PageSourceSearch

https://cdn.pacdora.com/_pacui/assets/src-DURlYNmsEc.js

js pacdora.com collected 2026-09-25 19:12:22 UTC 228,591 bytes, 4 lines download raw bytes

1import{Hr as e,Ni as t,ct as n,mt as r}from"./src-DdRYxgPx8x.js";import{r as i}from"./aws-sdk-DkTA9HjmnT.js";var a=class{constructor(e){t(this,`width`,void 0),t(this,`height`,void 0),t(this,`ratio`,void 0),t(this,`domElement`,void 0),t(this,`children`,[]),t(this,`name`,``),t(this,`scale`,1),t(this,`beforeRender`,null),this.width=e.width??100,this.height=e.height??100,this.ratio=e.ratio??1,this.scale=e.scale??1,this.name=e.name??``,this.domElement=document.createElement(`canvas`),this.initCanvas()}appendTo(e,t={}){if(Object.assign(this.domElement.style,t),e&&!this.domElement.parentNode)e.appendChild(this.domElement);else{var n;(n=this.domElement.parentNode)==null||n.removeChild(this.domElement)}}initCanvas(){this.domElement.style.width=`${this.width}px`,this.domElement.style.height=`${this.height}px`,this.domElement.width=Math.round(this.width*this.ratio*this.scale),this.domElement.height=Math.round(this.height*this.ratio*this.scale)}setCanvasSize(e,t){this.width=e,this.height=t,this.domElement.style.width=`${this.width}px`,this.domElement.style.height=`${this.height}px`,this.domElement.width=Math.round(this.width*this.ratio*this.scale),this.domElement.height=Math.round(this.height*this.ratio*this.scale)}addChild(e){this.children.push(e),this.children.sort((e,t)=>t.zIndex-e.zIndex)}getPainter(){return this.domElement.getContext(`2d`)}async render(){var e;let t=this.domElement.getContext(`2d`);t==null||t.clearRect(0,0,this.domElement.width,this.domElement.height),(e=this.beforeRender)==null||e.call(this,t,this.scale);for(let e=0;e<this.children.length;e++)try{await this.children[e].paint(t,this.scale)}catch(e){console.error(`paint child error`,e)}}dispose(){if(this.domElement.parentNode){var e;this.domElement.width=0,this.domElement.height=0,(e=this.domElement.parentNode)==null||e.removeChild(this.domElement)}}console(){}},o=class{constructor(e,n){t(this,`x`,0),t(this,`y`,0),this.x=e,this.y=n}},s=class{constructor(e){t(this,`position`,new o(0,0)),t(this,`name`,``),t(this,`composite`,``),t(this,`visible`,void 0),t(this,`rotation`,void 0),t(this,`scaleX`,void 0),t(this,`scaleY`,void 0),t(this,`zIndex`,void 0),t(this,`children`,[]),t(this,`parent`,void 0),t(this,`width`,void 0),t(this,`height`,void 0),t(this,`opacity`,void 0),t(this,`beforeRender`,null),this.position=e.position??new o(0,0),this.name=e.name??``,this.composite=e.composite??``,this.visible=e.visible??!0,this.rotation=e.rotation??0,this.scaleX=e.scaleX??1,this.scaleY=e.scaleY??1,this.zIndex=e.zIndex??1,this.opacity=e.opacity??1,this.width=e.width??1,this.height=e.height??1}addChild(e){this.children.push(e),this.children.sort((e,t)=>t.zIndex-e.zIndex)}async paint(e,t=1){if(this.visible&&e){var n;e.save(),(n=this.beforeRender)==null||n.call(this,e,t),this.composite!==``&&(e.globalCompositeOperation=this.composite),e.globalAlpha=this.opacity,e.translate((this.position.x+this.width/2)*t,(this.position.y+this.height/2)*t),e.rotate(this.rotation),e.translate(-this.width/2*t,-this.height/2*t),e.scale(this.scaleX,this.scaleY);for(let n=0;n<this.children.length;n++)try{await this.children[n].paint(e,t)}catch(e){console.error(`paint child error`,e)}try{await this.draw(e,t)}catch(e){console.error(`draw error`,e)}e.restore()}}};function c(e,t,n,r){if(![e,t,n,r].every(e=>Number.isFinite(e)&&e>0))return{x:0,y:0,width:e,height:t};let i=Math.min(e/n,t/r),a=n*i,o=r*i;return{x:(e-a)/2,y:(t-o)/2,width:a,height:o}}function l(e){if(!e)return{r:0,g:0,b:0,a:0};let t=e.toLowerCase().trim(),n=/^#([0-9|a-f]{3}|[0-9|a-f]{6}|[0-9|a-f]{4}|[0-9|a-f]{8})$/,r=/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/,i=/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/;if(t&&n.test(t)){let e=t.length===5||t.length===9,n=1;t.length===5?(n=parseInt(`0x${t[4]}${t[4]}`)/255,t=t.substr(0,t.length-1)):t.length===9&&(n=parseInt(`0x${t[7]}${t[8]}`)/255,t=t.substr(0,t.length-2)),t.length==4&&(t=`#`+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]);let r=[];for(let e=1;e<7;e+=2)r.push(parseInt(`0x`+t.slice(e,e+2)));return{r:r[0],g:r[1],b:r[2],a:e?n:1}}else if(r.test(t)){let e=t.match(r);return{r:Number(e[1])%256,g:Number(e[2])%256,b:Number(e[3])%256,a:1}}else if(i.test(t)){let e=t.match(i);return{r:Number(e[1])%256,g:Number(e[2])%256,b:Number(e[3])%256,a:Number(e[4])}}return{r:0,g:0,b:0,a:0}}function u(e,t){let n=l(e),r=l(t);return n.r===r.r&&n.g===r.g&&n.b===r.b&&n.a===r.a}function d(e){e.querySelectorAll(`*`);let t=e.querySelector(`style`);if(t){if(document.head.appendChild(t),t.sheet){let n=t.sheet.cssRules;for(let t=0;t<n.length;t++){let r=n[t],i=e.querySelectorAll(r.selectorText);if(i)for(let e=0;e<i.length;e++)[`fill`,`stroke`].forEach(t=>{i[e].style[t]=r.style.getPropertyValue(t)})}}document.head.removeChild(t),e.appendChild(t)}}function f(e,t,n){let r=e.querySelectorAll(`*`),i=[];for(let e=0;e<r.length;e++){let a=r[e];if([`defs`,`style`,`title`].includes(a.nodeName))continue;if(a.getAttribute(t)&&u(a.getAttribute(t)??``,n)){i.push({el:a,type:`attr`});continue}let o=a.style;o.getPropertyValue(t)&&u(o.getPropertyValue(t)??``,n)&&i.push({el:a,type:`style`})}return i}var p=40,m=new Map;function h(){for(;m.size>p;){let e=m.keys().next().value;if(e===void 0)break;m.delete(e)}}function g(e,t){let n=JSON.stringify([e,t]),r=m.get(n);if(r)return r;let i=fetch(e,{cache:`force-cache`}).then(e=>e.text()).then(n=>{let r=document.createElement(`div`);r.innerHTML=n;let i=r.querySelector(`svg`);if(!i)return e;d(i);let a=r.querySelector(`style`);a||(a=document.createElement(`style`));for(let e of t){let{type:t,value:n,color:r}=e,o=f(i,t,n);if(o.length===0){a.innerHTML+=`.pac-${e.class}{${t}:${r}}`,i.classList.add(`pac-${e.class}`);continue}
1o.forEach(e=>{e.type===`attr`?e.el.setAttribute(t,r):e.el.style[t]=r})}return i.appendChild(a),`data:image/svg+xml,${encodeURIComponent(new XMLSerializer().serializeToString(i))}`});return m.set(n,i),h(),i.catch(()=>{m.get(n)===i&&m.delete(n)}),i}function _(e,t,n,r,i){let a=document.createElement(`canvas`);a.width=Math.max(1,Math.ceil(t)),a.height=Math.max(1,Math.ceil(n));let o=a.getContext(`2d`);if(!o){i(e);return}i(o),o.globalCompositeOperation=`color`,o.fillStyle=r,o.fillRect(0,0,t,n),o.globalCompositeOperation=`destination-in`,i(o),e.drawImage(a,0,0)}var v=class extends s{constructor(e){super(e),t(this,`path`,void 0),t(this,`fileIsLoaded`,!1),t(this,`loadPromise`,void 0),t(this,`width`,void 0),t(this,`height`,void 0),t(this,`image`,void 0),t(this,`bg`,void 0),t(this,`rotateX`,!1),t(this,`rotateY`,!1),t(this,`tint`,null),t(this,`fit`,void 0),this.path=e.path,this.width=e.width??100,this.height=e.height??100,this.image=new Image(this.width,this.height),this.image.setAttribute(`crossOrigin`,`Anonymous`),this.rotateX=!!e.rotateX,this.rotateY=!!e.rotateY,this.tint=e.tint??null,this.fit=e.fit,this.bg=e.bg;let n=null;if(this.loadPromise=new Promise(e=>n=e),this.image.onload=e=>{this.fileIsLoaded=!0,n&&n(this.image)},this.image.onerror=e=>{console.error(`painter load image error`,e,this.image.src),this.fileIsLoaded=!0,n&&n(this.image)},e.can_set_color===1&&e.path.toLowerCase().split(/[?#]/)[0].endsWith(`.svg`)){let t=e.fills||[];g(this.path,t).then(e=>{this.image.src=e}).catch(e=>{console.error(`painter fetch svg error`,e,this.path),this.fileIsLoaded=!0,n&&n(this.image)})}else this.path?this.image.src=this.path:(this.fileIsLoaded=!0,n==null||n(this.image))}async draw(e,t){e.translate(this.rotateX?this.width*t:0,this.rotateY?this.height*t:0),e.scale(this.rotateX?-1:1,this.rotateY?-1:1);let n=e=>{if(this.fit!==`contain`&&this.bg&&(/.(jpe?g|png)$/.test(this.path.toLowerCase())||/data:image\/(jpe?g|png)/.test(this.path.toLowerCase())))e.beginPath(),e.rect(0,0,this.width*t,this.height*t),e.clip(),e.drawImage(this.image,this.bg.x*t,this.bg.y*t,this.bg.width*t,this.bg.height*t);else if(this.fit===`contain`){let n=c(this.width,this.height,this.image.naturalWidth,this.image.naturalHeight);e.drawImage(this.image,n.x*t,n.y*t,n.width*t,n.height*t)}else e.drawImage(this.image,0,0,this.width*t,this.height*t)};this.fileIsLoaded||await this.loadPromise,this.tint?_(e,this.width*t,this.height*t,this.tint,n):n(e)}};String.prototype.codePointAt||(function(){var e=function(){try{var e={},t=Object.defineProperty,n=t(e,e,e)&&t}catch{}return n}(),t=function(e){if(this==null)throw TypeError();var t=String(this),n=t.length,r=e?Number(e):0;if(r!=r&&(r=0),!(r<0||r>=n)){var i=t.charCodeAt(r),a;return i>=55296&&i<=56319&&n>r+1&&(a=t.charCodeAt(r+1),a>=56320&&a<=57343)?(i-55296)*1024+a-56320+65536:i}};e?e(String.prototype,`codePointAt`,{value:t,configurable:!0,writable:!0}):String.prototype.codePointAt=t})();var y=0,b=-3;function x(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function S(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new x,this.dtree=new x}var C=new x,w=new x,T=new Uint8Array(30),E=new Uint16Array(30),D=new Uint8Array(30),O=new Uint16Array(30),k=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),A=new x,j=new Uint8Array(320);function M(e,t,n,r){var i,a;for(i=0;i<n;++i)e[i]=0;for(i=0;i<30-n;++i)e[i+n]=i/n|0;for(a=r,i=0;i<30;++i)t[i]=a,a+=1<<e[i]}function N(e,t){var n;for(n=0;n<7;++n)e.table[n]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,n=0;n<24;++n)e.trans[n]=256+n;for(n=0;n<144;++n)e.trans[24+n]=n;for(n=0;n<8;++n)e.trans[168+n]=280+n;for(n=0;n<112;++n)e.trans[176+n]=144+n;for(n=0;n<5;++n)t.table[n]=0;for(t.table[5]=32,n=0;n<32;++n)t.trans[n]=n}var P=new Uint16Array(16);function ee(e,t,n,r){var i,a;for(i=0;i<16;++i)e.table[i]=0;for(i=0;i<r;++i)e.table[t[n+i]]++;for(e.table[0]=0,a=0,i=0;i<16;++i)P[i]=a,a+=e.table[i];for(i=0;i<r;++i)t[n+i]&&(e.trans[P[t[n+i]]++]=i)}function te(e){e.bitcount--||(e.tag=e.source[e.sourceIndex++],e.bitcount=7);var t=e.tag&1;return e.tag>>>=1,t}function F(e,t,n){if(!t)return n;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var r=e.tag&65535>>>16-t;return e.tag>>>
1=t,e.bitcount-=t,r+n}function ne(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<<e.bitcount,e.bitcount+=8;var n=0,r=0,i=0,a=e.tag;do r=2*r+(a&1),a>>>=1,++i,n+=t.table[i],r-=t.table[i];while(r>=0);return e.tag=a,e.bitcount-=i,t.trans[n+r]}function re(e,t,n){var r=F(e,5,257),i=F(e,5,1),a=F(e,4,4),o,s,c;for(o=0;o<19;++o)j[o]=0;for(o=0;o<a;++o){var l=F(e,3,0);j[k[o]]=l}for(ee(A,j,0,19),s=0;s<r+i;){var u=ne(e,A);switch(u){case 16:var d=j[s-1];for(c=F(e,2,3);c;--c)j[s++]=d;break;case 17:for(c=F(e,3,3);c;--c)j[s++]=0;break;case 18:for(c=F(e,7,11);c;--c)j[s++]=0;break;default:j[s++]=u;break}}ee(t,j,0,r),ee(n,j,r,i)}function ie(e,t,n){for(;;){var r=ne(e,t);if(r===256)return y;if(r<256)e.dest[e.destLen++]=r;else{var i,a,o,s;for(r-=257,i=F(e,T[r],E[r]),a=ne(e,n),o=e.destLen-F(e,D[a],O[a]),s=o;s<o+i;++s)e.dest[e.destLen++]=e.dest[s]}}}function ae(e){for(var t,n,r;e.bitcount>8;)e.sourceIndex--,e.bitcount-=8;if(t=e.source[e.sourceIndex+1],t=256*t+e.source[e.sourceIndex],n=e.source[e.sourceIndex+3],n=256*n+e.source[e.sourceIndex+2],t!==(~n&65535))return b;for(e.sourceIndex+=4,r=t;r;--r)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,y}function oe(e,t){var n=new S(e,t),r,i,a;do{switch(r=te(n),i=F(n,2,0),i){case 0:a=ae(n);break;case 1:a=ie(n,C,w);break;case 2:re(n,n.ltree,n.dtree),a=ie(n,n.ltree,n.dtree);break;default:a=b}if(a!==y)throw Error(`Data error`)}while(!r);return n.destLen<n.dest.length?typeof n.dest.slice==`function`?n.dest.slice(0,n.destLen):n.dest.subarray(0,n.destLen):n.dest}N(C,w),M(T,E,4,3),M(D,O,2,1),T[28]=0,E[28]=258;var se=oe;function ce(e,t,n,r,i){return(1-i)**3*e+3*(1-i)**2*i*t+3*(1-i)*i**2*n+i**3*r}function le(){this.x1=NaN,this.y1=NaN,this.x2=NaN,this.y2=NaN}le.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},le.prototype.addPoint=function(e,t){typeof e==`number`&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),typeof t==`number`&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))},le.prototype.addX=function(e){this.addPoint(e,null)},le.prototype.addY=function(e){this.addPoint(null,e)},le.prototype.addBezier=function(e,t,n,r,i,a,o,s){var c=[e,t],l=[n,r],u=[i,a],d=[o,s];this.addPoint(e,t),this.addPoint(o,s);for(var f=0;f<=1;f++){var p=6*c[f]-12*l[f]+6*u[f],m=-3*c[f]+9*l[f]-9*u[f]+3*d[f],h=3*l[f]-3*c[f];if(m===0){if(p===0)continue;var g=-h/p;0<g&&g<1&&(f===0&&this.addX(ce(c[f],l[f],u[f],d[f],g)),f===1&&this.addY(ce(c[f],l[f],u[f],d[f],g)));continue}var _=p**2-4*h*m;if(!(_<0)){var v=(-p+Math.sqrt(_))/(2*m);0<v&&v<1&&(f===0&&this.addX(ce(c[f],l[f],u[f],d[f],v)),f===1&&this.addY(ce(c[f],l[f],u[f],d[f],v)));var y=(-p-Math.sqrt(_))/(2*m);0<y&&y<1&&(f===0&&this.addX(ce(c[f],l[f],u[f],d[f],y)),f===1&&this.addY(ce(c[f],l[f],u[f],d[f],y)))}}},le.prototype.addQuad=function(e,t,n,r,i,a){var o=e+2/3*(n-e),s=t+2/3*(r-t),c=o+1/3*(i-e),l=s+1/3*(a-t);this.addBezier(e,t,o,s,c,l,i,a)};function I(){this.commands=[],this.fill=`black`,this.stroke=null,this.strokeWidth=1}I.prototype.moveTo=function(e,t){this.commands.push({type:`M`,x:e,y:t})},I.prototype.lineTo=function(e,t){this.commands.push({type:`L`,x:e,y:t})},I.prototype.curveTo=I.prototype.bezierCurveTo=function(e,t,n,r,i,a){this.commands.push({type:`C`,x1:e,y1:t,x2:n,y2:r,x:i,y:a})},I.prototype.quadTo=I.prototype.quadraticCurveTo=function(e,t,n,r){this.commands.push({type:`Q`,x1:e,y1:t,x:n,y:r})},I.prototype.close=I.prototype.closePath=function(){this.commands.push({type:`Z`})},I.prototype.extend=function(e){if(e.commands)e=e.commands;else if(e instanceof le){var t=e;this.moveTo(t.x1,t.y1),this.lineTo(t.x2,t.y1),this.lineTo(t.x2,t.y2),this.lineTo(t.x1,t.y2),this.close();return}Array.prototype.push.apply(this.commands,e)},I.prototype.getBoundingBox=function(){for(var e=new le,t=0,n=0,r=0,i=0,a=0;a<this.commands.length;a++){var o=this.commands[a];switch(o.type){case`M`:e.addPoint(o.x,o.y),t=r=o.x,n=i=o.y;break;case`L`:e.addPoint(o.x,o.y),r=o.x,i=o.y;break;case`Q`:e.addQuad(r,i,o.x1,o.y1,o.x,o.y),r=o.x,i=o.y;break;case`C`:e.addBezier(r,i,o.x1,o.y1,o.x2,o.y2,o.x,o.y),r=o.x,i=o.y;break;case`Z`:r=t,i=n;break;default:throw Error(`Unexpected path command `+o.type)}}return e.isEmpty()&&e.addPoint(0,0),e},I.prototype.draw=function(e){e.beginPath();for(var t=0;t<this.commands.length;t+=1){var n=this.commands[t];n.type===`M`?e.moveTo(n.x,n.y):n.type===`L`?e.lineTo(n.x,n.y):n.type===`C`?e.bezierCurveTo(n.x1,n.y1,n.x2,n.y2,n.x,n.y):n.type===`Q`?e.quadraticCurveTo(n.x1,n.y1,n.x,n.y):n.type===`Z`&&e.closePath()}this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=this.strokeWidth,e.stroke())},I.prototype.toPathData=function(e){e=e===void 0?2:e;
1function t(t){return Math.round(t)===t?``+Math.round(t):t.toFixed(e)}function n(){for(var e=arguments,n=``,r=0;r<arguments.length;r+=1){var i=e[r];i>=0&&r>0&&(n+=` `),n+=t(i)}return n}for(var r=``,i=0;i<this.commands.length;i+=1){var a=this.commands[i];a.type===`M`?r+=`M`+n(a.x,a.y):a.type===`L`?r+=`L`+n(a.x,a.y):a.type===`C`?r+=`C`+n(a.x1,a.y1,a.x2,a.y2,a.x,a.y):a.type===`Q`?r+=`Q`+n(a.x1,a.y1,a.x,a.y):a.type===`Z`&&(r+=`Z`)}return r},I.prototype.toSVG=function(e){var t=`<path d="`;return t+=this.toPathData(e),t+=`"`,this.fill&&this.fill!==`black`&&(this.fill===null?t+=` fill="none"`:t+=` fill="`+this.fill+`"`),this.stroke&&(t+=` stroke="`+this.stroke+`" stroke-width="`+this.strokeWidth+`"`),t+=`/>`,t},I.prototype.toDOMElement=function(e){var t=this.toPathData(e),n=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return n.setAttribute(`d`,t),n};function ue(e){throw Error(e)}function de(e,t){e||ue(t)}var L={fail:ue,argument:de,assert:de},fe=32768,pe=2147483648,me={},R={},z={};function he(e){return function(){return e}}R.BYTE=function(e){return L.argument(e>=0&&e<=255,`Byte value should be between 0 and 255.`),[e]},z.BYTE=he(1),R.CHAR=function(e){return[e.charCodeAt(0)]},z.CHAR=he(1),R.CHARARRAY=function(e){e===void 0&&(e=``,console.warn(`Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name.`));for(var t=[],n=0;n<e.length;n+=1)t[n]=e.charCodeAt(n);return t},z.CHARARRAY=function(e){return e===void 0?0:e.length},R.USHORT=function(e){return[e>>8&255,e&255]},z.USHORT=he(2),R.SHORT=function(e){return e>=fe&&(e=-(2*fe-e)),[e>>8&255,e&255]},z.SHORT=he(2),R.UINT24=function(e){return[e>>16&255,e>>8&255,e&255]},z.UINT24=he(3),R.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]},z.ULONG=he(4),R.LONG=function(e){return e>=pe&&(e=-(2*pe-e)),[e>>24&255,e>>16&255,e>>8&255,e&255]},z.LONG=he(4),R.FIXED=R.ULONG,z.FIXED=z.ULONG,R.FWORD=R.SHORT,z.FWORD=z.SHORT,R.UFWORD=R.USHORT,z.UFWORD=z.USHORT,R.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,e&255]},z.LONGDATETIME=he(8),R.TAG=function(e){return L.argument(e.length===4,`Tag should be exactly 4 ASCII characters.`),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},z.TAG=he(4),R.Card8=R.BYTE,z.Card8=z.BYTE,R.Card16=R.USHORT,z.Card16=z.USHORT,R.OffSize=R.BYTE,z.OffSize=z.BYTE,R.SID=R.USHORT,z.SID=z.USHORT,R.NUMBER=function(e){return e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?(e-=108,[(e>>8)+247,e&255]):e>=-1131&&e<=-108?(e=-e-108,[(e>>8)+251,e&255]):e>=-32768&&e<=32767?R.NUMBER16(e):R.NUMBER32(e)},z.NUMBER=function(e){return R.NUMBER(e).length},R.NUMBER16=function(e){return[28,e>>8&255,e&255]},z.NUMBER16=he(3),R.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,e&255]},z.NUMBER32=he(5),R.REAL=function(e){var t=e.toString(),n=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(n){var r=parseFloat(`1e`+((n[2]?+n[2]:0)+n[1].length));t=(Math.round(e*r)/r).toString()}for(var i=``,a=0,o=t.length;a<o;a+=1){var s=t[a];s===`e`?i+=t[++a]===`-`?`c`:`b`:s===`.`?i+=`a`:s===`-`?i+=`e`:i+=s}i+=i.length&1?`f`:`ff`;for(var c=[30],l=0,u=i.length;l<u;l+=2)c.push(parseInt(i.substr(l,2),16));return c},z.REAL=function(e){return R.REAL(e).length},R.NAME=R.CHARARRAY,z.NAME=z.CHARARRAY,R.STRING=R.CHARARRAY,z.STRING=z.CHARARRAY,me.UTF8=function(e,t,n){for(var r=[],i=n,a=0;a<i;a++,t+=1)r[a]=e.getUint8(t);return String.fromCharCode.apply(null,r)},me.UTF16=function(e,t,n){for(var r=[],i=n/2,a=0;a<i;a++,t+=2)r[a]=e.getUint16(t);return String.fromCharCode.apply(null,r)},R.UTF16=function(e){for(var t=[],n=0;n<e.length;n+=1){var r=e.charCodeAt(n);t[t.length]=r>>8&255,t[t.length]=r&255}return t},z.UTF16=function(e){return e.length*2};var ge={"x-mac-croatian":`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ\xA0ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ`,"x-mac-cyrillic":`АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»…\xA0ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю`,"x-mac-gaelic":`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»…\xA0ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ`,"x-mac-greek":`Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»…\xA0ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­`,"x-mac-icelandic":`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»…\xA0ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ`,"x-mac-inuit":`ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ…\xA0ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł`,"x-mac-ce":`ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»…\xA0ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ`,macintosh:`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»…\xA0ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ`,"x-mac-romanian":`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»…\xA0ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ`,"x-mac-turkish":`ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»…\xA0ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ`};me.MACSTRING=function(e,t,n,r){var i=ge[r];if(i!==void 0){for(var a=``,o=0;o<n;o++){var s=e.getUint8(t+o);s<=127?a+=String.fromCharCode(s):a+=i[s&127]}return a}};var _e=typeof WeakMap==`function`&&new WeakMap,ve,ye=function(e){if(!ve)for(var t in ve={},ge)ve[t]=new String(t);var n=ve[e];if(n!==void 0){if(_e){var r=_e.get(n);if(r!==void 0)return r}var i=ge[e];if(i!==void 0){for(var a={},o=0;o<i.length;
1o++)a[i.charCodeAt(o)]=o+128;return _e&&_e.set(n,a),a}}};R.MACSTRING=function(e,t){var n=ye(t);if(n!==void 0){for(var r=[],i=0;i<e.length;i++){var a=e.charCodeAt(i);if(a>=128&&(a=n[a],a===void 0))return;r[i]=a}return r}},z.MACSTRING=function(e,t){var n=R.MACSTRING(e,t);return n===void 0?0:n.length};function be(e){return e>=-128&&e<=127}function xe(e,t,n){for(var r=0,i=e.length;t<i&&r<64&&e[t]===0;)++t,++r;return n.push(128|r-1),t}function Se(e,t,n){for(var r=0,i=e.length,a=t;a<i&&r<64;){var o=e[a];if(!be(o)||o===0&&a+1<i&&e[a+1]===0)break;++a,++r}n.push(r-1);for(var s=t;s<a;++s)n.push(e[s]+256&255);return a}function Ce(e,t,n){for(var r=0,i=e.length,a=t;a<i&&r<64;){var o=e[a];if(o===0||be(o)&&a+1<i&&be(e[a+1]))break;++a,++r}n.push(64|r-1);for(var s=t;s<a;++s){var c=e[s];n.push(c+65536>>8&255,c+256&255)}return a}R.VARDELTAS=function(e){for(var t=0,n=[];t<e.length;){var r=e[t];t=r===0?xe(e,t,n):r>=-128&&r<=127?Se(e,t,n):Ce(e,t,n)}return n},R.INDEX=function(e){for(var t=1,n=[t],r=[],i=0;i<e.length;i+=1){var a=R.OBJECT(e[i]);Array.prototype.push.apply(r,a),t+=a.length,n.push(t)}if(r.length===0)return[0,0];for(var o=[],s=1+Math.floor(Math.log(t)/Math.log(2))/8|0,c=[void 0,R.BYTE,R.USHORT,R.UINT24,R.ULONG][s],l=0;l<n.length;l+=1){var u=c(n[l]);Array.prototype.push.apply(o,u)}return Array.prototype.concat(R.Card16(e.length),R.OffSize(s),o,r)},z.INDEX=function(e){return R.INDEX(e).length},R.DICT=function(e){for(var t=[],n=Object.keys(e),r=n.length,i=0;i<r;i+=1){var a=parseInt(n[i],0),o=e[a];t=t.concat(R.OPERAND(o.value,o.type)),t=t.concat(R.OPERATOR(a))}return t},z.DICT=function(e){return R.DICT(e).length},R.OPERATOR=function(e){return e<1200?[e]:[12,e-1200]},R.OPERAND=function(e,t){var n=[];if(Array.isArray(t))for(var r=0;r<t.length;r+=1)L.argument(e.length===t.length,`Not enough arguments given for type`+t),n=n.concat(R.OPERAND(e[r],t[r]));else if(t===`SID`)n=n.concat(R.NUMBER(e));else if(t===`offset`)n=n.concat(R.NUMBER32(e));else if(t===`number`)n=n.concat(R.NUMBER(e));else if(t===`real`)n=n.concat(R.REAL(e));else throw Error(`Unknown operand type `+t);return n},R.OP=R.BYTE,z.OP=z.BYTE;var we=typeof WeakMap==`function`&&new WeakMap;R.CHARSTRING=function(e){if(we){var t=we.get(e);if(t!==void 0)return t}for(var n=[],r=e.length,i=0;i<r;i+=1){var a=e[i];n=n.concat(R[a.type](a.value))}return we&&we.set(e,n),n},z.CHARSTRING=function(e){return R.CHARSTRING(e).length},R.OBJECT=function(e){var t=R[e.type];return L.argument(t!==void 0,`No encoding function for type `+e.type),t(e.value)},z.OBJECT=function(e){var t=z[e.type];return L.argument(t!==void 0,`No sizeOf function for type `+e.type),t(e.value)},R.TABLE=function(e){for(var t=[],n=e.fields.length,r=[],i=[],a=0;a<n;a+=1){var o=e.fields[a],s=R[o.type];L.argument(s!==void 0,`No encoding function for field type `+o.type+` (`+o.name+`)`);var c=e[o.name];c===void 0&&(c=o.value);var l=s(c);o.type===`TABLE`?(i.push(t.length),t=t.concat([0,0]),r.push(l)):t=t.concat(l)}for(var u=0;u<r.length;u+=1){var d=i[u],f=t.length;L.argument(f<65536,`Table `+e.tableName+` too big.`),t[d]=f>>8,t[d+1]=f&255,t=t.concat(r[u])}return t},z.TABLE=function(e){for(var t=0,n=e.fields.length,r=0;r<n;r+=1){var i=e.fields[r],a=z[i.type];L.argument(a!==void 0,`No sizeOf function for field type `+i.type+` (`+i.name+`)`);var o=e[i.name];o===void 0&&(o=i.value),t+=a(o),i.type===`TABLE`&&(t+=2)}return t},R.RECORD=R.TABLE,z.RECORD=z.TABLE,R.LITERAL=function(e){return e},z.LITERAL=function(e){return e.length};function B(e,t,n){if(t.length&&(t[0].name!==`coverageFormat`||t[0].value===1))for(var r=0;r<t.length;r+=1){var i=t[r];this[i.name]=i.value}if(this.tableName=e,this.fields=t,n)for(var a=Object.keys(n),o=0;o<a.length;o+=1){var s=a[o],c=n[s];this[s]!==void 0&&(this[s]=c)}}B.prototype.encode=function(){return R.TABLE(this)},B.prototype.sizeOf=function(){return z.TABLE(this)};function Te(e,t,n){n===void 0&&(n=t.length);var r=Array(t.length+1);r[0]={name:e+`Count`,type:`USHORT`,value:n};for(var i=0;i<t.length;i++)r[i+1]={name:e+i,type:`USHORT`,value:t[i]};return r}function Ee(e,t,n){var r=t.length,i=Array(r+1);i[0]={name:e+`Count`,type:`USHORT`,value:r};for(var a=0;a<r;a++)i[a+1]={name:e+a,type:`TABLE`,value:n(t[a],a)};return i}function De(e,t,n){var r=t.length,i=[];
1i[0]={name:e+`Count`,type:`USHORT`,value:r};for(var a=0;a<r;a++)i=i.concat(n(t[a],a));return i}function Oe(e){e.format===1?B.call(this,`coverageTable`,[{name:`coverageFormat`,type:`USHORT`,value:1}].concat(Te(`glyph`,e.glyphs))):e.format===2?B.call(this,`coverageTable`,[{name:`coverageFormat`,type:`USHORT`,value:2}].concat(De(`rangeRecord`,e.ranges,function(e){return[{name:`startGlyphID`,type:`USHORT`,value:e.start},{name:`endGlyphID`,type:`USHORT`,value:e.end},{name:`startCoverageIndex`,type:`USHORT`,value:e.index}]}))):L.assert(!1,`Coverage format must be 1 or 2.`)}Oe.prototype=Object.create(B.prototype),Oe.prototype.constructor=Oe;function ke(e){B.call(this,`scriptListTable`,De(`scriptRecord`,e,function(e,t){var n=e.script,r=n.defaultLangSys;return L.assert(!!r,`Unable to write GSUB: script `+e.tag+` has no default language system.`),[{name:`scriptTag`+t,type:`TAG`,value:e.tag},{name:`script`+t,type:`TABLE`,value:new B(`scriptTable`,[{name:`defaultLangSys`,type:`TABLE`,value:new B(`defaultLangSys`,[{name:`lookupOrder`,type:`USHORT`,value:0},{name:`reqFeatureIndex`,type:`USHORT`,value:r.reqFeatureIndex}].concat(Te(`featureIndex`,r.featureIndexes)))}].concat(De(`langSys`,n.langSysRecords,function(e,t){var n=e.langSys;return[{name:`langSysTag`+t,type:`TAG`,value:e.tag},{name:`langSys`+t,type:`TABLE`,value:new B(`langSys`,[{name:`lookupOrder`,type:`USHORT`,value:0},{name:`reqFeatureIndex`,type:`USHORT`,value:n.reqFeatureIndex}].concat(Te(`featureIndex`,n.featureIndexes)))}]})))}]}))}ke.prototype=Object.create(B.prototype),ke.prototype.constructor=ke;function Ae(e){B.call(this,`featureListTable`,De(`featureRecord`,e,function(e,t){var n=e.feature;return[{name:`featureTag`+t,type:`TAG`,value:e.tag},{name:`feature`+t,type:`TABLE`,value:new B(`featureTable`,[{name:`featureParams`,type:`USHORT`,value:n.featureParams}].concat(Te(`lookupListIndex`,n.lookupListIndexes)))}]}))}Ae.prototype=Object.create(B.prototype),Ae.prototype.constructor=Ae;function je(e,t){B.call(this,`lookupListTable`,Ee(`lookup`,e,function(e){var n=t[e.lookupType];return L.assert(!!n,`Unable to write GSUB lookup type `+e.lookupType+` tables.`),new B(`lookupTable`,[{name:`lookupType`,type:`USHORT`,value:e.lookupType},{name:`lookupFlag`,type:`USHORT`,value:e.lookupFlag}].concat(Ee(`subtable`,e.subtables,n)))}))}je.prototype=Object.create(B.prototype),je.prototype.constructor=je;var V={Table:B,Record:B,Coverage:Oe,ScriptList:ke,FeatureList:Ae,LookupList:je,ushortList:Te,tableList:Ee,recordList:De};function Me(e,t){return e.getUint8(t)}function Ne(e,t){return e.getUint16(t,!1)}function Pe(e,t){return e.getInt16(t,!1)}function Fe(e,t){return e.getUint32(t,!1)}function Ie(e,t){return e.getInt16(t,!1)+e.getUint16(t+2,!1)/65535}function Le(e,t){for(var n=``,r=t;r<t+4;r+=1)n+=String.fromCharCode(e.getInt8(r));return n}function Re(e,t,n){for(var r=0,i=0;i<n;i+=1)r<<=8,r+=e.getUint8(t+i);return r}function ze(e,t,n){for(var r=[],i=t;i<n;i+=1)r.push(e.getUint8(i));return r}function Be(e){for(var t=``,n=0;n<e.length;n+=1)t+=String.fromCharCode(e[n]);return t}var Ve={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};function H(e,t){this.data=e,this.offset=t,this.relativeOffset=0}H.prototype.parseByte=function(){var e=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},H.prototype.parseChar=function(){var e=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,e},H.prototype.parseCard8=H.prototype.parseByte,H.prototype.parseUShort=function(){var e=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},H.prototype.parseCard16=H.prototype.parseUShort,H.prototype.parseSID=H.prototype.parseUShort,H.prototype.parseOffset16=H.prototype.parseUShort,H.prototype.parseShort=function(){var e=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,e},H.prototype.parseF2Dot14=function(){var e=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,e},H.prototype.parseULong=function(){var e=Fe(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},H.prototype.parseOffset32=H.prototype.parseULong,H.prototype.parseFixed=function(){var e=Ie(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,e},H.prototype.parseString=function(e){var t=this.data,n=this.offset+this.relativeOffset,r=``;this.relativeOffset+=e;for(var i=0;i<e;i++)r+=String.fromCharCode(t.getUint8(n+i));return r},H.prototype.parseTag=function(){return this.parseString(4)},H.prototype.parseLongDateTime=function(){var e=Fe(this.data,this.offset+this.relativeOffset+4);return e-=2082844800,this.relativeOffset+=8,e},H.prototype.parseVersion=function(e){var t=Ne(this.data,this.offset+this.relativeOffset),n=Ne(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,e===void 0&&(e=4096),t+n/e/10},H.prototype.skip=function(e,t){t===void 0&&(t=1),this.relativeOffset+=Ve[e]*t},H.prototype.parseULongList=function(e){e===void 0&&(e=this.parseULong());for(var t=Array(e),n=this.data,r=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=n.getUint32(r),r+=4;return this.relativeOffset+=e*4,t},H.prototype.parseOffset16List=H.prototype.parseUShortList=function(e){e===void 0&&(e=this.parseUShort());for(var t=Array(e),n=this.data,r=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=n.getUint16(r),r+=2;return this.relativeOffset+=e*2,t},H.prototype.parseShortList=function(e){for(var t=Array(e),n=this.data,r=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=n.getInt16(r),r+=2;return this.relativeOffset+=e*2,t},H.prototype.parseByteList=function(e){for(var t=Array(e),n=this.data,r=this.offset+this.relativeOffset,i=0;i<e;i++)t[i]=n.getUint8(r++);return this.relativeOffset+=e,t},H.prototype.parseList=function(e,t){t||(t=e,e=this.parseUShort());for(var n=Array(e),r=0;r<e;r++)n[r]=t.call(this);return n},H.prototype.parseList32=function(e,t){t||(t=e,e=this.parseULong());for(var n=Array(e),r=0;r<e;r++)n[r]=t.call(this);return n},H.prototype.parseRecordList=function(e,t){t||(t=e,e=this.parseUShort());for(var n=Array(e),r=Object.keys(t),i=0;i<e;i++){for(var a={},o=0;o<r.length;o++){var s=r[o];a[s]=t[s].call(this)}n[i]=a}return n},H.prototype.parseRecordList32=function(e,t){t||(t=e,e=this.parseULong());for(var n=Array(e),r=Object.keys(t),i=0;i<e;i++){for(var a={},o=0;o<r.length;o++){var s=r[o];a[s]=t[s].call(this)}n[i]=a}return n},H.prototype.parseStruct=function(e){if(typeof e==`function`)return e.call(this);for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var i=t[r];n[i]=e[i].call(this)}return n},H.prototype.parseValueRecord=function(e){if(e===void 0&&(e=this.parseUShort()),e!==0){var t={};return e&1&&(t.xPlacement=this.parseShort()),e&2&&(t.yPlacement=this.parseShort()),e&4&&(t.xAdvance=this.parseShort()),e&8&&(t.yAdvance=this.parseShort()),e&16&&(t.xPlaDevice=void 0,this.parseShort()),e&32&&(t.yPlaDevice=void 0,this.parseShort()),e&64&&(t.xAdvDevice=void 0,this.parseShort()),e&128&&(t.yAdvDevice=void 0,this.parseShort()),t}},H.prototype.parseValueRecordList=function(){for(var e=this.parseUShort(),t=this.parseUShort(),n=Array(t),r=0;r<t;r++)n[r]=this.parseValueRecord(e);return n},H.prototype.parsePointer=function(e){var t=this.parseOffset16();if(t>0)return new H(this.data,this.offset+t).parseStruct(e)},H.prototype.parsePointer32=function(e){var t=this.parseOffset32();if(t>0)return new H(this.data,this.offset+t).parseStruct(e)},H.prototype.parseListOfLists=function(e){for(var t=this.parseOffset16List(),n=t.length,r=this.relativeOffset,i=Array(n),a=0;a<n;a++){var o=t[a];if(o===0){i[a]=void 0;continue}if(this.relativeOffset=o,e){for(var s=this.parseOffset16List(),c=Array(s.length),l=0;l<s.length;l++)this.relativeOffset=o+s[l],c[l]=e.call(this);i[a]=c}else i[a]=this.parseUShortList()}return this.relativeOffset=r,i},H.prototype.parseCoverage=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort(),n=this.parseUShort();if(t===1)return{format:1,glyphs:this.parseUShortList(n)};if(t===2){for(var r=Array(n),i=0;i<n;i++)r[i]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:r}}throw Error(`0x`+e.toString(16)+`: Coverage format must be 1 or 2.`)},H.prototype.parseClassDef=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(t===2)return{format:2,ranges:this.parseRecordList({start:H.uShort,end:H.uShort,classId:H.uShort})};throw Error(`0x`+e.toString(16)+`: ClassDef format must be 1 or 2.`)},H.list=function(e,t){return function(){return this.parseList(e,t)}},H.list32=function(e,t){return function(){return this.parseList32(e,t)}},H.recordList=function(e,t){return function(){return this.parseRecordList(e,t)}},H.recordList32=function(e,t){return function(){return this.parseRecordList32(e,t)}},H.pointer=function(e){return function(){return this.parsePointer(e)}},H.pointer32=function(e){return function(){return this.parsePointer32(e)}},H.tag=H.prototype.parseTag,H.byte=H.prototype.parseByte,H.uShort=H.offset16=H.prototype.parseUShort,H.uShortList=H.prototype.parseUShortList,H.uLong=H.offset32=H.prototype.parseULong,H.uLongList=H.prototype.parseULongList,H.struct=H.prototype.parseStruct,H.coverage=H.prototype.parseCoverage,H.classDef=H.prototype.parseClassDef;var He={reserved:H.uShort,reqFeatureIndex:H.uShort,featureIndexes:H.uShortList};H.prototype.parseScriptList=function(){return this.parsePointer(H.recordList({tag:H.tag,script:H.pointer({defaultLangSys:H.pointer(He),langSysRecords:H.recordList({tag:H.tag,langSys:H.pointer(He)})})}))||[]},H.prototype.parseFeatureList=function(){return this.parsePointer(H.recordList({tag:H.tag,feature:H.pointer({featureParam
1s:H.offset16,lookupListIndexes:H.uShortList})}))||[]},H.prototype.parseLookupList=function(e){return this.parsePointer(H.list(H.pointer(function(){var t=this.parseUShort();L.argument(1<=t&&t<=9,`GPOS/GSUB lookup type `+t+` unknown.`);var n=this.parseUShort(),r=n&16;return{lookupType:t,lookupFlag:n,subtables:this.parseList(H.pointer(e[t])),markFilteringSet:r?this.parseUShort():void 0}})))||[]},H.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){var e=this.parseUShort(),t=this.parseUShort();return L.argument(e===1&&t<1,`GPOS/GSUB feature variations table unknown.`),this.parseRecordList32({conditionSetOffset:H.offset32,featureTableSubstitutionOffset:H.offset32})})||[]};var U={getByte:Me,getCard8:Me,getUShort:Ne,getCard16:Ne,getShort:Pe,getULong:Fe,getFixed:Ie,getTag:Le,getOffset:Re,getBytes:ze,bytesToString:Be,Parser:H};function Ue(e,t){t.parseUShort(),e.length=t.parseULong(),e.language=t.parseULong();var n;e.groupCount=n=t.parseULong(),e.glyphIndexMap={};for(var r=0;r<n;r+=1)for(var i=t.parseULong(),a=t.parseULong(),o=t.parseULong(),s=i;s<=a;s+=1)e.glyphIndexMap[s]=o,o++}function We(e,t,n,r,i){e.length=t.parseUShort(),e.language=t.parseUShort();var a;e.segCount=a=t.parseUShort()>>1,t.skip(`uShort`,3),e.glyphIndexMap={};for(var o=new U.Parser(n,r+i+14),s=new U.Parser(n,r+i+16+a*2),c=new U.Parser(n,r+i+16+a*4),l=new U.Parser(n,r+i+16+a*6),u=r+i+16+a*8,d=0;d<a-1;d+=1)for(var f=void 0,p=o.parseUShort(),m=s.parseUShort(),h=c.parseShort(),g=l.parseUShort(),_=m;_<=p;_+=1)g===0?f=_+h&65535:(u=l.offset+l.relativeOffset-2,u+=g,u+=(_-m)*2,f=U.getUShort(n,u),f!==0&&(f=f+h&65535)),e.glyphIndexMap[_]=f}function Ge(e,t){var n={};n.version=U.getUShort(e,t),L.argument(n.version===0,`cmap table version should be 0.`),n.numTables=U.getUShort(e,t+2);for(var r=-1,i=n.numTables-1;i>=0;--i){var a=U.getUShort(e,t+4+i*8),o=U.getUShort(e,t+4+i*8+2);if(a===3&&(o===0||o===1||o===10)||a===0&&(o===0||o===1||o===2||o===3||o===4)){r=U.getULong(e,t+4+i*8+4);break}}if(r===-1)throw Error(`No valid cmap sub-tables found.`);var s=new U.Parser(e,t+r);if(n.format=s.parseUShort(),n.format===12)Ue(n,s);else if(n.format===4)We(n,s,e,t,r);else throw Error(`Only format 4 and 12 cmap tables are supported (found format `+n.format+`).`);return n}function Ke(e,t,n){e.segments.push({end:t,start:t,delta:-(t-n),offset:0,glyphIndex:n})}function qe(e){e.segments.push({end:65535,start:65535,delta:1,offset:0})}function Je(e){var t=!0,n;for(n=e.length-1;n>0;--n)if(e.get(n).unicode>65535){console.log(`Adding CMAP format 12 (needed!)`),t=!1;break}var r=[{name:`version`,type:`USHORT`,value:0},{name:`numTables`,type:`USHORT`,value:t?1:2},{name:`platformID`,type:`USHORT`,value:3},{name:`encodingID`,type:`USHORT`,value:1},{name:`offset`,type:`ULONG`,value:t?12:20}];t||(r=r.concat([{name:`cmap12PlatformID`,type:`USHORT`,value:3},{name:`cmap12EncodingID`,type:`USHORT`,value:10},{name:`cmap12Offset`,type:`ULONG`,value:0}])),r=r.concat([{name:`format`,type:`USHORT`,value:4},{name:`cmap4Length`,type:`USHORT`,value:0},{name:`language`,type:`USHORT`,value:0},{name:`segCountX2`,type:`USHORT`,value:0},{name:`searchRange`,type:`USHORT`,value:0},{name:`entrySelector`,type:`USHORT`,value:0},{name:`rangeShift`,type:`USHORT`,value:0}]);var i=new V.Table(`cmap`,r);for(i.segments=[],n=0;n<e.length;n+=1){for(var a=e.get(n),o=0;o<a.unicodes.length;o+=1)Ke(i,a.unicodes[o],n);i.segments=i.segments.sort(function(e,t){return e.start-t.start})}qe(i);var s=i.segments.length,c=0,l=[],u=[],d=[],f=[],p=[],m=[];for(n=0;n<s;n+=1){var h=i.segments[n];h.end<=65535&&h.start<=65535?(l=l.concat({name:`end_`+n,type:`USHORT`,value:h.end}),u=u.concat({name:`start_`+n,type:`USHORT`,value:h.start}),d=d.concat({name:`idDelta_`+n,type:`SHORT`,value:h.delta}),f=f.concat({name:`idRangeOffset_`+n,type:`USHORT`,value:h.offset}),h.glyphId!==void 0&&(p=p.concat({name:`glyph_`+n,type:`USHORT`,value:h.glyphId}))):c+=1,!t&&h.glyphIndex!==void 0&&(m=m.concat({name:`cmap12Start_`+n,type:`ULONG`,value:h.start}),m=m.concat({name:`cmap12End_`+n,type:`ULONG`,value:h.end}),m=m.concat({name:`cmap12Glyph_`+n,type:`ULONG`,value:h.glyphIndex}))}if(i.segCountX2=(s-c)*2,i.searchRange=2**Math.floor(Math.log(s-c)/Math.log(2))*2,i.entrySelector=Math.log(i.searchRange/2)/Math.log(2),i.rangeShift=i.segCountX2-i.searchRange,i.fields=i.fields.concat(l),i.fields.push({name:`reservedPad`,type:`USHORT`,value:0}),i.fields=i.fields.concat(u),i.fields=i.fields.concat(d),i.fields=i.fields.concat(f),i.fields=i.fields.concat(p),i.cmap4Length=14+l.length*2+2+u.length*2+d.length*2+f.length*2+p.length*2,!t){var g=16+m.length*4;i.cmap12Offset=20+i.cmap4Length,i.fields=i.fields.concat([{name:`cmap12Format`,type:`USHORT`,value:12},{name:`cmap12Reserved`,type:`USHORT`,value:0},{name:`cmap12Length`,type:`ULONG`,value:g},{name:`cmap12Language`,type:`ULONG`,value:0},{name:`cmap12nGroups`,type:`ULONG`,value:m.length/3}]),i.fields=i.fields.concat(m)}return i}var Ye={parse:Ge,make:Je},Xe=`.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,end
1ash,dagger,daggerdbl,periodcentered,paragraph,bullet,quotesinglbase,quotedblbase,quotedblright,guillemotright,ellipsis,perthousand,questiondown,grave,acute,circumflex,tilde,macron,breve,dotaccent,dieresis,ring,cedilla,hungarumlaut,ogonek,caron,emdash,AE,ordfeminine,Lslash,Oslash,OE,ordmasculine,ae,dotlessi,lslash,oslash,oe,germandbls,onesuperior,logicalnot,mu,trademark,Eth,onehalf,plusminus,Thorn,onequarter,divide,brokenbar,degree,thorn,threequarters,twosuperior,registered,minus,eth,multiply,threesuperior,copyright,Aacute,Acircumflex,Adieresis,Agrave,Aring,Atilde,Ccedilla,Eacute,Ecircumflex,Edieresis,Egrave,Iacute,Icircumflex,Idieresis,Igrave,Ntilde,Oacute,Ocircumflex,Odieresis,Ograve,Otilde,Scaron,Uacute,Ucircumflex,Udieresis,Ugrave,Yacute,Ydieresis,Zcaron,aacute,acircumflex,adieresis,agrave,aring,atilde,ccedilla,eacute,ecircumflex,edieresis,egrave,iacute,icircumflex,idieresis,igrave,ntilde,oacute,ocircumflex,odieresis,ograve,otilde,scaron,uacute,ucircumflex,udieresis,ugrave,yacute,ydieresis,zcaron,exclamsmall,Hungarumlautsmall,dollaroldstyle,dollarsuperior,ampersandsmall,Acutesmall,parenleftsuperior,parenrightsuperior,266 ff,onedotenleader,zerooldstyle,oneoldstyle,twooldstyle,threeoldstyle,fouroldstyle,fiveoldstyle,sixoldstyle,sevenoldstyle,eightoldstyle,nineoldstyle,commasuperior,threequartersemdash,periodsuperior,questionsmall,asuperior,bsuperior,centsuperior,dsuperior,esuperior,isuperior,lsuperior,msuperior,nsuperior,osuperior,rsuperior,ssuperior,tsuperior,ff,ffi,ffl,parenleftinferior,parenrightinferior,Circumflexsmall,hyphensuperior,Gravesmall,Asmall,Bsmall,Csmall,Dsmall,Esmall,Fsmall,Gsmall,Hsmall,Ismall,Jsmall,Ksmall,Lsmall,Msmall,Nsmall,Osmall,Psmall,Qsmall,Rsmall,Ssmall,Tsmall,Usmall,Vsmall,Wsmall,Xsmall,Ysmall,Zsmall,colonmonetary,onefitted,rupiah,Tildesmall,exclamdownsmall,centoldstyle,Lslashsmall,Scaronsmall,Zcaronsmall,Dieresissmall,Brevesmall,Caronsmall,Dotaccentsmall,Macronsmall,figuredash,hypheninferior,Ogoneksmall,Ringsmall,Cedillasmall,questiondownsmall,oneeighth,threeeighths,fiveeighths,seveneighths,onethird,twothirds,zerosuperior,foursuperior,fivesuperior,sixsuperior,sevensuperior,eightsuperior,ninesuperior,zeroinferior,oneinferior,twoinferior,threeinferior,fourinferior,fiveinferior,sixinferior,seveninferior,eightinferior,nineinferior,centinferior,dollarinferior,periodinferior,commainferior,Agravesmall,Aacutesmall,Acircumflexsmall,Atildesmall,Adieresissmall,Aringsmall,AEsmall,Ccedillasmall,Egravesmall,Eacutesmall,Ecircumflexsmall,Edieresissmall,Igravesmall,Iacutesmall,Icircumflexsmall,Idieresissmall,Ethsmall,Ntildesmall,Ogravesmall,Oacutesmall,Ocircumflexsmall,Otildesmall,Odieresissmall,OEsmall,Oslashsmall,Ugravesmall,Uacutesmall,Ucircumflexsmall,Udieresissmall,Yacutesmall,Thornsmall,Ydieresissmall,001.000,001.001,001.002,001.003,Black,Bold,Book,Light,Medium,Regular,Roman,Semibold`.split(`,`),Ze=`................................space.exclam.quotedbl.numbersign.dollar.percent.ampersand.quoteright.parenleft.parenright.asterisk.plus.comma.hyphen.period.slash.zero.one.two.three.four.five.six.seven.eight.nine.colon.semicolon.less.equal.greater.question.at.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.bracketleft.backslash.bracketright.asciicircum.underscore.quoteleft.a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.braceleft.bar.braceright.asciitilde...................................exclamdown.cent.sterling.fraction.yen.florin.section.currency.quotesingle.quotedblleft.guillemotleft.guilsinglleft.guilsinglright.fi.fl..endash.dagger.daggerdbl.periodcentered..paragraph.bullet.quotesinglbase.quotedblbase.quotedblright.guillemotright.ellipsis.perthousand..questiondown..grave.acute.circumflex.tilde.macron.breve.dotaccent.dieresis..ring.cedilla..hungarumlaut.ogonek.caron.emdash.................AE..ordfeminine.....Lslash.Oslash.OE.ordmasculine......ae....dotlessi...lslash.oslash.oe.germandbls`.split(`.`),Qe=`................................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.t
1wosuperior.threesuperior.foursuperior.fivesuperior.sixsuperior.sevensuperior.eightsuperior.ninesuperior.zeroinferior.oneinferior.twoinferior.threeinferior.fourinferior.fiveinferior.sixinferior.seveninferior.eightinferior.nineinferior.centinferior.dollarinferior.periodinferior.commainferior.Agravesmall.Aacutesmall.Acircumflexsmall.Atildesmall.Adieresissmall.Aringsmall.AEsmall.Ccedillasmall.Egravesmall.Eacutesmall.Ecircumflexsmall.Edieresissmall.Igravesmall.Iacutesmall.Icircumflexsmall.Idieresissmall.Ethsmall.Ntildesmall.Ogravesmall.Oacutesmall.Ocircumflexsmall.Otildesmall.Odieresissmall.OEsmall.Oslashsmall.Ugravesmall.Uacutesmall.Ucircumflexsmall.Udieresissmall.Yacutesmall.Thornsmall.Ydieresissmall`.split(`.`),$e=`.notdef,.null,nonmarkingreturn,space,exclam,quotedbl,numbersign,dollar,percent,ampersand,quotesingle,parenleft,parenright,asterisk,plus,comma,hyphen,period,slash,zero,one,two,three,four,five,six,seven,eight,nine,colon,semicolon,less,equal,greater,question,at,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,bracketleft,backslash,bracketright,asciicircum,underscore,grave,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,braceleft,bar,braceright,asciitilde,Adieresis,Aring,Ccedilla,Eacute,Ntilde,Odieresis,Udieresis,aacute,agrave,acircumflex,adieresis,atilde,aring,ccedilla,eacute,egrave,ecircumflex,edieresis,iacute,igrave,icircumflex,idieresis,ntilde,oacute,ograve,ocircumflex,odieresis,otilde,uacute,ugrave,ucircumflex,udieresis,dagger,degree,cent,sterling,section,bullet,paragraph,germandbls,registered,copyright,trademark,acute,dieresis,notequal,AE,Oslash,infinity,plusminus,lessequal,greaterequal,yen,mu,partialdiff,summation,product,pi,integral,ordfeminine,ordmasculine,Omega,ae,oslash,questiondown,exclamdown,logicalnot,radical,florin,approxequal,Delta,guillemotleft,guillemotright,ellipsis,nonbreakingspace,Agrave,Atilde,Otilde,OE,oe,endash,emdash,quotedblleft,quotedblright,quoteleft,quoteright,divide,lozenge,ydieresis,Ydieresis,fraction,currency,guilsinglleft,guilsinglright,fi,fl,daggerdbl,periodcentered,quotesinglbase,quotedblbase,perthousand,Acircumflex,Ecircumflex,Aacute,Edieresis,Egrave,Iacute,Icircumflex,Idieresis,Igrave,Oacute,Ocircumflex,apple,Ograve,Uacute,Ucircumflex,Ugrave,dotlessi,circumflex,tilde,macron,breve,dotaccent,ring,cedilla,hungarumlaut,ogonek,caron,Lslash,lslash,Scaron,scaron,Zcaron,zcaron,brokenbar,Eth,eth,Yacute,yacute,Thorn,thorn,minus,multiply,onesuperior,twosuperior,threesuperior,onehalf,onequarter,threequarters,franc,Gbreve,gbreve,Idotaccent,Scedilla,scedilla,Cacute,cacute,Ccaron,ccaron,dcroat`.split(`,`);function et(e){this.font=e}et.prototype.charToGlyphIndex=function(e){var t=e.codePointAt(0),n=this.font.glyphs;if(n){for(var r=0;r<n.length;r+=1)for(var i=n.get(r),a=0;a<i.unicodes.length;a+=1)if(i.unicodes[a]===t)return r}return null};function tt(e){this.cmap=e}tt.prototype.charToGlyphIndex=function(e){return this.cmap.glyphIndexMap[e.codePointAt(0)]||0};function nt(e,t){this.encoding=e,this.charset=t}nt.prototype.charToGlyphIndex=function(e){var t=e.codePointAt(0),n=this.encoding[t];return this.charset.indexOf(n)};function rt(e){switch(e.version){case 1:this.names=$e.slice();break;case 2:this.names=Array(e.numberOfGlyphs);for(var t=0;t<e.numberOfGlyphs;t++)e.glyphNameIndex[t]<$e.length?this.names[t]=$e[e.glyphNameIndex[t]]:this.names[t]=e.names[e.glyphNameIndex[t]-$e.length];break;case 2.5:this.names=Array(e.numberOfGlyphs);for(var n=0;n<e.numberOfGlyphs;n++)this.names[n]=$e[n+e.glyphNameIndex[n]];break;case 3:this.names=[];break;default:this.names=[];break}}rt.prototype.nameToGlyphIndex=function(e){return this.names.indexOf(e)},rt.prototype.glyphIndexToName=function(e){return this.names[e]};function it(e){for(var t,n=e.tables.cmap.glyphIndexMap,r=Object.keys(n),i=0;i<r.length;i+=1){var a=r[i],o=n[a];t=e.glyphs.get(o),t.addUnicode(parseInt(a))}for(var s=0;s<e.glyphs.length;s+=1)t=e.glyphs.get(s),e.cffEncoding?e.isCIDFont?t.name=`gid`+s:t.name=e.cffEncoding.charset[s]:e.glyphNames.names&&(t.name=e.glyphNames.glyphIndexToName(s))}function at(e){e._IndexToUnicodeMap={};for(var t=e.tables.cmap.glyphIndexMap,n=Object.keys(t),r=0;r<n.length;r+=1){var i=n[r],a=t[i];e._IndexToUnicodeMap[a]===void 0?e._IndexToUnicodeMap[a]={unicodes:[parseInt(i)]}:e._IndexToUnicodeMap[a].unicodes.push(parseInt(i))}}function ot(e,t){t.lowMemory?at(e):it(e)}function st(e,t,n,r,i){e.beginPath(),e.moveTo(t,n),e.lineTo(r,i),e.stroke()}var ct={line:st};function lt(e,t){var n=t||new I;return{configurable:!0,get:function(){return typeof n==`function`&&(n=n()),n},set:function(e){n=e}}}function W(e){this.bindConstructorValues(e)}W.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.yM
vendor: 4,590 bytes, line 1
1ax),`advanceWidth`in e&&(this.advanceWidth=e.advanceWidth),Object.defineProperty(this,"path",lt(this,e.path))},W.prototype.addUnicode=function(e){this.unicodes.length===0&&(this.unicode=e),this.unicodes.push(e)},W.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},W.prototype.getPath=function(e,t,n,r,i){e=e===void 0?0:e,t=t===void 0?0:t,n=n===void 0?72:n;var a,o;r||(r={});var s=r.xScale,c=r.yScale;if(r.hinting&&i&&i.hinting&&(o=this.path&&i.hinting.exec(this,n)),o)a=i.hinting.getCommands(o),e=Math.round(e),t=Math.round(t),s=c=1;else{a=this.path.commands;var l=1/(this.path.unitsPerEm||1e3)*n;s===void 0&&(s=l),c===void 0&&(c=l)}for(var u=new I,d=0;d<a.length;d+=1){var f=a[d];f.type===`M`?u.moveTo(e+f.x*s,t+-f.y*c):f.type===`L`?u.lineTo(e+f.x*s,t+-f.y*c):f.type===`Q`?u.quadraticCurveTo(e+f.x1*s,t+-f.y1*c,e+f.x*s,t+-f.y*c):f.type===`C`?u.curveTo(e+f.x1*s,t+-f.y1*c,e+f.x2*s,t+-f.y2*c,e+f.x*s,t+-f.y*c):f.type===`Z`&&u.closePath()}return u},W.prototype.getContours=function(){if(this.points===void 0)return[];for(var e=[],t=[],n=0;n<this.points.length;n+=1){var r=this.points[n];t.push(r),r.lastPointOfContour&&(e.push(t),t=[])}return L.argument(t.length===0,`There are still points left in the current contour.`),e},W.prototype.getMetrics=function(){for(var e=this.path.commands,t=[],n=[],r=0;r<e.length;r+=1){var i=e[r];i.type!==`Z`&&(t.push(i.x),n.push(i.y)),(i.type===`Q`||i.type===`C`)&&(t.push(i.x1),n.push(i.y1)),i.type===`C`&&(t.push(i.x2),n.push(i.y2))}var a={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,t),yMax:Math.max.apply(null,n),leftSideBearing:this.leftSideBearing};return isFinite(a.xMin)||(a.xMin=0),isFinite(a.xMax)||(a.xMax=this.advanceWidth),isFinite(a.yMin)||(a.yMin=0),isFinite(a.yMax)||(a.yMax=0),a.rightSideBearing=this.advanceWidth-a.leftSideBearing-(a.xMax-a.xMin),a},W.prototype.draw=function(e,t,n,r,i){this.getPath(t,n,r,i).draw(e)},W.prototype.drawPoints=function(e,t,n,r){function i(t,n,r,i){e.beginPath();for(var a=0;a<t.length;a+=1)e.moveTo(n+t[a].x*i,r+t[a].y*i),e.arc(n+t[a].x*i,r+t[a].y*i,2,0,Math.PI*2,!1);e.closePath(),e.fill()}t=t===void 0?0:t,n=n===void 0?0:n,r=r===void 0?24:r;for(var a=1/this.path.unitsPerEm*r,o=[],s=[],c=this.path,l=0;l<c.commands.length;l+=1){var u=c.commands[l];u.x!==void 0&&o.push({x:u.x,y:-u.y}),u.x1!==void 0&&s.push({x:u.x1,y:-u.y1}),u.x2!==void 0&&s.push({x:u.x2,y:-u.y2})}e.fillStyle=`blue`,i(o,t,n,a),e.fillStyle=`red`,i(s,t,n,a)},W.prototype.drawMetrics=function(e,t,n,r){var i;t=t===void 0?0:t,n=n===void 0?0:n,r=r===void 0?24:r,i=1/this.path.unitsPerEm*r,e.lineWidth=1,e.strokeStyle=`black`,ct.line(e,t,-1e4,t,1e4),ct.line(e,-1e4,n,1e4,n);var a=this.xMin||0,o=this.yMin||0,s=this.xMax||0,c=this.yMax||0,l=this.advanceWidth||0;e.strokeStyle=`blue`,ct.line(e,t+a*i,-1e4,t+a*i,1e4),ct.line(e,t+s*i,-1e4,t+s*i,1e4),ct.line(e,-1e4,n+-o*i,1e4,n+-o*i),ct.line(e,-1e4,n+-c*i,1e4,n+-c*i),e.strokeStyle=`green`,ct.line(e,t+l*i,-1e4,t+l*i,1e4)};function ut(e,t,n){Object.defineProperty(e,t,{get:function(){return e.path,e[n]},set:function(t){e[n]=t},enumerable:!0,configurable:!0})}function dt(e,t){if(this.font=e,this.glyphs={},Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];r.path.unitsPerEm=e.unitsPerEm,this.glyphs[n]=r}this.length=t&&t.length||0}dt.prototype.get=function(e){if(this.glyphs[e]===void 0){this.font._push(e),typeof this.glyphs[e]==`function`&&(this.glyphs[e]=this.glyphs[e]());var t=this.glyphs[e],n=this.font._IndexToUnicodeMap[e];if(n)for(var r=0;r<n.unicodes.length;r++)t.addUnicode(n.unicodes[r]);this.font.cffEncoding?this.font.isCIDFont?t.name=`gid`+e:t.name=this.font.cffEncoding.charset[e]:this.font.glyphNames.names&&(t.name=this.font.glyphNames.glyphIndexToName(e)),this.glyphs[e].advanceWidth=this.font._hmtxTableData[e].advanceWidth,this.glyphs[e].leftSideBearing=this.font._hmtxTableData[e].leftSideBearing}else typeof this.glyphs[e]==`function`&&(this.glyphs[e]=this.glyphs[e]());return this.glyphs[e]},dt.prototype.push=function(e,t){this.glyphs[e]=t,this.length++};function ft(e,t){return new W({index:t,font:e})}function pt(e,t,n,r,i,a){return function(){var o=new W({index:t,font:e});return o.path=function(){n(o,r,i);var t=a(e.glyphs,o);return t.unitsPerEm=e.unitsPerEm,t},ut(o,`xMin`,`_xMin`),ut(o,`xMax`,`_xMax`),ut(o,`yMin`,`_yMin`),ut(o,`yMax`,`_yMax`),o}}function mt(e,t,n,r){return function(){var i=new W({index:t,font:e});return i.path=function(){var t=n(e,i,r);return t.unitsPerEm=e.unitsPerEm,t},i}}var ht={GlyphSet:dt,glyphLoader:ft,ttfGlyphLoader:pt,cffGlyphLoader:mt};function gt(e,t){if(e===t)return!0;
1if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n+=1)if(!gt(e[n],t[n]))return!1;return!0}else return!1}function _t(e){return e.length<1240?107:e.length<33900?1131:32768}function vt(e,t,n){var r=[],i=[],a=U.getCard16(e,t),o,s;if(a!==0){var c=U.getByte(e,t+2);o=t+(a+1)*c+2;for(var l=t+3,u=0;u<a+1;u+=1)r.push(U.getOffset(e,l,c)),l+=c;s=o+r[a]}else s=t+2;for(var d=0;d<r.length-1;d+=1){var f=U.getBytes(e,o+r[d],o+r[d+1]);n&&(f=n(f)),i.push(f)}return{objects:i,startOffset:t,endOffset:s}}function yt(e,t){var n=[],r=U.getCard16(e,t),i,a;if(r!==0){var o=U.getByte(e,t+2);i=t+(r+1)*o+2;for(var s=t+3,c=0;c<r+1;c+=1)n.push(U.getOffset(e,s,o)),s+=o;a=i+n[r]}else a=t+2;return{offsets:n,startOffset:t,endOffset:a}}function bt(e,t,n,r,i){var a=U.getCard16(n,r),o=0;if(a!==0){var s=U.getByte(n,r+2);o=r+(a+1)*s+2}var c=U.getBytes(n,o+t[e],o+t[e+1]);return i&&(c=i(c)),c}function xt(e){for(var t=``,n=15,r=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`.`,`E`,`E-`,null,`-`];;){var i=e.parseByte(),a=i>>4,o=i&15;if(a===n||(t+=r[a],o===n))break;t+=r[o]}return parseFloat(t)}function St(e,t){var n,r,i,a;if(t===28)return n=e.parseByte(),r=e.parseByte(),n<<8|r;if(t===29)return n=e.parseByte(),r=e.parseByte(),i=e.parseByte(),a=e.parseByte(),n<<24|r<<16|i<<8|a;if(t===30)return xt(e);if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return n=e.parseByte(),(t-247)*256+n+108;if(t>=251&&t<=254)return n=e.parseByte(),-(t-251)*256-n-108;throw Error(`Invalid b0 `+t)}function Ct(e){for(var t={},n=0;n<e.length;n+=1){var r=e[n][0],i=e[n][1],a=void 0;if(a=i.length===1?i[0]:i,t.hasOwnProperty(r)&&!isNaN(t[r]))throw Error(`Object `+t+` already has key `+r);t[r]=a}return t}function wt(e,t,n){t=t===void 0?0:t;var r=new U.Parser(e,t),i=[],a=[];for(n=n===void 0?e.length:n;r.relativeOffset<n;){var o=r.parseByte();o<=21?(o===12&&(o=1200+r.parseByte()),i.push([o,a]),a=[]):a.push(St(r,o))}return Ct(i)}function Tt(e,t){return t=t<=390?Xe[t]:e[t-391],t}function Et(e,t,n){for(var r={},i,a=0;a<t.length;a+=1){var o=t[a];if(Array.isArray(o.type)){var s=[];s.length=o.type.length;for(var c=0;c<o.type.length;c++)i=e[o.op]===void 0?void 0:e[o.op][c],i===void 0&&(i=o.value!==void 0&&o.value[c]!==void 0?o.value[c]:null),o.type[c]===`SID`&&(i=Tt(n,i)),s[c]=i;r[o.name]=s}else i=e[o.op],i===void 0&&(i=o.value===void 0?null:o.value),o.type===`SID`&&(i=Tt(n,i)),r[o.name]=i}return r}function Dt(e,t){var n={};return n.formatMajor=U.getCard8(e,t),n.formatMinor=U.getCard8(e,t+1),n.size=U.getCard8(e,t+2),n.offsetSize=U.getCard8(e,t+3),n.startOffset=t,n.endOffset=t+4,n}var Ot=[{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`}],kt=[{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 At(e,t){return Et(wt(e,0,e.byteLength),Ot,t)}function jt(e,t,n,r){return Et(wt(e,t,n),kt,r)}function Mt(e,t,n,r){for(var i=[],a=0;a<n.length;a+=1){var o=At(new DataView(new Uint8Array(n[a]).buffer),r);o._subrs=[],o._subrsBias=0,o._defaultWidthX=0,o._nominalWidthX=0;var s=o.private[0],c=o.private[1];if(s!==0&&c!==0){var l=jt(e,c+t,s,r);o._defaultWidthX=l.defaultWidthX,o._nominalWidthX=l.nominalWidthX,l.subrs!==0&&(o._subrs=vt(e,c+l.subrs+t).objects,o._subrsBias=_t(o._subrs)),o._privateDict=l}i.push(o)}return i}function Nt(e,t,n,r){var i,a,o=new U.Parser(e,t);--n;var s=[`.notdef`],c=o.parseCard8();if(c===0)for(var l=0;l<n;l+=1)i=o.parseSID(),s.push(Tt(r,i));else if(c===1)for(;s.length<=n;){i=o.parseSID(),a=o.parseCard8();for(var u=0;u<=a;u+=1)s.push(Tt(r,i)),i+=1}else if(c===2)for(;s.length<=n;){i=o.parseSID(),a=o.parseCard16();for(var d=0;d<=a;d+=1)s.push(Tt(r,i)),i+=1}else throw Error(`Unknown charset format `+c);return s}function Pt(e,t,n){var r,i={},a=new U.Parser(e,t),o=a.parseCard8();if(o===0)for(var s=a.parseCard8(),c=0;c<s;c+=1)r=a.parseCard8(),i[r]=c;else if(o===1){var l=a.parseCard8();r=1;for(var u=0;u<l;u+=1)for(var d=a.parseCard8(),f=a.parseCard8(),p=d;p<=d+f;p+=1)i[p]=r,r+=1}else throw Error(`Unknown encoding format `+o);return new nt(i,n)}function Ft(e,t,n){var r,i,a,o,s=new I,c=[],l=0,u=!1,d=!1,f=0,p=0,m,h,g,_;if(e.isCIDFont){var v=e.tables.cff.topDict._fdSelect[t.index],y=e.tables.cff.topDict._fdArray[v];m=y._subrs,h=y._subrsBias,g=y._defaultWidthX,_=y._nominalWidthX}else m=e.tables.cff.topDict._subrs,h=e.tables.cff.topDict._subrsBias,g=e.tables.cff.topDict._defaultWidthX,_=e.tables.cff.topDict._nominalWidthX;var b=g;function x(e,t){d&&s.closePath(),s.moveTo(e,t),d=!0}function S(){c.length%2!=0&&!u&&(b=c.shift()+_),l+=c.length>>1,c.length=0,u=!0}function C(n){for(var g,v,y,w,T,E,D,O,k,A,j,M,N=0;N<n.length;){var P=n[N];switch(N+=1,P){case 1:S();break;case 3:S();break;case 4:c.length>1&&!u&&(b=c.shift()+_,u=!0),p+=c.pop(),x(f,p);break;case 5:for(;c.length>0;)f+=c.shift(),p+=c.shift(),s.lineTo(f,p);break;case 6:for(;c.length>0&&(f+=c.shift(),s.lineTo(f,p),c.length!==0);)p+=c.shift(),s.lineTo(f,p);break;case 7:for(;c.length>0&&(p+=c.shift(),s.lineTo(f,p),c.length!==0);)f+=c.shift(),s.lineTo(f,p);break;case 8:for(;c.length>0;)r=f+c.shift(),i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),f=a+c.shift(),p=o+c.shift(),s.curveTo(r,i,a,o,f,p);break;case 10:T=c.pop()+h,E=m[T],E&&C(E);break;case 11:return;case 12:switch(P=n[N],N+=1,P){case 35:r=f+c.shift(),i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),D=a+c.shift(),O=o+c.shift(),k=D+c.shift(),A=O+c.shift(),j=k+c.shift(),M=A+c.shift(),f=j+c.shift(),p=M+c.shift(),c.shift(),s.curveTo(r,i,a,o,D,O),s.curveTo(k,A,j,M,f,p);break;case 34:r=f+c.shift(),i=p,a=r+c.shift(),o=i+c.shift(),D=a+c.shift(),O=o,k=D+c.shift(),A=o,j=k+c.shift(),M=p,f=j+c.shift(),s.curveTo(r,i,a,o,D,O),s.curveTo(k,A,j,M,f,p);break;case 36:r=f+c.shift(),i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),D=a+c.shift(),O=o,k=D+c.shift(),A=o,j=k+c.shift(),M=A+c.shift(),f=j+c.shift(),s.curveTo(r,i,a,o,D,O),s.curveTo(k,A,j,M,f,p);break;case 37:r=f+c.shift(),i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),D=a+c.shift(),O=o+c.shift(),k=D+c.shift(),A=O+c.shift(),j=k+c.shift(),M=A+c.shift(),Math.abs(j-f)>Math.abs(M-p)?f=j+c.shift():p=M+c.shift(),s.curveTo(r,i,a,o,D,O),s.curveTo(k,A,j,M,f,p);break;default:console.log(`Glyph `+t.index+`: unknown operator 1200`+P),c.length=0}break;case 14:c.length>0&&!u&&(b=c.shift()+_,u=!0),d&&(s.closePath(),d=!1);break;case 18:S();break;case 19:case 20:S(),N+=l+7>>3;break;case 21:c.length>2&&!u&&(b=c.shift()+_,u=!0),p+=c.pop(),f+=c.pop(),x(f,p);break;case 22:c.length>1&&!u&&(b=c.shift()+_,u=!0),f+=c.pop(),x(f,p);break;case 23:S();break;case 24:for(;c.length>2;)r=f+c.shift(),i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),f=a+c.shift(),p=o+c.shift(),s.curveTo(r,i,a,o,f,p);f+=c.shift(),p+=c.shift(),s.lineTo(f,p);break;case 25:for(;c.length>6;)f+=c.shift(),p+=c.shift(),s.lineTo(f,p);r=f+c.shift(),i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),f=a+c.shift(),p=o+c.shift(),s.curveTo(r,i,a,o,f,p);break;case 26:for(c.length%2&&(f+=c.shift());c.length>0;)r=f,i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),f=a,p=o+c.shift(),s.curveTo(r,i,a,o,f,p);break;case 27:for(c.length%2&&(p+=c.shift());c.length>0;)r=f+c.shift(),i=p,a=r+c.shift(),o=i+c.shift(),f=a+c.shift(),p=o,s.curveTo(r,i,a,o,f,p);break;case 28:g=n[N],v=n[N+1],c.push((g<<24|v<<16)>>16),N+=2;break;case 29:T=c.pop()+e.gsubrsBias,E=e.gsubrs[T],E&&C(E);break;case 30:for(;c.length>0&&(r=f,i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),f=a+c.shift(),p=o+(c.length===1?c.shift():0),s.curveTo(r,i,a,o,f,p),c.length!==0);)r=f+c.shift(),i=p,a=r+c.shift(),o=i+c.shift(),p=o+c.shift(),f=a+(c.length===1?c.shift():0),s.curveTo(r,i,a,o,f,p);break;case 31:for(;c.length>0&&(r=f+c.shift(),i=p,a=r+c.shift(),o=i+c.shift(),p=o+c.shift(),f=a+(c.length===1?c.shift():0),s.curveTo(r,i,a,o,f,p),c.length!==0);)r=f,i=p+c.shift(),a=r+c.shift(),o=i+c.shift(),f=a+c.shift(),p=o+(c.length===1?c.shift():0),s.curveTo(r,i,a,o,f,p);break;default:P<32?console.log(`Glyph `+t.index+`: unknown operator `+P):P<247?c.push(P-139):P<251?(g=n[N],N+=1,c.push((P-247)
1*256+g+108)):P<255?(g=n[N],N+=1,c.push(-(P-251)*256-g-108)):(g=n[N],v=n[N+1],y=n[N+2],w=n[N+3],N+=4,c.push((g<<24|v<<16|y<<8|w)/65536))}}}return C(n),t.advanceWidth=b,s}function It(e,t,n,r){var i=[],a,o=new U.Parser(e,t),s=o.parseCard8();if(s===0)for(var c=0;c<n;c++){if(a=o.parseCard8(),a>=r)throw Error(`CFF table CID Font FDSelect has bad FD index value `+a+` (FD count `+r+`)`);i.push(a)}else if(s===3){var l=o.parseCard16(),u=o.parseCard16();if(u!==0)throw Error(`CFF Table CID Font FDSelect format 3 range has bad initial GID `+u);for(var d,f=0;f<l;f++){if(a=o.parseCard8(),d=o.parseCard16(),a>=r)throw Error(`CFF table CID Font FDSelect has bad FD index value `+a+` (FD count `+r+`)`);if(d>n)throw Error(`CFF Table CID Font FDSelect format 3 range has bad GID `+d);for(;u<d;u++)i.push(a);u=d}if(d!==n)throw Error(`CFF Table CID Font FDSelect format 3 range has bad final GID `+d)}else throw Error(`CFF Table CID Font FDSelect table has unsupported format `+s);return i}function Lt(e,t,n,r){n.tables.cff={};var i=vt(e,vt(e,Dt(e,t).endOffset,U.bytesToString).endOffset),a=vt(e,i.endOffset,U.bytesToString);n.gsubrs=vt(e,a.endOffset).objects,n.gsubrsBias=_t(n.gsubrs);var o=Mt(e,t,i.objects,a.objects);if(o.length!==1)throw Error(`CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = `+o.length);var s=o[0];if(n.tables.cff.topDict=s,s._privateDict&&(n.defaultWidthX=s._privateDict.defaultWidthX,n.nominalWidthX=s._privateDict.nominalWidthX),s.ros[0]!==void 0&&s.ros[1]!==void 0&&(n.isCIDFont=!0),n.isCIDFont){var c=s.fdArray,l=s.fdSelect;if(c===0||l===0)throw Error(`Font is marked as a CID font, but FDArray and/or FDSelect information is missing`);c+=t;var u=Mt(e,t,vt(e,c).objects,a.objects);s._fdArray=u,l+=t,s._fdSelect=It(e,l,n.numGlyphs,u.length)}var d=t+s.private[1],f=jt(e,d,s.private[0],a.objects);n.defaultWidthX=f.defaultWidthX,n.nominalWidthX=f.nominalWidthX,f.subrs===0?(n.subrs=[],n.subrsBias=0):(n.subrs=vt(e,d+f.subrs).objects,n.subrsBias=_t(n.subrs));var p;r.lowMemory?(p=yt(e,t+s.charStrings),n.nGlyphs=p.offsets.length):(p=vt(e,t+s.charStrings),n.nGlyphs=p.objects.length);var m=Nt(e,t+s.charset,n.nGlyphs,a.objects);if(s.encoding===0?n.cffEncoding=new nt(Ze,m):s.encoding===1?n.cffEncoding=new nt(Qe,m):n.cffEncoding=Pt(e,t+s.encoding,m),n.encoding=n.encoding||n.cffEncoding,n.glyphs=new ht.GlyphSet(n),r.lowMemory)n._push=function(r){var i=bt(r,p.offsets,e,t+s.charStrings);n.glyphs.push(r,ht.cffGlyphLoader(n,r,Ft,i))};else for(var h=0;h<n.nGlyphs;h+=1){var g=p.objects[h];n.glyphs.push(h,ht.cffGlyphLoader(n,h,Ft,g))}}function Rt(e,t){var n,r=Xe.indexOf(e);return r>=0&&(n=r),r=t.indexOf(e),r>=0?n=r+Xe.length:(n=Xe.length+t.length,t.push(e)),n}function zt(){return new V.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 Bt(e){var t=new V.Record(`Name INDEX`,[{name:`names`,type:`INDEX`,value:[]}]);t.names=[];for(var n=0;n<e.length;n+=1)t.names.push({name:`name_`+n,type:`NAME`,value:e[n]});return t}function Vt(e,t,n){for(var r={},i=0;i<e.length;i+=1){var a=e[i],o=t[a.name];o!==void 0&&!gt(o,a.value)&&(a.type===`SID`&&(o=Rt(o,n)),r[a.op]={name:a.name,type:a.type,value:o})}return r}function Ht(e,t){var n=new V.Record(`Top DICT`,[{name:`dict`,type:`DICT`,value:{}}]);return n.dict=Vt(Ot,e,t),n}function Ut(e){var t=new V.Record(`Top DICT INDEX`,[{name:`topDicts`,type:`INDEX`,value:[]}]);return t.topDicts=[{name:`topDict_0`,type:`TABLE`,value:e}],t}function Wt(e){var t=new V.Record(`String INDEX`,[{name:`strings`,type:`INDEX`,value:[]}]);t.strings=[];for(var n=0;n<e.length;n+=1)t.strings.push({name:`string_`+n,type:`STRING`,value:e[n]});return t}function Gt(){return new V.Record(`Global Subr INDEX`,[{name:`subrs`,type:`INDEX`,value:[]}])}function Kt(e,t){for(var n=new V.Record(`Charsets`,[{name:`format`,type:`Card8`,value:0}]),r=0;r<e.length;r+=1){var i=e[r],a=Rt(i,t);n.fields.push({name:`glyph_`+r,type:`SID`,value:a})}return n}function qt(e){var t=[],n=e.path;t.push({name:`width`,type:`NUMBER`,value:e.advanceWidth});for(var r=0,i=0,a=0;a<n.commands.length;a+=1){var o=void 0,s=void 0,c=n.commands[a];if(c.type===`Q`){var l=1/3,u=2/3;c={type:`C`,x:c.x,y:c.y,x1:Math.round(l*r+u*c.x1),y1:Math.round(l*i+u*c.y1),x2:Math.round(l*c.x+u*c.x1),y2:Math.round(l*c.y+u*c.y1)}}
vendor: 25,402 bytes, line 1
1if(c.type===`M`)o=Math.round(c.x-r),s=Math.round(c.y-i),t.push({name:`dx`,type:`NUMBER`,value:o}),t.push({name:`dy`,type:`NUMBER`,value:s}),t.push({name:`rmoveto`,type:`OP`,value:21}),r=Math.round(c.x),i=Math.round(c.y);else if(c.type===`L`)o=Math.round(c.x-r),s=Math.round(c.y-i),t.push({name:`dx`,type:`NUMBER`,value:o}),t.push({name:`dy`,type:`NUMBER`,value:s}),t.push({name:`rlineto`,type:`OP`,value:5}),r=Math.round(c.x),i=Math.round(c.y);else if(c.type===`C`){var d=Math.round(c.x1-r),f=Math.round(c.y1-i),p=Math.round(c.x2-c.x1),m=Math.round(c.y2-c.y1);o=Math.round(c.x-c.x2),s=Math.round(c.y-c.y2),t.push({name:`dx1`,type:`NUMBER`,value:d}),t.push({name:`dy1`,type:`NUMBER`,value:f}),t.push({name:`dx2`,type:`NUMBER`,value:p}),t.push({name:`dy2`,type:`NUMBER`,value:m}),t.push({name:`dx`,type:`NUMBER`,value:o}),t.push({name:`dy`,type:`NUMBER`,value:s}),t.push({name:`rrcurveto`,type:`OP`,value:8}),r=Math.round(c.x),i=Math.round(c.y)}}return t.push({name:`endchar`,type:`OP`,value:14}),t}function Jt(e){for(var t=new V.Record(`CharStrings INDEX`,[{name:`charStrings`,type:`INDEX`,value:[]}]),n=0;n<e.length;n+=1){var r=e.get(n),i=qt(r);t.charStrings.push({name:r.name,type:`CHARSTRING`,value:i})}return t}function Yt(e,t){var n=new V.Record(`Private DICT`,[{name:`dict`,type:`DICT`,value:{}}]);return n.dict=Vt(kt,e,t),n}function Xt(e,t){for(var n=new V.Table(`CFF `,[{name:`header`,type:`RECORD`},{name:`nameIndex`,type:`RECORD`},{name:`topDictIndex`,type:`RECORD`},{name:`stringIndex`,type:`RECORD`},{name:`globalSubrIndex`,type:`RECORD`},{name:`charsets`,type:`RECORD`},{name:`charStringsIndex`,type:`RECORD`},{name:`privateDict`,type:`RECORD`}]),r=1/t.unitsPerEm,i={version:t.version,fullName:t.fullName,familyName:t.familyName,weight:t.weightName,fontBBox:t.fontBBox||[0,0,0,0],fontMatrix:[r,0,0,r,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},a={},o=[],s,c=1;c<e.length;c+=1)s=e.get(c),o.push(s.name);var l=[];n.header=zt(),n.nameIndex=Bt([t.postScriptName]);var u=Ht(i,l);return n.topDictIndex=Ut(u),n.globalSubrIndex=Gt(),n.charsets=Kt(o,l),n.charStringsIndex=Jt(e),n.privateDict=Yt(a,l),n.stringIndex=Wt(l),i.charset=n.header.sizeOf()+n.nameIndex.sizeOf()+n.topDictIndex.sizeOf()+n.stringIndex.sizeOf()+n.globalSubrIndex.sizeOf(),i.encoding=0,i.charStrings=i.charset+n.charsets.sizeOf(),i.private[1]=i.charStrings+n.charStringsIndex.sizeOf(),u=Ht(i,l),n.topDictIndex=Ut(u),n}var Zt={parse:Lt,make:Xt};function Qt(e,t){var n={},r=new U.Parser(e,t);return n.version=r.parseVersion(),n.fontRevision=Math.round(r.parseFixed()*1e3)/1e3,n.checkSumAdjustment=r.parseULong(),n.magicNumber=r.parseULong(),L.argument(n.magicNumber===1594834165,`Font header has wrong magic number.`),n.flags=r.parseUShort(),n.unitsPerEm=r.parseUShort(),n.created=r.parseLongDateTime(),n.modified=r.parseLongDateTime(),n.xMin=r.parseShort(),n.yMin=r.parseShort(),n.xMax=r.parseShort(),n.yMax=r.parseShort(),n.macStyle=r.parseUShort(),n.lowestRecPPEM=r.parseUShort(),n.fontDirectionHint=r.parseShort(),n.indexToLocFormat=r.parseShort(),n.glyphDataFormat=r.parseShort(),n}function $t(e){var t=Math.round(new Date().getTime()/1e3)+2082844800,n=t;return e.createdTimestamp&&(n=e.createdTimestamp+2082844800),new V.Table(`head`,[{name:`version`,type:`FIXED`,value:65536},{name:`fontRevision`,type:`FIXED`,value:65536},{name:`checkSumAdjustment`,type:`ULONG`,value:0},{name:`magicNumber`,type:`ULONG`,value:1594834165},{name:`flags`,type:`USHORT`,value:0},{name:`unitsPerEm`,type:`USHORT`,value:1e3},{name:`created`,type:`LONGDATETIME`,value:n},{name:`modified`,type:`LONGDATETIME`,value:t},{name:`xMin`,type:`SHORT`,value:0},{name:`yMin`,type:`SHORT`,value:0},{name:`xMax`,type:`SHORT`,value:0},{name:`yMax`,type:`SHORT`,value:0},{name:`macStyle`,type:`USHORT`,value:0},{name:`lowestRecPPEM`,type:`USHORT`,value:0},{name:`fontDirectionHint`,type:`SHORT`,value:2},{name:`indexToLocFormat`,type:`SHORT`,value:0},{name:`glyphDataFormat`,type:`SHORT`,value:0}],e)}var en={parse:Qt,make:$t};function tn(e,t){var n={},r=new U.Parser(e,t);return n.version=r.parseVersion(),n.ascender=r.parseShort(),n.descender=r.parseShort(),n.lineGap=r.parseShort(),n.advanceWidthMax=r.parseUShort(),n.minLeftSideBearing=r.parseShort(),n.minRightSideBearing=r.parseShort(),n.xMaxExtent=r.parseShort(),n.caretSlopeRise=r.parseShort(),n.caretSlopeRun=r.parseShort(),n.caretOffset=r.parseShort(),r.relativeOffset+=8,n.metricDataFormat=r.parseShort(),n.numberOfHMetrics=r.parseUShort(),n}function nn(e){return new V.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 rn={parse:tn,make:nn};function an(e,t,n,r,i){for(var a,o,s=new U.Parser(e,t),c=0;c<r;c+=1){c<n&&(a=s.parseUShort(),o=s.parseShort());var l=i.get(c);l.advanceWidth=a,l.leftSideBearing=o}}function on(e,t,n,r,i){e._hmtxTableData={};for(var a,o,s=new U.Parser(t,n),c=0;c<i;c+=1)c<r&&(a=s.parseUShort(),o=s.parseShort()),e._hmtxTableData[c]={advanceWidth:a,leftSideBearing:o}}function sn(e,t,n,r,i,a,o){o.lowMemory?on(e,t,n,r,i):an(t,n,r,i,a)}function cn(e){for(var t=new V.Table(`hmtx`,[]),n=0;n<e.length;n+=1){var r=e.get(n),i=r.advanceWidth||0,a=r.leftSideBearing||0;t.fields.push({name:`advanceWidth_`+n,type:`USHORT`,value:i}),t.fields.push({name:`leftSideBearing_`+n,type:`SHORT`,value:a})}return t}var ln={parse:sn,make:cn};function un(e){for(var t=new V.Table(`ltag`,[{name:`version`,type:`ULONG`,value:1},{name:`flags`,type:`ULONG`,value:0},{name:`numTags`,type:`ULONG`,value:e.length}]),n=``,r=12+e.length*4,i=0;i<e.length;++i){var a=n.indexOf(e[i]);a<0&&(a=n.length,n+=e[i]),t.fields.push({name:`offset `+i,type:`USHORT`,value:r+a}),t.fields.push({name:`length `+i,type:`USHORT`,value:e[i].length})}return t.fields.push({name:`stringPool`,type:`CHARARRAY`,value:n}),t}function dn(e,t){var n=new U.Parser(e,t),r=n.parseULong();L.argument(r===1,`Unsupported ltag table version.`),n.skip(`uLong`,1);for(var i=n.parseULong(),a=[],o=0;o<i;o++){for(var s=``,c=t+n.parseUShort(),l=n.parseUShort(),u=c;u<c+l;++u)s+=String.fromCharCode(e.getInt8(u));a.push(s)}return a}var fn={make:un,parse:dn};function pn(e,t){var n={},r=new U.Parser(e,t);return n.version=r.parseVersion(),n.numGlyphs=r.parseUShort(),n.version===1&&(n.maxPoints=r.parseUShort(),n.maxContours=r.parseUShort(),n.maxCompositePoints=r.parseUShort(),n.maxCompositeContours=r.parseUShort(),n.maxZones=r.parseUShort(),n.maxTwilightPoints=r.parseUShort(),n.maxStorage=r.parseUShort(),n.maxFunctionDefs=r.parseUShort(),n.maxInstructionDefs=r.parseUShort(),n.maxStackElements=r.parseUShort(),n.maxSizeOfInstructions=r.parseUShort(),n.maxComponentElements=r.parseUShort(),n.maxComponentDepth=r.parseUShort()),n}function mn(e){return new V.Table(`maxp`,[{name:`version`,type:`FIXED`,value:20480},{name:`numGlyphs`,type:`USHORT`,value:e}])}var hn={parse:pn,make:mn},gn=[`copyright`,`fontFamily`,`fontSubfamily`,`uniqueID`,`fullName`,`version`,`postScriptName`,`trademark`,`manufacturer`,`designer`,`description`,`manufacturerURL`,`designerURL`,`license`,`licenseURL`,`reserved`,`preferredFamily`,`preferredSubfamily`,`compatibleFullName`,`sampleText`,`postScriptFindFontName`,`wwsFamily`,`wwsSubfamily`],_n={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`},vn={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},yn={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 bn(e,t,n){switch(e){case 0:if(t===65535)return`und`;if(n)return n[t];break;case 1:return _n[t];case 3:return yn[t]}}var xn=`utf-16`,Sn={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`},Cn={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 wn(e,t,n){switch(e){case 0:return xn;case 1:return Cn[n]||Sn[t];case 3:if(t===1||t===10)return xn;break}}function Tn(e,t,n){for(var r={},i=new U.Parser(e,t),a=i.parseUShort(),o=i.parseUShort(),s=i.offset+i.parseUShort(),c=0;c<o;c++){var l=i.parseUShort(),u=i.parseUShort(),d=i.parseUShort(),f=i.parseUShort(),p=gn[f]||f,m=i.parseUShort(),h=i.parseUShort(),g=bn(l,d,n),_=wn(l,u,d);if(_!==void 0&&g!==void 0){var v=void 0;if(v=_===xn?me.UTF16(e,s+h,m):me.MACSTRING(e,s+h,m,_),v){var y=r[p];y===void 0&&(y=r[p]={}),y[g]=v}}}return a===1&&i.parseUShort(),r}function En(e){var t={};for(var n in e)t[e[n]]=parseInt(n);return t}function Dn(e,t,n,r,i,a){return new V.Record(`NameRecord`,[{name:`platformID`,type:`USHORT`,value:e},{name:`encodingID`,type:`USHORT`,value:t},{name:`languageID`,type:`USHORT`,value:n},{name:`nameID`,type:`USHORT`,value:r},{name:`length`,type:`USHORT`,value:i},{name:`offset`,type:`USHORT`,value:a}])}function On(e,t){var n=e.length,r=t.length-n+1;loop:for(var i=0;i<r;i++)for(;i<r;i++){for(var a=0;a<n;a++)if(t[i+a]!==e[a])continue loop;return i}return-1}function kn(e,t){var n=On(e,t);if(n<0){n=t.length;for(var r=0,i=e.length;r<i;++r)t.push(e[r])}return n}function An(e,t){var n,r=[],i={},a=En(gn);for(var o in e){var s=a[o];if(s===void 0&&(s=o),n=parseInt(s),isNaN(n))throw Error(`Name table entry "`+o+`" does not exist, see nameTableNames for complete list.`);i[n]=e[o],r.push(n)}for(var c=En(_n),l=En(yn),u=[],d=[],f=0;f<r.length;f++){n=r[f];var p=i[n];for(var m in p){var h=p[m],g=1,_=c[m],v=vn[_],y=wn(g,v,_),b=R.MACSTRING(h,y);b===void 0&&(g=0,_=t.indexOf(m),_<0&&(_=t.length,t.push(m)),v=4,b=R.UTF16(h));var x=kn(b,d);u.push(Dn(g,v,_,n,b.length,x));var S=l[m];if(S!==void 0){var C=R.UTF16(h),w=kn(C,d);u.push(Dn(3,1,S,n,C.length,w))}}}u.sort(function(e,t){return e.platformID-t.platformID||e.encodingID-t.encodingID||e.languageID-t.languageID||e.nameID-t.nameID});for(var T=new V.Table(`name`,[{name:`format`,type:`USHORT`,value:0},{name:`count`,type:`USHORT`,value:u.length},{name:`stringOffset`,type:`USHORT`,value:6+u.length*12}]),E=0;E<u.length;E++)T.fields.push({name:`record_`+E,type:`RECORD`,value:u[E]});return T.fields.push({name:`strings`,type:`LITERAL`,value:d}),T}var jn={parse:Tn,make:An},Mn=[{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 Nn(e){for(var t=0;t<Mn.length;t+=1){var n=Mn[t];if(e>=n.begin&&e<n.end)return t}return-1}function Pn(e,t){var n={},r=new U.Parser(e,t);n.version=r.parseUShort(),n.xAvgCharWidth=r.parseShort(),n.usWeightClass=r.parseUShort(),n.usWidthClass=r.parseUShort(),n.fsType=r.parseUShort(),n.ySubscriptXSize=r.parseShort(),n.ySubscriptYSize=r.parseShort(),n.ySubscriptXOffset=r.parseShort(),n.ySubscriptYOffset=r.parseShort(),n.ySuperscriptXSize=r.parseShort(),n.ySuperscriptYSize=r.parseShort(),n.ySuperscriptXOffset=r.parseShort(),n.ySuperscriptYOffset=r.parseShort(),n.yStrikeoutSize=r.parseShort(),n.yStrikeoutPosition=r.parseShort(),n.sFamilyClass=r.parseShort(),n.panose=[];for(var i=0;i<10;i++)n.panose[i]=r.parseByte();return n.ulUnicodeRange1=r.parseULong(),n.ulUnicodeRange2=r.parseULong(),n.ulUnicodeRange3=r.parseULong(),n.ulUnicodeRange4=r.parseULong(),n.achVendID=String.fromCharCode(r.parseByte(),r.parseByte(),r.parseByte(),r.parseByte()),n.fsSelection=r.parseUShort(),n.usFirstCharIndex=r.parseUShort(),n.usLastCharIndex=r.parseUShort(),n.sTypoAscender=r.parseShort(),n.sTypoDescender=r.parseShort(),n.sTypoLineGap=r.parseShort(),n.usWinAscent=r.parseUShort(),n.usWinDescent=r.parseUShort(),n.version>=1&&(n.ulCodePageRange1=r.parseULong(),n.ulCodePageRange2=r.parseULong()),n.version>=2&&(n.sxHeight=r.parseShort(),n.sCapHeight=r.parseShort(),n.usDefaultChar=r.parseUShort(),n.usBreakChar=r.parseUShort(),n.usMaxContent=r.parseUShort()),n}function Fn(e){return new V.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 In={parse:Pn,make:Fn,unicodeRanges:Mn,getUnicodeRange:Nn};function Ln(e,t){var n={},r=new U.Parser(e,t);switch(n.version=r.parseVersion(),n.italicAngle=r.parseFixed(),n.underlinePosition=r.parseShort(),n.underlineThickness=r.parseShort(),n.isFixedPitch=r.parseULong(),n.minMemType42=r.parseULong(),n.maxMemType42=r.parseULong(),n.minMemType1=r.parseULong(),n.maxMemType1=r.parseULong(),n.version){case 1:n.names=$e.slice();break;case 2:n.numberOfGlyphs=r.parseUShort(),n.glyphNameIndex=Array(n.numberOfGlyphs);for(var i=0;i<n.numberOfGlyphs;i++)n.glyphNameIndex[i]=r.parseUShort();n.names=[];for(var a=0;a<n.numberOfGlyphs;a++)if(n.glyphNameIndex[a]>=$e.length){var o=r.parseChar();n.names.push(r.parseString(o))}break;case 2.5:n.numberOfGlyphs=r.parseUShort(),n.offset=Array(n.numberOfGlyphs);for(var s=0;s<n.numberOfGlyphs;s++)n.offset[s]=r.parseChar();break}return n}function Rn(){return new V.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 zn={parse:Ln,make:Rn},G=Array(9);G[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(H.coverage),deltaGlyphId:this.parseUShort()};if(t===2)return{substFormat:2,coverage:this.parsePointer(H.coverage),substitute:this.parseOffset16List()};L.assert(!1,`0x`+e.toString(16)+`: lookup type 1 format must be 1 or 2.`)},G[2]=function(){var e=this.parseUShort();return L.argument(e===1,`GSUB Multiple Substitution Subtable identifier-format must be 1`),{substFormat:e,coverage:this.parsePointer(H.coverage),sequences:this.parseListOfLists()}},G[3]=function(){var e=this.parseUShort();return L.argument(e===1,`GSUB Alternate Substitution Subtable identifier-format must be 1`),{substFormat:e,coverage:this.parsePointer(H.coverage),alternateSets:this.parseListOfLists()}},G[4]=function(){var e=this.parseUShort();return L.argument(e===1,`GSUB ligature table identifier-format must be 1`),{substFormat:e,coverage:this.parsePointer(H.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};var Bn={sequenceIndex:H.uShort,lookupListIndex:H.uShort};G[5]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:t,coverage:this.parsePointer(H.coverage),ruleSets:this.parseListOfLists(function(){var e=this.parseUShort(),t=this.parseUShort();return{input:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,Bn)}})};if(t===2)return{substFormat:t,coverage:this.parsePointer(H.coverage),classDef:this.parsePointer(H.classDef),classSets:this.parseListOfLists(function(){var e=this.parseUShort(),t=this.parseUShort();return{classes:this.parseUShortList(e-1),lookupRecords:this.parseRecordList(t,Bn)}})};if(t===3){var n=this.parseUShort(),r=this.parseUShort();return{substFormat:t,coverages:this.parseList(n,H.pointer(H.coverage)),lookupRecords:this.parseRecordList(r,Bn)}}L.assert(!1,`0x`+e.toString(16)+`: lookup type 5 format must be 1, 2 or 3.`)},G[6]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{substFormat:1,coverage:this.parsePointer(H.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Bn)}})};if(t===2)return{substFormat:2,coverage:this.parsePointer(H.coverage),backtrackClassDef:this.parsePointer(H.classDef),inputClassDef:this.parsePointer(H.classDef),lookaheadClassDef:this.parsePointer(H.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input
1:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(Bn)}})};if(t===3)return{substFormat:3,backtrackCoverage:this.parseList(H.pointer(H.coverage)),inputCoverage:this.parseList(H.pointer(H.coverage)),lookaheadCoverage:this.parseList(H.pointer(H.coverage)),lookupRecords:this.parseRecordList(Bn)};L.assert(!1,`0x`+e.toString(16)+`: lookup type 6 format must be 1, 2 or 3.`)},G[7]=function(){var e=this.parseUShort();L.argument(e===1,`GSUB Extension Substitution subtable identifier-format must be 1`);var t=this.parseUShort(),n=new H(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:t,extension:G[t].call(n)}},G[8]=function(){var e=this.parseUShort();return L.argument(e===1,`GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1`),{substFormat:e,coverage:this.parsePointer(H.coverage),backtrackCoverage:this.parseList(H.pointer(H.coverage)),lookaheadCoverage:this.parseList(H.pointer(H.coverage)),substitutes:this.parseUShortList()}};function Vn(e,t){t=t||0;var n=new H(e,t),r=n.parseVersion(1);return L.argument(r===1||r===1.1,`Unsupported GSUB table version.`),r===1?{version:r,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(G)}:{version:r,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(G),variations:n.parseFeatureVariationsList()}}var Hn=Array(9);Hn[1]=function(e){return e.substFormat===1?new V.Table(`substitutionTable`,[{name:`substFormat`,type:`USHORT`,value:1},{name:`coverage`,type:`TABLE`,value:new V.Coverage(e.coverage)},{name:`deltaGlyphID`,type:`USHORT`,value:e.deltaGlyphId}]):new V.Table(`substitutionTable`,[{name:`substFormat`,type:`USHORT`,value:2},{name:`coverage`,type:`TABLE`,value:new V.Coverage(e.coverage)}].concat(V.ushortList(`substitute`,e.substitute)))},Hn[2]=function(e){return L.assert(e.substFormat===1,`Lookup type 2 substFormat must be 1.`),new V.Table(`substitutionTable`,[{name:`substFormat`,type:`USHORT`,value:1},{name:`coverage`,type:`TABLE`,value:new V.Coverage(e.coverage)}].concat(V.tableList(`seqSet`,e.sequences,function(e){return new V.Table(`sequenceSetTable`,V.ushortList(`sequence`,e))})))},Hn[3]=function(e){return L.assert(e.substFormat===1,`Lookup type 3 substFormat must be 1.`),new V.Table(`substitutionTable`,[{name:`substFormat`,type:`USHORT`,value:1},{name:`coverage`,type:`TABLE`,value:new V.Coverage(e.coverage)}].concat(V.tableList(`altSet`,e.alternateSets,function(e){return new V.Table(`alternateSetTable`,V.ushortList(`alternate`,e))})))},Hn[4]=function(e){return L.assert(e.substFormat===1,`Lookup type 4 substFormat must be 1.`),new V.Table(`substitutionTable`,[{name:`substFormat`,type:`USHORT`,value:1},{name:`coverage`,type:`TABLE`,value:new V.Coverage(e.coverage)}].concat(V.tableList(`ligSet`,e.ligatureSets,function(e){return new V.Table(`ligatureSetTable`,V.tableList(`ligature`,e,function(e){return new V.Table(`ligatureTable`,[{name:`ligGlyph`,type:`USHORT`,value:e.ligGlyph}].concat(V.ushortList(`component`,e.components,e.components.length+1)))}))})))},Hn[6]=function(e){if(e.substFormat===1)return new V.Table(`chainContextTable`,[{name:`substFormat`,type:`USHORT`,value:e.substFormat},{name:`coverage`,type:`TABLE`,value:new V.Coverage(e.coverage)}].concat(V.tableList(`chainRuleSet`,e.chainRuleSets,function(e){return new V.Table(`chainRuleSetTable`,V.tableList(`chainRule`,e,function(e){var t=V.ushortList(`backtrackGlyph`,e.backtrack,e.backtrack.length).concat(V.ushortList(`inputGlyph`,e.input,e.input.length+1)).concat(V.ushortList(`lookaheadGlyph`,e.lookahead,e.lookahead.length)).concat(V.ushortList(`substitution`,[],e.lookupRecords.length));return e.lookupRecords.forEach(function(e,n){t=t.concat({name:`sequenceIndex`+n,type:`USHORT`,value:e.sequenceIndex}).concat({name:`lookupListIndex`+n,type:`USHORT`,value:e.lookupListIndex})}),new V.Table(`chainRuleTable`,t)}))})));if(e.substFormat===2)L.assert(!1,`lookup type 6 format 2 is not yet supported.`);else if(e.substFormat===3){var t=[{name:`substFormat`,type:`USHORT`,value:e.substFormat}];return t.push({name:`backtrackGlyphCount`,type:`USHORT`,value:e.backtrackCoverage.length}),e.backtrackCoverage.forEach(function(e,n){t.push({name:`backtrackCoverage`+n,type:`TABLE`,value:new V.Coverage(e)})}),t.push({name:`inputGlyphCount`,type:`USHORT`,value:e.inputCoverage.length}),e.inputCoverage.forEach(function(e,n){t.push({name:`inputCoverage`+n,type:`TABLE`,value:new V.Coverage(e)})}),t.push({name:`lookaheadGlyphCount`,type:`USHORT`,value:e.lookaheadCoverage.length}),e.lookaheadCoverage.forEach(function(e,n){t.push({name:`lookaheadCoverage`+n,type:`TABLE`,value:new V.Coverage(e)})}),t.push({name:`substitutionCount`,type:`USHORT`,value:e.lookupRecords.length}),e.lookupRecords.forEach(function(e,n){t=t.concat({name:`sequenceIndex`+n,type:`USHORT`,value:e.sequenceIndex}).concat({name:`lookupListIndex`+n,type:`USHORT`,value:e.lookupListIndex})}),new V.Table(`chainContextTable`,t)}L.assert(!1,`lookup type 6 format must be 1, 2 or 3.`)};function Un(e){return new V.Table(`GSUB`,[{name:`version`,type:`ULONG`,value:65536},{name:`scripts`,type:`TABLE`,value:new V.ScriptList(e.scripts)},{name:`features`,type:`TABLE`,value:new V.FeatureList(e.features)},{name:`lookups`,type:`TABLE`,value:new V.LookupList(e.lookups,Hn)}])}var Wn={parse:Vn,make:Un};function Gn(e,t){var n=new U.Parser(e,t),r=n.parseULong();L.argument(r===1,`Unsupported META table version.`),n.parseULong(),n.parseULong();for(var i=n.parseULong(),a={},o=0;o<i;o++){var s=n.parseTag(),c=n.parseULong(),l=n.parseULong();a[s]=me.UTF8(e,t+c,l)}return a}function Kn(e){var t=Object.keys(e).length,n=``,r=16+t*12,i=new V.Table(`meta`,[{name:`version`,type:`ULONG`,value:1},{name:`flags`,type:`ULONG`,value:0},{name:`offset`,type:`ULONG`,value:r},{name:`numTags`,type:`ULONG`,value:t}]);for(var a in e){var o=n.length;n+=e[a],i.fields.push({name:`tag `+a,type:`TAG`,value:a}),i.fields.push({name:`offset `+a,type:`ULONG`,value:r+o}),i.fields.push({name:`length `+a,type:`ULONG`,value:e[a].length})}return i.fields.push({name:`stringPool`,type:`CHARARRAY`,value:n}),i}var qn={parse:Gn,make:Kn};function Jn(e){return Math.log(e)/Math.log(2)|0}function Yn(e){for(;e.length%4!=0;)e.push(0);for(var t=0,n=0;n<e.length;n+=4)t+=(e[n]<<24)+(e[n+1]<<16)+(e[n+2]<<8)+e[n+3];return t%=2**32,t}function Xn(e,t,n,r){return new V.Record(`Table Record`,[{name:`tag`,type:`TAG`,value:e===void 0?``:e},{name:`checkSum`,type:`ULONG`,value:t===void 0?0:t},{name:`offset`,type:`ULONG`,value:n===void 0?0:n},{name:`length`,type:`ULONG`,value:r===void 0?0:r}])}function Zn(e){var t=new V.Table(`sfnt`,[{name:`version`,type:`TAG`,value:`OTTO`},{name:`numTables`,type:`USHORT`,value:0}
vendor: 37,186 bytes, line 1
1,{name:`searchRange`,type:`USHORT`,value:0},{name:`entrySelector`,type:`USHORT`,value:0},{name:`rangeShift`,type:`USHORT`,value:0}]);t.tables=e,t.numTables=e.length;var n=2**Jn(t.numTables);t.searchRange=16*n,t.entrySelector=Jn(n),t.rangeShift=t.numTables*16-t.searchRange;for(var r=[],i=[],a=t.sizeOf()+Xn().sizeOf()*t.numTables;a%4!=0;)a+=1,i.push({name:`padding`,type:`BYTE`,value:0});for(var o=0;o<e.length;o+=1){var s=e[o];L.argument(s.tableName.length===4,`Table name`+s.tableName+` is invalid.`);var c=s.sizeOf(),l=Xn(s.tableName,Yn(s.encode()),a,c);for(r.push({name:l.tag+` Table Record`,type:`RECORD`,value:l}),i.push({name:s.tableName+` table`,type:`RECORD`,value:s}),a+=c,L.argument(!isNaN(a),`Something went wrong calculating the offset.`);a%4!=0;)a+=1,i.push({name:`padding`,type:`BYTE`,value:0})}return r.sort(function(e,t){return e.value.tag>t.value.tag?1:-1}),t.fields=t.fields.concat(r),t.fields=t.fields.concat(i),t}function Qn(e,t,n){for(var r=0;r<t.length;r+=1){var i=e.charToGlyphIndex(t[r]);if(i>0)return e.glyphs.get(i).getMetrics()}return n}function $n(e){for(var t=0,n=0;n<e.length;n+=1)t+=e[n];return t/e.length}function er(e){for(var t=[],n=[],r=[],i=[],a=[],o=[],s=[],c,l=0,u=0,d=0,f=0,p=0,m=0;m<e.glyphs.length;m+=1){var h=e.glyphs.get(m),g=h.unicode|0;if(isNaN(h.advanceWidth))throw Error(`Glyph `+h.name+` (`+m+`): advanceWidth is not a number.`);(c>g||c===void 0)&&g>0&&(c=g),l<g&&(l=g);var _=In.getUnicodeRange(g);if(_<32)u|=1<<_;else if(_<64)d|=1<<_-32;else if(_<96)f|=1<<_-64;else if(_<123)p|=1<<_-96;else throw Error(`Unicode ranges bits > 123 are reserved for internal usage`);if(h.name!==`.notdef`){var v=h.getMetrics();t.push(v.xMin),n.push(v.yMin),r.push(v.xMax),i.push(v.yMax),o.push(v.leftSideBearing),s.push(v.rightSideBearing),a.push(h.advanceWidth)}}var y={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,r),yMax:Math.max.apply(null,i),advanceWidthMax:Math.max.apply(null,a),advanceWidthAvg:$n(a),minLeftSideBearing:Math.min.apply(null,o),maxLeftSideBearing:Math.max.apply(null,o),minRightSideBearing:Math.min.apply(null,s)};y.ascender=e.ascender,y.descender=e.descender;var b=en.make({flags:3,unitsPerEm:e.unitsPerEm,xMin:y.xMin,yMin:y.yMin,xMax:y.xMax,yMax:y.yMax,lowestRecPPEM:3,createdTimestamp:e.createdTimestamp}),x=rn.make({ascender:y.ascender,descender:y.descender,advanceWidthMax:y.advanceWidthMax,minLeftSideBearing:y.minLeftSideBearing,minRightSideBearing:y.minRightSideBearing,xMaxExtent:y.maxLeftSideBearing+(y.xMax-y.xMin),numberOfHMetrics:e.glyphs.length}),S=hn.make(e.glyphs.length),C=In.make(Object.assign({xAvgCharWidth:Math.round(y.advanceWidthAvg),usFirstCharIndex:c,usLastCharIndex:l,ulUnicodeRange1:u,ulUnicodeRange2:d,ulUnicodeRange3:f,ulUnicodeRange4:p,sTypoAscender:y.ascender,sTypoDescender:y.descender,sTypoLineGap:0,usWinAscent:y.yMax,usWinDescent:Math.abs(y.yMin),ulCodePageRange1:1,sxHeight:Qn(e,`xyvw`,{yMax:Math.round(y.ascender/2)}).yMax,sCapHeight:Qn(e,`HIKLEFJMNTZBDPRAGOQSUVWXY`,y).yMax,usDefaultChar:e.hasChar(` `)?32:0,usBreakChar:e.hasChar(` `)?32:0},e.tables.os2)),w=ln.make(e.glyphs),T=Ye.make(e.glyphs),E=e.getEnglishName(`fontFamily`),D=e.getEnglishName(`fontSubfamily`),O=E+` `+D,k=e.getEnglishName(`postScriptName`);k||(k=E.replace(/\s/g,``)+`-`+D);var A={};for(var j in e.names)A[j]=e.names[j];A.uniqueID||(A.uniqueID={en:e.getEnglishName(`manufacturer`)+`:`+O}),A.postScriptName||(A.postScriptName={en:k}),A.preferredFamily||(A.preferredFamily=e.names.fontFamily),A.preferredSubfamily||(A.preferredSubfamily=e.names.fontSubfamily);var M=[],N=jn.make(A,M),P=M.length>0?fn.make(M):void 0,ee=zn.make(),te=Zt.make(e.glyphs,{version:e.getEnglishName(`version`),fullName:O,familyName:E,weightName:D,postScriptName:k,unitsPerEm:e.unitsPerEm,fontBBox:[0,y.yMin,y.ascender,y.advanceWidthMax]}),F=e.metas&&Object.keys(e.metas).length>0?qn.make(e.metas):void 0,ne=[b,x,S,C,N,T,ee,te,w];P&&ne.push(P),e.tables.gsub&&ne.push(Wn.make(e.tables.gsub)),F&&ne.push(F);for(var re=Zn(ne),ie=Yn(re.encode()),ae=re.fields,oe=!1,se=0;se<ae.length;se+=1)if(ae[se].name===`head table`){ae[se].value.checkSumAdjustment=2981146554-ie,oe=!0;break}if(!oe)throw Error(`Could not find head table with checkSum to adjust.`);return re}var tr={make:Zn,fontToTable:er,computeCheckSum:Yn};function nr(e,t){for(var n=0,r=e.length-1;n<=r;){var i=n+r>>>1,a=e[i].tag;if(a===t)return i;a<t?n=i+1:r=i-1}return-n-1}function rr(e,t){for(var n=0,r=e.length-1;n<=r;){var i=n+r>>>1,a=e[i];if(a===t)return i;a<t?n=i+1:r=i-1}return-n-1}function ir(e,t){for(var n,r=0,i=e.length-1;r<=i;){var a=r+i>>>1;n=e[a];var o=n.start;if(o===t)return n;o<t?r=a+1:i=a-1}if(r>0)return n=e[r-1],t>n.end?0:n}function ar(e,t){this.font=e,this.tableName=t}ar.prototype={searchTag:nr,binSearch:rr,getTable:function(e){var t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){var e=this.getTable();return e?e.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var e=this.getTable();if(e){for(var t=!1,n=0;n<e.scripts.length;n++){var r=e.scripts[n].tag;if(r===`DFLT`)return r;r===`latn`&&(t=!0)}if(t)return`latn`}},getScriptTable:function(e,t){var n=this.getTable(t);if(n){e=e||`DFLT`;var r=n.scripts,i=nr(n.scripts,e);if(i>=0)return r[i].script;if(t){var a={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return r.splice(-1-i,0,a),a.script}}},getLangSysTable:function(e,t,n){var r=this.getScriptTable(e,n);if(r){if(!t||t===`dflt`||t===`DFLT`)return r.defaultLangSys;var i=nr(r.langSysRecords,t);if(i>=0)return r.langSysRecords[i].langSys;if(n){var a={tag:t,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return r.langSysRecords.splice(-1-i,0,a),a.langSys}}},getFeatureTable:function(e,t,n,r){var i=this.getLangSysTable(e,t,r);if(i){for(var a,o=i.featureIndexes,s=this.font.tables[this.tableName].features,c=0;c<o.length;c++)if(a=s[o[c]],a.tag===n)return a.feature;if(r){var l=s.length;return L.assert(l===0||n>=s[l-1].tag,`Features must be added in alphabetical order.`),a={tag:n,feature:{params:0,lookupListIndexes:[]}},s.push(a),o.push(l),a.feature}}},getLookupTables:function(e,t,n,r,i){var a=this.getFeatureTable(e,t,n,i),o=[];if(a){for(var s,c=a.lookupListIndexes,l=this.font.tables[this.tableName].lookups,u=0;u<c.length;u++)s=l[c[u]],s.lookupType===r&&o.push(s);if(o.length===0&&i){s={lookupType:r,lookupFlag:0,subtables:[],markFilteringSet:void 0};var d=l.length;return l.push(s),c.push(d),[s]}}return o},getGlyphClass:function(e,t){switch(e.format){case 1:return e.startGlyph<=t&&t<e.startGlyph+e.classes.length?e.classes[t-e.startGlyph]:0;case 2:var n=ir(e.ranges,t);return n?n.classId:0}},getCoverageIndex:function(e,t){switch(e.format){case 1:var n=rr(e.glyphs,t);return n>=0?n:-1;case 2:var r=ir(e.ranges,t);return r?r.index+t-r.start:-1}},expandCoverage:function(e){if(e.format===1)return e.glyphs;for(var t=[],n=e.ranges,r=0;r<n.length;r++)for(var i=n[r],a=i.start,o=i.end,s=a;s<=o;s++)t.push(s);return t}};function or(e){ar.call(this,e,`gpos`)}or.prototype=ar.prototype,or.prototype.init=function(){var e=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(e)},or.prototype.getKerningValue=function(e,t,n){for(var r=0;r<e.length;r++)for(var i=e[r].subtables,a=0;a<i.length;a++){var o=i[a],s=this.getCoverageIndex(o.coverage,t);if(!(s<0))switch(o.posFormat){case 1:for(var c=o.pairSets[s],l=0;l<c.length;l++){var u=c[l];if(u.secondGlyph===n)return u.value1&&u.value1.xAdvance||0}break;case 2:var d=this.getGlyphClass(o.classDef1,t),f=this.getGlyphClass(o.classDef2,n),p=o.classRecords[d][f];return p.value1&&p.value1.xAdvance||0}}return 0},or.prototype.getKerningTables=function(e,t){if(this.font.tables.gpos)return this.getLookupTables(e,t,`kern`,2)};function K(e){ar.call(this,e,`gsub`)}function sr(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function cr(e,t,n){for(var r=e.subtables,i=0;i<r.length;i++){var a=r[i];if(a.substFormat===t)return a}if(n)return r.push(n),n}K.prototype=ar.prototype,K.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:`DFLT`,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},K.prototype.getSingle=function(e,t,n){for(var r=[],i=this.getLookupTables(t,n,e,1),a=0;a<i.length;a++)for(var o=i[a].subtables,s=0;s<o.length;s++){var c=o[s],l=this.expandCoverage(c.coverage),u=void 0;if(c.substFormat===1){var d=c.deltaGlyphId;for(u=0;u<l.length;u++){var f=l[u];r.push({sub:f,by:f+d})}}else{var p=c.substitute;for(u=0;u<l.length;u++)r.push({sub:l[u],by:p[u]})}}return r},K.prototype.getMultiple=function(e,t,n){for(var r=[],i=this.getLookupTables(t,n,e,2),a=0;a<i.length;a++)for(var o=i[a].subtables,s=0;s<o.length;s++){var c=o[s],l=this.expandCoverage(c.coverage),u=void 0;for(u=0;u<l.length;u++){var d=l[u],f=c.sequences[u];r.push({sub:d,by:f})}}return r},K.prototype.getAlternates=function(e,t,n){for(var r=[],i=this.getLookupTables(t,n,e,3),a=0;a<i.length;a++)for(var o=i[a].subtables,s=0;s<o.length;s++)for(var c=o[s],l=this.expandCoverage(c.coverage),u=c.alternateSets,d=0;d<l.length;d++)r.push({sub:l[d],by:u[d]});return r},K.prototype.getLigatures=function(e,t,n){for(var r=[],i=this.getLookupTables(t,n,e,4),a=0;a<i.length;a++)for(var o=i[a].subtables,s=0;s<o.length;s++)for(var c=o[s],l=this.expandCoverage(c.coverage),u=c.ligatureSets,d=0;d<l.length;d++)for(var f=l[d],p=u[d],m=0;m<p.length;m++){var h=p[m];r.push({sub:[f].concat(h.components),by:h.ligGlyph})}return r},K.prototype.addSingle=function(e,t,n,r){var i=this.getLookupTables(n,r,e,1,!0)[0],a=cr(i,2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});L.assert(a.coverage.format===1,`Single: unable to modify coverage table format `+a.coverage.format);var o=t.sub,s=this.binSearch(a.coverage.glyphs,o);s<0&&(s=-1-s,a.coverage.glyphs.splice(s,0,o),a.substitute.splice(s,0,0)),a.substitute[s]=t.by},K.prototype.addMultiple=function(e,t,n,r){L.assert(t.by instanceof Array&&t.by.length>1,`Multiple: "by" must be an array of two or more ids`);var i=this.getLookupTables(n,r,e,2,!0)[0],a=cr(i,1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});L.assert(a.coverage.format===1,`Multiple: unable to modify coverage table format `+a.coverage.format);var o=t.sub,s=this.binSearch(a.coverage.glyphs,o);s<0&&(s=-1-s,a.coverage.glyphs.splice(s,0,o),a.sequences.splice(s,0,0)),a.sequences[s]=t.by},K.prototype.addAlternate=function(e,t,n,r){var i=this.getLookupTables(n,r,e,3,!0)[0],a=cr(i,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});L.assert(a.coverage.format===1,`Alternate: unable to modify coverage table format `+a.coverage.format);var o=t.sub,s=this.binSearch(a.coverage.glyphs,o);s<0&&(s=-1-s,a.coverage.glyphs.splice(s,0,o),a.alternateSets.splice(s,0,0)),a.alternateSets[s]=t.by},K.prototype.addLigature=function(e,t,n,r){var i=this.getLookupTables(n,r,e,4,!0)[0],a=i.subtables[0];a||(a={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},i.subtables[0]=a),L.assert(a.coverage.format===1,`Ligature: unable to modify coverage table format `+a.coverage.format);var o=t.sub[0],s=t.sub.slice(1),c={ligGlyph:t.by,components:s},l=this.binSearch(a.coverage.glyphs,o);if(l>=0){for(var u=a.ligatureSets[l],d=0;d<u.length;d++)if(sr(u[d].components,s))return;u.push(c)}else l=-1-l,a.coverage.glyphs.splice(l,0,o),a.ligatureSets.splice(l,0,[c])},K.prototype.getFeature=function(e,t,n){if(/ss\d\d/.test(e))return this.getSingle(e,t,n);switch(e){case`aalt`:case`salt`:return this.getSingle(e,t,n).concat(this.getAlternates(e,t,n));case`dlig`:case`liga`:case`rlig`:return this.getLigatures(e,t,n);case`ccmp`:return this.getMultiple(e,t,n).concat(this.getLigatures(e,t,n));case`stch`:return this.getMultiple(e,t,n)}},K.prototype.add=function(e,t,n,r){if(/ss\d\d/.test(e))return this.addSingle(e,t,n,r);switch(e){case`aalt`:case`salt`:return typeof t.by==`number`?this.addSingle(e,t,n,r):this.addAlternate(e,t,n,r);case`dlig`:case`liga`:case`rlig`:return this.addLigature(e,t,n,r);case`ccmp`:return t.by instanceof Array?this.addMultiple(e,t,n,r):this.addLigature(e,t,n,r)}};function lr(){return typeof window<`u`}function ur(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),r=0;r<e.length;++r)n[r]=e[r];return t}function dr(e){for(var t=new Buffer(e.byteLength),n=new Uint8Array(e),r=0;r<t.length;++r)t[r]=n[r];return t}function fr(e,t){if(!e)throw t}function pr(e,t,n,r,i){var a;return(t&r)>0?(a=e.parseByte(),(t&i)===0&&(a=-a),a=n+a):a=(t&i)>0?n:n+e.parseShort(),a}function mr(e,t,n){var r=new U.Parser(t,n);e.numberOfContours=r.parseShort(),e._xMin=r.parseShort(),e._yMin=r.parseShort(),e._xMax=r.parseShort(),e._yMax=r.parseShort();var i,a;if(e.numberOfContours>0){for(var o=e.endPointIndices=[],s=0;s<e.numberOfContours;s+=1)o.push(r.parseUShort());e.instructionLength=r.parseUShort(),e.instructions=[];for(var c=0;c<e.instructionLength;c+=1)e.instructions.push(r.parseByte());var l=o[o.length-1]+1;i=[];for(var u=0;u<l;u+=1)if(a=r.parseByte(),i.push(a),(a&8)>0)for(var d=r.parseByte(),f=0;f<d;f+=1)i.push(a),u+=1;if(L.argument(i.length===l,`Bad flags.`),o.length>0){var p=[],m;if(l>0){for(var h=0;h<l;h+=1)a=i[h],m={},m.onCurve=!!(a&1),m.lastPointOfContour=o.indexOf(h)>=0,p.push(m);for(var g=0,_=0;_<l;_+=1)a=i[_],m=p[_],m.x=pr(r,a,g,2,16),g=m.x;for(var v=0,y=0;y<l;y+=1)a=i[y],m=p[y],m.y=pr(r,a,v,4,32),v=m.y}e.points=p}else e.points=[]}else if(e.numberOfContours===0)e.points=[];else{e.isComposite=!0,e.points=[],e.components=[];for(var b=!0;b;){i=r.parseUShort();var x={glyphIndex:r.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(i&1)>0?(i&2)>0?(x.dx=r.parseShort(),x.dy=r.parseShort()):x.matchedPoints=[r.parseUShort(),r.parseUShort()]:(i&2)>0?(x.dx=r.parseChar(),x.dy=r.parseChar()):x.matchedPoints=[r.parseByte(),r.parseByte()],(i&8)>0?x.xScale=x.yScale=r.parseF2Dot14():(i&64)>0?(x.xScale=r.parseF2Dot14(),x.yScale=r.parseF2Dot14()):(i&128)>0&&(x.xScale=r.parseF2Dot14(),x.scale01=r.parseF2Dot14(),x.scale10=r.parseF2Dot14(),x.yScale=r.parseF2Dot14()),e.components.push(x),b=!!(i&32)}if(i&256){e.instructionLength=r.parseUShort(),e.instructions=[];for(var S=0;S<e.instructionLength;S+=1)e.instructions.push(r.parseByte())}}}function hr(e,t){for(var n=[],r=0;r<e.length;r+=1){var i=e[r],a={x:t.xScale*i.x+t.scale01*i.y+t.dx,y:t.scale10*i.x+t.yScale*i.y+t.dy,onCurve:i.onCurve,lastPointOfContour:i.lastPointOfContour};n.push(a)}return n}function gr(e){for(var t=[],n=[],r=0;r<e.length;r+=1){var i=e[r];n.push(i),i.lastPointOfContour&&(t.push(n),n=[])}return L.argument(n.length===0,`There are still points left in the current contour.`),t}function _r(e){var t=new I;if(!e)return t;for(var n=gr(e),r=0;r<n.length;++r){var i=n[r],a=null,o=i[i.length-1],s=i[0];if(o.onCurve)t.moveTo(o.x,o.y);else if(s.onCurve)t.moveTo(s.x,s.y);else{var c={x:(o.x+s.x)*.5,y:(o.y+s.y)*.5};t.moveTo(c.x,c.y)}for(var l=0;l<i.length;++l)if(a=o,o=s,s=i[(l+1)%i.length],o.onCurve)t.lineTo(o.x,o.y);else{var u=s;a.onCurve||((o.x+a.x)*.5,(o.y+a.y)*.5),s.onCurve||(u={x:(o.x+s.x)*.5,y:(o.y+s.y)*.5}),t.quadraticCurveTo(o.x,o.y,u.x,u.y)}t.closePath()}return t}function vr(e,t){if(t.isComposite)for(var n=0;n<t.components.length;n+=1){var r=t.components[n],i=e.get(r.glyphIndex);if(i.getPath(),i.points){var a=void 0;if(r.matchedPoints===void 0)a=hr(i.points,r);else{if(r.matchedPoints[0]>t.points.length-1||r.matchedPoints[1]>i.points.length-1)throw Error(`Matched points out of range in `+t.name);var o=t.points[r.matchedPoints[0]],s=i.points[r.matchedPoints[1]],c={xScale:r.xScale,scale01:r.scale01,scale10:r.scale10,yScale:r.yScale,dx:0,dy:0};s=hr([s],c)[0],c.dx=o.x-s.x,c.dy=o.y-s.y,a=hr(i.points,c)}t.points=t.points.concat(a)}}return _r(t.points)}function yr(e,t,n,r){for(var i=new ht.GlyphSet(r),a=0;a<n.length-1;a+=1){var o=n[a];o===n[a+1]?i.push(a,ht.glyphLoader(r,a)):i.push(a,ht.ttfGlyphLoader(r,a,mr,e,t+o,vr))}return i}function br(e,t,n,r){var i=new ht.GlyphSet(r);return r._push=function(a){var o=n[a];o===n[a+1]?i.push(a,ht.glyphLoader(r,a)):i.push(a,ht.ttfGlyphLoader(r,a,mr,e,t+o,vr))},i}function xr(e,t,n,r,i){return i.lowMemory?br(e,t,n,r):yr(e,t,n,r)}var Sr={getPath:_r,parse:xr},Cr,wr,Tr,Er;function Dr(e){this.font=e,this.getCommands=function(e){return Sr.getPath(e).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function Or(e){return e}function kr(e){return Math.sign(e)*Math.round(Math.abs(e))}function Ar(e){return Math.sign(e)*Math.round(Math.abs(e*2))/2}function jr(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function Mr(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function Nr(e){return Math.sign(e)*Math.floor(Math.abs(e))}var Pr=function(e){var t=this.srPeriod,n=this.srPhase,r=this.srThreshold,i=1;return e<0&&(e=-e,i=-1),e+=r-n,e=Math.trunc(e/t)*t,e+=n,e<0?n*i:e*i},Fr={x:1,y:0,axis:`x`,distance:function(e,t,n,r){return(n?e.xo:e.x)-(r?t.xo:t.x)},interpolate:function(e,t,n,r){var i,a,o,s,c,l,u;if(!r||r===this){if(i=e.xo-t.xo,a=e.xo-n.xo,c=t.x-t.xo,l=n.x-n.xo,o=Math.abs(i),s=Math.abs(a),u=o+s,u===0){e.x=e.xo+(c+l)/2;return}e.x=e.xo+(c*s+l*o)/u;return}if(i=r.distance(e,t,!0,!0),a=r.distance(e,n,!0,!0),c=r.distance(t,t,!1,!0),l=r.distance(n,n,!1,!0),o=Math.abs(i),s=Math.abs(a),u=o+s,u===0){Fr.setRelative(e,e,(c+l)/2,r,!0);return}Fr.setRelative(e,e,(c*s+l*o)/u,r,!0)},normalSlope:-1/0,setRelative:function(e,t,n,r,i){if(!r||r===this){e.x=(i?t.xo:t.x)+n;return}var a=i?t.xo:t.x,o=i?t.yo:t.y,s=a+n*r.x,c=o+n*r.y;e.x=s+(e.y-c)/r.normalSlope},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},Ir={x:0,y:1,axis:`y`,distance:function(e,t,n,r){return(n?e.yo:e.y)-(r?t.yo:t.y)},interpolate:function(e,t,n,r){var i,a,o,s,c,l,u;if(!r||r===this){if(i=e.yo-t.yo,a=e.yo-n.yo,c=t.y-t.yo,l=n.y-n.yo,o=Math.abs(i),s=Math.abs(a),u=o+s,u===0){e.y=e.yo+(c+l)/2;return}e.y=e.yo+(c*s+l*o)/u;return}if(i=r.distance(e,t,!0,!0),a=r.distance(e,n,!0,!0),c=r.distance(t,t,!1,!0),l=r.distance(n,n,!1,!0),o=Math.abs(i),s=Math.abs(a),u=o+s,u===0){Ir.setRelative(e,e,(c+l)/2,r,!0);return}Ir.setRelative(e,e,(c*s+l*o)/u,r,!0)},normalSlope:0,setRelative:function(e,t,n,r,i){if(!r||r===this){e.y=(i?t.yo:t.y)+n;return}var a=i?t.xo:t.x,o=i?t.yo:t.y,s=a+n*r.x;e.y=o+n*r.y+r.normalSlope*(e.x-s)},slope:1/0,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};Object.freeze(Fr),Object.freeze(Ir);function Lr(e,t){this.x=e,this.y=t,this.axis=void 0,this.slope=t/e,this.normalSlope=-e/t,Object.freeze(this)}Lr.prototype.distance=function(e,t,n,r){return this.x*Fr.distance(e,t,n,r)+this.y*Ir.distance(e,t,n,r)},Lr.prototype.interpolate=function(e,t,n,r){var i,a,o=r.distance(e,t,!0,!0),s=r.distance(e,n,!0,!0),c,l,u;if(i=r.distance(t,t,!1,!0),a=r.distance(n,n,!1,!0),c=Math.abs(o),l=Math.abs(s),u=c+l,u===0){this.setRelative(e,e,(i+a)/2,r,!0);return}this.setRelative(e,e,(i*l+a*c)/u,r,!0)},Lr.prototype.setRelative=function(e,t,n,r,i){r=r||this;var a=i?t.xo:t.x,o=i?t.yo:t.y,s=a+n*r.x,c=o+n*r.y,l=r.normalSlope,u=this.slope,d=e.x,f=e.y;e.x=(u*d-l*s+c-f)/(u-l),e.y=u*(e.x-d)+f},Lr.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0};function Rr(e,t){var n=Math.sqrt(e*e+t*t);return e/=n,t/=n,e===1&&t===0?Fr:e===0&&t===1?Ir:new Lr(e,t)}function zr(e,t,n,r){this.x=this.xo=Math.round(e*64)/64,this.y=this.yo=Math.round(t*64)/64,this.lastPointOfContour=n,this.onCurve=r,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}zr.prototype.nextTouched=function(e){for(var t=this.nextPointOnContour;!e.touched(t)&&t!==this;)t=t.nextPointOnContour;return t},zr.prototype.prevTouched=function(e){for(var t=this.prevPointOnContour;!e.touched(t)&&t!==this;)t=t.prevPointOnContour;return t};var Br=Object.freeze(new zr(0,0)),Vr={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function Hr(e,t){switch(this.env=e,this.stack=[],this.prog=t,e){case`glyf`:this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case`prep`:this.fv=this.pv=this.dpv=Fr,this.round=kr}}Dr.prototype.exec=function(e,t){if(typeof t!=`number`)throw Error(`Point size is not a number!`);if(!(this._errorState>2)){var n=this.font,r=this._prepState;if(!r||r.ppem!==t){var i=this._fpgmState;if(!i){Hr.prototype=Vr,i=this._fpgmState=new Hr(`fpgm`,n.tables.fpgm),i.funcs=[],i.font=n,exports.DEBUG&&(console.log(`---EXEC FPGM---`),i.step=-1);try{wr(i)}catch(e){console.log(`Hinting error in FPGM:`+e),this._errorState=3;return}}Hr.prototype=i,r=this._prepState=new Hr(`prep`,n.tables.prep),r.ppem=t;var a=n.tables.cvt;if(a)for(var o=r.cvt=Array(a.length),s=t/n.unitsPerEm,c=0;c<a.length;c++)o[c]=a[c]*s;else r.cvt=[];exports.DEBUG&&(console.log(`---EXEC PREP---`),r.step=-1);try{wr(r)}catch(e){this._errorState<2&&console.log(`Hinting error in PREP:`+e),this._errorState=2}}if(!(this._errorState>1))try{return Tr(e,r)}catch(e){this._errorState<1&&(console.log(`Hinting error:`+e),console.log(`Note: further hinting errors are silenced`)),this._errorState=1;return}}},Tr=function(e,t){var n=t.ppem/t.font.unitsPerEm,r=n,i=e.components,a,o,s;if(Hr.prototype=t,!i)s=new Hr(`glyf`,e.instructions),exports.DEBUG&&(console.log(`---EXEC GLYPH---`),s.step=-1),Er(e,s,n,r),o=s.gZone;else{var c=t.font;o=[],a=[];for(var l=0;l<i.length;l++){var u=i[l],d=c.glyphs.get(u.glyphIndex);s=new Hr(`glyf`,d.instructions),exports.DEBUG&&(console.log(`---EXEC COMP `+l+`---`),s.step=-1),Er(d,s,n,r);for(var f=Math.round(u.dx*n),p=Math.round(u.dy*r),m=s.gZone,h=s.contours,g=0;g<m.length;g++){var _=m[g];_.xTouched=_.yTouched=!1,_.xo=_.x+=f,_.yo=_.y+=p}var v=o.length;o.push.apply(o,m);for(var y=0;y<h.length;y++)a.push(h[y]+v)}e.instructions&&!s.inhibitGridFit&&(s=new Hr(`glyf`,e.instructions),s.gZone=s.z0=s.z1=s.z2=o,s.contours=a,o.push(new zr(0,0),new zr(Math.round(e.advanceWidth*n),0)),exports.DEBUG&&(console.log(`---EXEC COMPOSITE---`),s.step=-1),wr(s),o.length-=2)}return o},Er=function(e,t,n,r){for(var i=e.points||[],a=i.length,o=t.gZone=t.z0=t.z1=t.z2=[],s=t.contours=[],c,l=0;l<a;l++)c=i[l],o[l]=new zr(c.x*n,c.y*r,c.lastPointOfContour,c.onCurve);for(var u,d,f=0;f<a;f++)c=o[f],u||(u=c,s.push(f)),c.lastPointOfContour?(c.nextPointOnContour=u,u.prevPointOnContour=c,u=void 0):(d=o[f+1],c.nextPointOnContour=d,d.prevPointOnContour=c);if(!t.inhibitGridFit){if(exports.DEBUG){console.log(`PROCESSING GLYPH`,t.stack);for(var p=0;p<a;p++)console.log(p,o[p].x,o[p].y)}if(o.push(new zr(0,0),new zr(Math.round(e.advanceWidth*n),0)),wr(t),o.length-=2,exports.DEBUG){console.log(`FINISHED GLYPH`,t.stack);for(var m=0;m<a;m++)console.log(m,o[m].x,o[m].y)}}},wr=function(e){var t=e.prog;if(t){var n=t.length,r;for(e.ip=0;e.ip<n;e.ip++){if(exports.DEBUG&&e.step++,r=Cr[t[e.ip]],!r)throw Error(`unknown instruction: 0x`+Number(t[e.ip]).toString(16));r(e)}}};function Ur(e){for(var t=e.tZone=Array(e.gZone.length),n=0;n<t.length;n++)t[n]=new zr(0,0)}function Wr(e,t){var n=e.prog,r=e.ip,i=1,a;do if(a=n[++r],a===88)i++;else if(a===89)i--;else if(a===64)r+=n[r+1]+1;else if(a===65)r+=2*n[r+1]+1;else if(a>=176&&a<=183)r+=a-176+1;else if(a>=184&&a<=191)r+=(a-184+1)*2;else if(t&&i===1&&a===27)break;while(i>0);e.ip=r}function Gr(e,t){exports.DEBUG&&console.log(t.step,`SVTCA[`+e.axis+`]`),t.fv=t.pv=t.dpv=e}function Kr(e,t){exports.DEBUG&&console.log(t.step,`SPVTCA[`+e.axis+`]`),t.pv=t.dpv=e}function qr(e,t){exports.DEBUG&&console.log(t.step,`SFVTCA[`+e.axis+`]`),t.fv=e}function Jr(e,t){var n=t.stack,r=n.pop(),i=n.pop(),a=t.z2[r],o=t.z1[i];exports.DEBUG&&console.log(`SPVTL[`+e+`]`,r,i);var s,c;e?(s=a.y-o.y,c=o.x-a.x):(s=o.x-a.x,c=o.y-a.y),t.pv=t.dpv=Rr(s,c)}function Yr(e,t){var n=t.stack,r=n.pop(),i=n.pop(),a=t.z2[r],o=t.z1[i];exports.DEBUG&&console.log(`SFVTL[`+e+`]`,r,i);var s,c;e?(s=a.y-o.y,c=o.x-a.x):(s=o.x-a.x,c=o.y-a.y),t.fv=Rr(s,c)}function Xr(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`SPVFS[]`,n,r),e.pv=e.dpv=Rr(r,n)}function Zr(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`SPVFS[]`,n,r),e.fv=Rr(r,n)}function Qr(e){var t=e.stack,n=e.pv;exports.DEBUG&&console.log(e.step,`GPV[]`),t.push(n.x*16384),t.push(n.y*16384)}function $r(e){var t=e.stack,n=e.fv;exports.DEBUG&&console.log(e.step,`GFV[]`),t.push(n.x*16384),t.push(n.y*16384)}function ei(e){e.fv=e.pv,exports.DEBUG&&console.log(e.step,`SFVTPV[]`)}function ti(e){var t=e.stack,n=t.pop(),r=t.pop(),i=t.pop(),a=t.pop(),o=t.pop(),s=e.z0,c=e.z1,l=s[n],u=s[r],d=c[i],f=c[a],p=e.z2[o];exports.DEBUG&&console.log(`ISECT[], `,n,r,i,a,o);var m=l.x,h=l.y,g=u.x,_=u.y,v=d.x,y=d.y,b=f.x,x=f.y,S=(m-g)*(y-x)-(h-_)*(v-b),C=m*_-h*g,w=v*x-y*b;p.x=(C*(v-b)-w*(m-g))/S,p.y=(C*(y-x)-w*(h-_))/S}function ni(e){e.rp0=e.stack.pop(),exports.DEBUG&&console.log(e.step,`SRP0[]`,e.rp0)}function ri(e){e.rp1=e.stack.pop(),exports.DEBUG&&console.log(e.step,`SRP1[]`,e.rp1)}function ii(e){e.rp2=e.stack.pop(),exports.DEBUG&&console.log(e.step,`SRP2[]`,e.rp2)}function ai(e){var t=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,`SZP0[]`,t),e.zp0=t,t){case 0:e.tZone||Ur(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw Error(`Invalid zone pointer`)}}function oi(e){var t=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,`SZP1[]`,t),e.zp1=t,t){case 0:e.tZone||Ur(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw Error(`Invalid zone pointer`)}}function si(e){var t=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,`SZP2[]`,t),e.zp2=t,t){case 0:e.tZone||Ur(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw Error(`Invalid zone pointer`)}}function ci(e){var t=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,`SZPS[]`,t),e.zp0=e.zp1=e.zp2=t,t){case 0:e.tZone||Ur(e),e.z0=e.z1=e.z2=e.tZone;break;case 1:e.z0=e.z1=e.z2=e.gZone;break;default:throw Error(`Invalid zone pointer`)}}function li(e){e.loop=e.stack.pop(),exports.DEBUG&&console.log(e.step,`SLOOP[]`,e.loop)}function ui(e){exports.DEBUG&&console.log(e.step,`RTG[]`),e.round=kr}function di(e){exports.DEBUG&&console.log(e.step,`RTHG[]`),e.round=jr}function fi(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`SMD[]`,t),e.minDis=t/64}function pi(e){exports.DEBUG&&console.log(e.step,`ELSE[]`),Wr(e,!1)}function mi(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`JMPR[]`,t),e.ip+=t-1}function hi(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`SCVTCI[]`,t),e.cvCutIn=t/64}function gi(e){var t=e.stack;exports.DEBUG&&console.log(e.step,`DUP[]`),t.push(t[t.length-1])}function _i(e){exports.DEBUG&&console.log(e.step,`POP[]`),e.stack.pop()}function vi(e){exports.DEBUG&&console.log(e.step,`CLEAR[]`),e.stack.length=0}function yi(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`SWAP[]`),t.push(n),t.push(r)}function bi(e){var t=e.stack;exports.DEBUG&&console.log(e.step,`DEPTH[]`),t.push(t.length)}function xi(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`LOOPCALL[]`,n,r);var i=e.ip,a=e.prog;e.prog=e.funcs[n];for(var o=0;o<r;o++)wr(e),exports.DEBUG&&console.log(++e.step,o+1<r?`next loopcall`:`done loopcall`,o);e.ip=i,e.prog=a}function Si(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`CALL[]`,t);var n=e.ip,r=e.prog;e.prog=e.funcs[t],wr(e),e.ip=n,e.prog=r,exports.DEBUG&&console.log(++e.step,`returning from`,t)}function Ci(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`CINDEX[]`,n),t.push(t[t.length-n])}function wi(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`MINDEX[]`,n),t.push(t.splice(t.length-n,1)[0])}function Ti(e){if(e.env!==`fpgm`)throw Error(`FDEF not allowed here`);var t=e.stack,n=e.prog,r=e.ip,i=t.pop(),a=r;for(exports.DEBUG&&console.log(e.step,`FDEF[]`,i);n[++r]!==45;);e.ip=r,e.funcs[i]=n.slice(a+1,r)}function Ei(e,t){var n=t.stack.pop(),r=t.z0[n],i=t.fv,a=t.pv;exports.DEBUG&&console.log(t.step,`MDAP[`+e+`]`,n);var o=a.distance(r,Br);e&&(o=t.round(o)),i.setRelative(r,Br,o,a),i.touch(r),t.rp0=t.rp1=n}function Di(e,t){var n=t.z2,r=n.length-2,i,a,o;exports.DEBUG&&console.log(t.step,`IUP[`+e.axis+`]`);for(var s=0;s<r;s++)i=n[s],!e.touched(i)&&(a=i.prevTouched(e),a!==i&&(o=i.nextTouched(e),a===o&&e.setRelative(i,i,e.distance(a,a,!1,!0),e,!0),e.interpolate(i,a,o,e)))}function Oi(e,t){for(var n=t.stack,r=e?t.rp1:t.rp2,i=(e?t.z0:t.z1)[r],a=t.fv,o=t.pv,s=t.loop,c=t.z2;s--;){var l=n.pop(),u=c[l],d=o.distance(i,i,!1,!0);a.setRelative(u,u,d,o),a.touch(u),exports.DEBUG&&console.log(t.step,(t.loop>1?`loop `+(t.loop-s)+`: `:``)+`SHP[`+(e?`rp1`:`rp2`)+`]`,l)}t.loop=1}function ki(e,t){var n=t.stack,r=e?t.rp1:t.rp2,i=(e?t.z0:t.z1)[r],a=t.fv,o=t.pv,s=n.pop(),c=t.z2[t.contours[s]],l=c;exports.DEBUG&&console.log(t.step,`SHC[`+e+`]`,s);var u=o.distance(i,i,!1,!0);do l!==i&&a.setRelative(l,l,u,o),l=l.nextPointOnContour;while(l!==c)}function Ai(e,t){var n=t.stack,r=e?t.rp1:t.rp2,i=(e?t.z0:t.z1)[r],a=t.fv,o=t.pv,s=n.pop();exports.DEBUG&&console.log(t.step,`SHZ[`+e+`]`,s);var c;switch(s){case 0:c=t.tZone;break;case 1:c=t.gZone;break;default:throw Error(`Invalid zone`)}for(var l,u=o.distance(i,i,!1,!0),d=c.length-2,f=0;f<d;f++)l=c[f],a.setRelative(l,l,u,o)}function ji(e){for(var t=e.stack,n=e.loop,r=e.fv,i=t.pop()/64,a=e.z2;n--;){var o=t.pop(),s=a[o];exports.DEBUG&&console.log(e.step,(e.loop>1?`loop `+(e.loop-n)+`: `:``)+`SHPIX[]`,o,i),r.setRelative(s,s,i),r.touch(s)}e.loop=1}function Mi(e){for(var t=e.stack,n=e.rp1,r=e.rp2,i=e.loop,a=e.z0[n],o=e.z1[r],s=e.fv,c=e.dpv,l=e.z2;i--;){var u=t.pop(),d=l[u];exports.DEBUG&&console.log(e.step,(e.loop>1?`loop `+(e.loop-i)+`: `:``)+`IP[]`,u,n,`<->`,r),s.interpolate(d,a,o,c),s.touch(d)}e.loop=1}function Ni(e,t){var n=t.stack,r=n.pop()/64,i=n.pop(),a=t.z1[i],o=t.z0[t.rp0],s=t.fv,c=t.pv;s.setRelative(a,o,r,c),s.touch(a),exports.DEBUG&&console.log(t.step,`MSIRP[`+e+`]`,r,i),t.rp1=t.rp0,t.rp2=i,e&&(t.rp0=i)}function Pi(e){for(var t=e.stack,n=e.rp0,r=e.z0[n],i=e.loop,a=e.fv,o=e.pv,s=e.z1;i--;){var c=t.pop(),l=s[c];exports.DEBUG&&console.log(e.step,(e.loop>1?`loop `+(e.loop-i)+`: `:``)+`ALIGNRP[]`,c),a.setRelative(l,r,0,o),a.touch(l)}e.loop=1}function Fi(e){exports.DEBUG&&console.log(e.step,`RTDG[]`),e.round=Ar}function Ii(e,t){var n=t.stack,r=n.pop(),i=n.pop(),a=t.z0[i],o=t.fv,s=t.pv,c=t.cvt[r];exports.DEBUG&&console.log(t.step,`MIAP[`+e+`]`,r,`(`,c,`)`,i);var l=s.distance(a,Br);e&&(Math.abs(l-c)<t.cvCutIn&&(l=c),l=t.round(l)),o.setRelative(a,Br,l,s),t.zp0===0&&(a.xo=a.x,a.yo=a.y),o.touch(a),t.rp0=t.rp1=i}function Li(e){var t=e.prog,n=e.ip,r=e.stack,i=t[++n];exports.DEBUG&&console.log(e.step,`NPUSHB[]`,i);for(var a=0;a<i;a++)r.push(t[++n]);e.ip=n}function Ri(e){var t=e.ip,n=e.prog,r=e.stack,i=n[++t];exports.DEBUG&&console.log(e.step,`NPUSHW[]`,i);for(var a=0;a<i;a++){var o=n[++t]<<8|n[++t];o&32768&&(o=-((o^65535)+1)),r.push(o)}e.ip=t}function zi(e){var t=e.stack,n=e.store;n||(n=e.store=[]);var r=t.pop(),i=t.pop();exports.DEBUG&&console.log(e.step,`WS`,r,i),n[i]=r}function Bi(e){var t=e.stack,n=e.store,r=t.pop();exports.DEBUG&&console.log(e.step,`RS`,r);var i=n&&n[r]||0;t.push(i)}function Vi(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`WCVTP`,n,r),e.cvt[r]=n/64}function Hi(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`RCVT`,n),t.push(e.cvt[n]*64)}function Ui(e,t){var n=t.stack,r=n.pop(),i=t.z2[r];exports.DEBUG&&console.log(t.step,`GC[`+e+`]`,r),n.push(t.dpv.distance(i,Br,e,!1)*64)}function Wi(e,t){var n=t.stack,r=n.pop(),i=n.pop(),a=t.z1[r],o=t.z0[i],s=t.dpv.distance(o,a,e,e);exports.DEBUG&&console.log(t.step,`MD[`+e+`]`,r,i,`->`,s),t.stack.push(Math.round(s*64))}function Gi(e){exports.DEBUG&&console.log(e.step,`MPPEM[]`),e.stack.push(e.ppem)}function Ki(e){exports.DEBUG&&console.log(e.step,`FLIPON[]`),e.autoFlip=!0}function qi(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`LT[]`,n,r),t.push(+(r<n))}function Ji(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`LTEQ[]`,n,r),t.push(+(r<=n))}function Yi(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`GT[]`,n,r),t.push(+(r>n))}function Xi(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`GTEQ[]`,n,r),t.push(+(r>=n))}function Zi(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`EQ[]`,n,r),t.push(+(n===r))}function Qi(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`NEQ[]`,n,r),t.push(n===r?0:1)}function $i(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`ODD[]`,n),t.push(Math.trunc(n)%2?1:0)}function ea(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`EVEN[]`,n),t.push(Math.trunc(n)%2?0:1)}function ta(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`IF[]`,t),t||(Wr(e,!0),exports.DEBUG&&console.log(e.step,`EIF[]`))}function na(e){exports.DEBUG&&console.log(e.step,`EIF[]`)}function ra(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`AND[]`,n,r),t.push(n&&r?1:0)}function ia(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`OR[]`,n,r),t.push(n||r?1:0)}function aa(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`NOT[]`,n),t.push(+!n)}function oa(e,t){var n=t.stack,r=n.pop(),i=t.fv,a=t.pv,o=t.ppem,s=t.deltaBase+(e-1)*16,c=t.deltaShift,l=t.z0;exports.DEBUG&&console.log(t.step,`DELTAP[`+e+`]`,r,n);for(var u=0;u<r;u++){var d=n.pop(),f=n.pop();if(s+((f&240)>>4)===o){var p=(f&15)-8;p>=0&&p++,exports.DEBUG&&console.log(t.step,`DELTAPFIX`,d,`by`,p*c);var m=l[d];i.setRelative(m,m,p*c,a)}}}function sa(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`SDB[]`,t),e.deltaBase=t}function ca(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`SDS[]`,t),e.deltaShift=.5**t}function la(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`ADD[]`,n,r),t.push(r+n)}function ua(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`SUB[]`,n,r),t.push(r-n)}function da(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`DIV[]`,n,r),t.push(r*64/n)}function fa(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`MUL[]`,n,r),t.push(r*n/64)}function pa(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`ABS[]`,n),t.push(Math.abs(n))}function ma(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`NEG[]`,n),t.push(-n)}function ha(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`FLOOR[]`,n),t.push(Math.floor(n/64)*64)}function ga(e){var t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,`CEILING[]`,n),t.push(Math.ceil(n/64)*64)}function _a(e,t){var n=t.stack,r=n.pop();exports.DEBUG&&console.log(t.step,`ROUND[]`),n.push(t.round(r/64)*64)}function va(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`WCVTF[]`,n,r),e.cvt[r]=n*e.ppem/e.font.unitsPerEm}function ya(e,t){var n=t.stack,r=n.pop(),i=t.ppem,a=t.deltaBase+(e-1)*16,o=t.deltaShift;exports.DEBUG&&console.log(t.step,`DELTAC[`+e+`]`,r,n);for(var s=0;s<r;s++){var c=n.pop(),l=n.pop();if(a+((l&240)>>4)===i){var u=(l&15)-8;u>=0&&u++;var d=u*o;exports.DEBUG&&console.log(t.step,`DELTACFIX`,c,`by`,d),t.cvt[c]+=d}}}function ba(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`SROUND[]`,t),e.round=Pr;var n;switch(t&192){case 0:n=.5;break;case 64:n=1;break;case 128:n=2;break;default:throw Error(`invalid SROUND value`)}switch(e.srPeriod=n,t&48){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*n;break;case 32:e.srPhase=.5*n;break;case 48:e.srPhase=.75*n;break;default:throw Error(`invalid SROUND value`)}t&=15,t===0?e.srThreshold=0:e.srThreshold=(t/8-.5)*n}function xa(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`S45ROUND[]`,t),e.round=Pr;var n;switch(t&192){case 0:n=Math.sqrt(2)/2;break;case 64:n=Math.sqrt(2);break;case 128:n=2*Math.sqrt(2);break;default:throw Error(`invalid S45ROUND value`)}switch(e.srPeriod=n,t&48){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*n;break;case 32:e.srPhase=.5*n;break;case 48:e.srPhase=.75*n;break;default:throw Error(`invalid S45ROUND value`)}t&=15,t===0?e.srThreshold=0:e.srThreshold=(t/8-.5)*n}function Sa(e){exports.DEBUG&&console.log(e.step,`ROFF[]`),e.round=Or}function Ca(e){exports.DEBUG&&console.log(e.step,`RUTG[]`),e.round=Mr}function wa(e){exports.DEBUG&&console.log(e.step,`RDTG[]`),e.round=Nr}function Ta(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`SCANCTRL[]`,t)}function Ea(e,t){var n=t.stack,r=n.pop(),i=n.pop(),a=t.z2[r],o=t.z1[i];exports.DEBUG&&console.log(t.step,`SDPVTL[`+e+`]`,r,i);var s,c;e?(s=a.y-o.y,c=o.x-a.x):(s=o.x-a.x,c=o.y-a.y),t.dpv=Rr(s,c)}function Da(e){var t=e.stack,n=t.pop(),r=0;exports.DEBUG&&console.log(e.step,`GETINFO[]`,n),n&1&&(r=35),n&32&&(r|=4096),t.push(r)}function Oa(e){var t=e.stack,n=t.pop(),r=t.pop(),i=t.pop();exports.DEBUG&&console.log(e.step,`ROLL[]`),t.push(r),t.push(n),t.push(i)}function ka(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`MAX[]`,n,r),t.push(Math.max(r,n))}function Aa(e){var t=e.stack,n=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,`MIN[]`,n,r),t.push(Math.min(r,n))}function ja(e){var t=e.stack.pop();exports.DEBUG&&console.log(e.step,`SCANTYPE[]`,t)}function Ma(e){var t=e.stack.pop(),n=e.stack.pop();
1switch(exports.DEBUG&&console.log(e.step,`INSTCTRL[]`,t,n),t){case 1:e.inhibitGridFit=!!n;return;case 2:e.ignoreCvt=!!n;return;default:throw Error(`invalid INSTCTRL[] selector`)}}function Na(e,t){var n=t.stack,r=t.prog,i=t.ip;exports.DEBUG&&console.log(t.step,`PUSHB[`+e+`]`);for(var a=0;a<e;a++)n.push(r[++i]);t.ip=i}function Pa(e,t){var n=t.ip,r=t.prog,i=t.stack;exports.DEBUG&&console.log(t.ip,`PUSHW[`+e+`]`);for(var a=0;a<e;a++){var o=r[++n]<<8|r[++n];o&32768&&(o=-((o^65535)+1)),i.push(o)}t.ip=n}function q(e,t,n,r,i,a){var o=a.stack,s=e&&o.pop(),c=o.pop(),l=a.rp0,u=a.z0[l],d=a.z1[c],f=a.minDis,p=a.fv,m=a.dpv,h,g=h=m.distance(d,u,!0,!0),_=g>=0?1:-1,v;g=Math.abs(g),e&&(v=a.cvt[s],r&&Math.abs(g-v)<a.cvCutIn&&(g=v)),n&&g<f&&(g=f),r&&(g=a.round(g)),p.setRelative(d,u,_*g,m),p.touch(d),exports.DEBUG&&console.log(a.step,(e?`MIRP[`:`MDRP[`)+(t?`M`:`m`)+(n?`>`:`_`)+(r?`R`:`_`)+(i===0?`Gr`:i===1?`Bl`:i===2?`Wh`:``)+`]`,e?s+`(`+a.cvt[s]+`,`+v+`)`:``,c,`(d =`,h,`->`,_*g,`)`),a.rp1=a.rp0,a.rp2=c,t&&(a.rp0=c)}Cr=[Gr.bind(void 0,Ir),Gr.bind(void 0,Fr),Kr.bind(void 0,Ir),Kr.bind(void 0,Fr),qr.bind(void 0,Ir),qr.b
vendor: 5,380 bytes, line 1
1ind(void 0,Fr),Jr.bind(void 0,0),Jr.bind(void 0,1),Yr.bind(void 0,0),Yr.bind(void 0,1),Xr,Zr,Qr,$r,ei,ti,ni,ri,ii,ai,oi,si,ci,li,ui,di,fi,pi,mi,hi,void 0,void 0,gi,_i,vi,yi,bi,Ci,wi,void 0,void 0,void 0,xi,Si,Ti,void 0,Ei.bind(void 0,0),Ei.bind(void 0,1),Di.bind(void 0,Ir),Di.bind(void 0,Fr),Oi.bind(void 0,0),Oi.bind(void 0,1),ki.bind(void 0,0),ki.bind(void 0,1),Ai.bind(void 0,0),Ai.bind(void 0,1),ji,Mi,Ni.bind(void 0,0),Ni.bind(void 0,1),Pi,Fi,Ii.bind(void 0,0),Ii.bind(void 0,1),Li,Ri,zi,Bi,Vi,Hi,Ui.bind(void 0,0),Ui.bind(void 0,1),void 0,Wi.bind(void 0,0),Wi.bind(void 0,1),Gi,void 0,Ki,void 0,void 0,qi,Ji,Yi,Xi,Zi,Qi,$i,ea,ta,na,ra,ia,aa,oa.bind(void 0,1),sa,ca,la,ua,da,fa,pa,ma,ha,ga,_a.bind(void 0,0),_a.bind(void 0,1),_a.bind(void 0,2),_a.bind(void 0,3),void 0,void 0,void 0,void 0,va,oa.bind(void 0,2),oa.bind(void 0,3),ya.bind(void 0,1),ya.bind(void 0,2),ya.bind(void 0,3),ba,xa,void 0,void 0,Sa,void 0,Ca,wa,_i,_i,void 0,void 0,void 0,void 0,void 0,Ta,Ea.bind(void 0,0),Ea.bind(void 0,1),Da,void 0,Oa,ka,Aa,ja,Ma,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,Na.bind(void 0,1),Na.bind(void 0,2),Na.bind(void 0,3),Na.bind(void 0,4),Na.bind(void 0,5),Na.bind(void 0,6),Na.bind(void 0,7),Na.bind(void 0,8),Pa.bind(void 0,1),Pa.bind(void 0,2),Pa.bind(void 0,3),Pa.bind(void 0,4),Pa.bind(void 0,5),Pa.bind(void 0,6),Pa.bind(void 0,7),Pa.bind(void 0,8),q.bind(void 0,0,0,0,0,0),q.bind(void 0,0,0,0,0,1),q.bind(void 0,0,0,0,0,2),q.bind(void 0,0,0,0,0,3),q.bind(void 0,0,0,0,1,0),q.bind(void 0,0,0,0,1,1),q.bind(void 0,0,0,0,1,2),q.bind(void 0,0,0,0,1,3),q.bind(void 0,0,0,1,0,0),q.bind(void 0,0,0,1,0,1),q.bind(void 0,0,0,1,0,2),q.bind(void 0,0,0,1,0,3),q.bind(void 0,0,0,1,1,0),q.bind(void 0,0,0,1,1,1),q.bind(void 0,0,0,1,1,2),q.bind(void 0,0,0,1,1,3),q.bind(void 0,0,1,0,0,0),q.bind(void 0,0,1,0,0,1),q.bind(void 0,0,1,0,0,2),q.bind(void 0,0,1,0,0,3),q.bind(void 0,0,1,0,1,0),q.bind(void 0,0,1,0,1,1),q.bind(void 0,0,1,0,1,2),q.bind(void 0,0,1,0,1,3),q.bind(void 0,0,1,1,0,0),q.bind(void 0,0,1,1,0,1),q.bind(void 0,0,1,1,0,2),q.bind(void 0,0,1,1,0,3),q.bind(void 0,0,1,1,1,0),q.bind(void 0,0,1,1,1,1),q.bind(void 0,0,1,1,1,2),q.bind(void 0,0,1,1,1,3),q.bind(void 0,1,0,0,0,0),q.bind(void 0,1,0,0,0,1),q.bind(void 0,1,0,0,0,2),q.bind(void 0,1,0,0,0,3),q.bind(void 0,1,0,0,1,0),q.bind(void 0,1,0,0,1,1),q.bind(void 0,1,0,0,1,2),q.bind(void 0,1,0,0,1,3),q.bind(void 0,1,0,1,0,0),q.bind(void 0,1,0,1,0,1),q.bind(void 0,1,0,1,0,2),q.bind(void 0,1,0,1,0,3),q.bind(void 0,1,0,1,1,0),q.bind(void 0,1,0,1,1,1),q.bind(void 0,1,0,1,1,2),q.bind(void 0,1,0,1,1,3),q.bind(void 0,1,1,0,0,0),q.bind(void 0,1,1,0,0,1),q.bind(void 0,1,1,0,0,2),q.bind(void 0,1,1,0,0,3),q.bind(void 0,1,1,0,1,0),q.bind(void 0,1,1,0,1,1),q.bind(void 0,1,1,0,1,2),q.bind(void 0,1,1,0,1,3),q.bind(void 0,1,1,1,0,0),q.bind(void 0,1,1,1,0,1),q.bind(void 0,1,1,1,0,2),q.bind(void 0,1,1,1,0,3),q.bind(void 0,1,1,1,1,0),q.bind(void 0,1,1,1,1,1),q.bind(void 0,1,1,1,1,2),q.bind(void 0,1,1,1,1,3)];function Fa(e){this.char=e,this.state={},this.activeState=null}function Ia(e,t,n){this.contextName=n,this.startIndex=e,this.endOffset=t}function La(e,t,n){this.contextName=e,this.openRange=null,this.ranges=[],this.checkStart=t,this.checkEnd=n}function J(e,t){this.context=e,this.index=t,this.length=e.length,this.current=e[t],this.backtrack=e.slice(0,t),this.lookahead=e.slice(t+1)}function Ra(e){this.eventId=e,this.subscribers=[]}function za(e){var t=this,n=[`start`,`end`,`next`,`newToken`,`contextStart`,`contextEnd`,`insertToken`,`removeToken`,`removeRange`,`replaceToken`,`replaceRange`,`composeRUD`,`updateContextsRanges`];n.forEach(function(e){Object.defineProperty(t.events,e,{value:new Ra(e)})}),e&&n.forEach(function(n){var r=e[n];typeof r==`function`&&t.events[n].subscribe(r)}),[`insertToken`,`removeToken`,`removeRange`,`replaceToken`,`replaceRange`,`composeRUD`].forEach(function(e){t.events[e].subscribe(t.updateContextsRanges)})}function Y(e){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],za.call(this,e)}Fa.prototype.setState=function(e,t){return this.state[e]=t,this.activeState={key:e,value:this.state[e]},this.activeState},Fa.prototype.getState=function(e){return this.state[e]||null},Y.prototype.inboundIndex=function(e){return e>=0&&e<this.tokens.length},Y.prototype.composeRUD=function(e){var t=this,n=!0,r=e.map(function(e){return t[e[0]].apply(t,e.slice(1).concat(n))}),i=function(e){return typeof e==`object`&&e.hasOwnProperty(`FAIL`)};if(r.every(i))return{FAIL:`composeRUD: one or more operations hasn't completed successfully`,report:r.filter(i)};this.dispatch(`composeRUD`,[r.filter(function(e){return!i(e)})])},Y.prototype.replaceRange=function(e,t,n,r){t=t===null?this.tokens.length:t;var i=n.every(function(e){return e instanceof Fa});if(!isNaN(e)&&this.inboundIndex(e)&&i){var a=this.tokens.splice.apply(this.tokens,[e,t].concat(n));return r||this.dispatch(`replaceToken`,[e,t,n]),[a,n]}else return{FAIL:`replaceRange: invalid tokens or startIndex.`}},Y.prototype.replaceToken=function(e,t,n){if(!isNaN(e)&&this.inboundIndex(e)&&t instanceof Fa){var r=this.tokens.splice(e,1,t);return n||this.dispatch(`replaceToken`,[e,t]),[r[0],t]}
1else return{FAIL:`replaceToken: invalid token or index.`}},Y.prototype.removeRange=function(e,t,n){t=isNaN(t)?this.tokens.length:t;var r=this.tokens.splice(e,t);return n||this.dispatch(`removeRange`,[r,e,t]),r},Y.prototype.removeToken=function(e,t){if(!isNaN(e)&&this.inboundIndex(e)){var n=this.tokens.splice(e,1);return t||this.dispatch(`removeToken`,[n,e]),n}else return{FAIL:`removeToken: invalid token index.`}},Y.prototype.insertToken=function(e,t,n){return e.every(function(e){return e instanceof Fa})?(this.tokens.splice.apply(this.tokens,[t,0].concat(e)),n||this.dispatch(`insertToken`,[e,t]),e):{FAIL:`insertToken: invalid token(s).`}},Y.prototype.registerModifier=function(e,t,n){this.events.newToken.subscribe(function(r,i){var a=[r,i],o=t===null||t.apply(this,a)===!0,s=[r,i];if(o){var c=n.apply(this,s);r.setState(e,c)}}),this.registeredModifiers.push(e)},Ra.prototype.subscribe=function(e){return typeof e==`function`?this.subscribers.push(e)-1:{FAIL:`invalid '`+this.eventId+`' event handler`}},Ra.prototype.unsubscribe=function(e){this.subscribers.splice(e,1)},J.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)},J.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}},Y.prototype.rangeToText=function(e){if(e instanceof Ia)return this.getRangeTokens(e).map(function(e){return e.char}).join(``)},Y.prototype.getText=function(){return this.tokens.map(function(e){return e.char}).join(``)},Y.prototype.getContext=function(e){return this.registeredContexts[e]||null},Y.prototype.on=function(e,t){var n=this.events[e];return n?n.subscribe(t):null},Y.prototype.dispatch=function(e,t){var n=this,r=this.events[e];r instanceof Ra&&r.subscribers.forEach(function(e){e.apply(n,t||[])})},Y.prototype.registerContextChecker=function(e,t,n){if(this.getContext(e))return{FAIL:`context name '`+e+`' is already registered.`};if(typeof t!=`function`)return{FAIL:`missing context start check.`};if(typeof n!=`function`)return{FAIL:`missing context end check.`};var r=new La(e,t,n);return this.registeredContexts[e]=r,this.contextCheckers.push(r),r},Y.prototype.getRangeTokens=function(e){var t=e.startIndex+e.endOffset;return[].concat(this.tokens.slice(e.startIndex,t))},Y.prototype.getContextRanges=function(e){var t=this.getContext(e);return t?t.ranges:{FAIL:`context checker '`+e+`' is not registered.`}},Y.prototype.resetContextsRanges=function(){var e=this.registeredContexts;for(var t in e)if(e.hasOwnProperty(t)){var n=e[t];n.ranges=[]}},Y.prototype.updateContextsRanges=function(){this.resetContextsRanges();for(var e=this.tokens.map(function(e){return e.char}),t=0;t<e.length;t++){var n=new J(e,t);this.runContextCheck(n)}this.dispatch(`updateContextsRanges`,[this.registeredContexts])},Y.prototype.setEndOffset=function(e,t){var n=this.getContext(t).openRange.startIndex,r=new Ia(n,e,t),i=this.getContext(t).ranges;return r.rangeId=t+`.`+i.length,i.push(r),this.getContext(t).openRange=null,r},Y.prototype.runContextCheck=function(e){var t=this,n=e.index;this.contextCheckers.forEach(function(r){var i=r.contextName,a=t.getContext(i).openRange;if(!a&&r.checkStart(e)&&(a=new Ia(n,null,i),t.getContext(i).openRange=a,t.dispatch(`contextStart`,[i,n])),a&&r.checkEnd(e)){var o=n-a.startIndex+1,s=t.setEndOffset(o,i);t.dispatch(`contextEnd`,[i,s])}})},Y.prototype.tokenize=function(e){this.tokens=[],this.resetContextsRanges();var t=Array.from(e);this.dispatch(`start`);for(var n=0;n<t.length;n++){var r=t[n],i=new J(t,n);this.dispatch(`next`,[i]),this.runContextCheck(i);var a=new Fa(r);this.tokens.push(a),this.dispatch(`newToken`,[a,i])}return this.dispatch(`end`,[this.tokens]),this.tokens};function Ba(e){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(e)}function Va(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 Ha(e){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(e)}function Ua(e){return/[A-z]/.test(e)}function Wa(e){return/\s/.test(e)}function X(e){this.font=e,this.features={}}function Ga(e){this.id=e.id,this.tag=e.tag,this.substitution=e.substitution}function Ka(e,t){if(!e)return-1;switch(t.format){case 1:return t.glyphs.indexOf(e);case 2:for(var n=t.ranges,r=0;r<n.length;r++){var i=n[r];if(e>=i.start&&e<=i.end){var a=e-i.start;return i.index+a}}break;default:return-1}return-1}function qa(e,t){return Ka(e,t.coverage)===-1?null:e+t.deltaGlyphId}function Ja(e,t){var n=Ka(e,t.coverage);return n===-1?null:t.substitute[n]}function Ya(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=t.current;a=Array.isArray(a)?a[0]:a;var o=Ka(a,i);o!==-1&&n.push(o)}return n.length===e.length?n:-1}function Xa(e,t){var n=t.inputCoverage.length+t.lookaheadCoverage.length+t.backtrackCoverage.length;if(e.context.length<n)return[];var r=Ya(t.inputCoverage,e);if(r===-1)return[];var i=t.inputCoverage.length-1;if(e.lookahead.length<t.lookaheadCoverage.length)return[];for(var a=e.lookahead.slice(i);a.length&&Ha(a[0].char);)a.shift();var o=new J(a,0),s=Ya(t.lookaheadCoverage,o),c=[].concat(e.backtrack);for(c.reverse();c.length&&Ha(c[0].char);)c.shift();if(c.length<t.backtrackCoverage.length)return[];var l=new J(c,0),u=Ya(t.backtrackCoverage,l),d=r.length===t.inputCoverage.length&&s.length===t.lookaheadCoverage.length&&u.length===t.backtrackCoverage.length,f=[];if(d)for(var p=0;p<t.lookupRecords.length;p++)for(var m=t.lookupRecords[p].lookupListIndex,h=this.getLookupByIndex(m),g=0;g<h.subtables.length;g++){var _=h.subtables[g],v=this.getLookupMethod(h,_);if(this.getSubstitutionType(h,_)===`12`)for(var y=0;y<r.length;y++){var b=v(e.get(y));b&&f.push(b)}}return f}function Za(e,t){var n=e.current,r=Ka(n,t.coverage);if(r===-1)return null;for(var i,a=t.ligatureSets[r],o=0;o<a.length;o++){i=a[o];for(var s=0;s<i.components.length&&e.lookahead[s]===i.components[s];s++)if(s===i.components.length-1)return i}return null}function Qa(e,t){var n=Ka(e,t.coverage);return n===-1?null:t.sequences[n]}X.prototype.getDefaultScriptFeaturesIndexes=function(){for(var e=this.font.tables.gsub.scripts,t=0;t<e.length;t++){var n=e[t];if(n.tag===`DFLT`)return n.script.defaultLangSys.featureIndexes}return[]},X.prototype.getScriptFeaturesIndexes=function(e){if(!this.font.tables.gsub)return[];if(!e)return this.getDefaultScriptFeaturesIndexes();for(var t=this.font.tables.gsub.scripts,n=0;n<t.length;n++){var r=t[n];if(r.tag===e&&r.script.defaultLangSys)return r.script.defaultLangSys.featureIndexes;var i=r.langSysRecords;if(i)for(var a=0;a<i.length;a++){var o=i[a];if(o.tag===e)return o.langSys.featureIndexes}}return this.getDefaultScriptFeaturesIndexes()},X.prototype.mapTagsToFeatures=function(e,t){for(var n={},r=0;r<e.length;r++){var i=e[r].tag;n[i]=e[r].feature}this.features[t].tags=n},X.prototype.getScriptFeatures=function(e){var t=this.features[e];if(this.features.hasOwnProperty(e))return t;var n=this.getScriptFeaturesIndexes(e);if(!n)return null;var r=this.font.tables.gsub;return t=n.map(function(e){return r.features[e]}),this.features[e]=t,this.mapTagsToFeatures(t,e),t},X.prototype.getSubstitutionType=function(e,t){return e.lookupType.toString()+t.substFormat.toString()},X.prototype.getLookupMethod=function(e,t){var n=this;switch(this.getSubstitutionType(e,t)){case`11`:return function(e){return qa.apply(n,[e,t])};case`12`:return function(e){return Ja.apply(n,[e,t])};case`63`:return function(e){return Xa.apply(n,[e,t])};case`41`:return function(e){return Za.apply(n,[e,t])};case`21`:return function(e){return Qa.apply(n,[e,t])};default:throw Error(`lookupType: `+e.lookupType+` - substFormat: `+t.substFormat+` is not yet supported`)}},X.prototype.lookupFeature=function(e){var t=e.contextParams,n=t.index,r=this.getFeature({tag:e.tag,script:e.script});if(!r)return Error(`font '`+this.font.names.fullName.en+`' doesn't support feature '`+e.tag+`' for script '`+e.script+`'.`);for(var i=this.getFeatureLookups(r),a=[].concat(t.context),o=0;o<i.length;o++)for(var s=i[o],c=this.getLookupSubtables(s),l=0;l<c.length;l++){var u=c[l],d=this.getSubstitutionType(s,u),f=this.getLookupMethod(s,u),p=void 0;switch(d){case`11`:p=f(t.current),p&&a.splice(n,1,new Ga({id:11,tag:e.tag,substitution:p}
1));break;case`12`:p=f(t.current),p&&a.splice(n,1,new Ga({id:12,tag:e.tag,substitution:p}));break;case`63`:p=f(t),Array.isArray(p)&&p.length&&a.splice(n,1,new Ga({id:63,tag:e.tag,substitution:p}));break;case`41`:p=f(t),p&&a.splice(n,1,new Ga({id:41,tag:e.tag,substitution:p}));break;case`21`:p=f(t.current),p&&a.splice(n,1,new Ga({id:21,tag:e.tag,substitution:p}));break}t=new J(a,n),!(Array.isArray(p)&&!p.length)&&(p=null)}return a.length?a:null},X.prototype.supports=function(e){if(!e.script)return!1;this.getScriptFeatures(e.script);var t=this.features.hasOwnProperty(e.script);if(!e.tag)return t;var n=this.features[e.script].some(function(t){return t.tag===e.tag});return t&&n},X.prototype.getLookupSubtables=function(e){return e.subtables||null},X.prototype.getLookupByIndex=function(e){return this.font.tables.gsub.lookups[e]||null},X.prototype.getFeatureLookups=function(e){return e.lookupListIndexes.map(this.getLookupByIndex.bind(this))},X.prototype.getFeature=function(e){if(!this.font)return{FAIL:`No font was found`};this.features.hasOwnProperty(e.script)||this.getScriptFeatures(e.script);var t=this.features[e.script];return t?t.tags[e.tag]?this.features[e.script].tags[e.tag]:null:{FAIL:`No feature for script `+e.script}};function $a(e){var t=e.current,n=e.get(-1);return n===null&&Ba(t)||!Ba(n)&&Ba(t)}function eo(e){var t=e.get(1);return t===null||!Ba(t)}var to={startCheck:$a,endCheck:eo};function no(e){var t=e.current,n=e.get(-1);return(Ba(t)||Ha(t))&&!Ba(n)}function ro(e){var t=e.get(1);switch(!0){case t===null:return!0;case!Ba(t)&&!Ha(t):var n=Wa(t);if(!n)return!0;if(n){var r=!1;if(r=e.lookahead.some(function(e){return Ba(e)||Ha(e)}),!r)return!0}break;default:return!1}}var io={startCheck:no,endCheck:ro};function ao(e,t,n){t[n].setState(e.tag,e.substitution)}function oo(e,t,n){t[n].setState(e.tag,e.substitution)}function so(e,t,n){e.substitution.forEach(function(r,i){t[n+i].setState(e.tag,r)})}function co(e,t,n){var r=t[n];r.setState(e.tag,e.substitution.ligGlyph);for(var i=e.substitution.components.length,a=0;a<i;a++)r=t[n+a+1],r.setState(`deleted`,!0)}var lo={11:ao,12:oo,63:so,41:co};function uo(e,t,n){e instanceof Ga&&lo[e.id]&&lo[e.id](e,t,n)}function fo(e){for(var t=[].concat(e.backtrack),n=t.length-1;n>=0;n--){var r=t[n],i=Va(r),a=Ha(r);if(!i&&!a)return!0;if(i)return!1}return!1}function po(e){if(Va(e.current))return!1;for(var t=0;t<e.lookahead.length;t++){var n=e.lookahead[t];if(!Ha(n))return!0}return!1}function mo(e){var t=this,n=`arab`,r=this.featuresTags[n],i=this.tokenizer.getRangeTokens(e);if(i.length!==1){var a=new J(i.map(function(e){return e.getState(`glyphIndex`)}),0),o=new J(i.map(function(e){return e.char}),0);i.forEach(function(e,s){if(!Ha(e.char)){a.setCurrentIndex(s),o.setCurrentIndex(s);var c=0;fo(o)&&(c|=1),po(o)&&(c|=2);var l;switch(c){case 1:l=`fina`;break;case 2:l=`init`;break;case 3:l=`medi`;break}if(r.indexOf(l)!==-1){var u=t.query.lookupFeature({tag:l,script:n,contextParams:a});if(u instanceof Error)return console.info(u.message);u.forEach(function(e,t){e instanceof Ga&&(uo(e,i,t),a.context[t]=e.substitution)})}}})}}function ho(e,t){return new J(e.map(function(e){return e.activeState.value}),t||0)}function go(e){var t=this,n=`arab`,r=this.tokenizer.getRangeTokens(e),i=ho(r);i.context.forEach(function(e,a){i.setCurrentIndex(a);var o=t.query.lookupFeature({tag:`rlig`,script:n,contextParams:i});o.length&&(o.forEach(function(e){return uo(e,r,a)}),i=ho(r))})}function _o(e){var t=e.current,n=e.get(-1);return n===null&&Ua(t)||!Ua(n)&&Ua(t)}function vo(e){var t=e.get(1);return t===null||!Ua(t)}var yo={startCheck:_o,endCheck:vo};function bo(e,t){return new J(e.map(function(e){return e.activeState.value}),t||0)}function xo(e){var t=this,n=`latn`,r=this.tokenizer.getRangeTokens(e),i=bo(r);i.context.forEach(function(e,a){i.setCurrentIndex(a);var o=t.query.lookupFeature({tag:`liga`,script:n,contextParams:i});o.length&&(o.forEach(function(e){return uo(e,r,a)}),i=bo(r))})}function Z(e){this.baseDir=e||`ltr`,this.tokenizer=new Y,this.featuresTags={}}Z.prototype.setText=function(e){this.text=e},Z.prototype.contextChecks={latinWordCheck:yo,arabicWordCheck:to,arabicSentenceCheck:io};function So(e){var t=this.contextChecks[e+`Check`];return this.tokenizer.registerContextChecker(e,t.startCheck,t.endCheck)}function Co(){return So.call(this,`latinWord`),So.call(this,`arabicWord`),So.call(this,`arabicSentence`),this.tokenizer.tokenize(this.text)}function wo(){var e=this;this.tokenizer.getContextRanges(`arabicSentence`).forEach(function(t){var n=e.tokenizer.getRangeTokens(t);e.tokenizer.replaceRange(t.startIndex,t.endOffset,n.reverse())})}Z.prototype.registerFeatures=function(e,t){var n=this,r=t.filter(function(t){return n.query.supports({script:e,tag:t})});this.featuresTags.hasOwnProperty(e)?this.featuresTags[e]=this.featuresTags[e].concat(r):this.featuresTags[e]=r},Z.prototype.applyFeatures=function(e,t){if(!e)throw Error(`No valid font was provided to apply features`);this.query||(this.query=new X(e));for(var n=0;n<t.length;n++){var r=t[n];this.query.supports({script:r.script})&&this.registerFeatures(r.script,r.tags)}},Z.prototype.registerModifier=function(e,t,n){this.tokenizer.registerModifier(e,t,n)};function To(){if(this.tokenizer.registeredModifiers.indexOf(`glyphIndex`)===-1)throw Error(`glyphIndex modifier is required to apply arabic presentation features.`)}function Eo(){var e=this;this.featuresTags.hasOwnProperty(`arab`)&&(To.call(this),this.tokenizer.getContextRanges(`arabicWord`).forEach(function(t){mo.call(e,t)}))}function Do(){var e=this,t=`arab`;this.featuresTags.hasOwnProperty(t)&&this.featuresTags[t].indexOf(`rlig`)!==-1&&(To.call(this),this.tokenizer.getContextRanges(`arabicWord`).forEach(function(t){go.call(e,t)}))}function Oo(){var e=this,t=`latn`;this.featuresTags.hasOwnProperty(t)&&this.featuresTags[t].indexOf(`liga`)!==-1&&(To.call(this),this.tokenizer.getContextRanges(`latinWord`).forEach(function(t){xo.call(e,t)}))}Z.prototype.checkContextReady=function(e){return!!this.tokenizer.getContext(e)},Z.prototype.applyFeaturesToContexts=function(){this.checkContextReady(`arabicWord`)&&(Eo.call(this),Do.call(this)),this.checkContextReady(`latinWord`)&&Oo.call(this),this.checkContextReady(`arabicSentence`)&&wo.call(this)},Z.prototype.processText=function(e){(!this.text||this.text!==e)&&(this.setText(e),Co.call(this),this.applyFeaturesToContexts())},Z.prototype.getBidiText=function(e){return this.processText(e),this.tokenizer.getText()},Z.prototype.getTextGlyphs=function(e){this.processText(e);for(var t=[],n=0;n<this.tokenizer.tokens.length;n++){var r=this.tokenizer.tokens[n];if(!r.state.deleted){var i=r.activeState.value;t.push(Array.isArray(i)?i[0]:i)}}return t};function Q(e){e=e||{},e.tables=e.tables||{},e.empty||(fr(e.familyName,`When creating a new Font object, familyName is required.`),fr(e.styleName,`When creating a new Font object, styleName is required.`),fr(e.unitsPerEm,`When creating a new Font object, unitsPerEm is required.`),fr(e.ascender,`When creating a new Font object, ascender is required.`),fr(e.descender<=0,`When creating a new Font object, negative descender value is required.`),this.names={fontFamily:{en:e.familyName||` `}
1,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 ht.GlyphSet(this,e.glyphs||[]),this.encoding=new et(this),this.position=new or(this),this.substitution=new K(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 Dr(this)}})}Q.prototype.hasChar=function(e){return this.encoding.charToGlyphIndex(e)!==null},Q.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},Q.prototype.charToGlyph=function(e){var t=this.charToGlyphIndex(e),n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},Q.prototype.updateFeatures=function(e){return this.defaultRenderOptions.features.map(function(t){return t.script===`latn`?{script:`latn`,tags:t.tags.filter(function(t){return e[t]})}:t})},Q.prototype.stringToGlyphs=function(e,t){var n=this,r=new Z;r.registerModifier(`glyphIndex`,null,function(e){return n.charToGlyphIndex(e.char)});var i=t?this.updateFeatures(t.features):this.defaultRenderOptions.features;r.applyFeatures(this,i);for(var a=r.getTextGlyphs(e),o=a.length,s=Array(o),c=this.glyphs.get(0),l=0;l<o;l+=1)s[l]=this.glyphs.get(a[l])||c;return s},Q.prototype.nameToGlyphIndex=function(e){return this.glyphNames.nameToGlyphIndex(e)},Q.prototype.nameToGlyph=function(e){var t=this.nameToGlyphIndex(e),n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},Q.prototype.glyphIndexToName=function(e){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(e):``},Q.prototype.getKerningValue=function(e,t){e=e.index||e,t=t.index||t;var n=this.position.defaultKerningTables;return n?this.position.getKerningValue(n,e,t):this.kerningPairs[e+`,`+t]||0},Q.prototype.defaultRenderOptions={kerning:!0,features:[{script:`arab`,tags:[`init`,`medi`,`fina`,`rlig`]},{script:`latn`,tags:[`liga`,`rlig`]}]},Q.prototype.forEachGlyph=function(e,t,n,r,i,a){t=t===void 0?0:t,n=n===void 0?0:n,r=r===void 0?72:r,i=Object.assign({},this.defaultRenderOptions,i);var o=1/this.unitsPerEm*r,s=this.stringToGlyphs(e,i),c;if(i.kerning){var l=i.script||this.position.getDefaultScriptName();c=this.position.getKerningTables(l,i.language)}for(var u=0;u<s.length;u+=1){var d=s[u];if(a.call(this,d,t,n,r,i),d.advanceWidth&&(t+=d.advanceWidth*o),i.kerning&&u<s.length-1){var f=c?this.position.getKerningValue(c,d.index,s[u+1].index):this.getKerningValue(d,s[u+1]);t+=f*o}i.letterSpacing?t+=i.letterSpacing*r:i.tracking&&(t+=i.tracking/1e3*r)}return t},Q.prototype.getPath=function(e,t,n,r,i){var a=new I;return this.forEachGlyph(e,t,n,r,i,function(e,t,n,r){var o=e.getPath(t,n,r,i,this);a.extend(o)}),a},Q.prototype.getPaths=function(e,t,n,r,i){var a=[];return this.forEachGlyph(e,t,n,r,i,function(e,t,n,r){var o=e.getPath(t,n,r,i,this);a.push(o)}),a},Q.prototype.getAdvanceWidth=function(e,t,n){return this.forEachGlyph(e,0,0,t,n,function(){})},Q.prototype.draw=function(e,t,n,r,i,a){this.getPath(t,n,r,i,a).draw(e)},Q.prototype.drawPoints=function(e,t,n,r,i,a){this.forEachGlyph(t,n,r,i,a,function(t,n,r,i){t.drawPoints(e,n,r,i)})},Q.prototype.drawMetrics=function(e,t,n,r,i,a){this.forEachGlyph(t,n,r,i,a,function(t,n,r,i){t.drawMetrics(e,n,r,i)})},Q.prototype.getEnglishName=function(e){var t=this.names[e];if(t)return t.en},Q.prototype.validate=function(){var e=this;function t(t){var n=e.getEnglishName(t);n&&n.trim().length}t(`fontFamily`),t(`weightName`),t(`manufacturer`),t(`copyright`),t(`version`),this.unitsPerEm},Q.prototype.toTables=function(){return tr.fontToTable(this)},Q.prototype.toBuffer=function(){return console.warn(`Font.toBuffer is deprecated. Use Font.toArrayBuffer instead.`),this.toArrayBuffer()},Q.prototype.toArrayBuffer=function(){for(var e=this.toTables().encode(),t=new ArrayBuffer(e.length),n=new Uint8Array(t),r=0;r<e.length;r++)n[r]=e[r];return t},Q.prototype.download=function(e){var t=this.getEnglishName(`fontFamily`),n=this.getEnglishName(`fontSubfam
1ily`);e=e||t.replace(/\s/g,``)+`-`+n+`.otf`;var r=this.toArrayBuffer();if(lr())if(window.URL=window.URL||window.webkitURL,window.URL){var a=new DataView(r),o=new Blob([a],{type:`font/opentype`}),s=document.createElement(`a`);s.href=window.URL.createObjectURL(o),s.download=e;var c=document.createEvent(`MouseEvents`);c.initEvent(`click`,!0,!1),s.dispatchEvent(c)}else console.warn(`Font file could not be downloaded. Try using a different browser.`);else{var l=i(),u=dr(r);l.writeFileSync(e,u)}},Q.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},Q.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},Q.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};function ko(e,t){var n=JSON.stringify(e),r=256;for(var i in t){var a=parseInt(i);if(!(!a||a<256)){if(JSON.stringify(t[i])===n)return a;r<=a&&(r=a+1)}}return t[r]=e,r}function Ao(e,t,n){var r=ko(t.name,n);return[{name:`tag_`+e,type:`TAG`,value:t.tag},{name:`minValue_`+e,type:`FIXED`,value:t.minValue<<16},{name:`defaultValue_`+e,type:`FIXED`,value:t.defaultValue<<16},{name:`maxValue_`+e,type:`FIXED`,value:t.maxValue<<16},{name:`flags_`+e,type:`USHORT`,value:0},{name:`nameID_`+e,type:`USHORT`,value:r}]}function jo(e,t,n){var r={},i=new U.Parser(e,t);return r.tag=i.parseTag(),r.minValue=i.parseFixed(),r.defaultValue=i.parseFixed(),r.maxValue=i.parseFixed(),i.skip(`uShort`,1),r.name=n[i.parseUShort()]||{},r}function Mo(e,t,n,r){for(var i=ko(t.name,r),a=[{name:`nameID_`+e,type:`USHORT`,value:i},{name:`flags_`+e,type:`USHORT`,value:0}],o=0;o<n.length;++o){var s=n[o].tag;a.push({name:`axis_`+e+` `+s,type:`FIXED`,value:t.coordinates[s]<<16})}return a}function No(e,t,n,r){var i={},a=new U.Parser(e,t);i.name=r[a.parseUShort()]||{},a.skip(`uShort`,1),i.coordinates={};for(var o=0;o<n.length;++o)i.coordinates[n[o].tag]=a.parseFixed();return i}function Po(e,t){var n=new V.Table(`fvar`,[{name:`version`,type:`ULONG`,value:65536},{name:`offsetToData`,type:`USHORT`,value:0},{name:`countSizePairs`,type:`USHORT`,value:2},{name:`axisCount`,type:`USHORT`,value:e.axes.length},{name:`axisSize`,type:`USHORT`,value:20},{name:`instanceCount`,type:`USHORT`,value:e.instances.length},{name:`instanceSize`,type:`USHORT`,value:4+e.axes.length*4}]);n.offsetToData=n.sizeOf();for(var r=0;r<e.axes.length;r++)n.fields=n.fields.concat(Ao(r,e.axes[r],t));for(var i=0;i<e.instances.length;i++)n.fields=n.fields.concat(Mo(i,e.instances[i],e.axes,t));return n}
vendor: 2,742 bytes, line 1
1function Fo(e,t,n){var r=new U.Parser(e,t),i=r.parseULong();L.argument(i===65536,`Unsupported fvar table version.`);var a=r.parseOffset16();r.skip(`uShort`,1);for(var o=r.parseUShort(),s=r.parseUShort(),c=r.parseUShort(),l=r.parseUShort(),u=[],d=0;d<o;d++)u.push(jo(e,t+a+d*s,n));for(var f=[],p=t+a+o*s,m=0;m<c;m++)f.push(No(e,p+m*l,u,n));return{axes:u,instances:f}}var Io={make:Po,parse:Fo},Lo=function(){return{coverage:this.parsePointer(H.coverage),attachPoints:this.parseList(H.pointer(H.uShortList))}},Ro=function(){var e=this.parseUShort();if(L.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()}},zo=function(){return this.parseList(H.pointer(Ro))},Bo=function(){return{coverage:this.parsePointer(H.coverage),ligGlyphs:this.parseList(H.pointer(zo))}},Vo=function(){return this.parseUShort(),this.parseList(H.pointer(H.coverage))};function Ho(e,t){t=t||0;var n=new H(e,t),r=n.parseVersion(1);L.argument(r===1||r===1.2||r===1.3,`Unsupported GDEF table version.`);var i={version:r,classDef:n.parsePointer(H.classDef),attachList:n.parsePointer(Lo),ligCaretList:n.parsePointer(Bo),markAttachClassDef:n.parsePointer(H.classDef)};return r>=1.2&&(i.markGlyphSets=n.parsePointer(Vo)),i}var Uo={parse:Ho},Wo=Array(10);Wo[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{posFormat:1,coverage:this.parsePointer(H.coverage),value:this.parseValueRecord()};if(t===2)return{posFormat:2,coverage:this.parsePointer(H.coverage),values:this.parseValueRecordList()};L.assert(!1,`0x`+e.toString(16)+`: GPOS lookup type 1 format must be 1 or 2.`)},Wo[2]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();L.assert(t===1||t===2,`0x`+e.toString(16)+`: GPOS lookup type 2 format must be 1 or 2.`);var n=this.parsePointer(H.coverage),r=this.parseUShort(),i=this.parseUShort();if(t===1)return{posFormat:t,coverage:n,valueFormat1:r,valueFormat2:i,pairSets:this.parseList(H.pointer(H.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(r),value2:this.parseValueRecord(i)}})))};if(t===2){var a=this.parsePointer(H.classDef),o=this.parsePointer(H.classDef),s=this.parseUShort(),c=this.parseUShort();return{posFormat:t,coverage:n,valueFormat1:r,valueFormat2:i,classDef1:a,classDef2:o,class1Count:s,class2Count:c,classRecords:this.parseList(s,H.list(c,function(){return{value1:this.parseValueRecord(r),value2:this.parseValueRecord(i)}}))}}},Wo[3]=function(){return{error:`GPOS Lookup 3 not supported`}},Wo[4]=function(){return{error:`GPOS Lookup 4 not supported`}},Wo[5]=function(){return{error:`GPOS Lookup 5 not supported`}}
1,Wo[6]=function(){return{error:`GPOS Lookup 6 not supported`}},Wo[7]=function(){return{error:`GPOS Lookup 7 not supported`}},Wo[8]=function(){return{error:`GPOS Lookup 8 not supported`}},Wo[9]=function(){return{error:`GPOS Lookup 9 not supported`}};function Go(e,t){t=t||0;var n=new H(e,t),r=n.parseVersion(1);return L.argument(r===1||r===1.1,`Unsupported GPOS table version `+r),r===1?{version:r,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(Wo)}:{version:r,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(Wo),variations:n.parseFeatureVariationsList()}}var Ko=Array(10);function qo(e){return new V.Table(`GPOS`,[{name:`version`,type:`ULONG`,value:65536},{name:`scripts`,type:`TABLE`,value:new V.ScriptList(e.scripts)},{name:`features`,type:`TABLE`,value:new V.FeatureList(e.features)},{name:`lookups`,type:`TABLE`,value:new V.LookupList(e.lookups,Ko)}])}var Jo={parse:Go,make:qo};function Yo(e){var t={};e.skip(`uShort`);var n=e.parseUShort();L.argument(n===0,`Unsupported kern sub-table version.`),e.skip(`uShort`,2);var r=e.parseUShort();e.skip(`uShort`,3);for(var i=0;i<r;i+=1){var a=e.parseUShort(),o=e.parseUShort(),s=e.parseShort();t[a+`,`+o]=s}return t}function Xo(e){var t={};e.skip(`uShort`),e.parseULong()>1&&console.warn(`Only the first kern subtable is supported.`),e.skip(`uLong`);var n=e.parseUShort()&255;if(e.skip(`uShort`),n===0){var r=e.parseUShort();e.skip(`uShort`,3);for(var i=0;i<r;i+=1){var a=e.parseUShort(),o=e.parseUShort(),s=e.parseShort();t[a+`,`+o]=s}}return t}function Zo(e,t){var n=new U.Parser(e,t),r=n.parseUShort();if(r===0)return Yo(n);if(r===1)return Xo(n);throw Error(`Unsupported kern table version (`+r+`).`)}var Qo={parse:Zo};function $o(e,t,n,r){for(var i=new U.Parser(e,t),a=r?i.parseUShort:i.parseULong,o=[],s=0;s<n+1;s+=1){var c=a.call(i);r&&(c*=2),o.push(c)}return o}var es={parse:$o};function ts(e,t){i().readFile(e,function(e,n){if(e)return t(e.message);t(null,ur(n))})}function ns(e,t){var n=new XMLHttpRequest;n.open(`get`,e,!0),n.responseType=`arraybuffer`,n.onload=function(){return n.response?t(null,n.response):t(`Font could not be loaded: `+n.statusText)},n.onerror=function(){t(`Font could not be loaded`)},n.send()}function rs(e,t){for(var n=[],r=12,i=0;i<t;i+=1){var a=U.getTag(e,r),o=U.getULong(e,r+4),s=U.getULong(e,r+8),c=U.getULong(e,r+12);n.push({tag:a,checksum:o,offset:s,length:c,compression:!1}),r+=16}return n}function is(e,t){for(var n=[],r=44,i=0;i<t;i+=1){var a=U.getTag(e,r),o=U.getULong(e,r+4),s=U.getULong(e,r+8),c=U.getULong(e,r+12),l=void 0;l=s<c?`WOFF`:!1,n.push({tag:a,offset:o,compression:l,compressedLength:s,length:c}),r+=20}return n}function $(e,t){if(t.compression===`WOFF`){var n=new Uint8Array(e.buffer,t.offset+2,t.compressedLength-2),r=new Uint8Array(t.length);if(se(n,r),r.byteLength!==t.length)throw Error(`Decompression error: `+t.tag+` decompressed length doesn't match recorded length`);return{data:new DataView(r.buffer,0),offset:0}}else return{data:e,offset:t.offset}}function as(e,t){t=t??{};var n,r,i=new Q({empty:!0}),a=new DataView(e,0),o,s=[],c=U.getTag(a,0);if(c===`\0�\0\0`||c===`true`||c===`typ1`)i.outlinesFormat=`truetype`,o=U.getUShort(a,4),s=rs(a,o);else if(c===`OTTO`)i.outlinesFormat=`cff`,o=U.getUShort(a,4),s=rs(a,o);else if(c===`wOFF`){var l=U.getTag(a,4);if(l===`\0�\0\0`)i.outlinesFormat=`truetype`;else if(l===`OTTO`)i.outlinesFormat=`cff`;else throw Error(`Unsupported OpenType flavor `+c);o=U.getUShort(a,12),s=is(a,o)}else throw Error(`Unsupported OpenType signature `+c);for(var u,d,f,p,m,h,g,_,v,y,b,x,S=0;S<o;S+=1){var C=s[S],w=void 0;switch(C.tag){case`cmap`:w=$(a,C),i.tables.cmap=Ye.parse(w.data,w.offset),i.encoding=new tt(i.tables.cmap);break;case`cvt `:w=$(a,C),x=new U.Parser(w.data,w.offset),i.tables.cvt=x.parseShortList(C.length/2);break;case`fvar`:d=C;break;case`fpgm`:w=$(a,C),x=new U.Parser(w.data,w.offset),i.tables.fpgm=x.parseByteList(C.length);break;case`head`:w=$(a,C),i.tables.head=en.parse(w.data,w.offset),i.unitsPerEm=i.tables.head.unitsPerEm,n=i.tables.head.indexToLocFormat;break;case`hhea`:w=$(a,C),i.tables.hhea=rn.parse(w.data,w.offset),i.ascender=i.tables.hhea.ascender,i.descender=i.tables.hhea.descender,i.numberOfHMetrics=i.tables.hhea.numberOfHMetrics;break;case`hmtx`:g=C;break;case`ltag`:w=$(a,C),r=fn.parse(w.data,w.offset);break;case`maxp`:w=$(a,C),i.tables.maxp=hn.parse(w.data,w.offset),i.numGlyphs=i.tables.maxp.numGlyphs;break;case`name`:y=C;break;case`OS/2`:w=$(a,C),i.tables.os2=In.parse(w.data,w.offset);break;case`post`:w=$(a,C),i.tables.post=zn.parse(w.data,w.offset),i.glyphNames=new rt(i.tables.post);break;case`prep`:w=$(a,C),x=new U.Parser(w.data,w.offset),i.tables.prep=x.parseByteList(C.length);break;case`glyf`:f=C;break;case`loca`:v=C;break;case`CFF `:u=C;break;case`kern`:_=C;break;case`GDEF`:p=C;break;case`GPOS`:m=C;break;case`GSUB`:h=C;break;case`meta`:b=C;break}}var T=$(a,y);if(i.tables.name=jn.parse(T.data,T.offset,r),i.names=i.tables.name,f&&v){var E=n===0,D=$(a,v),O=es.parse(D.data,D.offset,i.numGlyphs,E),k=$(a,f);i.glyphs=Sr.parse(k.data,k.offset,O,i,t)}else if(u){var A=$(a,u);Zt.parse(A.data,A.offset,i,t)}else throw Error(`Font doesn't contain TrueType or CFF outlines.`);var j=$(a,g);if(ln.parse(i,j.data,j.offset,i.numberOfHMetrics,i.numGlyphs,i.glyphs,t),ot(i,t),_){var M=$(a,_);i.kerningPairs=Qo.parse(M.data,M.offset)}else i.kerningPairs={};if(p){var N=$(a,p);i.tables.gdef=Uo.parse(N.data,N.offset)}if(m){var P=$(a,m);i.tables.gpos=Jo.parse(P.data,P.offset),i.position.init()}if(h){var ee=$(a,h);i.tables.gsub=Wn.parse(ee.data,ee.offset)}if(d){var te=$(a,d);i.tables.fvar=Io.parse(te.data,te.offset,i.names)}if(b){var F=$(a,b);i.tables.meta=qn.parse(F.data,F.offset),i.metas=i.tables.meta}return i}function os(e,t,n){n=n??{};var r=typeof window>`u`&&!n.isUrl?ts:ns;return new Promise(function(i,a){r(e,function(e,r){if(e){if(t)return t(e);a(e)}var o;try{o=as(r,n)}catch(e){if(t)return t(e,null);a(e)}if(t)return t(null,o);i(o)})})}function ss(e,t){return as(ur(i().readFileSync(e)),t)}var cs=Object.freeze({__proto__:null,Font:Q,Glyph:W,Path:I,BoundingBox:le,_parse:U,parse:as,load:os,loadSync:ss});function ls(e){return e.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,``)}function us(e,t){return new Promise(n=>{e.style.fontShadow=Array.isArray(e.style.fontShadow)?e.style.fontShadow:[],e.style.fontStroke=Array.isArray(e.style.fontStroke)?e.style.fontStroke:[],e.style.lineHeight=Number.isFinite(Number(e.style.lineHeight))?Number(e.style.lineHeight):Number(e.style.fontSize)||12,e.style.fontSize=Number.isFinite(Number(e.style.fontSize))?Number(e.style.fontSize):12,e.style.width=Number.isFinite(Number(e.style.width))?Number(e.style.width):1,e.style.height=Number.isFinite(Number(e.style.height))?Number(e.style.height):e.style.lineHeight,e.style.opacity=Number.isFinite(Number(e.style.opacity))?Number(e.style.opacity):1;let r=``,i=String(e.value??``).split(``);
1i.forEach((e,t)=>{e===`&`&&(i[t]=`&amp;`),e===`>`&&(i[t]=`&gt;`),e===`<`&&(i[t]=`&lt;`)}),i.forEach(e=>{r=`${r}${e}`});let a=`<div style="${fs(e,t)}">${ls(r)}</div>`;e.style.fontStroke.forEach((n,i)=>{let o=ds(e,i,t);a+=`<div style="${o}">${ls(r)}</div>`}),Math.min((e.style.fontSize??12)/12,1);let o=Number(Number(e.style.width).toFixed(8)),s=e.isAutoWidth&&!e.style.vertical?Math.max(e.style.height,e.style.lineHeight):e.style.height,c=Number(Number(s).toFixed(8)),l=e.fonts[e.src],u=e.fallbackSrc?e.fonts[e.fallbackSrc]:void 0,d=l?hs(l,e.style.fontFamily,e.value,u):``;a=`<div xmlns="http://www.w3.org/1999/xhtml" style="${ps(e)}" >${a}</div>`;let f=`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${c}"><defs><style>${d}</style></defs><foreignObject width="100%" height="100%">${a}</foreignObject></svg>`,p=`data:image/svg+xml;charset=utf8,`+encodeURIComponent(f),m=new Image;m.crossOrigin=`anonymous`,m.onload=function(e){n(m)},m.src=p})}function ds(e,t,n){let r=``;e.style.fontShadow&&e.style.fontShadow.length&&e.style.fontShadow.forEach((e,t)=>{r+=`${n||e.color} ${e.value[0]/3.7795275591}px ${e.value[1]/3.7795275591}px ${e.value[2]/3.7795275591}px ${t>0?`,`:``}`});let i=Math.min((e.style.fontSize??12)/12,1),a=Math.max(e.style.fontSize??12,12);return[...ms(e),`position: absolute`,`z-index: ${e.style.fontShadow.length-t}`,`top: 0`,`left: 0`,`line-height:${e.style.lineHeight/e.style.fontSize}`,`display: ${e.style.display||`block`}`,`font-size: ${a}px`,`font-family: ${e.style.fontFamily},Poppins,NotoSansCJK,Arial`,`text-align: ${e.style.textAlign}`,`color: ${n||e.style.color||`#000000`}`,`font-weight: ${e.style.fontWeight}`,`font-style: ${e.style.fontStyle||`normal`}`,`opacity: ${e.style.opacity}`,`transform: scale(${i})`,`transform-origin:0 0`,`writing-mode:${e.style.vertical?`vertical-rl`:`horizontal-tb`}`,`text-shadow:${r||``}`,`-webkit-text-stroke:${e.style.fontStroke[t].value/3.7795275591}px ${n||e.style.fontStroke[t].color}`,`-webkit-font-smoothing: antialiased`].join(`;`)}function fs(e,t){let n=Math.min(Number(e.style.fontSize??12)/12,1),r=e.style,i=Math.max(r.fontSize??12,12);return[...ms(e),`line-height: ${`${(r.lineHeight??12)/(r.fontSize??12)}`}`,`position: absolute`,`z-index: ${e.style.fontShadow.length+1}`,`top: 0`,`left: 0`,`display: ${e.style.display||`block`}`,`font-size: ${i}px`,`font-family: ${e.style.fontFamily},Poppins,NotoSansCJK,Arial`,`text-align: ${e.style.textAlign}`,`color: ${t||e.style.color||`#000000`}`,`font-weight: ${e.style.fontWeight}`,`font-style: ${e.style.fontStyle||`normal`}`,`opacity: ${e.style.opacity}`,`transform: scale(${n})`,`transform-origin:0 0`,`writing-mode:${e.style.vertical?`vertical-rl`:`horizontal-tb`}`,`-webkit-font-smoothing: antialiased`].join(`;`)}function ps(e){return[...ms(e),`position: relative`].join(`;`)}function ms(e){let t=e.style,n=Math.min((t.fontSize??12)/12,1),r=!!e.isAutoWidth;return[`width:${e.style.vertical?`auto`:r?`max-content`:`${e.style.width/n}px`} `,`min-height: ${e.style.vertical?`auto`:`${e.style.lineHeight??12}px`}`,`height: ${e.style.vertical?r?`max-content`:`${e.style.height/n}px`:`auto`}`,`min-width: ${e.style.vertical?`${e.style.lineHeight??12}px`:`auto`}`,`outline: none`,`line-break: ${r?`auto`:`anywhere`}`,`overflow-wrap: ${r?`normal`:`anywhere`}`,`word-break: ${r?`normal`:`break-all`}`,`white-space: ${r?`pre`:`break-spaces`}`]}function hs(e,t,n,r){if(!e)return``;let i=``;if(e.type===`opentype`){let a=e.data,o=new cs.Font({familyName:t,styleName:`Regular`,unitsPerEm:a.unitsPerEm,ascender:a.ascender,descender:a.descender,glyphs:[]});for(let e=0;e<n.length;e++){let t=a.charToGlyph(n[e]);t.index===0&&(r==null?void 0:r.type)===`opentype`&&(t=r.data.charToGlyph(n[e])),o.glyphs.push(e,()=>t)}let s=o.toArrayBuffer();i=`data:font/opentype;base64,`+btoa(String.fromCharCode.apply(null,new Uint8Array(s)))}else i=e.data;return`@font-face {
2    font-family: ${t};
3    src: url('${i}');
4  }`}var gs=class extends s{constructor(e){super(e),t(this,`color`,void 0),t(this,`fontFamily`,void 0),t(this,`fontResultRatio`,void 0),t(this,`fontShadow`,void 0),t(this,`fontSize`,void 0),t(this,`fontStroke`,void 0),t(this,`fontStyle`,void 0),t(this,`fontWeight`,void 0),t(this,`lineHeight`,void 0),t(this,`textAlign`,void 0),t(this,`vertical`,void 0),t(this,`fontResultId`,void 0),t(this,`src`,void 0),t(this,`original_src`,void 0),t(this,`value`,void 0),t(this,`fonts`,void 0),t(this,`fallbackSrc`,void 0),t(this,`isAutoWidth`,void 0),this.color=e.color,this.fontFamily=e.fontFamily,this.fontResultId=e.fontResultId,this.src=e.src,this.value=e.value,this.original_src=e.original_src,this.vertical=e.vertical,this.textAlign=e.textAlign,this.lineHeight=e.lineHeight,this.fontWeight=e.fontWeight,this.fontStyle=e.fontStyle,this.fontStroke=e.fontStroke,this.fontSize=e.fontSize,this.fontShadow=e.fontShadow,this.fontResultRatio=e.fontResultRatio,this.fonts=e.fonts,this.fallbackSrc=e.fallbackSrc,this.isAutoWidth=!!e.isAutoWidth}async draw(e,t){let n=await us({src:this.src,fallbackSrc:this.fallbackSrc,value:this.value,fontResultId:this.fontResultId,original_src:this.original_src,isAutoWidth:this.isAutoWidth,style:{color:this.color,width:this.width,height:this.height,fontFamily:this.fontFamily,fontResultRatio:this.fontResultRatio,fontShadow:this.fontShadow,fontSize:this.fontSize,fontStroke:this.fontStroke,fontStyle:this.fontStyle,fontWeight:this.fontWeight,lineHeight:this.lineHeight,opacity:this.opacity,textAlign:this.textAlign,vertical:this.vertical},fonts:this.fonts},``);
4e.drawImage(n,0,0,this.width*t,this.height*t)}},_s=class extends v{constructor(e){super(e),t(this,`color`,void 0),t(this,`repeat`,void 0),this.color=e.color,this.repeat=e.repeat}getRepeat(){var e,t;let n=Number((e=this.repeat)==null?void 0:e.x),r=Number((t=this.repeat)==null?void 0:t.y);return!Number.isFinite(n)||!Number.isFinite(r)||n<=0||r<=0||n===1&&r===1?null:{x:n,y:r}}async drawRepeatedImage(e,t,n){this.fileIsLoaded||await this.loadPromise;let r=this.width*t,i=this.height*t,a=r/n.x,o=i/n.y,s=Math.ceil(n.x),c=Math.ceil(n.y);e.save(),e.beginPath(),e.rect(0,0,r,i),e.clip();for(let t=0;t<s;t++)for(let n=0;n<c;n++){let s=t*a,c=n*o;e.drawImage(this.image,s,c,Math.min(a+1,r-s),Math.min(o+1,i-c))}e.restore()}async draw(e,t){if(this.path){let n=this.getRepeat();n?await this.drawRepeatedImage(e,t,n):await super.draw(e,t)}this.color&&(e.fillStyle=this.color,e.fillRect(0,0,this.width*t,this.height*t))}},vs=class extends s{constructor(e){super(e),t(this,`fill`,void 0),t(this,`stroke`,void 0),t(this,`strokeDashArray`,void 0),t(this,`type`,void 0),t(this,`strokeWidth`,void 0),t(this,`radius`,void 0),this.fill=e.fill,this.stroke=e.stroke,this.type=e.type,this.strokeWidth=e.strokeWidth,this.radius=e.radius,this.strokeDashArray=e.strokeDashArray}getSVGImage(e){let t=new Image(this.width,this.height);t.setAttribute(`crossOrigin`,`Anonymous`);let n=null,r=new Promise(e=>n=e);t.onload=e=>{n&&n(t)},t.onerror=e=>{console.error(`painter load image error`,e,t.src),n&&n(t)};let i=document.createElement(`div`);return i.innerHTML=e,t.src=`data:image/svg+xml,`+encodeURIComponent(new XMLSerializer().serializeToString(i.querySelector(`svg`))),r}async draw(t,n){let r=e({uuid:``,width:this.width,height:this.height,type:this.type,fill:this.fill,stroke:this.stroke,strokeWidth:this.strokeWidth,strokeDashArray:this.strokeDashArray,radius:this.radius}
4),i=await this.getSVGImage(r);t.drawImage(i,0,0,this.width*n,this.height*n)}},ys=class extends s{constructor(e){super(e);let t=e.designs;for(let n=0;n<t.length;n++){let r=t[n],i=null;switch(r.type){case`shape`:i=new vs({width:r.style.width,height:r.style.height,position:new o(r.style.left,r.style.top),radius:r.style.radius,type:r.shapeType,stroke:r.style.stroke,strokeWidth:r.style.strokeWidth,strokeDashArray:r.style.strokeDashArray,fill:r.style.color});break;case`img`:i=new v({width:r.style.width,height:r.style.height,rotateX:r.style.rotateX,rotateY:r.style.rotateY,bg:r.bg,position:new o(r.style.left,r.style.top),path:r.src,opacity:r.style.opacity/100,rotation:r.style.rotate/180*Math.PI,can_set_color:r.can_set_color,fills:r.fills,tint:r._texture_tint,fit:r._image_fit});break;case`font`:i=new gs({width:r.style.width,height:r.style.height,position:new o(r.style.left,r.style.top),src:r.src,original_src:r.original_src,opacity:r.style.opacity/100,rotation:r.style.rotate/180*Math.PI,color:r.style.color,value:r.value,fontResultId:r.fontResultId,fontSize:r.style.fontSize,fontResultRatio:r.style.fontResultRatio,fontFamily:r.style.fontFamily,fontShadow:r.style.fontShadow??[],fontStyle:r.style.fontStyle,fontWeight:r.style.fontWeight,lineHeight:r.style.lineHeight,textAlign:r.style.textAlign,vertical:r.style.vertical,fontStroke:r.style.fontStroke??[],fonts:e.fonts,isAutoWidth:r._is_auto_width})}i&&this.children.push(i)}}async draw(e,t){}};function bs(e,t,n,r,i,a,o,s,c,l){let u=function(e){return Math.sqrt(e[0]**2+e[1]**2)},d=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(u(e)*u(t))},f=function(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(d(e,t))},p=Math.cos(a)*(t-c)/2+Math.sin(a)*(n-l)/2,m=-Math.sin(a)*(t-c)/2+Math.cos(a)*(n-l)/2,h=p**2/r**2+m**2/i**2;h>1&&(r*=Math.sqrt(h),i*=Math.sqrt(h));let g=(o===s?-1:1)*Math.sqrt((r**2*i**2-r**2*m**2-i**2*p**2)/(r**2*m**2+i**2*p**2));isNaN(g)&&(g=0);let _=g*r*m/i,v=g*-i*p/r,y=(t+c)/2+Math.cos(a)*_-Math.sin(a)*v,b=(n+l)/2+Math.sin(a)*_+Math.cos(a)*v,x=f([1,0],[(p-_)/r,(m-v)/i]),S=[(p-_)/r,(m-v)/i],C=[(-p-_)/r,(-m-v)/i],w=f(S,C);d(S,C)<=-1&&(w=Math.PI),d(S,C)>=1&&(w=0);let T=r>i?r:i,E=r>i?1:r/i,D=r>i?i/r:1;e.translate(y,b),e.rotate(a),e.scale(E,D),e.arc(0,0,T,x,x+w,!!(1-s)),e.scale(1/E,1/D),e.rotate(-a),e.translate(-y,-b)}var xs=class extends s{async draw(e,t){e.lineWidth=this.lineWidth*t,e.setLineDash(this.lineDash),e.beginPath();for(let o=0;o<this.path.length;o++){let s=this.path[o];switch(s.mtd){case`M`:e.moveTo((this.flipX?this.width-s.x:s.x)*t,(this.flipY?this.height-s.y:s.y)*t);break;case`L`:case`H`:case`V`:e.lineTo((this.flipX?this.width-s.x:s.x)*t,(this.flipY?this.height-s.y:s.y)*t);break;case`Q`:e.quadraticCurveTo((this.flipX?this.width-(s.cx??0):s.cx??0)*t,(this.flipY?this.height-(s.cy??0):s.cy??0)*t,(this.flipX?this.width-s.x:s.x)*t,(this.flipY?this.height-s.y:s.y)*t);break;case`C`:let c=s.cx??0,l=s.cy??0,u=s.cx1??0,d=s.cy1??0,f=s.x??0,p=s.y??0;e.bezierCurveTo((this.flipX?this.width-c:c)*t,(this.flipY?this.height-l:l)*t,(this.flipX?this.width-u:u)*t,(this.flipY?this.height-d:d)*t,(this.flipX?this.width-f:f)*t,(this.flipY?this.height-p:p)*t);break;case`A`:var n,r,i,a;bs(e,(this.flipX?this.width-(((n=this.path[o-1])==null?void 0:n.x)??0):((r=this.path[o-1])==null?void 0:r.x)??0)*t,(this.flipY?this.height-(((i=this.path[o-1])==null?void 0:i.y)??0):((a=this.path[o-1])==null?void 0:a.y)??0)*t,(this.flipX?this.width-(s.rx??0):s.rx??0)*t,(this.flipY?this.height-(s.ry??0):s.ry??0)*t,s.ang??0,s.arc??0,this.flipX&&this.flipY||!(this.flipX||this.flipY)?s.dir??0:+((s.dir??0)===0),(this.flipX?this.width-s.x:s.x)*t,(this.flipY?this.height-s.y:s.y)*t);break;case`Z`:this.isClose?(e.closePath(),e.fillStyle=this.color,e.fill()):(e.closePath(),e.strokeStyle=this.color,e.stroke());break}o===this.path.length-1&&s.mtd!==`Z`&&(this.isClose?(e.closePath(),e.fillStyle=this.color,e.fill()):(e.strokeStyle=this.color,e.stroke()))}e.setLineDash([])}constructor(e){super(e),t(this,`path`,void 0),t(this,`isClose`,void 0),t(this,`color`,void 0),t(this,`flipX`,!1),t(this,`flipY`,!1),t(this,`lineWidth`,1),t(this,`lineDash`,void 0),this.path=e.path,this.isClose=e.isClose,this.color=e.color,this.flipX=e.flipX??!1,this.flipY=e.flipY??!1,this.lineWidth=e.lineWidth??1,this.lineDash=e.lineDash??[]}};function Ss(e){return new Promise((t,n)=>{let r=new Image;r.crossOrigin=`anonymous`,r.src=e,r.onload=()=>t(r),r.onerror=()=>n(Error(`Image load failed`))})}function Cs(e){if(e.length===0)return null;let t=e.reduce((e,t)=>
4({w:e.w+t.w,h:e.h+t.h}),{w:0,h:0});return{name:e.map(e=>e.name).join(`,`),w:t.w/e.length,h:t.h/e.length}}function ws(e){let t=[],n=e.trim().split(/(?=[MLHVCSQTAZ])/i).filter(Boolean),r=0,i=0;return n.forEach(e=>{let n=e.trim().split(/\s+/),a=n[0],o=n.slice(1).map(e=>parseFloat(e));switch(a){case`M`:o.length>=2&&(r=o[0],i=o[1],t.push({mtd:`M`,x:r,y:i}));break;case`L`:o.length>=2&&(r=o[0],i=o[1],t.push({mtd:`L`,x:r,y:i}));break;case`H`:o.length>=1&&(r=o[0],t.push({mtd:`H`,x:r,y:i}));break;case`V`:o.length>=1&&(i=o[0],t.push({mtd:`V`,x:r,y:i}));break;case`C`:o.length>=6&&(r=o[4],i=o[5],t.push({mtd:`C`,cx:o[0],cy:o[1],cx1:o[2],cy1:o[3],x:r,y:i}));break;case`Q`:o.length>=4&&(r=o[2],i=o[3],t.push({mtd:`Q`,cx:o[0],cy:o[1],x:r,y:i}));break;case`A`:o.length>=7&&(r=o[5],i=o[6],t.push({mtd:`A`,rx:o[0],ry:o[1],ang:o[2],arc:o[3],dir:o[4],x:r,y:i}));break;case`Z`:t.push({mtd:`Z`,x:r,y:i});break}}),t}function Ts(e,t,n,r,i,a,o,s,c,l){let u=function(e){return Math.sqrt(e[0]**2+e[1]**2)},d=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(u(e)*u(t))},f=function(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(d(e,t))},p=Math.cos(a)*(t-c)/2+Math.sin(a)*(n-l)/2,m=-Math.sin(a)*(t-c)/2+Math.cos(a)*(n-l)/2,h=p**2/r**2+m**2/i**2;h>1&&(r*=Math.sqrt(h),i*=Math.sqrt(h));let g=(o===s?-1:1)*Math.sqrt((r**2*i**2-r**2*m**2-i**2*p**2)/(r**2*m**2+i**2*p**2));isNaN(g)&&(g=0);let _=g*r*m/i,v=g*-i*p/r,y=(t+c)/2+Math.cos(a)*_-Math.sin(a)*v,b=(n+l)/2+Math.sin(a)*_+Math.cos(a)*v,x=f([1,0],[(p-_)/r,(m-v)/i]),S=[(p-_)/r,(m-v)/i],C=[(-p-_)/r,(-m-v)/i],w=f(S,C);d(S,C)<=-1&&(w=Math.PI),d(S,C)>=1&&(w=0);let T=r>i?r:i,E=r>i?1:r/i,D=r>i?i/r:1;e.translate(y,b),e.rotate(a),e.scale(E,D),e.arc(0,0,T,x,x+w,!!(1-s)),e.scale(1/E,1/D),e.rotate(-a),e.translate(-y,-b)}var Es=class extends s{async draw(e,t){e.beginPath();for(let o=0;o<this.path.length;o++){let s=this.path[o];switch(s.mtd){case`M`:e.moveTo((this.flipX?this.width-s.x:s.x)*t,(this.flipY?this.height-s.y:s.y)*t);break;case`L`:e.lineTo((this.flipX?this.width-s.x:s.x)*t,(this.flipY?this.height-s.y:s.y)*t);break;case`Q`:e.quadraticCurveTo((this.flipX?this.width-(s.cx??0):s.cx??0)*t,(this.flipY?this.height-(s.cy??0):s.cy??0)*t,(this.flipX?this.width-s.x:s.x)*t,(this.flipY?this.height-s.y:s.y)*t);break;case`C`:let c=s.cx??0,l=s.cy??0,u=s.cx1??0,d=s.cy1??0,f=s.x??0,p=s.y??0;e.bezierCurveTo((this.flipX?this.width-c:c)*t,(this.flipY?this.height-l:l)*t,(this.flipX?this.width-u:u)*t,(this.flipY?this.height-d:d)*t,(this.flipX?this.width-f:f)*t,(this.flipY?this.height-p:p)*t);break;case`A`:var n,r,i,a;Ts(e,(this.flipX?this.width-(((n=this.path[o-1])==null?void 0:n.x)??0):((r=this.path[o-1])==null?void 0:r.x)??0)*t,(this.flipY?this.height-(((i=this.path[o-1])==null?void 0:i.y)??0):((a=this.path[o-1])==null?void 0:a.y)??0)*t,(this.flipX?this.width-(s.rx??0):s.rx??0)*t,(this.flipY?this.height-(s.ry??0):s.ry??0)*t,s.ang??0,s.arc??0,this.flipX&&this.flipY||!(this.flipX||this.flipY)?s.dir??0:+((s.dir??0)===0),(this.flipX?this.width-s.x:s.x)*t,(this.flipY?this.height-s.y:s.y)*t);break;case`Z`:this.isClose&&e.closePath();break}}this.isClose?(e.closePath(),e.clip()):e.clip(`nonzero`)}constructor(e){super(e),t(this,`path`,void 0),t(this,`isClose`,void 0),t(this,`color`,void 0),t(this,`flipX`,!1),t(this,`flipY`,!1),t(this,`lineWidth`,1),this.path=e.path,this.isClose=e.isClose,this.color=e.color,this.flipX=e.flipX??!1,this.flipY=e.flipY??!1,this.lineWidth=e.lineWidth??1}},Ds=[{map:{cdn:``},repeat:null,matchMaterialKeys:[`WHITE_BOARD`],matchScienceIds:[8],matchGroupKeys:[`white paperboard`],matchKeywords:[`白卡纸`,`white card`,`white cardboard`,`white paperboard`]},{map:{cdn:`//cdn.pacdora.com/texture/6c390317-7897-4cce-926a-c5fc9838c9e7.jpg`,oss:`https://oss.pacdora.cn/frontend/web-assets/82711ca5-0ecb-4c76-9e63-05fddcf736c2.jpg`},repeat:{x:3,y:3},matchMaterialKeys:[`KRAFT`],matchScienceIds:[36],matchGroupKeys:[`kraft paperboard`],matchKeywords:[`牛皮`,`kraft`]},{map:{cdn:`//cdn.pacdora.com/texture/214fcbd1-5f78-47c9-a458-d8101371e200.jpg`,oss:`https://oss.pacdora.cn/frontend/web-assets/27a8b0fc-8814-4107-9a41-6bc266492f81.jpg`},repeat:{x:3,y:3},matchMaterialKeys:[`FLUTE`],matchScienceIds:[3,4,5,6,10,11,12,13,14,15,16,17,18,19,20,21],matchGroupKeys:[`corrugated paper`],matchKeywords:[`瓦楞`,`flute`,`corrugated`]}];function Os(e){return String(e??``).trim().toLowerCase()}function ks(e){return String(e??``).trim().toUpperCase().replace(/[\s-]+/g,`_`)}function As(){if(typeof document<`u`){var e,t;if((((e=document.body)==null?void 0:e.getAttribute(`lang`))||((t=document.documentElement)==null?void 0:t.getAttribute(`lang`)))===`zh-CN`)return!0}if(typeof window<`u`){let e=window.location.hostname;return e.includes(`pacdora.cn`)||e.includes(`baoxiaohe.com`)}return!1}function js(e){return e?As()&&e.oss?e.oss:e.cdn:``}function Ms(e){var t;let n=(e==null?void 0:e.layer)??{},r=e==null||(t=e.cate)==null?void 0:t.layerList;return!Array.isArray(r)||!r.length?Object.keys(n):r.filter(e=>!e.isGrey).map(e=>e.name).filter(e=>n[e])}function Ns(e){var t,n;return Number(e==null||(t=e.cate)==null?void 0:t.elaborate)===1?e==null?void 0:e.science_id:(e==null||(n=e.layer)==null||(n=n.traditional)==null?void 0:n.science_id)??(e==null?void 0:e.science_id)}function Ps(e){let t=Object.values((e==null?void 0:e.layer)??{});return[e==null?void 0:e.material,e==null?void 0:e.materialKey,e==null?void 0:e.material_key,e==null?void 0:e.science_name,e==null?void 0:e.zhName,e==null?void 0:e.zh_name,e==null?void 0:e.group_name,e==null?void 0:e.group_key,...t.flatMap(e=>[e==null?void 0:e.science_name,e==null?void 0:e.group_name,e==null?void 0:e.group_key])].map(Os).filter(
4Boolean).join(` `)}function Fs(e){return ks((e==null?void 0:e.material)??(e==null?void 0:e.materialKey)??(e==null?void 0:e.material_key))}function Is(e){var t;let n=Fs(e),r=Number(Ns(e)),i=Ps(e),a=Os((e==null?void 0:e.group_key)??(e==null||(t=e.layer)==null||(t=t.traditional)==null?void 0:t.group_key));for(let e of Ds)if(e.matchMaterialKeys.some(e=>ks(e)===n))return e;for(let e of Ds)if(Number.isFinite(r)&&e.matchScienceIds.includes(r)||e.matchGroupKeys.some(e=>Os(e)===a)||e.matchKeywords.some(e=>i.includes(Os(e))))return e}function Ls(e,t){return Number(e==null?void 0:e.x)===Number(t==null?void 0:t.x)&&Number(e==null?void 0:e.y)===Number(t==null?void 0:t.y)}function Rs(e){try{var t;if(!e||Number(e==null||(t=e.cate)==null?void 0:t.complex_type)===1)return e;let r=Is(e);if(!r)return e;let i=js(r.map);if(!i)return e;for(let t of Ms(e)){var n;let a=(n=e.layer)==null?void 0:n[t];if(!a)continue;a.science_image!==i&&(a.science_image=i);let o=r.repeat?{...r.repeat}:null;Ls(a.science_image_repeat,o)||(a.science_image_repeat=o)}return e}catch{return e}}var zs={SCALE_MIN:.2,SCALE_MAX:5,SCALE_STEP:.1,SCALE_DEFAULT:1,OFFSET_MIN:-200,OFFSET_MAX:200,OFFSET_STEP:1,OFFSET_DEFAULT:0,ANGLE_MIN:0,ANGLE_MAX:360,ANGLE_STEP:1,ANGLE_DEFAULT:0},Bs={ANGLE_0:0,ANGLE_180:180,ANGLE_DEFAULT:0,SCALE_MIN:.2,SCALE_MAX:5,SCALE_STEP:.1,SCALE_DEFAULT:1};function Vs(e){return new Promise(t=>{let n=new FileReader;n.onloadend=()=>t(n.result),n.readAsDataURL(e)})}var Hs=class{constructor(e,n,r=`preview`){t(this,`project`,void 0),t(this,`knife`,void 0),t(this,`canvasMap`,void 0),t(this,`needUpdates`,{}),t(this,`scale`,3),t(this,`mode`,void 0),t(this,`isShowScience`,!0),t(this,`persist`,!1),t(this,`fonts`,{}),t(this,`DPI`,3.7795275591),t(this,`isShowSize`,!1),t(this,`isShowWatermak`,!1),t(this,`watermark`,void 0),t(this,`mainLayer`,``),t(this,`mainFace`,``),t(this,`mainSide`,`outside`),t(this,`showWithAi`,!1),t(this,`uploadTextAngle`,z
4s.ANGLE_DEFAULT),t(this,`uploadTextScale`,zs.SCALE_DEFAULT),t(this,`uploadTextOffsetX`,zs.OFFSET_DEFAULT),t(this,`uploadTextOffsetY`,zs.OFFSET_DEFAULT),t(this,`textGroupCache`,new Map),t(this,`watermarkAngle`,Bs.ANGLE_DEFAULT),t(this,`watermarkScale`,Bs.SCALE_DEFAULT),t(this,`languages`,{mainFace:`Upload your images`,orCreateWithAi:`or create with AI`}),t(this,`_languagesColor`,`#4c4c4c`),t(this,`lang`,`en-US`),t(this,`viewport`,void 0),t(this,`hasMainFace`,!1),t(this,`clipFaces`,void 0),t(this,`onlyShowUploadImage`,!1),this.project=Rs(e),this.knife=n,this.canvasMap={},this.mode=r,this.calScale()}get languagesColor(){return this._languagesColor}set languagesColor(e){this._languagesColor=e}setViewport(e,t){this.viewport={width:e,height:t}}switchLanguage(e,t){t&&(this.lang=t),e&&(this.languages={mainFace:e.mainFace,orCreateWithAi:e.orCreateWithAi??`or create with AI`})}async setWatermark(e,t){this.isShowWatermak=e,this.watermark=t?await r(t):void 0}setUploadTextAngle(e){this.uploadTextAngle=e}setUploadTextScale(e){this.uploadTextScale=e}setUploadTextOffset(e,t){this.uploadTextOffsetX=e,this.uploadTextOffsetY=t}setWatermarkSettings(e){e.angle!==void 0&&(this.watermarkAngle=e.angle===180?180:0),e.scale!==void 0&&(this.watermarkScale=Math.max(Bs.SCALE_MIN,Math.min(Bs.SCALE_MAX,e.scale)))}getWatermarkSettings(){return{angle:this.watermarkAngle,scale:this.watermarkScale}}drawWatermark(e,t,n=!1){var r;if(!this.watermark)return;let i=e,a=i.getContext(`2d`),o=[],s=i.width,c=i.height,l=!1;t&&!((r=this.knife)==null||(r=r.layer)==null||(r=r[t])==null)&&r.faces&&(o=this.knife.layer[t].faces,s=this.knife.layer[t].totalX,c=this.knife.layer[t].totalY,l=!0);let u=(this.watermark.width||1)/(this.watermark.height||1),d=i.width/this.scale,f=6;f=d<100?2:d<500?4:d<1e3?6:d<2e3?8:10;let p=i.width/f*this.watermarkScale,m=p/u,h=p<24||m<24,g=p<12||m<12,_=Math.ceil(i.width/p),v=Math.ceil(i.height/m);if(_=Math.min(_,50),v=Math.min(v,50),l&&(_+=1,v+=1),a.save(),h||this.watermarkScale<.5?(a.imageSmoothingEnabled=!0,a.imageSmoothingQuality=`high`):(a.imageSmoothingEnabled=!0,a.imageSmoothingQuality=`medium`),l&&o.length>0){let e=new Es({path:o.map(e=>e.dlist||[]).flat(),width:s,height:c,flipX:n,isClose:!0}),t=i.width/s;e.draw(a,t)}g?(a.globalAlpha=.3,a.globalCompositeOperation=`difference`):h?(a.globalAlpha=.4,a.globalCompositeOperation=`multiply`):this.watermarkScale<.5?(a.globalAlpha=.6,a.globalCompositeOperation=`source-over`):(a.globalAlpha=.8,a.globalCompositeOperation=`source-over`);try{for(let e=0;e<v;e++)for(let t=0;t<_;t++){let n=t*p,r=e*m;if(this.watermarkAngle===180){if(a.save(),a.translate(n+p/2,r+m/2),a.rotate(Math.PI),h){let e=Math.round(p),t=Math.round(m);a.globalCompositeOperation=`source-over`,a.globalAlpha=.3,a.shadowColor=`rgba(255, 255, 255, 0.8)`,a.shadowBlur=1,a.shadowOffsetX=0,a.shadowOffsetY=0,a.drawImage(this.watermark,-e/2,-t/2,e,t),a.shadowColor=`transparent`,a.shadowBlur=0,a.globalCompositeOperation=`multiply`,a.globalAlpha=.4,a.drawImage(this.watermark,-e/2,-t/2,e,t)}else a.drawImage(this.watermark,-p/2,-m/2,p,m);a.restore()}else if(l||n<i.width&&r<i.height)if(h){let e=Math.round(n),t=Math.round(r),i=Math.round(p),o=Math.round(m);a.save(),a.globalCompositeOperation=`source-over`,a.globalAlpha=.3,a.shadowColor=`rgba(255, 255, 255, 0.8)`,a.shadowBlur=1,a.shadowOffsetX=0,a.shadowOffsetY=0,a.drawImage(this.watermark,e,t,i,o),a.shadowColor=`transparent`,a.shadowBlur=0,a.globalCompositeOperation=`multiply`,a.globalAlpha=.4,a.drawImage(this.watermark,e,t,i,o),a.restore()}else a.drawImage(this.watermark,n,r,p,m)}}catch(e){console.error(`绘制水印时出错:`,e)}a.restore()}setPainterMode(e){this.mode=e||`preview`,this.calScale()}setClipFaces(e){this.clipFaces=e}getFontAssertUrl(){return this.lang===`zh-CN`?`https://oss.pacdora.cn/frontend/webFonts/HarmonyOS_Sans_SC_Regular.woff2`:`https://cdn.pacdora.com/font_v2/Poppins/Poppins-Regular.woff2`}calScale(){if(this.knife){let{totalX:e,totalY:t}=n(this.knife);switch(this.mode){case`preview`:Math.max(e,t)<500?this.scale=9:Math.max(e,t)<800?this.scale=6:Math.max(e,t)<1500?this.scale=3:Math.max(e,t)<3e3?this.scale=1:this.scale=.8;break;case`iosPhone`:Math.max(e,t)<500?this.scale=7:Math.max(e,t)<1200?this.scale=5:Math.max(e,t)<2e3?this.scale=3:Math.max(e,t)<3e3?this.scale=1:this.scale=.7;break;case`performance`:Math.max(e,t)<500?this.scale=3:Math.max(e,t)<1e3||Math.max(e,t)<2e3?this.scale=1:this.scale=.6;break;case`render`:let n=2048/Math.max(e,t)*this.DPI;this.scale=n;break}}}setProject(e){e&&(this.project=Rs(e))}setKnife(e){this.knife=e,this.calScale()}setPersist(e){this.persist=e}
4async drawBackground(e,t,n=`outside`){let{science_image:r,science_image_repeat:i}=t,a=new _s({path:this.isShowScience?r:``,color:t.color,repeat:i,position:new o(0,0),width:e.width*e.ratio,height:e.height*e.ratio});e.addChild(a);let s=t.faces,c=t.faceColor,l=Object.keys(c||{});for(let r=0;r<l.length;r++){let i=l[r],a=c[i].rgba,u=s.find(e=>e.name===i);if(u){let r=new xs({path:u.dlist,color:a,width:t.totalX,height:t.totalY,flipX:n===`inside`,position:new o(0,0),isClose:!0});e.addChild(r)}}}async setHoverColor(e,t,n,r){var i;let a=Object.keys(this.canvasMap);for(let t=0;t<a.length;t++){let n=this.canvasMap[a[t]],r=n.outside.children.findIndex(e=>e.name===`hover`);r>=0&&(n.outside.children.splice(r,1),e!==a[t]&&(await n.outside.render(),this.isShowWatermak&&this.drawWatermark(n.outside.domElement,a[t].replace(`_element`,``),!1)));let i=n.inside.children.findIndex(e=>e.name===`hover`);i>=0&&(n.inside.children.splice(i,1),e!==a[t]&&(await n.inside.render(),this.isShowWatermak&&this.drawWatermark(n.inside.domElement,a[t].replace(`_element`,``),!0)))}let s=(((i=this.knife)==null||(i=i.layer[e])==null?void 0:i.faces)??[]).find(e=>e.name===t);if(s){let t=[...s.dlist];s.dlist[s.dlist.length-1].mtd.toLowerCase()!==`z`&&t.push({mtd:`Z`});let i=new xs({path:t,color:r,position:new o(0,0),isClose:!0,zIndex:-1,name:`hover`,opacity:.12});return this.canvasMap[`${e}_element`][n].addChild(i),await this.canvasMap[`${e}_element`][n].render(),this.isShowWatermak&&this.drawWatermark(this.canvasMap[`${e}_element`][n].domElement,e,n===`inside`),this.canvasMap[`${e}_element`][n]}}async clearHoverColor(){let e=Object.keys(this.canvasMap);for(let t=0;t<e.length;t++){let n=this.canvasMap[e[t]],r=n.outside.children.findIndex(e=>e.name===`hover`);r>=0&&(n.outside.children.splice(r,1),await n.outside.render(),this.isShowWatermak&&this.drawWatermark(n.outside.domElement,e[t].replace(`_element`,``)));let i=n.inside.children.findIndex(e=>e.name===`hover`);i>=0&&(n.inside.children.splice(i,1),await n.inside.render(),this.isShowWatermak&&this.drawWatermark(n.inside.domElement,e[t].replace(`_element`,``)))}}get hasMainFaceFont(){let e=Object.keys(this.canvasMap);for(let t=0;t<e.length;t++)if(this.canvasMap[e[t]].outside.children.findIndex(e=>e.name===`mainFaceFont`)>-1)return!0;return!1}drawDesigns(e,t,n){for(let r=0;r<t.length;r++){let i=t[r],a=null;switch(i.type){case`shape`:a=new vs({opacity:i.style.opacity/100,position:new o(i.style.left,i.style.top),rotation:i.style.rotate/180*Math.PI,width:i.style.width,height:i.style.height,radius:i.style.radius,type:i.shapeType,stroke:i.style.stroke,strokeWidth:i.style.strokeWidth,strokeDashArray:i.style.strokeDashArray,fill:i.style.color});break;case`img`:a=new v({width:i.style.width,height:i.style.height,rotateX:i.style.rotateX,rotateY:i.style.rotateY,bg:i.bg,position:new o(i.style.left,i.style.top),path:i.src,opacity:i.style.opacity/100,rotation:i.style.rotate/180*Math.PI,can_set_color:i.can_set_color,fills:i.fills,tint:i._texture_tint,fit:i._image_fit});break;case`font`:a=new gs({width:i.style.width,height:i.style.height,position:new o(i.style.left,i.style.top),src:i.src,original_src:i.original_src,opacity:i.style.opacity/100,rotation:i.style.rotate/180*Math.PI,color:i.style.color,value:i.value,fontResultId:i.fontResultId,fontSize:i.style.fontSize,fontResultRatio:i.style.fontResultRatio,fontFamily:i.style.fontFamily,fontShadow:i.style.fontShadow??[],fontStyle:i.style.fontStyle,fontWeight:i.style.fontWeight,lineHeight:i.style.lineHeight,textAlign:i.style.textAlign,vertical:i.style.vertical,fontStroke:i.style.fontStroke??[],fonts:this.fonts,fallbackSrc:this.getFontAssertUrl(),isAutoWidth:i._is_auto_width});break;case`group`:a=new ys({width:i.style.width,height:i.style.height,position:new o(i.style.left,i.style.top),designs:i.designs??[],opacity:i.style.opacity/100,rotation:i.style.rotate/180*Math.PI,fonts:this.fonts});break}a&&(n==null||n(a),e.addChild(a))}}async getAllLayerCanvas(){let{cate:e={}}=this.project,{layerList:t=[]}=e,n=t.filter(e=>!e.isGrey).map(e=>e.name),r={};for(let e=0;e<n.length;e++){let t=n[e];r[t]=await this.getLayerAllCanvas(t)}return r}async getLayerAllCanvas(e){let t={};for(let n of[`element`,`metalness`,`normal`,`clearcoat`])t[n]=await this.getLayerCanvas(e,n);return t}getMainDesignCanvas(){if(this.project){let e=Object.keys(this.project.layer)[0];if(this.canvasMap[`${e}_element`])return this.canvasMap[`${e}_element`].outside}return null}async dealRenderModeCanvas(e,{designList:t,science_image:n,face_background:r}){try{if(this.mode===`render`&&t.length===0&&JSON.stringify(r||{})===`{}`){let t=e.width*e.ratio;n?e.scale=(await Ss(n)).width/t:e.scale=1,e.setCanvasSize(e.width,e.height)}}catch(e){console.error(e)}}generateCanvasScale(e,t,n,r,i,a){let o=this.scale;if(this.mode!==`render`&&this.viewport){let s=null;s=this.mainFace&&this.mainLayer&&t===this.mainLayer?e[this.mainLayer].faces.find(e=>e.name===this.mainFace):Cs(e[t].faces);let c=this.mode===`preview`?1.5:1;if(s){let e=3e3/((a>1?n:r)*i),t=this.viewport.height/s.h;o=Math.min(Math.max(t*c,1),e)}}return o}canShowUploadYourImage(){try{if(!this.project)return!1;let{layer:e}=this.project;for(let t of Object.keys(e)){let{design_list:n=[],inside_design_list:r=[]}=e[t];if(n.length>0||r.length>0)return!1}return!0}catch{return!1}}async getLayerCanvas(e,t,n=`all`){let{layer:r}=this.knife,{layer:i}=this.project,{totalX:s,totalY:c}=r[e],{inside_design_list:l=[],design_list:u=[]}=i[e],d=this.getFontAssertUrl();if(!this.fonts[d])try{let e=await fetch(d).then(e=>e.arrayBuffer());this.fonts[d]={type:`opentype`,data:cs.parse(e)}}catch{let e=await fetch(d).then(e=>e.blob());this.fonts[d]={type:`origin`,data:await Vs(e)}}for(let e=0;e<u.length;e++){let t=u[e];if(t.type===`font`){if(!this.fonts[t.src])if(/\.woff2$/.test(t.src)){let e=await fetch(t.src).then(e=>e.blob());this.fonts[t.src]={type:`origin`,data:await Vs(e)}}else try{let e=await fetch(t.src).then(e=>e.arrayBuffer());this.fonts[t.src]={type:`opentype`,data:cs.parse(e)}}catch{}}else if(t.type===`group`){let e=t.designs??[];for(let t=0;t<e.length;t++){let n=e[t];if(n.type===`font`&&!this.fonts[n.src])if(/\.woff2$/.test(n.src)){let e=await fetch(n.src.substr(0,2)===`//`?`https:${n.src}`:n.src).then(e=>e.blob());this.fonts[n.src]={type:`origin`,data:await Vs(e)}}
4else try{let e=await fetch(n.src).then(e=>e.arrayBuffer());this.fonts[n.src]={type:`opentype`,data:cs.parse(e)}}catch{}}}}let f=s/c,p=128/f,m=s/128,h,g;if(this.canvasMap[`${e}_${t}`])h=this.canvasMap[`${e}_${t}`].outside,h.ratio=m,g=this.canvasMap[`${e}_${t}`].inside,g.ratio=m,h==null||h.setCanvasSize(128,p),g==null||g.setCanvasSize(128,p),h.children.splice(0,h.children.length),g.children.splice(0,g.children.length);else{let n=this.generateCanvasScale(r,e,128,p,m,f);h=new a({width:128,height:p,ratio:m,name:`${t}${e}OutsideLayer`,scale:n}),g=new a({width:128,height:p,ratio:m,name:`${t}${e}InsideLayer`,scale:n})}if(t===`element`)if(this.drawBackground(h,{color:i[e].background,science_image:i[e].science_image,science_image_repeat:i[e].science_image_repeat,totalX:s,totalY:c,faces:r[e].faces,faceColor:i[e].face_background}),this.drawDesigns(h,u,t=>{t.beforeRender=(t,n)=>{this.clipFaces&&this.clipFaces.length>0&&new Es({path:r[e].faces.filter(e=>{var t;return(t=this.clipFaces)==null?void 0:t.includes(e.name)}).map(e=>e.dlist).flat(),width:s,height:c,flipX:!1,isClose:!1}).draw(t,n)}}),await this.dealRenderModeCanvas(h,{designList:u,science_image:i[e].science_image,face_background:i[e].face_background}),this.drawBackground(g,{color:i[e].inside_background,science_image:i[e].science_image,science_image_repeat:i[e].science_image_repeat,totalX:s,totalY:c,faces:r[e].faces,faceColor:i[e].inside_face_background},`inside`),this.drawDesigns(g,l),await this.dealRenderModeCanvas(g,{designList:l,science_image:i[e].science_image,face_background:i[e].inside_face_background}),this.canShowUploadYourImage()&&this.isShowSize){var _;let t=((_=this.project)==null||(_=_.cate)==null?void 0:_.complex_type)===1;if(e===this.mainLayer){let n=r[e].faces.find(e=>e.name===this.mainFace);if(n){let{w:r,h:i,x:a,y:c}=n,l=Math.min(r,i)/160*12*this.uploadTextScale,u=l*.15,d=l*.5,f=t&&!this.onlyShowUploadImage,p=this.showWithAi||f,m=this.showWithAi&&f,_=this.showWithAi?d:u,v=m?l*3+d+u:p?l*2+_:l,y=r*this.uploadTextOffsetX/100,b=i*this.uploadTextOffsetY/100,x=c+i/2+b,S=[],C=p||m?0:v/2-l/2;if(S.push({type:`font`,style:{left:0,top:C,width:r,height:l*1.2,fontSize:l,opacity:100,rotate:0,color:this.languagesColor,fontFamily:`Poppins`,fontStyle:`normal`,fontWeight:``,lineHeight:l,textAlign:`center`,vertical:0},value:this.languages.mainFace,fontResultId:-1,src:this.getFontAssertUrl(),original_src:this.getFontAssertUrl(),fontShadow:[],fontStroke:[],fontResultRatio:1}),this.showWithAi&&S.push({type:`font`,style:{left:0,top:l+d,width:r,height:l*1.2,fontSize:l,opacity:100,rotate:0,color:this.languagesColor,fontFamily:`Poppins`,fontStyle:`normal`,fontWeight:``,lineHeight:l,textAlign:`center`,vertical:0},value:this.languages.orCreateWithAi,fontResultId:-1,src:this.getFontAssertUrl(),original_src:this.getFontAssertUrl(),fontShadow:[],fontStroke:[],fontResultRatio:1}),f){let e=m?l+d+l+u:l+u;S.push({type:`font`,style:{left:0,top:e,width:r,height:l*1.2,fontSize:l,opacity:100,rotate:0,color:this.languagesColor,fontFamily:`Poppins`,fontStyle:`normal`,fontWeight:``,lineHeight:l,textAlign:`center`,vertical:0},value:`${(r*this.DPI).toFixed(0)} × ${(i*this.DPI).toFixed(0)} px`,fontResultId:-1,src:this.getFontAssertUrl(),original_src:this.getFontAssertUrl(),fontShadow:[],fontStroke:[],fontResultRatio:1})}let w=this.createOrUpdateTextGroup(e,{width:r,height:v,position:new o(a+y,x-v/2),designs:S,isCup:t,face:{w:r,h:i,x:a,y:c}},s);w&&(this.mainSide===`outside`?h.addChild(w):g.addChild(w)),this.hasMainFace=!0}}}else this.hasMainFace=!1;else t===`metalness`?(this.drawBackground(h,{color:`#ffff00`,science_image:``,totalX:s,totalY:c,faces:r[e].faces,faceColor:i[e].face_background}),this.drawBackground(g,{color:`#ffff00`,science_image:``,totalX:s,totalY:c,faces:r[e].faces,faceColor:i[e].inside_face_background})):t===`normal`?(this.drawBackground(h,{color:`#808080`,science_image:``,totalX:s,totalY:c,faces:r[e].faces,faceColor:i[e].face_background}),this.drawBackground(g,{color:`#808080`,science_image:``,totalX:s,totalY:c,faces:r[e].faces,faceColor:i[e].inside_face_background}
4)):t===`clearcoat`&&(this.drawBackground(h,{color:`#00ffff`,science_image:``,totalX:s,totalY:c,faces:r[e].faces,faceColor:i[e].face_background}),this.drawBackground(g,{color:`#00ffff`,science_image:``,totalX:s,totalY:c,faces:r[e].faces,faceColor:i[e].inside_face_background}));return this.persist?(h.appendTo(document.body,{display:`none`}),g.appendTo(document.body,{display:`none`})):(h.appendTo(null),g.appendTo(null)),(n===`all`||n===`outside`)&&(await h.render(),this.isShowWatermak&&this.drawWatermark(h.domElement,e,!1)),(n===`all`||n===`inside`)&&(await g.render(),this.isShowWatermak&&this.drawWatermark(g.domElement,e,!0)),this.canvasMap[`${e}_${t}`]={inside:g,outside:h},this.needUpdates[`${e}_${t}`]=!1,this.canvasMap[`${e}_${t}`]}getCanvas(e,t){return this.canvasMap[`${e}_${t}`]}dispose(){let e=Object.keys(this.canvasMap);for(let t=0;t<e.length;t++){let n=this.canvasMap[e[t]],r=Object.keys(n);for(let e in r)n[e]&&n[e].dispose()}this.textGroupCache.clear()}createOrUpdateTextGroup(e,t,n){let r=`${e}_${this.mainSide}`,i=t.position;this.mainSide===`inside`&&(i=new o(n-t.position.x-t.width,t.position.y));let a=new ys({name:`mainFaceFont`,width:t.width,height:t.height,position:i,opacity:1,rotation:this.uploadTextAngle/180*Math.PI,designs:t.designs,fonts:this.fonts});return this.textGroupCache.set(r,a),a}async updateTextGroup(e,t){if(t.angle!==void 0&&(this.uploadTextAngle=t.angle),t.scale!==void 0&&(this.uploadTextScale=t.scale),t.offsetX!==void 0&&(this.uploadTextOffsetX=t.offsetX),t.offsetY!==void 0&&(this.uploadTextOffsetY=t.offsetY),t.color!==void 0&&(this.languagesColor=t.color),!(this.canShowUploadYourImage()&&this.isShowSize))return;let n=this.canvasMap[`${e}_element`];if(!n)return null;let r=this.mainSide===`outside`?n.outside:n.inside;r.children=r.children.filter(e=>e.name!==`mainFaceFont`);let{layer:i}=this.knife,{totalX:a}=i[e],s=i[e].faces.find(e=>e.name===this.mainFace);if(s){var c;let{w:t,h:n,x:i,y:l}=s,u=Math.min(t,n)/160*12*this.uploadTextScale,d=u*.15,f=((c=this.project)==null||(c=c.cate)==null?void 0:c.complex_type)===1,p=f&&!this.onlyShowUploadImage,m=p?u*2+d:u,h=t*this.uploadTextOffsetX/100,g=n*this.uploadTextOffsetY/100,_=l+n/2+g,v=[];v.push({type:`font`,style:{left:0,top:p?0:m/2-u/2,width:t,height:u*1.2,fontSize:u,opacity:100,rotate:0,color:this.languagesColor,fontFamily:`Poppins`,fontStyle:`normal`,fontWeight:``,lineHeight:u,textAlign:`center`,vertical:0},value:this.languages.mainFace,fontResultId:-1,src:this.getFontAssertUrl(),original_src:this.getFontAssertUrl(),fontShadow:[],fontStroke:[],fontResultRatio:1}),p&&v.push({type:`font`,style:{left:0,top:u+d,width:t,height:u*1.2,fontSize:u,opacity:100,rotate:0,color:this.languagesColor,fontFamily:`Poppins`,fontStyle:`normal`,fontWeight:``,lineHeight:u,textAlign:`center`,vertical:0},value:`${(t*this.DPI).toFixed(0)} × ${(n*this.DPI).toFixed(0)} px`,fontResultId:-1,src:this.getFontAssertUrl(),original_src:this.getFontAssertUrl(),fontShadow:[],fontStroke:[],fontResultRatio:1});let y=this.createOrUpdateTextGroup(e,{width:t,height:m,position:new o(i+h,_-m/2),designs:v,isCup:f,face:{w:t,h:n,x:i,y:l}},a);return y&&(r.addChild(y),await r.render(),this.isShowWatermak&&this.drawWatermark(r.domElement,e,this.mainSide===`inside`)),y}return null}};function Us(e){return new Promise(t=>{let n=new FileReader;n.onloadend=()=>t(n.result),n.readAsDataURL(e)})}var Ws=class{constructor(e,n,r=`preview`){t(this,`project`,void 0),t(this,`knife`,void 0),t(this,`canvasMap`,void 0),t(this,`needUpdates`,{}),t(this,`scale`,3),t(this,`mode`,void 0),t(this,`isShowScience`,!0),t(this,`persist`,!1),t(this,`fonts`,{}),t(this,`DPI`,3.7795275591),t(this,`isShowSize`,!1),t(this,`isShowWatermak`,!1),t(this,`watermark`,void 0),t(this,`mainLayer`,``),t(this,`mainFace`,``),t(this,`bleedColor`,`#68b82e`),t(this,`trimColor`,`#2028b0`),t(this,`creaseColor`,`#ff0000`),t(this,`withDieline`,!0),t(this,`languages`,{mainFace:`Upload your images`}),this.project=Rs(e),this.knife=n,this.canvasMap={},this.mode=r,this.calScale()}switchLanguage(e){e&&(this.languages=e)}setWatermark(e,t){this.isShowWatermak=e,this.watermark=t}drawWatermark2(e,t){if(this.watermark){let n=this.watermark.width*4,r=this.watermark.height*4;for(let i=0;i<=e.height;i+=r)for(let a=0;a<=e.width;a+=n)t.drawImage(this.watermark,a,i,n,r)}}async drawWatermark(e){if(this.watermark){let t=this.watermark.width*4,n=this.watermark.height*4,r=e,i=r.getContext(`2d`),{cate:a={}}=this.project,{layerList:s=[]}=a,c=s.filter(e=>!e.isGrey).map(e=>e.name);for(let e=0;e<c.length;e++){let t=this.knife.layer[c[e]];await new Es({path:t.bleeds,color:this.bleedColor,width:t.totalX,height:t.totalY,flipX:!1,position:new o(0,0),isClose:!1}).draw(i,this.scale)}for(let e=0;e<=r.height;e+=n)for(let a=0;a<=r.width;a+=t)r.globalCompositeOperation=`destination-over`,i.drawImage(this.watermark,a,e,t,n)}}setPainterMode(e){this.mode=e||`preview`,this.calScale()}calScale(){if(this.knife){let{totalX:e,totalY:t}=n(this.knife);switch(this.mode){case`preview`:Math.max(e,t)<500?this.scale=9:Math.max(e,t)<800?this.scale=6:Math.max(e,t)<1500?this.scale=3:Math.max(e,t)<3e3?this.scale=1:this.scale=.8;break;case`iosPhone`:Math.max(e,t)<500?this.scale=7:Math.max(e,t)<1200?this.scale=5:Math.max(e,t)<2e3?this.scale=3:Math.max(e,t)<3e3?this.scale=1:this.scale=.7;break;case`performance`:Math.max(e,t)<500?this.scale=3:Math.max(e,t)<1e3||Math.max(e,t)<2e3?this.scale=1:this.scale=.6;break;case`render`:let n=2048/Math.max(e,t)*this.DPI;this.scale=n;break}}}setProject(e){e&&(this.project=Rs(e))}setKnife(e){this.knife=e,this.calScale()}setPersist(e){this.persist=e}
4async drawBackground(e,t,n=`outside`,r=0){let{science_image:i,science_image_repeat:a}=t,s=new _s({path:this.isShowScience?i:``,color:t.color,repeat:a,position:new o(r,r),width:e.width*e.ratio,height:e.height*e.ratio});s.beforeRender=(e,r)=>{new Es({path:t.bleeds,color:this.bleedColor,width:t.totalX,height:t.totalY,flipX:n===`inside`,position:new o(0,0),isClose:!1}).draw(e,r)},e.addChild(s);let c=t.faces,l=t.faceColor,u=Object.keys(l||{});for(let i=0;i<u.length;i++){let a=u[i],s=l[a].rgba,d=c.find(e=>e.name===a);if(d){let i=new xs({path:d.dlist,color:s,width:t.totalX,height:t.totalY,flipX:n===`inside`,position:new o(r,r),isClose:!0});e.addChild(i)}}}async setHoverColor(e,t,n,r){var i;let a=Object.keys(this.canvasMap);for(let t=0;t<a.length;t++){let n=this.canvasMap[a[t]],r=n.outside.children.findIndex(e=>e.name===`hover`);r>=0&&(n.outside.children.splice(r,1),e!==a[t]&&(await n.outside.render(),this.isShowWatermak&&this.drawWatermark(n.outside.domElement)));let i=n.inside.children.findIndex(e=>e.name===`hover`);i>=0&&(n.inside.children.splice(i,1),e!==a[t]&&(await n.inside.render(),this.isShowWatermak&&this.drawWatermark(n.inside.domElement)))}let s=(((i=this.knife)==null||(i=i.layer[e])==null?void 0:i.faces)??[]).find(e=>e.name===t);if(s){let t=[...s.dlist];s.dlist[s.dlist.length-1].mtd.toLowerCase()!==`z`&&t.push({mtd:`Z`});let i=new xs({path:t,color:r,position:new o(0,0),isClose:!0,zIndex:-1,name:`hover`,opacity:.12});return this.canvasMap[`${e}_element`][n].addChild(i),await this.canvasMap[`${e}_element`][n].render(),this.isShowWatermak&&this.drawWatermark(this.canvasMap[`${e}_element`][n].domElement),this.canvasMap[`${e}_element`][n]}}async clearHoverColor(){let e=Object.keys(this.canvasMap);for(let t=0;t<e.length;t++){let n=this.canvasMap[e[t]],r=n.outside.children.findIndex(e=>e.name===`hover`);r>=0&&(n.outside.children.splice(r,1),await n.outside.render(),this.isShowWatermak&&this.drawWatermark(n.outside.domElement));let i=n.inside.children.findIndex(e=>e.name===`hover`);i>=0&&(n.inside.children.splice(i,1),await n.inside.render(),this.isShowWatermak&&this.drawWatermark(n.inside.domElement))}}get hasMainFaceFont(){let e=Object.keys(this.canvasMap);for(let t=0;t<e.length;t++)if(this.canvasMap[e[t]].outside.children.findIndex(e=>e.name===`mainFaceFont`)>-1)return!0;return!1}drawDesigns(e,t,n=0){for(let r=0;r<t.length;r++){let i=t[r],a=null;switch(i.type){case`shape`:a=new vs({opacity:i.style.opacity/100,position:new o(i.style.left+n,i.style.top+n),rotation:i.style.rotate/180*Math.PI,width:i.style.width,height:i.style.height,radius:i.style.radius,type:i.shapeType,stroke:i.style.stroke,strokeWidth:i.style.strokeWidth,strokeDashArray:i.style.strokeDashArray,fill:i.style.color});break;case`img`:a=new v({width:i.style.width,height:i.style.height,rotateX:i.style.rotateX,rotateY:i.style.rotateY,bg:i.bg,position:new o(i.style.left+n,i.style.top+n),path:i.src,opacity:i.style.opacity/100,rotation:i.style.rotate/180*Math.PI,can_set_color:i.can_set_color,fills:i.fills,tint:i._texture_tint,fit:i._image_fit});break;case`font`:a=new gs({width:i.style.width,height:i.style.height,position:new o(i.style.left+n,i.style.top+n),src:i.src,original_src:i.original_src,opacity:i.style.opacity/100,rotation:i.style.rotate/180*Math.PI,color:i.style.color,value:i.value,fontResultId:i.fontResultId,fontSize:i.style.fontSize,fontResultRatio:i.style.fontResultRatio,fontFamily:i.style.fontFamily,fontShadow:i.style.fontShadow??[],fontStyle:i.style.fontStyle,fontWeight:i.style.fontWeight,lineHeight:i.style.lineHeight,textAlign:i.style.textAlign,vertical:i.style.vertical,fontStroke:i.style.fontStroke??[],fonts:this.fonts,isAutoWidth:i._is_auto_width});break;case`group`:a=new ys({width:i.style.width,height:i.style.height,position:new o(i.style.left+n,i.style.top+n),designs:i.designs??[],opacity:i.style.opacity/100,rotation:i.style.rotate/180*Math.PI,fonts:this.fonts});break}a&&e.addChild(a)}}async getAllLayerCanvas(){let{cate:e={}}=this.project,{layerList:t=[]}=e,n=t.filter(e=>!e.isGrey).map(e=>e.name),r={};for(let e=0;e<n.length;e++){let t=n[e];r[t]=await this.getLayerAllCanvas(t)}return r}async getLayerAllCanvas(e){let t={};for(let n of[`element`,`metalness`,`normal`,`clearcoat`])t[n]=await this.getLayerCanvas(e,n);return t}getMainDesignCanvas(){if(this.project){let e=Object.keys(this.project.layer)[0];if(this.canvasMap[`${e}_element`])return this.canvasMap[`${e}_element`].outside}return null}drawDieline(e,t,n,r=0){let{bleeds:i,cuts:a,folds:s,holes:c,totalX:l,totalY:u}=this.knife.layer[n],d=l/400,f=new xs({path:i,color:this.bleedColor,width:l,height:u,lineWidth:d,flipX:t===`inside`,position:new o(0,0),isClose:!1});e.addChild(f);let p=new xs({path:a,color:this.trimColor,width:l,height:u,lineWidth:d,flipX:t===`inside`,position:new o(r,r),isClose:!1});e.addChild(p);for(let n=0;n<s.length;n++){let i=new xs({path:s[n].path?ws(s[n].d):[{mtd:`M`,x:s[n].x1,y:s[n].y1},{mtd:`L`,x:s[n].x2,y:s[n].y2}],color:this.creaseColor,width:l,height:u,lineWidth:d,flipX:t===`inside`,position:new o(r,r),isClose:!1,lineDash:[5,5]});e.addChild(i)}for(let n=0;n<c.length;n++){let i=new xs({path:c[n],color:`#000000`,width:l,height:u,lineWidth:d,flipX:t===`inside`,position:new o(r,r),isClose:!1});e.addChild(i)}}async getDielineScreenShot(e=!0){let{cate:t={}}=this.project,{layerList:n=[]}=t,r=n.filter(e=>!e.isGrey).map(e=>e.name),i=document.createElement(`canvas`),a=i.getContext(`2d`),o={};for(let t=0;t<r.length;t++){let n=r[t],i=(await this.getLayerCanvas(n,`element`,`outside`,e)).outside.domElement;o[n]={width:i.width,height:i.height,canvas:i}}let s=Object.keys(o);i.width=s.reduce((e,t)=>
4e+o[t].width,0),i.height=s.reduce((e,t)=>Math.max(e,o[t].height),0);for(let e=0;e<s.length;e++){let{width:t,height:n,canvas:r}=o[s[e]],c=s.slice(0,e).reduce((e,t)=>e+o[t].width,0),l=(i.height-n)/2;a==null||a.drawImage(r,c,l,t,n)}return i.toDataURL()}async getLayerCanvas(e,t,n=`all`,r=!0){let{layer:i}=this.knife,{layer:o}=this.project,{totalX:s,totalY:c}=i[e],{bleedline:l}=i[e],{bleeds:u}=i[e];l=this.withDieline?l:0,s+=2*l,c+=2*l;let{inside_design_list:d=[],design_list:f=[]}=o[e];for(let e=0;e<f.length;e++){let t=f[e];if(t.type===`font`){if(!this.fonts[t.src])if(/\.woff2$/.test(t.src)){let e=await fetch(t.src).then(e=>e.blob());this.fonts[t.src]={type:`origin`,data:await Us(e)}}else try{let e=await fetch(t.src).then(e=>e.arrayBuffer());this.fonts[t.src]={type:`opentype`,data:cs.parse(e)}}catch{let e=await fetch(`https://cdn.pacdora.com/font_v2/Poppins/Poppins-Medium.woff2`).then(e=>e.arrayBuffer());this.fonts[t.src]={type:`opentype`,data:cs.parse(e)}}}else if(t.type===`group`){let e=t.designs??[];for(let t=0;t<e.length;t++){let n=e[t];if(n.type===`font`&&!this.fonts[n.src])if(/\.woff2$/.test(n.src)){let e=await fetch(n.src.substr(0,2)===`//`?`https:${n.src}`:n.src).then(e=>e.blob());this.fonts[n.src]={type:`origin`,data:await Us(e)}}else try{let e=await fetch(n.src).then(e=>e.arrayBuffer());this.fonts[n.src]={type:`opentype`,data:cs.parse(e)}}catch{let e=await fetch(`https://cdn.pacdora.com/font_v2/Poppins/Poppins-Medium.woff2`).then(e=>e.blob());this.fonts[n.src]={type:`origin`,data:await Us(e)}}}}}let p=s/c,m=Math.round(128/p),h=s/128,g,_;return this.canvasMap[`${e}_${t}`]?(g=this.canvasMap[`${e}_${t}`].outside,g.ratio=h,_=this.canvasMap[`${e}_${t}`].inside,_.ratio=h,g==null||g.setCanvasSize(128,m),_==null||_.setCanvasSize(128,m),g.children.splice(0,g.children.length),_.children.splice(0,_.children.length)):(g=new a({width:128,height:m,ratio:h,name:`${t}${e}OutsideLayer`,scale:this.scale}),_=new a({width:128,height:m,ratio:h,name:`${t}${e}InsideLayer`,scale:this.scale})),t===`element`?(r&&this.drawBackground(g,{color:o[e].background,science_image:o[e].science_image,science_image_repeat:o[e].science_image_repeat,totalX:s,totalY:c,faces:i[e].faces,faceColor:o[e].face_background,bleeds:u},`outside`,0),r&&this.drawDesigns(g,f,l),this.drawBackground(_,{color:o[e].inside_background,science_image:o[e].science_image,science_image_repeat:o[e].science_image_repeat,totalX:s,totalY:c,faces:i[e].faces,faceColor:o[e].inside_face_background,bleeds:u},`inside`,l),this.drawDesigns(_,d,l),this.drawDieline(g,`outside`,e,l),this.drawDieline(_,`inside`,e,l)):t===`metalness`?(this.drawBackground(g,{color:`#ffff00`,science_image:``,totalX:s,totalY:c,faces:i[e].faces,faceColor:o[e].face_background},`outside`,l),this.drawBackground(_,{color:`#ffff00`,science_image:``,totalX:s,totalY:c,faces:i[e].faces,faceColor:o[e].inside_face_background},`inside`,l)):t===`normal`?(this.drawBackground(g,{color:`#808080`,science_image:``,totalX:s,totalY:c,faces:i[e].faces,faceColor:o[e].face_background},`outside`,l),this.drawBackground(_,{color:`#808080`,science_image:``,totalX:s,totalY:c,faces:i[e].faces,faceColor:o[e].inside_face_background},`inside`,l)):t===`clearcoat`&&(this.drawBackground(g,{color:`#00ffff`,science_image:``,totalX:s,totalY:c,faces:i[e].faces,faceColor:o[e].face_background},`outside`,l),this.drawBackground(_,{color:`#00ffff`,science_image:``,totalX:s,totalY:c,faces:i[e].faces,faceColor:o[e].inside_face_background},`inside`,l)),this.persist?(g.appendTo(document.body,{display:`none`}),_.appendTo(document.body,{display:`none`})):(g.appendTo(null),_.appendTo(null)),(n===`all`||n===`outside`)&&(await g.render(),this.isShowWatermak&&this.drawWatermark(g.domElement)),(n===`all`||n===`inside`)&&(await _.render(),this.drawWatermark(_.domElement)),this.canvasMap[`${e}_${t}`]={inside:_,outside:g},this.needUpdates[`${e}_${t}`]=!1,this.canvasMap[`${e}_${t}`]}getCanvas(e,t){return this.canvasMap[`${e}_${t}`]}dispose(){let e=Object.keys(this.canvasMap);for(let t=0;t<e.length;t++){let n=this.canvasMap[e[t]],r=Object.keys(n);for(let e in r)n[e]&&n[e].dispose()}}};export{Bs as i,Hs as n,zs as r,Ws as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.