@phin-tech/dottie 0.6.1 → 0.6.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/PARITY.md +1 -1
- package/README.md +8 -2
- package/dist/compile.js +54 -4
- package/dist/dottie-compile.mjs +66 -6
- package/dist/dottie-loader.js +2 -1
- package/dist/dottie-player.js +224 -141
- package/dist/dottie-player.min.js +52 -52
- package/dist/dottie.js +218 -141
- package/dist/fonts/OFL-architects-daughter.txt +93 -0
- package/dist/fonts/OFL-caveat.txt +93 -0
- package/dist/fonts/OFL-patrick-hand.txt +93 -0
- package/dist/fonts/architects-daughter-regular.woff2 +0 -0
- package/dist/fonts/caveat-bold.woff2 +0 -0
- package/dist/fonts/caveat-regular.woff2 +0 -0
- package/dist/fonts/patrick-hand-regular.woff2 +0 -0
- package/dist/types/compile.d.ts +5 -1
- package/dist/types/fonts.d.ts +13 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/metrics.d.ts +16 -9
- package/dist/types/model.d.ts +2 -0
- package/dist/types/text.d.ts +20 -6
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! dottie.js 0.6.
|
|
2
|
-
"use strict";(()=>{var on=Object.defineProperty;var wi=(t,e,n)=>e in t?on(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Pi=(t,e)=>{for(var n in e)on(t,n,{get:e[n],enumerable:!0})};var M=(t,e,n)=>wi(t,typeof e!="symbol"?e+"":e,n);var nn={};Pi(nn,{BOIL_DRAWINGS:()=>we,DottieFormatError:()=>Z,DottiePlayer:()=>Tt,KINDS:()=>ln,KNOWN_FIELDS:()=>an,MAX_DURATION:()=>bt,MAX_MARCH:()=>xe,Playback:()=>Ft,SUPPORTED_VERSION:()=>Yr,VERSION:()=>Vr,allowedURL:()=>ht,black:()=>ct,bounds:()=>et,cameraView:()=>vt,clampFPS:()=>kt,clampMarch:()=>un,clampTime:()=>C,clear:()=>cn,cloneElement:()=>z,definePlayer:()=>pe,elementIndex:()=>vi,frameTimes:()=>ie,inkOnDark:()=>hn,inspect:()=>ki,inspectFrame:()=>tn,inspectPage:()=>en,isAutomaticInk:()=>Pe,luminance:()=>wt,orderedElements:()=>dt,pageIndex:()=>Ht,parseDottie:()=>Lt,plan:()=>Et,posterTime:()=>at,render:()=>Cr,repeatIsValid:()=>Ut,resolved:()=>K,sameColor:()=>xt,sampleTimes:()=>Je,sceneAt:()=>Gn,stableSortBy:()=>qt,still:()=>Bn,svg:()=>fe,svgParts:()=>ut,themeNamed:()=>yt,themes:()=>Qe,transientElements:()=>Nn,webLink:()=>$t,withRoughness:()=>jt});var Yr=2,ln=["rectangle","ellipse","diamond","text","connector","freehand","path","note","image","symbol"],Mi=["linear","easeIn","easeOut","easeInOut","hold","spring","bounce","elastic"],an={file:["version","pages","images"],page:["id","name","layers","elements","theme","guidesX","guidesY","guidesLocked","timeline","symbols"],symbol:["id","name","width","height","layers","elements","timeline","button","params"],layer:["id","name","visible","locked"],rgba:["r","g","b","a"],style:["stroke","fill","fillStyle","strokeWidth","dash","roughness","bowing","fontSize","gridSize","opacity","dashOffset"],element:["id","kind","x","y","width","height","style","seed","layerID","text","connector","groupID","points","path","subpaths","evenOdd","rotation","link","url","anchor","click","hover","symbol","playback","offset","args","image","reveal","ports","labelRect","extension"],strokePoint:["x","y"],subpath:["closed","coords"],inlineImage:["data","format"],endpoint:["elementID","port","portIndex","x","y"],extensionRef:["id","shape","version","params"],normalizedPoint:["x","y"],normalizedRect:["x","y","width","height"],connector:["start","end","routing","startHead","endHead"],timeline:["fps","duration","boil","settle","poster","tracks","camera","markers"],track:["element","keys","boil","follow","repeats","march"],keyframe:["t","x","y","width","height","rotation","strokeWidth","stroke","fill","visible","reveal","opacity","ease"],follow:["path","start","end","ease","reverse","orient","laps"],repeat:["start","end","count"],cameraKey:["t","x","y","width","height","ease"],marker:["t","name"],click:["scene","url"],hover:["stroke","fill","opacity"]},bt=3600,xe=1e4,un=t=>t===void 0||!Number.isFinite(t)||t===0?null:Math.min(Math.max(t,-xe),xe),we=3,ct={r:.12,g:.12,b:.13,a:1},cn={r:0,g:0,b:0,a:0},hn={r:.93,g:.93,b:.94,a:1},Z=class extends Error{},S=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),R=t=>typeof t=="number"&&Number.isFinite(t)?t:void 0,I=t=>typeof t=="string"?t:void 0,sn=t=>S(t)&&Object.values(t).every(e=>typeof e=="string")?{...t}:null,W=t=>typeof t=="boolean"?t:void 0,Y=t=>typeof t=="string"?t.toUpperCase():void 0;function C(t){return Number.isFinite(t)?Math.min(Math.max(t,0),bt):t===1/0?bt:0}function kt(t){return Number.isFinite(t)?Math.min(Math.max(t,1),60):12}function ht(t){let e=t.trim();return!/^(https?:\/\/|mailto:)/i.test(e)||[...e].length<=7||/[\u0000-\u001f\u007f-\u009f]/.test(e)?null:e}function $t(t){return t?ht(t):null}function gt(t){if(!S(t))return;let e=R(t.r),n=R(t.g),i=R(t.b);if(!(e===void 0||n===void 0||i===void 0))return{r:e,g:n,b:i,a:R(t.a)??1}}var ke=class{constructor(){M(this,"warnings",[]);M(this,"seen",new Set)}warn(e){this.seen.has(e)||(this.seen.add(e),this.warnings.push(e))}fields(e,n){let i=an[n];for(let r of Object.keys(e))i.includes(r)||this.warn(`Unknown field "${r}" on ${n}, ignored`)}style(e){let n=S(e)?e:{};this.fields(n,"style");let i=I(n.fillStyle)??"solid",r=I(n.dash)??"solid";return["solid","hachure","crossHatch","grid"].includes(i)||this.warn(`Unknown fill style "${i}", drawn solid`),["solid","dashed","dotted"].includes(r)||this.warn(`Unknown dash "${r}", drawn solid`),{stroke:gt(n.stroke)??{...ct},fill:gt(n.fill)??{...cn},fillStyle:["solid","hachure","crossHatch","grid"].includes(i)?i:"solid",strokeWidth:R(n.strokeWidth)??2,dash:["solid","dashed","dotted"].includes(r)?r:"solid",roughness:R(n.roughness)??1,bowing:R(n.bowing)??1,fontSize:R(n.fontSize)??18,gridSize:R(n.gridSize)??null,opacity:R(n.opacity)??null,dashOffset:R(n.dashOffset)??null}}endpoint(e){let n=S(e)?e:{},i=I(n.port),r=R(n.portIndex);return{elementID:Y(n.elementID)??null,port:i&&["top","right","bottom","left"].includes(i)?i:null,portIndex:r!==void 0&&Number.isInteger(r)&&r>=0?r:null,x:R(n.x)??0,y:R(n.y)??0}}connector(e){if(!S(e))return null;this.fields(e,"connector");let n=(r,o)=>{let s=I(r);return s&&["none","arrow","triangle","dot","bar"].includes(s)?s:o},i=I(e.routing);return{start:this.endpoint(e.start),end:this.endpoint(e.end),routing:i&&["straight","curved","elbow"].includes(i)?i:"straight",startHead:n(e.startHead,"none"),endHead:n(e.endHead,"arrow")}}image(e,n){if(!S(e))return null;let i=I(e.ref);if(i!==void 0)return n[i]??{data:"",format:"png"};let r=I(e.data);return r===void 0?null:this.picture(r,I(e.format))}picture(e,n){return Ri.test(e)?{data:e.replace(/\s+/g,""),format:n==="jpeg"?"jpeg":"png"}:(this.warn("Skipped a picture whose data isn't base64"),{data:"",format:"png"})}element(e,n){if(!S(e))return null;this.fields(e,"element");let i=Y(e.id),r=I(e.kind),o=Y(e.layerID);if(!i||!r||!o)return this.warn("Skipped an element without an id, kind or layer"),null;ln.includes(r)||this.warn(`Unknown element kind "${r}", drawn as a placeholder`);let s=Array.isArray(e.subpaths)?e.subpaths.filter(S).map(l=>({closed:W(l.closed)??!1,coords:Array.isArray(l.coords)?l.coords.filter(a=>typeof a=="number"):[]})):null;return{id:i,kind:r,layerID:o,x:R(e.x)??0,y:R(e.y)??0,width:R(e.width)??0,height:R(e.height)??0,style:this.style(e.style),seed:(R(e.seed)??1)>>>0,text:I(e.text)??null,connector:this.connector(e.connector),groupID:Y(e.groupID)??null,points:Array.isArray(e.points)?e.points.filter(S).map(l=>({x:R(l.x)??0,y:R(l.y)??0})):null,path:Array.isArray(e.path)?e.path.filter(l=>typeof l=="number"):null,subpaths:s,evenOdd:W(e.evenOdd)??null,rotation:R(e.rotation)??null,link:Y(e.link)??null,url:I(e.url)??null,anchor:I(e.anchor)??null,click:this.click(e.click),hover:this.hover(e.hover),symbol:Y(e.symbol)??null,playback:this.playback(e.playback),offset:R(e.offset)??null,args:sn(e.args),image:this.image(e.image,n),reveal:R(e.reveal)??null,ports:Array.isArray(e.ports)?e.ports.map(l=>{let a=S(l)?l:{};return{x:R(a.x)??0,y:R(a.y)??0}}):null,labelRect:this.labelRect(e.labelRect),extension:this.extension(e.extension)}}labelRect(e){return S(e)?(this.fields(e,"normalizedRect"),{x:R(e.x)??0,y:R(e.y)??0,width:R(e.width)??0,height:R(e.height)??0}):null}extension(e){if(!S(e))return null;this.fields(e,"extensionRef");let n=I(e.id),i=I(e.shape),r=I(e.version);if(n===void 0||i===void 0||r===void 0)return this.warn("Skipped an extension without an id, shape or version"),null;let o={};if(S(e.params))for(let[s,l]of Object.entries(e.params))(typeof l=="number"||typeof l=="boolean"||typeof l=="string")&&(o[s]=l);return{id:n,shape:i,version:r,params:o}}click(e){if(!S(e))return null;this.fields(e,"click");let n=I(e.url),i=n===void 0?null:ht(n);return n!==void 0&&i===null&&this.warn("Skipped a click link that isn't http, https or mailto"),{scene:I(e.scene)??null,url:i}}playback(e){let n=I(e);return n===void 0?null:["loop","once","still","click"].includes(n)?n:"loop"}symbol(e,n){if(!S(e))return null;this.fields(e,"symbol");let i=Y(e.id);if(!i)return this.warn("Skipped a symbol without an id"),null;let r=s=>{let l=R(s);return Math.max(1,l??100)},o=(Array.isArray(e.layers)?e.layers:[]).filter(S).flatMap(s=>{let l=Y(s.id);return l?[{id:l,name:I(s.name)??"",visible:W(s.visible)??!0,locked:W(s.locked)??!1}]:[]});return o.length===0&&o.push({id:`${i}-LAYER`,name:"Layer 1",visible:!0,locked:!1}),{id:i,name:I(e.name)??"Symbol",width:r(e.width),height:r(e.height),layers:o,elements:(Array.isArray(e.elements)?e.elements:[]).map(s=>this.element(s,n)).filter(s=>s!==null),timeline:this.timeline(e.timeline),button:W(e.button)??null,params:sn(e.params)}}hover(e){return S(e)?(this.fields(e,"hover"),{stroke:gt(e.stroke)??null,fill:gt(e.fill)??null,opacity:R(e.opacity)??null}):null}ease(e){let n=I(e);return n===void 0?null:Mi.includes(n)?n:(this.warn(`Unknown ease "${n}", played linear`),null)}keyframe(e){if(!S(e))return null;this.fields(e,"keyframe");let n=R(e.t);if(n===void 0)return null;let i={t:n};for(let a of["x","y","width","height","rotation","strokeWidth","reveal","opacity"]){let c=R(e[a]);c!==void 0&&(i[a]=c)}let r=gt(e.stroke),o=gt(e.fill),s=W(e.visible),l=this.ease(e.ease);return r&&(i.stroke=r),o&&(i.fill=o),s!==void 0&&(i.visible=s),l&&(i.ease=l),i}track(e){if(!S(e))return null;this.fields(e,"track");let n=Y(e.element);if(!n)return null;let i=(Array.isArray(e.keys)?e.keys:[]).map(s=>this.keyframe(s)).filter(s=>s!==null&&s.t>=0&&s.t<=bt);qt(i,s=>s.t);let r=Array.isArray(e.follow)?e.follow.filter(S).flatMap(s=>{let l=Y(s.path),a=R(s.start),c=R(s.end);return!l||a===void 0||c===void 0||a<0||c>bt?[]:[{path:l,start:a,end:c,ease:this.ease(s.ease),reverse:W(s.reverse)??null,orient:W(s.orient)??null,laps:R(s.laps)??null}]}):null,o=Array.isArray(e.repeats)?e.repeats.filter(S).flatMap(s=>{let l=R(s.start),a=R(s.end);if(l===void 0||a===void 0)return[];let c=R(s.count),u={start:l,end:a,count:c===void 0?null:Math.trunc(c)};return Ut(u)?[u]:[]}):null;return{element:n,keys:i,boil:W(e.boil)??null,follow:r,repeats:o,march:un(R(e.march))}}timeline(e){if(!S(e))return null;this.fields(e,"timeline");let n=R(e.boil),i=Array.isArray(e.camera)?e.camera.filter(S).flatMap(s=>{let l=R(s.t),a=R(s.x),c=R(s.y),u=R(s.width),h=R(s.height);return l===void 0||a===void 0||c===void 0||u===void 0||h===void 0?[]:u>1&&h>1&&l>=0?[{t:l,x:a,y:c,width:u,height:h,ease:this.ease(s.ease)}]:[]}):null;i&&qt(i,s=>s.t);let r=Array.isArray(e.markers)?e.markers.filter(S).flatMap(s=>{let l=R(s.t);return l!==void 0&&l>=0?[{t:l,name:I(s.name)??""}]:[]}):null;r&&qt(r,s=>s.t);let o=R(e.poster);return{fps:kt(R(e.fps)??12),duration:C(R(e.duration)??0),boil:n!==void 0&&Number.isInteger(n)&&n>0?Math.min(n,1e4):null,settle:W(e.settle)??null,poster:o===void 0?null:C(o),tracks:(Array.isArray(e.tracks)?e.tracks:[]).map(s=>this.track(s)).filter(s=>s!==null),camera:i,markers:r}}page(e,n,i){if(!S(e))throw new Z(`Page ${i} is not an object`);this.fields(e,"page");let r=(Array.isArray(e.layers)?e.layers:[]).filter(S).flatMap(o=>{let s=Y(o.id);return s?[{id:s,name:I(o.name)??"",visible:W(o.visible)??!0,locked:W(o.locked)??!1}]:[]});return r.length===0&&(this.warn(`Page ${i} has no layers`),r.push({id:"LAYER",name:"Layer 1",visible:!0,locked:!1})),{id:Y(e.id)??`PAGE-${i}`,name:I(e.name)??`Page ${i}`,layers:r,elements:(Array.isArray(e.elements)?e.elements:[]).map(o=>this.element(o,n)).filter(o=>o!==null),theme:I(e.theme)??null,timeline:this.timeline(e.timeline),symbols:Array.isArray(e.symbols)?e.symbols.map(o=>this.symbol(o,n)).filter(o=>o!==null):null}}},Ri=/^[A-Za-z0-9+/=\s]*$/;function Ut(t){return Number.isFinite(t.start)&&Number.isFinite(t.end)&&t.start>=0&&t.end-t.start>.001&&t.end<=bt&&(t.count===null||t.count>=1&&t.count<=1e4)}function qt(t,e){let n=t.map((i,r)=>[i,r]);n.sort((i,r)=>e(i[0])-e(r[0])||i[1]-r[1]);for(let i=0;i<t.length;i++)t[i]=n[i][0]}function Lt(t){let e=t;if(typeof t=="string")try{e=JSON.parse(t)}catch(s){throw new Z(`Not JSON: ${s.message}`)}if(!S(e))throw new Z("Not a Dottie drawing");let n=R(e.version);if(n===void 0)throw new Z("Not a Dottie drawing (no version)");if(!Array.isArray(e.pages)||e.pages.length===0)throw new Z("A drawing needs at least one page");let i=new ke;i.fields(e,"file"),n>2&&i.warn(`File version ${n} is newer than this player knows (2); some things may not show`);let r={};if(S(e.images))for(let[s,l]of Object.entries(e.images))S(l)&&typeof l.data=="string"&&(r[s]=i.picture(l.data,I(l.format)));let o=e.pages.map((s,l)=>i.page(s,r,l+1));if(new Set(o.map(s=>s.id)).size!==o.length)throw new Z("Two pages share an id");return{version:n,pages:o,warnings:i.warnings}}function wt(t){return .2126*t.r+.7152*t.g+.0722*t.b}function xt(t,e){return t.r===e.r&&t.g===e.g&&t.b===e.b&&t.a===e.a}function Pe(t){return xt(t,ct)||xt(t,hn)}function z(t){return{...t,style:{...t.style,stroke:{...t.style.stroke},fill:{...t.style.fill}},connector:t.connector?{...t.connector,start:{...t.connector.start},end:{...t.connector.end}}:null}}function dt(t){if(t.layers.length<=1)return t.elements;let e=new Map;t.layers.forEach((i,r)=>{e.has(i.id)||e.set(i.id,r)});let n=t.layers.map(()=>[]);for(let i of t.elements)n[e.get(i.layerID)??0].push(i);return n.flat()}function vi(t){let e=new Map;for(let n of t.elements)e.has(n.id)||e.set(n.id,n);return e}var dn=.5522847498307936,T=class t{constructor(){M(this,"segments",[])}get isEmpty(){return this.segments.length===0}moveTo(e){return this.segments.push({op:"M",p:e}),this}lineTo(e){return this.segments.push({op:"L",p:e}),this}quadTo(e,n){return this.segments.push({op:"Q",c:n,p:e}),this}curveTo(e,n,i){return this.segments.push({op:"C",c1:n,c2:i,p:e}),this}close(){return this.segments.push({op:"Z"}),this}addPath(e){return this.segments.push(...e.segments),this}addLines(e){return e.forEach((n,i)=>i===0?this.moveTo(n):this.lineTo(n)),this}static rect(e){return new t().addLines([{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}]).close()}addEllipse(e){let n=e.x+e.width/2,i=e.y+e.height/2,r=e.width/2,o=e.height/2,s=r*dn,l=o*dn;return this.moveTo({x:n+r,y:i}),this.curveTo({x:n,y:i+o},{x:n+r,y:i+l},{x:n+s,y:i+o}),this.curveTo({x:n-r,y:i},{x:n-s,y:i+o},{x:n-r,y:i+l}),this.curveTo({x:n,y:i-o},{x:n-r,y:i-l},{x:n-s,y:i-o}),this.curveTo({x:n+r,y:i},{x:n+s,y:i-o},{x:n+r,y:i-l}),this.close()}static ellipse(e){return new t().addEllipse(e)}translated(e,n){let i=o=>({x:o.x+e,y:o.y+n}),r=new t;return r.segments=this.segments.map(o=>{switch(o.op){case"M":case"L":return{op:o.op,p:i(o.p)};case"Q":return{op:"Q",c:i(o.c),p:i(o.p)};case"C":return{op:"C",c1:i(o.c1),c2:i(o.c2),p:i(o.p)};case"Z":return o}}),r}contours(){let e=[],n=[],i={x:0,y:0};for(let r of this.segments){let o=n.length?n[n.length-1]:i;switch(r.op){case"M":n.length>1&&e.push(n),i=r.p,n=[r.p];break;case"L":n.push(r.p);break;case"Q":for(let s=1;s<=12;s++){let l=s/12,a=1-l;n.push({x:a*a*o.x+2*a*l*r.c.x+l*l*r.p.x,y:a*a*o.y+2*a*l*r.c.y+l*l*r.p.y})}break;case"C":for(let s=1;s<=16;s++){let l=s/16,a=1-l;n.push({x:a*a*a*o.x+3*a*a*l*r.c1.x+3*a*l*l*r.c2.x+l*l*l*r.p.x,y:a*a*a*o.y+3*a*a*l*r.c1.y+3*a*l*l*r.c2.y+l*l*l*r.p.y})}break;case"Z":n.push(i),n.length>1&&e.push(n),n=[i];break}}return n.length>1&&e.push(n),e}trimmed(e){let n=this.contours().map(o=>new Pt(o)),i=Math.min(Math.max(e,0),1)*n.reduce((o,s)=>o+s.length,0),r=new t;for(let o of n){if(!(i>0))break;r.moveTo(o.points[0]);for(let s=1;s<o.points.length;s++){let l=o.lengths[s]-o.lengths[s-1];if(l<=i){r.lineTo(o.points[s]),i-=l;continue}let a=o.points[s-1],c=o.points[s],u=i/l;r.lineTo({x:a.x+(c.x-a.x)*u,y:a.y+(c.y-a.y)*u}),i=0;break}}return r}data(){let e=[];for(let n of this.segments)switch(n.op){case"M":e.push(`M${k(n.p.x)} ${k(n.p.y)}`);break;case"L":e.push(`L${k(n.p.x)} ${k(n.p.y)}`);break;case"Q":e.push(`Q${k(n.c.x)} ${k(n.c.y)} ${k(n.p.x)} ${k(n.p.y)}`);break;case"C":e.push(`C${k(n.c1.x)} ${k(n.c1.y)} ${k(n.c2.x)} ${k(n.c2.y)} ${k(n.p.x)} ${k(n.p.y)}`);break;case"Z":e.push("Z");break}return e.join(" ")}};function Dt(t){return t<0?-Math.round(-t):Math.round(t)}function k(t){let e=Dt(t*100)/100;return Number.isInteger(e)?String(e===0?0:e):String(e)}var Pt=class{constructor(e){M(this,"points");M(this,"lengths");this.points=e;let n=0;this.lengths=e.map((i,r)=>(r>0&&(n+=Math.hypot(i.x-e[r-1].x,i.y-e[r-1].y)),n))}get length(){return this.lengths.length?this.lengths[this.lengths.length-1]:0}point(e){if(this.points.length<=1||!(this.length>0))return this.points[0]??{x:0,y:0};let n=Math.min(Math.max(e,0),1)*this.length,i=1;for(;i<this.lengths.length-1&&this.lengths[i]<n;)i++;let r=this.lengths[i]-this.lengths[i-1],o=r>0?(n-this.lengths[i-1])/r:0,s=this.points[i-1],l=this.points[i];return{x:s.x+(l.x-s.x)*o,y:s.y+(l.y-s.y)*o}}},F=t=>t.x+t.width/2,H=t=>t.y+t.height/2,G=t=>t.x+t.width,N=t=>t.y+t.height;function Me(t,e){if(!t)return{...e};let n=Math.min(t.x,e.x),i=Math.min(t.y,e.y);return{x:n,y:i,width:Math.max(G(t),G(e))-n,height:Math.max(N(t),N(e))-i}}function Mt(t,e,n){return{x:t.x+e,y:t.y+n,width:t.width-2*e,height:t.height-2*n}}function it(t,e,n){if(n===0)return t;let i=t.x-e.x,r=t.y-e.y;return{x:e.x+i*Math.cos(n)-r*Math.sin(n),y:e.y+i*Math.sin(n)+r*Math.cos(n)}}function Re(t,e){let n=1-e;return{x:t[0].x*(n*n*n)+t[1].x*(3*e*n*n)+t[2].x*(3*e*e*n)+t[3].x*(e*e*e),y:t[0].y*(n*n*n)+t[1].y*(3*e*n*n)+t[2].y*(3*e*e*n)+t[3].y*(e*e*e)}}function mn(t,e){let n=[t[0]];for(let i=0;i<Math.floor((t.length-1)/3);i++){let r=t.slice(3*i,3*i+4),o=0;for(let l=1;l<r.length;l++)o+=Math.hypot(r[l].x-r[l-1].x,r[l].y-r[l-1].y);let s=Math.min(400,Math.max(4,Math.ceil(o/Math.max(e,.5))));for(let l=1;l<=s;l++)n.push(Re(r,l/s))}return n}var L=t=>({x:t.x,y:t.y,width:t.width,height:t.height}),V=t=>t.rotation??0,Ot=t=>({x:t.x+t.width/2,y:t.y+t.height/2}),q=(t,e)=>it(e,Ot(t),V(t)),fn=(t,e)=>it(e,Ot(t),-V(t));function pn(t){let e=L(t);if(V(t)===0)return e;let n=[{x:e.x,y:e.y},{x:G(e),y:e.y},{x:G(e),y:N(e)},{x:e.x,y:N(e)}].map(l=>q(t,l)),i=n.map(l=>l.x),r=n.map(l=>l.y),o=Math.min(...i),s=Math.min(...r);return{x:o,y:s,width:Math.max(...i)-o,height:Math.max(...r)-s}}function yn(t,e){if(!Pe(t.style.stroke))return t;let n=z(t),r=(t.style.fillStyle==="solid"||t.style.fillStyle==="grid")&&t.style.fill.a>=.5&&wt(t.style.fill)>.5;return n.style.stroke=wt(e)>.5&&r?{...ct}:{...e},n}function Rt(t){if(t.kind!=="path"||!t.subpaths)return[];let e=[];for(let n of t.subpaths){if(n.coords.length<8||(n.coords.length-2)%6!==0)continue;let i=[];for(let r=0;r<n.coords.length;r+=2)i.push({x:t.x+n.coords[r]*t.width,y:t.y+n.coords[r+1]*t.height});e.push({closed:n.closed,points:i})}return e}function ve(t){let e=new T;for(let n of Rt(t)){e.moveTo(n.points[0]);for(let i=0;i<(n.points.length-1)/3;i++)e.curveTo(n.points[3*i+3],n.points[3*i+1],n.points[3*i+2]);n.closed&&e.close()}return e}function Ai(t,e){let n=L(t),i=e==="top"?{x:F(n),y:n.y}:e==="right"?{x:G(n),y:H(n)}:e==="bottom"?{x:F(n),y:N(n)}:{x:n.x,y:H(n)};return q(t,i)}function Ei(t){let e=[];for(let n=0;n+3<t.length;n+=3){let i=t.slice(n,n+4);for(let r=0;r<16;r++)e.push(Re(i,r/16))}return e.push(t[t.length-1]),e}function Ti(t,e,n){let i=null,r=null;for(let s of Rt(t)){let l=Ei(s.points),a=l.length,c=s.closed?a:a-1;for(let u=0;u<c;u++){let h=l[u],f=l[(u+1)%a],d={x:f.x-h.x,y:f.y-h.y},m={x:h.x-e.x,y:h.y-e.y},p=d.x*n.y-n.x*d.y;if(p===0)continue;let y=(d.x*m.y-d.y*m.x)/p,P=(n.x*m.y-n.y*m.x)/p;y>0&&P>=0&&P<=1&&((i===null||y<i)&&(i=y),y<=1&&(r===null||y>r)&&(r=y))}}let o=r??i;return o===null?null:{x:e.x+n.x*o,y:e.y+n.y*o}}function Si(t,e){let n=L(t),i=Ot(t),r=fn(t,e),o=r.x-i.x,s=r.y-i.y;if(!((o!==0||s!==0)&&n.width>0&&n.height>0))return i;if(t.kind==="path"){let u=Ti(t,i,{x:o,y:s});if(u)return q(t,u)}let l=n.width/2,a=n.height/2,c;return t.kind==="ellipse"?c=1/Math.sqrt(o*o/(l*l)+s*s/(a*a)):t.kind==="diamond"?c=1/(Math.abs(o)/l+Math.abs(s)/a):c=Math.min(o!==0?l/Math.abs(o):1/0,s!==0?a/Math.abs(s):1/0),q(t,{x:i.x+o*c,y:i.y+s*c})}function gn(t,e){let n=t.elementID?e.get(t.elementID):void 0;return n?Ot(n):{x:t.x,y:t.y}}function Ii(t,e){let n=L(t);return q(t,{x:n.x+e.x*n.width,y:n.y+e.y*n.height})}function bn(t,e,n){let i=t.elementID?n.get(t.elementID):void 0;if(!i)return{x:t.x,y:t.y};let r=t.portIndex,o=i.ports??[];return typeof r=="number"&&Number.isInteger(r)&&r>=0&&r<o.length?Ii(i,o[r]):t.port?Ai(i,t.port):Si(i,e)}function J(t,e){let n=t.connector;return n?[bn(n.start,gn(n.end,e),e),bn(n.end,gn(n.start,e),e)]:[{x:0,y:0},{x:0,y:0}]}function rt(t){if(t.kind==="polyline")return t.points;let e=[];for(let n=0;n<=24;n++){let i=n/24,r=1-i;e.push({x:r*r*r*t.a.x+3*r*r*i*t.b.x+3*r*i*i*t.c.x+i*i*i*t.d.x,y:r*r*r*t.a.y+3*r*r*i*t.b.y+3*r*i*i*t.c.y+i*i*i*t.d.y})}return e}function ot(t,e){let n=t.connector;if(!n)return{kind:"polyline",points:[]};let[i,r]=J(t,e),o=r.x-i.x,s=r.y-i.y,l=Math.abs(o)>=Math.abs(s);switch(n.routing){case"straight":return{kind:"polyline",points:[i,r]};case"curved":return l?{kind:"cubic",a:i,b:{x:i.x+o/2,y:i.y},c:{x:r.x-o/2,y:r.y},d:r}:{kind:"cubic",a:i,b:{x:i.x,y:i.y+s/2},c:{x:r.x,y:r.y-s/2},d:r};case"elbow":{let a=h=>h===null?null:h==="top"||h==="bottom",c=a(n.start.port)??!l,u=a(n.end.port)??!l;if(c&&u){let h=i.y+s/2;return{kind:"polyline",points:[i,{x:i.x,y:h},{x:r.x,y:h},r]}}if(!c&&!u){let h=i.x+o/2;return{kind:"polyline",points:[i,{x:h,y:i.y},{x:h,y:r.y},r]}}return c?{kind:"polyline",points:[i,{x:i.x,y:r.y},r]}:{kind:"polyline",points:[i,{x:r.x,y:i.y},r]}}}}function xn(t,e,n){let i=Math.atan2(t.y-e.y,t.x-e.x),r=Math.PI/7,o=s=>({x:t.x-n*Math.cos(i+s),y:t.y-n*Math.sin(i+s)});return[o(r),o(-r)]}function kn(t,e){let n=rt(ot(t,e));if(n.length===0)return{x:0,y:0,width:0,height:0};let i=n[0].x,r=n[0].y,o=i,s=r;for(let l of n)i=Math.min(i,l.x),r=Math.min(r,l.y),o=Math.max(o,l.x),s=Math.max(s,l.y);return{x:i,y:r,width:o-i,height:s-r}}function wn(t,e){let n=rt(ot(t,e));if(n.length<=1)return n[0]??{x:0,y:0};let i=[],r=0;for(let s=0;s<n.length-1;s++){let l=Math.hypot(n[s+1].x-n[s].x,n[s+1].y-n[s].y);i.push(l),r+=l}let o=r/2;for(let s=0;s<i.length;s++){let l=i[s];if(o<=l||s===i.length-1){let a=l===0?0:o/l;return{x:n[s].x+(n[s+1].x-n[s].x)*a,y:n[s].y+(n[s+1].y-n[s].y)*a}}o-=l}return n[0]}function U(t){let e=new Map;for(let n of t.elements)e.has(n.id)||e.set(n.id,n);return e}function Ee(t,e,n){let i=t[1]+n>>>0,r=i<t[1]?1:0;return[t[0]+e+r>>>0,i]}function $i(t,e){let n=t&65535,i=t>>>16,r=e&65535,o=e>>>16,s=n*r,l=n*o,a=i*r,c=i*o,u=l+a,h=s+u%65536*65536;return[c+Math.floor(u/65536)+Math.floor(h/4294967296)>>>0,h>>>0]}function Te(t,e,n){let i=$i(t[1],n);return[i[0]+Math.imul(t[0],n)+Math.imul(t[1],e)>>>0,i[1]]}function Ae(t,e){let n=(t[1]>>>e|t[0]<<32-e)>>>0;return[(t[0]^t[0]>>>e)>>>0,(t[1]^n)>>>0]}function Pn(t){return t=Te(Ae(t,30),3210233709,484763065),t=Te(Ae(t,27),2496678331,321982955),Ae(t,31)}var st=class{constructor(e){M(this,"state");this.state=Ee([0,e>>>0],2654435769,2135587861)}next(){return this.state=Ee(this.state,2654435769,2135587861),Pn(this.state)}top53(){let[e,n]=this.next();return e*2097152+(n>>>11)}signed(){return Math.floor(this.top53())/2**52-1}unit(){return this.top53()/2**53}};function Kt(t,e){let n=Ee([0,t>>>0],...Li(e));return n=Pn(n),Math.max(1,n[1]>>>0)}function Li(t){let e=Te([0,t>>>0],2654435769,2135587861);return[e[0],e[1]]}var Mn=(t,e,n)=>t.signed()*e*n;function tt(t,e,n,i,r,o,s){let l=Math.hypot(e.x-t.x,e.y-t.y);if(!(l>.5))return;let a=l<200?1:l>500?.4:-.0016668*l+1.233334,c=l<20?l/10:2;for(let u=0;u<2;u++){let h=(u===0?1:.5)*a,f=()=>Mn(n,c,i)*h,d=n.unit()*.4+.3,m=Mn(n,l/60,i)*r*a,p=e.x-t.x,y=e.y-t.y,P=-y/l,x=p/l,g=o?t:{x:t.x+f(),y:t.y+f()},A=o?e:{x:e.x+f(),y:e.y+f()},v=t.x+p*d*.66+P*m+f()*.5,w=t.y+y*d*.66+x*m+f()*.5,b=t.x+p*(.5+d*.5)+P*m+f()*.5,E=t.y+y*(.5+d*.5)+x*m+f()*.5;s.moveTo(g),s.curveTo(A,{x:v,y:w},{x:b,y:E})}}function Se(t,e,n,i){let r=new T;for(let o=0;o<t.length;o++)tt(t[o],t[(o+1)%t.length],e,n,i,!1,r);return r}function Rn(t,e,n){let i=new T,r=t.x+t.width/2,o=t.y+t.height/2,s=t.width/2,l=t.height/2;if(!(s>.5&&l>.5))return i;let a=Math.max(8,Math.min(24,Math.trunc((s+l)/6))),c=Math.min(2.5,(s+l)/25)*n;for(let u=0;u<2;u++){let h=e.unit()*2*Math.PI,f=2*Math.PI*(u===0?1:1.04),d=Math.trunc(a*f/(2*Math.PI))+1,m=[];for(let p=0;p<d;p++){let y=h+f*p/a,P=e.signed()*c,x=e.signed()*c;m.push({x:r+s*Math.cos(y)+P,y:o+l*Math.sin(y)+x})}Di(m,i)}return i}function Di(t,e){if(!(t.length<=2)){e.moveTo(t[0]);for(let n=0;n<t.length-1;n++){let i=t[Math.max(n-1,0)],r=t[n],o=t[n+1],s=t[Math.min(n+2,t.length-1)];e.curveTo(o,{x:r.x+(o.x-i.x)/6,y:r.y+(o.y-i.y)/6},{x:o.x-(s.x-r.x)/6,y:o.y-(s.y-r.y)/6})}}}var Ie=-41*Math.PI/180;function vn(t,e,n){if(!(n>0))return[];let i=Math.cos(e),r=Math.sin(e),o=t.filter(f=>f.length>=3).map(f=>f.map(d=>({x:d.x*i+d.y*r,y:-d.x*r+d.y*i}))),s=o.flat();if(s.length===0)return[];let l=1/0,a=-1/0;for(let f of s)l=Math.min(l,f.y),a=Math.max(a,f.y);let c=(f,d)=>({x:f*i-d*r,y:f*r+d*i}),u=[],h=l+n/2;for(;h<a;){let f=[];for(let d of o)for(let m=0;m<d.length;m++){let p=d[m],y=d[(m+1)%d.length];(p.y<=h&&h<y.y||y.y<=h&&h<p.y)&&f.push(p.x+(h-p.y)/(y.y-p.y)*(y.x-p.x))}f.sort((d,m)=>d-m);for(let d=0;d+1<f.length;d+=2)f[d+1]-f[d]>.5&&u.push([c(f[d],h),c(f[d+1],h)]);h+=n}return u}var Sn=2,$e=.75,Oi=.8,En=.6;function In(t,e){return[...Tn(t,e,!1),...Tn(t,e,!0)]}function Tn(t,e,n){if(!(e>0))return[];let i=c=>n?{x:c.y,y:c.x}:c,r=t.filter(c=>c.length>=3).map(c=>c.map(i)),o=r.flat().map(c=>c.y);if(o.length===0)return[];let s=Math.min(...o),l=Math.max(...o),a=[];for(let c=Math.floor(s/e)*e;c<l-.5;c+=e){if(!(c>s+.5))continue;let u=[];for(let h of r)for(let f=0;f<h.length;f++){let d=h[f],m=h[(f+1)%h.length];(d.y<=c&&c<m.y||m.y<=c&&c<d.y)&&u.push(d.x+(c-d.y)/(m.y-d.y)*(m.x-d.x))}u.sort((h,f)=>h-f);for(let h=0;h+1<u.length;h+=2)u[h+1]-u[h]>.5&&a.push([i({x:u[h],y:c}),i({x:u[h+1],y:c})])}return a}function $n(t){return .2126*t.r+.7152*t.g+.0722*t.b>.5?{r:t.r*.84,g:t.g*.84,b:t.b*.8,a:t.a}:{r:t.r+(1-t.r)*.25,g:t.g+(1-t.g)*.25,b:t.b+(1-t.b)*.25,a:t.a}}function Le(t){return t.style.fillStyle==="grid"&&t.style.fill.a>0&&["rectangle","ellipse","diamond","path"].includes(t.kind)}function Qt(t,e,n){let i=(Math.imul(t,668265261)^Math.imul(e,374761393)^Math.imul(n,2654435761))>>>0;return i=Math.imul(i^i>>>15,2246822507)>>>0,i=Math.imul(i^i>>>13,3266489909)>>>0,i=(i^i>>>16)>>>0,i/4294967296}function Ln(t,e,n){let i=n/Sn;return{x:(t+.5+(Qt(t,e,1)-.5)*En)*i,y:(e+.5+(Qt(t,e,2)-.5)*En)*i}}function Ci(t,e,n,i){let r=1/0;for(let o=-1;o<=1;o++)for(let s=-1;s<=1;s++){if(o===0&&s===0)continue;let l=Ln(t+o,e+s,i);r=Math.min(r,Math.hypot(l.x-n.x,l.y-n.y))}return r*Oi}function zi(t,e,n){let i=Math.cos(e),r=Math.sin(e),o=n*.8,s=n*.5;return[-1,0,1].map(l=>{let a=t.x-r*s*l,c=t.y+i*s*l;return[{x:a-i*o,y:c-r*o},{x:a+i*o,y:c+r*o}]})}function Vi(t,e){let n=!1;for(let i of t){if(i.length<3)continue;let r=i.length-1;for(let o=0;o<i.length;o++){let s=i[o],l=i[r];s.y>e.y!=l.y>e.y&&e.x<(l.x-s.x)*(e.y-s.y)/(l.y-s.y)+s.x&&(n=!n),r=o}}return n}function Wi(t,e){let n=1/0;for(let i of e)if(!(i.length<2))for(let r=0;r<i.length;r++){let o=i[r],s=i[(r+1)%i.length],l=s.x-o.x,a=s.y-o.y,c=l*l+a*a,u=c>0?Math.max(0,Math.min(1,((t.x-o.x)*l+(t.y-o.y)*a)/c)):0;n=Math.min(n,Math.hypot(t.x-(o.x+u*l),t.y-(o.y+u*a)))}return n}var Yi=(t,e)=>e.x>=t.x&&e.x<t.x+t.width&&e.y>=t.y&&e.y<t.y+t.height,Xt=new Map;function Dn(t){if(t.length===0)return[];let e=t.map(r=>[r.kind,r.x,r.y,r.width,r.height,r.rotation??0,mt(r),JSON.stringify(r.subpaths??null),r.style.stroke.r,r.style.stroke.g,r.style.stroke.b,r.style.stroke.a,r.style.roughness,r.style.strokeWidth].join(",")).join(";"),n=Xt.get(e);if(n)return n;let i=Bi(t);return Xt.size>=16&&Xt.clear(),Xt.set(e,i),i}function Bi(t){let e=t.map(o=>{let s=De(o).map(d=>d.map(m=>q(o,m))),l=s.flat(),a=l.map(d=>d.x),c=l.map(d=>d.y),u=a.length?Math.min(...a):0,h=c.length?Math.min(...c):0,f={x:u,y:h,width:(a.length?Math.max(...a):0)-u,height:(c.length?Math.max(...c):0)-h};return{contours:s,box:f,cell:mt(o),element:o}}),n=e.map(()=>[]),i=new Set;for(let o of e){let s=o.cell/Sn,l=Mt(o.box,-o.cell,-o.cell),a=Math.floor(l.x/s),c=Math.ceil((l.x+l.width)/s),u=Math.floor(l.y/s),h=Math.ceil((l.y+l.height)/s),f=$e*o.cell;for(let d=a;d<c;d++)for(let m=u;m<h;m++){let p=`${o.cell}|${d}|${m}`;if(i.has(p))continue;i.add(p);let y=Ln(d,m,o.cell),P=1/0,x=-1;for(let w=0;w<e.length;w++){let b=e[w];if(!Yi(Mt(b.box,-f,-f),y))continue;if(Vi(b.contours,y)){P=0;break}let E=Wi(y,b.contours);E<P&&(P=E,x=w)}if(!(P>0&&P<=f&&x>=0))continue;let g=Qt(d,m,3)*Math.PI,A=Ci(d,m,y,o.cell),v=Math.trunc(Qt(d,m,4)*4294967296)>>>0;for(let[w,b]of zi(y,g,A))n[x].push([w,b,v])}}let r=[];return e.forEach((o,s)=>{if(n[s].length===0)return;let l=o.element,a=new T;for(let[c,u,h]of n[s])l.style.roughness<=0?a.moveTo(c).lineTo(u):tt(c,u,new st(h),l.style.roughness*.35,.2,!1,a);r.push({ink:{...l.style.stroke,a:l.style.stroke.a*.6},width:Math.max(.8,l.style.strokeWidth*.45),path:a})}),r}var Zt=class{constructor(e=6e3){M(this,"map",new Map);M(this,"limit");this.limit=e}get(e,n){let i=this.map.get(e);if(i!==void 0)return i;let r=n();return this.map.size>=this.limit&&this.map.clear(),this.map.set(e,r),r}},Cn=new Zt,Gi=new Zt;function zn(t,e){let n=t.style;return[e,t.kind,t.x,t.y,t.width,t.height,t.seed,n.roughness,n.bowing,n.strokeWidth,n.fillStyle,n.fillStyle==="grid"?mt(t):0,t.path?t.path.join(","):t.subpaths?JSON.stringify(t.subpaths):""].join("|")}var mt=t=>Math.max(8,t.style.gridSize??50);function ft(t){return t.kind==="freehand"&&t.path===null?On(t):Cn.get(zn(t,0),()=>On(t))}function Vn(t){return[{x:t.x,y:t.y},{x:G(t),y:t.y},{x:G(t),y:N(t)},{x:t.x,y:N(t)}]}function Jt(t){return[{x:F(t),y:t.y},{x:G(t),y:H(t)},{x:F(t),y:N(t)},{x:t.x,y:H(t)}]}function On(t){let e=L(t),n=new st(t.seed),i=t.style.roughness;switch(t.kind){case"ellipse":return i<=0?T.ellipse(e):Rn(e,n,i);case"diamond":return i<=0?new T().addLines(Jt(e)).close():Se(Jt(e),n,i,t.style.bowing);case"text":case"connector":return T.rect(e);case"freehand":return Fi(t);case"path":return i<=0?ve(t):Ni(t,n);default:return i<=0?T.rect(e):Se(Vn(e),n,i,t.style.bowing)}}function Ni(t,e){let n=t.style.roughness,i=new T;for(let r of Rt(t)){let o=r.points;for(let s=0;s<(o.length-1)/3;s++){let l=o[3*s],a=o[3*s+1],c=o[3*s+2],u=o[3*s+3];if(a.x===l.x&&a.y===l.y&&c.x===u.x&&c.y===u.y){tt(l,u,e,n,t.style.bowing,!0,i);continue}let h=Math.hypot(a.x-l.x,a.y-l.y)+Math.hypot(c.x-a.x,c.y-a.y)+Math.hypot(u.x-c.x,u.y-c.y),f=Math.min(2.5,h/30)*n;for(let d=0;d<2;d++){let m=d===0?1:.5,p=()=>e.signed()*f*m;i.moveTo(l);let y=a.x+p(),P=a.y+p(),x=c.x+p(),g=c.y+p();i.curveTo(u,{x:y,y:P},{x,y:g})}}}return i}function Fi(t){let e=L(t),n=t.path;if(n&&n.length>=8&&(n.length-2)%6===0){let o=l=>({x:e.x+n[2*l]*e.width,y:e.y+n[2*l+1]*e.height}),s=new T().moveTo(o(0));for(let l=0;l<Math.floor((n.length/2-1)/3);l++)s.curveTo(o(3*l+3),o(3*l+1),o(3*l+2));return s}let i=(t.points??[]).map(o=>({x:e.x+o.x*e.width,y:e.y+o.y*e.height})),r=new T;if(i.length===0)return r;if(r.moveTo(i[0]),i.length===1)return r.lineTo(i[0]);if(i.length===2)return r.lineTo(i[1]);for(let o=1;o<i.length-1;o++)r.quadTo({x:(i[o].x+i[o+1].x)/2,y:(i[o].y+i[o+1].y)/2},i[o]);return r.lineTo(i[i.length-1])}function De(t){return t.kind!=="path"?[Hi(t)]:Rt(t).map(e=>mn(e.points,3))}function Hi(t){let e=L(t);if(t.kind==="ellipse"){let n=[];for(let i=0;i<48;i++){let r=2*Math.PI*i/48;n.push({x:F(e)+e.width/2*Math.cos(r),y:H(e)+e.height/2*Math.sin(r)})}return n}return t.kind==="diamond"?Jt(e):Vn(e)}function te(t){let e=L(t);return t.kind==="ellipse"?T.ellipse(e):t.kind==="path"?ve(t):t.kind==="diamond"?new T().addLines(Jt(e)).close():T.rect(e)}function Oe(t){return t.style.fillStyle==="solid"||["freehand","connector","text","image"].includes(t.kind)?new T:Cn.get(zn(t,1),()=>ji(t))}function ji(t){let e=De(t),n=new st((t.seed^1540483477)>>>0),i=new T;if(t.style.fillStyle==="grid"){for(let[s,l]of In(e,mt(t)))t.style.roughness<=0?i.moveTo(s).lineTo(l):tt(s,l,n,t.style.roughness*.3,.3,!1,i);return i}let r=Math.max(4,t.style.strokeWidth*4),o=[Ie];t.style.fillStyle==="crossHatch"&&o.push(Ie+Math.PI/2);for(let s of o)for(let[l,a]of vn(e,s,r))t.style.roughness<=0?i.moveTo(l).lineTo(a):tt(l,a,n,t.style.roughness*.6,.5,!1,i);return i}function ee(t,e){switch(t){case"solid":return null;case"dashed":return[Math.max(8,e*4),Math.max(6,e*3)];case"dotted":return[.01,Math.max(5,e*2.6)]}}function Ce(t,e){let n=t.connector;if(!n)return[new T,new T];let[i,r]=J(t,e),o=[t.seed,t.style.roughness,t.style.bowing,t.style.strokeWidth,n.routing,n.startHead,n.endHead,n.start.port,n.end.port,i.x,i.y,r.x,r.y].join("|");return Gi.get(o,()=>_i(t,e))}function _i(t,e){let n=t.connector,i=new st(t.seed),r=t.style.roughness,o=t.style.bowing,s=new T,l=new T,a=ot(t,e);if(a.kind==="polyline"){let d=a.points;for(let m=0;m<Math.max(d.length-1,0);m++)r<=0?s.moveTo(d[m]).lineTo(d[m+1]):tt(d[m],d[m+1],i,r,o,!0,s)}else{s.moveTo(a.a);let d=r*3,m=()=>i.signed()*d,p=a.b.x+m(),y=a.b.y+m(),P=a.c.x+m(),x=a.c.y+m();s.curveTo(a.d,{x:p,y},{x:P,y:x})}let c=rt(a),u=Math.max(10,t.style.strokeWidth*5),h=(d,m)=>{r<=0?s.moveTo(d).lineTo(m):tt(d,m,i,r*.5,0,!0,s)},f=(d,m,p)=>{let[y,P]=xn(m,p,u);switch(d){case"arrow":h(y,m),h(P,m);break;case"triangle":h(y,m),h(P,m),h(y,P),l.moveTo(m).lineTo(y).lineTo(P).close();break;case"dot":{let x=u*.32,g=Math.atan2(m.y-p.y,m.x-p.x),A=m.x-x*Math.cos(g),v=m.y-x*Math.sin(g);l.addEllipse({x:A-x,y:v-x,width:2*x,height:2*x});break}case"bar":{let x=Math.atan2(m.y-p.y,m.x-p.x)+Math.PI/2,g=u*.5;h({x:m.x-g*Math.cos(x),y:m.y-g*Math.sin(x)},{x:m.x+g*Math.cos(x),y:m.y+g*Math.sin(x)});break}}};return c.length>1&&(f(n.endHead,c[c.length-1],c[c.length-2]),f(n.startHead,c[0],c[1])),[s,l]}function We(t,e){switch(t){case"linear":return e;case"easeIn":return e*e*e;case"easeOut":return 1-Math.pow(1-e,3);case"easeInOut":return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2;case"hold":return 0;case"spring":return qi(e);case"bounce":return Ui(e);case"elastic":return Ki(e)}}function qi(t){if(t<=0)return 0;if(t>=1)return 1;let e=n=>1-Math.exp(-6*n)*(Math.cos(3*Math.PI*n)+6/(3*Math.PI)*Math.sin(3*Math.PI*n));return e(t)+t*(1-e(1))}function Ui(t){if(t<=0)return 0;if(t>=1)return 1;let e=7.5625,n=2.75;if(t<1/n)return e*t*t;if(t<2/n){let r=t-1.5/n;return e*r*r+.75}if(t<2.5/n){let r=t-2.25/n;return e*r*r+.9375}let i=t-2.625/n;return e*i*i+.984375}function Ki(t){return t<=0?0:t>=1?1:Math.pow(2,-10*t)*Math.sin((t*10-.75)*(2*Math.PI/3))+1}var Ct=(t,e)=>t%e;function zt(t,e){let n=(t.repeats??[]).filter(Ut).slice().sort((i,r)=>i.start-r.start);if(n.length===0)return e;for(let i of n){if(!(e>=i.end))continue;let r=i.end-i.start;if(i.count===null)return i.start+Ct(e-i.start,r);let o=r*i.count;if(e<i.start+o)return i.start+Ct(e-i.start,r);e-=o-r}return e}function ze(t,e,n,i,r){e=zt(t,e);let o,s;for(let u of t.keys)if(n(u)!==void 0)if(u.t<=e)o=u;else{s=u;break}if(!o&&!s)return i;if(o&&!s)return n(o);if(!o&&s)return n(s);let l=o,a=s,c=a.t-l.t>0?(e-l.t)/(a.t-l.t):1;return r(n(l),n(a),We(l.ease??"linear",c))}var Xi=(t,e,n)=>t+(e-t)*n,ne=(t,e,n)=>Math.min(Math.max(t+(e-t)*n,0),1),Wn=(t,e,n)=>({r:ne(t.r,e.r,n),g:ne(t.g,e.g,n),b:ne(t.b,e.b,n),a:ne(t.a,e.a,n)});function lt(t,e,n,i){return ze(t,e,r=>r[n],i,Xi)}function Qi(t,e){e=zt(t,e);let n=(r,o)=>{let s;for(let a of t.keys)a.t<=e&&r(a)!==void 0&&(s=a);let l=t.keys.find(a=>a.t>e&&r(a)!==void 0);return!s||!l?!1:s.ease!=="hold"&&!o(r(s),r(l))},i=r=>n(o=>o[r],(o,s)=>o===s);return i("x")||i("y")||i("width")||i("height")||i("rotation")||i("strokeWidth")||n(r=>r.stroke,xt)||n(r=>r.fill,xt)||i("reveal")||i("opacity")}function Ve(t,e){e=zt(t,e);let n=t.keys.filter(r=>r.visible!==void 0);if(n.length===0)return!0;let i;for(let r of n)r.t<=e&&(i=r);return i?i.visible:!n[0].visible}function Zi(t,e,n){if(e=z(e),t.keys.some(i=>i.reveal!==void 0)){let i=lt(t,n,"reveal",e.reveal??1);e.reveal=i>=1?null:Math.max(0,i)}if(t.keys.some(i=>i.opacity!==void 0)){let i=Math.min(Math.max(lt(t,n,"opacity",e.style.opacity??1),0),1);e.style.opacity=i>=1?null:i}return e.kind==="connector"||(e.x=lt(t,n,"x",e.x),e.y=lt(t,n,"y",e.y),e.width=Math.max(0,lt(t,n,"width",e.width)),e.height=Math.max(0,lt(t,n,"height",e.height)),t.keys.some(i=>i.rotation!==void 0)&&(e.rotation=lt(t,n,"rotation",V(e))),e.style.strokeWidth=Math.max(0,lt(t,n,"strokeWidth",e.style.strokeWidth)),e.style.stroke=ze(t,n,i=>i.stroke,e.style.stroke,Wn),e.style.fill=ze(t,n,i=>i.fill,e.style.fill,Wn)),e}function Ji(t,e){e=zt(t,e);let n=null;for(let r of t.follow??[])r.start<=e&&(n===null||r.start>n.start)&&(n=r);if(!n)return null;let i=n;return t.keys.some(r=>r.t>=i.end&&r.t<=e&&(r.x!==void 0||r.y!==void 0))?null:n}function tr(t,e){if(t.kind==="connector")return new Pt(rt(ot(t,U(e))));let n=z(t);n.style.roughness=0;let i=ft(n).contours()[0]??[];return new Pt(V(t)===0?i:i.map(r=>q(t,r)))}function er(t,e,n,i){let r=Ji(t,n);if(!r)return e;n=zt(t,n);let o=i.elements.find(h=>h.id===r.path);if(!o||o.id===e.id)return e;let s=tr(o,i),l=r.end-r.start,a=Math.min(Math.max(We(r.ease??"easeInOut",l>0?Math.min(1,(n-r.start)/l):1),0),1)*(r.laps??1);a>1&&(a=Ct(a,1)===0?1:Ct(a,1)),r.reverse===!0&&(a=1-a);let c=s.point(a),u=z(e);if(u.x=c.x-e.width/2,u.y=c.y-e.height/2,r.orient===!0){let h=r.reverse===!0?-.01:.01,f=s.point(a-h/2),d=s.point(a+h/2);(f.x!==d.x||f.y!==d.y)&&(u.rotation=Math.atan2(d.y-f.y,d.x-f.x))}return u}function nr(t,e,n,i){if(!(n>0))return 0;let r=C(t.duration);if(r>0){let s=Dt(e*r/n);s!==0&&(e=s*n/r)}let o=Ct(e*i,n);return o<0?-o:o===0?0:n-o}function ir(t){let e=new Map;for(let n of t.tracks)e.has(n.element)||e.set(n.element,n);return e}function K(t,e){return j(Vt(t,e),C(e))}function Vt(t,e){let n=t.timeline;if(!n)return t;e=C(e);let i=ir(n),r=n.boil===null?null:Math.trunc(Math.floor(e*kt(n.fps)+1e-9)/Math.max(1,n.boil))%we>>>0,o=new Set;for(let d of i.values())Ve(d,e)||o.add(d.element);let s=null;if(n.settle===!0){s=new Set;for(let d of i.values())Qi(d,e)&&s.add(d.element)}let l=d=>{let m=i.get(d.id)?.boil;return m??(s?d.connector?[d.connector.start.elementID,d.connector.end.elementID].some(p=>p!==null&&s.has(p)):s.has(d.id):!0)},a=t.elements.map(d=>{let m=i.get(d.id),p=m?Zi(m,d,e):d;r!==null&&r>0&&l(d)&&(p===d&&(p=z(d)),p.seed=Kt(d.seed,r));let y=m?.march!=null?ee(p.style.dash,p.style.strokeWidth):null;return m?.march!=null&&y&&(p===d&&(p=z(d)),p.style.dashOffset=nr(n,m.march,y.reduce((P,x)=>P+x,0),e)),p});a=a.map((d,m)=>o.has(d.id)?t.elements[m]:d);let c={...t,elements:a,timeline:null};a=a.map(d=>{let m=i.get(d.id);return m?er(m,d,e,c):d});let u={...t,elements:a,timeline:null},h=U(u),f=new Set(o);return a=a.map(d=>{let m=d.connector;if(!m||![m.start.elementID,m.end.elementID].some(x=>x!==null&&o.has(x)))return d;if(!(i.get(d.id)?.keys.some(x=>x.visible!==void 0)??!1))return f.add(d.id),d;let[p,y]=J(d,h),P=z(d);return P.connector.start={elementID:null,port:m.start.port,x:p.x,y:p.y},P.connector.end={elementID:null,port:m.end.port,x:y.x,y:y.y},P}),{...t,elements:a.filter(d=>!f.has(d.id)),timeline:null}}function at(t){return t.timeline?t.timeline.poster??t.timeline.duration:0}function Bn(t){return t.timeline?K(t,at(t)):j(t,0)}function rr(t,e){let n=t.camera??[];if(n.length===0)return null;let i;for(let l of n)l.t<=e&&(i=l);let r=n.find(l=>l.t>e);if(!i)return Yn(n[0]);if(!r)return Yn(i);let o=We(i.ease??"easeInOut",(e-i.t)/Math.max(r.t-i.t,1e-9)),s=(l,a)=>l+(a-l)*o;return{x:s(i.x,r.x),y:s(i.y,r.y),width:Math.max(1,s(i.width,r.width)),height:Math.max(1,s(i.height,r.height))}}var Yn=t=>({x:t.x,y:t.y,width:t.width,height:t.height});function vt(t,e){let n=t.camera?.[0],i=rr(t,e);return!n||!i||!(i.width>0&&i.height>0)?null:or(i,n.width/n.height)}function or(t,e){if(!(t.width>0&&t.height>0&&e>0))return t;let n=t.width,i=t.height;return t.width/t.height<e?n=t.height*e:i=t.width/e,{x:t.x+t.width/2-n/2,y:t.y+t.height/2-i/2,width:n,height:i}}function sr(t){return Math.max(1,Math.ceil(C(t.duration)*kt(t.fps)))}function ie(t){let e=kt(t.fps),n=[];for(let r=0;r<sr(t);r++)n.push(r/e);let i=n[n.length-1];return t.duration-i>1e-6&&n.push(t.duration),n}function Gn(t,e){let n=-1;return(t.markers??[]).forEach((i,r)=>{i.t<=e&&(n=r)}),n}function Nn(t){let e=t.timeline;if(!e)return new Set;let n=e.poster??e.duration;return new Set(e.tracks.filter(i=>!Ve(i,0)&&!Ve(i,n)).map(i=>i.element))}var lr=8,ar=2e4,Ye=1e-9;function re(t,e){let n=(t.timeline?.markers??[]).find(i=>i.name.toLowerCase()===e);return n?Math.min(Math.max(n.t,0),C(t.timeline?.duration??0)):null}function Yt(t,e){switch(e){case"up":return re(t,"up")??0;case"over":return re(t,"over")??Yt(t,"up");case"down":return re(t,"down")??Yt(t,"over");default:return re(t,"hit")}}function ur(t,e,n,i){let r=C(t.timeline?.duration??0);if(t.button===!0)return Yt(t,"up")??0;let o=i!==null&&Number.isFinite(i)?i:0;switch(n??"loop"){case"still":return Math.min(t.timeline?.poster??r,r);case"click":return Math.min(Math.max(o,0),r);case"once":return Math.min(Math.max(e+o,0),r);default:{if(r<=0)return 0;let s=e+o,l=s%r;return l<0&&(l+=r),s>Ye&&(l<Ye||r-l<Ye)?r:l}}}function cr(t,e){let n=t.params;if(!n||Object.keys(n).length===0)return t;let i=new Map(Object.entries(n));for(let[o,s]of Object.entries(e??{}))i.has(o)&&i.set(o,s);let r=o=>o.includes("{{")?o.replace(/\{\{\s*([^{}]*?)\s*\}\}/g,(s,l)=>i.get(l)??s):o;return{...t,elements:t.elements.map(o=>{if(o.text===null&&o.args===null)return o;let s=z(o);return s.text!==null&&(s.text=r(s.text)),s.args!==null&&(s.args=Object.fromEntries(Object.entries(s.args).map(([l,a])=>[l,r(a)]))),s})}}function hr(t){return{id:t.id,name:t.name,layers:t.layers,elements:t.elements,theme:null,timeline:t.timeline,symbols:null}}function oe(t){return t.elements.some(e=>e.kind==="symbol")}function j(t,e,n=!0,i=new Map){if(!oe(t))return t;let r={left:ar};return{...t,elements:Hn(t.elements,t,e,Ne(t),[],n,r,i)}}function Ne(t){let e=new Map;for(let n of t.symbols??[])e.has(n.id)||e.set(n.id,n);return e}function Hn(t,e,n,i,r,o,s,l=new Map){let a=new Set(t.filter(h=>h.kind==="symbol").map(h=>h.id));if(a.size===0)return s.left-=t.length,t;let c=U(e),u=[];for(let h of t){if(s.left<=0)break;let f=h.connector;if(h.kind==="connector"&&f&&[f.start.elementID,f.end.elementID].some(v=>v!==null&&a.has(v))){let[v,w]=J(h,c),b=z(h);f.start.elementID!==null&&a.has(f.start.elementID)&&(b.connector.start={elementID:null,port:f.start.port,x:v.x,y:v.y}),f.end.elementID!==null&&a.has(f.end.elementID)&&(b.connector.end={elementID:null,port:f.end.port,x:w.x,y:w.y}),u.push(b),s.left-=1;continue}if(h.kind!=="symbol"){u.push(h),s.left-=1;continue}s.left-=1;let d=h.symbol,m=d===null?void 0:i.get(d);if(d===null||!m||r.includes(d)||r.length>=lr)continue;let p=r.length===0?l.get(h.id):void 0,y=p!==void 0?Math.min(Math.max(p,0),C(m.timeline?.duration??0)):ur(m,n,h.playback,h.offset),P=hr(cr(m,h.args)),x=o?Vt(P,y):P,g=new Set(x.layers.filter(v=>v.visible).map(v=>v.id)),A={...x,elements:dt(x).filter(v=>g.has(v.layerID)),layers:[{id:h.layerID,name:"",visible:!0,locked:!1}]};for(let v of Hn(A.elements,A,y,i,[...r,d],o,s))u.push(dr(v,h,m))}return u}function dr(t,e,n){let i={x:e.x,y:e.y,width:e.width,height:e.height},r=i.width/n.width,o=i.height/n.height,s=Math.sqrt(Math.abs(r*o)),l={x:i.x+i.width/2,y:i.y+i.height/2},a=V(e),c=d=>it({x:i.x+d.x*r,y:i.y+d.y*o},l,a),u=z(t);u.id=Ge(e.id,t.id),u.layerID=e.layerID,u.groupID=null,u.link=t.link===null?null:Ge(e.id,t.link),u.seed=Kt(t.seed,e.seed),u.click=null,u.hover=null;let h={x:i.x+t.x*r,y:i.y+t.y*o,width:t.width*r,height:t.height*o},f=it({x:h.x+h.width/2,y:h.y+h.height/2},l,a);if(u.x=f.x-h.width/2,u.y=f.y-h.height/2,u.width=h.width,u.height=h.height,(a!==0||t.rotation!==null)&&(u.rotation=V(t)+a),u.style.strokeWidth=t.style.strokeWidth*s,u.style.fontSize=t.style.fontSize*s,t.style.gridSize!==null&&(u.style.gridSize=t.style.gridSize*s),e.style.opacity!==null&&(u.style.opacity=(t.style.opacity??1)*e.style.opacity),t.connector){let d=m=>{if(m.elementID!==null)return{elementID:Ge(e.id,m.elementID),port:m.port,x:m.x,y:m.y};let p=c(m);return{elementID:null,port:m.port,x:p.x,y:p.y}};u.connector={...t.connector,start:d(t.connector.start),end:d(t.connector.end)}}return u}var Be=(1n<<64n)-1n;function Wt(t){let e=t+0x9e3779b97f4a7c15n&Be;return e=(e^e>>30n)*0xbf58476d1ce4e5b9n&Be,e=(e^e>>27n)*0x94d049bb133111ebn&Be,e^e>>31n}function Fn(t){let e=t.replace(/-/g,"").padStart(32,"0").slice(-32);return[BigInt(`0x${e.slice(0,16)}`),BigInt(`0x${e.slice(16)}`)]}function Ge(t,e){let[n,i]=Fn(t),[r,o]=Fn(e),s=Wt(Wt(Wt(Wt(n)^i)^r)^o),l=Wt(s^0x6a09e667f3bcc909n),a=s.toString(16).padStart(16,"0")+l.toString(16).padStart(16,"0");return`${a.slice(0,8)}-${a.slice(8,12)}-${a.slice(12,16)}-${a.slice(16,20)}-${a.slice(20)}`.toUpperCase()}function mr(t,e){let n=e.findIndex(i=>i.name===t);return n>=0?n:e.findIndex(i=>i.name.toLowerCase()===t.toLowerCase())}function jn(t,e){let n=t.timeline?.markers??[],i=new Map,r=null;for(let o of t.elements){let s=o.click;if(s?.scene){let a=mr(s.scene,n);if(a>=0){i.set(o.id,{scene:a});continue}}let l=(s?.url?ht(s.url):null)??$t(o.url);if(l){i.set(o.id,{url:l});continue}if(o.link&&e&&e.pages.length>1){r||(r=new Map,e.pages.forEach((c,u)=>{for(let h of c.elements)r.has(h.id)||r.set(h.id,u)}));let a=r.get(o.link);a!==void 0&&e.pages[a]!==t&&i.set(o.id,{page:a})}}return i}function fr(t){let e=t.hover;if(!e)return t;let n={...t.style};if(e.stroke&&(n.stroke=e.stroke),e.fill&&(n.fill=e.fill),e.opacity!==null&&Number.isFinite(e.opacity)){let i=Math.min(Math.max(e.opacity,0),1);n.opacity=i>=1?null:i}return{...t,style:n}}function _n(t,e){return{...t,elements:t.elements.map(n=>e.has(n.id)?fr(n):n)}}function qn(t){return!!t.hover&&(t.hover.stroke!==null||t.hover.fill!==null||t.hover.opacity!==null)}function Un(t,e){let n=(t.text??"").split(`
|
|
3
|
-
`).find(i=>i.length>0);return n||(t.anchor?t.anchor:e||t.kind)}function
|
|
1
|
+
/*! dottie.js 0.6.2 | Apache-2.0 | https://github.com/phin-tech/dottie */
|
|
2
|
+
"use strict";(()=>{var mn=Object.defineProperty;var Mi=(t,e,n)=>e in t?mn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ri=(t,e)=>{for(var n in e)mn(t,n,{get:e[n],enumerable:!0})};var w=(t,e,n)=>Mi(t,typeof e!="symbol"?e+"":e,n);var fn={};Ri(fn,{BOIL_DRAWINGS:()=>ve,BUNDLED_FONTS:()=>Dt,DottieFormatError:()=>Q,DottiePlayer:()=>At,KINDS:()=>yn,KNOWN_FIELDS:()=>gn,MAX_DURATION:()=>xt,MAX_MARCH:()=>Re,Playback:()=>Xt,SUPPORTED_VERSION:()=>Nr,VERSION:()=>Gr,addFonts:()=>ie,allowedURL:()=>ht,black:()=>ct,bounds:()=>et,cameraView:()=>vt,clampFPS:()=>wt,clampMarch:()=>bn,clampTime:()=>O,clear:()=>xn,cloneElement:()=>C,definePlayer:()=>ke,elementIndex:()=>Si,fontFaces:()=>Fe,fontFile:()=>Le,frameTimes:()=>fe,inkOnDark:()=>kn,inspect:()=>Pi,inspectFrame:()=>cn,inspectPage:()=>hn,isAutomaticInk:()=>Se,luminance:()=>Pt,orderedElements:()=>ft,pageIndex:()=>jt,parseDottie:()=>Ft,plan:()=>St,posterTime:()=>at,render:()=>Wr,repeatIsValid:()=>Qt,resolved:()=>H,sameColor:()=>kt,sampleTimes:()=>un,sceneAt:()=>ii,setFontBase:()=>Sn,stableSortBy:()=>qt,still:()=>ni,svg:()=>xe,svgParts:()=>ut,themeNamed:()=>gt,themes:()=>ln,transientElements:()=>ri,usedFonts:()=>ne,webLink:()=>Lt,withRoughness:()=>Jt});var Nr=2,yn=["rectangle","ellipse","diamond","text","connector","freehand","path","note","image","symbol"],Ti=["linear","easeIn","easeOut","easeInOut","hold","spring","bounce","elastic"],gn={file:["version","pages","images"],page:["id","name","layers","elements","theme","guidesX","guidesY","guidesLocked","timeline","symbols"],symbol:["id","name","width","height","layers","elements","timeline","button","params"],layer:["id","name","visible","locked"],rgba:["r","g","b","a"],style:["stroke","fill","fillStyle","strokeWidth","dash","roughness","bowing","fontSize","font","gridSize","opacity","dashOffset"],element:["id","kind","x","y","width","height","style","seed","layerID","text","connector","groupID","points","path","subpaths","evenOdd","rotation","link","url","anchor","click","hover","symbol","playback","offset","args","image","reveal","ports","labelRect","extension"],strokePoint:["x","y"],subpath:["closed","coords"],inlineImage:["data","format"],endpoint:["elementID","port","portIndex","x","y"],extensionRef:["id","shape","version","params"],normalizedPoint:["x","y"],normalizedRect:["x","y","width","height"],connector:["start","end","routing","startHead","endHead"],timeline:["fps","duration","boil","settle","poster","tracks","camera","markers"],track:["element","keys","boil","follow","repeats","march"],keyframe:["t","x","y","width","height","rotation","strokeWidth","stroke","fill","visible","reveal","opacity","ease"],follow:["path","start","end","ease","reverse","orient","laps"],repeat:["start","end","count"],cameraKey:["t","x","y","width","height","ease"],marker:["t","name"],click:["scene","url"],hover:["stroke","fill","opacity"]},xt=3600,Re=1e4,bn=t=>t===void 0||!Number.isFinite(t)||t===0?null:Math.min(Math.max(t,-Re),Re),ve=3,ct={r:.12,g:.12,b:.13,a:1},xn={r:0,g:0,b:0,a:0},kn={r:.93,g:.93,b:.94,a:1},Q=class extends Error{},E=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),R=t=>typeof t=="number"&&Number.isFinite(t)?t:void 0,I=t=>typeof t=="string"?t:void 0,pn=t=>E(t)&&Object.values(t).every(e=>typeof e=="string")?{...t}:null,$=t=>typeof t=="boolean"?t:void 0,W=t=>typeof t=="string"?t.toUpperCase():void 0;function O(t){return Number.isFinite(t)?Math.min(Math.max(t,0),xt):t===1/0?xt:0}function wt(t){return Number.isFinite(t)?Math.min(Math.max(t,1),60):12}function ht(t){let e=t.trim();return!/^(https?:\/\/|mailto:)/i.test(e)||[...e].length<=7||/[\u0000-\u001f\u007f-\u009f]/.test(e)?null:e}function Lt(t){return t?ht(t):null}function bt(t){if(!E(t))return;let e=R(t.r),n=R(t.g),i=R(t.b);if(!(e===void 0||n===void 0||i===void 0))return{r:e,g:n,b:i,a:R(t.a)??1}}var Te=class{constructor(){w(this,"warnings",[]);w(this,"seen",new Set)}warn(e){this.seen.has(e)||(this.seen.add(e),this.warnings.push(e))}fields(e,n){let i=gn[n];for(let r of Object.keys(e))i.includes(r)||this.warn(`Unknown field "${r}" on ${n}, ignored`)}style(e){let n=E(e)?e:{};this.fields(n,"style");let i=I(n.fillStyle)??"solid",r=I(n.dash)??"solid";return["solid","hachure","crossHatch","grid"].includes(i)||this.warn(`Unknown fill style "${i}", drawn solid`),["solid","dashed","dotted"].includes(r)||this.warn(`Unknown dash "${r}", drawn solid`),{stroke:bt(n.stroke)??{...ct},fill:bt(n.fill)??{...xn},fillStyle:["solid","hachure","crossHatch","grid"].includes(i)?i:"solid",strokeWidth:R(n.strokeWidth)??2,dash:["solid","dashed","dotted"].includes(r)?r:"solid",roughness:R(n.roughness)??1,bowing:R(n.bowing)??1,fontSize:R(n.fontSize)??18,font:I(n.font)||null,gridSize:R(n.gridSize)??null,opacity:R(n.opacity)??null,dashOffset:R(n.dashOffset)??null}}endpoint(e){let n=E(e)?e:{},i=I(n.port),r=R(n.portIndex);return{elementID:W(n.elementID)??null,port:i&&["top","right","bottom","left"].includes(i)?i:null,portIndex:r!==void 0&&Number.isInteger(r)&&r>=0?r:null,x:R(n.x)??0,y:R(n.y)??0}}connector(e){if(!E(e))return null;this.fields(e,"connector");let n=(r,o)=>{let s=I(r);return s&&["none","arrow","triangle","dot","bar"].includes(s)?s:o},i=I(e.routing);return{start:this.endpoint(e.start),end:this.endpoint(e.end),routing:i&&["straight","curved","elbow"].includes(i)?i:"straight",startHead:n(e.startHead,"none"),endHead:n(e.endHead,"arrow")}}image(e,n){if(!E(e))return null;let i=I(e.ref);if(i!==void 0)return n[i]??{data:"",format:"png"};let r=I(e.data);return r===void 0?null:this.picture(r,I(e.format))}picture(e,n){return vi.test(e)?{data:e.replace(/\s+/g,""),format:n==="jpeg"?"jpeg":"png"}:(this.warn("Skipped a picture whose data isn't base64"),{data:"",format:"png"})}element(e,n){if(!E(e))return null;this.fields(e,"element");let i=W(e.id),r=I(e.kind),o=W(e.layerID);if(!i||!r||!o)return this.warn("Skipped an element without an id, kind or layer"),null;yn.includes(r)||this.warn(`Unknown element kind "${r}", drawn as a placeholder`);let s=Array.isArray(e.subpaths)?e.subpaths.filter(E).map(l=>({closed:$(l.closed)??!1,coords:Array.isArray(l.coords)?l.coords.filter(a=>typeof a=="number"):[]})):null;return{id:i,kind:r,layerID:o,x:R(e.x)??0,y:R(e.y)??0,width:R(e.width)??0,height:R(e.height)??0,style:this.style(e.style),seed:(R(e.seed)??1)>>>0,text:I(e.text)??null,connector:this.connector(e.connector),groupID:W(e.groupID)??null,points:Array.isArray(e.points)?e.points.filter(E).map(l=>({x:R(l.x)??0,y:R(l.y)??0})):null,path:Array.isArray(e.path)?e.path.filter(l=>typeof l=="number"):null,subpaths:s,evenOdd:$(e.evenOdd)??null,rotation:R(e.rotation)??null,link:W(e.link)??null,url:I(e.url)??null,anchor:I(e.anchor)??null,click:this.click(e.click),hover:this.hover(e.hover),symbol:W(e.symbol)??null,playback:this.playback(e.playback),offset:R(e.offset)??null,args:pn(e.args),image:this.image(e.image,n),reveal:R(e.reveal)??null,ports:Array.isArray(e.ports)?e.ports.map(l=>{let a=E(l)?l:{};return{x:R(a.x)??0,y:R(a.y)??0}}):null,labelRect:this.labelRect(e.labelRect),extension:this.extension(e.extension)}}labelRect(e){return E(e)?(this.fields(e,"normalizedRect"),{x:R(e.x)??0,y:R(e.y)??0,width:R(e.width)??0,height:R(e.height)??0}):null}extension(e){if(!E(e))return null;this.fields(e,"extensionRef");let n=I(e.id),i=I(e.shape),r=I(e.version);if(n===void 0||i===void 0||r===void 0)return this.warn("Skipped an extension without an id, shape or version"),null;let o={};if(E(e.params))for(let[s,l]of Object.entries(e.params))(typeof l=="number"||typeof l=="boolean"||typeof l=="string")&&(o[s]=l);return{id:n,shape:i,version:r,params:o}}click(e){if(!E(e))return null;this.fields(e,"click");let n=I(e.url),i=n===void 0?null:ht(n);return n!==void 0&&i===null&&this.warn("Skipped a click link that isn't http, https or mailto"),{scene:I(e.scene)??null,url:i}}playback(e){let n=I(e);return n===void 0?null:["loop","once","still","click"].includes(n)?n:"loop"}symbol(e,n){if(!E(e))return null;this.fields(e,"symbol");let i=W(e.id);if(!i)return this.warn("Skipped a symbol without an id"),null;let r=s=>{let l=R(s);return Math.max(1,l??100)},o=(Array.isArray(e.layers)?e.layers:[]).filter(E).flatMap(s=>{let l=W(s.id);return l?[{id:l,name:I(s.name)??"",visible:$(s.visible)??!0,locked:$(s.locked)??!1}]:[]});return o.length===0&&o.push({id:`${i}-LAYER`,name:"Layer 1",visible:!0,locked:!1}),{id:i,name:I(e.name)??"Symbol",width:r(e.width),height:r(e.height),layers:o,elements:(Array.isArray(e.elements)?e.elements:[]).map(s=>this.element(s,n)).filter(s=>s!==null),timeline:this.timeline(e.timeline),button:$(e.button)??null,params:pn(e.params)}}hover(e){return E(e)?(this.fields(e,"hover"),{stroke:bt(e.stroke)??null,fill:bt(e.fill)??null,opacity:R(e.opacity)??null}):null}ease(e){let n=I(e);return n===void 0?null:Ti.includes(n)?n:(this.warn(`Unknown ease "${n}", played linear`),null)}keyframe(e){if(!E(e))return null;this.fields(e,"keyframe");let n=R(e.t);if(n===void 0)return null;let i={t:n};for(let a of["x","y","width","height","rotation","strokeWidth","reveal","opacity"]){let h=R(e[a]);h!==void 0&&(i[a]=h)}let r=bt(e.stroke),o=bt(e.fill),s=$(e.visible),l=this.ease(e.ease);return r&&(i.stroke=r),o&&(i.fill=o),s!==void 0&&(i.visible=s),l&&(i.ease=l),i}track(e){if(!E(e))return null;this.fields(e,"track");let n=W(e.element);if(!n)return null;let i=(Array.isArray(e.keys)?e.keys:[]).map(s=>this.keyframe(s)).filter(s=>s!==null&&s.t>=0&&s.t<=xt);qt(i,s=>s.t);let r=Array.isArray(e.follow)?e.follow.filter(E).flatMap(s=>{let l=W(s.path),a=R(s.start),h=R(s.end);return!l||a===void 0||h===void 0||a<0||h>xt?[]:[{path:l,start:a,end:h,ease:this.ease(s.ease),reverse:$(s.reverse)??null,orient:$(s.orient)??null,laps:R(s.laps)??null}]}):null,o=Array.isArray(e.repeats)?e.repeats.filter(E).flatMap(s=>{let l=R(s.start),a=R(s.end);if(l===void 0||a===void 0)return[];let h=R(s.count),u={start:l,end:a,count:h===void 0?null:Math.trunc(h)};return Qt(u)?[u]:[]}):null;return{element:n,keys:i,boil:$(e.boil)??null,follow:r,repeats:o,march:bn(R(e.march))}}timeline(e){if(!E(e))return null;this.fields(e,"timeline");let n=R(e.boil),i=Array.isArray(e.camera)?e.camera.filter(E).flatMap(s=>{let l=R(s.t),a=R(s.x),h=R(s.y),u=R(s.width),c=R(s.height);return l===void 0||a===void 0||h===void 0||u===void 0||c===void 0?[]:u>1&&c>1&&l>=0?[{t:l,x:a,y:h,width:u,height:c,ease:this.ease(s.ease)}]:[]}):null;i&&qt(i,s=>s.t);let r=Array.isArray(e.markers)?e.markers.filter(E).flatMap(s=>{let l=R(s.t);return l!==void 0&&l>=0?[{t:l,name:I(s.name)??""}]:[]}):null;r&&qt(r,s=>s.t);let o=R(e.poster);return{fps:wt(R(e.fps)??12),duration:O(R(e.duration)??0),boil:n!==void 0&&Number.isInteger(n)&&n>0?Math.min(n,1e4):null,settle:$(e.settle)??null,poster:o===void 0?null:O(o),tracks:(Array.isArray(e.tracks)?e.tracks:[]).map(s=>this.track(s)).filter(s=>s!==null),camera:i,markers:r}}page(e,n,i){if(!E(e))throw new Q(`Page ${i} is not an object`);this.fields(e,"page");let r=(Array.isArray(e.layers)?e.layers:[]).filter(E).flatMap(o=>{let s=W(o.id);return s?[{id:s,name:I(o.name)??"",visible:$(o.visible)??!0,locked:$(o.locked)??!1}]:[]});return r.length===0&&(this.warn(`Page ${i} has no layers`),r.push({id:"LAYER",name:"Layer 1",visible:!0,locked:!1})),{id:W(e.id)??`PAGE-${i}`,name:I(e.name)??`Page ${i}`,layers:r,elements:(Array.isArray(e.elements)?e.elements:[]).map(o=>this.element(o,n)).filter(o=>o!==null),theme:I(e.theme)??null,timeline:this.timeline(e.timeline),symbols:Array.isArray(e.symbols)?e.symbols.map(o=>this.symbol(o,n)).filter(o=>o!==null):null}}},vi=/^[A-Za-z0-9+/=\s]*$/;function Qt(t){return Number.isFinite(t.start)&&Number.isFinite(t.end)&&t.start>=0&&t.end-t.start>.001&&t.end<=xt&&(t.count===null||t.count>=1&&t.count<=1e4)}function qt(t,e){let n=t.map((i,r)=>[i,r]);n.sort((i,r)=>e(i[0])-e(r[0])||i[1]-r[1]);for(let i=0;i<t.length;i++)t[i]=n[i][0]}function Ft(t){let e=t;if(typeof t=="string")try{e=JSON.parse(t)}catch(s){throw new Q(`Not JSON: ${s.message}`)}if(!E(e))throw new Q("Not a Dottie drawing");let n=R(e.version);if(n===void 0)throw new Q("Not a Dottie drawing (no version)");if(!Array.isArray(e.pages)||e.pages.length===0)throw new Q("A drawing needs at least one page");let i=new Te;i.fields(e,"file"),n>2&&i.warn(`File version ${n} is newer than this player knows (2); some things may not show`);let r={};if(E(e.images))for(let[s,l]of Object.entries(e.images))E(l)&&typeof l.data=="string"&&(r[s]=i.picture(l.data,I(l.format)));let o=e.pages.map((s,l)=>i.page(s,r,l+1));if(new Set(o.map(s=>s.id)).size!==o.length)throw new Q("Two pages share an id");return{version:n,pages:o,warnings:i.warnings}}function Pt(t){return .2126*t.r+.7152*t.g+.0722*t.b}function kt(t,e){return t.r===e.r&&t.g===e.g&&t.b===e.b&&t.a===e.a}function Se(t){return kt(t,ct)||kt(t,kn)}function C(t){return{...t,style:{...t.style,stroke:{...t.style.stroke},fill:{...t.style.fill}},connector:t.connector?{...t.connector,start:{...t.connector.start},end:{...t.connector.end}}:null}}function ft(t){if(t.layers.length<=1)return t.elements;let e=new Map;t.layers.forEach((i,r)=>{e.has(i.id)||e.set(i.id,r)});let n=t.layers.map(()=>[]);for(let i of t.elements)n[e.get(i.layerID)??0].push(i);return n.flat()}function Si(t){let e=new Map;for(let n of t.elements)e.has(n.id)||e.set(n.id,n);return e}var wn=.60205078125,Pn=.92822265625,Mn=.23583984375,dt={"Architects Daughter":{faces:{regular:{ascent:.986328125,descent:.4033203125,k:{},leading:0,w:{" ":400.39,_:686.52,"-":310.55,"\u2013":310.55,"\u2014":411.13,",":177.73,";":124.02,":":166.99,"!":134.77,"?":505.86,".":140.63,"\u2026":422.85,"\xB7":140.63,"'":162.11,"\u2018":162.11,"\u2019":162.11,'"':236.33,"\u201C":236.33,"\u201D":236.33,"(":297.85,")":351.56,"[":424.8,"]":541.02,"{":352.54,"}":478.52,"@":1042.97,"*":507.81,"/":455.08,"\\":501.95,"&":669.92,"#":637.7,"%":518.55,"\u2022":192.38,"`":171.88,"^":306.64,"\u2190":1e3,"\u2192":1e3,"\u2191":645.02,"\u2193":645.02,"+":524.41,"\xD7":470.7,"<":475.59,"=":492.19,">":471.68,"|":145.51,"~":444.34,"\u25E6":578.13,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:556.64,0:630.86,1:127.93,2:572.27,3:508.79,4:680.66,5:708.01,6:626.95,7:615.23,8:648.44,9:569.34,a:508.79,A:640.63,b:561.52,B:710.94,c:632.81,C:708.01,d:512.7,D:648.44,e:541.02,E:591.8,\u00E9:541.02,f:593.75,F:692.38,g:515.63,G:692.38,h:495.12,H:605.47,i:151.37,I:151.37,j:177.73,J:529.3,k:614.26,K:605.47,l:157.23,L:692.38,m:778.32,M:827.15,n:500,N:626.95,o:562.5,O:669.92,p:556.64,P:637.7,q:513.67,Q:712.89,r:551.76,R:712.89,s:501.95,S:642.58,t:404.3,T:623.05,u:507.81,U:561.52,v:518.55,V:626.95,w:808.59,W:940.43,x:470.7,X:599.61,y:548.83,Y:534.18,z:495.12,Z:784.18}}},fallback:{"\u2190":[.966796875,.2109375,0],"\u2192":[.966796875,.2109375,0],"\u2191":[.966796875,.2109375,0],"\u2193":[.966796875,.2109375,0],"\u25E6":[.966796875,.2109375,0],"\u2610":[.66650390625,.25,.08349609375],"\u2611":[.66650390625,.25,.08349609375],"\u2713":[.966796875,.2109375,0]}},Caveat:{faces:{bold:{ascent:.9600067138671875,descent:.3000030517578125,k:{AC:-20,AE:-10,AG:-10,AH:-10,AI:10,Aj:10,AJ:10,AL:-10,AM:10,An:-10,AO:-20,AP:-10,Aq:-10,AQ:-20,Ar:-10,As:-10,AS:-35,AT:-50,Au:-10,AU:-20,av:-20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,ZB:-10,Zc:-10,ZC:-20,Zd:-30,ZD:-10,Ze:-40,ZE:-20,zf:10,Zg:-40,ZG:-20,zi:10,Zj:10,Zk:10,ZL:-10,Zm:-10,Zn:-50,Zo:-30,ZO:-30,Zp:-10,ZP:-10,Zq:-50,ZQ:-10,Zr:-40,ZR:-10,Zs:-30,ZS:-20,zt:10,Zt:-10,Zu:-30,ZU:-10,zv:10,Zv:-20,Zw:-40,ZW:-10,zx:10,Zx:-10,ZX:-10,Zy:-30,ZY:-20,zz:20,Zz:10,ZZ:-10},leading:0,w:{" ":242,_:446,"-":326,"\u2013":446,"\u2014":566,",":198,";":198,":":198,"!":210,"?":374,".":198,"\u2026":594,"\xB7":187,"'":117,"\u2018":117,"\u2019":117,'"':237,"\u201C":267,"\u201D":267,"(":330,")":330,"[":330,"]":330,"{":330,"}":330,"@":643,"*":363,"/":330,"\\":330,"&":564,"#":559,"%":600,"\u2022":187,"`":353,"^":446,"\u2190":1e3,"\u2192":1e3,"\u2191":722.66,"\u2193":722.66,"+":446,"\xD7":446,"<":446,"=":446,">":446,"|":330,"~":446,"\u25E6":608.4,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:450,0:450,1:450,2:450,3:450,4:450,5:434,6:471,7:446,8:450,9:438,a:446,A:511,b:444,B:523,c:364,C:477,d:402,D:587,e:334,E:534,\u00E9:325,f:300,F:466,g:364,G:494,h:473,H:574,i:196,I:409,j:213,J:315,k:374,K:508,l:178,L:426,m:569,M:729,n:459,N:619,o:362,O:505,p:378,P:468,q:377,Q:492,r:360,R:544,s:350,S:495,t:331,T:458,u:370,U:482,v:331,V:490,w:517,W:720,x:343,X:524,y:341,Y:504,z:315,Z:522}},regular:{ascent:.9600067138671875,descent:.3000030517578125,k:{AC:-20,AE:-10,AG:-10,AH:-10,AI:10,Aj:10,AJ:10,AL:-10,AM:10,An:-10,AO:-20,AP:-10,Aq:-10,AQ:-20,Ar:-10,As:-10,AS:-35,AT:-50,Au:-10,AU:-20,av:-20,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ZB:-10,Zc:-10,ZC:-20,Zd:-30,ZD:-10,Ze:-40,ZE:-20,zf:10,Zg:-40,ZG:-20,zi:10,Zj:10,Zk:10,ZL:-10,Zm:-10,Zn:-50,Zo:-30,ZO:-30,Zp:-10,ZP:-10,Zq:-50,ZQ:-10,Zr:-40,ZR:-10,Zs:-30,ZS:-20,zt:10,Zt:-10,Zu:-30,ZU:-10,zv:10,Zv:-20,Zw:-40,ZW:-10,zx:10,Zx:-10,ZX:-10,Zy:-30,ZY:-20,zz:20,Zz:10,ZZ:-10},leading:0,w:{" ":242,_:446,"-":326,"\u2013":446,"\u2014":566,",":198,";":198,":":198,"!":210,"?":374,".":198,"\u2026":594,"\xB7":187,"'":117,"\u2018":117,"\u2019":117,'"':237,"\u201C":267,"\u201D":267,"(":330,")":330,"[":330,"]":330,"{":330,"}":330,"@":643,"*":363,"/":330,"\\":330,"&":564,"#":559,"%":600,"\u2022":187,"`":353,"^":446,"\u2190":1e3,"\u2192":1e3,"\u2191":645.02,"\u2193":645.02,"+":446,"\xD7":446,"<":446,"=":446,">":446,"|":330,"~":446,"\u25E6":578.13,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:450,0:450,1:450,2:450,3:450,4:450,5:450,6:450,7:450,8:450,9:450,a:437,A:502,b:435,B:520,c:355,C:472,d:393,D:578,e:325,E:529,\u00E9:325,f:291,F:454,g:355,G:487,h:464,H:563,i:187,I:400,j:204,J:306,k:365,K:498,l:169,L:426,m:560,M:720,n:450,N:599,o:353,O:496,p:378,P:464,q:377,Q:502,r:360,R:537,s:341,S:486,t:331,T:458,u:370,U:482,v:331,V:490,w:517,W:720,x:343,X:524,y:341,Y:504,z:315,Z:522}}},fallback:{"\u2190":[.966796875,.2109375,0],"\u2192":[.966796875,.2109375,0],"\u2191":[.966796875,.2109375,0],"\u2193":[.966796875,.2109375,0],"\u25E6":[.966796875,.2109375,0],"\u2610":[.66650390625,.25,.08349609375],"\u2611":[.66650390625,.25,.08349609375],"\u2713":[.966796875,.2109375,0]}},"Helvetica Neue":{faces:{bold:{ascent:.975006103515625,descent:.2169952392578125,k:{"\u2018\u2018":-95,"\u2019\u2019":-95,"\u2019s":-74,"\u2019t":-18,"A\u2019":-74,AT:-92,Av:-18,AV:-46,Aw:-18,AW:-24,Ay:-18,AY:-74,"F,":-157,"F.":-157,"f\u2019":18,FA:-55,ff:-30,fi:20,fl:20,"L\u2019":-74,LT:-92,LV:-92,LW:-55,Ly:-37,LY:-111,"P,":-179,"P.":-179,PA:-74,"r-":-55,"r,":-92,"r.":-92,rc:-18,rd:-18,re:-18,rg:-28,rn:18,ro:-18,rq:-18,RT:-18,RV:-18,RW:-18,RY:-37,"T-":-129,"T,":-111,"T;":-111,"T:":-111,"T.":-111,Ta:-111,TA:-92,Tc:-111,Te:-111,To:-111,Tr:-92,Ts:-111,Tu:-92,Tw:-111,Ty:-111,"V-":-55,"v,":-74,"V,":-129,"V;":-46,"V:":-46,"v.":-74,"V.":-129,Va:-55,VA:-46,Ve:-55,Vi:-18,Vo:-55,Vr:-37,Vu:-37,Vy:-18,"w,":-55,"W,":-74,"W;":-18,"W:":-18,"w.":-55,"W.":-74,Wa:-37,WA:-24,We:-57,Wo:-57,Wr:-18,Wu:-18,"Y-":-111,"y,":-74,"Y,":-139,"Y;":-92,"Y:":-92,"y.":-74,"Y.":-139,Ya:-92,YA:-74,Ye:-111,Yi:-37,Yo:-111,Yp:-74,Yq:-92,Yu:-74,Yv:-55},leading:.0290069580078125,w:{" ":278,_:500,"-":407,"\u2013":500,"\u2014":1e3,",":278,";":278,":":278,"!":278,"?":556,".":278,"\u2026":1e3,"\xB7":278,"'":278,"\u2018":278,"\u2019":278,'"':463,"\u201C":463,"\u201D":463,"(":296,")":296,"[":333,"]":333,"{":333,"}":333,"@":800,"*":407,"/":371,"\\":371,"&":685,"#":556,"%":1e3,"\u2022":350,"`":259,"^":600,"\u2190":1e3,"\u2192":1e3,"\u2191":722.66,"\u2193":722.66,"+":600,"\xD7":600,"<":600,"=":600,">":600,"|":223,"~":600,"\u25E6":608.4,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:556,0:556,1:556,2:556,3:556,4:556,5:556,6:556,7:556,8:556,9:556,a:574,A:685,b:611,B:704,c:574,C:741,d:611,D:741,e:574,E:648,\u00E9:574,f:333,F:593,g:611,G:759,h:593,H:741,i:258,I:295,j:278,J:556,k:574,K:722,l:258,L:593,m:906,M:907,n:593,N:741,o:611,O:778,p:611,P:667,q:611,Q:778,r:389,R:722,s:537,S:649,t:352,T:611,u:593,U:741,v:520,V:630,w:814,W:944,x:537,X:667,y:519,Y:667,z:519,Z:648}},boldItalic:{ascent:.975006103515625,descent:.2169952392578125,k:{"\u2018\u2018":-95,"\u2019\u2019":-95,"\u2019s":-74,"\u2019t":-18,"A\u2019":-74,AT:-92,Av:-18,AV:-46,Aw:-18,AW:-24,Ay:-18,AY:-74,"F,":-157,"F.":-157,"f\u2019":18,FA:-55,ff:-68,"L\u2019":-74,LT:-92,LV:-92,LW:-55,Ly:-37,LY:-111,"P,":-179,"P.":-179,PA:-74,"r-":-55,"r,":-92,"r.":-92,rc:-18,rd:-18,re:-18,rg:-28,rn:18,ro:-18,rq:-18,RT:-18,RV:-18,RW:-18,RY:-37,"T-":-129,"T,":-111,"T;":-111,"T:":-111,"T.":-111,Ta:-111,TA:-92,Tc:-111,Te:-111,To:-111,Tr:-92,Ts:-111,Tu:-92,Tw:-111,Ty:-111,"V-":-55,"v,":-74,"V,":-129,"V;":-46,"V:":-46,"v.":-74,"V.":-129,Va:-55,VA:-46,Ve:-55,Vi:-18,Vo:-55,Vr:-37,Vu:-37,Vy:-18,"w,":-55,"W,":-74,"W;":-18,"W:":-18,"w.":-55,"W.":-74,Wa:-37,WA:-24,We:-57,Wo:-57,Wr:-18,Wu:-18,"Y-":-111,"y,":-74,"Y,":-139,"Y;":-92,"Y:":-92,"y.":-74,"Y.":-139,Ya:-92,YA:-74,Ye:-111,Yi:-37,Yo:-111,Yp:-74,Yq:-92,Yu:-74,Yv:-55},leading:.0290069580078125,w:{" ":278,_:500,"-":407,"\u2013":500,"\u2014":1e3,",":278,";":278,":":278,"!":296,"?":574,".":278,"\u2026":1e3,"\xB7":278,"'":278,"\u2018":278,"\u2019":278,'"':481,"\u201C":481,"\u201D":481,"(":296,")":296,"[":333,"]":333,"{":333,"}":333,"@":800,"*":407,"/":389,"\\":389,"&":685,"#":556,"%":963,"\u2022":350,"`":259,"^":600,"\u2190":1e3,"\u2192":1e3,"\u2191":722.66,"\u2193":722.66,"+":600,"\xD7":600,"<":600,"=":600,">":600,"|":222,"~":600,"\u25E6":608.4,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:556,0:556,1:556,2:556,3:556,4:556,5:556,6:556,7:556,8:556,9:556,a:574,A:685,b:611,B:722,c:556,C:741,d:611,D:741,e:574,E:667,\u00E9:574,f:352,F:593,g:611,G:759,h:611,H:741,i:259,I:296,j:259,J:556,k:556,K:722,l:259,L:574,m:907,M:907,n:611,N:741,o:593,O:778,p:611,P:667,q:611,Q:778,r:389,R:722,s:519,S:648,t:370,T:611,u:611,U:741,v:519,V:630,w:815,W:944,x:519,X:667,y:519,Y:648,z:500,Z:648}},italic:{ascent:.957000732421875,descent:.2129974365234375,k:{"\u2018\u2018":-95,"\u2019\u2019":-95,"\u2019s":-74,"\u2019t":-18,"A\u2019":-74,AT:-92,Av:-18,AV:-46,Aw:-18,AW:-24,Ay:-18,AY:-74,"F,":-157,"F.":-157,"f\u2019":18,FA:-55,ff:-15,fi:1,fl:1,"L\u2019":-74,LT:-92,LV:-92,LW:-55,Ly:-37,LY:-111,"P,":-179,"P.":-179,PA:-74,"r-":-55,"r,":-92,"r.":-92,rc:-18,rd:-18,re:-18,rg:-28,rn:18,ro:-18,rq:-18,RT:-18,RV:-18,RW:-18,RY:-37,"T-":-129,"T,":-111,"T;":-111,"T:":-111,"T.":-111,Ta:-111,TA:-92,Tc:-111,Te:-111,To:-111,Tr:-92,Ts:-111,Tu:-92,Tw:-111,Ty:-111,"V-":-55,"v,":-74,"V,":-129,"V;":-46,"V:":-46,"v.":-74,"V.":-129,Va:-55,VA:-46,Ve:-55,Vi:-18,Vo:-55,Vr:-37,Vu:-37,Vy:-18,"w,":-55,"W,":-74,"W;":-18,"W:":-18,"w.":-55,"W.":-74,Wa:-37,WA:-24,We:-57,Wo:-57,Wr:-18,Wu:-18,"Y-":-111,"y,":-74,"Y,":-139,"Y;":-92,"Y:":-92,"y.":-74,"Y.":-139,Ya:-92,YA:-74,Ye:-111,Yi:-37,Yo:-111,Yp:-74,Yq:-92,Yu:-74,Yv:-55},leading:.0279998779296875,w:{" ":278,_:500,"-":389,"\u2013":500,"\u2014":1e3,",":278,";":278,":":278,"!":259,"?":556,".":278,"\u2026":1e3,"\xB7":278,"'":278,"\u2018":278,"\u2019":278,'"':426,"\u201C":426,"\u201D":426,"(":259,")":259,"[":259,"]":259,"{":333,"}":333,"@":800,"*":352,"/":333,"\\":333,"&":630,"#":556,"%":926,"\u2022":500,"`":222,"^":600,"\u2190":1e3,"\u2192":1e3,"\u2191":645.02,"\u2193":645.02,"+":600,"\xD7":600,"<":600,"=":600,">":600,"|":222,"~":600,"\u25E6":578.13,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:556,0:556,1:556,2:556,3:556,4:556,5:556,6:556,7:556,8:556,9:556,a:519,A:667,b:593,B:685,c:537,C:722,d:593,D:704,e:537,E:611,\u00E9:537,f:296,F:574,g:574,G:759,h:556,H:722,i:222,I:259,j:222,J:519,k:481,K:667,l:222,L:556,m:852,M:870,n:556,N:722,o:574,O:759,p:593,P:648,q:593,Q:759,r:333,R:685,s:481,S:648,t:315,T:574,u:556,U:722,v:481,V:611,w:759,W:926,x:481,X:611,y:481,Y:611,z:444,Z:611}},regular:{ascent:.951995849609375,descent:.2129974365234375,k:{"\u2018\u2018":-95,"\u2019\u2019":-95,"\u2019s":-74,"\u2019t":-18,"A\u2019":-74,AT:-92,Av:-18,AV:-46,Aw:-18,AW:-24,Ay:-18,AY:-74,"F,":-157,"F.":-157,"f\u2019":18,FA:-55,ff:-15,"L\u2019":-74,LT:-92,LV:-92,LW:-55,Ly:-37,LY:-111,"P,":-179,"P.":-179,PA:-74,"r-":-55,"r,":-92,"r.":-92,rc:-18,rd:-18,re:-18,rg:-28,rn:18,ro:-18,rq:-18,RT:-18,RV:-18,RW:-18,RY:-37,"T-":-129,"T,":-111,"T;":-111,"T:":-111,"T.":-111,Ta:-111,TA:-92,Tc:-111,Te:-111,To:-111,Tr:-92,Ts:-111,Tu:-92,Tw:-111,Ty:-111,"V-":-55,"v,":-74,"V,":-129,"V;":-46,"V:":-46,"v.":-74,"V.":-129,Va:-55,VA:-46,Ve:-55,Vi:-18,Vo:-55,Vr:-37,Vu:-37,Vy:-18,"w,":-55,"W,":-74,"W;":-18,"W:":-18,"w.":-55,"W.":-74,Wa:-37,WA:-24,We:-57,Wo:-57,Wr:-18,Wu:-18,"Y-":-111,"y,":-74,"Y,":-139,"Y;":-92,"Y:":-92,"y.":-74,"Y.":-139,Ya:-92,YA:-74,Ye:-111,Yi:-37,Yo:-111,Yp:-74,Yq:-92,Yu:-74,Yv:-55},leading:.0279998779296875,w:{" ":278,_:500,"-":389,"\u2013":500,"\u2014":1e3,",":278,";":278,":":278,"!":259,"?":556,".":278,"\u2026":1e3,"\xB7":278,"'":278,"\u2018":278,"\u2019":278,'"':426,"\u201C":426,"\u201D":426,"(":259,")":259,"[":259,"]":259,"{":333,"}":333,"@":800,"*":352,"/":333,"\\":333,"&":630,"#":556,"%":1e3,"\u2022":350,"`":222,"^":600,"\u2190":1e3,"\u2192":1e3,"\u2191":645.02,"\u2193":645.02,"+":600,"\xD7":600,"<":600,"=":600,">":600,"|":222,"~":600,"\u25E6":578.13,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:556,0:556,1:556,2:556,3:556,4:556,5:556,6:556,7:556,8:556,9:556,a:537,A:648,b:593,B:685,c:537,C:722,d:593,D:704,e:537,E:611,\u00E9:537,f:296,F:574,g:574,G:759,h:556,H:722,i:222,I:259,j:222,J:519,k:519,K:667,l:222,L:556,m:853,M:871,n:556,N:722,o:574,O:760,p:593,P:648,q:593,Q:760,r:333,R:685,s:500,S:648,t:315,T:574,u:556,U:722,v:500,V:611,w:758,W:926,x:518,X:611,y:500,Y:648,z:480,Z:611}}},fallback:{"\u2190":[.966796875,.2109375,0],"\u2192":[.966796875,.2109375,0],"\u2191":[.966796875,.2109375,0],"\u2193":[.966796875,.2109375,0],"\u25E6":[.966796875,.2109375,0],"\u2610":[.66650390625,.25,.08349609375],"\u2611":[.66650390625,.25,.08349609375],"\u2713":[.966796875,.2109375,0]}},"Patrick Hand":{faces:{regular:{ascent:1.0420074462890625,descent:.3119964599609375,k:{},leading:0,w:{" ":230,_:571,"-":404,"\u2013":420,"\u2014":648,",":202,";":232,":":232,"!":247,"?":368,".":214,"\u2026":571,"\xB7":200,"'":164,"\u2018":190,"\u2019":220,'"':303,"\u201C":315,"\u201D":303,"(":334,")":364,"[":303,"]":296,"{":339,"}":328,"@":550,"*":404,"/":423,"\\":420,"&":530,"#":457,"%":643,"\u2022":352,"`":220,"^":370,"\u2190":1e3,"\u2192":1e3,"\u2191":645.02,"\u2193":645.02,"+":480,"\xD7":490,"<":396,"=":572,">":400,"|":176,"~":529,"\u25E6":578.13,"\u2610":830.08,"\u2611":830.08,"\u2713":764.16,$:507,0:448,1:363,2:468,3:448,4:375,5:423,6:399,7:495,8:433,9:367,a:392,A:488,b:412,B:507,c:388,C:548,d:390,D:475,e:398,E:442,\u00E9:398,f:359,F:375,g:445,G:480,h:420,H:468,i:224,I:235,j:235,J:370,k:415,K:523,l:266,L:372,m:680,M:595,n:452,N:532,o:403,O:556,p:428,P:481,q:463,Q:655,r:385,R:454,s:385,S:459,t:344,T:468,u:400,U:550,v:400,V:562,w:463,W:616,x:448,X:601,y:423,Y:442,z:428,Z:507}}},fallback:{"\u2190":[.966796875,.2109375,0],"\u2192":[.966796875,.2109375,0],"\u2191":[.966796875,.2109375,0],"\u2193":[.966796875,.2109375,0],"\u25E6":[.966796875,.2109375,0],"\u2610":[.66650390625,.25,.08349609375],"\u2611":[.66650390625,.25,.08349609375],"\u2713":[.966796875,.2109375,0]}}};var _t="Helvetica Neue",Ae="Helvetica Neue, Helvetica, Arial, sans-serif",Dt=Object.keys(dt).filter(t=>t!==_t).sort();function Yt(t){if(!t)return null;let e=t.toLowerCase();return Dt.find(n=>n.toLowerCase()===e)??null}function te(t){return dt[Yt(t)??_t]}function Ot(t,e,n){let i=e?n?"boldItalic":"bold":n?"italic":"regular";return t.faces[i]?i:"regular"}function ee(t){if(!t)return Ae;let e=[...Yt(t)??t].filter(n=>!`"'<>&;{}\\`.includes(n)).join("");return e===""?Ae:`${/^[\p{L}\p{N} -]+$/u.test(e)?e:`'${e}'`}, ${Ae}`}function Rn(t,e,n="regular",i){let r=te(i),o=r.faces[n]??r.faces.regular,s=o.w.n,l=0,a="";for(let h of t)l+=o.w[h]??s,a&&(l+=o.k[a+h]??0),a=h;return l*e/1e3}function Ai(t,e){let n=te(e).faces.regular,i=Math.round(n.ascent*t),r=Math.round(n.descent*t),o=Math.round(n.leading*t);return[i+Math.ceil(n.descent*t-1e-9),i+r+o]}function Ee(t,e){return t===" "?!0:(t==="/"||t==="-")&&e!==""&&!/[\d\s/-]/.test(e)}function Ei(t){let e=[...t],n=[],i="";return e.forEach((r,o)=>{i+=r;let s=e[o+1]??"";Ee(r,s)&&s!==" "&&(n.push(i),i="")}),(i||n.length===0)&&n.push(i),n}function Ii(t,e,n,i="regular",r){let o=l=>Rn(l,e,i,r),s=[];for(let l of t.split(/\r\n|\n|\r|\u2028|\u2029/)){let a="";for(let h of Ei(l)){let u=a+h;for(a===""||o(u.trimEnd())<=n?a=u:(s.push(a),a=h);o(a.trimEnd())>n&&[...a.trimEnd()].length>1;){let c=[...a],m=c.length-1;for(;m>1&&o(c.slice(0,m).join(""))>n;)m--;s.push(c.slice(0,m).join("")),a=c.slice(m).join("")}}s.push(a)}return s}function Tn(t,e,n,i){if(t==="")return{width:0,height:0};let r=Ii(t,e,n,"regular",i),o=Math.max(...r.map(a=>Rn(a.trimEnd(),e,"regular",i))),[s,l]=Ai(e,i);return{width:Math.ceil(o-1e-9),height:Math.ceil(s+l*(r.length-1)-1e-9)}}var Li=["bold","boldItalic","italic","regular"];function Le(t,e){return`${t.toLowerCase().replaceAll(" ","-")}-${e}.woff2`}function Fe(t){return Li.filter(e=>dt[t]?.faces[e]!==void 0)}function ne(t){let e=new Set,n=i=>{for(let r of i){let o=Yt(r.style.font);o&&e.add(o)}};n(t.elements);for(let i of t.symbols??[])n(i.elements);return Dt.filter(i=>e.has(i))}function Fi(){try{let t=typeof document>"u"?null:document.currentScript;if(t?.src)return new URL("fonts/",t.src).href;let e=void 0;return e?new URL("fonts/",e).href:null}catch{return null}}var Ie=Fi(),vn=new Set;function Sn(t){Ie=t.endsWith("/")?t:`${t}/`}function ie(t,e={}){if(!(typeof document>"u"||typeof FontFace>"u"||!document.fonts))for(let n of t){let i=Yt(n);if(!i||vn.has(i))continue;let r=e[i];if(!(!r&&!Ie)){vn.add(i);for(let o of Fe(i)){let s=r?.[o],l;if(s)l=Uint8Array.from(atob(s),h=>h.charCodeAt(0));else if(!r)l=`url(${JSON.stringify(Ie+Le(i,o))}) format("woff2")`;else continue;let a={weight:o.startsWith("bold")?"bold":"normal",style:o==="italic"||o==="boldItalic"?"italic":"normal"};document.fonts.add(new FontFace(i,l,a))}}}}var An=.5522847498307936,A=class t{constructor(){w(this,"segments",[])}get isEmpty(){return this.segments.length===0}moveTo(e){return this.segments.push({op:"M",p:e}),this}lineTo(e){return this.segments.push({op:"L",p:e}),this}quadTo(e,n){return this.segments.push({op:"Q",c:n,p:e}),this}curveTo(e,n,i){return this.segments.push({op:"C",c1:n,c2:i,p:e}),this}close(){return this.segments.push({op:"Z"}),this}addPath(e){return this.segments.push(...e.segments),this}addLines(e){return e.forEach((n,i)=>i===0?this.moveTo(n):this.lineTo(n)),this}static rect(e){return new t().addLines([{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}]).close()}addEllipse(e){let n=e.x+e.width/2,i=e.y+e.height/2,r=e.width/2,o=e.height/2,s=r*An,l=o*An;return this.moveTo({x:n+r,y:i}),this.curveTo({x:n,y:i+o},{x:n+r,y:i+l},{x:n+s,y:i+o}),this.curveTo({x:n-r,y:i},{x:n-s,y:i+o},{x:n-r,y:i+l}),this.curveTo({x:n,y:i-o},{x:n-r,y:i-l},{x:n-s,y:i-o}),this.curveTo({x:n+r,y:i},{x:n+s,y:i-o},{x:n+r,y:i-l}),this.close()}static ellipse(e){return new t().addEllipse(e)}translated(e,n){let i=o=>({x:o.x+e,y:o.y+n}),r=new t;return r.segments=this.segments.map(o=>{switch(o.op){case"M":case"L":return{op:o.op,p:i(o.p)};case"Q":return{op:"Q",c:i(o.c),p:i(o.p)};case"C":return{op:"C",c1:i(o.c1),c2:i(o.c2),p:i(o.p)};case"Z":return o}}),r}contours(){let e=[],n=[],i={x:0,y:0};for(let r of this.segments){let o=n.length?n[n.length-1]:i;switch(r.op){case"M":n.length>1&&e.push(n),i=r.p,n=[r.p];break;case"L":n.push(r.p);break;case"Q":for(let s=1;s<=12;s++){let l=s/12,a=1-l;n.push({x:a*a*o.x+2*a*l*r.c.x+l*l*r.p.x,y:a*a*o.y+2*a*l*r.c.y+l*l*r.p.y})}break;case"C":for(let s=1;s<=16;s++){let l=s/16,a=1-l;n.push({x:a*a*a*o.x+3*a*a*l*r.c1.x+3*a*l*l*r.c2.x+l*l*l*r.p.x,y:a*a*a*o.y+3*a*a*l*r.c1.y+3*a*l*l*r.c2.y+l*l*l*r.p.y})}break;case"Z":n.push(i),n.length>1&&e.push(n),n=[i];break}}return n.length>1&&e.push(n),e}trimmed(e){let n=this.contours().map(o=>new Mt(o)),i=Math.min(Math.max(e,0),1)*n.reduce((o,s)=>o+s.length,0),r=new t;for(let o of n){if(!(i>0))break;r.moveTo(o.points[0]);for(let s=1;s<o.points.length;s++){let l=o.lengths[s]-o.lengths[s-1];if(l<=i){r.lineTo(o.points[s]),i-=l;continue}let a=o.points[s-1],h=o.points[s],u=i/l;r.lineTo({x:a.x+(h.x-a.x)*u,y:a.y+(h.y-a.y)*u}),i=0;break}}return r}data(){let e=[];for(let n of this.segments)switch(n.op){case"M":e.push(`M${k(n.p.x)} ${k(n.p.y)}`);break;case"L":e.push(`L${k(n.p.x)} ${k(n.p.y)}`);break;case"Q":e.push(`Q${k(n.c.x)} ${k(n.c.y)} ${k(n.p.x)} ${k(n.p.y)}`);break;case"C":e.push(`C${k(n.c1.x)} ${k(n.c1.y)} ${k(n.c2.x)} ${k(n.c2.y)} ${k(n.p.x)} ${k(n.p.y)}`);break;case"Z":e.push("Z");break}return e.join(" ")}};function Ct(t){return t<0?-Math.round(-t):Math.round(t)}function k(t){let e=Ct(t*100)/100;return Number.isInteger(e)?String(e===0?0:e):String(e)}var Mt=class{constructor(e){w(this,"points");w(this,"lengths");this.points=e;let n=0;this.lengths=e.map((i,r)=>(r>0&&(n+=Math.hypot(i.x-e[r-1].x,i.y-e[r-1].y)),n))}get length(){return this.lengths.length?this.lengths[this.lengths.length-1]:0}point(e){if(this.points.length<=1||!(this.length>0))return this.points[0]??{x:0,y:0};let n=Math.min(Math.max(e,0),1)*this.length,i=1;for(;i<this.lengths.length-1&&this.lengths[i]<n;)i++;let r=this.lengths[i]-this.lengths[i-1],o=r>0?(n-this.lengths[i-1])/r:0,s=this.points[i-1],l=this.points[i];return{x:s.x+(l.x-s.x)*o,y:s.y+(l.y-s.y)*o}}},N=t=>t.x+t.width/2,Z=t=>t.y+t.height/2,G=t=>t.x+t.width,B=t=>t.y+t.height;function De(t,e){if(!t)return{...e};let n=Math.min(t.x,e.x),i=Math.min(t.y,e.y);return{x:n,y:i,width:Math.max(G(t),G(e))-n,height:Math.max(B(t),B(e))-i}}function Rt(t,e,n){return{x:t.x+e,y:t.y+n,width:t.width-2*e,height:t.height-2*n}}function it(t,e,n){if(n===0)return t;let i=t.x-e.x,r=t.y-e.y;return{x:e.x+i*Math.cos(n)-r*Math.sin(n),y:e.y+i*Math.sin(n)+r*Math.cos(n)}}function Ye(t,e){let n=1-e;return{x:t[0].x*(n*n*n)+t[1].x*(3*e*n*n)+t[2].x*(3*e*e*n)+t[3].x*(e*e*e),y:t[0].y*(n*n*n)+t[1].y*(3*e*n*n)+t[2].y*(3*e*e*n)+t[3].y*(e*e*e)}}function En(t,e){let n=[t[0]];for(let i=0;i<Math.floor((t.length-1)/3);i++){let r=t.slice(3*i,3*i+4),o=0;for(let l=1;l<r.length;l++)o+=Math.hypot(r[l].x-r[l-1].x,r[l].y-r[l-1].y);let s=Math.min(400,Math.max(4,Math.ceil(o/Math.max(e,.5))));for(let l=1;l<=s;l++)n.push(Ye(r,l/s))}return n}var D=t=>({x:t.x,y:t.y,width:t.width,height:t.height}),V=t=>t.rotation??0,Vt=t=>({x:t.x+t.width/2,y:t.y+t.height/2}),j=(t,e)=>it(e,Vt(t),V(t)),In=(t,e)=>it(e,Vt(t),-V(t));function Ln(t){let e=D(t);if(V(t)===0)return e;let n=[{x:e.x,y:e.y},{x:G(e),y:e.y},{x:G(e),y:B(e)},{x:e.x,y:B(e)}].map(l=>j(t,l)),i=n.map(l=>l.x),r=n.map(l=>l.y),o=Math.min(...i),s=Math.min(...r);return{x:o,y:s,width:Math.max(...i)-o,height:Math.max(...r)-s}}function Fn(t,e){if(!Se(t.style.stroke))return t;let n=C(t),r=(t.style.fillStyle==="solid"||t.style.fillStyle==="grid")&&t.style.fill.a>=.5&&Pt(t.style.fill)>.5;return n.style.stroke=Pt(e)>.5&&r?{...ct}:{...e},n}function Tt(t){if(t.kind!=="path"||!t.subpaths)return[];let e=[];for(let n of t.subpaths){if(n.coords.length<8||(n.coords.length-2)%6!==0)continue;let i=[];for(let r=0;r<n.coords.length;r+=2)i.push({x:t.x+n.coords[r]*t.width,y:t.y+n.coords[r+1]*t.height});e.push({closed:n.closed,points:i})}return e}function Oe(t){let e=new A;for(let n of Tt(t)){e.moveTo(n.points[0]);for(let i=0;i<(n.points.length-1)/3;i++)e.curveTo(n.points[3*i+3],n.points[3*i+1],n.points[3*i+2]);n.closed&&e.close()}return e}function Di(t,e){let n=D(t),i=e==="top"?{x:N(n),y:n.y}:e==="right"?{x:G(n),y:Z(n)}:e==="bottom"?{x:N(n),y:B(n)}:{x:n.x,y:Z(n)};return j(t,i)}function Yi(t){let e=[];for(let n=0;n+3<t.length;n+=3){let i=t.slice(n,n+4);for(let r=0;r<16;r++)e.push(Ye(i,r/16))}return e.push(t[t.length-1]),e}function Oi(t,e,n){let i=null,r=null;for(let s of Tt(t)){let l=Yi(s.points),a=l.length,h=s.closed?a:a-1;for(let u=0;u<h;u++){let c=l[u],m=l[(u+1)%a],f={x:m.x-c.x,y:m.y-c.y},d={x:c.x-e.x,y:c.y-e.y},p=f.x*n.y-n.x*f.y;if(p===0)continue;let y=(f.x*d.y-f.y*d.x)/p,g=(n.x*d.y-n.y*d.x)/p;y>0&&g>=0&&g<=1&&((i===null||y<i)&&(i=y),y<=1&&(r===null||y>r)&&(r=y))}}let o=r??i;return o===null?null:{x:e.x+n.x*o,y:e.y+n.y*o}}function Ci(t,e){let n=D(t),i=Vt(t),r=In(t,e),o=r.x-i.x,s=r.y-i.y;if(!((o!==0||s!==0)&&n.width>0&&n.height>0))return i;if(t.kind==="path"){let u=Oi(t,i,{x:o,y:s});if(u)return j(t,u)}let l=n.width/2,a=n.height/2,h;return t.kind==="ellipse"?h=1/Math.sqrt(o*o/(l*l)+s*s/(a*a)):t.kind==="diamond"?h=1/(Math.abs(o)/l+Math.abs(s)/a):h=Math.min(o!==0?l/Math.abs(o):1/0,s!==0?a/Math.abs(s):1/0),j(t,{x:i.x+o*h,y:i.y+s*h})}function Dn(t,e){let n=t.elementID?e.get(t.elementID):void 0;return n?Vt(n):{x:t.x,y:t.y}}function Vi(t,e){let n=D(t);return j(t,{x:n.x+e.x*n.width,y:n.y+e.y*n.height})}function Yn(t,e,n){let i=t.elementID?n.get(t.elementID):void 0;if(!i)return{x:t.x,y:t.y};let r=t.portIndex,o=i.ports??[];return typeof r=="number"&&Number.isInteger(r)&&r>=0&&r<o.length?Vi(i,o[r]):t.port?Di(i,t.port):Ci(i,e)}function _(t,e){let n=t.connector;return n?[Yn(n.start,Dn(n.end,e),e),Yn(n.end,Dn(n.start,e),e)]:[{x:0,y:0},{x:0,y:0}]}function rt(t){if(t.kind==="polyline")return t.points;let e=[];for(let n=0;n<=24;n++){let i=n/24,r=1-i;e.push({x:r*r*r*t.a.x+3*r*r*i*t.b.x+3*r*i*i*t.c.x+i*i*i*t.d.x,y:r*r*r*t.a.y+3*r*r*i*t.b.y+3*r*i*i*t.c.y+i*i*i*t.d.y})}return e}function ot(t,e){let n=t.connector;if(!n)return{kind:"polyline",points:[]};let[i,r]=_(t,e),o=r.x-i.x,s=r.y-i.y,l=Math.abs(o)>=Math.abs(s);switch(n.routing){case"straight":return{kind:"polyline",points:[i,r]};case"curved":return l?{kind:"cubic",a:i,b:{x:i.x+o/2,y:i.y},c:{x:r.x-o/2,y:r.y},d:r}:{kind:"cubic",a:i,b:{x:i.x,y:i.y+s/2},c:{x:r.x,y:r.y-s/2},d:r};case"elbow":{let a=c=>c===null?null:c==="top"||c==="bottom",h=a(n.start.port)??!l,u=a(n.end.port)??!l;if(h&&u){let c=i.y+s/2;return{kind:"polyline",points:[i,{x:i.x,y:c},{x:r.x,y:c},r]}}if(!h&&!u){let c=i.x+o/2;return{kind:"polyline",points:[i,{x:c,y:i.y},{x:c,y:r.y},r]}}return h?{kind:"polyline",points:[i,{x:i.x,y:r.y},r]}:{kind:"polyline",points:[i,{x:r.x,y:i.y},r]}}}}function On(t,e,n){let i=Math.atan2(t.y-e.y,t.x-e.x),r=Math.PI/7,o=s=>({x:t.x-n*Math.cos(i+s),y:t.y-n*Math.sin(i+s)});return[o(r),o(-r)]}function Cn(t,e){let n=rt(ot(t,e));if(n.length===0)return{x:0,y:0,width:0,height:0};let i=n[0].x,r=n[0].y,o=i,s=r;for(let l of n)i=Math.min(i,l.x),r=Math.min(r,l.y),o=Math.max(o,l.x),s=Math.max(s,l.y);return{x:i,y:r,width:o-i,height:s-r}}function Vn(t,e){let n=rt(ot(t,e));if(n.length<=1)return n[0]??{x:0,y:0};let i=[],r=0;for(let s=0;s<n.length-1;s++){let l=Math.hypot(n[s+1].x-n[s].x,n[s+1].y-n[s].y);i.push(l),r+=l}let o=r/2;for(let s=0;s<i.length;s++){let l=i[s];if(o<=l||s===i.length-1){let a=l===0?0:o/l;return{x:n[s].x+(n[s+1].x-n[s].x)*a,y:n[s].y+(n[s+1].y-n[s].y)*a}}o-=l}return n[0]}function J(t){let e=new Map;for(let n of t.elements)e.has(n.id)||e.set(n.id,n);return e}function Ve(t,e,n){let i=t[1]+n>>>0,r=i<t[1]?1:0;return[t[0]+e+r>>>0,i]}function $i(t,e){let n=t&65535,i=t>>>16,r=e&65535,o=e>>>16,s=n*r,l=n*o,a=i*r,h=i*o,u=l+a,c=s+u%65536*65536;return[h+Math.floor(u/65536)+Math.floor(c/4294967296)>>>0,c>>>0]}function $e(t,e,n){let i=$i(t[1],n);return[i[0]+Math.imul(t[0],n)+Math.imul(t[1],e)>>>0,i[1]]}function Ce(t,e){let n=(t[1]>>>e|t[0]<<32-e)>>>0;return[(t[0]^t[0]>>>e)>>>0,(t[1]^n)>>>0]}function $n(t){return t=$e(Ce(t,30),3210233709,484763065),t=$e(Ce(t,27),2496678331,321982955),Ce(t,31)}var st=class{constructor(e){w(this,"state");this.state=Ve([0,e>>>0],2654435769,2135587861)}next(){return this.state=Ve(this.state,2654435769,2135587861),$n(this.state)}top53(){let[e,n]=this.next();return e*2097152+(n>>>11)}signed(){return Math.floor(this.top53())/2**52-1}unit(){return this.top53()/2**53}};function re(t,e){let n=Ve([0,t>>>0],...Wi(e));return n=$n(n),Math.max(1,n[1]>>>0)}function Wi(t){let e=$e([0,t>>>0],2654435769,2135587861);return[e[0],e[1]]}var Wn=(t,e,n)=>t.signed()*e*n;function tt(t,e,n,i,r,o,s){let l=Math.hypot(e.x-t.x,e.y-t.y);if(!(l>.5))return;let a=l<200?1:l>500?.4:-.0016668*l+1.233334,h=l<20?l/10:2;for(let u=0;u<2;u++){let c=(u===0?1:.5)*a,m=()=>Wn(n,h,i)*c,f=n.unit()*.4+.3,d=Wn(n,l/60,i)*r*a,p=e.x-t.x,y=e.y-t.y,g=-y/l,P=p/l,b=o?t:{x:t.x+m(),y:t.y+m()},T=o?e:{x:e.x+m(),y:e.y+m()},v=t.x+p*f*.66+g*d+m()*.5,x=t.y+y*f*.66+P*d+m()*.5,M=t.x+p*(.5+f*.5)+g*d+m()*.5,S=t.y+y*(.5+f*.5)+P*d+m()*.5;s.moveTo(b),s.curveTo(T,{x:v,y:x},{x:M,y:S})}}function We(t,e,n,i){let r=new A;for(let o=0;o<t.length;o++)tt(t[o],t[(o+1)%t.length],e,n,i,!1,r);return r}function zn(t,e,n){let i=new A,r=t.x+t.width/2,o=t.y+t.height/2,s=t.width/2,l=t.height/2;if(!(s>.5&&l>.5))return i;let a=Math.max(8,Math.min(24,Math.trunc((s+l)/6))),h=Math.min(2.5,(s+l)/25)*n;for(let u=0;u<2;u++){let c=e.unit()*2*Math.PI,m=2*Math.PI*(u===0?1:1.04),f=Math.trunc(a*m/(2*Math.PI))+1,d=[];for(let p=0;p<f;p++){let y=c+m*p/a,g=e.signed()*h,P=e.signed()*h;d.push({x:r+s*Math.cos(y)+g,y:o+l*Math.sin(y)+P})}zi(d,i)}return i}function zi(t,e){if(!(t.length<=2)){e.moveTo(t[0]);for(let n=0;n<t.length-1;n++){let i=t[Math.max(n-1,0)],r=t[n],o=t[n+1],s=t[Math.min(n+2,t.length-1)];e.curveTo(o,{x:r.x+(o.x-i.x)/6,y:r.y+(o.y-i.y)/6},{x:o.x-(s.x-r.x)/6,y:o.y-(s.y-r.y)/6})}}}var ze=-41*Math.PI/180;function Gn(t,e,n){if(!(n>0))return[];let i=Math.cos(e),r=Math.sin(e),o=t.filter(m=>m.length>=3).map(m=>m.map(f=>({x:f.x*i+f.y*r,y:-f.x*r+f.y*i}))),s=o.flat();if(s.length===0)return[];let l=1/0,a=-1/0;for(let m of s)l=Math.min(l,m.y),a=Math.max(a,m.y);let h=(m,f)=>({x:m*i-f*r,y:m*r+f*i}),u=[],c=l+n/2;for(;c<a;){let m=[];for(let f of o)for(let d=0;d<f.length;d++){let p=f[d],y=f[(d+1)%f.length];(p.y<=c&&c<y.y||y.y<=c&&c<p.y)&&m.push(p.x+(c-p.y)/(y.y-p.y)*(y.x-p.x))}m.sort((f,d)=>f-d);for(let f=0;f+1<m.length;f+=2)m[f+1]-m[f]>.5&&u.push([h(m[f],c),h(m[f+1],c)]);c+=n}return u}var Un=2,Ge=.75,Gi=.8,Nn=.6;function Xn(t,e){return[...Zn(t,e,!1),...Zn(t,e,!0)]}function Zn(t,e,n){if(!(e>0))return[];let i=h=>n?{x:h.y,y:h.x}:h,r=t.filter(h=>h.length>=3).map(h=>h.map(i)),o=r.flat().map(h=>h.y);if(o.length===0)return[];let s=Math.min(...o),l=Math.max(...o),a=[];for(let h=Math.floor(s/e)*e;h<l-.5;h+=e){if(!(h>s+.5))continue;let u=[];for(let c of r)for(let m=0;m<c.length;m++){let f=c[m],d=c[(m+1)%c.length];(f.y<=h&&h<d.y||d.y<=h&&h<f.y)&&u.push(f.x+(h-f.y)/(d.y-f.y)*(d.x-f.x))}u.sort((c,m)=>c-m);for(let c=0;c+1<u.length;c+=2)u[c+1]-u[c]>.5&&a.push([i({x:u[c],y:h}),i({x:u[c+1],y:h})])}return a}function jn(t){return .2126*t.r+.7152*t.g+.0722*t.b>.5?{r:t.r*.84,g:t.g*.84,b:t.b*.8,a:t.a}:{r:t.r+(1-t.r)*.25,g:t.g+(1-t.g)*.25,b:t.b+(1-t.b)*.25,a:t.a}}function Be(t){return t.style.fillStyle==="grid"&&t.style.fill.a>0&&["rectangle","ellipse","diamond","path"].includes(t.kind)}function se(t,e,n){let i=(Math.imul(t,668265261)^Math.imul(e,374761393)^Math.imul(n,2654435761))>>>0;return i=Math.imul(i^i>>>15,2246822507)>>>0,i=Math.imul(i^i>>>13,3266489909)>>>0,i=(i^i>>>16)>>>0,i/4294967296}function Jn(t,e,n){let i=n/Un;return{x:(t+.5+(se(t,e,1)-.5)*Nn)*i,y:(e+.5+(se(t,e,2)-.5)*Nn)*i}}function Bi(t,e,n,i){let r=1/0;for(let o=-1;o<=1;o++)for(let s=-1;s<=1;s++){if(o===0&&s===0)continue;let l=Jn(t+o,e+s,i);r=Math.min(r,Math.hypot(l.x-n.x,l.y-n.y))}return r*Gi}function Ni(t,e,n){let i=Math.cos(e),r=Math.sin(e),o=n*.8,s=n*.5;return[-1,0,1].map(l=>{let a=t.x-r*s*l,h=t.y+i*s*l;return[{x:a-i*o,y:h-r*o},{x:a+i*o,y:h+r*o}]})}function Zi(t,e){let n=!1;for(let i of t){if(i.length<3)continue;let r=i.length-1;for(let o=0;o<i.length;o++){let s=i[o],l=i[r];s.y>e.y!=l.y>e.y&&e.x<(l.x-s.x)*(e.y-s.y)/(l.y-s.y)+s.x&&(n=!n),r=o}}return n}function Ui(t,e){let n=1/0;for(let i of e)if(!(i.length<2))for(let r=0;r<i.length;r++){let o=i[r],s=i[(r+1)%i.length],l=s.x-o.x,a=s.y-o.y,h=l*l+a*a,u=h>0?Math.max(0,Math.min(1,((t.x-o.x)*l+(t.y-o.y)*a)/h)):0;n=Math.min(n,Math.hypot(t.x-(o.x+u*l),t.y-(o.y+u*a)))}return n}var Xi=(t,e)=>e.x>=t.x&&e.x<t.x+t.width&&e.y>=t.y&&e.y<t.y+t.height,oe=new Map;function Hn(t){if(t.length===0)return[];let e=t.map(r=>[r.kind,r.x,r.y,r.width,r.height,r.rotation??0,mt(r),JSON.stringify(r.subpaths??null),r.style.stroke.r,r.style.stroke.g,r.style.stroke.b,r.style.stroke.a,r.style.roughness,r.style.strokeWidth].join(",")).join(";"),n=oe.get(e);if(n)return n;let i=ji(t);return oe.size>=16&&oe.clear(),oe.set(e,i),i}function ji(t){let e=t.map(o=>{let s=Ne(o).map(f=>f.map(d=>j(o,d))),l=s.flat(),a=l.map(f=>f.x),h=l.map(f=>f.y),u=a.length?Math.min(...a):0,c=h.length?Math.min(...h):0,m={x:u,y:c,width:(a.length?Math.max(...a):0)-u,height:(h.length?Math.max(...h):0)-c};return{contours:s,box:m,cell:mt(o),element:o}}),n=e.map(()=>[]),i=new Set;for(let o of e){let s=o.cell/Un,l=Rt(o.box,-o.cell,-o.cell),a=Math.floor(l.x/s),h=Math.ceil((l.x+l.width)/s),u=Math.floor(l.y/s),c=Math.ceil((l.y+l.height)/s),m=Ge*o.cell;for(let f=a;f<h;f++)for(let d=u;d<c;d++){let p=`${o.cell}|${f}|${d}`;if(i.has(p))continue;i.add(p);let y=Jn(f,d,o.cell),g=1/0,P=-1;for(let x=0;x<e.length;x++){let M=e[x];if(!Xi(Rt(M.box,-m,-m),y))continue;if(Zi(M.contours,y)){g=0;break}let S=Ui(y,M.contours);S<g&&(g=S,P=x)}if(!(g>0&&g<=m&&P>=0))continue;let b=se(f,d,3)*Math.PI,T=Bi(f,d,y,o.cell),v=Math.trunc(se(f,d,4)*4294967296)>>>0;for(let[x,M]of Ni(y,b,T))n[P].push([x,M,v])}}let r=[];return e.forEach((o,s)=>{if(n[s].length===0)return;let l=o.element,a=new A;for(let[h,u,c]of n[s])l.style.roughness<=0?a.moveTo(h).lineTo(u):tt(h,u,new st(c),l.style.roughness*.35,.2,!1,a);r.push({ink:{...l.style.stroke,a:l.style.stroke.a*.6},width:Math.max(.8,l.style.strokeWidth*.45),path:a})}),r}var le=class{constructor(e=6e3){w(this,"map",new Map);w(this,"limit");this.limit=e}get(e,n){let i=this.map.get(e);if(i!==void 0)return i;let r=n();return this.map.size>=this.limit&&this.map.clear(),this.map.set(e,r),r}},qn=new le,Ji=new le;function Qn(t,e){let n=t.style;return[e,t.kind,t.x,t.y,t.width,t.height,t.seed,n.roughness,n.bowing,n.strokeWidth,n.fillStyle,n.fillStyle==="grid"?mt(t):0,t.path?t.path.join(","):t.subpaths?JSON.stringify(t.subpaths):""].join("|")}var mt=t=>Math.max(8,t.style.gridSize??50);function pt(t){return t.kind==="freehand"&&t.path===null?Kn(t):qn.get(Qn(t,0),()=>Kn(t))}function _n(t){return[{x:t.x,y:t.y},{x:G(t),y:t.y},{x:G(t),y:B(t)},{x:t.x,y:B(t)}]}function ae(t){return[{x:N(t),y:t.y},{x:G(t),y:Z(t)},{x:N(t),y:B(t)},{x:t.x,y:Z(t)}]}function Kn(t){let e=D(t),n=new st(t.seed),i=t.style.roughness;switch(t.kind){case"ellipse":return i<=0?A.ellipse(e):zn(e,n,i);case"diamond":return i<=0?new A().addLines(ae(e)).close():We(ae(e),n,i,t.style.bowing);case"text":case"connector":return A.rect(e);case"freehand":return Ki(t);case"path":return i<=0?Oe(t):Hi(t,n);default:return i<=0?A.rect(e):We(_n(e),n,i,t.style.bowing)}}function Hi(t,e){let n=t.style.roughness,i=new A;for(let r of Tt(t)){let o=r.points;for(let s=0;s<(o.length-1)/3;s++){let l=o[3*s],a=o[3*s+1],h=o[3*s+2],u=o[3*s+3];if(a.x===l.x&&a.y===l.y&&h.x===u.x&&h.y===u.y){tt(l,u,e,n,t.style.bowing,!0,i);continue}let c=Math.hypot(a.x-l.x,a.y-l.y)+Math.hypot(h.x-a.x,h.y-a.y)+Math.hypot(u.x-h.x,u.y-h.y),m=Math.min(2.5,c/30)*n;for(let f=0;f<2;f++){let d=f===0?1:.5,p=()=>e.signed()*m*d;i.moveTo(l);let y=a.x+p(),g=a.y+p(),P=h.x+p(),b=h.y+p();i.curveTo(u,{x:y,y:g},{x:P,y:b})}}}return i}function Ki(t){let e=D(t),n=t.path;if(n&&n.length>=8&&(n.length-2)%6===0){let o=l=>({x:e.x+n[2*l]*e.width,y:e.y+n[2*l+1]*e.height}),s=new A().moveTo(o(0));for(let l=0;l<Math.floor((n.length/2-1)/3);l++)s.curveTo(o(3*l+3),o(3*l+1),o(3*l+2));return s}let i=(t.points??[]).map(o=>({x:e.x+o.x*e.width,y:e.y+o.y*e.height})),r=new A;if(i.length===0)return r;if(r.moveTo(i[0]),i.length===1)return r.lineTo(i[0]);if(i.length===2)return r.lineTo(i[1]);for(let o=1;o<i.length-1;o++)r.quadTo({x:(i[o].x+i[o+1].x)/2,y:(i[o].y+i[o+1].y)/2},i[o]);return r.lineTo(i[i.length-1])}function Ne(t){return t.kind!=="path"?[qi(t)]:Tt(t).map(e=>En(e.points,3))}function qi(t){let e=D(t);if(t.kind==="ellipse"){let n=[];for(let i=0;i<48;i++){let r=2*Math.PI*i/48;n.push({x:N(e)+e.width/2*Math.cos(r),y:Z(e)+e.height/2*Math.sin(r)})}return n}return t.kind==="diamond"?ae(e):_n(e)}function ue(t){let e=D(t);return t.kind==="ellipse"?A.ellipse(e):t.kind==="path"?Oe(t):t.kind==="diamond"?new A().addLines(ae(e)).close():A.rect(e)}function Ze(t){return t.style.fillStyle==="solid"||["freehand","connector","text","image"].includes(t.kind)?new A:qn.get(Qn(t,1),()=>Qi(t))}function Qi(t){let e=Ne(t),n=new st((t.seed^1540483477)>>>0),i=new A;if(t.style.fillStyle==="grid"){for(let[s,l]of Xn(e,mt(t)))t.style.roughness<=0?i.moveTo(s).lineTo(l):tt(s,l,n,t.style.roughness*.3,.3,!1,i);return i}let r=Math.max(4,t.style.strokeWidth*4),o=[ze];t.style.fillStyle==="crossHatch"&&o.push(ze+Math.PI/2);for(let s of o)for(let[l,a]of Gn(e,s,r))t.style.roughness<=0?i.moveTo(l).lineTo(a):tt(l,a,n,t.style.roughness*.6,.5,!1,i);return i}function ce(t,e){switch(t){case"solid":return null;case"dashed":return[Math.max(8,e*4),Math.max(6,e*3)];case"dotted":return[.01,Math.max(5,e*2.6)]}}function Ue(t,e){let n=t.connector;if(!n)return[new A,new A];let[i,r]=_(t,e),o=[t.seed,t.style.roughness,t.style.bowing,t.style.strokeWidth,n.routing,n.startHead,n.endHead,n.start.port,n.end.port,i.x,i.y,r.x,r.y].join("|");return Ji.get(o,()=>_i(t,e))}function _i(t,e){let n=t.connector,i=new st(t.seed),r=t.style.roughness,o=t.style.bowing,s=new A,l=new A,a=ot(t,e);if(a.kind==="polyline"){let f=a.points;for(let d=0;d<Math.max(f.length-1,0);d++)r<=0?s.moveTo(f[d]).lineTo(f[d+1]):tt(f[d],f[d+1],i,r,o,!0,s)}else{s.moveTo(a.a);let f=r*3,d=()=>i.signed()*f,p=a.b.x+d(),y=a.b.y+d(),g=a.c.x+d(),P=a.c.y+d();s.curveTo(a.d,{x:p,y},{x:g,y:P})}let h=rt(a),u=Math.max(10,t.style.strokeWidth*5),c=(f,d)=>{r<=0?s.moveTo(f).lineTo(d):tt(f,d,i,r*.5,0,!0,s)},m=(f,d,p)=>{let[y,g]=On(d,p,u);switch(f){case"arrow":c(y,d),c(g,d);break;case"triangle":c(y,d),c(g,d),c(y,g),l.moveTo(d).lineTo(y).lineTo(g).close();break;case"dot":{let P=u*.32,b=Math.atan2(d.y-p.y,d.x-p.x),T=d.x-P*Math.cos(b),v=d.y-P*Math.sin(b);l.addEllipse({x:T-P,y:v-P,width:2*P,height:2*P});break}case"bar":{let P=Math.atan2(d.y-p.y,d.x-p.x)+Math.PI/2,b=u*.5;c({x:d.x-b*Math.cos(P),y:d.y-b*Math.sin(P)},{x:d.x+b*Math.cos(P),y:d.y+b*Math.sin(P)});break}}};return h.length>1&&(m(n.endHead,h[h.length-1],h[h.length-2]),m(n.startHead,h[0],h[1])),[s,l]}function Je(t,e){switch(t){case"linear":return e;case"easeIn":return e*e*e;case"easeOut":return 1-Math.pow(1-e,3);case"easeInOut":return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2;case"hold":return 0;case"spring":return tr(e);case"bounce":return er(e);case"elastic":return nr(e)}}function tr(t){if(t<=0)return 0;if(t>=1)return 1;let e=n=>1-Math.exp(-6*n)*(Math.cos(3*Math.PI*n)+6/(3*Math.PI)*Math.sin(3*Math.PI*n));return e(t)+t*(1-e(1))}function er(t){if(t<=0)return 0;if(t>=1)return 1;let e=7.5625,n=2.75;if(t<1/n)return e*t*t;if(t<2/n){let r=t-1.5/n;return e*r*r+.75}if(t<2.5/n){let r=t-2.25/n;return e*r*r+.9375}let i=t-2.625/n;return e*i*i+.984375}function nr(t){return t<=0?0:t>=1?1:Math.pow(2,-10*t)*Math.sin((t*10-.75)*(2*Math.PI/3))+1}var $t=(t,e)=>t%e;function Wt(t,e){let n=(t.repeats??[]).filter(Qt).slice().sort((i,r)=>i.start-r.start);if(n.length===0)return e;for(let i of n){if(!(e>=i.end))continue;let r=i.end-i.start;if(i.count===null)return i.start+$t(e-i.start,r);let o=r*i.count;if(e<i.start+o)return i.start+$t(e-i.start,r);e-=o-r}return e}function Xe(t,e,n,i,r){e=Wt(t,e);let o,s;for(let u of t.keys)if(n(u)!==void 0)if(u.t<=e)o=u;else{s=u;break}if(!o&&!s)return i;if(o&&!s)return n(o);if(!o&&s)return n(s);let l=o,a=s,h=a.t-l.t>0?(e-l.t)/(a.t-l.t):1;return r(n(l),n(a),Je(l.ease??"linear",h))}var ir=(t,e,n)=>t+(e-t)*n,he=(t,e,n)=>Math.min(Math.max(t+(e-t)*n,0),1),ti=(t,e,n)=>({r:he(t.r,e.r,n),g:he(t.g,e.g,n),b:he(t.b,e.b,n),a:he(t.a,e.a,n)});function lt(t,e,n,i){return Xe(t,e,r=>r[n],i,ir)}function rr(t,e){e=Wt(t,e);let n=(r,o)=>{let s;for(let a of t.keys)a.t<=e&&r(a)!==void 0&&(s=a);let l=t.keys.find(a=>a.t>e&&r(a)!==void 0);return!s||!l?!1:s.ease!=="hold"&&!o(r(s),r(l))},i=r=>n(o=>o[r],(o,s)=>o===s);return i("x")||i("y")||i("width")||i("height")||i("rotation")||i("strokeWidth")||n(r=>r.stroke,kt)||n(r=>r.fill,kt)||i("reveal")||i("opacity")}function je(t,e){e=Wt(t,e);let n=t.keys.filter(r=>r.visible!==void 0);if(n.length===0)return!0;let i;for(let r of n)r.t<=e&&(i=r);return i?i.visible:!n[0].visible}function or(t,e,n){if(e=C(e),t.keys.some(i=>i.reveal!==void 0)){let i=lt(t,n,"reveal",e.reveal??1);e.reveal=i>=1?null:Math.max(0,i)}if(t.keys.some(i=>i.opacity!==void 0)){let i=Math.min(Math.max(lt(t,n,"opacity",e.style.opacity??1),0),1);e.style.opacity=i>=1?null:i}return e.kind==="connector"||(e.x=lt(t,n,"x",e.x),e.y=lt(t,n,"y",e.y),e.width=Math.max(0,lt(t,n,"width",e.width)),e.height=Math.max(0,lt(t,n,"height",e.height)),t.keys.some(i=>i.rotation!==void 0)&&(e.rotation=lt(t,n,"rotation",V(e))),e.style.strokeWidth=Math.max(0,lt(t,n,"strokeWidth",e.style.strokeWidth)),e.style.stroke=Xe(t,n,i=>i.stroke,e.style.stroke,ti),e.style.fill=Xe(t,n,i=>i.fill,e.style.fill,ti)),e}function sr(t,e){e=Wt(t,e);let n=null;for(let r of t.follow??[])r.start<=e&&(n===null||r.start>n.start)&&(n=r);if(!n)return null;let i=n;return t.keys.some(r=>r.t>=i.end&&r.t<=e&&(r.x!==void 0||r.y!==void 0))?null:n}function lr(t,e){if(t.kind==="connector")return new Mt(rt(ot(t,J(e))));let n=C(t);n.style.roughness=0;let i=pt(n).contours()[0]??[];return new Mt(V(t)===0?i:i.map(r=>j(t,r)))}function ar(t,e,n,i){let r=sr(t,n);if(!r)return e;n=Wt(t,n);let o=i.elements.find(c=>c.id===r.path);if(!o||o.id===e.id)return e;let s=lr(o,i),l=r.end-r.start,a=Math.min(Math.max(Je(r.ease??"easeInOut",l>0?Math.min(1,(n-r.start)/l):1),0),1)*(r.laps??1);a>1&&(a=$t(a,1)===0?1:$t(a,1)),r.reverse===!0&&(a=1-a);let h=s.point(a),u=C(e);if(u.x=h.x-e.width/2,u.y=h.y-e.height/2,r.orient===!0){let c=r.reverse===!0?-.01:.01,m=s.point(a-c/2),f=s.point(a+c/2);(m.x!==f.x||m.y!==f.y)&&(u.rotation=Math.atan2(f.y-m.y,f.x-m.x))}return u}function ur(t,e,n,i){if(!(n>0))return 0;let r=O(t.duration);if(r>0){let s=Ct(e*r/n);s!==0&&(e=s*n/r)}let o=$t(e*i,n);return o<0?-o:o===0?0:n-o}function cr(t){let e=new Map;for(let n of t.tracks)e.has(n.element)||e.set(n.element,n);return e}function H(t,e){return U(zt(t,e),O(e))}function zt(t,e){let n=t.timeline;if(!n)return t;e=O(e);let i=cr(n),r=n.boil===null?null:Math.trunc(Math.floor(e*wt(n.fps)+1e-9)/Math.max(1,n.boil))%ve>>>0,o=new Set;for(let f of i.values())je(f,e)||o.add(f.element);let s=null;if(n.settle===!0){s=new Set;for(let f of i.values())rr(f,e)&&s.add(f.element)}let l=f=>{let d=i.get(f.id)?.boil;return d??(s?f.connector?[f.connector.start.elementID,f.connector.end.elementID].some(p=>p!==null&&s.has(p)):s.has(f.id):!0)},a=t.elements.map(f=>{let d=i.get(f.id),p=d?or(d,f,e):f;r!==null&&r>0&&l(f)&&(p===f&&(p=C(f)),p.seed=re(f.seed,r));let y=d?.march!=null?ce(p.style.dash,p.style.strokeWidth):null;return d?.march!=null&&y&&(p===f&&(p=C(f)),p.style.dashOffset=ur(n,d.march,y.reduce((g,P)=>g+P,0),e)),p});a=a.map((f,d)=>o.has(f.id)?t.elements[d]:f);let h={...t,elements:a,timeline:null};a=a.map(f=>{let d=i.get(f.id);return d?ar(d,f,e,h):f});let u={...t,elements:a,timeline:null},c=J(u),m=new Set(o);return a=a.map(f=>{let d=f.connector;if(!d||![d.start.elementID,d.end.elementID].some(P=>P!==null&&o.has(P)))return f;if(!(i.get(f.id)?.keys.some(P=>P.visible!==void 0)??!1))return m.add(f.id),f;let[p,y]=_(f,c),g=C(f);return g.connector.start={elementID:null,port:d.start.port,x:p.x,y:p.y},g.connector.end={elementID:null,port:d.end.port,x:y.x,y:y.y},g}),{...t,elements:a.filter(f=>!m.has(f.id)),timeline:null}}function at(t){return t.timeline?t.timeline.poster??t.timeline.duration:0}function ni(t){return t.timeline?H(t,at(t)):U(t,0)}function hr(t,e){let n=t.camera??[];if(n.length===0)return null;let i;for(let l of n)l.t<=e&&(i=l);let r=n.find(l=>l.t>e);if(!i)return ei(n[0]);if(!r)return ei(i);let o=Je(i.ease??"easeInOut",(e-i.t)/Math.max(r.t-i.t,1e-9)),s=(l,a)=>l+(a-l)*o;return{x:s(i.x,r.x),y:s(i.y,r.y),width:Math.max(1,s(i.width,r.width)),height:Math.max(1,s(i.height,r.height))}}var ei=t=>({x:t.x,y:t.y,width:t.width,height:t.height});function vt(t,e){let n=t.camera?.[0],i=hr(t,e);return!n||!i||!(i.width>0&&i.height>0)?null:fr(i,n.width/n.height)}function fr(t,e){if(!(t.width>0&&t.height>0&&e>0))return t;let n=t.width,i=t.height;return t.width/t.height<e?n=t.height*e:i=t.width/e,{x:t.x+t.width/2-n/2,y:t.y+t.height/2-i/2,width:n,height:i}}function dr(t){return Math.max(1,Math.ceil(O(t.duration)*wt(t.fps)))}function fe(t){let e=wt(t.fps),n=[];for(let r=0;r<dr(t);r++)n.push(r/e);let i=n[n.length-1];return t.duration-i>1e-6&&n.push(t.duration),n}function ii(t,e){let n=-1;return(t.markers??[]).forEach((i,r)=>{i.t<=e&&(n=r)}),n}function ri(t){let e=t.timeline;if(!e)return new Set;let n=e.poster??e.duration;return new Set(e.tracks.filter(i=>!je(i,0)&&!je(i,n)).map(i=>i.element))}var mr=8,pr=2e4,He=1e-9;function de(t,e){let n=(t.timeline?.markers??[]).find(i=>i.name.toLowerCase()===e);return n?Math.min(Math.max(n.t,0),O(t.timeline?.duration??0)):null}function Bt(t,e){switch(e){case"up":return de(t,"up")??0;case"over":return de(t,"over")??Bt(t,"up");case"down":return de(t,"down")??Bt(t,"over");default:return de(t,"hit")}}function yr(t,e,n,i){let r=O(t.timeline?.duration??0);if(t.button===!0)return Bt(t,"up")??0;let o=i!==null&&Number.isFinite(i)?i:0;switch(n??"loop"){case"still":return Math.min(t.timeline?.poster??r,r);case"click":return Math.min(Math.max(o,0),r);case"once":return Math.min(Math.max(e+o,0),r);default:{if(r<=0)return 0;let s=e+o,l=s%r;return l<0&&(l+=r),s>He&&(l<He||r-l<He)?r:l}}}function gr(t,e){let n=t.params;if(!n||Object.keys(n).length===0)return t;let i=new Map(Object.entries(n));for(let[o,s]of Object.entries(e??{}))i.has(o)&&i.set(o,s);let r=o=>o.includes("{{")?o.replace(/\{\{\s*([^{}]*?)\s*\}\}/g,(s,l)=>i.get(l)??s):o;return{...t,elements:t.elements.map(o=>{if(o.text===null&&o.args===null)return o;let s=C(o);return s.text!==null&&(s.text=r(s.text)),s.args!==null&&(s.args=Object.fromEntries(Object.entries(s.args).map(([l,a])=>[l,r(a)]))),s})}}function br(t){return{id:t.id,name:t.name,layers:t.layers,elements:t.elements,theme:null,timeline:t.timeline,symbols:null}}function me(t){return t.elements.some(e=>e.kind==="symbol")}function U(t,e,n=!0,i=new Map){if(!me(t))return t;let r={left:pr};return{...t,elements:si(t.elements,t,e,Qe(t),[],n,r,i)}}function Qe(t){let e=new Map;for(let n of t.symbols??[])e.has(n.id)||e.set(n.id,n);return e}function si(t,e,n,i,r,o,s,l=new Map){let a=new Set(t.filter(c=>c.kind==="symbol").map(c=>c.id));if(a.size===0)return s.left-=t.length,t;let h=J(e),u=[];for(let c of t){if(s.left<=0)break;let m=c.connector;if(c.kind==="connector"&&m&&[m.start.elementID,m.end.elementID].some(v=>v!==null&&a.has(v))){let[v,x]=_(c,h),M=C(c);m.start.elementID!==null&&a.has(m.start.elementID)&&(M.connector.start={elementID:null,port:m.start.port,x:v.x,y:v.y}),m.end.elementID!==null&&a.has(m.end.elementID)&&(M.connector.end={elementID:null,port:m.end.port,x:x.x,y:x.y}),u.push(M),s.left-=1;continue}if(c.kind!=="symbol"){u.push(c),s.left-=1;continue}s.left-=1;let f=c.symbol,d=f===null?void 0:i.get(f);if(f===null||!d||r.includes(f)||r.length>=mr)continue;let p=r.length===0?l.get(c.id):void 0,y=p!==void 0?Math.min(Math.max(p,0),O(d.timeline?.duration??0)):yr(d,n,c.playback,c.offset),g=br(gr(d,c.args)),P=o?zt(g,y):g,b=new Set(P.layers.filter(v=>v.visible).map(v=>v.id)),T={...P,elements:ft(P).filter(v=>b.has(v.layerID)),layers:[{id:c.layerID,name:"",visible:!0,locked:!1}]};for(let v of si(T.elements,T,y,i,[...r,f],o,s))u.push(xr(v,c,d))}return u}function xr(t,e,n){let i={x:e.x,y:e.y,width:e.width,height:e.height},r=i.width/n.width,o=i.height/n.height,s=Math.sqrt(Math.abs(r*o)),l={x:i.x+i.width/2,y:i.y+i.height/2},a=V(e),h=f=>it({x:i.x+f.x*r,y:i.y+f.y*o},l,a),u=C(t);u.id=qe(e.id,t.id),u.layerID=e.layerID,u.groupID=null,u.link=t.link===null?null:qe(e.id,t.link),u.seed=re(t.seed,e.seed),u.click=null,u.hover=null;let c={x:i.x+t.x*r,y:i.y+t.y*o,width:t.width*r,height:t.height*o},m=it({x:c.x+c.width/2,y:c.y+c.height/2},l,a);if(u.x=m.x-c.width/2,u.y=m.y-c.height/2,u.width=c.width,u.height=c.height,(a!==0||t.rotation!==null)&&(u.rotation=V(t)+a),u.style.strokeWidth=t.style.strokeWidth*s,u.style.fontSize=t.style.fontSize*s,t.style.gridSize!==null&&(u.style.gridSize=t.style.gridSize*s),e.style.opacity!==null&&(u.style.opacity=(t.style.opacity??1)*e.style.opacity),t.connector){let f=d=>{if(d.elementID!==null)return{elementID:qe(e.id,d.elementID),port:d.port,x:d.x,y:d.y};let p=h(d);return{elementID:null,port:d.port,x:p.x,y:p.y}};u.connector={...t.connector,start:f(t.connector.start),end:f(t.connector.end)}}return u}var Ke=(1n<<64n)-1n;function Gt(t){let e=t+0x9e3779b97f4a7c15n&Ke;return e=(e^e>>30n)*0xbf58476d1ce4e5b9n&Ke,e=(e^e>>27n)*0x94d049bb133111ebn&Ke,e^e>>31n}function oi(t){let e=t.replace(/-/g,"").padStart(32,"0").slice(-32);return[BigInt(`0x${e.slice(0,16)}`),BigInt(`0x${e.slice(16)}`)]}function qe(t,e){let[n,i]=oi(t),[r,o]=oi(e),s=Gt(Gt(Gt(Gt(n)^i)^r)^o),l=Gt(s^0x6a09e667f3bcc909n),a=s.toString(16).padStart(16,"0")+l.toString(16).padStart(16,"0");return`${a.slice(0,8)}-${a.slice(8,12)}-${a.slice(12,16)}-${a.slice(16,20)}-${a.slice(20)}`.toUpperCase()}function kr(t,e){let n=e.findIndex(i=>i.name===t);return n>=0?n:e.findIndex(i=>i.name.toLowerCase()===t.toLowerCase())}function li(t,e){let n=t.timeline?.markers??[],i=new Map,r=null;for(let o of t.elements){let s=o.click;if(s?.scene){let a=kr(s.scene,n);if(a>=0){i.set(o.id,{scene:a});continue}}let l=(s?.url?ht(s.url):null)??Lt(o.url);if(l){i.set(o.id,{url:l});continue}if(o.link&&e&&e.pages.length>1){r||(r=new Map,e.pages.forEach((h,u)=>{for(let c of h.elements)r.has(c.id)||r.set(c.id,u)}));let a=r.get(o.link);a!==void 0&&e.pages[a]!==t&&i.set(o.id,{page:a})}}return i}function wr(t){let e=t.hover;if(!e)return t;let n={...t.style};if(e.stroke&&(n.stroke=e.stroke),e.fill&&(n.fill=e.fill),e.opacity!==null&&Number.isFinite(e.opacity)){let i=Math.min(Math.max(e.opacity,0),1);n.opacity=i>=1?null:i}return{...t,style:n}}function ai(t,e){return{...t,elements:t.elements.map(n=>e.has(n.id)?wr(n):n)}}function ui(t){return!!t.hover&&(t.hover.stroke!==null||t.hover.fill!==null||t.hover.opacity!==null)}function ci(t,e){let n=(t.text??"").split(`
|
|
3
|
+
`).find(i=>i.length>0);return n||(t.anchor?t.anchor:e||t.kind)}function hi(t,e){let n=new Map;for(let i of t.elements){if(!e.has(i.id)||i.kind!=="symbol")continue;let r={...t,layers:[{id:i.layerID,name:"",visible:!0,locked:!1}],elements:[i]};for(let o of U(r,0,!1).elements)n.set(o.id,i.id)}return n}var fi=`
|
|
4
4
|
.dottie-a { cursor: pointer; outline: none; }
|
|
5
5
|
.dottie-a .dottie-h { display: none; }
|
|
6
6
|
.dottie-a:hover .dottie-h, .dottie-a.dottie-hover .dottie-h, .dottie-a:focus-visible .dottie-h { display: inline; }
|
|
@@ -10,47 +10,47 @@
|
|
|
10
10
|
.dottie-a .dottie-d { display: none; }
|
|
11
11
|
.dottie-b:active .dottie-n, .dottie-b:active .dottie-h, .dottie-b.dottie-press .dottie-n, .dottie-b.dottie-press .dottie-h { display: none; }
|
|
12
12
|
.dottie-b:active .dottie-d, .dottie-b.dottie-press .dottie-d { display: inline; }
|
|
13
|
-
`;
|
|
13
|
+
`;function Y(t){let e=n=>Math.round(Math.min(Math.max(n,0),1)*255).toString(16).padStart(2,"0");return`#${e(t.r)}${e(t.g)}${e(t.b)}`}function Nt(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}var di=12,yt="\u2028";function Pr(t){let e=Math.min(di,t.width/2),n=Math.min(di,t.height/2);return{x:t.x+e,y:t.y+n,width:t.width-2*e,height:t.height-2*n}}var tn=/^ {0,3}(#{1,6})(?:[ \t]+(.*?))?(?:[ \t]+#+)?[ \t]*$/,gi=/^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/,en=/^ {0,3}(`{3,}|~{3,})/,Zt=/^( *)([-*+]|\d{1,9}[.)])([ \t]+|$)(.*)$/,pe=/^ {0,3}> ?(.*)$/,Mr=/^ *\|? *:?-+:? *(\| *:?-+:? *)*\|? *$/;function _e(t){let e=t.trim();return e.startsWith("|")&&(e=e.slice(1)),e.endsWith("|")&&!e.endsWith("\\|")&&(e=e.slice(0,-1)),e.split(/(?<!\\)\|/).map(n=>n.trim())}function Rr(t){return sn(t.replace(/\r\n?/g,`
|
|
14
14
|
`).split(`
|
|
15
|
-
`))}function
|
|
16
|
-
`))}),i=null)};for(;n<t.length;){let o=t[n];if(o.trim()===""){r(),n++;continue}let s=
|
|
17
|
-
`)});continue}let l=
|
|
18
|
-
`))}),i=null,n++;continue}if(
|
|
19
|
-
`)){for(o+=
|
|
20
|
-
`){for(o=o.replace(/ +$/,""),o+=
|
|
21
|
-
`,size:i,bold:!1,italic:!1,mono:!1,strike:!1,underline:!1,alpha:1}]:
|
|
22
|
-
`){
|
|
23
|
-
`&&
|
|
24
|
-
`,"").replaceAll(
|
|
25
|
-
`)}let
|
|
26
|
-
`;return
|
|
27
|
-
`;return n&&e&&(i+=`<rect x="${k(t.x)}" y="${k(t.y)}" width="${k(t.width)}" height="${k(t.height)}" fill="${
|
|
28
|
-
`),i}function ut(t,e,n,i=!1){if(
|
|
29
|
-
`).join("");
|
|
30
|
-
${
|
|
31
|
-
`),y<1&&(
|
|
32
|
-
${
|
|
33
|
-
`);let
|
|
34
|
-
${
|
|
35
|
-
`),u.push({key:p.id,markup:
|
|
36
|
-
`}function
|
|
37
|
-
`:`<path d="${
|
|
38
|
-
`;switch(t.kind){case"connector":{let[a,
|
|
39
|
-
`;if(
|
|
40
|
-
`),s){let
|
|
41
|
-
`),u+=
|
|
42
|
-
`}return t.style.stroke.a>0&&t.style.strokeWidth>0&&(
|
|
43
|
-
`),
|
|
44
|
-
`;case"rectangle":case"ellipse":case"diamond":case"path":case"note":{let a="";if(t.kind==="note"&&t.style.fill.a>0&&(a+=`<path d="${
|
|
45
|
-
`),t.style.fill.a>0){let
|
|
46
|
-
`;else if(t.style.fillStyle==="grid"){let u
|
|
47
|
-
`,a+=`<path d="${
|
|
48
|
-
`}else a+=`<path d="${
|
|
49
|
-
`}return a+=`<path d="${
|
|
50
|
-
`,s&&(a+=t.kind==="note"?
|
|
51
|
-
`+
|
|
52
|
-
`),s=r*1.2,l=s*o.length,a=i?
|
|
53
|
-
`}var
|
|
15
|
+
`))}function sn(t){let e=[],n=0,i=null,r=()=>{i&&(e.push({kind:"paragraph",inline:K(i.join(`
|
|
16
|
+
`))}),i=null)};for(;n<t.length;){let o=t[n];if(o.trim()===""){r(),n++;continue}let s=en.exec(o);if(s){r();let h=new RegExp(`^ {0,3}${s[1][0]==="`"?"`":"~"}{${s[1].length},}[ \\t]*$`),u=[];for(n++;n<t.length&&!h.test(t[n]);)u.push(t[n++]);n++,e.push({kind:"code",text:u.join(`
|
|
17
|
+
`)});continue}let l=tn.exec(o);if(l){r(),e.push({kind:"heading",level:l[1].length,inline:K(l[2]??"")}),n++;continue}if(i&&/^ {0,3}(=+|-+)[ \t]*$/.test(o)){let h=o.trim()[0]==="="?1:2;e.push({kind:"heading",level:h,inline:K(i.join(`
|
|
18
|
+
`))}),i=null,n++;continue}if(gi.test(o)){r(),e.push({kind:"rule"}),n++;continue}if(pe.test(o)){r();let h=[];for(;n<t.length&&t[n].trim()!=="";){let u=pe.exec(t[n]);h.push(u?u[1]:t[n]),n++}e.push({kind:"quote",children:sn(h)});continue}let a=Zt.exec(o);if(a&&(!i||a[4].trim()!=="")){r();let h=Tr(t,n);e.push(h.block),n=h.next;continue}if(!i&&o.includes("|")&&n+1<t.length&&Mr.test(t[n+1])&&t[n+1].includes("-")){let h=_e(o),u=_e(t[n+1]).map(m=>m.startsWith(":")&&m.endsWith(":")?"center":m.endsWith(":")?"right":m.startsWith(":")?"left":null),c=[];for(n+=2;n<t.length&&t[n].trim()!==""&&!tn.test(t[n])&&!pe.test(t[n])&&!en.test(t[n]);)c.push(_e(t[n]).slice(0,h.length).map(m=>K(m))),n++;e.push({kind:"table",align:u,head:h.map(m=>K(m)),rows:c});continue}i||(i=[]),i.push(o.replace(/^ +/,"")),n++}return r(),e}function Tr(t,e){let n=Zt.exec(t[e]),i=n[1].length,r=/^\d/.test(n[2])?null:n[2],o=r===null?parseInt(n[2],10):null,s=[],l=e;for(;l<t.length;){let a=Zt.exec(t[l]);if(!a||a[1].length!==i||r===null!==/^\d/.test(a[2])||r!==null&&a[2]!==r)break;let h=a[1].length+a[2].length+Math.max(1,Math.min(a[3].length,4)),u=[a[4]];l++;let c=!1;for(;l<t.length;){let d=t[l];if(d.trim()===""){c=!0,u.push(""),l++;continue}if(d.length-d.trimStart().length>=h){u.push(d.slice(h)),c=!1,l++;continue}if(!c&&!Zt.test(d)&&!tn.test(d)&&!pe.test(d)&&!en.test(d)&&!gi.test(d)){u.push(d.trimStart()),l++;continue}break}for(;u.length&&u[u.length-1].trim()==="";)u.pop();let m=null,f=/^\[([ xX])\](?:[ \t]+|$)/.exec(u[0]??"");if(f&&(m=f[1]!==" ",u[0]=u[0].slice(f[0].length)),s.push({checkbox:m,children:sn(u)}),c&&l<t.length&&t[l-1]?.trim()===""){let d=Zt.exec(t[l]);if(!d||d[1].length!==i)break}}return{block:{kind:"list",ordered:o,items:s},next:l}}function K(t,e={}){let n=[],i=(l,a)=>{l&&n.push({...a,text:l})},r=0,o="",s=()=>{i(o,e),o=""};for(;r<t.length;){let l=t.slice(r),a;if(l[0]==="\\"&&/^\\[\\`*_{}[\]()#+\-.!|~>]/.test(l)){o+=l[1],r+=2;continue}if(l.startsWith(`\\
|
|
19
|
+
`)){for(o+=yt,r+=2;t[r]===" ";)r++;continue}if(l[0]===`
|
|
20
|
+
`){for(o=o.replace(/ +$/,""),o+=yt,r++;t[r]===" ";)r++;continue}if(a=/^(`+)([\s\S]*?[^`])\1(?!`)/.exec(l)){s();let h=a[2].replace(/\n/g," ");/^ .* $/.test(h)&&(h=h.slice(1,-1)),i(h,{...e,mono:!0}),r+=a[0].length;continue}if(a=/^!\[([^\]]*)\]\([^)]*\)/.exec(l)){s(),n.push(...K(a[1],e)),r+=a[0].length;continue}if(a=/^\[([^\]]+)\]\([^)]*\)/.exec(l)){s(),n.push(...K(a[1],{...e,link:!0})),r+=a[0].length;continue}if(a=/^<((?:https?|ftp|mailto):[^>\s]+)>/.exec(l)){s(),i(a[1],{...e,link:!0}),r+=a[0].length;continue}if(a=/^~~(?=\S)([\s\S]*?\S)~~/.exec(l)){s(),n.push(...K(a[1],{...e,strike:!0})),r+=a[0].length;continue}if(a=/^(\*\*|__)(?=\S)([\s\S]*?\S)\1/.exec(l)){s(),n.push(...K(a[2],{...e,bold:!0})),r+=a[0].length;continue}if((a=/^(\*|_)(?=\S)([\s\S]*?\S)\1(?!\1)/.exec(l))&&(a[1]==="*"||!/\w/.test(t[r-1]??""))){s(),n.push(...K(a[2],{...e,italic:!0})),r+=a[0].length;continue}o+=l[0],r++}return s(),vr(n)}function vr(t){let e=/\b(?:(?:https?|ftp):\/\/|www\.)[^\s<]*[^\s<.,:;"')\]!?]/g;return t.flatMap(n=>{if(n.link||n.mono||!(n.text.includes("://")||n.text.includes("www.")))return[n];let i=[],r=0;for(let o of n.text.matchAll(e))o.index>r&&i.push({...n,text:n.text.slice(r,o.index)}),i.push({...n,text:o[0],link:!0}),r=o.index+o[0].length;return r<n.text.length&&i.push({...n,text:n.text.slice(r)}),i})}function ge(t,e){return t.mono?dt[_t]:e}function ye(t,e,n){let i=ge(e,n);if(e.mono&&i.fallback[t]===void 0)return wn*e.size;let r=i.faces[Ot(i,e.bold,e.italic)];return(r.w[t]??i.faces.regular.w[t]??r.w.n)*e.size/1e3}function nn(t,e,n,i){return n.mono?0:(i.faces[Ot(i,n.bold,n.italic)].k[t+e]??0)*n.size/1e3}function rn(t,e,n){let i=ge(e,n).fallback[t];if(i)return[i[0]*e.size,i[1]*e.size,i[2]*e.size];if(e.mono)return[Pn*e.size,Mn*e.size,0];let r=n.faces[Ot(n,e.bold,e.italic)];return[r.ascent*e.size,r.descent*e.size,r.leading*e.size]}var on=class{constructor(e,n,i){w(this,"paras",[]);w(this,"nextSpacing",null);w(this,"fontSize");w(this,"width");w(this,"fam");this.fontSize=e,this.width=n,this.fam=i}get gap(){return this.fontSize*.5}spacing(e){return this.paras.length===0?0:this.nextSpacing??e}run(e,n,i,r={}){let o=!!e.mono;return{text:e.text,size:o?n*.9:n,bold:!!(e.bold||r.bold),italic:!!(e.italic||r.italic),mono:o,strike:!!e.strike,underline:!!e.link,alpha:i}}paragraph(e,n){this.paras.push({tabs:[],rule:null,tableRule:null,...e,quote:n}),this.nextSpacing=null}text(e,n,i,r={}){if(n.marker){let o={text:n.marker.text+" ",size:this.fontSize,bold:!1,italic:!1,mono:!1,strike:!1,underline:!1,alpha:1};this.paragraph({runs:[o,...e],spacing:i,firstIndent:n.marker.start,indent:n.marker.hang,tabs:[{align:"left",x:n.marker.hang}],...r},n.quote)}else this.paragraph({runs:e,spacing:i,firstIndent:n.indent,indent:n.indent,...r},n.quote)}block(e,n){let i=n.quote!==null,r=i?.7:1;switch(e.kind){case"heading":{let o=[1.5,1.3,1.15,1.05,1,1][Math.min(Math.max(e.level,1),6)-1];this.text(e.inline.map(s=>this.run(s,this.fontSize*o,r,{bold:!0,italic:i})),n,this.spacing(this.gap*1.4));break}case"paragraph":this.text(e.inline.map(o=>this.run(o,this.fontSize,r,{italic:i})),n,this.spacing(this.gap));break;case"list":{let o=e.items.map((h,u)=>h.checkbox===!0?"\u2611":h.checkbox===!1?"\u2610":e.ordered!==null?`${e.ordered+u}.`:n.listDepth%2===0?"\u2022":"\u25E6"),s=h=>mi({text:h,size:this.fontSize,bold:!1,italic:!1,mono:!1,strike:!1,underline:!1,alpha:1},this.fam),l=Math.max(0,...o.map(s)),a=n.indent+Math.max(l+this.fontSize*.45,this.fontSize*1.2);e.items.forEach((h,u)=>{(u>0||n.listDepth>0||n.marker)&&(this.nextSpacing=this.fontSize*.15);let c={...n,marker:{text:o[u],start:n.indent,hang:a},indent:a,listDepth:n.listDepth+1};h.children.length===0&&this.text([],c,this.spacing(this.gap));for(let m of h.children)this.block(m,c),c.marker=null,this.nextSpacing=this.fontSize*.3;this.nextSpacing=null});break}case"quote":{let o={...n,quote:n.indent+3,indent:n.indent+this.fontSize};for(let s of e.children)this.block(s,o);break}case"code":{let s={text:e.text===""?" ":e.text.replace(/\n/g,yt),size:this.fontSize*.85,bold:!1,italic:!1,mono:!0,strike:!1,underline:!1,alpha:r};this.text([s],{...n,indent:n.indent+this.fontSize*.5},this.spacing(this.gap));break}case"rule":{let o={text:" ",size:this.fontSize*.6,bold:!1,italic:!1,mono:!1,strike:!1,underline:!1,alpha:1};this.text([o],n,this.spacing(this.gap),{rule:n.indent});break}case"table":this.table(e,n);break}}table(e,n){let i=[{cells:e.head,header:!0},...e.rows.map(b=>({cells:b,header:!1}))],r=Math.max(1,...i.map(b=>b.cells.length)),o=n.quote!==null,s=(b,T,v)=>b.map(x=>({...this.run({...x,text:x.text.replaceAll(yt," ")},v,o?.7:1,{bold:T,italic:o})})),l=b=>{let T=new Array(r).fill(0);for(let v of i)v.cells.forEach((x,M)=>{M<r&&(T[M]=Math.max(T[M],s(x,v.header,b).reduce((S,F)=>S+mi(F,this.fam),0)))});return T},a=Math.max(this.width-n.indent,1),h=this.fontSize,u=l(h),c=h*1.2,m=u.reduce((b,T)=>b+T,0)+c*(r-1);m>a&&(h=Math.max(this.fontSize*a/m,Math.min(this.fontSize,9)),u=l(h),c=h*1.2);let f=[],d=n.indent;for(let b of u)f.push(d),d+=b+c;let p=d-c-n.indent,y=[],g=!1;for(let b=0;b<r;b++){let T=e.align[b]??null;T==="center"?y.push({align:"center",x:f[b]+u[b]/2}):T==="right"?y.push({align:"right",x:f[b]+u[b]}):b>0&&y.push({align:"left",x:f[b]}),b===0&&(T==="center"||T==="right")&&(g=!0)}let P=b=>({text:b,size:h,bold:!1,italic:!1,mono:!1,strike:!1,underline:!1,alpha:1});i.forEach((b,T)=>{let v=[];g&&v.push(P(" "));for(let M=0;M<r;M++)M>0&&v.push(P(" ")),M<b.cells.length&&v.push(...s(b.cells[M],b.header,h));v.length===0&&v.push(P(" "));let x=T===0?this.spacing(this.gap):T===1?h*.45:h*.2;this.paragraph({runs:v,spacing:x,firstIndent:n.indent,indent:n.indent,tabs:y,tableRule:b.header?[n.indent,p]:null},n.quote)})}};function mi(t,e){let n=0,i="";for(let r of t.text)n+=ye(r,t,e),i&&(n+=nn(i,r,t,e)),i=r;return n}var pi=28;function Sr(t,e,n,i,r){let o=[],s=0,l=null;return t.forEach((a,h)=>{let u=h<t.length-1?[...a.runs,{text:`
|
|
21
|
+
`,size:i,bold:!1,italic:!1,mono:!1,strike:!1,underline:!1,alpha:1}]:a.runs,c=[];u.forEach((d,p)=>{for(let y of d.text)c.push({ch:y,run:p})});let m=0,f=!0;for(;m<c.length||f&&c.length===0;){let d=f?a.firstIndent:a.indent,p=e,y=[],g=d,P=-1,b=m;for(;b<c.length;b++){let{ch:S,run:F}=c[b],Kt=u[F];if(S===yt||S===`
|
|
22
|
+
`){y.push({ch:S,run:F,x:g,w:0}),b++;break}if(S===" "){let nt=a.tabs.find(It=>It.x>g+.01),Et;if(nt)if(nt.align==="left")Et=nt.x;else{let It=0,Me="";for(let q=b+1;q<c.length&&c[q].ch!==" "&&c[q].ch!==`
|
|
23
|
+
`&&c[q].ch!==yt;q++){let dn=u[c[q].run];It+=ye(c[q].ch,dn,r)+(Me?nn(Me,c[q].ch,dn,r):0),Me=c[q].ch}Et=Math.max(g,nt.align==="right"?nt.x-It:nt.x-It/2)}else Et=(Math.floor(g/pi)+1)*pi;y.push({ch:S,run:F,x:g,w:Et-g}),g=Et;continue}let X=y[y.length-1],we=X&&X.run===F&&X.ch!==" "?nn(X.ch,S,Kt,r):0;X&&(X.w+=we,g+=we);let Pe=ye(S,Kt,r);if(S!==" "&&g+Pe>p+.01&&y.some(nt=>nt.ch!==" ")){P>=0&&(y.length=P+1,b=m+P+1),X&&(X.w-=we);break}y.push({ch:S,run:F,x:g,w:Pe}),g+=Pe,Ee(S,c[b+1]?.ch??"")&&(P=y.length-1)}if(y.length===0&&b===m&&m<c.length){let{ch:S,run:F}=c[m];y.push({ch:S,run:F,x:d,w:ye(S,u[F],r)}),b=m+1}let T=0,v=0,x=0;for(let S of y){let[F,Kt,X]=rn(S.ch,u[S.run],r);T=Math.max(T,F),v=Math.max(v,Kt),x=Math.max(x,X)}if(y.length===0&&([T,v,x]=rn(" ",u[0]??{text:" ",size:i,bold:!1,italic:!1,mono:!1,strike:!1,underline:!1,alpha:1},r)),s=l?s+Math.round(l.desc)+Math.round(l.lead)+(f?a.spacing:0)+Math.round(T):Math.round(T),s+v>n+.5)return;let M={glyphs:y,asc:T,desc:v,lead:x,baseline:s,para:a,first:f};if(M.glyphs.forEach(S=>{S.r=u[S.run]}),o.push(M),l=M,f=!1,m=b,c.length===0)break}}),o}function bi(t,e){let n=Pr({x:e.x,y:e.y,width:e.width,height:e.height});if(!(n.width>1&&n.height>1))return"";let i=te(e.style.font),r=new on(e.style.fontSize,n.width,i);for(let u of Rr(t))r.block(u,{indent:0,marker:null,quote:null,listDepth:0});let o=Sr(r.paras,n.width,n.height,e.style.fontSize,i),s=Y(e.style.stroke),l="",a=[];for(let u of o){let c=u.para;if(c.quote!==null&&a.push([n.x+c.quote,n.y+u.baseline-u.asc,n.x+c.quote,n.y+u.baseline+u.desc]),c.rule!==null&&a.push([n.x+c.rule,n.y+u.baseline-3,n.x+n.width,n.y+u.baseline-3]),c.tableRule){let p=n.y+u.baseline+u.desc+2;a.push([n.x+c.tableRule[0],p,Math.min(n.x+n.width,n.x+c.tableRule[0]+c.tableRule[1]),p])}let m="",f=0,d=u.glyphs;for(;f<d.length;){let p=d[f].r,y=f,g="",P=yi(d[f].ch,ge(p,i));for(;y<d.length&&Ar(d[y].r,p)&&d[y].ch!==" "&&yi(d[y].ch,ge(p,i))===P;)g+=d[y].ch,y++;let b=g.replaceAll(`
|
|
24
|
+
`,"").replaceAll(yt,"");if(b.trim()!==""){let T=`font-size="${k(p.size)}"`;p.mono&&(T+=' font-family="Menlo, Consolas, monospace"');let v=p.mono?"regular":Ot(i,p.bold,p.italic);(p.mono?p.bold:v==="bold"||v==="boldItalic")&&(T+=' font-weight="bold"'),(p.mono?p.italic:v==="italic"||v==="boldItalic")&&(T+=' font-style="italic"'),p.underline&&(T+=' text-decoration="underline"'),p.alpha<1&&(T+=` fill-opacity="${k(p.alpha*e.style.stroke.a)}"`),m+=`<tspan x="${k(n.x+d[f].x)}" ${T}>${Nt(b)}</tspan>`}if(p.strike&&y>f){let T=u.baseline-rn(d[f].ch,p,i)[0]*.32;a.push([n.x+d[f].x,n.y+T,n.x+d[y-1].x+d[y-1].w,n.y+T])}y===f&&y++,f=y}m&&(l+=`<text y="${k(n.y+u.baseline)}" font-family="${ee(e.style.font)}" fill="${s}" xml:space="preserve">${m}</text>
|
|
25
|
+
`)}let h=k(Math.max(1,e.style.fontSize/14));for(let[u,c,m,f]of a)l+=`<line x1="${k(u)}" y1="${k(c)}" x2="${k(m)}" y2="${k(f)}" stroke="${s}" stroke-width="${h}"/>
|
|
26
|
+
`;return l}function yi(t,e){return e.fallback[t]?`fb:${t}`:""}function Ar(t,e){return t===e||t.size===e.size&&t.bold===e.bold&&t.italic===e.italic&&t.mono===e.mono&&t.strike===e.strike&&t.underline===e.underline&&t.alpha===e.alpha}var z=(t,e,n)=>({r:t,g:e,b:n,a:1}),ln=[{id:"paper",name:"Paper",background:z(.984,.98,.965),ink:z(.12,.12,.13)},{id:"white",name:"White",background:z(1,1,1),ink:z(.12,.12,.13)},{id:"sepia",name:"Sepia",background:z(.953,.914,.824),ink:z(.23,.18,.13)},{id:"blueprint",name:"Blueprint",background:z(.106,.227,.361),ink:z(.91,.945,.984)},{id:"chalkboard",name:"Chalkboard",background:z(.169,.227,.2),ink:z(.945,.945,.918)},{id:"midnight",name:"Midnight",background:z(.082,.086,.102),ink:z(.925,.925,.94)}];function gt(t){return ln.find(e=>e.id===t)??null}function et(t,e=24){if(me(t))return et(U(t,0),e);let n=J(t),i=s=>{if(s.kind==="connector")return Cn(s,n);let l=Be(s)?(Ge+.25)*mt(s):0;return Rt(Ln(s),-l,-l)};if(t.elements.length===0)return{x:0,y:0,width:200,height:200};let r=t.elements.filter(s=>(s.style.opacity??1)>0),o=null;for(let s of r.length?r:t.elements)o=De(o,i(s));return Rt(o,-e,-e)}function St(t){let e=t.timeline??{fps:12,duration:0,boil:null,settle:null,poster:null,tracks:[],camera:null,markers:null},n=fe(e),i=e.camera?.find(o=>o.width>1&&o.height>1);if(i){let o=i.width/i.height,s=n.map(a=>vt(e,a)??{x:i.x,y:i.y,width:i.width,height:i.height}),l=Math.min(Math.max(...s.map(a=>a.width)),4096);return{times:n,rects:s,size:{width:l,height:l/o}}}let r=null;for(let o of n){let s=H(t,o);s.elements.length>0&&(r=De(r,et(s)))}return r||(r=et(H(t,n[0]))),{times:n,rects:n.map(()=>r),size:{width:r.width,height:r.height}}}var Ut=(t,e)=>t.a<1?` ${e}="${k(t.a)}"`:"";function Er(t,e,n){let i=`<svg xmlns="http://www.w3.org/2000/svg" width="${k(t.width)}" height="${k(t.height)}" viewBox="${k(t.x)} ${k(t.y)} ${k(t.width)} ${k(t.height)}">
|
|
27
|
+
`;return n&&e&&(i+=`<rect x="${k(t.x)}" y="${k(t.y)}" width="${k(t.width)}" height="${k(t.height)}" fill="${Y(e)}"/>
|
|
28
|
+
`),i}function ut(t,e,n,i=!1){if(me(t))return ut(U(t,0),e,n,i);let r=gt(t.theme),o=e?r?.background??e:null,s=r?.ink??ct,l={...t,elements:t.elements.map(p=>Fn(p,s))},a=n??et(l),h=new Set(l.layers.filter(p=>p.visible).map(p=>p.id)),u=[],c=J(l),m=ft(l),f=m.filter(p=>h.has(p.layerID)&&Be(p)),d=Hn(f).map(p=>`<path d="${p.path.data()}" fill="none" stroke="${Y(p.ink)}"${Ut(p.ink,"stroke-opacity")} stroke-width="${k(p.width)}" stroke-linecap="round"/>
|
|
29
|
+
`).join("");d&&u.push({key:"rock",markup:d});for(let p of m){if(!h.has(p.layerID))continue;let y=Math.min(Math.max(p.style.opacity??1,0),1);if(y<=0)continue;let g=Dr(p,c,o);V(p)!==0&&p.kind!=="connector"&&(g=`<g transform="rotate(${k(V(p)*180/Math.PI)} ${k(N(D(p)))} ${k(Z(D(p)))})">
|
|
30
|
+
${g}</g>
|
|
31
|
+
`),y<1&&(g=`<g opacity="${k(y)}">
|
|
32
|
+
${g}</g>
|
|
33
|
+
`);let P=i?(p.click?.url?ht(p.click.url):null)??Lt(p.url):null;P&&(g=`<a href="${Nt(P).replace(/"/g,""")}" target="_blank">
|
|
34
|
+
${g}</a>
|
|
35
|
+
`),u.push({key:p.id,markup:g})}return{bounds:a,parts:u}}function xe(t,e={r:1,g:1,b:1,a:1},n){let{bounds:i,parts:r}=ut(t,e,n,!0);return Er(i,gt(t.theme)?.background??e,e!==null)+r.map(o=>o.markup).join("")+`</svg>
|
|
36
|
+
`}function Ir(t,e){let n=Vn(t,e),i=t.text??"",r=Tn(i===""?"Label":i,t.style.fontSize,200,t.style.font),o=Math.max(r.width+12,44),s=r.height+6;return{x:n.x-o/2,y:n.y-s/2,width:o,height:s}}function Lr(t,e){let n=[...t];return n.slice(0,Math.floor(n.length*e)).join("")}function Fr(t){return t.reveal!==null&&t.reveal<1?Math.max(0,t.reveal):null}function Dr(t,e,n){let i=Y(t.style.stroke),r=`stroke="${i}" stroke-width="${k(t.style.strokeWidth)}" stroke-linecap="round" stroke-linejoin="round"`,o=ce(t.style.dash,t.style.strokeWidth);o&&(r+=` stroke-dasharray="${o.map(k).join(" ")}"`),o&&t.style.dashOffset!==null&&k(t.style.dashOffset)!=="0"&&(r+=` stroke-dashoffset="${k(t.style.dashOffset)}"`);let s=t.text,l=Fr(t);if(l!==null)if(t.kind==="text")s=Lr(s??"",l);else return t.kind==="connector"?`<path d="${Ue(t,e)[0].trimmed(l).data()}" fill="none" ${r}/>
|
|
37
|
+
`:`<path d="${pt(t).trimmed(l).data()}" fill="none" ${r}/>
|
|
38
|
+
`;switch(t.kind){case"connector":{let[a,h]=Ue(t,e),u=`<path d="${a.data()}" fill="none" ${r}/>
|
|
39
|
+
`;if(h.isEmpty||(u+=`<path d="${h.data()}" fill="${i}" stroke="none"/>
|
|
40
|
+
`),s){let c=Ir(t,e);n&&(u+=`<rect x="${k(c.x)}" y="${k(c.y)}" width="${k(c.width)}" height="${k(c.height)}" fill="${Y(n)}"/>
|
|
41
|
+
`),u+=be(s,c,t,!0)}return u}case"text":return be(s??"",D(t),t,!1);case"image":{let a=D(t),h="";if(t.image){let u=t.image.format==="jpeg"?"image/jpeg":"image/png";h+=`<image x="${k(a.x)}" y="${k(a.y)}" width="${k(a.width)}" height="${k(a.height)}" preserveAspectRatio="none" href="data:${u};base64,${t.image.data}"/>
|
|
42
|
+
`}return t.style.stroke.a>0&&t.style.strokeWidth>0&&(h+=`<path d="${pt(t).data()}" fill="none" ${r}/>
|
|
43
|
+
`),h}case"freehand":return`<path d="${pt(t).data()}" fill="none" ${r}/>
|
|
44
|
+
`;case"rectangle":case"ellipse":case"diamond":case"path":case"note":{let a="";if(t.kind==="note"&&t.style.fill.a>0&&(a+=`<path d="${ue(t).translated(2,3).data()}" fill="#000000" fill-opacity="${k(.14*t.style.fill.a)}" stroke="none"/>
|
|
45
|
+
`),t.style.fill.a>0){let h=t.evenOdd===!0?' fill-rule="evenodd"':"";if(t.style.fillStyle==="solid")a+=`<path d="${ue(t).data()}" fill="${Y(t.style.fill)}"${Ut(t.style.fill,"fill-opacity")}${h} stroke="none"/>
|
|
46
|
+
`;else if(t.style.fillStyle==="grid"){let u=jn(t.style.fill);a+=`<path d="${ue(t).data()}" fill="${Y(t.style.fill)}"${Ut(t.style.fill,"fill-opacity")}${h} stroke="none"/>
|
|
47
|
+
`,a+=`<path d="${Ze(t).data()}" fill="none" stroke="${Y(u)}"${Ut(u,"stroke-opacity")} stroke-width="1" stroke-linecap="round"/>
|
|
48
|
+
`}else a+=`<path d="${Ze(t).data()}" fill="none" stroke="${Y(t.style.fill)}"${Ut(t.style.fill,"stroke-opacity")} stroke-width="${k(Math.max(1,t.style.strokeWidth/2))}" stroke-linecap="round"/>
|
|
49
|
+
`}return a+=`<path d="${pt(t).data()}" fill="none" ${r}/>
|
|
50
|
+
`,s&&(a+=t.kind==="note"?bi(s,t):be(s,t.kind==="path"?Or(t):D(t),t,!0)),a}default:return Yr(t,r)}}function Yr(t,e){let n=D(t);return`<path d="${A.rect(n).moveTo({x:n.x,y:n.y}).lineTo({x:n.x+n.width,y:n.y+n.height}).data()}" fill="none" ${e} stroke-opacity="0.5" stroke-dasharray="6 4"/>
|
|
51
|
+
`+be(`${t.kind}${t.text?`: ${t.text}`:""}`,n,{...t,style:{...t.style,fontSize:Math.min(t.style.fontSize,12)}},!0)}function Or(t){let e=D(t),n=t.labelRect;return n?{x:e.x+n.x*e.width,y:e.y+n.y*e.height,width:n.width*e.width,height:n.height*e.height}:e}function be(t,e,n,i){let r=n.style.fontSize,o=t.split(`
|
|
52
|
+
`),s=r*1.2,l=s*o.length,a=i?N(e):e.x,h=i?Z(e)-l/2:e.y,u=`<text x="${k(a)}" font-family="${ee(n.style.font)}" font-size="${k(r)}" fill="${Y(n.style.stroke)}"${i?' text-anchor="middle"':""}>`;return o.forEach((c,m)=>{u+=`<tspan x="${k(a)}" y="${k(h+s*(m+.8))}">${Nt(c)}</tspan>`}),u+`</text>
|
|
53
|
+
`}var Cr={r:1,g:1,b:1,a:1};function jt(t,e){let n=(e??"").trim();if(!n)return 0;let i=t.pages.findIndex(o=>o.name.toLowerCase()===n.toLowerCase());if(i>=0)return i;let r=Number(n);return Number.isInteger(r)&&r>=1&&r<=t.pages.length?r-1:0}function Jt(t,e){return{...t,elements:t.elements.map(n=>({...n,style:{...n.style,roughness:e}}))}}var Vr=`
|
|
54
54
|
:host { display: block; position: relative; color: var(--dottie-ink); background: var(--dottie-page);
|
|
55
55
|
font: 14px -apple-system, system-ui, sans-serif; border-radius: var(--dottie-radius, 0); }
|
|
56
56
|
:host([hidden]) { display: none; }
|
|
@@ -65,16 +65,16 @@ input[type=range] { flex: 1; min-width: 60px; accent-color: currentColor; }
|
|
|
65
65
|
output { font-variant-numeric: tabular-nums; min-width: 4.5em; text-align: right; }
|
|
66
66
|
.scene { min-width: 0; flex: 0 1 auto; text-align: center; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
67
67
|
.error { padding: 16px; font-family: ui-monospace, Menlo, monospace; white-space: pre-wrap; }
|
|
68
|
-
${
|
|
68
|
+
${fi}`,Xt=class{constructor(e,n,i={}){w(this,"page");w(this,"plan");w(this,"scenes");w(this,"sceneNames");w(this,"background");w(this,"ink");w(this,"clicks");w(this,"replays",new Map);w(this,"replayStarts",new Map);w(this,"hoverIDs");w(this,"labels",new Map);w(this,"owner",new Map);w(this,"partsOfOwner",new Map);w(this,"overTimes",new Map);w(this,"downTimes",new Map);w(this,"hitTimes",new Map);w(this,"last",{t:0,i:0});w(this,"svg");w(this,"groups",new Map);w(this,"order",[]);w(this,"frame",-1);w(this,"onFrame",null);this.page=i.clean?Jt(e,0):e,ie(ne(this.page)),this.plan=St(this.page),this.clicks=li(e,i.file);let r=Qe(this.page);for(let u of this.page.elements){let c=u.kind==="symbol"&&u.symbol!==null?r.get(u.symbol):void 0;if(c)if(c.button===!0)for(let[m,f]of[["over",this.overTimes],["down",this.downTimes],["hit",this.hitTimes]]){let d=Bt(c,m);d!==null&&f.set(u.id,d)}else u.playback==="click"&&(c.timeline?.duration??0)>0&&this.replays.set(u.id,c.timeline.duration)}let o=new Set([...this.clicks.keys(),...this.replays.keys()]);this.hoverIDs=new Set(this.page.elements.filter(u=>o.has(u.id)&&u.kind!=="symbol"&&ui(u)).map(u=>u.id));let s=new Set(this.page.elements.filter(u=>o.has(u.id)&&u.kind==="symbol").map(u=>u.id));for(let u of this.page.elements)o.has(u.id)&&(this.labels.set(u.id,ci(u,u.symbol!==null?r.get(u.symbol)?.name:void 0)),u.kind!=="symbol"&&this.owner.set(u.id,u.id));for(let[u,c]of hi(this.page,s))this.owner.set(u,c);for(let[u,c]of this.owner)this.partsOfOwner.set(c,[...this.partsOfOwner.get(c)??[],u]);let l=u=>{let c=0;return this.plan.times.forEach((m,f)=>{Math.abs(m-u)<Math.abs(this.plan.times[c]-u)&&(c=f)}),c};this.scenes=(e.timeline?.markers??[]).map(u=>l(u.t)),this.sceneNames=(e.timeline?.markers??[]).map(u=>u.name);let a=gt(e.theme);this.background=a?.background??Cr,this.ink=a?.ink??{r:.12,g:.12,b:.13,a:1};let h="http://www.w3.org/2000/svg";this.svg=document.createElementNS(h,"svg"),this.svg.setAttribute("width",k(this.plan.size.width)),this.svg.setAttribute("height",k(this.plan.size.height)),this.svg.style.maxWidth=`${Math.ceil(this.plan.size.width)}px`,n.replaceChildren(this.svg)}get frameCount(){return this.plan.times.length}get posterFrame(){let e=at(this.page),n=0;return this.plan.times.forEach((i,r)=>{Math.abs(i-e)<Math.abs(this.plan.times[n]-e)&&(n=r)}),n}show(e){let n=this.frameCount;e=(e%n+n)%n,this.drawAt(this.plan.times[e],e),this.frame=e,this.onFrame?.(e)}replay(e,n){this.replays.has(e)&&this.replayStarts.set(e,n)}replaying(e=performance.now()){for(let[n,i]of this.replayStarts)if(e-i<(this.replays.get(n)??0)*1e3)return!0;return!1}redraw(){this.drawAt(this.last.t,this.last.i)}drawAt(e,n=0){this.last={t:e,i:n};let i=this.plan.rects[Math.min(n,this.plan.rects.length-1)],r=typeof performance>"u"?0:performance.now(),o=new Map;for(let[x,M]of this.replayStarts)o.set(x,Math.min((r-M)/1e3,this.replays.get(x)??0));let s=O(e),l=zt(this.page,s),a=U(l,s,!0,o),{parts:h}=ut(a,this.background,i),u=(x,M)=>{for(let S of M)this.owner.has(S.key)&&x.set(S.key,S.markup);return x},c=x=>x.size===0?new Map:u(new Map,ut(U(l,s,!0,new Map([...o,...x])),this.background,i).parts.filter(M=>x.has(this.owner.get(M.key)??""))),m=this.hoverIDs.size===0?new Map:u(new Map,ut(ai(a,this.hoverIDs),this.background,i).parts.filter(x=>this.hoverIDs.has(x.key))),f=c(this.overTimes),d=c(this.downTimes),p=c(this.hitTimes),y=u(new Map,h),g=[],P=new Set;for(let x of h){let M=this.owner.get(x.key);if(M===void 0){g.push(x);continue}P.has(M)||(P.add(M),g.push(this.buttonPart(M,y,m,f,d,p,l)))}this.svg.setAttribute("viewBox",`${k(i.x)} ${k(i.y)} ${k(i.width)} ${k(i.height)}`);let b="http://www.w3.org/2000/svg",T=g.map(x=>x.key);for(let x of g){let M=x.markup,S=this.groups.get(x.key);if(S)S.markup!==M&&(S.g.innerHTML=M,S.markup=M),x.button!==void 0&&S.g.classList.toggle("dottie-b",x.button);else{let F=document.createElementNS(b,"g");F.innerHTML=M,x.button!==void 0&&(F.setAttribute("class",x.button?"dottie-a dottie-b":"dottie-a"),F.setAttribute("data-a",x.key),F.setAttribute("tabindex","0"),F.setAttribute("role","button"),F.setAttribute("aria-label",this.labels.get(x.key)??"")),this.groups.set(x.key,{g:F,markup:M})}}let v=new Set(T);for(let[x,M]of this.groups)v.has(x)||(M.g.remove(),this.groups.delete(x));if(T.length!==this.order.length||T.some((x,M)=>x!==this.order[M])){let x=this.svg.firstChild;for(let M of T){let S=this.groups.get(M).g;S===x?x=x.nextSibling:this.svg.insertBefore(S,x)}for(;x;){let M=x.nextSibling;x.remove(),x=M}this.order=T}}buttonPart(e,n,i,r,o,s,l){let a=this.partsOfOwner.get(e)??[e],h=P=>{let b=a.map(T=>P.get(T)??"").join("");return b===""?null:b},u=h(n)??"",c=l.elements.find(P=>P.id===e&&P.kind==="symbol"),m=h(c?r:i),f=c?h(o):null,d=m!==null&&m!==u?m:null,p=f!==null&&f!==(m??u)?f:null;if(!c&&d===null)return{key:e,markup:u,button:!1};let y=c?' pointer-events="none"':"",g=`<g class="dottie-n"${y}>
|
|
69
69
|
${u}</g>
|
|
70
|
-
`;if(
|
|
71
|
-
${
|
|
72
|
-
`),p!==null&&(
|
|
70
|
+
`;if(d!==null&&(g+=`<g class="dottie-h"${y}>
|
|
71
|
+
${d}</g>
|
|
72
|
+
`),p!==null&&(g+=`<g class="dottie-d"${y}>
|
|
73
73
|
${p}</g>
|
|
74
|
-
`),
|
|
75
|
-
${
|
|
76
|
-
`;else{let
|
|
77
|
-
`}}return{key:e,markup:
|
|
74
|
+
`),c){let P=h(s);if(P!==null)g+=`<g class="dottie-hit" opacity="0" pointer-events="all">
|
|
75
|
+
${P}</g>
|
|
76
|
+
`;else{let b={x:c.x+c.width/2,y:c.y+c.height/2},T=c.rotation??0,v=[[c.x,c.y],[c.x+c.width,c.y],[c.x+c.width,c.y+c.height],[c.x,c.y+c.height]].map(([M,S])=>it({x:M,y:S},b,T)),x=new A().moveTo(v[0]).lineTo(v[1]).lineTo(v[2]).lineTo(v[3]).close();g+=`<path class="dottie-hit" d="${x.data()}" fill="none" stroke="none" pointer-events="all"/>
|
|
77
|
+
`}}return{key:e,markup:g,button:p!==null}}sceneAt(e){let n=-1;return this.scenes.forEach((i,r)=>{i<=e&&(n=r)}),n}},$r=typeof HTMLElement>"u"?class{}:HTMLElement,At=class extends $r{constructor(){super();w(this,"file",null);w(this,"playback",null);w(this,"root");w(this,"stage");w(this,"bar");w(this,"playButton");w(this,"scrub");w(this,"time");w(this,"sceneLabel");w(this,"prev");w(this,"next");w(this,"playing",!1);w(this,"last",0);w(this,"acc",0);w(this,"raf",0);w(this,"replayRaf",0);w(this,"loadToken",0);w(this,"visible",!0);w(this,"observer",null);this.root=this.attachShadow({mode:"open"}),this.root.innerHTML=`<style>${Vr}</style><div class="stage" part="stage" role="img"></div>
|
|
78
78
|
<div class="bar" part="controls" hidden>
|
|
79
79
|
<button class="play" aria-label="Play">\u25B6</button>
|
|
80
80
|
<button class="prev" aria-label="Previous scene" hidden>\u23EE</button>
|
|
@@ -82,4 +82,4 @@ ${x}</g>
|
|
|
82
82
|
<button class="next" aria-label="Next scene" hidden>\u23ED</button>
|
|
83
83
|
<input class="scrub" type="range" min="0" max="0" value="0" aria-label="Frame">
|
|
84
84
|
<output class="time">0.0s</output>
|
|
85
|
-
</div>`;let n=i=>this.root.querySelector(i);this.stage=n(".stage"),this.bar=n(".bar"),this.playButton=n(".play"),this.scrub=n(".scrub"),this.time=n(".time"),this.sceneLabel=n(".scene"),this.prev=n(".prev"),this.next=n(".next"),this.playButton.onclick=()=>{let i=this.playback;i&&!this.playing&&i.scenes.length&&i.frame>=i.frameCount-1&&i.show(0),this.setPlaying(!this.playing)},this.scrub.oninput=()=>{this.setPlaying(!1),this.playback?.show(Number(this.scrub.value))},this.next.onclick=()=>this.nextScene(),this.prev.onclick=()=>this.prevScene(),this.stage.addEventListener("click",i=>{let r=
|
|
85
|
+
</div>`;let n=i=>this.root.querySelector(i);this.stage=n(".stage"),this.bar=n(".bar"),this.playButton=n(".play"),this.scrub=n(".scrub"),this.time=n(".time"),this.sceneLabel=n(".scene"),this.prev=n(".prev"),this.next=n(".next"),this.playButton.onclick=()=>{let i=this.playback;i&&!this.playing&&i.scenes.length&&i.frame>=i.frameCount-1&&i.show(0),this.setPlaying(!this.playing)},this.scrub.oninput=()=>{this.setPlaying(!1),this.playback?.show(Number(this.scrub.value))},this.next.onclick=()=>this.nextScene(),this.prev.onclick=()=>this.prevScene(),this.stage.addEventListener("click",i=>{let r=xi(i.target);r&&this.activate(r.getAttribute("data-a")??"")}),this.addEventListener("keydown",i=>this.key(i))}connectedCallback(){this.hasAttribute("tabindex")||(this.tabIndex=0),"IntersectionObserver"in window&&(this.observer=new IntersectionObserver(n=>{this.visible=n.some(i=>i.isIntersecting),this.schedule()}),this.observer.observe(this)),this.load()}disconnectedCallback(){cancelAnimationFrame(this.raf),this.raf=0,this.observer?.disconnect()}attributeChangedCallback(n,i,r){i===r||!this.isConnected||(n==="src"?this.load():n==="label"?this.stage.setAttribute("aria-label",r??""):this.file&&this.mount())}async load(){let n=++this.loadToken;try{let i,r=this.getAttribute("src");if(r){let o=await fetch(r);if(!o.ok)throw new Error(`${r}: ${o.status} ${o.statusText}`);i=await o.text()}else{let o=this.querySelector('script[type="application/json"], script[type="application/vnd.dottie+json"]');if(!o)return;i=o.textContent??""}if(n!==this.loadToken)return;this.setFile(Ft(i))}catch(i){if(n!==this.loadToken)return;this.stage.innerHTML="";let r=document.createElement("div");r.className="error",r.textContent=`Couldn't show this drawing: ${i.message}`,this.stage.append(r),this.dispatchEvent(new CustomEvent("error",{detail:i}))}}setFile(n){this.file=n;for(let i of n.warnings)console.warn(`dottie-player: ${i}`);this.mount(),this.dispatchEvent(new CustomEvent("load",{detail:{file:n}}))}mount(){let n=this.file,i=n.pages[jt(n,this.getAttribute("page"))],r=new Xt(i,this.stage,{clean:this.hasAttribute("clean"),file:n});this.playback=r,this.style.setProperty("--dottie-page",Y(r.background)),this.style.setProperty("--dottie-ink",Y(r.ink)),this.style.colorScheme=Pt(r.background)<.5?"dark":"light",this.stage.setAttribute("aria-label",this.getAttribute("label")??i.name);let o=this.getAttribute("at"),s=i.timeline!==null&&r.frameCount>1&&o===null;this.bar.hidden=!s||this.hasAttribute("no-controls");let l=r.scenes.length>0;if(this.prev.hidden=this.next.hidden=this.sceneLabel.hidden=!l,this.scrub.max=String(r.frameCount-1),r.onFrame=h=>{if(this.scrub.value=String(h),this.time.textContent=`${r.plan.times[h].toFixed(1)}s`,l){let u=r.sceneAt(h);this.sceneLabel.textContent=u<0?"":r.sceneNames[u]}this.dispatchEvent(new CustomEvent("frame",{detail:{frame:h,time:r.plan.times[h]}}))},!s){r.drawAt(o!==null?Number(o)||0:at(i),o!==null?ki(r,Number(o)||0):r.posterFrame),this.setPlaying(!1);return}if(r.show(0),typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches){r.show(r.posterFrame),this.setPlaying(!1);return}this.setPlaying(!this.hasAttribute("no-autoplay")&&!r.scenes.includes(0))}get paused(){return!this.playing}get currentTime(){let n=this.playback;return n&&n.frame>=0?n.plan.times[n.frame]:0}set currentTime(n){let i=this.playback;i&&(this.setPlaying(!1),i.show(ki(i,n)))}get duration(){return this.playback?.page.timeline?.duration??0}play(){this.setPlaying(!0)}pause(){this.setPlaying(!1)}nextScene(){let n=this.playback;n&&(n.frame>=n.frameCount-1&&n.show(0),this.setPlaying(!0))}prevScene(){let n=this.playback;if(!n)return;let i=n.sceneAt(n.frame);i>=0&&n.scenes[i]===n.frame&&(i-=1),this.setPlaying(!1),n.show(i>=0?n.scenes[i]:0)}activate(n){let i=this.playback,r=i?.clicks.get(n),o=i?.replays.has(n)??!1;if(!i||!r&&!o)return;let s={element:n,...r??{},...o?{replay:!0}:{}};if(!this.dispatchEvent(new CustomEvent("action",{detail:s,cancelable:!0})))return;let l=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;if(o){let a=performance.now();i.replay(n,l?a-i.replays.get(n)*1e3:a),i.redraw(),this.scheduleReplay()}r&&("url"in r?/^(https?:|mailto:)/i.test(r.url)&&window.open(r.url,"_blank","noopener"):"page"in r?this.setAttribute("page",String(r.page+1)):r.scene>=0&&r.scene<i.scenes.length&&(l||this.hasAttribute("at")||i.frameCount<2?(this.setPlaying(!1),i.show(r.scene+1<i.scenes.length?i.scenes[r.scene+1]:i.frameCount-1)):(i.show(i.scenes[r.scene]),this.setPlaying(!0))))}scheduleReplay(){if(this.replayRaf)return;let n=()=>{this.replayRaf=0;let i=this.playback;!i||!this.isConnected||(this.playing||i.redraw(),i.replaying()?this.replayRaf=requestAnimationFrame(n):this.playing||i.redraw())};this.replayRaf=requestAnimationFrame(n)}setPlaying(n){let i=this.playback;this.playing=n&&!!i&&i.frameCount>1&&i.page.timeline!==null,this.playButton.textContent=this.playing?"\u275A\u275A":"\u25B6",this.playButton.setAttribute("aria-label",this.playing?"Pause":"Play"),this.last=0,this.acc=0,this.schedule()}schedule(){this.playing&&this.visible&&!this.raf&&this.isConnected&&(this.raf=requestAnimationFrame(n=>this.tick(n)))}tick(n){this.raf=0;let i=this.playback;if(!this.playing||!i)return;let r=1e3/(i.page.timeline?.fps??12);this.last&&(this.acc+=Math.min(n-this.last,1e3)),this.last=n;let o=!1;for(;this.playing&&this.acc>=r;){this.acc-=r;let s=i.frame+1;if(s>=i.frameCount&&(i.scenes.length||this.hasAttribute("no-loop"))){this.setPlaying(!1);break}if(i.frame=s%i.frameCount,o=!0,i.scenes.includes(i.frame)){this.setPlaying(!1);break}}o&&i.show(i.frame),this.playing&&!this.visible&&(this.last=0),this.schedule()}key(n){let i=this.playback,r=n.composedPath()[0],o=xi(r);if(i&&o&&(n.key==="Enter"||n.key===" ")){n.preventDefault(),this.activate(o.getAttribute("data-a")??"");return}if(!i||i.page.timeline===null||i.frameCount<=1||this.hasAttribute("at")||r===this.scrub&&n.key!==" ")return;let s=i.scenes.length>0,l=!0;n.key===" "?s?this.playing?this.setPlaying(!1):this.nextScene():this.setPlaying(!this.playing):n.key==="ArrowRight"?s?this.nextScene():(this.setPlaying(!1),i.show(i.frame+1)):n.key==="ArrowLeft"?s?this.prevScene():(this.setPlaying(!1),i.show(i.frame-1)):n.key==="."?(this.setPlaying(!1),i.show(i.frame+1)):n.key===","?(this.setPlaying(!1),i.show(i.frame-1)):l=!1,l&&n.preventDefault()}};w(At,"observedAttributes",["src","page","at","clean","no-controls","label"]);function xi(t){let e=t;return e&&typeof e.closest=="function"?e.closest(".dottie-a"):null}function ki(t,e){let n=0;return t.plan.times.forEach((i,r)=>{Math.abs(i-e)<Math.abs(t.plan.times[n]-e)&&(n=r)}),n}function ke(t="dottie-player"){typeof customElements<"u"&&!customElements.get(t)&&customElements.define(t,class extends At{})}var L=t=>{let e=Ct(t*1e4)/1e4;return e===0?0:e},an=t=>[L(t.x),L(t.y)],Ht=t=>[L(t.x),L(t.y),L(t.width),L(t.height)],wi=t=>[L(t.r),L(t.g),L(t.b),L(t.a)];function un(t){let e=t.timeline;if(!e)return[0];let n=e.duration,i=[0,n];for(let r=1;r<16;r++)i.push(n*(r+.37)/16);for(let r of e.markers??[])i.push(r.t);return e.poster!==null&&i.push(e.poster),[...new Set(i.map(L))].filter(r=>r>=0&&r<=n).sort((r,o)=>r-o)}function cn(t,e){let n=H(t,e),i=J(n),r=new Set(n.layers.filter(l=>l.visible).map(l=>l.id)),o={t:L(e)},s=t.timeline;if(s){let l=vt(s,e);o.view=l?Ht(l):null;let a=-1;(s.markers??[]).forEach((h,u)=>{h.t<=e&&(a=u)}),o.scene=a}return s?.camera?.length||(o.bounds=Ht(et(n))),o.elements=ft(n).map((l,a)=>{let h={id:l.id,kind:l.kind,z:a,seed:l.seed,frame:Ht({x:l.x,y:l.y,width:l.width,height:l.height})};if(r.has(l.layerID)||(h.hiddenLayer=!0),l.rotation!==null&&(h.rotation=L(l.rotation)),l.style.opacity!==null&&(h.opacity=L(l.style.opacity)),l.reveal!==null&&(h.reveal=L(l.reveal)),l.style.dashOffset!==null&&(h.dashOffset=L(l.style.dashOffset)),h.strokeWidth=L(l.style.strokeWidth),h.stroke=wi(l.style.stroke),h.fill=wi(l.style.fill),l.kind==="connector"){let[u,c]=_(l,i);h.start=an(u),h.end=an(c),h.route=rt(ot(l,i)).map(an)}return h}),o}function hn(t,e,n){let i={page:e+1,name:t.name,id:t.id},r=t.timeline;if(r){let o=St(t);i.duration=L(r.duration),i.fps=L(r.fps),i.frameCount=o.times.length,i.poster=L(r.poster??r.duration),i.size=[L(o.size.width),L(o.size.height)],r.camera?.length||(i.bounds=Ht(o.rects[0])),i.markers=(r.markers??[]).map(s=>({t:L(s.t),name:s.name}))}else i.bounds=Ht(et(t));return i.frames=n.map(o=>cn(t,o)),i}function Pi(t,e){return{version:t.version,pages:t.pages.map((n,i)=>hn(n,i,e??un(n)))}}function Wr(t,e={}){let n=zr(t)?t:Ft(t),i=n.pages[jt(n,e.page===void 0?null:String(e.page))];return i=H(i,e.at??at(i)),e.clean&&(i=Jt(i,0)),xe(i,e.background===void 0?{r:1,g:1,b:1,a:1}:e.background)}function zr(t){return typeof t=="object"&&t!==null&&Array.isArray(t.pages)&&Array.isArray(t.warnings)}var Gr="0.6.2";ke();globalThis.Dottie??(globalThis.Dottie=fn);})();
|