@xterm/addon-ligatures 0.11.0-beta.285 → 0.11.0-beta.286

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.
@@ -14,7 +14,7 @@
14
14
  * Copyright (c) Microsoft Corporation. All rights reserved.
15
15
  * Licensed under the MIT License. See License.txt in the project root for license information.
16
16
  *--------------------------------------------------------------------------------------------*/
17
- var Bp=Object.create;var ir=Object.defineProperty;var _p=Object.getOwnPropertyDescriptor;var Gp=Object.getOwnPropertyNames;var Hp=Object.getPrototypeOf,Vp=Object.prototype.hasOwnProperty;var ki=g=>{throw TypeError(g)};var zp=(g,f,p)=>f in g?ir(g,f,{enumerable:!0,configurable:!0,writable:!0,value:p}):g[f]=p;var jp=(g,f)=>()=>(f||g((f={exports:{}}).exports,f),f.exports);var Wp=(g,f,p,h)=>{if(f&&typeof f=="object"||typeof f=="function")for(let y of Gp(f))!Vp.call(g,y)&&y!==p&&ir(g,y,{get:()=>f[y],enumerable:!(h=_p(f,y))||h.enumerable});return g};var qp=(g,f,p)=>(p=g!=null?Bp(Hp(g)):{},Wp(f||!g||!g.__esModule?ir(p,"default",{value:g,enumerable:!0}):p,g));var ye=(g,f,p)=>zp(g,typeof f!="symbol"?f+"":f,p),ar=(g,f,p)=>f.has(g)||ki("Cannot "+p);var b=(g,f,p)=>(ar(g,f,"read from private field"),p?p.call(g):f.get(g)),K=(g,f,p)=>f.has(g)?ki("Cannot add the same private member more than once"):f instanceof WeakSet?f.add(g):f.set(g,p),V=(g,f,p,h)=>(ar(g,f,"write to private field"),h?h.call(g,p):f.set(g,p),p),R=(g,f,p)=>(ar(g,f,"access private method"),p);var vs=(g,f,p,h)=>({set _(y){V(g,f,y,p)},get _(){return b(g,f,h)}});var Oi=jp((Ci,xs)=>{var Ti=(()=>{var g=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,y=(e,t)=>{for(var n in t)g(e,n,{get:t[n],enumerable:!0})},k=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of p(t))!h.call(e,r)&&r!==n&&g(e,r,{get:()=>t[r],enumerable:!(s=f(t,r))||s.enumerable});return e},T=e=>k(g({},"__esModule",{value:!0}),e),O={};y(O,{BoundingBox:()=>ws,Font:()=>yi,Glyph:()=>fn,Path:()=>Wt,_parse:()=>F,load:()=>Mp,loadSync:()=>Pp,parse:()=>Up});var w=0,E=-3;function j(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function H(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new j,this.dtree=new j}var Q=new j,X=new j,fe=new Uint8Array(30),J=new Uint16Array(30),Se=new Uint8Array(30),$=new Uint16Array(30),ee=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ne=new j,se=new Uint8Array(320);function pe(e,t,n,s){var r,o;for(r=0;r<n;++r)e[r]=0;for(r=0;r<30-n;++r)e[r+n]=r/n|0;for(o=s,r=0;r<30;++r)t[r]=o,o+=1<<e[r]}function Vt(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 St=new Uint16Array(16);function It(e,t,n,s){var r,o;for(r=0;r<16;++r)e.table[r]=0;for(r=0;r<s;++r)e.table[t[n+r]]++;for(e.table[0]=0,o=0,r=0;r<16;++r)St[r]=o,o+=e.table[r];for(r=0;r<s;++r)t[n+r]&&(e.trans[St[t[n+r]]++]=r)}function wt(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var t=e.tag&1;return e.tag>>>=1,t}function Be(e,t,n){if(!t)return n;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var s=e.tag&65535>>>16-t;return e.tag>>>=t,e.bitcount-=t,s+n}function zt(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var n=0,s=0,r=0,o=e.tag;do s=2*s+(o&1),o>>>=1,++r,n+=t.table[r],s-=t.table[r];while(s>=0);return e.tag=o,e.bitcount-=r,t.trans[n+s]}function Wi(e,t,n){var s,r,o,i,a,l;for(s=Be(e,5,257),r=Be(e,5,1),o=Be(e,4,4),i=0;i<19;++i)se[i]=0;for(i=0;i<o;++i){var c=Be(e,3,0);se[ee[i]]=c}for(It(ne,se,0,19),a=0;a<s+r;){var u=zt(e,ne);switch(u){case 16:var m=se[a-1];for(l=Be(e,2,3);l;--l)se[a++]=m;break;case 17:for(l=Be(e,3,3);l;--l)se[a++]=0;break;case 18:for(l=Be(e,7,11);l;--l)se[a++]=0;break;default:se[a++]=u;break}}It(t,se,0,s),It(n,se,s,r)}function wr(e,t,n){for(;;){var s=zt(e,t);if(s===256)return w;if(s<256)e.dest[e.destLen++]=s;else{var r,o,i,a;for(s-=257,r=Be(e,fe[s],J[s]),o=zt(e,n),i=e.destLen-Be(e,Se[o],$[o]),a=i;a<i+r;++a)e.dest[e.destLen++]=e.dest[a]}}}function qi(e){for(var t,n,s;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 E;for(e.sourceIndex+=4,s=t;s;--s)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,w}function Er(e,t){var n=new H(e,t),s,r,o;do{switch(s=wt(n),r=Be(n,2,0),r){case 0:o=qi(n);break;case 1:o=wr(n,Q,X);break;case 2:Wi(n,n.ltree,n.dtree),o=wr(n,n.ltree,n.dtree);break;default:o=E}if(o!==w)throw new Error("Data error")}while(!s);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}Vt(Q,X),pe(fe,J,4,3),pe(Se,$,2,1),fe[28]=0,J[28]=258;function on(e,t,n,s,r){return Math.pow(1-r,3)*e+3*Math.pow(1-r,2)*r*t+3*(1-r)*Math.pow(r,2)*n+Math.pow(r,3)*s}function jt(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}jt.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},jt.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))},jt.prototype.addX=function(e){this.addPoint(e,null)},jt.prototype.addY=function(e){this.addPoint(null,e)},jt.prototype.addBezier=function(e,t,n,s,r,o,i,a){let l=[e,t],c=[n,s],u=[r,o],m=[i,a];this.addPoint(e,t),this.addPoint(i,a);for(let d=0;d<=1;d++){let x=6*l[d]-12*c[d]+6*u[d],v=-3*l[d]+9*c[d]-9*u[d]+3*m[d],S=3*c[d]-3*l[d];if(v===0){if(x===0)continue;let z=-S/x;0<z&&z<1&&(d===0&&this.addX(on(l[d],c[d],u[d],m[d],z)),d===1&&this.addY(on(l[d],c[d],u[d],m[d],z)));continue}let I=Math.pow(x,2)-4*S*v;if(I<0)continue;let _=(-x+Math.sqrt(I))/(2*v);0<_&&_<1&&(d===0&&this.addX(on(l[d],c[d],u[d],m[d],_)),d===1&&this.addY(on(l[d],c[d],u[d],m[d],_)));let P=(-x-Math.sqrt(I))/(2*v);0<P&&P<1&&(d===0&&this.addX(on(l[d],c[d],u[d],m[d],P)),d===1&&this.addY(on(l[d],c[d],u[d],m[d],P)))}},jt.prototype.addQuad=function(e,t,n,s,r,o){let i=e+.6666666666666666*(n-e),a=t+2/3*(s-t),l=i+1/3*(r-e),c=a+1/3*(o-t);this.addBezier(e,t,i,a,l,c,r,o)};var ws=jt;function ve(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}var In={};function Lr(e,t){let n=Math.floor(e),s=e-n;if(In[t]||(In[t]={}),In[t][s]!==void 0){let o=In[t][s];return n+o}let r=+(Math.round(s+"e+"+t)+"e-"+t);return In[t][s]=r,n+r}function Ar(e){let t=[[]],n=0,s=0;for(let r=0;r<e.length;r+=1){let o=t[t.length-1],i=e[r],a=o[0],l=o[1],c=o[o.length-1],u=e[r+1];o.push(i),i.type==="M"?(n=i.x,s=i.y):i.type==="L"&&(!u||u.type==="Z")?Math.abs(i.x-n)>1||Math.abs(i.y-s)>1||o.pop():i.type==="L"&&c&&c.x===i.x&&c.y===i.y?o.pop():i.type==="Z"&&(a&&l&&c&&a.type==="M"&&l.type==="L"&&c.type==="L"&&c.x===a.x&&c.y===a.y&&(o.shift(),o[0].type="M"),r+1<e.length&&t.push([]))}return e=[].concat.apply([],t),e}function $i(e){return Object.assign({},{decimalPlaces:2,optimize:!0,flipY:!0,flipYBase:void 0,scale:1,x:0,y:0},e)}function Xi(e){return parseInt(e)===e&&(e={decimalPlaces:e,flipY:!1}),Object.assign({},{decimalPlaces:2,optimize:!0,flipY:!0,flipYBase:void 0},e)}ve.prototype.fromSVG=function(e,t={}){typeof SVGPathElement<"u"&&e instanceof SVGPathElement&&(e=e.getAttribute("d")),t=$i(t),this.commands=[];let n="0123456789",s="MmLlQqCcZzHhVv",r="SsTtAa",o="-+",i={},a=[""],l=!1;function c(v){return v.filter(S=>S.length).map(S=>{let I=parseFloat(S);return(t.decimalPlaces||t.decimalPlaces===0)&&(I=Lr(I,t.decimalPlaces)),I})}function u(v){if(!this.commands.length)return v;let S=this.commands[this.commands.length-1];for(let I=0;I<v.length;I++)v[I]+=S[I&1?"y":"x"];return v}function m(){if(i.type===void 0)return;let v=i.type.toUpperCase(),S=v!=="Z"&&i.type.toUpperCase()!==i.type,I=c(a);if(a=[""],!I.length&&v!=="Z")return;S&&v!=="H"&&v!=="V"&&(I=u.apply(this,[I]));let _=this.commands.length&&this.commands[this.commands.length-1].x||0,P=this.commands.length&&this.commands[this.commands.length-1].y||0;switch(v){case"M":this.moveTo(...I);break;case"L":this.lineTo(...I);break;case"V":for(let z=0;z<I.length;z++){let Y=0;S&&(Y=this.commands.length&&this.commands[this.commands.length-1].y||0),this.lineTo(_,I[z]+Y)}break;case"H":for(let z=0;z<I.length;z++){let Y=0;S&&(Y=this.commands.length&&this.commands[this.commands.length-1].x||0),this.lineTo(I[z]+Y,P)}break;case"C":this.bezierCurveTo(...I);break;case"Q":this.quadraticCurveTo(...I);break;case"Z":(this.commands.length<1||this.commands[this.commands.length-1].type!=="Z")&&this.close();break}if(this.commands.length)for(let z in this.commands[this.commands.length-1])this.commands[this.commands.length-1][z]===void 0&&(this.commands[this.commands.length-1][z]=0)}for(let v=0;v<e.length;v++){let S=e.charAt(v),I=a[a.length-1];if(n.indexOf(S)>-1)a[a.length-1]+=S;else if(o.indexOf(S)>-1)if(!i.type&&!this.commands.length&&(i.type="L"),S==="-")!i.type||I.indexOf("-")>0?l=!0:I.length?a.push("-"):a[a.length-1]=S;else if(!i.type||I.length>0)l=!0;else continue;else if(s.indexOf(S)>-1)i.type?(m.apply(this),i={type:S}):i.type=S;else{if(r.indexOf(S)>-1)throw new Error("Unsupported path command: "+S+". Currently supported commands are "+s.split("").join(", ")+".");` ,
17
+ var Bp=Object.create;var ir=Object.defineProperty;var _p=Object.getOwnPropertyDescriptor;var Gp=Object.getOwnPropertyNames;var Hp=Object.getPrototypeOf,Vp=Object.prototype.hasOwnProperty;var ki=g=>{throw TypeError(g)};var zp=(g,f,p)=>f in g?ir(g,f,{enumerable:!0,configurable:!0,writable:!0,value:p}):g[f]=p;var jp=(g,f)=>()=>{try{return f||g((f={exports:{}}).exports,f),f.exports}catch(p){throw f=0,p}};var Wp=(g,f,p,h)=>{if(f&&typeof f=="object"||typeof f=="function")for(let y of Gp(f))!Vp.call(g,y)&&y!==p&&ir(g,y,{get:()=>f[y],enumerable:!(h=_p(f,y))||h.enumerable});return g};var qp=(g,f,p)=>(p=g!=null?Bp(Hp(g)):{},Wp(f||!g||!g.__esModule?ir(p,"default",{value:g,enumerable:!0}):p,g));var ye=(g,f,p)=>zp(g,typeof f!="symbol"?f+"":f,p),ar=(g,f,p)=>f.has(g)||ki("Cannot "+p);var b=(g,f,p)=>(ar(g,f,"read from private field"),p?p.call(g):f.get(g)),K=(g,f,p)=>f.has(g)?ki("Cannot add the same private member more than once"):f instanceof WeakSet?f.add(g):f.set(g,p),V=(g,f,p,h)=>(ar(g,f,"write to private field"),h?h.call(g,p):f.set(g,p),p),R=(g,f,p)=>(ar(g,f,"access private method"),p);var vs=(g,f,p,h)=>({set _(y){V(g,f,y,p)},get _(){return b(g,f,h)}});var Oi=jp((Ci,xs)=>{var Ti=(()=>{var g=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,h=Object.prototype.hasOwnProperty,y=(e,t)=>{for(var n in t)g(e,n,{get:t[n],enumerable:!0})},k=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of p(t))!h.call(e,r)&&r!==n&&g(e,r,{get:()=>t[r],enumerable:!(s=f(t,r))||s.enumerable});return e},T=e=>k(g({},"__esModule",{value:!0}),e),O={};y(O,{BoundingBox:()=>ws,Font:()=>yi,Glyph:()=>fn,Path:()=>Wt,_parse:()=>F,load:()=>Mp,loadSync:()=>Pp,parse:()=>Up});var w=0,E=-3;function j(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function H(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new j,this.dtree=new j}var Q=new j,X=new j,fe=new Uint8Array(30),J=new Uint16Array(30),Se=new Uint8Array(30),$=new Uint16Array(30),ee=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ne=new j,se=new Uint8Array(320);function pe(e,t,n,s){var r,o;for(r=0;r<n;++r)e[r]=0;for(r=0;r<30-n;++r)e[r+n]=r/n|0;for(o=s,r=0;r<30;++r)t[r]=o,o+=1<<e[r]}function Vt(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 St=new Uint16Array(16);function It(e,t,n,s){var r,o;for(r=0;r<16;++r)e.table[r]=0;for(r=0;r<s;++r)e.table[t[n+r]]++;for(e.table[0]=0,o=0,r=0;r<16;++r)St[r]=o,o+=e.table[r];for(r=0;r<s;++r)t[n+r]&&(e.trans[St[t[n+r]]++]=r)}function wt(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var t=e.tag&1;return e.tag>>>=1,t}function Be(e,t,n){if(!t)return n;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var s=e.tag&65535>>>16-t;return e.tag>>>=t,e.bitcount-=t,s+n}function zt(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var n=0,s=0,r=0,o=e.tag;do s=2*s+(o&1),o>>>=1,++r,n+=t.table[r],s-=t.table[r];while(s>=0);return e.tag=o,e.bitcount-=r,t.trans[n+s]}function Wi(e,t,n){var s,r,o,i,a,l;for(s=Be(e,5,257),r=Be(e,5,1),o=Be(e,4,4),i=0;i<19;++i)se[i]=0;for(i=0;i<o;++i){var c=Be(e,3,0);se[ee[i]]=c}for(It(ne,se,0,19),a=0;a<s+r;){var u=zt(e,ne);switch(u){case 16:var m=se[a-1];for(l=Be(e,2,3);l;--l)se[a++]=m;break;case 17:for(l=Be(e,3,3);l;--l)se[a++]=0;break;case 18:for(l=Be(e,7,11);l;--l)se[a++]=0;break;default:se[a++]=u;break}}It(t,se,0,s),It(n,se,s,r)}function wr(e,t,n){for(;;){var s=zt(e,t);if(s===256)return w;if(s<256)e.dest[e.destLen++]=s;else{var r,o,i,a;for(s-=257,r=Be(e,fe[s],J[s]),o=zt(e,n),i=e.destLen-Be(e,Se[o],$[o]),a=i;a<i+r;++a)e.dest[e.destLen++]=e.dest[a]}}}function qi(e){for(var t,n,s;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 E;for(e.sourceIndex+=4,s=t;s;--s)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,w}function Er(e,t){var n=new H(e,t),s,r,o;do{switch(s=wt(n),r=Be(n,2,0),r){case 0:o=qi(n);break;case 1:o=wr(n,Q,X);break;case 2:Wi(n,n.ltree,n.dtree),o=wr(n,n.ltree,n.dtree);break;default:o=E}if(o!==w)throw new Error("Data error")}while(!s);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}Vt(Q,X),pe(fe,J,4,3),pe(Se,$,2,1),fe[28]=0,J[28]=258;function on(e,t,n,s,r){return Math.pow(1-r,3)*e+3*Math.pow(1-r,2)*r*t+3*(1-r)*Math.pow(r,2)*n+Math.pow(r,3)*s}function jt(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}jt.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},jt.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))},jt.prototype.addX=function(e){this.addPoint(e,null)},jt.prototype.addY=function(e){this.addPoint(null,e)},jt.prototype.addBezier=function(e,t,n,s,r,o,i,a){let l=[e,t],c=[n,s],u=[r,o],m=[i,a];this.addPoint(e,t),this.addPoint(i,a);for(let d=0;d<=1;d++){let x=6*l[d]-12*c[d]+6*u[d],v=-3*l[d]+9*c[d]-9*u[d]+3*m[d],S=3*c[d]-3*l[d];if(v===0){if(x===0)continue;let z=-S/x;0<z&&z<1&&(d===0&&this.addX(on(l[d],c[d],u[d],m[d],z)),d===1&&this.addY(on(l[d],c[d],u[d],m[d],z)));continue}let I=Math.pow(x,2)-4*S*v;if(I<0)continue;let _=(-x+Math.sqrt(I))/(2*v);0<_&&_<1&&(d===0&&this.addX(on(l[d],c[d],u[d],m[d],_)),d===1&&this.addY(on(l[d],c[d],u[d],m[d],_)));let P=(-x-Math.sqrt(I))/(2*v);0<P&&P<1&&(d===0&&this.addX(on(l[d],c[d],u[d],m[d],P)),d===1&&this.addY(on(l[d],c[d],u[d],m[d],P)))}},jt.prototype.addQuad=function(e,t,n,s,r,o){let i=e+.6666666666666666*(n-e),a=t+2/3*(s-t),l=i+1/3*(r-e),c=a+1/3*(o-t);this.addBezier(e,t,i,a,l,c,r,o)};var ws=jt;function ve(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}var In={};function Lr(e,t){let n=Math.floor(e),s=e-n;if(In[t]||(In[t]={}),In[t][s]!==void 0){let o=In[t][s];return n+o}let r=+(Math.round(s+"e+"+t)+"e-"+t);return In[t][s]=r,n+r}function Ar(e){let t=[[]],n=0,s=0;for(let r=0;r<e.length;r+=1){let o=t[t.length-1],i=e[r],a=o[0],l=o[1],c=o[o.length-1],u=e[r+1];o.push(i),i.type==="M"?(n=i.x,s=i.y):i.type==="L"&&(!u||u.type==="Z")?Math.abs(i.x-n)>1||Math.abs(i.y-s)>1||o.pop():i.type==="L"&&c&&c.x===i.x&&c.y===i.y?o.pop():i.type==="Z"&&(a&&l&&c&&a.type==="M"&&l.type==="L"&&c.type==="L"&&c.x===a.x&&c.y===a.y&&(o.shift(),o[0].type="M"),r+1<e.length&&t.push([]))}return e=[].concat.apply([],t),e}function $i(e){return Object.assign({},{decimalPlaces:2,optimize:!0,flipY:!0,flipYBase:void 0,scale:1,x:0,y:0},e)}function Xi(e){return parseInt(e)===e&&(e={decimalPlaces:e,flipY:!1}),Object.assign({},{decimalPlaces:2,optimize:!0,flipY:!0,flipYBase:void 0},e)}ve.prototype.fromSVG=function(e,t={}){typeof SVGPathElement<"u"&&e instanceof SVGPathElement&&(e=e.getAttribute("d")),t=$i(t),this.commands=[];let n="0123456789",s="MmLlQqCcZzHhVv",r="SsTtAa",o="-+",i={},a=[""],l=!1;function c(v){return v.filter(S=>S.length).map(S=>{let I=parseFloat(S);return(t.decimalPlaces||t.decimalPlaces===0)&&(I=Lr(I,t.decimalPlaces)),I})}function u(v){if(!this.commands.length)return v;let S=this.commands[this.commands.length-1];for(let I=0;I<v.length;I++)v[I]+=S[I&1?"y":"x"];return v}function m(){if(i.type===void 0)return;let v=i.type.toUpperCase(),S=v!=="Z"&&i.type.toUpperCase()!==i.type,I=c(a);if(a=[""],!I.length&&v!=="Z")return;S&&v!=="H"&&v!=="V"&&(I=u.apply(this,[I]));let _=this.commands.length&&this.commands[this.commands.length-1].x||0,P=this.commands.length&&this.commands[this.commands.length-1].y||0;switch(v){case"M":this.moveTo(...I);break;case"L":this.lineTo(...I);break;case"V":for(let z=0;z<I.length;z++){let Y=0;S&&(Y=this.commands.length&&this.commands[this.commands.length-1].y||0),this.lineTo(_,I[z]+Y)}break;case"H":for(let z=0;z<I.length;z++){let Y=0;S&&(Y=this.commands.length&&this.commands[this.commands.length-1].x||0),this.lineTo(I[z]+Y,P)}break;case"C":this.bezierCurveTo(...I);break;case"Q":this.quadraticCurveTo(...I);break;case"Z":(this.commands.length<1||this.commands[this.commands.length-1].type!=="Z")&&this.close();break}if(this.commands.length)for(let z in this.commands[this.commands.length-1])this.commands[this.commands.length-1][z]===void 0&&(this.commands[this.commands.length-1][z]=0)}for(let v=0;v<e.length;v++){let S=e.charAt(v),I=a[a.length-1];if(n.indexOf(S)>-1)a[a.length-1]+=S;else if(o.indexOf(S)>-1)if(!i.type&&!this.commands.length&&(i.type="L"),S==="-")!i.type||I.indexOf("-")>0?l=!0:I.length?a.push("-"):a[a.length-1]=S;else if(!i.type||I.length>0)l=!0;else continue;else if(s.indexOf(S)>-1)i.type?(m.apply(this),i={type:S}):i.type=S;else{if(r.indexOf(S)>-1)throw new Error("Unsupported path command: "+S+". Currently supported commands are "+s.split("").join(", ")+".");` ,
18
18
  \r\f\v`.indexOf(S)>-1?a.push(""):S==="."?!i.type||I.indexOf(S)>-1?l=!0:a[a.length-1]+=S:l=!0}if(l)throw new Error("Unexpected character: "+S+" at offset "+v)}m.apply(this),t.optimize&&(this.commands=Ar(this.commands));let d=t.flipY,x=t.flipYBase;if(d===!0&&t.flipYBase===void 0){let v=this.getBoundingBox();x=v.y1+v.y2}for(let v in this.commands){let S=this.commands[v];for(let I in S)["x","x1","x2"].includes(I)?this.commands[v][I]=t.x+S[I]*t.scale:["y","y1","y2"].includes(I)&&(this.commands[v][I]=t.y+(d?x-S[I]:S[I])*t.scale)}return this},ve.fromSVG=function(e,t){return new ve().fromSVG(e,t)},ve.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},ve.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},ve.prototype.curveTo=ve.prototype.bezierCurveTo=function(e,t,n,s,r,o){this.commands.push({type:"C",x1:e,y1:t,x2:n,y2:s,x:r,y:o})},ve.prototype.quadTo=ve.prototype.quadraticCurveTo=function(e,t,n,s){this.commands.push({type:"Q",x1:e,y1:t,x:n,y:s})},ve.prototype.close=ve.prototype.closePath=function(){this.commands.push({type:"Z"})},ve.prototype.extend=function(e){if(e.commands)e=e.commands;else if(e instanceof ws){let 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)},ve.prototype.getBoundingBox=function(){let e=new ws,t=0,n=0,s=0,r=0;for(let o=0;o<this.commands.length;o++){let i=this.commands[o];switch(i.type){case"M":e.addPoint(i.x,i.y),t=s=i.x,n=r=i.y;break;case"L":e.addPoint(i.x,i.y),s=i.x,r=i.y;break;case"Q":e.addQuad(s,r,i.x1,i.y1,i.x,i.y),s=i.x,r=i.y;break;case"C":e.addBezier(s,r,i.x1,i.y1,i.x2,i.y2,i.x,i.y),s=i.x,r=i.y;break;case"Z":s=t,r=n;break;default:throw new Error("Unexpected path command "+i.type)}}return e.isEmpty()&&e.addPoint(0,0),e},ve.prototype.draw=function(e){let t=this._layers;if(t&&t.length){for(let s=0;s<t.length;s++)this.draw.call(t[s],e);return}let n=this._image;if(n){e.drawImage(n.image,n.x,n.y,n.width,n.height);return}e.beginPath();for(let s=0;s<this.commands.length;s+=1){let r=this.commands[s];r.type==="M"?e.moveTo(r.x,r.y):r.type==="L"?e.lineTo(r.x,r.y):r.type==="C"?e.bezierCurveTo(r.x1,r.y1,r.x2,r.y2,r.x,r.y):r.type==="Q"?e.quadraticCurveTo(r.x1,r.y1,r.x,r.y):r.type==="Z"&&this.stroke&&this.strokeWidth&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())},ve.prototype.toPathData=function(e){e=Xi(e);function t(a){let l=Lr(a,e.decimalPlaces);return Math.round(a)===l?""+l:l.toFixed(e.decimalPlaces)}function n(){let a="";for(let l=0;l<arguments.length;l+=1){let c=arguments[l];c>=0&&l>0&&(a+=" "),a+=t(c)}return a}let s=this.commands;e.optimize&&(s=JSON.parse(JSON.stringify(this.commands)),s=Ar(s));let r=e.flipY,o=e.flipYBase;if(r===!0&&o===void 0){let a=new ve;a.extend(s);let l=a.getBoundingBox();o=l.y1+l.y2}let i="";for(let a=0;a<s.length;a+=1){let l=s[a];l.type==="M"?i+="M"+n(l.x,r?o-l.y:l.y):l.type==="L"?i+="L"+n(l.x,r?o-l.y:l.y):l.type==="C"?i+="C"+n(l.x1,r?o-l.y1:l.y1,l.x2,r?o-l.y2:l.y2,l.x,r?o-l.y:l.y):l.type==="Q"?i+="Q"+n(l.x1,r?o-l.y1:l.y1,l.x,r?o-l.y:l.y):l.type==="Z"&&(i+="Z")}return i},ve.prototype.toSVG=function(e,t){this._layers&&this._layers.length&&console.warn("toSVG() does not support colr font layers yet"),this._image&&console.warn("toSVG() does not support SVG glyphs yet"),t||(t=this.toPathData(e));let n='<path d="';return n+=t,n+='"',this.fill!==void 0&&this.fill!=="black"&&(this.fill===null?n+=' fill="none"':n+=' fill="'+this.fill+'"'),this.stroke&&(n+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),n+="/>",n},ve.prototype.toDOMElement=function(e,t){this._layers&&this._layers.length&&console.warn("toDOMElement() does not support colr font layers yet"),t||(t=this.toPathData(e));let n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d",t),this.fill!==void 0&&this.fill!=="black"&&(this.fill===null?n.setAttribute("fill","none"):n.setAttribute("fill",this.fill)),this.stroke&&(n.setAttribute("stroke",this.stroke),n.setAttribute("stroke-width",this.strokeWidth)),n};var Wt=ve;function Rr(e){throw new Error(e)}function Dr(e,t){e||Rr(t)}var B={fail:Rr,argument:Dr,assert:Dr},Fr=32768,Ur=2147483648,Yi=-32768,Zi=32767+1/65536,an={},D={},W={};function tt(e){return function(){return e}}D.BYTE=function(e){return B.argument(e>=0&&e<=255,"Byte value should be between 0 and 255."),[e]},W.BYTE=tt(1),D.CHAR=function(e){return[e.charCodeAt(0)]},W.CHAR=tt(1),D.CHARARRAY=function(e){(e===null||typeof e>"u")&&(e="",console.warn("CHARARRAY with undefined or null value encountered and treated as an empty string. This is probably caused by a missing glyph name."));let t=[];for(let n=0;n<e.length;n+=1)t[n]=e.charCodeAt(n);return t},W.CHARARRAY=function(e){return typeof e>"u"?0:e.length},D.USHORT=function(e){return[e>>8&255,e&255]},W.USHORT=tt(2),D.SHORT=function(e){return e>=Fr&&(e=-(2*Fr-e)),[e>>8&255,e&255]},W.SHORT=tt(2),D.UINT24=function(e){return[e>>16&255,e>>8&255,e&255]},W.UINT24=tt(3),D.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]},W.ULONG=tt(4),D.LONG=function(e){return e>=Ur&&(e=-(2*Ur-e)),[e>>24&255,e>>16&255,e>>8&255,e&255]},W.LONG=tt(4),D.FLOAT=function(e){if(e>Zi||e<Yi)throw new Error(`Value ${e} is outside the range of representable values in 16.16 format`);let t=Math.round(e*65536)<<0;return D.ULONG(t)},W.FLOAT=W.ULONG,D.FIXED=D.ULONG,W.FIXED=W.ULONG,D.FWORD=D.SHORT,W.FWORD=W.SHORT,D.UFWORD=D.USHORT,W.UFWORD=W.USHORT,D.F2DOT14=function(e){return D.USHORT(e*16384)},W.F2DOT14=W.USHORT,D.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,e&255]},W.LONGDATETIME=tt(8),D.TAG=function(e){return B.argument(e.length===4,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},W.TAG=tt(4),D.Card8=D.BYTE,W.Card8=W.BYTE,D.Card16=D.USHORT,W.Card16=W.USHORT,D.OffSize=D.BYTE,W.OffSize=W.BYTE,D.SID=D.USHORT,W.SID=W.USHORT,D.NUMBER=function(e){return e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?(e=e-108,[(e>>8)+247,e&255]):e>=-1131&&e<=-108?(e=-e-108,[(e>>8)+251,e&255]):e>=-32768&&e<=32767?D.NUMBER16(e):D.NUMBER32(e)},W.NUMBER=function(e){return D.NUMBER(e).length},D.NUMBER16=function(e){return[28,e>>8&255,e&255]},W.NUMBER16=tt(3),D.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,e&255]},W.NUMBER32=tt(5),D.REAL=function(e){let t=e.toString(),n=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(n){let o=parseFloat("1e"+((n[2]?+n[2]:0)+n[1].length));t=(Math.round(e*o)/o).toString()}let s="";for(let o=0,i=t.length;o<i;o+=1){let a=t[o];a==="e"?s+=t[++o]==="-"?"c":"b":a==="."?s+="a":a==="-"?s+="e":s+=a}s+=s.length&1?"f":"ff";let r=[30];for(let o=0,i=s.length;o<i;o+=2)r.push(parseInt(s.substr(o,2),16));return r},W.REAL=function(e){return D.REAL(e).length},D.NAME=D.CHARARRAY,W.NAME=W.CHARARRAY,D.STRING=D.CHARARRAY,W.STRING=W.CHARARRAY,an.UTF8=function(e,t,n){let s=[],r=n;for(let o=0;o<r;o++,t+=1)s[o]=e.getUint8(t);return String.fromCharCode.apply(null,s)},an.UTF16=function(e,t,n){let s=[],r=n/2;for(let o=0;o<r;o++,t+=2)s[o]=e.getUint16(t);return String.fromCharCode.apply(null,s)},D.UTF16=function(e){let t=[];for(let n=0;n<e.length;n+=1){let s=e.charCodeAt(n);t[t.length]=s>>8&255,t[t.length]=s&255}return t},W.UTF16=function(e){return e.length*2};var jn={"x-mac-croatian":"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\u0160\u2122\xB4\xA8\u2260\u017D\xD8\u221E\xB1\u2264\u2265\u2206\xB5\u2202\u2211\u220F\u0161\u222B\xAA\xBA\u03A9\u017E\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u0106\xAB\u010C\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u0110\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\uF8FF\xA9\u2044\u20AC\u2039\u203A\xC6\xBB\u2013\xB7\u201A\u201E\u2030\xC2\u0107\xC1\u010D\xC8\xCD\xCE\xCF\xCC\xD3\xD4\u0111\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u03C0\xCB\u02DA\xB8\xCA\xE6\u02C7","x-mac-cyrillic":"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u2020\xB0\u0490\xA3\xA7\u2022\xB6\u0406\xAE\xA9\u2122\u0402\u0452\u2260\u0403\u0453\u221E\xB1\u2264\u2265\u0456\xB5\u0491\u0408\u0404\u0454\u0407\u0457\u0409\u0459\u040A\u045A\u0458\u0405\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\u040B\u045B\u040C\u045C\u0455\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u201E\u040E\u045E\u040F\u045F\u2116\u0401\u0451\u044F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E","x-mac-gaelic":"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u1E02\xB1\u2264\u2265\u1E03\u010A\u010B\u1E0A\u1E0B\u1E1E\u1E1F\u0120\u0121\u1E40\xE6\xF8\u1E41\u1E56\u1E57\u027C\u0192\u017F\u1E60\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\u1E61\u1E9B\xFF\u0178\u1E6A\u20AC\u2039\u203A\u0176\u0177\u1E6B\xB7\u1EF2\u1EF3\u204A\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\u2663\xD2\xDA\xDB\xD9\u0131\xDD\xFD\u0174\u0175\u1E84\u1E85\u1E80\u1E81\u1E82\u1E83","x-mac-greek":"\xC4\xB9\xB2\xC9\xB3\xD6\xDC\u0385\xE0\xE2\xE4\u0384\xA8\xE7\xE9\xE8\xEA\xEB\xA3\u2122\xEE\xEF\u2022\xBD\u2030\xF4\xF6\xA6\u20AC\xF9\xFB\xFC\u2020\u0393\u0394\u0398\u039B\u039E\u03A0\xDF\xAE\xA9\u03A3\u03AA\xA7\u2260\xB0\xB7\u0391\xB1\u2264\u2265\xA5\u0392\u0395\u0396\u0397\u0399\u039A\u039C\u03A6\u03AB\u03A8\u03A9\u03AC\u039D\xAC\u039F\u03A1\u2248\u03A4\xAB\xBB\u2026\xA0\u03A5\u03A7\u0386\u0388\u0153\u2013\u2015\u201C\u201D\u2018\u2019\xF7\u0389\u038A\u038C\u038E\u03AD\u03AE\u03AF\u03CC\u038F\u03CD\u03B1\u03B2\u03C8\u03B4\u03B5\u03C6\u03B3\u03B7\u03B9\u03BE\u03BA\u03BB\u03BC\u03BD\u03BF\u03C0\u03CE\u03C1\u03C3\u03C4\u03B8\u03C9\u03C2\u03C7\u03C5\u03B6\u03CA\u03CB\u0390\u03B0\xAD","x-mac-icelandic":"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\xDD\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\u20AC\xD0\xF0\xDE\xFE\xFD\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7","x-mac-inuit":"\u1403\u1404\u1405\u1406\u140A\u140B\u1431\u1432\u1433\u1434\u1438\u1439\u1449\u144E\u144F\u1450\u1451\u1455\u1456\u1466\u146D\u146E\u146F\u1470\u1472\u1473\u1483\u148B\u148C\u148D\u148E\u1490\u1491\xB0\u14A1\u14A5\u14A6\u2022\xB6\u14A7\xAE\xA9\u2122\u14A8\u14AA\u14AB\u14BB\u14C2\u14C3\u14C4\u14C5\u14C7\u14C8\u14D0\u14EF\u14F0\u14F1\u14F2\u14F4\u14F5\u1505\u14D5\u14D6\u14D7\u14D8\u14DA\u14DB\u14EA\u1528\u1529\u152A\u152B\u152D\u2026\xA0\u152E\u153E\u1555\u1556\u1557\u2013\u2014\u201C\u201D\u2018\u2019\u1558\u1559\u155A\u155D\u1546\u1547\u1548\u1549\u154B\u154C\u1550\u157F\u1580\u1581\u1582\u1583\u1584\u1585\u158F\u1590\u1591\u1592\u1593\u1594\u1595\u1671\u1672\u1673\u1674\u1675\u1676\u1596\u15A0\u15A1\u15A2\u15A3\u15A4\u15A5\u15A6\u157C\u0141\u0142","x-mac-ce":"\xC4\u0100\u0101\xC9\u0104\xD6\xDC\xE1\u0105\u010C\xE4\u010D\u0106\u0107\xE9\u0179\u017A\u010E\xED\u010F\u0112\u0113\u0116\xF3\u0117\xF4\xF6\xF5\xFA\u011A\u011B\xFC\u2020\xB0\u0118\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\u0119\xA8\u2260\u0123\u012E\u012F\u012A\u2264\u2265\u012B\u0136\u2202\u2211\u0142\u013B\u013C\u013D\u013E\u0139\u013A\u0145\u0146\u0143\xAC\u221A\u0144\u0147\u2206\xAB\xBB\u2026\xA0\u0148\u0150\xD5\u0151\u014C\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\u014D\u0154\u0155\u0158\u2039\u203A\u0159\u0156\u0157\u0160\u201A\u201E\u0161\u015A\u015B\xC1\u0164\u0165\xCD\u017D\u017E\u016A\xD3\xD4\u016B\u016E\xDA\u016F\u0170\u0171\u0172\u0173\xDD\xFD\u0137\u017B\u0141\u017C\u0122\u02C7",macintosh:"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\u20AC\u2039\u203A\uFB01\uFB02\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7","x-mac-romanian":"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\u0102\u0218\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\u0103\u0219\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\u20AC\u2039\u203A\u021A\u021B\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7","x-mac-turkish":"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u03A9\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u011E\u011F\u0130\u0131\u015E\u015F\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uF8FF\xD2\xDA\xDB\xD9\uF8A0\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7"};an.MACSTRING=function(e,t,n,s){let r=jn[s];if(r===void 0)return;let o="";for(let i=0;i<n;i++){let a=e.getUint8(t+i);a<=127?o+=String.fromCharCode(a):o+=r[a&127]}return o};var Wn=typeof WeakMap=="function"&&new WeakMap,qn,Ki=function(e){if(!qn){qn={};for(let r in jn)qn[r]=new String(r)}let t=qn[e];if(t===void 0)return;if(Wn){let r=Wn.get(t);if(r!==void 0)return r}let n=jn[e];if(n===void 0)return;let s={};for(let r=0;r<n.length;r++)s[n.charCodeAt(r)]=r+128;return Wn&&Wn.set(t,s),s};D.MACSTRING=function(e,t){let n=Ki(t);if(n===void 0)return;let s=[];for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o>=128&&(o=n[o],o===void 0))return;s[r]=o}return s},W.MACSTRING=function(e,t){let n=D.MACSTRING(e,t);return n!==void 0?n.length:0};function Es(e){return e>=-128&&e<=127}function Qi(e,t,n){let s=0,r=e.length;for(;t<r&&s<64&&e[t]===0;)++t,++s;return n.push(128|s-1),t}function Ji(e,t,n){let s=0,r=e.length,o=t;for(;o<r&&s<64;){let i=e[o];if(!Es(i)||i===0&&o+1<r&&e[o+1]===0)break;++o,++s}n.push(s-1);for(let i=t;i<o;++i)n.push(e[i]+256&255);return o}function ea(e,t,n){let s=0,r=e.length,o=t;for(;o<r&&s<64;){let i=e[o];if(i===0||Es(i)&&o+1<r&&Es(e[o+1]))break;++o,++s}n.push(64|s-1);for(let i=t;i<o;++i){let a=e[i];n.push(a+65536>>8&255,a+256&255)}return o}D.VARDELTAS=function(e){let t=0,n=[];for(;t<e.length;){let s=e[t];s===0?t=Qi(e,t,n):s>=-128&&s<=127?t=Ji(e,t,n):t=ea(e,t,n)}return n},D.INDEX=function(e){let t=1,n=[t],s=[];for(let a=0;a<e.length;a+=1){let l=D.OBJECT(e[a]);Array.prototype.push.apply(s,l),t+=l.length,n.push(t)}if(s.length===0)return[0,0];let r=[],o=1+Math.floor(Math.log(t)/Math.log(2))/8|0,i=[void 0,D.BYTE,D.USHORT,D.UINT24,D.ULONG][o];for(let a=0;a<n.length;a+=1){let l=i(n[a]);Array.prototype.push.apply(r,l)}return Array.prototype.concat(D.Card16(e.length),D.OffSize(o),r,s)},W.INDEX=function(e){return D.INDEX(e).length},D.DICT=function(e){let t=[],n=Object.keys(e),s=n.length;for(let r=0;r<s;r+=1){let o=parseInt(n[r],0),i=e[o],a=D.OPERAND(i.value,i.type),l=D.OPERATOR(o);for(let c=0;c<a.length;c++)t.push(a[c]);for(let c=0;c<l.length;c++)t.push(l[c])}return t},W.DICT=function(e){return D.DICT(e).length},D.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},D.OPERAND=function(e,t){let n=[];if(Array.isArray(t))for(let s=0;s<t.length;s+=1){B.argument(e.length===t.length,"Not enough arguments given for type"+t);let r=D.OPERAND(e[s],t[s]);for(let o=0;o<r.length;o++)n.push(r[o])}else if(t==="SID"){let s=D.NUMBER(e);for(let r=0;r<s.length;r++)n.push(s[r])}else if(t==="offset"){let s=D.NUMBER32(e);for(let r=0;r<s.length;r++)n.push(s[r])}else if(t==="number"){let s=D.NUMBER(e);for(let r=0;r<s.length;r++)n.push(s[r])}else if(t==="real"){let s=D.REAL(e);for(let r=0;r<s.length;r++)n.push(s[r])}else throw new Error("Unknown operand type "+t);return n},D.OP=D.BYTE,W.OP=W.BYTE;var $n=typeof WeakMap=="function"&&new WeakMap;D.CHARSTRING=function(e){if($n){let s=$n.get(e);if(s!==void 0)return s}let t=[],n=e.length;for(let s=0;s<n;s+=1){let r=e[s],o=D[r.type](r.value);for(let i=0;i<o.length;i++)t.push(o[i])}return $n&&$n.set(e,t),t},W.CHARSTRING=function(e){return D.CHARSTRING(e).length},D.OBJECT=function(e){let t=D[e.type];return B.argument(t!==void 0,"No encoding function for type "+e.type),t(e.value)},W.OBJECT=function(e){let t=W[e.type];return B.argument(t!==void 0,"No sizeOf function for type "+e.type),t(e.value)},D.TABLE=function(e){let t=[],n=(e.fields||[]).length,s=[],r=[];for(let o=0;o<n;o+=1){let i=e.fields[o],a=D[i.type];B.argument(a!==void 0,"No encoding function for field type "+i.type+" ("+i.name+")");let l=e[i.name];l===void 0&&(l=i.value);let c=a(l);if(i.type==="TABLE")l.fields!==null&&(r.push(t.length),s.push(c)),t.push(0,0);else for(let u=0;u<c.length;u++)t.push(c[u])}for(let o=0;o<s.length;o+=1){let i=r[o],a=t.length;B.argument(a<65536,"Table "+e.tableName+" too big."),t[i]=a>>8,t[i+1]=a&255;for(let l=0;l<s[o].length;l++)t.push(s[o][l])}return t},W.TABLE=function(e){let t=0,n=(e.fields||[]).length;for(let s=0;s<n;s+=1){let r=e.fields[s],o=W[r.type];B.argument(o!==void 0,"No sizeOf function for field type "+r.type+" ("+r.name+")");let i=e[r.name];i===void 0&&(i=r.value),t+=o(i),r.type==="TABLE"&&(t+=2)}return t},D.RECORD=D.TABLE,W.RECORD=W.TABLE,D.LITERAL=function(e){return e},W.LITERAL=function(e){return e.length};function de(e,t,n){if(t&&t.length)for(let s=0;s<t.length;s+=1){let r=t[s];this[r.name]=r.value}if(this.tableName=e,this.fields=t,n){let s=Object.keys(n);for(let r=0;r<s.length;r+=1){let o=s[r],i=n[o];this[o]!==void 0&&(this[o]=i)}}}de.prototype.encode=function(){return D.TABLE(this)},de.prototype.sizeOf=function(){return W.TABLE(this)};function ln(e,t,n){n===void 0&&(n=t.length);let s=new Array(t.length+1);s[0]={name:e+"Count",type:"USHORT",value:n};for(let r=0;r<t.length;r++)s[r+1]={name:e+r,type:"USHORT",value:t[r]};return s}function Ls(e,t,n){let s=t.length,r=new Array(s+1);r[0]={name:e+"Count",type:"USHORT",value:s};for(let o=0;o<s;o++)r[o+1]={name:e+o,type:"TABLE",value:n(t[o],o)};return r}function un(e,t,n){let s=t.length,r=[];r[0]={name:e+"Count",type:"USHORT",value:s};for(let o=0;o<s;o++)r=r.concat(n(t[o],o));return r}function Xn(e){e.format===1?de.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(ln("glyph",e.glyphs))):e.format===2?de.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:2}].concat(un("rangeRecord",e.ranges,function(t,n){return[{name:"startGlyphID"+n,type:"USHORT",value:t.start},{name:"endGlyphID"+n,type:"USHORT",value:t.end},{name:"startCoverageIndex"+n,type:"USHORT",value:t.index}]}))):B.assert(!1,"Coverage format must be 1 or 2.")}Xn.prototype=Object.create(de.prototype),Xn.prototype.constructor=Xn;function Yn(e){de.call(this,"scriptListTable",un("scriptRecord",e,function(t,n){let s=t.script,r=s.defaultLangSys;return B.assert(!!r,"Unable to write GSUB: script "+t.tag+" has no default language system."),[{name:"scriptTag"+n,type:"TAG",value:t.tag},{name:"script"+n,type:"TABLE",value:new de("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new de("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:r.reqFeatureIndex}].concat(ln("featureIndex",r.featureIndexes)))}].concat(un("langSys",s.langSysRecords,function(o,i){let a=o.langSys;return[{name:"langSysTag"+i,type:"TAG",value:o.tag},{name:"langSys"+i,type:"TABLE",value:new de("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:a.reqFeatureIndex}].concat(ln("featureIndex",a.featureIndexes)))}]})))}]}))}Yn.prototype=Object.create(de.prototype),Yn.prototype.constructor=Yn;function Zn(e){de.call(this,"featureListTable",un("featureRecord",e,function(t,n){let s=t.feature;return[{name:"featureTag"+n,type:"TAG",value:t.tag},{name:"feature"+n,type:"TABLE",value:new de("featureTable",[{name:"featureParams",type:"USHORT",value:s.featureParams}].concat(ln("lookupListIndex",s.lookupListIndexes)))}]}))}Zn.prototype=Object.create(de.prototype),Zn.prototype.constructor=Zn;function Kn(e,t){de.call(this,"lookupListTable",Ls("lookup",e,function(n){let s=t[n.lookupType];return B.assert(!!s,"Unable to write GSUB lookup type "+n.lookupType+" tables."),new de("lookupTable",[{name:"lookupType",type:"USHORT",value:n.lookupType},{name:"lookupFlag",type:"USHORT",value:n.lookupFlag}].concat(Ls("subtable",n.subtables,s)))}))}Kn.prototype=Object.create(de.prototype),Kn.prototype.constructor=Kn;function Qn(e){e.format===1?de.call(this,"classDefTable",[{name:"classFormat",type:"USHORT",value:1},{name:"startGlyphID",type:"USHORT",value:e.startGlyph}].concat(ln("glyph",e.classes))):e.format===2?de.call(this,"classDefTable",[{name:"classFormat",type:"USHORT",value:2}].concat(un("rangeRecord",e.ranges,function(t,n){return[{name:"startGlyphID"+n,type:"USHORT",value:t.start},{name:"endGlyphID"+n,type:"USHORT",value:t.end},{name:"class"+n,type:"USHORT",value:t.classId}]}))):B.assert(!1,"Class format must be 1 or 2.")}Qn.prototype=Object.create(de.prototype),Qn.prototype.constructor=Qn;var A={Table:de,Record:de,Coverage:Xn,ClassDef:Qn,ScriptList:Yn,FeatureList:Zn,LookupList:Kn,ushortList:ln,tableList:Ls,recordList:un};function Mr(e,t){return e.getUint8(t)}function Jn(e,t){return e.getUint16(t,!1)}function ta(e,t){return e.getInt16(t,!1)}function Pr(e,t){return(e.getUint16(t)<<8)+e.getUint8(t+2)}function As(e,t){return e.getUint32(t,!1)}function na(e,t){return e.getInt32(t,!1)}function Nr(e,t){let n=e.getInt16(t,!1),s=e.getUint16(t+2,!1);return n+s/65535}function sa(e,t){let n="";for(let s=t;s<t+4;s+=1)n+=String.fromCharCode(e.getInt8(s));return n}function ra(e,t,n){let s=0;for(let r=0;r<n;r+=1)s<<=8,s+=e.getUint8(t+r);return s}function oa(e,t,n){let s=[];for(let r=t;r<n;r+=1)s.push(e.getUint8(r));return s}function ia(e){let t="";for(let n=0;n<e.length;n+=1)t+=String.fromCharCode(e[n]);return t}var aa={byte:1,uShort:2,f2dot14:2,short:2,uInt24:3,uLong:4,fixed:4,longDateTime:8,tag:4},Ie={LONG_WORDS:32768,WORD_DELTA_COUNT_MASK:32767,SHARED_POINT_NUMBERS:32768,COUNT_MASK:4095,EMBEDDED_PEAK_TUPLE:32768,INTERMEDIATE_REGION:16384,PRIVATE_POINT_NUMBERS:8192,TUPLE_INDEX_MASK:4095,POINTS_ARE_WORDS:128,POINT_RUN_COUNT_MASK:127,DELTAS_ARE_ZERO:128,DELTAS_ARE_WORDS:64,DELTA_RUN_COUNT_MASK:63,INNER_INDEX_BIT_COUNT_MASK:15,MAP_ENTRY_SIZE_MASK:48};function C(e,t){this.data=e,this.offset=t,this.relativeOffset=0}C.prototype.parseByte=function(){let e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},C.prototype.parseChar=function(){let e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},C.prototype.parseCard8=C.prototype.parseByte,C.prototype.parseUShort=function(){let e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},C.prototype.parseCard16=C.prototype.parseUShort,C.prototype.parseSID=C.prototype.parseUShort,C.prototype.parseOffset16=C.prototype.parseUShort,C.prototype.parseShort=function(){let e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},C.prototype.parseF2Dot14=function(){let e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e},C.prototype.parseUInt24=function(){let e=Pr(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=3,e},C.prototype.parseULong=function(){let e=As(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},C.prototype.parseLong=function(){let e=na(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},C.prototype.parseOffset32=C.prototype.parseULong,C.prototype.parseFixed=function(){let e=Nr(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},C.prototype.parseString=function(e){let t=this.data,n=this.offset+this.relativeOffset,s="";this.relativeOffset+=e;for(let r=0;r<e;r++)s+=String.fromCharCode(t.getUint8(n+r));return s},C.prototype.parseTag=function(){return this.parseString(4)},C.prototype.parseLongDateTime=function(){let e=As(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e},C.prototype.parseVersion=function(e){let t=Jn(this.data,this.offset+this.relativeOffset),n=Jn(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,e===void 0&&(e=4096),t+n/e/10},C.prototype.skip=function(e,t){t===void 0&&(t=1),this.relativeOffset+=aa[e]*t},C.prototype.parseULongList=function(e){e===void 0&&(e=this.parseULong());let t=new Array(e),n=this.data,s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getUint32(s),s+=4;return this.relativeOffset+=e*4,t},C.prototype.parseOffset16List=C.prototype.parseUShortList=function(e){e===void 0&&(e=this.parseUShort());let t=new Array(e),n=this.data,s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getUint16(s),s+=2;return this.relativeOffset+=e*2,t},C.prototype.parseShortList=function(e){let t=new Array(e),n=this.data,s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getInt16(s),s+=2;return this.relativeOffset+=e*2,t},C.prototype.parseByteList=function(e){let t=new Array(e),n=this.data,s=this.offset+this.relativeOffset;for(let r=0;r<e;r++)t[r]=n.getUint8(s++);return this.relativeOffset+=e,t},C.prototype.parseList=function(e,t){t||(t=e,e=this.parseUShort());let n=new Array(e);for(let s=0;s<e;s++)n[s]=t.call(this);return n},C.prototype.parseList32=function(e,t){t||(t=e,e=this.parseULong());let n=new Array(e);for(let s=0;s<e;s++)n[s]=t.call(this);return n},C.prototype.parseRecordList=function(e,t){t||(t=e,e=this.parseUShort());let n=new Array(e),s=Object.keys(t);for(let r=0;r<e;r++){let o={};for(let i=0;i<s.length;i++){let a=s[i],l=t[a];o[a]=l.call(this)}n[r]=o}return n},C.prototype.parseRecordList32=function(e,t){t||(t=e,e=this.parseULong());let n=new Array(e),s=Object.keys(t);for(let r=0;r<e;r++){let o={};for(let i=0;i<s.length;i++){let a=s[i],l=t[a];o[a]=l.call(this)}n[r]=o}return n},C.prototype.parseTupleRecords=function(e,t){let n=[];for(let s=0;s<e;s++){let r=[];for(let o=0;o<t;o++)r.push(this.parseF2Dot14());n.push(r)}return n},C.prototype.parseStruct=function(e){if(typeof e=="function")return e.call(this);{let t=Object.keys(e),n={};for(let s=0;s<t.length;s++){let r=t[s],o=e[r];n[r]=o.call(this)}return n}},C.prototype.parseValueRecord=function(e){if(e===void 0&&(e=this.parseUShort()),e===0)return;let 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},C.prototype.parseValueRecordList=function(){let e=this.parseUShort(),t=this.parseUShort(),n=new Array(t);for(let s=0;s<t;s++)n[s]=this.parseValueRecord(e);return n},C.prototype.parsePointer=function(e){let t=this.parseOffset16();if(t>0)return new C(this.data,this.offset+t).parseStruct(e)},C.prototype.parsePointer32=function(e){let t=this.parseOffset32();if(t>0)return new C(this.data,this.offset+t).parseStruct(e)},C.prototype.parseListOfLists=function(e){let t=this.parseOffset16List(),n=t.length,s=this.relativeOffset,r=new Array(n);for(let o=0;o<n;o++){let i=t[o];if(i===0){r[o]=void 0;continue}if(this.relativeOffset=i,e){let a=this.parseOffset16List(),l=new Array(a.length);for(let c=0;c<a.length;c++)this.relativeOffset=i+a[c],l[c]=e.call(this);r[o]=l}else r[o]=this.parseUShortList()}return this.relativeOffset=s,r},C.prototype.parseCoverage=function(){let e=this.offset+this.relativeOffset,t=this.parseUShort(),n=this.parseUShort();if(t===1)return{format:1,glyphs:this.parseUShortList(n)};if(t===2){let s=new Array(n);for(let r=0;r<n;r++)s[r]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:s}}throw new Error("0x"+e.toString(16)+": Coverage format must be 1 or 2.")},C.prototype.parseClassDef=function(){let e=this.offset+this.relativeOffset,t=this.parseUShort();return t===1?{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()}:t===2?{format:2,ranges:this.parseRecordList({start:C.uShort,end:C.uShort,classId:C.uShort})}:(console.warn(`0x${e.toString(16)}: This font file uses an invalid ClassDef format of ${t}. It might be corrupted and should be reacquired if it doesn't display as intended.`),{format:t})},C.list=function(e,t){return function(){return this.parseList(e,t)}},C.list32=function(e,t){return function(){return this.parseList32(e,t)}},C.recordList=function(e,t){return function(){return this.parseRecordList(e,t)}},C.recordList32=function(e,t){return function(){return this.parseRecordList32(e,t)}},C.pointer=function(e){return function(){return this.parsePointer(e)}},C.pointer32=function(e){return function(){return this.parsePointer32(e)}},C.tag=C.prototype.parseTag,C.byte=C.prototype.parseByte,C.uShort=C.offset16=C.prototype.parseUShort,C.uShortList=C.prototype.parseUShortList,C.uInt24=C.prototype.parseUInt24,C.uLong=C.offset32=C.prototype.parseULong,C.uLongList=C.prototype.parseULongList,C.fixed=C.prototype.parseFixed,C.f2Dot14=C.prototype.parseF2Dot14,C.struct=C.prototype.parseStruct,C.coverage=C.prototype.parseCoverage,C.classDef=C.prototype.parseClassDef;var Br={reserved:C.uShort,reqFeatureIndex:C.uShort,featureIndexes:C.uShortList};C.prototype.parseScriptList=function(){return this.parsePointer(C.recordList({tag:C.tag,script:C.pointer({defaultLangSys:C.pointer(Br),langSysRecords:C.recordList({tag:C.tag,langSys:C.pointer(Br)})})}))||[]},C.prototype.parseFeatureList=function(){return this.parsePointer(C.recordList({tag:C.tag,feature:C.pointer({featureParams:C.offset16,lookupListIndexes:C.uShortList})}))||[]},C.prototype.parseLookupList=function(e){return this.parsePointer(C.list(C.pointer(function(){let t=this.parseUShort();B.argument(1<=t&&t<=9,"GPOS/GSUB lookup type "+t+" unknown.");let n=this.parseUShort(),s=n&16;return{lookupType:t,lookupFlag:n,subtables:this.parseList(C.pointer(e[t])),markFilteringSet:s?this.parseUShort():void 0}})))||[]},C.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){let e=this.parseUShort(),t=this.parseUShort();return B.argument(e===1&&t<1,"GPOS/GSUB feature variations table unknown."),this.parseRecordList32({conditionSetOffset:C.offset32,featureTableSubstitutionOffset:C.offset32})})||[]},C.prototype.parseVariationStore=function(){let e=this.relativeOffset,t=this.parseUShort(),n={itemVariationStore:this.parseItemVariationStore()};return this.relativeOffset=e+t+2,n},C.prototype.parseItemVariationStore=function(){let e=this.relativeOffset,t={format:this.parseUShort(),variationRegions:[],itemVariationSubtables:[]},n=this.parseOffset32(),s=this.parseUShort(),r=this.parseULongList(s);this.relativeOffset=e+n,t.variationRegions=this.parseVariationRegionList();for(let o=0;o<s;o++){let i=r[o];this.relativeOffset=e+i,t.itemVariationSubtables.push(this.parseItemVariationSubtable())}return t},C.prototype.parseVariationRegionList=function(){let e=this.parseUShort(),t=this.parseUShort();return this.parseRecordList(t,{regionAxes:C.recordList(e,{startCoord:C.f2Dot14,peakCoord:C.f2Dot14,endCoord:C.f2Dot14})})},C.prototype.parseItemVariationSubtable=function(){let e=this.parseUShort(),t=this.parseUShort(),n=this.parseUShortList(),s=n.length;return{regionIndexes:n,deltaSets:e&&s?this.parseDeltaSets(e,t,s):[]}},C.prototype.parseDeltaSetIndexMap=function(){let e=this.parseByte(),t=this.parseByte(),n=[],s=0;switch(e){case 0:s=this.parseUShort();break;case 1:s=this.parseULong();break;default:console.error(`unsupported DeltaSetIndexMap format ${e}`)}if(!s)return{format:e,entryFormat:t};let r=(t&Ie.INNER_INDEX_BIT_COUNT_MASK)+1,o=((t&Ie.MAP_ENTRY_SIZE_MASK)>>4)+1;for(let i=0;i<s;i++){let a;if(o===1)a=this.parseByte();else if(o===2)a=this.parseUShort();else if(o===3)a=this.parseUInt24();else if(o===4)a=this.parseULong();else throw new Error(`Invalid entry size of ${o}`);let l=a>>r,c=a&(1<<r)-1;n.push({outerIndex:l,innerIndex:c})}return{format:e,entryFormat:t,map:n}},C.prototype.parseDeltaSets=function(e,t,n){let s=Array.from({length:e},()=>[]),r=t&Ie.LONG_WORDS,o=t&Ie.WORD_DELTA_COUNT_MASK;if(o>n)throw Error("wordCount must be less than or equal to regionIndexCount");let i=(r?this.parseLong:this.parseShort).bind(this),a=(r?this.parseShort:this.parseChar).bind(this);for(let l=0;l<e;l++)for(let c=0;c<n;c++)c<o?s[l].push(i()):s[l].push(a());return s},C.prototype.parseTupleVariationStoreList=function(e,t,n){let s=this.parseUShort(),o=this.parseUShort()&1,i=this.parseOffset32(),a=(o?this.parseULong:this.parseUShort).bind(this),l={},c=a();o||(c*=2);let u;for(let m=0;m<s;m++){u=a(),o||(u*=2);let d=u-c;l[m]=d?this.parseTupleVariationStore(i+c,e,t,n,m):void 0,c=u}return l},C.prototype.parseTupleVariationStore=function(e,t,n,s,r){let o=this.relativeOffset;this.relativeOffset=e,n==="cvar"&&(this.relativeOffset+=4);let i=this.parseUShort(),a=!!(i&Ie.SHARED_POINT_NUMBERS),l=i&Ie.COUNT_MASK,c=this.parseOffset16(),u=[],m=[];for(let v=0;v<l;v++){let S=this.parseTupleVariationHeader(t,n);u.push(S)}this.relativeOffset!==e+c&&(console.warn(`Unexpected offset after parsing tuple variation headers! Expected ${e+c}, actually ${this.relativeOffset}`),this.relativeOffset=e+c),a&&(m=this.parsePackedPointNumbers());let d=this.relativeOffset;for(let v=0;v<l;v++){let S=u[v];S.privatePoints=[],this.relativeOffset=d,n==="cvar"&&!S.peakTuple&&console.warn("An embedded peak tuple is required in TupleVariationHeaders for the cvar table."),S.flags.privatePointNumbers&&(S.privatePoints=this.parsePackedPointNumbers()),delete S.flags;let I=this.offset,_=this.relativeOffset,P=z=>{let Y,re,ie=()=>{let ae=0;if(n==="gvar"){if(ae=S.privatePoints.length||m.length,!ae){let me=s.get(r);me.path,ae=me.points.length,ae+=4}}else n==="cvar"&&(ae=s.length);this.offset=I,this.relativeOffset=_,Y=this.parsePackedDeltas(ae),n==="gvar"&&(re=this.parsePackedDeltas(ae))};return{configurable:!0,get:function(){return Y===void 0&&ie(),z==="deltasY"?re:Y},set:function(ae){Y===void 0&&ie(),z==="deltasY"?re=ae:Y=ae}}};Object.defineProperty(S,"deltas",P.call(this,"deltas")),n==="gvar"&&Object.defineProperty(S,"deltasY",P.call(this,"deltasY")),d+=S.variationDataSize,delete S.variationDataSize}this.relativeOffset=o;let x={headers:u};return x.sharedPoints=m,x},C.prototype.parseTupleVariationHeader=function(e,t){let n=this.parseUShort(),s=this.parseUShort(),r=!!(s&Ie.EMBEDDED_PEAK_TUPLE),o=!!(s&Ie.INTERMEDIATE_REGION),i=!!(s&Ie.PRIVATE_POINT_NUMBERS),a=r?void 0:s&Ie.TUPLE_INDEX_MASK,l=r?this.parseTupleRecords(1,e)[0]:void 0,c=o?this.parseTupleRecords(1,e)[0]:void 0,u=o?this.parseTupleRecords(1,e)[0]:void 0,m={variationDataSize:n,peakTuple:l,intermediateStartTuple:c,intermediateEndTuple:u,flags:{embeddedPeakTuple:r,intermediateRegion:o,privatePointNumbers:i}};return t==="gvar"&&(m.sharedTupleRecordsIndex=a),m},C.prototype.parsePackedPointNumbers=function(){let e=this.parseByte(),t=[],n=e;if(e>=128){let r=this.parseByte();n=(e&Ie.POINT_RUN_COUNT_MASK)<<8|r}let s=0;for(;t.length<n;){let r=this.parseByte(),o=!!(r&Ie.POINTS_ARE_WORDS),i=(r&Ie.POINT_RUN_COUNT_MASK)+1;for(let a=0;a<i&&t.length<n;a++){let l;o?l=this.parseUShort():l=this.parseByte(),s=s+l,t.push(s)}}return t},C.prototype.parsePackedDeltas=function(e){let t=[];for(;t.length<e;){let n=this.parseByte(),s=!!(n&Ie.DELTAS_ARE_ZERO),r=!!(n&Ie.DELTAS_ARE_WORDS),o=(n&Ie.DELTA_RUN_COUNT_MASK)+1;for(let i=0;i<o&&t.length<e;i++)s?t.push(0):r?t.push(this.parseShort()):t.push(this.parseChar())}return t};var F={getByte:Mr,getCard8:Mr,getUShort:Jn,getCard16:Jn,getShort:ta,getUInt24:Pr,getULong:As,getFixed:Nr,getTag:sa,getOffset:ra,getBytes:oa,bytesToString:ia,Parser:C},es=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],_r={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"},la={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},Gr={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 ua(e,t,n){switch(e){case 0:if(t===65535)return"und";if(n)return n[t];break;case 1:return _r[t];case 3:return Gr[t]}}var Rs="utf-16",ca={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"},fa={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 Ds(e,t,n){switch(e){case 0:return Rs;case 1:return fa[n]||ca[t];case 3:if(t===1||t===10)return Rs;break}}var Hr={0:"unicode",1:"macintosh",2:"reserved",3:"windows"};function pa(e){return Hr[e]}function ha(e,t,n){let s={},r=new F.Parser(e,t),o=r.parseUShort(),i=r.parseUShort(),a=r.offset+r.parseUShort();for(let l=0;l<i;l++){let c=r.parseUShort(),u=r.parseUShort(),m=r.parseUShort(),d=r.parseUShort(),x=es[d]||d,v=r.parseUShort(),S=r.parseUShort(),I=ua(c,m,n),_=Ds(c,u,m),P=pa(c);if(_!==void 0&&I!==void 0&&P!==void 0){let z;if(_===Rs?z=an.UTF16(e,a+S,v):z=an.MACSTRING(e,a+S,v,_),z){let Y=s[P];Y===void 0&&(Y=s[P]={});let re=Y[x];re===void 0&&(re=Y[x]={}),re[I]=z}}}return o===1&&r.parseUShort(),s}function ts(e){let t={};for(let n in e)t[e[n]]=parseInt(n);return t}function Vr(e,t,n,s,r,o){return new A.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:s},{name:"length",type:"USHORT",value:r},{name:"offset",type:"USHORT",value:o}])}function da(e,t){let n=e.length,s=t.length-n+1;e:for(let r=0;r<s;r++)for(;r<s;r++){for(let o=0;o<n;o++)if(t[r+o]!==e[o])continue e;return r}return-1}function zr(e,t){let n=da(e,t);if(n<0){n=t.length;let s=0,r=e.length;for(;s<r;++s)t.push(e[s])}return n}function ga(e,t){let n=ts(Hr),s=ts(_r),r=ts(Gr),o=[],i=[];for(let l in e){let c,u=[],m={},d=ts(es),x=n[l];for(let v in e[l]){let S=d[v];if(S===void 0&&(S=v),c=parseInt(S),isNaN(c))throw new Error('Name table entry "'+v+'" does not exist, see nameTableNames for complete list.');m[c]=e[l][v],u.push(c)}for(let v=0;v<u.length;v++){c=u[v];let S=m[c];for(let I in S){let _=S[I];if(x===1||x===0){let P=s[I],z=la[P],Y=Ds(x,z,P),re=D.MACSTRING(_,Y);if(x===0&&(P=t.indexOf(I),P<0&&(P=t.length,t.push(I)),z=4,re=D.UTF16(_)),re!==void 0){let ie=zr(re,i);o.push(Vr(x,z,P,c,re.length,ie))}}if(x===3){let P=r[I];if(P!==void 0){let z=D.UTF16(_),Y=zr(z,i);o.push(Vr(3,1,P,c,z.length,Y))}}}}}o.sort(function(l,c){return l.platformID-c.platformID||l.encodingID-c.encodingID||l.languageID-c.languageID||l.nameID-c.nameID});let a=new A.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:o.length},{name:"stringOffset",type:"USHORT",value:6+o.length*12}]);for(let l=0;l<o.length;l++)a.fields.push({name:"record_"+l,type:"RECORD",value:o[l]});return a.fields.push({name:"strings",type:"LITERAL",value:i}),a}function ns(e,t,n=[]){if(t<256&&t in es){if(n.length&&!n.includes(parseInt(t)))return;t=es[t]}for(let s in e)for(let r in e[s])if(r===t||parseInt(r)===t)return e[s][r]}var jr={parse:ha,make:ga,getNameByID:ns};function ma(e,t,n,s){e.length=t.parseUShort(),e.language=t.parseUShort()-1;let r=t.parseByteList(e.length),o=Object.assign({},r),i=Ds(n,s,e.language),a=jn[i];for(let l=0;l<a.length;l++)o[a.charCodeAt(l)]=r[128+l];e.glyphIndexMap=o}function ya(e,t,n){t.parseUShort(),e.length=t.parseULong(),e.language=t.parseULong();let s;e.groupCount=s=t.parseULong(),e.glyphIndexMap={};for(let r=0;r<s;r+=1){let o=t.parseULong(),i=t.parseULong(),a=t.parseULong();for(let l=o;l<=i;l+=1)e.glyphIndexMap[l]=a,n===12&&a++}}function ba(e,t,n,s,r){e.length=t.parseUShort(),e.language=t.parseUShort();let o;e.segCount=o=t.parseUShort()>>1,t.skip("uShort",3),e.glyphIndexMap={};let i=new F.Parser(n,s+r+14),a=new F.Parser(n,s+r+16+o*2),l=new F.Parser(n,s+r+16+o*4),c=new F.Parser(n,s+r+16+o*6),u=s+r+16+o*8;for(let m=0;m<o-1;m+=1){let d,x=i.parseUShort(),v=a.parseUShort(),S=l.parseShort(),I=c.parseUShort();for(let _=v;_<=x;_+=1)I!==0?(u=c.offset+c.relativeOffset-2,u+=I,u+=(_-v)*2,d=F.getUShort(n,u),d!==0&&(d=d+S&65535)):d=_+S&65535,e.glyphIndexMap[_]=d}}function va(e,t){let n={};t.skip("uLong");let s=t.parseULong();for(let r=0;r<s;r+=1){let o=t.parseUInt24(),i={varSelector:o},a=t.parseOffset32(),l=t.parseOffset32(),c=t.relativeOffset;a&&(t.relativeOffset=a,i.defaultUVS=t.parseStruct({ranges:function(){return t.parseRecordList32({startUnicodeValue:t.parseUInt24,additionalCount:t.parseByte})}})),l&&(t.relativeOffset=l,i.nonDefaultUVS=t.parseStruct({uvsMappings:function(){let u={},m=t.parseRecordList32({unicodeValue:t.parseUInt24,glyphID:t.parseUShort});for(let d=0;d<m.length;d+=1)u[m[d].unicodeValue]=m[d];return u}})),n[o]=i,t.relativeOffset=c}e.varSelectorList=n}function xa(e,t){let n={};n.version=F.getUShort(e,t),B.argument(n.version===0,"cmap table version should be 0."),n.numTables=F.getUShort(e,t+2);let s=null,r=-1,o=-1,i=null,a=null,l=[0,1,2,3,4,6],c=[0,1,10];for(let m=n.numTables-1;m>=0;m-=1)if(i=F.getUShort(e,t+4+m*8),a=F.getUShort(e,t+4+m*8+2),i===3&&c.includes(a)||i===0&&l.includes(a)||i===1&&a===0){if(o>0)continue;if(o=F.getULong(e,t+4+m*8+4),s)break}else if(i===0&&a===5){if(r=F.getULong(e,t+4+m*8+4),s=new F.Parser(e,t+r),s.parseUShort()!==14)r=-1,s=null;else if(o>0)break}if(o===-1)throw new Error("No valid cmap sub-tables found.");let u=new F.Parser(e,t+o);if(n.format=u.parseUShort(),n.format===0)ma(n,u,i,a);else if(n.format===12||n.format===13)ya(n,u,n.format);else if(n.format===4)ba(n,u,e,t,o);else throw new Error("Only format 0 (platformId 1, encodingId 0), 4, 12 and 14 cmap tables are supported (found format "+n.format+", platformId "+i+", encodingId "+a+").");return s&&va(n,s),n}function Sa(e,t,n){e.segments.push({end:t,start:t,delta:-(t-n),offset:0,glyphIndex:n})}function ka(e){e.segments.push({end:65535,start:65535,delta:1,offset:0})}function Ta(e){if(e.length===0)return e;let t=[e[0]];for(let n=1;n<e.length;n++){let s=t[t.length-1],r=e[n];s.end+1===r.start&&s.delta===r.delta&&r.end!==65535?s.end=r.end:t.push(r)}return t}function Ca(e){let t=!0,n;for(n=e.length-1;n>0;n-=1)if(e.get(n).unicode>65535){t=!1;break}let s=[{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||s.push({name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}),s.push({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});let r=new A.Table("cmap",s);for(r.segments=[],n=0;n<e.length;n+=1){let x=e.get(n);for(let v=0;v<x.unicodes.length;v+=1)Sa(r,x.unicodes[v],n)}r.segments.sort(function(x,v){return x.start-v.start}),r.segments=Ta(r.segments),ka(r);let o=r.segments.length,i=0,a=[],l=[],c=[],u=[],m=[],d=[];for(n=0;n<o;n+=1){let x=r.segments[n];x.end<=65535&&x.start<=65535?(a.push({name:"end_"+n,type:"USHORT",value:x.end}),l.push({name:"start_"+n,type:"USHORT",value:x.start}),c.push({name:"idDelta_"+n,type:"SHORT",value:x.delta}),u.push({name:"idRangeOffset_"+n,type:"USHORT",value:x.offset}),x.glyphId!==void 0&&m.push({name:"glyph_"+n,type:"USHORT",value:x.glyphId})):i+=1,!t&&x.glyphIndex!==void 0&&(d.push({name:"cmap12Start_"+n,type:"ULONG",value:x.start}),d.push({name:"cmap12End_"+n,type:"ULONG",value:x.end}),d.push({name:"cmap12Glyph_"+n,type:"ULONG",value:x.glyphIndex}))}r.segCountX2=(o-i)*2,r.searchRange=Math.pow(2,Math.floor(Math.log(o-i)/Math.log(2)))*2,r.entrySelector=Math.log(r.searchRange/2)/Math.log(2),r.rangeShift=r.segCountX2-r.searchRange;for(let x=0;x<a.length;x++)r.fields.push(a[x]);r.fields.push({name:"reservedPad",type:"USHORT",value:0});for(let x=0;x<l.length;x++)r.fields.push(l[x]);for(let x=0;x<c.length;x++)r.fields.push(c[x]);for(let x=0;x<u.length;x++)r.fields.push(u[x]);for(let x=0;x<m.length;x++)r.fields.push(m[x]);if(r.cmap4Length=14+a.length*2+2+l.length*2+c.length*2+u.length*2+m.length*2,!t){let x=16+d.length*4;r.cmap12Offset=20+r.cmap4Length,r.fields.push({name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:x},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:d.length/3});for(let v=0;v<d.length;v++)r.fields.push(d[v])}return r}var Wr={parse:xa,make:Ca},ss=[".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"],Oa=[".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"],Ia=[".notdef","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"],wa=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","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"],Fs=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],Ea=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],qt=[".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"];function qr(e){this.font=e}qr.prototype.charToGlyphIndex=function(e){let t=e.codePointAt(0),n=this.font.glyphs;if(n)for(let s=0;s<n.length;s+=1){let r=n.get(s);for(let o=0;o<r.unicodes.length;o+=1)if(r.unicodes[o]===t)return s}return null};function $r(e){this.cmap=e}$r.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.codePointAt(0)]||0};function Xr(e,t){this.encoding=e,this.charset=t}Xr.prototype.charToGlyphIndex=function(e){let t=e.codePointAt(0),n=this.encoding[t];return this.charset.indexOf(n)};function Us(e){switch(e.version){case 1:this.names=qt.slice();break;case 2:this.names=new Array(e.numberOfGlyphs);for(let t=0;t<e.numberOfGlyphs;t++)e.glyphNameIndex[t]<qt.length?this.names[t]=qt[e.glyphNameIndex[t]]:this.names[t]=e.names[e.glyphNameIndex[t]-qt.length];break;case 2.5:this.names=new Array(e.numberOfGlyphs);for(let t=0;t<e.numberOfGlyphs;t++)this.names[t]=qt[t+e.glyphNameIndex[t]];break;case 3:this.names=[];break;default:this.names=[];break}}Us.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)},Us.prototype.glyphIndexToName=function(e){return this.names[e]};function La(e){let t,n=e.tables.cmap.glyphIndexMap,s=Object.keys(n);for(let r=0;r<s.length;r+=1){let o=s[r],i=n[o];t=e.glyphs.get(i),t.addUnicode(parseInt(o))}for(let r=0;r<e.glyphs.length;r+=1)t=e.glyphs.get(r),e.cffEncoding?t.name=e.cffEncoding.charset[r]:e.glyphNames.names&&(t.name=e.glyphNames.glyphIndexToName(r))}function Aa(e){e._IndexToUnicodeMap={};let t=e.tables.cmap.glyphIndexMap,n=Object.keys(t);for(let s=0;s<n.length;s+=1){let r=n[s],o=t[r];e._IndexToUnicodeMap[o]===void 0?e._IndexToUnicodeMap[o]={unicodes:[parseInt(r)]}:e._IndexToUnicodeMap[o].unicodes.push(parseInt(r))}}function Ra(e,t){t.lowMemory?Aa(e):La(e)}function Da(e,t,n,s,r){e.beginPath(),e.moveTo(t,n),e.lineTo(s,r),e.stroke()}var $t={line:Da};function Fa(e,t){let n=new C(e,t),s=n.parseShort();s!==0&&console.warn("Only CPALv0 is currently fully supported.");let r=n.parseShort(),o=n.parseShort(),i=n.parseShort(),a=n.parseOffset32(),l=n.parseUShortList(o);n.relativeOffset=a;let c=n.parseULongList(i);return n.relativeOffset=a,{version:s,numPaletteEntries:r,colorRecords:c,colorRecordIndices:l}}function Ua({version:e=0,numPaletteEntries:t=0,colorRecords:n=[],colorRecordIndices:s=[0]}){return B.argument(e===0,"Only CPALv0 are supported."),B.argument(n.length,"No colorRecords given."),B.argument(s.length,"No colorRecordIndices given."),s.length>1&&B.argument(t,"Can't infer numPaletteEntries on multiple colorRecordIndices"),new A.Table("CPAL",[{name:"version",type:"USHORT",value:e},{name:"numPaletteEntries",type:"USHORT",value:t||n.length},{name:"numPalettes",type:"USHORT",value:s.length},{name:"numColorRecords",type:"USHORT",value:n.length},{name:"colorRecordsArrayOffset",type:"ULONG",value:12+2*s.length},...s.map((r,o)=>({name:"colorRecordIndices_"+o,type:"USHORT",value:r})),...n.map((r,o)=>({name:"colorRecords_"+o,type:"ULONG",value:r}))])}function Yr(e){var t=(e&4278190080)>>24,n=(e&16711680)>>16,s=(e&65280)>>8,r=e&255;return t=t+256&255,n=n+256&255,s=s+256&255,r=(r+256&255)/255,{b:t,g:n,r:s,a:r}}function Ms(e,t,n=0,s="hexa"){if(t==65535)return"currentColor";let r=e&&e.tables&&e.tables.cpal;if(!r)return"currentColor";if(n>r.colorRecordIndices.length-1)throw new Error(`Palette index out of range (colorRecordIndices.length: ${r.colorRecordIndices.length}, index: ${t})`);if(t>r.numPaletteEntries)throw new Error(`Color index out of range (numPaletteEntries: ${r.numPaletteEntries}, index: ${t})`);let o=r.colorRecordIndices[n]+t;if(o>r.colorRecords)throw new Error(`Color index out of range (colorRecords.length: ${r.colorRecords.length}, lookupIndex: ${o})`);let i=Yr(r.colorRecords[o]);return s==="bgra"?i:cn(i,s)}function nt(e){return("0"+parseInt(e).toString(16)).slice(-2)}function Ma(e){let t=e.r/255,n=e.g/255,s=e.b/255,r=Math.max(t,n,s),o=Math.min(t,n,s),i,a,l=(r+o)/2;if(r===o)i=a=0;else{let c=r-o;switch(a=l>.5?c/(2-r-o):c/(r+o),r){case t:i=(n-s)/c+(n<s?6:0);break;case n:i=(s-t)/c+2;break;case s:i=(t-n)/c+4;break}i/=6}return{h:i*360,s:a*100,l:l*100}}function Pa(e){let{h:t,s:n,l:s,a:r}=e;t=t%360,n/=100,s/=100;let o=(1-Math.abs(2*s-1))*n,i=o*(1-Math.abs(t/60%2-1)),a=s-o/2,l=0,c=0,u=0;return 0<=t&&t<60?(l=o,c=i,u=0):60<=t&&t<120?(l=i,c=o,u=0):120<=t&&t<180?(l=0,c=o,u=i):180<=t&&t<240?(l=0,c=i,u=o):240<=t&&t<300?(l=i,c=0,u=o):300<=t&&t<=360&&(l=o,c=0,u=i),{r:Math.round((l+a)*255),g:Math.round((c+a)*255),b:Math.round((u+a)*255),a:r}}function Zr(e){return parseInt(`0x${nt(e.b)}${nt(e.g)}${nt(e.r)}${nt(e.a*255)}`,16)}function rs(e,t="hexa"){let n=t=="raw"||t=="cpal",s=Number.isInteger(e),r=!0;if(s&&n||e==="currentColor")return e;if(typeof e=="object"){if(t=="bgra")return e;if(n)return Zr(e)}else if(!s&&/^#([a-f0-9]{3}|[a-f0-9]{4}|[a-f0-9]{6}|[a-f0-9]{8})$/i.test(e.trim())){switch(e=e.trim().substring(1),e.length){case 3:e={r:parseInt(e[0].repeat(2),16),g:parseInt(e[1].repeat(2),16),b:parseInt(e[2].repeat(2),16),a:1};break;case 4:e={r:parseInt(e[0].repeat(2),16),g:parseInt(e[1].repeat(2),16),b:parseInt(e[2].repeat(2),16),a:parseInt(e[3].repeat(2),16)/255};break;case 6:e={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16),a:1};break;case 8:e={r:parseInt(e[0]+e[1],16),g:parseInt(e[2]+e[3],16),b:parseInt(e[4]+e[5],16),a:parseInt(e[6]+e[7],16)/255};break}if(t=="bgra")return e}else if(typeof document<"u"&&/^[a-z]+$/i.test(e)){let o=document.createElement("canvas").getContext("2d");o.fillStyle=e;let i=cn(o.fillStyle,"hexa");i==="#000000ff"&&e.toLowerCase()!=="black"?r=!1:e=i}else{e=e.trim();let o=/rgba?\(\s*(?:(\d*\.\d+)(%?)|(\d+)(%?))\s*(?:,|\s*)\s*(?:(\d*\.\d+)(%?)|(\d+)(%?))\s*(?:,|\s*)\s*(?:(\d*\.\d+)(%?)|(\d+)(%?))\s*(?:(?:,|\s|\/)\s*(?:(0*(?:\.\d+)?()|0*1(?:\.0+)?())|(?:\.\d+)|(\d+)(%)|(\d*\.\d+)(%)))?\s*\)/;if(o.test(e)){let i=e.match(o).filter(a=>typeof a<"u");e={r:Math.round(parseFloat(i[1])/(i[2]?.39215686274509803:1)),g:Math.round(parseFloat(i[3])/(i[4]?.39215686274509803:1)),b:Math.round(parseFloat(i[5])/(i[6]?.39215686274509803:1)),a:i[7]?parseFloat(i[7])/(i[8]?100:1):1}}else{let i=/hsla?\(\s*(?:(\d*\.\d+|\d+)(deg|turn|))\s*(?:,|\s*)\s*(?:(\d*\.\d+)%?|(\d+)%?)\s*(?:,|\s*)\s*(?:(\d*\.\d+)%?|(\d+)%?)\s*(?:(?:,|\s|\/)\s*(?:(0*(?:\.\d+)?()|0*1(?:\.0+)?())|(?:\.\d+)|(\d+)(%)|(\d*\.\d+)(%)))?\s*\)/;if(i.test(e)){let a=e.match(i).filter(l=>typeof l<"u");e=Pa({h:parseFloat(a[1])*(a[2]==="turn"?360:1),s:parseFloat(a[3]),l:parseFloat(a[4]),a:a[5]?parseFloat(a[5])/(a[6]?100:1):1})}else r=!1}}if(!r)throw new Error(`Invalid color format: ${e}`);return cn(e,t)}function cn(e,t="hexa"){if(e==="currentColor")return e;if(Number.isInteger(e)){if(t=="raw"||t=="cpal")return e;e=Yr(e)}else typeof e!="object"&&(e=rs(e,"bgra"));let n=["hsl","hsla"].includes(t)?Ma(e):null;switch(t){case"rgba":return`rgba(${e.r}, ${e.g}, ${e.b}, ${parseFloat(e.a.toFixed(3))})`;case"rgb":return`rgb(${e.r}, ${e.g}, ${e.b})`;case"hex":case"hex6":case"hex-6":return`#${nt(e.r)}${nt(e.g)}${nt(e.b)}`;case"hexa":case"hex8":case"hex-8":return`#${nt(e.r)}${nt(e.g)}${nt(e.b)}${nt(e.a*255)}`;case"hsl":return`hsl(${n.h.toFixed(2)}, ${n.s.toFixed(2)}%, ${n.l.toFixed(2)}%)`;case"hsla":return`hsla(${n.h.toFixed(2)}, ${n.s.toFixed(2)}%, ${n.l.toFixed(2)}%, ${parseFloat(e.a.toFixed(3))})`;case"bgra":return e;case"raw":case"cpal":return Zr(e);default:throw new Error("Unknown color format: "+t)}}var Kr={parse:Fa,make:Ua,getPaletteColor:Ms,parseColor:rs,formatColor:cn};function Na(e,t){let n=t||new Wt;return{configurable:!0,get:function(){return typeof n=="function"&&(n=n()),n},set:function(s){n=s}}}function we(e){this.bindConstructorValues(e)}we.prototype.bindConstructorValues=function(e){if(this.index=e.index||0,e.name===".notdef"?e.unicode=void 0:e.name===".null"&&(e.unicode=0),e.unicode===0&&e.name!==".null")throw new Error('The unicode value "0" is reserved for the glyph name ".null" and cannot be used by any other glyph.');this.name=e.name||null,this.unicode=e.unicode,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),"leftSideBearing"in e&&(this.leftSideBearing=e.leftSideBearing),"points"in e&&(this.points=e.points),Object.defineProperty(this,"path",Na(this,e.path))},we.prototype.addUnicode=function(e){this.unicodes.length===0&&(this.unicode=e),this.unicodes.push(e)},we.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},we.prototype.getPath=function(e,t,n,s,r){e=e!==void 0?e:0,t=t!==void 0?t:0,n=n!==void 0?n:72,s=Object.assign({},r&&r.defaultRenderOptions,s);let o,i,a=s.xScale,l=s.yScale,c=1/(this.path.unitsPerEm||1e3)*n,u=this;r&&r.variation&&(u=r.variation.getTransform(this,s.variation),o=u.path.commands),s.hinting&&r&&r.hinting&&(i=u.path&&r.hinting.exec(u,n,s)),i?(o=r.hinting.getCommands(i),e=Math.round(e),t=Math.round(t),a=l=1):(o=u.path.commands,a===void 0&&(a=c),l===void 0&&(l=c));let m=new Wt;if(s.drawSVG){let d=this.getSvgImage(r);if(d){let x=new Wt;return x._image={image:d.image,x:e+d.leftSideBearing*c,y:t-d.baseline*c,width:d.image.width*c,height:d.image.height*c},m._layers=[x],m}}if(s.drawLayers){let d=this.getLayers(r);if(d&&d.length){m._layers=[];for(let x=0;x<d.length;x+=1){let v=d[x],S=Ms(r,v.paletteIndex,s.usePalette);S==="currentColor"?S=s.fill||"black":S=cn(S,s.colorFormat||"rgba"),s=Object.assign({},s,{fill:S}),m._layers.push(this.getPath.call(v.glyph,e,t,n,s,r))}return m}}m.fill=s.fill||this.path.fill,m.stroke=this.path.stroke,m.strokeWidth=this.path.strokeWidth*c;for(let d=0;d<o.length;d+=1){let x=o[d];x.type==="M"?m.moveTo(e+x.x*a,t+-x.y*l):x.type==="L"?m.lineTo(e+x.x*a,t+-x.y*l):x.type==="Q"?m.quadraticCurveTo(e+x.x1*a,t+-x.y1*l,e+x.x*a,t+-x.y*l):x.type==="C"?m.curveTo(e+x.x1*a,t+-x.y1*l,e+x.x2*a,t+-x.y2*l,e+x.x*a,t+-x.y*l):x.type==="Z"&&m.stroke&&m.strokeWidth&&m.closePath()}return m},we.prototype.getLayers=function(e){if(!e)throw new Error("The font object is required to read the colr/cpal tables in order to get the layers.");return e.layers.get(this.index)},we.prototype.getSvgImage=function(e){if(!e)throw new Error("The font object is required to read the svg table in order to get the image.");return e.svgImages.get(this.index)},we.prototype.getContours=function(e=null){if(this.points===void 0&&!e)return[];let t=[],n=[],s=e||this.points;for(let r=0;r<s.length;r+=1){let o=s[r];n.push(o),o.lastPointOfContour&&(t.push(n),n=[])}return B.argument(n.length===0,"There are still points left in the current contour."),t},we.prototype.getMetrics=function(){let e=this.path.commands,t=[],n=[];for(let r=0;r<e.length;r+=1){let o=e[r];o.type!=="Z"&&(t.push(o.x),n.push(o.y)),(o.type==="Q"||o.type==="C")&&(t.push(o.x1),n.push(o.y1)),o.type==="C"&&(t.push(o.x2),n.push(o.y2))}let s={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(s.xMin)||(s.xMin=0),isFinite(s.xMax)||(s.xMax=this.advanceWidth),isFinite(s.yMin)||(s.yMin=0),isFinite(s.yMax)||(s.yMax=0),s.rightSideBearing=this.advanceWidth-s.leftSideBearing-(s.xMax-s.xMin),s},we.prototype.draw=function(e,t,n,s,r,o){r=Object.assign({},o&&o.defaultRenderOptions,r),this.getPath(t,n,s,r,o).draw(e)},we.prototype.drawPoints=function(e,t,n,s,r,o){if(r=Object.assign({},o&&o.defaultRenderOptions,r),r.drawLayers){let d=this.getLayers(o);if(d&&d.length){for(let x=0;x<d.length;x+=1)d[x].glyph.index!==this.index&&this.drawPoints.call(d[x].glyph,e,t,n,s);return}}function i(d,x,v,S){e.beginPath();for(let I=0;I<d.length;I+=1)e.moveTo(x+d[I].x*S,v+d[I].y*S),e.arc(x+d[I].x*S,v+d[I].y*S,2,0,Math.PI*2,!1);e.fill()}t=t!==void 0?t:0,n=n!==void 0?n:0,s=s!==void 0?s:24;let a=1/this.path.unitsPerEm*s,l=[],c=[],m=this.path.commands;o&&o.variation&&(m=o.variation.getTransform(this,r.variation).path.commands);for(let d=0;d<m.length;d+=1){let x=m[d];x.x!==void 0&&l.push({x:x.x,y:-x.y}),x.x1!==void 0&&c.push({x:x.x1,y:-x.y1}),x.x2!==void 0&&c.push({x:x.x2,y:-x.y2})}e.fillStyle="blue",i(l,t,n,a),e.fillStyle="red",i(c,t,n,a)},we.prototype.drawMetrics=function(e,t,n,s){let r;t=t!==void 0?t:0,n=n!==void 0?n:0,s=s!==void 0?s:24,r=1/this.path.unitsPerEm*s,e.lineWidth=1,e.strokeStyle="black",$t.line(e,t,-1e4,t,1e4),$t.line(e,-1e4,n,1e4,n);let o=this.xMin||0,i=this.yMin||0,a=this.xMax||0,l=this.yMax||0,c=this.advanceWidth||0;e.strokeStyle="blue",$t.line(e,t+o*r,-1e4,t+o*r,1e4),$t.line(e,t+a*r,-1e4,t+a*r,1e4),$t.line(e,-1e4,n+-i*r,1e4,n+-i*r),$t.line(e,-1e4,n+-l*r,1e4,n+-l*r),e.strokeStyle="green",$t.line(e,t+c*r,-1e4,t+c*r,1e4)},we.prototype.toPathData=function(e,t){e=Object.assign({},{variation:t&&t.defaultRenderOptions.variation},e);let n=this;t&&t.variation&&(n=t.variation.getTransform(this,e.variation));let s=n.points&&e.pointsTransform?e.pointsTransform(n.points):n.path;return e.pathTransform&&(s=e.pathTransform(s)),s.toPathData(e)},we.prototype.fromSVG=function(e,t={}){return this.path.fromSVG(e,t)},we.prototype.toSVG=function(e,t){let n=this.toPathData.apply(this,[e,t]);return this.path.toSVG(e,n)},we.prototype.toDOMElement=function(e,t){e=Object.assign({},{variation:t&&t.defaultRenderOptions.variation},e);let n=this.path;return t&&t.variation&&(n=t.variation.getTransform(this,e.variation).path),n.toDOMElement(e)};var fn=we;function pn(e,t,n){Object.defineProperty(e,t,{get:function(){return typeof e[n]>"u"&&e.path,e[n]},set:function(s){e[n]=s},enumerable:!0,configurable:!0})}function os(e,t){if(this.font=e,this.glyphs={},Array.isArray(t))for(let n=0;n<t.length;n++){let s=t[n];s.path.unitsPerEm=e.unitsPerEm,this.glyphs[n]=s}this.length=t&&t.length||0}typeof Symbol<"u"&&Symbol.iterator&&(os.prototype[Symbol.iterator]=function(){let e=-1;return{next:function(){e++;let t=e>=this.length-1;return{value:this.get(e),done:t}}.bind(this)}}),os.prototype.get=function(e){if(this.font._push&&this.glyphs[e]===void 0){this.font._push(e),typeof this.glyphs[e]=="function"&&(this.glyphs[e]=this.glyphs[e]());let t=this.glyphs[e],n=this.font._IndexToUnicodeMap[e];if(n)for(let s=0;s<n.unicodes.length;s++)t.addUnicode(n.unicodes[s]);this.font.cffEncoding?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]},os.prototype.push=function(e,t){this.glyphs[e]=t,this.length++};function Ba(e,t){return new fn({index:t,font:e})}function _a(e,t,n,s,r,o){return function(){let i=new fn({index:t,font:e});return i.path=function(){n(i,s,r);let a=o(e.glyphs,i);return a.unitsPerEm=e.unitsPerEm,a},pn(i,"numberOfContours","_numberOfContours"),pn(i,"xMin","_xMin"),pn(i,"xMax","_xMax"),pn(i,"yMin","_yMin"),pn(i,"yMax","_yMax"),pn(i,"points","_points"),i}}function Ga(e,t,n,s,r){return function(){let o=new fn({index:t,font:e});return o.path=function(){let i=n(e,o,s,r);return i.unitsPerEm=e.unitsPerEm,i},o}}var mt={GlyphSet:os,glyphLoader:Ba,ttfGlyphLoader:_a,cffGlyphLoader:Ga};function Qr(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!Qr(e[n],t[n]))return!1;return!0}else return!1}var Jr=10;function is(e){let t;return e.length<1240?t=107:e.length<33900?t=1131:t=32768,t}function yt(e,t,n,s){let r=[],o=[],i=s>1?F.getULong(e,t):F.getCard16(e,t),a=s>1?4:2,l,c;if(i!==0){let u=F.getByte(e,t+a);l=t+(i+1)*u+a;let m=t+a+1;for(let d=0;d<i+1;d+=1)r.push(F.getOffset(e,m,u)),m+=u;c=l+r[i]}else c=t+a;for(let u=0;u<r.length-1;u+=1){let m=F.getBytes(e,l+r[u],l+r[u+1]);n&&(m=n(m,e,t,s)),o.push(m)}return{objects:o,startOffset:t,endOffset:c}}function Ha(e,t,n){let s=[],r=n>1?F.getULong(e,t):F.getCard16(e,t),o=n>1?4:2,i,a;if(r!==0){let l=F.getByte(e,t+o);i=t+(r+1)*l+o;let c=t+o+1;for(let u=0;u<r+1;u+=1)s.push(F.getOffset(e,c,l)),c+=l;a=i+s[r]}else a=t+o;return{offsets:s,startOffset:t,endOffset:a}}function Va(e,t,n,s,r,o){let i=o>1?F.getULong(n,s):F.getCard16(n,s),a=o>1?4:2,l=0;if(i!==0){let u=F.getByte(n,s+a);l=s+(i+1)*u+a}let c=F.getBytes(n,l+t[e],l+t[e+1]);return r&&(c=r(c)),c}function za(e){let t="",s=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];for(;;){let r=e.parseByte(),o=r>>4,i=r&15;if(o===15||(t+=s[o],i===15))break;t+=s[i]}return parseFloat(t)}function ja(e,t){let n,s,r,o;if(t===28)return n=e.parseByte(),s=e.parseByte(),n<<8|s;if(t===29)return n=e.parseByte(),s=e.parseByte(),r=e.parseByte(),o=e.parseByte(),n<<24|s<<16|r<<8|o;if(t===30)return za(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 new Error("Invalid b0 "+t)}function Wa(e){let t={};for(let n=0;n<e.length;n+=1){let s=e[n][0],r=e[n][1],o;if(r.length===1?o=r[0]:o=r,Object.prototype.hasOwnProperty.call(t,s)&&!isNaN(t[s]))throw new Error("Object "+t+" already has key "+s);t[s]=o}return t}function Ps(e,t,n,s){t=t!==void 0?t:0;let r=new F.Parser(e,t),o=[],i=[];n=n!==void 0?n:e.byteLength;let a=s<2?22:28;for(;r.relativeOffset<n;){let l=r.parseByte();if(l<a){if(l===12&&(l=1200+r.parseByte()),s>1&&l===23){Ja(i);continue}o.push([l,i]),i=[]}else i.push(ja(r,l,s))}return Wa(o)}function wn(e,t){return t<=390?t=ss[t]:e?t=e[t-391]:t=void 0,t}function Ns(e,t,n){let s={},r;for(let o=0;o<t.length;o+=1){let i=t[o];if(Array.isArray(i.type)){let a=[];a.length=i.type.length;for(let l=0;l<i.type.length;l++)r=e[i.op]!==void 0?e[i.op][l]:void 0,r===void 0&&(r=i.value!==void 0&&i.value[l]!==void 0?i.value[l]:null),i.type[l]==="SID"&&(r=wn(n,r)),a[l]=r;s[i.name]=a}else r=e[i.op],r===void 0&&(r=i.value!==void 0?i.value:null),i.type==="SID"&&(r=wn(n,r)),s[i.name]=r}return s}function qa(e,t){let n={};if(n.formatMajor=F.getCard8(e,t),n.formatMinor=F.getCard8(e,t+1),n.formatMajor>2)throw new Error(`Unsupported CFF table version ${n.formatMajor}.${n.formatMinor}`);return n.size=F.getCard8(e,t+2),n.formatMajor<2?(n.offsetSize=F.getCard8(e,t+3),n.startOffset=t,n.endOffset=t+4):(n.topDictLength=F.getCard16(e,t+3),n.endOffset=t+8),n}var eo=[{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"}],to=[{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"charStrings",op:17,type:"offset"},{name:"fdArray",op:1236,type:"offset"},{name:"fdSelect",op:1237,type:"offset"},{name:"vstore",op:24,type:"offset"}],no=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}],so=[{name:"blueValues",op:6,type:"delta"},{name:"otherBlues",op:7,type:"delta"},{name:"familyBlues",op:7,type:"delta"},{name:"familyBlues",op:8,type:"delta"},{name:"familyOtherBlues",op:9,type:"delta"},{name:"blueScale",op:1209,type:"number",value:.039625},{name:"blueShift",op:1210,type:"number",value:7},{name:"blueFuzz",op:1211,type:"number",value:1},{name:"stdHW",op:10,type:"number"},{name:"stdVW",op:11,type:"number"},{name:"stemSnapH",op:1212,type:"number"},{name:"stemSnapV",op:1213,type:"number"},{name:"languageGroup",op:1217,type:"number",value:0},{name:"expansionFactor",op:1218,type:"number",value:.06},{name:"vsindex",op:22,type:"number",value:0},{name:"subrs",op:19,type:"offset"}],$a=[{name:"private",op:18,type:["number","offset"],value:[0,0]}];function Xa(e,t,n,s){let r=Ps(e,t,e.byteLength,s);return Ns(r,s>1?to:eo,n)}function Bs(e,t,n,s,r){let o=Ps(e,t,n,r);return Ns(o,r>1?so:no,s)}function Ya(e,t,n){let s=Ps(e,t,void 0,n);return Ns(s,$a)}function Za(e,t,n){let s=[];for(let r=0;r<n.length;r++){let o=new DataView(new Uint8Array(n[r]).buffer),i=Ya(o,0,2),a=i.private[0],l=i.private[1];if(a!==0&&l!==0){let c=Bs(e,l+t,a,[],2);if(c.subrs){let u=l+c.subrs,m=yt(e,u+t,void 0,2);i._subrs=m.objects,i._subrsBias=is(i._subrs)}i._privateDict=c}s.push(i)}return s}function _s(e,t,n,s,r){let o=[];for(let i=0;i<n.length;i+=1){let a=new DataView(new Uint8Array(n[i]).buffer),l=Xa(a,0,s,r);l._subrs=[],l._subrsBias=0,l._defaultWidthX=0,l._nominalWidthX=0;let c=r<2?l.private[0]:0,u=r<2?l.private[1]:0;if(c!==0&&u!==0){let m=Bs(e,u+t,c,s,r);if(l._defaultWidthX=m.defaultWidthX,l._nominalWidthX=m.nominalWidthX,m.subrs!==0){let d=u+m.subrs,x=yt(e,d+t,void 0,r);l._subrs=x.objects,l._subrsBias=is(l._subrs)}l._privateDict=m}o.push(l)}return o}function Ka(e,t,n,s,r){let o,i,a=new F.Parser(e,t);n-=1;let l=[".notdef"],c=a.parseCard8();if(c===0)for(let u=0;u<n;u+=1)o=a.parseSID(),r?l.push(o):l.push(wn(s,o)||o);else if(c===1)for(;l.length<=n;){o=a.parseSID(),i=a.parseCard8();for(let u=0;u<=i;u+=1)r?l.push("cid"+("00000"+o).slice(-5)):l.push(wn(s,o)||o),o+=1}else if(c===2)for(;l.length<=n;){o=a.parseSID(),i=a.parseCard16();for(let u=0;u<=i;u+=1)r?l.push("cid"+("00000"+o).slice(-5)):l.push(wn(s,o)||o),o+=1}else throw new Error("Unknown charset format "+c);return l}function Qa(e,t){let n,s={},r=new F.Parser(e,t),o=r.parseCard8();if(o===0){let i=r.parseCard8();for(let a=0;a<i;a+=1)n=r.parseCard8(),s[n]=a}else if(o===1){let i=r.parseCard8();n=1;for(let a=0;a<i;a+=1){let l=r.parseCard8(),c=r.parseCard8();for(let u=l;u<=l+c;u+=1)s[u]=n,n+=1}}else throw new Error("Unknown encoding format "+o);return s}function Ja(e){let t=e.pop();for(;e.length>t;)e.pop()}function ro(e,t){let n=e.tables.cff&&e.tables.cff.topDict&&e.tables.cff.topDict.paintType||0;return n===2&&(t.fill=null,t.stroke="black",t.strokeWidth=e.tables.cff.topDict.strokeWidth||0),n}function Gs(e,t,n,s,r){let o,i,a,l,c=new Wt,u=[],m=0,d=!1,x=!1,v=0,S=0,I,_,P,z,Y=0,re=[],ie,ae=0,me=e.tables.cff2||e.tables.cff;if(P=me.topDict._defaultWidthX,z=me.topDict._nominalWidthX,r=r||e.variation&&e.variation.get(),t.getBlendPath||(t.getBlendPath=function(U){return Gs(e,t,n,s,U)}),e.isCIDFont||s>1){let U=me.topDict._fdSelect?me.topDict._fdSelect[t.index]:0,M=me.topDict._fdArray[U];I=M._subrs,_=M._subrsBias,s>1?(re=me.topDict._vstore.itemVariationStore,Y=M._privateDict.vsindex):(P=M._defaultWidthX,z=M._nominalWidthX)}else I=me.topDict._subrs,_=me.topDict._subrsBias;let ot=ro(e,c),Z=P;function Ve(U,M){x&&ot!==2&&c.closePath(),c.moveTo(U,M),x=!0}function De(){let U;U=(u.length&1)!==0,U&&!d&&(Z=u.shift()+z),m+=u.length>>1,u.length=0,d=!0}function G(U){let M,Ee,Mt,ms,Kt,it,Fe,Ke,Le,ze,Ue,Me,ge=0;for(;ge<U.length;){let Je=U[ge];switch(ge+=1,Je){case 1:De();break;case 3:De();break;case 4:u.length>1&&!d&&(Z=u.shift()+z,d=!0),S+=u.pop(),Ve(v,S);break;case 5:for(;u.length>0;)v+=u.shift(),S+=u.shift(),c.lineTo(v,S);break;case 6:for(;u.length>0&&(v+=u.shift(),c.lineTo(v,S),u.length!==0);)S+=u.shift(),c.lineTo(v,S);break;case 7:for(;u.length>0&&(S+=u.shift(),c.lineTo(v,S),u.length!==0);)v+=u.shift(),c.lineTo(v,S);break;case 8:for(;u.length>0;)o=v+u.shift(),i=S+u.shift(),a=o+u.shift(),l=i+u.shift(),v=a+u.shift(),S=l+u.shift(),c.curveTo(o,i,a,l,v,S);break;case 10:if(Kt=u.pop()+_,it=I[Kt],it){if(ae>=Jr){console.warn("CFF charstring subroutine call depth exceeded, skipping callsubr");break}ae++,G(it),ae--}break;case 11:if(s>1){console.error("CFF CharString operator return (11) is not supported in CFF2");break}return;case 12:switch(Je=U[ge],ge+=1,Je){case 35:o=v+u.shift(),i=S+u.shift(),a=o+u.shift(),l=i+u.shift(),Fe=a+u.shift(),Ke=l+u.shift(),Le=Fe+u.shift(),ze=Ke+u.shift(),Ue=Le+u.shift(),Me=ze+u.shift(),v=Ue+u.shift(),S=Me+u.shift(),u.shift(),c.curveTo(o,i,a,l,Fe,Ke),c.curveTo(Le,ze,Ue,Me,v,S);break;case 34:o=v+u.shift(),i=S,a=o+u.shift(),l=i+u.shift(),Fe=a+u.shift(),Ke=l,Le=Fe+u.shift(),ze=l,Ue=Le+u.shift(),Me=S,v=Ue+u.shift(),c.curveTo(o,i,a,l,Fe,Ke),c.curveTo(Le,ze,Ue,Me,v,S);break;case 36:o=v+u.shift(),i=S+u.shift(),a=o+u.shift(),l=i+u.shift(),Fe=a+u.shift(),Ke=l,Le=Fe+u.shift(),ze=l,Ue=Le+u.shift(),Me=ze+u.shift(),v=Ue+u.shift(),c.curveTo(o,i,a,l,Fe,Ke),c.curveTo(Le,ze,Ue,Me,v,S);break;case 37:o=v+u.shift(),i=S+u.shift(),a=o+u.shift(),l=i+u.shift(),Fe=a+u.shift(),Ke=l+u.shift(),Le=Fe+u.shift(),ze=Ke+u.shift(),Ue=Le+u.shift(),Me=ze+u.shift(),Math.abs(Ue-v)>Math.abs(Me-S)?v=Ue+u.shift():S=Me+u.shift(),c.curveTo(o,i,a,l,Fe,Ke),c.curveTo(Le,ze,Ue,Me,v,S);break;default:console.log("Glyph "+t.index+": unknown operator 1200"+Je),u.length=0}break;case 14:if(s>1){console.error("CFF CharString operator endchar (14) is not supported in CFF2");break}if(u.length>=4){let Qt=Fs[u.pop()],mn=Fs[u.pop()],ys=u.pop(),bs=u.pop();if(Qt&&mn){t.isComposite=!0,t.components=[];let xi=e.cffEncoding.charset.indexOf(Qt),Si=e.cffEncoding.charset.indexOf(mn);t.components.push({glyphIndex:Si,dx:0,dy:0}),t.components.push({glyphIndex:xi,dx:bs,dy:ys}),c.extend(e.glyphs.get(Si).path);let Np=e.glyphs.get(xi),rr=JSON.parse(JSON.stringify(Np.path.commands));for(let or=0;or<rr.length;or+=1){let vt=rr[or];vt.type!=="Z"&&(vt.x+=bs,vt.y+=ys),(vt.type==="Q"||vt.type==="C")&&(vt.x1+=bs,vt.y1+=ys),vt.type==="C"&&(vt.x2+=bs,vt.y2+=ys)}c.extend(rr)}}else u.length>0&&!d&&(Z=u.shift()+z,d=!0);x&&ot!==2&&(c.closePath(),x=!1);break;case 15:if(s<2){console.error("CFF2 CharString operator vsindex (15) is not supported in CFF");break}Y=u.pop();break;case 16:if(s<2){console.error("CFF2 CharString operator blend (16) is not supported in CFF");break}ie||(ie=e.variation&&r&&e.variation.process.getBlendVector(re,Y,r));var le=u.pop(),_e=ie?ie.length:re.itemVariationSubtables[Y].regionIndexes.length,Qe=le*_e,at=u.length-Qe,Ct=at-le;if(ie)for(let Qt=0;Qt<le;Qt++){var vi=u[Ct+Qt];for(let mn=0;mn<_e;mn++)vi+=ie[mn]*u[at++];u[Ct+Qt]=vi}for(;Qe--;)u.pop();break;case 18:De();break;case 19:case 20:De(),ge+=m+7>>3;break;case 21:u.length>2&&!d&&(Z=u.shift()+z,d=!0),S+=u.pop(),v+=u.pop(),Ve(v,S);break;case 22:u.length>1&&!d&&(Z=u.shift()+z,d=!0),v+=u.pop(),Ve(v,S);break;case 23:De();break;case 24:for(;u.length>2;)o=v+u.shift(),i=S+u.shift(),a=o+u.shift(),l=i+u.shift(),v=a+u.shift(),S=l+u.shift(),c.curveTo(o,i,a,l,v,S);v+=u.shift(),S+=u.shift(),c.lineTo(v,S);break;case 25:for(;u.length>6;)v+=u.shift(),S+=u.shift(),c.lineTo(v,S);o=v+u.shift(),i=S+u.shift(),a=o+u.shift(),l=i+u.shift(),v=a+u.shift(),S=l+u.shift(),c.curveTo(o,i,a,l,v,S);break;case 26:for(u.length&1&&(v+=u.shift());u.length>0;)o=v,i=S+u.shift(),a=o+u.shift(),l=i+u.shift(),v=a,S=l+u.shift(),c.curveTo(o,i,a,l,v,S);break;case 27:for(u.length&1&&(S+=u.shift());u.length>0;)o=v+u.shift(),i=S,a=o+u.shift(),l=i+u.shift(),v=a+u.shift(),S=l,c.curveTo(o,i,a,l,v,S);break;case 28:M=U[ge],Ee=U[ge+1],u.push((M<<24|Ee<<16)>>16),ge+=2;break;case 29:if(Kt=u.pop()+e.gsubrsBias,it=e.gsubrs[Kt],it){if(ae>=Jr){console.warn("CFF charstring subroutine call depth exceeded, skipping callgsubr");break}ae++,G(it),ae--}break;case 30:for(;u.length>0&&(o=v,i=S+u.shift(),a=o+u.shift(),l=i+u.shift(),v=a+u.shift(),S=l+(u.length===1?u.shift():0),c.curveTo(o,i,a,l,v,S),u.length!==0);)o=v+u.shift(),i=S,a=o+u.shift(),l=i+u.shift(),S=l+u.shift(),v=a+(u.length===1?u.shift():0),c.curveTo(o,i,a,l,v,S);break;case 31:for(;u.length>0&&(o=v+u.shift(),i=S,a=o+u.shift(),l=i+u.shift(),S=l+u.shift(),v=a+(u.length===1?u.shift():0),c.curveTo(o,i,a,l,v,S),u.length!==0);)o=v,i=S+u.shift(),a=o+u.shift(),l=i+u.shift(),v=a+u.shift(),S=l+(u.length===1?u.shift():0),c.curveTo(o,i,a,l,v,S);break;default:Je<32?console.log("Glyph "+t.index+": unknown operator "+Je):Je<247?u.push(Je-139):Je<251?(M=U[ge],ge+=1,u.push((Je-247)*256+M+108)):Je<255?(M=U[ge],ge+=1,u.push(-(Je-251)*256-M-108)):(M=U[ge],Ee=U[ge+1],Mt=U[ge+2],ms=U[ge+3],ge+=4,u.push((M<<24|Ee<<16|Mt<<8|ms)/65536))}}}return G(n),e.variation&&r&&(c.commands=c.commands.map(U=>{let M=Object.keys(U);for(let Ee=0;Ee<M.length;Ee++){let Mt=M[Ee];Mt!=="type"&&(U[Mt]=Math.round(U[Mt]))}return U})),d&&(t.advanceWidth=Z),c}function oo(e,t,n,s,r){let o=[],i,a=new F.Parser(e,t),l=a.parseCard8();if(l===0)for(let c=0;c<n;c++){if(i=a.parseCard8(),i>=s)throw new Error("CFF table CID Font FDSelect has bad FD index value "+i+" (FD count "+s+")");o.push(i)}else if(l===3||r>1&&l===4){let c=l===4?a.parseULong():a.parseCard16(),u=l===4?a.parseULong():a.parseCard16();if(u!==0)throw new Error(`CFF Table CID Font FDSelect format ${l} range has bad initial GID ${u}`);let m;for(let d=0;d<c;d++){if(i=l===4?a.parseUShort():a.parseCard8(),m=l===4?a.parseULong():a.parseCard16(),i>=s)throw new Error("CFF table CID Font FDSelect has bad FD index value "+i+" (FD count "+s+")");if(m>n)throw new Error(`CFF Table CID Font FDSelect format ${r} range has bad GID ${m}`);for(;u<m;u++)o.push(i);u=m}if(m!==n)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final (Sentinal) GID "+m)}else throw new Error("CFF Table CID Font FDSelect table has unsupported format "+l);return o}function el(e,t,n,s){let r,o=qa(e,t);o.formatMajor===2?r=n.tables.cff2={}:r=n.tables.cff={};let i=o.formatMajor>1?null:yt(e,o.endOffset,F.bytesToString),a=o.formatMajor>1?null:yt(e,i.endOffset),l=o.formatMajor>1?null:yt(e,a.endOffset,F.bytesToString),c=yt(e,o.formatMajor>1?t+o.size+o.topDictLength:l.endOffset,void 0,o.formatMajor);n.gsubrs=c.objects,n.gsubrsBias=is(n.gsubrs);let u;if(o.formatMajor>1){let d=t+o.size,x=F.getBytes(e,d,d+o.topDictLength);u=_s(e,0,[x],void 0,o.formatMajor)[0]}else{let d=_s(e,t,a.objects,l.objects,o.formatMajor);if(d.length!==1)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+d.length);u=d[0]}if(r.topDict=u,u._privateDict&&(n.defaultWidthX=u._privateDict.defaultWidthX,n.nominalWidthX=u._privateDict.nominalWidthX),o.formatMajor<2&&u.ros[0]!==void 0&&u.ros[1]!==void 0&&(n.isCIDFont=!0),o.formatMajor>1){let d=u.fdArray,x=u.fdSelect;if(!d)throw new Error("This is a CFF2 font, but FDArray information is missing");let v=yt(e,t+d,null,o.formatMajor),S=Za(e,t,v.objects);u._fdArray=S,x&&(u._fdSelect=oo(e,t+x,n.numGlyphs,S.length,o.formatMajor))}else if(n.isCIDFont){let d=u.fdArray,x=u.fdSelect;if(d===0||x===0)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");d+=t;let v=yt(e,d),S=_s(e,t,v.objects,l.objects,o.formatMajor);u._fdArray=S,x+=t,u._fdSelect=oo(e,x,n.numGlyphs,S.length,o.formatMajor)}if(o.formatMajor<2){let d=t+u.private[1],x=Bs(e,d,u.private[0],l.objects,o.formatMajor);if(n.defaultWidthX=x.defaultWidthX,n.nominalWidthX=x.nominalWidthX,x.subrs!==0){let v=d+x.subrs,S=yt(e,v);n.subrs=S.objects,n.subrsBias=is(n.subrs)}else n.subrs=[],n.subrsBias=0}let m;if(s.lowMemory?(m=Ha(e,t+u.charStrings,o.formatMajor),n.nGlyphs=m.offsets.length-(o.formatMajor>1?1:0)):(m=yt(e,t+u.charStrings,null,o.formatMajor),n.nGlyphs=m.objects.length),o.formatMajor>1&&n.tables.maxp&&n.nGlyphs!==n.tables.maxp.numGlyphs&&console.error(`Glyph count in the CFF2 table (${n.nGlyphs}) must correspond to the glyph count in the maxp table (${n.tables.maxp.numGlyphs})`),o.formatMajor<2){let d=[],x=[];u.charset===0?d=Oa:u.charset===1?d=Ia:u.charset===2?d=wa:d=Ka(e,t+u.charset,n.nGlyphs,l.objects,n.isCIDFont),u.encoding===0?x=Fs:u.encoding===1?x=Ea:x=Qa(e,t+u.encoding),n.cffEncoding=new Xr(x,d),n.encoding=n.encoding||n.cffEncoding}if(n.glyphs=new mt.GlyphSet(n),s.lowMemory)n._push=function(d){let x=Va(d,m.offsets,e,t+u.charStrings,void 0,o.formatMajor);n.glyphs.push(d,mt.cffGlyphLoader(n,d,Gs,x,o.formatMajor))};else for(let d=0;d<n.nGlyphs;d+=1){let x=m.objects[d];n.glyphs.push(d,mt.cffGlyphLoader(n,d,Gs,x,o.formatMajor))}if(u.vstore){let d=new F.Parser(e,t+u.vstore);u._vstore=d.parseVariationStore()}}function io(e,t){let n,s=ss.indexOf(e);return s>=0&&(n=s),s=t.indexOf(e),s>=0?n=s+ss.length:(n=ss.length+t.length,t.push(e)),n}function tl(){return new A.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 nl(e){let t=new A.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);t.names=[];for(let n=0;n<e.length;n+=1)t.names.push({name:"name_"+n,type:"NAME",value:e[n]});return t}function ao(e,t,n){let s={};for(let r=0;r<e.length;r+=1){let o=e[r],i=t[o.name];i!==void 0&&!Qr(i,o.value)&&(o.type==="SID"&&(i=io(i,n)),s[o.op]={name:o.name,type:o.type,value:i})}return s}function lo(e,t,n){let s=new A.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return s.dict=ao(n>1?to:eo,e,t),s}function uo(e){let t=new A.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return t.topDicts=[{name:"topDict_0",type:"TABLE",value:e}],t}function sl(e){let t=new A.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);t.strings=[];for(let n=0;n<e.length;n+=1)t.strings.push({name:"string_"+n,type:"STRING",value:e[n]});return t}function rl(){return new A.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}])}function ol(e,t){let n=new A.Record("Charsets",[{name:"format",type:"Card8",value:0}]);for(let s=0;s<e.length;s+=1){let r=e[s],o=io(r,t);n.fields.push({name:"glyph_"+s,type:"SID",value:o})}return n}function il(e,t){let n=[],s=e.path;t<2&&n.push({name:"width",type:"NUMBER",value:e.advanceWidth});let r=0,o=0;for(let i=0;i<s.commands.length;i+=1){let a,l,c=s.commands[i];if(c.type==="Q"){let u=.3333333333333333,m=2/3;c={type:"C",x:c.x,y:c.y,x1:Math.round(u*r+m*c.x1),y1:Math.round(u*o+m*c.y1),x2:Math.round(u*c.x+m*c.x1),y2:Math.round(u*c.y+m*c.y1)}}if(c.type==="M")a=Math.round(c.x-r),l=Math.round(c.y-o),n.push({name:"dx",type:"NUMBER",value:a}),n.push({name:"dy",type:"NUMBER",value:l}),n.push({name:"rmoveto",type:"OP",value:21}),r=Math.round(c.x),o=Math.round(c.y);else if(c.type==="L")a=Math.round(c.x-r),l=Math.round(c.y-o),n.push({name:"dx",type:"NUMBER",value:a}),n.push({name:"dy",type:"NUMBER",value:l}),n.push({name:"rlineto",type:"OP",value:5}),r=Math.round(c.x),o=Math.round(c.y);else if(c.type==="C"){let u=Math.round(c.x1-r),m=Math.round(c.y1-o),d=Math.round(c.x2-c.x1),x=Math.round(c.y2-c.y1);a=Math.round(c.x-c.x2),l=Math.round(c.y-c.y2),n.push({name:"dx1",type:"NUMBER",value:u}),n.push({name:"dy1",type:"NUMBER",value:m}),n.push({name:"dx2",type:"NUMBER",value:d}),n.push({name:"dy2",type:"NUMBER",value:x}),n.push({name:"dx",type:"NUMBER",value:a}),n.push({name:"dy",type:"NUMBER",value:l}),n.push({name:"rrcurveto",type:"OP",value:8}),r=Math.round(c.x),o=Math.round(c.y)}}return t<2&&n.push({name:"endchar",type:"OP",value:14}),n}function al(e,t){let n=new A.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]);for(let s=0;s<e.length;s+=1){let r=e.get(s),o=il(r,t);n.charStrings.push({name:r.name,type:"CHARSTRING",value:o})}return n}function ll(e,t,n){let s=new A.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return s.dict=ao(n>1?so:no,e,t),s}function ul(e,t){let s=new A.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,o={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]},i=t&&t.topDict||{};i.paintType&&(o.paintType=i.paintType,o.strokeWidth=i.strokeWidth||0);let a={},l=[],c;for(let x=1;x<e.length;x+=1)c=e.get(x),l.push(c.name);let u=[];s.header=tl(),s.nameIndex=nl([t.postScriptName]);let m=lo(o,u);s.topDictIndex=uo(m),s.globalSubrIndex=rl(),s.charsets=ol(l,u),s.charStringsIndex=al(e,1),s.privateDict=ll(a,u),s.stringIndex=sl(u);let d=s.header.sizeOf()+s.nameIndex.sizeOf()+s.topDictIndex.sizeOf()+s.stringIndex.sizeOf()+s.globalSubrIndex.sizeOf();return o.charset=d,o.encoding=0,o.charStrings=o.charset+s.charsets.sizeOf(),o.private[1]=o.charStrings+s.charStringsIndex.sizeOf(),m=lo(o,u),s.topDictIndex=uo(m),s}var Hs={parse:el,make:ul};function cl(e,t){let n={},s=new F.Parser(e,t);return n.version=s.parseVersion(),n.fontRevision=Math.round(s.parseFixed()*1e3)/1e3,n.checkSumAdjustment=s.parseULong(),n.magicNumber=s.parseULong(),B.argument(n.magicNumber===1594834165,"Font header has wrong magic number."),n.flags=s.parseUShort(),n.unitsPerEm=s.parseUShort(),n.created=s.parseLongDateTime(),n.modified=s.parseLongDateTime(),n.xMin=s.parseShort(),n.yMin=s.parseShort(),n.xMax=s.parseShort(),n.yMax=s.parseShort(),n.macStyle=s.parseUShort(),n.lowestRecPPEM=s.parseUShort(),n.fontDirectionHint=s.parseShort(),n.indexToLocFormat=s.parseShort(),n.glyphDataFormat=s.parseShort(),n}function fl(e){let t=Math.round(new Date().getTime()/1e3)+2082844800,n=t,s=e.macStyle||0;return e.createdTimestamp&&(n=e.createdTimestamp+2082844800),new A.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:s},{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 co={parse:cl,make:fl};function pl(e,t){let n={},s=new F.Parser(e,t);return n.version=s.parseVersion(),n.ascender=s.parseShort(),n.descender=s.parseShort(),n.lineGap=s.parseShort(),n.advanceWidthMax=s.parseUShort(),n.minLeftSideBearing=s.parseShort(),n.minRightSideBearing=s.parseShort(),n.xMaxExtent=s.parseShort(),n.caretSlopeRise=s.parseShort(),n.caretSlopeRun=s.parseShort(),n.caretOffset=s.parseShort(),s.relativeOffset+=8,n.metricDataFormat=s.parseShort(),n.numberOfHMetrics=s.parseUShort(),n}function hl(e){return new A.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 fo={parse:pl,make:hl};function dl(e,t,n,s,r){let o,i,a=new F.Parser(e,t);for(let l=0;l<s;l+=1){l<n&&(o=a.parseUShort(),i=a.parseShort());let c=r.get(l);c.advanceWidth=o,c.leftSideBearing=i}}function gl(e,t,n,s,r){e._hmtxTableData={};let o,i,a=new F.Parser(t,n);for(let l=0;l<r;l+=1)l<s&&(o=a.parseUShort(),i=a.parseShort()),e._hmtxTableData[l]={advanceWidth:o,leftSideBearing:i}}function ml(e,t,n,s,r,o,i){i.lowMemory?gl(e,t,n,s,r):dl(t,n,s,r,o)}function yl(e){let t=new A.Table("hmtx",[]);for(let n=0;n<e.length;n+=1){let s=e.get(n),r=s.advanceWidth||0,o=s.leftSideBearing||0;t.fields.push({name:"advanceWidth_"+n,type:"USHORT",value:r}),t.fields.push({name:"leftSideBearing_"+n,type:"SHORT",value:o})}return t}var po={parse:ml,make:yl};function bl(e){let t=new A.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:e.length}]),n="",s=12+e.length*4;for(let r=0;r<e.length;++r){let o=n.indexOf(e[r]);o<0&&(o=n.length,n+=e[r]),t.fields.push({name:"offset "+r,type:"USHORT",value:s+o}),t.fields.push({name:"length "+r,type:"USHORT",value:e[r].length})}return t.fields.push({name:"stringPool",type:"CHARARRAY",value:n}),t}function vl(e,t){let n=new F.Parser(e,t),s=n.parseULong();B.argument(s===1,"Unsupported ltag table version."),n.skip("uLong",1);let r=n.parseULong(),o=[];for(let i=0;i<r;i++){let a="",l=t+n.parseUShort(),c=n.parseUShort();for(let u=l;u<l+c;++u)a+=String.fromCharCode(e.getInt8(u));o.push(a)}return o}var ho={make:bl,parse:vl};function xl(e,t){let n={},s=new F.Parser(e,t);return n.version=s.parseVersion(),n.numGlyphs=s.parseUShort(),n.version===1&&(n.maxPoints=s.parseUShort(),n.maxContours=s.parseUShort(),n.maxCompositePoints=s.parseUShort(),n.maxCompositeContours=s.parseUShort(),n.maxZones=s.parseUShort(),n.maxTwilightPoints=s.parseUShort(),n.maxStorage=s.parseUShort(),n.maxFunctionDefs=s.parseUShort(),n.maxInstructionDefs=s.parseUShort(),n.maxStackElements=s.parseUShort(),n.maxSizeOfInstructions=s.parseUShort(),n.maxComponentElements=s.parseUShort(),n.maxComponentDepth=s.parseUShort()),n}function Sl(e){return new A.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:e}])}var go={parse:xl,make:Sl},Vs=[{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 kl(e){for(let t=0;t<Vs.length;t+=1){let n=Vs[t];if(e>=n.begin&&e<n.end)return t}return-1}function Tl(e,t){let n={},s=new F.Parser(e,t);n.version=s.parseUShort(),n.xAvgCharWidth=s.parseShort(),n.usWeightClass=s.parseUShort(),n.usWidthClass=s.parseUShort(),n.fsType=s.parseUShort(),n.ySubscriptXSize=s.parseShort(),n.ySubscriptYSize=s.parseShort(),n.ySubscriptXOffset=s.parseShort(),n.ySubscriptYOffset=s.parseShort(),n.ySuperscriptXSize=s.parseShort(),n.ySuperscriptYSize=s.parseShort(),n.ySuperscriptXOffset=s.parseShort(),n.ySuperscriptYOffset=s.parseShort(),n.yStrikeoutSize=s.parseShort(),n.yStrikeoutPosition=s.parseShort(),n.sFamilyClass=s.parseShort(),n.panose=[];for(let r=0;r<10;r++)n.panose[r]=s.parseByte();return n.ulUnicodeRange1=s.parseULong(),n.ulUnicodeRange2=s.parseULong(),n.ulUnicodeRange3=s.parseULong(),n.ulUnicodeRange4=s.parseULong(),n.achVendID=String.fromCharCode(s.parseByte(),s.parseByte(),s.parseByte(),s.parseByte()),n.fsSelection=s.parseUShort(),n.usFirstCharIndex=s.parseUShort(),n.usLastCharIndex=s.parseUShort(),n.sTypoAscender=s.parseShort(),n.sTypoDescender=s.parseShort(),n.sTypoLineGap=s.parseShort(),n.usWinAscent=s.parseUShort(),n.usWinDescent=s.parseUShort(),n.version>=1&&(n.ulCodePageRange1=s.parseULong(),n.ulCodePageRange2=s.parseULong()),n.version>=2&&(n.sxHeight=s.parseShort(),n.sCapHeight=s.parseShort(),n.usDefaultChar=s.parseUShort(),n.usBreakChar=s.parseUShort(),n.usMaxContent=s.parseUShort()),n}function Cl(e){return new A.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 zs={parse:Tl,make:Cl,unicodeRanges:Vs,getUnicodeRange:kl};function Ol(e,t){let n={},s=new F.Parser(e,t);switch(n.version=s.parseVersion(),n.italicAngle=s.parseFixed(),n.underlinePosition=s.parseShort(),n.underlineThickness=s.parseShort(),n.isFixedPitch=s.parseULong(),n.minMemType42=s.parseULong(),n.maxMemType42=s.parseULong(),n.minMemType1=s.parseULong(),n.maxMemType1=s.parseULong(),n.version){case 1:n.names=qt.slice();break;case 2:n.numberOfGlyphs=s.parseUShort(),n.glyphNameIndex=new Array(n.numberOfGlyphs);for(let r=0;r<n.numberOfGlyphs;r++)n.glyphNameIndex[r]=s.parseUShort();n.names=[];for(let r=0;r<n.numberOfGlyphs;r++)if(n.glyphNameIndex[r]>=qt.length){let o=s.parseChar();n.names.push(s.parseString(o))}break;case 2.5:n.numberOfGlyphs=s.parseUShort(),n.offset=new Array(n.numberOfGlyphs);for(let r=0;r<n.numberOfGlyphs;r++)n.offset[r]=s.parseChar();break}return n}function Il(e){let{italicAngle:t=Math.round((e.italicAngle||0)*65536),underlinePosition:n=0,underlineThickness:s=0,isFixedPitch:r=0,minMemType42:o=0,maxMemType42:i=0,minMemType1:a=0,maxMemType1:l=0}=e.tables.post||{};return new A.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:t},{name:"underlinePosition",type:"FWORD",value:n},{name:"underlineThickness",type:"FWORD",value:s},{name:"isFixedPitch",type:"ULONG",value:r},{name:"minMemType42",type:"ULONG",value:o},{name:"maxMemType42",type:"ULONG",value:i},{name:"minMemType1",type:"ULONG",value:a},{name:"maxMemType1",type:"ULONG",value:l}])}var mo={parse:Ol,make:Il},st=new Array(9);st[1]=function(){let t=this.offset+this.relativeOffset,n=this.parseUShort();if(n===1)return{substFormat:1,coverage:this.parsePointer(C.coverage),deltaGlyphId:this.parseShort()};if(n===2)return{substFormat:2,coverage:this.parsePointer(C.coverage),substitute:this.parseOffset16List()};B.assert(!1,"0x"+t.toString(16)+": lookup type 1 format must be 1 or 2.")},st[2]=function(){let t=this.parseUShort();return B.argument(t===1,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(C.coverage),sequences:this.parseListOfLists()}},st[3]=function(){let t=this.parseUShort();return B.argument(t===1,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(C.coverage),alternateSets:this.parseListOfLists()}},st[4]=function(){let t=this.parseUShort();return B.argument(t===1,"GSUB ligature table identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(C.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};var hn={sequenceIndex:C.uShort,lookupListIndex:C.uShort};st[5]=function(){let t=this.offset+this.relativeOffset,n=this.parseUShort();if(n===1)return{substFormat:n,coverage:this.parsePointer(C.coverage),ruleSets:this.parseListOfLists(function(){let s=this.parseUShort(),r=this.parseUShort();return{input:this.parseUShortList(s-1),lookupRecords:this.parseRecordList(r,hn)}})};if(n===2)return{substFormat:n,coverage:this.parsePointer(C.coverage),classDef:this.parsePointer(C.classDef),classSets:this.parseListOfLists(function(){let s=this.parseUShort(),r=this.parseUShort();return{classes:this.parseUShortList(s-1),lookupRecords:this.parseRecordList(r,hn)}})};if(n===3){let s=this.parseUShort(),r=this.parseUShort();return{substFormat:n,coverages:this.parseList(s,C.pointer(C.coverage)),lookupRecords:this.parseRecordList(r,hn)}}B.assert(!1,"0x"+t.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},st[6]=function(){let t=this.offset+this.relativeOffset,n=this.parseUShort();if(n===1)return{substFormat:1,coverage:this.parsePointer(C.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(hn)}})};if(n===2)return{substFormat:2,coverage:this.parsePointer(C.coverage),backtrackClassDef:this.parsePointer(C.classDef),inputClassDef:this.parsePointer(C.classDef),lookaheadClassDef:this.parsePointer(C.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(hn)}})};if(n===3)return{substFormat:3,backtrackCoverage:this.parseList(C.pointer(C.coverage)),inputCoverage:this.parseList(C.pointer(C.coverage)),lookaheadCoverage:this.parseList(C.pointer(C.coverage)),lookupRecords:this.parseRecordList(hn)};B.assert(!1,"0x"+t.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},st[7]=function(){let t=this.parseUShort();B.argument(t===1,"GSUB Extension Substitution subtable identifier-format must be 1");let n=this.parseUShort(),s=new C(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:n,extension:st[n].call(s)}},st[8]=function(){let t=this.parseUShort();return B.argument(t===1,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(C.coverage),backtrackCoverage:this.parseList(C.pointer(C.coverage)),lookaheadCoverage:this.parseList(C.pointer(C.coverage)),substitutes:this.parseUShortList()}};function wl(e,t){t=t||0;let n=new C(e,t),s=n.parseVersion(1);return B.argument(s===1||s===1.1,"Unsupported GSUB table version."),s===1?{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(st)}:{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(st),variations:n.parseFeatureVariationsList()}}var Xt=new Array(9);Xt[1]=function(t){if(t.substFormat===1)return new A.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new A.Coverage(t.coverage)},{name:"deltaGlyphID",type:"SHORT",value:t.deltaGlyphId}]);if(t.substFormat===2)return new A.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new A.Coverage(t.coverage)}].concat(A.ushortList("substitute",t.substitute)));B.fail("Lookup type 1 substFormat must be 1 or 2.")},Xt[2]=function(t){return B.assert(t.substFormat===1,"Lookup type 2 substFormat must be 1."),new A.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new A.Coverage(t.coverage)}].concat(A.tableList("seqSet",t.sequences,function(n){return new A.Table("sequenceSetTable",A.ushortList("sequence",n))})))},Xt[3]=function(t){return B.assert(t.substFormat===1,"Lookup type 3 substFormat must be 1."),new A.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new A.Coverage(t.coverage)}].concat(A.tableList("altSet",t.alternateSets,function(n){return new A.Table("alternateSetTable",A.ushortList("alternate",n))})))},Xt[4]=function(t){return B.assert(t.substFormat===1,"Lookup type 4 substFormat must be 1."),new A.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new A.Coverage(t.coverage)}].concat(A.tableList("ligSet",t.ligatureSets,function(n){return new A.Table("ligatureSetTable",A.tableList("ligature",n,function(s){return new A.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:s.ligGlyph}].concat(A.ushortList("component",s.components,s.components.length+1)))}))})))},Xt[5]=function(t){if(t.substFormat===1)return new A.Table("contextualSubstitutionTable",[{name:"substFormat",type:"USHORT",value:t.substFormat},{name:"coverage",type:"TABLE",value:new A.Coverage(t.coverage)}].concat(A.tableList("sequenceRuleSet",t.ruleSets,function(n){return n?new A.Table("sequenceRuleSetTable",A.tableList("sequenceRule",n,function(s){let r=A.ushortList("seqLookup",[],s.lookupRecords.length).concat(A.ushortList("inputSequence",s.input,s.input.length+1));[r[0],r[1]]=[r[1],r[0]];for(let o=0;o<s.lookupRecords.length;o++){let i=s.lookupRecords[o];r=r.concat({name:"sequenceIndex"+o,type:"USHORT",value:i.sequenceIndex}).concat({name:"lookupListIndex"+o,type:"USHORT",value:i.lookupListIndex})}return new A.Table("sequenceRuleTable",r)})):new A.Table("NULL",null)})));if(t.substFormat===2)return new A.Table("contextualSubstitutionTable",[{name:"substFormat",type:"USHORT",value:t.substFormat},{name:"coverage",type:"TABLE",value:new A.Coverage(t.coverage)},{name:"classDef",type:"TABLE",value:new A.ClassDef(t.classDef)}].concat(A.tableList("classSeqRuleSet",t.classSets,function(n){return n?new A.Table("classSeqRuleSetTable",A.tableList("classSeqRule",n,function(s){let r=A.ushortList("classes",s.classes,s.classes.length+1).concat(A.ushortList("seqLookupCount",[],s.lookupRecords.length));for(let o=0;o<s.lookupRecords.length;o++){let i=s.lookupRecords[o];r=r.concat({name:"sequenceIndex"+o,type:"USHORT",value:i.sequenceIndex}).concat({name:"lookupListIndex"+o,type:"USHORT",value:i.lookupListIndex})}return new A.Table("classSeqRuleTable",r)})):new A.Table("NULL",null)})));if(t.substFormat===3){let n=[{name:"substFormat",type:"USHORT",value:t.substFormat}];n.push({name:"inputGlyphCount",type:"USHORT",value:t.coverages.length}),n.push({name:"substitutionCount",type:"USHORT",value:t.lookupRecords.length});for(let r=0;r<t.coverages.length;r++){let o=t.coverages[r];n.push({name:"inputCoverage"+r,type:"TABLE",value:new A.Coverage(o)})}for(let r=0;r<t.lookupRecords.length;r++){let o=t.lookupRecords[r];n=n.concat({name:"sequenceIndex"+r,type:"USHORT",value:o.sequenceIndex}).concat({name:"lookupListIndex"+r,type:"USHORT",value:o.lookupListIndex})}return new A.Table("contextualSubstitutionTable",n)}B.assert(!1,"lookup type 5 format must be 1, 2 or 3.")},Xt[6]=function(t){if(t.substFormat===1)return new A.Table("chainContextTable",[{name:"substFormat",type:"USHORT",value:t.substFormat},{name:"coverage",type:"TABLE",value:new A.Coverage(t.coverage)}].concat(A.tableList("chainRuleSet",t.chainRuleSets,function(s){return new A.Table("chainRuleSetTable",A.tableList("chainRule",s,function(r){let o=A.ushortList("backtrackGlyph",r.backtrack,r.backtrack.length).concat(A.ushortList("inputGlyph",r.input,r.input.length+1)).concat(A.ushortList("lookaheadGlyph",r.lookahead,r.lookahead.length)).concat(A.ushortList("substitution",[],r.lookupRecords.length));for(let i=0;i<r.lookupRecords.length;i++){let a=r.lookupRecords[i];o=o.concat({name:"sequenceIndex"+i,type:"USHORT",value:a.sequenceIndex}).concat({name:"lookupListIndex"+i,type:"USHORT",value:a.lookupListIndex})}return new A.Table("chainRuleTable",o)}))})));if(t.substFormat===2)B.assert(!1,"lookup type 6 format 2 is not yet supported.");else if(t.substFormat===3){let n=[{name:"substFormat",type:"USHORT",value:t.substFormat}];n.push({name:"backtrackGlyphCount",type:"USHORT",value:t.backtrackCoverage.length});for(let r=0;r<t.backtrackCoverage.length;r++){let o=t.backtrackCoverage[r];n.push({name:"backtrackCoverage"+r,type:"TABLE",value:new A.Coverage(o)})}n.push({name:"inputGlyphCount",type:"USHORT",value:t.inputCoverage.length});for(let r=0;r<t.inputCoverage.length;r++){let o=t.inputCoverage[r];n.push({name:"inputCoverage"+r,type:"TABLE",value:new A.Coverage(o)})}n.push({name:"lookaheadGlyphCount",type:"USHORT",value:t.lookaheadCoverage.length});for(let r=0;r<t.lookaheadCoverage.length;r++){let o=t.lookaheadCoverage[r];n.push({name:"lookaheadCoverage"+r,type:"TABLE",value:new A.Coverage(o)})}n.push({name:"substitutionCount",type:"USHORT",value:t.lookupRecords.length});for(let r=0;r<t.lookupRecords.length;r++){let o=t.lookupRecords[r];n=n.concat({name:"sequenceIndex"+r,type:"USHORT",value:o.sequenceIndex}).concat({name:"lookupListIndex"+r,type:"USHORT",value:o.lookupListIndex})}return new A.Table("chainContextTable",n)}B.assert(!1,"lookup type 6 format must be 1, 2 or 3.")};function El(e){return new A.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new A.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new A.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new A.LookupList(e.lookups,Xt)}])}var yo={parse:wl,make:El};function Ll(e,t){let n=new F.Parser(e,t),s=n.parseULong();B.argument(s===1,"Unsupported META table version."),n.parseULong(),n.parseULong();let r=n.parseULong(),o={};for(let i=0;i<r;i++){let a=n.parseTag(),l=n.parseULong(),c=n.parseULong();if(a==="appl"||a==="bild")continue;let u=an.UTF8(e,t+l,c);o[a]=u}return o}function Al(e){let t=Object.keys(e).length,n="",s=16+t*12,r=new A.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:s},{name:"numTags",type:"ULONG",value:t}]);for(let o in e){let i=n.length;n+=e[o],r.fields.push({name:"tag "+o,type:"TAG",value:o}),r.fields.push({name:"offset "+o,type:"ULONG",value:s+i}),r.fields.push({name:"length "+o,type:"ULONG",value:e[o].length})}return r.fields.push({name:"stringPool",type:"CHARARRAY",value:n}),r}var bo={parse:Ll,make:Al};function Rl(e,t){let n=new C(e,t),s=n.parseUShort();s!==0&&console.warn("Only COLRv0 is currently fully supported. A subset of color glyphs might be available in this font if provided in the v0 format.");let r=n.parseUShort(),o=n.parseOffset32(),i=n.parseOffset32(),a=n.parseUShort();n.relativeOffset=o;let l=n.parseRecordList(r,{glyphID:C.uShort,firstLayerIndex:C.uShort,numLayers:C.uShort});n.relativeOffset=i;let c=n.parseRecordList(a,{glyphID:C.uShort,paletteIndex:C.uShort});return{version:s,baseGlyphRecords:l,layerRecords:c}}function Dl({version:e=0,baseGlyphRecords:t=[],layerRecords:n=[]}){B.argument(e===0,"Only COLRv0 supported.");let s=14,r=s+t.length*6;return new A.Table("COLR",[{name:"version",type:"USHORT",value:e},{name:"numBaseGlyphRecords",type:"USHORT",value:t.length},{name:"baseGlyphRecordsOffset",type:"ULONG",value:s},{name:"layerRecordsOffset",type:"ULONG",value:r},{name:"numLayerRecords",type:"USHORT",value:n.length},...t.map((o,i)=>[{name:"glyphID_"+i,type:"USHORT",value:o.glyphID},{name:"firstLayerIndex_"+i,type:"USHORT",value:o.firstLayerIndex},{name:"numLayers_"+i,type:"USHORT",value:o.numLayers}]).flat(),...n.map((o,i)=>[{name:"LayerGlyphID_"+i,type:"USHORT",value:o.glyphID},{name:"paletteIndex_"+i,type:"USHORT",value:o.paletteIndex}]).flat()])}var vo={parse:Rl,make:Dl};function Fl(e,t){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:t.axisNameID}]}function Ul(e,t,n){let s={},r=new F.Parser(e,t);s.tag=r.parseTag(),s.minValue=r.parseFixed(),s.defaultValue=r.parseFixed(),s.maxValue=r.parseFixed(),r.skip("uShort",1);let o=r.parseUShort();return s.axisNameID=o,s.name=ns(n,o),s}function Ml(e,t,n,s={}){let r=[{name:"nameID_"+e,type:"USHORT",value:t.subfamilyNameID},{name:"flags_"+e,type:"USHORT",value:0}];for(let o=0;o<n.length;++o){let i=n[o].tag;r.push({name:"axis_"+e+" "+i,type:"FIXED",value:t.coordinates[i]<<16})}return s&&s.postScriptNameID&&r.push({name:"postScriptNameID_",type:"USHORT",value:t.postScriptNameID!==void 0?t.postScriptNameID:65535}),r}function Pl(e,t,n,s,r){let o={},i=new F.Parser(e,t),a=i.parseUShort();o.subfamilyNameID=a,o.name=ns(s,a,[2,17]),i.skip("uShort",1),o.coordinates={};for(let c=0;c<n.length;++c)o.coordinates[n[c].tag]=i.parseFixed();if(i.relativeOffset===r)return o.postScriptNameID=void 0,o.postScriptName=void 0,o;let l=i.parseUShort();return o.postScriptNameID=l==65535?void 0:l,o.postScriptName=o.postScriptNameID!==void 0?ns(s,l,[6]):"",o}function Nl(e,t){let n=new A.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(let r=0;r<e.axes.length;r++)n.fields=n.fields.concat(Fl(r,e.axes[r],t));let s={};for(let r=0;r<e.instances.length;r++)if(e.instances[r].postScriptNameID!==void 0){n.instanceSize+=2,s.postScriptNameID=!0;break}for(let r=0;r<e.instances.length;r++)n.fields=n.fields.concat(Ml(r,e.instances[r],e.axes,s));return n}function Bl(e,t,n){let s=new F.Parser(e,t),r=s.parseULong();B.argument(r===65536,"Unsupported fvar table version.");let o=s.parseOffset16();s.skip("uShort",1);let i=s.parseUShort(),a=s.parseUShort(),l=s.parseUShort(),c=s.parseUShort(),u=[];for(let x=0;x<i;x++)u.push(Ul(e,t+o+x*a,n));let m=[],d=t+o+i*a;for(let x=0;x<l;x++)m.push(Pl(e,d+x*c,u,n,c));return{axes:u,instances:m}}var xo={make:Nl,parse:Bl},_l={tag:C.tag,nameID:C.uShort,ordering:C.uShort},En=new Array(5);En[1]=function(){return{axisIndex:this.parseUShort(),flags:this.parseUShort(),valueNameID:this.parseUShort(),value:this.parseFixed()}},En[2]=function(){return{axisIndex:this.parseUShort(),flags:this.parseUShort(),valueNameID:this.parseUShort(),nominalValue:this.parseFixed(),rangeMinValue:this.parseFixed(),rangeMaxValue:this.parseFixed()}},En[3]=function(){return{axisIndex:this.parseUShort(),flags:this.parseUShort(),valueNameID:this.parseUShort(),value:this.parseFixed(),linkedValue:this.parseFixed()}},En[4]=function(){let t=this.parseUShort();return{flags:this.parseUShort(),valueNameID:this.parseUShort(),axisValues:this.parseList(t,function(){return{axisIndex:this.parseUShort(),value:this.parseFixed()}})}};function Gl(){let e=this.parseUShort(),t=En[e],n={format:e};return t===void 0?(console.warn(`Unknown axis value table format ${e}`),n):Object.assign(n,this.parseStruct(t.bind(this)))}function Hl(e,t,n){t||(t=0);let s=new F.Parser(e,t),r=s.parseUShort(),o=s.parseUShort();r!==1&&console.warn(`Unsupported STAT table version ${r}.${o}`);let i=[r,o],a=s.parseUShort(),l=s.parseUShort(),c=s.parseOffset32(),u=s.parseUShort(),m=s.parseOffset32(),d=r>1||o>0?s.parseUShort():void 0;n!==void 0&&B.argument(l>=n.axes.length,"STAT axis count must be greater than or equal to fvar axis count"),u>0&&B.argument(l>=0,"STAT axis count must be greater than 0 if STAT axis value count is greater than 0");let x=[];for(let I=0;I<l;I++)s.offset=t+c,s.relativeOffset=I*a,x.push(s.parseStruct(_l));s.offset=t,s.relativeOffset=m;let v=s.parseUShortList(u),S=[];for(let I=0;I<u;I++)s.offset=t+m,s.relativeOffset=v[I],S.push(Gl.apply(s));return{version:i,axes:x,values:S,elidedFallbackNameID:d}}var Ln=new Array(5);Ln[1]=function(t,n){return[{name:`format${t}`,type:"USHORT",value:1},{name:`axisIndex${t}`,type:"USHORT",value:n.axisIndex},{name:`flags${t}`,type:"USHORT",value:n.flags},{name:`valueNameID${t}`,type:"USHORT",value:n.valueNameID},{name:`value${t}`,type:"FLOAT",value:n.value}]},Ln[2]=function(t,n){return[{name:`format${t}`,type:"USHORT",value:2},{name:`axisIndex${t}`,type:"USHORT",value:n.axisIndex},{name:`flags${t}`,type:"USHORT",value:n.flags},{name:`valueNameID${t}`,type:"USHORT",value:n.valueNameID},{name:`nominalValue${t}`,type:"FLOAT",value:n.nominalValue},{name:`rangeMinValue${t}`,type:"FLOAT",value:n.rangeMinValue},{name:`rangeMaxValue${t}`,type:"FLOAT",value:n.rangeMaxValue}]},Ln[3]=function(t,n){return[{name:`format${t}`,type:"USHORT",value:3},{name:`axisIndex${t}`,type:"USHORT",value:n.axisIndex},{name:`flags${t}`,type:"USHORT",value:n.flags},{name:`valueNameID${t}`,type:"USHORT",value:n.valueNameID},{name:`value${t}`,type:"FLOAT",value:n.value},{name:`linkedValue${t}`,type:"FLOAT",value:n.linkedValue}]},Ln[4]=function(t,n){let s=[{name:`format${t}`,type:"USHORT",value:4},{name:`axisCount${t}`,type:"USHORT",value:n.axisValues.length},{name:`flags${t}`,type:"USHORT",value:n.flags},{name:`valueNameID${t}`,type:"USHORT",value:n.valueNameID}];for(let r=0;r<n.axisValues.length;r++)s=s.concat([{name:`format${t}axisIndex${r}`,type:"USHORT",value:n.axisValues[r].axisIndex},{name:`format${t}value${r}`,type:"FLOAT",value:n.axisValues[r].value}]);return s};function Vl(e,t){return new A.Record("axisRecord_"+e,[{name:"axisTag_"+e,type:"TAG",value:t.tag},{name:"axisNameID_"+e,type:"USHORT",value:t.nameID},{name:"axisOrdering_"+e,type:"USHORT",value:t.ordering}])}function zl(e,t){let n=t.format,s=Ln[n];B.argument(s!==void 0,`Unknown axis value table format ${n}`);let r=s(e,t);return new A.Table("axisValueTable_"+e,r)}function jl(e){let t=new A.Table("STAT",[{name:"majorVersion",type:"USHORT",value:1},{name:"minorVersion",type:"USHORT",value:2},{name:"designAxisSize",type:"USHORT",value:8},{name:"designAxisCount",type:"USHORT",value:e.axes.length},{name:"designAxesOffset",type:"ULONG",value:0},{name:"axisValueCount",type:"USHORT",value:e.values.length},{name:"offsetToAxisValueOffsets",type:"ULONG",value:0},{name:"elidedFallbackNameID",type:"USHORT",value:e.elidedFallbackNameID}]);t.designAxesOffset=t.offsetToAxisValueOffsets=t.sizeOf();for(let o=0;o<e.axes.length;o++){let i=Vl(o,e.axes[o]);t.offsetToAxisValueOffsets+=i.sizeOf(),t.fields=t.fields.concat(i.fields)}let n=[],s=[],r=e.values.length*2;for(let o=0;o<e.values.length;o++){let i=zl(o,e.values[o]);n.push({name:"offset_"+o,type:"USHORT",value:r}),r+=i.sizeOf(),s=s.concat(i.fields)}return t.fields=t.fields.concat(n),t.fields=t.fields.concat(s),t}var So={make:jl,parse:Hl};function Wl(e,t){return new A.Record("axisValueMap_"+e,[{name:"fromCoordinate_"+e,type:"F2DOT14",value:t.fromCoordinate},{name:"toCoordinate_"+e,type:"F2DOT14",value:t.toCoordinate}])}function ql(e,t){let n=new A.Record("segmentMap_"+e,[{name:"positionMapCount_"+e,type:"USHORT",value:t.axisValueMaps.length}]),s=[];for(let r=0;r<t.axisValueMaps.length;r++){let o=Wl(`${e}_${r}`,t.axisValueMaps[r]);s=s.concat(o.fields)}return n.fields=n.fields.concat(s),n}function $l(e,t){B.argument(e.axisSegmentMaps.length===t.axes.length,"avar axis count must correspond to fvar axis count");let n=new A.Table("avar",[{name:"majorVersion",type:"USHORT",value:1},{name:"minorVersion",type:"USHORT",value:0},{name:"reserved",type:"USHORT",value:0},{name:"axisCount",type:"USHORT",value:e.axisSegmentMaps.length}]);for(let s=0;s<e.axisSegmentMaps.length;s++){let r=ql(s,e.axisSegmentMaps[s]);n.fields=n.fields.concat(r.fields)}return n}function Xl(e,t,n){t||(t=0);let s=new C(e,t),r=s.parseUShort(),o=s.parseUShort();r!==1&&console.warn(`Unsupported avar table version ${r}.${o}`),s.skip("uShort",1);let i=s.parseUShort();B.argument(i===n.axes.length,"avar axis count must correspond to fvar axis count");let a=[];for(let l=0;l<i;l++){let c=[],u=s.parseUShort();for(let m=0;m<u;m++){let d=s.parseF2Dot14(),x=s.parseF2Dot14();c.push({fromCoordinate:d,toCoordinate:x})}a.push({axisValueMaps:c})}return{version:[r,o],axisSegmentMaps:a}}var ko={make:$l,parse:Xl};function Yl(e,t,n,s){let r=new F.Parser(e,t),o=r.parseTupleVariationStore(r.relativeOffset,n.axes.length,"cvar",s),i=r.parseUShort(),a=r.parseUShort();return i!==1&&console.warn(`Unsupported cvar table version ${i}.${a}`),{version:[i,a],...o}}function Zl(){console.warn("Writing of cvar tables is not yet supported.")}var To={make:Zl,parse:Yl};function Kl(e,t,n,s){let r=new F.Parser(e,t),o=r.parseUShort(),i=r.parseUShort();o!==1&&console.warn(`Unsupported gvar table version ${o}.${i}`);let a=r.parseUShort();a!==n.axes.length&&console.warn(`axisCount ${a} in gvar table does not match the number of axes ${n.axes.length} in the fvar table!`);let l=r.parseUShort(),c=r.parsePointer32(function(){return this.parseTupleRecords(l,a)}),u=r.parseTupleVariationStoreList(a,"gvar",s);return{version:[o,i],sharedTuples:c,glyphVariations:u}}function Ql(){console.warn("Writing of gvar tables is not yet supported.")}var Co={make:Ql,parse:Kl};function Jl(e,t){let n={},s=new F.Parser(e,t);n.version=s.parseUShort(),B.argument(n.version<=1,"Unsupported gasp table version."),n.numRanges=s.parseUShort(),n.gaspRanges=[];for(let r=0;r<n.numRanges;r++)n.gaspRanges[r]={rangeMaxPPEM:s.parseUShort(),rangeGaspBehavior:s.parseUShort()};return n}function eu(e){let t=new A.Table("gasp",[{name:"version",type:"USHORT",value:1},{name:"numRanges",type:"USHORT",value:e.numRanges}]);for(let n in e.gaspRanges)t.fields.push({name:"rangeMaxPPEM",type:"USHORT",value:e.gaspRanges[n].rangeMaxPPEM}),t.fields.push({name:"rangeGaspBehavior",type:"USHORT",value:e.gaspRanges[n].rangeGaspBehavior});return t}var Oo={parse:Jl,make:eu};function tu(e,t){let n=new Map,s=e.buffer,r=new C(e,t);if(r.parseUShort()!==0)return n;r.relativeOffset=r.parseOffset32();let i=e.byteOffset+t+r.relativeOffset,a=r.parseUShort(),l=new Map;for(let c=0;c<a;c++){let u=r.parseUShort(),m=r.parseUShort(),d=i+r.parseOffset32(),x=r.parseULong(),v=l.get(d);v===void 0&&(v=new Uint8Array(s,d,x),l.set(d,v));for(let S=u;S<=m;S++)n.set(S,v)}return n}function nu(e){let t=Array.from(e.keys()).sort(),n=[],s=[],r=new Map,o=0,i={endGlyphID:null};for(let d=0,x=t.length;d<x;d++){let v=t[d],S=e.get(v),I=r.get(S);I===void 0&&(I=o,s.push(S),r.set(S,I),o+=S.byteLength),v-1===i.endGlyphID&&I===i.svgDocOffset?i.endGlyphID=v:(i={startGlyphID:v,endGlyphID:v,svgDocOffset:I,svgDocLength:S.byteLength},n.push(i))}let a=n.length,l=s.length,c=2+a*12,u=new Array(4+a*4+l),m=0;u[m++]={name:"version",type:"USHORT",value:0},u[m++]={name:"svgDocumentListOffset",type:"ULONG",value:10},u[m++]={name:"reserved",type:"ULONG",value:0},u[m++]={name:"numEntries",type:"USHORT",value:a};for(let d=0;d<a;d++){let x="documentRecord_"+d,{startGlyphID:v,endGlyphID:S,svgDocOffset:I,svgDocLength:_}=n[d];u[m++]={name:x+"_startGlyphID",type:"USHORT",value:v},u[m++]={name:x+"_endGlyphID",type:"USHORT",value:S},u[m++]={name:x+"_svgDocOffset",type:"ULONG",value:c+I},u[m++]={name:x+"_svgDocLength",type:"ULONG",value:_}}for(let d=0;d<l;d++)u[m++]={name:"svgDoc_"+d,type:"LITERAL",value:s[d]};return new A.Table("SVG ",u)}var Io={make:nu,parse:tu};function wo(e){return Math.log(e)/Math.log(2)|0}function js(e){for(;e.length%4!==0;)e.push(0);let t=0;for(let n=0;n<e.length;n+=4)t+=(e[n]<<24)+(e[n+1]<<16)+(e[n+2]<<8)+e[n+3];return t%=Math.pow(2,32),t}function Eo(e,t,n,s){return new A.Record("Table Record",[{name:"tag",type:"TAG",value:e!==void 0?e:""},{name:"checkSum",type:"ULONG",value:t!==void 0?t:0},{name:"offset",type:"ULONG",value:n!==void 0?n:0},{name:"length",type:"ULONG",value:s!==void 0?s:0}])}function Lo(e){let t=new A.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;let n=Math.pow(2,wo(t.numTables));t.searchRange=16*n,t.entrySelector=wo(n),t.rangeShift=t.numTables*16-t.searchRange;let s=[],r=[],o=t.sizeOf()+Eo().sizeOf()*t.numTables;for(;o%4!==0;)o+=1,r.push({name:"padding",type:"BYTE",value:0});for(let i=0;i<e.length;i+=1){let a=e[i];B.argument(a.tableName.length===4,"Table name"+a.tableName+" is invalid.");let l=a.sizeOf(),c=Eo(a.tableName,js(a.encode()),o,l);for(s.push({name:c.tag+" Table Record",type:"RECORD",value:c}),r.push({name:a.tableName+" table",type:"RECORD",value:a}),o+=l,B.argument(!isNaN(o),"Something went wrong calculating the offset.");o%4!==0;)o+=1,r.push({name:"padding",type:"BYTE",value:0})}return s.sort(function(i,a){return i.value.tag>a.value.tag?1:-1}),t.fields=t.fields.concat(s),t.fields=t.fields.concat(r),t}function Ao(e,t,n){for(let s=0;s<t.length;s+=1){let r=e.charToGlyphIndex(t[s]);if(r>0)return e.glyphs.get(r).getMetrics()}return n}function su(e){let t=0;for(let n=0;n<e.length;n+=1)t+=e[n];return t/e.length}function ru(e){let t=[],n=[],s=[],r=[],o=[],i=[],a=[],l,c=0,u=0,m=0,d=0,x=0;for(let le=0;le<e.glyphs.length;le+=1){let _e=e.glyphs.get(le),Qe=_e.unicode|0;if(isNaN(_e.advanceWidth))throw new Error("Glyph "+_e.name+" ("+le+"): advanceWidth is not a number.");(l>Qe||l===void 0)&&Qe>0&&(l=Qe),c<Qe&&(c=Qe);let at=zs.getUnicodeRange(Qe);if(at<32)u|=1<<at;else if(at<64)m|=1<<at-32;else if(at<96)d|=1<<at-64;else if(at<123)x|=1<<at-96;else throw new Error("Unicode ranges bits > 123 are reserved for internal usage");if(_e.name===".notdef")continue;let Ct=_e.getMetrics();t.push(Ct.xMin),n.push(Ct.yMin),s.push(Ct.xMax),r.push(Ct.yMax),i.push(Ct.leftSideBearing),a.push(Ct.rightSideBearing),o.push(_e.advanceWidth)}let v={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,s),yMax:Math.max.apply(null,r),advanceWidthMax:Math.max.apply(null,o),advanceWidthAvg:su(o),minLeftSideBearing:Math.min.apply(null,i),maxLeftSideBearing:Math.max.apply(null,i),minRightSideBearing:Math.min.apply(null,a)};v.ascender=e.ascender,v.descender=e.descender;let S=0;e.weightClass>=600&&(S|=e.macStyleValues.BOLD),e.italicAngle<0&&(S|=e.macStyleValues.ITALIC);let I=co.make({flags:3,unitsPerEm:e.unitsPerEm,xMin:v.xMin,yMin:v.yMin,xMax:v.xMax,yMax:v.yMax,lowestRecPPEM:3,macStyle:S,createdTimestamp:e.createdTimestamp}),_=fo.make({ascender:v.ascender,descender:v.descender,advanceWidthMax:v.advanceWidthMax,minLeftSideBearing:v.minLeftSideBearing,minRightSideBearing:v.minRightSideBearing,xMaxExtent:v.maxLeftSideBearing+(v.xMax-v.xMin),numberOfHMetrics:e.glyphs.length}),P=go.make(e.glyphs.length),z=zs.make(Object.assign({xAvgCharWidth:Math.round(v.advanceWidthAvg),usFirstCharIndex:l,usLastCharIndex:c,ulUnicodeRange1:u,ulUnicodeRange2:m,ulUnicodeRange3:d,ulUnicodeRange4:x,sTypoAscender:v.ascender,sTypoDescender:v.descender,sTypoLineGap:0,usWinAscent:v.yMax,usWinDescent:Math.abs(v.yMin),ulCodePageRange1:1,sxHeight:Ao(e,"xyvw",{yMax:Math.round(v.ascender/2)}).yMax,sCapHeight:Ao(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",v).yMax,usDefaultChar:e.hasChar(" ")?32:0,usBreakChar:e.hasChar(" ")?32:0},e.tables.os2)),Y=po.make(e.glyphs),re=Wr.make(e.glyphs),ie=e.getEnglishName("fontFamily"),ae=e.getEnglishName("fontSubfamily"),me=ie+" "+ae,ot=e.getEnglishName("postScriptName");ot||(ot=ie.replace(/\s/g,"")+"-"+ae);let Z={};for(let le in e.names)Z[le]=e.names[le];Z.unicode=Z.unicode||{},Z.macintosh=Z.macintosh||{},Z.windows=Z.windows||{};let Ve=e.names.unicode||{},De=e.names.macintosh||{},G=e.names.windows||{};for(let le in Z){if(Z[le]=Z[le]||{},!Z[le].uniqueID){let _e=e.getEnglishName("manufacturer")||"";Z[le].uniqueID={en:`${_e}: ${me}`}}Z[le].postScriptName||(Z[le].postScriptName={en:ot})}Z.unicode.preferredFamily||(Z.unicode.preferredFamily=Ve.fontFamily||De.fontFamily||G.fontFamily),Z.macintosh.preferredFamily||(Z.macintosh.preferredFamily=De.fontFamily||Ve.fontFamily||G.fontFamily),Z.windows.preferredFamily||(Z.windows.preferredFamily=G.fontFamily||Ve.fontFamily||De.fontFamily),Z.unicode.preferredSubfamily||(Z.unicode.preferredSubfamily=Ve.fontSubfamily||De.fontSubfamily||G.fontSubfamily),Z.macintosh.preferredSubfamily||(Z.macintosh.preferredSubfamily=De.fontSubfamily||Ve.fontSubfamily||G.fontSubfamily),Z.windows.preferredSubfamily||(Z.windows.preferredSubfamily=G.fontSubfamily||Ve.fontSubfamily||De.fontSubfamily);let U=[],M=jr.make(Z,U),Ee=U.length>0?ho.make(U):void 0,Mt=mo.make(e),ms=Hs.make(e.glyphs,{version:e.getEnglishName("version"),fullName:me,familyName:ie,weightName:ae,postScriptName:ot,unitsPerEm:e.unitsPerEm,fontBBox:[0,v.yMin,v.ascender,v.advanceWidthMax],topDict:e.tables.cff&&e.tables.cff.topDict||{}}),Kt=e.metas&&Object.keys(e.metas).length>0?bo.make(e.metas):void 0,it=[I,_,P,z,M,re,Mt,ms,Y];Ee&&it.push(Ee);let Fe={gsub:yo,cpal:Kr,colr:vo,stat:So,avar:ko,cvar:To,fvar:xo,gvar:Co,gasp:Oo,svg:Io},Ke={avar:[e.tables.fvar],fvar:[e.names]};for(let le in Fe){let _e=e.tables[le];if(_e){let Qe=Fe[le].make.call(e,_e,...Ke[le]||[]);Qe&&it.push(Qe)}}Kt&&it.push(Kt);let Le=Lo(it),ze=Le.encode(),Ue=js(ze),Me=Le.fields,ge=!1;for(let le=0;le<Me.length;le+=1)if(Me[le].name==="head table"){Me[le].value.checkSumAdjustment=2981146554-Ue,ge=!0;break}if(!ge)throw new Error("Could not find head table with checkSum to adjust.");return Le}var ou={make:Lo,fontToTable:ru,computeCheckSum:js};function Ws(e,t){let n=0,s=e.length-1;for(;n<=s;){let r=n+s>>>1,o=e[r].tag;if(o===t)return r;o<t?n=r+1:s=r-1}return-n-1}function Ro(e,t){let n=0,s=e.length-1;for(;n<=s;){let r=n+s>>>1,o=e[r];if(o===t)return r;o<t?n=r+1:s=r-1}return-n-1}function Do(e,t){let n,s=0,r=e.length-1;for(;s<=r;){let o=s+r>>>1;n=e[o];let i=n.start;if(i===t)return n;i<t?s=o+1:r=o-1}if(s>0)return n=e[s-1],t>n.end?0:n}function Fo(e,t){this.font=e,this.tableName=t}Fo.prototype={searchTag:Ws,binSearch:Ro,getTable:function(e){let t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){let e=this.getTable();return e?e.scripts.map(function(t){return t.tag}):[]},getDefaultScriptName:function(){let e=this.getTable();if(!e)return;let t=!1;for(let n=0;n<e.scripts.length;n++){let s=e.scripts[n].tag;if(s==="DFLT")return s;s==="latn"&&(t=!0)}if(t)return"latn"},getScriptTable:function(e,t){let n=this.getTable(t);if(n){e=e||"DFLT";let s=n.scripts,r=Ws(n.scripts,e);if(r>=0)return s[r].script;if(t){let o={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return s.splice(-1-r,0,o),o.script}}},getLangSysTable:function(e,t,n){let s=this.getScriptTable(e,n);if(s){if(!t||t==="dflt"||t==="DFLT")return s.defaultLangSys;let r=Ws(s.langSysRecords,t);if(r>=0)return s.langSysRecords[r].langSys;if(n){let o={tag:t,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return s.langSysRecords.splice(-1-r,0,o),o.langSys}}},getFeatureTable:function(e,t,n,s){let r=this.getLangSysTable(e,t,s);if(r){let o,i=r.featureIndexes,a=this.font.tables[this.tableName].features;for(let l=0;l<i.length;l++)if(o=a[i[l]],o.tag===n)return o.feature;if(s){let l=a.length;return B.assert(l===0||n>=a[l-1].tag,"Features must be added in alphabetical order."),o={tag:n,feature:{params:0,lookupListIndexes:[]}},a.push(o),i.push(l),o.feature}}},getLookupTables:function(e,t,n,s,r){let o=this.getFeatureTable(e,t,n,r),i=[];if(o){let a,l=o.lookupListIndexes,c=this.font.tables[this.tableName].lookups;for(let u=0;u<l.length;u++)a=c[l[u]],a.lookupType===s&&i.push(a);if(i.length===0&&r){a={lookupType:s,lookupFlag:0,subtables:[],markFilteringSet:void 0};let u=c.length;return c.push(a),l.push(u),[a]}}return i},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:{let n=Do(e.ranges,t);return n?n.classId:0}}},getCoverageIndex:function(e,t){switch(e.format){case 1:{let n=Ro(e.glyphs,t);return n>=0?n:-1}case 2:{let n=Do(e.ranges,t);return n?n.index+t-n.start:-1}}},expandCoverage:function(e){if(e.format===1)return e.glyphs;{let t=[],n=e.ranges;for(let s=0;s<n.length;s++){let r=n[s],o=r.start,i=r.end;for(let a=o;a<=i;a++)t.push(a)}return t}}};var as=Fo;function An(e){as.call(this,e,"gpos")}An.prototype=as.prototype,An.prototype.init=function(){let e=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(e)},An.prototype.getKerningValue=function(e,t,n){for(let s=0;s<e.length;s++){let r=e[s].subtables;for(let o=0;o<r.length;o++){let i=r[o],a=this.getCoverageIndex(i.coverage,t);if(!(a<0))switch(i.posFormat){case 1:{let l=i.pairSets[a];for(let c=0;c<l.length;c++){let u=l[c];if(u.secondGlyph===n)return u.value1&&u.value1.xAdvance||0}break}case 2:{let l=this.getGlyphClass(i.classDef1,t),c=this.getGlyphClass(i.classDef2,n),u=i.classRecords[l][c];return u.value1&&u.value1.xAdvance||0}}}}return 0},An.prototype.getKerningTables=function(e,t){if(this.font.tables.gpos)return this.getLookupTables(e,t,"kern",2)};var iu=An;function au(e,t){let n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}function lu(e,t,n){let s=0,r=e.length-1,o=null;for(;s<=r;){let i=Math.floor((s+r)/2),a=e[i],l=a[t];if(l<n)s=i+1;else if(l>n)r=i-1;else{o=a;break}}return o}function uu(e,t,n){let s=0,r=e.length-1;for(;s<=r;){let o=Math.floor((s+r)/2),i=e[o];if(i[t]<n)s=o+1;else if(i[t]>n)r=o-1;else return o}return-1}function cu(e,t,n){let s=0,r=e.length,o=(i,a)=>i[t]-a[t];for(;s<r;){let i=s+r>>>1;o(e[i],n)<0?s=i+1:r=i}return e.splice(s,0,n),s}function Uo(e){return e[0]===31&&e[1]===139&&e[2]===8}function fu(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=10,s=e.byteLength-8,r=t.getInt8(3);if(r&4&&(n+=2+t.getUint16(n,!0)),r&8)for(;n<s&&e[n++]!==0;);if(r&16)for(;n<s&&e[n++]!==0;);if(r&2&&(n+=2),n>=s)throw new Error("Can't find compressed blocks");let o=t.getUint32(t.byteLength-4,!0);return Er(e.subarray(n,s),new Uint8Array(o))}function Mo(e){return{x:e.x,y:e.y,onCurve:e.onCurve,lastPointOfContour:e.lastPointOfContour}}function pu(e){return{glyphIndex:e.glyphIndex,xScale:e.xScale,scale01:e.scale01,scale10:e.scale10,yScale:e.yScale,dx:e.dx,dy:e.dy}}function Ge(e){as.call(this,e,"gsub")}function qs(e,t,n){let s=e.subtables;for(let r=0;r<s.length;r++){let o=s[r];if(o.substFormat===t)return o}if(n)return s.push(n),n}Ge.prototype=as.prototype,Ge.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},Ge.prototype.getSingle=function(e,t,n){let s=[],r=this.getLookupTables(t,n,e,1);for(let o=0;o<r.length;o++){let i=r[o].subtables;for(let a=0;a<i.length;a++){let l=i[a],c=this.expandCoverage(l.coverage),u;if(l.substFormat===1){let m=l.deltaGlyphId;for(u=0;u<c.length;u++){let d=c[u];s.push({sub:d,by:d+m})}}else{let m=l.substitute;for(u=0;u<c.length;u++)s.push({sub:c[u],by:m[u]})}}}return s},Ge.prototype.getMultiple=function(e,t,n){let s=[],r=this.getLookupTables(t,n,e,2);for(let o=0;o<r.length;o++){let i=r[o].subtables;for(let a=0;a<i.length;a++){let l=i[a],c=this.expandCoverage(l.coverage),u;for(u=0;u<c.length;u++){let m=c[u],d=l.sequences[u];s.push({sub:m,by:d})}}}return s},Ge.prototype.getAlternates=function(e,t,n){let s=[],r=this.getLookupTables(t,n,e,3);for(let o=0;o<r.length;o++){let i=r[o].subtables;for(let a=0;a<i.length;a++){let l=i[a],c=this.expandCoverage(l.coverage),u=l.alternateSets;for(let m=0;m<c.length;m++)s.push({sub:c[m],by:u[m]})}}return s},Ge.prototype.getLigatures=function(e,t,n){let s=[],r=this.getLookupTables(t,n,e,4);for(let o=0;o<r.length;o++){let i=r[o].subtables;for(let a=0;a<i.length;a++){let l=i[a],c=this.expandCoverage(l.coverage),u=l.ligatureSets;for(let m=0;m<c.length;m++){let d=c[m],x=u[m];for(let v=0;v<x.length;v++){let S=x[v];s.push({sub:[d].concat(S.components),by:S.ligGlyph})}}}}return s},Ge.prototype.addSingle=function(e,t,n,s){let r=this.getLookupTables(n,s,e,1,!0)[0],o=qs(r,2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});B.assert(o.coverage.format===1,"Single: unable to modify coverage table format "+o.coverage.format);let i=t.sub,a=this.binSearch(o.coverage.glyphs,i);a<0&&(a=-1-a,o.coverage.glyphs.splice(a,0,i),o.substitute.splice(a,0,0)),o.substitute[a]=t.by},Ge.prototype.addMultiple=function(e,t,n,s){B.assert(t.by instanceof Array&&t.by.length>1,'Multiple: "by" must be an array of two or more ids');let r=this.getLookupTables(n,s,e,2,!0)[0],o=qs(r,1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});B.assert(o.coverage.format===1,"Multiple: unable to modify coverage table format "+o.coverage.format);let i=t.sub,a=this.binSearch(o.coverage.glyphs,i);a<0&&(a=-1-a,o.coverage.glyphs.splice(a,0,i),o.sequences.splice(a,0,0)),o.sequences[a]=t.by},Ge.prototype.addAlternate=function(e,t,n,s){let r=this.getLookupTables(n,s,e,3,!0)[0],o=qs(r,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});B.assert(o.coverage.format===1,"Alternate: unable to modify coverage table format "+o.coverage.format);let i=t.sub,a=this.binSearch(o.coverage.glyphs,i);a<0&&(a=-1-a,o.coverage.glyphs.splice(a,0,i),o.alternateSets.splice(a,0,0)),o.alternateSets[a]=t.by},Ge.prototype.addLigature=function(e,t,n,s){let r=this.getLookupTables(n,s,e,4,!0)[0],o=r.subtables[0];o||(o={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},r.subtables[0]=o),B.assert(o.coverage.format===1,"Ligature: unable to modify coverage table format "+o.coverage.format);let i=t.sub[0],a=t.sub.slice(1),l={ligGlyph:t.by,components:a},c=this.binSearch(o.coverage.glyphs,i);if(c>=0){let u=o.ligatureSets[c];for(let m=0;m<u.length;m++)if(au(u[m].components,a))return;u.push(l)}else c=-1-c,o.coverage.glyphs.splice(c,0,i),o.ligatureSets.splice(c,0,[l])},Ge.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)}},Ge.prototype.add=function(e,t,n,s){if(/ss\d\d/.test(e))return this.addSingle(e,t,n,s);switch(e){case"aalt":case"salt":return typeof t.by=="number"?this.addSingle(e,t,n,s):this.addAlternate(e,t,n,s);case"dlig":case"liga":case"rlig":return this.addLigature(e,t,n,s);case"ccmp":return t.by instanceof Array?this.addMultiple(e,t,n,s):this.addLigature(e,t,n,s)}};var hu=Ge,Po=class{constructor(e){this.defaultValue=255,this.font=e}cpal(){return this.font.tables&&this.font.tables.cpal?this.font.tables.cpal:!1}getAll(e){let t=[],n=this.cpal();if(!n)return t;for(let s=0;s<n.colorRecordIndices.length;s++){let r=n.colorRecordIndices[s],o=[];for(let i=r;i<r+n.numPaletteEntries;i++)o.push(cn(n.colorRecords[i],e||"hexa"));t.push(o)}return t}toCPALcolor(e){return Array.isArray(e)?e.map(t=>rs(t,"raw")):rs(e,"raw")}fillPalette(e,t=[],n=this.cpal().numPaletteEntries){return e=Number.isInteger(e)?this.get(e,"raw"):e,Object.assign(Array(n).fill(this.defaultValue),this.toCPALcolor(e).concat(this.toCPALcolor(t)))}extend(e){if(this.ensureCPAL(Array(e).fill(this.defaultValue)))return;let t=this.cpal(),n=t.numPaletteEntries+e,s=this.getAll().map(r=>this.fillPalette(r,[],n));t.numPaletteEntries=n,t.colorRecords=this.toCPALcolor(s.flat()),this.updateIndices()}get(e,t="hexa"){return this.getAll(t)[e]||null}getColor(e,t=0,n="hexa"){return Ms(this.font,e,t,n)}setColor(e,t,n=0){e=parseInt(e),n=parseInt(n);let s=this.getAll("raw"),r=s[n];if(!r)throw Error(`paletteIndex ${n} out of range`);let o=this.cpal(),i=o.numPaletteEntries;Array.isArray(t)||(t=[t]),t.length+e>i&&(this.extend(t.length+e-i),s=this.getAll("raw"),r=s[n]);for(let a=0;a<t.length;a++)r[a+e]=this.toCPALcolor(t[a]);o.colorRecords=s.flat(),this.updateIndices()}add(e){if(this.ensureCPAL(e))return;let t=this.cpal(),n=t.numPaletteEntries;e&&e.length?(e=this.toCPALcolor(e),e.length>n?this.extend(e.length-n):e.length<n&&(e=this.fillPalette(e)),t.colorRecordIndices.push(t.colorRecords.length),t.colorRecords.push(...e)):(t.colorRecordIndices.push(t.colorRecords.length),t.colorRecords.push(...Array(n).fill(this.defaultValue)))}delete(e){let t=this.getAll("raw");delete t[e];let n=this.cpal();n.colorRecordIndices.pop(),n.colorRecords=t.flat()}deleteColor(e,t){if(e===t)throw Error("replacementIndex cannot be the same as colorIndex");let n=this.cpal(),s=this.getAll("raw"),r=[];if(t>n.numPaletteEntries-1)throw Error(`Replacement index out of range: numPaletteEntries after deletion: ${n.numPaletteEntries-1}, replacementIndex: ${t})`);for(let a=0;a<s.length;a++){let c=s[a].filter((u,m)=>m!==e);r.push(c)}let o=this.font.tables.colr;if(o){let a=o.layerRecords;for(let l=0;l<a.length;l++){let c=a[l].paletteIndex;if(c>e)a[l].paletteIndex-=1;else if(c===e){let u=0;for(let m=0;m<s.length;m++)if(t>e&&t<=e+s[m].length){u++;break}a[l].paletteIndex=t-u}}this.font.tables.colr={...o,layerRecords:a}}let i=r.flat();for(let a=0;a<s.length;a++)n.colorRecordIndices[a]-=a;n.numPaletteEntries=Math.max(0,n.numPaletteEntries-1),n.colorRecords=this.toCPALcolor(i)}ensureCPAL(e){return this.cpal()?!1:(!e||!e.length?e=[this.defaultValue]:e=this.toCPALcolor(e),this.font.tables.cpal={version:0,numPaletteEntries:e.length,colorRecords:e,colorRecordIndices:[0]},!0)}updateIndices(){let e=this.cpal(),t=Math.ceil(e.colorRecords.length/e.numPaletteEntries);e.colorRecordIndices=[];for(let n=0;n<t;n++)e.colorRecordIndices.push(n*e.numPaletteEntries)}},du=class{constructor(e){this.font=e}ensureCOLR(){return this.font.tables.colr||(this.font.tables.colr={version:0,baseGlyphRecords:[],layerRecords:[]}),this.font}get(e){let t=this.font,n=[],s=t.tables.colr,r=t.tables.cpal;if(!s||!r)return n;let o=lu(s.baseGlyphRecords,"glyphID",e);if(!o)return n;let i=o.firstLayerIndex,a=o.numLayers;for(let l=0;l<a;l++){let c=s.layerRecords[i+l];n.push({glyph:t.glyphs.get(c.glyphID),paletteIndex:c.paletteIndex})}return n}add(e,t,n){let s=this.get(e);t=Array.isArray(t)?t:[t],n===void 0||n===1/0||n>s.length?n=s.length:n<0&&(n=s.length+1+n%(s.length+1),n>=s.length+1&&(n-=s.length+1));let r=[];for(let o=0;o<n;o++){let i=Number.isInteger(s[o].glyph)?s[o].glyph:s[o].glyph.index;r.push({glyphID:i,paletteIndex:s[o].paletteIndex})}for(let o of t){let i=Number.isInteger(o.glyph)?o.glyph:o.glyph.index;r.push({glyphID:i,paletteIndex:o.paletteIndex})}for(let o=n;o<s.length;o++){let i=Number.isInteger(s[o].glyph)?s[o].glyph:s[o].glyph.index;r.push({glyphID:i,paletteIndex:s[o].paletteIndex})}this.updateColrTable(e,r)}setPaletteIndex(e,t,n){let s=this.get(e);s[t]?(s=s.map((r,o)=>({glyphID:r.glyph.index,paletteIndex:o===t?n:r.paletteIndex})),this.updateColrTable(e,s)):console.error("Invalid layer index")}remove(e,t,n=t){let s=this.get(e);s=s.map(r=>({glyphID:r.glyph.index,paletteIndex:r.paletteIndex})),s.splice(t,n-t+1),this.updateColrTable(e,s)}updateColrTable(e,t){this.ensureCOLR();let s=this.font.tables.colr,r=uu(s.baseGlyphRecords,"glyphID",e);if(r===-1){let u={glyphID:e,firstLayerIndex:s.layerRecords.length,numLayers:0};r=cu(s.baseGlyphRecords,"glyphID",u)}let i=s.baseGlyphRecords[r],a=i.numLayers,l=t.length,c=l-a;if(c>0){let u=t.slice(a).map(m=>({glyphID:m.glyphID,paletteIndex:m.paletteIndex}));s.layerRecords.splice(i.firstLayerIndex+a,0,...u)}else c<0&&s.layerRecords.splice(i.firstLayerIndex+l,-c);for(let u=0;u<Math.min(a,l);u++)s.layerRecords[i.firstLayerIndex+u]={glyphID:t[u].glyphID,paletteIndex:t[u].paletteIndex};if(i.numLayers=l,c!==0)for(let u=0;u<s.baseGlyphRecords.length;u++){let m=s.baseGlyphRecords[u];u===r||m.firstLayerIndex<i.firstLayerIndex||(s.baseGlyphRecords[u].firstLayerIndex+=c)}}},gu=class{constructor(e){this.font=e,this.cache=new WeakMap}get(e){let t=this.getOrCreateSvgImageCacheEntry(e);return t&&t.image}getAsync(e){let t=this.getOrCreateSvgImageCacheEntry(e);return t&&t.promise}getOrCreateSvgImageCacheEntry(e){let t=this.font.tables.svg;if(t===void 0)return;let n=t.get(e);if(n===void 0)return;let s=this.cache.get(n);s===void 0&&(s=mu(n),this.cache.set(n,s));let r=s.images.get(e);return r===void 0&&(r=yu(this.font,s.template,e),r.promise.then(o=>{if(r.image=o,typeof this.font.onGlyphUpdated=="function")try{this.font.onGlyphUpdated(e)}catch(i){console.error("font.onGlyphUpdated",e,i)}}),s.images.set(e,r)),r}};function mu(e){return{template:bu(e).then(Su),images:new Map}}function yu(e,t,n){return{promise:t.then(s=>{let r;typeof s=="string"?r=s:(s[4]=n,r=s.join(""));let o=ku(r,e.unitsPerEm);return o.image.decode().then(()=>o)}),image:void 0}}var bu=typeof DecompressionStream=="function"?xu:vu;function vu(e){try{return Promise.resolve(new TextDecoder().decode(Uo(e)?fu(e):e))}catch(t){return Promise.reject(t)}}function xu(e){if(Uo(e))return new Response(new Response(e).body.pipeThrough(new DecompressionStream("gzip"))).text();try{return Promise.resolve(new TextDecoder().decode(e))}catch(t){return Promise.reject(t)}}function Su(e){let t=e.indexOf("<svg"),n=e.indexOf(">",t+4)+1;if(/ id=['"]glyph\d+['"]/.test(e.substring(t,n)))return e;let s=e.lastIndexOf("</svg>");return[e.substring(0,n),"<defs>",e.substring(n,s),'</defs><use href="#glyph',"",'"/>',e.substring(s)]}function ku(e,t){let s=new DOMParser().parseFromString(e,"image/svg+xml").documentElement,r=s.viewBox.baseVal,o=s.width.baseVal,i=s.height.baseVal,a=1,l=1;r.width>0&&r.height>0&&(o.unitType===1?(a=o.valueInSpecifiedUnits/r.width,l=i.unitType===1?i.valueInSpecifiedUnits/r.height:a):i.unitType===1?(l=i.valueInSpecifiedUnits/r.height,a=l):t&&(a=t/r.width,l=t/r.height));let c=document.createElement("div");c.style.position="fixed",c.style.visibility="hidden",c.appendChild(s),document.body.appendChild(c);let u=s.getBBox();document.body.removeChild(c);let m=(u.x-r.x)*a,d=(r.y-u.y)*l,x=u.width*a,v=u.height*l;s.setAttribute("viewBox",[u.x,u.y,u.width,u.height].join(" ")),a!==1&&s.setAttribute("width",x),l!==1&&s.setAttribute("height",v);let S=new Image(x,v);return S.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(s.outerHTML),{leftSideBearing:m,baseline:d,image:S}}var $s=new WeakMap;function No(e,t,n,s,r){let o;return(t&s)>0?(o=e.parseByte(),(t&r)===0&&(o=-o),o=n+o):(t&r)>0?o=n:o=n+e.parseShort(),o}function Bo(e,t,n){let s=new F.Parser(t,n);e._numberOfContours=s.parseShort(),e._xMin=s.parseShort(),e._yMin=s.parseShort(),e._xMax=s.parseShort(),e._yMax=s.parseShort();let r,o;if(e._numberOfContours>0){let i=e.endPointIndices=[];for(let l=0;l<e._numberOfContours;l+=1)i.push(s.parseUShort());e.instructionLength=s.parseUShort(),e.instructions=[];for(let l=0;l<e.instructionLength;l+=1)e.instructions.push(s.parseByte());let a=i[i.length-1]+1;r=[];for(let l=0;l<a;l+=1)if(o=s.parseByte(),r.push(o),(o&8)>0){let c=s.parseByte();for(let u=0;u<c;u+=1)r.push(o),l+=1}if(B.argument(r.length===a,"Bad flags."),i.length>0){let l=[],c;if(a>0){for(let d=0;d<a;d+=1)o=r[d],c={},c.onCurve=!!(o&1),c.lastPointOfContour=i.indexOf(d)>=0,l.push(c);let u=0;for(let d=0;d<a;d+=1)o=r[d],c=l[d],c.x=No(s,o,u,2,16),u=c.x;let m=0;for(let d=0;d<a;d+=1)o=r[d],c=l[d],c.y=No(s,o,m,4,32),m=c.y}e.points=l}else e.points=[]}else if(e._numberOfContours===0)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];let i=!0;for(;i;){r=s.parseUShort();let a={glyphIndex:s.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(r&1)>0?(r&2)>0?(a.dx=s.parseShort(),a.dy=s.parseShort()):a.matchedPoints=[s.parseUShort(),s.parseUShort()]:(r&2)>0?(a.dx=s.parseChar(),a.dy=s.parseChar()):a.matchedPoints=[s.parseByte(),s.parseByte()],(r&8)>0?a.xScale=a.yScale=s.parseF2Dot14():(r&64)>0?(a.xScale=s.parseF2Dot14(),a.yScale=s.parseF2Dot14()):(r&128)>0&&(a.xScale=s.parseF2Dot14(),a.scale01=s.parseF2Dot14(),a.scale10=s.parseF2Dot14(),a.yScale=s.parseF2Dot14()),e.components.push(a),i=!!(r&32)}if(r&256){e.instructionLength=s.parseUShort(),e.instructions=[];for(let a=0;a<e.instructionLength;a+=1)e.instructions.push(s.parseByte())}}}function ls(e,t){let n=[];for(let s=0;s<e.length;s+=1){let r=e[s],o={x:t.xScale*r.x+t.scale10*r.y+t.dx,y:t.scale01*r.x+t.yScale*r.y+t.dy,onCurve:r.onCurve,lastPointOfContour:r.lastPointOfContour};n.push(o)}return n}function Tu(e){let t=[],n=[];for(let s=0;s<e.length;s+=1){let r=e[s];n.push(r),r.lastPointOfContour&&(t.push(n),n=[])}return B.argument(n.length===0,"There are still points left in the current contour."),t}function Xs(e){let t=new Wt;if(!e)return t;let n=Tu(e);for(let s=0;s<n.length;++s){let r=n[s],o=r[r.length-1],i=r[0];if(o.onCurve)t.moveTo(o.x,o.y);else if(i.onCurve)t.moveTo(i.x,i.y);else{let a={x:(o.x+i.x)*.5,y:(o.y+i.y)*.5};t.moveTo(a.x,a.y)}for(let a=0;a<r.length;++a)if(o=i,i=r[(a+1)%r.length],o.onCurve)t.lineTo(o.x,o.y);else{let l=i;i.onCurve||(l={x:(o.x+i.x)*.5,y:(o.y+i.y)*.5}),t.quadraticCurveTo(o.x,o.y,l.x,l.y)}t.closePath()}return t}function _o(e,t){if(t.isComposite){$s.has(e)||$s.set(e,new Set);let n=$s.get(e);n.add(t.index);try{for(let s=0;s<t.components.length;s+=1){let r=t.components[s];if(n.has(r.glyphIndex))continue;let o=e.get(r.glyphIndex);if(o.getPath(),o.points){let i;if(r.matchedPoints===void 0)i=ls(o.points,r);else{if(r.matchedPoints[0]>t.points.length-1||r.matchedPoints[1]>o.points.length-1)throw Error("Matched points out of range in "+t.name);let a=t.points[r.matchedPoints[0]],l=o.points[r.matchedPoints[1]],c={xScale:r.xScale,scale01:r.scale01,scale10:r.scale10,yScale:r.yScale,dx:0,dy:0};l=ls([l],c)[0],c.dx=a.x-l.x,c.dy=a.y-l.y,i=ls(o.points,c)}t.points=t.points.concat(i)}}}finally{n.delete(t.index)}}return Xs(t.points)}function Cu(e,t,n,s){let r=new mt.GlyphSet(s);for(let o=0;o<n.length-1;o+=1){let i=n[o],a=n[o+1];i!==a?r.push(o,mt.ttfGlyphLoader(s,o,Bo,e,t+i,_o)):r.push(o,mt.glyphLoader(s,o))}return r}function Ou(e,t,n,s){let r=new mt.GlyphSet(s);return s._push=function(o){let i=n[o],a=n[o+1];i!==a?r.push(o,mt.ttfGlyphLoader(s,o,Bo,e,t+i,_o)):r.push(o,mt.glyphLoader(s,o))},r}function Iu(e,t,n,s,r){return r.lowMemory?Ou(e,t,n,s):Cu(e,t,n,s)}var Go={getPath:Xs,parse:Iu},wu=class{constructor(e){this.font=e}normalizeCoordTags(e){for(let t in e)if(t.length<4){let n=t.padEnd(4," ");e[n]===void 0&&(e[n]=e[t]),delete e[t]}}getNormalizedCoords(e){e||(e=this.font.variation.get());let t=[];this.normalizeCoordTags(e);for(let n=0;n<this.fvar().axes.length;n++){let s=this.fvar().axes[n],r=e[s.tag];r===void 0&&(r=s.defaultValue),r<s.defaultValue?t.push((r-s.defaultValue+Number.EPSILON)/(s.defaultValue-s.minValue+Number.EPSILON)):t.push((r-s.defaultValue+Number.EPSILON)/(s.maxValue-s.defaultValue+Number.EPSILON))}if(this.avar())for(let n=0;n<this.avar().axisSegmentMaps.length;n++){let s=this.avar().axisSegmentMaps[n];for(let r=0;r<s.axisValueMaps.length;r++){let o=s.axisValueMaps[r];if(r>=1&&t[n]<o.fromCoordinate){let i=s.axisValueMaps[r-1];t[n]=((t[n]-i.fromCoordinate)*(o.toCoordinate-i.toCoordinate)+Number.EPSILON)/(o.fromCoordinate-i.fromCoordinate+Number.EPSILON)+i.toCoordinate;break}}}return t}interpolatePoints(e,t,n){if(e.length===0)return;let s=0;for(;s<e.length;){let r=s,o=s,i=e[o];for(;!i.lastPointOfContour;)i=e[++o];for(;s<=o&&!n[s];)s++;if(s>o)continue;let a=s,l=s;for(s++;s<=o;)n[s]&&(this.deltaInterpolate(l+1,s-1,l,s,t,e),l=s),s++;l===a?this.deltaShift(r,o,l,t,e):(this.deltaInterpolate(l+1,o,l,a,t,e),a>0&&this.deltaInterpolate(r,a-1,l,a,t,e)),s=o+1}}deltaInterpolate(e,t,n,s,r,o){if(e>t)return;let i=["x","y"];for(let l=0;l<i.length;l++){let c=i[l];if(r[n][c]>r[s][c]){var a=n;n=s,s=a}let u=r[n][c],m=r[s][c],d=o[n][c],x=o[s][c];if(u!==m||d===x){let v=u===m?0:(x-d)/(m-u);for(let S=e;S<=t;S++){let I=r[S][c];I<=u?I+=d-u:I>=m?I+=x-m:I=d+(I-u)*v,o[S][c]=I}}}}deltaShift(e,t,n,s,r){let o=r[n].x-s[n].x,i=r[n].y-s[n].y;if(!(o===0&&i===0))for(let a=e;a<=t;a++)a!==n&&(r[a].x+=o,r[a].y+=i)}transformComponents(e,t,n,s,r,o){let i=0;for(let a=0;a<e.components.length;a++){let l=e.components[a],c=this.font.glyphs.get(l.glyphIndex),u=pu(l),m=s.indexOf(a);m>-1&&(u.dx+=Math.round(r.deltas[m]*o),u.dy+=Math.round(r.deltasY[m]*o));let d=ls(this.getTransform(c,n).points,u);t.splice(i,d.length,...d),i+=c.points.length}}applyTupleVariationStore(e,t,n,s="gvar",r={}){n||(n=this.font.variation.get());let o=this.getNormalizedCoords(n),{headers:i,sharedPoints:a}=e,l=this.fvar().axes.length,c;s==="gvar"?c=t.map(Mo):s==="cvar"&&(c=[...t]);for(let u=0;u<i.length;u++){let m=i[u],d=1;for(let v=0;v<l;v++){let S=[0];switch(s){case"gvar":S=m.peakTuple?m.peakTuple:this.gvar().sharedTuples[m.sharedTupleRecordsIndex];break;case"cvar":S=m.peakTuple;break}if(S[v]!==0){if(o[v]===0){d=0;break}if(m.intermediateStartTuple)if(o[v]<m.intermediateStartTuple[v]||o[v]>m.intermediateEndTuple[v]){d=0;break}else o[v]<S[v]?d=d*(o[v]-m.intermediateStartTuple[v]+Number.EPSILON)/(S[v]-m.intermediateStartTuple[v]+Number.EPSILON):d=d*(m.intermediateEndTuple[v]-o[v]+Number.EPSILON)/(m.intermediateEndTuple[v]-S[v]+Number.EPSILON);else{if(o[v]<Math.min(0,S[v])||o[v]>Math.max(0,S[v])){d=0;break}d=(d*o[v]+Number.EPSILON)/(S[v]+Number.EPSILON)}}}if(d===0)continue;let x=m.privatePoints.length?m.privatePoints:a;if(s==="gvar"&&r.glyph&&r.glyph.isComposite)this.transformComponents(r.glyph,c,n,x,m,d);else if(x.length===0)for(let v=0;v<c.length;v++){let S=c[v];s==="gvar"?c[v]={x:Math.round(S.x+m.deltas[v]*d),y:Math.round(S.y+m.deltasY[v]*d),onCurve:S.onCurve,lastPointOfContour:S.lastPointOfContour}:s==="cvar"&&(c[v]=Math.round(S+m.deltas[v]*d))}else{let v;s==="gvar"?v=c.map(Mo):s==="cvar"&&(v=c);let S=Array(t.length).fill(!1);for(let I=0;I<x.length;I++){let _=x[I];if(_<t.length){let P=v[_];s==="gvar"?(S[_]=!0,P.x+=m.deltas[I]*d,P.y+=m.deltasY[I]*d):s==="cvar"&&(c[_]=Math.round(P+m.deltas[I]*d))}}if(s==="gvar"){this.interpolatePoints(v,c,S);for(let I=0;I<t.length;I++){let _=v[I].x-c[I].x,P=v[I].y-c[I].y;c[I].x=Math.round(c[I].x+_),c[I].y=Math.round(c[I].y+P)}}}}return c}getTransform(e,t){Number.isInteger(e)&&(e=this.font.glyphs.get(e));let n=e.getBlendPath,s=!!(e.points&&e.points.length),r=e;if(n||s){if(t||(t=this.font.variation.get()),s){let o=this.gvar()&&this.gvar().glyphVariations[e.index];if(o){let i=e.points,a=this.applyTupleVariationStore(o,i,t,"gvar",{glyph:e});r=new fn(Object.assign({},e,{points:a,path:Xs(a)}))}}else if(n){let o=e.getBlendPath(t);r=new fn(Object.assign({},e,{path:o}))}}return this.font.tables.hvar&&(e._advanceWidth=typeof e._advanceWidth<"u"?e._advanceWidth:e.advanceWidth,e.advanceWidth=r.advanceWidth=Math.round(e._advanceWidth+this.getVariableAdjustment(r.index,"hvar","advanceWidth",t)),e._leftSideBearing=typeof e._leftSideBearing<"u"?e._leftSideBearing:e.leftSideBearing,e.leftSideBearing=r.leftSideBearing=Math.round(e._leftSideBearing+this.getVariableAdjustment(r.index,"hvar","lsb",t))),r}getCvarTransform(e){let t=this.font.tables.cvt,n=this.cvar();return!t||!t.length||!n||!n.headers.length?t:this.applyTupleVariationStore(n,t,e,"cvar")}getVariableAdjustment(e,t,n,s){s=s||this.font.variation.get();let r,o,i=this.font.tables[t];if(!i)throw Error(`trying to get variation adjustment from non-existent table "${i}"`);if(!i.itemVariationStore)throw Error(`trying to get variation adjustment from table "${i}" which does not have an itemVariationStore`);let a=i[n]&&i[n].map.length;if(a){let l=e;l>=a&&(l=a-1),{outerIndex:r,innerIndex:o}=i[n].map[l]}else r=0,o=e;return this.getDelta(i.itemVariationStore,r,o,s)}getDelta(e,t,n,s){if(t>=e.itemVariationSubtables.length)return 0;let r=e.itemVariationSubtables[t];if(n>=r.deltaSets.length)return 0;let o=r.deltaSets[n],i=this.getBlendVector(e,t,s),a=0;for(let l=0;l<r.regionIndexes.length;l++)a+=o[l]*i[l];return a}getBlendVector(e,t,n){n||(n=this.font.variation.get());let s=e.itemVariationSubtables[t],r=this.getNormalizedCoords(n),o=[];for(let i=0;i<s.regionIndexes.length;i++){let a=1,l=s.regionIndexes[i],c=e.variationRegions[l].regionAxes;for(let u=0;u<c.length;u++){let m=c[u],d;m.startCoord>m.peakCoord||m.peakCoord>m.endCoord||m.startCoord<0&&m.endCoord>0&&m.peakCoord!==0||m.peakCoord===0?d=1:r[u]<m.startCoord||r[u]>m.endCoord?d=0:r[u]===m.peakCoord?d=1:r[u]<m.peakCoord?d=(r[u]-m.startCoord+Number.EPSILON)/(m.peakCoord-m.startCoord+Number.EPSILON):d=(m.endCoord-r[u]+Number.EPSILON)/(m.endCoord-m.peakCoord+Number.EPSILON),a*=d}o[i]=a}return o}avar(){return this.font.tables.avar}cvar(){return this.font.tables.cvar}fvar(){return this.font.tables.fvar}gvar(){return this.font.tables.gvar}hvar(){return this.font.tables.hvar}},Eu=class{constructor(e){this.font=e,this.process=new wu(this.font),this.activateDefaultVariation(),this.getTransform=this.process.getTransform.bind(this.process)}activateDefaultVariation(){let e=this.getDefaultInstanceIndex();e>-1?this.set(e):this.set(this.getDefaultCoordinates())}getDefaultCoordinates(){return this.fvar().axes.reduce((e,t)=>(e[t.tag]=t.defaultValue,e),{})}getDefaultInstanceIndex(){let e=this.getDefaultCoordinates(),t=this.getInstanceIndex(e);return t<0&&(t=this.fvar().instances.findIndex(n=>n.name&&n.name.en==="Regular")),t}getInstanceIndex(e){return this.fvar().instances.findIndex(t=>Object.keys(e).every(n=>t.coordinates[n]===e[n]))}getInstance(e){return this.fvar().instances&&this.fvar().instances[e]}set(e){let t;if(Number.isInteger(e)){let n=this.getInstance(e);if(!n)throw Error(`Invalid instance index ${e}`);t={...n.coordinates}}else t=e,this.process.normalizeCoordTags(t);t=Object.assign({},this.font.defaultRenderOptions.variation,t),this.font.defaultRenderOptions=Object.assign({},this.font.defaultRenderOptions,{variation:t})}get(){return Object.assign({},this.font.defaultRenderOptions.variation)}avar(){return this.font.tables.avar}cvar(){return this.font.tables.cvar}fvar(){return this.font.tables.fvar}gvar(){return this.font.tables.gvar}hvar(){return this.font.tables.hvar}},Ho=1e6,us=64,cs=1e4,Vo,Yt,zo,Ys;function jo(e){this.font=e,this.getCommands=function(t){return Go.getPath(t).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function Lu(e){return e}function Wo(e){return Math.sign(e)*Math.round(Math.abs(e))}function Au(e){return Math.sign(e)*Math.round(Math.abs(e*2))/2}function Ru(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function Du(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function Fu(e){return Math.sign(e)*Math.floor(Math.abs(e))}var qo=function(e){let t=this.srPeriod,n=this.srPhase,s=this.srThreshold,r=1;return e<0&&(e=-e,r=-1),e+=s-n,e=Math.trunc(e/t)*t,e+=n,e<0?n*r:e*r},bt={x:1,y:0,axis:"x",distance:function(e,t,n,s){return(n?e.xo:e.x)-(s?t.xo:t.x)},interpolate:function(e,t,n,s){let r,o,i,a,l,c,u;if(!s||s===this){if(r=e.xo-t.xo,o=e.xo-n.xo,l=t.x-t.xo,c=n.x-n.xo,i=Math.abs(r),a=Math.abs(o),u=i+a,u===0){e.x=e.xo+(l+c)/2;return}e.x=e.xo+(l*a+c*i)/u;return}if(r=s.distance(e,t,!0,!0),o=s.distance(e,n,!0,!0),l=s.distance(t,t,!1,!0),c=s.distance(n,n,!1,!0),i=Math.abs(r),a=Math.abs(o),u=i+a,u===0){bt.setRelative(e,e,(l+c)/2,s,!0);return}bt.setRelative(e,e,(l*a+c*i)/u,s,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(e,t,n,s,r){if(!s||s===this){e.x=(r?t.xo:t.x)+n;return}let o=r?t.xo:t.x,i=r?t.yo:t.y,a=o+n*s.x,l=i+n*s.y;e.x=a+(e.y-l)/s.normalSlope},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},kt={x:0,y:1,axis:"y",distance:function(e,t,n,s){return(n?e.yo:e.y)-(s?t.yo:t.y)},interpolate:function(e,t,n,s){let r,o,i,a,l,c,u;if(!s||s===this){if(r=e.yo-t.yo,o=e.yo-n.yo,l=t.y-t.yo,c=n.y-n.yo,i=Math.abs(r),a=Math.abs(o),u=i+a,u===0){e.y=e.yo+(l+c)/2;return}e.y=e.yo+(l*a+c*i)/u;return}if(r=s.distance(e,t,!0,!0),o=s.distance(e,n,!0,!0),l=s.distance(t,t,!1,!0),c=s.distance(n,n,!1,!0),i=Math.abs(r),a=Math.abs(o),u=i+a,u===0){kt.setRelative(e,e,(l+c)/2,s,!0);return}kt.setRelative(e,e,(l*a+c*i)/u,s,!0)},normalSlope:0,setRelative:function(e,t,n,s,r){if(!s||s===this){e.y=(r?t.yo:t.y)+n;return}let o=r?t.xo:t.x,i=r?t.yo:t.y,a=o+n*s.x,l=i+n*s.y;e.y=l+s.normalSlope*(e.x-a)},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};Object.freeze(bt),Object.freeze(kt);function Rn(e,t){this.x=e,this.y=t,this.axis=void 0,this.slope=t/e,this.normalSlope=-e/t,Object.freeze(this)}Rn.prototype.distance=function(e,t,n,s){return this.x*bt.distance(e,t,n,s)+this.y*kt.distance(e,t,n,s)},Rn.prototype.interpolate=function(e,t,n,s){let r,o,i,a,l,c,u;if(i=s.distance(e,t,!0,!0),a=s.distance(e,n,!0,!0),r=s.distance(t,t,!1,!0),o=s.distance(n,n,!1,!0),l=Math.abs(i),c=Math.abs(a),u=l+c,u===0){this.setRelative(e,e,(r+o)/2,s,!0);return}this.setRelative(e,e,(r*c+o*l)/u,s,!0)},Rn.prototype.setRelative=function(e,t,n,s,r){s=s||this;let o=r?t.xo:t.x,i=r?t.yo:t.y,a=o+n*s.x,l=i+n*s.y,c=s.normalSlope,u=this.slope,m=e.x,d=e.y;e.x=(u*m-c*a+l-d)/(u-c),e.y=u*(e.x-m)+d},Rn.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0};function Dn(e,t){let n=Math.sqrt(e*e+t*t);return e/=n,t/=n,e===1&&t===0?bt:e===0&&t===1?kt:new Rn(e,t)}function Tt(e,t,n,s){this.x=this.xo=Math.round(e*64)/64,this.y=this.yo=Math.round(t*64)/64,this.lastPointOfContour=n,this.onCurve=s,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Tt.prototype.nextTouched=function(e){let t=this.nextPointOnContour;for(;!e.touched(t)&&t!==this;)t=t.nextPointOnContour;return t},Tt.prototype.prevTouched=function(e){let t=this.prevPointOnContour;for(;!e.touched(t)&&t!==this;)t=t.prevPointOnContour;return t};var Fn=Object.freeze(new Tt(0,0)),Uu={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function Et(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=bt,this.round=Wo}}jo.prototype.exec=function(e,t){if(typeof t!="number")throw new Error("Point size is not a number!");if(this._errorState>2)return;let n=this.font,s=this._prepState;if(!s||s.ppem!==t){let r=this._fpgmState;if(!r){Et.prototype=Uu,r=this._fpgmState=new Et("fpgm",n.tables.fpgm),r.funcs=[],r.font=n,r.instructionCount=0,r.callDepth=0;try{Yt(r)}catch(i){console.log("Hinting error in FPGM:"+i),this._errorState=3;return}}Et.prototype=r,s=this._prepState=new Et("prep",n.tables.prep),s.ppem=t,s.instructionCount=0,s.callDepth=0;let o=n.variation&&n.variation.process.getCvarTransform()||n.tables.cvt;if(o){let i=s.cvt=new Array(o.length),a=t/n.unitsPerEm;for(let l=0;l<o.length;l++)i[l]=o[l]*a}else s.cvt=[];try{Yt(s)}catch(i){this._errorState<2&&console.log("Hinting error in PREP:"+i),this._errorState=2}}if(!(this._errorState>1))try{return zo(e,s)}catch(r){this._errorState<1&&(console.log("Hinting error:"+r),console.log("Note: further hinting errors are silenced")),this._errorState=1;return}},zo=function(e,t){let n=t.ppem/t.font.unitsPerEm,s=n,r=e.components,o,i,a;if(Et.prototype=t,!r)a=new Et("glyf",e.instructions),a.instructionCount=0,a.callDepth=0,Ys(e,a,n,s),i=a.gZone;else{let l=t.font;i=[],o=[];for(let c=0;c<r.length;c++){let u=r[c],m=l.glyphs.get(u.glyphIndex);a=new Et("glyf",m.instructions),a.instructionCount=0,a.callDepth=0,Ys(m,a,n,s);let d=Math.round(u.dx*n),x=Math.round(u.dy*s),v=a.gZone,S=a.contours;for(let _=0;_<v.length;_++){let P=v[_];P.xTouched=P.yTouched=!1,P.xo=P.x=P.x+d,P.yo=P.y=P.y+x}let I=i.length;i.push.apply(i,v);for(let _=0;_<S.length;_++)o.push(S[_]+I)}e.instructions&&!a.inhibitGridFit&&(a=new Et("glyf",e.instructions),a.gZone=a.z0=a.z1=a.z2=i,a.contours=o,i.push(new Tt(0,0),new Tt(Math.round(e.advanceWidth*n),0)),Yt(a),i.length-=2)}return i},Ys=function(e,t,n,s){let r=e.points||[],o=r.length,i=t.gZone=t.z0=t.z1=t.z2=[],a=t.contours=[],l;for(let m=0;m<o;m++)l=r[m],i[m]=new Tt(l.x*n,l.y*s,l.lastPointOfContour,l.onCurve);let c,u;for(let m=0;m<o;m++)l=i[m],c||(c=l,a.push(m)),l.lastPointOfContour?(l.nextPointOnContour=c,c.prevPointOnContour=l,c=void 0):(u=i[m+1],l.nextPointOnContour=u,u.prevPointOnContour=l);t.inhibitGridFit||(i.push(new Tt(0,0),new Tt(Math.round(e.advanceWidth*n),0)),Yt(t),i.length-=2)},Yt=function(e){let t=e.prog;if(!t)return;let n=t.length,s;for(e.ip=0;e.ip<n;e.ip++){if(++e.instructionCount>Ho)throw new Error("Hinting instructions exceeded maximum of "+Ho);if(s=Vo[t[e.ip]],!s)throw new Error("unknown instruction: 0x"+Number(t[e.ip]).toString(16));s(e)}};function fs(e){let t=e.tZone=new Array(e.gZone.length);for(let n=0;n<t.length;n++)t[n]=new Tt(0,0)}function $o(e,t){let n=e.prog,s=e.ip,r=1,o;do if(o=n[++s],o===88)r++;else if(o===89)r--;else if(o===64)s+=n[s+1]+1;else if(o===65)s+=2*n[s+1]+1;else if(o>=176&&o<=183)s+=o-176+1;else if(o>=184&&o<=191)s+=(o-184+1)*2;else if(t&&r===1&&o===27)break;while(r>0);e.ip=s}function Xo(e,t){t.fv=t.pv=t.dpv=e}function Yo(e,t){t.pv=t.dpv=e}function Zo(e,t){t.fv=e}function Ko(e,t){let n=t.stack,s=n.pop(),r=n.pop(),o=t.z2[s],i=t.z1[r],a,l;e?(a=o.y-i.y,l=i.x-o.x):(a=i.x-o.x,l=i.y-o.y),t.pv=t.dpv=Dn(a,l)}function Qo(e,t){let n=t.stack,s=n.pop(),r=n.pop(),o=t.z2[s],i=t.z1[r],a,l;e?(a=o.y-i.y,l=i.x-o.x):(a=i.x-o.x,l=i.y-o.y),t.fv=Dn(a,l)}function Mu(e){let t=e.stack,n=t.pop(),s=t.pop();e.pv=e.dpv=Dn(s,n)}function Pu(e){let t=e.stack,n=t.pop(),s=t.pop();e.fv=Dn(s,n)}function Nu(e){let t=e.stack,n=e.pv;t.push(n.x*16384),t.push(n.y*16384)}function Bu(e){let t=e.stack,n=e.fv;t.push(n.x*16384),t.push(n.y*16384)}function _u(e){e.fv=e.pv}function Gu(e){let t=e.stack,n=t.pop(),s=t.pop(),r=t.pop(),o=t.pop(),i=t.pop(),a=e.z0,l=e.z1,c=a[n],u=a[s],m=l[r],d=l[o],x=e.z2[i],v=c.x,S=c.y,I=u.x,_=u.y,P=m.x,z=m.y,Y=d.x,re=d.y,ie=(v-I)*(z-re)-(S-_)*(P-Y),ae=v*_-S*I,me=P*re-z*Y;x.x=(ae*(P-Y)-me*(v-I))/ie,x.y=(ae*(z-re)-me*(S-_))/ie}function Hu(e){e.rp0=e.stack.pop()}function Vu(e){e.rp1=e.stack.pop()}function zu(e){e.rp2=e.stack.pop()}function ju(e){let t=e.stack.pop();switch(e.zp0=t,t){case 0:e.tZone||fs(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function Wu(e){let t=e.stack.pop();switch(e.zp1=t,t){case 0:e.tZone||fs(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function qu(e){let t=e.stack.pop();switch(e.zp2=t,t){case 0:e.tZone||fs(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function $u(e){let t=e.stack.pop();switch(e.zp0=e.zp1=e.zp2=t,t){case 0:e.tZone||fs(e),e.z0=e.z1=e.z2=e.tZone;break;case 1:e.z0=e.z1=e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function Xu(e){e.loop=e.stack.pop(),e.loop>cs&&(e.loop=cs)}function Yu(e){e.round=Wo}function Zu(e){e.round=Ru}function Ku(e){let t=e.stack.pop();e.minDis=t/64}function Qu(e){$o(e,!1)}function Ju(e){let t=e.stack.pop();e.ip+=t-1}function ec(e){let t=e.stack.pop();e.cvCutIn=t/64}function tc(e){let t=e.stack;t.push(t[t.length-1])}function Zs(e){e.stack.pop()}function nc(e){e.stack.length=0}function sc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(n),t.push(s)}function rc(e){let t=e.stack;t.push(t.length)}function oc(e){let t=e.stack,n=t.pop(),s=t.pop();if(s>cs&&(s=cs),++e.callDepth>us)throw new Error("Hinting call depth exceeded maximum of "+us);let r=e.ip,o=e.prog;e.prog=e.funcs[n];for(let i=0;i<s;i++)Yt(e);e.ip=r,e.prog=o,e.callDepth--}function ic(e){let t=e.stack.pop();if(++e.callDepth>us)throw new Error("Hinting call depth exceeded maximum of "+us);let n=e.ip,s=e.prog;e.prog=e.funcs[t],Yt(e),e.ip=n,e.prog=s,e.callDepth--}function ac(e){let t=e.stack,n=t.pop();t.push(t[t.length-n])}function lc(e){let t=e.stack,n=t.pop();t.push(t.splice(t.length-n,1)[0])}function uc(e){if(e.env!=="fpgm")throw new Error("FDEF not allowed here");let t=e.stack,n=e.prog,s=e.ip,r=t.pop(),o=s;for(;n[++s]!==45;);e.ip=s,e.funcs[r]=n.slice(o+1,s)}function Jo(e,t){let n=t.stack.pop(),s=t.z0[n],r=t.fv,o=t.pv,i=o.distance(s,Fn);e&&(i=t.round(i)),r.setRelative(s,Fn,i,o),r.touch(s),t.rp0=t.rp1=n}function ei(e,t){let n=t.z2,s=n.length-2,r,o,i;for(let a=0;a<s;a++)r=n[a],!e.touched(r)&&(o=r.prevTouched(e),o!==r&&(i=r.nextTouched(e),o===i&&e.setRelative(r,r,e.distance(o,o,!1,!0),e,!0),e.interpolate(r,o,i,e)))}function ti(e,t){let n=t.stack,s=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[s],o=t.fv,i=t.pv,a=t.loop,l=t.z2;for(;a--;){let c=n.pop(),u=l[c],m=i.distance(r,r,!1,!0);o.setRelative(u,u,m,i),o.touch(u)}t.loop=1}function ni(e,t){let n=t.stack,s=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[s],o=t.fv,i=t.pv,a=n.pop(),l=t.z2[t.contours[a]],c=l,u=i.distance(r,r,!1,!0);do c!==r&&o.setRelative(c,c,u,i),c=c.nextPointOnContour;while(c!==l)}function si(e,t){let n=t.stack,s=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[s],o=t.fv,i=t.pv,a=n.pop(),l;switch(a){case 0:l=t.tZone;break;case 1:l=t.gZone;break;default:throw new Error("Invalid zone")}let c,u=i.distance(r,r,!1,!0),m=l.length-2;for(let d=0;d<m;d++)c=l[d],o.setRelative(c,c,u,i)}function cc(e){let t=e.stack,n=e.loop,s=e.fv,r=t.pop()/64,o=e.z2;for(;n--;){let i=t.pop(),a=o[i];s.setRelative(a,a,r),s.touch(a)}e.loop=1}function fc(e){let t=e.stack,n=e.rp1,s=e.rp2,r=e.loop,o=e.z0[n],i=e.z1[s],a=e.fv,l=e.dpv,c=e.z2;for(;r--;){let u=t.pop(),m=c[u];a.interpolate(m,o,i,l),a.touch(m)}e.loop=1}function ri(e,t){let n=t.stack,s=n.pop()/64,r=n.pop(),o=t.z1[r],i=t.z0[t.rp0],a=t.fv,l=t.pv;a.setRelative(o,i,s,l),a.touch(o),t.rp1=t.rp0,t.rp2=r,e&&(t.rp0=r)}function pc(e){let t=e.stack,n=e.rp0,s=e.z0[n],r=e.loop,o=e.fv,i=e.pv,a=e.z1;for(;r--;){let l=t.pop(),c=a[l];o.setRelative(c,s,0,i),o.touch(c)}e.loop=1}function hc(e){e.round=Au}function oi(e,t){let n=t.stack,s=n.pop(),r=n.pop(),o=t.z0[r],i=t.fv,a=t.pv,l=t.cvt[s],c=a.distance(o,Fn);e&&(Math.abs(c-l)<t.cvCutIn&&(c=l),c=t.round(c)),i.setRelative(o,Fn,c,a),t.zp0===0&&(o.xo=o.x,o.yo=o.y),i.touch(o),t.rp0=t.rp1=r}function dc(e){let t=e.prog,n=e.ip,s=e.stack,r=t[++n];for(let o=0;o<r;o++)s.push(t[++n]);e.ip=n}function gc(e){let t=e.ip,n=e.prog,s=e.stack,r=n[++t];for(let o=0;o<r;o++){let i=n[++t]<<8|n[++t];i&32768&&(i=-((i^65535)+1)),s.push(i)}e.ip=t}function mc(e){let t=e.stack,n=e.store;n||(n=e.store=[]);let s=t.pop(),r=t.pop();n[r]=s}function yc(e){let t=e.stack,n=e.store,s=t.pop(),r=n&&n[s]||0;t.push(r)}function bc(e){let t=e.stack,n=t.pop(),s=t.pop();e.cvt[s]=n/64}function vc(e){let t=e.stack,n=t.pop();t.push(e.cvt[n]*64)}function ii(e,t){let n=t.stack,s=n.pop(),r=t.z2[s];n.push(t.dpv.distance(r,Fn,e,!1)*64)}function ai(e,t){let n=t.stack,s=n.pop(),r=n.pop(),o=t.z1[s],i=t.z0[r],a=t.dpv.distance(i,o,e,e);t.stack.push(Math.round(a*64))}function xc(e){e.stack.push(e.ppem)}function Sc(e){e.autoFlip=!0}function kc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s<n?1:0)}function Tc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s<=n?1:0)}function Cc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s>n?1:0)}function Oc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s>=n?1:0)}function Ic(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(n===s?1:0)}function wc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(n!==s?1:0)}function Ec(e){let t=e.stack,n=t.pop();t.push(Math.trunc(n)&1?1:0)}function Lc(e){let t=e.stack,n=t.pop();t.push(Math.trunc(n)&1?0:1)}function Ac(e){let t=e.stack.pop(),n;t||$o(e,!0)}function Rc(e){}function Dc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(n&&s?1:0)}function Fc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(n||s?1:0)}function Uc(e){let t=e.stack,n=t.pop();t.push(n?0:1)}function Ks(e,t){let n=t.stack,s=n.pop(),r=t.fv,o=t.pv,i=t.ppem,a=t.deltaBase+(e-1)*16,l=t.deltaShift,c=t.z0;for(let u=0;u<s;u++){let m=n.pop(),d=n.pop();if(a+((d&240)>>4)!==i)continue;let v=(d&15)-8;v>=0&&v++;let S=c[m];r.setRelative(S,S,v*l,o)}}function Mc(e){let n=e.stack.pop();e.deltaBase=n}function Pc(e){let n=e.stack.pop();e.deltaShift=Math.pow(.5,n)}function Nc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s+n)}function Bc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s-n)}function _c(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s*64/n)}function Gc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s*n/64)}function Hc(e){let t=e.stack,n=t.pop();t.push(Math.abs(n))}function Vc(e){let t=e.stack,n=t.pop();t.push(-n)}function zc(e){let t=e.stack,n=t.pop();t.push(Math.floor(n/64)*64)}function jc(e){let t=e.stack,n=t.pop();t.push(Math.ceil(n/64)*64)}function ps(e,t){let n=t.stack,s=n.pop();n.push(t.round(s/64)*64)}function Wc(e){let t=e.stack,n=t.pop(),s=t.pop();e.cvt[s]=n*e.ppem/e.font.unitsPerEm}function Qs(e,t){let n=t.stack,s=n.pop(),r=t.ppem,o=t.deltaBase+(e-1)*16,i=t.deltaShift;for(let a=0;a<s;a++){let l=n.pop(),c=n.pop();if(o+((c&240)>>4)!==r)continue;let m=(c&15)-8;m>=0&&m++;let d=m*i;t.cvt[l]+=d}}function qc(e){let t=e.stack.pop();e.round=qo;let n;switch(t&192){case 0:n=.5;break;case 64:n=1;break;case 128:n=2;break;default:throw new 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 new Error("invalid SROUND value")}t&=15,t===0?e.srThreshold=0:e.srThreshold=(t/8-.5)*n}function $c(e){let t=e.stack.pop();e.round=qo;let 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 new 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 new Error("invalid S45ROUND value")}t&=15,t===0?e.srThreshold=0:e.srThreshold=(t/8-.5)*n}function Xc(e){e.round=Lu}function Yc(e){e.round=Du}function Zc(e){e.round=Fu}function Kc(e){let t=e.stack.pop()}function li(e,t){let n=t.stack,s=n.pop(),r=n.pop(),o=t.z2[s],i=t.z1[r],a,l;e?(a=o.y-i.y,l=i.x-o.x):(a=i.x-o.x,l=i.y-o.y),t.dpv=Dn(a,l)}function Qc(e){let t=e.stack,n=t.pop(),s=0;n&1&&(s=35),n&32&&(s|=4096),t.push(s)}function Jc(e){let t=e.stack,n=t.pop(),s=t.pop(),r=t.pop();t.push(s),t.push(n),t.push(r)}function ef(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(Math.max(s,n))}function tf(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(Math.min(s,n))}function nf(e){let t=e.stack.pop()}function sf(e){let t=e.stack.pop(),n=e.stack.pop();switch(t){case 1:e.inhibitGridFit=!!n;return;case 2:e.ignoreCvt=!!n;return;default:throw new Error("invalid INSTCTRL[] selector")}}function Lt(e,t){let n=t.stack,s=t.prog,r=t.ip;for(let o=0;o<e;o++)n.push(s[++r]);t.ip=r}function At(e,t){let n=t.ip,s=t.prog,r=t.stack;for(let o=0;o<e;o++){let i=s[++n]<<8|s[++n];i&32768&&(i=-((i^65535)+1)),r.push(i)}t.ip=n}function N(e,t,n,s,r,o){let i=o.stack,a=e&&i.pop(),l=i.pop(),c=o.rp0,u=o.z0[c],m=o.z1[l],d=o.minDis,x=o.fv,v=o.dpv,S,I,_,P;I=S=v.distance(m,u,!0,!0),_=I>=0?1:-1,I=Math.abs(I),e&&(P=o.cvt[a],s&&Math.abs(I-P)<o.cvCutIn&&(I=P)),n&&I<d&&(I=d),s&&(I=o.round(I)),x.setRelative(m,u,_*I,v),x.touch(m),o.rp1=o.rp0,o.rp2=l,t&&(o.rp0=l)}Vo=[Xo.bind(void 0,kt),Xo.bind(void 0,bt),Yo.bind(void 0,kt),Yo.bind(void 0,bt),Zo.bind(void 0,kt),Zo.bind(void 0,bt),Ko.bind(void 0,0),Ko.bind(void 0,1),Qo.bind(void 0,0),Qo.bind(void 0,1),Mu,Pu,Nu,Bu,_u,Gu,Hu,Vu,zu,ju,Wu,qu,$u,Xu,Yu,Zu,Ku,Qu,Ju,ec,void 0,void 0,tc,Zs,nc,sc,rc,ac,lc,void 0,void 0,void 0,oc,ic,uc,void 0,Jo.bind(void 0,0),Jo.bind(void 0,1),ei.bind(void 0,kt),ei.bind(void 0,bt),ti.bind(void 0,0),ti.bind(void 0,1),ni.bind(void 0,0),ni.bind(void 0,1),si.bind(void 0,0),si.bind(void 0,1),cc,fc,ri.bind(void 0,0),ri.bind(void 0,1),pc,hc,oi.bind(void 0,0),oi.bind(void 0,1),dc,gc,mc,yc,bc,vc,ii.bind(void 0,0),ii.bind(void 0,1),void 0,ai.bind(void 0,0),ai.bind(void 0,1),xc,void 0,Sc,void 0,void 0,kc,Tc,Cc,Oc,Ic,wc,Ec,Lc,Ac,Rc,Dc,Fc,Uc,Ks.bind(void 0,1),Mc,Pc,Nc,Bc,_c,Gc,Hc,Vc,zc,jc,ps.bind(void 0,0),ps.bind(void 0,1),ps.bind(void 0,2),ps.bind(void 0,3),void 0,void 0,void 0,void 0,Wc,Ks.bind(void 0,2),Ks.bind(void 0,3),Qs.bind(void 0,1),Qs.bind(void 0,2),Qs.bind(void 0,3),qc,$c,void 0,void 0,Xc,void 0,Yc,Zc,Zs,Zs,void 0,void 0,void 0,void 0,void 0,Kc,li.bind(void 0,0),li.bind(void 0,1),Qc,void 0,Jc,ef,tf,nf,sf,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,Lt.bind(void 0,1),Lt.bind(void 0,2),Lt.bind(void 0,3),Lt.bind(void 0,4),Lt.bind(void 0,5),Lt.bind(void 0,6),Lt.bind(void 0,7),Lt.bind(void 0,8),At.bind(void 0,1),At.bind(void 0,2),At.bind(void 0,3),At.bind(void 0,4),At.bind(void 0,5),At.bind(void 0,6),At.bind(void 0,7),At.bind(void 0,8),N.bind(void 0,0,0,0,0,0),N.bind(void 0,0,0,0,0,1),N.bind(void 0,0,0,0,0,2),N.bind(void 0,0,0,0,0,3),N.bind(void 0,0,0,0,1,0),N.bind(void 0,0,0,0,1,1),N.bind(void 0,0,0,0,1,2),N.bind(void 0,0,0,0,1,3),N.bind(void 0,0,0,1,0,0),N.bind(void 0,0,0,1,0,1),N.bind(void 0,0,0,1,0,2),N.bind(void 0,0,0,1,0,3),N.bind(void 0,0,0,1,1,0),N.bind(void 0,0,0,1,1,1),N.bind(void 0,0,0,1,1,2),N.bind(void 0,0,0,1,1,3),N.bind(void 0,0,1,0,0,0),N.bind(void 0,0,1,0,0,1),N.bind(void 0,0,1,0,0,2),N.bind(void 0,0,1,0,0,3),N.bind(void 0,0,1,0,1,0),N.bind(void 0,0,1,0,1,1),N.bind(void 0,0,1,0,1,2),N.bind(void 0,0,1,0,1,3),N.bind(void 0,0,1,1,0,0),N.bind(void 0,0,1,1,0,1),N.bind(void 0,0,1,1,0,2),N.bind(void 0,0,1,1,0,3),N.bind(void 0,0,1,1,1,0),N.bind(void 0,0,1,1,1,1),N.bind(void 0,0,1,1,1,2),N.bind(void 0,0,1,1,1,3),N.bind(void 0,1,0,0,0,0),N.bind(void 0,1,0,0,0,1),N.bind(void 0,1,0,0,0,2),N.bind(void 0,1,0,0,0,3),N.bind(void 0,1,0,0,1,0),N.bind(void 0,1,0,0,1,1),N.bind(void 0,1,0,0,1,2),N.bind(void 0,1,0,0,1,3),N.bind(void 0,1,0,1,0,0),N.bind(void 0,1,0,1,0,1),N.bind(void 0,1,0,1,0,2),N.bind(void 0,1,0,1,0,3),N.bind(void 0,1,0,1,1,0),N.bind(void 0,1,0,1,1,1),N.bind(void 0,1,0,1,1,2),N.bind(void 0,1,0,1,1,3),N.bind(void 0,1,1,0,0,0),N.bind(void 0,1,1,0,0,1),N.bind(void 0,1,1,0,0,2),N.bind(void 0,1,1,0,0,3),N.bind(void 0,1,1,0,1,0),N.bind(void 0,1,1,0,1,1),N.bind(void 0,1,1,0,1,2),N.bind(void 0,1,1,0,1,3),N.bind(void 0,1,1,1,0,0),N.bind(void 0,1,1,1,0,1),N.bind(void 0,1,1,1,0,2),N.bind(void 0,1,1,1,0,3),N.bind(void 0,1,1,1,1,0),N.bind(void 0,1,1,1,1,1),N.bind(void 0,1,1,1,1,2),N.bind(void 0,1,1,1,1,3)];var rf=jo;function dn(e){this.char=e,this.state={},this.activeState=null}function Js(e,t,n){this.contextName=n,this.startIndex=e,this.endOffset=t}function of(e,t,n){this.contextName=e,this.openRange=null,this.ranges=[],this.checkStart=t,this.checkEnd=n}function Re(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 hs(e){this.eventId=e,this.subscribers=[]}function af(e){let t=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];for(let s=0;s<t.length;s++){let r=t[s];Object.defineProperty(this.events,r,{value:new hs(r)})}if(e)for(let s=0;s<t.length;s++){let r=t[s],o=e[r];typeof o=="function"&&this.events[r].subscribe(o)}let n=["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"];for(let s=0;s<n.length;s++){let r=n[s];this.events[r].subscribe(this.updateContextsRanges)}}function he(e){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],af.call(this,e)}dn.prototype.setState=function(e,t){return this.state[e]=t,this.activeState={key:e,value:this.state[e]},this.activeState},dn.prototype.getState=function(e){return this.state[e]||null},he.prototype.inboundIndex=function(e){return e>=0&&e<this.tokens.length},he.prototype.composeRUD=function(e){let n=e.map(r=>this[r[0]].apply(this,r.slice(1).concat(!0))),s=r=>typeof r=="object"&&Object.prototype.hasOwnProperty.call(r,"FAIL");if(n.every(s))return{FAIL:"composeRUD: one or more operations hasn't completed successfully",report:n.filter(s)};this.dispatch("composeRUD",[n.filter(r=>!s(r))])},he.prototype.replaceRange=function(e,t,n,s){t=t!==null?t:this.tokens.length;let r=n.every(o=>o instanceof dn);if(!isNaN(e)&&this.inboundIndex(e)&&r){let o=this.tokens.splice.apply(this.tokens,[e,t].concat(n));return s||this.dispatch("replaceToken",[e,t,n]),[o,n]}else return{FAIL:"replaceRange: invalid tokens or startIndex."}},he.prototype.replaceToken=function(e,t,n){if(!isNaN(e)&&this.inboundIndex(e)&&t instanceof dn){let s=this.tokens.splice(e,1,t);return n||this.dispatch("replaceToken",[e,t]),[s[0],t]}else return{FAIL:"replaceToken: invalid token or index."}},he.prototype.removeRange=function(e,t,n){t=isNaN(t)?this.tokens.length:t;let s=this.tokens.splice(e,t);return n||this.dispatch("removeRange",[s,e,t]),s},he.prototype.removeToken=function(e,t){if(!isNaN(e)&&this.inboundIndex(e)){let n=this.tokens.splice(e,1);return t||this.dispatch("removeToken",[n,e]),n}else return{FAIL:"removeToken: invalid token index."}},he.prototype.insertToken=function(e,t,n){return e.every(r=>r instanceof dn)?(this.tokens.splice.apply(this.tokens,[t,0].concat(e)),n||this.dispatch("insertToken",[e,t]),e):{FAIL:"insertToken: invalid token(s)."}},he.prototype.registerModifier=function(e,t,n){this.events.newToken.subscribe(function(s,r){let o=[s,r],i=t===null||t.apply(this,o)===!0,a=[s,r];if(i){let l=n.apply(this,a);s.setState(e,l)}}),this.registeredModifiers.push(e)},hs.prototype.subscribe=function(e){return typeof e=="function"?this.subscribers.push(e)-1:{FAIL:`invalid '${this.eventId}' event handler`}},hs.prototype.unsubscribe=function(e){this.subscribers.splice(e,1)},Re.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)},Re.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}},he.prototype.rangeToText=function(e){if(e instanceof Js)return this.getRangeTokens(e).map(t=>t.char).join("")},he.prototype.getText=function(){return this.tokens.map(e=>e.char).join("")},he.prototype.getContext=function(e){let t=this.registeredContexts[e];return t||null},he.prototype.on=function(e,t){let n=this.events[e];return n?n.subscribe(t):null},he.prototype.dispatch=function(e,t){let n=this.events[e];if(n instanceof hs)for(let s=0;s<n.subscribers.length;s++)n.subscribers[s].apply(this,t||[])},he.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."};let s=new of(e,t,n);return this.registeredContexts[e]=s,this.contextCheckers.push(s),s},he.prototype.getRangeTokens=function(e){let t=e.startIndex+e.endOffset;return[].concat(this.tokens.slice(e.startIndex,t))},he.prototype.getContextRanges=function(e){let t=this.getContext(e);return t?t.ranges:{FAIL:`context checker '${e}' is not registered.`}},he.prototype.resetContextsRanges=function(){let e=this.registeredContexts;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];n.ranges=[]}},he.prototype.updateContextsRanges=function(){this.resetContextsRanges();let e=this.tokens.map(t=>t.char);for(let t=0;t<e.length;t++){let n=new Re(e,t);this.runContextCheck(n)}this.dispatch("updateContextsRanges",[this.registeredContexts])},he.prototype.setEndOffset=function(e,t){let n=this.getContext(t).openRange.startIndex,s=new Js(n,e,t),r=this.getContext(t).ranges;return s.rangeId=`${t}.${r.length}`,r.push(s),this.getContext(t).openRange=null,s},he.prototype.runContextCheck=function(e){let t=e.index;for(let n=0;n<this.contextCheckers.length;n++){let s=this.contextCheckers[n],r=s.contextName,o=this.getContext(r).openRange;if(!o&&s.checkStart(e)&&(o=new Js(t,null,r),this.getContext(r).openRange=o,this.dispatch("contextStart",[r,t])),o&&s.checkEnd(e)){let i=t-o.startIndex+1,a=this.setEndOffset(i,r);this.dispatch("contextEnd",[r,a])}}},he.prototype.tokenize=function(e){this.tokens=[],this.resetContextsRanges();let t=Array.from(e);this.dispatch("start");for(let n=0;n<t.length;n++){let s=t[n],r=new Re(t,n);this.dispatch("next",[r]),this.runContextCheck(r);let o=new dn(s);this.tokens.push(o),this.dispatch("newToken",[o,r])}return this.dispatch("end",[this.tokens]),this.tokens};var lf=he;function Rt(e){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(e)}function ui(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 Dt(e){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(e)}function ds(e){return/[\u0E00-\u0E7F]/.test(e)}function gs(e){return/[A-z]/.test(e)}function uf(e){return/\s/.test(e)}function He(e){this.font=e,this.features={}}function Ft(e){this.id=e.id,this.tag=e.tag,this.substitution=e.substitution}function Ut(e,t){if(!e)return-1;switch(t.format){case 1:return t.glyphs.indexOf(e);case 2:{let n=t.ranges;for(let s=0;s<n.length;s++){let r=n[s];if(e>=r.start&&e<=r.end){let o=e-r.start;return r.index+o}}break}default:return-1}return-1}function cf(e,t){return Ut(e,t.coverage)===-1?null:e+t.deltaGlyphId}function ff(e,t){let n=Ut(e,t.coverage);return n===-1?null:t.substitute[n]}function er(e,t){let n=[];for(let s=0;s<e.length;s++){let r=e[s],o=t.current;o=Array.isArray(o)?o[0]:o;let i=Ut(o,r);i!==-1&&n.push(i)}return n.length!==e.length?-1:n}function pf(e,t){let n=t.inputCoverage.length+t.lookaheadCoverage.length+t.backtrackCoverage.length;if(e.context.length<n)return[];let s=er(t.inputCoverage,e);if(s===-1)return[];let r=t.inputCoverage.length-1;if(e.lookahead.length<t.lookaheadCoverage.length)return[];let o=e.lookahead.slice(r);for(;o.length&&Dt(o[0].char);)o.shift();let i=new Re(o,0),a=er(t.lookaheadCoverage,i),l=[].concat(e.backtrack);for(l.reverse();l.length&&Dt(l[0].char);)l.shift();if(l.length<t.backtrackCoverage.length)return[];let c=new Re(l,0),u=er(t.backtrackCoverage,c),m=s.length===t.inputCoverage.length&&a.length===t.lookaheadCoverage.length&&u.length===t.backtrackCoverage.length,d=[];if(m)for(let x=0;x<t.lookupRecords.length;x++){let v=t.lookupRecords[x],S=v.lookupListIndex,I=this.getLookupByIndex(S);for(let _=0;_<I.subtables.length;_++){let P=I.subtables[_],z,Y=this.getSubstitutionType(I,P);if(Y==="71"?(Y=this.getSubstitutionType(P,P.extension),z=this.getLookupMethod(P,P.extension),P=P.extension):z=this.getLookupMethod(I,P),Y==="12"){let re=e.get(v.sequenceIndex),ie=z(re);ie&&d.push(ie)}else if(Y==="21"){let re=e.get(v.sequenceIndex),ie=z(re);ie&&d.push(ie)}else throw new Error(`Substitution type ${Y} is not supported in chaining substitution`)}}return d}function hf(e,t){let n=e.current,s=Ut(n,t.coverage);if(s===-1)return null;let r,o=t.ligatureSets[s];for(let i=0;i<o.length;i++){r=o[i];for(let a=0;a<r.components.length;a++){let l=e.lookahead[a],c=r.components[a];if(l!==c)break;if(a===r.components.length-1)return r}}return null}function df(e,t){let n=e.current;if(Ut(n,t.coverage)===-1)return null;for(let r of t.ruleSets)for(let o of r){let i=!0;for(let a=0;a<o.input.length;a++)if(e.lookahead[a]!==o.input[a]){i=!1;break}if(i){let a=[];a.push(n);for(let c=0;c<o.input.length;c++)a.push(o.input[c]);let l=(c,u)=>{let{lookupListIndex:m,sequenceIndex:d}=u,{subtables:x}=this.getLookupByIndex(m);for(let v of x)Ut(c[d],v.coverage)!==-1&&(c[d]=v.deltaGlyphId)};for(let c=0;c<o.lookupRecords.length;c++){let u=o.lookupRecords[c];l(a,u)}return a}}return null}function gf(e,t){if(e.context.length<t.coverages.length)return[];for(let s=0;s<t.coverages.length;s++){let r=e.get(s);if(r=Array.isArray(r)?r[0]:r,Ut(r,t.coverages[s])===-1)return[]}let n=[];for(let s=0;s<t.lookupRecords.length;s++){let r=t.lookupRecords[s],o=r.lookupListIndex,i=this.getLookupByIndex(o);for(let a=0;a<i.subtables.length;a++){let l=i.subtables[a],c,u=this.getSubstitutionType(i,l);if(u==="71"?(u=this.getSubstitutionType(l,l.extension),c=this.getLookupMethod(l,l.extension),l=l.extension):c=this.getLookupMethod(i,l),u==="12"){let m=e.get(r.sequenceIndex),d=c(m);d&&n.push(d)}else if(u==="21"){let m=e.get(r.sequenceIndex),d=c(m);d&&n.push(d)}}}return n}function mf(e,t){let n=Ut(e,t.coverage);return n===-1?null:t.sequences[n]}He.prototype.getDefaultScriptFeaturesIndexes=function(){let e=this.font.tables.gsub.scripts;for(let t=0;t<e.length;t++){let n=e[t];if(n.tag==="DFLT")return n.script.defaultLangSys.featureIndexes}return[]},He.prototype.getScriptFeaturesIndexes=function(e){if(!this.font.tables.gsub)return[];if(!e)return this.getDefaultScriptFeaturesIndexes();let n=this.font.tables.gsub.scripts;for(let s=0;s<n.length;s++){let r=n[s];if(r.tag===e&&r.script.defaultLangSys)return r.script.defaultLangSys.featureIndexes;{let o=r.langSysRecords;if(o)for(let i=0;i<o.length;i++){let a=o[i];if(a.tag===e)return a.langSys.featureIndexes}}}return this.getDefaultScriptFeaturesIndexes()},He.prototype.mapTagsToFeatures=function(e,t){let n={};for(let s=0;s<e.length;s++){let r=e[s].tag,o=e[s].feature;n[r]=o}this.features[t].tags=n},He.prototype.getScriptFeatures=function(e){let t=this.features[e];if(Object.prototype.hasOwnProperty.call(this.features,e))return t;let n=this.getScriptFeaturesIndexes(e);if(!n)return null;let s=this.font.tables.gsub;return t=n.map(r=>s.features[r]),this.features[e]=t,this.mapTagsToFeatures(t,e),t},He.prototype.getSubstitutionType=function(e,t){let n=e.lookupType.toString(),s=t.substFormat.toString();return n+s},He.prototype.getLookupMethod=function(e,t){let n=this.getSubstitutionType(e,t);switch(n){case"11":return s=>cf.apply(this,[s,t]);case"12":return s=>ff.apply(this,[s,t]);case"63":return s=>pf.apply(this,[s,t]);case"41":return s=>hf.apply(this,[s,t]);case"21":return s=>mf.apply(this,[s,t]);case"51":return s=>df.apply(this,[s,t]);case"53":return s=>gf.apply(this,[s,t]);default:throw new Error(`substitutionType : ${n} lookupType: ${e.lookupType} - substFormat: ${t.substFormat} is not yet supported`)}},He.prototype.lookupFeature=function(e){let t=e.contextParams,n=t.index,s=this.getFeature({tag:e.tag,script:e.script});if(!s)return new Error(`font '${(this.font.names.unicode||this.font.names.windows||this.font.names.macintosh).fullName.en}' doesn't support feature '${e.tag}' for script '${e.script}'.`);let r=this.getFeatureLookups(s),o=[].concat(t.context);for(let i=0;i<r.length;i++){let a=r[i],l=this.getLookupSubtables(a);for(let c=0;c<l.length;c++){let u=l[c],m=this.getSubstitutionType(a,u),d;m==="71"?(m=this.getSubstitutionType(u,u.extension),d=this.getLookupMethod(u,u.extension),u=u.extension):d=this.getLookupMethod(a,u);let x;switch(m){case"11":x=d(t.current),x&&o.splice(n,1,new Ft({id:11,tag:e.tag,substitution:x}));break;case"12":x=d(t.current),x&&o.splice(n,1,new Ft({id:12,tag:e.tag,substitution:x}));break;case"63":x=d(t),Array.isArray(x)&&x.length&&o.splice(n,1,new Ft({id:63,tag:e.tag,substitution:x}));break;case"41":x=d(t),x&&o.splice(n,1,new Ft({id:41,tag:e.tag,substitution:x}));break;case"21":x=d(t.current),x&&o.splice(n,1,new Ft({id:21,tag:e.tag,substitution:x}));break;case"51":case"53":x=d(t),Array.isArray(x)&&x.length&&o.splice(n,1,new Ft({id:parseInt(m),tag:e.tag,substitution:x}));break}t=new Re(o,n),!(Array.isArray(x)&&!x.length)&&(x=null)}}return o.length?o:null},He.prototype.supports=function(e){if(!e.script)return!1;this.getScriptFeatures(e.script);let t=Object.prototype.hasOwnProperty.call(this.features,e.script);if(!e.tag)return t;let n=this.features[e.script].some(s=>s.tag===e.tag);return t&&n},He.prototype.getLookupSubtables=function(e){return e.subtables||null},He.prototype.getLookupByIndex=function(e){return this.font.tables.gsub.lookups[e]||null},He.prototype.getFeatureLookups=function(e){return e.lookupListIndexes.map(this.getLookupByIndex.bind(this))},He.prototype.getFeature=function(t){if(!this.font)return{FAIL:"No font was found"};Object.prototype.hasOwnProperty.call(this.features,t.script)||this.getScriptFeatures(t.script);let n=this.features[t.script];return n?n.tags[t.tag]?this.features[t.script].tags[t.tag]:null:{FAIL:`No feature for script ${t.script}`}};var yf=He;function bf(e){let t=e.current,n=e.get(-1);return n===null&&Rt(t)||!Rt(n)&&Rt(t)}function vf(e){let t=e.get(1);return t===null||!Rt(t)}var xf={startCheck:bf,endCheck:vf};function Sf(e){let t=e.current,n=e.get(-1);return(Rt(t)||Dt(t))&&!Rt(n)}function kf(e){let t=e.get(1);switch(!0){case t===null:return!0;case(!Rt(t)&&!Dt(t)):{let n=uf(t);if(!n)return!0;if(n){let s=!1;if(s=e.lookahead.some(r=>Rt(r)||Dt(r)),!s)return!0}break}default:return!1}}var Tf={startCheck:Sf,endCheck:kf};function Cf(e,t,n){t[n].setState(e.tag,e.substitution)}function Of(e,t,n){t[n].setState(e.tag,e.substitution)}function tr(e,t,n){for(let s=0;s<e.substitution.length;s++){let r=e.substitution[s],o=t[n+s];if(Array.isArray(r)){r.length?o.setState(e.tag,r[0]):o.setState("deleted",!0);continue}o.setState(e.tag,r)}}function If(e,t,n){let s=t[n];s.setState(e.tag,e.substitution.ligGlyph);let r=e.substitution.components.length;for(let o=0;o<r;o++)s=t[n+o+1],s.setState("deleted",!0)}var ci={11:Cf,12:Of,63:tr,41:If,51:tr,53:tr};function wf(e,t,n){e instanceof Ft&&ci[e.id]&&ci[e.id](e,t,n)}var Zt=wf;function Ef(e){let t=[].concat(e.backtrack);for(let n=t.length-1;n>=0;n--){let s=t[n],r=ui(s),o=Dt(s);if(!r&&!o)return!0;if(r)return!1}return!1}function Lf(e){if(ui(e.current))return!1;for(let t=0;t<e.lookahead.length;t++){let n=e.lookahead[t];if(!Dt(n))return!0}return!1}function Af(e){let t="arab",n=this.featuresTags[t],s=this.tokenizer.getRangeTokens(e);if(s.length===1)return;let r=new Re(s.map(i=>i.getState("glyphIndex")),0),o=new Re(s.map(i=>i.char),0);for(let i=0;i<s.length;i++){let a=s[i];if(Dt(a.char))continue;r.setCurrentIndex(i),o.setCurrentIndex(i);let l=0;Ef(o)&&(l|=1),Lf(o)&&(l|=2);let c;switch(l){case 1:c="fina";break;case 2:c="init";break;case 3:c="medi";break}if(n.indexOf(c)===-1)continue;let u=this.query.lookupFeature({tag:c,script:t,contextParams:r});if(u instanceof Error){console.info(u.message);continue}for(let m=0;m<u.length;m++){let d=u[m];d instanceof Ft&&(Zt(d,s,m),r.context[m]=d.substitution)}}}var Rf=Af;function fi(e,t){let n=e.map(s=>s.activeState.value);return new Re(n,t||0)}function Df(e){let t="arab",n=this.tokenizer.getRangeTokens(e),s=fi(n);for(let r=0;r<s.context.length;r++){s.setCurrentIndex(r);let o=this.query.lookupFeature({tag:"rlig",script:t,contextParams:s});if(o.length){for(let i=0;i<o.length;i++){let a=o[i];Zt(a,n,r)}s=fi(n)}}}var Ff=Df;function Uf(e){return e.index===0&&e.context.length>1}function Mf(e){return e.index===e.context.length-1}var Pf={startCheck:Uf,endCheck:Mf};function pi(e,t){let n=e.map(s=>s.activeState.value);return new Re(n,t||0)}function Nf(e){let t="delf",n="ccmp",s=this.tokenizer.getRangeTokens(e),r=pi(s);for(let o=0;o<r.context.length;o++){if(!this.query.getFeature({tag:n,script:t,contextParams:r}))continue;r.setCurrentIndex(o);let i=this.query.lookupFeature({tag:n,script:t,contextParams:r});if(i.length){for(let a=0;a<i.length;a++){let l=i[a];Zt(l,s,o)}r=pi(s)}}}var Bf=Nf;function _f(e){let t=e.current,n=e.get(-1);return n===null&&gs(t)||!gs(n)&&gs(t)}function Gf(e){let t=e.get(1);return t===null||!gs(t)}var Hf={startCheck:_f,endCheck:Gf};function hi(e,t){let n=e.map(s=>s.activeState.value);return new Re(n,t||0)}function Vf(e){let t="latn",n=this.tokenizer.getRangeTokens(e),s=hi(n);for(let r=0;r<s.context.length;r++){s.setCurrentIndex(r);let o=this.query.lookupFeature({tag:"liga",script:t,contextParams:s});if(o.length){for(let i=0;i<o.length;i++){let a=o[i];Zt(a,n,r)}s=hi(n)}}}var zf=Vf;function jf(e){let t=e.current,n=e.get(-1);return n===null&&ds(t)||!ds(n)&&ds(t)}function Wf(e){let t=e.get(1);return t===null||!ds(t)}var qf={startCheck:jf,endCheck:Wf};function di(e,t){let n=e.map(s=>s.activeState.value);return new Re(n,t||0)}function $f(e){let t="thai",n=this.tokenizer.getRangeTokens(e),s=di(n,0);for(let r=0;r<s.context.length;r++){s.setCurrentIndex(r);let o=this.query.lookupFeature({tag:"ccmp",script:t,contextParams:s});if(o.length){for(let i=0;i<o.length;i++){let a=o[i];Zt(a,n,r)}s=di(n,r)}}}var Xf=$f;function gi(e,t){let n=e.map(s=>s.activeState.value);return new Re(n,t||0)}function Yf(e){let t="thai",n=this.tokenizer.getRangeTokens(e),s=gi(n,0);for(let r=0;r<s.context.length;r++){s.setCurrentIndex(r);let o=this.query.lookupFeature({tag:"liga",script:t,contextParams:s});if(o.length){for(let i=0;i<o.length;i++){let a=o[i];Zt(a,n,r)}s=gi(n,r)}}}var Zf=Yf;function mi(e,t){let n=e.map(s=>s.activeState.value);return new Re(n,t||0)}function Kf(e){let t="thai",n=this.tokenizer.getRangeTokens(e),s=mi(n,0);for(let r=0;r<s.context.length;r++){s.setCurrentIndex(r);let o=this.query.lookupFeature({tag:"rlig",script:t,contextParams:s});if(o.length){for(let i=0;i<o.length;i++){let a=o[i];Zt(a,n,r)}s=mi(n,r)}}}var Qf=Kf;function nr(e){if(e===null)return!1;let t=e.codePointAt(0);return t>=6155&&t<=6157||t>=65024&&t<=65039||t>=917760&&t<=917999}function Jf(e){let t=e.current,n=e.get(1);return n===null&&nr(t)||nr(n)}function ep(e){let t=e.get(1);return t===null||!nr(t)}var tp={startCheck:Jf,endCheck:ep};function np(e){let t=this.query.font,n=this.tokenizer.getRangeTokens(e);if(n[1].setState("deleted",!0),t.tables.cmap&&t.tables.cmap.varSelectorList){let s=n[0].char.codePointAt(0),r=n[1].char.codePointAt(0),o=t.tables.cmap.varSelectorList[r];if(o!==void 0&&o.nonDefaultUVS){let i=o.nonDefaultUVS.uvsMappings;if(i[s]){let a=i[s].glyphID;t.glyphs.glyphs[a]!==void 0&&n[0].setState("glyphIndex",a)}}}}var sp=np;function Ze(e){this.baseDir=e||"ltr",this.tokenizer=new lf,this.featuresTags={}}Ze.prototype.setText=function(e){this.text=e},Ze.prototype.contextChecks={ccmpReplacementCheck:Pf,latinWordCheck:Hf,arabicWordCheck:xf,arabicSentenceCheck:Tf,thaiWordCheck:qf,unicodeVariationSequenceCheck:tp};function gn(e){let t=this.contextChecks[`${e}Check`];return this.tokenizer.registerContextChecker(e,t.startCheck,t.endCheck)}function rp(){return gn.call(this,"ccmpReplacement"),gn.call(this,"latinWord"),gn.call(this,"arabicWord"),gn.call(this,"arabicSentence"),gn.call(this,"thaiWord"),gn.call(this,"unicodeVariationSequence"),this.tokenizer.tokenize(this.text)}function op(){let e=this.tokenizer.getContextRanges("arabicSentence");for(let t=0;t<e.length;t++){let n=e[t],s=this.tokenizer.getRangeTokens(n);this.tokenizer.replaceRange(n.startIndex,n.endOffset,s.reverse())}}Ze.prototype.registerFeatures=function(e,t){let n=t.filter(s=>this.query.supports({script:e,tag:s}));Object.prototype.hasOwnProperty.call(this.featuresTags,e)?this.featuresTags[e]=this.featuresTags[e].concat(n):this.featuresTags[e]=n},Ze.prototype.applyFeatures=function(e,t){if(!e)throw new Error("No valid font was provided to apply features");this.query||(this.query=new yf(e));for(let n=0;n<t.length;n++){let s=t[n];this.query.supports({script:s.script})&&this.registerFeatures(s.script,s.tags)}},Ze.prototype.registerModifier=function(e,t,n){this.tokenizer.registerModifier(e,t,n)};function Un(){if(this.tokenizer.registeredModifiers.indexOf("glyphIndex")===-1)throw new Error("glyphIndex modifier is required to apply arabic presentation features.")}function ip(){if(!Object.prototype.hasOwnProperty.call(this.featuresTags,"arab"))return;Un.call(this);let t=this.tokenizer.getContextRanges("arabicWord");for(let n=0;n<t.length;n++){let s=t[n];Rf.call(this,s)}}function ap(){Un.call(this);let e=this.tokenizer.getContextRanges("ccmpReplacement");for(let t=0;t<e.length;t++){let n=e[t];Bf.call(this,n)}}function lp(){if(!this.hasFeatureEnabled("arab","rlig"))return;Un.call(this);let e=this.tokenizer.getContextRanges("arabicWord");for(let t=0;t<e.length;t++){let n=e[t];Ff.call(this,n)}}function up(){if(!this.hasFeatureEnabled("latn","liga"))return;Un.call(this);let e=this.tokenizer.getContextRanges("latinWord");for(let t=0;t<e.length;t++){let n=e[t];zf.call(this,n)}}function cp(){let e=this.tokenizer.getContextRanges("unicodeVariationSequence");for(let t=0;t<e.length;t++){let n=e[t];sp.call(this,n)}}function fp(){Un.call(this);let e=this.tokenizer.getContextRanges("thaiWord");for(let t=0;t<e.length;t++){let n=e[t];this.hasFeatureEnabled("thai","liga")&&Zf.call(this,n),this.hasFeatureEnabled("thai","rlig")&&Qf.call(this,n),this.hasFeatureEnabled("thai","ccmp")&&Xf.call(this,n)}}Ze.prototype.checkContextReady=function(e){return!!this.tokenizer.getContext(e)},Ze.prototype.applyFeaturesToContexts=function(){this.checkContextReady("ccmpReplacement")&&ap.call(this),this.checkContextReady("arabicWord")&&(ip.call(this),lp.call(this)),this.checkContextReady("latinWord")&&up.call(this),this.checkContextReady("arabicSentence")&&op.call(this),this.checkContextReady("thaiWord")&&fp.call(this),this.checkContextReady("unicodeVariationSequence")&&cp.call(this)},Ze.prototype.hasFeatureEnabled=function(e,t){return(this.featuresTags[e]||[]).indexOf(t)!==-1},Ze.prototype.processText=function(e){(!this.text||this.text!==e)&&(this.setText(e),rp.call(this),this.applyFeaturesToContexts())},Ze.prototype.getBidiText=function(e){return this.processText(e),this.tokenizer.getText()},Ze.prototype.getTextGlyphs=function(e){this.processText(e);let t=[];for(let n=0;n<this.tokenizer.tokens.length;n++){let s=this.tokenizer.tokens[n];if(s.state.deleted)continue;let r=s.activeState.value;t.push(Array.isArray(r)?r[0]:r)}return t};var pp=Ze;function sr(e){return{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||" "}}}function oe(e){if(e=e||{},e.tables=e.tables||{},!e.empty){if(!e.familyName)throw new Error("When creating a new Font object, familyName is required.");if(!e.styleName)throw new Error("When creating a new Font object, styleName is required.");if(!e.unitsPerEm)throw new Error("When creating a new Font object, unitsPerEm is required.");if(!e.ascender)throw new Error("When creating a new Font object, ascender is required.");if(e.descender>0)throw new Error("When creating a new Font object, negative descender value is required.");this.names={},this.names.unicode=sr(e),this.names.macintosh=sr(e),this.names.windows=sr(e),this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.italicAngle=e.italicAngle||0,this.weightClass=e.weightClass||0;let t=0;e.fsSelection?t=e.fsSelection:(this.italicAngle<0?t|=this.fsSelectionValues.ITALIC:this.italicAngle>0&&(t|=this.fsSelectionValues.OBLIQUE),this.weightClass>=600&&(t|=this.fsSelectionValues.BOLD),t===0&&(t=this.fsSelectionValues.REGULAR)),(!e.panose||!Array.isArray(e.panose))&&(e.panose=[0,0,0,0,0,0,0,0,0]),this.tables=Object.assign(e.tables,{os2:Object.assign({usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,bFamilyType:e.panose[0]||0,bSerifStyle:e.panose[1]||0,bWeight:e.panose[2]||0,bProportion:e.panose[3]||0,bContrast:e.panose[4]||0,bStrokeVariation:e.panose[5]||0,bArmStyle:e.panose[6]||0,bLetterform:e.panose[7]||0,bMidline:e.panose[8]||0,bXHeight:e.panose[9]||0,fsSelection:t},e.tables.os2)})}this.supported=!0,this.glyphs=new mt.GlyphSet(this,e.glyphs||[]),this.encoding=new qr(this),this.position=new iu(this),this.substitution=new hu(this),this.tables=this.tables||{},this.tables=new Proxy(this.tables,{set:(t,n,s)=>(t[n]=s,t.fvar&&(t.gvar||t.cff2)&&!this.variation&&(this.variation=new Eu(this)),!0)}),this.palettes=new Po(this),this.layers=new du(this),this.svgImages=new gu(this),this._push=null,this._hmtxTableData={},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:this.outlinesFormat==="truetype"?this._hinting=new rf(this):null}})}oe.prototype.hasChar=function(e){return this.encoding.charToGlyphIndex(e)>0},oe.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},oe.prototype.charToGlyph=function(e){let t=this.charToGlyphIndex(e),n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},oe.prototype.updateFeatures=function(e){return this.defaultRenderOptions.features.map(t=>t.script==="latn"?{script:"latn",tags:t.tags.filter(n=>e[n])}:t)},oe.prototype.stringToGlyphIndexes=function(e,t){let n=new pp,s=o=>this.charToGlyphIndex(o.char);n.registerModifier("glyphIndex",null,s);let r=t?this.updateFeatures(t.features):this.defaultRenderOptions.features;return n.applyFeatures(this,r),n.getTextGlyphs(e)},oe.prototype.stringToGlyphs=function(e,t){let n=this.stringToGlyphIndexes(e,t),s=n.length,r=new Array(s),o=this.glyphs.get(0);for(let i=0;i<s;i+=1)r[i]=this.glyphs.get(n[i])||o;return r},oe.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)},oe.prototype.nameToGlyph=function(e){let t=this.nameToGlyphIndex(e),n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},oe.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):""},oe.prototype.getKerningValue=function(e,t){e=e.index||e,t=t.index||t;let n=this.position.defaultKerningTables;return n?this.position.getKerningValue(n,e,t):this.kerningPairs[e+","+t]||0},oe.prototype.defaultRenderOptions={kerning:!0,features:[{script:"arab",tags:["init","medi","fina","rlig"]},{script:"latn",tags:["liga","rlig"]},{script:"thai",tags:["liga","rlig","ccmp"]}],hinting:!1,usePalette:0,drawLayers:!0,drawSVG:!0},oe.prototype.forEachGlyph=function(e,t,n,s,r,o){t=t!==void 0?t:0,n=n!==void 0?n:0,s=s!==void 0?s:72,r=Object.assign({},this.defaultRenderOptions,r);let i=1/this.unitsPerEm*s,a=this.stringToGlyphs(e,r),l;if(r.kerning){let c=r.script||this.position.getDefaultScriptName();l=this.position.getKerningTables(c,r.language)}for(let c=0;c<a.length;c+=1){let u=a[c];if(o.call(this,u,t,n,s,r),u.advanceWidth&&(t+=u.advanceWidth*i),r.kerning&&c<a.length-1){let m=l?this.position.getKerningValue(l,u.index,a[c+1].index):this.getKerningValue(u,a[c+1]);t+=m*i}r.letterSpacing?t+=r.letterSpacing*s:r.tracking&&(t+=r.tracking/1e3*s)}return t},oe.prototype.getPath=function(e,t,n,s,r){r=Object.assign({},this.defaultRenderOptions,r);let o=new Wt;if(o._layers=[],ro(this,o,s),o.stroke){let i=1/(o.unitsPerEm||1e3)*s;o.strokeWidth*=i}return this.forEachGlyph(e,t,n,s,r,(i,a,l,c)=>{let u=i.getPath(a,l,c,r,this);if(r.drawSVG||r.drawLayers){let m=u._layers;if(m&&m.length){for(let d=0;d<m.length;d++){let x=m[d];o._layers.push(x)}return}}o.extend(u)}),o},oe.prototype.getPaths=function(e,t,n,s,r){r=Object.assign({},this.defaultRenderOptions,r);let o=[];return this.forEachGlyph(e,t,n,s,r,function(i,a,l,c){let u=i.getPath(a,l,c,r,this);o.push(u)}),o},oe.prototype.getAdvanceWidth=function(e,t,n){return n=Object.assign({},this.defaultRenderOptions,n),this.forEachGlyph(e,0,0,t,n,function(){})},oe.prototype.draw=function(e,t,n,s,r,o){this.getPath(t,n,s,r,o).draw(e)},oe.prototype.drawPoints=function(e,t,n,s,r,o){o=Object.assign({},this.defaultRenderOptions,o),this.forEachGlyph(t,n,s,r,o,function(i,a,l,c){i.drawPoints(e,a,l,c,o,this)})},oe.prototype.drawMetrics=function(e,t,n,s,r,o){o=Object.assign({},this.defaultRenderOptions,o),this.forEachGlyph(t,n,s,r,o,function(i,a,l,c){i.drawMetrics(e,a,l,c)})},oe.prototype.getEnglishName=function(e){let t=(this.names.unicode||this.names.macintosh||this.names.windows)[e];if(t)return t.en},oe.prototype.validate=function(){let e=[],t=this;function n(r,o){r||(console.warn(`[opentype.js] ${o}`),e.push(o))}function s(r){let o=t.getEnglishName(r);n(o&&o.trim().length>0,"No English "+r+" specified.")}if(s("fontFamily"),s("weightName"),s("manufacturer"),s("copyright"),s("version"),n(this.unitsPerEm>0,"No unitsPerEm specified."),this.tables.colr){let r=this.tables.colr.baseGlyphRecords,o=-1;for(let i=0;i<r.length;i++){let a=r[i].glyphID;if(n(o<r[i].glyphID,`baseGlyphs must be sorted by GlyphID in ascending order, but glyphID ${a} comes after ${o}`),o>r[i].glyphID)break;o=a}}return e},oe.prototype.toTables=function(){return ou.fontToTable(this)},oe.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},oe.prototype.toArrayBuffer=function(){let t=this.toTables().encode(),n=new ArrayBuffer(t.length),s=new Uint8Array(n);for(let r=0;r<t.length;r++)s[r]=t[r];return n},oe.prototype.download=function(){console.error("DEPRECATED: platform-specific actions are to be implemented on user-side")},oe.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},oe.prototype.macStyleValues={BOLD:1,ITALIC:2,UNDERLINE:4,OUTLINED:8,SHADOW:16,CONDENSED:32,EXTENDED:64},oe.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},oe.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};var yi=oe;function hp(e,t){let n=new F.Parser(e,t),s=n.parseUShort(),r=n.parseUShort();s!==1&&console.warn(`Unsupported hvar table version ${s}.${r}`);let o=[s,r],i=n.parsePointer32(function(){return this.parseItemVariationStore()}),a=n.parsePointer32(function(){return this.parseDeltaSetIndexMap()}),l=n.parsePointer32(function(){return this.parseDeltaSetIndexMap()}),c=n.parsePointer32(function(){return this.parseDeltaSetIndexMap()});return{version:o,itemVariationStore:i,advanceWidth:a,lsb:l,rsb:c}}function dp(){console.warn("Writing of hvar tables is not yet supported.")}var gp={make:dp,parse:hp},mp=function(){return{coverage:this.parsePointer(C.coverage),attachPoints:this.parseList(C.pointer(C.uShortList))}},yp=function(){var e=this.parseUShort();if(B.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()}},bp=function(){return this.parseList(C.pointer(yp))},vp=function(){return{coverage:this.parsePointer(C.coverage),ligGlyphs:this.parseList(C.pointer(bp))}},xp=function(){return this.parseUShort(),this.parseList(C.pointer(C.coverage))};function Sp(e,t){t=t||0;let n=new C(e,t),s=n.parseVersion(1);B.argument(s===1||s===1.2||s===1.3,"Unsupported GDEF table version.");var r={version:s,classDef:n.parsePointer(C.classDef),attachList:n.parsePointer(mp),ligCaretList:n.parsePointer(vp),markAttachClassDef:n.parsePointer(C.classDef)};return s>=1.2&&(r.markGlyphSets=n.parsePointer(xp)),r}var kp={parse:Sp},rt=new Array(10);rt[1]=function(){let t=this.offset+this.relativeOffset,n=this.parseUShort();if(n===1)return{posFormat:1,coverage:this.parsePointer(C.coverage),value:this.parseValueRecord()};if(n===2)return{posFormat:2,coverage:this.parsePointer(C.coverage),values:this.parseValueRecordList()};B.assert(!1,"0x"+t.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},rt[2]=function(){let t=this.offset+this.relativeOffset,n=this.parseUShort();B.assert(n===1||n===2,"0x"+t.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");let s=this.parsePointer(C.coverage),r=this.parseUShort(),o=this.parseUShort();if(n===1)return{posFormat:n,coverage:s,valueFormat1:r,valueFormat2:o,pairSets:this.parseList(C.pointer(C.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(r),value2:this.parseValueRecord(o)}})))};if(n===2){let i=this.parsePointer(C.classDef),a=this.parsePointer(C.classDef),l=this.parseUShort(),c=this.parseUShort();return{posFormat:n,coverage:s,valueFormat1:r,valueFormat2:o,classDef1:i,classDef2:a,class1Count:l,class2Count:c,classRecords:this.parseList(l,C.list(c,function(){return{value1:this.parseValueRecord(r),value2:this.parseValueRecord(o)}}))}}},rt[3]=function(){return{error:"GPOS Lookup 3 not supported"}},rt[4]=function(){return{error:"GPOS Lookup 4 not supported"}},rt[5]=function(){return{error:"GPOS Lookup 5 not supported"}},rt[6]=function(){return{error:"GPOS Lookup 6 not supported"}},rt[7]=function(){return{error:"GPOS Lookup 7 not supported"}},rt[8]=function(){return{error:"GPOS Lookup 8 not supported"}},rt[9]=function(){return{error:"GPOS Lookup 9 not supported"}};function Tp(e,t){t=t||0;let n=new C(e,t),s=n.parseVersion(1);return B.argument(s===1||s===1.1,"Unsupported GPOS table version "+s),s===1?{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(rt)}:{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(rt),variations:n.parseFeatureVariationsList()}}var Cp=new Array(10);function Op(e){return new A.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new A.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new A.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new A.LookupList(e.lookups,Cp)}])}var Ip={parse:Tp,make:Op};function wp(e){let t={};e.skip("uShort");let n=e.parseUShort();B.argument(n===0,"Unsupported kern sub-table version."),e.skip("uShort",2);let s=e.parseUShort();e.skip("uShort",3);for(let r=0;r<s;r+=1){let o=e.parseUShort(),i=e.parseUShort(),a=e.parseShort();t[o+","+i]=a}return t}function Ep(e){let t={};e.skip("uShort"),e.parseULong()>1&&console.warn("Only the first kern subtable is supported."),e.skip("uLong");let r=e.parseUShort()&255;if(e.skip("uShort"),r===0){let o=e.parseUShort();e.skip("uShort",3);for(let i=0;i<o;i+=1){let a=e.parseUShort(),l=e.parseUShort(),c=e.parseShort();t[a+","+l]=c}}return t}function Lp(e,t){let n=new F.Parser(e,t),s=n.parseUShort();if(s===0)return wp(n);if(s===1)return Ep(n);throw new Error("Unsupported kern table version ("+s+").")}var Ap={parse:Lp};function Rp(e,t,n,s){let r=new F.Parser(e,t),o=s?r.parseUShort:r.parseULong,i=[];for(let a=0;a<n+1;a+=1){let l=o.call(r);s&&(l*=2),i.push(l)}return i}var Dp={parse:Rp};function bi(e,t){let n=[],s=12;for(let r=0;r<t;r+=1){let o=F.getTag(e,s),i=F.getULong(e,s+4),a=F.getULong(e,s+8),l=F.getULong(e,s+12);n.push({tag:o,checksum:i,offset:a,length:l,compression:!1}),s+=16}return n}function Fp(e,t){let n=[],s=44;for(let r=0;r<t;r+=1){let o=F.getTag(e,s),i=F.getULong(e,s+4),a=F.getULong(e,s+8),l=F.getULong(e,s+12),c;a<l?c="WOFF":c=!1,n.push({tag:o,offset:i,compression:c,compressedLength:a,length:l}),s+=20}return n}function te(e,t){if(t.compression==="WOFF"){let n=new Uint8Array(e.buffer,t.offset+2,t.compressedLength-2),s=new Uint8Array(t.length);if(Er(n,s),s.byteLength!==t.length)throw new Error("Decompression error: "+t.tag+" decompressed length doesn't match recorded length");return{data:new DataView(s.buffer,0),offset:0}}else return{data:e,offset:t.offset}}function Up(e,t={}){let n,s,r=new yi({empty:!0});e.constructor!==ArrayBuffer&&(e=new Uint8Array(e).buffer);let o=new DataView(e,0),i,a=[],l=F.getTag(o,0);if(l==="\0\0\0"||l==="true"||l==="typ1")r.outlinesFormat="truetype",i=F.getUShort(o,4),a=bi(o,i);else if(l==="OTTO")r.outlinesFormat="cff",i=F.getUShort(o,4),a=bi(o,i);else if(l==="wOFF"){let G=F.getTag(o,4);if(G==="\0\0\0")r.outlinesFormat="truetype";else if(G==="OTTO")r.outlinesFormat="cff";else throw new Error("Unsupported OpenType flavor "+l);i=F.getUShort(o,12),a=Fp(o,i)}else if(l==="wOF2"){let G="https://github.com/opentypejs/opentype.js/issues/183#issuecomment-1147228025";throw new Error("WOFF2 require an external decompressor library, see examples at: "+G)}else throw new Error("Unsupported OpenType signature "+l);let c,u,m,d,x,v,S,I,_,P,z,Y,re,ie,ae,me,ot,Z;for(let G=0;G<i;G+=1){let U=a[G],M;switch(U.tag){case"avar":S=U;break;case"cmap":M=te(o,U),r.tables.cmap=Wr.parse(M.data,M.offset),r.encoding=new $r(r.tables.cmap);break;case"cvt ":M=te(o,U),Z=new F.Parser(M.data,M.offset),r.tables.cvt=Z.parseShortList(U.length/2);break;case"fvar":m=U;break;case"STAT":d=U;break;case"gvar":x=U;break;case"cvar":v=U;break;case"fpgm":M=te(o,U),Z=new F.Parser(M.data,M.offset),r.tables.fpgm=Z.parseByteList(U.length);break;case"head":M=te(o,U),r.tables.head=co.parse(M.data,M.offset),r.unitsPerEm=r.tables.head.unitsPerEm,n=r.tables.head.indexToLocFormat;break;case"hhea":M=te(o,U),r.tables.hhea=fo.parse(M.data,M.offset),r.ascender=r.tables.hhea.ascender,r.descender=r.tables.hhea.descender,r.numberOfHMetrics=r.tables.hhea.numberOfHMetrics;break;case"HVAR":re=U;break;case"hmtx":Y=U;break;case"ltag":M=te(o,U),s=ho.parse(M.data,M.offset);break;case"COLR":M=te(o,U),r.tables.colr=vo.parse(M.data,M.offset);break;case"CPAL":M=te(o,U),r.tables.cpal=Kr.parse(M.data,M.offset);break;case"maxp":M=te(o,U),r.tables.maxp=go.parse(M.data,M.offset),r.numGlyphs=r.tables.maxp.numGlyphs;break;case"name":me=U;break;case"OS/2":M=te(o,U),r.tables.os2=zs.parse(M.data,M.offset);break;case"post":M=te(o,U),r.tables.post=mo.parse(M.data,M.offset),r.glyphNames=new Us(r.tables.post);break;case"prep":M=te(o,U),Z=new F.Parser(M.data,M.offset),r.tables.prep=Z.parseByteList(U.length);break;case"glyf":I=U;break;case"loca":ae=U;break;case"CFF ":c=U;break;case"CFF2":u=U;break;case"kern":ie=U;break;case"GDEF":_=U;break;case"GPOS":P=U;break;case"GSUB":z=U;break;case"meta":ot=U;break;case"gasp":try{M=te(o,U),r.tables.gasp=Oo.parse(M.data,M.offset)}catch(Ee){console.warn("Failed to parse gasp table, skipping."),console.warn(Ee)}break;case"SVG ":M=te(o,U),r.tables.svg=Io.parse(M.data,M.offset);break;default:break}}let Ve=te(o,me);if(r.tables.name=jr.parse(Ve.data,Ve.offset,s),r.names=r.tables.name,I&&ae){let G=n===0,U=te(o,ae),M=Dp.parse(U.data,U.offset,r.numGlyphs,G),Ee=te(o,I);r.glyphs=Go.parse(Ee.data,Ee.offset,M,r,t)}else if(c){let G=te(o,c);Hs.parse(G.data,G.offset,r,t)}else if(u){let G=te(o,u);Hs.parse(G.data,G.offset,r,t)}else throw new Error("Font doesn't contain TrueType, CFF or CFF2 outlines.");let De=te(o,Y);if(po.parse(r,De.data,De.offset,r.numberOfHMetrics,r.numGlyphs,r.glyphs,t),Ra(r,t),ie){let G=te(o,ie);r.kerningPairs=Ap.parse(G.data,G.offset)}else r.kerningPairs={};if(_){let G=te(o,_);r.tables.gdef=kp.parse(G.data,G.offset)}if(P){let G=te(o,P);r.tables.gpos=Ip.parse(G.data,G.offset),r.position.init()}if(z){let G=te(o,z);r.tables.gsub=yo.parse(G.data,G.offset)}if(m){let G=te(o,m);r.tables.fvar=xo.parse(G.data,G.offset,r.names)}if(d){let G=te(o,d);r.tables.stat=So.parse(G.data,G.offset,r.tables.fvar)}if(x){m||console.warn("This font provides a gvar table, but no fvar table, which is required for variable fonts."),I||console.warn("This font provides a gvar table, but no glyf table. Glyph variation only works with TrueType outlines.");let G=te(o,x);r.tables.gvar=Co.parse(G.data,G.offset,r.tables.fvar,r.glyphs)}if(v){m||console.warn("This font provides a cvar table, but no fvar table, which is required for variable fonts."),r.tables.cvt||console.warn("This font provides a cvar table, but no cvt table which could be made variable."),I||console.warn("This font provides a gvar table, but no glyf table. Glyph variation only works with TrueType outlines.");let G=te(o,v);r.tables.cvar=To.parse(G.data,G.offset,r.tables.fvar,r.tables.cvt||[])}if(S){m||console.warn("This font provides an avar table, but no fvar table, which is required for variable fonts.");let G=te(o,S);r.tables.avar=ko.parse(G.data,G.offset,r.tables.fvar)}if(re){m||console.warn("This font provides an HVAR table, but no fvar table, which is required for variable fonts."),Y||console.warn("This font provides an HVAR table, but no hmtx table to vary.");let G=te(o,re);r.tables.hvar=gp.parse(G.data,G.offset,r.tables.fvar)}if(ot){let G=te(o,ot);r.tables.meta=bo.parse(G.data,G.offset),r.metas=r.tables.meta}return r.palettes=new Po(r),r}function Mp(){console.error("DEPRECATED! migrate to: opentype.parse(buffer, opt) See: https://github.com/opentypejs/opentype.js/issues/675")}function Pp(){console.error('DEPRECATED! migrate to: opentype.parse(require("fs").readFileSync(url), opt)')}return T(O)})();(function(g,f){typeof define=="function"&&define.amd?define(f):typeof xs=="object"&&xs.exports?xs.exports=f():g.opentype=f()})(typeof self<"u"?self:Ci,()=>({...Ti,default:Ti}))});var Gi=qp(Oi());import{tracingChannel as $p,channel as Xp}from"node:diagnostics_channel";var Ce=Xp("lru-cache:metrics"),Mn=$p("lru-cache"),Yp=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,lr=()=>Ce.hasSubscribers||Mn.hasSubscribers,Li=new Set,Ii=typeof process=="object"&&process?process:{},Zp=(g,f,p,h)=>{typeof Ii.emitWarning=="function"?Ii.emitWarning(g,f,p,h):console.error(`[${p}] ${f}: ${g}`)},Kp=g=>!Li.has(g),Pt=g=>!!g&&g===Math.floor(g)&&g>0&&isFinite(g),Ai=g=>Pt(g)?g<=Math.pow(2,8)?Uint8Array:g<=Math.pow(2,16)?Uint16Array:g<=Math.pow(2,32)?Uint32Array:g<=Number.MAX_SAFE_INTEGER?Ss:null:null,Ss=class extends Array{constructor(g){super(g),this.fill(0)}},xt,bn,Qp=(xt=class{constructor(f,p){ye(this,"heap");ye(this,"length");if(!b(xt,bn))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new p(f),this.length=0}static create(f){let p=Ai(f);if(!p)return[];V(xt,bn,!0);let h=new xt(f,p);return V(xt,bn,!1),h}push(f){this.heap[this.length++]=f}pop(){return this.heap[--this.length]}},bn=new WeakMap,K(xt,bn,!1),xt),wi,Ei,et,je,lt,Jt,ut,vn,xn,ct,xe,ft,be,ce,q,Pe,We,Ae,ke,pt,Te,ht,dt,qe,$e,gt,Sn,Ne,en,L,ur,tn,Ot,Bn,Xe,Di,nn,kn,_n,Nt,Bt,cr,yn,ks,Fi,Ui,Ts,ue,fr,Mi,Pi,Pn,pr,Nn,_t,hr,Tn,Ri=(Tn=class{constructor(f){K(this,L);K(this,et);K(this,je);K(this,lt);K(this,Jt);K(this,ut);K(this,vn);K(this,xn);K(this,ct);ye(this,"ttl");ye(this,"ttlResolution");ye(this,"ttlAutopurge");ye(this,"updateAgeOnGet");ye(this,"updateAgeOnHas");ye(this,"allowStale");ye(this,"noDisposeOnSet");ye(this,"noUpdateTTL");ye(this,"maxEntrySize");ye(this,"sizeCalculation");ye(this,"noDeleteOnFetchRejection");ye(this,"noDeleteOnStaleGet");ye(this,"allowStaleOnFetchAbort");ye(this,"allowStaleOnFetchRejection");ye(this,"ignoreFetchAbort");ye(this,"backgroundFetchSize");K(this,xe);K(this,ft);K(this,be);K(this,ce);K(this,q);K(this,Pe);K(this,We);K(this,Ae);K(this,ke);K(this,pt);K(this,Te);K(this,ht);K(this,dt);K(this,qe);K(this,$e);K(this,gt);K(this,Sn);K(this,Ne);K(this,en);K(this,tn,()=>{});K(this,Ot,()=>{});K(this,Bn,()=>{});K(this,Xe,()=>!1);K(this,nn,f=>{});K(this,kn,(f,p,h)=>{});K(this,_n,(f,p,h,y)=>{if(h||y)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});ye(this,wi,"LRUCache");let{max:p=0,ttl:h,ttlResolution:y=1,ttlAutopurge:k,updateAgeOnGet:T,updateAgeOnHas:O,allowStale:w,dispose:E,onInsert:j,disposeAfter:H,noDisposeOnSet:Q,noUpdateTTL:X,maxSize:fe=0,maxEntrySize:J=0,sizeCalculation:Se,fetchMethod:$,memoMethod:ee,noDeleteOnFetchRejection:ne,noDeleteOnStaleGet:se,allowStaleOnFetchRejection:pe,allowStaleOnFetchAbort:Vt,ignoreFetchAbort:St,backgroundFetchSize:It=1,perf:wt}=f;if(this.backgroundFetchSize=It,wt!==void 0&&typeof wt?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(V(this,ct,wt??Yp),p!==0&&!Pt(p))throw new TypeError("max option must be a nonnegative integer");let Be=p?Ai(p):Array;if(!Be)throw new Error("invalid max value: "+p);if(V(this,et,p),V(this,je,fe),this.maxEntrySize=J||b(this,je),this.sizeCalculation=Se,this.sizeCalculation){if(!b(this,je)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(ee!==void 0&&typeof ee!="function")throw new TypeError("memoMethod must be a function if defined");if(V(this,xn,ee),$!==void 0&&typeof $!="function")throw new TypeError("fetchMethod must be a function if specified");if(V(this,vn,$),V(this,Sn,!!$),V(this,be,new Map),V(this,ce,Array.from({length:p}).fill(void 0)),V(this,q,Array.from({length:p}).fill(void 0)),V(this,Pe,new Be(p)),V(this,We,new Be(p)),V(this,Ae,0),V(this,ke,0),V(this,pt,Qp.create(p)),V(this,xe,0),V(this,ft,0),typeof E=="function"&&V(this,lt,E),typeof j=="function"&&V(this,Jt,j),typeof H=="function"?(V(this,ut,H),V(this,Te,[])):(V(this,ut,void 0),V(this,Te,void 0)),V(this,gt,!!b(this,lt)),V(this,en,!!b(this,Jt)),V(this,Ne,!!b(this,ut)),this.noDisposeOnSet=!!Q,this.noUpdateTTL=!!X,this.noDeleteOnFetchRejection=!!ne,this.allowStaleOnFetchRejection=!!pe,this.allowStaleOnFetchAbort=!!Vt,this.ignoreFetchAbort=!!St,this.maxEntrySize!==0){if(b(this,je)!==0&&!Pt(b(this,je)))throw new TypeError("maxSize must be a positive integer if specified");if(!Pt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");R(this,L,Di).call(this)}if(this.allowStale=!!w,this.noDeleteOnStaleGet=!!se,this.updateAgeOnGet=!!T,this.updateAgeOnHas=!!O,this.ttlResolution=Pt(y)||y===0?y:1,this.ttlAutopurge=!!k,this.ttl=h||0,this.ttl){if(!Pt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");R(this,L,ur).call(this)}if(b(this,et)===0&&this.ttl===0&&b(this,je)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!b(this,et)&&!b(this,je)){let zt="LRU_CACHE_UNBOUNDED";Kp(zt)&&(Li.add(zt),Zp("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",zt,Tn))}}get perf(){return b(this,ct)}static unsafeExposeInternals(f){return{starts:b(f,dt),ttls:b(f,qe),autopurgeTimers:b(f,$e),sizes:b(f,ht),keyMap:b(f,be),keyList:b(f,ce),valList:b(f,q),next:b(f,Pe),prev:b(f,We),get head(){return b(f,Ae)},get tail(){return b(f,ke)},free:b(f,pt),isBackgroundFetch:p=>{var h;return R(h=f,L,ue).call(h,p)},backgroundFetch:(p,h,y,k)=>{var T;return R(T=f,L,Ts).call(T,p,h,y,k)},moveToTail:p=>{var h;return R(h=f,L,Nn).call(h,p)},indexes:p=>{var h;return R(h=f,L,Nt).call(h,p)},rindexes:p=>{var h;return R(h=f,L,Bt).call(h,p)},isStale:p=>{var h;return b(h=f,Xe).call(h,p)}}}get max(){return b(this,et)}get maxSize(){return b(this,je)}get calculatedSize(){return b(this,ft)}get size(){return b(this,xe)}get fetchMethod(){return b(this,vn)}get memoMethod(){return b(this,xn)}get dispose(){return b(this,lt)}get onInsert(){return b(this,Jt)}get disposeAfter(){return b(this,ut)}getRemainingTTL(f){return b(this,be).has(f)?1/0:0}*entries(){for(let f of R(this,L,Nt).call(this))b(this,q)[f]!==void 0&&b(this,ce)[f]!==void 0&&!R(this,L,ue).call(this,b(this,q)[f])&&(yield[b(this,ce)[f],b(this,q)[f]])}*rentries(){for(let f of R(this,L,Bt).call(this))b(this,q)[f]!==void 0&&b(this,ce)[f]!==void 0&&!R(this,L,ue).call(this,b(this,q)[f])&&(yield[b(this,ce)[f],b(this,q)[f]])}*keys(){for(let f of R(this,L,Nt).call(this)){let p=b(this,ce)[f];p!==void 0&&!R(this,L,ue).call(this,b(this,q)[f])&&(yield p)}}*rkeys(){for(let f of R(this,L,Bt).call(this)){let p=b(this,ce)[f];p!==void 0&&!R(this,L,ue).call(this,b(this,q)[f])&&(yield p)}}*values(){for(let f of R(this,L,Nt).call(this))b(this,q)[f]!==void 0&&!R(this,L,ue).call(this,b(this,q)[f])&&(yield b(this,q)[f])}*rvalues(){for(let f of R(this,L,Bt).call(this))b(this,q)[f]!==void 0&&!R(this,L,ue).call(this,b(this,q)[f])&&(yield b(this,q)[f])}[(Ei=Symbol.iterator,wi=Symbol.toStringTag,Ei)](){return this.entries()}find(f,p={}){for(let h of R(this,L,Nt).call(this)){let y=b(this,q)[h],k=R(this,L,ue).call(this,y)?y.__staleWhileFetching:y;if(k!==void 0&&f(k,b(this,ce)[h],this))return R(this,L,Pn).call(this,b(this,ce)[h],p)}}forEach(f,p=this){for(let h of R(this,L,Nt).call(this)){let y=b(this,q)[h],k=R(this,L,ue).call(this,y)?y.__staleWhileFetching:y;k!==void 0&&f.call(p,k,b(this,ce)[h],this)}}rforEach(f,p=this){for(let h of R(this,L,Bt).call(this)){let y=b(this,q)[h],k=R(this,L,ue).call(this,y)?y.__staleWhileFetching:y;k!==void 0&&f.call(p,k,b(this,ce)[h],this)}}purgeStale(){let f=!1;for(let p of R(this,L,Bt).call(this,{allowStale:!0}))b(this,Xe).call(this,p)&&(R(this,L,_t).call(this,b(this,ce)[p],"expire"),f=!0);return f}info(f){let p=b(this,be).get(f);if(p===void 0)return;let h=b(this,q)[p],y=R(this,L,ue).call(this,h)?h.__staleWhileFetching:h;if(y===void 0)return;let k={value:y};if(b(this,qe)&&b(this,dt)){let T=b(this,qe)[p],O=b(this,dt)[p];if(T&&O){let w=T-(b(this,ct).now()-O);k.ttl=w,k.start=Date.now()}}return b(this,ht)&&(k.size=b(this,ht)[p]),k}dump(){let f=[];for(let p of R(this,L,Nt).call(this,{allowStale:!0})){let h=b(this,ce)[p],y=b(this,q)[p],k=R(this,L,ue).call(this,y)?y.__staleWhileFetching:y;if(k===void 0||h===void 0)continue;let T={value:k};if(b(this,qe)&&b(this,dt)){T.ttl=b(this,qe)[p];let O=b(this,ct).now()-b(this,dt)[p];T.start=Math.floor(Date.now()-O)}b(this,ht)&&(T.size=b(this,ht)[p]),f.unshift([h,T])}return f}load(f){this.clear();for(let[p,h]of f){if(h.start){let y=Date.now()-h.start;h.start=b(this,ct).now()-y}R(this,L,yn).call(this,p,h.value,h)}}set(f,p,h={}){let{status:y=Ce.hasSubscribers?{}:void 0}=h;h.status=y,y&&(y.op="set",y.key=f,p!==void 0&&(y.value=p),y.cache=this);let k=R(this,L,yn).call(this,f,p,h);return y&&Ce.hasSubscribers&&Ce.publish(y),k}pop(){var f;try{for(;b(this,xe);){let p=b(this,q)[b(this,Ae)];if(R(this,L,ks).call(this,!0),R(this,L,ue).call(this,p)){if(p.__staleWhileFetching)return p.__staleWhileFetching}else if(p!==void 0)return p}}finally{if(b(this,Ne)&&b(this,Te)){let p=b(this,Te),h;for(;h=p?.shift();)(f=b(this,ut))==null||f.call(this,...h)}}}has(f,p={}){let{status:h=Ce.hasSubscribers?{}:void 0}=p;p.status=h,h&&(h.op="has",h.key=f,h.cache=this);let y=R(this,L,Fi).call(this,f,p);return Ce.hasSubscribers&&Ce.publish(h),y}peek(f,p={}){let{status:h=lr()?{}:void 0}=p;h&&(h.op="peek",h.key=f,h.cache=this),p.status=h;let y=R(this,L,Ui).call(this,f,p);return Ce.hasSubscribers&&Ce.publish(h),y}fetch(f,p={}){let h=Mn.hasSubscribers,{status:y=lr()?{}:void 0}=p;p.status=y,y&&p.context&&(y.context=p.context);let k=R(this,L,fr).call(this,f,p);return y&&h&&(y.trace=!0,Mn.tracePromise(()=>k,y).catch(()=>{})),k}forceFetch(f,p={}){let h=Mn.hasSubscribers,{status:y=lr()?{}:void 0}=p;p.status=y,y&&p.context&&(y.context=p.context);let k=R(this,L,Mi).call(this,f,p);return y&&h&&(y.trace=!0,Mn.tracePromise(()=>k,y).catch(()=>{})),k}memo(f,p={}){let{status:h=Ce.hasSubscribers?{}:void 0}=p;p.status=h,h&&(h.op="memo",h.key=f,p.context&&(h.context=p.context),h.cache=this);let y=R(this,L,Pi).call(this,f,p);return h&&(h.value=y),Ce.hasSubscribers&&Ce.publish(h),y}get(f,p={}){let{status:h=Ce.hasSubscribers?{}:void 0}=p;p.status=h,h&&(h.op="get",h.key=f,h.cache=this);let y=R(this,L,Pn).call(this,f,p);return h&&(y!==void 0&&(h.value=y),Ce.hasSubscribers&&Ce.publish(h)),y}delete(f){return R(this,L,_t).call(this,f,"delete")}clear(){return R(this,L,hr).call(this,"delete")}},et=new WeakMap,je=new WeakMap,lt=new WeakMap,Jt=new WeakMap,ut=new WeakMap,vn=new WeakMap,xn=new WeakMap,ct=new WeakMap,xe=new WeakMap,ft=new WeakMap,be=new WeakMap,ce=new WeakMap,q=new WeakMap,Pe=new WeakMap,We=new WeakMap,Ae=new WeakMap,ke=new WeakMap,pt=new WeakMap,Te=new WeakMap,ht=new WeakMap,dt=new WeakMap,qe=new WeakMap,$e=new WeakMap,gt=new WeakMap,Sn=new WeakMap,Ne=new WeakMap,en=new WeakMap,L=new WeakSet,ur=function(){let f=new Ss(b(this,et)),p=new Ss(b(this,et));V(this,qe,f),V(this,dt,p);let h=this.ttlAutopurge?Array.from({length:b(this,et)}):void 0;V(this,$e,h),V(this,Bn,(O,w,E=b(this,ct).now())=>{p[O]=w!==0?E:0,f[O]=w,y(O,w)}),V(this,tn,O=>{p[O]=f[O]!==0?b(this,ct).now():0,y(O,f[O])});let y=this.ttlAutopurge?(O,w)=>{if(h?.[O]&&(clearTimeout(h[O]),h[O]=void 0),w&&w!==0&&h){let E=setTimeout(()=>{b(this,Xe).call(this,O)&&R(this,L,_t).call(this,b(this,ce)[O],"expire")},w+1);E.unref&&E.unref(),h[O]=E}}:()=>{};V(this,Ot,(O,w)=>{if(f[w]){let E=f[w],j=p[w];if(!E||!j)return;O.ttl=E,O.start=j,O.now=k||T();let H=O.now-j;O.remainingTTL=E-H}});let k=0,T=()=>{let O=b(this,ct).now();if(this.ttlResolution>0){k=O;let w=setTimeout(()=>k=0,this.ttlResolution);w.unref&&w.unref()}return O};this.getRemainingTTL=O=>{let w=b(this,be).get(O);if(w===void 0)return 0;let E=f[w],j=p[w];if(!E||!j)return 1/0;let H=(k||T())-j;return E-H},V(this,Xe,O=>{let w=p[O],E=f[O];return!!E&&!!w&&(k||T())-w>E})},tn=new WeakMap,Ot=new WeakMap,Bn=new WeakMap,Xe=new WeakMap,Di=function(){let f=new Ss(b(this,et));V(this,ft,0),V(this,ht,f),V(this,nn,p=>{V(this,ft,b(this,ft)-f[p]),f[p]=0}),V(this,_n,(p,h,y,k)=>{if(!Pt(y)){if(R(this,L,ue).call(this,h))return this.backgroundFetchSize;if(k){if(typeof k!="function")throw new TypeError("sizeCalculation must be a function");if(y=k(h,p),!Pt(y))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return y}),V(this,kn,(p,h,y)=>{if(f[p]=h,b(this,je)){let k=b(this,je)-f[p];for(;b(this,ft)>k;)R(this,L,ks).call(this,!0)}V(this,ft,b(this,ft)+f[p]),y&&(y.entrySize=h,y.totalCalculatedSize=b(this,ft))})},nn=new WeakMap,kn=new WeakMap,_n=new WeakMap,Nt=function*({allowStale:f=this.allowStale}={}){if(b(this,xe))for(let p=b(this,ke);R(this,L,cr).call(this,p)&&((f||!b(this,Xe).call(this,p))&&(yield p),p!==b(this,Ae));)p=b(this,We)[p]},Bt=function*({allowStale:f=this.allowStale}={}){if(b(this,xe))for(let p=b(this,Ae);R(this,L,cr).call(this,p)&&((f||!b(this,Xe).call(this,p))&&(yield p),p!==b(this,ke));)p=b(this,Pe)[p]},cr=function(f){return f!==void 0&&b(this,be).get(b(this,ce)[f])===f},yn=function(f,p,h,y){var fe,J,Se,$;let{ttl:k=this.ttl,start:T,noDisposeOnSet:O=this.noDisposeOnSet,sizeCalculation:w=this.sizeCalculation,status:E}=h,j=R(this,L,ue).call(this,p);if(p===void 0)return E&&(E.set="deleted"),this.delete(f),this;let{noUpdateTTL:H=this.noUpdateTTL}=h;E&&!j&&(E.value=p);let Q=b(this,_n).call(this,f,p,h.size||0,w,E);if(this.maxEntrySize&&Q>this.maxEntrySize)return R(this,L,_t).call(this,f,"set"),E&&(E.set="miss",E.maxEntrySizeExceeded=!0),this;let X=b(this,xe)===0?void 0:b(this,be).get(f);if(X===void 0)X=b(this,xe)===0?b(this,ke):b(this,pt).length!==0?b(this,pt).pop():b(this,xe)===b(this,et)?R(this,L,ks).call(this,!1):b(this,xe),b(this,ce)[X]=f,b(this,q)[X]=p,b(this,be).set(f,X),b(this,Pe)[b(this,ke)]=X,b(this,We)[X]=b(this,ke),V(this,ke,X),vs(this,xe)._++,b(this,kn).call(this,X,Q,E),E&&(E.set="add"),H=!1,b(this,en)&&!j&&((fe=b(this,Jt))==null||fe.call(this,p,f,"add"));else{R(this,L,Nn).call(this,X);let ee=b(this,q)[X];if(p!==ee){if(!O)if(R(this,L,ue).call(this,ee)){ee!==y&&ee.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:ne}=ee;ne!==void 0&&ne!==p&&(b(this,gt)&&((J=b(this,lt))==null||J.call(this,ne,f,"set")),b(this,Ne)&&b(this,Te)?.push([ne,f,"set"]))}else b(this,gt)&&((Se=b(this,lt))==null||Se.call(this,ee,f,"set")),b(this,Ne)&&b(this,Te)?.push([ee,f,"set"]);if(b(this,nn).call(this,X),b(this,kn).call(this,X,Q,E),b(this,q)[X]=p,!j){let ne=ee&&R(this,L,ue).call(this,ee)?ee.__staleWhileFetching:ee,se=ne===void 0?"add":p!==ne?"replace":"update";E&&(E.set=se,ne!==void 0&&(E.oldValue=ne)),b(this,en)&&this.onInsert?.(p,f,se)}}else j||(E&&(E.set="update"),b(this,en)&&this.onInsert?.(p,f,"update"))}if(k!==0&&!b(this,qe)&&R(this,L,ur).call(this),b(this,qe)&&(H||b(this,Bn).call(this,X,k,T),E&&b(this,Ot).call(this,E,X)),!O&&b(this,Ne)&&b(this,Te)){let ee=b(this,Te),ne;for(;ne=ee?.shift();)($=b(this,ut))==null||$.call(this,...ne)}return this},ks=function(f){var O;let p=b(this,Ae),h=b(this,ce)[p],y=b(this,q)[p],k=R(this,L,ue).call(this,y);k&&y.__abortController.abort(new Error("evicted"));let T=k?y.__staleWhileFetching:y;return(b(this,gt)||b(this,Ne))&&T!==void 0&&(b(this,gt)&&((O=b(this,lt))==null||O.call(this,T,h,"evict")),b(this,Ne)&&b(this,Te)?.push([T,h,"evict"])),b(this,nn).call(this,p),b(this,$e)?.[p]&&(clearTimeout(b(this,$e)[p]),b(this,$e)[p]=void 0),f&&(b(this,ce)[p]=void 0,b(this,q)[p]=void 0,b(this,pt).push(p)),b(this,xe)===1?(V(this,Ae,V(this,ke,0)),b(this,pt).length=0):V(this,Ae,b(this,Pe)[p]),b(this,be).delete(h),vs(this,xe)._--,p},Fi=function(f,p={}){let{updateAgeOnHas:h=this.updateAgeOnHas,status:y}=p,k=b(this,be).get(f);if(k!==void 0){let T=b(this,q)[k];if(R(this,L,ue).call(this,T)&&T.__staleWhileFetching===void 0)return!1;if(b(this,Xe).call(this,k))y&&(y.has="stale",b(this,Ot).call(this,y,k));else return h&&b(this,tn).call(this,k),y&&(y.has="hit",b(this,Ot).call(this,y,k)),!0}else y&&(y.has="miss");return!1},Ui=function(f,p){let{status:h,allowStale:y=this.allowStale}=p,k=b(this,be).get(f);if(k===void 0||!y&&b(this,Xe).call(this,k)){h&&(h.peek=k===void 0?"miss":"stale");return}let T=b(this,q)[k],O=R(this,L,ue).call(this,T)?T.__staleWhileFetching:T;return h&&(O!==void 0?(h.peek="hit",h.value=O):h.peek="miss"),O},Ts=function(f,p,h,y){let k=p===void 0?void 0:b(this,q)[p];if(R(this,L,ue).call(this,k))return k;let T=new AbortController,{signal:O}=h;O?.addEventListener("abort",()=>T.abort(O.reason),{signal:T.signal});let w={signal:T.signal,options:h,context:y},E=(J,Se=!1)=>{let{aborted:$}=T.signal,ee=h.ignoreFetchAbort&&J!==void 0,ne=h.ignoreFetchAbort||!!(h.allowStaleOnFetchAbort&&J!==void 0);if(h.status&&($&&!Se?(h.status.fetchAborted=!0,h.status.fetchError=T.signal.reason,ee&&(h.status.fetchAbortIgnored=!0)):h.status.fetchResolved=!0),$&&!ee&&!Se)return H(T.signal.reason,ne);let se=X,pe=b(this,q)[p];return(pe===X||pe===void 0&&ee&&Se)&&(J===void 0?se.__staleWhileFetching!==void 0?b(this,q)[p]=se.__staleWhileFetching:R(this,L,_t).call(this,f,"fetch"):(h.status&&(h.status.fetchUpdated=!0),R(this,L,yn).call(this,f,J,w.options,se))),J},j=J=>(h.status&&(h.status.fetchRejected=!0,h.status.fetchError=J),H(J,!1)),H=(J,Se)=>{let{aborted:$}=T.signal,ee=$&&h.allowStaleOnFetchAbort,ne=ee||h.allowStaleOnFetchRejection,se=ne||h.noDeleteOnFetchRejection,pe=X;if(b(this,q)[p]===X&&(!se||!Se&&pe.__staleWhileFetching===void 0?R(this,L,_t).call(this,f,"fetch"):ee||(b(this,q)[p]=pe.__staleWhileFetching)),ne)return h.status&&pe.__staleWhileFetching!==void 0&&(h.status.returnedStale=!0),pe.__staleWhileFetching;if(pe.__returned===pe)throw J},Q=(J,Se)=>{var ee;let $=(ee=b(this,vn))==null?void 0:ee.call(this,f,k,w);T.signal.addEventListener("abort",()=>{(!h.ignoreFetchAbort||h.allowStaleOnFetchAbort)&&(J(void 0),h.allowStaleOnFetchAbort&&(J=ne=>E(ne,!0)))}),$&&$ instanceof Promise?$.then(ne=>J(ne===void 0?void 0:ne),Se):$!==void 0&&J($)};h.status&&(h.status.fetchDispatched=!0);let X=new Promise(Q).then(E,j),fe=Object.assign(X,{__abortController:T,__staleWhileFetching:k,__returned:void 0});return p===void 0?(R(this,L,yn).call(this,f,fe,{...w.options,status:void 0}),p=b(this,be).get(f)):b(this,q)[p]=fe,fe},ue=function(f){if(!b(this,Sn))return!1;let p=f;return!!p&&p instanceof Promise&&p.hasOwnProperty("__staleWhileFetching")&&p.__abortController instanceof AbortController},fr=async function(f,p={}){let{allowStale:h=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:k=this.noDeleteOnStaleGet,ttl:T=this.ttl,noDisposeOnSet:O=this.noDisposeOnSet,size:w=0,sizeCalculation:E=this.sizeCalculation,noUpdateTTL:j=this.noUpdateTTL,noDeleteOnFetchRejection:H=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Q=this.allowStaleOnFetchRejection,ignoreFetchAbort:X=this.ignoreFetchAbort,allowStaleOnFetchAbort:fe=this.allowStaleOnFetchAbort,context:J,forceRefresh:Se=!1,status:$,signal:ee}=p;if($&&($.op="fetch",$.key=f,Se&&($.forceRefresh=!0),$.cache=this),!b(this,Sn))return $&&($.fetch="get"),R(this,L,Pn).call(this,f,{allowStale:h,updateAgeOnGet:y,noDeleteOnStaleGet:k,status:$});let ne={allowStale:h,updateAgeOnGet:y,noDeleteOnStaleGet:k,ttl:T,noDisposeOnSet:O,size:w,sizeCalculation:E,noUpdateTTL:j,noDeleteOnFetchRejection:H,allowStaleOnFetchRejection:Q,allowStaleOnFetchAbort:fe,ignoreFetchAbort:X,status:$,signal:ee},se=b(this,be).get(f);if(se===void 0){$&&($.fetch="miss");let pe=R(this,L,Ts).call(this,f,se,ne,J);return pe.__returned=pe}else{let pe=b(this,q)[se];if(R(this,L,ue).call(this,pe)){let wt=h&&pe.__staleWhileFetching!==void 0;return $&&($.fetch="inflight",wt&&($.returnedStale=!0)),wt?pe.__staleWhileFetching:pe.__returned=pe}let Vt=b(this,Xe).call(this,se);if(!Se&&!Vt)return $&&($.fetch="hit"),R(this,L,Nn).call(this,se),y&&b(this,tn).call(this,se),$&&b(this,Ot).call(this,$,se),pe;let St=R(this,L,Ts).call(this,f,se,ne,J),It=St.__staleWhileFetching!==void 0&&h;return $&&($.fetch=Vt?"stale":"refresh",It&&Vt&&($.returnedStale=!0)),It?St.__staleWhileFetching:St.__returned=St}},Mi=async function(f,p={}){let h=await R(this,L,fr).call(this,f,p);if(h===void 0)throw new Error("fetch() returned undefined");return h},Pi=function(f,p={}){let h=b(this,xn);if(!h)throw new Error("no memoMethod provided to constructor");let{context:y,status:k,forceRefresh:T,...O}=p;k&&T&&(k.forceRefresh=!0);let w=R(this,L,Pn).call(this,f,O),E=T||w===void 0;if(k&&(k.memo=E?"miss":"hit",E||(k.value=w)),!E)return w;let j=h(f,w,{options:O,context:y});return k&&(k.value=j),R(this,L,yn).call(this,f,j,O),j},Pn=function(f,p={}){let{allowStale:h=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:k=this.noDeleteOnStaleGet,status:T}=p,O=b(this,be).get(f);if(O===void 0){T&&(T.get="miss");return}let w=b(this,q)[O],E=R(this,L,ue).call(this,w);return T&&b(this,Ot).call(this,T,O),b(this,Xe).call(this,O)?E?(T&&(T.get="stale-fetching"),h&&w.__staleWhileFetching!==void 0?(T&&(T.returnedStale=!0),w.__staleWhileFetching):void 0):(k||R(this,L,_t).call(this,f,"expire"),T&&(T.get="stale"),h?(T&&(T.returnedStale=!0),w):void 0):(T&&(T.get=E?"fetching":"hit"),R(this,L,Nn).call(this,O),y&&b(this,tn).call(this,O),E?w.__staleWhileFetching:w)},pr=function(f,p){b(this,We)[p]=f,b(this,Pe)[f]=p},Nn=function(f){f!==b(this,ke)&&(f===b(this,Ae)?V(this,Ae,b(this,Pe)[f]):R(this,L,pr).call(this,b(this,We)[f],b(this,Pe)[f]),R(this,L,pr).call(this,b(this,ke),f),V(this,ke,f))},_t=function(f,p){var y,k;Ce.hasSubscribers&&Ce.publish({op:"delete",delete:p,key:f,cache:this});let h=!1;if(b(this,xe)!==0){let T=b(this,be).get(f);if(T!==void 0)if(b(this,$e)?.[T]&&(clearTimeout(b(this,$e)?.[T]),b(this,$e)[T]=void 0),h=!0,b(this,xe)===1)R(this,L,hr).call(this,p);else{b(this,nn).call(this,T);let O=b(this,q)[T];if(R(this,L,ue).call(this,O)?O.__abortController.abort(new Error("deleted")):(b(this,gt)||b(this,Ne))&&(b(this,gt)&&((y=b(this,lt))==null||y.call(this,O,f,p)),b(this,Ne)&&b(this,Te)?.push([O,f,p])),b(this,be).delete(f),b(this,ce)[T]=void 0,b(this,q)[T]=void 0,T===b(this,ke))V(this,ke,b(this,We)[T]);else if(T===b(this,Ae))V(this,Ae,b(this,Pe)[T]);else{let w=b(this,We)[T];b(this,Pe)[w]=b(this,Pe)[T];let E=b(this,Pe)[T];b(this,We)[E]=b(this,We)[T]}vs(this,xe)._--,b(this,pt).push(T)}}if(b(this,Ne)&&b(this,Te)?.length){let T=b(this,Te),O;for(;O=T?.shift();)(k=b(this,ut))==null||k.call(this,...O)}return h},hr=function(f){var p,h;for(let y of R(this,L,Bt).call(this,{allowStale:!0})){let k=b(this,q)[y];if(R(this,L,ue).call(this,k))k.__abortController.abort(new Error("deleted"));else{let T=b(this,ce)[y];b(this,gt)&&((p=b(this,lt))==null||p.call(this,k,T,f)),b(this,Ne)&&b(this,Te)?.push([k,T,f])}}if(b(this,be).clear(),b(this,q).fill(void 0),b(this,ce).fill(void 0),b(this,qe)&&b(this,dt)){b(this,qe).fill(0),b(this,dt).fill(0);for(let y of b(this,$e)??[])y!==void 0&&clearTimeout(y);b(this,$e)?.fill(void 0)}if(b(this,ht)&&b(this,ht).fill(0),V(this,Ae,0),V(this,ke,0),b(this,pt).length=0,V(this,ft,0),V(this,xe,0),b(this,Ne)&&b(this,Te)){let y=b(this,Te),k;for(;k=y?.shift();)(h=b(this,ut))==null||h.call(this,...k)}},Tn);function Gn(g){let f={individual:{},range:[]},p=new WeakMap;for(let h of g)gr(f,h,p);return f}function gr(g,f,p){for(let[h,y]of Object.entries(f.individual))if(g.individual[h])Cn(g.individual[h],y,p);else{let k=!1;for(let[T,{range:O,entry:w}]of g.range.entries()){let E=dr(Number(h),O);if(E.both!==null){k=!0,g.individual[h]=y,Cn(g.individual[h],Oe(w),p),g.range.splice(T,1);for(let j of E.second)Array.isArray(j)?g.range.push({range:j,entry:Oe(w)}):g.individual[j]=Oe(w)}}k||(g.individual[h]=y)}for(let{range:h,entry:y}of f.range){let k=[h];for(let T=0;T<g.range.length;T++){let{range:O,entry:w}=g.range[T];for(let[E,j]of k.entries())if(Array.isArray(j)){let H=Jp(j,O);if(H.both===null)continue;g.range.splice(T,1),T--;let Q=Oe(w);Array.isArray(H.both)?g.range.push({range:H.both,entry:Q}):g.individual[H.both]=Q,Cn(Q,Oe(y),p);for(let X of H.second)Array.isArray(X)?g.range.push({range:X,entry:Oe(w)}):g.individual[X]=Oe(w);k=H.first}else{let H=dr(j,O);if(H.both===null)continue;g.individual[j]=Oe(y),Cn(g.individual[j],Oe(w),p),g.range.splice(T,1),T--;for(let Q of H.second)Array.isArray(Q)?g.range.push({range:Q,entry:Oe(w)}):g.individual[Q]=Oe(w);k.splice(E,1,...H.first);break}}for(let T of Object.keys(g.individual))for(let[O,w]of k.entries())if(Array.isArray(w)){let E=dr(Number(T),w);if(E.both===null)continue;Cn(g.individual[T],Oe(y),p),k.splice(O,1,...E.second);break}else if(Number(T)===w){Cn(g.individual[T],Oe(y),p);break}for(let T of k)Array.isArray(T)?g.range.push({range:T,entry:Oe(y)}):g.individual[T]=Oe(y)}}function Cn(g,f,p){let h=p.get(g);h?.has(f)||(h||(h=new Set,p.set(g,h)),h.add(f),f.lookup&&(!g.lookup||g.lookup.index>f.lookup.index||g.lookup.index===f.lookup.index&&g.lookup.subIndex>f.lookup.subIndex)&&(g.lookup=f.lookup),f.forward&&(g.forward?gr(g.forward,f.forward,p):g.forward=f.forward),f.reverse&&(g.reverse?gr(g.reverse,f.reverse,p):g.reverse=f.reverse))}function Jp(g,f){let p={first:[],second:[],both:null};if(g[0]<f[1]&&f[0]<g[1]){let h=Math.max(g[0],f[0]),y=Math.min(g[1],f[1]);p.both=sn(h,y)}if(g[0]<f[0]){let h=g[0],y=Math.min(f[0],g[1]);p.first.push(sn(h,y))}else if(f[0]<g[0]){let h=f[0],y=Math.min(f[1],g[0]);p.second.push(sn(h,y))}if(g[1]>f[1]){let h=Math.max(g[0],f[1]),y=g[1];p.first.push(sn(h,y))}else if(f[1]>g[1]){let h=Math.max(g[1],f[0]),y=f[1];p.second.push(sn(h,y))}return p}function dr(g,f){if(g<f[0]||g>f[1])return{first:[g],second:[f],both:null};let p={first:[],second:[],both:g};return f[0]<g&&p.second.push(sn(f[0],g)),f[1]>g&&p.second.push(sn(g+1,f[1])),p}function sn(g,f){return f-g===1?g:[g,f]}function Oe(g,f=new Map){if(f.has(g))return f.get(g);let p={};return f.set(g,p),g.forward&&(p.forward=Ni(g.forward,f)),g.reverse&&(p.reverse=Ni(g.reverse,f)),g.lookup&&(p.lookup={contextRange:g.lookup.contextRange.slice(),index:g.lookup.index,length:g.lookup.length,subIndex:g.lookup.subIndex,substitutions:g.lookup.substitutions.slice()}),p}function Ni(g,f=new Map){let p={};for(let[h,y]of Object.entries(g.individual))p[h]=Oe(y,f);return{individual:p,range:g.range.map(({range:h,entry:y})=>({range:h.slice(),entry:Oe(y,f)}))}}function Hn(g,f,p,h){let y=f[h],k=g[y];if(!k)return;let T=k.lookup;if(k.reverse){let w=eh(k.reverse,f,p);(!T&&w||w&&T&&(T.index>w.index||T.index===w.index&&T.subIndex>w.subIndex))&&(T=w)}if(++h>=f.length||!k.forward)return T;let O=Hn(k.forward,f,p,h);return(!T&&O||O&&T&&(T.index>O.index||T.index===O.index&&T.subIndex>O.subIndex))&&(T=O),T}function eh(g,f,p){let h=g[f[--p]],y=h&&h.lookup;for(;h&&((!y&&h.lookup||h.lookup&&y&&y.index>h.lookup.index)&&(y=h.lookup),!(--p<0||!h.reverse));)h=h.reverse[f[p]];return y}function Cs(g,f,p){let h=!1;for(let y=0;y<g.length;y++){let k=g[y];if(h){if(p<=k[0])return g[y-1][1]=p,g;if(p<=k[1])return g[y-1][1]=Math.max(p,k[1]),g.splice(y,1),g;g.splice(y,1),y--}else{if(p<=k[0])return g.splice(y,0,[f,p]),g;if(p<=k[1])return k[0]=Math.min(f,k[0]),g;if(f<k[1])k[0]=Math.min(f,k[0]),h=!0;else continue}}return h?g[g.length-1][1]=p:g.push([f,p]),g}function mr(g,f){switch(g.format){case 1:let p=g.glyphs.indexOf(f);return p!==-1?p:null;case 2:let h=g.ranges.find(y=>y.start<=f&&y.end>=f);return h?h.index:null}}function Ye(g){switch(g.format){case 1:return g.glyphs.map((p,h)=>({glyphId:p,index:h}));case 2:let f=[];for(let[p,h]of g.ranges.entries())h.end===h.start?f.push({glyphId:h.start,index:p}):f.push({glyphId:[h.start,h.end+1],index:p});return f}}function Bi(g,f){let p=f[0],h=Os(g,p),y=f[0]+1,k=new Map;for(;y<f[1];)Os(g,y)!==h&&(y-p<=1?k.set(p,h):k.set([p,y],h)),y++;return y-p<=1?k.set(p,h):k.set([p,y],h),k}function Os(g,f){let p=mr(g.coverage,f);if(p===null)return null;switch(g.substFormat){case 1:return(f+g.deltaGlyphId)%2**16;case 2:return g.substitute[p]??null}}function On(g,f,p,h,y){let k=[];for(let T of p){T.entry.forward={individual:{},range:[]};for(let O of g)k.push(...rn(T.entry.forward,h,y,f,O).map(({entry:w,substitution:E})=>({entry:w,substitutions:[...T.substitutions,E]})))}return k}function Gt(g,f){let p=[],h=new Set;for(let y of f){if(h.has(y.entry))continue;h.add(y.entry),y.entry.forward??={individual:{},range:[]};let k={};for(let T of g)Array.isArray(T)?y.entry.forward.range.push({entry:k,range:T}):y.entry.forward.individual[T]=k;p.push({entry:k,substitutions:y.substitutions})}return p}function Ht(g,f){let p=[],h=new Set;for(let y of f){if(h.has(y.entry))continue;h.add(y.entry),y.entry.reverse??={individual:{},range:[]};let k={};for(let T of g)Array.isArray(T)?y.entry.reverse.range.push({entry:k,range:T}):y.entry.reverse.individual[T]=k;p.push({entry:k,substitutions:y.substitutions})}return p}function rn(g,f,p,h,y){let k=[];if(!Array.isArray(y))g.individual[y]={},k.push({entry:g.individual[y],substitution:nh(f,p,h,y)});else{let T=th(f,p,h,y);for(let[O,w]of T){let E={};Array.isArray(O)?g.range.push({range:O,entry:E}):g.individual[O]={},k.push({entry:E,substitution:w})}}return k}function th(g,f,p,h){for(let y of g.filter(k=>k.sequenceIndex===p))for(let k of f[y.lookupListIndex].subtables){let T=Bi(k,h);if(!Array.from(T.values()).every(O=>O!==null))return T}return new Map([[h,null]])}function nh(g,f,p,h){for(let y of g.filter(k=>k.sequenceIndex===p))for(let k of f[y.lookupListIndex].subtables){let T=Os(k,h);if(T!==null)return T}return null}function yr(g,f,p){let h={individual:{},range:[]},y=Ye(g.coverage);for(let{glyphId:k,index:T}of y){let O=g.chainRuleSets[T];if(O)for(let[w,E]of O.entries()){let j=rn(h,E.lookupRecords,f,0,k).map(({entry:H,substitution:Q})=>({entry:H,substitutions:[Q]}));for(let[H,Q]of E.input.entries())j=On([Q],H+1,j,E.lookupRecords,f);for(let H of E.lookahead)j=Gt([H],j);for(let H of E.backtrack)j=Ht([H],j);for(let{entry:H,substitutions:Q}of j)H.lookup={substitutions:Q,length:E.input.length+1,index:p,subIndex:w,contextRange:[-1*E.backtrack.length,1+E.input.length+E.lookahead.length]}}}return h}function vr(g,f){return g.format===2?Array.isArray(f)?sh(g,f):new Map([[f,br(g,f)]]):new Map([[f,null]])}function sh(g,f){let p=f[0],h=br(g,p),y=f[0]+1,k=new Map;for(;y<f[1];)br(g,y)!==h&&(y-p<=1?k.set(p,h):k.set([p,y],h)),y++;return y-p<=1?k.set(p,h):k.set([p,y],h),k}function br(g,f){for(let p of g.ranges)if(p.start<=f&&p.end>=f)return p.classId;return null}function Is(g,f){switch(g.format){case 2:let p=[];for(let h of g.ranges)h.classId===f&&(h.end===h.start?p.push(h.start):p.push([h.start,h.end+1]));return p;default:return[]}}function xr(g,f,p){let h=[],y=Ye(g.coverage);for(let{glyphId:k}of y){let T=vr(g.inputClassDef,k);for(let[O,w]of T.entries()){if(w===null)continue;let E=g.chainClassSet[w];if(E)for(let[j,H]of E.entries()){let Q={individual:{},range:[]},X=rn(Q,H.lookupRecords,f,0,O).map(({entry:fe,substitution:J})=>({entry:fe,substitutions:[J]}));for(let[fe,J]of H.input.entries())X=On(Is(g.inputClassDef,J),fe+1,X,H.lookupRecords,f);for(let fe of H.lookahead)X=Gt(Is(g.lookaheadClassDef,fe),X);for(let fe of H.backtrack)X=Ht(Is(g.backtrackClassDef,fe),X);for(let{entry:fe,substitutions:J}of X)fe.lookup={substitutions:J,index:p,subIndex:j,length:H.input.length+1,contextRange:[-1*H.backtrack.length,1+H.input.length+H.lookahead.length]};h.push(Q)}}}return Gn(h)}function Sr(g,f,p){let h={individual:{},range:[]},y=Ye(g.inputCoverage[0]);for(let{glyphId:k}of y){let T=rn(h,g.lookupRecords,f,0,k).map(({entry:O,substitution:w})=>({entry:O,substitutions:[w]}));for(let[O,w]of g.inputCoverage.slice(1).entries())T=On(Ye(w).map(E=>E.glyphId),O+1,T,g.lookupRecords,f);for(let O of g.lookaheadCoverage)T=Gt(Ye(O).map(w=>w.glyphId),T);for(let O of g.backtrackCoverage)T=Ht(Ye(O).map(w=>w.glyphId),T);for(let{entry:O,substitutions:w}of T)O.lookup={substitutions:w,index:p,subIndex:0,length:g.inputCoverage.length,contextRange:[-1*g.backtrackCoverage.length,g.inputCoverage.length+g.lookaheadCoverage.length]}}return h}function kr(g,f){let p={individual:{},range:[]},h=Ye(g.coverage);for(let{glyphId:y,index:k}of h){let T={};Array.isArray(y)?p.range.push({entry:T,range:y}):p.individual[y]=T;let O=[{entry:T,substitutions:[g.substitutes[k]]}];for(let w of g.lookaheadCoverage)O=Gt(Ye(w).map(E=>E.glyphId),O);for(let w of g.backtrackCoverage)O=Ht(Ye(w).map(E=>E.glyphId),O);for(let{entry:w,substitutions:E}of O)w.lookup={substitutions:E,index:f,subIndex:0,length:1,contextRange:[-1*g.backtrackCoverage.length,1+g.lookaheadCoverage.length]}}return p}function Vn(g,f=new Map){let p={};for(let[h,y]of Object.entries(g.individual))p[h]=_i(y,f);for(let{range:h,entry:y}of g.range){let k=_i(y,f);for(let T=h[0];T<h[1];T++)p[T]=k}return p}function _i(g,f){if(f.has(g))return f.get(g);let p={};return f.set(g,p),g.forward&&(p.forward=Vn(g.forward,f)),g.reverse&&(p.reverse=Vn(g.reverse,f)),g.lookup&&(p.lookup=g.lookup),p}var Tr=class{constructor(f,p){this._lookupTrees=[];this._glyphLookups={};this._font=f,p.cacheSize>0&&(this._cache=new Ri({maxSize:p.cacheSize,sizeCalculation:((O,w)=>w.length)}));let y=(this._font.tables.gsub&&this._font.tables.gsub.features.filter(O=>O.tag==="calt")||[]).reduce((O,w)=>[...O,...w.feature.lookupListIndexes],[]),k=this._font.tables.gsub&&this._font.tables.gsub.lookups||[],T=k.filter((O,w)=>y.some(E=>E===w));for(let[O,w]of T.entries()){let E=[];switch(w.lookupType){case 6:for(let[H,Q]of w.subtables.entries())switch(Q.substFormat){case 1:E.push(yr(Q,k,H));break;case 2:E.push(xr(Q,k,H));break;case 3:E.push(Sr(Q,k,H));break}break;case 8:for(let[H,Q]of w.subtables.entries())E.push(kr(Q,H));break}let j=Vn(Gn(E));this._lookupTrees.push({tree:j,processForward:w.lookupType!==8});for(let H of Object.keys(j))this._glyphLookups[H]||(this._glyphLookups[H]=[]),this._glyphLookups[H].push(O)}}findLigatures(f){let p=this._cache&&this._cache.get(f);if(p&&!Array.isArray(p))return p;let h=[];for(let T of f)h.push(this._font.charToGlyphIndex(T));if(this._lookupTrees.length===0)return{inputGlyphs:h,outputGlyphs:h,contextRanges:[]};let y=this._findInternal(h.slice()),k={inputGlyphs:h,outputGlyphs:y.sequence,contextRanges:y.ranges};return this._cache&&this._cache.set(f,k),k}findLigatureRanges(f){if(this._lookupTrees.length===0)return[];let p=this._cache&&this._cache.get(f);if(p)return Array.isArray(p)?p:p.contextRanges;let h=[];for(let k of f)h.push(this._font.charToGlyphIndex(k));let y=this._findInternal(h);return this._cache&&this._cache.set(f,y.ranges),y.ranges}_findInternal(f){let p=[],h=this._getNextLookup(f,0);for(;h.index!==null;){let y=this._lookupTrees[h.index];if(y.processForward){let k=h.last;for(let T=h.first;T<k;T++){let O=Hn(y.tree,f,T,T);if(O){for(let w=0;w<O.substitutions.length;w++){let E=O.substitutions[w];E!==null&&(f[T+w]=E)}Cs(p,O.contextRange[0]+T,O.contextRange[1]+T),T+O.length>=k&&(k=T+O.length+1),T+=O.length-1}}}else for(let k=h.last-1;k>=h.first;k--){let T=Hn(y.tree,f,k,k);if(T){for(let O=0;O<T.substitutions.length;O++){let w=T.substitutions[O];w!==null&&(f[k+O]=w)}Cs(p,T.contextRange[0]+k,T.contextRange[1]+k),k-=T.length-1}}h=this._getNextLookup(f,h.index+1)}return{sequence:f,ranges:p}}_getNextLookup(f,p){let h={index:null,first:1/0,last:-1};for(let y=0;y<f.length;y++){let k=this._glyphLookups[f[y]];if(k)for(let T=0;T<k.length;T++){let O=k[T];if(O>=p){(h.index===null||O<=h.index)&&(h.index=O,h.first>y&&(h.first=y),h.last=y+1);break}}}return h}};function Hi(g,f){let p=Gi.parse(g);return new Tr(p,{cacheSize:0,...f})}function Or(g){if(typeof g!="string")throw new Error("Font family must be a string");let f={input:g,offset:0},p=[],h="";for(;f.offset<f.input.length;){let y=f.input[f.offset++];switch(y){case"'":case'"':h+=rh(f,y);break;case",":p.push(h),h="";break;default:/\s/.test(y)||(f.offset--,h+=oh(f),p.push(h),h="")}}return p}function rh(g,f){let p="",h=!1;for(;g.offset<g.input.length;){let y=g.input[g.offset++];if(h)/[\dA-Fa-f]/.test(y)?(g.offset--,p+=Vi(g)):y!==`
19
19
  `&&(p+=y),h=!1;else switch(y){case f:return p;case"\\":h=!0;break;default:p+=y}}throw new Error("Unterminated string")}function oh(g){let f="",p=!1;for(;g.offset<g.input.length;){let h=g.input[g.offset++];if(p)/[\dA-Fa-f]/.test(h)?(g.offset--,f+=Vi(g)):f+=h,p=!1;else switch(h){case"\\":p=!0;break;case",":return f;default:/\s/.test(h)?f.endsWith(" ")||(f+=" "):f+=h}}return f}function Vi(g){let f="";for(;g.offset<g.input.length;){let p=g.input[g.offset++];if(/\s/.test(p))return Cr(f);if(f.length>=6||!/[\dA-Fa-f]/.test(p))return g.offset--,Cr(f);f+=p}return Cr(f)}function Cr(g){return String.fromCodePoint(parseInt(g,16))}var zn;async function Ir(g,f){if(!zn){if(typeof navigator<"u"&&"fonts"in navigator){try{let y=await navigator.permissions.request?.({name:"local-fonts"});if(y&&y.state!=="granted")throw new Error("Permission to access local fonts not granted.")}catch(y){if(y instanceof Error&&y.name!=="TypeError")throw y}let h={};try{let y=await navigator.fonts.query();for(let k of y)h.hasOwnProperty(k.family)||(h[k.family]=[]),h[k.family].push(k);zn=Promise.resolve(h)}catch(y){y instanceof Error&&console.error(y.name,y.message)}}else if(typeof window<"u"&&"queryLocalFonts"in window){let h={};try{let y=await window.queryLocalFonts();for(let k of y)h.hasOwnProperty(k.family)||(h[k.family]=[]),h[k.family].push(k);zn=Promise.resolve(h)}catch(y){y instanceof Error&&console.error(y.name,y.message)}}zn??=Promise.resolve({})}let p=await zn;for(let h of Or(g)){if(ih.includes(h))return;if(p.hasOwnProperty(h)&&p[h].length>0){let y=p[h][0];if("blob"in y){let T=await(await y.blob()).arrayBuffer();return Hi(T,{cacheSize:f})}return}}}var ih=["serif","sans-serif","cursive","fantasy","monospace","system-ui","emoji","math","fangsong"];var ah=1e5;function zi(g,f=[]){let p,h,y=0,k;return g.registerCharacterJoiner(T=>{let O=g.options.fontFamily;if(O&&(y===0||p!==O)){h=void 0,y=1,p=O;let w=p;Ir(w,ah).then(E=>{w===g.options.fontFamily&&(y=2,h=E,E&&g.refresh(0,g.rows-1))}).catch(E=>{w===g.options.fontFamily&&(y=3,g.options.logLevel==="debug"&&console.debug(k,new Error("Failure while loading font")),h=void 0,k=E)})}return h&&y===2?h.findLigatureRanges(T).map(w=>[w[0],w[1]]):lh(T,f)})}function lh(g,f){let p=[];for(let h=0;h<g.length;h++)for(let y=0;y<f.length;y++)if(g.startsWith(f[y],h)){p.push([h,h+f[y].length]),h+=f[y].length-1;break}return p}var ji=class{constructor(f){this._fallbackLigatures=(f?.fallbackLigatures??["<--","<---","<<-","<-","->","->>","-->","--->","<==","<===","<<=","<=","=>","=>>","==>","===>",">=",">>=","<->","<-->","<--->","<---->","<=>","<==>","<===>","<====>","::",":::","<~~","</","</>","/>","~~>","==","!=","/=","~=","<>","===","!==","!===","<:",":=","*=","*+","<*","<*>","*>","<|","<|>","|>","+*","=*","=:",":>","/*","*/","+++","<!--","<!---"]).sort((p,h)=>h.length-p.length),this._fontFeatureSettings=f?.fontFeatureSettings}activate(f){if(!f.element)throw new Error("Cannot activate LigaturesAddon before open is called");this._terminal=f,this._characterJoinerId=zi(f,this._fallbackLigatures),f.element.style.fontFeatureSettings=this._fontFeatureSettings??'"calt" on'}dispose(){this._characterJoinerId!==void 0&&(this._terminal?.deregisterCharacterJoiner(this._characterJoinerId),this._characterJoinerId=void 0),this._terminal?.element&&(this._terminal.element.style.fontFeatureSettings="")}};export{ji as LigaturesAddon};
20
20
  //# sourceMappingURL=addon-ligatures.mjs.map