presenter 0.7.1 → 0.7.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/dist/export/powerpoint-renderer/objects/renderSvg.d.ts +3 -0
- package/dist/export.js +30 -29
- package/dist/export.js.map +1 -0
- package/dist/export.mjs +933 -846
- package/dist/export.mjs.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/objects/SVG.d.ts +13 -0
- package/dist/presenter.js +3 -2
- package/dist/presenter.js.map +1 -0
- package/dist/presenter.mjs +742 -662
- package/dist/presenter.mjs.map +1 -0
- package/dist/renderer/browser-canvas/objects/renderSvg.d.ts +3 -0
- package/dist/types/ObjectType.d.ts +1 -0
- package/dist/utils/presentation/getSvgImageUrlById.d.ts +7 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export { Mask } from './objects/Mask';
|
|
|
14
14
|
export { Path } from './objects/Path';
|
|
15
15
|
export { Polygon } from './objects/Polygon';
|
|
16
16
|
export { Rectangle } from './objects/Rectangle';
|
|
17
|
+
export { SVG } from './objects/SVG';
|
|
17
18
|
export { Text } from './objects/Text';
|
|
18
19
|
export { BrowserCanvasRenderer } from './renderer/browser-canvas/BrowserCanvasRenderer';
|
|
19
20
|
export type { BrowserCanvasRendererProps } from './renderer/browser-canvas/types/BrowserCanvasRendererProps';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Anchor } from '../types/Anchor';
|
|
2
|
+
import { ObjectType } from '../types/ObjectType';
|
|
3
|
+
import { SlideObject } from '../types/SlideObject';
|
|
4
|
+
export interface SVG extends SlideObject {
|
|
5
|
+
readonly objectType: typeof ObjectType.SVG;
|
|
6
|
+
readonly anchor: Anchor;
|
|
7
|
+
readonly height: number;
|
|
8
|
+
readonly svg: string;
|
|
9
|
+
readonly width: number;
|
|
10
|
+
readonly x: number;
|
|
11
|
+
readonly y: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function SVG(props?: Partial<SVG> | null): SVG;
|
package/dist/presenter.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
(function(I,$){typeof exports=="object"&&typeof module<"u"?$(exports):typeof define=="function"&&define.amd?define(["exports"],$):(I=typeof globalThis<"u"?globalThis:I||self,$(I.Presenter={}))})(this,(function(I){"use strict";var Sn=Object.defineProperty;var In=(I,$,m0)=>$ in I?Sn(I,$,{enumerable:!0,configurable:!0,writable:!0,value:m0}):I[$]=m0;var _=(I,$,m0)=>In(I,typeof $!="symbol"?$+"":$,m0);var A0,b0,M0,L0,T0;const $={ANIMATE:"Animate",PAUSE:"Pause",UPDATE:"Update"};function m0(n){return n*n*n}function Zt(n){return--n*n*n+1}function Kt(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var q0=1.70158;(function n(e){e=+e;function t(o){return(o=+o)*o*(e*(o-1)+o)}return t.overshoot=n,t})(q0),(function n(e){e=+e;function t(o){return--o*o*((o+1)*e+o)+1}return t.overshoot=n,t})(q0);var Vt=(function n(e){e=+e;function t(o){return((o*=2)<1?o*o*((e+1)*o-e):(o-=2)*o*((e+1)*o+e)+2)/2}return t.overshoot=n,t})(q0);const O0={LINEAR:n=>n,CUBIC:Kt,CUBIC_IN:m0,CUBIC_OUT:Zt,BACK_IN_OUT:Vt.overshoot(.8)},Qt=O0.LINEAR;function k0(n,e,t={}){return{type:$.ANIMATE,object:n,props:e,delay:0,duration:1e3,easing:Qt,block:!1,interpolators:null,isKey:!1,shortcut:null,...typeof t=="number"?{duration:t}:t}}function Jt(n,e={}){return k0(n,{opacity:1},{duration:500,easing:O0.CUBIC,...typeof e=="number"?{duration:e}:e})}function t1(n,e={}){return k0(n,{opacity:0},{duration:500,easing:O0.CUBIC,...typeof e=="number"?{duration:e}:e})}function B0(n,e){return{type:$.UPDATE,isKey:!1,object:n,props:e,shortcut:null}}function e1(n){return B0(n,{opacity:0})}function n1(n){return B0(n,{opacity:1})}const J={TOP_LEFT:"TopLeft",TOP:"Top",TOP_RIGHT:"TopRight",LEFT:"Left",CENTER:"Center",RIGHT:"Right",BOTTOM_LEFT:"BottomLeft",BOTTOM:"Bottom",BOTTOM_RIGHT:"BottomRight"},s0=J.TOP_LEFT;function G(n,e=0,t=0,o=1){if(typeof n=="string"){const i=n.replace("#",""),s=parseInt(i,16);return isNaN(s)?(console.warn("Invalid hex color format:",n),Q):i.length===6?{red:s>>16&255,green:s>>8&255,blue:s&255,alpha:1}:i.length===8?{red:s>>24&255,green:s>>16&255,blue:s>>8&255,alpha:(s&255)/255}:(console.warn("Invalid hex color format:",n),Q)}else if(typeof n=="number")return{red:n,green:e??0,blue:t??0,alpha:o??1};return{red:0,green:0,blue:0,alpha:1,...n}}G.BLACK=G(0,0,0),G.BLUE=G(0,0,255),G.GREEN=G(0,255,0),G.RED=G(255,0,0),G.TRANSPARENT=G(0,0,0,0),G.WHITE=G(255,255,255);const Q={red:0,green:0,blue:0,alpha:1};function D0(n=null){return{content:null,setup:null,anchor:J.TOP_LEFT,height:0,width:0,x:0,y:0,...n}}function lt(n,e=null){return n.alpha*(e??1)}function P0(n,e=null){const{red:t,green:o,blue:i}=n,s=t<<16|o<<8|i,a=Math.round(lt(n,e)*255);return`#${s.toString(16).padStart(6,"0")}${a!==255?a.toString(16).padStart(2,"0"):""}`}function r1(n=null){const{url:e="https://wikipedia.org/",backgroundColor:t=G.TRANSPARENT,borderColor:o=Q,borderWidth:i=0,pointerEvents:s="auto",scale:a=1,anchor:r=s0,height:h=1e3,width:c=1e3,x:f=0,y:x=0}=n||{},l=document.createElement("iframe");l.src=e,l.style.backgroundColor=P0(t),l.style.border=i>0?`${i}px solid ${P0(o)}`:"none",l.style.pointerEvents=s;const u=(100/a).toFixed(3)+"%";return l.style.height=i===0?u:`calc(${u} - ${i*2}px)`,l.style.width=i===0?u:`calc(${u} - ${i*2}px)`,l.style.transform=`scale(${a})`,l.style.transformOrigin="top left",D0({content:l,anchor:r,height:h,width:c,x:f,y:x})}const f0={LEFT:"left",CENTER:"center",RIGHT:"right"},i1=f0.LEFT;function h0(n,e){throw new Error("Unexpected value: "+n)}function o1(n=null){const{alignment:e=f0.LEFT,scale:t=1,anchor:o=s0,height:i=1e3,width:s=1e3,x:a=0,y:r=0}=n||{};function h(c){const f=document.createElement("video");switch(f.autoplay=!0,f.style.transform=`scale(${t})`,e){case f0.LEFT:f.style.transformOrigin="top left";break;case f0.CENTER:f.style.transformOrigin="top center";break;case f0.RIGHT:f.style.transformOrigin="top right";break;default:h0(e)}c.appendChild(f);const x={video:{displaySurface:"window"},audio:!1};return navigator.mediaDevices.getDisplayMedia(x).then(l=>{const u=l.getVideoTracks()[0];u!==void 0&&(u.onended=function(){f.style.display="none"}),f.srcObject=l,f.play()}).catch(l=>{console.error("Could not start screen capture -",l)}),()=>{f.srcObject.getTracks().forEach(u=>u.stop()),f.style.display="none",f.srcObject=null}}return D0({content:null,setup:h,anchor:o,height:i,width:s,x:a,y:r})}const z={ARROW:"Arrow",CIRCLE:"Circle",GROUP:"Group",IMAGE:"Image",LINE:"Line",MASK:"Mask",PATH:"Path",POLYGON:"Polygon",RECTANGLE:"Rectangle",SLIDE_OBJECT:"SlideObject",TEXT:"Text"};function n0(n){return{objectType:z.SLIDE_OBJECT,opacity:1,...n}}function a1(n=null){const{arrowheadSize:e,width:t=10,...o}=n||{},i=e??t*4;return n0({objectType:z.ARROW,arrowheadSize:i,color:Q,drawn:1,endX:100,endY:100,isArrowheadDoubled:!1,isArrowheadFilled:!1,isDrawnFromCenter:!1,startX:0,startY:0,width:t,...o})}const s1=50;function h1(n=null){return n0({objectType:z.CIRCLE,anchor:s0,borderColor:Q,borderWidth:0,drawn:1,fill:Q,radius:s1,x:0,y:0,...n})}function j0(n,e=null){return n0({objectType:z.GROUP,anchor:s0,height:0,objects:n,previewColor:null,rotateOriginPreviewSize:0,rotateOriginX:0,rotateOriginY:0,rotation:0,scale:1,width:0,x:0,y:0,...e})}function l1(n){const{anchor:e=s0,cols:t=1,rows:o=1,gapX:i=0,gapY:s=0,width:a=0,height:r=0,x:h=0,y:c=0,objects:f=()=>null}=n,x=[],l=[];let u=0,m=0;for(let M=0;M<o;M++){const C=[];u=0;let E=0;for(let L=0;L<t;L++){const S=f(M,L),P=typeof a=="function"?a(M,L):a,R=typeof r=="function"?r(M,L):r;C.push(S),S!=null&&l.push(j0([S],{x:u,y:m})),u+=P+i,E=Math.max(E,R)}x.push(C),m+=E+s}return{grid:j0(l,{x:h,y:c,height:m-s,width:u-i,anchor:e}),objects:x}}function c1(n=null){return n0({objectType:z.IMAGE,anchor:s0,height:100,imageId:"",rounding:0,smooth:!0,width:100,x:0,y:0,...n})}function u1(n=null){return n0({objectType:z.LINE,color:Q,drawn:1,endX:100,endY:100,isDrawnFromCenter:!1,isRounded:!1,startX:0,startY:0,width:10,...n})}function f1(n,e=null){return n0({objectType:z.MASK,anchor:s0,height:100,objects:n,preview:!1,width:100,x:0,y:0,...e})}var g1=Object.defineProperty,O=(n,e)=>g1(n,"name",{value:e,configurable:!0}),C0={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},p1=/([astvzqmhlc])([^astvzqmhlc]*)/gi,d1=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi,x1=O(n=>{const e=(n&&n.length>0?n:"M0,0").match(p1);if(!e)throw new Error(`No path elements found in string ${n}`);return e.reduce((t,o)=>{let i=o.charAt(0),s=i.toLowerCase(),a=y1(o.substring(1));if(s==="m"&&a.length>2&&(t.push([i,...a.splice(0,2)]),s="l",i=i==="m"?"l":"L"),s.toLowerCase()==="a"&&(a.length===5||a.length===6)){const r=o.substring(1).trim().split(" ");a=[Number(r[0]),Number(r[1]),Number(r[2]),Number(r[3].charAt(0)),Number(r[3].charAt(1)),Number(r[3].substring(2)),Number(r[4])]}for(;a.length>=0;){if(a.length===C0[s]){t.push([i,...a.splice(0,C0[s])]);break}if(a.length<C0[s])throw new Error(`Malformed path data: "${i}" must have ${C0[s]} elements and has ${a.length}: ${o}`);t.push([i,...a.splice(0,C0[s])])}return t},[])},"default"),y1=O(n=>{const e=n.match(d1);return e?e.map(Number):[]},"parseValues"),t0=(A0=class{constructor(e,t,o,i){_(this,"x0");_(this,"x1");_(this,"y0");_(this,"y1");_(this,"getTotalLength",O(()=>Math.sqrt(Math.pow(this.x0-this.x1,2)+Math.pow(this.y0-this.y1,2)),"getTotalLength"));_(this,"getPointAtLength",O(e=>{let t=e/Math.sqrt(Math.pow(this.x0-this.x1,2)+Math.pow(this.y0-this.y1,2));t=Number.isNaN(t)?1:t;const o=(this.x1-this.x0)*t,i=(this.y1-this.y0)*t;return{x:this.x0+o,y:this.y0+i}},"getPointAtLength"));_(this,"getTangentAtLength",O(e=>{const t=Math.sqrt((this.x1-this.x0)*(this.x1-this.x0)+(this.y1-this.y0)*(this.y1-this.y0));return{x:(this.x1-this.x0)/t,y:(this.y1-this.y0)/t}},"getTangentAtLength"));_(this,"getPropertiesAtLength",O(e=>{const t=this.getPointAtLength(e),o=this.getTangentAtLength(e);return{x:t.x,y:t.y,tangentX:o.x,tangentY:o.y}},"getPropertiesAtLength"));this.x0=e,this.x1=t,this.y0=o,this.y1=i}},O(A0,"LinearPosition"),A0),ct=(b0=class{constructor(e,t,o,i,s,a,r,h,c){_(this,"x0");_(this,"y0");_(this,"rx");_(this,"ry");_(this,"xAxisRotate");_(this,"LargeArcFlag");_(this,"SweepFlag");_(this,"x1");_(this,"y1");_(this,"length");_(this,"getTotalLength",O(()=>this.length,"getTotalLength"));_(this,"getPointAtLength",O(e=>{e<0?e=0:e>this.length&&(e=this.length);const t=ut({x:this.x0,y:this.y0},this.rx,this.ry,this.xAxisRotate,this.LargeArcFlag,this.SweepFlag,{x:this.x1,y:this.y1},e/this.length);return{x:t.x,y:t.y}},"getPointAtLength"));_(this,"getTangentAtLength",O(e=>{e<0?e=0:e>this.length&&(e=this.length);const t=.05,o=this.getPointAtLength(e);let i;e<0?e=0:e>this.length&&(e=this.length),i=e<this.length-t?this.getPointAtLength(e+t):this.getPointAtLength(e-t);const s=i.x-o.x,a=i.y-o.y,r=Math.sqrt(s*s+a*a);return e<this.length-t?{x:-s/r,y:-a/r}:{x:s/r,y:a/r}},"getTangentAtLength"));_(this,"getPropertiesAtLength",O(e=>{const t=this.getTangentAtLength(e),o=this.getPointAtLength(e);return{x:o.x,y:o.y,tangentX:t.x,tangentY:t.y}},"getPropertiesAtLength"));this.x0=e,this.y0=t,this.rx=o,this.ry=i,this.xAxisRotate=s,this.LargeArcFlag=a,this.SweepFlag=r,this.x1=h,this.y1=c;const f=v1(300,function(x){return ut({x:e,y:t},o,i,s,a,r,{x:h,y:c},x)});this.length=f.arcLength}},O(b0,"Arc"),b0),ut=O((n,e,t,o,i,s,a,r)=>{e=Math.abs(e),t=Math.abs(t),o=w1(o,360);const h=m1(o);if(n.x===a.x&&n.y===a.y)return{x:n.x,y:n.y,ellipticalArcAngle:0};if(e===0||t===0)return{x:0,y:0,ellipticalArcAngle:0};const c=(n.x-a.x)/2,f=(n.y-a.y)/2,x={x:Math.cos(h)*c+Math.sin(h)*f,y:-Math.sin(h)*c+Math.cos(h)*f},l=Math.pow(x.x,2)/Math.pow(e,2)+Math.pow(x.y,2)/Math.pow(t,2);l>1&&(e=Math.sqrt(l)*e,t=Math.sqrt(l)*t);let u=(Math.pow(e,2)*Math.pow(t,2)-Math.pow(e,2)*Math.pow(x.y,2)-Math.pow(t,2)*Math.pow(x.x,2))/(Math.pow(e,2)*Math.pow(x.y,2)+Math.pow(t,2)*Math.pow(x.x,2));u=u<0?0:u;const m=(i!==s?1:-1)*Math.sqrt(u),y=m*(e*x.y/t),M=m*(-t*x.x/e),C={x:Math.cos(h)*y-Math.sin(h)*M+(n.x+a.x)/2,y:Math.sin(h)*y+Math.cos(h)*M+(n.y+a.y)/2},E={x:(x.x-y)/e,y:(x.y-M)/t},L=gt({x:1,y:0},E);let S=gt(E,{x:(-x.x-y)/e,y:(-x.y-M)/t});!s&&S>0?S-=2*Math.PI:s&&S<0&&(S+=2*Math.PI),S%=2*Math.PI;const P=L+S*r,R=e*Math.cos(P),W=t*Math.sin(P);return{x:Math.cos(h)*R-Math.sin(h)*W+C.x,y:Math.sin(h)*R+Math.cos(h)*W+C.y,ellipticalArcStartAngle:L,ellipticalArcEndAngle:L+S,ellipticalArcAngle:P,ellipticalArcCenter:C,resultantRx:e,resultantRy:t}},"pointOnEllipticalArc"),v1=O((n,e)=>{n=n??500;let t=0;const o=[],i=[];let s,a=e(0);for(let r=0;r<n;r++){const h=A1(r*(1/n),0,1);s=e(h),t+=ft(a,s),i.push([a,s]),o.push({t:h,arcLength:t}),a=s}return s=e(1),i.push([a,s]),t+=ft(a,s),o.push({t:1,arcLength:t}),{arcLength:t,arcLengthMap:o,approximationLines:i}},"approximateArcLengthOfCurve"),w1=O((n,e)=>(n%e+e)%e,"mod"),m1=O(n=>n*(Math.PI/180),"toRadians"),ft=O((n,e)=>Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2)),"distance"),A1=O((n,e,t)=>Math.min(Math.max(n,e),t),"clamp"),gt=O((n,e)=>{const t=n.x*e.x+n.y*e.y,o=Math.sqrt((Math.pow(n.x,2)+Math.pow(n.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2)));return(n.x*e.y-n.y*e.x<0?-1:1)*Math.acos(t/o)},"angleBetween"),b1=[[],[],[-.5773502691896257,.5773502691896258],[0,-.7745966692414833,.7745966692414833],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],M1=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],L1=[[1],[1,1],[1,2,1],[1,3,3,1]],T1=O((n,e,t)=>({x:(1-t)*(1-t)*(1-t)*n[0]+3*(1-t)*(1-t)*t*n[1]+3*(1-t)*t*t*n[2]+t*t*t*n[3],y:(1-t)*(1-t)*(1-t)*e[0]+3*(1-t)*(1-t)*t*e[1]+3*(1-t)*t*t*e[2]+t*t*t*e[3]}),"cubicPoint"),P1=O((n,e,t)=>pt([3*(n[1]-n[0]),3*(n[2]-n[1]),3*(n[3]-n[2])],[3*(e[1]-e[0]),3*(e[2]-e[1]),3*(e[3]-e[2])],t),"cubicDerivative"),C1=O((n,e,t)=>{let o,i;const s=t/2;o=0;for(let a=0;a<20;a++)i=s*b1[20][a]+s,o+=M1[20][a]*dt(n,e,i);return s*o},"getCubicArcLength"),pt=O((n,e,t)=>({x:(1-t)*(1-t)*n[0]+2*(1-t)*t*n[1]+t*t*n[2],y:(1-t)*(1-t)*e[0]+2*(1-t)*t*e[1]+t*t*e[2]}),"quadraticPoint"),E1=O((n,e,t)=>{t===void 0&&(t=1);const o=n[0]-2*n[1]+n[2],i=e[0]-2*e[1]+e[2],s=2*n[1]-2*n[0],a=2*e[1]-2*e[0],r=4*(o*o+i*i),h=4*(o*s+i*a),c=s*s+a*a;if(r===0)return t*Math.sqrt(Math.pow(n[2]-n[0],2)+Math.pow(e[2]-e[0],2));const f=h/(2*r),x=t+f,l=c/r-f*f,u=x*x+l>0?Math.sqrt(x*x+l):0,m=f*f+l>0?Math.sqrt(f*f+l):0,y=f+Math.sqrt(f*f+l)!==0&&(x+u)/(f+m)!==0?l*Math.log(Math.abs((x+u)/(f+m))):0;return Math.sqrt(r)/2*(x*u-f*m+y)},"getQuadraticArcLength"),S1=O((n,e,t)=>({x:2*(1-t)*(n[1]-n[0])+2*t*(n[2]-n[1]),y:2*(1-t)*(e[1]-e[0])+2*t*(e[2]-e[1])}),"quadraticDerivative");function dt(n,e,t){const o=U0(1,t,n),i=U0(1,t,e),s=o*o+i*i;return Math.sqrt(s)}O(dt,"BFunc");var U0=O((n,e,t)=>{const o=t.length-1;let i,s;if(o===0)return 0;if(n===0){s=0;for(let a=0;a<=o;a++)s+=L1[o][a]*Math.pow(1-e,o-a)*Math.pow(e,a)*t[a];return s}i=new Array(o);for(let a=0;a<o;a++)i[a]=o*(t[a+1]-t[a]);return U0(n-1,e,i)},"getDerivative"),z0=O((n,e,t)=>{let o=1,i=n/e,s=(n-t(i))/e,a=0;for(;o>.001;){const r=t(i+s),h=Math.abs(n-r)/e;if(h<o)o=h,i+=s;else{const c=t(i-s),f=Math.abs(n-c)/e;f<o?(o=f,i-=s):s/=2}if(a++,a>500)break}return i},"t2length"),l0=(M0=class{constructor(e,t,o,i,s,a,r,h){_(this,"a");_(this,"b");_(this,"c");_(this,"d");_(this,"length");_(this,"getArcLength");_(this,"getPoint");_(this,"getDerivative");_(this,"getTotalLength",O(()=>this.length,"getTotalLength"));_(this,"getPointAtLength",O(e=>{const t=[this.a.x,this.b.x,this.c.x,this.d.x],o=[this.a.y,this.b.y,this.c.y,this.d.y],i=z0(e,this.length,s=>this.getArcLength(t,o,s));return this.getPoint(t,o,i)},"getPointAtLength"));_(this,"getTangentAtLength",O(e=>{const t=[this.a.x,this.b.x,this.c.x,this.d.x],o=[this.a.y,this.b.y,this.c.y,this.d.y],i=z0(e,this.length,h=>this.getArcLength(t,o,h)),s=this.getDerivative(t,o,i),a=Math.sqrt(s.x*s.x+s.y*s.y);let r;return r=a>0?{x:s.x/a,y:s.y/a}:{x:0,y:0},r},"getTangentAtLength"));_(this,"getPropertiesAtLength",O(e=>{const t=[this.a.x,this.b.x,this.c.x,this.d.x],o=[this.a.y,this.b.y,this.c.y,this.d.y],i=z0(e,this.length,c=>this.getArcLength(t,o,c)),s=this.getDerivative(t,o,i),a=Math.sqrt(s.x*s.x+s.y*s.y);let r;r=a>0?{x:s.x/a,y:s.y/a}:{x:0,y:0};const h=this.getPoint(t,o,i);return{x:h.x,y:h.y,tangentX:r.x,tangentY:r.y}},"getPropertiesAtLength"));_(this,"getC",O(()=>this.c,"getC"));_(this,"getD",O(()=>this.d,"getD"));this.a={x:e,y:t},this.b={x:o,y:i},this.c={x:s,y:a},r!==void 0&&h!==void 0?(this.getArcLength=C1,this.getPoint=T1,this.getDerivative=P1,this.d={x:r,y:h}):(this.getArcLength=E1,this.getPoint=pt,this.getDerivative=S1,this.d={x:0,y:0}),this.length=this.getArcLength([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],1)}},O(M0,"Bezier"),M0),I1=(L0=class{constructor(e){_(this,"length",0);_(this,"partial_lengths",[]);_(this,"functions",[]);_(this,"initial_point",null);_(this,"getPartAtLength",O(e=>{e<0?e=0:e>this.length&&(e=this.length);let t=this.partial_lengths.length-1;for(;this.partial_lengths[t]>=e&&t>0;)t--;return t++,{fraction:e-this.partial_lengths[t-1],i:t}},"getPartAtLength"));_(this,"getTotalLength",O(()=>this.length,"getTotalLength"));_(this,"getPointAtLength",O(e=>{const t=this.getPartAtLength(e),o=this.functions[t.i];if(o)return o.getPointAtLength(t.fraction);if(this.initial_point)return this.initial_point;throw new Error("Wrong function at this part.")},"getPointAtLength"));_(this,"getTangentAtLength",O(e=>{const t=this.getPartAtLength(e),o=this.functions[t.i];if(o)return o.getTangentAtLength(t.fraction);if(this.initial_point)return{x:0,y:0};throw new Error("Wrong function at this part.")},"getTangentAtLength"));_(this,"getPropertiesAtLength",O(e=>{const t=this.getPartAtLength(e),o=this.functions[t.i];if(o)return o.getPropertiesAtLength(t.fraction);if(this.initial_point)return{x:this.initial_point.x,y:this.initial_point.y,tangentX:0,tangentY:0};throw new Error("Wrong function at this part.")},"getPropertiesAtLength"));_(this,"getParts",O(()=>{const e=[];for(let t=0;t<this.functions.length;t++)if(this.functions[t]!==null){this.functions[t]=this.functions[t];const o={start:this.functions[t].getPointAtLength(0),end:this.functions[t].getPointAtLength(this.partial_lengths[t]-this.partial_lengths[t-1]),length:this.partial_lengths[t]-this.partial_lengths[t-1],getPointAtLength:this.functions[t].getPointAtLength,getTangentAtLength:this.functions[t].getTangentAtLength,getPropertiesAtLength:this.functions[t].getPropertiesAtLength};e.push(o)}return e},"getParts"));const t=Array.isArray(e)?e:x1(e);let o,i=[0,0],s=[0,0],a=[0,0];for(let r=0;r<t.length;r++){if(t[r][0]==="M")i=[t[r][1],t[r][2]],a=[i[0],i[1]],this.functions.push(null),r===0&&(this.initial_point={x:t[r][1],y:t[r][2]});else if(t[r][0]==="m")i=[t[r][1]+i[0],t[r][2]+i[1]],a=[i[0],i[1]],this.functions.push(null);else if(t[r][0]==="L")this.length+=Math.sqrt(Math.pow(i[0]-t[r][1],2)+Math.pow(i[1]-t[r][2],2)),this.functions.push(new t0(i[0],t[r][1],i[1],t[r][2])),i=[t[r][1],t[r][2]];else if(t[r][0]==="l")this.length+=Math.sqrt(Math.pow(t[r][1],2)+Math.pow(t[r][2],2)),this.functions.push(new t0(i[0],t[r][1]+i[0],i[1],t[r][2]+i[1])),i=[t[r][1]+i[0],t[r][2]+i[1]];else if(t[r][0]==="H")this.length+=Math.abs(i[0]-t[r][1]),this.functions.push(new t0(i[0],t[r][1],i[1],i[1])),i[0]=t[r][1];else if(t[r][0]==="h")this.length+=Math.abs(t[r][1]),this.functions.push(new t0(i[0],i[0]+t[r][1],i[1],i[1])),i[0]=t[r][1]+i[0];else if(t[r][0]==="V")this.length+=Math.abs(i[1]-t[r][1]),this.functions.push(new t0(i[0],i[0],i[1],t[r][1])),i[1]=t[r][1];else if(t[r][0]==="v")this.length+=Math.abs(t[r][1]),this.functions.push(new t0(i[0],i[0],i[1],i[1]+t[r][1])),i[1]=t[r][1]+i[1];else if(t[r][0]==="z"||t[r][0]==="Z")this.length+=Math.sqrt(Math.pow(a[0]-i[0],2)+Math.pow(a[1]-i[1],2)),this.functions.push(new t0(i[0],a[0],i[1],a[1])),i=[a[0],a[1]];else if(t[r][0]==="C")o=new l0(i[0],i[1],t[r][1],t[r][2],t[r][3],t[r][4],t[r][5],t[r][6]),this.length+=o.getTotalLength(),i=[t[r][5],t[r][6]],this.functions.push(o);else if(t[r][0]==="c")o=new l0(i[0],i[1],i[0]+t[r][1],i[1]+t[r][2],i[0]+t[r][3],i[1]+t[r][4],i[0]+t[r][5],i[1]+t[r][6]),o.getTotalLength()>0?(this.length+=o.getTotalLength(),this.functions.push(o),i=[t[r][5]+i[0],t[r][6]+i[1]]):this.functions.push(new t0(i[0],i[0],i[1],i[1]));else if(t[r][0]==="S"){if(r>0&&["C","c","S","s"].indexOf(t[r-1][0])>-1){if(o){const h=o.getC();o=new l0(i[0],i[1],2*i[0]-h.x,2*i[1]-h.y,t[r][1],t[r][2],t[r][3],t[r][4])}}else o=new l0(i[0],i[1],i[0],i[1],t[r][1],t[r][2],t[r][3],t[r][4]);o&&(this.length+=o.getTotalLength(),i=[t[r][3],t[r][4]],this.functions.push(o))}else if(t[r][0]==="s"){if(r>0&&["C","c","S","s"].indexOf(t[r-1][0])>-1){if(o){const h=o.getC(),c=o.getD();o=new l0(i[0],i[1],i[0]+c.x-h.x,i[1]+c.y-h.y,i[0]+t[r][1],i[1]+t[r][2],i[0]+t[r][3],i[1]+t[r][4])}}else o=new l0(i[0],i[1],i[0],i[1],i[0]+t[r][1],i[1]+t[r][2],i[0]+t[r][3],i[1]+t[r][4]);o&&(this.length+=o.getTotalLength(),i=[t[r][3]+i[0],t[r][4]+i[1]],this.functions.push(o))}else if(t[r][0]==="Q"){if(i[0]===t[r][1]&&i[1]===t[r][2]){const h=new t0(t[r][1],t[r][3],t[r][2],t[r][4]);this.length+=h.getTotalLength(),this.functions.push(h)}else o=new l0(i[0],i[1],t[r][1],t[r][2],t[r][3],t[r][4],void 0,void 0),this.length+=o.getTotalLength(),this.functions.push(o);i=[t[r][3],t[r][4]],s=[t[r][1],t[r][2]]}else if(t[r][0]==="q"){if(t[r][1]!==0||t[r][2]!==0)o=new l0(i[0],i[1],i[0]+t[r][1],i[1]+t[r][2],i[0]+t[r][3],i[1]+t[r][4],void 0,void 0),this.length+=o.getTotalLength(),this.functions.push(o);else{const h=new t0(i[0]+t[r][1],i[0]+t[r][3],i[1]+t[r][2],i[1]+t[r][4]);this.length+=h.getTotalLength(),this.functions.push(h)}s=[i[0]+t[r][1],i[1]+t[r][2]],i=[t[r][3]+i[0],t[r][4]+i[1]]}else if(t[r][0]==="T"){if(r>0&&["Q","q","T","t"].indexOf(t[r-1][0])>-1)o=new l0(i[0],i[1],2*i[0]-s[0],2*i[1]-s[1],t[r][1],t[r][2],void 0,void 0),this.functions.push(o),this.length+=o.getTotalLength();else{const h=new t0(i[0],t[r][1],i[1],t[r][2]);this.functions.push(h),this.length+=h.getTotalLength()}s=[2*i[0]-s[0],2*i[1]-s[1]],i=[t[r][1],t[r][2]]}else if(t[r][0]==="t"){if(r>0&&["Q","q","T","t"].indexOf(t[r-1][0])>-1)o=new l0(i[0],i[1],2*i[0]-s[0],2*i[1]-s[1],i[0]+t[r][1],i[1]+t[r][2],void 0,void 0),this.length+=o.getTotalLength(),this.functions.push(o);else{const h=new t0(i[0],i[0]+t[r][1],i[1],i[1]+t[r][2]);this.length+=h.getTotalLength(),this.functions.push(h)}s=[2*i[0]-s[0],2*i[1]-s[1]],i=[t[r][1]+i[0],t[r][2]+i[1]]}else if(t[r][0]==="A"){const h=new ct(i[0],i[1],t[r][1],t[r][2],t[r][3],t[r][4]===1,t[r][5]===1,t[r][6],t[r][7]);this.length+=h.getTotalLength(),i=[t[r][6],t[r][7]],this.functions.push(h)}else if(t[r][0]==="a"){const h=new ct(i[0],i[1],t[r][1],t[r][2],t[r][3],t[r][4]===1,t[r][5]===1,i[0]+t[r][6],i[1]+t[r][7]);this.length+=h.getTotalLength(),i=[i[0]+t[r][6],i[1]+t[r][7]],this.functions.push(h)}this.partial_lengths.push(this.length)}}},O(L0,"SVGPathProperties"),L0),H0=(T0=class{constructor(e){_(this,"inst");_(this,"getTotalLength",O(()=>this.inst.getTotalLength(),"getTotalLength"));_(this,"getPointAtLength",O(e=>this.inst.getPointAtLength(e),"getPointAtLength"));_(this,"getTangentAtLength",O(e=>this.inst.getTangentAtLength(e),"getTangentAtLength"));_(this,"getPropertiesAtLength",O(e=>this.inst.getPropertiesAtLength(e),"getPropertiesAtLength"));_(this,"getParts",O(()=>this.inst.getParts(),"getParts"));if(this.inst=new I1(e),!(this instanceof H0))return new H0(e)}},O(T0,"_svgPathProperties"),T0);function xt(n=G.BLACK){return{...n,alpha:0}}function _1(n=null){const{path:e,height:t=100,width:o=100,viewboxHeight:i,viewboxWidth:s,...a}=n??{},r=e??"M 0 0 L 100 100",c=new H0(r).getTotalLength();return n0({objectType:z.PATH,anchor:s0,color:Q,drawn:1,fill:xt(),isRounded:!1,height:t,path:r,pathLength:c,strokeWidth:4,viewboxHeight:i??t,viewboxWidth:s??o,width:o,x:0,y:0,...a})}function O1(n=null){return n0({objectType:z.POLYGON,borderColor:Q,borderWidth:0,drawn:1,points:[{x:0,y:0},{x:100,y:0},{x:100,y:100}],fill:Q,...n})}function k1(n=null){return n0({objectType:z.RECTANGLE,anchor:s0,borderColor:Q,borderWidth:0,drawn:1,fill:Q,height:100,rounding:0,width:100,x:0,y:0,...n})}const yt={NORMAL:"normal",ITALIC:"italic",OBLIQUE:"oblique"},F1=yt.NORMAL,vt={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900},R1=vt.NORMAL,N1={color:Q,fontFamily:"sans-serif",fontSize:100,fontStyle:F1,fontWeight:R1,ligatures:!1};function wt(n){return typeof n=="string"?[[{text:n}]]:n.map(e=>e.map(t=>typeof t=="string"?{text:t}:t))}function mt(n){return wt(n).reduce((t,o)=>t+o.reduce((i,s)=>i+s.text.length,0),0)}function At(n="",e=null){return n0({objectType:z.TEXT,alignment:i1,anchor:s0,length:null,lineSpacing:1,text:n,x:0,y:0,...N1,...e})}At.writeOn=(n,e={})=>k0(n,{length:mt(n.text)},e);let K=null;function q1({presentation:n,onNavigateToSlide:e}){if(K!==null&&!K.closed){K.focus();return}if(K=window.open("","Navigator","width=300,height=500,left=20,top=50"),K===null){console.error("Failed to open navigator window.");return}const t=B1(n,e);K.document.title=n.title,K.document.body.appendChild(t),K.addEventListener("keyup",o=>{(o.key==="Escape"||o.key==="`")&&(K==null||K.close(),K=null)})}function B1(n,e){const t=document.createElement("div");return t.style.fontFamily="Arial, sans-serif",n.slides.forEach((o,i)=>{const s=D1(o,i);s.style.cursor="pointer",s.addEventListener("click",a=>{a.shiftKey&&(K==null||K.close()),e(i)}),t.appendChild(s)}),t}function D1(n,e){const t=document.createElement("div");return t.style.marginBottom="8px",t.style.padding="8px",t.style.backgroundColor="#eceed7",t.style.borderRadius="4px",t.style.userSelect="none",t.innerHTML=`${e+1}: `+(n.title.length>0?n.title:`Slide ${e+1}`),t}function r0(n=null){return{height:0,width:0,...n}}const j1=r0({width:0,height:0});function bt(n=null){return{backgroundColor:G.WHITE,slides:[],title:"Presentation",size:r0({width:3840,height:2160}),resources:{images:{}},...n}}function U1(n){const e=Array.isArray(n)?n:[n];let t=0,o=0;for(const i of e)switch(i.type){case $.PAUSE:t+=i.duration;break;case $.ANIMATE:o=Math.max(o,t+i.delay+i.duration),i.block&&(t+=i.delay+i.duration);break;case $.UPDATE:break;default:h0(i)}return o}function W0(n,e=null){const{red:t,green:o,blue:i}=n,s=lt(n,e);return`rgba(${t}, ${o}, ${i}, ${s})`}function z1(n){return n===document.body}function H1(n,e){const t=document.createElement("div");if(t.style.width="100%",t.style.aspectRatio=`${n.size.width} / ${n.size.height}`,t.style.position="relative",t.style.top="50%",t.style.transform="translateY(-50%)",t.style.marginLeft="auto",t.style.marginRight="auto",z1(e)){t.style.overflowY="clip",document.title=n.title,document.documentElement.style.height="100%",document.body.style.margin="0",document.body.style.height="100%",document.body.style.width="100%",document.body.style.backgroundColor="#000000";const o=n.size.height/n.size.width;Mt(t,o),window.matchMedia(`(min-aspect-ratio: ${n.size.width} / ${n.size.height})`).addEventListener("change",()=>Mt(t,o))}return t}function Mt(n,e){window.innerHeight/window.innerWidth>e?(n.style.width="100%",n.style.height="auto"):(n.style.width="auto",n.style.height="100%")}const Lt={check:n=>typeof n=="object"&&n!==null&&typeof n.red=="number"&&typeof n.green=="number"&&typeof n.blue=="number"&&typeof n.alpha=="number",interpolate:(n,e,t)=>({red:Math.round(n.red+(e.red-n.red)*t),green:Math.round(n.green+(e.green-n.green)*t),blue:Math.round(n.blue+(e.blue-n.blue)*t),alpha:n.alpha+(e.alpha-n.alpha)*t})},W1={check:n=>!0,interpolate:(n,e)=>e},Tt={check:n=>typeof n=="number",interpolate:(n,e,t)=>n+(e-n)*t},Pt=[Tt,Lt,W1];function $1(n,e,t,o=null){if(t===0)return n;if(t===1)return{...n,...e};const i=o!=null?[...o,...Pt]:Pt,s={};for(const a in e){const r=n[a],h=e[a];for(const c of i)if(c.check(r,a)&&c.check(h,a)){s[a]=c.interpolate(r,h,t);break}}return{...n,...s}}function Ct(n,e,t=null){if(e===null)return;const o=Array.isArray(e)?e:[e];let i=0;for(const s of o){if(t!==null&&i>t)break;switch(s.type){case $.ANIMATE:{const a=n.get(s.object);if(a===void 0)break;const r=t!==null?t-i:null,h=Math.max(Math.min(r!==null?(r-s.delay)/s.duration:1,1),0);n.set(s.object,{...a,...$1(a,s.props,s.easing(h),s.interpolators)}),s.block&&(i+=s.delay+s.duration);break}case $.UPDATE:{const a=n.get(s.object);if(a===void 0)break;n.set(s.object,{...a,...s.props});break}case $.PAUSE:i+=s.duration;break;default:h0(s)}}}function Y1(n){return"objects"in n?n.objects.filter(e=>"objectType"in e):[]}function X1({slide:n,buildIndex:e,buildTime:t}){const o=new Map;function i(a){o.set(a,a);for(const r of Y1(a))i(r)}for(const a of n.objects)i(a);const s=t===null?e:e-1;for(let a=0;a<s;a++){const r=n.animations[a]??null;Ct(o,r)}if(t!==null&&e>0){const a=n.animations[e-1]??null;Ct(o,a,t)}return o}function G1(n){var o;const{slides:e}=n,t={s:{slideIndex:0,buildIndex:0},c:{slideIndex:null,buildIndex:0},e:{slideIndex:e.length-1,buildIndex:((o=e[e.length-1])==null?void 0:o.animations.length)??0}};for(let i=0;i<e.length;i++){const s=e[i];if(s===void 0)continue;const a=s.shortcut;$0(t,a,i,0);for(let r=0;r<s.animations.length;r++){const h=s.animations[r];if(h!==void 0)if(Array.isArray(h))for(const c of h)$0(t,c.shortcut,i,r+1);else $0(t,h.shortcut,i,r+1)}}return t}function $0(n,e,t,o){if(e!==null)if(Array.isArray(e))for(const i of e)n[i]={slideIndex:t,buildIndex:o};else n[e]={slideIndex:t,buildIndex:o}}function Z1(n,e,t,{onNext:o,onPrevious:i,onRenderSlide:s,onShowNavigator:a}){t.shortcuts=G1(n),e.addEventListener("mousemove",()=>{e.style.cursor="auto"}),e.addEventListener("keyup",r=>{if(r.code==="Escape"){t.textCommand=null;return}if(r.code==="ArrowRight"||r.code==="Space"){o(r.shiftKey);return}if(r.code==="ArrowLeft"){i(r.shiftKey);return}if(t.textCommand!==null){if(r.code==="Enter"){const h=t.textCommand;t.textCommand=null;const c=t.shortcuts[h];c!==void 0?s(c.slideIndex,c.buildIndex):isNaN(Number(h))||s(Number(h)-1,0);return}else r.code==="Backspace"?t.textCommand=t.textCommand.slice(0,-1):t.textCommand+=r.key;return}if(r.key==="g"){t.textCommand="";return}if(r.key==="`"){a();return}})}const d0="presenterState";function K1(n,e){const t=localStorage.getItem(d0);if(t===null)return null;if(e===null)return localStorage.removeItem(d0),null;let o;try{o=JSON.parse(t)}catch(c){return console.error("Failed to parse presentation state from localStorage:",c),localStorage.removeItem(d0),null}const{title:i,timestamp:s}=o;let{slideIndex:a,buildIndex:r}=o;if(typeof i!="string"||typeof a!="number"||typeof r!="number"||typeof s!="number"||i!==n.title||Date.now()-s>1e3*60*e)return localStorage.removeItem(d0),null;a>n.slides.length-1&&(a=n.slides.length-1,r=0);const h=n.slides[a];return h===void 0?(localStorage.removeItem(d0),null):(r>h.animations.length&&(r=h.animations.length),{title:i,slideIndex:a,buildIndex:r})}function V1({title:n,slideIndex:e,buildIndex:t}){localStorage.setItem(d0,JSON.stringify({title:n,slideIndex:e,buildIndex:t,timestamp:Date.now()}))}const Et=Object.freeze({canvas:null,extrasContainer:null,mountedExtrasCleanups:[],mountedExtrasSlideIndex:null,slideIndex:0,buildIndex:0,currentAnimationId:null,imageById:{},shortcutState:{textCommand:null,shortcuts:{}}}),e0={Browser:"browser",Node:"node"};function Q1(n,e){e.context.clearRect(0,0,n.width,n.height)}function J1(n){const e=document.createElement("canvas");return e.setAttribute("width",n.width.toString()),e.setAttribute("height",n.height.toString()),e.style.position="absolute",e.style.width="100%",e}const g0={Browser:"browser",Node:"node"};function te(n){const e=new Path2D(n);return{type:g0.Browser,path:e}}function ee(n){const{drawn:e,startX:t,startY:o,endX:i,endY:s,arrowheadSize:a,isArrowheadFilled:r,isDrawnFromCenter:h}=n,c={x:t,y:o},f={x:i,y:s},x=Math.atan2(f.y-c.y,f.x-c.x),l={x:c.x+(f.x-c.x)/2,y:c.y+(f.y-c.y)/2},u=f.x-c.x,m=f.y-c.y,M=Math.hypot(u,m)*e,C=Math.cos(x),E=Math.sin(x),L=h?{x:l.x-C*M/2,y:l.y-E*M/2}:c,S=h?{x:l.x+C*M/2,y:l.y+E*M/2}:{x:c.x+C*M,y:c.y+E*M},P=r?Math.PI/6:Math.PI/4.5,R=M<a*2?M/2:a,W={x:S.x-R*Math.cos(x-P),y:S.y-R*Math.sin(x-P)},V={x:S.x-R*Math.cos(x+P),y:S.y-R*Math.sin(x+P)},U={x:L.x+R*Math.cos(x-P),y:L.y+R*Math.sin(x-P)},X={x:L.x+R*Math.cos(x+P),y:L.y+R*Math.sin(x+P)};return{arrowPoints:[L,S],arrowheadPoints:[W,S,V],doubledArrowheadPoints:[U,L,X]}}function x0({ctx:n,color:e,drawn:t=null,isDrawnFromCenter:o=!1,isRounded:i=!1,opacity:s=null,path:a,pathLength:r=null,width:h}){if(!(h===0||t===0)){if(t!==null&&r!==null&&t!==1){const c=r+(i?h:0),f=r*t;o?n.context.setLineDash([0,(c-f)/2,f,(c-f)/2]):n.context.setLineDash([f,c-f])}else n.context.setLineDash([]);if(n.context.lineWidth=h,n.context.strokeStyle=P0(e,s),n.context.lineCap=i?"round":"butt",a===void 0){n.context.stroke();return}switch(n.type){case e0.Browser:a.type===g0.Browser?n.context.stroke(a.path):console.warn("Attempted to use Node Path2D in Browser Canvas context");break;case e0.Node:a.type===g0.Node?n.context.stroke(a.path):console.warn("Attempted to use Browser Path2D in Node Canvas context");break;default:h0(n)}}}function y0({ctx:n,path:e,color:t,opacity:o=null}){if(n.context.fillStyle=W0(t,o),e===void 0){n.context.fill();return}switch(n.type){case e0.Browser:e.type===g0.Browser?n.context.fill(e.path):console.warn("Attempted to use Node Path2D in Browser Canvas context");break;case e0.Node:e.type===g0.Node?n.context.fill(e.path):console.warn("Attempted to use Browser Path2D in Node Canvas context");break;default:h0(n)}}function Y0(n,e){const t=e(),o=n[0];if(o===void 0)return{path:t,length:0};t.path.moveTo(o.x,o.y);let i=0;for(let s=1;s<n.length;s++){const a=n[s],r=n[s-1];if(a===void 0||r===void 0)continue;const h=a.x-r.x,c=a.y-r.y;i+=Math.hypot(h,c),t.path.lineTo(a.x,a.y)}return{path:t,length:i}}const ne=({ctx:n,object:e,opacity:t,createPath2D:o})=>{const i=e.opacity*t;if(i===0||e.drawn===0)return;const{arrowPoints:s,arrowheadPoints:a,doubledArrowheadPoints:r}=ee(e),{path:h}=Y0(s,o),{path:c}=Y0(a,o);if(x0({color:e.color,ctx:n,path:h,opacity:i,width:e.width}),e.isArrowheadFilled&&(c.path.closePath(),y0({ctx:n,path:c,color:e.color,opacity:i})),x0({color:e.color,ctx:n,path:c,opacity:i,width:e.width}),e.isArrowheadDoubled){const{path:f}=Y0(r,o);e.isArrowheadFilled&&(f.path.closePath(),y0({ctx:n,path:f,color:e.color,opacity:i})),x0({color:e.color,ctx:n,path:f,opacity:i,width:e.width})}};function re(n,e){const t=n.radius-n.borderWidth/2;if(t<=0)return;const o=e(),i=-Math.PI/2;return o.path.arc(n.x,n.y,t,i,i+2*Math.PI),o}function ie(n,e){const t=e(),o=-Math.PI/2;t.path.arc(n.x,n.y,n.radius,o,o+2*Math.PI);const i=2*Math.PI*n.radius;return{path:t,length:i}}function St(n,e){switch(n.type){case e0.Browser:e.type===g0.Browser?n.context.clip(e.path):console.warn("Attempted to use Node Path2D in Browser Canvas context");break;case e0.Node:e.type===g0.Node?n.context.clip(e.path):console.warn("Attempted to use Browser Path2D in Node Canvas context");break;default:h0(n)}}const oe=({ctx:n,object:e,opacity:t,createPath2D:o})=>{const i=e.opacity*t;if(i===0||e.drawn===0&&e.fill.alpha===0)return;const{path:s,length:a}=ie(e,o);if(i<1&&e.borderWidth>0){const r=re(e,o);r!==void 0&&(n.context.save(),St(n,r),y0({ctx:n,path:s,color:e.fill,opacity:i}),n.context.restore())}else y0({ctx:n,path:s,color:e.fill,opacity:i});x0({color:e.borderColor,ctx:n,drawn:e.drawn,path:s,pathLength:a,opacity:i,width:e.borderWidth})};function Y(n=null){return{x:0,y:0,...n}}const ae=Y();function c0(n=null){return{origin:ae,size:j1,...n}}c0();function v0(n,e,t){const{x:o,y:i}=n,{width:s,height:a}=t;switch(e){case J.TOP_LEFT:return c0({origin:Y({x:o,y:i}),size:t});case J.TOP:return c0({origin:Y({x:o-s/2,y:i}),size:t});case J.TOP_RIGHT:return c0({origin:Y({x:o-s,y:i}),size:t});case J.LEFT:return c0({origin:Y({x:o,y:i-a/2}),size:t});case J.CENTER:return c0({origin:Y({x:o-s/2,y:i-a/2}),size:t});case J.RIGHT:return c0({origin:Y({x:o-s,y:i-a/2}),size:t});case J.BOTTOM_LEFT:return c0({origin:Y({x:o,y:i-a}),size:t});case J.BOTTOM:return c0({origin:Y({x:o-s/2,y:i-a}),size:t});case J.BOTTOM_RIGHT:return c0({origin:Y({x:o-s,y:i-a}),size:t});default:h0(e)}}const se=({ctx:n,object:e,renderObject:t,opacity:o})=>{const i=v0(Y({x:e.x,y:e.y}),e.anchor,r0({width:e.width*e.scale,height:e.height*e.scale})),{rotation:s,rotateOriginX:a,rotateOriginY:r}=e;if(e.scale!==0){n.context.translate(i.origin.x,i.origin.y),n.context.scale(e.scale,e.scale),n.context.translate(a,r),n.context.rotate(s*Math.PI/180),n.context.translate(-a,-r);for(const h of e.objects)t(h,o*e.opacity);e.previewColor!==null&&(n.context.fillStyle=P0(e.previewColor),n.context.fillRect(0,0,e.width,e.height)),n.context.translate(a,r),n.context.rotate(-s*Math.PI/180),n.context.translate(-a,-r),e.rotateOriginPreviewSize>0&&(n.context.fillStyle="red",n.context.beginPath(),n.context.arc(a,r,e.rotateOriginPreviewSize,0,2*Math.PI),n.context.fill()),n.context.scale(1/e.scale,1/e.scale),n.context.translate(-i.origin.x,-i.origin.y)}};function X0(n,e,t,o,i=0){const s=o();s.path.moveTo(n.x+t,n.y),s.path.lineTo(n.x+e.width-t,n.y),s.path.arcTo(n.x+e.width,n.y,n.x+e.width,n.y+t,t),s.path.lineTo(n.x+e.width,n.y+e.height-t),s.path.arcTo(n.x+e.width,n.y+e.height,n.x+e.width-t,n.y+e.height,t),s.path.lineTo(n.x+t,n.y+e.height),s.path.arcTo(n.x,n.y+e.height,n.x,n.y+e.height-t,t),s.path.lineTo(n.x,n.y+t),s.path.arcTo(n.x,n.y,n.x+t,n.y,t),i>0&&s.path.lineTo(n.x+t+i,n.y);const a=2*(e.width+e.height-4*t)+2*Math.PI*t+i;return{path:s,length:a}}const G0={Browser:"browser",Node:"node"},he=({ctx:n,imageById:e,object:t,opacity:o,createPath2D:i})=>{const s=v0(Y({x:t.x,y:t.y}),t.anchor,r0({width:t.width,height:t.height})),a=e[t.imageId];if(a!==void 0){if(n.context.save(),t.rounding>0){const r=X0(s.origin,s.size,t.rounding,i);switch(n.type){case e0.Browser:r.path.type===g0.Browser?n.context.clip(r.path.path):console.warn("Attempted to use Node Path2D in Browser Canvas context");break;case e0.Node:r.path.type===g0.Node?n.context.clip(r.path.path):console.warn("Attempted to use Browser Path2D in Node Canvas context");break;default:h0(n)}}switch(n.context.globalAlpha=o*t.opacity,n.context.imageSmoothingEnabled=t.smooth,n.type){case e0.Browser:a.type===G0.Browser?n.context.drawImage(a.image,s.origin.x,s.origin.y,s.size.width,s.size.height):console.warn("Attempted to use Node Image in Browser Canvas context");break;case e0.Node:a.type===G0.Node?n.context.drawImage(a.image,s.origin.x,s.origin.y,s.size.width,s.size.height):console.warn("Attempted to use Browser Image in Node Canvas context");break;default:h0(n)}n.context.restore()}};function le(n,e){const t=e();t.path.moveTo(n.startX,n.startY),t.path.lineTo(n.endX,n.endY);const o=Math.hypot(n.endX-n.startX,n.endY-n.startY);return{path:t,length:o}}const ce=({ctx:n,object:e,opacity:t,createPath2D:o})=>{const i=e.opacity*t;if(i===0||e.drawn===0)return;const{path:s,length:a}=le(e,o);x0({color:e.color,ctx:n,drawn:e.drawn,isDrawnFromCenter:e.isDrawnFromCenter,isRounded:e.isRounded,path:s,pathLength:a,opacity:i,width:e.width})},ue=({ctx:n,object:e,opacity:t,renderObject:o})=>{n.context.save();const i=v0(Y({x:e.x,y:e.y}),e.anchor,r0({width:e.width,height:e.height}));e.preview&&(n.context.lineWidth=4,n.context.strokeStyle=P0(G.RED),n.context.rect(i.origin.x,i.origin.y,i.size.width,i.size.height),n.context.stroke()),n.context.beginPath(),n.context.rect(i.origin.x,i.origin.y,i.size.width,i.size.height),n.context.closePath(),n.context.clip();for(const s of e.objects)o(s,t*e.opacity);n.context.restore()},fe=({ctx:n,object:e,opacity:t,createPath2D:o})=>{const i=e.opacity*t;if(i===0||e.drawn===0&&e.fill.alpha===0)return;const{origin:s}=v0(Y({x:e.x,y:e.y}),e.anchor,r0({width:e.width,height:e.height})),a=o(e.path);n.context.save(),n.context.translate(s.x,s.y),n.context.scale(e.width/e.viewboxWidth,e.height/e.viewboxHeight),y0({ctx:n,path:a,color:e.fill,opacity:i}),x0({color:e.color,ctx:n,drawn:e.drawn,isRounded:e.isRounded,path:a,pathLength:e.pathLength,opacity:i,width:e.strokeWidth}),n.context.restore()};function ge(n,e){const t=e(),o=n.points,i=o[0];if(i===void 0)return{path:t,length:0};t.path.moveTo(i.x,i.y);let s=0,a=i;for(let h=1;h<o.length;h++){const c=o[h];if(c===void 0)continue;t.path.lineTo(c.x,c.y);const f=Math.hypot(c.x-a.x,c.y-a.y);s+=f,a=c}t.path.closePath();const r=Math.hypot(i.x-a.x,i.y-a.y);return s+=r,{path:t,length:s}}const pe=({ctx:n,object:e,opacity:t,createPath2D:o})=>{const i=e.opacity*t;if(i===0||e.drawn===0&&e.fill.alpha===0)return;const{path:s,length:a}=ge(e,o);y0({ctx:n,path:s,color:e.fill,opacity:i}),x0({color:e.borderColor,ctx:n,drawn:e.drawn,path:s,pathLength:a,opacity:i,width:e.borderWidth})};function de(n,e){const t=n.borderWidth/2,{origin:o,size:i}=v0(Y({x:n.x,y:n.y}),n.anchor,r0({width:n.width,height:n.height})),s=i.width-n.borderWidth,a=i.height-n.borderWidth;if(s<=0||a<=0)return;const r=Y({x:o.x+t,y:o.y+t}),h=r0({width:s,height:a}),c=Math.max(0,Math.min(n.rounding-t,Math.min(s,a)/2));if(c>0)return X0(r,h,c,e).path;const f=e();return f.path.moveTo(r.x,r.y),f.path.lineTo(r.x+s,r.y),f.path.lineTo(r.x+s,r.y+a),f.path.lineTo(r.x,r.y+a),f.path.closePath(),f}function xe(n,e){const{origin:t,size:o}=v0(Y({x:n.x,y:n.y}),n.anchor,r0({width:n.width,height:n.height})),i=Math.max(0,Math.min(n.rounding,Math.min(o.width,o.height)/2)),s=Math.min(n.borderWidth*2,o.width-i);if(i>0)return X0(t,o,i,e,s);{const a=e();a.path.moveTo(t.x,t.y),a.path.lineTo(t.x+o.width,t.y),a.path.lineTo(t.x+o.width,t.y+o.height),a.path.lineTo(t.x,t.y+o.height),a.path.lineTo(t.x,t.y),a.path.lineTo(t.x+s,t.y);const r=2*(o.width+o.height)+s;return{path:a,length:r}}}const ye=({ctx:n,object:e,opacity:t,createPath2D:o})=>{const i=e.opacity*t;if(i===0||e.drawn===0&&e.fill.alpha===0)return;const{path:s,length:a}=xe(e,o);if(i<1&&e.borderWidth>0){const r=de(e,o);r!==void 0&&(n.context.save(),St(n,r),y0({ctx:n,path:s,color:e.fill,opacity:i}),n.context.restore())}else y0({ctx:n,path:s,color:e.fill,opacity:i});x0({color:e.borderColor,ctx:n,drawn:e.drawn,path:s,pathLength:a,opacity:i,width:e.borderWidth})};function ve(n){return{color:n.color,fontFamily:n.fontFamily,fontSize:n.fontSize,fontStyle:n.fontStyle,fontWeight:n.fontWeight,ligatures:n.ligatures}}function we(n,e=1){const t=Math.max(...n.map(s=>s.reduce((a,r)=>a+r.width,0)));let o=0,i=0;for(let s=0;s<n.length;s++){const a=n[s];if(a===void 0)continue;const r=Math.max(...a.map(h=>h.height));o+=r+i*(e-1),i=r}return{height:o,width:t}}function me(n){return{width:n.width,height:n.fontBoundingBoxAscent}}function It(n,e,t=1){n.context.fillStyle=W0(e.color,t),n.context.font=`${e.fontStyle} ${e.fontWeight} ${e.fontSize}px ${e.fontFamily}`,n.type===e0.Browser?n.context.textRendering=e.ligatures?"optimizeLegibility":"optimizeSpeed":n.context.fontVariant=e.ligatures?"common-ligatures":"no-common-ligatures"}function Ae(n,e,t){const o=[];for(const i of n){const s=[];for(const a of i){const{text:r,...h}=a,c={...e,...h};It(t,c);const f=t.context.measureText(r);s.push(me(f))}o.push(s)}return o}const be=({ctx:n,object:e,opacity:t})=>{const o=e.opacity*t;if(o===0)return;const{length:i}=e,s=wt(e.text),a=ve(e),r=Ae(s,a,n),h=we(r,e.lineSpacing),c=v0(Y({x:e.x,y:e.y}),e.anchor,h);let f=c.origin.x,x=c.origin.y,l=0,u=0;for(let m=0;m<s.length;m++){const y=s[m],M=r[m];if(y==null||M==null){console.error("Could not determine text units or sizes for line");continue}const C=M.reduce((L,S)=>L+S.width,0),E=M.length===0?u:M.reduce((L,S)=>Math.max(L,S.height),0);switch(e.alignment){case f0.LEFT:f=c.origin.x;break;case f0.CENTER:f=c.origin.x+(c.size.width-C)/2;break;case f0.RIGHT:f=c.origin.x+(c.size.width-C);break;default:h0(e.alignment);break}x+=E+u*(e.lineSpacing-1),u=E;for(let L=0;L<y.length&&!(i!==null&&l>=i);L++){const S=y[L],P=M[L];if(S==null||P==null){console.error("Could not determine text unit or size for unit");continue}const{text:R,...W}=S;let V;if(i!==null&&l+R.length>i){const u0=i-l;V=R.slice(0,u0)}const U=V??R;l+=U.length;const X={...a,...W};It(n,X,o),n.context.fillText(U,f,x),f+=P.width}}},Me={[z.ARROW]:ne,[z.CIRCLE]:oe,[z.GROUP]:se,[z.IMAGE]:he,[z.LINE]:ce,[z.MASK]:ue,[z.PATH]:fe,[z.POLYGON]:pe,[z.RECTANGLE]:ye,[z.SLIDE_OBJECT]:()=>{},[z.TEXT]:be};function Le(n){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("viewBox",`0 0 ${n.width} ${n.height}`),e.style.backgroundColor="transparent",e.style.position="absolute",e.style.width="100%",e}function Te(n,e){if(n===null)return null;const t=v0(Y({x:e.x,y:e.y}),e.anchor,r0({width:e.width,height:e.height})),o=document.createElementNS("http://www.w3.org/2000/svg","foreignObject");o.setAttribute("x",t.origin.x.toString()),o.setAttribute("y",t.origin.y.toString()),o.setAttribute("width",e.width.toString()),o.setAttribute("height",e.height.toString());const i=e.content;i!==null&&o.appendChild(i),n.appendChild(o);let s=null;if(e.setup!==null){const a=e.setup(o);a!==void 0&&(s=a)}return()=>{s!==null&&s(),n.removeChild(o)}}async function Pe(n){if(Object.keys(n).length===0)return{};const e={},t=i=>new Promise((s,a)=>{const r=new Image;if(r.onload=()=>s(r),r.onerror=c=>a(c),i.includes("</svg>")){const c=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),f=URL.createObjectURL(c);r.src=f}else r.src=i}),o=Object.entries(n).map(async([i,s])=>{const a=await t(s);e[i]={type:G0.Browser,image:a}});return await Promise.all(o),e}class Ce{constructor(e){const{objectRenderers:t,...o}=e;this.props={presentation:bt(),element:document.body,objectRenderers:{...Me,...t},cacheDurationMinutes:15,...o},this.state={...Et}}async present(){const{presentation:e,element:t}=this.props,o=J1(e.size),i=Le(e.size);this.state={...Et,imageById:await Pe(e.resources.images),canvas:o,extrasContainer:i};const s=H1(e,t);Z1(e,t,this.state.shortcutState,{onNext:r=>this.next(r),onPrevious:r=>this.previous(r),onRenderSlide:(r,h)=>{this.state.shortcutState.shortcuts.b={slideIndex:this.state.slideIndex,buildIndex:this.state.buildIndex},this.renderSlide(r??this.state.slideIndex,h)},onShowNavigator:()=>q1({presentation:e,onNavigateToSlide:r=>this.renderSlide(r)})}),t.replaceChildren(),s.appendChild(o),s.appendChild(i),t.appendChild(s);const a=K1(e,this.props.cacheDurationMinutes);a!==null?this.renderSlide(a.slideIndex,a.buildIndex):this.renderSlide(0)}renderSlide(e,t=0,o=null){const{objectRenderers:i,presentation:s}=this.props,{canvas:a,imageById:r}=this.state,h=this.state.slideIndex!==e;this.state.slideIndex=e,this.state.buildIndex=t,o===null&&V1({title:s.title,slideIndex:e,buildIndex:t});const c=s.slides[e];if(c===void 0||a===null)return;if(h||this.state.mountedExtrasCleanups.length===0&&c.extras.length>0){for(const m of this.state.mountedExtrasCleanups)m();this.state.mountedExtrasCleanups=[];for(const m of c.extras){const y=Te(this.state.extrasContainer,m);y!==null&&this.state.mountedExtrasCleanups.push(y)}}const f=a.getContext("2d");if(f===null)return;const x={type:e0.Browser,context:f};Q1(a,x);const l=X1({slide:c,buildIndex:t,buildTime:o});x.context.fillStyle=W0(s.backgroundColor),x.context.fillRect(0,0,a.width,a.height);function u(m,y){const M=i[m.objectType],C=l.get(m);M===void 0||C===void 0||M({ctx:x,imageById:r,object:C,opacity:y,renderObject:u,createPath2D:te})}for(const m of c.objects)u(m,1)}next(e=!1){const{presentation:t}=this.props,{currentAnimationId:o,slideIndex:i,buildIndex:s}=this.state;this.props.element.style.cursor="none",o!==null&&cancelAnimationFrame(o);const a=t.slides[i];if(a===void 0)return;const r=a.animations[s];if(r!==void 0&&!e){const h=performance.now(),c=U1(r),f=x=>{const l=x-h;l<c?(this.renderSlide(i,s+1,l),this.state.currentAnimationId=requestAnimationFrame(f)):this.renderSlide(i,s+1,null)};this.state.currentAnimationId=requestAnimationFrame(f)}else i+1<t.slides.length&&this.renderSlide(i+1)}previous(e=!1){const{currentAnimationId:t,slideIndex:o,buildIndex:i}=this.state;if(this.props.element.style.cursor="none",t!==null&&cancelAnimationFrame(t),i>0)e?this.renderSlide(o,0):this.renderSlide(o,i-1);else if(o>0){const s=this.props.presentation.slides[o-1],a=e?0:(s==null?void 0:s.animations.length)??0;this.renderSlide(o-1,a)}else this.renderSlide(0,0)}}function Ee(n=1e3){return{type:$.PAUSE,isKey:!1,duration:n,shortcut:null}}function Se(n=null){return{objects:[],animations:[],extras:[],isAllKey:!1,isEndKey:!0,isStartKey:!1,shortcut:null,title:"",...n}}function Ie(n,e={}){return{...e,text:n}}function _e(n=G.BLACK){return{...n,alpha:1}}function Oe(n){for(var e=-1,t=n.length,o,i=n[t-1],s=0;++e<t;)o=i,i=n[e],s+=o[1]*i[0]-o[0]*i[1];return s/2}function ke(n){for(var e=-1,t=n.length,o=n[t-1],i,s,a=o[0],r=o[1],h=0;++e<t;)i=a,s=r,o=n[e],a=o[0],r=o[1],i-=a,s-=r,h+=Math.sqrt(i*i+s*s);return h}function Fe(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Z0,_t;function Re(){if(_t)return Z0;_t=1;var n={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},e=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function t(u){return u===10||u===13||u===8232||u===8233||u===32||u===9||u===11||u===12||u===160||u>=5760&&e.indexOf(u)>=0}function o(u){switch(u|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function i(u){return(u|32)===97}function s(u){return u>=48&&u<=57}function a(u){return u>=48&&u<=57||u===43||u===45||u===46}function r(u){this.index=0,this.path=u,this.max=u.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function h(u){for(;u.index<u.max&&t(u.path.charCodeAt(u.index));)u.index++}function c(u){var m=u.path.charCodeAt(u.index);if(m===48){u.param=0,u.index++;return}if(m===49){u.param=1,u.index++;return}u.err="SvgPath: arc flag can be 0 or 1 only (at pos "+u.index+")"}function f(u){var m=u.index,y=m,M=u.max,C=!1,E=!1,L=!1,S=!1,P;if(y>=M){u.err="SvgPath: missed param (at pos "+y+")";return}if(P=u.path.charCodeAt(y),(P===43||P===45)&&(y++,P=y<M?u.path.charCodeAt(y):0),!s(P)&&P!==46){u.err="SvgPath: param should start with 0..9 or `.` (at pos "+y+")";return}if(P!==46){if(C=P===48,y++,P=y<M?u.path.charCodeAt(y):0,C&&y<M&&P&&s(P)){u.err="SvgPath: numbers started with `0` such as `09` are illegal (at pos "+m+")";return}for(;y<M&&s(u.path.charCodeAt(y));)y++,E=!0;P=y<M?u.path.charCodeAt(y):0}if(P===46){for(S=!0,y++;s(u.path.charCodeAt(y));)y++,L=!0;P=y<M?u.path.charCodeAt(y):0}if(P===101||P===69){if(S&&!E&&!L){u.err="SvgPath: invalid float exponent (at pos "+y+")";return}if(y++,P=y<M?u.path.charCodeAt(y):0,(P===43||P===45)&&y++,y<M&&s(u.path.charCodeAt(y)))for(;y<M&&s(u.path.charCodeAt(y));)y++;else{u.err="SvgPath: invalid float exponent (at pos "+y+")";return}}u.index=y,u.param=parseFloat(u.path.slice(m,y))+0}function x(u){var m,y;m=u.path[u.segmentStart],y=m.toLowerCase();var M=u.data;if(y==="m"&&M.length>2&&(u.result.push([m,M[0],M[1]]),M=M.slice(2),y="l",m=m==="m"?"l":"L"),y==="r")u.result.push([m].concat(M));else for(;M.length>=n[y]&&(u.result.push([m].concat(M.splice(0,n[y]))),!!n[y]););}function l(u){var m=u.max,y,M,C,E,L;if(u.segmentStart=u.index,y=u.path.charCodeAt(u.index),M=i(y),!o(y)){u.err="SvgPath: bad command "+u.path[u.index]+" (at pos "+u.index+")";return}if(E=n[u.path[u.index].toLowerCase()],u.index++,h(u),u.data=[],!E){x(u);return}for(C=!1;;){for(L=E;L>0;L--){if(M&&(L===3||L===4)?c(u):f(u),u.err.length){x(u);return}u.data.push(u.param),h(u),C=!1,u.index<m&&u.path.charCodeAt(u.index)===44&&(u.index++,h(u),C=!0)}if(!C&&(u.index>=u.max||!a(u.path.charCodeAt(u.index))))break}x(u)}return Z0=function(m){var y=new r(m),M=y.max;for(h(y);y.index<M&&!y.err.length;)l(y);return y.result.length&&("mM".indexOf(y.result[0][0])<0?(y.err="SvgPath: string should start with `M` or `m`",y.result=[]):y.result[0][0]="M"),{err:y.err,segments:y.result}},Z0}var K0,Ot;function kt(){if(Ot)return K0;Ot=1;function n(t,o){return[t[0]*o[0]+t[2]*o[1],t[1]*o[0]+t[3]*o[1],t[0]*o[2]+t[2]*o[3],t[1]*o[2]+t[3]*o[3],t[0]*o[4]+t[2]*o[5]+t[4],t[1]*o[4]+t[3]*o[5]+t[5]]}function e(){if(!(this instanceof e))return new e;this.queue=[],this.cache=null}return e.prototype.matrix=function(t){return t[0]===1&&t[1]===0&&t[2]===0&&t[3]===1&&t[4]===0&&t[5]===0?this:(this.cache=null,this.queue.push(t),this)},e.prototype.translate=function(t,o){return(t!==0||o!==0)&&(this.cache=null,this.queue.push([1,0,0,1,t,o])),this},e.prototype.scale=function(t,o){return(t!==1||o!==1)&&(this.cache=null,this.queue.push([t,0,0,o,0,0])),this},e.prototype.rotate=function(t,o,i){var s,a,r;return t!==0&&(this.translate(o,i),s=t*Math.PI/180,a=Math.cos(s),r=Math.sin(s),this.queue.push([a,r,-r,a,0,0]),this.cache=null,this.translate(-o,-i)),this},e.prototype.skewX=function(t){return t!==0&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},e.prototype.skewY=function(t){return t!==0&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},e.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],this.queue.length===1)return this.cache;for(var t=1;t<this.queue.length;t++)this.cache=n(this.cache,this.queue[t]);return this.cache},e.prototype.calc=function(t,o,i){var s;return this.queue.length?(this.cache||(this.cache=this.toArray()),s=this.cache,[t*s[0]+o*s[2]+(i?0:s[4]),t*s[1]+o*s[3]+(i?0:s[5])]):[t,o]},K0=e,K0}var V0,Ft;function Ne(){if(Ft)return V0;Ft=1;var n=kt(),e={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},t=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,o=/[\s,]+/;return V0=function(s){var a=new n,r,h;return s.split(t).forEach(function(c){if(c.length){if(typeof e[c]<"u"){r=c;return}switch(h=c.split(o).map(function(f){return+f||0}),r){case"matrix":h.length===6&&a.matrix(h);return;case"scale":h.length===1?a.scale(h[0],h[0]):h.length===2&&a.scale(h[0],h[1]);return;case"rotate":h.length===1?a.rotate(h[0],0,0):h.length===3&&a.rotate(h[0],h[1],h[2]);return;case"translate":h.length===1?a.translate(h[0],0):h.length===2&&a.translate(h[0],h[1]);return;case"skewX":h.length===1&&a.skewX(h[0]);return;case"skewY":h.length===1&&a.skewY(h[0]);return}}}),a},V0}var Q0,Rt;function qe(){if(Rt)return Q0;Rt=1;var n=Math.PI*2;function e(i,s,a,r){var h=i*r-s*a<0?-1:1,c=i*a+s*r;return c>1&&(c=1),c<-1&&(c=-1),h*Math.acos(c)}function t(i,s,a,r,h,c,f,x,l,u){var m=u*(i-a)/2+l*(s-r)/2,y=-l*(i-a)/2+u*(s-r)/2,M=f*f,C=x*x,E=m*m,L=y*y,S=M*C-M*L-C*E;S<0&&(S=0),S/=M*L+C*E,S=Math.sqrt(S)*(h===c?-1:1);var P=S*f/x*y,R=S*-x/f*m,W=u*P-l*R+(i+a)/2,V=l*P+u*R+(s+r)/2,U=(m-P)/f,X=(y-R)/x,u0=(-m-P)/f,w0=(-y-R)/x,p0=e(1,0,U,X),a0=e(U,X,u0,w0);return c===0&&a0>0&&(a0-=n),c===1&&a0<0&&(a0+=n),[W,V,p0,a0]}function o(i,s){var a=1.3333333333333333*Math.tan(s/4),r=Math.cos(i),h=Math.sin(i),c=Math.cos(i+s),f=Math.sin(i+s);return[r,h,r-h*a,h+r*a,c+f*a,f-c*a,c,f]}return Q0=function(s,a,r,h,c,f,x,l,u){var m=Math.sin(u*n/360),y=Math.cos(u*n/360),M=y*(s-r)/2+m*(a-h)/2,C=-m*(s-r)/2+y*(a-h)/2;if(M===0&&C===0)return[];if(x===0||l===0)return[];x=Math.abs(x),l=Math.abs(l);var E=M*M/(x*x)+C*C/(l*l);E>1&&(x*=Math.sqrt(E),l*=Math.sqrt(E));var L=t(s,a,r,h,c,f,x,l,m,y),S=[],P=L[2],R=L[3],W=Math.max(Math.ceil(Math.abs(R)/(n/4)),1);R/=W;for(var V=0;V<W;V++)S.push(o(P,R)),P+=R;return S.map(function(U){for(var X=0;X<U.length;X+=2){var u0=U[X+0],w0=U[X+1];u0*=x,w0*=l;var p0=y*u0-m*w0,a0=m*u0+y*w0;U[X+0]=p0+L[0],U[X+1]=a0+L[1]}return U})},Q0}var J0,Nt;function Be(){if(Nt)return J0;Nt=1;var n=1e-10,e=Math.PI/180;function t(o,i,s){if(!(this instanceof t))return new t(o,i,s);this.rx=o,this.ry=i,this.ax=s}return t.prototype.transform=function(o){var i=Math.cos(this.ax*e),s=Math.sin(this.ax*e),a=[this.rx*(o[0]*i+o[2]*s),this.rx*(o[1]*i+o[3]*s),this.ry*(-o[0]*s+o[2]*i),this.ry*(-o[1]*s+o[3]*i)],r=a[0]*a[0]+a[2]*a[2],h=a[1]*a[1]+a[3]*a[3],c=((a[0]-a[3])*(a[0]-a[3])+(a[2]+a[1])*(a[2]+a[1]))*((a[0]+a[3])*(a[0]+a[3])+(a[2]-a[1])*(a[2]-a[1])),f=(r+h)/2;if(c<n*f)return this.rx=this.ry=Math.sqrt(f),this.ax=0,this;var x=a[0]*a[1]+a[2]*a[3];c=Math.sqrt(c);var l=f+c/2,u=f-c/2;return this.ax=Math.abs(x)<n&&Math.abs(l-h)<n?90:Math.atan(Math.abs(x)>Math.abs(l-h)?(l-r)/x:x/(l-h))*180/Math.PI,this.ax>=0?(this.rx=Math.sqrt(l),this.ry=Math.sqrt(u)):(this.ax+=90,this.rx=Math.sqrt(u),this.ry=Math.sqrt(l)),this},t.prototype.isDegenerate=function(){return this.rx<n*this.ry||this.ry<n*this.rx},J0=t,J0}var tt,qt;function De(){if(qt)return tt;qt=1;var n=Re(),e=Ne(),t=kt(),o=qe(),i=Be();function s(a){if(!(this instanceof s))return new s(a);var r=n(a);this.segments=r.segments,this.err=r.err,this.__stack=[]}return s.from=function(a){if(typeof a=="string")return new s(a);if(a instanceof s){var r=new s("");return r.err=a.err,r.segments=a.segments.map(function(h){return h.slice()}),r.__stack=a.__stack.map(function(h){return t().matrix(h.toArray())}),r}throw new Error("SvgPath.from: invalid param type "+a)},s.prototype.__matrix=function(a){var r=this,h;a.queue.length&&this.iterate(function(c,f,x,l){var u,m,y,M;switch(c[0]){case"v":u=a.calc(0,c[1],!0),m=u[0]===0?["v",u[1]]:["l",u[0],u[1]];break;case"V":u=a.calc(x,c[1],!1),m=u[0]===a.calc(x,l,!1)[0]?["V",u[1]]:["L",u[0],u[1]];break;case"h":u=a.calc(c[1],0,!0),m=u[1]===0?["h",u[0]]:["l",u[0],u[1]];break;case"H":u=a.calc(c[1],l,!1),m=u[1]===a.calc(x,l,!1)[1]?["H",u[0]]:["L",u[0],u[1]];break;case"a":case"A":var C=a.toArray(),E=i(c[1],c[2],c[3]).transform(C);if(C[0]*C[3]-C[1]*C[2]<0&&(c[5]=c[5]?"0":"1"),u=a.calc(c[6],c[7],c[0]==="a"),c[0]==="A"&&c[6]===x&&c[7]===l||c[0]==="a"&&c[6]===0&&c[7]===0){m=[c[0]==="a"?"l":"L",u[0],u[1]];break}E.isDegenerate()?m=[c[0]==="a"?"l":"L",u[0],u[1]]:m=[c[0],E.rx,E.ry,E.ax,c[4],c[5],u[0],u[1]];break;case"m":M=f>0,u=a.calc(c[1],c[2],M),m=["m",u[0],u[1]];break;default:for(y=c[0],m=[y],M=y.toLowerCase()===y,h=1;h<c.length;h+=2)u=a.calc(c[h],c[h+1],M),m.push(u[0],u[1])}r.segments[f]=m},!0)},s.prototype.__evaluateStack=function(){var a,r;if(this.__stack.length){if(this.__stack.length===1){this.__matrix(this.__stack[0]),this.__stack=[];return}for(a=t(),r=this.__stack.length;--r>=0;)a.matrix(this.__stack[r].toArray());this.__matrix(a),this.__stack=[]}},s.prototype.toString=function(){var a="",r="",h=!1;this.__evaluateStack();for(var c=0,f=this.segments.length;c<f;c++){var x=this.segments[c],l=x[0];l!==r||l==="m"||l==="M"?(l==="m"&&r==="z"&&(a+=" "),a+=l,h=!1):h=!0;for(var u=1;u<x.length;u++){var m=x[u];u===1?h&&m>=0&&(a+=" "):m>=0&&(a+=" "),a+=m}r=l}return a},s.prototype.translate=function(a,r){return this.__stack.push(t().translate(a,r||0)),this},s.prototype.scale=function(a,r){return this.__stack.push(t().scale(a,!r&&r!==0?a:r)),this},s.prototype.rotate=function(a,r,h){return this.__stack.push(t().rotate(a,r||0,h||0)),this},s.prototype.skewX=function(a){return this.__stack.push(t().skewX(a)),this},s.prototype.skewY=function(a){return this.__stack.push(t().skewY(a)),this},s.prototype.matrix=function(a){return this.__stack.push(t().matrix(a)),this},s.prototype.transform=function(a){return a.trim()?(this.__stack.push(e(a)),this):this},s.prototype.round=function(a){var r=0,h=0,c=0,f=0,x;return a=a||0,this.__evaluateStack(),this.segments.forEach(function(l){var u=l[0].toLowerCase()===l[0];switch(l[0]){case"H":case"h":u&&(l[1]+=c),c=l[1]-l[1].toFixed(a),l[1]=+l[1].toFixed(a);return;case"V":case"v":u&&(l[1]+=f),f=l[1]-l[1].toFixed(a),l[1]=+l[1].toFixed(a);return;case"Z":case"z":c=r,f=h;return;case"M":case"m":u&&(l[1]+=c,l[2]+=f),c=l[1]-l[1].toFixed(a),f=l[2]-l[2].toFixed(a),r=c,h=f,l[1]=+l[1].toFixed(a),l[2]=+l[2].toFixed(a);return;case"A":case"a":u&&(l[6]+=c,l[7]+=f),c=l[6]-l[6].toFixed(a),f=l[7]-l[7].toFixed(a),l[1]=+l[1].toFixed(a),l[2]=+l[2].toFixed(a),l[3]=+l[3].toFixed(a+2),l[6]=+l[6].toFixed(a),l[7]=+l[7].toFixed(a);return;default:x=l.length,u&&(l[x-2]+=c,l[x-1]+=f),c=l[x-2]-l[x-2].toFixed(a),f=l[x-1]-l[x-1].toFixed(a),l.forEach(function(m,y){y&&(l[y]=+l[y].toFixed(a))});return}}),this},s.prototype.iterate=function(a,r){var h=this.segments,c={},f=!1,x=0,l=0,u=0,m=0,y,M,C;if(r||this.__evaluateStack(),h.forEach(function(E,L){var S=a(E,L,x,l);Array.isArray(S)&&(c[L]=S,f=!0);var P=E[0]===E[0].toLowerCase();switch(E[0]){case"m":case"M":x=E[1]+(P?x:0),l=E[2]+(P?l:0),u=x,m=l;return;case"h":case"H":x=E[1]+(P?x:0);return;case"v":case"V":l=E[1]+(P?l:0);return;case"z":case"Z":x=u,l=m;return;default:x=E[E.length-2]+(P?x:0),l=E[E.length-1]+(P?l:0)}}),!f)return this;for(C=[],y=0;y<h.length;y++)if(typeof c[y]<"u")for(M=0;M<c[y].length;M++)C.push(c[y][M]);else C.push(h[y]);return this.segments=C,this},s.prototype.abs=function(){return this.iterate(function(a,r,h,c){var f=a[0],x=f.toUpperCase(),l;if(f!==x)switch(a[0]=x,f){case"v":a[1]+=c;return;case"a":a[6]+=h,a[7]+=c;return;default:for(l=1;l<a.length;l++)a[l]+=l%2?h:c}},!0),this},s.prototype.rel=function(){return this.iterate(function(a,r,h,c){var f=a[0],x=f.toLowerCase(),l;if(f!==x&&!(r===0&&f==="M"))switch(a[0]=x,f){case"V":a[1]-=c;return;case"A":a[6]-=h,a[7]-=c;return;default:for(l=1;l<a.length;l++)a[l]-=l%2?h:c}},!0),this},s.prototype.unarc=function(){return this.iterate(function(a,r,h,c){var f,x,l,u=[],m=a[0];return m!=="A"&&m!=="a"?null:(m==="a"?(x=h+a[6],l=c+a[7]):(x=a[6],l=a[7]),f=o(h,c,x,l,a[4],a[5],a[1],a[2],a[3]),f.length===0?[[a[0]==="a"?"l":"L",a[6],a[7]]]:(f.forEach(function(y){u.push(["C",y[2],y[3],y[4],y[5],y[6],y[7]])}),u))}),this},s.prototype.unshort=function(){var a=this.segments,r,h,c,f,x;return this.iterate(function(l,u,m,y){var M=l[0],C=M.toUpperCase(),E;u&&(C==="T"?(E=M==="t",c=a[u-1],c[0]==="Q"?(r=c[1]-m,h=c[2]-y):c[0]==="q"?(r=c[1]-c[3],h=c[2]-c[4]):(r=0,h=0),f=-r,x=-h,E||(f+=m,x+=y),a[u]=[E?"q":"Q",f,x,l[1],l[2]]):C==="S"&&(E=M==="s",c=a[u-1],c[0]==="C"?(r=c[3]-m,h=c[4]-y):c[0]==="c"?(r=c[3]-c[5],h=c[4]-c[6]):(r=0,h=0),f=-r,x=-h,E||(f+=m,x+=y),a[u]=[E?"c":"C",f,x,l[1],l[2],l[3],l[4]]))}),this},tt=s,tt}var et,Bt;function je(){return Bt||(Bt=1,et=De()),et}var Ue=je();const ze=Fe(Ue);var nt={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},He=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function We(n){var e=[];return n.replace(He,function(t,o,i){var s=o.toLowerCase();for(i=Ye(i),s==="m"&&i.length>2&&(e.push([o].concat(i.splice(0,2))),s="l",o=o==="m"?"l":"L");i.length>=0;){if(i.length===nt[s])return i.unshift(o),e.push(i);if(i.length<nt[s])throw new Error("malformed path data");e.push([o].concat(i.splice(0,nt[s])))}}),e}var $e=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function Ye(n){var e=n.match($e);return e?e.map(Number):[]}function i0(n,e,t,o,i,s,a,r){return new rt(n,e,t,o,i,s,a,r)}function rt(n,e,t,o,i,s,a,r){this.a={x:n,y:e},this.b={x:t,y:o},this.c={x:i,y:s},this.d={x:a,y:r},a!=null&&r!==null&&r!==void 0?(this.getArcLength=nn,this.getPoint=Ze,this.getDerivative=Ge):(this.getArcLength=Ke,this.getPoint=Dt,this.getDerivative=Xe),this.init()}rt.prototype={constructor:rt,init:function(){this.length=this.getArcLength([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y])},getTotalLength:function(){return this.length},getPointAtLength:function(n){var e=it(n,this.length,this.getArcLength,[this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y]);return this.getPoint([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],e)},getTangentAtLength:function(n){var e=it(n,this.length,this.getArcLength,[this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y]),t=this.getDerivative([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],e),o=Math.sqrt(t.x*t.x+t.y*t.y),i;return o>0?i={x:t.x/o,y:t.y/o}:i={x:0,y:0},i},getPropertiesAtLength:function(n){var e=it(n,this.length,this.getArcLength,[this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y]),t=this.getDerivative([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],e),o=Math.sqrt(t.x*t.x+t.y*t.y),i;o>0?i={x:t.x/o,y:t.y/o}:i={x:0,y:0};var s=this.getPoint([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],e);return{x:s.x,y:s.y,tangentX:i.x,tangentY:i.y}}};function Xe(n,e,t){return{x:(1-t)*2*(n[1]-n[0])+t*2*(n[2]-n[1]),y:(1-t)*2*(e[1]-e[0])+t*2*(e[2]-e[1])}}function Ge(n,e,t){var o=Dt([3*(n[1]-n[0]),3*(n[2]-n[1]),3*(n[3]-n[2])],[3*(e[1]-e[0]),3*(e[2]-e[1]),3*(e[3]-e[2])],t);return o}function it(n,e,t,o,i){for(var s=1,a=n/e,r=(n-t(o,i,a))/e;s>.001;){var h=t(o,i,a+r),c=t(o,i,a-r),f=Math.abs(n-h)/e,x=Math.abs(n-c)/e;f<s?(s=f,a+=r):x<s?(s=x,a-=r):r/=2}return a}function Dt(n,e,t){var o=(1-t)*(1-t)*n[0]+2*(1-t)*t*n[1]+t*t*n[2],i=(1-t)*(1-t)*e[0]+2*(1-t)*t*e[1]+t*t*e[2];return{x:o,y:i}}function Ze(n,e,t){var o=(1-t)*(1-t)*(1-t)*n[0]+3*(1-t)*(1-t)*t*n[1]+3*(1-t)*t*t*n[2]+t*t*t*n[3],i=(1-t)*(1-t)*(1-t)*e[0]+3*(1-t)*(1-t)*t*e[1]+3*(1-t)*t*t*e[2]+t*t*t*e[3];return{x:o,y:i}}function Ke(n,e,t){t===void 0&&(t=1);var o=n[0]-2*n[1]+n[2],i=e[0]-2*e[1]+e[2],s=2*n[1]-2*n[0],a=2*e[1]-2*e[0],r=4*(o*o+i*i),h=4*(o*s+i*a),c=s*s+a*a;if(r===0)return t*Math.sqrt(Math.pow(n[2]-n[0],2)+Math.pow(e[2]-e[0],2));var f=h/(2*r),x=c/r,l=t+f,u=x-f*f;return Math.sqrt(r)/2*(l*Math.sqrt(l*l+u)-f*Math.sqrt(f*f+u)+u*Math.log(Math.abs((l+Math.sqrt(l*l+u))/(f+Math.sqrt(f*f+u)))))}var Ve=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],Qe=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],Je=[[1],[1,1],[1,2,1],[1,3,3,1]];function tn(n,e){return Je[n][e]}function ot(n,e,t){var o=t.length-1,i,s,a;if(o===0)return 0;if(n===0){for(s=0,a=0;a<=o;a++)s+=tn(o,a)*Math.pow(1-e,o-a)*Math.pow(e,a)*t[a];return s}else{for(i=new Array(o),a=0;a<o;a++)i[a]=o*(t[a+1]-t[a]);return ot(n-1,e,i)}}function en(n,e,t){var o=ot(1,t,n),i=ot(1,t,e),s=o*o+i*i;return Math.sqrt(s)}function nn(n,e,t){var o,i,s,a;t===void 0&&(t=1);var r=20;for(o=t/2,i=0,s=0;s<r;s++)a=o*Ve[r][s]+o,i+=Qe[r][s]*en(n,e,a);return o*i}var E0=Math.PI*2;function jt(n,e,t,o){var i=n*o-e*t<0?-1:1,s=n*t+e*o;return s>1&&(s=1),s<-1&&(s=-1),i*Math.acos(s)}function rn(n,e,t,o,i,s,a,r,h,c){var f=c*(n-t)/2+h*(e-o)/2,x=-h*(n-t)/2+c*(e-o)/2,l=a*a,u=r*r,m=f*f,y=x*x,M=l*u-l*y-u*m;M<0&&(M=0),M/=l*y+u*m,M=Math.sqrt(M)*(i===s?-1:1);var C=M*a/r*x,E=M*-r/a*f,L=c*C-h*E+(n+t)/2,S=h*C+c*E+(e+o)/2,P=(f-C)/a,R=(x-E)/r,W=(-f-C)/a,V=(-x-E)/r,U=jt(1,0,P,R),X=jt(P,R,W,V);return s===0&&X>0&&(X-=E0),s===1&&X<0&&(X+=E0),[L,S,U,X]}function on(n,e){var t=1.3333333333333333*Math.tan(e/4),o=Math.cos(n),i=Math.sin(n),s=Math.cos(n+e),a=Math.sin(n+e);return[o,i,o-i*t,i+o*t,s+a*t,a-s*t,s,a]}function an(n,e,t,o,i,s,a,r,h){var c=Math.sin(i*E0/360),f=Math.cos(i*E0/360),x=f*(n-r)/2+c*(e-h)/2,l=-c*(n-r)/2+f*(e-h)/2;if(x===0&&l===0)return[];if(t===0||o===0)return[];t=Math.abs(t),o=Math.abs(o);var u=x*x/(t*t)+l*l/(o*o);u>1&&(t*=Math.sqrt(u),o*=Math.sqrt(u));var m=rn(n,e,r,h,s,a,t,o,c,f),y=[],M=m[2],C=m[3],E=Math.max(Math.ceil(Math.abs(C)/(E0/4)),1);C/=E;for(var L=0;L<E;L++)y.push(on(M,C)),M+=C;return y.map(function(S){for(var P=0;P<S.length;P+=2){var R=S[P+0],W=S[P+1];R*=t,W*=o;var V=f*R-c*W,U=c*R+f*W;S[P+0]=V+m[0],S[P+1]=U+m[1]}return S})}function Ut(n,e,t,o,i,s,a,r,h){return new at(n,e,t,o,i,s,a,r,h)}function at(n,e,t,o,i,s,a,r,h){var c=0,f=[],x=[],l=an(n,e,t,o,i,s,a,r,h);l.forEach(function(u){var m=new i0(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7]),y=m.getTotalLength();c+=y,f.push(y),x.push(m)}),this.length=c,this.partialLengths=f,this.curves=x}at.prototype={constructor:at,init:function(){},getTotalLength:function(){return this.length},getPointAtLength:function(n){n<0?n=0:n>this.length&&(n=this.length);for(var e=this.partialLengths.length-1;this.partialLengths[e]>=n&&this.partialLengths[e]>0;)e--;e<this.partialLengths.length-1&&e++;for(var t=0,o=0;o<e;o++)t+=this.partialLengths[o];return this.curves[e].getPointAtLength(n-t)},getTangentAtLength:function(n){n<0?n=0:n>this.length&&(n=this.length);for(var e=this.partialLengths.length-1;this.partialLengths[e]>=n&&this.partialLengths[e]>0;)e--;e<this.partialLengths.length-1&&e++;for(var t=0,o=0;o<e;o++)t+=this.partialLengths[o];return this.curves[e].getTangentAtLength(n-t)},getPropertiesAtLength:function(n){var e=this.getTangentAtLength(n),t=this.getPointAtLength(n);return{x:t.x,y:t.y,tangentX:e.x,tangentY:e.y}}};function o0(n,e,t,o){return new S0(n,e,t,o)}function S0(n,e,t,o){this.x0=n,this.x1=e,this.y0=t,this.y1=o}S0.prototype.getTotalLength=function(){return Math.sqrt(Math.pow(this.x0-this.x1,2)+Math.pow(this.y0-this.y1,2))},S0.prototype.getPointAtLength=function(n){var e=n/Math.sqrt(Math.pow(this.x0-this.x1,2)+Math.pow(this.y0-this.y1,2)),t=(this.x1-this.x0)*e,o=(this.y1-this.y0)*e;return{x:this.x0+t,y:this.y0+o}},S0.prototype.getTangentAtLength=function(){var n=Math.sqrt((this.x1-this.x0)*(this.x1-this.x0)+(this.y1-this.y0)*(this.y1-this.y0));return{x:(this.x1-this.x0)/n,y:(this.y1-this.y0)/n}},S0.prototype.getPropertiesAtLength=function(n){var e=this.getPointAtLength(n),t=this.getTangentAtLength();return{x:e.x,y:e.y,tangentX:t.x,tangentY:t.y}};function sn(n){var e=0,t=[],o=[];function i(a){if(!a)return null;for(var r=We(a),h=[0,0],c=[0,0],f,x,l=0;l<r.length;l++)r[l][0]==="M"?(h=[r[l][1],r[l][2]],x=[h[0],h[1]],o.push(null)):r[l][0]==="m"?(h=[r[l][1]+h[0],r[l][2]+h[1]],x=[h[0],h[1]],o.push(null)):r[l][0]==="L"?(e=e+Math.sqrt(Math.pow(h[0]-r[l][1],2)+Math.pow(h[1]-r[l][2],2)),o.push(new o0(h[0],r[l][1],h[1],r[l][2])),h=[r[l][1],r[l][2]]):r[l][0]==="l"?(e=e+Math.sqrt(Math.pow(r[l][1],2)+Math.pow(r[l][2],2)),o.push(new o0(h[0],r[l][1]+h[0],h[1],r[l][2]+h[1])),h=[r[l][1]+h[0],r[l][2]+h[1]]):r[l][0]==="H"?(e=e+Math.abs(h[0]-r[l][1]),o.push(new o0(h[0],r[l][1],h[1],h[1])),h[0]=r[l][1]):r[l][0]==="h"?(e=e+Math.abs(r[l][1]),o.push(new o0(h[0],h[0]+r[l][1],h[1],h[1])),h[0]=r[l][1]+h[0]):r[l][0]==="V"?(e=e+Math.abs(h[1]-r[l][1]),o.push(new o0(h[0],h[0],h[1],r[l][1])),h[1]=r[l][1]):r[l][0]==="v"?(e=e+Math.abs(r[l][1]),o.push(new o0(h[0],h[0],h[1],h[1]+r[l][1])),h[1]=r[l][1]+h[1]):r[l][0]==="z"||r[l][0]==="Z"?(e=e+Math.sqrt(Math.pow(x[0]-h[0],2)+Math.pow(x[1]-h[1],2)),o.push(new o0(h[0],x[0],h[1],x[1])),h=[x[0],x[1]]):r[l][0]==="C"?(f=new i0(h[0],h[1],r[l][1],r[l][2],r[l][3],r[l][4],r[l][5],r[l][6]),e=e+f.getTotalLength(),h=[r[l][5],r[l][6]],o.push(f)):r[l][0]==="c"?(f=new i0(h[0],h[1],h[0]+r[l][1],h[1]+r[l][2],h[0]+r[l][3],h[1]+r[l][4],h[0]+r[l][5],h[1]+r[l][6]),e=e+f.getTotalLength(),h=[r[l][5]+h[0],r[l][6]+h[1]],o.push(f)):r[l][0]==="S"?(l>0&&["C","c","S","s"].indexOf(r[l-1][0])>-1?f=new i0(h[0],h[1],2*h[0]-r[l-1][r[l-1].length-4],2*h[1]-r[l-1][r[l-1].length-3],r[l][1],r[l][2],r[l][3],r[l][4]):f=new i0(h[0],h[1],h[0],h[1],r[l][1],r[l][2],r[l][3],r[l][4]),e=e+f.getTotalLength(),h=[r[l][3],r[l][4]],o.push(f)):r[l][0]==="s"?(l>0&&["C","c","S","s"].indexOf(r[l-1][0])>-1?f=new i0(h[0],h[1],h[0]+f.d.x-f.c.x,h[1]+f.d.y-f.c.y,h[0]+r[l][1],h[1]+r[l][2],h[0]+r[l][3],h[1]+r[l][4]):f=new i0(h[0],h[1],h[0],h[1],h[0]+r[l][1],h[1]+r[l][2],h[0]+r[l][3],h[1]+r[l][4]),e=e+f.getTotalLength(),h=[r[l][3]+h[0],r[l][4]+h[1]],o.push(f)):r[l][0]==="Q"?(h[0]!=r[l][1]&&h[1]!=r[l][2]?f=new i0(h[0],h[1],r[l][1],r[l][2],r[l][3],r[l][4]):f=new o0(r[l][1],r[l][3],r[l][2],r[l][4]),e=e+f.getTotalLength(),o.push(f),h=[r[l][3],r[l][4]],c=[r[l][1],r[l][2]]):r[l][0]==="q"?(r[l][1]==0&&r[l][2]==0?f=new o0(h[0]+r[l][1],h[0]+r[l][3],h[1]+r[l][2],h[1]+r[l][4]):f=new i0(h[0],h[1],h[0]+r[l][1],h[1]+r[l][2],h[0]+r[l][3],h[1]+r[l][4]),e=e+f.getTotalLength(),c=[h[0]+r[l][1],h[1]+r[l][2]],h=[r[l][3]+h[0],r[l][4]+h[1]],o.push(f)):r[l][0]==="T"?(l>0&&["Q","q","T","t"].indexOf(r[l-1][0])>-1?f=new i0(h[0],h[1],2*h[0]-c[0],2*h[1]-c[1],r[l][1],r[l][2]):f=new o0(h[0],r[l][1],h[1],r[l][2]),o.push(f),e=e+f.getTotalLength(),c=[2*h[0]-c[0],2*h[1]-c[1]],h=[r[l][1],r[l][2]]):r[l][0]==="t"?(l>0&&["Q","q","T","t"].indexOf(r[l-1][0])>-1?f=new i0(h[0],h[1],2*h[0]-c[0],2*h[1]-c[1],h[0]+r[l][1],h[1]+r[l][2]):f=new o0(h[0],h[0]+r[l][1],h[1],h[1]+r[l][2]),e=e+f.getTotalLength(),c=[2*h[0]-c[0],2*h[1]-c[1]],h=[r[l][1]+h[0],r[l][2]+h[0]],o.push(f)):r[l][0]==="A"?(f=new Ut(h[0],h[1],r[l][1],r[l][2],r[l][3],r[l][4],r[l][5],r[l][6],r[l][7]),e=e+f.getTotalLength(),h=[r[l][6],r[l][7]],o.push(f)):r[l][0]==="a"&&(f=new Ut(h[0],h[1],r[l][1],r[l][2],r[l][3],r[l][4],r[l][5],h[0]+r[l][6],h[1]+r[l][7]),e=e+f.getTotalLength(),h=[h[0]+r[l][6],h[1]+r[l][7]],o.push(f)),t.push(e);return i}i.getTotalLength=function(){return e},i.getPointAtLength=function(a){var r=s(a);return o[r.i].getPointAtLength(r.fraction)},i.getTangentAtLength=function(a){var r=s(a);return o[r.i].getTangentAtLength(r.fraction)},i.getPropertiesAtLength=function(a){var r=s(a);return o[r.i].getPropertiesAtLength(r.fraction)};var s=function(a){a<0?a=0:a>e&&(a=e);for(var r=t.length-1;t[r]>=a&&t[r]>0;)r--;return r++,{fraction:a-t[r-1],i:r}};return i(n)}function F0(n,e){return Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1]))}function zt(n,e,t){return[n[0]+(e[0]-n[0])*t,n[1]+(e[1]-n[1])*t]}function hn(n,e){return F0(n,e)<1e-9}function ln(n,e,t){let o=n.map((i,s)=>cn(i,e[s]));return function(i){let s=o.map(a=>a(i));return t?gn(s):s}}function cn(n,e){return function(t){return n.map((o,i)=>o+t*(e[i]-o))}}function R0(n){return typeof n=="number"&&isFinite(n)}const st=`All shapes must be supplied as arrays of [x, y] points or an SVG path string (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d).
|
|
1
|
+
(function(I,$){typeof exports=="object"&&typeof module<"u"?$(exports):typeof define=="function"&&define.amd?define(["exports"],$):(I=typeof globalThis<"u"?globalThis:I||self,$(I.Presenter={}))})(this,(function(I){"use strict";var On=Object.defineProperty;var kn=(I,$,m0)=>$ in I?On(I,$,{enumerable:!0,configurable:!0,writable:!0,value:m0}):I[$]=m0;var _=(I,$,m0)=>kn(I,typeof $!="symbol"?$+"":$,m0);var b0,A0,M0,L0,T0;const $={ANIMATE:"Animate",PAUSE:"Pause",UPDATE:"Update"};function m0(n){return n*n*n}function Vt(n){return--n*n*n+1}function Kt(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var B0=1.70158;(function n(e){e=+e;function t(o){return(o=+o)*o*(e*(o-1)+o)}return t.overshoot=n,t})(B0),(function n(e){e=+e;function t(o){return--o*o*((o+1)*e+o)+1}return t.overshoot=n,t})(B0);var Qt=(function n(e){e=+e;function t(o){return((o*=2)<1?o*o*((e+1)*o-e):(o-=2)*o*((e+1)*o+e)+2)/2}return t.overshoot=n,t})(B0);const k0={LINEAR:n=>n,CUBIC:Kt,CUBIC_IN:m0,CUBIC_OUT:Vt,BACK_IN_OUT:Qt.overshoot(.8)},Jt=k0.LINEAR;function F0(n,e,t={}){return{type:$.ANIMATE,object:n,props:e,delay:0,duration:1e3,easing:Jt,block:!1,interpolators:null,isKey:!1,shortcut:null,...typeof t=="number"?{duration:t}:t}}function t1(n,e={}){return F0(n,{opacity:1},{duration:500,easing:k0.CUBIC,...typeof e=="number"?{duration:e}:e})}function e1(n,e={}){return F0(n,{opacity:0},{duration:500,easing:k0.CUBIC,...typeof e=="number"?{duration:e}:e})}function D0(n,e){return{type:$.UPDATE,isKey:!1,object:n,props:e,shortcut:null}}function n1(n){return D0(n,{opacity:0})}function r1(n){return D0(n,{opacity:1})}const t0={TOP_LEFT:"TopLeft",TOP:"Top",TOP_RIGHT:"TopRight",LEFT:"Left",CENTER:"Center",RIGHT:"Right",BOTTOM_LEFT:"BottomLeft",BOTTOM:"Bottom",BOTTOM_RIGHT:"BottomRight"},i0=t0.TOP_LEFT;function X(n,e=0,t=0,o=1){if(typeof n=="string"){const i=n.replace("#",""),s=parseInt(i,16);return isNaN(s)?(console.warn("Invalid hex color format:",n),J):i.length===6?{red:s>>16&255,green:s>>8&255,blue:s&255,alpha:1}:i.length===8?{red:s>>24&255,green:s>>16&255,blue:s>>8&255,alpha:(s&255)/255}:(console.warn("Invalid hex color format:",n),J)}else if(typeof n=="number")return{red:n,green:e??0,blue:t??0,alpha:o??1};return{red:0,green:0,blue:0,alpha:1,...n}}X.BLACK=X(0,0,0),X.BLUE=X(0,0,255),X.GREEN=X(0,255,0),X.RED=X(255,0,0),X.TRANSPARENT=X(0,0,0,0),X.WHITE=X(255,255,255);const J={red:0,green:0,blue:0,alpha:1};function j0(n=null){return{content:null,setup:null,anchor:t0.TOP_LEFT,height:0,width:0,x:0,y:0,...n}}function lt(n,e=null){return n.alpha*(e??1)}function P0(n,e=null){const{red:t,green:o,blue:i}=n,s=t<<16|o<<8|i,a=Math.round(lt(n,e)*255);return`#${s.toString(16).padStart(6,"0")}${a!==255?a.toString(16).padStart(2,"0"):""}`}function i1(n=null){const{url:e="https://wikipedia.org/",backgroundColor:t=X.TRANSPARENT,borderColor:o=J,borderWidth:i=0,pointerEvents:s="auto",scale:a=1,anchor:r=i0,height:h=1e3,width:c=1e3,x:f=0,y=0}=n||{},l=document.createElement("iframe");l.src=e,l.style.backgroundColor=P0(t),l.style.border=i>0?`${i}px solid ${P0(o)}`:"none",l.style.pointerEvents=s;const u=(100/a).toFixed(3)+"%";return l.style.height=i===0?u:`calc(${u} - ${i*2}px)`,l.style.width=i===0?u:`calc(${u} - ${i*2}px)`,l.style.transform=`scale(${a})`,l.style.transformOrigin="top left",j0({content:l,anchor:r,height:h,width:c,x:f,y})}const f0={LEFT:"left",CENTER:"center",RIGHT:"right"},o1=f0.LEFT;function o0(n,e){throw new Error("Unexpected value: "+n)}function a1(n=null){const{alignment:e=f0.LEFT,scale:t=1,anchor:o=i0,height:i=1e3,width:s=1e3,x:a=0,y:r=0}=n||{};function h(c){const f=document.createElement("video");switch(f.autoplay=!0,f.style.transform=`scale(${t})`,e){case f0.LEFT:f.style.transformOrigin="top left";break;case f0.CENTER:f.style.transformOrigin="top center";break;case f0.RIGHT:f.style.transformOrigin="top right";break;default:o0(e)}c.appendChild(f);const y={video:{displaySurface:"window"},audio:!1};return navigator.mediaDevices.getDisplayMedia(y).then(l=>{const u=l.getVideoTracks()[0];u!==void 0&&(u.onended=function(){f.style.display="none"}),f.srcObject=l,f.play()}).catch(l=>{console.error("Could not start screen capture -",l)}),()=>{f.srcObject.getTracks().forEach(u=>u.stop()),f.style.display="none",f.srcObject=null}}return j0({content:null,setup:h,anchor:o,height:i,width:s,x:a,y:r})}const D={ARROW:"Arrow",CIRCLE:"Circle",GROUP:"Group",IMAGE:"Image",LINE:"Line",MASK:"Mask",PATH:"Path",POLYGON:"Polygon",RECTANGLE:"Rectangle",SLIDE_OBJECT:"SlideObject",SVG:"SVG",TEXT:"Text"};function e0(n){return{objectType:D.SLIDE_OBJECT,opacity:1,...n}}function s1(n=null){const{arrowheadSize:e,width:t=10,...o}=n||{},i=e??t*4;return e0({objectType:D.ARROW,arrowheadSize:i,color:J,drawn:1,endX:100,endY:100,isArrowheadDoubled:!1,isArrowheadFilled:!1,isDrawnFromCenter:!1,startX:0,startY:0,width:t,...o})}const h1=50;function l1(n=null){return e0({objectType:D.CIRCLE,anchor:i0,borderColor:J,borderWidth:0,drawn:1,fill:J,radius:h1,x:0,y:0,...n})}function z0(n,e=null){return e0({objectType:D.GROUP,anchor:i0,height:0,objects:n,previewColor:null,rotateOriginPreviewSize:0,rotateOriginX:0,rotateOriginY:0,rotation:0,scale:1,width:0,x:0,y:0,...e})}function c1(n){const{anchor:e=i0,cols:t=1,rows:o=1,gapX:i=0,gapY:s=0,width:a=0,height:r=0,x:h=0,y:c=0,objects:f=()=>null}=n,y=[],l=[];let u=0,m=0;for(let M=0;M<o;M++){const C=[];u=0;let E=0;for(let L=0;L<t;L++){const S=f(M,L),P=typeof a=="function"?a(M,L):a,R=typeof r=="function"?r(M,L):r;C.push(S),S!=null&&l.push(z0([S],{x:u,y:m})),u+=P+i,E=Math.max(E,R)}y.push(C),m+=E+s}return{grid:z0(l,{x:h,y:c,height:m-s,width:u-i,anchor:e}),objects:y}}function u1(n=null){return e0({objectType:D.IMAGE,anchor:i0,height:100,imageId:"",rounding:0,smooth:!0,width:100,x:0,y:0,...n})}function f1(n=null){return e0({objectType:D.LINE,color:J,drawn:1,endX:100,endY:100,isDrawnFromCenter:!1,isRounded:!1,startX:0,startY:0,width:10,...n})}function g1(n,e=null){return e0({objectType:D.MASK,anchor:i0,height:100,objects:n,preview:!1,width:100,x:0,y:0,...e})}var p1=Object.defineProperty,O=(n,e)=>p1(n,"name",{value:e,configurable:!0}),C0={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},d1=/([astvzqmhlc])([^astvzqmhlc]*)/gi,y1=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi,x1=O(n=>{const e=(n&&n.length>0?n:"M0,0").match(d1);if(!e)throw new Error(`No path elements found in string ${n}`);return e.reduce((t,o)=>{let i=o.charAt(0),s=i.toLowerCase(),a=v1(o.substring(1));if(s==="m"&&a.length>2&&(t.push([i,...a.splice(0,2)]),s="l",i=i==="m"?"l":"L"),s.toLowerCase()==="a"&&(a.length===5||a.length===6)){const r=o.substring(1).trim().split(" ");a=[Number(r[0]),Number(r[1]),Number(r[2]),Number(r[3].charAt(0)),Number(r[3].charAt(1)),Number(r[3].substring(2)),Number(r[4])]}for(;a.length>=0;){if(a.length===C0[s]){t.push([i,...a.splice(0,C0[s])]);break}if(a.length<C0[s])throw new Error(`Malformed path data: "${i}" must have ${C0[s]} elements and has ${a.length}: ${o}`);t.push([i,...a.splice(0,C0[s])])}return t},[])},"default"),v1=O(n=>{const e=n.match(y1);return e?e.map(Number):[]},"parseValues"),n0=(b0=class{constructor(e,t,o,i){_(this,"x0");_(this,"x1");_(this,"y0");_(this,"y1");_(this,"getTotalLength",O(()=>Math.sqrt(Math.pow(this.x0-this.x1,2)+Math.pow(this.y0-this.y1,2)),"getTotalLength"));_(this,"getPointAtLength",O(e=>{let t=e/Math.sqrt(Math.pow(this.x0-this.x1,2)+Math.pow(this.y0-this.y1,2));t=Number.isNaN(t)?1:t;const o=(this.x1-this.x0)*t,i=(this.y1-this.y0)*t;return{x:this.x0+o,y:this.y0+i}},"getPointAtLength"));_(this,"getTangentAtLength",O(e=>{const t=Math.sqrt((this.x1-this.x0)*(this.x1-this.x0)+(this.y1-this.y0)*(this.y1-this.y0));return{x:(this.x1-this.x0)/t,y:(this.y1-this.y0)/t}},"getTangentAtLength"));_(this,"getPropertiesAtLength",O(e=>{const t=this.getPointAtLength(e),o=this.getTangentAtLength(e);return{x:t.x,y:t.y,tangentX:o.x,tangentY:o.y}},"getPropertiesAtLength"));this.x0=e,this.x1=t,this.y0=o,this.y1=i}},O(b0,"LinearPosition"),b0),ct=(A0=class{constructor(e,t,o,i,s,a,r,h,c){_(this,"x0");_(this,"y0");_(this,"rx");_(this,"ry");_(this,"xAxisRotate");_(this,"LargeArcFlag");_(this,"SweepFlag");_(this,"x1");_(this,"y1");_(this,"length");_(this,"getTotalLength",O(()=>this.length,"getTotalLength"));_(this,"getPointAtLength",O(e=>{e<0?e=0:e>this.length&&(e=this.length);const t=ut({x:this.x0,y:this.y0},this.rx,this.ry,this.xAxisRotate,this.LargeArcFlag,this.SweepFlag,{x:this.x1,y:this.y1},e/this.length);return{x:t.x,y:t.y}},"getPointAtLength"));_(this,"getTangentAtLength",O(e=>{e<0?e=0:e>this.length&&(e=this.length);const t=.05,o=this.getPointAtLength(e);let i;e<0?e=0:e>this.length&&(e=this.length),i=e<this.length-t?this.getPointAtLength(e+t):this.getPointAtLength(e-t);const s=i.x-o.x,a=i.y-o.y,r=Math.sqrt(s*s+a*a);return e<this.length-t?{x:-s/r,y:-a/r}:{x:s/r,y:a/r}},"getTangentAtLength"));_(this,"getPropertiesAtLength",O(e=>{const t=this.getTangentAtLength(e),o=this.getPointAtLength(e);return{x:o.x,y:o.y,tangentX:t.x,tangentY:t.y}},"getPropertiesAtLength"));this.x0=e,this.y0=t,this.rx=o,this.ry=i,this.xAxisRotate=s,this.LargeArcFlag=a,this.SweepFlag=r,this.x1=h,this.y1=c;const f=w1(300,function(y){return ut({x:e,y:t},o,i,s,a,r,{x:h,y:c},y)});this.length=f.arcLength}},O(A0,"Arc"),A0),ut=O((n,e,t,o,i,s,a,r)=>{e=Math.abs(e),t=Math.abs(t),o=m1(o,360);const h=b1(o);if(n.x===a.x&&n.y===a.y)return{x:n.x,y:n.y,ellipticalArcAngle:0};if(e===0||t===0)return{x:0,y:0,ellipticalArcAngle:0};const c=(n.x-a.x)/2,f=(n.y-a.y)/2,y={x:Math.cos(h)*c+Math.sin(h)*f,y:-Math.sin(h)*c+Math.cos(h)*f},l=Math.pow(y.x,2)/Math.pow(e,2)+Math.pow(y.y,2)/Math.pow(t,2);l>1&&(e=Math.sqrt(l)*e,t=Math.sqrt(l)*t);let u=(Math.pow(e,2)*Math.pow(t,2)-Math.pow(e,2)*Math.pow(y.y,2)-Math.pow(t,2)*Math.pow(y.x,2))/(Math.pow(e,2)*Math.pow(y.y,2)+Math.pow(t,2)*Math.pow(y.x,2));u=u<0?0:u;const m=(i!==s?1:-1)*Math.sqrt(u),x=m*(e*y.y/t),M=m*(-t*y.x/e),C={x:Math.cos(h)*x-Math.sin(h)*M+(n.x+a.x)/2,y:Math.sin(h)*x+Math.cos(h)*M+(n.y+a.y)/2},E={x:(y.x-x)/e,y:(y.y-M)/t},L=gt({x:1,y:0},E);let S=gt(E,{x:(-y.x-x)/e,y:(-y.y-M)/t});!s&&S>0?S-=2*Math.PI:s&&S<0&&(S+=2*Math.PI),S%=2*Math.PI;const P=L+S*r,R=e*Math.cos(P),W=t*Math.sin(P);return{x:Math.cos(h)*R-Math.sin(h)*W+C.x,y:Math.sin(h)*R+Math.cos(h)*W+C.y,ellipticalArcStartAngle:L,ellipticalArcEndAngle:L+S,ellipticalArcAngle:P,ellipticalArcCenter:C,resultantRx:e,resultantRy:t}},"pointOnEllipticalArc"),w1=O((n,e)=>{n=n??500;let t=0;const o=[],i=[];let s,a=e(0);for(let r=0;r<n;r++){const h=A1(r*(1/n),0,1);s=e(h),t+=ft(a,s),i.push([a,s]),o.push({t:h,arcLength:t}),a=s}return s=e(1),i.push([a,s]),t+=ft(a,s),o.push({t:1,arcLength:t}),{arcLength:t,arcLengthMap:o,approximationLines:i}},"approximateArcLengthOfCurve"),m1=O((n,e)=>(n%e+e)%e,"mod"),b1=O(n=>n*(Math.PI/180),"toRadians"),ft=O((n,e)=>Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2)),"distance"),A1=O((n,e,t)=>Math.min(Math.max(n,e),t),"clamp"),gt=O((n,e)=>{const t=n.x*e.x+n.y*e.y,o=Math.sqrt((Math.pow(n.x,2)+Math.pow(n.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2)));return(n.x*e.y-n.y*e.x<0?-1:1)*Math.acos(t/o)},"angleBetween"),M1=[[],[],[-.5773502691896257,.5773502691896258],[0,-.7745966692414833,.7745966692414833],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],L1=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],T1=[[1],[1,1],[1,2,1],[1,3,3,1]],P1=O((n,e,t)=>({x:(1-t)*(1-t)*(1-t)*n[0]+3*(1-t)*(1-t)*t*n[1]+3*(1-t)*t*t*n[2]+t*t*t*n[3],y:(1-t)*(1-t)*(1-t)*e[0]+3*(1-t)*(1-t)*t*e[1]+3*(1-t)*t*t*e[2]+t*t*t*e[3]}),"cubicPoint"),C1=O((n,e,t)=>pt([3*(n[1]-n[0]),3*(n[2]-n[1]),3*(n[3]-n[2])],[3*(e[1]-e[0]),3*(e[2]-e[1]),3*(e[3]-e[2])],t),"cubicDerivative"),E1=O((n,e,t)=>{let o,i;const s=t/2;o=0;for(let a=0;a<20;a++)i=s*M1[20][a]+s,o+=L1[20][a]*dt(n,e,i);return s*o},"getCubicArcLength"),pt=O((n,e,t)=>({x:(1-t)*(1-t)*n[0]+2*(1-t)*t*n[1]+t*t*n[2],y:(1-t)*(1-t)*e[0]+2*(1-t)*t*e[1]+t*t*e[2]}),"quadraticPoint"),S1=O((n,e,t)=>{t===void 0&&(t=1);const o=n[0]-2*n[1]+n[2],i=e[0]-2*e[1]+e[2],s=2*n[1]-2*n[0],a=2*e[1]-2*e[0],r=4*(o*o+i*i),h=4*(o*s+i*a),c=s*s+a*a;if(r===0)return t*Math.sqrt(Math.pow(n[2]-n[0],2)+Math.pow(e[2]-e[0],2));const f=h/(2*r),y=t+f,l=c/r-f*f,u=y*y+l>0?Math.sqrt(y*y+l):0,m=f*f+l>0?Math.sqrt(f*f+l):0,x=f+Math.sqrt(f*f+l)!==0&&(y+u)/(f+m)!==0?l*Math.log(Math.abs((y+u)/(f+m))):0;return Math.sqrt(r)/2*(y*u-f*m+x)},"getQuadraticArcLength"),I1=O((n,e,t)=>({x:2*(1-t)*(n[1]-n[0])+2*t*(n[2]-n[1]),y:2*(1-t)*(e[1]-e[0])+2*t*(e[2]-e[1])}),"quadraticDerivative");function dt(n,e,t){const o=U0(1,t,n),i=U0(1,t,e),s=o*o+i*i;return Math.sqrt(s)}O(dt,"BFunc");var U0=O((n,e,t)=>{const o=t.length-1;let i,s;if(o===0)return 0;if(n===0){s=0;for(let a=0;a<=o;a++)s+=T1[o][a]*Math.pow(1-e,o-a)*Math.pow(e,a)*t[a];return s}i=new Array(o);for(let a=0;a<o;a++)i[a]=o*(t[a+1]-t[a]);return U0(n-1,e,i)},"getDerivative"),H0=O((n,e,t)=>{let o=1,i=n/e,s=(n-t(i))/e,a=0;for(;o>.001;){const r=t(i+s),h=Math.abs(n-r)/e;if(h<o)o=h,i+=s;else{const c=t(i-s),f=Math.abs(n-c)/e;f<o?(o=f,i-=s):s/=2}if(a++,a>500)break}return i},"t2length"),l0=(M0=class{constructor(e,t,o,i,s,a,r,h){_(this,"a");_(this,"b");_(this,"c");_(this,"d");_(this,"length");_(this,"getArcLength");_(this,"getPoint");_(this,"getDerivative");_(this,"getTotalLength",O(()=>this.length,"getTotalLength"));_(this,"getPointAtLength",O(e=>{const t=[this.a.x,this.b.x,this.c.x,this.d.x],o=[this.a.y,this.b.y,this.c.y,this.d.y],i=H0(e,this.length,s=>this.getArcLength(t,o,s));return this.getPoint(t,o,i)},"getPointAtLength"));_(this,"getTangentAtLength",O(e=>{const t=[this.a.x,this.b.x,this.c.x,this.d.x],o=[this.a.y,this.b.y,this.c.y,this.d.y],i=H0(e,this.length,h=>this.getArcLength(t,o,h)),s=this.getDerivative(t,o,i),a=Math.sqrt(s.x*s.x+s.y*s.y);let r;return r=a>0?{x:s.x/a,y:s.y/a}:{x:0,y:0},r},"getTangentAtLength"));_(this,"getPropertiesAtLength",O(e=>{const t=[this.a.x,this.b.x,this.c.x,this.d.x],o=[this.a.y,this.b.y,this.c.y,this.d.y],i=H0(e,this.length,c=>this.getArcLength(t,o,c)),s=this.getDerivative(t,o,i),a=Math.sqrt(s.x*s.x+s.y*s.y);let r;r=a>0?{x:s.x/a,y:s.y/a}:{x:0,y:0};const h=this.getPoint(t,o,i);return{x:h.x,y:h.y,tangentX:r.x,tangentY:r.y}},"getPropertiesAtLength"));_(this,"getC",O(()=>this.c,"getC"));_(this,"getD",O(()=>this.d,"getD"));this.a={x:e,y:t},this.b={x:o,y:i},this.c={x:s,y:a},r!==void 0&&h!==void 0?(this.getArcLength=E1,this.getPoint=P1,this.getDerivative=C1,this.d={x:r,y:h}):(this.getArcLength=S1,this.getPoint=pt,this.getDerivative=I1,this.d={x:0,y:0}),this.length=this.getArcLength([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],1)}},O(M0,"Bezier"),M0),_1=(L0=class{constructor(e){_(this,"length",0);_(this,"partial_lengths",[]);_(this,"functions",[]);_(this,"initial_point",null);_(this,"getPartAtLength",O(e=>{e<0?e=0:e>this.length&&(e=this.length);let t=this.partial_lengths.length-1;for(;this.partial_lengths[t]>=e&&t>0;)t--;return t++,{fraction:e-this.partial_lengths[t-1],i:t}},"getPartAtLength"));_(this,"getTotalLength",O(()=>this.length,"getTotalLength"));_(this,"getPointAtLength",O(e=>{const t=this.getPartAtLength(e),o=this.functions[t.i];if(o)return o.getPointAtLength(t.fraction);if(this.initial_point)return this.initial_point;throw new Error("Wrong function at this part.")},"getPointAtLength"));_(this,"getTangentAtLength",O(e=>{const t=this.getPartAtLength(e),o=this.functions[t.i];if(o)return o.getTangentAtLength(t.fraction);if(this.initial_point)return{x:0,y:0};throw new Error("Wrong function at this part.")},"getTangentAtLength"));_(this,"getPropertiesAtLength",O(e=>{const t=this.getPartAtLength(e),o=this.functions[t.i];if(o)return o.getPropertiesAtLength(t.fraction);if(this.initial_point)return{x:this.initial_point.x,y:this.initial_point.y,tangentX:0,tangentY:0};throw new Error("Wrong function at this part.")},"getPropertiesAtLength"));_(this,"getParts",O(()=>{const e=[];for(let t=0;t<this.functions.length;t++)if(this.functions[t]!==null){this.functions[t]=this.functions[t];const o={start:this.functions[t].getPointAtLength(0),end:this.functions[t].getPointAtLength(this.partial_lengths[t]-this.partial_lengths[t-1]),length:this.partial_lengths[t]-this.partial_lengths[t-1],getPointAtLength:this.functions[t].getPointAtLength,getTangentAtLength:this.functions[t].getTangentAtLength,getPropertiesAtLength:this.functions[t].getPropertiesAtLength};e.push(o)}return e},"getParts"));const t=Array.isArray(e)?e:x1(e);let o,i=[0,0],s=[0,0],a=[0,0];for(let r=0;r<t.length;r++){if(t[r][0]==="M")i=[t[r][1],t[r][2]],a=[i[0],i[1]],this.functions.push(null),r===0&&(this.initial_point={x:t[r][1],y:t[r][2]});else if(t[r][0]==="m")i=[t[r][1]+i[0],t[r][2]+i[1]],a=[i[0],i[1]],this.functions.push(null);else if(t[r][0]==="L")this.length+=Math.sqrt(Math.pow(i[0]-t[r][1],2)+Math.pow(i[1]-t[r][2],2)),this.functions.push(new n0(i[0],t[r][1],i[1],t[r][2])),i=[t[r][1],t[r][2]];else if(t[r][0]==="l")this.length+=Math.sqrt(Math.pow(t[r][1],2)+Math.pow(t[r][2],2)),this.functions.push(new n0(i[0],t[r][1]+i[0],i[1],t[r][2]+i[1])),i=[t[r][1]+i[0],t[r][2]+i[1]];else if(t[r][0]==="H")this.length+=Math.abs(i[0]-t[r][1]),this.functions.push(new n0(i[0],t[r][1],i[1],i[1])),i[0]=t[r][1];else if(t[r][0]==="h")this.length+=Math.abs(t[r][1]),this.functions.push(new n0(i[0],i[0]+t[r][1],i[1],i[1])),i[0]=t[r][1]+i[0];else if(t[r][0]==="V")this.length+=Math.abs(i[1]-t[r][1]),this.functions.push(new n0(i[0],i[0],i[1],t[r][1])),i[1]=t[r][1];else if(t[r][0]==="v")this.length+=Math.abs(t[r][1]),this.functions.push(new n0(i[0],i[0],i[1],i[1]+t[r][1])),i[1]=t[r][1]+i[1];else if(t[r][0]==="z"||t[r][0]==="Z")this.length+=Math.sqrt(Math.pow(a[0]-i[0],2)+Math.pow(a[1]-i[1],2)),this.functions.push(new n0(i[0],a[0],i[1],a[1])),i=[a[0],a[1]];else if(t[r][0]==="C")o=new l0(i[0],i[1],t[r][1],t[r][2],t[r][3],t[r][4],t[r][5],t[r][6]),this.length+=o.getTotalLength(),i=[t[r][5],t[r][6]],this.functions.push(o);else if(t[r][0]==="c")o=new l0(i[0],i[1],i[0]+t[r][1],i[1]+t[r][2],i[0]+t[r][3],i[1]+t[r][4],i[0]+t[r][5],i[1]+t[r][6]),o.getTotalLength()>0?(this.length+=o.getTotalLength(),this.functions.push(o),i=[t[r][5]+i[0],t[r][6]+i[1]]):this.functions.push(new n0(i[0],i[0],i[1],i[1]));else if(t[r][0]==="S"){if(r>0&&["C","c","S","s"].indexOf(t[r-1][0])>-1){if(o){const h=o.getC();o=new l0(i[0],i[1],2*i[0]-h.x,2*i[1]-h.y,t[r][1],t[r][2],t[r][3],t[r][4])}}else o=new l0(i[0],i[1],i[0],i[1],t[r][1],t[r][2],t[r][3],t[r][4]);o&&(this.length+=o.getTotalLength(),i=[t[r][3],t[r][4]],this.functions.push(o))}else if(t[r][0]==="s"){if(r>0&&["C","c","S","s"].indexOf(t[r-1][0])>-1){if(o){const h=o.getC(),c=o.getD();o=new l0(i[0],i[1],i[0]+c.x-h.x,i[1]+c.y-h.y,i[0]+t[r][1],i[1]+t[r][2],i[0]+t[r][3],i[1]+t[r][4])}}else o=new l0(i[0],i[1],i[0],i[1],i[0]+t[r][1],i[1]+t[r][2],i[0]+t[r][3],i[1]+t[r][4]);o&&(this.length+=o.getTotalLength(),i=[t[r][3]+i[0],t[r][4]+i[1]],this.functions.push(o))}else if(t[r][0]==="Q"){if(i[0]===t[r][1]&&i[1]===t[r][2]){const h=new n0(t[r][1],t[r][3],t[r][2],t[r][4]);this.length+=h.getTotalLength(),this.functions.push(h)}else o=new l0(i[0],i[1],t[r][1],t[r][2],t[r][3],t[r][4],void 0,void 0),this.length+=o.getTotalLength(),this.functions.push(o);i=[t[r][3],t[r][4]],s=[t[r][1],t[r][2]]}else if(t[r][0]==="q"){if(t[r][1]!==0||t[r][2]!==0)o=new l0(i[0],i[1],i[0]+t[r][1],i[1]+t[r][2],i[0]+t[r][3],i[1]+t[r][4],void 0,void 0),this.length+=o.getTotalLength(),this.functions.push(o);else{const h=new n0(i[0]+t[r][1],i[0]+t[r][3],i[1]+t[r][2],i[1]+t[r][4]);this.length+=h.getTotalLength(),this.functions.push(h)}s=[i[0]+t[r][1],i[1]+t[r][2]],i=[t[r][3]+i[0],t[r][4]+i[1]]}else if(t[r][0]==="T"){if(r>0&&["Q","q","T","t"].indexOf(t[r-1][0])>-1)o=new l0(i[0],i[1],2*i[0]-s[0],2*i[1]-s[1],t[r][1],t[r][2],void 0,void 0),this.functions.push(o),this.length+=o.getTotalLength();else{const h=new n0(i[0],t[r][1],i[1],t[r][2]);this.functions.push(h),this.length+=h.getTotalLength()}s=[2*i[0]-s[0],2*i[1]-s[1]],i=[t[r][1],t[r][2]]}else if(t[r][0]==="t"){if(r>0&&["Q","q","T","t"].indexOf(t[r-1][0])>-1)o=new l0(i[0],i[1],2*i[0]-s[0],2*i[1]-s[1],i[0]+t[r][1],i[1]+t[r][2],void 0,void 0),this.length+=o.getTotalLength(),this.functions.push(o);else{const h=new n0(i[0],i[0]+t[r][1],i[1],i[1]+t[r][2]);this.length+=h.getTotalLength(),this.functions.push(h)}s=[2*i[0]-s[0],2*i[1]-s[1]],i=[t[r][1]+i[0],t[r][2]+i[1]]}else if(t[r][0]==="A"){const h=new ct(i[0],i[1],t[r][1],t[r][2],t[r][3],t[r][4]===1,t[r][5]===1,t[r][6],t[r][7]);this.length+=h.getTotalLength(),i=[t[r][6],t[r][7]],this.functions.push(h)}else if(t[r][0]==="a"){const h=new ct(i[0],i[1],t[r][1],t[r][2],t[r][3],t[r][4]===1,t[r][5]===1,i[0]+t[r][6],i[1]+t[r][7]);this.length+=h.getTotalLength(),i=[i[0]+t[r][6],i[1]+t[r][7]],this.functions.push(h)}this.partial_lengths.push(this.length)}}},O(L0,"SVGPathProperties"),L0),G0=(T0=class{constructor(e){_(this,"inst");_(this,"getTotalLength",O(()=>this.inst.getTotalLength(),"getTotalLength"));_(this,"getPointAtLength",O(e=>this.inst.getPointAtLength(e),"getPointAtLength"));_(this,"getTangentAtLength",O(e=>this.inst.getTangentAtLength(e),"getTangentAtLength"));_(this,"getPropertiesAtLength",O(e=>this.inst.getPropertiesAtLength(e),"getPropertiesAtLength"));_(this,"getParts",O(()=>this.inst.getParts(),"getParts"));if(this.inst=new _1(e),!(this instanceof G0))return new G0(e)}},O(T0,"_svgPathProperties"),T0);function yt(n=X.BLACK){return{...n,alpha:0}}function O1(n=null){const{path:e,height:t=100,width:o=100,viewboxHeight:i,viewboxWidth:s,...a}=n??{},r=e??"M 0 0 L 100 100",c=new G0(r).getTotalLength();return e0({objectType:D.PATH,anchor:i0,color:J,drawn:1,fill:yt(),isRounded:!1,height:t,path:r,pathLength:c,strokeWidth:4,viewboxHeight:i??t,viewboxWidth:s??o,width:o,x:0,y:0,...a})}function k1(n=null){return e0({objectType:D.POLYGON,borderColor:J,borderWidth:0,drawn:1,points:[{x:0,y:0},{x:100,y:0},{x:100,y:100}],fill:J,...n})}function F1(n=null){return e0({objectType:D.RECTANGLE,anchor:i0,borderColor:J,borderWidth:0,drawn:1,fill:J,height:100,rounding:0,width:100,x:0,y:0,...n})}function R1(n=null){return e0({objectType:D.SVG,anchor:i0,height:100,svg:"",width:100,x:0,y:0,...n})}const xt={NORMAL:"normal",ITALIC:"italic",OBLIQUE:"oblique"},N1=xt.NORMAL,vt={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900},q1=vt.NORMAL,B1={color:J,fontFamily:"sans-serif",fontSize:100,fontStyle:N1,fontWeight:q1,ligatures:!1};function wt(n){return typeof n=="string"?[[{text:n}]]:n.map(e=>e.map(t=>typeof t=="string"?{text:t}:t))}function mt(n){return wt(n).reduce((t,o)=>t+o.reduce((i,s)=>i+s.text.length,0),0)}function bt(n="",e=null){return e0({objectType:D.TEXT,alignment:o1,anchor:i0,length:null,lineSpacing:1,text:n,x:0,y:0,...B1,...e})}bt.writeOn=(n,e={})=>F0(n,{length:mt(n.text)},e);let V=null;function D1({presentation:n,onNavigateToSlide:e}){if(V!==null&&!V.closed){V.focus();return}if(V=window.open("","Navigator","width=300,height=500,left=20,top=50"),V===null){console.error("Failed to open navigator window.");return}const t=j1(n,e);V.document.title=n.title,V.document.body.appendChild(t),V.addEventListener("keyup",o=>{(o.key==="Escape"||o.key==="`")&&(V==null||V.close(),V=null)})}function j1(n,e){const t=document.createElement("div");return t.style.fontFamily="Arial, sans-serif",n.slides.forEach((o,i)=>{const s=z1(o,i);s.style.cursor="pointer",s.addEventListener("click",a=>{a.shiftKey&&(V==null||V.close()),e(i)}),t.appendChild(s)}),t}function z1(n,e){const t=document.createElement("div");return t.style.marginBottom="8px",t.style.padding="8px",t.style.backgroundColor="#eceed7",t.style.borderRadius="4px",t.style.userSelect="none",t.innerHTML=`${e+1}: `+(n.title.length>0?n.title:`Slide ${e+1}`),t}function r0(n=null){return{height:0,width:0,...n}}const U1=r0({width:0,height:0});function At(n=null){return{backgroundColor:X.WHITE,slides:[],title:"Presentation",size:r0({width:3840,height:2160}),resources:{images:{}},...n}}function H1(n){const e=Array.isArray(n)?n:[n];let t=0,o=0;for(const i of e)switch(i.type){case $.PAUSE:t+=i.duration;break;case $.ANIMATE:o=Math.max(o,t+i.delay+i.duration),i.block&&(t+=i.delay+i.duration);break;case $.UPDATE:break;default:o0(i)}return o}function W0(n,e=null){const{red:t,green:o,blue:i}=n,s=lt(n,e);return`rgba(${t}, ${o}, ${i}, ${s})`}function G1(n){return n===document.body}function W1(n,e){const t=document.createElement("div");if(t.style.width="100%",t.style.aspectRatio=`${n.size.width} / ${n.size.height}`,t.style.position="relative",t.style.top="50%",t.style.transform="translateY(-50%)",t.style.marginLeft="auto",t.style.marginRight="auto",G1(e)){t.style.overflowY="clip",document.title=n.title,document.documentElement.style.height="100%",document.body.style.margin="0",document.body.style.height="100%",document.body.style.width="100%",document.body.style.backgroundColor="#000000";const o=n.size.height/n.size.width;Mt(t,o),window.matchMedia(`(min-aspect-ratio: ${n.size.width} / ${n.size.height})`).addEventListener("change",()=>Mt(t,o))}return t}function Mt(n,e){window.innerHeight/window.innerWidth>e?(n.style.width="100%",n.style.height="auto"):(n.style.width="auto",n.style.height="100%")}const Lt={check:n=>typeof n=="object"&&n!==null&&typeof n.red=="number"&&typeof n.green=="number"&&typeof n.blue=="number"&&typeof n.alpha=="number",interpolate:(n,e,t)=>({red:Math.round(n.red+(e.red-n.red)*t),green:Math.round(n.green+(e.green-n.green)*t),blue:Math.round(n.blue+(e.blue-n.blue)*t),alpha:n.alpha+(e.alpha-n.alpha)*t})},$1={check:n=>!0,interpolate:(n,e)=>e},Tt={check:n=>typeof n=="number",interpolate:(n,e,t)=>n+(e-n)*t},Pt=[Tt,Lt,$1];function Y1(n,e,t,o=null){if(t===0)return n;if(t===1)return{...n,...e};const i=o!=null?[...o,...Pt]:Pt,s={};for(const a in e){const r=n[a],h=e[a];for(const c of i)if(c.check(r,a)&&c.check(h,a)){s[a]=c.interpolate(r,h,t);break}}return{...n,...s}}function Ct(n,e,t=null){if(e===null)return;const o=Array.isArray(e)?e:[e];let i=0;for(const s of o){if(t!==null&&i>t)break;switch(s.type){case $.ANIMATE:{const a=n.get(s.object);if(a===void 0)break;const r=t!==null?t-i:null,h=Math.max(Math.min(r!==null?(r-s.delay)/s.duration:1,1),0);n.set(s.object,{...a,...Y1(a,s.props,s.easing(h),s.interpolators)}),s.block&&(i+=s.delay+s.duration);break}case $.UPDATE:{const a=n.get(s.object);if(a===void 0)break;n.set(s.object,{...a,...s.props});break}case $.PAUSE:i+=s.duration;break;default:o0(s)}}}function Et(n){return"objects"in n?n.objects.filter(e=>"objectType"in e):[]}function X1({slide:n,buildIndex:e,buildTime:t}){const o=new Map;function i(a){o.set(a,a);for(const r of Et(a))i(r)}for(const a of n.objects)i(a);const s=t===null?e:e-1;for(let a=0;a<s;a++){const r=n.animations[a]??null;Ct(o,r)}if(t!==null&&e>0){const a=n.animations[e-1]??null;Ct(o,a,t)}return o}function Z1(n){const e={};function t(o){if(o.objectType===D.SVG){const s=o.svg;s!==void 0&&s.length>0&&(e[s]=s)}const i=Et(o);for(const s of i)t(s)}for(const o of n.slides)for(const i of o.objects)t(i);return e}function V1(n){var o;const{slides:e}=n,t={s:{slideIndex:0,buildIndex:0},c:{slideIndex:null,buildIndex:0},e:{slideIndex:e.length-1,buildIndex:((o=e[e.length-1])==null?void 0:o.animations.length)??0}};for(let i=0;i<e.length;i++){const s=e[i];if(s===void 0)continue;const a=s.shortcut;$0(t,a,i,0);for(let r=0;r<s.animations.length;r++){const h=s.animations[r];if(h!==void 0)if(Array.isArray(h))for(const c of h)$0(t,c.shortcut,i,r+1);else $0(t,h.shortcut,i,r+1)}}return t}function $0(n,e,t,o){if(e!==null)if(Array.isArray(e))for(const i of e)n[i]={slideIndex:t,buildIndex:o};else n[e]={slideIndex:t,buildIndex:o}}function K1(n,e,t,{onNext:o,onPrevious:i,onRenderSlide:s,onShowNavigator:a}){t.shortcuts=V1(n),e.addEventListener("mousemove",()=>{e.style.cursor="auto"}),e.addEventListener("keyup",r=>{if(r.code==="Escape"){t.textCommand=null;return}if(r.code==="ArrowRight"||r.code==="Space"){o(r.shiftKey);return}if(r.code==="ArrowLeft"){i(r.shiftKey);return}if(t.textCommand!==null){if(r.code==="Enter"){const h=t.textCommand;t.textCommand=null;const c=t.shortcuts[h];c!==void 0?s(c.slideIndex,c.buildIndex):isNaN(Number(h))||s(Number(h)-1,0);return}else r.code==="Backspace"?t.textCommand=t.textCommand.slice(0,-1):t.textCommand+=r.key;return}if(r.key==="g"){t.textCommand="";return}if(r.key==="`"){a();return}})}const y0="presenterState";function Q1(n,e){const t=localStorage.getItem(y0);if(t===null)return null;if(e===null)return localStorage.removeItem(y0),null;let o;try{o=JSON.parse(t)}catch(c){return console.error("Failed to parse presentation state from localStorage:",c),localStorage.removeItem(y0),null}const{title:i,timestamp:s}=o;let{slideIndex:a,buildIndex:r}=o;if(typeof i!="string"||typeof a!="number"||typeof r!="number"||typeof s!="number"||i!==n.title||Date.now()-s>1e3*60*e)return localStorage.removeItem(y0),null;a>n.slides.length-1&&(a=n.slides.length-1,r=0);const h=n.slides[a];return h===void 0?(localStorage.removeItem(y0),null):(r>h.animations.length&&(r=h.animations.length),{title:i,slideIndex:a,buildIndex:r})}function J1({title:n,slideIndex:e,buildIndex:t}){localStorage.setItem(y0,JSON.stringify({title:n,slideIndex:e,buildIndex:t,timestamp:Date.now()}))}const St=Object.freeze({canvas:null,extrasContainer:null,mountedExtrasCleanups:[],mountedExtrasSlideIndex:null,slideIndex:0,buildIndex:0,currentAnimationId:null,imageById:{},shortcutState:{textCommand:null,shortcuts:{}}}),Q={Browser:"browser",Node:"node"};function te(n,e){e.context.clearRect(0,0,n.width,n.height)}function ee(n){const e=document.createElement("canvas");return e.setAttribute("width",n.width.toString()),e.setAttribute("height",n.height.toString()),e.style.position="absolute",e.style.width="100%",e}const g0={Browser:"browser",Node:"node"};function ne(n){const e=new Path2D(n);return{type:g0.Browser,path:e}}function re(n){const{drawn:e,startX:t,startY:o,endX:i,endY:s,arrowheadSize:a,isArrowheadFilled:r,isDrawnFromCenter:h}=n,c={x:t,y:o},f={x:i,y:s},y=Math.atan2(f.y-c.y,f.x-c.x),l={x:c.x+(f.x-c.x)/2,y:c.y+(f.y-c.y)/2},u=f.x-c.x,m=f.y-c.y,M=Math.hypot(u,m)*e,C=Math.cos(y),E=Math.sin(y),L=h?{x:l.x-C*M/2,y:l.y-E*M/2}:c,S=h?{x:l.x+C*M/2,y:l.y+E*M/2}:{x:c.x+C*M,y:c.y+E*M},P=r?Math.PI/6:Math.PI/4.5,R=M<a*2?M/2:a,W={x:S.x-R*Math.cos(y-P),y:S.y-R*Math.sin(y-P)},K={x:S.x-R*Math.cos(y+P),y:S.y-R*Math.sin(y+P)},U={x:L.x+R*Math.cos(y-P),y:L.y+R*Math.sin(y-P)},Y={x:L.x+R*Math.cos(y+P),y:L.y+R*Math.sin(y+P)};return{arrowPoints:[L,S],arrowheadPoints:[W,S,K],doubledArrowheadPoints:[U,L,Y]}}function x0({ctx:n,color:e,drawn:t=null,isDrawnFromCenter:o=!1,isRounded:i=!1,opacity:s=null,path:a,pathLength:r=null,width:h}){if(!(h===0||t===0)){if(t!==null&&r!==null&&t!==1){const c=r+(i?h:0),f=r*t;o?n.context.setLineDash([0,(c-f)/2,f,(c-f)/2]):n.context.setLineDash([f,c-f])}else n.context.setLineDash([]);if(n.context.lineWidth=h,n.context.strokeStyle=P0(e,s),n.context.lineCap=i?"round":"butt",a===void 0){n.context.stroke();return}switch(n.type){case Q.Browser:a.type===g0.Browser?n.context.stroke(a.path):console.warn("Attempted to use Node Path2D in Browser Canvas context");break;case Q.Node:a.type===g0.Node?n.context.stroke(a.path):console.warn("Attempted to use Browser Path2D in Node Canvas context");break;default:o0(n)}}}function v0({ctx:n,path:e,color:t,opacity:o=null}){if(n.context.fillStyle=W0(t,o),e===void 0){n.context.fill();return}switch(n.type){case Q.Browser:e.type===g0.Browser?n.context.fill(e.path):console.warn("Attempted to use Node Path2D in Browser Canvas context");break;case Q.Node:e.type===g0.Node?n.context.fill(e.path):console.warn("Attempted to use Browser Path2D in Node Canvas context");break;default:o0(n)}}function Y0(n,e){const t=e(),o=n[0];if(o===void 0)return{path:t,length:0};t.path.moveTo(o.x,o.y);let i=0;for(let s=1;s<n.length;s++){const a=n[s],r=n[s-1];if(a===void 0||r===void 0)continue;const h=a.x-r.x,c=a.y-r.y;i+=Math.hypot(h,c),t.path.lineTo(a.x,a.y)}return{path:t,length:i}}const ie=({ctx:n,object:e,opacity:t,createPath2D:o})=>{const i=e.opacity*t;if(i===0||e.drawn===0)return;const{arrowPoints:s,arrowheadPoints:a,doubledArrowheadPoints:r}=re(e),{path:h}=Y0(s,o),{path:c}=Y0(a,o);if(x0({color:e.color,ctx:n,path:h,opacity:i,width:e.width}),e.isArrowheadFilled&&(c.path.closePath(),v0({ctx:n,path:c,color:e.color,opacity:i})),x0({color:e.color,ctx:n,path:c,opacity:i,width:e.width}),e.isArrowheadDoubled){const{path:f}=Y0(r,o);e.isArrowheadFilled&&(f.path.closePath(),v0({ctx:n,path:f,color:e.color,opacity:i})),x0({color:e.color,ctx:n,path:f,opacity:i,width:e.width})}};function oe(n,e){const t=n.radius-n.borderWidth/2;if(t<=0)return;const o=e(),i=-Math.PI/2;return o.path.arc(n.x,n.y,t,i,i+2*Math.PI),o}function ae(n,e){const t=e(),o=-Math.PI/2;t.path.arc(n.x,n.y,n.radius,o,o+2*Math.PI);const i=2*Math.PI*n.radius;return{path:t,length:i}}function It(n,e){switch(n.type){case Q.Browser:e.type===g0.Browser?n.context.clip(e.path):console.warn("Attempted to use Node Path2D in Browser Canvas context");break;case Q.Node:e.type===g0.Node?n.context.clip(e.path):console.warn("Attempted to use Browser Path2D in Node Canvas context");break;default:o0(n)}}const se=({ctx:n,object:e,opacity:t,createPath2D:o})=>{const i=e.opacity*t;if(i===0||e.drawn===0&&e.fill.alpha===0)return;const{path:s,length:a}=ae(e,o);if(i<1&&e.borderWidth>0){const r=oe(e,o);r!==void 0&&(n.context.save(),It(n,r),v0({ctx:n,path:s,color:e.fill,opacity:i}),n.context.restore())}else v0({ctx:n,path:s,color:e.fill,opacity:i});x0({color:e.borderColor,ctx:n,drawn:e.drawn,path:s,pathLength:a,opacity:i,width:e.borderWidth})};function G(n=null){return{x:0,y:0,...n}}const he=G();function c0(n=null){return{origin:he,size:U1,...n}}c0();function p0(n,e,t){const{x:o,y:i}=n,{width:s,height:a}=t;switch(e){case t0.TOP_LEFT:return c0({origin:G({x:o,y:i}),size:t});case t0.TOP:return c0({origin:G({x:o-s/2,y:i}),size:t});case t0.TOP_RIGHT:return c0({origin:G({x:o-s,y:i}),size:t});case t0.LEFT:return c0({origin:G({x:o,y:i-a/2}),size:t});case t0.CENTER:return c0({origin:G({x:o-s/2,y:i-a/2}),size:t});case t0.RIGHT:return c0({origin:G({x:o-s,y:i-a/2}),size:t});case t0.BOTTOM_LEFT:return c0({origin:G({x:o,y:i-a}),size:t});case t0.BOTTOM:return c0({origin:G({x:o-s/2,y:i-a}),size:t});case t0.BOTTOM_RIGHT:return c0({origin:G({x:o-s,y:i-a}),size:t});default:o0(e)}}const le=({ctx:n,object:e,renderObject:t,opacity:o})=>{const i=p0(G({x:e.x,y:e.y}),e.anchor,r0({width:e.width*e.scale,height:e.height*e.scale})),{rotation:s,rotateOriginX:a,rotateOriginY:r}=e;if(e.scale!==0){n.context.translate(i.origin.x,i.origin.y),n.context.scale(e.scale,e.scale),n.context.translate(a,r),n.context.rotate(s*Math.PI/180),n.context.translate(-a,-r);for(const h of e.objects)t(h,o*e.opacity);e.previewColor!==null&&(n.context.fillStyle=P0(e.previewColor),n.context.fillRect(0,0,e.width,e.height)),n.context.translate(a,r),n.context.rotate(-s*Math.PI/180),n.context.translate(-a,-r),e.rotateOriginPreviewSize>0&&(n.context.fillStyle="red",n.context.beginPath(),n.context.arc(a,r,e.rotateOriginPreviewSize,0,2*Math.PI),n.context.fill()),n.context.scale(1/e.scale,1/e.scale),n.context.translate(-i.origin.x,-i.origin.y)}};function X0(n,e,t,o,i=0){const s=o();s.path.moveTo(n.x+t,n.y),s.path.lineTo(n.x+e.width-t,n.y),s.path.arcTo(n.x+e.width,n.y,n.x+e.width,n.y+t,t),s.path.lineTo(n.x+e.width,n.y+e.height-t),s.path.arcTo(n.x+e.width,n.y+e.height,n.x+e.width-t,n.y+e.height,t),s.path.lineTo(n.x+t,n.y+e.height),s.path.arcTo(n.x,n.y+e.height,n.x,n.y+e.height-t,t),s.path.lineTo(n.x,n.y+t),s.path.arcTo(n.x,n.y,n.x+t,n.y,t),i>0&&s.path.lineTo(n.x+t+i,n.y);const a=2*(e.width+e.height-4*t)+2*Math.PI*t+i;return{path:s,length:a}}const E0={Browser:"browser",Node:"node"},ce=({ctx:n,imageById:e,object:t,opacity:o,createPath2D:i})=>{const s=p0(G({x:t.x,y:t.y}),t.anchor,r0({width:t.width,height:t.height})),a=e[t.imageId];if(a!==void 0){if(n.context.save(),t.rounding>0){const r=X0(s.origin,s.size,t.rounding,i);switch(n.type){case Q.Browser:r.path.type===g0.Browser?n.context.clip(r.path.path):console.warn("Attempted to use Node Path2D in Browser Canvas context");break;case Q.Node:r.path.type===g0.Node?n.context.clip(r.path.path):console.warn("Attempted to use Browser Path2D in Node Canvas context");break;default:o0(n)}}switch(n.context.globalAlpha=o*t.opacity,n.context.imageSmoothingEnabled=t.smooth,n.type){case Q.Browser:a.type===E0.Browser?n.context.drawImage(a.image,s.origin.x,s.origin.y,s.size.width,s.size.height):console.warn("Attempted to use Node Image in Browser Canvas context");break;case Q.Node:a.type===E0.Node?n.context.drawImage(a.image,s.origin.x,s.origin.y,s.size.width,s.size.height):console.warn("Attempted to use Browser Image in Node Canvas context");break;default:o0(n)}n.context.restore()}};function ue(n,e){const t=e();t.path.moveTo(n.startX,n.startY),t.path.lineTo(n.endX,n.endY);const o=Math.hypot(n.endX-n.startX,n.endY-n.startY);return{path:t,length:o}}const fe=({ctx:n,object:e,opacity:t,createPath2D:o})=>{const i=e.opacity*t;if(i===0||e.drawn===0)return;const{path:s,length:a}=ue(e,o);x0({color:e.color,ctx:n,drawn:e.drawn,isDrawnFromCenter:e.isDrawnFromCenter,isRounded:e.isRounded,path:s,pathLength:a,opacity:i,width:e.width})},ge=({ctx:n,object:e,opacity:t,renderObject:o})=>{n.context.save();const i=p0(G({x:e.x,y:e.y}),e.anchor,r0({width:e.width,height:e.height}));e.preview&&(n.context.lineWidth=4,n.context.strokeStyle=P0(X.RED),n.context.rect(i.origin.x,i.origin.y,i.size.width,i.size.height),n.context.stroke()),n.context.beginPath(),n.context.rect(i.origin.x,i.origin.y,i.size.width,i.size.height),n.context.closePath(),n.context.clip();for(const s of e.objects)o(s,t*e.opacity);n.context.restore()},pe=({ctx:n,object:e,opacity:t,createPath2D:o})=>{const i=e.opacity*t;if(i===0||e.drawn===0&&e.fill.alpha===0)return;const{origin:s}=p0(G({x:e.x,y:e.y}),e.anchor,r0({width:e.width,height:e.height})),a=o(e.path);n.context.save(),n.context.translate(s.x,s.y),n.context.scale(e.width/e.viewboxWidth,e.height/e.viewboxHeight),v0({ctx:n,path:a,color:e.fill,opacity:i}),x0({color:e.color,ctx:n,drawn:e.drawn,isRounded:e.isRounded,path:a,pathLength:e.pathLength,opacity:i,width:e.strokeWidth}),n.context.restore()};function de(n,e){const t=e(),o=n.points,i=o[0];if(i===void 0)return{path:t,length:0};t.path.moveTo(i.x,i.y);let s=0,a=i;for(let h=1;h<o.length;h++){const c=o[h];if(c===void 0)continue;t.path.lineTo(c.x,c.y);const f=Math.hypot(c.x-a.x,c.y-a.y);s+=f,a=c}t.path.closePath();const r=Math.hypot(i.x-a.x,i.y-a.y);return s+=r,{path:t,length:s}}const ye=({ctx:n,object:e,opacity:t,createPath2D:o})=>{const i=e.opacity*t;if(i===0||e.drawn===0&&e.fill.alpha===0)return;const{path:s,length:a}=de(e,o);v0({ctx:n,path:s,color:e.fill,opacity:i}),x0({color:e.borderColor,ctx:n,drawn:e.drawn,path:s,pathLength:a,opacity:i,width:e.borderWidth})};function xe(n,e){const t=n.borderWidth/2,{origin:o,size:i}=p0(G({x:n.x,y:n.y}),n.anchor,r0({width:n.width,height:n.height})),s=i.width-n.borderWidth,a=i.height-n.borderWidth;if(s<=0||a<=0)return;const r=G({x:o.x+t,y:o.y+t}),h=r0({width:s,height:a}),c=Math.max(0,Math.min(n.rounding-t,Math.min(s,a)/2));if(c>0)return X0(r,h,c,e).path;const f=e();return f.path.moveTo(r.x,r.y),f.path.lineTo(r.x+s,r.y),f.path.lineTo(r.x+s,r.y+a),f.path.lineTo(r.x,r.y+a),f.path.closePath(),f}function ve(n,e){const{origin:t,size:o}=p0(G({x:n.x,y:n.y}),n.anchor,r0({width:n.width,height:n.height})),i=Math.max(0,Math.min(n.rounding,Math.min(o.width,o.height)/2)),s=Math.min(n.borderWidth*2,o.width-i);if(i>0)return X0(t,o,i,e,s);{const a=e();a.path.moveTo(t.x,t.y),a.path.lineTo(t.x+o.width,t.y),a.path.lineTo(t.x+o.width,t.y+o.height),a.path.lineTo(t.x,t.y+o.height),a.path.lineTo(t.x,t.y),a.path.lineTo(t.x+s,t.y);const r=2*(o.width+o.height)+s;return{path:a,length:r}}}const we=({ctx:n,object:e,opacity:t,createPath2D:o})=>{const i=e.opacity*t;if(i===0||e.drawn===0&&e.fill.alpha===0)return;const{path:s,length:a}=ve(e,o);if(i<1&&e.borderWidth>0){const r=xe(e,o);r!==void 0&&(n.context.save(),It(n,r),v0({ctx:n,path:s,color:e.fill,opacity:i}),n.context.restore())}else v0({ctx:n,path:s,color:e.fill,opacity:i});x0({color:e.borderColor,ctx:n,drawn:e.drawn,path:s,pathLength:a,opacity:i,width:e.borderWidth})},me=({ctx:n,imageById:e,object:t,opacity:o})=>{const i=t.opacity*o;if(i===0||!t.svg)return;const s=e[t.svg];if(s===void 0)return;const a=p0(G({x:t.x,y:t.y}),t.anchor,r0({width:t.width,height:t.height}));switch(n.context.save(),n.context.globalAlpha=i,n.type){case Q.Browser:s.type===E0.Browser&&n.context.drawImage(s.image,a.origin.x,a.origin.y,a.size.width,a.size.height);break;case Q.Node:s.type===E0.Node&&n.context.drawImage(s.image,a.origin.x,a.origin.y,a.size.width,a.size.height);break;default:o0(n)}n.context.restore()};function be(n){return{color:n.color,fontFamily:n.fontFamily,fontSize:n.fontSize,fontStyle:n.fontStyle,fontWeight:n.fontWeight,ligatures:n.ligatures}}function Ae(n,e=1){const t=Math.max(...n.map(s=>s.reduce((a,r)=>a+r.width,0)));let o=0,i=0;for(let s=0;s<n.length;s++){const a=n[s];if(a===void 0)continue;const r=Math.max(...a.map(h=>h.height));o+=r+i*(e-1),i=r}return{height:o,width:t}}function Me(n){return{width:n.width,height:n.fontBoundingBoxAscent}}function _t(n,e,t=1){n.context.fillStyle=W0(e.color,t),n.context.font=`${e.fontStyle} ${e.fontWeight} ${e.fontSize}px ${e.fontFamily}`,n.type===Q.Browser?n.context.textRendering=e.ligatures?"optimizeLegibility":"optimizeSpeed":n.context.fontVariant=e.ligatures?"common-ligatures":"no-common-ligatures"}function Le(n,e,t){const o=[];for(const i of n){const s=[];for(const a of i){const{text:r,...h}=a,c={...e,...h};_t(t,c);const f=t.context.measureText(r);s.push(Me(f))}o.push(s)}return o}const Te=({ctx:n,object:e,opacity:t})=>{const o=e.opacity*t;if(o===0)return;const{length:i}=e,s=wt(e.text),a=be(e),r=Le(s,a,n),h=Ae(r,e.lineSpacing),c=p0(G({x:e.x,y:e.y}),e.anchor,h);let f=c.origin.x,y=c.origin.y,l=0,u=0;for(let m=0;m<s.length;m++){const x=s[m],M=r[m];if(x==null||M==null){console.error("Could not determine text units or sizes for line");continue}const C=M.reduce((L,S)=>L+S.width,0),E=M.length===0?u:M.reduce((L,S)=>Math.max(L,S.height),0);switch(e.alignment){case f0.LEFT:f=c.origin.x;break;case f0.CENTER:f=c.origin.x+(c.size.width-C)/2;break;case f0.RIGHT:f=c.origin.x+(c.size.width-C);break;default:o0(e.alignment);break}y+=E+u*(e.lineSpacing-1),u=E;for(let L=0;L<x.length&&!(i!==null&&l>=i);L++){const S=x[L],P=M[L];if(S==null||P==null){console.error("Could not determine text unit or size for unit");continue}const{text:R,...W}=S;let K;if(i!==null&&l+R.length>i){const u0=i-l;K=R.slice(0,u0)}const U=K??R;l+=U.length;const Y={...a,...W};_t(n,Y,o),n.context.fillText(U,f,y),f+=P.width}}},Pe={[D.ARROW]:ie,[D.CIRCLE]:se,[D.GROUP]:le,[D.IMAGE]:ce,[D.LINE]:fe,[D.MASK]:ge,[D.PATH]:pe,[D.POLYGON]:ye,[D.RECTANGLE]:we,[D.SLIDE_OBJECT]:()=>{},[D.SVG]:me,[D.TEXT]:Te};function Ce(n){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("viewBox",`0 0 ${n.width} ${n.height}`),e.style.backgroundColor="transparent",e.style.position="absolute",e.style.width="100%",e}function Ee(n,e){if(n===null)return null;const t=p0(G({x:e.x,y:e.y}),e.anchor,r0({width:e.width,height:e.height})),o=document.createElementNS("http://www.w3.org/2000/svg","foreignObject");o.setAttribute("x",t.origin.x.toString()),o.setAttribute("y",t.origin.y.toString()),o.setAttribute("width",e.width.toString()),o.setAttribute("height",e.height.toString());const i=e.content;i!==null&&o.appendChild(i),n.appendChild(o);let s=null;if(e.setup!==null){const a=e.setup(o);a!==void 0&&(s=a)}return()=>{s!==null&&s(),n.removeChild(o)}}async function Se(n){if(Object.keys(n).length===0)return{};const e={},t=i=>new Promise((s,a)=>{const r=new Image;if(r.onload=()=>s(r),r.onerror=c=>a(c),i.includes("</svg>")){const c=i.replace(/<\?xml[^?]*\?>\s*/g,""),f=new Blob([c],{type:"image/svg+xml;charset=utf-8"}),y=URL.createObjectURL(f);r.src=y}else r.src=i}),o=Object.entries(n).map(async([i,s])=>{const a=await t(s);e[i]={type:E0.Browser,image:a}});try{await Promise.all(o)}catch(i){console.error("Error loading images:",i)}return e}class Ie{constructor(e){const{objectRenderers:t,...o}=e;this.props={presentation:At(),element:document.body,objectRenderers:{...Pe,...t},cacheDurationMinutes:15,...o},this.state={...St}}async present(){const{presentation:e,element:t}=this.props,o=ee(e.size),i=Ce(e.size);this.state={...St,imageById:await Se({...e.resources.images,...Z1(e)}),canvas:o,extrasContainer:i};const s=W1(e,t);K1(e,t,this.state.shortcutState,{onNext:r=>this.next(r),onPrevious:r=>this.previous(r),onRenderSlide:(r,h)=>{this.state.shortcutState.shortcuts.b={slideIndex:this.state.slideIndex,buildIndex:this.state.buildIndex},this.renderSlide(r??this.state.slideIndex,h)},onShowNavigator:()=>D1({presentation:e,onNavigateToSlide:r=>this.renderSlide(r)})}),t.replaceChildren(),s.appendChild(o),s.appendChild(i),t.appendChild(s);const a=Q1(e,this.props.cacheDurationMinutes);a!==null?this.renderSlide(a.slideIndex,a.buildIndex):this.renderSlide(0)}renderSlide(e,t=0,o=null){const{objectRenderers:i,presentation:s}=this.props,{canvas:a,imageById:r}=this.state,h=this.state.slideIndex!==e;this.state.slideIndex=e,this.state.buildIndex=t,o===null&&J1({title:s.title,slideIndex:e,buildIndex:t});const c=s.slides[e];if(c===void 0||a===null)return;if(h||this.state.mountedExtrasCleanups.length===0&&c.extras.length>0){for(const m of this.state.mountedExtrasCleanups)m();this.state.mountedExtrasCleanups=[];for(const m of c.extras){const x=Ee(this.state.extrasContainer,m);x!==null&&this.state.mountedExtrasCleanups.push(x)}}const f=a.getContext("2d");if(f===null)return;const y={type:Q.Browser,context:f};te(a,y);const l=X1({slide:c,buildIndex:t,buildTime:o});y.context.fillStyle=W0(s.backgroundColor),y.context.fillRect(0,0,a.width,a.height);function u(m,x){const M=i[m.objectType],C=l.get(m);M===void 0||C===void 0||M({ctx:y,imageById:r,object:C,opacity:x,renderObject:u,createPath2D:ne})}for(const m of c.objects)u(m,1)}next(e=!1){const{presentation:t}=this.props,{currentAnimationId:o,slideIndex:i,buildIndex:s}=this.state;this.props.element.style.cursor="none",o!==null&&cancelAnimationFrame(o);const a=t.slides[i];if(a===void 0)return;const r=a.animations[s];if(r!==void 0&&!e){const h=performance.now(),c=H1(r),f=y=>{const l=y-h;l<c?(this.renderSlide(i,s+1,l),this.state.currentAnimationId=requestAnimationFrame(f)):this.renderSlide(i,s+1,null)};this.state.currentAnimationId=requestAnimationFrame(f)}else i+1<t.slides.length&&this.renderSlide(i+1)}previous(e=!1){const{currentAnimationId:t,slideIndex:o,buildIndex:i}=this.state;if(this.props.element.style.cursor="none",t!==null&&cancelAnimationFrame(t),i>0)e?this.renderSlide(o,0):this.renderSlide(o,i-1);else if(o>0){const s=this.props.presentation.slides[o-1],a=e?0:(s==null?void 0:s.animations.length)??0;this.renderSlide(o-1,a)}else this.renderSlide(0,0)}}function _e(n=1e3){return{type:$.PAUSE,isKey:!1,duration:n,shortcut:null}}function Oe(n=null){return{objects:[],animations:[],extras:[],isAllKey:!1,isEndKey:!0,isStartKey:!1,shortcut:null,title:"",...n}}function ke(n,e={}){return{...e,text:n}}function Fe(n=X.BLACK){return{...n,alpha:1}}function Re(n){for(var e=-1,t=n.length,o,i=n[t-1],s=0;++e<t;)o=i,i=n[e],s+=o[1]*i[0]-o[0]*i[1];return s/2}function Ne(n){for(var e=-1,t=n.length,o=n[t-1],i,s,a=o[0],r=o[1],h=0;++e<t;)i=a,s=r,o=n[e],a=o[0],r=o[1],i-=a,s-=r,h+=Math.sqrt(i*i+s*s);return h}function qe(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Z0,Ot;function Be(){if(Ot)return Z0;Ot=1;var n={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},e=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function t(u){return u===10||u===13||u===8232||u===8233||u===32||u===9||u===11||u===12||u===160||u>=5760&&e.indexOf(u)>=0}function o(u){switch(u|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}function i(u){return(u|32)===97}function s(u){return u>=48&&u<=57}function a(u){return u>=48&&u<=57||u===43||u===45||u===46}function r(u){this.index=0,this.path=u,this.max=u.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function h(u){for(;u.index<u.max&&t(u.path.charCodeAt(u.index));)u.index++}function c(u){var m=u.path.charCodeAt(u.index);if(m===48){u.param=0,u.index++;return}if(m===49){u.param=1,u.index++;return}u.err="SvgPath: arc flag can be 0 or 1 only (at pos "+u.index+")"}function f(u){var m=u.index,x=m,M=u.max,C=!1,E=!1,L=!1,S=!1,P;if(x>=M){u.err="SvgPath: missed param (at pos "+x+")";return}if(P=u.path.charCodeAt(x),(P===43||P===45)&&(x++,P=x<M?u.path.charCodeAt(x):0),!s(P)&&P!==46){u.err="SvgPath: param should start with 0..9 or `.` (at pos "+x+")";return}if(P!==46){if(C=P===48,x++,P=x<M?u.path.charCodeAt(x):0,C&&x<M&&P&&s(P)){u.err="SvgPath: numbers started with `0` such as `09` are illegal (at pos "+m+")";return}for(;x<M&&s(u.path.charCodeAt(x));)x++,E=!0;P=x<M?u.path.charCodeAt(x):0}if(P===46){for(S=!0,x++;s(u.path.charCodeAt(x));)x++,L=!0;P=x<M?u.path.charCodeAt(x):0}if(P===101||P===69){if(S&&!E&&!L){u.err="SvgPath: invalid float exponent (at pos "+x+")";return}if(x++,P=x<M?u.path.charCodeAt(x):0,(P===43||P===45)&&x++,x<M&&s(u.path.charCodeAt(x)))for(;x<M&&s(u.path.charCodeAt(x));)x++;else{u.err="SvgPath: invalid float exponent (at pos "+x+")";return}}u.index=x,u.param=parseFloat(u.path.slice(m,x))+0}function y(u){var m,x;m=u.path[u.segmentStart],x=m.toLowerCase();var M=u.data;if(x==="m"&&M.length>2&&(u.result.push([m,M[0],M[1]]),M=M.slice(2),x="l",m=m==="m"?"l":"L"),x==="r")u.result.push([m].concat(M));else for(;M.length>=n[x]&&(u.result.push([m].concat(M.splice(0,n[x]))),!!n[x]););}function l(u){var m=u.max,x,M,C,E,L;if(u.segmentStart=u.index,x=u.path.charCodeAt(u.index),M=i(x),!o(x)){u.err="SvgPath: bad command "+u.path[u.index]+" (at pos "+u.index+")";return}if(E=n[u.path[u.index].toLowerCase()],u.index++,h(u),u.data=[],!E){y(u);return}for(C=!1;;){for(L=E;L>0;L--){if(M&&(L===3||L===4)?c(u):f(u),u.err.length){y(u);return}u.data.push(u.param),h(u),C=!1,u.index<m&&u.path.charCodeAt(u.index)===44&&(u.index++,h(u),C=!0)}if(!C&&(u.index>=u.max||!a(u.path.charCodeAt(u.index))))break}y(u)}return Z0=function(m){var x=new r(m),M=x.max;for(h(x);x.index<M&&!x.err.length;)l(x);return x.result.length&&("mM".indexOf(x.result[0][0])<0?(x.err="SvgPath: string should start with `M` or `m`",x.result=[]):x.result[0][0]="M"),{err:x.err,segments:x.result}},Z0}var V0,kt;function Ft(){if(kt)return V0;kt=1;function n(t,o){return[t[0]*o[0]+t[2]*o[1],t[1]*o[0]+t[3]*o[1],t[0]*o[2]+t[2]*o[3],t[1]*o[2]+t[3]*o[3],t[0]*o[4]+t[2]*o[5]+t[4],t[1]*o[4]+t[3]*o[5]+t[5]]}function e(){if(!(this instanceof e))return new e;this.queue=[],this.cache=null}return e.prototype.matrix=function(t){return t[0]===1&&t[1]===0&&t[2]===0&&t[3]===1&&t[4]===0&&t[5]===0?this:(this.cache=null,this.queue.push(t),this)},e.prototype.translate=function(t,o){return(t!==0||o!==0)&&(this.cache=null,this.queue.push([1,0,0,1,t,o])),this},e.prototype.scale=function(t,o){return(t!==1||o!==1)&&(this.cache=null,this.queue.push([t,0,0,o,0,0])),this},e.prototype.rotate=function(t,o,i){var s,a,r;return t!==0&&(this.translate(o,i),s=t*Math.PI/180,a=Math.cos(s),r=Math.sin(s),this.queue.push([a,r,-r,a,0,0]),this.cache=null,this.translate(-o,-i)),this},e.prototype.skewX=function(t){return t!==0&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},e.prototype.skewY=function(t){return t!==0&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},e.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],this.queue.length===1)return this.cache;for(var t=1;t<this.queue.length;t++)this.cache=n(this.cache,this.queue[t]);return this.cache},e.prototype.calc=function(t,o,i){var s;return this.queue.length?(this.cache||(this.cache=this.toArray()),s=this.cache,[t*s[0]+o*s[2]+(i?0:s[4]),t*s[1]+o*s[3]+(i?0:s[5])]):[t,o]},V0=e,V0}var K0,Rt;function De(){if(Rt)return K0;Rt=1;var n=Ft(),e={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},t=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,o=/[\s,]+/;return K0=function(s){var a=new n,r,h;return s.split(t).forEach(function(c){if(c.length){if(typeof e[c]<"u"){r=c;return}switch(h=c.split(o).map(function(f){return+f||0}),r){case"matrix":h.length===6&&a.matrix(h);return;case"scale":h.length===1?a.scale(h[0],h[0]):h.length===2&&a.scale(h[0],h[1]);return;case"rotate":h.length===1?a.rotate(h[0],0,0):h.length===3&&a.rotate(h[0],h[1],h[2]);return;case"translate":h.length===1?a.translate(h[0],0):h.length===2&&a.translate(h[0],h[1]);return;case"skewX":h.length===1&&a.skewX(h[0]);return;case"skewY":h.length===1&&a.skewY(h[0]);return}}}),a},K0}var Q0,Nt;function je(){if(Nt)return Q0;Nt=1;var n=Math.PI*2;function e(i,s,a,r){var h=i*r-s*a<0?-1:1,c=i*a+s*r;return c>1&&(c=1),c<-1&&(c=-1),h*Math.acos(c)}function t(i,s,a,r,h,c,f,y,l,u){var m=u*(i-a)/2+l*(s-r)/2,x=-l*(i-a)/2+u*(s-r)/2,M=f*f,C=y*y,E=m*m,L=x*x,S=M*C-M*L-C*E;S<0&&(S=0),S/=M*L+C*E,S=Math.sqrt(S)*(h===c?-1:1);var P=S*f/y*x,R=S*-y/f*m,W=u*P-l*R+(i+a)/2,K=l*P+u*R+(s+r)/2,U=(m-P)/f,Y=(x-R)/y,u0=(-m-P)/f,w0=(-x-R)/y,d0=e(1,0,U,Y),h0=e(U,Y,u0,w0);return c===0&&h0>0&&(h0-=n),c===1&&h0<0&&(h0+=n),[W,K,d0,h0]}function o(i,s){var a=1.3333333333333333*Math.tan(s/4),r=Math.cos(i),h=Math.sin(i),c=Math.cos(i+s),f=Math.sin(i+s);return[r,h,r-h*a,h+r*a,c+f*a,f-c*a,c,f]}return Q0=function(s,a,r,h,c,f,y,l,u){var m=Math.sin(u*n/360),x=Math.cos(u*n/360),M=x*(s-r)/2+m*(a-h)/2,C=-m*(s-r)/2+x*(a-h)/2;if(M===0&&C===0)return[];if(y===0||l===0)return[];y=Math.abs(y),l=Math.abs(l);var E=M*M/(y*y)+C*C/(l*l);E>1&&(y*=Math.sqrt(E),l*=Math.sqrt(E));var L=t(s,a,r,h,c,f,y,l,m,x),S=[],P=L[2],R=L[3],W=Math.max(Math.ceil(Math.abs(R)/(n/4)),1);R/=W;for(var K=0;K<W;K++)S.push(o(P,R)),P+=R;return S.map(function(U){for(var Y=0;Y<U.length;Y+=2){var u0=U[Y+0],w0=U[Y+1];u0*=y,w0*=l;var d0=x*u0-m*w0,h0=m*u0+x*w0;U[Y+0]=d0+L[0],U[Y+1]=h0+L[1]}return U})},Q0}var J0,qt;function ze(){if(qt)return J0;qt=1;var n=1e-10,e=Math.PI/180;function t(o,i,s){if(!(this instanceof t))return new t(o,i,s);this.rx=o,this.ry=i,this.ax=s}return t.prototype.transform=function(o){var i=Math.cos(this.ax*e),s=Math.sin(this.ax*e),a=[this.rx*(o[0]*i+o[2]*s),this.rx*(o[1]*i+o[3]*s),this.ry*(-o[0]*s+o[2]*i),this.ry*(-o[1]*s+o[3]*i)],r=a[0]*a[0]+a[2]*a[2],h=a[1]*a[1]+a[3]*a[3],c=((a[0]-a[3])*(a[0]-a[3])+(a[2]+a[1])*(a[2]+a[1]))*((a[0]+a[3])*(a[0]+a[3])+(a[2]-a[1])*(a[2]-a[1])),f=(r+h)/2;if(c<n*f)return this.rx=this.ry=Math.sqrt(f),this.ax=0,this;var y=a[0]*a[1]+a[2]*a[3];c=Math.sqrt(c);var l=f+c/2,u=f-c/2;return this.ax=Math.abs(y)<n&&Math.abs(l-h)<n?90:Math.atan(Math.abs(y)>Math.abs(l-h)?(l-r)/y:y/(l-h))*180/Math.PI,this.ax>=0?(this.rx=Math.sqrt(l),this.ry=Math.sqrt(u)):(this.ax+=90,this.rx=Math.sqrt(u),this.ry=Math.sqrt(l)),this},t.prototype.isDegenerate=function(){return this.rx<n*this.ry||this.ry<n*this.rx},J0=t,J0}var tt,Bt;function Ue(){if(Bt)return tt;Bt=1;var n=Be(),e=De(),t=Ft(),o=je(),i=ze();function s(a){if(!(this instanceof s))return new s(a);var r=n(a);this.segments=r.segments,this.err=r.err,this.__stack=[]}return s.from=function(a){if(typeof a=="string")return new s(a);if(a instanceof s){var r=new s("");return r.err=a.err,r.segments=a.segments.map(function(h){return h.slice()}),r.__stack=a.__stack.map(function(h){return t().matrix(h.toArray())}),r}throw new Error("SvgPath.from: invalid param type "+a)},s.prototype.__matrix=function(a){var r=this,h;a.queue.length&&this.iterate(function(c,f,y,l){var u,m,x,M;switch(c[0]){case"v":u=a.calc(0,c[1],!0),m=u[0]===0?["v",u[1]]:["l",u[0],u[1]];break;case"V":u=a.calc(y,c[1],!1),m=u[0]===a.calc(y,l,!1)[0]?["V",u[1]]:["L",u[0],u[1]];break;case"h":u=a.calc(c[1],0,!0),m=u[1]===0?["h",u[0]]:["l",u[0],u[1]];break;case"H":u=a.calc(c[1],l,!1),m=u[1]===a.calc(y,l,!1)[1]?["H",u[0]]:["L",u[0],u[1]];break;case"a":case"A":var C=a.toArray(),E=i(c[1],c[2],c[3]).transform(C);if(C[0]*C[3]-C[1]*C[2]<0&&(c[5]=c[5]?"0":"1"),u=a.calc(c[6],c[7],c[0]==="a"),c[0]==="A"&&c[6]===y&&c[7]===l||c[0]==="a"&&c[6]===0&&c[7]===0){m=[c[0]==="a"?"l":"L",u[0],u[1]];break}E.isDegenerate()?m=[c[0]==="a"?"l":"L",u[0],u[1]]:m=[c[0],E.rx,E.ry,E.ax,c[4],c[5],u[0],u[1]];break;case"m":M=f>0,u=a.calc(c[1],c[2],M),m=["m",u[0],u[1]];break;default:for(x=c[0],m=[x],M=x.toLowerCase()===x,h=1;h<c.length;h+=2)u=a.calc(c[h],c[h+1],M),m.push(u[0],u[1])}r.segments[f]=m},!0)},s.prototype.__evaluateStack=function(){var a,r;if(this.__stack.length){if(this.__stack.length===1){this.__matrix(this.__stack[0]),this.__stack=[];return}for(a=t(),r=this.__stack.length;--r>=0;)a.matrix(this.__stack[r].toArray());this.__matrix(a),this.__stack=[]}},s.prototype.toString=function(){var a="",r="",h=!1;this.__evaluateStack();for(var c=0,f=this.segments.length;c<f;c++){var y=this.segments[c],l=y[0];l!==r||l==="m"||l==="M"?(l==="m"&&r==="z"&&(a+=" "),a+=l,h=!1):h=!0;for(var u=1;u<y.length;u++){var m=y[u];u===1?h&&m>=0&&(a+=" "):m>=0&&(a+=" "),a+=m}r=l}return a},s.prototype.translate=function(a,r){return this.__stack.push(t().translate(a,r||0)),this},s.prototype.scale=function(a,r){return this.__stack.push(t().scale(a,!r&&r!==0?a:r)),this},s.prototype.rotate=function(a,r,h){return this.__stack.push(t().rotate(a,r||0,h||0)),this},s.prototype.skewX=function(a){return this.__stack.push(t().skewX(a)),this},s.prototype.skewY=function(a){return this.__stack.push(t().skewY(a)),this},s.prototype.matrix=function(a){return this.__stack.push(t().matrix(a)),this},s.prototype.transform=function(a){return a.trim()?(this.__stack.push(e(a)),this):this},s.prototype.round=function(a){var r=0,h=0,c=0,f=0,y;return a=a||0,this.__evaluateStack(),this.segments.forEach(function(l){var u=l[0].toLowerCase()===l[0];switch(l[0]){case"H":case"h":u&&(l[1]+=c),c=l[1]-l[1].toFixed(a),l[1]=+l[1].toFixed(a);return;case"V":case"v":u&&(l[1]+=f),f=l[1]-l[1].toFixed(a),l[1]=+l[1].toFixed(a);return;case"Z":case"z":c=r,f=h;return;case"M":case"m":u&&(l[1]+=c,l[2]+=f),c=l[1]-l[1].toFixed(a),f=l[2]-l[2].toFixed(a),r=c,h=f,l[1]=+l[1].toFixed(a),l[2]=+l[2].toFixed(a);return;case"A":case"a":u&&(l[6]+=c,l[7]+=f),c=l[6]-l[6].toFixed(a),f=l[7]-l[7].toFixed(a),l[1]=+l[1].toFixed(a),l[2]=+l[2].toFixed(a),l[3]=+l[3].toFixed(a+2),l[6]=+l[6].toFixed(a),l[7]=+l[7].toFixed(a);return;default:y=l.length,u&&(l[y-2]+=c,l[y-1]+=f),c=l[y-2]-l[y-2].toFixed(a),f=l[y-1]-l[y-1].toFixed(a),l.forEach(function(m,x){x&&(l[x]=+l[x].toFixed(a))});return}}),this},s.prototype.iterate=function(a,r){var h=this.segments,c={},f=!1,y=0,l=0,u=0,m=0,x,M,C;if(r||this.__evaluateStack(),h.forEach(function(E,L){var S=a(E,L,y,l);Array.isArray(S)&&(c[L]=S,f=!0);var P=E[0]===E[0].toLowerCase();switch(E[0]){case"m":case"M":y=E[1]+(P?y:0),l=E[2]+(P?l:0),u=y,m=l;return;case"h":case"H":y=E[1]+(P?y:0);return;case"v":case"V":l=E[1]+(P?l:0);return;case"z":case"Z":y=u,l=m;return;default:y=E[E.length-2]+(P?y:0),l=E[E.length-1]+(P?l:0)}}),!f)return this;for(C=[],x=0;x<h.length;x++)if(typeof c[x]<"u")for(M=0;M<c[x].length;M++)C.push(c[x][M]);else C.push(h[x]);return this.segments=C,this},s.prototype.abs=function(){return this.iterate(function(a,r,h,c){var f=a[0],y=f.toUpperCase(),l;if(f!==y)switch(a[0]=y,f){case"v":a[1]+=c;return;case"a":a[6]+=h,a[7]+=c;return;default:for(l=1;l<a.length;l++)a[l]+=l%2?h:c}},!0),this},s.prototype.rel=function(){return this.iterate(function(a,r,h,c){var f=a[0],y=f.toLowerCase(),l;if(f!==y&&!(r===0&&f==="M"))switch(a[0]=y,f){case"V":a[1]-=c;return;case"A":a[6]-=h,a[7]-=c;return;default:for(l=1;l<a.length;l++)a[l]-=l%2?h:c}},!0),this},s.prototype.unarc=function(){return this.iterate(function(a,r,h,c){var f,y,l,u=[],m=a[0];return m!=="A"&&m!=="a"?null:(m==="a"?(y=h+a[6],l=c+a[7]):(y=a[6],l=a[7]),f=o(h,c,y,l,a[4],a[5],a[1],a[2],a[3]),f.length===0?[[a[0]==="a"?"l":"L",a[6],a[7]]]:(f.forEach(function(x){u.push(["C",x[2],x[3],x[4],x[5],x[6],x[7]])}),u))}),this},s.prototype.unshort=function(){var a=this.segments,r,h,c,f,y;return this.iterate(function(l,u,m,x){var M=l[0],C=M.toUpperCase(),E;u&&(C==="T"?(E=M==="t",c=a[u-1],c[0]==="Q"?(r=c[1]-m,h=c[2]-x):c[0]==="q"?(r=c[1]-c[3],h=c[2]-c[4]):(r=0,h=0),f=-r,y=-h,E||(f+=m,y+=x),a[u]=[E?"q":"Q",f,y,l[1],l[2]]):C==="S"&&(E=M==="s",c=a[u-1],c[0]==="C"?(r=c[3]-m,h=c[4]-x):c[0]==="c"?(r=c[3]-c[5],h=c[4]-c[6]):(r=0,h=0),f=-r,y=-h,E||(f+=m,y+=x),a[u]=[E?"c":"C",f,y,l[1],l[2],l[3],l[4]]))}),this},tt=s,tt}var et,Dt;function He(){return Dt||(Dt=1,et=Ue()),et}var Ge=He();const We=qe(Ge);var nt={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},$e=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function Ye(n){var e=[];return n.replace($e,function(t,o,i){var s=o.toLowerCase();for(i=Ze(i),s==="m"&&i.length>2&&(e.push([o].concat(i.splice(0,2))),s="l",o=o==="m"?"l":"L");i.length>=0;){if(i.length===nt[s])return i.unshift(o),e.push(i);if(i.length<nt[s])throw new Error("malformed path data");e.push([o].concat(i.splice(0,nt[s])))}}),e}var Xe=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function Ze(n){var e=n.match(Xe);return e?e.map(Number):[]}function a0(n,e,t,o,i,s,a,r){return new rt(n,e,t,o,i,s,a,r)}function rt(n,e,t,o,i,s,a,r){this.a={x:n,y:e},this.b={x:t,y:o},this.c={x:i,y:s},this.d={x:a,y:r},a!=null&&r!==null&&r!==void 0?(this.getArcLength=an,this.getPoint=Qe,this.getDerivative=Ke):(this.getArcLength=Je,this.getPoint=jt,this.getDerivative=Ve),this.init()}rt.prototype={constructor:rt,init:function(){this.length=this.getArcLength([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y])},getTotalLength:function(){return this.length},getPointAtLength:function(n){var e=it(n,this.length,this.getArcLength,[this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y]);return this.getPoint([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],e)},getTangentAtLength:function(n){var e=it(n,this.length,this.getArcLength,[this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y]),t=this.getDerivative([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],e),o=Math.sqrt(t.x*t.x+t.y*t.y),i;return o>0?i={x:t.x/o,y:t.y/o}:i={x:0,y:0},i},getPropertiesAtLength:function(n){var e=it(n,this.length,this.getArcLength,[this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y]),t=this.getDerivative([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],e),o=Math.sqrt(t.x*t.x+t.y*t.y),i;o>0?i={x:t.x/o,y:t.y/o}:i={x:0,y:0};var s=this.getPoint([this.a.x,this.b.x,this.c.x,this.d.x],[this.a.y,this.b.y,this.c.y,this.d.y],e);return{x:s.x,y:s.y,tangentX:i.x,tangentY:i.y}}};function Ve(n,e,t){return{x:(1-t)*2*(n[1]-n[0])+t*2*(n[2]-n[1]),y:(1-t)*2*(e[1]-e[0])+t*2*(e[2]-e[1])}}function Ke(n,e,t){var o=jt([3*(n[1]-n[0]),3*(n[2]-n[1]),3*(n[3]-n[2])],[3*(e[1]-e[0]),3*(e[2]-e[1]),3*(e[3]-e[2])],t);return o}function it(n,e,t,o,i){for(var s=1,a=n/e,r=(n-t(o,i,a))/e;s>.001;){var h=t(o,i,a+r),c=t(o,i,a-r),f=Math.abs(n-h)/e,y=Math.abs(n-c)/e;f<s?(s=f,a+=r):y<s?(s=y,a-=r):r/=2}return a}function jt(n,e,t){var o=(1-t)*(1-t)*n[0]+2*(1-t)*t*n[1]+t*t*n[2],i=(1-t)*(1-t)*e[0]+2*(1-t)*t*e[1]+t*t*e[2];return{x:o,y:i}}function Qe(n,e,t){var o=(1-t)*(1-t)*(1-t)*n[0]+3*(1-t)*(1-t)*t*n[1]+3*(1-t)*t*t*n[2]+t*t*t*n[3],i=(1-t)*(1-t)*(1-t)*e[0]+3*(1-t)*(1-t)*t*e[1]+3*(1-t)*t*t*e[2]+t*t*t*e[3];return{x:o,y:i}}function Je(n,e,t){t===void 0&&(t=1);var o=n[0]-2*n[1]+n[2],i=e[0]-2*e[1]+e[2],s=2*n[1]-2*n[0],a=2*e[1]-2*e[0],r=4*(o*o+i*i),h=4*(o*s+i*a),c=s*s+a*a;if(r===0)return t*Math.sqrt(Math.pow(n[2]-n[0],2)+Math.pow(e[2]-e[0],2));var f=h/(2*r),y=c/r,l=t+f,u=y-f*f;return Math.sqrt(r)/2*(l*Math.sqrt(l*l+u)-f*Math.sqrt(f*f+u)+u*Math.log(Math.abs((l+Math.sqrt(l*l+u))/(f+Math.sqrt(f*f+u)))))}var tn=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],en=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],nn=[[1],[1,1],[1,2,1],[1,3,3,1]];function rn(n,e){return nn[n][e]}function ot(n,e,t){var o=t.length-1,i,s,a;if(o===0)return 0;if(n===0){for(s=0,a=0;a<=o;a++)s+=rn(o,a)*Math.pow(1-e,o-a)*Math.pow(e,a)*t[a];return s}else{for(i=new Array(o),a=0;a<o;a++)i[a]=o*(t[a+1]-t[a]);return ot(n-1,e,i)}}function on(n,e,t){var o=ot(1,t,n),i=ot(1,t,e),s=o*o+i*i;return Math.sqrt(s)}function an(n,e,t){var o,i,s,a;t===void 0&&(t=1);var r=20;for(o=t/2,i=0,s=0;s<r;s++)a=o*tn[r][s]+o,i+=en[r][s]*on(n,e,a);return o*i}var S0=Math.PI*2;function zt(n,e,t,o){var i=n*o-e*t<0?-1:1,s=n*t+e*o;return s>1&&(s=1),s<-1&&(s=-1),i*Math.acos(s)}function sn(n,e,t,o,i,s,a,r,h,c){var f=c*(n-t)/2+h*(e-o)/2,y=-h*(n-t)/2+c*(e-o)/2,l=a*a,u=r*r,m=f*f,x=y*y,M=l*u-l*x-u*m;M<0&&(M=0),M/=l*x+u*m,M=Math.sqrt(M)*(i===s?-1:1);var C=M*a/r*y,E=M*-r/a*f,L=c*C-h*E+(n+t)/2,S=h*C+c*E+(e+o)/2,P=(f-C)/a,R=(y-E)/r,W=(-f-C)/a,K=(-y-E)/r,U=zt(1,0,P,R),Y=zt(P,R,W,K);return s===0&&Y>0&&(Y-=S0),s===1&&Y<0&&(Y+=S0),[L,S,U,Y]}function hn(n,e){var t=1.3333333333333333*Math.tan(e/4),o=Math.cos(n),i=Math.sin(n),s=Math.cos(n+e),a=Math.sin(n+e);return[o,i,o-i*t,i+o*t,s+a*t,a-s*t,s,a]}function ln(n,e,t,o,i,s,a,r,h){var c=Math.sin(i*S0/360),f=Math.cos(i*S0/360),y=f*(n-r)/2+c*(e-h)/2,l=-c*(n-r)/2+f*(e-h)/2;if(y===0&&l===0)return[];if(t===0||o===0)return[];t=Math.abs(t),o=Math.abs(o);var u=y*y/(t*t)+l*l/(o*o);u>1&&(t*=Math.sqrt(u),o*=Math.sqrt(u));var m=sn(n,e,r,h,s,a,t,o,c,f),x=[],M=m[2],C=m[3],E=Math.max(Math.ceil(Math.abs(C)/(S0/4)),1);C/=E;for(var L=0;L<E;L++)x.push(hn(M,C)),M+=C;return x.map(function(S){for(var P=0;P<S.length;P+=2){var R=S[P+0],W=S[P+1];R*=t,W*=o;var K=f*R-c*W,U=c*R+f*W;S[P+0]=K+m[0],S[P+1]=U+m[1]}return S})}function Ut(n,e,t,o,i,s,a,r,h){return new at(n,e,t,o,i,s,a,r,h)}function at(n,e,t,o,i,s,a,r,h){var c=0,f=[],y=[],l=ln(n,e,t,o,i,s,a,r,h);l.forEach(function(u){var m=new a0(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7]),x=m.getTotalLength();c+=x,f.push(x),y.push(m)}),this.length=c,this.partialLengths=f,this.curves=y}at.prototype={constructor:at,init:function(){},getTotalLength:function(){return this.length},getPointAtLength:function(n){n<0?n=0:n>this.length&&(n=this.length);for(var e=this.partialLengths.length-1;this.partialLengths[e]>=n&&this.partialLengths[e]>0;)e--;e<this.partialLengths.length-1&&e++;for(var t=0,o=0;o<e;o++)t+=this.partialLengths[o];return this.curves[e].getPointAtLength(n-t)},getTangentAtLength:function(n){n<0?n=0:n>this.length&&(n=this.length);for(var e=this.partialLengths.length-1;this.partialLengths[e]>=n&&this.partialLengths[e]>0;)e--;e<this.partialLengths.length-1&&e++;for(var t=0,o=0;o<e;o++)t+=this.partialLengths[o];return this.curves[e].getTangentAtLength(n-t)},getPropertiesAtLength:function(n){var e=this.getTangentAtLength(n),t=this.getPointAtLength(n);return{x:t.x,y:t.y,tangentX:e.x,tangentY:e.y}}};function s0(n,e,t,o){return new I0(n,e,t,o)}function I0(n,e,t,o){this.x0=n,this.x1=e,this.y0=t,this.y1=o}I0.prototype.getTotalLength=function(){return Math.sqrt(Math.pow(this.x0-this.x1,2)+Math.pow(this.y0-this.y1,2))},I0.prototype.getPointAtLength=function(n){var e=n/Math.sqrt(Math.pow(this.x0-this.x1,2)+Math.pow(this.y0-this.y1,2)),t=(this.x1-this.x0)*e,o=(this.y1-this.y0)*e;return{x:this.x0+t,y:this.y0+o}},I0.prototype.getTangentAtLength=function(){var n=Math.sqrt((this.x1-this.x0)*(this.x1-this.x0)+(this.y1-this.y0)*(this.y1-this.y0));return{x:(this.x1-this.x0)/n,y:(this.y1-this.y0)/n}},I0.prototype.getPropertiesAtLength=function(n){var e=this.getPointAtLength(n),t=this.getTangentAtLength();return{x:e.x,y:e.y,tangentX:t.x,tangentY:t.y}};function cn(n){var e=0,t=[],o=[];function i(a){if(!a)return null;for(var r=Ye(a),h=[0,0],c=[0,0],f,y,l=0;l<r.length;l++)r[l][0]==="M"?(h=[r[l][1],r[l][2]],y=[h[0],h[1]],o.push(null)):r[l][0]==="m"?(h=[r[l][1]+h[0],r[l][2]+h[1]],y=[h[0],h[1]],o.push(null)):r[l][0]==="L"?(e=e+Math.sqrt(Math.pow(h[0]-r[l][1],2)+Math.pow(h[1]-r[l][2],2)),o.push(new s0(h[0],r[l][1],h[1],r[l][2])),h=[r[l][1],r[l][2]]):r[l][0]==="l"?(e=e+Math.sqrt(Math.pow(r[l][1],2)+Math.pow(r[l][2],2)),o.push(new s0(h[0],r[l][1]+h[0],h[1],r[l][2]+h[1])),h=[r[l][1]+h[0],r[l][2]+h[1]]):r[l][0]==="H"?(e=e+Math.abs(h[0]-r[l][1]),o.push(new s0(h[0],r[l][1],h[1],h[1])),h[0]=r[l][1]):r[l][0]==="h"?(e=e+Math.abs(r[l][1]),o.push(new s0(h[0],h[0]+r[l][1],h[1],h[1])),h[0]=r[l][1]+h[0]):r[l][0]==="V"?(e=e+Math.abs(h[1]-r[l][1]),o.push(new s0(h[0],h[0],h[1],r[l][1])),h[1]=r[l][1]):r[l][0]==="v"?(e=e+Math.abs(r[l][1]),o.push(new s0(h[0],h[0],h[1],h[1]+r[l][1])),h[1]=r[l][1]+h[1]):r[l][0]==="z"||r[l][0]==="Z"?(e=e+Math.sqrt(Math.pow(y[0]-h[0],2)+Math.pow(y[1]-h[1],2)),o.push(new s0(h[0],y[0],h[1],y[1])),h=[y[0],y[1]]):r[l][0]==="C"?(f=new a0(h[0],h[1],r[l][1],r[l][2],r[l][3],r[l][4],r[l][5],r[l][6]),e=e+f.getTotalLength(),h=[r[l][5],r[l][6]],o.push(f)):r[l][0]==="c"?(f=new a0(h[0],h[1],h[0]+r[l][1],h[1]+r[l][2],h[0]+r[l][3],h[1]+r[l][4],h[0]+r[l][5],h[1]+r[l][6]),e=e+f.getTotalLength(),h=[r[l][5]+h[0],r[l][6]+h[1]],o.push(f)):r[l][0]==="S"?(l>0&&["C","c","S","s"].indexOf(r[l-1][0])>-1?f=new a0(h[0],h[1],2*h[0]-r[l-1][r[l-1].length-4],2*h[1]-r[l-1][r[l-1].length-3],r[l][1],r[l][2],r[l][3],r[l][4]):f=new a0(h[0],h[1],h[0],h[1],r[l][1],r[l][2],r[l][3],r[l][4]),e=e+f.getTotalLength(),h=[r[l][3],r[l][4]],o.push(f)):r[l][0]==="s"?(l>0&&["C","c","S","s"].indexOf(r[l-1][0])>-1?f=new a0(h[0],h[1],h[0]+f.d.x-f.c.x,h[1]+f.d.y-f.c.y,h[0]+r[l][1],h[1]+r[l][2],h[0]+r[l][3],h[1]+r[l][4]):f=new a0(h[0],h[1],h[0],h[1],h[0]+r[l][1],h[1]+r[l][2],h[0]+r[l][3],h[1]+r[l][4]),e=e+f.getTotalLength(),h=[r[l][3]+h[0],r[l][4]+h[1]],o.push(f)):r[l][0]==="Q"?(h[0]!=r[l][1]&&h[1]!=r[l][2]?f=new a0(h[0],h[1],r[l][1],r[l][2],r[l][3],r[l][4]):f=new s0(r[l][1],r[l][3],r[l][2],r[l][4]),e=e+f.getTotalLength(),o.push(f),h=[r[l][3],r[l][4]],c=[r[l][1],r[l][2]]):r[l][0]==="q"?(r[l][1]==0&&r[l][2]==0?f=new s0(h[0]+r[l][1],h[0]+r[l][3],h[1]+r[l][2],h[1]+r[l][4]):f=new a0(h[0],h[1],h[0]+r[l][1],h[1]+r[l][2],h[0]+r[l][3],h[1]+r[l][4]),e=e+f.getTotalLength(),c=[h[0]+r[l][1],h[1]+r[l][2]],h=[r[l][3]+h[0],r[l][4]+h[1]],o.push(f)):r[l][0]==="T"?(l>0&&["Q","q","T","t"].indexOf(r[l-1][0])>-1?f=new a0(h[0],h[1],2*h[0]-c[0],2*h[1]-c[1],r[l][1],r[l][2]):f=new s0(h[0],r[l][1],h[1],r[l][2]),o.push(f),e=e+f.getTotalLength(),c=[2*h[0]-c[0],2*h[1]-c[1]],h=[r[l][1],r[l][2]]):r[l][0]==="t"?(l>0&&["Q","q","T","t"].indexOf(r[l-1][0])>-1?f=new a0(h[0],h[1],2*h[0]-c[0],2*h[1]-c[1],h[0]+r[l][1],h[1]+r[l][2]):f=new s0(h[0],h[0]+r[l][1],h[1],h[1]+r[l][2]),e=e+f.getTotalLength(),c=[2*h[0]-c[0],2*h[1]-c[1]],h=[r[l][1]+h[0],r[l][2]+h[0]],o.push(f)):r[l][0]==="A"?(f=new Ut(h[0],h[1],r[l][1],r[l][2],r[l][3],r[l][4],r[l][5],r[l][6],r[l][7]),e=e+f.getTotalLength(),h=[r[l][6],r[l][7]],o.push(f)):r[l][0]==="a"&&(f=new Ut(h[0],h[1],r[l][1],r[l][2],r[l][3],r[l][4],r[l][5],h[0]+r[l][6],h[1]+r[l][7]),e=e+f.getTotalLength(),h=[h[0]+r[l][6],h[1]+r[l][7]],o.push(f)),t.push(e);return i}i.getTotalLength=function(){return e},i.getPointAtLength=function(a){var r=s(a);return o[r.i].getPointAtLength(r.fraction)},i.getTangentAtLength=function(a){var r=s(a);return o[r.i].getTangentAtLength(r.fraction)},i.getPropertiesAtLength=function(a){var r=s(a);return o[r.i].getPropertiesAtLength(r.fraction)};var s=function(a){a<0?a=0:a>e&&(a=e);for(var r=t.length-1;t[r]>=a&&t[r]>0;)r--;return r++,{fraction:a-t[r-1],i:r}};return i(n)}function R0(n,e){return Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1]))}function Ht(n,e,t){return[n[0]+(e[0]-n[0])*t,n[1]+(e[1]-n[1])*t]}function un(n,e){return R0(n,e)<1e-9}function fn(n,e,t){let o=n.map((i,s)=>gn(i,e[s]));return function(i){let s=o.map(a=>a(i));return t?yn(s):s}}function gn(n,e){return function(t){return n.map((o,i)=>o+t*(e[i]-o))}}function N0(n){return typeof n=="number"&&isFinite(n)}const st=`All shapes must be supplied as arrays of [x, y] points or an SVG path string (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d).
|
|
2
2
|
Example valid ways of supplying a shape would be:
|
|
3
3
|
[[0, 0], [10, 0], [10, 10]]
|
|
4
4
|
"M0,0 L10,0 L10,10Z"
|
|
5
|
-
`;function un(n){return new ze(n).abs()}function fn(n){return n.toString().split("M").map((e,t)=>(e=e.trim(),t&&e?"M"+e:e)).filter(e=>e)}function gn(n){return"M"+n.join("L")+"Z"}function pn(n,e){let t=un(n);return dn(t)||xn(t,e)}function dn(n){let e=n.segments||[],t=[];if(!e.length||e[0][0]!=="M")return!1;for(let o=0;o<e.length;o++){let[i,s,a]=e[o];if(i==="M"&&o||i==="Z")break;if(i==="M"||i==="L")t.push([s,a]);else if(i==="H")t.push([s,t[t.length-1][1]]);else if(i==="V")t.push([t[t.length-1][0],s]);else return!1}return t.length?{ring:t}:!1}function xn(n,e){let t=fn(n)[0],o=[],i,s,a=3;if(!t)throw new TypeError(st);s=yn(t),i=s.getTotalLength(),e&&R0(e)&&e>0&&(a=Math.max(a,Math.ceil(i/e)));for(let r=0;r<a;r++){let h=s.getPointAtLength(i*r/a);o.push([h.x,h.y])}return{ring:o,skipBisect:!0}}function yn(n){if(typeof window<"u"&&window&&window.document)try{let e=window.document.createElementNS("http://www.w3.org/2000/svg","path");return e.setAttributeNS(null,"d",n),e}catch{}return sn(n)}function Ht(n,e){const t=n.length+e,o=ke(n)/e;let i=0,s=0,a=o/2;for(;n.length<t;){let r=n[i],h=n[(i+1)%n.length],c=F0(r,h);if(a<=s+c){n.splice(i+1,0,c?zt(r,h,(a-s)/c):r.slice(0)),a+=o;continue}s+=c,i++}}function vn(n,e=1/0){for(let t=0;t<n.length;t++){let o=n[t],i=t===n.length-1?n[0]:n[t+1];for(;F0(o,i)>e;)i=zt(o,i,.5),n.splice(t+1,0,i)}}function Wt(n,e){let t,o,i;if(typeof n=="string"){let s=pn(n,e);n=s.ring,i=s.skipBisect}else if(!Array.isArray(n))throw new TypeError(st);if(t=n.slice(0),!wn(t))throw new TypeError(st);return t.length>1&&hn(t[0],t[t.length-1])&&t.pop(),o=Oe(t),o>0&&t.reverse(),!i&&e&&R0(e)&&e>0&&vn(t,e),t}function wn(n){return n.every(function(e){return Array.isArray(e)&&e.length>=2&&R0(e[0])&&R0(e[1])})}function mn(n,e){let t=n.length,o=1/0,i,s,a;for(let r=0;r<t;r++)s=0,e.forEach(function(h,c){let f=F0(n[(r+c)%t],h);s+=f*f}),s<o&&(o=s,i=r);i&&(a=n.splice(0,i),n.splice(n.length,0,...a))}function An(n,e,{maxSegmentLength:t=10,string:o=!0}={}){let i=Wt(n,t),s=Wt(e,t),a=bn(i,s,o);return!o||typeof n!="string"&&typeof e!="string"?a:r=>r<1e-4&&typeof n=="string"?n:1-r<1e-4&&typeof e=="string"?e:a(r)}function bn(n,e,t){let o;return o=n.length-e.length,Ht(n,o<0?o*-1:0),Ht(e,o>0?o:0),mn(n,e),ln(n,e,t)}var N0={exports:{}},$t;function Mn(){if($t)return N0.exports;$t=1,N0.exports=n,N0.exports.default=n;function n(g,d,p){p=p||2;var v=d&&d.length,w=v?d[0]*p:g.length,A=e(g,0,w,p,!0),b=[];if(!A||A.next===A.prev)return b;var T,F,k,H,D,N,Z;if(v&&(A=h(g,d,A,p)),g.length>80*p){T=k=g[0],F=H=g[1];for(var j=p;j<w;j+=p)D=g[j],N=g[j+1],D<T&&(T=D),N<F&&(F=N),D>k&&(k=D),N>H&&(H=N);Z=Math.max(k-T,H-F),Z=Z!==0?32767/Z:0}return o(A,b,p,T,F,Z,0),b}function e(g,d,p,v,w){var A,b;if(w===ht(g,d,p,v)>0)for(A=d;A<p;A+=v)b=w0(A,g[A],g[A+1],b);else for(A=p-v;A>=d;A-=v)b=w0(A,g[A],g[A+1],b);return b&&S(b,b.next)&&(p0(b),b=b.next),b}function t(g,d){if(!g)return g;d||(d=g);var p=g,v;do if(v=!1,!p.steiner&&(S(p,p.next)||L(p.prev,p,p.next)===0)){if(p0(p),p=d=p.prev,p===p.next)break;v=!0}else p=p.next;while(v||p!==d);return d}function o(g,d,p,v,w,A,b){if(g){!b&&A&&u(g,v,w,A);for(var T=g,F,k;g.prev!==g.next;){if(F=g.prev,k=g.next,A?s(g,v,w,A):i(g)){d.push(F.i/p|0),d.push(g.i/p|0),d.push(k.i/p|0),p0(g),g=k.next,T=k.next;continue}if(g=k,g===T){b?b===1?(g=a(t(g),d,p),o(g,d,p,v,w,A,2)):b===2&&r(g,d,p,v,w,A):o(t(g),d,p,v,w,A,1);break}}}}function i(g){var d=g.prev,p=g,v=g.next;if(L(d,p,v)>=0)return!1;for(var w=d.x,A=p.x,b=v.x,T=d.y,F=p.y,k=v.y,H=w<A?w<b?w:b:A<b?A:b,D=T<F?T<k?T:k:F<k?F:k,N=w>A?w>b?w:b:A>b?A:b,Z=T>F?T>k?T:k:F>k?F:k,j=v.next;j!==d;){if(j.x>=H&&j.x<=N&&j.y>=D&&j.y<=Z&&C(w,T,A,F,b,k,j.x,j.y)&&L(j.prev,j,j.next)>=0)return!1;j=j.next}return!0}function s(g,d,p,v){var w=g.prev,A=g,b=g.next;if(L(w,A,b)>=0)return!1;for(var T=w.x,F=A.x,k=b.x,H=w.y,D=A.y,N=b.y,Z=T<F?T<k?T:k:F<k?F:k,j=H<D?H<N?H:N:D<N?D:N,I0=T>F?T>k?T:k:F>k?F:k,_0=H>D?H>N?H:N:D>N?D:N,Xt=y(Z,j,d,p,v),Gt=y(I0,_0,d,p,v),q=g.prevZ,B=g.nextZ;q&&q.z>=Xt&&B&&B.z<=Gt;){if(q.x>=Z&&q.x<=I0&&q.y>=j&&q.y<=_0&&q!==w&&q!==b&&C(T,H,F,D,k,N,q.x,q.y)&&L(q.prev,q,q.next)>=0||(q=q.prevZ,B.x>=Z&&B.x<=I0&&B.y>=j&&B.y<=_0&&B!==w&&B!==b&&C(T,H,F,D,k,N,B.x,B.y)&&L(B.prev,B,B.next)>=0))return!1;B=B.nextZ}for(;q&&q.z>=Xt;){if(q.x>=Z&&q.x<=I0&&q.y>=j&&q.y<=_0&&q!==w&&q!==b&&C(T,H,F,D,k,N,q.x,q.y)&&L(q.prev,q,q.next)>=0)return!1;q=q.prevZ}for(;B&&B.z<=Gt;){if(B.x>=Z&&B.x<=I0&&B.y>=j&&B.y<=_0&&B!==w&&B!==b&&C(T,H,F,D,k,N,B.x,B.y)&&L(B.prev,B,B.next)>=0)return!1;B=B.nextZ}return!0}function a(g,d,p){var v=g;do{var w=v.prev,A=v.next.next;!S(w,A)&&P(w,v,v.next,A)&&U(w,A)&&U(A,w)&&(d.push(w.i/p|0),d.push(v.i/p|0),d.push(A.i/p|0),p0(v),p0(v.next),v=g=A),v=v.next}while(v!==g);return t(v)}function r(g,d,p,v,w,A){var b=g;do{for(var T=b.next.next;T!==b.prev;){if(b.i!==T.i&&E(b,T)){var F=u0(b,T);b=t(b,b.next),F=t(F,F.next),o(b,d,p,v,w,A,0),o(F,d,p,v,w,A,0);return}T=T.next}b=b.next}while(b!==g)}function h(g,d,p,v){var w=[],A,b,T,F,k;for(A=0,b=d.length;A<b;A++)T=d[A]*v,F=A<b-1?d[A+1]*v:g.length,k=e(g,T,F,v,!1),k===k.next&&(k.steiner=!0),w.push(M(k));for(w.sort(c),A=0;A<w.length;A++)p=f(w[A],p);return p}function c(g,d){return g.x-d.x}function f(g,d){var p=x(g,d);if(!p)return d;var v=u0(p,g);return t(v,v.next),t(p,p.next)}function x(g,d){var p=d,v=g.x,w=g.y,A=-1/0,b;do{if(w<=p.y&&w>=p.next.y&&p.next.y!==p.y){var T=p.x+(w-p.y)*(p.next.x-p.x)/(p.next.y-p.y);if(T<=v&&T>A&&(A=T,b=p.x<p.next.x?p:p.next,T===v))return b}p=p.next}while(p!==d);if(!b)return null;var F=b,k=b.x,H=b.y,D=1/0,N;p=b;do v>=p.x&&p.x>=k&&v!==p.x&&C(w<H?v:A,w,k,H,w<H?A:v,w,p.x,p.y)&&(N=Math.abs(w-p.y)/(v-p.x),U(p,g)&&(N<D||N===D&&(p.x>b.x||p.x===b.x&&l(b,p)))&&(b=p,D=N)),p=p.next;while(p!==F);return b}function l(g,d){return L(g.prev,g,d.prev)<0&&L(d.next,g,g.next)<0}function u(g,d,p,v){var w=g;do w.z===0&&(w.z=y(w.x,w.y,d,p,v)),w.prevZ=w.prev,w.nextZ=w.next,w=w.next;while(w!==g);w.prevZ.nextZ=null,w.prevZ=null,m(w)}function m(g){var d,p,v,w,A,b,T,F,k=1;do{for(p=g,g=null,A=null,b=0;p;){for(b++,v=p,T=0,d=0;d<k&&(T++,v=v.nextZ,!!v);d++);for(F=k;T>0||F>0&&v;)T!==0&&(F===0||!v||p.z<=v.z)?(w=p,p=p.nextZ,T--):(w=v,v=v.nextZ,F--),A?A.nextZ=w:g=w,w.prevZ=A,A=w;p=v}A.nextZ=null,k*=2}while(b>1);return g}function y(g,d,p,v,w){return g=(g-p)*w|0,d=(d-v)*w|0,g=(g|g<<8)&16711935,g=(g|g<<4)&252645135,g=(g|g<<2)&858993459,g=(g|g<<1)&1431655765,d=(d|d<<8)&16711935,d=(d|d<<4)&252645135,d=(d|d<<2)&858993459,d=(d|d<<1)&1431655765,g|d<<1}function M(g){var d=g,p=g;do(d.x<p.x||d.x===p.x&&d.y<p.y)&&(p=d),d=d.next;while(d!==g);return p}function C(g,d,p,v,w,A,b,T){return(w-b)*(d-T)>=(g-b)*(A-T)&&(g-b)*(v-T)>=(p-b)*(d-T)&&(p-b)*(A-T)>=(w-b)*(v-T)}function E(g,d){return g.next.i!==d.i&&g.prev.i!==d.i&&!V(g,d)&&(U(g,d)&&U(d,g)&&X(g,d)&&(L(g.prev,g,d.prev)||L(g,d.prev,d))||S(g,d)&&L(g.prev,g,g.next)>0&&L(d.prev,d,d.next)>0)}function L(g,d,p){return(d.y-g.y)*(p.x-d.x)-(d.x-g.x)*(p.y-d.y)}function S(g,d){return g.x===d.x&&g.y===d.y}function P(g,d,p,v){var w=W(L(g,d,p)),A=W(L(g,d,v)),b=W(L(p,v,g)),T=W(L(p,v,d));return!!(w!==A&&b!==T||w===0&&R(g,p,d)||A===0&&R(g,v,d)||b===0&&R(p,g,v)||T===0&&R(p,d,v))}function R(g,d,p){return d.x<=Math.max(g.x,p.x)&&d.x>=Math.min(g.x,p.x)&&d.y<=Math.max(g.y,p.y)&&d.y>=Math.min(g.y,p.y)}function W(g){return g>0?1:g<0?-1:0}function V(g,d){var p=g;do{if(p.i!==g.i&&p.next.i!==g.i&&p.i!==d.i&&p.next.i!==d.i&&P(p,p.next,g,d))return!0;p=p.next}while(p!==g);return!1}function U(g,d){return L(g.prev,g,g.next)<0?L(g,d,g.next)>=0&&L(g,g.prev,d)>=0:L(g,d,g.prev)<0||L(g,g.next,d)<0}function X(g,d){var p=g,v=!1,w=(g.x+d.x)/2,A=(g.y+d.y)/2;do p.y>A!=p.next.y>A&&p.next.y!==p.y&&w<(p.next.x-p.x)*(A-p.y)/(p.next.y-p.y)+p.x&&(v=!v),p=p.next;while(p!==g);return v}function u0(g,d){var p=new a0(g.i,g.x,g.y),v=new a0(d.i,d.x,d.y),w=g.next,A=d.prev;return g.next=d,d.prev=g,p.next=w,w.prev=p,v.next=p,p.prev=v,A.next=v,v.prev=A,v}function w0(g,d,p,v){var w=new a0(g,d,p);return v?(w.next=v.next,w.prev=v,v.next.prev=w,v.next=w):(w.prev=w,w.next=w),w}function p0(g){g.next.prev=g.prev,g.prev.next=g.next,g.prevZ&&(g.prevZ.nextZ=g.nextZ),g.nextZ&&(g.nextZ.prevZ=g.prevZ)}function a0(g,d,p){this.i=g,this.x=d,this.y=p,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}n.deviation=function(g,d,p,v){var w=d&&d.length,A=w?d[0]*p:g.length,b=Math.abs(ht(g,0,A,p));if(w)for(var T=0,F=d.length;T<F;T++){var k=d[T]*p,H=T<F-1?d[T+1]*p:g.length;b-=Math.abs(ht(g,k,H,p))}var D=0;for(T=0;T<v.length;T+=3){var N=v[T]*p,Z=v[T+1]*p,j=v[T+2]*p;D+=Math.abs((g[N]-g[j])*(g[Z+1]-g[N+1])-(g[N]-g[Z])*(g[j+1]-g[N+1]))}return b===0&&D===0?0:Math.abs((D-b)/b)};function ht(g,d,p,v){for(var w=0,A=d,b=p-v;A<p;A+=v)w+=(g[b]-g[A])*(g[A+1]+g[b+1]),b=A;return w}return n.flatten=function(g){for(var d=g[0][0].length,p={vertices:[],holes:[],dimensions:d},v=0,w=0;w<g.length;w++){for(var A=0;A<g[w].length;A++)for(var b=0;b<d;b++)p.vertices.push(g[w][A][b]);w>0&&(v+=g[w-1].length,p.holes.push(v))}return p},N0.exports}Mn();function Yt(n,e){return n<e?-1:n>e?1:n>=e?0:NaN}function Ln(n){return n.length===1&&(n=Tn(n)),{left:function(e,t,o,i){for(o==null&&(o=0),i==null&&(i=e.length);o<i;){var s=o+i>>>1;n(e[s],t)<0?o=s+1:i=s}return o},right:function(e,t,o,i){for(o==null&&(o=0),i==null&&(i=e.length);o<i;){var s=o+i>>>1;n(e[s],t)>0?i=s:o=s+1}return o}}}function Tn(n){return function(e,t){return Yt(n(e),t)}}Ln(Yt);function Pn(n,e,t=3){const o=An(n,e,{maxSegmentLength:t});return{check:i=>typeof i=="string",interpolate:(i,s,a)=>o(a)}}function Cn(n){const e=o=>n.width*o,t=o=>n.height*o;return{scaleX:e,scaleY:t,position:(o,i)=>Y({x:e(o),y:t(i)})}}function En(n){const e=[];if(n.isAllKey){for(let t=0;t<=n.animations.length;t++)e.push(t);return e}return n.isStartKey&&e.push(0),n.animations.forEach((t,o)=>{Array.isArray(t)?t.some(i=>i.isKey)&&e.push(o+1):t.isKey&&e.push(o+1)}),n.isEndKey&&e[e.length-1]!==n.animations.length&&e.push(n.animations.length),e}I.Alignment=f0,I.Anchor=J,I.Animate=k0,I.Arrow=a1,I.BrowserCanvasRenderer=Ce,I.Circle=h1,I.Color=G,I.Easing=O0,I.FadeIn=Jt,I.FadeOut=t1,I.FontStyle=yt,I.FontWeight=vt,I.Grid=l1,I.Group=j0,I.Hide=e1,I.IFrame=r1,I.Image=c1,I.Line=u1,I.Mask=f1,I.ObjectType=z,I.Opaque=_e,I.Path=_1,I.Pause=Ee,I.Polygon=O1,I.Position=Y,I.Presentation=bt,I.Rectangle=k1,I.ScreenCapture=o1,I.Show=n1,I.Size=r0,I.Slide=Se,I.SlideObject=n0,I.SlideWebExtra=D0,I.Text=At,I.TextUnit=Ie,I.Transparent=xt,I.Update=B0,I.getKeySlideBuildIndices=En,I.getSizingFunctions=Cn,I.getSmoothPathInterpolator=Pn,I.getTextContentLength=mt,I.interpolateColor=Lt,I.interpolateNumber=Tt,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})}));
|
|
5
|
+
`;function pn(n){return new We(n).abs()}function dn(n){return n.toString().split("M").map((e,t)=>(e=e.trim(),t&&e?"M"+e:e)).filter(e=>e)}function yn(n){return"M"+n.join("L")+"Z"}function xn(n,e){let t=pn(n);return vn(t)||wn(t,e)}function vn(n){let e=n.segments||[],t=[];if(!e.length||e[0][0]!=="M")return!1;for(let o=0;o<e.length;o++){let[i,s,a]=e[o];if(i==="M"&&o||i==="Z")break;if(i==="M"||i==="L")t.push([s,a]);else if(i==="H")t.push([s,t[t.length-1][1]]);else if(i==="V")t.push([t[t.length-1][0],s]);else return!1}return t.length?{ring:t}:!1}function wn(n,e){let t=dn(n)[0],o=[],i,s,a=3;if(!t)throw new TypeError(st);s=mn(t),i=s.getTotalLength(),e&&N0(e)&&e>0&&(a=Math.max(a,Math.ceil(i/e)));for(let r=0;r<a;r++){let h=s.getPointAtLength(i*r/a);o.push([h.x,h.y])}return{ring:o,skipBisect:!0}}function mn(n){if(typeof window<"u"&&window&&window.document)try{let e=window.document.createElementNS("http://www.w3.org/2000/svg","path");return e.setAttributeNS(null,"d",n),e}catch{}return cn(n)}function Gt(n,e){const t=n.length+e,o=Ne(n)/e;let i=0,s=0,a=o/2;for(;n.length<t;){let r=n[i],h=n[(i+1)%n.length],c=R0(r,h);if(a<=s+c){n.splice(i+1,0,c?Ht(r,h,(a-s)/c):r.slice(0)),a+=o;continue}s+=c,i++}}function bn(n,e=1/0){for(let t=0;t<n.length;t++){let o=n[t],i=t===n.length-1?n[0]:n[t+1];for(;R0(o,i)>e;)i=Ht(o,i,.5),n.splice(t+1,0,i)}}function Wt(n,e){let t,o,i;if(typeof n=="string"){let s=xn(n,e);n=s.ring,i=s.skipBisect}else if(!Array.isArray(n))throw new TypeError(st);if(t=n.slice(0),!An(t))throw new TypeError(st);return t.length>1&&un(t[0],t[t.length-1])&&t.pop(),o=Re(t),o>0&&t.reverse(),!i&&e&&N0(e)&&e>0&&bn(t,e),t}function An(n){return n.every(function(e){return Array.isArray(e)&&e.length>=2&&N0(e[0])&&N0(e[1])})}function Mn(n,e){let t=n.length,o=1/0,i,s,a;for(let r=0;r<t;r++)s=0,e.forEach(function(h,c){let f=R0(n[(r+c)%t],h);s+=f*f}),s<o&&(o=s,i=r);i&&(a=n.splice(0,i),n.splice(n.length,0,...a))}function Ln(n,e,{maxSegmentLength:t=10,string:o=!0}={}){let i=Wt(n,t),s=Wt(e,t),a=Tn(i,s,o);return!o||typeof n!="string"&&typeof e!="string"?a:r=>r<1e-4&&typeof n=="string"?n:1-r<1e-4&&typeof e=="string"?e:a(r)}function Tn(n,e,t){let o;return o=n.length-e.length,Gt(n,o<0?o*-1:0),Gt(e,o>0?o:0),Mn(n,e),fn(n,e,t)}var q0={exports:{}},$t;function Pn(){if($t)return q0.exports;$t=1,q0.exports=n,q0.exports.default=n;function n(g,d,p){p=p||2;var v=d&&d.length,w=v?d[0]*p:g.length,b=e(g,0,w,p,!0),A=[];if(!b||b.next===b.prev)return A;var T,F,k,H,j,N,Z;if(v&&(b=h(g,d,b,p)),g.length>80*p){T=k=g[0],F=H=g[1];for(var z=p;z<w;z+=p)j=g[z],N=g[z+1],j<T&&(T=j),N<F&&(F=N),j>k&&(k=j),N>H&&(H=N);Z=Math.max(k-T,H-F),Z=Z!==0?32767/Z:0}return o(b,A,p,T,F,Z,0),A}function e(g,d,p,v,w){var b,A;if(w===ht(g,d,p,v)>0)for(b=d;b<p;b+=v)A=w0(b,g[b],g[b+1],A);else for(b=p-v;b>=d;b-=v)A=w0(b,g[b],g[b+1],A);return A&&S(A,A.next)&&(d0(A),A=A.next),A}function t(g,d){if(!g)return g;d||(d=g);var p=g,v;do if(v=!1,!p.steiner&&(S(p,p.next)||L(p.prev,p,p.next)===0)){if(d0(p),p=d=p.prev,p===p.next)break;v=!0}else p=p.next;while(v||p!==d);return d}function o(g,d,p,v,w,b,A){if(g){!A&&b&&u(g,v,w,b);for(var T=g,F,k;g.prev!==g.next;){if(F=g.prev,k=g.next,b?s(g,v,w,b):i(g)){d.push(F.i/p|0),d.push(g.i/p|0),d.push(k.i/p|0),d0(g),g=k.next,T=k.next;continue}if(g=k,g===T){A?A===1?(g=a(t(g),d,p),o(g,d,p,v,w,b,2)):A===2&&r(g,d,p,v,w,b):o(t(g),d,p,v,w,b,1);break}}}}function i(g){var d=g.prev,p=g,v=g.next;if(L(d,p,v)>=0)return!1;for(var w=d.x,b=p.x,A=v.x,T=d.y,F=p.y,k=v.y,H=w<b?w<A?w:A:b<A?b:A,j=T<F?T<k?T:k:F<k?F:k,N=w>b?w>A?w:A:b>A?b:A,Z=T>F?T>k?T:k:F>k?F:k,z=v.next;z!==d;){if(z.x>=H&&z.x<=N&&z.y>=j&&z.y<=Z&&C(w,T,b,F,A,k,z.x,z.y)&&L(z.prev,z,z.next)>=0)return!1;z=z.next}return!0}function s(g,d,p,v){var w=g.prev,b=g,A=g.next;if(L(w,b,A)>=0)return!1;for(var T=w.x,F=b.x,k=A.x,H=w.y,j=b.y,N=A.y,Z=T<F?T<k?T:k:F<k?F:k,z=H<j?H<N?H:N:j<N?j:N,_0=T>F?T>k?T:k:F>k?F:k,O0=H>j?H>N?H:N:j>N?j:N,Xt=x(Z,z,d,p,v),Zt=x(_0,O0,d,p,v),q=g.prevZ,B=g.nextZ;q&&q.z>=Xt&&B&&B.z<=Zt;){if(q.x>=Z&&q.x<=_0&&q.y>=z&&q.y<=O0&&q!==w&&q!==A&&C(T,H,F,j,k,N,q.x,q.y)&&L(q.prev,q,q.next)>=0||(q=q.prevZ,B.x>=Z&&B.x<=_0&&B.y>=z&&B.y<=O0&&B!==w&&B!==A&&C(T,H,F,j,k,N,B.x,B.y)&&L(B.prev,B,B.next)>=0))return!1;B=B.nextZ}for(;q&&q.z>=Xt;){if(q.x>=Z&&q.x<=_0&&q.y>=z&&q.y<=O0&&q!==w&&q!==A&&C(T,H,F,j,k,N,q.x,q.y)&&L(q.prev,q,q.next)>=0)return!1;q=q.prevZ}for(;B&&B.z<=Zt;){if(B.x>=Z&&B.x<=_0&&B.y>=z&&B.y<=O0&&B!==w&&B!==A&&C(T,H,F,j,k,N,B.x,B.y)&&L(B.prev,B,B.next)>=0)return!1;B=B.nextZ}return!0}function a(g,d,p){var v=g;do{var w=v.prev,b=v.next.next;!S(w,b)&&P(w,v,v.next,b)&&U(w,b)&&U(b,w)&&(d.push(w.i/p|0),d.push(v.i/p|0),d.push(b.i/p|0),d0(v),d0(v.next),v=g=b),v=v.next}while(v!==g);return t(v)}function r(g,d,p,v,w,b){var A=g;do{for(var T=A.next.next;T!==A.prev;){if(A.i!==T.i&&E(A,T)){var F=u0(A,T);A=t(A,A.next),F=t(F,F.next),o(A,d,p,v,w,b,0),o(F,d,p,v,w,b,0);return}T=T.next}A=A.next}while(A!==g)}function h(g,d,p,v){var w=[],b,A,T,F,k;for(b=0,A=d.length;b<A;b++)T=d[b]*v,F=b<A-1?d[b+1]*v:g.length,k=e(g,T,F,v,!1),k===k.next&&(k.steiner=!0),w.push(M(k));for(w.sort(c),b=0;b<w.length;b++)p=f(w[b],p);return p}function c(g,d){return g.x-d.x}function f(g,d){var p=y(g,d);if(!p)return d;var v=u0(p,g);return t(v,v.next),t(p,p.next)}function y(g,d){var p=d,v=g.x,w=g.y,b=-1/0,A;do{if(w<=p.y&&w>=p.next.y&&p.next.y!==p.y){var T=p.x+(w-p.y)*(p.next.x-p.x)/(p.next.y-p.y);if(T<=v&&T>b&&(b=T,A=p.x<p.next.x?p:p.next,T===v))return A}p=p.next}while(p!==d);if(!A)return null;var F=A,k=A.x,H=A.y,j=1/0,N;p=A;do v>=p.x&&p.x>=k&&v!==p.x&&C(w<H?v:b,w,k,H,w<H?b:v,w,p.x,p.y)&&(N=Math.abs(w-p.y)/(v-p.x),U(p,g)&&(N<j||N===j&&(p.x>A.x||p.x===A.x&&l(A,p)))&&(A=p,j=N)),p=p.next;while(p!==F);return A}function l(g,d){return L(g.prev,g,d.prev)<0&&L(d.next,g,g.next)<0}function u(g,d,p,v){var w=g;do w.z===0&&(w.z=x(w.x,w.y,d,p,v)),w.prevZ=w.prev,w.nextZ=w.next,w=w.next;while(w!==g);w.prevZ.nextZ=null,w.prevZ=null,m(w)}function m(g){var d,p,v,w,b,A,T,F,k=1;do{for(p=g,g=null,b=null,A=0;p;){for(A++,v=p,T=0,d=0;d<k&&(T++,v=v.nextZ,!!v);d++);for(F=k;T>0||F>0&&v;)T!==0&&(F===0||!v||p.z<=v.z)?(w=p,p=p.nextZ,T--):(w=v,v=v.nextZ,F--),b?b.nextZ=w:g=w,w.prevZ=b,b=w;p=v}b.nextZ=null,k*=2}while(A>1);return g}function x(g,d,p,v,w){return g=(g-p)*w|0,d=(d-v)*w|0,g=(g|g<<8)&16711935,g=(g|g<<4)&252645135,g=(g|g<<2)&858993459,g=(g|g<<1)&1431655765,d=(d|d<<8)&16711935,d=(d|d<<4)&252645135,d=(d|d<<2)&858993459,d=(d|d<<1)&1431655765,g|d<<1}function M(g){var d=g,p=g;do(d.x<p.x||d.x===p.x&&d.y<p.y)&&(p=d),d=d.next;while(d!==g);return p}function C(g,d,p,v,w,b,A,T){return(w-A)*(d-T)>=(g-A)*(b-T)&&(g-A)*(v-T)>=(p-A)*(d-T)&&(p-A)*(b-T)>=(w-A)*(v-T)}function E(g,d){return g.next.i!==d.i&&g.prev.i!==d.i&&!K(g,d)&&(U(g,d)&&U(d,g)&&Y(g,d)&&(L(g.prev,g,d.prev)||L(g,d.prev,d))||S(g,d)&&L(g.prev,g,g.next)>0&&L(d.prev,d,d.next)>0)}function L(g,d,p){return(d.y-g.y)*(p.x-d.x)-(d.x-g.x)*(p.y-d.y)}function S(g,d){return g.x===d.x&&g.y===d.y}function P(g,d,p,v){var w=W(L(g,d,p)),b=W(L(g,d,v)),A=W(L(p,v,g)),T=W(L(p,v,d));return!!(w!==b&&A!==T||w===0&&R(g,p,d)||b===0&&R(g,v,d)||A===0&&R(p,g,v)||T===0&&R(p,d,v))}function R(g,d,p){return d.x<=Math.max(g.x,p.x)&&d.x>=Math.min(g.x,p.x)&&d.y<=Math.max(g.y,p.y)&&d.y>=Math.min(g.y,p.y)}function W(g){return g>0?1:g<0?-1:0}function K(g,d){var p=g;do{if(p.i!==g.i&&p.next.i!==g.i&&p.i!==d.i&&p.next.i!==d.i&&P(p,p.next,g,d))return!0;p=p.next}while(p!==g);return!1}function U(g,d){return L(g.prev,g,g.next)<0?L(g,d,g.next)>=0&&L(g,g.prev,d)>=0:L(g,d,g.prev)<0||L(g,g.next,d)<0}function Y(g,d){var p=g,v=!1,w=(g.x+d.x)/2,b=(g.y+d.y)/2;do p.y>b!=p.next.y>b&&p.next.y!==p.y&&w<(p.next.x-p.x)*(b-p.y)/(p.next.y-p.y)+p.x&&(v=!v),p=p.next;while(p!==g);return v}function u0(g,d){var p=new h0(g.i,g.x,g.y),v=new h0(d.i,d.x,d.y),w=g.next,b=d.prev;return g.next=d,d.prev=g,p.next=w,w.prev=p,v.next=p,p.prev=v,b.next=v,v.prev=b,v}function w0(g,d,p,v){var w=new h0(g,d,p);return v?(w.next=v.next,w.prev=v,v.next.prev=w,v.next=w):(w.prev=w,w.next=w),w}function d0(g){g.next.prev=g.prev,g.prev.next=g.next,g.prevZ&&(g.prevZ.nextZ=g.nextZ),g.nextZ&&(g.nextZ.prevZ=g.prevZ)}function h0(g,d,p){this.i=g,this.x=d,this.y=p,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}n.deviation=function(g,d,p,v){var w=d&&d.length,b=w?d[0]*p:g.length,A=Math.abs(ht(g,0,b,p));if(w)for(var T=0,F=d.length;T<F;T++){var k=d[T]*p,H=T<F-1?d[T+1]*p:g.length;A-=Math.abs(ht(g,k,H,p))}var j=0;for(T=0;T<v.length;T+=3){var N=v[T]*p,Z=v[T+1]*p,z=v[T+2]*p;j+=Math.abs((g[N]-g[z])*(g[Z+1]-g[N+1])-(g[N]-g[Z])*(g[z+1]-g[N+1]))}return A===0&&j===0?0:Math.abs((j-A)/A)};function ht(g,d,p,v){for(var w=0,b=d,A=p-v;b<p;b+=v)w+=(g[A]-g[b])*(g[b+1]+g[A+1]),A=b;return w}return n.flatten=function(g){for(var d=g[0][0].length,p={vertices:[],holes:[],dimensions:d},v=0,w=0;w<g.length;w++){for(var b=0;b<g[w].length;b++)for(var A=0;A<d;A++)p.vertices.push(g[w][b][A]);w>0&&(v+=g[w-1].length,p.holes.push(v))}return p},q0.exports}Pn();function Yt(n,e){return n<e?-1:n>e?1:n>=e?0:NaN}function Cn(n){return n.length===1&&(n=En(n)),{left:function(e,t,o,i){for(o==null&&(o=0),i==null&&(i=e.length);o<i;){var s=o+i>>>1;n(e[s],t)<0?o=s+1:i=s}return o},right:function(e,t,o,i){for(o==null&&(o=0),i==null&&(i=e.length);o<i;){var s=o+i>>>1;n(e[s],t)>0?i=s:o=s+1}return o}}}function En(n){return function(e,t){return Yt(n(e),t)}}Cn(Yt);function Sn(n,e,t=3){const o=Ln(n,e,{maxSegmentLength:t});return{check:i=>typeof i=="string",interpolate:(i,s,a)=>o(a)}}function In(n){const e=o=>n.width*o,t=o=>n.height*o;return{scaleX:e,scaleY:t,position:(o,i)=>G({x:e(o),y:t(i)})}}function _n(n){const e=[];if(n.isAllKey){for(let t=0;t<=n.animations.length;t++)e.push(t);return e}return n.isStartKey&&e.push(0),n.animations.forEach((t,o)=>{Array.isArray(t)?t.some(i=>i.isKey)&&e.push(o+1):t.isKey&&e.push(o+1)}),n.isEndKey&&e[e.length-1]!==n.animations.length&&e.push(n.animations.length),e}I.Alignment=f0,I.Anchor=t0,I.Animate=F0,I.Arrow=s1,I.BrowserCanvasRenderer=Ie,I.Circle=l1,I.Color=X,I.Easing=k0,I.FadeIn=t1,I.FadeOut=e1,I.FontStyle=xt,I.FontWeight=vt,I.Grid=c1,I.Group=z0,I.Hide=n1,I.IFrame=i1,I.Image=u1,I.Line=f1,I.Mask=g1,I.ObjectType=D,I.Opaque=Fe,I.Path=O1,I.Pause=_e,I.Polygon=k1,I.Position=G,I.Presentation=At,I.Rectangle=F1,I.SVG=R1,I.ScreenCapture=a1,I.Show=r1,I.Size=r0,I.Slide=Oe,I.SlideObject=e0,I.SlideWebExtra=j0,I.Text=bt,I.TextUnit=ke,I.Transparent=yt,I.Update=D0,I.getKeySlideBuildIndices=_n,I.getSizingFunctions=In,I.getSmoothPathInterpolator=Sn,I.getTextContentLength=mt,I.interpolateColor=Lt,I.interpolateNumber=Tt,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})}));
|
|
6
|
+
//# sourceMappingURL=presenter.js.map
|