UNPKG

@daiyam/xterm-tab-addon-ligatures

Version:

Add support for programming ligatures to xterm.js

2 lines 197 kB
/*! For license information please see addon-ligatures.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.LigaturesAddon=t():e.LigaturesAddon=t()}(globalThis,(()=>(()=>{var e={522:(e,t)=>{"use strict";function n(e){const t={};for(const[n,o]of Object.entries(e.individual))t[n]=s(o);for(const{range:n,entry:o}of e.range){const e=s(o);for(let s=n[0];s<n[1];s++)t[s]=e}return t}function s(e){const t={};return e.forward&&(t.forward=n(e.forward)),e.reverse&&(t.reverse=n(e.reverse)),e.lookup&&(t.lookup=e.lookup),t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},768:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(386),o=n(749),r=n(68),a=n(503),i=n(123),l=n(664),u=n(697),c=n(634),p=n(842),f=n(522);class h{constructor(e,t){this._lookupTrees=[],this._glyphLookups={},this._font=e,t.cacheSize>0&&(this._cache=new o({max:t.cacheSize,length:(e,t)=>t.length}));const n=(this._font.tables.gsub&&this._font.tables.gsub.features.filter((e=>"calt"===e.tag))||[]).reduce(((e,t)=>[...e,...t.feature.lookupListIndexes]),[]),s=this._font.tables.gsub&&this._font.tables.gsub.lookups||[],a=s.filter(((e,t)=>n.some((e=>e===t))));for(const[e,t]of a.entries()){const n=[];switch(t.lookupType){case 6:for(const[e,o]of t.subtables.entries())switch(o.substFormat){case 1:n.push(l.default(o,s,e));break;case 2:n.push(u.default(o,s,e));break;case 3:n.push(c.default(o,s,e))}break;case 8:for(const[e,s]of t.subtables.entries())n.push(p.default(s,e))}const o=f.default(r.default(n));this._lookupTrees.push({tree:o,processForward:8!==t.lookupType});for(const t of Object.keys(o))this._glyphLookups[t]||(this._glyphLookups[t]=[]),this._glyphLookups[t].push(e)}}findLigatures(e){const t=this._cache&&this._cache.get(e);if(t&&!Array.isArray(t))return t;const n=[];for(const t of e)n.push(this._font.charToGlyphIndex(t));if(0===this._lookupTrees.length)return{inputGlyphs:n,outputGlyphs:n,contextRanges:[]};const s=this._findInternal(n.slice()),o={inputGlyphs:n,outputGlyphs:s.sequence,contextRanges:s.ranges};return this._cache&&this._cache.set(e,o),o}findLigatureRanges(e){if(0===this._lookupTrees.length)return[];const t=this._cache&&this._cache.get(e);if(t)return Array.isArray(t)?t:t.contextRanges;const n=[];for(const t of e)n.push(this._font.charToGlyphIndex(t));const s=this._findInternal(n);return this._cache&&this._cache.set(e,s.ranges),s.ranges}_findInternal(e){const t=[];let n=this._getNextLookup(e,0);for(;null!==n.index;){const s=this._lookupTrees[n.index];if(s.processForward){let o=n.last;for(let r=n.first;r<o;r++){const n=a.default(s.tree,e,r,r);if(n){for(let t=0;t<n.substitutions.length;t++){const s=n.substitutions[t];null!==s&&(e[r+t]=s)}i.default(t,n.contextRange[0]+r,n.contextRange[1]+r),r+n.length>=o&&(o=r+n.length+1),r+=n.length-1}}}else for(let o=n.last-1;o>=n.first;o--){const n=a.default(s.tree,e,o,o);if(n){for(let t=0;t<n.substitutions.length;t++){const s=n.substitutions[t];null!==s&&(e[o+t]=s)}i.default(t,n.contextRange[0]+o,n.contextRange[1]+o),o-=n.length-1}}n=this._getNextLookup(e,n.index+1)}return{sequence:e,ranges:t}}_getNextLookup(e,t){const n={index:null,first:1/0,last:-1};for(let s=0;s<e.length;s++){const o=this._glyphLookups[e[s]];if(o)for(let e=0;e<o.length;e++){const r=o[e];if(r>=t){(null===n.index||r<=n.index)&&(n.index=r,n.first>s&&(n.first=s),n.last=s+1);break}}}return n}}async function d(e,t){const o=await Promise.resolve().then((()=>n(460))).then((t=>t.promisify(s.load)(e)));return new h(o,Object.assign({cacheSize:0},t))}t.load=async function(e,t){const[s]=await Promise.resolve().then((()=>n(734))).then((t=>t.listVariants(e)));if(!s)throw new Error(`Font ${e} not found`);return d(s.path,t)},t.loadFile=d,t.loadBuffer=function(e,t){const n=s.parse(e);return new h(n,Object.assign({cacheSize:0},t))}},68:(e,t)=>{"use strict";function n(e,t){for(const[n,o]of Object.entries(t.individual))if(e.individual[n])s(e.individual[n],o);else{let t=!1;for(const[a,{range:l,entry:u}]of e.range.entries()){const c=r(Number(n),l);if(null!==c.both){t=!0,e.individual[n]=o,s(e.individual[n],i(u)),e.range.splice(a,1);for(const t of c.second)Array.isArray(t)?e.range.push({range:t,entry:i(u)}):e.individual[t]=i(u)}}t||(e.individual[n]=o)}for(const{range:n,entry:a}of t.range){let t=[n];for(let n=0;n<e.range.length;n++){const{range:l,entry:u}=e.range[n];for(const[c,p]of t.entries()){if(!Array.isArray(p)){const o=r(p,l);if(null===o.both)continue;e.individual[p]=i(a),s(e.individual[p],i(u)),e.range.splice(n,1),n--;for(const t of o.second)Array.isArray(t)?e.range.push({range:t,entry:i(u)}):e.individual[t]=i(u);t.splice(c,1,...o.first);break}{const r=o(p,l);if(null===r.both)continue;e.range.splice(n,1),n--;const c=i(u);Array.isArray(r.both)?e.range.push({range:r.both,entry:c}):e.individual[r.both]=c,s(c,i(a));for(const t of r.second)Array.isArray(t)?e.range.push({range:t,entry:i(u)}):e.individual[t]=i(u);t=r.first}}}for(const n of Object.keys(e.individual))for(const[o,l]of t.entries()){if(Array.isArray(l)){const u=r(Number(n),l);if(null===u.both)continue;s(e.individual[n],i(a)),t.splice(o,1,...u.second);break}if(Number(n)===l){s(e.individual[n],i(a));break}}for(const n of t)Array.isArray(n)?e.range.push({range:n,entry:i(a)}):e.individual[n]=i(a)}}function s(e,t){t.lookup&&(!e.lookup||e.lookup.index>t.lookup.index||e.lookup.index===t.lookup.index&&e.lookup.subIndex>t.lookup.subIndex)&&(e.lookup=t.lookup),t.forward&&(e.forward?n(e.forward,t.forward):e.forward=t.forward),t.reverse&&(e.reverse?n(e.reverse,t.reverse):e.reverse=t.reverse)}function o(e,t){const n={first:[],second:[],both:null};if(e[0]<t[1]&&t[0]<e[1]){const s=Math.max(e[0],t[0]),o=Math.min(e[1],t[1]);n.both=a(s,o)}if(e[0]<t[0]){const s=e[0],o=Math.min(t[0],e[1]);n.first.push(a(s,o))}else if(t[0]<e[0]){const s=t[0],o=Math.min(t[1],e[0]);n.second.push(a(s,o))}if(e[1]>t[1]){const s=Math.max(e[0],t[1]),o=e[1];n.first.push(a(s,o))}else if(t[1]>e[1]){const s=Math.max(e[1],t[0]),o=t[1];n.second.push(a(s,o))}return n}function r(e,t){if(e<t[0]||e>t[1])return{first:[e],second:[t],both:null};const n={first:[],second:[],both:e};return t[0]<e&&n.second.push(a(t[0],e)),t[1]>e&&n.second.push(a(e+1,t[1])),n}function a(e,t){return t-e==1?e:[e,t]}function i(e){const t={};return e.forward&&(t.forward=l(e.forward)),e.reverse&&(t.reverse=l(e.reverse)),e.lookup&&(t.lookup={contextRange:e.lookup.contextRange.slice(),index:e.lookup.index,length:e.lookup.length,subIndex:e.lookup.subIndex,substitutions:e.lookup.substitutions.slice()}),t}function l(e){const t={};for(const[n,s]of Object.entries(e.individual))t[n]=i(s);return{individual:t,range:e.range.map((({range:e,entry:t})=>({range:e.slice(),entry:i(t)})))}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t={individual:{},range:[]};for(const s of e)n(t,s);return t}},123:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){let s=!1;for(let o=0;o<e.length;o++){const r=e[o];if(s){if(n<=r[0])return e[o-1][1]=n,e;if(n<=r[1])return e[o-1][1]=Math.max(n,r[1]),e.splice(o,1),s=!1,e;e.splice(o,1),o--}else{if(n<=r[0])return e.splice(o,0,[t,n]),e;if(n<=r[1])return r[0]=Math.min(t,r[0]),e;if(!(t<r[1]))continue;r[0]=Math.min(t,r[0]),s=!0}}return s?e[e.length-1][1]=n:e.push([t,n]),e}},664:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(180),o=n(330);t.default=function(e,t,n){const r={individual:{},range:[]},a=s.listGlyphsByIndex(e.coverage);for(const{glyphId:s,index:i}of a){const a=e.chainRuleSets[i];if(a)for(const[e,i]of a.entries()){let a=o.getInputTree(r,i.lookupRecords,t,0,s).map((({entry:e,substitution:t})=>({entry:e,substitutions:[t]})));for(const[e,n]of i.input.entries())a=o.processInputPosition([n],e+1,a,i.lookupRecords,t);for(const e of i.lookahead)a=o.processLookaheadPosition([e],a);for(const e of i.backtrack)a=o.processBacktrackPosition([e],a);for(const{entry:t,substitutions:s}of a)t.lookup={substitutions:s,length:i.input.length+1,index:n,subIndex:e,contextRange:[-1*i.backtrack.length,1+i.input.length+i.lookahead.length]}}}return r}},697:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(68),o=n(180),r=n(477),a=n(330);t.default=function(e,t,n){const i=[],l=o.listGlyphsByIndex(e.coverage);for(const{glyphId:s}of l){const o=r.default(e.inputClassDef,s);for(const[s,l]of o.entries()){if(null===l)continue;const o=e.chainClassSet[l];if(o)for(const[l,u]of o.entries()){const o={individual:{},range:[]};let c=a.getInputTree(o,u.lookupRecords,t,0,s).map((({entry:e,substitution:t})=>({entry:e,substitutions:[t]})));for(const[n,s]of u.input.entries())c=a.processInputPosition(r.listClassGlyphs(e.inputClassDef,s),n+1,c,u.lookupRecords,t);for(const t of u.lookahead)c=a.processLookaheadPosition(r.listClassGlyphs(e.lookaheadClassDef,t),c);for(const t of u.backtrack)c=a.processBacktrackPosition(r.listClassGlyphs(e.backtrackClassDef,t),c);for(const{entry:e,substitutions:t}of c)e.lookup={substitutions:t,index:n,subIndex:l,length:u.input.length+1,contextRange:[-1*u.backtrack.length,1+u.input.length+u.lookahead.length]};i.push(o)}}}return s.default(i)}},634:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(180),o=n(330);t.default=function(e,t,n){const r={individual:{},range:[]},a=s.listGlyphsByIndex(e.inputCoverage[0]);for(const{glyphId:i}of a){let a=o.getInputTree(r,e.lookupRecords,t,0,i).map((({entry:e,substitution:t})=>({entry:e,substitutions:[t]})));for(const[n,r]of e.inputCoverage.slice(1).entries())a=o.processInputPosition(s.listGlyphsByIndex(r).map((e=>e.glyphId)),n+1,a,e.lookupRecords,t);for(const t of e.lookaheadCoverage)a=o.processLookaheadPosition(s.listGlyphsByIndex(t).map((e=>e.glyphId)),a);for(const t of e.backtrackCoverage)a=o.processBacktrackPosition(s.listGlyphsByIndex(t).map((e=>e.glyphId)),a);for(const{entry:t,substitutions:s}of a)t.lookup={substitutions:s,index:n,subIndex:0,length:e.inputCoverage.length,contextRange:[-1*e.backtrackCoverage.length,e.inputCoverage.length+e.lookaheadCoverage.length]}}return r}},842:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(180),o=n(330);t.default=function(e,t){const n={individual:{},range:[]},r=s.listGlyphsByIndex(e.coverage);for(const{glyphId:a,index:i}of r){const r={};Array.isArray(a)?n.range.push({entry:r,range:a}):n.individual[a]=r;let l=[{entry:r,substitutions:[e.substitutes[i]]}];for(const t of e.lookaheadCoverage)l=o.processLookaheadPosition(s.listGlyphsByIndex(t).map((e=>e.glyphId)),l);for(const t of e.backtrackCoverage)l=o.processBacktrackPosition(s.listGlyphsByIndex(t).map((e=>e.glyphId)),l);for(const{entry:n,substitutions:s}of l)n.lookup={substitutions:s,index:t,subIndex:0,length:1,contextRange:[-1*e.backtrackCoverage.length,1+e.lookaheadCoverage.length]}}return n}},477:(e,t)=>{"use strict";function n(e,t){for(const n of e.ranges)if(n.start<=t&&n.end>=t)return n.classId;return null}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return 2===e.format?Array.isArray(t)?function(e,t){let s=t[0],o=n(e,s),r=t[0]+1;const a=new Map;for(;r<t[1];)n(e,r)!==o&&(r-s<=1?a.set(s,o):a.set([s,r],o)),r++;return r-s<=1?a.set(s,o):a.set([s,r],o),a}(e,t):new Map([[t,n(e,t)]]):new Map([[t,null]])},t.listClassGlyphs=function(e,t){if(2===e.format){const n=[];for(const s of e.ranges)s.classId===t&&(s.end===s.start?n.push(s.start):n.push([s.start,s.end+1]));return n}return[]}},180:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){switch(e.format){case 1:const n=e.glyphs.indexOf(t);return-1!==n?n:null;case 2:const s=e.ranges.find((e=>e.start<=t&&e.end>=t));return s?s.index:null}},t.listGlyphsByIndex=function(e){switch(e.format){case 1:return e.glyphs.map(((e,t)=>({glyphId:e,index:t})));case 2:let t=[];for(const[n,s]of e.ranges.entries())s.end===s.start?t.push({glyphId:s.start,index:n}):t.push({glyphId:[s.start,s.end+1],index:n});return t}}},330:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(171);function o(e,t,n,o,a){const i=[];if(Array.isArray(a)){const r=function(e,t,n,o){for(const r of e.filter((e=>e.sequenceIndex===n)))for(const e of t[r.lookupListIndex].subtables){const t=s.getRangeSubstitutionGlyphs(e,o);if(!Array.from(t.values()).every((e=>null!==e)))return t}return new Map([[o,null]])}(t,n,o,a);for(const[t,n]of r){const s={};Array.isArray(t)?e.range.push({range:t,entry:s}):e.individual[t]={},i.push({entry:s,substitution:n})}}else e.individual[a]={},i.push({entry:e.individual[a],substitution:r(t,n,o,a)});return i}function r(e,t,n,o){for(const r of e.filter((e=>e.sequenceIndex===n)))for(const e of t[r.lookupListIndex].subtables){const t=s.getIndividualSubstitutionGlyph(e,o);if(null!==t)return t}return null}t.processInputPosition=function(e,t,n,s,r){const a=[];for(const i of n){i.entry.forward={individual:{},range:[]};for(const n of e)a.push(...o(i.entry.forward,s,r,t,n).map((({entry:e,substitution:t})=>({entry:e,substitutions:[...i.substitutions,t]}))))}return a},t.processLookaheadPosition=function(e,t){const n=[];for(const s of t)for(const t of e){const e={};s.entry.forward||(s.entry.forward={individual:{},range:[]}),n.push({entry:e,substitutions:s.substitutions}),Array.isArray(t)?s.entry.forward.range.push({entry:e,range:t}):s.entry.forward.individual[t]=e}return n},t.processBacktrackPosition=function(e,t){const n=[];for(const s of t)for(const t of e){const e={};s.entry.reverse||(s.entry.reverse={individual:{},range:[]}),n.push({entry:e,substitutions:s.substitutions}),Array.isArray(t)?s.entry.reverse.range.push({entry:e,range:t}):s.entry.reverse.individual[t]=e}return n},t.getInputTree=o},171:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(180);function o(e,t){const n=s.default(e.coverage,t);if(null===n)return null;switch(e.substFormat){case 1:return(t+e.deltaGlyphId)%65536;case 2:return null!=e.substitute[n]?e.substitute[n]:null}}t.getRangeSubstitutionGlyphs=function(e,t){let n=t[0],s=o(e,n),r=t[0]+1;const a=new Map;for(;r<t[1];)o(e,r)!==s&&(r-n<=1?a.set(n,s):a.set([n,r],s)),r++;return r-n<=1?a.set(n,s):a.set([n,r],s),a},t.getIndividualSubstitutionGlyph=o},503:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n,s,o){let r=t[n[o]];if(!r)return;let a=r.lookup;if(r.reverse){const e=function(e,t,n){let s=e[t[--n]],o=s&&s.lookup;for(;s&&((!o&&s.lookup||s.lookup&&o&&o.index>s.lookup.index)&&(o=s.lookup),!(--n<0)&&s.reverse);)s=s.reverse[t[n]];return o}(r.reverse,n,s);(!a&&e||e&&a&&(a.index>e.index||a.index===e.index&&a.subIndex>e.subIndex))&&(a=e)}if(++o>=n.length||!r.forward)return a;const i=e(r.forward,n,s,o);return(!a&&i||i&&a&&(a.index>i.index||a.index===i.index&&a.subIndex>i.subIndex))&&(a=i),a}},987:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(486);var o,r;!function(e){e.Serif="serif",e.SansSerif="sansSerif",e.Monospace="monospace",e.Cursive="cursive",e.Unknown="unknown"}(o=t.Type||(t.Type={})),function(e){e.Regular="regular",e.Italic="italic",e.Oblique="oblique",e.Bold="bold",e.BoldItalic="boldItalic",e.BoldOblique="boldOblique",e.Other="other"}(r=t.Style||(t.Style={}));const a=[" Regular"," Bold"," Bold Italic"," Bold Oblique"," Italic"," Oblique"];function i(e){if(!e.os2&&!e.head)return r.Other;const t=e.os2?32&e.os2.fsSelection:1&e.head.macStyle,n=e.os2?1&e.os2.fsSelection:e.post?e.post.italicAngle<0:2&e.head.macStyle,s=e.os2?512&e.os2.fsSelection:e.post?e.post.italicAngle>0:0,o=e.os2?320&e.os2.fsSelection:1;return t?s?r.BoldOblique:n?r.BoldItalic:r.Bold:s?r.Oblique:n?r.Italic:o?r.Regular:r.Other}t.name=function(e,t){const n=e.names.preferredFamily&&e.names.preferredFamily[t]?e.names.preferredFamily[t]:e.names.fontFamily[t];if("win32"===s.platform()){const s=`${n} ${e.names.preferredSubfamily&&e.names.preferredSubfamily[t]?e.names.preferredSubfamily[t]:e.names.fontSubfamily[t]}`;let o=-1;for(const e of a){const t=s.lastIndexOf(e);if(-1!==t){o=t;break}}return-1!==o?s.substring(0,o):s}return n},t.type=function(e){if(e.os2)switch(e.os2.panose[0]){case 2:return 9===e.os2.panose[3]?o.Monospace:e.os2.panose[1]>=11&&e.os2.panose[1]<=15||0===e.os2.panose[1]?o.SansSerif:o.Serif;case 3:return o.Cursive}else if(e.post&&e.post.isFixedPitch)return o.Monospace;return o.Unknown},t.style=i;const l=[r.Bold,r.BoldItalic,r.BoldOblique];t.weight=function(e){return e.os2?e.os2.usWeightClass:l.includes(i(e))?700:400}},734:function(e,t,n){"use strict";var s=this&&this.__rest||function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(e);o<s.length;o++)t.indexOf(s[o])<0&&(n[s[o]]=e[s[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0});const o=n(877),r=n(533),a=n(987);var i=n(987);async function l(e){const t=Object.assign({concurrency:4,language:"en"},e),n=await o.default({extensions:["ttf","otf"]}),a=await async function(e,n,s){const o=[];let a=0;const i=async e=>{o.push(await(async e=>{try{return u(e,await r.default(e),t.language)}catch(e){if(["TypeError","SyntaxError","ReferenceError","RangeError","AssertionError"].includes(e.name))throw e}})(n[e])),a<n.length&&await i(a++)},l=[];for(;a<n.length&&a<s;a++)l.push(i(a));return await Promise.all(l),o}(0,n,t.concurrency),i={};for(let e of a.filter((e=>e))){const{name:t}=e,n=s(e,["name"]);i[t]||(i[t]=[]),i[t].push(n)}return i}function u(e,t,n){return{name:a.name(t,n),path:e,type:a.type(t),weight:a.weight(t),style:a.style(t)}}t.Type=i.Type,t.Style=i.Style,t.list=l,t.listVariants=async function(e,t){return(await l(t))[e]||[]},t.get=async function(e,t){const n=Object.assign({language:"en"},t);return u(e,await r.default(e),n.language)}},533:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(383),o=n(596),r=n(967),a=n(0),i=n(614),l=n(898),u=n(870);var c;!function(e){e[e.TrueType=0]="TrueType",e[e.CFF=1]="CFF",e[e.Woff=2]="Woff"}(c||(c={}));const p={name:{tag:Buffer.from("name"),parse:r.default},ltag:{tag:Buffer.from("ltag"),parse:a.default},os2:{tag:Buffer.from("OS/2"),parse:i.default},head:{tag:Buffer.from("head"),parse:l.default},post:{tag:Buffer.from("post"),parse:u.default}};t.default=async function(e){return new Promise(((t,n)=>{(async()=>{const t=o.default(),r=s.createReadStream(e);let a=!1;const i=()=>{a=!0};r.once("close",i),r.once("end",i),r.once("error",(e=>{a=!0,n(e)})),r.pipe(t);try{switch(function(e){if(e.equals(f.one)||e.equals(f.true)||e.equals(f.typ1))return c.TrueType;if(e.equals(f.otto))return c.CFF;if(e.equals(f.woff))return c.Woff;throw new Error(`Unsupported signature type: ${e}`)}(await t.read(4))){case c.TrueType:case c.CFF:const n=(await t.read(2)).readUInt16BE(0);await t.skip(6);const s=await async function(e,t){const n={};for(let s=0;s<t;s++){const t=await e.read(4),s=await e.read(12);for(const[e,o]of Object.entries(p))if(t.equals(o.tag)&&(n[e]={offset:s.readUInt32BE(4),length:s.readUInt32BE(8)},n.name&&n.ltag&&n.os2))return n}return n}(t,n),o=Object.entries(s).sort(((e,t)=>e[1].offset-t[1].offset)),r={};for(const[e,n]of o)await t.skip(n.offset-t.offset),r[e]=await t.read(n.length);let a=[];if(r.ltag&&(a=p.ltag.parse(r.ltag)),!r.name)throw new Error(`missing required OpenType table 'name' in font file: ${e}`);return{names:p.name.parse(r.name,a),os2:r.os2&&p.os2.parse(r.os2),head:r.head&&p.head.parse(r.head),post:r.post&&p.post.parse(r.post)};case c.Woff:default:throw new Error("provided font type is not supported yet")}}finally{r.unpipe(t),a||(r.destroy(),t.destroy())}})().then(t,n)}))};const f={one:Buffer.from([0,1,0,0]),otto:Buffer.from("OTTO"),true:Buffer.from("true"),typ1:Buffer.from("typ1"),woff:Buffer.from("wOFF")}},898:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(970);t.default=function(e){return{version:s.formatFixed(e.readUInt16BE(0),e.readUInt16BE(2)),fontRevision:s.formatFixed(e.readUInt16BE(4),e.readUInt16BE(6)),checkSumAdjustment:e.readUInt32BE(8),magicNumber:e.readUInt32BE(12),flags:e.readUInt16BE(16),unitsPerEm:e.readUInt16BE(18),created:s.formatLongDateTime(e.readUInt32BE(20),e.readUInt32BE(24)),modified:s.formatLongDateTime(e.readUInt32BE(28),e.readUInt32BE(32)),xMin:e.readInt16BE(36),yMin:e.readInt16BE(38),xMax:e.readInt16BE(40),yMax:e.readInt16BE(42),macStyle:e.readUInt16BE(44),lowestRecPPEM:e.readUInt16BE(46),fontDirectionHint:e.readInt16BE(48),indexToLocFormat:e.readInt16BE(50),glyphDataFormat:e.readInt16BE(52)}}},0:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(1!==e.readUInt32BE(0))throw new Error("Unsupported ltag table version.");const t=e.readUInt32BE(8),n=[];for(let s=0;s<t;s++){let t="";const o=e.readUInt16BE(12+4*s),r=e.readUInt16BE(14+4*s);for(let n=o;n<o+r;++n)t+=String.fromCharCode(e.readInt8(n));n.push(t)}return n}},967:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],s={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"},o={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 r(e,t,n){switch(e){case 0:if(65535===t)return"und";if(n)return n[t];break;case 1:return s[t];case 3:return o[t]}}const a="utf-16",i={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"},l={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 u(e,t,n){switch(e){case 0:return a;case 1:return l[n]||i[t];case 3:if(1===t||10===t)return a}}t.default=function(e,t){const s={},o=e.readUInt16BE(2),i=e.readUInt16BE(4);let l=6;for(let c=0;c<o;c++){const o=e.readUInt16BE(l+0),c=e.readUInt16BE(l+2),f=e.readUInt16BE(l+4),h=e.readUInt16BE(l+6),d=n[h]||String(h),g=e.readUInt16BE(l+8),m=e.readUInt16BE(l+10),y=r(o,f,t),v=u(o,c,f);if(l+=12,void 0!==v&&void 0!==y){let t;if(v===a){const n=g/2,s=Array(n);for(let t=0;t<n;t++)s[t]=e.readUInt16BE(i+m+2*t);t=String.fromCharCode(...s)}else t=p(e,i+m,g,v);if(t){let e=s[d];void 0===e&&(e=s[d]={}),e[y]=t}}}return s};const c={"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":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};function p(e,t,n,s){const o=c[s];if(void 0===o)return;let r="";for(let s=0;s<n;s++){const n=e.readUInt8(t+s);r+=n<=127?String.fromCharCode(n):o[127&n]}return r}},614:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t={version:e.readUInt16BE(0),xAvgCharWidth:e.readUInt16BE(2),usWeightClass:e.readUInt16BE(4),usWidthClass:e.readUInt16BE(6),fsType:e.readUInt16BE(8),ySubscriptXSize:e.readInt16BE(10),ySubscriptYSize:e.readInt16BE(12),ySubscriptXOffset:e.readInt16BE(14),ySubscriptYOffset:e.readInt16BE(16),ySuperscriptXSize:e.readInt16BE(18),ySuperscriptYSize:e.readInt16BE(20),ySuperscriptXOffset:e.readInt16BE(22),ySuperscriptYOffset:e.readInt16BE(24),yStrikeoutSize:e.readInt16BE(26),yStrikeoutPosition:e.readInt16BE(28),sFamilyClass:e.readInt16BE(30),panose:[e.readUInt8(32),e.readUInt8(33),e.readUInt8(34),e.readUInt8(35),e.readUInt8(36),e.readUInt8(37),e.readUInt8(38),e.readUInt8(39),e.readUInt8(40),e.readUInt8(41)],ulUnicodeRange1:e.readUInt32BE(42),ulUnicodeRange2:e.readUInt32BE(46),ulUnicodeRange3:e.readUInt32BE(50),ulUnicodeRange4:e.readUInt32BE(54),achVendID:String.fromCharCode(e.readUInt8(58),e.readUInt8(59),e.readUInt8(60),e.readUInt8(61)),fsSelection:e.readUInt16BE(62),usFirstCharIndex:e.readUInt16BE(64),usLastCharIndex:e.readUInt16BE(66),sTypoAscender:e.readInt16BE(68),sTypoDescender:e.readInt16BE(70),sTypoLineGap:e.readInt16BE(72),usWinAscent:e.readUInt16BE(74),usWinDescent:e.readUInt16BE(76)};return t.version>=1&&(t.ulCodePageRange1=e.readUInt32BE(78),t.ulCodePageRange2=e.readUInt32BE(82)),t.version>=2&&(t.sxHeight=e.readInt16BE(86),t.sCapHeight=e.readInt16BE(88),t.usDefaultChar=e.readUInt16BE(90),t.usBreakChar=e.readUInt16BE(92),t.usMaxContent=e.readUInt16BE(94)),t}},870:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(970);t.default=function(e){return{version:s.formatFixed(e.readUInt16BE(0),e.readUInt16BE(2)),italicAngle:s.formatFixed(e.readUInt16BE(4),e.readUInt16BE(6)),underlinePosition:e.readInt16BE(8),underlineThickness:e.readInt16BE(10),isFixedPitch:e.readUInt32BE(12),minMemType42:e.readUInt32BE(16),maxMemType42:e.readUInt32BE(20),minMemType1:e.readUInt32BE(24),maxMemType1:e.readUInt32BE(28)}}},970:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatFixed=function(e,t){return e+t/65536},t.formatLongDateTime=function(e,t){return 1e3*(e*2**32+t-2082844800)}},877:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(3),o=n(621),r=n(696),a={win32:()=>process.env.WINDIR?[s.join(process.env.WINDIR,"Fonts")]:["C:\\Windows\\Fonts"],darwin:()=>{const e=o.homedir();return[...e?[s.join(e,"/Library/Fonts")]:[],"/Library/Fonts","/Network/Library/Fonts","/System/Library/Fonts","/System Folder/Fonts"]},linux:()=>{const e=o.homedir();return["/usr/share/fonts","/usr/local/share/fonts",...e?[s.join(e,".fonts"),s.join(e,".local/share/fonts")]:[]]}};function i(e){const t=Object.assign({extensions:["ttf","otf","ttc","woff","woff2"],additionalFolders:[]},e),n=o.platform(),s=a[n];if(!s)throw new Error(`Unsupported platform: ${n}`);const i=s();return r.default([...i,...t.additionalFolders],t.extensions)}e.exports=Object.assign(i,{default:i}),t.default=i},696:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=n(383),o=n(460),r=n(3),a=o.promisify(s.readdir),i=o.promisify(s.stat);async function l(e,t,n=10){if(n<=0)return[];let s;try{s=await a(e)}catch(e){return[]}const o=[];return await Promise.all(s.map((async s=>{const a=r.join(e,s);let u;try{u=await i(a)}catch(e){return}u.isFile()&&t.test(a)?o.push(a):u.isDirectory()&&o.push(...await l(a,t,n-1))}))),o}t.default=async function(e,t){const n=new Set;return await Promise.all(e.map((async e=>{const s=await l(r.resolve(e),new RegExp(`\\.${t.map((e=>`(?:${e})`)).join("|")}$`));for(const e of s)n.add(e)}))),[...n]}},749:(e,t,n)=>{"use strict";const s=n(799),o=Symbol("max"),r=Symbol("length"),a=Symbol("lengthCalculator"),i=Symbol("allowStale"),l=Symbol("maxAge"),u=Symbol("dispose"),c=Symbol("noDisposeOnSet"),p=Symbol("lruList"),f=Symbol("cache"),h=Symbol("updateAgeOnGet"),d=()=>1,g=(e,t,n)=>{const s=e[f].get(t);if(s){const t=s.value;if(m(e,t)){if(v(e,s),!e[i])return}else n&&(e[h]&&(s.value.now=Date.now()),e[p].unshiftNode(s));return t.value}},m=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[l]&&n>e[l]},y=e=>{if(e[r]>e[o])for(let t=e[p].tail;e[r]>e[o]&&null!==t;){const n=t.prev;v(e,t),t=n}},v=(e,t)=>{if(t){const n=t.value;e[u]&&e[u](n.key,n.value),e[r]-=n.length,e[f].delete(n.key),e[p].removeNode(t)}};class b{constructor(e,t,n,s,o){this.key=e,this.value=t,this.length=n,this.now=s,this.maxAge=o||0}}const x=(e,t,n,s)=>{let o=n.value;m(e,o)&&(v(e,n),e[i]||(o=void 0)),o&&t.call(s,o.value,o.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[o]=e.max||1/0;const t=e.length||d;if(this[a]="function"!=typeof t?d:t,this[i]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[u]=e.dispose,this[c]=e.noDisposeOnSet||!1,this[h]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[o]=e||1/0,y(this)}get max(){return this[o]}set allowStale(e){this[i]=!!e}get allowStale(){return this[i]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,y(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=d),e!==this[a]&&(this[a]=e,this[r]=0,this[p].forEach((e=>{e.length=this[a](e.value,e.key),this[r]+=e.length}))),y(this)}get lengthCalculator(){return this[a]}get length(){return this[r]}get itemCount(){return this[p].length}rforEach(e,t){t=t||this;for(let n=this[p].tail;null!==n;){const s=n.prev;x(this,e,n,t),n=s}}forEach(e,t){t=t||this;for(let n=this[p].head;null!==n;){const s=n.next;x(this,e,n,t),n=s}}keys(){return this[p].toArray().map((e=>e.key))}values(){return this[p].toArray().map((e=>e.value))}reset(){this[u]&&this[p]&&this[p].length&&this[p].forEach((e=>this[u](e.key,e.value))),this[f]=new Map,this[p]=new s,this[r]=0}dump(){return this[p].map((e=>!m(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[p]}set(e,t,n){if((n=n||this[l])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const s=n?Date.now():0,i=this[a](t,e);if(this[f].has(e)){if(i>this[o])return v(this,this[f].get(e)),!1;const a=this[f].get(e).value;return this[u]&&(this[c]||this[u](e,a.value)),a.now=s,a.maxAge=n,a.value=t,this[r]+=i-a.length,a.length=i,this.get(e),y(this),!0}const h=new b(e,t,i,s,n);return h.length>this[o]?(this[u]&&this[u](e,t),!1):(this[r]+=h.length,this[p].unshift(h),this[f].set(e,this[p].head),y(this),!0)}has(e){if(!this[f].has(e))return!1;const t=this[f].get(e).value;return!m(this,t)}get(e){return g(this,e,!0)}peek(e){return g(this,e,!1)}pop(){const e=this[p].tail;return e?(v(this,e),e.value):null}del(e){v(this,this[f].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const s=e[n],o=s.e||0;if(0===o)this.set(s.k,s.v);else{const e=o-t;e>0&&this.set(s.k,s.v,e)}}}prune(){this[f].forEach(((e,t)=>g(this,t,!1)))}}},386:(e,t,n)=>{"use strict";n.r(t),n.d(t,{BoundingBox:()=>i,Font:()=>gn,Glyph:()=>ie,Path:()=>u,_parse:()=>z,load:()=>Cn,loadSync:()=>Dn,parse:()=>Bn});var s=n(741),o=n.n(s);function r(e,t,n,s,o){return Math.pow(1-o,3)*e+3*Math.pow(1-o,2)*o*t+3*(1-o)*Math.pow(o,2)*n+Math.pow(o,3)*s}function a(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}a.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},a.prototype.addPoint=function(e,t){"number"==typeof e&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))},a.prototype.addX=function(e){this.addPoint(e,null)},a.prototype.addY=function(e){this.addPoint(null,e)},a.prototype.addBezier=function(e,t,n,s,o,a,i,l){const u=[e,t],c=[n,s],p=[o,a],f=[i,l];this.addPoint(e,t),this.addPoint(i,l);for(let e=0;e<=1;e++){const t=6*u[e]-12*c[e]+6*p[e],n=-3*u[e]+9*c[e]-9*p[e]+3*f[e],s=3*c[e]-3*u[e];if(0===n){if(0===t)continue;const n=-s/t;0<n&&n<1&&(0===e&&this.addX(r(u[e],c[e],p[e],f[e],n)),1===e&&this.addY(r(u[e],c[e],p[e],f[e],n)));continue}const o=Math.pow(t,2)-4*s*n;if(o<0)continue;const a=(-t+Math.sqrt(o))/(2*n);0<a&&a<1&&(0===e&&this.addX(r(u[e],c[e],p[e],f[e],a)),1===e&&this.addY(r(u[e],c[e],p[e],f[e],a)));const i=(-t-Math.sqrt(o))/(2*n);0<i&&i<1&&(0===e&&this.addX(r(u[e],c[e],p[e],f[e],i)),1===e&&this.addY(r(u[e],c[e],p[e],f[e],i)))}},a.prototype.addQuad=function(e,t,n,s,o,r){const a=e+2/3*(n-e),i=t+2/3*(s-t),l=a+1/3*(o-e),u=i+1/3*(r-t);this.addBezier(e,t,a,i,l,u,o,r)};const i=a;function l(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}l.prototype.moveTo=function(e,t){this.commands.push({type:"M",x:e,y:t})},l.prototype.lineTo=function(e,t){this.commands.push({type:"L",x:e,y:t})},l.prototype.curveTo=l.prototype.bezierCurveTo=function(e,t,n,s,o,r){this.commands.push({type:"C",x1:e,y1:t,x2:n,y2:s,x:o,y:r})},l.prototype.quadTo=l.prototype.quadraticCurveTo=function(e,t,n,s){this.commands.push({type:"Q",x1:e,y1:t,x:n,y:s})},l.prototype.close=l.prototype.closePath=function(){this.commands.push({type:"Z"})},l.prototype.extend=function(e){if(e.commands)e=e.commands;else if(e instanceof i){const t=e;return this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),void this.close()}Array.prototype.push.apply(this.commands,e)},l.prototype.getBoundingBox=function(){const e=new i;let t=0,n=0,s=0,o=0;for(let r=0;r<this.commands.length;r++){const a=this.commands[r];switch(a.type){case"M":e.addPoint(a.x,a.y),t=s=a.x,n=o=a.y;break;case"L":e.addPoint(a.x,a.y),s=a.x,o=a.y;break;case"Q":e.addQuad(s,o,a.x1,a.y1,a.x,a.y),s=a.x,o=a.y;break;case"C":e.addBezier(s,o,a.x1,a.y1,a.x2,a.y2,a.x,a.y),s=a.x,o=a.y;break;case"Z":s=t,o=n;break;default:throw new Error("Unexpected path command "+a.type)}}return e.isEmpty()&&e.addPoint(0,0),e},l.prototype.draw=function(e){e.beginPath();for(let t=0;t<this.commands.length;t+=1){const n=this.commands[t];"M"===n.type?e.moveTo(n.x,n.y):"L"===n.type?e.lineTo(n.x,n.y):"C"===n.type?e.bezierCurveTo(n.x1,n.y1,n.x2,n.y2,n.x,n.y):"Q"===n.type?e.quadraticCurveTo(n.x1,n.y1,n.x,n.y):"Z"===n.type&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())},l.prototype.toPathData=function(e){function t(t){return Math.round(t)===t?""+Math.round(t):t.toFixed(e)}function n(){let e="";for(let n=0;n<arguments.length;n+=1){const s=arguments[n];s>=0&&n>0&&(e+=" "),e+=t(s)}return e}e=void 0!==e?e:2;let s="";for(let e=0;e<this.commands.length;e+=1){const t=this.commands[e];"M"===t.type?s+="M"+n(t.x,t.y):"L"===t.type?s+="L"+n(t.x,t.y):"C"===t.type?s+="C"+n(t.x1,t.y1,t.x2,t.y2,t.x,t.y):"Q"===t.type?s+="Q"+n(t.x1,t.y1,t.x,t.y):"Z"===t.type&&(s+="Z")}return s},l.prototype.toSVG=function(e){let t='<path d="';return t+=this.toPathData(e),t+='"',this.fill&&"black"!==this.fill&&(null===this.fill?t+=' fill="none"':t+=' fill="'+this.fill+'"'),this.stroke&&(t+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),t+="/>",t},l.prototype.toDOMElement=function(e){const t=this.toPathData(e),n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("d",t),n};const u=l;function c(e){throw new Error(e)}function p(e,t){e||c(t)}const f={fail:c,argument:p,assert:p},h=2147483648,d={},g={},m={};function y(e){return function(){return e}}g.BYTE=function(e){return f.argument(e>=0&&e<=255,"Byte value should be between 0 and 255."),[e]},m.BYTE=y(1),g.CHAR=function(e){return[e.charCodeAt(0)]},m.CHAR=y(1),g.CHARARRAY=function(e){const t=[];for(let n=0;n<e.length;n+=1)t[n]=e.charCodeAt(n);return t},m.CHARARRAY=function(e){return e.length},g.USHORT=function(e){return[e>>8&255,255&e]},m.USHORT=y(2),g.SHORT=function(e){return e>=32768&&(e=-(65536-e)),[e>>8&255,255&e]},m.SHORT=y(2),g.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},m.UINT24=y(3),g.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},m.ULONG=y(4),g.LONG=function(e){return e>=h&&(e=-(2*h-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},m.LONG=y(4),g.FIXED=g.ULONG,m.FIXED=m.ULONG,g.FWORD=g.SHORT,m.FWORD=m.SHORT,g.UFWORD=g.USHORT,m.UFWORD=m.USHORT,g.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},m.LONGDATETIME=y(8),g.TAG=function(e){return f.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},m.TAG=y(4),g.Card8=g.BYTE,m.Card8=m.BYTE,g.Card16=g.USHORT,m.Card16=m.USHORT,g.OffSize=g.BYTE,m.OffSize=m.BYTE,g.SID=g.USHORT,m.SID=m.USHORT,g.NUMBER=function(e){return e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?[247+((e-=108)>>8),255&e]:e>=-1131&&e<=-108?[251+((e=-e-108)>>8),255&e]:e>=-32768&&e<=32767?g.NUMBER16(e):g.NUMBER32(e)},m.NUMBER=function(e){return g.NUMBER(e).length},g.NUMBER16=function(e){return[28,e>>8&255,255&e]},m.NUMBER16=y(3),g.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},m.NUMBER32=y(5),g.REAL=function(e){let t=e.toString();const n=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(n){const s=parseFloat("1e"+((n[2]?+n[2]:0)+n[1].length));t=(Math.round(e*s)/s).toString()}let s="";for(let e=0,n=t.length;e<n;e+=1){const n=t[e];s+="e"===n?"-"===t[++e]?"c":"b":"."===n?"a":"-"===n?"e":n}s+=1&s.length?"f":"ff";const o=[30];for(let e=0,t=s.length;e<t;e+=2)o.push(parseInt(s.substr(e,2),16));return o},m.REAL=function(e){return g.REAL(e).length},g.NAME=g.CHARARRAY,m.NAME=m.CHARARRAY,g.STRING=g.CHARARRAY,m.STRING=m.CHARARRAY,d.UTF8=function(e,t,n){const s=[],o=n;for(let n=0;n<o;n++,t+=1)s[n]=e.getUint8(t);return String.fromCharCode.apply(null,s)},d.UTF16=function(e,t,n){const s=[],o=n/2;for(let n=0;n<o;n++,t+=2)s[n]=e.getUint16(t);return String.fromCharCode.apply(null,s)},g.UTF16=function(e){const t=[];for(let n=0;n<e.length;n+=1){const s=e.charCodeAt(n);t[t.length]=s>>8&255,t[t.length]=255&s}return t},m.UTF16=function(e){return 2*e.length};const v={"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":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};d.MACSTRING=function(e,t,n,s){const o=v[s];if(void 0===o)return;let r="";for(let s=0;s<n;s++){const n=e.getUint8(t+s);r+=n<=127?String.fromCharCode(n):o[127&n]}return r};const b="function"==typeof WeakMap&&new WeakMap;let x;function S(e){return e>=-128&&e<=127}function U(e,t,n){let s=0;const o=e.length;for(;t<o&&s<64&&0===e[t];)++t,++s;return n.push(128|s-1),t}function k(e,t,n){let s=0;const o=e.length;let r=t;for(;r<o&&s<64;){const t=e[r];if(!S(t))break;if(0===t&&r+1<o&&0===e[r+1])break;++r,++s}n.push(s-1);for(let s=t;s<r;++s)n.push(e[s]+256&255);return r}function T(e,t,n){let s=0;const o=e.length;let r=t;for(;r<o&&s<64;){const t=e[r];if(0===t)break;if(S(t)&&r+1<o&&S(e[r+1]))break;++r,++s}n.push(64|s-1);for(let s=t;s<r;++s){const t=e[s];n.push(t+65536>>8&255,t+256&255)}return r}g.MACSTRING=function(e,t){const n=function(e){if(!x){x={};for(let e in v)x[e]=new String(e)}const t=x[e];if(void 0===t)return;if(b){const e=b.get(t);if(void 0!==e)return e}const n=v[e];if(void 0===n)return;const s={};for(let e=0;e<n.length;e++)s[n.charCodeAt(e)]=e+128;return b&&b.set(t,s),s}(t);if(void 0===n)return;const s=[];for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);if(o>=128&&(o=n[o],void 0===o))return;s[t]=o}return s},m.MACSTRING=function(e,t){const n=g.MACSTRING(e,t);return void 0!==n?n.length:0},g.VARDELTAS=function(e){let t=0;const n=[];for(;t<e.length;){const s=e[t];t=0===s?U(e,t,n):s>=-128&&s<=127?k(e,t,n):T(e,t,n)}return n},g.INDEX=function(e){let t=1;const n=[t],s=[];for(let o=0;o<e.length;o+=1){const r=g.OBJECT(e[o]);Array.prototype.push.apply(s,r),t+=r.length,n.push(t)}if(0===s.length)return[0,0];const o=[],r=1+Math.floor(Math.log(t)/Math.log(2))/8|0,a=[void 0,g.BYTE,g.USHORT,g.UINT24,g.ULONG][r];for(let e=0;e<n.length;e+=1){const t=a(n[e]);Array.prototype.push.apply(o,t)}return Array.prototype.concat(g.Card16(e.length),g.OffSize(r),o,s)},m.INDEX=function(e){return g.INDEX(e).length},g.DICT=function(e){let t=[];const n=Object.keys(e),s=n.length;for(let o=0;o<s;o+=1){const s=parseInt(n[o],0),r=e[s];t=t.concat(g.OPERAND(r.value,r.type)),t=t.concat(g.OPERATOR(s))}return t},m.DICT=function(e){return g.DICT(e).length},g.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},g.OPERAND=function(e,t){let n=[];if(Array.isArray(t))for(let s=0;s<t.length;s+=1)f.argument(e.length===t.length,"Not enough arguments given for type"+t),n=n.concat(g.OPERAND(e[s],t[s]));else if("SID"===t)n=n.concat(g.NUMBER(e));else if("offset"===t)n=n.concat(g.NUMBER32(e));else if("number"===t)n=n.concat(g.NUMBER(e));else{if("real"!==t)throw new Error("Unknown operand type "+t);n=n.concat(g.REAL(e))}return n},g.OP=g.BYTE,m.OP=m.BYTE;const E="function"==typeof WeakMap&&new WeakMap;function w(e,t,n){for(let e=0;e<t.length;e+=1){const n=t[e];this[n.name]=n.value}if(this.tableName=e,this.fields=t,n){const e=Object.keys(n);for(let t=0;t<e.length;t+=1){const s=e[t],o=n[s];void 0!==this[s]&&(this[s]=o)}}}function O(e,t,n){void 0===n&&(n=t.length);const s=new Array(t.length+1);s[0]={name:e+"Count",type:"USHORT",value:n};for(let n=0;n<t.length;n++)s[n+1]={name:e+n,type:"USHORT",value:t[n]};return s}function I(e,t,n){const s=t.length,o=new Array(s+1);o[0]={name:e+"Count",type:"USHORT",value:s};for(let r=0;r<s;r++)o[r+1]={name:e+r,type:"TABLE",value:n(t[r],r)};return o}function R(e,t,n){const s=t.length;let o=[];o[0]={name:e+"Count",type:"USHORT",value:s};for(let e=0;e<s;e++)o=o.concat(n(t[e],e));return o}function L(e){1===e.format?w.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(O("glyph",e.glyphs))):f.assert(!1,"Can't create coverage table format 2 yet.")}function B(e){w.call(this,"scriptListTable",R("scriptRecord",e,(function(e,t){const n=e.script;let s=n.defaultLangSys;return f.assert(!!s,"Unable to write GSUB: script "+e.tag+" has no default language system."),[{name:"scriptTag"+t,type:"TAG",value:e.tag},{name:"script"+t,type:"TABLE",value:new w("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new w("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:s.reqFeatureIndex}].concat(O("featureIndex",s.featureIndexes)))}].concat(R("langSys",n.langSysRecords,(function(e,t){const n=e.langSys;return[{name:"langSysTag"+t,type:"TAG",value:e.tag},{name:"langSys"+t,type:"TABLE",value:new w("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:n.reqFeatureIndex}].concat(O("featureIndex",n.featureIndexes)))}]}))))}]})))}function C(e){w.call(this,"featureListTable",R("featureRecord",e,(function(e,t){const n=e.feature;return[{name:"featureTag"+t,type:"TAG",value:e.tag},{name:"feature"+t,type:"TABLE",value:new w("featureTable",[{name:"featureParams",type:"USHORT",value:n.featureParams}].concat(O("lookupListIndex",n.lookupListIndexes)))}]})))}function D(e,t){w.call(this,"lookupListTable",I("lookup",e,(function(e){let n=t[e.lookupType];return f.assert(!!n,"Unable to write GSUB lookup type "+e.lookupType+" tables."),new w("lookupTable",[{name:"lookupType",type:"USHORT",value:e.lookupType},{name:"lookupFlag",type:"USHORT",value:e.lookupFlag}].concat(I("subtable",e.subtables,n)))})))}g.CHARSTRING=function(e){if(E){const t=E.get(e);if(void 0!==t)return t}let t=[];const n=e.length;for(let s=0;s<n;s+=1){const n=e[s];t=t.concat(g[n.type](n.value))}return E&&E.set(e,t),t},m.CHARSTRING=function(e){return g.CHARSTRING(e).length},g.OBJECT=function(e){const t=g[e.type];return f.argument(void 0!==t,"No encoding function for type "+e.type),t(e.value)},m.OBJECT=function(e){const t=m[e.type];return f.argument(void 0!==t,"No sizeOf function for type "+e.type),t(e.value)},g.TABLE=function(e){let t=[];const n=e.fields.length,s=[],o=[];for(let r=0;r<n;r+=1){const n=e.fields[r],a=g[n.type];f.argument(void 0!==a,"No encoding function for field type "+n.type+" ("+n.name+")");let i=e[n.name];void 0===i&&(i=n.value);const l=a(i);"TABLE"===n.type?(o.push(t.length),t=t.concat([0,0]),s.push(l)):t=t.concat(l)}for(let n=0;n<s.length;n+=1){const r=o[n],a=t.length;f.argument(a<65536,"Table "+e.tableName+" too big."),t[r]=a>>8,t[r+1]=255&a,t=t.concat(s[n])}return t},m.TABLE=function(e){let t=0;const n=e.fields.length;for(let s=0;s<n;s+=1){const n=e.fields[s],o=m[n.type];f.argument(