@sailfish-ai/addon-ligatures 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,45 @@
1
+ Copyright (c) 2019, The xterm.js authors (https://github.com/xtermjs/xterm.js)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
20
+
21
+ ---
22
+
23
+ The code that analyzes font ligatures is forked from https://github.com/princjef/font-ligatures with this license:
24
+
25
+ MIT License
26
+
27
+ Copyright (c) 2018 Jeffrey Principe
28
+
29
+ Permission is hereby granted, free of charge, to any person obtaining a copy
30
+ of this software and associated documentation files (the "Software"), to deal
31
+ in the Software without restriction, including without limitation the rights
32
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
33
+ copies of the Software, and to permit persons to whom the Software is
34
+ furnished to do so, subject to the following conditions:
35
+
36
+ The above copyright notice and this permission notice shall be included in all
37
+ copies or substantial portions of the Software.
38
+
39
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
40
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
41
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
42
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
43
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
44
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
45
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,55 @@
1
+ ## @sailfish-ai/addon-ligatures
2
+
3
+ Add support for programming ligatures to [xterm.js] when running in environments with access to [Node.js] APIs (such as [Electron]).
4
+
5
+ ### Requirements
6
+
7
+ * [Node.js] 8.x or higher (present in [Electron] 1.8.3 or higher)
8
+ * [xterm.js] 4.0.0 or higher using the default canvas renderer
9
+
10
+ ### Install
11
+
12
+ ```bash
13
+ npm install --save @sailfish-ai/addon-ligatures
14
+ ```
15
+
16
+ ### Usage
17
+
18
+ ```ts
19
+ import { Terminal } from '@sailfish-ai/xterm';
20
+ import { LigaturesAddon } from '@sailfish-ai/addon-ligatures';
21
+
22
+ const terminal = new Terminal();
23
+ const ligaturesAddon = new LigaturesAddon();
24
+ terminal.open(containerElement);
25
+ terminal.loadAddon(ligaturesAddon);
26
+ ```
27
+
28
+ ### How It Works
29
+
30
+ In a browser environment, font ligature information is read directly by the web browser and used to render text correctly without any intervention from the developer. As of version 3, xterm.js uses the canvas to render characters individually, resulting in a significant performance boost. However, this means that it can no longer lean on the browser to determine when to draw font ligatures.
31
+
32
+ This package locates the font file on disk for the font currently in use by the terminal and parses the ligature information out of it (via the [font-ligatures] package). As text is rendered in xterm.js, this package annotates it with the locations of ligatures, allowing xterm.js to render it correctly.
33
+
34
+ Since this package depends on being able to find and resolve a system font from disk, it has to have system access that isn't available in the web browser. As a result, this package is mainly useful in environments that combine browser and Node.js runtimes (such as [Electron]).
35
+
36
+ ### Fallback Ligatures
37
+
38
+ When ligatures cannot be fetched from the environment, a set of "fallback" ligatures is used to get the most common ligatures working. These fallback ligatures can be customized with options passed to `LigatureAddon.constructor`.
39
+
40
+ ### Fonts
41
+
42
+ This package makes use of the following fonts for testing:
43
+
44
+ * [Fira Code][Fira Code] - [Licensed under the OFL][Fira Code License] by Nikita Prokopov, Mozilla Foundation with reserved names Fira Code, Fira Mono, and Fira Sans
45
+ * [Iosevka] - [Licensed under the OFL][Iosevka License] by Belleve Invis with reserved name Iosevka
46
+
47
+ [xterm.js]: https://github.com/xtermjs/xterm.js
48
+ [Electron]: https://electronjs.org/
49
+ [Node.js]: https://nodejs.org/
50
+ [font-ligatures]: https://github.com/princjef/font-ligatures
51
+ [Fira Code]: https://github.com/tonsky/FiraCode
52
+ [Fira Code License]: https://github.com/tonsky/FiraCode/blob/master/LICENSE
53
+ [Iosevka]: https://github.com/be5invis/Iosevka
54
+ [Iosevka License]: https://github.com/be5invis/Iosevka/blob/master/LICENSE.md
55
+
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
3
+ * @license MIT
4
+ *
5
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
6
+ * @license MIT
7
+ *
8
+ * Originally forked from (with the author's permission):
9
+ * Fabrice Bellard's javascript vt100 for jslinux:
10
+ * http://bellard.org/jslinux/
11
+ * Copyright (c) 2011 Fabrice Bellard
12
+ */
13
+ /*---------------------------------------------------------------------------------------------
14
+ * Copyright (c) Microsoft Corporation. All rights reserved.
15
+ * Licensed under the MIT License. See License.txt in the project root for license information.
16
+ *--------------------------------------------------------------------------------------------*/
17
+ var No=Object.create;var _n=Object.defineProperty;var Ho=Object.getOwnPropertyDescriptor;var _o=Object.getOwnPropertyNames;var zo=Object.getPrototypeOf,Wo=Object.prototype.hasOwnProperty;var tt=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(f,p)=>(typeof require<"u"?require:f)[p]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var Ur=(s,f)=>()=>(f||s((f={exports:{}}).exports,f),f.exports);var Vo=(s,f,p,h)=>{if(f&&typeof f=="object"||typeof f=="function")for(let v of _o(f))!Wo.call(s,v)&&v!==p&&_n(s,v,{get:()=>f[v],enumerable:!(h=Ho(f,v))||h.enumerable});return s};var zn=(s,f,p)=>(p=s!=null?No(zo(s)):{},Vo(f||!s||!s.__esModule?_n(p,"default",{value:s,enumerable:!0}):p,s));var Vn=Ur((Or,Wn)=>{(function(s,f){typeof Or=="object"&&typeof Wn<"u"?f(Or):typeof define=="function"&&define.amd?define(["exports"],f):f(s.opentype=s.opentype||{})})(Or,(function(s){"use strict";var f=0,p=-3;function h(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function v(e,r){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=r,this.destLen=0,this.ltree=new h,this.dtree=new h}var x=new h,S=new h,L=new Uint8Array(30),k=new Uint16Array(30),D=new Uint8Array(30),V=new Uint16Array(30),N=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),W=new h,X=new Uint8Array(320);function ve(e,r,t,n){var a,i;for(a=0;a<t;++a)e[a]=0;for(a=0;a<30-t;++a)e[a+t]=a/t|0;for(i=n,a=0;a<30;++a)r[a]=i,i+=1<<e[a]}function Ae(e,r){var t;for(t=0;t<7;++t)e.table[t]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,t=0;t<24;++t)e.trans[t]=256+t;for(t=0;t<144;++t)e.trans[24+t]=t;for(t=0;t<8;++t)e.trans[168+t]=280+t;for(t=0;t<112;++t)e.trans[176+t]=144+t;for(t=0;t<5;++t)r.table[t]=0;for(r.table[5]=32,t=0;t<32;++t)r.trans[t]=t}var xt=new Uint16Array(16);function Dr(e,r,t,n){var a,i;for(a=0;a<16;++a)e.table[a]=0;for(a=0;a<n;++a)e.table[r[t+a]]++;for(e.table[0]=0,i=0,a=0;a<16;++a)xt[a]=i,i+=e.table[a];for(a=0;a<n;++a)r[t+a]&&(e.trans[xt[r[t+a]]++]=a)}function la(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var r=e.tag&1;return e.tag>>>=1,r}function Se(e,r,t){if(!r)return t;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var n=e.tag&65535>>>16-r;return e.tag>>>=r,e.bitcount-=r,n+t}function Ar(e,r){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var t=0,n=0,a=0,i=e.tag;do n=2*n+(i&1),i>>>=1,++a,t+=r.table[a],n-=r.table[a];while(n>=0);return e.tag=i,e.bitcount-=a,r.trans[t+n]}function fa(e,r,t){var n,a,i,o,l,u;for(n=Se(e,5,257),a=Se(e,5,1),i=Se(e,4,4),o=0;o<19;++o)X[o]=0;for(o=0;o<i;++o){var c=Se(e,3,0);X[N[o]]=c}for(Dr(W,X,0,19),l=0;l<n+a;){var d=Ar(e,W);switch(d){case 16:var y=X[l-1];for(u=Se(e,2,3);u;--u)X[l++]=y;break;case 17:for(u=Se(e,3,3);u;--u)X[l++]=0;break;case 18:for(u=Se(e,7,11);u;--u)X[l++]=0;break;default:X[l++]=d;break}}Dr(r,X,0,n),Dr(t,X,n,a)}function St(e,r,t){for(;;){var n=Ar(e,r);if(n===256)return f;if(n<256)e.dest[e.destLen++]=n;else{var a,i,o,l;for(n-=257,a=Se(e,L[n],k[n]),i=Ar(e,t),o=e.destLen-Se(e,D[i],V[i]),l=o;l<o+a;++l)e.dest[e.destLen++]=e.dest[l]}}}function pa(e){for(var r,t,n;e.bitcount>8;)e.sourceIndex--,e.bitcount-=8;if(r=e.source[e.sourceIndex+1],r=256*r+e.source[e.sourceIndex],t=e.source[e.sourceIndex+3],t=256*t+e.source[e.sourceIndex+2],r!==(~t&65535))return p;for(e.sourceIndex+=4,n=r;n;--n)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,f}function ha(e,r){var t=new v(e,r),n,a,i;do{switch(n=la(t),a=Se(t,2,0),a){case 0:i=pa(t);break;case 1:i=St(t,x,S);break;case 2:fa(t,t.ltree,t.dtree),i=St(t,t.ltree,t.dtree);break;default:i=p}if(i!==f)throw new Error("Data error")}while(!n);return t.destLen<t.dest.length?typeof t.dest.slice=="function"?t.dest.slice(0,t.destLen):t.dest.subarray(0,t.destLen):t.dest}Ae(x,S),ve(L,k,4,3),ve(D,V,2,1),L[28]=0,k[28]=258;var ca=ha;function We(e,r,t,n,a){return Math.pow(1-a,3)*e+3*Math.pow(1-a,2)*a*r+3*(1-a)*Math.pow(a,2)*t+Math.pow(a,3)*n}function ke(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}ke.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},ke.prototype.addPoint=function(e,r){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 r=="number"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=r,this.y2=r),r<this.y1&&(this.y1=r),r>this.y2&&(this.y2=r))},ke.prototype.addX=function(e){this.addPoint(e,null)},ke.prototype.addY=function(e){this.addPoint(null,e)},ke.prototype.addBezier=function(e,r,t,n,a,i,o,l){var u=this,c=[e,r],d=[t,n],y=[a,i],g=[o,l];this.addPoint(e,r),this.addPoint(o,l);for(var m=0;m<=1;m++){var T=6*c[m]-12*d[m]+6*y[m],O=-3*c[m]+9*d[m]-9*y[m]+3*g[m],F=3*d[m]-3*c[m];if(O===0){if(T===0)continue;var U=-F/T;0<U&&U<1&&(m===0&&u.addX(We(c[m],d[m],y[m],g[m],U)),m===1&&u.addY(We(c[m],d[m],y[m],g[m],U)));continue}var P=Math.pow(T,2)-4*F*O;if(!(P<0)){var I=(-T+Math.sqrt(P))/(2*O);0<I&&I<1&&(m===0&&u.addX(We(c[m],d[m],y[m],g[m],I)),m===1&&u.addY(We(c[m],d[m],y[m],g[m],I)));var H=(-T-Math.sqrt(P))/(2*O);0<H&&H<1&&(m===0&&u.addX(We(c[m],d[m],y[m],g[m],H)),m===1&&u.addY(We(c[m],d[m],y[m],g[m],H)))}}},ke.prototype.addQuad=function(e,r,t,n,a,i){var o=e+.6666666666666666*(t-e),l=r+2/3*(n-r),u=o+1/3*(a-e),c=l+1/3*(i-r);this.addBezier(e,r,o,l,u,c,a,i)};function Z(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}Z.prototype.moveTo=function(e,r){this.commands.push({type:"M",x:e,y:r})},Z.prototype.lineTo=function(e,r){this.commands.push({type:"L",x:e,y:r})},Z.prototype.curveTo=Z.prototype.bezierCurveTo=function(e,r,t,n,a,i){this.commands.push({type:"C",x1:e,y1:r,x2:t,y2:n,x:a,y:i})},Z.prototype.quadTo=Z.prototype.quadraticCurveTo=function(e,r,t,n){this.commands.push({type:"Q",x1:e,y1:r,x:t,y:n})},Z.prototype.close=Z.prototype.closePath=function(){this.commands.push({type:"Z"})},Z.prototype.extend=function(e){if(e.commands)e=e.commands;else if(e instanceof ke){var r=e;this.moveTo(r.x1,r.y1),this.lineTo(r.x2,r.y1),this.lineTo(r.x2,r.y2),this.lineTo(r.x1,r.y2),this.close();return}Array.prototype.push.apply(this.commands,e)},Z.prototype.getBoundingBox=function(){for(var e=this,r=new ke,t=0,n=0,a=0,i=0,o=0;o<this.commands.length;o++){var l=e.commands[o];switch(l.type){case"M":r.addPoint(l.x,l.y),t=a=l.x,n=i=l.y;break;case"L":r.addPoint(l.x,l.y),a=l.x,i=l.y;break;case"Q":r.addQuad(a,i,l.x1,l.y1,l.x,l.y),a=l.x,i=l.y;break;case"C":r.addBezier(a,i,l.x1,l.y1,l.x2,l.y2,l.x,l.y),a=l.x,i=l.y;break;case"Z":a=t,i=n;break;default:throw new Error("Unexpected path command "+l.type)}}return r.isEmpty()&&r.addPoint(0,0),r},Z.prototype.draw=function(e){var r=this;e.beginPath();for(var t=0;t<this.commands.length;t+=1){var n=r.commands[t];n.type==="M"?e.moveTo(n.x,n.y):n.type==="L"?e.lineTo(n.x,n.y):n.type==="C"?e.bezierCurveTo(n.x1,n.y1,n.x2,n.y2,n.x,n.y):n.type==="Q"?e.quadraticCurveTo(n.x1,n.y1,n.x,n.y):n.type==="Z"&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())},Z.prototype.toPathData=function(e){var r=this;e=e!==void 0?e:2;function t(l){return Math.round(l)===l?""+Math.round(l):l.toFixed(e)}function n(){for(var l=arguments,u="",c=0;c<arguments.length;c+=1){var d=l[c];d>=0&&c>0&&(u+=" "),u+=t(d)}return u}for(var a="",i=0;i<this.commands.length;i+=1){var o=r.commands[i];o.type==="M"?a+="M"+n(o.x,o.y):o.type==="L"?a+="L"+n(o.x,o.y):o.type==="C"?a+="C"+n(o.x1,o.y1,o.x2,o.y2,o.x,o.y):o.type==="Q"?a+="Q"+n(o.x1,o.y1,o.x,o.y):o.type==="Z"&&(a+="Z")}return a},Z.prototype.toSVG=function(e){var r='<path d="';return r+=this.toPathData(e),r+='"',this.fill&&this.fill!=="black"&&(this.fill===null?r+=' fill="none"':r+=' fill="'+this.fill+'"'),this.stroke&&(r+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),r+="/>",r},Z.prototype.toDOMElement=function(e){var r=this.toPathData(e),t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d",r),t};function Tt(e){throw new Error(e)}function kt(e,r){e||Tt(r)}var G={fail:Tt,argument:kt,assert:kt},Ft=32768,Lt=2147483648,Ve={},E={},M={};function ge(e){return function(){return e}}E.BYTE=function(e){return G.argument(e>=0&&e<=255,"Byte value should be between 0 and 255."),[e]},M.BYTE=ge(1),E.CHAR=function(e){return[e.charCodeAt(0)]},M.CHAR=ge(1),E.CHARARRAY=function(e){for(var r=[],t=0;t<e.length;t+=1)r[t]=e.charCodeAt(t);return r},M.CHARARRAY=function(e){return e.length},E.USHORT=function(e){return[e>>8&255,e&255]},M.USHORT=ge(2),E.SHORT=function(e){return e>=Ft&&(e=-(2*Ft-e)),[e>>8&255,e&255]},M.SHORT=ge(2),E.UINT24=function(e){return[e>>16&255,e>>8&255,e&255]},M.UINT24=ge(3),E.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]},M.ULONG=ge(4),E.LONG=function(e){return e>=Lt&&(e=-(2*Lt-e)),[e>>24&255,e>>16&255,e>>8&255,e&255]},M.LONG=ge(4),E.FIXED=E.ULONG,M.FIXED=M.ULONG,E.FWORD=E.SHORT,M.FWORD=M.SHORT,E.UFWORD=E.USHORT,M.UFWORD=M.USHORT,E.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,e&255]},M.LONGDATETIME=ge(8),E.TAG=function(e){return G.argument(e.length===4,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},M.TAG=ge(4),E.Card8=E.BYTE,M.Card8=M.BYTE,E.Card16=E.USHORT,M.Card16=M.USHORT,E.OffSize=E.BYTE,M.OffSize=M.BYTE,E.SID=E.USHORT,M.SID=M.USHORT,E.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?E.NUMBER16(e):E.NUMBER32(e)},M.NUMBER=function(e){return E.NUMBER(e).length},E.NUMBER16=function(e){return[28,e>>8&255,e&255]},M.NUMBER16=ge(3),E.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,e&255]},M.NUMBER32=ge(5),E.REAL=function(e){var r=e.toString(),t=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(r);if(t){var n=parseFloat("1e"+((t[2]?+t[2]:0)+t[1].length));r=(Math.round(e*n)/n).toString()}for(var a="",i=0,o=r.length;i<o;i+=1){var l=r[i];l==="e"?a+=r[++i]==="-"?"c":"b":l==="."?a+="a":l==="-"?a+="e":a+=l}a+=a.length&1?"f":"ff";for(var u=[30],c=0,d=a.length;c<d;c+=2)u.push(parseInt(a.substr(c,2),16));return u},M.REAL=function(e){return E.REAL(e).length},E.NAME=E.CHARARRAY,M.NAME=M.CHARARRAY,E.STRING=E.CHARARRAY,M.STRING=M.CHARARRAY,Ve.UTF8=function(e,r,t){for(var n=[],a=t,i=0;i<a;i++,r+=1)n[i]=e.getUint8(r);return String.fromCharCode.apply(null,n)},Ve.UTF16=function(e,r,t){for(var n=[],a=t/2,i=0;i<a;i++,r+=2)n[i]=e.getUint16(r);return String.fromCharCode.apply(null,n)},E.UTF16=function(e){for(var r=[],t=0;t<e.length;t+=1){var n=e.charCodeAt(t);r[r.length]=n>>8&255,r[r.length]=n&255}return r},M.UTF16=function(e){return e.length*2};var Mr={"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"};Ve.MACSTRING=function(e,r,t,n){var a=Mr[n];if(a!==void 0){for(var i="",o=0;o<t;o++){var l=e.getUint8(r+o);l<=127?i+=String.fromCharCode(l):i+=a[l&127]}return i}};var fr=typeof WeakMap=="function"&&new WeakMap,pr,va=function(e){if(!pr){pr={};for(var r in Mr)pr[r]=new String(r)}var t=pr[e];if(t!==void 0){if(fr){var n=fr.get(t);if(n!==void 0)return n}var a=Mr[e];if(a!==void 0){for(var i={},o=0;o<a.length;o++)i[a.charCodeAt(o)]=o+128;return fr&&fr.set(t,i),i}}};E.MACSTRING=function(e,r){var t=va(r);if(t!==void 0){for(var n=[],a=0;a<e.length;a++){var i=e.charCodeAt(a);if(i>=128&&(i=t[i],i===void 0))return;n[a]=i}return n}},M.MACSTRING=function(e,r){var t=E.MACSTRING(e,r);return t!==void 0?t.length:0};function Br(e){return e>=-128&&e<=127}function da(e,r,t){for(var n=0,a=e.length;r<a&&n<64&&e[r]===0;)++r,++n;return t.push(128|n-1),r}function ga(e,r,t){for(var n=0,a=e.length,i=r;i<a&&n<64;){var o=e[i];if(!Br(o)||o===0&&i+1<a&&e[i+1]===0)break;++i,++n}t.push(n-1);for(var l=r;l<i;++l)t.push(e[l]+256&255);return i}function ma(e,r,t){for(var n=0,a=e.length,i=r;i<a&&n<64;){var o=e[i];if(o===0||Br(o)&&i+1<a&&Br(e[i+1]))break;++i,++n}t.push(64|n-1);for(var l=r;l<i;++l){var u=e[l];t.push(u+65536>>8&255,u+256&255)}return i}E.VARDELTAS=function(e){for(var r=0,t=[];r<e.length;){var n=e[r];n===0?r=da(e,r,t):n>=-128&&n<=127?r=ga(e,r,t):r=ma(e,r,t)}return t},E.INDEX=function(e){for(var r=1,t=[r],n=[],a=0;a<e.length;a+=1){var i=E.OBJECT(e[a]);Array.prototype.push.apply(n,i),r+=i.length,t.push(r)}if(n.length===0)return[0,0];for(var o=[],l=1+Math.floor(Math.log(r)/Math.log(2))/8|0,u=[void 0,E.BYTE,E.USHORT,E.UINT24,E.ULONG][l],c=0;c<t.length;c+=1){var d=u(t[c]);Array.prototype.push.apply(o,d)}return Array.prototype.concat(E.Card16(e.length),E.OffSize(l),o,n)},M.INDEX=function(e){return E.INDEX(e).length},E.DICT=function(e){for(var r=[],t=Object.keys(e),n=t.length,a=0;a<n;a+=1){var i=parseInt(t[a],0),o=e[i];r=r.concat(E.OPERAND(o.value,o.type)),r=r.concat(E.OPERATOR(i))}return r},M.DICT=function(e){return E.DICT(e).length},E.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},E.OPERAND=function(e,r){var t=[];if(Array.isArray(r))for(var n=0;n<r.length;n+=1)G.argument(e.length===r.length,"Not enough arguments given for type"+r),t=t.concat(E.OPERAND(e[n],r[n]));else if(r==="SID")t=t.concat(E.NUMBER(e));else if(r==="offset")t=t.concat(E.NUMBER32(e));else if(r==="number")t=t.concat(E.NUMBER(e));else if(r==="real")t=t.concat(E.REAL(e));else throw new Error("Unknown operand type "+r);return t},E.OP=E.BYTE,M.OP=M.BYTE;var hr=typeof WeakMap=="function"&&new WeakMap;E.CHARSTRING=function(e){if(hr){var r=hr.get(e);if(r!==void 0)return r}for(var t=[],n=e.length,a=0;a<n;a+=1){var i=e[a];t=t.concat(E[i.type](i.value))}return hr&&hr.set(e,t),t},M.CHARSTRING=function(e){return E.CHARSTRING(e).length},E.OBJECT=function(e){var r=E[e.type];return G.argument(r!==void 0,"No encoding function for type "+e.type),r(e.value)},M.OBJECT=function(e){var r=M[e.type];return G.argument(r!==void 0,"No sizeOf function for type "+e.type),r(e.value)},E.TABLE=function(e){for(var r=[],t=e.fields.length,n=[],a=[],i=0;i<t;i+=1){var o=e.fields[i],l=E[o.type];G.argument(l!==void 0,"No encoding function for field type "+o.type+" ("+o.name+")");var u=e[o.name];u===void 0&&(u=o.value);var c=l(u);o.type==="TABLE"?(a.push(r.length),r=r.concat([0,0]),n.push(c)):r=r.concat(c)}for(var d=0;d<n.length;d+=1){var y=a[d],g=r.length;G.argument(g<65536,"Table "+e.tableName+" too big."),r[y]=g>>8,r[y+1]=g&255,r=r.concat(n[d])}return r},M.TABLE=function(e){for(var r=0,t=e.fields.length,n=0;n<t;n+=1){var a=e.fields[n],i=M[a.type];G.argument(i!==void 0,"No sizeOf function for field type "+a.type+" ("+a.name+")");var o=e[a.name];o===void 0&&(o=a.value),r+=i(o),a.type==="TABLE"&&(r+=2)}return r},E.RECORD=E.TABLE,M.RECORD=M.TABLE,E.LITERAL=function(e){return e},M.LITERAL=function(e){return e.length};function ee(e,r,t){for(var n=this,a=0;a<r.length;a+=1){var i=r[a];n[i.name]=i.value}if(this.tableName=e,this.fields=r,t)for(var o=Object.keys(t),l=0;l<o.length;l+=1){var u=o[l],c=t[u];n[u]!==void 0&&(n[u]=c)}}ee.prototype.encode=function(){return E.TABLE(this)},ee.prototype.sizeOf=function(){return M.TABLE(this)};function $e(e,r,t){t===void 0&&(t=r.length);var n=new Array(r.length+1);n[0]={name:e+"Count",type:"USHORT",value:t};for(var a=0;a<r.length;a++)n[a+1]={name:e+a,type:"USHORT",value:r[a]};return n}function Pr(e,r,t){var n=r.length,a=new Array(n+1);a[0]={name:e+"Count",type:"USHORT",value:n};for(var i=0;i<n;i++)a[i+1]={name:e+i,type:"TABLE",value:t(r[i],i)};return a}function cr(e,r,t){var n=r.length,a=[];a[0]={name:e+"Count",type:"USHORT",value:n};for(var i=0;i<n;i++)a=a.concat(t(r[i],i));return a}function vr(e){e.format===1?ee.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat($e("glyph",e.glyphs))):G.assert(!1,"Can't create coverage table format 2 yet.")}vr.prototype=Object.create(ee.prototype),vr.prototype.constructor=vr;function dr(e){ee.call(this,"scriptListTable",cr("scriptRecord",e,function(r,t){var n=r.script,a=n.defaultLangSys;return G.assert(!!a,"Unable to write GSUB: script "+r.tag+" has no default language system."),[{name:"scriptTag"+t,type:"TAG",value:r.tag},{name:"script"+t,type:"TABLE",value:new ee("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new ee("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:a.reqFeatureIndex}].concat($e("featureIndex",a.featureIndexes)))}].concat(cr("langSys",n.langSysRecords,function(i,o){var l=i.langSys;return[{name:"langSysTag"+o,type:"TAG",value:i.tag},{name:"langSys"+o,type:"TABLE",value:new ee("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:l.reqFeatureIndex}].concat($e("featureIndex",l.featureIndexes)))}]})))}]}))}dr.prototype=Object.create(ee.prototype),dr.prototype.constructor=dr;function gr(e){ee.call(this,"featureListTable",cr("featureRecord",e,function(r,t){var n=r.feature;return[{name:"featureTag"+t,type:"TAG",value:r.tag},{name:"feature"+t,type:"TABLE",value:new ee("featureTable",[{name:"featureParams",type:"USHORT",value:n.featureParams}].concat($e("lookupListIndex",n.lookupListIndexes)))}]}))}gr.prototype=Object.create(ee.prototype),gr.prototype.constructor=gr;function mr(e,r){ee.call(this,"lookupListTable",Pr("lookup",e,function(t){var n=r[t.lookupType];return G.assert(!!n,"Unable to write GSUB lookup type "+t.lookupType+" tables."),new ee("lookupTable",[{name:"lookupType",type:"USHORT",value:t.lookupType},{name:"lookupFlag",type:"USHORT",value:t.lookupFlag}].concat(Pr("subtable",t.subtables,n)))}))}mr.prototype=Object.create(ee.prototype),mr.prototype.constructor=mr;var A={Table:ee,Record:ee,Coverage:vr,ScriptList:dr,FeatureList:gr,LookupList:mr,ushortList:$e,tableList:Pr,recordList:cr};function Et(e,r){return e.getUint8(r)}function yr(e,r){return e.getUint16(r,!1)}function ya(e,r){return e.getInt16(r,!1)}function Gr(e,r){return e.getUint32(r,!1)}function Ut(e,r){var t=e.getInt16(r,!1),n=e.getUint16(r+2,!1);return t+n/65535}function ba(e,r){for(var t="",n=r;n<r+4;n+=1)t+=String.fromCharCode(e.getInt8(n));return t}function xa(e,r,t){for(var n=0,a=0;a<t;a+=1)n<<=8,n+=e.getUint8(r+a);return n}function Sa(e,r,t){for(var n=[],a=r;a<t;a+=1)n.push(e.getUint8(a));return n}function Ta(e){for(var r="",t=0;t<e.length;t+=1)r+=String.fromCharCode(e[t]);return r}var ka={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function b(e,r){this.data=e,this.offset=r,this.relativeOffset=0}b.prototype.parseByte=function(){var e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},b.prototype.parseChar=function(){var e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},b.prototype.parseCard8=b.prototype.parseByte,b.prototype.parseUShort=function(){var e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},b.prototype.parseCard16=b.prototype.parseUShort,b.prototype.parseSID=b.prototype.parseUShort,b.prototype.parseOffset16=b.prototype.parseUShort,b.prototype.parseShort=function(){var e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},b.prototype.parseF2Dot14=function(){var e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e},b.prototype.parseULong=function(){var e=Gr(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},b.prototype.parseOffset32=b.prototype.parseULong,b.prototype.parseFixed=function(){var e=Ut(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},b.prototype.parseString=function(e){var r=this.data,t=this.offset+this.relativeOffset,n="";this.relativeOffset+=e;for(var a=0;a<e;a++)n+=String.fromCharCode(r.getUint8(t+a));return n},b.prototype.parseTag=function(){return this.parseString(4)},b.prototype.parseLongDateTime=function(){var e=Gr(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e},b.prototype.parseVersion=function(e){var r=yr(this.data,this.offset+this.relativeOffset),t=yr(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,e===void 0&&(e=4096),r+t/e/10},b.prototype.skip=function(e,r){r===void 0&&(r=1),this.relativeOffset+=ka[e]*r},b.prototype.parseULongList=function(e){e===void 0&&(e=this.parseULong());for(var r=new Array(e),t=this.data,n=this.offset+this.relativeOffset,a=0;a<e;a++)r[a]=t.getUint32(n),n+=4;return this.relativeOffset+=e*4,r},b.prototype.parseOffset16List=b.prototype.parseUShortList=function(e){e===void 0&&(e=this.parseUShort());for(var r=new Array(e),t=this.data,n=this.offset+this.relativeOffset,a=0;a<e;a++)r[a]=t.getUint16(n),n+=2;return this.relativeOffset+=e*2,r},b.prototype.parseShortList=function(e){for(var r=new Array(e),t=this.data,n=this.offset+this.relativeOffset,a=0;a<e;a++)r[a]=t.getInt16(n),n+=2;return this.relativeOffset+=e*2,r},b.prototype.parseByteList=function(e){for(var r=new Array(e),t=this.data,n=this.offset+this.relativeOffset,a=0;a<e;a++)r[a]=t.getUint8(n++);return this.relativeOffset+=e,r},b.prototype.parseList=function(e,r){var t=this;r||(r=e,e=this.parseUShort());for(var n=new Array(e),a=0;a<e;a++)n[a]=r.call(t);return n},b.prototype.parseList32=function(e,r){var t=this;r||(r=e,e=this.parseULong());for(var n=new Array(e),a=0;a<e;a++)n[a]=r.call(t);return n},b.prototype.parseRecordList=function(e,r){var t=this;r||(r=e,e=this.parseUShort());for(var n=new Array(e),a=Object.keys(r),i=0;i<e;i++){for(var o={},l=0;l<a.length;l++){var u=a[l],c=r[u];o[u]=c.call(t)}n[i]=o}return n},b.prototype.parseRecordList32=function(e,r){var t=this;r||(r=e,e=this.parseULong());for(var n=new Array(e),a=Object.keys(r),i=0;i<e;i++){for(var o={},l=0;l<a.length;l++){var u=a[l],c=r[u];o[u]=c.call(t)}n[i]=o}return n},b.prototype.parseStruct=function(e){var r=this;if(typeof e=="function")return e.call(this);for(var t=Object.keys(e),n={},a=0;a<t.length;a++){var i=t[a],o=e[i];n[i]=o.call(r)}return n},b.prototype.parseValueRecord=function(e){if(e===void 0&&(e=this.parseUShort()),e!==0){var r={};return e&1&&(r.xPlacement=this.parseShort()),e&2&&(r.yPlacement=this.parseShort()),e&4&&(r.xAdvance=this.parseShort()),e&8&&(r.yAdvance=this.parseShort()),e&16&&(r.xPlaDevice=void 0,this.parseShort()),e&32&&(r.yPlaDevice=void 0,this.parseShort()),e&64&&(r.xAdvDevice=void 0,this.parseShort()),e&128&&(r.yAdvDevice=void 0,this.parseShort()),r}},b.prototype.parseValueRecordList=function(){for(var e=this,r=this.parseUShort(),t=this.parseUShort(),n=new Array(t),a=0;a<t;a++)n[a]=e.parseValueRecord(r);return n},b.prototype.parsePointer=function(e){var r=this.parseOffset16();if(r>0)return new b(this.data,this.offset+r).parseStruct(e)},b.prototype.parsePointer32=function(e){var r=this.parseOffset32();if(r>0)return new b(this.data,this.offset+r).parseStruct(e)},b.prototype.parseListOfLists=function(e){for(var r=this,t=this.parseOffset16List(),n=t.length,a=this.relativeOffset,i=new Array(n),o=0;o<n;o++){var l=t[o];if(l===0){i[o]=void 0;continue}if(r.relativeOffset=l,e){for(var u=r.parseOffset16List(),c=new Array(u.length),d=0;d<u.length;d++)r.relativeOffset=l+u[d],c[d]=e.call(r);i[o]=c}else i[o]=r.parseUShortList()}return this.relativeOffset=a,i},b.prototype.parseCoverage=function(){var e=this,r=this.offset+this.relativeOffset,t=this.parseUShort(),n=this.parseUShort();if(t===1)return{format:1,glyphs:this.parseUShortList(n)};if(t===2){for(var a=new Array(n),i=0;i<n;i++)a[i]={start:e.parseUShort(),end:e.parseUShort(),index:e.parseUShort()};return{format:2,ranges:a}}throw new Error("0x"+r.toString(16)+": Coverage format must be 1 or 2.")},b.prototype.parseClassDef=function(){var e=this.offset+this.relativeOffset,r=this.parseUShort();if(r===1)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(r===2)return{format:2,ranges:this.parseRecordList({start:b.uShort,end:b.uShort,classId:b.uShort})};throw new Error("0x"+e.toString(16)+": ClassDef format must be 1 or 2.")},b.list=function(e,r){return function(){return this.parseList(e,r)}},b.list32=function(e,r){return function(){return this.parseList32(e,r)}},b.recordList=function(e,r){return function(){return this.parseRecordList(e,r)}},b.recordList32=function(e,r){return function(){return this.parseRecordList32(e,r)}},b.pointer=function(e){return function(){return this.parsePointer(e)}},b.pointer32=function(e){return function(){return this.parsePointer32(e)}},b.tag=b.prototype.parseTag,b.byte=b.prototype.parseByte,b.uShort=b.offset16=b.prototype.parseUShort,b.uShortList=b.prototype.parseUShortList,b.uLong=b.offset32=b.prototype.parseULong,b.uLongList=b.prototype.parseULongList,b.struct=b.prototype.parseStruct,b.coverage=b.prototype.parseCoverage,b.classDef=b.prototype.parseClassDef;var Ot={reserved:b.uShort,reqFeatureIndex:b.uShort,featureIndexes:b.uShortList};b.prototype.parseScriptList=function(){return this.parsePointer(b.recordList({tag:b.tag,script:b.pointer({defaultLangSys:b.pointer(Ot),langSysRecords:b.recordList({tag:b.tag,langSys:b.pointer(Ot)})})}))||[]},b.prototype.parseFeatureList=function(){return this.parsePointer(b.recordList({tag:b.tag,feature:b.pointer({featureParams:b.offset16,lookupListIndexes:b.uShortList})}))||[]},b.prototype.parseLookupList=function(e){return this.parsePointer(b.list(b.pointer(function(){var r=this.parseUShort();G.argument(1<=r&&r<=9,"GPOS/GSUB lookup type "+r+" unknown.");var t=this.parseUShort(),n=t&16;return{lookupType:r,lookupFlag:t,subtables:this.parseList(b.pointer(e[r])),markFilteringSet:n?this.parseUShort():void 0}})))||[]},b.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){var e=this.parseUShort(),r=this.parseUShort();G.argument(e===1&&r<1,"GPOS/GSUB feature variations table unknown.");var t=this.parseRecordList32({conditionSetOffset:b.offset32,featureTableSubstitutionOffset:b.offset32});return t})||[]};var w={getByte:Et,getCard8:Et,getUShort:yr,getCard16:yr,getShort:ya,getULong:Gr,getFixed:Ut,getTag:ba,getOffset:xa,getBytes:Sa,bytesToString:Ta,Parser:b};function Fa(e,r){r.parseUShort(),e.length=r.parseULong(),e.language=r.parseULong();var t;e.groupCount=t=r.parseULong(),e.glyphIndexMap={};for(var n=0;n<t;n+=1)for(var a=r.parseULong(),i=r.parseULong(),o=r.parseULong(),l=a;l<=i;l+=1)e.glyphIndexMap[l]=o,o++}function La(e,r,t,n,a){e.length=r.parseUShort(),e.language=r.parseUShort();var i;e.segCount=i=r.parseUShort()>>1,r.skip("uShort",3),e.glyphIndexMap={};for(var o=new w.Parser(t,n+a+14),l=new w.Parser(t,n+a+16+i*2),u=new w.Parser(t,n+a+16+i*4),c=new w.Parser(t,n+a+16+i*6),d=n+a+16+i*8,y=0;y<i-1;y+=1)for(var g=void 0,m=o.parseUShort(),T=l.parseUShort(),O=u.parseShort(),F=c.parseUShort(),U=T;U<=m;U+=1)F!==0?(d=c.offset+c.relativeOffset-2,d+=F,d+=(U-T)*2,g=w.getUShort(t,d),g!==0&&(g=g+O&65535)):g=U+O&65535,e.glyphIndexMap[U]=g}function Ea(e,r){var t={};t.version=w.getUShort(e,r),G.argument(t.version===0,"cmap table version should be 0."),t.numTables=w.getUShort(e,r+2);for(var n=-1,a=t.numTables-1;a>=0;a-=1){var i=w.getUShort(e,r+4+a*8),o=w.getUShort(e,r+4+a*8+2);if(i===3&&(o===0||o===1||o===10)){n=w.getULong(e,r+4+a*8+4);break}}if(n===-1)throw new Error("No valid cmap sub-tables found.");var l=new w.Parser(e,r+n);if(t.format=l.parseUShort(),t.format===12)Fa(t,l);else if(t.format===4)La(t,l,e,r,n);else throw new Error("Only format 4 and 12 cmap tables are supported (found format "+t.format+").");return t}function Ua(e,r,t){e.segments.push({end:r,start:r,delta:-(r-t),offset:0,glyphIndex:t})}function Oa(e){e.segments.push({end:65535,start:65535,delta:1,offset:0})}function Ia(e){var r=!0,t;for(t=e.length-1;t>0;t-=1){var n=e.get(t);if(n.unicode>65535){console.log("Adding CMAP format 12 (needed!)"),r=!1;break}}var a=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:r?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:r?12:20}];r||(a=a.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),a=a.concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);var i=new A.Table("cmap",a);for(i.segments=[],t=0;t<e.length;t+=1){for(var o=e.get(t),l=0;l<o.unicodes.length;l+=1)Ua(i,o.unicodes[l],t);i.segments=i.segments.sort(function(P,I){return P.start-I.start})}Oa(i);var u=i.segments.length,c=0,d=[],y=[],g=[],m=[],T=[],O=[];for(t=0;t<u;t+=1){var F=i.segments[t];F.end<=65535&&F.start<=65535?(d=d.concat({name:"end_"+t,type:"USHORT",value:F.end}),y=y.concat({name:"start_"+t,type:"USHORT",value:F.start}),g=g.concat({name:"idDelta_"+t,type:"SHORT",value:F.delta}),m=m.concat({name:"idRangeOffset_"+t,type:"USHORT",value:F.offset}),F.glyphId!==void 0&&(T=T.concat({name:"glyph_"+t,type:"USHORT",value:F.glyphId}))):c+=1,!r&&F.glyphIndex!==void 0&&(O=O.concat({name:"cmap12Start_"+t,type:"ULONG",value:F.start}),O=O.concat({name:"cmap12End_"+t,type:"ULONG",value:F.end}),O=O.concat({name:"cmap12Glyph_"+t,type:"ULONG",value:F.glyphIndex}))}if(i.segCountX2=(u-c)*2,i.searchRange=Math.pow(2,Math.floor(Math.log(u-c)/Math.log(2)))*2,i.entrySelector=Math.log(i.searchRange/2)/Math.log(2),i.rangeShift=i.segCountX2-i.searchRange,i.fields=i.fields.concat(d),i.fields.push({name:"reservedPad",type:"USHORT",value:0}),i.fields=i.fields.concat(y),i.fields=i.fields.concat(g),i.fields=i.fields.concat(m),i.fields=i.fields.concat(T),i.cmap4Length=14+d.length*2+2+y.length*2+g.length*2+m.length*2+T.length*2,!r){var U=16+O.length*4;i.cmap12Offset=20+i.cmap4Length,i.fields=i.fields.concat([{name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:U},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:O.length/3}]),i.fields=i.fields.concat(O)}return i}var It={parse:Ea,make:Ia},br=[".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"],Ca=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],wa=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],Me=[".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 Ct(e){this.font=e}Ct.prototype.charToGlyphIndex=function(e){var r=e.charCodeAt(0),t=this.font.glyphs;if(t){for(var n=0;n<t.length;n+=1)for(var a=t.get(n),i=0;i<a.unicodes.length;i+=1)if(a.unicodes[i]===r)return n}return null};function wt(e){this.cmap=e}wt.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.charCodeAt(0)]||0};function xr(e,r){this.encoding=e,this.charset=r}xr.prototype.charToGlyphIndex=function(e){var r=e.charCodeAt(0),t=this.encoding[r];return this.charset.indexOf(t)};function Nr(e){var r=this;switch(e.version){case 1:this.names=Me.slice();break;case 2:this.names=new Array(e.numberOfGlyphs);for(var t=0;t<e.numberOfGlyphs;t++)e.glyphNameIndex[t]<Me.length?r.names[t]=Me[e.glyphNameIndex[t]]:r.names[t]=e.names[e.glyphNameIndex[t]-Me.length];break;case 2.5:this.names=new Array(e.numberOfGlyphs);for(var n=0;n<e.numberOfGlyphs;n++)r.names[n]=Me[n+e.glyphNameIndex[n]];break;case 3:this.names=[];break;default:this.names=[];break}}Nr.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)},Nr.prototype.glyphIndexToName=function(e){return this.names[e]};function Ra(e){for(var r,t=e.tables.cmap.glyphIndexMap,n=Object.keys(t),a=0;a<n.length;a+=1){var i=n[a],o=t[i];r=e.glyphs.get(o),r.addUnicode(parseInt(i))}for(var l=0;l<e.glyphs.length;l+=1)r=e.glyphs.get(l),e.cffEncoding?e.isCIDFont?r.name="gid"+l:r.name=e.cffEncoding.charset[l]:e.glyphNames.names&&(r.name=e.glyphNames.glyphIndexToName(l))}function Da(e,r,t,n,a){e.beginPath(),e.moveTo(r,t),e.lineTo(n,a),e.stroke()}var Be={line:Da};function Rt(e,r,t,n,a){var i;return(r&n)>0?(i=e.parseByte(),(r&a)===0&&(i=-i),i=t+i):(r&a)>0?i=t:i=t+e.parseShort(),i}function Aa(e,r,t){var n=new w.Parser(r,t);e.numberOfContours=n.parseShort(),e._xMin=n.parseShort(),e._yMin=n.parseShort(),e._xMax=n.parseShort(),e._yMax=n.parseShort();var a,i;if(e.numberOfContours>0){for(var o=e.endPointIndices=[],l=0;l<e.numberOfContours;l+=1)o.push(n.parseUShort());e.instructionLength=n.parseUShort(),e.instructions=[];for(var u=0;u<e.instructionLength;u+=1)e.instructions.push(n.parseByte());var c=o[o.length-1]+1;a=[];for(var d=0;d<c;d+=1)if(i=n.parseByte(),a.push(i),(i&8)>0)for(var y=n.parseByte(),g=0;g<y;g+=1)a.push(i),d+=1;if(G.argument(a.length===c,"Bad flags."),o.length>0){var m=[],T;if(c>0){for(var O=0;O<c;O+=1)i=a[O],T={},T.onCurve=!!(i&1),T.lastPointOfContour=o.indexOf(O)>=0,m.push(T);for(var F=0,U=0;U<c;U+=1)i=a[U],T=m[U],T.x=Rt(n,i,F,2,16),F=T.x;for(var P=0,I=0;I<c;I+=1)i=a[I],T=m[I],T.y=Rt(n,i,P,4,32),P=T.y}e.points=m}else e.points=[]}else if(e.numberOfContours===0)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];for(var H=!0;H;){a=n.parseUShort();var R={glyphIndex:n.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(a&1)>0?(a&2)>0?(R.dx=n.parseShort(),R.dy=n.parseShort()):R.matchedPoints=[n.parseUShort(),n.parseUShort()]:(a&2)>0?(R.dx=n.parseChar(),R.dy=n.parseChar()):R.matchedPoints=[n.parseByte(),n.parseByte()],(a&8)>0?R.xScale=R.yScale=n.parseF2Dot14():(a&64)>0?(R.xScale=n.parseF2Dot14(),R.yScale=n.parseF2Dot14()):(a&128)>0&&(R.xScale=n.parseF2Dot14(),R.scale01=n.parseF2Dot14(),R.scale10=n.parseF2Dot14(),R.yScale=n.parseF2Dot14()),e.components.push(R),H=!!(a&32)}if(a&256){e.instructionLength=n.parseUShort(),e.instructions=[];for(var B=0;B<e.instructionLength;B+=1)e.instructions.push(n.parseByte())}}}function Hr(e,r){for(var t=[],n=0;n<e.length;n+=1){var a=e[n],i={x:r.xScale*a.x+r.scale01*a.y+r.dx,y:r.scale10*a.x+r.yScale*a.y+r.dy,onCurve:a.onCurve,lastPointOfContour:a.lastPointOfContour};t.push(i)}return t}function Ma(e){for(var r=[],t=[],n=0;n<e.length;n+=1){var a=e[n];t.push(a),a.lastPointOfContour&&(r.push(t),t=[])}return G.argument(t.length===0,"There are still points left in the current contour."),r}function Dt(e){var r=new Z;if(!e)return r;for(var t=Ma(e),n=0;n<t.length;++n){var a=t[n],i=null,o=a[a.length-1],l=a[0];if(o.onCurve)r.moveTo(o.x,o.y);else if(l.onCurve)r.moveTo(l.x,l.y);else{var u={x:(o.x+l.x)*.5,y:(o.y+l.y)*.5};r.moveTo(u.x,u.y)}for(var c=0;c<a.length;++c)if(i=o,o=l,l=a[(c+1)%a.length],o.onCurve)r.lineTo(o.x,o.y);else{var d=i,y=l;i.onCurve||(d={x:(o.x+i.x)*.5,y:(o.y+i.y)*.5},r.lineTo(d.x,d.y)),l.onCurve||(y={x:(o.x+l.x)*.5,y:(o.y+l.y)*.5}),r.lineTo(d.x,d.y),r.quadraticCurveTo(o.x,o.y,y.x,y.y)}r.closePath()}return r}function Ba(e,r){if(r.isComposite)for(var t=0;t<r.components.length;t+=1){var n=r.components[t],a=e.get(n.glyphIndex);if(a.getPath(),a.points){var i=void 0;if(n.matchedPoints===void 0)i=Hr(a.points,n);else{if(n.matchedPoints[0]>r.points.length-1||n.matchedPoints[1]>a.points.length-1)throw Error("Matched points out of range in "+r.name);var o=r.points[n.matchedPoints[0]],l=a.points[n.matchedPoints[1]],u={xScale:n.xScale,scale01:n.scale01,scale10:n.scale10,yScale:n.yScale,dx:0,dy:0};l=Hr([l],u)[0],u.dx=o.x-l.x,u.dy=o.y-l.y,i=Hr(a.points,u)}r.points=r.points.concat(i)}}return Dt(r.points)}function Pa(e,r,t,n){for(var a=new qe.GlyphSet(n),i=0;i<t.length-1;i+=1){var o=t[i],l=t[i+1];o!==l?a.push(i,qe.ttfGlyphLoader(n,i,Aa,e,r+o,Ba)):a.push(i,qe.glyphLoader(n,i))}return a}var At={getPath:Dt,parse:Pa};function Ga(e,r){var t=r||new Z;return{configurable:!0,get:function(){return typeof t=="function"&&(t=t()),t},set:function(n){t=n}}}function fe(e){this.bindConstructorValues(e)}fe.prototype.bindConstructorValues=function(e){this.index=e.index||0,this.name=e.name||null,this.unicode=e.unicode||void 0,this.unicodes=e.unicodes||e.unicode!==void 0?[e.unicode]:[],e.xMin&&(this.xMin=e.xMin),e.yMin&&(this.yMin=e.yMin),e.xMax&&(this.xMax=e.xMax),e.yMax&&(this.yMax=e.yMax),e.advanceWidth&&(this.advanceWidth=e.advanceWidth),Object.defineProperty(this,"path",Ga(this,e.path))},fe.prototype.addUnicode=function(e){this.unicodes.length===0&&(this.unicode=e),this.unicodes.push(e)},fe.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},fe.prototype.getPath=function(e,r,t,n,a){e=e!==void 0?e:0,r=r!==void 0?r:0,t=t!==void 0?t:72;var i,o;n||(n={});var l=n.xScale,u=n.yScale;if(n.hinting&&a&&a.hinting&&(o=this.path&&a.hinting.exec(this,t)),o)i=At.getPath(o).commands,e=Math.round(e),r=Math.round(r),l=u=1;else{i=this.path.commands;var c=1/this.path.unitsPerEm*t;l===void 0&&(l=c),u===void 0&&(u=c)}for(var d=new Z,y=0;y<i.length;y+=1){var g=i[y];g.type==="M"?d.moveTo(e+g.x*l,r+-g.y*u):g.type==="L"?d.lineTo(e+g.x*l,r+-g.y*u):g.type==="Q"?d.quadraticCurveTo(e+g.x1*l,r+-g.y1*u,e+g.x*l,r+-g.y*u):g.type==="C"?d.curveTo(e+g.x1*l,r+-g.y1*u,e+g.x2*l,r+-g.y2*u,e+g.x*l,r+-g.y*u):g.type==="Z"&&d.closePath()}return d},fe.prototype.getContours=function(){var e=this;if(this.points===void 0)return[];for(var r=[],t=[],n=0;n<this.points.length;n+=1){var a=e.points[n];t.push(a),a.lastPointOfContour&&(r.push(t),t=[])}return G.argument(t.length===0,"There are still points left in the current contour."),r},fe.prototype.getMetrics=function(){for(var e=this.path.commands,r=[],t=[],n=0;n<e.length;n+=1){var a=e[n];a.type!=="Z"&&(r.push(a.x),t.push(a.y)),(a.type==="Q"||a.type==="C")&&(r.push(a.x1),t.push(a.y1)),a.type==="C"&&(r.push(a.x2),t.push(a.y2))}var i={xMin:Math.min.apply(null,r),yMin:Math.min.apply(null,t),xMax:Math.max.apply(null,r),yMax:Math.max.apply(null,t),leftSideBearing:this.leftSideBearing};return isFinite(i.xMin)||(i.xMin=0),isFinite(i.xMax)||(i.xMax=this.advanceWidth),isFinite(i.yMin)||(i.yMin=0),isFinite(i.yMax)||(i.yMax=0),i.rightSideBearing=this.advanceWidth-i.leftSideBearing-(i.xMax-i.xMin),i},fe.prototype.draw=function(e,r,t,n,a){this.getPath(r,t,n,a).draw(e)},fe.prototype.drawPoints=function(e,r,t,n){function a(y,g,m,T){var O=Math.PI*2;e.beginPath();for(var F=0;F<y.length;F+=1)e.moveTo(g+y[F].x*T,m+y[F].y*T),e.arc(g+y[F].x*T,m+y[F].y*T,2,0,O,!1);e.closePath(),e.fill()}r=r!==void 0?r:0,t=t!==void 0?t:0,n=n!==void 0?n:24;for(var i=1/this.path.unitsPerEm*n,o=[],l=[],u=this.path,c=0;c<u.commands.length;c+=1){var d=u.commands[c];d.x!==void 0&&o.push({x:d.x,y:-d.y}),d.x1!==void 0&&l.push({x:d.x1,y:-d.y1}),d.x2!==void 0&&l.push({x:d.x2,y:-d.y2})}e.fillStyle="blue",a(o,r,t,i),e.fillStyle="red",a(l,r,t,i)},fe.prototype.drawMetrics=function(e,r,t,n){var a;r=r!==void 0?r:0,t=t!==void 0?t:0,n=n!==void 0?n:24,a=1/this.path.unitsPerEm*n,e.lineWidth=1,e.strokeStyle="black",Be.line(e,r,-1e4,r,1e4),Be.line(e,-1e4,t,1e4,t);var i=this.xMin||0,o=this.yMin||0,l=this.xMax||0,u=this.yMax||0,c=this.advanceWidth||0;e.strokeStyle="blue",Be.line(e,r+i*a,-1e4,r+i*a,1e4),Be.line(e,r+l*a,-1e4,r+l*a,1e4),Be.line(e,-1e4,t+-o*a,1e4,t+-o*a),Be.line(e,-1e4,t+-u*a,1e4,t+-u*a),e.strokeStyle="green",Be.line(e,r+c*a,-1e4,r+c*a,1e4)};function Sr(e,r,t){Object.defineProperty(e,r,{get:function(){return e.path,e[t]},set:function(n){e[t]=n},enumerable:!0,configurable:!0})}function _r(e,r){var t=this;if(this.font=e,this.glyphs={},Array.isArray(r))for(var n=0;n<r.length;n++)t.glyphs[n]=r[n];this.length=r&&r.length||0}_r.prototype.get=function(e){return typeof this.glyphs[e]=="function"&&(this.glyphs[e]=this.glyphs[e]()),this.glyphs[e]},_r.prototype.push=function(e,r){this.glyphs[e]=r,this.length++};function Na(e,r){return new fe({index:r,font:e})}function Ha(e,r,t,n,a,i){return function(){var o=new fe({index:r,font:e});return o.path=function(){t(o,n,a);var l=i(e.glyphs,o);return l.unitsPerEm=e.unitsPerEm,l},Sr(o,"xMin","_xMin"),Sr(o,"xMax","_xMax"),Sr(o,"yMin","_yMin"),Sr(o,"yMax","_yMax"),o}}function _a(e,r,t,n){return function(){var a=new fe({index:r,font:e});return a.path=function(){var i=t(e,a,n);return i.unitsPerEm=e.unitsPerEm,i},a}}var qe={GlyphSet:_r,glyphLoader:Na,ttfGlyphLoader:Ha,cffGlyphLoader:_a};function Mt(e,r){if(e===r)return!0;if(Array.isArray(e)&&Array.isArray(r)){if(e.length!==r.length)return!1;for(var t=0;t<e.length;t+=1)if(!Mt(e[t],r[t]))return!1;return!0}else return!1}function zr(e){var r;return e.length<1240?r=107:e.length<33900?r=1131:r=32768,r}function Oe(e,r,t){var n=[],a=[],i=w.getCard16(e,r),o,l;if(i!==0){var u=w.getByte(e,r+2);o=r+(i+1)*u+2;for(var c=r+3,d=0;d<i+1;d+=1)n.push(w.getOffset(e,c,u)),c+=u;l=o+n[i]}else l=r+2;for(var y=0;y<n.length-1;y+=1){var g=w.getBytes(e,o+n[y],o+n[y+1]);t&&(g=t(g)),a.push(g)}return{objects:a,startOffset:r,endOffset:l}}function za(e){for(var r="",t=15,n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var a=e.parseByte(),i=a>>4,o=a&15;if(i===t||(r+=n[i],o===t))break;r+=n[o]}return parseFloat(r)}function Wa(e,r){var t,n,a,i;if(r===28)return t=e.parseByte(),n=e.parseByte(),t<<8|n;if(r===29)return t=e.parseByte(),n=e.parseByte(),a=e.parseByte(),i=e.parseByte(),t<<24|n<<16|a<<8|i;if(r===30)return za(e);if(r>=32&&r<=246)return r-139;if(r>=247&&r<=250)return t=e.parseByte(),(r-247)*256+t+108;if(r>=251&&r<=254)return t=e.parseByte(),-(r-251)*256-t-108;throw new Error("Invalid b0 "+r)}function Va(e){for(var r={},t=0;t<e.length;t+=1){var n=e[t][0],a=e[t][1],i=void 0;if(a.length===1?i=a[0]:i=a,r.hasOwnProperty(n)&&!isNaN(r[n]))throw new Error("Object "+r+" already has key "+n);r[n]=i}return r}function Bt(e,r,t){r=r!==void 0?r:0;var n=new w.Parser(e,r),a=[],i=[];for(t=t!==void 0?t:e.length;n.relativeOffset<t;){var o=n.parseByte();o<=21?(o===12&&(o=1200+n.parseByte()),a.push([o,i]),i=[]):i.push(Wa(n,o))}return Va(a)}function er(e,r){return r<=390?r=br[r]:r=e[r-391],r}function Pt(e,r,t){for(var n={},a,i=0;i<r.length;i+=1){var o=r[i];if(Array.isArray(o.type)){var l=[];l.length=o.type.length;for(var u=0;u<o.type.length;u++)a=e[o.op]!==void 0?e[o.op][u]:void 0,a===void 0&&(a=o.value!==void 0&&o.value[u]!==void 0?o.value[u]:null),o.type[u]==="SID"&&(a=er(t,a)),l[u]=a;n[o.name]=l}else a=e[o.op],a===void 0&&(a=o.value!==void 0?o.value:null),o.type==="SID"&&(a=er(t,a)),n[o.name]=a}return n}function qa(e,r){var t={};return t.formatMajor=w.getCard8(e,r),t.formatMinor=w.getCard8(e,r+1),t.size=w.getCard8(e,r+2),t.offsetSize=w.getCard8(e,r+3),t.startOffset=r,t.endOffset=r+4,t}var Gt=[{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"}],Nt=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}];function Xa(e,r){var t=Bt(e,0,e.byteLength);return Pt(t,Gt,r)}function Ht(e,r,t,n){var a=Bt(e,r,t);return Pt(a,Nt,n)}function _t(e,r,t,n){for(var a=[],i=0;i<t.length;i+=1){var o=new DataView(new Uint8Array(t[i]).buffer),l=Xa(o,n);l._subrs=[],l._subrsBias=0;var u=l.private[0],c=l.private[1];if(u!==0&&c!==0){var d=Ht(e,c+r,u,n);if(l._defaultWidthX=d.defaultWidthX,l._nominalWidthX=d.nominalWidthX,d.subrs!==0){var y=c+d.subrs,g=Oe(e,y+r);l._subrs=g.objects,l._subrsBias=zr(l._subrs)}l._privateDict=d}a.push(l)}return a}function Ya(e,r,t,n){var a,i,o=new w.Parser(e,r);t-=1;var l=[".notdef"],u=o.parseCard8();if(u===0)for(var c=0;c<t;c+=1)a=o.parseSID(),l.push(er(n,a));else if(u===1)for(;l.length<=t;){a=o.parseSID(),i=o.parseCard8();for(var d=0;d<=i;d+=1)l.push(er(n,a)),a+=1}else if(u===2)for(;l.length<=t;){a=o.parseSID(),i=o.parseCard16();for(var y=0;y<=i;y+=1)l.push(er(n,a)),a+=1}else throw new Error("Unknown charset format "+u);return l}function Za(e,r,t){var n,a={},i=new w.Parser(e,r),o=i.parseCard8();if(o===0)for(var l=i.parseCard8(),u=0;u<l;u+=1)n=i.parseCard8(),a[n]=u;else if(o===1){var c=i.parseCard8();n=1;for(var d=0;d<c;d+=1)for(var y=i.parseCard8(),g=i.parseCard8(),m=y;m<=y+g;m+=1)a[m]=n,n+=1}else throw new Error("Unknown encoding format "+o);return new xr(a,t)}function Qa(e,r,t){var n,a,i,o,l=new Z,u=[],c=0,d=!1,y=!1,g=0,m=0,T,O,F,U;if(e.isCIDFont){var P=e.tables.cff.topDict._fdSelect[r.index],I=e.tables.cff.topDict._fdArray[P];T=I._subrs,O=I._subrsBias,F=I._defaultWidthX,U=I._nominalWidthX}else T=e.tables.cff.topDict._subrs,O=e.tables.cff.topDict._subrsBias,F=e.tables.cff.topDict._defaultWidthX,U=e.tables.cff.topDict._nominalWidthX;var H=F;function R(q,K){y&&l.closePath(),l.moveTo(q,K),y=!0}function B(){var q;q=u.length%2!==0,q&&!d&&(H=u.shift()+U),c+=u.length>>1,u.length=0,d=!0}function ue(q){for(var K,se,le,pe,de,J,j,re,te,ne,oe,he,Y=0;Y<q.length;){var ae=q[Y];switch(Y+=1,ae){case 1:B();break;case 3:B();break;case 4:u.length>1&&!d&&(H=u.shift()+U,d=!0),m+=u.pop(),R(g,m);break;case 5:for(;u.length>0;)g+=u.shift(),m+=u.shift(),l.lineTo(g,m);break;case 6:for(;u.length>0&&(g+=u.shift(),l.lineTo(g,m),u.length!==0);)m+=u.shift(),l.lineTo(g,m);break;case 7:for(;u.length>0&&(m+=u.shift(),l.lineTo(g,m),u.length!==0);)g+=u.shift(),l.lineTo(g,m);break;case 8:for(;u.length>0;)n=g+u.shift(),a=m+u.shift(),i=n+u.shift(),o=a+u.shift(),g=i+u.shift(),m=o+u.shift(),l.curveTo(n,a,i,o,g,m);break;case 10:de=u.pop()+O,J=T[de],J&&ue(J);break;case 11:return;case 12:switch(ae=q[Y],Y+=1,ae){case 35:n=g+u.shift(),a=m+u.shift(),i=n+u.shift(),o=a+u.shift(),j=i+u.shift(),re=o+u.shift(),te=j+u.shift(),ne=re+u.shift(),oe=te+u.shift(),he=ne+u.shift(),g=oe+u.shift(),m=he+u.shift(),u.shift(),l.curveTo(n,a,i,o,j,re),l.curveTo(te,ne,oe,he,g,m);break;case 34:n=g+u.shift(),a=m,i=n+u.shift(),o=a+u.shift(),j=i+u.shift(),re=o,te=j+u.shift(),ne=o,oe=te+u.shift(),he=m,g=oe+u.shift(),l.curveTo(n,a,i,o,j,re),l.curveTo(te,ne,oe,he,g,m);break;case 36:n=g+u.shift(),a=m+u.shift(),i=n+u.shift(),o=a+u.shift(),j=i+u.shift(),re=o,te=j+u.shift(),ne=o,oe=te+u.shift(),he=ne+u.shift(),g=oe+u.shift(),l.curveTo(n,a,i,o,j,re),l.curveTo(te,ne,oe,he,g,m);break;case 37:n=g+u.shift(),a=m+u.shift(),i=n+u.shift(),o=a+u.shift(),j=i+u.shift(),re=o+u.shift(),te=j+u.shift(),ne=re+u.shift(),oe=te+u.shift(),he=ne+u.shift(),Math.abs(oe-g)>Math.abs(he-m)?g=oe+u.shift():m=he+u.shift(),l.curveTo(n,a,i,o,j,re),l.curveTo(te,ne,oe,he,g,m);break;default:console.log("Glyph "+r.index+": unknown operator 1200"+ae),u.length=0}break;case 14:u.length>0&&!d&&(H=u.shift()+U,d=!0),y&&(l.closePath(),y=!1);break;case 18:B();break;case 19:case 20:B(),Y+=c+7>>3;break;case 21:u.length>2&&!d&&(H=u.shift()+U,d=!0),m+=u.pop(),g+=u.pop(),R(g,m);break;case 22:u.length>1&&!d&&(H=u.shift()+U,d=!0),g+=u.pop(),R(g,m);break;case 23:B();break;case 24:for(;u.length>2;)n=g+u.shift(),a=m+u.shift(),i=n+u.shift(),o=a+u.shift(),g=i+u.shift(),m=o+u.shift(),l.curveTo(n,a,i,o,g,m);g+=u.shift(),m+=u.shift(),l.lineTo(g,m);break;case 25:for(;u.length>6;)g+=u.shift(),m+=u.shift(),l.lineTo(g,m);n=g+u.shift(),a=m+u.shift(),i=n+u.shift(),o=a+u.shift(),g=i+u.shift(),m=o+u.shift(),l.curveTo(n,a,i,o,g,m);break;case 26:for(u.length%2&&(g+=u.shift());u.length>0;)n=g,a=m+u.shift(),i=n+u.shift(),o=a+u.shift(),g=i,m=o+u.shift(),l.curveTo(n,a,i,o,g,m);break;case 27:for(u.length%2&&(m+=u.shift());u.length>0;)n=g+u.shift(),a=m,i=n+u.shift(),o=a+u.shift(),g=i+u.shift(),m=o,l.curveTo(n,a,i,o,g,m);break;case 28:K=q[Y],se=q[Y+1],u.push((K<<24|se<<16)>>16),Y+=2;break;case 29:de=u.pop()+e.gsubrsBias,J=e.gsubrs[de],J&&ue(J);break;case 30:for(;u.length>0&&(n=g,a=m+u.shift(),i=n+u.shift(),o=a+u.shift(),g=i+u.shift(),m=o+(u.length===1?u.shift():0),l.curveTo(n,a,i,o,g,m),u.length!==0);)n=g+u.shift(),a=m,i=n+u.shift(),o=a+u.shift(),m=o+u.shift(),g=i+(u.length===1?u.shift():0),l.curveTo(n,a,i,o,g,m);break;case 31:for(;u.length>0&&(n=g+u.shift(),a=m,i=n+u.shift(),o=a+u.shift(),m=o+u.shift(),g=i+(u.length===1?u.shift():0),l.curveTo(n,a,i,o,g,m),u.length!==0);)n=g,a=m+u.shift(),i=n+u.shift(),o=a+u.shift(),g=i+u.shift(),m=o+(u.length===1?u.shift():0),l.curveTo(n,a,i,o,g,m);break;default:ae<32?console.log("Glyph "+r.index+": unknown operator "+ae):ae<247?u.push(ae-139):ae<251?(K=q[Y],Y+=1,u.push((ae-247)*256+K+108)):ae<255?(K=q[Y],Y+=1,u.push(-(ae-251)*256-K-108)):(K=q[Y],se=q[Y+1],le=q[Y+2],pe=q[Y+3],Y+=4,u.push((K<<24|se<<16|le<<8|pe)/65536))}}}return ue(t),r.advanceWidth=H,l}function Ja(e,r,t,n){var a=[],i,o=new w.Parser(e,r),l=o.parseCard8();if(l===0)for(var u=0;u<t;u++){if(i=o.parseCard8(),i>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+i+" (FD count "+n+")");a.push(i)}else if(l===3){var c=o.parseCard16(),d=o.parseCard16();if(d!==0)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+d);for(var y,g=0;g<c;g++){if(i=o.parseCard8(),y=o.parseCard16(),i>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+i+" (FD count "+n+")");if(y>t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+y);for(;d<y;d++)a.push(i);d=y}if(y!==t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+y)}else throw new Error("CFF Table CID Font FDSelect table has unsupported format "+l);return a}function Ka(e,r,t){t.tables.cff={};var n=qa(e,r),a=Oe(e,n.endOffset,w.bytesToString),i=Oe(e,a.endOffset),o=Oe(e,i.endOffset,w.bytesToString),l=Oe(e,o.endOffset);t.gsubrs=l.objects,t.gsubrsBias=zr(t.gsubrs);var u=_t(e,r,i.objects,o.objects);if(u.length!==1)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+u.length);var c=u[0];if(t.tables.cff.topDict=c,c._privateDict&&(t.defaultWidthX=c._privateDict.defaultWidthX,t.nominalWidthX=c._privateDict.nominalWidthX),c.ros[0]!==void 0&&c.ros[1]!==void 0&&(t.isCIDFont=!0),t.isCIDFont){var d=c.fdArray,y=c.fdSelect;if(d===0||y===0)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");d+=r;var g=Oe(e,d),m=_t(e,r,g.objects,o.objects);c._fdArray=m,y+=r,c._fdSelect=Ja(e,y,t.numGlyphs,m.length)}var T=r+c.private[1],O=Ht(e,T,c.private[0],o.objects);if(t.defaultWidthX=O.defaultWidthX,t.nominalWidthX=O.nominalWidthX,O.subrs!==0){var F=T+O.subrs,U=Oe(e,F);t.subrs=U.objects,t.subrsBias=zr(t.subrs)}else t.subrs=[],t.subrsBias=0;var P=Oe(e,r+c.charStrings);t.nGlyphs=P.objects.length;var I=Ya(e,r+c.charset,t.nGlyphs,o.objects);c.encoding===0?t.cffEncoding=new xr(Ca,I):c.encoding===1?t.cffEncoding=new xr(wa,I):t.cffEncoding=Za(e,r+c.encoding,I),t.encoding=t.encoding||t.cffEncoding,t.glyphs=new qe.GlyphSet(t);for(var H=0;H<t.nGlyphs;H+=1){var R=P.objects[H];t.glyphs.push(H,qe.cffGlyphLoader(t,H,Qa,R))}}function zt(e,r){var t,n=br.indexOf(e);return n>=0&&(t=n),n=r.indexOf(e),n>=0?t=n+br.length:(t=br.length+r.length,r.push(e)),t}function ja(){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 $a(e){var r=new A.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);r.names=[];for(var t=0;t<e.length;t+=1)r.names.push({name:"name_"+t,type:"NAME",value:e[t]});return r}function Wt(e,r,t){for(var n={},a=0;a<e.length;a+=1){var i=e[a],o=r[i.name];o!==void 0&&!Mt(o,i.value)&&(i.type==="SID"&&(o=zt(o,t)),n[i.op]={name:i.name,type:i.type,value:o})}return n}function Vt(e,r){var t=new A.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return t.dict=Wt(Gt,e,r),t}function qt(e){var r=new A.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return r.topDicts=[{name:"topDict_0",type:"TABLE",value:e}],r}function ei(e){var r=new A.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);r.strings=[];for(var t=0;t<e.length;t+=1)r.strings.push({name:"string_"+t,type:"STRING",value:e[t]});return r}function ri(){return new A.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}])}function ti(e,r){for(var t=new A.Record("Charsets",[{name:"format",type:"Card8",value:0}]),n=0;n<e.length;n+=1){var a=e[n],i=zt(a,r);t.fields.push({name:"glyph_"+n,type:"SID",value:i})}return t}function ni(e){var r=[],t=e.path;r.push({name:"width",type:"NUMBER",value:e.advanceWidth});for(var n=0,a=0,i=0;i<t.commands.length;i+=1){var o=void 0,l=void 0,u=t.commands[i];if(u.type==="Q"){var c=.3333333333333333,d=2/3;u={type:"C",x:u.x,y:u.y,x1:c*n+d*u.x1,y1:c*a+d*u.y1,x2:c*u.x+d*u.x1,y2:c*u.y+d*u.y1}}if(u.type==="M")o=Math.round(u.x-n),l=Math.round(u.y-a),r.push({name:"dx",type:"NUMBER",value:o}),r.push({name:"dy",type:"NUMBER",value:l}),r.push({name:"rmoveto",type:"OP",value:21}),n=Math.round(u.x),a=Math.round(u.y);else if(u.type==="L")o=Math.round(u.x-n),l=Math.round(u.y-a),r.push({name:"dx",type:"NUMBER",value:o}),r.push({name:"dy",type:"NUMBER",value:l}),r.push({name:"rlineto",type:"OP",value:5}),n=Math.round(u.x),a=Math.round(u.y);else if(u.type==="C"){var y=Math.round(u.x1-n),g=Math.round(u.y1-a),m=Math.round(u.x2-u.x1),T=Math.round(u.y2-u.y1);o=Math.round(u.x-u.x2),l=Math.round(u.y-u.y2),r.push({name:"dx1",type:"NUMBER",value:y}),r.push({name:"dy1",type:"NUMBER",value:g}),r.push({name:"dx2",type:"NUMBER",value:m}),r.push({name:"dy2",type:"NUMBER",value:T}),r.push({name:"dx",type:"NUMBER",value:o}),r.push({name:"dy",type:"NUMBER",value:l}),r.push({name:"rrcurveto",type:"OP",value:8}),n=Math.round(u.x),a=Math.round(u.y)}}return r.push({name:"endchar",type:"OP",value:14}),r}function ai(e){for(var r=new A.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]),t=0;t<e.length;t+=1){var n=e.get(t),a=ni(n);r.charStrings.push({name:n.name,type:"CHARSTRING",value:a})}return r}function ii(e,r){var t=new A.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return t.dict=Wt(Nt,e,r),t}function si(e,r){for(var t=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"}]),n=1/r.unitsPerEm,a={version:r.version,fullName:r.fullName,familyName:r.familyName,weight:r.weightName,fontBBox:r.fontBBox||[0,0,0,0],fontMatrix:[n,0,0,n,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},i={},o=[],l,u=1;u<e.length;u+=1)l=e.get(u),o.push(l.name);var c=[];t.header=ja(),t.nameIndex=$a([r.postScriptName]);var d=Vt(a,c);t.topDictIndex=qt(d),t.globalSubrIndex=ri(),t.charsets=ti(o,c),t.charStringsIndex=ai(e),t.privateDict=ii(i,c),t.stringIndex=ei(c);var y=t.header.sizeOf()+t.nameIndex.sizeOf()+t.topDictIndex.sizeOf()+t.stringIndex.sizeOf()+t.globalSubrIndex.sizeOf();return a.charset=y,a.encoding=0,a.charStrings=a.charset+t.charsets.sizeOf(),a.private[1]=a.charStrings+t.charStringsIndex.sizeOf(),d=Vt(a,c),t.topDictIndex=qt(d),t}var Xt={parse:Ka,make:si};function oi(e,r){var t={},n=new w.Parser(e,r);return t.version=n.parseVersion(),t.fontRevision=Math.round(n.parseFixed()*1e3)/1e3,t.checkSumAdjustment=n.parseULong(),t.magicNumber=n.parseULong(),G.argument(t.magicNumber===1594834165,"Font header has wrong magic number."),t.flags=n.parseUShort(),t.unitsPerEm=n.parseUShort(),t.created=n.parseLongDateTime(),t.modified=n.parseLongDateTime(),t.xMin=n.parseShort(),t.yMin=n.parseShort(),t.xMax=n.parseShort(),t.yMax=n.parseShort(),t.macStyle=n.parseUShort(),t.lowestRecPPEM=n.parseUShort(),t.fontDirectionHint=n.parseShort(),t.indexToLocFormat=n.parseShort(),t.glyphDataFormat=n.parseShort(),t}function ui(e){var r=Math.round(new Date().getTime()/1e3)+2082844800,t=r;return e.createdTimestamp&&(t=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:t},{name:"modified",type:"LONGDATETIME",value:r},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],e)}var Yt={parse:oi,make:ui};function li(e,r){var t={},n=new w.Parser(e,r);return t.version=n.parseVersion(),t.ascender=n.parseShort(),t.descender=n.parseShort(),t.lineGap=n.parseShort(),t.advanceWidthMax=n.parseUShort(),t.minLeftSideBearing=n.parseShort(),t.minRightSideBearing=n.parseShort(),t.xMaxExtent=n.parseShort(),t.caretSlopeRise=n.parseShort(),t.caretSlopeRun=n.parseShort(),t.caretOffset=n.parseShort(),n.relativeOffset+=8,t.metricDataFormat=n.parseShort(),t.numberOfHMetrics=n.parseUShort(),t}function fi(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 Zt={parse:li,make:fi};function pi(e,r,t,n,a){for(var i,o,l=new w.Parser(e,r),u=0;u<n;u+=1){u<t&&(i=l.parseUShort(),o=l.parseShort());var c=a.get(u);c.advanceWidth=i,c.leftSideBearing=o}}function hi(e){for(var r=new A.Table("hmtx",[]),t=0;t<e.length;t+=1){var n=e.get(t),a=n.advanceWidth||0,i=n.leftSideBearing||0;r.fields.push({name:"advanceWidth_"+t,type:"USHORT",value:a}),r.fields.push({name:"leftSideBearing_"+t,type:"SHORT",value:i})}return r}var Qt={parse:pi,make:hi};function ci(e){for(var r=new A.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:e.length}]),t="",n=12+e.length*4,a=0;a<e.length;++a){var i=t.indexOf(e[a]);i<0&&(i=t.length,t+=e[a]),r.fields.push({name:"offset "+a,type:"USHORT",value:n+i}),r.fields.push({name:"length "+a,type:"USHORT",value:e[a].length})}return r.fields.push({name:"stringPool",type:"CHARARRAY",value:t}),r}function vi(e,r){var t=new w.Parser(e,r),n=t.parseULong();G.argument(n===1,"Unsupported ltag table version."),t.skip("uLong",1);for(var a=t.parseULong(),i=[],o=0;o<a;o++){for(var l="",u=r+t.parseUShort(),c=t.parseUShort(),d=u;d<u+c;++d)l+=String.fromCharCode(e.getInt8(d));i.push(l)}return i}var Jt={make:ci,parse:vi};function di(e,r){var t={},n=new w.Parser(e,r);return t.version=n.parseVersion(),t.numGlyphs=n.parseUShort(),t.version===1&&(t.maxPoints=n.parseUShort(),t.maxContours=n.parseUShort(),t.maxCompositePoints=n.parseUShort(),t.maxCompositeContours=n.parseUShort(),t.maxZones=n.parseUShort(),t.maxTwilightPoints=n.parseUShort(),t.maxStorage=n.parseUShort(),t.maxFunctionDefs=n.parseUShort(),t.maxInstructionDefs=n.parseUShort(),t.maxStackElements=n.parseUShort(),t.maxSizeOfInstructions=n.parseUShort(),t.maxComponentElements=n.parseUShort(),t.maxComponentDepth=n.parseUShort()),t}function gi(e){return new A.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:e}])}var Kt={parse:di,make:gi},jt=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],$t={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"},mi={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},en={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 yi(e,r,t){switch(e){case 0:if(r===65535)return"und";if(t)return t[r];break;case 1:return $t[r];case 3:return en[r]}}var Wr="utf-16",bi={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"},xi={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 rn(e,r,t){switch(e){case 0:return Wr;case 1:return xi[t]||bi[r];case 3:if(r===1||r===10)return Wr;break}}function Si(e,r,t){for(var n={},a=new w.Parser(e,r),i=a.parseUShort(),o=a.parseUShort(),l=a.offset+a.parseUShort(),u=0;u<o;u++){var c=a.parseUShort(),d=a.parseUShort(),y=a.parseUShort(),g=a.parseUShort(),m=jt[g]||g,T=a.parseUShort(),O=a.parseUShort(),F=yi(c,y,t),U=rn(c,d,y);if(U!==void 0&&F!==void 0){var P=void 0;if(U===Wr?P=Ve.UTF16(e,l+O,T):P=Ve.MACSTRING(e,l+O,T,U),P){var I=n[m];I===void 0&&(I=n[m]={}),I[F]=P}}}var H=0;return i===1&&(H=a.parseUShort()),n}function Vr(e){var r={};for(var t in e)r[e[t]]=parseInt(t);return r}function tn(e,r,t,n,a,i){return new A.Record("NameRecord",[{name:"platformID",type:"USHORT",value:e},{name:"encodingID",type:"USHORT",value:r},{name:"languageID",type:"USHORT",value:t},{name:"nameID",type:"USHORT",value:n},{name:"length",type:"USHORT",value:a},{name:"offset",type:"USHORT",value:i}])}function Ti(e,r){var t=e.length,n=r.length-t+1;e:for(var a=0;a<n;a++)for(;a<n;a++){for(var i=0;i<t;i++)if(r[a+i]!==e[i])continue e;return a}return-1}function nn(e,r){var t=Ti(e,r);if(t<0){t=r.length;for(var n=0,a=e.length;n<a;++n)r.push(e[n])}return t}function ki(e,r){var t,n=[],a={},i=Vr(jt);for(var o in e){var l=i[o];if(l===void 0&&(l=o),t=parseInt(l),isNaN(t))throw new Error('Name table entry "'+o+'" does not exist, see nameTableNames for complete list.');a[t]=e[o],n.push(t)}for(var u=Vr($t),c=Vr(en),d=[],y=[],g=0;g<n.length;g++){t=n[g];var m=a[t];for(var T in m){var O=m[T],F=1,U=u[T],P=mi[U],I=rn(F,P,U),H=E.MACSTRING(O,I);H===void 0&&(F=0,U=r.indexOf(T),U<0&&(U=r.length,r.push(T)),P=4,H=E.UTF16(O));var R=nn(H,y);d.push(tn(F,P,U,t,H.length,R));var B=c[T];if(B!==void 0){var ue=E.UTF16(O),q=nn(ue,y);d.push(tn(3,1,B,t,ue.length,q))}}}d.sort(function(le,pe){return le.platformID-pe.platformID||le.encodingID-pe.encodingID||le.languageID-pe.languageID||le.nameID-pe.nameID});for(var K=new A.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:d.length},{name:"stringOffset",type:"USHORT",value:6+d.length*12}]),se=0;se<d.length;se++)K.fields.push({name:"record_"+se,type:"RECORD",value:d[se]});return K.fields.push({name:"strings",type:"LITERAL",value:y}),K}var an={parse:Si,make:ki},qr=[{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 Fi(e){for(var r=0;r<qr.length;r+=1){var t=qr[r];if(e>=t.begin&&e<t.end)return r}return-1}function Li(e,r){var t={},n=new w.Parser(e,r);t.version=n.parseUShort(),t.xAvgCharWidth=n.parseShort(),t.usWeightClass=n.parseUShort(),t.usWidthClass=n.parseUShort(),t.fsType=n.parseUShort(),t.ySubscriptXSize=n.parseShort(),t.ySubscriptYSize=n.parseShort(),t.ySubscriptXOffset=n.parseShort(),t.ySubscriptYOffset=n.parseShort(),t.ySuperscriptXSize=n.parseShort(),t.ySuperscriptYSize=n.parseShort(),t.ySuperscriptXOffset=n.parseShort(),t.ySuperscriptYOffset=n.parseShort(),t.yStrikeoutSize=n.parseShort(),t.yStrikeoutPosition=n.parseShort(),t.sFamilyClass=n.parseShort(),t.panose=[];for(var a=0;a<10;a++)t.panose[a]=n.parseByte();return t.ulUnicodeRange1=n.parseULong(),t.ulUnicodeRange2=n.parseULong(),t.ulUnicodeRange3=n.parseULong(),t.ulUnicodeRange4=n.parseULong(),t.achVendID=String.fromCharCode(n.parseByte(),n.parseByte(),n.parseByte(),n.parseByte()),t.fsSelection=n.parseUShort(),t.usFirstCharIndex=n.parseUShort(),t.usLastCharIndex=n.parseUShort(),t.sTypoAscender=n.parseShort(),t.sTypoDescender=n.parseShort(),t.sTypoLineGap=n.parseShort(),t.usWinAscent=n.parseUShort(),t.usWinDescent=n.parseUShort(),t.version>=1&&(t.ulCodePageRange1=n.parseULong(),t.ulCodePageRange2=n.parseULong()),t.version>=2&&(t.sxHeight=n.parseShort(),t.sCapHeight=n.parseShort(),t.usDefaultChar=n.parseUShort(),t.usBreakChar=n.parseUShort(),t.usMaxContent=n.parseUShort()),t}function Ei(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 Xr={parse:Li,make:Ei,unicodeRanges:qr,getUnicodeRange:Fi};function Ui(e,r){var t={},n=new w.Parser(e,r);switch(t.version=n.parseVersion(),t.italicAngle=n.parseFixed(),t.underlinePosition=n.parseShort(),t.underlineThickness=n.parseShort(),t.isFixedPitch=n.parseULong(),t.minMemType42=n.parseULong(),t.maxMemType42=n.parseULong(),t.minMemType1=n.parseULong(),t.maxMemType1=n.parseULong(),t.version){case 1:t.names=Me.slice();break;case 2:t.numberOfGlyphs=n.parseUShort(),t.glyphNameIndex=new Array(t.numberOfGlyphs);for(var a=0;a<t.numberOfGlyphs;a++)t.glyphNameIndex[a]=n.parseUShort();t.names=[];for(var i=0;i<t.numberOfGlyphs;i++)if(t.glyphNameIndex[i]>=Me.length){var o=n.parseChar();t.names.push(n.parseString(o))}break;case 2.5:t.numberOfGlyphs=n.parseUShort(),t.offset=new Array(t.numberOfGlyphs);for(var l=0;l<t.numberOfGlyphs;l++)t.offset[l]=n.parseChar();break}return t}function Oi(){return new A.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:0},{name:"underlinePosition",type:"FWORD",value:0},{name:"underlineThickness",type:"FWORD",value:0},{name:"isFixedPitch",type:"ULONG",value:0},{name:"minMemType42",type:"ULONG",value:0},{name:"maxMemType42",type:"ULONG",value:0},{name:"minMemType1",type:"ULONG",value:0},{name:"maxMemType1",type:"ULONG",value:0}])}var sn={parse:Ui,make:Oi},me=new Array(9);me[1]=function(){var r=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(b.coverage),deltaGlyphId:this.parseUShort()};if(t===2)return{substFormat:2,coverage:this.parsePointer(b.coverage),substitute:this.parseOffset16List()};G.assert(!1,"0x"+r.toString(16)+": lookup type 1 format must be 1 or 2.")},me[2]=function(){var r=this.parseUShort();return G.argument(r===1,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:r,coverage:this.parsePointer(b.coverage),sequences:this.parseListOfLists()}},me[3]=function(){var r=this.parseUShort();return G.argument(r===1,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:r,coverage:this.parsePointer(b.coverage),alternateSets:this.parseListOfLists()}},me[4]=function(){var r=this.parseUShort();return G.argument(r===1,"GSUB ligature table identifier-format must be 1"),{substFormat:r,coverage:this.parsePointer(b.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};var Xe={sequenceIndex:b.uShort,lookupListIndex:b.uShort};me[5]=function(){var r=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:t,coverage:this.parsePointer(b.coverage),ruleSets:this.parseListOfLists(function(){var i=this.parseUShort(),o=this.parseUShort();return{input:this.parseUShortList(i-1),lookupRecords:this.parseRecordList(o,Xe)}})};if(t===2)return{substFormat:t,coverage:this.parsePointer(b.coverage),classDef:this.parsePointer(b.classDef),classSets:this.parseListOfLists(function(){var i=this.parseUShort(),o=this.parseUShort();return{classes:this.parseUShortList(i-1),lookupRecords:this.parseRecordList(o,Xe)}})};if(t===3){var n=this.parseUShort(),a=this.parseUShort();return{substFormat:t,coverages:this.parseList(n,b.pointer(b.coverage)),lookupRecords:this.parseRecordList(a,Xe)}}G.assert(!1,"0x"+r.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},me[6]=function(){var r=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(b.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Xe)}})};if(t===2)return{substFormat:2,coverage:this.parsePointer(b.coverage),backtrackClassDef:this.parsePointer(b.classDef),inputClassDef:this.parsePointer(b.classDef),lookaheadClassDef:this.parsePointer(b.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Xe)}})};if(t===3)return{substFormat:3,backtrackCoverage:this.parseList(b.pointer(b.coverage)),inputCoverage:this.parseList(b.pointer(b.coverage)),lookaheadCoverage:this.parseList(b.pointer(b.coverage)),lookupRecords:this.parseRecordList(Xe)};G.assert(!1,"0x"+r.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},me[7]=function(){var r=this.parseUShort();G.argument(r===1,"GSUB Extension Substitution subtable identifier-format must be 1");var t=this.parseUShort(),n=new b(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:me[t].call(n)}},me[8]=function(){var r=this.parseUShort();return G.argument(r===1,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:r,coverage:this.parsePointer(b.coverage),backtrackCoverage:this.parseList(b.pointer(b.coverage)),lookaheadCoverage:this.parseList(b.pointer(b.coverage)),substitutes:this.parseUShortList()}};function Ii(e,r){r=r||0;var t=new b(e,r),n=t.parseVersion(1);return G.argument(n===1||n===1.1,"Unsupported GSUB table version."),n===1?{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(me)}:{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(me),variations:t.parseFeatureVariationsList()}}var Tr=new Array(9);Tr[1]=function(r){return r.substFormat===1?new A.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new A.Coverage(r.coverage)},{name:"deltaGlyphID",type:"USHORT",value:r.deltaGlyphId}]):new A.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new A.Coverage(r.coverage)}].concat(A.ushortList("substitute",r.substitute)))},Tr[3]=function(r){return G.assert(r.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(r.coverage)}].concat(A.tableList("altSet",r.alternateSets,function(t){return new A.Table("alternateSetTable",A.ushortList("alternate",t))})))},Tr[4]=function(r){return G.assert(r.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(r.coverage)}].concat(A.tableList("ligSet",r.ligatureSets,function(t){return new A.Table("ligatureSetTable",A.tableList("ligature",t,function(n){return new A.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:n.ligGlyph}].concat(A.ushortList("component",n.components,n.components.length+1)))}))})))};function Ci(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,Tr)}])}var on={parse:Ii,make:Ci};function wi(e,r){var t=new w.Parser(e,r),n=t.parseULong();G.argument(n===1,"Unsupported META table version."),t.parseULong(),t.parseULong();for(var a=t.parseULong(),i={},o=0;o<a;o++){var l=t.parseTag(),u=t.parseULong(),c=t.parseULong(),d=Ve.UTF8(e,r+u,c);i[l]=d}return i}function Ri(e){var r=Object.keys(e).length,t="",n=16+r*12,a=new A.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:n},{name:"numTags",type:"ULONG",value:r}]);for(var i in e){var o=t.length;t+=e[i],a.fields.push({name:"tag "+i,type:"TAG",value:i}),a.fields.push({name:"offset "+i,type:"ULONG",value:n+o}),a.fields.push({name:"length "+i,type:"ULONG",value:e[i].length})}return a.fields.push({name:"stringPool",type:"CHARARRAY",value:t}),a}var un={parse:wi,make:Ri};function ln(e){return Math.log(e)/Math.log(2)|0}function Yr(e){for(;e.length%4!==0;)e.push(0);for(var r=0,t=0;t<e.length;t+=4)r+=(e[t]<<24)+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];return r%=Math.pow(2,32),r}function fn(e,r,t,n){return new A.Record("Table Record",[{name:"tag",type:"TAG",value:e!==void 0?e:""},{name:"checkSum",type:"ULONG",value:r!==void 0?r:0},{name:"offset",type:"ULONG",value:t!==void 0?t:0},{name:"length",type:"ULONG",value:n!==void 0?n:0}])}function pn(e){var r=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}]);r.tables=e,r.numTables=e.length;var t=Math.pow(2,ln(r.numTables));r.searchRange=16*t,r.entrySelector=ln(t),r.rangeShift=r.numTables*16-r.searchRange;for(var n=[],a=[],i=r.sizeOf()+fn().sizeOf()*r.numTables;i%4!==0;)i+=1,a.push({name:"padding",type:"BYTE",value:0});for(var o=0;o<e.length;o+=1){var l=e[o];G.argument(l.tableName.length===4,"Table name"+l.tableName+" is invalid.");var u=l.sizeOf(),c=fn(l.tableName,Yr(l.encode()),i,u);for(n.push({name:c.tag+" Table Record",type:"RECORD",value:c}),a.push({name:l.tableName+" table",type:"RECORD",value:l}),i+=u,G.argument(!isNaN(i),"Something went wrong calculating the offset.");i%4!==0;)i+=1,a.push({name:"padding",type:"BYTE",value:0})}return n.sort(function(d,y){return d.value.tag>y.value.tag?1:-1}),r.fields=r.fields.concat(n),r.fields=r.fields.concat(a),r}function hn(e,r,t){for(var n=0;n<r.length;n+=1){var a=e.charToGlyphIndex(r[n]);if(a>0){var i=e.glyphs.get(a);return i.getMetrics()}}return t}function Di(e){for(var r=0,t=0;t<e.length;t+=1)r+=e[t];return r/e.length}function Ai(e){for(var r=[],t=[],n=[],a=[],i=[],o=[],l=[],u,c=0,d=0,y=0,g=0,m=0,T=0;T<e.glyphs.length;T+=1){var O=e.glyphs.get(T),F=O.unicode|0;if(isNaN(O.advanceWidth))throw new Error("Glyph "+O.name+" ("+T+"): advanceWidth is not a number.");(u>F||u===void 0)&&F>0&&(u=F),c<F&&(c=F);var U=Xr.getUnicodeRange(F);if(U<32)d|=1<<U;else if(U<64)y|=1<<U-32;else if(U<96)g|=1<<U-64;else if(U<123)m|=1<<U-96;else throw new Error("Unicode ranges bits > 123 are reserved for internal usage");if(O.name!==".notdef"){var P=O.getMetrics();r.push(P.xMin),t.push(P.yMin),n.push(P.xMax),a.push(P.yMax),o.push(P.leftSideBearing),l.push(P.rightSideBearing),i.push(O.advanceWidth)}}var I={xMin:Math.min.apply(null,r),yMin:Math.min.apply(null,t),xMax:Math.max.apply(null,n),yMax:Math.max.apply(null,a),advanceWidthMax:Math.max.apply(null,i),advanceWidthAvg:Di(i),minLeftSideBearing:Math.min.apply(null,o),maxLeftSideBearing:Math.max.apply(null,o),minRightSideBearing:Math.min.apply(null,l)};I.ascender=e.ascender,I.descender=e.descender;var H=Yt.make({flags:3,unitsPerEm:e.unitsPerEm,xMin:I.xMin,yMin:I.yMin,xMax:I.xMax,yMax:I.yMax,lowestRecPPEM:3,createdTimestamp:e.createdTimestamp}),R=Zt.make({ascender:I.ascender,descender:I.descender,advanceWidthMax:I.advanceWidthMax,minLeftSideBearing:I.minLeftSideBearing,minRightSideBearing:I.minRightSideBearing,xMaxExtent:I.maxLeftSideBearing+(I.xMax-I.xMin),numberOfHMetrics:e.glyphs.length}),B=Kt.make(e.glyphs.length),ue=Xr.make({xAvgCharWidth:Math.round(I.advanceWidthAvg),usWeightClass:e.tables.os2.usWeightClass,usWidthClass:e.tables.os2.usWidthClass,usFirstCharIndex:u,usLastCharIndex:c,ulUnicodeRange1:d,ulUnicodeRange2:y,ulUnicodeRange3:g,ulUnicodeRange4:m,fsSelection:e.tables.os2.fsSelection,sTypoAscender:I.ascender,sTypoDescender:I.descender,sTypoLineGap:0,usWinAscent:I.yMax,usWinDescent:Math.abs(I.yMin),ulCodePageRange1:1,sxHeight:hn(e,"xyvw",{yMax:Math.round(I.ascender/2)}).yMax,sCapHeight:hn(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",I).yMax,usDefaultChar:e.hasChar(" ")?32:0,usBreakChar:e.hasChar(" ")?32:0}),q=Qt.make(e.glyphs),K=It.make(e.glyphs),se=e.getEnglishName("fontFamily"),le=e.getEnglishName("fontSubfamily"),pe=se+" "+le,de=e.getEnglishName("postScriptName");de||(de=se.replace(/\s/g,"")+"-"+le);var J={};for(var j in e.names)J[j]=e.names[j];J.uniqueID||(J.uniqueID={en:e.getEnglishName("manufacturer")+":"+pe}),J.postScriptName||(J.postScriptName={en:de}),J.preferredFamily||(J.preferredFamily=e.names.fontFamily),J.preferredSubfamily||(J.preferredSubfamily=e.names.fontSubfamily);var re=[],te=an.make(J,re),ne=re.length>0?Jt.make(re):void 0,oe=sn.make(),he=Xt.make(e.glyphs,{version:e.getEnglishName("version"),fullName:pe,familyName:se,weightName:le,postScriptName:de,unitsPerEm:e.unitsPerEm,fontBBox:[0,I.yMin,I.ascender,I.advanceWidthMax]}),Y=e.metas&&Object.keys(e.metas).length>0?un.make(e.metas):void 0,ae=[H,R,B,ue,te,K,oe,he,q];ne&&ae.push(ne),e.tables.gsub&&ae.push(on.make(e.tables.gsub)),Y&&ae.push(Y);for(var et=pn(ae),Po=et.encode(),Go=Yr(Po),rt=et.fields,Hn=!1,Er=0;Er<rt.length;Er+=1)if(rt[Er].name==="head table"){rt[Er].value.checkSumAdjustment=2981146554-Go,Hn=!0;break}if(!Hn)throw new Error("Could not find head table with checkSum to adjust.");return et}var Mi={make:pn,fontToTable:Ai,computeCheckSum:Yr};function Zr(e,r){for(var t=0,n=e.length-1;t<=n;){var a=t+n>>>1,i=e[a].tag;if(i===r)return a;i<r?t=a+1:n=a-1}return-t-1}function cn(e,r){for(var t=0,n=e.length-1;t<=n;){var a=t+n>>>1,i=e[a];if(i===r)return a;i<r?t=a+1:n=a-1}return-t-1}function vn(e,r){for(var t,n=0,a=e.length-1;n<=a;){var i=n+a>>>1;t=e[i];var o=t.start;if(o===r)return t;o<r?n=i+1:a=i-1}if(n>0)return t=e[n-1],r>t.end?0:t}function rr(e,r){this.font=e,this.tableName=r}rr.prototype={searchTag:Zr,binSearch:cn,getTable:function(e){var r=this.font.tables[this.tableName];return!r&&e&&(r=this.font.tables[this.tableName]=this.createDefaultTable()),r},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(r){return r.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var r=!1,t=0;t<e.scripts.length;t++){var n=e.scripts[t].tag;if(n==="DFLT")return n;n==="latn"&&(r=!0)}if(r)return"latn"}},getScriptTable:function(e,r){var t=this.getTable(r);if(t){e=e||"DFLT";var n=t.scripts,a=Zr(t.scripts,e);if(a>=0)return n[a].script;if(r){var i={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return n.splice(-1-a,0,i),i.script}}},getLangSysTable:function(e,r,t){var n=this.getScriptTable(e,t);if(n){if(!r||r==="dflt"||r==="DFLT")return n.defaultLangSys;var a=Zr(n.langSysRecords,r);if(a>=0)return n.langSysRecords[a].langSys;if(t){var i={tag:r,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return n.langSysRecords.splice(-1-a,0,i),i.langSys}}},getFeatureTable:function(e,r,t,n){var a=this.getLangSysTable(e,r,n);if(a){for(var i,o=a.featureIndexes,l=this.font.tables[this.tableName].features,u=0;u<o.length;u++)if(i=l[o[u]],i.tag===t)return i.feature;if(n){var c=l.length;return G.assert(c===0||t>=l[c-1].tag,"Features must be added in alphabetical order."),i={tag:t,feature:{params:0,lookupListIndexes:[]}},l.push(i),o.push(c),i.feature}}},getLookupTables:function(e,r,t,n,a){var i=this.getFeatureTable(e,r,t,a),o=[];if(i){for(var l,u=i.lookupListIndexes,c=this.font.tables[this.tableName].lookups,d=0;d<u.length;d++)l=c[u[d]],l.lookupType===n&&o.push(l);if(o.length===0&&a){l={lookupType:n,lookupFlag:0,subtables:[],markFilteringSet:void 0};var y=c.length;return c.push(l),u.push(y),[l]}}return o},getGlyphClass:function(e,r){switch(e.format){case 1:return e.startGlyph<=r&&r<e.startGlyph+e.classes.length?e.classes[r-e.startGlyph]:0;case 2:var t=vn(e.ranges,r);return t?t.classId:0}},getCoverageIndex:function(e,r){switch(e.format){case 1:var t=cn(e.glyphs,r);return t>=0?t:-1;case 2:var n=vn(e.ranges,r);return n?n.index+r-n.start:-1}},expandCoverage:function(e){if(e.format===1)return e.glyphs;for(var r=[],t=e.ranges,n=0;n<t.length;n++)for(var a=t[n],i=a.start,o=a.end,l=i;l<=o;l++)r.push(l);return r}};function kr(e){rr.call(this,e,"gpos")}kr.prototype=rr.prototype,kr.prototype.getKerningValue=function(e,r,t){for(var n=this,a=0;a<e.length;a++)for(var i=e[a].subtables,o=0;o<i.length;o++){var l=i[o],u=n.getCoverageIndex(l.coverage,r);if(!(u<0))switch(l.posFormat){case 1:for(var c=l.pairSets[u],d=0;d<c.length;d++){var y=c[d];if(y.secondGlyph===t)return y.value1&&y.value1.xAdvance||0}break;case 2:var g=n.getGlyphClass(l.classDef1,r),m=n.getGlyphClass(l.classDef2,t),T=l.classRecords[g][m];return T.value1&&T.value1.xAdvance||0}}return 0},kr.prototype.getKerningTables=function(e,r){if(this.font.tables.gpos)return this.getLookupTables(e,r,"kern",2)};function ye(e){rr.call(this,e,"gsub")}function Bi(e,r){var t=e.length;if(t!==r.length)return!1;for(var n=0;n<t;n++)if(e[n]!==r[n])return!1;return!0}function dn(e,r,t){for(var n=e.subtables,a=0;a<n.length;a++){var i=n[a];if(i.substFormat===r)return i}if(t)return n.push(t),t}ye.prototype=rr.prototype,ye.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},ye.prototype.getSingle=function(e,r,t){for(var n=this,a=[],i=this.getLookupTables(r,t,e,1),o=0;o<i.length;o++)for(var l=i[o].subtables,u=0;u<l.length;u++){var c=l[u],d=n.expandCoverage(c.coverage),y=void 0;if(c.substFormat===1){var g=c.deltaGlyphId;for(y=0;y<d.length;y++){var m=d[y];a.push({sub:m,by:m+g})}}else{var T=c.substitute;for(y=0;y<d.length;y++)a.push({sub:d[y],by:T[y]})}}return a},ye.prototype.getAlternates=function(e,r,t){for(var n=this,a=[],i=this.getLookupTables(r,t,e,3),o=0;o<i.length;o++)for(var l=i[o].subtables,u=0;u<l.length;u++)for(var c=l[u],d=n.expandCoverage(c.coverage),y=c.alternateSets,g=0;g<d.length;g++)a.push({sub:d[g],by:y[g]});return a},ye.prototype.getLigatures=function(e,r,t){for(var n=this,a=[],i=this.getLookupTables(r,t,e,4),o=0;o<i.length;o++)for(var l=i[o].subtables,u=0;u<l.length;u++)for(var c=l[u],d=n.expandCoverage(c.coverage),y=c.ligatureSets,g=0;g<d.length;g++)for(var m=d[g],T=y[g],O=0;O<T.length;O++){var F=T[O];a.push({sub:[m].concat(F.components),by:F.ligGlyph})}return a},ye.prototype.addSingle=function(e,r,t,n){var a=this.getLookupTables(t,n,e,1,!0)[0],i=dn(a,2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});G.assert(i.coverage.format===1,"Ligature: unable to modify coverage table format "+i.coverage.format);var o=r.sub,l=this.binSearch(i.coverage.glyphs,o);l<0&&(l=-1-l,i.coverage.glyphs.splice(l,0,o),i.substitute.splice(l,0,0)),i.substitute[l]=r.by},ye.prototype.addAlternate=function(e,r,t,n){var a=this.getLookupTables(t,n,e,3,!0)[0],i=dn(a,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});G.assert(i.coverage.format===1,"Ligature: unable to modify coverage table format "+i.coverage.format);var o=r.sub,l=this.binSearch(i.coverage.glyphs,o);l<0&&(l=-1-l,i.coverage.glyphs.splice(l,0,o),i.alternateSets.splice(l,0,0)),i.alternateSets[l]=r.by},ye.prototype.addLigature=function(e,r,t,n){var a=this.getLookupTables(t,n,e,4,!0)[0],i=a.subtables[0];i||(i={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},a.subtables[0]=i),G.assert(i.coverage.format===1,"Ligature: unable to modify coverage table format "+i.coverage.format);var o=r.sub[0],l=r.sub.slice(1),u={ligGlyph:r.by,components:l},c=this.binSearch(i.coverage.glyphs,o);if(c>=0){for(var d=i.ligatureSets[c],y=0;y<d.length;y++)if(Bi(d[y].components,l))return;d.push(u)}else c=-1-c,i.coverage.glyphs.splice(c,0,o),i.ligatureSets.splice(c,0,[u])},ye.prototype.getFeature=function(e,r,t){if(/ss\d\d/.test(e))return this.getSingle(e,r,t);switch(e){case"aalt":case"salt":return this.getSingle(e,r,t).concat(this.getAlternates(e,r,t));case"dlig":case"liga":case"rlig":return this.getLigatures(e,r,t)}},ye.prototype.add=function(e,r,t,n){if(/ss\d\d/.test(e))return this.addSingle(e,r,t,n);switch(e){case"aalt":case"salt":return typeof r.by=="number"?this.addSingle(e,r,t,n):this.addAlternate(e,r,t,n);case"dlig":case"liga":case"rlig":return this.addLigature(e,r,t,n)}};function Pi(){return typeof window<"u"}function gn(e){for(var r=new ArrayBuffer(e.length),t=new Uint8Array(r),n=0;n<e.length;++n)t[n]=e[n];return r}function Gi(e){for(var r=new Buffer(e.byteLength),t=new Uint8Array(e),n=0;n<r.length;++n)r[n]=t[n];return r}function Ye(e,r){if(!e)throw r}var mn,Pe,yn,Qr;function bn(e){this.font=e,this._fpgmState=this._prepState=void 0,this._errorState=0}function Ni(e){return e}function xn(e){return Math.sign(e)*Math.round(Math.abs(e))}function Hi(e){return Math.sign(e)*Math.round(Math.abs(e*2))/2}function _i(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function zi(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function Wi(e){return Math.sign(e)*Math.floor(Math.abs(e))}var Sn=function(e){var r=this.srPeriod,t=this.srPhase,n=this.srThreshold,a=1;return e<0&&(e=-e,a=-1),e+=n-t,e=Math.trunc(e/r)*r,e+=t,e<0?t*a:e*a},Te={x:1,y:0,axis:"x",distance:function(e,r,t,n){return(t?e.xo:e.x)-(n?r.xo:r.x)},interpolate:function(e,r,t,n){var a,i,o,l,u,c,d;if(!n||n===this){if(a=e.xo-r.xo,i=e.xo-t.xo,u=r.x-r.xo,c=t.x-t.xo,o=Math.abs(a),l=Math.abs(i),d=o+l,d===0){e.x=e.xo+(u+c)/2;return}e.x=e.xo+(u*l+c*o)/d;return}if(a=n.distance(e,r,!0,!0),i=n.distance(e,t,!0,!0),u=n.distance(r,r,!1,!0),c=n.distance(t,t,!1,!0),o=Math.abs(a),l=Math.abs(i),d=o+l,d===0){Te.setRelative(e,e,(u+c)/2,n,!0);return}Te.setRelative(e,e,(u*l+c*o)/d,n,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(e,r,t,n,a){if(!n||n===this){e.x=(a?r.xo:r.x)+t;return}var i=a?r.xo:r.x,o=a?r.yo:r.y,l=i+t*n.x,u=o+t*n.y;e.x=l+(e.y-u)/n.normalSlope},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},Fe={x:0,y:1,axis:"y",distance:function(e,r,t,n){return(t?e.yo:e.y)-(n?r.yo:r.y)},interpolate:function(e,r,t,n){var a,i,o,l,u,c,d;if(!n||n===this){if(a=e.yo-r.yo,i=e.yo-t.yo,u=r.y-r.yo,c=t.y-t.yo,o=Math.abs(a),l=Math.abs(i),d=o+l,d===0){e.y=e.yo+(u+c)/2;return}e.y=e.yo+(u*l+c*o)/d;return}if(a=n.distance(e,r,!0,!0),i=n.distance(e,t,!0,!0),u=n.distance(r,r,!1,!0),c=n.distance(t,t,!1,!0),o=Math.abs(a),l=Math.abs(i),d=o+l,d===0){Fe.setRelative(e,e,(u+c)/2,n,!0);return}Fe.setRelative(e,e,(u*l+c*o)/d,n,!0)},normalSlope:0,setRelative:function(e,r,t,n,a){if(!n||n===this){e.y=(a?r.yo:r.y)+t;return}var i=a?r.xo:r.x,o=a?r.yo:r.y,l=i+t*n.x,u=o+t*n.y;e.y=u+n.normalSlope*(e.x-l)},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};Object.freeze(Te),Object.freeze(Fe);function tr(e,r){this.x=e,this.y=r,this.axis=void 0,this.slope=r/e,this.normalSlope=-e/r,Object.freeze(this)}tr.prototype.distance=function(e,r,t,n){return this.x*Te.distance(e,r,t,n)+this.y*Fe.distance(e,r,t,n)},tr.prototype.interpolate=function(e,r,t,n){var a,i,o,l,u,c,d;if(o=n.distance(e,r,!0,!0),l=n.distance(e,t,!0,!0),a=n.distance(r,r,!1,!0),i=n.distance(t,t,!1,!0),u=Math.abs(o),c=Math.abs(l),d=u+c,d===0){this.setRelative(e,e,(a+i)/2,n,!0);return}this.setRelative(e,e,(a*c+i*u)/d,n,!0)},tr.prototype.setRelative=function(e,r,t,n,a){n=n||this;var i=a?r.xo:r.x,o=a?r.yo:r.y,l=i+t*n.x,u=o+t*n.y,c=n.normalSlope,d=this.slope,y=e.x,g=e.y;e.x=(d*y-c*l+u-g)/(d-c),e.y=d*(e.x-y)+g},tr.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0};function nr(e,r){var t=Math.sqrt(e*e+r*r);return e/=t,r/=t,e===1&&r===0?Te:e===0&&r===1?Fe:new tr(e,r)}function Le(e,r,t,n){this.x=this.xo=Math.round(e*64)/64,this.y=this.yo=Math.round(r*64)/64,this.lastPointOfContour=t,this.onCurve=n,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Le.prototype.nextTouched=function(e){for(var r=this.nextPointOnContour;!e.touched(r)&&r!==this;)r=r.nextPointOnContour;return r},Le.prototype.prevTouched=function(e){for(var r=this.prevPointOnContour;!e.touched(r)&&r!==this;)r=r.prevPointOnContour;return r};var ar=Object.freeze(new Le(0,0)),Vi={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function Ie(e,r){switch(this.env=e,this.stack=[],this.prog=r,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=Te,this.round=xn}}bn.prototype.exec=function(e,r){if(typeof r!="number")throw new Error("Point size is not a number!");if(!(this._errorState>2)){var t=this.font,n=this._prepState;if(!n||n.ppem!==r){var a=this._fpgmState;if(!a){Ie.prototype=Vi,a=this._fpgmState=new Ie("fpgm",t.tables.fpgm),a.funcs=[],a.font=t,s.DEBUG&&(console.log("---EXEC FPGM---"),a.step=-1);try{Pe(a)}catch(c){console.log("Hinting error in FPGM:"+c),this._errorState=3;return}}Ie.prototype=a,n=this._prepState=new Ie("prep",t.tables.prep),n.ppem=r;var i=t.tables.cvt;if(i)for(var o=n.cvt=new Array(i.length),l=r/t.unitsPerEm,u=0;u<i.length;u++)o[u]=i[u]*l;else n.cvt=[];s.DEBUG&&(console.log("---EXEC PREP---"),n.step=-1);try{Pe(n)}catch(c){this._errorState<2&&console.log("Hinting error in PREP:"+c),this._errorState=2}}if(!(this._errorState>1))try{return yn(e,n)}catch(c){this._errorState<1&&(console.log("Hinting error:"+c),console.log("Note: further hinting errors are silenced")),this._errorState=1;return}}},yn=function(e,r){var t=r.ppem/r.font.unitsPerEm,n=t,a=e.components,i,o,l;if(Ie.prototype=r,!a)l=new Ie("glyf",e.instructions),s.DEBUG&&(console.log("---EXEC GLYPH---"),l.step=-1),Qr(e,l,t,n),o=l.gZone;else{var u=r.font;o=[],i=[];for(var c=0;c<a.length;c++){var d=a[c],y=u.glyphs.get(d.glyphIndex);l=new Ie("glyf",y.instructions),s.DEBUG&&(console.log("---EXEC COMP "+c+"---"),l.step=-1),Qr(y,l,t,n);for(var g=Math.round(d.dx*t),m=Math.round(d.dy*n),T=l.gZone,O=l.contours,F=0;F<T.length;F++){var U=T[F];U.xTouched=U.yTouched=!1,U.xo=U.x=U.x+g,U.yo=U.y=U.y+m}var P=o.length;o.push.apply(o,T);for(var I=0;I<O.length;I++)i.push(O[I]+P)}e.instructions&&!l.inhibitGridFit&&(l=new Ie("glyf",e.instructions),l.gZone=l.z0=l.z1=l.z2=o,l.contours=i,o.push(new Le(0,0),new Le(Math.round(e.advanceWidth*t),0)),s.DEBUG&&(console.log("---EXEC COMPOSITE---"),l.step=-1),Pe(l),o.length-=2)}return o},Qr=function(e,r,t,n){for(var a=e.points||[],i=a.length,o=r.gZone=r.z0=r.z1=r.z2=[],l=r.contours=[],u,c=0;c<i;c++)u=a[c],o[c]=new Le(u.x*t,u.y*n,u.lastPointOfContour,u.onCurve);for(var d,y,g=0;g<i;g++)u=o[g],d||(d=u,l.push(g)),u.lastPointOfContour?(u.nextPointOnContour=d,d.prevPointOnContour=u,d=void 0):(y=o[g+1],u.nextPointOnContour=y,y.prevPointOnContour=u);if(!r.inhibitGridFit){if(s.DEBUG){console.log("PROCESSING GLYPH",r.stack);for(var m=0;m<i;m++)console.log(m,o[m].x,o[m].y)}if(o.push(new Le(0,0),new Le(Math.round(e.advanceWidth*t),0)),Pe(r),o.length-=2,s.DEBUG){console.log("FINISHED GLYPH",r.stack);for(var T=0;T<i;T++)console.log(T,o[T].x,o[T].y)}}},Pe=function(e){var r=e.prog;if(r){var t=r.length,n;for(e.ip=0;e.ip<t;e.ip++){if(s.DEBUG&&e.step++,n=mn[r[e.ip]],!n)throw new Error("unknown instruction: 0x"+Number(r[e.ip]).toString(16));n(e)}}};function Fr(e){for(var r=e.tZone=new Array(e.gZone.length),t=0;t<r.length;t++)r[t]=new Le(0,0)}function Tn(e,r){var t=e.prog,n=e.ip,a=1,i;do if(i=t[++n],i===88)a++;else if(i===89)a--;else if(i===64)n+=t[n+1]+1;else if(i===65)n+=2*t[n+1]+1;else if(i>=176&&i<=183)n+=i-176+1;else if(i>=184&&i<=191)n+=(i-184+1)*2;else if(r&&a===1&&i===27)break;while(a>0);e.ip=n}function kn(e,r){s.DEBUG&&console.log(r.step,"SVTCA["+e.axis+"]"),r.fv=r.pv=r.dpv=e}function Fn(e,r){s.DEBUG&&console.log(r.step,"SPVTCA["+e.axis+"]"),r.pv=r.dpv=e}function Ln(e,r){s.DEBUG&&console.log(r.step,"SFVTCA["+e.axis+"]"),r.fv=e}function En(e,r){var t=r.stack,n=t.pop(),a=t.pop(),i=r.z2[n],o=r.z1[a];s.DEBUG&&console.log("SPVTL["+e+"]",n,a);var l,u;e?(l=i.y-o.y,u=o.x-i.x):(l=o.x-i.x,u=o.y-i.y),r.pv=r.dpv=nr(l,u)}function Un(e,r){var t=r.stack,n=t.pop(),a=t.pop(),i=r.z2[n],o=r.z1[a];s.DEBUG&&console.log("SFVTL["+e+"]",n,a);var l,u;e?(l=i.y-o.y,u=o.x-i.x):(l=o.x-i.x,u=o.y-i.y),r.fv=nr(l,u)}function qi(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"SPVFS[]",t,n),e.pv=e.dpv=nr(n,t)}function Xi(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"SPVFS[]",t,n),e.fv=nr(n,t)}function Yi(e){var r=e.stack,t=e.pv;s.DEBUG&&console.log(e.step,"GPV[]"),r.push(t.x*16384),r.push(t.y*16384)}function Zi(e){var r=e.stack,t=e.fv;s.DEBUG&&console.log(e.step,"GFV[]"),r.push(t.x*16384),r.push(t.y*16384)}function Qi(e){e.fv=e.pv,s.DEBUG&&console.log(e.step,"SFVTPV[]")}function Ji(e){var r=e.stack,t=r.pop(),n=r.pop(),a=r.pop(),i=r.pop(),o=r.pop(),l=e.z0,u=e.z1,c=l[t],d=l[n],y=u[a],g=u[i],m=e.z2[o];s.DEBUG&&console.log("ISECT[], ",t,n,a,i,o);var T=c.x,O=c.y,F=d.x,U=d.y,P=y.x,I=y.y,H=g.x,R=g.y,B=(T-F)*(I-R)-(O-U)*(P-H),ue=T*U-O*F,q=P*R-I*H;m.x=(ue*(P-H)-q*(T-F))/B,m.y=(ue*(I-R)-q*(O-U))/B}function Ki(e){e.rp0=e.stack.pop(),s.DEBUG&&console.log(e.step,"SRP0[]",e.rp0)}function ji(e){e.rp1=e.stack.pop(),s.DEBUG&&console.log(e.step,"SRP1[]",e.rp1)}function $i(e){e.rp2=e.stack.pop(),s.DEBUG&&console.log(e.step,"SRP2[]",e.rp2)}function es(e){var r=e.stack.pop();switch(s.DEBUG&&console.log(e.step,"SZP0[]",r),e.zp0=r,r){case 0:e.tZone||Fr(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function rs(e){var r=e.stack.pop();switch(s.DEBUG&&console.log(e.step,"SZP1[]",r),e.zp1=r,r){case 0:e.tZone||Fr(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function ts(e){var r=e.stack.pop();switch(s.DEBUG&&console.log(e.step,"SZP2[]",r),e.zp2=r,r){case 0:e.tZone||Fr(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function ns(e){var r=e.stack.pop();switch(s.DEBUG&&console.log(e.step,"SZPS[]",r),e.zp0=e.zp1=e.zp2=r,r){case 0:e.tZone||Fr(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 as(e){e.loop=e.stack.pop(),s.DEBUG&&console.log(e.step,"SLOOP[]",e.loop)}function is(e){s.DEBUG&&console.log(e.step,"RTG[]"),e.round=xn}function ss(e){s.DEBUG&&console.log(e.step,"RTHG[]"),e.round=_i}function os(e){var r=e.stack.pop();s.DEBUG&&console.log(e.step,"SMD[]",r),e.minDis=r/64}function us(e){s.DEBUG&&console.log(e.step,"ELSE[]"),Tn(e,!1)}function ls(e){var r=e.stack.pop();s.DEBUG&&console.log(e.step,"JMPR[]",r),e.ip+=r-1}function fs(e){var r=e.stack.pop();s.DEBUG&&console.log(e.step,"SCVTCI[]",r),e.cvCutIn=r/64}function ps(e){var r=e.stack;s.DEBUG&&console.log(e.step,"DUP[]"),r.push(r[r.length-1])}function Jr(e){s.DEBUG&&console.log(e.step,"POP[]"),e.stack.pop()}function hs(e){s.DEBUG&&console.log(e.step,"CLEAR[]"),e.stack.length=0}function cs(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"SWAP[]"),r.push(t),r.push(n)}function vs(e){var r=e.stack;s.DEBUG&&console.log(e.step,"DEPTH[]"),r.push(r.length)}function ds(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"LOOPCALL[]",t,n);var a=e.ip,i=e.prog;e.prog=e.funcs[t];for(var o=0;o<n;o++)Pe(e),s.DEBUG&&console.log(++e.step,o+1<n?"next loopcall":"done loopcall",o);e.ip=a,e.prog=i}function gs(e){var r=e.stack.pop();s.DEBUG&&console.log(e.step,"CALL[]",r);var t=e.ip,n=e.prog;e.prog=e.funcs[r],Pe(e),e.ip=t,e.prog=n,s.DEBUG&&console.log(++e.step,"returning from",r)}function ms(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"CINDEX[]",t),r.push(r[r.length-t])}function ys(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"MINDEX[]",t),r.push(r.splice(r.length-t,1)[0])}function bs(e){if(e.env!=="fpgm")throw new Error("FDEF not allowed here");var r=e.stack,t=e.prog,n=e.ip,a=r.pop(),i=n;for(s.DEBUG&&console.log(e.step,"FDEF[]",a);t[++n]!==45;);e.ip=n,e.funcs[a]=t.slice(i+1,n)}function On(e,r){var t=r.stack.pop(),n=r.z0[t],a=r.fv,i=r.pv;s.DEBUG&&console.log(r.step,"MDAP["+e+"]",t);var o=i.distance(n,ar);e&&(o=r.round(o)),a.setRelative(n,ar,o,i),a.touch(n),r.rp0=r.rp1=t}function In(e,r){var t=r.z2,n=t.length-2,a,i,o;s.DEBUG&&console.log(r.step,"IUP["+e.axis+"]");for(var l=0;l<n;l++)a=t[l],!e.touched(a)&&(i=a.prevTouched(e),i!==a&&(o=a.nextTouched(e),i===o&&e.setRelative(a,a,e.distance(i,i,!1,!0),e,!0),e.interpolate(a,i,o,e)))}function Cn(e,r){for(var t=r.stack,n=e?r.rp1:r.rp2,a=(e?r.z0:r.z1)[n],i=r.fv,o=r.pv,l=r.loop,u=r.z2;l--;){var c=t.pop(),d=u[c],y=o.distance(a,a,!1,!0);i.setRelative(d,d,y,o),i.touch(d),s.DEBUG&&console.log(r.step,(r.loop>1?"loop "+(r.loop-l)+": ":"")+"SHP["+(e?"rp1":"rp2")+"]",c)}r.loop=1}function wn(e,r){var t=r.stack,n=e?r.rp1:r.rp2,a=(e?r.z0:r.z1)[n],i=r.fv,o=r.pv,l=t.pop(),u=r.z2[r.contours[l]],c=u;s.DEBUG&&console.log(r.step,"SHC["+e+"]",l);var d=o.distance(a,a,!1,!0);do c!==a&&i.setRelative(c,c,d,o),c=c.nextPointOnContour;while(c!==u)}function Rn(e,r){var t=r.stack,n=e?r.rp1:r.rp2,a=(e?r.z0:r.z1)[n],i=r.fv,o=r.pv,l=t.pop();s.DEBUG&&console.log(r.step,"SHZ["+e+"]",l);var u;switch(l){case 0:u=r.tZone;break;case 1:u=r.gZone;break;default:throw new Error("Invalid zone")}for(var c,d=o.distance(a,a,!1,!0),y=u.length-2,g=0;g<y;g++)c=u[g],i.setRelative(c,c,d,o)}function xs(e){for(var r=e.stack,t=e.loop,n=e.fv,a=r.pop()/64,i=e.z2;t--;){var o=r.pop(),l=i[o];s.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-t)+": ":"")+"SHPIX[]",o,a),n.setRelative(l,l,a),n.touch(l)}e.loop=1}function Ss(e){for(var r=e.stack,t=e.rp1,n=e.rp2,a=e.loop,i=e.z0[t],o=e.z1[n],l=e.fv,u=e.dpv,c=e.z2;a--;){var d=r.pop(),y=c[d];s.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-a)+": ":"")+"IP[]",d,t,"<->",n),l.interpolate(y,i,o,u),l.touch(y)}e.loop=1}function Dn(e,r){var t=r.stack,n=t.pop()/64,a=t.pop(),i=r.z1[a],o=r.z0[r.rp0],l=r.fv,u=r.pv;l.setRelative(i,o,n,u),l.touch(i),s.DEBUG&&console.log(r.step,"MSIRP["+e+"]",n,a),r.rp1=r.rp0,r.rp2=a,e&&(r.rp0=a)}function Ts(e){for(var r=e.stack,t=e.rp0,n=e.z0[t],a=e.loop,i=e.fv,o=e.pv,l=e.z1;a--;){var u=r.pop(),c=l[u];s.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-a)+": ":"")+"ALIGNRP[]",u),i.setRelative(c,n,0,o),i.touch(c)}e.loop=1}function ks(e){s.DEBUG&&console.log(e.step,"RTDG[]"),e.round=Hi}function An(e,r){var t=r.stack,n=t.pop(),a=t.pop(),i=r.z0[a],o=r.fv,l=r.pv,u=r.cvt[n];s.DEBUG&&console.log(r.step,"MIAP["+e+"]",n,"(",u,")",a);var c=l.distance(i,ar);e&&(Math.abs(c-u)<r.cvCutIn&&(c=u),c=r.round(c)),o.setRelative(i,ar,c,l),r.zp0===0&&(i.xo=i.x,i.yo=i.y),o.touch(i),r.rp0=r.rp1=a}function Fs(e){var r=e.prog,t=e.ip,n=e.stack,a=r[++t];s.DEBUG&&console.log(e.step,"NPUSHB[]",a);for(var i=0;i<a;i++)n.push(r[++t]);e.ip=t}function Ls(e){var r=e.ip,t=e.prog,n=e.stack,a=t[++r];s.DEBUG&&console.log(e.step,"NPUSHW[]",a);for(var i=0;i<a;i++){var o=t[++r]<<8|t[++r];o&32768&&(o=-((o^65535)+1)),n.push(o)}e.ip=r}function Es(e){var r=e.stack,t=e.store;t||(t=e.store=[]);var n=r.pop(),a=r.pop();s.DEBUG&&console.log(e.step,"WS",n,a),t[a]=n}function Us(e){var r=e.stack,t=e.store,n=r.pop();s.DEBUG&&console.log(e.step,"RS",n);var a=t&&t[n]||0;r.push(a)}function Os(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"WCVTP",t,n),e.cvt[n]=t/64}function Is(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"RCVT",t),r.push(e.cvt[t]*64)}function Mn(e,r){var t=r.stack,n=t.pop(),a=r.z2[n];s.DEBUG&&console.log(r.step,"GC["+e+"]",n),t.push(r.dpv.distance(a,ar,e,!1)*64)}function Bn(e,r){var t=r.stack,n=t.pop(),a=t.pop(),i=r.z1[n],o=r.z0[a],l=r.dpv.distance(o,i,e,e);s.DEBUG&&console.log(r.step,"MD["+e+"]",n,a,"->",l),r.stack.push(Math.round(l*64))}function Cs(e){s.DEBUG&&console.log(e.step,"MPPEM[]"),e.stack.push(e.ppem)}function ws(e){s.DEBUG&&console.log(e.step,"FLIPON[]"),e.autoFlip=!0}function Rs(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"LT[]",t,n),r.push(n<t?1:0)}function Ds(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"LTEQ[]",t,n),r.push(n<=t?1:0)}function As(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"GT[]",t,n),r.push(n>t?1:0)}function Ms(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"GTEQ[]",t,n),r.push(n>=t?1:0)}function Bs(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"EQ[]",t,n),r.push(t===n?1:0)}function Ps(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"NEQ[]",t,n),r.push(t!==n?1:0)}function Gs(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"ODD[]",t),r.push(Math.trunc(t)%2?1:0)}function Ns(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"EVEN[]",t),r.push(Math.trunc(t)%2?0:1)}function Hs(e){var r=e.stack.pop(),t;s.DEBUG&&console.log(e.step,"IF[]",r),r||(Tn(e,!0),s.DEBUG&&console.log(e.step,t===27?"ELSE[]":"EIF[]"))}function _s(e){s.DEBUG&&console.log(e.step,"EIF[]")}function zs(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"AND[]",t,n),r.push(t&&n?1:0)}function Ws(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"OR[]",t,n),r.push(t||n?1:0)}function Vs(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"NOT[]",t),r.push(t?0:1)}function Kr(e,r){var t=r.stack,n=t.pop(),a=r.fv,i=r.pv,o=r.ppem,l=r.deltaBase+(e-1)*16,u=r.deltaShift,c=r.z0;s.DEBUG&&console.log(r.step,"DELTAP["+e+"]",n,t);for(var d=0;d<n;d++){var y=t.pop(),g=t.pop(),m=l+((g&240)>>4);if(m===o){var T=(g&15)-8;T>=0&&T++,s.DEBUG&&console.log(r.step,"DELTAPFIX",y,"by",T*u);var O=c[y];a.setRelative(O,O,T*u,i)}}}function qs(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"SDB[]",t),e.deltaBase=t}function Xs(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"SDS[]",t),e.deltaShift=Math.pow(.5,t)}function Ys(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"ADD[]",t,n),r.push(n+t)}function Zs(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"SUB[]",t,n),r.push(n-t)}function Qs(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"DIV[]",t,n),r.push(n*64/t)}function Js(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"MUL[]",t,n),r.push(n*t/64)}function Ks(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"ABS[]",t),r.push(Math.abs(t))}function js(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"NEG[]",t),r.push(-t)}function $s(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"FLOOR[]",t),r.push(Math.floor(t/64)*64)}function eo(e){var r=e.stack,t=r.pop();s.DEBUG&&console.log(e.step,"CEILING[]",t),r.push(Math.ceil(t/64)*64)}function Lr(e,r){var t=r.stack,n=t.pop();s.DEBUG&&console.log(r.step,"ROUND[]"),t.push(r.round(n/64)*64)}function ro(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"WCVTF[]",t,n),e.cvt[n]=t*e.ppem/e.font.unitsPerEm}function jr(e,r){var t=r.stack,n=t.pop(),a=r.ppem,i=r.deltaBase+(e-1)*16,o=r.deltaShift;s.DEBUG&&console.log(r.step,"DELTAC["+e+"]",n,t);for(var l=0;l<n;l++){var u=t.pop(),c=t.pop(),d=i+((c&240)>>4);if(d===a){var y=(c&15)-8;y>=0&&y++;var g=y*o;s.DEBUG&&console.log(r.step,"DELTACFIX",u,"by",g),r.cvt[u]+=g}}}function to(e){var r=e.stack.pop();s.DEBUG&&console.log(e.step,"SROUND[]",r),e.round=Sn;var t;switch(r&192){case 0:t=.5;break;case 64:t=1;break;case 128:t=2;break;default:throw new Error("invalid SROUND value")}switch(e.srPeriod=t,r&48){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*t;break;case 32:e.srPhase=.5*t;break;case 48:e.srPhase=.75*t;break;default:throw new Error("invalid SROUND value")}r&=15,r===0?e.srThreshold=0:e.srThreshold=(r/8-.5)*t}function no(e){var r=e.stack.pop();s.DEBUG&&console.log(e.step,"S45ROUND[]",r),e.round=Sn;var t;switch(r&192){case 0:t=Math.sqrt(2)/2;break;case 64:t=Math.sqrt(2);break;case 128:t=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(e.srPeriod=t,r&48){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*t;break;case 32:e.srPhase=.5*t;break;case 48:e.srPhase=.75*t;break;default:throw new Error("invalid S45ROUND value")}r&=15,r===0?e.srThreshold=0:e.srThreshold=(r/8-.5)*t}function ao(e){s.DEBUG&&console.log(e.step,"ROFF[]"),e.round=Ni}function io(e){s.DEBUG&&console.log(e.step,"RUTG[]"),e.round=zi}function so(e){s.DEBUG&&console.log(e.step,"RDTG[]"),e.round=Wi}function oo(e){var r=e.stack.pop();s.DEBUG&&console.log(e.step,"SCANCTRL[]",r)}function Pn(e,r){var t=r.stack,n=t.pop(),a=t.pop(),i=r.z2[n],o=r.z1[a];s.DEBUG&&console.log(r.step,"SDPVTL["+e+"]",n,a);var l,u;e?(l=i.y-o.y,u=o.x-i.x):(l=o.x-i.x,u=o.y-i.y),r.dpv=nr(l,u)}function uo(e){var r=e.stack,t=r.pop(),n=0;s.DEBUG&&console.log(e.step,"GETINFO[]",t),t&1&&(n=35),t&32&&(n|=4096),r.push(n)}function lo(e){var r=e.stack,t=r.pop(),n=r.pop(),a=r.pop();s.DEBUG&&console.log(e.step,"ROLL[]"),r.push(n),r.push(t),r.push(a)}function fo(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"MAX[]",t,n),r.push(Math.max(n,t))}function po(e){var r=e.stack,t=r.pop(),n=r.pop();s.DEBUG&&console.log(e.step,"MIN[]",t,n),r.push(Math.min(n,t))}function ho(e){var r=e.stack.pop();s.DEBUG&&console.log(e.step,"SCANTYPE[]",r)}function co(e){var r=e.stack.pop(),t=e.stack.pop();switch(s.DEBUG&&console.log(e.step,"INSTCTRL[]",r,t),r){case 1:e.inhibitGridFit=!!t;return;case 2:e.ignoreCvt=!!t;return;default:throw new Error("invalid INSTCTRL[] selector")}}function Ce(e,r){var t=r.stack,n=r.prog,a=r.ip;s.DEBUG&&console.log(r.step,"PUSHB["+e+"]");for(var i=0;i<e;i++)t.push(n[++a]);r.ip=a}function we(e,r){var t=r.ip,n=r.prog,a=r.stack;s.DEBUG&&console.log(r.ip,"PUSHW["+e+"]");for(var i=0;i<e;i++){var o=n[++t]<<8|n[++t];o&32768&&(o=-((o^65535)+1)),a.push(o)}r.ip=t}function C(e,r,t,n,a,i){var o=i.stack,l=e&&o.pop(),u=o.pop(),c=i.rp0,d=i.z0[c],y=i.z1[u],g=i.minDis,m=i.fv,T=i.dpv,O,F,U,P;F=O=T.distance(y,d,!0,!0),U=F>=0?1:-1,F=Math.abs(F),e&&(P=i.cvt[l],n&&Math.abs(F-P)<i.cvCutIn&&(F=P)),t&&F<g&&(F=g),n&&(F=i.round(F)),m.setRelative(y,d,U*F,T),m.touch(y),s.DEBUG&&console.log(i.step,(e?"MIRP[":"MDRP[")+(r?"M":"m")+(t?">":"_")+(n?"R":"_")+(a===0?"Gr":a===1?"Bl":a===2?"Wh":"")+"]",e?l+"("+i.cvt[l]+","+P+")":"",u,"(d =",O,"->",U*F,")"),i.rp1=i.rp0,i.rp2=u,r&&(i.rp0=u)}mn=[kn.bind(void 0,Fe),kn.bind(void 0,Te),Fn.bind(void 0,Fe),Fn.bind(void 0,Te),Ln.bind(void 0,Fe),Ln.bind(void 0,Te),En.bind(void 0,0),En.bind(void 0,1),Un.bind(void 0,0),Un.bind(void 0,1),qi,Xi,Yi,Zi,Qi,Ji,Ki,ji,$i,es,rs,ts,ns,as,is,ss,os,us,ls,fs,void 0,void 0,ps,Jr,hs,cs,vs,ms,ys,void 0,void 0,void 0,ds,gs,bs,void 0,On.bind(void 0,0),On.bind(void 0,1),In.bind(void 0,Fe),In.bind(void 0,Te),Cn.bind(void 0,0),Cn.bind(void 0,1),wn.bind(void 0,0),wn.bind(void 0,1),Rn.bind(void 0,0),Rn.bind(void 0,1),xs,Ss,Dn.bind(void 0,0),Dn.bind(void 0,1),Ts,ks,An.bind(void 0,0),An.bind(void 0,1),Fs,Ls,Es,Us,Os,Is,Mn.bind(void 0,0),Mn.bind(void 0,1),void 0,Bn.bind(void 0,0),Bn.bind(void 0,1),Cs,void 0,ws,void 0,void 0,Rs,Ds,As,Ms,Bs,Ps,Gs,Ns,Hs,_s,zs,Ws,Vs,Kr.bind(void 0,1),qs,Xs,Ys,Zs,Qs,Js,Ks,js,$s,eo,Lr.bind(void 0,0),Lr.bind(void 0,1),Lr.bind(void 0,2),Lr.bind(void 0,3),void 0,void 0,void 0,void 0,ro,Kr.bind(void 0,2),Kr.bind(void 0,3),jr.bind(void 0,1),jr.bind(void 0,2),jr.bind(void 0,3),to,no,void 0,void 0,ao,void 0,io,so,Jr,Jr,void 0,void 0,void 0,void 0,void 0,oo,Pn.bind(void 0,0),Pn.bind(void 0,1),uo,void 0,lo,fo,po,ho,co,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,Ce.bind(void 0,1),Ce.bind(void 0,2),Ce.bind(void 0,3),Ce.bind(void 0,4),Ce.bind(void 0,5),Ce.bind(void 0,6),Ce.bind(void 0,7),Ce.bind(void 0,8),we.bind(void 0,1),we.bind(void 0,2),we.bind(void 0,3),we.bind(void 0,4),we.bind(void 0,5),we.bind(void 0,6),we.bind(void 0,7),we.bind(void 0,8),C.bind(void 0,0,0,0,0,0),C.bind(void 0,0,0,0,0,1),C.bind(void 0,0,0,0,0,2),C.bind(void 0,0,0,0,0,3),C.bind(void 0,0,0,0,1,0),C.bind(void 0,0,0,0,1,1),C.bind(void 0,0,0,0,1,2),C.bind(void 0,0,0,0,1,3),C.bind(void 0,0,0,1,0,0),C.bind(void 0,0,0,1,0,1),C.bind(void 0,0,0,1,0,2),C.bind(void 0,0,0,1,0,3),C.bind(void 0,0,0,1,1,0),C.bind(void 0,0,0,1,1,1),C.bind(void 0,0,0,1,1,2),C.bind(void 0,0,0,1,1,3),C.bind(void 0,0,1,0,0,0),C.bind(void 0,0,1,0,0,1),C.bind(void 0,0,1,0,0,2),C.bind(void 0,0,1,0,0,3),C.bind(void 0,0,1,0,1,0),C.bind(void 0,0,1,0,1,1),C.bind(void 0,0,1,0,1,2),C.bind(void 0,0,1,0,1,3),C.bind(void 0,0,1,1,0,0),C.bind(void 0,0,1,1,0,1),C.bind(void 0,0,1,1,0,2),C.bind(void 0,0,1,1,0,3),C.bind(void 0,0,1,1,1,0),C.bind(void 0,0,1,1,1,1),C.bind(void 0,0,1,1,1,2),C.bind(void 0,0,1,1,1,3),C.bind(void 0,1,0,0,0,0),C.bind(void 0,1,0,0,0,1),C.bind(void 0,1,0,0,0,2),C.bind(void 0,1,0,0,0,3),C.bind(void 0,1,0,0,1,0),C.bind(void 0,1,0,0,1,1),C.bind(void 0,1,0,0,1,2),C.bind(void 0,1,0,0,1,3),C.bind(void 0,1,0,1,0,0),C.bind(void 0,1,0,1,0,1),C.bind(void 0,1,0,1,0,2),C.bind(void 0,1,0,1,0,3),C.bind(void 0,1,0,1,1,0),C.bind(void 0,1,0,1,1,1),C.bind(void 0,1,0,1,1,2),C.bind(void 0,1,0,1,1,3),C.bind(void 0,1,1,0,0,0),C.bind(void 0,1,1,0,0,1),C.bind(void 0,1,1,0,0,2),C.bind(void 0,1,1,0,0,3),C.bind(void 0,1,1,0,1,0),C.bind(void 0,1,1,0,1,1),C.bind(void 0,1,1,0,1,2),C.bind(void 0,1,1,0,1,3),C.bind(void 0,1,1,1,0,0),C.bind(void 0,1,1,1,0,1),C.bind(void 0,1,1,1,0,2),C.bind(void 0,1,1,1,0,3),C.bind(void 0,1,1,1,1,0),C.bind(void 0,1,1,1,1,1),C.bind(void 0,1,1,1,1,2),C.bind(void 0,1,1,1,1,3)];function z(e){e=e||{},e.empty||(Ye(e.familyName,"When creating a new Font object, familyName is required."),Ye(e.styleName,"When creating a new Font object, styleName is required."),Ye(e.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),Ye(e.ascender,"When creating a new Font object, ascender is required."),Ye(e.descender,"When creating a new Font object, descender is required."),Ye(e.descender<0,"Descender should be negative (e.g. -512)."),this.names={fontFamily:{en:e.familyName||" "},fontSubfamily:{en:e.styleName||" "},fullName:{en:e.fullName||e.familyName+" "+e.styleName},postScriptName:{en:e.postScriptName||e.familyName+e.styleName},designer:{en:e.designer||" "},designerURL:{en:e.designerURL||" "},manufacturer:{en:e.manufacturer||" "},manufacturerURL:{en:e.manufacturerURL||" "},license:{en:e.license||" "},licenseURL:{en:e.licenseURL||" "},version:{en:e.version||"Version 0.1"},description:{en:e.description||" "},copyright:{en:e.copyright||" "},trademark:{en:e.trademark||" "}},this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.tables={os2:{usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,fsSelection:e.fsSelection||this.fsSelectionValues.REGULAR}}),this.supported=!0,this.glyphs=new qe.GlyphSet(this,e.glyphs||[]),this.encoding=new Ct(this),this.position=new kr(this),this.substitution=new ye(this),this.tables=this.tables||{},Object.defineProperty(this,"hinting",{get:function(){if(this._hinting)return this._hinting;if(this.outlinesFormat==="truetype")return this._hinting=new bn(this)}})}z.prototype.hasChar=function(e){return this.encoding.charToGlyphIndex(e)!==null},z.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},z.prototype.charToGlyph=function(e){var r=this.charToGlyphIndex(e),t=this.glyphs.get(r);return t||(t=this.glyphs.get(0)),t},z.prototype.stringToGlyphs=function(e,r){var t=this;r=r||this.defaultRenderOptions;for(var n=[],a=0;a<e.length;a+=1){var i=e[a];n.push(t.charToGlyphIndex(i))}var o=n.length;if(r.features){var l=r.script||this.substitution.getDefaultScriptName(),u=[];r.features.liga&&(u=u.concat(this.substitution.getFeature("liga",l,r.language))),r.features.rlig&&(u=u.concat(this.substitution.getFeature("rlig",l,r.language)));for(var c=0;c<o;c+=1)for(var d=0;d<u.length;d++){for(var y=u[d],g=y.sub,m=g.length,T=0;T<m&&g[T]===n[c+T];)T++;T===m&&(n.splice(c,m,y.by),o=o-m+1)}}for(var O=new Array(o),F=this.glyphs.get(0),U=0;U<o;U+=1)O[U]=t.glyphs.get(n[U])||F;return O},z.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)},z.prototype.nameToGlyph=function(e){var r=this.nameToGlyphIndex(e),t=this.glyphs.get(r);return t||(t=this.glyphs.get(0)),t},z.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):""},z.prototype.getKerningValue=function(e,r){return e=e.index||e,r=r.index||r,this.kerningPairs[e+","+r]||0},z.prototype.defaultRenderOptions={kerning:!0,features:{liga:!0,rlig:!0}},z.prototype.forEachGlyph=function(e,r,t,n,a,i){var o=this;r=r!==void 0?r:0,t=t!==void 0?t:0,n=n!==void 0?n:72,a=a||this.defaultRenderOptions;var l=1/this.unitsPerEm*n,u=this.stringToGlyphs(e,a),c;if(a.kerning){var d=a.script||this.position.getDefaultScriptName();c=this.position.getKerningTables(d,a.language)}for(var y=0;y<u.length;y+=1){var g=u[y];if(i.call(o,g,r,t,n,a),g.advanceWidth&&(r+=g.advanceWidth*l),a.kerning&&y<u.length-1){var m=c?o.position.getKerningValue(c,g.index,u[y+1].index):o.getKerningValue(g,u[y+1]);r+=m*l}a.letterSpacing?r+=a.letterSpacing*n:a.tracking&&(r+=a.tracking/1e3*n)}return r},z.prototype.getPath=function(e,r,t,n,a){var i=new Z;return this.forEachGlyph(e,r,t,n,a,function(o,l,u,c){var d=o.getPath(l,u,c,a,this);i.extend(d)}),i},z.prototype.getPaths=function(e,r,t,n,a){var i=[];return this.forEachGlyph(e,r,t,n,a,function(o,l,u,c){var d=o.getPath(l,u,c,a,this);i.push(d)}),i},z.prototype.getAdvanceWidth=function(e,r,t){return this.forEachGlyph(e,0,0,r,t,function(){})},z.prototype.draw=function(e,r,t,n,a,i){this.getPath(r,t,n,a,i).draw(e)},z.prototype.drawPoints=function(e,r,t,n,a,i){this.forEachGlyph(r,t,n,a,i,function(o,l,u,c){o.drawPoints(e,l,u,c)})},z.prototype.drawMetrics=function(e,r,t,n,a,i){this.forEachGlyph(r,t,n,a,i,function(o,l,u,c){o.drawMetrics(e,l,u,c)})},z.prototype.getEnglishName=function(e){var r=this.names[e];if(r)return r.en},z.prototype.validate=function(){var e=[],r=this;function t(a,i){a||e.push(i)}function n(a){var i=r.getEnglishName(a);t(i&&i.trim().length>0,"No English "+a+" specified.")}n("fontFamily"),n("weightName"),n("manufacturer"),n("copyright"),n("version"),t(this.unitsPerEm>0,"No unitsPerEm specified.")},z.prototype.toTables=function(){return Mi.fontToTable(this)},z.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},z.prototype.toArrayBuffer=function(){for(var e=this.toTables(),r=e.encode(),t=new ArrayBuffer(r.length),n=new Uint8Array(t),a=0;a<r.length;a++)n[a]=r[a];return t},z.prototype.download=function(e){var r=this.getEnglishName("fontFamily"),t=this.getEnglishName("fontSubfamily");e=e||r.replace(/\s/g,"")+"-"+t+".otf";var n=this.toArrayBuffer();if(Pi())window.requestFileSystem=window.requestFileSystem||window.webkitRequestFileSystem,window.requestFileSystem(window.TEMPORARY,n.byteLength,function(o){o.root.getFile(e,{create:!0},function(l){l.createWriter(function(u){var c=new DataView(n),d=new Blob([c],{type:"font/opentype"});u.write(d),u.addEventListener("writeend",function(){location.href=l.toURL()},!1)})})},function(o){throw new Error(o.name+": "+o.message)});else{var a=tt("fs"),i=Gi(n);a.writeFileSync(e,i)}},z.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},z.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},z.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};function Gn(e,r){var t=JSON.stringify(e),n=256;for(var a in r){var i=parseInt(a);if(!(!i||i<256)){if(JSON.stringify(r[a])===t)return i;n<=i&&(n=i+1)}}return r[n]=e,n}function vo(e,r,t){var n=Gn(r.name,t);return[{name:"tag_"+e,type:"TAG",value:r.tag},{name:"minValue_"+e,type:"FIXED",value:r.minValue<<16},{name:"defaultValue_"+e,type:"FIXED",value:r.defaultValue<<16},{name:"maxValue_"+e,type:"FIXED",value:r.maxValue<<16},{name:"flags_"+e,type:"USHORT",value:0},{name:"nameID_"+e,type:"USHORT",value:n}]}function go(e,r,t){var n={},a=new w.Parser(e,r);return n.tag=a.parseTag(),n.minValue=a.parseFixed(),n.defaultValue=a.parseFixed(),n.maxValue=a.parseFixed(),a.skip("uShort",1),n.name=t[a.parseUShort()]||{},n}function mo(e,r,t,n){for(var a=Gn(r.name,n),i=[{name:"nameID_"+e,type:"USHORT",value:a},{name:"flags_"+e,type:"USHORT",value:0}],o=0;o<t.length;++o){var l=t[o].tag;i.push({name:"axis_"+e+" "+l,type:"FIXED",value:r.coordinates[l]<<16})}return i}function yo(e,r,t,n){var a={},i=new w.Parser(e,r);a.name=n[i.parseUShort()]||{},i.skip("uShort",1),a.coordinates={};for(var o=0;o<t.length;++o)a.coordinates[t[o].tag]=i.parseFixed();return a}function bo(e,r){var t=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}]);t.offsetToData=t.sizeOf();for(var n=0;n<e.axes.length;n++)t.fields=t.fields.concat(vo(n,e.axes[n],r));for(var a=0;a<e.instances.length;a++)t.fields=t.fields.concat(mo(a,e.instances[a],e.axes,r));return t}function xo(e,r,t){var n=new w.Parser(e,r),a=n.parseULong();G.argument(a===65536,"Unsupported fvar table version.");var i=n.parseOffset16();n.skip("uShort",1);for(var o=n.parseUShort(),l=n.parseUShort(),u=n.parseUShort(),c=n.parseUShort(),d=[],y=0;y<o;y++)d.push(go(e,r+i+y*l,t));for(var g=[],m=r+i+o*l,T=0;T<u;T++)g.push(yo(e,m+T*c,d,t));return{axes:d,instances:g}}var So={make:bo,parse:xo},be=new Array(10);be[1]=function(){var r=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{posFormat:1,coverage:this.parsePointer(b.coverage),value:this.parseValueRecord()};if(t===2)return{posFormat:2,coverage:this.parsePointer(b.coverage),values:this.parseValueRecordList()};G.assert(!1,"0x"+r.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},be[2]=function(){var r=this.offset+this.relativeOffset,t=this.parseUShort(),n=this.parsePointer(b.coverage),a=this.parseUShort(),i=this.parseUShort();if(t===1)return{posFormat:t,coverage:n,valueFormat1:a,valueFormat2:i,pairSets:this.parseList(b.pointer(b.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(a),value2:this.parseValueRecord(i)}})))};if(t===2){var o=this.parsePointer(b.classDef),l=this.parsePointer(b.classDef),u=this.parseUShort(),c=this.parseUShort();return{posFormat:t,coverage:n,valueFormat1:a,valueFormat2:i,classDef1:o,classDef2:l,class1Count:u,class2Count:c,classRecords:this.parseList(u,b.list(c,function(){return{value1:this.parseValueRecord(a),value2:this.parseValueRecord(i)}}))}}G.assert(!1,"0x"+r.toString(16)+": GPOS lookup type 2 format must be 1 or 2.")},be[3]=function(){return{error:"GPOS Lookup 3 not supported"}},be[4]=function(){return{error:"GPOS Lookup 4 not supported"}},be[5]=function(){return{error:"GPOS Lookup 5 not supported"}},be[6]=function(){return{error:"GPOS Lookup 6 not supported"}},be[7]=function(){return{error:"GPOS Lookup 7 not supported"}},be[8]=function(){return{error:"GPOS Lookup 8 not supported"}},be[9]=function(){return{error:"GPOS Lookup 9 not supported"}};function To(e,r){r=r||0;var t=new b(e,r),n=t.parseVersion(1);return G.argument(n===1||n===1.1,"Unsupported GPOS table version "+n),n===1?{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(be)}:{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(be),variations:t.parseFeatureVariationsList()}}var ko=new Array(10);function Fo(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,ko)}])}var Lo={parse:To,make:Fo};function Eo(e){var r={};e.skip("uShort");var t=e.parseUShort();G.argument(t===0,"Unsupported kern sub-table version."),e.skip("uShort",2);var n=e.parseUShort();e.skip("uShort",3);for(var a=0;a<n;a+=1){var i=e.parseUShort(),o=e.parseUShort(),l=e.parseShort();r[i+","+o]=l}return r}function Uo(e){var r={};e.skip("uShort");var t=e.parseULong();t>1&&console.warn("Only the first kern subtable is supported."),e.skip("uLong");var n=e.parseUShort(),a=n&255;if(e.skip("uShort"),a===0){var i=e.parseUShort();e.skip("uShort",3);for(var o=0;o<i;o+=1){var l=e.parseUShort(),u=e.parseUShort(),c=e.parseShort();r[l+","+u]=c}}return r}function Oo(e,r){var t=new w.Parser(e,r),n=t.parseUShort();if(n===0)return Eo(t);if(n===1)return Uo(t);throw new Error("Unsupported kern table version ("+n+").")}var Io={parse:Oo};function Co(e,r,t,n){for(var a=new w.Parser(e,r),i=n?a.parseUShort:a.parseULong,o=[],l=0;l<t+1;l+=1){var u=i.call(a);n&&(u*=2),o.push(u)}return o}var wo={parse:Co};function Ro(e,r){var t=tt("fs");t.readFile(e,function(n,a){if(n)return r(n.message);r(null,gn(a))})}function Do(e,r){var t=new XMLHttpRequest;t.open("get",e,!0),t.responseType="arraybuffer",t.onload=function(){return t.response?r(null,t.response):r("Font could not be loaded: "+t.statusText)},t.onerror=function(){r("Font could not be loaded")},t.send()}function Nn(e,r){for(var t=[],n=12,a=0;a<r;a+=1){var i=w.getTag(e,n),o=w.getULong(e,n+4),l=w.getULong(e,n+8),u=w.getULong(e,n+12);t.push({tag:i,checksum:o,offset:l,length:u,compression:!1}),n+=16}return t}function Ao(e,r){for(var t=[],n=44,a=0;a<r;a+=1){var i=w.getTag(e,n),o=w.getULong(e,n+4),l=w.getULong(e,n+8),u=w.getULong(e,n+12),c=void 0;l<u?c="WOFF":c=!1,t.push({tag:i,offset:o,compression:c,compressedLength:l,length:u}),n+=20}return t}function Q(e,r){if(r.compression==="WOFF"){var t=new Uint8Array(e.buffer,r.offset+2,r.compressedLength-2),n=new Uint8Array(r.length);if(ca(t,n),n.byteLength!==r.length)throw new Error("Decompression error: "+r.tag+" decompressed length doesn't match recorded length");var a=new DataView(n.buffer,0);return{data:a,offset:0}}else return{data:e,offset:r.offset}}function $r(e){var r,t,n=new z({empty:!0}),a=new DataView(e,0),i,o=[],l=w.getTag(a,0);if(l==="\0\0\0"||l==="true"||l==="typ1")n.outlinesFormat="truetype",i=w.getUShort(a,4),o=Nn(a,i);else if(l==="OTTO")n.outlinesFormat="cff",i=w.getUShort(a,4),o=Nn(a,i);else if(l==="wOFF"){var u=w.getTag(a,4);if(u==="\0\0\0")n.outlinesFormat="truetype";else if(u==="OTTO")n.outlinesFormat="cff";else throw new Error("Unsupported OpenType flavor "+l);i=w.getUShort(a,12),o=Ao(a,i)}else throw new Error("Unsupported OpenType signature "+l);for(var c,d,y,g,m,T,O,F,U,P,I,H=0;H<i;H+=1){var R=o[H],B=void 0;switch(R.tag){case"cmap":B=Q(a,R),n.tables.cmap=It.parse(B.data,B.offset),n.encoding=new wt(n.tables.cmap);break;case"cvt ":B=Q(a,R),I=new w.Parser(B.data,B.offset),n.tables.cvt=I.parseShortList(R.length/2);break;case"fvar":d=R;break;case"fpgm":B=Q(a,R),I=new w.Parser(B.data,B.offset),n.tables.fpgm=I.parseByteList(R.length);break;case"head":B=Q(a,R),n.tables.head=Yt.parse(B.data,B.offset),n.unitsPerEm=n.tables.head.unitsPerEm,r=n.tables.head.indexToLocFormat;break;case"hhea":B=Q(a,R),n.tables.hhea=Zt.parse(B.data,B.offset),n.ascender=n.tables.hhea.ascender,n.descender=n.tables.hhea.descender,n.numberOfHMetrics=n.tables.hhea.numberOfHMetrics;break;case"hmtx":T=R;break;case"ltag":B=Q(a,R),t=Jt.parse(B.data,B.offset);break;case"maxp":B=Q(a,R),n.tables.maxp=Kt.parse(B.data,B.offset),n.numGlyphs=n.tables.maxp.numGlyphs;break;case"name":U=R;break;case"OS/2":B=Q(a,R),n.tables.os2=Xr.parse(B.data,B.offset);break;case"post":B=Q(a,R),n.tables.post=sn.parse(B.data,B.offset),n.glyphNames=new Nr(n.tables.post);break;case"prep":B=Q(a,R),I=new w.Parser(B.data,B.offset),n.tables.prep=I.parseByteList(R.length);break;case"glyf":y=R;break;case"loca":F=R;break;case"CFF ":c=R;break;case"kern":O=R;break;case"GPOS":g=R;break;case"GSUB":m=R;break;case"meta":P=R;break}}var ue=Q(a,U);if(n.tables.name=an.parse(ue.data,ue.offset,t),n.names=n.tables.name,y&&F){var q=r===0,K=Q(a,F),se=wo.parse(K.data,K.offset,n.numGlyphs,q),le=Q(a,y);n.glyphs=At.parse(le.data,le.offset,se,n)}else if(c){var pe=Q(a,c);Xt.parse(pe.data,pe.offset,n)}else throw new Error("Font doesn't contain TrueType or CFF outlines.");var de=Q(a,T);if(Qt.parse(de.data,de.offset,n.numberOfHMetrics,n.numGlyphs,n.glyphs),Ra(n),O){var J=Q(a,O);n.kerningPairs=Io.parse(J.data,J.offset)}else n.kerningPairs={};if(g){var j=Q(a,g);n.tables.gpos=Lo.parse(j.data,j.offset)}if(m){var re=Q(a,m);n.tables.gsub=on.parse(re.data,re.offset)}if(d){var te=Q(a,d);n.tables.fvar=So.parse(te.data,te.offset,n.names)}if(P){var ne=Q(a,P);n.tables.meta=un.parse(ne.data,ne.offset),n.metas=n.tables.meta}return n}function Mo(e,r){var t=typeof window>"u",n=t?Ro:Do;n(e,function(a,i){if(a)return r(a);var o;try{o=$r(i)}catch(l){return r(l,null)}return r(null,o)})}function Bo(e){var r=tt("fs"),t=r.readFileSync(e);return $r(gn(t))}s.Font=z,s.Glyph=fe,s.Path=Z,s.BoundingBox=ke,s._parse=w,s.parse=$r,s.load=Mo,s.loadSync=Bo,Object.defineProperty(s,"__esModule",{value:!0})}))});var Xn=Ur((su,qn)=>{"use strict";qn.exports=function(s){s.prototype[Symbol.iterator]=function*(){for(let f=this.head;f;f=f.next)yield f.value}}});var Zn=Ur((ou,Yn)=>{"use strict";Yn.exports=_;_.Node=Ge;_.create=_;function _(s){var f=this;if(f instanceof _||(f=new _),f.tail=null,f.head=null,f.length=0,s&&typeof s.forEach=="function")s.forEach(function(v){f.push(v)});else if(arguments.length>0)for(var p=0,h=arguments.length;p<h;p++)f.push(arguments[p]);return f}_.prototype.removeNode=function(s){if(s.list!==this)throw new Error("removing node which does not belong to this list");var f=s.next,p=s.prev;return f&&(f.prev=p),p&&(p.next=f),s===this.head&&(this.head=f),s===this.tail&&(this.tail=p),s.list.length--,s.next=null,s.prev=null,s.list=null,f};_.prototype.unshiftNode=function(s){if(s!==this.head){s.list&&s.list.removeNode(s);var f=this.head;s.list=this,s.next=f,f&&(f.prev=s),this.head=s,this.tail||(this.tail=s),this.length++}};_.prototype.pushNode=function(s){if(s!==this.tail){s.list&&s.list.removeNode(s);var f=this.tail;s.list=this,s.prev=f,f&&(f.next=s),this.tail=s,this.head||(this.head=s),this.length++}};_.prototype.push=function(){for(var s=0,f=arguments.length;s<f;s++)Xo(this,arguments[s]);return this.length};_.prototype.unshift=function(){for(var s=0,f=arguments.length;s<f;s++)Yo(this,arguments[s]);return this.length};_.prototype.pop=function(){if(this.tail){var s=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,s}};_.prototype.shift=function(){if(this.head){var s=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,s}};_.prototype.forEach=function(s,f){f=f||this;for(var p=this.head,h=0;p!==null;h++)s.call(f,p.value,h,this),p=p.next};_.prototype.forEachReverse=function(s,f){f=f||this;for(var p=this.tail,h=this.length-1;p!==null;h--)s.call(f,p.value,h,this),p=p.prev};_.prototype.get=function(s){for(var f=0,p=this.head;p!==null&&f<s;f++)p=p.next;if(f===s&&p!==null)return p.value};_.prototype.getReverse=function(s){for(var f=0,p=this.tail;p!==null&&f<s;f++)p=p.prev;if(f===s&&p!==null)return p.value};_.prototype.map=function(s,f){f=f||this;for(var p=new _,h=this.head;h!==null;)p.push(s.call(f,h.value,this)),h=h.next;return p};_.prototype.mapReverse=function(s,f){f=f||this;for(var p=new _,h=this.tail;h!==null;)p.push(s.call(f,h.value,this)),h=h.prev;return p};_.prototype.reduce=function(s,f){var p,h=this.head;if(arguments.length>1)p=f;else if(this.head)h=this.head.next,p=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var v=0;h!==null;v++)p=s(p,h.value,v),h=h.next;return p};_.prototype.reduceReverse=function(s,f){var p,h=this.tail;if(arguments.length>1)p=f;else if(this.tail)h=this.tail.prev,p=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var v=this.length-1;h!==null;v--)p=s(p,h.value,v),h=h.prev;return p};_.prototype.toArray=function(){for(var s=new Array(this.length),f=0,p=this.head;p!==null;f++)s[f]=p.value,p=p.next;return s};_.prototype.toArrayReverse=function(){for(var s=new Array(this.length),f=0,p=this.tail;p!==null;f++)s[f]=p.value,p=p.prev;return s};_.prototype.slice=function(s,f){f=f||this.length,f<0&&(f+=this.length),s=s||0,s<0&&(s+=this.length);var p=new _;if(f<s||f<0)return p;s<0&&(s=0),f>this.length&&(f=this.length);for(var h=0,v=this.head;v!==null&&h<s;h++)v=v.next;for(;v!==null&&h<f;h++,v=v.next)p.push(v.value);return p};_.prototype.sliceReverse=function(s,f){f=f||this.length,f<0&&(f+=this.length),s=s||0,s<0&&(s+=this.length);var p=new _;if(f<s||f<0)return p;s<0&&(s=0),f>this.length&&(f=this.length);for(var h=this.length,v=this.tail;v!==null&&h>f;h--)v=v.prev;for(;v!==null&&h>s;h--,v=v.prev)p.push(v.value);return p};_.prototype.splice=function(s,f,...p){s>this.length&&(s=this.length-1),s<0&&(s=this.length+s);for(var h=0,v=this.head;v!==null&&h<s;h++)v=v.next;for(var x=[],h=0;v&&h<f;h++)x.push(v.value),v=this.removeNode(v);v===null&&(v=this.tail),v!==this.head&&v!==this.tail&&(v=v.prev);for(var h=0;h<p.length;h++)v=qo(this,v,p[h]);return x};_.prototype.reverse=function(){for(var s=this.head,f=this.tail,p=s;p!==null;p=p.prev){var h=p.prev;p.prev=p.next,p.next=h}return this.head=f,this.tail=s,this};function qo(s,f,p){var h=f===s.head?new Ge(p,null,f,s):new Ge(p,f,f.next,s);return h.next===null&&(s.tail=h),h.prev===null&&(s.head=h),s.length++,h}function Xo(s,f){s.tail=new Ge(f,s.tail,null,s),s.head||(s.head=s.tail),s.length++}function Yo(s,f){s.head=new Ge(f,null,s.head,s),s.tail||(s.tail=s.head),s.length++}function Ge(s,f,p,h){if(!(this instanceof Ge))return new Ge(s,f,p,h);this.list=h,this.value=s,f?(f.next=this,this.prev=f):this.prev=null,p?(p.prev=this,this.next=p):this.next=null}try{Xn()(_)}catch{}});var $n=Ur((uu,jn)=>{"use strict";var Zo=Zn(),Ne=Symbol("max"),Ue=Symbol("length"),Ze=Symbol("lengthCalculator"),sr=Symbol("allowStale"),He=Symbol("maxAge"),Ee=Symbol("dispose"),Qn=Symbol("noDisposeOnSet"),$=Symbol("lruList"),xe=Symbol("cache"),Kn=Symbol("updateAgeOnGet"),nt=()=>1,it=class{constructor(f){if(typeof f=="number"&&(f={max:f}),f||(f={}),f.max&&(typeof f.max!="number"||f.max<0))throw new TypeError("max must be a non-negative number");let p=this[Ne]=f.max||1/0,h=f.length||nt;if(this[Ze]=typeof h!="function"?nt:h,this[sr]=f.stale||!1,f.maxAge&&typeof f.maxAge!="number")throw new TypeError("maxAge must be a number");this[He]=f.maxAge||0,this[Ee]=f.dispose,this[Qn]=f.noDisposeOnSet||!1,this[Kn]=f.updateAgeOnGet||!1,this.reset()}set max(f){if(typeof f!="number"||f<0)throw new TypeError("max must be a non-negative number");this[Ne]=f||1/0,ir(this)}get max(){return this[Ne]}set allowStale(f){this[sr]=!!f}get allowStale(){return this[sr]}set maxAge(f){if(typeof f!="number")throw new TypeError("maxAge must be a non-negative number");this[He]=f,ir(this)}get maxAge(){return this[He]}set lengthCalculator(f){typeof f!="function"&&(f=nt),f!==this[Ze]&&(this[Ze]=f,this[Ue]=0,this[$].forEach(p=>{p.length=this[Ze](p.value,p.key),this[Ue]+=p.length})),ir(this)}get lengthCalculator(){return this[Ze]}get length(){return this[Ue]}get itemCount(){return this[$].length}rforEach(f,p){p=p||this;for(let h=this[$].tail;h!==null;){let v=h.prev;Jn(this,f,h,p),h=v}}forEach(f,p){p=p||this;for(let h=this[$].head;h!==null;){let v=h.next;Jn(this,f,h,p),h=v}}keys(){return this[$].toArray().map(f=>f.key)}values(){return this[$].toArray().map(f=>f.value)}reset(){this[Ee]&&this[$]&&this[$].length&&this[$].forEach(f=>this[Ee](f.key,f.value)),this[xe]=new Map,this[$]=new Zo,this[Ue]=0}dump(){return this[$].map(f=>Ir(this,f)?!1:{k:f.key,v:f.value,e:f.now+(f.maxAge||0)}).toArray().filter(f=>f)}dumpLru(){return this[$]}set(f,p,h){if(h=h||this[He],h&&typeof h!="number")throw new TypeError("maxAge must be a number");let v=h?Date.now():0,x=this[Ze](p,f);if(this[xe].has(f)){if(x>this[Ne])return Qe(this,this[xe].get(f)),!1;let k=this[xe].get(f).value;return this[Ee]&&(this[Qn]||this[Ee](f,k.value)),k.now=v,k.maxAge=h,k.value=p,this[Ue]+=x-k.length,k.length=x,this.get(f),ir(this),!0}let S=new st(f,p,x,v,h);return S.length>this[Ne]?(this[Ee]&&this[Ee](f,p),!1):(this[Ue]+=S.length,this[$].unshift(S),this[xe].set(f,this[$].head),ir(this),!0)}has(f){if(!this[xe].has(f))return!1;let p=this[xe].get(f).value;return!Ir(this,p)}get(f){return at(this,f,!0)}peek(f){return at(this,f,!1)}pop(){let f=this[$].tail;return f?(Qe(this,f),f.value):null}del(f){Qe(this,this[xe].get(f))}load(f){this.reset();let p=Date.now();for(let h=f.length-1;h>=0;h--){let v=f[h],x=v.e||0;if(x===0)this.set(v.k,v.v);else{let S=x-p;S>0&&this.set(v.k,v.v,S)}}}prune(){this[xe].forEach((f,p)=>at(this,p,!1))}},at=(s,f,p)=>{let h=s[xe].get(f);if(h){let v=h.value;if(Ir(s,v)){if(Qe(s,h),!s[sr])return}else p&&(s[Kn]&&(h.value.now=Date.now()),s[$].unshiftNode(h));return v.value}},Ir=(s,f)=>{if(!f||!f.maxAge&&!s[He])return!1;let p=Date.now()-f.now;return f.maxAge?p>f.maxAge:s[He]&&p>s[He]},ir=s=>{if(s[Ue]>s[Ne])for(let f=s[$].tail;s[Ue]>s[Ne]&&f!==null;){let p=f.prev;Qe(s,f),f=p}},Qe=(s,f)=>{if(f){let p=f.value;s[Ee]&&s[Ee](p.key,p.value),s[Ue]-=p.length,s[xe].delete(p.key),s[$].removeNode(f)}},st=class{constructor(f,p,h,v,x){this.key=f,this.value=p,this.length=h,this.now=v,this.maxAge=x||0}},Jn=(s,f,p,h)=>{let v=p.value;Ir(s,v)&&(Qe(s,p),s[sr]||(v=void 0)),v&&f.call(h,v.value,v.key,s)};jn.exports=it});var na=zn(Vn()),aa=zn($n());function or(s){let f={individual:{},range:[]},p=new WeakMap;for(let h of s)ut(f,h,p);return f}function ut(s,f,p){for(let[h,v]of Object.entries(f.individual))if(s.individual[h])Je(s.individual[h],v,p);else{let x=!1;for(let[S,{range:L,entry:k}]of s.range.entries()){let D=ot(Number(h),L);if(D.both!==null){x=!0,s.individual[h]=v,Je(s.individual[h],ie(k),p),s.range.splice(S,1);for(let V of D.second)Array.isArray(V)?s.range.push({range:V,entry:ie(k)}):s.individual[V]=ie(k)}}x||(s.individual[h]=v)}for(let{range:h,entry:v}of f.range){let x=[h];for(let S=0;S<s.range.length;S++){let{range:L,entry:k}=s.range[S];for(let[D,V]of x.entries())if(Array.isArray(V)){let N=Qo(V,L);if(N.both===null)continue;s.range.splice(S,1),S--;let W=ie(k);Array.isArray(N.both)?s.range.push({range:N.both,entry:W}):s.individual[N.both]=W,Je(W,ie(v),p);for(let X of N.second)Array.isArray(X)?s.range.push({range:X,entry:ie(k)}):s.individual[X]=ie(k);x=N.first}else{let N=ot(V,L);if(N.both===null)continue;s.individual[V]=ie(v),Je(s.individual[V],ie(k),p),s.range.splice(S,1),S--;for(let W of N.second)Array.isArray(W)?s.range.push({range:W,entry:ie(k)}):s.individual[W]=ie(k);x.splice(D,1,...N.first);break}}for(let S of Object.keys(s.individual))for(let[L,k]of x.entries())if(Array.isArray(k)){let D=ot(Number(S),k);if(D.both===null)continue;Je(s.individual[S],ie(v),p),x.splice(L,1,...D.second);break}else if(Number(S)===k){Je(s.individual[S],ie(v),p);break}for(let S of x)Array.isArray(S)?s.range.push({range:S,entry:ie(v)}):s.individual[S]=ie(v)}}function Je(s,f,p){let h=p.get(s);h?.has(f)||(h||(h=new Set,p.set(s,h)),h.add(f),f.lookup&&(!s.lookup||s.lookup.index>f.lookup.index||s.lookup.index===f.lookup.index&&s.lookup.subIndex>f.lookup.subIndex)&&(s.lookup=f.lookup),f.forward&&(s.forward?ut(s.forward,f.forward,p):s.forward=f.forward),f.reverse&&(s.reverse?ut(s.reverse,f.reverse,p):s.reverse=f.reverse))}function Qo(s,f){let p={first:[],second:[],both:null};if(s[0]<f[1]&&f[0]<s[1]){let h=Math.max(s[0],f[0]),v=Math.min(s[1],f[1]);p.both=_e(h,v)}if(s[0]<f[0]){let h=s[0],v=Math.min(f[0],s[1]);p.first.push(_e(h,v))}else if(f[0]<s[0]){let h=f[0],v=Math.min(f[1],s[0]);p.second.push(_e(h,v))}if(s[1]>f[1]){let h=Math.max(s[0],f[1]),v=s[1];p.first.push(_e(h,v))}else if(f[1]>s[1]){let h=Math.max(s[1],f[0]),v=f[1];p.second.push(_e(h,v))}return p}function ot(s,f){if(s<f[0]||s>f[1])return{first:[s],second:[f],both:null};let p={first:[],second:[],both:s};return f[0]<s&&p.second.push(_e(f[0],s)),f[1]>s&&p.second.push(_e(s+1,f[1])),p}function _e(s,f){return f-s===1?s:[s,f]}function ie(s,f=new Map){if(f.has(s))return f.get(s);let p={};return f.set(s,p),s.forward&&(p.forward=ea(s.forward,f)),s.reverse&&(p.reverse=ea(s.reverse,f)),s.lookup&&(p.lookup={contextRange:s.lookup.contextRange.slice(),index:s.lookup.index,length:s.lookup.length,subIndex:s.lookup.subIndex,substitutions:s.lookup.substitutions.slice()}),p}function ea(s,f=new Map){let p={};for(let[h,v]of Object.entries(s.individual))p[h]=ie(v,f);return{individual:p,range:s.range.map(({range:h,entry:v})=>({range:h.slice(),entry:ie(v,f)}))}}function ur(s,f,p,h){let v=f[h],x=s[v];if(!x)return;let S=x.lookup;if(x.reverse){let k=Jo(x.reverse,f,p);(!S&&k||k&&S&&(S.index>k.index||S.index===k.index&&S.subIndex>k.subIndex))&&(S=k)}if(++h>=f.length||!x.forward)return S;let L=ur(x.forward,f,p,h);return(!S&&L||L&&S&&(S.index>L.index||S.index===L.index&&S.subIndex>L.subIndex))&&(S=L),S}function Jo(s,f,p){let h=s[f[--p]],v=h&&h.lookup;for(;h&&((!v&&h.lookup||h.lookup&&v&&v.index>h.lookup.index)&&(v=h.lookup),!(--p<0||!h.reverse));)h=h.reverse[f[p]];return v}function Cr(s,f,p){let h=!1;for(let v=0;v<s.length;v++){let x=s[v];if(h){if(p<=x[0])return s[v-1][1]=p,s;if(p<=x[1])return s[v-1][1]=Math.max(p,x[1]),s.splice(v,1),h=!1,s;s.splice(v,1),v--}else{if(p<=x[0])return s.splice(v,0,[f,p]),s;if(p<=x[1])return x[0]=Math.min(f,x[0]),s;if(f<x[1])x[0]=Math.min(f,x[0]),h=!0;else continue}}return h?s[s.length-1][1]=p:s.push([f,p]),s}function lt(s,f){switch(s.format){case 1:let p=s.glyphs.indexOf(f);return p!==-1?p:null;case 2:let h=s.ranges.find(v=>v.start<=f&&v.end>=f);return h?h.index:null}}function ce(s){switch(s.format){case 1:return s.glyphs.map((p,h)=>({glyphId:p,index:h}));case 2:let f=[];for(let[p,h]of s.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 ra(s,f){let p=f[0],h=wr(s,p),v=f[0]+1,x=new Map;for(;v<f[1];)wr(s,v)!==h&&(v-p<=1?x.set(p,h):x.set([p,v],h)),v++;return v-p<=1?x.set(p,h):x.set([p,v],h),x}function wr(s,f){let p=lt(s.coverage,f);if(p===null)return null;switch(s.substFormat){case 1:return(f+s.deltaGlyphId)%2**16;case 2:return s.substitute[p]!=null?s.substitute[p]:null}}function Ke(s,f,p,h,v){let x=[];for(let S of p){S.entry.forward={individual:{},range:[]};for(let L of s)x.push(...ze(S.entry.forward,h,v,f,L).map(({entry:k,substitution:D})=>({entry:k,substitutions:[...S.substitutions,D]})))}return x}function Re(s,f){let p=[],h=new Set;for(let v of f){if(h.has(v.entry))continue;h.add(v.entry),v.entry.forward||(v.entry.forward={individual:{},range:[]});let x={};for(let S of s)Array.isArray(S)?v.entry.forward.range.push({entry:x,range:S}):v.entry.forward.individual[S]=x;p.push({entry:x,substitutions:v.substitutions})}return p}function De(s,f){let p=[],h=new Set;for(let v of f){if(h.has(v.entry))continue;h.add(v.entry),v.entry.reverse||(v.entry.reverse={individual:{},range:[]});let x={};for(let S of s)Array.isArray(S)?v.entry.reverse.range.push({entry:x,range:S}):v.entry.reverse.individual[S]=x;p.push({entry:x,substitutions:v.substitutions})}return p}function ze(s,f,p,h,v){let x=[];if(!Array.isArray(v))s.individual[v]={},x.push({entry:s.individual[v],substitution:jo(f,p,h,v)});else{let S=Ko(f,p,h,v);for(let[L,k]of S){let D={};Array.isArray(L)?s.range.push({range:L,entry:D}):s.individual[L]={},x.push({entry:D,substitution:k})}}return x}function Ko(s,f,p,h){for(let v of s.filter(x=>x.sequenceIndex===p))for(let x of f[v.lookupListIndex].subtables){let S=ra(x,h);if(!Array.from(S.values()).every(L=>L!==null))return S}return new Map([[h,null]])}function jo(s,f,p,h){for(let v of s.filter(x=>x.sequenceIndex===p))for(let x of f[v.lookupListIndex].subtables){let S=wr(x,h);if(S!==null)return S}return null}function ft(s,f,p){let h={individual:{},range:[]},v=ce(s.coverage);for(let{glyphId:x,index:S}of v){let L=s.chainRuleSets[S];if(L)for(let[k,D]of L.entries()){let V=ze(h,D.lookupRecords,f,0,x).map(({entry:N,substitution:W})=>({entry:N,substitutions:[W]}));for(let[N,W]of D.input.entries())V=Ke([W],N+1,V,D.lookupRecords,f);for(let N of D.lookahead)V=Re([N],V);for(let N of D.backtrack)V=De([N],V);for(let{entry:N,substitutions:W}of V)N.lookup={substitutions:W,length:D.input.length+1,index:p,subIndex:k,contextRange:[-1*D.backtrack.length,1+D.input.length+D.lookahead.length]}}}return h}function ht(s,f){switch(s.format){case 2:return Array.isArray(f)?$o(s,f):new Map([[f,pt(s,f)]]);default:return new Map([[f,null]])}}function $o(s,f){let p=f[0],h=pt(s,p),v=f[0]+1,x=new Map;for(;v<f[1];)pt(s,v)!==h&&(v-p<=1?x.set(p,h):x.set([p,v],h)),v++;return v-p<=1?x.set(p,h):x.set([p,v],h),x}function pt(s,f){for(let p of s.ranges)if(p.start<=f&&p.end>=f)return p.classId;return null}function Rr(s,f){switch(s.format){case 2:let p=[];for(let h of s.ranges)h.classId===f&&(h.end===h.start?p.push(h.start):p.push([h.start,h.end+1]));return p;default:return[]}}function ct(s,f,p){let h=[],v=ce(s.coverage);for(let{glyphId:x}of v){let S=ht(s.inputClassDef,x);for(let[L,k]of S.entries()){if(k===null)continue;let D=s.chainClassSet[k];if(D)for(let[V,N]of D.entries()){let W={individual:{},range:[]},X=ze(W,N.lookupRecords,f,0,L).map(({entry:ve,substitution:Ae})=>({entry:ve,substitutions:[Ae]}));for(let[ve,Ae]of N.input.entries())X=Ke(Rr(s.inputClassDef,Ae),ve+1,X,N.lookupRecords,f);for(let ve of N.lookahead)X=Re(Rr(s.lookaheadClassDef,ve),X);for(let ve of N.backtrack)X=De(Rr(s.backtrackClassDef,ve),X);for(let{entry:ve,substitutions:Ae}of X)ve.lookup={substitutions:Ae,index:p,subIndex:V,length:N.input.length+1,contextRange:[-1*N.backtrack.length,1+N.input.length+N.lookahead.length]};h.push(W)}}}return or(h)}function vt(s,f,p){let h={individual:{},range:[]},v=ce(s.inputCoverage[0]);for(let{glyphId:x}of v){let S=ze(h,s.lookupRecords,f,0,x).map(({entry:L,substitution:k})=>({entry:L,substitutions:[k]}));for(let[L,k]of s.inputCoverage.slice(1).entries())S=Ke(ce(k).map(D=>D.glyphId),L+1,S,s.lookupRecords,f);for(let L of s.lookaheadCoverage)S=Re(ce(L).map(k=>k.glyphId),S);for(let L of s.backtrackCoverage)S=De(ce(L).map(k=>k.glyphId),S);for(let{entry:L,substitutions:k}of S)L.lookup={substitutions:k,index:p,subIndex:0,length:s.inputCoverage.length,contextRange:[-1*s.backtrackCoverage.length,s.inputCoverage.length+s.lookaheadCoverage.length]}}return h}function dt(s,f){let p={individual:{},range:[]},h=ce(s.coverage);for(let{glyphId:v,index:x}of h){let S={};Array.isArray(v)?p.range.push({entry:S,range:v}):p.individual[v]=S;let L=[{entry:S,substitutions:[s.substitutes[x]]}];for(let k of s.lookaheadCoverage)L=Re(ce(k).map(D=>D.glyphId),L);for(let k of s.backtrackCoverage)L=De(ce(k).map(D=>D.glyphId),L);for(let{entry:k,substitutions:D}of L)k.lookup={substitutions:D,index:f,subIndex:0,length:1,contextRange:[-1*s.backtrackCoverage.length,1+s.lookaheadCoverage.length]}}return p}function lr(s,f=new Map){let p={};for(let[h,v]of Object.entries(s.individual))p[h]=ta(v,f);for(let{range:h,entry:v}of s.range){let x=ta(v,f);for(let S=h[0];S<h[1];S++)p[S]=x}return p}function ta(s,f){if(f.has(s))return f.get(s);let p={};return f.set(s,p),s.forward&&(p.forward=lr(s.forward,f)),s.reverse&&(p.reverse=lr(s.reverse,f)),s.lookup&&(p.lookup=s.lookup),p}var gt=class{constructor(f,p){this._lookupTrees=[];this._glyphLookups={};this._font=f,p.cacheSize>0&&(this._cache=new aa.LRUCache({max:p.cacheSize,sizeCalculation:(L,k)=>k.length}));let v=(this._font.tables.gsub&&this._font.tables.gsub.features.filter(L=>L.tag==="calt")||[]).reduce((L,k)=>[...L,...k.feature.lookupListIndexes],[]),x=this._font.tables.gsub&&this._font.tables.gsub.lookups||[],S=x.filter((L,k)=>v.some(D=>D===k));for(let[L,k]of S.entries()){let D=[];switch(k.lookupType){case 6:for(let[N,W]of k.subtables.entries())switch(W.substFormat){case 1:D.push(ft(W,x,N));break;case 2:D.push(ct(W,x,N));break;case 3:D.push(vt(W,x,N));break}break;case 8:for(let[N,W]of k.subtables.entries())D.push(dt(W,N));break}let V=lr(or(D));this._lookupTrees.push({tree:V,processForward:k.lookupType!==8});for(let N of Object.keys(V))this._glyphLookups[N]||(this._glyphLookups[N]=[]),this._glyphLookups[N].push(L)}}findLigatures(f){let p=this._cache&&this._cache.get(f);if(p&&!Array.isArray(p))return p;let h=[];for(let S of f)h.push(this._font.charToGlyphIndex(S));if(this._lookupTrees.length===0)return{inputGlyphs:h,outputGlyphs:h,contextRanges:[]};let v=this._findInternal(h.slice()),x={inputGlyphs:h,outputGlyphs:v.sequence,contextRanges:v.ranges};return this._cache&&this._cache.set(f,x),x}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 x of f)h.push(this._font.charToGlyphIndex(x));let v=this._findInternal(h);return this._cache&&this._cache.set(f,v.ranges),v.ranges}_findInternal(f){let p=[],h=this._getNextLookup(f,0);for(;h.index!==null;){let v=this._lookupTrees[h.index];if(v.processForward){let x=h.last;for(let S=h.first;S<x;S++){let L=ur(v.tree,f,S,S);if(L){for(let k=0;k<L.substitutions.length;k++){let D=L.substitutions[k];D!==null&&(f[S+k]=D)}Cr(p,L.contextRange[0]+S,L.contextRange[1]+S),S+L.length>=x&&(x=S+L.length+1),S+=L.length-1}}}else for(let x=h.last-1;x>=h.first;x--){let S=ur(v.tree,f,x,x);if(S){for(let L=0;L<S.substitutions.length;L++){let k=S.substitutions[L];k!==null&&(f[x+L]=k)}Cr(p,S.contextRange[0]+x,S.contextRange[1]+x),x-=S.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 v=0;v<f.length;v++){let x=this._glyphLookups[f[v]];if(x)for(let S=0;S<x.length;S++){let L=x[S];if(L>=p){(h.index===null||L<=h.index)&&(h.index=L,h.first>v&&(h.first=v),h.last=v+1);break}}}return h}};function ia(s,f){let p=na.parse(s);return new gt(p,{cacheSize:0,...f})}function yt(s){if(typeof s!="string")throw new Error("Font family must be a string");let f={input:s,offset:0},p=[],h="";for(;f.offset<f.input.length;){let v=f.input[f.offset++];switch(v){case"'":case'"':h+=eu(f,v);break;case",":p.push(h),h="";break;default:/\s/.test(v)||(f.offset--,h+=ru(f),p.push(h),h="")}}return p}function eu(s,f){let p="",h=!1;for(;s.offset<s.input.length;){let v=s.input[s.offset++];if(h)/[\dA-Fa-f]/.test(v)?(s.offset--,p+=sa(s)):v!==`
18
+ `&&(p+=v),h=!1;else switch(v){case f:return p;case"\\":h=!0;break;default:p+=v}}throw new Error("Unterminated string")}function ru(s){let f="",p=!1;for(;s.offset<s.input.length;){let h=s.input[s.offset++];if(p)/[\dA-Fa-f]/.test(h)?(s.offset--,f+=sa(s)):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 sa(s){let f="";for(;s.offset<s.input.length;){let p=s.input[s.offset++];if(/\s/.test(p))return mt(f);if(f.length>=6||!/[\dA-Fa-f]/.test(p))return s.offset--,mt(f);f+=p}return mt(f)}function mt(s){return String.fromCodePoint(parseInt(s,16))}var je;async function bt(s,f){if(!je){if(typeof navigator<"u"&&"fonts"in navigator){try{let v=await navigator.permissions.request?.({name:"local-fonts"});if(v&&v.state!=="granted")throw new Error("Permission to access local fonts not granted.")}catch(v){if(v.name!=="TypeError")throw v}let h={};try{let v=await navigator.fonts.query();for(let x of v)h.hasOwnProperty(x.family)||(h[x.family]=[]),h[x.family].push(x);je=Promise.resolve(h)}catch(v){console.error(v.name,v.message)}}else if(typeof window<"u"&&"queryLocalFonts"in window){let h={};try{let v=await window.queryLocalFonts();for(let x of v)h.hasOwnProperty(x.family)||(h[x.family]=[]),h[x.family].push(x);je=Promise.resolve(h)}catch(v){console.error(v.name,v.message)}}je||(je=Promise.resolve({}))}let p=await je;for(let h of yt(s)){if(tu.includes(h))return;if(p.hasOwnProperty(h)&&p[h].length>0){let v=p[h][0];if("blob"in v){let S=await(await v.blob()).arrayBuffer();return ia(S,{cacheSize:f})}return}}}var tu=["serif","sans-serif","cursive","fantasy","monospace","system-ui","emoji","math","fangsong"];var nu=1e5;function oa(s,f=[]){let p,h,v=0,x;return s.registerCharacterJoiner(S=>{let L=s.options.fontFamily;if(L&&(v===0||p!==L)){h=void 0,v=1,p=L;let k=p;bt(k,nu).then(D=>{k===s.options.fontFamily&&(v=2,h=D,D&&s.refresh(0,s.rows-1))}).catch(D=>{k===s.options.fontFamily&&(v=3,s.options.logLevel==="debug"&&console.debug(x,new Error("Failure while loading font")),h=void 0,x=D)})}return h&&v===2?h.findLigatureRanges(S).map(k=>[k[0],k[1]]):au(S,f)})}function au(s,f){let p=[];for(let h=0;h<s.length;h++)for(let v=0;v<f.length;v++)if(s.startsWith(f[v],h)){p.push([h,h+f[v].length]),h+=f[v].length-1;break}return p}var ua=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=oa(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{ua as LigaturesAddon};
19
+ //# sourceMappingURL=addon-ligatures.mjs.map