@mappedin/mappedin-js 6.0.1-beta.30 → 6.0.1-beta.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_LICENSES.txt +59 -2
- package/lib/esm/GLTFExporter-XQMSPUH3.js +1 -0
- package/lib/esm/GLTFLoader-X2MDKJUT.js +1 -0
- package/lib/esm/{browser-64MRL2ZR.js → browser-OJTYUPQX.js} +1 -1
- package/lib/esm/chunk-2W6HOSKW.js +1 -0
- package/lib/esm/chunk-BL4SI3SC.js +1 -0
- package/lib/esm/chunk-D3IQOXID.js +1 -0
- package/lib/esm/{chunk-VD44EZOA.js → chunk-LCL7XTV4.js} +1 -1
- package/lib/esm/{chunk-OSMCRNNF.js → chunk-NP6PYE7C.js} +1 -1
- package/lib/esm/{chunk-OFHRQORP.js → chunk-QN3BHHTQ.js} +1 -1
- package/lib/esm/index.d.ts +347 -129
- package/lib/esm/index.js +1 -1
- package/lib/esm/{inspector-RQUC7XBE.js → inspector-PYUFVJT3.js} +1 -1
- package/lib/esm/{internal-FFMF4P2Y.js → internal-VCLKPDWG.js} +1 -1
- package/lib/esm/{outdoor-context-v4-E3KR4IBA.js → outdoor-context-v4-JBWJ3GVY.js} +1 -1
- package/lib/esm/text3d-EHF4IPDU.js +1 -0
- package/package.json +3 -3
- package/lib/esm/GLTFExporter-2HAV72SJ.js +0 -1
- package/lib/esm/GLTFLoader-IS3L5KUS.js +0 -1
- package/lib/esm/chunk-A3CEQIQD.js +0 -1
- package/lib/esm/chunk-JNSM5T55.js +0 -1
- package/lib/esm/chunk-ODQ3775R.js +0 -1
- package/lib/esm/text3d-7MFD4QFJ.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{V as Sn,ma as Ie}from"./chunk-A3CEQIQD.js";import"./chunk-OFHRQORP.js";import"./chunk-VD44EZOA.js";import{A as at,B as vn,E as pn,F as kr,H as Xe,I as Ur,J as gn,K as wt,N as Ft,P as mn,S as Mt,U as yn,Va as Un,Z as Ht,_ as bn,aa as xn,ba as Tn,d as Tr,k as _r,ka as _n,ma as kn,n as fn,o as un,u as cn,y as hn,z as dn}from"./chunk-JNSM5T55.js";import{a as Pe,b as Ke}from"./chunk-OSMCRNNF.js";import"./chunk-H2E2454S.js";Pe();Pe();Pe();function fa(){var h=Object.create(null);function r(t,e){var a=t.id,o=t.name,n=t.dependencies;n===void 0&&(n=[]);var i=t.init;i===void 0&&(i=function(){});var s=t.getTransferables;if(s===void 0&&(s=null),!h[a])try{n=n.map(function(u){return u&&u.isWorkerModule&&(r(u,function(c){if(c instanceof Error)throw c}),u=h[u.id].value),u}),i=f("<"+o+">.init",i),s&&(s=f("<"+o+">.getTransferables",s));var l=null;typeof i=="function"?l=i.apply(void 0,n):console.error("worker module init function failed to rehydrate"),h[a]={id:a,value:l,getTransferables:s},e(l)}catch(u){u&&u.noLog||console.error(u),e(u)}}function d(t,e){var a,o=t.id,n=t.args;(!h[o]||typeof h[o].value!="function")&&e(new Error("Worker module "+o+": not found or its 'init' did not return a function"));try{var i=(a=h[o]).value.apply(a,n);i&&typeof i.then=="function"?i.then(s,function(l){return e(l instanceof Error?l:new Error(""+l))}):s(i)}catch(l){e(l)}function s(l){try{var u=h[o].getTransferables&&h[o].getTransferables(l);(!u||!Array.isArray(u)||!u.length)&&(u=void 0),e(l,u)}catch(c){console.error(c),e(c)}}}function f(t,e){var a=void 0;self.troikaDefine=function(n){return a=n};var o=URL.createObjectURL(new Blob(["/** "+t.replace(/\*/g,"")+" **/\n\ntroikaDefine(\n"+e+"\n)"],{type:"application/javascript"}));try{importScripts(o)}catch(n){console.error(n)}return URL.revokeObjectURL(o),delete self.troikaDefine,a}self.addEventListener("message",function(t){var e=t.data,a=e.messageId,o=e.action,n=e.data;try{o==="registerModule"&&r(n,function(i){i instanceof Error?postMessage({messageId:a,success:!1,error:i.message}):postMessage({messageId:a,success:!0,result:{isCallable:typeof i=="function"}})}),o==="callModule"&&d(n,function(i,s){i instanceof Error?postMessage({messageId:a,success:!1,error:i.message}):postMessage({messageId:a,success:!0,result:i},s||void 0)})}catch(i){postMessage({messageId:a,success:!1,error:i.stack})}})}function ua(h){var r=function(){for(var d=[],f=arguments.length;f--;)d[f]=arguments[f];return r._getInitResult().then(function(t){if(typeof t=="function")return t.apply(void 0,d);throw new Error("Worker module function was called but `init` did not return a callable function")})};return r._getInitResult=function(){var d=h.dependencies,f=h.init;d=Array.isArray(d)?d.map(function(e){return e&&(e=e.onMainThread||e,e._getInitResult&&(e=e._getInitResult())),e}):[];var t=Promise.all(d).then(function(e){return f.apply(null,e)});return r._getInitResult=function(){return t},t},r}var Fn=function(){var h=!1;if(typeof window<"u"&&typeof window.document<"u")try{var r=new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"})));r.terminate(),h=!0}catch(d){typeof Ke<"u"&&Ke.env.NODE_ENV==="test"||console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+d.message+"]")}return Fn=function(){return h},h},ca=0,ha=0,Sr=!1,At=Object.create(null),Dt=Object.create(null),wr=Object.create(null);function ot(h){if((!h||typeof h.init!="function")&&!Sr)throw new Error("requires `options.init` function");var r=h.dependencies,d=h.init,f=h.getTransferables,t=h.workerId,e=ua(h);t==null&&(t="#default");var a="workerModule"+ ++ca,o=h.name||a,n=null;r=r&&r.map(function(s){return typeof s=="function"&&!s.workerModuleData&&(Sr=!0,s=ot({workerId:t,name:"<"+o+"> function dependency: "+s.name,init:"function(){return (\n"+Yt(s)+"\n)}"}),Sr=!1),s&&s.workerModuleData&&(s=s.workerModuleData),s});function i(){for(var s=[],l=arguments.length;l--;)s[l]=arguments[l];if(!Fn())return e.apply(void 0,s);if(!n){n=wn(t,"registerModule",i.workerModuleData);var u=function(){n=null,Dt[t].delete(u)};(Dt[t]||(Dt[t]=new Set)).add(u)}return n.then(function(c){var p=c.isCallable;if(p)return wn(t,"callModule",{id:a,args:s});throw new Error("Worker module function was called but `init` did not return a callable function")})}return i.workerModuleData={isWorkerModule:!0,id:a,name:o,dependencies:r,init:Yt(d),getTransferables:f&&Yt(f)},i.onMainThread=e,i}function Mn(h){Dt[h]&&Dt[h].forEach(function(r){r()}),At[h]&&(At[h].terminate(),delete At[h])}function Yt(h){var r=h.toString();return!/^function/.test(r)&&/^\w+\s*\(/.test(r)&&(r="function "+r),r}function da(h){var r=At[h];if(!r){var d=Yt(fa);r=At[h]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+h.replace(/\*/g,"")+" **/\n\n;("+d+")()"],{type:"application/javascript"}))),r.onmessage=function(f){var t=f.data,e=t.messageId,a=wr[e];if(!a)throw new Error("WorkerModule response with empty or unknown messageId");delete wr[e],a(t)}}return r}function wn(h,r,d){return new Promise(function(f,t){var e=++ha;wr[e]=function(a){a.success?f(a.result):t(new Error("Error in worker "+r+" call: "+a.error))},da(h).postMessage({messageId:e,action:r,data:d})})}Pe();function Fr(){var h=function(r){function d(P,O,v,x,F,D,_,W){var C=1-_;W.x=C*C*P+2*C*_*v+_*_*F,W.y=C*C*O+2*C*_*x+_*_*D}function f(P,O,v,x,F,D,_,W,C,I){var Y=1-C;I.x=Y*Y*Y*P+3*Y*Y*C*v+3*Y*C*C*F+C*C*C*_,I.y=Y*Y*Y*O+3*Y*Y*C*x+3*Y*C*C*D+C*C*C*W}function t(P,O){for(var v=/([MLQCZ])([^MLQCZ]*)/g,x,F,D,_,W;x=v.exec(P);){var C=x[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(I){return parseFloat(I)});switch(x[1]){case"M":_=F=C[0],W=D=C[1];break;case"L":(C[0]!==_||C[1]!==W)&&O("L",_,W,_=C[0],W=C[1]);break;case"Q":{O("Q",_,W,_=C[2],W=C[3],C[0],C[1]);break}case"C":{O("C",_,W,_=C[4],W=C[5],C[0],C[1],C[2],C[3]);break}case"Z":(_!==F||W!==D)&&O("L",_,W,F,D);break}}}function e(P,O,v){v===void 0&&(v=16);var x={x:0,y:0};t(P,function(F,D,_,W,C,I,Y,$,X){switch(F){case"L":O(D,_,W,C);break;case"Q":{for(var N=D,pe=_,ue=1;ue<v;ue++)d(D,_,I,Y,W,C,ue/(v-1),x),O(N,pe,x.x,x.y),N=x.x,pe=x.y;break}case"C":{for(var Z=D,ee=_,se=1;se<v;se++)f(D,_,I,Y,$,X,W,C,se/(v-1),x),O(Z,ee,x.x,x.y),Z=x.x,ee=x.y;break}}})}var a="precision highp float;attribute vec2 aUV;varying vec2 vUV;void main(){vUV=aUV;gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",o="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){gl_FragColor=texture2D(tex,vUV);}",n=new WeakMap,i={premultipliedAlpha:!1,preserveDrawingBuffer:!0,antialias:!1,depth:!1};function s(P,O){var v=P.getContext?P.getContext("webgl",i):P,x=n.get(v);if(!x){let Y=function(Z){var ee=D[Z];if(!ee&&(ee=D[Z]=v.getExtension(Z),!ee))throw new Error(Z+" not supported");return ee},$=function(Z,ee){var se=v.createShader(ee);return v.shaderSource(se,Z),v.compileShader(se),se},X=function(Z,ee,se,j){if(!_[Z]){var te={},q={},L=v.createProgram();v.attachShader(L,$(ee,v.VERTEX_SHADER)),v.attachShader(L,$(se,v.FRAGMENT_SHADER)),v.linkProgram(L),_[Z]={program:L,transaction:function(K){v.useProgram(L),K({setUniform:function(J,be){for(var re=[],ae=arguments.length-2;ae-- >0;)re[ae]=arguments[ae+2];var fe=q[be]||(q[be]=v.getUniformLocation(L,be));v["uniform"+J].apply(v,[fe].concat(re))},setAttribute:function(J,be,re,ae,fe){var de=te[J];de||(de=te[J]={buf:v.createBuffer(),loc:v.getAttribLocation(L,J),data:null}),v.bindBuffer(v.ARRAY_BUFFER,de.buf),v.vertexAttribPointer(de.loc,be,v.FLOAT,!1,0,0),v.enableVertexAttribArray(de.loc),F?v.vertexAttribDivisor(de.loc,ae):Y("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(de.loc,ae),fe!==de.data&&(v.bufferData(v.ARRAY_BUFFER,fe,re),de.data=fe)}})}}}_[Z].transaction(j)},N=function(Z,ee){C++;try{v.activeTexture(v.TEXTURE0+C);var se=W[Z];se||(se=W[Z]=v.createTexture(),v.bindTexture(v.TEXTURE_2D,se),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MIN_FILTER,v.NEAREST),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MAG_FILTER,v.NEAREST)),v.bindTexture(v.TEXTURE_2D,se),ee(se,C)}finally{C--}},pe=function(Z,ee,se){var j=v.createFramebuffer();I.push(j),v.bindFramebuffer(v.FRAMEBUFFER,j),v.activeTexture(v.TEXTURE0+ee),v.bindTexture(v.TEXTURE_2D,Z),v.framebufferTexture2D(v.FRAMEBUFFER,v.COLOR_ATTACHMENT0,v.TEXTURE_2D,Z,0);try{se(j)}finally{v.deleteFramebuffer(j),v.bindFramebuffer(v.FRAMEBUFFER,I[--I.length-1]||null)}},ue=function(){D={},_={},W={},C=-1,I.length=0};var F=typeof WebGL2RenderingContext<"u"&&v instanceof WebGL2RenderingContext,D={},_={},W={},C=-1,I=[];v.canvas.addEventListener("webglcontextlost",function(Z){ue(),Z.preventDefault()},!1),n.set(v,x={gl:v,isWebGL2:F,getExtension:Y,withProgram:X,withTexture:N,withTextureFramebuffer:pe,handleContextLoss:ue})}O(x)}function l(P,O,v,x,F,D,_,W){_===void 0&&(_=15),W===void 0&&(W=null),s(P,function(C){var I=C.gl,Y=C.withProgram,$=C.withTexture;$("copy",function(X,N){I.texImage2D(I.TEXTURE_2D,0,I.RGBA,F,D,0,I.RGBA,I.UNSIGNED_BYTE,O),Y("copy",a,o,function(pe){var ue=pe.setUniform,Z=pe.setAttribute;Z("aUV",2,I.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),ue("1i","image",N),I.bindFramebuffer(I.FRAMEBUFFER,W||null),I.disable(I.BLEND),I.colorMask(_&8,_&4,_&2,_&1),I.viewport(v,x,F,D),I.scissor(v,x,F,D),I.drawArrays(I.TRIANGLES,0,3)})})})}function u(P,O,v){var x=P.width,F=P.height;s(P,function(D){var _=D.gl,W=new Uint8Array(x*F*4);_.readPixels(0,0,x,F,_.RGBA,_.UNSIGNED_BYTE,W),P.width=O,P.height=v,l(_,W,0,0,x,F)})}var c=Object.freeze({__proto__:null,withWebGLContext:s,renderImageData:l,resizeWebGLCanvasWithoutClearing:u});function p(P,O,v,x,F,D){D===void 0&&(D=1);var _=new Uint8Array(P*O),W=x[2]-x[0],C=x[3]-x[1],I=[];e(v,function(Z,ee,se,j){I.push({x1:Z,y1:ee,x2:se,y2:j,minX:Math.min(Z,se),minY:Math.min(ee,j),maxX:Math.max(Z,se),maxY:Math.max(ee,j)})}),I.sort(function(Z,ee){return Z.maxX-ee.maxX});for(var Y=0;Y<P;Y++)for(var $=0;$<O;$++){var X=pe(x[0]+W*(Y+.5)/P,x[1]+C*($+.5)/O),N=Math.pow(1-Math.abs(X)/F,D)/2;X<0&&(N=1-N),N=Math.max(0,Math.min(255,Math.round(N*255))),_[$*P+Y]=N}return _;function pe(Z,ee){for(var se=1/0,j=1/0,te=I.length;te--;){var q=I[te];if(q.maxX+j<=Z)break;if(Z+j>q.minX&&ee-j<q.maxY&&ee+j>q.minY){var L=R(Z,ee,q.x1,q.y1,q.x2,q.y2);L<se&&(se=L,j=Math.sqrt(se))}}return ue(Z,ee)&&(j=-j),j}function ue(Z,ee){for(var se=0,j=I.length;j--;){var te=I[j];if(te.maxX<=Z)break;var q=te.y1>ee!=te.y2>ee&&Z<(te.x2-te.x1)*(ee-te.y1)/(te.y2-te.y1)+te.x1;q&&(se+=te.y1<te.y2?1:-1)}return se!==0}}function g(P,O,v,x,F,D,_,W,C,I){D===void 0&&(D=1),W===void 0&&(W=0),C===void 0&&(C=0),I===void 0&&(I=0),y(P,O,v,x,F,D,_,null,W,C,I)}function y(P,O,v,x,F,D,_,W,C,I,Y){D===void 0&&(D=1),C===void 0&&(C=0),I===void 0&&(I=0),Y===void 0&&(Y=0);for(var $=p(P,O,v,x,F,D),X=new Uint8Array($.length*4),N=0;N<$.length;N++)X[N*4+Y]=$[N];l(_,X,C,I,P,O,1<<3-Y,W)}function R(P,O,v,x,F,D){var _=F-v,W=D-x,C=_*_+W*W,I=C?Math.max(0,Math.min(1,((P-v)*_+(O-x)*W)/C)):0,Y=P-(v+I*_),$=O-(x+I*W);return Y*Y+$*$}var w=Object.freeze({__proto__:null,generate:p,generateIntoCanvas:g,generateIntoFramebuffer:y}),k="precision highp float;uniform vec4 uGlyphBounds;attribute vec2 aUV;attribute vec4 aLineSegment;varying vec4 vLineSegment;varying vec2 vGlyphXY;void main(){vLineSegment=aLineSegment;vGlyphXY=mix(uGlyphBounds.xy,uGlyphBounds.zw,aUV);gl_Position=vec4(mix(vec2(-1.0),vec2(1.0),aUV),0.0,1.0);}",T="precision highp float;uniform vec4 uGlyphBounds;uniform float uMaxDistance;uniform float uExponent;varying vec4 vLineSegment;varying vec2 vGlyphXY;float absDistToSegment(vec2 point,vec2 lineA,vec2 lineB){vec2 lineDir=lineB-lineA;float lenSq=dot(lineDir,lineDir);float t=lenSq==0.0 ? 0.0 : clamp(dot(point-lineA,lineDir)/lenSq,0.0,1.0);vec2 linePt=lineA+t*lineDir;return distance(point,linePt);}void main(){vec4 seg=vLineSegment;vec2 p=vGlyphXY;float dist=absDistToSegment(p,seg.xy,seg.zw);float val=pow(1.0-clamp(dist/uMaxDistance,0.0,1.0),uExponent)*0.5;bool crossing=(seg.y>p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y<vLineSegment.w;gl_FragColor=vec4(crossingUp ? 1.0/255.0 : 0.0,crossing&&!crossingUp ? 1.0/255.0 : 0.0,0.0,val);}",U="precision highp float;uniform sampler2D tex;varying vec2 vUV;void main(){vec4 color=texture2D(tex,vUV);bool inside=color.r!=color.g;float val=inside ? 1.0-color.a : color.a;gl_FragColor=vec4(val);}",A=new Float32Array([0,0,2,0,0,2]),b=null,M=!1,z={},E=new WeakMap;function H(P){if(!M&&!V(P))throw new Error("WebGL generation not supported")}function m(P,O,v,x,F,D,_){if(D===void 0&&(D=1),_===void 0&&(_=null),!_&&(_=b,!_)){var W=typeof OffscreenCanvas=="function"?new OffscreenCanvas(1,1):typeof document<"u"?document.createElement("canvas"):null;if(!W)throw new Error("OffscreenCanvas or DOM canvas not supported");_=b=W.getContext("webgl",{depth:!1})}H(_);var C=new Uint8Array(P*O*4);s(_,function(X){var N=X.gl,pe=X.withTexture,ue=X.withTextureFramebuffer;pe("readable",function(Z,ee){N.texImage2D(N.TEXTURE_2D,0,N.RGBA,P,O,0,N.RGBA,N.UNSIGNED_BYTE,null),ue(Z,ee,function(se){S(P,O,v,x,F,D,N,se,0,0,0),N.readPixels(0,0,P,O,N.RGBA,N.UNSIGNED_BYTE,C)})})});for(var I=new Uint8Array(P*O),Y=0,$=0;Y<C.length;Y+=4)I[$++]=C[Y];return I}function B(P,O,v,x,F,D,_,W,C,I){D===void 0&&(D=1),W===void 0&&(W=0),C===void 0&&(C=0),I===void 0&&(I=0),S(P,O,v,x,F,D,_,null,W,C,I)}function S(P,O,v,x,F,D,_,W,C,I,Y){D===void 0&&(D=1),C===void 0&&(C=0),I===void 0&&(I=0),Y===void 0&&(Y=0),H(_);var $=[];e(v,function(X,N,pe,ue){$.push(X,N,pe,ue)}),$=new Float32Array($),s(_,function(X){var N=X.gl,pe=X.isWebGL2,ue=X.getExtension,Z=X.withProgram,ee=X.withTexture,se=X.withTextureFramebuffer,j=X.handleContextLoss;if(ee("rawDistances",function(te,q){(P!==te._lastWidth||O!==te._lastHeight)&&N.texImage2D(N.TEXTURE_2D,0,N.RGBA,te._lastWidth=P,te._lastHeight=O,0,N.RGBA,N.UNSIGNED_BYTE,null),Z("main",k,T,function(L){var he=L.setAttribute,K=L.setUniform,ne=!pe&&ue("ANGLE_instanced_arrays"),J=!pe&&ue("EXT_blend_minmax");he("aUV",2,N.STATIC_DRAW,0,A),he("aLineSegment",4,N.DYNAMIC_DRAW,1,$),K.apply(void 0,["4f","uGlyphBounds"].concat(x)),K("1f","uMaxDistance",F),K("1f","uExponent",D),se(te,q,function(be){N.enable(N.BLEND),N.colorMask(!0,!0,!0,!0),N.viewport(0,0,P,O),N.scissor(0,0,P,O),N.blendFunc(N.ONE,N.ONE),N.blendEquationSeparate(N.FUNC_ADD,pe?N.MAX:J.MAX_EXT),N.clear(N.COLOR_BUFFER_BIT),pe?N.drawArraysInstanced(N.TRIANGLES,0,3,$.length/4):ne.drawArraysInstancedANGLE(N.TRIANGLES,0,3,$.length/4)})}),Z("post",a,U,function(L){L.setAttribute("aUV",2,N.STATIC_DRAW,0,A),L.setUniform("1i","tex",q),N.bindFramebuffer(N.FRAMEBUFFER,W),N.disable(N.BLEND),N.colorMask(Y===0,Y===1,Y===2,Y===3),N.viewport(C,I,P,O),N.scissor(C,I,P,O),N.drawArrays(N.TRIANGLES,0,3)})}),N.isContextLost())throw j(),new Error("webgl context lost")})}function V(P){var O=!P||P===b?z:P.canvas||P,v=E.get(O);if(v===void 0){M=!0;var x=null;try{var F=[97,106,97,61,99,137,118,80,80,118,137,99,61,97,106,97],D=m(4,4,"M8,8L16,8L24,24L16,24Z",[0,0,32,32],24,1,P);v=D&&F.length===D.length&&D.every(function(_,W){return _===F[W]}),v||(x="bad trial run results",console.info(F,D))}catch(_){v=!1,x=_.message}x&&console.warn("WebGL SDF generation not supported:",x),M=!1,E.set(O,v)}return v}var G=Object.freeze({__proto__:null,generate:m,generateIntoCanvas:B,generateIntoFramebuffer:S,isSupported:V});function Q(P,O,v,x,F,D){F===void 0&&(F=Math.max(x[2]-x[0],x[3]-x[1])/2),D===void 0&&(D=1);try{return m.apply(G,arguments)}catch(_){return console.info("WebGL SDF generation failed, falling back to JS",_),p.apply(w,arguments)}}function ie(P,O,v,x,F,D,_,W,C,I){F===void 0&&(F=Math.max(x[2]-x[0],x[3]-x[1])/2),D===void 0&&(D=1),W===void 0&&(W=0),C===void 0&&(C=0),I===void 0&&(I=0);try{return B.apply(G,arguments)}catch(Y){return console.info("WebGL SDF generation failed, falling back to JS",Y),g.apply(w,arguments)}}return r.forEachPathCommand=t,r.generate=Q,r.generateIntoCanvas=ie,r.javascript=w,r.pathToLineSegments=e,r.webgl=G,r.webglUtils=c,Object.defineProperty(r,"__esModule",{value:!0}),r}({});return h}Pe();function va(){var h=function(r){var d={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},f={},t={};f.L=1,t[1]="L",Object.keys(d).forEach(function(j,te){f[j]=1<<te+1,t[f[j]]=j}),Object.freeze(f);var e=f.LRI|f.RLI|f.FSI,a=f.L|f.R|f.AL,o=f.B|f.S|f.WS|f.ON|f.FSI|f.LRI|f.RLI|f.PDI,n=f.BN|f.RLE|f.LRE|f.RLO|f.LRO|f.PDF,i=f.S|f.WS|f.B|e|f.PDI|n,s=null;function l(){if(!s){s=new Map;var j=function(q){if(d.hasOwnProperty(q)){var L=0;d[q].split(",").forEach(function(he){var K=he.split("+"),ne=K[0],J=K[1];ne=parseInt(ne,36),J=J?parseInt(J,36):0,s.set(L+=ne,f[q]);for(var be=0;be<J;be++)s.set(++L,f[q])})}};for(var te in d)j(te)}}function u(j){return l(),s.get(j.codePointAt(0))||f.L}function c(j){return t[u(j)]}var p={pairs:"14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function g(j,te){var q=36,L=0,he=new Map,K=te&&new Map,ne;return j.split(",").forEach(function J(be){if(be.indexOf("+")!==-1)for(var re=+be;re--;)J(ne);else{ne=be;var ae=be.split(">"),fe=ae[0],de=ae[1];fe=String.fromCodePoint(L+=parseInt(fe,q)),de=String.fromCodePoint(L+=parseInt(de,q)),he.set(fe,de),te&&K.set(de,fe)}}),{map:he,reverseMap:K}}var y,R,w;function k(){if(!y){var j=g(p.pairs,!0),te=j.map,q=j.reverseMap;y=te,R=q,w=g(p.canonical,!1).map}}function T(j){return k(),y.get(j)||null}function U(j){return k(),R.get(j)||null}function A(j){return k(),w.get(j)||null}var b=f.L,M=f.R,z=f.EN,E=f.ES,H=f.ET,m=f.AN,B=f.CS,S=f.B,V=f.S,G=f.ON,Q=f.BN,ie=f.NSM,P=f.AL,O=f.LRO,v=f.RLO,x=f.LRE,F=f.RLE,D=f.PDF,_=f.LRI,W=f.RLI,C=f.FSI,I=f.PDI;function Y(j,te){for(var q=125,L=new Uint32Array(j.length),he=0;he<j.length;he++)L[he]=u(j[he]);var K=new Map;function ne(Le,Ve){var Ge=L[Le];L[Le]=Ve,K.set(Ge,K.get(Ge)-1),Ge&o&&K.set(o,K.get(o)-1),K.set(Ve,(K.get(Ve)||0)+1),Ve&o&&K.set(o,(K.get(o)||0)+1)}for(var J=new Uint8Array(j.length),be=new Map,re=[],ae=null,fe=0;fe<j.length;fe++)ae||re.push(ae={start:fe,end:j.length-1,level:te==="rtl"?1:te==="ltr"?0:sn(fe,!1)}),L[fe]&S&&(ae.end=fe,ae=null);for(var de=F|x|v|O|e|I|D|S,_e=function(Le){return Le+(Le&1?1:2)},Me=function(Le){return Le+(Le&1?2:1)},ge=0;ge<re.length;ge++){ae=re[ge];var me=[{_level:ae.level,_override:0,_isolate:0}],le=void 0,Ue=0,Se=0,Re=0;K.clear();for(var ke=ae.start;ke<=ae.end;ke++){var ce=L[ke];if(le=me[me.length-1],K.set(ce,(K.get(ce)||0)+1),ce&o&&K.set(o,(K.get(o)||0)+1),ce&de)if(ce&(F|x)){J[ke]=le._level;var xe=(ce===F?Me:_e)(le._level);xe<=q&&!Ue&&!Se?me.push({_level:xe,_override:0,_isolate:0}):Ue||Se++}else if(ce&(v|O)){J[ke]=le._level;var Qe=(ce===v?Me:_e)(le._level);Qe<=q&&!Ue&&!Se?me.push({_level:Qe,_override:ce&v?M:b,_isolate:0}):Ue||Se++}else if(ce&e){ce&C&&(ce=sn(ke+1,!0)===1?W:_),J[ke]=le._level,le._override&&ne(ke,le._override);var Te=(ce===W?Me:_e)(le._level);Te<=q&&Ue===0&&Se===0?(Re++,me.push({_level:Te,_override:0,_isolate:1,_isolInitIndex:ke})):Ue++}else if(ce&I){if(Ue>0)Ue--;else if(Re>0){for(Se=0;!me[me.length-1]._isolate;)me.pop();var ye=me[me.length-1]._isolInitIndex;ye!=null&&(be.set(ye,ke),be.set(ke,ye)),me.pop(),Re--}le=me[me.length-1],J[ke]=le._level,le._override&&ne(ke,le._override)}else ce&D?(Ue===0&&(Se>0?Se--:!le._isolate&&me.length>1&&(me.pop(),le=me[me.length-1])),J[ke]=le._level):ce&S&&(J[ke]=ae.level);else J[ke]=le._level,le._override&&ce!==Q&&ne(ke,le._override)}for(var Ae=[],we=null,ve=ae.start;ve<=ae.end;ve++){var Fe=L[ve];if(!(Fe&n)){var Be=J[ve],Ee=Fe&e,De=Fe===I;we&&Be===we._level?(we._end=ve,we._endsWithIsolInit=Ee):Ae.push(we={_start:ve,_end:ve,_level:Be,_startsWithPDI:De,_endsWithIsolInit:Ee})}}for(var We=[],Ze=0;Ze<Ae.length;Ze++){var Ye=Ae[Ze];if(!Ye._startsWithPDI||Ye._startsWithPDI&&!be.has(Ye._start)){for(var qe=[we=Ye],rt=void 0;we&&we._endsWithIsolInit&&(rt=be.get(we._end))!=null;)for(var Je=Ze+1;Je<Ae.length;Je++)if(Ae[Je]._start===rt){qe.push(we=Ae[Je]);break}for(var Oe=[],nt=0;nt<qe.length;nt++)for(var zr=qe[nt],tr=zr._start;tr<=zr._end;tr++)Oe.push(tr);for(var na=J[Oe[0]],Wr=ae.level,Bt=Oe[0]-1;Bt>=0;Bt--)if(!(L[Bt]&n)){Wr=J[Bt];break}var rr=Oe[Oe.length-1],aa=J[rr],Nr=ae.level;if(!(L[rr]&e)){for(var Ot=rr+1;Ot<=ae.end;Ot++)if(!(L[Ot]&n)){Nr=J[Ot];break}}We.push({_seqIndices:Oe,_sosType:Math.max(Wr,na)%2?M:b,_eosType:Math.max(Nr,aa)%2?M:b})}}for(var nr=0;nr<We.length;nr++){var ar=We[nr],oe=ar._seqIndices,gt=ar._sosType,oa=ar._eosType,ft=J[oe[0]]&1?M:b;if(K.get(ie))for(var Rt=0;Rt<oe.length;Rt++){var Vr=oe[Rt];if(L[Vr]&ie){for(var or=gt,Lt=Rt-1;Lt>=0;Lt--)if(!(L[oe[Lt]]&n)){or=L[oe[Lt]];break}ne(Vr,or&(e|I)?G:or)}}if(K.get(z))for(var Gt=0;Gt<oe.length;Gt++){var jr=oe[Gt];if(L[jr]&z)for(var Pt=Gt-1;Pt>=-1;Pt--){var Xr=Pt===-1?gt:L[oe[Pt]];if(Xr&a){Xr===P&&ne(jr,m);break}}}if(K.get(P))for(var ir=0;ir<oe.length;ir++){var Hr=oe[ir];L[Hr]&P&&ne(Hr,M)}if(K.get(E)||K.get(B))for(var mt=1;mt<oe.length-1;mt++){var sr=oe[mt];if(L[sr]&(E|B)){for(var ut=0,lr=0,fr=mt-1;fr>=0&&(ut=L[oe[fr]],!!(ut&n));fr--);for(var ur=mt+1;ur<oe.length&&(lr=L[oe[ur]],!!(lr&n));ur++);ut===lr&&(L[sr]===E?ut===z:ut&(z|m))&&ne(sr,ut)}}if(K.get(z))for(var je=0;je<oe.length;je++){var ia=oe[je];if(L[ia]&z){for(var It=je-1;It>=0&&L[oe[It]]&(H|n);It--)ne(oe[It],z);for(je++;je<oe.length&&L[oe[je]]&(H|n|z);je++)L[oe[je]]!==z&&ne(oe[je],z)}}if(K.get(H)||K.get(E)||K.get(B))for(var yt=0;yt<oe.length;yt++){var Yr=oe[yt];if(L[Yr]&(H|E|B)){ne(Yr,G);for(var zt=yt-1;zt>=0&&L[oe[zt]]&n;zt--)ne(oe[zt],G);for(var Wt=yt+1;Wt<oe.length&&L[oe[Wt]]&n;Wt++)ne(oe[Wt],G)}}if(K.get(z))for(var cr=0,Jr=gt;cr<oe.length;cr++){var Kr=oe[cr],hr=L[Kr];hr&z?Jr===b&&ne(Kr,b):hr&a&&(Jr=hr)}if(K.get(o)){var bt=M|z|m,Qr=bt|b,Nt=[];{for(var ct=[],ht=0;ht<oe.length;ht++)if(L[oe[ht]]&o){var xt=j[oe[ht]],Zr=void 0;if(T(xt)!==null)if(ct.length<63)ct.push({char:xt,seqIndex:ht});else break;else if((Zr=U(xt))!==null)for(var Tt=ct.length-1;Tt>=0;Tt--){var dr=ct[Tt].char;if(dr===Zr||dr===U(A(xt))||T(A(dr))===xt){Nt.push([ct[Tt].seqIndex,ht]),ct.length=Tt;break}}}Nt.sort(function(Le,Ve){return Le[0]-Ve[0]})}for(var vr=0;vr<Nt.length;vr++){for(var qr=Nt[vr],Vt=qr[0],pr=qr[1],$r=!1,Ne=0,gr=Vt+1;gr<pr;gr++){var en=oe[gr];if(L[en]&Qr){$r=!0;var tn=L[en]&bt?M:b;if(tn===ft){Ne=tn;break}}}if($r&&!Ne){Ne=gt;for(var mr=Vt-1;mr>=0;mr--){var rn=oe[mr];if(L[rn]&Qr){var nn=L[rn]&bt?M:b;nn!==ft?Ne=nn:Ne=ft;break}}}if(Ne){if(L[oe[Vt]]=L[oe[pr]]=Ne,Ne!==ft){for(var _t=Vt+1;_t<oe.length;_t++)if(!(L[oe[_t]]&n)){u(j[oe[_t]])&ie&&(L[oe[_t]]=Ne);break}}if(Ne!==ft){for(var kt=pr+1;kt<oe.length;kt++)if(!(L[oe[kt]]&n)){u(j[oe[kt]])&ie&&(L[oe[kt]]=Ne);break}}}}for(var $e=0;$e<oe.length;$e++)if(L[oe[$e]]&o){for(var an=$e,yr=$e,br=gt,Ut=$e-1;Ut>=0;Ut--)if(L[oe[Ut]]&n)an=Ut;else{br=L[oe[Ut]]&bt?M:b;break}for(var on=oa,St=$e+1;St<oe.length;St++)if(L[oe[St]]&(o|n))yr=St;else{on=L[oe[St]]&bt?M:b;break}for(var xr=an;xr<=yr;xr++)L[oe[xr]]=br===on?br:ft;$e=yr}}}for(var ze=ae.start;ze<=ae.end;ze++){var sa=J[ze],jt=L[ze];if(sa&1?jt&(b|z|m)&&J[ze]++:jt&M?J[ze]++:jt&(m|z)&&(J[ze]+=2),jt&n&&(J[ze]=ze===0?ae.level:J[ze-1]),ze===ae.end||u(j[ze])&(V|S))for(var Xt=ze;Xt>=0&&u(j[Xt])&i;Xt--)J[Xt]=ae.level}}return{levels:J,paragraphs:re};function sn(Le,Ve){for(var Ge=Le;Ge<j.length;Ge++){var et=L[Ge];if(et&(M|P))return 1;if(et&(S|b)||Ve&&et===I)return 0;if(et&e){var ln=la(Ge);Ge=ln===-1?j.length:ln}}return 0}function la(Le){for(var Ve=1,Ge=Le+1;Ge<j.length;Ge++){var et=L[Ge];if(et&S)break;if(et&I){if(--Ve===0)return Ge}else et&e&&Ve++}return-1}}var $="14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",X;function N(){if(!X){var j=g($,!0),te=j.map,q=j.reverseMap;q.forEach(function(L,he){te.set(he,L)}),X=te}}function pe(j){return N(),X.get(j)||null}function ue(j,te,q,L){var he=j.length;q=Math.max(0,q==null?0:+q),L=Math.min(he-1,L==null?he-1:+L);for(var K=new Map,ne=q;ne<=L;ne++)if(te[ne]&1){var J=pe(j[ne]);J!==null&&K.set(ne,J)}return K}function Z(j,te,q,L){var he=j.length;q=Math.max(0,q==null?0:+q),L=Math.min(he-1,L==null?he-1:+L);var K=[];return te.paragraphs.forEach(function(ne){var J=Math.max(q,ne.start),be=Math.min(L,ne.end);if(J<be){for(var re=te.levels.slice(J,be+1),ae=be;ae>=J&&u(j[ae])&i;ae--)re[ae]=ne.level;for(var fe=ne.level,de=1/0,_e=0;_e<re.length;_e++){var Me=re[_e];Me>fe&&(fe=Me),Me<de&&(de=Me|1)}for(var ge=fe;ge>=de;ge--)for(var me=0;me<re.length;me++)if(re[me]>=ge){for(var le=me;me+1<re.length&&re[me+1]>=ge;)me++;me>le&&K.push([le+J,me+J])}}}),K}function ee(j,te,q,L){var he=se(j,te,q,L),K=[].concat(j);return he.forEach(function(ne,J){K[J]=(te.levels[ne]&1?pe(j[ne]):null)||j[ne]}),K.join("")}function se(j,te,q,L){for(var he=Z(j,te,q,L),K=[],ne=0;ne<j.length;ne++)K[ne]=ne;return he.forEach(function(J){for(var be=J[0],re=J[1],ae=K.slice(be,re+1),fe=ae.length;fe--;)K[re-fe]=ae[fe]}),K}return r.closingToOpeningBracket=U,r.getBidiCharType=u,r.getBidiCharTypeName=c,r.getCanonicalBracket=A,r.getEmbeddingLevels=Y,r.getMirroredCharacter=pe,r.getMirroredCharactersMap=ue,r.getReorderSegments=Z,r.getReorderedIndices=se,r.getReorderedString=ee,r.openingToClosingBracket=T,Object.defineProperty(r,"__esModule",{value:!0}),r}({});return h}var An=va;Pe();var Ar=/\bvoid\s+main\s*\(\s*\)\s*{/g;function Mr(h){let r=/^[ \t]*#include +<([\w\d./]+)>/gm;function d(f,t){let e=bn[t];return e?Mr(e):f}return h.replace(r,d)}var Ce=[];for(let h=0;h<256;h++)Ce[h]=(h<16?"0":"")+h.toString(16);function pa(){let h=Math.random()*4294967295|0,r=Math.random()*4294967295|0,d=Math.random()*4294967295|0,f=Math.random()*4294967295|0;return(Ce[h&255]+Ce[h>>8&255]+Ce[h>>16&255]+Ce[h>>24&255]+"-"+Ce[r&255]+Ce[r>>8&255]+"-"+Ce[r>>16&15|64]+Ce[r>>24&255]+"-"+Ce[d&63|128]+Ce[d>>8&255]+"-"+Ce[d>>16&255]+Ce[d>>24&255]+Ce[f&255]+Ce[f>>8&255]+Ce[f>>16&255]+Ce[f>>24&255]).toUpperCase()}var it=Object.assign||function(){let h=arguments[0];for(let r=1,d=arguments.length;r<d;r++){let f=arguments[r];if(f)for(let t in f)Object.prototype.hasOwnProperty.call(f,t)&&(h[t]=f[t])}return h},ga=Date.now(),Dn=new WeakMap,Cn=new Map,ma=1e10;function dt(h,r){let d=Ta(r),f=Dn.get(h);if(f||Dn.set(h,f=Object.create(null)),f[d])return new f[d];let t="_onBeforeCompile".concat(d),e=function(i,s){h.onBeforeCompile.call(this,i,s);let l=this.customProgramCacheKey()+"|"+i.vertexShader+"|"+i.fragmentShader,u=Cn[l];if(!u){let c=ya(this,i,r,d);u=Cn[l]=c}i.vertexShader=u.vertexShader,i.fragmentShader=u.fragmentShader,it(i.uniforms,this.uniforms),r.timeUniform&&(i.uniforms[r.timeUniform]={get value(){return Date.now()-ga}}),this[t]&&this[t](i)},a=function(){return o(r.chained?h:h.clone())},o=function(i){let s=Object.create(i,n);return Object.defineProperty(s,"baseMaterial",{value:h}),Object.defineProperty(s,"id",{value:ma++}),s.uuid=pa(),s.uniforms=it({},i.uniforms,r.uniforms),s.defines=it({},i.defines,r.defines),s.defines["TROIKA_DERIVED_MATERIAL_".concat(d)]="",s.extensions=it({},i.extensions,r.extensions),s._listeners=void 0,s},n={constructor:{value:a},isDerivedMaterial:{value:!0},type:{get:()=>h.type,set:i=>{h.type=i}},isDerivedFrom:{writable:!0,configurable:!0,value:function(i){let s=this.baseMaterial;return i===s||s.isDerivedMaterial&&s.isDerivedFrom(i)||!1}},customProgramCacheKey:{writable:!0,configurable:!0,value:function(){return h.customProgramCacheKey()+"|"+d}},onBeforeCompile:{get(){return e},set(i){this[t]=i}},copy:{writable:!0,configurable:!0,value:function(i){return h.copy.call(this,i),!h.isShaderMaterial&&!h.isDerivedMaterial&&(it(this.extensions,i.extensions),it(this.defines,i.defines),it(this.uniforms,yn.clone(i.uniforms))),this}},clone:{writable:!0,configurable:!0,value:function(){let i=new h.constructor;return o(i).copy(this)}},getDepthMaterial:{writable:!0,configurable:!0,value:function(){let i=this._depthMaterial;return i||(i=this._depthMaterial=dt(h.isDerivedMaterial?h.getDepthMaterial():new xn({depthPacking:cn}),r),i.defines.IS_DEPTH_MATERIAL="",i.uniforms=this.uniforms),i}},getDistanceMaterial:{writable:!0,configurable:!0,value:function(){let i=this._distanceMaterial;return i||(i=this._distanceMaterial=dt(h.isDerivedMaterial?h.getDistanceMaterial():new Tn,r),i.defines.IS_DISTANCE_MATERIAL="",i.uniforms=this.uniforms),i}},dispose:{writable:!0,configurable:!0,value(){let{_depthMaterial:i,_distanceMaterial:s}=this;i&&i.dispose(),s&&s.dispose(),h.dispose.call(this)}}};return f[d]=a,new a}function ya(h,{vertexShader:r,fragmentShader:d},f,t){let{vertexDefs:e,vertexMainIntro:a,vertexMainOutro:o,vertexTransform:n,fragmentDefs:i,fragmentMainIntro:s,fragmentMainOutro:l,fragmentColorTransform:u,customRewriter:c,timeUniform:p}=f;if(e=e||"",a=a||"",o=o||"",i=i||"",s=s||"",l=l||"",(n||c)&&(r=Mr(r)),(u||c)&&(d=d.replace(/^[ \t]*#include <((?:tonemapping|encodings|colorspace|fog|premultiplied_alpha|dithering)_fragment)>/gm,"\n//!BEGIN_POST_CHUNK $1\n$&\n//!END_POST_CHUNK\n"),d=Mr(d)),c){let g=c({vertexShader:r,fragmentShader:d});r=g.vertexShader,d=g.fragmentShader}if(u){let g=[];d=d.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,y=>(g.push(y),"")),l="".concat(u,"\n").concat(g.join("\n"),"\n").concat(l)}if(p){let g="\nuniform float ".concat(p,";\n");e=g+e,i=g+i}return n&&(r="vec3 troika_position_".concat(t,";\nvec3 troika_normal_").concat(t,";\nvec2 troika_uv_").concat(t,";\n").concat(r,"\n"),e="".concat(e,"\nvoid troikaVertexTransform").concat(t,"(inout vec3 position, inout vec3 normal, inout vec2 uv) {\n ").concat(n,"\n}\n"),a="\ntroika_position_".concat(t," = vec3(position);\ntroika_normal_").concat(t," = vec3(normal);\ntroika_uv_").concat(t," = vec2(uv);\ntroikaVertexTransform").concat(t,"(troika_position_").concat(t,", troika_normal_").concat(t,", troika_uv_").concat(t,");\n").concat(a,"\n"),r=r.replace(/\b(position|normal|uv)\b/g,(g,y,R,w)=>/\battribute\s+vec[23]\s+$/.test(w.substr(0,R))?y:"troika_".concat(y,"_").concat(t)),h.map&&h.map.channel>0||(r=r.replace(/\bMAP_UV\b/g,"troika_uv_".concat(t)))),r=En(r,t,e,a,o),d=En(d,t,i,s,l),{vertexShader:r,fragmentShader:d}}function En(h,r,d,f,t){return(f||t||d)&&(h=h.replace(Ar,"\n".concat(d,"\nvoid troikaOrigMain").concat(r,"() {")),h+="\nvoid main() {\n ".concat(f,"\n troikaOrigMain").concat(r,"();\n ").concat(t,"\n}")),h}function ba(h,r){return h==="uniforms"?void 0:typeof r=="function"?r.toString():r}var xa=0,Bn=new Map;function Ta(h){let r=JSON.stringify(h,ba),d=Bn.get(r);return d==null&&Bn.set(r,d=++xa),d}function _a(){return typeof window>"u"&&(self.window=self),function(h){var r={parse:function(t){var e=r._bin,a=new Uint8Array(t);if(e.readASCII(a,0,4)=="ttcf"){var o=4;e.readUshort(a,o),o+=2,e.readUshort(a,o),o+=2;var n=e.readUint(a,o);o+=4;for(var i=[],s=0;s<n;s++){var l=e.readUint(a,o);o+=4,i.push(r._readFont(a,l))}return i}return[r._readFont(a,0)]},_readFont:function(t,e){var a=r._bin,o=e;a.readFixed(t,e),e+=4;var n=a.readUshort(t,e);e+=2,a.readUshort(t,e),e+=2,a.readUshort(t,e),e+=2,a.readUshort(t,e),e+=2;for(var i=["cmap","head","hhea","maxp","hmtx","name","OS/2","post","loca","glyf","kern","CFF ","GDEF","GPOS","GSUB","SVG "],s={_data:t,_offset:o},l={},u=0;u<n;u++){var c=a.readASCII(t,e,4);e+=4,a.readUint(t,e),e+=4;var p=a.readUint(t,e);e+=4;var g=a.readUint(t,e);e+=4,l[c]={offset:p,length:g}}for(u=0;u<i.length;u++){var y=i[u];l[y]&&(s[y.trim()]=r[y.trim()].parse(t,l[y].offset,l[y].length,s))}return s},_tabOffset:function(t,e,a){for(var o=r._bin,n=o.readUshort(t,a+4),i=a+12,s=0;s<n;s++){var l=o.readASCII(t,i,4);i+=4,o.readUint(t,i),i+=4;var u=o.readUint(t,i);if(i+=4,o.readUint(t,i),i+=4,l==e)return u}return 0}};r._bin={readFixed:function(t,e){return(t[e]<<8|t[e+1])+(t[e+2]<<8|t[e+3])/65540},readF2dot14:function(t,e){return r._bin.readShort(t,e)/16384},readInt:function(t,e){return r._bin._view(t).getInt32(e)},readInt8:function(t,e){return r._bin._view(t).getInt8(e)},readShort:function(t,e){return r._bin._view(t).getInt16(e)},readUshort:function(t,e){return r._bin._view(t).getUint16(e)},readUshorts:function(t,e,a){for(var o=[],n=0;n<a;n++)o.push(r._bin.readUshort(t,e+2*n));return o},readUint:function(t,e){return r._bin._view(t).getUint32(e)},readUint64:function(t,e){return 4294967296*r._bin.readUint(t,e)+r._bin.readUint(t,e+4)},readASCII:function(t,e,a){for(var o="",n=0;n<a;n++)o+=String.fromCharCode(t[e+n]);return o},readUnicode:function(t,e,a){for(var o="",n=0;n<a;n++){var i=t[e++]<<8|t[e++];o+=String.fromCharCode(i)}return o},_tdec:typeof window<"u"&&window.TextDecoder?new window.TextDecoder:null,readUTF8:function(t,e,a){var o=r._bin._tdec;return o&&e==0&&a==t.length?o.decode(t):r._bin.readASCII(t,e,a)},readBytes:function(t,e,a){for(var o=[],n=0;n<a;n++)o.push(t[e+n]);return o},readASCIIArray:function(t,e,a){for(var o=[],n=0;n<a;n++)o.push(String.fromCharCode(t[e+n]));return o},_view:function(t){return t._dataView||(t._dataView=t.buffer?new DataView(t.buffer,t.byteOffset,t.byteLength):new DataView(new Uint8Array(t).buffer))}},r._lctf={},r._lctf.parse=function(t,e,a,o,n){var i=r._bin,s={},l=e;i.readFixed(t,e),e+=4;var u=i.readUshort(t,e);e+=2;var c=i.readUshort(t,e);e+=2;var p=i.readUshort(t,e);return e+=2,s.scriptList=r._lctf.readScriptList(t,l+u),s.featureList=r._lctf.readFeatureList(t,l+c),s.lookupList=r._lctf.readLookupList(t,l+p,n),s},r._lctf.readLookupList=function(t,e,a){var o=r._bin,n=e,i=[],s=o.readUshort(t,e);e+=2;for(var l=0;l<s;l++){var u=o.readUshort(t,e);e+=2;var c=r._lctf.readLookupTable(t,n+u,a);i.push(c)}return i},r._lctf.readLookupTable=function(t,e,a){var o=r._bin,n=e,i={tabs:[]};i.ltype=o.readUshort(t,e),e+=2,i.flag=o.readUshort(t,e),e+=2;var s=o.readUshort(t,e);e+=2;for(var l=i.ltype,u=0;u<s;u++){var c=o.readUshort(t,e);e+=2;var p=a(t,l,n+c,i);i.tabs.push(p)}return i},r._lctf.numOfOnes=function(t){for(var e=0,a=0;a<32;a++)t>>>a&1&&e++;return e},r._lctf.readClassDef=function(t,e){var a=r._bin,o=[],n=a.readUshort(t,e);if(e+=2,n==1){var i=a.readUshort(t,e);e+=2;var s=a.readUshort(t,e);e+=2;for(var l=0;l<s;l++)o.push(i+l),o.push(i+l),o.push(a.readUshort(t,e)),e+=2}if(n==2){var u=a.readUshort(t,e);for(e+=2,l=0;l<u;l++)o.push(a.readUshort(t,e)),e+=2,o.push(a.readUshort(t,e)),e+=2,o.push(a.readUshort(t,e)),e+=2}return o},r._lctf.getInterval=function(t,e){for(var a=0;a<t.length;a+=3){var o=t[a],n=t[a+1];if(t[a+2],o<=e&&e<=n)return a}return-1},r._lctf.readCoverage=function(t,e){var a=r._bin,o={};o.fmt=a.readUshort(t,e),e+=2;var n=a.readUshort(t,e);return e+=2,o.fmt==1&&(o.tab=a.readUshorts(t,e,n)),o.fmt==2&&(o.tab=a.readUshorts(t,e,3*n)),o},r._lctf.coverageIndex=function(t,e){var a=t.tab;if(t.fmt==1)return a.indexOf(e);if(t.fmt==2){var o=r._lctf.getInterval(a,e);if(o!=-1)return a[o+2]+(e-a[o])}return-1},r._lctf.readFeatureList=function(t,e){var a=r._bin,o=e,n=[],i=a.readUshort(t,e);e+=2;for(var s=0;s<i;s++){var l=a.readASCII(t,e,4);e+=4;var u=a.readUshort(t,e);e+=2;var c=r._lctf.readFeatureTable(t,o+u);c.tag=l.trim(),n.push(c)}return n},r._lctf.readFeatureTable=function(t,e){var a=r._bin,o=e,n={},i=a.readUshort(t,e);e+=2,i>0&&(n.featureParams=o+i);var s=a.readUshort(t,e);e+=2,n.tab=[];for(var l=0;l<s;l++)n.tab.push(a.readUshort(t,e+2*l));return n},r._lctf.readScriptList=function(t,e){var a=r._bin,o=e,n={},i=a.readUshort(t,e);e+=2;for(var s=0;s<i;s++){var l=a.readASCII(t,e,4);e+=4;var u=a.readUshort(t,e);e+=2,n[l.trim()]=r._lctf.readScriptTable(t,o+u)}return n},r._lctf.readScriptTable=function(t,e){var a=r._bin,o=e,n={},i=a.readUshort(t,e);e+=2,i>0&&(n.default=r._lctf.readLangSysTable(t,o+i));var s=a.readUshort(t,e);e+=2;for(var l=0;l<s;l++){var u=a.readASCII(t,e,4);e+=4;var c=a.readUshort(t,e);e+=2,n[u.trim()]=r._lctf.readLangSysTable(t,o+c)}return n},r._lctf.readLangSysTable=function(t,e){var a=r._bin,o={};a.readUshort(t,e),e+=2,o.reqFeature=a.readUshort(t,e),e+=2;var n=a.readUshort(t,e);return e+=2,o.features=a.readUshorts(t,e,n),o},r.CFF={},r.CFF.parse=function(t,e,a){var o=r._bin;(t=new Uint8Array(t.buffer,e,a))[e=0],t[++e],t[++e],t[++e],e++;var n=[];e=r.CFF.readIndex(t,e,n);for(var i=[],s=0;s<n.length-1;s++)i.push(o.readASCII(t,e+n[s],n[s+1]-n[s]));e+=n[n.length-1];var l=[];e=r.CFF.readIndex(t,e,l);var u=[];for(s=0;s<l.length-1;s++)u.push(r.CFF.readDict(t,e+l[s],e+l[s+1]));e+=l[l.length-1];var c=u[0],p=[];e=r.CFF.readIndex(t,e,p);var g=[];for(s=0;s<p.length-1;s++)g.push(o.readASCII(t,e+p[s],p[s+1]-p[s]));if(e+=p[p.length-1],r.CFF.readSubrs(t,e,c),c.CharStrings){e=c.CharStrings,p=[],e=r.CFF.readIndex(t,e,p);var y=[];for(s=0;s<p.length-1;s++)y.push(o.readBytes(t,e+p[s],p[s+1]-p[s]));c.CharStrings=y}if(c.ROS){e=c.FDArray;var R=[];for(e=r.CFF.readIndex(t,e,R),c.FDArray=[],s=0;s<R.length-1;s++){var w=r.CFF.readDict(t,e+R[s],e+R[s+1]);r.CFF._readFDict(t,w,g),c.FDArray.push(w)}e+=R[R.length-1],e=c.FDSelect,c.FDSelect=[];var k=t[e];if(e++,k!=3)throw k;var T=o.readUshort(t,e);for(e+=2,s=0;s<T+1;s++)c.FDSelect.push(o.readUshort(t,e),t[e+2]),e+=3}return c.Encoding&&(c.Encoding=r.CFF.readEncoding(t,c.Encoding,c.CharStrings.length)),c.charset&&(c.charset=r.CFF.readCharset(t,c.charset,c.CharStrings.length)),r.CFF._readFDict(t,c,g),c},r.CFF._readFDict=function(t,e,a){var o;for(var n in e.Private&&(o=e.Private[1],e.Private=r.CFF.readDict(t,o,o+e.Private[0]),e.Private.Subrs&&r.CFF.readSubrs(t,o+e.Private.Subrs,e.Private)),e)["FamilyName","FontName","FullName","Notice","version","Copyright"].indexOf(n)!=-1&&(e[n]=a[e[n]-426+35])},r.CFF.readSubrs=function(t,e,a){var o=r._bin,n=[];e=r.CFF.readIndex(t,e,n);var i,s=n.length;i=s<1240?107:s<33900?1131:32768,a.Bias=i,a.Subrs=[];for(var l=0;l<n.length-1;l++)a.Subrs.push(o.readBytes(t,e+n[l],n[l+1]-n[l]))},r.CFF.tableSE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],r.CFF.glyphByUnicode=function(t,e){for(var a=0;a<t.charset.length;a++)if(t.charset[a]==e)return a;return-1},r.CFF.glyphBySE=function(t,e){return e<0||e>255?-1:r.CFF.glyphByUnicode(t,r.CFF.tableSE[e])},r.CFF.readEncoding=function(t,e,a){r._bin;var o=[".notdef"],n=t[e];if(e++,n!=0)throw"error: unknown encoding format: "+n;var i=t[e];e++;for(var s=0;s<i;s++)o.push(t[e+s]);return o},r.CFF.readCharset=function(t,e,a){var o=r._bin,n=[".notdef"],i=t[e];if(e++,i==0)for(var s=0;s<a;s++){var l=o.readUshort(t,e);e+=2,n.push(l)}else{if(i!=1&&i!=2)throw"error: format: "+i;for(;n.length<a;){l=o.readUshort(t,e),e+=2;var u=0;for(i==1?(u=t[e],e++):(u=o.readUshort(t,e),e+=2),s=0;s<=u;s++)n.push(l),l++}}return n},r.CFF.readIndex=function(t,e,a){var o=r._bin,n=o.readUshort(t,e)+1,i=t[e+=2];if(e++,i==1)for(var s=0;s<n;s++)a.push(t[e+s]);else if(i==2)for(s=0;s<n;s++)a.push(o.readUshort(t,e+2*s));else if(i==3)for(s=0;s<n;s++)a.push(16777215&o.readUint(t,e+3*s-1));else if(n!=1)throw"unsupported offset size: "+i+", count: "+n;return(e+=n*i)-1},r.CFF.getCharString=function(t,e,a){var o=r._bin,n=t[e],i=t[e+1];t[e+2],t[e+3],t[e+4];var s=1,l=null,u=null;n<=20&&(l=n,s=1),n==12&&(l=100*n+i,s=2),21<=n&&n<=27&&(l=n,s=1),n==28&&(u=o.readShort(t,e+1),s=3),29<=n&&n<=31&&(l=n,s=1),32<=n&&n<=246&&(u=n-139,s=1),247<=n&&n<=250&&(u=256*(n-247)+i+108,s=2),251<=n&&n<=254&&(u=256*-(n-251)-i-108,s=2),n==255&&(u=o.readInt(t,e+1)/65535,s=5),a.val=u!=null?u:"o"+l,a.size=s},r.CFF.readCharString=function(t,e,a){for(var o=e+a,n=r._bin,i=[];e<o;){var s=t[e],l=t[e+1];t[e+2],t[e+3],t[e+4];var u=1,c=null,p=null;s<=20&&(c=s,u=1),s==12&&(c=100*s+l,u=2),s!=19&&s!=20||(c=s,u=2),21<=s&&s<=27&&(c=s,u=1),s==28&&(p=n.readShort(t,e+1),u=3),29<=s&&s<=31&&(c=s,u=1),32<=s&&s<=246&&(p=s-139,u=1),247<=s&&s<=250&&(p=256*(s-247)+l+108,u=2),251<=s&&s<=254&&(p=256*-(s-251)-l-108,u=2),s==255&&(p=n.readInt(t,e+1)/65535,u=5),i.push(p!=null?p:"o"+c),e+=u}return i},r.CFF.readDict=function(t,e,a){for(var o=r._bin,n={},i=[];e<a;){var s=t[e],l=t[e+1];t[e+2],t[e+3],t[e+4];var u=1,c=null,p=null;if(s==28&&(p=o.readShort(t,e+1),u=3),s==29&&(p=o.readInt(t,e+1),u=5),32<=s&&s<=246&&(p=s-139,u=1),247<=s&&s<=250&&(p=256*(s-247)+l+108,u=2),251<=s&&s<=254&&(p=256*-(s-251)-l-108,u=2),s==255)throw p=o.readInt(t,e+1)/65535,u=5,"unknown number";if(s==30){var g=[];for(u=1;;){var y=t[e+u];u++;var R=y>>4,w=15&y;if(R!=15&&g.push(R),w!=15&&g.push(w),w==15)break}for(var k="",T=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],U=0;U<g.length;U++)k+=T[g[U]];p=parseFloat(k)}s<=21&&(c=["version","Notice","FullName","FamilyName","Weight","FontBBox","BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StdHW","StdVW","escape","UniqueID","XUID","charset","Encoding","CharStrings","Private","Subrs","defaultWidthX","nominalWidthX"][s],u=1,s==12&&(c=["Copyright","isFixedPitch","ItalicAngle","UnderlinePosition","UnderlineThickness","PaintType","CharstringType","FontMatrix","StrokeWidth","BlueScale","BlueShift","BlueFuzz","StemSnapH","StemSnapV","ForceBold",0,0,"LanguageGroup","ExpansionFactor","initialRandomSeed","SyntheticBase","PostScript","BaseFontName","BaseFontBlend",0,0,0,0,0,0,"ROS","CIDFontVersion","CIDFontRevision","CIDFontType","CIDCount","UIDBase","FDArray","FDSelect","FontName"][l],u=2)),c!=null?(n[c]=i.length==1?i[0]:i,i=[]):i.push(p),e+=u}return n},r.cmap={},r.cmap.parse=function(t,e,a){t=new Uint8Array(t.buffer,e,a),e=0;var o=r._bin,n={};o.readUshort(t,e),e+=2;var i=o.readUshort(t,e);e+=2;var s=[];n.tables=[];for(var l=0;l<i;l++){var u=o.readUshort(t,e);e+=2;var c=o.readUshort(t,e);e+=2;var p=o.readUint(t,e);e+=4;var g="p"+u+"e"+c,y=s.indexOf(p);if(y==-1){var R;y=n.tables.length,s.push(p);var w=o.readUshort(t,p);w==0?R=r.cmap.parse0(t,p):w==4?R=r.cmap.parse4(t,p):w==6?R=r.cmap.parse6(t,p):w==12?R=r.cmap.parse12(t,p):console.debug("unknown format: "+w,u,c,p),n.tables.push(R)}if(n[g]!=null)throw"multiple tables for one platform+encoding";n[g]=y}return n},r.cmap.parse0=function(t,e){var a=r._bin,o={};o.format=a.readUshort(t,e),e+=2;var n=a.readUshort(t,e);e+=2,a.readUshort(t,e),e+=2,o.map=[];for(var i=0;i<n-6;i++)o.map.push(t[e+i]);return o},r.cmap.parse4=function(t,e){var a=r._bin,o=e,n={};n.format=a.readUshort(t,e),e+=2;var i=a.readUshort(t,e);e+=2,a.readUshort(t,e),e+=2;var s=a.readUshort(t,e);e+=2;var l=s/2;n.searchRange=a.readUshort(t,e),e+=2,n.entrySelector=a.readUshort(t,e),e+=2,n.rangeShift=a.readUshort(t,e),e+=2,n.endCount=a.readUshorts(t,e,l),e+=2*l,e+=2,n.startCount=a.readUshorts(t,e,l),e+=2*l,n.idDelta=[];for(var u=0;u<l;u++)n.idDelta.push(a.readShort(t,e)),e+=2;for(n.idRangeOffset=a.readUshorts(t,e,l),e+=2*l,n.glyphIdArray=[];e<o+i;)n.glyphIdArray.push(a.readUshort(t,e)),e+=2;return n},r.cmap.parse6=function(t,e){var a=r._bin,o={};o.format=a.readUshort(t,e),e+=2,a.readUshort(t,e),e+=2,a.readUshort(t,e),e+=2,o.firstCode=a.readUshort(t,e),e+=2;var n=a.readUshort(t,e);e+=2,o.glyphIdArray=[];for(var i=0;i<n;i++)o.glyphIdArray.push(a.readUshort(t,e)),e+=2;return o},r.cmap.parse12=function(t,e){var a=r._bin,o={};o.format=a.readUshort(t,e),e+=2,e+=2,a.readUint(t,e),e+=4,a.readUint(t,e),e+=4;var n=a.readUint(t,e);e+=4,o.groups=[];for(var i=0;i<n;i++){var s=e+12*i,l=a.readUint(t,s+0),u=a.readUint(t,s+4),c=a.readUint(t,s+8);o.groups.push([l,u,c])}return o},r.glyf={},r.glyf.parse=function(t,e,a,o){for(var n=[],i=0;i<o.maxp.numGlyphs;i++)n.push(null);return n},r.glyf._parseGlyf=function(t,e){var a=r._bin,o=t._data,n=r._tabOffset(o,"glyf",t._offset)+t.loca[e];if(t.loca[e]==t.loca[e+1])return null;var i={};if(i.noc=a.readShort(o,n),n+=2,i.xMin=a.readShort(o,n),n+=2,i.yMin=a.readShort(o,n),n+=2,i.xMax=a.readShort(o,n),n+=2,i.yMax=a.readShort(o,n),n+=2,i.xMin>=i.xMax||i.yMin>=i.yMax)return null;if(i.noc>0){i.endPts=[];for(var s=0;s<i.noc;s++)i.endPts.push(a.readUshort(o,n)),n+=2;var l=a.readUshort(o,n);if(n+=2,o.length-n<l)return null;i.instructions=a.readBytes(o,n,l),n+=l;var u=i.endPts[i.noc-1]+1;for(i.flags=[],s=0;s<u;s++){var c=o[n];if(n++,i.flags.push(c),(8&c)!=0){var p=o[n];n++;for(var g=0;g<p;g++)i.flags.push(c),s++}}for(i.xs=[],s=0;s<u;s++){var y=(2&i.flags[s])!=0,R=(16&i.flags[s])!=0;y?(i.xs.push(R?o[n]:-o[n]),n++):R?i.xs.push(0):(i.xs.push(a.readShort(o,n)),n+=2)}for(i.ys=[],s=0;s<u;s++)y=(4&i.flags[s])!=0,R=(32&i.flags[s])!=0,y?(i.ys.push(R?o[n]:-o[n]),n++):R?i.ys.push(0):(i.ys.push(a.readShort(o,n)),n+=2);var w=0,k=0;for(s=0;s<u;s++)w+=i.xs[s],k+=i.ys[s],i.xs[s]=w,i.ys[s]=k}else{var T;i.parts=[];do{T=a.readUshort(o,n),n+=2;var U={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1};if(i.parts.push(U),U.glyphIndex=a.readUshort(o,n),n+=2,1&T){var A=a.readShort(o,n);n+=2;var b=a.readShort(o,n);n+=2}else A=a.readInt8(o,n),n++,b=a.readInt8(o,n),n++;2&T?(U.m.tx=A,U.m.ty=b):(U.p1=A,U.p2=b),8&T?(U.m.a=U.m.d=a.readF2dot14(o,n),n+=2):64&T?(U.m.a=a.readF2dot14(o,n),n+=2,U.m.d=a.readF2dot14(o,n),n+=2):128&T&&(U.m.a=a.readF2dot14(o,n),n+=2,U.m.b=a.readF2dot14(o,n),n+=2,U.m.c=a.readF2dot14(o,n),n+=2,U.m.d=a.readF2dot14(o,n),n+=2)}while(32&T);if(256&T){var M=a.readUshort(o,n);for(n+=2,i.instr=[],s=0;s<M;s++)i.instr.push(o[n]),n++}}return i},r.GDEF={},r.GDEF.parse=function(t,e,a,o){var n=e;e+=4;var i=r._bin.readUshort(t,e);return{glyphClassDef:i===0?null:r._lctf.readClassDef(t,n+i)}},r.GPOS={},r.GPOS.parse=function(t,e,a,o){return r._lctf.parse(t,e,a,o,r.GPOS.subt)},r.GPOS.subt=function(t,e,a,o){var n=r._bin,i=a,s={};if(s.fmt=n.readUshort(t,a),a+=2,e==1||e==2||e==3||e==7||e==8&&s.fmt<=2){var l=n.readUshort(t,a);a+=2,s.coverage=r._lctf.readCoverage(t,l+i)}if(e==1&&s.fmt==1){var u=n.readUshort(t,a);a+=2,u!=0&&(s.pos=r.GPOS.readValueRecord(t,a,u))}else if(e==2&&s.fmt>=1&&s.fmt<=2){u=n.readUshort(t,a),a+=2;var c=n.readUshort(t,a);a+=2;var p=r._lctf.numOfOnes(u),g=r._lctf.numOfOnes(c);if(s.fmt==1){s.pairsets=[];var y=n.readUshort(t,a);a+=2;for(var R=0;R<y;R++){var w=i+n.readUshort(t,a);a+=2;var k=n.readUshort(t,w);w+=2;for(var T=[],U=0;U<k;U++){var A=n.readUshort(t,w);w+=2,u!=0&&(m=r.GPOS.readValueRecord(t,w,u),w+=2*p),c!=0&&(B=r.GPOS.readValueRecord(t,w,c),w+=2*g),T.push({gid2:A,val1:m,val2:B})}s.pairsets.push(T)}}if(s.fmt==2){var b=n.readUshort(t,a);a+=2;var M=n.readUshort(t,a);a+=2;var z=n.readUshort(t,a);a+=2;var E=n.readUshort(t,a);for(a+=2,s.classDef1=r._lctf.readClassDef(t,i+b),s.classDef2=r._lctf.readClassDef(t,i+M),s.matrix=[],R=0;R<z;R++){var H=[];for(U=0;U<E;U++){var m=null,B=null;u!=0&&(m=r.GPOS.readValueRecord(t,a,u),a+=2*p),c!=0&&(B=r.GPOS.readValueRecord(t,a,c),a+=2*g),H.push({val1:m,val2:B})}s.matrix.push(H)}}}else if(e==4&&s.fmt==1)s.markCoverage=r._lctf.readCoverage(t,n.readUshort(t,a)+i),s.baseCoverage=r._lctf.readCoverage(t,n.readUshort(t,a+2)+i),s.markClassCount=n.readUshort(t,a+4),s.markArray=r.GPOS.readMarkArray(t,n.readUshort(t,a+6)+i),s.baseArray=r.GPOS.readBaseArray(t,n.readUshort(t,a+8)+i,s.markClassCount);else if(e==6&&s.fmt==1)s.mark1Coverage=r._lctf.readCoverage(t,n.readUshort(t,a)+i),s.mark2Coverage=r._lctf.readCoverage(t,n.readUshort(t,a+2)+i),s.markClassCount=n.readUshort(t,a+4),s.mark1Array=r.GPOS.readMarkArray(t,n.readUshort(t,a+6)+i),s.mark2Array=r.GPOS.readBaseArray(t,n.readUshort(t,a+8)+i,s.markClassCount);else{if(e==9&&s.fmt==1){var S=n.readUshort(t,a);a+=2;var V=n.readUint(t,a);if(a+=4,o.ltype==9)o.ltype=S;else if(o.ltype!=S)throw"invalid extension substitution";return r.GPOS.subt(t,o.ltype,i+V)}console.debug("unsupported GPOS table LookupType",e,"format",s.fmt)}return s},r.GPOS.readValueRecord=function(t,e,a){var o=r._bin,n=[];return n.push(1&a?o.readShort(t,e):0),e+=1&a?2:0,n.push(2&a?o.readShort(t,e):0),e+=2&a?2:0,n.push(4&a?o.readShort(t,e):0),e+=4&a?2:0,n.push(8&a?o.readShort(t,e):0),e+=8&a?2:0,n},r.GPOS.readBaseArray=function(t,e,a){var o=r._bin,n=[],i=e,s=o.readUshort(t,e);e+=2;for(var l=0;l<s;l++){for(var u=[],c=0;c<a;c++)u.push(r.GPOS.readAnchorRecord(t,i+o.readUshort(t,e))),e+=2;n.push(u)}return n},r.GPOS.readMarkArray=function(t,e){var a=r._bin,o=[],n=e,i=a.readUshort(t,e);e+=2;for(var s=0;s<i;s++){var l=r.GPOS.readAnchorRecord(t,a.readUshort(t,e+2)+n);l.markClass=a.readUshort(t,e),o.push(l),e+=4}return o},r.GPOS.readAnchorRecord=function(t,e){var a=r._bin,o={};return o.fmt=a.readUshort(t,e),o.x=a.readShort(t,e+2),o.y=a.readShort(t,e+4),o},r.GSUB={},r.GSUB.parse=function(t,e,a,o){return r._lctf.parse(t,e,a,o,r.GSUB.subt)},r.GSUB.subt=function(t,e,a,o){var n=r._bin,i=a,s={};if(s.fmt=n.readUshort(t,a),a+=2,e!=1&&e!=2&&e!=4&&e!=5&&e!=6)return null;if(e==1||e==2||e==4||e==5&&s.fmt<=2||e==6&&s.fmt<=2){var l=n.readUshort(t,a);a+=2,s.coverage=r._lctf.readCoverage(t,i+l)}if(e==1&&s.fmt>=1&&s.fmt<=2){if(s.fmt==1)s.delta=n.readShort(t,a),a+=2;else if(s.fmt==2){var u=n.readUshort(t,a);a+=2,s.newg=n.readUshorts(t,a,u),a+=2*s.newg.length}}else if(e==2&&s.fmt==1){u=n.readUshort(t,a),a+=2,s.seqs=[];for(var c=0;c<u;c++){var p=n.readUshort(t,a)+i;a+=2;var g=n.readUshort(t,p);s.seqs.push(n.readUshorts(t,p+2,g))}}else if(e==4)for(s.vals=[],u=n.readUshort(t,a),a+=2,c=0;c<u;c++){var y=n.readUshort(t,a);a+=2,s.vals.push(r.GSUB.readLigatureSet(t,i+y))}else if(e==5&&s.fmt==2){if(s.fmt==2){var R=n.readUshort(t,a);a+=2,s.cDef=r._lctf.readClassDef(t,i+R),s.scset=[];var w=n.readUshort(t,a);for(a+=2,c=0;c<w;c++){var k=n.readUshort(t,a);a+=2,s.scset.push(k==0?null:r.GSUB.readSubClassSet(t,i+k))}}}else if(e==6&&s.fmt==3){if(s.fmt==3){for(c=0;c<3;c++){u=n.readUshort(t,a),a+=2;for(var T=[],U=0;U<u;U++)T.push(r._lctf.readCoverage(t,i+n.readUshort(t,a+2*U)));a+=2*u,c==0&&(s.backCvg=T),c==1&&(s.inptCvg=T),c==2&&(s.ahedCvg=T)}u=n.readUshort(t,a),a+=2,s.lookupRec=r.GSUB.readSubstLookupRecords(t,a,u)}}else{if(e==7&&s.fmt==1){var A=n.readUshort(t,a);a+=2;var b=n.readUint(t,a);if(a+=4,o.ltype==9)o.ltype=A;else if(o.ltype!=A)throw"invalid extension substitution";return r.GSUB.subt(t,o.ltype,i+b)}console.debug("unsupported GSUB table LookupType",e,"format",s.fmt)}return s},r.GSUB.readSubClassSet=function(t,e){var a=r._bin.readUshort,o=e,n=[],i=a(t,e);e+=2;for(var s=0;s<i;s++){var l=a(t,e);e+=2,n.push(r.GSUB.readSubClassRule(t,o+l))}return n},r.GSUB.readSubClassRule=function(t,e){var a=r._bin.readUshort,o={},n=a(t,e),i=a(t,e+=2);e+=2,o.input=[];for(var s=0;s<n-1;s++)o.input.push(a(t,e)),e+=2;return o.substLookupRecords=r.GSUB.readSubstLookupRecords(t,e,i),o},r.GSUB.readSubstLookupRecords=function(t,e,a){for(var o=r._bin.readUshort,n=[],i=0;i<a;i++)n.push(o(t,e),o(t,e+2)),e+=4;return n},r.GSUB.readChainSubClassSet=function(t,e){var a=r._bin,o=e,n=[],i=a.readUshort(t,e);e+=2;for(var s=0;s<i;s++){var l=a.readUshort(t,e);e+=2,n.push(r.GSUB.readChainSubClassRule(t,o+l))}return n},r.GSUB.readChainSubClassRule=function(t,e){for(var a=r._bin,o={},n=["backtrack","input","lookahead"],i=0;i<n.length;i++){var s=a.readUshort(t,e);e+=2,i==1&&s--,o[n[i]]=a.readUshorts(t,e,s),e+=2*o[n[i]].length}return s=a.readUshort(t,e),e+=2,o.subst=a.readUshorts(t,e,2*s),e+=2*o.subst.length,o},r.GSUB.readLigatureSet=function(t,e){var a=r._bin,o=e,n=[],i=a.readUshort(t,e);e+=2;for(var s=0;s<i;s++){var l=a.readUshort(t,e);e+=2,n.push(r.GSUB.readLigature(t,o+l))}return n},r.GSUB.readLigature=function(t,e){var a=r._bin,o={chain:[]};o.nglyph=a.readUshort(t,e),e+=2;var n=a.readUshort(t,e);e+=2;for(var i=0;i<n-1;i++)o.chain.push(a.readUshort(t,e)),e+=2;return o},r.head={},r.head.parse=function(t,e,a){var o=r._bin,n={};return o.readFixed(t,e),e+=4,n.fontRevision=o.readFixed(t,e),e+=4,o.readUint(t,e),e+=4,o.readUint(t,e),e+=4,n.flags=o.readUshort(t,e),e+=2,n.unitsPerEm=o.readUshort(t,e),e+=2,n.created=o.readUint64(t,e),e+=8,n.modified=o.readUint64(t,e),e+=8,n.xMin=o.readShort(t,e),e+=2,n.yMin=o.readShort(t,e),e+=2,n.xMax=o.readShort(t,e),e+=2,n.yMax=o.readShort(t,e),e+=2,n.macStyle=o.readUshort(t,e),e+=2,n.lowestRecPPEM=o.readUshort(t,e),e+=2,n.fontDirectionHint=o.readShort(t,e),e+=2,n.indexToLocFormat=o.readShort(t,e),e+=2,n.glyphDataFormat=o.readShort(t,e),e+=2,n},r.hhea={},r.hhea.parse=function(t,e,a){var o=r._bin,n={};return o.readFixed(t,e),e+=4,n.ascender=o.readShort(t,e),e+=2,n.descender=o.readShort(t,e),e+=2,n.lineGap=o.readShort(t,e),e+=2,n.advanceWidthMax=o.readUshort(t,e),e+=2,n.minLeftSideBearing=o.readShort(t,e),e+=2,n.minRightSideBearing=o.readShort(t,e),e+=2,n.xMaxExtent=o.readShort(t,e),e+=2,n.caretSlopeRise=o.readShort(t,e),e+=2,n.caretSlopeRun=o.readShort(t,e),e+=2,n.caretOffset=o.readShort(t,e),e+=2,e+=8,n.metricDataFormat=o.readShort(t,e),e+=2,n.numberOfHMetrics=o.readUshort(t,e),e+=2,n},r.hmtx={},r.hmtx.parse=function(t,e,a,o){for(var n=r._bin,i={aWidth:[],lsBearing:[]},s=0,l=0,u=0;u<o.maxp.numGlyphs;u++)u<o.hhea.numberOfHMetrics&&(s=n.readUshort(t,e),e+=2,l=n.readShort(t,e),e+=2),i.aWidth.push(s),i.lsBearing.push(l);return i},r.kern={},r.kern.parse=function(t,e,a,o){var n=r._bin,i=n.readUshort(t,e);if(e+=2,i==1)return r.kern.parseV1(t,e-2,a,o);var s=n.readUshort(t,e);e+=2;for(var l={glyph1:[],rval:[]},u=0;u<s;u++){e+=2,a=n.readUshort(t,e),e+=2;var c=n.readUshort(t,e);e+=2;var p=c>>>8;if((p&=15)!=0)throw"unknown kern table format: "+p;e=r.kern.readFormat0(t,e,l)}return l},r.kern.parseV1=function(t,e,a,o){var n=r._bin;n.readFixed(t,e),e+=4;var i=n.readUint(t,e);e+=4;for(var s={glyph1:[],rval:[]},l=0;l<i;l++){n.readUint(t,e),e+=4;var u=n.readUshort(t,e);e+=2,n.readUshort(t,e),e+=2;var c=u>>>8;if((c&=15)!=0)throw"unknown kern table format: "+c;e=r.kern.readFormat0(t,e,s)}return s},r.kern.readFormat0=function(t,e,a){var o=r._bin,n=-1,i=o.readUshort(t,e);e+=2,o.readUshort(t,e),e+=2,o.readUshort(t,e),e+=2,o.readUshort(t,e),e+=2;for(var s=0;s<i;s++){var l=o.readUshort(t,e);e+=2;var u=o.readUshort(t,e);e+=2;var c=o.readShort(t,e);e+=2,l!=n&&(a.glyph1.push(l),a.rval.push({glyph2:[],vals:[]}));var p=a.rval[a.rval.length-1];p.glyph2.push(u),p.vals.push(c),n=l}return e},r.loca={},r.loca.parse=function(t,e,a,o){var n=r._bin,i=[],s=o.head.indexToLocFormat,l=o.maxp.numGlyphs+1;if(s==0)for(var u=0;u<l;u++)i.push(n.readUshort(t,e+(u<<1))<<1);if(s==1)for(u=0;u<l;u++)i.push(n.readUint(t,e+(u<<2)));return i},r.maxp={},r.maxp.parse=function(t,e,a){var o=r._bin,n={},i=o.readUint(t,e);return e+=4,n.numGlyphs=o.readUshort(t,e),e+=2,i==65536&&(n.maxPoints=o.readUshort(t,e),e+=2,n.maxContours=o.readUshort(t,e),e+=2,n.maxCompositePoints=o.readUshort(t,e),e+=2,n.maxCompositeContours=o.readUshort(t,e),e+=2,n.maxZones=o.readUshort(t,e),e+=2,n.maxTwilightPoints=o.readUshort(t,e),e+=2,n.maxStorage=o.readUshort(t,e),e+=2,n.maxFunctionDefs=o.readUshort(t,e),e+=2,n.maxInstructionDefs=o.readUshort(t,e),e+=2,n.maxStackElements=o.readUshort(t,e),e+=2,n.maxSizeOfInstructions=o.readUshort(t,e),e+=2,n.maxComponentElements=o.readUshort(t,e),e+=2,n.maxComponentDepth=o.readUshort(t,e),e+=2),n},r.name={},r.name.parse=function(t,e,a){var o=r._bin,n={};o.readUshort(t,e),e+=2;var i=o.readUshort(t,e);e+=2,o.readUshort(t,e);for(var s,l=["copyright","fontFamily","fontSubfamily","ID","fullName","version","postScriptName","trademark","manufacturer","designer","description","urlVendor","urlDesigner","licence","licenceURL","---","typoFamilyName","typoSubfamilyName","compatibleFull","sampleText","postScriptCID","wwsFamilyName","wwsSubfamilyName","lightPalette","darkPalette"],u=e+=2,c=0;c<i;c++){var p=o.readUshort(t,e);e+=2;var g=o.readUshort(t,e);e+=2;var y=o.readUshort(t,e);e+=2;var R=o.readUshort(t,e);e+=2;var w=o.readUshort(t,e);e+=2;var k=o.readUshort(t,e);e+=2;var T,U=l[R],A=u+12*i+k;if(p==0)T=o.readUnicode(t,A,w/2);else if(p==3&&g==0)T=o.readUnicode(t,A,w/2);else if(g==0)T=o.readASCII(t,A,w);else if(g==1)T=o.readUnicode(t,A,w/2);else if(g==3)T=o.readUnicode(t,A,w/2);else{if(p!=1)throw"unknown encoding "+g+", platformID: "+p;T=o.readASCII(t,A,w),console.debug("reading unknown MAC encoding "+g+" as ASCII")}var b="p"+p+","+y.toString(16);n[b]==null&&(n[b]={}),n[b][U!==void 0?U:R]=T,n[b]._lang=y}for(var M in n)if(n[M].postScriptName!=null&&n[M]._lang==1033)return n[M];for(var M in n)if(n[M].postScriptName!=null&&n[M]._lang==0)return n[M];for(var M in n)if(n[M].postScriptName!=null&&n[M]._lang==3084)return n[M];for(var M in n)if(n[M].postScriptName!=null)return n[M];for(var M in n){s=M;break}return console.debug("returning name table with languageID "+n[s]._lang),n[s]},r["OS/2"]={},r["OS/2"].parse=function(t,e,a){var o=r._bin.readUshort(t,e);e+=2;var n={};if(o==0)r["OS/2"].version0(t,e,n);else if(o==1)r["OS/2"].version1(t,e,n);else if(o==2||o==3||o==4)r["OS/2"].version2(t,e,n);else{if(o!=5)throw"unknown OS/2 table version: "+o;r["OS/2"].version5(t,e,n)}return n},r["OS/2"].version0=function(t,e,a){var o=r._bin;return a.xAvgCharWidth=o.readShort(t,e),e+=2,a.usWeightClass=o.readUshort(t,e),e+=2,a.usWidthClass=o.readUshort(t,e),e+=2,a.fsType=o.readUshort(t,e),e+=2,a.ySubscriptXSize=o.readShort(t,e),e+=2,a.ySubscriptYSize=o.readShort(t,e),e+=2,a.ySubscriptXOffset=o.readShort(t,e),e+=2,a.ySubscriptYOffset=o.readShort(t,e),e+=2,a.ySuperscriptXSize=o.readShort(t,e),e+=2,a.ySuperscriptYSize=o.readShort(t,e),e+=2,a.ySuperscriptXOffset=o.readShort(t,e),e+=2,a.ySuperscriptYOffset=o.readShort(t,e),e+=2,a.yStrikeoutSize=o.readShort(t,e),e+=2,a.yStrikeoutPosition=o.readShort(t,e),e+=2,a.sFamilyClass=o.readShort(t,e),e+=2,a.panose=o.readBytes(t,e,10),e+=10,a.ulUnicodeRange1=o.readUint(t,e),e+=4,a.ulUnicodeRange2=o.readUint(t,e),e+=4,a.ulUnicodeRange3=o.readUint(t,e),e+=4,a.ulUnicodeRange4=o.readUint(t,e),e+=4,a.achVendID=[o.readInt8(t,e),o.readInt8(t,e+1),o.readInt8(t,e+2),o.readInt8(t,e+3)],e+=4,a.fsSelection=o.readUshort(t,e),e+=2,a.usFirstCharIndex=o.readUshort(t,e),e+=2,a.usLastCharIndex=o.readUshort(t,e),e+=2,a.sTypoAscender=o.readShort(t,e),e+=2,a.sTypoDescender=o.readShort(t,e),e+=2,a.sTypoLineGap=o.readShort(t,e),e+=2,a.usWinAscent=o.readUshort(t,e),e+=2,a.usWinDescent=o.readUshort(t,e),e+=2},r["OS/2"].version1=function(t,e,a){var o=r._bin;return e=r["OS/2"].version0(t,e,a),a.ulCodePageRange1=o.readUint(t,e),e+=4,a.ulCodePageRange2=o.readUint(t,e),e+=4},r["OS/2"].version2=function(t,e,a){var o=r._bin;return e=r["OS/2"].version1(t,e,a),a.sxHeight=o.readShort(t,e),e+=2,a.sCapHeight=o.readShort(t,e),e+=2,a.usDefault=o.readUshort(t,e),e+=2,a.usBreak=o.readUshort(t,e),e+=2,a.usMaxContext=o.readUshort(t,e),e+=2},r["OS/2"].version5=function(t,e,a){var o=r._bin;return e=r["OS/2"].version2(t,e,a),a.usLowerOpticalPointSize=o.readUshort(t,e),e+=2,a.usUpperOpticalPointSize=o.readUshort(t,e),e+=2},r.post={},r.post.parse=function(t,e,a){var o=r._bin,n={};return n.version=o.readFixed(t,e),e+=4,n.italicAngle=o.readFixed(t,e),e+=4,n.underlinePosition=o.readShort(t,e),e+=2,n.underlineThickness=o.readShort(t,e),e+=2,n},r==null&&(r={}),r.U==null&&(r.U={}),r.U.codeToGlyph=function(t,e){var a=t.cmap,o=-1;if(a.p0e4!=null?o=a.p0e4:a.p3e1!=null?o=a.p3e1:a.p1e0!=null?o=a.p1e0:a.p0e3!=null&&(o=a.p0e3),o==-1)throw"no familiar platform and encoding!";var n=a.tables[o];if(n.format==0)return e>=n.map.length?0:n.map[e];if(n.format==4){for(var i=-1,s=0;s<n.endCount.length;s++)if(e<=n.endCount[s]){i=s;break}return i==-1||n.startCount[i]>e?0:65535&(n.idRangeOffset[i]!=0?n.glyphIdArray[e-n.startCount[i]+(n.idRangeOffset[i]>>1)-(n.idRangeOffset.length-i)]:e+n.idDelta[i])}if(n.format==12){if(e>n.groups[n.groups.length-1][1])return 0;for(s=0;s<n.groups.length;s++){var l=n.groups[s];if(l[0]<=e&&e<=l[1])return l[2]+(e-l[0])}return 0}throw"unknown cmap table format "+n.format},r.U.glyphToPath=function(t,e){var a={cmds:[],crds:[]};if(t.SVG&&t.SVG.entries[e]){var o=t.SVG.entries[e];return o==null?a:(typeof o=="string"&&(o=r.SVG.toPath(o),t.SVG.entries[e]=o),o)}if(t.CFF){var n={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:t.CFF.Private?t.CFF.Private.defaultWidthX:0,open:!1},i=t.CFF,s=t.CFF.Private;if(i.ROS){for(var l=0;i.FDSelect[l+2]<=e;)l+=2;s=i.FDArray[i.FDSelect[l+1]].Private}r.U._drawCFF(t.CFF.CharStrings[e],n,i,s,a)}else t.glyf&&r.U._drawGlyf(e,t,a);return a},r.U._drawGlyf=function(t,e,a){var o=e.glyf[t];o==null&&(o=e.glyf[t]=r.glyf._parseGlyf(e,t)),o!=null&&(o.noc>-1?r.U._simpleGlyph(o,a):r.U._compoGlyph(o,e,a))},r.U._simpleGlyph=function(t,e){for(var a=0;a<t.noc;a++){for(var o=a==0?0:t.endPts[a-1]+1,n=t.endPts[a],i=o;i<=n;i++){var s=i==o?n:i-1,l=i==n?o:i+1,u=1&t.flags[i],c=1&t.flags[s],p=1&t.flags[l],g=t.xs[i],y=t.ys[i];if(i==o)if(u){if(!c){r.U.P.moveTo(e,g,y);continue}r.U.P.moveTo(e,t.xs[s],t.ys[s])}else c?r.U.P.moveTo(e,t.xs[s],t.ys[s]):r.U.P.moveTo(e,(t.xs[s]+g)/2,(t.ys[s]+y)/2);u?c&&r.U.P.lineTo(e,g,y):p?r.U.P.qcurveTo(e,g,y,t.xs[l],t.ys[l]):r.U.P.qcurveTo(e,g,y,(g+t.xs[l])/2,(y+t.ys[l])/2)}r.U.P.closePath(e)}},r.U._compoGlyph=function(t,e,a){for(var o=0;o<t.parts.length;o++){var n={cmds:[],crds:[]},i=t.parts[o];r.U._drawGlyf(i.glyphIndex,e,n);for(var s=i.m,l=0;l<n.crds.length;l+=2){var u=n.crds[l],c=n.crds[l+1];a.crds.push(u*s.a+c*s.b+s.tx),a.crds.push(u*s.c+c*s.d+s.ty)}for(l=0;l<n.cmds.length;l++)a.cmds.push(n.cmds[l])}},r.U._getGlyphClass=function(t,e){var a=r._lctf.getInterval(e,t);return a==-1?0:e[a+2]},r.U._applySubs=function(t,e,a,o){for(var n=t.length-e-1,i=0;i<a.tabs.length;i++)if(a.tabs[i]!=null){var s,l=a.tabs[i];if(!l.coverage||(s=r._lctf.coverageIndex(l.coverage,t[e]))!=-1){if(a.ltype==1)t[e],l.fmt==1?t[e]=t[e]+l.delta:t[e]=l.newg[s];else if(a.ltype==4)for(var u=l.vals[s],c=0;c<u.length;c++){var p=u[c],g=p.chain.length;if(!(g>n)){for(var y=!0,R=0,w=0;w<g;w++){for(;t[e+R+(1+w)]==-1;)R++;p.chain[w]!=t[e+R+(1+w)]&&(y=!1)}if(y){for(t[e]=p.nglyph,w=0;w<g+R;w++)t[e+w+1]=-1;break}}}else if(a.ltype==5&&l.fmt==2)for(var k=r._lctf.getInterval(l.cDef,t[e]),T=l.cDef[k+2],U=l.scset[T],A=0;A<U.length;A++){var b=U[A],M=b.input;if(!(M.length>n)){for(y=!0,w=0;w<M.length;w++){var z=r._lctf.getInterval(l.cDef,t[e+1+w]);if(k==-1&&l.cDef[z+2]!=M[w]){y=!1;break}}if(y){var E=b.substLookupRecords;for(c=0;c<E.length;c+=2)E[c],E[c+1]}}}else if(a.ltype==6&&l.fmt==3){if(!r.U._glsCovered(t,l.backCvg,e-l.backCvg.length)||!r.U._glsCovered(t,l.inptCvg,e)||!r.U._glsCovered(t,l.ahedCvg,e+l.inptCvg.length))continue;var H=l.lookupRec;for(A=0;A<H.length;A+=2){k=H[A];var m=o[H[A+1]];r.U._applySubs(t,e+k,m,o)}}}}},r.U._glsCovered=function(t,e,a){for(var o=0;o<e.length;o++)if(r._lctf.coverageIndex(e[o],t[a+o])==-1)return!1;return!0},r.U.glyphsToPath=function(t,e,a){for(var o={cmds:[],crds:[]},n=0,i=0;i<e.length;i++){var s=e[i];if(s!=-1){for(var l=i<e.length-1&&e[i+1]!=-1?e[i+1]:0,u=r.U.glyphToPath(t,s),c=0;c<u.crds.length;c+=2)o.crds.push(u.crds[c]+n),o.crds.push(u.crds[c+1]);for(a&&o.cmds.push(a),c=0;c<u.cmds.length;c++)o.cmds.push(u.cmds[c]);a&&o.cmds.push("X"),n+=t.hmtx.aWidth[s],i<e.length-1&&(n+=r.U.getPairAdjustment(t,s,l))}}return o},r.U.P={},r.U.P.moveTo=function(t,e,a){t.cmds.push("M"),t.crds.push(e,a)},r.U.P.lineTo=function(t,e,a){t.cmds.push("L"),t.crds.push(e,a)},r.U.P.curveTo=function(t,e,a,o,n,i,s){t.cmds.push("C"),t.crds.push(e,a,o,n,i,s)},r.U.P.qcurveTo=function(t,e,a,o,n){t.cmds.push("Q"),t.crds.push(e,a,o,n)},r.U.P.closePath=function(t){t.cmds.push("Z")},r.U._drawCFF=function(t,e,a,o,n){for(var i=e.stack,s=e.nStems,l=e.haveWidth,u=e.width,c=e.open,p=0,g=e.x,y=e.y,R=0,w=0,k=0,T=0,U=0,A=0,b=0,M=0,z=0,E=0,H={val:0,size:0};p<t.length;){r.CFF.getCharString(t,p,H);var m=H.val;if(p+=H.size,m=="o1"||m=="o18")i.length%2!=0&&!l&&(u=i.shift()+o.nominalWidthX),s+=i.length>>1,i.length=0,l=!0;else if(m=="o3"||m=="o23")i.length%2!=0&&!l&&(u=i.shift()+o.nominalWidthX),s+=i.length>>1,i.length=0,l=!0;else if(m=="o4")i.length>1&&!l&&(u=i.shift()+o.nominalWidthX,l=!0),c&&r.U.P.closePath(n),y+=i.pop(),r.U.P.moveTo(n,g,y),c=!0;else if(m=="o5")for(;i.length>0;)g+=i.shift(),y+=i.shift(),r.U.P.lineTo(n,g,y);else if(m=="o6"||m=="o7")for(var B=i.length,S=m=="o6",V=0;V<B;V++){var G=i.shift();S?g+=G:y+=G,S=!S,r.U.P.lineTo(n,g,y)}else if(m=="o8"||m=="o24"){B=i.length;for(var Q=0;Q+6<=B;)R=g+i.shift(),w=y+i.shift(),k=R+i.shift(),T=w+i.shift(),g=k+i.shift(),y=T+i.shift(),r.U.P.curveTo(n,R,w,k,T,g,y),Q+=6;m=="o24"&&(g+=i.shift(),y+=i.shift(),r.U.P.lineTo(n,g,y))}else{if(m=="o11")break;if(m=="o1234"||m=="o1235"||m=="o1236"||m=="o1237")m=="o1234"&&(w=y,k=(R=g+i.shift())+i.shift(),E=T=w+i.shift(),A=T,M=y,g=(b=(U=(z=k+i.shift())+i.shift())+i.shift())+i.shift(),r.U.P.curveTo(n,R,w,k,T,z,E),r.U.P.curveTo(n,U,A,b,M,g,y)),m=="o1235"&&(R=g+i.shift(),w=y+i.shift(),k=R+i.shift(),T=w+i.shift(),z=k+i.shift(),E=T+i.shift(),U=z+i.shift(),A=E+i.shift(),b=U+i.shift(),M=A+i.shift(),g=b+i.shift(),y=M+i.shift(),i.shift(),r.U.P.curveTo(n,R,w,k,T,z,E),r.U.P.curveTo(n,U,A,b,M,g,y)),m=="o1236"&&(R=g+i.shift(),w=y+i.shift(),k=R+i.shift(),E=T=w+i.shift(),A=T,b=(U=(z=k+i.shift())+i.shift())+i.shift(),M=A+i.shift(),g=b+i.shift(),r.U.P.curveTo(n,R,w,k,T,z,E),r.U.P.curveTo(n,U,A,b,M,g,y)),m=="o1237"&&(R=g+i.shift(),w=y+i.shift(),k=R+i.shift(),T=w+i.shift(),z=k+i.shift(),E=T+i.shift(),U=z+i.shift(),A=E+i.shift(),b=U+i.shift(),M=A+i.shift(),Math.abs(b-g)>Math.abs(M-y)?g=b+i.shift():y=M+i.shift(),r.U.P.curveTo(n,R,w,k,T,z,E),r.U.P.curveTo(n,U,A,b,M,g,y));else if(m=="o14"){if(i.length>0&&!l&&(u=i.shift()+a.nominalWidthX,l=!0),i.length==4){var ie=i.shift(),P=i.shift(),O=i.shift(),v=i.shift(),x=r.CFF.glyphBySE(a,O),F=r.CFF.glyphBySE(a,v);r.U._drawCFF(a.CharStrings[x],e,a,o,n),e.x=ie,e.y=P,r.U._drawCFF(a.CharStrings[F],e,a,o,n)}c&&(r.U.P.closePath(n),c=!1)}else if(m=="o19"||m=="o20")i.length%2!=0&&!l&&(u=i.shift()+o.nominalWidthX),s+=i.length>>1,i.length=0,l=!0,p+=s+7>>3;else if(m=="o21")i.length>2&&!l&&(u=i.shift()+o.nominalWidthX,l=!0),y+=i.pop(),g+=i.pop(),c&&r.U.P.closePath(n),r.U.P.moveTo(n,g,y),c=!0;else if(m=="o22")i.length>1&&!l&&(u=i.shift()+o.nominalWidthX,l=!0),g+=i.pop(),c&&r.U.P.closePath(n),r.U.P.moveTo(n,g,y),c=!0;else if(m=="o25"){for(;i.length>6;)g+=i.shift(),y+=i.shift(),r.U.P.lineTo(n,g,y);R=g+i.shift(),w=y+i.shift(),k=R+i.shift(),T=w+i.shift(),g=k+i.shift(),y=T+i.shift(),r.U.P.curveTo(n,R,w,k,T,g,y)}else if(m=="o26")for(i.length%2&&(g+=i.shift());i.length>0;)R=g,w=y+i.shift(),g=k=R+i.shift(),y=(T=w+i.shift())+i.shift(),r.U.P.curveTo(n,R,w,k,T,g,y);else if(m=="o27")for(i.length%2&&(y+=i.shift());i.length>0;)w=y,k=(R=g+i.shift())+i.shift(),T=w+i.shift(),g=k+i.shift(),y=T,r.U.P.curveTo(n,R,w,k,T,g,y);else if(m=="o10"||m=="o29"){var D=m=="o10"?o:a;if(i.length==0)console.debug("error: empty stack");else{var _=i.pop(),W=D.Subrs[_+D.Bias];e.x=g,e.y=y,e.nStems=s,e.haveWidth=l,e.width=u,e.open=c,r.U._drawCFF(W,e,a,o,n),g=e.x,y=e.y,s=e.nStems,l=e.haveWidth,u=e.width,c=e.open}}else if(m=="o30"||m=="o31"){var C=i.length,I=(Q=0,m=="o31");for(Q+=C-(B=-3&C);Q<B;)I?(w=y,k=(R=g+i.shift())+i.shift(),y=(T=w+i.shift())+i.shift(),B-Q==5?(g=k+i.shift(),Q++):g=k,I=!1):(R=g,w=y+i.shift(),k=R+i.shift(),T=w+i.shift(),g=k+i.shift(),B-Q==5?(y=T+i.shift(),Q++):y=T,I=!0),r.U.P.curveTo(n,R,w,k,T,g,y),Q+=4}else{if((m+"").charAt(0)=="o")throw console.debug("Unknown operation: "+m,t),m;i.push(m)}}}e.x=g,e.y=y,e.nStems=s,e.haveWidth=l,e.width=u,e.open=c};var d=r,f={Typr:d};return h.Typr=d,h.default=f,Object.defineProperty(h,"__esModule",{value:!0}),h}({}).Typr}function ka(){return function(h){var r=Uint8Array,d=Uint16Array,f=Uint32Array,t=new r([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),e=new r([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=function(m,B){for(var S=new d(31),V=0;V<31;++V)S[V]=B+=1<<m[V-1];var G=new f(S[30]);for(V=1;V<30;++V)for(var Q=S[V];Q<S[V+1];++Q)G[Q]=Q-S[V]<<5|V;return[S,G]},n=o(t,2),i=n[0],s=n[1];i[28]=258,s[258]=28;for(var l=o(e,0)[0],u=new d(32768),c=0;c<32768;++c){var p=(43690&c)>>>1|(21845&c)<<1;p=(61680&(p=(52428&p)>>>2|(13107&p)<<2))>>>4|(3855&p)<<4,u[c]=((65280&p)>>>8|(255&p)<<8)>>>1}var g=function(m,B,S){for(var V=m.length,G=0,Q=new d(B);G<V;++G)++Q[m[G]-1];var ie,P=new d(B);for(G=0;G<B;++G)P[G]=P[G-1]+Q[G-1]<<1;if(S){ie=new d(1<<B);var O=15-B;for(G=0;G<V;++G)if(m[G])for(var v=G<<4|m[G],x=B-m[G],F=P[m[G]-1]++<<x,D=F|(1<<x)-1;F<=D;++F)ie[u[F]>>>O]=v}else for(ie=new d(V),G=0;G<V;++G)m[G]&&(ie[G]=u[P[m[G]-1]++]>>>15-m[G]);return ie},y=new r(288);for(c=0;c<144;++c)y[c]=8;for(c=144;c<256;++c)y[c]=9;for(c=256;c<280;++c)y[c]=7;for(c=280;c<288;++c)y[c]=8;var R=new r(32);for(c=0;c<32;++c)R[c]=5;var w=g(y,9,1),k=g(R,5,1),T=function(m){for(var B=m[0],S=1;S<m.length;++S)m[S]>B&&(B=m[S]);return B},U=function(m,B,S){var V=B/8|0;return(m[V]|m[V+1]<<8)>>(7&B)&S},A=function(m,B){var S=B/8|0;return(m[S]|m[S+1]<<8|m[S+2]<<16)>>(7&B)},b=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],M=function(m,B,S){var V=new Error(B||b[m]);if(V.code=m,Error.captureStackTrace&&Error.captureStackTrace(V,M),!S)throw V;return V},z=function(m,B,S){var V=m.length;if(!V||S&&!S.l&&V<5)return B||new r(0);var G=!B||S,Q=!S||S.i;S||(S={}),B||(B=new r(3*V));var ie,P=function(le){var Ue=B.length;if(le>Ue){var Se=new r(Math.max(2*Ue,le));Se.set(B),B=Se}},O=S.f||0,v=S.p||0,x=S.b||0,F=S.l,D=S.d,_=S.m,W=S.n,C=8*V;do{if(!F){S.f=O=U(m,v,1);var I=U(m,v+1,3);if(v+=3,!I){var Y=m[(q=((ie=v)/8|0)+(7&ie&&1)+4)-4]|m[q-3]<<8,$=q+Y;if($>V){Q&&M(0);break}G&&P(x+Y),B.set(m.subarray(q,$),x),S.b=x+=Y,S.p=v=8*$;continue}if(I==1)F=w,D=k,_=9,W=5;else if(I==2){var X=U(m,v,31)+257,N=U(m,v+10,15)+4,pe=X+U(m,v+5,31)+1;v+=14;for(var ue=new r(pe),Z=new r(19),ee=0;ee<N;++ee)Z[a[ee]]=U(m,v+3*ee,7);v+=3*N;var se=T(Z),j=(1<<se)-1,te=g(Z,se,1);for(ee=0;ee<pe;){var q,L=te[U(m,v,j)];if(v+=15&L,(q=L>>>4)<16)ue[ee++]=q;else{var he=0,K=0;for(q==16?(K=3+U(m,v,3),v+=2,he=ue[ee-1]):q==17?(K=3+U(m,v,7),v+=3):q==18&&(K=11+U(m,v,127),v+=7);K--;)ue[ee++]=he}}var ne=ue.subarray(0,X),J=ue.subarray(X);_=T(ne),W=T(J),F=g(ne,_,1),D=g(J,W,1)}else M(1);if(v>C){Q&&M(0);break}}G&&P(x+131072);for(var be=(1<<_)-1,re=(1<<W)-1,ae=v;;ae=v){var fe=(he=F[A(m,v)&be])>>>4;if((v+=15&he)>C){Q&&M(0);break}if(he||M(2),fe<256)B[x++]=fe;else{if(fe==256){ae=v,F=null;break}var de=fe-254;if(fe>264){var _e=t[ee=fe-257];de=U(m,v,(1<<_e)-1)+i[ee],v+=_e}var Me=D[A(m,v)&re],ge=Me>>>4;if(Me||M(3),v+=15&Me,J=l[ge],ge>3&&(_e=e[ge],J+=A(m,v)&(1<<_e)-1,v+=_e),v>C){Q&&M(0);break}G&&P(x+131072);for(var me=x+de;x<me;x+=4)B[x]=B[x-J],B[x+1]=B[x+1-J],B[x+2]=B[x+2-J],B[x+3]=B[x+3-J];x=me}}S.l=F,S.p=ae,S.b=x,F&&(O=1,S.m=_,S.d=D,S.n=W)}while(!O);return x==B.length?B:function(le,Ue,Se){(Ue==null||Ue<0)&&(Ue=0),(Se==null||Se>le.length)&&(Se=le.length);var Re=new(le instanceof d?d:le instanceof f?f:r)(Se-Ue);return Re.set(le.subarray(Ue,Se)),Re}(B,0,x)},E=new r(0),H=typeof TextDecoder<"u"&&new TextDecoder;try{H.decode(E,{stream:!0})}catch{}return h.convert_streams=function(m){var B=new DataView(m),S=0;function V(){var X=B.getUint16(S);return S+=2,X}function G(){var X=B.getUint32(S);return S+=4,X}function Q(X){Y.setUint16($,X),$+=2}function ie(X){Y.setUint32($,X),$+=4}for(var P={signature:G(),flavor:G(),length:G(),numTables:V(),reserved:V(),totalSfntSize:G(),majorVersion:V(),minorVersion:V(),metaOffset:G(),metaLength:G(),metaOrigLength:G(),privOffset:G(),privLength:G()},O=0;Math.pow(2,O)<=P.numTables;)O++;O--;for(var v=16*Math.pow(2,O),x=16*P.numTables-v,F=12,D=[],_=0;_<P.numTables;_++)D.push({tag:G(),offset:G(),compLength:G(),origLength:G(),origChecksum:G()}),F+=16;var W,C=new Uint8Array(12+16*D.length+D.reduce(function(X,N){return X+N.origLength+4},0)),I=C.buffer,Y=new DataView(I),$=0;return ie(P.flavor),Q(P.numTables),Q(v),Q(O),Q(x),D.forEach(function(X){ie(X.tag),ie(X.origChecksum),ie(F),ie(X.origLength),X.outOffset=F,(F+=X.origLength)%4!=0&&(F+=4-F%4)}),D.forEach(function(X){var N,pe=m.slice(X.offset,X.offset+X.compLength);if(X.compLength!=X.origLength){var ue=new Uint8Array(X.origLength);N=new Uint8Array(pe,2),z(N,ue)}else ue=new Uint8Array(pe);C.set(ue,X.outOffset);var Z=0;(F=X.outOffset+X.origLength)%4!=0&&(Z=4-F%4),C.set(new Uint8Array(Z).buffer,X.outOffset+X.origLength),W=F+Z}),I.slice(0,W)},Object.defineProperty(h,"__esModule",{value:!0}),h}({}).convert_streams}function Ua(h,r){let d={M:2,L:2,Q:4,C:6,Z:0},f={C:"18g,ca,368,1kz",D:"17k,6,2,2+4,5+c,2+6,2+1,10+1,9+f,j+11,2+1,a,2,2+1,15+2,3,j+2,6+3,2+8,2,2,2+1,w+a,4+e,3+3,2,3+2,3+5,23+w,2f+4,3,2+9,2,b,2+3,3,1k+9,6+1,3+1,2+2,2+d,30g,p+y,1,1+1g,f+x,2,sd2+1d,jf3+4,f+3,2+4,2+2,b+3,42,2,4+2,2+1,2,3,t+1,9f+w,2,el+2,2+g,d+2,2l,2+1,5,3+1,2+1,2,3,6,16wm+1v",R:"17m+3,2,2,6+3,m,15+2,2+2,h+h,13,3+8,2,2,3+1,2,p+1,x,5+4,5,a,2,2,3,u,c+2,g+1,5,2+1,4+1,5j,6+1,2,b,2+2,f,2+1,1s+2,2,3+1,7,1ez0,2,2+1,4+4,b,4,3,b,42,2+2,4,3,2+1,2,o+3,ae,ep,x,2o+2,3+1,3,5+1,6",L:"x9u,jff,a,fd,jv",T:"4t,gj+33,7o+4,1+1,7c+18,2,2+1,2+1,2,21+a,2,1b+k,h,2u+6,3+5,3+1,2+3,y,2,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,3,7,6+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+d,1,1+1,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,ek,3+1,r+4,1e+4,6+5,2p+c,1+3,1,1+2,1+b,2db+2,3y,2p+v,ff+3,30+1,n9x,1+2,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,5s,6y+2,ea,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+9,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2,2b+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,470+8,at4+4,1o+6,t5,1s+3,2a,f5l+1,2+3,43o+2,a+7,1+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,1,gzau,v+2n,3l+6n"},t=1,e=2,a=4,o=8,n=16,i=32,s;function l(b){if(!s){let M={R:e,L:t,D:a,C:n,U:i,T:o};s=new Map;for(let z in f){let E=0;f[z].split(",").forEach(H=>{let[m,B]=H.split("+");m=parseInt(m,36),B=B?parseInt(B,36):0,s.set(E+=m,M[z]);for(let S=B;S--;)s.set(++E,M[z])})}}return s.get(b)||i}let u=1,c=2,p=3,g=4,y=[null,"isol","init","fina","medi"];function R(b){let M=new Uint8Array(b.length),z=i,E=u,H=-1;for(let m=0;m<b.length;m++){let B=b.codePointAt(m),S=l(B)|0,V=u;S&o||(z&(t|a|n)?S&(e|a|n)?(V=p,(E===u||E===p)&&M[H]++):S&(t|i)&&(E===c||E===g)&&M[H]--:z&(e|i)&&(E===c||E===g)&&M[H]--,E=M[m]=V,z=S,H=m,B>65535&&m++)}return M}function w(b,M){let z=[];for(let H=0;H<M.length;H++){let m=M.codePointAt(H);m>65535&&H++,z.push(h.U.codeToGlyph(b,m))}let E=b.GSUB;if(E){let{lookupList:H,featureList:m}=E,B,S=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws|ccmp)$/,V=[];m.forEach(G=>{if(S.test(G.tag))for(let Q=0;Q<G.tab.length;Q++){if(V[G.tab[Q]])continue;V[G.tab[Q]]=!0;let ie=H[G.tab[Q]],P=/^(isol|init|fina|medi)$/.test(G.tag);P&&!B&&(B=R(M));for(let O=0;O<z.length;O++)(!B||!P||y[B[O]]===G.tag)&&h.U._applySubs(z,O,ie,H)}})}return z}function k(b,M){let z=new Int16Array(M.length*3),E=0;for(;E<M.length;E++){let S=M[E];if(S===-1)continue;z[E*3+2]=b.hmtx.aWidth[S];let V=b.GPOS;if(V){let G=V.lookupList;for(let Q=0;Q<G.length;Q++){let ie=G[Q];for(let P=0;P<ie.tabs.length;P++){let O=ie.tabs[P];if(ie.ltype===1){if(h._lctf.coverageIndex(O.coverage,S)!==-1&&O.pos){B(O.pos,E);break}}else if(ie.ltype===2){let v=null,x=H();if(x!==-1){let F=h._lctf.coverageIndex(O.coverage,M[x]);if(F!==-1){if(O.fmt===1){let D=O.pairsets[F];for(let _=0;_<D.length;_++)D[_].gid2===S&&(v=D[_])}else if(O.fmt===2){let D=h.U._getGlyphClass(M[x],O.classDef1),_=h.U._getGlyphClass(S,O.classDef2);v=O.matrix[D][_]}if(v){v.val1&&B(v.val1,x),v.val2&&B(v.val2,E);break}}}}else if(ie.ltype===4){let v=h._lctf.coverageIndex(O.markCoverage,S);if(v!==-1){let x=H(m),F=x===-1?-1:h._lctf.coverageIndex(O.baseCoverage,M[x]);if(F!==-1){let D=O.markArray[v],_=O.baseArray[F][D.markClass];z[E*3]=_.x-D.x+z[x*3]-z[x*3+2],z[E*3+1]=_.y-D.y+z[x*3+1];break}}}else if(ie.ltype===6){let v=h._lctf.coverageIndex(O.mark1Coverage,S);if(v!==-1){let x=H();if(x!==-1){let F=M[x];if(T(b,F)===3){let D=h._lctf.coverageIndex(O.mark2Coverage,F);if(D!==-1){let _=O.mark1Array[v],W=O.mark2Array[D][_.markClass];z[E*3]=W.x-_.x+z[x*3]-z[x*3+2],z[E*3+1]=W.y-_.y+z[x*3+1];break}}}}}}}}else if(b.kern&&!b.cff){let G=H();if(G!==-1){let Q=b.kern.glyph1.indexOf(M[G]);if(Q!==-1){let ie=b.kern.rval[Q].glyph2.indexOf(S);ie!==-1&&(z[G*3+2]+=b.kern.rval[Q].vals[ie])}}}}return z;function H(S){for(let V=E-1;V>=0;V--)if(M[V]!==-1&&(!S||S(M[V])))return V;return-1}function m(S){return T(b,S)===1}function B(S,V){for(let G=0;G<3;G++)z[V*3+G]+=S[G]||0}}function T(b,M){let z=b.GDEF&&b.GDEF.glyphClassDef;return z?h.U._getGlyphClass(M,z):0}function U(...b){for(let M=0;M<b.length;M++)if(typeof b[M]=="number")return b[M]}function A(b){let M=Object.create(null),z=b["OS/2"],E=b.hhea,H=b.head.unitsPerEm,m=U(z&&z.sTypoAscender,E&&E.ascender,H),B={unitsPerEm:H,ascender:m,descender:U(z&&z.sTypoDescender,E&&E.descender,0),capHeight:U(z&&z.sCapHeight,m),xHeight:U(z&&z.sxHeight,m),lineGap:U(z&&z.sTypoLineGap,E&&E.lineGap),supportsCodePoint(S){return h.U.codeToGlyph(b,S)>0},forEachGlyph(S,V,G,Q){let ie=0,P=1/B.unitsPerEm*V,O=w(b,S),v=0,x=k(b,O);return O.forEach((F,D)=>{if(F!==-1){let _=M[F];if(!_){let{cmds:W,crds:C}=h.U.glyphToPath(b,F),I="",Y=0;for(let ue=0,Z=W.length;ue<Z;ue++){let ee=d[W[ue]];I+=W[ue];for(let se=1;se<=ee;se++)I+=(se>1?",":"")+C[Y++]}let $,X,N,pe;if(C.length){$=X=1/0,N=pe=-1/0;for(let ue=0,Z=C.length;ue<Z;ue+=2){let ee=C[ue],se=C[ue+1];ee<$&&($=ee),se<X&&(X=se),ee>N&&(N=ee),se>pe&&(pe=se)}}else $=N=X=pe=0;_=M[F]={index:F,advanceWidth:b.hmtx.aWidth[F],xMin:$,yMin:X,xMax:N,yMax:pe,path:I}}Q.call(null,_,ie+x[D*3]*P,x[D*3+1]*P,v),ie+=x[D*3+2]*P,G&&(ie+=G*V)}v+=S.codePointAt(v)>65535?2:1}),ie}};return B}return function(M){let z=new Uint8Array(M,0,4),E=h._bin.readASCII(z,0,4);if(E==="wOFF")M=r(M);else if(E==="wOF2")throw new Error("woff2 fonts not supported");return A(h.parse(M)[0])}}var Sa=ot({name:"Typr Font Parser",dependencies:[_a,ka,Ua],init(h,r,d){let f=h(),t=r();return d(f,t)}});function wa(){return function(h){var r=function(){this.buckets=new Map};r.prototype.add=function(k){var T=k>>5;this.buckets.set(T,(this.buckets.get(T)||0)|1<<(31&k))},r.prototype.has=function(k){var T=this.buckets.get(k>>5);return T!==void 0&&(T&1<<(31&k))!=0},r.prototype.serialize=function(){var k=[];return this.buckets.forEach(function(T,U){k.push((+U).toString(36)+":"+T.toString(36))}),k.join(",")},r.prototype.deserialize=function(k){var T=this;this.buckets.clear(),k.split(",").forEach(function(U){var A=U.split(":");T.buckets.set(parseInt(A[0],36),parseInt(A[1],36))})};var d=Math.pow(2,8),f=d-1,t=~f;function e(k){var T=function(A){return A&t}(k).toString(16),U=function(A){return(A&t)+d-1}(k).toString(16);return"codepoint-index/plane"+(k>>16)+"/"+T+"-"+U+".json"}function a(k,T){var U=k&f,A=T.codePointAt(U/6|0);return((A=(A||48)-48)&1<<U%6)!=0}function o(k,T){var U;(U=k,U.replace(/U\+/gi,"").replace(/^,+|,+$/g,"").split(/,+/).map(function(A){return A.split("-").map(function(b){return parseInt(b.trim(),16)})})).forEach(function(A){var b=A[0],M=A[1];M===void 0&&(M=b),T(b,M)})}function n(k,T){o(k,function(U,A){for(var b=U;b<=A;b++)T(b)})}var i={},s={},l=new WeakMap,u="https://cdn.jsdelivr.net/gh/lojjic/unicode-font-resolver@v1.0.1/packages/data";function c(k){var T=l.get(k);return T||(T=new r,n(k.ranges,function(U){return T.add(U)}),l.set(k,T)),T}var p,g=new Map;function y(k,T,U){return k[T]?T:k[U]?U:function(A){for(var b in A)return b}(k)}function R(k,T){var U=T;if(!k.includes(U)){U=1/0;for(var A=0;A<k.length;A++)Math.abs(k[A]-T)<Math.abs(U-T)&&(U=k[A])}return U}function w(k){return p||(p=new Set,n("9-D,20,85,A0,1680,2000-200A,2028-202F,205F,3000",function(T){p.add(T)})),p.has(k)}return h.CodePointSet=r,h.clearCache=function(){i={},s={}},h.getFontsForString=function(k,T){T===void 0&&(T={});var U,A=T.lang;A===void 0&&(A=new RegExp("\\p{Script=Hangul}","u").test(U=k)?"ko":new RegExp("\\p{Script=Hiragana}|\\p{Script=Katakana}","u").test(U)?"ja":"en");var b=T.category;b===void 0&&(b="sans-serif");var M=T.style;M===void 0&&(M="normal");var z=T.weight;z===void 0&&(z=400);var E=(T.dataUrl||u).replace(/\/$/g,""),H=new Map,m=new Uint8Array(k.length),B={},S={},V=new Array(k.length),G=new Map,Q=!1;function ie(v){var x=g.get(v);return x||(x=fetch(E+"/"+v).then(function(F){if(!F.ok)throw new Error(F.statusText);return F.json().then(function(D){if(!Array.isArray(D)||D[0]!==1)throw new Error("Incorrect schema version; need 1, got "+D[0]);return D[1]})}).catch(function(F){if(E!==u)return Q||(console.error('unicode-font-resolver: Failed loading from dataUrl "'+E+'", trying default CDN. '+F.message),Q=!0),E=u,g.delete(v),ie(v);throw F}),g.set(v,x)),x}for(var P=function(v){var x=k.codePointAt(v),F=e(x);V[v]=F,i[F]||G.has(F)||G.set(F,ie(F).then(function(D){i[F]=D})),x>65535&&(v++,O=v)},O=0;O<k.length;O++)P(O);return Promise.all(G.values()).then(function(){G.clear();for(var v=function(F){var D=k.codePointAt(F),_=null,W=i[V[F]],C=void 0;for(var I in W){var Y=S[I];if(Y===void 0&&(Y=S[I]=new RegExp(I).test(A||"en")),Y){for(var $ in C=I,W[I])if(a(D,W[I][$])){_=$;break}break}}if(!_){e:for(var X in W)if(X!==C){for(var N in W[X])if(a(D,W[X][N])){_=N;break e}}}_||(console.debug("No font coverage for U+"+D.toString(16)),_="latin"),V[F]=_,s[_]||G.has(_)||G.set(_,ie("font-meta/"+_+".json").then(function(pe){s[_]=pe})),D>65535&&(F++,x=F)},x=0;x<k.length;x++)v(x);return Promise.all(G.values())}).then(function(){for(var v,x=null,F=0;F<k.length;F++){var D=k.codePointAt(F);if(x&&(w(D)||c(x).has(D)))m[F]=m[F-1];else{x=s[V[F]];var _=B[x.id];if(!_){var W=x.typeforms,C=y(W,b,"sans-serif"),I=y(W[C],M,"normal"),Y=R((v=W[C])===null||v===void 0?void 0:v[I],z);_=B[x.id]=E+"/font-files/"+x.id+"/"+C+"."+I+"."+Y+".woff"}var $=H.get(_);$==null&&($=H.size,H.set(_,$)),m[F]=$}D>65535&&(F++,m[F]=m[F-1])}return{fontUrls:Array.from(H.keys()),chars:m}})},Object.defineProperty(h,"__esModule",{value:!0}),h}({})}function Fa(h,r){let d=Object.create(null),f=Object.create(null);function t(a,o){let n=i=>{console.error("Failure loading font ".concat(a),i)};try{let i=new XMLHttpRequest;i.open("get",a,!0),i.responseType="arraybuffer",i.onload=function(){if(i.status>=400)n(new Error(i.statusText));else if(i.status>0)try{let s=h(i.response);s.src=a,o(s)}catch(s){n(s)}},i.onerror=n,i.send()}catch(i){n(i)}}function e(a,o){let n=d[a];n?o(n):f[a]?f[a].push(o):(f[a]=[o],t(a,i=>{i.src=a,d[a]=i,f[a].forEach(s=>s(i)),delete f[a]}))}return function(a,o,{lang:n,fonts:i=[],style:s="normal",weight:l="normal",unicodeFontsURL:u}={}){let c=new Uint8Array(a.length),p=[];a.length||w();let g=new Map,y=[];if(s!=="italic"&&(s="normal"),typeof l!="number"&&(l=l==="bold"?700:400),i&&!Array.isArray(i)&&(i=[i]),i=i.slice().filter(T=>!T.lang||T.lang.test(n)).reverse(),i.length){let b=0;(function M(z=0){for(let E=z,H=a.length;E<H;E++){let m=a.codePointAt(E);if(b===1&&p[c[E-1]].supportsCodePoint(m)||E>0&&/\s/.test(a[E]))c[E]=c[E-1],b===2&&(y[y.length-1][1]=E);else for(let B=c[E],S=i.length;B<=S;B++)if(B===S){let V=b===2?y[y.length-1]:y[y.length]=[E,E];V[1]=E,b=2}else{c[E]=B;let{src:V,unicodeRange:G}=i[B];if(!G||k(m,G)){let Q=d[V];if(!Q){e(V,()=>{M(E)});return}if(Q.supportsCodePoint(m)){let ie=g.get(Q);typeof ie!="number"&&(ie=p.length,p.push(Q),g.set(Q,ie)),c[E]=ie,b=1;break}}}m>65535&&E+1<H&&(c[E+1]=c[E],E++,b===2&&(y[y.length-1][1]=E))}R()})()}else y.push([0,a.length-1]),R();function R(){if(y.length){let T=y.map(U=>a.substring(U[0],U[1]+1)).join("\n");r.getFontsForString(T,{lang:n||void 0,style:s,weight:l,dataUrl:u}).then(({fontUrls:U,chars:A})=>{let b=p.length,M=0;y.forEach(E=>{for(let H=0,m=E[1]-E[0];H<=m;H++)c[E[0]+H]=A[M++]+b;M++});let z=0;U.forEach((E,H)=>{e(E,m=>{p[H+b]=m,++z===U.length&&w()})})})}else w()}function w(){o({chars:c,fonts:p})}function k(T,U){for(let A=0;A<U.length;A++){let[b,M=b]=U[A];if(b<=T&&T<=M)return!0}return!1}}}var Ma=ot({name:"FontResolver",dependencies:[Fa,Sa,wa],init(h,r,d){return h(r,d())}});function Aa(h,r){let f=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,t="[^\\S\\u00A0]",e=new RegExp("".concat(t,"|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]"));function a({text:p,lang:g,fonts:y,style:R,weight:w,preResolvedFonts:k,unicodeFontsURL:T},U){let A=({chars:b,fonts:M})=>{let z,E,H=[];for(let m=0;m<b.length;m++)b[m]!==E?(E=b[m],H.push(z={start:m,end:m,fontObj:M[b[m]]})):z.end=m;U(H)};k?A(k):h(p,A,{lang:g,fonts:y,style:R,weight:w,unicodeFontsURL:T})}function o({text:p="",font:g,lang:y,sdfGlyphSize:R=64,fontSize:w=400,fontWeight:k=1,fontStyle:T="normal",letterSpacing:U=0,lineHeight:A="normal",maxWidth:b=1/0,direction:M,textAlign:z="left",textIndent:E=0,whiteSpace:H="normal",overflowWrap:m="normal",anchorX:B=0,anchorY:S=0,metricsOnly:V=!1,unicodeFontsURL:G,preResolvedFonts:Q=null,includeCaretPositions:ie=!1,chunkedBoundsSize:P=8192,colorRanges:O=null},v){let x=l(),F={fontLoad:0,typesetting:0};p.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),p=p.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),w=+w,U=+U,b=+b,A=A||"normal",E=+E,a({text:p,lang:y,style:T,weight:k,fonts:typeof g=="string"?[{src:g}]:g,unicodeFontsURL:G,preResolvedFonts:Q},D=>{F.fontLoad=l()-x;let _=isFinite(b),W=null,C=null,I=null,Y=null,$=null,X=null,N=null,pe=null,ue=0,Z=0,ee=H!=="nowrap",se=new Map,j=l(),te=E,q=0,L=new u,he=[L];D.forEach(re=>{let{fontObj:ae}=re,{ascender:fe,descender:de,unitsPerEm:_e,lineGap:Me,capHeight:ge,xHeight:me}=ae,le=se.get(ae);if(!le){let ce=w/_e,xe=A==="normal"?(fe-de+Me)*ce:A*w,Qe=(xe-(fe-de)*ce)/2,Te=Math.min(xe,(fe-de)*ce),ye=(fe+de)/2*ce+Te/2;le={index:se.size,src:ae.src,fontObj:ae,fontSizeMult:ce,unitsPerEm:_e,ascender:fe*ce,descender:de*ce,capHeight:ge*ce,xHeight:me*ce,lineHeight:xe,baseline:-Qe-fe*ce,caretTop:ye,caretBottom:ye-Te},se.set(ae,le)}let{fontSizeMult:Ue}=le,Se=p.slice(re.start,re.end+1),Re,ke;ae.forEachGlyph(Se,w,U,(ce,xe,Qe,Te)=>{xe+=q,Te+=re.start,Re=xe,ke=ce;let ye=p.charAt(Te),Ae=ce.advanceWidth*Ue,we=L.count,ve;if("isEmpty"in ce||(ce.isWhitespace=!!ye&&new RegExp(t).test(ye),ce.canBreakAfter=!!ye&&e.test(ye),ce.isEmpty=ce.xMin===ce.xMax||ce.yMin===ce.yMax||f.test(ye)),!ce.isWhitespace&&!ce.isEmpty&&Z++,ee&&_&&!ce.isWhitespace&&xe+Ae+te>b&&we){if(L.glyphAt(we-1).glyphObj.canBreakAfter)ve=new u,te=-xe;else for(let Be=we;Be--;)if(Be===0&&m==="break-word"){ve=new u,te=-xe;break}else if(L.glyphAt(Be).glyphObj.canBreakAfter){ve=L.splitAt(Be+1);let Ee=ve.glyphAt(0).x;te-=Ee;for(let De=ve.count;De--;)ve.glyphAt(De).x-=Ee;break}ve&&(L.isSoftWrapped=!0,L=ve,he.push(L),ue=b)}let Fe=L.glyphAt(L.count);Fe.glyphObj=ce,Fe.x=xe+te,Fe.y=Qe,Fe.width=Ae,Fe.charIndex=Te,Fe.fontData=le,ye==="\n"&&(L=new u,he.push(L),te=-(xe+Ae+U*w)+E)}),q=Re+ke.advanceWidth*Ue+U*w});let K=0;he.forEach(re=>{let ae=!0;for(let fe=re.count;fe--;){let de=re.glyphAt(fe);ae&&!de.glyphObj.isWhitespace&&(re.width=de.x+de.width,re.width>ue&&(ue=re.width),ae=!1);let{lineHeight:_e,capHeight:Me,xHeight:ge,baseline:me}=de.fontData;_e>re.lineHeight&&(re.lineHeight=_e);let le=me-re.baseline;le<0&&(re.baseline+=le,re.cap+=le,re.ex+=le),re.cap=Math.max(re.cap,re.baseline+Me),re.ex=Math.max(re.ex,re.baseline+ge)}re.baseline-=K,re.cap-=K,re.ex-=K,K+=re.lineHeight});let ne=0,J=0;if(B&&(typeof B=="number"?ne=-B:typeof B=="string"&&(ne=-ue*(B==="left"?0:B==="center"?.5:B==="right"?1:i(B)))),S&&(typeof S=="number"?J=-S:typeof S=="string"&&(J=S==="top"?0:S==="top-baseline"?-he[0].baseline:S==="top-cap"?-he[0].cap:S==="top-ex"?-he[0].ex:S==="middle"?K/2:S==="bottom"?K:S==="bottom-baseline"?-he[he.length-1].baseline:i(S)*K)),!V){let re=r.getEmbeddingLevels(p,M);W=new Uint16Array(Z),C=new Uint8Array(Z),I=new Float32Array(Z*2),Y={},N=[1/0,1/0,-1/0,-1/0],pe=[],ie&&(X=new Float32Array(p.length*4)),O&&($=new Uint8Array(Z*3));let ae=0,fe=-1,de=-1,_e,Me;if(he.forEach((ge,me)=>{let{count:le,width:Ue}=ge;if(le>0){let Se=0;for(let Te=le;Te--&&ge.glyphAt(Te).glyphObj.isWhitespace;)Se++;let Re=0,ke=0;if(z==="center")Re=(ue-Ue)/2;else if(z==="right")Re=ue-Ue;else if(z==="justify"&&ge.isSoftWrapped){let Te=0;for(let ye=le-Se;ye--;)ge.glyphAt(ye).glyphObj.isWhitespace&&Te++;ke=(ue-Ue)/Te}if(ke||Re){let Te=0;for(let ye=0;ye<le;ye++){let Ae=ge.glyphAt(ye),we=Ae.glyphObj;Ae.x+=Re+Te,ke!==0&&we.isWhitespace&&ye<le-Se&&(Te+=ke,Ae.width+=ke)}}let ce=r.getReorderSegments(p,re,ge.glyphAt(0).charIndex,ge.glyphAt(ge.count-1).charIndex);for(let Te=0;Te<ce.length;Te++){let[ye,Ae]=ce[Te],we=1/0,ve=-1/0;for(let Fe=0;Fe<le;Fe++)if(ge.glyphAt(Fe).charIndex>=ye){let Be=Fe,Ee=Fe;for(;Ee<le;Ee++){let De=ge.glyphAt(Ee);if(De.charIndex>Ae)break;Ee<le-Se&&(we=Math.min(we,De.x),ve=Math.max(ve,De.x+De.width))}for(let De=Be;De<Ee;De++){let We=ge.glyphAt(De);We.x=ve-(We.x+We.width-we)}break}}let xe,Qe=Te=>xe=Te;for(let Te=0;Te<le;Te++){let ye=ge.glyphAt(Te);xe=ye.glyphObj;let Ae=xe.index,we=re.levels[ye.charIndex]&1;if(we){let ve=r.getMirroredCharacter(p[ye.charIndex]);ve&&ye.fontData.fontObj.forEachGlyph(ve,0,0,Qe)}if(ie){let{charIndex:ve,fontData:Fe}=ye,Be=ye.x+ne,Ee=ye.x+ye.width+ne;X[ve*4]=we?Ee:Be,X[ve*4+1]=we?Be:Ee,X[ve*4+2]=ge.baseline+Fe.caretBottom+J,X[ve*4+3]=ge.baseline+Fe.caretTop+J;let De=ve-fe;De>1&&s(X,fe,De),fe=ve}if(O){let{charIndex:ve}=ye;for(;ve>de;)de++,O.hasOwnProperty(de)&&(Me=O[de])}if(!xe.isWhitespace&&!xe.isEmpty){let ve=ae++,{fontSizeMult:Fe,src:Be,index:Ee}=ye.fontData,De=Y[Be]||(Y[Be]={});De[Ae]||(De[Ae]={path:xe.path,pathBounds:[xe.xMin,xe.yMin,xe.xMax,xe.yMax]});let We=ye.x+ne,Ze=ye.y+ge.baseline+J;I[ve*2]=We,I[ve*2+1]=Ze;let Ye=We+xe.xMin*Fe,qe=Ze+xe.yMin*Fe,rt=We+xe.xMax*Fe,Je=Ze+xe.yMax*Fe;Ye<N[0]&&(N[0]=Ye),qe<N[1]&&(N[1]=qe),rt>N[2]&&(N[2]=rt),Je>N[3]&&(N[3]=Je),ve%P===0&&(_e={start:ve,end:ve,rect:[1/0,1/0,-1/0,-1/0]},pe.push(_e)),_e.end++;let Oe=_e.rect;if(Ye<Oe[0]&&(Oe[0]=Ye),qe<Oe[1]&&(Oe[1]=qe),rt>Oe[2]&&(Oe[2]=rt),Je>Oe[3]&&(Oe[3]=Je),W[ve]=Ae,C[ve]=Ee,O){let nt=ve*3;$[nt]=Me>>16&255,$[nt+1]=Me>>8&255,$[nt+2]=Me&255}}}}}),X){let ge=p.length-fe;ge>1&&s(X,fe,ge)}}let be=[];se.forEach(({index:re,src:ae,unitsPerEm:fe,ascender:de,descender:_e,lineHeight:Me,capHeight:ge,xHeight:me})=>{be[re]={src:ae,unitsPerEm:fe,ascender:de,descender:_e,lineHeight:Me,capHeight:ge,xHeight:me}}),F.typesetting=l()-j,v({glyphIds:W,glyphFontIndices:C,glyphPositions:I,glyphData:Y,fontData:be,caretPositions:X,glyphColors:$,chunkedBounds:pe,fontSize:w,topBaseline:J+he[0].baseline,blockBounds:[ne,J-K,ne+ue,J],visibleBounds:N,timings:F})})}function n(p,g){o({...p,metricsOnly:!0},y=>{let[R,w,k,T]=y.blockBounds;g({width:k-R,height:T-w})})}function i(p){let g=p.match(/^([\d.]+)%$/),y=g?parseFloat(g[1]):NaN;return isNaN(y)?0:y/100}function s(p,g,y){let R=p[g*4],w=p[g*4+1],k=p[g*4+2],T=p[g*4+3],U=(w-R)/y;for(let A=0;A<y;A++){let b=(g+A)*4;p[b]=R+U*A,p[b+1]=R+U*(A+1),p[b+2]=k,p[b+3]=T}}function l(){return(self.performance||Date).now()}function u(){this.data=[]}let c=["glyphObj","x","y","width","charIndex","fontData"];return u.prototype={width:0,lineHeight:0,baseline:0,cap:0,ex:0,isSoftWrapped:!1,get count(){return Math.ceil(this.data.length/c.length)},glyphAt(p){let g=u.flyweight;return g.data=this.data,g.index=p,g},splitAt(p){let g=new u;return g.data=this.data.splice(p*c.length),g}},u.flyweight=c.reduce((p,g,y,R)=>(Object.defineProperty(p,g,{get(){return this.data[this.index*c.length+y]},set(w){this.data[this.index*c.length+y]=w}}),p),{data:null,index:0}),{typeset:o,measure:n}}var lt=()=>(self.performance||Date).now(),qt=Fr(),On;function Da(h,r,d,f,t,e,a,o,n,i,s=!0){return s?Ea(h,r,d,f,t,e,a,o,n,i).then(null,l=>(On||(console.warn("WebGL SDF generation failed, falling back to JS",l),On=!0),Ln(h,r,d,f,t,e,a,o,n,i))):Ln(h,r,d,f,t,e,a,o,n,i)}var Qt=[],Ca=5,Br=0;function Xn(){let h=lt();for(;Qt.length&<()-h<Ca;)Qt.shift()();Br=Qt.length?setTimeout(Xn,0):0}var Ea=(...h)=>new Promise((r,d)=>{Qt.push(()=>{let f=lt();try{qt.webgl.generateIntoCanvas(...h),r({timing:lt()-f})}catch(t){d(t)}}),Br||(Br=setTimeout(Xn,0))}),Ba=4,Oa=2e3,Rn={},Ra=0;function Ln(h,r,d,f,t,e,a,o,n,i){let s="TroikaTextSDFGenerator_JS_"+Ra++%Ba,l=Rn[s];return l||(l=Rn[s]={workerModule:ot({name:s,workerId:s,dependencies:[Fr,lt],init(u,c){let p=u().javascript.generate;return function(...g){let y=c();return{textureData:p(...g),timing:c()-y}}},getTransferables(u){return[u.textureData.buffer]}}),requests:0,idleTimer:null}),l.requests++,clearTimeout(l.idleTimer),l.workerModule(h,r,d,f,t,e).then(({textureData:u,timing:c})=>{let p=lt(),g=new Uint8Array(u.length*4);for(let y=0;y<u.length;y++)g[y*4+i]=u[y];return qt.webglUtils.renderImageData(a,g,o,n,h,r,1<<3-i),c+=lt()-p,--l.requests===0&&(l.idleTimer=setTimeout(()=>{Mn(s)},Oa)),{timing:c}})}function La(h){h._warm||(qt.webgl.isSupported(h),h._warm=!0)}var Ga=qt.webglUtils.resizeWebGLCanvasWithoutClearing,st={defaultFontURL:null,unicodeFontsURL:null,sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048,useWorker:!0},Pa=new Ft,Ia=!1;function vt(){return(self.performance||Date).now()}var Gn=Object.create(null);function Hn(h,r){Ia=!0,h=Wa({},h);let d=vt(),{defaultFontURL:f}=st,t=[];if(f&&t.push({label:"default",src:Pn(f)}),h.font&&t.push({label:"user",src:Pn(h.font)}),h.font=t,h.text=""+h.text,h.sdfGlyphSize=h.sdfGlyphSize||st.sdfGlyphSize,h.unicodeFontsURL=h.unicodeFontsURL||st.unicodeFontsURL,h.colorRanges!=null){let c={};for(let p in h.colorRanges)if(h.colorRanges.hasOwnProperty(p)){let g=h.colorRanges[p];typeof g!="number"&&(g=Pa.set(g).getHex()),c[p]=g}h.colorRanges=c}Object.freeze(h);let{textureWidth:e,sdfExponent:a}=st,{sdfGlyphSize:o}=h,n=e/o*4,i=Gn[o];if(!i){let c=document.createElement("canvas");c.width=e,c.height=o*256/n,i=Gn[o]={glyphCount:0,sdfGlyphSize:o,sdfCanvas:c,sdfTexture:new pn(c,void 0,void 0,void 0,_r,_r),contextLost:!1,glyphsByFont:new Map},i.sdfTexture.generateMipmaps=!1,za(i)}let{sdfTexture:s,sdfCanvas:l}=i;(st.useWorker?Kn:Va)(h).then(c=>{let{glyphIds:p,glyphFontIndices:g,fontData:y,glyphPositions:R,fontSize:w,timings:k}=c,T=[],U=new Float32Array(p.length*4),A=0,b=0,M=vt(),z=y.map(S=>{let V=i.glyphsByFont.get(S.src);return V||i.glyphsByFont.set(S.src,V=new Map),V});p.forEach((S,V)=>{let G=g[V],{src:Q,unitsPerEm:ie}=y[G],P=z[G].get(S);if(!P){let{path:D,pathBounds:_}=c.glyphData[Q][S],W=Math.max(_[2]-_[0],_[3]-_[1])/o*(st.sdfMargin*o+.5),C=i.glyphCount++,I=[_[0]-W,_[1]-W,_[2]+W,_[3]+W];z[G].set(S,P={path:D,atlasIndex:C,sdfViewBox:I}),T.push(P)}let{sdfViewBox:O}=P,v=R[b++],x=R[b++],F=w/ie;U[A++]=v+O[0]*F,U[A++]=x+O[1]*F,U[A++]=v+O[2]*F,U[A++]=x+O[3]*F,p[V]=P.atlasIndex}),k.quads=(k.quads||0)+(vt()-M);let E=vt();k.sdf={};let H=l.height,m=Math.ceil(i.glyphCount/n),B=Math.pow(2,Math.ceil(Math.log2(m*o)));B>H&&(console.info("Increasing SDF texture size ".concat(H,"->").concat(B)),Ga(l,e,B),s.dispose()),Promise.all(T.map(S=>Yn(S,i,h.gpuAccelerateSDF).then(({timing:V})=>{k.sdf[S.atlasIndex]=V}))).then(()=>{T.length&&!i.contextLost&&(Jn(i),s.needsUpdate=!0),k.sdfTotal=vt()-E,k.total=vt()-d,r(Object.freeze({parameters:h,sdfTexture:s,sdfGlyphSize:o,sdfExponent:a,glyphBounds:U,glyphAtlasIndices:p,glyphColors:c.glyphColors,caretPositions:c.caretPositions,chunkedBounds:c.chunkedBounds,ascender:c.ascender,descender:c.descender,lineHeight:c.lineHeight,capHeight:c.capHeight,xHeight:c.xHeight,topBaseline:c.topBaseline,blockBounds:c.blockBounds,visibleBounds:c.visibleBounds,timings:c.timings}))})}),Promise.resolve().then(()=>{i.contextLost||La(l)})}function Yn({path:h,atlasIndex:r,sdfViewBox:d},{sdfGlyphSize:f,sdfCanvas:t,contextLost:e},a){if(e)return Promise.resolve({timing:-1});let{textureWidth:o,sdfExponent:n}=st,i=Math.max(d[2]-d[0],d[3]-d[1]),s=Math.floor(r/4),l=s%(o/f)*f,u=Math.floor(s/(o/f))*f,c=r%4;return Da(f,f,h,d,i,n,t,l,u,c,a)}function za(h){let r=h.sdfCanvas;r.addEventListener("webglcontextlost",d=>{console.log("Context Lost",d),d.preventDefault(),h.contextLost=!0}),r.addEventListener("webglcontextrestored",d=>{console.log("Context Restored",d),h.contextLost=!1;let f=[];h.glyphsByFont.forEach(t=>{t.forEach(e=>{f.push(Yn(e,h,!0))})}),Promise.all(f).then(()=>{Jn(h),h.sdfTexture.needsUpdate=!0})})}function Gr({font:h,characters:r,sdfGlyphSize:d},f){let t=Array.isArray(r)?r.join("\n"):""+r;Hn({font:h,sdfGlyphSize:d,text:t},f)}function Wa(h,r){for(let d in r)r.hasOwnProperty(d)&&(h[d]=r[d]);return h}var Jt;function Pn(h){return Jt||(Jt=typeof document>"u"?{}:document.createElement("a")),Jt.href=h,Jt.href}function Jn(h){if(typeof createImageBitmap!="function"){console.info("Safari<15: applying SDF canvas workaround");let{sdfCanvas:r,sdfTexture:d}=h,{width:f,height:t}=r,e=h.sdfCanvas.getContext("webgl"),a=d.image.data;(!a||a.length!==f*t*4)&&(a=new Uint8Array(f*t*4),d.image={width:f,height:t,data:a},d.flipY=!1,d.isDataTexture=!0),e.readPixels(0,0,f,t,e.RGBA,e.UNSIGNED_BYTE,a)}}var Na=ot({name:"Typesetter",dependencies:[Aa,Ma,An],init(h,r,d){return h(r,d())}}),Kn=ot({name:"Typesetter",dependencies:[Na],init(h){return function(r){return new Promise(d=>{h.typeset(r,d)})}},getTransferables(h){let r=[];for(let d in h)h[d]&&h[d].buffer&&r.push(h[d].buffer);return r}}),Va=Kn.onMainThread;var In={};function ja(h){let r=In[h];return r||(r=In[h]=new Ht(1,1,h,h).translate(.5,.5,0)),r}var Zt="aTroikaGlyphBounds",Et="aTroikaGlyphIndex",Xa="aTroikaGlyphColor",Or=class extends Un{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new gn,this.boundingBox=new Ur}computeBoundingSphere(){}computeBoundingBox(){}set detail(r){if(r!==this._detail){this._detail=r,(typeof r!="number"||r<1)&&(r=1);let d=ja(r);["position","normal","uv"].forEach(f=>{this.attributes[f]=d.attributes[f].clone()}),this.setIndex(d.getIndex().clone())}}get detail(){return this._detail}set curveRadius(r){r!==this._curveRadius&&(this._curveRadius=r,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(r,d,f,t,e){this.updateAttributeData(Zt,r,4),this.updateAttributeData(Et,d,1),this.updateAttributeData(Xa,e,3),this._blockBounds=f,this._chunkedBounds=t,this.instanceCount=d.length,this._updateBounds()}_updateBounds(){let r=this._blockBounds;if(r){let{curveRadius:d,boundingBox:f}=this;if(d){let{PI:t,floor:e,min:a,max:o,sin:n,cos:i}=Math,s=t/2,l=t*2,u=Math.abs(d),c=r[0]/u,p=r[2]/u,g=e((c+s)/l)!==e((p+s)/l)?-u:a(n(c)*u,n(p)*u),y=e((c-s)/l)!==e((p-s)/l)?u:o(n(c)*u,n(p)*u),R=e((c+t)/l)!==e((p+t)/l)?u*2:o(u-i(c)*u,u-i(p)*u);f.min.set(g,r[1],d<0?-R:0),f.max.set(y,r[3],d<0?0:R)}else f.min.set(r[0],r[1],0),f.max.set(r[2],r[3],0);f.getBoundingSphere(this.boundingSphere)}}applyClipRect(r){let d=this.getAttribute(Et).count,f=this._chunkedBounds;if(f)for(let t=f.length;t--;){d=f[t].end;let e=f[t].rect;if(e[1]<r.w&&e[3]>r.y&&e[0]<r.z&&e[2]>r.x)break}this.instanceCount=d}updateAttributeData(r,d,f){let t=this.getAttribute(r);d?t&&t.array.length===d.length?(t.array.set(d),t.needsUpdate=!0):(this.setAttribute(r,new kn(d,f)),delete this._maxInstanceCount,this.dispose()):t&&this.deleteAttribute(r)}},Ha="\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform vec4 uTroikaTotalBounds;\nuniform vec4 uTroikaClipRect;\nuniform mat3 uTroikaOrient;\nuniform bool uTroikaUseGlyphColors;\nuniform float uTroikaEdgeOffset;\nuniform float uTroikaBlurRadius;\nuniform vec2 uTroikaPositionOffset;\nuniform float uTroikaCurveRadius;\nattribute vec4 aTroikaGlyphBounds;\nattribute float aTroikaGlyphIndex;\nattribute vec3 aTroikaGlyphColor;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec3 vTroikaGlyphColor;\nvarying vec2 vTroikaGlyphDimensions;\n",Ya="\nvec4 bounds = aTroikaGlyphBounds;\nbounds.xz += uTroikaPositionOffset.x;\nbounds.yw -= uTroikaPositionOffset.y;\n\nvec4 outlineBounds = vec4(\n bounds.xy - uTroikaEdgeOffset - uTroikaBlurRadius,\n bounds.zw + uTroikaEdgeOffset + uTroikaBlurRadius\n);\nvec4 clippedBounds = vec4(\n clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw),\n clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw)\n);\n\nvec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy);\n\nposition.xy = mix(bounds.xy, bounds.zw, clippedXY);\n\nuv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy);\n\nfloat rad = uTroikaCurveRadius;\nif (rad != 0.0) {\n float angle = position.x / rad;\n position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad);\n normal.xz = vec2(sin(angle), cos(angle));\n}\n \nposition = uTroikaOrient * position;\nnormal = uTroikaOrient * normal;\n\nvTroikaGlyphUV = clippedXY.xy;\nvTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]);\n\n\nfloat txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize;\nvec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize;\nvec2 txStartUV = txUvPerSquare * vec2(\n mod(floor(aTroikaGlyphIndex / 4.0), txCols),\n floor(floor(aTroikaGlyphIndex / 4.0) / txCols)\n);\nvTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare);\nvTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0);\n",Ja="\nuniform sampler2D uTroikaSDFTexture;\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform float uTroikaSDFExponent;\nuniform float uTroikaEdgeOffset;\nuniform float uTroikaFillOpacity;\nuniform float uTroikaBlurRadius;\nuniform vec3 uTroikaStrokeColor;\nuniform float uTroikaStrokeWidth;\nuniform float uTroikaStrokeOpacity;\nuniform bool uTroikaSDFDebug;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec2 vTroikaGlyphDimensions;\n\nfloat troikaSdfValueToSignedDistance(float alpha) {\n // Inverse of exponential encoding in webgl-sdf-generator\n \n float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y);\n float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension;\n float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0);\n return signedDist;\n}\n\nfloat troikaGlyphUvToSdfValue(vec2 glyphUV) {\n vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV);\n vec4 rgba = texture2D(uTroikaSDFTexture, textureUV);\n float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1\n return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a;\n}\n\nfloat troikaGlyphUvToDistance(vec2 uv) {\n return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv));\n}\n\nfloat troikaGetAADist() {\n \n #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300\n return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5;\n #else\n return vTroikaGlyphDimensions.x / 64.0;\n #endif\n}\n\nfloat troikaGetFragDistValue() {\n vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize);\n float distance = troikaGlyphUvToDistance(clampedGlyphUV);\n \n // Extrapolate distance when outside bounds:\n distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : \n length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions);\n\n \n\n return distance;\n}\n\nfloat troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) {\n #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL)\n float alpha = step(-distanceOffset, -distance);\n #else\n\n float alpha = smoothstep(\n distanceOffset + aaDist,\n distanceOffset - aaDist,\n distance\n );\n #endif\n\n return alpha;\n}\n",Ka="\nfloat aaDist = troikaGetAADist();\nfloat fragDistance = troikaGetFragDistValue();\nfloat edgeAlpha = uTroikaSDFDebug ?\n troikaGlyphUvToSdfValue(vTroikaGlyphUV) :\n troikaGetEdgeAlpha(fragDistance, uTroikaEdgeOffset, max(aaDist, uTroikaBlurRadius));\n\n#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL)\nvec4 fillRGBA = gl_FragColor;\nfillRGBA.a *= uTroikaFillOpacity;\nvec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity);\nif (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb;\ngl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep(\n -uTroikaStrokeWidth - aaDist,\n -uTroikaStrokeWidth + aaDist,\n fragDistance\n));\ngl_FragColor.a *= edgeAlpha;\n#endif\n\nif (edgeAlpha == 0.0) {\n discard;\n}\n";function Qn(h){let r=dt(h,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new at},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new kr(0,0,0,0)},uTroikaClipRect:{value:new kr(0,0,0,0)},uTroikaEdgeOffset:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new at},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new Ft},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new vn},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:Ha,vertexTransform:Ya,fragmentDefs:Ja,fragmentColorTransform:Ka,customRewriter({vertexShader:d,fragmentShader:f}){let t=/\buniform\s+vec3\s+diffuse\b/;return t.test(f)&&(f=f.replace(t,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),t.test(d)||(d=d.replace(Ar,"uniform vec3 diffuse;\n$&\nvTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;\n"))),{vertexShader:d,fragmentShader:f}}});return r.transparent=!0,r.forceSinglePass=!0,Object.defineProperties(r,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),r}var Pr=new mn({color:16777215,side:Tr,transparent:!0}),zn=8421504,Wn=new wt,Kt=new Xe,Dr=new Xe,Ct=[],Qa=new Xe,Cr="+x+y";function Nn(h){return Array.isArray(h)?h[0]:h}var Zn=()=>{let h=new Mt(new Ht(1,1),Pr);return Zn=()=>h,h},qn=()=>{let h=new Mt(new Ht(1,1,32,1),Pr);return qn=()=>h,h},Za={type:"syncstart"},qa={type:"synccomplete"},$n=["font","fontSize","fontStyle","fontWeight","lang","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],$a=$n.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail"),tt=class extends Mt{constructor(){let r=new Or;super(r,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.unicodeFontsURL=null,this.fontSize=.1,this.fontWeight="normal",this.fontStyle="normal",this.lang=null,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=zn,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=Cr,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(r){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(r):(this._isSyncing=!0,this.dispatchEvent(Za),Hn({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||.1,fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF,unicodeFontsURL:this.unicodeFontsURL},d=>{this._isSyncing=!1,this._textRenderInfo=d,this.geometry.updateGlyphs(d.glyphBounds,d.glyphAtlasIndices,d.blockBounds,d.chunkedBounds,d.glyphColors);let f=this._queuedSyncs;f&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{f.forEach(t=>t&&t())})),this.dispatchEvent(qa),r&&r()})))}onBeforeRender(r,d,f,t,e,a){this.sync(),e.isTroikaTextMaterial&&this._prepareForRender(e)}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}createDerivedMaterial(r){return Qn(r)}get material(){let r=this._derivedMaterial,d=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=Pr.clone());if((!r||!r.isDerivedFrom(d))&&(r=this._derivedMaterial=this.createDerivedMaterial(d),d.addEventListener("dispose",function f(){d.removeEventListener("dispose",f),r.dispose()})),this.hasOutline()){let f=r._outlineMtl;return f||(f=r._outlineMtl=Object.create(r,{id:{value:r.id+.1}}),f.isTextOutlineMaterial=!0,f.depthWrite=!1,f.map=null,r.addEventListener("dispose",function t(){r.removeEventListener("dispose",t),f.dispose()})),[f,r]}else return r}set material(r){r&&r.isTroikaTextMaterial?(this._derivedMaterial=r,this._baseMaterial=r.baseMaterial):this._baseMaterial=r}hasOutline(){return!!(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY)}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(r){this.geometry.detail=r}get curveRadius(){return this.geometry.curveRadius}set curveRadius(r){this.geometry.curveRadius=r}get customDepthMaterial(){return Nn(this.material).getDepthMaterial()}get customDistanceMaterial(){return Nn(this.material).getDistanceMaterial()}_prepareForRender(r){let d=r.isTextOutlineMaterial,f=r.uniforms,t=this.textRenderInfo;if(t){let{sdfTexture:o,blockBounds:n}=t;f.uTroikaSDFTexture.value=o,f.uTroikaSDFTextureSize.value.set(o.image.width,o.image.height),f.uTroikaSDFGlyphSize.value=t.sdfGlyphSize,f.uTroikaSDFExponent.value=t.sdfExponent,f.uTroikaTotalBounds.value.fromArray(n),f.uTroikaUseGlyphColors.value=!d&&!!t.glyphColors;let i=0,s=0,l=0,u,c,p,g=0,y=0;if(d){let{outlineWidth:w,outlineOffsetX:k,outlineOffsetY:T,outlineBlur:U,outlineOpacity:A}=this;i=this._parsePercent(w)||0,s=Math.max(0,this._parsePercent(U)||0),u=A,g=this._parsePercent(k)||0,y=this._parsePercent(T)||0}else l=Math.max(0,this._parsePercent(this.strokeWidth)||0),l&&(p=this.strokeColor,f.uTroikaStrokeColor.value.set(p==null?zn:p),c=this.strokeOpacity,c==null&&(c=1)),u=this.fillOpacity;f.uTroikaEdgeOffset.value=i,f.uTroikaPositionOffset.value.set(g,y),f.uTroikaBlurRadius.value=s,f.uTroikaStrokeWidth.value=l,f.uTroikaStrokeOpacity.value=c,f.uTroikaFillOpacity.value=u==null?1:u,f.uTroikaCurveRadius.value=this.curveRadius||0;let R=this.clipRect;if(R&&Array.isArray(R)&&R.length===4)f.uTroikaClipRect.value.fromArray(R);else{let w=(this.fontSize||.1)*100;f.uTroikaClipRect.value.set(n[0]-w,n[1]-w,n[2]+w,n[3]+w)}this.geometry.applyClipRect(f.uTroikaClipRect.value)}f.uTroikaSDFDebug.value=!!this.debugSDF,r.polygonOffset=!!this.depthOffset,r.polygonOffsetFactor=r.polygonOffsetUnits=this.depthOffset||0;let e=d?this.outlineColor||0:this.color;if(e==null)delete r.color;else{let o=r.hasOwnProperty("color")?r.color:r.color=new Ft;(e!==o._input||typeof e=="object")&&o.set(o._input=e)}let a=this.orientation||Cr;if(a!==r._orientation){let o=f.uTroikaOrient.value;a=a.replace(/[^-+xyz]/g,"");let n=a!==Cr&&a.match(/^([-+])([xyz])([-+])([xyz])$/);if(n){let[,i,s,l,u]=n;Kt.set(0,0,0)[s]=i==="-"?1:-1,Dr.set(0,0,0)[u]=l==="-"?-1:1,Wn.lookAt(Qa,Kt.cross(Dr),Dr),o.setFromMatrix4(Wn)}else o.identity();r._orientation=a}}_parsePercent(r){if(typeof r=="string"){let d=r.match(/^(-?[\d.]+)%$/),f=d?parseFloat(d[1]):NaN;r=(isNaN(f)?0:f/100)*this.fontSize}return r}localPositionToTextCoords(r,d=new at){d.copy(r);let f=this.curveRadius;return f&&(d.x=Math.atan2(r.x,Math.abs(f)-Math.abs(r.z))*Math.abs(f)),d}worldPositionToTextCoords(r,d=new at){return Kt.copy(r),this.localPositionToTextCoords(this.worldToLocal(Kt),d)}raycast(r,d){let{textRenderInfo:f,curveRadius:t}=this;if(f){let e=f.blockBounds,a=t?qn():Zn(),o=a.geometry,{position:n,uv:i}=o.attributes;for(let s=0;s<i.count;s++){let l=e[0]+i.getX(s)*(e[2]-e[0]),u=e[1]+i.getY(s)*(e[3]-e[1]),c=0;t&&(c=t-Math.cos(l/t)*t,l=Math.sin(l/t)*t),n.setXYZ(s,l,u,c)}o.boundingSphere=this.geometry.boundingSphere,o.boundingBox=this.geometry.boundingBox,a.matrixWorld=this.matrixWorld,a.material.side=this.material.side,Ct.length=0,a.raycast(r,Ct);for(let s=0;s<Ct.length;s++)Ct[s].object=this,d.push(Ct[s])}}copy(r){let d=this.geometry;return super.copy(r),this.geometry=d,$a.forEach(f=>{this[f]=r[f]}),this}clone(){return new this.constructor().copy(this)}};$n.forEach(h=>{let r="_private_"+h;Object.defineProperty(tt.prototype,h,{get(){return this[r]},set(d){d!==this[r]&&(this[r]=d,this._needsSync=!0)}})});var eo={type:"syncstart"},to={type:"synccomplete"},pt="aTroikaTextBatchMemberIndex",Rr=32,Vn=new Ur,jn=new Ft,Lr=class h extends tt{constructor(){super(),this._members=new Map,this._dataTextures={},this._onMemberSynced=r=>{this._members.get(r.target).dirty=!0}}add(...r){for(let d=0;d<r.length;d++)r[d]instanceof tt?this.addText(r[d]):super.add(r[d]);return this}remove(...r){for(let d=0;d<r.length;d++)r[d]instanceof tt?this.removeText(r[d]):super.remove(r[d]);return this}addText(r){this._members.has(r)||(this._members.set(r,{index:-1,glyphCount:-1,dirty:!0}),r.addEventListener("synccomplete",this._onMemberSynced))}removeText(r){this._needsRepack=!0,r.removeEventListener("synccomplete",this._onMemberSynced),this._members.delete(r)}createDerivedMaterial(r){return ro(r)}updateMatrixWorld(r){super.updateMatrixWorld(r),this.updateBounds()}updateBounds(){let r=this.geometry.boundingBox.makeEmpty();this._members.forEach((d,f)=>{f.matrixAutoUpdate&&f.updateMatrix(),Vn.copy(f.geometry.boundingBox).applyMatrix4(f.matrix),r.union(Vn)}),r.getBoundingSphere(this.geometry.boundingSphere)}hasOutline(){for(let r of this._members.keys())if(r.hasOutline())return!0;return!1}_prepareForRender(r){let d=r.isTextOutlineMaterial;r.uniforms.uTroikaIsOutline.value=d;let f=this._dataTextures[d?"outline":"main"],t=Math.pow(2,Math.ceil(Math.log2(this._members.size*Rr)));if(!f||t!==f.image.data.length){f&&f.dispose();let o=Math.min(t/4,1024);f=this._dataTextures[d?"outline":"main"]=new _n(new Float32Array(t),o,t/4/o,un,fn)}let e=f.image.data,a=(o,n)=>{n!==e[o]&&(e[o]=n,f.needsUpdate=!0)};this._members.forEach(({index:o,dirty:n},i)=>{if(o>-1){let s=o*Rr,l=i.matrix.elements;for(let b=0;b<16;b++)a(s+b,l[b]);i._prepareForRender(r);let{uTroikaTotalBounds:u,uTroikaClipRect:c,uTroikaPositionOffset:p,uTroikaEdgeOffset:g,uTroikaBlurRadius:y,uTroikaStrokeWidth:R,uTroikaStrokeColor:w,uTroikaStrokeOpacity:k,uTroikaFillOpacity:T,uTroikaCurveRadius:U}=r.uniforms;for(let b=0;b<4;b++)a(s+16+b,u.value.getComponent(b));for(let b=0;b<4;b++)a(s+20+b,c.value.getComponent(b));let A=d?i.outlineColor||0:i.color;A==null&&(A=this.color),A==null&&(A=this.material.color),A==null&&(A=16777215),a(s+24,jn.set(A).getHex()),a(s+25,T.value),a(s+26,U.value),d?(a(s+28,p.value.x),a(s+29,p.value.y),a(s+30,g.value),a(s+31,y.value)):(a(s+28,R.value),a(s+29,jn.set(w.value).getHex()),a(s+30,k.value))}}),r.setMatrixTexture(f),super._prepareForRender(r)}sync(r){let d=this._needsRepack?[]:null;this._needsRepack=!1,this._members.forEach((f,t)=>{(f.dirty||t._needsSync)&&(f.dirty=!1,(d||(d=[])).push(new Promise(e=>{t._needsSync?t.sync(e):e()})))}),d&&(this.dispatchEvent(eo),Promise.all(d).then(()=>{let{geometry:f}=this,t=f.attributes,e=t[pt]&&t[pt].array||new Uint16Array(0),a=t[Et]&&t[Et].array||new Float32Array(0),o=t[Zt]&&t[Zt].array||new Float32Array(0),n=0;this._members.forEach((l,{textRenderInfo:u})=>{u&&(n+=u.glyphAtlasIndices.length,this._textRenderInfo=u)}),n!==e.length&&(e=Er(e,n),a=Er(a,n),o=Er(o,n*4));let i=0,s=0;this._members.forEach((l,{textRenderInfo:u})=>{if(u){let c=u.glyphAtlasIndices.length;e.fill(i,s,s+c),a.set(u.glyphAtlasIndices,s,s+c),o.set(u.glyphBounds,s*4,(s+c)*4),s+=c,l.index=i++}}),f.updateAttributeData(pt,e,1),f.getAttribute(pt).setUsage(hn),f.updateAttributeData(Et,a,1),f.updateAttributeData(Zt,o,4),this.updateBounds(),this.dispatchEvent(to),r&&r()}))}copy(r){return r instanceof h&&(super.copy(r),this._members.forEach((d,f)=>this.removeText(f)),r._members.forEach((d,f)=>this.addText(f))),this}dispose(){super.dispose(),Object.values(this._dataTextures).forEach(r=>r.dispose())}};function Er(h,r){let d=new h.constructor(r);return d.set(h.subarray(0,r)),d}function ro(h){let r="uTroikaMatricesTexture",d="uTroikaMatricesTextureSize",f=dt(h,{chained:!0,uniforms:{[d]:{value:new at},[r]:{value:null}},vertexDefs:"\n uniform highp sampler2D ".concat(r,";\n uniform vec2 ").concat(d,";\n attribute float ").concat(pt,";\n\n vec4 troikaBatchTexel(float offset) {\n offset += ").concat(pt," * ").concat(Rr.toFixed(1)," / 4.0;\n float w = ").concat(d,".x;\n vec2 uv = (vec2(mod(offset, w), floor(offset / w)) + 0.5) / ").concat(d,";\n return texture2D(").concat(r,", uv);\n }\n "),vertexTransform:"\n mat4 matrix = mat4(\n troikaBatchTexel(0.0),\n troikaBatchTexel(1.0),\n troikaBatchTexel(2.0),\n troikaBatchTexel(3.0)\n );\n position.xyz = (matrix * vec4(position, 1.0)).xyz;\n "});return f=Qn(f),f=dt(f,{chained:!0,uniforms:{uTroikaIsOutline:{value:!1}},customRewriter(t){return["uTroikaTotalBounds","uTroikaClipRect","uTroikaPositionOffset","uTroikaEdgeOffset","uTroikaBlurRadius","uTroikaStrokeWidth","uTroikaStrokeColor","uTroikaStrokeOpacity","uTroikaFillOpacity","uTroikaCurveRadius","diffuse"].forEach(a=>{t=no(t,a)}),t},vertexDefs:"\n uniform bool uTroikaIsOutline;\n vec3 troikaFloatToColor(float v) {\n return mod(floor(vec3(v / 65536.0, v / 256.0, v)), 256.0) / 256.0;\n }\n ",vertexTransform:"\n uTroikaTotalBounds = troikaBatchTexel(4.0);\n uTroikaClipRect = troikaBatchTexel(5.0);\n \n vec4 data = troikaBatchTexel(6.0);\n diffuse = troikaFloatToColor(data.x);\n uTroikaFillOpacity = data.y;\n uTroikaCurveRadius = data.z;\n \n data = troikaBatchTexel(7.0);\n if (uTroikaIsOutline) {\n if (data == vec4(0.0)) { // degenerate if zero outline\n position = vec3(0.0);\n } else {\n uTroikaPositionOffset = data.xy;\n uTroikaEdgeOffset = data.z;\n uTroikaBlurRadius = data.w;\n }\n } else {\n uTroikaStrokeWidth = data.x;\n uTroikaStrokeColor = troikaFloatToColor(data.y);\n uTroikaStrokeOpacity = data.z;\n }\n "}),f.setMatrixTexture=t=>{f.uniforms[r].value=t,f.uniforms[d].value.set(t.image.width,t.image.height)},f}function no({vertexShader:h,fragmentShader:r},d,f=d){let t=new RegExp("uniform\\s+(bool|float|vec[234]|mat[34])\\s+".concat(d,"\\b")),e,a=!1;r=r.replace(t,(n,i)=>(a=!0,"varying ".concat(e=i," ").concat(f)));let o=!1;return h=h.replace(t,(n,i)=>(o=!0,"".concat(a?"varying":""," ").concat(e=i," ").concat(f))),o||(h="".concat(a?"varying":""," ").concat(e," ").concat(f,";\n").concat(h)),{vertexShader:h,fragmentShader:r}}Pe();var ea="abcdefghijklmnopqrstuvwxyz";function ta(h){return new Promise((r,d)=>{h?typeof h=="string"?Gr({font:h,characters:ea},()=>{r(h)}):d(new Error("bad fontUrl ".concat(h))):import("./roboto-regular-YXLENGLP.js").then(f=>{Gr({font:f.default,characters:ea},()=>{r(f.default)})})})}var Ir=.1,ao=new Xe;function ra(h,r,d,f){return r<=0||d<=0?Promise.reject("incoorect dimension [".concat(r,", ").concat(d,"]")):new Promise((t,e)=>{h.sync(a);function a(){if(!h.geometry.boundingBox)return;let{x:o,y:n}=h.geometry.boundingBox.getSize(ao);if(n>d||o>r){if(h.fontSize===Ir)return e("cannot find suitable font size for ".concat(h.text,". MaxSize: [").concat(r,", ").concat(d,"], Current size: [").concat(o,", ").concat(n,"]. min font size").concat(Ir,"."));h.fontSize=Math.max(Ir,h.fontSize-f),h.sync(a)}else return t({size:[o,n]})}})}async function Lo(h,r,d,f){var k,T,U,A,b,M,z,E,H,m,B,S,V,G;let t=r.feature.properties,{textArea:e}=t;if(!e)throw new Error("textArea is required");let a=(k=d.margin)!=null?k:Ie.margin,[o,n,i,s]=Array.isArray(a)?a:[a,a,a,a],l=new tt;r.textMesh=l,l.text=t.content;let u=e.maxHeight-o-i,c=e.maxWidth-s-n;l.fontSize=Math.min(u,(T=d.fontSize)!=null?T:Ie.fontSize),l.color=(U=d.color)!=null?U:Ie.color,l.maxWidth=(A=d.maxWidth)!=null?A:c,l.anchorX="center",l.anchorY="middle",l.textAlign="center";let p=(b=d.font)!=null?b:Ie.font;p?l.font=p:er?l.font=await er:l.font=await io(),l.outlineOpacity=(M=d.outlineOpacity)!=null?M:Ie.outlineOpacity,l.outlineColor=(z=d.outlineColor)!=null?z:Ie.outlineColor,l.outlineOffsetY=(E=d.outlineOffsetY)!=null?E:Ie.outlineOffsetY,l.outlineOffsetX=(H=d.outlineOffsetX)!=null?H:Ie.outlineOffsetX,l.outlineWidth=(m=d.outlineWidth)!=null?m:Ie.outlineWidth,l.outlineBlur=(B=d.outlineBlur)!=null?B:Ie.outlineBlur,l.strokeWidth=(S=d.strokeWidth)!=null?S:Ie.strokeWidth,l.strokeColor=(V=d.strokeColor)!=null?V:Ie.strokeColor,l.strokeOpacity=(G=d.strokeOpacity)!=null?G:Ie.strokeOpacity;let g=f(e.position,He);l.position.copy(g);let y=Sn(Math.PI/2-dn.degToRad(e.rotation));l.rotation.z=y,l.userData={entityId:h.toString(),rotationZ:y};let R,w;try{w=(await ra(l,c,u,l.fontSize*.2)).size}catch(Q){throw new Error("Cannot fit text to area: entityId: ".concat(r.polygonEntityId," ").concat(Q))}if(w)return $t.identity(),He.set(0,0,1),$t.makeRotationAxis(oo,y),He.set(e.align==="near"?s+w[0]/2:e.maxWidth/2,0,0),He.applyMatrix4($t),l.position.x-=He.x,l.position.y-=He.y,R&&(He.set(e.maxWidth/2,0,0),He.applyMatrix4($t),R.position.x-=He.x,R.position.y-=He.y),{text:l}}var $t=new wt,He=new Xe,oo=new Xe(0,0,1),er;function io(h){return er=ta(h),er}export{Lr as BatchedText,tt as Text,Lo as createTroikaText,io as preloadFont};
|