flo-mat 4.0.1 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/__tests__/find-2-prong/get-medial/get-closest-points.spec.ts +49 -0
- package/browser/index.js +1153 -1205
- package/browser/index.min.js +1 -1
- package/node/closest-boundary-point/foot-and-endpoint-info.d.ts +0 -3
- package/node/closest-boundary-point/get-close-boundary-points-certified.d.ts +1 -1
- package/node/closest-boundary-point/get-close-boundary-points-certified.js +2 -2
- package/node/closest-boundary-point/get-close-boundary-points-certified.js.map +1 -1
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.d.ts +1 -2
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.js +34 -24
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.js.map +1 -1
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.d.ts +1 -1
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.js +6 -9
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.js.map +1 -1
- package/node/cp-node/fs/insert-cp-node.d.ts +2 -2
- package/node/cp-node/fs/insert-cp-node.js.map +1 -1
- package/node/cp-node/fs/is-order-correct.d.ts +2 -2
- package/node/cp-node/fs/is-order-correct.js.map +1 -1
- package/node/cp-node/fs/traverse-cp.js.map +1 -1
- package/node/cp-node/fs/traverse-vertices.d.ts +1 -1
- package/node/cp-node/fs/traverse-vertices.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-branch.d.ts +1 -1
- package/node/debug/functions/draw-elem/draw-branch.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-cp-node.d.ts +1 -1
- package/node/debug/functions/draw-elem/draw-cp-node.js +2 -2
- package/node/debug/functions/draw-elem/draw-cp-node.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-leaves.d.ts +1 -1
- package/node/debug/functions/draw-elem/draw-leaves.js +2 -2
- package/node/debug/functions/draw-elem/draw-leaves.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-mat.d.ts +1 -1
- package/node/debug/functions/draw-elem/draw-mat.js +1 -2
- package/node/debug/functions/draw-elem/draw-mat.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-min-y.d.ts +1 -1
- package/node/debug/functions/draw-elem/draw-min-y.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-three-prong.d.ts +1 -1
- package/node/debug/functions/draw-elem/draw-three-prong.js +2 -2
- package/node/debug/functions/draw-elem/draw-three-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-vertex.d.ts +1 -1
- package/node/debug/functions/draw-elem/draw-vertex.js +0 -2
- package/node/debug/functions/draw-elem/draw-vertex.js.map +1 -1
- package/node/error-analysis/gamma.d.ts +32 -0
- package/node/error-analysis/gamma.js +39 -0
- package/node/error-analysis/gamma.js.map +1 -0
- package/node/find-2-prong/find-2-prong.js +5 -5
- package/node/find-2-prong/find-2-prong.js.map +1 -1
- package/node/find-2-prong/get-medial/get-closest-points.js +27 -23
- package/node/find-2-prong/get-medial/get-closest-points.js.map +1 -1
- package/node/find-3-prong/calc-better-x.d.ts +1 -1
- package/node/find-3-prong/calc-better-x.js +6 -4
- package/node/find-3-prong/calc-better-x.js.map +1 -1
- package/node/find-3-prong/calc-initial-3-prong-center.d.ts +1 -1
- package/node/find-3-prong/calc-initial-3-prong-center.js +4 -3
- package/node/find-3-prong/calc-initial-3-prong-center.js.map +1 -1
- package/node/find-3-prong/find-3-prong-for-delta3s.js +22 -5
- package/node/find-3-prong/find-3-prong-for-delta3s.js.map +1 -1
- package/node/find-3-prong/find-and-add-3-prong.d.ts +2 -2
- package/node/find-3-prong/find-and-add-3-prong.js +15 -0
- package/node/find-3-prong/find-and-add-3-prong.js.map +1 -1
- package/node/find-3-prong/find-and-add-3-prongs-on-loop.js +8 -21
- package/node/find-3-prong/find-and-add-3-prongs-on-loop.js.map +1 -1
- package/node/find-3-prong/find-and-add-3-prongs.d.ts +1 -4
- package/node/find-3-prong/find-and-add-3-prongs.js +1 -2
- package/node/find-3-prong/find-and-add-3-prongs.js.map +1 -1
- package/node/find-3-prong/get-closest-points.d.ts +1 -1
- package/node/find-3-prong/get-closest-points.js +2 -2
- package/node/find-3-prong/get-closest-points.js.map +1 -1
- package/node/find-3-prong/timed-cc.d.ts +3 -0
- package/node/find-3-prong/timed-cc.js +5 -0
- package/node/find-3-prong/timed-cc.js.map +1 -0
- package/node/find-mat/create-initial-cp-tree.d.ts +2 -2
- package/node/find-mat/create-initial-cp-tree.js +2 -2
- package/node/find-mat/create-initial-cp-tree.js.map +1 -1
- package/node/find-mat/find-mat.d.ts +4 -4
- package/node/find-mat/find-mat.js.map +1 -1
- package/node/find-mat/find-mats.js +2 -2
- package/node/find-mat/find-mats.js.map +1 -1
- package/node/find-mat/get-meta.d.ts +2 -2
- package/node/find-mat/get-meta.js +1 -0
- package/node/find-mat/get-meta.js.map +1 -1
- package/node/index.d.ts +1 -0
- package/node/index.js +1 -0
- package/node/index.js.map +1 -1
- package/node/mat/create-new-cp-trees.d.ts +2 -2
- package/node/mat/create-new-cp-trees.js +2 -2
- package/node/mat/create-new-cp-trees.js.map +1 -1
- package/node/mat/get-cp-node-to-left-or-same.d.ts +2 -2
- package/node/mat/get-cp-node-to-left-or-same.js +2 -1
- package/node/mat/get-cp-node-to-left-or-same.js.map +1 -1
- package/node/mat/mat-meta.d.ts +2 -2
- package/node/point-on-shape/get-osculating-circle.js +2 -1
- package/node/point-on-shape/get-osculating-circle.js.map +1 -1
- package/package.json +5 -6
- package/src/closest-boundary-point/foot-and-endpoint-info.ts +0 -3
- package/src/closest-boundary-point/get-close-boundary-points-certified.ts +0 -2
- package/src/closest-boundary-point/get-potential-closest-points-on-curve-certified.ts +41 -27
- package/src/closest-boundary-point/root-interval-to-distance-squared-interval.ts +5 -10
- package/src/cp-node/fs/insert-cp-node.ts +2 -2
- package/src/cp-node/fs/is-order-correct.ts +2 -2
- package/src/cp-node/fs/traverse-cp.ts +1 -1
- package/src/cp-node/fs/traverse-vertices.ts +1 -2
- package/src/debug/functions/check-ordering.ts +0 -1
- package/src/debug/functions/draw-elem/draw-branch.ts +1 -3
- package/src/debug/functions/draw-elem/draw-cp-node.ts +3 -4
- package/src/debug/functions/draw-elem/draw-leaves.ts +3 -3
- package/src/debug/functions/draw-elem/draw-mat.ts +2 -5
- package/src/debug/functions/draw-elem/draw-min-y.ts +2 -2
- package/src/debug/functions/draw-elem/draw-three-prong.ts +3 -3
- package/src/debug/functions/draw-elem/draw-vertex.ts +1 -4
- package/src/error-analysis/gamma.ts +9 -2
- package/src/find-2-prong/find-2-prong.ts +7 -6
- package/src/find-2-prong/get-medial/get-closest-points.ts +24 -26
- package/src/find-3-prong/calc-better-x.ts +7 -4
- package/src/find-3-prong/calc-initial-3-prong-center.ts +2 -3
- package/src/find-3-prong/find-3-prong-for-delta3s.ts +23 -5
- package/src/find-3-prong/find-and-add-3-prong.ts +18 -4
- package/src/find-3-prong/find-and-add-3-prongs-on-loop.ts +7 -23
- package/src/find-3-prong/find-and-add-3-prongs.ts +5 -3
- package/src/find-3-prong/get-closest-points.ts +0 -2
- package/src/find-3-prong/timed-cc.ts +9 -0
- package/src/find-mat/create-initial-cp-tree.ts +3 -3
- package/src/find-mat/find-mat.ts +5 -6
- package/src/find-mat/find-mats.ts +4 -2
- package/src/find-mat/get-meta.ts +3 -3
- package/src/index.ts +2 -1
- package/src/mat/create-new-cp-trees.ts +3 -3
- package/src/mat/get-cp-node-to-left-or-same.ts +4 -3
- package/src/mat/mat-meta.ts +2 -2
- package/src/point-on-shape/get-osculating-circle.ts +2 -1
- package/wallaby.mjs +1 -0
- package/node/closest-boundary-point/get-p-from-box.d.ts +0 -3
- package/node/closest-boundary-point/get-p-from-box.js +0 -11
- package/node/closest-boundary-point/get-p-from-box.js.map +0 -1
package/browser/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t=[],e){const r=[],o={beziers:t,curves:r,idx:e};if(0===t.length)return o;let i,c=0;for(let e=0;e<t.length;e++){if(n(t[e]))continue;const s={loop:o,ps:t[e],prev:i,next:void 0,idx:c};i&&(i.next=s),i=s,r.push(s),c++}const s=r[r.length-1];return r[0].prev=s,s.next=r[0],s.ps[s.ps.length-1]=r[0].ps[0],o}function n(t){return 2===t.length?t[0][0]===t[1][0]&&t[0][1]===t[1][1]:3===t.length?t[0][0]===t[1][0]&&t[0][1]===t[1][1]&&t[1][1]===t[2][1]&&t[1][1]===t[2][1]:t[0][0]===t[1][0]&&t[0][1]===t[1][1]&&t[1][1]===t[2][1]&&t[1][1]===t[2][1]&&t[2][1]===t[3][1]&&t[2][1]===t[3][1]}function e(t){const n=[];for(let e=0;e<t.length;e++){const r=t[e];0===e&&n.push("M "+r[0][0].toString()+" "+r[0][1].toString()),4===r.length?n.push("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()+" "):3===r.length?n.push("Q "+r[1][0].toString()+" "+r[1][1].toString()+" "+r[2][0].toString()+" "+r[2][1].toString()+" "):2===r.length&&n.push("L "+r[1][0].toString()+" "+r[1][1].toString()+" ")}return n.push(" z"),n.join("\n")}class r{initialPoint=void 0;p;vals=void 0;prev2ndCubicControlPoint=void 0;prev2ndQuadraticControlPoint=void 0;constructor(){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 c={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 s(t){let n=0,e=0,r=1,o=0,i=1,c=1;const s=t._currentIndex;t._skipOptionalSpaces();let u=t._currentIndex;u<t._endIndex&&"+"===t._string[u]?(t._currentIndex+=1,u+=1):u<t._endIndex&&"-"===t._string[u]&&(t._currentIndex+=1,u+=1,i=-1);const f=t._string[u];if(u===t._endIndex||(f<"0"||f>"9")&&"."!==f)throw new Error(`The first character of a number must be one of [0-9+-.]. Found '${f}' at index ${u}.`);const l=t._currentIndex;for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)t._currentIndex+=1,u+=1;if(u!==l){let n=u-1,r=1;for(;n>=l;)e+=r*(Number(t._string[n])-0),n-=1,r*=10}if(u<t._endIndex&&"."===t._string[u]){if(t._currentIndex+=1,u+=1,u>=t._endIndex||t._string[u]<"0"||t._string[u]>"9")throw new Error("There must be a least one digit following the .");for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)r*=10,o+=Number(t._string.charAt(u))/r,t._currentIndex+=1,u+=1}if(u!==s&&u+1<t._endIndex&&("e"===t._string[u]||"E"===t._string[u])&&"x"!==t._string[u+1]&&"m"!==t._string[u+1]){if(t._currentIndex+=1,u+=1,"+"===t._string[u]?(t._currentIndex+=1,u+=1):"-"===t._string[u]&&(t._currentIndex+=1,u+=1,c=-1),u>=t._endIndex||t._string[u]<"0"||t._string[u]>"9")throw new Error("There must be an exponent.");for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)n*=10,n+=Number(t._string[u]),t._currentIndex+=1,u+=1}let a=e+o;if(a*=i,n&&(a*=Math.pow(10,c*n)),s===u)throw new Error("Internal error: startIndex === source._currentIndex");return t._skipOptionalSpacesOrDelimiter(),a}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{_string;_currentIndex;_endIndex;_prevCommand;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=[s(this)]:"M"===r||"L"===r||"T"===r?n=[s(this),s(this)]:"S"===r||"Q"===r?n=[s(this),s(this),s(this),s(this)]:"C"===r?n=[s(this),s(this),s(this),s(this),s(this),s(this)]:"A"===r?n=[s(this),s(this),s(this),this._parseArcFlag(),this._parseArcFlag(),s(this),s(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 s,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=c[l];if(!t)throw new Error("Invalid SVG - command not recognized.");const e=t(n);n.p=e[e.length-1],u.push(e)}s=l}else u.length&&("z"!==s&&u.push(o(n)),e.push(u),u=[]),n.initialPoint=n.p=n.vals,s=l}return u.length>0&&("z"!==s&&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 a(t,n,e="thin10 red nofill",r=0){if(0===n.length)return[];let o=`M${n[0][0][0]} ${n[0][0][1]} `;for(let t=0;t<n.length;t++){const e=n[t];if(e.length<=1)continue;const[,r,i,c]=e;o+=2===e.length?`L ${r[0]} ${r[1]} `:3===e.length?`Q ${r[0]} ${r[1]} ${i[0]} ${i[1]} `:`C ${r[0]} ${r[1]} ${i[0]} ${i[1]} ${c[0]} ${c[1]} `}const i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttributeNS(null,"d",o),i.setAttributeNS(null,"class",e),t.appendChild(i),[i]}function p(t){const n=t.length,e=Array.from(Array(n),()=>new Array(n).fill(0));for(let r=0;r<n;r++)for(let o=0;o<n;o++)e[r][o]=t[r][o];for(let t=0;t<n;t++)for(let r=0;r<n;r++)for(let o=0;o<n;o++)e[r][t]+e[t][o]<e[r][o]&&(e[r][o]=e[r][t]+e[t][o]);return e}function h(t){const n=t,e=[];do{e.push(t),t=t.next}while(t!==n);return e}function d(t){return h(t).filter(t=>t.isHoleClosing)}function g(t){const n=t.pointOnShape;return{idx:n.curve.idx,t:n.t,order:n.order,order2:n.order2}}function v(t){const n=t;let e=n,r=0;do{r++,e=e.nextOnCircle}while(e!==n);return r}function m(t,n=!1){const e=t,r=n?[]:[t];let o=t.nextOnCircle;for(;o!==e;)r.push(o),o=o.nextOnCircle;return r}function x(t){return t===t.next.prevOnCircle}function b(t){return m(t).filter(t=>!x(t)).length}function w(t){return m(t.prevOnCircle,!0).every(x)}function _(t){return 0===t.pointOnShape.circle.radius}function M(t){const n=t.pointOnShape,e=n.curve;return{...t,pos:n,p:n.p,t:n.t,isTerminating:x(t),isFullyTerminating:w(t),isSharp:_(t),prongCount:v(t),getRealProngCount:b(t),ordering:g(t),curve:e,loop:e.loop}}function S(t){let n=t;if(x(n))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 N(t,n){const e=h(t),r=new Set;for(t of e)x(t)||r.has(t.next.prevOnCircle)||n(t),r.add(t)}function I(t){const n=[],e=t;let r=e;for(;r!==e.prevOnCircle;)x(r)||n.push(r.next),r=r.nextOnCircle;return n}function y(t,n){n(t);const e=m(t).filter(t=>!x(t)).map(t=>t.next);for(const t of e){const e=[t];for(;e.length;){const t=e.pop();n(t),e.push(...I(t))}}}const E=["prev","next","prevOnCircle","nextOnCircle","holeCloserTwin"];function C(t){const n=new Map,e=O(t);n.set(t,e);const r=[{cpNode:t,newCpNode:e}];for(;r.length;){const{cpNode:t,newCpNode:e}=r.pop();for(const o of E){const i=t[o];if(void 0===i)continue;let c=n.get(i);c||(c=O(i),n.set(i,c),r.push({cpNode:i,newCpNode:c})),e[o]=c}}return e}function O(t){return{...t,prev:void 0,next:void 0,prevOnCircle:void 0,nextOnCircle:void 0,holeCloserTwin:void 0}}function T(t){const n=t,e=t.next,r=n.pointOnShape,o=e.pointOnShape,i=r.curve,c=o.curve;if(i.loop!==c.loop)return[];const s=[];return c===i?s.push({ps:r.curve.ps,ts:[r.t,o.t]}):(s.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?r:1;t.push({ps:o.ps,ts:[0,n]})}while(o!==e)}(s,r.curve,o.curve,o.t)),s}function A(t,n,e){if(4===t.length)return 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],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=p-n*(p-h),g=s-n*(s-f),v=f-n*(f-a),m=g-n*(g-v);return[e,[p,g],[d,m],[d-n*(d-(h-n*(h-(l-n*(l-i[0]))))),m-n*(m-(v-n*(v-(a-n*(a-i[1])))))]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=l-n*(l-i[0]),g=p-n*(p-h),v=h-n*(h-d),m=s-n*(s-f),x=f-n*(f-a),b=a-n*(a-i[1]),w=m-n*(m-x),_=x-n*(x-b);return[[g-n*(g-v),w-n*(w-_)],[v,_],[d,b],i]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=t[3],s=r[0],u=r[1],f=o[0],l=o[1],a=i[0],p=i[1],h=n*n,d=n*h,g=e*e,v=e*g,m=n*e,x=s-f,b=a-f,w=x+b,_=n*x,M=e*x,S=c[0]-s-3*b,N=u-l,I=p-l,y=N+I,E=n*N,C=e*N,O=c[1]-u-3*I;return[[d*S+(3*n*(n*w-x)+s),d*O+(3*n*(n*y-N)+u)],[m*(n*S+2*w)+(h*w+s-(M+2*_)),m*(n*O+2*y)+(h*y+u-(C+2*E))],[m*(e*S+2*w)+(g*w+s-(2*M+_)),m*(e*O+2*y)+(g*y+u-(2*C+E))],[v*S+(3*e*(e*w-x)+s),v*O+(3*e*(e*y-N)+u)]]}(t,n,e)}(t,n,e);if(3===t.length)return 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],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=c-u;return[e,[-n*l+i,-n*a+c],[f*(l+(o[0]-s))-(2*n*l-i),f*(a+(o[1]-u))-(2*n*a-c)]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=o[0]-s,p=c-u,h=o[1]-u;return[[f*(l+a)-(2*n*l-i),f*(p+h)-(2*n*p-c)],[n*a+s,n*h+u],o]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=n*n,a=e*e,p=n*e,h=c-u,d=h+(i[0]-u),g=s-f,v=g+(i[1]-f);return[[l*d-(2*n*h-c),l*v-(2*n*g-s)],[p*d-(h*(e+n)-c),p*v-(g*(e+n)-s)],[a*d-(2*e*h-c),a*v-(2*e*g-s)]]}(t,n,e)}(t,n,e);if(2===t.length)return 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[e,[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];return[[n*(r[0]-o)+o,n*(r[1]-i)+i],r]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1];return[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]]}(t,n,e)}(t,n,e);if(1===t.length)return t;throw new Error("The given bezier curve must be of order <= 3.")}function P(t){return T(t).map(t=>A(t.ps,t.ts[0],t.ts[1]))}function k(t,n){const{cpTrees:e}=n,r=t.prev,o=t.next;r.next=o,o.prev=r,e.get(t.pointOnShape.curve.loop).remove(t,!1)}function B(t,n){const e=v(t);if(2!==e)throw new Error(`Cannot delete \`CpNode\` on ${e}-prong`);m(t).forEach(t=>k(t,n))}function z(t){const n=[],e=t.next;let r=e;do{n.push(r),r=r.nextOnCircle}while(r.nextOnCircle!==e);return n}function F(t,n,e){if(void 0===t.size||void 0===e)return;const r=e[n];if(t.size>r&&void 0!==r)for(const[n]of t){t.delete(n);break}}const Y=[function(t,n){let e,r=!1;return function(){return r||(e=t(),r=!0),e}},function(t,n,e=!1){const r=new WeakMap,o=new Map;function i(t){return"object"!=typeof t&&"function"!=typeof t||null===t?o:r}const c=function(r){let c;const s=i(r);return s.has(r)?(e&&console.log("cache hit"),c=s.get(r)):(e&&console.log("cache miss"),c=t(r),s.set(r,c),F(o,0,n)),c};return c.mapS=o,c.weakMapS=r,c.clearCache=function(){o.clear()},c.addToCache=function(t,e){const r=i(e);r.set(e,t),F(r,1,n)},c},function(t,n){const e=new WeakMap,r=new Map;function o(t,o){const i=("object"==typeof o||"function"==typeof o)&&null!==o;let c="object"!=typeof t&&"function"!=typeof t||null===t?r:e,s=c.get(t);return void 0===s&&(s={weakMap:new WeakMap,map:new Map},c.set(t,s),F(c,0,n)),i?s.weakMap:s.map}function i(e,r){const i=o(e,r);let c;return i.has(r)?c=i.get(r):(c=t(e,r),i.set(r,c),F(i,1,n)),c}return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r){const i=o(e,r);i.set(r,t),F(i,1,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i){const c=("object"==typeof o||"function"==typeof o)&&null!==o,s=("object"==typeof i||"function"==typeof i)&&null!==i;let u="object"!=typeof t&&"function"!=typeof t||null===t?r:e,f=u.get(t);void 0===f&&(f={weakMap:new WeakMap,map:new Map},u.set(t,f),F(u,0,n));const l=c?f.weakMap:f.map;let a=l.get(o);return void 0===a&&(a={weakMap:new WeakMap,map:new Map},l.set(o,a),F(l,1,n)),s?a.weakMap:a.map}const i=function(e,r,i){const c=o(e,r,i);let s;return c.has(i)?s=c.get(i):(s=t(e,r,i),c.set(i,s),F(c,2,n)),s};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i){const c=o(e,r,i);c.set(i,t),F(c,2,n)},i},function(t,n,e=!1){const r=new WeakMap,o=new Map;function i(t,e,i,c){const s=("object"==typeof e||"function"==typeof e)&&null!==e,u=("object"==typeof i||"function"==typeof i)&&null!==i,f=("object"==typeof c||"function"==typeof c)&&null!==c;let l="object"!=typeof t&&"function"!=typeof t||null===t?o:r,a=l.get(t);void 0===a&&(a={weakMap:new WeakMap,map:new Map},l.set(t,a),F(l,0,n));const p=s?a.weakMap:a.map;let h=p.get(e);void 0===h&&(h={weakMap:new WeakMap,map:new Map},p.set(e,h),F(p,1,n));const d=u?h.weakMap:h.map;let g=d.get(i);return void 0===g&&(g={weakMap:new WeakMap,map:new Map},d.set(i,g),F(d,2,n)),f?g.weakMap:g.map}const c=function(r,o,c,s){const u=i(r,o,c,s);let f;return u.has(s)?(e&&console.log("cache hit"),f=u.get(s)):(e&&console.log("cache miss"),f=t(r,o,c,s),u.set(s,f),F(u,3,n)),f};return c.mapS=o,c.weakMapS=r,c.clearCache=function(){o.clear()},c.addToCache=function(t,e,r,o,c){const s=i(e,r,o,c);s.set(c,t),F(s,3,n)},c},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s){const u=("object"==typeof o||"function"==typeof o)&&null!==o,f=("object"==typeof i||"function"==typeof i)&&null!==i,l=("object"==typeof c||"function"==typeof c)&&null!==c,a=("object"==typeof s||"function"==typeof s)&&null!==s;let p="object"!=typeof t&&"function"!=typeof t||null===t?r:e,h=p.get(t);void 0===h&&(h={weakMap:new WeakMap,map:new Map},p.set(t,h),F(p,0,n));const d=u?h.weakMap:h.map;let g=d.get(o);void 0===g&&(g={weakMap:new WeakMap,map:new Map},d.set(o,g),F(d,1,n));const v=f?g.weakMap:g.map;let m=v.get(i);void 0===m&&(m={weakMap:new WeakMap,map:new Map},v.set(i,m),F(v,2,n));const x=l?m.weakMap:m.map;let b=x.get(c);return void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(c,b),F(x,3,n)),a?b.weakMap:b.map}const i=function(e,r,i,c,s){const u=o(e,r,i,c,s);let f;return u.has(s)?f=u.get(s):(f=t(e,r,i,c,s),u.set(s,f),F(u,4,n)),f};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s){const u=o(e,r,i,c,s);u.set(s,t),F(u,4,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u){const f=("object"==typeof o||"function"==typeof o)&&null!==o,l=("object"==typeof i||"function"==typeof i)&&null!==i,a=("object"==typeof c||"function"==typeof c)&&null!==c,p=("object"==typeof s||"function"==typeof s)&&null!==s,h=("object"==typeof u||"function"==typeof u)&&null!==u;let d="object"!=typeof t&&"function"!=typeof t||null===t?r:e,g=d.get(t);void 0===g&&(g={weakMap:new WeakMap,map:new Map},d.set(t,g),F(d,0,n));const v=f?g.weakMap:g.map;let m=v.get(o);void 0===m&&(m={weakMap:new WeakMap,map:new Map},v.set(o,m),F(v,1,n));const x=l?m.weakMap:m.map;let b=x.get(i);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(i,b),F(x,2,n));const w=a?b.weakMap:b.map;let _=w.get(c);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(c,_),F(w,3,n));const M=p?_.weakMap:_.map;let S=M.get(s);return void 0===S&&(S={weakMap:new WeakMap,map:new Map},M.set(s,S),F(M,4,n)),h?S.weakMap:S.map}const i=function(e,r,i,c,s,u){const f=o(e,r,i,c,s,u);let l;return f.has(u)?l=f.get(u):(l=t(e,r,i,c,s,u),f.set(u,l),F(f,5,n)),l};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u){const f=o(e,r,i,c,s,u);f.set(u,t),F(f,5,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u,f){const l=("object"==typeof o||"function"==typeof o)&&null!==o,a=("object"==typeof i||"function"==typeof i)&&null!==i,p=("object"==typeof c||"function"==typeof c)&&null!==c,h=("object"==typeof s||"function"==typeof s)&&null!==s,d=("object"==typeof u||"function"==typeof u)&&null!==u,g=("object"==typeof f||"function"==typeof f)&&null!==f;let v="object"!=typeof t&&"function"!=typeof t||null===t?r:e,m=v.get(t);void 0===m&&(m={weakMap:new WeakMap,map:new Map},v.set(t,m),F(v,0,n));const x=l?m.weakMap:m.map;let b=x.get(o);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(o,b),F(x,1,n));const w=a?b.weakMap:b.map;let _=w.get(i);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(i,_),F(w,2,n));const M=p?_.weakMap:_.map;let S=M.get(c);void 0===S&&(S={weakMap:new WeakMap,map:new Map},M.set(c,S),F(M,3,n));const N=h?S.weakMap:S.map;let I=N.get(s);void 0===I&&(I={weakMap:new WeakMap,map:new Map},N.set(s,I),F(N,4,n));const y=d?I.weakMap:I.map;let E=y.get(u);return void 0===E&&(E={weakMap:new WeakMap,map:new Map},y.set(u,E),F(y,5,n)),g?E.weakMap:E.map}const i=function(e,r,i,c,s,u,f){const l=o(e,r,i,c,s,u,f);let a;return l.has(f)?a=l.get(f):(a=t(e,r,i,c,s,u,f),l.set(f,a),F(l,6,n)),a};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u,f){const l=o(e,r,i,c,s,u,f);l.set(f,t),F(l,6,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u,f,l){const a=("object"==typeof o||"function"==typeof o)&&null!==o,p=("object"==typeof i||"function"==typeof i)&&null!==i,h=("object"==typeof c||"function"==typeof c)&&null!==c,d=("object"==typeof s||"function"==typeof s)&&null!==s,g=("object"==typeof u||"function"==typeof u)&&null!==u,v=("object"==typeof f||"function"==typeof f)&&null!==f,m=("object"==typeof l||"function"==typeof l)&&null!==l;let x="object"!=typeof t&&"function"!=typeof t||null===t?r:e,b=x.get(t);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(t,b),F(x,0,n));const w=a?b.weakMap:b.map;let _=w.get(o);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(o,_),F(w,1,n));const M=p?_.weakMap:_.map;let S=M.get(i);void 0===S&&(S={weakMap:new WeakMap,map:new Map},M.set(i,S),F(M,2,n));const N=h?S.weakMap:S.map;let I=N.get(c);void 0===I&&(I={weakMap:new WeakMap,map:new Map},N.set(c,I),F(N,3,n));const y=d?I.weakMap:I.map;let E=y.get(s);void 0===E&&(E={weakMap:new WeakMap,map:new Map},y.set(s,E),F(y,4,n));const C=g?E.weakMap:E.map;let O=C.get(u);void 0===O&&(O={weakMap:new WeakMap,map:new Map},C.set(u,O),F(C,5,n));const T=v?O.weakMap:O.map;let A=T.get(f);return void 0===A&&(A={weakMap:new WeakMap,map:new Map},T.set(f,A),F(T,6,n)),m?A.weakMap:A.map}const i=function(e,r,i,c,s,u,f,l){const a=o(e,r,i,c,s,u,f,l);let p;return a.has(l)?p=a.get(l):(p=t(e,r,i,c,s,u,f,l),a.set(l,p),F(a,7,n)),p};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u,f,l){const a=o(e,r,i,c,s,u,f,l);a.set(l,t),F(a,7,n)},i}];function L(t,n,e=!1){const r=t.length;if(r>8)throw new Error("A maximum of 8 formal parameters are supported");return(0,Y[r])(t,n,e)}function X(t,n){const[[e,r],[o,i]]=t,[[c,s],[u,f]]=n,l=o-e,a=i-r,p=u-c,h=f-s,d=p*a-h*l;if(0===d)return;const g=((s-r)*l-(c-e)*a)/d;return[c+g*p,s+g*h]}function H(t,n){return[n[0]-t[0],n[1]-t[1]]}function V(t,n){return t[0]*n[0]+t[1]*n[1]}function $(t){return[-t[1],t[0]]}function D(t,n){return t[0]*n[1]-t[1]*n[0]}function q(t,n,e){return[t[0]+(n[0]-t[0])*e,t[1]+(n[1]-t[1])*e]}function j(t,n){function e(n){return[t[0]+n[0],t[1]+n[1]]}return void 0===n?e:e(n)}function W(t){const n=1/Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]*n,t[1]*n]}function Q(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 R(t,n){let e=0;for(let r=0;r<t.length;r++)e=e*n+t[r];return e}function G(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[3*(s-n+3*(r-i)),6*(i+n-2*r),3*(r-n)],[3*(u-e+3*(o-c)),6*(c+e-2*o),3*(o-e)]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,c]]=t;return[[2*(i+n-2*r),2*(r-n)],[2*(c+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 U(t,n){const[e,r]=G(t);return[R(e,n),R(r,n)]}function Z(t,n){const e=t-n,r=t-e;return[t-(e+r)+(r-n),e]}function J(t,n){const e=t.length,r=n.length;let o=0,i=0;const c=[];for(;o<e&&i<r;)0!==t[o]?0!==n[i]?Math.abs(t[o])<=Math.abs(n[i])?(c.push(t[o]),o++):(c.push(n[i]),i++):i++:o++;for(;o<e;)c.push(t[o]),o++;for(;i<r;)c.push(n[i]),i++;if(0===c.length)return[0];const s=c.length;if(1===s)return c;const u=[],f=c[1],l=c[0];let a=f+l;const p=l-(a-f);0!==p&&u.push(p),i=0;for(let t=2;t<s;t++){const n=c[t],e=a+n,r=e-a,o=a-(e-r)+(n-r);0!==o&&u.push(o),a=e}return 0===a&&0!==u.length||u.push(a),u}const K=134217729;function tt(t,n){const e=t.length;let r;const o=t[0];let i=o*n;const c=K*o,s=c-(c-o),u=o-s,f=K*n,l=f-(f-n),a=n-l,p=[],h=u*a-(i-s*l-u*l-s*a);0!==h&&p.push(h);for(let o=1;o<e;o++){const e=t[o],c=e*n,s=K*e,u=s-(s-e),f=e-u,l=K*n,a=l-(l-n),h=n-a,d=f*h-(c-u*a-f*a-u*h),g=i+d,v=g-i,m=i-(g-v)+(d-v);0!==m&&p.push(m),r=g;const x=c+r,b=r-(x-c);0!==b&&p.push(b),i=x}return 0===i&&0!==p.length||p.push(i),p}function nt(t,n){const e=n.length;let r;const o=n[0];let i=o*t;const c=K*o,s=c-(c-o),u=o-s,f=K*t,l=f-(f-t),a=t-l,p=[],h=u*a-(i-s*l-u*l-s*a);0!==h&&p.push(h);for(let o=1;o<e;o++){const e=n[o],c=e*t,s=K*e,u=s-(s-e),f=e-u,l=K*t,a=l-(l-t),h=t-a,d=f*h-(c-u*a-f*a-u*h),g=i+d,v=g-i,m=i-(g-v)+(d-v);0!==m&&p.push(m),r=g;const x=c+r,b=r-(x-c);0!==b&&p.push(b),i=x}return 0===i&&0!==p.length||p.push(i),p}const et=tt,rt=J;function ot(t,n){let e=[0];for(let r=0;r<t.length;r++)e=rt(e,et(n,t[r]));return e}function it(t){let n=t[0];for(let e=1;e<t.length;e++)n+=t[e];return n}function ct(t){const n=t.length,e=new Array(n);for(let r=0;r<n;r++)e[r]=-t[r];return e}const st=ct,ut=J;function ft(t,n){const e=st(n);return ut(t,e)}function lt(t){return t[t.length-1]}const at=Z,pt=nt;function ht(t){if(4===t.length){const[[n,e],[r,o]]=t;return[pt(3,at(r,n)),pt(3,at(o,e))]}if(3===t.length){const[[n,e],[r,o]]=t;return[at(2*r,2*n),at(2*o,2*e)]}if(2===t.length){const[[n,e],[r,o]]=t;return[at(r,n),at(o,e)]}if(1===t.length)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}function dt(t,n){const e=t+n,r=e-t;return[t-(e-r)+(n-r),e]}function gt(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,c=i-r,s=r-(i-c)+(e-c);0!==s&&o.push(s),r=i}return 0===r&&0!==o.length||o.push(r),o}const vt=dt,mt=nt,xt=gt;function bt(t){if(4===t.length){const[[n,e],[r,o],[i,c]]=t;return[mt(6,xt(vt(i,n),-2*r)),mt(6,xt(vt(c,e),-2*o))]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[xt(vt(2*i,2*n),-4*r),xt(vt(2*c,2*e),-4*o)]}if(t.length<=2)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3")}const wt=Z,_t=nt,Mt=J;function St(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[_t(6,Mt(wt(s,n),_t(3,wt(r,i))))],[_t(6,Mt(wt(u,e),_t(3,wt(o,c))))]]}if(t.length<=3)return[[[0]],[[0]]];throw new Error("The given bezier curve must be of order <= 3.")}const{sign:Nt}=Math;function It(t,n){const[e,r]=ht(t),[o,i]=bt(t),[c,s]=ht(n),[u,f]=bt(n),l=ft(ot(e,i),ot(r,o)),a=ft(ot(c,f),ot(s,u)),p=lt(l),h=lt(a);if(Nt(p)!==Nt(h))return p-h;const d=J(ot(c,c),ot(s,s)),g=J(ot(e,e),ot(r,r)),v=ot(d,d),m=ot(v,d),x=ot(g,g),b=ot(x,g);if(0!==p||0!==h){const t=ot(l,l),n=ot(a,a),e=lt(ft(ot(t,m),ot(n,b)));if(0!==e)return p>0?e:-e}const[[w],[_]]=St(t),[[M],[S]]=St(n),N=ft(ot(e,_),ot(r,w)),I=J(ot(e,o),ot(r,i)),y=ft(ot(c,S),ot(s,M)),E=J(ot(c,u),ot(s,f)),C=ft(ot(g,N),tt(ot(l,I),3)),O=ft(ot(d,y),tt(ot(a,E),3)),T=lt(C),A=lt(O);if(T!==A)return T-A;if(0===T&&0===A)return 0;const P=ot(C,C),k=ot(v,m),B=ot(O,O),z=ot(x,b),F=lt(ft(ot(P,k),ot(B,z)));return T>0?F:-F}function yt(t,n){return t[0]===n[0]&&t[1]===n[1]}function Et(t,n){const{ccw:e,tangentI:r,tangentO:o,dotTangents:i}=function(t,n){const e=t.length;let r=t[e-2],o=n[0],i=n[1];yt(r,o)&&(r=t[e-3]),yt(o,i)&&(i=n[2]);const c=function(t,n,e){const r=Z(t[0],e[0]),o=Z(n[1],e[1]),i=Z(t[1],e[1]),c=Z(n[0],e[0]);return it(J(ot(r,o),ct(ot(i,c))))}(r,o,i),s=[Z(o[0],r[0]),Z(o[1],r[1])],u=[Z(i[0],o[0]),Z(i[1],o[1])],f=function(t,n){return it(J(ot(t[0],n[0]),ot(t[1],n[1])))}(s,u);return 0!==c||f>0?{ccw:c,tangentI:s,tangentO:u,dotTangents:f}:{ccw:It(t.slice().reverse(),n),tangentI:s,tangentO:u,dotTangents:f}}(t,n),c=e<0,s=e>0,u=[W(r.map(t=>t[1])),W(o.map(t=>t[1]))],f=D(u[0],u[1]);let l,a;return i>0?(l=f<-.0698,a=f>.0698):(l=c,a=s),{tangents:u,isSharp:c,isDull:s,isQuiteSharp:l,isQuiteDull:a}}const Ct=L(function(t){const{t:n,curve:e}=t;return Et(1===n?e.ps:e.prev.ps,1===n?e.next.ps:e.ps)});function Ot(t){return 0===t.t||1===t.t}function Tt(t){return!!Ot(t)&&Ct(t).isSharp}function At(t){const n=t.pointOnShape.circle.center,e=t,r=t.nextOnCircle,o=e.pointOnShape,i=r.pointOnShape,c=o.p,s=i.p;let u;if(Tt(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=W(U(t.ps,0)),r=[-(f=W(U(n.ps,1)))[0],-f[1]],i=V(e,r),c=Math.sqrt((1+i)/2);u=Q(Math.sqrt((1-i)/2),c,r)}else u=c[0]===s[0]&&c[1]===s[1]?H(c,n):$(H(c,s));var f;return[n,j(W(u),n)]}const{abs:Pt}=Math,kt=1e-4;function Bt(t,n){const e=t.pointOnShape.circle.center,r=At(t),o=n.pointOnShape.circle.center,i=At(n.prevOnCircle),c=X(r,i),s=H(e,o);let u;if(c){const t=H(e,c),n=H(o,c);u=V(t,s)<0||V(n,s)>0}else u=!0;if(!u)return[e,c,o];const f=$(s),l=H(r[0],r[1]),a=H(i[0],i[1]),p=Pt(D(s,l))/9,h=Pt(D(s,a))/9;if(p>.01||h>.01)return[e,o];if(p>kt||h>kt){const t=q(e,o,1/3),n=q(e,o,2/3),c=j(f,t),s=[n,j(f,n)];return[e,X(r,[t,c]),X(i,s),o]}return[e,o]}function zt(t){return Bt(t,t.next)}function Ft(t){const n=t;let e=n;for(;e.next===e.prevOnCircle;)if(e=e.next,e===n)return;return e}function Yt(t,n){return m(t).indexOf(n)>=0}function Lt(t){return 1===b(t)&&!t.isHoleClosing}function Xt(t){return 2===b(t)}function Ht(t){return m(t).every(x)}function Vt(t){if(Ht(t))return[];for(;x(t);)t=t.nextOnCircle;for(t=t.next;2===b(t);)t=t.next;t=t.prevOnCircle;const n=[];do{n.push(t),t=t.next}while(!w(t)&&2===b(t));return n}function $t(t){return Vt(t).map(t=>zt(t))}function Dt(t,n){const e=n[0]-t[0],r=n[1]-t[1];return Math.sqrt(e*e+r*r)}function qt(t,n){const[e,r]=t,[[o,i],[c,s]]=n;return Dt([o+e*(c-o),i+e*(s-i)],[o+r*(c-o),i+r*(s-i)])}function jt(t,n,e=16){if(n[0]===n[1])return 0;const{weights:r,abscissas:o}=Wt[e],[i,c]=n;let s=0;const u=(c-i)/2,f=(c+i)/2;for(let n=0;n<=e-1;n++)s+=r[n]*t(u*o[n]+f);return u*s}L(zt);const Wt={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 Qt(t){const[n,e]=G(t);return function(t){const r=R(n,t),o=R(e,t);return Math.sqrt(r*r+o*o)}}const Rt=Math.abs,Gt=[[0,0],[0,0],[0,0]];function Ut(t,n,e){return 0===n?1===e?{ps:t,_ps:Gt}:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=c-u,d=[[i,c],[-n*p+i,-n*h+c],[a*(p+(f-s))-(2*n*p-i),a*(h+(l-u))-(2*n*h-c)]],g=Rt(n),v=Rt(i),m=Rt(s),x=Rt(f),b=v+m,w=Rt(c),_=Rt(u),M=w+_;return{ps:d,_ps:[[0,0],[g*b+v,g*M+w],[a*(b+(x+m))+(2*g*b+v),a*(M+(Rt(l)+_))+(2*g*M+w)]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=f-s,d=c-u,g=l-u,v=[[a*(p+h)-(2*n*p-i),a*(d+g)-(2*n*d-c)],[n*h+s,n*g+u],[f,l]],m=Rt(n),x=Rt(i),b=Rt(s),w=x+b,_=Rt(f)+b,M=Rt(c),S=Rt(u),N=M+S;return{ps:v,_ps:[[a*(w+_)+(2*m*w+x),a*(N+(Rt(l)+S))+(2*m*N+M)],[m*_+b,0],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=i[0],a=i[1],p=n*n,h=e*e,d=n*e,g=c-u,v=g+(l-u),m=s-f,x=m+(a-f),b=p*v-(2*n*g-c),w=d*v-(g*(e+n)-c),_=h*v-(2*e*g-c),M=p*x-(2*n*m-s),S=d*x-(m*(e+n)-s),N=h*x-(2*e*m-s),I=Rt(n),y=Rt(e),E=Rt(d),C=Rt(c),O=Rt(u),T=C+O,A=T+Rt(l)+O,P=Rt(s),k=Rt(f),B=P+k,z=B+Rt(a)+k;return{ps:[[b,M],[w,S],[_,N]],_ps:[[p*A+(2*I*T+C),p*z+(2*I*B+P)],[E*A+(T*(y+I)+C),E*x+(B*(y+I)+P)],[h*A+(2*y*T+C),h*z+(2*y*B+P)]]}}(t,n,e)}const Zt=134217729;function Jt(t,n){const e=t*n,r=Zt*t,o=r-(r-t),i=t-o,c=Zt*n,s=c-(c-n),u=n-s;return[i*u-(e-o*s-i*s-o*u),e]}function Kt(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=r+i,s=c-r,u=e+o,f=u-e,l=r-(c-s)+(i-s)+u,a=c+l,p=e-(u-f)+(o-f)+(l-(a-c)),h=a+p;return[p-(h-a),h]}function tn(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=r-i,s=c-r,u=e-o,f=u-e,l=r-(c-s)+(-i-s)+u,a=c+l,p=e-(u-f)+(-o-f)+(l-(a-c)),h=a+p;return[p-(h-a),h]}const{atan2:nn}=Math,en=Jt;function rn(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=tn(en(i,e),en(o,r))[1],s=Kt(en(o,e),en(i,r))[1];return nn(c,s)}const{abs:on}=Math;function cn(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+=on(rn(n[t],n[t+1]));return r}function sn(t,n=.4,e=2**-16){const r=[0],o=[1];for(;;){const i=r[r.length-1],c=o[o.length-1];if(cn(A(t,i,c))<=n||c-i<=e){if(r.push(o.pop()),1===c)return r;continue}const s=(i+c)/2;o.push(s)}}function un(t,n,e=.4,r=16){const o=t[0],i=t[1];if(o===i)return 0;const[[c,s],[u,f],[l,a]]=n;if(c===u&&u===l&&s===f&&f===a)return 0;const p=Ut(n,o,i).ps,h=sn(p,e);let d=0;for(let t=0;t<h.length-1;t++){const n=h[t],e=h[t+1];d+=jt(Qt(p),[n,e],r)}return d}const fn=Math.abs,ln=[[0,0],[0,0],[0,0],[0,0]];function an(t,n,e){return 0===n?1===e?{ps:t,_ps:ln}:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=d-n*(d-g),m=v-n*(v-(g-n*(g-(l-n*(l-p))))),x=s-n*(s-f),b=f-n*(f-a),w=x-n*(x-b),_=w-n*(w-(b-n*(b-(a-n*(a-h))))),M=fn(n),S=fn(c),N=fn(u),I=fn(l),y=fn(p),E=fn(s),C=fn(f),O=fn(a),T=S+M*(S+N),A=N+M*(N+I),P=T+M*(T+A),k=E+M*(E+C),B=C+M*(C+O),z=k+M*(k+B);return{ps:[[c,s],[d,x],[v,w],[m,_]],_ps:[[0,0],[T,k],[P,z],[P+M*(P+(A+M*(A+(I+M*(I+y))))),z+M*(z+(B+M*(B+(O+M*(O+fn(h))))))]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=l-n*(l-p),m=d-n*(d-g),x=g-n*(g-v),b=m-n*(m-x),w=s-n*(s-f),_=f-n*(f-a),M=a-n*(a-h),S=w-n*(w-_),N=_-n*(_-M),I=S-n*(S-N),y=fn(n),E=fn(c),C=fn(u),O=fn(l),T=fn(p),A=fn(s),P=fn(f),k=fn(a),B=E+y*(E+C),z=C+y*(C+O),F=O+y*(O+T),Y=B+y*(B+z),L=z+y*(z+F),X=A+y*(A+P),H=P+y*(P+k),V=k+y*(k+fn(h)),$=X+y*(X+H),D=H+y*(H+V);return{ps:[[b,I],[x,N],[v,M],[p,h]],_ps:[[Y+y*(Y+L),$+y*($+D)],[L,D],[F,V],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=t[3],s=r[0],u=r[1],f=o[0],l=o[1],a=i[0],p=i[1],h=n*n,d=n*h,g=e*e,v=e*g,m=n*e,x=s-f,b=a-f,w=c[0]-s,_=x+b,M=n*x,S=e*x,N=w-3*b,I=u-l,y=p-l,E=c[1]-u,C=I+y,O=n*I,T=e*I,A=E-3*y,P=d*N+(3*n*(n*_-x)+s),k=m*(n*N+2*_)+(h*_+s-(S+2*M)),B=m*(e*N+2*_)+(g*_+s-(2*S+M)),z=v*N+(3*e*(e*_-x)+s),F=d*A+(3*n*(n*C-I)+u),Y=m*(n*A+2*C)+(h*C+u-(T+2*O)),L=m*(e*A+2*C)+(g*C+u-(2*T+O)),X=v*A+(3*e*(e*C-I)+u),H=fn(n),V=fn(e),$=fn(m),D=fn(d),q=fn(v),j=fn(s),W=fn(f),Q=j+W,R=fn(a)+W,G=Q+R,U=H*Q,Z=V*Q,J=fn(w)+3*R,K=fn(u),tt=fn(l),nt=K+tt,et=fn(p)+tt,rt=nt+et,ot=H*nt,it=V*nt,ct=fn(E)+3*et;return{ps:[[P,F],[k,Y],[B,L],[z,X]],_ps:[[D*J+(3*H*(H*G+Q)+j),D*ct+(3*H*(H*rt+nt)+K)],[$*(H*J+2*G)+(h*G+j+(Z+2*U)),$*(H*ct+2*rt)+(h*rt+K+(it+2*ot))],[$*(V*J+2*G)+(g*G+j+(2*Z+U)),$*(V*ct+2*rt)+(g*rt+K+(2*it+ot))],[q*J+(3*V*(V*G+Q)+j),q*ct+(3*V*(V*rt+nt)+K)]]}}(t,n,e)}function pn(t,n,e=.4,r=16){const o=t[0],i=t[1];if(o===i)return 0;const[[c,s],[u,f],[l,a],[p,h]]=n;if(c===u&&u===l&&l===p&&s===f&&f===a&&a===h)return 0;const d=an(n,o,i).ps,g=sn(d,e);let v=0;for(let t=0;t<g.length-1;t++){const n=g[t],e=g[t+1];v+=jt(Qt(d),[n,e],r)}return v}function hn(t,n=.4,e=16){if(4===t.length)return pn([0,1],t,n,e);if(3===t.length)return un([0,1],t,n,e);if(2===t.length)return qt([0,1],t);if(1===t.length)return 0;throw new Error("The given bezier curve must be of order <= 3.")}function dn(t,n,e=!0){const{cpNodes:r,hasHoleCloser:o}=function(t,n,e=!0){if(!e&&t===n)return{cpNodes:[],hasHoleCloser:!1};const r=t,o=[r];let i=t.next,c=r.isHoleClosing;for(;i!==n&&i!==r;)i.isHoleClosing&&(c=!0),o.push(i),i=i.next;return{cpNodes:o,hasHoleCloser:c}}(t,n,e);return{pss:r.flatMap(P),hasHoleCloser:o}}function gn(t){const n=t,e=t.nextOnCircle,r=Dt(n.pointOnShape.p,e.pointOnShape.p),{pss:o,hasHoleCloser:i}=dn(n,e),c=function(t){let n=0;for(let e of t)n+=e;return n}(o.map(t=>hn(t)));return i?1/0:c/r}function vn(t,n){let e=t;const r=[];for(;e!==n;){const t=Bt(e,e.next);r.push(t),e=e.next}return r}function mn(t,n){const e=D(W(U(zt(t),0)),W(U(zt(n),0)));return Math.abs(Math.asin(e)*(180/Math.PI))}function xn(t){const n=[];return y(t,t=>{n.push(t)}),n}function bn(t,n){let e;return e=t.curve.idx-n.curve.idx,0!==e||(e=t.t-n.t,0!==e||(e=t.order-n.order,0!==e||(e=t.order2-n.order2))),e}function wn(t,n){return bn(t.pointOnShape,n.pointOnShape)}const _n={getChildren:z,getVertexForwardChildren:I,getAllOnLoop:h,getAllOnCircle:m,isOnSameCircle:Yt,isTerminating:x,isFullyTerminating:w,getFirstExit:Ft,isSharp:_,isOneProng:Lt,getProngCount:v,getRealProngCount:b,cpNodeComparator:wn,enhanceCpNode:M,traverseCp:S,traverseEdges:N,traverseVertices:y,clone:C,getBoundaryBezierPartsToNext:T,getBoundaryBeziersToNext:P,removeVertex:B,getMatCurveToNext:zt,isTwoProng:Xt,getBranch:Vt,getBranchBeziers:$t,getSalience:gn,getMatCurveBetween:Bt,getEdgeDirection:At,getBoundaryBeziersBetween:dn,getMatCurvesBetween:vn,getHoleClosers:d,getInitialDegAngleBetweenMatCurves:mn,getAllVertices:xn};function Mn(t){return n=>m(n).some(t)}const Sn=Mn(function(t){return 2!==b(t)&&!t.isHoleClosing});function Nn(t){const n=new Array(t.length);for(let e=0;e<t.length;e++)n[e]=-t[e];return n}function In(t){return n=>1/t(n.toReversed())}function yn(t){const n=t.length-1;if(n<1)return 0;t[0]<0&&(t=Nn(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=1/0,i=!1;for(let r=0;r<o;r++){if(t[r]<=0)continue;const c=(-t[o]/(t[r]/2**e[r]))**(1/(o-r));e[r]++,n>c&&(n=c),i=!0}i&&r<n&&(r=n)}return r}In(yn);const En=(Cn=yn,t=>-Cn(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==(n-1)%2&&(e[t]=-e[t]);return e}(t)));var Cn;In(En);const{min:On,max:Tn}=Math,{abs:An}=Math;function Pn(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 c=i-(r-e);c&&(n[--o]=r,r=c)}let i=0;for(let t=o;t<e;++t){const e=n[t],o=r;r=e+o;const c=o-(r-e);c&&(n[i++]=c)}return n[i++]=r,n.length=i,n}const kn=Number.EPSILON,Bn=Number.EPSILON/2,zn=Bn*Bn,Fn=Ln(1),Yn=function(){const t=3*zn;return t/(1-t)}();function Ln(t){const n=t*Bn;return n/(1-n)}new Array(20).fill(0).map((t,n)=>Ln(n));const{abs:Xn}=Math,{abs:Hn}=Math,Vn=134217729;function $n(t,n){const e=n[0],r=n[1],o=r*t,i=Vn*r,c=i-(i-r),s=r-c,u=Vn*t,f=u-(u-t),l=t-f,a=s*l-(o-c*f-s*f-c*l)+e*t,p=o+a;return[a-(p-o),p]}const{abs:Dn}=Math;function qn(t,n,e){const r=t.length-1;if(r<0)return[[],[]];const o=Dn(n),i=t.slice(),c=e.slice();for(let t=0;t<=r;t++)for(let e=1;e<=r-t;e++){const t=i[e-1],r=c[e-1],s=$n(n,t),u=o*r+Dn(s[1]),f=i[e];i[e]=Kt(f,s),c[e]=c[e]+u+Dn(i[e][1])}return[i,c]}const jn=2**27+1;function Wn(t,n){const e=t[1],r=n[1],o=e*r,i=jn*e,c=i-(i-e),s=e-c,u=jn*r,f=u-(u-r),l=r-f,a=s*l-(o-c*f-s*f-c*l)+(e*n[0]+t[0]*r),p=o+a;return[a-(p-o),p]}const{abs:Qn}=Math;function Rn(t,n){const e=t.length-1;if(e<0)return[];const r=t.slice();for(let t=0;t<=e;t++)for(let o=1;o<=e-t;o++)r[o]=Pn(J(r[o],tt(r[o-1],n)));return r}function Gn(t,n){const e=t.length-1;if(e<0)return[];const r=new Array(e+1);r[e]=t[e];let o=[1];for(let i=1;i<=e;i++)o=tt(o,n),r[e-i]=ot(t[e-i],o);return r}const{abs:Un,sign:Zn}=Math;const Jn=134217729;function Kn(t,n){const e=t*n,r=Jn*t,o=r-(r-t),i=t-o,c=Jn*n,s=c-(c-n),u=n-s;return[i*u-(e-o*s-i*s-o*u),e]}const{abs:te}=Math;function ne(t,n){const e=te(n);let r=t[0],o=.5*te(r);for(let i=1;i<t.length;i++)r=r*n+t[i],o=o*e+te(r);return o=Bn*(2*o-te(r)),[r,o]}const ee=Math.abs,{abs:re}=Math,oe=Ln(1),ie=Ln(2);function ce(t,n,e=void 0,r=1){const o=t[0],[i,c]=ne(o,n),s=ie*function(t,n){const e=ee(n);let r=0;for(let n=0;n<t.length;n++)r=r*e+ee(t[n]);return r}(o,n),u=void 0!==e?R(e,re(n)):0;if((c+s+u)*r<Math.abs(i))return i;const f=function(t,n){const e=[],r=[];let o,i=t[0];for(let c=1;c<t.length;c++){const[s,u]=Kn(i,n);[o,i]=dt(u,t[c]),e.push(s),r.push(o)}return{r̂:i,pπ:e,pσ:r}}(o,n),{pπ:l,pσ:a}=f;let{r̂:p}=f;const[h,d]=ne(l,n),[g,v]=ne(a,n),[m,x]=ne(t[1],n);let b=d+v+x+u;return p=h+g+m+p,b+=oe*p,b*r<Math.abs(p)?p:0}function se(t,n){let e=[0];for(let r=0;r<t.length;r++)e=J(t[r],tt(e,n));return e}const{abs:ue,min:fe,max:le,log2:ae,ceil:pe}=Math;function he(t,n,e,r,o,i,c,s){let u=e,f=r,l=u,a=o,p=f-u,h=p;for(;;){let d;ue(a)<ue(i)&&(u=f,f=l,l=u,o=i,i=a,a=o);const g=le(ue(u),ue(f));d=g<=1?kn:kn*2**pe(ae(g));const v=.5*(l-f);if(ue(v)<=d)return f<l?[f,l,f]:[l,f,f];if(ue(p)<d||ue(o)<=ue(i))p=v,h=p;else{let t,n,e=i/o;if(u===l)t=2*v*e,n=1-e;else{n=o/a;const r=i/a;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=p,p=h,2*t<3*v*n-ue(d*n)&&t<ue(.5*e*n)?h=t/n:(p=v,h=p)}if(u=f,o=i,d<ue(h)?f+=h:0<v?f+=d:f-=d,0===(i=s?it(se(c(),f)):ce(t,f,n))){if(s)return[f,f,f];const o=le(e,f-d),u=fe(r,f+d);if(ce(t,o,n)*ce(t,u,n)!==0)return[o,u,f];if(s=!0,0===(i=it(se(c(),f))))return[f,f,f]}(0<i&&0<a||i<=0&&a<=0)&&(l=u,a=o,p=f-u,h=p)}}const{abs:de}=Math;function ge(t,n,e){const r=de(n);let o=t[0],i=e[0];for(let c=1;c<t.length;c++){const s=o*n;o=s+t[c],i=i*r+de(s)+e[c]+de(o)}return[o,i]}function ve(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}const me=Kt,xe=$n,{abs:be}=Math;function we(t,n,e){const r=be(n);let o=t[0],i=e[0];for(let c=1;c<t.length;c++){const s=xe(n,o);o=me(s,t[c]),i=i*r+be(s[1])+e[c]+be(o[1])}return[o,i]}const{abs:_e,min:Me,max:Se,log2:Ne,ceil:Ie}=Math,ye=Yn/Fn;function Ee(t,n,e,r,o,i,c){const s=t.length-1;let u=0,f=1;for(;;){f*=2;for(let l=1;l<f;l+=2){u++;const a=o+(i-o)*(f+2*l)/(4*f),[p,h]=ge(t,a,n);if(_e(p)>h*Fn)return[a,p];if(u>s)return Ce(e,r,o,i,c)}}}function Ce(t,n,e,r,o){const i=t.length-1;let c=0,s=1;for(;;){s*=2;for(let u=1;u<s;u+=2){c++;const f=e+(r-e)*(s+2*u)/(4*s),[l,a]=we(t,f,n);if(_e(l[1])>a*Yn)return[f,l[1]];if(c>i)return Oe(o(),e,r)}}}function Oe(t,n,e){const r=t.length-1;let o=1;for(;;){o*=2;for(let i=1;i<o;i+=2){const c=n+(e-n)*(o+2*i)/(4*o),s=Pn(se(t,c)),u=s[s.length-1];if(0!==u)return[c,u];if(0>r)throw new Error("Cannot resolve root even in Shewchuk expansion precision")}}}function Te(t,n=-1/0,e=1/0,r,o,i=!1){let c;"number"==typeof t[0]&&(t=t.map(t=>[0,t]));const s=()=>void 0===o?t:(void 0===c&&(c=o()),c);if(r=r||new Array(t.length).fill(0),({pDd:t,pDd_:r,pExact:c}=function(t,n,e,r){let o;for(;t.length>0&&An(t[0][1])<=r*n[0]&&(o=o||e(),0===lt(o[0]));)(t=t.slice()).shift(),(n=n.slice()).shift(),o.shift();return{pDd:t,pDd_:n,pExact:o}}(t,r,s,Yn)),0===t.length)return;if(1===t.length)return[];const u=t.map(t=>t[0]+t[1]);return!i&&n!==-1/0&&e!==1/0||([n,e]=function(t,n,e){return[t=Tn(t,En(e)),n=On(n,yn(e))]}(n,e,u),n!==e)?function(t,n,e,r,o,i){const c=e.map((n,e)=>n*ye+_e(t[e])),s=r,u=o;let f,l,a,p,h=o-r;for(;[f,l]=ge(t,r,c),!(_e(f)>l*Fn);)r-=h/2,h*=2;for(;[a,p]=ge(t,o,c),!(_e(a)>p*Fn);)o+=h/2,h*=2;const d=[[r,o,f,a,0]],g=[],v=function(t,n,e,r,o){return function(i,c,s,u,f){let[l,a]=function(t,n,e){const r=t.length-1,o=Xn(n),i=t.slice(),c=e.slice();for(let t=0;t<=r;t++)for(let e=1;e<=r-t;e++){const t=n*i[e-1],r=o*c[e-1]+Xn(t);i[e]=i[e]+t,c[e]=c[e]+r+Xn(i[e])}return[i,c]}(t,i,n);!function(t,n,e){const r=t.length-1;if(r<0)return;let o=n,i=0;for(let c=1;c<=r;c++){const s=r-c,u=t[s],f=Hn(u),l=e[s],a=u*o;t[s]=a,e[s]=l*o+f*i+Hn(a);const p=o*n;i=i*n+p,o=p}}(l,c-i,a),l.reverse(),a.reverse(),function(t,n){const e=t.length-1;for(let r=0;r<=e;r++)for(let o=1;o<=e-r;o++){const e=t[o-1],r=n[o-1]+Xn(e);t[o]=t[o]+e,n[o]=n[o]+r+Xn(t[o])}}(l,a);let p=0,h=0,d=Zn(s);for(let t=1;t<l.length-1;t++){let n=Zn(l[t]);const e=l[t],r=a[t]*Fn;Un(e)<=r&&(h++,n=-d),n!==d&&(p++,d=n)}return Zn(u)!==d&&p++,1===h&&1===p?1:h>0?function(t,n,e,r,o,i,c,s){let[u,f]=qn(t,e,n);(function(t,n,e){const r=t.length-1;if(r<0)return;let o=[0,n],i=0;for(let c=1;c<=r;c++){const s=r-c,u=t[s],f=Qn(u[1]),l=e[s],a=Wn(o,u);t[s]=a,e[s]=l*o[1]+f*i+Qn(a[1]);const p=Wn(o,[0,n]);i=i*n+p[1],o=p}})(u,r-e,f),u.reverse(),f.reverse(),[u,f]=qn(u,1,f);let l=0,a=0,p=Zn(o);for(let t=0;t<u.length-1;t++){let n=Zn(u[t][1]);const e=f[t]*Yn,r=u[t];e>=Un(r[1])&&(a++,n=-p),n!==p&&(l++,p=n)}return Zn(i)!==p&&l++,1===a&&1===l?1:0===a?l:c>1?function(t,n,e,r,o){let i=Rn(t(),n);i=Gn(i,e-n),i.reverse(),i=Rn(i,1);let c=0,s=Zn(r);for(let t=1;t<i.length-1;t++){const n=i[t];let e=Zn(n[n.length-1]);e!==s&&0!==e&&(c++,s=e)}return Zn(o)!==s&&c++,c}(s,e,r,o,i):-l}(e,r,i,c,s,u,f,o):p}}(t,c,n,e,i);let m,x;for(;d.length>0;){const r=d.pop(),[o,s,u,f,l]=r,a=v(o,s,u,f,l);if(0===a)continue;if(1===a){m=m||e.map(t=>t*Yn),x=x||ve(n);const[t,r,c]=he(x,m,o,s,u,f,i,!1);g.push({t:c,tS:t,tE:r,multiplicity:1});continue}let p=a<0?l+1:0;if(s-o<=2*_e(a)*kn*Se(1,2**Ie(Ne(Se(_e(o),_e(s)))))){if(0===p){g.push({t:(o+s)/2,tS:o,tE:s,multiplicity:_e(a)});continue}p=1/0}const[h,b]=Ee(t,c,n,e,o,s,i);d.push([o,h,u,b,p]),d.push([h,s,b,f,p])}return g.reverse(),g.filter(t=>{const{tS:n,tE:e}=t;return!(e<s||n>u)})}(u,t,r,n,e,s):[{t:n,tS:n,tE:e,multiplicity:u.length-1}]}function Ae(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],[c,s],[u,f]]=t,l=e+(o-e)*n,a=o+(c-o)*n,p=l+(a-l)*n,h=r+(i-r)*n,d=i+(s-i)*n,g=h+(d-h)*n;return[p+(a+(c+(u-c)*n-a)*n-p)*n,g+(d+(s+(f-s)*n-d)*n-g)*n]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=e+(o-e)*n,f=r+(i-r)*n;return[u+(o+(c-o)*n-u)*n,f+(i+(s-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 Pe=Math.abs;function ke(t,n){if(0===n[0]&&0===n[1])return[0,0];if(0===n[0]&&1===n[1])return[0,0];const e=Pe(n[1]);if(4===t.length){const[[n,r],[o,i],[c,s],[u,f]]=t,l=Pe(n),a=Pe(r),p=Pe(o),h=Pe(i),d=Pe(c),g=Pe(s),v=l+(p+l)*e,m=p+(d+p)*e,x=v+(m+v)*e,b=a+(h+a)*e,w=h+(g+h)*e,_=b+(w+b)*e;return[x+(m+(d+(Pe(u)+d)*e+m)*e+x)*e,_+(w+(g+(Pe(f)+g)*e+w)*e+_)*e]}if(3===t.length){const[[n,r],[o,i],[c,s]]=t,u=Pe(n),f=Pe(r),l=Pe(o),a=Pe(i),p=u+(l+u)*e,h=f+(a+f)*e;return[p+(l+(Pe(c)+l)*e+p)*e,h+(a+(Pe(s)+a)*e+h)*e]}if(2===t.length){const[[n,r],[o,i]]=t,c=Pe(n),s=Pe(r);return[c+(Pe(o)+c)*e,s+(Pe(i)+s)*e]}if(1===t.length)return[0,0];throw new Error("The given bezier curve must be of order <= 3.")}Number.EPSILON;const Be=Number.EPSILON/2,ze=Be*Be,Fe=(Ye(1),Le(3));function Ye(t){const n=t*Be;return n/(1-n)}function Le(t){const n=t*ze;return n/(1-n)}const Xe=Math.abs,He=[[0,0],[0,0],[0,0],[0,0]];function Ve(t,n,e){return 0===n?1===e?{ps:t,_ps:He}:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=d-n*(d-g),m=v-n*(v-(g-n*(g-(l-n*(l-p))))),x=s-n*(s-f),b=f-n*(f-a),w=x-n*(x-b),_=w-n*(w-(b-n*(b-(a-n*(a-h))))),M=Xe(n),S=Xe(c),N=Xe(u),I=Xe(l),y=Xe(p),E=Xe(s),C=Xe(f),O=Xe(a),T=S+M*(S+N),A=N+M*(N+I),P=T+M*(T+A),k=E+M*(E+C),B=C+M*(C+O),z=k+M*(k+B);return{ps:[[c,s],[d,x],[v,w],[m,_]],_ps:[[0,0],[T,k],[P,z],[P+M*(P+(A+M*(A+(I+M*(I+y))))),z+M*(z+(B+M*(B+(O+M*(O+Xe(h))))))]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=l-n*(l-p),m=d-n*(d-g),x=g-n*(g-v),b=m-n*(m-x),w=s-n*(s-f),_=f-n*(f-a),M=a-n*(a-h),S=w-n*(w-_),N=_-n*(_-M),I=S-n*(S-N),y=Xe(n),E=Xe(c),C=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G+Q)+j),q*ct+(3*V*(V*rt+nt)+K)]]}}(t,n,e)}const $e=Math.abs,De=[[0,0],[0,0],[0,0]];function qe(t,n,e){return 0===n?1===e?{ps:t,_ps:De}:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=c-u,d=[[i,c],[-n*p+i,-n*h+c],[a*(p+(f-s))-(2*n*p-i),a*(h+(l-u))-(2*n*h-c)]],g=$e(n),v=$e(i),m=$e(s),x=$e(f),b=v+m,w=$e(c),_=$e(u),M=w+_;return{ps:d,_ps:[[0,0],[g*b+v,g*M+w],[a*(b+(x+m))+(2*g*b+v),a*(M+($e(l)+_))+(2*g*M+w)]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=f-s,d=c-u,g=l-u,v=[[a*(p+h)-(2*n*p-i),a*(d+g)-(2*n*d-c)],[n*h+s,n*g+u],[f,l]],m=$e(n),x=$e(i),b=$e(s),w=x+b,_=$e(f)+b,M=$e(c),S=$e(u),N=M+S;return{ps:v,_ps:[[a*(w+_)+(2*m*w+x),a*(N+($e(l)+S))+(2*m*N+M)],[m*_+b,0],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=i[0],a=i[1],p=n*n,h=e*e,d=n*e,g=c-u,v=g+(l-u),m=s-f,x=m+(a-f),b=p*v-(2*n*g-c),w=d*v-(g*(e+n)-c),_=h*v-(2*e*g-c),M=p*x-(2*n*m-s),S=d*x-(m*(e+n)-s),N=h*x-(2*e*m-s),I=$e(n),y=$e(e),E=$e(d),C=$e(c),O=$e(u),T=C+O,A=T+$e(l)+O,P=$e(s),k=$e(f),B=P+k,z=B+$e(a)+k;return{ps:[[b,M],[w,S],[_,N]],_ps:[[p*A+(2*I*T+C),p*z+(2*I*B+P)],[E*A+(T*(y+I)+C),E*x+(B*(y+I)+P)],[h*A+(2*y*T+C),h*z+(2*y*B+P)]]}}(t,n,e)}const je=Math.abs,We=[[0,0],[0,0]];const Qe=Number.EPSILON/2,Re=Ye(1);function Ge(t,n){return n[0]!==n[1]?4===t.length?function(t,n){const{ps:e,_ps:r}=Ve(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=e[3][0],u=9*Qe*r[0][0],f=9*Qe*r[1][0],l=9*Qe*r[2][0],a=9*Qe*r[3][0],p=e[0][1],h=e[1][1],d=e[2][1],g=e[3][1],v=9*Qe*r[0][1],m=9*Qe*r[1][1],x=9*Qe*r[2][1],b=9*Qe*r[3][1],w=Math.min(o-u,i-f,c-l,s-a),_=Math.max(o+u,i+f,c+l,s+a);return[[w,Math.min(p-v,h-m,d-x,g-b)],[_,Math.max(p+v,h+m,d+x,g+b)]]}(t,n):3===t.length?function(t,n){const{ps:e,_ps:r}=qe(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=5*Qe*r[0][0],u=5*Qe*r[1][0],f=5*Qe*r[2][0],l=e[0][1],a=e[1][1],p=e[2][1],h=5*Qe*r[0][1],d=5*Qe*r[1][1],g=5*Qe*r[2][1],v=Math.min(o-s,i-u,c-f),m=Math.max(o+s,i+u,c+f);return[[v,Math.min(l-h,a-d,p-g)],[m,Math.max(l+h,a+d,p+g)]]}(t,n):function(t,n){const{ps:e,_ps:r}=function(t,n,e){return 0===n?1===e?{ps:t,_ps:We}:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[o,i],[n*(c-o)+o,n*(s-i)+i]],f=je(n),l=je(o),a=je(c),p=je(i);return{ps:u,_ps:[[0,0],[f*(a+l)+l,f*(je(s)+p)+p]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[n*(c-o)+o,n*(s-i)+i],[c,s]],f=je(n),l=je(o),a=je(c),p=je(i);return{ps:u,_ps:[[f*(a+l)+l,f*(je(s)+p)+p],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1],f=[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]],l=je(n),a=je(e),p=je(i),h=je(s),d=je(c),g=je(u);return{ps:f,_ps:[[l*(h+p)+p,l*(g+d)+d],[a*(h+p)+p,a*(g+d)+d]]}}(t,n,e)}(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=3*Qe*r[0][0],s=3*Qe*r[1][0],u=e[0][1],f=e[1][1],l=3*Qe*r[0][1],a=3*Qe*r[1][1],p=Math.min(o-c,i-s),h=Math.max(o+c,i+s);return[[p,Math.min(u-l,f-a)],[h,Math.max(u+l,f+a)]]}(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=Ae(t,n);let i;if(4===t.length)i=ke(t,[0,n]).map(t=>8*Re*t);else if(3===t.length)i=ke(t,[0,n]).map(t=>5*Re*t);else if(2===t.length)i=ke(t,[0,n]).map(t=>2*Re*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 Ue(t){const n=t[0],e=t[1];return[(n[0]+e[0])/2,(n[1]+e[1])/2]}const Ze=Z,Je=Number.EPSILON;function Ke(t,n){const e=t-n,r=t-e;return[t-(e+r)+(r-n),e]}function tr(t){return[2*t[0],2*t[1]]}function nr(t){return[4*t[0],4*t[1]]}const er=Ke,rr=Kt,or=$n,ir=Wn,cr=tr,sr=nr,ur=tn;function fr(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,g]=n,v=er(c,d),m=er(u,d),x=er(l,d),b=er(p,d),w=er(s,g),_=er(f,g),M=er(a,g),S=er(h,g),N=ir(v,v),I=or(6,ir(v,m)),y=or(6,ir(v,x)),E=cr(ir(v,b)),C=or(9,ir(m,m)),O=or(18,ir(m,x)),T=or(6,ir(m,b)),A=or(9,ir(x,x)),P=or(6,ir(x,b)),k=ir(b,b),B=ir(w,w),z=or(6,ir(w,_)),F=or(6,ir(w,M)),Y=cr(ir(w,S)),L=or(9,ir(_,_)),X=or(18,ir(_,M)),H=or(6,ir(_,S)),V=or(9,ir(M,M)),$=or(6,ir(M,S)),D=ir(S,S),q=rr(T,A),j=rr(E,O),W=rr(y,C),Q=rr(H,V),R=rr(Y,X),G=rr(F,L);return[or(6,rr(rr(rr(rr(ur(k,P),ur(N,I)),q),ur(W,j)),rr(rr(rr(ur(D,$),ur(B,z)),Q),ur(G,R)))),or(5,rr(ur(rr(rr(P,or(5,I)),or(3,j)),cr(rr(rr(q,cr(W)),or(3,N)))),ur(rr(rr($,or(5,z)),or(3,R)),cr(rr(rr(Q,cr(G)),or(3,B)))))),sr(rr(ur(ur(q,or(3,ur(j,cr(W)))),or(5,ur(cr(I),or(3,N)))),ur(ur(Q,or(3,ur(R,cr(G)))),or(5,ur(cr(z),or(3,B)))))),or(3,rr(ur(j,cr(ur(cr(W),or(5,ur(I,cr(N)))))),ur(R,cr(ur(cr(G),or(5,ur(z,cr(B)))))))),cr(rr(ur(W,or(5,ur(I,or(3,N)))),ur(G,or(5,ur(z,or(3,B)))))),rr(ur(I,or(6,N)),ur(z,or(6,B)))]}const lr=Ke,ar=Kt,pr=$n,hr=Wn,dr=tr,gr=tn,vr=nr;function mr(t,n){const[[e,r],[o,i],[c,s]]=t,[u,f]=n,l=lr(e,u),a=lr(o,u),p=lr(c,u),h=lr(r,f),d=lr(i,f),g=lr(s,f),v=hr(l,l),m=hr(l,a),x=hr(l,p),b=hr(a,a),w=hr(a,p),_=hr(p,p),M=hr(h,h),S=hr(h,d),N=hr(h,g),I=hr(d,d),y=hr(d,g),E=hr(g,g),C=ar(N,dr(I)),O=ar(x,dr(b));return[ar(gr(ar(ar(E,M),dr(C)),vr(ar(y,S))),gr(ar(ar(_,v),dr(O)),vr(ar(w,m)))),pr(3,ar(ar(gr(y,C),gr(pr(3,S),M)),ar(gr(w,O),gr(pr(3,m),v)))),ar(gr(C,pr(3,gr(dr(S),M))),gr(O,pr(3,gr(dr(m),v)))),ar(gr(S,M),gr(m,v))]}function xr(t){return[-2*t[0],-2*t[1]]}const br=Jt,wr=Kt,_r=xr;function Mr(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=e-c,f=o-c,l=r-s,a=i-s,p=br(u,u),h=br(u,f),d=br(f,f),g=br(l,l),v=br(l,a),m=br(a,a),x=wr(h,v),b=wr(g,p);return[wr(wr(d,m),wr(b,_r(x))),tn(x,b)]}function Sr(t){const n=[];for(let e=0;e<t.length;e++)n.push(2*t[e]);return n}function Nr(t){const n=[];for(let e=0;e<t.length;e++)n.push(-2*t[e]);return n}const Ir=Z,yr=nt,Er=Sr,Cr=Nr,Or=Z,Tr=nt,Ar=Sr;function Pr(t){const n=[];for(let e=0;e<t.length;e++)n.push(4*t[e]);return n}const kr=Z,Br=Nr,zr=Math.abs;function Fr(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=zr(e[0]),s=zr(e[1]),u=zr(r[0]),f=zr(r[1]),l=zr(o[0]),a=zr(o[1]),p=zr(i[0]),h=zr(i[1]),d=zr(n[0]),g=zr(n[1]),v=c+d,m=u+d,x=l+d,b=p+d,w=s+g,_=f+g,M=a+g,S=h+g,N=v*v,I=6*v*m,y=6*x*b,E=w*w,C=6*w*_,O=6*M*S,T=6*m*b+9*x*x,A=2*v*b+18*m*x,P=6*v*x+9*m*m,k=6*_*S+9*M*M,B=2*w*S+18*_*M,z=6*w*M+9*_*_;return[6*(b*b+y+(N+I)+T+(P+A)+(S*S+O+(E+C)+k+(z+B))),5*(y+5*I+3*A+2*(T+2*P+3*N)+(O+5*C+3*B+2*(k+2*z+3*E))),4*(T+3*(A+2*P)+5*(2*I+3*N)+(k+3*(B+2*z)+5*(2*C+3*E))),3*(A+2*(2*P+5*(I+2*N))+(B+2*(2*z+5*(C+2*E)))),2*(P+5*(I+3*N)+(z+5*(C+3*E))),I+6*N+(C+6*E)]}function Yr(t,n){const e=t[0],r=t[1],o=t[2],i=zr(e[0]),c=zr(e[1]),s=zr(r[0]),u=zr(r[1]),f=zr(o[0]),l=zr(o[1]),a=zr(n[0]),p=zr(n[1]),h=i+a,d=s+a,g=f+a,v=c+p,m=u+p,x=l+p,b=h*h,w=h*d,_=d*g,M=v*v,S=v*m,N=m*x,I=v*x+m*m*2,y=h*g+d*d*2;return[x*x+M+2*I+4*(N+S)+(g*g+b+2*y+4*(_+w)),3*(N+I+(3*S+M)+(_+y+(3*w+b))),I+3*(2*S+M)+(y+3*(2*w+b)),S+M+(w+b)]}function Lr(t,n){const e=t[0],r=t[1],o=zr(e[0]),i=zr(e[1]),c=zr(r[0]),s=zr(r[1]),u=zr(n[0]),f=zr(n[1]),l=o+u,a=c+u,p=i+f,h=s+f,d=l*a+p*h,g=p*p+l*l;return[a*a+h*h+2*d+g,d+g]}Le(6);const{sqrt:Xr}=Math;function Hr(t,n,e=0,r=1){const{polyDd:o,polyE:i,getPolyExact:c}=function(t,n){const e=t.length-1;if(3===e)return{polyDd:fr(t,n),polyE:Fr(t,n).map(t=>20*t),getPolyExact:()=>function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,g]=n,v=Ir(c,d),m=Ir(u,d),x=Ir(l,d),b=Ir(p,d),w=Ir(s,g),_=Ir(f,g),M=Ir(a,g),S=Ir(h,g),N=ot(v,v),I=yr(6,ot(v,m)),y=yr(6,ot(v,x)),E=Er(ot(v,b)),C=yr(9,ot(m,m)),O=yr(18,ot(m,x)),T=yr(6,ot(m,b)),A=yr(9,ot(x,x)),P=yr(6,ot(x,b)),k=ot(b,b),B=ot(w,w),z=yr(6,ot(w,_)),F=yr(6,ot(w,M)),Y=Er(ot(w,S)),L=yr(9,ot(_,_)),X=yr(18,ot(_,M)),H=yr(6,ot(_,S)),V=yr(9,ot(M,M)),$=yr(6,ot(M,S)),D=ot(S,S),q=J(T,A),j=J(E,O),W=J(y,C),Q=J(H,V),R=J(Y,X),G=J(F,L),U=ft(J(J(k,N),J(q,W)),J(J(j,P),I)),Z=ft(J(J(D,B),J(Q,G)),J(J(R,$),z)),K=yr(6,J(U,Z)),tt=J(Cr(J(J(q,Er(W)),yr(3,N))),J(J(P,yr(3,j)),yr(5,I))),nt=J(Cr(J(J(Q,Er(G)),yr(3,B))),J(J($,yr(3,R)),yr(5,z))),et=yr(5,J(tt,nt)),rt=J(J(q,yr(3,ft(Er(W),j))),yr(5,ft(yr(3,N),Er(I)))),it=J(J(Q,yr(3,ft(Er(G),R))),yr(5,ft(yr(3,B),Er(z)))),ct=yr(4,J(rt,it)),st=ft(j,Er(ft(Er(W),yr(5,ft(I,Er(N)))))),ut=ft(R,Er(ft(Er(G),yr(5,ft(z,Er(B)))))),lt=yr(3,J(st,ut)),at=ft(W,yr(5,ft(I,yr(3,N)))),pt=ft(G,yr(5,ft(z,yr(3,B))));return[K,et,ct,lt,Er(J(at,pt)),J(ft(I,yr(6,N)),ft(z,yr(6,B)))].map(Pn)}(t,n)};if(2===e)return{polyDd:mr(t,n),polyE:Yr(t,n).map(t=>16*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i],[c,s]]=t,[u,f]=n,l=Or(e,u),a=Or(o,u),p=Or(c,u),h=Or(r,f),d=Or(i,f),g=Or(s,f),v=ot(l,l),m=ot(l,a),x=ot(l,p),b=ot(a,a),w=ot(a,p),_=ot(p,p),M=ot(h,h),S=ot(h,d),N=ot(h,g),I=ot(d,d),y=ot(d,g),E=ot(g,g),C=J(N,Ar(I)),O=J(x,Ar(b)),T=J(ft(J(_,Ar(O)),Pr(J(w,m))),v),A=J(ft(J(E,Ar(C)),Pr(J(y,S))),M),P=J(T,A),k=J(ft(w,O),ft(Tr(3,m),v)),B=J(ft(y,C),ft(Tr(3,S),M));return[P,Tr(3,J(k,B)),J(ft(C,Tr(3,ft(Ar(S),M))),ft(O,Tr(3,ft(Ar(m),v)))),J(ft(S,M),ft(m,v))].map(Pn)}(t,n)};if(1===e)return{polyDd:Mr(t,n),polyE:Lr(t,n).map(t=>12*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=kr(e,c),f=kr(o,c),l=kr(r,s),a=kr(i,s),p=ot(u,u),h=ot(u,f),d=ot(f,f),g=ot(l,l),v=ot(l,a),m=ot(a,a),x=J(h,v),b=J(g,p);return[J(J(d,m),J(Br(x),b)),ft(x,b)].map(Pn)}(t,n)};if(0===e)return{polyDd:[[0,1]],polyE:[0],getPolyExact:()=>[[1]]};throw new Error("The given bezier curve must be of order 1, 2 or 3")}(t,n),s=Te(o,e,r,i,c)||[];s.push({t:e,tS:e,tE:e,multiplicity:1}),s.push({t:r,tS:r,tE:r,multiplicity:1});const u=s.map(e=>{const r=Ge(t,[e.tS,e.tE]),o=function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=n[0],f=n[1];let l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(const[t,n]of[[o,i],[o,s],[c,i],[c,s]]){const e=Ze(t,u),r=Ze(n,f),o=it(J(ot(e,e),ot(r,r))),i=o*(1-Je),c=o*(1+Je);i<=l&&(l=i),c>=a&&(a=c)}return[l,a]}(r,n);return{p:Ue(r),t:e.t,d:(Xr(o[0])+Xr(o[1]))/2,dSquaredI:o,box:r,ri:e}});let f=Number.POSITIVE_INFINITY;for(let t=0;t<u.length;t++){const n=u[t].dSquaredI[1];n<f&&(f=n)}const l=[];for(let t=0;t<u.length;t++){const n=u[t];n.dSquaredI[0]<=f&&l.push(n)}return l}function Vr(t){return{t,tS:t,tE:t,multiplicity:1}}function $r(t){return(t.tS+t.tE)/2}function Dr(t){const n=t.xs;if(4===n.length){let t=0,e=0;for(let r=0;r<n.length;r++)0===n[r].x.kind&&t++,4===n[r].x.kind&&e++;if(2===t&&2===e)return!0}return n.length<=2&&7!==n[0].x.kind}const qr=Pn;function jr(t){const n=(t=qr(t)).length;return 2===n?t:1===n?[0,t[0]]:[t[n-2],t[n-1]]}const{abs:Wr,min:Qr,max:Rr,log2:Gr,ceil:Ur}=Math;function Zr(t,n){const{tS:e,tE:r}=t,o=r-e;if(0===o)return[{tS:[0,e],tE:[0,e],multiplicity:t.multiplicity}];const i=2**Ur(Gr(o)),c=function(t,n,e){return Gn(Rn(t,e),n)}(n,i,e),s=c.map(jr),u=s.map(t=>t[1]*kn**2),f=Te(s,0,1,u,()=>c),l=[];for(const t of f)l.push({tS:dt(e,t.tS*i),tE:dt(e,t.tE*i),multiplicity:t.multiplicity});return l}function Jr(t,n){return lt(ft(t,n))}const{abs:Kr}=Math;function to(t,n){const e=t.inOuts;e.sort(function(t){return(n,e)=>{let r=n.side-e.side;if(0!==r)return r;const o=n.sideX,i=e.sideX;r=o.ri.tS-i.ri.tS;const c=8*Number.EPSILON;return Kr(r)>=c?r:(o.compensated||(o.compensated=1,o.riExp=Zr(o.ri,o.getPExact())[0]),i.compensated||(i.compensated=1,i.riExp=Zr(i.ri,i.getPExact())[0]),r=Jr(o.riExp.tS,i.riExp.tS),0!==r?r:(r=n.dir-e.dir,0!==r?t*r:1===n.dir?n.idx-e.idx:e.idx-n.idx))}}(n));let r=e[e.length-1];for(let t=0;t<e.length;t++){const n=e[t];n.prevAround=r,r.nextAround=n,r=n}}function no(t,n,e,r){const o=function(t,n){return(e,r,o)=>{t.has(e)||(e.orientation=r,e.parent=o,e.windingNum=o.windingNum+e.orientation,n.push(e))}}(r,e);to(t.container,n.orientation);let i,c,s=1,u=t,f=n.orientation;for(;u=1===n.orientation?u.nextAround:u.prevAround,u!==t;){const t=s;s-=u.dir,1===s&&(f*=-1),-1!==u.dir&&(i?1===t&&0===s?o(u,n.orientation,n.parent):0===t&&-1===s&&o(u,-n.orientation,n.parent):0===s?i=u:1===s&&o(u,n.orientation,n))}return Dr(t.container)||(c=[t.p,i.p]),{inOutToUse:i,additionalBezier:c}}function eo(t,n){const e=t._x_,r=n._x_,o=e.curve,i=e.x.ri.tS,c=r.curve,s=r.x.ri.tS;let u=o,f=i;Dr(t.container)||(f=$r(Hr(o.ps,t.p)[0].ri));const l=[];for(;;){if(u===c&&(f<s||f===s&&0!==l.length)){const t=u.ps,n=[f,s];return l.push({ps:t,ts:n}),l}{const t=u.ps,n=[f,1];l.push({ps:t,ts:n})}f=0,u=u.next}}function ro(t,n){const e=n._x_,r=t._x_,o=r.curve,i=r.x.ri.tS,c=e.curve,s=e.x.ri.tS;let u=o,f=i;Dr(t.container)||(f=$r(Hr(u.ps,t.p)[0].ri));const l=[];for(;;){const t=u.ps;if(u===c&&(f>s||f===s&&0!==l.length)){const n=[f,s];return l.push({ps:t,ts:n}),l}{const n=[f,0];l.push({ps:t,ts:n})}f=1,u=u.prev}}function oo(t,n,e,r){const o=function(t,n,e){return(r,o,i,c)=>{n.has(r)||1!==r.dir||(r.loopsIdxs=new Set(c),r.orientation=o*t.orientation,r.parent=i.parent,r.windingNum=i.windingNum+r.orientation,e.unshift(r))}}(n,r,e);to(t.container,1);let i=t.nextAround,c=t;const s=[],u=new Set(n.loopsIdxs);for(;c=c.nextAround,c!==t;)o(c,n.dir,n,u),s.push(c.idx),-1===c.dir?u?.add(c._x_?.curve.loop.idx):u.delete(c._x_?.curve.loop.idx);let f;return Dr(t.container)||(f=[t.p,i.p]),{inOutToUse:i,additionalBezier:f}}function io(t){const{ps:n,ts:e}=t;return function(t,n,e){if(4===t.length)return 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],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=p-n*(p-h),g=s-n*(s-f),v=f-n*(f-a),m=g-n*(g-v);return[e,[p,g],[d,m],[d-n*(d-(h-n*(h-(l-n*(l-i[0]))))),m-n*(m-(v-n*(v-(a-n*(a-i[1])))))]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=l-n*(l-i[0]),g=p-n*(p-h),v=h-n*(h-d),m=s-n*(s-f),x=f-n*(f-a),b=a-n*(a-i[1]),w=m-n*(m-x),_=x-n*(x-b);return[[g-n*(g-v),w-n*(w-_)],[v,_],[d,b],i]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=t[3],s=r[0],u=r[1],f=o[0],l=o[1],a=i[0],p=i[1],h=n*n,d=n*h,g=e*e,v=e*g,m=n*e,x=s-f,b=a-f,w=x+b,_=n*x,M=e*x,S=c[0]-s-3*b,N=u-l,I=p-l,y=N+I,E=n*N,C=e*N,O=c[1]-u-3*I;return[[d*S+(3*n*(n*w-x)+s),d*O+(3*n*(n*y-N)+u)],[m*(n*S+2*w)+(h*w+s-(M+2*_)),m*(n*O+2*y)+(h*y+u-(C+2*E))],[m*(e*S+2*w)+(g*w+s-(2*M+_)),m*(e*O+2*y)+(g*y+u-(2*C+E))],[v*S+(3*e*(e*w-x)+s),v*O+(3*e*(e*y-N)+u)]]}(t,n,e)}(t,n,e);if(3===t.length)return 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],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=c-u;return[e,[-n*l+i,-n*a+c],[f*(l+(o[0]-s))-(2*n*l-i),f*(a+(o[1]-u))-(2*n*a-c)]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=o[0]-s,p=c-u,h=o[1]-u;return[[f*(l+a)-(2*n*l-i),f*(p+h)-(2*n*p-c)],[n*a+s,n*h+u],o]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=n*n,a=e*e,p=n*e,h=c-u,d=h+(i[0]-u),g=s-f,v=g+(i[1]-f);return[[l*d-(2*n*h-c),l*v-(2*n*g-s)],[p*d-(h*(e+n)-c),p*v-(g*(e+n)-s)],[a*d-(2*e*h-c),a*v-(2*e*g-s)]]}(t,n,e)}(t,n,e);if(2===t.length)return 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[e,[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];return[[n*(r[0]-o)+o,n*(r[1]-i)+i],r]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1];return[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]]}(t,n,e)}(t,n,e);if(1===t.length)return t;throw new Error("The given bezier curve must be of order <= 3.")}(n,e[0],e[1])}function co(t,n,e){const r=[],o=[];let i,c=n;const s=e?oo:no,u=[];do{t.add(c),u.push(c);const e=c.nextOrPrev;t.add(e);const f=1===c.dir?eo(c,e):ro(c,e);o.push(...f);const l=s(e,n,r,t);if(({inOutToUse:c,additionalBezier:i}=l),void 0!==i){const t=io(o[o.length-1]),n={ps:t,ts:[0,$r(Hr(t,i[0])[0].ri)]};o.pop(),o.push(n),o.push({ps:i,ts:[0,1]})}}while(c!==n);return"undefined"!=typeof _debug_&&_debug_.verbose&&function(t){const n=[],e=[];for(let r of t)e.push(1===r.dir?"color: blue;":"color: red"),n.push(`%c${r.idx}`)}(u),{bezierPieces:o,additionalOutsToCheck:r}}function so(t,n,e,r){const o=[t];for(;o.length;){const t=o.pop();if(n.add(t._x_.curve.loop),e.has(t))continue;t.children=new Set;const{bezierPieces:i,additionalOutsToCheck:c}=co(e,t,r);t.bezierPieces=i,t.parent.children=t.parent.children||new Set,t.parent.children.add(t);for(let t=0;t<c.length;t++)o.push(c[t])}}function uo(t){if(4===t.length)return fo(t);if(3===t.length)return lo(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 fo(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[s-n+3*(r-i),3*(i+n-2*r),3*(r-n),n],[u-e+3*(o-c),3*(c+e-2*o),3*(o-e),e]]}function lo(t){const[[n,e],[r,o],[i,c]]=t;return[[i+n-2*r,2*(r-n),n],[c+e-2*o,2*(o-e),e]]}function ao(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[3*(s-n+3*(r-i)),6*(i+n-2*r),3*(r-n)],[3*(u-e+3*(o-c)),6*(c+e-2*o),3*(o-e)]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,c]]=t;return[[2*(i+n-2*r),2*(r-n)],[2*(c+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 po(t,n){const[e,r]=ao(t);return[R(e,n),R(r,n)]}function ho(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]=ao(t),c=Te(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=Ge(t,i);s[0][1]<r.box[0][1]&&(r={ts:i,box:s}),s[1][1]>o.box[0][1]&&(o={ts:i,box:s})}return{minY:r,maxY:o}}function go(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]=ao(t),c=Te(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=Ge(t,i);s[0][0]<r.box[0][0]&&(r={ts:i,box:s}),s[1][0]>o.box[0][0]&&(o={ts:i,box:s})}return{minX:r,maxX:o}}(t),e=ho(t);return[[n.minX.box[0][0],e.minY.box[0][1]],[n.maxX.box[1][0],e.maxY.box[1][1]]]}const vo=L(go),mo=L(function(t){const n=ao(t),e=Te(n[0],0,1)?.map(t=>t.t)||[],r=Te(n[1],0,1)?.map(t=>t.t)||[];e.push(0,1),r.push(0,1);let o,i,c,s,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(let n=0;n<e.length;n++){const r=e[n],[c]=Ae(t,r);c<u&&(u=c,o=r),c>f&&(f=c,i=r)}for(let n=0;n<r.length;n++){const e=r[n],[,o]=Ae(t,e);o<l&&(l=o,c=e),o>a&&(a=o,s=e)}return{ts:[[o,c],[i,s]],box:[[u,l],[f,a]]}}),{min:xo,max:bo}=Math;function wo(t){const n=t.map(mo);return{minX:xo(...n.map(t=>t.box[0][0])),maxX:bo(...n.map(t=>t.box[1][0])),minY:xo(...n.map(t=>t.box[0][1])),maxY:bo(...n.map(t=>t.box[1][1]))}}const _o=new Function("try {return this===window;}catch(e){ return false;}")()?function(t){const n=window.atob(t),e=n.length,r=new Uint8Array(e);for(let t=0;t<e;t++)r[t]=n.charCodeAt(t);return r.buffer}:function(t){return function(t){const n=new ArrayBuffer(t.length),e=new Uint8Array(n);for(let n=0;n<t.length;++n)e[n]=t[n];return n}(Buffer.from(t,"base64"))},Mo=_o("AGFzbQEAAAABBgFgAX8BfAMDAgAABQMBAAAHHwMGbWVtb3J5AgAHc3F1YXJlcwAACHNxdWFyZXM0AAEKjgECPwECfiAArULHuuXf9tjQm2p+IgEgASABfnxCIIoiAiACfiABQse65d/22NCbanx8QiCKIgIgAn4gAXxCIIi6C0wBAn4gAK1Cx7rl3/bY0JtqfiIBQse65d/22NCbanwiAiABIAIgASABIAF+fEIgiiIBIAF+fEIgiiIBIAF+fEIgiiIBIAF+fEIgiLoL"),So=new WebAssembly.Module(Mo),No=new WebAssembly.Instance(So),Io=No.exports.squares;No.exports.squares4;const yo=1e-6;function Eo(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;do{e++;const o=Io(e)/4294967296,i=r(t,n,Ae(t[Io(e+1e3)%t.length],o));if(void 0!==i)return i}while(e<100);return;function r(t,n,e){if(function(t,n){const e=wo(t),r=wo(n);return e.minX<r.minX||e.maxX>r.maxX||e.minY<r.minY||e.maxY>r.maxY}(t,n))return!1;const r=function(t,n){const[e,r]=n;let o=0;for(let i=0;i<t.length;i++){const c=t[i],[[s,u],[f,l]]=vo(c);let a=u>r||l<r||!1;if(a=a||s>e||!1,a)continue;const p=[];let h,d,g;const v=!0;h=t=>uo(t)[1],d=[0,-r],g=0;const m=c.map(j(d)),x=h(m),b=Te(x,0-yo,1+yo)?.map(t=>t.t)||[];for(let t=0;t<b.length;t++){const e=b[t];if(Math.abs(e)<yo||Math.abs(e-1)<yo)return;const r=Ae(m,e);(v&&n[g]>=r[g]||!v&&n[g]<=r[g])&&p.push(e)}if(1===p.length||3===p.length)for(const t of p){const n=W(po(c,t));if(Math.abs(n[1])<yo)return}o+=p.length}return o}(n,e);return void 0!==r?r%2!=0:void 0}}(n.beziers,o.bezierPieces.map(io))){e=o;for(const t of o.children)r.push(t)}}}function Co(t,n){return Oo(t)-Oo(n)}function Oo(t){let n=Number.POSITIVE_INFINITY;for(const e of t){const t=mo(e).box[0][1];t<n&&(n=t)}return n}const{abs:To,sign:Ao}=Math;function Po(t){let n=t.parent;for(;;){if(void 0===n)return!1;if(n.used)return!0;n=n.parent}}function ko(t,n,e){let[[r,o],[i,c]]=n,[[s,u],[f,l]]=e;o>c&&([o,c]=[c,o]),u>l&&([u,l]=[l,u]),r>i&&([r,i]=[i,r]),s>f&&([s,f]=[f,s]);const a=t||r===i&&s===f,p=t||o===c&&u===l;return(a?r<=f:r<f)&&(a?i>=s:i>s)&&(p?u<=c:u<c)&&(p?l>=o:l>o)}function Bo(t,n){return ko(!0,t.box,n.box)}function zo(t,n){for(let e=0;e<n.length;e++){const r=n[e];Fo(t,[r.a,r.b])}}function Fo(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 Yo(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)||Yo(t,i,e,r)}}function Lo(t){const n=[],e=new Set;for(const r of t){const o=r[0];e.has(o)||(n.push([]),Yo(t,o,e,n[n.length-1]))}return n}function Xo(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 Ho(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 c=[];for(const n of e){const[[e,s],[u,f]]=n.box;e<t&&(t=e),s<r&&(r=s),u>o&&(o=u),f>i&&(i=f),c.push(...n.xs)}const s={box:[[t,r],[o,i]],xs:c,inOuts:void 0};n.push(s)}return n}function Vo(t){return{tS:[0,t.tS],tE:[0,t.tE],multiplicity:t.multiplicity}}function $o(t,n){const e=t[0],r=t[1],o=r+n,i=o-r,c=e+(r-(o-i)+(n-i)),s=o+c;return[c-(s-o),s]}const Do=Ke,qo=$n,jo=Kt,Wo=$o,Qo=Math.abs;function Ro(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=Do(s,n),l=Do(r,i),a=3*(r-i),p=qo(3,l),h=Qo(a),d=jo(f,p),g=h+Qo(s-n+a),v=Do(i,2*r),m=Wo(v,n),x=Qo(i-2*r+n),b=qo(3,m),w=6*x,_=Do(r,n),M=qo(3,_),S=Qo(3*(r-n)),N=Do(u,e),I=Do(o,c),y=3*(o-c),E=qo(3,I),C=Qo(y),O=jo(N,E),T=C+Qo(u-e+y),A=Do(c,2*o),P=Wo(A,e),k=Qo(c-2*o+e),B=qo(3,P),z=6*k,F=Do(o,e);return{coeffs:[[d,b,M,[0,n]],[O,B,qo(3,F),[0,e]]],errorBound:[[g,w,S,0],[T,z,Qo(3*(o-e)),0]]}}function Go(t){const[[n,e],[r,o],[i,c]]=t,s=i-2*r,u=Do(i,2*r),f=Wo(u,n),l=Qo(s+n),a=Do(2*r,2*n),p=c-2*o,h=Do(c,2*o),d=Wo(h,e),g=Qo(p+e);return{coeffs:[[f,a,[0,n]],[d,Do(2*o,2*e),[0,e]]],errorBound:[[l,0,0],[g,0,0]]}}function Uo(t){const[[n,e],[r,o]]=t;return[[Do(r,n),[0,n]],[Do(o,e),[0,e]]]}const Zo=tn,Jo=$n,Ko=ct,ti=Math.abs;function ni(t){const[[n,[,e]],[r,[,o]]]=Uo(t),i=Ko(r),c=n,s=Jo(o,n),u=ti(s[1]),f=Jo(e,r),l=ti(f[1]),a=Zo(f,s);return{coeffs:{vₓ:i,vᵧ:c,v:a},errorBound:{v_:u+l+ti(a[1])}}}const{abs:ei}=Math,ri=Kt,oi=$n,ii=Wn;function ci(t){return[-t[0],-t[1]]}const si=ci,ui=tr,fi=$n,li=Wn,ai=tn,pi=Math.abs;function hi(t){const{coeffs:[[n,e,[,r]],[o,i,[,c]]],errorBound:[[s],[u]]}=Go(t),f=n[1],l=e[1],a=o[1],p=i[1],h=pi(r),d=pi(l),g=pi(f),v=pi(c),m=pi(p),x=pi(a),b=li(n,i),w=s*m+2*pi(f*p),_=li(e,o),M=d*u+2*pi(l*a),S=fi(c,n),N=v*s+pi(c*f),I=fi(r,o),y=h*u+pi(r*a),E=fi(c,e),C=pi(c*l),O=fi(r,i),T=pi(r*p),A=li(n,n),P=2*(s*g+pi(f*f)),k=li(n,o),B=s*x+g*u+2*pi(f*a),z=li(o,o),F=2*(u*x+pi(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lr[1]),Hr=Ni(Fn,Gt),Vr=Yn*Ut+Wn*yn+wi(Hr[1]),$r=Ii(Lr,Hr),Dr=Xr+Vr+wi($r[1]),qr=Ni(Dt,zr),jr=qt*Fr+Sn*Yr+wi(qr[1]),Wr=yi(qr,$r);return{coeffs:{vₓₓₓ:Gn,vₓₓᵧ:te,vₓᵧᵧ:ie,vᵧᵧᵧ:se,vₓₓ:Ne,vₓᵧ:Qe,vᵧᵧ:Be,vₓ:_r,vᵧ:Ar,v:Wr},errorBound:{vₓₓₓ_:Un,vₓₓᵧ_:ne,vₓᵧᵧ_:ce,vᵧᵧᵧ_:ue,vₓₓ_:Ie,vₓᵧ_:Re,vᵧᵧ_:ze,vₓ_:Mr,vᵧ_:Pr,v_:jr+Dr+wi(Wr[1])}}}const Ci=Jt,Oi=tr,Ti=$n,Ai=Wn,Pi=Kt,{abs:ki}=Math,Bi=Kt,zi=$n,Fi=Wn,{abs:Yi}=Math,Li=Jt,Xi=tr,Hi=$n,Vi=Wn,$i=Kt,{abs:Di}=Math,qi=Jt,ji=tr,Wi=$n,Qi=Wn,Ri=Kt,{abs:Gi}=Math,Ui=Kt,Zi=$n,Ji=Wn,{abs:Ki}=Math,tc=Jt,nc=tr,ec=$n,rc=Wn,oc=Kt,{abs:ic}=Math,cc=Jt,sc=tr,uc=$n,fc=Wn,lc=Kt,{abs:ac}=Math,pc=Z,hc=dt,dc=nt,gc=gt;function vc(t){if(4===t.length)return mc(t);if(3===t.length)return xc(t);if(2===t.length)return bc(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 mc(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[J(pc(s,n),dc(3,pc(r,i))),dc(3,gc(hc(i,n),-2*r)),dc(3,pc(r,n)),[n]].map(Pn),[J(pc(u,e),dc(3,pc(o,c))),dc(3,gc(hc(c,e),-2*o)),dc(3,pc(o,e)),[e]].map(Pn)]}function xc(t){const[[n,e],[r,o],[i,c]]=t;return[[gc(hc(i,n),-2*r),pc(2*r,2*n),[n]],[gc(hc(c,e),-2*o),pc(2*o,2*e),[e]]]}function bc(t){const[[n,e],[r,o]]=t;return[[pc(r,n),[n]],[pc(o,e),[e]]]}const wc=nt,_c=ct;function Mc(t){const[[n,[e]],[r,[o]]]=t;if(0!==lt(n)||0!==lt(r))return{vₓ:_c(r),vᵧ:n,v:Pn(ft(wc(e,r),wc(o,n)))}}const Sc=nt,Nc=ot,Ic=J;function yc(t,n){const e=bc(t),[[r,[o]],[i,[c]]]=bc(n),{vₓ:s,vᵧ:u,v:f}=Mc(e),l=Nc(r,s),a=Nc(i,u),p=Ic(l,a),h=Sc(o,s),d=Sc(c,u),g=Ic(h,d);return[p,Ic(g,f)].map(Pn)}const Ec=nt,Cc=Sr,Oc=ft,Tc=ot,Ac=ct;function Pc(t){const[[n,e,[r]],[o,i,[c]]]=t;if(0===lt(n)&&0===lt(o))return Mc([[e,[r]],[i,[c]]]);const s=Tc(n,i),u=Tc(e,o),f=Ec(c,n),l=Ec(r,o),a=Ec(c,e),p=Ec(r,i),h=Tc(n,n),d=Tc(n,o),g=Tc(o,o),v=Oc(s,u),m=Oc(f,l),x=Oc(a,p),b=Pn(Ac(g)),w=Pn(Cc(d)),_=Pn(Ac(h)),M=Tc(i,v),S=Cc(Tc(o,m)),N=Pn(Oc(M,S)),I=Cc(Tc(n,m)),y=Tc(e,v),E=Pn(Oc(I,y)),C=Tc(v,x),O=Tc(m,m);return{vₓₓ:b,vₓᵧ:w,vᵧᵧ:_,vₓ:N,vᵧ:E,v:Pn(Oc(C,O))}}const kc=Kn,Bc=nt,zc=ot,Fc=J,Yc=Sr;function Lc(t,n){const e=xc(t);if(0===lt(e[0][0])&&0===lt(e[1][0]))return yc([t[0],t[2]],n);const[[r,[o]],[i,[c]]]=bc(n),{vₓₓ:s,vₓᵧ:u,vᵧᵧ:f,vₓ:l,vᵧ:a,v:p}=Pc(e),h=kc(o,o),d=Bc(o,r),g=kc(o,c),v=Bc(o,i),m=zc(r,r),x=Bc(c,r),b=zc(r,i),w=kc(c,c),_=Bc(c,i),M=zc(i,i),S=zc(m,s),N=zc(M,f),I=zc(b,u),y=Fc(S,N),E=Fc(y,I),C=zc(d,s),O=zc(_,f),T=Fc(v,x),A=zc(T,u),P=Yc(Fc(C,O)),k=Fc(P,A),B=zc(r,l),z=zc(i,a),F=Fc(B,z),Y=Fc(k,F),L=zc(h,s),X=zc(g,u),H=zc(w,f),V=Fc(L,X),$=Fc(V,H),D=Bc(o,l),q=Bc(c,a),j=Fc(D,q),W=Fc($,j);return[E,Y,Fc(W,p)].map(Pn)}const Xc=ot,Hc=Z,Vc=tt,$c=dt;function Dc(t,n=!1){const[e,r,o,i]=t;if(!n){const[t,n]=e,[c,s]=r,[u,f]=o,[l,a]=i;return[e,[it(ft(Vc($c(c/4,u/4),3),$c(t/4,l/4))),it(ft(Vc($c(s/4,f/4),3),$c(n/4,a/4)))],i]}const c=function(t,n){const[[e,r],[o,i]]=t,[[c,s],[u,f]]=n,l=Hc(o,e),a=Hc(i,r),p=Hc(u,c),h=Hc(f,s),d=ft(Xc(p,a),Xc(h,l));if(0===lt(d))return;const g=Hc(c,e),v=Hc(s,r),m=it(ft(Xc(v,l),Xc(g,a)))/it(d);return[c+m*it(p),s+m*it(h)]}([e,r],[i,o]);if(void 0!==c)return[e,c,i]}const qc=nt,jc=ot,Wc=J,Qc=ft,Rc=ct,Gc=Sr;function Uc(t){const[[n,e,r,[o]],[i,c,s,[u]]]=t;if(0===lt(n)&&0===lt(i))return Pc([[e,r,[o]],[c,s,[u]]]);const f=jc(n,s),l=jc(r,i),a=jc(n,c),p=jc(e,c),h=jc(e,i),d=jc(n,n),g=jc(c,c),v=jc(i,i),m=jc(r,n),x=jc(e,e),b=jc(s,i),w=jc(c,i),_=jc(e,n),M=jc(n,i),S=qc(u,n),N=qc(o,i),I=qc(u,e),y=qc(o,c),E=jc(e,s),C=jc(r,c),O=qc(u,r),T=q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a}=Mc(e),p=os(r,f),h=os(c,l),d=is(p,h),g=os(o,f),v=os(s,l),m=is(g,v),x=rs(i,f),b=rs(u,l),w=is(x,b);return[d,m,is(w,a)].map(Pn)}const ss=Kn,us=nt,fs=ot,ls=J,as=Sr;function ps(t,n){const e=xc(t);if(0===lt(e[0][0])&&0===lt(e[1][0]))return cs([t[0],t[2]],n);const[[r,o,[i]],[c,s,[u]]]=xc(n);if(0===lt(r)&&0===lt(c))return Lc(t,[n[0],n[2]]);const{vₓₓ:f,vₓᵧ:l,vᵧᵧ:a,vₓ:p,vᵧ:h,v:d}=Pc(e),g=ss(i,i),v=us(i,o),m=us(i,r),x=ss(i,u),b=us(i,s),w=us(i,c),_=fs(o,o),M=fs(o,r),S=us(u,o),N=fs(o,s),I=fs(o,c),y=fs(r,s),E=fs(r,r),C=us(u,r),O=fs(r,c),T=ss(u,u),A=us(u,s),P=us(u,c),k=fs(s,s),B=fs(s,c),z=fs(c,c),F=fs(E,f),Y=fs(O,l),L=fs(z,a),X=ls(F,Y),H=ls(X,L),V=fs(M,f),$=fs(B,a),D=ls(I,y),q=fs(D,l),j=as(ls(V,$)),W=ls(j,q),Q=ls(as(m),_),R=ls(as(P),k),G=ls(w,N),U=ls(G,C),Z=fs(Q,f),J=fs(R,a),K=fs(U,l),tt=fs(r,p),nt=fs(c,h),et=ls(Z,J),rt=ls(et,K),ot=ls(tt,nt),it=ls(rt,ot),ct=fs(v,f),st=fs(A,a),ut=ls(b,S),ft=fs(ut,l),at=as(ls(ct,st)),pt=fs(o,p),ht=fs(s,h),dt=ls(at,ft),gt=ls(pt,ht),vt=ls(dt,gt),mt=fs(g,f),xt=fs(x,l),bt=fs(T,a),wt=us(i,p),_t=us(u,h),Mt=ls(mt,xt),St=ls(Mt,bt),Nt=ls(wt,_t),It=ls(St,Nt);return[H,W,it,vt,ls(It,d)].map(Pn)}const hs=Kn,ds=nt,gs=ot,vs=J,ms=Sr;function xs(t,n){const e=mc(t);if(0===lt(e[0][0])&&0===lt(e[1][0]))return ps(Dc(t),n);const[[r,o,[i]],[c,s,[u]]]=xc(n);if(0===lt(r)&&0===lt(c))return es(t,[n[0],n[2]]);const{vₓₓₓ:f,vₓₓᵧ:l,vₓᵧᵧ:a,vᵧᵧᵧ:p,vₓₓ:h,vₓᵧ:d,vᵧᵧ:g,vₓ:v,vᵧ:m,v:x}=Uc(e),b=hs(i,i),w=ds(i,o),_=ds(i,r),M=hs(i,u),S=ds(i,s),N=ds(i,c),I=gs(o,o),y=gs(o,r),E=ds(u,o),C=gs(o,s),O=gs(o,c),T=gs(r,s),A=gs(r,r),P=ds(u,r),k=gs(r,c),B=hs(u,u),z=ds(u,s),F=ds(u,c),Y=gs(s,s),L=gs(s,c),X=gs(c,c),H=gs(r,f),V=gs(r,a),$=gs(c,l),D=gs(c,p),q=vs(H,$),j=vs(V,D),W=gs(A,q),Q=gs(X,j),R=vs(W,Q),G=vs(_,I),U=vs(F,Y),Z=vs(ms(_),I),J=vs(ms(F),Y),K=vs(ms(C),P),tt=vs(ms(C),N),nt=vs(ms(P),C),et=vs(ds(6,_),I),rt=vs(ds(6,F),Y),ot=vs(O,T),it=vs(N,P),ct=vs(ms(E),S),st=vs(ms(S),E),ut=vs(N,C),ft=vs(ut,P),at=ds(3,A),pt=ds(3,X),ht=gs(at,f),dt=gs(A,l),gt=ms(gs(k,l)),vt=ms(gs(k,a)),mt=gs(X,a),xt=gs(pt,p),bt=vs(ht,gt),wt=vs(dt,vt),_t=vs(bt,mt),Mt=vs(wt,xt),St=gs(o,_t),Nt=gs(s,Mt),It=vs(St,Nt),yt=gs(c,Z),Et=gs(c,tt),Ct=gs(r,K),Ot=gs(r,J),Tt=gs(ds(3,r),G),At=gs(ds(3,c),U),Pt=vs(yt,Ct),kt=vs(Et,Ot),Bt=gs(Tt,f),zt=gs(At,p),Ft=gs(Pt,l),Yt=gs(kt,a),Lt=vs(Bt,zt),Xt=vs(Ft,Yt),Ht=gs(A,h),Vt=gs(X,g),$t=gs(k,d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ne=vs(Se,we),Ie=vs(_e,Me),ye=vs(Ne,Ie);return[R,It,Wt,dn,Hn,fe,vs(ye,x)].map(Pn)}const bs=nt,ws=ot,_s=J;function Ms(t,n){const e=bc(t),[[r,o,i,[c]],[s,u,f,[l]]]=mc(n);if(0===lt(r)&&0===lt(s))return cs(t,Dc(n));const{vₓ:a,vᵧ:p,v:h}=Mc(e),d=ws(r,a),g=ws(s,p),v=_s(d,g),m=ws(o,a),x=ws(u,p),b=_s(m,x),w=ws(i,a),_=ws(f,p),M=_s(w,_),S=bs(c,a),N=bs(l,p),I=_s(S,N);return[v,b,M,_s(I,h)].map(Pn)}const Ss=Kn,Ns=nt,Is=ot,ys=J,Es=Sr;function Cs(t,n){const e=xc(t);if(0===lt(e[0][0])&&0===lt(e[1][0]))return Ms([t[0],t[2]],n);const[[r,o,i,[c]],[s,u,f,[l]]]=mc(n);if(0===lt(r)&&0===lt(s))return ps(t,Dc(n));const{vₓₓ:a,vₓᵧ:p,vᵧᵧ:h,vₓ:d,vᵧ:g,v}=Pc(e),m=Ss(c,c),x=Ns(c,i),b=Ns(c,o),w=Ns(c,r),_=Ss(c,l),M=Ns(c,f),S=Ns(c,u),N=Ns(c,s),I=Is(i,i),y=Is(i,o),E=Is(i,r),C=Ns(l,i),O=Is(i,f),T=Is(i,u),A=Is(i,s),P=Is(o,f),k=Is(o,o),B=Is(o,r),z=Ns(l,o),F=Is(o,u),Y=Is(o,s),L=Is(r,r),X=Ns(l,r),H=Is(r,f),V=Is(r,u),$=Is(r,s),D=Ss(l,l),q=Ns(l,f),j=Ns(l,u),W=Ns(l,s),Q=Is(f,f),R=Is(f,u),G=Is(s,s),U=Is(u,u),Z=Is(u,s),J=Is(f,s),K=Is(L,a),tt=Is($,p),nt=Is(G,h),et=ys(K,tt),rt=ys(et,nt),ot=Is(B,a),it=Is(Z,h),ct=ys(ot,it),st=ys(Y,V),ut=Is(st,p),ft=ys(Es(ct),ut),at=ys(Es(E),k),pt=ys(Es(J),U),ht=ys(A,F),dt=ys(ht,H),gt=Is(at,a),vt=Is(pt,h),mt=ys(gt,vt),xt=Is(dt,p),bt=ys(mt,xt),wt=ys(w,y),_t=ys(W,R),Mt=ys(N,T),St=ys(P,X),Nt=ys(Mt,St),It=Is(wt,a),yt=Is(_t,h),Et=Es(ys(It,yt)),Ct=Is(Nt,p),Ot=Is(r,d),Tt=Is(s,g),At=ys(Ot,Tt),Pt=ys(Et,Ct),kt=ys(Pt,At),Bt=ys(Es(b),I),zt=ys(Es(j),Q),Ft=ys(S,O),Yt=ys(Ft,z),Lt=Is(Bt,a),Xt=Is(zt,h),Ht=Is(Yt,p),Vt=ys(Lt,Xt),$t=ys(Vt,Ht),Dt=Is(o,d),qt=Is(u,g),jt=ys(Dt,qt),Wt=ys($t,jt),Qt=Is(x,a),Rt=Is(q,h),Gt=ys(M,C),Ut=Is(Gt,p),Zt=Es(ys(Qt,Rt)),Jt=ys(Zt,Ut),Kt=Is(i,d),tn=Is(f,g),nn=ys(Kt,tn),en=ys(Jt,nn),rn=Is(m,a),on=Is(_,p),cn=Is(D,h),sn=Ns(c,d),un=Ns(l,g),fn=ys(rn,on),ln=ys(fn,cn),an=ys(sn,un),pn=ys(ln,an);return[rt,ft,bt,kt,Wt,en,ys(pn,v)].map(Pn)}const Os=Kn,Ts=nt,As=ot,Ps=J,ks=Sr,Bs=[[function(t,n){const{coeffs:{vₓ:e,vᵧ:r,v:o},errorBound:{v_:i}}=ni(t),[[c,[,s]],[u,[,f]]]=Uo(n),l=c[1],a=u[1],p=e[1],h=r[1],d=o[1],g=l*p,v=2*ei(g),m=ii(c,e),x=a*h,b=2*ei(x),w=ii(u,r),_=g+x,M=ri(m,w),S=v+b+ei(_),N=s*p,I=oi(s,e),y=ei(N),E=f*h,C=oi(f,r),O=ei(E),T=N+E,A=ri(I,C),P=y+O+ei(T);return{coeffs:[M,ri(A,o)],errBound:[S,P+i+ei(T+d)]}},function(t,n){const{coeffs:{vₓ:e,vᵧ:r,v:o},errorBound:{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S),O),fo=Ps(ks(G),Z),lo=As(p,to),ao=As(h,no),po=As(v,so),ho=As(g,uo),go=As(m,fo),vo=As(o,x),mo=As(u,b),xo=Ps(vo,mo),bo=Ps(lo,ao),wo=Ps(co,po),_o=Ps(ho,go),Mo=Ps(bo,wo),So=Ps(_o,xo),No=Ps(Mo,So),Io=Ps(P,y),yo=Ts(c,p),Eo=Ts(l,h),Co=Ps(Io,P),Oo=Ps(Io,y),To=As(i,_),Ao=As(To,a),Po=As(f,Q),ko=As(Po,d),Bo=As(v,Io),zo=As(M,g),Fo=As(R,m),Yo=Ps(zo,Fo),Lo=As(i,x),Xo=As(f,b),Ho=Ps(Lo,Xo),Vo=As(yo,Co),$o=As(Eo,Oo),Do=Ps(Vo,$o),qo=Ts(3,Ps(Ao,ko)),jo=Ps(Bo,ks(Yo)),Wo=Ps(Do,qo),Qo=Ps(jo,Ho),Ro=Ps(Wo,Qo),Go=Ts(c,a),Uo=Ts(l,p),Zo=Ps(Go,Uo),Jo=Ts(c,h),Ko=Ts(l,d),ti=Ps(Jo,Ko),ni=Ps(Zo,g),ei=Ps(ti,m),ri=As(_,ni),oi=As(Q,ei),ii=Ps(ri,oi),ci=As(I,v),si=Ps(ii,ci),ui=Ts(c,x),fi=Ts(l,b),li=Ps(ui,fi),ai=Ps(si,li);return[dt,Et,Jt,Fn,be,Ke,Vr,No,Ro,Ps(ai,w)].map(Pn)}]];function Fs(t,n){const{coeffs:e,errBound:r}=Bs[t.length-2][n.length-2](t,n);return{coeffs:e,errBound:r,getPExact:()=>zs[t.length-2][n.length-2](t,n)}}const Ys=134217729;function Ls(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=r/i,s=i*c,u=Ys*i,f=u-(u-i),l=i-f,a=Ys*c,p=a-(a-c),h=c-p,d=o*c,g=s+d,v=d-(g-s)+(l*h-(s-f*p-l*p-f*h)),m=g+v,x=(r-m+(e-(v-(m-g))))/i,b=c+x;return[x-(b-c),b]}const Xs=Ls,Hs=Number.EPSILON/2,Vs=Hs*Hs,$s=tn,Ds=tn,qs=Wn,js=Kt,Ws=tn,Qs=Ke,Rs=$o,{abs:Gs}=Math,Us=[0,1],Zs=tn,Js=$o,Ks=Kt,tu=Wn,nu=$n,eu=tr,ru=function(t,n,e,r){const o=t[0],i=t[1],c=n[0],s=n[1],u=Xs(t,n),f=Math.abs(o+i),l=Math.abs(c+s),a=l-Hs*l-r;return a<=0?{est:u,err:Number.POSITIVE_INFINITY}:{est:u,err:(l*e+f*r)/a**2+9*Vs*Math.abs(f/l)}},ou=function(t,n){return $s(t,n)[1]>0?n:t},iu=function(t,n){return Ds(t,n)[1]>0?t:n};function cu(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],[c,s]],[u,f]){const l=Zs(f,u),a=3*ze*Gs(l[1]),p=Zs(Us,u),h=3*ze*Gs(p[1]),d=ru(l,p,a,h);f=Js(d.est,d.err);const g=Zs(Us,u),v=tu(u,u),m=tu(u,g),x=tu(g,g),b=tu(v,u),w=tu(v,g),_=tu(x,u),M=tu(x,g),S=Zs(Us,f),N=tu(f,f),I=tu(f,S),y=tu(S,S),E=tu(N,f),C=tu(N,S),O=tu(y,f),T=tu(y,S),A=Gs(u[1]),P=Gs(g[1]),k=Gs(v[1]),B=Gs(m[1]),z=Gs(x[1]),F=Gs(b[1]),Y=Gs(w[1]),L=Gs(_[1]),X=Gs(M[1]),H=Gs(f[1]),V=Gs(S[1]),$=Gs(N[1]),D=Gs(I[1]),q=Gs(y[1]),j=Gs(E[1]),W=Gs(C[1]),Q=Gs(O[1]),R=Gs(T[1]);let G=Gs(t),U=Gs(n),Z=Gs(e),J=Gs(r),K=Gs(o),tt=Gs(i),nt=Gs(c),et=Gs(s);const rt=Ks(nu(c,u),nu(o,g)),ot=Ks(Ks(nu(c,v),nu(2*o,m)),nu(e,x)),it=Ks(Ks(nu(c,b),nu(t,M)),nu(3,Ks(nu(o,w),nu(e,_)))),ct=Ks(tu(ot,f),tu(it,S)),st=Ks(Ks(tu(rt,N),tu(it,y)),tu(eu(ot),I)),ut=Ks(Ks(nu(c,E),tu(it,T)),nu(3,Ks(tu(rt,C),tu(ot,O)))),ft=Gs(it[1]),lt=nt*A+K*P,at=nt*k+2*K*B+Z*z;G=nt*F+G*X+3*(K*Y+Z*L),Z=at*H+ft*V,K=lt*$+ft*q+2*at*D,nt=nt*j+ft*R+3*(lt*W+at*Q),G*=11*ze,Z*=15*ze,K*=20*ze,nt*=22*ze;const pt=Ks(nu(s,u),nu(i,g)),ht=Ks(Ks(nu(s,v),nu(2*i,m)),nu(r,x)),dt=Ks(Ks(nu(s,b),nu(n,M)),nu(3,Ks(nu(i,w),nu(r,_)))),gt=Ks(tu(ht,f),tu(dt,S)),vt=Ks(Ks(tu(pt,N),tu(dt,y)),tu(eu(ht),I)),mt=Ks(Ks(nu(s,E),tu(dt,T)),nu(3,Ks(tu(pt,C),tu(ht,O)))),xt=Gs(dt[1]),bt=et*A+tt*P,wt=et*k+2*tt*B+J*z;U=et*F+U*X+3*(tt*Y+J*L),J=wt*H+xt*V,tt=bt*$+xt*q+2*wt*D,et=et*j+xt*R+3*(bt*W+wt*Q),U*=11*ze,J*=15*ze,tt*=20*ze,et*=22*ze;const _t=ou(ou(Js(it,-G),Js(ct,-Z)),ou(Js(st,-K),Js(ut,-nt))),Mt=iu(iu(Js(it,+G),Js(ct,+Z)),iu(Js(st,+K),Js(ut,+nt)));return[[_t,ou(ou(Js(dt,-U),Js(gt,-J)),ou(Js(vt,-tt),Js(mt,-et)))],[Mt,iu(iu(Js(dt,+U),Js(gt,+J)),iu(Js(vt,+tt),Js(mt,+et)))]]}(t,n):3===t.length?function([[t,n],[e,r],[o,i]],[c,s]){const u=Zs(s,c),f=3*ze*Gs(u[1]),l=Zs(Us,c),a=3*ze*Gs(l[1]),p=ru(u,l,f,a);s=Js(p.est,p.err);const h=Zs(Us,c),d=tu(c,c),g=tu(c,h),v=tu(h,h),m=Zs(Us,s),x=tu(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nu(n,a)),N=Ks(nu(r,i),tu(S,p));x=w*h+x*d,w=w*g+x*v,x*=3*Be,w*=7*Be;const I=ou(Js(_,-m),Js(M,-b)),y=iu(Js(_,+m),Js(M,+b));return[[I,ou(Js(S,-x),Js(N,-w))],[y,iu(Js(S,+x),Js(N,+w))]]}(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=>[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],[c,s],[u,f]]=t,l=Rs(qs(Qs(o,e),n),e),a=Rs(qs(Qs(c,o),n),o),p=Rs(qs(Qs(u,c),n),c),h=js(l,qs(Ws(a,l),n)),d=js(a,qs(Ws(p,a),n)),g=js(h,qs(Ws(d,h),n)),v=Rs(qs(Qs(i,r),n),r),m=Rs(qs(Qs(s,i),n),i),x=Rs(qs(Qs(f,s),n),s),b=js(v,qs(Ws(m,v),n)),w=js(m,qs(Ws(x,m),n));return[g,js(b,qs(Ws(w,b),n))]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=js([0,e],qs(Qs(o,e),n)),f=js([0,o],qs(Qs(c,o),n)),l=js(u,qs(Ws(f,u),n)),a=js([0,r],qs(Qs(i,r),n)),p=js([0,i],qs(Qs(s,i),n));return[l,js(a,qs(Ws(p,a),n))]}if(2===t.length){const[[e,r],[o,i]]=t;return[Rs(qs(Qs(o,e),n),e),Rs(qs(Qs(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=ke(t,n).map(t=>16*Fe*t);else if(3===t.length)i=ke(t,n).map(t=>10*Fe*t);else if(2===t.length)i=ke(t,n).map(t=>4*Fe*t);else if(1===t.length)return[o,o];return[[Js(o[0],-i[0]),Js(o[1],-i[1])],[Js(o[0],+i[0]),Js(o[1],+i[1])]]}(t,n[0])}function su(t){return(n,e)=>{let[[r,o],[i,c]]=n,[[s,u],[f,l]]=e;return(o[1]>c[1]||o[1]===c[1]&&o[0]>c[0])&&([o,c]=[c,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]),(s[1]>f[1]||s[1]===f[1]&&s[0]>f[0])&&([s,f]=[f,s]),t?(r[1]<f[1]||r[1]===f[1]&&r[0]<=f[0])&&(i[1]>s[1]||i[1]===s[1]&&i[0]>=s[0])&&(u[1]<c[1]||u[1]===c[1]&&u[0]<=c[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]>s[1]||i[1]===s[1]&&i[0]>s[0])&&(u[1]<c[1]||u[1]===c[1]&&u[0]<c[0])&&(l[1]>o[1]||l[1]===o[1]&&l[0]>o[0])}}function uu(t){return[((n=t.x.box)[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2];var n}function fu(t,n){const e=Fs(t,n);if(void 0===e)return;const{coeffs:r,errBound:o,getPExact:i}=e,c=Te(r,0,1,o,i)||[];return 0!==c.length?{ris:c.map(Vo),getPExact:i}:void 0}function lu(t){const n=it(t.tS);return{t:n,tS:n,tE:it(t.tE),multiplicity:t.multiplicity}}function au(t,n){const e=fu(t,n);if(void 0===e)return[];const{getPExact:r}=e;let o,{ris:i}=e;const c=()=>(o=o||r(),o),s=fu(n,t);if(void 0===s)return[];let{ris:u}=s;const{getPExact:f}=s;let l;const a=()=>(l=l||f(),l);let p;p=1;let h,d=0;t:for(;d<p;){h=u.map(n=>cu(t,[n.tS,n.tE]));for(let t=0;t<u.length;t++){const n=h[t];for(let e=t+1;e<u.length;e++){const t=h[e];if(su(!0)(n,t)){const t=[];for(const n of u)t.push(...Zr({t:n.tS[1],tS:n.tS[1],tE:n.tE[1],multiplicity:n.multiplicity},a()));u=t,d++;continue t}}}break t}p=1;let g,v=0;t:for(;v<p;){g=i.map(t=>cu(n,[t.tS,t.tE]));for(let t=0;t<i.length;t++){const n=g[t];for(let e=t+1;e<i.length;e++){const t=g[e];if(su(!0)(n,t)){const t=[];for(const n of i)t.push(...Zr({t:n.tS[1],tS:n.tS[1],tE:n.tE[1],multiplicity:n.multiplicity},c()));i=t,v++;continue t}}}break t}const m=[];for(let t=0;t<u.length;t++){const n=h[t];for(let e=0;e<i.length;e++){const o=g[e];if(su(!0)(n,o)){const c={compensated:d,ri:lu(u[t]),riExp:d?u[t]:void 0,getPExact:d?void 0:f,kind:1,box:pu(n)},s={compensated:v,ri:lu(i[e]),riExp:v?i[e]:void 0,getPExact:v?void 0:r,kind:1,box:pu(o)};m.push({psX:c,sideX:s})}}}return m}function pu(t){return t.map(t=>t.map(it))}function hu(t,n){return function(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,c=e.slice();for(let t=0;t<i.length;t++){const n=au(o,i[t]);for(const{psX:e,sideX:r}of n)c.push({x:e,side:t,sideX:r,curve:void 0})}c.sort((t,n)=>t.x.ri.tS-n.x.ri.tS);const s=[],u=[];let f,l;for(const n of c)void 0!==n.side?(!0===l&&(u.push({idx:++r,dir:1,p:uu(n),_x_:f,container:t,side:n.side,sideX:n.sideX,loopsIdxs:new Set,children:new Set,windingNum:0,orientation:0}),f.out=u[u.length-1]),l=!1):(!1===l&&(s.push({idx:++r,dir:-1,p:uu(f),_x_:n,container:t,side:f.side,sideX:f.sideX,loopsIdxs:new Set,children:new Set,windingNum:0,orientation:0}),n.in_=s[s.length-1]),l=!0),f=n;return{ins:s,outs:u,ioIdx:r}}}(t);for(const t of o){const[e,o]=t;let c,s;({ins:c,outs:s,ioIdx:n}=i(e,o,n)),r.push(...c),r.push(...s)}return{inOuts:r,ioIdx:n}}(t,n)}function du(t,n,e,r){const o=[];for(const r of t)o.push({type:-1,item:r,x:n(r)}),o.push({type:1,item:r,x:e(r)});o.sort(gu);const i=new Set,c=[];for(const t of o){const{item:n,type:e}=t;if(-1===e){for(const t of i){const e=r(n,t);e&&c.push({a:n,b:t,u:e})}i.add(n)}else 1===e&&i.delete(n)}return c}function gu(t,n){const e=t.x-n.x;return 0!==e?e:t.type}function vu(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 c;if(r>0){if(o<=0)return i;c=r+o}else{if(!(r<0))return i;if(o>=0)return i;c=-r-o}return Math.abs(i)>=3330669073875472e-31*c?i:function(t,n,e,r){const o=t[0]-e[0],i=n[0]-e[0],c=t[1]-e[1],s=n[1]-e[1],u=ft(Kn(o,s),Kn(c,i));let f=it(u);if(Math.abs(f)>=2220446049250315e-31*r)return f;const l=Z(t[0],e[0])[0],a=Z(n[0],e[0])[0],p=Z(t[1],e[1])[0],h=Z(n[1],e[1])[0];if(0===l&&0===p&&0===a&&0===h)return f;const d=1109335647967049e-46*r+3330669073875471e-31*Math.abs(f);if(f+=o*h+s*l-(c*a+i*p),Math.abs(f)>=d)return f;const g=J(u,ft(Kn(l,s),Kn(p,i))),v=J(g,ft(Kn(o,h),Kn(c,a)));let m=J(v,ft(Kn(l,h),Kn(p,a)));return m=Pn(m),m[m.length-1]}(t,n,e,c)}function mu(t,n){const e=n[0]-t[0],r=n[1]-t[1];return e*e+r*r}function xu(t,n){if(0===t.length)return;const e=t.slice(),r=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}(e),[o]=e.splice(r,1);e.sort((t,n)=>{let e=-vu(o,t,n);return 0!==e?e:(e=t[1]-n[1],0!==e?e:t[0]-n[0])}),e.unshift(o);const i=function(t){const n=[t[0]],e=t.length;for(let r=1;r<t.length;r++){const o=t[(r+e-1)%e],i=t[r];o[0]===i[0]&&o[1]===i[1]||n.push(i)}return n}(e),c=[];for(const t of i){for(;c.length>=2&&vu(c[c.length-2],c[c.length-1],t)<0;)c.pop();c.push(t)}if(n||c.length<3)return c;const s=[];{const t=c.length;for(let n=0;n<t;n++){const e=(n+1)%t,r=c[(n+t-1)%t],o=c[n],i=c[e];(0!==vu(r,o,i)||bu(r,o,i)<0)&&s.push(o)}}return s}function bu(t,n,e){const r=n[0]-t[0],o=n[1]-t[1];return r*(e[0]-n[0])+o*(e[1]-n[1])}const wu=xu,_u=Kt,Mu=ot,Su=J,Nu=Wn,Iu=Math.abs,yu=Le(3);const Eu=Math.abs;const Cu=Math.abs,Ou=Wn,Tu=Kt,Au=ot,Pu=J,ku=Math.abs,Bu=Ye(1),zu=Le(3);function Fu(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=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,c]]=lo(t),s=n*i-e*o,u=n*c-r*o;return{vₓₓ:-o*o,vₓᵧ:2*n*o,vᵧᵧ:-n*n,vₓ:i*s-2*o*u,vᵧ:2*n*u-e*s,v:s*(e*c-r*i)-u*u}}(t),{vₓₓ_:l,vₓᵧ_:a,vᵧᵧ_:p,vₓ_:h,vᵧ_:d,v_:g}=function(t){const[n,e]=t[0],[[r,o],[i,c]]=function(t){const[[n,e],[r,o],[i,c]]=t,s=Eu(n),u=Eu(r),f=Eu(i),l=Eu(e),a=Eu(o);return[[f+s+2*u,2*(u+s),0],[Eu(c)+l+2*a,2*(a+l),0]]}(t),s=Cu(n),u=Cu(e),f=r*c+o*i,l=r*u+s*i;return{vₓₓ_:i*i,vₓᵧ_:2*r*i,vᵧᵧ_:r*r,vₓ_:c*f+2*i*l,vᵧ_:2*r*l+o*f,v_:f*(o*u+s*c)+l*l}}(t),v=u?0:1,m=ku(c),x=ku(s);if((v+12)*Bu*(l*(m*m)+a*(m*x)+p*(x*x)+(h*m+d*x)+g)<ku(n*c*c+e*c*s+r*s*s+(o*c+i*s)+f))return!1}{const{coeffs:{vₓₓ:n,vₓᵧ:o,vᵧᵧ:i,vₓ:u,vᵧ:f,v:l},errorBound:{vₓₓ_:a,vₓᵧ_:p,vᵧᵧ_:h,vₓ_:d,vᵧ_:g,v_:v}}=hi(t),m=jr(e),x=jr(r),b=ku(c),w=ku(s),_=b/3,M=w/3,S=Ou(m,m),N=S[1],I=2*(b*_+N),y=Ou(x,x),E=y[1],C=2*(w*M+E),O=Ou(m,x),T=ku(O[1]),A=b*M+_*w+2*T,P=Ou(n,S),k=ku(n[1])*I+a*N+2*ku(P[1]),B=Ou(o,O),z=ku(o[1])*A+p*T+2*ku(B[1]),F=Ou(i,y),Y=ku(i[1])*C+h*E+2*ku(F[1]),L=Ou(m,u),X=ku(u[1])*_+d*b+2*ku(L[1]),H=Ou(x,f),V=ku(f[1])*M+g*w+2*ku(H[1]),$=Tu(P,B),D=k+z+ku($[1]),q=Tu($,F),j=D+Y+ku(q[1]),W=Tu(L,H),Q=X+V+ku(W[1]),R=Tu(q,W),G=j+Q+ku(R[1]),U=Tu(R,l),Z=G+v+ku(U[1]);if(zu*Z<ku(it(U)))return!1}{const n=function(t){return Pc(xc(t))}(t);if(void 0===n)return u&&c===t[0][0]&&s===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ᵧ:a,v:p}=n;return 0===lt(Pu(Pu(Pu(Au(o,Au(e,e)),Au(i,Au(e,r))),Au(f,Au(r,r))),Pu(Pu(Au(e,l),Au(r,a)),p)))}}const Yu=Math.abs,Lu=Wn,Xu=Kt,Hu=ot,Vu=J,$u=Math.abs,Du=Ye(1),qu=Le(3);function ju(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=r[i-1],u=1===o&&1===i;{const{vₓₓₓ:n,vₓₓᵧ:e,vₓᵧᵧ:r,vᵧᵧᵧ:o,vₓₓ:i,vₓᵧ:f,vᵧᵧ:l,vₓ:a,vᵧ:p,v:h}=function(t){const[[n,e,r,o],[i,c,s,u]]=fo(t),f=n*s,l=r*i,a=n*c,p=e*i,h=n*n,d=i*i,g=n*u-o*i,v=f-l,m=a-p,x=e*u-o*c,b=e*s-r*c,w=r*u-o*s,_=2*v,M=g*g,S=g*b,N=_*x,I=m*x,y=-3*g-b,E=-3*M-2*S+(N+m*w),C=2*(g*v-I),O=g*m-v*v+m*b;return{vₓₓₓ:-i*d,vₓₓᵧ:3*n*d,vₓᵧᵧ:-3*i*h,vᵧᵧᵧ:n*h,vₓₓ:y*d+m*(s*i-c*c)+_*c*i,vₓᵧ:2*(m*(e*c-(l+f)/2)-(y*n*i+v*(p+a))),vᵧᵧ:y*h+m*(r*n-e*e)+_*e*n,vₓ:i*E+(c*C+s*O),vᵧ:-n*E-(e*C+r*O),v:g*(N-M-S)+(O*w-I*x)}}(t),{vₓₓₓ_:d,vₓₓᵧ_:g,vₓᵧᵧ_:v,vᵧᵧᵧ_:m,vₓₓ_:x,vₓᵧ_:b,vᵧᵧ_:w,vₓ_:_,vᵧ_:M,v_:S}=function(t){const[n,e]=t[0],[[r,o,i],[c,s,u]]=function(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=Eu(n),l=Eu(r),a=Eu(i),p=Eu(s),h=Eu(e),d=Eu(o),g=Eu(c);return[[p+f+3*(l+a),3*(a+f+2*l),3*(l+f),0],[Eu(u)+h+3*(d+g),3*(g+h+2*d),3*(d+h),0]]}(t),f=Yu(n),l=Yu(e),a=r*u,p=i*c,h=r*s,d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:g,v}=n,m=Hu(e,e),x=Hu(e,m),b=Hu(r,r),w=Hu(r,b),_=Hu(r,m),M=Hu(e,b),S=Hu(e,r),N=Hu(o,x),I=Hu(i,_),y=Hu(f,M),E=Hu(l,w),C=Hu(a,m),O=Hu(p,S),T=Hu(h,b),A=Hu(e,d),P=Hu(r,g),k=Vu(N,I),B=Vu(y,E),z=Vu(k,B),F=Vu(C,O),Y=Vu(F,T),L=Vu(z,Y),X=Vu(A,P),H=Vu(X,v);return 0===lt(Vu(L,H))}}function Wu(t,n){const{coeffs:e,errBound:r,getPExact:o}=Fs(t,n);return Te(e,0,1,r,o)}const Qu=Math.min,Ru=Math.max;function Gu(t,n){let[[e,r],[o,i]]=t,[[c,s],[u,f]]=n;if(e>o&&([e,o]=[o,e]),c>u&&([c,u]=[u,c]),r>i&&([r,i]=[i,r]),s>f&&([s,f]=[f,s]),e<=u&&o>=c&&s<=i&&f>=r)return[[Ru(e,c),Ru(r,s)],[Qu(o,u),Qu(i,f)]]}function Uu(t,n,e){if(void 0===e)return;if(0===e.length)return[];const r=Wu(n,t);if(void 0===r)return;if(0===r.length)return[];const o=r.map(n=>Ge(t,[n.tS,n.tE])),i=e.map(t=>Ge(n,[t.tS,t.tE])),c=[];for(let t=0;t<r.length;t++){const n=o[t];for(let o=0;o<e.length;o++){const s=Gu(n,i[o]);if(void 0!==s){const n={ri:r[t],box:s,kind:1},i={ri:e[o],box:s,kind:1};c.push([n,i])}}}return c}function Zu(t,n,e){for(const r of[t,n]){const o=r.length;for(let i=1;i<o+1;i++){const c=r[i-1],s=r[i%o],u=[s[1]-c[1],c[0]-s[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 a=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY;for(let t=0;t<n.length;t++){const e=u[0]*n[t][0]+u[1]*n[t][1];e<a&&(a=e),e>p&&(p=e)}if(e&&(l<a||p<f))return!1;if(!e&&(l<=a||p<=f))return!1}}return!0}const Ju=Kn,Ku=J,tf=Number.EPSILON/2,nf=Math.abs;function ef(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=s+3*r,l=n+3*i,a=f-l,p=nf(3*r)+nf(f)+(nf(3*i)+nf(l))+nf(a);if(nf(a)-tf*p>0)return!1;const h=u+3*o,d=e+3*c,g=h-d,v=nf(3*o)+nf(h)+(nf(3*c)+nf(d))+nf(g);return!(nf(g)-tf*v>0)&&0===lt(ft(Ku([s],Ju(3,r)),Ku([n],Ju(3,i))))&&0===lt(ft(Ku([u],Ju(3,o)),Ku([e],Ju(3,c))))}const rf=dt,{abs:of}=Math;function cf(t){const[[n,e],[r,o],[i,c]]=t,s=n+i,u=s-2*r,f=of(s)+of(u);if(of(u)-f>0)return!1;const l=e+c,a=l-2*o,p=of(l)+of(a);return!(of(a)-p>0)&&0===lt(ft(rf(n,i),[2*r]))&&0===lt(ft(rf(e,c),[2*o]))}function sf(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 uf(t){return 4===t.length&&ef(t)&&(t=Dc(t)),3===t.length&&cf(t)&&(t=[t[0],t[2]]),2===t.length&&sf(t)&&(t=[t[0]]),t}const ff=Number.EPSILON,lf=ff/2;function af(t,n){return n<0?t<1?t:1-lf:0===n?1:t>1?t:1+ff}function pf(t){const n=function(t){const n=new ArrayBuffer(8);return new DataView(n).setFloat64(0,t,!1),Array.from(new Uint8Array(n))}(t),e=n[0],r=n[1],o=e>>7,i=((127&e)<<4)+((240&r)>>4),c=0===i?0:16,s=0===i?i-1022:i-1023,u=n.slice(1);return u[0]=(15&r)+c,{sign:o,exponent:s,significand:u}}function hf(t){return pf(t).significand}function df(t){return Math.log2(t&-t)}function gf(t){if(0===t||!Number.isFinite(t))return NaN;const n=hf(t),e=n.length;for(let t=e-1;t>=0;t--){if(0===n[t])continue;const r=df(n[t]);if(Number.isFinite(r))return 8*(e-t-1)+r}return NaN}function vf(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 mf(t){if(0===t||!Number.isFinite(t))return NaN;const n=hf(t),e=n.length;for(let t=0;t<e;t++){const r=vf(n[t]);if(Number.isFinite(r))return 8*(e-t-1)+r}return NaN}function xf(t){return pf(t).exponent}function bf(t){if(0===t||!Number.isFinite(t))return NaN;const n=xf(t);return mf(t)-52+n}function wf(t,n){const e=(2**(53-n)+1)*t;return e-(e-t)}const _f=lt,Mf=Pn;function Sf(t){return 0===t?0:mf(t)-gf(t)+1}const Nf=ot,If=function(t,n){if(t=Mf(t),0===_f(t))return[0];const e=bf(t[t.length-1]);let r=e,o=t.length-1;for(;o>0;){const i=bf(t[o-1]);if(e-i>n)break;r=i,o--}const i=Math.min(n-(e-r),53);let c=t[o];c=wf(c,i);const s=t.slice(o);return s[0]=c,s},yf=function(t){const n=Pn(t);if(0===lt(n))return 0;const e=n[n.length-1],r=n[0];return xf(e)-xf(r)+(53-gf(r))},Ef=ft,Cf=it;function Of(t){return it(function(t,n,e){let r=n,o=t,i=!1,c=0;e||(c=yf(o)-yf(r)+1,e=c/53+1,i=!0);let s=[1/Cf(r)],u=1;for(;;){if(o=Nf(o,s),u>e)return i?(o=If(o,c),o):o.slice(o.length-e,o.length);r=Nf(r,s),s=Ef([2],r),u*=2}}(t[0],t[1],2))}function Tf(t){return lt(t[0])*lt(t[1])}function Af(t){return(n,e)=>{const r=vc(n),o=vc(e),i=vc(n.slice().reverse()),c=vc(e.slice().reverse()),s=t(r,o),u=t(i,o),f=t(r,c),l=t(i,c),a=-Tf(u),p=-Tf(l),h=Of(s),d=Of(f);return[af(h,a),af(d,p)]}}const Pf=Af(function(t,n){const e=0===lt(t[0][0])?1:0;return function(t,n){const[e,r]=t,[,o]=n;return[ft(o,r),e]}(t[e],n[e])});function kf(t,n){return Jr(ot(t[0],n[1]),ot(t[1],n[0]))*lt(t[1])*lt(n[1])}function Bf(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=-xf(e)+Sf(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 0n;const e=-xf(t)+Sf(t)-1;return BigInt(t*2**e)*2n**BigInt(n-e)})):t.map(t=>t.map(t=>BigInt(t*2**n)))}function zf(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 Ff=BigInt(2**53);function Yf(t){if(0n===t)return[0];const n=[];let e=0,r=t;for(;0n!==r;){r=t/Ff;const o=t%Ff;n.push(Number(o)*2**(53*e)),t=r,e++}return Pn(n)}const{round:Lf,sqrt:Xf}=Math;function Hf(t){if(t<=1n){if(t<0n)throw new Error("square root of negative numbers are not allowed");return t}let n=BigInt(Lf(Xf(Number(t))));for(;;){const e=n+t/n>>1n;if(e===n)return n;n=e}}function Vf(t){return t<0n?-t:t}function $f(t){let n=0n;for(let e=0;e<t.length;e++)n+=t[e];return n}function Df(t,n){const[e,r]=qf(t[0],n[0]),[o,i]=qf(t[1],n[1]);if(0===kf(e,o)||0===kf(e,i))return e;if(0===kf(r,o)||0===kf(r,i))return r;throw new Error("An unexpected error occured.")}function qf(t,n){const[e,r]=t,[o,i]=n,[c,s]=function(t){const[n,e]=Bf(t).map($f),r=zf(n,e);return[Yf(Hf(Vf(n/r))),Yf(Hf(Vf(e/r)))]}([o,e]);return[[ft(ot(i,s),ot(r,c)),ot(c,Sr(e))],[ft(ot(i,ct(s)),ot(r,c)),ot(c,Sr(e))]].sort(kf)}function jf(t,n){const e=vc(t),r=0===lt(e[0][0])?0:0===lt(e[1][0])?1:-1;if(-1!==r){const e=t[0][r],o=t[2][r],i=n[0][r],c=n[2][r];return Pf([[e,e],[o,o]],[[i,i],[c,c]])}return Af(Df)(t,n)}const{round:Wf,cbrt:Qf}=Math;function Rf(t){const n=(e=t)>0n?1n:e<0n?-1n:0n;var e;if((t=Vf(t))<=1n)return n*t;let r=BigInt(Wf(Qf(Number(t))));for(;;){const e=(2n*r+t/(r*r))/3n;if(e===r)return n*r;r=e}}function Gf(t){return ot(t,t)}const Uf=Af(function(t,n){const e=0===lt(t[0][0])?1:0;return function(t,n){const[e,r]=t,[o,i]=n,c=function(t){const[n,e]=Bf(t).map($f),r=zf(n,e);return[Yf(Rf(n/r)),Yf(Rf(e/r))]}([o,e]),s=Gf(c[0]);return[ft(ot(i,Gf(c[1])),ot(r,s)),ot(nt(3,e),s)]}(t[e],n[e])}),{EPSILON:Zf}=Number,Jf=Zf/2+Zf**2/2;function Kf(t){return t>0?t-t*Jf:t+t*Jf}const{EPSILON:tl}=Number,nl=tl/2+tl**2/2;function el(t){return t>0?t+t*nl:t-t*nl}function rl(t){if(0===t||1===t)return[t,t];const n=Kf(Kf(t)),e=function(t){return el(el(t))}(t);return[n,e]}function ol(t,n,e,r){const o=t.ps,i=n.ps,c=[];let s=Wu(o,i);if(void 0===s){const r=2**(e-47),s=function(t,n,e=!1){e||(t=uf(t),n=uf(n));const r=[,,Pf,jf,Uf],[o,i]=r[t.length](t,n),[c,s]=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:c,bez:"A",start:!0},{tA:1,tB:s,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=Ge(t,[e,e]);return[{p:o[0],kind:4,box:o,t1:e,ri1:{t:e,tS:e,tE:e,multiplicity:1},t2:r,ri2:{t:r,tS:r,tE:r,multiplicity:1}}]}if(u[0].bez===u[1].bez)return[];const f=u[1],l=u[2],[a,p]=rl(f.tA),[h,d]=rl(f.tB),[g,v]=rl(l.tA),[m,x]=rl(l.tB),b=Ge(t,[a,p]),w=Ge(n,[h,d]),_=Ge(t,[g,v]),M=Ge(n,[m,x]),S=Gu(b,w),N=Gu(_,M),I={t:a,tS:a,tE:p,multiplicity:1},y={t:h,tS:h,tE:d,multiplicity:1},E={t:g,tS:g,tE:v,multiplicity:1},C={t:m,tS:m,tE:x,multiplicity:1};return[{p:Ue(S),kind:5,box:S,t1:$r(I),ri1:I,t2:$r(y),ri2:y},{p:Ue(N),kind:5,box:N,t1:$r(E),ri1:E,t2:$r(C),ri2:C}]}(o,i);for(const e of s){const i=Ae(o,e.ri1.tS),s=[[i[0]-r,i[1]-r],[i[0]+r,i[1]+r]],u={x:{ri:e.ri1,kind:5,box:s},curve:t},f={x:{ri:e.ri2,kind:5,box:s},curve:n};c.push([u,f])}return c}if(r&&(s=s.filter(t=>t.tS>0)),0===s.length)return[];const u=Uu(o,i,s);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};c.push([r,o])}return c}const il=Ye(1);function cl(t,n,e){const r=n.ps;if(0===t)return r[0],{x:{ri:{t,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:{t,tS:t,tE:t,multiplicity:1},box:[o,o],kind:e},curve:n}}const{p:o,pE:i}=function(t,n){const e=Ae(t,n),r=ke(t,[0,n]);if(4===t.length)return{p:e,pE:r.map(t=>9*il*t)};if(3===t.length)return{p:e,pE:r.map(t=>6*il*t)};if(2===t.length)return{p:e,pE:r.map(t=>3*il*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:{t,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 sl(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 ju(t,n);if(3===t.length)return Fu(t,n);if(2===t.length)return function(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=r[i-1],u=1===o&&1===i;{const{coeffs:{vₓ:n,vᵧ:o,v:i},errorBound:{v_:u}}=ni(t),f=jr(e),l=jr(r),a=Iu(c),p=Iu(s),h=Iu(n[1]),d=Iu(o[1]),g=a/3,v=p/3,m=n[1]*c,x=Nu(f,n),b=h*g+2*Iu(m),w=o[1]*s,_=Nu(l,o),M=d*v+2*Iu(w),S=_u(x,_),N=b+M+Iu(S[1]),I=_u(S,i),y=N+u+Iu(I[1]);if(yu*y<Iu(it(I)))return!1}{const n=function(t){return Mc(bc(t))}(t);if(void 0===n)return u&&c===t[0][0]&&s===t[0][1];const{vₓ:o,vᵧ:i,v:f}=n,l=Mu(e,o),a=Mu(r,i);return 0===lt(Su(Su(l,a),f))}}(t,n);if(1===t.length){const e=Pn(n[0]),r=Pn(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 o=Uu(e,r,[Vr(1)]);if(void 0===o||0===o.length)return;return[[{x:o[0][0],curve:t},cl(1,n,1)]]}}const ul=ct;function fl(t){return t[t.length-1]<0?ul(t):t}function ll(t,n){const e=t+n,r=e-t;return[t-(e-r)+(n-r),e]}Number.EPSILON;const al=Number.EPSILON/2;function pl(t,n,e,r){const o=t/n,i=Math.abs(t),c=Math.abs(n),s=c-r;return s<=0?{est:o,err:Number.POSITIVE_INFINITY}:{est:o,err:(c*e+i*r)/s**2+al*Math.abs(i/c)}}function hl(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,c=i-(i-r),s=r-c,u=.5*(e-o-(s*s-(o-c*c-c*s*2))+n)/r;return[u-(r+u-r),r+u]}const{abs:dl}=Math;const gl=Math.abs,vl=Ye(1);function ml(t){const{coeffs:[[n,e,r],[o,i,c]],errorBound:[[s,u],[f,l]]}=function(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=s-n,l=r-i,a=f+3*l,p=i+n,h=p-2*r,d=r-n,g=u-e,v=o-c,m=g+3*v,x=c+e,b=x-2*o,w=o-e;return{coeffs:[[a,3*h,3*d,n],[m,3*b,3*w,e]],errorBound:[[dl(f)+6*dl(l)+dl(a),6*(dl(p)+dl(h)),6*dl(d),0],[dl(g)+6*dl(v)+dl(m),6*(dl(x)+dl(b)),6*dl(w),0]]}}(t),a=gl(n),p=gl(e),h=gl(r),d=gl(o),g=gl(i),v=gl(c),m=e*o,x=n*i,b=n*c,w=r*o,_=e*c,M=r*i,S=u*d+p*f+gl(m),N=s*g+a*l+gl(x),I=s*v+gl(b),y=h*f+gl(w),E=u*v+gl(_),C=h*l+gl(M),O=m-x,T=gl(O),A=S+N+T,P=w-b,k=gl(P),B=y+I+k,z=_-M,F=gl(z),Y=E+C+F,L=O*O,X=O*P,H=z*O,V=P*P,$=H+V;return{coeffs:[L,X,$],errBound:[2*A*T+gl(L),A*k+T*B+gl(X),Y*T+F*A+gl(H)+(2*k*B+gl(V))+gl($)].map(t=>vl*t)}}const xl=ot,bl=J;function wl(t){const[[n,e,r],[o,i,c]]=mc(t),s=xl(e,o),u=xl(n,i),f=xl(n,c),l=xl(r,o),a=xl(e,c),p=xl(r,i),h=ft(s,u),d=ft(l,f),g=ft(a,p),v=xl(h,h),m=xl(h,d),x=xl(h,g),b=xl(d,d);return[v,m,bl(x,b)]}const _l=ft,Ml=ot,Sl=nt,Nl=Ke,Il=ll,yl=ci,El=Kt,Cl=tr,Ol=Ls,Tl=J,Al=gt,Pl=2*Number.EPSILON,kl=Math.abs,Bl=Ye(1);function zl(t,n=!0){if(t.length<4)return[];const{coeffs:[e,r,o],errBound:[i,c,s]}=ml(t);if(kl(e)<=i){const[[n,e],[r,o],[i,c],[s,u]]=t,f=Tl(Nl(s,n),Sl(3,Nl(r,i))),l=Al(Il(i,n),-2*r),a=Tl(Nl(u,e),Sl(3,Nl(o,c))),p=Al(Il(c,e),-2*o);if(0===Jr(Ml(l,a),Ml(f,p)))return[]}const u=r*r,f=4*e*o,l=u-f,a=2*c*kl(r)+Bl*u+(4*(i*kl(o)+kl(e)*s)+Bl*kl(f))+Bl*kl(l);if(l<-a)return[];if(l>a){const{est:t,err:u}=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))}}(l,a);let f;f=r>=0?-r-t:-r+t;const p=c+u+Bl*kl(f),{est:h,err:d}=pl(f,2*e,p,2*i),{est:g,err:v}=pl(2*o,f,2*s,p);if(n){if(h+d<0||h-d>1||g+v<0||g-v>1)return[]}else if((h+d<0||h-d>1)&&(g+v<0||g-v>1))return[]}let[p,h,d]=wl(t);const g=_l(Ml(h,h),Sl(4,Ml(p,d))),v=lt(g);if(v<0)return[];if(v>0){const t=hl(jr(g));let e;p=jr(p),h=jr(h),d=jr(d),e=lt(h)>=0?yl(El(h,t)):El(yl(h),t);let r=it(Ol(e,Cl(p))),o=it(Ol(Cl(d),e));if(n){if(r<-Pl||r>1+Pl||o<-Pl||o>1+Pl)return[]}else if((r<-Pl||r>1+Pl)&&(o<-Pl||o>1+Pl))return[];return[r,o]=r<o?[r,o]:[o,r],r>=0-Pl&&r<=1+Pl?o>=0-Pl&&o<=1+Pl?[r,o]:[r]:o>=0-Pl&&o<=1+Pl?[o]:[]}const m=Nr(p);if(lt(h)*lt(m)<0)return[];if(Jr(fl(h),fl(m))>0)return[];const x=jr(h),b=jr(m),w=Ol(x,b),_=w[1]+w[0];return[_,_]}const Fl=Number.EPSILON;function Yl(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[6*(s-n+3*(r-i)),6*(i+n-2*r)],[6*(u-e+3*(o-c)),6*(c+e-2*o)]]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[[2*(i-2*r+n)],[2*(c-2*o+e)]]}if(t.length<=2)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}function Ll(t){if(4===t.length)return 0===vu(t[0],t[1],t[2])&&0===vu(t[1],t[2],t[3])&&0===vu(t[0],t[2],t[3]);if(3===t.length)return 0===vu(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 Xl(t){if(Ll(t))return{minima:[],maxima:[],inflections:[]};if(4===t.length&&ef(t)&&(t=Dc(t)),3===t.length){const n=function(t){const[[n,e],[r,o],[i,c]]=t,s=i-r,u=s-(r-n),f=c-o,l=f-(o-e);return[u*u+l*l,-(n*(u-r)-r*(s-r)+e*(l-o)-o*(f-o))]}(t);return{minima:[],maxima:Te(n,0,1)?.map(t=>t.t)||[],inflections:[]}}const n=function(t){const[[n,e,r],[o,i,c]]=ao(t),[[s,u],[f,l]]=Yl(t),[[a],[p]]=function(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[6*(s-n+3*(r-i))],[6*(u-e+3*(o-c))]]}if(t.length<=3)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}(t),h=a*i,d=p*e,g=u*c,v=u*i,m=f*f,x=s*c,b=l*r,w=l*e,_=f*r,M=r*e,S=r*n,N=r*o,I=e*e,y=e*n,E=e*i,C=n*c,O=n*o,T=n*n,A=c*i,P=c*o,k=i*i,B=i*o,z=o*o,F=a*c-p*r,Y=u*r+l*c,L=g-b,X=r*r+c*c,H=E+C,V=P+k,$=S+I,D=e*o+n*i,q=T-z,j=y-B,W=M-A,Q=r*i+e*c,R=P+V,G=S+$,U=N+H,Z=E+H,J=G-R,K=H+C,tt=N+E+C,nt=2*w+_;return{inflectionPoly:[s*o-f*n,u*o+s*i-l*n-f*e,v+x-w-_,g-b],otherExtremaPoly:[T*(h-3*d)+z*(3*h-d)+2*(O*(a*e-p*i+3*(l*f-u*s))+3*s*f*j)+3*(D*(m-s*s)+q*(u*f+l*s)),a*(o*(G+3*V)+n*Z)-p*(r*(3*T+z)+e*(3*y+2*B)+n*R)+3*(u*(l*q-u*O+2*(f*j-s*D))+s*(2*l*j+f*(2*(S-P)+(I-k))-s*tt)+l*(l*O+2*f*D)+m*U),a*(2*r*D+e*K+i*(4*P+R))-p*(2*r*(3*y+B)+e*(I+2*P)+i*K)+3*(u*(2*(l*j-s*tt)+f*J-u*D)+s*(2*f*W-s*Q)+l*(l*D+2*f*U+s*J)+m*Q),a*(r*(N+2*H)+c*(I+3*V))-p*(r*(3*$+R)+c*Z)+3*(u*(l*J-u*U+2*(f*W-s*Q))+s*(r*(nt-s*c)-c*(2*l*i+f*c))+l*(l*H+r*(2*f*i+l*o))+f*c*nt),X*(h-d)+2*(M+A)*F-3*(Y*(v+x-w-_)+(u*e+s*r+l*i+f*c)*L),F*X-3*Y*L]}}(t),e=n.inflectionPoly,r=n.otherExtremaPoly,o=Te(r,0,1)?.map(t=>t.t)||[],i=function(t){const n=t.length-1;if(n<=0)return[];const e=new Array(n);for(let r=0;r<n;r++)e[r]=(n-r)*t[r];return e}(r),c=[],s=[];for(let t=0;t<o.length;t++){const n=o[t],r=R(i,n);R(e,n)*r>=0?c.push(n):s.push(n)}return{minima:c,maxima:s,inflections:Te(e,0,1)?.map(t=>t.t)||[]}}function Hl(t,n){const[e,r]=ao(t),[o,i]=Yl(t),c=R(e,n),s=R(r,n),u=R(o,n);return(c*R(i,n)-s*u)/Math.sqrt((c*c+s*s)**3)}const{abs:Vl}=Math,$l=L(function(t){const{curves:n}=t;let e=ho(n[0].ps).minY,r=n[0];for(let t=1;t<n.length;t++){const o=ho(n[t].ps).minY,i=o.box[0][1],c=e.box[0][1];(i<c||i===c&&o.ts[0]>e.ts[0])&&(e=o,r=n[t])}return{curve:r,y:e}});function Dl(t){const{curve:n,y:e}=$l(t),r=e.ts;return r[0]<=0?[cl(0,n,0),cl(1,n.prev,0)]:r[1]>=1?[cl(1,n,0),cl(0,n.next,0)]:[{x:{ri:{t:r[0],tS:r[0],tE:r[1],multiplicity:1},kind:0,box:e.box},curve:n},{x:{ri:{t:r[0],tS:r[0],tE:r[1],multiplicity:1},kind:0,box:e.box},curve:n}]}function ql(t,n,e){const r=e-(n-Math.floor(Math.log2(Math.abs(t))))+1;return r<=0?0:e>=53?t:wf(t,r)}function jl(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=du(e,t=>vo(t.ps)[0][0],t=>vo(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=vo(r),c=vo(o);if(t.next!==n&&n.next!==t){if(ko(!0,i,c)){const r=ol(t,n,e,!1);return r.length?r:void 0}return}if(n.next===t&&([t,n]=[n,t],[r,o]=[o,r]),0!==vu(r[0],r[1],o[1]))return;if(!ko(!1,i,c))return;let s;return s=mu(r[0],r[1])>mu(o[0],o[1])?[$r(Hr(r,o[1])[0].ri),1]:[0,$r(Hr(o,r[0])[0].ri)],[[cl(1,t,5),cl(0,n,5)],[cl(s[0],t,5),cl(s[1],n,5)]]}(n,e,t);if(n.next===e||e.next===n)return ko(!1,vo(r),vo(o))&&Zu(wu(r,!1),wu(o,!1),!1)?e.next===n?ol(e,n,t,!0):ol(n,e,t,!0):sl(n,e);let i=ko(!0,vo(r),vo(o));return i?(i=Zu(wu(r,!1),wu(o,!1),!0),i?ol(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=zl(e);if(0===r.length)continue;const o=r[0]===r[1]?3:2,i=r[0]-Fl,c=r[0]+Fl,s=r[1]-Fl,u=r[1]+Fl,f=Ge(e,[i,c]),l=Ge(e,[s,u]);n.push([{x:{ri:{t:i,tS:i,tE:c,multiplicity:1},box:f,kind:o},curve:t},{x:{ri:{t:s,tS:s,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([cl(1,t,4),cl(0,t.next,4)]);return n}(t),{extremes:c,xs:s}=function(t){const n=new Map,e=[];for(const r of t){const t=Dl(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=Xl(r),{minima:i,maxima:c}=o,s=[0,1,...i,...c];for(let o of s)Vl(Hl(r,o))>1e7*2**-t&&e.push([cl(o,n,7),cl(o,n,7)])}return e}(e,t);let f=[...r,...o,...i,...s,...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 s)_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=du(l,Wl,Ql,Bo);if(!t.length)break;const n=new Map;zo(n,t);const e=Lo(n),r=Xo(l,e);l=[...Ho(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=>ql(t,n,n-r)));return{...t,box:e}})}(l,e,n),"undefined"!=typeof _debug_&&(_debug_.generated.elems.container=l);let a=0;for(const t of l){for(const n of t.xs)n.container=t;let n;({inOuts:n,ioIdx:a}=hu(t,a)),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],n[t].prev=n[(t-1+e)%e]}}(f);for(const t of l)for(const n of t.inOuts){if(-1===n.dir)continue;const t=n;let e=t._x_;for(;e=e.next,void 0===e.in_;);t.nextOrPrev=e.in_,t.idx=t.nextOrPrev.idx}for(const t of l)for(const n of t.inOuts){if(1===n.dir)continue;const t=n;let e=t._x_;for(;e=e.prev,void 0===e.out;);t.nextOrPrev=e.out,t.idx=t.nextOrPrev.idx}return{extremes:c,containers:l}}function Wl(t){return t.box[0][0]}function Ql(t){return t.box[1][0]}function Rl(t,n,e){to(t,1);const r=t.inOuts,o=r[0],i=r[r.length-1],c=1===o.dir?o:i,s=i.dir,u=0===n.idx?new Set:1===n.orientation?n.loopsIdxs:new Set;return o.orientation=s,o.parent=n,o.windingNum=n.windingNum+s,o.loopsIdxs=new Set(u),o.children=new Set,1===s&&o.loopsIdxs?.add(e.idx),i.orientation=s,i.parent=n,i.windingNum=n.windingNum+s,i.loopsIdxs=new Set(u),i.children=new Set,1===s&&i.loopsIdxs?.add(e.idx),c}function Gl(t){if(!Ll(t))return!1;const n=t.map(t=>t[0]),e=t.map(t=>t[1]);return!(Ul(n)&&Ul(e))}function Ul(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 Zl(t,n){const e=n/Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[e*t[0],e*t[1]]}function Jl(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:Kl}=Math;function ta(t,n,e){if(void 0!==t&&!sf(t)){if(2===t.length)return t;if(3===t.length){if(Jl(t))return Ll(t)?[t[0],t[2]]:t;if(ea(t[0],t[2]))return;return[t[0],t[2]]}if(Jl(t)){const r=na(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:ta(r,n,e)}if(ea(t[0],t[3])){if(Ll(t))return;return t}if(Ll(t))return[t[0],t[3]];if(ea(t[0],t[1])&&ea(t[1],t[2])||ea(t[1],t[2])&&ea(t[2],t[3])||ea(t[0],t[1])&&ea(t[2],t[3]))return ta([t[0],t[t.length-1]],n,e);if(ea(t[0],t[2])||ea(t[1],t[3])||ea(t[1],t[2]))return t;if(ea(t[0],t[1])){if(mu(t[1],t[2])<4*n)return[t[0],t[2],t[2],t[3]];{const r=Zl(H(t[1],t[2]),2*n),o=j(t[1],r);return na([t[0],e(o),t[2],t[3]])}}if(ea(t[2],t[3])){if(mu(t[2],t[1])<4*n)return[t[0],t[1],t[1],t[3]];{const r=Zl(H(t[2],t[1]),2*n),o=j(t[2],r);return na([t[0],t[1],e(o),t[3]])}}}}function na(t){return Ll(t)?[t[0],t[3]]:ef(t)?Dc(t):t}function ea(t,n){return t[0]===n[0]&&t[1]===n[1]}function ra(t){return t}function oa(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=>{const r=ql(e[0],t,n),o=ql(e[1],t,n);return r===e[0]&&o===e[1]?e:[r,o]}}(t,n):ra;return t=>{const n=[];for(let e=0;e<t.length;e++){let i=t[e].slice();const c=n[n.length-1],s=c?c[c.length-1]:o(t[0][0]);i[0]=s,i=i.map(t=>o(t)),Gl(i)&&(i=[i[0],i[i.length-1]]),i=ta(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 c=t.slice();return c=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,c=0,s=0;for(;!(++c>10);){i=(t+Math.random())*(1+(Math.random()-.7)*r),i=ql(i,e,n);const c=Sf(i);c>s&&(s=c,o=i)}return o}));t.push(i)}o.push(t)}return o}(c,n,e,1):c,c=c.map(i),c=c.filter(t=>t.length>0),c}const ia=L(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 ca(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{max:sa}=Math;function ua(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 c=0;c<e+1;c++)for(let s=0;s<r+1;s++)i[o-(c+s)]+=t[e-c]*n[r-s];return ca(i)}function fa(t,n){const e=t.length-1,r=new Array(e+2);for(let n=0;n<e+1;n++)r[n]=t[n]/(e+1-n);return r[e+1]=n,r}const{min:la,max:aa}=Math;function pa(t,n){const e=t.length-1,r=n.length-1,o=aa(e,r),i=new Array(o+1),c=la(e,r);for(let s=0;s<=c;s++)i[o-s]=t[e-s]+n[r-s];for(let n=c+1;n<=e;n++)i[o-n]=t[e-n];for(let t=c+1;t<=r;t++)i[o-t]=n[r-t];return ca(i)}function ha(t){let n=0;for(const e of t){const[t,r]=uo(e),[o,i]=ao(e);n+=R(fa(pa(ua(t,i),Nn(ua(r,o))),0),1)}return n/2}function da(t){let n=0;for(let e=0;e<t.length-1;e++)n+=Dt(t[e],t[e+1]);return n}function ga(t){const[n,e]=t[0],[r,o]=t[t.length-1];let i,c;const s=da(t);if(256*mu(t[0],t[t.length-1])<s*s){const[r,o]=Ae(t,.5),s=Math.sqrt((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/s,c=(r-n)/s}else{const t=Math.sqrt((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/t,c=(r-n)/t}const u=function(t,n,e){const r=j(t[0].map(t=>-t));return go(t.map(t=>Q(-n,e,r(t))))}(t,i,c),[[f,l],[a,p]]=u,h=[u[0],[a,l],u[1],[f,p]],d=Q(i,c);return h.map(n=>j(t[0],d(n)))}function va(t){return{ps:t,ts:[0,1]}}const{atan2:ma}=Math,xa=Jt;function ba(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=tn(xa(i,e),xa(o,r))[1],s=Kt(xa(o,e),xa(i,r))[1];return ma(c,s)}const wa=tt,_a=ft,Ma=dt,Sa=lt,Na=ft,Ia=ot,ya=nt,Ea=Ke,Ca=ll,Oa=J,Ta=gt,Aa=Math.abs,Pa=Ye(1),ka={order:0,realOrder:0,collinear:!0,nodeType:"n/a"},Ba={order:1,realOrder:1,collinear:!0,nodeType:"n/a"},za={order:1,realOrder:0,collinear:!0,nodeType:"n/a"},Fa={order:2,realOrder:2,collinear:!1,nodeType:"n/a"},Ya={order:2,realOrder:2,collinear:!0,nodeType:"n/a"},La={order:2,realOrder:1,collinear:!0,nodeType:"n/a"},Xa={order:2,realOrder:0,collinear:!0,nodeType:"n/a"},Ha={order:3,realOrder:3,collinear:!1,nodeType:"crunode"},Va={order:3,realOrder:3,collinear:!1,nodeType:"acnode"},$a={order:3,realOrder:3,collinear:!1,nodeType:"cusp"},Da={order:3,realOrder:3,collinear:!1,nodeType:"explicit"},qa={order:3,realOrder:3,collinear:!0,nodeType:"n/a"},ja={order:3,realOrder:2,collinear:!1,nodeType:"n/a"},Wa={order:3,realOrder:2,collinear:!0,nodeType:"n/a"},Qa={order:3,realOrder:1,collinear:!0,nodeType:"n/a"},Ra={order:3,realOrder:0,collinear:!0,nodeType:"n/a"};const{abs:Ga,PI:Ua}=Math;function Za(t,n=[0,1]){if(t.length<=2)return 0;const[e,r]=n;if(e===r)return 0;if(3===t.length){const n=qe(t,e,r).ps,[[o,i],[c,s],[u,f]]=n;return ba([c-o,s-i],[u-c,f-s])}if(4===t.length){const n=Ve(t,e,r).ps,o=function(t){if(4===t.length)return ef(t)?function(t){if(!Ll(t))return!1;const[n,e,r,o]=t,[i,c]=n,[s,u]=e,[f,l]=r,[a,p]=o,h=_a(wa(Ma(s/4,f/4),3),Ma(i/4,a/4)),d=_a(wa(Ma(u/4,l/4),3),Ma(c/4,p/4));return 0===Sa(_a(Ma(i/2,a/2),h))&&0===Sa(_a(Ma(c/2,p/2),d))}(t)?sf(t)?Ra:Qa:Ll(t)?Wa:ja:Ll(t)?qa:function(t){const{coeffs:[n,e,r],errBound:[o,i,c]}=ml(t);if(Aa(n)<=o){const[[n,e],[r,o],[i,c],[s,u]]=t,f=Oa(Ea(s,n),ya(3,Ea(r,i))),l=Ta(Ca(i,n),-2*r),a=Oa(Ea(u,e),ya(3,Ea(o,c))),p=Ta(Ca(c,e),-2*o);if(0===Jr(Ia(l,a),Ia(f,p)))return Da}const s=e*e,u=4*n*r,f=s-u,l=2*i*Aa(e)+Pa*s+(4*(o*Aa(r)+Aa(n)*c)+Pa*Aa(u))+Pa*Aa(f);if(f<-l)return Va;if(f>l)return Ha;const[a,p,h]=wl(t),d=lt(Na(Ia(p,p),ya(4,Ia(a,h))));return d<0?Va:d>0?Ha:$a}(t);if(3===t.length)return Ll(t)?cf(t)?sf(t)?Xa:La:Ya:Fa;if(2===t.length)return sf(t)?za:Ba;if(1===t.length)return ka;throw new Error("The given bezier curve must be of order <= 3")}(n),[[i,c],[s,u],[f,l],[a,p]]=n,h=[s-i,u-c],d=[f-s,l-u],g=[a-f,p-l];if(0===d[0]&&0===d[1]||o.realOrder<=2)return ba(h,g);const v=ba(h,d)+ba(d,g);return"acnode"===o.nodeType||"cusp"===o.nodeType?v<=-Ua?v+2*Ua:v>=+Ua?v-2*Ua:v:v}throw new Error("The given bezier curve must be of order <= 3.")}const{round:Ja,PI:Ka}=Math;const{abs:tp,max:np,ceil:ep,log2:rp}=Math;function op(n,e,r={}){let o;"undefined"!=typeof _debug_&&(o=performance.now()),e=e||ia(n);const i=ep(rp(e)),{inclMicroCorners:c=!0,minLoopArea:s=(2**i*2**-12)**2,forceOrientationNegative:u=!1,booleanOp:f="OR",containerSizeMultiplier:l=16}=r,a=2**i*2**-46*l;(function(t){if("undefined"!=typeof _debug_)for(const n of t){_debug_.generated.elems.loopPre.push(...t),_debug_.generated.elems.loopsPre.push(t);for(const t of n){const n=vo(t),e=ga(t),r=wu(t,!1);_debug_.generated.elems.bezier_.push(t),_debug_.generated.elems.looseBoundingBox_.push(n),_debug_.generated.elems.tightBoundingBox_.push(e),_debug_.generated.elems.boundingHull_.push(r)}}})(n=oa(n,46,i,!1,!0)),n.sort(Co);const p=n.map((n,e)=>t(n,e)),{extremes:h,containers:d}=jl(p,a,i),g={dir:void 0,idx:0,parent:void 0,children:new Set,windingNum:0,p:void 0,_x_:void 0,container:void 0,loopsIdxs:new Set,orientation:-1},v=new Set,m=new Set;for(const t of p){if(v.has(t))continue;v.add(t);const n=Eo(g,t),e=h.get(t)[0].container;if(0===e.inOuts.length)continue;const r=Rl(e,n,t),o=2===e.inOuts.length&&2===e.xs.length;if(o&&e.inOuts[0].nextOrPrev===e.inOuts[1])r.bezierPieces=t.beziers.map(va),r.parent.children=r.parent.children||new Set,r.parent.children.add(r);else if(so(r,v,m,!1),o&&void 0!==r.bezierPieces){const{bezierPieces:t}=r,n=t[t.length-1],e=t[0];if(n.ps===e.ps){const r={ps:n.ps,ts:[n.ts[0],e.ts[1]]};t.shift(),t.pop(),t.unshift(r)}}}"undefined"!=typeof _debug_&&_debug_.verbose;const x=function(t){const n=[],e=[t];for(;e.length;){const t=e.pop();0===t.windingNum&&n.push(...t.children),e.push(...t.children),0===t.windingNum&&(t.children=new Set)}return n}(g);"undefined"!=typeof _debug_&&_debug_.verbose;const b=function(t){return n=>{const e="OR"===t||"XOR"===t?[n]:[];n.used="OR"===t||"XOR"===t;const r=Array.from(n.children);for(;r.length;){const n=r.pop();if("OR"===t&&0===n.windingNum&&e.push(n),"AND"===t){const t=Po(n);(0===n.windingNum&&t||To(n.windingNum)>=2&&!t)&&(e.push(n),n.used=!0)}if("XOR"===t){const t=Po(n);(0===n.windingNum&&t||To(n.windingNum)>=2&&t)&&(e.push(n),n.used=!0)}for(const t of n.children)r.push(t)}return e}}(f),w=x.map(b).filter(t=>0!==t.length).map(n=>{const e=n[0].orientation;return n.map((n,r)=>function(n,e,r,o){const i=n.bezierPieces?.map(io);if(void 0===i)return t([],r);const{orientation:c}=n,s=o?-1:e;return t((0===r?s:-s)*c>0?i:i.map(t=>t.toReversed()).toReversed(),r)}(n,e,r,u))}),_=[];for(let t=0;t<w.length;t++){const n=w[t].filter(t=>tp(ha(t.beziers))>s);n.length&&(n.sort((t,n)=>Co(t.beziers,n.beziers)),_.push(n))}"undefined"!=typeof _debug_&&(_debug_.generated.timing.simplifyPaths=performance.now()-o);const M=c?_:_.map(n=>n.map(n=>{const{beziers:e}=n,r=function(t,n){!function(t){Ja(function(t){const n=t.length;let e=0;for(let r=0;r<n;r++){const o=t[(r-1+n)%n],i=t[r];e+=Za(i,[0,1])+ba(po(o,1),po(i,0))}return e}(t)/(2*Ka))}(t);const e=t.map(t=>t.map(t=>[t[0],t[1]])).filter(t=>da(t)>n),r=e.length;for(let t=0;t<r;t++){const n=e[t],o=e[(t+1)%r],i=n[n.length-1],c=o[0];c[0]===i[0]&&c[1]===i[1]||(i[0]=c[0],i[1]=c[1])}return e}(e,np(...d.map(t=>tp(t.box[0][0]-t.box[1][0])),...d.map(t=>tp(t.box[0][1]-t.box[1][1]))));return t(r,n.idx)}));return function(t){if("undefined"!=typeof _debug_)for(const n of t)_debug_.generated.elems.loop.push(...n),_debug_.generated.elems.loops.push(n)}(M),M}const{max:ip,abs:cp}=Math;function sp(t){let n=0;for(let e=0;e<t.length-1;e++)n+=Dt(t[e],t[e+1]);return n}function up(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],[c,s],[u,f]]=t,l=e+(o-e)*n,a=o+(c-o)*n,p=l+(a-l)*n,h=r+(i-r)*n,d=i+(s-i)*n,g=h+(d-h)*n;return[p+(a+(c+(u-c)*n-a)*n-p)*n,g+(d+(s+(f-s)*n-d)*n-g)*n]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=e+(o-e)*n,f=r+(i-r)*n;return[u+(o+(c-o)*n-u)*n,f+(i+(s-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.")}function fp(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=n[0],g=n[1],v=c-d,m=u-d,x=l-d,b=p-d,w=s-g,_=f-g,M=a-g,S=h-g,N=v*v,I=6*v*m,y=6*x*b,E=w*w,C=6*w*_,O=6*M*S,T=6*m*b+9*x*x,A=2*v*b+18*m*x,P=6*v*x+9*m*m,k=6*_*S+9*M*M,B=2*w*S+18*_*M,z=6*w*M+9*_*_;return[6*(b*b-y+(N-I)+T+(P-A)+(S*S-O+(E-C)+k+(z-B))),5*(y+5*I+3*A-2*(T+2*P+3*N)+(O+5*C+3*B-2*(k+2*z+3*E))),4*(T-3*(A-2*P)-5*(2*I-3*N)+(k-3*(B-2*z)-5*(2*C-3*E))),3*(A-2*(2*P-5*(I-2*N))+(B-2*(2*z-5*(C-2*E)))),2*(P-5*(I-3*N)+(z-5*(C-3*E))),I-6*N+(C-6*E)]}function lp(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n[0],p=n[1],h=i-a,d=s-a,g=f-a,v=c-p,m=u-p,x=l-p,b=h*h,w=h*d,_=d*g,M=v*v,S=v*m,N=m*x,I=v*x+m*m*2,y=h*g+d*d*2;return[x*x+M+2*I-4*(N+S)+(g*g+b+2*y-4*(_+w)),3*(N-I+(3*S-M)+(_-y+(3*w-b))),I-3*(2*S-M)+(y-3*(2*w-b)),S-M+(w-b)]}function ap(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=e-c,f=o-c,l=r-s,a=i-s,p=u*f+l*a,h=l*l+u*u;return[f*f+a*a+(h-2*p),p-h]}const{sqrt:pp}=Math;function hp(t,n,e=!0){let r;if(4===t.length)r=fp(t,n);else if(3===t.length)r=lp(t,n);else{if(2!==t.length){if(1===t.length)return{p:t[0],t:0,d:Dt(t[0],n)};throw new Error("The given bezier curve must be of order <= 3.")}r=ap(t,n)}const o=Te(r,0,1)?.map(t=>t.t)||[];e&&(o.push(0),o.push(1));let i,c=Number.POSITIVE_INFINITY;for(const e of o){const r=up(t,e),o=mu(r,n);o<c&&(c=o,i={p:r,t:e,d:pp(o)})}return i}const{sqrt:dp}=Math;function gp(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 vp(t){return Math.max(t.hL+t.hEL,t.hR+t.hER)}function mp(t,n){const e=vp(t)-vp(n);return 0!==e?e:t.tS-n.tS}class xp{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,c=t[i],s=t[e];if(this.compare(s,c)>0)break;t[i]=s,t[e]=c,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 bp=Math.max;function wp(t,n,e,r=50){if(1===t.length)return hp(n,t[0]).d;if(1===n.length)return function(t,n){let e;if(4===t.length)e=fp(t,n);else if(3===t.length)e=lp(t,n);else{if(2!==t.length){if(1===t.length)return{p:t[0],t:0,d:Dt(t[0],n)};throw new Error("The given bezier curve must be of order <= 3.")}e=ap(t,n)}const r=Te(e,0,1)?.map(t=>t.t)||[];r.push(0),r.push(1);let o,i=Number.NEGATIVE_INFINITY;for(const e of r){const r=up(t,e),c=mu(r,n);c>i&&(i=c,o={p:r,t:e,d:dp(c)})}return o}(t,n[0]).d;if(2===t.length&&2===n.length){const e=hp(n,t[0]).d,r=hp(n,t[t.length-1]).d;return e>r?e:r}const o=bp(gp(t),gp(n));e=e||o/1e6;const[i,c]=_p(t,0,1),s={tS:0,tE:1,hL:hp(n,t[0]).d,hR:hp(n,t[t.length-1]).d,hEL:i,hER:c},u=new xp(mp);u.insert(s);let f=0,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(;;){const o=u.heap[0],{tS:i,tE:c,hL:s,hR:p}=o,h=(i+c)/2,[d,g]=_p(t,i,h),[v,m]=_p(t,h,c),x=up(t,h),b=Dt(x,hp(n,x).p),w=bp(s,b,p);if(w>a&&(a=w),l=vp(o),l-a<e)return a;if(f++>r)return a;const _={tS:i,tE:h,hL:s,hR:b,hEL:d,hER:g},M={tS:h,tE:c,hL:b,hR:p,hEL:v,hER:m};u.swapMinOrMax(_),u.insert(M)}}function _p(t,n,e){const r=(e+n)/2,o=A(t,n,r),i=A(t,r,e);return[sp(o),sp(i)]}function Mp(t,n=!1){const e=t;let r=e;const o=[];do{n&&r===e||x(r)||o.push(r),r=r.nextOnCircle}while(r!==e);return o}function Sp(t){const n=[],e=[t],r=new Set;for(;e.length>0;){const t=Vt(e.pop());if(0===t.length)continue;n.push(t);const o=t[0],i=t[t.length-1].next.prevOnCircle;r.add(o),r.add(i);const c=Mp(o,!0),s=Mp(i,!0),u=c.filter(t=>!r.has(t)),f=s.filter(t=>!r.has(t));for(const t of u)r.add(t);for(const t of f)r.add(t);e.push(...u,...f)}return n}const Np=-1;class Ip{datum;color=0;parent;extras;"-1";1;constructor(t){this.datum=t}}function yp(t){return!!t&&0===t.color}class Ep{compare;duplicatesAllowed;root;nodeCount;valueCount;constructor(t,n=!0,e){if(this.compare=t,this.duplicatesAllowed=n,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?1:Np]}}toArrayInOrder(){const t=[];return function n(e){e&&(n(e[-1]),t.push(e.datum),void 0!==e.extras&&t.push(...e.extras),n(e[1]))}(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 Ip(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?1:Np;e[n]=t(e[n],r),e[n].parent=e}return yp(e[1])&&!yp(e[-1])&&(e=Cp(Np,e)),yp(e[-1])&&yp(e[-1][-1])&&(e=Cp(1,e)),yp(e[-1])&&yp(e[1])&&Tp(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,c){const s=r.duplicatesAllowed&&void 0!==i.extras;let u=r.compare(c,i.datum);if(u<0&&!i[-1]||u>0&&!i[1])return i;if(u<0){yp(i[-1])||yp(i[-1][-1])||(i=Ap(i));const n=t(i[-1],c);return null===n?null:(i[-1]=n,i[-1]&&(i[-1].parent=i),Pp(i))}if(yp(i[-1])&&(i=Cp(1,i),u=r.compare(c,i.datum)),0===u&&!i[1]){if(s&&!n){if(void 0===e||!0===e(c,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(c,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(c,i.datum)?(o=i.datum,r.valueCount-=1+(s?i.extras.length:0),void r.nodeCount--):null}if(yp(i[1])||yp(i[1][-1])||(i=function(t){return Tp(t),yp(t[-1][-1])&&Tp(t=Cp(1,t)),t}(i),u=r.compare(c,i.datum)),0===u)if(s&&!n)if(void 0===e||!0===e(c,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 s=0;s<t.length;s++)if(!0===e(c,t[s])){o=t.splice(s,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(c,i.datum))return null;{r.valueCount-=1+(s?i.extras.length:0),o=i.datum;const t=r.getMinNode(i[1]);i.datum=t?.datum,r.duplicatesAllowed&&(i.extras=t?.extras),i[1]=Op(i[1]),r.nodeCount--}}else{const n=t(i[1],c);if(null===n)return null;i[1]=n}return i[1]&&(i[1].parent=i),Pp(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?1:Np]}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[-1]),void e(o[1]);i>0?r[0]=o:i<0&&(r[1]=o),o=o[i>0?1:Np]}}(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?1:Np]}return[]}getMinOrMaxNode(t){return n=>{if(void 0===n&&(n=this.root),n){for(;n[t];)n=n[t];return n}}}getMinNode=this.getMinOrMaxNode(Np);getMaxNode=this.getMinOrMaxNode(1);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 Cp(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=0,e}function Op(t){if(t[-1])return yp(t[-1])||yp(t[-1][-1])||(t=Ap(t)),t[-1]=Op(t[-1]),t[-1]&&(t[-1].parent=t),Pp(t)}function Tp(t){t.color=(t.color+1)%2,t[-1].color=(t[-1].color+1)%2,t[1].color=(t[1].color+1)%2}function Ap(t){if(Tp(t),yp(t[1][-1])){const n=Cp(1,t[1]);t[1]=n,n.parent=t,Tp(t=Cp(Np,t))}return t}function Pp(t){return yp(t[1])&&(t=Cp(Np,t)),yp(t[-1])&&yp(t[-1][-1])&&(t=Cp(1,t)),yp(t[-1])&&yp(t[1])&&Tp(t),t}function kp(t){const n=new Map;return h(t).forEach(function(t){const e=t.pointOnShape.curve.loop;let r=n.get(e);r||(r=new Ep(wn,!1),n.set(e,r)),r.insert(t)}),n}const{max:Bp}=Math;function zp(t,n=.125,e=50){let r=C(t.cpNode);for(;!x(r);)r=r.next;const o=Sp(r),i=new Set;for(let t=0;t<o.length;t++){const r=o[t];let c=0;for(;c<r.length;){const t=c;for(;(c++,c!==r.length)&&!(Fp(t,c,r,e)>n);)i.add(r[c])}}r=function(t,n){const e=n;do{if(t(n))return n;n=n.next}while(n!==e)}(x,r);for(const n of i)Mn(t=>2!==v(t)&&!t.isHoleClosing)(n)||B(n,t.meta);return{cpNode:r,meta:{...t.meta,cpTrees:kp(r)}}}function Fp(t,n,e,r){const o=[],i=Bt(e[t],e[n].next);for(;t<n+1;t++)o.push(wp(zt(e[t]),i,r));return Bp(...o)}function Yp(t){const n=[],e=h(t);for(const t of e)w(t)&&!t.isHoleClosing&&n.push(t);return n}const Lp=function(t,n,e){const r=t.get(n);return void 0!==r&&r.has(e)},Xp=function(t,n,e){let r=t.get(n);void 0===r&&(r=new Set,t.set(n,r)),r.add(e)};function Hp(t){let n=t,e=t.prevOnCircle;for(;x(e);)e=e.prevOnCircle;const r=[];do{x(n)||r.push(n),n=n.nextOnCircle}while(n!==e);return r}function Vp(t,n){const e=new Map,r=new Map;return N(t,function(t){const o=r.get(t)||n*t.pointOnShape.circle.radius,i=t.next,c=function(t,n,e=.4,r=16){if(4===n.length)return pn(t,n,e,r);if(3===n.length)return un(t,n,e,r);if(2===n.length)return qt(t,n);if(1===n.length)return 0;throw new Error("The given bezier curve must be of order <= 3.")}([0,1],zt(t)),s=i.pointOnShape.circle.radius;if(o-c>n*s)for(const t of m(i))if(r.set(t,o-c),!i.isHoleClosing){const{center:t}=i.pointOnShape.circle;Xp(e,t[0],t[1])}}),e}function $p(t,n){let e=0;"undefined"!=typeof _debug_&&(e=performance.now());const r=function(t){const n=h(t);return n.reduce(function(t,n){return t.pointOnShape.circle.radius>=n.pointOnShape.circle.radius?t:n},n[0])}(C(t.cpNode));!function(t,n){const e=Yp(n);for(;e.length;){const r=e.pop(),{center:o}=r.pointOnShape.circle;if(!Lp(t,o[0],o[1])||r.isIntersection)continue;let i=r.prevOnCircle,c=!1;for(;!c;){i=i.next;const{center:e}=i.pointOnShape.circle;if(Lp(t,e[0],e[1]))if(Yt(i,n))c=!0;else{if(1===Hp(i).length)continue;c=!0}else{for(;x(i.prevOnCircle);)i=i.prevOnCircle;c=!0}}if(c){const t=i.prevOnCircle;t.next=i,i.prev=t,t.nextOnCircle=i,i.prevOnCircle=t}}}(Vp(r,n),r);const o={cpNode:r,meta:{...t.meta,cpTrees:kp(r)}};return function(t){"undefined"!=typeof _debug_&&(_debug_.generated.timing.sats=performance.now()-t)}(e),o}const Dp={maxCurviness:.05,maxLength:40,applySat:!0,satScale:2,simplify:!0,simplifyTolerance:2**-4,minBezLength:2**-6,angleIncrement:15},qp={maxCurviness:{range:[.01,3],scaleByMaxCoordinate:!1},maxLength:{range:[1,1024],scaleByMaxCoordinate:!0},angleIncrement:{range:[.1,360],scaleByMaxCoordinate:!1},satScale:{range:[1,1/0],scaleByMaxCoordinate:!1},simplifyTolerance:{range:[2**-20,2**20],scaleByMaxCoordinate:!0},minBezLength:{range:[2**-20,2],scaleByMaxCoordinate:!0}};function jp(t){return[t[1],-t[0]]}function Wp(t,n){if(!Ot(n))return 0;const e=Ct(n);return e.isDull?-V(jp(e.tangents[0]),W(H(n.p,t))):0}function Qp(t){return t[0]*t[0]+t[1]*t[1]}function Rp(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 Gp(t){const n=t[0],e=t[1],r=t[2],o=Qp,i=.5*Rp([o(n),n[1],1],[o(e),e[1],1],[o(r),r[1],1]),c=.5*Rp([n[0],o(n),1],[e[0],o(e),1],[r[0],o(r),1]),s=Rp([n[0],n[1],1],[e[0],e[1],1],[r[0],r[1],1]);return[i/s,c/s]}function Up(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}const Zp=Ke,Jp=Kt,Kp=$n,th=Wn,nh=tr,eh=nr,rh=tn;function oh(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,g]=n,v=Zp(c,d),m=Zp(u,d),x=Zp(l,d),b=Zp(p,d),w=Zp(s,g),_=Zp(f,g),M=Zp(a,g),S=Zp(h,g),N=th(v,v),I=Kp(6,th(v,m)),y=Kp(6,th(v,x)),E=nh(th(v,b)),C=Kp(9,th(m,m)),O=Kp(18,th(m,x)),T=Kp(6,th(m,b)),A=Kp(9,th(x,x)),P=Kp(6,th(x,b)),k=th(b,b),B=th(w,w),z=Kp(6,th(w,_)),F=Kp(6,th(w,M)),Y=nh(th(w,S)),L=Kp(9,th(_,_)),X=Kp(18,th(_,M)),H=Kp(6,th(_,S)),V=Kp(9,th(M,M)),$=Kp(6,th(M,S)),D=th(S,S),q=Jp(T,A),j=Jp(E,O),W=Jp(y,C),Q=Jp(H,V),R=Jp(Y,X),G=Jp(F,L);return[K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s,a=i-s,p=hh(u,u),h=hh(u,f),d=hh(f,f),g=hh(l,l),v=hh(l,a),m=hh(a,a),x=dh(h,v),b=dh(g,p);return[dh(dh(d,m),dh(b,gh(x))),tn(x,b)]}const mh=Z,xh=nt,bh=Sr,wh=Nr,_h=Z,Mh=nt,Sh=Sr;function Nh(t){const n=[];for(let e=0;e<t.length;e++)n.push(4*t[e]);return n}const Ih=Z,yh=Nr,Eh=Math.abs;function Ch(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=Eh(e[0]),s=Eh(e[1]),u=Eh(r[0]),f=Eh(r[1]),l=Eh(o[0]),a=Eh(o[1]),p=Eh(i[0]),h=Eh(i[1]),d=Eh(n[0]),g=Eh(n[1]),v=c+d,m=u+d,x=l+d,b=p+d,w=s+g,_=f+g,M=a+g,S=h+g,N=v*v,I=6*v*m,y=6*x*b,E=w*w,C=6*w*_,O=6*M*S,T=6*m*b+9*x*x,A=2*v*b+18*m*x,P=6*v*x+9*m*m,k=6*_*S+9*M*M,B=2*w*S+18*_*M,z=6*w*M+9*_*_;return[6*(b*b+y+(N+I)+T+(P+A)+(S*S+O+(E+C)+k+(z+B))),5*(y+5*I+3*A+2*(T+2*P+3*N)+(O+5*C+3*B+2*(k+2*z+3*E))),4*(T+3*(A+2*P)+5*(2*I+3*N)+(k+3*(B+2*z)+5*(2*C+3*E))),3*(A+2*(2*P+5*(I+2*N))+(B+2*(2*z+5*(C+2*E)))),2*(P+5*(I+3*N)+(z+5*(C+3*E))),I+6*N+(C+6*E)]}function Oh(t,n){const e=t[0],r=t[1],o=t[2],i=Eh(e[0]),c=Eh(e[1]),s=Eh(r[0]),u=Eh(r[1]),f=Eh(o[0]),l=Eh(o[1]),a=Eh(n[0]),p=Eh(n[1]),h=i+a,d=s+a,g=f+a,v=c+p,m=u+p,x=l+p,b=h*h,w=h*d,_=d*g,M=v*v,S=v*m,N=m*x,I=v*x+m*m*2,y=h*g+d*d*2;return[x*x+M+2*I+4*(N+S)+(g*g+b+2*y+4*(_+w)),3*(N+I+(3*S+M)+(_+y+(3*w+b))),I+3*(2*S+M)+(y+3*(2*w+b)),S+M+(w+b)]}function Th(t,n){const e=t[0],r=t[1],o=Eh(e[0]),i=Eh(e[1]),c=Eh(r[0]),s=Eh(r[1]),u=Eh(n[0]),f=Eh(n[1]),l=o+u,a=c+u,p=i+f,h=s+f,d=l*a+p*h,g=p*p+l*l;return[a*a+h*h+2*d+g,d+g]}const Ah=Math.abs;function Ph(t,n){if(0===n[0]&&0===n[1])return[0,0];if(0===n[0]&&1===n[1])return[0,0];const e=Ah(n[1]);if(4===t.length){const[[n,r],[o,i],[c,s],[u,f]]=t,l=Ah(n),a=Ah(r),p=Ah(o),h=Ah(i),d=Ah(c),g=Ah(s),v=l+(p+l)*e,m=p+(d+p)*e,x=v+(m+v)*e,b=a+(h+a)*e,w=h+(g+h)*e,_=b+(w+b)*e;return[x+(m+(d+(Ah(u)+d)*e+m)*e+x)*e,_+(w+(g+(Ah(f)+g)*e+w)*e+_)*e]}if(3===t.length){const[[n,r],[o,i],[c,s]]=t,u=Ah(n),f=Ah(r),l=Ah(o),a=Ah(i),p=u+(l+u)*e,h=f+(a+f)*e;return[p+(l+(Ah(c)+l)*e+p)*e,h+(a+(Ah(s)+a)*e+h)*e]}if(2===t.length){const[[n,r],[o,i]]=t,c=Ah(n),s=Ah(r);return[c+(Ah(o)+c)*e,s+(Ah(i)+s)*e]}if(1===t.length)return[0,0];throw new Error("The given bezier curve must be of order <= 3.")}Number.EPSILON;const kh=Number.EPSILON/2;function Bh(t){const n=t*kh;return n/(1-n)}Bh(1);const zh=Math.abs,Fh=[[0,0],[0,0]];const Yh=Number.EPSILON/2,Lh=Bh(1);function Xh(t,n){return n[0]!==n[1]?4===t.length?function(t,n){const{ps:e,_ps:r}=an(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=e[3][0],u=9*Yh*r[0][0],f=9*Yh*r[1][0],l=9*Yh*r[2][0],a=9*Yh*r[3][0],p=e[0][1],h=e[1][1],d=e[2][1],g=e[3][1],v=9*Yh*r[0][1],m=9*Yh*r[1][1],x=9*Yh*r[2][1],b=9*Yh*r[3][1],w=Math.min(o-u,i-f,c-l,s-a),_=Math.max(o+u,i+f,c+l,s+a);return[[w,Math.min(p-v,h-m,d-x,g-b)],[_,Math.max(p+v,h+m,d+x,g+b)]]}(t,n):3===t.length?function(t,n){const{ps:e,_ps:r}=Ut(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=5*Yh*r[0][0],u=5*Yh*r[1][0],f=5*Yh*r[2][0],l=e[0][1],a=e[1][1],p=e[2][1],h=5*Yh*r[0][1],d=5*Yh*r[1][1],g=5*Yh*r[2][1],v=Math.min(o-s,i-u,c-f),m=Math.max(o+s,i+u,c+f);return[[v,Math.min(l-h,a-d,p-g)],[m,Math.max(l+h,a+d,p+g)]]}(t,n):function(t,n){const{ps:e,_ps:r}=function(t,n,e){return 0===n?1===e?{ps:t,_ps:Fh}:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[o,i],[n*(c-o)+o,n*(s-i)+i]],f=zh(n),l=zh(o),a=zh(c),p=zh(i);return{ps:u,_ps:[[0,0],[f*(a+l)+l,f*(zh(s)+p)+p]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[n*(c-o)+o,n*(s-i)+i],[c,s]],f=zh(n),l=zh(o),a=zh(c),p=zh(i);return{ps:u,_ps:[[f*(a+l)+l,f*(zh(s)+p)+p],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1],f=[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]],l=zh(n),a=zh(e),p=zh(i),h=zh(s),d=zh(c),g=zh(u);return{ps:f,_ps:[[l*(h+p)+p,l*(g+d)+d],[a*(h+p)+p,a*(g+d)+d]]}}(t,n,e)}(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=3*Yh*r[0][0],s=3*Yh*r[1][0],u=e[0][1],f=e[1][1],l=3*Yh*r[0][1],a=3*Yh*r[1][1],p=Math.min(o-c,i-s),h=Math.max(o+c,i+s);return[[p,Math.min(u-l,f-a)],[h,Math.max(u+l,f+a)]]}(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=up(t,n);let i;if(4===t.length)i=Ph(t,[0,n]).map(t=>8*Lh*t);else if(3===t.length)i=Ph(t,[0,n]).map(t=>5*Lh*t);else if(2===t.length)i=Ph(t,[0,n]).map(t=>2*Lh*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 Hh=Z,Vh=Wn,$h=Kt,Dh=Number.EPSILON,{sqrt:qh}=Math;function jh(t,n,e,r){const[o,i]=r,c=n.ps;let{polyDd:s,polyE:u,getPolyExact:f}=function(t,n){const e=t.length-1;if(3===e)return{polyDd:oh(t,n),polyE:Ch(t,n).map(t=>20*t),getPolyExact:()=>function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,g]=n,v=mh(c,d),m=mh(u,d),x=mh(l,d),b=mh(p,d),w=mh(s,g),_=mh(f,g),M=mh(a,g),S=mh(h,g),N=ot(v,v),I=xh(6,ot(v,m)),y=xh(6,ot(v,x)),E=bh(ot(v,b)),C=xh(9,ot(m,m)),O=xh(18,ot(m,x)),T=xh(6,ot(m,b)),A=xh(9,ot(x,x)),P=xh(6,ot(x,b)),k=ot(b,b),B=ot(w,w),z=xh(6,ot(w,_)),F=xh(6,ot(w,M)),Y=bh(ot(w,S)),L=xh(9,ot(_,_)),X=xh(18,ot(_,M)),H=xh(6,ot(_,S)),V=xh(9,ot(M,M)),$=xh(6,ot(M,S)),D=ot(S,S),q=J(T,A),j=J(E,O),W=J(y,C),Q=J(H,V),R=J(Y,X),G=J(F,L),U=ft(J(J(k,N),J(q,W)),J(J(j,P),I)),Z=ft(J(J(D,B),J(Q,G)),J(J(R,$),z)),K=xh(6,J(U,Z)),tt=J(wh(J(J(q,bh(W)),xh(3,N))),J(J(P,xh(3,j)),xh(5,I))),nt=J(wh(J(J(Q,bh(G)),xh(3,B))),J(J($,xh(3,R)),xh(5,z))),et=xh(5,J(tt,nt)),rt=J(J(q,xh(3,ft(bh(W),j))),xh(5,ft(xh(3,N),bh(I)))),it=J(J(Q,xh(3,ft(bh(G),R))),xh(5,ft(xh(3,B),bh(z)))),ct=xh(4,J(rt,it)),st=ft(j,bh(ft(bh(W),xh(5,ft(I,bh(N)))))),ut=ft(R,bh(ft(bh(G),xh(5,ft(z,bh(B)))))),lt=xh(3,J(st,ut)),at=ft(W,xh(5,ft(I,xh(3,N)))),pt=ft(G,xh(5,ft(z,xh(3,B))));return[K,et,ct,lt,bh(J(at,pt)),J(ft(I,xh(6,N)),ft(z,xh(6,B)))].map(Pn)}(t,n)};if(2===e)return{polyDd:ph(t,n),polyE:Oh(t,n).map(t=>16*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i],[c,s]]=t,[u,f]=n,l=_h(e,u),a=_h(o,u),p=_h(c,u),h=_h(r,f),d=_h(i,f),g=_h(s,f),v=ot(l,l),m=ot(l,a),x=ot(l,p),b=ot(a,a),w=ot(a,p),_=ot(p,p),M=ot(h,h),S=ot(h,d),N=ot(h,g),I=ot(d,d),y=ot(d,g),E=ot(g,g),C=J(N,Sh(I)),O=J(x,Sh(b)),T=J(ft(J(_,Sh(O)),Nh(J(w,m))),v),A=J(ft(J(E,Sh(C)),Nh(J(y,S))),M),P=J(T,A),k=J(ft(w,O),ft(Mh(3,m),v)),B=J(ft(y,C),ft(Mh(3,S),M));return[P,Mh(3,J(k,B)),J(ft(C,Mh(3,ft(Sh(S),M))),ft(O,Mh(3,ft(Sh(m),v)))),J(ft(S,M),ft(m,v))].map(Pn)}(t,n)};if(1===e)return{polyDd:vh(t,n),polyE:Th(t,n).map(t=>12*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=Ih(e,c),f=Ih(o,c),l=Ih(r,s),a=Ih(i,s),p=ot(u,u),h=ot(u,f),d=ot(f,f),g=ot(l,l),v=ot(l,a),m=ot(a,a),x=J(h,v),b=J(g,p);return[J(J(d,m),J(yh(x),b)),ft(x,b)].map(Pn)}(t,n)};if(0===e)return{polyDd:[[0,1]],polyE:[0],getPolyExact:()=>[[1]]};throw new Error("The given bezier curve must be of order 1, 2 or 3")}(c,e);const l=Te(s,o,i,u,f)||[];l.push(Vr(o)),l.push(Vr(i));const a=l.map(r=>{const{tS:o,tE:i}=r,s=(o+i)/2,u=s<0?0:s>1?1:s,f=Xh(c,[o,i]),l=function(t){const n=t[0],e=t[1];return[(n[0]+e[0])/2,(n[1]+e[1])/2]}(f),a=function(t,n,e){const r=n[0],o=n[1],i=r[0],c=r[1],s=o[0],u=o[1],f=e[0],l=e[1];let a=1/0,p=-1/0;for(const[n,e]of[[i,c],[i,u],[s,c],[s,u]]){const r=Hh(n,f),o=Hh(e,l),i=$h(Vh(r,r),Vh(o,o))[1],c=i*(1-2**t*Dh),s=i*(1+2**t*Dh);c<=a&&(a=c),s>=p&&(p=s)}return[a,p]}(t,f,e),p=0===u?1:u;return{curve:0===u?n.prev:n,p:l,t:p,d:(qh(a[0])+qh(a[1]))/2,dSquaredI:a,box:f}});return a}const{min:Wh}=Math,Qh=1+2**-20;function Rh(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=n[0],f=n[1];return u<o?f<i?mu(t[0],n):f>s?mu([o,s],n):(o-u)**2:u>c?f<i?mu([c,i],n):f>s?mu(t[1],n):(u-c)**2:f<i?(i-f)**2:f>s?(f-s)**2:0}function Gh(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]=G(t),c=Te(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=Xh(t,i);s[0][0]<r.box[0][0]&&(r={ts:i,box:s}),s[1][0]>o.box[0][0]&&(o={ts:i,box:s})}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]=G(t),c=Te(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=Xh(t,i);s[0][1]<r.box[0][1]&&(r={ts:i,box:s}),s[1][1]>o.box[0][1]&&(o={ts:i,box:s})}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 Uh=L(Gh);function Zh(t){const[n,e]=t[0],[r,o]=t[t.length-1];let i,c;const s=sp(t);if(256*mu(t[0],t[t.length-1])<s*s){const[r,o]=up(t,.5),s=Math.sqrt((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/s,c=(r-n)/s}else{const t=Math.sqrt((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/t,c=(r-n)/t}const u=function(t,n,e){const r=j(t[0].map(t=>-t));return Gh(t.map(t=>Q(-n,e,r(t))))}(t,i,c),[[f,l],[a,p]]=u,h=[u[0],[a,l],u[1],[f,p]],d=Q(i,c);return h.map(n=>j(t[0],d(n)))}function Jh(t,n){const e=[0,1,2,3].map(e=>function(t,n){const e=mu,r=n[0],o=n[1],i=e(r,o);if(0==i)return e(t,r);let c=((t[0]-r[0])*(o[0]-r[0])+(t[1]-r[1])*(o[1]-r[1]))/i;return c=Math.max(0,Math.min(1,c)),e(t,[r[0]+c*(o[0]-r[0]),r[1]+c*(o[1]-r[1])])}(n,[t[e],t[(e+1)%4]])),r=mu(t[0],t[1]),o=mu(t[0],t[3]);return e[0]<=o&&e[2]<=o&&e[1]<=r&&e[3]<=r?0:Math.min(...e)}const Kh=L(Zh);const td=Wn,nd=Kt,ed=tn,rd=Ke,od=$o;function id(t,n){return function(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],[c,s],[u,f]]=t,l=od(td(rd(o,e),n),e),a=od(td(rd(c,o),n),o),p=od(td(rd(u,c),n),c),h=nd(l,td(ed(a,l),n)),d=nd(a,td(ed(p,a),n)),g=nd(h,td(ed(d,h),n)),v=od(td(rd(i,r),n),r),m=od(td(rd(s,i),n),i),x=od(td(rd(f,s),n),s),b=nd(v,td(ed(m,v),n)),w=nd(m,td(ed(x,m),n));return[g,nd(b,td(ed(w,b),n))]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=nd([0,e],td(rd(o,e),n)),f=nd([0,o],td(rd(c,o),n)),l=nd(u,td(ed(f,u),n)),a=nd([0,r],td(rd(i,r),n)),p=nd([0,i],td(rd(s,i),n));return[l,nd(a,td(ed(p,a),n))]}if(2===t.length){const[[e,r],[o,i]]=t;return[od(td(rd(o,e),n),e),od(td(rd(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,[0,n]).map(t=>t[0]+t[1])}function cd(t,n,e){n=function(t,n){const e=function(t,n){let e=1/0;for(let r=0;r<t.length;r++){const o=t[r],{curve:{ps:i},ts:c}=o,s=up(i,c[0]),u=up(i,c[1]);e=Wh(e,mu(n,s),mu(n,u))}return Qh*e}(t,n);return t=function(t,n,e){const r=[];for(let o=0;o<t.length;o++){const i=t[o],{ps:c}=i.curve;Rh(Uh(c),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],c=i.curve.ps;Jh(Kh(c),n)<=e&&r.push(i)}return r}(t,n,e),t}(n,e);const r=[];for(let o=0;o<n.length;o++){const i=n[o],c=jh(t,i.curve,e,i.ts);r.push(...c)}let o=1/0;for(let t=0;t<r.length;t++){const n=r[t].dSquaredI[1];n<o&&(o=n)}const i=[];for(let t=0;t<r.length;t++){const n=r[t];n.dSquaredI[0]<=o&&i.push(n)}return i.map(t=>{const{curve:n,t:e}=t,{ps:r}=n;return{p:id(r,e),t:e,curve:n,isSource:!1}})}function sd(t,n,e){return e.map(e=>cd(t,e,n)[0])}function ud(t,n){return[n*t[0],n*t[1]]}function fd(t,n,e,r){const o=Up(r);let i,c,s,u,f=1,l=0;do{c=j(ud(r,f),e),s=sd(t,c,n),u=Up(H(c,Gp(s.map(t=>t.p)))),i=u<o,f/=2,l++}while(!i&&l<3);return{newX:c,newV:u,newPoss:s}}const{min:ld,abs:ad,asin:pd}=Math;function hd(t,n,e,r,o){const i=2**(o-32),c=[t[0],t[n],t[t.length-1]],s=[r[0],r[n],r[t.length-1]],u=[[c[0],c[1],c[2]],[c[1],c[2],c[0]],[c[2],c[0],c[1]]][e],f=[[s[0],s[1],s[2]],[s[1],s[2],s[0]],[s[2],s[0],s[1]]][e];if(_(u[0][0]))return;let l,a=0,p=function(t,n,e){const r=n[0][0].pointOnShape.circle.center,o=cd(t,e[1],r)[0];return Gp([n[0][0].pointOnShape.p,o.p,n[2][1].pointOnShape.p])}(o,u,f),h=1/0;for(;h>i&&a<10;){if(a++,l=sd(o,p,f),!Number.isFinite(p[0])||!Number.isFinite(p[1]))return;const t=Gp(l.map(t=>t.p)),n=H(p,t);if(!Number.isFinite(n[0])||!Number.isFinite(n[1]))return;const e=fd(o,f,p,n);p=e.newX,l=e.newPoss;const r=Up(n);h=ad(r-e.newV)}const d=(Dt(p,l[0].p)+Dt(p,l[1].p)+Dt(p,l[2].p))/3,g={center:p,radius:d};let v=0;for(let t=0;t<3;t++){const n=l[t],e=W(H(n.p,p)),r=$(e);if(Ot(n)&&Ct(n).isDull){const t=Et(n.curve.ps,n.curve.next.ps).tangents.map($),r=pd(D(t[0],e)),o=pd(D(e,t[1]));let i=0;r>0&&(i+=r),o>0&&(i+=o),v+=i}else{const t=W(U(n.curve.ps,n.t));v+=ad(pd(D(r,t)))}}const m=[];for(let t=0;t<r.length;t++){const n=cd(o,r[t],p)[0];m.push(Dt(n.p,p))}const x=ld(...m);return{threeProngInfo:{poss:l,circle:g,δ3s:u},error:1*ad(d-x)+1*v}}function dd(t){let n=t[0];const e=t[1],r=[];let o=!0;do{const t=n.pointOnShape,e=n.next.pointOnShape,i=t.curve,c=e.curve;if(o)if(o=!1,c===i&&bn(e,t)>0)r.push({curve:i,ts:[t.t,e.t]}),n=n.next;else{if(i.loop===c.loop){const n={curve:i,ts:[t.t,1]};r.push(n),gd(r,i,c,e.t)}n=n.next}else o=!0,n=n.prevOnCircle}while(n!==e);return r}function gd(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 vd(t,n,e,r){const o={...n,order:e,order2:r},i=t.findBounds({pointOnShape:o});if(void 0!==i[0]||void 0!==i[1])return void 0===i[0]||void 0===i[1]?t.max(t.root):i[0].datum}function md(t,n,e,r,o,i,c){if(void 0!==i&&!function(t,n,e){const r=bn(n,e.pointOnShape);if(r<0)return!0;if(0===r)return!1;const o=t.getMinNode();if(void 0===o)return!0;const i=o.datum;return bn(t.getMaxNode().datum.pointOnShape,n)<0&&i===e}(r,o,i.next)&&!t)return;const s={pointOnShape:o,isHoleClosing:n,isIntersection:e,id:c.id,next:void 0,prev:void 0,nextOnCircle:void 0,prevOnCircle:void 0};c.id++;const u=void 0===i?s:i,f=void 0===i?s:u.next;return f.prev=s,u.next=s,s.prev=u,s.next=f,r.insert(s),s}function xd(t,n,e,r,o,i,c){const{cpTrees:s}=o;let u=!1;const f=i.map((i,f)=>{const l=r[f],a=s.get(i.curve.loop),p={...i,circle:e,order:l,order2:0},h=void 0===c?vd(a,i,l,0):c[f],d=md(t,n,!1,a,p,h,o.lastInsertId);return void 0===d&&(u=!0),d});return u||function(t,n){n=n.slice().sort(function(t){const n=t.center;return function(t,e){let r=t.pointOnShape.p,o=e.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}}(t));const e=n.length;for(let t=0;t<e;t++){const r=n[t];r.nextOnCircle=n[(t+1)%e],r.prevOnCircle=n[(t-1+e)%e]}}(e,f),{anyFailed:u,cpNodes:f}}const bd=Math.cos(Math.PI/180*1);function wd(t,n,e,r,o,i){const{cpTrees:c,maxCoordPowerOf2:s}=t,u=2**(s-40),f=2**(s-46),l=vd(c.get(n.curve.loop),n,r,o);if(!l)return;const a=[l,l.next],{p,t:h}=n;for(const t of a){const n=t.pointOnShape.p,r=Dt(p,n);if(!(r>u)&&(V(W(H(n,t.pointOnShape.circle.center)),W(H(p,e.center)))>bd||r<f&&0!==h&&1!==h))return t}}function _d(t,n){const e=[];for(const t of n)e.push([t,t.next]);const r=function(t,n){const e=t.map(dd);let r,o=1/0;for(let i=1;i<t.length-1;i++)for(let c=0;c<3;c++){const s=hd(t,i,c,e,n);if(void 0===s)continue;const{error:u,threeProngInfo:f}=s;u<o&&(o=u,r=f)}return r}(e,t.maxCoordPowerOf2),{circle:o,poss:i,δ3s:c}=r,s=[];for(let t=0;t<3;t++)s.push(Wp(o.center,i[t]));const u=[];for(let n=0;n<i.length;n++){const e=wd(t,i[n],o,s[n],0);void 0!==e&&v(e)<=2&&!e.isHoleClosing&&u.push(e)}return{closeBysFor3Prong:u,cpNodes:0===u.length?xd(!0,!1,o,s,t,i,c.map(t=>t[0])).cpNodes:[]}}let Md=0;function Sd(t,n){if(Tt(n.pointOnShape))return{closeBysFor3Prong:void 0,addedCpNodes:[]};const e=[];for(;;){if(void 0===n)continue;const r=S(n);if(r.length<=2)break;const{closeBysFor3Prong:o,cpNodes:i}=_d(t,r);if(e.push(i),o.length>0)return{closeBysFor3Prong:o,addedCpNodes:e};if("undefined"!=typeof _debug_&&++Md===_debug_.directives.stopAfterThreeProngsNum)return}return{closeBysFor3Prong:void 0,addedCpNodes:e}}function Nd(t){for(const n of t)return n}function Id(t,n,e,r){for(const o of[n[0]])m(o).forEach(t=>{e.delete(t),r.delete(t)}),B(o,t)}function yd(t,n,e){const r=new Map;for(let o=0;o<n.length;o++){const i=new Ep(wn,!1);r.set(t[o],i);const c=n[o];let s,u;for(const t of c){const n={center:t.p,radius:0},{curve:r}=t,o={...t,curve:r,t:1,circle:n,order:-1,order2:0},c={...t,curve:r.next,t:0,circle:n,order:1,order2:0};s=md(!0,!1,!1,i,o,u,e),u=md(!0,!1,!1,i,c,s,e),s.prevOnCircle=u,u.prevOnCircle=s,s.nextOnCircle=u,u.nextOnCircle=s}}return r}const Ed=xu;let Cd;function Od(t,n){Cd=performance.now()}function Td(t){const n=[],e=[],r=[],o=[],i=[];for(const c of t)for(const t of c.curves){const c=t.ps,s=Ed(c,!0);r.push(s);const u=Uh(c);n.push(u);const f=Zh(c);e.push(f);const l=Et(t.ps,t.next.ps);l.isQuiteSharp?o.push(t):l.isQuiteDull&&i.push(t)}return{looseBoundingBoxes:n,tightBoundingBoxes:e,boundingHulls:r,sharpCorners:o,dullCorners:i}}function Ad(t){return n=>{const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];sp(o.ps)<t||Et(o.ps,o.next.ps).isQuiteSharp&&e.push({curve:o,t:1,isSource:!0,p:id(o.ps,1)})}return e}}function Pd(t,n){const e=t.length-1,r=[t[0]];for(let o=1;o<e;o++)r.push(t[o]+n*r[o-1]);return r}function kd(t,n,e){const[r,o]=t,[i,c]=n,[s,u]=e,f=r-s,l=o-u;return{a0:2*(i*f+c*l),b0:f*f+l*l}}const Bd=[,,function(t,n,e){const[r,o]=t,[i,c]=n,[[s,u],[f,l]]=e,a=-s+f,p=-u+l,h=-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Q=2*(_*S+M*N),R=2*(_*I+M*y)+(S*S+N*N),G=2*(_*E+M*C)+2*(S*I+N*y),U=2*(S*E+N*C)+(I*I+y*y),Z=2*(I*E+y*C),J=E*E+C*C;return{A:[$,D,q,j],B:[W,Q,R,G,U,Z,J],C:[k,B,z],D:[F,Y,L,X,H,V],H:[$*F-W*k,$*Y+D*F-(W*B+Q*k),$*L+D*Y+q*F-(W*z+Q*B+R*k),$*X+D*L+q*Y+j*F-(Q*z+R*B+G*k),$*H+D*X+q*L+j*Y-(R*z+G*B+U*k),$*V+D*H+q*X+j*L-(G*z+U*B+Z*k),D*V+q*H+j*X-(U*z+Z*B+J*k),q*V+j*H-(Z*z+J*B),j*V-J*z]}}],{sqrt:zd,abs:Fd,max:Yd}=Math;function Ld(t,n,e,r,o,i){const{curve:c,ts:[s,u]}=i,{ps:f}=c,{curve:l,t:a,p}=e,h=0===o&&c===l,d=[];let g,v=!1,m=!1;if(s!==u){const{A:e,B:o,C:i,D:l,H:x}=function(t,n,e){if(1===e.length){const{a0:r,b0:o}=kd(t,n,e[0]);return{A:[r],B:[o],C:[],D:[],H:[]}}return Bd[e.length](t,n,e)}(p,n,f),b=h?Pd(x,a):void 0,w=r&&h?Pd(b,a):void 0;g=Te((r&&h?Pd(w,a):void 0)??b??x,s,u)||[];for(let r=0;r<g.length;r++){const f=g[r],{tS:a,tE:h,t:x}=f;if(f.multiplicity>1)continue;if(h<s||a>u)continue;const b=x<0?0:x>1?1:x,w=R(e,b),_=R(o,b),M=R(i,b),S=R(l,b),N=Fd(w),I=Fd(M);if(Yd(N,I)<2**-40)continue;const y=N>I?-_/w:-S/M;if(y<=0)continue;const E=[y*n[0],y*n[1]],C=zd(Qp(E));if(C<=2**(t-40))continue;const O=[p[0]+E[0],p[1]+E[1]];f.tS<=s&&f.tE>=s&&(v=!0),f.tS<=u&&f.tE>=u&&(m=!0);const T=0===b?1:b,A={curve:0===b?c.prev:c,s:T,d:C,x:O};d.push(A)}}const x=f[f.length-1];let b=0===a&&c===l.prev||1===a&&c===l;const w=[];if(0===s);else if(1===s)b||v||w.push({P:x,t:1});else if(!v){const t=up(f,s);w.push({P:t,t:s})}if(s!==u)if(0===u);else if(1===u)b||m||(w.push({P:x,t:1}),b=!0);else if(!m){const t=up(f,u);w.push({P:t,t:u})}for(let t=0;t<w.length;t++){const{P:e,t:r}=w[t],{a0:o,b0:i}=kd(p,n,e);if(Fd(o)<=2**-40||Fd(i)<=2**-40)continue;const s=-i/o;if(s<2**-40)continue;const u=[s*n[0],s*n[1]],f=zd(Qp(u)),l=[p[0]+u[0],p[1]+u[1]],a=0===r?1:r,h={curve:0===r?c.prev:c,s:a,d:f,x:l};d.push(h)}return d}const{abs:Xd}=Math,Hd=1+2**-20;function Vd(t,n){const[e,r]=t,[o,i]=n,c=Ke(e,o),s=Ke(r,i);return Kt(Wn(c,c),Wn(s,s))[1]}const $d=1+2**-20,Dd=L(Zh),qd=Jt,jd=Kt,Wd=tn,Qd=function(t,n){const e=n[0],r=n[1],o=r*t,i=Vn*r,c=i-(i-r),s=r-c,u=Vn*t,f=u-(u-t),l=t-f,a=e*t,p=o+a,h=a-(p-o)+(s*l-(o-c*f-s*f-c*l)),d=p+h;return[h-(d-p),d]},{acos:Rd}=Math;function Gd(t,n){let e=[0,0];for(let r=0;r<t.length;r++)e=Kt(t[r],$n(n,e));return e}const Ud=ll,Zd=Ke,Jd=$n,Kd=Kt,tg=$o;function ng(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[Jd(3,Kd(Zd(s,n),Jd(3,Zd(r,i)))),Jd(6,tg(Ud(i,n),-2*r)),Jd(3,Zd(r,n))],[Jd(3,Kd(Zd(u,e),Jd(3,Zd(o,c)))),Jd(6,tg(Ud(c,e),-2*o)),Jd(3,Zd(o,e))]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,c]]=t;return[[tg(Ud(2*i,2*n),-4*r),Zd(2*r,2*n)],[tg(Ud(2*c,2*e),-4*o),Zd(2*o,2*e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[Zd(r,n)],[Zd(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 eg=Ke,rg=Kt,og=$n,ig=$o;function cg(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[og(6,rg(eg(s,n),og(3,eg(r,i)))),og(6,ig(eg(i,2*r),n))],[og(6,rg(eg(u,e),og(3,eg(o,c)))),og(6,ig(eg(c,2*o),e))]]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[[ig(eg(2*i,4*r),2*n)],[ig(eg(2*c,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 sg=Wn,ug=Kt,fg=tn;const{sqrt:lg}=Math;function ag(t,n,e){const{curve:r,p:o,t:i}=n,{ps:c}=r,s=1/t,u=-function(t,n){const[e,r]=function(t,n){const[e,r]=ng(t),[o,i]=cg(t),c=Gd(e,n),s=Gd(r,n),u=Gd(o,n),f=Gd(i,n),l=fg(sg(c,f),sg(s,u)),a=ug(sg(c,c),sg(s,s));return[l,hl(sg(a,sg(a,a)))]}(t,n);return Ls(e,r)}(c,i)[1],f=u<s?s:u,[l,a]=e,p=lg(l*l+a*a)*f;return[[o[0]+l/p,o[1]+a/p],1/f]}const{sqrt:pg}=Math,{sin:hg,cos:dg,max:gg,sqrt:vg}=Math;function mg(t){const{loops:n,maxCoordPowerOf2:e,squaredDiagonalLength:r}=t,o=(2**(e-21))**2,i=2**(e-46),c=vg(r),s=2**(e-32);return function(r,u,f,l){const{curve:{loop:a,ps:p},t:h,p:d}=l,g=function(t,n){const[e,r]=ng(t),o=Gd(r,n);return[[-o[0],-o[1]],Gd(e,n)]}(p,h),v=[-g[0][1],-g[1][1]],m=r?[0,-c]:0!==f?Q(hg(f),dg(f))(v):v;let[x,b]=function(t,n,e,r,o){let i,c;const{p:s}=r;if(n)return[[s[0],s[1]-e],e];if(0===t)return ag(e,r,o);const{p:u}=r,[f,l]=o,a=e/pg(f*f+l*l),p=[f*a,l*a];return i=[u[0]+p[0],u[1]+p[1]],c=e,[i,c]}(f,r,c,l,m);const w=function(t,n,e,r,o,i,c){const{cpTrees:s}=o;if(n)return r.filter(t=>t!==e).flatMap(t=>t.curves.map(t=>({curve:t,ts:[0,1]})));const u=Ot(i)&&Ct(i).isDull?1===i.t&&0===t?-1:0===i.t?1:Wp(c,i):0,f=vd(s.get(e),i,u,0);return f&&f!==f.next.next?dd([f,f]):e.curves.map(t=>({curve:t,ts:[0,1]}))}(f,r,a,n,t,l,x),_=function(t,n,e,r){let o=1/0,i=[e[0]+r[0],e[1]+r[1]];for(let t=0;t<n.length;t++){const c=n[t],{ps:s}=c.curve,u=s[0],f=s[s.length-1];for(const t of[u,f]){if(mu(i,t)>o)continue;const{a0:n,b0:c}=kd(e,r,t);if(Xd(n)<=2**-40||Xd(c)<=2**-40)continue;const s=-c/n;if(s<2**-40)continue;const u=[s*r[0],s*r[1]],f=Qp(u);f<o&&(o=f,i=[e[0]+u[0],e[1]+u[1]])}}return Hd*o}(0,w,d,m),M=vg(_);if(u&&b<(1-s)*M)return void function(t,n,e,r){if(Ot(r)&&Ct(r).isDull)return;const o={radius:n,center:e};if(wd(t,r,o,Wp(o.center,r),0))return;const{anyFailed:i,cpNodes:c}=xd(!1,!1,o,[-.5,.5],t,[r,r])}(t,b,x,l);const S=vg(m[0]**2+m[1]**2);x=[d[0]+m[0]/S*M,d[1]+m[1]/S*M],function(t,n,e){if(t.length<=2)return t;let r=0;for(let o=0;o<t.length;o++){const i=t[o],{ps:c}=i.curve;Rh(Uh(c),n)<=$d*e&&Jh(Dd(c),n)<=$d*e&&(t[r]=i,r++)}t.length=r}(w,x,_);const N=function(t,n,e,r,o,i){const c=[];for(let s=0;s<i.length;s++){const u=Ld(t,n,e,r,o,i[s]);c.push(...u)}let s=1/0;for(let t=0;t<c.length;t++){const n=c[t].d*(1+2**-46);n<s&&(s=n)}const u=[];for(let t=0;t<c.length;t++){const n=c[t];n.d*(1-2**-46)<=s&&u.push(n)}return u}(e,m,l,u,f,w);if(1!==N.length){if(0===N.length)return;if(!function(t){const{curve:n,s:e}=t[0];for(let r=1;r<t.length;r++){const{curve:o,s:i}=t[r];if(n!==o||e!==i)return!1}return!0}(N))return}const{x:I,d:y,curve:E,s:C}=N[0],O={curve:E,t:C,isSource:!1,p:id(E.ps,C)},T={center:I,radius:y},A=Vd(l.p,O.p),P=Vd(I,O.p);if(!r){if(0===A)return;if(A<=gg(function(t,n,e){if(n+e>=t)return 1/0;const r=Ke(t,n),o=Qd(n,r),i=t-n,c=n*i,s=(c-n*e-e*e/2)/(c+i*e),u=Ls(Wd(Wd(o,qd(n,e)),qd(e,e/2)),jd(o,Qd(e,r)))[1];return Rd(s),n*Rd(u)}(b,vg(P),4*i),o))return}return{circle:T,z:O}}}function xg(t,n,e,r,o){e=0===e.t?{...e,curve:e.curve.prev,t:1}:e;const i=Wp(n.center,e),c=Wp(n.center,r),s={...r,circle:n,order:c,order2:0},u={...e,circle:n,order:i,order2:0};if(wd(t,e,n,i,0))return;if(wd(t,r,n,c,0))return;const{anyFailed:f,cpNodes:l}=xd(o,o,n,[i,c],t,[u,s]);if(!f)return o&&function(t,n){const{cpTrees:e}=t,[r,o]=n,i=o.pointOnShape,c=md(!0,!0,!1,e.get(i.curve.loop),{...i,order2:1},o,t.lastInsertId);c.holeCloserTwin=o,o.holeCloserTwin=c;const s=r.pointOnShape,u=md(!0,!0,!1,e.get(s.curve.loop),{...r.pointOnShape,order2:-1},r.prev,t.lastInsertId);u.holeCloserTwin=r,r.holeCloserTwin=u,u.prevOnCircle=c,u.nextOnCircle=c,c.prevOnCircle=u,c.nextOnCircle=u,o.next=r,r.prev=o,u.next=c,c.prev=u}(t,l),l[0];l.forEach(n=>{void 0!==n&&k(n,t)})}const{PI:bg,atan2:wg}=Math;function _g(t,n,e,r){let o;const i=mg(t),c=n*bg/180;for(let n=0;n<e.length;n++){const s=e[n],u=Mg(c,s);for(const e of u){const c=i(!1,r,e,s);if(c){const{circle:n,z:e}=c,r=xg(t,n,s,e,!1);o=o||r}if("undefined"!=typeof _debug_&&n+1===_debug_.directives.stopAfterTwoProngsNum)return}}return o}function Mg(t,n){const e=[0];if(1===n.t){const{curve:r}=n,o=Et(r.ps,r.next.ps);if(o.isQuiteDull){const n=jp(o.tangents[0]),r=jp(o.tangents[1]),i=(wg(n[1],n[0])+2*bg)%(2*bg),c=((wg(r[1],r[0])+2*bg)%(2*bg)-i+2*bg)%(2*bg);let s=t;for(;s<=c-t/2;)e.push(s),s+=t}}return e}function Sg(t,n,e,r){let o;for(let i=0;i<e.length;i++){const c=_g(t,n,e[i],r);o=void 0===o?c:o}return o}function Ng(t,n=.4,e=10,r=2**-16){const o=[0],i=[1];for(;;){const c=o[o.length-1],s=i[i.length-1],u=A(t,c,s),f=sp(u),l=cn(u);if(f<=e&&l<=n||s-c<=r){if(o.push(i.pop()),1===s)return o;continue}const a=(c+s)/2;i.push(a)}}function Ig(t){if(t.length<4)return[];const[[n,e],[r,o],[i,c],[s,u]]=t,f=r-n,l=o-e,a=i-r-f,p=c-o-l,h=s-i-f-2*a,d=u-c-l-2*p,g=a*d-p*h,v=f*d-l*h,m=f*p-l*a;return Te([g,v,m],0,1)?.map(t=>t.t)||[]}function yg(t,n,e){return function(r){const o=[],i=r.curves;for(let r=0;r<i.length;r++){const c=i[r],s=c.ps;if(sp(s)<t)continue;let u=Ng(s,n,e);u=2===u.length?[.5]:u,u.push(...Ig(s)),u=u.filter(t=>0!==t&&1!==t);const f=u.map(t=>({curve:c,t,isSource:!0,p:id(c.ps,t)}));o.push(...f)}return o}}const Eg=Ke,Cg=Kt,Og=$n,Tg=tr,Ag=nr,Pg=$n,kg=Wn,Bg=Kt,zg=tn;const Fg=Kn,Yg=J,Lg=Number.EPSILON/2,Xg=Math.abs,Hg=ot,Vg=Z,$g=tt,Dg=dt;const qg=Ke,jg=$n,Wg=Wn,Qg=Kt,Rg=tn;function Gg(t){if(function(t){if(4===t.length)return 0===vu(t[0],t[1],t[2])&&0===vu(t[1],t[2],t[3])&&0===vu(t[0],t[2],t[3]);if(3===t.length)return 0===vu(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,c],[s,u]]=t,f=s+3*r,l=n+3*i,a=f-l,p=Xg(3*r)+Xg(f)+(Xg(3*i)+Xg(l))+Xg(a);if(Xg(a)-Lg*p>0)return!1;const h=u+3*o,d=e+3*c,g=h-d,v=Xg(3*o)+Xg(h)+(Xg(3*c)+Xg(d))+Xg(g);return!(Xg(g)-Lg*v>0)&&0===lt(ft(Yg([s],Fg(3,r)),Yg([n],Fg(3,i))))&&0===lt(ft(Yg([u],Fg(3,o)),Yg([e],Fg(3,c))))}(t)&&(t=function(t,n=!1){const[e,r,o,i]=t;if(!n){const[t,n]=e,[c,s]=r,[u,f]=o,[l,a]=i;return[e,[it(ft($g(Dg(c/4,u/4),3),Dg(t/4,l/4))),it(ft($g(Dg(s/4,f/4),3),Dg(n/4,a/4)))],i]}const c=function(t,n){const[[e,r],[o,i]]=t,[[c,s],[u,f]]=n,l=Vg(o,e),a=Vg(i,r),p=Vg(u,c),h=Vg(f,s),d=ft(Hg(p,a),Hg(h,l));if(0===lt(d))return;const g=Vg(c,e),v=Vg(s,r),m=it(ft(Hg(v,l),Hg(g,a)))/it(d);return[c+m*it(p),s+m*it(h)]}([e,r],[i,o]);if(void 0!==c)return[e,c,i]}(t)),3===t.length){const n=function(t){const[[n,e],[r,o],[i,c]]=t,s=qg(r,n),u=qg(i,r),f=Rg(u,s),l=qg(o,e),a=qg(c,o),p=Rg(a,l),h=Qg(Rg(jg(n,Rg(f,[0,r])),jg(r,Rg(u,[0,r]))),Rg(jg(e,Rg(p,[0,o])),jg(o,Rg(a,[0,o]))));return[Qg(Wg(f,f),Wg(p,p)),ci(h)]}(t);return{minima:[],maxima:Te(n,0,1)?.map(t=>t.t)||[],inflections:[]}}const n=function(t){const[[n,e,r],[o,i,c]]=ng(t),[[s,u],[f,l]]=cg(t),[[a],[p]]=function(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[Og(6,Cg(Eg(s,n),Og(3,Eg(r,i))))],[Og(6,Cg(Eg(u,e),Og(3,Eg(o,c))))]]}if(t.length<=3)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}(t),h=kg(a,i),d=kg(p,e),g=kg(u,c),v=kg(u,i),m=kg(f,f),x=kg(s,c),b=kg(l,r),w=kg(l,e),_=kg(f,r),M=kg(r,e),S=kg(r,n),N=kg(r,o),I=kg(e,e),y=kg(e,n),E=kg(e,i),C=kg(n,c),O=kg(n,o),T=kg(n,n),A=kg(c,i),P=kg(c,o),k=kg(i,i),B=kg(i,o),z=kg(o,o),F=zg(kg(a,c),kg(p,r)),Y=zg(h,d),L=Bg(kg(u,r),kg(l,c)),X=Bg(Bg(kg(u,e),kg(s,r)),Bg(kg(l,i),kg(f,c))),H=zg(g,b),V=zg(Bg(v,x),Bg(w,_)),$=Bg(kg(r,r),kg(c,c)),D=Bg(M,A),q=Bg(E,C),j=Bg(P,k),W=Bg(S,I),Q=Bg(kg(e,o),kg(n,i)),R=zg(T,z),G=zg(y,B),U=Bg(N,E),Z=zg(M,A),J=Bg(kg(r,i),kg(e,c)),K=Bg(P,j),tt=Bg(S,W),nt=Bg(N,q),et=Bg(E,q),rt=zg(tt,K),ot=Bg(q,C),it=Bg(U,C),ct=Bg(tr(w),_),st=kg(T,zg(h,Pg(3,d))),ut=kg(z,zg(Pg(3,h),d)),ft=tr(Bg(kg(O,Bg(zg(kg(a,e),kg(p,i)),Pg(3,zg(kg(l,f),kg(u,s))))),Pg(3,kg(kg(s,f),G)))),lt=Pg(3,Bg(kg(Q,zg(m,kg(s,s))),kg(R,Bg(kg(u,f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));return{inflectionPoly:[zg(kg(s,o),kg(f,n)),zg(Bg(kg(u,o),kg(s,i)),Bg(kg(l,n),kg(f,e))),zg(Bg(v,x),Bg(w,_)),zg(g,b)],otherExtremaPoly:[at,gt,bt,St,Nt,It]}}(t),e=n.inflectionPoly,r=n.otherExtremaPoly,o=Te(r,0,1)?.map(t=>t.t)||[],i=function(t){const n=t.length-1;if(n<=0)return[];const e=new Array(n);for(let r=0;r<n;r++)e[r]=$n(n-r,t[r]);return e}(r),c=[],s=[];for(let t=0;t<o.length;t++){const n=o[t],r=se(i,n);lt(ot(se(e,n),r))>=0?c.push(n):s.push(n)}return{minima:c,maxima:s,inflections:Te(e,0,1)?.map(t=>t.t)||[]}}function Ug(t){return{curve:t.curve,t:t.t,isSource:!0,p:id(t.curve.ps,t.t)}}function Zg(t,n,e,r,o){(o&&(r>t.val||r===t.val&&e>t.t)||!o&&(r<t.val||r===t.val&&e>t.t))&&(t.curve=n,t.t=e,t.val=r)}const Jg=L(function(t){const n=[{curve:void 0,t:void 0,val:1/0},{curve:void 0,t:void 0,val:1/0}],e=[{curve:void 0,t:void 0,val:-1/0},{curve:void 0,t:void 0,val:-1/0}];return t.curves.forEach(function(t){const r=function(t){const n=G(t),e=Te(n[0],0,1)?.map(t=>t.t)||[],r=Te(n[1],0,1)?.map(t=>t.t)||[];e.push(0,1),r.push(0,1);let o,i,c,s,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(let n=0;n<e.length;n++){const r=e[n],[c]=up(t,r);c<u&&(u=c,o=r),c>f&&(f=c,i=r)}for(let n=0;n<r.length;n++){const e=r[n],[,o]=up(t,e);o<l&&(l=o,c=e),o>a&&(a=o,s=e)}return{ts:[[o,c],[i,s]],box:[[u,l],[f,a]]}}(t.ps);for(let o=0;o<2;o++)Zg(n[o],t,r.ts[0][o],r.box[0][o],!1),Zg(e[o],t,r.ts[1][o],r.box[1][o],!0)}),{minX:Ug(n[0]),minY:Ug(n[1]),maxX:Ug(e[0]),maxY:Ug(e[1])}});function Kg(t){return Jg(t).minY}function tv(t){const{loops:n}=t,e=n.map(Kg);let r;const o=mg(t);for(let n=1;n<e.length;n++){const i=e[n],c=o(!0,!1,0,i);if(!c)throw new Error("Unable to find hole-closing 2-prong");const{circle:s,z:u}=c,f=xg(t,s,i,u,!0);r=void 0===r?f:r}return r}const nv=L(function(t){let n,e,r,o,i=1/0,c=-1/0,s=1/0,u=-1/0;for(const f of t){const t=Jg(f);t.minX.p[0]<i&&(n=t.minX,i=t.minX.p[0]),t.maxX.p[0]>c&&(e=t.maxX,c=t.maxX.p[0]),t.minY.p[1]<s&&(r=t.minY,s=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}});function ev(t,n,e){const{minBezLength:r,maxCurviness:o,maxLength:i,angleIncrement:c}=e,s=Ad(r),u=function(t){return n=>{const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];if(sp(o.ps)<t)continue;const{next:i,ps:c}=o;if(Et(c,i.ps).isQuiteDull){const t=c[c.length-1];e.push({curve:o,t:1,isSource:!0,p:t}),e.push({curve:i,t:0,isSource:!0,p:t})}}return e}}(r),f=yg(r,o,i),l=function(t){return function(n){const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];sp(o.ps)<t||e.push(...Gg(o.ps).maxima.map(t=>({curve:o,t,isSource:!0,p:id(o.ps,t)})))}return e}}(r),a=nv(t),p=(a.maxX.p[0]-a.minX.p[0])**2+(a.maxY.p[1]-a.minY.p[1])**2,d=t.map(s),g={id:0},v=yd(t,d,g),m=Td(t),x=(Od(),{maxCoordPowerOf2:n,squaredDiagonalLength:p,loops:t,cpTrees:v,lastInsertId:g,...m});let b;if(b=tv(x),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterHoleClosers)return{cpNode:b,meta:x};if(function(){if("undefined"==typeof _debug_)return;const t=_debug_.generated.timing,n=performance.now();t.holeClosers+=n-Cd,Cd=n}(),b=Sg(x,c,t.map(u),!1)||b,b=Sg(x,c,t.map(l),!0)||b,b=Sg(x,c,t.map(f),!1)||b,function(){if("undefined"==typeof _debug_)return;const t=_debug_.generated.timing,n=performance.now();t.oneAnd2Prongs+=n-Cd,Cd=n}(),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterTwoProngs)return{cpNode:b,meta:x};if(b=function(t,n){if(void 0===n)return;const e=new Set;let r=!0;for(;r;){r=!1;const o=new Set(h(n));for(const n of o){const{closeBysFor3Prong:i,addedCpNodes:c}=Sd(t,n);c.length>0&&(r=!0),void 0===i?e.add(n):(r=!0,Id(t,i,o,e)),c.forEach(t=>t.forEach(t=>e.add(t)))}n=Nd(e)}return Nd(e)}(x,b),void 0===b)return;if("undefined"!=typeof _debug_&&_debug_.directives.stopAfterThreeProngs)return{cpNode:b,meta:x};const w={cpNode:b,meta:x};return"undefined"!=typeof _debug_&&(_debug_.generated.timing.threeProngs+=performance.now()-Cd),w}const{ceil:rv,log2:ov}=Math;function iv(t,n){const{maxCoordinate:e}=function(t){let n=0,e=1/0,r=-1/0,o=1/0,i=-1/0;for(const c of t)for(const t of c)for(const c of t){const t=c[0],s=c[1],u=ip(cp(t),cp(s));u>n&&(n=u),t<e&&(e=t),t>r&&(r=t),s<o&&(o=s),s>i&&(i=s)}return{maxCoordinate:n,width:r-e,height:i-o}}(t),r=rv(ov(e)),o=function(t,n){const e={...n};for(const n in qp){const r=n;let o=e[r];const i=qp[r],{range:c,scaleByMaxCoordinate:s}=i;o<c[0]&&(o=c[0]),o>c[1]&&(o=c[1]),s&&(o*=2**(t-10)),e[r]=o}return e}(r,{...Dp,...n||{}}),{applySat:i,simplify:c,satScale:s,simplifyTolerance:u}=o,f=op(t,void 0,{forceOrientationNegative:!0}),l=[];for(const t of f){let n=ev(t,r,o);void 0!==n&&(i&&(n=$p(n,s)),c&&(n=zp(n,u,50)),l.push(n))}return l}function cv(t){const n=function(t){let n=t;const e=Yp(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(v(o)>2){const n=o.nextOnCircle;Yt(o,t)?e=!0:o.next===n?o=n:n.next!==r&&(e=!0)}else if(x(o)&&!o.isIntersection)return void(n=o);if(e){r.next=o,o.prev=r,n=o;break}}}return n}(C(t.cpNode));if(n)return{cpNode:n,meta:{...t.meta,cpTrees:kp(n)}}}let sv=0;function uv(t){return t.map(t=>{return(n=t.pointOnShape).p[0]+", "+n.p[1]+" | bz: "+n.curve.idx+" | t: "+n.t;var n})}function fv(t,n=3){return t[0].toFixed(n)+", "+t[1].toFixed(n)}const lv={δToString:uv,δsToString:function(t){return t.map(uv)},pointToStr:fv,pointsToStr:function(t,n=3){return t.map(t=>fv(t,n))},nameObj:function(t,n=""){t.name=""+n+sv++}},av="red thin10 nofill ",pv="http://www.w3.org/2000/svg";function hv(t,n,e=av,r){const o=n.center,i=n.radius,c=document.createElementNS(pv,"circle");return c.setAttributeNS(null,"cx",o[0].toString()),c.setAttributeNS(null,"cy",o[1].toString()),c.setAttributeNS(null,"r",i.toString()),c.setAttributeNS(null,"class",e),t.appendChild(c),r&&setTimeout(()=>c.remove(),r),[c]}function dv(t,n,e=3,r="red",o){const[i]=hv(t,{center:n,radius:e},"dot "+r,o);return o&&setTimeout(()=>i.remove(),o),[i]}function gv(t,n,e=av,r=0,o=void 0,i=0){const c=document.createElementNS(pv,"line");c.setAttributeNS(null,"x1",n[0][0].toString()),c.setAttributeNS(null,"y1",n[0][1].toString()),c.setAttributeNS(null,"x2",n[1][0].toString()),c.setAttributeNS(null,"y2",n[1][1].toString()),c.setAttributeNS(null,"class",e),t.appendChild(c);let s=[];if(void 0!==o)for(const e of n)s.push(...dv(t,e,i,o,r));for(const n of s)t.appendChild(n);const u=[c,...s];return r&&setTimeout(()=>{for(const t of u)t.remove()},r),u}function vv(t,n,e=av,r=3,o){const i=hv(t,{center:n,radius:r},e),c=[[n[0]-r,n[1]],[n[0]+r,n[1]]],s=[[n[0],n[1]-r],[n[0],n[1]+r]],u=gv(t,c,e),f=gv(t,s,e);return o&&setTimeout(()=>{i.forEach(t=>t.remove()),u.forEach(t=>t.remove()),f.forEach(t=>t.remove())},o),[...i,...u,...f]}function mv(t){return 2===t?"L":3===t?"Q":4===t?"C":void 0}function xv(t,n,e=av,r=0,o=void 0,i=0,c=void 0){const[[s,u],[f,l],[a,p]]=n,h=document.createElementNS(pv,"path");h.setAttributeNS(null,"d",`M${s} ${u} Q${f} ${l} ${a} ${p}`),e&&h.setAttributeNS(null,"class",e);let d=[];if(void 0!==o)for(const e of n)d.push(...dv(t,e,i,o,r));let g=[];if(void 0!==c)for(let e=0;e<n.length-1;e++)g.push(...gv(t,[n[e],n[e+1]],c,r));const v=[h,...d,...g];for(const n of v)t.appendChild(n);return r&&setTimeout(()=>{for(const t of v)t.remove()},r),v}function bv(t,n,e=av,r=0,o=void 0,i=0,c=void 0){const[[s,u],[f,l],[a,p],[h,d]]=n;if(s===h&&f===h&&a===h&&u===d&&l===d&&p===d)return vv(t,[s,u],e,.2,r);const g=document.createElementNS(pv,"path");g.setAttributeNS(null,"d",`M${s} ${u} C${f} ${l} ${a} ${p} ${h} ${d}`),g.setAttributeNS(null,"class",e);let v=[];if(void 0!==o)for(const e of n)v.push(...dv(t,e,i,o,r));let m=[];if(void 0!==c)for(let e=0;e<n.length-1;e++)m.push(...gv(t,[n[e],n[e+1]],c,r));const x=[g,...v,...m];for(const n of x)t.appendChild(n);return r&&setTimeout(()=>{for(const t of x)t.remove()},r),x}function wv(t,n,e=av,r=0,o=void 0,i=0,c=void 0){return 2===n.length?gv(t,n,e,r,o,i):3===n.length?xv(t,n,e,r,o,i,c):4===n.length?bv(t,n,e,r,o,i,c):[]}const _v=["red","green","cyan","blue"];function Mv(t,n){const e=1-n;if(4===t.length){const[[r,o],[i,c],[s,u],[f,l]]=t;return[r*e**3+3*i*e**2*n+3*s*e*n**2+f*n**3,o*e**3+3*c*e**2*n+3*u*e*n**2+l*n**3]}if(3===t.length){const[[r,o],[i,c],[s,u]]=t;return[r*e**2+2*i*e*n+s*n**2,o*e**2+2*c*e*n+u*n**2]}if(2===t.length){const[[r,o],[i,c]]=t;return[r*e+i*n,o*e+c*n]}return[NaN,NaN]}function Sv(t,n){return 2===t.length?function(t,n){const[[e,r],[o,i]]=t,c=1-n,s=[c*e+n*o,c*r+n*i];return[[[e,r],s],[s,[o,i]]]}(t,n):3===t.length?function(t,n){const[[e,r],[o,i],[c,s]]=t,u=1-n,f=[u*u*e+2*u*n*o+n*n*c,u*u*r+2*u*n*i+n*n*s];return[[[e,r],[u*e+n*o,u*r+n*i],f],[f,[u*o+n*c,u*i+n*s],[c,s]]]}(t,n):4===t.length?function(t,n){const[[e,r],[o,i],[c,s],[u,f]]=t,l=1-n,a=n*n,p=a*n,h=l*l,d=h*l,g=[p*u+3*l*a*c+3*h*n*o+d*e,p*f+3*l*a*s+3*h*n*i+d*r];return[[[e,r],[n*o+l*e,n*i+l*r],[a*c+2*l*n*o+h*e,a*s+2*l*n*i+h*r],g],[g,[a*u+2*n*l*c+h*o,a*f+2*n*l*s+h*i],[n*u+l*c,n*f+l*s],[u,f]]]}(t,n):[]}const Nv={circle:hv,crossHair:vv,dot:dv,line:gv,rect:function(t,n,e=av,r){const[[o,i],[c,s]]=n,u=o<c?o:c,f=i<s?i:s,l=Math.abs(o-c),a=Math.abs(i-s),p=document.createElementNS(pv,"rect");return p.setAttributeNS(null,"x",u.toString()),p.setAttributeNS(null,"y",f.toString()),p.setAttributeNS(null,"width",l.toString()),p.setAttributeNS(null,"height",a.toString()),e&&p.setAttributeNS(null,"class",e),t.appendChild(p),r&&setTimeout(()=>p.remove(),r),[p]},beziers:function(t,n,e,r){const o=void 0===e,i=[];for(let r=0;r<n.length;r++){const c=n[r],s=o?"thin5 nofill "+_v[r%_v.length]:e;i.push(...wv(t,c,s))}return r&&setTimeout(()=>i.forEach(t=>t.remove()),r),i},bezier:wv,bezierPiece:function(t,n,e,r=av,o){const i=e[0]===e[1]?vv(t,Mv(n,e[0]),r,1.5):wv(t,function(t,n){if(0===n[0]&&1===n[1])return t;if(n[0]===n[1]){const e=Mv(t,n[0]);return[e,e,e,e]}return 0===n[0]?Sv(t,n[1])[0]:1===n[1]?Sv(t,n[0])[1]:Sv(Sv(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:xv,cubicBezier:bv,polygon:function(t,n,e=av,r){const o=document.createElementNS(pv,"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=av,r){if(!n.length)return[];const o=document.createElementNS(pv,"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+=`${mv(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=av,r){if(n.length<2)return[];const o=document.createElementNS(pv,"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=av,i){const c=document.createElementNS(pv,"text");return c.setAttributeNS(null,"x",n[0].toString()),c.setAttributeNS(null,"y",n[1].toString()),c.setAttributeNS(null,"font-size",r.toString()),c.setAttributeNS(null,"class",o),c.textContent=e,t.appendChild(c),i&&setTimeout(()=>c.remove(),i),[c]}};function Iv(t,n){return(n,e,r,o=0,i=1)=>{let c,s;switch(e.isHoleClosing){case!1:c="red ",s="2";break;case!0:c="cyan ",s="10"}const{pointOnShape:u}=e,{circle:f}=u,{center:l,radius:a}=f,{isSource:p,p:h}=u,d=e.nextOnCircle.pointOnShape.p,g=p?h:d,v=p?d:h,{line:m,dot:x,circle:b,crossHair:w}=Nv,_=x(n,f.center,.02*i,"yellow",o);return[...b(n,f,c+"thin"+s+" nofill",o),...x(n,g,.005*i,c,o),...x(n,v,.01*i,c,o),...t?w(n,f.center,"red thin2 nofill",.002*i,o):[],..._]}}function yv(t,n){return{center:t.center,radius:n*t.radius}}const{getAllOnCircle:Ev}=_n,{isTerminating:Cv}=_n,Ov=["thin10 blue nofill","thin10 red nofill"];function Tv(t,n,e,r=0,o=1){let i=n.cpNode;if(!i)return[];for(;!Cv(i);)i=i.next;const c=[];let s=0;return N(i,n=>{if(Cv(n))return;const e=zt(n);e&&(c.push(...Nv.bezier(t,e,Ov[s%2],r)),s++)}),c}function Av(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 Pv(t,n,e="thin5 purple nofill",r=0,o=1){const i=[],c=[];for(const t of n){if(x(t))continue;const n=zt(t);n&&c.push(n)}return i.push(...a(t,c,e,r)),i}const kv={oneProng:function(t,n,e,r=0,o=1){const{pointOnShape:i}=n,{circle:c}=i;return[...Nv.dot(t,i.p,.02*o,"deeppink",r),...Nv.dot(t,c.center,.01*o,"deeppink",r),...Nv.circle(t,c,"deeppink thin5 nofill",r)]},twoProng:Iv(!1),threeProng:function(t,n,e,r=0,o=1){const i=yv(n.pointOnShape.circle,1),{center:c,radius:s}=i,u=_n.getAllOnCircle(n).map(t=>t.pointOnShape),{dot:f,circle:l,crossHair:a}=Nv,p=l(t,i,"blue thin2 nofill",r),h=[],d=[];for(let n=0;n<u.length;n++){const e=u[n].p;h.push(...f(t,e,.01*(n+1)*o,"blue",r)),d.push(...Nv.line(t,[e,c],"thin5 red",r))}const g=a(t,i.center,"red thin2 nofill",.02*o,r);return[...h,...d,...p,...g]},boundingHull:function(t,n,e="thin5 black nofill",r=0,o=1){return Nv.polygon(t,n,e,r)},looseBoundingBox:function(t,n,e="thin5 brown nofill",r=0,o=1){const[[i,c],[s,u]]=n;return n=[[i,c],[s,c],[s,u],[i,u]],Nv.polygon(t,n,e,r)},tightBoundingBox:function(t,n,e="thin5 pinker nofill",r=0,o=1){return Nv.polygon(t,n,"thin5 pinker nofill",r)},vertex:function(t,n,e,r=0,o=1){const i=n.pointOnShape.circle;let c=[];return c=[...Nv.dot(t,i.center,.01*o,"darkgreen",r)],c},mat:Tv,maxVertex:function(t,n){const e=n.pointOnShape.circle;return Nv.circle(t,e,"brown thin10 nofill")},leaves:function(t,n,e="thin10 deeppink nofill",r=0,o=1){const i=[],{line:c,dot:s,circle:u}=Nv;for(const f of n){const n=f.pointOnShape,{circle:l}=n,{center:a,radius:p}=l,h=[Av(t,a,.5,"pinker thin5 nofill")],d=_n.getAllOnCircle(f).map(t=>t.pointOnShape),g=[],v=[];for(let n=0;n<d.length;n++){const e=d[n].p;v.push(...s(t,e,.01*(n+1)*o,"pinker",r)),g.push(...c(t,[e,a],"thin5 red",r))}const m=u(t,l,e,r);i.push(...m,...v,...g,...h)}return i},cull:function(t,n,e="thin10 cyan nofill",r=0,o=1){const i=[];return i.push(...Nv.crossHair(t,n,e,.1*o,r)),i},cpNode:function(t,n,e="blue thin2 nofill",r=0,o=1){const i=yv(n.pointOnShape.circle,1),{center:c,radius:s}=i,u=_n.getAllOnCircle(n).map(t=>t.pointOnShape),{dot:f,circle:l,crossHair:a}=Nv,p=l(t,i,e,r),h=[],d=[];for(let n=0;n<u.length;n++){const e=u[n].p;h.push(...f(t,e,.01*(n+1)*o,"blue",r)),d.push(...Nv.line(t,[e,c],"thin5 red",r))}const g=a(t,c,"orange thin10 nofill",2*o,r);return[...h,...d,...p,...g]},branch:Pv,holeCloser:Iv(!1)},Bv={...kv,twoProng:Iv(!0)};function zv(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:[],twoProng:[],looseBoundingBox:[],tightBoundingBox:[],vertex:[],threeProng:[],boundingHull:[],mat:[],cpNode:[],maxVertex:[],leaves:[]},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:{},...kv},...lv},directives:{...n&&n.directives?n.directives:{},stopAfterHoleClosers:!1,stopAfterHoleClosersNum:void 0,stopAfterTwoProngs:!1,stopAfterTwoProngsNum:void 0,stopAfterThreeProngs:!1,stopAfterThreeProngsNum:void 0}},window._debug_=n}const Fv={oneProng:[],twoProng:[],threeProng:[],looseBoundingBox:[],tightBoundingBox:[],boundingHull:[],vertex:[],mat:[],maxVertex:[],leaves:[],cull:[],cpNode:[],branch:[],holeCloser:[]},Yv=Object.keys(Fv);function Lv(t,n,e,r){const o=[];for(const r of t)o.push({type:0,item:r,x:n(r)}),o.push({type:1,item:r,x:e(r)});o.sort(Xv);const i=new Set,c=[];for(const t of o){const{item:n}=t;if(0===t.type){for(const t of i.values())r(n,t)&&c.push([n,t]);i.add(n)}else 1===t.type&&i.delete(t.item)}return c}function Xv(t,n){const e=t.x-n.x;return 0!==e?e:0===t.type?-1:1}const Hv=1e-4;function Vv(t,n){const e=t.pointOnShape,r=n.pointOnShape;let{curve:o,p:i,t:c}=e,{curve:s,p:u,t:f}=r;if(i[0]===u[0]&&i[1]===u[1])return[i];1===c&&(c=0,o=o.next),0===f&&(f=1,s=s.prev);const{ps:l}=o,{ps:a}=s,p=[i,j(i)(W(U(l,c)))],h=[u,j(u)(W(U(a,f)))],d=X(p,h),g=H(i,u);let v;if(d){const t=H(i,d),n=H(u,d);v=V(t,g)<0||V(n,g)>0}else v=!0;if(!v)return[i,d,u];const m=H(p[0],p[1]),x=H(h[0],h[1]),b=Math.abs(D(g,m))/9,w=Math.abs(D(g,x))/9;return b>.01||w>.01||b>Hv||w>Hv?void 0:[i,u]}const $v=L(function(t){return hn(zt(t))});function Dv(t,n){const e=function(t){const n=new Map;for(let e of t)for(let r of t){const t=e.pointOnShape.circle.center,o=r.pointOnShape.circle.center,i=e.pointOnShape.p,c=r.pointOnShape.p;r!==e&&t[0]===o[0]&&t[1]===o[1]&&i[0]===c[0]&&i[1]===c[1]&&n.set(e,r)}return n}(n),r=t.length,o=[];for(let n=0;n<r;n++){const i=t[n],c=[];for(let o=0;o<r;o++){const r=t[o];if(n===o){c.push(0);continue}let s=1/0;for(const t of m(i)){let n=$v(t),o=t.next;for(;!Yt(o,r);)if(o.isHoleClosing)o=qv(e,o);else{if(Sn(o)){n=1/0;break}n+=$v(o),o=o.next}n<s&&(s=n)}c.push(s)}o.push(c)}return o}function qv(t,n){return t.get(n).next}export{_n as CpNodeFs,e as beziersToSvgPathStr,C as clone,wn as cpNodeComparator,yd as createInitialCpTree,Yv as debugElemNames,a as drawBeziersAsSinglePath,Pv as drawBranch,kv as drawElemFs,Bv as drawElemFsDetailed,Tv as drawMat,Fv as emptyDebugElems,zv as enableDebugForMat,M as enhanceCpNode,mg as find2Prong,tv as findAndAddHoleClosing2Prongs,iv as findMats,p as floydWarshall,m as getAllOnCircle,h as getAllOnLoop,xn as getAllVertices,T as getBoundaryBezierPartsToNext,dn as getBoundaryBeziersBetween,P as getBoundaryBeziersToNext,dd as getBoundaryPieceBeziers,Vt as getBranch,$t as getBranchBeziers,Sp as getBranches,z as getChildren,cd as getCloseBoundaryPointsCertified,Rh as getClosestSquareDistanceToRect,At as getEdgeDirection,Ft as getFirstExit,yg as getFor2ProngsOnLoop,Dv as getGraph,d as getHoleClosers,Vv as getImpliedBoundaryBezierBetween,mn as getInitialDegAngleBetweenMatCurves,Bt as getMatCurveBetween,zt as getMatCurveToNext,vn as getMatCurvesBetween,Td as getPartialMeta,l as getPathsFromStr,Od as getPointToCpNode,jh as getPotentialClosestPointsOnCurveCertified,v as getProngCount,b as getRealProngCount,gn as getSalience,Vp as getSatCulls,nv as getShapeBounds,Ad as getSharpCornersOnLoop,I as getVertexForwardChildren,w as isFullyTerminating,Yt as isOnSameCircle,Lt as isOneProng,_ as isSharp,x as isTerminating,Ht as isTrivial,Xt as isTwoProng,Sn as isVertexSpecial,t as loopFromBeziers,B as removeVertex,zp as simplifyMat,Lv as sweepLine,$p as toScaleAxis,S as traverseCp,N as traverseEdges,y as traverseVertices,cv as trimMat};
|
|
1
|
+
function t(t=[],e){const r=[],o={beziers:t,curves:r,idx:e};if(0===t.length)return o;let i,c=0;for(let e=0;e<t.length;e++){if(n(t[e]))continue;const s={loop:o,ps:t[e],prev:i,next:void 0,idx:c};i&&(i.next=s),i=s,r.push(s),c++}const s=r[r.length-1];return r[0].prev=s,s.next=r[0],s.ps[s.ps.length-1]=r[0].ps[0],o}function n(t){return 2===t.length?t[0][0]===t[1][0]&&t[0][1]===t[1][1]:3===t.length?t[0][0]===t[1][0]&&t[0][1]===t[1][1]&&t[1][1]===t[2][1]&&t[1][1]===t[2][1]:t[0][0]===t[1][0]&&t[0][1]===t[1][1]&&t[1][1]===t[2][1]&&t[1][1]===t[2][1]&&t[2][1]===t[3][1]&&t[2][1]===t[3][1]}function e(t){const n=[];for(let e=0;e<t.length;e++){const r=t[e];0===e&&n.push("M "+r[0][0].toString()+" "+r[0][1].toString()),4===r.length?n.push("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()+" "):3===r.length?n.push("Q "+r[1][0].toString()+" "+r[1][1].toString()+" "+r[2][0].toString()+" "+r[2][1].toString()+" "):2===r.length&&n.push("L "+r[1][0].toString()+" "+r[1][1].toString()+" ")}return n.push(" z"),n.join("\n")}class r{initialPoint=void 0;p;vals=void 0;prev2ndCubicControlPoint=void 0;prev2ndQuadraticControlPoint=void 0;constructor(){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 c={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 s(t){let n=0,e=0,r=1,o=0,i=1,c=1;const s=t._currentIndex;t._skipOptionalSpaces();let u=t._currentIndex;u<t._endIndex&&"+"===t._string[u]?(t._currentIndex+=1,u+=1):u<t._endIndex&&"-"===t._string[u]&&(t._currentIndex+=1,u+=1,i=-1);const f=t._string[u];if(u===t._endIndex||(f<"0"||f>"9")&&"."!==f)throw new Error(`The first character of a number must be one of [0-9+-.]. Found '${f}' at index ${u}.`);const l=t._currentIndex;for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)t._currentIndex+=1,u+=1;if(u!==l){let n=u-1,r=1;for(;n>=l;)e+=r*(Number(t._string[n])-0),n-=1,r*=10}if(u<t._endIndex&&"."===t._string[u]){if(t._currentIndex+=1,u+=1,u>=t._endIndex||t._string[u]<"0"||t._string[u]>"9")throw new Error("There must be a least one digit following the .");for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)r*=10,o+=Number(t._string.charAt(u))/r,t._currentIndex+=1,u+=1}if(u!==s&&u+1<t._endIndex&&("e"===t._string[u]||"E"===t._string[u])&&"x"!==t._string[u+1]&&"m"!==t._string[u+1]){if(t._currentIndex+=1,u+=1,"+"===t._string[u]?(t._currentIndex+=1,u+=1):"-"===t._string[u]&&(t._currentIndex+=1,u+=1,c=-1),u>=t._endIndex||t._string[u]<"0"||t._string[u]>"9")throw new Error("There must be an exponent.");for(;u<t._endIndex&&t._string[u]>="0"&&t._string[u]<="9";)n*=10,n+=Number(t._string[u]),t._currentIndex+=1,u+=1}let a=e+o;if(a*=i,n&&(a*=Math.pow(10,c*n)),s===u)throw new Error("Internal error: startIndex === source._currentIndex");return t._skipOptionalSpacesOrDelimiter(),a}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{_string;_currentIndex;_endIndex;_prevCommand;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=[s(this)]:"M"===r||"L"===r||"T"===r?n=[s(this),s(this)]:"S"===r||"Q"===r?n=[s(this),s(this),s(this),s(this)]:"C"===r?n=[s(this),s(this),s(this),s(this),s(this),s(this)]:"A"===r?n=[s(this),s(this),s(this),this._parseArcFlag(),this._parseArcFlag(),s(this),s(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 s,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=c[l];if(!t)throw new Error("Invalid SVG - command not recognized.");const e=t(n);n.p=e[e.length-1],u.push(e)}s=l}else u.length&&("z"!==s&&u.push(o(n)),e.push(u),u=[]),n.initialPoint=n.p=n.vals,s=l}return u.length>0&&("z"!==s&&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 a(t,n,e="thin10 red nofill",r=0){if(0===n.length)return[];let o=`M${n[0][0][0]} ${n[0][0][1]} `;for(let t=0;t<n.length;t++){const e=n[t];if(e.length<=1)continue;const[,r,i,c]=e;o+=2===e.length?`L ${r[0]} ${r[1]} `:3===e.length?`Q ${r[0]} ${r[1]} ${i[0]} ${i[1]} `:`C ${r[0]} ${r[1]} ${i[0]} ${i[1]} ${c[0]} ${c[1]} `}const i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttributeNS(null,"d",o),i.setAttributeNS(null,"class",e),t.appendChild(i),[i]}function p(t){const n=t.length,e=Array.from(Array(n),()=>new Array(n).fill(0));for(let r=0;r<n;r++)for(let o=0;o<n;o++)e[r][o]=t[r][o];for(let t=0;t<n;t++)for(let r=0;r<n;r++)for(let o=0;o<n;o++)e[r][t]+e[t][o]<e[r][o]&&(e[r][o]=e[r][t]+e[t][o]);return e}function h(t){const n=t,e=[];do{e.push(t),t=t.next}while(t!==n);return e}function d(t){return h(t).filter(t=>t.isHoleClosing)}function g(t){const n=t.pointOnShape;return{idx:n.curve.idx,t:n.t,order:n.order,order2:n.order2}}function v(t){const n=t;let e=n,r=0;do{r++,e=e.nextOnCircle}while(e!==n);return r}function m(t,n=!1){const e=t,r=n?[]:[t];let o=t.nextOnCircle;for(;o!==e;)r.push(o),o=o.nextOnCircle;return r}function x(t){return t===t.next.prevOnCircle}function b(t){return m(t).filter(t=>!x(t)).length}function w(t){return m(t.prevOnCircle,!0).every(x)}function _(t){return 0===t.pointOnShape.circle.radius}function M(t){const n=t.pointOnShape,e=n.curve;return{...t,pos:n,p:n.p,t:n.t,isTerminating:x(t),isFullyTerminating:w(t),isSharp:_(t),prongCount:v(t),getRealProngCount:b(t),ordering:g(t),curve:e,loop:e.loop}}function S(t){let n=t;if(x(n))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 N(t,n){const e=h(t),r=new Set;for(t of e)x(t)||r.has(t.next.prevOnCircle)||n(t),r.add(t)}function I(t){const n=[],e=t;let r=e;for(;r!==e.prevOnCircle;)x(r)||n.push(r.next),r=r.nextOnCircle;return n}function y(t,n){n(t);const e=m(t).filter(t=>!x(t)).map(t=>t.next);for(const t of e){const e=[t];for(;e.length;){const t=e.pop();n(t),e.push(...I(t))}}}const E=["prev","next","prevOnCircle","nextOnCircle","holeCloserTwin"];function O(t){const n=new Map,e=C(t);n.set(t,e);const r=[{cpNode:t,newCpNode:e}];for(;r.length;){const{cpNode:t,newCpNode:e}=r.pop();for(const o of E){const i=t[o];if(void 0===i)continue;let c=n.get(i);c||(c=C(i),n.set(i,c),r.push({cpNode:i,newCpNode:c})),e[o]=c}}return e}function C(t){return{...t,prev:void 0,next:void 0,prevOnCircle:void 0,nextOnCircle:void 0,holeCloserTwin:void 0}}function T(t){const n=t,e=t.next,r=n.pointOnShape,o=e.pointOnShape,i=r.curve,c=o.curve;if(i.loop!==c.loop)return[];const s=[];return c===i?s.push({ps:r.curve.ps,ts:[r.t,o.t]}):(s.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?r:1;t.push({ps:o.ps,ts:[0,n]})}while(o!==e)}(s,r.curve,o.curve,o.t)),s}function P(t,n,e){if(4===t.length)return 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],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=p-n*(p-h),g=s-n*(s-f),v=f-n*(f-a),m=g-n*(g-v);return[e,[p,g],[d,m],[d-n*(d-(h-n*(h-(l-n*(l-i[0]))))),m-n*(m-(v-n*(v-(a-n*(a-i[1])))))]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=l-n*(l-i[0]),g=p-n*(p-h),v=h-n*(h-d),m=s-n*(s-f),x=f-n*(f-a),b=a-n*(a-i[1]),w=m-n*(m-x),_=x-n*(x-b);return[[g-n*(g-v),w-n*(w-_)],[v,_],[d,b],i]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=t[3],s=r[0],u=r[1],f=o[0],l=o[1],a=i[0],p=i[1],h=n*n,d=n*h,g=e*e,v=e*g,m=n*e,x=s-f,b=a-f,w=x+b,_=n*x,M=e*x,S=c[0]-s-3*b,N=u-l,I=p-l,y=N+I,E=n*N,O=e*N,C=c[1]-u-3*I;return[[d*S+(3*n*(n*w-x)+s),d*C+(3*n*(n*y-N)+u)],[m*(n*S+2*w)+(h*w+s-(M+2*_)),m*(n*C+2*y)+(h*y+u-(O+2*E))],[m*(e*S+2*w)+(g*w+s-(2*M+_)),m*(e*C+2*y)+(g*y+u-(2*O+E))],[v*S+(3*e*(e*w-x)+s),v*C+(3*e*(e*y-N)+u)]]}(t,n,e)}(t,n,e);if(3===t.length)return 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],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=c-u;return[e,[-n*l+i,-n*a+c],[f*(l+(o[0]-s))-(2*n*l-i),f*(a+(o[1]-u))-(2*n*a-c)]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=o[0]-s,p=c-u,h=o[1]-u;return[[f*(l+a)-(2*n*l-i),f*(p+h)-(2*n*p-c)],[n*a+s,n*h+u],o]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=n*n,a=e*e,p=n*e,h=c-u,d=h+(i[0]-u),g=s-f,v=g+(i[1]-f);return[[l*d-(2*n*h-c),l*v-(2*n*g-s)],[p*d-(h*(e+n)-c),p*v-(g*(e+n)-s)],[a*d-(2*e*h-c),a*v-(2*e*g-s)]]}(t,n,e)}(t,n,e);if(2===t.length)return 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[e,[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];return[[n*(r[0]-o)+o,n*(r[1]-i)+i],r]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1];return[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]]}(t,n,e)}(t,n,e);if(1===t.length)return t;throw new Error("The given bezier curve must be of order <= 3.")}function A(t){return T(t).map(t=>P(t.ps,t.ts[0],t.ts[1]))}function k(t,n){const{cpTrees:e}=n,r=t.prev,o=t.next;r.next=o,o.prev=r,e.get(t.pointOnShape.curve.loop).remove(t,!1)}function B(t,n){const e=v(t);if(2!==e)throw new Error(`Cannot delete \`CpNode\` on ${e}-prong`);m(t).forEach(t=>k(t,n))}function z(t){const n=[],e=t.next;let r=e;do{n.push(r),r=r.nextOnCircle}while(r.nextOnCircle!==e);return n}function F(t,n,e){if(void 0===t.size||void 0===e)return;const r=e[n];if(t.size>r&&void 0!==r)for(const[n]of t){t.delete(n);break}}const Y=[function(t,n){let e,r=!1;return function(){return r||(e=t(),r=!0),e}},function(t,n,e=!1){const r=new WeakMap,o=new Map;function i(t){return"object"!=typeof t&&"function"!=typeof t||null===t?o:r}const c=function(r){let c;const s=i(r);return s.has(r)?(e&&console.log("cache hit"),c=s.get(r)):(e&&console.log("cache miss"),c=t(r),s.set(r,c),F(o,0,n)),c};return c.mapS=o,c.weakMapS=r,c.clearCache=function(){o.clear()},c.addToCache=function(t,e){const r=i(e);r.set(e,t),F(r,1,n)},c},function(t,n){const e=new WeakMap,r=new Map;function o(t,o){const i=("object"==typeof o||"function"==typeof o)&&null!==o;let c="object"!=typeof t&&"function"!=typeof t||null===t?r:e,s=c.get(t);return void 0===s&&(s={weakMap:new WeakMap,map:new Map},c.set(t,s),F(c,0,n)),i?s.weakMap:s.map}function i(e,r){const i=o(e,r);let c;return i.has(r)?c=i.get(r):(c=t(e,r),i.set(r,c),F(i,1,n)),c}return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r){const i=o(e,r);i.set(r,t),F(i,1,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i){const c=("object"==typeof o||"function"==typeof o)&&null!==o,s=("object"==typeof i||"function"==typeof i)&&null!==i;let u="object"!=typeof t&&"function"!=typeof t||null===t?r:e,f=u.get(t);void 0===f&&(f={weakMap:new WeakMap,map:new Map},u.set(t,f),F(u,0,n));const l=c?f.weakMap:f.map;let a=l.get(o);return void 0===a&&(a={weakMap:new WeakMap,map:new Map},l.set(o,a),F(l,1,n)),s?a.weakMap:a.map}const i=function(e,r,i){const c=o(e,r,i);let s;return c.has(i)?s=c.get(i):(s=t(e,r,i),c.set(i,s),F(c,2,n)),s};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i){const c=o(e,r,i);c.set(i,t),F(c,2,n)},i},function(t,n,e=!1){const r=new WeakMap,o=new Map;function i(t,e,i,c){const s=("object"==typeof e||"function"==typeof e)&&null!==e,u=("object"==typeof i||"function"==typeof i)&&null!==i,f=("object"==typeof c||"function"==typeof c)&&null!==c;let l="object"!=typeof t&&"function"!=typeof t||null===t?o:r,a=l.get(t);void 0===a&&(a={weakMap:new WeakMap,map:new Map},l.set(t,a),F(l,0,n));const p=s?a.weakMap:a.map;let h=p.get(e);void 0===h&&(h={weakMap:new WeakMap,map:new Map},p.set(e,h),F(p,1,n));const d=u?h.weakMap:h.map;let g=d.get(i);return void 0===g&&(g={weakMap:new WeakMap,map:new Map},d.set(i,g),F(d,2,n)),f?g.weakMap:g.map}const c=function(r,o,c,s){const u=i(r,o,c,s);let f;return u.has(s)?(e&&console.log("cache hit"),f=u.get(s)):(e&&console.log("cache miss"),f=t(r,o,c,s),u.set(s,f),F(u,3,n)),f};return c.mapS=o,c.weakMapS=r,c.clearCache=function(){o.clear()},c.addToCache=function(t,e,r,o,c){const s=i(e,r,o,c);s.set(c,t),F(s,3,n)},c},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s){const u=("object"==typeof o||"function"==typeof o)&&null!==o,f=("object"==typeof i||"function"==typeof i)&&null!==i,l=("object"==typeof c||"function"==typeof c)&&null!==c,a=("object"==typeof s||"function"==typeof s)&&null!==s;let p="object"!=typeof t&&"function"!=typeof t||null===t?r:e,h=p.get(t);void 0===h&&(h={weakMap:new WeakMap,map:new Map},p.set(t,h),F(p,0,n));const d=u?h.weakMap:h.map;let g=d.get(o);void 0===g&&(g={weakMap:new WeakMap,map:new Map},d.set(o,g),F(d,1,n));const v=f?g.weakMap:g.map;let m=v.get(i);void 0===m&&(m={weakMap:new WeakMap,map:new Map},v.set(i,m),F(v,2,n));const x=l?m.weakMap:m.map;let b=x.get(c);return void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(c,b),F(x,3,n)),a?b.weakMap:b.map}const i=function(e,r,i,c,s){const u=o(e,r,i,c,s);let f;return u.has(s)?f=u.get(s):(f=t(e,r,i,c,s),u.set(s,f),F(u,4,n)),f};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s){const u=o(e,r,i,c,s);u.set(s,t),F(u,4,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u){const f=("object"==typeof o||"function"==typeof o)&&null!==o,l=("object"==typeof i||"function"==typeof i)&&null!==i,a=("object"==typeof c||"function"==typeof c)&&null!==c,p=("object"==typeof s||"function"==typeof s)&&null!==s,h=("object"==typeof u||"function"==typeof u)&&null!==u;let d="object"!=typeof t&&"function"!=typeof t||null===t?r:e,g=d.get(t);void 0===g&&(g={weakMap:new WeakMap,map:new Map},d.set(t,g),F(d,0,n));const v=f?g.weakMap:g.map;let m=v.get(o);void 0===m&&(m={weakMap:new WeakMap,map:new Map},v.set(o,m),F(v,1,n));const x=l?m.weakMap:m.map;let b=x.get(i);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(i,b),F(x,2,n));const w=a?b.weakMap:b.map;let _=w.get(c);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(c,_),F(w,3,n));const M=p?_.weakMap:_.map;let S=M.get(s);return void 0===S&&(S={weakMap:new WeakMap,map:new Map},M.set(s,S),F(M,4,n)),h?S.weakMap:S.map}const i=function(e,r,i,c,s,u){const f=o(e,r,i,c,s,u);let l;return f.has(u)?l=f.get(u):(l=t(e,r,i,c,s,u),f.set(u,l),F(f,5,n)),l};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u){const f=o(e,r,i,c,s,u);f.set(u,t),F(f,5,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u,f){const l=("object"==typeof o||"function"==typeof o)&&null!==o,a=("object"==typeof i||"function"==typeof i)&&null!==i,p=("object"==typeof c||"function"==typeof c)&&null!==c,h=("object"==typeof s||"function"==typeof s)&&null!==s,d=("object"==typeof u||"function"==typeof u)&&null!==u,g=("object"==typeof f||"function"==typeof f)&&null!==f;let v="object"!=typeof t&&"function"!=typeof t||null===t?r:e,m=v.get(t);void 0===m&&(m={weakMap:new WeakMap,map:new Map},v.set(t,m),F(v,0,n));const x=l?m.weakMap:m.map;let b=x.get(o);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(o,b),F(x,1,n));const w=a?b.weakMap:b.map;let _=w.get(i);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(i,_),F(w,2,n));const M=p?_.weakMap:_.map;let S=M.get(c);void 0===S&&(S={weakMap:new WeakMap,map:new Map},M.set(c,S),F(M,3,n));const N=h?S.weakMap:S.map;let I=N.get(s);void 0===I&&(I={weakMap:new WeakMap,map:new Map},N.set(s,I),F(N,4,n));const y=d?I.weakMap:I.map;let E=y.get(u);return void 0===E&&(E={weakMap:new WeakMap,map:new Map},y.set(u,E),F(y,5,n)),g?E.weakMap:E.map}const i=function(e,r,i,c,s,u,f){const l=o(e,r,i,c,s,u,f);let a;return l.has(f)?a=l.get(f):(a=t(e,r,i,c,s,u,f),l.set(f,a),F(l,6,n)),a};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u,f){const l=o(e,r,i,c,s,u,f);l.set(f,t),F(l,6,n)},i},function(t,n){const e=new WeakMap,r=new Map;function o(t,o,i,c,s,u,f,l){const a=("object"==typeof o||"function"==typeof o)&&null!==o,p=("object"==typeof i||"function"==typeof i)&&null!==i,h=("object"==typeof c||"function"==typeof c)&&null!==c,d=("object"==typeof s||"function"==typeof s)&&null!==s,g=("object"==typeof u||"function"==typeof u)&&null!==u,v=("object"==typeof f||"function"==typeof f)&&null!==f,m=("object"==typeof l||"function"==typeof l)&&null!==l;let x="object"!=typeof t&&"function"!=typeof t||null===t?r:e,b=x.get(t);void 0===b&&(b={weakMap:new WeakMap,map:new Map},x.set(t,b),F(x,0,n));const w=a?b.weakMap:b.map;let _=w.get(o);void 0===_&&(_={weakMap:new WeakMap,map:new Map},w.set(o,_),F(w,1,n));const M=p?_.weakMap:_.map;let S=M.get(i);void 0===S&&(S={weakMap:new WeakMap,map:new Map},M.set(i,S),F(M,2,n));const N=h?S.weakMap:S.map;let I=N.get(c);void 0===I&&(I={weakMap:new WeakMap,map:new Map},N.set(c,I),F(N,3,n));const y=d?I.weakMap:I.map;let E=y.get(s);void 0===E&&(E={weakMap:new WeakMap,map:new Map},y.set(s,E),F(y,4,n));const O=g?E.weakMap:E.map;let C=O.get(u);void 0===C&&(C={weakMap:new WeakMap,map:new Map},O.set(u,C),F(O,5,n));const T=v?C.weakMap:C.map;let P=T.get(f);return void 0===P&&(P={weakMap:new WeakMap,map:new Map},T.set(f,P),F(T,6,n)),m?P.weakMap:P.map}const i=function(e,r,i,c,s,u,f,l){const a=o(e,r,i,c,s,u,f,l);let p;return a.has(l)?p=a.get(l):(p=t(e,r,i,c,s,u,f,l),a.set(l,p),F(a,7,n)),p};return i.mapS=r,i.weakMapS=e,i.clearCache=function(){r.clear()},i.addToCache=function(t,e,r,i,c,s,u,f,l){const a=o(e,r,i,c,s,u,f,l);a.set(l,t),F(a,7,n)},i}];function L(t,n,e=!1){const r=t.length;if(r>8)throw new Error("A maximum of 8 formal parameters are supported");return(0,Y[r])(t,n,e)}function X(t,n){const[[e,r],[o,i]]=t,[[c,s],[u,f]]=n,l=o-e,a=i-r,p=u-c,h=f-s,d=p*a-h*l;if(0===d)return;const g=((s-r)*l-(c-e)*a)/d;return[c+g*p,s+g*h]}function H(t,n){return[n[0]-t[0],n[1]-t[1]]}function D(t,n){return t[0]*n[0]+t[1]*n[1]}function V(t){return[-t[1],t[0]]}function $(t,n){return t[0]*n[1]-t[1]*n[0]}function q(t,n,e){return[t[0]+(n[0]-t[0])*e,t[1]+(n[1]-t[1])*e]}function j(t,n){function e(n){return[t[0]+n[0],t[1]+n[1]]}return void 0===n?e:e(n)}function W(t){const n=1/Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]*n,t[1]*n]}function Q(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 R(t,n){let e=0;for(let r=0;r<t.length;r++)e=e*n+t[r];return e}function G(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[3*(s-n+3*(r-i)),6*(i+n-2*r),3*(r-n)],[3*(u-e+3*(o-c)),6*(c+e-2*o),3*(o-e)]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,c]]=t;return[[2*(i+n-2*r),2*(r-n)],[2*(c+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 U(t,n){const[e,r]=G(t);return[R(e,n),R(r,n)]}function Z(t,n){const e=t-n,r=t-e;return[t-(e+r)+(r-n),e]}function J(t,n){const e=t.length,r=n.length;let o=0,i=0;const c=[];for(;o<e&&i<r;)0!==t[o]?0!==n[i]?Math.abs(t[o])<=Math.abs(n[i])?(c.push(t[o]),o++):(c.push(n[i]),i++):i++:o++;for(;o<e;)c.push(t[o]),o++;for(;i<r;)c.push(n[i]),i++;if(0===c.length)return[0];const s=c.length;if(1===s)return c;const u=[],f=c[1],l=c[0];let a=f+l;const p=l-(a-f);0!==p&&u.push(p),i=0;for(let t=2;t<s;t++){const n=c[t],e=a+n,r=e-a,o=a-(e-r)+(n-r);0!==o&&u.push(o),a=e}return 0===a&&0!==u.length||u.push(a),u}const K=134217729;function tt(t,n){const e=t.length;let r;const o=t[0];let i=o*n;const c=K*o,s=c-(c-o),u=o-s,f=K*n,l=f-(f-n),a=n-l,p=[],h=u*a-(i-s*l-u*l-s*a);0!==h&&p.push(h);for(let o=1;o<e;o++){const e=t[o],c=e*n,s=K*e,u=s-(s-e),f=e-u,l=K*n,a=l-(l-n),h=n-a,d=f*h-(c-u*a-f*a-u*h),g=i+d,v=g-i,m=i-(g-v)+(d-v);0!==m&&p.push(m),r=g;const x=c+r,b=r-(x-c);0!==b&&p.push(b),i=x}return 0===i&&0!==p.length||p.push(i),p}function nt(t,n){const e=n.length;let r;const o=n[0];let i=o*t;const c=K*o,s=c-(c-o),u=o-s,f=K*t,l=f-(f-t),a=t-l,p=[],h=u*a-(i-s*l-u*l-s*a);0!==h&&p.push(h);for(let o=1;o<e;o++){const e=n[o],c=e*t,s=K*e,u=s-(s-e),f=e-u,l=K*t,a=l-(l-t),h=t-a,d=f*h-(c-u*a-f*a-u*h),g=i+d,v=g-i,m=i-(g-v)+(d-v);0!==m&&p.push(m),r=g;const x=c+r,b=r-(x-c);0!==b&&p.push(b),i=x}return 0===i&&0!==p.length||p.push(i),p}function et(t,n){let e=[0];for(let r=0;r<t.length;r++)e=J(e,tt(n,t[r]));return e}function rt(t){let n=t[0];for(let e=1;e<t.length;e++)n+=t[e];return n}function ot(t){const n=t.length,e=new Array(n);for(let r=0;r<n;r++)e[r]=-t[r];return e}function it(t,n){return J(t,ot(n))}function ct(t){return t[t.length-1]}const st=Z,ut=nt;function ft(t){if(4===t.length){const[[n,e],[r,o]]=t;return[ut(3,st(r,n)),ut(3,st(o,e))]}if(3===t.length){const[[n,e],[r,o]]=t;return[st(2*r,2*n),st(2*o,2*e)]}if(2===t.length){const[[n,e],[r,o]]=t;return[st(r,n),st(o,e)]}if(1===t.length)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}function lt(t,n){const e=t+n,r=e-t;return[t-(e-r)+(n-r),e]}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,c=i-r,s=r-(i-c)+(e-c);0!==s&&o.push(s),r=i}return 0===r&&0!==o.length||o.push(r),o}const pt=lt,ht=nt,dt=at;function gt(t){if(4===t.length){const[[n,e],[r,o],[i,c]]=t;return[ht(6,dt(pt(i,n),-2*r)),ht(6,dt(pt(c,e),-2*o))]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[dt(pt(2*i,2*n),-4*r),dt(pt(2*c,2*e),-4*o)]}if(t.length<=2)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3")}const vt=Z,mt=nt,xt=J;function bt(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[mt(6,xt(vt(s,n),mt(3,vt(r,i))))],[mt(6,xt(vt(u,e),mt(3,vt(o,c))))]]}if(t.length<=3)return[[[0]],[[0]]];throw new Error("The given bezier curve must be of order <= 3.")}const{sign:wt}=Math;function _t(t,n){const[e,r]=ft(t),[o,i]=gt(t),[c,s]=ft(n),[u,f]=gt(n),l=it(et(e,i),et(r,o)),a=it(et(c,f),et(s,u)),p=ct(l),h=ct(a);if(wt(p)!==wt(h))return p-h;const d=J(et(c,c),et(s,s)),g=J(et(e,e),et(r,r)),v=et(d,d),m=et(v,d),x=et(g,g),b=et(x,g);if(0!==p||0!==h){const t=et(l,l),n=et(a,a),e=ct(it(et(t,m),et(n,b)));if(0!==e)return p>0?e:-e}const[[w],[_]]=bt(t),[[M],[S]]=bt(n),N=it(et(e,_),et(r,w)),I=J(et(e,o),et(r,i)),y=it(et(c,S),et(s,M)),E=J(et(c,u),et(s,f)),O=it(et(g,N),tt(et(l,I),3)),C=it(et(d,y),tt(et(a,E),3)),T=ct(O),P=ct(C);if(T!==P)return T-P;if(0===T&&0===P)return 0;const A=et(O,O),k=et(v,m),B=et(C,C),z=et(x,b),F=ct(it(et(A,k),et(B,z)));return T>0?F:-F}function Mt(t,n){return t[0]===n[0]&&t[1]===n[1]}function St(t,n){const{ccw:e,tangentI:r,tangentO:o,dotTangents:i}=function(t,n){const e=t.length;let r=t[e-2],o=n[0],i=n[1];Mt(r,o)&&(r=t[e-3]),Mt(o,i)&&(i=n[2]);const c=function(t,n,e){const r=Z(t[0],e[0]),o=Z(n[1],e[1]),i=Z(t[1],e[1]),c=Z(n[0],e[0]);return rt(J(et(r,o),ot(et(i,c))))}(r,o,i),s=[Z(o[0],r[0]),Z(o[1],r[1])],u=[Z(i[0],o[0]),Z(i[1],o[1])],f=function(t,n){return rt(J(et(t[0],n[0]),et(t[1],n[1])))}(s,u);return 0!==c||f>0?{ccw:c,tangentI:s,tangentO:u,dotTangents:f}:{ccw:_t(t.slice().reverse(),n),tangentI:s,tangentO:u,dotTangents:f}}(t,n),c=e<0,s=e>0,u=[W(r.map(t=>t[1])),W(o.map(t=>t[1]))],f=$(u[0],u[1]);let l,a;return i>0?(l=f<-.0698,a=f>.0698):(l=c,a=s),{tangents:u,isSharp:c,isDull:s,isQuiteSharp:l,isQuiteDull:a}}const Nt=L(function(t){const{t:n,curve:e}=t;return St(1===n?e.ps:e.prev.ps,1===n?e.next.ps:e.ps)});function It(t){return 0===t.t||1===t.t}function yt(t){return!!It(t)&&Nt(t).isSharp}function Et(t){const n=t.pointOnShape.circle.center,e=t,r=t.nextOnCircle,o=e.pointOnShape,i=r.pointOnShape,c=o.p,s=i.p;let u;if(yt(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=W(U(t.ps,0)),r=[-(f=W(U(n.ps,1)))[0],-f[1]],i=D(e,r),c=Math.sqrt((1+i)/2);u=Q(Math.sqrt((1-i)/2),c,r)}else u=c[0]===s[0]&&c[1]===s[1]?H(c,n):V(H(c,s));var f;return[n,j(W(u),n)]}const{abs:Ot}=Math,Ct=1e-4;function Tt(t,n){const e=t.pointOnShape.circle.center,r=Et(t),o=n.pointOnShape.circle.center,i=Et(n.prevOnCircle),c=X(r,i),s=H(e,o);let u;if(c){const t=H(e,c),n=H(o,c);u=D(t,s)<0||D(n,s)>0}else u=!0;if(!u)return[e,c,o];const f=V(s),l=H(r[0],r[1]),a=H(i[0],i[1]),p=Ot($(s,l))/9,h=Ot($(s,a))/9;if(p>.01||h>.01)return[e,o];if(p>Ct||h>Ct){const t=q(e,o,1/3),n=q(e,o,2/3),c=j(f,t),s=[n,j(f,n)];return[e,X(r,[t,c]),X(i,s),o]}return[e,o]}function Pt(t){return Tt(t,t.next)}function At(t){const n=t;let e=n;for(;e.next===e.prevOnCircle;)if(e=e.next,e===n)return;return e}function kt(t,n){return m(t).indexOf(n)>=0}function Bt(t){return 1===b(t)&&!t.isHoleClosing}function zt(t){return 2===b(t)}function Ft(t){return m(t).every(x)}function Yt(t){if(Ft(t))return[];for(;x(t);)t=t.nextOnCircle;for(t=t.next;2===b(t);)t=t.next;t=t.prevOnCircle;const n=[];do{n.push(t),t=t.next}while(!w(t)&&2===b(t));return n}function Lt(t){return Yt(t).map(t=>Pt(t))}function Xt(t,n){const e=n[0]-t[0],r=n[1]-t[1];return Math.sqrt(e*e+r*r)}function Ht(t,n){const[e,r]=t,[[o,i],[c,s]]=n;return Xt([o+e*(c-o),i+e*(s-i)],[o+r*(c-o),i+r*(s-i)])}function Dt(t,n,e=16){if(n[0]===n[1])return 0;const{weights:r,abscissas:o}=Vt[e],[i,c]=n;let s=0;const u=(c-i)/2,f=(c+i)/2;for(let n=0;n<=e-1;n++)s+=r[n]*t(u*o[n]+f);return u*s}L(Pt);const Vt={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]}},{sqrt:$t}=Math;function qt(t){const[n,e]=G(t);return function(t){const r=R(n,t),o=R(e,t);return $t(r*r+o*o)}}const{abs:jt}=Math,Wt=[[0,0],[0,0],[0,0]];function Qt(t,n,e){return 0===n?1===e?{ps:t,_ps:Wt}:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=c-u,d=[[i,c],[-n*p+i,-n*h+c],[a*(p+(f-s))-(2*n*p-i),a*(h+(l-u))-(2*n*h-c)]],g=jt(n),v=jt(i),m=jt(s),x=jt(f),b=v+m,w=jt(c),_=jt(u),M=w+_;return{ps:d,_ps:[[0,0],[g*b+v,g*M+w],[a*(b+(x+m))+(2*g*b+v),a*(M+(jt(l)+_))+(2*g*M+w)]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=f-s,d=c-u,g=l-u,v=[[a*(p+h)-(2*n*p-i),a*(d+g)-(2*n*d-c)],[n*h+s,n*g+u],[f,l]],m=jt(n),x=jt(i),b=jt(s),w=x+b,_=jt(f)+b,M=jt(c),S=jt(u),N=M+S;return{ps:v,_ps:[[a*(w+_)+(2*m*w+x),a*(N+(jt(l)+S))+(2*m*N+M)],[m*_+b,0],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=i[0],a=i[1],p=n*n,h=e*e,d=n*e,g=c-u,v=g+(l-u),m=s-f,x=m+(a-f),b=p*v-(2*n*g-c),w=d*v-(g*(e+n)-c),_=h*v-(2*e*g-c),M=p*x-(2*n*m-s),S=d*x-(m*(e+n)-s),N=h*x-(2*e*m-s),I=jt(n),y=jt(e),E=jt(d),O=jt(c),C=jt(u),T=O+C,P=T+jt(l)+C,A=jt(s),k=jt(f),B=A+k,z=B+jt(a)+k;return{ps:[[b,M],[w,S],[_,N]],_ps:[[p*P+(2*I*T+O),p*z+(2*I*B+A)],[E*P+(T*(y+I)+O),E*x+(B*(y+I)+A)],[h*P+(2*y*T+O),h*z+(2*y*B+A)]]}}(t,n,e)}const Rt=134217729;function Gt(t,n){const e=t*n,r=Rt*t,o=r-(r-t),i=t-o,c=Rt*n,s=c-(c-n),u=n-s;return[i*u-(e-o*s-i*s-o*u),e]}function Ut(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=r+i,s=c-r,u=e+o,f=u-e,l=r-(c-s)+(i-s)+u,a=c+l,p=e-(u-f)+(o-f)+(l-(a-c)),h=a+p;return[p-(h-a),h]}function Zt(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=r-i,s=c-r,u=e-o,f=u-e,l=r-(c-s)+(-i-s)+u,a=c+l,p=e-(u-f)+(-o-f)+(l-(a-c)),h=a+p;return[p-(h-a),h]}const{atan2:Jt}=Math,Kt=Gt;function tn(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=Zt(Kt(i,e),Kt(o,r))[1],s=Ut(Kt(o,e),Kt(i,r))[1];return Jt(c,s)}const{abs:nn}=Math;function en(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+=nn(tn(n[t],n[t+1]));return r}function rn(t,n=.4,e=2**-16){const r=[0],o=[1];for(;;){const i=r[r.length-1],c=o[o.length-1];if(en(P(t,i,c))<=n||c-i<=e){if(r.push(o.pop()),1===c)return r;continue}const s=(i+c)/2;o.push(s)}}const{sqrt:on,log:cn}=Math;function sn(t,n,e=.4,r=16){const o=t[0],i=t[1];if(o===i)return 0;const[[c,s],[u,f],[l,a]]=n;if(c===u&&u===l&&s===f&&f===a)return 0;const p=Qt(n,o,i).ps,h=rn(p,e);let d=0;for(let t=0;t<h.length-1;t++){const n=h[t],e=h[t+1];d+=Dt(qt(p),[n,e],r)}return d}const{abs:un}=Math,fn=[[0,0],[0,0],[0,0],[0,0]];function ln(t,n,e){return 0===n?1===e?{ps:t,_ps:fn}:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=d-n*(d-g),m=v-n*(v-(g-n*(g-(l-n*(l-p))))),x=s-n*(s-f),b=f-n*(f-a),w=x-n*(x-b),_=w-n*(w-(b-n*(b-(a-n*(a-h))))),M=un(n),S=un(c),N=un(u),I=un(l),y=un(p),E=un(s),O=un(f),C=un(a),T=S+M*(S+N),P=N+M*(N+I),A=T+M*(T+P),k=E+M*(E+O),B=O+M*(O+C),z=k+M*(k+B);return{ps:[[c,s],[d,x],[v,w],[m,_]],_ps:[[0,0],[T,k],[A,z],[A+M*(A+(P+M*(P+(I+M*(I+y))))),z+M*(z+(B+M*(B+(C+M*(C+un(h))))))]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=l-n*(l-p),m=d-n*(d-g),x=g-n*(g-v),b=m-n*(m-x),w=s-n*(s-f),_=f-n*(f-a),M=a-n*(a-h),S=w-n*(w-_),N=_-n*(_-M),I=S-n*(S-N),y=un(n),E=un(c),O=un(u),C=un(l),T=un(p),P=un(s),A=un(f),k=un(a),B=E+y*(E+O),z=O+y*(O+C),F=C+y*(C+T),Y=B+y*(B+z),L=z+y*(z+F),X=P+y*(P+A),H=A+y*(A+k),D=k+y*(k+un(h)),V=X+y*(X+H),$=H+y*(H+D);return{ps:[[b,I],[x,N],[v,M],[p,h]],_ps:[[Y+y*(Y+L),V+y*(V+$)],[L,$],[F,D],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=t[3],s=r[0],u=r[1],f=o[0],l=o[1],a=i[0],p=i[1],h=n*n,d=n*h,g=e*e,v=e*g,m=n*e,x=s-f,b=a-f,w=c[0]-s,_=x+b,M=n*x,S=e*x,N=w-3*b,I=u-l,y=p-l,E=c[1]-u,O=I+y,C=n*I,T=e*I,P=E-3*y,A=d*N+(3*n*(n*_-x)+s),k=m*(n*N+2*_)+(h*_+s-(S+2*M)),B=m*(e*N+2*_)+(g*_+s-(2*S+M)),z=v*N+(3*e*(e*_-x)+s),F=d*P+(3*n*(n*O-I)+u),Y=m*(n*P+2*O)+(h*O+u-(T+2*C)),L=m*(e*P+2*O)+(g*O+u-(2*T+C)),X=v*P+(3*e*(e*O-I)+u),H=un(n),D=un(e),V=un(m),$=un(d),q=un(v),j=un(s),W=un(f),Q=j+W,R=un(a)+W,G=Q+R,U=H*Q,Z=D*Q,J=un(w)+3*R,K=un(u),tt=un(l),nt=K+tt,et=un(p)+tt,rt=nt+et,ot=H*nt,it=D*nt,ct=un(E)+3*et;return{ps:[[A,F],[k,Y],[B,L],[z,X]],_ps:[[$*J+(3*H*(H*G+Q)+j),$*ct+(3*H*(H*rt+nt)+K)],[V*(H*J+2*G)+(h*G+j+(Z+2*U)),V*(H*ct+2*rt)+(h*rt+K+(it+2*ot))],[V*(D*J+2*G)+(g*G+j+(2*Z+U)),V*(D*ct+2*rt)+(g*rt+K+(2*it+ot))],[q*J+(3*D*(D*G+Q)+j),q*ct+(3*D*(D*rt+nt)+K)]]}}(t,n,e)}function an(t,n,e=.4,r=16){const o=t[0],i=t[1];if(o===i)return 0;const[[c,s],[u,f],[l,a],[p,h]]=n;if(c===u&&u===l&&l===p&&s===f&&f===a&&a===h)return 0;const d=ln(n,o,i).ps,g=rn(d,e);let v=0;for(let t=0;t<g.length-1;t++){const n=g[t],e=g[t+1];v+=Dt(qt(d),[n,e],r)}return v}function pn(t,n=.4,e=16){if(4===t.length)return an([0,1],t,n,e);if(3===t.length)return sn([0,1],t,n,e);if(2===t.length)return Ht([0,1],t);if(1===t.length)return 0;throw new Error("The given bezier curve must be of order <= 3.")}function hn(t,n,e=!0){const{cpNodes:r,hasHoleCloser:o}=function(t,n,e=!0){if(!e&&t===n)return{cpNodes:[],hasHoleCloser:!1};const r=t,o=[r];let i=t.next,c=r.isHoleClosing;for(;i!==n&&i!==r;)i.isHoleClosing&&(c=!0),o.push(i),i=i.next;return{cpNodes:o,hasHoleCloser:c}}(t,n,e);return{pss:r.flatMap(A),hasHoleCloser:o}}function dn(t){const n=t,e=t.nextOnCircle,r=Xt(n.pointOnShape.p,e.pointOnShape.p),{pss:o,hasHoleCloser:i}=hn(n,e),c=function(t){let n=0;for(let e of t)n+=e;return n}(o.map(t=>pn(t)));return i?1/0:c/r}function gn(t,n){let e=t;const r=[];for(;e!==n;){const t=Tt(e,e.next);r.push(t),e=e.next}return r}function vn(t,n){const e=$(W(U(Pt(t),0)),W(U(Pt(n),0)));return Math.abs(Math.asin(e)*(180/Math.PI))}function mn(t){const n=[];return y(t,t=>{n.push(t)}),n}function xn(t,n){let e;return e=t.curve.idx-n.curve.idx,0!==e||(e=t.t-n.t,0!==e||(e=t.order-n.order,0!==e||(e=t.order2-n.order2))),e}function bn(t,n){return xn(t.pointOnShape,n.pointOnShape)}const wn={getChildren:z,getVertexForwardChildren:I,getAllOnLoop:h,getAllOnCircle:m,isOnSameCircle:kt,isTerminating:x,isFullyTerminating:w,getFirstExit:At,isSharp:_,isOneProng:Bt,getProngCount:v,getRealProngCount:b,cpNodeComparator:bn,enhanceCpNode:M,traverseCp:S,traverseEdges:N,traverseVertices:y,clone:O,getBoundaryBezierPartsToNext:T,getBoundaryBeziersToNext:A,removeVertex:B,getMatCurveToNext:Pt,isTwoProng:zt,getBranch:Yt,getBranchBeziers:Lt,getSalience:dn,getMatCurveBetween:Tt,getEdgeDirection:Et,getBoundaryBeziersBetween:hn,getMatCurvesBetween:gn,getHoleClosers:d,getInitialDegAngleBetweenMatCurves:vn,getAllVertices:mn};function _n(t){return n=>m(n).some(t)}const Mn=_n(function(t){return 2!==b(t)&&!t.isHoleClosing});function Sn(t){const n=new Array(t.length);for(let e=0;e<t.length;e++)n[e]=-t[e];return n}function Nn(t){return n=>1/t(n.toReversed())}function In(t){const n=t.length-1;if(n<1)return 0;t[0]<0&&(t=Sn(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=1/0,i=!1;for(let r=0;r<o;r++){if(t[r]<=0)continue;const c=(-t[o]/(t[r]/2**e[r]))**(1/(o-r));e[r]++,n>c&&(n=c),i=!0}i&&r<n&&(r=n)}return r}Nn(In);const yn=(En=In,t=>-En(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==(n-1)%2&&(e[t]=-e[t]);return e}(t)));var En;Nn(yn);const{min:On,max:Cn}=Math,{abs:Tn}=Math;function Pn(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 c=i-(r-e);c&&(n[--o]=r,r=c)}let i=0;for(let t=o;t<e;++t){const e=n[t],o=r;r=e+o;const c=o-(r-e);c&&(n[i++]=c)}return n[i++]=r,n.length=i,n}const An=Number.EPSILON,kn=Number.EPSILON/2,Bn=kn*kn,zn=Yn(1),Fn=function(){const t=3*Bn;return t/(1-t)}();function Yn(t){const n=t*kn;return n/(1-n)}new Array(20).fill(0).map((t,n)=>Yn(n));const{abs:Ln}=Math,{abs:Xn}=Math,Hn=134217729;function Dn(t,n){const e=n[0],r=n[1],o=r*t,i=Hn*r,c=i-(i-r),s=r-c,u=Hn*t,f=u-(u-t),l=t-f,a=s*l-(o-c*f-s*f-c*l)+e*t,p=o+a;return[a-(p-o),p]}const{abs:Vn}=Math;function $n(t,n,e){const r=t.length-1;if(r<0)return[[],[]];const o=Vn(n),i=t.slice(),c=e.slice();for(let t=0;t<=r;t++)for(let e=1;e<=r-t;e++){const t=i[e-1],r=c[e-1],s=Dn(n,t),u=o*r+Vn(s[1]),f=i[e];i[e]=Ut(f,s),c[e]=c[e]+u+Vn(i[e][1])}return[i,c]}const qn=2**27+1;function jn(t,n){const e=t[1],r=n[1],o=e*r,i=qn*e,c=i-(i-e),s=e-c,u=qn*r,f=u-(u-r),l=r-f,a=s*l-(o-c*f-s*f-c*l)+(e*n[0]+t[0]*r),p=o+a;return[a-(p-o),p]}const{abs:Wn}=Math;function Qn(t,n){const e=t.length-1;if(e<0)return[];const r=t.slice();for(let t=0;t<=e;t++)for(let o=1;o<=e-t;o++)r[o]=Pn(J(r[o],tt(r[o-1],n)));return r}function Rn(t,n){const e=t.length-1;if(e<0)return[];const r=new Array(e+1);r[e]=t[e];let o=[1];for(let i=1;i<=e;i++)o=tt(o,n),r[e-i]=et(t[e-i],o);return r}const{abs:Gn,sign:Un}=Math;const Zn=134217729;function Jn(t,n){const e=t*n,r=Zn*t,o=r-(r-t),i=t-o,c=Zn*n,s=c-(c-n),u=n-s;return[i*u-(e-o*s-i*s-o*u),e]}const{abs:Kn}=Math;function te(t,n){const e=Kn(n);let r=t[0],o=.5*Kn(r);for(let i=1;i<t.length;i++)r=r*n+t[i],o=o*e+Kn(r);return o=kn*(2*o-Kn(r)),[r,o]}const ne=Math.abs,{abs:ee}=Math,re=Yn(1),oe=Yn(2);function ie(t,n,e=void 0,r=1){const o=t[0],[i,c]=te(o,n),s=oe*function(t,n){const e=ne(n);let r=0;for(let n=0;n<t.length;n++)r=r*e+ne(t[n]);return r}(o,n),u=void 0!==e?R(e,ee(n)):0;if((c+s+u)*r<Math.abs(i))return i;const f=function(t,n){const e=[],r=[];let o,i=t[0];for(let c=1;c<t.length;c++){const[s,u]=Jn(i,n);[o,i]=lt(u,t[c]),e.push(s),r.push(o)}return{r̂:i,pπ:e,pσ:r}}(o,n),{pπ:l,pσ:a}=f;let{r̂:p}=f;const[h,d]=te(l,n),[g,v]=te(a,n),[m,x]=te(t[1],n);let b=d+v+x+u;return p=h+g+m+p,b+=re*p,b*r<Math.abs(p)?p:0}function ce(t,n){let e=[0];for(let r=0;r<t.length;r++)e=J(t[r],tt(e,n));return e}const{abs:se,min:ue,max:fe,log2:le,ceil:ae}=Math;function pe(t,n,e,r,o,i,c,s){let u=e,f=r,l=u,a=o,p=f-u,h=p;for(;;){let d;se(a)<se(i)&&(u=f,f=l,l=u,o=i,i=a,a=o);const g=fe(se(u),se(f));d=g<=1?An:An*2**ae(le(g));const v=.5*(l-f);if(se(v)<=d)return f<l?[f,l,f]:[l,f,f];if(se(p)<d||se(o)<=se(i))p=v,h=p;else{let t,n,e=i/o;if(u===l)t=2*v*e,n=1-e;else{n=o/a;const r=i/a;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=p,p=h,2*t<3*v*n-se(d*n)&&t<se(.5*e*n)?h=t/n:(p=v,h=p)}if(u=f,o=i,d<se(h)?f+=h:0<v?f+=d:f-=d,0===(i=s?rt(ce(c(),f)):ie(t,f,n))){if(s)return[f,f,f];const o=fe(e,f-d),u=ue(r,f+d);if(ie(t,o,n)*ie(t,u,n)!==0)return[o,u,f];if(s=!0,0===(i=rt(ce(c(),f))))return[f,f,f]}(0<i&&0<a||i<=0&&a<=0)&&(l=u,a=o,p=f-u,h=p)}}const{abs:he}=Math;function de(t,n,e){const r=he(n);let o=t[0],i=e[0];for(let c=1;c<t.length;c++){const s=o*n;o=s+t[c],i=i*r+he(s)+e[c]+he(o)}return[o,i]}function ge(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}const ve=Ut,me=Dn,{abs:xe}=Math;function be(t,n,e){const r=xe(n);let o=t[0],i=e[0];for(let c=1;c<t.length;c++){const s=me(n,o);o=ve(s,t[c]),i=i*r+xe(s[1])+e[c]+xe(o[1])}return[o,i]}const{abs:we,min:_e,max:Me,log2:Se,ceil:Ne}=Math,Ie=Fn/zn;function ye(t,n,e,r,o,i,c){const s=t.length-1;let u=0,f=1;for(;;){f*=2;for(let l=1;l<f;l+=2){u++;const a=o+(i-o)*(f+2*l)/(4*f),[p,h]=de(t,a,n);if(we(p)>h*zn)return[a,p];if(u>s)return Ee(e,r,o,i,c)}}}function Ee(t,n,e,r,o){const i=t.length-1;let c=0,s=1;for(;;){s*=2;for(let u=1;u<s;u+=2){c++;const f=e+(r-e)*(s+2*u)/(4*s),[l,a]=be(t,f,n);if(we(l[1])>a*Fn)return[f,l[1]];if(c>i)return Oe(o(),e,r)}}}function Oe(t,n,e){const r=t.length-1;let o=1;for(;;){o*=2;for(let i=1;i<o;i+=2){const c=n+(e-n)*(o+2*i)/(4*o),s=Pn(ce(t,c)),u=s[s.length-1];if(0!==u)return[c,u];if(0>r)throw new Error("Cannot resolve root even in Shewchuk expansion precision")}}}function Ce(t,n=-1/0,e=1/0,r,o,i=!1){let c;"number"==typeof t[0]&&(t=t.map(t=>[0,t]));const s=()=>void 0===o?t:(void 0===c&&(c=o()),c);if(r=r||new Array(t.length).fill(0),({pDd:t,pDd_:r,pExact:c}=function(t,n,e,r){let o;for(;t.length>0&&Tn(t[0][1])<=r*n[0]&&(o=o||e(),0===ct(o[0]));)(t=t.slice()).shift(),(n=n.slice()).shift(),o.shift();return{pDd:t,pDd_:n,pExact:o}}(t,r,s,Fn)),0===t.length)return;if(1===t.length)return[];const u=t.map(t=>t[0]+t[1]);return!i&&n!==-1/0&&e!==1/0||([n,e]=function(t,n,e){return[t=Cn(t,yn(e)),n=On(n,In(e))]}(n,e,u),n!==e)?function(t,n,e,r,o,i){const c=e.map((n,e)=>n*Ie+we(t[e])),s=r,u=o;let f,l,a,p,h=o-r;for(;[f,l]=de(t,r,c),!(we(f)>l*zn);)r-=h/2,h*=2;for(;[a,p]=de(t,o,c),!(we(a)>p*zn);)o+=h/2,h*=2;const d=[[r,o,f,a,0]],g=[],v=function(t,n,e,r,o){return function(i,c,s,u,f){let[l,a]=function(t,n,e){const r=t.length-1,o=Ln(n),i=t.slice(),c=e.slice();for(let t=0;t<=r;t++)for(let e=1;e<=r-t;e++){const t=n*i[e-1],r=o*c[e-1]+Ln(t);i[e]=i[e]+t,c[e]=c[e]+r+Ln(i[e])}return[i,c]}(t,i,n);!function(t,n,e){const r=t.length-1;if(r<0)return;let o=n,i=0;for(let c=1;c<=r;c++){const s=r-c,u=t[s],f=Xn(u),l=e[s],a=u*o;t[s]=a,e[s]=l*o+f*i+Xn(a);const p=o*n;i=i*n+p,o=p}}(l,c-i,a),l.reverse(),a.reverse(),function(t,n){const e=t.length-1;for(let r=0;r<=e;r++)for(let o=1;o<=e-r;o++){const e=t[o-1],r=n[o-1]+Ln(e);t[o]=t[o]+e,n[o]=n[o]+r+Ln(t[o])}}(l,a);let p=0,h=0,d=Un(s);for(let t=1;t<l.length-1;t++){let n=Un(l[t]);const e=l[t],r=a[t]*zn;Gn(e)<=r&&(h++,n=-d),n!==d&&(p++,d=n)}return Un(u)!==d&&p++,1===h&&1===p?1:h>0?function(t,n,e,r,o,i,c,s){let[u,f]=$n(t,e,n);(function(t,n,e){const r=t.length-1;if(r<0)return;let o=[0,n],i=0;for(let c=1;c<=r;c++){const s=r-c,u=t[s],f=Wn(u[1]),l=e[s],a=jn(o,u);t[s]=a,e[s]=l*o[1]+f*i+Wn(a[1]);const p=jn(o,[0,n]);i=i*n+p[1],o=p}})(u,r-e,f),u.reverse(),f.reverse(),[u,f]=$n(u,1,f);let l=0,a=0,p=Un(o);for(let t=0;t<u.length-1;t++){let n=Un(u[t][1]);const e=f[t]*Fn,r=u[t];e>=Gn(r[1])&&(a++,n=-p),n!==p&&(l++,p=n)}return Un(i)!==p&&l++,1===a&&1===l?1:0===a?l:c>1?function(t,n,e,r,o){let i=Qn(t(),n);i=Rn(i,e-n),i.reverse(),i=Qn(i,1);let c=0,s=Un(r);for(let t=1;t<i.length-1;t++){const n=i[t];let e=Un(n[n.length-1]);e!==s&&0!==e&&(c++,s=e)}return Un(o)!==s&&c++,c}(s,e,r,o,i):-l}(e,r,i,c,s,u,f,o):p}}(t,c,n,e,i);let m,x;for(;d.length>0;){const r=d.pop(),[o,s,u,f,l]=r,a=v(o,s,u,f,l);if(0===a)continue;if(1===a){m=m||e.map(t=>t*Fn),x=x||ge(n);const[t,r,c]=pe(x,m,o,s,u,f,i,!1);g.push({t:c,tS:t,tE:r,multiplicity:1});continue}let p=a<0?l+1:0;if(s-o<=2*we(a)*An*Me(1,2**Ne(Se(Me(we(o),we(s)))))){if(0===p){g.push({t:(o+s)/2,tS:o,tE:s,multiplicity:we(a)});continue}p=1/0}const[h,b]=ye(t,c,n,e,o,s,i);d.push([o,h,u,b,p]),d.push([h,s,b,f,p])}return g.reverse(),g.filter(t=>{const{tS:n,tE:e}=t;return!(e<s||n>u)})}(u,t,r,n,e,s):[{t:n,tS:n,tE:e,multiplicity:u.length-1}]}function Te(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],[c,s],[u,f]]=t,l=e+(o-e)*n,a=o+(c-o)*n,p=l+(a-l)*n,h=r+(i-r)*n,d=i+(s-i)*n,g=h+(d-h)*n;return[p+(a+(c+(u-c)*n-a)*n-p)*n,g+(d+(s+(f-s)*n-d)*n-g)*n]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=e+(o-e)*n,f=r+(i-r)*n;return[u+(o+(c-o)*n-u)*n,f+(i+(s-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 Pe=Math.abs;function Ae(t,n){if(0===n[0]&&0===n[1])return[0,0];if(0===n[0]&&1===n[1])return[0,0];const e=Pe(n[1]);if(4===t.length){const[[n,r],[o,i],[c,s],[u,f]]=t,l=Pe(n),a=Pe(r),p=Pe(o),h=Pe(i),d=Pe(c),g=Pe(s),v=l+(p+l)*e,m=p+(d+p)*e,x=v+(m+v)*e,b=a+(h+a)*e,w=h+(g+h)*e,_=b+(w+b)*e;return[x+(m+(d+(Pe(u)+d)*e+m)*e+x)*e,_+(w+(g+(Pe(f)+g)*e+w)*e+_)*e]}if(3===t.length){const[[n,r],[o,i],[c,s]]=t,u=Pe(n),f=Pe(r),l=Pe(o),a=Pe(i),p=u+(l+u)*e,h=f+(a+f)*e;return[p+(l+(Pe(c)+l)*e+p)*e,h+(a+(Pe(s)+a)*e+h)*e]}if(2===t.length){const[[n,r],[o,i]]=t,c=Pe(n),s=Pe(r);return[c+(Pe(o)+c)*e,s+(Pe(i)+s)*e]}if(1===t.length)return[0,0];throw new Error("The given bezier curve must be of order <= 3.")}Number.EPSILON;const ke=Number.EPSILON/2,Be=ke*ke,ze=(Fe(1),Ye(3));function Fe(t){const n=t*ke;return n/(1-n)}function Ye(t){const n=t*Be;return n/(1-n)}const Le=Math.abs,Xe=[[0,0],[0,0],[0,0],[0,0]];function He(t,n,e){return 0===n?1===e?{ps:t,_ps:Xe}:function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=d-n*(d-g),m=v-n*(v-(g-n*(g-(l-n*(l-p))))),x=s-n*(s-f),b=f-n*(f-a),w=x-n*(x-b),_=w-n*(w-(b-n*(b-(a-n*(a-h))))),M=Le(n),S=Le(c),N=Le(u),I=Le(l),y=Le(p),E=Le(s),O=Le(f),C=Le(a),T=S+M*(S+N),P=N+M*(N+I),A=T+M*(T+P),k=E+M*(E+O),B=O+M*(O+C),z=k+M*(k+B);return{ps:[[c,s],[d,x],[v,w],[m,_]],_ps:[[0,0],[T,k],[A,z],[A+M*(A+(P+M*(P+(I+M*(I+y))))),z+M*(z+(B+M*(B+(C+M*(C+Le(h))))))]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=c-n*(c-u),g=u-n*(u-l),v=l-n*(l-p),m=d-n*(d-g),x=g-n*(g-v),b=m-n*(m-x),w=s-n*(s-f),_=f-n*(f-a),M=a-n*(a-h),S=w-n*(w-_),N=_-n*(_-M),I=S-n*(S-N),y=Le(n),E=Le(c),O=Le(u),C=Le(l),T=Le(p),P=Le(s),A=Le(f),k=Le(a),B=E+y*(E+O),z=O+y*(O+C),F=C+y*(C+T),Y=B+y*(B+z),L=z+y*(z+F),X=P+y*(P+A),H=A+y*(A+k),D=k+y*(k+Le(h)),V=X+y*(X+H),$=H+y*(H+D);return{ps:[[b,I],[x,N],[v,M],[p,h]],_ps:[[Y+y*(Y+L),V+y*(V+$)],[L,$],[F,D],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=t[3],s=r[0],u=r[1],f=o[0],l=o[1],a=i[0],p=i[1],h=n*n,d=n*h,g=e*e,v=e*g,m=n*e,x=s-f,b=a-f,w=c[0]-s,_=x+b,M=n*x,S=e*x,N=w-3*b,I=u-l,y=p-l,E=c[1]-u,O=I+y,C=n*I,T=e*I,P=E-3*y,A=d*N+(3*n*(n*_-x)+s),k=m*(n*N+2*_)+(h*_+s-(S+2*M)),B=m*(e*N+2*_)+(g*_+s-(2*S+M)),z=v*N+(3*e*(e*_-x)+s),F=d*P+(3*n*(n*O-I)+u),Y=m*(n*P+2*O)+(h*O+u-(T+2*C)),L=m*(e*P+2*O)+(g*O+u-(2*T+C)),X=v*P+(3*e*(e*O-I)+u),H=Le(n),D=Le(e),V=Le(m),$=Le(d),q=Le(v),j=Le(s),W=Le(f),Q=j+W,R=Le(a)+W,G=Q+R,U=H*Q,Z=D*Q,J=Le(w)+3*R,K=Le(u),tt=Le(l),nt=K+tt,et=Le(p)+tt,rt=nt+et,ot=H*nt,it=D*nt,ct=Le(E)+3*et;return{ps:[[A,F],[k,Y],[B,L],[z,X]],_ps:[[$*J+(3*H*(H*G+Q)+j),$*ct+(3*H*(H*rt+nt)+K)],[V*(H*J+2*G)+(h*G+j+(Z+2*U)),V*(H*ct+2*rt)+(h*rt+K+(it+2*ot))],[V*(D*J+2*G)+(g*G+j+(2*Z+U)),V*(D*ct+2*rt)+(g*rt+K+(2*it+ot))],[q*J+(3*D*(D*G+Q)+j),q*ct+(3*D*(D*rt+nt)+K)]]}}(t,n,e)}const De=Math.abs,Ve=[[0,0],[0,0],[0,0]];function $e(t,n,e){return 0===n?1===e?{ps:t,_ps:Ve}:function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=c-u,d=[[i,c],[-n*p+i,-n*h+c],[a*(p+(f-s))-(2*n*p-i),a*(h+(l-u))-(2*n*h-c)]],g=De(n),v=De(i),m=De(s),x=De(f),b=v+m,w=De(c),_=De(u),M=w+_;return{ps:d,_ps:[[0,0],[g*b+v,g*M+w],[a*(b+(x+m))+(2*g*b+v),a*(M+(De(l)+_))+(2*g*M+w)]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n*n,p=i-s,h=f-s,d=c-u,g=l-u,v=[[a*(p+h)-(2*n*p-i),a*(d+g)-(2*n*d-c)],[n*h+s,n*g+u],[f,l]],m=De(n),x=De(i),b=De(s),w=x+b,_=De(f)+b,M=De(c),S=De(u),N=M+S;return{ps:v,_ps:[[a*(w+_)+(2*m*w+x),a*(N+(De(l)+S))+(2*m*N+M)],[m*_+b,0],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=i[0],a=i[1],p=n*n,h=e*e,d=n*e,g=c-u,v=g+(l-u),m=s-f,x=m+(a-f),b=p*v-(2*n*g-c),w=d*v-(g*(e+n)-c),_=h*v-(2*e*g-c),M=p*x-(2*n*m-s),S=d*x-(m*(e+n)-s),N=h*x-(2*e*m-s),I=De(n),y=De(e),E=De(d),O=De(c),C=De(u),T=O+C,P=T+De(l)+C,A=De(s),k=De(f),B=A+k,z=B+De(a)+k;return{ps:[[b,M],[w,S],[_,N]],_ps:[[p*P+(2*I*T+O),p*z+(2*I*B+A)],[E*P+(T*(y+I)+O),E*x+(B*(y+I)+A)],[h*P+(2*y*T+O),h*z+(2*y*B+A)]]}}(t,n,e)}const qe=Math.abs,je=[[0,0],[0,0]];const We=Number.EPSILON/2,Qe=Fe(1);function Re(t,n){return n[0]!==n[1]?4===t.length?function(t,n){const{ps:e,_ps:r}=He(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=e[3][0],u=9*We*r[0][0],f=9*We*r[1][0],l=9*We*r[2][0],a=9*We*r[3][0],p=e[0][1],h=e[1][1],d=e[2][1],g=e[3][1],v=9*We*r[0][1],m=9*We*r[1][1],x=9*We*r[2][1],b=9*We*r[3][1],w=Math.min(o-u,i-f,c-l,s-a),_=Math.max(o+u,i+f,c+l,s+a);return[[w,Math.min(p-v,h-m,d-x,g-b)],[_,Math.max(p+v,h+m,d+x,g+b)]]}(t,n):3===t.length?function(t,n){const{ps:e,_ps:r}=$e(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=5*We*r[0][0],u=5*We*r[1][0],f=5*We*r[2][0],l=e[0][1],a=e[1][1],p=e[2][1],h=5*We*r[0][1],d=5*We*r[1][1],g=5*We*r[2][1],v=Math.min(o-s,i-u,c-f),m=Math.max(o+s,i+u,c+f);return[[v,Math.min(l-h,a-d,p-g)],[m,Math.max(l+h,a+d,p+g)]]}(t,n):function(t,n){const{ps:e,_ps:r}=function(t,n,e){return 0===n?1===e?{ps:t,_ps:je}:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[o,i],[n*(c-o)+o,n*(s-i)+i]],f=qe(n),l=qe(o),a=qe(c),p=qe(i);return{ps:u,_ps:[[0,0],[f*(a+l)+l,f*(qe(s)+p)+p]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[n*(c-o)+o,n*(s-i)+i],[c,s]],f=qe(n),l=qe(o),a=qe(c),p=qe(i);return{ps:u,_ps:[[f*(a+l)+l,f*(qe(s)+p)+p],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1],f=[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]],l=qe(n),a=qe(e),p=qe(i),h=qe(s),d=qe(c),g=qe(u);return{ps:f,_ps:[[l*(h+p)+p,l*(g+d)+d],[a*(h+p)+p,a*(g+d)+d]]}}(t,n,e)}(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=3*We*r[0][0],s=3*We*r[1][0],u=e[0][1],f=e[1][1],l=3*We*r[0][1],a=3*We*r[1][1],p=Math.min(o-c,i-s),h=Math.max(o+c,i+s);return[[p,Math.min(u-l,f-a)],[h,Math.max(u+l,f+a)]]}(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=Te(t,n);let i;if(4===t.length)i=Ae(t,[0,n]).map(t=>8*Qe*t);else if(3===t.length)i=Ae(t,[0,n]).map(t=>5*Qe*t);else if(2===t.length)i=Ae(t,[0,n]).map(t=>2*Qe*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 Ge(t){const n=t[0],e=t[1];return[(n[0]+e[0])/2,(n[1]+e[1])/2]}const Ue=Z,Ze=Number.EPSILON;function Je(t,n){const e=t-n,r=t-e;return[t-(e+r)+(r-n),e]}function Ke(t){return[2*t[0],2*t[1]]}function tr(t){return[4*t[0],4*t[1]]}const nr=Je,er=Ut,rr=Dn,or=jn,ir=Ke,cr=tr,sr=Zt;function ur(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,g]=n,v=nr(c,d),m=nr(u,d),x=nr(l,d),b=nr(p,d),w=nr(s,g),_=nr(f,g),M=nr(a,g),S=nr(h,g),N=or(v,v),I=rr(6,or(v,m)),y=rr(6,or(v,x)),E=ir(or(v,b)),O=rr(9,or(m,m)),C=rr(18,or(m,x)),T=rr(6,or(m,b)),P=rr(9,or(x,x)),A=rr(6,or(x,b)),k=or(b,b),B=or(w,w),z=rr(6,or(w,_)),F=rr(6,or(w,M)),Y=ir(or(w,S)),L=rr(9,or(_,_)),X=rr(18,or(_,M)),H=rr(6,or(_,S)),D=rr(9,or(M,M)),V=rr(6,or(M,S)),$=or(S,S),q=er(T,P),j=er(E,C),W=er(y,O),Q=er(H,D),R=er(Y,X),G=er(F,L);return[rr(6,er(er(er(er(sr(k,A),sr(N,I)),q),sr(W,j)),er(er(er(sr($,V),sr(B,z)),Q),sr(G,R)))),rr(5,er(sr(er(er(A,rr(5,I)),rr(3,j)),ir(er(er(q,ir(W)),rr(3,N)))),sr(er(er(V,rr(5,z)),rr(3,R)),ir(er(er(Q,ir(G)),rr(3,B)))))),cr(er(sr(sr(q,rr(3,sr(j,ir(W)))),rr(5,sr(ir(I),rr(3,N)))),sr(sr(Q,rr(3,sr(R,ir(G)))),rr(5,sr(ir(z),rr(3,B)))))),rr(3,er(sr(j,ir(sr(ir(W),rr(5,sr(I,ir(N)))))),sr(R,ir(sr(ir(G),rr(5,sr(z,ir(B)))))))),ir(er(sr(W,rr(5,sr(I,rr(3,N)))),sr(G,rr(5,sr(z,rr(3,B)))))),er(sr(I,rr(6,N)),sr(z,rr(6,B)))]}const fr=Je,lr=Ut,ar=Dn,pr=jn,hr=Ke,dr=Zt,gr=tr;function vr(t,n){const[[e,r],[o,i],[c,s]]=t,[u,f]=n,l=fr(e,u),a=fr(o,u),p=fr(c,u),h=fr(r,f),d=fr(i,f),g=fr(s,f),v=pr(l,l),m=pr(l,a),x=pr(l,p),b=pr(a,a),w=pr(a,p),_=pr(p,p),M=pr(h,h),S=pr(h,d),N=pr(h,g),I=pr(d,d),y=pr(d,g),E=pr(g,g),O=lr(N,hr(I)),C=lr(x,hr(b));return[lr(dr(lr(lr(E,M),hr(O)),gr(lr(y,S))),dr(lr(lr(_,v),hr(C)),gr(lr(w,m)))),ar(3,lr(lr(dr(y,O),dr(ar(3,S),M)),lr(dr(w,C),dr(ar(3,m),v)))),lr(dr(O,ar(3,dr(hr(S),M))),dr(C,ar(3,dr(hr(m),v)))),lr(dr(S,M),dr(m,v))]}function mr(t){return[-2*t[0],-2*t[1]]}const xr=Gt,br=Ut,wr=mr;function _r(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=e-c,f=o-c,l=r-s,a=i-s,p=xr(u,u),h=xr(u,f),d=xr(f,f),g=xr(l,l),v=xr(l,a),m=xr(a,a),x=br(h,v),b=br(g,p);return[br(br(d,m),br(b,wr(x))),Zt(x,b)]}function Mr(t){const n=[];for(let e=0;e<t.length;e++)n.push(2*t[e]);return n}function Sr(t){const n=[];for(let e=0;e<t.length;e++)n.push(-2*t[e]);return n}const Nr=Z,Ir=nt,yr=Mr,Er=Sr,Or=Z,Cr=nt,Tr=Mr;function Pr(t){const n=[];for(let e=0;e<t.length;e++)n.push(4*t[e]);return n}const Ar=Z,kr=Sr,Br=Math.abs;function zr(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=Br(e[0]),s=Br(e[1]),u=Br(r[0]),f=Br(r[1]),l=Br(o[0]),a=Br(o[1]),p=Br(i[0]),h=Br(i[1]),d=Br(n[0]),g=Br(n[1]),v=c+d,m=u+d,x=l+d,b=p+d,w=s+g,_=f+g,M=a+g,S=h+g,N=v*v,I=6*v*m,y=6*x*b,E=w*w,O=6*w*_,C=6*M*S,T=6*m*b+9*x*x,P=2*v*b+18*m*x,A=6*v*x+9*m*m,k=6*_*S+9*M*M,B=2*w*S+18*_*M,z=6*w*M+9*_*_;return[6*(b*b+y+(N+I)+T+(A+P)+(S*S+C+(E+O)+k+(z+B))),5*(y+5*I+3*P+2*(T+2*A+3*N)+(C+5*O+3*B+2*(k+2*z+3*E))),4*(T+3*(P+2*A)+5*(2*I+3*N)+(k+3*(B+2*z)+5*(2*O+3*E))),3*(P+2*(2*A+5*(I+2*N))+(B+2*(2*z+5*(O+2*E)))),2*(A+5*(I+3*N)+(z+5*(O+3*E))),I+6*N+(O+6*E)]}function Fr(t,n){const e=t[0],r=t[1],o=t[2],i=Br(e[0]),c=Br(e[1]),s=Br(r[0]),u=Br(r[1]),f=Br(o[0]),l=Br(o[1]),a=Br(n[0]),p=Br(n[1]),h=i+a,d=s+a,g=f+a,v=c+p,m=u+p,x=l+p,b=h*h,w=h*d,_=d*g,M=v*v,S=v*m,N=m*x,I=v*x+m*m*2,y=h*g+d*d*2;return[x*x+M+2*I+4*(N+S)+(g*g+b+2*y+4*(_+w)),3*(N+I+(3*S+M)+(_+y+(3*w+b))),I+3*(2*S+M)+(y+3*(2*w+b)),S+M+(w+b)]}function Yr(t,n){const e=t[0],r=t[1],o=Br(e[0]),i=Br(e[1]),c=Br(r[0]),s=Br(r[1]),u=Br(n[0]),f=Br(n[1]),l=o+u,a=c+u,p=i+f,h=s+f,d=l*a+p*h,g=p*p+l*l;return[a*a+h*h+2*d+g,d+g]}Ye(6);const{sqrt:Lr}=Math;function Xr(t,n,e=0,r=1){const{polyDd:o,polyE:i,getPolyExact:c}=function(t,n){const e=t.length-1;if(3===e)return{polyDd:ur(t,n),polyE:zr(t,n).map(t=>20*t),getPolyExact:()=>function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,g]=n,v=Nr(c,d),m=Nr(u,d),x=Nr(l,d),b=Nr(p,d),w=Nr(s,g),_=Nr(f,g),M=Nr(a,g),S=Nr(h,g),N=et(v,v),I=Ir(6,et(v,m)),y=Ir(6,et(v,x)),E=yr(et(v,b)),O=Ir(9,et(m,m)),C=Ir(18,et(m,x)),T=Ir(6,et(m,b)),P=Ir(9,et(x,x)),A=Ir(6,et(x,b)),k=et(b,b),B=et(w,w),z=Ir(6,et(w,_)),F=Ir(6,et(w,M)),Y=yr(et(w,S)),L=Ir(9,et(_,_)),X=Ir(18,et(_,M)),H=Ir(6,et(_,S)),D=Ir(9,et(M,M)),V=Ir(6,et(M,S)),$=et(S,S),q=J(T,P),j=J(E,C),W=J(y,O),Q=J(H,D),R=J(Y,X),G=J(F,L),U=it(J(J(k,N),J(q,W)),J(J(j,A),I)),Z=it(J(J($,B),J(Q,G)),J(J(R,V),z)),K=Ir(6,J(U,Z)),tt=J(Er(J(J(q,yr(W)),Ir(3,N))),J(J(A,Ir(3,j)),Ir(5,I))),nt=J(Er(J(J(Q,yr(G)),Ir(3,B))),J(J(V,Ir(3,R)),Ir(5,z))),rt=Ir(5,J(tt,nt)),ot=J(J(q,Ir(3,it(yr(W),j))),Ir(5,it(Ir(3,N),yr(I)))),ct=J(J(Q,Ir(3,it(yr(G),R))),Ir(5,it(Ir(3,B),yr(z)))),st=Ir(4,J(ot,ct)),ut=it(j,yr(it(yr(W),Ir(5,it(I,yr(N)))))),ft=it(R,yr(it(yr(G),Ir(5,it(z,yr(B)))))),lt=Ir(3,J(ut,ft)),at=it(W,Ir(5,it(I,Ir(3,N)))),pt=it(G,Ir(5,it(z,Ir(3,B))));return[K,rt,st,lt,yr(J(at,pt)),J(it(I,Ir(6,N)),it(z,Ir(6,B)))].map(Pn)}(t,n)};if(2===e)return{polyDd:vr(t,n),polyE:Fr(t,n).map(t=>16*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i],[c,s]]=t,[u,f]=n,l=Or(e,u),a=Or(o,u),p=Or(c,u),h=Or(r,f),d=Or(i,f),g=Or(s,f),v=et(l,l),m=et(l,a),x=et(l,p),b=et(a,a),w=et(a,p),_=et(p,p),M=et(h,h),S=et(h,d),N=et(h,g),I=et(d,d),y=et(d,g),E=et(g,g),O=J(N,Tr(I)),C=J(x,Tr(b)),T=J(it(J(_,Tr(C)),Pr(J(w,m))),v),P=J(it(J(E,Tr(O)),Pr(J(y,S))),M),A=J(T,P),k=J(it(w,C),it(Cr(3,m),v)),B=J(it(y,O),it(Cr(3,S),M));return[A,Cr(3,J(k,B)),J(it(O,Cr(3,it(Tr(S),M))),it(C,Cr(3,it(Tr(m),v)))),J(it(S,M),it(m,v))].map(Pn)}(t,n)};if(1===e)return{polyDd:_r(t,n),polyE:Yr(t,n).map(t=>12*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=Ar(e,c),f=Ar(o,c),l=Ar(r,s),a=Ar(i,s),p=et(u,u),h=et(u,f),d=et(f,f),g=et(l,l),v=et(l,a),m=et(a,a),x=J(h,v),b=J(g,p);return[J(J(d,m),J(kr(x),b)),it(x,b)].map(Pn)}(t,n)};if(0===e)return{polyDd:[[0,1]],polyE:[0],getPolyExact:()=>[[1]]};throw new Error("The given bezier curve must be of order 1, 2 or 3")}(t,n),s=Ce(o,e,r,i,c)||[];s.push({t:e,tS:e,tE:e,multiplicity:1}),s.push({t:r,tS:r,tE:r,multiplicity:1});const u=s.map(e=>{const r=Re(t,[e.tS,e.tE]),o=function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=n[0],f=n[1];let l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(const[t,n]of[[o,i],[o,s],[c,i],[c,s]]){const e=Ue(t,u),r=Ue(n,f),o=rt(J(et(e,e),et(r,r))),i=o*(1-Ze),c=o*(1+Ze);i<=l&&(l=i),c>=a&&(a=c)}return[l,a]}(r,n);return{p:Ge(r),t:e.t,d:(Lr(o[0])+Lr(o[1]))/2,dSquaredI:o,box:r,ri:e}});let f=Number.POSITIVE_INFINITY;for(let t=0;t<u.length;t++){const n=u[t].dSquaredI[1];n<f&&(f=n)}const l=[];for(let t=0;t<u.length;t++){const n=u[t];n.dSquaredI[0]<=f&&l.push(n)}return l}function Hr(t){return(t.tS+t.tE)/2}function Dr(t){const n=t.xs;if(4===n.length){let t=0,e=0;for(let r=0;r<n.length;r++)0===n[r].x.kind&&t++,4===n[r].x.kind&&e++;if(2===t&&2===e)return!0}return n.length<=2&&7!==n[0].x.kind}function Vr(t){const n=(t=Pn(t)).length;return 2===n?t:n<=1?[0,t[0]]:[t[n-2],t[n-1]]}const{abs:$r,min:qr,max:jr,log2:Wr,ceil:Qr}=Math;function Rr(t,n){const{tS:e,tE:r}=t,o=r-e;if(0===o)return[{tS:[0,e],tE:[0,e],multiplicity:t.multiplicity}];const i=2**Qr(Wr(o)),c=function(t,n,e){return Rn(Qn(t,e),n)}(n,i,e),s=c.map(Vr),u=s.map(t=>t[1]*An**2),f=Ce(s,0,1,u,()=>c),l=[];for(const t of f)l.push({tS:lt(e,t.tS*i),tE:lt(e,t.tE*i),multiplicity:t.multiplicity});return l}function Gr(t,n){return ct(it(t,n))}const{abs:Ur}=Math;function Zr(t,n){const e=t.inOuts;e.sort(function(t){return(n,e)=>{let r=n.side-e.side;if(0!==r)return r;const o=n.sideX,i=e.sideX;r=o.ri.tS-i.ri.tS;const c=8*Number.EPSILON;return Ur(r)>=c?r:(o.compensated||(o.compensated=1,o.riExp=Rr(o.ri,o.getPExact())[0]),i.compensated||(i.compensated=1,i.riExp=Rr(i.ri,i.getPExact())[0]),r=Gr(o.riExp.tS,i.riExp.tS),0!==r?r:(r=n.dir-e.dir,0!==r?t*r:1===n.dir?n.idx-e.idx:e.idx-n.idx))}}(n));let r=e[e.length-1];for(let t=0;t<e.length;t++){const n=e[t];n.prevAround=r,r.nextAround=n,r=n}}function Jr(t,n,e,r){const o=function(t,n){return(e,r,o)=>{t.has(e)||(e.orientation=r,e.parent=o,e.windingNum=o.windingNum+e.orientation,n.push(e))}}(r,e);Zr(t.container,n.orientation);let i,c,s=1,u=t,f=n.orientation;for(;u=1===n.orientation?u.nextAround:u.prevAround,u!==t;){const t=s;s-=u.dir,1===s&&(f*=-1),-1!==u.dir&&(i?1===t&&0===s?o(u,n.orientation,n.parent):0===t&&-1===s&&o(u,-n.orientation,n.parent):0===s?i=u:1===s&&o(u,n.orientation,n))}return Dr(t.container)||(c=[t.p,i.p]),{inOutToUse:i,additionalBezier:c}}function Kr(t,n){const e=t._x_,r=n._x_,o=e.curve,i=e.x.ri.tS,c=r.curve,s=r.x.ri.tS;let u=o,f=i;Dr(t.container)||(f=Hr(Xr(o.ps,t.p)[0].ri));const l=[];for(;;){if(u===c&&(f<s||f===s&&0!==l.length)){const t=u.ps,n=[f,s];return l.push({ps:t,ts:n}),l}{const t=u.ps,n=[f,1];l.push({ps:t,ts:n})}f=0,u=u.next}}function to(t,n){const e=n._x_,r=t._x_,o=r.curve,i=r.x.ri.tS,c=e.curve,s=e.x.ri.tS;let u=o,f=i;Dr(t.container)||(f=Hr(Xr(u.ps,t.p)[0].ri));const l=[];for(;;){const t=u.ps;if(u===c&&(f>s||f===s&&0!==l.length)){const n=[f,s];return l.push({ps:t,ts:n}),l}{const n=[f,0];l.push({ps:t,ts:n})}f=1,u=u.prev}}function no(t,n,e,r){const o=function(t,n,e){return(r,o,i,c)=>{n.has(r)||1!==r.dir||(r.loopsIdxs=new Set(c),r.orientation=o*t.orientation,r.parent=i.parent,r.windingNum=i.windingNum+r.orientation,e.unshift(r))}}(n,r,e);Zr(t.container,1);let i=t.nextAround,c=t;const s=[],u=new Set(n.loopsIdxs);for(;c=c.nextAround,c!==t;)o(c,n.dir,n,u),s.push(c.idx),-1===c.dir?u?.add(c._x_?.curve.loop.idx):u.delete(c._x_?.curve.loop.idx);let f;return Dr(t.container)||(f=[t.p,i.p]),{inOutToUse:i,additionalBezier:f}}function eo(t){const{ps:n,ts:e}=t;return function(t,n,e){if(4===t.length)return 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],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=p-n*(p-h),g=s-n*(s-f),v=f-n*(f-a),m=g-n*(g-v);return[e,[p,g],[d,m],[d-n*(d-(h-n*(h-(l-n*(l-i[0]))))),m-n*(m-(v-n*(v-(a-n*(a-i[1])))))]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=c-n*(c-u),h=u-n*(u-l),d=l-n*(l-i[0]),g=p-n*(p-h),v=h-n*(h-d),m=s-n*(s-f),x=f-n*(f-a),b=a-n*(a-i[1]),w=m-n*(m-x),_=x-n*(x-b);return[[g-n*(g-v),w-n*(w-_)],[v,_],[d,b],i]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=t[3],s=r[0],u=r[1],f=o[0],l=o[1],a=i[0],p=i[1],h=n*n,d=n*h,g=e*e,v=e*g,m=n*e,x=s-f,b=a-f,w=x+b,_=n*x,M=e*x,S=c[0]-s-3*b,N=u-l,I=p-l,y=N+I,E=n*N,O=e*N,C=c[1]-u-3*I;return[[d*S+(3*n*(n*w-x)+s),d*C+(3*n*(n*y-N)+u)],[m*(n*S+2*w)+(h*w+s-(M+2*_)),m*(n*C+2*y)+(h*y+u-(O+2*E))],[m*(e*S+2*w)+(g*w+s-(2*M+_)),m*(e*C+2*y)+(g*y+u-(2*O+E))],[v*S+(3*e*(e*w-x)+s),v*C+(3*e*(e*y-N)+u)]]}(t,n,e)}(t,n,e);if(3===t.length)return 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],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=c-u;return[e,[-n*l+i,-n*a+c],[f*(l+(o[0]-s))-(2*n*l-i),f*(a+(o[1]-u))-(2*n*a-c)]]}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=n*n,l=i-s,a=o[0]-s,p=c-u,h=o[1]-u;return[[f*(l+a)-(2*n*l-i),f*(p+h)-(2*n*p-c)],[n*a+s,n*h+u],o]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=t[2],c=r[0],s=r[1],u=o[0],f=o[1],l=n*n,a=e*e,p=n*e,h=c-u,d=h+(i[0]-u),g=s-f,v=g+(i[1]-f);return[[l*d-(2*n*h-c),l*v-(2*n*g-s)],[p*d-(h*(e+n)-c),p*v-(g*(e+n)-s)],[a*d-(2*e*h-c),a*v-(2*e*g-s)]]}(t,n,e)}(t,n,e);if(2===t.length)return 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[e,[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];return[[n*(r[0]-o)+o,n*(r[1]-i)+i],r]}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1];return[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]]}(t,n,e)}(t,n,e);if(1===t.length)return t;throw new Error("The given bezier curve must be of order <= 3.")}(n,e[0],e[1])}function ro(t,n,e){const r=[],o=[];let i,c=n;const s=e?no:Jr,u=[];do{t.add(c),u.push(c);const e=c.nextOrPrev;t.add(e);const f=1===c.dir?Kr(c,e):to(c,e);o.push(...f);const l=s(e,n,r,t);if(({inOutToUse:c,additionalBezier:i}=l),void 0!==i){const t=eo(o[o.length-1]),n={ps:t,ts:[0,Hr(Xr(t,i[0])[0].ri)]};o.pop(),o.push(n),o.push({ps:i,ts:[0,1]})}}while(c!==n);return"undefined"!=typeof _debug_&&_debug_.verbose&&function(t){const n=[],e=[];for(let r of t)e.push(1===r.dir?"color: blue;":"color: red"),n.push(`%c${r.idx}`)}(u),{bezierPieces:o,additionalOutsToCheck:r}}function oo(t,n,e,r){const o=[t];for(;o.length;){const t=o.pop();if(n.add(t._x_.curve.loop),e.has(t))continue;t.children=new Set;const{bezierPieces:i,additionalOutsToCheck:c}=ro(e,t,r);t.bezierPieces=i,t.parent.children=t.parent.children||new Set,t.parent.children.add(t);for(let t=0;t<c.length;t++)o.push(c[t])}}function io(t){if(4===t.length)return co(t);if(3===t.length)return so(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 co(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[s-n+3*(r-i),3*(i+n-2*r),3*(r-n),n],[u-e+3*(o-c),3*(c+e-2*o),3*(o-e),e]]}function so(t){const[[n,e],[r,o],[i,c]]=t;return[[i+n-2*r,2*(r-n),n],[c+e-2*o,2*(o-e),e]]}function uo(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[3*(s-n+3*(r-i)),6*(i+n-2*r),3*(r-n)],[3*(u-e+3*(o-c)),6*(c+e-2*o),3*(o-e)]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,c]]=t;return[[2*(i+n-2*r),2*(r-n)],[2*(c+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 fo(t,n){const[e,r]=uo(t);return[R(e,n),R(r,n)]}function lo(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]=uo(t),c=Ce(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=Re(t,i);s[0][1]<r.box[0][1]&&(r={ts:i,box:s}),s[1][1]>o.box[0][1]&&(o={ts:i,box:s})}return{minY:r,maxY:o}}function ao(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]=uo(t),c=Ce(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=Re(t,i);s[0][0]<r.box[0][0]&&(r={ts:i,box:s}),s[1][0]>o.box[0][0]&&(o={ts:i,box:s})}return{minX:r,maxX:o}}(t),e=lo(t);return[[n.minX.box[0][0],e.minY.box[0][1]],[n.maxX.box[1][0],e.maxY.box[1][1]]]}const po=L(ao),ho=L(function(t){const n=uo(t),e=Ce(n[0],0,1)?.map(t=>t.t)||[],r=Ce(n[1],0,1)?.map(t=>t.t)||[];e.push(0,1),r.push(0,1);let o,i,c,s,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(let n=0;n<e.length;n++){const r=e[n],[c]=Te(t,r);c<u&&(u=c,o=r),c>f&&(f=c,i=r)}for(let n=0;n<r.length;n++){const e=r[n],[,o]=Te(t,e);o<l&&(l=o,c=e),o>a&&(a=o,s=e)}return{ts:[[o,c],[i,s]],box:[[u,l],[f,a]]}}),{min:go,max:vo}=Math;function mo(t){const n=t.map(ho);return{minX:go(...n.map(t=>t.box[0][0])),maxX:vo(...n.map(t=>t.box[1][0])),minY:go(...n.map(t=>t.box[0][1])),maxY:vo(...n.map(t=>t.box[1][1]))}}const xo=new Function("try {return this===window;}catch(e){ return false;}")()?function(t){const n=window.atob(t),e=n.length,r=new Uint8Array(e);for(let t=0;t<e;t++)r[t]=n.charCodeAt(t);return r.buffer}:function(t){return function(t){const n=new ArrayBuffer(t.length),e=new Uint8Array(n);for(let n=0;n<t.length;++n)e[n]=t[n];return n}(Buffer.from(t,"base64"))},bo=xo("AGFzbQEAAAABBgFgAX8BfAMDAgAABQMBAAAHHwMGbWVtb3J5AgAHc3F1YXJlcwAACHNxdWFyZXM0AAEKjgECPwECfiAArULHuuXf9tjQm2p+IgEgASABfnxCIIoiAiACfiABQse65d/22NCbanx8QiCKIgIgAn4gAXxCIIi6C0wBAn4gAK1Cx7rl3/bY0JtqfiIBQse65d/22NCbanwiAiABIAIgASABIAF+fEIgiiIBIAF+fEIgiiIBIAF+fEIgiiIBIAF+fEIgiLoL"),wo=new WebAssembly.Module(bo),_o=new WebAssembly.Instance(wo),Mo=_o.exports.squares;_o.exports.squares4;const So=1e-6;function No(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;do{e++;const o=Mo(e)/4294967296,i=r(t,n,Te(t[Mo(e+1e3)%t.length],o));if(void 0!==i)return i}while(e<100);return;function r(t,n,e){if(function(t,n){const e=mo(t),r=mo(n);return e.minX<r.minX||e.maxX>r.maxX||e.minY<r.minY||e.maxY>r.maxY}(t,n))return!1;const r=function(t,n){const[e,r]=n;let o=0;for(let i=0;i<t.length;i++){const c=t[i],[[s,u],[f,l]]=po(c);let a=u>r||l<r||!1;if(a=a||s>e||!1,a)continue;const p=[];let h,d,g;const v=!0;h=t=>io(t)[1],d=[0,-r],g=0;const m=c.map(j(d)),x=h(m),b=Ce(x,0-So,1+So)?.map(t=>t.t)||[];for(let t=0;t<b.length;t++){const e=b[t];if(Math.abs(e)<So||Math.abs(e-1)<So)return;const r=Te(m,e);(v&&n[g]>=r[g]||!v&&n[g]<=r[g])&&p.push(e)}if(1===p.length||3===p.length)for(const t of p){const n=W(fo(c,t));if(Math.abs(n[1])<So)return}o+=p.length}return o}(n,e);return void 0!==r?r%2!=0:void 0}}(n.beziers,o.bezierPieces.map(eo))){e=o;for(const t of o.children)r.push(t)}}}function Io(t,n){return yo(t)-yo(n)}function yo(t){let n=Number.POSITIVE_INFINITY;for(const e of t){const t=ho(e).box[0][1];t<n&&(n=t)}return n}const{abs:Eo,sign:Oo}=Math;function Co(t){let n=t.parent;for(;;){if(void 0===n)return!1;if(n.used)return!0;n=n.parent}}function To(t,n,e){let[[r,o],[i,c]]=n,[[s,u],[f,l]]=e;o>c&&([o,c]=[c,o]),u>l&&([u,l]=[l,u]),r>i&&([r,i]=[i,r]),s>f&&([s,f]=[f,s]);const a=t||r===i&&s===f,p=t||o===c&&u===l;return(a?r<=f:r<f)&&(a?i>=s:i>s)&&(p?u<=c:u<c)&&(p?l>=o:l>o)}function Po(t,n){return To(!0,t.box,n.box)}function Ao(t,n){for(let e=0;e<n.length;e++){const r=n[e];ko(t,[r.a,r.b])}}function ko(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 Bo(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)||Bo(t,i,e,r)}}function zo(t){const n=[],e=new Set;for(const r of t){const o=r[0];e.has(o)||(n.push([]),Bo(t,o,e,n[n.length-1]))}return n}function Fo(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 Yo(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 c=[];for(const n of e){const[[e,s],[u,f]]=n.box;e<t&&(t=e),s<r&&(r=s),u>o&&(o=u),f>i&&(i=f),c.push(...n.xs)}const s={box:[[t,r],[o,i]],xs:c,inOuts:void 0};n.push(s)}return n}function Lo(t){return{tS:[0,t.tS],tE:[0,t.tE],multiplicity:t.multiplicity}}function Xo(t,n){const e=t[0],r=t[1],o=r+n,i=o-r,c=e+(r-(o-i)+(n-i)),s=o+c;return[c-(s-o),s]}const Ho=Je,Do=Dn,Vo=Ut,$o=Xo,qo=Math.abs;function jo(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=Ho(s,n),l=Ho(r,i),a=3*(r-i),p=Do(3,l),h=qo(a),d=Vo(f,p),g=h+qo(s-n+a),v=Ho(i,2*r),m=$o(v,n),x=qo(i-2*r+n),b=Do(3,m),w=6*x,_=Ho(r,n),M=Do(3,_),S=qo(3*(r-n)),N=Ho(u,e),I=Ho(o,c),y=3*(o-c),E=Do(3,I),O=qo(y),C=Vo(N,E),T=O+qo(u-e+y),P=Ho(c,2*o),A=$o(P,e),k=qo(c-2*o+e),B=Do(3,A),z=6*k,F=Ho(o,e);return{coeffs:[[d,b,M,[0,n]],[C,B,Do(3,F),[0,e]]],errorBound:[[g,w,S,0],[T,z,qo(3*(o-e)),0]]}}function Wo(t){const[[n,e],[r,o],[i,c]]=t,s=i-2*r,u=Ho(i,2*r),f=$o(u,n),l=qo(s+n),a=Ho(2*r,2*n),p=c-2*o,h=Ho(c,2*o),d=$o(h,e),g=qo(p+e);return{coeffs:[[f,a,[0,n]],[d,Ho(2*o,2*e),[0,e]]],errorBound:[[l,0,0],[g,0,0]]}}function Qo(t){const[[n,e],[r,o]]=t;return[[Ho(r,n),[0,n]],[Ho(o,e),[0,e]]]}const Ro=Zt,Go=Dn,Uo=ot,Zo=Math.abs;function Jo(t){const[[n,[,e]],[r,[,o]]]=Qo(t),i=Uo(r),c=n,s=Go(o,n),u=Zo(s[1]),f=Go(e,r),l=Zo(f[1]),a=Ro(f,s);return{coeffs:{vₓ:i,vᵧ:c,v:a},errorBound:{v_:u+l+Zo(a[1])}}}const{abs:Ko}=Math,ti=Ut,ni=Dn,ei=jn;function ri(t){return[-t[0],-t[1]]}const oi=ri,ii=Ke,ci=Dn,si=jn,ui=Zt,fi=Math.abs;function li(t){const{coeffs:[[n,e,[,r]],[o,i,[,c]]],errorBound:[[s],[u]]}=Wo(t),f=n[1],l=e[1],a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ier curve must be of order <= cubic.")}function dc(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[J(fc(s,n),ac(3,fc(r,i))),ac(3,pc(lc(i,n),-2*r)),ac(3,fc(r,n)),[n]].map(Pn),[J(fc(u,e),ac(3,fc(o,c))),ac(3,pc(lc(c,e),-2*o)),ac(3,fc(o,e)),[e]].map(Pn)]}function gc(t){const[[n,e],[r,o],[i,c]]=t;return[[pc(lc(i,n),-2*r),fc(2*r,2*n),[n]],[pc(lc(c,e),-2*o),fc(2*o,2*e),[e]]]}function vc(t){const[[n,e],[r,o]]=t;return[[fc(r,n),[n]],[fc(o,e),[e]]]}const mc=nt,xc=ot;function bc(t){const[[n,[e]],[r,[o]]]=t;if(0!==ct(n)||0!==ct(r))return{vₓ:xc(r),vᵧ:n,v:Pn(it(mc(e,r),mc(o,n)))}}const wc=nt,_c=et,Mc=J;function Sc(t,n){const e=vc(t),[[r,[o]],[i,[c]]]=vc(n),{vₓ:s,vᵧ:u,v:f}=bc(e),l=_c(r,s),a=_c(i,u),p=Mc(l,a),h=wc(o,s),d=wc(c,u),g=Mc(h,d);return[p,Mc(g,f)].map(Pn)}const Nc=nt,Ic=Mr,yc=it,Ec=et,Oc=ot;function Cc(t){const[[n,e,[r]],[o,i,[c]]]=t;if(0===ct(n)&&0===ct(o))return bc([[e,[r]],[i,[c]]]);const s=Ec(n,i),u=Ec(e,o),f=Nc(c,n),l=Nc(r,o),a=Nc(c,e),p=Nc(r,i),h=Ec(n,n),d=Ec(n,o),g=Ec(o,o),v=yc(s,u),m=yc(f,l),x=yc(a,p),b=Pn(Oc(g)),w=Pn(Ic(d)),_=Pn(Oc(h)),M=Ec(i,v),S=Ic(Ec(o,m)),N=Pn(yc(M,S)),I=Ic(Ec(n,m)),y=Ec(e,v),E=Pn(yc(I,y)),O=Ec(v,x),C=Ec(m,m);return{vₓₓ:b,vₓᵧ:w,vᵧᵧ:_,vₓ:N,vᵧ:E,v:Pn(yc(O,C))}}const Tc=Jn,Pc=nt,Ac=et,kc=J,Bc=Mr;function zc(t,n){const e=gc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return Sc([t[0],t[2]],n);const[[r,[o]],[i,[c]]]=vc(n),{vₓₓ:s,vₓᵧ:u,vᵧᵧ:f,vₓ:l,vᵧ:a,v:p}=Cc(e),h=Tc(o,o),d=Pc(o,r),g=Tc(o,c),v=Pc(o,i),m=Ac(r,r),x=Pc(c,r),b=Ac(r,i),w=Tc(c,c),_=Pc(c,i),M=Ac(i,i),S=Ac(m,s),N=Ac(M,f),I=Ac(b,u),y=kc(S,N),E=kc(y,I),O=Ac(d,s),C=Ac(_,f),T=kc(v,x),P=Ac(T,u),A=Bc(kc(O,C)),k=kc(A,P),B=Ac(r,l),z=Ac(i,a),F=kc(B,z),Y=kc(k,F),L=Ac(h,s),X=Ac(g,u),H=Ac(w,f),D=kc(L,X),V=kc(D,H),$=Pc(o,l),q=Pc(c,a),j=kc($,q),W=kc(V,j);return[E,Y,kc(W,p)].map(Pn)}const Fc=et,Yc=Z,Lc=tt,Xc=lt;function Hc(t,n=!1){const[e,r,o,i]=t;if(!n){const[t,n]=e,[c,s]=r,[u,f]=o,[l,a]=i;return[e,[rt(it(Lc(Xc(c/4,u/4),3),Xc(t/4,l/4))),rt(it(Lc(Xc(s/4,f/4),3),Xc(n/4,a/4)))],i]}const c=function(t,n){const[[e,r],[o,i]]=t,[[c,s],[u,f]]=n,l=Yc(o,e),a=Yc(i,r),p=Yc(u,c),h=Yc(f,s),d=it(Fc(p,a),Fc(h,l));if(0===ct(d))return;const g=Yc(c,e),v=Yc(s,r),m=rt(it(Fc(v,l),Fc(g,a)))/rt(d);return[c+m*rt(p),s+m*rt(h)]}([e,r],[i,o]);if(void 0!==c)return[e,c,i]}const Dc=nt,Vc=et,$c=J,qc=it,jc=ot,Wc=Mr;function Qc(t){const[[n,e,r,[o]],[i,c,s,[u]]]=t;if(0===ct(n)&&0===ct(i))return Cc([[e,r,[o]],[c,s,[u]]]);const f=Vc(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nt=Uc(N,Mt),It=Uc(b,p),yt=Zc(St,Nt),Et=Zc(yt,It),Ot=Gc(o,d),Ct=Gc(c,g),Tt=Zc(Ot,Ct),Pt=Zc(Et,Tt);return[$,tt,xt,Zc(Pt,v)].map(Pn)}const ts=nt,ns=et,es=J;function rs(t,n){const e=vc(t),[[r,o,[i]],[c,s,[u]]]=gc(n);if(0===ct(r)&&0===ct(c))return Sc(t,[n[0],n[2]]);const{vₓ:f,vᵧ:l,v:a}=bc(e),p=ns(r,f),h=ns(c,l),d=es(p,h),g=ns(o,f),v=ns(s,l),m=es(g,v),x=ts(i,f),b=ts(u,l),w=es(x,b);return[d,m,es(w,a)].map(Pn)}const os=Jn,is=nt,cs=et,ss=J,us=Mr;function fs(t,n){const e=gc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return rs([t[0],t[2]],n);const[[r,o,[i]],[c,s,[u]]]=gc(n);if(0===ct(r)&&0===ct(c))return zc(t,[n[0],n[2]]);const{vₓₓ:f,vₓᵧ:l,vᵧᵧ:a,vₓ:p,vᵧ:h,v:d}=Cc(e),g=os(i,i),v=is(i,o),m=is(i,r),x=os(i,u),b=is(i,s),w=is(i,c),_=cs(o,o),M=cs(o,r),S=is(u,o),N=cs(o,s),I=cs(o,c),y=cs(r,s),E=cs(r,r),O=is(u,r),C=cs(r,c),T=os(u,u),P=is(u,s),A=is(u,c),k=cs(s,s),B=cs(s,c),z=cs(c,c),F=cs(E,f),Y=cs(C,l),L=cs(z,a),X=ss(F,Y),H=ss(X,L),D=cs(M,f),V=cs(B,a),$=ss(I,y),q=cs($,l),j=us(ss(D,V)),W=ss(j,q),Q=ss(us(m),_),R=ss(us(A),k),G=ss(w,N),U=ss(G,O),Z=cs(Q,f),J=cs(R,a),K=cs(U,l),tt=cs(r,p),nt=cs(c,h),et=ss(Z,J),rt=ss(et,K),ot=ss(tt,nt),it=ss(rt,ot),st=cs(v,f),ut=cs(P,a),ft=ss(b,S),lt=cs(ft,l),at=us(ss(st,ut)),pt=cs(o,p),ht=cs(s,h),dt=ss(at,lt),gt=ss(pt,ht),vt=ss(dt,gt),mt=cs(g,f),xt=cs(x,l),bt=cs(T,a),wt=is(i,p),_t=is(u,h),Mt=ss(mt,xt),St=ss(Mt,bt),Nt=ss(wt,_t),It=ss(St,Nt);return[H,W,it,vt,ss(It,d)].map(Pn)}const ls=Jn,as=nt,ps=et,hs=J,ds=Mr;function gs(t,n){const e=dc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return fs(Hc(t),n);const[[r,o,[i]],[c,s,[u]]]=gc(n);if(0===ct(r)&&0===ct(c))return Kc(t,[n[0],n[2]]);const{vₓₓₓ:f,vₓₓᵧ:l,vₓᵧᵧ:a,vᵧᵧᵧ:p,vₓₓ:h,vₓᵧ:d,vᵧᵧ:g,vₓ:v,vᵧ:m,v:x}=Qc(e),b=ls(i,i),w=as(i,o),_=as(i,r),M=ls(i,u),S=as(i,s),N=as(i,c),I=ps(o,o),y=ps(o,r),E=as(u,o),O=ps(o,s),C=ps(o,c),T=ps(r,s),P=ps(r,r),A=as(u,r),k=ps(r,c),B=ls(u,u),z=as(u,s),F=as(u,c),Y=ps(s,s),L=ps(s,c),X=ps(c,c),H=ps(r,f),D=ps(r,a),V=ps(c,l),$=ps(c,p),q=hs(H,V),j=hs(D,$),W=ps(P,q),Q=ps(X,j),R=hs(W,Q),G=hs(_,I),U=hs(F,Y),Z=hs(ds(_),I),J=hs(ds(F),Y),K=hs(ds(O),A),tt=hs(ds(O),N),nt=hs(ds(A),O),et=hs(as(6,_),I),rt=hs(as(6,F),Y),ot=hs(C,T),it=hs(N,A),st=hs(ds(E),S),ut=hs(ds(S),E),ft=hs(N,O),lt=hs(ft,A),at=as(3,P),pt=as(3,X),ht=ps(at,f),dt=ps(P,l),gt=ds(ps(k,l)),vt=ds(ps(k,a)),mt=ps(X,a),xt=ps(pt,p),bt=hs(ht,gt),wt=hs(dt,vt),_t=hs(bt,mt),Mt=hs(wt,xt),St=ps(o,_t),Nt=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kn,te),oe=hs(ne,ee),ie=hs(re,oe),ce=hs(Gn,Un),se=hs(Zn,Jn),ue=hs(ie,ce),fe=hs(ue,se),le=as(i,f),ae=as(i,a),pe=as(u,l),he=as(u,p),de=hs(le,pe),ge=hs(ae,he),ve=hs(de,h),me=hs(ge,g),xe=ps(b,ve),be=ps(B,me),we=ps(M,d),_e=as(i,v),Me=as(u,m),Se=hs(xe,be),Ne=hs(Se,we),Ie=hs(_e,Me),ye=hs(Ne,Ie);return[R,It,Wt,dn,Hn,fe,hs(ye,x)].map(Pn)}const vs=nt,ms=et,xs=J;function bs(t,n){const e=vc(t),[[r,o,i,[c]],[s,u,f,[l]]]=dc(n);if(0===ct(r)&&0===ct(s))return rs(t,Hc(n));const{vₓ:a,vᵧ:p,v:h}=bc(e),d=ms(r,a),g=ms(s,p),v=xs(d,g),m=ms(o,a),x=ms(u,p),b=xs(m,x),w=ms(i,a),_=ms(f,p),M=xs(w,_),S=vs(c,a),N=vs(l,p),I=xs(S,N);return[v,b,M,xs(I,h)].map(Pn)}const ws=Jn,_s=nt,Ms=et,Ss=J,Ns=Mr;function Is(t,n){const e=gc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return bs([t[0],t[2]],n);const[[r,o,i,[c]],[s,u,f,[l]]]=dc(n);if(0===ct(r)&&0===ct(s))return fs(t,Hc(n));const{vₓₓ:a,vₓᵧ:p,vᵧᵧ:h,vₓ:d,vᵧ:g,v}=Cc(e),m=ws(c,c),x=_s(c,i),b=_s(c,o),w=_s(c,r),_=ws(c,l),M=_s(c,f),S=_s(c,u),N=_s(c,s),I=Ms(i,i),y=Ms(i,o),E=Ms(i,r),O=_s(l,i),C=Ms(i,f),T=Ms(i,u),P=Ms(i,s),A=Ms(o,f),k=Ms(o,o),B=Ms(o,r),z=_s(l,o),F=Ms(o,u),Y=Ms(o,s),L=Ms(r,r),X=_s(l,r),H=Ms(r,f),D=Ms(r,u),V=Ms(r,s),$=ws(l,l),q=_s(l,f),j=_s(l,u),W=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=Jo(t),[[c,[,s]],[u,[,f]]]=Qo(n),l=c[1],a=u[1],p=e[1],h=r[1],d=o[1],g=l*p,v=2*Ko(g),m=ei(c,e),x=a*h,b=2*Ko(x),w=ei(u,r),_=g+x,M=ti(m,w),S=v+b+Ko(_),N=s*p,I=ni(s,e),y=Ko(N),E=f*h,O=ni(f,r),C=Ko(E),T=N+E,P=ti(I,O),A=y+C+Ko(T);return{coeffs:[M,ti(P,o)],errBound:[S,A+i+Ko(T+d)]}},function(t,n){const{coeffs:{vₓ:e,vᵧ:r,v:o},errorBound:{v_:i}}=Jo(t),{coeffs:[[c,s,[,u]],[f,l,[,a]]],errorBound:[[p],[h]]}=Wo(n),d=e[1],g=r[1],v=o[1],m=Bi(d),x=Bi(g),b=s[1],w=c[1],_=l[1],M=f[1],S=w*d,N=ki(c,e),I=p*m+2*Bi(S),y=M*g,E=ki(f,r),O=h*x+2*Bi(y),C=S+y,T=Pi(N,E),P=I+O+Bi(C),A=b*d,k=ki(s,e),B=2*Bi(A),z=_*g,F=ki(l,r),Y=2*Bi(z),L=A+z,X=Pi(k,F),H=B+Y+Bi(L),D=Ai(u,e),V=u*d,$=Bi(V),q=Ai(a,r),j=a*g,W=Bi(j),Q=V+j,R=Pi(D,q),G=$+W+Bi(Q),U=Q+v;return{coeffs:[T,X,Pi(R,o)],errBound:[P,H,G+i+Bi(U)]}},function(t,n){const{coeffs:{vₓ:e,vᵧ:r,v:o},errorBound:{v_:i}}=Jo(t),{coeffs:[[c,s,u,[,f]],[l,a,p,[,h]]],errorBound:[[d,g,v],[m,x,b]]}=jo(n),w=Ui(e[1]),_=Ui(r[1]),M=Gi(c,e),S=d*w+2*Ui(M[1]),N=Gi(l,r),I=m*_+2*Ui(N[1]),y=Qi(M,N),E=S+I+Ui(y[1]),O=Gi(s,e),C=g*w+2*Ui(O[1]),T=Gi(a,r),P=x*_+2*Ui(T[1]),A=Qi(O,T),k=C+P+Ui(A[1]),B=Gi(u,e),z=v*w+2*Ui(B[1]),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uc(Sb),yb=Sb+j;return{coeffs:[lr,no,Pi,tu,dl,xp,Gd,em,Ex,sc(Nb,a)],errBound:[ar,eo,Ai,nu,gl,bp,Ud,rm,Ox,Ib+_+uc(yb)]}}]],As=[[Sc,rs,bs],[zc,fs,Is],[Kc,gs,function(t,n){const e=dc(t);if(0===ct(e[0][0])&&0===ct(e[1][0]))return Is(Hc(t),n);const[[r,o,i,[c]],[s,u,f,[l]]]=dc(n);if(0===ct(r)&&0===ct(s))return gs(t,Hc(n));const{vₓₓₓ:a,vₓₓᵧ:p,vₓᵧᵧ:h,vᵧᵧᵧ:d,vₓₓ:g,vₓᵧ:v,vᵧᵧ:m,vₓ:x,vᵧ:b,v:w}=Qc(e),_=ys(c,c),M=Es(c,i),S=Es(c,o),N=Es(c,r),I=ys(c,l),y=Es(c,f),E=Es(c,u),O=Es(c,s),C=Os(i,i),T=Os(i,o),P=Os(i,r),A=Es(l,i),k=Os(i,f),B=Os(i,u),z=Os(i,s),F=Os(o,f),Y=Os(o,o),L=Os(o,r),X=Es(l,o),H=Os(o,u),D=Os(o,s),V=Os(r,r),$=Es(l,r),q=Os(r,f),j=Os(r,u),W=Os(r,s),Q=ys(l,l),R=Es(l,f),G=Es(l,u),U=Es(l,s),Z=Os(f,f),J=Os(f,u),K=Os(s,s),tt=Os(u,u),nt=Os(u,s),et=Os(f,s),rt=Os(r,V),ot=Os(r,K),it=Os(s,V),st=Os(s,K),ut=Os(rt,a),ft=Os(ot,h),lt=Os(it,p),at=Os(st,d),pt=Cs(ut,ft),ht=Cs(lt,at),dt=Cs(pt,ht),gt=Cs(Ts(D),j),vt=Cs(Ts(j),D),mt=Os(r,gt),xt=Os(s,vt),bt=Os(o,V),wt=Os(u,K),_t=Os(a,bt),Mt=Os(d,wt),St=Os(p,mt),Nt=Os(h,xt),It=Cs(St,Nt),yt=Es(3,Cs(_t,Mt)),Et=Cs(It,yt),Ot=Os(i,W),Ct=Os(f,V),Tt=Os(o,nt),Pt=Os(i,K),At=Os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m),ri=Os(_,ni),oi=Os(Q,ei),ii=Cs(ri,oi),ci=Os(I,v),si=Cs(ii,ci),ui=Es(c,x),fi=Es(l,b),li=Cs(ui,fi),ai=Cs(si,li);return[dt,Et,Jt,Fn,be,Ke,Dr,No,Ro,Cs(ai,w)].map(Pn)}]];function ks(t,n){const{coeffs:e,errBound:r}=Ps[t.length-2][n.length-2](t,n);return{coeffs:e,errBound:r,getPExact:()=>As[t.length-2][n.length-2](t,n)}}const Bs=134217729;function zs(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=r/i,s=i*c,u=Bs*i,f=u-(u-i),l=i-f,a=Bs*c,p=a-(a-c),h=c-p,d=o*c,g=s+d,v=d-(g-s)+(l*h-(s-f*p-l*p-f*h)),m=g+v,x=(r-m+(e-(v-(m-g))))/i,b=c+x;return[x-(b-c),b]}const Fs=zs,Ys=Number.EPSILON/2,Ls=Ys*Ys,Xs=Zt,Hs=Zt,Ds=jn,Vs=Ut,$s=Zt,qs=Je,js=Xo,{abs:Ws}=Math,Qs=[0,1],Rs=Zt,Gs=Xo,Us=Ut,Zs=jn,Js=Dn,Ks=Ke,tu=function(t,n,e,r){const o=t[0],i=t[1],c=n[0],s=n[1],u=Fs(t,n),f=Math.abs(o+i),l=Math.abs(c+s),a=l-Ys*l-r;return a<=0?{est:u,err:Number.POSITIVE_INFINITY}:{est:u,err:(l*e+f*r)/a**2+9*Ls*Math.abs(f/l)}},nu=function(t,n){return Xs(t,n)[1]>0?n:t},eu=function(t,n){return Hs(t,n)[1]>0?t:n};function ru(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],[c,s]],[u,f]){const l=Rs(f,u),a=3*Be*Ws(l[1]),p=Rs(Qs,u),h=3*Be*Ws(p[1]),d=tu(l,p,a,h);f=Gs(d.est,d.err);const g=Rs(Qs,u),v=Zs(u,u),m=Zs(u,g),x=Zs(g,g),b=Zs(v,u),w=Zs(v,g),_=Zs(x,u),M=Zs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=G,B=y*U+E*G,F=O*i+2*C*U+T*G,A*=7*Be,B*=11*Be,F*=14*Be;const Z=nu(nu(Gs(X,-P),Gs(H,-k)),Gs(D,-z)),J=eu(eu(Gs(X,+P),Gs(H,+k)),Gs(D,+z));return[[Z,nu(nu(Gs(W,-A),Gs(Q,-B)),Gs(R,-F))],[J,eu(eu(Gs(W,+A),Gs(Q,+B)),Gs(R,+F))]]}(t,n):function([[t,n],[e,r]],[o,i]){const c=Rs(i,o),s=3*Be*Ws(c[1]),u=Rs(Qs,o),f=3*Be*Ws(u[1]),l=tu(c,u,s,f);i=Gs(l.est,l.err);const a=Rs(Qs,o),p=Rs(Qs,i),h=Ws(o[1]),d=Ws(a[1]),g=Ws(i[1]),v=Ws(p[1]);let m=Ws(t),x=Ws(n),b=Ws(e),w=Ws(r);const _=Us(Js(e,o),Js(t,a)),M=Us(Js(e,i),Zs(_,p));m=b*h+m*d,b=b*g+m*v,m*=3*ke,b*=7*ke;const S=Us(Js(r,o),Js(n,a)),N=Us(Js(r,i),Zs(S,p));x=w*h+x*d,w=w*g+x*v,x*=3*ke,w*=7*ke;const I=nu(Gs(_,-m),Gs(M,-b)),y=eu(Gs(_,+m),Gs(M,+b));return[[I,nu(Gs(S,-x),Gs(N,-w))],[y,eu(Gs(S,+x),Gs(N,+w))]]}(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=>[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],[c,s],[u,f]]=t,l=js(Ds(qs(o,e),n),e),a=js(Ds(qs(c,o),n),o),p=js(Ds(qs(u,c),n),c),h=Vs(l,Ds($s(a,l),n)),d=Vs(a,Ds($s(p,a),n)),g=Vs(h,Ds($s(d,h),n)),v=js(Ds(qs(i,r),n),r),m=js(Ds(qs(s,i),n),i),x=js(Ds(qs(f,s),n),s),b=Vs(v,Ds($s(m,v),n)),w=Vs(m,Ds($s(x,m),n));return[g,Vs(b,Ds($s(w,b),n))]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=Vs([0,e],Ds(qs(o,e),n)),f=Vs([0,o],Ds(qs(c,o),n)),l=Vs(u,Ds($s(f,u),n)),a=Vs([0,r],Ds(qs(i,r),n)),p=Vs([0,i],Ds(qs(s,i),n));return[l,Vs(a,Ds($s(p,a),n))]}if(2===t.length){const[[e,r],[o,i]]=t;return[js(Ds(qs(o,e),n),e),js(Ds(qs(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=Ae(t,n).map(t=>16*ze*t);else if(3===t.length)i=Ae(t,n).map(t=>10*ze*t);else if(2===t.length)i=Ae(t,n).map(t=>4*ze*t);else if(1===t.length)return[o,o];return[[Gs(o[0],-i[0]),Gs(o[1],-i[1])],[Gs(o[0],+i[0]),Gs(o[1],+i[1])]]}(t,n[0])}function ou(t){return(n,e)=>{let[[r,o],[i,c]]=n,[[s,u],[f,l]]=e;return(o[1]>c[1]||o[1]===c[1]&&o[0]>c[0])&&([o,c]=[c,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]),(s[1]>f[1]||s[1]===f[1]&&s[0]>f[0])&&([s,f]=[f,s]),t?(r[1]<f[1]||r[1]===f[1]&&r[0]<=f[0])&&(i[1]>s[1]||i[1]===s[1]&&i[0]>=s[0])&&(u[1]<c[1]||u[1]===c[1]&&u[0]<=c[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]>s[1]||i[1]===s[1]&&i[0]>s[0])&&(u[1]<c[1]||u[1]===c[1]&&u[0]<c[0])&&(l[1]>o[1]||l[1]===o[1]&&l[0]>o[0])}}function iu(t){return[((n=t.x.box)[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2];var n}function cu(t,n){const e=ks(t,n);if(void 0===e)return;const{coeffs:r,errBound:o,getPExact:i}=e,c=Ce(r,0,1,o,i)||[];return 0!==c.length?{ris:c.map(Lo),getPExact:i}:void 0}function su(t){const n=rt(t.tS);return{t:n,tS:n,tE:rt(t.tE),multiplicity:t.multiplicity}}function uu(t,n){const e=cu(t,n);if(void 0===e)return[];const{getPExact:r}=e;let o,{ris:i}=e;const c=()=>(o=o||r(),o),s=cu(n,t);if(void 0===s)return[];let{ris:u}=s;const{getPExact:f}=s;let l;const a=()=>(l=l||f(),l);let p;p=1;let h,d=0;t:for(;d<p;){h=u.map(n=>ru(t,[n.tS,n.tE]));for(let t=0;t<u.length;t++){const n=h[t];for(let e=t+1;e<u.length;e++){const t=h[e];if(ou(!0)(n,t)){const t=[];for(const n of u)t.push(...Rr({t:n.tS[1],tS:n.tS[1],tE:n.tE[1],multiplicity:n.multiplicity},a()));u=t,d++;continue t}}}break t}p=1;let g,v=0;t:for(;v<p;){g=i.map(t=>ru(n,[t.tS,t.tE]));for(let t=0;t<i.length;t++){const n=g[t];for(let e=t+1;e<i.length;e++){const t=g[e];if(ou(!0)(n,t)){const t=[];for(const n of i)t.push(...Rr({t:n.tS[1],tS:n.tS[1],tE:n.tE[1],multiplicity:n.multiplicity},c()));i=t,v++;continue t}}}break t}const m=[];for(let t=0;t<u.length;t++){const n=h[t];for(let e=0;e<i.length;e++){const o=g[e];if(ou(!0)(n,o)){const c={compensated:d,ri:su(u[t]),riExp:d?u[t]:void 0,getPExact:d?void 0:f,kind:1,box:fu(n)},s={compensated:v,ri:su(i[e]),riExp:v?i[e]:void 0,getPExact:v?void 0:r,kind:1,box:fu(o)};m.push({psX:c,sideX:s})}}}return m}function fu(t){return t.map(t=>t.map(rt))}function lu(t,n){return function(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,c=e.slice();for(let t=0;t<i.length;t++){const n=uu(o,i[t]);for(const{psX:e,sideX:r}of n)c.push({x:e,side:t,sideX:r,curve:void 0})}c.sort((t,n)=>t.x.ri.tS-n.x.ri.tS);const s=[],u=[];let f,l;for(const n of c)void 0!==n.side?(!0===l&&(u.push({idx:++r,dir:1,p:iu(n),_x_:f,container:t,side:n.side,sideX:n.sideX,loopsIdxs:new Set,children:new Set,windingNum:0,orientation:0}),f.out=u[u.length-1]),l=!1):(!1===l&&(s.push({idx:++r,dir:-1,p:iu(f),_x_:n,container:t,side:f.side,sideX:f.sideX,loopsIdxs:new Set,children:new Set,windingNum:0,orientation:0}),n.in_=s[s.length-1]),l=!0),f=n;return{ins:s,outs:u,ioIdx:r}}}(t);for(const t of o){const[e,o]=t;let c,s;({ins:c,outs:s,ioIdx:n}=i(e,o,n)),r.push(...c),r.push(...s)}return{inOuts:r,ioIdx:n}}(t,n)}function au(t,n,e,r){const o=[];for(const r of t)o.push({type:-1,item:r,x:n(r)}),o.push({type:1,item:r,x:e(r)});o.sort(pu);const i=new Set,c=[];for(const t of o){const{item:n,type:e}=t;if(-1===e){for(const t of i){const e=r(n,t);e&&c.push({a:n,b:t,u:e})}i.add(n)}else 1===e&&i.delete(n)}return c}function pu(t,n){const e=t.x-n.x;return 0!==e?e:t.type}function hu(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 c;if(r>0){if(o<=0)return i;c=r+o}else{if(!(r<0))return i;if(o>=0)return i;c=-r-o}return Math.abs(i)>=3330669073875472e-31*c?i:function(t,n,e,r){const o=t[0]-e[0],i=n[0]-e[0],c=t[1]-e[1],s=n[1]-e[1],u=it(Jn(o,s),Jn(c,i));let f=rt(u);if(Math.abs(f)>=2220446049250315e-31*r)return f;const l=Z(t[0],e[0])[0],a=Z(n[0],e[0])[0],p=Z(t[1],e[1])[0],h=Z(n[1],e[1])[0];if(0===l&&0===p&&0===a&&0===h)return f;const d=1109335647967049e-46*r+3330669073875471e-31*Math.abs(f);if(f+=o*h+s*l-(c*a+i*p),Math.abs(f)>=d)return f;const g=J(u,it(Jn(l,s),Jn(p,i))),v=J(g,it(Jn(o,h),Jn(c,a)));let m=J(v,it(Jn(l,h),Jn(p,a)));return m=Pn(m),m[m.length-1]}(t,n,e,c)}function du(t,n){const e=n[0]-t[0],r=n[1]-t[1];return e*e+r*r}function gu(t,n){if(0===t.length)return;const e=t.slice(),r=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}(e),[o]=e.splice(r,1);e.sort((t,n)=>{let e=-hu(o,t,n);return 0!==e?e:(e=t[1]-n[1],0!==e?e:t[0]-n[0])}),e.unshift(o);const i=function(t){const n=[t[0]],e=t.length;for(let r=1;r<t.length;r++){const o=t[(r+e-1)%e],i=t[r];o[0]===i[0]&&o[1]===i[1]||n.push(i)}return n}(e),c=[];for(const t of i){for(;c.length>=2&&hu(c[c.length-2],c[c.length-1],t)<0;)c.pop();c.push(t)}if(n||c.length<3)return c;const s=[];{const t=c.length;for(let n=0;n<t;n++){const e=(n+1)%t,r=c[(n+t-1)%t],o=c[n],i=c[e];(0!==hu(r,o,i)||vu(r,o,i)<0)&&s.push(o)}}return s}function vu(t,n,e){const r=n[0]-t[0],o=n[1]-t[1];return r*(e[0]-n[0])+o*(e[1]-n[1])}const mu=gu,xu=Ut,bu=et,wu=J,_u=jn,Mu=Math.abs,Su=Ye(3);const Nu=Math.abs;const Iu=Math.abs,yu=jn,Eu=Ut,Ou=et,Cu=J,Tu=Math.abs,Pu=Fe(1),Au=Ye(3);function ku(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=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,c]]=so(t),s=n*i-e*o,u=n*c-r*o;return{vₓₓ:-o*o,vₓᵧ:2*n*o,vᵧᵧ:-n*n,vₓ:i*s-2*o*u,vᵧ:2*n*u-e*s,v:s*(e*c-r*i)-u*u}}(t),{vₓₓ_:l,vₓᵧ_:a,vᵧᵧ_:p,vₓ_:h,vᵧ_:d,v_:g}=function(t){const[n,e]=t[0],[[r,o],[i,c]]=function(t){const[[n,e],[r,o],[i,c]]=t,s=Nu(n),u=Nu(r),f=Nu(i),l=Nu(e),a=Nu(o);return[[f+s+2*u,2*(u+s),0],[Nu(c)+l+2*a,2*(a+l),0]]}(t),s=Iu(n),u=Iu(e),f=r*c+o*i,l=r*u+s*i;return{vₓₓ_:i*i,vₓᵧ_:2*r*i,vᵧᵧ_:r*r,vₓ_:c*f+2*i*l,vᵧ_:2*r*l+o*f,v_:f*(o*u+s*c)+l*l}}(t),v=u?0:1,m=Tu(c),x=Tu(s);if((v+12)*Pu*(l*(m*m)+a*(m*x)+p*(x*x)+(h*m+d*x)+g)<Tu(n*c*c+e*c*s+r*s*s+(o*c+i*s)+f))return!1}{const{coeffs:{vₓₓ:n,vₓᵧ:o,vᵧᵧ:i,vₓ:u,vᵧ:f,v:l},errorBound:{vₓₓ_:a,vₓᵧ_:p,vᵧᵧ_:h,vₓ_:d,vᵧ_:g,v_:v}}=li(t),m=Vr(e),x=Vr(r),b=Tu(c),w=Tu(s),_=b/3,M=w/3,S=yu(m,m),N=S[1],I=2*(b*_+N),y=yu(x,x),E=y[1],O=2*(w*M+E),C=yu(m,x),T=Tu(C[1]),P=b*M+_*w+2*T,A=yu(n,S),k=Tu(n[1])*I+a*N+2*Tu(A[1]),B=yu(o,C),z=Tu(o[1])*P+p*T+2*Tu(B[1]),F=yu(i,y),Y=Tu(i[1])*O+h*E+2*Tu(F[1]),L=yu(m,u),X=Tu(u[1])*_+d*b+2*Tu(L[1]),H=yu(x,f),D=Tu(f[1])*M+g*w+2*Tu(H[1]),V=Eu(A,B),$=k+z+Tu(V[1]),q=Eu(V,F),j=$+Y+Tu(q[1]),W=Eu(L,H),Q=X+D+Tu(W[1]),R=Eu(q,W),G=j+Q+Tu(R[1]),U=Eu(R,l),Z=G+v+Tu(U[1]);if(Au*Z<Tu(rt(U)))return!1}{const n=function(t){return Cc(gc(t))}(t);if(void 0===n)return u&&c===t[0][0]&&s===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ᵧ:a,v:p}=n;return 0===ct(Cu(Cu(Cu(Ou(o,Ou(e,e)),Ou(i,Ou(e,r))),Ou(f,Ou(r,r))),Cu(Cu(Ou(e,l),Ou(r,a)),p)))}}const Bu=Math.abs,zu=jn,Fu=Ut,Yu=et,Lu=J,Xu=Math.abs,Hu=Fe(1),Du=Ye(3);function Vu(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=r[i-1],u=1===o&&1===i;{const{vₓₓₓ:n,vₓₓᵧ:e,vₓᵧᵧ:r,vᵧᵧᵧ:o,vₓₓ:i,vₓᵧ:f,vᵧᵧ:l,vₓ:a,vᵧ:p,v:h}=function(t){const[[n,e,r,o],[i,c,s,u]]=co(t),f=n*s,l=r*i,a=n*c,p=e*i,h=n*n,d=i*i,g=n*u-o*i,v=f-l,m=a-p,x=e*u-o*c,b=e*s-r*c,w=r*u-o*s,_=2*v,M=g*g,S=g*b,N=_*x,I=m*x,y=-3*g-b,E=-3*M-2*S+(N+m*w),O=2*(g*v-I),C=g*m-v*v+m*b;return{vₓₓₓ:-i*d,vₓₓᵧ:3*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ft),Nt=ut+lt+Xu(St[1]),It=Fu(_t,St),yt=Mt+Nt+Xu(It[1]),Et=Fu(at,ht),Ot=pt+dt+Xu(Et[1]),Ct=Fu(Et,gt),Tt=Ot+vt+Xu(Ct[1]),Pt=Fu(It,Ct),At=yt+Tt+Xu(Pt[1]),kt=Fu(mt,bt),Bt=xt+wt+Xu(kt[1]),zt=Fu(kt,d),Ft=Bt+N+Xu(zt[1]),Yt=Fu(Pt,zt),Lt=At+Ft+Xu(Yt[1]);if(Du*Lt<Xu(rt(Yt)))return!1}{const n=function(t){return Qc(dc(t))}(t);if(void 0===n)return u&&c===t[0][0]&&s===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ₓₓ:a,vₓᵧ:p,vᵧᵧ:h,vₓ:d,vᵧ:g,v}=n,m=Yu(e,e),x=Yu(e,m),b=Yu(r,r),w=Yu(r,b),_=Yu(r,m),M=Yu(e,b),S=Yu(e,r),N=Yu(o,x),I=Yu(i,_),y=Yu(f,M),E=Yu(l,w),O=Yu(a,m),C=Yu(p,S),T=Yu(h,b),P=Yu(e,d),A=Yu(r,g),k=Lu(N,I),B=Lu(y,E),z=Lu(k,B),F=Lu(O,C),Y=Lu(F,T),L=Lu(z,Y),X=Lu(P,A),H=Lu(X,v);return 0===ct(Lu(L,H))}}function $u(t,n){const{coeffs:e,errBound:r,getPExact:o}=ks(t,n);return Ce(e,0,1,r,o)}const qu=Math.min,ju=Math.max;function Wu(t,n){let[[e,r],[o,i]]=t,[[c,s],[u,f]]=n;if(e>o&&([e,o]=[o,e]),c>u&&([c,u]=[u,c]),r>i&&([r,i]=[i,r]),s>f&&([s,f]=[f,s]),e<=u&&o>=c&&s<=i&&f>=r)return[[ju(e,c),ju(r,s)],[qu(o,u),qu(i,f)]]}function Qu(t,n,e){if(void 0===e)return;if(0===e.length)return[];const r=$u(n,t);if(void 0===r)return;if(0===r.length)return[];const o=r.map(n=>Re(t,[n.tS,n.tE])),i=e.map(t=>Re(n,[t.tS,t.tE])),c=[];for(let t=0;t<r.length;t++){const n=o[t];for(let o=0;o<e.length;o++){const s=Wu(n,i[o]);if(void 0!==s){const n={ri:r[t],box:s,kind:1},i={ri:e[o],box:s,kind:1};c.push([n,i])}}}return c}function Ru(t,n,e){for(const r of[t,n]){const o=r.length;for(let i=1;i<o+1;i++){const c=r[i-1],s=r[i%o],u=[s[1]-c[1],c[0]-s[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 a=Number.POSITIVE_INFINITY,p=Number.NEGATIVE_INFINITY;for(let t=0;t<n.length;t++){const e=u[0]*n[t][0]+u[1]*n[t][1];e<a&&(a=e),e>p&&(p=e)}if(e&&(l<a||p<f))return!1;if(!e&&(l<=a||p<=f))return!1}}return!0}const Gu=Jn,Uu=J,Zu=Number.EPSILON/2,Ju=Math.abs;function Ku(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=s+3*r,l=n+3*i,a=f-l,p=Ju(3*r)+Ju(f)+(Ju(3*i)+Ju(l))+Ju(a);if(Ju(a)-Zu*p>0)return!1;const h=u+3*o,d=e+3*c,g=h-d,v=Ju(3*o)+Ju(h)+(Ju(3*c)+Ju(d))+Ju(g);return!(Ju(g)-Zu*v>0)&&0===ct(it(Uu([s],Gu(3,r)),Uu([n],Gu(3,i))))&&0===ct(it(Uu([u],Gu(3,o)),Uu([e],Gu(3,c))))}const tf=lt,{abs:nf}=Math;function ef(t){const[[n,e],[r,o],[i,c]]=t,s=n+i,u=s-2*r,f=nf(s)+nf(u);if(nf(u)-f>0)return!1;const l=e+c,a=l-2*o,p=nf(l)+nf(a);return!(nf(a)-p>0)&&0===ct(it(tf(n,i),[2*r]))&&0===ct(it(tf(e,c),[2*o]))}function rf(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 of(t){return 4===t.length&&Ku(t)&&(t=Hc(t)),3===t.length&&ef(t)&&(t=[t[0],t[2]]),2===t.length&&rf(t)&&(t=[t[0]]),t}const cf=Number.EPSILON,sf=cf/2;function uf(t,n){return n<0?t<1?t:1-sf:0===n?1:t>1?t:1+cf}function ff(t){const n=function(t){const n=new ArrayBuffer(8);return new DataView(n).setFloat64(0,t,!1),Array.from(new Uint8Array(n))}(t),e=n[0],r=n[1],o=e>>7,i=((127&e)<<4)+((240&r)>>4),c=0===i?0:16,s=0===i?i-1022:i-1023,u=n.slice(1);return u[0]=(15&r)+c,{sign:o,exponent:s,significand:u}}function lf(t){return ff(t).significand}function af(t){return Math.log2(t&-t)}function pf(t){if(0===t||!Number.isFinite(t))return NaN;const n=lf(t),e=n.length;for(let t=e-1;t>=0;t--){if(0===n[t])continue;const r=af(n[t]);if(Number.isFinite(r))return 8*(e-t-1)+r}return NaN}function hf(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 df(t){if(0===t||!Number.isFinite(t))return NaN;const n=lf(t),e=n.length;for(let t=0;t<e;t++){const r=hf(n[t]);if(Number.isFinite(r))return 8*(e-t-1)+r}return NaN}function gf(t){return ff(t).exponent}function vf(t){if(0===t||!Number.isFinite(t))return NaN;const n=gf(t);return df(t)-52+n}function mf(t,n){const e=(2**(53-n)+1)*t;return e-(e-t)}function xf(t,n){if(0===ct(t=Pn(t)))return[0];const e=vf(t[t.length-1]);let r=e,o=t.length-1;for(;o>0;){const i=vf(t[o-1]);if(e-i>n)break;r=i,o--}const i=Math.min(n-(e-r),53);let c=t[o];c=mf(c,i);const s=t.slice(o);return s[0]=c,s}function bf(t){return 0===t?0:df(t)-pf(t)+1}function wf(t){const n=Pn(t);if(0===ct(n))return 0;const e=n[n.length-1],r=n[0];return gf(e)-gf(r)+(53-pf(r))}function _f(t){return rt(function(t,n,e){let r=n,o=t,i=!1,c=0;e||(c=wf(o)-wf(r)+1,e=c/53+1,i=!0);let s=[1/rt(r)],u=1;for(;;){if(o=et(o,s),u>e)return i?(o=xf(o,c),o):o.slice(o.length-e,o.length);r=et(r,s),s=it([2],r),u*=2}}(t[0],t[1],2))}function Mf(t){return ct(t[0])*ct(t[1])}function Sf(t){return(n,e)=>{const r=hc(n),o=hc(e),i=hc(n.slice().reverse()),c=hc(e.slice().reverse()),s=t(r,o),u=t(i,o),f=t(r,c),l=t(i,c),a=-Mf(u),p=-Mf(l),h=_f(s),d=_f(f);return[uf(h,a),uf(d,p)]}}const Nf=Sf(function(t,n){const e=0===ct(t[0][0])?1:0;return function(t,n){const[e,r]=t,[,o]=n;return[it(o,r),e]}(t[e],n[e])});function If(t,n){return Gr(et(t[0],n[1]),et(t[1],n[0]))*ct(t[1])*ct(n[1])}function yf(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=-gf(e)+bf(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 0n;const e=-gf(t)+bf(t)-1;return BigInt(t*2**e)*2n**BigInt(n-e)})):t.map(t=>t.map(t=>BigInt(t*2**n)))}function Ef(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 Of=BigInt(2**53);function Cf(t){if(0n===t)return[0];const n=[];let e=0,r=t;for(;0n!==r;){r=t/Of;const o=t%Of;n.push(Number(o)*2**(53*e)),t=r,e++}return Pn(n)}const{round:Tf,sqrt:Pf}=Math;function Af(t){if(t<=1n){if(t<0n)throw new Error("square root of negative numbers are not allowed");return t}let n=BigInt(Tf(Pf(Number(t))));for(;;){const e=n+t/n>>1n;if(e===n)return n;n=e}}function kf(t){return t<0n?-t:t}function Bf(t){let n=0n;for(let e=0;e<t.length;e++)n+=t[e];return n}function zf(t,n){const[e,r]=Ff(t[0],n[0]),[o,i]=Ff(t[1],n[1]);if(0===If(e,o)||0===If(e,i))return e;if(0===If(r,o)||0===If(r,i))return r;throw new Error("An unexpected error occured.")}function Ff(t,n){const[e,r]=t,[o,i]=n,[c,s]=function(t){const[n,e]=yf(t).map(Bf),r=Ef(n,e);return[Cf(Af(kf(n/r))),Cf(Af(kf(e/r)))]}([o,e]);return[[it(et(i,s),et(r,c)),et(c,Mr(e))],[it(et(i,ot(s)),et(r,c)),et(c,Mr(e))]].sort(If)}function Yf(t,n){const e=hc(t),r=0===ct(e[0][0])?0:0===ct(e[1][0])?1:-1;if(-1!==r){const e=t[0][r],o=t[2][r],i=n[0][r],c=n[2][r];return Nf([[e,e],[o,o]],[[i,i],[c,c]])}return Sf(zf)(t,n)}const{round:Lf,cbrt:Xf}=Math;function Hf(t){const n=(e=t)>0n?1n:e<0n?-1n:0n;var e;if((t=kf(t))<=1n)return n*t;let r=BigInt(Lf(Xf(Number(t))));for(;;){const e=(2n*r+t/(r*r))/3n;if(e===r)return n*r;r=e}}function Df(t){return et(t,t)}const Vf=Sf(function(t,n){const e=0===ct(t[0][0])?1:0;return function(t,n){const[e,r]=t,[o,i]=n,c=function(t){const[n,e]=yf(t).map(Bf),r=Ef(n,e);return[Cf(Hf(n/r)),Cf(Hf(e/r))]}([o,e]),s=Df(c[0]);return[it(et(i,Df(c[1])),et(r,s)),et(nt(3,e),s)]}(t[e],n[e])}),{EPSILON:$f}=Number,qf=$f/2+$f**2/2;function jf(t){return t>0?t-t*qf:t+t*qf}const{EPSILON:Wf}=Number,Qf=Wf/2+Wf**2/2;function Rf(t){return t>0?t+t*Qf:t-t*Qf}function Gf(t){if(0===t||1===t)return[t,t];const n=jf(jf(t)),e=function(t){return Rf(Rf(t))}(t);return[n,e]}function Uf(t,n,e,r){const o=t.ps,i=n.ps,c=[];let s=$u(o,i);if(void 0===s){const r=2**(e-47),s=function(t,n,e=!1){e||(t=of(t),n=of(n));const r=[,,Nf,Yf,Vf],[o,i]=r[t.length](t,n),[c,s]=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:c,bez:"A",start:!0},{tA:1,tB:s,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=Re(t,[e,e]);return[{p:o[0],kind:4,box:o,t1:e,ri1:{t:e,tS:e,tE:e,multiplicity:1},t2:r,ri2:{t:r,tS:r,tE:r,multiplicity:1}}]}if(u[0].bez===u[1].bez)return[];const f=u[1],l=u[2],[a,p]=Gf(f.tA),[h,d]=Gf(f.tB),[g,v]=Gf(l.tA),[m,x]=Gf(l.tB),b=Re(t,[a,p]),w=Re(n,[h,d]),_=Re(t,[g,v]),M=Re(n,[m,x]),S=Wu(b,w),N=Wu(_,M),I={t:a,tS:a,tE:p,multiplicity:1},y={t:h,tS:h,tE:d,multiplicity:1},E={t:g,tS:g,tE:v,multiplicity:1},O={t:m,tS:m,tE:x,multiplicity:1};return[{p:Ge(S),kind:5,box:S,t1:Hr(I),ri1:I,t2:Hr(y),ri2:y},{p:Ge(N),kind:5,box:N,t1:Hr(E),ri1:E,t2:Hr(O),ri2:O}]}(o,i);for(const e of s){const i=Te(o,e.ri1.tS),s=[[i[0]-r,i[1]-r],[i[0]+r,i[1]+r]],u={x:{ri:e.ri1,kind:5,box:s},curve:t},f={x:{ri:e.ri2,kind:5,box:s},curve:n};c.push([u,f])}return c}if(r&&(s=s.filter(t=>t.tS>0)),0===s.length)return[];const u=Qu(o,i,s);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};c.push([r,o])}return c}const Zf=Fe(1);function Jf(t,n,e){const r=n.ps;if(0===t)return r[0],{x:{ri:{t,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:{t,tS:t,tE:t,multiplicity:1},box:[o,o],kind:e},curve:n}}const{p:o,pE:i}=function(t,n){const e=Te(t,n),r=Ae(t,[0,n]);if(4===t.length)return{p:e,pE:r.map(t=>9*Zf*t)};if(3===t.length)return{p:e,pE:r.map(t=>6*Zf*t)};if(2===t.length)return{p:e,pE:r.map(t=>3*Zf*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:{t,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 Kf(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 Vu(t,n);if(3===t.length)return ku(t,n);if(2===t.length)return function(t,n){const[e,r]=n,o=e.length,i=r.length,c=e[o-1],s=r[i-1],u=1===o&&1===i;{const{coeffs:{vₓ:n,vᵧ:o,v:i},errorBound:{v_:u}}=Jo(t),f=Vr(e),l=Vr(r),a=Mu(c),p=Mu(s),h=Mu(n[1]),d=Mu(o[1]),g=a/3,v=p/3,m=n[1]*c,x=_u(f,n),b=h*g+2*Mu(m),w=o[1]*s,_=_u(l,o),M=d*v+2*Mu(w),S=xu(x,_),N=b+M+Mu(S[1]),I=xu(S,i),y=N+u+Mu(I[1]);if(Su*y<Mu(rt(I)))return!1}{const n=function(t){return bc(vc(t))}(t);if(void 0===n)return u&&c===t[0][0]&&s===t[0][1];const{vₓ:o,vᵧ:i,v:f}=n,l=bu(e,o),a=bu(r,i);return 0===ct(wu(wu(l,a),f))}}(t,n);if(1===t.length){const e=Pn(n[0]),r=Pn(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=Qu(e,r,[(o=1,{t:o,tS:o,tE:o,multiplicity:1})]);if(void 0===i||0===i.length)return;return[[{x:i[0][0],curve:t},Jf(1,n,1)]]}var o}function tl(t){return t[t.length-1]<0?ot(t):t}function nl(t,n){const e=t+n,r=e-t;return[t-(e-r)+(n-r),e]}Number.EPSILON;const el=Number.EPSILON/2;function rl(t,n,e,r){const o=t/n,i=Math.abs(t),c=Math.abs(n),s=c-r;return s<=0?{est:o,err:Number.POSITIVE_INFINITY}:{est:o,err:(c*e+i*r)/s**2+el*Math.abs(i/c)}}function ol(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,c=i-(i-r),s=r-c,u=.5*(e-o-(s*s-(o-c*c-c*s*2))+n)/r;return[u-(r+u-r),r+u]}const{abs:il}=Math;const cl=Math.abs,sl=Fe(1);function ul(t){const{coeffs:[[n,e,r],[o,i,c]],errorBound:[[s,u],[f,l]]}=function(t){const[[n,e],[r,o],[i,c],[s,u]]=t,f=s-n,l=r-i,a=f+3*l,p=i+n,h=p-2*r,d=r-n,g=u-e,v=o-c,m=g+3*v,x=c+e,b=x-2*o,w=o-e;return{coeffs:[[a,3*h,3*d,n],[m,3*b,3*w,e]],errorBound:[[il(f)+6*il(l)+il(a),6*(il(p)+il(h)),6*il(d),0],[il(g)+6*il(v)+il(m),6*(il(x)+il(b)),6*il(w),0]]}}(t),a=cl(n),p=cl(e),h=cl(r),d=cl(o),g=cl(i),v=cl(c),m=e*o,x=n*i,b=n*c,w=r*o,_=e*c,M=r*i,S=u*d+p*f+cl(m),N=s*g+a*l+cl(x),I=s*v+cl(b),y=h*f+cl(w),E=u*v+cl(_),O=h*l+cl(M),C=m-x,T=cl(C),P=S+N+T,A=w-b,k=cl(A),B=y+I+k,z=_-M,F=cl(z),Y=E+O+F,L=C*C,X=C*A,H=z*C,D=A*A,V=H+D;return{coeffs:[L,X,V],errBound:[2*P*T+cl(L),P*k+T*B+cl(X),Y*T+F*P+cl(H)+(2*k*B+cl(D))+cl(V)].map(t=>sl*t)}}const fl=et,ll=J;function al(t){const[[n,e,r],[o,i,c]]=dc(t),s=fl(e,o),u=fl(n,i),f=fl(n,c),l=fl(r,o),a=fl(e,c),p=fl(r,i),h=it(s,u),d=it(l,f),g=it(a,p),v=fl(h,h),m=fl(h,d),x=fl(h,g),b=fl(d,d);return[v,m,ll(x,b)]}const pl=it,hl=et,dl=nt,gl=Je,vl=nl,ml=ri,xl=Ut,bl=Ke,wl=zs,_l=J,Ml=at,Sl=2*Number.EPSILON,Nl=Math.abs,Il=Fe(1);function yl(t,n=!0){if(t.length<4)return[];const{coeffs:[e,r,o],errBound:[i,c,s]}=ul(t);if(Nl(e)<=i){const[[n,e],[r,o],[i,c],[s,u]]=t,f=_l(gl(s,n),dl(3,gl(r,i))),l=Ml(vl(i,n),-2*r),a=_l(gl(u,e),dl(3,gl(o,c))),p=Ml(vl(c,e),-2*o);if(0===Gr(hl(l,a),hl(f,p)))return[]}const u=r*r,f=4*e*o,l=u-f,a=2*c*Nl(r)+Il*u+(4*(i*Nl(o)+Nl(e)*s)+Il*Nl(f))+Il*Nl(l);if(l<-a)return[];if(l>a){const{est:t,err:u}=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))}}(l,a);let f;f=r>=0?-r-t:-r+t;const p=c+u+Il*Nl(f),{est:h,err:d}=rl(f,2*e,p,2*i),{est:g,err:v}=rl(2*o,f,2*s,p);if(n){if(h+d<0||h-d>1||g+v<0||g-v>1)return[]}else if((h+d<0||h-d>1)&&(g+v<0||g-v>1))return[]}let[p,h,d]=al(t);const g=pl(hl(h,h),dl(4,hl(p,d))),v=ct(g);if(v<0)return[];if(v>0){const t=ol(Vr(g));let e;p=Vr(p),h=Vr(h),d=Vr(d),e=ct(h)>=0?ml(xl(h,t)):xl(ml(h),t);let r=rt(wl(e,bl(p))),o=rt(wl(bl(d),e));if(n){if(r<-Sl||r>1+Sl||o<-Sl||o>1+Sl)return[]}else if((r<-Sl||r>1+Sl)&&(o<-Sl||o>1+Sl))return[];return[r,o]=r<o?[r,o]:[o,r],r>=0-Sl&&r<=1+Sl?o>=0-Sl&&o<=1+Sl?[r,o]:[r]:o>=0-Sl&&o<=1+Sl?[o]:[]}const m=Sr(p);if(ct(h)*ct(m)<0)return[];if(Gr(tl(h),tl(m))>0)return[];const x=Vr(h),b=Vr(m),w=wl(x,b),_=w[1]+w[0];return[_,_]}const El=Number.EPSILON;function Ol(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[6*(s-n+3*(r-i)),6*(i+n-2*r)],[6*(u-e+3*(o-c)),6*(c+e-2*o)]]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[[2*(i-2*r+n)],[2*(c-2*o+e)]]}if(t.length<=2)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}function Cl(t){if(4===t.length)return 0===hu(t[0],t[1],t[2])&&0===hu(t[1],t[2],t[3])&&0===hu(t[0],t[2],t[3]);if(3===t.length)return 0===hu(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 Tl(t){if(Cl(t))return{minima:[],maxima:[],inflections:[]};if(4===t.length&&Ku(t)&&(t=Hc(t)),3===t.length){const n=function(t){const[[n,e],[r,o],[i,c]]=t,s=i-r,u=s-(r-n),f=c-o,l=f-(o-e);return[u*u+l*l,-(n*(u-r)-r*(s-r)+e*(l-o)-o*(f-o))]}(t);return{minima:[],maxima:Ce(n,0,1)?.map(t=>t.t)||[],inflections:[]}}const n=function(t){const[[n,e,r],[o,i,c]]=uo(t),[[s,u],[f,l]]=Ol(t),[[a],[p]]=function(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[6*(s-n+3*(r-i))],[6*(u-e+3*(o-c))]]}if(t.length<=3)return[[0],[0]];throw new Error("The given bezier curve must be of order <= 3.")}(t),h=a*i,d=p*e,g=u*c,v=u*i,m=f*f,x=s*c,b=l*r,w=l*e,_=f*r,M=r*e,S=r*n,N=r*o,I=e*e,y=e*n,E=e*i,O=n*c,C=n*o,T=n*n,P=c*i,A=c*o,k=i*i,B=i*o,z=o*o,F=a*c-p*r,Y=u*r+l*c,L=g-b,X=r*r+c*c,H=E+O,D=A+k,V=S+I,$=e*o+n*i,q=T-z,j=y-B,W=M-P,Q=r*i+e*c,R=A+D,G=S+V,U=N+H,Z=E+H,J=G-R,K=H+O,tt=N+E+O,nt=2*w+_;return{inflectionPoly:[s*o-f*n,u*o+s*i-l*n-f*e,v+x-w-_,g-b],otherExtremaPoly:[T*(h-3*d)+z*(3*h-d)+2*(C*(a*e-p*i+3*(l*f-u*s))+3*s*f*j)+3*($*(m-s*s)+q*(u*f+l*s)),a*(o*(G+3*D)+n*Z)-p*(r*(3*T+z)+e*(3*y+2*B)+n*R)+3*(u*(l*q-u*C+2*(f*j-s*$))+s*(2*l*j+f*(2*(S-A)+(I-k))-s*tt)+l*(l*C+2*f*$)+m*U),a*(2*r*$+e*K+i*(4*A+R))-p*(2*r*(3*y+B)+e*(I+2*A)+i*K)+3*(u*(2*(l*j-s*tt)+f*J-u*$)+s*(2*f*W-s*Q)+l*(l*$+2*f*U+s*J)+m*Q),a*(r*(N+2*H)+c*(I+3*D))-p*(r*(3*V+R)+c*Z)+3*(u*(l*J-u*U+2*(f*W-s*Q))+s*(r*(nt-s*c)-c*(2*l*i+f*c))+l*(l*H+r*(2*f*i+l*o))+f*c*nt),X*(h-d)+2*(M+P)*F-3*(Y*(v+x-w-_)+(u*e+s*r+l*i+f*c)*L),F*X-3*Y*L]}}(t),e=n.inflectionPoly,r=n.otherExtremaPoly,o=Ce(r,0,1)?.map(t=>t.t)||[],i=function(t){const n=t.length-1;if(n<=0)return[];const e=new Array(n);for(let r=0;r<n;r++)e[r]=(n-r)*t[r];return e}(r),c=[],s=[];for(let t=0;t<o.length;t++){const n=o[t],r=R(i,n);R(e,n)*r>=0?c.push(n):s.push(n)}return{minima:c,maxima:s,inflections:Ce(e,0,1)?.map(t=>t.t)||[]}}function Pl(t,n){const[e,r]=uo(t),[o,i]=Ol(t),c=R(e,n),s=R(r,n),u=R(o,n);return(c*R(i,n)-s*u)/Math.sqrt((c*c+s*s)**3)}const{abs:Al}=Math,kl=L(function(t){const{curves:n}=t;let e=lo(n[0].ps).minY,r=n[0];for(let t=1;t<n.length;t++){const o=lo(n[t].ps).minY,i=o.box[0][1],c=e.box[0][1];(i<c||i===c&&o.ts[0]>e.ts[0])&&(e=o,r=n[t])}return{curve:r,y:e}});function Bl(t){const{curve:n,y:e}=kl(t),r=e.ts;return r[0]<=0?[Jf(0,n,0),Jf(1,n.prev,0)]:r[1]>=1?[Jf(1,n,0),Jf(0,n.next,0)]:[{x:{ri:{t:r[0],tS:r[0],tE:r[1],multiplicity:1},kind:0,box:e.box},curve:n},{x:{ri:{t:r[0],tS:r[0],tE:r[1],multiplicity:1},kind:0,box:e.box},curve:n}]}function zl(t,n,e){const r=e-(n-Math.floor(Math.log2(Math.abs(t))))+1;return r<=0?0:e>=53?t:mf(t,r)}function Fl(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=au(e,t=>po(t.ps)[0][0],t=>po(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=po(r),c=po(o);if(t.next!==n&&n.next!==t){if(To(!0,i,c)){const r=Uf(t,n,e,!1);return r.length?r:void 0}return}if(n.next===t&&([t,n]=[n,t],[r,o]=[o,r]),0!==hu(r[0],r[1],o[1]))return;if(!To(!1,i,c))return;let s;return s=du(r[0],r[1])>du(o[0],o[1])?[Hr(Xr(r,o[1])[0].ri),1]:[0,Hr(Xr(o,r[0])[0].ri)],[[Jf(1,t,5),Jf(0,n,5)],[Jf(s[0],t,5),Jf(s[1],n,5)]]}(n,e,t);if(n.next===e||e.next===n)return To(!1,po(r),po(o))&&Ru(mu(r,!1),mu(o,!1),!1)?e.next===n?Uf(e,n,t,!0):Uf(n,e,t,!0):Kf(n,e);let i=To(!0,po(r),po(o));return i?(i=Ru(mu(r,!1),mu(o,!1),!0),i?Uf(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=yl(e);if(0===r.length)continue;const o=r[0]===r[1]?3:2,i=r[0]-El,c=r[0]+El,s=r[1]-El,u=r[1]+El,f=Re(e,[i,c]),l=Re(e,[s,u]);n.push([{x:{ri:{t:i,tS:i,tE:c,multiplicity:1},box:f,kind:o},curve:t},{x:{ri:{t:s,tS:s,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([Jf(1,t,4),Jf(0,t.next,4)]);return n}(t),{extremes:c,xs:s}=function(t){const n=new Map,e=[];for(const r of t){const t=Bl(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=Tl(r),{minima:i,maxima:c}=o,s=[0,1,...i,...c];for(let o of s)Al(Pl(r,o))>1e7*2**-t&&e.push([Jf(o,n,7),Jf(o,n,7)])}return e}(e,t);let f=[...r,...o,...i,...s,...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 s)_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=au(l,Yl,Ll,Po);if(!t.length)break;const n=new Map;Ao(n,t);const e=zo(n),r=Fo(l,e);l=[...Yo(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=>zl(t,n,n-r)));return{...t,box:e}})}(l,e,n),"undefined"!=typeof _debug_&&(_debug_.generated.elems.container=l);let a=0;for(const t of l){for(const n of t.xs)n.container=t;let n;({inOuts:n,ioIdx:a}=lu(t,a)),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],n[t].prev=n[(t-1+e)%e]}}(f);for(const t of l)for(const n of t.inOuts){if(-1===n.dir)continue;const t=n;let e=t._x_;for(;e=e.next,void 0===e.in_;);t.nextOrPrev=e.in_,t.idx=t.nextOrPrev.idx}for(const t of l)for(const n of t.inOuts){if(1===n.dir)continue;const t=n;let e=t._x_;for(;e=e.prev,void 0===e.out;);t.nextOrPrev=e.out,t.idx=t.nextOrPrev.idx}return{extremes:c,containers:l}}function Yl(t){return t.box[0][0]}function Ll(t){return t.box[1][0]}function Xl(t,n,e){Zr(t,1);const r=t.inOuts,o=r[0],i=r[r.length-1],c=1===o.dir?o:i,s=i.dir,u=0===n.idx?new Set:1===n.orientation?n.loopsIdxs:new Set;return o.orientation=s,o.parent=n,o.windingNum=n.windingNum+s,o.loopsIdxs=new Set(u),o.children=new Set,1===s&&o.loopsIdxs?.add(e.idx),i.orientation=s,i.parent=n,i.windingNum=n.windingNum+s,i.loopsIdxs=new Set(u),i.children=new Set,1===s&&i.loopsIdxs?.add(e.idx),c}function Hl(t){if(!Cl(t))return!1;const n=t.map(t=>t[0]),e=t.map(t=>t[1]);return!(Dl(n)&&Dl(e))}function Dl(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 Vl(t,n){const e=n/Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[e*t[0],e*t[1]]}function $l(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:ql}=Math;function jl(t,n,e){if(void 0!==t&&!rf(t)){if(2===t.length)return t;if(3===t.length){if($l(t))return Cl(t)?[t[0],t[2]]:t;if(Ql(t[0],t[2]))return;return[t[0],t[2]]}if($l(t)){const r=Wl(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:jl(r,n,e)}if(Ql(t[0],t[3])){if(Cl(t))return;return t}if(Cl(t))return[t[0],t[3]];if(Ql(t[0],t[1])&&Ql(t[1],t[2])||Ql(t[1],t[2])&&Ql(t[2],t[3])||Ql(t[0],t[1])&&Ql(t[2],t[3]))return jl([t[0],t[t.length-1]],n,e);if(Ql(t[0],t[2])||Ql(t[1],t[3])||Ql(t[1],t[2]))return t;if(Ql(t[0],t[1])){if(du(t[1],t[2])<4*n)return[t[0],t[2],t[2],t[3]];{const r=Vl(H(t[1],t[2]),2*n),o=j(t[1],r);return Wl([t[0],e(o),t[2],t[3]])}}if(Ql(t[2],t[3])){if(du(t[2],t[1])<4*n)return[t[0],t[1],t[1],t[3]];{const r=Vl(H(t[2],t[1]),2*n),o=j(t[2],r);return Wl([t[0],t[1],e(o),t[3]])}}}}function Wl(t){return Cl(t)?[t[0],t[3]]:Ku(t)?Hc(t):t}function Ql(t,n){return t[0]===n[0]&&t[1]===n[1]}function Rl(t){return t}function Gl(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=>{const r=zl(e[0],t,n),o=zl(e[1],t,n);return r===e[0]&&o===e[1]?e:[r,o]}}(t,n):Rl;return t=>{const n=[];for(let e=0;e<t.length;e++){let i=t[e].slice();const c=n[n.length-1],s=c?c[c.length-1]:o(t[0][0]);i[0]=s,i=i.map(t=>o(t)),Hl(i)&&(i=[i[0],i[i.length-1]]),i=jl(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 c=t.slice();return c=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,c=0,s=0;for(;!(++c>10);){i=(t+Math.random())*(1+(Math.random()-.7)*r),i=zl(i,e,n);const c=bf(i);c>s&&(s=c,o=i)}return o}));t.push(i)}o.push(t)}return o}(c,n,e,1):c,c=c.map(i),c=c.filter(t=>t.length>0),c}const Ul=L(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 Zl(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{max:Jl}=Math;function Kl(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 c=0;c<e+1;c++)for(let s=0;s<r+1;s++)i[o-(c+s)]+=t[e-c]*n[r-s];return Zl(i)}function ta(t,n){const e=t.length-1,r=new Array(e+2);for(let n=0;n<e+1;n++)r[n]=t[n]/(e+1-n);return r[e+1]=n,r}const{min:na,max:ea}=Math;function ra(t,n){const e=t.length-1,r=n.length-1,o=ea(e,r),i=new Array(o+1),c=na(e,r);for(let s=0;s<=c;s++)i[o-s]=t[e-s]+n[r-s];for(let n=c+1;n<=e;n++)i[o-n]=t[e-n];for(let t=c+1;t<=r;t++)i[o-t]=n[r-t];return Zl(i)}function oa(t){let n=0;for(const e of t){const[t,r]=io(e),[o,i]=uo(e);n+=R(ta(ra(Kl(t,i),Sn(Kl(r,o))),0),1)}return n/2}function ia(t){let n=0;for(let e=0;e<t.length-1;e++)n+=Xt(t[e],t[e+1]);return n}function ca(t){const[n,e]=t[0],[r,o]=t[t.length-1];let i,c;const s=ia(t);if(256*du(t[0],t[t.length-1])<s*s){const[r,o]=Te(t,.5),s=Math.sqrt((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/s,c=(r-n)/s}else{const t=Math.sqrt((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/t,c=(r-n)/t}const u=function(t,n,e){const r=j(t[0].map(t=>-t));return ao(t.map(t=>Q(-n,e,r(t))))}(t,i,c),[[f,l],[a,p]]=u,h=[u[0],[a,l],u[1],[f,p]],d=Q(i,c);return h.map(n=>j(t[0],d(n)))}function sa(t){return{ps:t,ts:[0,1]}}const{atan2:ua}=Math,fa=Gt;function la(t,n){const e=t[0],r=t[1],o=n[0],i=n[1],c=Zt(fa(i,e),fa(o,r))[1],s=Ut(fa(o,e),fa(i,r))[1];return ua(c,s)}const aa=tt,pa=it,ha=lt,da=ct,ga=it,va=et,ma=nt,xa=Je,ba=nl,wa=J,_a=at,Ma=Math.abs,Sa=Fe(1),Na={order:0,realOrder:0,collinear:!0,nodeType:"n/a"},Ia={order:1,realOrder:1,collinear:!0,nodeType:"n/a"},ya={order:1,realOrder:0,collinear:!0,nodeType:"n/a"},Ea={order:2,realOrder:2,collinear:!1,nodeType:"n/a"},Oa={order:2,realOrder:2,collinear:!0,nodeType:"n/a"},Ca={order:2,realOrder:1,collinear:!0,nodeType:"n/a"},Ta={order:2,realOrder:0,collinear:!0,nodeType:"n/a"},Pa={order:3,realOrder:3,collinear:!1,nodeType:"crunode"},Aa={order:3,realOrder:3,collinear:!1,nodeType:"acnode"},ka={order:3,realOrder:3,collinear:!1,nodeType:"cusp"},Ba={order:3,realOrder:3,collinear:!1,nodeType:"explicit"},za={order:3,realOrder:3,collinear:!0,nodeType:"n/a"},Fa={order:3,realOrder:2,collinear:!1,nodeType:"n/a"},Ya={order:3,realOrder:2,collinear:!0,nodeType:"n/a"},La={order:3,realOrder:1,collinear:!0,nodeType:"n/a"},Xa={order:3,realOrder:0,collinear:!0,nodeType:"n/a"};const{abs:Ha,PI:Da}=Math;function Va(t,n=[0,1]){if(t.length<=2)return 0;const[e,r]=n;if(e===r)return 0;if(3===t.length){const n=$e(t,e,r).ps,[[o,i],[c,s],[u,f]]=n;return la([c-o,s-i],[u-c,f-s])}if(4===t.length){const n=He(t,e,r).ps,o=function(t){if(4===t.length)return Ku(t)?function(t){if(!Cl(t))return!1;const[n,e,r,o]=t,[i,c]=n,[s,u]=e,[f,l]=r,[a,p]=o,h=pa(aa(ha(s/4,f/4),3),ha(i/4,a/4)),d=pa(aa(ha(u/4,l/4),3),ha(c/4,p/4));return 0===da(pa(ha(i/2,a/2),h))&&0===da(pa(ha(c/2,p/2),d))}(t)?rf(t)?Xa:La:Cl(t)?Ya:Fa:Cl(t)?za:function(t){const{coeffs:[n,e,r],errBound:[o,i,c]}=ul(t);if(Ma(n)<=o){const[[n,e],[r,o],[i,c],[s,u]]=t,f=wa(xa(s,n),ma(3,xa(r,i))),l=_a(ba(i,n),-2*r),a=wa(xa(u,e),ma(3,xa(o,c))),p=_a(ba(c,e),-2*o);if(0===Gr(va(l,a),va(f,p)))return Ba}const s=e*e,u=4*n*r,f=s-u,l=2*i*Ma(e)+Sa*s+(4*(o*Ma(r)+Ma(n)*c)+Sa*Ma(u))+Sa*Ma(f);if(f<-l)return Aa;if(f>l)return Pa;const[a,p,h]=al(t),d=ct(ga(va(p,p),ma(4,va(a,h))));return d<0?Aa:d>0?Pa:ka}(t);if(3===t.length)return Cl(t)?ef(t)?rf(t)?Ta:Ca:Oa:Ea;if(2===t.length)return rf(t)?ya:Ia;if(1===t.length)return Na;throw new Error("The given bezier curve must be of order <= 3")}(n),[[i,c],[s,u],[f,l],[a,p]]=n,h=[s-i,u-c],d=[f-s,l-u],g=[a-f,p-l];if(0===d[0]&&0===d[1]||o.realOrder<=2)return la(h,g);const v=la(h,d)+la(d,g);return"acnode"===o.nodeType||"cusp"===o.nodeType?v<=-Da?v+2*Da:v>=+Da?v-2*Da:v:v}throw new Error("The given bezier curve must be of order <= 3.")}const{round:$a,PI:qa}=Math;const{abs:ja,max:Wa,ceil:Qa,log2:Ra}=Math;function Ga(n,e,r={}){let o;"undefined"!=typeof _debug_&&(o=performance.now()),e=e||Ul(n);const i=Qa(Ra(e)),{inclMicroCorners:c=!0,minLoopArea:s=(2**i*2**-12)**2,forceOrientationNegative:u=!1,booleanOp:f="OR",containerSizeMultiplier:l=16}=r,a=2**i*2**-46*l;(function(t){if("undefined"!=typeof _debug_)for(const n of t){_debug_.generated.elems.loopPre.push(...t),_debug_.generated.elems.loopsPre.push(t);for(const t of n){const n=po(t),e=ca(t),r=mu(t,!1);_debug_.generated.elems.bezier_.push(t),_debug_.generated.elems.looseBoundingBox_.push(n),_debug_.generated.elems.tightBoundingBox_.push(e),_debug_.generated.elems.boundingHull_.push(r)}}})(n=Gl(n,46,i,!1,!0)),n.sort(Io);const p=n.map((n,e)=>t(n,e)),{extremes:h,containers:d}=Fl(p,a,i),g={dir:void 0,idx:0,parent:void 0,children:new Set,windingNum:0,p:void 0,_x_:void 0,container:void 0,loopsIdxs:new Set,orientation:-1},v=new Set,m=new Set;for(const t of p){if(v.has(t))continue;v.add(t);const n=No(g,t),e=h.get(t)[0].container;if(0===e.inOuts.length)continue;const r=Xl(e,n,t),o=2===e.inOuts.length&&2===e.xs.length;if(o&&e.inOuts[0].nextOrPrev===e.inOuts[1])r.bezierPieces=t.beziers.map(sa),r.parent.children=r.parent.children||new Set,r.parent.children.add(r);else if(oo(r,v,m,!1),o&&void 0!==r.bezierPieces){const{bezierPieces:t}=r,n=t[t.length-1],e=t[0];if(n.ps===e.ps){const r={ps:n.ps,ts:[n.ts[0],e.ts[1]]};t.shift(),t.pop(),t.unshift(r)}}}"undefined"!=typeof _debug_&&_debug_.verbose;const x=function(t){const n=[],e=[t];for(;e.length;){const t=e.pop();0===t.windingNum&&n.push(...t.children),e.push(...t.children),0===t.windingNum&&(t.children=new Set)}return n}(g);"undefined"!=typeof _debug_&&_debug_.verbose;const b=function(t){return n=>{const e="OR"===t||"XOR"===t?[n]:[];n.used="OR"===t||"XOR"===t;const r=Array.from(n.children);for(;r.length;){const n=r.pop();if("OR"===t&&0===n.windingNum&&e.push(n),"AND"===t){const t=Co(n);(0===n.windingNum&&t||Eo(n.windingNum)>=2&&!t)&&(e.push(n),n.used=!0)}if("XOR"===t){const t=Co(n);(0===n.windingNum&&t||Eo(n.windingNum)>=2&&t)&&(e.push(n),n.used=!0)}for(const t of n.children)r.push(t)}return e}}(f),w=x.map(b).filter(t=>0!==t.length).map(n=>{const e=n[0].orientation;return n.map((n,r)=>function(n,e,r,o){const i=n.bezierPieces?.map(eo);if(void 0===i)return t([],r);const{orientation:c}=n,s=o?-1:e;return t((0===r?s:-s)*c>0?i:i.map(t=>t.toReversed()).toReversed(),r)}(n,e,r,u))}),_=[];for(let t=0;t<w.length;t++){const n=w[t].filter(t=>ja(oa(t.beziers))>s);n.length&&(n.sort((t,n)=>Io(t.beziers,n.beziers)),_.push(n))}"undefined"!=typeof _debug_&&(_debug_.generated.timing.simplifyPaths=performance.now()-o);const M=c?_:_.map(n=>n.map(n=>{const{beziers:e}=n,r=function(t,n){!function(t){$a(function(t){const n=t.length;let e=0;for(let r=0;r<n;r++){const o=t[(r-1+n)%n],i=t[r];e+=Va(i,[0,1])+la(fo(o,1),fo(i,0))}return e}(t)/(2*qa))}(t);const e=t.map(t=>t.map(t=>[t[0],t[1]])).filter(t=>ia(t)>n),r=e.length;for(let t=0;t<r;t++){const n=e[t],o=e[(t+1)%r],i=n[n.length-1],c=o[0];c[0]===i[0]&&c[1]===i[1]||(i[0]=c[0],i[1]=c[1])}return e}(e,Wa(...d.map(t=>ja(t.box[0][0]-t.box[1][0])),...d.map(t=>ja(t.box[0][1]-t.box[1][1]))));return t(r,n.idx)}));return function(t){if("undefined"!=typeof _debug_)for(const n of t)_debug_.generated.elems.loop.push(...n),_debug_.generated.elems.loops.push(n)}(M),M}const{max:Ua,abs:Za}=Math;function Ja(t){let n=0;for(let e=0;e<t.length-1;e++)n+=Xt(t[e],t[e+1]);return n}function Ka(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],[c,s],[u,f]]=t,l=e+(o-e)*n,a=o+(c-o)*n,p=l+(a-l)*n,h=r+(i-r)*n,d=i+(s-i)*n,g=h+(d-h)*n;return[p+(a+(c+(u-c)*n-a)*n-p)*n,g+(d+(s+(f-s)*n-d)*n-g)*n]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=e+(o-e)*n,f=r+(i-r)*n;return[u+(o+(c-o)*n-u)*n,f+(i+(s-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.")}function tp(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],d=n[0],g=n[1],v=c-d,m=u-d,x=l-d,b=p-d,w=s-g,_=f-g,M=a-g,S=h-g,N=v*v,I=6*v*m,y=6*x*b,E=w*w,O=6*w*_,C=6*M*S,T=6*m*b+9*x*x,P=2*v*b+18*m*x,A=6*v*x+9*m*m,k=6*_*S+9*M*M,B=2*w*S+18*_*M,z=6*w*M+9*_*_;return[6*(b*b-y+(N-I)+T+(A-P)+(S*S-C+(E-O)+k+(z-B))),5*(y+5*I+3*P-2*(T+2*A+3*N)+(C+5*O+3*B-2*(k+2*z+3*E))),4*(T-3*(P-2*A)-5*(2*I-3*N)+(k-3*(B-2*z)-5*(2*O-3*E))),3*(P-2*(2*A-5*(I-2*N))+(B-2*(2*z-5*(O-2*E)))),2*(A-5*(I-3*N)+(z-5*(O-3*E))),I-6*N+(O-6*E)]}function np(t,n){const e=t[0],r=t[1],o=t[2],i=e[0],c=e[1],s=r[0],u=r[1],f=o[0],l=o[1],a=n[0],p=n[1],h=i-a,d=s-a,g=f-a,v=c-p,m=u-p,x=l-p,b=h*h,w=h*d,_=d*g,M=v*v,S=v*m,N=m*x,I=v*x+m*m*2,y=h*g+d*d*2;return[x*x+M+2*I-4*(N+S)+(g*g+b+2*y-4*(_+w)),3*(N-I+(3*S-M)+(_-y+(3*w-b))),I-3*(2*S-M)+(y-3*(2*w-b)),S-M+(w-b)]}function ep(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=e-c,f=o-c,l=r-s,a=i-s,p=u*f+l*a,h=l*l+u*u;return[f*f+a*a+(h-2*p),p-h]}const{sqrt:rp}=Math;function op(t,n,e=!0){let r;if(4===t.length)r=tp(t,n);else if(3===t.length)r=np(t,n);else{if(2!==t.length){if(1===t.length)return{p:t[0],t:0,d:Xt(t[0],n)};throw new Error("The given bezier curve must be of order <= 3.")}r=ep(t,n)}const o=Ce(r,0,1)?.map(t=>t.t)||[];e&&(o.push(0),o.push(1));let i,c=Number.POSITIVE_INFINITY;for(const e of o){const r=Ka(t,e),o=du(r,n);o<c&&(c=o,i={p:r,t:e,d:rp(o)})}return i}const{sqrt:ip}=Math,{abs:cp}=Math;function sp(t){let n=Number.NEGATIVE_INFINITY;for(let e=0;e<t.length;e++){const r=t[e],o=cp(r[0]),i=cp(r[1]);o>n&&(n=o),i>n&&(n=i)}return n}const{max:up}=Math;function fp(t){return up(t.hL+t.hEL,t.hR+t.hER)}function lp(t,n){const e=fp(t)-fp(n);return 0!==e?e:t.tS-n.tS}class ap{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,c=t[i],s=t[e];if(this.compare(s,c)>0)break;t[i]=s,t[e]=c,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{max:pp}=Math;function hp(t,n,e,r=50){if(1===t.length)return op(n,t[0]).d;if(1===n.length)return function(t,n){let e;if(4===t.length)e=tp(t,n);else if(3===t.length)e=np(t,n);else{if(2!==t.length){if(1===t.length)return{p:t[0],t:0,d:Xt(t[0],n)};throw new Error("The given bezier curve must be of order <= 3.")}e=ep(t,n)}const r=Ce(e,0,1)?.map(t=>t.t)||[];r.push(0),r.push(1);let o,i=Number.NEGATIVE_INFINITY;for(const e of r){const r=Ka(t,e),c=du(r,n);c>i&&(i=c,o={p:r,t:e,d:ip(c)})}return o}(t,n[0]).d;if(2===t.length&&2===n.length){const e=op(n,t[0]).d,r=op(n,t[t.length-1]).d;return e>r?e:r}const o=pp(sp(t),sp(n));e=e||o/1e6;const[i,c]=dp(t,0,1),s={tS:0,tE:1,hL:op(n,t[0]).d,hR:op(n,t[t.length-1]).d,hEL:i,hER:c},u=new ap(lp);u.insert(s);let f=0,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(;;){const o=u.heap[0],{tS:i,tE:c,hL:s,hR:p}=o,h=(i+c)/2,[d,g]=dp(t,i,h),[v,m]=dp(t,h,c),x=Ka(t,h),b=Xt(x,op(n,x).p),w=pp(s,b,p);if(w>a&&(a=w),l=fp(o),l-a<e)return a;if(f++>r)return a;const _={tS:i,tE:h,hL:s,hR:b,hEL:d,hER:g},M={tS:h,tE:c,hL:b,hR:p,hEL:v,hER:m};u.swapMinOrMax(_),u.insert(M)}}function dp(t,n,e){const r=(e+n)/2,o=P(t,n,r),i=P(t,r,e);return[Ja(o),Ja(i)]}function gp(t,n=!1){const e=t;let r=e;const o=[];do{n&&r===e||x(r)||o.push(r),r=r.nextOnCircle}while(r!==e);return o}function vp(t){const n=[],e=[t],r=new Set;for(;e.length>0;){const t=Yt(e.pop());if(0===t.length)continue;n.push(t);const o=t[0],i=t[t.length-1].next.prevOnCircle;r.add(o),r.add(i);const c=gp(o,!0),s=gp(i,!0),u=c.filter(t=>!r.has(t)),f=s.filter(t=>!r.has(t));for(const t of u)r.add(t);for(const t of f)r.add(t);e.push(...u,...f)}return n}class mp{datum;color=0;parent;left;right;constructor(t){this.datum=t}}class xp{compare;root;constructor(t){this.compare=t,this.root=void 0}isEmpty(){return void 0===this.root}find(t){let n=this.root;for(;n;){const e=this.compare(t,n.datum);if(0===e)return n;n=e<0?n.left:n.right}}insert(t){if(void 0===this.root)return this.root=new mp(t),void(this.root.color=1);let n,e=this.root;for(;e;){n=e;const r=this.compare(t,e.datum);if(0===r)return void(e.datum=t);e=r<0?e.left:e.right}const r=new mp(t);r.parent=n,this.compare(t,n.datum)<0?n.left=r:n.right=r,this.fixInsert(r)}remove(t,n=!1,e){const r=this.find(t);if(void 0===r)return;const o=r.datum;return this.removeNode(r),o}findBounds(t){let n=this.root;const e=[void 0,void 0];for(;n;)this.compare(t,n.datum)>=0?(e[0]=n,n=n.right):(e[1]=n,n=n.left);return e}getMinNode(t){let n=void 0===t?this.root:t;for(;n&&n.left;)n=n.left;return n}getMaxNode(t){let n=void 0===t?this.root:t;for(;n&&n.right;)n=n.right;return n}removeNode(t){let n,e,r=t,o=r.color;void 0===t.left?(n=t.right,e=t.parent,this.transplant(t,t.right)):void 0===t.right?(n=t.left,e=t.parent,this.transplant(t,t.left)):(r=this.getMinNode(t.right),o=r.color,n=r.right,r.parent===t?(e=r,n&&(n.parent=r)):(e=r.parent,this.transplant(r,r.right),r.right=t.right,r.right.parent=r),this.transplant(t,r),r.left=t.left,r.left.parent=r,r.color=t.color),1===o&&this.fixDelete(n,e)}fixInsert(t){let n=t;for(;n.parent&&0===n.parent.color;){const t=n.parent,e=t.parent;if(t===e.left){const r=e.right;0===this.colorOf(r)?(t.color=1,r.color=1,e.color=0,n=e):(n===t.right&&(n=t,this.rotateLeft(n)),n.parent.color=1,e.color=0,this.rotateRight(e))}else{const r=e.left;0===this.colorOf(r)?(t.color=1,r.color=1,e.color=0,n=e):(n===t.left&&(n=t,this.rotateRight(n)),n.parent.color=1,e.color=0,this.rotateLeft(e))}}this.root.color=1}fixDelete(t,n){let e=t,r=n;for(;e!==this.root&&1===this.colorOf(e)&&void 0!==r;)if(e===r?.left){let t=r.right;0===this.colorOf(t)&&(t.color=1,r.color=0,this.rotateLeft(r),t=r.right),1===this.colorOf(t?.left)&&1===this.colorOf(t?.right)?(t&&(t.color=0),e=r,r=e?.parent):(1===this.colorOf(t?.right)&&(t?.left&&(t.left.color=1),t&&(t.color=0,this.rotateRight(t)),t=r.right),t&&(t.color=r.color),r.color=1,t?.right&&(t.right.color=1),this.rotateLeft(r),e=this.root,r=void 0)}else{let t=r?.left;0===this.colorOf(t)&&(t.color=1,r.color=0,this.rotateRight(r),t=r.left),1===this.colorOf(t?.left)&&1===this.colorOf(t?.right)?(t&&(t.color=0),e=r,r=r?.parent):(1===this.colorOf(t?.left)&&(t?.right&&(t.right.color=1),t&&(t.color=0,this.rotateLeft(t)),t=r?.left),t&&(t.color=r.color),r.color=1,t?.left&&(t.left.color=1),this.rotateRight(r),e=this.root,r=void 0)}e&&(e.color=1)}transplant(t,n){void 0===t.parent?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n&&(n.parent=t.parent)}rotateLeft(t){const n=t.right;t.right=n.left,n.left&&(n.left.parent=t),n.parent=t.parent,void 0===t.parent?this.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n}rotateRight(t){const n=t.left;t.left=n.right,n.right&&(n.right.parent=t),n.parent=t.parent,void 0===t.parent?this.root=n:t===t.parent.right?t.parent.right=n:t.parent.left=n,n.right=t,t.parent=n}colorOf(t){return t?t.color:1}}function bp(t){const n=new Map;return h(t).forEach(function(t){const e=t.pointOnShape.curve.loop;let r=n.get(e);r||(r=new xp(bn),n.set(e,r)),r.insert(t)}),n}const{max:wp}=Math;function _p(t,n=.125,e=50){let r=O(t.cpNode);for(;!x(r);)r=r.next;const o=vp(r),i=new Set;for(let t=0;t<o.length;t++){const r=o[t];let c=0;for(;c<r.length;){const t=c;for(;(c++,c!==r.length)&&!(Mp(t,c,r,e)>n);)i.add(r[c])}}r=function(t,n){const e=n;do{if(t(n))return n;n=n.next}while(n!==e)}(x,r);for(const n of i)_n(t=>2!==v(t)&&!t.isHoleClosing)(n)||B(n,t.meta);return{cpNode:r,meta:{...t.meta,cpTrees:bp(r)}}}function Mp(t,n,e,r){const o=[],i=Tt(e[t],e[n].next);for(;t<n+1;t++)o.push(hp(Pt(e[t]),i,r));return wp(...o)}function Sp(t){const n=[],e=h(t);for(const t of e)w(t)&&!t.isHoleClosing&&n.push(t);return n}const Np=function(t,n,e){const r=t.get(n);return void 0!==r&&r.has(e)},Ip=function(t,n,e){let r=t.get(n);void 0===r&&(r=new Set,t.set(n,r)),r.add(e)};function yp(t){let n=t,e=t.prevOnCircle;for(;x(e);)e=e.prevOnCircle;const r=[];do{x(n)||r.push(n),n=n.nextOnCircle}while(n!==e);return r}function Ep(t,n){const e=new Map,r=new Map;return N(t,function(t){const o=r.get(t)||n*t.pointOnShape.circle.radius,i=t.next,c=function(t,n,e=.4,r=16){if(4===n.length)return an(t,n,e,r);if(3===n.length)return sn(t,n,e,r);if(2===n.length)return Ht(t,n);if(1===n.length)return 0;throw new Error("The given bezier curve must be of order <= 3.")}([0,1],Pt(t)),s=i.pointOnShape.circle.radius;if(o-c>n*s)for(const t of m(i))if(r.set(t,o-c),!i.isHoleClosing){const{center:t}=i.pointOnShape.circle;Ip(e,t[0],t[1])}}),e}function Op(t,n){let e=0;"undefined"!=typeof _debug_&&(e=performance.now());const r=function(t){const n=h(t);return n.reduce(function(t,n){return t.pointOnShape.circle.radius>=n.pointOnShape.circle.radius?t:n},n[0])}(O(t.cpNode));!function(t,n){const e=Sp(n);for(;e.length;){const r=e.pop(),{center:o}=r.pointOnShape.circle;if(!Np(t,o[0],o[1])||r.isIntersection)continue;let i=r.prevOnCircle,c=!1;for(;!c;){i=i.next;const{center:e}=i.pointOnShape.circle;if(Np(t,e[0],e[1]))if(kt(i,n))c=!0;else{if(1===yp(i).length)continue;c=!0}else{for(;x(i.prevOnCircle);)i=i.prevOnCircle;c=!0}}if(c){const t=i.prevOnCircle;t.next=i,i.prev=t,t.nextOnCircle=i,i.prevOnCircle=t}}}(Ep(r,n),r);const o={cpNode:r,meta:{...t.meta,cpTrees:bp(r)}};return function(t){"undefined"!=typeof _debug_&&(_debug_.generated.timing.sats=performance.now()-t)}(e),o}const Cp={maxCurviness:.05,maxLength:40,applySat:!0,satScale:2,simplify:!0,simplifyTolerance:2**-4,minBezLength:2**-6,angleIncrement:15},Tp={maxCurviness:{range:[.01,3],scaleByMaxCoordinate:!1},maxLength:{range:[1,1024],scaleByMaxCoordinate:!0},angleIncrement:{range:[.1,360],scaleByMaxCoordinate:!1},satScale:{range:[1,1/0],scaleByMaxCoordinate:!1},simplifyTolerance:{range:[2**-20,2**20],scaleByMaxCoordinate:!0},minBezLength:{range:[2**-20,2],scaleByMaxCoordinate:!0}};function Pp(t){return[t[1],-t[0]]}function Ap(t,n){if(!It(n))return 0;const e=Nt(n);return e.isDull?-D(Pp(e.tangents[0]),W(H(n.p,t))):0}function kp(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Bp(t){return t[0]*t[0]+t[1]*t[1]}function z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t,ih=Mr,ch=Sr,sh=Z,uh=nt,fh=Mr;function lh(t){const n=[];for(let e=0;e<t.length;e++)n.push(4*t[e]);return n}const ah=Z,ph=Sr,{abs:hh}=Math;function dh(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=hh(e[0]),s=hh(e[1]),u=hh(r[0]),f=hh(r[1]),l=hh(o[0]),a=hh(o[1]),p=hh(i[0]),h=hh(i[1]),d=hh(n[0]),g=hh(n[1]),v=c+d,m=u+d,x=l+d,b=p+d,w=s+g,_=f+g,M=a+g,S=h+g,N=v*v,I=6*v*m,y=6*x*b,E=w*w,O=6*w*_,C=6*M*S,T=6*m*b+9*x*x,P=2*v*b+18*m*x,A=6*v*x+9*m*m,k=6*_*S+9*M*M,B=2*w*S+18*_*M,z=6*w*M+9*_*_;return[6*(b*b+y+(N+I)+T+(A+P)+(S*S+C+(E+O)+k+(z+B))),5*(y+5*I+3*P+2*(T+2*A+3*N)+(C+5*O+3*B+2*(k+2*z+3*E))),4*(T+3*(P+2*A)+5*(2*I+3*N)+(k+3*(B+2*z)+5*(2*O+3*E))),3*(P+2*(2*A+5*(I+2*N))+(B+2*(2*z+5*(O+2*E)))),2*(A+5*(I+3*N)+(z+5*(O+3*E))),I+6*N+(O+6*E)]}function gh(t,n){const e=t[0],r=t[1],o=t[2],i=hh(e[0]),c=hh(e[1]),s=hh(r[0]),u=hh(r[1]),f=hh(o[0]),l=hh(o[1]),a=hh(n[0]),p=hh(n[1]),h=i+a,d=s+a,g=f+a,v=c+p,m=u+p,x=l+p,b=h*h,w=h*d,_=d*g,M=v*v,S=v*m,N=m*x,I=v*x+m*m*2,y=h*g+d*d*2;return[x*x+M+2*I+4*(N+S)+(g*g+b+2*y+4*(_+w)),3*(N+I+(3*S+M)+(_+y+(3*w+b))),I+3*(2*S+M)+(y+3*(2*w+b)),S+M+(w+b)]}function vh(t,n){const e=t[0],r=t[1],o=hh(e[0]),i=hh(e[1]),c=hh(r[0]),s=hh(r[1]),u=hh(n[0]),f=hh(n[1]),l=o+u,a=c+u,p=i+f,h=s+f,d=l*a+p*h,g=p*p+l*l;return[a*a+h*h+2*d+g,d+g]}const{abs:mh}=Math;function xh(t,n){if(0===n[0]&&0===n[1])return[0,0];if(0===n[0]&&1===n[1])return[0,0];const e=mh(n[1]);if(4===t.length){const[[n,r],[o,i],[c,s],[u,f]]=t,l=mh(n),a=mh(r),p=mh(o),h=mh(i),d=mh(c),g=mh(s),v=l+(p+l)*e,m=p+(d+p)*e,x=v+(m+v)*e,b=a+(h+a)*e,w=h+(g+h)*e,_=b+(w+b)*e;return[x+(m+(d+(mh(u)+d)*e+m)*e+x)*e,_+(w+(g+(mh(f)+g)*e+w)*e+_)*e]}if(3===t.length){const[[n,r],[o,i],[c,s]]=t,u=mh(n),f=mh(r),l=mh(o),a=mh(i),p=u+(l+u)*e,h=f+(a+f)*e;return[p+(l+(mh(c)+l)*e+p)*e,h+(a+(mh(s)+a)*e+h)*e]}if(2===t.length){const[[n,r],[o,i]]=t,c=mh(n),s=mh(r);return[c+(mh(o)+c)*e,s+(mh(i)+s)*e]}if(1===t.length)return[0,0];throw new Error("The given bezier curve must be of order <= 3.")}Number.EPSILON;const bh=Number.EPSILON/2,wh=function(){const t=1*bh;return t/(1-t)}(),{abs:_h}=Math,Mh=[[0,0],[0,0]];const{min:Sh,max:Nh}=Math;function Ih(t,n){return n[0]!==n[1]?4===t.length?function(t,n){const{ps:e,_ps:r}=ln(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=e[3][0],u=9*bh*r[0][0],f=9*bh*r[1][0],l=9*bh*r[2][0],a=9*bh*r[3][0],p=e[0][1],h=e[1][1],d=e[2][1],g=e[3][1],v=9*bh*r[0][1],m=9*bh*r[1][1],x=9*bh*r[2][1],b=9*bh*r[3][1],w=Sh(o-u,i-f,c-l,s-a),_=Nh(o+u,i+f,c+l,s+a);return[[w,Sh(p-v,h-m,d-x,g-b)],[_,Nh(p+v,h+m,d+x,g+b)]]}(t,n):3===t.length?function(t,n){const{ps:e,_ps:r}=Qt(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=e[2][0],s=5*bh*r[0][0],u=5*bh*r[1][0],f=5*bh*r[2][0],l=e[0][1],a=e[1][1],p=e[2][1],h=5*bh*r[0][1],d=5*bh*r[1][1],g=5*bh*r[2][1],v=Sh(o-s,i-u,c-f),m=Nh(o+s,i+u,c+f);return[[v,Sh(l-h,a-d,p-g)],[m,Nh(l+h,a+d,p+g)]]}(t,n):function(t,n){const{ps:e,_ps:r}=function(t,n,e){return 0===n?1===e?{ps:t,_ps:Mh}:function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[o,i],[n*(c-o)+o,n*(s-i)+i]],f=_h(n),l=_h(o),a=_h(c),p=_h(i);return{ps:u,_ps:[[0,0],[f*(a+l)+l,f*(_h(s)+p)+p]]}}(t,e):1===e?function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=[[n*(c-o)+o,n*(s-i)+i],[c,s]],f=_h(n),l=_h(o),a=_h(c),p=_h(i);return{ps:u,_ps:[[f*(a+l)+l,f*(_h(s)+p)+p],[0,0]]}}(t,n):function(t,n,e){const r=t[0],o=t[1],i=r[0],c=r[1],s=o[0],u=o[1],f=[[n*(s-i)+i,n*(u-c)+c],[e*(s-i)+i,e*(u-c)+c]],l=_h(n),a=_h(e),p=_h(i),h=_h(s),d=_h(c),g=_h(u);return{ps:f,_ps:[[l*(h+p)+p,l*(g+d)+d],[a*(h+p)+p,a*(g+d)+d]]}}(t,n,e)}(t,n[0],n[1]),o=e[0][0],i=e[1][0],c=3*bh*r[0][0],s=3*bh*r[1][0],u=e[0][1],f=e[1][1],l=3*bh*r[0][1],a=3*bh*r[1][1],p=Sh(o-c,i-s),h=Nh(o+c,i+s);return[[p,Sh(u-l,f-a)],[h,Nh(u+l,f+a)]]}(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=Ka(t,n);let i;if(4===t.length)i=xh(t,[0,n]).map(t=>8*wh*t);else if(3===t.length)i=xh(t,[0,n]).map(t=>5*wh*t);else if(2===t.length)i=xh(t,[0,n]).map(t=>2*wh*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 yh=jn,Eh=Ut,Oh=Zt,Ch=Je,Th=Xo;function Ph(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],[c,s],[u,f]]=t,l=Th(yh(Ch(o,e),n),e),a=Th(yh(Ch(c,o),n),o),p=Th(yh(Ch(u,c),n),c),h=Eh(l,yh(Oh(a,l),n)),d=Eh(a,yh(Oh(p,a),n)),g=Eh(h,yh(Oh(d,h),n)),v=Th(yh(Ch(i,r),n),r),m=Th(yh(Ch(s,i),n),i),x=Th(yh(Ch(f,s),n),s),b=Eh(v,yh(Oh(m,v),n)),w=Eh(m,yh(Oh(x,m),n));return[g,Eh(b,yh(Oh(w,b),n))]}if(3===t.length){const[[e,r],[o,i],[c,s]]=t,u=Eh([0,e],yh(Ch(o,e),n)),f=Eh([0,o],yh(Ch(c,o),n)),l=Eh(u,yh(Oh(f,u),n)),a=Eh([0,r],yh(Ch(i,r),n)),p=Eh([0,i],yh(Ch(s,i),n));return[l,Eh(a,yh(Oh(p,a),n))]}if(2===t.length){const[[e,r],[o,i]]=t;return[Th(yh(Ch(o,e),n),e),Th(yh(Ch(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.")}const Ah=Je,kh=jn,Bh=Ut,zh=Number.EPSILON;function Fh(t,n){const[e,r]=t,[o,i]=n,c=Je(e,o),s=Je(r,i);return Ut(jn(c,c),jn(s,s))[1]}const Yh=Number.EPSILON;function Lh(t,n,e){const[r,o]=e,{ps:i}=t,c=[];if(r!==o){const{polyDd:e,polyE:s,getPolyExact:u}=function(t,n){const e=t.length-1;if(3===e)return{polyDd:qp(t,n),polyE:dh(t,n).map(t=>20*t),getPolyExact:()=>function(t,n){const e=t[0],r=t[1],o=t[2],i=t[3],c=e[0],s=e[1],u=r[0],f=r[1],l=o[0],a=o[1],p=i[0],h=i[1],[d,g]=n,v=rh(c,d),m=rh(u,d),x=rh(l,d),b=rh(p,d),w=rh(s,g),_=rh(f,g),M=rh(a,g),S=rh(h,g),N=et(v,v),I=oh(6,et(v,m)),y=oh(6,et(v,x)),E=ih(et(v,b)),O=oh(9,et(m,m)),C=oh(18,et(m,x)),T=oh(6,et(m,b)),P=oh(9,et(x,x)),A=oh(6,et(x,b)),k=et(b,b),B=et(w,w),z=oh(6,et(w,_)),F=oh(6,et(w,M)),Y=ih(et(w,S)),L=oh(9,et(_,_)),X=oh(18,et(_,M)),H=oh(6,et(_,S)),D=oh(9,et(M,M)),V=oh(6,et(M,S)),$=et(S,S),q=J(T,P),j=J(E,C),W=J(y,O),Q=J(H,D),R=J(Y,X),G=J(F,L),U=it(J(J(k,N),J(q,W)),J(J(j,A),I)),Z=it(J(J($,B),J(Q,G)),J(J(R,V),z)),K=oh(6,J(U,Z)),tt=J(ch(J(J(q,ih(W)),oh(3,N))),J(J(A,oh(3,j)),oh(5,I))),nt=J(ch(J(J(Q,ih(G)),oh(3,B))),J(J(V,oh(3,R)),oh(5,z))),rt=oh(5,J(tt,nt)),ot=J(J(q,oh(3,it(ih(W),j))),oh(5,it(oh(3,N),ih(I)))),ct=J(J(Q,oh(3,it(ih(G),R))),oh(5,it(oh(3,B),ih(z)))),st=oh(4,J(ot,ct)),ut=it(j,ih(it(ih(W),oh(5,it(I,ih(N)))))),ft=it(R,ih(it(ih(G),oh(5,it(z,ih(B)))))),lt=oh(3,J(ut,ft)),at=it(W,oh(5,it(I,oh(3,N)))),pt=it(G,oh(5,it(z,oh(3,B))));return[K,rt,st,lt,ih(J(at,pt)),J(it(I,oh(6,N)),it(z,oh(6,B)))].map(Pn)}(t,n)};if(2===e)return{polyDd:Jp(t,n),polyE:gh(t,n).map(t=>16*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i],[c,s]]=t,[u,f]=n,l=sh(e,u),a=sh(o,u),p=sh(c,u),h=sh(r,f),d=sh(i,f),g=sh(s,f),v=et(l,l),m=et(l,a),x=et(l,p),b=et(a,a),w=et(a,p),_=et(p,p),M=et(h,h),S=et(h,d),N=et(h,g),I=et(d,d),y=et(d,g),E=et(g,g),O=J(N,fh(I)),C=J(x,fh(b)),T=J(it(J(_,fh(C)),lh(J(w,m))),v),P=J(it(J(E,fh(O)),lh(J(y,S))),M),A=J(T,P),k=J(it(w,C),it(uh(3,m),v)),B=J(it(y,O),it(uh(3,S),M));return[A,uh(3,J(k,B)),J(it(O,uh(3,it(fh(S),M))),it(C,uh(3,it(fh(m),v)))),J(it(S,M),it(m,v))].map(Pn)}(t,n)};if(1===e)return{polyDd:eh(t,n),polyE:vh(t,n).map(t=>12*t),getPolyExact:()=>function(t,n){const[[e,r],[o,i]]=t,[c,s]=n,u=ah(e,c),f=ah(o,c),l=ah(r,s),a=ah(i,s),p=et(u,u),h=et(u,f),d=et(f,f),g=et(l,l),v=et(l,a),m=et(a,a),x=J(h,v),b=J(g,p);return[J(J(d,m),J(ph(x),b)),it(x,b)].map(Pn)}(t,n)};if(0===e)return{polyDd:[[0,1]],polyE:[0],getPolyExact:()=>[[1]]};throw new Error("The given bezier curve must be of order 1, 2 or 3")}(i,n),f=Ce(e,r,o,s,u)||[];c.push(...f.map(e=>{const{tS:r,tE:o,t:c}=e,s=c<0?0:c>1?1:c,u=function(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=n[0],f=n[1];let l=1/0,a=-1/0;for(const[t,n]of[[o,i],[o,s],[c,i],[c,s]]){const e=Ah(t,u),r=Ah(n,f),o=Bh(kh(e,e),kh(r,r))[1],i=o*(1-zh),c=o*(1+zh);i<=l&&(l=i),c>=a&&(a=c)}return[l,a]}(Ih(i,[r,o]),n),f=0===s?1:s;return{curve:0===s?t.prev:t,t:f,dSquaredI:u}}))}const s=e.slice();return r===o&&s.push(r),c.push(...s.map(e=>{const r=Fh(Ph(i,[0,e]).map(t=>t[0]+t[1]),n),o=[r*(1-Yh),r*(1+Yh)],c=0===e?1:e;return{curve:0===e?t.prev:t,t:c,dSquaredI:o}})),c}const{min:Xh}=Math,Hh=1+2**-20;function Dh(t,n){const e=t[0],r=t[1],o=e[0],i=e[1],c=r[0],s=r[1],u=n[0],f=n[1];return u<o?f<i?du(t[0],n):f>s?du([o,s],n):(o-u)**2:u>c?f<i?du([c,i],n):f>s?du(t[1],n):(u-c)**2:f<i?(i-f)**2:f>s?(f-s)**2:0}function Vh(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]=G(t),c=Ce(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=Ih(t,i);s[0][0]<r.box[0][0]&&(r={ts:i,box:s}),s[1][0]>o.box[0][0]&&(o={ts:i,box:s})}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]=G(t),c=Ce(i,0,1)||[];for(let n=0;n<c.length;n++){const e=c[n],i=[e.tS,e.tE],s=Ih(t,i);s[0][1]<r.box[0][1]&&(r={ts:i,box:s}),s[1][1]>o.box[0][1]&&(o={ts:i,box:s})}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 $h=L(Vh),{sqrt:qh}=Math;function jh(t){const[n,e]=t[0],[r,o]=t[t.length-1];let i,c;const s=Ja(t);if(256*du(t[0],t[t.length-1])<s*s){const[r,o]=Ka(t,.5),s=qh((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/s,c=(r-n)/s}else{const t=qh((r-n)*(r-n)+(o-e)*(o-e));i=(o-e)/t,c=(r-n)/t}const u=function(t,n,e){const r=j(t[0].map(t=>-t));return Vh(t.map(t=>Q(-n,e,r(t))))}(t,i,c),[[f,l],[a,p]]=u,h=[u[0],[a,l],u[1],[f,p]],d=Q(i,c);return h.map(n=>j(t[0],d(n)))}function Wh(t,n){const e=[0,1,2,3].map(e=>function(t,n){const e=du,r=n[0],o=n[1],i=e(r,o);if(0==i)return e(t,r);let c=((t[0]-r[0])*(o[0]-r[0])+(t[1]-r[1])*(o[1]-r[1]))/i;return c=Math.max(0,Math.min(1,c)),e(t,[r[0]+c*(o[0]-r[0]),r[1]+c*(o[1]-r[1])])}(n,[t[e],t[(e+1)%4]])),r=du(t[0],t[1]),o=du(t[0],t[3]);return e[0]<=o&&e[2]<=o&&e[1]<=r&&e[3]<=r?0:Math.min(...e)}const Qh=L(jh);function Rh(t,n){return Ph(t,[0,n]).map(t=>t[0]+t[1])}function Gh(t,n){t=function(t,n){const e=function(t,n){let e=1/0;for(let r=0;r<t.length;r++){const o=t[r],{curve:{ps:i},ts:c}=o,s=Ka(i,c[0]),u=Ka(i,c[1]);e=Xh(e,du(n,s),du(n,u))}return Hh*e}(t,n);return t=function(t,n,e){const r=[];for(let o=0;o<t.length;o++){const i=t[o],{ps:c}=i.curve;Dh($h(c),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],c=i.curve.ps;Wh(Qh(c),n)<=e&&r.push(i)}return r}(t,n,e),t}(t,n);const e=[];for(let r=0;r<t.length;r++){const o=t[r],i=Lh(o.curve,n,o.ts);e.push(...i)}let r=1/0;for(let t=0;t<e.length;t++){const n=e[t].dSquaredI[1];n<r&&(r=n)}const o=[];for(let t=0;t<e.length;t++){const n=e[t];n.dSquaredI[0]<=r&&o.push(n)}return o.map(t=>{const{curve:n,t:e}=t,{ps:r}=n;return{p:Rh(r,e),t:e,curve:n,isSource:!1}})}function Uh(t,n){return n.map(n=>Gh(n,t)[0])}function Zh(t,n){return[n*t[0],n*t[1]]}function Jh(t,n,e){const r=kp(e);let o,i,c,s,u=1,f=0;do{i=j(Zh(e,u),n),c=t.map(t=>Gh(t,n)[0]),s=kp(H(i,Fp(c.map(t=>t.p)))),o=s<r,u/=2,f++}while(!o&&f<3);return{newX:i,newV:s,newPoss:c}}const{min:Kh,abs:td,asin:nd}=Math;function ed(t,n,e,r,o){const i=2**(o-32),c=[t[0],t[n],t[t.length-1]],s=[r[0],r[n],r[t.length-1]],u=[[c[0],c[1],c[2]],[c[1],c[2],c[0]],[c[2],c[0],c[1]]][e],f=[[s[0],s[1],s[2]],[s[1],s[2],s[0]],[s[2],s[0],s[1]]][e];if(_(u[0][0]))return;let l,a=0,p=function(t,n){const e=t[0][0].pointOnShape.circle.center,r=Gh(n[1],e)[0],o=[t[0][0].pointOnShape.p,r.p,t[2][1].pointOnShape.p];return Fp(o)}(u,f),h=1/0;for(;h>i&&a<10;){if(a++,l=Uh(p,f),!Number.isFinite(p[0])||!Number.isFinite(p[1]))return;const t=Fp(l.map(t=>t.p)),n=H(p,t);if(!Number.isFinite(n[0])||!Number.isFinite(n[1]))return;const e=Jh(f,p,n);p=e.newX,l=e.newPoss;const r=kp(n);h=td(r-e.newV)}const d=(Xt(p,l[0].p)+Xt(p,l[1].p)+Xt(p,l[2].p))/3,g={center:p,radius:d};let v=0;for(let t=0;t<3;t++){const n=l[t],e=W(H(n.p,p)),r=V(e);if(It(n)&&Nt(n).isDull){const t=St(n.curve.ps,n.curve.next.ps).tangents.map(V),r=nd($(t[0],e)),o=nd($(e,t[1]));let i=0;r>0&&(i+=r),o>0&&(i+=o),v+=i}else{const t=W(U(n.curve.ps,n.t));v+=td(nd($(r,t)))}}const m=[];for(let t=0;t<r.length;t++){const n=Gh(r[t],p)[0];m.push(Xt(n.p,p))}const x=Kh(...m);return{threeProngInfo:{poss:l,circle:g,δ3s:u},error:1*td(d-x)+1*v}}function rd(t){let n=t[0];const e=t[1],r=[];let o=!0;do{const t=n.pointOnShape,e=n.next.pointOnShape,i=t.curve,c=e.curve;if(o)if(o=!1,c===i&&xn(e,t)>0)r.push({curve:i,ts:[t.t,e.t]}),n=n.next;else{if(i.loop===c.loop){const n={curve:i,ts:[t.t,1]};r.push(n),od(r,i,c,e.t)}n=n.next}else o=!0,n=n.prevOnCircle}while(n!==e);return r}function od(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 id(t,n,e,r){const o={...n,order:e,order2:r},i=t.findBounds({pointOnShape:o});if(void 0!==i[0]||void 0!==i[1])return void 0===i[0]||void 0===i[1]?t.getMaxNode()?.datum:i[0].datum}function cd(t,n,e,r,o,i,c){if(void 0!==i&&!function(t,n,e){const r=xn(n,e.pointOnShape);if(r<0)return!0;if(0===r)return!1;const o=t.getMinNode();if(void 0===o)return!0;const i=o.datum;return xn(t.getMaxNode().datum.pointOnShape,n)<0&&i===e}(r,o,i.next)&&!t)return;const s={pointOnShape:o,isHoleClosing:n,isIntersection:e,id:c.id,next:void 0,prev:void 0,nextOnCircle:void 0,prevOnCircle:void 0};c.id++;const u=void 0===i?s:i,f=void 0===i?s:u.next;return f.prev=s,u.next=s,s.prev=u,s.next=f,r.insert(s),s}function sd(t,n,e,r,o,i,c){const{cpTrees:s}=o;let u=!1;const f=i.map((i,f)=>{const l=r[f],a=s.get(i.curve.loop),p={...i,circle:e,order:l,order2:0},h=void 0===c?id(a,i,l,0):c[f],d=cd(t,n,!1,a,p,h,o.lastInsertId);return void 0===d&&(u=!0),d});return u||function(t,n){n=n.slice().sort(function(t){const n=t.center;return function(t,e){let r=t.pointOnShape.p,o=e.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}}(t));const e=n.length;for(let t=0;t<e;t++){const r=n[t];r.nextOnCircle=n[(t+1)%e],r.prevOnCircle=n[(t-1+e)%e]}}(e,f),{anyFailed:u,cpNodes:f}}const ud=Math.cos(Math.PI/180*1);function fd(t,n,e,r,o,i){const{cpTrees:c,maxCoordPowerOf2:s}=t,u=2**(s-40),f=2**(s-46),l=id(c.get(n.curve.loop),n,r,o);if(!l)return;const a=[l,l.next],{p,t:h}=n;for(const t of a){const n=t.pointOnShape.p,r=Xt(p,n);if(!(r>u)&&(D(W(H(n,t.pointOnShape.circle.center)),W(H(p,e.center)))>ud||r<f&&0!==h&&1!==h))return t}}function ld(t,n){const e=[];for(const t of n)e.push([t,t.next]);const r=function(t,n){const e=t.map(rd);let r,o=1/0;for(let i=1;i<t.length-1;i++)for(let c=0;c<3;c++){const s=ed(t,i,c,e,n);if(void 0===s)continue;const{error:u,threeProngInfo:f}=s;u<o&&(o=u,r=f)}return r}(e,t.maxCoordPowerOf2),{circle:o,poss:i,δ3s:c}=r,s=[];for(let t=0;t<3;t++)s.push(Ap(o.center,i[t]));const u=[];for(let n=0;n<i.length;n++){const e=fd(t,i[n],o,s[n],0);void 0!==e&&v(e)<=2&&!e.isHoleClosing&&u.push(e)}return{closeBysFor3Prong:u,cpNodes:0===u.length?sd(!0,!1,o,s,t,i,c.map(t=>t[0])).cpNodes:[]}}let ad=0;function pd(t,n){if(yt(n.pointOnShape))return{closeBysFor3Prong:void 0,addedCpNodes:[]};const e=[];for(;;){if(void 0===n)continue;const r=S(n);if(r.length<=2)break;const{closeBysFor3Prong:o,cpNodes:i}=ld(t,r);if(e.push(i),o.length>0)return{closeBysFor3Prong:o,addedCpNodes:e};if("undefined"!=typeof _debug_&&++ad===_debug_.directives.stopAfterThreeProngsNum)return}return{closeBysFor3Prong:void 0,addedCpNodes:e}}function hd(t){for(const n of t)return n}function dd(t,n,e,r){const o=n[0];m(o).forEach(t=>{e.delete(t),r.delete(t)}),B(o,t)}function gd(t,n,e){const r=new Map;for(let o=0;o<n.length;o++){const i=new xp(bn);r.set(t[o],i);const c=n[o];let s,u;for(const t of c){const n={center:t.p,radius:0},{curve:r}=t,o={...t,curve:r,t:1,circle:n,order:-1,order2:0},c={...t,curve:r.next,t:0,circle:n,order:1,order2:0};s=cd(!0,!1,!1,i,o,u,e),u=cd(!0,!1,!1,i,c,s,e),s.prevOnCircle=u,u.prevOnCircle=s,s.nextOnCircle=u,u.nextOnCircle=s}}return r}const vd=gu;let md;function xd(t,n){md=performance.now()}function bd(t){const n=[],e=[],r=[],o=[],i=[];for(const c of t)for(const t of c.curves){const c=t.ps,s=vd(c,!0);r.push(s);const u=$h(c);n.push(u);const f=jh(c);e.push(f);const l=St(t.ps,t.next.ps);l.isQuiteSharp?o.push(t):l.isQuiteDull&&i.push(t)}return{looseBoundingBoxes:n,tightBoundingBoxes:e,boundingHulls:r,sharpCorners:o,dullCorners:i}}function wd(t){return n=>{const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];Ja(o.ps)<t||St(o.ps,o.next.ps).isQuiteSharp&&e.push({curve:o,t:1,isSource:!0,p:Rh(o.ps,1)})}return e}}function _d(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[s-n+3*(r-i),3*(i+n-2*r),3*(r-n),n],[u-e+3*(o-c),3*(c+e-2*o),3*(o-e),e]]}function Md(t){const[[n,e],[r,o],[i,c]]=t;return[[i+n-2*r,2*(r-n),n],[c+e-2*o,2*(o-e),e]]}function Sd(t,n,e){const[r,o]=t,[i,c]=n,[s,u]=e,f=r-s,l=o-u;return{a0:2*(i*f+c*l),b0:f*f+l*l}}const Nd=[,,function(t,n,e){const[r,o]=t,[i,c]=n,[[s,u],[f,l]]=e,a=f-s,p=l-u,h=r-s,d=o-u,g=i*a+c*p,v=-(a*a+p*p),m=a*h+p*d,x=2*(i*h+c*d),b=-v,w=h*h+d*d;return{A:[-2*g,x],B:[b,-2*m,w],C:[g],D:[v,m],H:[b*g,x*v,x*m-w*g]}},function(t,n,e){const[r,o]=t,[i,c]=n,[[s,u]]=e,[[f,l],[a,p]]=Md(e),h=r-s,d=o-u,g=2*(i*f+c*a),v=i*l+c*p,m=i*h+c*d,x=f*f+a*a,b=f*l+a*p,w=h*l+d*p,_=h*h+d*d,M=2*(h*f+d*a)-(l*l+p*p),S=-M;return{A:[-g,-2*v,2*m],B:[x,2*b,S,-2*w,_],C:[g,v],D:[-2*x,-3*b,M,w],H:[x*g,b*g+3*x*v,4*(b*v-m*x),g*w+v*S-6*m*b,-2*m*S-g*_,2*m*w-v*_]}},function(t,n,e){const[r,o]=t,[i,c]=n,[[s,u,f,l],[a,p,h,d]]=_d(e),g=r-l,v=o-d,m=i*s+c*a,x=i*u+c*p,b=i*f+c*h,w=i*g+c*v,_=s*s+a*a,M=s*u+a*p,S=s*f+a*h,N=u*u+p*p,I=u*f+p*h,y=f*f+h*h,E=s*g+a*v,O=u*g+p*v,C=f*g+h*v,T=g*g+v*v,P=2*S+N,A=2*I-2*E,k=y-2*O,B=-2*C;return{A:[-2*m,-2*x,-2*b,2*w],B:[_,2*M,P,A,k,B,T],C:[3*m,2*x,b],D:[-3*_,-5*M,-4*S-2*N,3*E-3*I,2*O-y,C],H:[3*m*_,4*(m*M+x*_),m*P+6*x*M+5*b*_,2*x*P+8*b*M-6*w*_,-m*k+x*A+3*b*P-10*w*M,-2*m*B+2*b*A-4*w*P,b*k-x*B-3*w*A-3*m*T,-2*w*k-2*x*T,-w*B-b*T]}}],{sqrt:Id,abs:yd,max:Ed}=Math;function Od(t,n,e,r,o,i){const{curve:c,ts:[s,u]}=i,{ps:f}=c,{curve:l,t:a,p}=e,h=c===l,d=0===o&&h,g=[];let v,m=!1,x=!1;if(!(s===u||d&&2===f.length||h&&3===f.length&&r)){const{A:e,B:r,H:o}=d?3===f.length?function(t,n,e){const[[r,o],[i,c]]=Md(e),[s,u]=n,f=r*t+o,l=i*t+c,a=r*r+i*i,p=2*(s*r+u*i);return{A:[-p],B:[a,2*(r*f+i*l),f*f+l*l],H:[a*p,p*(a*t+(r*o+i*c))]}}(a,n,f):function(t,n,e){const[r,o]=n,[[i,c,s],[u,f,l]]=_d(e),a=r*i+o*u,p=r*c+o*f,h=r*s+o*l,d=i*i+u*u,g=i*c+u*f,v=i*s+u*l,m=c*c+f*f,x=c*s+f*l,b=s*s+l*l,w=t*(t*(t*a+p)+h),_=t*(t*(t*d+g)+v),M=t*(t*(t*g+m)+x),S=3*a,N=-3*d,I=-5*g+t*N,y=-4*v-2*m+t*I,E=-3*x+3*_+t*y,O=-2*a,C=2*v+m,T=2*x-2*_,P=b-2*M,A=2*g+2*t*d,k=C+t*(2*A-t*d),B=T+t*(2*k-t*A),z=3*a*d,F=4*(a*g+p*d)+4*t*z,Y=a*C+6*p*g+5*h*d+t*(4*F-6*t*z),L=2*p*C+8*h*g-6*w*d+t*(4*Y+t*(-6*F+4*t*z));return{A:[O,-2*p+2*t*O],B:[d,A,k,B,P+t*(2*B-t*k)],C:[S,2*p+t*S],D:[N,I,y,E,2*M-b+t*E],H:[z,F,Y,L,-a*P+p*T+3*h*C-10*w*g+t*(4*L+t*(-6*Y+t*(4*F-t*z)))]}}(a,n,f):function(t,n,e){if(1===e.length){const{a0:r,b0:o}=Sd(t,n,e[0]);return{A:[r],B:[o],C:[],D:[],H:[]}}return Nd[e.length](t,n,e)}(p,n,f);v=Ce(o,s,u)||[];for(let o=0;o<v.length;o++){const i=v[o],{tS:f,tE:l,t:a}=i;if(i.multiplicity>1)continue;if(l<s||f>u)continue;if(f<0)continue;const h=l>1?1:a,d=R(e,h),b=R(r,h),w=yd(d);if(Ed(w)<2**-40)continue;const _=-b/d;if(_<=0)continue;const M=[_*n[0],_*n[1]],S=Id(Bp(M));if(S<=2**(t-40))continue;const N=[p[0]+M[0],p[1]+M[1]];i.tS<=s&&i.tE>=s&&(m=!0),i.tS<=u&&i.tE>=u&&(x=!0);const I=0===h?1:h,y={curve:0===h?c.prev:c,s:I,d:S,x:N};g.push(y)}}const b=f[f.length-1];let w=0===a&&c===l.prev||1===a&&c===l;const _=[];if(0===s);else if(1===s)w||m||_.push({P:b,t:1});else if(!m){const t=Ka(f,s);_.push({P:t,t:s})}if(s!==u)if(0===u);else if(1===u)w||x||(_.push({P:b,t:1}),w=!0);else if(!x){const t=Ka(f,u);_.push({P:t,t:u})}for(let t=0;t<_.length;t++){const{P:e,t:r}=_[t],{a0:o,b0:i}=Sd(p,n,e);if(yd(o)<=2**-40||yd(i)<=2**-40)continue;const s=-i/o;if(s<2**-40)continue;const u=[s*n[0],s*n[1]],f=Id(Bp(u)),l=[p[0]+u[0],p[1]+u[1]],a=0===r?1:r,h={curve:0===r?c.prev:c,s:a,d:f,x:l};g.push(h)}return g}const{abs:Cd}=Math,Td=1+2**-20,Pd=1+2**-20,Ad=L(jh),kd=Gt,Bd=Ut,zd=Zt,Fd=function(t,n){const e=n[0],r=n[1],o=r*t,i=Hn*r,c=i-(i-r),s=r-c,u=Hn*t,f=u-(u-t),l=t-f,a=e*t,p=o+a,h=a-(p-o)+(s*l-(o-c*f-s*f-c*l)),d=p+h;return[h-(d-p),d]},{acos:Yd}=Math;function Ld(t,n){let e=[0,0];for(let r=0;r<t.length;r++)e=Ut(t[r],Dn(n,e));return e}const Xd=nl,Hd=Je,Dd=Dn,Vd=Ut,$d=Xo;function qd(t){if(4===t.length)return function(t){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[Dd(3,Vd(Hd(s,n),Dd(3,Hd(r,i)))),Dd(6,$d(Xd(i,n),-2*r)),Dd(3,Hd(r,n))],[Dd(3,Vd(Hd(u,e),Dd(3,Hd(o,c)))),Dd(6,$d(Xd(c,e),-2*o)),Dd(3,Hd(o,e))]]}(t);if(3===t.length)return function(t){const[[n,e],[r,o],[i,c]]=t;return[[$d(Xd(2*i,2*n),-4*r),Hd(2*r,2*n)],[$d(Xd(2*c,2*e),-4*o),Hd(2*o,2*e)]]}(t);if(2===t.length)return function(t){const[[n,e],[r,o]]=t;return[[Hd(r,n)],[Hd(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 jd=Je,Wd=Ut,Qd=Dn,Rd=Xo;function Gd(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[Qd(6,Wd(jd(s,n),Qd(3,jd(r,i)))),Qd(6,Rd(jd(i,2*r),n))],[Qd(6,Wd(jd(u,e),Qd(3,jd(o,c)))),Qd(6,Rd(jd(c,2*o),e))]]}if(3===t.length){const[[n,e],[r,o],[i,c]]=t;return[[Rd(jd(2*i,4*r),2*n)],[Rd(jd(2*c,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 Ud=jn,Zd=Ut,Jd=Zt;const{sqrt:Kd}=Math;function tg(t,n,e){const{curve:r,p:o,t:i}=n,{ps:c}=r,s=1/t,u=function(t,n){const[e,r]=function(t,n){const[e,r]=qd(t),[o,i]=Gd(t),c=Ld(e,n),s=Ld(r,n),u=Ld(o,n),f=Ld(i,n),l=Jd(Ud(c,f),Ud(s,u)),a=Zd(Ud(c,c),Ud(s,s));return[l,ol(Ud(a,Ud(a,a)))]}(t,n);return zs(e,r)}(c,i),f=-(u[0]+u[1]),l=f<s?s:f,[a,p]=e,h=Kd(a*a+p*p)*l;return[[o[0]+a/h,o[1]+p/h],1/l]}const{sqrt:ng}=Math,{sin:eg,cos:rg,max:og,sqrt:ig}=Math;function cg(t){const{loops:n,maxCoordPowerOf2:e,squaredDiagonalLength:r}=t,o=(2**(e-21))**2,i=2**(e-46),c=ig(r),s=2**(e-32);return function(r,u,f,l){const{curve:{loop:a,ps:p},t:h,p:d}=l,g=function(t,n){const[e,r]=qd(t),o=Ld(r,n);return[[-o[0],-o[1]],Ld(e,n)]}(p,h),v=[-g[0][1],-g[1][1]],m=r?[0,-c]:0!==f?Q(eg(f),rg(f))(v):v;let[x,b]=function(t,n,e,r,o){let i,c;const{p:s}=r;if(n)return[[s[0],s[1]-e],e];if(0===t)return tg(e,r,o);const{p:u}=r,[f,l]=o,a=e/ng(f*f+l*l),p=[f*a,l*a];return i=[u[0]+p[0],u[1]+p[1]],c=e,[i,c]}(f,r,c,l,m);const w=function(t,n,e,r,o,i,c){const{cpTrees:s}=o;if(n)return r.filter(t=>t!==e).flatMap(t=>t.curves.map(t=>({curve:t,ts:[0,1]})));const u=It(i)&&Nt(i).isDull?1===i.t&&0===t?-1:0===i.t?1:Ap(c,i):0,f=id(s.get(e),i,u,0);return f&&f!==f.next.next?rd([f,f]):e.curves.map(t=>({curve:t,ts:[0,1]}))}(f,r,a,n,t,l,x),_=function(t,n,e,r){let o=1/0,i=[e[0]+r[0],e[1]+r[1]];for(let t=0;t<n.length;t++){const c=n[t],{ps:s}=c.curve,u=s[0],f=s[s.length-1];for(const t of[u,f]){if(du(i,t)>o)continue;const{a0:n,b0:c}=Sd(e,r,t);if(Cd(n)<=2**-40||Cd(c)<=2**-40)continue;const s=-c/n;if(s<2**-40)continue;const u=[s*r[0],s*r[1]],f=Bp(u);f<o&&(o=f,i=[e[0]+u[0],e[1]+u[1]])}}return Td*o}(0,w,d,m),M=ig(_),S=ig(m[0]**2+m[1]**2);x=[d[0]+m[0]/S*M,d[1]+m[1]/S*M],function(t,n,e){if(t.length<=2)return t;let r=0;for(let o=0;o<t.length;o++){const i=t[o],{ps:c}=i.curve;Dh($h(c),n)<=Pd*e&&Wh(Ad(c),n)<=Pd*e&&(t[r]=i,r++)}t.length=r}(w,x,_);const N=function(t,n,e,r,o,i){const c=[];for(let s=0;s<i.length;s++){const u=Od(t,n,e,r,o,i[s]);c.push(...u)}let s=1/0;for(let t=0;t<c.length;t++){const n=c[t].d*(1+2**-46);n<s&&(s=n)}const u=[];for(let t=0;t<c.length;t++){const n=c[t];n.d*(1-2**-46)<=s&&u.push(n)}return u}(e,m,l,u,f,w);if(1!==N.length){if(0===N.length)return;if(!function(t){const{curve:n,s:e}=t[0];for(let r=1;r<t.length;r++){const{curve:o,s:i}=t[r];if(n!==o||e!==i)return!1}return!0}(N))return}const{x:I,d:y,curve:E,s:O}=N[0];if(u&&b<(1-s)*y)return void function(t,n,e,r){if(It(r)&&Nt(r).isDull)return;const o={radius:n,center:e};if(fd(t,r,o,Ap(o.center,r),0))return;const{anyFailed:i,cpNodes:c}=sd(!1,!1,o,[-.5,.5],t,[r,r])}(t,b,x,l);const C={curve:E,t:O,isSource:!1,p:Rh(E.ps,O)},T={center:I,radius:y},P=Fh(l.p,C.p),A=Fh(I,C.p);if(!r){if(0===P)return;if(P<=og(function(t,n,e){if(n+e>=t)return 1/0;const r=Je(t,n),o=Fd(n,r),i=t-n,c=n*i,s=(c-n*e-e*e/2)/(c+i*e),u=zs(zd(zd(o,kd(n,e)),kd(e,e/2)),Bd(o,Fd(e,r)))[1];return Yd(s),n*Yd(u)}(b,ig(A),4*i),o))return}return{circle:T,z:C}}}function sg(t,n,e,r,o){e=0===e.t?{...e,curve:e.curve.prev,t:1}:e;const i=Ap(n.center,e),c=Ap(n.center,r),s={...r,circle:n,order:c,order2:0},u={...e,circle:n,order:i,order2:0};if(fd(t,e,n,i,0))return;if(fd(t,r,n,c,0))return;const{anyFailed:f,cpNodes:l}=sd(o,o,n,[i,c],t,[u,s]);if(!f)return o&&function(t,n){const{cpTrees:e}=t,[r,o]=n,i=o.pointOnShape,c=cd(!0,!0,!1,e.get(i.curve.loop),{...i,order2:1},o,t.lastInsertId);c.holeCloserTwin=o,o.holeCloserTwin=c;const s=r.pointOnShape,u=cd(!0,!0,!1,e.get(s.curve.loop),{...r.pointOnShape,order2:-1},r.prev,t.lastInsertId);u.holeCloserTwin=r,r.holeCloserTwin=u,u.prevOnCircle=c,u.nextOnCircle=c,c.prevOnCircle=u,c.nextOnCircle=u,o.next=r,r.prev=o,u.next=c,c.prev=u}(t,l),l[0];l.forEach(n=>{void 0!==n&&k(n,t)})}const{PI:ug,atan2:fg}=Math;function lg(t,n,e,r){let o;const i=cg(t),c=n*ug/180;for(let n=0;n<e.length;n++){const s=e[n],u=ag(c,s);for(const e of u){const c=i(!1,r,e,s);if(c){const{circle:n,z:e}=c,r=sg(t,n,s,e,!1);o=o||r}if("undefined"!=typeof _debug_&&n+1===_debug_.directives.stopAfterTwoProngsNum)return}}return o}function ag(t,n){const e=[0];if(1===n.t){const{curve:r}=n,o=St(r.ps,r.next.ps);if(o.isQuiteDull){const n=Pp(o.tangents[0]),r=Pp(o.tangents[1]),i=(fg(n[1],n[0])+2*ug)%(2*ug),c=((fg(r[1],r[0])+2*ug)%(2*ug)-i+2*ug)%(2*ug);let s=t;for(;s<=c-t/2;)e.push(s),s+=t}}return e}function pg(t,n,e,r){let o;for(let i=0;i<e.length;i++){const c=lg(t,n,e[i],r);o=void 0===o?c:o}return o}function hg(t,n=.4,e=10,r=2**-16){const o=[0],i=[1];for(;;){const c=o[o.length-1],s=i[i.length-1],u=P(t,c,s),f=Ja(u),l=en(u);if(f<=e&&l<=n||s-c<=r){if(o.push(i.pop()),1===s)return o;continue}const a=(c+s)/2;i.push(a)}}function dg(t){if(t.length<4)return[];const[[n,e],[r,o],[i,c],[s,u]]=t,f=r-n,l=o-e,a=i-r-f,p=c-o-l,h=s-i-f-2*a,d=u-c-l-2*p,g=a*d-p*h,v=f*d-l*h,m=f*p-l*a;return Ce([g,v,m],0,1)?.map(t=>t.t)||[]}function gg(t,n,e){return function(r){const o=[],i=r.curves;for(let r=0;r<i.length;r++){const c=i[r],s=c.ps;if(Ja(s)<t)continue;let u=hg(s,n,e);u=2===u.length?[.5]:u,u.push(...dg(s)),u=u.filter(t=>0!==t&&1!==t);const f=u.map(t=>({curve:c,t,isSource:!0,p:Rh(c.ps,t)}));o.push(...f)}return o}}const vg=Je,mg=Ut,xg=Dn,bg=Ke,wg=tr,_g=Dn,Mg=jn,Sg=Ut,Ng=Zt;const Ig=Jn,yg=J,{abs:Eg}=Math,Og=et,Cg=Z,Tg=tt,Pg=lt;const Ag=Je,kg=Dn,Bg=jn,zg=Ut,Fg=Zt;function Yg(t){if(function(t){if(4===t.length)return 0===hu(t[0],t[1],t[2])&&0===hu(t[1],t[2],t[3])&&0===hu(t[0],t[2],t[3]);if(3===t.length)return 0===hu(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,c],[s,u]]=t,f=s+3*r,l=n+3*i,a=f-l,p=Eg(3*r)+Eg(f)+(Eg(3*i)+Eg(l))+Eg(a);if(Eg(a)-bh*p>0)return!1;const h=u+3*o,d=e+3*c,g=h-d,v=Eg(3*o)+Eg(h)+(Eg(3*c)+Eg(d))+Eg(g);return!(Eg(g)-bh*v>0)&&0===ct(it(yg([s],Ig(3,r)),yg([n],Ig(3,i))))&&0===ct(it(yg([u],Ig(3,o)),yg([e],Ig(3,c))))}(t)&&(t=function(t,n=!1){const[e,r,o,i]=t;if(!n){const[t,n]=e,[c,s]=r,[u,f]=o,[l,a]=i;return[e,[rt(it(Tg(Pg(c/4,u/4),3),Pg(t/4,l/4))),rt(it(Tg(Pg(s/4,f/4),3),Pg(n/4,a/4)))],i]}const c=function(t,n){const[[e,r],[o,i]]=t,[[c,s],[u,f]]=n,l=Cg(o,e),a=Cg(i,r),p=Cg(u,c),h=Cg(f,s),d=it(Og(p,a),Og(h,l));if(0===ct(d))return;const g=Cg(c,e),v=Cg(s,r),m=rt(it(Og(v,l),Og(g,a)))/rt(d);return[c+m*rt(p),s+m*rt(h)]}([e,r],[i,o]);if(void 0!==c)return[e,c,i]}(t)),3===t.length){const n=function(t){const[[n,e],[r,o],[i,c]]=t,s=Ag(r,n),u=Ag(i,r),f=Fg(u,s),l=Ag(o,e),a=Ag(c,o),p=Fg(a,l),h=zg(Fg(kg(n,Fg(f,[0,r])),kg(r,Fg(u,[0,r]))),Fg(kg(e,Fg(p,[0,o])),kg(o,Fg(a,[0,o]))));return[zg(Bg(f,f),Bg(p,p)),ri(h)]}(t);return{minima:[],maxima:Ce(n,0,1)?.map(t=>t.t)||[],inflections:[]}}const n=function(t){const[[n,e,r],[o,i,c]]=qd(t),[[s,u],[f,l]]=Gd(t),[[a],[p]]=function(t){if(4===t.length){const[[n,e],[r,o],[i,c],[s,u]]=t;return[[xg(6,mg(vg(s,n),xg(3,vg(r,i))))],[xg(6,mg(vg(u,e),xg(3,vg(o,c))))]]}if(t.length<=3)return[[[0,0]],[[0,0]]];throw new Error("The given bezier curve must be of order <= 3.")}(t),h=Mg(a,i),d=Mg(p,e),g=Mg(u,c),v=Mg(u,i),m=Mg(f,f),x=Mg(s,c),b=Mg(l,r),w=Mg(l,e),_=Mg(f,r),M=Mg(r,e),S=Mg(r,n),N=Mg(r,o),I=Mg(e,e),y=Mg(e,n),E=Mg(e,i),O=Mg(n,c),C=Mg(n,o),T=Mg(n,n),P=Mg(c,i),A=Mg(c,o),k=Mg(i,i),B=Mg(i,o),z=Mg(o,o),F=Ng(Mg(a,c),Mg(p,r)),Y=Ng(h,d),L=Sg(Mg(u,r),Mg(l,c)),X=Sg(Sg(Mg(u,e),Mg(s,r)),Sg(Mg(l,i),Mg(f,c))),H=Ng(g,b),D=Ng(Sg(v,x),Sg(w,_)),V=Sg(Mg(r,r),Mg(c,c)),$=Sg(M,P),q=Sg(E,O),j=Sg(A,k),W=Sg(S,I),Q=Sg(Mg(e,o),Mg(n,i)),R=Ng(T,z),G=Ng(y,B),U=Sg(N,E),Z=Ng(M,P),J=Sg(Mg(r,i),Mg(e,c)),K=Sg(A,j),tt=Sg(S,W),nt=Sg(N,q),et=Sg(E,q),rt=Ng(tt,K),ot=Sg(q,O),it=Sg(U,O),ct=Sg(Ke(w),_),st=Mg(T,Ng(h,_g(3,d))),ut=Mg(z,Ng(_g(3,h),d)),ft=Ke(Sg(Mg(C,Sg(Ng(Mg(a,e),Mg(p,i)),_g(3,Ng(Mg(l,f),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(Mg(f,i)),Mg(l,o))))),Mg(f,Mg(c,ct))))),St=Sg(Ng(wt,_t),Mt),Nt=Ng(Sg(Mg(V,Y),bg(Mg($,F))),_g(3,Sg(Mg(L,D),Mg(X,H)))),It=Ng(Mg(F,V),_g(3,Mg(L,H)));return{inflectionPoly:[Ng(Mg(s,o),Mg(f,n)),Ng(Sg(Mg(u,o),Mg(s,i)),Sg(Mg(l,n),Mg(f,e))),Ng(Sg(v,x),Sg(w,_)),Ng(g,b)],otherExtremaPoly:[at,gt,bt,St,Nt,It]}}(t),e=n.inflectionPoly,r=n.otherExtremaPoly,o=Ce(r,0,1)?.map(t=>t.t)||[],i=function(t){const n=t.length-1;if(n<=0)return[];const e=new Array(n);for(let r=0;r<n;r++)e[r]=Dn(n-r,t[r]);return e}(r),c=[],s=[];for(let t=0;t<o.length;t++){const n=o[t],r=ce(i,n);ct(et(ce(e,n),r))>=0?c.push(n):s.push(n)}return{minima:c,maxima:s,inflections:Ce(e,0,1)?.map(t=>t.t)||[]}}function Lg(t){return{curve:t.curve,t:t.t,isSource:!0,p:Rh(t.curve.ps,t.t)}}function Xg(t,n,e,r,o){(o&&(r>t.val||r===t.val&&e>t.t)||!o&&(r<t.val||r===t.val&&e>t.t))&&(t.curve=n,t.t=e,t.val=r)}const Hg=L(function(t){const n=[{curve:void 0,t:void 0,val:1/0},{curve:void 0,t:void 0,val:1/0}],e=[{curve:void 0,t:void 0,val:-1/0},{curve:void 0,t:void 0,val:-1/0}];return t.curves.forEach(function(t){const r=function(t){const n=G(t),e=Ce(n[0],0,1)?.map(t=>t.t)||[],r=Ce(n[1],0,1)?.map(t=>t.t)||[];e.push(0,1),r.push(0,1);let o,i,c,s,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;for(let n=0;n<e.length;n++){const r=e[n],[c]=Ka(t,r);c<u&&(u=c,o=r),c>f&&(f=c,i=r)}for(let n=0;n<r.length;n++){const e=r[n],[,o]=Ka(t,e);o<l&&(l=o,c=e),o>a&&(a=o,s=e)}return{ts:[[o,c],[i,s]],box:[[u,l],[f,a]]}}(t.ps);for(let o=0;o<2;o++)Xg(n[o],t,r.ts[0][o],r.box[0][o],!1),Xg(e[o],t,r.ts[1][o],r.box[1][o],!0)}),{minX:Lg(n[0]),minY:Lg(n[1]),maxX:Lg(e[0]),maxY:Lg(e[1])}});function Dg(t){return Hg(t).minY}function Vg(t){const{loops:n}=t,e=n.map(Dg);let r;const o=cg(t);for(let n=1;n<e.length;n++){const i=e[n],c=o(!0,!1,0,i);if(!c)throw new Error("Unable to find hole-closing 2-prong");const{circle:s,z:u}=c,f=sg(t,s,i,u,!0);r=void 0===r?f:r}return r}const $g=L(function(t){let n,e,r,o,i=1/0,c=-1/0,s=1/0,u=-1/0;for(const f of t){const t=Hg(f);t.minX.p[0]<i&&(n=t.minX,i=t.minX.p[0]),t.maxX.p[0]>c&&(e=t.maxX,c=t.maxX.p[0]),t.minY.p[1]<s&&(r=t.minY,s=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}});function qg(t,n,e){const{minBezLength:r,maxCurviness:o,maxLength:i,angleIncrement:c}=e,s=wd(r),u=function(t){return n=>{const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];if(Ja(o.ps)<t)continue;const{next:i,ps:c}=o;if(St(c,i.ps).isQuiteDull){const t=c[c.length-1];e.push({curve:o,t:1,isSource:!0,p:t}),e.push({curve:i,t:0,isSource:!0,p:t})}}return e}}(r),f=gg(r,o,i),l=function(t){return function(n){const e=[];for(let r=0;r<n.curves.length;r++){const o=n.curves[r];Ja(o.ps)<t||e.push(...Yg(o.ps).maxima.map(t=>({curve:o,t,isSource:!0,p:Rh(o.ps,t)})))}return e}}(r),a=$g(t),p=(a.maxX.p[0]-a.minX.p[0])**2+(a.maxY.p[1]-a.minY.p[1])**2,d=t.map(s),g={id:0},v=gd(t,d,g),m=bd(t),x=(xd(),{maxCoordPowerOf2:n,squaredDiagonalLength:p,loops:t,cpTrees:v,lastInsertId:g,...m});let b;if(b=Vg(x),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterHoleClosers)return{cpNode:b,meta:x};if(function(){if("undefined"==typeof _debug_)return;const t=_debug_.generated.timing,n=performance.now();t.holeClosers+=n-md,md=n}(),b=pg(x,c,t.map(u),!1)||b,b=pg(x,c,t.map(l),!0)||b,b=pg(x,c,t.map(f),!1)||b,function(){if("undefined"==typeof _debug_)return;const t=_debug_.generated.timing,n=performance.now();t.oneAnd2Prongs+=n-md,md=n}(),"undefined"!=typeof _debug_&&_debug_.directives.stopAfterTwoProngs)return{cpNode:b,meta:x};if(b=function(t,n){if(void 0===n)return;const e=new Set;let r=!0;for(;r;){r=!1;const o=new Set(h(n));for(const n of o){const{closeBysFor3Prong:i,addedCpNodes:c}=pd(t,n);c.length>0&&(r=!0),void 0===i?e.add(n):(r=!0,dd(t,i,o,e)),c.forEach(t=>t.forEach(t=>e.add(t)))}n=hd(e)}return n}(x,b),void 0===b)return;if("undefined"!=typeof _debug_&&_debug_.directives.stopAfterThreeProngs)return{cpNode:b,meta:x};const w={cpNode:b,meta:x};return"undefined"!=typeof _debug_&&(_debug_.generated.timing.threeProngs+=performance.now()-md),w}const{ceil:jg,log2:Wg}=Math;function Qg(t,n){const{maxCoordinate:e}=function(t){let n=0,e=1/0,r=-1/0,o=1/0,i=-1/0;for(const c of t)for(const t of c)for(const c of t){const t=c[0],s=c[1],u=Ua(Za(t),Za(s));u>n&&(n=u),t<e&&(e=t),t>r&&(r=t),s<o&&(o=s),s>i&&(i=s)}return{maxCoordinate:n,width:r-e,height:i-o}}(t),r=jg(Wg(e)),o=function(t,n){const e={...n};for(const n in Tp){const r=n;let o=e[r];const i=Tp[r],{range:c,scaleByMaxCoordinate:s}=i;o<c[0]&&(o=c[0]),o>c[1]&&(o=c[1]),s&&(o*=2**(t-10)),e[r]=o}return e}(r,{...Cp,...n||{}}),{applySat:i,simplify:c,satScale:s,simplifyTolerance:u}=o,f=Ga(t,void 0,{forceOrientationNegative:!0}),l=[];for(const t of f){let n=qg(t,r,o);void 0!==n&&(i&&(n=Op(n,s)),c&&(n=_p(n,u,50)),l.push(n))}return l}function Rg(t){const n=function(t){let n=t;const e=Sp(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(v(o)>2){const n=o.nextOnCircle;kt(o,t)?e=!0:o.next===n?o=n:n.next!==r&&(e=!0)}else if(x(o)&&!o.isIntersection)return void(n=o);if(e){r.next=o,o.prev=r,n=o;break}}}return n}(O(t.cpNode));if(n)return{cpNode:n,meta:{...t.meta,cpTrees:bp(n)}}}let Gg=0;function Ug(t){return t.map(t=>{return(n=t.pointOnShape).p[0]+", "+n.p[1]+" | bz: "+n.curve.idx+" | t: "+n.t;var n})}function Zg(t,n=3){return t[0].toFixed(n)+", "+t[1].toFixed(n)}const Jg={δToString:Ug,δsToString:function(t){return t.map(Ug)},pointToStr:Zg,pointsToStr:function(t,n=3){return t.map(t=>Zg(t,n))},nameObj:function(t,n=""){t.name=""+n+Gg++}},Kg="red thin10 nofill ",tv="http://www.w3.org/2000/svg";function nv(t,n,e=Kg,r){const o=n.center,i=n.radius,c=document.createElementNS(tv,"circle");return c.setAttributeNS(null,"cx",o[0].toString()),c.setAttributeNS(null,"cy",o[1].toString()),c.setAttributeNS(null,"r",i.toString()),c.setAttributeNS(null,"class",e),t.appendChild(c),r&&setTimeout(()=>c.remove(),r),[c]}function ev(t,n,e=3,r="red",o){const[i]=nv(t,{center:n,radius:e},"dot "+r,o);return o&&setTimeout(()=>i.remove(),o),[i]}function rv(t,n,e=Kg,r=0,o=void 0,i=0){const c=document.createElementNS(tv,"line");c.setAttributeNS(null,"x1",n[0][0].toString()),c.setAttributeNS(null,"y1",n[0][1].toString()),c.setAttributeNS(null,"x2",n[1][0].toString()),c.setAttributeNS(null,"y2",n[1][1].toString()),c.setAttributeNS(null,"class",e),t.appendChild(c);let s=[];if(void 0!==o)for(const e of n)s.push(...ev(t,e,i,o,r));for(const n of s)t.appendChild(n);const u=[c,...s];return r&&setTimeout(()=>{for(const t of u)t.remove()},r),u}function ov(t,n,e=Kg,r=3,o){const i=nv(t,{center:n,radius:r},e),c=[[n[0]-r,n[1]],[n[0]+r,n[1]]],s=[[n[0],n[1]-r],[n[0],n[1]+r]],u=rv(t,c,e),f=rv(t,s,e);return o&&setTimeout(()=>{i.forEach(t=>t.remove()),u.forEach(t=>t.remove()),f.forEach(t=>t.remove())},o),[...i,...u,...f]}function iv(t){return 2===t?"L":3===t?"Q":4===t?"C":void 0}function cv(t,n,e=Kg,r=0,o=void 0,i=0,c=void 0){const[[s,u],[f,l],[a,p]]=n,h=document.createElementNS(tv,"path");h.setAttributeNS(null,"d",`M${s} ${u} Q${f} ${l} ${a} ${p}`),e&&h.setAttributeNS(null,"class",e);let d=[];if(void 0!==o)for(const e of n)d.push(...ev(t,e,i,o,r));let g=[];if(void 0!==c)for(let e=0;e<n.length-1;e++)g.push(...rv(t,[n[e],n[e+1]],c,r));const v=[h,...d,...g];for(const n of v)t.appendChild(n);return r&&setTimeout(()=>{for(const t of v)t.remove()},r),v}function sv(t,n,e=Kg,r=0,o=void 0,i=0,c=void 0){const[[s,u],[f,l],[a,p],[h,d]]=n;if(s===h&&f===h&&a===h&&u===d&&l===d&&p===d)return ov(t,[s,u],e,.2,r);const g=document.createElementNS(tv,"path");g.setAttributeNS(null,"d",`M${s} ${u} C${f} ${l} ${a} ${p} ${h} ${d}`),g.setAttributeNS(null,"class",e);let v=[];if(void 0!==o)for(const e of n)v.push(...ev(t,e,i,o,r));let m=[];if(void 0!==c)for(let e=0;e<n.length-1;e++)m.push(...rv(t,[n[e],n[e+1]],c,r));const x=[g,...v,...m];for(const n of x)t.appendChild(n);return r&&setTimeout(()=>{for(const t of x)t.remove()},r),x}function uv(t,n,e=Kg,r=0,o=void 0,i=0,c=void 0){return 2===n.length?rv(t,n,e,r,o,i):3===n.length?cv(t,n,e,r,o,i,c):4===n.length?sv(t,n,e,r,o,i,c):[]}const fv=["red","green","cyan","blue"];function lv(t,n){const e=1-n;if(4===t.length){const[[r,o],[i,c],[s,u],[f,l]]=t;return[r*e**3+3*i*e**2*n+3*s*e*n**2+f*n**3,o*e**3+3*c*e**2*n+3*u*e*n**2+l*n**3]}if(3===t.length){const[[r,o],[i,c],[s,u]]=t;return[r*e**2+2*i*e*n+s*n**2,o*e**2+2*c*e*n+u*n**2]}if(2===t.length){const[[r,o],[i,c]]=t;return[r*e+i*n,o*e+c*n]}return[NaN,NaN]}function av(t,n){return 2===t.length?function(t,n){const[[e,r],[o,i]]=t,c=1-n,s=[c*e+n*o,c*r+n*i];return[[[e,r],s],[s,[o,i]]]}(t,n):3===t.length?function(t,n){const[[e,r],[o,i],[c,s]]=t,u=1-n,f=[u*u*e+2*u*n*o+n*n*c,u*u*r+2*u*n*i+n*n*s];return[[[e,r],[u*e+n*o,u*r+n*i],f],[f,[u*o+n*c,u*i+n*s],[c,s]]]}(t,n):4===t.length?function(t,n){const[[e,r],[o,i],[c,s],[u,f]]=t,l=1-n,a=n*n,p=a*n,h=l*l,d=h*l,g=[p*u+3*l*a*c+3*h*n*o+d*e,p*f+3*l*a*s+3*h*n*i+d*r];return[[[e,r],[n*o+l*e,n*i+l*r],[a*c+2*l*n*o+h*e,a*s+2*l*n*i+h*r],g],[g,[a*u+2*n*l*c+h*o,a*f+2*n*l*s+h*i],[n*u+l*c,n*f+l*s],[u,f]]]}(t,n):[]}const pv={circle:nv,crossHair:ov,dot:ev,line:rv,rect:function(t,n,e=Kg,r){const[[o,i],[c,s]]=n,u=o<c?o:c,f=i<s?i:s,l=Math.abs(o-c),a=Math.abs(i-s),p=document.createElementNS(tv,"rect");return p.setAttributeNS(null,"x",u.toString()),p.setAttributeNS(null,"y",f.toString()),p.setAttributeNS(null,"width",l.toString()),p.setAttributeNS(null,"height",a.toString()),e&&p.setAttributeNS(null,"class",e),t.appendChild(p),r&&setTimeout(()=>p.remove(),r),[p]},beziers:function(t,n,e,r){const o=void 0===e,i=[];for(let r=0;r<n.length;r++){const c=n[r],s=o?"thin5 nofill "+fv[r%fv.length]:e;i.push(...uv(t,c,s))}return r&&setTimeout(()=>i.forEach(t=>t.remove()),r),i},bezier:uv,bezierPiece:function(t,n,e,r=Kg,o){const i=e[0]===e[1]?ov(t,lv(n,e[0]),r,1.5):uv(t,function(t,n){if(0===n[0]&&1===n[1])return t;if(n[0]===n[1]){const e=lv(t,n[0]);return[e,e,e,e]}return 0===n[0]?av(t,n[1])[0]:1===n[1]?av(t,n[0])[1]:av(av(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:cv,cubicBezier:sv,polygon:function(t,n,e=Kg,r){const o=document.createElementNS(tv,"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=Kg,r){if(!n.length)return[];const o=document.createElementNS(tv,"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+=`${iv(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=Kg,r){if(n.length<2)return[];const o=document.createElementNS(tv,"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=Kg,i){const c=document.createElementNS(tv,"text");return c.setAttributeNS(null,"x",n[0].toString()),c.setAttributeNS(null,"y",n[1].toString()),c.setAttributeNS(null,"font-size",r.toString()),c.setAttributeNS(null,"class",o),c.textContent=e,t.appendChild(c),i&&setTimeout(()=>c.remove(),i),[c]}};function hv(t,n){return(n,e,r,o=0,i=1)=>{let c,s;switch(e.isHoleClosing){case!1:c="red ",s="2";break;case!0:c="cyan ",s="10"}const{pointOnShape:u}=e,{circle:f}=u,{center:l,radius:a}=f,{isSource:p,p:h}=u,d=e.nextOnCircle.pointOnShape.p,g=p?h:d,v=p?d:h,{line:m,dot:x,circle:b,crossHair:w}=pv,_=x(n,f.center,.02*i,"yellow",o);return[...b(n,f,c+"thin"+s+" nofill",o),...x(n,g,.005*i,c,o),...x(n,v,.01*i,c,o),...t?w(n,f.center,"red thin2 nofill",.002*i,o):[],..._]}}function dv(t,n){return{center:t.center,radius:n*t.radius}}const gv=["thin10 blue nofill","thin10 red nofill"];function vv(t,n,e,r=0,o=1){let i=n.cpNode;if(!i)return[];for(;!x(i);)i=i.next;const c=[];let s=0;return N(i,n=>{if(x(n))return;const e=Pt(n);e&&(c.push(...pv.bezier(t,e,gv[s%2],r)),s++)}),c}function mv(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 xv(t,n,e="thin5 purple nofill",r=0,o=1){const i=[],c=[];for(const t of n){if(x(t))continue;const n=Pt(t);n&&c.push(n)}return i.push(...a(t,c,e,r)),i}const bv={oneProng:function(t,n,e,r=0,o=1){const{pointOnShape:i}=n,{circle:c}=i;return[...pv.dot(t,i.p,.02*o,"deeppink",r),...pv.dot(t,c.center,.01*o,"deeppink",r),...pv.circle(t,c,"deeppink thin5 nofill",r)]},twoProng:hv(!1),threeProng:function(t,n,e,r=0,o=1){const i=dv(n.pointOnShape.circle,1),{center:c,radius:s}=i,u=m(n).map(t=>t.pointOnShape),{dot:f,circle:l,crossHair:a}=pv,p=l(t,i,"blue thin2 nofill",r),h=[],d=[];for(let n=0;n<u.length;n++){const e=u[n].p;h.push(...f(t,e,.01*(n+1)*o,"blue",r)),d.push(...pv.line(t,[e,c],"thin5 red",r))}const g=a(t,i.center,"red thin2 nofill",.02*o,r);return[...h,...d,...p,...g]},boundingHull:function(t,n,e="thin5 black nofill",r=0,o=1){return pv.polygon(t,n,e,r)},looseBoundingBox:function(t,n,e="thin5 brown nofill",r=0,o=1){const[[i,c],[s,u]]=n;return n=[[i,c],[s,c],[s,u],[i,u]],pv.polygon(t,n,e,r)},tightBoundingBox:function(t,n,e="thin5 pinker nofill",r=0,o=1){return pv.polygon(t,n,"thin5 pinker nofill",r)},vertex:function(t,n,e,r=0,o=1){const i=n.pointOnShape.circle;let c=[];return c=[...pv.dot(t,i.center,.01*o,"darkgreen",r)],c},mat:vv,maxVertex:function(t,n){const e=n.pointOnShape.circle;return pv.circle(t,e,"brown thin10 nofill")},leaves:function(t,n,e="thin10 deeppink nofill",r=0,o=1){const i=[],{line:c,dot:s,circle:u}=pv;for(const f of n){const n=f.pointOnShape,{circle:l}=n,{center:a,radius:p}=l,h=[mv(t,a,.5,"pinker thin5 nofill")],d=m(f).map(t=>t.pointOnShape),g=[],v=[];for(let n=0;n<d.length;n++){const e=d[n].p;v.push(...s(t,e,.01*(n+1)*o,"pinker",r)),g.push(...c(t,[e,a],"thin5 red",r))}const x=u(t,l,e,r);i.push(...x,...v,...g,...h)}return i},cull:function(t,n,e="thin10 cyan nofill",r=0,o=1){const i=[];return i.push(...pv.crossHair(t,n,e,.1*o,r)),i},cpNode:function(t,n,e="blue thin2 nofill",r=0,o=1){const i=dv(n.pointOnShape.circle,1),{center:c,radius:s}=i,u=m(n).map(t=>t.pointOnShape),{dot:f,circle:l,crossHair:a}=pv,p=l(t,i,e,r),h=[],d=[];for(let n=0;n<u.length;n++){const e=u[n].p;h.push(...f(t,e,.01*(n+1)*o,"blue",r)),d.push(...pv.line(t,[e,c],"thin5 red",r))}const g=a(t,c,"orange thin10 nofill",2*o,r);return[...h,...d,...p,...g]},branch:xv,holeCloser:hv(!1)},wv={...bv,twoProng:hv(!0)};function _v(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:[],twoProng:[],looseBoundingBox:[],tightBoundingBox:[],vertex:[],threeProng:[],boundingHull:[],mat:[],cpNode:[],maxVertex:[],leaves:[]},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:{},...bv},...Jg},directives:{...n&&n.directives?n.directives:{},stopAfterHoleClosers:!1,stopAfterHoleClosersNum:void 0,stopAfterTwoProngs:!1,stopAfterTwoProngsNum:void 0,stopAfterThreeProngs:!1,stopAfterThreeProngsNum:void 0}},window._debug_=n}const Mv={oneProng:[],twoProng:[],threeProng:[],looseBoundingBox:[],tightBoundingBox:[],boundingHull:[],vertex:[],mat:[],maxVertex:[],leaves:[],cull:[],cpNode:[],branch:[],holeCloser:[]},Sv=Object.keys(Mv);function Nv(t,n,e,r){const o=[];for(const r of t)o.push({type:0,item:r,x:n(r)}),o.push({type:1,item:r,x:e(r)});o.sort(Iv);const i=new Set,c=[];for(const t of o){const{item:n}=t;if(0===t.type){for(const t of i.values())r(n,t)&&c.push([n,t]);i.add(n)}else 1===t.type&&i.delete(t.item)}return c}function Iv(t,n){const e=t.x-n.x;return 0!==e?e:0===t.type?-1:1}const yv=1e-4;function Ev(t,n){const e=t.pointOnShape,r=n.pointOnShape;let{curve:o,p:i,t:c}=e,{curve:s,p:u,t:f}=r;if(i[0]===u[0]&&i[1]===u[1])return[i];1===c&&(c=0,o=o.next),0===f&&(f=1,s=s.prev);const{ps:l}=o,{ps:a}=s,p=[i,j(i)(W(U(l,c)))],h=[u,j(u)(W(U(a,f)))],d=X(p,h),g=H(i,u);let v;if(d){const t=H(i,d),n=H(u,d);v=D(t,g)<0||D(n,g)>0}else v=!0;if(!v)return[i,d,u];const m=H(p[0],p[1]),x=H(h[0],h[1]),b=Math.abs($(g,m))/9,w=Math.abs($(g,x))/9;return b>.01||w>.01||b>yv||w>yv?void 0:[i,u]}const Ov=L(function(t){return pn(Pt(t))});function Cv(t,n){const e=function(t){const n=new Map;for(let e of t)for(let r of t){const t=e.pointOnShape.circle.center,o=r.pointOnShape.circle.center,i=e.pointOnShape.p,c=r.pointOnShape.p;r!==e&&t[0]===o[0]&&t[1]===o[1]&&i[0]===c[0]&&i[1]===c[1]&&n.set(e,r)}return n}(n),r=t.length,o=[];for(let n=0;n<r;n++){const i=t[n],c=[];for(let o=0;o<r;o++){const r=t[o];if(n===o){c.push(0);continue}let s=1/0;for(const t of m(i)){let n=Ov(t),o=t.next;for(;!kt(o,r);)if(o.isHoleClosing)o=Tv(e,o);else{if(Mn(o)){n=1/0;break}n+=Ov(o),o=o.next}n<s&&(s=n)}c.push(s)}o.push(c)}return o}function Tv(t,n){return t.get(n).next}export{wn as CpNodeFs,e as beziersToSvgPathStr,O as clone,bn as cpNodeComparator,gd as createInitialCpTree,Sv as debugElemNames,a as drawBeziersAsSinglePath,xv as drawBranch,bv as drawElemFs,wv as drawElemFsDetailed,vv as drawMat,Mv as emptyDebugElems,_v as enableDebugForMat,M as enhanceCpNode,cg as find2Prong,Vg as findAndAddHoleClosing2Prongs,Qg as findMats,p as floydWarshall,m as getAllOnCircle,h as getAllOnLoop,mn as getAllVertices,T as getBoundaryBezierPartsToNext,hn as getBoundaryBeziersBetween,A as getBoundaryBeziersToNext,rd as getBoundaryPieceBeziers,Yt as getBranch,Lt as getBranchBeziers,vp as getBranches,z as getChildren,Gh as getCloseBoundaryPointsCertified,Dh as getClosestSquareDistanceToRect,Et as getEdgeDirection,At as getFirstExit,gg as getFor2ProngsOnLoop,Cv as getGraph,d as getHoleClosers,Ev as getImpliedBoundaryBezierBetween,vn as getInitialDegAngleBetweenMatCurves,Tt as getMatCurveBetween,Pt as getMatCurveToNext,gn as getMatCurvesBetween,bd as getPartialMeta,l as getPathsFromStr,xd as getPointToCpNode,Lh as getPotentialClosestPointsOnCurveCertified,v as getProngCount,b as getRealProngCount,dn as getSalience,Ep as getSatCulls,$g as getShapeBounds,wd as getSharpCornersOnLoop,I as getVertexForwardChildren,w as isFullyTerminating,kt as isOnSameCircle,Bt as isOneProng,_ as isSharp,x as isTerminating,Ft as isTrivial,zt as isTwoProng,Mn as isVertexSpecial,t as loopFromBeziers,B as removeVertex,dv as scaleCircle,_p as simplifyMat,Nv as sweepLine,Op as toScaleAxis,S as traverseCp,N as traverseEdges,y as traverseVertices,Rg as trimMat};
|