brepjs-verify 0.13.0 → 0.24.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,7 +21,7 @@ var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports);function
21
21
  `),this.boundingBox,e)}},ZF=class e{blueprints;_boundingBox;constructor(e){e.length===0&&M(`CompoundBlueprint`,`requires at least one blueprint (the outer boundary) — use createCompoundBlueprint() for Result-based validation`),this.blueprints=e,this._boundingBox=null}clone(){return new e(this.blueprints.map(e=>e.clone()))}get boundingBox(){if(!this._boundingBox){let e=new rF;this.blueprints.forEach(t=>{e.add(t.boundingBox)}),this._boundingBox=e}return this._boundingBox}get repr(){return[`Compound Blueprints`,`-- Outline`,kk(this.blueprints).repr,`-- Holes`,...this.blueprints.slice(1).map(e=>e.repr)].join(`
22
22
  `)}stretch(t,n,r){return new e(this.blueprints.map(e=>e.stretch(t,n,r)))}rotate(t,n){return new e(this.blueprints.map(e=>e.rotate(t,n)))}scale(t,n){let r=n||this.boundingBox.center;return new e(this.blueprints.map(e=>e.scale(t,r)))}translate(t,n=0){return new e(this.blueprints.map(e=>typeof t==`number`?e.translate(t,n):e.translate(t)))}mirror(t,n,r){return new e(this.blueprints.map(e=>e.mirror(t,n,r)))}sketchOnPlane(e,t){return this.blueprints.map(n=>n.sketchOnPlane(e,t))}sketchOnFace(e,t){return this.blueprints.map(n=>n.sketchOnFace(e,t))}punchHole(e,t,n={}){return kk(this.blueprints).punchHole(e,t,n)}toSVGViewBox(e=1){return AF(this.boundingBox,e)}toSVGPaths(){return this.blueprints.flatMap(e=>e.toSVGPaths())}toSVGGroup(){return`<g>${this.blueprints.map(e=>e.toSVGPath()).join(``)}</g>`}toSVG(e=1){return jF(this.toSVGGroup(),this.boundingBox,e)}},QF=e=>{if(e.length===0)return[];if(e.length===1)return[[lo(e,0,`groupByBoundingBoxOverlap`)]];let t=new LF(e.length);for(let n of e){let[[e,r],[i,a]]=n.boundingBox.bounds;t.add(e,r,i,a)}t.finish();let n=e.map((n,r)=>{let[[i,a],[o,s]]=n.boundingBox.bounds;return t.search(i,a,o,s).filter(t=>t>r&&!n.boundingBox.isOut(lo(e,t,`groupByBoundingBoxOverlap`).boundingBox))}),r=[],i=Array(n.length);return n.forEach((t,n)=>{let a=i[n];a||(a=[],r.push(a)),a.push(lo(e,n,`groupByBoundingBoxOverlap`)),t.length&&t.forEach(e=>{i[e]=a})}),r},$F=e=>e.map((t,n)=>{let r=lo(t.curves,0,`addContainmentInfo`),i=r.value((r.lastParameter+r.firstParameter)/2);return{blueprint:t,isIn:e.filter((e,t)=>n===t?!1:e.isInside(i))}}),eI=(e,t)=>e.flatMap(({blueprint:e})=>nI(t.filter(({blueprint:t,isIn:n})=>t===e||n.indexOf(e)!==-1))),tI=(e,t)=>[t.filter(({isIn:e})=>e.length<=1),...nI($F(e.map(({blueprint:e})=>e)))],nI=e=>{if(!e.length)return[];let t=e.filter(({isIn:e})=>!e.length),n=e.filter(({isIn:e})=>e.length>1);return t.length===1&&n.length===0?[e]:t.length>1?eI(t,e):tI(n,e)},rI=e=>new XF(QF(e).map($F).flatMap(nI).map(e=>e.length===1?lo(e,0,`organiseBlueprints`).blueprint:(e.sort((e,t)=>e.isIn.length-t.isIn.length),new ZF(e.map(({blueprint:e})=>e))))),iI=e=>e===`symmetric`||typeof e==`number`||Array.isArray(e)&&e.length===2,aI=e=>{let t;t=e?iI(e)?{endTangent:e}:{endTangent:0,...e}:{endTangent:[1,0]};let{endTangent:n,startFactor:r=1,endFactor:i=1,startTangent:a}=t,o;o=typeof n==`number`?NP(1,n*QE):n;let s;return s=typeof a==`number`?NP(1,a*QE):a,{endTangent:o,startFactor:r,endFactor:i,startTangent:s}};function oI(e,t,n){return e<t?{majorRadius:t,minorRadius:e,rotationAngle:n+90}:{majorRadius:e,minorRadius:t,rotationAngle:n}}function sI(e,t,n,r,i,a,o,s){let c=i*QE,l=e=>EP(s(e)),u=l(NP(n,c)),d=l(NP(r,c+Math.PI/2)),f=FP(s(jP([1,0],c))),[,p]=PP(f),{cx:m,cy:h,startAngle:g,endAngle:_,clockwise:v,rx:y,ry:b}=uI(e,t,u,d,p,a,o),x=mF(y,b,v?g:_,v?_:g,[m,h],f);return v||x.reverse(),x}function cI(e,t,n,r,i){let a=Math.PI*2,o=lI(1,0,e,t),s=lI(e,t,-n,-r);for(;s>a;)s-=a;for(;s<0;)s+=a;i||(s-=a);let c=o+s;for(;c>a;)c-=a;for(;c<0;)c+=a;return{startAngle:o,deltaAngle:s,endAngle:c}}function lI(e,t,n,r){let i=e*n+t*r,a=Math.sqrt((e*e+t*t)*(n*n+r*r));a<1e-12&&M(`radianAngle`,`Cannot compute angle between zero-length vectors`);let o=Math.acos(Math.max(-1,Math.min(1,i/a)));return e*r-t*n<0&&(o=-o),o}function uI([e,t],[n,r],i,a,o,s,c){i<0&&(i=-i),a<0&&(a=-a),(i<1e-10||a<1e-10)&&M(`convertSvgEllipseParams`,`rx and ry cannot be 0`);let l=Math.sin(o),u=Math.cos(o),d=(e-n)/2,f=(t-r)/2,p=(e+n)/2,m=(t+r)/2,h=u*d+l*f,g=u*f-l*d,_=h*h/(i*i)+g*g/(a*a);_>1&&(i*=Math.sqrt(_),a*=Math.sqrt(_));let v=i*a,y=i*g,b=a*h,x=y*y+b*b;x||M(`convertSvgEllipseParams`,`Start point cannot be same as end point`);let S=Math.sqrt(Math.abs((v*v-x)/x));s===c&&(S=-S);let C=S*y/a,w=-S*b/i,ee=u*C-l*w+p,te=l*C+u*w+m,ne=(h-C)/i,re=(h+C)/i,{startAngle:ie,deltaAngle:ae,endAngle:oe}=cI(ne,(g-w)/a,re,(g+w)/a,c);return{cx:ee,cy:te,startAngle:ie,deltaAngle:ae,endAngle:oe,clockwise:c,rx:i,ry:a}}var dI={chamfer:JF,dogbone:YF,fillet:qF};function fI(e,t){if(typeof e==`function`)return e;let n=dI[t];return(t,r)=>n(t,r,e)}var pI=class{pointer;firstPoint;pendingCurves;_nextCorner;constructor(e=[0,0]){this.pointer=e,this.firstPoint=e,this._nextCorner=null,this.pendingCurves=[]}_convertToUV([e,t]){return[e,t]}_convertFromUV([e,t]){return[e,t]}_lastCurve(){let e=this.pendingCurves.length;return e===0?null:this.pendingCurves[e-1]}_requireLastCurve(e,t){let n=this._lastCurve();return n||M(e,`You need a previous curve to ${t}`),n}_resolveRelative(e,t){return[this.pointer[0]+e,this.pointer[1]+t]}_saveCurveAndAdvance(e,t){return this.saveCurve(e),this.pointer=t,this}get penPosition(){return this.pointer}get penAngle(){let e=this._lastCurve();if(!e)return 0;let[t,n]=e.tangentAt(1);return Math.atan2(n,t)*$E}movePointerTo(e){return this.pendingCurves.length&&M(`Sketcher2d.movePointerTo`,`You can only move the pointer if there is no curve defined`),this.pointer=e,this.firstPoint=e,this}saveCurve(e){if(!this._nextCorner){this.pendingCurves.push(e);return}let t=this.pendingCurves.pop();t||M(`Sketcher2d.saveCurve`,`No previous curve available for custom corner`),this.pendingCurves.push(...this._nextCorner(t,e)),this._nextCorner=null}lineTo(e){let t=lF(this._convertToUV(this.pointer),this._convertToUV(e));return this._saveCurveAndAdvance(t,e)}line(e,t){return this.lineTo(this._resolveRelative(e,t))}vLine(e){return this.line(0,e)}hLine(e){return this.line(e,0)}vLineTo(e){return this.lineTo([this.pointer[0],e])}hLineTo(e){return this.lineTo([e,this.pointer[1]])}polarLineTo([e,t]){return this.lineTo(NP(e,t*QE))}polarLine(e,t){let[n,r]=NP(e,t*QE);return this.line(n,r)}tangentLine(e){let t=this._requireLastCurve(`Sketcher2d.tangentLine`,`sketch a tangent line`),n=FP(this._convertFromUV(t.tangentAt(1)));return this.line(n[0]*e,n[1]*e)}threePointsArcTo(e,t){let n=uF(this._convertToUV(this.pointer),this._convertToUV(t),this._convertToUV(e));return this._saveCurveAndAdvance(n,e)}threePointsArc(e,t,n,r){let[i,a]=this.pointer;return this.threePointsArcTo([i+e,a+t],[i+n,a+r])}sagittaArcTo(e,t){let[n,r]=this.pointer,[i,a]=e,o=(n+i)/2,s=(r+a)/2,c=-(a-r),l=i-n,u=Math.sqrt(c**2+l**2);u<1e-12&&M(`sagittaArcTo`,`Start and end points cannot be identical`);let d=[o+c/u*t,s+l/u*t],f=uF(this._convertToUV(this.pointer),this._convertToUV(d),this._convertToUV(e));return this._saveCurveAndAdvance(f,e)}sagittaArc(e,t,n){return this.sagittaArcTo(this._resolveRelative(e,t),n)}vSagittaArc(e,t){return this.sagittaArc(0,e,t)}hSagittaArc(e,t){return this.sagittaArc(e,0,t)}bulgeArcTo(e,t){if(!t)return this.lineTo(e);let n=EP(this.pointer,e)/2;return this.sagittaArcTo(e,-t*n)}bulgeArc(e,t,n){return this.bulgeArcTo(this._resolveRelative(e,t),n)}vBulgeArc(e,t){return this.bulgeArc(0,e,t)}hBulgeArc(e,t){return this.bulgeArc(e,0,t)}tangentArcTo(e){let t=this._requireLastCurve(`Sketcher2d.tangentArc`,`sketch a tangent arc`),n=dF(this._convertToUV(this.pointer),t.tangentAt(1),this._convertToUV(e));return this._saveCurveAndAdvance(n,e)}tangentArc(e,t){return this.tangentArcTo(this._resolveRelative(e,t))}ellipseTo(e,t,n,r=0,i=!1,a=!1){let{majorRadius:o,minorRadius:s,rotationAngle:c}=oI(t,n,r),l=sI(this._convertToUV(this.pointer),this._convertToUV(e),o,s,c,i,a,e=>this._convertToUV(e));return this._saveCurveAndAdvance(l,e)}ellipse(e,t,n,r,i=0,a=!1,o=!1){return this.ellipseTo(this._resolveRelative(e,t),n,r,i,a,o)}halfEllipseTo(e,t,n=!1){let r=AP(e,this.pointer),i=EP(e,this.pointer);return this.ellipseTo(e,i/2,t,r*$E,!0,n)}halfEllipse(e,t,n,r=!1){return this.halfEllipseTo(this._resolveRelative(e,t),n,r)}bezierCurveTo(e,t){let n=t.length===2&&!Array.isArray(t[0])?[t]:t,r=hF(this._convertToUV(this.pointer),n.map(e=>this._convertToUV(e)),this._convertToUV(e));return this._saveCurveAndAdvance(r,e)}quadraticBezierCurveTo(e,t){return this.bezierCurveTo(e,[t])}cubicBezierCurveTo(e,t,n){return this.bezierCurveTo(e,[t,n])}smoothSplineTo(e,t){let{endTangent:n,startTangent:r,startFactor:i,endFactor:a}=aI(t),o=this._lastCurve(),s=EP(this.pointer,e)*.25,c;c=r||(o?this._convertFromUV(o.tangentAt(1)):[1,0]),c=FP(c);let l=[this.pointer[0]+c[0]*i*s,this.pointer[1]+c[1]*i*s],u;u=n===`symmetric`?[-c[0],-c[1]]:n,u=FP(u);let d=[e[0]-u[0]*a*s,e[1]-u[1]*a*s];return this.cubicBezierCurveTo(e,l,d)}smoothSpline(e,t,n){return this.smoothSplineTo(this._resolveRelative(e,t),n)}customCorner(e,t=`fillet`){return this.pendingCurves.length||M(`Sketcher2d.customCorner`,`You need a curve defined to fillet the angle`),this._nextCorner=fI(e,t),this}_customCornerLastWithFirst(e,t=`fillet`){if(!e)return;let n=this.pendingCurves.pop(),r=this.pendingCurves.shift();(!n||!r)&&M(`Sketcher2d._customCornerLastWithFirst`,`Not enough curves to close and fillet`),this.pendingCurves.push(...fI(e,t)(n,r))}_closeSketch(){SP(this.pointer,this.firstPoint)||this.lineTo(this.firstPoint)}_closeWithMirror(){SP(this.pointer,this.firstPoint)&&M(`Sketcher2d._closeWithMirror`,`Cannot close with a mirror when the sketch is already closed`);let e=[this.pointer[0]-this.firstPoint[0],this.pointer[1]-this.firstPoint[1]],t=this._convertToUV(this.pointer),n=this._convertToUV(e),r=this.pendingCurves.map(e=>new aF(U().mirrorCurve2dAcrossAxis(e.wrapped,t[0],t[1],n[0],n[1])));r.reverse();for(let e of r)e.reverse();this.pendingCurves.push(...r),this.pointer=this.firstPoint}},mI=class extends pI{constructor(e=[0,0]){super(),this.pointer=e,this.firstPoint=e,this.pendingCurves=[]}done(){return new NF(this.pendingCurves)}close(){return this._closeSketch(),this.done()}closeWithMirror(){return this._closeWithMirror(),this.close()}closeWithCustomCorner(e,t=`fillet`){return this._closeSketch(),this._customCornerLastWithFirst(e,t),this.done()}},hI=2*Math.PI;function gI(e){let t=e%hI,n=t<0?t+hI:t;return n<Math.PI?n:n===Math.PI?0:Math.abs(n-hI)}function _I(e){return e.curves.map((t,n)=>({firstCurve:t,secondCurve:Ok(e.curves,(n+1)%e.curves.length),point:t.lastPoint}))}function vI(e){let t=t=>vI([...e,t]),n=t=>e.every(e=>e(t));return{shouldKeep:n,when:e=>t(e),inList:e=>t(t=>e.some(e=>SP(e,t.point))),atDistance:(e,n=[0,0])=>t(t=>Math.abs(EP(n,t.point)-e)<1e-9),atPoint:e=>t(t=>SP(e,t.point)),inBox:(e,n)=>{let r=Math.min(e[0],n[0]),i=Math.max(e[0],n[0]),a=Math.min(e[1],n[1]),o=Math.max(e[1],n[1]);return t(e=>{let[t,n]=e.point;return t>=r&&t<=i&&n>=a&&n<=o})},ofAngle:e=>t(t=>{let n=t.firstCurve.tangentAt(1),r=t.secondCurve.tangentAt(0);return Math.abs(gI(kP(n,r))-gI(QE*e))<1e-9}),not:e=>{let n=e(vI([]));return t(e=>!n.shouldKeep(e))},either:e=>{let n=e.map(e=>e(vI([])));return t(e=>n.some(t=>t.shouldKeep(e)))},find:e=>_I(e).filter(n)}}function yI(){return vI([])}var bI=(e,t,n=0)=>{let r=[...Array(t).keys()].map(n=>{let r=-(Math.PI*2/t)*n;return[e*Math.sin(r),e*Math.cos(r)]}),i=Ak(r),a=new mI().movePointerTo([i[0],i[1]]);return n?r.forEach(([e,t])=>a.sagittaArcTo([e,t],n)):r.forEach(([e,t])=>a.lineTo([e,t])),a.done()},xI=(e,t,n=0)=>{let{rx:r=0,ry:i=0}=typeof n==`number`?{ry:n,rx:n}:n,a=Math.min(r,e/2),o=Math.min(i,t/2),s=a&&o;s||(a=0,o=0);let c=a===o,l=new mI([Math.min(0,-(e/2-a)),-t/2]),u=(e,t)=>{s&&(c?l.tangentArc(e,t):l.ellipse(e,t,a,o,0,!1,!0))};return a<e/2&&l.hLine(e-2*a),u(a,o),o<t/2&&l.vLine(t-2*o),u(-a,o),a<e/2&&l.hLine(-(e-2*a)),u(-a,-o),o<t/2&&l.vLine(-(t-2*o)),u(a,-o),l.close()},SI=(e,t)=>SP(e,t,yP);function CI(e){return`${e[0].toFixed(9)},${e[1].toFixed(9)}`}function wI(e,t){let n=CI(e),r=CI(t);return n<r?`${n}|${r}`:`${r}|${n}`}function TI(e){let t=e[0];return t===void 0&&M(`startOfSegment`,`empty segment`),t.firstPoint}function EI(e){let t=e[e.length-1];return t===void 0&&M(`endOfSegment`,`empty segment`),t.lastPoint}function DI(e){return[...e].reverse().map(e=>{let t=e.clone();return t.reverse(),t})}function OI(e){return[...e].reverse().map(DI)}function kI(e){let t=(e.lastParameter+e.firstParameter)/2;return e.value(t)}function AI(e,t){let n=CI(t);for(let r=0;r<e.length;r++){let i=e[r];if(i!==void 0&&CI(i.firstPoint)===n&&SI(t,i.firstPoint))return r}for(let n=0;n<e.length;n++){let r=e[n];if(r!==void 0&&SI(t,r.firstPoint))return n}return-1}function jI(e,t,n,r){for(let i=0;i<e.length;i++){let a=e[i];if(a!==void 0&&CI(a.firstPoint)===t&&CI(a.lastPoint)===n&&r(a))return i}for(let t=0;t<e.length;t++){let n=e[t];if(n!==void 0&&r(n))return t}return-1}function MI(e,t){return t<=0?e:e.slice(t).concat(e.slice(0,t))}function NI(e,t){return MI(e,AI(e,t))}function PI(e,t){let n=CI(t.firstPoint),r=CI(t.lastPoint),i=e=>SI(t.firstPoint,e.firstPoint)&&SI(t.lastPoint,e.lastPoint),a=e=>SI(t.lastPoint,e.firstPoint)&&SI(t.firstPoint,e.lastPoint);function o(e,t,n,r){let i=jI(e,t,n,r);return i===-1?null:MI(e,i)}let s=o(e,n,r,i);if(s!==null)return s;let c=o(e,r,n,a);if(c!==null)return c;let l=DI(e),u=o(l,n,r,i);if(u!==null)return u;let d=o(l,r,n,a);if(d!==null)return d;M(`rotateToStartAtSegment`,`failed to rotate to segment start`)}function*FI(e,t,n){let r=new Set(t.map(CI)),i=new Set(n.map(e=>wI(e.firstPoint,e.lastPoint))),a=e=>r.has(CI(e))?!0:t.some(t=>SI(t,e)),o=(e,t)=>i.has(wI(e,t))?!0:n.some(n=>SI(n.firstPoint,e)&&SI(n.lastPoint,t)||SI(n.firstPoint,t)&&SI(n.lastPoint,e)),s=[];for(let t of e){if(SI(t.firstPoint,t.lastPoint)){s.push(t);continue}let e=a(t.lastPoint),n=o(t.firstPoint,t.lastPoint);e?(s.push(t),yield s,s=[]):n?(s.length&&(yield s,s=[]),yield[t]):s.push(t)}s.length&&(yield s)}function II(e,t,n){return e.filter(e=>{let r=t.filter(t=>SI(t.firstPoint,e)||SI(t.lastPoint,e)),i=r.length%2?r.filter(t=>!(SI(t.firstPoint,e)&&SI(t.lastPoint,e))):r;if(i.length===0||i.length%2)return!1;let a=i.map(e=>n.isInside(kI(e)));return!(a.every(Boolean)||a.every(e=>!e))})}function LI(e,n){let r=[],i=[],a=e.curves.map(()=>[]),o=n.curves.map(()=>[]),s=new LF(n.curves.length);for(let e of n.curves){let[[t,n],[r,i]]=e.boundingBox.bounds;s.add(t,n,r,i)}return s.finish(),e.curves.forEach((e,c)=>{let[[l,u],[d,f]]=e.boundingBox.bounds,p=s.search(l,u,d,f);for(let s of p){let{intersections:l,commonSegments:u,commonSegmentsPoints:d}=j(HF(e,t(n.curves,s),yP/100));r.push(...l),a[c]?.push(...l),o[s]?.push(...l),i.push(...u),r.push(...d),a[c]?.push(...d),o[s]?.push(...d)}}),{allIntersections:nF(r,yP),allCommonSegments:i,firstCurvePoints:a,secondCurvePoints:o}}function RI(e,t){return Mk([e,t]).flatMap(([e,t])=>t.length===0?[e]:e.splitAt(t,yP/100))}function zI(e,t,n){return e.some(([e,r])=>e===void 0||r===void 0?!1:SI(e,t)&&SI(r,n)||SI(e,n)&&SI(r,t))}function BI(e,t){let{allIntersections:n,allCommonSegments:r,firstCurvePoints:i,secondCurvePoints:a}=LI(e,t);if(n.length<=1)return null;let o=RI(e.curves,i),s=RI(t.curves,a),c=r.map(e=>[e.firstPoint,e.lastPoint]),l=II(II(n,o,t),s,e);if(l.length===0&&r.length===0)return null;if(r.length===0){let e=l[0];if(e===void 0)return null;o=NI(o,e),s=NI(s,e)}else{let e=r[0];if(e===void 0)return null;o=PI(o,e),s=PI(s,e)}let u=Array.from(FI(o,l,r)),d=Array.from(FI(s,l,r)),f=u[0],p=d[0];if(f!==void 0&&p!==void 0){let e=!SI(EI(p),EI(f)),t=r.length>0&&p.length!==1;(e||t)&&(d=OI(d))}let m=Math.max(u.length,d.length),h=[];for(let e=0;e<m;e++){let t=u[e],n=d[e];if(t===void 0||n===void 0){let e=t??n;if(e===void 0)continue;h.push([e,e]);continue}zI(c,TI(t),EI(t))?h.push([t,`same`]):h.push([t,n])}return h}function VI(e){if(e.length<2)return e;let n=[],r=0;for(;r<e.length;){let i=t(e,r);if(i.geomType!==`LINE`){n.push(i),r++;continue}let a=i.lastPoint,o=r+1;for(;o<e.length;){let n=t(e,o);if(n.geomType!==`LINE`||!SI(a,n.firstPoint))break;let r=wP(a,i.firstPoint),s=wP(n.lastPoint,n.firstPoint);if(Math.abs(OP(r,s))>1e-9)break;a=n.lastPoint,o++}o>r+1?n.push(lF(i.firstPoint,a)):n.push(i),r=o}return n}function HI(e){let t=e.map(e=>e.firstPoint),n=e.map(e=>e.lastPoint),r=Mk([t,n.slice(-1).concat(n.slice(0,-1))]).map(([e,t],n)=>e===void 0||t===void 0||SI(e,t)?null:n).filter(e=>e!==null);if(r.length===0)return[e];let i=Mk([r.slice(0,-1),r.slice(1)]).map(([t,n])=>e.slice(t,n)),a=e.slice(r[r.length-1]),o=r[0];return o!==void 0&&o!==0&&(a=a.concat(e.slice(0,o))),i.push(a),i}function UI(e,t,n){return t===1?{curves:[...e],segmentsIn:1,lastWasSame:null}:t===2||t===0?{curves:[],segmentsIn:null,lastWasSame:null}:t===null?{curves:[],segmentsIn:null,lastWasSame:n?[...n,...e]:e}:{curves:[],segmentsIn:t,lastWasSame:n}}function WI(e,t,n,r,i,a,o){let s=[],c=0,l=e[0];if(l!==void 0){let t=kI(l),n=r.isInside(t);(i.firstInside===`keep`&&n||i.firstInside===`remove`&&!n)&&(c+=1,s.push(...e))}let u=t[0];if(u!==void 0){let e=kI(u),r=n.isInside(e);if(i.secondInside===`keep`&&r||i.secondInside===`remove`&&!r){let e=t;c===1&&(e=DI(t)),c+=1,s.push(...e)}}return a===null&&c===1&&o!==null&&(s=[...o,...s]),{curves:s,segmentsIn:c===1?c:a,lastWasSame:c===1?null:o}}function GI(e,t,n){let r=BI(e,t);if(r===null)return KI(e,t);if(r.every(([,e])=>e===`same`))return{identical:!0};let i=null,a=null,o=r.flatMap(([r,o])=>{if(o===`same`){let e=UI(r,i,a);return i=e.segmentsIn,a=e.lastWasSame,e.curves}let s=WI(r,o,e,t,n,i,a);return i=s.segmentsIn,a=s.lastWasSame,s.curves}),s=a;s!==null&&i===1&&(o=[...s,...o]);let c=HI(VI(o)).filter(e=>e.length>0).map(e=>new NF(e));if(c.length===0)return null;if(c.length===1){let e=c[0];return e===void 0?null:e}return rI(c)}function KI(e,t){let n=e.curves[0],r=t.curves[0];return{identical:!1,firstCurveInSecond:n!==void 0&&t.isInside(kI(n)),secondCurveInFirst:r!==void 0&&e.isInside(kI(r))}}function qI(e,t){let n=GI(e,t,{firstInside:`remove`,secondInside:`remove`});return n===null||n instanceof NF||n instanceof XF?n:n.identical?e.clone():n.firstCurveInSecond?t.clone():n.secondCurveInFirst?e.clone():new XF([e,t])}function JI(e,t){let n=GI(e,t,{firstInside:`remove`,secondInside:`keep`});return n===null||n instanceof NF||n instanceof XF?n:n.identical||n.firstCurveInSecond?null:n.secondCurveInFirst?new XF([new ZF([e,t])]):e.clone()}function YI(e,t){let n=GI(e,t,{firstInside:`keep`,secondInside:`keep`});return n===null||n instanceof NF||n instanceof XF?n:n.identical||n.firstCurveInSecond?e.clone():n.secondCurveInFirst?t.clone():null}var XI=(e,t)=>{if(e instanceof NF&&t instanceof NF){let n=[];return e.curves.forEach(e=>{t.curves.forEach(t=>{let{intersections:r,commonSegmentsPoints:i}=j(HF(e,t));n.push(...r),n.push(...i)})}),n=nF(n),n.length>1}if(e instanceof ZF||e instanceof XF)return e.blueprints.some(e=>XI(e,t));if(t instanceof ZF||t instanceof XF)return t.blueprints.some(t=>XI(e,t));M(`genericIntersects`,`Unhandled shape combination in genericIntersects`)},ZI=(e,t)=>{if(e instanceof ZF){if(t instanceof NF)return eL(t,e);if(t instanceof ZF)return nL(e,t)}if(t instanceof ZF){if(e instanceof NF)return eL(e,t);if(e instanceof ZF)return nL(e,t)}if(e instanceof NF&&t instanceof NF)return qI(e,t);M(`genericFuse`,`Unhandled shape combination in genericFuse`)},QI=e=>{let t=new Map,n=[];return e.forEach((r,i)=>{let a;t.has(i)?a=t.get(i):(a={current:r,fusedWith:new Set([i])},n.push(a)),e.slice(i+1).forEach((e,n)=>{let r=a.current,o=i+n+1;if(a.fusedWith.has(o))return;let s=e,c=!1;if(t.has(o)&&(s=t.get(o).current,c=!0),r.boundingBox.isOut(s.boundingBox)||!XI(r,s))return;let l;if(r instanceof XF||s instanceof XF){let e=rL(r,s);e===null&&M(`fuseIntersectingBlueprints`,`fuse2D returned null for non-null inputs`),l=e}else l=ZI(r,s);if(!(l instanceof NF||l instanceof ZF)){if(l instanceof XF&&l.blueprints.length===2)return;l instanceof XF&&l.blueprints.length===1?l=lo(l.blueprints,0,`fuseIntersectingBlueprints`):l instanceof XF||M(`fuseIntersectingBlueprints`,`Fuse produced unexpected non-blueprint result`)}a.fusedWith.add(o),a.current=l,c||t.set(o,a)})}),rI(n.map(({current:e})=>e).flatMap(e=>$I(e)))},$I=e=>e instanceof NF?[e]:e instanceof ZF?e.blueprints:e instanceof XF?e.blueprints.flatMap(e=>$I(e)):[],eL=(e,t)=>{let n=qI(e,lo(t.blueprints,0,`fuseBlueprintWithCompound`)),r=t.blueprints.slice(1).map(t=>JI(t,e));return rI([...$I(n),...r.flatMap(e=>$I(e))])};function tL(e,t){let n=[];for(let r of e)for(let e of t)n.push([r,e]);return n}var nL=(e,t)=>{let n=lo(e.blueprints,0,`fuseCompoundWithCompound`),r=lo(t.blueprints,0,`fuseCompoundWithCompound`),i=qI(n,r),a=t.blueprints.slice(1).map(e=>JI(e,n)),o=e.blueprints.slice(1).map(e=>JI(e,r)),s=tL(e.blueprints.slice(1),t.blueprints.slice(1)).flatMap(([e,t])=>$I(YI(e,t)));return rI([...$I(i),...a.flatMap(e=>$I(e)),...o.flatMap(e=>$I(e)),...s])},rL=(e,t)=>{if(e===null)return t?.clone()??null;if(t===null)return e.clone();if(!(e instanceof XF)&&t instanceof XF)return QI([e,...t.blueprints]);if(!(t instanceof XF)&&e instanceof XF)return QI([t,...e.blueprints]);if(e instanceof XF&&t instanceof XF){let n=rL(lo(e.blueprints,0,`fuse2D`),t);return e.blueprints.slice(1).forEach(e=>{n=rL(e,n)}),n}if(e instanceof ZF){if(t instanceof XF)return rL(t,e);if(t instanceof NF)return eL(t,e);if(t instanceof ZF)return nL(e,t)}if(t instanceof ZF){if(e instanceof XF)return rL(e,t);if(e instanceof NF)return eL(e,t);if(e instanceof ZF)return nL(e,t)}return e instanceof NF&&t instanceof NF?qI(e,t):null},iL=e=>{let t=e.flatMap(e=>e===null?[]:e instanceof XF?e.blueprints:e);return t.length===1?lo(t,0,`mergeNonIntersecting`):new XF(t)},aL=(e,t)=>{if(e===null)return null;if(t===null)return e.clone();if(e instanceof XF)return iL(e.blueprints.map(e=>aL(e,t)));if(e instanceof ZF){let n=lo(e.blueprints,0,`cut2D`);if(t instanceof NF&&!t.intersects(n))return n.isInside(t.firstPoint)?rI([n,...$I(rL(t,new XF(e.blueprints.slice(1))))]):e.clone();{let r=aL(n,t);return e.blueprints.slice(1).forEach(e=>{r=aL(r,e)}),r}}if(t instanceof XF){let n=e;for(let e of t.blueprints)n=aL(n,e);return n}if(t instanceof ZF){let n=JI(e,lo(t.blueprints,0,`cut2D`));return t.blueprints.slice(1).forEach(t=>{n=rL(n,YI(t,e))}),n}return JI(e,t)};function oL(e,t){if(e===null||t===null)return null;if(e instanceof NF&&t instanceof NF)return YI(e,t);if(e instanceof XF)return iL(e.blueprints.map(e=>oL(e,t)));if(e instanceof ZF){let n=lo(e.blueprints,0,`intersect2D`),r=e.blueprints.slice(1);if(r.length===0)return oL(n,t);let i=oL(n,t);for(let e of r)i=aL(i,e);return i}if(t instanceof XF)return iL(t.blueprints.map(t=>oL(e,t)));if(t instanceof ZF){let n=lo(t.blueprints,0,`intersect2D`),r=t.blueprints.slice(1);if(r.length===0)return oL(n,e);let i=oL(n,e);for(let e of r)i=aL(i,e);return i}M(`intersect2D`,`Unhandled Shape2D combination`)}var sL=e(((e,t)=>{t.exports={}}));
23
23
  /*! https://mths.be/codepointat v0.2.0 by @mathias */
24
- String.prototype.codePointAt||(function(){var e=function(){try{var e={},t=Object.defineProperty,n=t(e,e,e)&&t}catch{}return n}(),t=function(e){if(this==null)throw TypeError();var t=String(this),n=t.length,r=e?Number(e):0;if(r!=r&&(r=0),!(r<0||r>=n)){var i=t.charCodeAt(r),a;return i>=55296&&i<=56319&&n>r+1&&(a=t.charCodeAt(r+1),a>=56320&&a<=57343)?(i-55296)*1024+a-56320+65536:i}};e?e(String.prototype,`codePointAt`,{value:t,configurable:!0,writable:!0}):String.prototype.codePointAt=t})();var cL=0,lL=-3;function uL(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function dL(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new uL,this.dtree=new uL}var fL=new uL,pL=new uL,mL=new Uint8Array(30),hL=new Uint16Array(30),gL=new Uint8Array(30),_L=new Uint16Array(30),vL=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),yL=new uL,bL=new Uint8Array(320);function xL(e,t,n,r){var i,a;for(i=0;i<n;++i)e[i]=0;for(i=0;i<30-n;++i)e[i+n]=i/n|0;for(a=r,i=0;i<30;++i)t[i]=a,a+=1<<e[i]}function SL(e,t){var n;for(n=0;n<7;++n)e.table[n]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,n=0;n<24;++n)e.trans[n]=256+n;for(n=0;n<144;++n)e.trans[24+n]=n;for(n=0;n<8;++n)e.trans[168+n]=280+n;for(n=0;n<112;++n)e.trans[176+n]=144+n;for(n=0;n<5;++n)t.table[n]=0;for(t.table[5]=32,n=0;n<32;++n)t.trans[n]=n}var CL=new Uint16Array(16);function wL(e,t,n,r){var i,a;for(i=0;i<16;++i)e.table[i]=0;for(i=0;i<r;++i)e.table[t[n+i]]++;for(e.table[0]=0,a=0,i=0;i<16;++i)CL[i]=a,a+=e.table[i];for(i=0;i<r;++i)t[n+i]&&(e.trans[CL[t[n+i]]++]=i)}function TL(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var t=e.tag&1;return e.tag>>>=1,t}function EL(e,t,n){if(!t)return n;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var r=e.tag&65535>>>16-t;return e.tag>>>=t,e.bitcount-=t,r+n}function DL(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var n=0,r=0,i=0,a=e.tag;do r=2*r+(a&1),a>>>=1,++i,n+=t.table[i],r-=t.table[i];while(r>=0);return e.tag=a,e.bitcount-=i,t.trans[n+r]}function OL(e,t,n){var r=EL(e,5,257),i=EL(e,5,1),a=EL(e,4,4),o,s,c;for(o=0;o<19;++o)bL[o]=0;for(o=0;o<a;++o){var l=EL(e,3,0);bL[vL[o]]=l}for(wL(yL,bL,0,19),s=0;s<r+i;){var u=DL(e,yL);switch(u){case 16:var d=bL[s-1];for(c=EL(e,2,3);c;--c)bL[s++]=d;break;case 17:for(c=EL(e,3,3);c;--c)bL[s++]=0;break;case 18:for(c=EL(e,7,11);c;--c)bL[s++]=0;break;default:bL[s++]=u;break}}wL(t,bL,0,r),wL(n,bL,r,i)}function kL(e,t,n){for(;;){var r=DL(e,t);if(r===256)return cL;if(r<256)e.dest[e.destLen++]=r;else{var i,a,o,s;for(r-=257,i=EL(e,mL[r],hL[r]),a=DL(e,n),o=e.destLen-EL(e,gL[a],_L[a]),s=o;s<o+i;++s)e.dest[e.destLen++]=e.dest[s]}}}function AL(e){for(var t,n,r;e.bitcount>8;)e.sourceIndex--,e.bitcount-=8;if(t=e.source[e.sourceIndex+1],t=256*t+e.source[e.sourceIndex],n=e.source[e.sourceIndex+3],n=256*n+e.source[e.sourceIndex+2],t!==(~n&65535))return lL;for(e.sourceIndex+=4,r=t;r;--r)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,cL}function jL(e,t){var n=new dL(e,t),r,i,a;do{switch(r=TL(n),i=EL(n,2,0),i){case 0:a=AL(n);break;case 1:a=kL(n,fL,pL);break;case 2:OL(n,n.ltree,n.dtree),a=kL(n,n.ltree,n.dtree);break;default:a=lL}if(a!==cL)throw Error(`Data error`)}while(!r);return n.destLen<n.dest.length?typeof n.dest.slice==`function`?n.dest.slice(0,n.destLen):n.dest.subarray(0,n.destLen):n.dest}SL(fL,pL),xL(mL,hL,4,3),xL(gL,_L,2,1),mL[28]=0,hL[28]=258;var ML=jL;function NL(e,t,n,r,i){return(1-i)**3*e+3*(1-i)**2*i*t+3*(1-i)*i**2*n+i**3*r}function PL(){this.x1=NaN,this.y1=NaN,this.x2=NaN,this.y2=NaN}PL.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},PL.prototype.addPoint=function(e,t){typeof e==`number`&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),typeof t==`number`&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))},PL.prototype.addX=function(e){this.addPoint(e,null)},PL.prototype.addY=function(e){this.addPoint(null,e)},PL.prototype.addBezier=function(e,t,n,r,i,a,o,s){var c=[e,t],l=[n,r],u=[i,a],d=[o,s];this.addPoint(e,t),this.addPoint(o,s);for(var f=0;f<=1;f++){var p=6*c[f]-12*l[f]+6*u[f],m=-3*c[f]+9*l[f]-9*u[f]+3*d[f],h=3*l[f]-3*c[f];if(m===0){if(p===0)continue;var g=-h/p;0<g&&g<1&&(f===0&&this.addX(NL(c[f],l[f],u[f],d[f],g)),f===1&&this.addY(NL(c[f],l[f],u[f],d[f],g)));continue}var _=p**2-4*h*m;if(!(_<0)){var v=(-p+Math.sqrt(_))/(2*m);0<v&&v<1&&(f===0&&this.addX(NL(c[f],l[f],u[f],d[f],v)),f===1&&this.addY(NL(c[f],l[f],u[f],d[f],v)));var y=(-p-Math.sqrt(_))/(2*m);0<y&&y<1&&(f===0&&this.addX(NL(c[f],l[f],u[f],d[f],y)),f===1&&this.addY(NL(c[f],l[f],u[f],d[f],y)))}}},PL.prototype.addQuad=function(e,t,n,r,i,a){var o=e+2/3*(n-e),s=t+2/3*(r-t),c=o+1/3*(i-e),l=s+1/3*(a-t);this.addBezier(e,t,o,s,c,l,i,a)};function FL(){this.commands=[],this.fill=`black`,this.stroke=null,this.strokeWidth=1}FL.prototype.moveTo=function(e,t){this.commands.push({type:`M`,x:e,y:t})},FL.prototype.lineTo=function(e,t){this.commands.push({type:`L`,x:e,y:t})},FL.prototype.curveTo=FL.prototype.bezierCurveTo=function(e,t,n,r,i,a){this.commands.push({type:`C`,x1:e,y1:t,x2:n,y2:r,x:i,y:a})},FL.prototype.quadTo=FL.prototype.quadraticCurveTo=function(e,t,n,r){this.commands.push({type:`Q`,x1:e,y1:t,x:n,y:r})},FL.prototype.close=FL.prototype.closePath=function(){this.commands.push({type:`Z`})},FL.prototype.extend=function(e){if(e.commands)e=e.commands;else if(e instanceof PL){var t=e;this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),this.close();return}Array.prototype.push.apply(this.commands,e)},FL.prototype.getBoundingBox=function(){for(var e=new PL,t=0,n=0,r=0,i=0,a=0;a<this.commands.length;a++){var o=this.commands[a];switch(o.type){case`M`:e.addPoint(o.x,o.y),t=r=o.x,n=i=o.y;break;case`L`:e.addPoint(o.x,o.y),r=o.x,i=o.y;break;case`Q`:e.addQuad(r,i,o.x1,o.y1,o.x,o.y),r=o.x,i=o.y;break;case`C`:e.addBezier(r,i,o.x1,o.y1,o.x2,o.y2,o.x,o.y),r=o.x,i=o.y;break;case`Z`:r=t,i=n;break;default:throw Error(`Unexpected path command `+o.type)}}return e.isEmpty()&&e.addPoint(0,0),e},FL.prototype.draw=function(e){e.beginPath();for(var t=0;t<this.commands.length;t+=1){var n=this.commands[t];n.type===`M`?e.moveTo(n.x,n.y):n.type===`L`?e.lineTo(n.x,n.y):n.type===`C`?e.bezierCurveTo(n.x1,n.y1,n.x2,n.y2,n.x,n.y):n.type===`Q`?e.quadraticCurveTo(n.x1,n.y1,n.x,n.y):n.type===`Z`&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())},FL.prototype.toPathData=function(e){e=e===void 0?2:e;function t(t){return Math.round(t)===t?``+Math.round(t):t.toFixed(e)}function n(){for(var e=arguments,n=``,r=0;r<arguments.length;r+=1){var i=e[r];i>=0&&r>0&&(n+=` `),n+=t(i)}return n}for(var r=``,i=0;i<this.commands.length;i+=1){var a=this.commands[i];a.type===`M`?r+=`M`+n(a.x,a.y):a.type===`L`?r+=`L`+n(a.x,a.y):a.type===`C`?r+=`C`+n(a.x1,a.y1,a.x2,a.y2,a.x,a.y):a.type===`Q`?r+=`Q`+n(a.x1,a.y1,a.x,a.y):a.type===`Z`&&(r+=`Z`)}return r},FL.prototype.toSVG=function(e){var t=`<path d="`;return t+=this.toPathData(e),t+=`"`,this.fill&&this.fill!==`black`&&(this.fill===null?t+=` fill="none"`:t+=` fill="`+this.fill+`"`),this.stroke&&(t+=` stroke="`+this.stroke+`" stroke-width="`+this.strokeWidth+`"`),t+=`/>`,t},FL.prototype.toDOMElement=function(e){var t=this.toPathData(e),n=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return n.setAttribute(`d`,t),n};function IL(e){throw Error(e)}function LL(e,t){e||IL(t)}var K={fail:IL,argument:LL,assert:LL},RL=32768,zL=2147483648,BL={},q={},J={};function VL(e){return function(){return e}}q.BYTE=function(e){return K.argument(e>=0&&e<=255,`Byte value should be between 0 and 255.`),[e]},J.BYTE=VL(1),q.CHAR=function(e){return[e.charCodeAt(0)]},J.CHAR=VL(1),q.CHARARRAY=function(e){e===void 0&&(e=``,console.warn(`Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name.`));for(var t=[],n=0;n<e.length;n+=1)t[n]=e.charCodeAt(n);return t},J.CHARARRAY=function(e){return e===void 0?0:e.length},q.USHORT=function(e){return[e>>8&255,e&255]},J.USHORT=VL(2),q.SHORT=function(e){return e>=RL&&(e=-(2*RL-e)),[e>>8&255,e&255]},J.SHORT=VL(2),q.UINT24=function(e){return[e>>16&255,e>>8&255,e&255]},J.UINT24=VL(3),q.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]},J.ULONG=VL(4),q.LONG=function(e){return e>=zL&&(e=-(2*zL-e)),[e>>24&255,e>>16&255,e>>8&255,e&255]},J.LONG=VL(4),q.FIXED=q.ULONG,J.FIXED=J.ULONG,q.FWORD=q.SHORT,J.FWORD=J.SHORT,q.UFWORD=q.USHORT,J.UFWORD=J.USHORT,q.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,e&255]},J.LONGDATETIME=VL(8),q.TAG=function(e){return K.argument(e.length===4,`Tag should be exactly 4 ASCII characters.`),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},J.TAG=VL(4),q.Card8=q.BYTE,J.Card8=J.BYTE,q.Card16=q.USHORT,J.Card16=J.USHORT,q.OffSize=q.BYTE,J.OffSize=J.BYTE,q.SID=q.USHORT,J.SID=J.USHORT,q.NUMBER=function(e){return e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?(e-=108,[(e>>8)+247,e&255]):e>=-1131&&e<=-108?(e=-e-108,[(e>>8)+251,e&255]):e>=-32768&&e<=32767?q.NUMBER16(e):q.NUMBER32(e)},J.NUMBER=function(e){return q.NUMBER(e).length},q.NUMBER16=function(e){return[28,e>>8&255,e&255]},J.NUMBER16=VL(3),q.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,e&255]},J.NUMBER32=VL(5),q.REAL=function(e){var t=e.toString(),n=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(n){var r=parseFloat(`1e`+((n[2]?+n[2]:0)+n[1].length));t=(Math.round(e*r)/r).toString()}for(var i=``,a=0,o=t.length;a<o;a+=1){var s=t[a];s===`e`?i+=t[++a]===`-`?`c`:`b`:s===`.`?i+=`a`:s===`-`?i+=`e`:i+=s}i+=i.length&1?`f`:`ff`;for(var c=[30],l=0,u=i.length;l<u;l+=2)c.push(parseInt(i.substr(l,2),16));return c},J.REAL=function(e){return q.REAL(e).length},q.NAME=q.CHARARRAY,J.NAME=J.CHARARRAY,q.STRING=q.CHARARRAY,J.STRING=J.CHARARRAY,BL.UTF8=function(e,t,n){for(var r=[],i=n,a=0;a<i;a++,t+=1)r[a]=e.getUint8(t);return String.fromCharCode.apply(null,r)},BL.UTF16=function(e,t,n){for(var r=[],i=n/2,a=0;a<i;a++,t+=2)r[a]=e.getUint16(t);return String.fromCharCode.apply(null,r)},q.UTF16=function(e){for(var t=[],n=0;n<e.length;n+=1){var r=e.charCodeAt(n);t[t.length]=r>>8&255,t[t.length]=r&255}return t},J.UTF16=function(e){return e.length*2};var HL={"x-mac-croatian":`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ\xA0ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ`,"x-mac-cyrillic":`АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»…\xA0ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю`,"x-mac-gaelic":`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»…\xA0ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ`,"x-mac-greek":`Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»…\xA0ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­`,"x-mac-icelandic":`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»…\xA0ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ`,"x-mac-inuit":`ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ…\xA0ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł`,"x-mac-ce":`ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»…\xA0ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ`,macintosh:`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»…\xA0ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ`,"x-mac-romanian":`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»…\xA0ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ`,"x-mac-turkish":`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»…\xA0ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ`};BL.MACSTRING=function(e,t,n,r){var i=HL[r];if(i!==void 0){for(var a=``,o=0;o<n;o++){var s=e.getUint8(t+o);s<=127?a+=String.fromCharCode(s):a+=i[s&127]}return a}};var UL=typeof WeakMap==`function`&&new WeakMap,WL,GL=function(e){if(!WL)for(var t in WL={},HL)WL[t]=new String(t);var n=WL[e];if(n!==void 0){if(UL){var r=UL.get(n);if(r!==void 0)return r}var i=HL[e];if(i!==void 0){for(var a={},o=0;o<i.length;o++)a[i.charCodeAt(o)]=o+128;return UL&&UL.set(n,a),a}}};q.MACSTRING=function(e,t){var n=GL(t);if(n!==void 0){for(var r=[],i=0;i<e.length;i++){var a=e.charCodeAt(i);if(a>=128&&(a=n[a],a===void 0))return;r[i]=a}return r}},J.MACSTRING=function(e,t){var n=q.MACSTRING(e,t);return n===void 0?0:n.length};function KL(e){return e>=-128&&e<=127}function qL(e,t,n){for(var r=0,i=e.length;t<i&&r<64&&e[t]===0;)++t,++r;return n.push(128|r-1),t}function JL(e,t,n){for(var r=0,i=e.length,a=t;a<i&&r<64;){var o=e[a];if(!KL(o)||o===0&&a+1<i&&e[a+1]===0)break;++a,++r}n.push(r-1);for(var s=t;s<a;++s)n.push(e[s]+256&255);return a}function YL(e,t,n){for(var r=0,i=e.length,a=t;a<i&&r<64;){var o=e[a];if(o===0||KL(o)&&a+1<i&&KL(e[a+1]))break;++a,++r}n.push(64|r-1);for(var s=t;s<a;++s){var c=e[s];n.push(c+65536>>8&255,c+256&255)}return a}q.VARDELTAS=function(e){for(var t=0,n=[];t<e.length;){var r=e[t];t=r===0?qL(e,t,n):r>=-128&&r<=127?JL(e,t,n):YL(e,t,n)}return n},q.INDEX=function(e){for(var t=1,n=[t],r=[],i=0;i<e.length;i+=1){var a=q.OBJECT(e[i]);Array.prototype.push.apply(r,a),t+=a.length,n.push(t)}if(r.length===0)return[0,0];for(var o=[],s=1+Math.floor(Math.log(t)/Math.log(2))/8|0,c=[void 0,q.BYTE,q.USHORT,q.UINT24,q.ULONG][s],l=0;l<n.length;l+=1){var u=c(n[l]);Array.prototype.push.apply(o,u)}return Array.prototype.concat(q.Card16(e.length),q.OffSize(s),o,r)},J.INDEX=function(e){return q.INDEX(e).length},q.DICT=function(e){for(var t=[],n=Object.keys(e),r=n.length,i=0;i<r;i+=1){var a=parseInt(n[i],0),o=e[a];t=t.concat(q.OPERAND(o.value,o.type)),t=t.concat(q.OPERATOR(a))}return t},J.DICT=function(e){return q.DICT(e).length},q.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},q.OPERAND=function(e,t){var n=[];if(Array.isArray(t))for(var r=0;r<t.length;r+=1)K.argument(e.length===t.length,`Not enough arguments given for type`+t),n=n.concat(q.OPERAND(e[r],t[r]));else if(t===`SID`)n=n.concat(q.NUMBER(e));else if(t===`offset`)n=n.concat(q.NUMBER32(e));else if(t===`number`)n=n.concat(q.NUMBER(e));else if(t===`real`)n=n.concat(q.REAL(e));else throw Error(`Unknown operand type `+t);return n},q.OP=q.BYTE,J.OP=J.BYTE;var XL=typeof WeakMap==`function`&&new WeakMap;q.CHARSTRING=function(e){if(XL){var t=XL.get(e);if(t!==void 0)return t}for(var n=[],r=e.length,i=0;i<r;i+=1){var a=e[i];n=n.concat(q[a.type](a.value))}return XL&&XL.set(e,n),n},J.CHARSTRING=function(e){return q.CHARSTRING(e).length},q.OBJECT=function(e){var t=q[e.type];return K.argument(t!==void 0,`No encoding function for type `+e.type),t(e.value)},J.OBJECT=function(e){var t=J[e.type];return K.argument(t!==void 0,`No sizeOf function for type `+e.type),t(e.value)},q.TABLE=function(e){for(var t=[],n=e.fields.length,r=[],i=[],a=0;a<n;a+=1){var o=e.fields[a],s=q[o.type];K.argument(s!==void 0,`No encoding function for field type `+o.type+` (`+o.name+`)`);var c=e[o.name];c===void 0&&(c=o.value);var l=s(c);o.type===`TABLE`?(i.push(t.length),t=t.concat([0,0]),r.push(l)):t=t.concat(l)}for(var u=0;u<r.length;u+=1){var d=i[u],f=t.length;K.argument(f<65536,`Table `+e.tableName+` too big.`),t[d]=f>>8,t[d+1]=f&255,t=t.concat(r[u])}return t},J.TABLE=function(e){for(var t=0,n=e.fields.length,r=0;r<n;r+=1){var i=e.fields[r],a=J[i.type];K.argument(a!==void 0,`No sizeOf function for field type `+i.type+` (`+i.name+`)`);var o=e[i.name];o===void 0&&(o=i.value),t+=a(o),i.type===`TABLE`&&(t+=2)}return t},q.RECORD=q.TABLE,J.RECORD=J.TABLE,q.LITERAL=function(e){return e},J.LITERAL=function(e){return e.length};function ZL(e,t,n){if(t.length&&(t[0].name!==`coverageFormat`||t[0].value===1))for(var r=0;r<t.length;r+=1){var i=t[r];this[i.name]=i.value}if(this.tableName=e,this.fields=t,n)for(var a=Object.keys(n),o=0;o<a.length;o+=1){var s=a[o],c=n[s];this[s]!==void 0&&(this[s]=c)}}ZL.prototype.encode=function(){return q.TABLE(this)},ZL.prototype.sizeOf=function(){return J.TABLE(this)};function QL(e,t,n){n===void 0&&(n=t.length);var r=Array(t.length+1);r[0]={name:e+`Count`,type:`USHORT`,value:n};for(var i=0;i<t.length;i++)r[i+1]={name:e+i,type:`USHORT`,value:t[i]};return r}function $L(e,t,n){var r=t.length,i=Array(r+1);i[0]={name:e+`Count`,type:`USHORT`,value:r};for(var a=0;a<r;a++)i[a+1]={name:e+a,type:`TABLE`,value:n(t[a],a)};return i}function eR(e,t,n){var r=t.length,i=[];i[0]={name:e+`Count`,type:`USHORT`,value:r};for(var a=0;a<r;a++)i=i.concat(n(t[a],a));return i}function tR(e){e.format===1?ZL.call(this,`coverageTable`,[{name:`coverageFormat`,type:`USHORT`,value:1}].concat(QL(`glyph`,e.glyphs))):e.format===2?ZL.call(this,`coverageTable`,[{name:`coverageFormat`,type:`USHORT`,value:2}].concat(eR(`rangeRecord`,e.ranges,function(e){return[{name:`startGlyphID`,type:`USHORT`,value:e.start},{name:`endGlyphID`,type:`USHORT`,value:e.end},{name:`startCoverageIndex`,type:`USHORT`,value:e.index}]}))):K.assert(!1,`Coverage format must be 1 or 2.`)}tR.prototype=Object.create(ZL.prototype),tR.prototype.constructor=tR;function nR(e){ZL.call(this,`scriptListTable`,eR(`scriptRecord`,e,function(e,t){var n=e.script,r=n.defaultLangSys;return K.assert(!!r,`Unable to write GSUB: script `+e.tag+` has no default language system.`),[{name:`scriptTag`+t,type:`TAG`,value:e.tag},{name:`script`+t,type:`TABLE`,value:new ZL(`scriptTable`,[{name:`defaultLangSys`,type:`TABLE`,value:new ZL(`defaultLangSys`,[{name:`lookupOrder`,type:`USHORT`,value:0},{name:`reqFeatureIndex`,type:`USHORT`,value:r.reqFeatureIndex}].concat(QL(`featureIndex`,r.featureIndexes)))}].concat(eR(`langSys`,n.langSysRecords,function(e,t){var n=e.langSys;return[{name:`langSysTag`+t,type:`TAG`,value:e.tag},{name:`langSys`+t,type:`TABLE`,value:new ZL(`langSys`,[{name:`lookupOrder`,type:`USHORT`,value:0},{name:`reqFeatureIndex`,type:`USHORT`,value:n.reqFeatureIndex}].concat(QL(`featureIndex`,n.featureIndexes)))}]})))}]}))}nR.prototype=Object.create(ZL.prototype),nR.prototype.constructor=nR;function rR(e){ZL.call(this,`featureListTable`,eR(`featureRecord`,e,function(e,t){var n=e.feature;return[{name:`featureTag`+t,type:`TAG`,value:e.tag},{name:`feature`+t,type:`TABLE`,value:new ZL(`featureTable`,[{name:`featureParams`,type:`USHORT`,value:n.featureParams}].concat(QL(`lookupListIndex`,n.lookupListIndexes)))}]}))}rR.prototype=Object.create(ZL.prototype),rR.prototype.constructor=rR;function iR(e,t){ZL.call(this,`lookupListTable`,$L(`lookup`,e,function(e){var n=t[e.lookupType];return K.assert(!!n,`Unable to write GSUB lookup type `+e.lookupType+` tables.`),new ZL(`lookupTable`,[{name:`lookupType`,type:`USHORT`,value:e.lookupType},{name:`lookupFlag`,type:`USHORT`,value:e.lookupFlag}].concat($L(`subtable`,e.subtables,n)))}))}iR.prototype=Object.create(ZL.prototype),iR.prototype.constructor=iR;var Y={Table:ZL,Record:ZL,Coverage:tR,ScriptList:nR,FeatureList:rR,LookupList:iR,ushortList:QL,tableList:$L,recordList:eR};function aR(e,t){return e.getUint8(t)}function oR(e,t){return e.getUint16(t,!1)}function sR(e,t){return e.getInt16(t,!1)}function cR(e,t){return e.getUint32(t,!1)}function lR(e,t){return e.getInt16(t,!1)+e.getUint16(t+2,!1)/65535}function uR(e,t){for(var n=``,r=t;r<t+4;r+=1)n+=String.fromCharCode(e.getInt8(r));return n}function dR(e,t,n){for(var r=0,i=0;i<n;i+=1)r<<=8,r+=e.getUint8(t+i);return r}function fR(e,t,n){for(var r=[],i=t;i<n;i+=1)r.push(e.getUint8(i));return r}function pR(e){for(var t=``,n=0;n<e.length;n+=1)t+=String.fromCharCode(e[n]);return t}var mR={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function X(e,t){this.data=e,this.offset=t,this.relativeOffset=0}X.prototype.parseByte=function(){var e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},X.prototype.parseChar=function(){var e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},X.prototype.parseCard8=X.prototype.parseByte,X.prototype.parseUShort=function(){var e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},X.prototype.parseCard16=X.prototype.parseUShort,X.prototype.parseSID=X.prototype.parseUShort,X.prototype.parseOffset16=X.prototype.parseUShort,X.prototype.parseShort=function(){var e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},X.prototype.parseF2Dot14=function(){var e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e},X.prototype.parseULong=function(){var e=cR(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},X.prototype.parseOffset32=X.prototype.parseULong,X.prototype.parseFixed=function(){var e=lR(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},X.prototype.parseString=function(e){var t=this.data,n=this.offset+this.relativeOffset,r=``;this.relativeOffset+=e;for(var i=0;i<e;i++)r+=String.fromCharCode(t.getUint8(n+i));return r},X.prototype.parseTag=function(){return this.parseString(4)},X.prototype.parseLongDateTime=function(){var e=cR(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e},X.prototype.parseVersion=function(e){var t=oR(this.data,this.offset+this.relativeOffset),n=oR(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,e===void 0&&(e=4096),t+n/e/10},X.prototype.skip=function(e,t){t===void 0&&(t=1),this.relativeOffset+=mR[e]*t},X.prototype.parseULongList=function(e){e===void 0&&(e=this.parseULong());for(var t=Array(e),n=this.data,r=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=n.getUint32(r),r+=4;return this.relativeOffset+=e*4,t},X.prototype.parseOffset16List=X.prototype.parseUShortList=function(e){e===void 0&&(e=this.parseUShort());for(var t=Array(e),n=this.data,r=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=n.getUint16(r),r+=2;return this.relativeOffset+=e*2,t},X.prototype.parseShortList=function(e){for(var t=Array(e),n=this.data,r=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=n.getInt16(r),r+=2;return this.relativeOffset+=e*2,t},X.prototype.parseByteList=function(e){for(var t=Array(e),n=this.data,r=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=n.getUint8(r++);return this.relativeOffset+=e,t},X.prototype.parseList=function(e,t){t||(t=e,e=this.parseUShort());for(var n=Array(e),r=0;r<e;r++)n[r]=t.call(this);return n},X.prototype.parseList32=function(e,t){t||(t=e,e=this.parseULong());for(var n=Array(e),r=0;r<e;r++)n[r]=t.call(this);return n},X.prototype.parseRecordList=function(e,t){t||(t=e,e=this.parseUShort());for(var n=Array(e),r=Object.keys(t),i=0;i<e;i++){for(var a={},o=0;o<r.length;o++){var s=r[o];a[s]=t[s].call(this)}n[i]=a}return n},X.prototype.parseRecordList32=function(e,t){t||(t=e,e=this.parseULong());for(var n=Array(e),r=Object.keys(t),i=0;i<e;i++){for(var a={},o=0;o<r.length;o++){var s=r[o];a[s]=t[s].call(this)}n[i]=a}return n},X.prototype.parseStruct=function(e){if(typeof e==`function`)return e.call(this);for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var i=t[r];n[i]=e[i].call(this)}return n},X.prototype.parseValueRecord=function(e){if(e===void 0&&(e=this.parseUShort()),e!==0){var t={};return e&1&&(t.xPlacement=this.parseShort()),e&2&&(t.yPlacement=this.parseShort()),e&4&&(t.xAdvance=this.parseShort()),e&8&&(t.yAdvance=this.parseShort()),e&16&&(t.xPlaDevice=void 0,this.parseShort()),e&32&&(t.yPlaDevice=void 0,this.parseShort()),e&64&&(t.xAdvDevice=void 0,this.parseShort()),e&128&&(t.yAdvDevice=void 0,this.parseShort()),t}},X.prototype.parseValueRecordList=function(){for(var e=this.parseUShort(),t=this.parseUShort(),n=Array(t),r=0;r<t;r++)n[r]=this.parseValueRecord(e);return n},X.prototype.parsePointer=function(e){var t=this.parseOffset16();if(t>0)return new X(this.data,this.offset+t).parseStruct(e)},X.prototype.parsePointer32=function(e){var t=this.parseOffset32();if(t>0)return new X(this.data,this.offset+t).parseStruct(e)},X.prototype.parseListOfLists=function(e){for(var t=this.parseOffset16List(),n=t.length,r=this.relativeOffset,i=Array(n),a=0;a<n;a++){var o=t[a];if(o===0){i[a]=void 0;continue}if(this.relativeOffset=o,e){for(var s=this.parseOffset16List(),c=Array(s.length),l=0;l<s.length;l++)this.relativeOffset=o+s[l],c[l]=e.call(this);i[a]=c}else i[a]=this.parseUShortList()}return this.relativeOffset=r,i},X.prototype.parseCoverage=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort(),n=this.parseUShort();if(t===1)return{format:1,glyphs:this.parseUShortList(n)};if(t===2){for(var r=Array(n),i=0;i<n;i++)r[i]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:r}}throw Error(`0x`+e.toString(16)+`: Coverage format must be 1 or 2.`)},X.prototype.parseClassDef=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(t===2)return{format:2,ranges:this.parseRecordList({start:X.uShort,end:X.uShort,classId:X.uShort})};throw Error(`0x`+e.toString(16)+`: ClassDef format must be 1 or 2.`)},X.list=function(e,t){return function(){return this.parseList(e,t)}},X.list32=function(e,t){return function(){return this.parseList32(e,t)}},X.recordList=function(e,t){return function(){return this.parseRecordList(e,t)}},X.recordList32=function(e,t){return function(){return this.parseRecordList32(e,t)}},X.pointer=function(e){return function(){return this.parsePointer(e)}},X.pointer32=function(e){return function(){return this.parsePointer32(e)}},X.tag=X.prototype.parseTag,X.byte=X.prototype.parseByte,X.uShort=X.offset16=X.prototype.parseUShort,X.uShortList=X.prototype.parseUShortList,X.uLong=X.offset32=X.prototype.parseULong,X.uLongList=X.prototype.parseULongList,X.struct=X.prototype.parseStruct,X.coverage=X.prototype.parseCoverage,X.classDef=X.prototype.parseClassDef;var hR={reserved:X.uShort,reqFeatureIndex:X.uShort,featureIndexes:X.uShortList};X.prototype.parseScriptList=function(){return this.parsePointer(X.recordList({tag:X.tag,script:X.pointer({defaultLangSys:X.pointer(hR),langSysRecords:X.recordList({tag:X.tag,langSys:X.pointer(hR)})})}))||[]},X.prototype.parseFeatureList=function(){return this.parsePointer(X.recordList({tag:X.tag,feature:X.pointer({featureParams:X.offset16,lookupListIndexes:X.uShortList})}))||[]},X.prototype.parseLookupList=function(e){return this.parsePointer(X.list(X.pointer(function(){var t=this.parseUShort();K.argument(1<=t&&t<=9,`GPOS/GSUB lookup type `+t+` unknown.`);var n=this.parseUShort(),r=n&16;return{lookupType:t,lookupFlag:n,subtables:this.parseList(X.pointer(e[t])),markFilteringSet:r?this.parseUShort():void 0}})))||[]},X.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){var e=this.parseUShort(),t=this.parseUShort();return K.argument(e===1&&t<1,`GPOS/GSUB feature variations table unknown.`),this.parseRecordList32({conditionSetOffset:X.offset32,featureTableSubstitutionOffset:X.offset32})})||[]};var Z={getByte:aR,getCard8:aR,getUShort:oR,getCard16:oR,getShort:sR,getULong:cR,getFixed:lR,getTag:uR,getOffset:dR,getBytes:fR,bytesToString:pR,Parser:X};function gR(e,t){t.parseUShort(),e.length=t.parseULong(),e.language=t.parseULong();var n;e.groupCount=n=t.parseULong(),e.glyphIndexMap={};for(var r=0;r<n;r+=1)for(var i=t.parseULong(),a=t.parseULong(),o=t.parseULong(),s=i;s<=a;s+=1)e.glyphIndexMap[s]=o,o++}function _R(e,t,n,r,i){e.length=t.parseUShort(),e.language=t.parseUShort();var a;e.segCount=a=t.parseUShort()>>1,t.skip(`uShort`,3),e.glyphIndexMap={};for(var o=new Z.Parser(n,r+i+14),s=new Z.Parser(n,r+i+16+a*2),c=new Z.Parser(n,r+i+16+a*4),l=new Z.Parser(n,r+i+16+a*6),u=r+i+16+a*8,d=0;d<a-1;d+=1)for(var f=void 0,p=o.parseUShort(),m=s.parseUShort(),h=c.parseShort(),g=l.parseUShort(),_=m;_<=p;_+=1)g===0?f=_+h&65535:(u=l.offset+l.relativeOffset-2,u+=g,u+=(_-m)*2,f=Z.getUShort(n,u),f!==0&&(f=f+h&65535)),e.glyphIndexMap[_]=f}function vR(e,t){var n={};n.version=Z.getUShort(e,t),K.argument(n.version===0,`cmap table version should be 0.`),n.numTables=Z.getUShort(e,t+2);for(var r=-1,i=n.numTables-1;i>=0;--i){var a=Z.getUShort(e,t+4+i*8),o=Z.getUShort(e,t+4+i*8+2);if(a===3&&(o===0||o===1||o===10)||a===0&&(o===0||o===1||o===2||o===3||o===4)){r=Z.getULong(e,t+4+i*8+4);break}}if(r===-1)throw Error(`No valid cmap sub-tables found.`);var s=new Z.Parser(e,t+r);if(n.format=s.parseUShort(),n.format===12)gR(n,s);else if(n.format===4)_R(n,s,e,t,r);else throw Error(`Only format 4 and 12 cmap tables are supported (found format `+n.format+`).`);return n}function yR(e,t,n){e.segments.push({end:t,start:t,delta:-(t-n),offset:0,glyphIndex:n})}function bR(e){e.segments.push({end:65535,start:65535,delta:1,offset:0})}function xR(e){var t=!0,n;for(n=e.length-1;n>0;--n)if(e.get(n).unicode>65535){console.log(`Adding CMAP format 12 (needed!)`),t=!1;break}var r=[{name:`version`,type:`USHORT`,value:0},{name:`numTables`,type:`USHORT`,value:t?1:2},{name:`platformID`,type:`USHORT`,value:3},{name:`encodingID`,type:`USHORT`,value:1},{name:`offset`,type:`ULONG`,value:t?12:20}];t||(r=r.concat([{name:`cmap12PlatformID`,type:`USHORT`,value:3},{name:`cmap12EncodingID`,type:`USHORT`,value:10},{name:`cmap12Offset`,type:`ULONG`,value:0}])),r=r.concat([{name:`format`,type:`USHORT`,value:4},{name:`cmap4Length`,type:`USHORT`,value:0},{name:`language`,type:`USHORT`,value:0},{name:`segCountX2`,type:`USHORT`,value:0},{name:`searchRange`,type:`USHORT`,value:0},{name:`entrySelector`,type:`USHORT`,value:0},{name:`rangeShift`,type:`USHORT`,value:0}]);var i=new Y.Table(`cmap`,r);for(i.segments=[],n=0;n<e.length;n+=1){for(var a=e.get(n),o=0;o<a.unicodes.length;o+=1)yR(i,a.unicodes[o],n);i.segments=i.segments.sort(function(e,t){return e.start-t.start})}bR(i);var s=i.segments.length,c=0,l=[],u=[],d=[],f=[],p=[],m=[];for(n=0;n<s;n+=1){var h=i.segments[n];h.end<=65535&&h.start<=65535?(l=l.concat({name:`end_`+n,type:`USHORT`,value:h.end}),u=u.concat({name:`start_`+n,type:`USHORT`,value:h.start}),d=d.concat({name:`idDelta_`+n,type:`SHORT`,value:h.delta}),f=f.concat({name:`idRangeOffset_`+n,type:`USHORT`,value:h.offset}),h.glyphId!==void 0&&(p=p.concat({name:`glyph_`+n,type:`USHORT`,value:h.glyphId}))):c+=1,!t&&h.glyphIndex!==void 0&&(m=m.concat({name:`cmap12Start_`+n,type:`ULONG`,value:h.start}),m=m.concat({name:`cmap12End_`+n,type:`ULONG`,value:h.end}),m=m.concat({name:`cmap12Glyph_`+n,type:`ULONG`,value:h.glyphIndex}))}if(i.segCountX2=(s-c)*2,i.searchRange=2**Math.floor(Math.log(s-c)/Math.log(2))*2,i.entrySelector=Math.log(i.searchRange/2)/Math.log(2),i.rangeShift=i.segCountX2-i.searchRange,i.fields=i.fields.concat(l),i.fields.push({name:`reservedPad`,type:`USHORT`,value:0}),i.fields=i.fields.concat(u),i.fields=i.fields.concat(d),i.fields=i.fields.concat(f),i.fields=i.fields.concat(p),i.cmap4Length=14+l.length*2+2+u.length*2+d.length*2+f.length*2+p.length*2,!t){var g=16+m.length*4;i.cmap12Offset=20+i.cmap4Length,i.fields=i.fields.concat([{name:`cmap12Format`,type:`USHORT`,value:12},{name:`cmap12Reserved`,type:`USHORT`,value:0},{name:`cmap12Length`,type:`ULONG`,value:g},{name:`cmap12Language`,type:`ULONG`,value:0},{name:`cmap12nGroups`,type:`ULONG`,value:m.length/3}]),i.fields=i.fields.concat(m)}return i}var SR={parse:vR,make:xR},CR=`.notdef,space,exclam,quotedbl,numbersign,dollar,percent,ampersand,quoteright,parenleft,parenright,asterisk,plus,comma,hyphen,period,slash,zero,one,two,three,four,five,six,seven,eight,nine,colon,semicolon,less,equal,greater,question,at,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,bracketleft,backslash,bracketright,asciicircum,underscore,quoteleft,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,braceleft,bar,braceright,asciitilde,exclamdown,cent,sterling,fraction,yen,florin,section,currency,quotesingle,quotedblleft,guillemotleft,guilsinglleft,guilsinglright,fi,fl,endash,dagger,daggerdbl,periodcentered,paragraph,bullet,quotesinglbase,quotedblbase,quotedblright,guillemotright,ellipsis,perthousand,questiondown,grave,acute,circumflex,tilde,macron,breve,dotaccent,dieresis,ring,cedilla,hungarumlaut,ogonek,caron,emdash,AE,ordfeminine,Lslash,Oslash,OE,ordmasculine,ae,dotlessi,lslash,oslash,oe,germandbls,onesuperior,logicalnot,mu,trademark,Eth,onehalf,plusminus,Thorn,onequarter,divide,brokenbar,degree,thorn,threequarters,twosuperior,registered,minus,eth,multiply,threesuperior,copyright,Aacute,Acircumflex,Adieresis,Agrave,Aring,Atilde,Ccedilla,Eacute,Ecircumflex,Edieresis,Egrave,Iacute,Icircumflex,Idieresis,Igrave,Ntilde,Oacute,Ocircumflex,Odieresis,Ograve,Otilde,Scaron,Uacute,Ucircumflex,Udieresis,Ugrave,Yacute,Ydieresis,Zcaron,aacute,acircumflex,adieresis,agrave,aring,atilde,ccedilla,eacute,ecircumflex,edieresis,egrave,iacute,icircumflex,idieresis,igrave,ntilde,oacute,ocircumflex,odieresis,ograve,otilde,scaron,uacute,ucircumflex,udieresis,ugrave,yacute,ydieresis,zcaron,exclamsmall,Hungarumlautsmall,dollaroldstyle,dollarsuperior,ampersandsmall,Acutesmall,parenleftsuperior,parenrightsuperior,266 ff,onedotenleader,zerooldstyle,oneoldstyle,twooldstyle,threeoldstyle,fouroldstyle,fiveoldstyle,sixoldstyle,sevenoldstyle,eightoldstyle,nineoldstyle,commasuperior,threequartersemdash,periodsuperior,questionsmall,asuperior,bsuperior,centsuperior,dsuperior,esuperior,isuperior,lsuperior,msuperior,nsuperior,osuperior,rsuperior,ssuperior,tsuperior,ff,ffi,ffl,parenleftinferior,parenrightinferior,Circumflexsmall,hyphensuperior,Gravesmall,Asmall,Bsmall,Csmall,Dsmall,Esmall,Fsmall,Gsmall,Hsmall,Ismall,Jsmall,Ksmall,Lsmall,Msmall,Nsmall,Osmall,Psmall,Qsmall,Rsmall,Ssmall,Tsmall,Usmall,Vsmall,Wsmall,Xsmall,Ysmall,Zsmall,colonmonetary,onefitted,rupiah,Tildesmall,exclamdownsmall,centoldstyle,Lslashsmall,Scaronsmall,Zcaronsmall,Dieresissmall,Brevesmall,Caronsmall,Dotaccentsmall,Macronsmall,figuredash,hypheninferior,Ogoneksmall,Ringsmall,Cedillasmall,questiondownsmall,oneeighth,threeeighths,fiveeighths,seveneighths,onethird,twothirds,zerosuperior,foursuperior,fivesuperior,sixsuperior,sevensuperior,eightsuperior,ninesuperior,zeroinferior,oneinferior,twoinferior,threeinferior,fourinferior,fiveinferior,sixinferior,seveninferior,eightinferior,nineinferior,centinferior,dollarinferior,periodinferior,commainferior,Agravesmall,Aacutesmall,Acircumflexsmall,Atildesmall,Adieresissmall,Aringsmall,AEsmall,Ccedillasmall,Egravesmall,Eacutesmall,Ecircumflexsmall,Edieresissmall,Igravesmall,Iacutesmall,Icircumflexsmall,Idieresissmall,Ethsmall,Ntildesmall,Ogravesmall,Oacutesmall,Ocircumflexsmall,Otildesmall,Odieresissmall,OEsmall,Oslashsmall,Ugravesmall,Uacutesmall,Ucircumflexsmall,Udieresissmall,Yacutesmall,Thornsmall,Ydieresissmall,001.000,001.001,001.002,001.003,Black,Bold,Book,Light,Medium,Regular,Roman,Semibold`.split(`,`),wR=`................................space.exclam.quotedbl.numbersign.dollar.percent.ampersand.quoteright.parenleft.parenright.asterisk.plus.comma.hyphen.period.slash.zero.one.two.three.four.five.six.seven.eight.nine.colon.semicolon.less.equal.greater.question.at.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.bracketleft.backslash.bracketright.asciicircum.underscore.quoteleft.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.braceleft.bar.braceright.asciitilde...................................exclamdown.cent.sterling.fraction.yen.florin.section.currency.quotesingle.quotedblleft.guillemotleft.guilsinglleft.guilsinglright.fi.fl..endash.dagger.daggerdbl.periodcentered..paragraph.bullet.quotesinglbase.quotedblbase.quotedblright.guillemotright.ellipsis.perthousand..questiondown..grave.acute.circumflex.tilde.macron.breve.dotaccent.dieresis..ring.cedilla..hungarumlaut.ogonek.caron.emdash.................AE..ordfeminine.....Lslash.Oslash.OE.ordmasculine......ae....dotlessi...lslash.oslash.oe.germandbls`.split(`.`),TR=`................................space.exclamsmall.Hungarumlautsmall..dollaroldstyle.dollarsuperior.ampersandsmall.Acutesmall.parenleftsuperior.parenrightsuperior.twodotenleader.onedotenleader.comma.hyphen.period.fraction.zerooldstyle.oneoldstyle.twooldstyle.threeoldstyle.fouroldstyle.fiveoldstyle.sixoldstyle.sevenoldstyle.eightoldstyle.nineoldstyle.colon.semicolon.commasuperior.threequartersemdash.periodsuperior.questionsmall..asuperior.bsuperior.centsuperior.dsuperior.esuperior...isuperior...lsuperior.msuperior.nsuperior.osuperior...rsuperior.ssuperior.tsuperior..ff.fi.fl.ffi.ffl.parenleftinferior..parenrightinferior.Circumflexsmall.hyphensuperior.Gravesmall.Asmall.Bsmall.Csmall.Dsmall.Esmall.Fsmall.Gsmall.Hsmall.Ismall.Jsmall.Ksmall.Lsmall.Msmall.Nsmall.Osmall.Psmall.Qsmall.Rsmall.Ssmall.Tsmall.Usmall.Vsmall.Wsmall.Xsmall.Ysmall.Zsmall.colonmonetary.onefitted.rupiah.Tildesmall...................................exclamdownsmall.centoldstyle.Lslashsmall...Scaronsmall.Zcaronsmall.Dieresissmall.Brevesmall.Caronsmall..Dotaccentsmall...Macronsmall...figuredash.hypheninferior...Ogoneksmall.Ringsmall.Cedillasmall....onequarter.onehalf.threequarters.questiondownsmall.oneeighth.threeeighths.fiveeighths.seveneighths.onethird.twothirds...zerosuperior.onesuperior.twosuperior.threesuperior.foursuperior.fivesuperior.sixsuperior.sevensuperior.eightsuperior.ninesuperior.zeroinferior.oneinferior.twoinferior.threeinferior.fourinferior.fiveinferior.sixinferior.seveninferior.eightinferior.nineinferior.centinferior.dollarinferior.periodinferior.commainferior.Agravesmall.Aacutesmall.Acircumflexsmall.Atildesmall.Adieresissmall.Aringsmall.AEsmall.Ccedillasmall.Egravesmall.Eacutesmall.Ecircumflexsmall.Edieresissmall.Igravesmall.Iacutesmall.Icircumflexsmall.Idieresissmall.Ethsmall.Ntildesmall.Ogravesmall.Oacutesmall.Ocircumflexsmall.Otildesmall.Odieresissmall.OEsmall.Oslashsmall.Ugravesmall.Uacutesmall.Ucircumflexsmall.Udieresissmall.Yacutesmall.Thornsmall.Ydieresissmall`.split(`.`),ER=`.notdef,.null,nonmarkingreturn,space,exclam,quotedbl,numbersign,dollar,percent,ampersand,quotesingle,parenleft,parenright,asterisk,plus,comma,hyphen,period,slash,zero,one,two,three,four,five,six,seven,eight,nine,colon,semicolon,less,equal,greater,question,at,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,bracketleft,backslash,bracketright,asciicircum,underscore,grave,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,braceleft,bar,braceright,asciitilde,Adieresis,Aring,Ccedilla,Eacute,Ntilde,Odieresis,Udieresis,aacute,agrave,acircumflex,adieresis,atilde,aring,ccedilla,eacute,egrave,ecircumflex,edieresis,iacute,igrave,icircumflex,idieresis,ntilde,oacute,ograve,ocircumflex,odieresis,otilde,uacute,ugrave,ucircumflex,udieresis,dagger,degree,cent,sterling,section,bullet,paragraph,germandbls,registered,copyright,trademark,acute,dieresis,notequal,AE,Oslash,infinity,plusminus,lessequal,greaterequal,yen,mu,partialdiff,summation,product,pi,integral,ordfeminine,ordmasculine,Omega,ae,oslash,questiondown,exclamdown,logicalnot,radical,florin,approxequal,Delta,guillemotleft,guillemotright,ellipsis,nonbreakingspace,Agrave,Atilde,Otilde,OE,oe,endash,emdash,quotedblleft,quotedblright,quoteleft,quoteright,divide,lozenge,ydieresis,Ydieresis,fraction,currency,guilsinglleft,guilsinglright,fi,fl,daggerdbl,periodcentered,quotesinglbase,quotedblbase,perthousand,Acircumflex,Ecircumflex,Aacute,Edieresis,Egrave,Iacute,Icircumflex,Idieresis,Igrave,Oacute,Ocircumflex,apple,Ograve,Uacute,Ucircumflex,Ugrave,dotlessi,circumflex,tilde,macron,breve,dotaccent,ring,cedilla,hungarumlaut,ogonek,caron,Lslash,lslash,Scaron,scaron,Zcaron,zcaron,brokenbar,Eth,eth,Yacute,yacute,Thorn,thorn,minus,multiply,onesuperior,twosuperior,threesuperior,onehalf,onequarter,threequarters,franc,Gbreve,gbreve,Idotaccent,Scedilla,scedilla,Cacute,cacute,Ccaron,ccaron,dcroat`.split(`,`);function DR(e){this.font=e}DR.prototype.charToGlyphIndex=function(e){var t=e.codePointAt(0),n=this.font.glyphs;if(n){for(var r=0;r<n.length;r+=1)for(var i=n.get(r),a=0;a<i.unicodes.length;a+=1)if(i.unicodes[a]===t)return r}return null};function OR(e){this.cmap=e}OR.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.codePointAt(0)]||0};function kR(e,t){this.encoding=e,this.charset=t}kR.prototype.charToGlyphIndex=function(e){var t=e.codePointAt(0),n=this.encoding[t];return this.charset.indexOf(n)};function AR(e){switch(e.version){case 1:this.names=ER.slice();break;case 2:this.names=Array(e.numberOfGlyphs);for(var t=0;t<e.numberOfGlyphs;t++)e.glyphNameIndex[t]<ER.length?this.names[t]=ER[e.glyphNameIndex[t]]:this.names[t]=e.names[e.glyphNameIndex[t]-ER.length];break;case 2.5:this.names=Array(e.numberOfGlyphs);for(var n=0;n<e.numberOfGlyphs;n++)this.names[n]=ER[n+e.glyphNameIndex[n]];break;case 3:this.names=[];break;default:this.names=[];break}}AR.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)},AR.prototype.glyphIndexToName=function(e){return this.names[e]};function jR(e){for(var t,n=e.tables.cmap.glyphIndexMap,r=Object.keys(n),i=0;i<r.length;i+=1){var a=r[i],o=n[a];t=e.glyphs.get(o),t.addUnicode(parseInt(a))}for(var s=0;s<e.glyphs.length;s+=1)t=e.glyphs.get(s),e.cffEncoding?e.isCIDFont?t.name=`gid`+s:t.name=e.cffEncoding.charset[s]:e.glyphNames.names&&(t.name=e.glyphNames.glyphIndexToName(s))}function MR(e){e._IndexToUnicodeMap={};for(var t=e.tables.cmap.glyphIndexMap,n=Object.keys(t),r=0;r<n.length;r+=1){var i=n[r],a=t[i];e._IndexToUnicodeMap[a]===void 0?e._IndexToUnicodeMap[a]={unicodes:[parseInt(i)]}:e._IndexToUnicodeMap[a].unicodes.push(parseInt(i))}}function NR(e,t){t.lowMemory?MR(e):jR(e)}function PR(e,t,n,r,i){e.beginPath(),e.moveTo(t,n),e.lineTo(r,i),e.stroke()}var FR={line:PR};function IR(e,t){var n=t||new FL;return{configurable:!0,get:function(){return typeof n==`function`&&(n=n()),n},set:function(e){n=e}}}function LR(e){this.bindConstructorValues(e)}LR.prototype.bindConstructorValues=function(e){this.index=e.index||0,this.name=e.name||null,this.unicode=e.unicode||void 0,this.unicodes=e.unicodes||e.unicode!==void 0?[e.unicode]:[],`xMin`in e&&(this.xMin=e.xMin),`yMin`in e&&(this.yMin=e.yMin),`xMax`in e&&(this.xMax=e.xMax),`yMax`in e&&(this.yMax=e.yMax),`advanceWidth`in e&&(this.advanceWidth=e.advanceWidth),Object.defineProperty(this,"path",IR(this,e.path))},LR.prototype.addUnicode=function(e){this.unicodes.length===0&&(this.unicode=e),this.unicodes.push(e)},LR.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},LR.prototype.getPath=function(e,t,n,r,i){e=e===void 0?0:e,t=t===void 0?0:t,n=n===void 0?72:n;var a,o;r||={};var s=r.xScale,c=r.yScale;if(r.hinting&&i&&i.hinting&&(o=this.path&&i.hinting.exec(this,n)),o)a=i.hinting.getCommands(o),e=Math.round(e),t=Math.round(t),s=c=1;else{a=this.path.commands;var l=1/(this.path.unitsPerEm||1e3)*n;s===void 0&&(s=l),c===void 0&&(c=l)}for(var u=new FL,d=0;d<a.length;d+=1){var f=a[d];f.type===`M`?u.moveTo(e+f.x*s,t+-f.y*c):f.type===`L`?u.lineTo(e+f.x*s,t+-f.y*c):f.type===`Q`?u.quadraticCurveTo(e+f.x1*s,t+-f.y1*c,e+f.x*s,t+-f.y*c):f.type===`C`?u.curveTo(e+f.x1*s,t+-f.y1*c,e+f.x2*s,t+-f.y2*c,e+f.x*s,t+-f.y*c):f.type===`Z`&&u.closePath()}return u},LR.prototype.getContours=function(){if(this.points===void 0)return[];for(var e=[],t=[],n=0;n<this.points.length;n+=1){var r=this.points[n];t.push(r),r.lastPointOfContour&&(e.push(t),t=[])}return K.argument(t.length===0,`There are still points left in the current contour.`),e},LR.prototype.getMetrics=function(){for(var e=this.path.commands,t=[],n=[],r=0;r<e.length;r+=1){var i=e[r];i.type!==`Z`&&(t.push(i.x),n.push(i.y)),(i.type===`Q`||i.type===`C`)&&(t.push(i.x1),n.push(i.y1)),i.type===`C`&&(t.push(i.x2),n.push(i.y2))}var a={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,t),yMax:Math.max.apply(null,n),leftSideBearing:this.leftSideBearing};return isFinite(a.xMin)||(a.xMin=0),isFinite(a.xMax)||(a.xMax=this.advanceWidth),isFinite(a.yMin)||(a.yMin=0),isFinite(a.yMax)||(a.yMax=0),a.rightSideBearing=this.advanceWidth-a.leftSideBearing-(a.xMax-a.xMin),a},LR.prototype.draw=function(e,t,n,r,i){this.getPath(t,n,r,i).draw(e)},LR.prototype.drawPoints=function(e,t,n,r){function i(t,n,r,i){e.beginPath();for(var a=0;a<t.length;a+=1)e.moveTo(n+t[a].x*i,r+t[a].y*i),e.arc(n+t[a].x*i,r+t[a].y*i,2,0,Math.PI*2,!1);e.closePath(),e.fill()}t=t===void 0?0:t,n=n===void 0?0:n,r=r===void 0?24:r;for(var a=1/this.path.unitsPerEm*r,o=[],s=[],c=this.path,l=0;l<c.commands.length;l+=1){var u=c.commands[l];u.x!==void 0&&o.push({x:u.x,y:-u.y}),u.x1!==void 0&&s.push({x:u.x1,y:-u.y1}),u.x2!==void 0&&s.push({x:u.x2,y:-u.y2})}e.fillStyle=`blue`,i(o,t,n,a),e.fillStyle=`red`,i(s,t,n,a)},LR.prototype.drawMetrics=function(e,t,n,r){var i;t=t===void 0?0:t,n=n===void 0?0:n,r=r===void 0?24:r,i=1/this.path.unitsPerEm*r,e.lineWidth=1,e.strokeStyle=`black`,FR.line(e,t,-1e4,t,1e4),FR.line(e,-1e4,n,1e4,n);var a=this.xMin||0,o=this.yMin||0,s=this.xMax||0,c=this.yMax||0,l=this.advanceWidth||0;e.strokeStyle=`blue`,FR.line(e,t+a*i,-1e4,t+a*i,1e4),FR.line(e,t+s*i,-1e4,t+s*i,1e4),FR.line(e,-1e4,n+-o*i,1e4,n+-o*i),FR.line(e,-1e4,n+-c*i,1e4,n+-c*i),e.strokeStyle=`green`,FR.line(e,t+l*i,-1e4,t+l*i,1e4)};function RR(e,t,n){Object.defineProperty(e,t,{get:function(){return e.path,e[n]},set:function(t){e[n]=t},enumerable:!0,configurable:!0})}function zR(e,t){if(this.font=e,this.glyphs={},Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];r.path.unitsPerEm=e.unitsPerEm,this.glyphs[n]=r}this.length=t&&t.length||0}zR.prototype.get=function(e){if(this.glyphs[e]===void 0){this.font._push(e),typeof this.glyphs[e]==`function`&&(this.glyphs[e]=this.glyphs[e]());var t=this.glyphs[e],n=this.font._IndexToUnicodeMap[e];if(n)for(var r=0;r<n.unicodes.length;r++)t.addUnicode(n.unicodes[r]);this.font.cffEncoding?this.font.isCIDFont?t.name=`gid`+e:t.name=this.font.cffEncoding.charset[e]:this.font.glyphNames.names&&(t.name=this.font.glyphNames.glyphIndexToName(e)),this.glyphs[e].advanceWidth=this.font._hmtxTableData[e].advanceWidth,this.glyphs[e].leftSideBearing=this.font._hmtxTableData[e].leftSideBearing}else typeof this.glyphs[e]==`function`&&(this.glyphs[e]=this.glyphs[e]());return this.glyphs[e]},zR.prototype.push=function(e,t){this.glyphs[e]=t,this.length++};function BR(e,t){return new LR({index:t,font:e})}function VR(e,t,n,r,i,a){return function(){var o=new LR({index:t,font:e});return o.path=function(){n(o,r,i);var t=a(e.glyphs,o);return t.unitsPerEm=e.unitsPerEm,t},RR(o,`xMin`,`_xMin`),RR(o,`xMax`,`_xMax`),RR(o,`yMin`,`_yMin`),RR(o,`yMax`,`_yMax`),o}}function HR(e,t,n,r){return function(){var i=new LR({index:t,font:e});return i.path=function(){var t=n(e,i,r);return t.unitsPerEm=e.unitsPerEm,t},i}}var UR={GlyphSet:zR,glyphLoader:BR,ttfGlyphLoader:VR,cffGlyphLoader:HR};function WR(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n+=1)if(!WR(e[n],t[n]))return!1;return!0}else return!1}function GR(e){return e.length<1240?107:e.length<33900?1131:32768}function KR(e,t,n){var r=[],i=[],a=Z.getCard16(e,t),o,s;if(a!==0){var c=Z.getByte(e,t+2);o=t+(a+1)*c+2;for(var l=t+3,u=0;u<a+1;u+=1)r.push(Z.getOffset(e,l,c)),l+=c;s=o+r[a]}else s=t+2;for(var d=0;d<r.length-1;d+=1){var f=Z.getBytes(e,o+r[d],o+r[d+1]);n&&(f=n(f)),i.push(f)}return{objects:i,startOffset:t,endOffset:s}}function qR(e,t){var n=[],r=Z.getCard16(e,t),i,a;if(r!==0){var o=Z.getByte(e,t+2);i=t+(r+1)*o+2;for(var s=t+3,c=0;c<r+1;c+=1)n.push(Z.getOffset(e,s,o)),s+=o;a=i+n[r]}else a=t+2;return{offsets:n,startOffset:t,endOffset:a}}function JR(e,t,n,r,i){var a=Z.getCard16(n,r),o=0;if(a!==0){var s=Z.getByte(n,r+2);o=r+(a+1)*s+2}var c=Z.getBytes(n,o+t[e],o+t[e+1]);return i&&(c=i(c)),c}function YR(e){for(var t=``,n=15,r=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`.`,`E`,`E-`,null,`-`];;){var i=e.parseByte(),a=i>>4,o=i&15;if(a===n||(t+=r[a],o===n))break;t+=r[o]}return parseFloat(t)}function XR(e,t){var n,r,i,a;if(t===28)return n=e.parseByte(),r=e.parseByte(),n<<8|r;if(t===29)return n=e.parseByte(),r=e.parseByte(),i=e.parseByte(),a=e.parseByte(),n<<24|r<<16|i<<8|a;if(t===30)return YR(e);if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return n=e.parseByte(),(t-247)*256+n+108;if(t>=251&&t<=254)return n=e.parseByte(),-(t-251)*256-n-108;throw Error(`Invalid b0 `+t)}function ZR(e){for(var t={},n=0;n<e.length;n+=1){var r=e[n][0],i=e[n][1],a=void 0;if(a=i.length===1?i[0]:i,t.hasOwnProperty(r)&&!isNaN(t[r]))throw Error(`Object `+t+` already has key `+r);t[r]=a}return t}function QR(e,t,n){t=t===void 0?0:t;var r=new Z.Parser(e,t),i=[],a=[];for(n=n===void 0?e.length:n;r.relativeOffset<n;){var o=r.parseByte();o<=21?(o===12&&(o=1200+r.parseByte()),i.push([o,a]),a=[]):a.push(XR(r,o))}return ZR(i)}function $R(e,t){return t=t<=390?CR[t]:e[t-391],t}function ez(e,t,n){for(var r={},i,a=0;a<t.length;a+=1){var o=t[a];if(Array.isArray(o.type)){var s=[];s.length=o.type.length;for(var c=0;c<o.type.length;c++)i=e[o.op]===void 0?void 0:e[o.op][c],i===void 0&&(i=o.value!==void 0&&o.value[c]!==void 0?o.value[c]:null),o.type[c]===`SID`&&(i=$R(n,i)),s[c]=i;r[o.name]=s}else i=e[o.op],i===void 0&&(i=o.value===void 0?null:o.value),o.type===`SID`&&(i=$R(n,i)),r[o.name]=i}return r}function tz(e,t){var n={};return n.formatMajor=Z.getCard8(e,t),n.formatMinor=Z.getCard8(e,t+1),n.size=Z.getCard8(e,t+2),n.offsetSize=Z.getCard8(e,t+3),n.startOffset=t,n.endOffset=t+4,n}var nz=[{name:`version`,op:0,type:`SID`},{name:`notice`,op:1,type:`SID`},{name:`copyright`,op:1200,type:`SID`},{name:`fullName`,op:2,type:`SID`},{name:`familyName`,op:3,type:`SID`},{name:`weight`,op:4,type:`SID`},{name:`isFixedPitch`,op:1201,type:`number`,value:0},{name:`italicAngle`,op:1202,type:`number`,value:0},{name:`underlinePosition`,op:1203,type:`number`,value:-100},{name:`underlineThickness`,op:1204,type:`number`,value:50},{name:`paintType`,op:1205,type:`number`,value:0},{name:`charstringType`,op:1206,type:`number`,value:2},{name:`fontMatrix`,op:1207,type:[`real`,`real`,`real`,`real`,`real`,`real`],value:[.001,0,0,.001,0,0]},{name:`uniqueId`,op:13,type:`number`},{name:`fontBBox`,op:5,type:[`number`,`number`,`number`,`number`],value:[0,0,0,0]},{name:`strokeWidth`,op:1208,type:`number`,value:0},{name:`xuid`,op:14,type:[],value:null},{name:`charset`,op:15,type:`offset`,value:0},{name:`encoding`,op:16,type:`offset`,value:0},{name:`charStrings`,op:17,type:`offset`,value:0},{name:`private`,op:18,type:[`number`,`offset`],value:[0,0]},{name:`ros`,op:1230,type:[`SID`,`SID`,`number`]},{name:`cidFontVersion`,op:1231,type:`number`,value:0},{name:`cidFontRevision`,op:1232,type:`number`,value:0},{name:`cidFontType`,op:1233,type:`number`,value:0},{name:`cidCount`,op:1234,type:`number`,value:8720},{name:`uidBase`,op:1235,type:`number`},{name:`fdArray`,op:1236,type:`offset`},{name:`fdSelect`,op:1237,type:`offset`},{name:`fontName`,op:1238,type:`SID`}],rz=[{name:`subrs`,op:19,type:`offset`,value:0},{name:`defaultWidthX`,op:20,type:`number`,value:0},{name:`nominalWidthX`,op:21,type:`number`,value:0}];function iz(e,t){return ez(QR(e,0,e.byteLength),nz,t)}function az(e,t,n,r){return ez(QR(e,t,n),rz,r)}function oz(e,t,n,r){for(var i=[],a=0;a<n.length;a+=1){var o=iz(new DataView(new Uint8Array(n[a]).buffer),r);o._subrs=[],o._subrsBias=0,o._defaultWidthX=0,o._nominalWidthX=0;var s=o.private[0],c=o.private[1];if(s!==0&&c!==0){var l=az(e,c+t,s,r);o._defaultWidthX=l.defaultWidthX,o._nominalWidthX=l.nominalWidthX,l.subrs!==0&&(o._subrs=KR(e,c+l.subrs+t).objects,o._subrsBias=GR(o._subrs)),o._privateDict=l}i.push(o)}return i}function sz(e,t,n,r){var i,a,o=new Z.Parser(e,t);--n;var s=[`.notdef`],c=o.parseCard8();if(c===0)for(var l=0;l<n;l+=1)i=o.parseSID(),s.push($R(r,i));else if(c===1)for(;s.length<=n;){i=o.parseSID(),a=o.parseCard8();for(var u=0;u<=a;u+=1)s.push($R(r,i)),i+=1}else if(c===2)for(;s.length<=n;){i=o.parseSID(),a=o.parseCard16();for(var d=0;d<=a;d+=1)s.push($R(r,i)),i+=1}else throw Error(`Unknown charset format `+c);return s}function cz(e,t,n){var r,i={},a=new Z.Parser(e,t),o=a.parseCard8();if(o===0)for(var s=a.parseCard8(),c=0;c<s;c+=1)r=a.parseCard8(),i[r]=c;else if(o===1){var l=a.parseCard8();r=1;for(var u=0;u<l;u+=1)for(var d=a.parseCard8(),f=a.parseCard8(),p=d;p<=d+f;p+=1)i[p]=r,r+=1}else throw Error(`Unknown encoding format `+o);return new kR(i,n)}function lz(e,t,n){var r,i,a,o,s=new FL,c=[],l=0,u=!1,d=!1,f=0,p=0,m,h,g,_;if(e.isCIDFont){var v=e.tables.cff.topDict._fdSelect[t.index],y=e.tables.cff.topDict._fdArray[v];m=y._subrs,h=y._subrsBias,g=y._defaultWidthX,_=y._nominalWidthX}else m=e.tables.cff.topDict._subrs,h=e.tables.cff.topDict._subrsBias,g=e.tables.cff.topDict._defaultWidthX,_=e.tables.cff.topDict._nominalWidthX;var b=g;function x(e,t){d&&s.closePath(),s.moveTo(e,t),d=!0}function S(){c.length%2!=0&&!u&&(b=c.shift()+_),l+=c.length>>1,c.length=0,u=!0}function C(n){for(var g,v,y,w,ee,te,ne,re,ie,ae,oe,se,ce=0;ce<n.length;){var le=n[ce];switch(ce+=1,le){case 1:S();break;case 3:S();break;case 4:c.length>1&&!u&&(b=c.shift()+_,u=!0),p+=c.pop(),x(f,p);break;case 5:for(;c.length>0;)f+=c.shift(),p+=c.shift(),s.lineTo(f,p);break;case 6:for(;c.length>0&&(f+=c.shift(),s.lineTo(f,p),c.length!==0);)p+=c.shift(),s.lineTo(f,p);break;case 7:for(;c.length>0&&(p+=c.shift(),s.lineTo(f,p),c.length!==0);)f+=c.shift(),s.lineTo(f,p);break;case 8:for(;c.length>0;)r=f+c.shift(),i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),f=a+c.shift(),p=o+c.shift(),s.curveTo(r,i,a,o,f,p);break;case 10:ee=c.pop()+h,te=m[ee],te&&C(te);break;case 11:return;case 12:switch(le=n[ce],ce+=1,le){case 35:r=f+c.shift(),i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),ne=a+c.shift(),re=o+c.shift(),ie=ne+c.shift(),ae=re+c.shift(),oe=ie+c.shift(),se=ae+c.shift(),f=oe+c.shift(),p=se+c.shift(),c.shift(),s.curveTo(r,i,a,o,ne,re),s.curveTo(ie,ae,oe,se,f,p);break;case 34:r=f+c.shift(),i=p,a=r+c.shift(),o=i+c.shift(),ne=a+c.shift(),re=o,ie=ne+c.shift(),ae=o,oe=ie+c.shift(),se=p,f=oe+c.shift(),s.curveTo(r,i,a,o,ne,re),s.curveTo(ie,ae,oe,se,f,p);break;case 36:r=f+c.shift(),i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),ne=a+c.shift(),re=o,ie=ne+c.shift(),ae=o,oe=ie+c.shift(),se=ae+c.shift(),f=oe+c.shift(),s.curveTo(r,i,a,o,ne,re),s.curveTo(ie,ae,oe,se,f,p);break;case 37:r=f+c.shift(),i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),ne=a+c.shift(),re=o+c.shift(),ie=ne+c.shift(),ae=re+c.shift(),oe=ie+c.shift(),se=ae+c.shift(),Math.abs(oe-f)>Math.abs(se-p)?f=oe+c.shift():p=se+c.shift(),s.curveTo(r,i,a,o,ne,re),s.curveTo(ie,ae,oe,se,f,p);break;default:console.log(`Glyph `+t.index+`: unknown operator 1200`+le),c.length=0}break;case 14:c.length>0&&!u&&(b=c.shift()+_,u=!0),d&&=(s.closePath(),!1);break;case 18:S();break;case 19:case 20:S(),ce+=l+7>>3;break;case 21:c.length>2&&!u&&(b=c.shift()+_,u=!0),p+=c.pop(),f+=c.pop(),x(f,p);break;case 22:c.length>1&&!u&&(b=c.shift()+_,u=!0),f+=c.pop(),x(f,p);break;case 23:S();break;case 24:for(;c.length>2;)r=f+c.shift(),i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),f=a+c.shift(),p=o+c.shift(),s.curveTo(r,i,a,o,f,p);f+=c.shift(),p+=c.shift(),s.lineTo(f,p);break;case 25:for(;c.length>6;)f+=c.shift(),p+=c.shift(),s.lineTo(f,p);r=f+c.shift(),i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),f=a+c.shift(),p=o+c.shift(),s.curveTo(r,i,a,o,f,p);break;case 26:for(c.length%2&&(f+=c.shift());c.length>0;)r=f,i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),f=a,p=o+c.shift(),s.curveTo(r,i,a,o,f,p);break;case 27:for(c.length%2&&(p+=c.shift());c.length>0;)r=f+c.shift(),i=p,a=r+c.shift(),o=i+c.shift(),f=a+c.shift(),p=o,s.curveTo(r,i,a,o,f,p);break;case 28:g=n[ce],v=n[ce+1],c.push((g<<24|v<<16)>>16),ce+=2;break;case 29:ee=c.pop()+e.gsubrsBias,te=e.gsubrs[ee],te&&C(te);break;case 30:for(;c.length>0&&(r=f,i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),f=a+c.shift(),p=o+(c.length===1?c.shift():0),s.curveTo(r,i,a,o,f,p),c.length!==0);)r=f+c.shift(),i=p,a=r+c.shift(),o=i+c.shift(),p=o+c.shift(),f=a+(c.length===1?c.shift():0),s.curveTo(r,i,a,o,f,p);break;case 31:for(;c.length>0&&(r=f+c.shift(),i=p,a=r+c.shift(),o=i+c.shift(),p=o+c.shift(),f=a+(c.length===1?c.shift():0),s.curveTo(r,i,a,o,f,p),c.length!==0);)r=f,i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),f=a+c.shift(),p=o+(c.length===1?c.shift():0),s.curveTo(r,i,a,o,f,p);break;default:le<32?console.log(`Glyph `+t.index+`: unknown operator `+le):le<247?c.push(le-139):le<251?(g=n[ce],ce+=1,c.push((le-247)*256+g+108)):le<255?(g=n[ce],ce+=1,c.push(-(le-251)*256-g-108)):(g=n[ce],v=n[ce+1],y=n[ce+2],w=n[ce+3],ce+=4,c.push((g<<24|v<<16|y<<8|w)/65536))}}}return C(n),t.advanceWidth=b,s}function uz(e,t,n,r){var i=[],a,o=new Z.Parser(e,t),s=o.parseCard8();if(s===0)for(var c=0;c<n;c++){if(a=o.parseCard8(),a>=r)throw Error(`CFF table CID Font FDSelect has bad FD index value `+a+` (FD count `+r+`)`);i.push(a)}else if(s===3){var l=o.parseCard16(),u=o.parseCard16();if(u!==0)throw Error(`CFF Table CID Font FDSelect format 3 range has bad initial GID `+u);for(var d,f=0;f<l;f++){if(a=o.parseCard8(),d=o.parseCard16(),a>=r)throw Error(`CFF table CID Font FDSelect has bad FD index value `+a+` (FD count `+r+`)`);if(d>n)throw Error(`CFF Table CID Font FDSelect format 3 range has bad GID `+d);for(;u<d;u++)i.push(a);u=d}if(d!==n)throw Error(`CFF Table CID Font FDSelect format 3 range has bad final GID `+d)}else throw Error(`CFF Table CID Font FDSelect table has unsupported format `+s);return i}function dz(e,t,n,r){n.tables.cff={};var i=KR(e,KR(e,tz(e,t).endOffset,Z.bytesToString).endOffset),a=KR(e,i.endOffset,Z.bytesToString);n.gsubrs=KR(e,a.endOffset).objects,n.gsubrsBias=GR(n.gsubrs);var o=oz(e,t,i.objects,a.objects);if(o.length!==1)throw Error(`CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = `+o.length);var s=o[0];if(n.tables.cff.topDict=s,s._privateDict&&(n.defaultWidthX=s._privateDict.defaultWidthX,n.nominalWidthX=s._privateDict.nominalWidthX),s.ros[0]!==void 0&&s.ros[1]!==void 0&&(n.isCIDFont=!0),n.isCIDFont){var c=s.fdArray,l=s.fdSelect;if(c===0||l===0)throw Error(`Font is marked as a CID font, but FDArray and/or FDSelect information is missing`);c+=t;var u=oz(e,t,KR(e,c).objects,a.objects);s._fdArray=u,l+=t,s._fdSelect=uz(e,l,n.numGlyphs,u.length)}var d=t+s.private[1],f=az(e,d,s.private[0],a.objects);n.defaultWidthX=f.defaultWidthX,n.nominalWidthX=f.nominalWidthX,f.subrs===0?(n.subrs=[],n.subrsBias=0):(n.subrs=KR(e,d+f.subrs).objects,n.subrsBias=GR(n.subrs));var p;r.lowMemory?(p=qR(e,t+s.charStrings),n.nGlyphs=p.offsets.length):(p=KR(e,t+s.charStrings),n.nGlyphs=p.objects.length);var m=sz(e,t+s.charset,n.nGlyphs,a.objects);if(s.encoding===0?n.cffEncoding=new kR(wR,m):s.encoding===1?n.cffEncoding=new kR(TR,m):n.cffEncoding=cz(e,t+s.encoding,m),n.encoding=n.encoding||n.cffEncoding,n.glyphs=new UR.GlyphSet(n),r.lowMemory)n._push=function(r){var i=JR(r,p.offsets,e,t+s.charStrings);n.glyphs.push(r,UR.cffGlyphLoader(n,r,lz,i))};else for(var h=0;h<n.nGlyphs;h+=1){var g=p.objects[h];n.glyphs.push(h,UR.cffGlyphLoader(n,h,lz,g))}}function fz(e,t){var n,r=CR.indexOf(e);return r>=0&&(n=r),r=t.indexOf(e),r>=0?n=r+CR.length:(n=CR.length+t.length,t.push(e)),n}function pz(){return new Y.Record(`Header`,[{name:`major`,type:`Card8`,value:1},{name:`minor`,type:`Card8`,value:0},{name:`hdrSize`,type:`Card8`,value:4},{name:`major`,type:`Card8`,value:1}])}function mz(e){var t=new Y.Record(`Name INDEX`,[{name:`names`,type:`INDEX`,value:[]}]);t.names=[];for(var n=0;n<e.length;n+=1)t.names.push({name:`name_`+n,type:`NAME`,value:e[n]});return t}function hz(e,t,n){for(var r={},i=0;i<e.length;i+=1){var a=e[i],o=t[a.name];o!==void 0&&!WR(o,a.value)&&(a.type===`SID`&&(o=fz(o,n)),r[a.op]={name:a.name,type:a.type,value:o})}return r}function gz(e,t){var n=new Y.Record(`Top DICT`,[{name:`dict`,type:`DICT`,value:{}}]);return n.dict=hz(nz,e,t),n}function _z(e){var t=new Y.Record(`Top DICT INDEX`,[{name:`topDicts`,type:`INDEX`,value:[]}]);return t.topDicts=[{name:`topDict_0`,type:`TABLE`,value:e}],t}function vz(e){var t=new Y.Record(`String INDEX`,[{name:`strings`,type:`INDEX`,value:[]}]);t.strings=[];for(var n=0;n<e.length;n+=1)t.strings.push({name:`string_`+n,type:`STRING`,value:e[n]});return t}function yz(){return new Y.Record(`Global Subr INDEX`,[{name:`subrs`,type:`INDEX`,value:[]}])}function bz(e,t){for(var n=new Y.Record(`Charsets`,[{name:`format`,type:`Card8`,value:0}]),r=0;r<e.length;r+=1){var i=e[r],a=fz(i,t);n.fields.push({name:`glyph_`+r,type:`SID`,value:a})}return n}function xz(e){var t=[],n=e.path;t.push({name:`width`,type:`NUMBER`,value:e.advanceWidth});for(var r=0,i=0,a=0;a<n.commands.length;a+=1){var o=void 0,s=void 0,c=n.commands[a];if(c.type===`Q`){var l=1/3,u=2/3;c={type:`C`,x:c.x,y:c.y,x1:Math.round(l*r+u*c.x1),y1:Math.round(l*i+u*c.y1),x2:Math.round(l*c.x+u*c.x1),y2:Math.round(l*c.y+u*c.y1)}}if(c.type===`M`)o=Math.round(c.x-r),s=Math.round(c.y-i),t.push({name:`dx`,type:`NUMBER`,value:o}),t.push({name:`dy`,type:`NUMBER`,value:s}),t.push({name:`rmoveto`,type:`OP`,value:21}),r=Math.round(c.x),i=Math.round(c.y);else if(c.type===`L`)o=Math.round(c.x-r),s=Math.round(c.y-i),t.push({name:`dx`,type:`NUMBER`,value:o}),t.push({name:`dy`,type:`NUMBER`,value:s}),t.push({name:`rlineto`,type:`OP`,value:5}),r=Math.round(c.x),i=Math.round(c.y);else if(c.type===`C`){var d=Math.round(c.x1-r),f=Math.round(c.y1-i),p=Math.round(c.x2-c.x1),m=Math.round(c.y2-c.y1);o=Math.round(c.x-c.x2),s=Math.round(c.y-c.y2),t.push({name:`dx1`,type:`NUMBER`,value:d}),t.push({name:`dy1`,type:`NUMBER`,value:f}),t.push({name:`dx2`,type:`NUMBER`,value:p}),t.push({name:`dy2`,type:`NUMBER`,value:m}),t.push({name:`dx`,type:`NUMBER`,value:o}),t.push({name:`dy`,type:`NUMBER`,value:s}),t.push({name:`rrcurveto`,type:`OP`,value:8}),r=Math.round(c.x),i=Math.round(c.y)}}return t.push({name:`endchar`,type:`OP`,value:14}),t}function Sz(e){for(var t=new Y.Record(`CharStrings INDEX`,[{name:`charStrings`,type:`INDEX`,value:[]}]),n=0;n<e.length;n+=1){var r=e.get(n),i=xz(r);t.charStrings.push({name:r.name,type:`CHARSTRING`,value:i})}return t}function Cz(e,t){var n=new Y.Record(`Private DICT`,[{name:`dict`,type:`DICT`,value:{}}]);return n.dict=hz(rz,e,t),n}function wz(e,t){for(var n=new Y.Table(`CFF `,[{name:`header`,type:`RECORD`},{name:`nameIndex`,type:`RECORD`},{name:`topDictIndex`,type:`RECORD`},{name:`stringIndex`,type:`RECORD`},{name:`globalSubrIndex`,type:`RECORD`},{name:`charsets`,type:`RECORD`},{name:`charStringsIndex`,type:`RECORD`},{name:`privateDict`,type:`RECORD`}]),r=1/t.unitsPerEm,i={version:t.version,fullName:t.fullName,familyName:t.familyName,weight:t.weightName,fontBBox:t.fontBBox||[0,0,0,0],fontMatrix:[r,0,0,r,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},a={},o=[],s,c=1;c<e.length;c+=1)s=e.get(c),o.push(s.name);var l=[];n.header=pz(),n.nameIndex=mz([t.postScriptName]);var u=gz(i,l);return n.topDictIndex=_z(u),n.globalSubrIndex=yz(),n.charsets=bz(o,l),n.charStringsIndex=Sz(e),n.privateDict=Cz(a,l),n.stringIndex=vz(l),i.charset=n.header.sizeOf()+n.nameIndex.sizeOf()+n.topDictIndex.sizeOf()+n.stringIndex.sizeOf()+n.globalSubrIndex.sizeOf(),i.encoding=0,i.charStrings=i.charset+n.charsets.sizeOf(),i.private[1]=i.charStrings+n.charStringsIndex.sizeOf(),u=gz(i,l),n.topDictIndex=_z(u),n}var Tz={parse:dz,make:wz};function Ez(e,t){var n={},r=new Z.Parser(e,t);return n.version=r.parseVersion(),n.fontRevision=Math.round(r.parseFixed()*1e3)/1e3,n.checkSumAdjustment=r.parseULong(),n.magicNumber=r.parseULong(),K.argument(n.magicNumber===1594834165,`Font header has wrong magic number.`),n.flags=r.parseUShort(),n.unitsPerEm=r.parseUShort(),n.created=r.parseLongDateTime(),n.modified=r.parseLongDateTime(),n.xMin=r.parseShort(),n.yMin=r.parseShort(),n.xMax=r.parseShort(),n.yMax=r.parseShort(),n.macStyle=r.parseUShort(),n.lowestRecPPEM=r.parseUShort(),n.fontDirectionHint=r.parseShort(),n.indexToLocFormat=r.parseShort(),n.glyphDataFormat=r.parseShort(),n}function Dz(e){var t=Math.round(new Date().getTime()/1e3)+2082844800,n=t;return e.createdTimestamp&&(n=e.createdTimestamp+2082844800),new Y.Table(`head`,[{name:`version`,type:`FIXED`,value:65536},{name:`fontRevision`,type:`FIXED`,value:65536},{name:`checkSumAdjustment`,type:`ULONG`,value:0},{name:`magicNumber`,type:`ULONG`,value:1594834165},{name:`flags`,type:`USHORT`,value:0},{name:`unitsPerEm`,type:`USHORT`,value:1e3},{name:`created`,type:`LONGDATETIME`,value:n},{name:`modified`,type:`LONGDATETIME`,value:t},{name:`xMin`,type:`SHORT`,value:0},{name:`yMin`,type:`SHORT`,value:0},{name:`xMax`,type:`SHORT`,value:0},{name:`yMax`,type:`SHORT`,value:0},{name:`macStyle`,type:`USHORT`,value:0},{name:`lowestRecPPEM`,type:`USHORT`,value:0},{name:`fontDirectionHint`,type:`SHORT`,value:2},{name:`indexToLocFormat`,type:`SHORT`,value:0},{name:`glyphDataFormat`,type:`SHORT`,value:0}],e)}var Oz={parse:Ez,make:Dz};function kz(e,t){var n={},r=new Z.Parser(e,t);return n.version=r.parseVersion(),n.ascender=r.parseShort(),n.descender=r.parseShort(),n.lineGap=r.parseShort(),n.advanceWidthMax=r.parseUShort(),n.minLeftSideBearing=r.parseShort(),n.minRightSideBearing=r.parseShort(),n.xMaxExtent=r.parseShort(),n.caretSlopeRise=r.parseShort(),n.caretSlopeRun=r.parseShort(),n.caretOffset=r.parseShort(),r.relativeOffset+=8,n.metricDataFormat=r.parseShort(),n.numberOfHMetrics=r.parseUShort(),n}function Az(e){return new Y.Table(`hhea`,[{name:`version`,type:`FIXED`,value:65536},{name:`ascender`,type:`FWORD`,value:0},{name:`descender`,type:`FWORD`,value:0},{name:`lineGap`,type:`FWORD`,value:0},{name:`advanceWidthMax`,type:`UFWORD`,value:0},{name:`minLeftSideBearing`,type:`FWORD`,value:0},{name:`minRightSideBearing`,type:`FWORD`,value:0},{name:`xMaxExtent`,type:`FWORD`,value:0},{name:`caretSlopeRise`,type:`SHORT`,value:1},{name:`caretSlopeRun`,type:`SHORT`,value:0},{name:`caretOffset`,type:`SHORT`,value:0},{name:`reserved1`,type:`SHORT`,value:0},{name:`reserved2`,type:`SHORT`,value:0},{name:`reserved3`,type:`SHORT`,value:0},{name:`reserved4`,type:`SHORT`,value:0},{name:`metricDataFormat`,type:`SHORT`,value:0},{name:`numberOfHMetrics`,type:`USHORT`,value:0}],e)}var jz={parse:kz,make:Az};function Mz(e,t,n,r,i){for(var a,o,s=new Z.Parser(e,t),c=0;c<r;c+=1){c<n&&(a=s.parseUShort(),o=s.parseShort());var l=i.get(c);l.advanceWidth=a,l.leftSideBearing=o}}function Nz(e,t,n,r,i){e._hmtxTableData={};for(var a,o,s=new Z.Parser(t,n),c=0;c<i;c+=1)c<r&&(a=s.parseUShort(),o=s.parseShort()),e._hmtxTableData[c]={advanceWidth:a,leftSideBearing:o}}function Pz(e,t,n,r,i,a,o){o.lowMemory?Nz(e,t,n,r,i):Mz(t,n,r,i,a)}function Fz(e){for(var t=new Y.Table(`hmtx`,[]),n=0;n<e.length;n+=1){var r=e.get(n),i=r.advanceWidth||0,a=r.leftSideBearing||0;t.fields.push({name:`advanceWidth_`+n,type:`USHORT`,value:i}),t.fields.push({name:`leftSideBearing_`+n,type:`SHORT`,value:a})}return t}var Iz={parse:Pz,make:Fz};function Lz(e){for(var t=new Y.Table(`ltag`,[{name:`version`,type:`ULONG`,value:1},{name:`flags`,type:`ULONG`,value:0},{name:`numTags`,type:`ULONG`,value:e.length}]),n=``,r=12+e.length*4,i=0;i<e.length;++i){var a=n.indexOf(e[i]);a<0&&(a=n.length,n+=e[i]),t.fields.push({name:`offset `+i,type:`USHORT`,value:r+a}),t.fields.push({name:`length `+i,type:`USHORT`,value:e[i].length})}return t.fields.push({name:`stringPool`,type:`CHARARRAY`,value:n}),t}function Rz(e,t){var n=new Z.Parser(e,t),r=n.parseULong();K.argument(r===1,`Unsupported ltag table version.`),n.skip(`uLong`,1);for(var i=n.parseULong(),a=[],o=0;o<i;o++){for(var s=``,c=t+n.parseUShort(),l=n.parseUShort(),u=c;u<c+l;++u)s+=String.fromCharCode(e.getInt8(u));a.push(s)}return a}var zz={make:Lz,parse:Rz};function Bz(e,t){var n={},r=new Z.Parser(e,t);return n.version=r.parseVersion(),n.numGlyphs=r.parseUShort(),n.version===1&&(n.maxPoints=r.parseUShort(),n.maxContours=r.parseUShort(),n.maxCompositePoints=r.parseUShort(),n.maxCompositeContours=r.parseUShort(),n.maxZones=r.parseUShort(),n.maxTwilightPoints=r.parseUShort(),n.maxStorage=r.parseUShort(),n.maxFunctionDefs=r.parseUShort(),n.maxInstructionDefs=r.parseUShort(),n.maxStackElements=r.parseUShort(),n.maxSizeOfInstructions=r.parseUShort(),n.maxComponentElements=r.parseUShort(),n.maxComponentDepth=r.parseUShort()),n}function Vz(e){return new Y.Table(`maxp`,[{name:`version`,type:`FIXED`,value:20480},{name:`numGlyphs`,type:`USHORT`,value:e}])}var Hz={parse:Bz,make:Vz},Uz=[`copyright`,`fontFamily`,`fontSubfamily`,`uniqueID`,`fullName`,`version`,`postScriptName`,`trademark`,`manufacturer`,`designer`,`description`,`manufacturerURL`,`designerURL`,`license`,`licenseURL`,`reserved`,`preferredFamily`,`preferredSubfamily`,`compatibleFullName`,`sampleText`,`postScriptFindFontName`,`wwsFamily`,`wwsSubfamily`],Wz={0:`en`,1:`fr`,2:`de`,3:`it`,4:`nl`,5:`sv`,6:`es`,7:`da`,8:`pt`,9:`no`,10:`he`,11:`ja`,12:`ar`,13:`fi`,14:`el`,15:`is`,16:`mt`,17:`tr`,18:`hr`,19:`zh-Hant`,20:`ur`,21:`hi`,22:`th`,23:`ko`,24:`lt`,25:`pl`,26:`hu`,27:`es`,28:`lv`,29:`se`,30:`fo`,31:`fa`,32:`ru`,33:`zh`,34:`nl-BE`,35:`ga`,36:`sq`,37:`ro`,38:`cz`,39:`sk`,40:`si`,41:`yi`,42:`sr`,43:`mk`,44:`bg`,45:`uk`,46:`be`,47:`uz`,48:`kk`,49:`az-Cyrl`,50:`az-Arab`,51:`hy`,52:`ka`,53:`mo`,54:`ky`,55:`tg`,56:`tk`,57:`mn-CN`,58:`mn`,59:`ps`,60:`ks`,61:`ku`,62:`sd`,63:`bo`,64:`ne`,65:`sa`,66:`mr`,67:`bn`,68:`as`,69:`gu`,70:`pa`,71:`or`,72:`ml`,73:`kn`,74:`ta`,75:`te`,76:`si`,77:`my`,78:`km`,79:`lo`,80:`vi`,81:`id`,82:`tl`,83:`ms`,84:`ms-Arab`,85:`am`,86:`ti`,87:`om`,88:`so`,89:`sw`,90:`rw`,91:`rn`,92:`ny`,93:`mg`,94:`eo`,128:`cy`,129:`eu`,130:`ca`,131:`la`,132:`qu`,133:`gn`,134:`ay`,135:`tt`,136:`ug`,137:`dz`,138:`jv`,139:`su`,140:`gl`,141:`af`,142:`br`,143:`iu`,144:`gd`,145:`gv`,146:`ga`,147:`to`,148:`el-polyton`,149:`kl`,150:`az`,151:`nn`},Gz={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:5,11:1,12:4,13:0,14:6,15:0,16:0,17:0,18:0,19:2,20:4,21:9,22:21,23:3,24:29,25:29,26:29,27:29,28:29,29:0,30:0,31:4,32:7,33:25,34:0,35:0,36:0,37:0,38:29,39:29,40:0,41:5,42:7,43:7,44:7,45:7,46:7,47:7,48:7,49:7,50:4,51:24,52:23,53:7,54:7,55:7,56:7,57:27,58:7,59:4,60:4,61:4,62:4,63:26,64:9,65:9,66:9,67:13,68:13,69:11,70:10,71:12,72:17,73:16,74:14,75:15,76:18,77:19,78:20,79:22,80:30,81:0,82:0,83:0,84:4,85:28,86:28,87:28,88:0,89:0,90:0,91:0,92:0,93:0,94:0,128:0,129:0,130:0,131:0,132:0,133:0,134:0,135:7,136:4,137:26,138:0,139:0,140:0,141:0,142:0,143:28,144:0,145:0,146:0,147:0,148:6,149:0,150:0,151:0},Kz={1078:`af`,1052:`sq`,1156:`gsw`,1118:`am`,5121:`ar-DZ`,15361:`ar-BH`,3073:`ar`,2049:`ar-IQ`,11265:`ar-JO`,13313:`ar-KW`,12289:`ar-LB`,4097:`ar-LY`,6145:`ary`,8193:`ar-OM`,16385:`ar-QA`,1025:`ar-SA`,10241:`ar-SY`,7169:`aeb`,14337:`ar-AE`,9217:`ar-YE`,1067:`hy`,1101:`as`,2092:`az-Cyrl`,1068:`az`,1133:`ba`,1069:`eu`,1059:`be`,2117:`bn`,1093:`bn-IN`,8218:`bs-Cyrl`,5146:`bs`,1150:`br`,1026:`bg`,1027:`ca`,3076:`zh-HK`,5124:`zh-MO`,2052:`zh`,4100:`zh-SG`,1028:`zh-TW`,1155:`co`,1050:`hr`,4122:`hr-BA`,1029:`cs`,1030:`da`,1164:`prs`,1125:`dv`,2067:`nl-BE`,1043:`nl`,3081:`en-AU`,10249:`en-BZ`,4105:`en-CA`,9225:`en-029`,16393:`en-IN`,6153:`en-IE`,8201:`en-JM`,17417:`en-MY`,5129:`en-NZ`,13321:`en-PH`,18441:`en-SG`,7177:`en-ZA`,11273:`en-TT`,2057:`en-GB`,1033:`en`,12297:`en-ZW`,1061:`et`,1080:`fo`,1124:`fil`,1035:`fi`,2060:`fr-BE`,3084:`fr-CA`,1036:`fr`,5132:`fr-LU`,6156:`fr-MC`,4108:`fr-CH`,1122:`fy`,1110:`gl`,1079:`ka`,3079:`de-AT`,1031:`de`,5127:`de-LI`,4103:`de-LU`,2055:`de-CH`,1032:`el`,1135:`kl`,1095:`gu`,1128:`ha`,1037:`he`,1081:`hi`,1038:`hu`,1039:`is`,1136:`ig`,1057:`id`,1117:`iu`,2141:`iu-Latn`,2108:`ga`,1076:`xh`,1077:`zu`,1040:`it`,2064:`it-CH`,1041:`ja`,1099:`kn`,1087:`kk`,1107:`km`,1158:`quc`,1159:`rw`,1089:`sw`,1111:`kok`,1042:`ko`,1088:`ky`,1108:`lo`,1062:`lv`,1063:`lt`,2094:`dsb`,1134:`lb`,1071:`mk`,2110:`ms-BN`,1086:`ms`,1100:`ml`,1082:`mt`,1153:`mi`,1146:`arn`,1102:`mr`,1148:`moh`,1104:`mn`,2128:`mn-CN`,1121:`ne`,1044:`nb`,2068:`nn`,1154:`oc`,1096:`or`,1123:`ps`,1045:`pl`,1046:`pt`,2070:`pt-PT`,1094:`pa`,1131:`qu-BO`,2155:`qu-EC`,3179:`qu`,1048:`ro`,1047:`rm`,1049:`ru`,9275:`smn`,4155:`smj-NO`,5179:`smj`,3131:`se-FI`,1083:`se`,2107:`se-SE`,8251:`sms`,6203:`sma-NO`,7227:`sms`,1103:`sa`,7194:`sr-Cyrl-BA`,3098:`sr`,6170:`sr-Latn-BA`,2074:`sr-Latn`,1132:`nso`,1074:`tn`,1115:`si`,1051:`sk`,1060:`sl`,11274:`es-AR`,16394:`es-BO`,13322:`es-CL`,9226:`es-CO`,5130:`es-CR`,7178:`es-DO`,12298:`es-EC`,17418:`es-SV`,4106:`es-GT`,18442:`es-HN`,2058:`es-MX`,19466:`es-NI`,6154:`es-PA`,15370:`es-PY`,10250:`es-PE`,20490:`es-PR`,3082:`es`,1034:`es`,21514:`es-US`,14346:`es-UY`,8202:`es-VE`,2077:`sv-FI`,1053:`sv`,1114:`syr`,1064:`tg`,2143:`tzm`,1097:`ta`,1092:`tt`,1098:`te`,1054:`th`,1105:`bo`,1055:`tr`,1090:`tk`,1152:`ug`,1058:`uk`,1070:`hsb`,1056:`ur`,2115:`uz-Cyrl`,1091:`uz`,1066:`vi`,1106:`cy`,1160:`wo`,1157:`sah`,1144:`ii`,1130:`yo`};function qz(e,t,n){switch(e){case 0:if(t===65535)return`und`;if(n)return n[t];break;case 1:return Wz[t];case 3:return Kz[t]}}var Jz=`utf-16`,Yz={0:`macintosh`,1:`x-mac-japanese`,2:`x-mac-chinesetrad`,3:`x-mac-korean`,6:`x-mac-greek`,7:`x-mac-cyrillic`,9:`x-mac-devanagai`,10:`x-mac-gurmukhi`,11:`x-mac-gujarati`,12:`x-mac-oriya`,13:`x-mac-bengali`,14:`x-mac-tamil`,15:`x-mac-telugu`,16:`x-mac-kannada`,17:`x-mac-malayalam`,18:`x-mac-sinhalese`,19:`x-mac-burmese`,20:`x-mac-khmer`,21:`x-mac-thai`,22:`x-mac-lao`,23:`x-mac-georgian`,24:`x-mac-armenian`,25:`x-mac-chinesesimp`,26:`x-mac-tibetan`,27:`x-mac-mongolian`,28:`x-mac-ethiopic`,29:`x-mac-ce`,30:`x-mac-vietnamese`,31:`x-mac-extarabic`},Xz={15:`x-mac-icelandic`,17:`x-mac-turkish`,18:`x-mac-croatian`,24:`x-mac-ce`,25:`x-mac-ce`,26:`x-mac-ce`,27:`x-mac-ce`,28:`x-mac-ce`,30:`x-mac-icelandic`,37:`x-mac-romanian`,38:`x-mac-ce`,39:`x-mac-ce`,40:`x-mac-ce`,143:`x-mac-inuit`,146:`x-mac-gaelic`};function Zz(e,t,n){switch(e){case 0:return Jz;case 1:return Xz[n]||Yz[t];case 3:if(t===1||t===10)return Jz;break}}function Qz(e,t,n){for(var r={},i=new Z.Parser(e,t),a=i.parseUShort(),o=i.parseUShort(),s=i.offset+i.parseUShort(),c=0;c<o;c++){var l=i.parseUShort(),u=i.parseUShort(),d=i.parseUShort(),f=i.parseUShort(),p=Uz[f]||f,m=i.parseUShort(),h=i.parseUShort(),g=qz(l,d,n),_=Zz(l,u,d);if(_!==void 0&&g!==void 0){var v=void 0;if(v=_===Jz?BL.UTF16(e,s+h,m):BL.MACSTRING(e,s+h,m,_),v){var y=r[p];y===void 0&&(y=r[p]={}),y[g]=v}}}return a===1&&i.parseUShort(),r}function $z(e){var t={};for(var n in e)t[e[n]]=parseInt(n);return t}function eB(e,t,n,r,i,a){return new Y.Record(`NameRecord`,[{name:`platformID`,type:`USHORT`,value:e},{name:`encodingID`,type:`USHORT`,value:t},{name:`languageID`,type:`USHORT`,value:n},{name:`nameID`,type:`USHORT`,value:r},{name:`length`,type:`USHORT`,value:i},{name:`offset`,type:`USHORT`,value:a}])}function tB(e,t){var n=e.length,r=t.length-n+1;loop:for(var i=0;i<r;i++)for(;i<r;i++){for(var a=0;a<n;a++)if(t[i+a]!==e[a])continue loop;return i}return-1}function nB(e,t){var n=tB(e,t);if(n<0){n=t.length;for(var r=0,i=e.length;r<i;++r)t.push(e[r])}return n}function rB(e,t){var n,r=[],i={},a=$z(Uz);for(var o in e){var s=a[o];if(s===void 0&&(s=o),n=parseInt(s),isNaN(n))throw Error(`Name table entry "`+o+`" does not exist, see nameTableNames for complete list.`);i[n]=e[o],r.push(n)}for(var c=$z(Wz),l=$z(Kz),u=[],d=[],f=0;f<r.length;f++){n=r[f];var p=i[n];for(var m in p){var h=p[m],g=1,_=c[m],v=Gz[_],y=Zz(g,v,_),b=q.MACSTRING(h,y);b===void 0&&(g=0,_=t.indexOf(m),_<0&&(_=t.length,t.push(m)),v=4,b=q.UTF16(h));var x=nB(b,d);u.push(eB(g,v,_,n,b.length,x));var S=l[m];if(S!==void 0){var C=q.UTF16(h),w=nB(C,d);u.push(eB(3,1,S,n,C.length,w))}}}u.sort(function(e,t){return e.platformID-t.platformID||e.encodingID-t.encodingID||e.languageID-t.languageID||e.nameID-t.nameID});for(var ee=new Y.Table(`name`,[{name:`format`,type:`USHORT`,value:0},{name:`count`,type:`USHORT`,value:u.length},{name:`stringOffset`,type:`USHORT`,value:6+u.length*12}]),te=0;te<u.length;te++)ee.fields.push({name:`record_`+te,type:`RECORD`,value:u[te]});return ee.fields.push({name:`strings`,type:`LITERAL`,value:d}),ee}var iB={parse:Qz,make:rB},aB=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}];function oB(e){for(var t=0;t<aB.length;t+=1){var n=aB[t];if(e>=n.begin&&e<n.end)return t}return-1}function sB(e,t){var n={},r=new Z.Parser(e,t);n.version=r.parseUShort(),n.xAvgCharWidth=r.parseShort(),n.usWeightClass=r.parseUShort(),n.usWidthClass=r.parseUShort(),n.fsType=r.parseUShort(),n.ySubscriptXSize=r.parseShort(),n.ySubscriptYSize=r.parseShort(),n.ySubscriptXOffset=r.parseShort(),n.ySubscriptYOffset=r.parseShort(),n.ySuperscriptXSize=r.parseShort(),n.ySuperscriptYSize=r.parseShort(),n.ySuperscriptXOffset=r.parseShort(),n.ySuperscriptYOffset=r.parseShort(),n.yStrikeoutSize=r.parseShort(),n.yStrikeoutPosition=r.parseShort(),n.sFamilyClass=r.parseShort(),n.panose=[];for(var i=0;i<10;i++)n.panose[i]=r.parseByte();return n.ulUnicodeRange1=r.parseULong(),n.ulUnicodeRange2=r.parseULong(),n.ulUnicodeRange3=r.parseULong(),n.ulUnicodeRange4=r.parseULong(),n.achVendID=String.fromCharCode(r.parseByte(),r.parseByte(),r.parseByte(),r.parseByte()),n.fsSelection=r.parseUShort(),n.usFirstCharIndex=r.parseUShort(),n.usLastCharIndex=r.parseUShort(),n.sTypoAscender=r.parseShort(),n.sTypoDescender=r.parseShort(),n.sTypoLineGap=r.parseShort(),n.usWinAscent=r.parseUShort(),n.usWinDescent=r.parseUShort(),n.version>=1&&(n.ulCodePageRange1=r.parseULong(),n.ulCodePageRange2=r.parseULong()),n.version>=2&&(n.sxHeight=r.parseShort(),n.sCapHeight=r.parseShort(),n.usDefaultChar=r.parseUShort(),n.usBreakChar=r.parseUShort(),n.usMaxContent=r.parseUShort()),n}function cB(e){return new Y.Table(`OS/2`,[{name:`version`,type:`USHORT`,value:3},{name:`xAvgCharWidth`,type:`SHORT`,value:0},{name:`usWeightClass`,type:`USHORT`,value:0},{name:`usWidthClass`,type:`USHORT`,value:0},{name:`fsType`,type:`USHORT`,value:0},{name:`ySubscriptXSize`,type:`SHORT`,value:650},{name:`ySubscriptYSize`,type:`SHORT`,value:699},{name:`ySubscriptXOffset`,type:`SHORT`,value:0},{name:`ySubscriptYOffset`,type:`SHORT`,value:140},{name:`ySuperscriptXSize`,type:`SHORT`,value:650},{name:`ySuperscriptYSize`,type:`SHORT`,value:699},{name:`ySuperscriptXOffset`,type:`SHORT`,value:0},{name:`ySuperscriptYOffset`,type:`SHORT`,value:479},{name:`yStrikeoutSize`,type:`SHORT`,value:49},{name:`yStrikeoutPosition`,type:`SHORT`,value:258},{name:`sFamilyClass`,type:`SHORT`,value:0},{name:`bFamilyType`,type:`BYTE`,value:0},{name:`bSerifStyle`,type:`BYTE`,value:0},{name:`bWeight`,type:`BYTE`,value:0},{name:`bProportion`,type:`BYTE`,value:0},{name:`bContrast`,type:`BYTE`,value:0},{name:`bStrokeVariation`,type:`BYTE`,value:0},{name:`bArmStyle`,type:`BYTE`,value:0},{name:`bLetterform`,type:`BYTE`,value:0},{name:`bMidline`,type:`BYTE`,value:0},{name:`bXHeight`,type:`BYTE`,value:0},{name:`ulUnicodeRange1`,type:`ULONG`,value:0},{name:`ulUnicodeRange2`,type:`ULONG`,value:0},{name:`ulUnicodeRange3`,type:`ULONG`,value:0},{name:`ulUnicodeRange4`,type:`ULONG`,value:0},{name:`achVendID`,type:`CHARARRAY`,value:`XXXX`},{name:`fsSelection`,type:`USHORT`,value:0},{name:`usFirstCharIndex`,type:`USHORT`,value:0},{name:`usLastCharIndex`,type:`USHORT`,value:0},{name:`sTypoAscender`,type:`SHORT`,value:0},{name:`sTypoDescender`,type:`SHORT`,value:0},{name:`sTypoLineGap`,type:`SHORT`,value:0},{name:`usWinAscent`,type:`USHORT`,value:0},{name:`usWinDescent`,type:`USHORT`,value:0},{name:`ulCodePageRange1`,type:`ULONG`,value:0},{name:`ulCodePageRange2`,type:`ULONG`,value:0},{name:`sxHeight`,type:`SHORT`,value:0},{name:`sCapHeight`,type:`SHORT`,value:0},{name:`usDefaultChar`,type:`USHORT`,value:0},{name:`usBreakChar`,type:`USHORT`,value:0},{name:`usMaxContext`,type:`USHORT`,value:0}],e)}var lB={parse:sB,make:cB,unicodeRanges:aB,getUnicodeRange:oB};function uB(e,t){var n={},r=new Z.Parser(e,t);switch(n.version=r.parseVersion(),n.italicAngle=r.parseFixed(),n.underlinePosition=r.parseShort(),n.underlineThickness=r.parseShort(),n.isFixedPitch=r.parseULong(),n.minMemType42=r.parseULong(),n.maxMemType42=r.parseULong(),n.minMemType1=r.parseULong(),n.maxMemType1=r.parseULong(),n.version){case 1:n.names=ER.slice();break;case 2:n.numberOfGlyphs=r.parseUShort(),n.glyphNameIndex=Array(n.numberOfGlyphs);for(var i=0;i<n.numberOfGlyphs;i++)n.glyphNameIndex[i]=r.parseUShort();n.names=[];for(var a=0;a<n.numberOfGlyphs;a++)if(n.glyphNameIndex[a]>=ER.length){var o=r.parseChar();n.names.push(r.parseString(o))}break;case 2.5:n.numberOfGlyphs=r.parseUShort(),n.offset=Array(n.numberOfGlyphs);for(var s=0;s<n.numberOfGlyphs;s++)n.offset[s]=r.parseChar();break}return n}function dB(){return new Y.Table(`post`,[{name:`version`,type:`FIXED`,value:196608},{name:`italicAngle`,type:`FIXED`,value:0},{name:`underlinePosition`,type:`FWORD`,value:0},{name:`underlineThickness`,type:`FWORD`,value:0},{name:`isFixedPitch`,type:`ULONG`,value:0},{name:`minMemType42`,type:`ULONG`,value:0},{name:`maxMemType42`,type:`ULONG`,value:0},{name:`minMemType1`,type:`ULONG`,value:0},{name:`maxMemType1`,type:`ULONG`,value:0}])}var fB={parse:uB,make:dB},pB=Array(9);pB[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(X.coverage),deltaGlyphId:this.parseUShort()};if(t===2)return{substFormat:2,coverage:this.parsePointer(X.coverage),substitute:this.parseOffset16List()};K.assert(!1,`0x`+e.toString(16)+`: lookup type 1 format must be 1 or 2.`)},pB[2]=function(){var e=this.parseUShort();return K.argument(e===1,`GSUB Multiple Substitution Subtable identifier-format must be 1`),{substFormat:e,coverage:this.parsePointer(X.coverage),sequences:this.parseListOfLists()}},pB[3]=function(){var e=this.parseUShort();return K.argument(e===1,`GSUB Alternate Substitution Subtable identifier-format must be 1`),{substFormat:e,coverage:this.parsePointer(X.coverage),alternateSets:this.parseListOfLists()}},pB[4]=function(){var e=this.parseUShort();return K.argument(e===1,`GSUB ligature table identifier-format must be 1`),{substFormat:e,coverage:this.parsePointer(X.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};var mB={sequenceIndex:X.uShort,lookupListIndex:X.uShort};pB[5]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:t,coverage:this.parsePointer(X.coverage),ruleSets:this.parseListOfLists(function(){var e=this.parseUShort(),t=this.parseUShort();return{input:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,mB)}})};if(t===2)return{substFormat:t,coverage:this.parsePointer(X.coverage),classDef:this.parsePointer(X.classDef),classSets:this.parseListOfLists(function(){var e=this.parseUShort(),t=this.parseUShort();return{classes:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,mB)}})};if(t===3){var n=this.parseUShort(),r=this.parseUShort();return{substFormat:t,coverages:this.parseList(n,X.pointer(X.coverage)),lookupRecords:this.parseRecordList(r,mB)}}K.assert(!1,`0x`+e.toString(16)+`: lookup type 5 format must be 1, 2 or 3.`)},pB[6]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(X.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(mB)}})};if(t===2)return{substFormat:2,coverage:this.parsePointer(X.coverage),backtrackClassDef:this.parsePointer(X.classDef),inputClassDef:this.parsePointer(X.classDef),lookaheadClassDef:this.parsePointer(X.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(mB)}})};if(t===3)return{substFormat:3,backtrackCoverage:this.parseList(X.pointer(X.coverage)),inputCoverage:this.parseList(X.pointer(X.coverage)),lookaheadCoverage:this.parseList(X.pointer(X.coverage)),lookupRecords:this.parseRecordList(mB)};K.assert(!1,`0x`+e.toString(16)+`: lookup type 6 format must be 1, 2 or 3.`)},pB[7]=function(){var e=this.parseUShort();K.argument(e===1,`GSUB Extension Substitution subtable identifier-format must be 1`);var t=this.parseUShort(),n=new X(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:pB[t].call(n)}},pB[8]=function(){var e=this.parseUShort();return K.argument(e===1,`GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1`),{substFormat:e,coverage:this.parsePointer(X.coverage),backtrackCoverage:this.parseList(X.pointer(X.coverage)),lookaheadCoverage:this.parseList(X.pointer(X.coverage)),substitutes:this.parseUShortList()}};function hB(e,t){t||=0;var n=new X(e,t),r=n.parseVersion(1);return K.argument(r===1||r===1.1,`Unsupported GSUB table version.`),r===1?{version:r,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(pB)}:{version:r,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(pB),variations:n.parseFeatureVariationsList()}}var gB=Array(9);gB[1]=function(e){return e.substFormat===1?new Y.Table(`substitutionTable`,[{name:`substFormat`,type:`USHORT`,value:1},{name:`coverage`,type:`TABLE`,value:new Y.Coverage(e.coverage)},{name:`deltaGlyphID`,type:`USHORT`,value:e.deltaGlyphId}]):new Y.Table(`substitutionTable`,[{name:`substFormat`,type:`USHORT`,value:2},{name:`coverage`,type:`TABLE`,value:new Y.Coverage(e.coverage)}].concat(Y.ushortList(`substitute`,e.substitute)))},gB[2]=function(e){return K.assert(e.substFormat===1,`Lookup type 2 substFormat must be 1.`),new Y.Table(`substitutionTable`,[{name:`substFormat`,type:`USHORT`,value:1},{name:`coverage`,type:`TABLE`,value:new Y.Coverage(e.coverage)}].concat(Y.tableList(`seqSet`,e.sequences,function(e){return new Y.Table(`sequenceSetTable`,Y.ushortList(`sequence`,e))})))},gB[3]=function(e){return K.assert(e.substFormat===1,`Lookup type 3 substFormat must be 1.`),new Y.Table(`substitutionTable`,[{name:`substFormat`,type:`USHORT`,value:1},{name:`coverage`,type:`TABLE`,value:new Y.Coverage(e.coverage)}].concat(Y.tableList(`altSet`,e.alternateSets,function(e){return new Y.Table(`alternateSetTable`,Y.ushortList(`alternate`,e))})))},gB[4]=function(e){return K.assert(e.substFormat===1,`Lookup type 4 substFormat must be 1.`),new Y.Table(`substitutionTable`,[{name:`substFormat`,type:`USHORT`,value:1},{name:`coverage`,type:`TABLE`,value:new Y.Coverage(e.coverage)}].concat(Y.tableList(`ligSet`,e.ligatureSets,function(e){return new Y.Table(`ligatureSetTable`,Y.tableList(`ligature`,e,function(e){return new Y.Table(`ligatureTable`,[{name:`ligGlyph`,type:`USHORT`,value:e.ligGlyph}].concat(Y.ushortList(`component`,e.components,e.components.length+1)))}))})))},gB[6]=function(e){if(e.substFormat===1)return new Y.Table(`chainContextTable`,[{name:`substFormat`,type:`USHORT`,value:e.substFormat},{name:`coverage`,type:`TABLE`,value:new Y.Coverage(e.coverage)}].concat(Y.tableList(`chainRuleSet`,e.chainRuleSets,function(e){return new Y.Table(`chainRuleSetTable`,Y.tableList(`chainRule`,e,function(e){var t=Y.ushortList(`backtrackGlyph`,e.backtrack,e.backtrack.length).concat(Y.ushortList(`inputGlyph`,e.input,e.input.length+1)).concat(Y.ushortList(`lookaheadGlyph`,e.lookahead,e.lookahead.length)).concat(Y.ushortList(`substitution`,[],e.lookupRecords.length));return e.lookupRecords.forEach(function(e,n){t=t.concat({name:`sequenceIndex`+n,type:`USHORT`,value:e.sequenceIndex}).concat({name:`lookupListIndex`+n,type:`USHORT`,value:e.lookupListIndex})}),new Y.Table(`chainRuleTable`,t)}))})));if(e.substFormat===2)K.assert(!1,`lookup type 6 format 2 is not yet supported.`);else if(e.substFormat===3){var t=[{name:`substFormat`,type:`USHORT`,value:e.substFormat}];return t.push({name:`backtrackGlyphCount`,type:`USHORT`,value:e.backtrackCoverage.length}),e.backtrackCoverage.forEach(function(e,n){t.push({name:`backtrackCoverage`+n,type:`TABLE`,value:new Y.Coverage(e)})}),t.push({name:`inputGlyphCount`,type:`USHORT`,value:e.inputCoverage.length}),e.inputCoverage.forEach(function(e,n){t.push({name:`inputCoverage`+n,type:`TABLE`,value:new Y.Coverage(e)})}),t.push({name:`lookaheadGlyphCount`,type:`USHORT`,value:e.lookaheadCoverage.length}),e.lookaheadCoverage.forEach(function(e,n){t.push({name:`lookaheadCoverage`+n,type:`TABLE`,value:new Y.Coverage(e)})}),t.push({name:`substitutionCount`,type:`USHORT`,value:e.lookupRecords.length}),e.lookupRecords.forEach(function(e,n){t=t.concat({name:`sequenceIndex`+n,type:`USHORT`,value:e.sequenceIndex}).concat({name:`lookupListIndex`+n,type:`USHORT`,value:e.lookupListIndex})}),new Y.Table(`chainContextTable`,t)}K.assert(!1,`lookup type 6 format must be 1, 2 or 3.`)};function _B(e){return new Y.Table(`GSUB`,[{name:`version`,type:`ULONG`,value:65536},{name:`scripts`,type:`TABLE`,value:new Y.ScriptList(e.scripts)},{name:`features`,type:`TABLE`,value:new Y.FeatureList(e.features)},{name:`lookups`,type:`TABLE`,value:new Y.LookupList(e.lookups,gB)}])}var vB={parse:hB,make:_B};function yB(e,t){var n=new Z.Parser(e,t),r=n.parseULong();K.argument(r===1,`Unsupported META table version.`),n.parseULong(),n.parseULong();for(var i=n.parseULong(),a={},o=0;o<i;o++){var s=n.parseTag(),c=n.parseULong(),l=n.parseULong();a[s]=BL.UTF8(e,t+c,l)}return a}function bB(e){var t=Object.keys(e).length,n=``,r=16+t*12,i=new Y.Table(`meta`,[{name:`version`,type:`ULONG`,value:1},{name:`flags`,type:`ULONG`,value:0},{name:`offset`,type:`ULONG`,value:r},{name:`numTags`,type:`ULONG`,value:t}]);for(var a in e){var o=n.length;n+=e[a],i.fields.push({name:`tag `+a,type:`TAG`,value:a}),i.fields.push({name:`offset `+a,type:`ULONG`,value:r+o}),i.fields.push({name:`length `+a,type:`ULONG`,value:e[a].length})}return i.fields.push({name:`stringPool`,type:`CHARARRAY`,value:n}),i}var xB={parse:yB,make:bB};function SB(e){return Math.log(e)/Math.log(2)|0}function CB(e){for(;e.length%4!=0;)e.push(0);for(var t=0,n=0;n<e.length;n+=4)t+=(e[n]<<24)+(e[n+1]<<16)+(e[n+2]<<8)+e[n+3];return t%=2**32,t}function wB(e,t,n,r){return new Y.Record(`Table Record`,[{name:`tag`,type:`TAG`,value:e===void 0?``:e},{name:`checkSum`,type:`ULONG`,value:t===void 0?0:t},{name:`offset`,type:`ULONG`,value:n===void 0?0:n},{name:`length`,type:`ULONG`,value:r===void 0?0:r}])}function TB(e){var t=new Y.Table(`sfnt`,[{name:`version`,type:`TAG`,value:`OTTO`},{name:`numTables`,type:`USHORT`,value:0},{name:`searchRange`,type:`USHORT`,value:0},{name:`entrySelector`,type:`USHORT`,value:0},{name:`rangeShift`,type:`USHORT`,value:0}]);t.tables=e,t.numTables=e.length;var n=2**SB(t.numTables);t.searchRange=16*n,t.entrySelector=SB(n),t.rangeShift=t.numTables*16-t.searchRange;for(var r=[],i=[],a=t.sizeOf()+wB().sizeOf()*t.numTables;a%4!=0;)a+=1,i.push({name:`padding`,type:`BYTE`,value:0});for(var o=0;o<e.length;o+=1){var s=e[o];K.argument(s.tableName.length===4,`Table name`+s.tableName+` is invalid.`);var c=s.sizeOf(),l=wB(s.tableName,CB(s.encode()),a,c);for(r.push({name:l.tag+` Table Record`,type:`RECORD`,value:l}),i.push({name:s.tableName+` table`,type:`RECORD`,value:s}),a+=c,K.argument(!isNaN(a),`Something went wrong calculating the offset.`);a%4!=0;)a+=1,i.push({name:`padding`,type:`BYTE`,value:0})}return r.sort(function(e,t){return e.value.tag>t.value.tag?1:-1}),t.fields=t.fields.concat(r),t.fields=t.fields.concat(i),t}function EB(e,t,n){for(var r=0;r<t.length;r+=1){var i=e.charToGlyphIndex(t[r]);if(i>0)return e.glyphs.get(i).getMetrics()}return n}function DB(e){for(var t=0,n=0;n<e.length;n+=1)t+=e[n];return t/e.length}function OB(e){for(var t=[],n=[],r=[],i=[],a=[],o=[],s=[],c,l=0,u=0,d=0,f=0,p=0,m=0;m<e.glyphs.length;m+=1){var h=e.glyphs.get(m),g=h.unicode|0;if(isNaN(h.advanceWidth))throw Error(`Glyph `+h.name+` (`+m+`): advanceWidth is not a number.`);(c>g||c===void 0)&&g>0&&(c=g),l<g&&(l=g);var _=lB.getUnicodeRange(g);if(_<32)u|=1<<_;else if(_<64)d|=1<<_-32;else if(_<96)f|=1<<_-64;else if(_<123)p|=1<<_-96;else throw Error(`Unicode ranges bits > 123 are reserved for internal usage`);if(h.name!==`.notdef`){var v=h.getMetrics();t.push(v.xMin),n.push(v.yMin),r.push(v.xMax),i.push(v.yMax),o.push(v.leftSideBearing),s.push(v.rightSideBearing),a.push(h.advanceWidth)}}var y={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,r),yMax:Math.max.apply(null,i),advanceWidthMax:Math.max.apply(null,a),advanceWidthAvg:DB(a),minLeftSideBearing:Math.min.apply(null,o),maxLeftSideBearing:Math.max.apply(null,o),minRightSideBearing:Math.min.apply(null,s)};y.ascender=e.ascender,y.descender=e.descender;var b=Oz.make({flags:3,unitsPerEm:e.unitsPerEm,xMin:y.xMin,yMin:y.yMin,xMax:y.xMax,yMax:y.yMax,lowestRecPPEM:3,createdTimestamp:e.createdTimestamp}),x=jz.make({ascender:y.ascender,descender:y.descender,advanceWidthMax:y.advanceWidthMax,minLeftSideBearing:y.minLeftSideBearing,minRightSideBearing:y.minRightSideBearing,xMaxExtent:y.maxLeftSideBearing+(y.xMax-y.xMin),numberOfHMetrics:e.glyphs.length}),S=Hz.make(e.glyphs.length),C=lB.make(Object.assign({xAvgCharWidth:Math.round(y.advanceWidthAvg),usFirstCharIndex:c,usLastCharIndex:l,ulUnicodeRange1:u,ulUnicodeRange2:d,ulUnicodeRange3:f,ulUnicodeRange4:p,sTypoAscender:y.ascender,sTypoDescender:y.descender,sTypoLineGap:0,usWinAscent:y.yMax,usWinDescent:Math.abs(y.yMin),ulCodePageRange1:1,sxHeight:EB(e,`xyvw`,{yMax:Math.round(y.ascender/2)}).yMax,sCapHeight:EB(e,`HIKLEFJMNTZBDPRAGOQSUVWXY`,y).yMax,usDefaultChar:e.hasChar(` `)?32:0,usBreakChar:e.hasChar(` `)?32:0},e.tables.os2)),w=Iz.make(e.glyphs),ee=SR.make(e.glyphs),te=e.getEnglishName(`fontFamily`),ne=e.getEnglishName(`fontSubfamily`),re=te+` `+ne,ie=e.getEnglishName(`postScriptName`);ie||=te.replace(/\s/g,``)+`-`+ne;var ae={};for(var oe in e.names)ae[oe]=e.names[oe];ae.uniqueID||={en:e.getEnglishName(`manufacturer`)+`:`+re},ae.postScriptName||={en:ie},ae.preferredFamily||=e.names.fontFamily,ae.preferredSubfamily||=e.names.fontSubfamily;var se=[],ce=iB.make(ae,se),le=se.length>0?zz.make(se):void 0,ue=fB.make(),de=Tz.make(e.glyphs,{version:e.getEnglishName(`version`),fullName:re,familyName:te,weightName:ne,postScriptName:ie,unitsPerEm:e.unitsPerEm,fontBBox:[0,y.yMin,y.ascender,y.advanceWidthMax]}),fe=e.metas&&Object.keys(e.metas).length>0?xB.make(e.metas):void 0,pe=[b,x,S,C,ce,ee,ue,de,w];le&&pe.push(le),e.tables.gsub&&pe.push(vB.make(e.tables.gsub)),fe&&pe.push(fe);for(var me=TB(pe),he=CB(me.encode()),ge=me.fields,_e=!1,ve=0;ve<ge.length;ve+=1)if(ge[ve].name===`head table`){ge[ve].value.checkSumAdjustment=2981146554-he,_e=!0;break}if(!_e)throw Error(`Could not find head table with checkSum to adjust.`);return me}var kB={make:TB,fontToTable:OB,computeCheckSum:CB};function AB(e,t){for(var n=0,r=e.length-1;n<=r;){var i=n+r>>>1,a=e[i].tag;if(a===t)return i;a<t?n=i+1:r=i-1}return-n-1}function jB(e,t){for(var n=0,r=e.length-1;n<=r;){var i=n+r>>>1,a=e[i];if(a===t)return i;a<t?n=i+1:r=i-1}return-n-1}function MB(e,t){for(var n,r=0,i=e.length-1;r<=i;){var a=r+i>>>1;n=e[a];var o=n.start;if(o===t)return n;o<t?r=a+1:i=a-1}if(r>0)return n=e[r-1],t>n.end?0:n}function NB(e,t){this.font=e,this.tableName=t}NB.prototype={searchTag:AB,binSearch:jB,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,n=0;n<e.scripts.length;n++){var r=e.scripts[n].tag;if(r===`DFLT`)return r;r===`latn`&&(t=!0)}if(t)return`latn`}},getScriptTable:function(e,t){var n=this.getTable(t);if(n){e||=`DFLT`;var r=n.scripts,i=AB(n.scripts,e);if(i>=0)return r[i].script;if(t){var a={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return r.splice(-1-i,0,a),a.script}}},getLangSysTable:function(e,t,n){var r=this.getScriptTable(e,n);if(r){if(!t||t===`dflt`||t===`DFLT`)return r.defaultLangSys;var i=AB(r.langSysRecords,t);if(i>=0)return r.langSysRecords[i].langSys;if(n){var a={tag:t,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return r.langSysRecords.splice(-1-i,0,a),a.langSys}}},getFeatureTable:function(e,t,n,r){var i=this.getLangSysTable(e,t,r);if(i){for(var a,o=i.featureIndexes,s=this.font.tables[this.tableName].features,c=0;c<o.length;c++)if(a=s[o[c]],a.tag===n)return a.feature;if(r){var l=s.length;return K.assert(l===0||n>=s[l-1].tag,`Features must be added in alphabetical order.`),a={tag:n,feature:{params:0,lookupListIndexes:[]}},s.push(a),o.push(l),a.feature}}},getLookupTables:function(e,t,n,r,i){var a=this.getFeatureTable(e,t,n,i),o=[];if(a){for(var s,c=a.lookupListIndexes,l=this.font.tables[this.tableName].lookups,u=0;u<c.length;u++)s=l[c[u]],s.lookupType===r&&o.push(s);if(o.length===0&&i){s={lookupType:r,lookupFlag:0,subtables:[],markFilteringSet:void 0};var d=l.length;return l.push(s),c.push(d),[s]}}return o},getGlyphClass:function(e,t){switch(e.format){case 1:return e.startGlyph<=t&&t<e.startGlyph+e.classes.length?e.classes[t-e.startGlyph]:0;case 2:var n=MB(e.ranges,t);return n?n.classId:0}},getCoverageIndex:function(e,t){switch(e.format){case 1:var n=jB(e.glyphs,t);return n>=0?n:-1;case 2:var r=MB(e.ranges,t);return r?r.index+t-r.start:-1}},expandCoverage:function(e){if(e.format===1)return e.glyphs;for(var t=[],n=e.ranges,r=0;r<n.length;r++)for(var i=n[r],a=i.start,o=i.end,s=a;s<=o;s++)t.push(s);return t}};function PB(e){NB.call(this,e,`gpos`)}PB.prototype=NB.prototype,PB.prototype.init=function(){var e=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(e)},PB.prototype.getKerningValue=function(e,t,n){for(var r=0;r<e.length;r++)for(var i=e[r].subtables,a=0;a<i.length;a++){var o=i[a],s=this.getCoverageIndex(o.coverage,t);if(!(s<0))switch(o.posFormat){case 1:for(var c=o.pairSets[s],l=0;l<c.length;l++){var u=c[l];if(u.secondGlyph===n)return u.value1&&u.value1.xAdvance||0}break;case 2:var d=this.getGlyphClass(o.classDef1,t),f=this.getGlyphClass(o.classDef2,n),p=o.classRecords[d][f];return p.value1&&p.value1.xAdvance||0}}return 0},PB.prototype.getKerningTables=function(e,t){if(this.font.tables.gpos)return this.getLookupTables(e,t,`kern`,2)};function FB(e){NB.call(this,e,`gsub`)}function IB(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function LB(e,t,n){for(var r=e.subtables,i=0;i<r.length;i++){var a=r[i];if(a.substFormat===t)return a}if(n)return r.push(n),n}FB.prototype=NB.prototype,FB.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:`DFLT`,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},FB.prototype.getSingle=function(e,t,n){for(var r=[],i=this.getLookupTables(t,n,e,1),a=0;a<i.length;a++)for(var o=i[a].subtables,s=0;s<o.length;s++){var c=o[s],l=this.expandCoverage(c.coverage),u=void 0;if(c.substFormat===1){var d=c.deltaGlyphId;for(u=0;u<l.length;u++){var f=l[u];r.push({sub:f,by:f+d})}}else{var p=c.substitute;for(u=0;u<l.length;u++)r.push({sub:l[u],by:p[u]})}}return r},FB.prototype.getMultiple=function(e,t,n){for(var r=[],i=this.getLookupTables(t,n,e,2),a=0;a<i.length;a++)for(var o=i[a].subtables,s=0;s<o.length;s++){var c=o[s],l=this.expandCoverage(c.coverage),u=void 0;for(u=0;u<l.length;u++){var d=l[u],f=c.sequences[u];r.push({sub:d,by:f})}}return r},FB.prototype.getAlternates=function(e,t,n){for(var r=[],i=this.getLookupTables(t,n,e,3),a=0;a<i.length;a++)for(var o=i[a].subtables,s=0;s<o.length;s++)for(var c=o[s],l=this.expandCoverage(c.coverage),u=c.alternateSets,d=0;d<l.length;d++)r.push({sub:l[d],by:u[d]});return r},FB.prototype.getLigatures=function(e,t,n){for(var r=[],i=this.getLookupTables(t,n,e,4),a=0;a<i.length;a++)for(var o=i[a].subtables,s=0;s<o.length;s++)for(var c=o[s],l=this.expandCoverage(c.coverage),u=c.ligatureSets,d=0;d<l.length;d++)for(var f=l[d],p=u[d],m=0;m<p.length;m++){var h=p[m];r.push({sub:[f].concat(h.components),by:h.ligGlyph})}return r},FB.prototype.addSingle=function(e,t,n,r){var i=this.getLookupTables(n,r,e,1,!0)[0],a=LB(i,2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});K.assert(a.coverage.format===1,`Single: unable to modify coverage table format `+a.coverage.format);var o=t.sub,s=this.binSearch(a.coverage.glyphs,o);s<0&&(s=-1-s,a.coverage.glyphs.splice(s,0,o),a.substitute.splice(s,0,0)),a.substitute[s]=t.by},FB.prototype.addMultiple=function(e,t,n,r){K.assert(t.by instanceof Array&&t.by.length>1,`Multiple: "by" must be an array of two or more ids`);var i=this.getLookupTables(n,r,e,2,!0)[0],a=LB(i,1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});K.assert(a.coverage.format===1,`Multiple: unable to modify coverage table format `+a.coverage.format);var o=t.sub,s=this.binSearch(a.coverage.glyphs,o);s<0&&(s=-1-s,a.coverage.glyphs.splice(s,0,o),a.sequences.splice(s,0,0)),a.sequences[s]=t.by},FB.prototype.addAlternate=function(e,t,n,r){var i=this.getLookupTables(n,r,e,3,!0)[0],a=LB(i,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});K.assert(a.coverage.format===1,`Alternate: unable to modify coverage table format `+a.coverage.format);var o=t.sub,s=this.binSearch(a.coverage.glyphs,o);s<0&&(s=-1-s,a.coverage.glyphs.splice(s,0,o),a.alternateSets.splice(s,0,0)),a.alternateSets[s]=t.by},FB.prototype.addLigature=function(e,t,n,r){var i=this.getLookupTables(n,r,e,4,!0)[0],a=i.subtables[0];a||(a={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},i.subtables[0]=a),K.assert(a.coverage.format===1,`Ligature: unable to modify coverage table format `+a.coverage.format);var o=t.sub[0],s=t.sub.slice(1),c={ligGlyph:t.by,components:s},l=this.binSearch(a.coverage.glyphs,o);if(l>=0){for(var u=a.ligatureSets[l],d=0;d<u.length;d++)if(IB(u[d].components,s))return;u.push(c)}else l=-1-l,a.coverage.glyphs.splice(l,0,o),a.ligatureSets.splice(l,0,[c])},FB.prototype.getFeature=function(e,t,n){if(/ss\d\d/.test(e))return this.getSingle(e,t,n);switch(e){case`aalt`:case`salt`:return this.getSingle(e,t,n).concat(this.getAlternates(e,t,n));case`dlig`:case`liga`:case`rlig`:return this.getLigatures(e,t,n);case`ccmp`:return this.getMultiple(e,t,n).concat(this.getLigatures(e,t,n));case`stch`:return this.getMultiple(e,t,n)}},FB.prototype.add=function(e,t,n,r){if(/ss\d\d/.test(e))return this.addSingle(e,t,n,r);switch(e){case`aalt`:case`salt`:return typeof t.by==`number`?this.addSingle(e,t,n,r):this.addAlternate(e,t,n,r);case`dlig`:case`liga`:case`rlig`:return this.addLigature(e,t,n,r);case`ccmp`:return t.by instanceof Array?this.addMultiple(e,t,n,r):this.addLigature(e,t,n,r)}};function RB(){return typeof window<`u`}function zB(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),r=0;r<e.length;++r)n[r]=e[r];return t}function BB(e){for(var t=new Buffer(e.byteLength),n=new Uint8Array(e),r=0;r<t.length;++r)t[r]=n[r];return t}function VB(e,t){if(!e)throw t}function HB(e,t,n,r,i){var a;return(t&r)>0?(a=e.parseByte(),(t&i)===0&&(a=-a),a=n+a):a=(t&i)>0?n:n+e.parseShort(),a}function UB(e,t,n){var r=new Z.Parser(t,n);e.numberOfContours=r.parseShort(),e._xMin=r.parseShort(),e._yMin=r.parseShort(),e._xMax=r.parseShort(),e._yMax=r.parseShort();var i,a;if(e.numberOfContours>0){for(var o=e.endPointIndices=[],s=0;s<e.numberOfContours;s+=1)o.push(r.parseUShort());e.instructionLength=r.parseUShort(),e.instructions=[];for(var c=0;c<e.instructionLength;c+=1)e.instructions.push(r.parseByte());var l=o[o.length-1]+1;i=[];for(var u=0;u<l;u+=1)if(a=r.parseByte(),i.push(a),(a&8)>0)for(var d=r.parseByte(),f=0;f<d;f+=1)i.push(a),u+=1;if(K.argument(i.length===l,`Bad flags.`),o.length>0){var p=[],m;if(l>0){for(var h=0;h<l;h+=1)a=i[h],m={},m.onCurve=!!(a&1),m.lastPointOfContour=o.indexOf(h)>=0,p.push(m);for(var g=0,_=0;_<l;_+=1)a=i[_],m=p[_],m.x=HB(r,a,g,2,16),g=m.x;for(var v=0,y=0;y<l;y+=1)a=i[y],m=p[y],m.y=HB(r,a,v,4,32),v=m.y}e.points=p}else e.points=[]}else if(e.numberOfContours===0)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];for(var b=!0;b;){i=r.parseUShort();var x={glyphIndex:r.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(i&1)>0?(i&2)>0?(x.dx=r.parseShort(),x.dy=r.parseShort()):x.matchedPoints=[r.parseUShort(),r.parseUShort()]:(i&2)>0?(x.dx=r.parseChar(),x.dy=r.parseChar()):x.matchedPoints=[r.parseByte(),r.parseByte()],(i&8)>0?x.xScale=x.yScale=r.parseF2Dot14():(i&64)>0?(x.xScale=r.parseF2Dot14(),x.yScale=r.parseF2Dot14()):(i&128)>0&&(x.xScale=r.parseF2Dot14(),x.scale01=r.parseF2Dot14(),x.scale10=r.parseF2Dot14(),x.yScale=r.parseF2Dot14()),e.components.push(x),b=!!(i&32)}if(i&256){e.instructionLength=r.parseUShort(),e.instructions=[];for(var S=0;S<e.instructionLength;S+=1)e.instructions.push(r.parseByte())}}}function WB(e,t){for(var n=[],r=0;r<e.length;r+=1){var i=e[r],a={x:t.xScale*i.x+t.scale01*i.y+t.dx,y:t.scale10*i.x+t.yScale*i.y+t.dy,onCurve:i.onCurve,lastPointOfContour:i.lastPointOfContour};n.push(a)}return n}function GB(e){for(var t=[],n=[],r=0;r<e.length;r+=1){var i=e[r];n.push(i),i.lastPointOfContour&&(t.push(n),n=[])}return K.argument(n.length===0,`There are still points left in the current contour.`),t}function KB(e){var t=new FL;if(!e)return t;for(var n=GB(e),r=0;r<n.length;++r){var i=n[r],a=null,o=i[i.length-1],s=i[0];if(o.onCurve)t.moveTo(o.x,o.y);else if(s.onCurve)t.moveTo(s.x,s.y);else{var c={x:(o.x+s.x)*.5,y:(o.y+s.y)*.5};t.moveTo(c.x,c.y)}for(var l=0;l<i.length;++l)if(a=o,o=s,s=i[(l+1)%i.length],o.onCurve)t.lineTo(o.x,o.y);else{var u=s;a.onCurve||((o.x+a.x)*.5,(o.y+a.y)*.5),s.onCurve||(u={x:(o.x+s.x)*.5,y:(o.y+s.y)*.5}),t.quadraticCurveTo(o.x,o.y,u.x,u.y)}t.closePath()}return t}function qB(e,t){if(t.isComposite)for(var n=0;n<t.components.length;n+=1){var r=t.components[n],i=e.get(r.glyphIndex);if(i.getPath(),i.points){var a=void 0;if(r.matchedPoints===void 0)a=WB(i.points,r);else{if(r.matchedPoints[0]>t.points.length-1||r.matchedPoints[1]>i.points.length-1)throw Error(`Matched points out of range in `+t.name);var o=t.points[r.matchedPoints[0]],s=i.points[r.matchedPoints[1]],c={xScale:r.xScale,scale01:r.scale01,scale10:r.scale10,yScale:r.yScale,dx:0,dy:0};s=WB([s],c)[0],c.dx=o.x-s.x,c.dy=o.y-s.y,a=WB(i.points,c)}t.points=t.points.concat(a)}}return KB(t.points)}function JB(e,t,n,r){for(var i=new UR.GlyphSet(r),a=0;a<n.length-1;a+=1){var o=n[a];o===n[a+1]?i.push(a,UR.glyphLoader(r,a)):i.push(a,UR.ttfGlyphLoader(r,a,UB,e,t+o,qB))}return i}function YB(e,t,n,r){var i=new UR.GlyphSet(r);return r._push=function(a){var o=n[a];o===n[a+1]?i.push(a,UR.glyphLoader(r,a)):i.push(a,UR.ttfGlyphLoader(r,a,UB,e,t+o,qB))},i}function XB(e,t,n,r,i){return i.lowMemory?YB(e,t,n,r):JB(e,t,n,r)}var ZB={getPath:KB,parse:XB},QB,$B,eV,tV;function nV(e){this.font=e,this.getCommands=function(e){return ZB.getPath(e).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function rV(e){return e}function iV(e){return Math.sign(e)*Math.round(Math.abs(e))}function aV(e){return Math.sign(e)*Math.round(Math.abs(e*2))/2}function oV(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function sV(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function cV(e){return Math.sign(e)*Math.floor(Math.abs(e))}var lV=function(e){var t=this.srPeriod,n=this.srPhase,r=this.srThreshold,i=1;return e<0&&(e=-e,i=-1),e+=r-n,e=Math.trunc(e/t)*t,e+=n,e<0?n*i:e*i},uV={x:1,y:0,axis:`x`,distance:function(e,t,n,r){return(n?e.xo:e.x)-(r?t.xo:t.x)},interpolate:function(e,t,n,r){var i,a,o,s,c,l,u;if(!r||r===this){if(i=e.xo-t.xo,a=e.xo-n.xo,c=t.x-t.xo,l=n.x-n.xo,o=Math.abs(i),s=Math.abs(a),u=o+s,u===0){e.x=e.xo+(c+l)/2;return}e.x=e.xo+(c*s+l*o)/u;return}if(i=r.distance(e,t,!0,!0),a=r.distance(e,n,!0,!0),c=r.distance(t,t,!1,!0),l=r.distance(n,n,!1,!0),o=Math.abs(i),s=Math.abs(a),u=o+s,u===0){uV.setRelative(e,e,(c+l)/2,r,!0);return}uV.setRelative(e,e,(c*s+l*o)/u,r,!0)},normalSlope:-1/0,setRelative:function(e,t,n,r,i){if(!r||r===this){e.x=(i?t.xo:t.x)+n;return}var a=i?t.xo:t.x,o=i?t.yo:t.y,s=a+n*r.x,c=o+n*r.y;e.x=s+(e.y-c)/r.normalSlope},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},dV={x:0,y:1,axis:`y`,distance:function(e,t,n,r){return(n?e.yo:e.y)-(r?t.yo:t.y)},interpolate:function(e,t,n,r){var i,a,o,s,c,l,u;if(!r||r===this){if(i=e.yo-t.yo,a=e.yo-n.yo,c=t.y-t.yo,l=n.y-n.yo,o=Math.abs(i),s=Math.abs(a),u=o+s,u===0){e.y=e.yo+(c+l)/2;return}e.y=e.yo+(c*s+l*o)/u;return}if(i=r.distance(e,t,!0,!0),a=r.distance(e,n,!0,!0),c=r.distance(t,t,!1,!0),l=r.distance(n,n,!1,!0),o=Math.abs(i),s=Math.abs(a),u=o+s,u===0){dV.setRelative(e,e,(c+l)/2,r,!0);return}dV.setRelative(e,e,(c*s+l*o)/u,r,!0)},normalSlope:0,setRelative:function(e,t,n,r,i){if(!r||r===this){e.y=(i?t.yo:t.y)+n;return}var a=i?t.xo:t.x,o=i?t.yo:t.y,s=a+n*r.x;e.y=o+n*r.y+r.normalSlope*(e.x-s)},slope:1/0,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};Object.freeze(uV),Object.freeze(dV);function fV(e,t){this.x=e,this.y=t,this.axis=void 0,this.slope=t/e,this.normalSlope=-e/t,Object.freeze(this)}fV.prototype.distance=function(e,t,n,r){return this.x*uV.distance(e,t,n,r)+this.y*dV.distance(e,t,n,r)},fV.prototype.interpolate=function(e,t,n,r){var i,a,o=r.distance(e,t,!0,!0),s=r.distance(e,n,!0,!0),c,l,u;if(i=r.distance(t,t,!1,!0),a=r.distance(n,n,!1,!0),c=Math.abs(o),l=Math.abs(s),u=c+l,u===0){this.setRelative(e,e,(i+a)/2,r,!0);return}this.setRelative(e,e,(i*l+a*c)/u,r,!0)},fV.prototype.setRelative=function(e,t,n,r,i){r||=this;var a=i?t.xo:t.x,o=i?t.yo:t.y,s=a+n*r.x,c=o+n*r.y,l=r.normalSlope,u=this.slope,d=e.x,f=e.y;e.x=(u*d-l*s+c-f)/(u-l),e.y=u*(e.x-d)+f},fV.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0};function pV(e,t){var n=Math.sqrt(e*e+t*t);return e/=n,t/=n,e===1&&t===0?uV:e===0&&t===1?dV:new fV(e,t)}function mV(e,t,n,r){this.x=this.xo=Math.round(e*64)/64,this.y=this.yo=Math.round(t*64)/64,this.lastPointOfContour=n,this.onCurve=r,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}mV.prototype.nextTouched=function(e){for(var t=this.nextPointOnContour;!e.touched(t)&&t!==this;)t=t.nextPointOnContour;return t},mV.prototype.prevTouched=function(e){for(var t=this.prevPointOnContour;!e.touched(t)&&t!==this;)t=t.prevPointOnContour;return t};var hV=Object.freeze(new mV(0,0)),gV={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function _V(e,t){switch(this.env=e,this.stack=[],this.prog=t,e){case`glyf`:this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case`prep`:this.fv=this.pv=this.dpv=uV,this.round=iV}}nV.prototype.exec=function(e,t){if(typeof t!=`number`)throw Error(`Point size is not a number!`);if(!(this._errorState>2)){var n=this.font,r=this._prepState;if(!r||r.ppem!==t){var i=this._fpgmState;if(!i){_V.prototype=gV,i=this._fpgmState=new _V(`fpgm`,n.tables.fpgm),i.funcs=[],i.font=n,exports.DEBUG&&(console.log(`---EXEC FPGM---`),i.step=-1);try{$B(i)}catch(e){console.log(`Hinting error in FPGM:`+e),this._errorState=3;return}}_V.prototype=i,r=this._prepState=new _V(`prep`,n.tables.prep),r.ppem=t;var a=n.tables.cvt;if(a)for(var o=r.cvt=Array(a.length),s=t/n.unitsPerEm,c=0;c<a.length;c++)o[c]=a[c]*s;else r.cvt=[];exports.DEBUG&&(console.log(`---EXEC PREP---`),r.step=-1);try{$B(r)}catch(e){this._errorState<2&&console.log(`Hinting error in PREP:`+e),this._errorState=2}}if(!(this._errorState>1))try{return eV(e,r)}catch(e){this._errorState<1&&(console.log(`Hinting error:`+e),console.log(`Note: further hinting errors are silenced`)),this._errorState=1;return}}},eV=function(e,t){var n=t.ppem/t.font.unitsPerEm,r=n,i=e.components,a,o,s;if(_V.prototype=t,!i)s=new _V(`glyf`,e.instructions),exports.DEBUG&&(console.log(`---EXEC GLYPH---`),s.step=-1),tV(e,s,n,r),o=s.gZone;else{var c=t.font;o=[],a=[];for(var l=0;l<i.length;l++){var u=i[l],d=c.glyphs.get(u.glyphIndex);s=new _V(`glyf`,d.instructions),exports.DEBUG&&(console.log(`---EXEC COMP `+l+`---`),s.step=-1),tV(d,s,n,r);for(var f=Math.round(u.dx*n),p=Math.round(u.dy*r),m=s.gZone,h=s.contours,g=0;g<m.length;g++){var _=m[g];_.xTouched=_.yTouched=!1,_.xo=_.x+=f,_.yo=_.y+=p}var v=o.length;o.push.apply(o,m);for(var y=0;y<h.length;y++)a.push(h[y]+v)}e.instructions&&!s.inhibitGridFit&&(s=new _V(`glyf`,e.instructions),s.gZone=s.z0=s.z1=s.z2=o,s.contours=a,o.push(new mV(0,0),new mV(Math.round(e.advanceWidth*n),0)),exports.DEBUG&&(console.log(`---EXEC COMPOSITE---`),s.step=-1),$B(s),o.length-=2)}return o},tV=function(e,t,n,r){for(var i=e.points||[],a=i.length,o=t.gZone=t.z0=t.z1=t.z2=[],s=t.contours=[],c,l=0;l<a;l++)c=i[l],o[l]=new mV(c.x*n,c.y*r,c.lastPointOfContour,c.onCurve);for(var u,d,f=0;f<a;f++)c=o[f],u||(u=c,s.push(f)),c.lastPointOfContour?(c.nextPointOnContour=u,u.prevPointOnContour=c,u=void 0):(d=o[f+1],c.nextPointOnContour=d,d.prevPointOnContour=c);if(!t.inhibitGridFit){if(exports.DEBUG){console.log(`PROCESSING GLYPH`,t.stack);for(var p=0;p<a;p++)console.log(p,o[p].x,o[p].y)}if(o.push(new mV(0,0),new mV(Math.round(e.advanceWidth*n),0)),$B(t),o.length-=2,exports.DEBUG){console.log(`FINISHED GLYPH`,t.stack);for(var m=0;m<a;m++)console.log(m,o[m].x,o[m].y)}}},$B=function(e){var t=e.prog;if(t){var n=t.length,r;for(e.ip=0;e.ip<n;e.ip++){if(exports.DEBUG&&e.step++,r=QB[t[e.ip]],!r)throw Error(`unknown instruction: 0x`+Number(t[e.ip]).toString(16));r(e)}}};function vV(e){for(var t=e.tZone=Array(e.gZone.length),n=0;n<t.length;n++)t[n]=new mV(0,0)}function yV(e,t){var n=e.prog,r=e.ip,i=1,a;do if(a=n[++r],a===88)i++;else if(a===89)i--;else if(a===64)r+=n[r+1]+1;else if(a===65)r+=2*n[r+1]+1;else if(a>=176&&a<=183)r+=a-176+1;else if(a>=184&&a<=191)r+=(a-184+1)*2;else if(t&&i===1&&a===27)break;while(i>0);e.ip=r}function bV(e,t){exports.DEBUG&&console.log(t.step,`SVTCA[`+e.axis+`]`),t.fv=t.pv=t.dpv=e}function xV(e,t){exports.DEBUG&&console.log(t.step,`SPVTCA[`+e.axis+`]`),t.pv=t.dpv=e}function SV(e,t){exports.DEBUG&&console.log(t.step,`SFVTCA[`+e.axis+`]`),t.fv=e}function CV(e,t){var n=t.stack,r=n.pop(),i=n.pop(),a=t.z2[r],o=t.z1[i];exports.DEBUG&&console.log(`SPVTL[`+e+`]`,r,i);var s,c;e?(s=a.y-o.y,c=o.x-a.x):(s=o.x-a.x,c=o.y-a.y),t.pv=t.dpv=pV(s,c)}function wV(e,t){var n=t.stack,r=n.pop(),i=n.pop(),a=t.z2[r],o=t.z1[i];exports.DEBUG&&console.log(`SFVTL[`+e+`]`,r,i);var s,c;e?(s=a.y-o.y,c=o.x-a.x):(s=o.x-a.x,c=o.y-a.y),t.fv=pV(s,c)}function TV(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`SPVFS[]`,n,r),e.pv=e.dpv=pV(r,n)}function EV(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`SPVFS[]`,n,r),e.fv=pV(r,n)}function DV(e){var t=e.stack,n=e.pv;exports.DEBUG&&console.log(e.step,`GPV[]`),t.push(n.x*16384),t.push(n.y*16384)}function OV(e){var t=e.stack,n=e.fv;exports.DEBUG&&console.log(e.step,`GFV[]`),t.push(n.x*16384),t.push(n.y*16384)}function kV(e){e.fv=e.pv,exports.DEBUG&&console.log(e.step,`SFVTPV[]`)}function AV(e){var t=e.stack,n=t.pop(),r=t.pop(),i=t.pop(),a=t.pop(),o=t.pop(),s=e.z0,c=e.z1,l=s[n],u=s[r],d=c[i],f=c[a],p=e.z2[o];exports.DEBUG&&console.log(`ISECT[], `,n,r,i,a,o);var m=l.x,h=l.y,g=u.x,_=u.y,v=d.x,y=d.y,b=f.x,x=f.y,S=(m-g)*(y-x)-(h-_)*(v-b),C=m*_-h*g,w=v*x-y*b;p.x=(C*(v-b)-w*(m-g))/S,p.y=(C*(y-x)-w*(h-_))/S}function jV(e){e.rp0=e.stack.pop(),exports.DEBUG&&console.log(e.step,`SRP0[]`,e.rp0)}function MV(e){e.rp1=e.stack.pop(),exports.DEBUG&&console.log(e.step,`SRP1[]`,e.rp1)}function NV(e){e.rp2=e.stack.pop(),exports.DEBUG&&console.log(e.step,`SRP2[]`,e.rp2)}function PV(e){var t=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,`SZP0[]`,t),e.zp0=t,t){case 0:e.tZone||vV(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw Error(`Invalid zone pointer`)}}function FV(e){var t=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,`SZP1[]`,t),e.zp1=t,t){case 0:e.tZone||vV(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw Error(`Invalid zone pointer`)}}function IV(e){var t=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,`SZP2[]`,t),e.zp2=t,t){case 0:e.tZone||vV(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw Error(`Invalid zone pointer`)}}function LV(e){var t=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,`SZPS[]`,t),e.zp0=e.zp1=e.zp2=t,t){case 0:e.tZone||vV(e),e.z0=e.z1=e.z2=e.tZone;break;case 1:e.z0=e.z1=e.z2=e.gZone;break;default:throw Error(`Invalid zone pointer`)}}function RV(e){e.loop=e.stack.pop(),exports.DEBUG&&console.log(e.step,`SLOOP[]`,e.loop)}function zV(e){exports.DEBUG&&console.log(e.step,`RTG[]`),e.round=iV}function BV(e){exports.DEBUG&&console.log(e.step,`RTHG[]`),e.round=oV}function VV(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`SMD[]`,t),e.minDis=t/64}function HV(e){exports.DEBUG&&console.log(e.step,`ELSE[]`),yV(e,!1)}function UV(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`JMPR[]`,t),e.ip+=t-1}function WV(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`SCVTCI[]`,t),e.cvCutIn=t/64}function GV(e){var t=e.stack;exports.DEBUG&&console.log(e.step,`DUP[]`),t.push(t[t.length-1])}function KV(e){exports.DEBUG&&console.log(e.step,`POP[]`),e.stack.pop()}function qV(e){exports.DEBUG&&console.log(e.step,`CLEAR[]`),e.stack.length=0}function JV(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`SWAP[]`),t.push(n),t.push(r)}function YV(e){var t=e.stack;exports.DEBUG&&console.log(e.step,`DEPTH[]`),t.push(t.length)}function XV(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`LOOPCALL[]`,n,r);var i=e.ip,a=e.prog;e.prog=e.funcs[n];for(var o=0;o<r;o++)$B(e),exports.DEBUG&&console.log(++e.step,o+1<r?`next loopcall`:`done loopcall`,o);e.ip=i,e.prog=a}function ZV(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`CALL[]`,t);var n=e.ip,r=e.prog;e.prog=e.funcs[t],$B(e),e.ip=n,e.prog=r,exports.DEBUG&&console.log(++e.step,`returning from`,t)}function QV(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`CINDEX[]`,n),t.push(t[t.length-n])}function $V(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`MINDEX[]`,n),t.push(t.splice(t.length-n,1)[0])}function eH(e){if(e.env!==`fpgm`)throw Error(`FDEF not allowed here`);var t=e.stack,n=e.prog,r=e.ip,i=t.pop(),a=r;for(exports.DEBUG&&console.log(e.step,`FDEF[]`,i);n[++r]!==45;);e.ip=r,e.funcs[i]=n.slice(a+1,r)}function tH(e,t){var n=t.stack.pop(),r=t.z0[n],i=t.fv,a=t.pv;exports.DEBUG&&console.log(t.step,`MDAP[`+e+`]`,n);var o=a.distance(r,hV);e&&(o=t.round(o)),i.setRelative(r,hV,o,a),i.touch(r),t.rp0=t.rp1=n}function nH(e,t){var n=t.z2,r=n.length-2,i,a,o;exports.DEBUG&&console.log(t.step,`IUP[`+e.axis+`]`);for(var s=0;s<r;s++)i=n[s],!e.touched(i)&&(a=i.prevTouched(e),a!==i&&(o=i.nextTouched(e),a===o&&e.setRelative(i,i,e.distance(a,a,!1,!0),e,!0),e.interpolate(i,a,o,e)))}function rH(e,t){for(var n=t.stack,r=e?t.rp1:t.rp2,i=(e?t.z0:t.z1)[r],a=t.fv,o=t.pv,s=t.loop,c=t.z2;s--;){var l=n.pop(),u=c[l],d=o.distance(i,i,!1,!0);a.setRelative(u,u,d,o),a.touch(u),exports.DEBUG&&console.log(t.step,(t.loop>1?`loop `+(t.loop-s)+`: `:``)+`SHP[`+(e?`rp1`:`rp2`)+`]`,l)}t.loop=1}function iH(e,t){var n=t.stack,r=e?t.rp1:t.rp2,i=(e?t.z0:t.z1)[r],a=t.fv,o=t.pv,s=n.pop(),c=t.z2[t.contours[s]],l=c;exports.DEBUG&&console.log(t.step,`SHC[`+e+`]`,s);var u=o.distance(i,i,!1,!0);do l!==i&&a.setRelative(l,l,u,o),l=l.nextPointOnContour;while(l!==c)}function aH(e,t){var n=t.stack,r=e?t.rp1:t.rp2,i=(e?t.z0:t.z1)[r],a=t.fv,o=t.pv,s=n.pop();exports.DEBUG&&console.log(t.step,`SHZ[`+e+`]`,s);var c;switch(s){case 0:c=t.tZone;break;case 1:c=t.gZone;break;default:throw Error(`Invalid zone`)}for(var l,u=o.distance(i,i,!1,!0),d=c.length-2,f=0;f<d;f++)l=c[f],a.setRelative(l,l,u,o)}function oH(e){for(var t=e.stack,n=e.loop,r=e.fv,i=t.pop()/64,a=e.z2;n--;){var o=t.pop(),s=a[o];exports.DEBUG&&console.log(e.step,(e.loop>1?`loop `+(e.loop-n)+`: `:``)+`SHPIX[]`,o,i),r.setRelative(s,s,i),r.touch(s)}e.loop=1}function sH(e){for(var t=e.stack,n=e.rp1,r=e.rp2,i=e.loop,a=e.z0[n],o=e.z1[r],s=e.fv,c=e.dpv,l=e.z2;i--;){var u=t.pop(),d=l[u];exports.DEBUG&&console.log(e.step,(e.loop>1?`loop `+(e.loop-i)+`: `:``)+`IP[]`,u,n,`<->`,r),s.interpolate(d,a,o,c),s.touch(d)}e.loop=1}function cH(e,t){var n=t.stack,r=n.pop()/64,i=n.pop(),a=t.z1[i],o=t.z0[t.rp0],s=t.fv,c=t.pv;s.setRelative(a,o,r,c),s.touch(a),exports.DEBUG&&console.log(t.step,`MSIRP[`+e+`]`,r,i),t.rp1=t.rp0,t.rp2=i,e&&(t.rp0=i)}function lH(e){for(var t=e.stack,n=e.rp0,r=e.z0[n],i=e.loop,a=e.fv,o=e.pv,s=e.z1;i--;){var c=t.pop(),l=s[c];exports.DEBUG&&console.log(e.step,(e.loop>1?`loop `+(e.loop-i)+`: `:``)+`ALIGNRP[]`,c),a.setRelative(l,r,0,o),a.touch(l)}e.loop=1}function uH(e){exports.DEBUG&&console.log(e.step,`RTDG[]`),e.round=aV}function dH(e,t){var n=t.stack,r=n.pop(),i=n.pop(),a=t.z0[i],o=t.fv,s=t.pv,c=t.cvt[r];exports.DEBUG&&console.log(t.step,`MIAP[`+e+`]`,r,`(`,c,`)`,i);var l=s.distance(a,hV);e&&(Math.abs(l-c)<t.cvCutIn&&(l=c),l=t.round(l)),o.setRelative(a,hV,l,s),t.zp0===0&&(a.xo=a.x,a.yo=a.y),o.touch(a),t.rp0=t.rp1=i}function fH(e){var t=e.prog,n=e.ip,r=e.stack,i=t[++n];exports.DEBUG&&console.log(e.step,`NPUSHB[]`,i);for(var a=0;a<i;a++)r.push(t[++n]);e.ip=n}function pH(e){var t=e.ip,n=e.prog,r=e.stack,i=n[++t];exports.DEBUG&&console.log(e.step,`NPUSHW[]`,i);for(var a=0;a<i;a++){var o=n[++t]<<8|n[++t];o&32768&&(o=-((o^65535)+1)),r.push(o)}e.ip=t}function mH(e){var t=e.stack,n=e.store;n||=e.store=[];var r=t.pop(),i=t.pop();exports.DEBUG&&console.log(e.step,`WS`,r,i),n[i]=r}function hH(e){var t=e.stack,n=e.store,r=t.pop();exports.DEBUG&&console.log(e.step,`RS`,r);var i=n&&n[r]||0;t.push(i)}function gH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`WCVTP`,n,r),e.cvt[r]=n/64}function _H(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`RCVT`,n),t.push(e.cvt[n]*64)}function vH(e,t){var n=t.stack,r=n.pop(),i=t.z2[r];exports.DEBUG&&console.log(t.step,`GC[`+e+`]`,r),n.push(t.dpv.distance(i,hV,e,!1)*64)}function yH(e,t){var n=t.stack,r=n.pop(),i=n.pop(),a=t.z1[r],o=t.z0[i],s=t.dpv.distance(o,a,e,e);exports.DEBUG&&console.log(t.step,`MD[`+e+`]`,r,i,`->`,s),t.stack.push(Math.round(s*64))}function bH(e){exports.DEBUG&&console.log(e.step,`MPPEM[]`),e.stack.push(e.ppem)}function xH(e){exports.DEBUG&&console.log(e.step,`FLIPON[]`),e.autoFlip=!0}function SH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`LT[]`,n,r),t.push(+(r<n))}function CH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`LTEQ[]`,n,r),t.push(+(r<=n))}function wH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`GT[]`,n,r),t.push(+(r>n))}function TH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`GTEQ[]`,n,r),t.push(+(r>=n))}function EH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`EQ[]`,n,r),t.push(+(n===r))}function DH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`NEQ[]`,n,r),t.push(n===r?0:1)}function OH(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`ODD[]`,n),t.push(Math.trunc(n)%2?1:0)}function kH(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`EVEN[]`,n),t.push(Math.trunc(n)%2?0:1)}function AH(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`IF[]`,t),t||(yV(e,!0),exports.DEBUG&&console.log(e.step,`EIF[]`))}function jH(e){exports.DEBUG&&console.log(e.step,`EIF[]`)}function MH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`AND[]`,n,r),t.push(n&&r?1:0)}function NH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`OR[]`,n,r),t.push(n||r?1:0)}function PH(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`NOT[]`,n),t.push(+!n)}function FH(e,t){var n=t.stack,r=n.pop(),i=t.fv,a=t.pv,o=t.ppem,s=t.deltaBase+(e-1)*16,c=t.deltaShift,l=t.z0;exports.DEBUG&&console.log(t.step,`DELTAP[`+e+`]`,r,n);for(var u=0;u<r;u++){var d=n.pop(),f=n.pop();if(s+((f&240)>>4)===o){var p=(f&15)-8;p>=0&&p++,exports.DEBUG&&console.log(t.step,`DELTAPFIX`,d,`by`,p*c);var m=l[d];i.setRelative(m,m,p*c,a)}}}function IH(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`SDB[]`,t),e.deltaBase=t}function LH(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`SDS[]`,t),e.deltaShift=.5**t}function RH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`ADD[]`,n,r),t.push(r+n)}function zH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`SUB[]`,n,r),t.push(r-n)}function BH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`DIV[]`,n,r),t.push(r*64/n)}function VH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`MUL[]`,n,r),t.push(r*n/64)}function HH(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`ABS[]`,n),t.push(Math.abs(n))}function UH(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`NEG[]`,n),t.push(-n)}function WH(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`FLOOR[]`,n),t.push(Math.floor(n/64)*64)}function GH(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`CEILING[]`,n),t.push(Math.ceil(n/64)*64)}function KH(e,t){var n=t.stack,r=n.pop();exports.DEBUG&&console.log(t.step,`ROUND[]`),n.push(t.round(r/64)*64)}function qH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`WCVTF[]`,n,r),e.cvt[r]=n*e.ppem/e.font.unitsPerEm}function JH(e,t){var n=t.stack,r=n.pop(),i=t.ppem,a=t.deltaBase+(e-1)*16,o=t.deltaShift;exports.DEBUG&&console.log(t.step,`DELTAC[`+e+`]`,r,n);for(var s=0;s<r;s++){var c=n.pop(),l=n.pop();if(a+((l&240)>>4)===i){var u=(l&15)-8;u>=0&&u++;var d=u*o;exports.DEBUG&&console.log(t.step,`DELTACFIX`,c,`by`,d),t.cvt[c]+=d}}}function YH(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`SROUND[]`,t),e.round=lV;var n;switch(t&192){case 0:n=.5;break;case 64:n=1;break;case 128:n=2;break;default:throw Error(`invalid SROUND value`)}switch(e.srPeriod=n,t&48){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*n;break;case 32:e.srPhase=.5*n;break;case 48:e.srPhase=.75*n;break;default:throw Error(`invalid SROUND value`)}t&=15,t===0?e.srThreshold=0:e.srThreshold=(t/8-.5)*n}function XH(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`S45ROUND[]`,t),e.round=lV;var n;switch(t&192){case 0:n=Math.sqrt(2)/2;break;case 64:n=Math.sqrt(2);break;case 128:n=2*Math.sqrt(2);break;default:throw Error(`invalid S45ROUND value`)}switch(e.srPeriod=n,t&48){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*n;break;case 32:e.srPhase=.5*n;break;case 48:e.srPhase=.75*n;break;default:throw Error(`invalid S45ROUND value`)}t&=15,t===0?e.srThreshold=0:e.srThreshold=(t/8-.5)*n}function ZH(e){exports.DEBUG&&console.log(e.step,`ROFF[]`),e.round=rV}function QH(e){exports.DEBUG&&console.log(e.step,`RUTG[]`),e.round=sV}function $H(e){exports.DEBUG&&console.log(e.step,`RDTG[]`),e.round=cV}function eU(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`SCANCTRL[]`,t)}function tU(e,t){var n=t.stack,r=n.pop(),i=n.pop(),a=t.z2[r],o=t.z1[i];exports.DEBUG&&console.log(t.step,`SDPVTL[`+e+`]`,r,i);var s,c;e?(s=a.y-o.y,c=o.x-a.x):(s=o.x-a.x,c=o.y-a.y),t.dpv=pV(s,c)}function nU(e){var t=e.stack,n=t.pop(),r=0;exports.DEBUG&&console.log(e.step,`GETINFO[]`,n),n&1&&(r=35),n&32&&(r|=4096),t.push(r)}function rU(e){var t=e.stack,n=t.pop(),r=t.pop(),i=t.pop();exports.DEBUG&&console.log(e.step,`ROLL[]`),t.push(r),t.push(n),t.push(i)}function iU(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`MAX[]`,n,r),t.push(Math.max(r,n))}function aU(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`MIN[]`,n,r),t.push(Math.min(r,n))}function oU(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`SCANTYPE[]`,t)}function sU(e){var t=e.stack.pop(),n=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,`INSTCTRL[]`,t,n),t){case 1:e.inhibitGridFit=!!n;return;case 2:e.ignoreCvt=!!n;return;default:throw Error(`invalid INSTCTRL[] selector`)}}function cU(e,t){var n=t.stack,r=t.prog,i=t.ip;exports.DEBUG&&console.log(t.step,`PUSHB[`+e+`]`);for(var a=0;a<e;a++)n.push(r[++i]);t.ip=i}function lU(e,t){var n=t.ip,r=t.prog,i=t.stack;exports.DEBUG&&console.log(t.ip,`PUSHW[`+e+`]`);for(var a=0;a<e;a++){var o=r[++n]<<8|r[++n];o&32768&&(o=-((o^65535)+1)),i.push(o)}t.ip=n}function Q(e,t,n,r,i,a){var o=a.stack,s=e&&o.pop(),c=o.pop(),l=a.rp0,u=a.z0[l],d=a.z1[c],f=a.minDis,p=a.fv,m=a.dpv,h,g=h=m.distance(d,u,!0,!0),_=g>=0?1:-1,v;g=Math.abs(g),e&&(v=a.cvt[s],r&&Math.abs(g-v)<a.cvCutIn&&(g=v)),n&&g<f&&(g=f),r&&(g=a.round(g)),p.setRelative(d,u,_*g,m),p.touch(d),exports.DEBUG&&console.log(a.step,(e?`MIRP[`:`MDRP[`)+(t?`M`:`m`)+(n?`>`:`_`)+(r?`R`:`_`)+(i===0?`Gr`:i===1?`Bl`:i===2?`Wh`:``)+`]`,e?s+`(`+a.cvt[s]+`,`+v+`)`:``,c,`(d =`,h,`->`,_*g,`)`),a.rp1=a.rp0,a.rp2=c,t&&(a.rp0=c)}QB=[bV.bind(void 0,dV),bV.bind(void 0,uV),xV.bind(void 0,dV),xV.bind(void 0,uV),SV.bind(void 0,dV),SV.bind(void 0,uV),CV.bind(void 0,0),CV.bind(void 0,1),wV.bind(void 0,0),wV.bind(void 0,1),TV,EV,DV,OV,kV,AV,jV,MV,NV,PV,FV,IV,LV,RV,zV,BV,VV,HV,UV,WV,void 0,void 0,GV,KV,qV,JV,YV,QV,$V,void 0,void 0,void 0,XV,ZV,eH,void 0,tH.bind(void 0,0),tH.bind(void 0,1),nH.bind(void 0,dV),nH.bind(void 0,uV),rH.bind(void 0,0),rH.bind(void 0,1),iH.bind(void 0,0),iH.bind(void 0,1),aH.bind(void 0,0),aH.bind(void 0,1),oH,sH,cH.bind(void 0,0),cH.bind(void 0,1),lH,uH,dH.bind(void 0,0),dH.bind(void 0,1),fH,pH,mH,hH,gH,_H,vH.bind(void 0,0),vH.bind(void 0,1),void 0,yH.bind(void 0,0),yH.bind(void 0,1),bH,void 0,xH,void 0,void 0,SH,CH,wH,TH,EH,DH,OH,kH,AH,jH,MH,NH,PH,FH.bind(void 0,1),IH,LH,RH,zH,BH,VH,HH,UH,WH,GH,KH.bind(void 0,0),KH.bind(void 0,1),KH.bind(void 0,2),KH.bind(void 0,3),void 0,void 0,void 0,void 0,qH,FH.bind(void 0,2),FH.bind(void 0,3),JH.bind(void 0,1),JH.bind(void 0,2),JH.bind(void 0,3),YH,XH,void 0,void 0,ZH,void 0,QH,$H,KV,KV,void 0,void 0,void 0,void 0,void 0,eU,tU.bind(void 0,0),tU.bind(void 0,1),nU,void 0,rU,iU,aU,oU,sU,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,cU.bind(void 0,1),cU.bind(void 0,2),cU.bind(void 0,3),cU.bind(void 0,4),cU.bind(void 0,5),cU.bind(void 0,6),cU.bind(void 0,7),cU.bind(void 0,8),lU.bind(void 0,1),lU.bind(void 0,2),lU.bind(void 0,3),lU.bind(void 0,4),lU.bind(void 0,5),lU.bind(void 0,6),lU.bind(void 0,7),lU.bind(void 0,8),Q.bind(void 0,0,0,0,0,0),Q.bind(void 0,0,0,0,0,1),Q.bind(void 0,0,0,0,0,2),Q.bind(void 0,0,0,0,0,3),Q.bind(void 0,0,0,0,1,0),Q.bind(void 0,0,0,0,1,1),Q.bind(void 0,0,0,0,1,2),Q.bind(void 0,0,0,0,1,3),Q.bind(void 0,0,0,1,0,0),Q.bind(void 0,0,0,1,0,1),Q.bind(void 0,0,0,1,0,2),Q.bind(void 0,0,0,1,0,3),Q.bind(void 0,0,0,1,1,0),Q.bind(void 0,0,0,1,1,1),Q.bind(void 0,0,0,1,1,2),Q.bind(void 0,0,0,1,1,3),Q.bind(void 0,0,1,0,0,0),Q.bind(void 0,0,1,0,0,1),Q.bind(void 0,0,1,0,0,2),Q.bind(void 0,0,1,0,0,3),Q.bind(void 0,0,1,0,1,0),Q.bind(void 0,0,1,0,1,1),Q.bind(void 0,0,1,0,1,2),Q.bind(void 0,0,1,0,1,3),Q.bind(void 0,0,1,1,0,0),Q.bind(void 0,0,1,1,0,1),Q.bind(void 0,0,1,1,0,2),Q.bind(void 0,0,1,1,0,3),Q.bind(void 0,0,1,1,1,0),Q.bind(void 0,0,1,1,1,1),Q.bind(void 0,0,1,1,1,2),Q.bind(void 0,0,1,1,1,3),Q.bind(void 0,1,0,0,0,0),Q.bind(void 0,1,0,0,0,1),Q.bind(void 0,1,0,0,0,2),Q.bind(void 0,1,0,0,0,3),Q.bind(void 0,1,0,0,1,0),Q.bind(void 0,1,0,0,1,1),Q.bind(void 0,1,0,0,1,2),Q.bind(void 0,1,0,0,1,3),Q.bind(void 0,1,0,1,0,0),Q.bind(void 0,1,0,1,0,1),Q.bind(void 0,1,0,1,0,2),Q.bind(void 0,1,0,1,0,3),Q.bind(void 0,1,0,1,1,0),Q.bind(void 0,1,0,1,1,1),Q.bind(void 0,1,0,1,1,2),Q.bind(void 0,1,0,1,1,3),Q.bind(void 0,1,1,0,0,0),Q.bind(void 0,1,1,0,0,1),Q.bind(void 0,1,1,0,0,2),Q.bind(void 0,1,1,0,0,3),Q.bind(void 0,1,1,0,1,0),Q.bind(void 0,1,1,0,1,1),Q.bind(void 0,1,1,0,1,2),Q.bind(void 0,1,1,0,1,3),Q.bind(void 0,1,1,1,0,0),Q.bind(void 0,1,1,1,0,1),Q.bind(void 0,1,1,1,0,2),Q.bind(void 0,1,1,1,0,3),Q.bind(void 0,1,1,1,1,0),Q.bind(void 0,1,1,1,1,1),Q.bind(void 0,1,1,1,1,2),Q.bind(void 0,1,1,1,1,3)];function uU(e){this.char=e,this.state={},this.activeState=null}function dU(e,t,n){this.contextName=n,this.startIndex=e,this.endOffset=t}function fU(e,t,n){this.contextName=e,this.openRange=null,this.ranges=[],this.checkStart=t,this.checkEnd=n}function pU(e,t){this.context=e,this.index=t,this.length=e.length,this.current=e[t],this.backtrack=e.slice(0,t),this.lookahead=e.slice(t+1)}function mU(e){this.eventId=e,this.subscribers=[]}function hU(e){var t=this,n=[`start`,`end`,`next`,`newToken`,`contextStart`,`contextEnd`,`insertToken`,`removeToken`,`removeRange`,`replaceToken`,`replaceRange`,`composeRUD`,`updateContextsRanges`];n.forEach(function(e){Object.defineProperty(t.events,e,{value:new mU(e)})}),e&&n.forEach(function(n){var r=e[n];typeof r==`function`&&t.events[n].subscribe(r)}),[`insertToken`,`removeToken`,`removeRange`,`replaceToken`,`replaceRange`,`composeRUD`].forEach(function(e){t.events[e].subscribe(t.updateContextsRanges)})}function gU(e){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],hU.call(this,e)}uU.prototype.setState=function(e,t){return this.state[e]=t,this.activeState={key:e,value:this.state[e]},this.activeState},uU.prototype.getState=function(e){return this.state[e]||null},gU.prototype.inboundIndex=function(e){return e>=0&&e<this.tokens.length},gU.prototype.composeRUD=function(e){var t=this,n=!0,r=e.map(function(e){return t[e[0]].apply(t,e.slice(1).concat(n))}),i=function(e){return typeof e==`object`&&e.hasOwnProperty(`FAIL`)};if(r.every(i))return{FAIL:`composeRUD: one or more operations hasn't completed successfully`,report:r.filter(i)};this.dispatch(`composeRUD`,[r.filter(function(e){return!i(e)})])},gU.prototype.replaceRange=function(e,t,n,r){t=t===null?this.tokens.length:t;var i=n.every(function(e){return e instanceof uU});if(!isNaN(e)&&this.inboundIndex(e)&&i){var a=this.tokens.splice.apply(this.tokens,[e,t].concat(n));return r||this.dispatch(`replaceToken`,[e,t,n]),[a,n]}else return{FAIL:`replaceRange: invalid tokens or startIndex.`}},gU.prototype.replaceToken=function(e,t,n){if(!isNaN(e)&&this.inboundIndex(e)&&t instanceof uU){var r=this.tokens.splice(e,1,t);return n||this.dispatch(`replaceToken`,[e,t]),[r[0],t]}else return{FAIL:`replaceToken: invalid token or index.`}},gU.prototype.removeRange=function(e,t,n){t=isNaN(t)?this.tokens.length:t;var r=this.tokens.splice(e,t);return n||this.dispatch(`removeRange`,[r,e,t]),r},gU.prototype.removeToken=function(e,t){if(!isNaN(e)&&this.inboundIndex(e)){var n=this.tokens.splice(e,1);return t||this.dispatch(`removeToken`,[n,e]),n}else return{FAIL:`removeToken: invalid token index.`}},gU.prototype.insertToken=function(e,t,n){return e.every(function(e){return e instanceof uU})?(this.tokens.splice.apply(this.tokens,[t,0].concat(e)),n||this.dispatch(`insertToken`,[e,t]),e):{FAIL:`insertToken: invalid token(s).`}},gU.prototype.registerModifier=function(e,t,n){this.events.newToken.subscribe(function(r,i){var a=[r,i],o=t===null||t.apply(this,a)===!0,s=[r,i];if(o){var c=n.apply(this,s);r.setState(e,c)}}),this.registeredModifiers.push(e)},mU.prototype.subscribe=function(e){return typeof e==`function`?this.subscribers.push(e)-1:{FAIL:`invalid '`+this.eventId+`' event handler`}},mU.prototype.unsubscribe=function(e){this.subscribers.splice(e,1)},pU.prototype.setCurrentIndex=function(e){this.index=e,this.current=this.context[e],this.backtrack=this.context.slice(0,e),this.lookahead=this.context.slice(e+1)},pU.prototype.get=function(e){switch(!0){case e===0:return this.current;case e<0&&Math.abs(e)<=this.backtrack.length:return this.backtrack.slice(e)[0];case e>0&&e<=this.lookahead.length:return this.lookahead[e-1];default:return null}},gU.prototype.rangeToText=function(e){if(e instanceof dU)return this.getRangeTokens(e).map(function(e){return e.char}).join(``)},gU.prototype.getText=function(){return this.tokens.map(function(e){return e.char}).join(``)},gU.prototype.getContext=function(e){return this.registeredContexts[e]||null},gU.prototype.on=function(e,t){var n=this.events[e];return n?n.subscribe(t):null},gU.prototype.dispatch=function(e,t){var n=this,r=this.events[e];r instanceof mU&&r.subscribers.forEach(function(e){e.apply(n,t||[])})},gU.prototype.registerContextChecker=function(e,t,n){if(this.getContext(e))return{FAIL:`context name '`+e+`' is already registered.`};if(typeof t!=`function`)return{FAIL:`missing context start check.`};if(typeof n!=`function`)return{FAIL:`missing context end check.`};var r=new fU(e,t,n);return this.registeredContexts[e]=r,this.contextCheckers.push(r),r},gU.prototype.getRangeTokens=function(e){var t=e.startIndex+e.endOffset;return[].concat(this.tokens.slice(e.startIndex,t))},gU.prototype.getContextRanges=function(e){var t=this.getContext(e);return t?t.ranges:{FAIL:`context checker '`+e+`' is not registered.`}},gU.prototype.resetContextsRanges=function(){var e=this.registeredContexts;for(var t in e)if(e.hasOwnProperty(t)){var n=e[t];n.ranges=[]}},gU.prototype.updateContextsRanges=function(){this.resetContextsRanges();for(var e=this.tokens.map(function(e){return e.char}),t=0;t<e.length;t++){var n=new pU(e,t);this.runContextCheck(n)}this.dispatch(`updateContextsRanges`,[this.registeredContexts])},gU.prototype.setEndOffset=function(e,t){var n=this.getContext(t).openRange.startIndex,r=new dU(n,e,t),i=this.getContext(t).ranges;return r.rangeId=t+`.`+i.length,i.push(r),this.getContext(t).openRange=null,r},gU.prototype.runContextCheck=function(e){var t=this,n=e.index;this.contextCheckers.forEach(function(r){var i=r.contextName,a=t.getContext(i).openRange;if(!a&&r.checkStart(e)&&(a=new dU(n,null,i),t.getContext(i).openRange=a,t.dispatch(`contextStart`,[i,n])),a&&r.checkEnd(e)){var o=n-a.startIndex+1,s=t.setEndOffset(o,i);t.dispatch(`contextEnd`,[i,s])}})},gU.prototype.tokenize=function(e){this.tokens=[],this.resetContextsRanges();var t=Array.from(e);this.dispatch(`start`);for(var n=0;n<t.length;n++){var r=t[n],i=new pU(t,n);this.dispatch(`next`,[i]),this.runContextCheck(i);var a=new uU(r);this.tokens.push(a),this.dispatch(`newToken`,[a,i])}return this.dispatch(`end`,[this.tokens]),this.tokens};function _U(e){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(e)}function vU(e){return/[\u0630\u0690\u0621\u0631\u0661\u0671\u0622\u0632\u0672\u0692\u06C2\u0623\u0673\u0693\u06C3\u0624\u0694\u06C4\u0625\u0675\u0695\u06C5\u06E5\u0676\u0696\u06C6\u0627\u0677\u0697\u06C7\u0648\u0688\u0698\u06C8\u0689\u0699\u06C9\u068A\u06CA\u066B\u068B\u06CB\u068C\u068D\u06CD\u06FD\u068E\u06EE\u06FE\u062F\u068F\u06CF\u06EF]/.test(e)}function yU(e){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(e)}function bU(e){return/[A-z]/.test(e)}function xU(e){return/\s/.test(e)}function SU(e){this.font=e,this.features={}}function CU(e){this.id=e.id,this.tag=e.tag,this.substitution=e.substitution}function wU(e,t){if(!e)return-1;switch(t.format){case 1:return t.glyphs.indexOf(e);case 2:for(var n=t.ranges,r=0;r<n.length;r++){var i=n[r];if(e>=i.start&&e<=i.end){var a=e-i.start;return i.index+a}}break;default:return-1}return-1}function TU(e,t){return wU(e,t.coverage)===-1?null:e+t.deltaGlyphId}function EU(e,t){var n=wU(e,t.coverage);return n===-1?null:t.substitute[n]}function DU(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=t.current;a=Array.isArray(a)?a[0]:a;var o=wU(a,i);o!==-1&&n.push(o)}return n.length===e.length?n:-1}function OU(e,t){var n=t.inputCoverage.length+t.lookaheadCoverage.length+t.backtrackCoverage.length;if(e.context.length<n)return[];var r=DU(t.inputCoverage,e);if(r===-1)return[];var i=t.inputCoverage.length-1;if(e.lookahead.length<t.lookaheadCoverage.length)return[];for(var a=e.lookahead.slice(i);a.length&&yU(a[0].char);)a.shift();var o=new pU(a,0),s=DU(t.lookaheadCoverage,o),c=[].concat(e.backtrack);for(c.reverse();c.length&&yU(c[0].char);)c.shift();if(c.length<t.backtrackCoverage.length)return[];var l=new pU(c,0),u=DU(t.backtrackCoverage,l),d=r.length===t.inputCoverage.length&&s.length===t.lookaheadCoverage.length&&u.length===t.backtrackCoverage.length,f=[];if(d)for(var p=0;p<t.lookupRecords.length;p++)for(var m=t.lookupRecords[p].lookupListIndex,h=this.getLookupByIndex(m),g=0;g<h.subtables.length;g++){var _=h.subtables[g],v=this.getLookupMethod(h,_);if(this.getSubstitutionType(h,_)===`12`)for(var y=0;y<r.length;y++){var b=v(e.get(y));b&&f.push(b)}}return f}function kU(e,t){var n=e.current,r=wU(n,t.coverage);if(r===-1)return null;for(var i,a=t.ligatureSets[r],o=0;o<a.length;o++){i=a[o];for(var s=0;s<i.components.length&&e.lookahead[s]===i.components[s];s++)if(s===i.components.length-1)return i}return null}function AU(e,t){var n=wU(e,t.coverage);return n===-1?null:t.sequences[n]}SU.prototype.getDefaultScriptFeaturesIndexes=function(){for(var e=this.font.tables.gsub.scripts,t=0;t<e.length;t++){var n=e[t];if(n.tag===`DFLT`)return n.script.defaultLangSys.featureIndexes}return[]},SU.prototype.getScriptFeaturesIndexes=function(e){if(!this.font.tables.gsub)return[];if(!e)return this.getDefaultScriptFeaturesIndexes();for(var t=this.font.tables.gsub.scripts,n=0;n<t.length;n++){var r=t[n];if(r.tag===e&&r.script.defaultLangSys)return r.script.defaultLangSys.featureIndexes;var i=r.langSysRecords;if(i)for(var a=0;a<i.length;a++){var o=i[a];if(o.tag===e)return o.langSys.featureIndexes}}return this.getDefaultScriptFeaturesIndexes()},SU.prototype.mapTagsToFeatures=function(e,t){for(var n={},r=0;r<e.length;r++){var i=e[r].tag;n[i]=e[r].feature}this.features[t].tags=n},SU.prototype.getScriptFeatures=function(e){var t=this.features[e];if(this.features.hasOwnProperty(e))return t;var n=this.getScriptFeaturesIndexes(e);if(!n)return null;var r=this.font.tables.gsub;return t=n.map(function(e){return r.features[e]}),this.features[e]=t,this.mapTagsToFeatures(t,e),t},SU.prototype.getSubstitutionType=function(e,t){return e.lookupType.toString()+t.substFormat.toString()},SU.prototype.getLookupMethod=function(e,t){var n=this;switch(this.getSubstitutionType(e,t)){case`11`:return function(e){return TU.apply(n,[e,t])};case`12`:return function(e){return EU.apply(n,[e,t])};case`63`:return function(e){return OU.apply(n,[e,t])};case`41`:return function(e){return kU.apply(n,[e,t])};case`21`:return function(e){return AU.apply(n,[e,t])};default:throw Error(`lookupType: `+e.lookupType+` - substFormat: `+t.substFormat+` is not yet supported`)}},SU.prototype.lookupFeature=function(e){var t=e.contextParams,n=t.index,r=this.getFeature({tag:e.tag,script:e.script});if(!r)return Error(`font '`+this.font.names.fullName.en+`' doesn't support feature '`+e.tag+`' for script '`+e.script+`'.`);for(var i=this.getFeatureLookups(r),a=[].concat(t.context),o=0;o<i.length;o++)for(var s=i[o],c=this.getLookupSubtables(s),l=0;l<c.length;l++){var u=c[l],d=this.getSubstitutionType(s,u),f=this.getLookupMethod(s,u),p=void 0;switch(d){case`11`:p=f(t.current),p&&a.splice(n,1,new CU({id:11,tag:e.tag,substitution:p}));break;case`12`:p=f(t.current),p&&a.splice(n,1,new CU({id:12,tag:e.tag,substitution:p}));break;case`63`:p=f(t),Array.isArray(p)&&p.length&&a.splice(n,1,new CU({id:63,tag:e.tag,substitution:p}));break;case`41`:p=f(t),p&&a.splice(n,1,new CU({id:41,tag:e.tag,substitution:p}));break;case`21`:p=f(t.current),p&&a.splice(n,1,new CU({id:21,tag:e.tag,substitution:p}));break}t=new pU(a,n),!(Array.isArray(p)&&!p.length)&&(p=null)}return a.length?a:null},SU.prototype.supports=function(e){if(!e.script)return!1;this.getScriptFeatures(e.script);var t=this.features.hasOwnProperty(e.script);if(!e.tag)return t;var n=this.features[e.script].some(function(t){return t.tag===e.tag});return t&&n},SU.prototype.getLookupSubtables=function(e){return e.subtables||null},SU.prototype.getLookupByIndex=function(e){return this.font.tables.gsub.lookups[e]||null},SU.prototype.getFeatureLookups=function(e){return e.lookupListIndexes.map(this.getLookupByIndex.bind(this))},SU.prototype.getFeature=function(e){if(!this.font)return{FAIL:`No font was found`};this.features.hasOwnProperty(e.script)||this.getScriptFeatures(e.script);var t=this.features[e.script];return t?t.tags[e.tag]?this.features[e.script].tags[e.tag]:null:{FAIL:`No feature for script `+e.script}};function jU(e){var t=e.current,n=e.get(-1);return n===null&&_U(t)||!_U(n)&&_U(t)}function MU(e){var t=e.get(1);return t===null||!_U(t)}var NU={startCheck:jU,endCheck:MU};function PU(e){var t=e.current,n=e.get(-1);return(_U(t)||yU(t))&&!_U(n)}function FU(e){var t=e.get(1);switch(!0){case t===null:return!0;case!_U(t)&&!yU(t):var n=xU(t);if(!n)return!0;if(n){var r=!1;if(r=e.lookahead.some(function(e){return _U(e)||yU(e)}),!r)return!0}break;default:return!1}}var IU={startCheck:PU,endCheck:FU};function LU(e,t,n){t[n].setState(e.tag,e.substitution)}function RU(e,t,n){t[n].setState(e.tag,e.substitution)}function zU(e,t,n){e.substitution.forEach(function(r,i){t[n+i].setState(e.tag,r)})}function BU(e,t,n){var r=t[n];r.setState(e.tag,e.substitution.ligGlyph);for(var i=e.substitution.components.length,a=0;a<i;a++)r=t[n+a+1],r.setState(`deleted`,!0)}var VU={11:LU,12:RU,63:zU,41:BU};function HU(e,t,n){e instanceof CU&&VU[e.id]&&VU[e.id](e,t,n)}function UU(e){for(var t=[].concat(e.backtrack),n=t.length-1;n>=0;n--){var r=t[n],i=vU(r),a=yU(r);if(!i&&!a)return!0;if(i)return!1}return!1}function WU(e){if(vU(e.current))return!1;for(var t=0;t<e.lookahead.length;t++){var n=e.lookahead[t];if(!yU(n))return!0}return!1}function GU(e){var t=this,n=`arab`,r=this.featuresTags[n],i=this.tokenizer.getRangeTokens(e);if(i.length!==1){var a=new pU(i.map(function(e){return e.getState(`glyphIndex`)}),0),o=new pU(i.map(function(e){return e.char}),0);i.forEach(function(e,s){if(!yU(e.char)){a.setCurrentIndex(s),o.setCurrentIndex(s);var c=0;UU(o)&&(c|=1),WU(o)&&(c|=2);var l;switch(c){case 1:l=`fina`;break;case 2:l=`init`;break;case 3:l=`medi`;break}if(r.indexOf(l)!==-1){var u=t.query.lookupFeature({tag:l,script:n,contextParams:a});if(u instanceof Error)return console.info(u.message);u.forEach(function(e,t){e instanceof CU&&(HU(e,i,t),a.context[t]=e.substitution)})}}})}}function KU(e,t){return new pU(e.map(function(e){return e.activeState.value}),t||0)}function qU(e){var t=this,n=`arab`,r=this.tokenizer.getRangeTokens(e),i=KU(r);i.context.forEach(function(e,a){i.setCurrentIndex(a);var o=t.query.lookupFeature({tag:`rlig`,script:n,contextParams:i});o.length&&(o.forEach(function(e){return HU(e,r,a)}),i=KU(r))})}function JU(e){var t=e.current,n=e.get(-1);return n===null&&bU(t)||!bU(n)&&bU(t)}function YU(e){var t=e.get(1);return t===null||!bU(t)}var XU={startCheck:JU,endCheck:YU};function ZU(e,t){return new pU(e.map(function(e){return e.activeState.value}),t||0)}function QU(e){var t=this,n=`latn`,r=this.tokenizer.getRangeTokens(e),i=ZU(r);i.context.forEach(function(e,a){i.setCurrentIndex(a);var o=t.query.lookupFeature({tag:`liga`,script:n,contextParams:i});o.length&&(o.forEach(function(e){return HU(e,r,a)}),i=ZU(r))})}function $U(e){this.baseDir=e||`ltr`,this.tokenizer=new gU,this.featuresTags={}}$U.prototype.setText=function(e){this.text=e},$U.prototype.contextChecks={latinWordCheck:XU,arabicWordCheck:NU,arabicSentenceCheck:IU};function eW(e){var t=this.contextChecks[e+`Check`];return this.tokenizer.registerContextChecker(e,t.startCheck,t.endCheck)}function tW(){return eW.call(this,`latinWord`),eW.call(this,`arabicWord`),eW.call(this,`arabicSentence`),this.tokenizer.tokenize(this.text)}function nW(){var e=this;this.tokenizer.getContextRanges(`arabicSentence`).forEach(function(t){var n=e.tokenizer.getRangeTokens(t);e.tokenizer.replaceRange(t.startIndex,t.endOffset,n.reverse())})}$U.prototype.registerFeatures=function(e,t){var n=this,r=t.filter(function(t){return n.query.supports({script:e,tag:t})});this.featuresTags.hasOwnProperty(e)?this.featuresTags[e]=this.featuresTags[e].concat(r):this.featuresTags[e]=r},$U.prototype.applyFeatures=function(e,t){if(!e)throw Error(`No valid font was provided to apply features`);this.query||=new SU(e);for(var n=0;n<t.length;n++){var r=t[n];this.query.supports({script:r.script})&&this.registerFeatures(r.script,r.tags)}},$U.prototype.registerModifier=function(e,t,n){this.tokenizer.registerModifier(e,t,n)};function rW(){if(this.tokenizer.registeredModifiers.indexOf(`glyphIndex`)===-1)throw Error(`glyphIndex modifier is required to apply arabic presentation features.`)}function iW(){var e=this;this.featuresTags.hasOwnProperty(`arab`)&&(rW.call(this),this.tokenizer.getContextRanges(`arabicWord`).forEach(function(t){GU.call(e,t)}))}function aW(){var e=this,t=`arab`;this.featuresTags.hasOwnProperty(t)&&this.featuresTags[t].indexOf(`rlig`)!==-1&&(rW.call(this),this.tokenizer.getContextRanges(`arabicWord`).forEach(function(t){qU.call(e,t)}))}function oW(){var e=this,t=`latn`;this.featuresTags.hasOwnProperty(t)&&this.featuresTags[t].indexOf(`liga`)!==-1&&(rW.call(this),this.tokenizer.getContextRanges(`latinWord`).forEach(function(t){QU.call(e,t)}))}$U.prototype.checkContextReady=function(e){return!!this.tokenizer.getContext(e)},$U.prototype.applyFeaturesToContexts=function(){this.checkContextReady(`arabicWord`)&&(iW.call(this),aW.call(this)),this.checkContextReady(`latinWord`)&&oW.call(this),this.checkContextReady(`arabicSentence`)&&nW.call(this)},$U.prototype.processText=function(e){(!this.text||this.text!==e)&&(this.setText(e),tW.call(this),this.applyFeaturesToContexts())},$U.prototype.getBidiText=function(e){return this.processText(e),this.tokenizer.getText()},$U.prototype.getTextGlyphs=function(e){this.processText(e);for(var t=[],n=0;n<this.tokenizer.tokens.length;n++){var r=this.tokenizer.tokens[n];if(!r.state.deleted){var i=r.activeState.value;t.push(Array.isArray(i)?i[0]:i)}}return t};function sW(e){e||={},e.tables=e.tables||{},e.empty||(VB(e.familyName,`When creating a new Font object, familyName is required.`),VB(e.styleName,`When creating a new Font object, styleName is required.`),VB(e.unitsPerEm,`When creating a new Font object, unitsPerEm is required.`),VB(e.ascender,`When creating a new Font object, ascender is required.`),VB(e.descender<=0,`When creating a new Font object, negative descender value is required.`),this.names={fontFamily:{en:e.familyName||` `},fontSubfamily:{en:e.styleName||` `},fullName:{en:e.fullName||e.familyName+` `+e.styleName},postScriptName:{en:e.postScriptName||(e.familyName+e.styleName).replace(/\s/g,``)},designer:{en:e.designer||` `},designerURL:{en:e.designerURL||` `},manufacturer:{en:e.manufacturer||` `},manufacturerURL:{en:e.manufacturerURL||` `},license:{en:e.license||` `},licenseURL:{en:e.licenseURL||` `},version:{en:e.version||`Version 0.1`},description:{en:e.description||` `},copyright:{en:e.copyright||` `},trademark:{en:e.trademark||` `}},this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.tables=Object.assign(e.tables,{os2:Object.assign({usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,fsSelection:e.fsSelection||this.fsSelectionValues.REGULAR},e.tables.os2)})),this.supported=!0,this.glyphs=new UR.GlyphSet(this,e.glyphs||[]),this.encoding=new DR(this),this.position=new PB(this),this.substitution=new FB(this),this.tables=this.tables||{},this._push=null,this._hmtxTableData={},Object.defineProperty(this,"hinting",{get:function(){if(this._hinting)return this._hinting;if(this.outlinesFormat===`truetype`)return this._hinting=new nV(this)}})}sW.prototype.hasChar=function(e){return this.encoding.charToGlyphIndex(e)!==null},sW.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},sW.prototype.charToGlyph=function(e){var t=this.charToGlyphIndex(e),n=this.glyphs.get(t);return n||=this.glyphs.get(0),n},sW.prototype.updateFeatures=function(e){return this.defaultRenderOptions.features.map(function(t){return t.script===`latn`?{script:`latn`,tags:t.tags.filter(function(t){return e[t]})}:t})},sW.prototype.stringToGlyphs=function(e,t){var n=this,r=new $U;r.registerModifier(`glyphIndex`,null,function(e){return n.charToGlyphIndex(e.char)});var i=t?this.updateFeatures(t.features):this.defaultRenderOptions.features;r.applyFeatures(this,i);for(var a=r.getTextGlyphs(e),o=a.length,s=Array(o),c=this.glyphs.get(0),l=0;l<o;l+=1)s[l]=this.glyphs.get(a[l])||c;return s},sW.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)},sW.prototype.nameToGlyph=function(e){var t=this.nameToGlyphIndex(e),n=this.glyphs.get(t);return n||=this.glyphs.get(0),n},sW.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):``},sW.prototype.getKerningValue=function(e,t){e=e.index||e,t=t.index||t;var n=this.position.defaultKerningTables;return n?this.position.getKerningValue(n,e,t):this.kerningPairs[e+`,`+t]||0},sW.prototype.defaultRenderOptions={kerning:!0,features:[{script:`arab`,tags:[`init`,`medi`,`fina`,`rlig`]},{script:`latn`,tags:[`liga`,`rlig`]}]},sW.prototype.forEachGlyph=function(e,t,n,r,i,a){t=t===void 0?0:t,n=n===void 0?0:n,r=r===void 0?72:r,i=Object.assign({},this.defaultRenderOptions,i);var o=1/this.unitsPerEm*r,s=this.stringToGlyphs(e,i),c;if(i.kerning){var l=i.script||this.position.getDefaultScriptName();c=this.position.getKerningTables(l,i.language)}for(var u=0;u<s.length;u+=1){var d=s[u];if(a.call(this,d,t,n,r,i),d.advanceWidth&&(t+=d.advanceWidth*o),i.kerning&&u<s.length-1){var f=c?this.position.getKerningValue(c,d.index,s[u+1].index):this.getKerningValue(d,s[u+1]);t+=f*o}i.letterSpacing?t+=i.letterSpacing*r:i.tracking&&(t+=i.tracking/1e3*r)}return t},sW.prototype.getPath=function(e,t,n,r,i){var a=new FL;return this.forEachGlyph(e,t,n,r,i,function(e,t,n,r){var o=e.getPath(t,n,r,i,this);a.extend(o)}),a},sW.prototype.getPaths=function(e,t,n,r,i){var a=[];return this.forEachGlyph(e,t,n,r,i,function(e,t,n,r){var o=e.getPath(t,n,r,i,this);a.push(o)}),a},sW.prototype.getAdvanceWidth=function(e,t,n){return this.forEachGlyph(e,0,0,t,n,function(){})},sW.prototype.draw=function(e,t,n,r,i,a){this.getPath(t,n,r,i,a).draw(e)},sW.prototype.drawPoints=function(e,t,n,r,i,a){this.forEachGlyph(t,n,r,i,a,function(t,n,r,i){t.drawPoints(e,n,r,i)})},sW.prototype.drawMetrics=function(e,t,n,r,i,a){this.forEachGlyph(t,n,r,i,a,function(t,n,r,i){t.drawMetrics(e,n,r,i)})},sW.prototype.getEnglishName=function(e){var t=this.names[e];if(t)return t.en},sW.prototype.validate=function(){var e=this;function t(t){var n=e.getEnglishName(t);n&&n.trim().length}t(`fontFamily`),t(`weightName`),t(`manufacturer`),t(`copyright`),t(`version`),this.unitsPerEm},sW.prototype.toTables=function(){return kB.fontToTable(this)},sW.prototype.toBuffer=function(){return console.warn(`Font.toBuffer is deprecated. Use Font.toArrayBuffer instead.`),this.toArrayBuffer()},sW.prototype.toArrayBuffer=function(){for(var e=this.toTables().encode(),t=new ArrayBuffer(e.length),n=new Uint8Array(t),r=0;r<e.length;r++)n[r]=e[r];return t},sW.prototype.download=function(e){var t=this.getEnglishName(`fontFamily`),n=this.getEnglishName(`fontSubfamily`);e||=t.replace(/\s/g,``)+`-`+n+`.otf`;var r=this.toArrayBuffer();if(RB())if(window.URL=window.URL||window.webkitURL,window.URL){var i=new DataView(r),a=new Blob([i],{type:`font/opentype`}),o=document.createElement(`a`);o.href=window.URL.createObjectURL(a),o.download=e;var s=document.createEvent(`MouseEvents`);s.initEvent(`click`,!0,!1),o.dispatchEvent(s)}else console.warn(`Font file could not be downloaded. Try using a different browser.`);else{var c=sL(),l=BB(r);c.writeFileSync(e,l)}},sW.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},sW.prototype.usWidthClasses={ULTRA_CONDENSED:1,EXTRA_CONDENSED:2,CONDENSED:3,SEMI_CONDENSED:4,MEDIUM:5,SEMI_EXPANDED:6,EXPANDED:7,EXTRA_EXPANDED:8,ULTRA_EXPANDED:9},sW.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};function cW(e,t){var n=JSON.stringify(e),r=256;for(var i in t){var a=parseInt(i);if(!(!a||a<256)){if(JSON.stringify(t[i])===n)return a;r<=a&&(r=a+1)}}return t[r]=e,r}function lW(e,t,n){var r=cW(t.name,n);return[{name:`tag_`+e,type:`TAG`,value:t.tag},{name:`minValue_`+e,type:`FIXED`,value:t.minValue<<16},{name:`defaultValue_`+e,type:`FIXED`,value:t.defaultValue<<16},{name:`maxValue_`+e,type:`FIXED`,value:t.maxValue<<16},{name:`flags_`+e,type:`USHORT`,value:0},{name:`nameID_`+e,type:`USHORT`,value:r}]}function uW(e,t,n){var r={},i=new Z.Parser(e,t);return r.tag=i.parseTag(),r.minValue=i.parseFixed(),r.defaultValue=i.parseFixed(),r.maxValue=i.parseFixed(),i.skip(`uShort`,1),r.name=n[i.parseUShort()]||{},r}function dW(e,t,n,r){for(var i=cW(t.name,r),a=[{name:`nameID_`+e,type:`USHORT`,value:i},{name:`flags_`+e,type:`USHORT`,value:0}],o=0;o<n.length;++o){var s=n[o].tag;a.push({name:`axis_`+e+` `+s,type:`FIXED`,value:t.coordinates[s]<<16})}return a}function fW(e,t,n,r){var i={},a=new Z.Parser(e,t);i.name=r[a.parseUShort()]||{},a.skip(`uShort`,1),i.coordinates={};for(var o=0;o<n.length;++o)i.coordinates[n[o].tag]=a.parseFixed();return i}function pW(e,t){var n=new Y.Table(`fvar`,[{name:`version`,type:`ULONG`,value:65536},{name:`offsetToData`,type:`USHORT`,value:0},{name:`countSizePairs`,type:`USHORT`,value:2},{name:`axisCount`,type:`USHORT`,value:e.axes.length},{name:`axisSize`,type:`USHORT`,value:20},{name:`instanceCount`,type:`USHORT`,value:e.instances.length},{name:`instanceSize`,type:`USHORT`,value:4+e.axes.length*4}]);n.offsetToData=n.sizeOf();for(var r=0;r<e.axes.length;r++)n.fields=n.fields.concat(lW(r,e.axes[r],t));for(var i=0;i<e.instances.length;i++)n.fields=n.fields.concat(dW(i,e.instances[i],e.axes,t));return n}function mW(e,t,n){var r=new Z.Parser(e,t),i=r.parseULong();K.argument(i===65536,`Unsupported fvar table version.`);var a=r.parseOffset16();r.skip(`uShort`,1);for(var o=r.parseUShort(),s=r.parseUShort(),c=r.parseUShort(),l=r.parseUShort(),u=[],d=0;d<o;d++)u.push(uW(e,t+a+d*s,n));for(var f=[],p=t+a+o*s,m=0;m<c;m++)f.push(fW(e,p+m*l,u,n));return{axes:u,instances:f}}var hW={make:pW,parse:mW},gW=function(){return{coverage:this.parsePointer(X.coverage),attachPoints:this.parseList(X.pointer(X.uShortList))}},_W=function(){var e=this.parseUShort();if(K.argument(e===1||e===2||e===3,`Unsupported CaretValue table version.`),e===1)return{coordinate:this.parseShort()};if(e===2)return{pointindex:this.parseShort()};if(e===3)return{coordinate:this.parseShort()}},vW=function(){return this.parseList(X.pointer(_W))},yW=function(){return{coverage:this.parsePointer(X.coverage),ligGlyphs:this.parseList(X.pointer(vW))}},bW=function(){return this.parseUShort(),this.parseList(X.pointer(X.coverage))};function xW(e,t){t||=0;var n=new X(e,t),r=n.parseVersion(1);K.argument(r===1||r===1.2||r===1.3,`Unsupported GDEF table version.`);var i={version:r,classDef:n.parsePointer(X.classDef),attachList:n.parsePointer(gW),ligCaretList:n.parsePointer(yW),markAttachClassDef:n.parsePointer(X.classDef)};return r>=1.2&&(i.markGlyphSets=n.parsePointer(bW)),i}var SW={parse:xW},CW=Array(10);CW[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{posFormat:1,coverage:this.parsePointer(X.coverage),value:this.parseValueRecord()};if(t===2)return{posFormat:2,coverage:this.parsePointer(X.coverage),values:this.parseValueRecordList()};K.assert(!1,`0x`+e.toString(16)+`: GPOS lookup type 1 format must be 1 or 2.`)},CW[2]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();K.assert(t===1||t===2,`0x`+e.toString(16)+`: GPOS lookup type 2 format must be 1 or 2.`);var n=this.parsePointer(X.coverage),r=this.parseUShort(),i=this.parseUShort();if(t===1)return{posFormat:t,coverage:n,valueFormat1:r,valueFormat2:i,pairSets:this.parseList(X.pointer(X.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(r),value2:this.parseValueRecord(i)}})))};if(t===2){var a=this.parsePointer(X.classDef),o=this.parsePointer(X.classDef),s=this.parseUShort(),c=this.parseUShort();return{posFormat:t,coverage:n,valueFormat1:r,valueFormat2:i,classDef1:a,classDef2:o,class1Count:s,class2Count:c,classRecords:this.parseList(s,X.list(c,function(){return{value1:this.parseValueRecord(r),value2:this.parseValueRecord(i)}}))}}},CW[3]=function(){return{error:`GPOS Lookup 3 not supported`}},CW[4]=function(){return{error:`GPOS Lookup 4 not supported`}},CW[5]=function(){return{error:`GPOS Lookup 5 not supported`}},CW[6]=function(){return{error:`GPOS Lookup 6 not supported`}},CW[7]=function(){return{error:`GPOS Lookup 7 not supported`}},CW[8]=function(){return{error:`GPOS Lookup 8 not supported`}},CW[9]=function(){return{error:`GPOS Lookup 9 not supported`}};function wW(e,t){t||=0;var n=new X(e,t),r=n.parseVersion(1);return K.argument(r===1||r===1.1,`Unsupported GPOS table version `+r),r===1?{version:r,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(CW)}:{version:r,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(CW),variations:n.parseFeatureVariationsList()}}var TW=Array(10);function EW(e){return new Y.Table(`GPOS`,[{name:`version`,type:`ULONG`,value:65536},{name:`scripts`,type:`TABLE`,value:new Y.ScriptList(e.scripts)},{name:`features`,type:`TABLE`,value:new Y.FeatureList(e.features)},{name:`lookups`,type:`TABLE`,value:new Y.LookupList(e.lookups,TW)}])}var DW={parse:wW,make:EW};function OW(e){var t={};e.skip(`uShort`);var n=e.parseUShort();K.argument(n===0,`Unsupported kern sub-table version.`),e.skip(`uShort`,2);var r=e.parseUShort();e.skip(`uShort`,3);for(var i=0;i<r;i+=1){var a=e.parseUShort(),o=e.parseUShort(),s=e.parseShort();t[a+`,`+o]=s}return t}function kW(e){var t={};e.skip(`uShort`),e.parseULong()>1&&console.warn(`Only the first kern subtable is supported.`),e.skip(`uLong`);var n=e.parseUShort()&255;if(e.skip(`uShort`),n===0){var r=e.parseUShort();e.skip(`uShort`,3);for(var i=0;i<r;i+=1){var a=e.parseUShort(),o=e.parseUShort(),s=e.parseShort();t[a+`,`+o]=s}}return t}function AW(e,t){var n=new Z.Parser(e,t),r=n.parseUShort();if(r===0)return OW(n);if(r===1)return kW(n);throw Error(`Unsupported kern table version (`+r+`).`)}var jW={parse:AW};function MW(e,t,n,r){for(var i=new Z.Parser(e,t),a=r?i.parseUShort:i.parseULong,o=[],s=0;s<n+1;s+=1){var c=a.call(i);r&&(c*=2),o.push(c)}return o}var NW={parse:MW};function PW(e,t){sL().readFile(e,function(e,n){if(e)return t(e.message);t(null,zB(n))})}function FW(e,t){var n=new XMLHttpRequest;n.open(`get`,e,!0),n.responseType=`arraybuffer`,n.onload=function(){return n.response?t(null,n.response):t(`Font could not be loaded: `+n.statusText)},n.onerror=function(){t(`Font could not be loaded`)},n.send()}function IW(e,t){for(var n=[],r=12,i=0;i<t;i+=1){var a=Z.getTag(e,r),o=Z.getULong(e,r+4),s=Z.getULong(e,r+8),c=Z.getULong(e,r+12);n.push({tag:a,checksum:o,offset:s,length:c,compression:!1}),r+=16}return n}function LW(e,t){for(var n=[],r=44,i=0;i<t;i+=1){var a=Z.getTag(e,r),o=Z.getULong(e,r+4),s=Z.getULong(e,r+8),c=Z.getULong(e,r+12),l=void 0;l=s<c?`WOFF`:!1,n.push({tag:a,offset:o,compression:l,compressedLength:s,length:c}),r+=20}return n}function RW(e,t){if(t.compression===`WOFF`){var n=new Uint8Array(e.buffer,t.offset+2,t.compressedLength-2),r=new Uint8Array(t.length);if(ML(n,r),r.byteLength!==t.length)throw Error(`Decompression error: `+t.tag+` decompressed length doesn't match recorded length`);return{data:new DataView(r.buffer,0),offset:0}}else return{data:e,offset:t.offset}}function zW(e,t){t??={};var n,r,i=new sW({empty:!0}),a=new DataView(e,0),o,s=[],c=Z.getTag(a,0);if(c===`\0\0\0`||c===`true`||c===`typ1`)i.outlinesFormat=`truetype`,o=Z.getUShort(a,4),s=IW(a,o);else if(c===`OTTO`)i.outlinesFormat=`cff`,o=Z.getUShort(a,4),s=IW(a,o);else if(c===`wOFF`){var l=Z.getTag(a,4);if(l===`\0\0\0`)i.outlinesFormat=`truetype`;else if(l===`OTTO`)i.outlinesFormat=`cff`;else throw Error(`Unsupported OpenType flavor `+c);o=Z.getUShort(a,12),s=LW(a,o)}else throw Error(`Unsupported OpenType signature `+c);for(var u,d,f,p,m,h,g,_,v,y,b,x,S=0;S<o;S+=1){var C=s[S],w=void 0;switch(C.tag){case`cmap`:w=RW(a,C),i.tables.cmap=SR.parse(w.data,w.offset),i.encoding=new OR(i.tables.cmap);break;case`cvt `:w=RW(a,C),x=new Z.Parser(w.data,w.offset),i.tables.cvt=x.parseShortList(C.length/2);break;case`fvar`:d=C;break;case`fpgm`:w=RW(a,C),x=new Z.Parser(w.data,w.offset),i.tables.fpgm=x.parseByteList(C.length);break;case`head`:w=RW(a,C),i.tables.head=Oz.parse(w.data,w.offset),i.unitsPerEm=i.tables.head.unitsPerEm,n=i.tables.head.indexToLocFormat;break;case`hhea`:w=RW(a,C),i.tables.hhea=jz.parse(w.data,w.offset),i.ascender=i.tables.hhea.ascender,i.descender=i.tables.hhea.descender,i.numberOfHMetrics=i.tables.hhea.numberOfHMetrics;break;case`hmtx`:g=C;break;case`ltag`:w=RW(a,C),r=zz.parse(w.data,w.offset);break;case`maxp`:w=RW(a,C),i.tables.maxp=Hz.parse(w.data,w.offset),i.numGlyphs=i.tables.maxp.numGlyphs;break;case`name`:y=C;break;case`OS/2`:w=RW(a,C),i.tables.os2=lB.parse(w.data,w.offset);break;case`post`:w=RW(a,C),i.tables.post=fB.parse(w.data,w.offset),i.glyphNames=new AR(i.tables.post);break;case`prep`:w=RW(a,C),x=new Z.Parser(w.data,w.offset),i.tables.prep=x.parseByteList(C.length);break;case`glyf`:f=C;break;case`loca`:v=C;break;case`CFF `:u=C;break;case`kern`:_=C;break;case`GDEF`:p=C;break;case`GPOS`:m=C;break;case`GSUB`:h=C;break;case`meta`:b=C;break}}var ee=RW(a,y);if(i.tables.name=iB.parse(ee.data,ee.offset,r),i.names=i.tables.name,f&&v){var te=n===0,ne=RW(a,v),re=NW.parse(ne.data,ne.offset,i.numGlyphs,te),ie=RW(a,f);i.glyphs=ZB.parse(ie.data,ie.offset,re,i,t)}else if(u){var ae=RW(a,u);Tz.parse(ae.data,ae.offset,i,t)}else throw Error(`Font doesn't contain TrueType or CFF outlines.`);var oe=RW(a,g);if(Iz.parse(i,oe.data,oe.offset,i.numberOfHMetrics,i.numGlyphs,i.glyphs,t),NR(i,t),_){var se=RW(a,_);i.kerningPairs=jW.parse(se.data,se.offset)}else i.kerningPairs={};if(p){var ce=RW(a,p);i.tables.gdef=SW.parse(ce.data,ce.offset)}if(m){var le=RW(a,m);i.tables.gpos=DW.parse(le.data,le.offset),i.position.init()}if(h){var ue=RW(a,h);i.tables.gsub=vB.parse(ue.data,ue.offset)}if(d){var de=RW(a,d);i.tables.fvar=hW.parse(de.data,de.offset,i.names)}if(b){var fe=RW(a,b);i.tables.meta=xB.parse(fe.data,fe.offset),i.metas=i.tables.meta}return i}function BW(e,t,n){n??={};var r=typeof window>`u`&&!n.isUrl?PW:FW;return new Promise(function(i,a){r(e,function(e,r){if(e){if(t)return t(e);a(e)}var o;try{o=zW(r,n)}catch(e){if(t)return t(e,null);a(e)}if(t)return t(null,o);i(o)})})}function VW(e,t){return zW(zB(sL().readFileSync(e)),t)}var HW=Object.freeze({__proto__:null,Font:sW,Glyph:LR,Path:FL,BoundingBox:PL,_parse:Z,parse:zW,load:BW,loadSync:VW}),UW=class{sketches;constructor(e){e.length===0&&M(`CompoundSketch`,`Cannot create CompoundSketch with an empty array of sketches`),this.sketches=e}delete(){this.sketches.forEach(e=>{e.delete()})}get outerSketch(){return kk(this.sketches)}get innerSketches(){return this.sketches.slice(1)}get wires(){return eG(this)}face(){return $W(this)}extrude(e,t={}){return tG(this,e,t)}revolve(e,t={}){return nG(this,e,t)}loftWith(e,t){return rG(this,e,t)}};function WW(e){let t={};e.defaultOrigin&&(t.defaultOrigin=e.defaultOrigin),e.defaultDirection&&(t.defaultDirection=e.defaultDirection);let n=new iG(e.wire,t);return e.baseFace&&(n.baseFace=e.baseFace),n}function GW(e){return new UW(e.map(WW))}function KW(e){let t;return t=e.baseFace?Kk(e.baseFace,e.wire):j(Wk(e.wire)),t}function qW(e){return aE(j(PD(e.wire.wrapped)))}function JW(e,t,{origin:n}={}){let r=j(Wk(e.wire)),i=j(qj(r,n?eD(n):e.defaultOrigin,t?eD(t):[0,0,1]));return r.delete(),e.delete(),i}function YW(e,t,{extrusionDirection:n,extrusionProfile:r,twistAngle:i,origin:a}={}){let o=oD(pD(n?eD(n):e.defaultDirection),t),s=a?eD(a):e.defaultOrigin;if(r&&!i){let t=j(Bj(e.wire,[...s],[...o],r));return e.delete(),t}if(i){let t=j(Vj(e.wire,i,[...s],[...o],r));return e.delete(),t}let c=j(Kj(j(Wk(e.wire)),[...o]));return e.delete(),c}function XW(e,t,n={}){let r=YO(e.wire),i=pD(oD(QO(e.wire,1e-9),-1)),a=e.defaultDirection,o=oD(lD(i,a),-1),s=t(xD([...r],[...o],[...i]),[...r]),c;if(`sketches`in s&&Array.isArray(s.sketches)){let e=s.sketches;c=e[0];for(let t=1;t<e.length;t++)e[t]?.delete()}else c=s;let l={forceProfileSpineOthogonality:!0,...n};e.baseFace&&(l.support=e.baseFace.wrapped);let u=j(Rj(c.wire,e.wire,l));return e.delete(),u}function ZW(e,t,n={},r=!1){let i=Array.isArray(t)?[e,...t]:[e,t],a=j(Yj(i.map(e=>e.wire),n,r));return i.forEach(e=>{e.delete()}),a}var QW=(e,t)=>{let n=j(t(kk(e))),r=e.slice(1).map(e=>j(t(e)));if(r.length===0)return n;try{return j(rA(n,r,{unsafe:!0}))}finally{n.delete();for(let e of r)e.delete()}};function $W(e){return Jk(e.outerSketch.face(),e.innerSketches.map(e=>e.wire))}function eG(e){return TA(e.sketches.map(e=>e.wire))}function tG(e,t,{extrusionDirection:n,extrusionProfile:r,twistAngle:i,origin:a}={}){let o=oD(pD(n?eD(n):e.outerSketch.defaultDirection),t);return r&&!i?QW(e.sketches,t=>Bj(t.wire,a?eD(a):e.outerSketch.defaultOrigin,o,r)):i?QW(e.sketches,t=>Vj(t.wire,i,a?eD(a):e.outerSketch.defaultOrigin,o,r)):j(Kj($W(e),o))}function nG(e,t,{origin:n}={}){let r=n?eD(n):e.outerSketch.defaultOrigin,i=t?eD(t):[0,0,1];return j(qj($W(e),r,i))}function rG(e,t,n){e.sketches.length!==t.sketches.length&&M(`CompoundSketch.loftWith`,`You need to loft with another compound with the same number of sketches`);let r=e.sketches.map((e,r)=>{let i=Ok(t.sketches,r),a={};return n.ruled!==void 0&&(a.ruled=n.ruled),e.clone().loftWith(i.clone(),a,!0)}),i=oE(j(PD($W(e).wrapped)));return r.push(i,$W(t)),j(EA(r))}var iG=class e{wire;_defaultOrigin;_defaultDirection;_baseFace;constructor(e,{defaultOrigin:t=[0,0,0],defaultDirection:n=[0,0,1]}={}){this.wire=e,this._defaultOrigin=eD(t),this._defaultDirection=eD(n),this.baseFace=null}get baseFace(){return this._baseFace}set baseFace(e){this._baseFace&&this._baseFace.delete(),this._baseFace=e&&oE(j(PD(e.wrapped)))}delete(){this.wire.delete(),this.baseFace&&this.baseFace.delete()}clone(){let t=new e(aE(j(PD(this.wire.wrapped))),{defaultOrigin:this.defaultOrigin,defaultDirection:this.defaultDirection});return this.baseFace&&(t.baseFace=oE(j(PD(this.baseFace.wrapped)))),t}get defaultOrigin(){return this._defaultOrigin}set defaultOrigin(e){this._defaultOrigin=eD(e)}get defaultDirection(){return this._defaultDirection}set defaultDirection(e){this._defaultDirection=eD(e)}face(){return KW(this)}wires(){return qW(this)}faces(){return this.face()}revolve(e,t={}){return JW(this,e,t)}extrude(e,t={}){return YW(this,e,t)}sweepSketch(e,t={}){return XW(this,e,t)}loftWith(e,t={},n=!1){return ZW(this,e,t,n)}},aG=class{sketches;constructor(e){this.sketches=e}wires(){return TA(this.sketches.map(e=>e instanceof iG?e.wire:e.wires))}faces(){return TA(this.sketches.map(e=>e.face()))}extrude(e,t={}){return TA(this.sketches.map(n=>n.extrude(e,t)))}revolve(e,t){return TA(this.sketches.map(n=>n.revolve(e,t)))}},oG={};async function sG(e,t=`default`,n=!1){if(!n&&oG[t])return O(oG[t]);let r;if(typeof e==`string`){let t;try{t=await fetch(e)}catch(t){return k(oo(N.FONT_FETCH_FAILED,`Failed to fetch font from ${e}: ${t instanceof Error?t.message:String(t)}`,t))}if(!t.ok)return k(oo(N.FONT_FETCH_FAILED,`Failed to fetch font from ${e}: HTTP ${t.status} ${t.statusText}`));r=await t.arrayBuffer()}else r=e;let i;try{i=HW.parse(r)}catch(e){return k(oo(N.FONT_PARSE_FAILED,`Failed to parse font data: ${e instanceof Error?e.message:String(e)}`,e))}let a=i;return oG[t]=a,oG.default||=a,O(a)}var cG=(e=`default`)=>oG[e],lG=function*(e){let t=null,n=null;for(let r of e){if(r.type===`Z`){t&&(yield t.close()),t=null;continue}let e=[-r.x,r.y];if(r.type===`M`){t&&(yield t.done()),t=new mI,t.movePointerTo(e),n=e;continue}n&&Math.abs(e[0]-n[0])<1e-9&&Math.abs(e[1]-n[1])<1e-9||(r.type===`L`&&t?.lineTo(e),r.type===`C`&&t?.cubicBezierCurveTo(e,[-r.x1,r.y1],[-r.x2,r.y2]),r.type===`Q`&&t?.quadraticBezierCurveTo(e,[-r.x1,r.y1]),n=e)}};function uG(e,{startX:t=0,startY:n=0,fontSize:r=16,fontFamily:i=`default`}={}){let a=cG(i);a||=cG(),a||M(`text`,`No fonts loaded. Call loadFont() before using text functions.`);let o=a.getPath(e,-t,-n,r);return rI(Array.from(lG(o.commands))).mirror([0,0])}var dG={XY:{dir:[0,0,1],xAxis:[1,0,0]},XZ:{dir:[0,-1,0],xAxis:[1,0,0]},YZ:{dir:[1,0,0],xAxis:[0,1,0]},YX:{dir:[0,0,-1],xAxis:[0,1,0]},ZX:{dir:[0,1,0],xAxis:[0,0,1]},ZY:{dir:[-1,0,0],xAxis:[0,0,1]},front:{dir:[0,-1,0],xAxis:[1,0,0]},back:{dir:[0,1,0],xAxis:[-1,0,0]},right:{dir:[-1,0,0],xAxis:[0,-1,0]},left:{dir:[1,0,0],xAxis:[0,1,0]},bottom:{dir:[0,0,1],xAxis:[1,0,0]},top:{dir:[0,0,-1],xAxis:[1,0,0]}};function fG(e){return typeof e==`string`&&e in dG}var pG=e=>e.IsNull()?[]:ME(W(e));function mG(e,t,n=!0){let r=U().projectEdges(e.wrapped,[...t.position],[...t.direction],[...t.xAxis]);return{visible:[...pG(r.visible.sharp),...pG(r.visible.smooth),...pG(r.visible.outline)],hidden:n?[...pG(r.hidden.sharp),...pG(r.hidden.smooth),...pG(r.hidden.outline)]:[]}}function hG(e=[0,0,0],t=[0,0,1],n){if(uD(t)<1e-12)return k(F(`CAMERA_ZERO_DIRECTION`,`Camera direction cannot be a zero-length vector`));let r;if(n)r=pD(n);else{let e=lD([0,0,1],t);uD(e)<1e-12&&(e=lD([0,1,0],t)),uD(e)<1e-12&&(e=lD([1,0,0],t)),r=pD(e)}let i=pD(lD(t,r));return O({position:e,direction:pD(t),xAxis:r,yAxis:i})}function gG(e,t){let n=pD(aD(e.position,t));return hG(e.position,n)}function _G(e){let t=dG[e];return hG([0,0,0],t.dir,t.xAxis)}function vG(e,t,n=!0){return mG(e,t,n)}var yG=(e,n=1e-7)=>{let r=new LF(e.length);e.forEach(e=>{let[t,i]=e.firstPoint;r.add(t-n,i-n,t+n,i+n)}),r.finish();let i=[],a=new Set;return e.forEach((o,s)=>{if(a.has(s))return;let c=[o],l=s;a.add(s);let u=e.length;for(;;){u--<0&&M(`stitchCurves`,`Infinite loop detected`);let[o,s]=t(c,c.length-1).lastPoint,d=r.search(o-n,s-n,o+n,s+n),f=t=>Math.abs((l-t)%e.length),p=d.filter(e=>!a.has(e)).map(n=>[t(e,n),n,f(n)]).sort(([,,e],[,,t])=>e-t);if(p.length===0){i.push(c);break}let[m,h]=t(p,0);c.push(m),a.add(h),l=h}}),i},bG=class extends pI{plane;constructor(e,t){super(),this.plane=e&&typeof e!=`string`?{...e}:j(wD(e??`XY`,t))}delete(){this.pendingCurves=[]}sagittaArcTo(e,t){return super.sagittaArcTo(e,-t)}buildWire(){try{var e=_T();this.pendingCurves.length||M(`Sketcher.buildWire`,`No lines to convert into a wire`);let t=e.u(new kT);return j(Uk(bF(this.pendingCurves,this.plane).map(e=>t.register(e))))}catch(t){e.e=t}finally{e.d()}}done(){return new iG(this.buildWire(),{defaultOrigin:this.plane.origin,defaultDirection:this.plane.zDir})}close(){return this._closeSketch(),this.done()}closeWithMirror(){SP(this.pointer,this.firstPoint)&&M(`Sketcher.closeWithMirror`,`Cannot close with a mirror when the sketch is already closed`);let e=this.buildWire(),t=ED(this.plane,this.pointer),n=lD(pD(aD(t,ED(this.plane,this.firstPoint))),this.plane.zDir),r=j(PD(e.wrapped));return new iG(j(Uk([e,aE(j(PD(U().mirror(r,eD(t),eD(n)))))])),{defaultOrigin:this.plane.origin,defaultDirection:this.plane.zDir})}closeWithCustomCorner(e,t=`fillet`){return this._closeSketch(),this._customCornerLastWithFirst(e,t),this.done()}},xG=class extends pI{face;_bounds;constructor(e,t=[0,0]){super(t),this.face=oE(j(PD(e.wrapped))),this._bounds=UD(e)}_convertToUV([e,t]){let{uMin:n,uMax:r,vMin:i,vMax:a}=this._bounds;return[n+e*(r-n),i+t*(a-i)]}_convertFromUV([e,t]){let{uMin:n,uMax:r,vMin:i,vMax:a}=this._bounds;return[(e-n)/(r-n),(t-i)/(a-i)]}_adaptSurface(){return U().extractSurfaceFromFace(this.face.wrapped)}buildWire(){let e=U(),t=this._adaptSurface(),n=j(Uk(this.pendingCurves.map(n=>iE(e.buildEdgeOnSurface(n.wrapped,t)))));return e.buildCurves3d(n.wrapped),n}done(){try{var e=_T();let t=e.u(new kT),n=this.buildWire(),r=new iG(n);if(tk(n)){let e=t.register(r.clone().face()),n=WD(e,.5,.5),i=oD(qD(e),-1);r.defaultOrigin=[n[0],n[1],n[2]],r.defaultDirection=[i[0],i[1],i[2]]}else{let e=YO(n),t=qD(this.face,[e[0],e[1],e[2]]);r.defaultOrigin=[e[0],e[1],e[2]],r.defaultDirection=[t[0],t[1],t[2]]}return r.baseFace=this.face,r}catch(t){e.e=t}finally{e.d()}}close(){return this._closeSketch(),this.done()}closeWithMirror(){return this._closeWithMirror(),this.close()}closeWithCustomCorner(e,t=`fillet`){return this._closeSketch(),this._customCornerLastWithFirst(e,t),this.done()}},SG=(e,t={})=>{let n=t.plane&&typeof t.plane!=`string`?{...t.plane}:j(wD(t.plane??`XY`,t.origin));return new iG(j(Uk([Pk(e,n.origin,n.zDir)])),{defaultOrigin:[...n.origin],defaultDirection:[...n.zDir]})},CG=(e=1,t=2,n={})=>{let r=n.plane&&typeof n.plane!=`string`?{...n.plane}:j(wD(n.plane??`XY`,n.origin)),i=r.xDir,a=e,o=t;return t>e&&(i=vD(i,r.zDir,90*QE),a=t,o=e),new iG(j(Uk([j(Fk(a,o,r.origin,r.zDir,i))])),{defaultOrigin:[...r.origin],defaultDirection:[...r.zDir]})},wG=(e,t,n={})=>(n.plane&&typeof n.plane!=`string`?new bG(n.plane):new bG(n.plane,n.origin)).movePointerTo([-e/2,-t/2]).hLine(e).vLine(t).hLine(-e).vLine(-t).done(),TG=(e,t,n=0,r={})=>{let i=xI(e,t,n).sketchOnPlane(r.plane,r.origin),a={};return i.defaultOrigin&&(a.defaultOrigin=i.defaultOrigin),i.defaultDirection&&(a.defaultDirection=i.defaultDirection),new iG(i.wire,a)},EG=(e,t,n=0,r={})=>{let i=[...Array(t).keys()].map(n=>{let r=-(Math.PI*2/t)*n;return[e*Math.sin(r),e*Math.cos(r)]}),a=r.plane&&typeof r.plane!=`string`?new bG(r.plane):new bG(r.plane,r.origin),o=Ak(i),s=a.movePointerTo([Ok(o,0),Ok(o,1)]);return n?i.forEach(e=>s.sagittaArcTo([Ok(e,0),Ok(e,1)],n)):i.forEach(e=>s.lineTo([Ok(e,0),Ok(e,1)])),s.done()},DG=(e,t,n=0)=>{let r=Math.PI/t,i=Math.cos(r)*e;return n>=0?i:i+n},OG=(e,t)=>{let n=[...JD(e)],r=[...qD(e)];return new iG(j(ck(ZD(e),t)),{defaultOrigin:n,defaultDirection:r})},kG=(e,t={},{pointsCount:n=400,start:r=0,stop:i=1}={},a={})=>{try{var o=_T();let s=o.u(new kT),c=t.plane&&typeof t.plane!=`string`?{...t.plane}:j(wD(t.plane??`XY`,t.origin)),l=(i-r)/n,u=[...Array(n+1).keys()].map(t=>ED(c,e(r+t*l)));return new iG(j(Uk([s.register(j(zk(u,a)))])),{defaultOrigin:[...c.origin],defaultDirection:[...c.zDir]})}catch(e){o.e=e}finally{o.d()}},AG=(e,t,n,r=[0,0,0],i=[0,0,1],a=!1)=>new iG(j(Uk([Ik(e,t,n,eD(r),eD(i),a)]))),jG=(e,t,n)=>new bG().movePointerTo([-e/2,t/2]).hLine(e).vLine(-t).hLine(-e).close().extrude(n),MG=(e,t)=>SP(e,t,bP*100),NG=(e,t,n,r)=>{let i=e[0]-t[0],a=e[1]-t[1],o=n[0]-r[0],s=n[1]-r[1],c=i*s-a*o;if(Math.abs(c)<1e-12)return null;let l=e[0]*t[1]-e[1]*t[0],u=n[0]*r[1]-n[1]*r[0];return[(l*o-u*i)/c,(l*s-u*a)/c]};function PG(e,t,n,r,i){let a=_F(t,n,r.original.lastPoint);e(r),e(a)}function FG(e,t,n,r,i){let a=lF(t,n);e(r),e(a)}function IG(e,t,n,r,i){let a=NG(r.offset instanceof aF?wP(t,r.offset.tangentAt(1)):r.offset.firstPoint,t,n,i.offset instanceof aF?CP(n,i.offset.tangentAt(0)):i.offset.lastPoint);if(!a){let i=lF(t,n);e(r),e(i);return}let o=DP([(t[0]+n[0])/2,(t[1]+n[1])/2],a),s=DP(t,n);if(s<1e-18||o>16*s){let i=lF(t,n);e(r),e(i);return}let c=lF(t,a),l=lF(a,n);e(r),e(c),e(l)}var LG={round:PG,bevel:FG,miter:IG};function RG(e,t,n){let r=n.length===1?lo(n,0,`rawOffsets`):zG(n,e.original.lastPoint),i=lo(e.offset.splitAt([r],bP),0,`rawOffsets`),a=t.offset.splitAt([r],bP).at(-1);return a||M(`offset.rawOffsets`,`Split produced no trailing curve segment`),{splitPrevious:{offset:i,original:e.original},splitCurrent:{offset:a,original:t.original}}}function zG(e,t){let n=lo(e,0,`selectClosestIntersection`),r=DP(n,t);for(let i=1;i<e.length;i++){let a=lo(e,i,`selectClosestIntersection`),o=DP(a,t);o<r&&(r=o,n=a)}return n}function BG(e){let t=new Map,n=(e,n)=>{let r=t.get(e)||[];t.set(e,[...r,...n])},r=new LF(e.length);for(let t of e){let[[e,n],[i,a]]=t.boundingBox.bounds;r.add(e,n,i,a)}return r.finish(),e.forEach((t,i)=>{let[[a,o],[s,c]]=t.boundingBox.bounds,l=r.search(a,o,s,c);for(let r of l){if(r<=i)continue;let a=lo(e,r,`offsetBlueprint`),{intersections:o,commonSegmentsPoints:s}=j(HF(t,a,bP)),c=[...o,...s].filter(e=>{let n=MG(e,t.firstPoint)||MG(e,t.lastPoint),r=MG(e,a.firstPoint)||MG(e,a.lastPoint);return!(n&&r)});c.length&&(n(i,c),n(r,c))}}),t}function VG(e,t,n={}){let r=e.orientation===`clockwise`?-t:t,i=e.curves.map(e=>({offset:GF(e,r),original:e})),a=[],o=null,s=i.at(-1);if(!s)return[];function c(e){if(e instanceof aF){a.push(e);return}o?e.offset instanceof aF?a.push(e.offset):MG(e.offset.firstPoint,e.offset.lastPoint)||a.push(lF(e.offset.firstPoint,e.offset.lastPoint)):o=e}let l=function*(){for(let e of i.slice(0,-1))yield e;o||M(`offset.rawOffsets`,`No saved curve after iterating offset segments`),yield o};for(let e of l()){let t=s.offset.lastPoint,r=e.offset.firstPoint;if(MG(t,r)){c(s),s=e;continue}let i=[];if(s.offset instanceof aF&&e.offset instanceof aF){let{intersections:t,commonSegmentsPoints:n}=j(HF(s.offset,e.offset,bP/100));i=[...t,...n]}if(i.length>0){let{splitPrevious:t,splitCurrent:n}=RG(s,e,i);c(t),s=n;continue}let a=LG[n.lineJoinType??`round`];a(c,t,r,s,e),s=e}return c(s),a}function HG(e,n,r={}){let i=VG(e,n,r);if(i.length<2)return null;let a=BG(i);if(!a.size){let t=new NF(i);return e.intersects(t)?null:t}let o=i.flatMap((e,t)=>{if(!a.has(t))return e;let n=a.get(t)||[];return e.splitAt(n,bP*100)}),s=new LF(e.curves.length);for(let t of e.curves){let[[e,n],[r,i]]=t.boundingBox.bounds;s.add(e,n,r,i)}s.finish();let c=Math.abs(n),l=o.filter(n=>{let[[r,i],[a,o]]=n.boundingBox.bounds;return!s.search(r-c,i-c,a+c,o+c).some(r=>t(e.curves,r).distanceFrom(n)<c-bP)});if(!l.length)return null;let u=yG(l).filter(e=>e.length>1).map(e=>new NF(e)).filter(e=>e.isClosed());return u.length?u.length===1?lo(u,0,`offsetBlueprint`):new XF(u):null}var UG=e=>{let t=lo(e,0,`fuseAll`);for(let n=1;n<e.length;n++)t=rL(t,lo(e,n,`fuseAll`));return t};function WG(e,t,n={}){if(e instanceof NF)return HG(e,t,n);if(e instanceof XF)return UG(e.blueprints.map(e=>WG(e,t,n)));if(e instanceof ZF){let r=UG(e.blueprints.slice(1).map(e=>WG(e,-t,n)));return aL(WG(lo(e.blueprints,0,`offset`),t,n),r)}return null}function GG(e,t){return e instanceof NF?new NF(cF(e.curves,t)):e instanceof ZF?new ZF(e.blueprints.map(e=>GG(e,t))):e instanceof XF?new XF(e.blueprints.map(e=>GG(e,t))):e}function KG(e,t,n,r){let i=()=>!0;r&&(i=r.shouldKeep.bind(r));let a=[kk(t.curves)],o=(t,r)=>{i({firstCurve:t,secondCurve:r,point:t.lastPoint})?a.push(...e(t,r,n)):a.push(t,r)};t.curves.slice(1).forEach(e=>{let t=a.pop();t||M(`customCorners.modifyCorners`,`Unexpected empty curve stack during filleting`),o(t,e)});let s=a.at(-1);if(s||M(`customCorners.modifyCorners`,`Unexpected empty curve list during corner modification`),SP(kk(a).firstPoint,s.lastPoint)&&a.length>1){let e=a.pop(),t=a.shift();(!e||!t)&&M(`customCorners.modifyCorners`,`Unexpected empty curve stack during close-and-fillet`),o(e,t)}return new NF(a)}function qG(e,t,n,r){return t instanceof NF?KG(e,t,n,r):t instanceof ZF?new ZF(t.blueprints.map(t=>KG(e,t,n,r))):t instanceof XF?new XF(t.blueprints.map(t=>qG(e,t,n,r)).filter(e=>e!==null)):null}function JG(e,t,n){return qG(qF,e,t,n)}function YG(e,t,n){return qG(JF,e,t,n)}function XG(e,t){return e instanceof NF?WW(t):e instanceof ZF?GW(t):new aG(t.map(e=>Array.isArray(e)?GW(e):WW(e)))}var ZG=class e{innerShape;constructor(e=null){this.innerShape=e}clone(){return new e(this.innerShape?.clone()||null)}serialize(){if(!this.innerShape)return JSON.stringify({type:`Empty`});function e(t){if(t instanceof ZF)return{type:`CompoundBlueprint`,blueprints:t.blueprints.map(e)};if(t instanceof XF)return{type:`Blueprints`,blueprints:t.blueprints.map(e)};if(t instanceof NF)return{type:`Blueprint`,curves:t.curves.map(e=>e.serialize())};M(`Drawing.serialize`,`Unknown shape type for serialization`)}return JSON.stringify(e(this.innerShape))}get boundingBox(){return this.innerShape?this.innerShape.boundingBox:new rF}stretch(t,n,r){return this.innerShape?new e(this.innerShape.stretch(t,n,r)):new e}get repr(){return this.innerShape===null?`=== empty shape`:this.innerShape.repr}rotate(t,n){return this.innerShape?new e(this.innerShape.rotate(t,n)):new e}translate(t,n=0){return this.innerShape?new e(typeof t==`number`?this.innerShape.translate(t,n):this.innerShape.translate(t)):new e}scale(t,n){return this.innerShape?new e(this.innerShape.scale(t,n)):new e}mirror(t,n,r){return this.innerShape?new e(this.innerShape.mirror(t,n,r)):new e}cut(t){return new e(aL(this.innerShape,t.innerShape))}fuse(t){return new e(rL(this.innerShape,t.innerShape))}intersect(t){return new e(oL(this.innerShape,t.innerShape))}fillet(t,n){let r=n&&n(yI());return new e(JG(this.innerShape,t,r))}chamfer(t,n){let r=n&&n(yI());return new e(YG(this.innerShape,t,r))}sketchOnPlane(e,t){this.innerShape||M(`Drawing`,`Trying to sketch an empty drawing`);let n=this.innerShape.sketchOnPlane(e,t);return XG(this.innerShape,n)}sketchOnFace(e,t){this.innerShape||M(`Drawing`,`Trying to sketch an empty drawing`);let n=this.innerShape.sketchOnFace(e,t);return XG(this.innerShape,n)}punchHole(e,t,n={}){return this.innerShape?this.innerShape.punchHole(e,t,n):e}toSVG(e){return this.innerShape?.toSVG(e)||``}toSVGViewBox(e=1){return this.innerShape?.toSVGViewBox(e)||``}toSVGPaths(){return this.innerShape?.toSVGPaths()||[]}offset(t,n={}){return new e(WG(this.innerShape,t,n))}approximate(t,n={}){return t!==`svg`&&M(`Drawing.approximate`,`Only 'svg' is supported for now`),new e(GG(this.innerShape,n))}get blueprint(){if(!(this.innerShape instanceof NF)){if(this.innerShape instanceof XF&&this.innerShape.blueprints.length===1&&this.innerShape.blueprints[0]instanceof NF)return this.innerShape.blueprints[0];M(`Drawing.blueprint`,`This drawing is not a blueprint`)}return this.innerShape}};function QG(e){function t(e){if(e.type===`CompoundBlueprint`)return new ZF(e.blueprints.map(t));if(e.type===`Blueprints`)return new XF(e.blueprints.map(t));if(e.type===`Blueprint`)return new NF(e.curves.map(e=>iF(e)));M(`Drawing.deserialize`,`Unknown shape type for deserialization`)}return new ZG(t(JSON.parse(e)))}var $G=class extends pI{constructor(e=[0,0]){super(),this.pointer=e,this.firstPoint=e,this.pendingCurves=[]}done(){return new ZG(new NF(this.pendingCurves))}close(){return this._closeSketch(),this.done()}closeWithMirror(){return this._closeWithMirror(),this.close()}closeWithCustomCorner(e,t=`fillet`){return this._closeSketch(),this._customCornerLastWithFirst(e,t),this.done()}};function eK(e){let t=new $G;return e&&t.movePointerTo(e),t}function tK(e,t,n=0){return new ZG(xI(e,t,n))}var nK=tK;function rK(e){return new ZG(new NF([fF(e)]))}function iK(e,t){let[n,r]=[e,t].sort((e,t)=>e-t);return new ZG(new NF([pF(r,n,r===e?[1,0]:[0,1])]))}function aK(e){return eK().movePointerTo([-e,0]).sagittaArc(2*e,0,e).sagittaArc(-2*e,0,e).close()}function oK(e,t){return eK().movePointerTo([-e,0]).halfEllipse(2*e,0,t).halfEllipse(-2*e,0,t).close()}function sK(e,t,n=0){return new ZG(bI(e,t,n))}function cK(e,{startX:t=0,startY:n=0,fontSize:r=16,fontFamily:i=`default`}={}){return new ZG(uG(e,{startX:t,startY:n,fontSize:r,fontFamily:i}))}var lK=(e,t={},n={})=>{e.length<2&&M(`drawPointsInterpolation`,`Need at least 2 points for interpolation, got ${e.length}`);let r=[j(gF(e,t))],i=e[0],a=e[e.length-1];return n.closeShape&&i&&a&&!SP(i,a)&&r.push(lF(a,i)),new ZG(new NF(r))},uK=(e,{pointsCount:t=400,start:n=0,stop:r=1,closeShape:i=!1}={},a={})=>{let o=(r-n)/t;return lK([...Array(t+1).keys()].map(t=>e(n+t*o)),a,{closeShape:i})},dK=e=>{try{var t=_T();let n=t.u(new kT),r=nK(1e3,1e3).sketchOnPlane(),i=n.register(j(Wk(r.wire))),a=yG(e.map(e=>kF(e,i))).map(e=>new NF(e));return a.length===0?new ZG:a.length===1?new ZG(a[0]):new ZG(new XF(a))}catch(e){t.e=e}finally{t.d()}};function fK(e,t=`front`){let n;n=typeof t==`string`?j(_G(t)):t;let{visible:r,hidden:i}=vG(e,n);return{visible:dK(r),hidden:dK(i)}}function pK(e){try{var t=_T();let n=t.u(new kT),r=n.register(oE(j(PD(e.wrapped)))),i=yG(ME(n.register(ZD(r))).map(t=>kF(t,e))).map(e=>new NF(e));return i.length===0?new ZG:i.length===1?new ZG(i[0]):new ZG(new XF(i))}catch(e){t.e=e}finally{t.d()}}function mK(e,t,n){return n===void 0?e.sketchOnPlane(t):e.sketchOnPlane(t,n)}function hK(e,t){return e.fuse(t)}function gK(e,t){return e.cut(t)}function _K(e,t){return e.intersect(t)}function vK(e,t,n){return e.fillet(t,n)}function yK(e,t,n){return e.chamfer(t,n)}function bK(e,t,n=0){return typeof t==`number`?e.translate(t,n):e.translate(t)}function xK(e,t,n){return e.rotate(t,n)}function SK(e,t,n){return e.scale(t,n)}function CK(e,t,n,r){return e.mirror(t,n,r)}function wK(e){let t=e.clone();return t.reverse(),t}function TK(e){return e.boundingBox}function EK(e){return e.firstPoint}function DK(e){return e.lastPoint}function OK(e,t,n){return e.splitAt(t,n)}function kK(e,t,n){return e.parameter(t,n)}function AK(e,t){return e.tangentAt(t)}function jK(e,t){return e.isOnCurve(t)}function MK(e,t){return e.distanceFrom(t)}function NK(e){return e.length===0?k(F(N.BLUEPRINT_EMPTY_CURVES,`createBlueprint: at least one curve is required`)):O(new NF(e))}function PK(e){return e.length===0?k(F(N.COMPOUND_BLUEPRINT_EMPTY,`createCompoundBlueprint: at least one blueprint (outer boundary) is required`)):O(new ZF(e))}function FK(e){return e.boundingBox}function IK(e){return e.orientation}function LK(e,t){return e.isInside(t)}function RK(e){return e.toSVGPathD()}function zK(e,t,n){return e.translate(t,n)}function BK(e,t,n){return e.rotate(t,n)}function VK(e,t,n){return e.scale(t,n)}function HK(e,t,n,r){return e.mirror(t,n,r)}function UK(e,t,n,r){return e.stretch(t,n,r)}function WK(e,t,n){return e.sketchOnPlane(t,n)}function GK(e,t,n){return e.sketchOnFace(t,n)}function KK(e,t){return n(e,t*3)}function qK(e,t){return n(e,t)}function JK(e){let t=[`# brepjs OBJ export`],n=e.vertices.length/3;for(let r=0;r<n;r++){let[n,i,a]=KK(e.vertices,r);t.push(`v ${n} ${i} ${a}`)}let r=e.normals.length/3;for(let n=0;n<r;n++){let[r,i,a]=KK(e.normals,n);t.push(`vn ${r} ${i} ${a}`)}let i=n=>{let[r,i,a]=qK(e.triangles,n);t.push(`f ${r+1}//${r+1} ${i+1}//${i+1} ${a+1}//${a+1}`)};if(e.faceGroups.length>0)for(let n of e.faceGroups){t.push(`g face_${n.faceId}`);let e=n.count/3;for(let t=0;t<e;t++)i(n.start+t*3)}else{let t=e.triangles.length/3;for(let e=0;e<t;e++)i(e*3)}return t.join(`
24
+ String.prototype.codePointAt||(function(){var e=function(){try{var e={},t=Object.defineProperty,n=t(e,e,e)&&t}catch{}return n}(),t=function(e){if(this==null)throw TypeError();var t=String(this),n=t.length,r=e?Number(e):0;if(r!=r&&(r=0),!(r<0||r>=n)){var i=t.charCodeAt(r),a;return i>=55296&&i<=56319&&n>r+1&&(a=t.charCodeAt(r+1),a>=56320&&a<=57343)?(i-55296)*1024+a-56320+65536:i}};e?e(String.prototype,`codePointAt`,{value:t,configurable:!0,writable:!0}):String.prototype.codePointAt=t})();var cL=0,lL=-3;function uL(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function dL(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new uL,this.dtree=new uL}var fL=new uL,pL=new uL,mL=new Uint8Array(30),hL=new Uint16Array(30),gL=new Uint8Array(30),_L=new Uint16Array(30),vL=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),yL=new uL,bL=new Uint8Array(320);function xL(e,t,n,r){var i,a;for(i=0;i<n;++i)e[i]=0;for(i=0;i<30-n;++i)e[i+n]=i/n|0;for(a=r,i=0;i<30;++i)t[i]=a,a+=1<<e[i]}function SL(e,t){var n;for(n=0;n<7;++n)e.table[n]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,n=0;n<24;++n)e.trans[n]=256+n;for(n=0;n<144;++n)e.trans[24+n]=n;for(n=0;n<8;++n)e.trans[168+n]=280+n;for(n=0;n<112;++n)e.trans[176+n]=144+n;for(n=0;n<5;++n)t.table[n]=0;for(t.table[5]=32,n=0;n<32;++n)t.trans[n]=n}var CL=new Uint16Array(16);function wL(e,t,n,r){var i,a;for(i=0;i<16;++i)e.table[i]=0;for(i=0;i<r;++i)e.table[t[n+i]]++;for(e.table[0]=0,a=0,i=0;i<16;++i)CL[i]=a,a+=e.table[i];for(i=0;i<r;++i)t[n+i]&&(e.trans[CL[t[n+i]]++]=i)}function TL(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var t=e.tag&1;return e.tag>>>=1,t}function EL(e,t,n){if(!t)return n;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var r=e.tag&65535>>>16-t;return e.tag>>>=t,e.bitcount-=t,r+n}function DL(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var n=0,r=0,i=0,a=e.tag;do r=2*r+(a&1),a>>>=1,++i,n+=t.table[i],r-=t.table[i];while(r>=0);return e.tag=a,e.bitcount-=i,t.trans[n+r]}function OL(e,t,n){var r=EL(e,5,257),i=EL(e,5,1),a=EL(e,4,4),o,s,c;for(o=0;o<19;++o)bL[o]=0;for(o=0;o<a;++o){var l=EL(e,3,0);bL[vL[o]]=l}for(wL(yL,bL,0,19),s=0;s<r+i;){var u=DL(e,yL);switch(u){case 16:var d=bL[s-1];for(c=EL(e,2,3);c;--c)bL[s++]=d;break;case 17:for(c=EL(e,3,3);c;--c)bL[s++]=0;break;case 18:for(c=EL(e,7,11);c;--c)bL[s++]=0;break;default:bL[s++]=u;break}}wL(t,bL,0,r),wL(n,bL,r,i)}function kL(e,t,n){for(;;){var r=DL(e,t);if(r===256)return cL;if(r<256)e.dest[e.destLen++]=r;else{var i,a,o,s;for(r-=257,i=EL(e,mL[r],hL[r]),a=DL(e,n),o=e.destLen-EL(e,gL[a],_L[a]),s=o;s<o+i;++s)e.dest[e.destLen++]=e.dest[s]}}}function AL(e){for(var t,n,r;e.bitcount>8;)e.sourceIndex--,e.bitcount-=8;if(t=e.source[e.sourceIndex+1],t=256*t+e.source[e.sourceIndex],n=e.source[e.sourceIndex+3],n=256*n+e.source[e.sourceIndex+2],t!==(~n&65535))return lL;for(e.sourceIndex+=4,r=t;r;--r)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,cL}function jL(e,t){var n=new dL(e,t),r,i,a;do{switch(r=TL(n),i=EL(n,2,0),i){case 0:a=AL(n);break;case 1:a=kL(n,fL,pL);break;case 2:OL(n,n.ltree,n.dtree),a=kL(n,n.ltree,n.dtree);break;default:a=lL}if(a!==cL)throw Error(`Data error`)}while(!r);return n.destLen<n.dest.length?typeof n.dest.slice==`function`?n.dest.slice(0,n.destLen):n.dest.subarray(0,n.destLen):n.dest}SL(fL,pL),xL(mL,hL,4,3),xL(gL,_L,2,1),mL[28]=0,hL[28]=258;var ML=jL;function NL(e,t,n,r,i){return(1-i)**3*e+3*(1-i)**2*i*t+3*(1-i)*i**2*n+i**3*r}function PL(){this.x1=NaN,this.y1=NaN,this.x2=NaN,this.y2=NaN}PL.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},PL.prototype.addPoint=function(e,t){typeof e==`number`&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),typeof t==`number`&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))},PL.prototype.addX=function(e){this.addPoint(e,null)},PL.prototype.addY=function(e){this.addPoint(null,e)},PL.prototype.addBezier=function(e,t,n,r,i,a,o,s){var c=[e,t],l=[n,r],u=[i,a],d=[o,s];this.addPoint(e,t),this.addPoint(o,s);for(var f=0;f<=1;f++){var p=6*c[f]-12*l[f]+6*u[f],m=-3*c[f]+9*l[f]-9*u[f]+3*d[f],h=3*l[f]-3*c[f];if(m===0){if(p===0)continue;var g=-h/p;0<g&&g<1&&(f===0&&this.addX(NL(c[f],l[f],u[f],d[f],g)),f===1&&this.addY(NL(c[f],l[f],u[f],d[f],g)));continue}var _=p**2-4*h*m;if(!(_<0)){var v=(-p+Math.sqrt(_))/(2*m);0<v&&v<1&&(f===0&&this.addX(NL(c[f],l[f],u[f],d[f],v)),f===1&&this.addY(NL(c[f],l[f],u[f],d[f],v)));var y=(-p-Math.sqrt(_))/(2*m);0<y&&y<1&&(f===0&&this.addX(NL(c[f],l[f],u[f],d[f],y)),f===1&&this.addY(NL(c[f],l[f],u[f],d[f],y)))}}},PL.prototype.addQuad=function(e,t,n,r,i,a){var o=e+2/3*(n-e),s=t+2/3*(r-t),c=o+1/3*(i-e),l=s+1/3*(a-t);this.addBezier(e,t,o,s,c,l,i,a)};function FL(){this.commands=[],this.fill=`black`,this.stroke=null,this.strokeWidth=1}FL.prototype.moveTo=function(e,t){this.commands.push({type:`M`,x:e,y:t})},FL.prototype.lineTo=function(e,t){this.commands.push({type:`L`,x:e,y:t})},FL.prototype.curveTo=FL.prototype.bezierCurveTo=function(e,t,n,r,i,a){this.commands.push({type:`C`,x1:e,y1:t,x2:n,y2:r,x:i,y:a})},FL.prototype.quadTo=FL.prototype.quadraticCurveTo=function(e,t,n,r){this.commands.push({type:`Q`,x1:e,y1:t,x:n,y:r})},FL.prototype.close=FL.prototype.closePath=function(){this.commands.push({type:`Z`})},FL.prototype.extend=function(e){if(e.commands)e=e.commands;else if(e instanceof PL){var t=e;this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),this.close();return}Array.prototype.push.apply(this.commands,e)},FL.prototype.getBoundingBox=function(){for(var e=new PL,t=0,n=0,r=0,i=0,a=0;a<this.commands.length;a++){var o=this.commands[a];switch(o.type){case`M`:e.addPoint(o.x,o.y),t=r=o.x,n=i=o.y;break;case`L`:e.addPoint(o.x,o.y),r=o.x,i=o.y;break;case`Q`:e.addQuad(r,i,o.x1,o.y1,o.x,o.y),r=o.x,i=o.y;break;case`C`:e.addBezier(r,i,o.x1,o.y1,o.x2,o.y2,o.x,o.y),r=o.x,i=o.y;break;case`Z`:r=t,i=n;break;default:throw Error(`Unexpected path command `+o.type)}}return e.isEmpty()&&e.addPoint(0,0),e},FL.prototype.draw=function(e){e.beginPath();for(var t=0;t<this.commands.length;t+=1){var n=this.commands[t];n.type===`M`?e.moveTo(n.x,n.y):n.type===`L`?e.lineTo(n.x,n.y):n.type===`C`?e.bezierCurveTo(n.x1,n.y1,n.x2,n.y2,n.x,n.y):n.type===`Q`?e.quadraticCurveTo(n.x1,n.y1,n.x,n.y):n.type===`Z`&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())},FL.prototype.toPathData=function(e){e=e===void 0?2:e;function t(t){return Math.round(t)===t?``+Math.round(t):t.toFixed(e)}function n(){for(var e=arguments,n=``,r=0;r<arguments.length;r+=1){var i=e[r];i>=0&&r>0&&(n+=` `),n+=t(i)}return n}for(var r=``,i=0;i<this.commands.length;i+=1){var a=this.commands[i];a.type===`M`?r+=`M`+n(a.x,a.y):a.type===`L`?r+=`L`+n(a.x,a.y):a.type===`C`?r+=`C`+n(a.x1,a.y1,a.x2,a.y2,a.x,a.y):a.type===`Q`?r+=`Q`+n(a.x1,a.y1,a.x,a.y):a.type===`Z`&&(r+=`Z`)}return r},FL.prototype.toSVG=function(e){var t=`<path d="`;return t+=this.toPathData(e),t+=`"`,this.fill&&this.fill!==`black`&&(this.fill===null?t+=` fill="none"`:t+=` fill="`+this.fill+`"`),this.stroke&&(t+=` stroke="`+this.stroke+`" stroke-width="`+this.strokeWidth+`"`),t+=`/>`,t},FL.prototype.toDOMElement=function(e){var t=this.toPathData(e),n=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return n.setAttribute(`d`,t),n};function IL(e){throw Error(e)}function LL(e,t){e||IL(t)}var K={fail:IL,argument:LL,assert:LL},RL=32768,zL=2147483648,BL={},q={},J={};function VL(e){return function(){return e}}q.BYTE=function(e){return K.argument(e>=0&&e<=255,`Byte value should be between 0 and 255.`),[e]},J.BYTE=VL(1),q.CHAR=function(e){return[e.charCodeAt(0)]},J.CHAR=VL(1),q.CHARARRAY=function(e){e===void 0&&(e=``,console.warn(`Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name.`));for(var t=[],n=0;n<e.length;n+=1)t[n]=e.charCodeAt(n);return t},J.CHARARRAY=function(e){return e===void 0?0:e.length},q.USHORT=function(e){return[e>>8&255,e&255]},J.USHORT=VL(2),q.SHORT=function(e){return e>=RL&&(e=-(2*RL-e)),[e>>8&255,e&255]},J.SHORT=VL(2),q.UINT24=function(e){return[e>>16&255,e>>8&255,e&255]},J.UINT24=VL(3),q.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]},J.ULONG=VL(4),q.LONG=function(e){return e>=zL&&(e=-(2*zL-e)),[e>>24&255,e>>16&255,e>>8&255,e&255]},J.LONG=VL(4),q.FIXED=q.ULONG,J.FIXED=J.ULONG,q.FWORD=q.SHORT,J.FWORD=J.SHORT,q.UFWORD=q.USHORT,J.UFWORD=J.USHORT,q.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,e&255]},J.LONGDATETIME=VL(8),q.TAG=function(e){return K.argument(e.length===4,`Tag should be exactly 4 ASCII characters.`),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},J.TAG=VL(4),q.Card8=q.BYTE,J.Card8=J.BYTE,q.Card16=q.USHORT,J.Card16=J.USHORT,q.OffSize=q.BYTE,J.OffSize=J.BYTE,q.SID=q.USHORT,J.SID=J.USHORT,q.NUMBER=function(e){return e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?(e-=108,[(e>>8)+247,e&255]):e>=-1131&&e<=-108?(e=-e-108,[(e>>8)+251,e&255]):e>=-32768&&e<=32767?q.NUMBER16(e):q.NUMBER32(e)},J.NUMBER=function(e){return q.NUMBER(e).length},q.NUMBER16=function(e){return[28,e>>8&255,e&255]},J.NUMBER16=VL(3),q.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,e&255]},J.NUMBER32=VL(5),q.REAL=function(e){var t=e.toString(),n=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(n){var r=parseFloat(`1e`+((n[2]?+n[2]:0)+n[1].length));t=(Math.round(e*r)/r).toString()}for(var i=``,a=0,o=t.length;a<o;a+=1){var s=t[a];s===`e`?i+=t[++a]===`-`?`c`:`b`:s===`.`?i+=`a`:s===`-`?i+=`e`:i+=s}i+=i.length&1?`f`:`ff`;for(var c=[30],l=0,u=i.length;l<u;l+=2)c.push(parseInt(i.substr(l,2),16));return c},J.REAL=function(e){return q.REAL(e).length},q.NAME=q.CHARARRAY,J.NAME=J.CHARARRAY,q.STRING=q.CHARARRAY,J.STRING=J.CHARARRAY,BL.UTF8=function(e,t,n){for(var r=[],i=n,a=0;a<i;a++,t+=1)r[a]=e.getUint8(t);return String.fromCharCode.apply(null,r)},BL.UTF16=function(e,t,n){for(var r=[],i=n/2,a=0;a<i;a++,t+=2)r[a]=e.getUint16(t);return String.fromCharCode.apply(null,r)},q.UTF16=function(e){for(var t=[],n=0;n<e.length;n+=1){var r=e.charCodeAt(n);t[t.length]=r>>8&255,t[t.length]=r&255}return t},J.UTF16=function(e){return e.length*2};var HL={"x-mac-croatian":`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ\xA0ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ`,"x-mac-cyrillic":`АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»…\xA0ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю`,"x-mac-gaelic":`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»…\xA0ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ`,"x-mac-greek":`Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»…\xA0ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­`,"x-mac-icelandic":`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»…\xA0ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ`,"x-mac-inuit":`ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ…\xA0ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł`,"x-mac-ce":`ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»…\xA0ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ`,macintosh:`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»…\xA0ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ`,"x-mac-romanian":`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»…\xA0ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ`,"x-mac-turkish":`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»…\xA0ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ`};BL.MACSTRING=function(e,t,n,r){var i=HL[r];if(i!==void 0){for(var a=``,o=0;o<n;o++){var s=e.getUint8(t+o);s<=127?a+=String.fromCharCode(s):a+=i[s&127]}return a}};var UL=typeof WeakMap==`function`&&new WeakMap,WL,GL=function(e){if(!WL)for(var t in WL={},HL)WL[t]=new String(t);var n=WL[e];if(n!==void 0){if(UL){var r=UL.get(n);if(r!==void 0)return r}var i=HL[e];if(i!==void 0){for(var a={},o=0;o<i.length;o++)a[i.charCodeAt(o)]=o+128;return UL&&UL.set(n,a),a}}};q.MACSTRING=function(e,t){var n=GL(t);if(n!==void 0){for(var r=[],i=0;i<e.length;i++){var a=e.charCodeAt(i);if(a>=128&&(a=n[a],a===void 0))return;r[i]=a}return r}},J.MACSTRING=function(e,t){var n=q.MACSTRING(e,t);return n===void 0?0:n.length};function KL(e){return e>=-128&&e<=127}function qL(e,t,n){for(var r=0,i=e.length;t<i&&r<64&&e[t]===0;)++t,++r;return n.push(128|r-1),t}function JL(e,t,n){for(var r=0,i=e.length,a=t;a<i&&r<64;){var o=e[a];if(!KL(o)||o===0&&a+1<i&&e[a+1]===0)break;++a,++r}n.push(r-1);for(var s=t;s<a;++s)n.push(e[s]+256&255);return a}function YL(e,t,n){for(var r=0,i=e.length,a=t;a<i&&r<64;){var o=e[a];if(o===0||KL(o)&&a+1<i&&KL(e[a+1]))break;++a,++r}n.push(64|r-1);for(var s=t;s<a;++s){var c=e[s];n.push(c+65536>>8&255,c+256&255)}return a}q.VARDELTAS=function(e){for(var t=0,n=[];t<e.length;){var r=e[t];t=r===0?qL(e,t,n):r>=-128&&r<=127?JL(e,t,n):YL(e,t,n)}return n},q.INDEX=function(e){for(var t=1,n=[t],r=[],i=0;i<e.length;i+=1){var a=q.OBJECT(e[i]);Array.prototype.push.apply(r,a),t+=a.length,n.push(t)}if(r.length===0)return[0,0];for(var o=[],s=1+Math.floor(Math.log(t)/Math.log(2))/8|0,c=[void 0,q.BYTE,q.USHORT,q.UINT24,q.ULONG][s],l=0;l<n.length;l+=1){var u=c(n[l]);Array.prototype.push.apply(o,u)}return Array.prototype.concat(q.Card16(e.length),q.OffSize(s),o,r)},J.INDEX=function(e){return q.INDEX(e).length},q.DICT=function(e){for(var t=[],n=Object.keys(e),r=n.length,i=0;i<r;i+=1){var a=parseInt(n[i],0),o=e[a];t=t.concat(q.OPERAND(o.value,o.type)),t=t.concat(q.OPERATOR(a))}return t},J.DICT=function(e){return q.DICT(e).length},q.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},q.OPERAND=function(e,t){var n=[];if(Array.isArray(t))for(var r=0;r<t.length;r+=1)K.argument(e.length===t.length,`Not enough arguments given for type`+t),n=n.concat(q.OPERAND(e[r],t[r]));else if(t===`SID`)n=n.concat(q.NUMBER(e));else if(t===`offset`)n=n.concat(q.NUMBER32(e));else if(t===`number`)n=n.concat(q.NUMBER(e));else if(t===`real`)n=n.concat(q.REAL(e));else throw Error(`Unknown operand type `+t);return n},q.OP=q.BYTE,J.OP=J.BYTE;var XL=typeof WeakMap==`function`&&new WeakMap;q.CHARSTRING=function(e){if(XL){var t=XL.get(e);if(t!==void 0)return t}for(var n=[],r=e.length,i=0;i<r;i+=1){var a=e[i];n=n.concat(q[a.type](a.value))}return XL&&XL.set(e,n),n},J.CHARSTRING=function(e){return q.CHARSTRING(e).length},q.OBJECT=function(e){var t=q[e.type];return K.argument(t!==void 0,`No encoding function for type `+e.type),t(e.value)},J.OBJECT=function(e){var t=J[e.type];return K.argument(t!==void 0,`No sizeOf function for type `+e.type),t(e.value)},q.TABLE=function(e){for(var t=[],n=e.fields.length,r=[],i=[],a=0;a<n;a+=1){var o=e.fields[a],s=q[o.type];K.argument(s!==void 0,`No encoding function for field type `+o.type+` (`+o.name+`)`);var c=e[o.name];c===void 0&&(c=o.value);var l=s(c);o.type===`TABLE`?(i.push(t.length),t=t.concat([0,0]),r.push(l)):t=t.concat(l)}for(var u=0;u<r.length;u+=1){var d=i[u],f=t.length;K.argument(f<65536,`Table `+e.tableName+` too big.`),t[d]=f>>8,t[d+1]=f&255,t=t.concat(r[u])}return t},J.TABLE=function(e){for(var t=0,n=e.fields.length,r=0;r<n;r+=1){var i=e.fields[r],a=J[i.type];K.argument(a!==void 0,`No sizeOf function for field type `+i.type+` (`+i.name+`)`);var o=e[i.name];o===void 0&&(o=i.value),t+=a(o),i.type===`TABLE`&&(t+=2)}return t},q.RECORD=q.TABLE,J.RECORD=J.TABLE,q.LITERAL=function(e){return e},J.LITERAL=function(e){return e.length};function ZL(e,t,n){if(t.length&&(t[0].name!==`coverageFormat`||t[0].value===1))for(var r=0;r<t.length;r+=1){var i=t[r];this[i.name]=i.value}if(this.tableName=e,this.fields=t,n)for(var a=Object.keys(n),o=0;o<a.length;o+=1){var s=a[o],c=n[s];this[s]!==void 0&&(this[s]=c)}}ZL.prototype.encode=function(){return q.TABLE(this)},ZL.prototype.sizeOf=function(){return J.TABLE(this)};function QL(e,t,n){n===void 0&&(n=t.length);var r=Array(t.length+1);r[0]={name:e+`Count`,type:`USHORT`,value:n};for(var i=0;i<t.length;i++)r[i+1]={name:e+i,type:`USHORT`,value:t[i]};return r}function $L(e,t,n){var r=t.length,i=Array(r+1);i[0]={name:e+`Count`,type:`USHORT`,value:r};for(var a=0;a<r;a++)i[a+1]={name:e+a,type:`TABLE`,value:n(t[a],a)};return i}function eR(e,t,n){var r=t.length,i=[];i[0]={name:e+`Count`,type:`USHORT`,value:r};for(var a=0;a<r;a++)i=i.concat(n(t[a],a));return i}function tR(e){e.format===1?ZL.call(this,`coverageTable`,[{name:`coverageFormat`,type:`USHORT`,value:1}].concat(QL(`glyph`,e.glyphs))):e.format===2?ZL.call(this,`coverageTable`,[{name:`coverageFormat`,type:`USHORT`,value:2}].concat(eR(`rangeRecord`,e.ranges,function(e){return[{name:`startGlyphID`,type:`USHORT`,value:e.start},{name:`endGlyphID`,type:`USHORT`,value:e.end},{name:`startCoverageIndex`,type:`USHORT`,value:e.index}]}))):K.assert(!1,`Coverage format must be 1 or 2.`)}tR.prototype=Object.create(ZL.prototype),tR.prototype.constructor=tR;function nR(e){ZL.call(this,`scriptListTable`,eR(`scriptRecord`,e,function(e,t){var n=e.script,r=n.defaultLangSys;return K.assert(!!r,`Unable to write GSUB: script `+e.tag+` has no default language system.`),[{name:`scriptTag`+t,type:`TAG`,value:e.tag},{name:`script`+t,type:`TABLE`,value:new ZL(`scriptTable`,[{name:`defaultLangSys`,type:`TABLE`,value:new ZL(`defaultLangSys`,[{name:`lookupOrder`,type:`USHORT`,value:0},{name:`reqFeatureIndex`,type:`USHORT`,value:r.reqFeatureIndex}].concat(QL(`featureIndex`,r.featureIndexes)))}].concat(eR(`langSys`,n.langSysRecords,function(e,t){var n=e.langSys;return[{name:`langSysTag`+t,type:`TAG`,value:e.tag},{name:`langSys`+t,type:`TABLE`,value:new ZL(`langSys`,[{name:`lookupOrder`,type:`USHORT`,value:0},{name:`reqFeatureIndex`,type:`USHORT`,value:n.reqFeatureIndex}].concat(QL(`featureIndex`,n.featureIndexes)))}]})))}]}))}nR.prototype=Object.create(ZL.prototype),nR.prototype.constructor=nR;function rR(e){ZL.call(this,`featureListTable`,eR(`featureRecord`,e,function(e,t){var n=e.feature;return[{name:`featureTag`+t,type:`TAG`,value:e.tag},{name:`feature`+t,type:`TABLE`,value:new ZL(`featureTable`,[{name:`featureParams`,type:`USHORT`,value:n.featureParams}].concat(QL(`lookupListIndex`,n.lookupListIndexes)))}]}))}rR.prototype=Object.create(ZL.prototype),rR.prototype.constructor=rR;function iR(e,t){ZL.call(this,`lookupListTable`,$L(`lookup`,e,function(e){var n=t[e.lookupType];return K.assert(!!n,`Unable to write GSUB lookup type `+e.lookupType+` tables.`),new ZL(`lookupTable`,[{name:`lookupType`,type:`USHORT`,value:e.lookupType},{name:`lookupFlag`,type:`USHORT`,value:e.lookupFlag}].concat($L(`subtable`,e.subtables,n)))}))}iR.prototype=Object.create(ZL.prototype),iR.prototype.constructor=iR;var Y={Table:ZL,Record:ZL,Coverage:tR,ScriptList:nR,FeatureList:rR,LookupList:iR,ushortList:QL,tableList:$L,recordList:eR};function aR(e,t){return e.getUint8(t)}function oR(e,t){return e.getUint16(t,!1)}function sR(e,t){return e.getInt16(t,!1)}function cR(e,t){return e.getUint32(t,!1)}function lR(e,t){return e.getInt16(t,!1)+e.getUint16(t+2,!1)/65535}function uR(e,t){for(var n=``,r=t;r<t+4;r+=1)n+=String.fromCharCode(e.getInt8(r));return n}function dR(e,t,n){for(var r=0,i=0;i<n;i+=1)r<<=8,r+=e.getUint8(t+i);return r}function fR(e,t,n){for(var r=[],i=t;i<n;i+=1)r.push(e.getUint8(i));return r}function pR(e){for(var t=``,n=0;n<e.length;n+=1)t+=String.fromCharCode(e[n]);return t}var mR={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function X(e,t){this.data=e,this.offset=t,this.relativeOffset=0}X.prototype.parseByte=function(){var e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},X.prototype.parseChar=function(){var e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},X.prototype.parseCard8=X.prototype.parseByte,X.prototype.parseUShort=function(){var e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},X.prototype.parseCard16=X.prototype.parseUShort,X.prototype.parseSID=X.prototype.parseUShort,X.prototype.parseOffset16=X.prototype.parseUShort,X.prototype.parseShort=function(){var e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},X.prototype.parseF2Dot14=function(){var e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e},X.prototype.parseULong=function(){var e=cR(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},X.prototype.parseOffset32=X.prototype.parseULong,X.prototype.parseFixed=function(){var e=lR(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},X.prototype.parseString=function(e){var t=this.data,n=this.offset+this.relativeOffset,r=``;this.relativeOffset+=e;for(var i=0;i<e;i++)r+=String.fromCharCode(t.getUint8(n+i));return r},X.prototype.parseTag=function(){return this.parseString(4)},X.prototype.parseLongDateTime=function(){var e=cR(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e},X.prototype.parseVersion=function(e){var t=oR(this.data,this.offset+this.relativeOffset),n=oR(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,e===void 0&&(e=4096),t+n/e/10},X.prototype.skip=function(e,t){t===void 0&&(t=1),this.relativeOffset+=mR[e]*t},X.prototype.parseULongList=function(e){e===void 0&&(e=this.parseULong());for(var t=Array(e),n=this.data,r=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=n.getUint32(r),r+=4;return this.relativeOffset+=e*4,t},X.prototype.parseOffset16List=X.prototype.parseUShortList=function(e){e===void 0&&(e=this.parseUShort());for(var t=Array(e),n=this.data,r=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=n.getUint16(r),r+=2;return this.relativeOffset+=e*2,t},X.prototype.parseShortList=function(e){for(var t=Array(e),n=this.data,r=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=n.getInt16(r),r+=2;return this.relativeOffset+=e*2,t},X.prototype.parseByteList=function(e){for(var t=Array(e),n=this.data,r=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=n.getUint8(r++);return this.relativeOffset+=e,t},X.prototype.parseList=function(e,t){t||(t=e,e=this.parseUShort());for(var n=Array(e),r=0;r<e;r++)n[r]=t.call(this);return n},X.prototype.parseList32=function(e,t){t||(t=e,e=this.parseULong());for(var n=Array(e),r=0;r<e;r++)n[r]=t.call(this);return n},X.prototype.parseRecordList=function(e,t){t||(t=e,e=this.parseUShort());for(var n=Array(e),r=Object.keys(t),i=0;i<e;i++){for(var a={},o=0;o<r.length;o++){var s=r[o];a[s]=t[s].call(this)}n[i]=a}return n},X.prototype.parseRecordList32=function(e,t){t||(t=e,e=this.parseULong());for(var n=Array(e),r=Object.keys(t),i=0;i<e;i++){for(var a={},o=0;o<r.length;o++){var s=r[o];a[s]=t[s].call(this)}n[i]=a}return n},X.prototype.parseStruct=function(e){if(typeof e==`function`)return e.call(this);for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var i=t[r];n[i]=e[i].call(this)}return n},X.prototype.parseValueRecord=function(e){if(e===void 0&&(e=this.parseUShort()),e!==0){var t={};return e&1&&(t.xPlacement=this.parseShort()),e&2&&(t.yPlacement=this.parseShort()),e&4&&(t.xAdvance=this.parseShort()),e&8&&(t.yAdvance=this.parseShort()),e&16&&(t.xPlaDevice=void 0,this.parseShort()),e&32&&(t.yPlaDevice=void 0,this.parseShort()),e&64&&(t.xAdvDevice=void 0,this.parseShort()),e&128&&(t.yAdvDevice=void 0,this.parseShort()),t}},X.prototype.parseValueRecordList=function(){for(var e=this.parseUShort(),t=this.parseUShort(),n=Array(t),r=0;r<t;r++)n[r]=this.parseValueRecord(e);return n},X.prototype.parsePointer=function(e){var t=this.parseOffset16();if(t>0)return new X(this.data,this.offset+t).parseStruct(e)},X.prototype.parsePointer32=function(e){var t=this.parseOffset32();if(t>0)return new X(this.data,this.offset+t).parseStruct(e)},X.prototype.parseListOfLists=function(e){for(var t=this.parseOffset16List(),n=t.length,r=this.relativeOffset,i=Array(n),a=0;a<n;a++){var o=t[a];if(o===0){i[a]=void 0;continue}if(this.relativeOffset=o,e){for(var s=this.parseOffset16List(),c=Array(s.length),l=0;l<s.length;l++)this.relativeOffset=o+s[l],c[l]=e.call(this);i[a]=c}else i[a]=this.parseUShortList()}return this.relativeOffset=r,i},X.prototype.parseCoverage=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort(),n=this.parseUShort();if(t===1)return{format:1,glyphs:this.parseUShortList(n)};if(t===2){for(var r=Array(n),i=0;i<n;i++)r[i]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:r}}throw Error(`0x`+e.toString(16)+`: Coverage format must be 1 or 2.`)},X.prototype.parseClassDef=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(t===2)return{format:2,ranges:this.parseRecordList({start:X.uShort,end:X.uShort,classId:X.uShort})};throw Error(`0x`+e.toString(16)+`: ClassDef format must be 1 or 2.`)},X.list=function(e,t){return function(){return this.parseList(e,t)}},X.list32=function(e,t){return function(){return this.parseList32(e,t)}},X.recordList=function(e,t){return function(){return this.parseRecordList(e,t)}},X.recordList32=function(e,t){return function(){return this.parseRecordList32(e,t)}},X.pointer=function(e){return function(){return this.parsePointer(e)}},X.pointer32=function(e){return function(){return this.parsePointer32(e)}},X.tag=X.prototype.parseTag,X.byte=X.prototype.parseByte,X.uShort=X.offset16=X.prototype.parseUShort,X.uShortList=X.prototype.parseUShortList,X.uLong=X.offset32=X.prototype.parseULong,X.uLongList=X.prototype.parseULongList,X.struct=X.prototype.parseStruct,X.coverage=X.prototype.parseCoverage,X.classDef=X.prototype.parseClassDef;var hR={reserved:X.uShort,reqFeatureIndex:X.uShort,featureIndexes:X.uShortList};X.prototype.parseScriptList=function(){return this.parsePointer(X.recordList({tag:X.tag,script:X.pointer({defaultLangSys:X.pointer(hR),langSysRecords:X.recordList({tag:X.tag,langSys:X.pointer(hR)})})}))||[]},X.prototype.parseFeatureList=function(){return this.parsePointer(X.recordList({tag:X.tag,feature:X.pointer({featureParams:X.offset16,lookupListIndexes:X.uShortList})}))||[]},X.prototype.parseLookupList=function(e){return this.parsePointer(X.list(X.pointer(function(){var t=this.parseUShort();K.argument(1<=t&&t<=9,`GPOS/GSUB lookup type `+t+` unknown.`);var n=this.parseUShort(),r=n&16;return{lookupType:t,lookupFlag:n,subtables:this.parseList(X.pointer(e[t])),markFilteringSet:r?this.parseUShort():void 0}})))||[]},X.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){var e=this.parseUShort(),t=this.parseUShort();return K.argument(e===1&&t<1,`GPOS/GSUB feature variations table unknown.`),this.parseRecordList32({conditionSetOffset:X.offset32,featureTableSubstitutionOffset:X.offset32})})||[]};var Z={getByte:aR,getCard8:aR,getUShort:oR,getCard16:oR,getShort:sR,getULong:cR,getFixed:lR,getTag:uR,getOffset:dR,getBytes:fR,bytesToString:pR,Parser:X};function gR(e,t){t.parseUShort(),e.length=t.parseULong(),e.language=t.parseULong();var n;e.groupCount=n=t.parseULong(),e.glyphIndexMap={};for(var r=0;r<n;r+=1)for(var i=t.parseULong(),a=t.parseULong(),o=t.parseULong(),s=i;s<=a;s+=1)e.glyphIndexMap[s]=o,o++}function _R(e,t,n,r,i){e.length=t.parseUShort(),e.language=t.parseUShort();var a;e.segCount=a=t.parseUShort()>>1,t.skip(`uShort`,3),e.glyphIndexMap={};for(var o=new Z.Parser(n,r+i+14),s=new Z.Parser(n,r+i+16+a*2),c=new Z.Parser(n,r+i+16+a*4),l=new Z.Parser(n,r+i+16+a*6),u=r+i+16+a*8,d=0;d<a-1;d+=1)for(var f=void 0,p=o.parseUShort(),m=s.parseUShort(),h=c.parseShort(),g=l.parseUShort(),_=m;_<=p;_+=1)g===0?f=_+h&65535:(u=l.offset+l.relativeOffset-2,u+=g,u+=(_-m)*2,f=Z.getUShort(n,u),f!==0&&(f=f+h&65535)),e.glyphIndexMap[_]=f}function vR(e,t){var n={};n.version=Z.getUShort(e,t),K.argument(n.version===0,`cmap table version should be 0.`),n.numTables=Z.getUShort(e,t+2);for(var r=-1,i=n.numTables-1;i>=0;--i){var a=Z.getUShort(e,t+4+i*8),o=Z.getUShort(e,t+4+i*8+2);if(a===3&&(o===0||o===1||o===10)||a===0&&(o===0||o===1||o===2||o===3||o===4)){r=Z.getULong(e,t+4+i*8+4);break}}if(r===-1)throw Error(`No valid cmap sub-tables found.`);var s=new Z.Parser(e,t+r);if(n.format=s.parseUShort(),n.format===12)gR(n,s);else if(n.format===4)_R(n,s,e,t,r);else throw Error(`Only format 4 and 12 cmap tables are supported (found format `+n.format+`).`);return n}function yR(e,t,n){e.segments.push({end:t,start:t,delta:-(t-n),offset:0,glyphIndex:n})}function bR(e){e.segments.push({end:65535,start:65535,delta:1,offset:0})}function xR(e){var t=!0,n;for(n=e.length-1;n>0;--n)if(e.get(n).unicode>65535){console.log(`Adding CMAP format 12 (needed!)`),t=!1;break}var r=[{name:`version`,type:`USHORT`,value:0},{name:`numTables`,type:`USHORT`,value:t?1:2},{name:`platformID`,type:`USHORT`,value:3},{name:`encodingID`,type:`USHORT`,value:1},{name:`offset`,type:`ULONG`,value:t?12:20}];t||(r=r.concat([{name:`cmap12PlatformID`,type:`USHORT`,value:3},{name:`cmap12EncodingID`,type:`USHORT`,value:10},{name:`cmap12Offset`,type:`ULONG`,value:0}])),r=r.concat([{name:`format`,type:`USHORT`,value:4},{name:`cmap4Length`,type:`USHORT`,value:0},{name:`language`,type:`USHORT`,value:0},{name:`segCountX2`,type:`USHORT`,value:0},{name:`searchRange`,type:`USHORT`,value:0},{name:`entrySelector`,type:`USHORT`,value:0},{name:`rangeShift`,type:`USHORT`,value:0}]);var i=new Y.Table(`cmap`,r);for(i.segments=[],n=0;n<e.length;n+=1){for(var a=e.get(n),o=0;o<a.unicodes.length;o+=1)yR(i,a.unicodes[o],n);i.segments=i.segments.sort(function(e,t){return e.start-t.start})}bR(i);var s=i.segments.length,c=0,l=[],u=[],d=[],f=[],p=[],m=[];for(n=0;n<s;n+=1){var h=i.segments[n];h.end<=65535&&h.start<=65535?(l=l.concat({name:`end_`+n,type:`USHORT`,value:h.end}),u=u.concat({name:`start_`+n,type:`USHORT`,value:h.start}),d=d.concat({name:`idDelta_`+n,type:`SHORT`,value:h.delta}),f=f.concat({name:`idRangeOffset_`+n,type:`USHORT`,value:h.offset}),h.glyphId!==void 0&&(p=p.concat({name:`glyph_`+n,type:`USHORT`,value:h.glyphId}))):c+=1,!t&&h.glyphIndex!==void 0&&(m=m.concat({name:`cmap12Start_`+n,type:`ULONG`,value:h.start}),m=m.concat({name:`cmap12End_`+n,type:`ULONG`,value:h.end}),m=m.concat({name:`cmap12Glyph_`+n,type:`ULONG`,value:h.glyphIndex}))}if(i.segCountX2=(s-c)*2,i.searchRange=2**Math.floor(Math.log(s-c)/Math.log(2))*2,i.entrySelector=Math.log(i.searchRange/2)/Math.log(2),i.rangeShift=i.segCountX2-i.searchRange,i.fields=i.fields.concat(l),i.fields.push({name:`reservedPad`,type:`USHORT`,value:0}),i.fields=i.fields.concat(u),i.fields=i.fields.concat(d),i.fields=i.fields.concat(f),i.fields=i.fields.concat(p),i.cmap4Length=14+l.length*2+2+u.length*2+d.length*2+f.length*2+p.length*2,!t){var g=16+m.length*4;i.cmap12Offset=20+i.cmap4Length,i.fields=i.fields.concat([{name:`cmap12Format`,type:`USHORT`,value:12},{name:`cmap12Reserved`,type:`USHORT`,value:0},{name:`cmap12Length`,type:`ULONG`,value:g},{name:`cmap12Language`,type:`ULONG`,value:0},{name:`cmap12nGroups`,type:`ULONG`,value:m.length/3}]),i.fields=i.fields.concat(m)}return i}var SR={parse:vR,make:xR},CR=`.notdef,space,exclam,quotedbl,numbersign,dollar,percent,ampersand,quoteright,parenleft,parenright,asterisk,plus,comma,hyphen,period,slash,zero,one,two,three,four,five,six,seven,eight,nine,colon,semicolon,less,equal,greater,question,at,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,bracketleft,backslash,bracketright,asciicircum,underscore,quoteleft,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,braceleft,bar,braceright,asciitilde,exclamdown,cent,sterling,fraction,yen,florin,section,currency,quotesingle,quotedblleft,guillemotleft,guilsinglleft,guilsinglright,fi,fl,endash,dagger,daggerdbl,periodcentered,paragraph,bullet,quotesinglbase,quotedblbase,quotedblright,guillemotright,ellipsis,perthousand,questiondown,grave,acute,circumflex,tilde,macron,breve,dotaccent,dieresis,ring,cedilla,hungarumlaut,ogonek,caron,emdash,AE,ordfeminine,Lslash,Oslash,OE,ordmasculine,ae,dotlessi,lslash,oslash,oe,germandbls,onesuperior,logicalnot,mu,trademark,Eth,onehalf,plusminus,Thorn,onequarter,divide,brokenbar,degree,thorn,threequarters,twosuperior,registered,minus,eth,multiply,threesuperior,copyright,Aacute,Acircumflex,Adieresis,Agrave,Aring,Atilde,Ccedilla,Eacute,Ecircumflex,Edieresis,Egrave,Iacute,Icircumflex,Idieresis,Igrave,Ntilde,Oacute,Ocircumflex,Odieresis,Ograve,Otilde,Scaron,Uacute,Ucircumflex,Udieresis,Ugrave,Yacute,Ydieresis,Zcaron,aacute,acircumflex,adieresis,agrave,aring,atilde,ccedilla,eacute,ecircumflex,edieresis,egrave,iacute,icircumflex,idieresis,igrave,ntilde,oacute,ocircumflex,odieresis,ograve,otilde,scaron,uacute,ucircumflex,udieresis,ugrave,yacute,ydieresis,zcaron,exclamsmall,Hungarumlautsmall,dollaroldstyle,dollarsuperior,ampersandsmall,Acutesmall,parenleftsuperior,parenrightsuperior,266 ff,onedotenleader,zerooldstyle,oneoldstyle,twooldstyle,threeoldstyle,fouroldstyle,fiveoldstyle,sixoldstyle,sevenoldstyle,eightoldstyle,nineoldstyle,commasuperior,threequartersemdash,periodsuperior,questionsmall,asuperior,bsuperior,centsuperior,dsuperior,esuperior,isuperior,lsuperior,msuperior,nsuperior,osuperior,rsuperior,ssuperior,tsuperior,ff,ffi,ffl,parenleftinferior,parenrightinferior,Circumflexsmall,hyphensuperior,Gravesmall,Asmall,Bsmall,Csmall,Dsmall,Esmall,Fsmall,Gsmall,Hsmall,Ismall,Jsmall,Ksmall,Lsmall,Msmall,Nsmall,Osmall,Psmall,Qsmall,Rsmall,Ssmall,Tsmall,Usmall,Vsmall,Wsmall,Xsmall,Ysmall,Zsmall,colonmonetary,onefitted,rupiah,Tildesmall,exclamdownsmall,centoldstyle,Lslashsmall,Scaronsmall,Zcaronsmall,Dieresissmall,Brevesmall,Caronsmall,Dotaccentsmall,Macronsmall,figuredash,hypheninferior,Ogoneksmall,Ringsmall,Cedillasmall,questiondownsmall,oneeighth,threeeighths,fiveeighths,seveneighths,onethird,twothirds,zerosuperior,foursuperior,fivesuperior,sixsuperior,sevensuperior,eightsuperior,ninesuperior,zeroinferior,oneinferior,twoinferior,threeinferior,fourinferior,fiveinferior,sixinferior,seveninferior,eightinferior,nineinferior,centinferior,dollarinferior,periodinferior,commainferior,Agravesmall,Aacutesmall,Acircumflexsmall,Atildesmall,Adieresissmall,Aringsmall,AEsmall,Ccedillasmall,Egravesmall,Eacutesmall,Ecircumflexsmall,Edieresissmall,Igravesmall,Iacutesmall,Icircumflexsmall,Idieresissmall,Ethsmall,Ntildesmall,Ogravesmall,Oacutesmall,Ocircumflexsmall,Otildesmall,Odieresissmall,OEsmall,Oslashsmall,Ugravesmall,Uacutesmall,Ucircumflexsmall,Udieresissmall,Yacutesmall,Thornsmall,Ydieresissmall,001.000,001.001,001.002,001.003,Black,Bold,Book,Light,Medium,Regular,Roman,Semibold`.split(`,`),wR=`................................space.exclam.quotedbl.numbersign.dollar.percent.ampersand.quoteright.parenleft.parenright.asterisk.plus.comma.hyphen.period.slash.zero.one.two.three.four.five.six.seven.eight.nine.colon.semicolon.less.equal.greater.question.at.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.bracketleft.backslash.bracketright.asciicircum.underscore.quoteleft.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.braceleft.bar.braceright.asciitilde...................................exclamdown.cent.sterling.fraction.yen.florin.section.currency.quotesingle.quotedblleft.guillemotleft.guilsinglleft.guilsinglright.fi.fl..endash.dagger.daggerdbl.periodcentered..paragraph.bullet.quotesinglbase.quotedblbase.quotedblright.guillemotright.ellipsis.perthousand..questiondown..grave.acute.circumflex.tilde.macron.breve.dotaccent.dieresis..ring.cedilla..hungarumlaut.ogonek.caron.emdash.................AE..ordfeminine.....Lslash.Oslash.OE.ordmasculine......ae....dotlessi...lslash.oslash.oe.germandbls`.split(`.`),TR=`................................space.exclamsmall.Hungarumlautsmall..dollaroldstyle.dollarsuperior.ampersandsmall.Acutesmall.parenleftsuperior.parenrightsuperior.twodotenleader.onedotenleader.comma.hyphen.period.fraction.zerooldstyle.oneoldstyle.twooldstyle.threeoldstyle.fouroldstyle.fiveoldstyle.sixoldstyle.sevenoldstyle.eightoldstyle.nineoldstyle.colon.semicolon.commasuperior.threequartersemdash.periodsuperior.questionsmall..asuperior.bsuperior.centsuperior.dsuperior.esuperior...isuperior...lsuperior.msuperior.nsuperior.osuperior...rsuperior.ssuperior.tsuperior..ff.fi.fl.ffi.ffl.parenleftinferior..parenrightinferior.Circumflexsmall.hyphensuperior.Gravesmall.Asmall.Bsmall.Csmall.Dsmall.Esmall.Fsmall.Gsmall.Hsmall.Ismall.Jsmall.Ksmall.Lsmall.Msmall.Nsmall.Osmall.Psmall.Qsmall.Rsmall.Ssmall.Tsmall.Usmall.Vsmall.Wsmall.Xsmall.Ysmall.Zsmall.colonmonetary.onefitted.rupiah.Tildesmall...................................exclamdownsmall.centoldstyle.Lslashsmall...Scaronsmall.Zcaronsmall.Dieresissmall.Brevesmall.Caronsmall..Dotaccentsmall...Macronsmall...figuredash.hypheninferior...Ogoneksmall.Ringsmall.Cedillasmall....onequarter.onehalf.threequarters.questiondownsmall.oneeighth.threeeighths.fiveeighths.seveneighths.onethird.twothirds...zerosuperior.onesuperior.twosuperior.threesuperior.foursuperior.fivesuperior.sixsuperior.sevensuperior.eightsuperior.ninesuperior.zeroinferior.oneinferior.twoinferior.threeinferior.fourinferior.fiveinferior.sixinferior.seveninferior.eightinferior.nineinferior.centinferior.dollarinferior.periodinferior.commainferior.Agravesmall.Aacutesmall.Acircumflexsmall.Atildesmall.Adieresissmall.Aringsmall.AEsmall.Ccedillasmall.Egravesmall.Eacutesmall.Ecircumflexsmall.Edieresissmall.Igravesmall.Iacutesmall.Icircumflexsmall.Idieresissmall.Ethsmall.Ntildesmall.Ogravesmall.Oacutesmall.Ocircumflexsmall.Otildesmall.Odieresissmall.OEsmall.Oslashsmall.Ugravesmall.Uacutesmall.Ucircumflexsmall.Udieresissmall.Yacutesmall.Thornsmall.Ydieresissmall`.split(`.`),ER=`.notdef,.null,nonmarkingreturn,space,exclam,quotedbl,numbersign,dollar,percent,ampersand,quotesingle,parenleft,parenright,asterisk,plus,comma,hyphen,period,slash,zero,one,two,three,four,five,six,seven,eight,nine,colon,semicolon,less,equal,greater,question,at,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,bracketleft,backslash,bracketright,asciicircum,underscore,grave,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,braceleft,bar,braceright,asciitilde,Adieresis,Aring,Ccedilla,Eacute,Ntilde,Odieresis,Udieresis,aacute,agrave,acircumflex,adieresis,atilde,aring,ccedilla,eacute,egrave,ecircumflex,edieresis,iacute,igrave,icircumflex,idieresis,ntilde,oacute,ograve,ocircumflex,odieresis,otilde,uacute,ugrave,ucircumflex,udieresis,dagger,degree,cent,sterling,section,bullet,paragraph,germandbls,registered,copyright,trademark,acute,dieresis,notequal,AE,Oslash,infinity,plusminus,lessequal,greaterequal,yen,mu,partialdiff,summation,product,pi,integral,ordfeminine,ordmasculine,Omega,ae,oslash,questiondown,exclamdown,logicalnot,radical,florin,approxequal,Delta,guillemotleft,guillemotright,ellipsis,nonbreakingspace,Agrave,Atilde,Otilde,OE,oe,endash,emdash,quotedblleft,quotedblright,quoteleft,quoteright,divide,lozenge,ydieresis,Ydieresis,fraction,currency,guilsinglleft,guilsinglright,fi,fl,daggerdbl,periodcentered,quotesinglbase,quotedblbase,perthousand,Acircumflex,Ecircumflex,Aacute,Edieresis,Egrave,Iacute,Icircumflex,Idieresis,Igrave,Oacute,Ocircumflex,apple,Ograve,Uacute,Ucircumflex,Ugrave,dotlessi,circumflex,tilde,macron,breve,dotaccent,ring,cedilla,hungarumlaut,ogonek,caron,Lslash,lslash,Scaron,scaron,Zcaron,zcaron,brokenbar,Eth,eth,Yacute,yacute,Thorn,thorn,minus,multiply,onesuperior,twosuperior,threesuperior,onehalf,onequarter,threequarters,franc,Gbreve,gbreve,Idotaccent,Scedilla,scedilla,Cacute,cacute,Ccaron,ccaron,dcroat`.split(`,`);function DR(e){this.font=e}DR.prototype.charToGlyphIndex=function(e){var t=e.codePointAt(0),n=this.font.glyphs;if(n){for(var r=0;r<n.length;r+=1)for(var i=n.get(r),a=0;a<i.unicodes.length;a+=1)if(i.unicodes[a]===t)return r}return null};function OR(e){this.cmap=e}OR.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.codePointAt(0)]||0};function kR(e,t){this.encoding=e,this.charset=t}kR.prototype.charToGlyphIndex=function(e){var t=e.codePointAt(0),n=this.encoding[t];return this.charset.indexOf(n)};function AR(e){switch(e.version){case 1:this.names=ER.slice();break;case 2:this.names=Array(e.numberOfGlyphs);for(var t=0;t<e.numberOfGlyphs;t++)e.glyphNameIndex[t]<ER.length?this.names[t]=ER[e.glyphNameIndex[t]]:this.names[t]=e.names[e.glyphNameIndex[t]-ER.length];break;case 2.5:this.names=Array(e.numberOfGlyphs);for(var n=0;n<e.numberOfGlyphs;n++)this.names[n]=ER[n+e.glyphNameIndex[n]];break;case 3:this.names=[];break;default:this.names=[];break}}AR.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)},AR.prototype.glyphIndexToName=function(e){return this.names[e]};function jR(e){for(var t,n=e.tables.cmap.glyphIndexMap,r=Object.keys(n),i=0;i<r.length;i+=1){var a=r[i],o=n[a];t=e.glyphs.get(o),t.addUnicode(parseInt(a))}for(var s=0;s<e.glyphs.length;s+=1)t=e.glyphs.get(s),e.cffEncoding?e.isCIDFont?t.name=`gid`+s:t.name=e.cffEncoding.charset[s]:e.glyphNames.names&&(t.name=e.glyphNames.glyphIndexToName(s))}function MR(e){e._IndexToUnicodeMap={};for(var t=e.tables.cmap.glyphIndexMap,n=Object.keys(t),r=0;r<n.length;r+=1){var i=n[r],a=t[i];e._IndexToUnicodeMap[a]===void 0?e._IndexToUnicodeMap[a]={unicodes:[parseInt(i)]}:e._IndexToUnicodeMap[a].unicodes.push(parseInt(i))}}function NR(e,t){t.lowMemory?MR(e):jR(e)}function PR(e,t,n,r,i){e.beginPath(),e.moveTo(t,n),e.lineTo(r,i),e.stroke()}var FR={line:PR};function IR(e,t){var n=t||new FL;return{configurable:!0,get:function(){return typeof n==`function`&&(n=n()),n},set:function(e){n=e}}}function LR(e){this.bindConstructorValues(e)}LR.prototype.bindConstructorValues=function(e){this.index=e.index||0,this.name=e.name||null,this.unicode=e.unicode||void 0,this.unicodes=e.unicodes||e.unicode!==void 0?[e.unicode]:[],`xMin`in e&&(this.xMin=e.xMin),`yMin`in e&&(this.yMin=e.yMin),`xMax`in e&&(this.xMax=e.xMax),`yMax`in e&&(this.yMax=e.yMax),`advanceWidth`in e&&(this.advanceWidth=e.advanceWidth),Object.defineProperty(this,"path",IR(this,e.path))},LR.prototype.addUnicode=function(e){this.unicodes.length===0&&(this.unicode=e),this.unicodes.push(e)},LR.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},LR.prototype.getPath=function(e,t,n,r,i){e=e===void 0?0:e,t=t===void 0?0:t,n=n===void 0?72:n;var a,o;r||={};var s=r.xScale,c=r.yScale;if(r.hinting&&i&&i.hinting&&(o=this.path&&i.hinting.exec(this,n)),o)a=i.hinting.getCommands(o),e=Math.round(e),t=Math.round(t),s=c=1;else{a=this.path.commands;var l=1/(this.path.unitsPerEm||1e3)*n;s===void 0&&(s=l),c===void 0&&(c=l)}for(var u=new FL,d=0;d<a.length;d+=1){var f=a[d];f.type===`M`?u.moveTo(e+f.x*s,t+-f.y*c):f.type===`L`?u.lineTo(e+f.x*s,t+-f.y*c):f.type===`Q`?u.quadraticCurveTo(e+f.x1*s,t+-f.y1*c,e+f.x*s,t+-f.y*c):f.type===`C`?u.curveTo(e+f.x1*s,t+-f.y1*c,e+f.x2*s,t+-f.y2*c,e+f.x*s,t+-f.y*c):f.type===`Z`&&u.closePath()}return u},LR.prototype.getContours=function(){if(this.points===void 0)return[];for(var e=[],t=[],n=0;n<this.points.length;n+=1){var r=this.points[n];t.push(r),r.lastPointOfContour&&(e.push(t),t=[])}return K.argument(t.length===0,`There are still points left in the current contour.`),e},LR.prototype.getMetrics=function(){for(var e=this.path.commands,t=[],n=[],r=0;r<e.length;r+=1){var i=e[r];i.type!==`Z`&&(t.push(i.x),n.push(i.y)),(i.type===`Q`||i.type===`C`)&&(t.push(i.x1),n.push(i.y1)),i.type===`C`&&(t.push(i.x2),n.push(i.y2))}var a={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,t),yMax:Math.max.apply(null,n),leftSideBearing:this.leftSideBearing};return isFinite(a.xMin)||(a.xMin=0),isFinite(a.xMax)||(a.xMax=this.advanceWidth),isFinite(a.yMin)||(a.yMin=0),isFinite(a.yMax)||(a.yMax=0),a.rightSideBearing=this.advanceWidth-a.leftSideBearing-(a.xMax-a.xMin),a},LR.prototype.draw=function(e,t,n,r,i){this.getPath(t,n,r,i).draw(e)},LR.prototype.drawPoints=function(e,t,n,r){function i(t,n,r,i){e.beginPath();for(var a=0;a<t.length;a+=1)e.moveTo(n+t[a].x*i,r+t[a].y*i),e.arc(n+t[a].x*i,r+t[a].y*i,2,0,Math.PI*2,!1);e.closePath(),e.fill()}t=t===void 0?0:t,n=n===void 0?0:n,r=r===void 0?24:r;for(var a=1/this.path.unitsPerEm*r,o=[],s=[],c=this.path,l=0;l<c.commands.length;l+=1){var u=c.commands[l];u.x!==void 0&&o.push({x:u.x,y:-u.y}),u.x1!==void 0&&s.push({x:u.x1,y:-u.y1}),u.x2!==void 0&&s.push({x:u.x2,y:-u.y2})}e.fillStyle=`blue`,i(o,t,n,a),e.fillStyle=`red`,i(s,t,n,a)},LR.prototype.drawMetrics=function(e,t,n,r){var i;t=t===void 0?0:t,n=n===void 0?0:n,r=r===void 0?24:r,i=1/this.path.unitsPerEm*r,e.lineWidth=1,e.strokeStyle=`black`,FR.line(e,t,-1e4,t,1e4),FR.line(e,-1e4,n,1e4,n);var a=this.xMin||0,o=this.yMin||0,s=this.xMax||0,c=this.yMax||0,l=this.advanceWidth||0;e.strokeStyle=`blue`,FR.line(e,t+a*i,-1e4,t+a*i,1e4),FR.line(e,t+s*i,-1e4,t+s*i,1e4),FR.line(e,-1e4,n+-o*i,1e4,n+-o*i),FR.line(e,-1e4,n+-c*i,1e4,n+-c*i),e.strokeStyle=`green`,FR.line(e,t+l*i,-1e4,t+l*i,1e4)};function RR(e,t,n){Object.defineProperty(e,t,{get:function(){return e.path,e[n]},set:function(t){e[n]=t},enumerable:!0,configurable:!0})}function zR(e,t){if(this.font=e,this.glyphs={},Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];r.path.unitsPerEm=e.unitsPerEm,this.glyphs[n]=r}this.length=t&&t.length||0}zR.prototype.get=function(e){if(this.glyphs[e]===void 0){this.font._push(e),typeof this.glyphs[e]==`function`&&(this.glyphs[e]=this.glyphs[e]());var t=this.glyphs[e],n=this.font._IndexToUnicodeMap[e];if(n)for(var r=0;r<n.unicodes.length;r++)t.addUnicode(n.unicodes[r]);this.font.cffEncoding?this.font.isCIDFont?t.name=`gid`+e:t.name=this.font.cffEncoding.charset[e]:this.font.glyphNames.names&&(t.name=this.font.glyphNames.glyphIndexToName(e)),this.glyphs[e].advanceWidth=this.font._hmtxTableData[e].advanceWidth,this.glyphs[e].leftSideBearing=this.font._hmtxTableData[e].leftSideBearing}else typeof this.glyphs[e]==`function`&&(this.glyphs[e]=this.glyphs[e]());return this.glyphs[e]},zR.prototype.push=function(e,t){this.glyphs[e]=t,this.length++};function BR(e,t){return new LR({index:t,font:e})}function VR(e,t,n,r,i,a){return function(){var o=new LR({index:t,font:e});return o.path=function(){n(o,r,i);var t=a(e.glyphs,o);return t.unitsPerEm=e.unitsPerEm,t},RR(o,`xMin`,`_xMin`),RR(o,`xMax`,`_xMax`),RR(o,`yMin`,`_yMin`),RR(o,`yMax`,`_yMax`),o}}function HR(e,t,n,r){return function(){var i=new LR({index:t,font:e});return i.path=function(){var t=n(e,i,r);return t.unitsPerEm=e.unitsPerEm,t},i}}var UR={GlyphSet:zR,glyphLoader:BR,ttfGlyphLoader:VR,cffGlyphLoader:HR};function WR(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n+=1)if(!WR(e[n],t[n]))return!1;return!0}else return!1}function GR(e){return e.length<1240?107:e.length<33900?1131:32768}function KR(e,t,n){var r=[],i=[],a=Z.getCard16(e,t),o,s;if(a!==0){var c=Z.getByte(e,t+2);o=t+(a+1)*c+2;for(var l=t+3,u=0;u<a+1;u+=1)r.push(Z.getOffset(e,l,c)),l+=c;s=o+r[a]}else s=t+2;for(var d=0;d<r.length-1;d+=1){var f=Z.getBytes(e,o+r[d],o+r[d+1]);n&&(f=n(f)),i.push(f)}return{objects:i,startOffset:t,endOffset:s}}function qR(e,t){var n=[],r=Z.getCard16(e,t),i,a;if(r!==0){var o=Z.getByte(e,t+2);i=t+(r+1)*o+2;for(var s=t+3,c=0;c<r+1;c+=1)n.push(Z.getOffset(e,s,o)),s+=o;a=i+n[r]}else a=t+2;return{offsets:n,startOffset:t,endOffset:a}}function JR(e,t,n,r,i){var a=Z.getCard16(n,r),o=0;if(a!==0){var s=Z.getByte(n,r+2);o=r+(a+1)*s+2}var c=Z.getBytes(n,o+t[e],o+t[e+1]);return i&&(c=i(c)),c}function YR(e){for(var t=``,n=15,r=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`.`,`E`,`E-`,null,`-`];;){var i=e.parseByte(),a=i>>4,o=i&15;if(a===n||(t+=r[a],o===n))break;t+=r[o]}return parseFloat(t)}function XR(e,t){var n,r,i,a;if(t===28)return n=e.parseByte(),r=e.parseByte(),n<<8|r;if(t===29)return n=e.parseByte(),r=e.parseByte(),i=e.parseByte(),a=e.parseByte(),n<<24|r<<16|i<<8|a;if(t===30)return YR(e);if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return n=e.parseByte(),(t-247)*256+n+108;if(t>=251&&t<=254)return n=e.parseByte(),-(t-251)*256-n-108;throw Error(`Invalid b0 `+t)}function ZR(e){for(var t={},n=0;n<e.length;n+=1){var r=e[n][0],i=e[n][1],a=void 0;if(a=i.length===1?i[0]:i,t.hasOwnProperty(r)&&!isNaN(t[r]))throw Error(`Object `+t+` already has key `+r);t[r]=a}return t}function QR(e,t,n){t=t===void 0?0:t;var r=new Z.Parser(e,t),i=[],a=[];for(n=n===void 0?e.length:n;r.relativeOffset<n;){var o=r.parseByte();o<=21?(o===12&&(o=1200+r.parseByte()),i.push([o,a]),a=[]):a.push(XR(r,o))}return ZR(i)}function $R(e,t){return t=t<=390?CR[t]:e[t-391],t}function ez(e,t,n){for(var r={},i,a=0;a<t.length;a+=1){var o=t[a];if(Array.isArray(o.type)){var s=[];s.length=o.type.length;for(var c=0;c<o.type.length;c++)i=e[o.op]===void 0?void 0:e[o.op][c],i===void 0&&(i=o.value!==void 0&&o.value[c]!==void 0?o.value[c]:null),o.type[c]===`SID`&&(i=$R(n,i)),s[c]=i;r[o.name]=s}else i=e[o.op],i===void 0&&(i=o.value===void 0?null:o.value),o.type===`SID`&&(i=$R(n,i)),r[o.name]=i}return r}function tz(e,t){var n={};return n.formatMajor=Z.getCard8(e,t),n.formatMinor=Z.getCard8(e,t+1),n.size=Z.getCard8(e,t+2),n.offsetSize=Z.getCard8(e,t+3),n.startOffset=t,n.endOffset=t+4,n}var nz=[{name:`version`,op:0,type:`SID`},{name:`notice`,op:1,type:`SID`},{name:`copyright`,op:1200,type:`SID`},{name:`fullName`,op:2,type:`SID`},{name:`familyName`,op:3,type:`SID`},{name:`weight`,op:4,type:`SID`},{name:`isFixedPitch`,op:1201,type:`number`,value:0},{name:`italicAngle`,op:1202,type:`number`,value:0},{name:`underlinePosition`,op:1203,type:`number`,value:-100},{name:`underlineThickness`,op:1204,type:`number`,value:50},{name:`paintType`,op:1205,type:`number`,value:0},{name:`charstringType`,op:1206,type:`number`,value:2},{name:`fontMatrix`,op:1207,type:[`real`,`real`,`real`,`real`,`real`,`real`],value:[.001,0,0,.001,0,0]},{name:`uniqueId`,op:13,type:`number`},{name:`fontBBox`,op:5,type:[`number`,`number`,`number`,`number`],value:[0,0,0,0]},{name:`strokeWidth`,op:1208,type:`number`,value:0},{name:`xuid`,op:14,type:[],value:null},{name:`charset`,op:15,type:`offset`,value:0},{name:`encoding`,op:16,type:`offset`,value:0},{name:`charStrings`,op:17,type:`offset`,value:0},{name:`private`,op:18,type:[`number`,`offset`],value:[0,0]},{name:`ros`,op:1230,type:[`SID`,`SID`,`number`]},{name:`cidFontVersion`,op:1231,type:`number`,value:0},{name:`cidFontRevision`,op:1232,type:`number`,value:0},{name:`cidFontType`,op:1233,type:`number`,value:0},{name:`cidCount`,op:1234,type:`number`,value:8720},{name:`uidBase`,op:1235,type:`number`},{name:`fdArray`,op:1236,type:`offset`},{name:`fdSelect`,op:1237,type:`offset`},{name:`fontName`,op:1238,type:`SID`}],rz=[{name:`subrs`,op:19,type:`offset`,value:0},{name:`defaultWidthX`,op:20,type:`number`,value:0},{name:`nominalWidthX`,op:21,type:`number`,value:0}];function iz(e,t){return ez(QR(e,0,e.byteLength),nz,t)}function az(e,t,n,r){return ez(QR(e,t,n),rz,r)}function oz(e,t,n,r){for(var i=[],a=0;a<n.length;a+=1){var o=iz(new DataView(new Uint8Array(n[a]).buffer),r);o._subrs=[],o._subrsBias=0,o._defaultWidthX=0,o._nominalWidthX=0;var s=o.private[0],c=o.private[1];if(s!==0&&c!==0){var l=az(e,c+t,s,r);o._defaultWidthX=l.defaultWidthX,o._nominalWidthX=l.nominalWidthX,l.subrs!==0&&(o._subrs=KR(e,c+l.subrs+t).objects,o._subrsBias=GR(o._subrs)),o._privateDict=l}i.push(o)}return i}function sz(e,t,n,r){var i,a,o=new Z.Parser(e,t);--n;var s=[`.notdef`],c=o.parseCard8();if(c===0)for(var l=0;l<n;l+=1)i=o.parseSID(),s.push($R(r,i));else if(c===1)for(;s.length<=n;){i=o.parseSID(),a=o.parseCard8();for(var u=0;u<=a;u+=1)s.push($R(r,i)),i+=1}else if(c===2)for(;s.length<=n;){i=o.parseSID(),a=o.parseCard16();for(var d=0;d<=a;d+=1)s.push($R(r,i)),i+=1}else throw Error(`Unknown charset format `+c);return s}function cz(e,t,n){var r,i={},a=new Z.Parser(e,t),o=a.parseCard8();if(o===0)for(var s=a.parseCard8(),c=0;c<s;c+=1)r=a.parseCard8(),i[r]=c;else if(o===1){var l=a.parseCard8();r=1;for(var u=0;u<l;u+=1)for(var d=a.parseCard8(),f=a.parseCard8(),p=d;p<=d+f;p+=1)i[p]=r,r+=1}else throw Error(`Unknown encoding format `+o);return new kR(i,n)}function lz(e,t,n){var r,i,a,o,s=new FL,c=[],l=0,u=!1,d=!1,f=0,p=0,m,h,g,_;if(e.isCIDFont){var v=e.tables.cff.topDict._fdSelect[t.index],y=e.tables.cff.topDict._fdArray[v];m=y._subrs,h=y._subrsBias,g=y._defaultWidthX,_=y._nominalWidthX}else m=e.tables.cff.topDict._subrs,h=e.tables.cff.topDict._subrsBias,g=e.tables.cff.topDict._defaultWidthX,_=e.tables.cff.topDict._nominalWidthX;var b=g;function x(e,t){d&&s.closePath(),s.moveTo(e,t),d=!0}function S(){c.length%2!=0&&!u&&(b=c.shift()+_),l+=c.length>>1,c.length=0,u=!0}function C(n){for(var g,v,y,w,ee,te,ne,re,ie,ae,oe,se,ce=0;ce<n.length;){var le=n[ce];switch(ce+=1,le){case 1:S();break;case 3:S();break;case 4:c.length>1&&!u&&(b=c.shift()+_,u=!0),p+=c.pop(),x(f,p);break;case 5:for(;c.length>0;)f+=c.shift(),p+=c.shift(),s.lineTo(f,p);break;case 6:for(;c.length>0&&(f+=c.shift(),s.lineTo(f,p),c.length!==0);)p+=c.shift(),s.lineTo(f,p);break;case 7:for(;c.length>0&&(p+=c.shift(),s.lineTo(f,p),c.length!==0);)f+=c.shift(),s.lineTo(f,p);break;case 8:for(;c.length>0;)r=f+c.shift(),i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),f=a+c.shift(),p=o+c.shift(),s.curveTo(r,i,a,o,f,p);break;case 10:ee=c.pop()+h,te=m[ee],te&&C(te);break;case 11:return;case 12:switch(le=n[ce],ce+=1,le){case 35:r=f+c.shift(),i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),ne=a+c.shift(),re=o+c.shift(),ie=ne+c.shift(),ae=re+c.shift(),oe=ie+c.shift(),se=ae+c.shift(),f=oe+c.shift(),p=se+c.shift(),c.shift(),s.curveTo(r,i,a,o,ne,re),s.curveTo(ie,ae,oe,se,f,p);break;case 34:r=f+c.shift(),i=p,a=r+c.shift(),o=i+c.shift(),ne=a+c.shift(),re=o,ie=ne+c.shift(),ae=o,oe=ie+c.shift(),se=p,f=oe+c.shift(),s.curveTo(r,i,a,o,ne,re),s.curveTo(ie,ae,oe,se,f,p);break;case 36:r=f+c.shift(),i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),ne=a+c.shift(),re=o,ie=ne+c.shift(),ae=o,oe=ie+c.shift(),se=ae+c.shift(),f=oe+c.shift(),s.curveTo(r,i,a,o,ne,re),s.curveTo(ie,ae,oe,se,f,p);break;case 37:r=f+c.shift(),i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),ne=a+c.shift(),re=o+c.shift(),ie=ne+c.shift(),ae=re+c.shift(),oe=ie+c.shift(),se=ae+c.shift(),Math.abs(oe-f)>Math.abs(se-p)?f=oe+c.shift():p=se+c.shift(),s.curveTo(r,i,a,o,ne,re),s.curveTo(ie,ae,oe,se,f,p);break;default:console.log(`Glyph `+t.index+`: unknown operator 1200`+le),c.length=0}break;case 14:c.length>0&&!u&&(b=c.shift()+_,u=!0),d&&=(s.closePath(),!1);break;case 18:S();break;case 19:case 20:S(),ce+=l+7>>3;break;case 21:c.length>2&&!u&&(b=c.shift()+_,u=!0),p+=c.pop(),f+=c.pop(),x(f,p);break;case 22:c.length>1&&!u&&(b=c.shift()+_,u=!0),f+=c.pop(),x(f,p);break;case 23:S();break;case 24:for(;c.length>2;)r=f+c.shift(),i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),f=a+c.shift(),p=o+c.shift(),s.curveTo(r,i,a,o,f,p);f+=c.shift(),p+=c.shift(),s.lineTo(f,p);break;case 25:for(;c.length>6;)f+=c.shift(),p+=c.shift(),s.lineTo(f,p);r=f+c.shift(),i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),f=a+c.shift(),p=o+c.shift(),s.curveTo(r,i,a,o,f,p);break;case 26:for(c.length%2&&(f+=c.shift());c.length>0;)r=f,i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),f=a,p=o+c.shift(),s.curveTo(r,i,a,o,f,p);break;case 27:for(c.length%2&&(p+=c.shift());c.length>0;)r=f+c.shift(),i=p,a=r+c.shift(),o=i+c.shift(),f=a+c.shift(),p=o,s.curveTo(r,i,a,o,f,p);break;case 28:g=n[ce],v=n[ce+1],c.push((g<<24|v<<16)>>16),ce+=2;break;case 29:ee=c.pop()+e.gsubrsBias,te=e.gsubrs[ee],te&&C(te);break;case 30:for(;c.length>0&&(r=f,i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),f=a+c.shift(),p=o+(c.length===1?c.shift():0),s.curveTo(r,i,a,o,f,p),c.length!==0);)r=f+c.shift(),i=p,a=r+c.shift(),o=i+c.shift(),p=o+c.shift(),f=a+(c.length===1?c.shift():0),s.curveTo(r,i,a,o,f,p);break;case 31:for(;c.length>0&&(r=f+c.shift(),i=p,a=r+c.shift(),o=i+c.shift(),p=o+c.shift(),f=a+(c.length===1?c.shift():0),s.curveTo(r,i,a,o,f,p),c.length!==0);)r=f,i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),f=a+c.shift(),p=o+(c.length===1?c.shift():0),s.curveTo(r,i,a,o,f,p);break;default:le<32?console.log(`Glyph `+t.index+`: unknown operator `+le):le<247?c.push(le-139):le<251?(g=n[ce],ce+=1,c.push((le-247)*256+g+108)):le<255?(g=n[ce],ce+=1,c.push(-(le-251)*256-g-108)):(g=n[ce],v=n[ce+1],y=n[ce+2],w=n[ce+3],ce+=4,c.push((g<<24|v<<16|y<<8|w)/65536))}}}return C(n),t.advanceWidth=b,s}function uz(e,t,n,r){var i=[],a,o=new Z.Parser(e,t),s=o.parseCard8();if(s===0)for(var c=0;c<n;c++){if(a=o.parseCard8(),a>=r)throw Error(`CFF table CID Font FDSelect has bad FD index value `+a+` (FD count `+r+`)`);i.push(a)}else if(s===3){var l=o.parseCard16(),u=o.parseCard16();if(u!==0)throw Error(`CFF Table CID Font FDSelect format 3 range has bad initial GID `+u);for(var d,f=0;f<l;f++){if(a=o.parseCard8(),d=o.parseCard16(),a>=r)throw Error(`CFF table CID Font FDSelect has bad FD index value `+a+` (FD count `+r+`)`);if(d>n)throw Error(`CFF Table CID Font FDSelect format 3 range has bad GID `+d);for(;u<d;u++)i.push(a);u=d}if(d!==n)throw Error(`CFF Table CID Font FDSelect format 3 range has bad final GID `+d)}else throw Error(`CFF Table CID Font FDSelect table has unsupported format `+s);return i}function dz(e,t,n,r){n.tables.cff={};var i=KR(e,KR(e,tz(e,t).endOffset,Z.bytesToString).endOffset),a=KR(e,i.endOffset,Z.bytesToString);n.gsubrs=KR(e,a.endOffset).objects,n.gsubrsBias=GR(n.gsubrs);var o=oz(e,t,i.objects,a.objects);if(o.length!==1)throw Error(`CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = `+o.length);var s=o[0];if(n.tables.cff.topDict=s,s._privateDict&&(n.defaultWidthX=s._privateDict.defaultWidthX,n.nominalWidthX=s._privateDict.nominalWidthX),s.ros[0]!==void 0&&s.ros[1]!==void 0&&(n.isCIDFont=!0),n.isCIDFont){var c=s.fdArray,l=s.fdSelect;if(c===0||l===0)throw Error(`Font is marked as a CID font, but FDArray and/or FDSelect information is missing`);c+=t;var u=oz(e,t,KR(e,c).objects,a.objects);s._fdArray=u,l+=t,s._fdSelect=uz(e,l,n.numGlyphs,u.length)}var d=t+s.private[1],f=az(e,d,s.private[0],a.objects);n.defaultWidthX=f.defaultWidthX,n.nominalWidthX=f.nominalWidthX,f.subrs===0?(n.subrs=[],n.subrsBias=0):(n.subrs=KR(e,d+f.subrs).objects,n.subrsBias=GR(n.subrs));var p;r.lowMemory?(p=qR(e,t+s.charStrings),n.nGlyphs=p.offsets.length):(p=KR(e,t+s.charStrings),n.nGlyphs=p.objects.length);var m=sz(e,t+s.charset,n.nGlyphs,a.objects);if(s.encoding===0?n.cffEncoding=new kR(wR,m):s.encoding===1?n.cffEncoding=new kR(TR,m):n.cffEncoding=cz(e,t+s.encoding,m),n.encoding=n.encoding||n.cffEncoding,n.glyphs=new UR.GlyphSet(n),r.lowMemory)n._push=function(r){var i=JR(r,p.offsets,e,t+s.charStrings);n.glyphs.push(r,UR.cffGlyphLoader(n,r,lz,i))};else for(var h=0;h<n.nGlyphs;h+=1){var g=p.objects[h];n.glyphs.push(h,UR.cffGlyphLoader(n,h,lz,g))}}function fz(e,t){var n,r=CR.indexOf(e);return r>=0&&(n=r),r=t.indexOf(e),r>=0?n=r+CR.length:(n=CR.length+t.length,t.push(e)),n}function pz(){return new Y.Record(`Header`,[{name:`major`,type:`Card8`,value:1},{name:`minor`,type:`Card8`,value:0},{name:`hdrSize`,type:`Card8`,value:4},{name:`major`,type:`Card8`,value:1}])}function mz(e){var t=new Y.Record(`Name INDEX`,[{name:`names`,type:`INDEX`,value:[]}]);t.names=[];for(var n=0;n<e.length;n+=1)t.names.push({name:`name_`+n,type:`NAME`,value:e[n]});return t}function hz(e,t,n){for(var r={},i=0;i<e.length;i+=1){var a=e[i],o=t[a.name];o!==void 0&&!WR(o,a.value)&&(a.type===`SID`&&(o=fz(o,n)),r[a.op]={name:a.name,type:a.type,value:o})}return r}function gz(e,t){var n=new Y.Record(`Top DICT`,[{name:`dict`,type:`DICT`,value:{}}]);return n.dict=hz(nz,e,t),n}function _z(e){var t=new Y.Record(`Top DICT INDEX`,[{name:`topDicts`,type:`INDEX`,value:[]}]);return t.topDicts=[{name:`topDict_0`,type:`TABLE`,value:e}],t}function vz(e){var t=new Y.Record(`String INDEX`,[{name:`strings`,type:`INDEX`,value:[]}]);t.strings=[];for(var n=0;n<e.length;n+=1)t.strings.push({name:`string_`+n,type:`STRING`,value:e[n]});return t}function yz(){return new Y.Record(`Global Subr INDEX`,[{name:`subrs`,type:`INDEX`,value:[]}])}function bz(e,t){for(var n=new Y.Record(`Charsets`,[{name:`format`,type:`Card8`,value:0}]),r=0;r<e.length;r+=1){var i=e[r],a=fz(i,t);n.fields.push({name:`glyph_`+r,type:`SID`,value:a})}return n}function xz(e){var t=[],n=e.path;t.push({name:`width`,type:`NUMBER`,value:e.advanceWidth});for(var r=0,i=0,a=0;a<n.commands.length;a+=1){var o=void 0,s=void 0,c=n.commands[a];if(c.type===`Q`){var l=1/3,u=2/3;c={type:`C`,x:c.x,y:c.y,x1:Math.round(l*r+u*c.x1),y1:Math.round(l*i+u*c.y1),x2:Math.round(l*c.x+u*c.x1),y2:Math.round(l*c.y+u*c.y1)}}if(c.type===`M`)o=Math.round(c.x-r),s=Math.round(c.y-i),t.push({name:`dx`,type:`NUMBER`,value:o}),t.push({name:`dy`,type:`NUMBER`,value:s}),t.push({name:`rmoveto`,type:`OP`,value:21}),r=Math.round(c.x),i=Math.round(c.y);else if(c.type===`L`)o=Math.round(c.x-r),s=Math.round(c.y-i),t.push({name:`dx`,type:`NUMBER`,value:o}),t.push({name:`dy`,type:`NUMBER`,value:s}),t.push({name:`rlineto`,type:`OP`,value:5}),r=Math.round(c.x),i=Math.round(c.y);else if(c.type===`C`){var d=Math.round(c.x1-r),f=Math.round(c.y1-i),p=Math.round(c.x2-c.x1),m=Math.round(c.y2-c.y1);o=Math.round(c.x-c.x2),s=Math.round(c.y-c.y2),t.push({name:`dx1`,type:`NUMBER`,value:d}),t.push({name:`dy1`,type:`NUMBER`,value:f}),t.push({name:`dx2`,type:`NUMBER`,value:p}),t.push({name:`dy2`,type:`NUMBER`,value:m}),t.push({name:`dx`,type:`NUMBER`,value:o}),t.push({name:`dy`,type:`NUMBER`,value:s}),t.push({name:`rrcurveto`,type:`OP`,value:8}),r=Math.round(c.x),i=Math.round(c.y)}}return t.push({name:`endchar`,type:`OP`,value:14}),t}function Sz(e){for(var t=new Y.Record(`CharStrings INDEX`,[{name:`charStrings`,type:`INDEX`,value:[]}]),n=0;n<e.length;n+=1){var r=e.get(n),i=xz(r);t.charStrings.push({name:r.name,type:`CHARSTRING`,value:i})}return t}function Cz(e,t){var n=new Y.Record(`Private DICT`,[{name:`dict`,type:`DICT`,value:{}}]);return n.dict=hz(rz,e,t),n}function wz(e,t){for(var n=new Y.Table(`CFF `,[{name:`header`,type:`RECORD`},{name:`nameIndex`,type:`RECORD`},{name:`topDictIndex`,type:`RECORD`},{name:`stringIndex`,type:`RECORD`},{name:`globalSubrIndex`,type:`RECORD`},{name:`charsets`,type:`RECORD`},{name:`charStringsIndex`,type:`RECORD`},{name:`privateDict`,type:`RECORD`}]),r=1/t.unitsPerEm,i={version:t.version,fullName:t.fullName,familyName:t.familyName,weight:t.weightName,fontBBox:t.fontBBox||[0,0,0,0],fontMatrix:[r,0,0,r,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},a={},o=[],s,c=1;c<e.length;c+=1)s=e.get(c),o.push(s.name);var l=[];n.header=pz(),n.nameIndex=mz([t.postScriptName]);var u=gz(i,l);return n.topDictIndex=_z(u),n.globalSubrIndex=yz(),n.charsets=bz(o,l),n.charStringsIndex=Sz(e),n.privateDict=Cz(a,l),n.stringIndex=vz(l),i.charset=n.header.sizeOf()+n.nameIndex.sizeOf()+n.topDictIndex.sizeOf()+n.stringIndex.sizeOf()+n.globalSubrIndex.sizeOf(),i.encoding=0,i.charStrings=i.charset+n.charsets.sizeOf(),i.private[1]=i.charStrings+n.charStringsIndex.sizeOf(),u=gz(i,l),n.topDictIndex=_z(u),n}var Tz={parse:dz,make:wz};function Ez(e,t){var n={},r=new Z.Parser(e,t);return n.version=r.parseVersion(),n.fontRevision=Math.round(r.parseFixed()*1e3)/1e3,n.checkSumAdjustment=r.parseULong(),n.magicNumber=r.parseULong(),K.argument(n.magicNumber===1594834165,`Font header has wrong magic number.`),n.flags=r.parseUShort(),n.unitsPerEm=r.parseUShort(),n.created=r.parseLongDateTime(),n.modified=r.parseLongDateTime(),n.xMin=r.parseShort(),n.yMin=r.parseShort(),n.xMax=r.parseShort(),n.yMax=r.parseShort(),n.macStyle=r.parseUShort(),n.lowestRecPPEM=r.parseUShort(),n.fontDirectionHint=r.parseShort(),n.indexToLocFormat=r.parseShort(),n.glyphDataFormat=r.parseShort(),n}function Dz(e){var t=Math.round(new Date().getTime()/1e3)+2082844800,n=t;return e.createdTimestamp&&(n=e.createdTimestamp+2082844800),new Y.Table(`head`,[{name:`version`,type:`FIXED`,value:65536},{name:`fontRevision`,type:`FIXED`,value:65536},{name:`checkSumAdjustment`,type:`ULONG`,value:0},{name:`magicNumber`,type:`ULONG`,value:1594834165},{name:`flags`,type:`USHORT`,value:0},{name:`unitsPerEm`,type:`USHORT`,value:1e3},{name:`created`,type:`LONGDATETIME`,value:n},{name:`modified`,type:`LONGDATETIME`,value:t},{name:`xMin`,type:`SHORT`,value:0},{name:`yMin`,type:`SHORT`,value:0},{name:`xMax`,type:`SHORT`,value:0},{name:`yMax`,type:`SHORT`,value:0},{name:`macStyle`,type:`USHORT`,value:0},{name:`lowestRecPPEM`,type:`USHORT`,value:0},{name:`fontDirectionHint`,type:`SHORT`,value:2},{name:`indexToLocFormat`,type:`SHORT`,value:0},{name:`glyphDataFormat`,type:`SHORT`,value:0}],e)}var Oz={parse:Ez,make:Dz};function kz(e,t){var n={},r=new Z.Parser(e,t);return n.version=r.parseVersion(),n.ascender=r.parseShort(),n.descender=r.parseShort(),n.lineGap=r.parseShort(),n.advanceWidthMax=r.parseUShort(),n.minLeftSideBearing=r.parseShort(),n.minRightSideBearing=r.parseShort(),n.xMaxExtent=r.parseShort(),n.caretSlopeRise=r.parseShort(),n.caretSlopeRun=r.parseShort(),n.caretOffset=r.parseShort(),r.relativeOffset+=8,n.metricDataFormat=r.parseShort(),n.numberOfHMetrics=r.parseUShort(),n}function Az(e){return new Y.Table(`hhea`,[{name:`version`,type:`FIXED`,value:65536},{name:`ascender`,type:`FWORD`,value:0},{name:`descender`,type:`FWORD`,value:0},{name:`lineGap`,type:`FWORD`,value:0},{name:`advanceWidthMax`,type:`UFWORD`,value:0},{name:`minLeftSideBearing`,type:`FWORD`,value:0},{name:`minRightSideBearing`,type:`FWORD`,value:0},{name:`xMaxExtent`,type:`FWORD`,value:0},{name:`caretSlopeRise`,type:`SHORT`,value:1},{name:`caretSlopeRun`,type:`SHORT`,value:0},{name:`caretOffset`,type:`SHORT`,value:0},{name:`reserved1`,type:`SHORT`,value:0},{name:`reserved2`,type:`SHORT`,value:0},{name:`reserved3`,type:`SHORT`,value:0},{name:`reserved4`,type:`SHORT`,value:0},{name:`metricDataFormat`,type:`SHORT`,value:0},{name:`numberOfHMetrics`,type:`USHORT`,value:0}],e)}var jz={parse:kz,make:Az};function Mz(e,t,n,r,i){for(var a,o,s=new Z.Parser(e,t),c=0;c<r;c+=1){c<n&&(a=s.parseUShort(),o=s.parseShort());var l=i.get(c);l.advanceWidth=a,l.leftSideBearing=o}}function Nz(e,t,n,r,i){e._hmtxTableData={};for(var a,o,s=new Z.Parser(t,n),c=0;c<i;c+=1)c<r&&(a=s.parseUShort(),o=s.parseShort()),e._hmtxTableData[c]={advanceWidth:a,leftSideBearing:o}}function Pz(e,t,n,r,i,a,o){o.lowMemory?Nz(e,t,n,r,i):Mz(t,n,r,i,a)}function Fz(e){for(var t=new Y.Table(`hmtx`,[]),n=0;n<e.length;n+=1){var r=e.get(n),i=r.advanceWidth||0,a=r.leftSideBearing||0;t.fields.push({name:`advanceWidth_`+n,type:`USHORT`,value:i}),t.fields.push({name:`leftSideBearing_`+n,type:`SHORT`,value:a})}return t}var Iz={parse:Pz,make:Fz};function Lz(e){for(var t=new Y.Table(`ltag`,[{name:`version`,type:`ULONG`,value:1},{name:`flags`,type:`ULONG`,value:0},{name:`numTags`,type:`ULONG`,value:e.length}]),n=``,r=12+e.length*4,i=0;i<e.length;++i){var a=n.indexOf(e[i]);a<0&&(a=n.length,n+=e[i]),t.fields.push({name:`offset `+i,type:`USHORT`,value:r+a}),t.fields.push({name:`length `+i,type:`USHORT`,value:e[i].length})}return t.fields.push({name:`stringPool`,type:`CHARARRAY`,value:n}),t}function Rz(e,t){var n=new Z.Parser(e,t),r=n.parseULong();K.argument(r===1,`Unsupported ltag table version.`),n.skip(`uLong`,1);for(var i=n.parseULong(),a=[],o=0;o<i;o++){for(var s=``,c=t+n.parseUShort(),l=n.parseUShort(),u=c;u<c+l;++u)s+=String.fromCharCode(e.getInt8(u));a.push(s)}return a}var zz={make:Lz,parse:Rz};function Bz(e,t){var n={},r=new Z.Parser(e,t);return n.version=r.parseVersion(),n.numGlyphs=r.parseUShort(),n.version===1&&(n.maxPoints=r.parseUShort(),n.maxContours=r.parseUShort(),n.maxCompositePoints=r.parseUShort(),n.maxCompositeContours=r.parseUShort(),n.maxZones=r.parseUShort(),n.maxTwilightPoints=r.parseUShort(),n.maxStorage=r.parseUShort(),n.maxFunctionDefs=r.parseUShort(),n.maxInstructionDefs=r.parseUShort(),n.maxStackElements=r.parseUShort(),n.maxSizeOfInstructions=r.parseUShort(),n.maxComponentElements=r.parseUShort(),n.maxComponentDepth=r.parseUShort()),n}function Vz(e){return new Y.Table(`maxp`,[{name:`version`,type:`FIXED`,value:20480},{name:`numGlyphs`,type:`USHORT`,value:e}])}var Hz={parse:Bz,make:Vz},Uz=[`copyright`,`fontFamily`,`fontSubfamily`,`uniqueID`,`fullName`,`version`,`postScriptName`,`trademark`,`manufacturer`,`designer`,`description`,`manufacturerURL`,`designerURL`,`license`,`licenseURL`,`reserved`,`preferredFamily`,`preferredSubfamily`,`compatibleFullName`,`sampleText`,`postScriptFindFontName`,`wwsFamily`,`wwsSubfamily`],Wz={0:`en`,1:`fr`,2:`de`,3:`it`,4:`nl`,5:`sv`,6:`es`,7:`da`,8:`pt`,9:`no`,10:`he`,11:`ja`,12:`ar`,13:`fi`,14:`el`,15:`is`,16:`mt`,17:`tr`,18:`hr`,19:`zh-Hant`,20:`ur`,21:`hi`,22:`th`,23:`ko`,24:`lt`,25:`pl`,26:`hu`,27:`es`,28:`lv`,29:`se`,30:`fo`,31:`fa`,32:`ru`,33:`zh`,34:`nl-BE`,35:`ga`,36:`sq`,37:`ro`,38:`cz`,39:`sk`,40:`si`,41:`yi`,42:`sr`,43:`mk`,44:`bg`,45:`uk`,46:`be`,47:`uz`,48:`kk`,49:`az-Cyrl`,50:`az-Arab`,51:`hy`,52:`ka`,53:`mo`,54:`ky`,55:`tg`,56:`tk`,57:`mn-CN`,58:`mn`,59:`ps`,60:`ks`,61:`ku`,62:`sd`,63:`bo`,64:`ne`,65:`sa`,66:`mr`,67:`bn`,68:`as`,69:`gu`,70:`pa`,71:`or`,72:`ml`,73:`kn`,74:`ta`,75:`te`,76:`si`,77:`my`,78:`km`,79:`lo`,80:`vi`,81:`id`,82:`tl`,83:`ms`,84:`ms-Arab`,85:`am`,86:`ti`,87:`om`,88:`so`,89:`sw`,90:`rw`,91:`rn`,92:`ny`,93:`mg`,94:`eo`,128:`cy`,129:`eu`,130:`ca`,131:`la`,132:`qu`,133:`gn`,134:`ay`,135:`tt`,136:`ug`,137:`dz`,138:`jv`,139:`su`,140:`gl`,141:`af`,142:`br`,143:`iu`,144:`gd`,145:`gv`,146:`ga`,147:`to`,148:`el-polyton`,149:`kl`,150:`az`,151:`nn`},Gz={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:5,11:1,12:4,13:0,14:6,15:0,16:0,17:0,18:0,19:2,20:4,21:9,22:21,23:3,24:29,25:29,26:29,27:29,28:29,29:0,30:0,31:4,32:7,33:25,34:0,35:0,36:0,37:0,38:29,39:29,40:0,41:5,42:7,43:7,44:7,45:7,46:7,47:7,48:7,49:7,50:4,51:24,52:23,53:7,54:7,55:7,56:7,57:27,58:7,59:4,60:4,61:4,62:4,63:26,64:9,65:9,66:9,67:13,68:13,69:11,70:10,71:12,72:17,73:16,74:14,75:15,76:18,77:19,78:20,79:22,80:30,81:0,82:0,83:0,84:4,85:28,86:28,87:28,88:0,89:0,90:0,91:0,92:0,93:0,94:0,128:0,129:0,130:0,131:0,132:0,133:0,134:0,135:7,136:4,137:26,138:0,139:0,140:0,141:0,142:0,143:28,144:0,145:0,146:0,147:0,148:6,149:0,150:0,151:0},Kz={1078:`af`,1052:`sq`,1156:`gsw`,1118:`am`,5121:`ar-DZ`,15361:`ar-BH`,3073:`ar`,2049:`ar-IQ`,11265:`ar-JO`,13313:`ar-KW`,12289:`ar-LB`,4097:`ar-LY`,6145:`ary`,8193:`ar-OM`,16385:`ar-QA`,1025:`ar-SA`,10241:`ar-SY`,7169:`aeb`,14337:`ar-AE`,9217:`ar-YE`,1067:`hy`,1101:`as`,2092:`az-Cyrl`,1068:`az`,1133:`ba`,1069:`eu`,1059:`be`,2117:`bn`,1093:`bn-IN`,8218:`bs-Cyrl`,5146:`bs`,1150:`br`,1026:`bg`,1027:`ca`,3076:`zh-HK`,5124:`zh-MO`,2052:`zh`,4100:`zh-SG`,1028:`zh-TW`,1155:`co`,1050:`hr`,4122:`hr-BA`,1029:`cs`,1030:`da`,1164:`prs`,1125:`dv`,2067:`nl-BE`,1043:`nl`,3081:`en-AU`,10249:`en-BZ`,4105:`en-CA`,9225:`en-029`,16393:`en-IN`,6153:`en-IE`,8201:`en-JM`,17417:`en-MY`,5129:`en-NZ`,13321:`en-PH`,18441:`en-SG`,7177:`en-ZA`,11273:`en-TT`,2057:`en-GB`,1033:`en`,12297:`en-ZW`,1061:`et`,1080:`fo`,1124:`fil`,1035:`fi`,2060:`fr-BE`,3084:`fr-CA`,1036:`fr`,5132:`fr-LU`,6156:`fr-MC`,4108:`fr-CH`,1122:`fy`,1110:`gl`,1079:`ka`,3079:`de-AT`,1031:`de`,5127:`de-LI`,4103:`de-LU`,2055:`de-CH`,1032:`el`,1135:`kl`,1095:`gu`,1128:`ha`,1037:`he`,1081:`hi`,1038:`hu`,1039:`is`,1136:`ig`,1057:`id`,1117:`iu`,2141:`iu-Latn`,2108:`ga`,1076:`xh`,1077:`zu`,1040:`it`,2064:`it-CH`,1041:`ja`,1099:`kn`,1087:`kk`,1107:`km`,1158:`quc`,1159:`rw`,1089:`sw`,1111:`kok`,1042:`ko`,1088:`ky`,1108:`lo`,1062:`lv`,1063:`lt`,2094:`dsb`,1134:`lb`,1071:`mk`,2110:`ms-BN`,1086:`ms`,1100:`ml`,1082:`mt`,1153:`mi`,1146:`arn`,1102:`mr`,1148:`moh`,1104:`mn`,2128:`mn-CN`,1121:`ne`,1044:`nb`,2068:`nn`,1154:`oc`,1096:`or`,1123:`ps`,1045:`pl`,1046:`pt`,2070:`pt-PT`,1094:`pa`,1131:`qu-BO`,2155:`qu-EC`,3179:`qu`,1048:`ro`,1047:`rm`,1049:`ru`,9275:`smn`,4155:`smj-NO`,5179:`smj`,3131:`se-FI`,1083:`se`,2107:`se-SE`,8251:`sms`,6203:`sma-NO`,7227:`sms`,1103:`sa`,7194:`sr-Cyrl-BA`,3098:`sr`,6170:`sr-Latn-BA`,2074:`sr-Latn`,1132:`nso`,1074:`tn`,1115:`si`,1051:`sk`,1060:`sl`,11274:`es-AR`,16394:`es-BO`,13322:`es-CL`,9226:`es-CO`,5130:`es-CR`,7178:`es-DO`,12298:`es-EC`,17418:`es-SV`,4106:`es-GT`,18442:`es-HN`,2058:`es-MX`,19466:`es-NI`,6154:`es-PA`,15370:`es-PY`,10250:`es-PE`,20490:`es-PR`,3082:`es`,1034:`es`,21514:`es-US`,14346:`es-UY`,8202:`es-VE`,2077:`sv-FI`,1053:`sv`,1114:`syr`,1064:`tg`,2143:`tzm`,1097:`ta`,1092:`tt`,1098:`te`,1054:`th`,1105:`bo`,1055:`tr`,1090:`tk`,1152:`ug`,1058:`uk`,1070:`hsb`,1056:`ur`,2115:`uz-Cyrl`,1091:`uz`,1066:`vi`,1106:`cy`,1160:`wo`,1157:`sah`,1144:`ii`,1130:`yo`};function qz(e,t,n){switch(e){case 0:if(t===65535)return`und`;if(n)return n[t];break;case 1:return Wz[t];case 3:return Kz[t]}}var Jz=`utf-16`,Yz={0:`macintosh`,1:`x-mac-japanese`,2:`x-mac-chinesetrad`,3:`x-mac-korean`,6:`x-mac-greek`,7:`x-mac-cyrillic`,9:`x-mac-devanagai`,10:`x-mac-gurmukhi`,11:`x-mac-gujarati`,12:`x-mac-oriya`,13:`x-mac-bengali`,14:`x-mac-tamil`,15:`x-mac-telugu`,16:`x-mac-kannada`,17:`x-mac-malayalam`,18:`x-mac-sinhalese`,19:`x-mac-burmese`,20:`x-mac-khmer`,21:`x-mac-thai`,22:`x-mac-lao`,23:`x-mac-georgian`,24:`x-mac-armenian`,25:`x-mac-chinesesimp`,26:`x-mac-tibetan`,27:`x-mac-mongolian`,28:`x-mac-ethiopic`,29:`x-mac-ce`,30:`x-mac-vietnamese`,31:`x-mac-extarabic`},Xz={15:`x-mac-icelandic`,17:`x-mac-turkish`,18:`x-mac-croatian`,24:`x-mac-ce`,25:`x-mac-ce`,26:`x-mac-ce`,27:`x-mac-ce`,28:`x-mac-ce`,30:`x-mac-icelandic`,37:`x-mac-romanian`,38:`x-mac-ce`,39:`x-mac-ce`,40:`x-mac-ce`,143:`x-mac-inuit`,146:`x-mac-gaelic`};function Zz(e,t,n){switch(e){case 0:return Jz;case 1:return Xz[n]||Yz[t];case 3:if(t===1||t===10)return Jz;break}}function Qz(e,t,n){for(var r={},i=new Z.Parser(e,t),a=i.parseUShort(),o=i.parseUShort(),s=i.offset+i.parseUShort(),c=0;c<o;c++){var l=i.parseUShort(),u=i.parseUShort(),d=i.parseUShort(),f=i.parseUShort(),p=Uz[f]||f,m=i.parseUShort(),h=i.parseUShort(),g=qz(l,d,n),_=Zz(l,u,d);if(_!==void 0&&g!==void 0){var v=void 0;if(v=_===Jz?BL.UTF16(e,s+h,m):BL.MACSTRING(e,s+h,m,_),v){var y=r[p];y===void 0&&(y=r[p]={}),y[g]=v}}}return a===1&&i.parseUShort(),r}function $z(e){var t={};for(var n in e)t[e[n]]=parseInt(n);return t}function eB(e,t,n,r,i,a){return new Y.Record(`NameRecord`,[{name:`platformID`,type:`USHORT`,value:e},{name:`encodingID`,type:`USHORT`,value:t},{name:`languageID`,type:`USHORT`,value:n},{name:`nameID`,type:`USHORT`,value:r},{name:`length`,type:`USHORT`,value:i},{name:`offset`,type:`USHORT`,value:a}])}function tB(e,t){var n=e.length,r=t.length-n+1;loop:for(var i=0;i<r;i++)for(;i<r;i++){for(var a=0;a<n;a++)if(t[i+a]!==e[a])continue loop;return i}return-1}function nB(e,t){var n=tB(e,t);if(n<0){n=t.length;for(var r=0,i=e.length;r<i;++r)t.push(e[r])}return n}function rB(e,t){var n,r=[],i={},a=$z(Uz);for(var o in e){var s=a[o];if(s===void 0&&(s=o),n=parseInt(s),isNaN(n))throw Error(`Name table entry "`+o+`" does not exist, see nameTableNames for complete list.`);i[n]=e[o],r.push(n)}for(var c=$z(Wz),l=$z(Kz),u=[],d=[],f=0;f<r.length;f++){n=r[f];var p=i[n];for(var m in p){var h=p[m],g=1,_=c[m],v=Gz[_],y=Zz(g,v,_),b=q.MACSTRING(h,y);b===void 0&&(g=0,_=t.indexOf(m),_<0&&(_=t.length,t.push(m)),v=4,b=q.UTF16(h));var x=nB(b,d);u.push(eB(g,v,_,n,b.length,x));var S=l[m];if(S!==void 0){var C=q.UTF16(h),w=nB(C,d);u.push(eB(3,1,S,n,C.length,w))}}}u.sort(function(e,t){return e.platformID-t.platformID||e.encodingID-t.encodingID||e.languageID-t.languageID||e.nameID-t.nameID});for(var ee=new Y.Table(`name`,[{name:`format`,type:`USHORT`,value:0},{name:`count`,type:`USHORT`,value:u.length},{name:`stringOffset`,type:`USHORT`,value:6+u.length*12}]),te=0;te<u.length;te++)ee.fields.push({name:`record_`+te,type:`RECORD`,value:u[te]});return ee.fields.push({name:`strings`,type:`LITERAL`,value:d}),ee}var iB={parse:Qz,make:rB},aB=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}];function oB(e){for(var t=0;t<aB.length;t+=1){var n=aB[t];if(e>=n.begin&&e<n.end)return t}return-1}function sB(e,t){var n={},r=new Z.Parser(e,t);n.version=r.parseUShort(),n.xAvgCharWidth=r.parseShort(),n.usWeightClass=r.parseUShort(),n.usWidthClass=r.parseUShort(),n.fsType=r.parseUShort(),n.ySubscriptXSize=r.parseShort(),n.ySubscriptYSize=r.parseShort(),n.ySubscriptXOffset=r.parseShort(),n.ySubscriptYOffset=r.parseShort(),n.ySuperscriptXSize=r.parseShort(),n.ySuperscriptYSize=r.parseShort(),n.ySuperscriptXOffset=r.parseShort(),n.ySuperscriptYOffset=r.parseShort(),n.yStrikeoutSize=r.parseShort(),n.yStrikeoutPosition=r.parseShort(),n.sFamilyClass=r.parseShort(),n.panose=[];for(var i=0;i<10;i++)n.panose[i]=r.parseByte();return n.ulUnicodeRange1=r.parseULong(),n.ulUnicodeRange2=r.parseULong(),n.ulUnicodeRange3=r.parseULong(),n.ulUnicodeRange4=r.parseULong(),n.achVendID=String.fromCharCode(r.parseByte(),r.parseByte(),r.parseByte(),r.parseByte()),n.fsSelection=r.parseUShort(),n.usFirstCharIndex=r.parseUShort(),n.usLastCharIndex=r.parseUShort(),n.sTypoAscender=r.parseShort(),n.sTypoDescender=r.parseShort(),n.sTypoLineGap=r.parseShort(),n.usWinAscent=r.parseUShort(),n.usWinDescent=r.parseUShort(),n.version>=1&&(n.ulCodePageRange1=r.parseULong(),n.ulCodePageRange2=r.parseULong()),n.version>=2&&(n.sxHeight=r.parseShort(),n.sCapHeight=r.parseShort(),n.usDefaultChar=r.parseUShort(),n.usBreakChar=r.parseUShort(),n.usMaxContent=r.parseUShort()),n}function cB(e){return new Y.Table(`OS/2`,[{name:`version`,type:`USHORT`,value:3},{name:`xAvgCharWidth`,type:`SHORT`,value:0},{name:`usWeightClass`,type:`USHORT`,value:0},{name:`usWidthClass`,type:`USHORT`,value:0},{name:`fsType`,type:`USHORT`,value:0},{name:`ySubscriptXSize`,type:`SHORT`,value:650},{name:`ySubscriptYSize`,type:`SHORT`,value:699},{name:`ySubscriptXOffset`,type:`SHORT`,value:0},{name:`ySubscriptYOffset`,type:`SHORT`,value:140},{name:`ySuperscriptXSize`,type:`SHORT`,value:650},{name:`ySuperscriptYSize`,type:`SHORT`,value:699},{name:`ySuperscriptXOffset`,type:`SHORT`,value:0},{name:`ySuperscriptYOffset`,type:`SHORT`,value:479},{name:`yStrikeoutSize`,type:`SHORT`,value:49},{name:`yStrikeoutPosition`,type:`SHORT`,value:258},{name:`sFamilyClass`,type:`SHORT`,value:0},{name:`bFamilyType`,type:`BYTE`,value:0},{name:`bSerifStyle`,type:`BYTE`,value:0},{name:`bWeight`,type:`BYTE`,value:0},{name:`bProportion`,type:`BYTE`,value:0},{name:`bContrast`,type:`BYTE`,value:0},{name:`bStrokeVariation`,type:`BYTE`,value:0},{name:`bArmStyle`,type:`BYTE`,value:0},{name:`bLetterform`,type:`BYTE`,value:0},{name:`bMidline`,type:`BYTE`,value:0},{name:`bXHeight`,type:`BYTE`,value:0},{name:`ulUnicodeRange1`,type:`ULONG`,value:0},{name:`ulUnicodeRange2`,type:`ULONG`,value:0},{name:`ulUnicodeRange3`,type:`ULONG`,value:0},{name:`ulUnicodeRange4`,type:`ULONG`,value:0},{name:`achVendID`,type:`CHARARRAY`,value:`XXXX`},{name:`fsSelection`,type:`USHORT`,value:0},{name:`usFirstCharIndex`,type:`USHORT`,value:0},{name:`usLastCharIndex`,type:`USHORT`,value:0},{name:`sTypoAscender`,type:`SHORT`,value:0},{name:`sTypoDescender`,type:`SHORT`,value:0},{name:`sTypoLineGap`,type:`SHORT`,value:0},{name:`usWinAscent`,type:`USHORT`,value:0},{name:`usWinDescent`,type:`USHORT`,value:0},{name:`ulCodePageRange1`,type:`ULONG`,value:0},{name:`ulCodePageRange2`,type:`ULONG`,value:0},{name:`sxHeight`,type:`SHORT`,value:0},{name:`sCapHeight`,type:`SHORT`,value:0},{name:`usDefaultChar`,type:`USHORT`,value:0},{name:`usBreakChar`,type:`USHORT`,value:0},{name:`usMaxContext`,type:`USHORT`,value:0}],e)}var lB={parse:sB,make:cB,unicodeRanges:aB,getUnicodeRange:oB};function uB(e,t){var n={},r=new Z.Parser(e,t);switch(n.version=r.parseVersion(),n.italicAngle=r.parseFixed(),n.underlinePosition=r.parseShort(),n.underlineThickness=r.parseShort(),n.isFixedPitch=r.parseULong(),n.minMemType42=r.parseULong(),n.maxMemType42=r.parseULong(),n.minMemType1=r.parseULong(),n.maxMemType1=r.parseULong(),n.version){case 1:n.names=ER.slice();break;case 2:n.numberOfGlyphs=r.parseUShort(),n.glyphNameIndex=Array(n.numberOfGlyphs);for(var i=0;i<n.numberOfGlyphs;i++)n.glyphNameIndex[i]=r.parseUShort();n.names=[];for(var a=0;a<n.numberOfGlyphs;a++)if(n.glyphNameIndex[a]>=ER.length){var o=r.parseChar();n.names.push(r.parseString(o))}break;case 2.5:n.numberOfGlyphs=r.parseUShort(),n.offset=Array(n.numberOfGlyphs);for(var s=0;s<n.numberOfGlyphs;s++)n.offset[s]=r.parseChar();break}return n}function dB(){return new Y.Table(`post`,[{name:`version`,type:`FIXED`,value:196608},{name:`italicAngle`,type:`FIXED`,value:0},{name:`underlinePosition`,type:`FWORD`,value:0},{name:`underlineThickness`,type:`FWORD`,value:0},{name:`isFixedPitch`,type:`ULONG`,value:0},{name:`minMemType42`,type:`ULONG`,value:0},{name:`maxMemType42`,type:`ULONG`,value:0},{name:`minMemType1`,type:`ULONG`,value:0},{name:`maxMemType1`,type:`ULONG`,value:0}])}var fB={parse:uB,make:dB},pB=Array(9);pB[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(X.coverage),deltaGlyphId:this.parseUShort()};if(t===2)return{substFormat:2,coverage:this.parsePointer(X.coverage),substitute:this.parseOffset16List()};K.assert(!1,`0x`+e.toString(16)+`: lookup type 1 format must be 1 or 2.`)},pB[2]=function(){var e=this.parseUShort();return K.argument(e===1,`GSUB Multiple Substitution Subtable identifier-format must be 1`),{substFormat:e,coverage:this.parsePointer(X.coverage),sequences:this.parseListOfLists()}},pB[3]=function(){var e=this.parseUShort();return K.argument(e===1,`GSUB Alternate Substitution Subtable identifier-format must be 1`),{substFormat:e,coverage:this.parsePointer(X.coverage),alternateSets:this.parseListOfLists()}},pB[4]=function(){var e=this.parseUShort();return K.argument(e===1,`GSUB ligature table identifier-format must be 1`),{substFormat:e,coverage:this.parsePointer(X.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};var mB={sequenceIndex:X.uShort,lookupListIndex:X.uShort};pB[5]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:t,coverage:this.parsePointer(X.coverage),ruleSets:this.parseListOfLists(function(){var e=this.parseUShort(),t=this.parseUShort();return{input:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,mB)}})};if(t===2)return{substFormat:t,coverage:this.parsePointer(X.coverage),classDef:this.parsePointer(X.classDef),classSets:this.parseListOfLists(function(){var e=this.parseUShort(),t=this.parseUShort();return{classes:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,mB)}})};if(t===3){var n=this.parseUShort(),r=this.parseUShort();return{substFormat:t,coverages:this.parseList(n,X.pointer(X.coverage)),lookupRecords:this.parseRecordList(r,mB)}}K.assert(!1,`0x`+e.toString(16)+`: lookup type 5 format must be 1, 2 or 3.`)},pB[6]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(X.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(mB)}})};if(t===2)return{substFormat:2,coverage:this.parsePointer(X.coverage),backtrackClassDef:this.parsePointer(X.classDef),inputClassDef:this.parsePointer(X.classDef),lookaheadClassDef:this.parsePointer(X.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(mB)}})};if(t===3)return{substFormat:3,backtrackCoverage:this.parseList(X.pointer(X.coverage)),inputCoverage:this.parseList(X.pointer(X.coverage)),lookaheadCoverage:this.parseList(X.pointer(X.coverage)),lookupRecords:this.parseRecordList(mB)};K.assert(!1,`0x`+e.toString(16)+`: lookup type 6 format must be 1, 2 or 3.`)},pB[7]=function(){var e=this.parseUShort();K.argument(e===1,`GSUB Extension Substitution subtable identifier-format must be 1`);var t=this.parseUShort(),n=new X(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:pB[t].call(n)}},pB[8]=function(){var e=this.parseUShort();return K.argument(e===1,`GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1`),{substFormat:e,coverage:this.parsePointer(X.coverage),backtrackCoverage:this.parseList(X.pointer(X.coverage)),lookaheadCoverage:this.parseList(X.pointer(X.coverage)),substitutes:this.parseUShortList()}};function hB(e,t){t||=0;var n=new X(e,t),r=n.parseVersion(1);return K.argument(r===1||r===1.1,`Unsupported GSUB table version.`),r===1?{version:r,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(pB)}:{version:r,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(pB),variations:n.parseFeatureVariationsList()}}var gB=Array(9);gB[1]=function(e){return e.substFormat===1?new Y.Table(`substitutionTable`,[{name:`substFormat`,type:`USHORT`,value:1},{name:`coverage`,type:`TABLE`,value:new Y.Coverage(e.coverage)},{name:`deltaGlyphID`,type:`USHORT`,value:e.deltaGlyphId}]):new Y.Table(`substitutionTable`,[{name:`substFormat`,type:`USHORT`,value:2},{name:`coverage`,type:`TABLE`,value:new Y.Coverage(e.coverage)}].concat(Y.ushortList(`substitute`,e.substitute)))},gB[2]=function(e){return K.assert(e.substFormat===1,`Lookup type 2 substFormat must be 1.`),new Y.Table(`substitutionTable`,[{name:`substFormat`,type:`USHORT`,value:1},{name:`coverage`,type:`TABLE`,value:new Y.Coverage(e.coverage)}].concat(Y.tableList(`seqSet`,e.sequences,function(e){return new Y.Table(`sequenceSetTable`,Y.ushortList(`sequence`,e))})))},gB[3]=function(e){return K.assert(e.substFormat===1,`Lookup type 3 substFormat must be 1.`),new Y.Table(`substitutionTable`,[{name:`substFormat`,type:`USHORT`,value:1},{name:`coverage`,type:`TABLE`,value:new Y.Coverage(e.coverage)}].concat(Y.tableList(`altSet`,e.alternateSets,function(e){return new Y.Table(`alternateSetTable`,Y.ushortList(`alternate`,e))})))},gB[4]=function(e){return K.assert(e.substFormat===1,`Lookup type 4 substFormat must be 1.`),new Y.Table(`substitutionTable`,[{name:`substFormat`,type:`USHORT`,value:1},{name:`coverage`,type:`TABLE`,value:new Y.Coverage(e.coverage)}].concat(Y.tableList(`ligSet`,e.ligatureSets,function(e){return new Y.Table(`ligatureSetTable`,Y.tableList(`ligature`,e,function(e){return new Y.Table(`ligatureTable`,[{name:`ligGlyph`,type:`USHORT`,value:e.ligGlyph}].concat(Y.ushortList(`component`,e.components,e.components.length+1)))}))})))},gB[6]=function(e){if(e.substFormat===1)return new Y.Table(`chainContextTable`,[{name:`substFormat`,type:`USHORT`,value:e.substFormat},{name:`coverage`,type:`TABLE`,value:new Y.Coverage(e.coverage)}].concat(Y.tableList(`chainRuleSet`,e.chainRuleSets,function(e){return new Y.Table(`chainRuleSetTable`,Y.tableList(`chainRule`,e,function(e){var t=Y.ushortList(`backtrackGlyph`,e.backtrack,e.backtrack.length).concat(Y.ushortList(`inputGlyph`,e.input,e.input.length+1)).concat(Y.ushortList(`lookaheadGlyph`,e.lookahead,e.lookahead.length)).concat(Y.ushortList(`substitution`,[],e.lookupRecords.length));return e.lookupRecords.forEach(function(e,n){t=t.concat({name:`sequenceIndex`+n,type:`USHORT`,value:e.sequenceIndex}).concat({name:`lookupListIndex`+n,type:`USHORT`,value:e.lookupListIndex})}),new Y.Table(`chainRuleTable`,t)}))})));if(e.substFormat===2)K.assert(!1,`lookup type 6 format 2 is not yet supported.`);else if(e.substFormat===3){var t=[{name:`substFormat`,type:`USHORT`,value:e.substFormat}];return t.push({name:`backtrackGlyphCount`,type:`USHORT`,value:e.backtrackCoverage.length}),e.backtrackCoverage.forEach(function(e,n){t.push({name:`backtrackCoverage`+n,type:`TABLE`,value:new Y.Coverage(e)})}),t.push({name:`inputGlyphCount`,type:`USHORT`,value:e.inputCoverage.length}),e.inputCoverage.forEach(function(e,n){t.push({name:`inputCoverage`+n,type:`TABLE`,value:new Y.Coverage(e)})}),t.push({name:`lookaheadGlyphCount`,type:`USHORT`,value:e.lookaheadCoverage.length}),e.lookaheadCoverage.forEach(function(e,n){t.push({name:`lookaheadCoverage`+n,type:`TABLE`,value:new Y.Coverage(e)})}),t.push({name:`substitutionCount`,type:`USHORT`,value:e.lookupRecords.length}),e.lookupRecords.forEach(function(e,n){t=t.concat({name:`sequenceIndex`+n,type:`USHORT`,value:e.sequenceIndex}).concat({name:`lookupListIndex`+n,type:`USHORT`,value:e.lookupListIndex})}),new Y.Table(`chainContextTable`,t)}K.assert(!1,`lookup type 6 format must be 1, 2 or 3.`)};function _B(e){return new Y.Table(`GSUB`,[{name:`version`,type:`ULONG`,value:65536},{name:`scripts`,type:`TABLE`,value:new Y.ScriptList(e.scripts)},{name:`features`,type:`TABLE`,value:new Y.FeatureList(e.features)},{name:`lookups`,type:`TABLE`,value:new Y.LookupList(e.lookups,gB)}])}var vB={parse:hB,make:_B};function yB(e,t){var n=new Z.Parser(e,t),r=n.parseULong();K.argument(r===1,`Unsupported META table version.`),n.parseULong(),n.parseULong();for(var i=n.parseULong(),a={},o=0;o<i;o++){var s=n.parseTag(),c=n.parseULong(),l=n.parseULong();a[s]=BL.UTF8(e,t+c,l)}return a}function bB(e){var t=Object.keys(e).length,n=``,r=16+t*12,i=new Y.Table(`meta`,[{name:`version`,type:`ULONG`,value:1},{name:`flags`,type:`ULONG`,value:0},{name:`offset`,type:`ULONG`,value:r},{name:`numTags`,type:`ULONG`,value:t}]);for(var a in e){var o=n.length;n+=e[a],i.fields.push({name:`tag `+a,type:`TAG`,value:a}),i.fields.push({name:`offset `+a,type:`ULONG`,value:r+o}),i.fields.push({name:`length `+a,type:`ULONG`,value:e[a].length})}return i.fields.push({name:`stringPool`,type:`CHARARRAY`,value:n}),i}var xB={parse:yB,make:bB};function SB(e){return Math.log(e)/Math.log(2)|0}function CB(e){for(;e.length%4!=0;)e.push(0);for(var t=0,n=0;n<e.length;n+=4)t+=(e[n]<<24)+(e[n+1]<<16)+(e[n+2]<<8)+e[n+3];return t%=2**32,t}function wB(e,t,n,r){return new Y.Record(`Table Record`,[{name:`tag`,type:`TAG`,value:e===void 0?``:e},{name:`checkSum`,type:`ULONG`,value:t===void 0?0:t},{name:`offset`,type:`ULONG`,value:n===void 0?0:n},{name:`length`,type:`ULONG`,value:r===void 0?0:r}])}function TB(e){var t=new Y.Table(`sfnt`,[{name:`version`,type:`TAG`,value:`OTTO`},{name:`numTables`,type:`USHORT`,value:0},{name:`searchRange`,type:`USHORT`,value:0},{name:`entrySelector`,type:`USHORT`,value:0},{name:`rangeShift`,type:`USHORT`,value:0}]);t.tables=e,t.numTables=e.length;var n=2**SB(t.numTables);t.searchRange=16*n,t.entrySelector=SB(n),t.rangeShift=t.numTables*16-t.searchRange;for(var r=[],i=[],a=t.sizeOf()+wB().sizeOf()*t.numTables;a%4!=0;)a+=1,i.push({name:`padding`,type:`BYTE`,value:0});for(var o=0;o<e.length;o+=1){var s=e[o];K.argument(s.tableName.length===4,`Table name`+s.tableName+` is invalid.`);var c=s.sizeOf(),l=wB(s.tableName,CB(s.encode()),a,c);for(r.push({name:l.tag+` Table Record`,type:`RECORD`,value:l}),i.push({name:s.tableName+` table`,type:`RECORD`,value:s}),a+=c,K.argument(!isNaN(a),`Something went wrong calculating the offset.`);a%4!=0;)a+=1,i.push({name:`padding`,type:`BYTE`,value:0})}return r.sort(function(e,t){return e.value.tag>t.value.tag?1:-1}),t.fields=t.fields.concat(r),t.fields=t.fields.concat(i),t}function EB(e,t,n){for(var r=0;r<t.length;r+=1){var i=e.charToGlyphIndex(t[r]);if(i>0)return e.glyphs.get(i).getMetrics()}return n}function DB(e){for(var t=0,n=0;n<e.length;n+=1)t+=e[n];return t/e.length}function OB(e){for(var t=[],n=[],r=[],i=[],a=[],o=[],s=[],c,l=0,u=0,d=0,f=0,p=0,m=0;m<e.glyphs.length;m+=1){var h=e.glyphs.get(m),g=h.unicode|0;if(isNaN(h.advanceWidth))throw Error(`Glyph `+h.name+` (`+m+`): advanceWidth is not a number.`);(c>g||c===void 0)&&g>0&&(c=g),l<g&&(l=g);var _=lB.getUnicodeRange(g);if(_<32)u|=1<<_;else if(_<64)d|=1<<_-32;else if(_<96)f|=1<<_-64;else if(_<123)p|=1<<_-96;else throw Error(`Unicode ranges bits > 123 are reserved for internal usage`);if(h.name!==`.notdef`){var v=h.getMetrics();t.push(v.xMin),n.push(v.yMin),r.push(v.xMax),i.push(v.yMax),o.push(v.leftSideBearing),s.push(v.rightSideBearing),a.push(h.advanceWidth)}}var y={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,r),yMax:Math.max.apply(null,i),advanceWidthMax:Math.max.apply(null,a),advanceWidthAvg:DB(a),minLeftSideBearing:Math.min.apply(null,o),maxLeftSideBearing:Math.max.apply(null,o),minRightSideBearing:Math.min.apply(null,s)};y.ascender=e.ascender,y.descender=e.descender;var b=Oz.make({flags:3,unitsPerEm:e.unitsPerEm,xMin:y.xMin,yMin:y.yMin,xMax:y.xMax,yMax:y.yMax,lowestRecPPEM:3,createdTimestamp:e.createdTimestamp}),x=jz.make({ascender:y.ascender,descender:y.descender,advanceWidthMax:y.advanceWidthMax,minLeftSideBearing:y.minLeftSideBearing,minRightSideBearing:y.minRightSideBearing,xMaxExtent:y.maxLeftSideBearing+(y.xMax-y.xMin),numberOfHMetrics:e.glyphs.length}),S=Hz.make(e.glyphs.length),C=lB.make(Object.assign({xAvgCharWidth:Math.round(y.advanceWidthAvg),usFirstCharIndex:c,usLastCharIndex:l,ulUnicodeRange1:u,ulUnicodeRange2:d,ulUnicodeRange3:f,ulUnicodeRange4:p,sTypoAscender:y.ascender,sTypoDescender:y.descender,sTypoLineGap:0,usWinAscent:y.yMax,usWinDescent:Math.abs(y.yMin),ulCodePageRange1:1,sxHeight:EB(e,`xyvw`,{yMax:Math.round(y.ascender/2)}).yMax,sCapHeight:EB(e,`HIKLEFJMNTZBDPRAGOQSUVWXY`,y).yMax,usDefaultChar:e.hasChar(` `)?32:0,usBreakChar:e.hasChar(` `)?32:0},e.tables.os2)),w=Iz.make(e.glyphs),ee=SR.make(e.glyphs),te=e.getEnglishName(`fontFamily`),ne=e.getEnglishName(`fontSubfamily`),re=te+` `+ne,ie=e.getEnglishName(`postScriptName`);ie||=te.replace(/\s/g,``)+`-`+ne;var ae={};for(var oe in e.names)ae[oe]=e.names[oe];ae.uniqueID||={en:e.getEnglishName(`manufacturer`)+`:`+re},ae.postScriptName||={en:ie},ae.preferredFamily||=e.names.fontFamily,ae.preferredSubfamily||=e.names.fontSubfamily;var se=[],ce=iB.make(ae,se),le=se.length>0?zz.make(se):void 0,ue=fB.make(),de=Tz.make(e.glyphs,{version:e.getEnglishName(`version`),fullName:re,familyName:te,weightName:ne,postScriptName:ie,unitsPerEm:e.unitsPerEm,fontBBox:[0,y.yMin,y.ascender,y.advanceWidthMax]}),fe=e.metas&&Object.keys(e.metas).length>0?xB.make(e.metas):void 0,pe=[b,x,S,C,ce,ee,ue,de,w];le&&pe.push(le),e.tables.gsub&&pe.push(vB.make(e.tables.gsub)),fe&&pe.push(fe);for(var me=TB(pe),he=CB(me.encode()),ge=me.fields,_e=!1,ve=0;ve<ge.length;ve+=1)if(ge[ve].name===`head table`){ge[ve].value.checkSumAdjustment=2981146554-he,_e=!0;break}if(!_e)throw Error(`Could not find head table with checkSum to adjust.`);return me}var kB={make:TB,fontToTable:OB,computeCheckSum:CB};function AB(e,t){for(var n=0,r=e.length-1;n<=r;){var i=n+r>>>1,a=e[i].tag;if(a===t)return i;a<t?n=i+1:r=i-1}return-n-1}function jB(e,t){for(var n=0,r=e.length-1;n<=r;){var i=n+r>>>1,a=e[i];if(a===t)return i;a<t?n=i+1:r=i-1}return-n-1}function MB(e,t){for(var n,r=0,i=e.length-1;r<=i;){var a=r+i>>>1;n=e[a];var o=n.start;if(o===t)return n;o<t?r=a+1:i=a-1}if(r>0)return n=e[r-1],t>n.end?0:n}function NB(e,t){this.font=e,this.tableName=t}NB.prototype={searchTag:AB,binSearch:jB,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,n=0;n<e.scripts.length;n++){var r=e.scripts[n].tag;if(r===`DFLT`)return r;r===`latn`&&(t=!0)}if(t)return`latn`}},getScriptTable:function(e,t){var n=this.getTable(t);if(n){e||=`DFLT`;var r=n.scripts,i=AB(n.scripts,e);if(i>=0)return r[i].script;if(t){var a={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return r.splice(-1-i,0,a),a.script}}},getLangSysTable:function(e,t,n){var r=this.getScriptTable(e,n);if(r){if(!t||t===`dflt`||t===`DFLT`)return r.defaultLangSys;var i=AB(r.langSysRecords,t);if(i>=0)return r.langSysRecords[i].langSys;if(n){var a={tag:t,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return r.langSysRecords.splice(-1-i,0,a),a.langSys}}},getFeatureTable:function(e,t,n,r){var i=this.getLangSysTable(e,t,r);if(i){for(var a,o=i.featureIndexes,s=this.font.tables[this.tableName].features,c=0;c<o.length;c++)if(a=s[o[c]],a.tag===n)return a.feature;if(r){var l=s.length;return K.assert(l===0||n>=s[l-1].tag,`Features must be added in alphabetical order.`),a={tag:n,feature:{params:0,lookupListIndexes:[]}},s.push(a),o.push(l),a.feature}}},getLookupTables:function(e,t,n,r,i){var a=this.getFeatureTable(e,t,n,i),o=[];if(a){for(var s,c=a.lookupListIndexes,l=this.font.tables[this.tableName].lookups,u=0;u<c.length;u++)s=l[c[u]],s.lookupType===r&&o.push(s);if(o.length===0&&i){s={lookupType:r,lookupFlag:0,subtables:[],markFilteringSet:void 0};var d=l.length;return l.push(s),c.push(d),[s]}}return o},getGlyphClass:function(e,t){switch(e.format){case 1:return e.startGlyph<=t&&t<e.startGlyph+e.classes.length?e.classes[t-e.startGlyph]:0;case 2:var n=MB(e.ranges,t);return n?n.classId:0}},getCoverageIndex:function(e,t){switch(e.format){case 1:var n=jB(e.glyphs,t);return n>=0?n:-1;case 2:var r=MB(e.ranges,t);return r?r.index+t-r.start:-1}},expandCoverage:function(e){if(e.format===1)return e.glyphs;for(var t=[],n=e.ranges,r=0;r<n.length;r++)for(var i=n[r],a=i.start,o=i.end,s=a;s<=o;s++)t.push(s);return t}};function PB(e){NB.call(this,e,`gpos`)}PB.prototype=NB.prototype,PB.prototype.init=function(){var e=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(e)},PB.prototype.getKerningValue=function(e,t,n){for(var r=0;r<e.length;r++)for(var i=e[r].subtables,a=0;a<i.length;a++){var o=i[a],s=this.getCoverageIndex(o.coverage,t);if(!(s<0))switch(o.posFormat){case 1:for(var c=o.pairSets[s],l=0;l<c.length;l++){var u=c[l];if(u.secondGlyph===n)return u.value1&&u.value1.xAdvance||0}break;case 2:var d=this.getGlyphClass(o.classDef1,t),f=this.getGlyphClass(o.classDef2,n),p=o.classRecords[d][f];return p.value1&&p.value1.xAdvance||0}}return 0},PB.prototype.getKerningTables=function(e,t){if(this.font.tables.gpos)return this.getLookupTables(e,t,`kern`,2)};function FB(e){NB.call(this,e,`gsub`)}function IB(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function LB(e,t,n){for(var r=e.subtables,i=0;i<r.length;i++){var a=r[i];if(a.substFormat===t)return a}if(n)return r.push(n),n}FB.prototype=NB.prototype,FB.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:`DFLT`,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},FB.prototype.getSingle=function(e,t,n){for(var r=[],i=this.getLookupTables(t,n,e,1),a=0;a<i.length;a++)for(var o=i[a].subtables,s=0;s<o.length;s++){var c=o[s],l=this.expandCoverage(c.coverage),u=void 0;if(c.substFormat===1){var d=c.deltaGlyphId;for(u=0;u<l.length;u++){var f=l[u];r.push({sub:f,by:f+d})}}else{var p=c.substitute;for(u=0;u<l.length;u++)r.push({sub:l[u],by:p[u]})}}return r},FB.prototype.getMultiple=function(e,t,n){for(var r=[],i=this.getLookupTables(t,n,e,2),a=0;a<i.length;a++)for(var o=i[a].subtables,s=0;s<o.length;s++){var c=o[s],l=this.expandCoverage(c.coverage),u=void 0;for(u=0;u<l.length;u++){var d=l[u],f=c.sequences[u];r.push({sub:d,by:f})}}return r},FB.prototype.getAlternates=function(e,t,n){for(var r=[],i=this.getLookupTables(t,n,e,3),a=0;a<i.length;a++)for(var o=i[a].subtables,s=0;s<o.length;s++)for(var c=o[s],l=this.expandCoverage(c.coverage),u=c.alternateSets,d=0;d<l.length;d++)r.push({sub:l[d],by:u[d]});return r},FB.prototype.getLigatures=function(e,t,n){for(var r=[],i=this.getLookupTables(t,n,e,4),a=0;a<i.length;a++)for(var o=i[a].subtables,s=0;s<o.length;s++)for(var c=o[s],l=this.expandCoverage(c.coverage),u=c.ligatureSets,d=0;d<l.length;d++)for(var f=l[d],p=u[d],m=0;m<p.length;m++){var h=p[m];r.push({sub:[f].concat(h.components),by:h.ligGlyph})}return r},FB.prototype.addSingle=function(e,t,n,r){var i=this.getLookupTables(n,r,e,1,!0)[0],a=LB(i,2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});K.assert(a.coverage.format===1,`Single: unable to modify coverage table format `+a.coverage.format);var o=t.sub,s=this.binSearch(a.coverage.glyphs,o);s<0&&(s=-1-s,a.coverage.glyphs.splice(s,0,o),a.substitute.splice(s,0,0)),a.substitute[s]=t.by},FB.prototype.addMultiple=function(e,t,n,r){K.assert(t.by instanceof Array&&t.by.length>1,`Multiple: "by" must be an array of two or more ids`);var i=this.getLookupTables(n,r,e,2,!0)[0],a=LB(i,1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});K.assert(a.coverage.format===1,`Multiple: unable to modify coverage table format `+a.coverage.format);var o=t.sub,s=this.binSearch(a.coverage.glyphs,o);s<0&&(s=-1-s,a.coverage.glyphs.splice(s,0,o),a.sequences.splice(s,0,0)),a.sequences[s]=t.by},FB.prototype.addAlternate=function(e,t,n,r){var i=this.getLookupTables(n,r,e,3,!0)[0],a=LB(i,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});K.assert(a.coverage.format===1,`Alternate: unable to modify coverage table format `+a.coverage.format);var o=t.sub,s=this.binSearch(a.coverage.glyphs,o);s<0&&(s=-1-s,a.coverage.glyphs.splice(s,0,o),a.alternateSets.splice(s,0,0)),a.alternateSets[s]=t.by},FB.prototype.addLigature=function(e,t,n,r){var i=this.getLookupTables(n,r,e,4,!0)[0],a=i.subtables[0];a||(a={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},i.subtables[0]=a),K.assert(a.coverage.format===1,`Ligature: unable to modify coverage table format `+a.coverage.format);var o=t.sub[0],s=t.sub.slice(1),c={ligGlyph:t.by,components:s},l=this.binSearch(a.coverage.glyphs,o);if(l>=0){for(var u=a.ligatureSets[l],d=0;d<u.length;d++)if(IB(u[d].components,s))return;u.push(c)}else l=-1-l,a.coverage.glyphs.splice(l,0,o),a.ligatureSets.splice(l,0,[c])},FB.prototype.getFeature=function(e,t,n){if(/ss\d\d/.test(e))return this.getSingle(e,t,n);switch(e){case`aalt`:case`salt`:return this.getSingle(e,t,n).concat(this.getAlternates(e,t,n));case`dlig`:case`liga`:case`rlig`:return this.getLigatures(e,t,n);case`ccmp`:return this.getMultiple(e,t,n).concat(this.getLigatures(e,t,n));case`stch`:return this.getMultiple(e,t,n)}},FB.prototype.add=function(e,t,n,r){if(/ss\d\d/.test(e))return this.addSingle(e,t,n,r);switch(e){case`aalt`:case`salt`:return typeof t.by==`number`?this.addSingle(e,t,n,r):this.addAlternate(e,t,n,r);case`dlig`:case`liga`:case`rlig`:return this.addLigature(e,t,n,r);case`ccmp`:return t.by instanceof Array?this.addMultiple(e,t,n,r):this.addLigature(e,t,n,r)}};function RB(){return typeof window<`u`}function zB(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),r=0;r<e.length;++r)n[r]=e[r];return t}function BB(e){for(var t=new Buffer(e.byteLength),n=new Uint8Array(e),r=0;r<t.length;++r)t[r]=n[r];return t}function VB(e,t){if(!e)throw t}function HB(e,t,n,r,i){var a;return(t&r)>0?(a=e.parseByte(),(t&i)===0&&(a=-a),a=n+a):a=(t&i)>0?n:n+e.parseShort(),a}function UB(e,t,n){var r=new Z.Parser(t,n);e.numberOfContours=r.parseShort(),e._xMin=r.parseShort(),e._yMin=r.parseShort(),e._xMax=r.parseShort(),e._yMax=r.parseShort();var i,a;if(e.numberOfContours>0){for(var o=e.endPointIndices=[],s=0;s<e.numberOfContours;s+=1)o.push(r.parseUShort());e.instructionLength=r.parseUShort(),e.instructions=[];for(var c=0;c<e.instructionLength;c+=1)e.instructions.push(r.parseByte());var l=o[o.length-1]+1;i=[];for(var u=0;u<l;u+=1)if(a=r.parseByte(),i.push(a),(a&8)>0)for(var d=r.parseByte(),f=0;f<d;f+=1)i.push(a),u+=1;if(K.argument(i.length===l,`Bad flags.`),o.length>0){var p=[],m;if(l>0){for(var h=0;h<l;h+=1)a=i[h],m={},m.onCurve=!!(a&1),m.lastPointOfContour=o.indexOf(h)>=0,p.push(m);for(var g=0,_=0;_<l;_+=1)a=i[_],m=p[_],m.x=HB(r,a,g,2,16),g=m.x;for(var v=0,y=0;y<l;y+=1)a=i[y],m=p[y],m.y=HB(r,a,v,4,32),v=m.y}e.points=p}else e.points=[]}else if(e.numberOfContours===0)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];for(var b=!0;b;){i=r.parseUShort();var x={glyphIndex:r.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(i&1)>0?(i&2)>0?(x.dx=r.parseShort(),x.dy=r.parseShort()):x.matchedPoints=[r.parseUShort(),r.parseUShort()]:(i&2)>0?(x.dx=r.parseChar(),x.dy=r.parseChar()):x.matchedPoints=[r.parseByte(),r.parseByte()],(i&8)>0?x.xScale=x.yScale=r.parseF2Dot14():(i&64)>0?(x.xScale=r.parseF2Dot14(),x.yScale=r.parseF2Dot14()):(i&128)>0&&(x.xScale=r.parseF2Dot14(),x.scale01=r.parseF2Dot14(),x.scale10=r.parseF2Dot14(),x.yScale=r.parseF2Dot14()),e.components.push(x),b=!!(i&32)}if(i&256){e.instructionLength=r.parseUShort(),e.instructions=[];for(var S=0;S<e.instructionLength;S+=1)e.instructions.push(r.parseByte())}}}function WB(e,t){for(var n=[],r=0;r<e.length;r+=1){var i=e[r],a={x:t.xScale*i.x+t.scale01*i.y+t.dx,y:t.scale10*i.x+t.yScale*i.y+t.dy,onCurve:i.onCurve,lastPointOfContour:i.lastPointOfContour};n.push(a)}return n}function GB(e){for(var t=[],n=[],r=0;r<e.length;r+=1){var i=e[r];n.push(i),i.lastPointOfContour&&(t.push(n),n=[])}return K.argument(n.length===0,`There are still points left in the current contour.`),t}function KB(e){var t=new FL;if(!e)return t;for(var n=GB(e),r=0;r<n.length;++r){var i=n[r],a=null,o=i[i.length-1],s=i[0];if(o.onCurve)t.moveTo(o.x,o.y);else if(s.onCurve)t.moveTo(s.x,s.y);else{var c={x:(o.x+s.x)*.5,y:(o.y+s.y)*.5};t.moveTo(c.x,c.y)}for(var l=0;l<i.length;++l)if(a=o,o=s,s=i[(l+1)%i.length],o.onCurve)t.lineTo(o.x,o.y);else{var u=s;a.onCurve||((o.x+a.x)*.5,(o.y+a.y)*.5),s.onCurve||(u={x:(o.x+s.x)*.5,y:(o.y+s.y)*.5}),t.quadraticCurveTo(o.x,o.y,u.x,u.y)}t.closePath()}return t}function qB(e,t){if(t.isComposite)for(var n=0;n<t.components.length;n+=1){var r=t.components[n],i=e.get(r.glyphIndex);if(i.getPath(),i.points){var a=void 0;if(r.matchedPoints===void 0)a=WB(i.points,r);else{if(r.matchedPoints[0]>t.points.length-1||r.matchedPoints[1]>i.points.length-1)throw Error(`Matched points out of range in `+t.name);var o=t.points[r.matchedPoints[0]],s=i.points[r.matchedPoints[1]],c={xScale:r.xScale,scale01:r.scale01,scale10:r.scale10,yScale:r.yScale,dx:0,dy:0};s=WB([s],c)[0],c.dx=o.x-s.x,c.dy=o.y-s.y,a=WB(i.points,c)}t.points=t.points.concat(a)}}return KB(t.points)}function JB(e,t,n,r){for(var i=new UR.GlyphSet(r),a=0;a<n.length-1;a+=1){var o=n[a];o===n[a+1]?i.push(a,UR.glyphLoader(r,a)):i.push(a,UR.ttfGlyphLoader(r,a,UB,e,t+o,qB))}return i}function YB(e,t,n,r){var i=new UR.GlyphSet(r);return r._push=function(a){var o=n[a];o===n[a+1]?i.push(a,UR.glyphLoader(r,a)):i.push(a,UR.ttfGlyphLoader(r,a,UB,e,t+o,qB))},i}function XB(e,t,n,r,i){return i.lowMemory?YB(e,t,n,r):JB(e,t,n,r)}var ZB={getPath:KB,parse:XB},QB,$B,eV,tV;function nV(e){this.font=e,this.getCommands=function(e){return ZB.getPath(e).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function rV(e){return e}function iV(e){return Math.sign(e)*Math.round(Math.abs(e))}function aV(e){return Math.sign(e)*Math.round(Math.abs(e*2))/2}function oV(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function sV(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function cV(e){return Math.sign(e)*Math.floor(Math.abs(e))}var lV=function(e){var t=this.srPeriod,n=this.srPhase,r=this.srThreshold,i=1;return e<0&&(e=-e,i=-1),e+=r-n,e=Math.trunc(e/t)*t,e+=n,e<0?n*i:e*i},uV={x:1,y:0,axis:`x`,distance:function(e,t,n,r){return(n?e.xo:e.x)-(r?t.xo:t.x)},interpolate:function(e,t,n,r){var i,a,o,s,c,l,u;if(!r||r===this){if(i=e.xo-t.xo,a=e.xo-n.xo,c=t.x-t.xo,l=n.x-n.xo,o=Math.abs(i),s=Math.abs(a),u=o+s,u===0){e.x=e.xo+(c+l)/2;return}e.x=e.xo+(c*s+l*o)/u;return}if(i=r.distance(e,t,!0,!0),a=r.distance(e,n,!0,!0),c=r.distance(t,t,!1,!0),l=r.distance(n,n,!1,!0),o=Math.abs(i),s=Math.abs(a),u=o+s,u===0){uV.setRelative(e,e,(c+l)/2,r,!0);return}uV.setRelative(e,e,(c*s+l*o)/u,r,!0)},normalSlope:-1/0,setRelative:function(e,t,n,r,i){if(!r||r===this){e.x=(i?t.xo:t.x)+n;return}var a=i?t.xo:t.x,o=i?t.yo:t.y,s=a+n*r.x,c=o+n*r.y;e.x=s+(e.y-c)/r.normalSlope},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},dV={x:0,y:1,axis:`y`,distance:function(e,t,n,r){return(n?e.yo:e.y)-(r?t.yo:t.y)},interpolate:function(e,t,n,r){var i,a,o,s,c,l,u;if(!r||r===this){if(i=e.yo-t.yo,a=e.yo-n.yo,c=t.y-t.yo,l=n.y-n.yo,o=Math.abs(i),s=Math.abs(a),u=o+s,u===0){e.y=e.yo+(c+l)/2;return}e.y=e.yo+(c*s+l*o)/u;return}if(i=r.distance(e,t,!0,!0),a=r.distance(e,n,!0,!0),c=r.distance(t,t,!1,!0),l=r.distance(n,n,!1,!0),o=Math.abs(i),s=Math.abs(a),u=o+s,u===0){dV.setRelative(e,e,(c+l)/2,r,!0);return}dV.setRelative(e,e,(c*s+l*o)/u,r,!0)},normalSlope:0,setRelative:function(e,t,n,r,i){if(!r||r===this){e.y=(i?t.yo:t.y)+n;return}var a=i?t.xo:t.x,o=i?t.yo:t.y,s=a+n*r.x;e.y=o+n*r.y+r.normalSlope*(e.x-s)},slope:1/0,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};Object.freeze(uV),Object.freeze(dV);function fV(e,t){this.x=e,this.y=t,this.axis=void 0,this.slope=t/e,this.normalSlope=-e/t,Object.freeze(this)}fV.prototype.distance=function(e,t,n,r){return this.x*uV.distance(e,t,n,r)+this.y*dV.distance(e,t,n,r)},fV.prototype.interpolate=function(e,t,n,r){var i,a,o=r.distance(e,t,!0,!0),s=r.distance(e,n,!0,!0),c,l,u;if(i=r.distance(t,t,!1,!0),a=r.distance(n,n,!1,!0),c=Math.abs(o),l=Math.abs(s),u=c+l,u===0){this.setRelative(e,e,(i+a)/2,r,!0);return}this.setRelative(e,e,(i*l+a*c)/u,r,!0)},fV.prototype.setRelative=function(e,t,n,r,i){r||=this;var a=i?t.xo:t.x,o=i?t.yo:t.y,s=a+n*r.x,c=o+n*r.y,l=r.normalSlope,u=this.slope,d=e.x,f=e.y;e.x=(u*d-l*s+c-f)/(u-l),e.y=u*(e.x-d)+f},fV.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0};function pV(e,t){var n=Math.sqrt(e*e+t*t);return e/=n,t/=n,e===1&&t===0?uV:e===0&&t===1?dV:new fV(e,t)}function mV(e,t,n,r){this.x=this.xo=Math.round(e*64)/64,this.y=this.yo=Math.round(t*64)/64,this.lastPointOfContour=n,this.onCurve=r,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}mV.prototype.nextTouched=function(e){for(var t=this.nextPointOnContour;!e.touched(t)&&t!==this;)t=t.nextPointOnContour;return t},mV.prototype.prevTouched=function(e){for(var t=this.prevPointOnContour;!e.touched(t)&&t!==this;)t=t.prevPointOnContour;return t};var hV=Object.freeze(new mV(0,0)),gV={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function _V(e,t){switch(this.env=e,this.stack=[],this.prog=t,e){case`glyf`:this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case`prep`:this.fv=this.pv=this.dpv=uV,this.round=iV}}nV.prototype.exec=function(e,t){if(typeof t!=`number`)throw Error(`Point size is not a number!`);if(!(this._errorState>2)){var n=this.font,r=this._prepState;if(!r||r.ppem!==t){var i=this._fpgmState;if(!i){_V.prototype=gV,i=this._fpgmState=new _V(`fpgm`,n.tables.fpgm),i.funcs=[],i.font=n,exports.DEBUG&&(console.log(`---EXEC FPGM---`),i.step=-1);try{$B(i)}catch(e){console.log(`Hinting error in FPGM:`+e),this._errorState=3;return}}_V.prototype=i,r=this._prepState=new _V(`prep`,n.tables.prep),r.ppem=t;var a=n.tables.cvt;if(a)for(var o=r.cvt=Array(a.length),s=t/n.unitsPerEm,c=0;c<a.length;c++)o[c]=a[c]*s;else r.cvt=[];exports.DEBUG&&(console.log(`---EXEC PREP---`),r.step=-1);try{$B(r)}catch(e){this._errorState<2&&console.log(`Hinting error in PREP:`+e),this._errorState=2}}if(!(this._errorState>1))try{return eV(e,r)}catch(e){this._errorState<1&&(console.log(`Hinting error:`+e),console.log(`Note: further hinting errors are silenced`)),this._errorState=1;return}}},eV=function(e,t){var n=t.ppem/t.font.unitsPerEm,r=n,i=e.components,a,o,s;if(_V.prototype=t,!i)s=new _V(`glyf`,e.instructions),exports.DEBUG&&(console.log(`---EXEC GLYPH---`),s.step=-1),tV(e,s,n,r),o=s.gZone;else{var c=t.font;o=[],a=[];for(var l=0;l<i.length;l++){var u=i[l],d=c.glyphs.get(u.glyphIndex);s=new _V(`glyf`,d.instructions),exports.DEBUG&&(console.log(`---EXEC COMP `+l+`---`),s.step=-1),tV(d,s,n,r);for(var f=Math.round(u.dx*n),p=Math.round(u.dy*r),m=s.gZone,h=s.contours,g=0;g<m.length;g++){var _=m[g];_.xTouched=_.yTouched=!1,_.xo=_.x+=f,_.yo=_.y+=p}var v=o.length;o.push.apply(o,m);for(var y=0;y<h.length;y++)a.push(h[y]+v)}e.instructions&&!s.inhibitGridFit&&(s=new _V(`glyf`,e.instructions),s.gZone=s.z0=s.z1=s.z2=o,s.contours=a,o.push(new mV(0,0),new mV(Math.round(e.advanceWidth*n),0)),exports.DEBUG&&(console.log(`---EXEC COMPOSITE---`),s.step=-1),$B(s),o.length-=2)}return o},tV=function(e,t,n,r){for(var i=e.points||[],a=i.length,o=t.gZone=t.z0=t.z1=t.z2=[],s=t.contours=[],c,l=0;l<a;l++)c=i[l],o[l]=new mV(c.x*n,c.y*r,c.lastPointOfContour,c.onCurve);for(var u,d,f=0;f<a;f++)c=o[f],u||(u=c,s.push(f)),c.lastPointOfContour?(c.nextPointOnContour=u,u.prevPointOnContour=c,u=void 0):(d=o[f+1],c.nextPointOnContour=d,d.prevPointOnContour=c);if(!t.inhibitGridFit){if(exports.DEBUG){console.log(`PROCESSING GLYPH`,t.stack);for(var p=0;p<a;p++)console.log(p,o[p].x,o[p].y)}if(o.push(new mV(0,0),new mV(Math.round(e.advanceWidth*n),0)),$B(t),o.length-=2,exports.DEBUG){console.log(`FINISHED GLYPH`,t.stack);for(var m=0;m<a;m++)console.log(m,o[m].x,o[m].y)}}},$B=function(e){var t=e.prog;if(t){var n=t.length,r;for(e.ip=0;e.ip<n;e.ip++){if(exports.DEBUG&&e.step++,r=QB[t[e.ip]],!r)throw Error(`unknown instruction: 0x`+Number(t[e.ip]).toString(16));r(e)}}};function vV(e){for(var t=e.tZone=Array(e.gZone.length),n=0;n<t.length;n++)t[n]=new mV(0,0)}function yV(e,t){var n=e.prog,r=e.ip,i=1,a;do if(a=n[++r],a===88)i++;else if(a===89)i--;else if(a===64)r+=n[r+1]+1;else if(a===65)r+=2*n[r+1]+1;else if(a>=176&&a<=183)r+=a-176+1;else if(a>=184&&a<=191)r+=(a-184+1)*2;else if(t&&i===1&&a===27)break;while(i>0);e.ip=r}function bV(e,t){exports.DEBUG&&console.log(t.step,`SVTCA[`+e.axis+`]`),t.fv=t.pv=t.dpv=e}function xV(e,t){exports.DEBUG&&console.log(t.step,`SPVTCA[`+e.axis+`]`),t.pv=t.dpv=e}function SV(e,t){exports.DEBUG&&console.log(t.step,`SFVTCA[`+e.axis+`]`),t.fv=e}function CV(e,t){var n=t.stack,r=n.pop(),i=n.pop(),a=t.z2[r],o=t.z1[i];exports.DEBUG&&console.log(`SPVTL[`+e+`]`,r,i);var s,c;e?(s=a.y-o.y,c=o.x-a.x):(s=o.x-a.x,c=o.y-a.y),t.pv=t.dpv=pV(s,c)}function wV(e,t){var n=t.stack,r=n.pop(),i=n.pop(),a=t.z2[r],o=t.z1[i];exports.DEBUG&&console.log(`SFVTL[`+e+`]`,r,i);var s,c;e?(s=a.y-o.y,c=o.x-a.x):(s=o.x-a.x,c=o.y-a.y),t.fv=pV(s,c)}function TV(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`SPVFS[]`,n,r),e.pv=e.dpv=pV(r,n)}function EV(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`SPVFS[]`,n,r),e.fv=pV(r,n)}function DV(e){var t=e.stack,n=e.pv;exports.DEBUG&&console.log(e.step,`GPV[]`),t.push(n.x*16384),t.push(n.y*16384)}function OV(e){var t=e.stack,n=e.fv;exports.DEBUG&&console.log(e.step,`GFV[]`),t.push(n.x*16384),t.push(n.y*16384)}function kV(e){e.fv=e.pv,exports.DEBUG&&console.log(e.step,`SFVTPV[]`)}function AV(e){var t=e.stack,n=t.pop(),r=t.pop(),i=t.pop(),a=t.pop(),o=t.pop(),s=e.z0,c=e.z1,l=s[n],u=s[r],d=c[i],f=c[a],p=e.z2[o];exports.DEBUG&&console.log(`ISECT[], `,n,r,i,a,o);var m=l.x,h=l.y,g=u.x,_=u.y,v=d.x,y=d.y,b=f.x,x=f.y,S=(m-g)*(y-x)-(h-_)*(v-b),C=m*_-h*g,w=v*x-y*b;p.x=(C*(v-b)-w*(m-g))/S,p.y=(C*(y-x)-w*(h-_))/S}function jV(e){e.rp0=e.stack.pop(),exports.DEBUG&&console.log(e.step,`SRP0[]`,e.rp0)}function MV(e){e.rp1=e.stack.pop(),exports.DEBUG&&console.log(e.step,`SRP1[]`,e.rp1)}function NV(e){e.rp2=e.stack.pop(),exports.DEBUG&&console.log(e.step,`SRP2[]`,e.rp2)}function PV(e){var t=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,`SZP0[]`,t),e.zp0=t,t){case 0:e.tZone||vV(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw Error(`Invalid zone pointer`)}}function FV(e){var t=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,`SZP1[]`,t),e.zp1=t,t){case 0:e.tZone||vV(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw Error(`Invalid zone pointer`)}}function IV(e){var t=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,`SZP2[]`,t),e.zp2=t,t){case 0:e.tZone||vV(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw Error(`Invalid zone pointer`)}}function LV(e){var t=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,`SZPS[]`,t),e.zp0=e.zp1=e.zp2=t,t){case 0:e.tZone||vV(e),e.z0=e.z1=e.z2=e.tZone;break;case 1:e.z0=e.z1=e.z2=e.gZone;break;default:throw Error(`Invalid zone pointer`)}}function RV(e){e.loop=e.stack.pop(),exports.DEBUG&&console.log(e.step,`SLOOP[]`,e.loop)}function zV(e){exports.DEBUG&&console.log(e.step,`RTG[]`),e.round=iV}function BV(e){exports.DEBUG&&console.log(e.step,`RTHG[]`),e.round=oV}function VV(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`SMD[]`,t),e.minDis=t/64}function HV(e){exports.DEBUG&&console.log(e.step,`ELSE[]`),yV(e,!1)}function UV(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`JMPR[]`,t),e.ip+=t-1}function WV(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`SCVTCI[]`,t),e.cvCutIn=t/64}function GV(e){var t=e.stack;exports.DEBUG&&console.log(e.step,`DUP[]`),t.push(t[t.length-1])}function KV(e){exports.DEBUG&&console.log(e.step,`POP[]`),e.stack.pop()}function qV(e){exports.DEBUG&&console.log(e.step,`CLEAR[]`),e.stack.length=0}function JV(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`SWAP[]`),t.push(n),t.push(r)}function YV(e){var t=e.stack;exports.DEBUG&&console.log(e.step,`DEPTH[]`),t.push(t.length)}function XV(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`LOOPCALL[]`,n,r);var i=e.ip,a=e.prog;e.prog=e.funcs[n];for(var o=0;o<r;o++)$B(e),exports.DEBUG&&console.log(++e.step,o+1<r?`next loopcall`:`done loopcall`,o);e.ip=i,e.prog=a}function ZV(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`CALL[]`,t);var n=e.ip,r=e.prog;e.prog=e.funcs[t],$B(e),e.ip=n,e.prog=r,exports.DEBUG&&console.log(++e.step,`returning from`,t)}function QV(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`CINDEX[]`,n),t.push(t[t.length-n])}function $V(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`MINDEX[]`,n),t.push(t.splice(t.length-n,1)[0])}function eH(e){if(e.env!==`fpgm`)throw Error(`FDEF not allowed here`);var t=e.stack,n=e.prog,r=e.ip,i=t.pop(),a=r;for(exports.DEBUG&&console.log(e.step,`FDEF[]`,i);n[++r]!==45;);e.ip=r,e.funcs[i]=n.slice(a+1,r)}function tH(e,t){var n=t.stack.pop(),r=t.z0[n],i=t.fv,a=t.pv;exports.DEBUG&&console.log(t.step,`MDAP[`+e+`]`,n);var o=a.distance(r,hV);e&&(o=t.round(o)),i.setRelative(r,hV,o,a),i.touch(r),t.rp0=t.rp1=n}function nH(e,t){var n=t.z2,r=n.length-2,i,a,o;exports.DEBUG&&console.log(t.step,`IUP[`+e.axis+`]`);for(var s=0;s<r;s++)i=n[s],!e.touched(i)&&(a=i.prevTouched(e),a!==i&&(o=i.nextTouched(e),a===o&&e.setRelative(i,i,e.distance(a,a,!1,!0),e,!0),e.interpolate(i,a,o,e)))}function rH(e,t){for(var n=t.stack,r=e?t.rp1:t.rp2,i=(e?t.z0:t.z1)[r],a=t.fv,o=t.pv,s=t.loop,c=t.z2;s--;){var l=n.pop(),u=c[l],d=o.distance(i,i,!1,!0);a.setRelative(u,u,d,o),a.touch(u),exports.DEBUG&&console.log(t.step,(t.loop>1?`loop `+(t.loop-s)+`: `:``)+`SHP[`+(e?`rp1`:`rp2`)+`]`,l)}t.loop=1}function iH(e,t){var n=t.stack,r=e?t.rp1:t.rp2,i=(e?t.z0:t.z1)[r],a=t.fv,o=t.pv,s=n.pop(),c=t.z2[t.contours[s]],l=c;exports.DEBUG&&console.log(t.step,`SHC[`+e+`]`,s);var u=o.distance(i,i,!1,!0);do l!==i&&a.setRelative(l,l,u,o),l=l.nextPointOnContour;while(l!==c)}function aH(e,t){var n=t.stack,r=e?t.rp1:t.rp2,i=(e?t.z0:t.z1)[r],a=t.fv,o=t.pv,s=n.pop();exports.DEBUG&&console.log(t.step,`SHZ[`+e+`]`,s);var c;switch(s){case 0:c=t.tZone;break;case 1:c=t.gZone;break;default:throw Error(`Invalid zone`)}for(var l,u=o.distance(i,i,!1,!0),d=c.length-2,f=0;f<d;f++)l=c[f],a.setRelative(l,l,u,o)}function oH(e){for(var t=e.stack,n=e.loop,r=e.fv,i=t.pop()/64,a=e.z2;n--;){var o=t.pop(),s=a[o];exports.DEBUG&&console.log(e.step,(e.loop>1?`loop `+(e.loop-n)+`: `:``)+`SHPIX[]`,o,i),r.setRelative(s,s,i),r.touch(s)}e.loop=1}function sH(e){for(var t=e.stack,n=e.rp1,r=e.rp2,i=e.loop,a=e.z0[n],o=e.z1[r],s=e.fv,c=e.dpv,l=e.z2;i--;){var u=t.pop(),d=l[u];exports.DEBUG&&console.log(e.step,(e.loop>1?`loop `+(e.loop-i)+`: `:``)+`IP[]`,u,n,`<->`,r),s.interpolate(d,a,o,c),s.touch(d)}e.loop=1}function cH(e,t){var n=t.stack,r=n.pop()/64,i=n.pop(),a=t.z1[i],o=t.z0[t.rp0],s=t.fv,c=t.pv;s.setRelative(a,o,r,c),s.touch(a),exports.DEBUG&&console.log(t.step,`MSIRP[`+e+`]`,r,i),t.rp1=t.rp0,t.rp2=i,e&&(t.rp0=i)}function lH(e){for(var t=e.stack,n=e.rp0,r=e.z0[n],i=e.loop,a=e.fv,o=e.pv,s=e.z1;i--;){var c=t.pop(),l=s[c];exports.DEBUG&&console.log(e.step,(e.loop>1?`loop `+(e.loop-i)+`: `:``)+`ALIGNRP[]`,c),a.setRelative(l,r,0,o),a.touch(l)}e.loop=1}function uH(e){exports.DEBUG&&console.log(e.step,`RTDG[]`),e.round=aV}function dH(e,t){var n=t.stack,r=n.pop(),i=n.pop(),a=t.z0[i],o=t.fv,s=t.pv,c=t.cvt[r];exports.DEBUG&&console.log(t.step,`MIAP[`+e+`]`,r,`(`,c,`)`,i);var l=s.distance(a,hV);e&&(Math.abs(l-c)<t.cvCutIn&&(l=c),l=t.round(l)),o.setRelative(a,hV,l,s),t.zp0===0&&(a.xo=a.x,a.yo=a.y),o.touch(a),t.rp0=t.rp1=i}function fH(e){var t=e.prog,n=e.ip,r=e.stack,i=t[++n];exports.DEBUG&&console.log(e.step,`NPUSHB[]`,i);for(var a=0;a<i;a++)r.push(t[++n]);e.ip=n}function pH(e){var t=e.ip,n=e.prog,r=e.stack,i=n[++t];exports.DEBUG&&console.log(e.step,`NPUSHW[]`,i);for(var a=0;a<i;a++){var o=n[++t]<<8|n[++t];o&32768&&(o=-((o^65535)+1)),r.push(o)}e.ip=t}function mH(e){var t=e.stack,n=e.store;n||=e.store=[];var r=t.pop(),i=t.pop();exports.DEBUG&&console.log(e.step,`WS`,r,i),n[i]=r}function hH(e){var t=e.stack,n=e.store,r=t.pop();exports.DEBUG&&console.log(e.step,`RS`,r);var i=n&&n[r]||0;t.push(i)}function gH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`WCVTP`,n,r),e.cvt[r]=n/64}function _H(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`RCVT`,n),t.push(e.cvt[n]*64)}function vH(e,t){var n=t.stack,r=n.pop(),i=t.z2[r];exports.DEBUG&&console.log(t.step,`GC[`+e+`]`,r),n.push(t.dpv.distance(i,hV,e,!1)*64)}function yH(e,t){var n=t.stack,r=n.pop(),i=n.pop(),a=t.z1[r],o=t.z0[i],s=t.dpv.distance(o,a,e,e);exports.DEBUG&&console.log(t.step,`MD[`+e+`]`,r,i,`->`,s),t.stack.push(Math.round(s*64))}function bH(e){exports.DEBUG&&console.log(e.step,`MPPEM[]`),e.stack.push(e.ppem)}function xH(e){exports.DEBUG&&console.log(e.step,`FLIPON[]`),e.autoFlip=!0}function SH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`LT[]`,n,r),t.push(+(r<n))}function CH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`LTEQ[]`,n,r),t.push(+(r<=n))}function wH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`GT[]`,n,r),t.push(+(r>n))}function TH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`GTEQ[]`,n,r),t.push(+(r>=n))}function EH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`EQ[]`,n,r),t.push(+(n===r))}function DH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`NEQ[]`,n,r),t.push(n===r?0:1)}function OH(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`ODD[]`,n),t.push(Math.trunc(n)%2?1:0)}function kH(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`EVEN[]`,n),t.push(Math.trunc(n)%2?0:1)}function AH(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`IF[]`,t),t||(yV(e,!0),exports.DEBUG&&console.log(e.step,`EIF[]`))}function jH(e){exports.DEBUG&&console.log(e.step,`EIF[]`)}function MH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`AND[]`,n,r),t.push(n&&r?1:0)}function NH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`OR[]`,n,r),t.push(n||r?1:0)}function PH(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`NOT[]`,n),t.push(+!n)}function FH(e,t){var n=t.stack,r=n.pop(),i=t.fv,a=t.pv,o=t.ppem,s=t.deltaBase+(e-1)*16,c=t.deltaShift,l=t.z0;exports.DEBUG&&console.log(t.step,`DELTAP[`+e+`]`,r,n);for(var u=0;u<r;u++){var d=n.pop(),f=n.pop();if(s+((f&240)>>4)===o){var p=(f&15)-8;p>=0&&p++,exports.DEBUG&&console.log(t.step,`DELTAPFIX`,d,`by`,p*c);var m=l[d];i.setRelative(m,m,p*c,a)}}}function IH(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`SDB[]`,t),e.deltaBase=t}function LH(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`SDS[]`,t),e.deltaShift=.5**t}function RH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`ADD[]`,n,r),t.push(r+n)}function zH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`SUB[]`,n,r),t.push(r-n)}function BH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`DIV[]`,n,r),t.push(r*64/n)}function VH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`MUL[]`,n,r),t.push(r*n/64)}function HH(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`ABS[]`,n),t.push(Math.abs(n))}function UH(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`NEG[]`,n),t.push(-n)}function WH(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`FLOOR[]`,n),t.push(Math.floor(n/64)*64)}function GH(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`CEILING[]`,n),t.push(Math.ceil(n/64)*64)}function KH(e,t){var n=t.stack,r=n.pop();exports.DEBUG&&console.log(t.step,`ROUND[]`),n.push(t.round(r/64)*64)}function qH(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`WCVTF[]`,n,r),e.cvt[r]=n*e.ppem/e.font.unitsPerEm}function JH(e,t){var n=t.stack,r=n.pop(),i=t.ppem,a=t.deltaBase+(e-1)*16,o=t.deltaShift;exports.DEBUG&&console.log(t.step,`DELTAC[`+e+`]`,r,n);for(var s=0;s<r;s++){var c=n.pop(),l=n.pop();if(a+((l&240)>>4)===i){var u=(l&15)-8;u>=0&&u++;var d=u*o;exports.DEBUG&&console.log(t.step,`DELTACFIX`,c,`by`,d),t.cvt[c]+=d}}}function YH(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`SROUND[]`,t),e.round=lV;var n;switch(t&192){case 0:n=.5;break;case 64:n=1;break;case 128:n=2;break;default:throw Error(`invalid SROUND value`)}switch(e.srPeriod=n,t&48){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*n;break;case 32:e.srPhase=.5*n;break;case 48:e.srPhase=.75*n;break;default:throw Error(`invalid SROUND value`)}t&=15,t===0?e.srThreshold=0:e.srThreshold=(t/8-.5)*n}function XH(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`S45ROUND[]`,t),e.round=lV;var n;switch(t&192){case 0:n=Math.sqrt(2)/2;break;case 64:n=Math.sqrt(2);break;case 128:n=2*Math.sqrt(2);break;default:throw Error(`invalid S45ROUND value`)}switch(e.srPeriod=n,t&48){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*n;break;case 32:e.srPhase=.5*n;break;case 48:e.srPhase=.75*n;break;default:throw Error(`invalid S45ROUND value`)}t&=15,t===0?e.srThreshold=0:e.srThreshold=(t/8-.5)*n}function ZH(e){exports.DEBUG&&console.log(e.step,`ROFF[]`),e.round=rV}function QH(e){exports.DEBUG&&console.log(e.step,`RUTG[]`),e.round=sV}function $H(e){exports.DEBUG&&console.log(e.step,`RDTG[]`),e.round=cV}function eU(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`SCANCTRL[]`,t)}function tU(e,t){var n=t.stack,r=n.pop(),i=n.pop(),a=t.z2[r],o=t.z1[i];exports.DEBUG&&console.log(t.step,`SDPVTL[`+e+`]`,r,i);var s,c;e?(s=a.y-o.y,c=o.x-a.x):(s=o.x-a.x,c=o.y-a.y),t.dpv=pV(s,c)}function nU(e){var t=e.stack,n=t.pop(),r=0;exports.DEBUG&&console.log(e.step,`GETINFO[]`,n),n&1&&(r=35),n&32&&(r|=4096),t.push(r)}function rU(e){var t=e.stack,n=t.pop(),r=t.pop(),i=t.pop();exports.DEBUG&&console.log(e.step,`ROLL[]`),t.push(r),t.push(n),t.push(i)}function iU(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`MAX[]`,n,r),t.push(Math.max(r,n))}function aU(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`MIN[]`,n,r),t.push(Math.min(r,n))}function oU(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`SCANTYPE[]`,t)}function sU(e){var t=e.stack.pop(),n=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,`INSTCTRL[]`,t,n),t){case 1:e.inhibitGridFit=!!n;return;case 2:e.ignoreCvt=!!n;return;default:throw Error(`invalid INSTCTRL[] selector`)}}function cU(e,t){var n=t.stack,r=t.prog,i=t.ip;exports.DEBUG&&console.log(t.step,`PUSHB[`+e+`]`);for(var a=0;a<e;a++)n.push(r[++i]);t.ip=i}function lU(e,t){var n=t.ip,r=t.prog,i=t.stack;exports.DEBUG&&console.log(t.ip,`PUSHW[`+e+`]`);for(var a=0;a<e;a++){var o=r[++n]<<8|r[++n];o&32768&&(o=-((o^65535)+1)),i.push(o)}t.ip=n}function Q(e,t,n,r,i,a){var o=a.stack,s=e&&o.pop(),c=o.pop(),l=a.rp0,u=a.z0[l],d=a.z1[c],f=a.minDis,p=a.fv,m=a.dpv,h,g=h=m.distance(d,u,!0,!0),_=g>=0?1:-1,v;g=Math.abs(g),e&&(v=a.cvt[s],r&&Math.abs(g-v)<a.cvCutIn&&(g=v)),n&&g<f&&(g=f),r&&(g=a.round(g)),p.setRelative(d,u,_*g,m),p.touch(d),exports.DEBUG&&console.log(a.step,(e?`MIRP[`:`MDRP[`)+(t?`M`:`m`)+(n?`>`:`_`)+(r?`R`:`_`)+(i===0?`Gr`:i===1?`Bl`:i===2?`Wh`:``)+`]`,e?s+`(`+a.cvt[s]+`,`+v+`)`:``,c,`(d =`,h,`->`,_*g,`)`),a.rp1=a.rp0,a.rp2=c,t&&(a.rp0=c)}QB=[bV.bind(void 0,dV),bV.bind(void 0,uV),xV.bind(void 0,dV),xV.bind(void 0,uV),SV.bind(void 0,dV),SV.bind(void 0,uV),CV.bind(void 0,0),CV.bind(void 0,1),wV.bind(void 0,0),wV.bind(void 0,1),TV,EV,DV,OV,kV,AV,jV,MV,NV,PV,FV,IV,LV,RV,zV,BV,VV,HV,UV,WV,void 0,void 0,GV,KV,qV,JV,YV,QV,$V,void 0,void 0,void 0,XV,ZV,eH,void 0,tH.bind(void 0,0),tH.bind(void 0,1),nH.bind(void 0,dV),nH.bind(void 0,uV),rH.bind(void 0,0),rH.bind(void 0,1),iH.bind(void 0,0),iH.bind(void 0,1),aH.bind(void 0,0),aH.bind(void 0,1),oH,sH,cH.bind(void 0,0),cH.bind(void 0,1),lH,uH,dH.bind(void 0,0),dH.bind(void 0,1),fH,pH,mH,hH,gH,_H,vH.bind(void 0,0),vH.bind(void 0,1),void 0,yH.bind(void 0,0),yH.bind(void 0,1),bH,void 0,xH,void 0,void 0,SH,CH,wH,TH,EH,DH,OH,kH,AH,jH,MH,NH,PH,FH.bind(void 0,1),IH,LH,RH,zH,BH,VH,HH,UH,WH,GH,KH.bind(void 0,0),KH.bind(void 0,1),KH.bind(void 0,2),KH.bind(void 0,3),void 0,void 0,void 0,void 0,qH,FH.bind(void 0,2),FH.bind(void 0,3),JH.bind(void 0,1),JH.bind(void 0,2),JH.bind(void 0,3),YH,XH,void 0,void 0,ZH,void 0,QH,$H,KV,KV,void 0,void 0,void 0,void 0,void 0,eU,tU.bind(void 0,0),tU.bind(void 0,1),nU,void 0,rU,iU,aU,oU,sU,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,cU.bind(void 0,1),cU.bind(void 0,2),cU.bind(void 0,3),cU.bind(void 0,4),cU.bind(void 0,5),cU.bind(void 0,6),cU.bind(void 0,7),cU.bind(void 0,8),lU.bind(void 0,1),lU.bind(void 0,2),lU.bind(void 0,3),lU.bind(void 0,4),lU.bind(void 0,5),lU.bind(void 0,6),lU.bind(void 0,7),lU.bind(void 0,8),Q.bind(void 0,0,0,0,0,0),Q.bind(void 0,0,0,0,0,1),Q.bind(void 0,0,0,0,0,2),Q.bind(void 0,0,0,0,0,3),Q.bind(void 0,0,0,0,1,0),Q.bind(void 0,0,0,0,1,1),Q.bind(void 0,0,0,0,1,2),Q.bind(void 0,0,0,0,1,3),Q.bind(void 0,0,0,1,0,0),Q.bind(void 0,0,0,1,0,1),Q.bind(void 0,0,0,1,0,2),Q.bind(void 0,0,0,1,0,3),Q.bind(void 0,0,0,1,1,0),Q.bind(void 0,0,0,1,1,1),Q.bind(void 0,0,0,1,1,2),Q.bind(void 0,0,0,1,1,3),Q.bind(void 0,0,1,0,0,0),Q.bind(void 0,0,1,0,0,1),Q.bind(void 0,0,1,0,0,2),Q.bind(void 0,0,1,0,0,3),Q.bind(void 0,0,1,0,1,0),Q.bind(void 0,0,1,0,1,1),Q.bind(void 0,0,1,0,1,2),Q.bind(void 0,0,1,0,1,3),Q.bind(void 0,0,1,1,0,0),Q.bind(void 0,0,1,1,0,1),Q.bind(void 0,0,1,1,0,2),Q.bind(void 0,0,1,1,0,3),Q.bind(void 0,0,1,1,1,0),Q.bind(void 0,0,1,1,1,1),Q.bind(void 0,0,1,1,1,2),Q.bind(void 0,0,1,1,1,3),Q.bind(void 0,1,0,0,0,0),Q.bind(void 0,1,0,0,0,1),Q.bind(void 0,1,0,0,0,2),Q.bind(void 0,1,0,0,0,3),Q.bind(void 0,1,0,0,1,0),Q.bind(void 0,1,0,0,1,1),Q.bind(void 0,1,0,0,1,2),Q.bind(void 0,1,0,0,1,3),Q.bind(void 0,1,0,1,0,0),Q.bind(void 0,1,0,1,0,1),Q.bind(void 0,1,0,1,0,2),Q.bind(void 0,1,0,1,0,3),Q.bind(void 0,1,0,1,1,0),Q.bind(void 0,1,0,1,1,1),Q.bind(void 0,1,0,1,1,2),Q.bind(void 0,1,0,1,1,3),Q.bind(void 0,1,1,0,0,0),Q.bind(void 0,1,1,0,0,1),Q.bind(void 0,1,1,0,0,2),Q.bind(void 0,1,1,0,0,3),Q.bind(void 0,1,1,0,1,0),Q.bind(void 0,1,1,0,1,1),Q.bind(void 0,1,1,0,1,2),Q.bind(void 0,1,1,0,1,3),Q.bind(void 0,1,1,1,0,0),Q.bind(void 0,1,1,1,0,1),Q.bind(void 0,1,1,1,0,2),Q.bind(void 0,1,1,1,0,3),Q.bind(void 0,1,1,1,1,0),Q.bind(void 0,1,1,1,1,1),Q.bind(void 0,1,1,1,1,2),Q.bind(void 0,1,1,1,1,3)];function uU(e){this.char=e,this.state={},this.activeState=null}function dU(e,t,n){this.contextName=n,this.startIndex=e,this.endOffset=t}function fU(e,t,n){this.contextName=e,this.openRange=null,this.ranges=[],this.checkStart=t,this.checkEnd=n}function pU(e,t){this.context=e,this.index=t,this.length=e.length,this.current=e[t],this.backtrack=e.slice(0,t),this.lookahead=e.slice(t+1)}function mU(e){this.eventId=e,this.subscribers=[]}function hU(e){var t=this,n=[`start`,`end`,`next`,`newToken`,`contextStart`,`contextEnd`,`insertToken`,`removeToken`,`removeRange`,`replaceToken`,`replaceRange`,`composeRUD`,`updateContextsRanges`];n.forEach(function(e){Object.defineProperty(t.events,e,{value:new mU(e)})}),e&&n.forEach(function(n){var r=e[n];typeof r==`function`&&t.events[n].subscribe(r)}),[`insertToken`,`removeToken`,`removeRange`,`replaceToken`,`replaceRange`,`composeRUD`].forEach(function(e){t.events[e].subscribe(t.updateContextsRanges)})}function gU(e){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],hU.call(this,e)}uU.prototype.setState=function(e,t){return this.state[e]=t,this.activeState={key:e,value:this.state[e]},this.activeState},uU.prototype.getState=function(e){return this.state[e]||null},gU.prototype.inboundIndex=function(e){return e>=0&&e<this.tokens.length},gU.prototype.composeRUD=function(e){var t=this,n=!0,r=e.map(function(e){return t[e[0]].apply(t,e.slice(1).concat(n))}),i=function(e){return typeof e==`object`&&e.hasOwnProperty(`FAIL`)};if(r.every(i))return{FAIL:`composeRUD: one or more operations hasn't completed successfully`,report:r.filter(i)};this.dispatch(`composeRUD`,[r.filter(function(e){return!i(e)})])},gU.prototype.replaceRange=function(e,t,n,r){t=t===null?this.tokens.length:t;var i=n.every(function(e){return e instanceof uU});if(!isNaN(e)&&this.inboundIndex(e)&&i){var a=this.tokens.splice.apply(this.tokens,[e,t].concat(n));return r||this.dispatch(`replaceToken`,[e,t,n]),[a,n]}else return{FAIL:`replaceRange: invalid tokens or startIndex.`}},gU.prototype.replaceToken=function(e,t,n){if(!isNaN(e)&&this.inboundIndex(e)&&t instanceof uU){var r=this.tokens.splice(e,1,t);return n||this.dispatch(`replaceToken`,[e,t]),[r[0],t]}else return{FAIL:`replaceToken: invalid token or index.`}},gU.prototype.removeRange=function(e,t,n){t=isNaN(t)?this.tokens.length:t;var r=this.tokens.splice(e,t);return n||this.dispatch(`removeRange`,[r,e,t]),r},gU.prototype.removeToken=function(e,t){if(!isNaN(e)&&this.inboundIndex(e)){var n=this.tokens.splice(e,1);return t||this.dispatch(`removeToken`,[n,e]),n}else return{FAIL:`removeToken: invalid token index.`}},gU.prototype.insertToken=function(e,t,n){return e.every(function(e){return e instanceof uU})?(this.tokens.splice.apply(this.tokens,[t,0].concat(e)),n||this.dispatch(`insertToken`,[e,t]),e):{FAIL:`insertToken: invalid token(s).`}},gU.prototype.registerModifier=function(e,t,n){this.events.newToken.subscribe(function(r,i){var a=[r,i],o=t===null||t.apply(this,a)===!0,s=[r,i];if(o){var c=n.apply(this,s);r.setState(e,c)}}),this.registeredModifiers.push(e)},mU.prototype.subscribe=function(e){return typeof e==`function`?this.subscribers.push(e)-1:{FAIL:`invalid '`+this.eventId+`' event handler`}},mU.prototype.unsubscribe=function(e){this.subscribers.splice(e,1)},pU.prototype.setCurrentIndex=function(e){this.index=e,this.current=this.context[e],this.backtrack=this.context.slice(0,e),this.lookahead=this.context.slice(e+1)},pU.prototype.get=function(e){switch(!0){case e===0:return this.current;case e<0&&Math.abs(e)<=this.backtrack.length:return this.backtrack.slice(e)[0];case e>0&&e<=this.lookahead.length:return this.lookahead[e-1];default:return null}},gU.prototype.rangeToText=function(e){if(e instanceof dU)return this.getRangeTokens(e).map(function(e){return e.char}).join(``)},gU.prototype.getText=function(){return this.tokens.map(function(e){return e.char}).join(``)},gU.prototype.getContext=function(e){return this.registeredContexts[e]||null},gU.prototype.on=function(e,t){var n=this.events[e];return n?n.subscribe(t):null},gU.prototype.dispatch=function(e,t){var n=this,r=this.events[e];r instanceof mU&&r.subscribers.forEach(function(e){e.apply(n,t||[])})},gU.prototype.registerContextChecker=function(e,t,n){if(this.getContext(e))return{FAIL:`context name '`+e+`' is already registered.`};if(typeof t!=`function`)return{FAIL:`missing context start check.`};if(typeof n!=`function`)return{FAIL:`missing context end check.`};var r=new fU(e,t,n);return this.registeredContexts[e]=r,this.contextCheckers.push(r),r},gU.prototype.getRangeTokens=function(e){var t=e.startIndex+e.endOffset;return[].concat(this.tokens.slice(e.startIndex,t))},gU.prototype.getContextRanges=function(e){var t=this.getContext(e);return t?t.ranges:{FAIL:`context checker '`+e+`' is not registered.`}},gU.prototype.resetContextsRanges=function(){var e=this.registeredContexts;for(var t in e)if(e.hasOwnProperty(t)){var n=e[t];n.ranges=[]}},gU.prototype.updateContextsRanges=function(){this.resetContextsRanges();for(var e=this.tokens.map(function(e){return e.char}),t=0;t<e.length;t++){var n=new pU(e,t);this.runContextCheck(n)}this.dispatch(`updateContextsRanges`,[this.registeredContexts])},gU.prototype.setEndOffset=function(e,t){var n=this.getContext(t).openRange.startIndex,r=new dU(n,e,t),i=this.getContext(t).ranges;return r.rangeId=t+`.`+i.length,i.push(r),this.getContext(t).openRange=null,r},gU.prototype.runContextCheck=function(e){var t=this,n=e.index;this.contextCheckers.forEach(function(r){var i=r.contextName,a=t.getContext(i).openRange;if(!a&&r.checkStart(e)&&(a=new dU(n,null,i),t.getContext(i).openRange=a,t.dispatch(`contextStart`,[i,n])),a&&r.checkEnd(e)){var o=n-a.startIndex+1,s=t.setEndOffset(o,i);t.dispatch(`contextEnd`,[i,s])}})},gU.prototype.tokenize=function(e){this.tokens=[],this.resetContextsRanges();var t=Array.from(e);this.dispatch(`start`);for(var n=0;n<t.length;n++){var r=t[n],i=new pU(t,n);this.dispatch(`next`,[i]),this.runContextCheck(i);var a=new uU(r);this.tokens.push(a),this.dispatch(`newToken`,[a,i])}return this.dispatch(`end`,[this.tokens]),this.tokens};function _U(e){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(e)}function vU(e){return/[\u0630\u0690\u0621\u0631\u0661\u0671\u0622\u0632\u0672\u0692\u06C2\u0623\u0673\u0693\u06C3\u0624\u0694\u06C4\u0625\u0675\u0695\u06C5\u06E5\u0676\u0696\u06C6\u0627\u0677\u0697\u06C7\u0648\u0688\u0698\u06C8\u0689\u0699\u06C9\u068A\u06CA\u066B\u068B\u06CB\u068C\u068D\u06CD\u06FD\u068E\u06EE\u06FE\u062F\u068F\u06CF\u06EF]/.test(e)}function yU(e){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(e)}function bU(e){return/[A-z]/.test(e)}function xU(e){return/\s/.test(e)}function SU(e){this.font=e,this.features={}}function CU(e){this.id=e.id,this.tag=e.tag,this.substitution=e.substitution}function wU(e,t){if(!e)return-1;switch(t.format){case 1:return t.glyphs.indexOf(e);case 2:for(var n=t.ranges,r=0;r<n.length;r++){var i=n[r];if(e>=i.start&&e<=i.end){var a=e-i.start;return i.index+a}}break;default:return-1}return-1}function TU(e,t){return wU(e,t.coverage)===-1?null:e+t.deltaGlyphId}function EU(e,t){var n=wU(e,t.coverage);return n===-1?null:t.substitute[n]}function DU(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=t.current;a=Array.isArray(a)?a[0]:a;var o=wU(a,i);o!==-1&&n.push(o)}return n.length===e.length?n:-1}function OU(e,t){var n=t.inputCoverage.length+t.lookaheadCoverage.length+t.backtrackCoverage.length;if(e.context.length<n)return[];var r=DU(t.inputCoverage,e);if(r===-1)return[];var i=t.inputCoverage.length-1;if(e.lookahead.length<t.lookaheadCoverage.length)return[];for(var a=e.lookahead.slice(i);a.length&&yU(a[0].char);)a.shift();var o=new pU(a,0),s=DU(t.lookaheadCoverage,o),c=[].concat(e.backtrack);for(c.reverse();c.length&&yU(c[0].char);)c.shift();if(c.length<t.backtrackCoverage.length)return[];var l=new pU(c,0),u=DU(t.backtrackCoverage,l),d=r.length===t.inputCoverage.length&&s.length===t.lookaheadCoverage.length&&u.length===t.backtrackCoverage.length,f=[];if(d)for(var p=0;p<t.lookupRecords.length;p++)for(var m=t.lookupRecords[p].lookupListIndex,h=this.getLookupByIndex(m),g=0;g<h.subtables.length;g++){var _=h.subtables[g],v=this.getLookupMethod(h,_);if(this.getSubstitutionType(h,_)===`12`)for(var y=0;y<r.length;y++){var b=v(e.get(y));b&&f.push(b)}}return f}function kU(e,t){var n=e.current,r=wU(n,t.coverage);if(r===-1)return null;for(var i,a=t.ligatureSets[r],o=0;o<a.length;o++){i=a[o];for(var s=0;s<i.components.length&&e.lookahead[s]===i.components[s];s++)if(s===i.components.length-1)return i}return null}function AU(e,t){var n=wU(e,t.coverage);return n===-1?null:t.sequences[n]}SU.prototype.getDefaultScriptFeaturesIndexes=function(){for(var e=this.font.tables.gsub.scripts,t=0;t<e.length;t++){var n=e[t];if(n.tag===`DFLT`)return n.script.defaultLangSys.featureIndexes}return[]},SU.prototype.getScriptFeaturesIndexes=function(e){if(!this.font.tables.gsub)return[];if(!e)return this.getDefaultScriptFeaturesIndexes();for(var t=this.font.tables.gsub.scripts,n=0;n<t.length;n++){var r=t[n];if(r.tag===e&&r.script.defaultLangSys)return r.script.defaultLangSys.featureIndexes;var i=r.langSysRecords;if(i)for(var a=0;a<i.length;a++){var o=i[a];if(o.tag===e)return o.langSys.featureIndexes}}return this.getDefaultScriptFeaturesIndexes()},SU.prototype.mapTagsToFeatures=function(e,t){for(var n={},r=0;r<e.length;r++){var i=e[r].tag;n[i]=e[r].feature}this.features[t].tags=n},SU.prototype.getScriptFeatures=function(e){var t=this.features[e];if(this.features.hasOwnProperty(e))return t;var n=this.getScriptFeaturesIndexes(e);if(!n)return null;var r=this.font.tables.gsub;return t=n.map(function(e){return r.features[e]}),this.features[e]=t,this.mapTagsToFeatures(t,e),t},SU.prototype.getSubstitutionType=function(e,t){return e.lookupType.toString()+t.substFormat.toString()},SU.prototype.getLookupMethod=function(e,t){var n=this;switch(this.getSubstitutionType(e,t)){case`11`:return function(e){return TU.apply(n,[e,t])};case`12`:return function(e){return EU.apply(n,[e,t])};case`63`:return function(e){return OU.apply(n,[e,t])};case`41`:return function(e){return kU.apply(n,[e,t])};case`21`:return function(e){return AU.apply(n,[e,t])};default:throw Error(`lookupType: `+e.lookupType+` - substFormat: `+t.substFormat+` is not yet supported`)}},SU.prototype.lookupFeature=function(e){var t=e.contextParams,n=t.index,r=this.getFeature({tag:e.tag,script:e.script});if(!r)return Error(`font '`+this.font.names.fullName.en+`' doesn't support feature '`+e.tag+`' for script '`+e.script+`'.`);for(var i=this.getFeatureLookups(r),a=[].concat(t.context),o=0;o<i.length;o++)for(var s=i[o],c=this.getLookupSubtables(s),l=0;l<c.length;l++){var u=c[l],d=this.getSubstitutionType(s,u),f=this.getLookupMethod(s,u),p=void 0;switch(d){case`11`:p=f(t.current),p&&a.splice(n,1,new CU({id:11,tag:e.tag,substitution:p}));break;case`12`:p=f(t.current),p&&a.splice(n,1,new CU({id:12,tag:e.tag,substitution:p}));break;case`63`:p=f(t),Array.isArray(p)&&p.length&&a.splice(n,1,new CU({id:63,tag:e.tag,substitution:p}));break;case`41`:p=f(t),p&&a.splice(n,1,new CU({id:41,tag:e.tag,substitution:p}));break;case`21`:p=f(t.current),p&&a.splice(n,1,new CU({id:21,tag:e.tag,substitution:p}));break}t=new pU(a,n),!(Array.isArray(p)&&!p.length)&&(p=null)}return a.length?a:null},SU.prototype.supports=function(e){if(!e.script)return!1;this.getScriptFeatures(e.script);var t=this.features.hasOwnProperty(e.script);if(!e.tag)return t;var n=this.features[e.script].some(function(t){return t.tag===e.tag});return t&&n},SU.prototype.getLookupSubtables=function(e){return e.subtables||null},SU.prototype.getLookupByIndex=function(e){return this.font.tables.gsub.lookups[e]||null},SU.prototype.getFeatureLookups=function(e){return e.lookupListIndexes.map(this.getLookupByIndex.bind(this))},SU.prototype.getFeature=function(e){if(!this.font)return{FAIL:`No font was found`};this.features.hasOwnProperty(e.script)||this.getScriptFeatures(e.script);var t=this.features[e.script];return t?t.tags[e.tag]?this.features[e.script].tags[e.tag]:null:{FAIL:`No feature for script `+e.script}};function jU(e){var t=e.current,n=e.get(-1);return n===null&&_U(t)||!_U(n)&&_U(t)}function MU(e){var t=e.get(1);return t===null||!_U(t)}var NU={startCheck:jU,endCheck:MU};function PU(e){var t=e.current,n=e.get(-1);return(_U(t)||yU(t))&&!_U(n)}function FU(e){var t=e.get(1);switch(!0){case t===null:return!0;case!_U(t)&&!yU(t):var n=xU(t);if(!n)return!0;if(n){var r=!1;if(r=e.lookahead.some(function(e){return _U(e)||yU(e)}),!r)return!0}break;default:return!1}}var IU={startCheck:PU,endCheck:FU};function LU(e,t,n){t[n].setState(e.tag,e.substitution)}function RU(e,t,n){t[n].setState(e.tag,e.substitution)}function zU(e,t,n){e.substitution.forEach(function(r,i){t[n+i].setState(e.tag,r)})}function BU(e,t,n){var r=t[n];r.setState(e.tag,e.substitution.ligGlyph);for(var i=e.substitution.components.length,a=0;a<i;a++)r=t[n+a+1],r.setState(`deleted`,!0)}var VU={11:LU,12:RU,63:zU,41:BU};function HU(e,t,n){e instanceof CU&&VU[e.id]&&VU[e.id](e,t,n)}function UU(e){for(var t=[].concat(e.backtrack),n=t.length-1;n>=0;n--){var r=t[n],i=vU(r),a=yU(r);if(!i&&!a)return!0;if(i)return!1}return!1}function WU(e){if(vU(e.current))return!1;for(var t=0;t<e.lookahead.length;t++){var n=e.lookahead[t];if(!yU(n))return!0}return!1}function GU(e){var t=this,n=`arab`,r=this.featuresTags[n],i=this.tokenizer.getRangeTokens(e);if(i.length!==1){var a=new pU(i.map(function(e){return e.getState(`glyphIndex`)}),0),o=new pU(i.map(function(e){return e.char}),0);i.forEach(function(e,s){if(!yU(e.char)){a.setCurrentIndex(s),o.setCurrentIndex(s);var c=0;UU(o)&&(c|=1),WU(o)&&(c|=2);var l;switch(c){case 1:l=`fina`;break;case 2:l=`init`;break;case 3:l=`medi`;break}if(r.indexOf(l)!==-1){var u=t.query.lookupFeature({tag:l,script:n,contextParams:a});if(u instanceof Error)return console.info(u.message);u.forEach(function(e,t){e instanceof CU&&(HU(e,i,t),a.context[t]=e.substitution)})}}})}}function KU(e,t){return new pU(e.map(function(e){return e.activeState.value}),t||0)}function qU(e){var t=this,n=`arab`,r=this.tokenizer.getRangeTokens(e),i=KU(r);i.context.forEach(function(e,a){i.setCurrentIndex(a);var o=t.query.lookupFeature({tag:`rlig`,script:n,contextParams:i});o.length&&(o.forEach(function(e){return HU(e,r,a)}),i=KU(r))})}function JU(e){var t=e.current,n=e.get(-1);return n===null&&bU(t)||!bU(n)&&bU(t)}function YU(e){var t=e.get(1);return t===null||!bU(t)}var XU={startCheck:JU,endCheck:YU};function ZU(e,t){return new pU(e.map(function(e){return e.activeState.value}),t||0)}function QU(e){var t=this,n=`latn`,r=this.tokenizer.getRangeTokens(e),i=ZU(r);i.context.forEach(function(e,a){i.setCurrentIndex(a);var o=t.query.lookupFeature({tag:`liga`,script:n,contextParams:i});o.length&&(o.forEach(function(e){return HU(e,r,a)}),i=ZU(r))})}function $U(e){this.baseDir=e||`ltr`,this.tokenizer=new gU,this.featuresTags={}}$U.prototype.setText=function(e){this.text=e},$U.prototype.contextChecks={latinWordCheck:XU,arabicWordCheck:NU,arabicSentenceCheck:IU};function eW(e){var t=this.contextChecks[e+`Check`];return this.tokenizer.registerContextChecker(e,t.startCheck,t.endCheck)}function tW(){return eW.call(this,`latinWord`),eW.call(this,`arabicWord`),eW.call(this,`arabicSentence`),this.tokenizer.tokenize(this.text)}function nW(){var e=this;this.tokenizer.getContextRanges(`arabicSentence`).forEach(function(t){var n=e.tokenizer.getRangeTokens(t);e.tokenizer.replaceRange(t.startIndex,t.endOffset,n.reverse())})}$U.prototype.registerFeatures=function(e,t){var n=this,r=t.filter(function(t){return n.query.supports({script:e,tag:t})});this.featuresTags.hasOwnProperty(e)?this.featuresTags[e]=this.featuresTags[e].concat(r):this.featuresTags[e]=r},$U.prototype.applyFeatures=function(e,t){if(!e)throw Error(`No valid font was provided to apply features`);this.query||=new SU(e);for(var n=0;n<t.length;n++){var r=t[n];this.query.supports({script:r.script})&&this.registerFeatures(r.script,r.tags)}},$U.prototype.registerModifier=function(e,t,n){this.tokenizer.registerModifier(e,t,n)};function rW(){if(this.tokenizer.registeredModifiers.indexOf(`glyphIndex`)===-1)throw Error(`glyphIndex modifier is required to apply arabic presentation features.`)}function iW(){var e=this;this.featuresTags.hasOwnProperty(`arab`)&&(rW.call(this),this.tokenizer.getContextRanges(`arabicWord`).forEach(function(t){GU.call(e,t)}))}function aW(){var e=this,t=`arab`;this.featuresTags.hasOwnProperty(t)&&this.featuresTags[t].indexOf(`rlig`)!==-1&&(rW.call(this),this.tokenizer.getContextRanges(`arabicWord`).forEach(function(t){qU.call(e,t)}))}function oW(){var e=this,t=`latn`;this.featuresTags.hasOwnProperty(t)&&this.featuresTags[t].indexOf(`liga`)!==-1&&(rW.call(this),this.tokenizer.getContextRanges(`latinWord`).forEach(function(t){QU.call(e,t)}))}$U.prototype.checkContextReady=function(e){return!!this.tokenizer.getContext(e)},$U.prototype.applyFeaturesToContexts=function(){this.checkContextReady(`arabicWord`)&&(iW.call(this),aW.call(this)),this.checkContextReady(`latinWord`)&&oW.call(this),this.checkContextReady(`arabicSentence`)&&nW.call(this)},$U.prototype.processText=function(e){(!this.text||this.text!==e)&&(this.setText(e),tW.call(this),this.applyFeaturesToContexts())},$U.prototype.getBidiText=function(e){return this.processText(e),this.tokenizer.getText()},$U.prototype.getTextGlyphs=function(e){this.processText(e);for(var t=[],n=0;n<this.tokenizer.tokens.length;n++){var r=this.tokenizer.tokens[n];if(!r.state.deleted){var i=r.activeState.value;t.push(Array.isArray(i)?i[0]:i)}}return t};function sW(e){e||={},e.tables=e.tables||{},e.empty||(VB(e.familyName,`When creating a new Font object, familyName is required.`),VB(e.styleName,`When creating a new Font object, styleName is required.`),VB(e.unitsPerEm,`When creating a new Font object, unitsPerEm is required.`),VB(e.ascender,`When creating a new Font object, ascender is required.`),VB(e.descender<=0,`When creating a new Font object, negative descender value is required.`),this.names={fontFamily:{en:e.familyName||` `},fontSubfamily:{en:e.styleName||` `},fullName:{en:e.fullName||e.familyName+` `+e.styleName},postScriptName:{en:e.postScriptName||(e.familyName+e.styleName).replace(/\s/g,``)},designer:{en:e.designer||` `},designerURL:{en:e.designerURL||` `},manufacturer:{en:e.manufacturer||` `},manufacturerURL:{en:e.manufacturerURL||` `},license:{en:e.license||` `},licenseURL:{en:e.licenseURL||` `},version:{en:e.version||`Version 0.1`},description:{en:e.description||` `},copyright:{en:e.copyright||` `},trademark:{en:e.trademark||` `}},this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.tables=Object.assign(e.tables,{os2:Object.assign({usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,fsSelection:e.fsSelection||this.fsSelectionValues.REGULAR},e.tables.os2)})),this.supported=!0,this.glyphs=new UR.GlyphSet(this,e.glyphs||[]),this.encoding=new DR(this),this.position=new PB(this),this.substitution=new FB(this),this.tables=this.tables||{},this._push=null,this._hmtxTableData={},Object.defineProperty(this,"hinting",{get:function(){if(this._hinting)return this._hinting;if(this.outlinesFormat===`truetype`)return this._hinting=new nV(this)}})}sW.prototype.hasChar=function(e){return this.encoding.charToGlyphIndex(e)!==null},sW.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},sW.prototype.charToGlyph=function(e){var t=this.charToGlyphIndex(e),n=this.glyphs.get(t);return n||=this.glyphs.get(0),n},sW.prototype.updateFeatures=function(e){return this.defaultRenderOptions.features.map(function(t){return t.script===`latn`?{script:`latn`,tags:t.tags.filter(function(t){return e[t]})}:t})},sW.prototype.stringToGlyphs=function(e,t){var n=this,r=new $U;r.registerModifier(`glyphIndex`,null,function(e){return n.charToGlyphIndex(e.char)});var i=t?this.updateFeatures(t.features):this.defaultRenderOptions.features;r.applyFeatures(this,i);for(var a=r.getTextGlyphs(e),o=a.length,s=Array(o),c=this.glyphs.get(0),l=0;l<o;l+=1)s[l]=this.glyphs.get(a[l])||c;return s},sW.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)},sW.prototype.nameToGlyph=function(e){var t=this.nameToGlyphIndex(e),n=this.glyphs.get(t);return n||=this.glyphs.get(0),n},sW.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):``},sW.prototype.getKerningValue=function(e,t){e=e.index||e,t=t.index||t;var n=this.position.defaultKerningTables;return n?this.position.getKerningValue(n,e,t):this.kerningPairs[e+`,`+t]||0},sW.prototype.defaultRenderOptions={kerning:!0,features:[{script:`arab`,tags:[`init`,`medi`,`fina`,`rlig`]},{script:`latn`,tags:[`liga`,`rlig`]}]},sW.prototype.forEachGlyph=function(e,t,n,r,i,a){t=t===void 0?0:t,n=n===void 0?0:n,r=r===void 0?72:r,i=Object.assign({},this.defaultRenderOptions,i);var o=1/this.unitsPerEm*r,s=this.stringToGlyphs(e,i),c;if(i.kerning){var l=i.script||this.position.getDefaultScriptName();c=this.position.getKerningTables(l,i.language)}for(var u=0;u<s.length;u+=1){var d=s[u];if(a.call(this,d,t,n,r,i),d.advanceWidth&&(t+=d.advanceWidth*o),i.kerning&&u<s.length-1){var f=c?this.position.getKerningValue(c,d.index,s[u+1].index):this.getKerningValue(d,s[u+1]);t+=f*o}i.letterSpacing?t+=i.letterSpacing*r:i.tracking&&(t+=i.tracking/1e3*r)}return t},sW.prototype.getPath=function(e,t,n,r,i){var a=new FL;return this.forEachGlyph(e,t,n,r,i,function(e,t,n,r){var o=e.getPath(t,n,r,i,this);a.extend(o)}),a},sW.prototype.getPaths=function(e,t,n,r,i){var a=[];return this.forEachGlyph(e,t,n,r,i,function(e,t,n,r){var o=e.getPath(t,n,r,i,this);a.push(o)}),a},sW.prototype.getAdvanceWidth=function(e,t,n){return this.forEachGlyph(e,0,0,t,n,function(){})},sW.prototype.draw=function(e,t,n,r,i,a){this.getPath(t,n,r,i,a).draw(e)},sW.prototype.drawPoints=function(e,t,n,r,i,a){this.forEachGlyph(t,n,r,i,a,function(t,n,r,i){t.drawPoints(e,n,r,i)})},sW.prototype.drawMetrics=function(e,t,n,r,i,a){this.forEachGlyph(t,n,r,i,a,function(t,n,r,i){t.drawMetrics(e,n,r,i)})},sW.prototype.getEnglishName=function(e){var t=this.names[e];if(t)return t.en},sW.prototype.validate=function(){var e=this;function t(t){var n=e.getEnglishName(t);n&&n.trim().length}t(`fontFamily`),t(`weightName`),t(`manufacturer`),t(`copyright`),t(`version`),this.unitsPerEm},sW.prototype.toTables=function(){return kB.fontToTable(this)},sW.prototype.toBuffer=function(){return console.warn(`Font.toBuffer is deprecated. Use Font.toArrayBuffer instead.`),this.toArrayBuffer()},sW.prototype.toArrayBuffer=function(){for(var e=this.toTables().encode(),t=new ArrayBuffer(e.length),n=new Uint8Array(t),r=0;r<e.length;r++)n[r]=e[r];return t},sW.prototype.download=function(e){var t=this.getEnglishName(`fontFamily`),n=this.getEnglishName(`fontSubfamily`);e||=t.replace(/\s/g,``)+`-`+n+`.otf`;var r=this.toArrayBuffer();if(RB())if(window.URL=window.URL||window.webkitURL,window.URL){var i=new DataView(r),a=new Blob([i],{type:`font/opentype`}),o=document.createElement(`a`);o.href=window.URL.createObjectURL(a),o.download=e;var s=document.createEvent(`MouseEvents`);s.initEvent(`click`,!0,!1),o.dispatchEvent(s)}else console.warn(`Font file could not be downloaded. Try using a different browser.`);else{var c=sL(),l=BB(r);c.writeFileSync(e,l)}},sW.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},sW.prototype.usWidthClasses={ULTRA_CONDENSED:1,EXTRA_CONDENSED:2,CONDENSED:3,SEMI_CONDENSED:4,MEDIUM:5,SEMI_EXPANDED:6,EXPANDED:7,EXTRA_EXPANDED:8,ULTRA_EXPANDED:9},sW.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};function cW(e,t){var n=JSON.stringify(e),r=256;for(var i in t){var a=parseInt(i);if(!(!a||a<256)){if(JSON.stringify(t[i])===n)return a;r<=a&&(r=a+1)}}return t[r]=e,r}function lW(e,t,n){var r=cW(t.name,n);return[{name:`tag_`+e,type:`TAG`,value:t.tag},{name:`minValue_`+e,type:`FIXED`,value:t.minValue<<16},{name:`defaultValue_`+e,type:`FIXED`,value:t.defaultValue<<16},{name:`maxValue_`+e,type:`FIXED`,value:t.maxValue<<16},{name:`flags_`+e,type:`USHORT`,value:0},{name:`nameID_`+e,type:`USHORT`,value:r}]}function uW(e,t,n){var r={},i=new Z.Parser(e,t);return r.tag=i.parseTag(),r.minValue=i.parseFixed(),r.defaultValue=i.parseFixed(),r.maxValue=i.parseFixed(),i.skip(`uShort`,1),r.name=n[i.parseUShort()]||{},r}function dW(e,t,n,r){for(var i=cW(t.name,r),a=[{name:`nameID_`+e,type:`USHORT`,value:i},{name:`flags_`+e,type:`USHORT`,value:0}],o=0;o<n.length;++o){var s=n[o].tag;a.push({name:`axis_`+e+` `+s,type:`FIXED`,value:t.coordinates[s]<<16})}return a}function fW(e,t,n,r){var i={},a=new Z.Parser(e,t);i.name=r[a.parseUShort()]||{},a.skip(`uShort`,1),i.coordinates={};for(var o=0;o<n.length;++o)i.coordinates[n[o].tag]=a.parseFixed();return i}function pW(e,t){var n=new Y.Table(`fvar`,[{name:`version`,type:`ULONG`,value:65536},{name:`offsetToData`,type:`USHORT`,value:0},{name:`countSizePairs`,type:`USHORT`,value:2},{name:`axisCount`,type:`USHORT`,value:e.axes.length},{name:`axisSize`,type:`USHORT`,value:20},{name:`instanceCount`,type:`USHORT`,value:e.instances.length},{name:`instanceSize`,type:`USHORT`,value:4+e.axes.length*4}]);n.offsetToData=n.sizeOf();for(var r=0;r<e.axes.length;r++)n.fields=n.fields.concat(lW(r,e.axes[r],t));for(var i=0;i<e.instances.length;i++)n.fields=n.fields.concat(dW(i,e.instances[i],e.axes,t));return n}function mW(e,t,n){var r=new Z.Parser(e,t),i=r.parseULong();K.argument(i===65536,`Unsupported fvar table version.`);var a=r.parseOffset16();r.skip(`uShort`,1);for(var o=r.parseUShort(),s=r.parseUShort(),c=r.parseUShort(),l=r.parseUShort(),u=[],d=0;d<o;d++)u.push(uW(e,t+a+d*s,n));for(var f=[],p=t+a+o*s,m=0;m<c;m++)f.push(fW(e,p+m*l,u,n));return{axes:u,instances:f}}var hW={make:pW,parse:mW},gW=function(){return{coverage:this.parsePointer(X.coverage),attachPoints:this.parseList(X.pointer(X.uShortList))}},_W=function(){var e=this.parseUShort();if(K.argument(e===1||e===2||e===3,`Unsupported CaretValue table version.`),e===1)return{coordinate:this.parseShort()};if(e===2)return{pointindex:this.parseShort()};if(e===3)return{coordinate:this.parseShort()}},vW=function(){return this.parseList(X.pointer(_W))},yW=function(){return{coverage:this.parsePointer(X.coverage),ligGlyphs:this.parseList(X.pointer(vW))}},bW=function(){return this.parseUShort(),this.parseList(X.pointer(X.coverage))};function xW(e,t){t||=0;var n=new X(e,t),r=n.parseVersion(1);K.argument(r===1||r===1.2||r===1.3,`Unsupported GDEF table version.`);var i={version:r,classDef:n.parsePointer(X.classDef),attachList:n.parsePointer(gW),ligCaretList:n.parsePointer(yW),markAttachClassDef:n.parsePointer(X.classDef)};return r>=1.2&&(i.markGlyphSets=n.parsePointer(bW)),i}var SW={parse:xW},CW=Array(10);CW[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{posFormat:1,coverage:this.parsePointer(X.coverage),value:this.parseValueRecord()};if(t===2)return{posFormat:2,coverage:this.parsePointer(X.coverage),values:this.parseValueRecordList()};K.assert(!1,`0x`+e.toString(16)+`: GPOS lookup type 1 format must be 1 or 2.`)},CW[2]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();K.assert(t===1||t===2,`0x`+e.toString(16)+`: GPOS lookup type 2 format must be 1 or 2.`);var n=this.parsePointer(X.coverage),r=this.parseUShort(),i=this.parseUShort();if(t===1)return{posFormat:t,coverage:n,valueFormat1:r,valueFormat2:i,pairSets:this.parseList(X.pointer(X.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(r),value2:this.parseValueRecord(i)}})))};if(t===2){var a=this.parsePointer(X.classDef),o=this.parsePointer(X.classDef),s=this.parseUShort(),c=this.parseUShort();return{posFormat:t,coverage:n,valueFormat1:r,valueFormat2:i,classDef1:a,classDef2:o,class1Count:s,class2Count:c,classRecords:this.parseList(s,X.list(c,function(){return{value1:this.parseValueRecord(r),value2:this.parseValueRecord(i)}}))}}},CW[3]=function(){return{error:`GPOS Lookup 3 not supported`}},CW[4]=function(){return{error:`GPOS Lookup 4 not supported`}},CW[5]=function(){return{error:`GPOS Lookup 5 not supported`}},CW[6]=function(){return{error:`GPOS Lookup 6 not supported`}},CW[7]=function(){return{error:`GPOS Lookup 7 not supported`}},CW[8]=function(){return{error:`GPOS Lookup 8 not supported`}},CW[9]=function(){return{error:`GPOS Lookup 9 not supported`}};function wW(e,t){t||=0;var n=new X(e,t),r=n.parseVersion(1);return K.argument(r===1||r===1.1,`Unsupported GPOS table version `+r),r===1?{version:r,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(CW)}:{version:r,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(CW),variations:n.parseFeatureVariationsList()}}var TW=Array(10);function EW(e){return new Y.Table(`GPOS`,[{name:`version`,type:`ULONG`,value:65536},{name:`scripts`,type:`TABLE`,value:new Y.ScriptList(e.scripts)},{name:`features`,type:`TABLE`,value:new Y.FeatureList(e.features)},{name:`lookups`,type:`TABLE`,value:new Y.LookupList(e.lookups,TW)}])}var DW={parse:wW,make:EW};function OW(e){var t={};e.skip(`uShort`);var n=e.parseUShort();K.argument(n===0,`Unsupported kern sub-table version.`),e.skip(`uShort`,2);var r=e.parseUShort();e.skip(`uShort`,3);for(var i=0;i<r;i+=1){var a=e.parseUShort(),o=e.parseUShort(),s=e.parseShort();t[a+`,`+o]=s}return t}function kW(e){var t={};e.skip(`uShort`),e.parseULong()>1&&console.warn(`Only the first kern subtable is supported.`),e.skip(`uLong`);var n=e.parseUShort()&255;if(e.skip(`uShort`),n===0){var r=e.parseUShort();e.skip(`uShort`,3);for(var i=0;i<r;i+=1){var a=e.parseUShort(),o=e.parseUShort(),s=e.parseShort();t[a+`,`+o]=s}}return t}function AW(e,t){var n=new Z.Parser(e,t),r=n.parseUShort();if(r===0)return OW(n);if(r===1)return kW(n);throw Error(`Unsupported kern table version (`+r+`).`)}var jW={parse:AW};function MW(e,t,n,r){for(var i=new Z.Parser(e,t),a=r?i.parseUShort:i.parseULong,o=[],s=0;s<n+1;s+=1){var c=a.call(i);r&&(c*=2),o.push(c)}return o}var NW={parse:MW};function PW(e,t){sL().readFile(e,function(e,n){if(e)return t(e.message);t(null,zB(n))})}function FW(e,t){var n=new XMLHttpRequest;n.open(`get`,e,!0),n.responseType=`arraybuffer`,n.onload=function(){return n.response?t(null,n.response):t(`Font could not be loaded: `+n.statusText)},n.onerror=function(){t(`Font could not be loaded`)},n.send()}function IW(e,t){for(var n=[],r=12,i=0;i<t;i+=1){var a=Z.getTag(e,r),o=Z.getULong(e,r+4),s=Z.getULong(e,r+8),c=Z.getULong(e,r+12);n.push({tag:a,checksum:o,offset:s,length:c,compression:!1}),r+=16}return n}function LW(e,t){for(var n=[],r=44,i=0;i<t;i+=1){var a=Z.getTag(e,r),o=Z.getULong(e,r+4),s=Z.getULong(e,r+8),c=Z.getULong(e,r+12),l=void 0;l=s<c?`WOFF`:!1,n.push({tag:a,offset:o,compression:l,compressedLength:s,length:c}),r+=20}return n}function RW(e,t){if(t.compression===`WOFF`){var n=new Uint8Array(e.buffer,t.offset+2,t.compressedLength-2),r=new Uint8Array(t.length);if(ML(n,r),r.byteLength!==t.length)throw Error(`Decompression error: `+t.tag+` decompressed length doesn't match recorded length`);return{data:new DataView(r.buffer,0),offset:0}}else return{data:e,offset:t.offset}}function zW(e,t){t??={};var n,r,i=new sW({empty:!0}),a=new DataView(e,0),o,s=[],c=Z.getTag(a,0);if(c===`\0\0\0`||c===`true`||c===`typ1`)i.outlinesFormat=`truetype`,o=Z.getUShort(a,4),s=IW(a,o);else if(c===`OTTO`)i.outlinesFormat=`cff`,o=Z.getUShort(a,4),s=IW(a,o);else if(c===`wOFF`){var l=Z.getTag(a,4);if(l===`\0\0\0`)i.outlinesFormat=`truetype`;else if(l===`OTTO`)i.outlinesFormat=`cff`;else throw Error(`Unsupported OpenType flavor `+c);o=Z.getUShort(a,12),s=LW(a,o)}else throw Error(`Unsupported OpenType signature `+c);for(var u,d,f,p,m,h,g,_,v,y,b,x,S=0;S<o;S+=1){var C=s[S],w=void 0;switch(C.tag){case`cmap`:w=RW(a,C),i.tables.cmap=SR.parse(w.data,w.offset),i.encoding=new OR(i.tables.cmap);break;case`cvt `:w=RW(a,C),x=new Z.Parser(w.data,w.offset),i.tables.cvt=x.parseShortList(C.length/2);break;case`fvar`:d=C;break;case`fpgm`:w=RW(a,C),x=new Z.Parser(w.data,w.offset),i.tables.fpgm=x.parseByteList(C.length);break;case`head`:w=RW(a,C),i.tables.head=Oz.parse(w.data,w.offset),i.unitsPerEm=i.tables.head.unitsPerEm,n=i.tables.head.indexToLocFormat;break;case`hhea`:w=RW(a,C),i.tables.hhea=jz.parse(w.data,w.offset),i.ascender=i.tables.hhea.ascender,i.descender=i.tables.hhea.descender,i.numberOfHMetrics=i.tables.hhea.numberOfHMetrics;break;case`hmtx`:g=C;break;case`ltag`:w=RW(a,C),r=zz.parse(w.data,w.offset);break;case`maxp`:w=RW(a,C),i.tables.maxp=Hz.parse(w.data,w.offset),i.numGlyphs=i.tables.maxp.numGlyphs;break;case`name`:y=C;break;case`OS/2`:w=RW(a,C),i.tables.os2=lB.parse(w.data,w.offset);break;case`post`:w=RW(a,C),i.tables.post=fB.parse(w.data,w.offset),i.glyphNames=new AR(i.tables.post);break;case`prep`:w=RW(a,C),x=new Z.Parser(w.data,w.offset),i.tables.prep=x.parseByteList(C.length);break;case`glyf`:f=C;break;case`loca`:v=C;break;case`CFF `:u=C;break;case`kern`:_=C;break;case`GDEF`:p=C;break;case`GPOS`:m=C;break;case`GSUB`:h=C;break;case`meta`:b=C;break}}var ee=RW(a,y);if(i.tables.name=iB.parse(ee.data,ee.offset,r),i.names=i.tables.name,f&&v){var te=n===0,ne=RW(a,v),re=NW.parse(ne.data,ne.offset,i.numGlyphs,te),ie=RW(a,f);i.glyphs=ZB.parse(ie.data,ie.offset,re,i,t)}else if(u){var ae=RW(a,u);Tz.parse(ae.data,ae.offset,i,t)}else throw Error(`Font doesn't contain TrueType or CFF outlines.`);var oe=RW(a,g);if(Iz.parse(i,oe.data,oe.offset,i.numberOfHMetrics,i.numGlyphs,i.glyphs,t),NR(i,t),_){var se=RW(a,_);i.kerningPairs=jW.parse(se.data,se.offset)}else i.kerningPairs={};if(p){var ce=RW(a,p);i.tables.gdef=SW.parse(ce.data,ce.offset)}if(m){var le=RW(a,m);i.tables.gpos=DW.parse(le.data,le.offset),i.position.init()}if(h){var ue=RW(a,h);i.tables.gsub=vB.parse(ue.data,ue.offset)}if(d){var de=RW(a,d);i.tables.fvar=hW.parse(de.data,de.offset,i.names)}if(b){var fe=RW(a,b);i.tables.meta=xB.parse(fe.data,fe.offset),i.metas=i.tables.meta}return i}function BW(e,t,n){n??={};var r=typeof window>`u`&&!n.isUrl?PW:FW;return new Promise(function(i,a){r(e,function(e,r){if(e){if(t)return t(e);a(e)}var o;try{o=zW(r,n)}catch(e){if(t)return t(e,null);a(e)}if(t)return t(null,o);i(o)})})}function VW(e,t){return zW(zB(sL().readFileSync(e)),t)}var HW=Object.freeze({__proto__:null,Font:sW,Glyph:LR,Path:FL,BoundingBox:PL,_parse:Z,parse:zW,load:BW,loadSync:VW}),UW=class{sketches;constructor(e){e.length===0&&M(`CompoundSketch`,`Cannot create CompoundSketch with an empty array of sketches`),this.sketches=e}delete(){this.sketches.forEach(e=>{e.delete()})}get outerSketch(){return kk(this.sketches)}get innerSketches(){return this.sketches.slice(1)}get wires(){return eG(this)}face(){return $W(this)}extrude(e,t={}){return tG(this,e,t)}revolve(e,t={}){return nG(this,e,t)}loftWith(e,t){return rG(this,e,t)}};function WW(e){let t={};e.defaultOrigin&&(t.defaultOrigin=e.defaultOrigin),e.defaultDirection&&(t.defaultDirection=e.defaultDirection);let n=new iG(e.wire,t);return e.baseFace&&(n.baseFace=e.baseFace),n}function GW(e){return new UW(e.map(WW))}function KW(e){let t;return t=e.baseFace?Kk(e.baseFace,e.wire):j(Wk(e.wire)),t}function qW(e){return aE(j(PD(e.wire.wrapped)))}function JW(e,t,{origin:n}={}){let r=j(Wk(e.wire)),i=j(qj(r,n?eD(n):e.defaultOrigin,t?eD(t):[0,0,1]));return r.delete(),e.delete(),i}function YW(e,t,{extrusionDirection:n,extrusionProfile:r,twistAngle:i,origin:a}={}){let o=oD(pD(n?eD(n):e.defaultDirection),t),s=a?eD(a):e.defaultOrigin;if(r&&!i){let t=j(Bj(e.wire,[...s],[...o],r));return e.delete(),t}if(i){let t=j(Vj(e.wire,i,[...s],[...o],r));return e.delete(),t}let c=j(Kj(j(Wk(e.wire)),[...o]));return e.delete(),c}function XW(e,t,n={}){let r=YO(e.wire),i=pD(oD(QO(e.wire,1e-9),-1)),a=e.defaultDirection,o=oD(lD(i,a),-1),s=t(xD([...r],[...o],[...i]),[...r]),c;if(`sketches`in s&&Array.isArray(s.sketches)){let e=s.sketches;c=e[0];for(let t=1;t<e.length;t++)e[t]?.delete()}else c=s;let l={forceProfileSpineOthogonality:!0,...n};e.baseFace&&(l.support=e.baseFace.wrapped);let u=j(Rj(c.wire,e.wire,l));return e.delete(),u}function ZW(e,t,n={},r=!1){let i=Array.isArray(t)?[e,...t]:[e,t],a=j(Yj(i.map(e=>e.wire),n,r));return i.forEach(e=>{e.delete()}),a}var QW=(e,t)=>{let n=j(t(kk(e))),r=e.slice(1).map(e=>j(t(e)));if(r.length===0)return n;try{return j(rA(n,r,{unsafe:!0}))}finally{n.delete();for(let e of r)e.delete()}};function $W(e){return Jk(e.outerSketch.face(),e.innerSketches.map(e=>e.wire))}function eG(e){return TA(e.sketches.map(e=>e.wire))}function tG(e,t,{extrusionDirection:n,extrusionProfile:r,twistAngle:i,origin:a}={}){let o=oD(pD(n?eD(n):e.outerSketch.defaultDirection),t);return r&&!i?QW(e.sketches,t=>Bj(t.wire,a?eD(a):e.outerSketch.defaultOrigin,o,r)):i?QW(e.sketches,t=>Vj(t.wire,i,a?eD(a):e.outerSketch.defaultOrigin,o,r)):j(Kj($W(e),o))}function nG(e,t,{origin:n}={}){let r=n?eD(n):e.outerSketch.defaultOrigin,i=t?eD(t):[0,0,1];return j(qj($W(e),r,i))}function rG(e,t,n){e.sketches.length!==t.sketches.length&&M(`CompoundSketch.loftWith`,`You need to loft with another compound with the same number of sketches`);let r=e.sketches.map((e,r)=>{let i=Ok(t.sketches,r),a={};return n.ruled!==void 0&&(a.ruled=n.ruled),e.clone().loftWith(i.clone(),a,!0)}),i=oE(j(PD($W(e).wrapped)));return r.push(i,$W(t)),j(EA(r))}var iG=class e{wire;_defaultOrigin;_defaultDirection;_baseFace;constructor(e,{defaultOrigin:t=[0,0,0],defaultDirection:n=[0,0,1]}={}){this.wire=e,this._defaultOrigin=eD(t),this._defaultDirection=eD(n),this.baseFace=null}get baseFace(){return this._baseFace}set baseFace(e){this._baseFace&&this._baseFace.delete(),this._baseFace=e&&oE(j(PD(e.wrapped)))}delete(){this.wire.delete(),this.baseFace&&this.baseFace.delete()}clone(){let t=new e(aE(j(PD(this.wire.wrapped))),{defaultOrigin:this.defaultOrigin,defaultDirection:this.defaultDirection});return this.baseFace&&(t.baseFace=oE(j(PD(this.baseFace.wrapped)))),t}get defaultOrigin(){return this._defaultOrigin}set defaultOrigin(e){this._defaultOrigin=eD(e)}get defaultDirection(){return this._defaultDirection}set defaultDirection(e){this._defaultDirection=eD(e)}face(){return KW(this)}wires(){return qW(this)}faces(){return this.face()}revolve(e,t={}){return JW(this,e,t)}extrude(e,t={}){return YW(this,e,t)}sweepSketch(e,t={}){return XW(this,e,t)}loftWith(e,t={},n=!1){return ZW(this,e,t,n)}},aG=class{sketches;constructor(e){this.sketches=e}wires(){return TA(this.sketches.map(e=>e instanceof iG?e.wire:e.wires))}faces(){return TA(this.sketches.map(e=>e.face()))}extrude(e,t={}){return TA(this.sketches.map(n=>n.extrude(e,t)))}revolve(e,t){return TA(this.sketches.map(n=>n.revolve(e,t)))}},oG={};async function sG(e,t=`default`,n=!1){if(!n&&oG[t])return O(oG[t]);let r;if(typeof e==`string`){let t;try{t=await fetch(e)}catch(t){return k(oo(N.FONT_FETCH_FAILED,`Failed to fetch font from ${e}: ${t instanceof Error?t.message:String(t)}`,t))}if(!t.ok)return k(oo(N.FONT_FETCH_FAILED,`Failed to fetch font from ${e}: HTTP ${t.status} ${t.statusText}`));r=await t.arrayBuffer()}else r=e;let i;try{i=HW.parse(r)}catch(e){return k(oo(N.FONT_PARSE_FAILED,`Failed to parse font data: ${e instanceof Error?e.message:String(e)}`,e))}let a=i;return oG[t]=a,oG.default||=a,O(a)}var cG=(e=`default`)=>oG[e],lG=function*(e){let t=null,n=null;for(let r of e){if(r.type===`Z`){t&&(yield t.close()),t=null;continue}let e=[-r.x,r.y];if(r.type===`M`){t&&(yield t.done()),t=new mI,t.movePointerTo(e),n=e;continue}n&&Math.abs(e[0]-n[0])<1e-9&&Math.abs(e[1]-n[1])<1e-9||(r.type===`L`&&t?.lineTo(e),r.type===`C`&&t?.cubicBezierCurveTo(e,[-r.x1,r.y1],[-r.x2,r.y2]),r.type===`Q`&&t?.quadraticBezierCurveTo(e,[-r.x1,r.y1]),n=e)}};function uG(e,{startX:t=0,startY:n=0,fontSize:r=16,fontFamily:i=`default`}={}){let a=cG(i);a||=cG(),a||M(`text`,`No fonts loaded. Call loadFont() before using text functions.`);let o=a.getPath(e,-t,-n,r);return rI(Array.from(lG(o.commands))).mirror([0,0])}var dG={XY:{dir:[0,0,1],xAxis:[1,0,0]},XZ:{dir:[0,-1,0],xAxis:[1,0,0]},YZ:{dir:[1,0,0],xAxis:[0,1,0]},YX:{dir:[0,0,-1],xAxis:[0,1,0]},ZX:{dir:[0,1,0],xAxis:[0,0,1]},ZY:{dir:[-1,0,0],xAxis:[0,0,1]},front:{dir:[0,-1,0],xAxis:[1,0,0]},back:{dir:[0,1,0],xAxis:[-1,0,0]},right:{dir:[-1,0,0],xAxis:[0,-1,0]},left:{dir:[1,0,0],xAxis:[0,1,0]},bottom:{dir:[0,0,1],xAxis:[1,0,0]},top:{dir:[0,0,-1],xAxis:[1,0,0]}};function fG(e){return typeof e==`string`&&e in dG}var pG=e=>e.IsNull()?[]:ME(W(e));function mG(e,t,n=!0){let r=U().projectEdges(e.wrapped,[...t.position],[...t.direction],[...t.xAxis]);return{visible:[...pG(r.visible.sharp),...pG(r.visible.smooth),...pG(r.visible.outline)],hidden:n?[...pG(r.hidden.sharp),...pG(r.hidden.smooth),...pG(r.hidden.outline)]:[]}}function hG(e=[0,0,0],t=[0,0,1],n){if(uD(t)<1e-12)return k(F(`CAMERA_ZERO_DIRECTION`,`Camera direction cannot be a zero-length vector`));let r;if(n)r=pD(n);else{let e=lD([0,0,1],t);uD(e)<1e-12&&(e=lD([0,1,0],t)),uD(e)<1e-12&&(e=lD([1,0,0],t)),r=pD(e)}let i=pD(lD(t,r));return O({position:e,direction:pD(t),xAxis:r,yAxis:i})}function gG(e,t){let n=pD(aD(e.position,t));return hG(e.position,n)}function _G(e){let t=dG[e];return hG([0,0,0],t.dir,t.xAxis)}function vG(e,t,n=!0){return mG(e,t,n)}var yG=(e,n=1e-7)=>{if(e.length===0)return[];let r=new LF(e.length);e.forEach(e=>{let[t,i]=e.firstPoint;r.add(t-n,i-n,t+n,i+n)}),r.finish();let i=[],a=new Set;return e.forEach((o,s)=>{if(a.has(s))return;let c=[o],l=s;a.add(s);let u=e.length;for(;;){u--<0&&M(`stitchCurves`,`Infinite loop detected`);let[o,s]=t(c,c.length-1).lastPoint,d=r.search(o-n,s-n,o+n,s+n),f=t=>Math.abs((l-t)%e.length),p=d.filter(e=>!a.has(e)).map(n=>[t(e,n),n,f(n)]).sort(([,,e],[,,t])=>e-t);if(p.length===0){i.push(c);break}let[m,h]=t(p,0);c.push(m),a.add(h),l=h}}),i},bG=class extends pI{plane;constructor(e,t){super(),this.plane=e&&typeof e!=`string`?{...e}:j(wD(e??`XY`,t))}delete(){this.pendingCurves=[]}sagittaArcTo(e,t){return super.sagittaArcTo(e,-t)}buildWire(){try{var e=_T();this.pendingCurves.length||M(`Sketcher.buildWire`,`No lines to convert into a wire`);let t=e.u(new kT);return j(Uk(bF(this.pendingCurves,this.plane).map(e=>t.register(e))))}catch(t){e.e=t}finally{e.d()}}done(){return new iG(this.buildWire(),{defaultOrigin:this.plane.origin,defaultDirection:this.plane.zDir})}close(){return this._closeSketch(),this.done()}closeWithMirror(){SP(this.pointer,this.firstPoint)&&M(`Sketcher.closeWithMirror`,`Cannot close with a mirror when the sketch is already closed`);let e=this.buildWire(),t=ED(this.plane,this.pointer),n=lD(pD(aD(t,ED(this.plane,this.firstPoint))),this.plane.zDir),r=j(PD(e.wrapped));return new iG(j(Uk([e,aE(j(PD(U().mirror(r,eD(t),eD(n)))))])),{defaultOrigin:this.plane.origin,defaultDirection:this.plane.zDir})}closeWithCustomCorner(e,t=`fillet`){return this._closeSketch(),this._customCornerLastWithFirst(e,t),this.done()}},xG=class extends pI{face;_bounds;constructor(e,t=[0,0]){super(t),this.face=oE(j(PD(e.wrapped))),this._bounds=UD(e)}_convertToUV([e,t]){let{uMin:n,uMax:r,vMin:i,vMax:a}=this._bounds;return[n+e*(r-n),i+t*(a-i)]}_convertFromUV([e,t]){let{uMin:n,uMax:r,vMin:i,vMax:a}=this._bounds;return[(e-n)/(r-n),(t-i)/(a-i)]}_adaptSurface(){return U().extractSurfaceFromFace(this.face.wrapped)}buildWire(){let e=U(),t=this._adaptSurface(),n=j(Uk(this.pendingCurves.map(n=>iE(e.buildEdgeOnSurface(n.wrapped,t)))));return e.buildCurves3d(n.wrapped),n}done(){try{var e=_T();let t=e.u(new kT),n=this.buildWire(),r=new iG(n);if(tk(n)){let e=t.register(r.clone().face()),n=WD(e,.5,.5),i=oD(qD(e),-1);r.defaultOrigin=[n[0],n[1],n[2]],r.defaultDirection=[i[0],i[1],i[2]]}else{let e=YO(n),t=qD(this.face,[e[0],e[1],e[2]]);r.defaultOrigin=[e[0],e[1],e[2]],r.defaultDirection=[t[0],t[1],t[2]]}return r.baseFace=this.face,r}catch(t){e.e=t}finally{e.d()}}close(){return this._closeSketch(),this.done()}closeWithMirror(){return this._closeWithMirror(),this.close()}closeWithCustomCorner(e,t=`fillet`){return this._closeSketch(),this._customCornerLastWithFirst(e,t),this.done()}},SG=(e,t={})=>{let n=t.plane&&typeof t.plane!=`string`?{...t.plane}:j(wD(t.plane??`XY`,t.origin));return new iG(j(Uk([Pk(e,n.origin,n.zDir)])),{defaultOrigin:[...n.origin],defaultDirection:[...n.zDir]})},CG=(e=1,t=2,n={})=>{let r=n.plane&&typeof n.plane!=`string`?{...n.plane}:j(wD(n.plane??`XY`,n.origin)),i=r.xDir,a=e,o=t;return t>e&&(i=vD(i,r.zDir,90*QE),a=t,o=e),new iG(j(Uk([j(Fk(a,o,r.origin,r.zDir,i))])),{defaultOrigin:[...r.origin],defaultDirection:[...r.zDir]})},wG=(e,t,n={})=>(n.plane&&typeof n.plane!=`string`?new bG(n.plane):new bG(n.plane,n.origin)).movePointerTo([-e/2,-t/2]).hLine(e).vLine(t).hLine(-e).vLine(-t).done(),TG=(e,t,n=0,r={})=>{let i=xI(e,t,n).sketchOnPlane(r.plane,r.origin),a={};return i.defaultOrigin&&(a.defaultOrigin=i.defaultOrigin),i.defaultDirection&&(a.defaultDirection=i.defaultDirection),new iG(i.wire,a)},EG=(e,t,n=0,r={})=>{let i=[...Array(t).keys()].map(n=>{let r=-(Math.PI*2/t)*n;return[e*Math.sin(r),e*Math.cos(r)]}),a=r.plane&&typeof r.plane!=`string`?new bG(r.plane):new bG(r.plane,r.origin),o=Ak(i),s=a.movePointerTo([Ok(o,0),Ok(o,1)]);return n?i.forEach(e=>s.sagittaArcTo([Ok(e,0),Ok(e,1)],n)):i.forEach(e=>s.lineTo([Ok(e,0),Ok(e,1)])),s.done()},DG=(e,t,n=0)=>{let r=Math.PI/t,i=Math.cos(r)*e;return n>=0?i:i+n},OG=(e,t)=>{let n=[...JD(e)],r=[...qD(e)];return new iG(j(ck(ZD(e),t)),{defaultOrigin:n,defaultDirection:r})},kG=(e,t={},{pointsCount:n=400,start:r=0,stop:i=1}={},a={})=>{try{var o=_T();let s=o.u(new kT),c=t.plane&&typeof t.plane!=`string`?{...t.plane}:j(wD(t.plane??`XY`,t.origin)),l=(i-r)/n,u=[...Array(n+1).keys()].map(t=>ED(c,e(r+t*l)));return new iG(j(Uk([s.register(j(zk(u,a)))])),{defaultOrigin:[...c.origin],defaultDirection:[...c.zDir]})}catch(e){o.e=e}finally{o.d()}},AG=(e,t,n,r=[0,0,0],i=[0,0,1],a=!1)=>new iG(j(Uk([Ik(e,t,n,eD(r),eD(i),a)]))),jG=(e,t,n)=>new bG().movePointerTo([-e/2,t/2]).hLine(e).vLine(-t).hLine(-e).close().extrude(n),MG=(e,t)=>SP(e,t,bP*100),NG=(e,t,n,r)=>{let i=e[0]-t[0],a=e[1]-t[1],o=n[0]-r[0],s=n[1]-r[1],c=i*s-a*o;if(Math.abs(c)<1e-12)return null;let l=e[0]*t[1]-e[1]*t[0],u=n[0]*r[1]-n[1]*r[0];return[(l*o-u*i)/c,(l*s-u*a)/c]};function PG(e,t,n,r,i){let a=_F(t,n,r.original.lastPoint);e(r),e(a)}function FG(e,t,n,r,i){let a=lF(t,n);e(r),e(a)}function IG(e,t,n,r,i){let a=NG(r.offset instanceof aF?wP(t,r.offset.tangentAt(1)):r.offset.firstPoint,t,n,i.offset instanceof aF?CP(n,i.offset.tangentAt(0)):i.offset.lastPoint);if(!a){let i=lF(t,n);e(r),e(i);return}let o=DP([(t[0]+n[0])/2,(t[1]+n[1])/2],a),s=DP(t,n);if(s<1e-18||o>16*s){let i=lF(t,n);e(r),e(i);return}let c=lF(t,a),l=lF(a,n);e(r),e(c),e(l)}var LG={round:PG,bevel:FG,miter:IG};function RG(e,t,n){let r=n.length===1?lo(n,0,`rawOffsets`):zG(n,e.original.lastPoint),i=lo(e.offset.splitAt([r],bP),0,`rawOffsets`),a=t.offset.splitAt([r],bP).at(-1);return a||M(`offset.rawOffsets`,`Split produced no trailing curve segment`),{splitPrevious:{offset:i,original:e.original},splitCurrent:{offset:a,original:t.original}}}function zG(e,t){let n=lo(e,0,`selectClosestIntersection`),r=DP(n,t);for(let i=1;i<e.length;i++){let a=lo(e,i,`selectClosestIntersection`),o=DP(a,t);o<r&&(r=o,n=a)}return n}function BG(e){let t=new Map,n=(e,n)=>{let r=t.get(e)||[];t.set(e,[...r,...n])},r=new LF(e.length);for(let t of e){let[[e,n],[i,a]]=t.boundingBox.bounds;r.add(e,n,i,a)}return r.finish(),e.forEach((t,i)=>{let[[a,o],[s,c]]=t.boundingBox.bounds,l=r.search(a,o,s,c);for(let r of l){if(r<=i)continue;let a=lo(e,r,`offsetBlueprint`),{intersections:o,commonSegmentsPoints:s}=j(HF(t,a,bP)),c=[...o,...s].filter(e=>{let n=MG(e,t.firstPoint)||MG(e,t.lastPoint),r=MG(e,a.firstPoint)||MG(e,a.lastPoint);return!(n&&r)});c.length&&(n(i,c),n(r,c))}}),t}function VG(e,t,n={}){let r=e.orientation===`clockwise`?-t:t,i=e.curves.map(e=>({offset:GF(e,r),original:e})),a=[],o=null,s=i.at(-1);if(!s)return[];function c(e){if(e instanceof aF){a.push(e);return}o?e.offset instanceof aF?a.push(e.offset):MG(e.offset.firstPoint,e.offset.lastPoint)||a.push(lF(e.offset.firstPoint,e.offset.lastPoint)):o=e}let l=function*(){for(let e of i.slice(0,-1))yield e;o||M(`offset.rawOffsets`,`No saved curve after iterating offset segments`),yield o};for(let e of l()){let t=s.offset.lastPoint,r=e.offset.firstPoint;if(MG(t,r)){c(s),s=e;continue}let i=[];if(s.offset instanceof aF&&e.offset instanceof aF){let{intersections:t,commonSegmentsPoints:n}=j(HF(s.offset,e.offset,bP/100));i=[...t,...n]}if(i.length>0){let{splitPrevious:t,splitCurrent:n}=RG(s,e,i);c(t),s=n;continue}let a=LG[n.lineJoinType??`round`];a(c,t,r,s,e),s=e}return c(s),a}function HG(e,n,r={}){let i=VG(e,n,r);if(i.length<2)return null;let a=BG(i);if(!a.size){let t=new NF(i);return e.intersects(t)?null:t}let o=i.flatMap((e,t)=>{if(!a.has(t))return e;let n=a.get(t)||[];return e.splitAt(n,bP*100)}),s=new LF(e.curves.length);for(let t of e.curves){let[[e,n],[r,i]]=t.boundingBox.bounds;s.add(e,n,r,i)}s.finish();let c=Math.abs(n),l=o.filter(n=>{let[[r,i],[a,o]]=n.boundingBox.bounds;return!s.search(r-c,i-c,a+c,o+c).some(r=>t(e.curves,r).distanceFrom(n)<c-bP)});if(!l.length)return null;let u=yG(l).filter(e=>e.length>1).map(e=>new NF(e)).filter(e=>e.isClosed());return u.length?u.length===1?lo(u,0,`offsetBlueprint`):new XF(u):null}var UG=e=>{let t=lo(e,0,`fuseAll`);for(let n=1;n<e.length;n++)t=rL(t,lo(e,n,`fuseAll`));return t};function WG(e,t,n={}){if(e instanceof NF)return HG(e,t,n);if(e instanceof XF)return UG(e.blueprints.map(e=>WG(e,t,n)));if(e instanceof ZF){let r=UG(e.blueprints.slice(1).map(e=>WG(e,-t,n)));return aL(WG(lo(e.blueprints,0,`offset`),t,n),r)}return null}function GG(e,t){return e instanceof NF?new NF(cF(e.curves,t)):e instanceof ZF?new ZF(e.blueprints.map(e=>GG(e,t))):e instanceof XF?new XF(e.blueprints.map(e=>GG(e,t))):e}function KG(e,t,n,r){let i=()=>!0;r&&(i=r.shouldKeep.bind(r));let a=[kk(t.curves)],o=(t,r)=>{i({firstCurve:t,secondCurve:r,point:t.lastPoint})?a.push(...e(t,r,n)):a.push(t,r)};t.curves.slice(1).forEach(e=>{let t=a.pop();t||M(`customCorners.modifyCorners`,`Unexpected empty curve stack during filleting`),o(t,e)});let s=a.at(-1);if(s||M(`customCorners.modifyCorners`,`Unexpected empty curve list during corner modification`),SP(kk(a).firstPoint,s.lastPoint)&&a.length>1){let e=a.pop(),t=a.shift();(!e||!t)&&M(`customCorners.modifyCorners`,`Unexpected empty curve stack during close-and-fillet`),o(e,t)}return new NF(a)}function qG(e,t,n,r){return t instanceof NF?KG(e,t,n,r):t instanceof ZF?new ZF(t.blueprints.map(t=>KG(e,t,n,r))):t instanceof XF?new XF(t.blueprints.map(t=>qG(e,t,n,r)).filter(e=>e!==null)):null}function JG(e,t,n){return qG(qF,e,t,n)}function YG(e,t,n){return qG(JF,e,t,n)}function XG(e,t){return e instanceof NF?WW(t):e instanceof ZF?GW(t):new aG(t.map(e=>Array.isArray(e)?GW(e):WW(e)))}var ZG=class e{innerShape;constructor(e=null){this.innerShape=e}clone(){return new e(this.innerShape?.clone()||null)}serialize(){if(!this.innerShape)return JSON.stringify({type:`Empty`});function e(t){if(t instanceof ZF)return{type:`CompoundBlueprint`,blueprints:t.blueprints.map(e)};if(t instanceof XF)return{type:`Blueprints`,blueprints:t.blueprints.map(e)};if(t instanceof NF)return{type:`Blueprint`,curves:t.curves.map(e=>e.serialize())};M(`Drawing.serialize`,`Unknown shape type for serialization`)}return JSON.stringify(e(this.innerShape))}get boundingBox(){return this.innerShape?this.innerShape.boundingBox:new rF}stretch(t,n,r){return this.innerShape?new e(this.innerShape.stretch(t,n,r)):new e}get repr(){return this.innerShape===null?`=== empty shape`:this.innerShape.repr}rotate(t,n){return this.innerShape?new e(this.innerShape.rotate(t,n)):new e}translate(t,n=0){return this.innerShape?new e(typeof t==`number`?this.innerShape.translate(t,n):this.innerShape.translate(t)):new e}scale(t,n){return this.innerShape?new e(this.innerShape.scale(t,n)):new e}mirror(t,n,r){return this.innerShape?new e(this.innerShape.mirror(t,n,r)):new e}cut(t){return new e(aL(this.innerShape,t.innerShape))}fuse(t){return new e(rL(this.innerShape,t.innerShape))}intersect(t){return new e(oL(this.innerShape,t.innerShape))}fillet(t,n){let r=n&&n(yI());return new e(JG(this.innerShape,t,r))}chamfer(t,n){let r=n&&n(yI());return new e(YG(this.innerShape,t,r))}sketchOnPlane(e,t){this.innerShape||M(`Drawing`,`Trying to sketch an empty drawing`);let n=this.innerShape.sketchOnPlane(e,t);return XG(this.innerShape,n)}sketchOnFace(e,t){this.innerShape||M(`Drawing`,`Trying to sketch an empty drawing`);let n=this.innerShape.sketchOnFace(e,t);return XG(this.innerShape,n)}punchHole(e,t,n={}){return this.innerShape?this.innerShape.punchHole(e,t,n):e}toSVG(e){return this.innerShape?.toSVG(e)||``}toSVGViewBox(e=1){return this.innerShape?.toSVGViewBox(e)||``}toSVGPaths(){return this.innerShape?.toSVGPaths()||[]}offset(t,n={}){return new e(WG(this.innerShape,t,n))}approximate(t,n={}){return t!==`svg`&&M(`Drawing.approximate`,`Only 'svg' is supported for now`),new e(GG(this.innerShape,n))}get blueprint(){if(!(this.innerShape instanceof NF)){if(this.innerShape instanceof XF&&this.innerShape.blueprints.length===1&&this.innerShape.blueprints[0]instanceof NF)return this.innerShape.blueprints[0];M(`Drawing.blueprint`,`This drawing is not a blueprint`)}return this.innerShape}};function QG(e){function t(e){if(e.type===`CompoundBlueprint`)return new ZF(e.blueprints.map(t));if(e.type===`Blueprints`)return new XF(e.blueprints.map(t));if(e.type===`Blueprint`)return new NF(e.curves.map(e=>iF(e)));M(`Drawing.deserialize`,`Unknown shape type for deserialization`)}return new ZG(t(JSON.parse(e)))}var $G=class extends pI{constructor(e=[0,0]){super(),this.pointer=e,this.firstPoint=e,this.pendingCurves=[]}done(){return new ZG(new NF(this.pendingCurves))}close(){return this._closeSketch(),this.done()}closeWithMirror(){return this._closeWithMirror(),this.close()}closeWithCustomCorner(e,t=`fillet`){return this._closeSketch(),this._customCornerLastWithFirst(e,t),this.done()}};function eK(e){let t=new $G;return e&&t.movePointerTo(e),t}function tK(e,t,n=0){return new ZG(xI(e,t,n))}var nK=tK;function rK(e){return new ZG(new NF([fF(e)]))}function iK(e,t){let[n,r]=[e,t].sort((e,t)=>e-t);return new ZG(new NF([pF(r,n,r===e?[1,0]:[0,1])]))}function aK(e){return eK().movePointerTo([-e,0]).sagittaArc(2*e,0,e).sagittaArc(-2*e,0,e).close()}function oK(e,t){return eK().movePointerTo([-e,0]).halfEllipse(2*e,0,t).halfEllipse(-2*e,0,t).close()}function sK(e,t,n=0){return new ZG(bI(e,t,n))}function cK(e,{startX:t=0,startY:n=0,fontSize:r=16,fontFamily:i=`default`}={}){return new ZG(uG(e,{startX:t,startY:n,fontSize:r,fontFamily:i}))}var lK=(e,t={},n={})=>{e.length<2&&M(`drawPointsInterpolation`,`Need at least 2 points for interpolation, got ${e.length}`);let r=[j(gF(e,t))],i=e[0],a=e[e.length-1];return n.closeShape&&i&&a&&!SP(i,a)&&r.push(lF(a,i)),new ZG(new NF(r))},uK=(e,{pointsCount:t=400,start:n=0,stop:r=1,closeShape:i=!1}={},a={})=>{let o=(r-n)/t;return lK([...Array(t+1).keys()].map(t=>e(n+t*o)),a,{closeShape:i})},dK=e=>{try{var t=_T();let n=t.u(new kT),r=nK(1e3,1e3).sketchOnPlane(),i=n.register(j(Wk(r.wire))),a=yG(e.map(e=>kF(e,i))).map(e=>new NF(e));return a.length===0?new ZG:a.length===1?new ZG(a[0]):new ZG(new XF(a))}catch(e){t.e=e}finally{t.d()}};function fK(e,t=`front`){let n;n=typeof t==`string`?j(_G(t)):t;let{visible:r,hidden:i}=vG(e,n);return{visible:dK(r),hidden:dK(i)}}function pK(e){try{var t=_T();let n=t.u(new kT),r=n.register(oE(j(PD(e.wrapped)))),i=yG(ME(n.register(ZD(r))).map(t=>kF(t,e))).map(e=>new NF(e));return i.length===0?new ZG:i.length===1?new ZG(i[0]):new ZG(new XF(i))}catch(e){t.e=e}finally{t.d()}}function mK(e,t,n){return n===void 0?e.sketchOnPlane(t):e.sketchOnPlane(t,n)}function hK(e,t){return e.fuse(t)}function gK(e,t){return e.cut(t)}function _K(e,t){return e.intersect(t)}function vK(e,t,n){return e.fillet(t,n)}function yK(e,t,n){return e.chamfer(t,n)}function bK(e,t,n=0){return typeof t==`number`?e.translate(t,n):e.translate(t)}function xK(e,t,n){return e.rotate(t,n)}function SK(e,t,n){return e.scale(t,n)}function CK(e,t,n,r){return e.mirror(t,n,r)}function wK(e){let t=e.clone();return t.reverse(),t}function TK(e){return e.boundingBox}function EK(e){return e.firstPoint}function DK(e){return e.lastPoint}function OK(e,t,n){return e.splitAt(t,n)}function kK(e,t,n){return e.parameter(t,n)}function AK(e,t){return e.tangentAt(t)}function jK(e,t){return e.isOnCurve(t)}function MK(e,t){return e.distanceFrom(t)}function NK(e){return e.length===0?k(F(N.BLUEPRINT_EMPTY_CURVES,`createBlueprint: at least one curve is required`)):O(new NF(e))}function PK(e){return e.length===0?k(F(N.COMPOUND_BLUEPRINT_EMPTY,`createCompoundBlueprint: at least one blueprint (outer boundary) is required`)):O(new ZF(e))}function FK(e){return e.boundingBox}function IK(e){return e.orientation}function LK(e,t){return e.isInside(t)}function RK(e){return e.toSVGPathD()}function zK(e,t,n){return e.translate(t,n)}function BK(e,t,n){return e.rotate(t,n)}function VK(e,t,n){return e.scale(t,n)}function HK(e,t,n,r){return e.mirror(t,n,r)}function UK(e,t,n,r){return e.stretch(t,n,r)}function WK(e,t,n){return e.sketchOnPlane(t,n)}function GK(e,t,n){return e.sketchOnFace(t,n)}function KK(e,t){return n(e,t*3)}function qK(e,t){return n(e,t)}function JK(e){let t=[`# brepjs OBJ export`],n=e.vertices.length/3;for(let r=0;r<n;r++){let[n,i,a]=KK(e.vertices,r);t.push(`v ${n} ${i} ${a}`)}let r=e.normals.length/3;for(let n=0;n<r;n++){let[r,i,a]=KK(e.normals,n);t.push(`vn ${r} ${i} ${a}`)}let i=n=>{let[r,i,a]=qK(e.triangles,n);t.push(`f ${r+1}//${r+1} ${i+1}//${i+1} ${a+1}//${a+1}`)};if(e.faceGroups.length>0)for(let n of e.faceGroups){t.push(`g face_${n.faceId}`);let e=n.count/3;for(let t=0;t<e;t++)i(n.start+t*3)}else{let t=e.triangles.length/3;for(let e=0;e<t;e++)i(e*3)}return t.join(`
25
25
  `)+`
26
26
  `}var YK=5126,XK=5125,ZK=34962,QK=34963,$K=[-Math.SQRT1_2,0,0,Math.SQRT1_2];function eq(e){return e===`Z`?[{mesh:0}]:[{name:`Z_up_to_Y_up`,rotation:$K,children:[1]},{mesh:0}]}function tq(e){let n=[1/0,1/0,1/0],r=[-1/0,-1/0,-1/0];for(let i=0;i<e.length;i+=3)for(let a=0;a<3;a++){let o=t(e,i+a);o<t(n,a)&&(n[a]=o),o>t(r,a)&&(r[a]=o)}return{min:n,max:r}}function nq(e){return e+3&-4}function rq(e){let t=new Uint8Array(e),n=8192,r=[];for(let e=0;e<t.length;e+=n)r.push(String.fromCharCode(...t.subarray(e,e+n)));return btoa(r.join(``))}function iq(e,t){let n=cq(e,`base64`,t);return JSON.stringify(n)}function aq(e,t){let{doc:n,binBuffer:r}=lq(e,t),i=JSON.stringify(n),a=new TextEncoder().encode(i),o=nq(a.length),s=new Uint8Array(o);s.set(a);for(let e=a.length;e<o;e++)s[e]=32;let c=nq(r.byteLength),l=new Uint8Array(c);l.set(new Uint8Array(r));let u=20+o+8+c,d=new ArrayBuffer(u),f=new DataView(d),p=new Uint8Array(d);f.setUint32(0,1179937895,!0),f.setUint32(4,2,!0),f.setUint32(8,u,!0),f.setUint32(12,o,!0),f.setUint32(16,1313821514,!0),p.set(s,20);let m=20+o;return f.setUint32(m,c,!0),f.setUint32(m+4,5130562,!0),p.set(l,m+8),d}function oq(e,t,n,r,i){return[{bufferView:0,componentType:XK,count:e.length,type:`SCALAR`},{bufferView:1,componentType:YK,count:t.length/3,type:`VEC3`,min:r,max:i},{bufferView:2,componentType:YK,count:n.length/3,type:`VEC3`}]}function sq(e,t,n){return[{buffer:0,byteOffset:0,byteLength:e,target:QK},{buffer:0,byteOffset:nq(e),byteLength:t,target:ZK},{buffer:0,byteOffset:nq(e)+t,byteLength:n,target:ZK}]}function cq(e,t,n){let{vertices:r,normals:i,triangles:a}=e,o=n?.materials;if(o&&o.size>0&&e.faceGroups.length>0)return hq(e,t,o,n.upAxis??`Y`);let s=a.byteLength,c=r.byteLength,l=i.byteLength,u=nq(s)+c+l,{min:d,max:f}=tq(r),p={asset:{version:`2.0`,generator:`brepjs`},scene:0,scenes:[{nodes:[0]}],nodes:eq(n?.upAxis??`Y`),meshes:[{primitives:[{attributes:{POSITION:1,NORMAL:2},indices:0}]}],accessors:oq(a,r,i,d,f),bufferViews:sq(s,c,l),buffers:[{byteLength:u}]};if(t===`base64`){let t=_q(e);p.buffers[0]={byteLength:u,uri:`data:application/octet-stream;base64,`+rq(t)}}return p}function lq(e,t){let n=t?.materials;if(n&&n.size>0&&e.faceGroups.length>0){let{doc:r,binBuffer:i}=gq(e,n,t.upAxis??`Y`);return{doc:r,binBuffer:i}}return{doc:cq(e,`glb`,t),binBuffer:_q(e)}}function uq(e,n){let{vertices:r,normals:i,triangles:a,faceGroups:o}=e,s=[],c=new Map,l=new Map;for(let e of n.values()){if(l.has(e))continue;let t=JSON.stringify([e.baseColor,e.metallic,e.roughness,e.name]),n=c.get(t);if(n!==void 0)l.set(e,n);else{let n=s.length;c.set(t,n),l.set(e,n),s.push({name:e.name??`material_${n}`,pbrMetallicRoughness:{baseColorFactor:e.baseColor??[.8,.8,.8,1],metallicFactor:e.metallic??0,roughnessFactor:e.roughness??.5}})}}let u=new Map;for(let e=0;e<o.length;e++){let t=Ok(o,e),r=n.get(t.faceId),i=r===void 0?-1:l.get(r)??-1,a=u.get(i);a?a.push(e):u.set(i,[e])}let d=[];for(let[e,n]of u){let r=0;for(let e of n)r+=Ok(o,e).count;let i=new Uint32Array(r),s=0;for(let e of n){let n=Ok(o,e);for(let e=n.start;e<n.start+n.count;e++)i[s++]=t(a,e)}d.push({indices:i,materialIdx:e})}let f=0,p=[];for(let e of d){let t=e.indices.byteLength;p.push({byteOffset:f,byteLength:t}),f=nq(f+t)}let m=f;return{primitiveData:d,indexBufferInfos:p,verticesOffset:m,totalByteLength:m+r.byteLength+i.byteLength,uniqueMaterials:s}}function dq(e,t,n,r){let{vertices:i,normals:a}=e,{min:o,max:s}=tq(i),c=r.length;r.push({buffer:0,byteOffset:t,byteLength:i.byteLength,target:ZK});let l=n.length;n.push({bufferView:c,componentType:YK,count:i.length/3,type:`VEC3`,min:o,max:s});let u=r.length;r.push({buffer:0,byteOffset:t+i.byteLength,byteLength:a.byteLength,target:ZK});let d=n.length;return n.push({bufferView:u,componentType:YK,count:a.length/3,type:`VEC3`}),{verticesAccIdx:l,normalsAccIdx:d}}function fq(e,t,n,r,i,a){let o=[];for(let s=0;s<e.length;s++){let c=Ok(e,s),l=Ok(t,s),u=a.length;a.push({buffer:0,byteOffset:l.byteOffset,byteLength:l.byteLength,target:QK});let d=i.length;i.push({bufferView:u,componentType:XK,count:c.indices.length,type:`SCALAR`});let f={attributes:{POSITION:n,NORMAL:r},indices:d};c.materialIdx>=0&&(f.material=c.materialIdx),o.push(f)}return o}function pq(e,t,n=`Y`){let{primitiveData:r,indexBufferInfos:i,verticesOffset:a,totalByteLength:o,uniqueMaterials:s}=t,c=[],l=[],{verticesAccIdx:u,normalsAccIdx:d}=dq(e,a,c,l),f=fq(r,i,u,d,c,l);return{asset:{version:`2.0`,generator:`brepjs`},scene:0,scenes:[{nodes:[0]}],nodes:eq(n),meshes:[{primitives:f}],accessors:c,bufferViews:l,buffers:[{byteLength:o}],materials:s}}function mq(e,t){let{vertices:n,normals:r}=e,{primitiveData:i,indexBufferInfos:a,verticesOffset:o,totalByteLength:s}=t,c=new ArrayBuffer(s),l=new Uint8Array(c);for(let e=0;e<i.length;e++){let t=Ok(i,e),n=Ok(a,e);l.set(new Uint8Array(t.indices.buffer,t.indices.byteOffset,t.indices.byteLength),n.byteOffset)}return l.set(new Uint8Array(n.buffer,n.byteOffset,n.byteLength),o),l.set(new Uint8Array(r.buffer,r.byteOffset,r.byteLength),o+n.byteLength),c}function hq(e,t,n,r=`Y`){let i=uq(e,n),a=pq(e,i,r);if(t===`base64`){let t=mq(e,i);a.buffers[0]={byteLength:i.totalByteLength,uri:`data:application/octet-stream;base64,`+rq(t)}}return a}function gq(e,t,n=`Y`){let r=uq(e,t);return{doc:pq(e,r,n),binBuffer:mq(e,r)}}function _q(e){let{vertices:t,normals:n,triangles:r}=e,i=r.byteLength,a=t.byteLength,o=n.byteLength,s=nq(i)+a+o,c=new ArrayBuffer(s),l=new Uint8Array(c);return l.set(new Uint8Array(r.buffer,r.byteOffset,i),0),l.set(new Uint8Array(t.buffer,t.byteOffset,a),nq(i)),l.set(new Uint8Array(n.buffer,n.byteOffset,o),nq(i)+a),c}function vq(e,t){let n=t?.layer??`0`,r=[];r.push(`0`,`SECTION`,`2`,`HEADER`),r.push(`9`,`$ACADVER`,`1`,`AC1009`),r.push(`0`,`ENDSEC`);let i=new Set([n]);for(let t of e)t.layer&&i.add(t.layer);r.push(`0`,`SECTION`,`2`,`TABLES`),r.push(`0`,`TABLE`,`2`,`LAYER`,`70`,String(i.size));for(let e of i)r.push(`0`,`LAYER`,`2`,e,`70`,`0`,`62`,`7`,`6`,`CONTINUOUS`);r.push(`0`,`ENDTAB`),r.push(`0`,`ENDSEC`),r.push(`0`,`SECTION`,`2`,`ENTITIES`);for(let t of e){let e=t.layer??n;if(t.type===`LINE`)r.push(`0`,`LINE`,`8`,e,`10`,String(t.start[0]),`20`,String(t.start[1]),`30`,`0`,`11`,String(t.end[0]),`21`,String(t.end[1]),`31`,`0`);else{r.push(`0`,`LWPOLYLINE`,`8`,e,`90`,String(t.points.length),`70`,t.closed?`1`:`0`);for(let e of t.points)r.push(`10`,String(e[0]),`20`,String(e[1]))}}return r.push(`0`,`ENDSEC`),r.push(`0`,`EOF`),r.join(`
27
27
  `)+`