@unmade/text-renderer 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ce-adapter/ce-types.d.ts +169 -0
- package/dist/ce-adapter/extractTextPlacements.d.ts +11 -0
- package/dist/ce-adapter/index.cjs +1 -0
- package/dist/ce-adapter/index.d.ts +12 -0
- package/dist/ce-adapter/index.js +157 -0
- package/dist/ce-adapter/mapStateToRendererOptions.d.ts +13 -0
- package/dist/ce-adapter/types.d.ts +56 -0
- package/dist/index.cjs +3 -3
- package/dist/index.js +343 -343
- package/dist/node/index.cjs +3 -3
- package/dist/node/index.js +343 -343
- package/dist/worker/index.cjs +8 -8
- package/dist/worker/index.js +628 -628
- package/package.json +15 -2
package/dist/node/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $n=require("svg-path-properties"),Zn=require("linkedom");require("node:path");const Qn=require("@thednp/dommatrix");String.prototype.codePointAt||(function(){var e=(function(){try{var t={},n=Object.defineProperty,a=n(t,t,t)&&n}catch{}return a})(),r=function(t){if(this==null)throw TypeError();var n=String(this),a=n.length,s=t?Number(t):0;if(s!=s&&(s=0),!(s<0||s>=a)){var i=n.charCodeAt(s),u;return i>=55296&&i<=56319&&a>s+1&&(u=n.charCodeAt(s+1),u>=56320&&u<=57343)?(i-55296)*1024+u-56320+65536:i}};e?e(String.prototype,"codePointAt",{value:r,configurable:!0,writable:!0}):String.prototype.codePointAt=r})();var Gr=0,Wt=-3;function He(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function Kn(e,r){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=r,this.destLen=0,this.ltree=new He,this.dtree=new He}var zt=new He,_t=new He,Nr=new Uint8Array(30),Hr=new Uint16Array(30),Vt=new Uint8Array(30),qt=new Uint16Array(30),jn=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),jr=new He,ie=new Uint8Array(320);function Xt(e,r,t,n){var a,s;for(a=0;a<t;++a)e[a]=0;for(a=0;a<30-t;++a)e[a+t]=a/t|0;for(s=n,a=0;a<30;++a)r[a]=s,s+=1<<e[a]}function Jn(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 Jr=new Uint16Array(16);function dr(e,r,t,n){var a,s;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,s=0,a=0;a<16;++a)Jr[a]=s,s+=e.table[a];for(a=0;a<n;++a)r[t+a]&&(e.trans[Jr[r[t+a]]++]=a)}function ea(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var r=e.tag&1;return e.tag>>>=1,r}function oe(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 wr(e,r){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var t=0,n=0,a=0,s=e.tag;do n=2*n+(s&1),s>>>=1,++a,t+=r.table[a],n-=r.table[a];while(n>=0);return e.tag=s,e.bitcount-=a,r.trans[t+n]}function ra(e,r,t){var n,a,s,i,u,o;for(n=oe(e,5,257),a=oe(e,5,1),s=oe(e,4,4),i=0;i<19;++i)ie[i]=0;for(i=0;i<s;++i){var l=oe(e,3,0);ie[jn[i]]=l}for(dr(jr,ie,0,19),u=0;u<n+a;){var f=wr(e,jr);switch(f){case 16:var p=ie[u-1];for(o=oe(e,2,3);o;--o)ie[u++]=p;break;case 17:for(o=oe(e,3,3);o;--o)ie[u++]=0;break;case 18:for(o=oe(e,7,11);o;--o)ie[u++]=0;break;default:ie[u++]=f;break}}dr(r,ie,0,n),dr(t,ie,n,a)}function et(e,r,t){for(;;){var n=wr(e,r);if(n===256)return Gr;if(n<256)e.dest[e.destLen++]=n;else{var a,s,i,u;for(n-=257,a=oe(e,Nr[n],Hr[n]),s=wr(e,t),i=e.destLen-oe(e,Vt[s],qt[s]),u=i;u<i+a;++u)e.dest[e.destLen++]=e.dest[u]}}}function ta(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 Wt;for(e.sourceIndex+=4,n=r;n;--n)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,Gr}function na(e,r){var t=new Kn(e,r),n,a,s;do{switch(n=ea(t),a=oe(t,2,0),a){case 0:s=ta(t);break;case 1:s=et(t,zt,_t);break;case 2:ra(t,t.ltree,t.dtree),s=et(t,t.ltree,t.dtree);break;default:s=Wt}if(s!==Gr)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}Jn(zt,_t);Xt(Nr,Hr,4,3);Xt(Vt,qt,2,1);Nr[28]=0;Hr[28]=258;var aa=na;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 he(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}he.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)};he.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))};he.prototype.addX=function(e){this.addPoint(e,null)};he.prototype.addY=function(e){this.addPoint(null,e)};he.prototype.addBezier=function(e,r,t,n,a,s,i,u){var o=[e,r],l=[t,n],f=[a,s],p=[i,u];this.addPoint(e,r),this.addPoint(i,u);for(var c=0;c<=1;c++){var h=6*o[c]-12*l[c]+6*f[c],d=-3*o[c]+9*l[c]-9*f[c]+3*p[c],g=3*l[c]-3*o[c];if(d===0){if(h===0)continue;var m=-g/h;0<m&&m<1&&(c===0&&this.addX(we(o[c],l[c],f[c],p[c],m)),c===1&&this.addY(we(o[c],l[c],f[c],p[c],m)));continue}var y=Math.pow(h,2)-4*g*d;if(!(y<0)){var U=(-h+Math.sqrt(y))/(2*d);0<U&&U<1&&(c===0&&this.addX(we(o[c],l[c],f[c],p[c],U)),c===1&&this.addY(we(o[c],l[c],f[c],p[c],U)));var x=(-h-Math.sqrt(y))/(2*d);0<x&&x<1&&(c===0&&this.addX(we(o[c],l[c],f[c],p[c],x)),c===1&&this.addY(we(o[c],l[c],f[c],p[c],x)))}}};he.prototype.addQuad=function(e,r,t,n,a,s){var i=e+.6666666666666666*(t-e),u=r+2/3*(n-r),o=i+1/3*(a-e),l=u+1/3*(s-r);this.addBezier(e,r,i,u,o,l,a,s)};function V(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}V.prototype.moveTo=function(e,r){this.commands.push({type:"M",x:e,y:r})};V.prototype.lineTo=function(e,r){this.commands.push({type:"L",x:e,y:r})};V.prototype.curveTo=V.prototype.bezierCurveTo=function(e,r,t,n,a,s){this.commands.push({type:"C",x1:e,y1:r,x2:t,y2:n,x:a,y:s})};V.prototype.quadTo=V.prototype.quadraticCurveTo=function(e,r,t,n){this.commands.push({type:"Q",x1:e,y1:r,x:t,y:n})};V.prototype.close=V.prototype.closePath=function(){this.commands.push({type:"Z"})};V.prototype.extend=function(e){if(e.commands)e=e.commands;else if(e instanceof he){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)};V.prototype.getBoundingBox=function(){for(var e=new he,r=0,t=0,n=0,a=0,s=0;s<this.commands.length;s++){var i=this.commands[s];switch(i.type){case"M":e.addPoint(i.x,i.y),r=n=i.x,t=a=i.y;break;case"L":e.addPoint(i.x,i.y),n=i.x,a=i.y;break;case"Q":e.addQuad(n,a,i.x1,i.y1,i.x,i.y),n=i.x,a=i.y;break;case"C":e.addBezier(n,a,i.x1,i.y1,i.x2,i.y2,i.x,i.y),n=i.x,a=i.y;break;case"Z":n=r,a=t;break;default:throw new Error("Unexpected path command "+i.type)}}return e.isEmpty()&&e.addPoint(0,0),e};V.prototype.draw=function(e){e.beginPath();for(var r=0;r<this.commands.length;r+=1){var t=this.commands[r];t.type==="M"?e.moveTo(t.x,t.y):t.type==="L"?e.lineTo(t.x,t.y):t.type==="C"?e.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y):t.type==="Q"?e.quadraticCurveTo(t.x1,t.y1,t.x,t.y):t.type==="Z"&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())};V.prototype.toPathData=function(e){e=e!==void 0?e:2;function r(i){return Math.round(i)===i?""+Math.round(i):i.toFixed(e)}function t(){for(var i=arguments,u="",o=0;o<arguments.length;o+=1){var l=i[o];l>=0&&o>0&&(u+=" "),u+=r(l)}return u}for(var n="",a=0;a<this.commands.length;a+=1){var s=this.commands[a];s.type==="M"?n+="M"+t(s.x,s.y):s.type==="L"?n+="L"+t(s.x,s.y):s.type==="C"?n+="C"+t(s.x1,s.y1,s.x2,s.y2,s.x,s.y):s.type==="Q"?n+="Q"+t(s.x1,s.y1,s.x,s.y):s.type==="Z"&&(n+="Z")}return n};V.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};V.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 Yt(e){throw new Error(e)}function rt(e,r){e||Yt(r)}var E={fail:Yt,argument:rt,assert:rt},tt=32768,nt=2147483648,Oe={},b={},O={};function ne(e){return function(){return e}}b.BYTE=function(e){return E.argument(e>=0&&e<=255,"Byte value should be between 0 and 255."),[e]};O.BYTE=ne(1);b.CHAR=function(e){return[e.charCodeAt(0)]};O.CHAR=ne(1);b.CHARARRAY=function(e){typeof e>"u"&&(e="",console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));for(var r=[],t=0;t<e.length;t+=1)r[t]=e.charCodeAt(t);return r};O.CHARARRAY=function(e){return typeof e>"u"?0:e.length};b.USHORT=function(e){return[e>>8&255,e&255]};O.USHORT=ne(2);b.SHORT=function(e){return e>=tt&&(e=-(2*tt-e)),[e>>8&255,e&255]};O.SHORT=ne(2);b.UINT24=function(e){return[e>>16&255,e>>8&255,e&255]};O.UINT24=ne(3);b.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]};O.ULONG=ne(4);b.LONG=function(e){return e>=nt&&(e=-(2*nt-e)),[e>>24&255,e>>16&255,e>>8&255,e&255]};O.LONG=ne(4);b.FIXED=b.ULONG;O.FIXED=O.ULONG;b.FWORD=b.SHORT;O.FWORD=O.SHORT;b.UFWORD=b.USHORT;O.UFWORD=O.USHORT;b.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,e&255]};O.LONGDATETIME=ne(8);b.TAG=function(e){return E.argument(e.length===4,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]};O.TAG=ne(4);b.Card8=b.BYTE;O.Card8=O.BYTE;b.Card16=b.USHORT;O.Card16=O.USHORT;b.OffSize=b.BYTE;O.OffSize=O.BYTE;b.SID=b.USHORT;O.SID=O.USHORT;b.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?b.NUMBER16(e):b.NUMBER32(e)};O.NUMBER=function(e){return b.NUMBER(e).length};b.NUMBER16=function(e){return[28,e>>8&255,e&255]};O.NUMBER16=ne(3);b.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,e&255]};O.NUMBER32=ne(5);b.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="",s=0,i=r.length;s<i;s+=1){var u=r[s];u==="e"?a+=r[++s]==="-"?"c":"b":u==="."?a+="a":u==="-"?a+="e":a+=u}a+=a.length&1?"f":"ff";for(var o=[30],l=0,f=a.length;l<f;l+=2)o.push(parseInt(a.substr(l,2),16));return o};O.REAL=function(e){return b.REAL(e).length};b.NAME=b.CHARARRAY;O.NAME=O.CHARARRAY;b.STRING=b.CHARARRAY;O.STRING=O.CHARARRAY;Oe.UTF8=function(e,r,t){for(var n=[],a=t,s=0;s<a;s++,r+=1)n[s]=e.getUint8(r);return String.fromCharCode.apply(null,n)};Oe.UTF16=function(e,r,t){for(var n=[],a=t/2,s=0;s<a;s++,r+=2)n[s]=e.getUint16(r);return String.fromCharCode.apply(null,n)};b.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};O.UTF16=function(e){return e.length*2};var Er={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};Oe.MACSTRING=function(e,r,t,n){var a=Er[n];if(a!==void 0){for(var s="",i=0;i<t;i++){var u=e.getUint8(r+i);u<=127?s+=String.fromCharCode(u):s+=a[u&127]}return s}};var Ze=typeof WeakMap=="function"&&new WeakMap,Qe,sa=function(e){if(!Qe){Qe={};for(var r in Er)Qe[r]=new String(r)}var t=Qe[e];if(t!==void 0){if(Ze){var n=Ze.get(t);if(n!==void 0)return n}var a=Er[e];if(a!==void 0){for(var s={},i=0;i<a.length;i++)s[a.charCodeAt(i)]=i+128;return Ze&&Ze.set(t,s),s}}};b.MACSTRING=function(e,r){var t=sa(r);if(t!==void 0){for(var n=[],a=0;a<e.length;a++){var s=e.charCodeAt(a);if(s>=128&&(s=t[s],s===void 0))return;n[a]=s}return n}};O.MACSTRING=function(e,r){var t=b.MACSTRING(e,r);return t!==void 0?t.length:0};function Or(e){return e>=-128&&e<=127}function ia(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 oa(e,r,t){for(var n=0,a=e.length,s=r;s<a&&n<64;){var i=e[s];if(!Or(i)||i===0&&s+1<a&&e[s+1]===0)break;++s,++n}t.push(n-1);for(var u=r;u<s;++u)t.push(e[u]+256&255);return s}function ua(e,r,t){for(var n=0,a=e.length,s=r;s<a&&n<64;){var i=e[s];if(i===0||Or(i)&&s+1<a&&Or(e[s+1]))break;++s,++n}t.push(64|n-1);for(var u=r;u<s;++u){var o=e[u];t.push(o+65536>>8&255,o+256&255)}return s}b.VARDELTAS=function(e){for(var r=0,t=[];r<e.length;){var n=e[r];n===0?r=ia(e,r,t):n>=-128&&n<=127?r=oa(e,r,t):r=ua(e,r,t)}return t};b.INDEX=function(e){for(var r=1,t=[r],n=[],a=0;a<e.length;a+=1){var s=b.OBJECT(e[a]);Array.prototype.push.apply(n,s),r+=s.length,t.push(r)}if(n.length===0)return[0,0];for(var i=[],u=1+Math.floor(Math.log(r)/Math.log(2))/8|0,o=[void 0,b.BYTE,b.USHORT,b.UINT24,b.ULONG][u],l=0;l<t.length;l+=1){var f=o(t[l]);Array.prototype.push.apply(i,f)}return Array.prototype.concat(b.Card16(e.length),b.OffSize(u),i,n)};O.INDEX=function(e){return b.INDEX(e).length};b.DICT=function(e){for(var r=[],t=Object.keys(e),n=t.length,a=0;a<n;a+=1){var s=parseInt(t[a],0),i=e[s];r=r.concat(b.OPERAND(i.value,i.type)),r=r.concat(b.OPERATOR(s))}return r};O.DICT=function(e){return b.DICT(e).length};b.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]};b.OPERAND=function(e,r){var t=[];if(Array.isArray(r))for(var n=0;n<r.length;n+=1)E.argument(e.length===r.length,"Not enough arguments given for type"+r),t=t.concat(b.OPERAND(e[n],r[n]));else if(r==="SID")t=t.concat(b.NUMBER(e));else if(r==="offset")t=t.concat(b.NUMBER32(e));else if(r==="number")t=t.concat(b.NUMBER(e));else if(r==="real")t=t.concat(b.REAL(e));else throw new Error("Unknown operand type "+r);return t};b.OP=b.BYTE;O.OP=O.BYTE;var Ke=typeof WeakMap=="function"&&new WeakMap;b.CHARSTRING=function(e){if(Ke){var r=Ke.get(e);if(r!==void 0)return r}for(var t=[],n=e.length,a=0;a<n;a+=1){var s=e[a];t=t.concat(b[s.type](s.value))}return Ke&&Ke.set(e,t),t};O.CHARSTRING=function(e){return b.CHARSTRING(e).length};b.OBJECT=function(e){var r=b[e.type];return E.argument(r!==void 0,"No encoding function for type "+e.type),r(e.value)};O.OBJECT=function(e){var r=O[e.type];return E.argument(r!==void 0,"No sizeOf function for type "+e.type),r(e.value)};b.TABLE=function(e){for(var r=[],t=e.fields.length,n=[],a=[],s=0;s<t;s+=1){var i=e.fields[s],u=b[i.type];E.argument(u!==void 0,"No encoding function for field type "+i.type+" ("+i.name+")");var o=e[i.name];o===void 0&&(o=i.value);var l=u(o);i.type==="TABLE"?(a.push(r.length),r=r.concat([0,0]),n.push(l)):r=r.concat(l)}for(var f=0;f<n.length;f+=1){var p=a[f],c=r.length;E.argument(c<65536,"Table "+e.tableName+" too big."),r[p]=c>>8,r[p+1]=c&255,r=r.concat(n[f])}return r};O.TABLE=function(e){for(var r=0,t=e.fields.length,n=0;n<t;n+=1){var a=e.fields[n],s=O[a.type];E.argument(s!==void 0,"No sizeOf function for field type "+a.type+" ("+a.name+")");var i=e[a.name];i===void 0&&(i=a.value),r+=s(i),a.type==="TABLE"&&(r+=2)}return r};b.RECORD=b.TABLE;O.RECORD=O.TABLE;b.LITERAL=function(e){return e};O.LITERAL=function(e){return e.length};function Z(e,r,t){if(r.length&&(r[0].name!=="coverageFormat"||r[0].value===1))for(var n=0;n<r.length;n+=1){var a=r[n];this[a.name]=a.value}if(this.tableName=e,this.fields=r,t)for(var s=Object.keys(t),i=0;i<s.length;i+=1){var u=s[i],o=t[u];this[u]!==void 0&&(this[u]=o)}}Z.prototype.encode=function(){return b.TABLE(this)};Z.prototype.sizeOf=function(){return O.TABLE(this)};function We(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 Lr(e,r,t){var n=r.length,a=new Array(n+1);a[0]={name:e+"Count",type:"USHORT",value:n};for(var s=0;s<n;s++)a[s+1]={name:e+s,type:"TABLE",value:t(r[s],s)};return a}function ze(e,r,t){var n=r.length,a=[];a[0]={name:e+"Count",type:"USHORT",value:n};for(var s=0;s<n;s++)a=a.concat(t(r[s],s));return a}function tr(e){e.format===1?Z.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(We("glyph",e.glyphs))):e.format===2?Z.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:2}].concat(ze("rangeRecord",e.ranges,function(r){return[{name:"startGlyphID",type:"USHORT",value:r.start},{name:"endGlyphID",type:"USHORT",value:r.end},{name:"startCoverageIndex",type:"USHORT",value:r.index}]}))):E.assert(!1,"Coverage format must be 1 or 2.")}tr.prototype=Object.create(Z.prototype);tr.prototype.constructor=tr;function nr(e){Z.call(this,"scriptListTable",ze("scriptRecord",e,function(r,t){var n=r.script,a=n.defaultLangSys;return E.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 Z("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new Z("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:a.reqFeatureIndex}].concat(We("featureIndex",a.featureIndexes)))}].concat(ze("langSys",n.langSysRecords,function(s,i){var u=s.langSys;return[{name:"langSysTag"+i,type:"TAG",value:s.tag},{name:"langSys"+i,type:"TABLE",value:new Z("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:u.reqFeatureIndex}].concat(We("featureIndex",u.featureIndexes)))}]})))}]}))}nr.prototype=Object.create(Z.prototype);nr.prototype.constructor=nr;function ar(e){Z.call(this,"featureListTable",ze("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 Z("featureTable",[{name:"featureParams",type:"USHORT",value:n.featureParams}].concat(We("lookupListIndex",n.lookupListIndexes)))}]}))}ar.prototype=Object.create(Z.prototype);ar.prototype.constructor=ar;function sr(e,r){Z.call(this,"lookupListTable",Lr("lookup",e,function(t){var n=r[t.lookupType];return E.assert(!!n,"Unable to write GSUB lookup type "+t.lookupType+" tables."),new Z("lookupTable",[{name:"lookupType",type:"USHORT",value:t.lookupType},{name:"lookupFlag",type:"USHORT",value:t.lookupFlag}].concat(Lr("subtable",t.subtables,n)))}))}sr.prototype=Object.create(Z.prototype);sr.prototype.constructor=sr;var S={Table:Z,Record:Z,Coverage:tr,ScriptList:nr,FeatureList:ar,LookupList:sr,ushortList:We,tableList:Lr,recordList:ze};function at(e,r){return e.getUint8(r)}function ir(e,r){return e.getUint16(r,!1)}function la(e,r){return e.getInt16(r,!1)}function Wr(e,r){return e.getUint32(r,!1)}function $t(e,r){var t=e.getInt16(r,!1),n=e.getUint16(r+2,!1);return t+n/65535}function fa(e,r){for(var t="",n=r;n<r+4;n+=1)t+=String.fromCharCode(e.getInt8(n));return t}function ca(e,r,t){for(var n=0,a=0;a<t;a+=1)n<<=8,n+=e.getUint8(r+a);return n}function pa(e,r,t){for(var n=[],a=r;a<t;a+=1)n.push(e.getUint8(a));return n}function ha(e){for(var r="",t=0;t<e.length;t+=1)r+=String.fromCharCode(e[t]);return r}var va={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function v(e,r){this.data=e,this.offset=r,this.relativeOffset=0}v.prototype.parseByte=function(){var e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e};v.prototype.parseChar=function(){var e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e};v.prototype.parseCard8=v.prototype.parseByte;v.prototype.parseUShort=function(){var e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e};v.prototype.parseCard16=v.prototype.parseUShort;v.prototype.parseSID=v.prototype.parseUShort;v.prototype.parseOffset16=v.prototype.parseUShort;v.prototype.parseShort=function(){var e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e};v.prototype.parseF2Dot14=function(){var e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e};v.prototype.parseULong=function(){var e=Wr(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e};v.prototype.parseOffset32=v.prototype.parseULong;v.prototype.parseFixed=function(){var e=$t(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e};v.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};v.prototype.parseTag=function(){return this.parseString(4)};v.prototype.parseLongDateTime=function(){var e=Wr(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e};v.prototype.parseVersion=function(e){var r=ir(this.data,this.offset+this.relativeOffset),t=ir(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,e===void 0&&(e=4096),r+t/e/10};v.prototype.skip=function(e,r){r===void 0&&(r=1),this.relativeOffset+=va[e]*r};v.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};v.prototype.parseOffset16List=v.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};v.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};v.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};v.prototype.parseList=function(e,r){r||(r=e,e=this.parseUShort());for(var t=new Array(e),n=0;n<e;n++)t[n]=r.call(this);return t};v.prototype.parseList32=function(e,r){r||(r=e,e=this.parseULong());for(var t=new Array(e),n=0;n<e;n++)t[n]=r.call(this);return t};v.prototype.parseRecordList=function(e,r){r||(r=e,e=this.parseUShort());for(var t=new Array(e),n=Object.keys(r),a=0;a<e;a++){for(var s={},i=0;i<n.length;i++){var u=n[i],o=r[u];s[u]=o.call(this)}t[a]=s}return t};v.prototype.parseRecordList32=function(e,r){r||(r=e,e=this.parseULong());for(var t=new Array(e),n=Object.keys(r),a=0;a<e;a++){for(var s={},i=0;i<n.length;i++){var u=n[i],o=r[u];s[u]=o.call(this)}t[a]=s}return t};v.prototype.parseStruct=function(e){if(typeof e=="function")return e.call(this);for(var r=Object.keys(e),t={},n=0;n<r.length;n++){var a=r[n],s=e[a];t[a]=s.call(this)}return t};v.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}};v.prototype.parseValueRecordList=function(){for(var e=this.parseUShort(),r=this.parseUShort(),t=new Array(r),n=0;n<r;n++)t[n]=this.parseValueRecord(e);return t};v.prototype.parsePointer=function(e){var r=this.parseOffset16();if(r>0)return new v(this.data,this.offset+r).parseStruct(e)};v.prototype.parsePointer32=function(e){var r=this.parseOffset32();if(r>0)return new v(this.data,this.offset+r).parseStruct(e)};v.prototype.parseListOfLists=function(e){for(var r=this.parseOffset16List(),t=r.length,n=this.relativeOffset,a=new Array(t),s=0;s<t;s++){var i=r[s];if(i===0){a[s]=void 0;continue}if(this.relativeOffset=i,e){for(var u=this.parseOffset16List(),o=new Array(u.length),l=0;l<u.length;l++)this.relativeOffset=i+u[l],o[l]=e.call(this);a[s]=o}else a[s]=this.parseUShortList()}return this.relativeOffset=n,a};v.prototype.parseCoverage=function(){var e=this.offset+this.relativeOffset,r=this.parseUShort(),t=this.parseUShort();if(r===1)return{format:1,glyphs:this.parseUShortList(t)};if(r===2){for(var n=new Array(t),a=0;a<t;a++)n[a]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:n}}throw new Error("0x"+e.toString(16)+": Coverage format must be 1 or 2.")};v.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:v.uShort,end:v.uShort,classId:v.uShort})};throw new Error("0x"+e.toString(16)+": ClassDef format must be 1 or 2.")};v.list=function(e,r){return function(){return this.parseList(e,r)}};v.list32=function(e,r){return function(){return this.parseList32(e,r)}};v.recordList=function(e,r){return function(){return this.parseRecordList(e,r)}};v.recordList32=function(e,r){return function(){return this.parseRecordList32(e,r)}};v.pointer=function(e){return function(){return this.parsePointer(e)}};v.pointer32=function(e){return function(){return this.parsePointer32(e)}};v.tag=v.prototype.parseTag;v.byte=v.prototype.parseByte;v.uShort=v.offset16=v.prototype.parseUShort;v.uShortList=v.prototype.parseUShortList;v.uLong=v.offset32=v.prototype.parseULong;v.uLongList=v.prototype.parseULongList;v.struct=v.prototype.parseStruct;v.coverage=v.prototype.parseCoverage;v.classDef=v.prototype.parseClassDef;var st={reserved:v.uShort,reqFeatureIndex:v.uShort,featureIndexes:v.uShortList};v.prototype.parseScriptList=function(){return this.parsePointer(v.recordList({tag:v.tag,script:v.pointer({defaultLangSys:v.pointer(st),langSysRecords:v.recordList({tag:v.tag,langSys:v.pointer(st)})})}))||[]};v.prototype.parseFeatureList=function(){return this.parsePointer(v.recordList({tag:v.tag,feature:v.pointer({featureParams:v.offset16,lookupListIndexes:v.uShortList})}))||[]};v.prototype.parseLookupList=function(e){return this.parsePointer(v.list(v.pointer(function(){var r=this.parseUShort();E.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(v.pointer(e[r])),markFilteringSet:n?this.parseUShort():void 0}})))||[]};v.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){var e=this.parseUShort(),r=this.parseUShort();E.argument(e===1&&r<1,"GPOS/GSUB feature variations table unknown.");var t=this.parseRecordList32({conditionSetOffset:v.offset32,featureTableSubstitutionOffset:v.offset32});return t})||[]};var F={getByte:at,getCard8:at,getUShort:ir,getCard16:ir,getShort:la,getULong:Wr,getFixed:$t,getTag:fa,getOffset:ca,getBytes:pa,bytesToString:ha,Parser:v};function da(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(),s=r.parseULong(),i=r.parseULong(),u=a;u<=s;u+=1)e.glyphIndexMap[u]=i,i++}function ga(e,r,t,n,a){e.length=r.parseUShort(),e.language=r.parseUShort();var s;e.segCount=s=r.parseUShort()>>1,r.skip("uShort",3),e.glyphIndexMap={};for(var i=new F.Parser(t,n+a+14),u=new F.Parser(t,n+a+16+s*2),o=new F.Parser(t,n+a+16+s*4),l=new F.Parser(t,n+a+16+s*6),f=n+a+16+s*8,p=0;p<s-1;p+=1)for(var c=void 0,h=i.parseUShort(),d=u.parseUShort(),g=o.parseShort(),m=l.parseUShort(),y=d;y<=h;y+=1)m!==0?(f=l.offset+l.relativeOffset-2,f+=m,f+=(y-d)*2,c=F.getUShort(t,f),c!==0&&(c=c+g&65535)):c=y+g&65535,e.glyphIndexMap[y]=c}function ma(e,r){var t={};t.version=F.getUShort(e,r),E.argument(t.version===0,"cmap table version should be 0."),t.numTables=F.getUShort(e,r+2);for(var n=-1,a=t.numTables-1;a>=0;a-=1){var s=F.getUShort(e,r+4+a*8),i=F.getUShort(e,r+4+a*8+2);if(s===3&&(i===0||i===1||i===10)||s===0&&(i===0||i===1||i===2||i===3||i===4)){n=F.getULong(e,r+4+a*8+4);break}}if(n===-1)throw new Error("No valid cmap sub-tables found.");var u=new F.Parser(e,r+n);if(t.format=u.parseUShort(),t.format===12)da(t,u);else if(t.format===4)ga(t,u,e,r,n);else throw new Error("Only format 4 and 12 cmap tables are supported (found format "+t.format+").");return t}function ya(e,r,t){e.segments.push({end:r,start:r,delta:-(r-t),offset:0,glyphIndex:t})}function xa(e){e.segments.push({end:65535,start:65535,delta:1,offset:0})}function ba(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 s=new S.Table("cmap",a);for(s.segments=[],t=0;t<e.length;t+=1){for(var i=e.get(t),u=0;u<i.unicodes.length;u+=1)ya(s,i.unicodes[u],t);s.segments=s.segments.sort(function(U,x){return U.start-x.start})}xa(s);var o=s.segments.length,l=0,f=[],p=[],c=[],h=[],d=[],g=[];for(t=0;t<o;t+=1){var m=s.segments[t];m.end<=65535&&m.start<=65535?(f=f.concat({name:"end_"+t,type:"USHORT",value:m.end}),p=p.concat({name:"start_"+t,type:"USHORT",value:m.start}),c=c.concat({name:"idDelta_"+t,type:"SHORT",value:m.delta}),h=h.concat({name:"idRangeOffset_"+t,type:"USHORT",value:m.offset}),m.glyphId!==void 0&&(d=d.concat({name:"glyph_"+t,type:"USHORT",value:m.glyphId}))):l+=1,!r&&m.glyphIndex!==void 0&&(g=g.concat({name:"cmap12Start_"+t,type:"ULONG",value:m.start}),g=g.concat({name:"cmap12End_"+t,type:"ULONG",value:m.end}),g=g.concat({name:"cmap12Glyph_"+t,type:"ULONG",value:m.glyphIndex}))}if(s.segCountX2=(o-l)*2,s.searchRange=Math.pow(2,Math.floor(Math.log(o-l)/Math.log(2)))*2,s.entrySelector=Math.log(s.searchRange/2)/Math.log(2),s.rangeShift=s.segCountX2-s.searchRange,s.fields=s.fields.concat(f),s.fields.push({name:"reservedPad",type:"USHORT",value:0}),s.fields=s.fields.concat(p),s.fields=s.fields.concat(c),s.fields=s.fields.concat(h),s.fields=s.fields.concat(d),s.cmap4Length=14+f.length*2+2+p.length*2+c.length*2+h.length*2+d.length*2,!r){var y=16+g.length*4;s.cmap12Offset=20+s.cmap4Length,s.fields=s.fields.concat([{name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:y},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:g.length/3}]),s.fields=s.fields.concat(g)}return s}var Zt={parse:ma,make:ba},er=[".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"],Sa=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],Ta=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],ke=[".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 Qt(e){this.font=e}Qt.prototype.charToGlyphIndex=function(e){var r=e.codePointAt(0),t=this.font.glyphs;if(t){for(var n=0;n<t.length;n+=1)for(var a=t.get(n),s=0;s<a.unicodes.length;s+=1)if(a.unicodes[s]===r)return n}return null};function Kt(e){this.cmap=e}Kt.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.codePointAt(0)]||0};function or(e,r){this.encoding=e,this.charset=r}or.prototype.charToGlyphIndex=function(e){var r=e.codePointAt(0),t=this.encoding[r];return this.charset.indexOf(t)};function zr(e){switch(e.version){case 1:this.names=ke.slice();break;case 2:this.names=new Array(e.numberOfGlyphs);for(var r=0;r<e.numberOfGlyphs;r++)e.glyphNameIndex[r]<ke.length?this.names[r]=ke[e.glyphNameIndex[r]]:this.names[r]=e.names[e.glyphNameIndex[r]-ke.length];break;case 2.5:this.names=new Array(e.numberOfGlyphs);for(var t=0;t<e.numberOfGlyphs;t++)this.names[t]=ke[t+e.glyphNameIndex[t]];break;case 3:this.names=[];break;default:this.names=[];break}}zr.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)};zr.prototype.glyphIndexToName=function(e){return this.names[e]};function ka(e){for(var r,t=e.tables.cmap.glyphIndexMap,n=Object.keys(t),a=0;a<n.length;a+=1){var s=n[a],i=t[s];r=e.glyphs.get(i),r.addUnicode(parseInt(s))}for(var u=0;u<e.glyphs.length;u+=1)r=e.glyphs.get(u),e.cffEncoding?e.isCIDFont?r.name="gid"+u:r.name=e.cffEncoding.charset[u]:e.glyphNames.names&&(r.name=e.glyphNames.glyphIndexToName(u))}function Fa(e){e._IndexToUnicodeMap={};for(var r=e.tables.cmap.glyphIndexMap,t=Object.keys(r),n=0;n<t.length;n+=1){var a=t[n],s=r[a];e._IndexToUnicodeMap[s]===void 0?e._IndexToUnicodeMap[s]={unicodes:[parseInt(a)]}:e._IndexToUnicodeMap[s].unicodes.push(parseInt(a))}}function Ua(e,r){r.lowMemory?Fa(e):ka(e)}function Ca(e,r,t,n,a){e.beginPath(),e.moveTo(r,t),e.lineTo(n,a),e.stroke()}var Te={line:Ca};function wa(e,r){var t=r||new V;return{configurable:!0,get:function(){return typeof t=="function"&&(t=t()),t},set:function(n){t=n}}}function K(e){this.bindConstructorValues(e)}K.prototype.bindConstructorValues=function(e){this.index=e.index||0,this.name=e.name||null,this.unicode=e.unicode||void 0,this.unicodes=e.unicodes||e.unicode!==void 0?[e.unicode]:[],"xMin"in e&&(this.xMin=e.xMin),"yMin"in e&&(this.yMin=e.yMin),"xMax"in e&&(this.xMax=e.xMax),"yMax"in e&&(this.yMax=e.yMax),"advanceWidth"in e&&(this.advanceWidth=e.advanceWidth),Object.defineProperty(this,"path",wa(this,e.path))};K.prototype.addUnicode=function(e){this.unicodes.length===0&&(this.unicode=e),this.unicodes.push(e)};K.prototype.getBoundingBox=function(){return this.path.getBoundingBox()};K.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 s,i;n||(n={});var u=n.xScale,o=n.yScale;if(n.hinting&&a&&a.hinting&&(i=this.path&&a.hinting.exec(this,t)),i)s=a.hinting.getCommands(i),e=Math.round(e),r=Math.round(r),u=o=1;else{s=this.path.commands;var l=1/(this.path.unitsPerEm||1e3)*t;u===void 0&&(u=l),o===void 0&&(o=l)}for(var f=new V,p=0;p<s.length;p+=1){var c=s[p];c.type==="M"?f.moveTo(e+c.x*u,r+-c.y*o):c.type==="L"?f.lineTo(e+c.x*u,r+-c.y*o):c.type==="Q"?f.quadraticCurveTo(e+c.x1*u,r+-c.y1*o,e+c.x*u,r+-c.y*o):c.type==="C"?f.curveTo(e+c.x1*u,r+-c.y1*o,e+c.x2*u,r+-c.y2*o,e+c.x*u,r+-c.y*o):c.type==="Z"&&f.closePath()}return f};K.prototype.getContours=function(){if(this.points===void 0)return[];for(var e=[],r=[],t=0;t<this.points.length;t+=1){var n=this.points[t];r.push(n),n.lastPointOfContour&&(e.push(r),r=[])}return E.argument(r.length===0,"There are still points left in the current contour."),e};K.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 s={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(s.xMin)||(s.xMin=0),isFinite(s.xMax)||(s.xMax=this.advanceWidth),isFinite(s.yMin)||(s.yMin=0),isFinite(s.yMax)||(s.yMax=0),s.rightSideBearing=this.advanceWidth-s.leftSideBearing-(s.xMax-s.xMin),s};K.prototype.draw=function(e,r,t,n,a){this.getPath(r,t,n,a).draw(e)};K.prototype.drawPoints=function(e,r,t,n){function a(p,c,h,d){e.beginPath();for(var g=0;g<p.length;g+=1)e.moveTo(c+p[g].x*d,h+p[g].y*d),e.arc(c+p[g].x*d,h+p[g].y*d,2,0,Math.PI*2,!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 s=1/this.path.unitsPerEm*n,i=[],u=[],o=this.path,l=0;l<o.commands.length;l+=1){var f=o.commands[l];f.x!==void 0&&i.push({x:f.x,y:-f.y}),f.x1!==void 0&&u.push({x:f.x1,y:-f.y1}),f.x2!==void 0&&u.push({x:f.x2,y:-f.y2})}e.fillStyle="blue",a(i,r,t,s),e.fillStyle="red",a(u,r,t,s)};K.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",Te.line(e,r,-1e4,r,1e4),Te.line(e,-1e4,t,1e4,t);var s=this.xMin||0,i=this.yMin||0,u=this.xMax||0,o=this.yMax||0,l=this.advanceWidth||0;e.strokeStyle="blue",Te.line(e,r+s*a,-1e4,r+s*a,1e4),Te.line(e,r+u*a,-1e4,r+u*a,1e4),Te.line(e,-1e4,t+-i*a,1e4,t+-i*a),Te.line(e,-1e4,t+-o*a,1e4,t+-o*a),e.strokeStyle="green",Te.line(e,r+l*a,-1e4,r+l*a,1e4)};function je(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){if(this.font=e,this.glyphs={},Array.isArray(r))for(var t=0;t<r.length;t++){var n=r[t];n.path.unitsPerEm=e.unitsPerEm,this.glyphs[t]=n}this.length=r&&r.length||0}_r.prototype.get=function(e){if(this.glyphs[e]===void 0){this.font._push(e),typeof this.glyphs[e]=="function"&&(this.glyphs[e]=this.glyphs[e]());var r=this.glyphs[e],t=this.font._IndexToUnicodeMap[e];if(t)for(var n=0;n<t.unicodes.length;n++)r.addUnicode(t.unicodes[n]);this.font.cffEncoding?this.font.isCIDFont?r.name="gid"+e:r.name=this.font.cffEncoding.charset[e]:this.font.glyphNames.names&&(r.name=this.font.glyphNames.glyphIndexToName(e)),this.glyphs[e].advanceWidth=this.font._hmtxTableData[e].advanceWidth,this.glyphs[e].leftSideBearing=this.font._hmtxTableData[e].leftSideBearing}else typeof this.glyphs[e]=="function"&&(this.glyphs[e]=this.glyphs[e]());return this.glyphs[e]};_r.prototype.push=function(e,r){this.glyphs[e]=r,this.length++};function Ea(e,r){return new K({index:r,font:e})}function Oa(e,r,t,n,a,s){return function(){var i=new K({index:r,font:e});return i.path=function(){t(i,n,a);var u=s(e.glyphs,i);return u.unitsPerEm=e.unitsPerEm,u},je(i,"xMin","_xMin"),je(i,"xMax","_xMax"),je(i,"yMin","_yMin"),je(i,"yMax","_yMax"),i}}function La(e,r,t,n){return function(){var a=new K({index:r,font:e});return a.path=function(){var s=t(e,a,n);return s.unitsPerEm=e.unitsPerEm,s},a}}var le={GlyphSet:_r,glyphLoader:Ea,ttfGlyphLoader:Oa,cffGlyphLoader:La};function jt(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(!jt(e[t],r[t]))return!1;return!0}else return!1}function Rr(e){var r;return e.length<1240?r=107:e.length<33900?r=1131:r=32768,r}function ye(e,r,t){var n=[],a=[],s=F.getCard16(e,r),i,u;if(s!==0){var o=F.getByte(e,r+2);i=r+(s+1)*o+2;for(var l=r+3,f=0;f<s+1;f+=1)n.push(F.getOffset(e,l,o)),l+=o;u=i+n[s]}else u=r+2;for(var p=0;p<n.length-1;p+=1){var c=F.getBytes(e,i+n[p],i+n[p+1]);t&&(c=t(c)),a.push(c)}return{objects:a,startOffset:r,endOffset:u}}function Ra(e,r){var t=[],n=F.getCard16(e,r),a,s;if(n!==0){var i=F.getByte(e,r+2);a=r+(n+1)*i+2;for(var u=r+3,o=0;o<n+1;o+=1)t.push(F.getOffset(e,u,i)),u+=i;s=a+t[n]}else s=r+2;return{offsets:t,startOffset:r,endOffset:s}}function Da(e,r,t,n,a){var s=F.getCard16(t,n),i=0;if(s!==0){var u=F.getByte(t,n+2);i=n+(s+1)*u+2}var o=F.getBytes(t,i+r[e],i+r[e+1]);return o}function Aa(e){for(var r="",t=15,n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var a=e.parseByte(),s=a>>4,i=a&15;if(s===t||(r+=n[s],i===t))break;r+=n[i]}return parseFloat(r)}function Ba(e,r){var t,n,a,s;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(),s=e.parseByte(),t<<24|n<<16|a<<8|s;if(r===30)return Aa(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 Ma(e){for(var r={},t=0;t<e.length;t+=1){var n=e[t][0],a=e[t][1],s=void 0;if(a.length===1?s=a[0]:s=a,r.hasOwnProperty(n)&&!isNaN(r[n]))throw new Error("Object "+r+" already has key "+n);r[n]=s}return r}function Jt(e,r,t){r=r!==void 0?r:0;var n=new F.Parser(e,r),a=[],s=[];for(t=t!==void 0?t:e.length;n.relativeOffset<t;){var i=n.parseByte();i<=21?(i===12&&(i=1200+n.parseByte()),a.push([i,s]),s=[]):s.push(Ba(n,i))}return Ma(a)}function Ne(e,r){return r<=390?r=er[r]:r=e[r-391],r}function en(e,r,t){for(var n={},a,s=0;s<r.length;s+=1){var i=r[s];if(Array.isArray(i.type)){var u=[];u.length=i.type.length;for(var o=0;o<i.type.length;o++)a=e[i.op]!==void 0?e[i.op][o]:void 0,a===void 0&&(a=i.value!==void 0&&i.value[o]!==void 0?i.value[o]:null),i.type[o]==="SID"&&(a=Ne(t,a)),u[o]=a;n[i.name]=u}else a=e[i.op],a===void 0&&(a=i.value!==void 0?i.value:null),i.type==="SID"&&(a=Ne(t,a)),n[i.name]=a}return n}function Ia(e,r){var t={};return t.formatMajor=F.getCard8(e,r),t.formatMinor=F.getCard8(e,r+1),t.size=F.getCard8(e,r+2),t.offsetSize=F.getCard8(e,r+3),t.startOffset=r,t.endOffset=r+4,t}var rn=[{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"}],tn=[{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 Pa(e,r){var t=Jt(e,0,e.byteLength);return en(t,rn,r)}function nn(e,r,t,n){var a=Jt(e,r,t);return en(a,tn,n)}function it(e,r,t,n){for(var a=[],s=0;s<t.length;s+=1){var i=new DataView(new Uint8Array(t[s]).buffer),u=Pa(i,n);u._subrs=[],u._subrsBias=0,u._defaultWidthX=0,u._nominalWidthX=0;var o=u.private[0],l=u.private[1];if(o!==0&&l!==0){var f=nn(e,l+r,o,n);if(u._defaultWidthX=f.defaultWidthX,u._nominalWidthX=f.nominalWidthX,f.subrs!==0){var p=l+f.subrs,c=ye(e,p+r);u._subrs=c.objects,u._subrsBias=Rr(u._subrs)}u._privateDict=f}a.push(u)}return a}function Ga(e,r,t,n){var a,s,i=new F.Parser(e,r);t-=1;var u=[".notdef"],o=i.parseCard8();if(o===0)for(var l=0;l<t;l+=1)a=i.parseSID(),u.push(Ne(n,a));else if(o===1)for(;u.length<=t;){a=i.parseSID(),s=i.parseCard8();for(var f=0;f<=s;f+=1)u.push(Ne(n,a)),a+=1}else if(o===2)for(;u.length<=t;){a=i.parseSID(),s=i.parseCard16();for(var p=0;p<=s;p+=1)u.push(Ne(n,a)),a+=1}else throw new Error("Unknown charset format "+o);return u}function Na(e,r,t){var n,a={},s=new F.Parser(e,r),i=s.parseCard8();if(i===0)for(var u=s.parseCard8(),o=0;o<u;o+=1)n=s.parseCard8(),a[n]=o;else if(i===1){var l=s.parseCard8();n=1;for(var f=0;f<l;f+=1)for(var p=s.parseCard8(),c=s.parseCard8(),h=p;h<=p+c;h+=1)a[h]=n,n+=1}else throw new Error("Unknown encoding format "+i);return new or(a,t)}function ot(e,r,t){var n,a,s,i,u=new V,o=[],l=0,f=!1,p=!1,c=0,h=0,d,g,m,y;if(e.isCIDFont){var U=e.tables.cff.topDict._fdSelect[r.index],x=e.tables.cff.topDict._fdArray[U];d=x._subrs,g=x._subrsBias,m=x._defaultWidthX,y=x._nominalWidthX}else d=e.tables.cff.topDict._subrs,g=e.tables.cff.topDict._subrsBias,m=e.tables.cff.topDict._defaultWidthX,y=e.tables.cff.topDict._nominalWidthX;var L=m;function w(T,R){p&&u.closePath(),u.moveTo(T,R),p=!0}function D(){var T;T=o.length%2!==0,T&&!f&&(L=o.shift()+y),l+=o.length>>1,o.length=0,f=!0}function C(T){for(var R,q,A,X,Q,P,H,Y,W,I,z,$,B=0;B<T.length;){var _=T[B];switch(B+=1,_){case 1:D();break;case 3:D();break;case 4:o.length>1&&!f&&(L=o.shift()+y,f=!0),h+=o.pop(),w(c,h);break;case 5:for(;o.length>0;)c+=o.shift(),h+=o.shift(),u.lineTo(c,h);break;case 6:for(;o.length>0&&(c+=o.shift(),u.lineTo(c,h),o.length!==0);)h+=o.shift(),u.lineTo(c,h);break;case 7:for(;o.length>0&&(h+=o.shift(),u.lineTo(c,h),o.length!==0);)c+=o.shift(),u.lineTo(c,h);break;case 8:for(;o.length>0;)n=c+o.shift(),a=h+o.shift(),s=n+o.shift(),i=a+o.shift(),c=s+o.shift(),h=i+o.shift(),u.curveTo(n,a,s,i,c,h);break;case 10:Q=o.pop()+g,P=d[Q],P&&C(P);break;case 11:return;case 12:switch(_=T[B],B+=1,_){case 35:n=c+o.shift(),a=h+o.shift(),s=n+o.shift(),i=a+o.shift(),H=s+o.shift(),Y=i+o.shift(),W=H+o.shift(),I=Y+o.shift(),z=W+o.shift(),$=I+o.shift(),c=z+o.shift(),h=$+o.shift(),o.shift(),u.curveTo(n,a,s,i,H,Y),u.curveTo(W,I,z,$,c,h);break;case 34:n=c+o.shift(),a=h,s=n+o.shift(),i=a+o.shift(),H=s+o.shift(),Y=i,W=H+o.shift(),I=i,z=W+o.shift(),$=h,c=z+o.shift(),u.curveTo(n,a,s,i,H,Y),u.curveTo(W,I,z,$,c,h);break;case 36:n=c+o.shift(),a=h+o.shift(),s=n+o.shift(),i=a+o.shift(),H=s+o.shift(),Y=i,W=H+o.shift(),I=i,z=W+o.shift(),$=I+o.shift(),c=z+o.shift(),u.curveTo(n,a,s,i,H,Y),u.curveTo(W,I,z,$,c,h);break;case 37:n=c+o.shift(),a=h+o.shift(),s=n+o.shift(),i=a+o.shift(),H=s+o.shift(),Y=i+o.shift(),W=H+o.shift(),I=Y+o.shift(),z=W+o.shift(),$=I+o.shift(),Math.abs(z-c)>Math.abs($-h)?c=z+o.shift():h=$+o.shift(),u.curveTo(n,a,s,i,H,Y),u.curveTo(W,I,z,$,c,h);break;default:console.log("Glyph "+r.index+": unknown operator 1200"+_),o.length=0}break;case 14:o.length>0&&!f&&(L=o.shift()+y,f=!0),p&&(u.closePath(),p=!1);break;case 18:D();break;case 19:case 20:D(),B+=l+7>>3;break;case 21:o.length>2&&!f&&(L=o.shift()+y,f=!0),h+=o.pop(),c+=o.pop(),w(c,h);break;case 22:o.length>1&&!f&&(L=o.shift()+y,f=!0),c+=o.pop(),w(c,h);break;case 23:D();break;case 24:for(;o.length>2;)n=c+o.shift(),a=h+o.shift(),s=n+o.shift(),i=a+o.shift(),c=s+o.shift(),h=i+o.shift(),u.curveTo(n,a,s,i,c,h);c+=o.shift(),h+=o.shift(),u.lineTo(c,h);break;case 25:for(;o.length>6;)c+=o.shift(),h+=o.shift(),u.lineTo(c,h);n=c+o.shift(),a=h+o.shift(),s=n+o.shift(),i=a+o.shift(),c=s+o.shift(),h=i+o.shift(),u.curveTo(n,a,s,i,c,h);break;case 26:for(o.length%2&&(c+=o.shift());o.length>0;)n=c,a=h+o.shift(),s=n+o.shift(),i=a+o.shift(),c=s,h=i+o.shift(),u.curveTo(n,a,s,i,c,h);break;case 27:for(o.length%2&&(h+=o.shift());o.length>0;)n=c+o.shift(),a=h,s=n+o.shift(),i=a+o.shift(),c=s+o.shift(),h=i,u.curveTo(n,a,s,i,c,h);break;case 28:R=T[B],q=T[B+1],o.push((R<<24|q<<16)>>16),B+=2;break;case 29:Q=o.pop()+e.gsubrsBias,P=e.gsubrs[Q],P&&C(P);break;case 30:for(;o.length>0&&(n=c,a=h+o.shift(),s=n+o.shift(),i=a+o.shift(),c=s+o.shift(),h=i+(o.length===1?o.shift():0),u.curveTo(n,a,s,i,c,h),o.length!==0);)n=c+o.shift(),a=h,s=n+o.shift(),i=a+o.shift(),h=i+o.shift(),c=s+(o.length===1?o.shift():0),u.curveTo(n,a,s,i,c,h);break;case 31:for(;o.length>0&&(n=c+o.shift(),a=h,s=n+o.shift(),i=a+o.shift(),h=i+o.shift(),c=s+(o.length===1?o.shift():0),u.curveTo(n,a,s,i,c,h),o.length!==0);)n=c,a=h+o.shift(),s=n+o.shift(),i=a+o.shift(),c=s+o.shift(),h=i+(o.length===1?o.shift():0),u.curveTo(n,a,s,i,c,h);break;default:_<32?console.log("Glyph "+r.index+": unknown operator "+_):_<247?o.push(_-139):_<251?(R=T[B],B+=1,o.push((_-247)*256+R+108)):_<255?(R=T[B],B+=1,o.push(-(_-251)*256-R-108)):(R=T[B],q=T[B+1],A=T[B+2],X=T[B+3],B+=4,o.push((R<<24|q<<16|A<<8|X)/65536))}}}return C(t),r.advanceWidth=L,u}function Ha(e,r,t,n){var a=[],s,i=new F.Parser(e,r),u=i.parseCard8();if(u===0)for(var o=0;o<t;o++){if(s=i.parseCard8(),s>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+s+" (FD count "+n+")");a.push(s)}else if(u===3){var l=i.parseCard16(),f=i.parseCard16();if(f!==0)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+f);for(var p,c=0;c<l;c++){if(s=i.parseCard8(),p=i.parseCard16(),s>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+s+" (FD count "+n+")");if(p>t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+p);for(;f<p;f++)a.push(s);f=p}if(p!==t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+p)}else throw new Error("CFF Table CID Font FDSelect table has unsupported format "+u);return a}function Wa(e,r,t,n){t.tables.cff={};var a=Ia(e,r),s=ye(e,a.endOffset,F.bytesToString),i=ye(e,s.endOffset),u=ye(e,i.endOffset,F.bytesToString),o=ye(e,u.endOffset);t.gsubrs=o.objects,t.gsubrsBias=Rr(t.gsubrs);var l=it(e,r,i.objects,u.objects);if(l.length!==1)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+l.length);var f=l[0];if(t.tables.cff.topDict=f,f._privateDict&&(t.defaultWidthX=f._privateDict.defaultWidthX,t.nominalWidthX=f._privateDict.nominalWidthX),f.ros[0]!==void 0&&f.ros[1]!==void 0&&(t.isCIDFont=!0),t.isCIDFont){var p=f.fdArray,c=f.fdSelect;if(p===0||c===0)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");p+=r;var h=ye(e,p),d=it(e,r,h.objects,u.objects);f._fdArray=d,c+=r,f._fdSelect=Ha(e,c,t.numGlyphs,d.length)}var g=r+f.private[1],m=nn(e,g,f.private[0],u.objects);if(t.defaultWidthX=m.defaultWidthX,t.nominalWidthX=m.nominalWidthX,m.subrs!==0){var y=g+m.subrs,U=ye(e,y);t.subrs=U.objects,t.subrsBias=Rr(t.subrs)}else t.subrs=[],t.subrsBias=0;var x;n.lowMemory?(x=Ra(e,r+f.charStrings),t.nGlyphs=x.offsets.length):(x=ye(e,r+f.charStrings),t.nGlyphs=x.objects.length);var L=Ga(e,r+f.charset,t.nGlyphs,u.objects);if(f.encoding===0?t.cffEncoding=new or(Sa,L):f.encoding===1?t.cffEncoding=new or(Ta,L):t.cffEncoding=Na(e,r+f.encoding,L),t.encoding=t.encoding||t.cffEncoding,t.glyphs=new le.GlyphSet(t),n.lowMemory)t._push=function(C){var T=Da(C,x.offsets,e,r+f.charStrings);t.glyphs.push(C,le.cffGlyphLoader(t,C,ot,T))};else for(var w=0;w<t.nGlyphs;w+=1){var D=x.objects[w];t.glyphs.push(w,le.cffGlyphLoader(t,w,ot,D))}}function an(e,r){var t,n=er.indexOf(e);return n>=0&&(t=n),n=r.indexOf(e),n>=0?t=n+er.length:(t=er.length+r.length,r.push(e)),t}function za(){return new S.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 S.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 sn(e,r,t){for(var n={},a=0;a<e.length;a+=1){var s=e[a],i=r[s.name];i!==void 0&&!jt(i,s.value)&&(s.type==="SID"&&(i=an(i,t)),n[s.op]={name:s.name,type:s.type,value:i})}return n}function ut(e,r){var t=new S.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return t.dict=sn(rn,e,r),t}function lt(e){var r=new S.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return r.topDicts=[{name:"topDict_0",type:"TABLE",value:e}],r}function Va(e){var r=new S.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 qa(){return new S.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}])}function Xa(e,r){for(var t=new S.Record("Charsets",[{name:"format",type:"Card8",value:0}]),n=0;n<e.length;n+=1){var a=e[n],s=an(a,r);t.fields.push({name:"glyph_"+n,type:"SID",value:s})}return t}function Ya(e){var r=[],t=e.path;r.push({name:"width",type:"NUMBER",value:e.advanceWidth});for(var n=0,a=0,s=0;s<t.commands.length;s+=1){var i=void 0,u=void 0,o=t.commands[s];if(o.type==="Q"){var l=.3333333333333333,f=2/3;o={type:"C",x:o.x,y:o.y,x1:Math.round(l*n+f*o.x1),y1:Math.round(l*a+f*o.y1),x2:Math.round(l*o.x+f*o.x1),y2:Math.round(l*o.y+f*o.y1)}}if(o.type==="M")i=Math.round(o.x-n),u=Math.round(o.y-a),r.push({name:"dx",type:"NUMBER",value:i}),r.push({name:"dy",type:"NUMBER",value:u}),r.push({name:"rmoveto",type:"OP",value:21}),n=Math.round(o.x),a=Math.round(o.y);else if(o.type==="L")i=Math.round(o.x-n),u=Math.round(o.y-a),r.push({name:"dx",type:"NUMBER",value:i}),r.push({name:"dy",type:"NUMBER",value:u}),r.push({name:"rlineto",type:"OP",value:5}),n=Math.round(o.x),a=Math.round(o.y);else if(o.type==="C"){var p=Math.round(o.x1-n),c=Math.round(o.y1-a),h=Math.round(o.x2-o.x1),d=Math.round(o.y2-o.y1);i=Math.round(o.x-o.x2),u=Math.round(o.y-o.y2),r.push({name:"dx1",type:"NUMBER",value:p}),r.push({name:"dy1",type:"NUMBER",value:c}),r.push({name:"dx2",type:"NUMBER",value:h}),r.push({name:"dy2",type:"NUMBER",value:d}),r.push({name:"dx",type:"NUMBER",value:i}),r.push({name:"dy",type:"NUMBER",value:u}),r.push({name:"rrcurveto",type:"OP",value:8}),n=Math.round(o.x),a=Math.round(o.y)}}return r.push({name:"endchar",type:"OP",value:14}),r}function $a(e){for(var r=new S.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]),t=0;t<e.length;t+=1){var n=e.get(t),a=Ya(n);r.charStrings.push({name:n.name,type:"CHARSTRING",value:a})}return r}function Za(e,r){var t=new S.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return t.dict=sn(tn,e,r),t}function Qa(e,r){for(var t=new S.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]},s={},i=[],u,o=1;o<e.length;o+=1)u=e.get(o),i.push(u.name);var l=[];t.header=za(),t.nameIndex=_a([r.postScriptName]);var f=ut(a,l);t.topDictIndex=lt(f),t.globalSubrIndex=qa(),t.charsets=Xa(i,l),t.charStringsIndex=$a(e),t.privateDict=Za(s,l),t.stringIndex=Va(l);var p=t.header.sizeOf()+t.nameIndex.sizeOf()+t.topDictIndex.sizeOf()+t.stringIndex.sizeOf()+t.globalSubrIndex.sizeOf();return a.charset=p,a.encoding=0,a.charStrings=a.charset+t.charsets.sizeOf(),a.private[1]=a.charStrings+t.charStringsIndex.sizeOf(),f=ut(a,l),t.topDictIndex=lt(f),t}var on={parse:Wa,make:Qa};function Ka(e,r){var t={},n=new F.Parser(e,r);return t.version=n.parseVersion(),t.fontRevision=Math.round(n.parseFixed()*1e3)/1e3,t.checkSumAdjustment=n.parseULong(),t.magicNumber=n.parseULong(),E.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 ja(e){var r=Math.round(new Date().getTime()/1e3)+2082844800,t=r;return e.createdTimestamp&&(t=e.createdTimestamp+2082844800),new S.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 un={parse:Ka,make:ja};function Ja(e,r){var t={},n=new F.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 es(e){return new S.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 ln={parse:Ja,make:es};function rs(e,r,t,n,a){for(var s,i,u=new F.Parser(e,r),o=0;o<n;o+=1){o<t&&(s=u.parseUShort(),i=u.parseShort());var l=a.get(o);l.advanceWidth=s,l.leftSideBearing=i}}function ts(e,r,t,n,a){e._hmtxTableData={};for(var s,i,u=new F.Parser(r,t),o=0;o<a;o+=1)o<n&&(s=u.parseUShort(),i=u.parseShort()),e._hmtxTableData[o]={advanceWidth:s,leftSideBearing:i}}function ns(e,r,t,n,a,s,i){i.lowMemory?ts(e,r,t,n,a):rs(r,t,n,a,s)}function as(e){for(var r=new S.Table("hmtx",[]),t=0;t<e.length;t+=1){var n=e.get(t),a=n.advanceWidth||0,s=n.leftSideBearing||0;r.fields.push({name:"advanceWidth_"+t,type:"USHORT",value:a}),r.fields.push({name:"leftSideBearing_"+t,type:"SHORT",value:s})}return r}var fn={parse:ns,make:as};function ss(e){for(var r=new S.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 s=t.indexOf(e[a]);s<0&&(s=t.length,t+=e[a]),r.fields.push({name:"offset "+a,type:"USHORT",value:n+s}),r.fields.push({name:"length "+a,type:"USHORT",value:e[a].length})}return r.fields.push({name:"stringPool",type:"CHARARRAY",value:t}),r}function is(e,r){var t=new F.Parser(e,r),n=t.parseULong();E.argument(n===1,"Unsupported ltag table version."),t.skip("uLong",1);for(var a=t.parseULong(),s=[],i=0;i<a;i++){for(var u="",o=r+t.parseUShort(),l=t.parseUShort(),f=o;f<o+l;++f)u+=String.fromCharCode(e.getInt8(f));s.push(u)}return s}var cn={make:ss,parse:is};function os(e,r){var t={},n=new F.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 us(e){return new S.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:e}])}var pn={parse:os,make:us},hn=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],vn={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"},ls={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},dn={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 fs(e,r,t){switch(e){case 0:if(r===65535)return"und";if(t)return t[r];break;case 1:return vn[r];case 3:return dn[r]}}var Dr="utf-16",cs={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"},ps={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 gn(e,r,t){switch(e){case 0:return Dr;case 1:return ps[t]||cs[r];case 3:if(r===1||r===10)return Dr;break}}function hs(e,r,t){for(var n={},a=new F.Parser(e,r),s=a.parseUShort(),i=a.parseUShort(),u=a.offset+a.parseUShort(),o=0;o<i;o++){var l=a.parseUShort(),f=a.parseUShort(),p=a.parseUShort(),c=a.parseUShort(),h=hn[c]||c,d=a.parseUShort(),g=a.parseUShort(),m=fs(l,p,t),y=gn(l,f,p);if(y!==void 0&&m!==void 0){var U=void 0;if(y===Dr?U=Oe.UTF16(e,u+g,d):U=Oe.MACSTRING(e,u+g,d,y),U){var x=n[h];x===void 0&&(x=n[h]={}),x[m]=U}}}return s===1&&a.parseUShort(),n}function gr(e){var r={};for(var t in e)r[e[t]]=parseInt(t);return r}function ft(e,r,t,n,a,s){return new S.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:s}])}function vs(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 s=0;s<t;s++)if(r[a+s]!==e[s])continue e;return a}return-1}function ct(e,r){var t=vs(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 ds(e,r){var t,n=[],a={},s=gr(hn);for(var i in e){var u=s[i];if(u===void 0&&(u=i),t=parseInt(u),isNaN(t))throw new Error('Name table entry "'+i+'" does not exist, see nameTableNames for complete list.');a[t]=e[i],n.push(t)}for(var o=gr(vn),l=gr(dn),f=[],p=[],c=0;c<n.length;c++){t=n[c];var h=a[t];for(var d in h){var g=h[d],m=1,y=o[d],U=ls[y],x=gn(m,U,y),L=b.MACSTRING(g,x);L===void 0&&(m=0,y=r.indexOf(d),y<0&&(y=r.length,r.push(d)),U=4,L=b.UTF16(g));var w=ct(L,p);f.push(ft(m,U,y,t,L.length,w));var D=l[d];if(D!==void 0){var C=b.UTF16(g),T=ct(C,p);f.push(ft(3,1,D,t,C.length,T))}}}f.sort(function(A,X){return A.platformID-X.platformID||A.encodingID-X.encodingID||A.languageID-X.languageID||A.nameID-X.nameID});for(var R=new S.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:f.length},{name:"stringOffset",type:"USHORT",value:6+f.length*12}]),q=0;q<f.length;q++)R.fields.push({name:"record_"+q,type:"RECORD",value:f[q]});return R.fields.push({name:"strings",type:"LITERAL",value:p}),R}var mn={parse:hs,make:ds},Ar=[{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 gs(e){for(var r=0;r<Ar.length;r+=1){var t=Ar[r];if(e>=t.begin&&e<t.end)return r}return-1}function ms(e,r){var t={},n=new F.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 ys(e){return new S.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 Br={parse:ms,make:ys,unicodeRanges:Ar,getUnicodeRange:gs};function xs(e,r){var t={},n=new F.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=ke.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 s=0;s<t.numberOfGlyphs;s++)if(t.glyphNameIndex[s]>=ke.length){var i=n.parseChar();t.names.push(n.parseString(i))}break;case 2.5:t.numberOfGlyphs=n.parseUShort(),t.offset=new Array(t.numberOfGlyphs);for(var u=0;u<t.numberOfGlyphs;u++)t.offset[u]=n.parseChar();break}return t}function bs(){return new S.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 yn={parse:xs,make:bs},ee=new Array(9);ee[1]=function(){var r=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(v.coverage),deltaGlyphId:this.parseUShort()};if(t===2)return{substFormat:2,coverage:this.parsePointer(v.coverage),substitute:this.parseOffset16List()};E.assert(!1,"0x"+r.toString(16)+": lookup type 1 format must be 1 or 2.")};ee[2]=function(){var r=this.parseUShort();return E.argument(r===1,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:r,coverage:this.parsePointer(v.coverage),sequences:this.parseListOfLists()}};ee[3]=function(){var r=this.parseUShort();return E.argument(r===1,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:r,coverage:this.parsePointer(v.coverage),alternateSets:this.parseListOfLists()}};ee[4]=function(){var r=this.parseUShort();return E.argument(r===1,"GSUB ligature table identifier-format must be 1"),{substFormat:r,coverage:this.parsePointer(v.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};var Ee={sequenceIndex:v.uShort,lookupListIndex:v.uShort};ee[5]=function(){var r=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:t,coverage:this.parsePointer(v.coverage),ruleSets:this.parseListOfLists(function(){var s=this.parseUShort(),i=this.parseUShort();return{input:this.parseUShortList(s-1),lookupRecords:this.parseRecordList(i,Ee)}})};if(t===2)return{substFormat:t,coverage:this.parsePointer(v.coverage),classDef:this.parsePointer(v.classDef),classSets:this.parseListOfLists(function(){var s=this.parseUShort(),i=this.parseUShort();return{classes:this.parseUShortList(s-1),lookupRecords:this.parseRecordList(i,Ee)}})};if(t===3){var n=this.parseUShort(),a=this.parseUShort();return{substFormat:t,coverages:this.parseList(n,v.pointer(v.coverage)),lookupRecords:this.parseRecordList(a,Ee)}}E.assert(!1,"0x"+r.toString(16)+": lookup type 5 format must be 1, 2 or 3.")};ee[6]=function(){var r=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(v.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Ee)}})};if(t===2)return{substFormat:2,coverage:this.parsePointer(v.coverage),backtrackClassDef:this.parsePointer(v.classDef),inputClassDef:this.parsePointer(v.classDef),lookaheadClassDef:this.parsePointer(v.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Ee)}})};if(t===3)return{substFormat:3,backtrackCoverage:this.parseList(v.pointer(v.coverage)),inputCoverage:this.parseList(v.pointer(v.coverage)),lookaheadCoverage:this.parseList(v.pointer(v.coverage)),lookupRecords:this.parseRecordList(Ee)};E.assert(!1,"0x"+r.toString(16)+": lookup type 6 format must be 1, 2 or 3.")};ee[7]=function(){var r=this.parseUShort();E.argument(r===1,"GSUB Extension Substitution subtable identifier-format must be 1");var t=this.parseUShort(),n=new v(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:ee[t].call(n)}};ee[8]=function(){var r=this.parseUShort();return E.argument(r===1,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:r,coverage:this.parsePointer(v.coverage),backtrackCoverage:this.parseList(v.pointer(v.coverage)),lookaheadCoverage:this.parseList(v.pointer(v.coverage)),substitutes:this.parseUShortList()}};function Ss(e,r){r=r||0;var t=new v(e,r),n=t.parseVersion(1);return E.argument(n===1||n===1.1,"Unsupported GSUB table version."),n===1?{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(ee)}:{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(ee),variations:t.parseFeatureVariationsList()}}var Le=new Array(9);Le[1]=function(r){return r.substFormat===1?new S.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new S.Coverage(r.coverage)},{name:"deltaGlyphID",type:"USHORT",value:r.deltaGlyphId}]):new S.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new S.Coverage(r.coverage)}].concat(S.ushortList("substitute",r.substitute)))};Le[2]=function(r){return E.assert(r.substFormat===1,"Lookup type 2 substFormat must be 1."),new S.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new S.Coverage(r.coverage)}].concat(S.tableList("seqSet",r.sequences,function(t){return new S.Table("sequenceSetTable",S.ushortList("sequence",t))})))};Le[3]=function(r){return E.assert(r.substFormat===1,"Lookup type 3 substFormat must be 1."),new S.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new S.Coverage(r.coverage)}].concat(S.tableList("altSet",r.alternateSets,function(t){return new S.Table("alternateSetTable",S.ushortList("alternate",t))})))};Le[4]=function(r){return E.assert(r.substFormat===1,"Lookup type 4 substFormat must be 1."),new S.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new S.Coverage(r.coverage)}].concat(S.tableList("ligSet",r.ligatureSets,function(t){return new S.Table("ligatureSetTable",S.tableList("ligature",t,function(n){return new S.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:n.ligGlyph}].concat(S.ushortList("component",n.components,n.components.length+1)))}))})))};Le[6]=function(r){if(r.substFormat===1){var t=new S.Table("chainContextTable",[{name:"substFormat",type:"USHORT",value:r.substFormat},{name:"coverage",type:"TABLE",value:new S.Coverage(r.coverage)}].concat(S.tableList("chainRuleSet",r.chainRuleSets,function(s){return new S.Table("chainRuleSetTable",S.tableList("chainRule",s,function(i){var u=S.ushortList("backtrackGlyph",i.backtrack,i.backtrack.length).concat(S.ushortList("inputGlyph",i.input,i.input.length+1)).concat(S.ushortList("lookaheadGlyph",i.lookahead,i.lookahead.length)).concat(S.ushortList("substitution",[],i.lookupRecords.length));return i.lookupRecords.forEach(function(o,l){u=u.concat({name:"sequenceIndex"+l,type:"USHORT",value:o.sequenceIndex}).concat({name:"lookupListIndex"+l,type:"USHORT",value:o.lookupListIndex})}),new S.Table("chainRuleTable",u)}))})));return t}else if(r.substFormat===2)E.assert(!1,"lookup type 6 format 2 is not yet supported.");else if(r.substFormat===3){var n=[{name:"substFormat",type:"USHORT",value:r.substFormat}];n.push({name:"backtrackGlyphCount",type:"USHORT",value:r.backtrackCoverage.length}),r.backtrackCoverage.forEach(function(s,i){n.push({name:"backtrackCoverage"+i,type:"TABLE",value:new S.Coverage(s)})}),n.push({name:"inputGlyphCount",type:"USHORT",value:r.inputCoverage.length}),r.inputCoverage.forEach(function(s,i){n.push({name:"inputCoverage"+i,type:"TABLE",value:new S.Coverage(s)})}),n.push({name:"lookaheadGlyphCount",type:"USHORT",value:r.lookaheadCoverage.length}),r.lookaheadCoverage.forEach(function(s,i){n.push({name:"lookaheadCoverage"+i,type:"TABLE",value:new S.Coverage(s)})}),n.push({name:"substitutionCount",type:"USHORT",value:r.lookupRecords.length}),r.lookupRecords.forEach(function(s,i){n=n.concat({name:"sequenceIndex"+i,type:"USHORT",value:s.sequenceIndex}).concat({name:"lookupListIndex"+i,type:"USHORT",value:s.lookupListIndex})});var a=new S.Table("chainContextTable",n);return a}E.assert(!1,"lookup type 6 format must be 1, 2 or 3.")};function Ts(e){return new S.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new S.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new S.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new S.LookupList(e.lookups,Le)}])}var xn={parse:Ss,make:Ts};function ks(e,r){var t=new F.Parser(e,r),n=t.parseULong();E.argument(n===1,"Unsupported META table version."),t.parseULong(),t.parseULong();for(var a=t.parseULong(),s={},i=0;i<a;i++){var u=t.parseTag(),o=t.parseULong(),l=t.parseULong(),f=Oe.UTF8(e,r+o,l);s[u]=f}return s}function Fs(e){var r=Object.keys(e).length,t="",n=16+r*12,a=new S.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 s in e){var i=t.length;t+=e[s],a.fields.push({name:"tag "+s,type:"TAG",value:s}),a.fields.push({name:"offset "+s,type:"ULONG",value:n+i}),a.fields.push({name:"length "+s,type:"ULONG",value:e[s].length})}return a.fields.push({name:"stringPool",type:"CHARARRAY",value:t}),a}var bn={parse:ks,make:Fs};function pt(e){return Math.log(e)/Math.log(2)|0}function Vr(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 ht(e,r,t,n){return new S.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 Sn(e){var r=new S.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,pt(r.numTables));r.searchRange=16*t,r.entrySelector=pt(t),r.rangeShift=r.numTables*16-r.searchRange;for(var n=[],a=[],s=r.sizeOf()+ht().sizeOf()*r.numTables;s%4!==0;)s+=1,a.push({name:"padding",type:"BYTE",value:0});for(var i=0;i<e.length;i+=1){var u=e[i];E.argument(u.tableName.length===4,"Table name"+u.tableName+" is invalid.");var o=u.sizeOf(),l=ht(u.tableName,Vr(u.encode()),s,o);for(n.push({name:l.tag+" Table Record",type:"RECORD",value:l}),a.push({name:u.tableName+" table",type:"RECORD",value:u}),s+=o,E.argument(!isNaN(s),"Something went wrong calculating the offset.");s%4!==0;)s+=1,a.push({name:"padding",type:"BYTE",value:0})}return n.sort(function(f,p){return f.value.tag>p.value.tag?1:-1}),r.fields=r.fields.concat(n),r.fields=r.fields.concat(a),r}function vt(e,r,t){for(var n=0;n<r.length;n+=1){var a=e.charToGlyphIndex(r[n]);if(a>0){var s=e.glyphs.get(a);return s.getMetrics()}}return t}function Us(e){for(var r=0,t=0;t<e.length;t+=1)r+=e[t];return r/e.length}function Cs(e){for(var r=[],t=[],n=[],a=[],s=[],i=[],u=[],o,l=0,f=0,p=0,c=0,h=0,d=0;d<e.glyphs.length;d+=1){var g=e.glyphs.get(d),m=g.unicode|0;if(isNaN(g.advanceWidth))throw new Error("Glyph "+g.name+" ("+d+"): advanceWidth is not a number.");(o>m||o===void 0)&&m>0&&(o=m),l<m&&(l=m);var y=Br.getUnicodeRange(m);if(y<32)f|=1<<y;else if(y<64)p|=1<<y-32;else if(y<96)c|=1<<y-64;else if(y<123)h|=1<<y-96;else throw new Error("Unicode ranges bits > 123 are reserved for internal usage");if(g.name!==".notdef"){var U=g.getMetrics();r.push(U.xMin),t.push(U.yMin),n.push(U.xMax),a.push(U.yMax),i.push(U.leftSideBearing),u.push(U.rightSideBearing),s.push(g.advanceWidth)}}var x={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,s),advanceWidthAvg:Us(s),minLeftSideBearing:Math.min.apply(null,i),maxLeftSideBearing:Math.max.apply(null,i),minRightSideBearing:Math.min.apply(null,u)};x.ascender=e.ascender,x.descender=e.descender;var L=un.make({flags:3,unitsPerEm:e.unitsPerEm,xMin:x.xMin,yMin:x.yMin,xMax:x.xMax,yMax:x.yMax,lowestRecPPEM:3,createdTimestamp:e.createdTimestamp}),w=ln.make({ascender:x.ascender,descender:x.descender,advanceWidthMax:x.advanceWidthMax,minLeftSideBearing:x.minLeftSideBearing,minRightSideBearing:x.minRightSideBearing,xMaxExtent:x.maxLeftSideBearing+(x.xMax-x.xMin),numberOfHMetrics:e.glyphs.length}),D=pn.make(e.glyphs.length),C=Br.make(Object.assign({xAvgCharWidth:Math.round(x.advanceWidthAvg),usFirstCharIndex:o,usLastCharIndex:l,ulUnicodeRange1:f,ulUnicodeRange2:p,ulUnicodeRange3:c,ulUnicodeRange4:h,sTypoAscender:x.ascender,sTypoDescender:x.descender,sTypoLineGap:0,usWinAscent:x.yMax,usWinDescent:Math.abs(x.yMin),ulCodePageRange1:1,sxHeight:vt(e,"xyvw",{yMax:Math.round(x.ascender/2)}).yMax,sCapHeight:vt(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",x).yMax,usDefaultChar:e.hasChar(" ")?32:0,usBreakChar:e.hasChar(" ")?32:0},e.tables.os2)),T=fn.make(e.glyphs),R=Zt.make(e.glyphs),q=e.getEnglishName("fontFamily"),A=e.getEnglishName("fontSubfamily"),X=q+" "+A,Q=e.getEnglishName("postScriptName");Q||(Q=q.replace(/\s/g,"")+"-"+A);var P={};for(var H in e.names)P[H]=e.names[H];P.uniqueID||(P.uniqueID={en:e.getEnglishName("manufacturer")+":"+X}),P.postScriptName||(P.postScriptName={en:Q}),P.preferredFamily||(P.preferredFamily=e.names.fontFamily),P.preferredSubfamily||(P.preferredSubfamily=e.names.fontSubfamily);var Y=[],W=mn.make(P,Y),I=Y.length>0?cn.make(Y):void 0,z=yn.make(),$=on.make(e.glyphs,{version:e.getEnglishName("version"),fullName:X,familyName:q,weightName:A,postScriptName:Q,unitsPerEm:e.unitsPerEm,fontBBox:[0,x.yMin,x.ascender,x.advanceWidthMax]}),B=e.metas&&Object.keys(e.metas).length>0?bn.make(e.metas):void 0,_=[L,w,D,C,W,R,z,$,T];I&&_.push(I),e.tables.gsub&&_.push(xn.make(e.tables.gsub)),B&&_.push(B);for(var Ae=Sn(_),pr=Ae.encode(),Be=Vr(pr),Me=Ae.fields,Ie=!1,Ce=0;Ce<Me.length;Ce+=1)if(Me[Ce].name==="head table"){Me[Ce].value.checkSumAdjustment=2981146554-Be,Ie=!0;break}if(!Ie)throw new Error("Could not find head table with checkSum to adjust.");return Ae}var ws={make:Sn,fontToTable:Cs,computeCheckSum:Vr};function mr(e,r){for(var t=0,n=e.length-1;t<=n;){var a=t+n>>>1,s=e[a].tag;if(s===r)return a;s<r?t=a+1:n=a-1}return-t-1}function dt(e,r){for(var t=0,n=e.length-1;t<=n;){var a=t+n>>>1,s=e[a];if(s===r)return a;s<r?t=a+1:n=a-1}return-t-1}function gt(e,r){for(var t,n=0,a=e.length-1;n<=a;){var s=n+a>>>1;t=e[s];var i=t.start;if(i===r)return t;i<r?n=s+1:a=s-1}if(n>0)return t=e[n-1],r>t.end?0:t}function Ve(e,r){this.font=e,this.tableName=r}Ve.prototype={searchTag:mr,binSearch:dt,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=mr(t.scripts,e);if(a>=0)return n[a].script;if(r){var s={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return n.splice(-1-a,0,s),s.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=mr(n.langSysRecords,r);if(a>=0)return n.langSysRecords[a].langSys;if(t){var s={tag:r,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return n.langSysRecords.splice(-1-a,0,s),s.langSys}}},getFeatureTable:function(e,r,t,n){var a=this.getLangSysTable(e,r,n);if(a){for(var s,i=a.featureIndexes,u=this.font.tables[this.tableName].features,o=0;o<i.length;o++)if(s=u[i[o]],s.tag===t)return s.feature;if(n){var l=u.length;return E.assert(l===0||t>=u[l-1].tag,"Features must be added in alphabetical order."),s={tag:t,feature:{params:0,lookupListIndexes:[]}},u.push(s),i.push(l),s.feature}}},getLookupTables:function(e,r,t,n,a){var s=this.getFeatureTable(e,r,t,a),i=[];if(s){for(var u,o=s.lookupListIndexes,l=this.font.tables[this.tableName].lookups,f=0;f<o.length;f++)u=l[o[f]],u.lookupType===n&&i.push(u);if(i.length===0&&a){u={lookupType:n,lookupFlag:0,subtables:[],markFilteringSet:void 0};var p=l.length;return l.push(u),o.push(p),[u]}}return i},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=gt(e.ranges,r);return t?t.classId:0}},getCoverageIndex:function(e,r){switch(e.format){case 1:var t=dt(e.glyphs,r);return t>=0?t:-1;case 2:var n=gt(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],s=a.start,i=a.end,u=s;u<=i;u++)r.push(u);return r}};function qe(e){Ve.call(this,e,"gpos")}qe.prototype=Ve.prototype;qe.prototype.init=function(){var e=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(e)};qe.prototype.getKerningValue=function(e,r,t){for(var n=0;n<e.length;n++)for(var a=e[n].subtables,s=0;s<a.length;s++){var i=a[s],u=this.getCoverageIndex(i.coverage,r);if(!(u<0))switch(i.posFormat){case 1:for(var o=i.pairSets[u],l=0;l<o.length;l++){var f=o[l];if(f.secondGlyph===t)return f.value1&&f.value1.xAdvance||0}break;case 2:var p=this.getGlyphClass(i.classDef1,r),c=this.getGlyphClass(i.classDef2,t),h=i.classRecords[p][c];return h.value1&&h.value1.xAdvance||0}}return 0};qe.prototype.getKerningTables=function(e,r){if(this.font.tables.gpos)return this.getLookupTables(e,r,"kern",2)};function j(e){Ve.call(this,e,"gsub")}function Es(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 qr(e,r,t){for(var n=e.subtables,a=0;a<n.length;a++){var s=n[a];if(s.substFormat===r)return s}if(t)return n.push(t),t}j.prototype=Ve.prototype;j.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}};j.prototype.getSingle=function(e,r,t){for(var n=[],a=this.getLookupTables(r,t,e,1),s=0;s<a.length;s++)for(var i=a[s].subtables,u=0;u<i.length;u++){var o=i[u],l=this.expandCoverage(o.coverage),f=void 0;if(o.substFormat===1){var p=o.deltaGlyphId;for(f=0;f<l.length;f++){var c=l[f];n.push({sub:c,by:c+p})}}else{var h=o.substitute;for(f=0;f<l.length;f++)n.push({sub:l[f],by:h[f]})}}return n};j.prototype.getMultiple=function(e,r,t){for(var n=[],a=this.getLookupTables(r,t,e,2),s=0;s<a.length;s++)for(var i=a[s].subtables,u=0;u<i.length;u++){var o=i[u],l=this.expandCoverage(o.coverage),f=void 0;for(f=0;f<l.length;f++){var p=l[f],c=o.sequences[f];n.push({sub:p,by:c})}}return n};j.prototype.getAlternates=function(e,r,t){for(var n=[],a=this.getLookupTables(r,t,e,3),s=0;s<a.length;s++)for(var i=a[s].subtables,u=0;u<i.length;u++)for(var o=i[u],l=this.expandCoverage(o.coverage),f=o.alternateSets,p=0;p<l.length;p++)n.push({sub:l[p],by:f[p]});return n};j.prototype.getLigatures=function(e,r,t){for(var n=[],a=this.getLookupTables(r,t,e,4),s=0;s<a.length;s++)for(var i=a[s].subtables,u=0;u<i.length;u++)for(var o=i[u],l=this.expandCoverage(o.coverage),f=o.ligatureSets,p=0;p<l.length;p++)for(var c=l[p],h=f[p],d=0;d<h.length;d++){var g=h[d];n.push({sub:[c].concat(g.components),by:g.ligGlyph})}return n};j.prototype.addSingle=function(e,r,t,n){var a=this.getLookupTables(t,n,e,1,!0)[0],s=qr(a,2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});E.assert(s.coverage.format===1,"Single: unable to modify coverage table format "+s.coverage.format);var i=r.sub,u=this.binSearch(s.coverage.glyphs,i);u<0&&(u=-1-u,s.coverage.glyphs.splice(u,0,i),s.substitute.splice(u,0,0)),s.substitute[u]=r.by};j.prototype.addMultiple=function(e,r,t,n){E.assert(r.by instanceof Array&&r.by.length>1,'Multiple: "by" must be an array of two or more ids');var a=this.getLookupTables(t,n,e,2,!0)[0],s=qr(a,1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});E.assert(s.coverage.format===1,"Multiple: unable to modify coverage table format "+s.coverage.format);var i=r.sub,u=this.binSearch(s.coverage.glyphs,i);u<0&&(u=-1-u,s.coverage.glyphs.splice(u,0,i),s.sequences.splice(u,0,0)),s.sequences[u]=r.by};j.prototype.addAlternate=function(e,r,t,n){var a=this.getLookupTables(t,n,e,3,!0)[0],s=qr(a,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});E.assert(s.coverage.format===1,"Alternate: unable to modify coverage table format "+s.coverage.format);var i=r.sub,u=this.binSearch(s.coverage.glyphs,i);u<0&&(u=-1-u,s.coverage.glyphs.splice(u,0,i),s.alternateSets.splice(u,0,0)),s.alternateSets[u]=r.by};j.prototype.addLigature=function(e,r,t,n){var a=this.getLookupTables(t,n,e,4,!0)[0],s=a.subtables[0];s||(s={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},a.subtables[0]=s),E.assert(s.coverage.format===1,"Ligature: unable to modify coverage table format "+s.coverage.format);var i=r.sub[0],u=r.sub.slice(1),o={ligGlyph:r.by,components:u},l=this.binSearch(s.coverage.glyphs,i);if(l>=0){for(var f=s.ligatureSets[l],p=0;p<f.length;p++)if(Es(f[p].components,u))return;f.push(o)}else l=-1-l,s.coverage.glyphs.splice(l,0,i),s.ligatureSets.splice(l,0,[o])};j.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);case"ccmp":return this.getMultiple(e,r,t).concat(this.getLigatures(e,r,t));case"stch":return this.getMultiple(e,r,t)}};j.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);case"ccmp":return r.by instanceof Array?this.addMultiple(e,r,t,n):this.addLigature(e,r,t,n)}};function Os(){return typeof window<"u"}function Tn(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 Ls(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 Ge(e,r){if(!e)throw r}function mt(e,r,t,n,a){var s;return(r&n)>0?(s=e.parseByte(),(r&a)===0&&(s=-s),s=t+s):(r&a)>0?s=t:s=t+e.parseShort(),s}function kn(e,r,t){var n=new F.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,s;if(e.numberOfContours>0){for(var i=e.endPointIndices=[],u=0;u<e.numberOfContours;u+=1)i.push(n.parseUShort());e.instructionLength=n.parseUShort(),e.instructions=[];for(var o=0;o<e.instructionLength;o+=1)e.instructions.push(n.parseByte());var l=i[i.length-1]+1;a=[];for(var f=0;f<l;f+=1)if(s=n.parseByte(),a.push(s),(s&8)>0)for(var p=n.parseByte(),c=0;c<p;c+=1)a.push(s),f+=1;if(E.argument(a.length===l,"Bad flags."),i.length>0){var h=[],d;if(l>0){for(var g=0;g<l;g+=1)s=a[g],d={},d.onCurve=!!(s&1),d.lastPointOfContour=i.indexOf(g)>=0,h.push(d);for(var m=0,y=0;y<l;y+=1)s=a[y],d=h[y],d.x=mt(n,s,m,2,16),m=d.x;for(var U=0,x=0;x<l;x+=1)s=a[x],d=h[x],d.y=mt(n,s,U,4,32),U=d.y}e.points=h}else e.points=[]}else if(e.numberOfContours===0)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];for(var L=!0;L;){a=n.parseUShort();var w={glyphIndex:n.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(a&1)>0?(a&2)>0?(w.dx=n.parseShort(),w.dy=n.parseShort()):w.matchedPoints=[n.parseUShort(),n.parseUShort()]:(a&2)>0?(w.dx=n.parseChar(),w.dy=n.parseChar()):w.matchedPoints=[n.parseByte(),n.parseByte()],(a&8)>0?w.xScale=w.yScale=n.parseF2Dot14():(a&64)>0?(w.xScale=n.parseF2Dot14(),w.yScale=n.parseF2Dot14()):(a&128)>0&&(w.xScale=n.parseF2Dot14(),w.scale01=n.parseF2Dot14(),w.scale10=n.parseF2Dot14(),w.yScale=n.parseF2Dot14()),e.components.push(w),L=!!(a&32)}if(a&256){e.instructionLength=n.parseUShort(),e.instructions=[];for(var D=0;D<e.instructionLength;D+=1)e.instructions.push(n.parseByte())}}}function yr(e,r){for(var t=[],n=0;n<e.length;n+=1){var a=e[n],s={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(s)}return t}function Rs(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 E.argument(t.length===0,"There are still points left in the current contour."),r}function Fn(e){var r=new V;if(!e)return r;for(var t=Rs(e),n=0;n<t.length;++n){var a=t[n],s=null,i=a[a.length-1],u=a[0];if(i.onCurve)r.moveTo(i.x,i.y);else if(u.onCurve)r.moveTo(u.x,u.y);else{var o={x:(i.x+u.x)*.5,y:(i.y+u.y)*.5};r.moveTo(o.x,o.y)}for(var l=0;l<a.length;++l)if(s=i,i=u,u=a[(l+1)%a.length],i.onCurve)r.lineTo(i.x,i.y);else{var f=u;s.onCurve||((i.x+s.x)*.5,(i.y+s.y)*.5),u.onCurve||(f={x:(i.x+u.x)*.5,y:(i.y+u.y)*.5}),r.quadraticCurveTo(i.x,i.y,f.x,f.y)}r.closePath()}return r}function Un(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 s=void 0;if(n.matchedPoints===void 0)s=yr(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 i=r.points[n.matchedPoints[0]],u=a.points[n.matchedPoints[1]],o={xScale:n.xScale,scale01:n.scale01,scale10:n.scale10,yScale:n.yScale,dx:0,dy:0};u=yr([u],o)[0],o.dx=i.x-u.x,o.dy=i.y-u.y,s=yr(a.points,o)}r.points=r.points.concat(s)}}return Fn(r.points)}function Ds(e,r,t,n){for(var a=new le.GlyphSet(n),s=0;s<t.length-1;s+=1){var i=t[s],u=t[s+1];i!==u?a.push(s,le.ttfGlyphLoader(n,s,kn,e,r+i,Un)):a.push(s,le.glyphLoader(n,s))}return a}function As(e,r,t,n){var a=new le.GlyphSet(n);return n._push=function(s){var i=t[s],u=t[s+1];i!==u?a.push(s,le.ttfGlyphLoader(n,s,kn,e,r+i,Un)):a.push(s,le.glyphLoader(n,s))},a}function Bs(e,r,t,n,a){return a.lowMemory?As(e,r,t,n):Ds(e,r,t,n)}var Cn={getPath:Fn,parse:Bs},wn,Ue,En,Mr;function On(e){this.font=e,this.getCommands=function(r){return Cn.getPath(r).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function Ms(e){return e}function Ln(e){return Math.sign(e)*Math.round(Math.abs(e))}function Is(e){return Math.sign(e)*Math.round(Math.abs(e*2))/2}function Ps(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function Gs(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function Ns(e){return Math.sign(e)*Math.floor(Math.abs(e))}var Rn=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},ue={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,s,i,u,o,l,f;if(!n||n===this){if(a=e.xo-r.xo,s=e.xo-t.xo,o=r.x-r.xo,l=t.x-t.xo,i=Math.abs(a),u=Math.abs(s),f=i+u,f===0){e.x=e.xo+(o+l)/2;return}e.x=e.xo+(o*u+l*i)/f;return}if(a=n.distance(e,r,!0,!0),s=n.distance(e,t,!0,!0),o=n.distance(r,r,!1,!0),l=n.distance(t,t,!1,!0),i=Math.abs(a),u=Math.abs(s),f=i+u,f===0){ue.setRelative(e,e,(o+l)/2,n,!0);return}ue.setRelative(e,e,(o*u+l*i)/f,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 s=a?r.xo:r.x,i=a?r.yo:r.y,u=s+t*n.x,o=i+t*n.y;e.x=u+(e.y-o)/n.normalSlope},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},ce={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,s,i,u,o,l,f;if(!n||n===this){if(a=e.yo-r.yo,s=e.yo-t.yo,o=r.y-r.yo,l=t.y-t.yo,i=Math.abs(a),u=Math.abs(s),f=i+u,f===0){e.y=e.yo+(o+l)/2;return}e.y=e.yo+(o*u+l*i)/f;return}if(a=n.distance(e,r,!0,!0),s=n.distance(e,t,!0,!0),o=n.distance(r,r,!1,!0),l=n.distance(t,t,!1,!0),i=Math.abs(a),u=Math.abs(s),f=i+u,f===0){ce.setRelative(e,e,(o+l)/2,n,!0);return}ce.setRelative(e,e,(o*u+l*i)/f,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 s=a?r.xo:r.x,i=a?r.yo:r.y,u=s+t*n.x,o=i+t*n.y;e.y=o+n.normalSlope*(e.x-u)},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};Object.freeze(ue);Object.freeze(ce);function Xe(e,r){this.x=e,this.y=r,this.axis=void 0,this.slope=r/e,this.normalSlope=-e/r,Object.freeze(this)}Xe.prototype.distance=function(e,r,t,n){return this.x*ue.distance(e,r,t,n)+this.y*ce.distance(e,r,t,n)};Xe.prototype.interpolate=function(e,r,t,n){var a,s,i,u,o,l,f;if(i=n.distance(e,r,!0,!0),u=n.distance(e,t,!0,!0),a=n.distance(r,r,!1,!0),s=n.distance(t,t,!1,!0),o=Math.abs(i),l=Math.abs(u),f=o+l,f===0){this.setRelative(e,e,(a+s)/2,n,!0);return}this.setRelative(e,e,(a*l+s*o)/f,n,!0)};Xe.prototype.setRelative=function(e,r,t,n,a){n=n||this;var s=a?r.xo:r.x,i=a?r.yo:r.y,u=s+t*n.x,o=i+t*n.y,l=n.normalSlope,f=this.slope,p=e.x,c=e.y;e.x=(f*p-l*u+o-c)/(f-l),e.y=f*(e.x-p)+c};Xe.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0};function Ye(e,r){var t=Math.sqrt(e*e+r*r);return e/=t,r/=t,e===1&&r===0?ue:e===0&&r===1?ce:new Xe(e,r)}function pe(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)}pe.prototype.nextTouched=function(e){for(var r=this.nextPointOnContour;!e.touched(r)&&r!==this;)r=r.nextPointOnContour;return r};pe.prototype.prevTouched=function(e){for(var r=this.prevPointOnContour;!e.touched(r)&&r!==this;)r=r.prevPointOnContour;return r};var _e=Object.freeze(new pe(0,0)),Hs={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function xe(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=ue,this.round=Ln}}On.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){xe.prototype=Hs,a=this._fpgmState=new xe("fpgm",t.tables.fpgm),a.funcs=[],a.font=t,exports.DEBUG&&(console.log("---EXEC FPGM---"),a.step=-1);try{Ue(a)}catch(l){console.log("Hinting error in FPGM:"+l),this._errorState=3;return}}xe.prototype=a,n=this._prepState=new xe("prep",t.tables.prep),n.ppem=r;var s=t.tables.cvt;if(s)for(var i=n.cvt=new Array(s.length),u=r/t.unitsPerEm,o=0;o<s.length;o++)i[o]=s[o]*u;else n.cvt=[];exports.DEBUG&&(console.log("---EXEC PREP---"),n.step=-1);try{Ue(n)}catch(l){this._errorState<2&&console.log("Hinting error in PREP:"+l),this._errorState=2}}if(!(this._errorState>1))try{return En(e,n)}catch(l){this._errorState<1&&(console.log("Hinting error:"+l),console.log("Note: further hinting errors are silenced")),this._errorState=1;return}}};En=function(e,r){var t=r.ppem/r.font.unitsPerEm,n=t,a=e.components,s,i,u;if(xe.prototype=r,!a)u=new xe("glyf",e.instructions),exports.DEBUG&&(console.log("---EXEC GLYPH---"),u.step=-1),Mr(e,u,t,n),i=u.gZone;else{var o=r.font;i=[],s=[];for(var l=0;l<a.length;l++){var f=a[l],p=o.glyphs.get(f.glyphIndex);u=new xe("glyf",p.instructions),exports.DEBUG&&(console.log("---EXEC COMP "+l+"---"),u.step=-1),Mr(p,u,t,n);for(var c=Math.round(f.dx*t),h=Math.round(f.dy*n),d=u.gZone,g=u.contours,m=0;m<d.length;m++){var y=d[m];y.xTouched=y.yTouched=!1,y.xo=y.x=y.x+c,y.yo=y.y=y.y+h}var U=i.length;i.push.apply(i,d);for(var x=0;x<g.length;x++)s.push(g[x]+U)}e.instructions&&!u.inhibitGridFit&&(u=new xe("glyf",e.instructions),u.gZone=u.z0=u.z1=u.z2=i,u.contours=s,i.push(new pe(0,0),new pe(Math.round(e.advanceWidth*t),0)),exports.DEBUG&&(console.log("---EXEC COMPOSITE---"),u.step=-1),Ue(u),i.length-=2)}return i};Mr=function(e,r,t,n){for(var a=e.points||[],s=a.length,i=r.gZone=r.z0=r.z1=r.z2=[],u=r.contours=[],o,l=0;l<s;l++)o=a[l],i[l]=new pe(o.x*t,o.y*n,o.lastPointOfContour,o.onCurve);for(var f,p,c=0;c<s;c++)o=i[c],f||(f=o,u.push(c)),o.lastPointOfContour?(o.nextPointOnContour=f,f.prevPointOnContour=o,f=void 0):(p=i[c+1],o.nextPointOnContour=p,p.prevPointOnContour=o);if(!r.inhibitGridFit){if(exports.DEBUG){console.log("PROCESSING GLYPH",r.stack);for(var h=0;h<s;h++)console.log(h,i[h].x,i[h].y)}if(i.push(new pe(0,0),new pe(Math.round(e.advanceWidth*t),0)),Ue(r),i.length-=2,exports.DEBUG){console.log("FINISHED GLYPH",r.stack);for(var d=0;d<s;d++)console.log(d,i[d].x,i[d].y)}}};Ue=function(e){var r=e.prog;if(r){var t=r.length,n;for(e.ip=0;e.ip<t;e.ip++){if(exports.DEBUG&&e.step++,n=wn[r[e.ip]],!n)throw new Error("unknown instruction: 0x"+Number(r[e.ip]).toString(16));n(e)}}};function lr(e){for(var r=e.tZone=new Array(e.gZone.length),t=0;t<r.length;t++)r[t]=new pe(0,0)}function Dn(e,r){var t=e.prog,n=e.ip,a=1,s;do if(s=t[++n],s===88)a++;else if(s===89)a--;else if(s===64)n+=t[n+1]+1;else if(s===65)n+=2*t[n+1]+1;else if(s>=176&&s<=183)n+=s-176+1;else if(s>=184&&s<=191)n+=(s-184+1)*2;else if(r&&a===1&&s===27)break;while(a>0);e.ip=n}function yt(e,r){exports.DEBUG&&console.log(r.step,"SVTCA["+e.axis+"]"),r.fv=r.pv=r.dpv=e}function xt(e,r){exports.DEBUG&&console.log(r.step,"SPVTCA["+e.axis+"]"),r.pv=r.dpv=e}function bt(e,r){exports.DEBUG&&console.log(r.step,"SFVTCA["+e.axis+"]"),r.fv=e}function St(e,r){var t=r.stack,n=t.pop(),a=t.pop(),s=r.z2[n],i=r.z1[a];exports.DEBUG&&console.log("SPVTL["+e+"]",n,a);var u,o;e?(u=s.y-i.y,o=i.x-s.x):(u=i.x-s.x,o=i.y-s.y),r.pv=r.dpv=Ye(u,o)}function Tt(e,r){var t=r.stack,n=t.pop(),a=t.pop(),s=r.z2[n],i=r.z1[a];exports.DEBUG&&console.log("SFVTL["+e+"]",n,a);var u,o;e?(u=s.y-i.y,o=i.x-s.x):(u=i.x-s.x,o=i.y-s.y),r.fv=Ye(u,o)}function Ws(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"SPVFS[]",t,n),e.pv=e.dpv=Ye(n,t)}function zs(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"SPVFS[]",t,n),e.fv=Ye(n,t)}function _s(e){var r=e.stack,t=e.pv;exports.DEBUG&&console.log(e.step,"GPV[]"),r.push(t.x*16384),r.push(t.y*16384)}function Vs(e){var r=e.stack,t=e.fv;exports.DEBUG&&console.log(e.step,"GFV[]"),r.push(t.x*16384),r.push(t.y*16384)}function qs(e){e.fv=e.pv,exports.DEBUG&&console.log(e.step,"SFVTPV[]")}function Xs(e){var r=e.stack,t=r.pop(),n=r.pop(),a=r.pop(),s=r.pop(),i=r.pop(),u=e.z0,o=e.z1,l=u[t],f=u[n],p=o[a],c=o[s],h=e.z2[i];exports.DEBUG&&console.log("ISECT[], ",t,n,a,s,i);var d=l.x,g=l.y,m=f.x,y=f.y,U=p.x,x=p.y,L=c.x,w=c.y,D=(d-m)*(x-w)-(g-y)*(U-L),C=d*y-g*m,T=U*w-x*L;h.x=(C*(U-L)-T*(d-m))/D,h.y=(C*(x-w)-T*(g-y))/D}function Ys(e){e.rp0=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SRP0[]",e.rp0)}function $s(e){e.rp1=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SRP1[]",e.rp1)}function Zs(e){e.rp2=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SRP2[]",e.rp2)}function Qs(e){var r=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SZP0[]",r),e.zp0=r,r){case 0:e.tZone||lr(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function Ks(e){var r=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SZP1[]",r),e.zp1=r,r){case 0:e.tZone||lr(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function js(e){var r=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SZP2[]",r),e.zp2=r,r){case 0:e.tZone||lr(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function Js(e){var r=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SZPS[]",r),e.zp0=e.zp1=e.zp2=r,r){case 0:e.tZone||lr(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 ei(e){e.loop=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SLOOP[]",e.loop)}function ri(e){exports.DEBUG&&console.log(e.step,"RTG[]"),e.round=Ln}function ti(e){exports.DEBUG&&console.log(e.step,"RTHG[]"),e.round=Ps}function ni(e){var r=e.stack.pop();exports.DEBUG&&console.log(e.step,"SMD[]",r),e.minDis=r/64}function ai(e){exports.DEBUG&&console.log(e.step,"ELSE[]"),Dn(e,!1)}function si(e){var r=e.stack.pop();exports.DEBUG&&console.log(e.step,"JMPR[]",r),e.ip+=r-1}function ii(e){var r=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCVTCI[]",r),e.cvCutIn=r/64}function oi(e){var r=e.stack;exports.DEBUG&&console.log(e.step,"DUP[]"),r.push(r[r.length-1])}function xr(e){exports.DEBUG&&console.log(e.step,"POP[]"),e.stack.pop()}function ui(e){exports.DEBUG&&console.log(e.step,"CLEAR[]"),e.stack.length=0}function li(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"SWAP[]"),r.push(t),r.push(n)}function fi(e){var r=e.stack;exports.DEBUG&&console.log(e.step,"DEPTH[]"),r.push(r.length)}function ci(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"LOOPCALL[]",t,n);var a=e.ip,s=e.prog;e.prog=e.funcs[t];for(var i=0;i<n;i++)Ue(e),exports.DEBUG&&console.log(++e.step,i+1<n?"next loopcall":"done loopcall",i);e.ip=a,e.prog=s}function pi(e){var r=e.stack.pop();exports.DEBUG&&console.log(e.step,"CALL[]",r);var t=e.ip,n=e.prog;e.prog=e.funcs[r],Ue(e),e.ip=t,e.prog=n,exports.DEBUG&&console.log(++e.step,"returning from",r)}function hi(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"CINDEX[]",t),r.push(r[r.length-t])}function vi(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"MINDEX[]",t),r.push(r.splice(r.length-t,1)[0])}function di(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(),s=n;for(exports.DEBUG&&console.log(e.step,"FDEF[]",a);t[++n]!==45;);e.ip=n,e.funcs[a]=t.slice(s+1,n)}function kt(e,r){var t=r.stack.pop(),n=r.z0[t],a=r.fv,s=r.pv;exports.DEBUG&&console.log(r.step,"MDAP["+e+"]",t);var i=s.distance(n,_e);e&&(i=r.round(i)),a.setRelative(n,_e,i,s),a.touch(n),r.rp0=r.rp1=t}function Ft(e,r){var t=r.z2,n=t.length-2,a,s,i;exports.DEBUG&&console.log(r.step,"IUP["+e.axis+"]");for(var u=0;u<n;u++)a=t[u],!e.touched(a)&&(s=a.prevTouched(e),s!==a&&(i=a.nextTouched(e),s===i&&e.setRelative(a,a,e.distance(s,s,!1,!0),e,!0),e.interpolate(a,s,i,e)))}function Ut(e,r){for(var t=r.stack,n=e?r.rp1:r.rp2,a=(e?r.z0:r.z1)[n],s=r.fv,i=r.pv,u=r.loop,o=r.z2;u--;){var l=t.pop(),f=o[l],p=i.distance(a,a,!1,!0);s.setRelative(f,f,p,i),s.touch(f),exports.DEBUG&&console.log(r.step,(r.loop>1?"loop "+(r.loop-u)+": ":"")+"SHP["+(e?"rp1":"rp2")+"]",l)}r.loop=1}function Ct(e,r){var t=r.stack,n=e?r.rp1:r.rp2,a=(e?r.z0:r.z1)[n],s=r.fv,i=r.pv,u=t.pop(),o=r.z2[r.contours[u]],l=o;exports.DEBUG&&console.log(r.step,"SHC["+e+"]",u);var f=i.distance(a,a,!1,!0);do l!==a&&s.setRelative(l,l,f,i),l=l.nextPointOnContour;while(l!==o)}function wt(e,r){var t=r.stack,n=e?r.rp1:r.rp2,a=(e?r.z0:r.z1)[n],s=r.fv,i=r.pv,u=t.pop();exports.DEBUG&&console.log(r.step,"SHZ["+e+"]",u);var o;switch(u){case 0:o=r.tZone;break;case 1:o=r.gZone;break;default:throw new Error("Invalid zone")}for(var l,f=i.distance(a,a,!1,!0),p=o.length-2,c=0;c<p;c++)l=o[c],s.setRelative(l,l,f,i)}function gi(e){for(var r=e.stack,t=e.loop,n=e.fv,a=r.pop()/64,s=e.z2;t--;){var i=r.pop(),u=s[i];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-t)+": ":"")+"SHPIX[]",i,a),n.setRelative(u,u,a),n.touch(u)}e.loop=1}function mi(e){for(var r=e.stack,t=e.rp1,n=e.rp2,a=e.loop,s=e.z0[t],i=e.z1[n],u=e.fv,o=e.dpv,l=e.z2;a--;){var f=r.pop(),p=l[f];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-a)+": ":"")+"IP[]",f,t,"<->",n),u.interpolate(p,s,i,o),u.touch(p)}e.loop=1}function Et(e,r){var t=r.stack,n=t.pop()/64,a=t.pop(),s=r.z1[a],i=r.z0[r.rp0],u=r.fv,o=r.pv;u.setRelative(s,i,n,o),u.touch(s),exports.DEBUG&&console.log(r.step,"MSIRP["+e+"]",n,a),r.rp1=r.rp0,r.rp2=a,e&&(r.rp0=a)}function yi(e){for(var r=e.stack,t=e.rp0,n=e.z0[t],a=e.loop,s=e.fv,i=e.pv,u=e.z1;a--;){var o=r.pop(),l=u[o];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-a)+": ":"")+"ALIGNRP[]",o),s.setRelative(l,n,0,i),s.touch(l)}e.loop=1}function xi(e){exports.DEBUG&&console.log(e.step,"RTDG[]"),e.round=Is}function Ot(e,r){var t=r.stack,n=t.pop(),a=t.pop(),s=r.z0[a],i=r.fv,u=r.pv,o=r.cvt[n];exports.DEBUG&&console.log(r.step,"MIAP["+e+"]",n,"(",o,")",a);var l=u.distance(s,_e);e&&(Math.abs(l-o)<r.cvCutIn&&(l=o),l=r.round(l)),i.setRelative(s,_e,l,u),r.zp0===0&&(s.xo=s.x,s.yo=s.y),i.touch(s),r.rp0=r.rp1=a}function bi(e){var r=e.prog,t=e.ip,n=e.stack,a=r[++t];exports.DEBUG&&console.log(e.step,"NPUSHB[]",a);for(var s=0;s<a;s++)n.push(r[++t]);e.ip=t}function Si(e){var r=e.ip,t=e.prog,n=e.stack,a=t[++r];exports.DEBUG&&console.log(e.step,"NPUSHW[]",a);for(var s=0;s<a;s++){var i=t[++r]<<8|t[++r];i&32768&&(i=-((i^65535)+1)),n.push(i)}e.ip=r}function Ti(e){var r=e.stack,t=e.store;t||(t=e.store=[]);var n=r.pop(),a=r.pop();exports.DEBUG&&console.log(e.step,"WS",n,a),t[a]=n}function ki(e){var r=e.stack,t=e.store,n=r.pop();exports.DEBUG&&console.log(e.step,"RS",n);var a=t&&t[n]||0;r.push(a)}function Fi(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"WCVTP",t,n),e.cvt[n]=t/64}function Ui(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"RCVT",t),r.push(e.cvt[t]*64)}function Lt(e,r){var t=r.stack,n=t.pop(),a=r.z2[n];exports.DEBUG&&console.log(r.step,"GC["+e+"]",n),t.push(r.dpv.distance(a,_e,e,!1)*64)}function Rt(e,r){var t=r.stack,n=t.pop(),a=t.pop(),s=r.z1[n],i=r.z0[a],u=r.dpv.distance(i,s,e,e);exports.DEBUG&&console.log(r.step,"MD["+e+"]",n,a,"->",u),r.stack.push(Math.round(u*64))}function Ci(e){exports.DEBUG&&console.log(e.step,"MPPEM[]"),e.stack.push(e.ppem)}function wi(e){exports.DEBUG&&console.log(e.step,"FLIPON[]"),e.autoFlip=!0}function Ei(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"LT[]",t,n),r.push(n<t?1:0)}function Oi(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"LTEQ[]",t,n),r.push(n<=t?1:0)}function Li(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"GT[]",t,n),r.push(n>t?1:0)}function Ri(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"GTEQ[]",t,n),r.push(n>=t?1:0)}function Di(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"EQ[]",t,n),r.push(t===n?1:0)}function Ai(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"NEQ[]",t,n),r.push(t!==n?1:0)}function Bi(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"ODD[]",t),r.push(Math.trunc(t)%2?1:0)}function Mi(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"EVEN[]",t),r.push(Math.trunc(t)%2?0:1)}function Ii(e){var r=e.stack.pop();exports.DEBUG&&console.log(e.step,"IF[]",r),r||(Dn(e,!0),exports.DEBUG&&console.log(e.step,"EIF[]"))}function Pi(e){exports.DEBUG&&console.log(e.step,"EIF[]")}function Gi(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"AND[]",t,n),r.push(t&&n?1:0)}function Ni(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"OR[]",t,n),r.push(t||n?1:0)}function Hi(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"NOT[]",t),r.push(t?0:1)}function br(e,r){var t=r.stack,n=t.pop(),a=r.fv,s=r.pv,i=r.ppem,u=r.deltaBase+(e-1)*16,o=r.deltaShift,l=r.z0;exports.DEBUG&&console.log(r.step,"DELTAP["+e+"]",n,t);for(var f=0;f<n;f++){var p=t.pop(),c=t.pop(),h=u+((c&240)>>4);if(h===i){var d=(c&15)-8;d>=0&&d++,exports.DEBUG&&console.log(r.step,"DELTAPFIX",p,"by",d*o);var g=l[p];a.setRelative(g,g,d*o,s)}}}function Wi(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"SDB[]",t),e.deltaBase=t}function zi(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"SDS[]",t),e.deltaShift=Math.pow(.5,t)}function _i(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"ADD[]",t,n),r.push(n+t)}function Vi(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"SUB[]",t,n),r.push(n-t)}function qi(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"DIV[]",t,n),r.push(n*64/t)}function Xi(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"MUL[]",t,n),r.push(n*t/64)}function Yi(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"ABS[]",t),r.push(Math.abs(t))}function $i(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"NEG[]",t),r.push(-t)}function Zi(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"FLOOR[]",t),r.push(Math.floor(t/64)*64)}function Qi(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"CEILING[]",t),r.push(Math.ceil(t/64)*64)}function Je(e,r){var t=r.stack,n=t.pop();exports.DEBUG&&console.log(r.step,"ROUND[]"),t.push(r.round(n/64)*64)}function Ki(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"WCVTF[]",t,n),e.cvt[n]=t*e.ppem/e.font.unitsPerEm}function Sr(e,r){var t=r.stack,n=t.pop(),a=r.ppem,s=r.deltaBase+(e-1)*16,i=r.deltaShift;exports.DEBUG&&console.log(r.step,"DELTAC["+e+"]",n,t);for(var u=0;u<n;u++){var o=t.pop(),l=t.pop(),f=s+((l&240)>>4);if(f===a){var p=(l&15)-8;p>=0&&p++;var c=p*i;exports.DEBUG&&console.log(r.step,"DELTACFIX",o,"by",c),r.cvt[o]+=c}}}function ji(e){var r=e.stack.pop();exports.DEBUG&&console.log(e.step,"SROUND[]",r),e.round=Rn;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 Ji(e){var r=e.stack.pop();exports.DEBUG&&console.log(e.step,"S45ROUND[]",r),e.round=Rn;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 eo(e){exports.DEBUG&&console.log(e.step,"ROFF[]"),e.round=Ms}function ro(e){exports.DEBUG&&console.log(e.step,"RUTG[]"),e.round=Gs}function to(e){exports.DEBUG&&console.log(e.step,"RDTG[]"),e.round=Ns}function no(e){var r=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCANCTRL[]",r)}function Dt(e,r){var t=r.stack,n=t.pop(),a=t.pop(),s=r.z2[n],i=r.z1[a];exports.DEBUG&&console.log(r.step,"SDPVTL["+e+"]",n,a);var u,o;e?(u=s.y-i.y,o=i.x-s.x):(u=i.x-s.x,o=i.y-s.y),r.dpv=Ye(u,o)}function ao(e){var r=e.stack,t=r.pop(),n=0;exports.DEBUG&&console.log(e.step,"GETINFO[]",t),t&1&&(n=35),t&32&&(n|=4096),r.push(n)}function so(e){var r=e.stack,t=r.pop(),n=r.pop(),a=r.pop();exports.DEBUG&&console.log(e.step,"ROLL[]"),r.push(n),r.push(t),r.push(a)}function io(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"MAX[]",t,n),r.push(Math.max(n,t))}function oo(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"MIN[]",t,n),r.push(Math.min(n,t))}function uo(e){var r=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCANTYPE[]",r)}function lo(e){var r=e.stack.pop(),t=e.stack.pop();switch(exports.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 de(e,r){var t=r.stack,n=r.prog,a=r.ip;exports.DEBUG&&console.log(r.step,"PUSHB["+e+"]");for(var s=0;s<e;s++)t.push(n[++a]);r.ip=a}function ge(e,r){var t=r.ip,n=r.prog,a=r.stack;exports.DEBUG&&console.log(r.ip,"PUSHW["+e+"]");for(var s=0;s<e;s++){var i=n[++t]<<8|n[++t];i&32768&&(i=-((i^65535)+1)),a.push(i)}r.ip=t}function k(e,r,t,n,a,s){var i=s.stack,u=e&&i.pop(),o=i.pop(),l=s.rp0,f=s.z0[l],p=s.z1[o],c=s.minDis,h=s.fv,d=s.dpv,g,m,y,U;m=g=d.distance(p,f,!0,!0),y=m>=0?1:-1,m=Math.abs(m),e&&(U=s.cvt[u],n&&Math.abs(m-U)<s.cvCutIn&&(m=U)),t&&m<c&&(m=c),n&&(m=s.round(m)),h.setRelative(p,f,y*m,d),h.touch(p),exports.DEBUG&&console.log(s.step,(e?"MIRP[":"MDRP[")+(r?"M":"m")+(t?">":"_")+(n?"R":"_")+(a===0?"Gr":a===1?"Bl":a===2?"Wh":"")+"]",e?u+"("+s.cvt[u]+","+U+")":"",o,"(d =",g,"->",y*m,")"),s.rp1=s.rp0,s.rp2=o,r&&(s.rp0=o)}wn=[yt.bind(void 0,ce),yt.bind(void 0,ue),xt.bind(void 0,ce),xt.bind(void 0,ue),bt.bind(void 0,ce),bt.bind(void 0,ue),St.bind(void 0,0),St.bind(void 0,1),Tt.bind(void 0,0),Tt.bind(void 0,1),Ws,zs,_s,Vs,qs,Xs,Ys,$s,Zs,Qs,Ks,js,Js,ei,ri,ti,ni,ai,si,ii,void 0,void 0,oi,xr,ui,li,fi,hi,vi,void 0,void 0,void 0,ci,pi,di,void 0,kt.bind(void 0,0),kt.bind(void 0,1),Ft.bind(void 0,ce),Ft.bind(void 0,ue),Ut.bind(void 0,0),Ut.bind(void 0,1),Ct.bind(void 0,0),Ct.bind(void 0,1),wt.bind(void 0,0),wt.bind(void 0,1),gi,mi,Et.bind(void 0,0),Et.bind(void 0,1),yi,xi,Ot.bind(void 0,0),Ot.bind(void 0,1),bi,Si,Ti,ki,Fi,Ui,Lt.bind(void 0,0),Lt.bind(void 0,1),void 0,Rt.bind(void 0,0),Rt.bind(void 0,1),Ci,void 0,wi,void 0,void 0,Ei,Oi,Li,Ri,Di,Ai,Bi,Mi,Ii,Pi,Gi,Ni,Hi,br.bind(void 0,1),Wi,zi,_i,Vi,qi,Xi,Yi,$i,Zi,Qi,Je.bind(void 0,0),Je.bind(void 0,1),Je.bind(void 0,2),Je.bind(void 0,3),void 0,void 0,void 0,void 0,Ki,br.bind(void 0,2),br.bind(void 0,3),Sr.bind(void 0,1),Sr.bind(void 0,2),Sr.bind(void 0,3),ji,Ji,void 0,void 0,eo,void 0,ro,to,xr,xr,void 0,void 0,void 0,void 0,void 0,no,Dt.bind(void 0,0),Dt.bind(void 0,1),ao,void 0,so,io,oo,uo,lo,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,de.bind(void 0,1),de.bind(void 0,2),de.bind(void 0,3),de.bind(void 0,4),de.bind(void 0,5),de.bind(void 0,6),de.bind(void 0,7),de.bind(void 0,8),ge.bind(void 0,1),ge.bind(void 0,2),ge.bind(void 0,3),ge.bind(void 0,4),ge.bind(void 0,5),ge.bind(void 0,6),ge.bind(void 0,7),ge.bind(void 0,8),k.bind(void 0,0,0,0,0,0),k.bind(void 0,0,0,0,0,1),k.bind(void 0,0,0,0,0,2),k.bind(void 0,0,0,0,0,3),k.bind(void 0,0,0,0,1,0),k.bind(void 0,0,0,0,1,1),k.bind(void 0,0,0,0,1,2),k.bind(void 0,0,0,0,1,3),k.bind(void 0,0,0,1,0,0),k.bind(void 0,0,0,1,0,1),k.bind(void 0,0,0,1,0,2),k.bind(void 0,0,0,1,0,3),k.bind(void 0,0,0,1,1,0),k.bind(void 0,0,0,1,1,1),k.bind(void 0,0,0,1,1,2),k.bind(void 0,0,0,1,1,3),k.bind(void 0,0,1,0,0,0),k.bind(void 0,0,1,0,0,1),k.bind(void 0,0,1,0,0,2),k.bind(void 0,0,1,0,0,3),k.bind(void 0,0,1,0,1,0),k.bind(void 0,0,1,0,1,1),k.bind(void 0,0,1,0,1,2),k.bind(void 0,0,1,0,1,3),k.bind(void 0,0,1,1,0,0),k.bind(void 0,0,1,1,0,1),k.bind(void 0,0,1,1,0,2),k.bind(void 0,0,1,1,0,3),k.bind(void 0,0,1,1,1,0),k.bind(void 0,0,1,1,1,1),k.bind(void 0,0,1,1,1,2),k.bind(void 0,0,1,1,1,3),k.bind(void 0,1,0,0,0,0),k.bind(void 0,1,0,0,0,1),k.bind(void 0,1,0,0,0,2),k.bind(void 0,1,0,0,0,3),k.bind(void 0,1,0,0,1,0),k.bind(void 0,1,0,0,1,1),k.bind(void 0,1,0,0,1,2),k.bind(void 0,1,0,0,1,3),k.bind(void 0,1,0,1,0,0),k.bind(void 0,1,0,1,0,1),k.bind(void 0,1,0,1,0,2),k.bind(void 0,1,0,1,0,3),k.bind(void 0,1,0,1,1,0),k.bind(void 0,1,0,1,1,1),k.bind(void 0,1,0,1,1,2),k.bind(void 0,1,0,1,1,3),k.bind(void 0,1,1,0,0,0),k.bind(void 0,1,1,0,0,1),k.bind(void 0,1,1,0,0,2),k.bind(void 0,1,1,0,0,3),k.bind(void 0,1,1,0,1,0),k.bind(void 0,1,1,0,1,1),k.bind(void 0,1,1,0,1,2),k.bind(void 0,1,1,0,1,3),k.bind(void 0,1,1,1,0,0),k.bind(void 0,1,1,1,0,1),k.bind(void 0,1,1,1,0,2),k.bind(void 0,1,1,1,0,3),k.bind(void 0,1,1,1,1,0),k.bind(void 0,1,1,1,1,1),k.bind(void 0,1,1,1,1,2),k.bind(void 0,1,1,1,1,3)];function Re(e){this.char=e,this.state={},this.activeState=null}function Xr(e,r,t){this.contextName=t,this.startIndex=e,this.endOffset=r}function fo(e,r,t){this.contextName=e,this.openRange=null,this.ranges=[],this.checkStart=r,this.checkEnd=t}function re(e,r){this.context=e,this.index=r,this.length=e.length,this.current=e[r],this.backtrack=e.slice(0,r),this.lookahead=e.slice(r+1)}function fr(e){this.eventId=e,this.subscribers=[]}function co(e){var r=this,t=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];t.forEach(function(a){Object.defineProperty(r.events,a,{value:new fr(a)})}),e&&t.forEach(function(a){var s=e[a];typeof s=="function"&&r.events[a].subscribe(s)});var n=["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"];n.forEach(function(a){r.events[a].subscribe(r.updateContextsRanges)})}function G(e){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],co.call(this,e)}Re.prototype.setState=function(e,r){return this.state[e]=r,this.activeState={key:e,value:this.state[e]},this.activeState};Re.prototype.getState=function(e){return this.state[e]||null};G.prototype.inboundIndex=function(e){return e>=0&&e<this.tokens.length};G.prototype.composeRUD=function(e){var r=this,t=!0,n=e.map(function(s){return r[s[0]].apply(r,s.slice(1).concat(t))}),a=function(s){return typeof s=="object"&&s.hasOwnProperty("FAIL")};if(n.every(a))return{FAIL:"composeRUD: one or more operations hasn't completed successfully",report:n.filter(a)};this.dispatch("composeRUD",[n.filter(function(s){return!a(s)})])};G.prototype.replaceRange=function(e,r,t,n){r=r!==null?r:this.tokens.length;var a=t.every(function(i){return i instanceof Re});if(!isNaN(e)&&this.inboundIndex(e)&&a){var s=this.tokens.splice.apply(this.tokens,[e,r].concat(t));return n||this.dispatch("replaceToken",[e,r,t]),[s,t]}else return{FAIL:"replaceRange: invalid tokens or startIndex."}};G.prototype.replaceToken=function(e,r,t){if(!isNaN(e)&&this.inboundIndex(e)&&r instanceof Re){var n=this.tokens.splice(e,1,r);return t||this.dispatch("replaceToken",[e,r]),[n[0],r]}else return{FAIL:"replaceToken: invalid token or index."}};G.prototype.removeRange=function(e,r,t){r=isNaN(r)?this.tokens.length:r;var n=this.tokens.splice(e,r);return t||this.dispatch("removeRange",[n,e,r]),n};G.prototype.removeToken=function(e,r){if(!isNaN(e)&&this.inboundIndex(e)){var t=this.tokens.splice(e,1);return r||this.dispatch("removeToken",[t,e]),t}else return{FAIL:"removeToken: invalid token index."}};G.prototype.insertToken=function(e,r,t){var n=e.every(function(a){return a instanceof Re});return n?(this.tokens.splice.apply(this.tokens,[r,0].concat(e)),t||this.dispatch("insertToken",[e,r]),e):{FAIL:"insertToken: invalid token(s)."}};G.prototype.registerModifier=function(e,r,t){this.events.newToken.subscribe(function(n,a){var s=[n,a],i=r===null||r.apply(this,s)===!0,u=[n,a];if(i){var o=t.apply(this,u);n.setState(e,o)}}),this.registeredModifiers.push(e)};fr.prototype.subscribe=function(e){return typeof e=="function"?this.subscribers.push(e)-1:{FAIL:"invalid '"+this.eventId+"' event handler"}};fr.prototype.unsubscribe=function(e){this.subscribers.splice(e,1)};re.prototype.setCurrentIndex=function(e){this.index=e,this.current=this.context[e],this.backtrack=this.context.slice(0,e),this.lookahead=this.context.slice(e+1)};re.prototype.get=function(e){switch(!0){case e===0:return this.current;case(e<0&&Math.abs(e)<=this.backtrack.length):return this.backtrack.slice(e)[0];case(e>0&&e<=this.lookahead.length):return this.lookahead[e-1];default:return null}};G.prototype.rangeToText=function(e){if(e instanceof Xr)return this.getRangeTokens(e).map(function(r){return r.char}).join("")};G.prototype.getText=function(){return this.tokens.map(function(e){return e.char}).join("")};G.prototype.getContext=function(e){var r=this.registeredContexts[e];return r||null};G.prototype.on=function(e,r){var t=this.events[e];return t?t.subscribe(r):null};G.prototype.dispatch=function(e,r){var t=this,n=this.events[e];n instanceof fr&&n.subscribers.forEach(function(a){a.apply(t,r||[])})};G.prototype.registerContextChecker=function(e,r,t){if(this.getContext(e))return{FAIL:"context name '"+e+"' is already registered."};if(typeof r!="function")return{FAIL:"missing context start check."};if(typeof t!="function")return{FAIL:"missing context end check."};var n=new fo(e,r,t);return this.registeredContexts[e]=n,this.contextCheckers.push(n),n};G.prototype.getRangeTokens=function(e){var r=e.startIndex+e.endOffset;return[].concat(this.tokens.slice(e.startIndex,r))};G.prototype.getContextRanges=function(e){var r=this.getContext(e);return r?r.ranges:{FAIL:"context checker '"+e+"' is not registered."}};G.prototype.resetContextsRanges=function(){var e=this.registeredContexts;for(var r in e)if(e.hasOwnProperty(r)){var t=e[r];t.ranges=[]}};G.prototype.updateContextsRanges=function(){this.resetContextsRanges();for(var e=this.tokens.map(function(n){return n.char}),r=0;r<e.length;r++){var t=new re(e,r);this.runContextCheck(t)}this.dispatch("updateContextsRanges",[this.registeredContexts])};G.prototype.setEndOffset=function(e,r){var t=this.getContext(r).openRange.startIndex,n=new Xr(t,e,r),a=this.getContext(r).ranges;return n.rangeId=r+"."+a.length,a.push(n),this.getContext(r).openRange=null,n};G.prototype.runContextCheck=function(e){var r=this,t=e.index;this.contextCheckers.forEach(function(n){var a=n.contextName,s=r.getContext(a).openRange;if(!s&&n.checkStart(e)&&(s=new Xr(t,null,a),r.getContext(a).openRange=s,r.dispatch("contextStart",[a,t])),s&&n.checkEnd(e)){var i=t-s.startIndex+1,u=r.setEndOffset(i,a);r.dispatch("contextEnd",[a,u])}})};G.prototype.tokenize=function(e){this.tokens=[],this.resetContextsRanges();var r=Array.from(e);this.dispatch("start");for(var t=0;t<r.length;t++){var n=r[t],a=new re(r,t);this.dispatch("next",[a]),this.runContextCheck(a);var s=new Re(n);this.tokens.push(s),this.dispatch("newToken",[s,a])}return this.dispatch("end",[this.tokens]),this.tokens};function be(e){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(e)}function An(e){return/[\u0630\u0690\u0621\u0631\u0661\u0671\u0622\u0632\u0672\u0692\u06C2\u0623\u0673\u0693\u06C3\u0624\u0694\u06C4\u0625\u0675\u0695\u06C5\u06E5\u0676\u0696\u06C6\u0627\u0677\u0697\u06C7\u0648\u0688\u0698\u06C8\u0689\u0699\u06C9\u068A\u06CA\u066B\u068B\u06CB\u068C\u068D\u06CD\u06FD\u068E\u06EE\u06FE\u062F\u068F\u06CF\u06EF]/.test(e)}function Se(e){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(e)}function rr(e){return/[A-z]/.test(e)}function po(e){return/\s/.test(e)}function J(e){this.font=e,this.features={}}function Fe(e){this.id=e.id,this.tag=e.tag,this.substitution=e.substitution}function $e(e,r){if(!e)return-1;switch(r.format){case 1:return r.glyphs.indexOf(e);case 2:for(var t=r.ranges,n=0;n<t.length;n++){var a=t[n];if(e>=a.start&&e<=a.end){var s=e-a.start;return a.index+s}}break;default:return-1}return-1}function ho(e,r){var t=$e(e,r.coverage);return t===-1?null:e+r.deltaGlyphId}function vo(e,r){var t=$e(e,r.coverage);return t===-1?null:r.substitute[t]}function Tr(e,r){for(var t=[],n=0;n<e.length;n++){var a=e[n],s=r.current;s=Array.isArray(s)?s[0]:s;var i=$e(s,a);i!==-1&&t.push(i)}return t.length!==e.length?-1:t}function go(e,r){var t=r.inputCoverage.length+r.lookaheadCoverage.length+r.backtrackCoverage.length;if(e.context.length<t)return[];var n=Tr(r.inputCoverage,e);if(n===-1)return[];var a=r.inputCoverage.length-1;if(e.lookahead.length<r.lookaheadCoverage.length)return[];for(var s=e.lookahead.slice(a);s.length&&Se(s[0].char);)s.shift();var i=new re(s,0),u=Tr(r.lookaheadCoverage,i),o=[].concat(e.backtrack);for(o.reverse();o.length&&Se(o[0].char);)o.shift();if(o.length<r.backtrackCoverage.length)return[];var l=new re(o,0),f=Tr(r.backtrackCoverage,l),p=n.length===r.inputCoverage.length&&u.length===r.lookaheadCoverage.length&&f.length===r.backtrackCoverage.length,c=[];if(p)for(var h=0;h<r.lookupRecords.length;h++)for(var d=r.lookupRecords[h],g=d.lookupListIndex,m=this.getLookupByIndex(g),y=0;y<m.subtables.length;y++){var U=m.subtables[y],x=this.getLookupMethod(m,U),L=this.getSubstitutionType(m,U);if(L==="12")for(var w=0;w<n.length;w++){var D=e.get(w),C=x(D);C&&c.push(C)}}return c}function mo(e,r){var t=e.current,n=$e(t,r.coverage);if(n===-1)return null;for(var a,s=r.ligatureSets[n],i=0;i<s.length;i++){a=s[i];for(var u=0;u<a.components.length;u++){var o=e.lookahead[u],l=a.components[u];if(o!==l)break;if(u===a.components.length-1)return a}}return null}function yo(e,r){var t=$e(e,r.coverage);return t===-1?null:r.sequences[t]}J.prototype.getDefaultScriptFeaturesIndexes=function(){for(var e=this.font.tables.gsub.scripts,r=0;r<e.length;r++){var t=e[r];if(t.tag==="DFLT")return t.script.defaultLangSys.featureIndexes}return[]};J.prototype.getScriptFeaturesIndexes=function(e){var r=this.font.tables;if(!r.gsub)return[];if(!e)return this.getDefaultScriptFeaturesIndexes();for(var t=this.font.tables.gsub.scripts,n=0;n<t.length;n++){var a=t[n];if(a.tag===e&&a.script.defaultLangSys)return a.script.defaultLangSys.featureIndexes;var s=a.langSysRecords;if(s)for(var i=0;i<s.length;i++){var u=s[i];if(u.tag===e){var o=u.langSys;return o.featureIndexes}}}return this.getDefaultScriptFeaturesIndexes()};J.prototype.mapTagsToFeatures=function(e,r){for(var t={},n=0;n<e.length;n++){var a=e[n].tag,s=e[n].feature;t[a]=s}this.features[r].tags=t};J.prototype.getScriptFeatures=function(e){var r=this.features[e];if(this.features.hasOwnProperty(e))return r;var t=this.getScriptFeaturesIndexes(e);if(!t)return null;var n=this.font.tables.gsub;return r=t.map(function(a){return n.features[a]}),this.features[e]=r,this.mapTagsToFeatures(r,e),r};J.prototype.getSubstitutionType=function(e,r){var t=e.lookupType.toString(),n=r.substFormat.toString();return t+n};J.prototype.getLookupMethod=function(e,r){var t=this,n=this.getSubstitutionType(e,r);switch(n){case"11":return function(a){return ho.apply(t,[a,r])};case"12":return function(a){return vo.apply(t,[a,r])};case"63":return function(a){return go.apply(t,[a,r])};case"41":return function(a){return mo.apply(t,[a,r])};case"21":return function(a){return yo.apply(t,[a,r])};default:throw new Error("lookupType: "+e.lookupType+" - substFormat: "+r.substFormat+" is not yet supported")}};J.prototype.lookupFeature=function(e){var r=e.contextParams,t=r.index,n=this.getFeature({tag:e.tag,script:e.script});if(!n)return new Error("font '"+this.font.names.fullName.en+"' doesn't support feature '"+e.tag+"' for script '"+e.script+"'.");for(var a=this.getFeatureLookups(n),s=[].concat(r.context),i=0;i<a.length;i++)for(var u=a[i],o=this.getLookupSubtables(u),l=0;l<o.length;l++){var f=o[l],p=this.getSubstitutionType(u,f),c=this.getLookupMethod(u,f),h=void 0;switch(p){case"11":h=c(r.current),h&&s.splice(t,1,new Fe({id:11,tag:e.tag,substitution:h}));break;case"12":h=c(r.current),h&&s.splice(t,1,new Fe({id:12,tag:e.tag,substitution:h}));break;case"63":h=c(r),Array.isArray(h)&&h.length&&s.splice(t,1,new Fe({id:63,tag:e.tag,substitution:h}));break;case"41":h=c(r),h&&s.splice(t,1,new Fe({id:41,tag:e.tag,substitution:h}));break;case"21":h=c(r.current),h&&s.splice(t,1,new Fe({id:21,tag:e.tag,substitution:h}));break}r=new re(s,t),!(Array.isArray(h)&&!h.length)&&(h=null)}return s.length?s:null};J.prototype.supports=function(e){if(!e.script)return!1;this.getScriptFeatures(e.script);var r=this.features.hasOwnProperty(e.script);if(!e.tag)return r;var t=this.features[e.script].some(function(n){return n.tag===e.tag});return r&&t};J.prototype.getLookupSubtables=function(e){return e.subtables||null};J.prototype.getLookupByIndex=function(e){var r=this.font.tables.gsub.lookups;return r[e]||null};J.prototype.getFeatureLookups=function(e){return e.lookupListIndexes.map(this.getLookupByIndex.bind(this))};J.prototype.getFeature=function(r){if(!this.font)return{FAIL:"No font was found"};this.features.hasOwnProperty(r.script)||this.getScriptFeatures(r.script);var t=this.features[r.script];return t?t.tags[r.tag]?this.features[r.script].tags[r.tag]:null:{FAIL:"No feature for script "+r.script}};function xo(e){var r=e.current,t=e.get(-1);return t===null&&be(r)||!be(t)&&be(r)}function bo(e){var r=e.get(1);return r===null||!be(r)}var So={startCheck:xo,endCheck:bo};function To(e){var r=e.current,t=e.get(-1);return(be(r)||Se(r))&&!be(t)}function ko(e){var r=e.get(1);switch(!0){case r===null:return!0;case(!be(r)&&!Se(r)):var t=po(r);if(!t)return!0;if(t){var n=!1;if(n=e.lookahead.some(function(a){return be(a)||Se(a)}),!n)return!0}break;default:return!1}}var Fo={startCheck:To,endCheck:ko};function Uo(e,r,t){r[t].setState(e.tag,e.substitution)}function Co(e,r,t){r[t].setState(e.tag,e.substitution)}function wo(e,r,t){e.substitution.forEach(function(n,a){var s=r[t+a];s.setState(e.tag,n)})}function Eo(e,r,t){var n=r[t];n.setState(e.tag,e.substitution.ligGlyph);for(var a=e.substitution.components.length,s=0;s<a;s++)n=r[t+s+1],n.setState("deleted",!0)}var At={11:Uo,12:Co,63:wo,41:Eo};function Yr(e,r,t){e instanceof Fe&&At[e.id]&&At[e.id](e,r,t)}function Oo(e){for(var r=[].concat(e.backtrack),t=r.length-1;t>=0;t--){var n=r[t],a=An(n),s=Se(n);if(!a&&!s)return!0;if(a)return!1}return!1}function Lo(e){if(An(e.current))return!1;for(var r=0;r<e.lookahead.length;r++){var t=e.lookahead[r],n=Se(t);if(!n)return!0}return!1}function Ro(e){var r=this,t="arab",n=this.featuresTags[t],a=this.tokenizer.getRangeTokens(e);if(a.length!==1){var s=new re(a.map(function(u){return u.getState("glyphIndex")}),0),i=new re(a.map(function(u){return u.char}),0);a.forEach(function(u,o){if(!Se(u.char)){s.setCurrentIndex(o),i.setCurrentIndex(o);var l=0;Oo(i)&&(l|=1),Lo(i)&&(l|=2);var f;switch(l){case 1:f="fina";break;case 2:f="init";break;case 3:f="medi";break}if(n.indexOf(f)!==-1){var p=r.query.lookupFeature({tag:f,script:t,contextParams:s});if(p instanceof Error)return console.info(p.message);p.forEach(function(c,h){c instanceof Fe&&(Yr(c,a,h),s.context[h]=c.substitution)})}}})}}function Bt(e,r){var t=e.map(function(n){return n.activeState.value});return new re(t,0)}function Do(e){var r=this,t="arab",n=this.tokenizer.getRangeTokens(e),a=Bt(n);a.context.forEach(function(s,i){a.setCurrentIndex(i);var u=r.query.lookupFeature({tag:"rlig",script:t,contextParams:a});u.length&&(u.forEach(function(o){return Yr(o,n,i)}),a=Bt(n))})}function Ao(e){var r=e.current,t=e.get(-1);return t===null&&rr(r)||!rr(t)&&rr(r)}function Bo(e){var r=e.get(1);return r===null||!rr(r)}var Mo={startCheck:Ao,endCheck:Bo};function Mt(e,r){var t=e.map(function(n){return n.activeState.value});return new re(t,0)}function Io(e){var r=this,t="latn",n=this.tokenizer.getRangeTokens(e),a=Mt(n);a.context.forEach(function(s,i){a.setCurrentIndex(i);var u=r.query.lookupFeature({tag:"liga",script:t,contextParams:a});u.length&&(u.forEach(function(o){return Yr(o,n,i)}),a=Mt(n))})}function ae(e){this.baseDir=e||"ltr",this.tokenizer=new G,this.featuresTags={}}ae.prototype.setText=function(e){this.text=e};ae.prototype.contextChecks={latinWordCheck:Mo,arabicWordCheck:So,arabicSentenceCheck:Fo};function kr(e){var r=this.contextChecks[e+"Check"];return this.tokenizer.registerContextChecker(e,r.startCheck,r.endCheck)}function Po(){return kr.call(this,"latinWord"),kr.call(this,"arabicWord"),kr.call(this,"arabicSentence"),this.tokenizer.tokenize(this.text)}function Go(){var e=this,r=this.tokenizer.getContextRanges("arabicSentence");r.forEach(function(t){var n=e.tokenizer.getRangeTokens(t);e.tokenizer.replaceRange(t.startIndex,t.endOffset,n.reverse())})}ae.prototype.registerFeatures=function(e,r){var t=this,n=r.filter(function(a){return t.query.supports({script:e,tag:a})});this.featuresTags.hasOwnProperty(e)?this.featuresTags[e]=this.featuresTags[e].concat(n):this.featuresTags[e]=n};ae.prototype.applyFeatures=function(e,r){if(!e)throw new Error("No valid font was provided to apply features");this.query||(this.query=new J(e));for(var t=0;t<r.length;t++){var n=r[t];this.query.supports({script:n.script})&&this.registerFeatures(n.script,n.tags)}};ae.prototype.registerModifier=function(e,r,t){this.tokenizer.registerModifier(e,r,t)};function $r(){if(this.tokenizer.registeredModifiers.indexOf("glyphIndex")===-1)throw new Error("glyphIndex modifier is required to apply arabic presentation features.")}function No(){var e=this,r="arab";if(this.featuresTags.hasOwnProperty(r)){$r.call(this);var t=this.tokenizer.getContextRanges("arabicWord");t.forEach(function(n){Ro.call(e,n)})}}function Ho(){var e=this,r="arab";if(this.featuresTags.hasOwnProperty(r)){var t=this.featuresTags[r];if(t.indexOf("rlig")!==-1){$r.call(this);var n=this.tokenizer.getContextRanges("arabicWord");n.forEach(function(a){Do.call(e,a)})}}}function Wo(){var e=this,r="latn";if(this.featuresTags.hasOwnProperty(r)){var t=this.featuresTags[r];if(t.indexOf("liga")!==-1){$r.call(this);var n=this.tokenizer.getContextRanges("latinWord");n.forEach(function(a){Io.call(e,a)})}}}ae.prototype.checkContextReady=function(e){return!!this.tokenizer.getContext(e)};ae.prototype.applyFeaturesToContexts=function(){this.checkContextReady("arabicWord")&&(No.call(this),Ho.call(this)),this.checkContextReady("latinWord")&&Wo.call(this),this.checkContextReady("arabicSentence")&&Go.call(this)};ae.prototype.processText=function(e){(!this.text||this.text!==e)&&(this.setText(e),Po.call(this),this.applyFeaturesToContexts())};ae.prototype.getBidiText=function(e){return this.processText(e),this.tokenizer.getText()};ae.prototype.getTextGlyphs=function(e){this.processText(e);for(var r=[],t=0;t<this.tokenizer.tokens.length;t++){var n=this.tokenizer.tokens[t];if(!n.state.deleted){var a=n.activeState.value;r.push(Array.isArray(a)?a[0]:a)}}return r};function M(e){e=e||{},e.tables=e.tables||{},e.empty||(Ge(e.familyName,"When creating a new Font object, familyName is required."),Ge(e.styleName,"When creating a new Font object, styleName is required."),Ge(e.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),Ge(e.ascender,"When creating a new Font object, ascender is required."),Ge(e.descender<=0,"When creating a new Font object, negative descender value is required."),this.names={fontFamily:{en:e.familyName||" "},fontSubfamily:{en:e.styleName||" "},fullName:{en:e.fullName||e.familyName+" "+e.styleName},postScriptName:{en:e.postScriptName||(e.familyName+e.styleName).replace(/\s/g,"")},designer:{en:e.designer||" "},designerURL:{en:e.designerURL||" "},manufacturer:{en:e.manufacturer||" "},manufacturerURL:{en:e.manufacturerURL||" "},license:{en:e.license||" "},licenseURL:{en:e.licenseURL||" "},version:{en:e.version||"Version 0.1"},description:{en:e.description||" "},copyright:{en:e.copyright||" "},trademark:{en:e.trademark||" "}},this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.tables=Object.assign(e.tables,{os2:Object.assign({usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,fsSelection:e.fsSelection||this.fsSelectionValues.REGULAR},e.tables.os2)})),this.supported=!0,this.glyphs=new le.GlyphSet(this,e.glyphs||[]),this.encoding=new Qt(this),this.position=new qe(this),this.substitution=new j(this),this.tables=this.tables||{},this._push=null,this._hmtxTableData={},Object.defineProperty(this,"hinting",{get:function(){if(this._hinting)return this._hinting;if(this.outlinesFormat==="truetype")return this._hinting=new On(this)}})}M.prototype.hasChar=function(e){return this.encoding.charToGlyphIndex(e)!==null};M.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)};M.prototype.charToGlyph=function(e){var r=this.charToGlyphIndex(e),t=this.glyphs.get(r);return t||(t=this.glyphs.get(0)),t};M.prototype.updateFeatures=function(e){return this.defaultRenderOptions.features.map(function(r){return r.script==="latn"?{script:"latn",tags:r.tags.filter(function(t){return e[t]})}:r})};M.prototype.stringToGlyphs=function(e,r){var t=this,n=new ae,a=function(p){return t.charToGlyphIndex(p.char)};n.registerModifier("glyphIndex",null,a);var s=r?this.updateFeatures(r.features):this.defaultRenderOptions.features;n.applyFeatures(this,s);for(var i=n.getTextGlyphs(e),u=i.length,o=new Array(u),l=this.glyphs.get(0),f=0;f<u;f+=1)o[f]=this.glyphs.get(i[f])||l;return o};M.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)};M.prototype.nameToGlyph=function(e){var r=this.nameToGlyphIndex(e),t=this.glyphs.get(r);return t||(t=this.glyphs.get(0)),t};M.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):""};M.prototype.getKerningValue=function(e,r){e=e.index||e,r=r.index||r;var t=this.position.defaultKerningTables;return t?this.position.getKerningValue(t,e,r):this.kerningPairs[e+","+r]||0};M.prototype.defaultRenderOptions={kerning:!0,features:[{script:"arab",tags:["init","medi","fina","rlig"]},{script:"latn",tags:["liga","rlig"]}]};M.prototype.forEachGlyph=function(e,r,t,n,a,s){r=r!==void 0?r:0,t=t!==void 0?t:0,n=n!==void 0?n:72,a=Object.assign({},this.defaultRenderOptions,a);var i=1/this.unitsPerEm*n,u=this.stringToGlyphs(e,a),o;if(a.kerning){var l=a.script||this.position.getDefaultScriptName();o=this.position.getKerningTables(l,a.language)}for(var f=0;f<u.length;f+=1){var p=u[f];if(s.call(this,p,r,t,n,a),p.advanceWidth&&(r+=p.advanceWidth*i),a.kerning&&f<u.length-1){var c=o?this.position.getKerningValue(o,p.index,u[f+1].index):this.getKerningValue(p,u[f+1]);r+=c*i}a.letterSpacing?r+=a.letterSpacing*n:a.tracking&&(r+=a.tracking/1e3*n)}return r};M.prototype.getPath=function(e,r,t,n,a){var s=new V;return this.forEachGlyph(e,r,t,n,a,function(i,u,o,l){var f=i.getPath(u,o,l,a,this);s.extend(f)}),s};M.prototype.getPaths=function(e,r,t,n,a){var s=[];return this.forEachGlyph(e,r,t,n,a,function(i,u,o,l){var f=i.getPath(u,o,l,a,this);s.push(f)}),s};M.prototype.getAdvanceWidth=function(e,r,t){return this.forEachGlyph(e,0,0,r,t,function(){})};M.prototype.draw=function(e,r,t,n,a,s){this.getPath(r,t,n,a,s).draw(e)};M.prototype.drawPoints=function(e,r,t,n,a,s){this.forEachGlyph(r,t,n,a,s,function(i,u,o,l){i.drawPoints(e,u,o,l)})};M.prototype.drawMetrics=function(e,r,t,n,a,s){this.forEachGlyph(r,t,n,a,s,function(i,u,o,l){i.drawMetrics(e,u,o,l)})};M.prototype.getEnglishName=function(e){var r=this.names[e];if(r)return r.en};M.prototype.validate=function(){var e=this;function r(n,a){}function t(n){var a=e.getEnglishName(n);a&&a.trim().length>0}t("fontFamily"),t("weightName"),t("manufacturer"),t("copyright"),t("version"),this.unitsPerEm>0};M.prototype.toTables=function(){return ws.fontToTable(this)};M.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()};M.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};M.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(Os())if(window.URL=window.URL||window.webkitURL,window.URL){var a=new DataView(n),s=new Blob([a],{type:"font/opentype"}),i=document.createElement("a");i.href=window.URL.createObjectURL(s),i.download=e;var u=document.createEvent("MouseEvents");u.initEvent("click",!0,!1),i.dispatchEvent(u)}else console.warn("Font file could not be downloaded. Try using a different browser.");else{var o=require("fs"),l=Ls(n);o.writeFileSync(e,l)}};M.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512};M.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};M.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};function Bn(e,r){var t=JSON.stringify(e),n=256;for(var a in r){var s=parseInt(a);if(!(!s||s<256)){if(JSON.stringify(r[a])===t)return s;n<=s&&(n=s+1)}}return r[n]=e,n}function zo(e,r,t){var n=Bn(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 _o(e,r,t){var n={},a=new F.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 Vo(e,r,t,n){for(var a=Bn(r.name,n),s=[{name:"nameID_"+e,type:"USHORT",value:a},{name:"flags_"+e,type:"USHORT",value:0}],i=0;i<t.length;++i){var u=t[i].tag;s.push({name:"axis_"+e+" "+u,type:"FIXED",value:r.coordinates[u]<<16})}return s}function qo(e,r,t,n){var a={},s=new F.Parser(e,r);a.name=n[s.parseUShort()]||{},s.skip("uShort",1),a.coordinates={};for(var i=0;i<t.length;++i)a.coordinates[t[i].tag]=s.parseFixed();return a}function Xo(e,r){var t=new S.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(zo(n,e.axes[n],r));for(var a=0;a<e.instances.length;a++)t.fields=t.fields.concat(Vo(a,e.instances[a],e.axes,r));return t}function Yo(e,r,t){var n=new F.Parser(e,r),a=n.parseULong();E.argument(a===65536,"Unsupported fvar table version.");var s=n.parseOffset16();n.skip("uShort",1);for(var i=n.parseUShort(),u=n.parseUShort(),o=n.parseUShort(),l=n.parseUShort(),f=[],p=0;p<i;p++)f.push(_o(e,r+s+p*u,t));for(var c=[],h=r+s+i*u,d=0;d<o;d++)c.push(qo(e,h+d*l,f,t));return{axes:f,instances:c}}var $o={make:Xo,parse:Yo},Zo=function(){return{coverage:this.parsePointer(v.coverage),attachPoints:this.parseList(v.pointer(v.uShortList))}},Qo=function(){var e=this.parseUShort();if(E.argument(e===1||e===2||e===3,"Unsupported CaretValue table version."),e===1)return{coordinate:this.parseShort()};if(e===2)return{pointindex:this.parseShort()};if(e===3)return{coordinate:this.parseShort()}},Ko=function(){return this.parseList(v.pointer(Qo))},jo=function(){return{coverage:this.parsePointer(v.coverage),ligGlyphs:this.parseList(v.pointer(Ko))}},Jo=function(){return this.parseUShort(),this.parseList(v.pointer(v.coverage))};function eu(e,r){r=r||0;var t=new v(e,r),n=t.parseVersion(1);E.argument(n===1||n===1.2||n===1.3,"Unsupported GDEF table version.");var a={version:n,classDef:t.parsePointer(v.classDef),attachList:t.parsePointer(Zo),ligCaretList:t.parsePointer(jo),markAttachClassDef:t.parsePointer(v.classDef)};return n>=1.2&&(a.markGlyphSets=t.parsePointer(Jo)),a}var ru={parse:eu},te=new Array(10);te[1]=function(){var r=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{posFormat:1,coverage:this.parsePointer(v.coverage),value:this.parseValueRecord()};if(t===2)return{posFormat:2,coverage:this.parsePointer(v.coverage),values:this.parseValueRecordList()};E.assert(!1,"0x"+r.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")};te[2]=function(){var r=this.offset+this.relativeOffset,t=this.parseUShort();E.assert(t===1||t===2,"0x"+r.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");var n=this.parsePointer(v.coverage),a=this.parseUShort(),s=this.parseUShort();if(t===1)return{posFormat:t,coverage:n,valueFormat1:a,valueFormat2:s,pairSets:this.parseList(v.pointer(v.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(a),value2:this.parseValueRecord(s)}})))};if(t===2){var i=this.parsePointer(v.classDef),u=this.parsePointer(v.classDef),o=this.parseUShort(),l=this.parseUShort();return{posFormat:t,coverage:n,valueFormat1:a,valueFormat2:s,classDef1:i,classDef2:u,class1Count:o,class2Count:l,classRecords:this.parseList(o,v.list(l,function(){return{value1:this.parseValueRecord(a),value2:this.parseValueRecord(s)}}))}}};te[3]=function(){return{error:"GPOS Lookup 3 not supported"}};te[4]=function(){return{error:"GPOS Lookup 4 not supported"}};te[5]=function(){return{error:"GPOS Lookup 5 not supported"}};te[6]=function(){return{error:"GPOS Lookup 6 not supported"}};te[7]=function(){return{error:"GPOS Lookup 7 not supported"}};te[8]=function(){return{error:"GPOS Lookup 8 not supported"}};te[9]=function(){return{error:"GPOS Lookup 9 not supported"}};function tu(e,r){r=r||0;var t=new v(e,r),n=t.parseVersion(1);return E.argument(n===1||n===1.1,"Unsupported GPOS table version "+n),n===1?{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(te)}:{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(te),variations:t.parseFeatureVariationsList()}}var nu=new Array(10);function au(e){return new S.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new S.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new S.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new S.LookupList(e.lookups,nu)}])}var su={parse:tu,make:au};function iu(e){var r={};e.skip("uShort");var t=e.parseUShort();E.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 s=e.parseUShort(),i=e.parseUShort(),u=e.parseShort();r[s+","+i]=u}return r}function ou(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 s=e.parseUShort();e.skip("uShort",3);for(var i=0;i<s;i+=1){var u=e.parseUShort(),o=e.parseUShort(),l=e.parseShort();r[u+","+o]=l}}return r}function uu(e,r){var t=new F.Parser(e,r),n=t.parseUShort();if(n===0)return iu(t);if(n===1)return ou(t);throw new Error("Unsupported kern table version ("+n+").")}var lu={parse:uu};function fu(e,r,t,n){for(var a=new F.Parser(e,r),s=n?a.parseUShort:a.parseULong,i=[],u=0;u<t+1;u+=1){var o=s.call(a);n&&(o*=2),i.push(o)}return i}var cu={parse:fu};function pu(e,r){var t=require("fs");t.readFile(e,function(n,a){if(n)return r(n.message);r(null,Tn(a))})}function hu(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 It(e,r){for(var t=[],n=12,a=0;a<r;a+=1){var s=F.getTag(e,n),i=F.getULong(e,n+4),u=F.getULong(e,n+8),o=F.getULong(e,n+12);t.push({tag:s,checksum:i,offset:u,length:o,compression:!1}),n+=16}return t}function vu(e,r){for(var t=[],n=44,a=0;a<r;a+=1){var s=F.getTag(e,n),i=F.getULong(e,n+4),u=F.getULong(e,n+8),o=F.getULong(e,n+12),l=void 0;u<o?l="WOFF":l=!1,t.push({tag:s,offset:i,compression:l,compressedLength:u,length:o}),n+=20}return t}function N(e,r){if(r.compression==="WOFF"){var t=new Uint8Array(e.buffer,r.offset+2,r.compressedLength-2),n=new Uint8Array(r.length);if(aa(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 Zr(e,r){r=r??{};var t,n,a=new M({empty:!0}),s=new DataView(e,0),i,u=[],o=F.getTag(s,0);if(o==="\0\0\0"||o==="true"||o==="typ1")a.outlinesFormat="truetype",i=F.getUShort(s,4),u=It(s,i);else if(o==="OTTO")a.outlinesFormat="cff",i=F.getUShort(s,4),u=It(s,i);else if(o==="wOFF"){var l=F.getTag(s,4);if(l==="\0\0\0")a.outlinesFormat="truetype";else if(l==="OTTO")a.outlinesFormat="cff";else throw new Error("Unsupported OpenType flavor "+o);i=F.getUShort(s,12),u=vu(s,i)}else throw new Error("Unsupported OpenType signature "+o);for(var f,p,c,h,d,g,m,y,U,x,L,w,D=0;D<i;D+=1){var C=u[D],T=void 0;switch(C.tag){case"cmap":T=N(s,C),a.tables.cmap=Zt.parse(T.data,T.offset),a.encoding=new Kt(a.tables.cmap);break;case"cvt ":T=N(s,C),w=new F.Parser(T.data,T.offset),a.tables.cvt=w.parseShortList(C.length/2);break;case"fvar":p=C;break;case"fpgm":T=N(s,C),w=new F.Parser(T.data,T.offset),a.tables.fpgm=w.parseByteList(C.length);break;case"head":T=N(s,C),a.tables.head=un.parse(T.data,T.offset),a.unitsPerEm=a.tables.head.unitsPerEm,t=a.tables.head.indexToLocFormat;break;case"hhea":T=N(s,C),a.tables.hhea=ln.parse(T.data,T.offset),a.ascender=a.tables.hhea.ascender,a.descender=a.tables.hhea.descender,a.numberOfHMetrics=a.tables.hhea.numberOfHMetrics;break;case"hmtx":m=C;break;case"ltag":T=N(s,C),n=cn.parse(T.data,T.offset);break;case"maxp":T=N(s,C),a.tables.maxp=pn.parse(T.data,T.offset),a.numGlyphs=a.tables.maxp.numGlyphs;break;case"name":x=C;break;case"OS/2":T=N(s,C),a.tables.os2=Br.parse(T.data,T.offset);break;case"post":T=N(s,C),a.tables.post=yn.parse(T.data,T.offset),a.glyphNames=new zr(a.tables.post);break;case"prep":T=N(s,C),w=new F.Parser(T.data,T.offset),a.tables.prep=w.parseByteList(C.length);break;case"glyf":c=C;break;case"loca":U=C;break;case"CFF ":f=C;break;case"kern":y=C;break;case"GDEF":h=C;break;case"GPOS":d=C;break;case"GSUB":g=C;break;case"meta":L=C;break}}var R=N(s,x);if(a.tables.name=mn.parse(R.data,R.offset,n),a.names=a.tables.name,c&&U){var q=t===0,A=N(s,U),X=cu.parse(A.data,A.offset,a.numGlyphs,q),Q=N(s,c);a.glyphs=Cn.parse(Q.data,Q.offset,X,a,r)}else if(f){var P=N(s,f);on.parse(P.data,P.offset,a,r)}else throw new Error("Font doesn't contain TrueType or CFF outlines.");var H=N(s,m);if(fn.parse(a,H.data,H.offset,a.numberOfHMetrics,a.numGlyphs,a.glyphs,r),Ua(a,r),y){var Y=N(s,y);a.kerningPairs=lu.parse(Y.data,Y.offset)}else a.kerningPairs={};if(h){var W=N(s,h);a.tables.gdef=ru.parse(W.data,W.offset)}if(d){var I=N(s,d);a.tables.gpos=su.parse(I.data,I.offset),a.position.init()}if(g){var z=N(s,g);a.tables.gsub=xn.parse(z.data,z.offset)}if(p){var $=N(s,p);a.tables.fvar=$o.parse($.data,$.offset,a.names)}if(L){var B=N(s,L);a.tables.meta=bn.parse(B.data,B.offset),a.metas=a.tables.meta}return a}function du(e,r,t){t=t??{};var n=typeof window>"u",a=n&&!t.isUrl?pu:hu;return new Promise(function(s,i){a(e,function(u,o){if(u){if(r)return r(u);i(u)}var l;try{l=Zr(o,t)}catch(f){if(r)return r(f,null);i(f)}if(r)return r(null,l);s(l)})})}function gu(e,r){var t=require("fs"),n=t.readFileSync(e);return Zr(Tn(n),r)}var mu=Object.freeze({__proto__:null,Font:M,Glyph:K,Path:V,BoundingBox:he,_parse:F,parse:Zr,load:du,loadSync:gu});function yu(e,r){const t={svgGlyphs:r};return new Proxy(e,{get(n,a,s){if(a in t)return t[a];const i=Reflect.get(n,a,s);return typeof i=="function"?i.bind(n):i},has(n,a){return a in t||Reflect.has(n,a)},set(n,a,s){return a==="svgGlyphs"?(t.svgGlyphs=s,!0):!1}})}const Ir=new Map,xu=()=>Ir,Mn=async(e,r=!1)=>{const t=Ir.get(e);if(t){if(r&&!t.svgGlyphs){const o=await fetch(e);if(!o.ok)throw new Error(`Failed to load font from ${e}: ${o.status} ${o.statusText}`);const l=await o.arrayBuffer(),{extractSVGGlyphs:f}=await Promise.resolve().then(()=>require("../index-BFEQ7yc6.cjs"));t.svgGlyphs=await f(l)}return t}const n=await fetch(e);if(!n.ok)throw new Error(`Failed to load font from ${e}: ${n.status} ${n.statusText}`);const a=await n.arrayBuffer(),s=mu.parse(a);let i;if(r){const{extractSVGGlyphs:o}=await Promise.resolve().then(()=>require("../index-BFEQ7yc6.cjs"));i=await o(a)}const u=yu(s,i);return Ir.set(e,u),u},In=.03125,Qr=1.1,bu=.2,De={outlineWidth:In,letterSpacing:0,letterSpacingOutline:0};class fe{constructor(r,t){this.x=r,this.y=t}get X(){return this.x}get Y(){return this.y}toSVGString(){return`${this.x} ${this.y}`}}function Su(e,r,t=new fe(0,0)){const n=e.X-t.X,a=e.Y-t.Y,s=r/180*Math.PI,i=Math.cos(s),u=Math.sin(s),o=n*i-a*u,l=n*u+a*i;return new fe(o+t.X,l+t.Y)}const Pn=e=>e===void 0||e==="flat"?{type:"flat"}:e==="curved"?{type:"curved"}:e,Gn=e=>{if(!e||!e.trim())throw new Error("Custom baseline path must be a non-empty SVG path string");if(!e.trim().startsWith("M"))throw new Error("Custom baseline path must start with an M (moveto) command")},Nn=({boxDimensions:e,totalTextHeight:r,baseline:t,lineHeight:n,verticalAlignment:a="centre",lineNumber:s=0})=>{const{width:i,height:u}=e,o=n-t;let l=t;switch(a){case"centre":{l=(u-r)/2+n-o;break}case"bottom":{l=u-r+n-o;break}}return l+=s*(n*Qr),`M 0 ${l} L ${i} ${l}`},Kr=({boxDimensions:e,baseline:r,textHeight:t,verticalAlignment:n})=>{const{width:a,height:s}=e,i=t*bu,u=t+i,o=n==="top"?0:s/2-u/2,l=r+o,f=l+i;if(n!=="top"&&(f>s||l-t<0))return Kr({boxDimensions:e,baseline:r,textHeight:t,verticalAlignment:"top"});const p=t/4,c=new fe(p,f),h=new fe(a/2,l),d=new fe(a-p,f),g=a*.2,m=new fe(g,r+o),y=new fe(a-g,r+o),U=`M ${c.toSVGString()}`,x=`Q ${m.toSVGString()} ${h.toSVGString()}`,L=`Q ${y.toSVGString()} ${d.toSVGString()}`;return`${U} ${x} ${L}`},Tu=e=>{const r=["I","l","1"];for(const t of r){const n=e.charToGlyph(t);if(n&&n.name!==".notdef")return t}return console.error('No standard character found for fixed height calculation. Using "I" as default.'),"I"},Fr=100,Hn=({font:e,boxDimensions:r,physicalSize:t,spacing:n=De})=>{const a=t;if(a[1]!==r.physicalUnits)throw new Error(`Mismatched units between physicalFontSize (${a[1]}) and boxDimensions (${r.physicalUnits})`);const{outlineWidth:s}=n,i=Tu(e),o=e.getPath(i,0,0,Fr).getBoundingBox();let l=o.y2-o.y1;if(s>0){const d=Fr*s;l+=d*2}const p=l/r.height*r.physicalHeight,c=a[0]/p;return Fr*c},Wn=({font:e,text:r,fontSize:t,spacing:n=De})=>{const{outlineWidth:a,letterSpacing:s,letterSpacingOutline:i}=n,o=e.getPath(r,0,0,t).getBoundingBox(),l=a?t*a*2:0,f=a>0?i:s,p=r.length>1?f*t*(r.length-1):0,c=o.x2-o.x1+l+p,h=o.y2-o.y1+l,d=o.y1*-1+l/2;return{width:c,height:h,baseline:d}},cr=Zn.DOMParser,ku=Qn,Fu=()=>new cr().parseFromString("<svg></svg>","image/svg+xml"),Uu=Fu();Uu.readyState="complete";const Cu={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},wu=e=>{let r=Array.from(e),t=!1;return r[0]==="#"&&(r.shift(),t=!0),r.length===3&&(r=r.map(n=>`${n}${n}`)),`${t?"#":""}${r.join("").toLowerCase()}`},Ur=e=>{const r=typeof e=="string"?Number.parseInt(e,10):e;return Math.max(0,Math.min(255,Math.round(r))).toString(16).padStart(2,"0")},Pt=(...e)=>{const[r,t,n]=Array.isArray(e[0])?e[0]:e;return`#${Ur(r)}${Ur(t)}${Ur(n)}`},Eu=(e,r,t)=>{if(r===0){const f=Math.round(t*255);return[f,f,f]}const n=(e%360+360)%360,a=(1-Math.abs(2*t-1))*r,s=a*(1-Math.abs(n/60%2-1)),i=t-a/2;let u=0,o=0,l=0;return n<60?(u=a,o=s,l=0):n<120?(u=s,o=a,l=0):n<180?(u=0,o=a,l=s):n<240?(u=0,o=s,l=a):n<300?(u=s,o=0,l=a):(u=a,o=0,l=s),[Math.round((u+i)*255),Math.round((o+i)*255),Math.round((l+i)*255)]},Ou=e=>/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e),zn=e=>{const r=e.trim().toLowerCase();if(r.startsWith("#")||/^[0-9a-f]{3}([0-9a-f]{3})?$/.test(r))return Ou(r)?wu(r):void 0;if(r.startsWith("rgb")){const n=r.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*[\d.]+\s*)?\)/);return n?Pt(Number.parseInt(n[1],10),Number.parseInt(n[2],10),Number.parseInt(n[3],10)):void 0}if(r.startsWith("hsl")){const n=r.match(/hsla?\(\s*(\d+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*[\d.]+\s*)?\)/);if(!n)return;const a=Number.parseInt(n[1],10),s=Number.parseFloat(n[2])/100,i=Number.parseFloat(n[3])/100,[u,o,l]=Eu(a,s,i);return Pt(u,o,l)}const t=Cu[r];if(t)return t},me={circle:"circle",ellipse:"ellipse",rect:"rect",line:"line",path:"path",polygon:"polygon",polyline:"polyline",stop:"stop"},ur={fill:"fill",stroke:"stroke"},Lu={tiling:[me.circle,me.ellipse,me.rect,me.line,me.path,me.polygon,me.polyline,me.stop,`[${ur.fill}]`,`[${ur.stroke}]`]},Ru=e=>Array.from(e.querySelectorAll(Lu.tiling.map(r=>`*:not(clipPath) > ${r}`).join(", "))),Du=e=>{const r=e.getAttribute(ur.stroke);return r==="none"||!r?!1:r},Cr=e=>{if(!(e==="none"||e==="transparent"||e.startsWith("url(")))return zn(e)},Au=e=>{const r=Ru(e).reduce((t,n)=>{const a=n.getAttribute("stop-color"),s=n.getAttribute(ur.fill)||"#000",i=Du(n);if(!a){const u=Cr(s);u&&t.add(u)}if(a){const u=Cr(a);u&&t.add(u)}if(i){const u=Cr(i);u&&t.add(u)}return t},new Set);return Array.from(r)},Bu=e=>{const r=new cr().parseFromString(e,"image/svg+xml").querySelector("svg");return r?Au(r):[]};function _n(e){const r=e.trim(),t=r.startsWith("<svg")||r.startsWith("<?xml"),n=t?r:`<svg>${r}</svg>`;return{doc:new cr().parseFromString(n,"image/svg+xml"),wasWrapped:!t}}function Vn(e,r){const t=e.querySelector("svg");return t?r?t.innerHTML:t.outerHTML:""}function Mu(e){const{svgGlyphs:r}=e;if(!r||r.size===0)return[];const t=new Set;for(const[,n]of r)for(const a of Bu(n.svg))t.add(a);return Array.from(t)}function Iu(e){return!!e&&e!=="none"&&e!=="transparent"&&!e.startsWith("url(")}function Pu(e){const t=new cr().parseFromString(e,"image/svg+xml").querySelector("svg");return t?t.innerHTML.trim():""}const Gu=["fill","stroke","clip-path","mask","filter"];function Nu(e,r){const{doc:t,wasWrapped:n}=_n(e),a=new Map;for(const s of t.querySelectorAll("[id]")){const i=s.getAttribute("id");if(!i)continue;const u=`${r}-${i}`;a.set(i,u),s.setAttribute("id",u)}if(a.size===0)return e;for(const s of Gu)for(const i of t.querySelectorAll(`[${s}]`)){const u=i.getAttribute(s);if(u){const o=u.replace(/url\(#([^)]+)\)/g,(l,f)=>{const p=a.get(f);return p?`url(#${p})`:`url(#${f})`});o!==u&&i.setAttribute(s,o)}}for(const s of t.querySelectorAll("[href], [xlink\\:href]"))for(const i of["href","xlink:href"]){const u=s.getAttribute(i);if(u?.startsWith("#")){const o=u.slice(1),l=a.get(o);l&&s.setAttribute(i,`#${l}`)}}return Vn(t,n)}const Hu=["fill","stroke","stop-color"],Wu=["path","rect","circle","ellipse","polygon","polyline","text"];function zu(e,r){const{doc:t,wasWrapped:n}=_n(e);for(const s of Hu)for(const i of t.querySelectorAll(`[${s}]`)){const u=i.getAttribute(s);if(!u||!Iu(u))continue;const o=zn(u),l=o?r[o]:void 0;l&&i.setAttribute(s,l.hex)}const a=r["#000000"];if(a){const s=Wu.map(i=>`${i}:not([fill])`).join(", ");for(const i of t.querySelectorAll(s))i.setAttribute("fill",a.hex)}return Vn(t,n)}const _u=(e=[1,0,0,1,0,0])=>{const r=`matrix(${e.join(",")})`,t=new ku(r);if(!t)throw new Error("Your browser does not support matrices");return t};function Vu(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const Gt=(e,r,t)=>e/t*r,qu=({font:e,baselinePath:r,text:t,fontSize:n,spacing:a=De,horizontalAlignment:s="centre",colourMap:i})=>{const{outlineWidth:u,letterSpacing:o,letterSpacingOutline:l}=a,f=new $n.svgPathProperties(r),p=u?n*u*2:0,c=f.getTotalLength(),h=e.getPaths(t,0,0,n,{drawSVG:!1}),g=e.getPath(t,0,0,n,{drawSVG:!1}).getBoundingBox(),m=g.x1-p/2,U=g.x2+p/2-m,x=u>0?l:o;let L=x?x*n:0;s==="distributed"&&(L=t.length===1?0:(c-U)/(t.length-1));const w=L*(t.length-1),D=U+w;let C=0-m;s==="centre"?C=(c-D)/2-m:s==="right"&&(C=c-U-m-w);const T=[];for(let R=0;R<h.length;R++){const q=h[R],A=q.getBoundingBox(),X=e.charToGlyph(t[R]),{advanceWidth:Q}=X;if(!Q)throw new Error(`No advance width for character: ${t[R]} in font ${e.names.fontFamily}`);const{x1:P,x2:H}=X.getBoundingBox(),Y=Gt(Q,n,e.unitsPerEm),W=Gt(H-P,n,e.unitsPerEm);let I=C+A.x1;if(R>0&&(I+=L*R),I+W>c)throw new Error(`TOO_WIDE: character "${t[R]}" at index ${R} exceeds baseline path length (${Math.round(I+W)} > ${Math.round(c)})`);const z=I+Y/2,$=f.getTangentAtLength(z),B=Math.atan2($.y,$.x)*180/Math.PI,_=f.getPointAtLength(I),Ae=_.x,pr=_.y,Be=A.x2-A.x1,Me=new fe(A.x1+Be/2,0),Ie=Su(new fe(A.x1,0),B,Me),Ce=Ae-Ie.X,Xn=pr-Ie.Y;let se=_u();se=se.translate(Ce,Xn),B&&(se=se.translate(A.x1+Be/2,0),se=se.rotate(B),se=se.translate(-A.x1-Be/2,0));const Yn=se.toString();let ve=q.toPathData(2);ve.length&&!ve.endsWith("Z")&&(ve+="Z",ve=ve.replace(/M/g,"ZM"),ve=ve.substring(1));let hr;if(e.svgGlyphs){const vr=e.svgGlyphs.get(X.index);if(vr){let Pe=Pu(vr.svg);Pe=Nu(Pe,`g${X.index}-${R}`),i&&(Pe=zu(Pe,i)),hr={content:Pe,viewBox:vr.viewbox,x:A.x1,y:A.y1,width:A.x2-A.x1,height:A.y2-A.y1,glyphIndex:X.index}}}T.push({path:q,matrix:se,attributes:{d:ve,"data-character":Vu(t[R]),transform:Yn},glyphData:{index:X.index,bbox:A},...hr?{svgGlyph:hr}:{}})}return T},Nt={hex:"#FFFFFF"},Pr=(e,r)=>{const t=`data-${e}-colour-url`,n=[`${e}="${r.hex}"`];return r.reference&&n.push(`${t}="${r.reference}"`),n.join(" ")},Ht=(e,r)=>{const{attributes:t,svgGlyph:n}=e;return n?`<g transform="${t.transform}" data-character="${t["data-character"]}"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="${n.viewBox}" width="${n.width}" height="${n.height}" x="${n.x}" y="${n.y}" data-glyph-index="${n.glyphIndex}">${n.content}</svg></g>`:`<path d="${t.d}" ${Pr("fill",r)} transform="${t.transform}" data-character="${t["data-character"]}"/>`},Xu=({boxDimensions:e,paths:r,spacing:t=De,fontSize:n=0,fillColour:a=Nt,strokeColour:s=Nt})=>{const{width:i,height:u}=e,{outlineWidth:o}=t,l=o>0&&n>0;let f;if(l){const c=n*o*2,h=r.filter(g=>!g.svgGlyph).map(({attributes:g})=>`<path d="${g.d}" ${Pr("fill",s)} ${Pr("stroke",s)} stroke-width="${c}" stroke-linejoin="round" transform="${g.transform}" data-character="${g["data-character"]}"/>`).join(`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $n=require("svg-path-properties"),Zn=require("linkedom");require("node:path");const Qn=require("@thednp/dommatrix");String.prototype.codePointAt||(function(){var e=(function(){try{var t={},n=Object.defineProperty,a=n(t,t,t)&&n}catch{}return a})(),r=function(t){if(this==null)throw TypeError();var n=String(this),a=n.length,s=t?Number(t):0;if(s!=s&&(s=0),!(s<0||s>=a)){var i=n.charCodeAt(s),u;return i>=55296&&i<=56319&&a>s+1&&(u=n.charCodeAt(s+1),u>=56320&&u<=57343)?(i-55296)*1024+u-56320+65536:i}};e?e(String.prototype,"codePointAt",{value:r,configurable:!0,writable:!0}):String.prototype.codePointAt=r})();var Gr=0,Wt=-3;function He(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function Kn(e,r){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=r,this.destLen=0,this.ltree=new He,this.dtree=new He}var zt=new He,_t=new He,Nr=new Uint8Array(30),Hr=new Uint16Array(30),Vt=new Uint8Array(30),qt=new Uint16Array(30),jn=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),jr=new He,ie=new Uint8Array(320);function Xt(e,r,t,n){var a,s;for(a=0;a<t;++a)e[a]=0;for(a=0;a<30-t;++a)e[a+t]=a/t|0;for(s=n,a=0;a<30;++a)r[a]=s,s+=1<<e[a]}function Jn(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 Jr=new Uint16Array(16);function dr(e,r,t,n){var a,s;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,s=0,a=0;a<16;++a)Jr[a]=s,s+=e.table[a];for(a=0;a<n;++a)r[t+a]&&(e.trans[Jr[r[t+a]]++]=a)}function ea(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var r=e.tag&1;return e.tag>>>=1,r}function oe(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 wr(e,r){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var t=0,n=0,a=0,s=e.tag;do n=2*n+(s&1),s>>>=1,++a,t+=r.table[a],n-=r.table[a];while(n>=0);return e.tag=s,e.bitcount-=a,r.trans[t+n]}function ra(e,r,t){var n,a,s,i,u,o;for(n=oe(e,5,257),a=oe(e,5,1),s=oe(e,4,4),i=0;i<19;++i)ie[i]=0;for(i=0;i<s;++i){var l=oe(e,3,0);ie[jn[i]]=l}for(dr(jr,ie,0,19),u=0;u<n+a;){var f=wr(e,jr);switch(f){case 16:var p=ie[u-1];for(o=oe(e,2,3);o;--o)ie[u++]=p;break;case 17:for(o=oe(e,3,3);o;--o)ie[u++]=0;break;case 18:for(o=oe(e,7,11);o;--o)ie[u++]=0;break;default:ie[u++]=f;break}}dr(r,ie,0,n),dr(t,ie,n,a)}function et(e,r,t){for(;;){var n=wr(e,r);if(n===256)return Gr;if(n<256)e.dest[e.destLen++]=n;else{var a,s,i,u;for(n-=257,a=oe(e,Nr[n],Hr[n]),s=wr(e,t),i=e.destLen-oe(e,Vt[s],qt[s]),u=i;u<i+a;++u)e.dest[e.destLen++]=e.dest[u]}}}function ta(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 Wt;for(e.sourceIndex+=4,n=r;n;--n)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,Gr}function na(e,r){var t=new Kn(e,r),n,a,s;do{switch(n=ea(t),a=oe(t,2,0),a){case 0:s=ta(t);break;case 1:s=et(t,zt,_t);break;case 2:ra(t,t.ltree,t.dtree),s=et(t,t.ltree,t.dtree);break;default:s=Wt}if(s!==Gr)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}Jn(zt,_t);Xt(Nr,Hr,4,3);Xt(Vt,qt,2,1);Nr[28]=0;Hr[28]=258;var aa=na;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 he(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}he.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)};he.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))};he.prototype.addX=function(e){this.addPoint(e,null)};he.prototype.addY=function(e){this.addPoint(null,e)};he.prototype.addBezier=function(e,r,t,n,a,s,i,u){var o=[e,r],l=[t,n],f=[a,s],p=[i,u];this.addPoint(e,r),this.addPoint(i,u);for(var c=0;c<=1;c++){var h=6*o[c]-12*l[c]+6*f[c],d=-3*o[c]+9*l[c]-9*f[c]+3*p[c],g=3*l[c]-3*o[c];if(d===0){if(h===0)continue;var m=-g/h;0<m&&m<1&&(c===0&&this.addX(we(o[c],l[c],f[c],p[c],m)),c===1&&this.addY(we(o[c],l[c],f[c],p[c],m)));continue}var y=Math.pow(h,2)-4*g*d;if(!(y<0)){var F=(-h+Math.sqrt(y))/(2*d);0<F&&F<1&&(c===0&&this.addX(we(o[c],l[c],f[c],p[c],F)),c===1&&this.addY(we(o[c],l[c],f[c],p[c],F)));var x=(-h-Math.sqrt(y))/(2*d);0<x&&x<1&&(c===0&&this.addX(we(o[c],l[c],f[c],p[c],x)),c===1&&this.addY(we(o[c],l[c],f[c],p[c],x)))}}};he.prototype.addQuad=function(e,r,t,n,a,s){var i=e+.6666666666666666*(t-e),u=r+2/3*(n-r),o=i+1/3*(a-e),l=u+1/3*(s-r);this.addBezier(e,r,i,u,o,l,a,s)};function q(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}q.prototype.moveTo=function(e,r){this.commands.push({type:"M",x:e,y:r})};q.prototype.lineTo=function(e,r){this.commands.push({type:"L",x:e,y:r})};q.prototype.curveTo=q.prototype.bezierCurveTo=function(e,r,t,n,a,s){this.commands.push({type:"C",x1:e,y1:r,x2:t,y2:n,x:a,y:s})};q.prototype.quadTo=q.prototype.quadraticCurveTo=function(e,r,t,n){this.commands.push({type:"Q",x1:e,y1:r,x:t,y:n})};q.prototype.close=q.prototype.closePath=function(){this.commands.push({type:"Z"})};q.prototype.extend=function(e){if(e.commands)e=e.commands;else if(e instanceof he){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)};q.prototype.getBoundingBox=function(){for(var e=new he,r=0,t=0,n=0,a=0,s=0;s<this.commands.length;s++){var i=this.commands[s];switch(i.type){case"M":e.addPoint(i.x,i.y),r=n=i.x,t=a=i.y;break;case"L":e.addPoint(i.x,i.y),n=i.x,a=i.y;break;case"Q":e.addQuad(n,a,i.x1,i.y1,i.x,i.y),n=i.x,a=i.y;break;case"C":e.addBezier(n,a,i.x1,i.y1,i.x2,i.y2,i.x,i.y),n=i.x,a=i.y;break;case"Z":n=r,a=t;break;default:throw new Error("Unexpected path command "+i.type)}}return e.isEmpty()&&e.addPoint(0,0),e};q.prototype.draw=function(e){e.beginPath();for(var r=0;r<this.commands.length;r+=1){var t=this.commands[r];t.type==="M"?e.moveTo(t.x,t.y):t.type==="L"?e.lineTo(t.x,t.y):t.type==="C"?e.bezierCurveTo(t.x1,t.y1,t.x2,t.y2,t.x,t.y):t.type==="Q"?e.quadraticCurveTo(t.x1,t.y1,t.x,t.y):t.type==="Z"&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())};q.prototype.toPathData=function(e){e=e!==void 0?e:2;function r(i){return Math.round(i)===i?""+Math.round(i):i.toFixed(e)}function t(){for(var i=arguments,u="",o=0;o<arguments.length;o+=1){var l=i[o];l>=0&&o>0&&(u+=" "),u+=r(l)}return u}for(var n="",a=0;a<this.commands.length;a+=1){var s=this.commands[a];s.type==="M"?n+="M"+t(s.x,s.y):s.type==="L"?n+="L"+t(s.x,s.y):s.type==="C"?n+="C"+t(s.x1,s.y1,s.x2,s.y2,s.x,s.y):s.type==="Q"?n+="Q"+t(s.x1,s.y1,s.x,s.y):s.type==="Z"&&(n+="Z")}return n};q.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};q.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 Yt(e){throw new Error(e)}function rt(e,r){e||Yt(r)}var E={fail:Yt,argument:rt,assert:rt},tt=32768,nt=2147483648,Oe={},b={},L={};function ne(e){return function(){return e}}b.BYTE=function(e){return E.argument(e>=0&&e<=255,"Byte value should be between 0 and 255."),[e]};L.BYTE=ne(1);b.CHAR=function(e){return[e.charCodeAt(0)]};L.CHAR=ne(1);b.CHARARRAY=function(e){typeof e>"u"&&(e="",console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));for(var r=[],t=0;t<e.length;t+=1)r[t]=e.charCodeAt(t);return r};L.CHARARRAY=function(e){return typeof e>"u"?0:e.length};b.USHORT=function(e){return[e>>8&255,e&255]};L.USHORT=ne(2);b.SHORT=function(e){return e>=tt&&(e=-(2*tt-e)),[e>>8&255,e&255]};L.SHORT=ne(2);b.UINT24=function(e){return[e>>16&255,e>>8&255,e&255]};L.UINT24=ne(3);b.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]};L.ULONG=ne(4);b.LONG=function(e){return e>=nt&&(e=-(2*nt-e)),[e>>24&255,e>>16&255,e>>8&255,e&255]};L.LONG=ne(4);b.FIXED=b.ULONG;L.FIXED=L.ULONG;b.FWORD=b.SHORT;L.FWORD=L.SHORT;b.UFWORD=b.USHORT;L.UFWORD=L.USHORT;b.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,e&255]};L.LONGDATETIME=ne(8);b.TAG=function(e){return E.argument(e.length===4,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]};L.TAG=ne(4);b.Card8=b.BYTE;L.Card8=L.BYTE;b.Card16=b.USHORT;L.Card16=L.USHORT;b.OffSize=b.BYTE;L.OffSize=L.BYTE;b.SID=b.USHORT;L.SID=L.USHORT;b.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?b.NUMBER16(e):b.NUMBER32(e)};L.NUMBER=function(e){return b.NUMBER(e).length};b.NUMBER16=function(e){return[28,e>>8&255,e&255]};L.NUMBER16=ne(3);b.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,e&255]};L.NUMBER32=ne(5);b.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="",s=0,i=r.length;s<i;s+=1){var u=r[s];u==="e"?a+=r[++s]==="-"?"c":"b":u==="."?a+="a":u==="-"?a+="e":a+=u}a+=a.length&1?"f":"ff";for(var o=[30],l=0,f=a.length;l<f;l+=2)o.push(parseInt(a.substr(l,2),16));return o};L.REAL=function(e){return b.REAL(e).length};b.NAME=b.CHARARRAY;L.NAME=L.CHARARRAY;b.STRING=b.CHARARRAY;L.STRING=L.CHARARRAY;Oe.UTF8=function(e,r,t){for(var n=[],a=t,s=0;s<a;s++,r+=1)n[s]=e.getUint8(r);return String.fromCharCode.apply(null,n)};Oe.UTF16=function(e,r,t){for(var n=[],a=t/2,s=0;s<a;s++,r+=2)n[s]=e.getUint16(r);return String.fromCharCode.apply(null,n)};b.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};L.UTF16=function(e){return e.length*2};var Er={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};Oe.MACSTRING=function(e,r,t,n){var a=Er[n];if(a!==void 0){for(var s="",i=0;i<t;i++){var u=e.getUint8(r+i);u<=127?s+=String.fromCharCode(u):s+=a[u&127]}return s}};var Ze=typeof WeakMap=="function"&&new WeakMap,Qe,sa=function(e){if(!Qe){Qe={};for(var r in Er)Qe[r]=new String(r)}var t=Qe[e];if(t!==void 0){if(Ze){var n=Ze.get(t);if(n!==void 0)return n}var a=Er[e];if(a!==void 0){for(var s={},i=0;i<a.length;i++)s[a.charCodeAt(i)]=i+128;return Ze&&Ze.set(t,s),s}}};b.MACSTRING=function(e,r){var t=sa(r);if(t!==void 0){for(var n=[],a=0;a<e.length;a++){var s=e.charCodeAt(a);if(s>=128&&(s=t[s],s===void 0))return;n[a]=s}return n}};L.MACSTRING=function(e,r){var t=b.MACSTRING(e,r);return t!==void 0?t.length:0};function Or(e){return e>=-128&&e<=127}function ia(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 oa(e,r,t){for(var n=0,a=e.length,s=r;s<a&&n<64;){var i=e[s];if(!Or(i)||i===0&&s+1<a&&e[s+1]===0)break;++s,++n}t.push(n-1);for(var u=r;u<s;++u)t.push(e[u]+256&255);return s}function ua(e,r,t){for(var n=0,a=e.length,s=r;s<a&&n<64;){var i=e[s];if(i===0||Or(i)&&s+1<a&&Or(e[s+1]))break;++s,++n}t.push(64|n-1);for(var u=r;u<s;++u){var o=e[u];t.push(o+65536>>8&255,o+256&255)}return s}b.VARDELTAS=function(e){for(var r=0,t=[];r<e.length;){var n=e[r];n===0?r=ia(e,r,t):n>=-128&&n<=127?r=oa(e,r,t):r=ua(e,r,t)}return t};b.INDEX=function(e){for(var r=1,t=[r],n=[],a=0;a<e.length;a+=1){var s=b.OBJECT(e[a]);Array.prototype.push.apply(n,s),r+=s.length,t.push(r)}if(n.length===0)return[0,0];for(var i=[],u=1+Math.floor(Math.log(r)/Math.log(2))/8|0,o=[void 0,b.BYTE,b.USHORT,b.UINT24,b.ULONG][u],l=0;l<t.length;l+=1){var f=o(t[l]);Array.prototype.push.apply(i,f)}return Array.prototype.concat(b.Card16(e.length),b.OffSize(u),i,n)};L.INDEX=function(e){return b.INDEX(e).length};b.DICT=function(e){for(var r=[],t=Object.keys(e),n=t.length,a=0;a<n;a+=1){var s=parseInt(t[a],0),i=e[s];r=r.concat(b.OPERAND(i.value,i.type)),r=r.concat(b.OPERATOR(s))}return r};L.DICT=function(e){return b.DICT(e).length};b.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]};b.OPERAND=function(e,r){var t=[];if(Array.isArray(r))for(var n=0;n<r.length;n+=1)E.argument(e.length===r.length,"Not enough arguments given for type"+r),t=t.concat(b.OPERAND(e[n],r[n]));else if(r==="SID")t=t.concat(b.NUMBER(e));else if(r==="offset")t=t.concat(b.NUMBER32(e));else if(r==="number")t=t.concat(b.NUMBER(e));else if(r==="real")t=t.concat(b.REAL(e));else throw new Error("Unknown operand type "+r);return t};b.OP=b.BYTE;L.OP=L.BYTE;var Ke=typeof WeakMap=="function"&&new WeakMap;b.CHARSTRING=function(e){if(Ke){var r=Ke.get(e);if(r!==void 0)return r}for(var t=[],n=e.length,a=0;a<n;a+=1){var s=e[a];t=t.concat(b[s.type](s.value))}return Ke&&Ke.set(e,t),t};L.CHARSTRING=function(e){return b.CHARSTRING(e).length};b.OBJECT=function(e){var r=b[e.type];return E.argument(r!==void 0,"No encoding function for type "+e.type),r(e.value)};L.OBJECT=function(e){var r=L[e.type];return E.argument(r!==void 0,"No sizeOf function for type "+e.type),r(e.value)};b.TABLE=function(e){for(var r=[],t=e.fields.length,n=[],a=[],s=0;s<t;s+=1){var i=e.fields[s],u=b[i.type];E.argument(u!==void 0,"No encoding function for field type "+i.type+" ("+i.name+")");var o=e[i.name];o===void 0&&(o=i.value);var l=u(o);i.type==="TABLE"?(a.push(r.length),r=r.concat([0,0]),n.push(l)):r=r.concat(l)}for(var f=0;f<n.length;f+=1){var p=a[f],c=r.length;E.argument(c<65536,"Table "+e.tableName+" too big."),r[p]=c>>8,r[p+1]=c&255,r=r.concat(n[f])}return r};L.TABLE=function(e){for(var r=0,t=e.fields.length,n=0;n<t;n+=1){var a=e.fields[n],s=L[a.type];E.argument(s!==void 0,"No sizeOf function for field type "+a.type+" ("+a.name+")");var i=e[a.name];i===void 0&&(i=a.value),r+=s(i),a.type==="TABLE"&&(r+=2)}return r};b.RECORD=b.TABLE;L.RECORD=L.TABLE;b.LITERAL=function(e){return e};L.LITERAL=function(e){return e.length};function Z(e,r,t){if(r.length&&(r[0].name!=="coverageFormat"||r[0].value===1))for(var n=0;n<r.length;n+=1){var a=r[n];this[a.name]=a.value}if(this.tableName=e,this.fields=r,t)for(var s=Object.keys(t),i=0;i<s.length;i+=1){var u=s[i],o=t[u];this[u]!==void 0&&(this[u]=o)}}Z.prototype.encode=function(){return b.TABLE(this)};Z.prototype.sizeOf=function(){return L.TABLE(this)};function We(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 Lr(e,r,t){var n=r.length,a=new Array(n+1);a[0]={name:e+"Count",type:"USHORT",value:n};for(var s=0;s<n;s++)a[s+1]={name:e+s,type:"TABLE",value:t(r[s],s)};return a}function ze(e,r,t){var n=r.length,a=[];a[0]={name:e+"Count",type:"USHORT",value:n};for(var s=0;s<n;s++)a=a.concat(t(r[s],s));return a}function tr(e){e.format===1?Z.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(We("glyph",e.glyphs))):e.format===2?Z.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:2}].concat(ze("rangeRecord",e.ranges,function(r){return[{name:"startGlyphID",type:"USHORT",value:r.start},{name:"endGlyphID",type:"USHORT",value:r.end},{name:"startCoverageIndex",type:"USHORT",value:r.index}]}))):E.assert(!1,"Coverage format must be 1 or 2.")}tr.prototype=Object.create(Z.prototype);tr.prototype.constructor=tr;function nr(e){Z.call(this,"scriptListTable",ze("scriptRecord",e,function(r,t){var n=r.script,a=n.defaultLangSys;return E.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 Z("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new Z("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:a.reqFeatureIndex}].concat(We("featureIndex",a.featureIndexes)))}].concat(ze("langSys",n.langSysRecords,function(s,i){var u=s.langSys;return[{name:"langSysTag"+i,type:"TAG",value:s.tag},{name:"langSys"+i,type:"TABLE",value:new Z("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:u.reqFeatureIndex}].concat(We("featureIndex",u.featureIndexes)))}]})))}]}))}nr.prototype=Object.create(Z.prototype);nr.prototype.constructor=nr;function ar(e){Z.call(this,"featureListTable",ze("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 Z("featureTable",[{name:"featureParams",type:"USHORT",value:n.featureParams}].concat(We("lookupListIndex",n.lookupListIndexes)))}]}))}ar.prototype=Object.create(Z.prototype);ar.prototype.constructor=ar;function sr(e,r){Z.call(this,"lookupListTable",Lr("lookup",e,function(t){var n=r[t.lookupType];return E.assert(!!n,"Unable to write GSUB lookup type "+t.lookupType+" tables."),new Z("lookupTable",[{name:"lookupType",type:"USHORT",value:t.lookupType},{name:"lookupFlag",type:"USHORT",value:t.lookupFlag}].concat(Lr("subtable",t.subtables,n)))}))}sr.prototype=Object.create(Z.prototype);sr.prototype.constructor=sr;var S={Table:Z,Record:Z,Coverage:tr,ScriptList:nr,FeatureList:ar,LookupList:sr,ushortList:We,tableList:Lr,recordList:ze};function at(e,r){return e.getUint8(r)}function ir(e,r){return e.getUint16(r,!1)}function la(e,r){return e.getInt16(r,!1)}function Wr(e,r){return e.getUint32(r,!1)}function $t(e,r){var t=e.getInt16(r,!1),n=e.getUint16(r+2,!1);return t+n/65535}function fa(e,r){for(var t="",n=r;n<r+4;n+=1)t+=String.fromCharCode(e.getInt8(n));return t}function ca(e,r,t){for(var n=0,a=0;a<t;a+=1)n<<=8,n+=e.getUint8(r+a);return n}function pa(e,r,t){for(var n=[],a=r;a<t;a+=1)n.push(e.getUint8(a));return n}function ha(e){for(var r="",t=0;t<e.length;t+=1)r+=String.fromCharCode(e[t]);return r}var va={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function v(e,r){this.data=e,this.offset=r,this.relativeOffset=0}v.prototype.parseByte=function(){var e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e};v.prototype.parseChar=function(){var e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e};v.prototype.parseCard8=v.prototype.parseByte;v.prototype.parseUShort=function(){var e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e};v.prototype.parseCard16=v.prototype.parseUShort;v.prototype.parseSID=v.prototype.parseUShort;v.prototype.parseOffset16=v.prototype.parseUShort;v.prototype.parseShort=function(){var e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e};v.prototype.parseF2Dot14=function(){var e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e};v.prototype.parseULong=function(){var e=Wr(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e};v.prototype.parseOffset32=v.prototype.parseULong;v.prototype.parseFixed=function(){var e=$t(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e};v.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};v.prototype.parseTag=function(){return this.parseString(4)};v.prototype.parseLongDateTime=function(){var e=Wr(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e};v.prototype.parseVersion=function(e){var r=ir(this.data,this.offset+this.relativeOffset),t=ir(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,e===void 0&&(e=4096),r+t/e/10};v.prototype.skip=function(e,r){r===void 0&&(r=1),this.relativeOffset+=va[e]*r};v.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};v.prototype.parseOffset16List=v.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};v.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};v.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};v.prototype.parseList=function(e,r){r||(r=e,e=this.parseUShort());for(var t=new Array(e),n=0;n<e;n++)t[n]=r.call(this);return t};v.prototype.parseList32=function(e,r){r||(r=e,e=this.parseULong());for(var t=new Array(e),n=0;n<e;n++)t[n]=r.call(this);return t};v.prototype.parseRecordList=function(e,r){r||(r=e,e=this.parseUShort());for(var t=new Array(e),n=Object.keys(r),a=0;a<e;a++){for(var s={},i=0;i<n.length;i++){var u=n[i],o=r[u];s[u]=o.call(this)}t[a]=s}return t};v.prototype.parseRecordList32=function(e,r){r||(r=e,e=this.parseULong());for(var t=new Array(e),n=Object.keys(r),a=0;a<e;a++){for(var s={},i=0;i<n.length;i++){var u=n[i],o=r[u];s[u]=o.call(this)}t[a]=s}return t};v.prototype.parseStruct=function(e){if(typeof e=="function")return e.call(this);for(var r=Object.keys(e),t={},n=0;n<r.length;n++){var a=r[n],s=e[a];t[a]=s.call(this)}return t};v.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}};v.prototype.parseValueRecordList=function(){for(var e=this.parseUShort(),r=this.parseUShort(),t=new Array(r),n=0;n<r;n++)t[n]=this.parseValueRecord(e);return t};v.prototype.parsePointer=function(e){var r=this.parseOffset16();if(r>0)return new v(this.data,this.offset+r).parseStruct(e)};v.prototype.parsePointer32=function(e){var r=this.parseOffset32();if(r>0)return new v(this.data,this.offset+r).parseStruct(e)};v.prototype.parseListOfLists=function(e){for(var r=this.parseOffset16List(),t=r.length,n=this.relativeOffset,a=new Array(t),s=0;s<t;s++){var i=r[s];if(i===0){a[s]=void 0;continue}if(this.relativeOffset=i,e){for(var u=this.parseOffset16List(),o=new Array(u.length),l=0;l<u.length;l++)this.relativeOffset=i+u[l],o[l]=e.call(this);a[s]=o}else a[s]=this.parseUShortList()}return this.relativeOffset=n,a};v.prototype.parseCoverage=function(){var e=this.offset+this.relativeOffset,r=this.parseUShort(),t=this.parseUShort();if(r===1)return{format:1,glyphs:this.parseUShortList(t)};if(r===2){for(var n=new Array(t),a=0;a<t;a++)n[a]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:n}}throw new Error("0x"+e.toString(16)+": Coverage format must be 1 or 2.")};v.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:v.uShort,end:v.uShort,classId:v.uShort})};throw new Error("0x"+e.toString(16)+": ClassDef format must be 1 or 2.")};v.list=function(e,r){return function(){return this.parseList(e,r)}};v.list32=function(e,r){return function(){return this.parseList32(e,r)}};v.recordList=function(e,r){return function(){return this.parseRecordList(e,r)}};v.recordList32=function(e,r){return function(){return this.parseRecordList32(e,r)}};v.pointer=function(e){return function(){return this.parsePointer(e)}};v.pointer32=function(e){return function(){return this.parsePointer32(e)}};v.tag=v.prototype.parseTag;v.byte=v.prototype.parseByte;v.uShort=v.offset16=v.prototype.parseUShort;v.uShortList=v.prototype.parseUShortList;v.uLong=v.offset32=v.prototype.parseULong;v.uLongList=v.prototype.parseULongList;v.struct=v.prototype.parseStruct;v.coverage=v.prototype.parseCoverage;v.classDef=v.prototype.parseClassDef;var st={reserved:v.uShort,reqFeatureIndex:v.uShort,featureIndexes:v.uShortList};v.prototype.parseScriptList=function(){return this.parsePointer(v.recordList({tag:v.tag,script:v.pointer({defaultLangSys:v.pointer(st),langSysRecords:v.recordList({tag:v.tag,langSys:v.pointer(st)})})}))||[]};v.prototype.parseFeatureList=function(){return this.parsePointer(v.recordList({tag:v.tag,feature:v.pointer({featureParams:v.offset16,lookupListIndexes:v.uShortList})}))||[]};v.prototype.parseLookupList=function(e){return this.parsePointer(v.list(v.pointer(function(){var r=this.parseUShort();E.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(v.pointer(e[r])),markFilteringSet:n?this.parseUShort():void 0}})))||[]};v.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){var e=this.parseUShort(),r=this.parseUShort();E.argument(e===1&&r<1,"GPOS/GSUB feature variations table unknown.");var t=this.parseRecordList32({conditionSetOffset:v.offset32,featureTableSubstitutionOffset:v.offset32});return t})||[]};var k={getByte:at,getCard8:at,getUShort:ir,getCard16:ir,getShort:la,getULong:Wr,getFixed:$t,getTag:fa,getOffset:ca,getBytes:pa,bytesToString:ha,Parser:v};function da(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(),s=r.parseULong(),i=r.parseULong(),u=a;u<=s;u+=1)e.glyphIndexMap[u]=i,i++}function ga(e,r,t,n,a){e.length=r.parseUShort(),e.language=r.parseUShort();var s;e.segCount=s=r.parseUShort()>>1,r.skip("uShort",3),e.glyphIndexMap={};for(var i=new k.Parser(t,n+a+14),u=new k.Parser(t,n+a+16+s*2),o=new k.Parser(t,n+a+16+s*4),l=new k.Parser(t,n+a+16+s*6),f=n+a+16+s*8,p=0;p<s-1;p+=1)for(var c=void 0,h=i.parseUShort(),d=u.parseUShort(),g=o.parseShort(),m=l.parseUShort(),y=d;y<=h;y+=1)m!==0?(f=l.offset+l.relativeOffset-2,f+=m,f+=(y-d)*2,c=k.getUShort(t,f),c!==0&&(c=c+g&65535)):c=y+g&65535,e.glyphIndexMap[y]=c}function ma(e,r){var t={};t.version=k.getUShort(e,r),E.argument(t.version===0,"cmap table version should be 0."),t.numTables=k.getUShort(e,r+2);for(var n=-1,a=t.numTables-1;a>=0;a-=1){var s=k.getUShort(e,r+4+a*8),i=k.getUShort(e,r+4+a*8+2);if(s===3&&(i===0||i===1||i===10)||s===0&&(i===0||i===1||i===2||i===3||i===4)){n=k.getULong(e,r+4+a*8+4);break}}if(n===-1)throw new Error("No valid cmap sub-tables found.");var u=new k.Parser(e,r+n);if(t.format=u.parseUShort(),t.format===12)da(t,u);else if(t.format===4)ga(t,u,e,r,n);else throw new Error("Only format 4 and 12 cmap tables are supported (found format "+t.format+").");return t}function ya(e,r,t){e.segments.push({end:r,start:r,delta:-(r-t),offset:0,glyphIndex:t})}function xa(e){e.segments.push({end:65535,start:65535,delta:1,offset:0})}function ba(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 s=new S.Table("cmap",a);for(s.segments=[],t=0;t<e.length;t+=1){for(var i=e.get(t),u=0;u<i.unicodes.length;u+=1)ya(s,i.unicodes[u],t);s.segments=s.segments.sort(function(F,x){return F.start-x.start})}xa(s);var o=s.segments.length,l=0,f=[],p=[],c=[],h=[],d=[],g=[];for(t=0;t<o;t+=1){var m=s.segments[t];m.end<=65535&&m.start<=65535?(f=f.concat({name:"end_"+t,type:"USHORT",value:m.end}),p=p.concat({name:"start_"+t,type:"USHORT",value:m.start}),c=c.concat({name:"idDelta_"+t,type:"SHORT",value:m.delta}),h=h.concat({name:"idRangeOffset_"+t,type:"USHORT",value:m.offset}),m.glyphId!==void 0&&(d=d.concat({name:"glyph_"+t,type:"USHORT",value:m.glyphId}))):l+=1,!r&&m.glyphIndex!==void 0&&(g=g.concat({name:"cmap12Start_"+t,type:"ULONG",value:m.start}),g=g.concat({name:"cmap12End_"+t,type:"ULONG",value:m.end}),g=g.concat({name:"cmap12Glyph_"+t,type:"ULONG",value:m.glyphIndex}))}if(s.segCountX2=(o-l)*2,s.searchRange=Math.pow(2,Math.floor(Math.log(o-l)/Math.log(2)))*2,s.entrySelector=Math.log(s.searchRange/2)/Math.log(2),s.rangeShift=s.segCountX2-s.searchRange,s.fields=s.fields.concat(f),s.fields.push({name:"reservedPad",type:"USHORT",value:0}),s.fields=s.fields.concat(p),s.fields=s.fields.concat(c),s.fields=s.fields.concat(h),s.fields=s.fields.concat(d),s.cmap4Length=14+f.length*2+2+p.length*2+c.length*2+h.length*2+d.length*2,!r){var y=16+g.length*4;s.cmap12Offset=20+s.cmap4Length,s.fields=s.fields.concat([{name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:y},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:g.length/3}]),s.fields=s.fields.concat(g)}return s}var Zt={parse:ma,make:ba},er=[".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"],Sa=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],Ta=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],ke=[".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 Qt(e){this.font=e}Qt.prototype.charToGlyphIndex=function(e){var r=e.codePointAt(0),t=this.font.glyphs;if(t){for(var n=0;n<t.length;n+=1)for(var a=t.get(n),s=0;s<a.unicodes.length;s+=1)if(a.unicodes[s]===r)return n}return null};function Kt(e){this.cmap=e}Kt.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.codePointAt(0)]||0};function or(e,r){this.encoding=e,this.charset=r}or.prototype.charToGlyphIndex=function(e){var r=e.codePointAt(0),t=this.encoding[r];return this.charset.indexOf(t)};function zr(e){switch(e.version){case 1:this.names=ke.slice();break;case 2:this.names=new Array(e.numberOfGlyphs);for(var r=0;r<e.numberOfGlyphs;r++)e.glyphNameIndex[r]<ke.length?this.names[r]=ke[e.glyphNameIndex[r]]:this.names[r]=e.names[e.glyphNameIndex[r]-ke.length];break;case 2.5:this.names=new Array(e.numberOfGlyphs);for(var t=0;t<e.numberOfGlyphs;t++)this.names[t]=ke[t+e.glyphNameIndex[t]];break;case 3:this.names=[];break;default:this.names=[];break}}zr.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)};zr.prototype.glyphIndexToName=function(e){return this.names[e]};function ka(e){for(var r,t=e.tables.cmap.glyphIndexMap,n=Object.keys(t),a=0;a<n.length;a+=1){var s=n[a],i=t[s];r=e.glyphs.get(i),r.addUnicode(parseInt(s))}for(var u=0;u<e.glyphs.length;u+=1)r=e.glyphs.get(u),e.cffEncoding?e.isCIDFont?r.name="gid"+u:r.name=e.cffEncoding.charset[u]:e.glyphNames.names&&(r.name=e.glyphNames.glyphIndexToName(u))}function Fa(e){e._IndexToUnicodeMap={};for(var r=e.tables.cmap.glyphIndexMap,t=Object.keys(r),n=0;n<t.length;n+=1){var a=t[n],s=r[a];e._IndexToUnicodeMap[s]===void 0?e._IndexToUnicodeMap[s]={unicodes:[parseInt(a)]}:e._IndexToUnicodeMap[s].unicodes.push(parseInt(a))}}function Ua(e,r){r.lowMemory?Fa(e):ka(e)}function Ca(e,r,t,n,a){e.beginPath(),e.moveTo(r,t),e.lineTo(n,a),e.stroke()}var Te={line:Ca};function wa(e,r){var t=r||new q;return{configurable:!0,get:function(){return typeof t=="function"&&(t=t()),t},set:function(n){t=n}}}function K(e){this.bindConstructorValues(e)}K.prototype.bindConstructorValues=function(e){this.index=e.index||0,this.name=e.name||null,this.unicode=e.unicode||void 0,this.unicodes=e.unicodes||e.unicode!==void 0?[e.unicode]:[],"xMin"in e&&(this.xMin=e.xMin),"yMin"in e&&(this.yMin=e.yMin),"xMax"in e&&(this.xMax=e.xMax),"yMax"in e&&(this.yMax=e.yMax),"advanceWidth"in e&&(this.advanceWidth=e.advanceWidth),Object.defineProperty(this,"path",wa(this,e.path))};K.prototype.addUnicode=function(e){this.unicodes.length===0&&(this.unicode=e),this.unicodes.push(e)};K.prototype.getBoundingBox=function(){return this.path.getBoundingBox()};K.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 s,i;n||(n={});var u=n.xScale,o=n.yScale;if(n.hinting&&a&&a.hinting&&(i=this.path&&a.hinting.exec(this,t)),i)s=a.hinting.getCommands(i),e=Math.round(e),r=Math.round(r),u=o=1;else{s=this.path.commands;var l=1/(this.path.unitsPerEm||1e3)*t;u===void 0&&(u=l),o===void 0&&(o=l)}for(var f=new q,p=0;p<s.length;p+=1){var c=s[p];c.type==="M"?f.moveTo(e+c.x*u,r+-c.y*o):c.type==="L"?f.lineTo(e+c.x*u,r+-c.y*o):c.type==="Q"?f.quadraticCurveTo(e+c.x1*u,r+-c.y1*o,e+c.x*u,r+-c.y*o):c.type==="C"?f.curveTo(e+c.x1*u,r+-c.y1*o,e+c.x2*u,r+-c.y2*o,e+c.x*u,r+-c.y*o):c.type==="Z"&&f.closePath()}return f};K.prototype.getContours=function(){if(this.points===void 0)return[];for(var e=[],r=[],t=0;t<this.points.length;t+=1){var n=this.points[t];r.push(n),n.lastPointOfContour&&(e.push(r),r=[])}return E.argument(r.length===0,"There are still points left in the current contour."),e};K.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 s={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(s.xMin)||(s.xMin=0),isFinite(s.xMax)||(s.xMax=this.advanceWidth),isFinite(s.yMin)||(s.yMin=0),isFinite(s.yMax)||(s.yMax=0),s.rightSideBearing=this.advanceWidth-s.leftSideBearing-(s.xMax-s.xMin),s};K.prototype.draw=function(e,r,t,n,a){this.getPath(r,t,n,a).draw(e)};K.prototype.drawPoints=function(e,r,t,n){function a(p,c,h,d){e.beginPath();for(var g=0;g<p.length;g+=1)e.moveTo(c+p[g].x*d,h+p[g].y*d),e.arc(c+p[g].x*d,h+p[g].y*d,2,0,Math.PI*2,!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 s=1/this.path.unitsPerEm*n,i=[],u=[],o=this.path,l=0;l<o.commands.length;l+=1){var f=o.commands[l];f.x!==void 0&&i.push({x:f.x,y:-f.y}),f.x1!==void 0&&u.push({x:f.x1,y:-f.y1}),f.x2!==void 0&&u.push({x:f.x2,y:-f.y2})}e.fillStyle="blue",a(i,r,t,s),e.fillStyle="red",a(u,r,t,s)};K.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",Te.line(e,r,-1e4,r,1e4),Te.line(e,-1e4,t,1e4,t);var s=this.xMin||0,i=this.yMin||0,u=this.xMax||0,o=this.yMax||0,l=this.advanceWidth||0;e.strokeStyle="blue",Te.line(e,r+s*a,-1e4,r+s*a,1e4),Te.line(e,r+u*a,-1e4,r+u*a,1e4),Te.line(e,-1e4,t+-i*a,1e4,t+-i*a),Te.line(e,-1e4,t+-o*a,1e4,t+-o*a),e.strokeStyle="green",Te.line(e,r+l*a,-1e4,r+l*a,1e4)};function je(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){if(this.font=e,this.glyphs={},Array.isArray(r))for(var t=0;t<r.length;t++){var n=r[t];n.path.unitsPerEm=e.unitsPerEm,this.glyphs[t]=n}this.length=r&&r.length||0}_r.prototype.get=function(e){if(this.glyphs[e]===void 0){this.font._push(e),typeof this.glyphs[e]=="function"&&(this.glyphs[e]=this.glyphs[e]());var r=this.glyphs[e],t=this.font._IndexToUnicodeMap[e];if(t)for(var n=0;n<t.unicodes.length;n++)r.addUnicode(t.unicodes[n]);this.font.cffEncoding?this.font.isCIDFont?r.name="gid"+e:r.name=this.font.cffEncoding.charset[e]:this.font.glyphNames.names&&(r.name=this.font.glyphNames.glyphIndexToName(e)),this.glyphs[e].advanceWidth=this.font._hmtxTableData[e].advanceWidth,this.glyphs[e].leftSideBearing=this.font._hmtxTableData[e].leftSideBearing}else typeof this.glyphs[e]=="function"&&(this.glyphs[e]=this.glyphs[e]());return this.glyphs[e]};_r.prototype.push=function(e,r){this.glyphs[e]=r,this.length++};function Ea(e,r){return new K({index:r,font:e})}function Oa(e,r,t,n,a,s){return function(){var i=new K({index:r,font:e});return i.path=function(){t(i,n,a);var u=s(e.glyphs,i);return u.unitsPerEm=e.unitsPerEm,u},je(i,"xMin","_xMin"),je(i,"xMax","_xMax"),je(i,"yMin","_yMin"),je(i,"yMax","_yMax"),i}}function La(e,r,t,n){return function(){var a=new K({index:r,font:e});return a.path=function(){var s=t(e,a,n);return s.unitsPerEm=e.unitsPerEm,s},a}}var le={GlyphSet:_r,glyphLoader:Ea,ttfGlyphLoader:Oa,cffGlyphLoader:La};function jt(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(!jt(e[t],r[t]))return!1;return!0}else return!1}function Rr(e){var r;return e.length<1240?r=107:e.length<33900?r=1131:r=32768,r}function ye(e,r,t){var n=[],a=[],s=k.getCard16(e,r),i,u;if(s!==0){var o=k.getByte(e,r+2);i=r+(s+1)*o+2;for(var l=r+3,f=0;f<s+1;f+=1)n.push(k.getOffset(e,l,o)),l+=o;u=i+n[s]}else u=r+2;for(var p=0;p<n.length-1;p+=1){var c=k.getBytes(e,i+n[p],i+n[p+1]);t&&(c=t(c)),a.push(c)}return{objects:a,startOffset:r,endOffset:u}}function Ra(e,r){var t=[],n=k.getCard16(e,r),a,s;if(n!==0){var i=k.getByte(e,r+2);a=r+(n+1)*i+2;for(var u=r+3,o=0;o<n+1;o+=1)t.push(k.getOffset(e,u,i)),u+=i;s=a+t[n]}else s=r+2;return{offsets:t,startOffset:r,endOffset:s}}function Da(e,r,t,n,a){var s=k.getCard16(t,n),i=0;if(s!==0){var u=k.getByte(t,n+2);i=n+(s+1)*u+2}var o=k.getBytes(t,i+r[e],i+r[e+1]);return o}function Aa(e){for(var r="",t=15,n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var a=e.parseByte(),s=a>>4,i=a&15;if(s===t||(r+=n[s],i===t))break;r+=n[i]}return parseFloat(r)}function Ba(e,r){var t,n,a,s;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(),s=e.parseByte(),t<<24|n<<16|a<<8|s;if(r===30)return Aa(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 Ma(e){for(var r={},t=0;t<e.length;t+=1){var n=e[t][0],a=e[t][1],s=void 0;if(a.length===1?s=a[0]:s=a,r.hasOwnProperty(n)&&!isNaN(r[n]))throw new Error("Object "+r+" already has key "+n);r[n]=s}return r}function Jt(e,r,t){r=r!==void 0?r:0;var n=new k.Parser(e,r),a=[],s=[];for(t=t!==void 0?t:e.length;n.relativeOffset<t;){var i=n.parseByte();i<=21?(i===12&&(i=1200+n.parseByte()),a.push([i,s]),s=[]):s.push(Ba(n,i))}return Ma(a)}function Ne(e,r){return r<=390?r=er[r]:r=e[r-391],r}function en(e,r,t){for(var n={},a,s=0;s<r.length;s+=1){var i=r[s];if(Array.isArray(i.type)){var u=[];u.length=i.type.length;for(var o=0;o<i.type.length;o++)a=e[i.op]!==void 0?e[i.op][o]:void 0,a===void 0&&(a=i.value!==void 0&&i.value[o]!==void 0?i.value[o]:null),i.type[o]==="SID"&&(a=Ne(t,a)),u[o]=a;n[i.name]=u}else a=e[i.op],a===void 0&&(a=i.value!==void 0?i.value:null),i.type==="SID"&&(a=Ne(t,a)),n[i.name]=a}return n}function Ia(e,r){var t={};return t.formatMajor=k.getCard8(e,r),t.formatMinor=k.getCard8(e,r+1),t.size=k.getCard8(e,r+2),t.offsetSize=k.getCard8(e,r+3),t.startOffset=r,t.endOffset=r+4,t}var rn=[{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"}],tn=[{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 Pa(e,r){var t=Jt(e,0,e.byteLength);return en(t,rn,r)}function nn(e,r,t,n){var a=Jt(e,r,t);return en(a,tn,n)}function it(e,r,t,n){for(var a=[],s=0;s<t.length;s+=1){var i=new DataView(new Uint8Array(t[s]).buffer),u=Pa(i,n);u._subrs=[],u._subrsBias=0,u._defaultWidthX=0,u._nominalWidthX=0;var o=u.private[0],l=u.private[1];if(o!==0&&l!==0){var f=nn(e,l+r,o,n);if(u._defaultWidthX=f.defaultWidthX,u._nominalWidthX=f.nominalWidthX,f.subrs!==0){var p=l+f.subrs,c=ye(e,p+r);u._subrs=c.objects,u._subrsBias=Rr(u._subrs)}u._privateDict=f}a.push(u)}return a}function Ga(e,r,t,n){var a,s,i=new k.Parser(e,r);t-=1;var u=[".notdef"],o=i.parseCard8();if(o===0)for(var l=0;l<t;l+=1)a=i.parseSID(),u.push(Ne(n,a));else if(o===1)for(;u.length<=t;){a=i.parseSID(),s=i.parseCard8();for(var f=0;f<=s;f+=1)u.push(Ne(n,a)),a+=1}else if(o===2)for(;u.length<=t;){a=i.parseSID(),s=i.parseCard16();for(var p=0;p<=s;p+=1)u.push(Ne(n,a)),a+=1}else throw new Error("Unknown charset format "+o);return u}function Na(e,r,t){var n,a={},s=new k.Parser(e,r),i=s.parseCard8();if(i===0)for(var u=s.parseCard8(),o=0;o<u;o+=1)n=s.parseCard8(),a[n]=o;else if(i===1){var l=s.parseCard8();n=1;for(var f=0;f<l;f+=1)for(var p=s.parseCard8(),c=s.parseCard8(),h=p;h<=p+c;h+=1)a[h]=n,n+=1}else throw new Error("Unknown encoding format "+i);return new or(a,t)}function ot(e,r,t){var n,a,s,i,u=new q,o=[],l=0,f=!1,p=!1,c=0,h=0,d,g,m,y;if(e.isCIDFont){var F=e.tables.cff.topDict._fdSelect[r.index],x=e.tables.cff.topDict._fdArray[F];d=x._subrs,g=x._subrsBias,m=x._defaultWidthX,y=x._nominalWidthX}else d=e.tables.cff.topDict._subrs,g=e.tables.cff.topDict._subrsBias,m=e.tables.cff.topDict._defaultWidthX,y=e.tables.cff.topDict._nominalWidthX;var R=m;function w(U,O){p&&u.closePath(),u.moveTo(U,O),p=!0}function D(){var U;U=o.length%2!==0,U&&!f&&(R=o.shift()+y),l+=o.length>>1,o.length=0,f=!0}function C(U){for(var O,I,A,X,Q,G,W,Y,z,P,_,$,B=0;B<U.length;){var V=U[B];switch(B+=1,V){case 1:D();break;case 3:D();break;case 4:o.length>1&&!f&&(R=o.shift()+y,f=!0),h+=o.pop(),w(c,h);break;case 5:for(;o.length>0;)c+=o.shift(),h+=o.shift(),u.lineTo(c,h);break;case 6:for(;o.length>0&&(c+=o.shift(),u.lineTo(c,h),o.length!==0);)h+=o.shift(),u.lineTo(c,h);break;case 7:for(;o.length>0&&(h+=o.shift(),u.lineTo(c,h),o.length!==0);)c+=o.shift(),u.lineTo(c,h);break;case 8:for(;o.length>0;)n=c+o.shift(),a=h+o.shift(),s=n+o.shift(),i=a+o.shift(),c=s+o.shift(),h=i+o.shift(),u.curveTo(n,a,s,i,c,h);break;case 10:Q=o.pop()+g,G=d[Q],G&&C(G);break;case 11:return;case 12:switch(V=U[B],B+=1,V){case 35:n=c+o.shift(),a=h+o.shift(),s=n+o.shift(),i=a+o.shift(),W=s+o.shift(),Y=i+o.shift(),z=W+o.shift(),P=Y+o.shift(),_=z+o.shift(),$=P+o.shift(),c=_+o.shift(),h=$+o.shift(),o.shift(),u.curveTo(n,a,s,i,W,Y),u.curveTo(z,P,_,$,c,h);break;case 34:n=c+o.shift(),a=h,s=n+o.shift(),i=a+o.shift(),W=s+o.shift(),Y=i,z=W+o.shift(),P=i,_=z+o.shift(),$=h,c=_+o.shift(),u.curveTo(n,a,s,i,W,Y),u.curveTo(z,P,_,$,c,h);break;case 36:n=c+o.shift(),a=h+o.shift(),s=n+o.shift(),i=a+o.shift(),W=s+o.shift(),Y=i,z=W+o.shift(),P=i,_=z+o.shift(),$=P+o.shift(),c=_+o.shift(),u.curveTo(n,a,s,i,W,Y),u.curveTo(z,P,_,$,c,h);break;case 37:n=c+o.shift(),a=h+o.shift(),s=n+o.shift(),i=a+o.shift(),W=s+o.shift(),Y=i+o.shift(),z=W+o.shift(),P=Y+o.shift(),_=z+o.shift(),$=P+o.shift(),Math.abs(_-c)>Math.abs($-h)?c=_+o.shift():h=$+o.shift(),u.curveTo(n,a,s,i,W,Y),u.curveTo(z,P,_,$,c,h);break;default:console.log("Glyph "+r.index+": unknown operator 1200"+V),o.length=0}break;case 14:o.length>0&&!f&&(R=o.shift()+y,f=!0),p&&(u.closePath(),p=!1);break;case 18:D();break;case 19:case 20:D(),B+=l+7>>3;break;case 21:o.length>2&&!f&&(R=o.shift()+y,f=!0),h+=o.pop(),c+=o.pop(),w(c,h);break;case 22:o.length>1&&!f&&(R=o.shift()+y,f=!0),c+=o.pop(),w(c,h);break;case 23:D();break;case 24:for(;o.length>2;)n=c+o.shift(),a=h+o.shift(),s=n+o.shift(),i=a+o.shift(),c=s+o.shift(),h=i+o.shift(),u.curveTo(n,a,s,i,c,h);c+=o.shift(),h+=o.shift(),u.lineTo(c,h);break;case 25:for(;o.length>6;)c+=o.shift(),h+=o.shift(),u.lineTo(c,h);n=c+o.shift(),a=h+o.shift(),s=n+o.shift(),i=a+o.shift(),c=s+o.shift(),h=i+o.shift(),u.curveTo(n,a,s,i,c,h);break;case 26:for(o.length%2&&(c+=o.shift());o.length>0;)n=c,a=h+o.shift(),s=n+o.shift(),i=a+o.shift(),c=s,h=i+o.shift(),u.curveTo(n,a,s,i,c,h);break;case 27:for(o.length%2&&(h+=o.shift());o.length>0;)n=c+o.shift(),a=h,s=n+o.shift(),i=a+o.shift(),c=s+o.shift(),h=i,u.curveTo(n,a,s,i,c,h);break;case 28:O=U[B],I=U[B+1],o.push((O<<24|I<<16)>>16),B+=2;break;case 29:Q=o.pop()+e.gsubrsBias,G=e.gsubrs[Q],G&&C(G);break;case 30:for(;o.length>0&&(n=c,a=h+o.shift(),s=n+o.shift(),i=a+o.shift(),c=s+o.shift(),h=i+(o.length===1?o.shift():0),u.curveTo(n,a,s,i,c,h),o.length!==0);)n=c+o.shift(),a=h,s=n+o.shift(),i=a+o.shift(),h=i+o.shift(),c=s+(o.length===1?o.shift():0),u.curveTo(n,a,s,i,c,h);break;case 31:for(;o.length>0&&(n=c+o.shift(),a=h,s=n+o.shift(),i=a+o.shift(),h=i+o.shift(),c=s+(o.length===1?o.shift():0),u.curveTo(n,a,s,i,c,h),o.length!==0);)n=c,a=h+o.shift(),s=n+o.shift(),i=a+o.shift(),c=s+o.shift(),h=i+(o.length===1?o.shift():0),u.curveTo(n,a,s,i,c,h);break;default:V<32?console.log("Glyph "+r.index+": unknown operator "+V):V<247?o.push(V-139):V<251?(O=U[B],B+=1,o.push((V-247)*256+O+108)):V<255?(O=U[B],B+=1,o.push(-(V-251)*256-O-108)):(O=U[B],I=U[B+1],A=U[B+2],X=U[B+3],B+=4,o.push((O<<24|I<<16|A<<8|X)/65536))}}}return C(t),r.advanceWidth=R,u}function Ha(e,r,t,n){var a=[],s,i=new k.Parser(e,r),u=i.parseCard8();if(u===0)for(var o=0;o<t;o++){if(s=i.parseCard8(),s>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+s+" (FD count "+n+")");a.push(s)}else if(u===3){var l=i.parseCard16(),f=i.parseCard16();if(f!==0)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+f);for(var p,c=0;c<l;c++){if(s=i.parseCard8(),p=i.parseCard16(),s>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+s+" (FD count "+n+")");if(p>t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+p);for(;f<p;f++)a.push(s);f=p}if(p!==t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+p)}else throw new Error("CFF Table CID Font FDSelect table has unsupported format "+u);return a}function Wa(e,r,t,n){t.tables.cff={};var a=Ia(e,r),s=ye(e,a.endOffset,k.bytesToString),i=ye(e,s.endOffset),u=ye(e,i.endOffset,k.bytesToString),o=ye(e,u.endOffset);t.gsubrs=o.objects,t.gsubrsBias=Rr(t.gsubrs);var l=it(e,r,i.objects,u.objects);if(l.length!==1)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+l.length);var f=l[0];if(t.tables.cff.topDict=f,f._privateDict&&(t.defaultWidthX=f._privateDict.defaultWidthX,t.nominalWidthX=f._privateDict.nominalWidthX),f.ros[0]!==void 0&&f.ros[1]!==void 0&&(t.isCIDFont=!0),t.isCIDFont){var p=f.fdArray,c=f.fdSelect;if(p===0||c===0)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");p+=r;var h=ye(e,p),d=it(e,r,h.objects,u.objects);f._fdArray=d,c+=r,f._fdSelect=Ha(e,c,t.numGlyphs,d.length)}var g=r+f.private[1],m=nn(e,g,f.private[0],u.objects);if(t.defaultWidthX=m.defaultWidthX,t.nominalWidthX=m.nominalWidthX,m.subrs!==0){var y=g+m.subrs,F=ye(e,y);t.subrs=F.objects,t.subrsBias=Rr(t.subrs)}else t.subrs=[],t.subrsBias=0;var x;n.lowMemory?(x=Ra(e,r+f.charStrings),t.nGlyphs=x.offsets.length):(x=ye(e,r+f.charStrings),t.nGlyphs=x.objects.length);var R=Ga(e,r+f.charset,t.nGlyphs,u.objects);if(f.encoding===0?t.cffEncoding=new or(Sa,R):f.encoding===1?t.cffEncoding=new or(Ta,R):t.cffEncoding=Na(e,r+f.encoding,R),t.encoding=t.encoding||t.cffEncoding,t.glyphs=new le.GlyphSet(t),n.lowMemory)t._push=function(C){var U=Da(C,x.offsets,e,r+f.charStrings);t.glyphs.push(C,le.cffGlyphLoader(t,C,ot,U))};else for(var w=0;w<t.nGlyphs;w+=1){var D=x.objects[w];t.glyphs.push(w,le.cffGlyphLoader(t,w,ot,D))}}function an(e,r){var t,n=er.indexOf(e);return n>=0&&(t=n),n=r.indexOf(e),n>=0?t=n+er.length:(t=er.length+r.length,r.push(e)),t}function za(){return new S.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 S.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 sn(e,r,t){for(var n={},a=0;a<e.length;a+=1){var s=e[a],i=r[s.name];i!==void 0&&!jt(i,s.value)&&(s.type==="SID"&&(i=an(i,t)),n[s.op]={name:s.name,type:s.type,value:i})}return n}function ut(e,r){var t=new S.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return t.dict=sn(rn,e,r),t}function lt(e){var r=new S.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return r.topDicts=[{name:"topDict_0",type:"TABLE",value:e}],r}function Va(e){var r=new S.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 qa(){return new S.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}])}function Xa(e,r){for(var t=new S.Record("Charsets",[{name:"format",type:"Card8",value:0}]),n=0;n<e.length;n+=1){var a=e[n],s=an(a,r);t.fields.push({name:"glyph_"+n,type:"SID",value:s})}return t}function Ya(e){var r=[],t=e.path;r.push({name:"width",type:"NUMBER",value:e.advanceWidth});for(var n=0,a=0,s=0;s<t.commands.length;s+=1){var i=void 0,u=void 0,o=t.commands[s];if(o.type==="Q"){var l=.3333333333333333,f=2/3;o={type:"C",x:o.x,y:o.y,x1:Math.round(l*n+f*o.x1),y1:Math.round(l*a+f*o.y1),x2:Math.round(l*o.x+f*o.x1),y2:Math.round(l*o.y+f*o.y1)}}if(o.type==="M")i=Math.round(o.x-n),u=Math.round(o.y-a),r.push({name:"dx",type:"NUMBER",value:i}),r.push({name:"dy",type:"NUMBER",value:u}),r.push({name:"rmoveto",type:"OP",value:21}),n=Math.round(o.x),a=Math.round(o.y);else if(o.type==="L")i=Math.round(o.x-n),u=Math.round(o.y-a),r.push({name:"dx",type:"NUMBER",value:i}),r.push({name:"dy",type:"NUMBER",value:u}),r.push({name:"rlineto",type:"OP",value:5}),n=Math.round(o.x),a=Math.round(o.y);else if(o.type==="C"){var p=Math.round(o.x1-n),c=Math.round(o.y1-a),h=Math.round(o.x2-o.x1),d=Math.round(o.y2-o.y1);i=Math.round(o.x-o.x2),u=Math.round(o.y-o.y2),r.push({name:"dx1",type:"NUMBER",value:p}),r.push({name:"dy1",type:"NUMBER",value:c}),r.push({name:"dx2",type:"NUMBER",value:h}),r.push({name:"dy2",type:"NUMBER",value:d}),r.push({name:"dx",type:"NUMBER",value:i}),r.push({name:"dy",type:"NUMBER",value:u}),r.push({name:"rrcurveto",type:"OP",value:8}),n=Math.round(o.x),a=Math.round(o.y)}}return r.push({name:"endchar",type:"OP",value:14}),r}function $a(e){for(var r=new S.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]),t=0;t<e.length;t+=1){var n=e.get(t),a=Ya(n);r.charStrings.push({name:n.name,type:"CHARSTRING",value:a})}return r}function Za(e,r){var t=new S.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return t.dict=sn(tn,e,r),t}function Qa(e,r){for(var t=new S.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]},s={},i=[],u,o=1;o<e.length;o+=1)u=e.get(o),i.push(u.name);var l=[];t.header=za(),t.nameIndex=_a([r.postScriptName]);var f=ut(a,l);t.topDictIndex=lt(f),t.globalSubrIndex=qa(),t.charsets=Xa(i,l),t.charStringsIndex=$a(e),t.privateDict=Za(s,l),t.stringIndex=Va(l);var p=t.header.sizeOf()+t.nameIndex.sizeOf()+t.topDictIndex.sizeOf()+t.stringIndex.sizeOf()+t.globalSubrIndex.sizeOf();return a.charset=p,a.encoding=0,a.charStrings=a.charset+t.charsets.sizeOf(),a.private[1]=a.charStrings+t.charStringsIndex.sizeOf(),f=ut(a,l),t.topDictIndex=lt(f),t}var on={parse:Wa,make:Qa};function Ka(e,r){var t={},n=new k.Parser(e,r);return t.version=n.parseVersion(),t.fontRevision=Math.round(n.parseFixed()*1e3)/1e3,t.checkSumAdjustment=n.parseULong(),t.magicNumber=n.parseULong(),E.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 ja(e){var r=Math.round(new Date().getTime()/1e3)+2082844800,t=r;return e.createdTimestamp&&(t=e.createdTimestamp+2082844800),new S.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 un={parse:Ka,make:ja};function Ja(e,r){var t={},n=new k.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 es(e){return new S.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 ln={parse:Ja,make:es};function rs(e,r,t,n,a){for(var s,i,u=new k.Parser(e,r),o=0;o<n;o+=1){o<t&&(s=u.parseUShort(),i=u.parseShort());var l=a.get(o);l.advanceWidth=s,l.leftSideBearing=i}}function ts(e,r,t,n,a){e._hmtxTableData={};for(var s,i,u=new k.Parser(r,t),o=0;o<a;o+=1)o<n&&(s=u.parseUShort(),i=u.parseShort()),e._hmtxTableData[o]={advanceWidth:s,leftSideBearing:i}}function ns(e,r,t,n,a,s,i){i.lowMemory?ts(e,r,t,n,a):rs(r,t,n,a,s)}function as(e){for(var r=new S.Table("hmtx",[]),t=0;t<e.length;t+=1){var n=e.get(t),a=n.advanceWidth||0,s=n.leftSideBearing||0;r.fields.push({name:"advanceWidth_"+t,type:"USHORT",value:a}),r.fields.push({name:"leftSideBearing_"+t,type:"SHORT",value:s})}return r}var fn={parse:ns,make:as};function ss(e){for(var r=new S.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 s=t.indexOf(e[a]);s<0&&(s=t.length,t+=e[a]),r.fields.push({name:"offset "+a,type:"USHORT",value:n+s}),r.fields.push({name:"length "+a,type:"USHORT",value:e[a].length})}return r.fields.push({name:"stringPool",type:"CHARARRAY",value:t}),r}function is(e,r){var t=new k.Parser(e,r),n=t.parseULong();E.argument(n===1,"Unsupported ltag table version."),t.skip("uLong",1);for(var a=t.parseULong(),s=[],i=0;i<a;i++){for(var u="",o=r+t.parseUShort(),l=t.parseUShort(),f=o;f<o+l;++f)u+=String.fromCharCode(e.getInt8(f));s.push(u)}return s}var cn={make:ss,parse:is};function os(e,r){var t={},n=new k.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 us(e){return new S.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:e}])}var pn={parse:os,make:us},hn=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],vn={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"},ls={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},dn={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 fs(e,r,t){switch(e){case 0:if(r===65535)return"und";if(t)return t[r];break;case 1:return vn[r];case 3:return dn[r]}}var Dr="utf-16",cs={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"},ps={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 gn(e,r,t){switch(e){case 0:return Dr;case 1:return ps[t]||cs[r];case 3:if(r===1||r===10)return Dr;break}}function hs(e,r,t){for(var n={},a=new k.Parser(e,r),s=a.parseUShort(),i=a.parseUShort(),u=a.offset+a.parseUShort(),o=0;o<i;o++){var l=a.parseUShort(),f=a.parseUShort(),p=a.parseUShort(),c=a.parseUShort(),h=hn[c]||c,d=a.parseUShort(),g=a.parseUShort(),m=fs(l,p,t),y=gn(l,f,p);if(y!==void 0&&m!==void 0){var F=void 0;if(y===Dr?F=Oe.UTF16(e,u+g,d):F=Oe.MACSTRING(e,u+g,d,y),F){var x=n[h];x===void 0&&(x=n[h]={}),x[m]=F}}}return s===1&&a.parseUShort(),n}function gr(e){var r={};for(var t in e)r[e[t]]=parseInt(t);return r}function ft(e,r,t,n,a,s){return new S.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:s}])}function vs(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 s=0;s<t;s++)if(r[a+s]!==e[s])continue e;return a}return-1}function ct(e,r){var t=vs(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 ds(e,r){var t,n=[],a={},s=gr(hn);for(var i in e){var u=s[i];if(u===void 0&&(u=i),t=parseInt(u),isNaN(t))throw new Error('Name table entry "'+i+'" does not exist, see nameTableNames for complete list.');a[t]=e[i],n.push(t)}for(var o=gr(vn),l=gr(dn),f=[],p=[],c=0;c<n.length;c++){t=n[c];var h=a[t];for(var d in h){var g=h[d],m=1,y=o[d],F=ls[y],x=gn(m,F,y),R=b.MACSTRING(g,x);R===void 0&&(m=0,y=r.indexOf(d),y<0&&(y=r.length,r.push(d)),F=4,R=b.UTF16(g));var w=ct(R,p);f.push(ft(m,F,y,t,R.length,w));var D=l[d];if(D!==void 0){var C=b.UTF16(g),U=ct(C,p);f.push(ft(3,1,D,t,C.length,U))}}}f.sort(function(A,X){return A.platformID-X.platformID||A.encodingID-X.encodingID||A.languageID-X.languageID||A.nameID-X.nameID});for(var O=new S.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:f.length},{name:"stringOffset",type:"USHORT",value:6+f.length*12}]),I=0;I<f.length;I++)O.fields.push({name:"record_"+I,type:"RECORD",value:f[I]});return O.fields.push({name:"strings",type:"LITERAL",value:p}),O}var mn={parse:hs,make:ds},Ar=[{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 gs(e){for(var r=0;r<Ar.length;r+=1){var t=Ar[r];if(e>=t.begin&&e<t.end)return r}return-1}function ms(e,r){var t={},n=new k.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 ys(e){return new S.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 Br={parse:ms,make:ys,unicodeRanges:Ar,getUnicodeRange:gs};function xs(e,r){var t={},n=new k.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=ke.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 s=0;s<t.numberOfGlyphs;s++)if(t.glyphNameIndex[s]>=ke.length){var i=n.parseChar();t.names.push(n.parseString(i))}break;case 2.5:t.numberOfGlyphs=n.parseUShort(),t.offset=new Array(t.numberOfGlyphs);for(var u=0;u<t.numberOfGlyphs;u++)t.offset[u]=n.parseChar();break}return t}function bs(){return new S.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 yn={parse:xs,make:bs},ee=new Array(9);ee[1]=function(){var r=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(v.coverage),deltaGlyphId:this.parseUShort()};if(t===2)return{substFormat:2,coverage:this.parsePointer(v.coverage),substitute:this.parseOffset16List()};E.assert(!1,"0x"+r.toString(16)+": lookup type 1 format must be 1 or 2.")};ee[2]=function(){var r=this.parseUShort();return E.argument(r===1,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:r,coverage:this.parsePointer(v.coverage),sequences:this.parseListOfLists()}};ee[3]=function(){var r=this.parseUShort();return E.argument(r===1,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:r,coverage:this.parsePointer(v.coverage),alternateSets:this.parseListOfLists()}};ee[4]=function(){var r=this.parseUShort();return E.argument(r===1,"GSUB ligature table identifier-format must be 1"),{substFormat:r,coverage:this.parsePointer(v.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};var Ee={sequenceIndex:v.uShort,lookupListIndex:v.uShort};ee[5]=function(){var r=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:t,coverage:this.parsePointer(v.coverage),ruleSets:this.parseListOfLists(function(){var s=this.parseUShort(),i=this.parseUShort();return{input:this.parseUShortList(s-1),lookupRecords:this.parseRecordList(i,Ee)}})};if(t===2)return{substFormat:t,coverage:this.parsePointer(v.coverage),classDef:this.parsePointer(v.classDef),classSets:this.parseListOfLists(function(){var s=this.parseUShort(),i=this.parseUShort();return{classes:this.parseUShortList(s-1),lookupRecords:this.parseRecordList(i,Ee)}})};if(t===3){var n=this.parseUShort(),a=this.parseUShort();return{substFormat:t,coverages:this.parseList(n,v.pointer(v.coverage)),lookupRecords:this.parseRecordList(a,Ee)}}E.assert(!1,"0x"+r.toString(16)+": lookup type 5 format must be 1, 2 or 3.")};ee[6]=function(){var r=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(v.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Ee)}})};if(t===2)return{substFormat:2,coverage:this.parsePointer(v.coverage),backtrackClassDef:this.parsePointer(v.classDef),inputClassDef:this.parsePointer(v.classDef),lookaheadClassDef:this.parsePointer(v.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Ee)}})};if(t===3)return{substFormat:3,backtrackCoverage:this.parseList(v.pointer(v.coverage)),inputCoverage:this.parseList(v.pointer(v.coverage)),lookaheadCoverage:this.parseList(v.pointer(v.coverage)),lookupRecords:this.parseRecordList(Ee)};E.assert(!1,"0x"+r.toString(16)+": lookup type 6 format must be 1, 2 or 3.")};ee[7]=function(){var r=this.parseUShort();E.argument(r===1,"GSUB Extension Substitution subtable identifier-format must be 1");var t=this.parseUShort(),n=new v(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:ee[t].call(n)}};ee[8]=function(){var r=this.parseUShort();return E.argument(r===1,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:r,coverage:this.parsePointer(v.coverage),backtrackCoverage:this.parseList(v.pointer(v.coverage)),lookaheadCoverage:this.parseList(v.pointer(v.coverage)),substitutes:this.parseUShortList()}};function Ss(e,r){r=r||0;var t=new v(e,r),n=t.parseVersion(1);return E.argument(n===1||n===1.1,"Unsupported GSUB table version."),n===1?{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(ee)}:{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(ee),variations:t.parseFeatureVariationsList()}}var Le=new Array(9);Le[1]=function(r){return r.substFormat===1?new S.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new S.Coverage(r.coverage)},{name:"deltaGlyphID",type:"USHORT",value:r.deltaGlyphId}]):new S.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new S.Coverage(r.coverage)}].concat(S.ushortList("substitute",r.substitute)))};Le[2]=function(r){return E.assert(r.substFormat===1,"Lookup type 2 substFormat must be 1."),new S.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new S.Coverage(r.coverage)}].concat(S.tableList("seqSet",r.sequences,function(t){return new S.Table("sequenceSetTable",S.ushortList("sequence",t))})))};Le[3]=function(r){return E.assert(r.substFormat===1,"Lookup type 3 substFormat must be 1."),new S.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new S.Coverage(r.coverage)}].concat(S.tableList("altSet",r.alternateSets,function(t){return new S.Table("alternateSetTable",S.ushortList("alternate",t))})))};Le[4]=function(r){return E.assert(r.substFormat===1,"Lookup type 4 substFormat must be 1."),new S.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new S.Coverage(r.coverage)}].concat(S.tableList("ligSet",r.ligatureSets,function(t){return new S.Table("ligatureSetTable",S.tableList("ligature",t,function(n){return new S.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:n.ligGlyph}].concat(S.ushortList("component",n.components,n.components.length+1)))}))})))};Le[6]=function(r){if(r.substFormat===1){var t=new S.Table("chainContextTable",[{name:"substFormat",type:"USHORT",value:r.substFormat},{name:"coverage",type:"TABLE",value:new S.Coverage(r.coverage)}].concat(S.tableList("chainRuleSet",r.chainRuleSets,function(s){return new S.Table("chainRuleSetTable",S.tableList("chainRule",s,function(i){var u=S.ushortList("backtrackGlyph",i.backtrack,i.backtrack.length).concat(S.ushortList("inputGlyph",i.input,i.input.length+1)).concat(S.ushortList("lookaheadGlyph",i.lookahead,i.lookahead.length)).concat(S.ushortList("substitution",[],i.lookupRecords.length));return i.lookupRecords.forEach(function(o,l){u=u.concat({name:"sequenceIndex"+l,type:"USHORT",value:o.sequenceIndex}).concat({name:"lookupListIndex"+l,type:"USHORT",value:o.lookupListIndex})}),new S.Table("chainRuleTable",u)}))})));return t}else if(r.substFormat===2)E.assert(!1,"lookup type 6 format 2 is not yet supported.");else if(r.substFormat===3){var n=[{name:"substFormat",type:"USHORT",value:r.substFormat}];n.push({name:"backtrackGlyphCount",type:"USHORT",value:r.backtrackCoverage.length}),r.backtrackCoverage.forEach(function(s,i){n.push({name:"backtrackCoverage"+i,type:"TABLE",value:new S.Coverage(s)})}),n.push({name:"inputGlyphCount",type:"USHORT",value:r.inputCoverage.length}),r.inputCoverage.forEach(function(s,i){n.push({name:"inputCoverage"+i,type:"TABLE",value:new S.Coverage(s)})}),n.push({name:"lookaheadGlyphCount",type:"USHORT",value:r.lookaheadCoverage.length}),r.lookaheadCoverage.forEach(function(s,i){n.push({name:"lookaheadCoverage"+i,type:"TABLE",value:new S.Coverage(s)})}),n.push({name:"substitutionCount",type:"USHORT",value:r.lookupRecords.length}),r.lookupRecords.forEach(function(s,i){n=n.concat({name:"sequenceIndex"+i,type:"USHORT",value:s.sequenceIndex}).concat({name:"lookupListIndex"+i,type:"USHORT",value:s.lookupListIndex})});var a=new S.Table("chainContextTable",n);return a}E.assert(!1,"lookup type 6 format must be 1, 2 or 3.")};function Ts(e){return new S.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new S.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new S.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new S.LookupList(e.lookups,Le)}])}var xn={parse:Ss,make:Ts};function ks(e,r){var t=new k.Parser(e,r),n=t.parseULong();E.argument(n===1,"Unsupported META table version."),t.parseULong(),t.parseULong();for(var a=t.parseULong(),s={},i=0;i<a;i++){var u=t.parseTag(),o=t.parseULong(),l=t.parseULong(),f=Oe.UTF8(e,r+o,l);s[u]=f}return s}function Fs(e){var r=Object.keys(e).length,t="",n=16+r*12,a=new S.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 s in e){var i=t.length;t+=e[s],a.fields.push({name:"tag "+s,type:"TAG",value:s}),a.fields.push({name:"offset "+s,type:"ULONG",value:n+i}),a.fields.push({name:"length "+s,type:"ULONG",value:e[s].length})}return a.fields.push({name:"stringPool",type:"CHARARRAY",value:t}),a}var bn={parse:ks,make:Fs};function pt(e){return Math.log(e)/Math.log(2)|0}function Vr(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 ht(e,r,t,n){return new S.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 Sn(e){var r=new S.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,pt(r.numTables));r.searchRange=16*t,r.entrySelector=pt(t),r.rangeShift=r.numTables*16-r.searchRange;for(var n=[],a=[],s=r.sizeOf()+ht().sizeOf()*r.numTables;s%4!==0;)s+=1,a.push({name:"padding",type:"BYTE",value:0});for(var i=0;i<e.length;i+=1){var u=e[i];E.argument(u.tableName.length===4,"Table name"+u.tableName+" is invalid.");var o=u.sizeOf(),l=ht(u.tableName,Vr(u.encode()),s,o);for(n.push({name:l.tag+" Table Record",type:"RECORD",value:l}),a.push({name:u.tableName+" table",type:"RECORD",value:u}),s+=o,E.argument(!isNaN(s),"Something went wrong calculating the offset.");s%4!==0;)s+=1,a.push({name:"padding",type:"BYTE",value:0})}return n.sort(function(f,p){return f.value.tag>p.value.tag?1:-1}),r.fields=r.fields.concat(n),r.fields=r.fields.concat(a),r}function vt(e,r,t){for(var n=0;n<r.length;n+=1){var a=e.charToGlyphIndex(r[n]);if(a>0){var s=e.glyphs.get(a);return s.getMetrics()}}return t}function Us(e){for(var r=0,t=0;t<e.length;t+=1)r+=e[t];return r/e.length}function Cs(e){for(var r=[],t=[],n=[],a=[],s=[],i=[],u=[],o,l=0,f=0,p=0,c=0,h=0,d=0;d<e.glyphs.length;d+=1){var g=e.glyphs.get(d),m=g.unicode|0;if(isNaN(g.advanceWidth))throw new Error("Glyph "+g.name+" ("+d+"): advanceWidth is not a number.");(o>m||o===void 0)&&m>0&&(o=m),l<m&&(l=m);var y=Br.getUnicodeRange(m);if(y<32)f|=1<<y;else if(y<64)p|=1<<y-32;else if(y<96)c|=1<<y-64;else if(y<123)h|=1<<y-96;else throw new Error("Unicode ranges bits > 123 are reserved for internal usage");if(g.name!==".notdef"){var F=g.getMetrics();r.push(F.xMin),t.push(F.yMin),n.push(F.xMax),a.push(F.yMax),i.push(F.leftSideBearing),u.push(F.rightSideBearing),s.push(g.advanceWidth)}}var x={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,s),advanceWidthAvg:Us(s),minLeftSideBearing:Math.min.apply(null,i),maxLeftSideBearing:Math.max.apply(null,i),minRightSideBearing:Math.min.apply(null,u)};x.ascender=e.ascender,x.descender=e.descender;var R=un.make({flags:3,unitsPerEm:e.unitsPerEm,xMin:x.xMin,yMin:x.yMin,xMax:x.xMax,yMax:x.yMax,lowestRecPPEM:3,createdTimestamp:e.createdTimestamp}),w=ln.make({ascender:x.ascender,descender:x.descender,advanceWidthMax:x.advanceWidthMax,minLeftSideBearing:x.minLeftSideBearing,minRightSideBearing:x.minRightSideBearing,xMaxExtent:x.maxLeftSideBearing+(x.xMax-x.xMin),numberOfHMetrics:e.glyphs.length}),D=pn.make(e.glyphs.length),C=Br.make(Object.assign({xAvgCharWidth:Math.round(x.advanceWidthAvg),usFirstCharIndex:o,usLastCharIndex:l,ulUnicodeRange1:f,ulUnicodeRange2:p,ulUnicodeRange3:c,ulUnicodeRange4:h,sTypoAscender:x.ascender,sTypoDescender:x.descender,sTypoLineGap:0,usWinAscent:x.yMax,usWinDescent:Math.abs(x.yMin),ulCodePageRange1:1,sxHeight:vt(e,"xyvw",{yMax:Math.round(x.ascender/2)}).yMax,sCapHeight:vt(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",x).yMax,usDefaultChar:e.hasChar(" ")?32:0,usBreakChar:e.hasChar(" ")?32:0},e.tables.os2)),U=fn.make(e.glyphs),O=Zt.make(e.glyphs),I=e.getEnglishName("fontFamily"),A=e.getEnglishName("fontSubfamily"),X=I+" "+A,Q=e.getEnglishName("postScriptName");Q||(Q=I.replace(/\s/g,"")+"-"+A);var G={};for(var W in e.names)G[W]=e.names[W];G.uniqueID||(G.uniqueID={en:e.getEnglishName("manufacturer")+":"+X}),G.postScriptName||(G.postScriptName={en:Q}),G.preferredFamily||(G.preferredFamily=e.names.fontFamily),G.preferredSubfamily||(G.preferredSubfamily=e.names.fontSubfamily);var Y=[],z=mn.make(G,Y),P=Y.length>0?cn.make(Y):void 0,_=yn.make(),$=on.make(e.glyphs,{version:e.getEnglishName("version"),fullName:X,familyName:I,weightName:A,postScriptName:Q,unitsPerEm:e.unitsPerEm,fontBBox:[0,x.yMin,x.ascender,x.advanceWidthMax]}),B=e.metas&&Object.keys(e.metas).length>0?bn.make(e.metas):void 0,V=[R,w,D,C,z,O,_,$,U];P&&V.push(P),e.tables.gsub&&V.push(xn.make(e.tables.gsub)),B&&V.push(B);for(var Ae=Sn(V),pr=Ae.encode(),Be=Vr(pr),Me=Ae.fields,Ie=!1,Ce=0;Ce<Me.length;Ce+=1)if(Me[Ce].name==="head table"){Me[Ce].value.checkSumAdjustment=2981146554-Be,Ie=!0;break}if(!Ie)throw new Error("Could not find head table with checkSum to adjust.");return Ae}var ws={make:Sn,fontToTable:Cs,computeCheckSum:Vr};function mr(e,r){for(var t=0,n=e.length-1;t<=n;){var a=t+n>>>1,s=e[a].tag;if(s===r)return a;s<r?t=a+1:n=a-1}return-t-1}function dt(e,r){for(var t=0,n=e.length-1;t<=n;){var a=t+n>>>1,s=e[a];if(s===r)return a;s<r?t=a+1:n=a-1}return-t-1}function gt(e,r){for(var t,n=0,a=e.length-1;n<=a;){var s=n+a>>>1;t=e[s];var i=t.start;if(i===r)return t;i<r?n=s+1:a=s-1}if(n>0)return t=e[n-1],r>t.end?0:t}function Ve(e,r){this.font=e,this.tableName=r}Ve.prototype={searchTag:mr,binSearch:dt,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=mr(t.scripts,e);if(a>=0)return n[a].script;if(r){var s={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return n.splice(-1-a,0,s),s.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=mr(n.langSysRecords,r);if(a>=0)return n.langSysRecords[a].langSys;if(t){var s={tag:r,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return n.langSysRecords.splice(-1-a,0,s),s.langSys}}},getFeatureTable:function(e,r,t,n){var a=this.getLangSysTable(e,r,n);if(a){for(var s,i=a.featureIndexes,u=this.font.tables[this.tableName].features,o=0;o<i.length;o++)if(s=u[i[o]],s.tag===t)return s.feature;if(n){var l=u.length;return E.assert(l===0||t>=u[l-1].tag,"Features must be added in alphabetical order."),s={tag:t,feature:{params:0,lookupListIndexes:[]}},u.push(s),i.push(l),s.feature}}},getLookupTables:function(e,r,t,n,a){var s=this.getFeatureTable(e,r,t,a),i=[];if(s){for(var u,o=s.lookupListIndexes,l=this.font.tables[this.tableName].lookups,f=0;f<o.length;f++)u=l[o[f]],u.lookupType===n&&i.push(u);if(i.length===0&&a){u={lookupType:n,lookupFlag:0,subtables:[],markFilteringSet:void 0};var p=l.length;return l.push(u),o.push(p),[u]}}return i},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=gt(e.ranges,r);return t?t.classId:0}},getCoverageIndex:function(e,r){switch(e.format){case 1:var t=dt(e.glyphs,r);return t>=0?t:-1;case 2:var n=gt(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],s=a.start,i=a.end,u=s;u<=i;u++)r.push(u);return r}};function qe(e){Ve.call(this,e,"gpos")}qe.prototype=Ve.prototype;qe.prototype.init=function(){var e=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(e)};qe.prototype.getKerningValue=function(e,r,t){for(var n=0;n<e.length;n++)for(var a=e[n].subtables,s=0;s<a.length;s++){var i=a[s],u=this.getCoverageIndex(i.coverage,r);if(!(u<0))switch(i.posFormat){case 1:for(var o=i.pairSets[u],l=0;l<o.length;l++){var f=o[l];if(f.secondGlyph===t)return f.value1&&f.value1.xAdvance||0}break;case 2:var p=this.getGlyphClass(i.classDef1,r),c=this.getGlyphClass(i.classDef2,t),h=i.classRecords[p][c];return h.value1&&h.value1.xAdvance||0}}return 0};qe.prototype.getKerningTables=function(e,r){if(this.font.tables.gpos)return this.getLookupTables(e,r,"kern",2)};function j(e){Ve.call(this,e,"gsub")}function Es(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 qr(e,r,t){for(var n=e.subtables,a=0;a<n.length;a++){var s=n[a];if(s.substFormat===r)return s}if(t)return n.push(t),t}j.prototype=Ve.prototype;j.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}};j.prototype.getSingle=function(e,r,t){for(var n=[],a=this.getLookupTables(r,t,e,1),s=0;s<a.length;s++)for(var i=a[s].subtables,u=0;u<i.length;u++){var o=i[u],l=this.expandCoverage(o.coverage),f=void 0;if(o.substFormat===1){var p=o.deltaGlyphId;for(f=0;f<l.length;f++){var c=l[f];n.push({sub:c,by:c+p})}}else{var h=o.substitute;for(f=0;f<l.length;f++)n.push({sub:l[f],by:h[f]})}}return n};j.prototype.getMultiple=function(e,r,t){for(var n=[],a=this.getLookupTables(r,t,e,2),s=0;s<a.length;s++)for(var i=a[s].subtables,u=0;u<i.length;u++){var o=i[u],l=this.expandCoverage(o.coverage),f=void 0;for(f=0;f<l.length;f++){var p=l[f],c=o.sequences[f];n.push({sub:p,by:c})}}return n};j.prototype.getAlternates=function(e,r,t){for(var n=[],a=this.getLookupTables(r,t,e,3),s=0;s<a.length;s++)for(var i=a[s].subtables,u=0;u<i.length;u++)for(var o=i[u],l=this.expandCoverage(o.coverage),f=o.alternateSets,p=0;p<l.length;p++)n.push({sub:l[p],by:f[p]});return n};j.prototype.getLigatures=function(e,r,t){for(var n=[],a=this.getLookupTables(r,t,e,4),s=0;s<a.length;s++)for(var i=a[s].subtables,u=0;u<i.length;u++)for(var o=i[u],l=this.expandCoverage(o.coverage),f=o.ligatureSets,p=0;p<l.length;p++)for(var c=l[p],h=f[p],d=0;d<h.length;d++){var g=h[d];n.push({sub:[c].concat(g.components),by:g.ligGlyph})}return n};j.prototype.addSingle=function(e,r,t,n){var a=this.getLookupTables(t,n,e,1,!0)[0],s=qr(a,2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});E.assert(s.coverage.format===1,"Single: unable to modify coverage table format "+s.coverage.format);var i=r.sub,u=this.binSearch(s.coverage.glyphs,i);u<0&&(u=-1-u,s.coverage.glyphs.splice(u,0,i),s.substitute.splice(u,0,0)),s.substitute[u]=r.by};j.prototype.addMultiple=function(e,r,t,n){E.assert(r.by instanceof Array&&r.by.length>1,'Multiple: "by" must be an array of two or more ids');var a=this.getLookupTables(t,n,e,2,!0)[0],s=qr(a,1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});E.assert(s.coverage.format===1,"Multiple: unable to modify coverage table format "+s.coverage.format);var i=r.sub,u=this.binSearch(s.coverage.glyphs,i);u<0&&(u=-1-u,s.coverage.glyphs.splice(u,0,i),s.sequences.splice(u,0,0)),s.sequences[u]=r.by};j.prototype.addAlternate=function(e,r,t,n){var a=this.getLookupTables(t,n,e,3,!0)[0],s=qr(a,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});E.assert(s.coverage.format===1,"Alternate: unable to modify coverage table format "+s.coverage.format);var i=r.sub,u=this.binSearch(s.coverage.glyphs,i);u<0&&(u=-1-u,s.coverage.glyphs.splice(u,0,i),s.alternateSets.splice(u,0,0)),s.alternateSets[u]=r.by};j.prototype.addLigature=function(e,r,t,n){var a=this.getLookupTables(t,n,e,4,!0)[0],s=a.subtables[0];s||(s={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},a.subtables[0]=s),E.assert(s.coverage.format===1,"Ligature: unable to modify coverage table format "+s.coverage.format);var i=r.sub[0],u=r.sub.slice(1),o={ligGlyph:r.by,components:u},l=this.binSearch(s.coverage.glyphs,i);if(l>=0){for(var f=s.ligatureSets[l],p=0;p<f.length;p++)if(Es(f[p].components,u))return;f.push(o)}else l=-1-l,s.coverage.glyphs.splice(l,0,i),s.ligatureSets.splice(l,0,[o])};j.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);case"ccmp":return this.getMultiple(e,r,t).concat(this.getLigatures(e,r,t));case"stch":return this.getMultiple(e,r,t)}};j.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);case"ccmp":return r.by instanceof Array?this.addMultiple(e,r,t,n):this.addLigature(e,r,t,n)}};function Os(){return typeof window<"u"}function Tn(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 Ls(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 Ge(e,r){if(!e)throw r}function mt(e,r,t,n,a){var s;return(r&n)>0?(s=e.parseByte(),(r&a)===0&&(s=-s),s=t+s):(r&a)>0?s=t:s=t+e.parseShort(),s}function kn(e,r,t){var n=new k.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,s;if(e.numberOfContours>0){for(var i=e.endPointIndices=[],u=0;u<e.numberOfContours;u+=1)i.push(n.parseUShort());e.instructionLength=n.parseUShort(),e.instructions=[];for(var o=0;o<e.instructionLength;o+=1)e.instructions.push(n.parseByte());var l=i[i.length-1]+1;a=[];for(var f=0;f<l;f+=1)if(s=n.parseByte(),a.push(s),(s&8)>0)for(var p=n.parseByte(),c=0;c<p;c+=1)a.push(s),f+=1;if(E.argument(a.length===l,"Bad flags."),i.length>0){var h=[],d;if(l>0){for(var g=0;g<l;g+=1)s=a[g],d={},d.onCurve=!!(s&1),d.lastPointOfContour=i.indexOf(g)>=0,h.push(d);for(var m=0,y=0;y<l;y+=1)s=a[y],d=h[y],d.x=mt(n,s,m,2,16),m=d.x;for(var F=0,x=0;x<l;x+=1)s=a[x],d=h[x],d.y=mt(n,s,F,4,32),F=d.y}e.points=h}else e.points=[]}else if(e.numberOfContours===0)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];for(var R=!0;R;){a=n.parseUShort();var w={glyphIndex:n.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(a&1)>0?(a&2)>0?(w.dx=n.parseShort(),w.dy=n.parseShort()):w.matchedPoints=[n.parseUShort(),n.parseUShort()]:(a&2)>0?(w.dx=n.parseChar(),w.dy=n.parseChar()):w.matchedPoints=[n.parseByte(),n.parseByte()],(a&8)>0?w.xScale=w.yScale=n.parseF2Dot14():(a&64)>0?(w.xScale=n.parseF2Dot14(),w.yScale=n.parseF2Dot14()):(a&128)>0&&(w.xScale=n.parseF2Dot14(),w.scale01=n.parseF2Dot14(),w.scale10=n.parseF2Dot14(),w.yScale=n.parseF2Dot14()),e.components.push(w),R=!!(a&32)}if(a&256){e.instructionLength=n.parseUShort(),e.instructions=[];for(var D=0;D<e.instructionLength;D+=1)e.instructions.push(n.parseByte())}}}function yr(e,r){for(var t=[],n=0;n<e.length;n+=1){var a=e[n],s={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(s)}return t}function Rs(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 E.argument(t.length===0,"There are still points left in the current contour."),r}function Fn(e){var r=new q;if(!e)return r;for(var t=Rs(e),n=0;n<t.length;++n){var a=t[n],s=null,i=a[a.length-1],u=a[0];if(i.onCurve)r.moveTo(i.x,i.y);else if(u.onCurve)r.moveTo(u.x,u.y);else{var o={x:(i.x+u.x)*.5,y:(i.y+u.y)*.5};r.moveTo(o.x,o.y)}for(var l=0;l<a.length;++l)if(s=i,i=u,u=a[(l+1)%a.length],i.onCurve)r.lineTo(i.x,i.y);else{var f=u;s.onCurve||((i.x+s.x)*.5,(i.y+s.y)*.5),u.onCurve||(f={x:(i.x+u.x)*.5,y:(i.y+u.y)*.5}),r.quadraticCurveTo(i.x,i.y,f.x,f.y)}r.closePath()}return r}function Un(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 s=void 0;if(n.matchedPoints===void 0)s=yr(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 i=r.points[n.matchedPoints[0]],u=a.points[n.matchedPoints[1]],o={xScale:n.xScale,scale01:n.scale01,scale10:n.scale10,yScale:n.yScale,dx:0,dy:0};u=yr([u],o)[0],o.dx=i.x-u.x,o.dy=i.y-u.y,s=yr(a.points,o)}r.points=r.points.concat(s)}}return Fn(r.points)}function Ds(e,r,t,n){for(var a=new le.GlyphSet(n),s=0;s<t.length-1;s+=1){var i=t[s],u=t[s+1];i!==u?a.push(s,le.ttfGlyphLoader(n,s,kn,e,r+i,Un)):a.push(s,le.glyphLoader(n,s))}return a}function As(e,r,t,n){var a=new le.GlyphSet(n);return n._push=function(s){var i=t[s],u=t[s+1];i!==u?a.push(s,le.ttfGlyphLoader(n,s,kn,e,r+i,Un)):a.push(s,le.glyphLoader(n,s))},a}function Bs(e,r,t,n,a){return a.lowMemory?As(e,r,t,n):Ds(e,r,t,n)}var Cn={getPath:Fn,parse:Bs},wn,Ue,En,Mr;function On(e){this.font=e,this.getCommands=function(r){return Cn.getPath(r).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function Ms(e){return e}function Ln(e){return Math.sign(e)*Math.round(Math.abs(e))}function Is(e){return Math.sign(e)*Math.round(Math.abs(e*2))/2}function Ps(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function Gs(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function Ns(e){return Math.sign(e)*Math.floor(Math.abs(e))}var Rn=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},ue={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,s,i,u,o,l,f;if(!n||n===this){if(a=e.xo-r.xo,s=e.xo-t.xo,o=r.x-r.xo,l=t.x-t.xo,i=Math.abs(a),u=Math.abs(s),f=i+u,f===0){e.x=e.xo+(o+l)/2;return}e.x=e.xo+(o*u+l*i)/f;return}if(a=n.distance(e,r,!0,!0),s=n.distance(e,t,!0,!0),o=n.distance(r,r,!1,!0),l=n.distance(t,t,!1,!0),i=Math.abs(a),u=Math.abs(s),f=i+u,f===0){ue.setRelative(e,e,(o+l)/2,n,!0);return}ue.setRelative(e,e,(o*u+l*i)/f,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 s=a?r.xo:r.x,i=a?r.yo:r.y,u=s+t*n.x,o=i+t*n.y;e.x=u+(e.y-o)/n.normalSlope},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},ce={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,s,i,u,o,l,f;if(!n||n===this){if(a=e.yo-r.yo,s=e.yo-t.yo,o=r.y-r.yo,l=t.y-t.yo,i=Math.abs(a),u=Math.abs(s),f=i+u,f===0){e.y=e.yo+(o+l)/2;return}e.y=e.yo+(o*u+l*i)/f;return}if(a=n.distance(e,r,!0,!0),s=n.distance(e,t,!0,!0),o=n.distance(r,r,!1,!0),l=n.distance(t,t,!1,!0),i=Math.abs(a),u=Math.abs(s),f=i+u,f===0){ce.setRelative(e,e,(o+l)/2,n,!0);return}ce.setRelative(e,e,(o*u+l*i)/f,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 s=a?r.xo:r.x,i=a?r.yo:r.y,u=s+t*n.x,o=i+t*n.y;e.y=o+n.normalSlope*(e.x-u)},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};Object.freeze(ue);Object.freeze(ce);function Xe(e,r){this.x=e,this.y=r,this.axis=void 0,this.slope=r/e,this.normalSlope=-e/r,Object.freeze(this)}Xe.prototype.distance=function(e,r,t,n){return this.x*ue.distance(e,r,t,n)+this.y*ce.distance(e,r,t,n)};Xe.prototype.interpolate=function(e,r,t,n){var a,s,i,u,o,l,f;if(i=n.distance(e,r,!0,!0),u=n.distance(e,t,!0,!0),a=n.distance(r,r,!1,!0),s=n.distance(t,t,!1,!0),o=Math.abs(i),l=Math.abs(u),f=o+l,f===0){this.setRelative(e,e,(a+s)/2,n,!0);return}this.setRelative(e,e,(a*l+s*o)/f,n,!0)};Xe.prototype.setRelative=function(e,r,t,n,a){n=n||this;var s=a?r.xo:r.x,i=a?r.yo:r.y,u=s+t*n.x,o=i+t*n.y,l=n.normalSlope,f=this.slope,p=e.x,c=e.y;e.x=(f*p-l*u+o-c)/(f-l),e.y=f*(e.x-p)+c};Xe.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0};function Ye(e,r){var t=Math.sqrt(e*e+r*r);return e/=t,r/=t,e===1&&r===0?ue:e===0&&r===1?ce:new Xe(e,r)}function pe(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)}pe.prototype.nextTouched=function(e){for(var r=this.nextPointOnContour;!e.touched(r)&&r!==this;)r=r.nextPointOnContour;return r};pe.prototype.prevTouched=function(e){for(var r=this.prevPointOnContour;!e.touched(r)&&r!==this;)r=r.prevPointOnContour;return r};var _e=Object.freeze(new pe(0,0)),Hs={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function xe(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=ue,this.round=Ln}}On.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){xe.prototype=Hs,a=this._fpgmState=new xe("fpgm",t.tables.fpgm),a.funcs=[],a.font=t,exports.DEBUG&&(console.log("---EXEC FPGM---"),a.step=-1);try{Ue(a)}catch(l){console.log("Hinting error in FPGM:"+l),this._errorState=3;return}}xe.prototype=a,n=this._prepState=new xe("prep",t.tables.prep),n.ppem=r;var s=t.tables.cvt;if(s)for(var i=n.cvt=new Array(s.length),u=r/t.unitsPerEm,o=0;o<s.length;o++)i[o]=s[o]*u;else n.cvt=[];exports.DEBUG&&(console.log("---EXEC PREP---"),n.step=-1);try{Ue(n)}catch(l){this._errorState<2&&console.log("Hinting error in PREP:"+l),this._errorState=2}}if(!(this._errorState>1))try{return En(e,n)}catch(l){this._errorState<1&&(console.log("Hinting error:"+l),console.log("Note: further hinting errors are silenced")),this._errorState=1;return}}};En=function(e,r){var t=r.ppem/r.font.unitsPerEm,n=t,a=e.components,s,i,u;if(xe.prototype=r,!a)u=new xe("glyf",e.instructions),exports.DEBUG&&(console.log("---EXEC GLYPH---"),u.step=-1),Mr(e,u,t,n),i=u.gZone;else{var o=r.font;i=[],s=[];for(var l=0;l<a.length;l++){var f=a[l],p=o.glyphs.get(f.glyphIndex);u=new xe("glyf",p.instructions),exports.DEBUG&&(console.log("---EXEC COMP "+l+"---"),u.step=-1),Mr(p,u,t,n);for(var c=Math.round(f.dx*t),h=Math.round(f.dy*n),d=u.gZone,g=u.contours,m=0;m<d.length;m++){var y=d[m];y.xTouched=y.yTouched=!1,y.xo=y.x=y.x+c,y.yo=y.y=y.y+h}var F=i.length;i.push.apply(i,d);for(var x=0;x<g.length;x++)s.push(g[x]+F)}e.instructions&&!u.inhibitGridFit&&(u=new xe("glyf",e.instructions),u.gZone=u.z0=u.z1=u.z2=i,u.contours=s,i.push(new pe(0,0),new pe(Math.round(e.advanceWidth*t),0)),exports.DEBUG&&(console.log("---EXEC COMPOSITE---"),u.step=-1),Ue(u),i.length-=2)}return i};Mr=function(e,r,t,n){for(var a=e.points||[],s=a.length,i=r.gZone=r.z0=r.z1=r.z2=[],u=r.contours=[],o,l=0;l<s;l++)o=a[l],i[l]=new pe(o.x*t,o.y*n,o.lastPointOfContour,o.onCurve);for(var f,p,c=0;c<s;c++)o=i[c],f||(f=o,u.push(c)),o.lastPointOfContour?(o.nextPointOnContour=f,f.prevPointOnContour=o,f=void 0):(p=i[c+1],o.nextPointOnContour=p,p.prevPointOnContour=o);if(!r.inhibitGridFit){if(exports.DEBUG){console.log("PROCESSING GLYPH",r.stack);for(var h=0;h<s;h++)console.log(h,i[h].x,i[h].y)}if(i.push(new pe(0,0),new pe(Math.round(e.advanceWidth*t),0)),Ue(r),i.length-=2,exports.DEBUG){console.log("FINISHED GLYPH",r.stack);for(var d=0;d<s;d++)console.log(d,i[d].x,i[d].y)}}};Ue=function(e){var r=e.prog;if(r){var t=r.length,n;for(e.ip=0;e.ip<t;e.ip++){if(exports.DEBUG&&e.step++,n=wn[r[e.ip]],!n)throw new Error("unknown instruction: 0x"+Number(r[e.ip]).toString(16));n(e)}}};function lr(e){for(var r=e.tZone=new Array(e.gZone.length),t=0;t<r.length;t++)r[t]=new pe(0,0)}function Dn(e,r){var t=e.prog,n=e.ip,a=1,s;do if(s=t[++n],s===88)a++;else if(s===89)a--;else if(s===64)n+=t[n+1]+1;else if(s===65)n+=2*t[n+1]+1;else if(s>=176&&s<=183)n+=s-176+1;else if(s>=184&&s<=191)n+=(s-184+1)*2;else if(r&&a===1&&s===27)break;while(a>0);e.ip=n}function yt(e,r){exports.DEBUG&&console.log(r.step,"SVTCA["+e.axis+"]"),r.fv=r.pv=r.dpv=e}function xt(e,r){exports.DEBUG&&console.log(r.step,"SPVTCA["+e.axis+"]"),r.pv=r.dpv=e}function bt(e,r){exports.DEBUG&&console.log(r.step,"SFVTCA["+e.axis+"]"),r.fv=e}function St(e,r){var t=r.stack,n=t.pop(),a=t.pop(),s=r.z2[n],i=r.z1[a];exports.DEBUG&&console.log("SPVTL["+e+"]",n,a);var u,o;e?(u=s.y-i.y,o=i.x-s.x):(u=i.x-s.x,o=i.y-s.y),r.pv=r.dpv=Ye(u,o)}function Tt(e,r){var t=r.stack,n=t.pop(),a=t.pop(),s=r.z2[n],i=r.z1[a];exports.DEBUG&&console.log("SFVTL["+e+"]",n,a);var u,o;e?(u=s.y-i.y,o=i.x-s.x):(u=i.x-s.x,o=i.y-s.y),r.fv=Ye(u,o)}function Ws(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"SPVFS[]",t,n),e.pv=e.dpv=Ye(n,t)}function zs(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"SPVFS[]",t,n),e.fv=Ye(n,t)}function _s(e){var r=e.stack,t=e.pv;exports.DEBUG&&console.log(e.step,"GPV[]"),r.push(t.x*16384),r.push(t.y*16384)}function Vs(e){var r=e.stack,t=e.fv;exports.DEBUG&&console.log(e.step,"GFV[]"),r.push(t.x*16384),r.push(t.y*16384)}function qs(e){e.fv=e.pv,exports.DEBUG&&console.log(e.step,"SFVTPV[]")}function Xs(e){var r=e.stack,t=r.pop(),n=r.pop(),a=r.pop(),s=r.pop(),i=r.pop(),u=e.z0,o=e.z1,l=u[t],f=u[n],p=o[a],c=o[s],h=e.z2[i];exports.DEBUG&&console.log("ISECT[], ",t,n,a,s,i);var d=l.x,g=l.y,m=f.x,y=f.y,F=p.x,x=p.y,R=c.x,w=c.y,D=(d-m)*(x-w)-(g-y)*(F-R),C=d*y-g*m,U=F*w-x*R;h.x=(C*(F-R)-U*(d-m))/D,h.y=(C*(x-w)-U*(g-y))/D}function Ys(e){e.rp0=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SRP0[]",e.rp0)}function $s(e){e.rp1=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SRP1[]",e.rp1)}function Zs(e){e.rp2=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SRP2[]",e.rp2)}function Qs(e){var r=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SZP0[]",r),e.zp0=r,r){case 0:e.tZone||lr(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function Ks(e){var r=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SZP1[]",r),e.zp1=r,r){case 0:e.tZone||lr(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function js(e){var r=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SZP2[]",r),e.zp2=r,r){case 0:e.tZone||lr(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function Js(e){var r=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SZPS[]",r),e.zp0=e.zp1=e.zp2=r,r){case 0:e.tZone||lr(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 ei(e){e.loop=e.stack.pop(),exports.DEBUG&&console.log(e.step,"SLOOP[]",e.loop)}function ri(e){exports.DEBUG&&console.log(e.step,"RTG[]"),e.round=Ln}function ti(e){exports.DEBUG&&console.log(e.step,"RTHG[]"),e.round=Ps}function ni(e){var r=e.stack.pop();exports.DEBUG&&console.log(e.step,"SMD[]",r),e.minDis=r/64}function ai(e){exports.DEBUG&&console.log(e.step,"ELSE[]"),Dn(e,!1)}function si(e){var r=e.stack.pop();exports.DEBUG&&console.log(e.step,"JMPR[]",r),e.ip+=r-1}function ii(e){var r=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCVTCI[]",r),e.cvCutIn=r/64}function oi(e){var r=e.stack;exports.DEBUG&&console.log(e.step,"DUP[]"),r.push(r[r.length-1])}function xr(e){exports.DEBUG&&console.log(e.step,"POP[]"),e.stack.pop()}function ui(e){exports.DEBUG&&console.log(e.step,"CLEAR[]"),e.stack.length=0}function li(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"SWAP[]"),r.push(t),r.push(n)}function fi(e){var r=e.stack;exports.DEBUG&&console.log(e.step,"DEPTH[]"),r.push(r.length)}function ci(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"LOOPCALL[]",t,n);var a=e.ip,s=e.prog;e.prog=e.funcs[t];for(var i=0;i<n;i++)Ue(e),exports.DEBUG&&console.log(++e.step,i+1<n?"next loopcall":"done loopcall",i);e.ip=a,e.prog=s}function pi(e){var r=e.stack.pop();exports.DEBUG&&console.log(e.step,"CALL[]",r);var t=e.ip,n=e.prog;e.prog=e.funcs[r],Ue(e),e.ip=t,e.prog=n,exports.DEBUG&&console.log(++e.step,"returning from",r)}function hi(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"CINDEX[]",t),r.push(r[r.length-t])}function vi(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"MINDEX[]",t),r.push(r.splice(r.length-t,1)[0])}function di(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(),s=n;for(exports.DEBUG&&console.log(e.step,"FDEF[]",a);t[++n]!==45;);e.ip=n,e.funcs[a]=t.slice(s+1,n)}function kt(e,r){var t=r.stack.pop(),n=r.z0[t],a=r.fv,s=r.pv;exports.DEBUG&&console.log(r.step,"MDAP["+e+"]",t);var i=s.distance(n,_e);e&&(i=r.round(i)),a.setRelative(n,_e,i,s),a.touch(n),r.rp0=r.rp1=t}function Ft(e,r){var t=r.z2,n=t.length-2,a,s,i;exports.DEBUG&&console.log(r.step,"IUP["+e.axis+"]");for(var u=0;u<n;u++)a=t[u],!e.touched(a)&&(s=a.prevTouched(e),s!==a&&(i=a.nextTouched(e),s===i&&e.setRelative(a,a,e.distance(s,s,!1,!0),e,!0),e.interpolate(a,s,i,e)))}function Ut(e,r){for(var t=r.stack,n=e?r.rp1:r.rp2,a=(e?r.z0:r.z1)[n],s=r.fv,i=r.pv,u=r.loop,o=r.z2;u--;){var l=t.pop(),f=o[l],p=i.distance(a,a,!1,!0);s.setRelative(f,f,p,i),s.touch(f),exports.DEBUG&&console.log(r.step,(r.loop>1?"loop "+(r.loop-u)+": ":"")+"SHP["+(e?"rp1":"rp2")+"]",l)}r.loop=1}function Ct(e,r){var t=r.stack,n=e?r.rp1:r.rp2,a=(e?r.z0:r.z1)[n],s=r.fv,i=r.pv,u=t.pop(),o=r.z2[r.contours[u]],l=o;exports.DEBUG&&console.log(r.step,"SHC["+e+"]",u);var f=i.distance(a,a,!1,!0);do l!==a&&s.setRelative(l,l,f,i),l=l.nextPointOnContour;while(l!==o)}function wt(e,r){var t=r.stack,n=e?r.rp1:r.rp2,a=(e?r.z0:r.z1)[n],s=r.fv,i=r.pv,u=t.pop();exports.DEBUG&&console.log(r.step,"SHZ["+e+"]",u);var o;switch(u){case 0:o=r.tZone;break;case 1:o=r.gZone;break;default:throw new Error("Invalid zone")}for(var l,f=i.distance(a,a,!1,!0),p=o.length-2,c=0;c<p;c++)l=o[c],s.setRelative(l,l,f,i)}function gi(e){for(var r=e.stack,t=e.loop,n=e.fv,a=r.pop()/64,s=e.z2;t--;){var i=r.pop(),u=s[i];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-t)+": ":"")+"SHPIX[]",i,a),n.setRelative(u,u,a),n.touch(u)}e.loop=1}function mi(e){for(var r=e.stack,t=e.rp1,n=e.rp2,a=e.loop,s=e.z0[t],i=e.z1[n],u=e.fv,o=e.dpv,l=e.z2;a--;){var f=r.pop(),p=l[f];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-a)+": ":"")+"IP[]",f,t,"<->",n),u.interpolate(p,s,i,o),u.touch(p)}e.loop=1}function Et(e,r){var t=r.stack,n=t.pop()/64,a=t.pop(),s=r.z1[a],i=r.z0[r.rp0],u=r.fv,o=r.pv;u.setRelative(s,i,n,o),u.touch(s),exports.DEBUG&&console.log(r.step,"MSIRP["+e+"]",n,a),r.rp1=r.rp0,r.rp2=a,e&&(r.rp0=a)}function yi(e){for(var r=e.stack,t=e.rp0,n=e.z0[t],a=e.loop,s=e.fv,i=e.pv,u=e.z1;a--;){var o=r.pop(),l=u[o];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-a)+": ":"")+"ALIGNRP[]",o),s.setRelative(l,n,0,i),s.touch(l)}e.loop=1}function xi(e){exports.DEBUG&&console.log(e.step,"RTDG[]"),e.round=Is}function Ot(e,r){var t=r.stack,n=t.pop(),a=t.pop(),s=r.z0[a],i=r.fv,u=r.pv,o=r.cvt[n];exports.DEBUG&&console.log(r.step,"MIAP["+e+"]",n,"(",o,")",a);var l=u.distance(s,_e);e&&(Math.abs(l-o)<r.cvCutIn&&(l=o),l=r.round(l)),i.setRelative(s,_e,l,u),r.zp0===0&&(s.xo=s.x,s.yo=s.y),i.touch(s),r.rp0=r.rp1=a}function bi(e){var r=e.prog,t=e.ip,n=e.stack,a=r[++t];exports.DEBUG&&console.log(e.step,"NPUSHB[]",a);for(var s=0;s<a;s++)n.push(r[++t]);e.ip=t}function Si(e){var r=e.ip,t=e.prog,n=e.stack,a=t[++r];exports.DEBUG&&console.log(e.step,"NPUSHW[]",a);for(var s=0;s<a;s++){var i=t[++r]<<8|t[++r];i&32768&&(i=-((i^65535)+1)),n.push(i)}e.ip=r}function Ti(e){var r=e.stack,t=e.store;t||(t=e.store=[]);var n=r.pop(),a=r.pop();exports.DEBUG&&console.log(e.step,"WS",n,a),t[a]=n}function ki(e){var r=e.stack,t=e.store,n=r.pop();exports.DEBUG&&console.log(e.step,"RS",n);var a=t&&t[n]||0;r.push(a)}function Fi(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"WCVTP",t,n),e.cvt[n]=t/64}function Ui(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"RCVT",t),r.push(e.cvt[t]*64)}function Lt(e,r){var t=r.stack,n=t.pop(),a=r.z2[n];exports.DEBUG&&console.log(r.step,"GC["+e+"]",n),t.push(r.dpv.distance(a,_e,e,!1)*64)}function Rt(e,r){var t=r.stack,n=t.pop(),a=t.pop(),s=r.z1[n],i=r.z0[a],u=r.dpv.distance(i,s,e,e);exports.DEBUG&&console.log(r.step,"MD["+e+"]",n,a,"->",u),r.stack.push(Math.round(u*64))}function Ci(e){exports.DEBUG&&console.log(e.step,"MPPEM[]"),e.stack.push(e.ppem)}function wi(e){exports.DEBUG&&console.log(e.step,"FLIPON[]"),e.autoFlip=!0}function Ei(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"LT[]",t,n),r.push(n<t?1:0)}function Oi(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"LTEQ[]",t,n),r.push(n<=t?1:0)}function Li(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"GT[]",t,n),r.push(n>t?1:0)}function Ri(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"GTEQ[]",t,n),r.push(n>=t?1:0)}function Di(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"EQ[]",t,n),r.push(t===n?1:0)}function Ai(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"NEQ[]",t,n),r.push(t!==n?1:0)}function Bi(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"ODD[]",t),r.push(Math.trunc(t)%2?1:0)}function Mi(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"EVEN[]",t),r.push(Math.trunc(t)%2?0:1)}function Ii(e){var r=e.stack.pop();exports.DEBUG&&console.log(e.step,"IF[]",r),r||(Dn(e,!0),exports.DEBUG&&console.log(e.step,"EIF[]"))}function Pi(e){exports.DEBUG&&console.log(e.step,"EIF[]")}function Gi(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"AND[]",t,n),r.push(t&&n?1:0)}function Ni(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"OR[]",t,n),r.push(t||n?1:0)}function Hi(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"NOT[]",t),r.push(t?0:1)}function br(e,r){var t=r.stack,n=t.pop(),a=r.fv,s=r.pv,i=r.ppem,u=r.deltaBase+(e-1)*16,o=r.deltaShift,l=r.z0;exports.DEBUG&&console.log(r.step,"DELTAP["+e+"]",n,t);for(var f=0;f<n;f++){var p=t.pop(),c=t.pop(),h=u+((c&240)>>4);if(h===i){var d=(c&15)-8;d>=0&&d++,exports.DEBUG&&console.log(r.step,"DELTAPFIX",p,"by",d*o);var g=l[p];a.setRelative(g,g,d*o,s)}}}function Wi(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"SDB[]",t),e.deltaBase=t}function zi(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"SDS[]",t),e.deltaShift=Math.pow(.5,t)}function _i(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"ADD[]",t,n),r.push(n+t)}function Vi(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"SUB[]",t,n),r.push(n-t)}function qi(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"DIV[]",t,n),r.push(n*64/t)}function Xi(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"MUL[]",t,n),r.push(n*t/64)}function Yi(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"ABS[]",t),r.push(Math.abs(t))}function $i(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"NEG[]",t),r.push(-t)}function Zi(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"FLOOR[]",t),r.push(Math.floor(t/64)*64)}function Qi(e){var r=e.stack,t=r.pop();exports.DEBUG&&console.log(e.step,"CEILING[]",t),r.push(Math.ceil(t/64)*64)}function Je(e,r){var t=r.stack,n=t.pop();exports.DEBUG&&console.log(r.step,"ROUND[]"),t.push(r.round(n/64)*64)}function Ki(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"WCVTF[]",t,n),e.cvt[n]=t*e.ppem/e.font.unitsPerEm}function Sr(e,r){var t=r.stack,n=t.pop(),a=r.ppem,s=r.deltaBase+(e-1)*16,i=r.deltaShift;exports.DEBUG&&console.log(r.step,"DELTAC["+e+"]",n,t);for(var u=0;u<n;u++){var o=t.pop(),l=t.pop(),f=s+((l&240)>>4);if(f===a){var p=(l&15)-8;p>=0&&p++;var c=p*i;exports.DEBUG&&console.log(r.step,"DELTACFIX",o,"by",c),r.cvt[o]+=c}}}function ji(e){var r=e.stack.pop();exports.DEBUG&&console.log(e.step,"SROUND[]",r),e.round=Rn;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 Ji(e){var r=e.stack.pop();exports.DEBUG&&console.log(e.step,"S45ROUND[]",r),e.round=Rn;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 eo(e){exports.DEBUG&&console.log(e.step,"ROFF[]"),e.round=Ms}function ro(e){exports.DEBUG&&console.log(e.step,"RUTG[]"),e.round=Gs}function to(e){exports.DEBUG&&console.log(e.step,"RDTG[]"),e.round=Ns}function no(e){var r=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCANCTRL[]",r)}function Dt(e,r){var t=r.stack,n=t.pop(),a=t.pop(),s=r.z2[n],i=r.z1[a];exports.DEBUG&&console.log(r.step,"SDPVTL["+e+"]",n,a);var u,o;e?(u=s.y-i.y,o=i.x-s.x):(u=i.x-s.x,o=i.y-s.y),r.dpv=Ye(u,o)}function ao(e){var r=e.stack,t=r.pop(),n=0;exports.DEBUG&&console.log(e.step,"GETINFO[]",t),t&1&&(n=35),t&32&&(n|=4096),r.push(n)}function so(e){var r=e.stack,t=r.pop(),n=r.pop(),a=r.pop();exports.DEBUG&&console.log(e.step,"ROLL[]"),r.push(n),r.push(t),r.push(a)}function io(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"MAX[]",t,n),r.push(Math.max(n,t))}function oo(e){var r=e.stack,t=r.pop(),n=r.pop();exports.DEBUG&&console.log(e.step,"MIN[]",t,n),r.push(Math.min(n,t))}function uo(e){var r=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCANTYPE[]",r)}function lo(e){var r=e.stack.pop(),t=e.stack.pop();switch(exports.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 de(e,r){var t=r.stack,n=r.prog,a=r.ip;exports.DEBUG&&console.log(r.step,"PUSHB["+e+"]");for(var s=0;s<e;s++)t.push(n[++a]);r.ip=a}function ge(e,r){var t=r.ip,n=r.prog,a=r.stack;exports.DEBUG&&console.log(r.ip,"PUSHW["+e+"]");for(var s=0;s<e;s++){var i=n[++t]<<8|n[++t];i&32768&&(i=-((i^65535)+1)),a.push(i)}r.ip=t}function T(e,r,t,n,a,s){var i=s.stack,u=e&&i.pop(),o=i.pop(),l=s.rp0,f=s.z0[l],p=s.z1[o],c=s.minDis,h=s.fv,d=s.dpv,g,m,y,F;m=g=d.distance(p,f,!0,!0),y=m>=0?1:-1,m=Math.abs(m),e&&(F=s.cvt[u],n&&Math.abs(m-F)<s.cvCutIn&&(m=F)),t&&m<c&&(m=c),n&&(m=s.round(m)),h.setRelative(p,f,y*m,d),h.touch(p),exports.DEBUG&&console.log(s.step,(e?"MIRP[":"MDRP[")+(r?"M":"m")+(t?">":"_")+(n?"R":"_")+(a===0?"Gr":a===1?"Bl":a===2?"Wh":"")+"]",e?u+"("+s.cvt[u]+","+F+")":"",o,"(d =",g,"->",y*m,")"),s.rp1=s.rp0,s.rp2=o,r&&(s.rp0=o)}wn=[yt.bind(void 0,ce),yt.bind(void 0,ue),xt.bind(void 0,ce),xt.bind(void 0,ue),bt.bind(void 0,ce),bt.bind(void 0,ue),St.bind(void 0,0),St.bind(void 0,1),Tt.bind(void 0,0),Tt.bind(void 0,1),Ws,zs,_s,Vs,qs,Xs,Ys,$s,Zs,Qs,Ks,js,Js,ei,ri,ti,ni,ai,si,ii,void 0,void 0,oi,xr,ui,li,fi,hi,vi,void 0,void 0,void 0,ci,pi,di,void 0,kt.bind(void 0,0),kt.bind(void 0,1),Ft.bind(void 0,ce),Ft.bind(void 0,ue),Ut.bind(void 0,0),Ut.bind(void 0,1),Ct.bind(void 0,0),Ct.bind(void 0,1),wt.bind(void 0,0),wt.bind(void 0,1),gi,mi,Et.bind(void 0,0),Et.bind(void 0,1),yi,xi,Ot.bind(void 0,0),Ot.bind(void 0,1),bi,Si,Ti,ki,Fi,Ui,Lt.bind(void 0,0),Lt.bind(void 0,1),void 0,Rt.bind(void 0,0),Rt.bind(void 0,1),Ci,void 0,wi,void 0,void 0,Ei,Oi,Li,Ri,Di,Ai,Bi,Mi,Ii,Pi,Gi,Ni,Hi,br.bind(void 0,1),Wi,zi,_i,Vi,qi,Xi,Yi,$i,Zi,Qi,Je.bind(void 0,0),Je.bind(void 0,1),Je.bind(void 0,2),Je.bind(void 0,3),void 0,void 0,void 0,void 0,Ki,br.bind(void 0,2),br.bind(void 0,3),Sr.bind(void 0,1),Sr.bind(void 0,2),Sr.bind(void 0,3),ji,Ji,void 0,void 0,eo,void 0,ro,to,xr,xr,void 0,void 0,void 0,void 0,void 0,no,Dt.bind(void 0,0),Dt.bind(void 0,1),ao,void 0,so,io,oo,uo,lo,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,de.bind(void 0,1),de.bind(void 0,2),de.bind(void 0,3),de.bind(void 0,4),de.bind(void 0,5),de.bind(void 0,6),de.bind(void 0,7),de.bind(void 0,8),ge.bind(void 0,1),ge.bind(void 0,2),ge.bind(void 0,3),ge.bind(void 0,4),ge.bind(void 0,5),ge.bind(void 0,6),ge.bind(void 0,7),ge.bind(void 0,8),T.bind(void 0,0,0,0,0,0),T.bind(void 0,0,0,0,0,1),T.bind(void 0,0,0,0,0,2),T.bind(void 0,0,0,0,0,3),T.bind(void 0,0,0,0,1,0),T.bind(void 0,0,0,0,1,1),T.bind(void 0,0,0,0,1,2),T.bind(void 0,0,0,0,1,3),T.bind(void 0,0,0,1,0,0),T.bind(void 0,0,0,1,0,1),T.bind(void 0,0,0,1,0,2),T.bind(void 0,0,0,1,0,3),T.bind(void 0,0,0,1,1,0),T.bind(void 0,0,0,1,1,1),T.bind(void 0,0,0,1,1,2),T.bind(void 0,0,0,1,1,3),T.bind(void 0,0,1,0,0,0),T.bind(void 0,0,1,0,0,1),T.bind(void 0,0,1,0,0,2),T.bind(void 0,0,1,0,0,3),T.bind(void 0,0,1,0,1,0),T.bind(void 0,0,1,0,1,1),T.bind(void 0,0,1,0,1,2),T.bind(void 0,0,1,0,1,3),T.bind(void 0,0,1,1,0,0),T.bind(void 0,0,1,1,0,1),T.bind(void 0,0,1,1,0,2),T.bind(void 0,0,1,1,0,3),T.bind(void 0,0,1,1,1,0),T.bind(void 0,0,1,1,1,1),T.bind(void 0,0,1,1,1,2),T.bind(void 0,0,1,1,1,3),T.bind(void 0,1,0,0,0,0),T.bind(void 0,1,0,0,0,1),T.bind(void 0,1,0,0,0,2),T.bind(void 0,1,0,0,0,3),T.bind(void 0,1,0,0,1,0),T.bind(void 0,1,0,0,1,1),T.bind(void 0,1,0,0,1,2),T.bind(void 0,1,0,0,1,3),T.bind(void 0,1,0,1,0,0),T.bind(void 0,1,0,1,0,1),T.bind(void 0,1,0,1,0,2),T.bind(void 0,1,0,1,0,3),T.bind(void 0,1,0,1,1,0),T.bind(void 0,1,0,1,1,1),T.bind(void 0,1,0,1,1,2),T.bind(void 0,1,0,1,1,3),T.bind(void 0,1,1,0,0,0),T.bind(void 0,1,1,0,0,1),T.bind(void 0,1,1,0,0,2),T.bind(void 0,1,1,0,0,3),T.bind(void 0,1,1,0,1,0),T.bind(void 0,1,1,0,1,1),T.bind(void 0,1,1,0,1,2),T.bind(void 0,1,1,0,1,3),T.bind(void 0,1,1,1,0,0),T.bind(void 0,1,1,1,0,1),T.bind(void 0,1,1,1,0,2),T.bind(void 0,1,1,1,0,3),T.bind(void 0,1,1,1,1,0),T.bind(void 0,1,1,1,1,1),T.bind(void 0,1,1,1,1,2),T.bind(void 0,1,1,1,1,3)];function Re(e){this.char=e,this.state={},this.activeState=null}function Xr(e,r,t){this.contextName=t,this.startIndex=e,this.endOffset=r}function fo(e,r,t){this.contextName=e,this.openRange=null,this.ranges=[],this.checkStart=r,this.checkEnd=t}function re(e,r){this.context=e,this.index=r,this.length=e.length,this.current=e[r],this.backtrack=e.slice(0,r),this.lookahead=e.slice(r+1)}function fr(e){this.eventId=e,this.subscribers=[]}function co(e){var r=this,t=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];t.forEach(function(a){Object.defineProperty(r.events,a,{value:new fr(a)})}),e&&t.forEach(function(a){var s=e[a];typeof s=="function"&&r.events[a].subscribe(s)});var n=["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"];n.forEach(function(a){r.events[a].subscribe(r.updateContextsRanges)})}function N(e){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],co.call(this,e)}Re.prototype.setState=function(e,r){return this.state[e]=r,this.activeState={key:e,value:this.state[e]},this.activeState};Re.prototype.getState=function(e){return this.state[e]||null};N.prototype.inboundIndex=function(e){return e>=0&&e<this.tokens.length};N.prototype.composeRUD=function(e){var r=this,t=!0,n=e.map(function(s){return r[s[0]].apply(r,s.slice(1).concat(t))}),a=function(s){return typeof s=="object"&&s.hasOwnProperty("FAIL")};if(n.every(a))return{FAIL:"composeRUD: one or more operations hasn't completed successfully",report:n.filter(a)};this.dispatch("composeRUD",[n.filter(function(s){return!a(s)})])};N.prototype.replaceRange=function(e,r,t,n){r=r!==null?r:this.tokens.length;var a=t.every(function(i){return i instanceof Re});if(!isNaN(e)&&this.inboundIndex(e)&&a){var s=this.tokens.splice.apply(this.tokens,[e,r].concat(t));return n||this.dispatch("replaceToken",[e,r,t]),[s,t]}else return{FAIL:"replaceRange: invalid tokens or startIndex."}};N.prototype.replaceToken=function(e,r,t){if(!isNaN(e)&&this.inboundIndex(e)&&r instanceof Re){var n=this.tokens.splice(e,1,r);return t||this.dispatch("replaceToken",[e,r]),[n[0],r]}else return{FAIL:"replaceToken: invalid token or index."}};N.prototype.removeRange=function(e,r,t){r=isNaN(r)?this.tokens.length:r;var n=this.tokens.splice(e,r);return t||this.dispatch("removeRange",[n,e,r]),n};N.prototype.removeToken=function(e,r){if(!isNaN(e)&&this.inboundIndex(e)){var t=this.tokens.splice(e,1);return r||this.dispatch("removeToken",[t,e]),t}else return{FAIL:"removeToken: invalid token index."}};N.prototype.insertToken=function(e,r,t){var n=e.every(function(a){return a instanceof Re});return n?(this.tokens.splice.apply(this.tokens,[r,0].concat(e)),t||this.dispatch("insertToken",[e,r]),e):{FAIL:"insertToken: invalid token(s)."}};N.prototype.registerModifier=function(e,r,t){this.events.newToken.subscribe(function(n,a){var s=[n,a],i=r===null||r.apply(this,s)===!0,u=[n,a];if(i){var o=t.apply(this,u);n.setState(e,o)}}),this.registeredModifiers.push(e)};fr.prototype.subscribe=function(e){return typeof e=="function"?this.subscribers.push(e)-1:{FAIL:"invalid '"+this.eventId+"' event handler"}};fr.prototype.unsubscribe=function(e){this.subscribers.splice(e,1)};re.prototype.setCurrentIndex=function(e){this.index=e,this.current=this.context[e],this.backtrack=this.context.slice(0,e),this.lookahead=this.context.slice(e+1)};re.prototype.get=function(e){switch(!0){case e===0:return this.current;case(e<0&&Math.abs(e)<=this.backtrack.length):return this.backtrack.slice(e)[0];case(e>0&&e<=this.lookahead.length):return this.lookahead[e-1];default:return null}};N.prototype.rangeToText=function(e){if(e instanceof Xr)return this.getRangeTokens(e).map(function(r){return r.char}).join("")};N.prototype.getText=function(){return this.tokens.map(function(e){return e.char}).join("")};N.prototype.getContext=function(e){var r=this.registeredContexts[e];return r||null};N.prototype.on=function(e,r){var t=this.events[e];return t?t.subscribe(r):null};N.prototype.dispatch=function(e,r){var t=this,n=this.events[e];n instanceof fr&&n.subscribers.forEach(function(a){a.apply(t,r||[])})};N.prototype.registerContextChecker=function(e,r,t){if(this.getContext(e))return{FAIL:"context name '"+e+"' is already registered."};if(typeof r!="function")return{FAIL:"missing context start check."};if(typeof t!="function")return{FAIL:"missing context end check."};var n=new fo(e,r,t);return this.registeredContexts[e]=n,this.contextCheckers.push(n),n};N.prototype.getRangeTokens=function(e){var r=e.startIndex+e.endOffset;return[].concat(this.tokens.slice(e.startIndex,r))};N.prototype.getContextRanges=function(e){var r=this.getContext(e);return r?r.ranges:{FAIL:"context checker '"+e+"' is not registered."}};N.prototype.resetContextsRanges=function(){var e=this.registeredContexts;for(var r in e)if(e.hasOwnProperty(r)){var t=e[r];t.ranges=[]}};N.prototype.updateContextsRanges=function(){this.resetContextsRanges();for(var e=this.tokens.map(function(n){return n.char}),r=0;r<e.length;r++){var t=new re(e,r);this.runContextCheck(t)}this.dispatch("updateContextsRanges",[this.registeredContexts])};N.prototype.setEndOffset=function(e,r){var t=this.getContext(r).openRange.startIndex,n=new Xr(t,e,r),a=this.getContext(r).ranges;return n.rangeId=r+"."+a.length,a.push(n),this.getContext(r).openRange=null,n};N.prototype.runContextCheck=function(e){var r=this,t=e.index;this.contextCheckers.forEach(function(n){var a=n.contextName,s=r.getContext(a).openRange;if(!s&&n.checkStart(e)&&(s=new Xr(t,null,a),r.getContext(a).openRange=s,r.dispatch("contextStart",[a,t])),s&&n.checkEnd(e)){var i=t-s.startIndex+1,u=r.setEndOffset(i,a);r.dispatch("contextEnd",[a,u])}})};N.prototype.tokenize=function(e){this.tokens=[],this.resetContextsRanges();var r=Array.from(e);this.dispatch("start");for(var t=0;t<r.length;t++){var n=r[t],a=new re(r,t);this.dispatch("next",[a]),this.runContextCheck(a);var s=new Re(n);this.tokens.push(s),this.dispatch("newToken",[s,a])}return this.dispatch("end",[this.tokens]),this.tokens};function be(e){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(e)}function An(e){return/[\u0630\u0690\u0621\u0631\u0661\u0671\u0622\u0632\u0672\u0692\u06C2\u0623\u0673\u0693\u06C3\u0624\u0694\u06C4\u0625\u0675\u0695\u06C5\u06E5\u0676\u0696\u06C6\u0627\u0677\u0697\u06C7\u0648\u0688\u0698\u06C8\u0689\u0699\u06C9\u068A\u06CA\u066B\u068B\u06CB\u068C\u068D\u06CD\u06FD\u068E\u06EE\u06FE\u062F\u068F\u06CF\u06EF]/.test(e)}function Se(e){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(e)}function rr(e){return/[A-z]/.test(e)}function po(e){return/\s/.test(e)}function J(e){this.font=e,this.features={}}function Fe(e){this.id=e.id,this.tag=e.tag,this.substitution=e.substitution}function $e(e,r){if(!e)return-1;switch(r.format){case 1:return r.glyphs.indexOf(e);case 2:for(var t=r.ranges,n=0;n<t.length;n++){var a=t[n];if(e>=a.start&&e<=a.end){var s=e-a.start;return a.index+s}}break;default:return-1}return-1}function ho(e,r){var t=$e(e,r.coverage);return t===-1?null:e+r.deltaGlyphId}function vo(e,r){var t=$e(e,r.coverage);return t===-1?null:r.substitute[t]}function Tr(e,r){for(var t=[],n=0;n<e.length;n++){var a=e[n],s=r.current;s=Array.isArray(s)?s[0]:s;var i=$e(s,a);i!==-1&&t.push(i)}return t.length!==e.length?-1:t}function go(e,r){var t=r.inputCoverage.length+r.lookaheadCoverage.length+r.backtrackCoverage.length;if(e.context.length<t)return[];var n=Tr(r.inputCoverage,e);if(n===-1)return[];var a=r.inputCoverage.length-1;if(e.lookahead.length<r.lookaheadCoverage.length)return[];for(var s=e.lookahead.slice(a);s.length&&Se(s[0].char);)s.shift();var i=new re(s,0),u=Tr(r.lookaheadCoverage,i),o=[].concat(e.backtrack);for(o.reverse();o.length&&Se(o[0].char);)o.shift();if(o.length<r.backtrackCoverage.length)return[];var l=new re(o,0),f=Tr(r.backtrackCoverage,l),p=n.length===r.inputCoverage.length&&u.length===r.lookaheadCoverage.length&&f.length===r.backtrackCoverage.length,c=[];if(p)for(var h=0;h<r.lookupRecords.length;h++)for(var d=r.lookupRecords[h],g=d.lookupListIndex,m=this.getLookupByIndex(g),y=0;y<m.subtables.length;y++){var F=m.subtables[y],x=this.getLookupMethod(m,F),R=this.getSubstitutionType(m,F);if(R==="12")for(var w=0;w<n.length;w++){var D=e.get(w),C=x(D);C&&c.push(C)}}return c}function mo(e,r){var t=e.current,n=$e(t,r.coverage);if(n===-1)return null;for(var a,s=r.ligatureSets[n],i=0;i<s.length;i++){a=s[i];for(var u=0;u<a.components.length;u++){var o=e.lookahead[u],l=a.components[u];if(o!==l)break;if(u===a.components.length-1)return a}}return null}function yo(e,r){var t=$e(e,r.coverage);return t===-1?null:r.sequences[t]}J.prototype.getDefaultScriptFeaturesIndexes=function(){for(var e=this.font.tables.gsub.scripts,r=0;r<e.length;r++){var t=e[r];if(t.tag==="DFLT")return t.script.defaultLangSys.featureIndexes}return[]};J.prototype.getScriptFeaturesIndexes=function(e){var r=this.font.tables;if(!r.gsub)return[];if(!e)return this.getDefaultScriptFeaturesIndexes();for(var t=this.font.tables.gsub.scripts,n=0;n<t.length;n++){var a=t[n];if(a.tag===e&&a.script.defaultLangSys)return a.script.defaultLangSys.featureIndexes;var s=a.langSysRecords;if(s)for(var i=0;i<s.length;i++){var u=s[i];if(u.tag===e){var o=u.langSys;return o.featureIndexes}}}return this.getDefaultScriptFeaturesIndexes()};J.prototype.mapTagsToFeatures=function(e,r){for(var t={},n=0;n<e.length;n++){var a=e[n].tag,s=e[n].feature;t[a]=s}this.features[r].tags=t};J.prototype.getScriptFeatures=function(e){var r=this.features[e];if(this.features.hasOwnProperty(e))return r;var t=this.getScriptFeaturesIndexes(e);if(!t)return null;var n=this.font.tables.gsub;return r=t.map(function(a){return n.features[a]}),this.features[e]=r,this.mapTagsToFeatures(r,e),r};J.prototype.getSubstitutionType=function(e,r){var t=e.lookupType.toString(),n=r.substFormat.toString();return t+n};J.prototype.getLookupMethod=function(e,r){var t=this,n=this.getSubstitutionType(e,r);switch(n){case"11":return function(a){return ho.apply(t,[a,r])};case"12":return function(a){return vo.apply(t,[a,r])};case"63":return function(a){return go.apply(t,[a,r])};case"41":return function(a){return mo.apply(t,[a,r])};case"21":return function(a){return yo.apply(t,[a,r])};default:throw new Error("lookupType: "+e.lookupType+" - substFormat: "+r.substFormat+" is not yet supported")}};J.prototype.lookupFeature=function(e){var r=e.contextParams,t=r.index,n=this.getFeature({tag:e.tag,script:e.script});if(!n)return new Error("font '"+this.font.names.fullName.en+"' doesn't support feature '"+e.tag+"' for script '"+e.script+"'.");for(var a=this.getFeatureLookups(n),s=[].concat(r.context),i=0;i<a.length;i++)for(var u=a[i],o=this.getLookupSubtables(u),l=0;l<o.length;l++){var f=o[l],p=this.getSubstitutionType(u,f),c=this.getLookupMethod(u,f),h=void 0;switch(p){case"11":h=c(r.current),h&&s.splice(t,1,new Fe({id:11,tag:e.tag,substitution:h}));break;case"12":h=c(r.current),h&&s.splice(t,1,new Fe({id:12,tag:e.tag,substitution:h}));break;case"63":h=c(r),Array.isArray(h)&&h.length&&s.splice(t,1,new Fe({id:63,tag:e.tag,substitution:h}));break;case"41":h=c(r),h&&s.splice(t,1,new Fe({id:41,tag:e.tag,substitution:h}));break;case"21":h=c(r.current),h&&s.splice(t,1,new Fe({id:21,tag:e.tag,substitution:h}));break}r=new re(s,t),!(Array.isArray(h)&&!h.length)&&(h=null)}return s.length?s:null};J.prototype.supports=function(e){if(!e.script)return!1;this.getScriptFeatures(e.script);var r=this.features.hasOwnProperty(e.script);if(!e.tag)return r;var t=this.features[e.script].some(function(n){return n.tag===e.tag});return r&&t};J.prototype.getLookupSubtables=function(e){return e.subtables||null};J.prototype.getLookupByIndex=function(e){var r=this.font.tables.gsub.lookups;return r[e]||null};J.prototype.getFeatureLookups=function(e){return e.lookupListIndexes.map(this.getLookupByIndex.bind(this))};J.prototype.getFeature=function(r){if(!this.font)return{FAIL:"No font was found"};this.features.hasOwnProperty(r.script)||this.getScriptFeatures(r.script);var t=this.features[r.script];return t?t.tags[r.tag]?this.features[r.script].tags[r.tag]:null:{FAIL:"No feature for script "+r.script}};function xo(e){var r=e.current,t=e.get(-1);return t===null&&be(r)||!be(t)&&be(r)}function bo(e){var r=e.get(1);return r===null||!be(r)}var So={startCheck:xo,endCheck:bo};function To(e){var r=e.current,t=e.get(-1);return(be(r)||Se(r))&&!be(t)}function ko(e){var r=e.get(1);switch(!0){case r===null:return!0;case(!be(r)&&!Se(r)):var t=po(r);if(!t)return!0;if(t){var n=!1;if(n=e.lookahead.some(function(a){return be(a)||Se(a)}),!n)return!0}break;default:return!1}}var Fo={startCheck:To,endCheck:ko};function Uo(e,r,t){r[t].setState(e.tag,e.substitution)}function Co(e,r,t){r[t].setState(e.tag,e.substitution)}function wo(e,r,t){e.substitution.forEach(function(n,a){var s=r[t+a];s.setState(e.tag,n)})}function Eo(e,r,t){var n=r[t];n.setState(e.tag,e.substitution.ligGlyph);for(var a=e.substitution.components.length,s=0;s<a;s++)n=r[t+s+1],n.setState("deleted",!0)}var At={11:Uo,12:Co,63:wo,41:Eo};function Yr(e,r,t){e instanceof Fe&&At[e.id]&&At[e.id](e,r,t)}function Oo(e){for(var r=[].concat(e.backtrack),t=r.length-1;t>=0;t--){var n=r[t],a=An(n),s=Se(n);if(!a&&!s)return!0;if(a)return!1}return!1}function Lo(e){if(An(e.current))return!1;for(var r=0;r<e.lookahead.length;r++){var t=e.lookahead[r],n=Se(t);if(!n)return!0}return!1}function Ro(e){var r=this,t="arab",n=this.featuresTags[t],a=this.tokenizer.getRangeTokens(e);if(a.length!==1){var s=new re(a.map(function(u){return u.getState("glyphIndex")}),0),i=new re(a.map(function(u){return u.char}),0);a.forEach(function(u,o){if(!Se(u.char)){s.setCurrentIndex(o),i.setCurrentIndex(o);var l=0;Oo(i)&&(l|=1),Lo(i)&&(l|=2);var f;switch(l){case 1:f="fina";break;case 2:f="init";break;case 3:f="medi";break}if(n.indexOf(f)!==-1){var p=r.query.lookupFeature({tag:f,script:t,contextParams:s});if(p instanceof Error)return console.info(p.message);p.forEach(function(c,h){c instanceof Fe&&(Yr(c,a,h),s.context[h]=c.substitution)})}}})}}function Bt(e,r){var t=e.map(function(n){return n.activeState.value});return new re(t,0)}function Do(e){var r=this,t="arab",n=this.tokenizer.getRangeTokens(e),a=Bt(n);a.context.forEach(function(s,i){a.setCurrentIndex(i);var u=r.query.lookupFeature({tag:"rlig",script:t,contextParams:a});u.length&&(u.forEach(function(o){return Yr(o,n,i)}),a=Bt(n))})}function Ao(e){var r=e.current,t=e.get(-1);return t===null&&rr(r)||!rr(t)&&rr(r)}function Bo(e){var r=e.get(1);return r===null||!rr(r)}var Mo={startCheck:Ao,endCheck:Bo};function Mt(e,r){var t=e.map(function(n){return n.activeState.value});return new re(t,0)}function Io(e){var r=this,t="latn",n=this.tokenizer.getRangeTokens(e),a=Mt(n);a.context.forEach(function(s,i){a.setCurrentIndex(i);var u=r.query.lookupFeature({tag:"liga",script:t,contextParams:a});u.length&&(u.forEach(function(o){return Yr(o,n,i)}),a=Mt(n))})}function ae(e){this.baseDir=e||"ltr",this.tokenizer=new N,this.featuresTags={}}ae.prototype.setText=function(e){this.text=e};ae.prototype.contextChecks={latinWordCheck:Mo,arabicWordCheck:So,arabicSentenceCheck:Fo};function kr(e){var r=this.contextChecks[e+"Check"];return this.tokenizer.registerContextChecker(e,r.startCheck,r.endCheck)}function Po(){return kr.call(this,"latinWord"),kr.call(this,"arabicWord"),kr.call(this,"arabicSentence"),this.tokenizer.tokenize(this.text)}function Go(){var e=this,r=this.tokenizer.getContextRanges("arabicSentence");r.forEach(function(t){var n=e.tokenizer.getRangeTokens(t);e.tokenizer.replaceRange(t.startIndex,t.endOffset,n.reverse())})}ae.prototype.registerFeatures=function(e,r){var t=this,n=r.filter(function(a){return t.query.supports({script:e,tag:a})});this.featuresTags.hasOwnProperty(e)?this.featuresTags[e]=this.featuresTags[e].concat(n):this.featuresTags[e]=n};ae.prototype.applyFeatures=function(e,r){if(!e)throw new Error("No valid font was provided to apply features");this.query||(this.query=new J(e));for(var t=0;t<r.length;t++){var n=r[t];this.query.supports({script:n.script})&&this.registerFeatures(n.script,n.tags)}};ae.prototype.registerModifier=function(e,r,t){this.tokenizer.registerModifier(e,r,t)};function $r(){if(this.tokenizer.registeredModifiers.indexOf("glyphIndex")===-1)throw new Error("glyphIndex modifier is required to apply arabic presentation features.")}function No(){var e=this,r="arab";if(this.featuresTags.hasOwnProperty(r)){$r.call(this);var t=this.tokenizer.getContextRanges("arabicWord");t.forEach(function(n){Ro.call(e,n)})}}function Ho(){var e=this,r="arab";if(this.featuresTags.hasOwnProperty(r)){var t=this.featuresTags[r];if(t.indexOf("rlig")!==-1){$r.call(this);var n=this.tokenizer.getContextRanges("arabicWord");n.forEach(function(a){Do.call(e,a)})}}}function Wo(){var e=this,r="latn";if(this.featuresTags.hasOwnProperty(r)){var t=this.featuresTags[r];if(t.indexOf("liga")!==-1){$r.call(this);var n=this.tokenizer.getContextRanges("latinWord");n.forEach(function(a){Io.call(e,a)})}}}ae.prototype.checkContextReady=function(e){return!!this.tokenizer.getContext(e)};ae.prototype.applyFeaturesToContexts=function(){this.checkContextReady("arabicWord")&&(No.call(this),Ho.call(this)),this.checkContextReady("latinWord")&&Wo.call(this),this.checkContextReady("arabicSentence")&&Go.call(this)};ae.prototype.processText=function(e){(!this.text||this.text!==e)&&(this.setText(e),Po.call(this),this.applyFeaturesToContexts())};ae.prototype.getBidiText=function(e){return this.processText(e),this.tokenizer.getText()};ae.prototype.getTextGlyphs=function(e){this.processText(e);for(var r=[],t=0;t<this.tokenizer.tokens.length;t++){var n=this.tokenizer.tokens[t];if(!n.state.deleted){var a=n.activeState.value;r.push(Array.isArray(a)?a[0]:a)}}return r};function M(e){e=e||{},e.tables=e.tables||{},e.empty||(Ge(e.familyName,"When creating a new Font object, familyName is required."),Ge(e.styleName,"When creating a new Font object, styleName is required."),Ge(e.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),Ge(e.ascender,"When creating a new Font object, ascender is required."),Ge(e.descender<=0,"When creating a new Font object, negative descender value is required."),this.names={fontFamily:{en:e.familyName||" "},fontSubfamily:{en:e.styleName||" "},fullName:{en:e.fullName||e.familyName+" "+e.styleName},postScriptName:{en:e.postScriptName||(e.familyName+e.styleName).replace(/\s/g,"")},designer:{en:e.designer||" "},designerURL:{en:e.designerURL||" "},manufacturer:{en:e.manufacturer||" "},manufacturerURL:{en:e.manufacturerURL||" "},license:{en:e.license||" "},licenseURL:{en:e.licenseURL||" "},version:{en:e.version||"Version 0.1"},description:{en:e.description||" "},copyright:{en:e.copyright||" "},trademark:{en:e.trademark||" "}},this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.tables=Object.assign(e.tables,{os2:Object.assign({usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,fsSelection:e.fsSelection||this.fsSelectionValues.REGULAR},e.tables.os2)})),this.supported=!0,this.glyphs=new le.GlyphSet(this,e.glyphs||[]),this.encoding=new Qt(this),this.position=new qe(this),this.substitution=new j(this),this.tables=this.tables||{},this._push=null,this._hmtxTableData={},Object.defineProperty(this,"hinting",{get:function(){if(this._hinting)return this._hinting;if(this.outlinesFormat==="truetype")return this._hinting=new On(this)}})}M.prototype.hasChar=function(e){return this.encoding.charToGlyphIndex(e)!==null};M.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)};M.prototype.charToGlyph=function(e){var r=this.charToGlyphIndex(e),t=this.glyphs.get(r);return t||(t=this.glyphs.get(0)),t};M.prototype.updateFeatures=function(e){return this.defaultRenderOptions.features.map(function(r){return r.script==="latn"?{script:"latn",tags:r.tags.filter(function(t){return e[t]})}:r})};M.prototype.stringToGlyphs=function(e,r){var t=this,n=new ae,a=function(p){return t.charToGlyphIndex(p.char)};n.registerModifier("glyphIndex",null,a);var s=r?this.updateFeatures(r.features):this.defaultRenderOptions.features;n.applyFeatures(this,s);for(var i=n.getTextGlyphs(e),u=i.length,o=new Array(u),l=this.glyphs.get(0),f=0;f<u;f+=1)o[f]=this.glyphs.get(i[f])||l;return o};M.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)};M.prototype.nameToGlyph=function(e){var r=this.nameToGlyphIndex(e),t=this.glyphs.get(r);return t||(t=this.glyphs.get(0)),t};M.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):""};M.prototype.getKerningValue=function(e,r){e=e.index||e,r=r.index||r;var t=this.position.defaultKerningTables;return t?this.position.getKerningValue(t,e,r):this.kerningPairs[e+","+r]||0};M.prototype.defaultRenderOptions={kerning:!0,features:[{script:"arab",tags:["init","medi","fina","rlig"]},{script:"latn",tags:["liga","rlig"]}]};M.prototype.forEachGlyph=function(e,r,t,n,a,s){r=r!==void 0?r:0,t=t!==void 0?t:0,n=n!==void 0?n:72,a=Object.assign({},this.defaultRenderOptions,a);var i=1/this.unitsPerEm*n,u=this.stringToGlyphs(e,a),o;if(a.kerning){var l=a.script||this.position.getDefaultScriptName();o=this.position.getKerningTables(l,a.language)}for(var f=0;f<u.length;f+=1){var p=u[f];if(s.call(this,p,r,t,n,a),p.advanceWidth&&(r+=p.advanceWidth*i),a.kerning&&f<u.length-1){var c=o?this.position.getKerningValue(o,p.index,u[f+1].index):this.getKerningValue(p,u[f+1]);r+=c*i}a.letterSpacing?r+=a.letterSpacing*n:a.tracking&&(r+=a.tracking/1e3*n)}return r};M.prototype.getPath=function(e,r,t,n,a){var s=new q;return this.forEachGlyph(e,r,t,n,a,function(i,u,o,l){var f=i.getPath(u,o,l,a,this);s.extend(f)}),s};M.prototype.getPaths=function(e,r,t,n,a){var s=[];return this.forEachGlyph(e,r,t,n,a,function(i,u,o,l){var f=i.getPath(u,o,l,a,this);s.push(f)}),s};M.prototype.getAdvanceWidth=function(e,r,t){return this.forEachGlyph(e,0,0,r,t,function(){})};M.prototype.draw=function(e,r,t,n,a,s){this.getPath(r,t,n,a,s).draw(e)};M.prototype.drawPoints=function(e,r,t,n,a,s){this.forEachGlyph(r,t,n,a,s,function(i,u,o,l){i.drawPoints(e,u,o,l)})};M.prototype.drawMetrics=function(e,r,t,n,a,s){this.forEachGlyph(r,t,n,a,s,function(i,u,o,l){i.drawMetrics(e,u,o,l)})};M.prototype.getEnglishName=function(e){var r=this.names[e];if(r)return r.en};M.prototype.validate=function(){var e=this;function r(n,a){}function t(n){var a=e.getEnglishName(n);a&&a.trim().length>0}t("fontFamily"),t("weightName"),t("manufacturer"),t("copyright"),t("version"),this.unitsPerEm>0};M.prototype.toTables=function(){return ws.fontToTable(this)};M.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()};M.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};M.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(Os())if(window.URL=window.URL||window.webkitURL,window.URL){var a=new DataView(n),s=new Blob([a],{type:"font/opentype"}),i=document.createElement("a");i.href=window.URL.createObjectURL(s),i.download=e;var u=document.createEvent("MouseEvents");u.initEvent("click",!0,!1),i.dispatchEvent(u)}else console.warn("Font file could not be downloaded. Try using a different browser.");else{var o=require("fs"),l=Ls(n);o.writeFileSync(e,l)}};M.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512};M.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};M.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};function Bn(e,r){var t=JSON.stringify(e),n=256;for(var a in r){var s=parseInt(a);if(!(!s||s<256)){if(JSON.stringify(r[a])===t)return s;n<=s&&(n=s+1)}}return r[n]=e,n}function zo(e,r,t){var n=Bn(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 _o(e,r,t){var n={},a=new k.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 Vo(e,r,t,n){for(var a=Bn(r.name,n),s=[{name:"nameID_"+e,type:"USHORT",value:a},{name:"flags_"+e,type:"USHORT",value:0}],i=0;i<t.length;++i){var u=t[i].tag;s.push({name:"axis_"+e+" "+u,type:"FIXED",value:r.coordinates[u]<<16})}return s}function qo(e,r,t,n){var a={},s=new k.Parser(e,r);a.name=n[s.parseUShort()]||{},s.skip("uShort",1),a.coordinates={};for(var i=0;i<t.length;++i)a.coordinates[t[i].tag]=s.parseFixed();return a}function Xo(e,r){var t=new S.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(zo(n,e.axes[n],r));for(var a=0;a<e.instances.length;a++)t.fields=t.fields.concat(Vo(a,e.instances[a],e.axes,r));return t}function Yo(e,r,t){var n=new k.Parser(e,r),a=n.parseULong();E.argument(a===65536,"Unsupported fvar table version.");var s=n.parseOffset16();n.skip("uShort",1);for(var i=n.parseUShort(),u=n.parseUShort(),o=n.parseUShort(),l=n.parseUShort(),f=[],p=0;p<i;p++)f.push(_o(e,r+s+p*u,t));for(var c=[],h=r+s+i*u,d=0;d<o;d++)c.push(qo(e,h+d*l,f,t));return{axes:f,instances:c}}var $o={make:Xo,parse:Yo},Zo=function(){return{coverage:this.parsePointer(v.coverage),attachPoints:this.parseList(v.pointer(v.uShortList))}},Qo=function(){var e=this.parseUShort();if(E.argument(e===1||e===2||e===3,"Unsupported CaretValue table version."),e===1)return{coordinate:this.parseShort()};if(e===2)return{pointindex:this.parseShort()};if(e===3)return{coordinate:this.parseShort()}},Ko=function(){return this.parseList(v.pointer(Qo))},jo=function(){return{coverage:this.parsePointer(v.coverage),ligGlyphs:this.parseList(v.pointer(Ko))}},Jo=function(){return this.parseUShort(),this.parseList(v.pointer(v.coverage))};function eu(e,r){r=r||0;var t=new v(e,r),n=t.parseVersion(1);E.argument(n===1||n===1.2||n===1.3,"Unsupported GDEF table version.");var a={version:n,classDef:t.parsePointer(v.classDef),attachList:t.parsePointer(Zo),ligCaretList:t.parsePointer(jo),markAttachClassDef:t.parsePointer(v.classDef)};return n>=1.2&&(a.markGlyphSets=t.parsePointer(Jo)),a}var ru={parse:eu},te=new Array(10);te[1]=function(){var r=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{posFormat:1,coverage:this.parsePointer(v.coverage),value:this.parseValueRecord()};if(t===2)return{posFormat:2,coverage:this.parsePointer(v.coverage),values:this.parseValueRecordList()};E.assert(!1,"0x"+r.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")};te[2]=function(){var r=this.offset+this.relativeOffset,t=this.parseUShort();E.assert(t===1||t===2,"0x"+r.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");var n=this.parsePointer(v.coverage),a=this.parseUShort(),s=this.parseUShort();if(t===1)return{posFormat:t,coverage:n,valueFormat1:a,valueFormat2:s,pairSets:this.parseList(v.pointer(v.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(a),value2:this.parseValueRecord(s)}})))};if(t===2){var i=this.parsePointer(v.classDef),u=this.parsePointer(v.classDef),o=this.parseUShort(),l=this.parseUShort();return{posFormat:t,coverage:n,valueFormat1:a,valueFormat2:s,classDef1:i,classDef2:u,class1Count:o,class2Count:l,classRecords:this.parseList(o,v.list(l,function(){return{value1:this.parseValueRecord(a),value2:this.parseValueRecord(s)}}))}}};te[3]=function(){return{error:"GPOS Lookup 3 not supported"}};te[4]=function(){return{error:"GPOS Lookup 4 not supported"}};te[5]=function(){return{error:"GPOS Lookup 5 not supported"}};te[6]=function(){return{error:"GPOS Lookup 6 not supported"}};te[7]=function(){return{error:"GPOS Lookup 7 not supported"}};te[8]=function(){return{error:"GPOS Lookup 8 not supported"}};te[9]=function(){return{error:"GPOS Lookup 9 not supported"}};function tu(e,r){r=r||0;var t=new v(e,r),n=t.parseVersion(1);return E.argument(n===1||n===1.1,"Unsupported GPOS table version "+n),n===1?{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(te)}:{version:n,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(te),variations:t.parseFeatureVariationsList()}}var nu=new Array(10);function au(e){return new S.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new S.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new S.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new S.LookupList(e.lookups,nu)}])}var su={parse:tu,make:au};function iu(e){var r={};e.skip("uShort");var t=e.parseUShort();E.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 s=e.parseUShort(),i=e.parseUShort(),u=e.parseShort();r[s+","+i]=u}return r}function ou(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 s=e.parseUShort();e.skip("uShort",3);for(var i=0;i<s;i+=1){var u=e.parseUShort(),o=e.parseUShort(),l=e.parseShort();r[u+","+o]=l}}return r}function uu(e,r){var t=new k.Parser(e,r),n=t.parseUShort();if(n===0)return iu(t);if(n===1)return ou(t);throw new Error("Unsupported kern table version ("+n+").")}var lu={parse:uu};function fu(e,r,t,n){for(var a=new k.Parser(e,r),s=n?a.parseUShort:a.parseULong,i=[],u=0;u<t+1;u+=1){var o=s.call(a);n&&(o*=2),i.push(o)}return i}var cu={parse:fu};function pu(e,r){var t=require("fs");t.readFile(e,function(n,a){if(n)return r(n.message);r(null,Tn(a))})}function hu(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 It(e,r){for(var t=[],n=12,a=0;a<r;a+=1){var s=k.getTag(e,n),i=k.getULong(e,n+4),u=k.getULong(e,n+8),o=k.getULong(e,n+12);t.push({tag:s,checksum:i,offset:u,length:o,compression:!1}),n+=16}return t}function vu(e,r){for(var t=[],n=44,a=0;a<r;a+=1){var s=k.getTag(e,n),i=k.getULong(e,n+4),u=k.getULong(e,n+8),o=k.getULong(e,n+12),l=void 0;u<o?l="WOFF":l=!1,t.push({tag:s,offset:i,compression:l,compressedLength:u,length:o}),n+=20}return t}function H(e,r){if(r.compression==="WOFF"){var t=new Uint8Array(e.buffer,r.offset+2,r.compressedLength-2),n=new Uint8Array(r.length);if(aa(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 Zr(e,r){r=r??{};var t,n,a=new M({empty:!0}),s=new DataView(e,0),i,u=[],o=k.getTag(s,0);if(o==="\0\0\0"||o==="true"||o==="typ1")a.outlinesFormat="truetype",i=k.getUShort(s,4),u=It(s,i);else if(o==="OTTO")a.outlinesFormat="cff",i=k.getUShort(s,4),u=It(s,i);else if(o==="wOFF"){var l=k.getTag(s,4);if(l==="\0\0\0")a.outlinesFormat="truetype";else if(l==="OTTO")a.outlinesFormat="cff";else throw new Error("Unsupported OpenType flavor "+o);i=k.getUShort(s,12),u=vu(s,i)}else throw new Error("Unsupported OpenType signature "+o);for(var f,p,c,h,d,g,m,y,F,x,R,w,D=0;D<i;D+=1){var C=u[D],U=void 0;switch(C.tag){case"cmap":U=H(s,C),a.tables.cmap=Zt.parse(U.data,U.offset),a.encoding=new Kt(a.tables.cmap);break;case"cvt ":U=H(s,C),w=new k.Parser(U.data,U.offset),a.tables.cvt=w.parseShortList(C.length/2);break;case"fvar":p=C;break;case"fpgm":U=H(s,C),w=new k.Parser(U.data,U.offset),a.tables.fpgm=w.parseByteList(C.length);break;case"head":U=H(s,C),a.tables.head=un.parse(U.data,U.offset),a.unitsPerEm=a.tables.head.unitsPerEm,t=a.tables.head.indexToLocFormat;break;case"hhea":U=H(s,C),a.tables.hhea=ln.parse(U.data,U.offset),a.ascender=a.tables.hhea.ascender,a.descender=a.tables.hhea.descender,a.numberOfHMetrics=a.tables.hhea.numberOfHMetrics;break;case"hmtx":m=C;break;case"ltag":U=H(s,C),n=cn.parse(U.data,U.offset);break;case"maxp":U=H(s,C),a.tables.maxp=pn.parse(U.data,U.offset),a.numGlyphs=a.tables.maxp.numGlyphs;break;case"name":x=C;break;case"OS/2":U=H(s,C),a.tables.os2=Br.parse(U.data,U.offset);break;case"post":U=H(s,C),a.tables.post=yn.parse(U.data,U.offset),a.glyphNames=new zr(a.tables.post);break;case"prep":U=H(s,C),w=new k.Parser(U.data,U.offset),a.tables.prep=w.parseByteList(C.length);break;case"glyf":c=C;break;case"loca":F=C;break;case"CFF ":f=C;break;case"kern":y=C;break;case"GDEF":h=C;break;case"GPOS":d=C;break;case"GSUB":g=C;break;case"meta":R=C;break}}var O=H(s,x);if(a.tables.name=mn.parse(O.data,O.offset,n),a.names=a.tables.name,c&&F){var I=t===0,A=H(s,F),X=cu.parse(A.data,A.offset,a.numGlyphs,I),Q=H(s,c);a.glyphs=Cn.parse(Q.data,Q.offset,X,a,r)}else if(f){var G=H(s,f);on.parse(G.data,G.offset,a,r)}else throw new Error("Font doesn't contain TrueType or CFF outlines.");var W=H(s,m);if(fn.parse(a,W.data,W.offset,a.numberOfHMetrics,a.numGlyphs,a.glyphs,r),Ua(a,r),y){var Y=H(s,y);a.kerningPairs=lu.parse(Y.data,Y.offset)}else a.kerningPairs={};if(h){var z=H(s,h);a.tables.gdef=ru.parse(z.data,z.offset)}if(d){var P=H(s,d);a.tables.gpos=su.parse(P.data,P.offset),a.position.init()}if(g){var _=H(s,g);a.tables.gsub=xn.parse(_.data,_.offset)}if(p){var $=H(s,p);a.tables.fvar=$o.parse($.data,$.offset,a.names)}if(R){var B=H(s,R);a.tables.meta=bn.parse(B.data,B.offset),a.metas=a.tables.meta}return a}function du(e,r,t){t=t??{};var n=typeof window>"u",a=n&&!t.isUrl?pu:hu;return new Promise(function(s,i){a(e,function(u,o){if(u){if(r)return r(u);i(u)}var l;try{l=Zr(o,t)}catch(f){if(r)return r(f,null);i(f)}if(r)return r(null,l);s(l)})})}function gu(e,r){var t=require("fs"),n=t.readFileSync(e);return Zr(Tn(n),r)}var mu=Object.freeze({__proto__:null,Font:M,Glyph:K,Path:q,BoundingBox:he,_parse:k,parse:Zr,load:du,loadSync:gu});function yu(e,r){const t={svgGlyphs:r};return new Proxy(e,{get(n,a,s){if(a in t)return t[a];const i=Reflect.get(n,a,s);return typeof i=="function"?i.bind(n):i},has(n,a){return a in t||Reflect.has(n,a)},set(n,a,s){return a==="svgGlyphs"?(t.svgGlyphs=s,!0):!1}})}const Ir=new Map,xu=()=>Ir,Mn=async(e,r=!1)=>{const t=Ir.get(e);if(t){if(r&&!t.svgGlyphs){const o=await fetch(e);if(!o.ok)throw new Error(`Failed to load font from ${e}: ${o.status} ${o.statusText}`);const l=await o.arrayBuffer(),{extractSVGGlyphs:f}=await Promise.resolve().then(()=>require("../index-BFEQ7yc6.cjs"));t.svgGlyphs=await f(l)}return t}const n=await fetch(e);if(!n.ok)throw new Error(`Failed to load font from ${e}: ${n.status} ${n.statusText}`);const a=await n.arrayBuffer(),s=mu.parse(a);let i;if(r){const{extractSVGGlyphs:o}=await Promise.resolve().then(()=>require("../index-BFEQ7yc6.cjs"));i=await o(a)}const u=yu(s,i);return Ir.set(e,u),u},In=.03125,Qr=1.1,bu=.2,De={outlineWidth:In,letterSpacing:0,letterSpacingOutline:0};class fe{constructor(r,t){this.x=r,this.y=t}get X(){return this.x}get Y(){return this.y}toSVGString(){return`${this.x} ${this.y}`}}function Su(e,r,t=new fe(0,0)){const n=e.X-t.X,a=e.Y-t.Y,s=r/180*Math.PI,i=Math.cos(s),u=Math.sin(s),o=n*i-a*u,l=n*u+a*i;return new fe(o+t.X,l+t.Y)}const Pn=e=>e===void 0||e==="flat"?{type:"flat"}:e==="curved"?{type:"curved"}:e,Gn=e=>{if(!e||!e.trim())throw new Error("Custom baseline path must be a non-empty SVG path string");if(!e.trim().startsWith("M"))throw new Error("Custom baseline path must start with an M (moveto) command")},Nn=({boxDimensions:e,totalTextHeight:r,baseline:t,lineHeight:n,verticalAlignment:a="centre",lineNumber:s=0})=>{const{width:i,height:u}=e,o=n-t;let l=t;switch(a){case"centre":{l=(u-r)/2+n-o;break}case"bottom":{l=u-r+n-o;break}}return l+=s*(n*Qr),`M 0 ${l} L ${i} ${l}`},Kr=({boxDimensions:e,baseline:r,textHeight:t,verticalAlignment:n})=>{const{width:a,height:s}=e,i=t*bu,u=t+i,o=n==="top"?0:s/2-u/2,l=r+o,f=l+i;if(n!=="top"&&(f>s||l-t<0))return Kr({boxDimensions:e,baseline:r,textHeight:t,verticalAlignment:"top"});const p=t/4,c=new fe(p,f),h=new fe(a/2,l),d=new fe(a-p,f),g=a*.2,m=new fe(g,r+o),y=new fe(a-g,r+o),F=`M ${c.toSVGString()}`,x=`Q ${m.toSVGString()} ${h.toSVGString()}`,R=`Q ${y.toSVGString()} ${d.toSVGString()}`;return`${F} ${x} ${R}`},Tu=e=>{const r=["I","l","1"];for(const t of r){const n=e.charToGlyph(t);if(n&&n.name!==".notdef")return t}return console.error('No standard character found for fixed height calculation. Using "I" as default.'),"I"},Fr=100,Hn=({font:e,boxDimensions:r,physicalSize:t,spacing:n=De})=>{const a=t;if(a[1]!==r.physicalUnits)throw new Error(`Mismatched units between physicalFontSize (${a[1]}) and boxDimensions (${r.physicalUnits})`);const{outlineWidth:s}=n,i=Tu(e),o=e.getPath(i,0,0,Fr).getBoundingBox();let l=o.y2-o.y1;if(s>0){const d=Fr*s;l+=d*2}const p=l/r.height*r.physicalHeight,c=a[0]/p;return Fr*c},Wn=({font:e,text:r,fontSize:t,spacing:n=De})=>{const{outlineWidth:a,letterSpacing:s,letterSpacingOutline:i}=n,o=e.getPath(r,0,0,t).getBoundingBox(),l=a?t*a*2:0,f=a>0?i:s,p=r.length>1?f*t*(r.length-1):0,c=o.x2-o.x1+l+p,h=o.y2-o.y1+l,d=o.y1*-1+l/2;return{width:c,height:h,baseline:d}},cr=Zn.DOMParser,ku=Qn,Fu=()=>new cr().parseFromString("<svg></svg>","image/svg+xml"),Uu=Fu();Uu.readyState="complete";const Cu={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},wu=e=>{let r=Array.from(e),t=!1;return r[0]==="#"&&(r.shift(),t=!0),r.length===3&&(r=r.map(n=>`${n}${n}`)),`${t?"#":""}${r.join("").toLowerCase()}`},Ur=e=>{const r=typeof e=="string"?Number.parseInt(e,10):e;return Math.max(0,Math.min(255,Math.round(r))).toString(16).padStart(2,"0")},Pt=(...e)=>{const[r,t,n]=Array.isArray(e[0])?e[0]:e;return`#${Ur(r)}${Ur(t)}${Ur(n)}`},Eu=(e,r,t)=>{if(r===0){const f=Math.round(t*255);return[f,f,f]}const n=(e%360+360)%360,a=(1-Math.abs(2*t-1))*r,s=a*(1-Math.abs(n/60%2-1)),i=t-a/2;let u=0,o=0,l=0;return n<60?(u=a,o=s,l=0):n<120?(u=s,o=a,l=0):n<180?(u=0,o=a,l=s):n<240?(u=0,o=s,l=a):n<300?(u=s,o=0,l=a):(u=a,o=0,l=s),[Math.round((u+i)*255),Math.round((o+i)*255),Math.round((l+i)*255)]},Ou=e=>/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e),zn=e=>{const r=e.trim().toLowerCase();if(r.startsWith("#")||/^[0-9a-f]{3}([0-9a-f]{3})?$/.test(r))return Ou(r)?wu(r):void 0;if(r.startsWith("rgb")){const n=r.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*[\d.]+\s*)?\)/);return n?Pt(Number.parseInt(n[1],10),Number.parseInt(n[2],10),Number.parseInt(n[3],10)):void 0}if(r.startsWith("hsl")){const n=r.match(/hsla?\(\s*(\d+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*[\d.]+\s*)?\)/);if(!n)return;const a=Number.parseInt(n[1],10),s=Number.parseFloat(n[2])/100,i=Number.parseFloat(n[3])/100,[u,o,l]=Eu(a,s,i);return Pt(u,o,l)}const t=Cu[r];if(t)return t},me={circle:"circle",ellipse:"ellipse",rect:"rect",line:"line",path:"path",polygon:"polygon",polyline:"polyline",stop:"stop"},ur={fill:"fill",stroke:"stroke"},Lu={tiling:[me.circle,me.ellipse,me.rect,me.line,me.path,me.polygon,me.polyline,me.stop,`[${ur.fill}]`,`[${ur.stroke}]`]},Ru=e=>Array.from(e.querySelectorAll(Lu.tiling.map(r=>`*:not(clipPath) > ${r}`).join(", "))),Du=e=>{const r=e.getAttribute(ur.stroke);return r==="none"||!r?!1:r},Cr=e=>{if(!(e==="none"||e==="transparent"||e.startsWith("url(")))return zn(e)},Au=e=>{const r=Ru(e).reduce((t,n)=>{const a=n.getAttribute("stop-color"),s=n.getAttribute(ur.fill)||"#000",i=Du(n);if(!a){const u=Cr(s);u&&t.add(u)}if(a){const u=Cr(a);u&&t.add(u)}if(i){const u=Cr(i);u&&t.add(u)}return t},new Set);return Array.from(r)},Bu=e=>{const r=new cr().parseFromString(e,"image/svg+xml").querySelector("svg");return r?Au(r):[]};function _n(e){const r=e.trim(),t=r.startsWith("<svg")||r.startsWith("<?xml"),n=t?r:`<svg>${r}</svg>`;return{doc:new cr().parseFromString(n,"image/svg+xml"),wasWrapped:!t}}function Vn(e,r){const t=e.querySelector("svg");return t?r?t.innerHTML:t.outerHTML:""}function Mu(e){const{svgGlyphs:r}=e;if(!r||r.size===0)return[];const t=new Set;for(const[,n]of r)for(const a of Bu(n.svg))t.add(a);return Array.from(t)}function Iu(e){return!!e&&e!=="none"&&e!=="transparent"&&!e.startsWith("url(")}function Pu(e){const t=new cr().parseFromString(e,"image/svg+xml").querySelector("svg");return t?t.innerHTML.trim():""}const Gu=["fill","stroke","clip-path","mask","filter"];function Nu(e,r){const{doc:t,wasWrapped:n}=_n(e),a=new Map;for(const s of t.querySelectorAll("[id]")){const i=s.getAttribute("id");if(!i)continue;const u=`${r}-${i}`;a.set(i,u),s.setAttribute("id",u)}if(a.size===0)return e;for(const s of Gu)for(const i of t.querySelectorAll(`[${s}]`)){const u=i.getAttribute(s);if(u){const o=u.replace(/url\(#([^)]+)\)/g,(l,f)=>{const p=a.get(f);return p?`url(#${p})`:`url(#${f})`});o!==u&&i.setAttribute(s,o)}}for(const s of t.querySelectorAll("[href], [xlink\\:href]"))for(const i of["href","xlink:href"]){const u=s.getAttribute(i);if(u?.startsWith("#")){const o=u.slice(1),l=a.get(o);l&&s.setAttribute(i,`#${l}`)}}return Vn(t,n)}const Hu=["fill","stroke","stop-color"],Wu=["path","rect","circle","ellipse","polygon","polyline","text"];function zu(e,r){const{doc:t,wasWrapped:n}=_n(e);for(const s of Hu)for(const i of t.querySelectorAll(`[${s}]`)){const u=i.getAttribute(s);if(!u||!Iu(u))continue;const o=zn(u),l=o?r[o]:void 0;l&&i.setAttribute(s,l.hex)}const a=r["#000000"];if(a){const s=Wu.map(i=>`${i}:not([fill])`).join(", ");for(const i of t.querySelectorAll(s))i.setAttribute("fill",a.hex)}return Vn(t,n)}const _u=(e=[1,0,0,1,0,0])=>{const r=`matrix(${e.join(",")})`,t=new ku(r);if(!t)throw new Error("Your browser does not support matrices");return t};function Vu(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const Gt=(e,r,t)=>e/t*r,qu=({font:e,baselinePath:r,text:t,fontSize:n,spacing:a=De,horizontalAlignment:s="centre",colourMap:i})=>{const{outlineWidth:u,letterSpacing:o,letterSpacingOutline:l}=a,f=new $n.svgPathProperties(r),p=u?n*u*2:0,c=f.getTotalLength(),h=e.getPaths(t,0,0,n,{drawSVG:!1}),g=e.getPath(t,0,0,n,{drawSVG:!1}).getBoundingBox(),m=g.x1-p/2,F=g.x2+p/2-m,x=u>0?l:o;let R=x?x*n:0;s==="distributed"&&(R=t.length===1?0:(c-F)/(t.length-1));const w=R*(t.length-1),D=F+w;let C=0-m;s==="centre"?C=(c-D)/2-m:s==="right"&&(C=c-F-m-w);const U=[];for(let O=0;O<h.length;O++){const I=h[O],A=I.getBoundingBox(),X=e.charToGlyph(t[O]),{advanceWidth:Q}=X;if(!Q)throw new Error(`No advance width for character: ${t[O]} in font ${e.names.fontFamily}`);const{x1:G,x2:W}=X.getBoundingBox(),Y=Gt(Q,n,e.unitsPerEm),z=Gt(W-G,n,e.unitsPerEm);let P=C+A.x1;if(O>0&&(P+=R*O),P+z>c)throw new Error(`TOO_WIDE: character "${t[O]}" at index ${O} exceeds baseline path length (${Math.round(P+z)} > ${Math.round(c)})`);const _=P+Y/2,$=f.getTangentAtLength(_),B=Math.atan2($.y,$.x)*180/Math.PI,V=f.getPointAtLength(P),Ae=V.x,pr=V.y,Be=A.x2-A.x1,Me=new fe(A.x1+Be/2,0),Ie=Su(new fe(A.x1,0),B,Me),Ce=Ae-Ie.X,Xn=pr-Ie.Y;let se=_u();se=se.translate(Ce,Xn),B&&(se=se.translate(A.x1+Be/2,0),se=se.rotate(B),se=se.translate(-A.x1-Be/2,0));const Yn=se.toString();let ve=I.toPathData(2);ve.length&&!ve.endsWith("Z")&&(ve+="Z",ve=ve.replace(/M/g,"ZM"),ve=ve.substring(1));let hr;if(e.svgGlyphs){const vr=e.svgGlyphs.get(X.index);if(vr){let Pe=Pu(vr.svg);Pe=Nu(Pe,`g${X.index}-${O}`),i&&(Pe=zu(Pe,i)),hr={content:Pe,viewBox:vr.viewbox,x:A.x1,y:A.y1,width:A.x2-A.x1,height:A.y2-A.y1,glyphIndex:X.index}}}U.push({path:I,matrix:se,attributes:{d:ve,"data-character":Vu(t[O]),transform:Yn},glyphData:{index:X.index,bbox:A},...hr?{svgGlyph:hr}:{}})}return U},Nt={hex:"#FFFFFF"},Pr=(e,r)=>{const t=`data-${e}-colour-url`,n=[`${e}="${r.hex}"`];return r.reference&&n.push(`${t}="${r.reference}"`),n.join(" ")},Ht=(e,r)=>{const{attributes:t,svgGlyph:n}=e;return n?`<g transform="${t.transform}" data-character="${t["data-character"]}"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="${n.viewBox}" width="${n.width}" height="${n.height}" x="${n.x}" y="${n.y}" data-glyph-index="${n.glyphIndex}">${n.content}</svg></g>`:`<path d="${t.d}" ${Pr("fill",r)} transform="${t.transform}" data-character="${t["data-character"]}"/>`},Xu=({boxDimensions:e,paths:r,spacing:t=De,fontSize:n=0,fillColour:a=Nt,strokeColour:s=Nt})=>{const{width:i,height:u}=e,{outlineWidth:o}=t,l=o>0&&n>0;let f;if(l){const c=n*o*2,h=r.filter(g=>!g.svgGlyph).map(({attributes:g})=>`<path d="${g.d}" ${Pr("fill",s)} ${Pr("stroke",s)} stroke-width="${c}" stroke-linejoin="round" transform="${g.transform}" data-character="${g["data-character"]}"/>`).join(`
|
|
2
2
|
`),d=r.map(g=>Ht(g,a)).join(`
|
|
3
3
|
`);f=`${h}
|
|
4
4
|
${d}`}else f=r.map(c=>Ht(c,a)).join(`
|
|
5
5
|
`);const p=f?`
|
|
6
6
|
${f}
|
|
7
|
-
`:"";return`<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${u}" viewBox="0 0 ${i} ${u}">${p}</svg>`},qn=e=>{const{text:r,font:t,physicalSize:n,boxDimensions:a,spacing:s=De,verticalAlignment:i="centre",baseline:u="flat",horizontalAlignment:o="left",fillColour:l={hex:"#FFFFFF"},strokeColour:f={hex:"#FFFFFF"},colourMap:p}=e,{width:c,height:h,physicalWidth:d,physicalHeight:g}=a;if(c<=0||h<=0)throw new Error(`boxDimensions width and height must be positive (got ${c}x${h})`);if(d<=0||g<=0)throw new Error(`boxDimensions physicalWidth and physicalHeight must be positive (got ${d}x${g})`);if(n[0]<=0)throw new Error(`physicalSize height must be positive (got ${n[0]})`);const m=Hn({font:t,boxDimensions:a,physicalSize:n,spacing:s}),y=Pn(u);let
|
|
8
|
-
`).filter(
|
|
7
|
+
`:"";return`<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${u}" viewBox="0 0 ${i} ${u}">${p}</svg>`},qn=e=>{const{text:r,font:t,physicalSize:n,boxDimensions:a,spacing:s=De,verticalAlignment:i="centre",baseline:u="flat",horizontalAlignment:o="left",fillColour:l={hex:"#FFFFFF"},strokeColour:f={hex:"#FFFFFF"},colourMap:p}=e,{width:c,height:h,physicalWidth:d,physicalHeight:g}=a;if(c<=0||h<=0)throw new Error(`boxDimensions width and height must be positive (got ${c}x${h})`);if(d<=0||g<=0)throw new Error(`boxDimensions physicalWidth and physicalHeight must be positive (got ${d}x${g})`);if(n[0]<=0)throw new Error(`physicalSize height must be positive (got ${n[0]})`);const m=Hn({font:t,boxDimensions:a,physicalSize:n,spacing:s}),y=Pn(u);let F=r.split(`
|
|
8
|
+
`).filter(O=>O.length>0);F.length||(F=[""]),(y.type==="curved"||y.type==="custom")&&(F=[F.join("")]);const x=F.map(O=>Wn({font:t,text:O,fontSize:m,spacing:s})),R=Math.max(...x.map(O=>O.baseline)),w=Math.max(...x.map(O=>O.height-O.baseline)),D=R+w,C=F.length===1?D:D+D*(F.length-1)*Qr,U=[];for(let O=0;O<F.length;O++){let I;switch(y.type){case"custom":Gn(y.path),I=y.path;break;case"curved":I=Kr({boxDimensions:a,baseline:x[O].baseline,textHeight:x[O].height,verticalAlignment:i});break;case"flat":I=Nn({boxDimensions:a,totalTextHeight:C,baseline:R,lineHeight:D,verticalAlignment:i,lineNumber:O});break}const A=qu({font:t,baselinePath:I,text:F[O],fontSize:m,spacing:s,horizontalAlignment:o,colourMap:p});U.push(...A)}return Xu({boxDimensions:a,paths:U,spacing:s,fontSize:m,fillColour:l,strokeColour:f})},Yu=async e=>{const{fontUrl:r,...t}=e,n=!!t.colourMap,a=await Mn(r,n);return qn({...t,font:a})};exports.DEFAULT_OUTLINE_FACTOR=In;exports.DEFAULT_SPACING=De;exports.LINE_HEIGHT=Qr;exports.generateCurvedBaseline=Kr;exports.generateFlatBaseline=Nn;exports.getFontCache=xu;exports.getFontColours=Mu;exports.getFontSizeFromPhysicalSize=Hn;exports.getRenderedText=Yu;exports.getTextMetricsAtFontSize=Wn;exports.loadOpentypeFont=Mn;exports.normaliseBaselineOption=Pn;exports.renderText=qn;exports.validateCustomBaselinePath=Gn;
|