modern-text 1.10.5 → 1.10.6

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.
Files changed (2) hide show
  1. package/dist/index.js +5 -5
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- (function(Y,Me){typeof exports=="object"&&typeof module<"u"?Me(exports):typeof define=="function"&&define.amd?define(["exports"],Me):(Y=typeof globalThis<"u"?globalThis:Y||self,Me(Y.modernText={}))})(this,(function(Y){"use strict";var Me={grad:.9,turn:360,rad:360/(2*Math.PI)},Zt=function(r){return typeof r=="string"?r.length>0:typeof r=="number"},ot=function(r,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*r)/e+0},It=function(r,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),r>e?e:r>t?r:t},yr=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},mr=function(r){return{r:It(r.r,0,255),g:It(r.g,0,255),b:It(r.b,0,255),a:It(r.a)}},_n=function(r){return{r:ot(r.r),g:ot(r.g),b:ot(r.b),a:ot(r.a,3)}},es=/^#([0-9a-f]{3,8})$/i,He=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},xr=function(r){var t=r.r,e=r.g,n=r.b,i=r.a,s=Math.max(t,e,n),o=s-Math.min(t,e,n),a=o?s===t?(e-n)/o:s===e?2+(n-t)/o:4+(t-e)/o:0;return{h:60*(a<0?a+6:a),s:s?o/s*100:0,v:s/255*100,a:i}},vr=function(r){var t=r.h,e=r.s,n=r.v,i=r.a;t=t/360*6,e/=100,n/=100;var s=Math.floor(t),o=n*(1-e),a=n*(1-(t-s)*e),l=n*(1-(1-t+s)*e),c=s%6;return{r:255*[n,a,o,o,l,n][c],g:255*[l,n,n,a,o,o][c],b:255*[o,o,l,n,n,a][c],a:i}},wr=function(r){return{h:yr(r.h),s:It(r.s,0,100),l:It(r.l,0,100),a:It(r.a)}},br=function(r){return{h:ot(r.h),s:ot(r.s),l:ot(r.l),a:ot(r.a,3)}},Sr=function(r){return vr((e=(t=r).s,{h:t.h,s:(e*=((n=t.l)<50?n:100-n)/100)>0?2*e/(n+e)*100:0,v:n+e,a:t.a}));var t,e,n},Pe=function(r){return{h:(t=xr(r)).h,s:(i=(200-(e=t.s))*(n=t.v)/100)>0&&i<200?e*n/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,e,n,i},ns=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,rs=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,is=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ss=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Cr={string:[[function(r){var t=es.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:r.length===4?ot(parseInt(r[3]+r[3],16)/255,2):1}:r.length===6||r.length===8?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:r.length===8?ot(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=is.exec(r)||ss.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:mr({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(r){var t=ns.exec(r)||rs.exec(r);if(!t)return null;var e,n,i=wr({h:(e=t[1],n=t[2],n===void 0&&(n="deg"),Number(e)*(Me[n]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return Sr(i)},"hsl"]],object:[[function(r){var t=r.r,e=r.g,n=r.b,i=r.a,s=i===void 0?1:i;return Zt(t)&&Zt(e)&&Zt(n)?mr({r:Number(t),g:Number(e),b:Number(n),a:Number(s)}):null},"rgb"],[function(r){var t=r.h,e=r.s,n=r.l,i=r.a,s=i===void 0?1:i;if(!Zt(t)||!Zt(e)||!Zt(n))return null;var o=wr({h:Number(t),s:Number(e),l:Number(n),a:Number(s)});return Sr(o)},"hsl"],[function(r){var t=r.h,e=r.s,n=r.v,i=r.a,s=i===void 0?1:i;if(!Zt(t)||!Zt(e)||!Zt(n))return null;var o=(function(a){return{h:yr(a.h),s:It(a.s,0,100),v:It(a.v,0,100),a:It(a.a)}})({h:Number(t),s:Number(e),v:Number(n),a:Number(s)});return vr(o)},"hsv"]]},Mr=function(r,t){for(var e=0;e<t.length;e++){var n=t[e][0](r);if(n)return[n,t[e][1]]}return[null,void 0]},os=function(r){return typeof r=="string"?Mr(r.trim(),Cr.string):typeof r=="object"&&r!==null?Mr(r,Cr.object):[null,void 0]},Tn=function(r,t){var e=Pe(r);return{h:e.h,s:It(e.s+100*t,0,100),l:e.l,a:e.a}},kn=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},Pr=function(r,t){var e=Pe(r);return{h:e.h,s:e.s,l:It(e.l+100*t,0,100),a:e.a}},_r=(function(){function r(t){this.parsed=os(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return this.parsed!==null},r.prototype.brightness=function(){return ot(kn(this.rgba),2)},r.prototype.isDark=function(){return kn(this.rgba)<.5},r.prototype.isLight=function(){return kn(this.rgba)>=.5},r.prototype.toHex=function(){return t=_n(this.rgba),e=t.r,n=t.g,i=t.b,o=(s=t.a)<1?He(ot(255*s)):"","#"+He(e)+He(n)+He(i)+o;var t,e,n,i,s,o},r.prototype.toRgb=function(){return _n(this.rgba)},r.prototype.toRgbString=function(){return t=_n(this.rgba),e=t.r,n=t.g,i=t.b,(s=t.a)<1?"rgba("+e+", "+n+", "+i+", "+s+")":"rgb("+e+", "+n+", "+i+")";var t,e,n,i,s},r.prototype.toHsl=function(){return br(Pe(this.rgba))},r.prototype.toHslString=function(){return t=br(Pe(this.rgba)),e=t.h,n=t.s,i=t.l,(s=t.a)<1?"hsla("+e+", "+n+"%, "+i+"%, "+s+")":"hsl("+e+", "+n+"%, "+i+"%)";var t,e,n,i,s},r.prototype.toHsv=function(){return t=xr(this.rgba),{h:ot(t.h),s:ot(t.s),v:ot(t.v),a:ot(t.a,3)};var t},r.prototype.invert=function(){return jt({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},r.prototype.saturate=function(t){return t===void 0&&(t=.1),jt(Tn(this.rgba,t))},r.prototype.desaturate=function(t){return t===void 0&&(t=.1),jt(Tn(this.rgba,-t))},r.prototype.grayscale=function(){return jt(Tn(this.rgba,-1))},r.prototype.lighten=function(t){return t===void 0&&(t=.1),jt(Pr(this.rgba,t))},r.prototype.darken=function(t){return t===void 0&&(t=.1),jt(Pr(this.rgba,-t))},r.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},r.prototype.alpha=function(t){return typeof t=="number"?jt({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):ot(this.rgba.a,3);var e},r.prototype.hue=function(t){var e=Pe(this.rgba);return typeof t=="number"?jt({h:t,s:e.s,l:e.l,a:e.a}):ot(e.h)},r.prototype.isEqual=function(t){return this.toHex()===jt(t).toHex()},r})(),jt=function(r){return r instanceof _r?r:new _r(r)};function J(r){return r==null||r===""||r==="none"}function de(r,t=0,e=10**t){return Math.round(e*r)/e+0}function Ut(r,t=!1){if(typeof r!="object"||!r)return r;if(Array.isArray(r))return t?r.map(n=>Ut(n,t)):r;const e={};for(const n in r){const i=r[n];i!=null&&(t?e[n]=Ut(i,t):e[n]=i)}return e}function Xe(r,t){const e={};return t.forEach(n=>{n in r&&(e[n]=r[n])}),e}function An(r,t){if(r===t)return!0;if(r&&t&&typeof r=="object"&&typeof t=="object"){const e=Array.from(new Set([...Object.keys(r),...Object.keys(t)]));return!e.length||e.every(n=>r[n]===t[n])}return!1}function as(r,t,e){const n=t.length-1;if(n<0)return r===void 0?e:r;for(let i=0;i<n;i++){if(r==null)return e;r=r[t[i]]}return r==null||r[t[n]]===void 0?e:r[t[n]]}function ls(r,t,e){const n=t.length-1;for(let i=0;i<n;i++)typeof r[t[i]]!="object"&&(r[t[i]]={}),r=r[t[i]];r[t[n]]=e}function cs(r,t,e){return r==null||!t||typeof t!="string"?e:r[t]!==void 0?r[t]:(t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,""),as(r,t.split("."),e))}function hs(r,t,e){if(!(typeof r!="object"||!t))return t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,""),ls(r,t.split("."),e)}class us{_observers=new Map;on(t,e){let n=this._observers.get(t);return n===void 0&&this._observers.set(t,n=new Set),n.add(e),this}once(t,e){const n=(...i)=>{this.off(t,n),e(...i)};return this.on(t,n),this}off(t,e){const n=this._observers.get(t);return n!==void 0&&(n.delete(e),n.size===0&&this._observers.delete(t)),this}emit(t,...e){return Array.from((this._observers.get(t)||new Map).values()).forEach(n=>n(...e)),this}destroy(){this._observers=new Map}}const On=Symbol("properties"),Ye=Symbol("inited");function In(r){let t;if(Object.hasOwn(r,On))t=r[On];else{const e=Object.getPrototypeOf(r);t=new Map(e?In(e):void 0),r[On]=t}return t}function Tr(r,t,e,n){const{alias:i,internalKey:s}=n,o=r[t];i?hs(r,i,e):r[s]=e,r.onUpdateProperty?.(t,e??Ze(r,t,n),o)}function kr(r,t,e){const{alias:n,internalKey:i}=e;let s;return n?s=cs(r,n):s=r[i],s=s??Ze(r,t,e),s}function Ze(r,t,e){const{default:n,fallback:i}=e;let s;if(n!==void 0&&!r[Ye]?.[t]){r[Ye]||(r[Ye]={}),r[Ye][t]=!0;const o=typeof n=="function"?n():n;o!==void 0&&(r[t]=o,s=o)}return s===void 0&&i!==void 0&&(s=typeof i=="function"?i():i),s}function fs(r,t){function e(){return typeof this.getProperty<"u"?this.getProperty(r):kr(this,r,t)}function n(i){typeof this.setProperty<"u"?this.setProperty(r,i):Tr(this,r,i,t)}return{get:e,set:n}}function ps(r,t,e={}){const n={...e,internalKey:Symbol(t)};In(r).set(t,n);const i=fs(t,n);Object.defineProperty(r.prototype,t,{get(){return i.get.call(this)},set(s){i.set.call(this,s)},configurable:!0,enumerable:!0})}function te(r){return function(t,e){if(typeof e!="string")throw new TypeError("Failed to @property decorator, prop name cannot be a symbol");ps(t.constructor,e,r)}}class ds extends us{_propertyAccessor;_properties=new Map;_updatedProperties=new Map;_changedProperties=new Set;_updatingPromise=Promise.resolve();_updating=!1;constructor(t){super(),this.setProperties(t)}isDirty(t){return t?this._updatedProperties.has(t):this._updatedProperties.size>0}getProperty(t){const e=this.getPropertyDeclaration(t);if(e){if(e.internal||e.alias)return kr(this,t,e);{let n;return this._propertyAccessor?.getProperty?n=this._propertyAccessor.getProperty(t):n=this._properties.get(t),n??Ze(this,t,e)}}}setProperty(t,e){const n=this.getPropertyDeclaration(t);if(n)if(n.internal||n.alias)Tr(this,t,e,n);else{const i=this.getProperty(t);this._propertyAccessor?.setProperty?.(t,e),this._properties.set(t,e),this.onUpdateProperty?.(t,e??Ze(this,t,n),i)}}getProperties(t){const e={};for(const[n,i]of this.getPropertyDeclarations())!i.internal&&!i.alias&&(!t||t.includes(n))&&(e[n]=this.getProperty(n));return e}setProperties(t){if(t&&typeof t=="object")for(const e in t)this.setProperty(e,t[e]);return this}resetProperties(){for(const[t,e]of this.getPropertyDeclarations())this.setProperty(t,typeof e.default=="function"?e.default():e.default);return this}getPropertyDeclarations(){return In(this.constructor)}getPropertyDeclaration(t){return this.getPropertyDeclarations().get(t)}setPropertyAccessor(t){const e=this.getPropertyDeclarations();this._propertyAccessor=void 0;const n={};return e.forEach((i,s)=>{n[s]=this.getProperty(s)}),this._propertyAccessor=t,e.forEach((i,s)=>{const o=this.getProperty(s),a=n[s];o!==void 0&&!Object.is(o,a)&&(this.setProperty(s,o),!i.internal&&!i.alias&&this.requestUpdate(s,o,a))}),this}async _nextTick(){return"requestAnimationFrame"in globalThis?new Promise(t=>globalThis.requestAnimationFrame(t)):Promise.resolve()}async _enqueueUpdate(){this._updating=!0;try{await this._updatingPromise}catch(t){Promise.reject(t)}await this._nextTick(),this._updating&&(this.onUpdate(),this._updating=!1)}onUpdate(){this._update(this._updatedProperties),this._updatedProperties=new Map}onUpdateProperty(t,e,n){Object.is(e,n)||this.requestUpdate(t,e,n)}requestUpdate(t,e,n){t!==void 0&&(this._updatedProperties.set(t,n),this._changedProperties.add(t),this._updateProperty(t,e,n),this.emit("updateProperty",t,e,n)),this._updating||(this._updatingPromise=this._enqueueUpdate())}_update(t){}_updateProperty(t,e,n){}toJSON(){const t={};return this._properties.forEach((e,n)=>{e!==void 0&&(e&&typeof e=="object"?"toJSON"in e&&typeof e.toJSON=="function"?t[n]=e.toJSON():Array.isArray(e)?t[n]=[...e]:t[n]={...e}:t[n]=e)}),t}clone(){return new this.constructor(this.toJSON())}destroy(){this.emit("destroy"),super.destroy()}}function Ar(r){let t;return typeof r=="number"?t={r:r>>24&255,g:r>>16&255,b:r>>8&255,a:(r&255)/255}:t=r,jt(t)}function gs(r){return{r:de(r.r),g:de(r.g),b:de(r.b),a:de(r.a,3)}}function Ke(r){const t=r.toString(16);return t.length<2?`0${t}`:t}const ys="#000000FF";function ms(r){return Ar(r).isValid()}function Et(r,t=!1){const e=Ar(r);if(!e.isValid()){if(typeof r=="string")return r;const a=`Failed to normalizeColor ${r}`;if(t)throw new Error(a);return console.warn(a),ys}const{r:n,g:i,b:s,a:o}=gs(e.rgba);return`#${Ke(n)}${Ke(i)}${Ke(s)}${Ke(de(o*255))}`}var Qe=Qe||{};Qe.parse=(function(){const r={linearGradient:/^(-(webkit|o|ms|moz)-)?(linear-gradient)/i,repeatingLinearGradient:/^(-(webkit|o|ms|moz)-)?(repeating-linear-gradient)/i,radialGradient:/^(-(webkit|o|ms|moz)-)?(radial-gradient)/i,repeatingRadialGradient:/^(-(webkit|o|ms|moz)-)?(repeating-radial-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?((\d*\.\d+)|(\d+\.?)))px/,percentageValue:/^(-?((\d*\.\d+)|(\d+\.?)))%/,emValue:/^(-?((\d*\.\d+)|(\d+\.?)))em/,angleValue:/^(-?((\d*\.\d+)|(\d+\.?)))deg/,radianValue:/^(-?((\d*\.\d+)|(\d+\.?)))rad/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^#([0-9a-f]+)/i,literalColor:/^([a-z]+)/i,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,varColor:/^var/i,calcValue:/^calc/i,variableName:/^(--[a-z0-9-,\s#]+)/i,number:/^((\d*\.\d+)|(\d+\.?))/,hslColor:/^hsl/i,hslaColor:/^hsla/i};let t="";function e(T){const _=new Error(`${t}: ${T}`);throw _.source=t,_}function n(){const T=i();return t.length>0&&e("Invalid input not EOF"),T}function i(){return x(s)}function s(){return o("linear-gradient",r.linearGradient,l)||o("repeating-linear-gradient",r.repeatingLinearGradient,l)||o("radial-gradient",r.radialGradient,u)||o("repeating-radial-gradient",r.repeatingRadialGradient,u)}function o(T,_,U){return a(_,$=>{const q=U();return q&&(I(r.comma)||e("Missing comma before color stops")),{type:T,orientation:q,colorStops:x(C)}})}function a(T,_){const U=I(T);if(U){I(r.startCall)||e("Missing (");const $=_(U);return I(r.endCall)||e("Missing )"),$}}function l(){const T=c();if(T)return T;const _=V("position-keyword",r.positionKeywords,1);return _?{type:"directional",value:_.value}:h()}function c(){return V("directional",r.sideOrCorner,1)}function h(){return V("angular",r.angleValue,1)||V("angular",r.radianValue,1)}function u(){let T,_=p(),U;return _&&(T=[],T.push(_),U=t,I(r.comma)&&(_=p(),_?T.push(_):t=U)),T}function p(){let T=d()||f();if(T)T.at=g();else{const _=y();if(_){T=_;const U=g();U&&(T.at=U)}else{const U=g();if(U)T={type:"default-radial",at:U};else{const $=M();$&&(T={type:"default-radial",at:$})}}}return T}function d(){const T=V("shape",/^(circle)/i,0);return T&&(T.style=L()||y()),T}function f(){const T=V("shape",/^(ellipse)/i,0);return T&&(T.style=M()||A()||y()),T}function y(){return V("extent-keyword",r.extentKeywords,1)}function g(){if(V("position",/^at/,0)){const T=M();return T||e("Missing positioning value"),T}}function M(){const T=P();if(T.x||T.y)return{type:"position",value:T}}function P(){return{x:A(),y:A()}}function x(T){let _=T();const U=[];if(_)for(U.push(_);I(r.comma);)_=T(),_?U.push(_):e("One extra comma");return U}function C(){const T=w();return T||e("Expected color definition"),T.length=A(),T}function w(){return S()||F()||E()||D()||b()||z()||v()}function v(){return V("literal",r.literalColor,0)}function S(){return V("hex",r.hexColor,1)}function b(){return a(r.rgbColor,()=>({type:"rgb",value:x(B)}))}function D(){return a(r.rgbaColor,()=>({type:"rgba",value:x(B)}))}function z(){return a(r.varColor,()=>({type:"var",value:N()}))}function E(){return a(r.hslColor,()=>{I(r.percentageValue)&&e("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");const _=B();I(r.comma);let U=I(r.percentageValue);const $=U?U[1]:null;I(r.comma),U=I(r.percentageValue);const q=U?U[1]:null;return(!$||!q)&&e("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[_,$,q]}})}function F(){return a(r.hslaColor,()=>{const T=B();I(r.comma);let _=I(r.percentageValue);const U=_?_[1]:null;I(r.comma),_=I(r.percentageValue);const $=_?_[1]:null;I(r.comma);const q=B();return(!U||!$)&&e("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[T,U,$,q]}})}function N(){return I(r.variableName)[1]}function B(){return I(r.number)[1]}function A(){return V("%",r.percentageValue,1)||W()||O()||L()}function W(){return V("position-keyword",r.positionKeywords,1)}function O(){return a(r.calcValue,()=>{let T=1,_=0;for(;T>0&&_<t.length;){const $=t.charAt(_);$==="("?T++:$===")"&&T--,_++}T>0&&e("Missing closing parenthesis in calc() expression");const U=t.substring(0,_-1);return R(_-1),{type:"calc",value:U}})}function L(){return V("px",r.pixelValue,1)||V("em",r.emValue,1)}function V(T,_,U){const $=I(_);if($)return{type:T,value:$[U]}}function I(T){let _,U;return U=/^\s+/.exec(t),U&&R(U[0].length),_=T.exec(t),_&&R(_[0].length),_}function R(T){t=t.substr(T)}return function(T){return t=T.toString().trim(),t.endsWith(";")&&(t=t.slice(0,-1)),n()}})();const Or=Qe.parse.bind(Qe);var Je=Je||{};Je.stringify=(function(){var r={"visit_linear-gradient":function(t){return r.visit_gradient(t)},"visit_repeating-linear-gradient":function(t){return r.visit_gradient(t)},"visit_radial-gradient":function(t){return r.visit_gradient(t)},"visit_repeating-radial-gradient":function(t){return r.visit_gradient(t)},visit_gradient:function(t){var e=r.visit(t.orientation);return e&&(e+=", "),t.type+"("+e+r.visit(t.colorStops)+")"},visit_shape:function(t){var e=t.value,n=r.visit(t.at),i=r.visit(t.style);return i&&(e+=" "+i),n&&(e+=" at "+n),e},"visit_default-radial":function(t){var e="",n=r.visit(t.at);return n&&(e+=n),e},"visit_extent-keyword":function(t){var e=t.value,n=r.visit(t.at);return n&&(e+=" at "+n),e},"visit_position-keyword":function(t){return t.value},visit_position:function(t){return r.visit(t.value.x)+" "+r.visit(t.value.y)},"visit_%":function(t){return t.value+"%"},visit_em:function(t){return t.value+"em"},visit_px:function(t){return t.value+"px"},visit_calc:function(t){return"calc("+t.value+")"},visit_literal:function(t){return r.visit_color(t.value,t)},visit_hex:function(t){return r.visit_color("#"+t.value,t)},visit_rgb:function(t){return r.visit_color("rgb("+t.value.join(", ")+")",t)},visit_rgba:function(t){return r.visit_color("rgba("+t.value.join(", ")+")",t)},visit_hsl:function(t){return r.visit_color("hsl("+t.value[0]+", "+t.value[1]+"%, "+t.value[2]+"%)",t)},visit_hsla:function(t){return r.visit_color("hsla("+t.value[0]+", "+t.value[1]+"%, "+t.value[2]+"%, "+t.value[3]+")",t)},visit_var:function(t){return r.visit_color("var("+t.value+")",t)},visit_color:function(t,e){var n=t,i=r.visit(e.length);return i&&(n+=" "+i),n},visit_angular:function(t){return t.value+"deg"},visit_directional:function(t){return"to "+t.value},visit_array:function(t){var e="",n=t.length;return t.forEach(function(i,s){e+=r.visit(i),s<n-1&&(e+=", ")}),e},visit_object:function(t){return t.width&&t.height?r.visit(t.width)+" "+r.visit(t.height):""},visit:function(t){if(!t)return"";if(t instanceof Array)return r.visit_array(t);if(typeof t=="object"&&!t.type)return r.visit_object(t);if(t.type){var e=r["visit_"+t.type];if(e)return e(t);throw Error("Missing visitor visit_"+t.type)}else throw Error("Invalid node.")}};return function(t){return r.visit(t)}})(),Je.stringify.bind(Je);function Ir(r){const t=r.length-1;return r.map((e,n)=>{const i=e.value;let s=de(n/t,3),o="#00000000";switch(e.type){case"rgb":o=Et({r:Number(i[0]??0),g:Number(i[1]??0),b:Number(i[2]??0)});break;case"rgba":o=Et({r:Number(i[0]??0),g:Number(i[1]??0),b:Number(i[2]??0),a:Number(i[3]??0)});break;case"literal":o=Et(e.value);break;case"hex":o=Et(`#${e.value}`);break}switch(e.length?.type){case"%":s=Number(e.length.value)/100;break}return{offset:s,color:o}})}function Er(r){let t=0;switch(r.orientation?.type){case"angular":t=Number(r.orientation.value);break}return{type:"linear-gradient",angle:t,stops:Ir(r.colorStops)}}function Br(r){return r.orientation?.map(t=>{switch(t?.type){case"shape":case"default-radial":case"extent-keyword":default:return null}}),{type:"radial-gradient",stops:Ir(r.colorStops)}}function _e(r){return r.startsWith("linear-gradient(")||r.startsWith("radial-gradient(")}function xs(r){return Or(r).map(t=>{switch(t?.type){case"linear-gradient":return Er(t);case"repeating-linear-gradient":return{...Er(t),repeat:!0};case"radial-gradient":return Br(t);case"repeating-radial-gradient":return{...Br(t),repeat:!0};default:return}}).filter(Boolean)}function vs(r){let t;return typeof r=="string"?t={color:r}:t={...r},{color:Et(t.color)}}function ws(r){let t;if(typeof r=="string"?t={image:r}:t={...r},t.image){const{type:e,...n}=xs(t.image)[0]??{};switch(e){case"radial-gradient":return{radialGradient:n};case"linear-gradient":return{linearGradient:n}}}return Xe(t,["linearGradient","radialGradient","rotateWithShape"])}function bs(r){let t;return typeof r=="string"?t={image:r}:t={...r},Xe(t,["image","cropRect","stretchRect","tile","dpi","opacity","rotateWithShape"])}function Ss(r){let t;return typeof r=="string"?t={preset:r}:t={...r},J(t.foregroundColor)?delete t.foregroundColor:t.foregroundColor=Et(t.foregroundColor),J(t.backgroundColor)?delete t.backgroundColor:t.backgroundColor=Et(t.backgroundColor),Xe(t,["preset","foregroundColor","backgroundColor"])}function Cs(r){return!J(r.color)}function Ms(r){return typeof r=="string"?ms(r):Cs(r)}function Ps(r){return!J(r.image)&&_e(r.image)||!!r.linearGradient||!!r.radialGradient}function _s(r){return typeof r=="string"?_e(r):Ps(r)}function Ts(r){return!J(r.image)&&!_e(r.image)}function ks(r){return typeof r=="string"?!_e(r):Ts(r)}function As(r){return!J(r.preset)}function Os(r){return typeof r=="string"?!1:As(r)}function Te(r){const t=r&&typeof r=="object"?r.enabled:void 0;return Ms(r)?Ut({enabled:t,...vs(r)}):_s(r)?Ut({enabled:t,...ws(r)}):ks(r)?Ut({enabled:t,...bs(r)}):Os(r)?Ut({enabled:t,...Ss(r)}):{}}function En(r){return typeof r=="string"?{...Te(r)}:{...Te(r),...Xe(r,["width","style","lineCap","lineJoin","headEnd","tailEnd"])}}function Is(){return{boxShadow:"none"}}function Es(){return{overflow:"visible",direction:void 0,display:void 0,boxSizing:void 0,width:void 0,height:void 0,maxHeight:void 0,maxWidth:void 0,minHeight:void 0,minWidth:void 0,position:void 0,left:0,top:0,right:void 0,bottom:void 0,borderTop:void 0,borderLeft:void 0,borderRight:void 0,borderBottom:void 0,borderWidth:0,border:void 0,flex:void 0,flexBasis:void 0,flexDirection:void 0,flexGrow:void 0,flexShrink:void 0,flexWrap:void 0,justifyContent:void 0,gap:void 0,alignContent:void 0,alignItems:void 0,alignSelf:void 0,marginTop:void 0,marginLeft:void 0,marginRight:void 0,marginBottom:void 0,margin:void 0,paddingTop:void 0,paddingLeft:void 0,paddingRight:void 0,paddingBottom:void 0,padding:void 0}}function Bs(){return{rotate:0,scaleX:1,scaleY:1,skewX:0,skewY:0,translateX:0,translateY:0,transform:"none",transformOrigin:"center"}}function Ds(){return{...Es(),...Bs(),...Is(),backgroundImage:"none",backgroundSize:"auto, auto",backgroundColor:"none",backgroundColormap:"none",borderRadius:0,borderColor:"none",borderStyle:"solid",outlineWidth:0,outlineOffset:0,outlineColor:"rgb(0, 0, 0)",outlineStyle:"none",visibility:"visible",filter:"none",opacity:1,pointerEvents:"auto",maskImage:"none"}}function Fs(){return{highlight:{},highlightImage:"none",highlightReferImage:"none",highlightColormap:"none",highlightLine:"none",highlightSize:"cover",highlightThickness:"100%"}}function Us(){return{listStyle:{},listStyleType:"none",listStyleImage:"none",listStyleColormap:"none",listStyleSize:"cover",listStylePosition:"outside"}}function Ls(){return{...Fs(),color:"rgb(0, 0, 0)",verticalAlign:"baseline",letterSpacing:0,wordSpacing:0,fontSize:14,fontWeight:"normal",fontFamily:"",fontStyle:"normal",fontKerning:"normal",textTransform:"none",textOrientation:"mixed",textDecoration:"none"}}function $s(){return{...Us(),writingMode:"horizontal-tb",textWrap:"wrap",textAlign:"start",textIndent:0,lineHeight:1.2}}function Ns(){return{...$s(),...Ls(),textStrokeWidth:0,textStrokeColor:"rgb(0, 0, 0)"}}function tn(r){return Ut({...r,color:J(r.color)?void 0:Et(r.color),backgroundColor:J(r.backgroundColor)?void 0:Et(r.backgroundColor),borderColor:J(r.borderColor)?void 0:Et(r.borderColor),outlineColor:J(r.outlineColor)?void 0:Et(r.outlineColor),shadowColor:J(r.shadowColor)?void 0:Et(r.shadowColor)})}function zs(){return{...Ds(),...Ns()}}const Rs=/\r\n|\n\r|\n|\r/,Vs=new RegExp(`^(${Rs.source})$`),js=`
1
+ (function(Y,Me){typeof exports=="object"&&typeof module<"u"?Me(exports):typeof define=="function"&&define.amd?define(["exports"],Me):(Y=typeof globalThis<"u"?globalThis:Y||self,Me(Y.modernText={}))})(this,(function(Y){"use strict";var Me={grad:.9,turn:360,rad:360/(2*Math.PI)},Zt=function(r){return typeof r=="string"?r.length>0:typeof r=="number"},ot=function(r,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*r)/e+0},Et=function(r,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),r>e?e:r>t?r:t},yr=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},mr=function(r){return{r:Et(r.r,0,255),g:Et(r.g,0,255),b:Et(r.b,0,255),a:Et(r.a)}},_n=function(r){return{r:ot(r.r),g:ot(r.g),b:ot(r.b),a:ot(r.a,3)}},es=/^#([0-9a-f]{3,8})$/i,He=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},xr=function(r){var t=r.r,e=r.g,n=r.b,i=r.a,s=Math.max(t,e,n),o=s-Math.min(t,e,n),a=o?s===t?(e-n)/o:s===e?2+(n-t)/o:4+(t-e)/o:0;return{h:60*(a<0?a+6:a),s:s?o/s*100:0,v:s/255*100,a:i}},vr=function(r){var t=r.h,e=r.s,n=r.v,i=r.a;t=t/360*6,e/=100,n/=100;var s=Math.floor(t),o=n*(1-e),a=n*(1-(t-s)*e),l=n*(1-(1-t+s)*e),c=s%6;return{r:255*[n,a,o,o,l,n][c],g:255*[l,n,n,a,o,o][c],b:255*[o,o,l,n,n,a][c],a:i}},wr=function(r){return{h:yr(r.h),s:Et(r.s,0,100),l:Et(r.l,0,100),a:Et(r.a)}},br=function(r){return{h:ot(r.h),s:ot(r.s),l:ot(r.l),a:ot(r.a,3)}},Sr=function(r){return vr((e=(t=r).s,{h:t.h,s:(e*=((n=t.l)<50?n:100-n)/100)>0?2*e/(n+e)*100:0,v:n+e,a:t.a}));var t,e,n},Pe=function(r){return{h:(t=xr(r)).h,s:(i=(200-(e=t.s))*(n=t.v)/100)>0&&i<200?e*n/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,e,n,i},ns=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,rs=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,is=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ss=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Cr={string:[[function(r){var t=es.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:r.length===4?ot(parseInt(r[3]+r[3],16)/255,2):1}:r.length===6||r.length===8?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:r.length===8?ot(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=is.exec(r)||ss.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:mr({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(r){var t=ns.exec(r)||rs.exec(r);if(!t)return null;var e,n,i=wr({h:(e=t[1],n=t[2],n===void 0&&(n="deg"),Number(e)*(Me[n]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return Sr(i)},"hsl"]],object:[[function(r){var t=r.r,e=r.g,n=r.b,i=r.a,s=i===void 0?1:i;return Zt(t)&&Zt(e)&&Zt(n)?mr({r:Number(t),g:Number(e),b:Number(n),a:Number(s)}):null},"rgb"],[function(r){var t=r.h,e=r.s,n=r.l,i=r.a,s=i===void 0?1:i;if(!Zt(t)||!Zt(e)||!Zt(n))return null;var o=wr({h:Number(t),s:Number(e),l:Number(n),a:Number(s)});return Sr(o)},"hsl"],[function(r){var t=r.h,e=r.s,n=r.v,i=r.a,s=i===void 0?1:i;if(!Zt(t)||!Zt(e)||!Zt(n))return null;var o=(function(a){return{h:yr(a.h),s:Et(a.s,0,100),v:Et(a.v,0,100),a:Et(a.a)}})({h:Number(t),s:Number(e),v:Number(n),a:Number(s)});return vr(o)},"hsv"]]},Mr=function(r,t){for(var e=0;e<t.length;e++){var n=t[e][0](r);if(n)return[n,t[e][1]]}return[null,void 0]},os=function(r){return typeof r=="string"?Mr(r.trim(),Cr.string):typeof r=="object"&&r!==null?Mr(r,Cr.object):[null,void 0]},Tn=function(r,t){var e=Pe(r);return{h:e.h,s:Et(e.s+100*t,0,100),l:e.l,a:e.a}},kn=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},Pr=function(r,t){var e=Pe(r);return{h:e.h,s:e.s,l:Et(e.l+100*t,0,100),a:e.a}},_r=(function(){function r(t){this.parsed=os(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return this.parsed!==null},r.prototype.brightness=function(){return ot(kn(this.rgba),2)},r.prototype.isDark=function(){return kn(this.rgba)<.5},r.prototype.isLight=function(){return kn(this.rgba)>=.5},r.prototype.toHex=function(){return t=_n(this.rgba),e=t.r,n=t.g,i=t.b,o=(s=t.a)<1?He(ot(255*s)):"","#"+He(e)+He(n)+He(i)+o;var t,e,n,i,s,o},r.prototype.toRgb=function(){return _n(this.rgba)},r.prototype.toRgbString=function(){return t=_n(this.rgba),e=t.r,n=t.g,i=t.b,(s=t.a)<1?"rgba("+e+", "+n+", "+i+", "+s+")":"rgb("+e+", "+n+", "+i+")";var t,e,n,i,s},r.prototype.toHsl=function(){return br(Pe(this.rgba))},r.prototype.toHslString=function(){return t=br(Pe(this.rgba)),e=t.h,n=t.s,i=t.l,(s=t.a)<1?"hsla("+e+", "+n+"%, "+i+"%, "+s+")":"hsl("+e+", "+n+"%, "+i+"%)";var t,e,n,i,s},r.prototype.toHsv=function(){return t=xr(this.rgba),{h:ot(t.h),s:ot(t.s),v:ot(t.v),a:ot(t.a,3)};var t},r.prototype.invert=function(){return jt({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},r.prototype.saturate=function(t){return t===void 0&&(t=.1),jt(Tn(this.rgba,t))},r.prototype.desaturate=function(t){return t===void 0&&(t=.1),jt(Tn(this.rgba,-t))},r.prototype.grayscale=function(){return jt(Tn(this.rgba,-1))},r.prototype.lighten=function(t){return t===void 0&&(t=.1),jt(Pr(this.rgba,t))},r.prototype.darken=function(t){return t===void 0&&(t=.1),jt(Pr(this.rgba,-t))},r.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},r.prototype.alpha=function(t){return typeof t=="number"?jt({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):ot(this.rgba.a,3);var e},r.prototype.hue=function(t){var e=Pe(this.rgba);return typeof t=="number"?jt({h:t,s:e.s,l:e.l,a:e.a}):ot(e.h)},r.prototype.isEqual=function(t){return this.toHex()===jt(t).toHex()},r})(),jt=function(r){return r instanceof _r?r:new _r(r)};function Q(r){return r==null||r===""||r==="none"}function de(r,t=0,e=10**t){return Math.round(e*r)/e+0}function Ut(r,t=!1){if(typeof r!="object"||!r)return r;if(Array.isArray(r))return t?r.map(n=>Ut(n,t)):r;const e={};for(const n in r){const i=r[n];i!=null&&(t?e[n]=Ut(i,t):e[n]=i)}return e}function Xe(r,t){const e={};return t.forEach(n=>{n in r&&(e[n]=r[n])}),e}function An(r,t){if(r===t)return!0;if(r&&t&&typeof r=="object"&&typeof t=="object"){const e=Array.from(new Set([...Object.keys(r),...Object.keys(t)]));return!e.length||e.every(n=>r[n]===t[n])}return!1}function as(r,t,e){const n=t.length-1;if(n<0)return r===void 0?e:r;for(let i=0;i<n;i++){if(r==null)return e;r=r[t[i]]}return r==null||r[t[n]]===void 0?e:r[t[n]]}function ls(r,t,e){const n=t.length-1;for(let i=0;i<n;i++)typeof r[t[i]]!="object"&&(r[t[i]]={}),r=r[t[i]];r[t[n]]=e}function cs(r,t,e){return r==null||!t||typeof t!="string"?e:r[t]!==void 0?r[t]:(t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,""),as(r,t.split("."),e))}function hs(r,t,e){if(!(typeof r!="object"||!t))return t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,""),ls(r,t.split("."),e)}class us{_observers=new Map;on(t,e){let n=this._observers.get(t);return n===void 0&&this._observers.set(t,n=new Set),n.add(e),this}once(t,e){const n=(...i)=>{this.off(t,n),e(...i)};return this.on(t,n),this}off(t,e){const n=this._observers.get(t);return n!==void 0&&(n.delete(e),n.size===0&&this._observers.delete(t)),this}emit(t,...e){return Array.from((this._observers.get(t)||new Map).values()).forEach(n=>n(...e)),this}destroy(){this._observers=new Map}}const On=Symbol("properties"),Ye=Symbol("inited");function In(r){let t;if(Object.hasOwn(r,On))t=r[On];else{const e=Object.getPrototypeOf(r);t=new Map(e?In(e):void 0),r[On]=t}return t}function Tr(r,t,e,n){const{alias:i,internalKey:s}=n,o=r[t];i?hs(r,i,e):r[s]=e,r.onUpdateProperty?.(t,e??Ze(r,t,n),o)}function kr(r,t,e){const{alias:n,internalKey:i}=e;let s;return n?s=cs(r,n):s=r[i],s=s??Ze(r,t,e),s}function Ze(r,t,e){const{default:n,fallback:i}=e;let s;if(n!==void 0&&!r[Ye]?.[t]){r[Ye]||(r[Ye]={}),r[Ye][t]=!0;const o=typeof n=="function"?n():n;o!==void 0&&(r[t]=o,s=o)}return s===void 0&&i!==void 0&&(s=typeof i=="function"?i():i),s}function fs(r,t){function e(){return typeof this.getProperty<"u"?this.getProperty(r):kr(this,r,t)}function n(i){typeof this.setProperty<"u"?this.setProperty(r,i):Tr(this,r,i,t)}return{get:e,set:n}}function ps(r,t,e={}){const n={...e,internalKey:Symbol(t)};In(r).set(t,n);const i=fs(t,n);Object.defineProperty(r.prototype,t,{get(){return i.get.call(this)},set(s){i.set.call(this,s)},configurable:!0,enumerable:!0})}function te(r){return function(t,e){if(typeof e!="string")throw new TypeError("Failed to @property decorator, prop name cannot be a symbol");ps(t.constructor,e,r)}}class ds extends us{_propertyAccessor;_properties=new Map;_updatedProperties=new Map;_changedProperties=new Set;_updatingPromise=Promise.resolve();_updating=!1;constructor(t){super(),this.setProperties(t)}isDirty(t){return t?this._updatedProperties.has(t):this._updatedProperties.size>0}getProperty(t){const e=this.getPropertyDeclaration(t);if(e){if(e.internal||e.alias)return kr(this,t,e);{let n;return this._propertyAccessor?.getProperty?n=this._propertyAccessor.getProperty(t):n=this._properties.get(t),n??Ze(this,t,e)}}}setProperty(t,e){const n=this.getPropertyDeclaration(t);if(n)if(n.internal||n.alias)Tr(this,t,e,n);else{const i=this.getProperty(t);this._propertyAccessor?.setProperty?.(t,e),this._properties.set(t,e),this.onUpdateProperty?.(t,e??Ze(this,t,n),i)}}getProperties(t){const e={};for(const[n,i]of this.getPropertyDeclarations())!i.internal&&!i.alias&&(!t||t.includes(n))&&(e[n]=this.getProperty(n));return e}setProperties(t){if(t&&typeof t=="object")for(const e in t)this.setProperty(e,t[e]);return this}resetProperties(){for(const[t,e]of this.getPropertyDeclarations())this.setProperty(t,typeof e.default=="function"?e.default():e.default);return this}getPropertyDeclarations(){return In(this.constructor)}getPropertyDeclaration(t){return this.getPropertyDeclarations().get(t)}setPropertyAccessor(t){const e=this.getPropertyDeclarations();this._propertyAccessor=void 0;const n={};return e.forEach((i,s)=>{n[s]=this.getProperty(s)}),this._propertyAccessor=t,e.forEach((i,s)=>{const o=this.getProperty(s),a=n[s];o!==void 0&&!Object.is(o,a)&&(this.setProperty(s,o),!i.internal&&!i.alias&&this.requestUpdate(s,o,a))}),this}async _nextTick(){return"requestAnimationFrame"in globalThis?new Promise(t=>globalThis.requestAnimationFrame(t)):Promise.resolve()}async _enqueueUpdate(){this._updating=!0;try{await this._updatingPromise}catch(t){Promise.reject(t)}await this._nextTick(),this._updating&&(this.onUpdate(),this._updating=!1)}onUpdate(){this._update(this._updatedProperties),this._updatedProperties=new Map}onUpdateProperty(t,e,n){Object.is(e,n)||this.requestUpdate(t,e,n)}requestUpdate(t,e,n){t!==void 0&&(this._updatedProperties.set(t,n),this._changedProperties.add(t),this._updateProperty(t,e,n),this.emit("updateProperty",t,e,n)),this._updating||(this._updatingPromise=this._enqueueUpdate())}_update(t){}_updateProperty(t,e,n){}toJSON(){const t={};return this._properties.forEach((e,n)=>{e!==void 0&&(e&&typeof e=="object"?"toJSON"in e&&typeof e.toJSON=="function"?t[n]=e.toJSON():Array.isArray(e)?t[n]=[...e]:t[n]={...e}:t[n]=e)}),t}clone(){return new this.constructor(this.toJSON())}destroy(){this.emit("destroy"),super.destroy()}}function Ar(r){let t;return typeof r=="number"?t={r:r>>24&255,g:r>>16&255,b:r>>8&255,a:(r&255)/255}:t=r,jt(t)}function gs(r){return{r:de(r.r),g:de(r.g),b:de(r.b),a:de(r.a,3)}}function Ke(r){const t=r.toString(16);return t.length<2?`0${t}`:t}const ys="#000000FF";function ms(r){return Ar(r).isValid()}function At(r,t=!1){const e=Ar(r);if(!e.isValid()){if(typeof r=="string")return r;const a=`Failed to normalizeColor ${r}`;if(t)throw new Error(a);return console.warn(a),ys}const{r:n,g:i,b:s,a:o}=gs(e.rgba);return`#${Ke(n)}${Ke(i)}${Ke(s)}${Ke(de(o*255))}`}var Qe=Qe||{};Qe.parse=(function(){const r={linearGradient:/^(-(webkit|o|ms|moz)-)?(linear-gradient)/i,repeatingLinearGradient:/^(-(webkit|o|ms|moz)-)?(repeating-linear-gradient)/i,radialGradient:/^(-(webkit|o|ms|moz)-)?(radial-gradient)/i,repeatingRadialGradient:/^(-(webkit|o|ms|moz)-)?(repeating-radial-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?((\d*\.\d+)|(\d+\.?)))px/,percentageValue:/^(-?((\d*\.\d+)|(\d+\.?)))%/,emValue:/^(-?((\d*\.\d+)|(\d+\.?)))em/,angleValue:/^(-?((\d*\.\d+)|(\d+\.?)))deg/,radianValue:/^(-?((\d*\.\d+)|(\d+\.?)))rad/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^#([0-9a-f]+)/i,literalColor:/^([a-z]+)/i,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,varColor:/^var/i,calcValue:/^calc/i,variableName:/^(--[a-z0-9-,\s#]+)/i,number:/^((\d*\.\d+)|(\d+\.?))/,hslColor:/^hsl/i,hslaColor:/^hsla/i};let t="";function e(T){const _=new Error(`${t}: ${T}`);throw _.source=t,_}function n(){const T=i();return t.length>0&&e("Invalid input not EOF"),T}function i(){return x(s)}function s(){return o("linear-gradient",r.linearGradient,l)||o("repeating-linear-gradient",r.repeatingLinearGradient,l)||o("radial-gradient",r.radialGradient,u)||o("repeating-radial-gradient",r.repeatingRadialGradient,u)}function o(T,_,U){return a(_,$=>{const q=U();return q&&(I(r.comma)||e("Missing comma before color stops")),{type:T,orientation:q,colorStops:x(C)}})}function a(T,_){const U=I(T);if(U){I(r.startCall)||e("Missing (");const $=_(U);return I(r.endCall)||e("Missing )"),$}}function l(){const T=c();if(T)return T;const _=V("position-keyword",r.positionKeywords,1);return _?{type:"directional",value:_.value}:h()}function c(){return V("directional",r.sideOrCorner,1)}function h(){return V("angular",r.angleValue,1)||V("angular",r.radianValue,1)}function u(){let T,_=p(),U;return _&&(T=[],T.push(_),U=t,I(r.comma)&&(_=p(),_?T.push(_):t=U)),T}function p(){let T=d()||f();if(T)T.at=g();else{const _=y();if(_){T=_;const U=g();U&&(T.at=U)}else{const U=g();if(U)T={type:"default-radial",at:U};else{const $=M();$&&(T={type:"default-radial",at:$})}}}return T}function d(){const T=V("shape",/^(circle)/i,0);return T&&(T.style=L()||y()),T}function f(){const T=V("shape",/^(ellipse)/i,0);return T&&(T.style=M()||A()||y()),T}function y(){return V("extent-keyword",r.extentKeywords,1)}function g(){if(V("position",/^at/,0)){const T=M();return T||e("Missing positioning value"),T}}function M(){const T=P();if(T.x||T.y)return{type:"position",value:T}}function P(){return{x:A(),y:A()}}function x(T){let _=T();const U=[];if(_)for(U.push(_);I(r.comma);)_=T(),_?U.push(_):e("One extra comma");return U}function C(){const T=w();return T||e("Expected color definition"),T.length=A(),T}function w(){return S()||F()||E()||D()||b()||z()||v()}function v(){return V("literal",r.literalColor,0)}function S(){return V("hex",r.hexColor,1)}function b(){return a(r.rgbColor,()=>({type:"rgb",value:x(B)}))}function D(){return a(r.rgbaColor,()=>({type:"rgba",value:x(B)}))}function z(){return a(r.varColor,()=>({type:"var",value:N()}))}function E(){return a(r.hslColor,()=>{I(r.percentageValue)&&e("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");const _=B();I(r.comma);let U=I(r.percentageValue);const $=U?U[1]:null;I(r.comma),U=I(r.percentageValue);const q=U?U[1]:null;return(!$||!q)&&e("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[_,$,q]}})}function F(){return a(r.hslaColor,()=>{const T=B();I(r.comma);let _=I(r.percentageValue);const U=_?_[1]:null;I(r.comma),_=I(r.percentageValue);const $=_?_[1]:null;I(r.comma);const q=B();return(!U||!$)&&e("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[T,U,$,q]}})}function N(){return I(r.variableName)[1]}function B(){return I(r.number)[1]}function A(){return V("%",r.percentageValue,1)||W()||O()||L()}function W(){return V("position-keyword",r.positionKeywords,1)}function O(){return a(r.calcValue,()=>{let T=1,_=0;for(;T>0&&_<t.length;){const $=t.charAt(_);$==="("?T++:$===")"&&T--,_++}T>0&&e("Missing closing parenthesis in calc() expression");const U=t.substring(0,_-1);return R(_-1),{type:"calc",value:U}})}function L(){return V("px",r.pixelValue,1)||V("em",r.emValue,1)}function V(T,_,U){const $=I(_);if($)return{type:T,value:$[U]}}function I(T){let _,U;return U=/^\s+/.exec(t),U&&R(U[0].length),_=T.exec(t),_&&R(_[0].length),_}function R(T){t=t.substr(T)}return function(T){return t=T.toString().trim(),t.endsWith(";")&&(t=t.slice(0,-1)),n()}})();const Or=Qe.parse.bind(Qe);var Je=Je||{};Je.stringify=(function(){var r={"visit_linear-gradient":function(t){return r.visit_gradient(t)},"visit_repeating-linear-gradient":function(t){return r.visit_gradient(t)},"visit_radial-gradient":function(t){return r.visit_gradient(t)},"visit_repeating-radial-gradient":function(t){return r.visit_gradient(t)},visit_gradient:function(t){var e=r.visit(t.orientation);return e&&(e+=", "),t.type+"("+e+r.visit(t.colorStops)+")"},visit_shape:function(t){var e=t.value,n=r.visit(t.at),i=r.visit(t.style);return i&&(e+=" "+i),n&&(e+=" at "+n),e},"visit_default-radial":function(t){var e="",n=r.visit(t.at);return n&&(e+=n),e},"visit_extent-keyword":function(t){var e=t.value,n=r.visit(t.at);return n&&(e+=" at "+n),e},"visit_position-keyword":function(t){return t.value},visit_position:function(t){return r.visit(t.value.x)+" "+r.visit(t.value.y)},"visit_%":function(t){return t.value+"%"},visit_em:function(t){return t.value+"em"},visit_px:function(t){return t.value+"px"},visit_calc:function(t){return"calc("+t.value+")"},visit_literal:function(t){return r.visit_color(t.value,t)},visit_hex:function(t){return r.visit_color("#"+t.value,t)},visit_rgb:function(t){return r.visit_color("rgb("+t.value.join(", ")+")",t)},visit_rgba:function(t){return r.visit_color("rgba("+t.value.join(", ")+")",t)},visit_hsl:function(t){return r.visit_color("hsl("+t.value[0]+", "+t.value[1]+"%, "+t.value[2]+"%)",t)},visit_hsla:function(t){return r.visit_color("hsla("+t.value[0]+", "+t.value[1]+"%, "+t.value[2]+"%, "+t.value[3]+")",t)},visit_var:function(t){return r.visit_color("var("+t.value+")",t)},visit_color:function(t,e){var n=t,i=r.visit(e.length);return i&&(n+=" "+i),n},visit_angular:function(t){return t.value+"deg"},visit_directional:function(t){return"to "+t.value},visit_array:function(t){var e="",n=t.length;return t.forEach(function(i,s){e+=r.visit(i),s<n-1&&(e+=", ")}),e},visit_object:function(t){return t.width&&t.height?r.visit(t.width)+" "+r.visit(t.height):""},visit:function(t){if(!t)return"";if(t instanceof Array)return r.visit_array(t);if(typeof t=="object"&&!t.type)return r.visit_object(t);if(t.type){var e=r["visit_"+t.type];if(e)return e(t);throw Error("Missing visitor visit_"+t.type)}else throw Error("Invalid node.")}};return function(t){return r.visit(t)}})(),Je.stringify.bind(Je);function Ir(r){const t=r.length-1;return r.map((e,n)=>{const i=e.value;let s=de(n/t,3),o="#00000000";switch(e.type){case"rgb":o=At({r:Number(i[0]??0),g:Number(i[1]??0),b:Number(i[2]??0)});break;case"rgba":o=At({r:Number(i[0]??0),g:Number(i[1]??0),b:Number(i[2]??0),a:Number(i[3]??0)});break;case"literal":o=At(e.value);break;case"hex":o=At(`#${e.value}`);break}return e.length?.type==="%"&&(s=Number(e.length.value)/100),{offset:s,color:o}})}function Er(r){let t=0;return r.orientation?.type==="angular"&&(t=Number(r.orientation.value)),{type:"linear-gradient",angle:t,stops:Ir(r.colorStops)}}function Br(r){return r.orientation?.map(t=>{switch(t?.type){default:return null}}),{type:"radial-gradient",stops:Ir(r.colorStops)}}function _e(r){return r.startsWith("linear-gradient(")||r.startsWith("radial-gradient(")}function xs(r){return Or(r).map(t=>{switch(t?.type){case"linear-gradient":return Er(t);case"repeating-linear-gradient":return{...Er(t),repeat:!0};case"radial-gradient":return Br(t);case"repeating-radial-gradient":return{...Br(t),repeat:!0};default:return}}).filter(Boolean)}function vs(r){let t;return typeof r=="string"?t={color:r}:t={...r},{color:At(t.color)}}function ws(r){let t;if(typeof r=="string"?t={image:r}:t={...r},t.image){const{type:e,...n}=xs(t.image)[0]??{};switch(e){case"radial-gradient":return{radialGradient:n};case"linear-gradient":return{linearGradient:n}}}return Xe(t,["linearGradient","radialGradient","rotateWithShape"])}function bs(r){let t;return typeof r=="string"?t={image:r}:t={...r},Xe(t,["image","cropRect","stretchRect","tile","dpi","opacity","rotateWithShape"])}function Ss(r){let t;return typeof r=="string"?t={preset:r}:t={...r},Q(t.foregroundColor)?delete t.foregroundColor:t.foregroundColor=At(t.foregroundColor),Q(t.backgroundColor)?delete t.backgroundColor:t.backgroundColor=At(t.backgroundColor),Xe(t,["preset","foregroundColor","backgroundColor"])}function Cs(r){return!Q(r.color)}function Ms(r){return typeof r=="string"?ms(r):Cs(r)}function Ps(r){return!Q(r.image)&&_e(r.image)||!!r.linearGradient||!!r.radialGradient}function _s(r){return typeof r=="string"?_e(r):Ps(r)}function Ts(r){return!Q(r.image)&&!_e(r.image)}function ks(r){return typeof r=="string"?!_e(r):Ts(r)}function As(r){return!Q(r.preset)}function Os(r){return typeof r=="string"?!1:As(r)}function Te(r){const t=r&&typeof r=="object"?r.enabled:void 0;return Ms(r)?Ut({enabled:t,...vs(r)}):_s(r)?Ut({enabled:t,...ws(r)}):ks(r)?Ut({enabled:t,...bs(r)}):Os(r)?Ut({enabled:t,...Ss(r)}):{}}function En(r){return typeof r=="string"?{...Te(r)}:{...Te(r),...Xe(r,["width","style","lineCap","lineJoin","headEnd","tailEnd"])}}function Is(){return{boxShadow:"none"}}function Es(){return{overflow:"visible",direction:void 0,display:void 0,boxSizing:void 0,width:void 0,height:void 0,maxHeight:void 0,maxWidth:void 0,minHeight:void 0,minWidth:void 0,position:void 0,left:0,top:0,right:void 0,bottom:void 0,borderTop:void 0,borderLeft:void 0,borderRight:void 0,borderBottom:void 0,borderWidth:0,border:void 0,flex:void 0,flexBasis:void 0,flexDirection:void 0,flexGrow:void 0,flexShrink:void 0,flexWrap:void 0,justifyContent:void 0,gap:void 0,alignContent:void 0,alignItems:void 0,alignSelf:void 0,marginTop:void 0,marginLeft:void 0,marginRight:void 0,marginBottom:void 0,margin:void 0,paddingTop:void 0,paddingLeft:void 0,paddingRight:void 0,paddingBottom:void 0,padding:void 0}}function Bs(){return{rotate:0,scaleX:1,scaleY:1,skewX:0,skewY:0,translateX:0,translateY:0,transform:"none",transformOrigin:"center"}}function Ds(){return{...Es(),...Bs(),...Is(),backgroundImage:"none",backgroundSize:"auto, auto",backgroundColor:"none",backgroundColormap:"none",borderRadius:0,borderColor:"none",borderStyle:"solid",outlineWidth:0,outlineOffset:0,outlineColor:"none",outlineStyle:"none",visibility:"visible",filter:"none",opacity:1,pointerEvents:"auto",maskImage:"none"}}function Fs(){return{highlight:{},highlightImage:"none",highlightReferImage:"none",highlightColormap:"none",highlightLine:"none",highlightSize:"cover",highlightThickness:"100%"}}function Us(){return{listStyle:{},listStyleType:"none",listStyleImage:"none",listStyleColormap:"none",listStyleSize:"cover",listStylePosition:"outside"}}function Ls(){return{...Fs(),color:"#000000",verticalAlign:"baseline",letterSpacing:0,wordSpacing:0,fontSize:14,fontWeight:"normal",fontFamily:"",fontStyle:"normal",fontKerning:"normal",textTransform:"none",textOrientation:"mixed",textDecoration:"none"}}function $s(){return{...Us(),writingMode:"horizontal-tb",textWrap:"wrap",textAlign:"start",textIndent:0,lineHeight:1.2}}function Ns(){return{...$s(),...Ls(),textStrokeWidth:0,textStrokeColor:"none"}}function tn(r){return Ut({...r,color:Q(r.color)?void 0:At(r.color),backgroundColor:Q(r.backgroundColor)?void 0:At(r.backgroundColor),borderColor:Q(r.borderColor)?void 0:At(r.borderColor),outlineColor:Q(r.outlineColor)?void 0:At(r.outlineColor),shadowColor:Q(r.shadowColor)?void 0:At(r.shadowColor),textStrokeColor:Q(r.textStrokeColor)?void 0:At(r.textStrokeColor)})}function zs(){return{...Ds(),...Ns()}}const Rs=/\r\n|\n\r|\n|\r/,Vs=new RegExp(`^(${Rs.source})$`),js=`
2
2
  `;function Gs(r){return Vs.test(r)}function Dr(r){const t=[];function e(){return t[t.length-1]}function n(a,l,c){const h=a?tn(a):{},u=l?Te(l):void 0,p=c?En(c):void 0,d=Ut({...h,fill:u,outline:p,fragments:[]});return t[t.length-1]?.fragments.length===0?t[t.length-1]=d:t.push(d),d}function i(a="",l,c,h){const u=l?tn(l):{},p=c?Te(c):void 0,d=h?En(h):void 0;Array.from(a).forEach(f=>{if(Gs(f)){const{fragments:y,fill:g,outline:M,...P}=e()||n();y.length||y.push(Ut({...u,fill:p,outline:d,content:js})),n(P,g,M)}else{const y=e()||n(),g=y.fragments[y.fragments.length-1];if(g){const{content:M,fill:P,outline:x,...C}=g;if(An(p,P)&&An(d,x)&&An(u,C)){g.content=`${M}${f}`;return}}y.fragments.push(Ut({...u,fill:p,outline:d,content:f}))}})}(Array.isArray(r)?r:[r]).forEach(a=>{if(typeof a=="string")n(),i(a);else if(Fr(a)){const{content:l,fill:c,outline:h,...u}=a;n(u,c,h),i(l)}else if(qs(a)){const{fragments:l,fill:c,outline:h,...u}=a;n(u,c,h),l.forEach(p=>{const{content:d,fill:f,outline:y,...g}=p;i(d,g,f,y)})}else Array.isArray(a)?(n(),a.forEach(l=>{if(typeof l=="string")i(l);else if(Fr(l)){const{content:c,fill:h,outline:u,...p}=l;i(c,p,h,u)}})):console.warn("Failed to parse text content",a)});const o=e();return o&&!o.fragments.length&&o.fragments.push({content:""}),t}function qs(r){return r&&typeof r=="object"&&"fragments"in r&&Array.isArray(r.fragments)}function Fr(r){return r&&typeof r=="object"&&"content"in r&&typeof r.content=="string"}function Ws(r){return typeof r=="string"||Array.isArray(r)?{content:Dr(r)}:Ut({...r,content:Dr(r.content??""),style:r.style?tn(r.style):void 0,effects:r.effects?r.effects.map(t=>tn(t)):void 0,measureDom:r.measureDom,fonts:r.fonts,fill:r.fill?Te(r.fill):void 0,outline:r.outline?En(r.outline):void 0})}function Hs(r,t,e=2){const n=t&&t.length,i=n?t[0]*e:r.length;let s=Ur(r,0,i,e,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,c;if(n&&(s=Qs(r,t,s,e)),r.length>80*e){a=r[0],l=r[1];let h=a,u=l;for(let p=e;p<i;p+=e){const d=r[p],f=r[p+1];d<a&&(a=d),f<l&&(l=f),d>h&&(h=d),f>u&&(u=f)}c=Math.max(h-a,u-l),c=c!==0?32767/c:0}return ke(s,o,e,a,l,c,0),o}function Ur(r,t,e,n,i){let s;if(i===co(r,t,e,n)>0)for(let o=t;o<e;o+=n)s=zr(o/n|0,r[o],r[o+1],s);else for(let o=e-n;o>=t;o-=n)s=zr(o/n|0,r[o],r[o+1],s);return s&&ge(s,s.next)&&(Ie(s),s=s.next),s}function ce(r,t){if(!r)return r;t||(t=r);let e=r,n;do if(n=!1,!e.steiner&&(ge(e,e.next)||tt(e.prev,e,e.next)===0)){if(Ie(e),e=t=e.prev,e===e.next)break;n=!0}else e=e.next;while(n||e!==t);return t}function ke(r,t,e,n,i,s,o){if(!r)return;!o&&s&&ro(r,n,i,s);let a=r;for(;r.prev!==r.next;){const l=r.prev,c=r.next;if(s?Ys(r,n,i,s):Xs(r)){t.push(l.i,r.i,c.i),Ie(r),r=c.next,a=c.next;continue}if(r=c,r===a){o?o===1?(r=Zs(ce(r),t),ke(r,t,e,n,i,s,2)):o===2&&Ks(r,t,e,n,i,s):ke(ce(r),t,e,n,i,s,1);break}}}function Xs(r){const t=r.prev,e=r,n=r.next;if(tt(t,e,n)>=0)return!1;const i=t.x,s=e.x,o=n.x,a=t.y,l=e.y,c=n.y,h=Math.min(i,s,o),u=Math.min(a,l,c),p=Math.max(i,s,o),d=Math.max(a,l,c);let f=n.next;for(;f!==t;){if(f.x>=h&&f.x<=p&&f.y>=u&&f.y<=d&&Ae(i,a,s,l,o,c,f.x,f.y)&&tt(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function Ys(r,t,e,n){const i=r.prev,s=r,o=r.next;if(tt(i,s,o)>=0)return!1;const a=i.x,l=s.x,c=o.x,h=i.y,u=s.y,p=o.y,d=Math.min(a,l,c),f=Math.min(h,u,p),y=Math.max(a,l,c),g=Math.max(h,u,p),M=Bn(d,f,t,e,n),P=Bn(y,g,t,e,n);let x=r.prevZ,C=r.nextZ;for(;x&&x.z>=M&&C&&C.z<=P;){if(x.x>=d&&x.x<=y&&x.y>=f&&x.y<=g&&x!==i&&x!==o&&Ae(a,h,l,u,c,p,x.x,x.y)&&tt(x.prev,x,x.next)>=0||(x=x.prevZ,C.x>=d&&C.x<=y&&C.y>=f&&C.y<=g&&C!==i&&C!==o&&Ae(a,h,l,u,c,p,C.x,C.y)&&tt(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;x&&x.z>=M;){if(x.x>=d&&x.x<=y&&x.y>=f&&x.y<=g&&x!==i&&x!==o&&Ae(a,h,l,u,c,p,x.x,x.y)&&tt(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;C&&C.z<=P;){if(C.x>=d&&C.x<=y&&C.y>=f&&C.y<=g&&C!==i&&C!==o&&Ae(a,h,l,u,c,p,C.x,C.y)&&tt(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function Zs(r,t){let e=r;do{const n=e.prev,i=e.next.next;!ge(n,i)&&$r(n,e,e.next,i)&&Oe(n,i)&&Oe(i,n)&&(t.push(n.i,e.i,i.i),Ie(e),Ie(e.next),e=r=i),e=e.next}while(e!==r);return ce(e)}function Ks(r,t,e,n,i,s){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&oo(o,a)){let l=Nr(o,a);o=ce(o,o.next),l=ce(l,l.next),ke(o,t,e,n,i,s,0),ke(l,t,e,n,i,s,0);return}a=a.next}o=o.next}while(o!==r)}function Qs(r,t,e,n){const i=[];for(let s=0,o=t.length;s<o;s++){const a=t[s]*n,l=s<o-1?t[s+1]*n:r.length,c=Ur(r,a,l,n,!1);c===c.next&&(c.steiner=!0),i.push(so(c))}i.sort(Js);for(let s=0;s<i.length;s++)e=to(i[s],e);return e}function Js(r,t){let e=r.x-t.x;if(e===0&&(e=r.y-t.y,e===0)){const n=(r.next.y-r.y)/(r.next.x-r.x),i=(t.next.y-t.y)/(t.next.x-t.x);e=n-i}return e}function to(r,t){const e=eo(r,t);if(!e)return t;const n=Nr(e,r);return ce(n,n.next),ce(e,e.next)}function eo(r,t){let e=t;const n=r.x,i=r.y;let s=-1/0,o;if(ge(r,e))return e;do{if(ge(r,e.next))return e.next;if(i<=e.y&&i>=e.next.y&&e.next.y!==e.y){const u=e.x+(i-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(u<=n&&u>s&&(s=u,o=e.x<e.next.x?e:e.next,u===n))return o}e=e.next}while(e!==t);if(!o)return null;const a=o,l=o.x,c=o.y;let h=1/0;e=o;do{if(n>=e.x&&e.x>=l&&n!==e.x&&Lr(i<c?n:s,i,l,c,i<c?s:n,i,e.x,e.y)){const u=Math.abs(i-e.y)/(n-e.x);Oe(e,r)&&(u<h||u===h&&(e.x>o.x||e.x===o.x&&no(o,e)))&&(o=e,h=u)}e=e.next}while(e!==a);return o}function no(r,t){return tt(r.prev,r,t.prev)<0&&tt(t.next,r,r.next)<0}function ro(r,t,e,n){let i=r;do i.z===0&&(i.z=Bn(i.x,i.y,t,e,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,io(i)}function io(r){let t,e=1;do{let n=r,i;r=null;let s=null;for(t=0;n;){t++;let o=n,a=0;for(let c=0;c<e&&(a++,o=o.nextZ,!!o);c++);let l=e;for(;a>0||l>0&&o;)a!==0&&(l===0||!o||n.z<=o.z)?(i=n,n=n.nextZ,a--):(i=o,o=o.nextZ,l--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;n=o}s.nextZ=null,e*=2}while(t>1);return r}function Bn(r,t,e,n,i){return r=(r-e)*i|0,t=(t-n)*i|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function so(r){let t=r,e=r;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==r);return e}function Lr(r,t,e,n,i,s,o,a){return(i-o)*(t-a)>=(r-o)*(s-a)&&(r-o)*(n-a)>=(e-o)*(t-a)&&(e-o)*(s-a)>=(i-o)*(n-a)}function Ae(r,t,e,n,i,s,o,a){return!(r===o&&t===a)&&Lr(r,t,e,n,i,s,o,a)}function oo(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!ao(r,t)&&(Oe(r,t)&&Oe(t,r)&&lo(r,t)&&(tt(r.prev,r,t.prev)||tt(r,t.prev,t))||ge(r,t)&&tt(r.prev,r,r.next)>0&&tt(t.prev,t,t.next)>0)}function tt(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function ge(r,t){return r.x===t.x&&r.y===t.y}function $r(r,t,e,n){const i=nn(tt(r,t,e)),s=nn(tt(r,t,n)),o=nn(tt(e,n,r)),a=nn(tt(e,n,t));return!!(i!==s&&o!==a||i===0&&en(r,e,t)||s===0&&en(r,n,t)||o===0&&en(e,r,n)||a===0&&en(e,t,n))}function en(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function nn(r){return r>0?1:r<0?-1:0}function ao(r,t){let e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&$r(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function Oe(r,t){return tt(r.prev,r,r.next)<0?tt(r,t,r.next)>=0&&tt(r,r.prev,t)>=0:tt(r,t,r.prev)<0||tt(r,r.next,t)<0}function lo(r,t){let e=r,n=!1;const i=(r.x+t.x)/2,s=(r.y+t.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&i<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(n=!n),e=e.next;while(e!==r);return n}function Nr(r,t){const e=Dn(r.i,r.x,r.y),n=Dn(t.i,t.x,t.y),i=r.next,s=t.prev;return r.next=t,t.prev=r,e.next=i,i.prev=e,n.next=e,e.prev=n,s.next=n,n.prev=s,n}function zr(r,t,e,n){const i=Dn(r,t,e);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ie(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Dn(r,t,e){return{i:r,x:t,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function co(r,t,e,n){let i=0;for(let s=t,o=e-n;s<e;s+=n)i+=(r[o]-r[s])*(r[s+1]+r[o+1]),o=s;return i}function ho(r,t,e,n={}){const{radius:i=1}=n;r.moveTo(t,e),r.arc(t,e,i,0,Math.PI*2)}const uo={arcs:"bevel",bevel:"bevel",miter:"miter","miter-clip":"miter",round:"round"};function Fn(r,t){const{fill:e="#000",stroke:n="none",strokeWidth:i=n==="none"?0:1,strokeLinecap:s="round",strokeLinejoin:o="miter",strokeMiterlimit:a=0,strokeDasharray:l=[],strokeDashoffset:c=0,shadowOffsetX:h=0,shadowOffsetY:u=0,shadowBlur:p=0,shadowColor:d="rgba(0, 0, 0, 0)"}=t;r.fillStyle=e,r.strokeStyle=n,r.lineWidth=i,r.lineCap=s,r.lineJoin=uo[o],r.miterLimit=a,r.setLineDash(l),r.lineDashOffset=c,r.shadowOffsetX=h,r.shadowOffsetY=u,r.shadowBlur=p,r.shadowColor=d}class k{constructor(t=0,e=0){this.x=t,this.y=e}static get MAX(){return new k(1/0,1/0)}static get MIN(){return new k(-1/0,-1/0)}get array(){return[this.x,this.y]}finite(){return this.x=Number.isFinite(this.x)?this.x:0,this.y=Number.isFinite(this.y)?this.y:0,this}set(t,e){return this.x=t,this.y=e,this}add(t){return this.x+=t.x,this.y+=t.y,this}sub(t){return this.x-=t.x,this.y-=t.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}divide(t){return this.x/=t.x,this.y/=t.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}rotate(t,e={x:0,y:0}){const n=-t/180*Math.PI,i=this.x-e.x,s=-(this.y-e.y),o=Math.sin(n),a=Math.cos(n);return this.set(e.x+(i*a-s*o),e.y-(i*o+s*a)),this}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}lengthSquared(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.lengthSquared())}scale(t,e=t,n={x:0,y:0}){const i=t<0?n.x-this.x+n.x:this.x,s=e<0?n.y-this.y+n.y:this.y;return this.x=i*Math.abs(t),this.y=s*Math.abs(e),this}skew(t,e=0,n={x:0,y:0}){const i=this.x-n.x,s=this.y-n.y;return this.x=n.x+(i+Math.tan(t)*s),this.y=n.y+(s+Math.tan(e)*i),this}min(...t){return this.x=Math.min(this.x,...t.map(e=>e.x)),this.y=Math.min(this.y,...t.map(e=>e.y)),this}max(...t){return this.x=Math.max(this.x,...t.map(e=>e.x)),this.y=Math.max(this.y,...t.map(e=>e.y)),this}normalize(){return this.scale(1/(this.length()||1))}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this}divideVectors(t,e){return this.x=t.x/e.x,this.y=t.y/e.y,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return this.x===t.x&&this.y===t.y}applyMatrix3(t){const e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}copy(t){return this.x=t.x,this.y=t.y,this}clone(){return new k(this.x,this.y)}}class H{constructor(t=0,e=0,n=0,i=0){this.left=t,this.top=e,this.width=n,this.height=i}get x(){return this.left}set x(t){this.left=t}get y(){return this.top}set y(t){this.top=t}get right(){return this.left+this.width}get bottom(){return this.top+this.height}get center(){return new k((this.left+this.right)/2,(this.top+this.bottom)/2)}get array(){return[this.left,this.top,this.width,this.height]}static from(...t){if(t.length===0)return new H;if(t.length===1)return t[0].clone();const e=t[0],n=t.slice(1).reduce((i,s)=>(i.left=Math.min(i.left,s.left),i.top=Math.min(i.top,s.top),i.right=Math.max(i.right,s.right),i.bottom=Math.max(i.bottom,s.bottom),i),{left:e?.left??0,top:e?.top??0,right:e?.right??0,bottom:e?.bottom??0});return new H(n.left,n.top,n.right-n.left,n.bottom-n.top)}translate(t,e){return this.left+=t,this.top+=e,this}copy(t){return this.left=t.left,this.top=t.top,this.width=t.width,this.height=t.height,this}clone(){return new H(this.left,this.top,this.width,this.height)}}class vt{elements=[];constructor(t=1,e=0,n=0,i=0,s=1,o=0,a=0,l=0,c=1){this.set(t,e,n,i,s,o,a,l,c)}set(t,e,n,i,s,o,a,l,c){const h=this.elements;return h[0]=t,h[1]=i,h[2]=a,h[3]=e,h[4]=s,h[5]=l,h[6]=n,h[7]=o,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],h=n[4],u=n[7],p=n[2],d=n[5],f=n[8],y=i[0],g=i[3],M=i[6],P=i[1],x=i[4],C=i[7],w=i[2],v=i[5],S=i[8];return s[0]=o*y+a*P+l*w,s[3]=o*g+a*x+l*v,s[6]=o*M+a*C+l*S,s[1]=c*y+h*P+u*w,s[4]=c*g+h*x+u*v,s[7]=c*M+h*C+u*S,s[2]=p*y+d*P+f*w,s[5]=p*g+d*x+f*v,s[8]=p*M+d*C+f*S,this}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8],u=h*o-a*c,p=a*l-h*s,d=c*s-o*l,f=e*u+n*p+i*d;if(f===0)return this.set(0,0,0,0,0,0,0,0,0);const y=1/f;return t[0]=u*y,t[1]=(i*c-h*n)*y,t[2]=(a*n-i*o)*y,t[3]=p*y,t[4]=(h*e-i*l)*y,t[5]=(i*s-a*e)*y,t[6]=d*y,t[7]=(n*l-c*e)*y,t[8]=(o*e-n*s)*y,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}scale(t,e){return this.premultiply(Un.makeScale(t,e)),this}rotate(t){return this.premultiply(Un.makeRotation(-t)),this}translate(t,e){return this.premultiply(Un.makeTranslation(t,e)),this}makeTranslation(t,e){return this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}clone(){return new this.constructor().fromArray(this.elements)}}const Un=new vt;function Rr(r,t,e,n){const i=r*e+t*n,s=Math.sqrt(r*r+t*t)*Math.sqrt(e*e+n*n);let o=Math.acos(Math.max(-1,Math.min(1,i/s)));return r*n-t*e<0&&(o=-o),o}function fo(r,t,e,n,i,s,o,a){if(t===0||e===0){r.lineTo(a.x,a.y);return}n=n*Math.PI/180,t=Math.abs(t),e=Math.abs(e);const l=(o.x-a.x)/2,c=(o.y-a.y)/2,h=Math.cos(n)*l+Math.sin(n)*c,u=-Math.sin(n)*l+Math.cos(n)*c;let p=t*t,d=e*e;const f=h*h,y=u*u,g=f/p+y/d;if(g>1){const z=Math.sqrt(g);t=z*t,e=z*e,p=t*t,d=e*e}const M=p*y+d*f,P=(p*d-M)/M;let x=Math.sqrt(Math.max(0,P));i===s&&(x=-x);const C=x*t*u/e,w=-x*e*h/t,v=Math.cos(n)*C-Math.sin(n)*w+(o.x+a.x)/2,S=Math.sin(n)*C+Math.cos(n)*w+(o.y+a.y)/2,b=Rr(1,0,(h-C)/t,(u-w)/e),D=Rr((h-C)/t,(u-w)/e,(-h-C)/t,(-u-w)/e)%(Math.PI*2);r.ellipse(v,S,t,e,n,b,b+D,s===0)}const rt={WHITESPACE:/[ \t\r\n]/,DIGIT:/\d/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};function Gt(r,t,e=0){let a=0,l=!0,c="",h="";const u=[];function p(g,M,P){const x=new SyntaxError(`Unexpected character "${g}" at index ${M}.`);throw x.partial=P,x}function d(){c!==""&&(h===""?u.push(Number(c)):u.push(Number(c)*10**Number(h))),c="",h=""}let f;const y=r.length;for(let g=0;g<y;g++){if(f=r[g],Array.isArray(t)&&t.includes(u.length%e)&&rt.FLAGS.test(f)){a=1,c=f,d();continue}if(a===0){if(rt.WHITESPACE.test(f))continue;if(rt.DIGIT.test(f)||rt.SIGN.test(f)){a=1,c=f;continue}if(rt.POINT.test(f)){a=2,c=f;continue}rt.COMMA.test(f)&&(l&&p(f,g,u),l=!0)}if(a===1){if(rt.DIGIT.test(f)){c+=f;continue}if(rt.POINT.test(f)){c+=f,a=2;continue}if(rt.EXP.test(f)){a=3;continue}rt.SIGN.test(f)&&c.length===1&&rt.SIGN.test(c[0])&&p(f,g,u)}if(a===2){if(rt.DIGIT.test(f)){c+=f;continue}if(rt.EXP.test(f)){a=3;continue}rt.POINT.test(f)&&c[c.length-1]==="."&&p(f,g,u)}if(a===3){if(rt.DIGIT.test(f)){h+=f;continue}if(rt.SIGN.test(f)){if(h===""){h+=f;continue}h.length===1&&rt.SIGN.test(h)&&p(f,g,u)}}rt.WHITESPACE.test(f)?(d(),a=0,l=!1):rt.COMMA.test(f)?(d(),a=0,l=!0):rt.SIGN.test(f)?(d(),a=1,c=f):rt.POINT.test(f)?(d(),a=2,c=f):p(f,g,u)}return d(),u}function ye(r,t){return r-(t-r)}function Vr(r,t){const e=new k,n=new k;for(let i=0,s=r.length;i<s;i++){const o=r[i];if(o.type==="m"||o.type==="M")o.type==="m"?e.add(o):e.copy(o),t.moveTo(e.x,e.y),n.copy(e);else if(o.type==="h"||o.type==="H")o.type==="h"?e.x+=o.x:e.x=o.x,t.lineTo(e.x,e.y),n.copy(e);else if(o.type==="v"||o.type==="V")o.type==="v"?e.y+=o.y:e.y=o.y,t.lineTo(e.x,e.y),n.copy(e);else if(o.type==="l"||o.type==="L")o.type==="l"?e.add(o):e.copy(o),t.lineTo(e.x,e.y),n.copy(e);else if(o.type==="c"||o.type==="C")o.type==="c"?(t.bezierCurveTo(e.x+o.x1,e.y+o.y1,e.x+o.x2,e.y+o.y2,e.x+o.x,e.y+o.y),n.x=e.x+o.x2,n.y=e.y+o.y2,e.add(o)):(t.bezierCurveTo(o.x1,o.y1,o.x2,o.y2,o.x,o.y),n.x=o.x2,n.y=o.y2,e.copy(o));else if(o.type==="s"||o.type==="S")o.type==="s"?(t.bezierCurveTo(ye(e.x,n.x),ye(e.y,n.y),e.x+o.x2,e.y+o.y2,e.x+o.x,e.y+o.y),n.x=e.x+o.x2,n.y=e.y+o.y2,e.add(o)):(t.bezierCurveTo(ye(e.x,n.x),ye(e.y,n.y),o.x2,o.y2,o.x,o.y),n.x=o.x2,n.y=o.y2,e.copy(o));else if(o.type==="q"||o.type==="Q")o.type==="q"?(t.quadraticCurveTo(e.x+o.x1,e.y+o.y1,e.x+o.x,e.y+o.y),n.x=e.x+o.x1,n.y=e.y+o.y1,e.add(o)):(t.quadraticCurveTo(o.x1,o.y1,o.x,o.y),n.x=o.x1,n.y=o.y1,e.copy(o));else if(o.type==="t"||o.type==="T"){const a=ye(e.x,n.x),l=ye(e.y,n.y);n.x=a,n.y=l,o.type==="t"?(t.quadraticCurveTo(a,l,e.x+o.x,e.y+o.y),e.add(o)):(t.quadraticCurveTo(a,l,o.x,o.y),e.copy(o))}else if(o.type==="a"||o.type==="A"){const a=e.clone();if(o.type==="a"){if(o.x===0&&o.y===0)continue;e.add(o)}else{if(e.equals(o))continue;e.copy(o)}n.copy(e),fo(t,o.rx,o.ry,o.angle,o.largeArcFlag,o.sweepFlag,a,e)}else o.type==="z"||o.type==="Z"?(t.startPoint&&e.copy(t.startPoint),t.closePath()):console.warn("Unsupported commands",o)}}function po(r){let t,e;const n=[];for(let i=0,s=r.length;i<s;i++){const o=r[i];switch(o.type){case"m":case"M":if(o.x.toFixed(4)===e?.x.toFixed(4)&&o.y.toFixed(4)===e?.y.toFixed(4))continue;n.push(`${o.type} ${o.x} ${o.y}`),e={x:o.x,y:o.y},t={x:o.x,y:o.y};break;case"h":case"H":n.push(`${o.type} ${o.x}`),e={x:o.x,y:e?.y??0};break;case"v":case"V":n.push(`${o.type} ${o.y}`),e={x:e?.x??0,y:o.y};break;case"l":case"L":n.push(`${o.type} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"c":case"C":n.push(`${o.type} ${o.x1} ${o.y1} ${o.x2} ${o.y2} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"s":case"S":n.push(`${o.type} ${o.x2} ${o.y2} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"q":case"Q":n.push(`${o.type} ${o.x1} ${o.y1} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"t":case"T":n.push(`${o.type} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"a":case"A":n.push(`${o.type} ${o.rx} ${o.ry} ${o.angle} ${o.largeArcFlag} ${o.sweepFlag} ${o.x} ${o.y}`),e={x:o.x,y:o.y};break;case"z":case"Z":n.push(o.type),t&&(e={x:t.x,y:t.y});break}}return n.join(" ")}const go=/[a-df-z][^a-df-z]*/gi;function jr(r){const t=[],e=r.match(go);if(!e)return t;for(let n=0,i=e.length;n<i;n++){const s=e[n],o=s.charAt(0),a=s.slice(1).trim();let l;switch(o){case"m":case"M":l=Gt(a);for(let c=0,h=l.length;c<h;c+=2)c===0?t.push({type:o,x:l[c],y:l[c+1]}):t.push({type:o==="m"?"l":"L",x:l[c],y:l[c+1]});break;case"h":case"H":l=Gt(a);for(let c=0,h=l.length;c<h;c++)t.push({type:o,x:l[c]});break;case"v":case"V":l=Gt(a);for(let c=0,h=l.length;c<h;c++)t.push({type:o,y:l[c]});break;case"l":case"L":l=Gt(a);for(let c=0,h=l.length;c<h;c+=2)t.push({type:o,x:l[c],y:l[c+1]});break;case"c":case"C":l=Gt(a);for(let c=0,h=l.length;c<h;c+=6)t.push({type:o,x1:l[c],y1:l[c+1],x2:l[c+2],y2:l[c+3],x:l[c+4],y:l[c+5]});break;case"s":case"S":l=Gt(a);for(let c=0,h=l.length;c<h;c+=4)t.push({type:o,x2:l[c],y2:l[c+1],x:l[c+2],y:l[c+3]});break;case"q":case"Q":l=Gt(a);for(let c=0,h=l.length;c<h;c+=4)t.push({type:o,x1:l[c],y1:l[c+1],x:l[c+2],y:l[c+3]});break;case"t":case"T":l=Gt(a);for(let c=0,h=l.length;c<h;c+=2)t.push({type:o,x:l[c],y:l[c+1]});break;case"a":case"A":l=Gt(a,[3,4],7);for(let c=0,h=l.length;c<h;c+=7)t.push({type:o,rx:l[c],ry:l[c+1],angle:l[c+2],largeArcFlag:l[c+3],sweepFlag:l[c+4],x:l[c+5],y:l[c+6]});break;case"z":case"Z":t.push({type:o});break;default:console.warn(s)}}return t}const Gr="data:image/svg+xml;",qr=`${Gr}base64,`,Wr=`${Gr}charset=utf8,`;function Hr(r){if(typeof r=="string"){let t;r.startsWith(qr)?(r=r.substring(qr.length,r.length),t=atob(r)):r.startsWith(Wr)?(r=r.substring(Wr.length,r.length),t=decodeURIComponent(r)):t=r;const e=new DOMParser().parseFromString(t,"text/xml"),n=e.querySelector("parsererror");if(n)throw new Error(`${n.textContent??"parser error"}
3
- ${t}`);return e.documentElement}else return r}const yo="px",mo=90,Xr=["mm","cm","in","pt","pc","px"],Yr={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:72/6,pc:1,px:-1},px:{px:1}};function Z(r){let t="px";if(typeof r=="string")for(let n=0,i=Xr.length;n<i;n++){const s=Xr[n];if(r.endsWith(s)){t=s,r=r.substring(0,r.length-s.length);break}}let e;return e=Yr[t][yo],e<0&&(e=Yr[t].in*mo),e*Number.parseFloat(r)}const xo=new vt,rn=new vt,Zr=new vt,Kr=new vt;function vo(r,t,e){if(!(r.hasAttribute("transform")||r.nodeName==="use"&&(r.hasAttribute("x")||r.hasAttribute("y"))))return null;const n=wo(r);return e.length>0&&n.premultiply(e[e.length-1]),t.copy(n),e.push(n),n}function wo(r){const t=new vt,e=xo;if(r.nodeName==="use"&&(r.hasAttribute("x")||r.hasAttribute("y"))&&t.translate(Z(r.getAttribute("x")),Z(r.getAttribute("y"))),r.hasAttribute("transform")){const n=r.getAttribute("transform").split(")");for(let i=n.length-1;i>=0;i--){const s=n[i].trim();if(s==="")continue;const o=s.indexOf("("),a=s.length;if(o>0&&o<a){const l=s.slice(0,o),c=Gt(s.slice(o+1));switch(e.identity(),l){case"translate":if(c.length>=1){const h=c[0];let u=0;c.length>=2&&(u=c[1]),e.translate(h,u)}break;case"rotate":if(c.length>=1){let h=0,u=0,p=0;h=c[0]*Math.PI/180,c.length>=3&&(u=c[1],p=c[2]),rn.makeTranslation(-u,-p),Zr.makeRotation(h),Kr.multiplyMatrices(Zr,rn),rn.makeTranslation(u,p),e.multiplyMatrices(rn,Kr)}break;case"scale":c.length>=1&&e.scale(c[0],c[1]??c[0]);break;case"skewX":c.length===1&&e.set(1,Math.tan(c[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":c.length===1&&e.set(1,0,0,Math.tan(c[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":c.length===6&&e.set(c[0],c[2],c[4],c[1],c[3],c[5],0,0,1);break}}t.premultiply(e)}}return t}function bo(r){return new Pt().arc(Z(r.getAttribute("cx")||0),Z(r.getAttribute("cy")||0),Z(r.getAttribute("r")||0),0,Math.PI*2)}function So(r,t){if(!(!r.sheet||!r.sheet.cssRules||!r.sheet.cssRules.length))for(let e=0;e<r.sheet.cssRules.length;e++){const n=r.sheet.cssRules[e];if(n.type!==1)continue;const i=n.selectorText.split(/,/g).filter(Boolean).map(o=>o.trim()),s={};for(let o=n.style.length,a=0;a<o;a++){const l=n.style.item(a);s[l]=n.style.getPropertyValue(l)}for(let o=0;o<i.length;o++)t[i[o]]=Object.assign(t[i[o]]||{},{...s})}}function Co(r){return new Pt().ellipse(Z(r.getAttribute("cx")||0),Z(r.getAttribute("cy")||0),Z(r.getAttribute("rx")||0),Z(r.getAttribute("ry")||0),0,0,Math.PI*2)}function Mo(r){return new Pt().moveTo(Z(r.getAttribute("x1")||0),Z(r.getAttribute("y1")||0)).lineTo(Z(r.getAttribute("x2")||0),Z(r.getAttribute("y2")||0))}function Po(r){const t=new Pt,e=r.getAttribute("d");return!e||e==="none"?null:(t.addData(e),t)}const _o=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function To(r){const t=new Pt;let e=0;return r.getAttribute("points")?.replace(_o,(n,i,s)=>{const o=Z(i),a=Z(s);return e===0?t.moveTo(o,a):t.lineTo(o,a),e++,n}),t.currentCurve.autoClose=!0,t}const ko=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function Ao(r){const t=new Pt;let e=0;return r.getAttribute("points")?.replace(ko,(n,i,s)=>{const o=Z(i),a=Z(s);return e===0?t.moveTo(o,a):t.lineTo(o,a),e++,n}),t.currentCurve.autoClose=!1,t}function Oo(r){const t=Z(r.getAttribute("x")||0),e=Z(r.getAttribute("y")||0),n=Z(r.getAttribute("rx")||r.getAttribute("ry")||0),i=Z(r.getAttribute("ry")||r.getAttribute("rx")||0),s=Z(r.getAttribute("width")),o=Z(r.getAttribute("height")),a=1-.551915024494,l=new Pt;return l.moveTo(t+n,e),l.lineTo(t+s-n,e),(n!==0||i!==0)&&l.bezierCurveTo(t+s-n*a,e,t+s,e+i*a,t+s,e+i),l.lineTo(t+s,e+o-i),(n!==0||i!==0)&&l.bezierCurveTo(t+s,e+o-i*a,t+s-n*a,e+o,t+s-n,e+o),l.lineTo(t+n,e+o),(n!==0||i!==0)&&l.bezierCurveTo(t+n*a,e+o,t,e+o-i*a,t,e+o-i),l.lineTo(t,e+i),(n!==0||i!==0)&&l.bezierCurveTo(t,e+i*a,t+n*a,e,t+n,e),l}function qt(r,t,e){t=Object.assign({},t);let n={};if(r.hasAttribute("class")){const c=r.getAttribute("class").split(/\s/).filter(Boolean).map(h=>h.trim());for(let h=0;h<c.length;h++)n=Object.assign(n,e[`.${c[h]}`])}r.hasAttribute("id")&&(n=Object.assign(n,e[`#${r.getAttribute("id")}`]));for(let c=r.style.length,h=0;h<c;h++){const u=r.style.item(h),p=r.style.getPropertyValue(u);t[u]=p,n[u]=p}function i(c,h,u=s){r.hasAttribute(c)&&(t[h]=u(r.getAttribute(c))),n[c]&&(t[h]=u(n[c]))}function s(c){return c.startsWith("url")&&console.warn("url access in attributes is not implemented."),c}function o(c){return Math.max(0,Math.min(1,Z(c)))}function a(c){return Math.max(0,Z(c))}function l(c){return c.split(" ").filter(h=>h!=="").map(h=>Z(h))}return i("fill","fill"),i("fill-opacity","fillOpacity",o),i("fill-rule","fillRule"),i("opacity","opacity",o),i("stroke","stroke"),i("stroke-opacity","strokeOpacity",o),i("stroke-width","strokeWidth",a),i("stroke-linecap","strokeLinecap"),i("stroke-linejoin","strokeLinejoin"),i("stroke-miterlimit","strokeMiterlimit",a),i("stroke-dasharray","strokeDasharray",l),i("stroke-dashoffset","strokeDashoffset",Z),i("visibility","visibility"),t}function Ln(r,t,e=[],n={}){if(r.nodeType!==1)return e;let i=!1,s=null,o={...t};switch(r.nodeName){case"svg":o=qt(r,o,n);break;case"style":So(r,n);break;case"g":o=qt(r,o,n);break;case"path":o=qt(r,o,n),r.hasAttribute("d")&&(s=Po(r));break;case"rect":o=qt(r,o,n),s=Oo(r);break;case"polygon":o=qt(r,o,n),s=To(r);break;case"polyline":o=qt(r,o,n),s=Ao(r);break;case"circle":o=qt(r,o,n),s=bo(r);break;case"ellipse":o=qt(r,o,n),s=Co(r);break;case"line":o=qt(r,o,n),s=Mo(r);break;case"defs":i=!0;break;case"use":{o=qt(r,o,n);const p=(r.getAttributeNS("http://www.w3.org/1999/xlink","href")||r.getAttribute("href")||"").substring(1),d=r.viewportElement?.getElementById(p);d?Ln(d,o,e,n):console.warn(`'use node' references non-existent node id: ${p}`);break}default:console.warn(r);break}if(o.display==="none")return e;const a=new vt,l=[],c=vo(r,a,l);s&&(s.applyTransform(a),e.push(s),s.style={...o});const h=r.childNodes;for(let u=0,p=h.length;u<p;u++){const d=h[u];i&&d.nodeName!=="style"&&d.nodeName!=="defs"||Ln(d,o,e,n)}return c&&(l.pop(),l.length>0?a.copy(l[l.length-1]):a.identity()),e}function Qr(r){const t=Hr(r);return new ee(Ln(t,{}),t.getAttribute("viewBox")?.trim().split(" ").map(e=>Number(e)))}function Jr(r,t,e,n,i){const s=(n-t)*.5,o=(i-e)*.5,a=r*r,l=r*a;return(2*e-2*n+s+o)*l+(-3*e+3*n-2*s-o)*a+s*r+e}function Io(r,t){const e=1-r;return e*e*e*t}function Eo(r,t){const e=1-r;return 3*e*e*r*t}function Bo(r,t){return 3*(1-r)*r*r*t}function Do(r,t){return r*r*r*t}function ti(r,t,e,n,i){return Io(r,t)+Eo(r,e)+Bo(r,n)+Do(r,i)}function ei(r,t={}){let{vertices:e=[],indices:n=[],holes:i=[],verticesStride:s=2,verticesOffset:o=e.length/s,indicesOffset:a=n.length}=t;const l=Hs(r,i,2);if(l.length){for(let h=0;h<l.length;h+=3)n[a++]=l[h]+o,n[a++]=l[h+1]+o,n[a++]=l[h+2]+o;let c=o*s;for(let h=0;h<r.length;h+=2)e[c]=r[h],e[c+1]=r[h+1],c+=s}return{vertices:e,indices:n}}const Fo=8,sn=11920929e-14,Uo=1;function Lo(r,t,e,n,i,s,o,a,l=.5,c=[]){const u=Math.min(.99,Math.max(0,l));let p=(Uo-u)/1;return p*=p,$n(r,t,e,n,i,s,o,a,c,p,0),c.push(o,a),c}function $n(r,t,e,n,i,s,o,a,l,c,h){if(h>Fo)return;const u=(r+e)/2,p=(t+n)/2,d=(e+i)/2,f=(n+s)/2,y=(i+o)/2,g=(s+a)/2,M=(u+d)/2,P=(p+f)/2,x=(d+y)/2,C=(f+g)/2,w=(M+x)/2,v=(P+C)/2;if(h>0){let S=o-r,b=a-t;const D=Math.abs((e-o)*b-(n-a)*S),z=Math.abs((i-o)*b-(s-a)*S);if(D>sn&&z>sn){if((D+z)*(D+z)<=c*(S*S+b*b)){l.push(w,v);return}}else if(D>sn){if(D*D<=c*(S*S+b*b)){l.push(w,v);return}}else if(z>sn){if(z*z<=c*(S*S+b*b)){l.push(w,v);return}}else if(S=w-(r+o)/2,b=v-(t+a)/2,S*S+b*b<=c){l.push(w,v);return}}$n(r,t,u,p,M,P,w,v,l,c,h+1),$n(w,v,x,C,y,g,o,a,l,c,h+1)}const $o=8,No=11920929e-14,zo=1;function Ro(r,t,e,n,i,s,o=.5,a=[]){const c=Math.min(.99,Math.max(0,o));let h=(zo-c)/1;return h*=h,Nn(a,r,t,e,n,i,s,h,0),a.push(i,s),a}function Nn(r,t,e,n,i,s,o,a,l){if(l>$o)return;const c=(t+n)/2,h=(e+i)/2,u=(n+s)/2,p=(i+o)/2,d=(c+u)/2,f=(h+p)/2;let y=s-t,g=o-e;const M=Math.abs((n-s)*g-(i-o)*y);if(M>No){if(M*M<=a*(y*y+g*g)){r.push(d,f);return}}else if(y=d-(t+s)/2,g=f-(e+o)/2,y*y+g*g<=a){r.push(d,f);return}Nn(r,t,e,c,h,d,f,a,l+1),Nn(r,d,f,u,p,s,o,a,l+1)}function Vo(r){return r.replace(/[^a-z0-9]/gi,"-").replace(/\B([A-Z])/g,"-$1").toLowerCase()}function jo(r,t,e,n){const i=t.clone().sub(r),s=n.clone().sub(e),o=e.clone().sub(r),a=i.cross(s);if(a===0)return new k((r.x+e.x)/2,(r.y+e.y)/2);const l=o.cross(s)/a;return Math.abs(l)>1?new k((r.x+e.x)/2,(r.y+e.y)/2):new k(r.x+l*i.x,r.y+l*i.y)}function ni(r,t,e,n,i,s){return(e-r)*(s-t)-(n-t)*(i-r)}function Go(r,t,e){const n=e.length;let i=0;for(let s=0,o=n-2;s<n;o=s,s+=2){const a=e[s],l=e[s+1],c=e[o],h=e[o+1];l<=t?h>t&&ni(c,h,a,l,r,t)>0&&i++:h<=t&&ni(c,h,a,l,r,t)<0&&i--}return i}function qo(r,t){const e=t[0]-r[0],n=t[1]-r[1];return Math.sqrt(e*e+n*n)}function Wo(r){const t=r.map((n,i)=>({index:i})),e=r.map(n=>{const i=n.length;if(!i)return[];let s=[Number.MAX_SAFE_INTEGER,0],o=[0,Number.MAX_SAFE_INTEGER],a=[Number.MIN_SAFE_INTEGER,0],l=[0,Number.MIN_SAFE_INTEGER];for(let P=0;P<i;P+=2){const x=n[P],C=n[P+1];s[0]>x&&(s=[x,C]),o[1]>C&&(o=[x,C]),a[0]<x&&(a=[x,C]),l[1]<C&&(l=[x,C])}const c=[(s[0]+a[0])/2,(o[1]+l[1])/2];let h,u,p,d,f,y,g,M;for(let P=0;P<i;P+=2){const x=n[P],C=n[P+1],w=Math.abs(x-c[0]),v=Math.abs(C-c[1]);C<c[1]&&(!h||w<h)&&(h=w,p=[x,C]),C>c[1]&&(!u||w<u)&&(u=w,d=[x,C]),x<c[0]&&(!f||v<f)&&(f=v,g=[x,C]),x>c[0]&&(!y||v<y)&&(y=v,M=[x,C])}return[s,o,a,l,p,d,g,M].filter(Boolean)});for(let n=0,i=r.length;n<i;n++){const s=[],o=e[n];for(let a=0;a<i;a++){if(n===a)continue;const l={},c=[];for(let h=0,u=o.length;h<u;h++){const[p,d]=o[h],f=Go(p,d,r[a]);l[f]=(l[f]??0)+1,c.push(f)}c.filter(h=>h!==0).length>c.filter(h=>h===0).length&&s.push({index:n,parentIndex:a,winding:Number(Array.from(Object.entries(l)).sort((h,u)=>u[1]-h[1])?.[0]?.[0]??0),dist:qo(e[n][0],e[a][0])})}s.reduce((a,l)=>a+l.winding,0)!==0&&(s.sort((a,l)=>a.dist-l.dist),t[n]=s[0])}return t}function Ho(r,t){const e=1-r;return e*e*t}function Xo(r,t){return 2*(1-r)*r*t}function Yo(r,t){return r*r*t}function ri(r,t,e,n){return Ho(r,t)+Xo(r,e)+Yo(r,n)}const Zo=1e-4,ii=1e-4;function Ko(r,t={}){const{vertices:e=[],indices:n=[],lineStyle:i={alignment:.5,cap:"butt",join:"miter",width:1,miterLimit:10},flipAlignment:s=!1,closed:o=!0}=t,a=Zo;if(r.length===0)return{vertices:e,indices:n};const l=i;let c=l.alignment;if(i.alignment!==.5){let I=Qo(r);s&&(I*=-1),c=(c-.5)*I+.5}const h={x:r[0],y:r[1]},u={x:r[r.length-2],y:r[r.length-1]},p=o,d=Math.abs(h.x-u.x)<a&&Math.abs(h.y-u.y)<a;if(p){r=r.slice(),d&&(r.pop(),r.pop(),u.x=r[r.length-2],u.y=r[r.length-1]);const I=(h.x+u.x)*.5,R=(u.y+h.y)*.5;r.unshift(I,R),r.push(I,R)}const f=e,y=r.length/2;let g=r.length;const M=f.length/2,P=l.width/2,x=P*P,C=l.miterLimit*l.miterLimit;let w=r[0],v=r[1],S=r[2],b=r[3],D=0,z=0,E=-(v-b),F=w-S,N=0,B=0,A=Math.sqrt(E*E+F*F);E/=A,F/=A,E*=P,F*=P;const W=c,O=(1-W)*2,L=W*2;p||(l.cap==="round"?g+=he(w-E*(O-L)*.5,v-F*(O-L)*.5,w-E*O,v-F*O,w+E*L,v+F*L,f,!0)+2:l.cap==="square"&&(g+=si(w,v,E,F,O,L,!0,f))),f.push(w-E*O,v-F*O),f.push(w+E*L,v+F*L);for(let I=1;I<y-1;++I){w=r[(I-1)*2],v=r[(I-1)*2+1],S=r[I*2],b=r[I*2+1],D=r[(I+1)*2],z=r[(I+1)*2+1],E=-(v-b),F=w-S,A=Math.sqrt(E*E+F*F),E/=A,F/=A,E*=P,F*=P,N=-(b-z),B=S-D,A=Math.sqrt(N*N+B*B),N/=A,B/=A,N*=P,B*=P;const R=S-w,T=v-b,_=S-D,U=z-b,$=R*_+T*U,q=T*_-U*R,X=q<0;if(Math.abs(q)<.001*Math.abs($)){f.push(S-E*O,b-F*O),f.push(S+E*L,b+F*L),$>=0&&(l.join==="round"?g+=he(S,b,S-E*O,b-F*O,S-N*O,b-B*O,f,!1)+4:g+=2,f.push(S-N*L,b-B*L),f.push(S+N*O,b+B*O));continue}const nt=(-E+w)*(-F+b)-(-E+S)*(-F+v),Yt=(-N+D)*(-B+b)-(-N+S)*(-B+z),Dt=(R*Yt-_*nt)/q,Mt=(U*nt-T*Yt)/q,Tt=(Dt-S)*(Dt-S)+(Mt-b)*(Mt-b),ht=S+(Dt-S)*O,kt=b+(Mt-b)*O,Rt=S-(Dt-S)*L,Vt=b-(Mt-b)*L,Ft=Math.min(R*R+T*T,_*_+U*U),Zi=X?O:L,Hl=Ft+Zi*Zi*x;Tt<=Hl?l.join==="bevel"||Tt/x>C?(X?(f.push(ht,kt),f.push(S+E*L,b+F*L),f.push(ht,kt),f.push(S+N*L,b+B*L)):(f.push(S-E*O,b-F*O),f.push(Rt,Vt),f.push(S-N*O,b-B*O),f.push(Rt,Vt)),g+=2):l.join==="round"?X?(f.push(ht,kt),f.push(S+E*L,b+F*L),g+=he(S,b,S+E*L,b+F*L,S+N*L,b+B*L,f,!0)+4,f.push(ht,kt),f.push(S+N*L,b+B*L)):(f.push(S-E*O,b-F*O),f.push(Rt,Vt),g+=he(S,b,S-E*O,b-F*O,S-N*O,b-B*O,f,!1)+4,f.push(S-N*O,b-B*O),f.push(Rt,Vt)):(f.push(ht,kt),f.push(Rt,Vt)):(f.push(S-E*O,b-F*O),f.push(S+E*L,b+F*L),l.join==="round"?X?g+=he(S,b,S+E*L,b+F*L,S+N*L,b+B*L,f,!0)+2:g+=he(S,b,S-E*O,b-F*O,S-N*O,b-B*O,f,!1)+2:l.join==="miter"&&Tt/x<=C&&(X?(f.push(Rt,Vt),f.push(Rt,Vt)):(f.push(ht,kt),f.push(ht,kt)),g+=2),f.push(S-N*O,b-B*O),f.push(S+N*L,b+B*L),g+=2)}w=r[(y-2)*2],v=r[(y-2)*2+1],S=r[(y-1)*2],b=r[(y-1)*2+1],E=-(v-b),F=w-S,A=Math.sqrt(E*E+F*F),E/=A,F/=A,E*=P,F*=P,f.push(S-E*O,b-F*O),f.push(S+E*L,b+F*L),p||(l.cap==="round"?g+=he(S-E*(O-L)*.5,b-F*(O-L)*.5,S-E*O,b-F*O,S+E*L,b+F*L,f,!1)+2:l.cap==="square"&&(g+=si(S,b,E,F,O,L,!1,f)));const V=ii*ii;for(let I=M;I<g+M-2;++I)w=f[I*2],v=f[I*2+1],S=f[(I+1)*2],b=f[(I+1)*2+1],D=f[(I+2)*2],z=f[(I+2)*2+1],!(Math.abs(w*(b-z)+S*(z-v)+D*(v-b))<V)&&n.push(I,I+1,I+2);return{vertices:e,indices:n}}function Qo(r){const t=r.length;if(t<6)return 1;let e=0;for(let n=0,i=r[t-2],s=r[t-1];n<t;n+=2){const o=r[n],a=r[n+1];e+=(o-i)*(a+s),i=o,s=a}return e<0?-1:1}function si(r,t,e,n,i,s,o,a){const l=r-e*i,c=t-n*i,h=r+e*s,u=t+n*s;let p,d;o?(p=n,d=-e):(p=-n,d=e);const f=l+p,y=c+d,g=h+p,M=u+d;return a.push(f,y),a.push(g,M),2}function he(r,t,e,n,i,s,o,a){const l=e-r,c=n-t;let h=Math.atan2(l,c),u=Math.atan2(i-r,s-t);a&&h<u?h+=Math.PI*2:!a&&h>u&&(u+=Math.PI*2);let p=h;const d=u-h,f=Math.abs(d),y=Math.sqrt(l*l+c*c),g=(15*f*Math.sqrt(y)/Math.PI>>0)+1,M=d/g;if(p+=M,a){o.push(r,t),o.push(e,n);for(let P=1,x=p;P<g;P++,x+=M)o.push(r,t),o.push(r+Math.sin(x)*y,t+Math.cos(x)*y);o.push(r,t),o.push(i,s)}else{o.push(e,n),o.push(r,t);for(let P=1,x=p;P<g;P++,x+=M)o.push(r+Math.sin(x)*y,t+Math.cos(x)*y),o.push(r,t);o.push(i,s),o.push(r,t)}return g*2}class me{arcLengthDivision=200;_lengths=[];getPointAt(t,e=new k){return this.getPoint(this.getUToTMapping(t),e)}isClockwise(){return!1}getControlPointRefs(){return[]}applyTransform(t){const e=typeof t=="function";return this.getControlPointRefs().forEach(n=>{e?t(n):n.applyMatrix3(t)}),this}getUnevenVertices(t=5,e=[]){const n=new k;for(let i=0,s=Math.max(1,t)-1;i<=s;i++)this.getPoint(i/s,n),e.push(n.x,n.y);return e}getSpacedVertices(t=5,e=[]){const n=new k;for(let i=0,s=Math.max(1,t)-1;i<=s;i++)this.getPointAt(i/s,n),e.push(n.x,n.y);return e}getAdaptiveVertices(t=[]){return this.getUnevenVertices(5,t)}_verticesToPoints(t,e=[]){for(let n=0,i=t.length;n<i;n+=2){const s=t[n],o=t[n+1];e.push(new k(s,o))}return e}getSpacedPoints(t,e=[]){const n=this.getSpacedVertices(t);return this._verticesToPoints(n,e),e}getUnevenPoints(t,e=[]){const n=this.getUnevenVertices(t);return this._verticesToPoints(n,e),e}getAdaptivePoints(t=[]){const e=this.getAdaptiveVertices();return this._verticesToPoints(e,t),t}getPoints(t,e=[]){let n;return t?n=this.getUnevenVertices(t):n=this.getAdaptiveVertices(),this._verticesToPoints(n,e),e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(){return this._lengths.length!==this.arcLengthDivision+1&&this.updateLengths(),this._lengths}updateLengths(){const t=this.arcLengthDivision,e=[0];for(let n=0,i=this.getPoint(0),s=1;s<=t;s++){const o=this.getPoint(s/t);n+=o.distanceTo(i),e.push(n),i=o}this._lengths=e}getUToTMapping(t,e){const n=this.getLengths(),i=n.length,s=e??t*n[i-1];if(i<2)return s/n[0];let o=0,a=0,l=i-1,c;for(;a<=l;)if(o=Math.floor(a+(l-a)/2),c=n[o]-s,c<0)a=o+1;else if(c>0)l=o-1;else{l=o;break}if(o=Math.max(0,l),n[o]===s)return o/(i-1);const h=n[o],p=n[o+1]-h,d=Math.max(0,(s-h)/p);return(o+d)/(i-1)}getTangent(t,e=new k){const i=Math.max(0,t-1e-4),s=Math.min(1,t+1e-4);return e.copy(this.getPoint(s).sub(this.getPoint(i)).normalize())}getTangentAt(t,e){return this.getTangent(this.getUToTMapping(t),e)}getNormal(t,e=new k){return this.getTangent(t,e),e.set(-e.y,e.x).normalize()}getNormalAt(t,e){return this.getNormal(this.getUToTMapping(t),e)}getTForPoint(t,e=.001){let n=0,i=1,s=(n+i)/2;for(;i-n>e;){s=(n+i)/2;const o=this.getPoint(s);if(o.distanceTo(t)<e)return s;o.x<t.x?n=s:i=s}return s}getMinMax(t=k.MAX,e=k.MIN){const n=this.getPoints();for(let i=0,s=n.length;i<s;i++){const o=n[i];t.min(o),e.max(o)}return{min:t.finite(),max:e.finite()}}getBoundingBox(){const{min:t,max:e}=this.getMinMax();return new H(t.x,t.y,e.x-t.x,e.y-t.y)}getFillVertices(t){return this.getAdaptiveVertices()}fillTriangulate(t){return ei(this.getFillVertices(t),t)}strokeTriangulate(t){return Ko(this.getAdaptiveVertices(),t)}toCommands(){const t=[],e=this.getPoints();for(let n=0,i=e.length;n<i;n++){const s=e[n];n===0?t.push({type:"M",x:s.x,y:s.y}):t.push({type:"L",x:s.x,y:s.y})}return t}toData(){return po(this.toCommands())}drawTo(t){return this.toCommands().forEach(e=>{switch(e.type){case"M":t.moveTo(e.x,e.y);break;case"L":t.lineTo(e.x,e.y);break}}),this}copy(t){return this.arcLengthDivision=t.arcLengthDivision,this}clone(){return new this.constructor().copy(this)}}const Jo=new vt,oi=new vt,ai=new vt,on=new k;class zn extends me{constructor(t=new k,e=new k,n=new k,i=0,s=0,o=Math.PI*2,a=!1){super(),this._center=t,this._radius=e,this._diff=n,this.rotate=i,this.startAngle=s,this.endAngle=o,this.clockwise=a}get cx(){return this._center.x}set cx(t){this._center.x=t}get cy(){return this._center.y}set cy(t){this._center.y=t}get rx(){return this._radius.x}set rx(t){this._radius.x=t}get ry(){return this._radius.y}set ry(t){this._radius.y=t}get dx(){return this._diff.x}set dx(t){this._diff.x=t}get dy(){return this._diff.y}set dy(t){this._diff.y=t}isClockwise(){return this.clockwise}_getDeltaAngle(){const t=Math.PI*2;let e=this.endAngle-this.startAngle;const n=Math.abs(e)<Number.EPSILON;return e=(e%t+t)%t,n?e=0:this.clockwise||(e=e===0?-t:e-t),e}getPoint(t,e=new k){const n=this._getDeltaAngle(),i=this.startAngle+t*n;let s=this.cx+this.rx*Math.cos(i),o=this.cy+this.ry*Math.sin(i);if(this.rotate!==0){const a=Math.cos(this.rotate),l=Math.sin(this.rotate),c=s-this.cx,h=o-this.cy;s=c*a-h*l+this.cx,o=c*l+h*a+this.cy}return e.set(s,o)}toCommands(){const{cx:t,cy:e,rx:n,ry:i,startAngle:s,endAngle:o,clockwise:a,rotate:l}=this,c=t+n*Math.cos(s)*Math.cos(l)-i*Math.sin(s)*Math.sin(l),h=e+n*Math.cos(s)*Math.sin(l)+i*Math.sin(s)*Math.cos(l),u=Math.abs(s-o),p=u>Math.PI?1:0,d=a?1:0,f=l*180/Math.PI;if(u>=2*Math.PI){const y=s+Math.PI,g=t+n*Math.cos(y)*Math.cos(l)-i*Math.sin(y)*Math.sin(l),M=e+n*Math.cos(y)*Math.sin(l)+i*Math.sin(y)*Math.cos(l);return[{type:"M",x:c,y:h},{type:"A",rx:n,ry:i,angle:f,largeArcFlag:0,sweepFlag:d,x:g,y:M},{type:"A",rx:n,ry:i,angle:f,largeArcFlag:0,sweepFlag:d,x:c,y:h}]}else{const y=t+n*Math.cos(o)*Math.cos(l)-i*Math.sin(o)*Math.sin(l),g=e+n*Math.cos(o)*Math.sin(l)+i*Math.sin(o)*Math.cos(l);return[{type:"M",x:c,y:h},{type:"A",rx:n,ry:i,angle:f,largeArcFlag:p,sweepFlag:d,x:y,y:g}]}}drawTo(t){const{cx:e,cy:n,rx:i,ry:s,rotate:o,startAngle:a,endAngle:l,clockwise:c}=this;return t.ellipse(e,n,i,s,o,a,l,!c),this}applyTransform(t){return on.set(this.cx,this.cy),on.applyMatrix3(t),this.cx=on.x,this.cy=on.y,na(t)?ta(this,t):ea(this,t),this}getControlPointRefs(){return[this._center]}_getAdaptiveVerticesByArc(t=[]){const{cx:e,cy:n,rx:i,ry:s,dx:o,dy:a,startAngle:l,endAngle:c,clockwise:h,rotate:u}=this,p=!h;let d=Math.abs(l-c);(!p&&l>c||p&&c>l)&&(d=2*Math.PI-d);const f=Math.max(12,Math.floor(12*i**(1/3)*(d/Math.PI)));let y=d/f,g=l;y*=p?-1:1;const M=Math.cos(p?u:-u),P=Math.sin(p?u:-u);for(let x=0;x<f+1;x++){const C=o+Math.cos(g)*i,w=a+Math.sin(g)*s,v=C*M-w*P,S=C*P+w*M;t.push(e+v,n+S),g+=y}return t}_getAdaptiveVerticesByCircle(t=[]){const{cx:e,cy:n,rx:i,ry:s,dx:o,dy:a,rotate:l,clockwise:c}=this;if(!(i>=0&&s>=0&&o>=0&&a>=0))return t;const h=Math.ceil(2.3*Math.sqrt(i+s)),u=h*8+(o?4:0)+(a?4:0),p=[];if(u===0)return t;{const y=p.length;if(h===0)p[y]=p[y+6]=e+o,p[y+1]=p[y+3]=n+a,p[y+2]=p[y+4]=e-o,p[y+5]=p[y+7]=n-a;else{let g=y,M=y+h*4+(o?2:0)+2,P=M,x=u,C=o+i,w=a,v=e+C,S=e-C,b=n+w;if(p[g++]=v,p[g++]=b,p[--M]=b,p[--M]=S,a){const z=n-w;p[P++]=S,p[P++]=z,p[--x]=z,p[--x]=v}for(let z=1;z<h;z++){const E=Math.PI/2*(z/h),F=o+Math.cos(E)*i,N=a+Math.sin(E)*s,B=e+F,A=e-F,W=n+N,O=n-N;p[g++]=B,p[g++]=W,p[--M]=W,p[--M]=A,p[P++]=A,p[P++]=O,p[--x]=O,p[--x]=B}C=o,w=a+s,v=e+C,S=e-C,b=n+w;const D=n-w;p[g++]=v,p[g++]=b,p[--x]=D,p[--x]=v,o&&(p[g++]=S,p[g++]=b,p[--x]=D,p[--x]=S)}}const d=Math.cos(c?-l:l),f=Math.sin(c?-l:l);for(let y=0;y<p.length;y+=2){const g=p[y],M=p[y+1],P=g-e,x=M-n,C=P*d-x*f,w=P*f+x*d;t.push(e+C,n+w)}return t}getAdaptiveVertices(t=[]){return this.startAngle===0&&this.endAngle===Math.PI*2?this._getAdaptiveVerticesByCircle(t):this._getAdaptiveVerticesByArc(t)}copy(t){return super.copy(t),this.cx=t.cx,this.cy=t.cy,this.rx=t.rx,this.ry=t.ry,this.dx=t.dx,this.dy=t.dy,this.startAngle=t.startAngle,this.endAngle=t.endAngle,this.clockwise=t.clockwise,this.rotate=t.rotate,this}}function ta(r,t){const e=r.rx,n=r.ry,i=Math.cos(r.rotate),s=Math.sin(r.rotate),o=new k(e*i,e*s),a=new k(-n*s,n*i),l=o.applyMatrix3(t),c=a.applyMatrix3(t),h=Jo.set(l.x,c.x,0,l.y,c.y,0,0,0,1),u=oi.copy(h).invert(),f=ai.copy(u).transpose().multiply(u).elements,y=ra(f[0],f[1],f[4]),g=Math.sqrt(y.rt1),M=Math.sqrt(y.rt2);if(r.rx=1/g,r.ry=1/M,r.rotate=Math.atan2(y.sn,y.cs),!((r.endAngle-r.startAngle)%(2*Math.PI)<Number.EPSILON)){const x=oi.set(g,0,0,0,M,0,0,0,1),C=ai.set(y.cs,y.sn,0,-y.sn,y.cs,0,0,0,1),w=x.multiply(C).multiply(h),v=S=>{const{x:b,y:D}=new k(Math.cos(S),Math.sin(S)).applyMatrix3(w);return Math.atan2(D,b)};r.startAngle=v(r.startAngle),r.endAngle=v(r.endAngle),li(t)&&(r.clockwise=!r.clockwise)}}function ea(r,t){const e=ci(t),n=hi(t);r.rx*=e,r.ry*=n;const i=e>Number.EPSILON?Math.atan2(t.elements[1],t.elements[0]):Math.atan2(-t.elements[3],t.elements[4]);r.rotate+=i,li(t)&&(r.startAngle*=-1,r.endAngle*=-1,r.clockwise=!r.clockwise)}function li(r){const t=r.elements;return t[0]*t[4]-t[1]*t[3]<0}function na(r){const t=r.elements,e=t[0]*t[3]+t[1]*t[4];if(e===0)return!1;const n=ci(r),i=hi(r);return Math.abs(e/(n*i))>Number.EPSILON}function ci(r){const t=r.elements;return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function hi(r){const t=r.elements;return Math.sqrt(t[3]*t[3]+t[4]*t[4])}function ra(r,t,e){let n,i,s,o,a;const l=r+e,c=r-e,h=Math.sqrt(c*c+4*t*t);return l>0?(n=.5*(l+h),a=1/n,i=r*a*e-t*a*t):l<0?i=.5*(l-h):(n=.5*h,i=-.5*h),c>0?s=c+h:s=c-h,Math.abs(s)>2*Math.abs(t)?(a=-2*t/s,o=1/Math.sqrt(1+a*a),s=a*o):Math.abs(t)===0?(s=1,o=0):(a=-.5*s/t,s=1/Math.sqrt(1+a*a),o=a*s),c>0&&(a=s,s=-o,o=a),{rt1:n,rt2:i,cs:s,sn:o}}class ia extends zn{constructor(t=0,e=0,n=1,i=0,s=Math.PI*2,o=!1){super(new k(t,e),new k(n,n),new k,0,i,s,o)}drawTo(t){const{cx:e,cy:n,rx:i,startAngle:s,endAngle:o,clockwise:a}=this;return t.arc(e,n,i,s,o,!a),this}}class Kt extends me{constructor(t=new k,e=new k){super(),this.p1=t,this.p2=e}static from(t,e,n,i){return new Kt(new k(t,e),new k(n,i))}getPoint(t,e=new k){return t===1?e.copy(this.p2):e.copy(this.p2).sub(this.p1).scale(t).add(this.p1),e}getPointAt(t,e=new k){return this.getPoint(t,e)}getTangent(t,e=new k){return e.subVectors(this.p2,this.p1).normalize()}getTangentAt(t,e=new k){return this.getTangent(t,e)}getControlPointRefs(){return[this.p1,this.p2]}getAdaptiveVertices(t=[]){return t.push(this.p1.x,this.p1.y,this.p2.x,this.p2.y),t}getMinMax(t=k.MAX,e=k.MIN){const{p1:n,p2:i}=this;return t.x=Math.min(t.x,n.x,i.x),t.y=Math.min(t.y,n.y,i.y),e.x=Math.max(e.x,n.x,i.x),e.y=Math.max(e.y,n.y,i.y),{min:t.finite(),max:e.finite()}}toCommands(){const{p1:t,p2:e}=this;return[{type:"M",x:t.x,y:t.y},{type:"L",x:e.x,y:e.y}]}getFillVertices(t={}){const e=Math.min(this.p1.x,this.p2.x),n=Math.max(this.p1.x,this.p2.x),i=Math.min(this.p1.y,this.p2.y),s=Math.max(this.p1.y,this.p2.y),o=e,a=i,l=n-e||t.style?.strokeWidth||0,c=s-i||t.style?.strokeWidth||0;return[o,a,o+l,a,o+l,a+c,o,a+c]}drawTo(t){const{p1:e,p2:n}=this;return t.lineTo(e.x,e.y),t.lineTo(n.x,n.y),this}copy(t){return super.copy(t),this.p1.copy(t.p1),this.p2.copy(t.p2),this}}class Ee extends me{constructor(t=[]){super(),this.curves=t}getFlatCurves(){return this.curves.flatMap(t=>t instanceof Ee?t.getFlatCurves():t)}addCurve(t){return this.curves.push(t),this}getPoint(t,e=new k){const n=t*this.getLength(),i=this.getLengths();let s=0;for(;s<i.length;){if(i[s]>=n){const o=i[s]-n,a=this.curves[s],l=a.getLength();return a.getPointAt(l===0?0:1-o/l,e)}s++}return e}getLengths(){return this._lengths.length!==this.curves.length&&this.updateLengths(),this._lengths}updateLengths(){const t=[];for(let e=0,n=0,i=this.curves.length;e<i;e++)n+=this.curves[e].getLength(),t.push(n);this._lengths=t}getControlPointRefs(){return this.curves.flatMap(t=>t.getControlPointRefs())}_removeNextPointIfEqualPrevPoint(t,e){const n=[t[e-1],t[e]],i=[t[e+1],t[e+2]];return n[0]===i[0]&&n[1]===i[1]&&t.splice(e+1,2),t}getSpacedVertices(t=5,e=[]){let n;return this.curves.forEach(i=>{i.getSpacedVertices(t,e),n&&this._removeNextPointIfEqualPrevPoint(e,n),n=e.length-1}),e}getAdaptiveVertices(t=[]){let e;return this.curves.forEach(n=>{n.getAdaptiveVertices(t),e&&this._removeNextPointIfEqualPrevPoint(t,e),e=t.length-1}),t}strokeTriangulate(t){return this.curves.length===1?this.curves[0].strokeTriangulate(t):super.strokeTriangulate(t)}getFillVertices(t){if(this.curves.length===1)return this.curves[0].getFillVertices(t);{const e=[];let n;return this.curves.forEach(i=>{let s;i instanceof Kt?s=i.getAdaptiveVertices():s=i.getFillVertices(t),e.push(...s),n&&this._removeNextPointIfEqualPrevPoint(e,n),n=e.length-1}),e}}applyTransform(t){return this.curves.forEach(e=>e.applyTransform(t)),this}getMinMax(t=k.MAX,e=k.MIN){return this.curves.forEach(n=>n.getMinMax(t,e)),{min:t.finite(),max:e.finite()}}getBoundingBox(){const{min:t,max:e}=this.getMinMax();return new H(t.x,t.y,e.x-t.x,e.y-t.y)}toCommands(){return this.curves.flatMap(t=>t.toCommands())}drawTo(t){const e=this.curves[0]?.getPoint(0);return e&&t.moveTo(e.x,e.y),this.curves.forEach(n=>n.drawTo(t)),this}copy(t){return super.copy(t),this.curves=t.curves.map(e=>e.clone()),this}}class Rn extends me{constructor(t=new k,e=new k,n=new k,i=new k){super(),this.p1=t,this.cp1=e,this.cp2=n,this.p2=i}static from(t,e,n,i,s,o,a,l){return new Rn(new k(t,e),new k(n,i),new k(s,o),new k(a,l))}getPoint(t,e=new k){const{p1:n,cp1:i,cp2:s,p2:o}=this;return e.set(ti(t,n.x,i.x,s.x,o.x),ti(t,n.y,i.y,s.y,o.y))}getAdaptiveVertices(t=[]){return Lo(this.p1.x,this.p1.y,this.cp1.x,this.cp1.y,this.cp2.x,this.cp2.y,this.p2.x,this.p2.y,.5,t)}getControlPointRefs(){return[this.p1,this.cp1,this.cp2,this.p2]}_solveQuadratic(t,e,n){const i=e*e-4*t*n;if(i<0)return[];const s=Math.sqrt(i),o=(-e+s)/(2*t),a=(-e-s)/(2*t);return[o,a].filter(l=>l>=0&&l<=1)}getMinMax(t=k.MAX,e=k.MIN){const{p1:n,cp1:i,cp2:s,p2:o}=this,a=this._solveQuadratic(3*(i.x-n.x),6*(s.x-i.x),3*(o.x-s.x)),l=this._solveQuadratic(3*(i.y-n.y),6*(s.y-i.y),3*(o.y-s.y)),c=[0,1,...a,...l];return((u,p)=>{for(const d of u)for(let f=0;f<=p;f++){const y=f/p-.5,g=Math.min(1,Math.max(0,d+y)),M=this.getPoint(g);t.x=Math.min(t.x,M.x),t.y=Math.min(t.y,M.y),e.x=Math.max(e.x,M.x),e.y=Math.max(e.y,M.y)}})(c,10),{min:t.finite(),max:e.finite()}}toCommands(){const{p1:t,cp1:e,cp2:n,p2:i}=this;return[{type:"M",x:t.x,y:t.y},{type:"C",x1:e.x,y1:e.y,x2:n.x,y2:n.y,x:i.x,y:i.y}]}drawTo(t){const{p1:e,cp1:n,cp2:i,p2:s}=this;return t.lineTo(e.x,e.y),t.bezierCurveTo(n.x,n.y,i.x,i.y,s.x,s.y),this}copy(t){return super.copy(t),this.p1.copy(t.p1),this.cp1.copy(t.cp1),this.cp2.copy(t.cp2),this.p2.copy(t.p2),this}}class sa extends zn{constructor(t=0,e=0,n=1,i=1,s=0,o=0,a=Math.PI*2,l=!1){super(new k(t,e),new k(n,i),new k,s,o,a,l)}drawTo(t){return t.ellipse(this.cx,this.cy,this.rx,this.ry,this.rotate,this.startAngle,this.endAngle,!this.clockwise),this}}class oa extends Ee{}class Vn extends me{constructor(t=new k,e=new k,n=new k){super(),this.p1=t,this.cp=e,this.p2=n}static from(t,e,n,i,s,o){return new Vn(new k(t,e),new k(n,i),new k(s,o))}getPoint(t,e=new k){const{p1:n,cp:i,p2:s}=this;return e.set(ri(t,n.x,i.x,s.x),ri(t,n.y,i.y,s.y)),e}getControlPointRefs(){return[this.p1,this.cp,this.p2]}getAdaptiveVertices(t=[]){return Ro(this.p1.x,this.p1.y,this.cp.x,this.cp.y,this.p2.x,this.p2.y,.5,t)}getMinMax(t=k.MAX,e=k.MIN){const{p1:n,cp:i,p2:s}=this,o=.5*(n.x+i.x),a=.5*(n.y+i.y),l=.5*(n.x+s.x),c=.5*(n.y+s.y);return t.x=Math.min(t.x,n.x,s.x,o,l),t.y=Math.min(t.y,n.y,s.y,a,c),e.x=Math.max(e.x,n.x,s.x,o,l),e.y=Math.max(e.y,n.y,s.y,a,c),{min:t.finite(),max:e.finite()}}toCommands(){const{p1:t,cp:e,p2:n}=this;return[{type:"M",x:t.x,y:t.y},{type:"Q",x1:e.x,y1:e.y,x:n.x,y:n.y}]}drawTo(t){const{p1:e,cp:n,p2:i}=this;return t.lineTo(e.x,e.y),t.quadraticCurveTo(n.x,n.y,i.x,i.y),this}copy(t){return super.copy(t),this.p1.copy(t.p1),this.cp.copy(t.cp),this.p2.copy(t.p2),this}}class aa extends oa{constructor(t=0,e=0,n=0,i=0){super(),this.x=t,this.y=e,this.width=n,this.height=i,this.update()}update(){const{x:t,y:e,width:n,height:i}=this,s=[new k(t,e),new k(t+n,e),new k(t+n,e+i),new k(t,e+i)];return this.curves=[new Kt(s[0],s[1]),new Kt(s[1],s[2]),new Kt(s[2],s[3]),new Kt(s[3],s[0])],this}drawTo(t){return t.rect(this.x,this.y,this.width,this.height),this}getFillVertices(t={}){const{x:e,y:n,width:i,height:s}=this;return[e,n,e+i,n,e+i,n+s,e,n+s]}copy(t){return super.copy(t),this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.update(),this}}class la extends zn{constructor(t=0,e=0,n=1,i=1,s=1){super(),this.x=t,this.y=e,this.width=n,this.height=i,this.radius=s,this.update()}update(){const{x:t,y:e,width:n,height:i,radius:s}=this,o=n/2,a=i/2,l=t+o,c=e+a,h=Math.max(0,Math.min(s,Math.min(o,a))),u=h;return this._center=new k(l,c),this._radius=new k(h,u),this._diff=new k(o-h,a-u),this}drawTo(t){const{x:e,y:n,width:i,height:s,radius:o}=this;return t.roundRect(e,n,i,s,o),this}copy(t){return super.copy(t),this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.radius=t.radius,this.update(),this}}class ca extends me{constructor(t=[]){super(),this.points=t}getPoint(t,e=new k){const{points:n}=this,i=(n.length-1)*t,s=Math.floor(i),o=i-s,a=n[s===0?s:s-1],l=n[s],c=n[s>n.length-2?n.length-1:s+1],h=n[s>n.length-3?n.length-1:s+2];return e.set(Jr(o,a.x,l.x,c.x,h.x),Jr(o,a.y,l.y,c.y,h.y)),e}getControlPointRefs(){return this.points}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++)this.points.push(t.points[e].clone());return this}}class an extends Ee{startPoint;currentPoint;autoClose=!1;constructor(t){super(),t&&this.addPoints(t)}addPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,n=t.length;e<n;e++){const{x:i,y:s}=t[e];this.lineTo(i,s)}return this}addCommands(t){return Vr(t,this),this}addData(t){return this.addCommands(jr(t)),this}_closeVertices(t){return this.autoClose&&t.length>=4&&t[0]!==t[t.length-2]&&t[1]!==t[t.length-1]&&t.push(t[0],t[1]),t}getUnevenVertices(t=40,e=[]){return this._closeVertices(super.getUnevenVertices(t,e))}getSpacedVertices(t=40,e=[]){return this._closeVertices(super.getSpacedVertices(t,e))}getAdaptiveVertices(t=[]){return this._closeVertices(super.getAdaptiveVertices(t))}getFillVertices(t){return this._closeVertices(super.getFillVertices(t))}_setCurrentPoint(t){return this.currentPoint=new k(t.x,t.y),this.startPoint||(this.startPoint=this.currentPoint.clone()),this}_connetLineTo(t){if(this.curves.length>0){const e=t.getPoint(0);(!this.currentPoint||!e.equals(this.currentPoint))&&this.lineTo(e.x,e.y)}return this}closePath(){const t=this.startPoint;if(t){const e=this.currentPoint;e&&!t.equals(e)&&(this.curves.push(new Kt(e.clone(),t.clone())),e.copy(t)),this.startPoint=void 0}return this}moveTo(t,e){return this.currentPoint=new k(t,e),this.startPoint=this.currentPoint.clone(),this}lineTo(t,e){const n=this.currentPoint;return n?.equals({x:t,y:e})||this.curves.push(Kt.from(n?.x??0,n?.y??0,t,e)),this._setCurrentPoint({x:t,y:e}),this}bezierCurveTo(t,e,n,i,s,o){const a=this.currentPoint;return a?.equals({x:s,y:o})||this.curves.push(Rn.from(a?.x??0,a?.y??0,t,e,n,i,s,o)),this._setCurrentPoint({x:s,y:o}),this}quadraticCurveTo(t,e,n,i){const s=this.currentPoint;return s?.equals({x:n,y:i})||this.curves.push(Vn.from(s?.x??0,s?.y??0,t,e,n,i)),this._setCurrentPoint({x:n,y:i}),this}arc(t,e,n,i,s,o){const a=new ia(t,e,n,i,s,!o);return this._connetLineTo(a),this.curves.push(a),this._setCurrentPoint(a.getPoint(1)),this}relativeArc(t,e,n,i,s,o){return t+=this.currentPoint?.x??0,e+=this.currentPoint?.y??0,this.arc(t,e,n,i,s,o),this}arcTo(t,e,n,i,s){return console.warn("Method arcTo not supported yet"),this}ellipse(t,e,n,i,s,o,a,l=!0){const c=new sa(t,e,n,i,s,o,a,!l);return this._connetLineTo(c),this.curves.push(c),this._setCurrentPoint(c.getPoint(1)),this}relativeEllipse(t,e,n,i,s,o,a,l){return t+=this.currentPoint?.x??0,e+=this.currentPoint?.y??0,this.ellipse(t,e,n,i,s,o,a,l),this}rect(t,e,n,i){const s=new aa(t,e,n,i);return this._connetLineTo(s),this.curves.push(s),this._setCurrentPoint({x:t,y:e}),this}roundRect(t,e,n,i,s){const o=new la(t,e,n,i,s);return this._connetLineTo(o),this.curves.push(o),this._setCurrentPoint({x:t,y:e}),this}splineThru(t){const e=this.currentPoint??new k;return this.curves.push(new ca([e].concat(t))),this._setCurrentPoint(t[t.length-1]),this}drawTo(t){const e=this.curves[0]?.getPoint(0);return e&&t.moveTo(e.x,e.y),this.curves.forEach(n=>n.drawTo(t)),this.autoClose&&t.closePath(),this}copy(t){return super.copy(t),this.autoClose=t.autoClose,this.currentPoint=t.currentPoint?.clone(),this}}class Pt extends Ee{_meta;currentCurve=new an;style;get startPoint(){return this.currentCurve.startPoint}get currentPoint(){return this.currentCurve.currentPoint}get strokeWidth(){return this.style.strokeWidth??((this.style.stroke??"none")==="none"?0:1)}constructor(t,e={}){super(),this.curves.push(this.currentCurve),this.style=e,t&&(t instanceof Pt?this.addPath(t):Array.isArray(t)?this.addCommands(t):this.addData(t))}getMeta(){return this._meta}setMeta(t){return this._meta=t,this}addPath(t){const e=t instanceof Pt?t.curves:[t];if(e.filter(n=>n.curves.length).length===0)return this;if(!this.currentCurve.curves.length){const n=this.curves.findIndex(i=>i===this.currentCurve);n>-1&&this.curves.splice(n,1)}return this.curves.push(...e.map(n=>n.clone())),this.currentCurve=this.curves[this.curves.length-1],this}closePath(){const t=this.startPoint;return t&&this.currentCurve.curves.length&&(this.currentCurve.closePath(),this.currentCurve=new an().moveTo(t.x,t.y),this.curves.push(this.currentCurve)),this}moveTo(t,e){return this.currentCurve.currentPoint?.equals({x:t,y:e})||(this.currentCurve.curves.length&&(this.currentCurve=new an,this.curves.push(this.currentCurve)),this.currentCurve.moveTo(t,e)),this}lineTo(t,e){return this.currentCurve.lineTo(t,e),this}bezierCurveTo(t,e,n,i,s,o){return this.currentCurve.bezierCurveTo(t,e,n,i,s,o),this}quadraticCurveTo(t,e,n,i){return this.currentCurve.quadraticCurveTo(t,e,n,i),this}arc(t,e,n,i,s,o){return this.currentCurve.arc(t,e,n,i,s,o),this}arcTo(t,e,n,i,s){return this.currentCurve.arcTo(t,e,n,i,s),this}ellipse(t,e,n,i,s,o,a,l){return this.currentCurve.ellipse(t,e,n,i,s,o,a,l),this}rect(t,e,n,i){return this.currentCurve.rect(t,e,n,i),this}roundRect(t,e,n,i,s){return this.currentCurve.roundRect(t,e,n,i,s),this}reset(){return this.currentCurve=new an,this.curves=[this.currentCurve],this.style={},this}addCommands(t){return Vr(t,this),this}addData(t){return this.addCommands(jr(t)),this}splineThru(t){return this.currentCurve.splineThru(t),this}scale(t,e=t,n={x:0,y:0}){return this.getControlPointRefs().forEach(i=>{i.scale(t,e,n)}),this}skew(t,e=0,n={x:0,y:0}){return this.getControlPointRefs().forEach(i=>{i.skew(t,e,n)}),this}rotate(t,e={x:0,y:0}){return this.getControlPointRefs().forEach(n=>{n.rotate(t,e)}),this}bold(t){if(t===0)return this;const e=this.getFlatCurves(),n=[],i=[],s=[];e.forEach((a,l)=>{const c=a.getControlPointRefs(),h=a.isClockwise();s[l]=c,i[l]=h;const u=c[0],p=c[c.length-1]??u;n.push({start:h?p:u,end:h?u:p,index:l})});const o=[];return n.forEach((a,l)=>{o[l]=[],n.forEach((c,h)=>{c.start&&a.end&&h!==l&&c.start?.equals(a.end)&&o[l].push(c.index)})}),e.forEach((a,l)=>{const c=i[l];s[l].forEach(h=>{h.add(a.getNormal(a.getTForPoint(h)).scale(c?t:-t))})}),o.forEach((a,l)=>{const c=s[l];a.forEach(h=>{const u=s[h],p=jo(c[c.length-1],c[c.length-2]??c[c.length-1],u[0],u[1]??u[0]);p&&(c[c.length-1].copy(p),u[0].copy(p))})}),this}getMinMax(t=k.MAX,e=k.MIN,n=!0){const i=this.strokeWidth;return this.curves.forEach(s=>{if(s.getMinMax(t,e),n&&i>1){const o=i/2,a=s.isClockwise(),l=[];for(let c=0;c<=1;c+=1/s.arcLengthDivision){const h=s.getPoint(c),u=s.getNormal(c),p=u.clone().scale(a?o:-o),d=u.clone().scale(a?-o:o);l.push(h.clone().add(p),h.clone().add(d),h.clone().add({x:o,y:0}),h.clone().add({x:-o,y:0}),h.clone().add({x:0,y:o}),h.clone().add({x:0,y:-o}),h.clone().add({x:o,y:o}),h.clone().add({x:-o,y:-o}))}t.min(...l),e.max(...l)}}),{min:t.finite(),max:e.finite()}}strokeTriangulate(t){const e=t?.indices??[],n=t?.vertices??[];return this.curves.forEach(i=>{i.strokeTriangulate({...t,indices:e,vertices:n,style:{...this.style}})}),{indices:e,vertices:n}}fillTriangulate(t){const e={...t,style:{...this.style,...t?.style}},n=e.indices??[],i=e.vertices??[];if((e.style.fillRule??"nonzero")==="nonzero"){const o=this.curves.map(c=>c.getFillVertices(e)),a=Wo(o),l=a.length;for(let c=0;c<l;c++){const h=a[c],u=o[c];if(h.winding||!u.length)continue;const p=u.slice(),d=[];for(let f=0;f<l;f++){const y=a[f];y.parentIndex===c&&(d.push(p.length/2),p.push(...o[y.index]))}ei(p,{...t,indices:n,vertices:i,holes:d,style:{...this.style}})}}else this.curves.forEach(o=>{o.fillTriangulate({...t,indices:n,vertices:i,style:{...this.style}})});return{indices:n,vertices:i}}getBoundingBox(t=!0){const{min:e,max:n}=this.getMinMax(void 0,void 0,t);return new H(e.x,e.y,n.x-e.x,n.y-e.y)}drawTo(t,e={}){e={...this.style,...e};const{fill:n="#000",stroke:i="none"}=e;return t.beginPath(),t.save(),Fn(t,e),this.curves.forEach(s=>{s.drawTo(t)}),n!=="none"&&t.fill(),i!=="none"&&t.stroke(),t.restore(),this}drawControlPointsTo(t,e={}){e={...this.style,...e};const{fill:n="#000",stroke:i="none"}=e;return t.beginPath(),t.save(),Fn(t,e),this.getControlPointRefs().forEach(s=>{ho(t,s.x,s.y,{radius:4})}),n!=="none"&&t.fill(),i!=="none"&&t.stroke(),t.restore(),this}toCommands(){return this.curves.flatMap(t=>t.toCommands())}toData(){return this.curves.filter(t=>t.curves.length).map(t=>t.toData()).join(" ")}toSvgPathString(){const t={...this.style,fill:this.style.fill??"#000",stroke:this.style.stroke??"none"},e={};for(const i in t)t[i]!==void 0&&(e[Vo(i)]=t[i]);Object.assign(e,{"stroke-width":`${this.strokeWidth}px`});let n="";for(const i in e)e[i]!==void 0&&(n+=`${i}:${e[i]};`);return`<path d="${this.toData()}" style="${n}"></path>`}copy(t){return super.copy(t),this.currentCurve=t.currentCurve.clone(),this.style={...t.style},this}}class ee{constructor(t=[],e){this.paths=t,this.viewBox=e}getBoundingBox(t=!0){if(!this.paths.length)return;const e=k.MAX,n=k.MIN;return this.paths.forEach(i=>i.getMinMax(e,n,t)),new H(e.x,e.y,n.x-e.x,n.y-e.y)}toTriangulatedSvgString(t=this.paths.map(n=>n.fillTriangulate()),e=0){let n="",i="";const s={x:-e,y:-e},o={x:e,y:e};(Array.isArray(t)?t:[t]).forEach(({vertices:h,indices:u,points:p=[]})=>{const d=f=>{const y=h[f*2],g=h[f*2+1];return s.x=Math.min(s.x,y+e),o.x=Math.max(o.x,y+e),s.y=Math.min(s.y,g+e),o.y=Math.max(o.y,g+e),[y,g]};for(let f=0,y=u.length;f<y;f+=3){const g=d(u[f]),M=d(u[f+1]),P=d(u[f+2]);n+=`<polygon
3
+ ${t}`);return e.documentElement}else return r}const yo="px",mo=90,Xr=["mm","cm","in","pt","pc","px"],Yr={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:72/6,pc:1,px:-1},px:{px:1}};function Z(r){let t="px";if(typeof r=="string")for(let n=0,i=Xr.length;n<i;n++){const s=Xr[n];if(r.endsWith(s)){t=s,r=r.substring(0,r.length-s.length);break}}let e;return e=Yr[t][yo],e<0&&(e=Yr[t].in*mo),e*Number.parseFloat(r)}const xo=new vt,rn=new vt,Zr=new vt,Kr=new vt;function vo(r,t,e){if(!(r.hasAttribute("transform")||r.nodeName==="use"&&(r.hasAttribute("x")||r.hasAttribute("y"))))return null;const n=wo(r);return e.length>0&&n.premultiply(e[e.length-1]),t.copy(n),e.push(n),n}function wo(r){const t=new vt,e=xo;if(r.nodeName==="use"&&(r.hasAttribute("x")||r.hasAttribute("y"))&&t.translate(Z(r.getAttribute("x")),Z(r.getAttribute("y"))),r.hasAttribute("transform")){const n=r.getAttribute("transform").split(")");for(let i=n.length-1;i>=0;i--){const s=n[i].trim();if(s==="")continue;const o=s.indexOf("("),a=s.length;if(o>0&&o<a){const l=s.slice(0,o),c=Gt(s.slice(o+1));switch(e.identity(),l){case"translate":if(c.length>=1){const h=c[0];let u=0;c.length>=2&&(u=c[1]),e.translate(h,u)}break;case"rotate":if(c.length>=1){let h=0,u=0,p=0;h=c[0]*Math.PI/180,c.length>=3&&(u=c[1],p=c[2]),rn.makeTranslation(-u,-p),Zr.makeRotation(h),Kr.multiplyMatrices(Zr,rn),rn.makeTranslation(u,p),e.multiplyMatrices(rn,Kr)}break;case"scale":c.length>=1&&e.scale(c[0],c[1]??c[0]);break;case"skewX":c.length===1&&e.set(1,Math.tan(c[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":c.length===1&&e.set(1,0,0,Math.tan(c[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":c.length===6&&e.set(c[0],c[2],c[4],c[1],c[3],c[5],0,0,1);break}}t.premultiply(e)}}return t}function bo(r){return new Pt().arc(Z(r.getAttribute("cx")||0),Z(r.getAttribute("cy")||0),Z(r.getAttribute("r")||0),0,Math.PI*2)}function So(r,t){if(!(!r.sheet||!r.sheet.cssRules||!r.sheet.cssRules.length))for(let e=0;e<r.sheet.cssRules.length;e++){const n=r.sheet.cssRules[e];if(n.type!==1)continue;const i=n.selectorText.split(/,/g).filter(Boolean).map(o=>o.trim()),s={};for(let o=n.style.length,a=0;a<o;a++){const l=n.style.item(a);s[l]=n.style.getPropertyValue(l)}for(let o=0;o<i.length;o++)t[i[o]]=Object.assign(t[i[o]]||{},{...s})}}function Co(r){return new Pt().ellipse(Z(r.getAttribute("cx")||0),Z(r.getAttribute("cy")||0),Z(r.getAttribute("rx")||0),Z(r.getAttribute("ry")||0),0,0,Math.PI*2)}function Mo(r){return new Pt().moveTo(Z(r.getAttribute("x1")||0),Z(r.getAttribute("y1")||0)).lineTo(Z(r.getAttribute("x2")||0),Z(r.getAttribute("y2")||0))}function Po(r){const t=new Pt,e=r.getAttribute("d");return!e||e==="none"?null:(t.addData(e),t)}const _o=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function To(r){const t=new Pt;let e=0;return r.getAttribute("points")?.replace(_o,(n,i,s)=>{const o=Z(i),a=Z(s);return e===0?t.moveTo(o,a):t.lineTo(o,a),e++,n}),t.currentCurve.autoClose=!0,t}const ko=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function Ao(r){const t=new Pt;let e=0;return r.getAttribute("points")?.replace(ko,(n,i,s)=>{const o=Z(i),a=Z(s);return e===0?t.moveTo(o,a):t.lineTo(o,a),e++,n}),t.currentCurve.autoClose=!1,t}function Oo(r){const t=Z(r.getAttribute("x")||0),e=Z(r.getAttribute("y")||0),n=Z(r.getAttribute("rx")||r.getAttribute("ry")||0),i=Z(r.getAttribute("ry")||r.getAttribute("rx")||0),s=Z(r.getAttribute("width")),o=Z(r.getAttribute("height")),a=1-.551915024494,l=new Pt;return l.moveTo(t+n,e),l.lineTo(t+s-n,e),(n!==0||i!==0)&&l.bezierCurveTo(t+s-n*a,e,t+s,e+i*a,t+s,e+i),l.lineTo(t+s,e+o-i),(n!==0||i!==0)&&l.bezierCurveTo(t+s,e+o-i*a,t+s-n*a,e+o,t+s-n,e+o),l.lineTo(t+n,e+o),(n!==0||i!==0)&&l.bezierCurveTo(t+n*a,e+o,t,e+o-i*a,t,e+o-i),l.lineTo(t,e+i),(n!==0||i!==0)&&l.bezierCurveTo(t,e+i*a,t+n*a,e,t+n,e),l}function qt(r,t,e){t=Object.assign({},t);let n={};if(r.hasAttribute("class")){const c=r.getAttribute("class").split(/\s/).filter(Boolean).map(h=>h.trim());for(let h=0;h<c.length;h++)n=Object.assign(n,e[`.${c[h]}`])}r.hasAttribute("id")&&(n=Object.assign(n,e[`#${r.getAttribute("id")}`]));for(let c=r.style.length,h=0;h<c;h++){const u=r.style.item(h),p=r.style.getPropertyValue(u);t[u]=p,n[u]=p}function i(c,h,u=s){r.hasAttribute(c)&&(t[h]=u(r.getAttribute(c))),n[c]&&(t[h]=u(n[c]))}function s(c){return c.startsWith("url")&&console.warn("url access in attributes is not implemented."),c}function o(c){return Math.max(0,Math.min(1,Z(c)))}function a(c){return Math.max(0,Z(c))}function l(c){return c.split(" ").filter(h=>h!=="").map(h=>Z(h))}return i("fill","fill"),i("fill-opacity","fillOpacity",o),i("fill-rule","fillRule"),i("opacity","opacity",o),i("stroke","stroke"),i("stroke-opacity","strokeOpacity",o),i("stroke-width","strokeWidth",a),i("stroke-linecap","strokeLinecap"),i("stroke-linejoin","strokeLinejoin"),i("stroke-miterlimit","strokeMiterlimit",a),i("stroke-dasharray","strokeDasharray",l),i("stroke-dashoffset","strokeDashoffset",Z),i("visibility","visibility"),t}function Ln(r,t,e=[],n={}){if(r.nodeType!==1)return e;let i=!1,s=null,o={...t};switch(r.nodeName){case"svg":o=qt(r,o,n);break;case"style":So(r,n);break;case"g":o=qt(r,o,n);break;case"path":o=qt(r,o,n),r.hasAttribute("d")&&(s=Po(r));break;case"rect":o=qt(r,o,n),s=Oo(r);break;case"polygon":o=qt(r,o,n),s=To(r);break;case"polyline":o=qt(r,o,n),s=Ao(r);break;case"circle":o=qt(r,o,n),s=bo(r);break;case"ellipse":o=qt(r,o,n),s=Co(r);break;case"line":o=qt(r,o,n),s=Mo(r);break;case"defs":i=!0;break;case"use":{o=qt(r,o,n);const p=(r.getAttributeNS("http://www.w3.org/1999/xlink","href")||r.getAttribute("href")||"").substring(1),d=r.viewportElement?.getElementById(p);d?Ln(d,o,e,n):console.warn(`'use node' references non-existent node id: ${p}`);break}default:console.warn(r);break}if(o.display==="none")return e;const a=new vt,l=[],c=vo(r,a,l);s&&(s.applyTransform(a),e.push(s),s.style={...o});const h=r.childNodes;for(let u=0,p=h.length;u<p;u++){const d=h[u];i&&d.nodeName!=="style"&&d.nodeName!=="defs"||Ln(d,o,e,n)}return c&&(l.pop(),l.length>0?a.copy(l[l.length-1]):a.identity()),e}function Qr(r){const t=Hr(r);return new ee(Ln(t,{}),t.getAttribute("viewBox")?.trim().split(" ").map(e=>Number(e)))}function Jr(r,t,e,n,i){const s=(n-t)*.5,o=(i-e)*.5,a=r*r,l=r*a;return(2*e-2*n+s+o)*l+(-3*e+3*n-2*s-o)*a+s*r+e}function Io(r,t){const e=1-r;return e*e*e*t}function Eo(r,t){const e=1-r;return 3*e*e*r*t}function Bo(r,t){return 3*(1-r)*r*r*t}function Do(r,t){return r*r*r*t}function ti(r,t,e,n,i){return Io(r,t)+Eo(r,e)+Bo(r,n)+Do(r,i)}function ei(r,t={}){let{vertices:e=[],indices:n=[],holes:i=[],verticesStride:s=2,verticesOffset:o=e.length/s,indicesOffset:a=n.length}=t;const l=Hs(r,i,2);if(l.length){for(let h=0;h<l.length;h+=3)n[a++]=l[h]+o,n[a++]=l[h+1]+o,n[a++]=l[h+2]+o;let c=o*s;for(let h=0;h<r.length;h+=2)e[c]=r[h],e[c+1]=r[h+1],c+=s}return{vertices:e,indices:n}}const Fo=8,sn=11920929e-14,Uo=1;function Lo(r,t,e,n,i,s,o,a,l=.5,c=[]){const u=Math.min(.99,Math.max(0,l));let p=(Uo-u)/1;return p*=p,$n(r,t,e,n,i,s,o,a,c,p,0),c.push(o,a),c}function $n(r,t,e,n,i,s,o,a,l,c,h){if(h>Fo)return;const u=(r+e)/2,p=(t+n)/2,d=(e+i)/2,f=(n+s)/2,y=(i+o)/2,g=(s+a)/2,M=(u+d)/2,P=(p+f)/2,x=(d+y)/2,C=(f+g)/2,w=(M+x)/2,v=(P+C)/2;if(h>0){let S=o-r,b=a-t;const D=Math.abs((e-o)*b-(n-a)*S),z=Math.abs((i-o)*b-(s-a)*S);if(D>sn&&z>sn){if((D+z)*(D+z)<=c*(S*S+b*b)){l.push(w,v);return}}else if(D>sn){if(D*D<=c*(S*S+b*b)){l.push(w,v);return}}else if(z>sn){if(z*z<=c*(S*S+b*b)){l.push(w,v);return}}else if(S=w-(r+o)/2,b=v-(t+a)/2,S*S+b*b<=c){l.push(w,v);return}}$n(r,t,u,p,M,P,w,v,l,c,h+1),$n(w,v,x,C,y,g,o,a,l,c,h+1)}const $o=8,No=11920929e-14,zo=1;function Ro(r,t,e,n,i,s,o=.5,a=[]){const c=Math.min(.99,Math.max(0,o));let h=(zo-c)/1;return h*=h,Nn(a,r,t,e,n,i,s,h,0),a.push(i,s),a}function Nn(r,t,e,n,i,s,o,a,l){if(l>$o)return;const c=(t+n)/2,h=(e+i)/2,u=(n+s)/2,p=(i+o)/2,d=(c+u)/2,f=(h+p)/2;let y=s-t,g=o-e;const M=Math.abs((n-s)*g-(i-o)*y);if(M>No){if(M*M<=a*(y*y+g*g)){r.push(d,f);return}}else if(y=d-(t+s)/2,g=f-(e+o)/2,y*y+g*g<=a){r.push(d,f);return}Nn(r,t,e,c,h,d,f,a,l+1),Nn(r,d,f,u,p,s,o,a,l+1)}function Vo(r){return r.replace(/[^a-z0-9]/gi,"-").replace(/\B([A-Z])/g,"-$1").toLowerCase()}function jo(r,t,e,n){const i=t.clone().sub(r),s=n.clone().sub(e),o=e.clone().sub(r),a=i.cross(s);if(a===0)return new k((r.x+e.x)/2,(r.y+e.y)/2);const l=o.cross(s)/a;return Math.abs(l)>1?new k((r.x+e.x)/2,(r.y+e.y)/2):new k(r.x+l*i.x,r.y+l*i.y)}function ni(r,t,e,n,i,s){return(e-r)*(s-t)-(n-t)*(i-r)}function Go(r,t,e){const n=e.length;let i=0;for(let s=0,o=n-2;s<n;o=s,s+=2){const a=e[s],l=e[s+1],c=e[o],h=e[o+1];l<=t?h>t&&ni(c,h,a,l,r,t)>0&&i++:h<=t&&ni(c,h,a,l,r,t)<0&&i--}return i}function qo(r,t){const e=t[0]-r[0],n=t[1]-r[1];return Math.sqrt(e*e+n*n)}function Wo(r){const t=r.map((n,i)=>({index:i})),e=r.map(n=>{const i=n.length;if(!i)return[];let s=[Number.MAX_SAFE_INTEGER,0],o=[0,Number.MAX_SAFE_INTEGER],a=[Number.MIN_SAFE_INTEGER,0],l=[0,Number.MIN_SAFE_INTEGER];for(let P=0;P<i;P+=2){const x=n[P],C=n[P+1];s[0]>x&&(s=[x,C]),o[1]>C&&(o=[x,C]),a[0]<x&&(a=[x,C]),l[1]<C&&(l=[x,C])}const c=[(s[0]+a[0])/2,(o[1]+l[1])/2];let h,u,p,d,f,y,g,M;for(let P=0;P<i;P+=2){const x=n[P],C=n[P+1],w=Math.abs(x-c[0]),v=Math.abs(C-c[1]);C<c[1]&&(!h||w<h)&&(h=w,p=[x,C]),C>c[1]&&(!u||w<u)&&(u=w,d=[x,C]),x<c[0]&&(!f||v<f)&&(f=v,g=[x,C]),x>c[0]&&(!y||v<y)&&(y=v,M=[x,C])}return[s,o,a,l,p,d,g,M].filter(Boolean)});for(let n=0,i=r.length;n<i;n++){const s=[],o=e[n];for(let a=0;a<i;a++){if(n===a)continue;const l={},c=[];for(let h=0,u=o.length;h<u;h++){const[p,d]=o[h],f=Go(p,d,r[a]);l[f]=(l[f]??0)+1,c.push(f)}c.filter(h=>h!==0).length>c.filter(h=>h===0).length&&s.push({index:n,parentIndex:a,winding:Number(Array.from(Object.entries(l)).sort((h,u)=>u[1]-h[1])?.[0]?.[0]??0),dist:qo(e[n][0],e[a][0])})}s.reduce((a,l)=>a+l.winding,0)!==0&&(s.sort((a,l)=>a.dist-l.dist),t[n]=s[0])}return t}function Ho(r,t){const e=1-r;return e*e*t}function Xo(r,t){return 2*(1-r)*r*t}function Yo(r,t){return r*r*t}function ri(r,t,e,n){return Ho(r,t)+Xo(r,e)+Yo(r,n)}const Zo=1e-4,ii=1e-4;function Ko(r,t={}){const{vertices:e=[],indices:n=[],lineStyle:i={alignment:.5,cap:"butt",join:"miter",width:1,miterLimit:10},flipAlignment:s=!1,closed:o=!0}=t,a=Zo;if(r.length===0)return{vertices:e,indices:n};const l=i;let c=l.alignment;if(i.alignment!==.5){let I=Qo(r);s&&(I*=-1),c=(c-.5)*I+.5}const h={x:r[0],y:r[1]},u={x:r[r.length-2],y:r[r.length-1]},p=o,d=Math.abs(h.x-u.x)<a&&Math.abs(h.y-u.y)<a;if(p){r=r.slice(),d&&(r.pop(),r.pop(),u.x=r[r.length-2],u.y=r[r.length-1]);const I=(h.x+u.x)*.5,R=(u.y+h.y)*.5;r.unshift(I,R),r.push(I,R)}const f=e,y=r.length/2;let g=r.length;const M=f.length/2,P=l.width/2,x=P*P,C=l.miterLimit*l.miterLimit;let w=r[0],v=r[1],S=r[2],b=r[3],D=0,z=0,E=-(v-b),F=w-S,N=0,B=0,A=Math.sqrt(E*E+F*F);E/=A,F/=A,E*=P,F*=P;const W=c,O=(1-W)*2,L=W*2;p||(l.cap==="round"?g+=he(w-E*(O-L)*.5,v-F*(O-L)*.5,w-E*O,v-F*O,w+E*L,v+F*L,f,!0)+2:l.cap==="square"&&(g+=si(w,v,E,F,O,L,!0,f))),f.push(w-E*O,v-F*O),f.push(w+E*L,v+F*L);for(let I=1;I<y-1;++I){w=r[(I-1)*2],v=r[(I-1)*2+1],S=r[I*2],b=r[I*2+1],D=r[(I+1)*2],z=r[(I+1)*2+1],E=-(v-b),F=w-S,A=Math.sqrt(E*E+F*F),E/=A,F/=A,E*=P,F*=P,N=-(b-z),B=S-D,A=Math.sqrt(N*N+B*B),N/=A,B/=A,N*=P,B*=P;const R=S-w,T=v-b,_=S-D,U=z-b,$=R*_+T*U,q=T*_-U*R,X=q<0;if(Math.abs(q)<.001*Math.abs($)){f.push(S-E*O,b-F*O),f.push(S+E*L,b+F*L),$>=0&&(l.join==="round"?g+=he(S,b,S-E*O,b-F*O,S-N*O,b-B*O,f,!1)+4:g+=2,f.push(S-N*L,b-B*L),f.push(S+N*O,b+B*O));continue}const nt=(-E+w)*(-F+b)-(-E+S)*(-F+v),Yt=(-N+D)*(-B+b)-(-N+S)*(-B+z),Dt=(R*Yt-_*nt)/q,Mt=(U*nt-T*Yt)/q,Tt=(Dt-S)*(Dt-S)+(Mt-b)*(Mt-b),ht=S+(Dt-S)*O,kt=b+(Mt-b)*O,Rt=S-(Dt-S)*L,Vt=b-(Mt-b)*L,Ft=Math.min(R*R+T*T,_*_+U*U),Zi=X?O:L,Hl=Ft+Zi*Zi*x;Tt<=Hl?l.join==="bevel"||Tt/x>C?(X?(f.push(ht,kt),f.push(S+E*L,b+F*L),f.push(ht,kt),f.push(S+N*L,b+B*L)):(f.push(S-E*O,b-F*O),f.push(Rt,Vt),f.push(S-N*O,b-B*O),f.push(Rt,Vt)),g+=2):l.join==="round"?X?(f.push(ht,kt),f.push(S+E*L,b+F*L),g+=he(S,b,S+E*L,b+F*L,S+N*L,b+B*L,f,!0)+4,f.push(ht,kt),f.push(S+N*L,b+B*L)):(f.push(S-E*O,b-F*O),f.push(Rt,Vt),g+=he(S,b,S-E*O,b-F*O,S-N*O,b-B*O,f,!1)+4,f.push(S-N*O,b-B*O),f.push(Rt,Vt)):(f.push(ht,kt),f.push(Rt,Vt)):(f.push(S-E*O,b-F*O),f.push(S+E*L,b+F*L),l.join==="round"?X?g+=he(S,b,S+E*L,b+F*L,S+N*L,b+B*L,f,!0)+2:g+=he(S,b,S-E*O,b-F*O,S-N*O,b-B*O,f,!1)+2:l.join==="miter"&&Tt/x<=C&&(X?(f.push(Rt,Vt),f.push(Rt,Vt)):(f.push(ht,kt),f.push(ht,kt)),g+=2),f.push(S-N*O,b-B*O),f.push(S+N*L,b+B*L),g+=2)}w=r[(y-2)*2],v=r[(y-2)*2+1],S=r[(y-1)*2],b=r[(y-1)*2+1],E=-(v-b),F=w-S,A=Math.sqrt(E*E+F*F),E/=A,F/=A,E*=P,F*=P,f.push(S-E*O,b-F*O),f.push(S+E*L,b+F*L),p||(l.cap==="round"?g+=he(S-E*(O-L)*.5,b-F*(O-L)*.5,S-E*O,b-F*O,S+E*L,b+F*L,f,!1)+2:l.cap==="square"&&(g+=si(S,b,E,F,O,L,!1,f)));const V=ii*ii;for(let I=M;I<g+M-2;++I)w=f[I*2],v=f[I*2+1],S=f[(I+1)*2],b=f[(I+1)*2+1],D=f[(I+2)*2],z=f[(I+2)*2+1],!(Math.abs(w*(b-z)+S*(z-v)+D*(v-b))<V)&&n.push(I,I+1,I+2);return{vertices:e,indices:n}}function Qo(r){const t=r.length;if(t<6)return 1;let e=0;for(let n=0,i=r[t-2],s=r[t-1];n<t;n+=2){const o=r[n],a=r[n+1];e+=(o-i)*(a+s),i=o,s=a}return e<0?-1:1}function si(r,t,e,n,i,s,o,a){const l=r-e*i,c=t-n*i,h=r+e*s,u=t+n*s;let p,d;o?(p=n,d=-e):(p=-n,d=e);const f=l+p,y=c+d,g=h+p,M=u+d;return a.push(f,y),a.push(g,M),2}function he(r,t,e,n,i,s,o,a){const l=e-r,c=n-t;let h=Math.atan2(l,c),u=Math.atan2(i-r,s-t);a&&h<u?h+=Math.PI*2:!a&&h>u&&(u+=Math.PI*2);let p=h;const d=u-h,f=Math.abs(d),y=Math.sqrt(l*l+c*c),g=(15*f*Math.sqrt(y)/Math.PI>>0)+1,M=d/g;if(p+=M,a){o.push(r,t),o.push(e,n);for(let P=1,x=p;P<g;P++,x+=M)o.push(r,t),o.push(r+Math.sin(x)*y,t+Math.cos(x)*y);o.push(r,t),o.push(i,s)}else{o.push(e,n),o.push(r,t);for(let P=1,x=p;P<g;P++,x+=M)o.push(r+Math.sin(x)*y,t+Math.cos(x)*y),o.push(r,t);o.push(i,s),o.push(r,t)}return g*2}class me{arcLengthDivision=200;_lengths=[];getPointAt(t,e=new k){return this.getPoint(this.getUToTMapping(t),e)}isClockwise(){return!1}getControlPointRefs(){return[]}applyTransform(t){const e=typeof t=="function";return this.getControlPointRefs().forEach(n=>{e?t(n):n.applyMatrix3(t)}),this}getUnevenVertices(t=5,e=[]){const n=new k;for(let i=0,s=Math.max(1,t)-1;i<=s;i++)this.getPoint(i/s,n),e.push(n.x,n.y);return e}getSpacedVertices(t=5,e=[]){const n=new k;for(let i=0,s=Math.max(1,t)-1;i<=s;i++)this.getPointAt(i/s,n),e.push(n.x,n.y);return e}getAdaptiveVertices(t=[]){return this.getUnevenVertices(5,t)}_verticesToPoints(t,e=[]){for(let n=0,i=t.length;n<i;n+=2){const s=t[n],o=t[n+1];e.push(new k(s,o))}return e}getSpacedPoints(t,e=[]){const n=this.getSpacedVertices(t);return this._verticesToPoints(n,e),e}getUnevenPoints(t,e=[]){const n=this.getUnevenVertices(t);return this._verticesToPoints(n,e),e}getAdaptivePoints(t=[]){const e=this.getAdaptiveVertices();return this._verticesToPoints(e,t),t}getPoints(t,e=[]){let n;return t?n=this.getUnevenVertices(t):n=this.getAdaptiveVertices(),this._verticesToPoints(n,e),e}getLength(){const t=this.getLengths();return t[t.length-1]??0}getLengths(){return this._lengths.length!==this.arcLengthDivision+1&&this.updateLengths(),this._lengths}updateLengths(){const t=this.arcLengthDivision,e=[0];for(let n=0,i=this.getPoint(0),s=1;s<=t;s++){const o=this.getPoint(s/t);n+=o.distanceTo(i),e.push(n),i=o}this._lengths=e}getUToTMapping(t,e){const n=this.getLengths(),i=n.length,s=e??t*n[i-1];if(i<2)return s/n[0];let o=0,a=0,l=i-1,c;for(;a<=l;)if(o=Math.floor(a+(l-a)/2),c=n[o]-s,c<0)a=o+1;else if(c>0)l=o-1;else{l=o;break}if(o=Math.max(0,l),n[o]===s)return o/(i-1);const h=n[o],p=n[o+1]-h,d=Math.max(0,(s-h)/p);return(o+d)/(i-1)}getTangent(t,e=new k){const i=Math.max(0,t-1e-4),s=Math.min(1,t+1e-4);return e.copy(this.getPoint(s).sub(this.getPoint(i)).normalize())}getTangentAt(t,e){return this.getTangent(this.getUToTMapping(t),e)}getNormal(t,e=new k){return this.getTangent(t,e),e.set(-e.y,e.x).normalize()}getNormalAt(t,e){return this.getNormal(this.getUToTMapping(t),e)}getTForPoint(t,e=.001){let n=0,i=1,s=(n+i)/2;for(;i-n>e;){s=(n+i)/2;const o=this.getPoint(s);if(o.distanceTo(t)<e)return s;o.x<t.x?n=s:i=s}return s}getMinMax(t=k.MAX,e=k.MIN){const n=this.getPoints();for(let i=0,s=n.length;i<s;i++){const o=n[i];t.min(o),e.max(o)}return{min:t.finite(),max:e.finite()}}getBoundingBox(){const{min:t,max:e}=this.getMinMax();return new H(t.x,t.y,e.x-t.x,e.y-t.y)}getFillVertices(t){return this.getAdaptiveVertices()}fillTriangulate(t){return ei(this.getFillVertices(t),t)}strokeTriangulate(t){return Ko(this.getAdaptiveVertices(),t)}toCommands(){const t=[],e=this.getPoints();for(let n=0,i=e.length;n<i;n++){const s=e[n];n===0?t.push({type:"M",x:s.x,y:s.y}):t.push({type:"L",x:s.x,y:s.y})}return t}toData(){return po(this.toCommands())}drawTo(t){return this.toCommands().forEach(e=>{switch(e.type){case"M":t.moveTo(e.x,e.y);break;case"L":t.lineTo(e.x,e.y);break}}),this}copy(t){return this.arcLengthDivision=t.arcLengthDivision,this}clone(){return new this.constructor().copy(this)}}const Jo=new vt,oi=new vt,ai=new vt,on=new k;class zn extends me{constructor(t=new k,e=new k,n=new k,i=0,s=0,o=Math.PI*2,a=!1){super(),this._center=t,this._radius=e,this._diff=n,this.rotate=i,this.startAngle=s,this.endAngle=o,this.clockwise=a}get cx(){return this._center.x}set cx(t){this._center.x=t}get cy(){return this._center.y}set cy(t){this._center.y=t}get rx(){return this._radius.x}set rx(t){this._radius.x=t}get ry(){return this._radius.y}set ry(t){this._radius.y=t}get dx(){return this._diff.x}set dx(t){this._diff.x=t}get dy(){return this._diff.y}set dy(t){this._diff.y=t}isClockwise(){return this.clockwise}_getDeltaAngle(){const t=Math.PI*2;let e=this.endAngle-this.startAngle;const n=Math.abs(e)<Number.EPSILON;return e=(e%t+t)%t,n?e=0:this.clockwise||(e=e===0?-t:e-t),e}getPoint(t,e=new k){const n=this._getDeltaAngle(),i=this.startAngle+t*n;let s=this.cx+this.rx*Math.cos(i),o=this.cy+this.ry*Math.sin(i);if(this.rotate!==0){const a=Math.cos(this.rotate),l=Math.sin(this.rotate),c=s-this.cx,h=o-this.cy;s=c*a-h*l+this.cx,o=c*l+h*a+this.cy}return e.set(s,o)}toCommands(){const{cx:t,cy:e,rx:n,ry:i,startAngle:s,endAngle:o,clockwise:a,rotate:l}=this,c=t+n*Math.cos(s)*Math.cos(l)-i*Math.sin(s)*Math.sin(l),h=e+n*Math.cos(s)*Math.sin(l)+i*Math.sin(s)*Math.cos(l),u=Math.abs(s-o),p=u>Math.PI?1:0,d=a?1:0,f=l*180/Math.PI;if(u>=2*Math.PI){const y=s+Math.PI,g=t+n*Math.cos(y)*Math.cos(l)-i*Math.sin(y)*Math.sin(l),M=e+n*Math.cos(y)*Math.sin(l)+i*Math.sin(y)*Math.cos(l);return[{type:"M",x:c,y:h},{type:"A",rx:n,ry:i,angle:f,largeArcFlag:0,sweepFlag:d,x:g,y:M},{type:"A",rx:n,ry:i,angle:f,largeArcFlag:0,sweepFlag:d,x:c,y:h}]}else{const y=t+n*Math.cos(o)*Math.cos(l)-i*Math.sin(o)*Math.sin(l),g=e+n*Math.cos(o)*Math.sin(l)+i*Math.sin(o)*Math.cos(l);return[{type:"M",x:c,y:h},{type:"A",rx:n,ry:i,angle:f,largeArcFlag:p,sweepFlag:d,x:y,y:g}]}}drawTo(t){const{cx:e,cy:n,rx:i,ry:s,rotate:o,startAngle:a,endAngle:l,clockwise:c}=this;return t.ellipse(e,n,i,s,o,a,l,!c),this}applyTransform(t){return on.set(this.cx,this.cy),on.applyMatrix3(t),this.cx=on.x,this.cy=on.y,na(t)?ta(this,t):ea(this,t),this}getControlPointRefs(){return[this._center]}_getAdaptiveVerticesByArc(t=[]){const{cx:e,cy:n,rx:i,ry:s,dx:o,dy:a,startAngle:l,endAngle:c,clockwise:h,rotate:u}=this,p=!h;let d=Math.abs(l-c);(!p&&l>c||p&&c>l)&&(d=2*Math.PI-d);const f=Math.max(12,Math.floor(12*i**(1/3)*(d/Math.PI)));let y=d/f,g=l;y*=p?-1:1;const M=Math.cos(p?u:-u),P=Math.sin(p?u:-u);for(let x=0;x<f+1;x++){const C=o+Math.cos(g)*i,w=a+Math.sin(g)*s,v=C*M-w*P,S=C*P+w*M;t.push(e+v,n+S),g+=y}return t}_getAdaptiveVerticesByCircle(t=[]){const{cx:e,cy:n,rx:i,ry:s,dx:o,dy:a,rotate:l,clockwise:c}=this;if(!(i>=0&&s>=0&&o>=0&&a>=0))return t;const h=Math.ceil(2.3*Math.sqrt(i+s)),u=h*8+(o?4:0)+(a?4:0),p=[];if(u===0)return t;{const y=p.length;if(h===0)p[y]=p[y+6]=e+o,p[y+1]=p[y+3]=n+a,p[y+2]=p[y+4]=e-o,p[y+5]=p[y+7]=n-a;else{let g=y,M=y+h*4+(o?2:0)+2,P=M,x=u,C=o+i,w=a,v=e+C,S=e-C,b=n+w;if(p[g++]=v,p[g++]=b,p[--M]=b,p[--M]=S,a){const z=n-w;p[P++]=S,p[P++]=z,p[--x]=z,p[--x]=v}for(let z=1;z<h;z++){const E=Math.PI/2*(z/h),F=o+Math.cos(E)*i,N=a+Math.sin(E)*s,B=e+F,A=e-F,W=n+N,O=n-N;p[g++]=B,p[g++]=W,p[--M]=W,p[--M]=A,p[P++]=A,p[P++]=O,p[--x]=O,p[--x]=B}C=o,w=a+s,v=e+C,S=e-C,b=n+w;const D=n-w;p[g++]=v,p[g++]=b,p[--x]=D,p[--x]=v,o&&(p[g++]=S,p[g++]=b,p[--x]=D,p[--x]=S)}}const d=Math.cos(c?-l:l),f=Math.sin(c?-l:l);for(let y=0;y<p.length;y+=2){const g=p[y],M=p[y+1],P=g-e,x=M-n,C=P*d-x*f,w=P*f+x*d;t.push(e+C,n+w)}return t}getAdaptiveVertices(t=[]){return this.startAngle===0&&this.endAngle===Math.PI*2?this._getAdaptiveVerticesByCircle(t):this._getAdaptiveVerticesByArc(t)}copy(t){return super.copy(t),this.cx=t.cx,this.cy=t.cy,this.rx=t.rx,this.ry=t.ry,this.dx=t.dx,this.dy=t.dy,this.startAngle=t.startAngle,this.endAngle=t.endAngle,this.clockwise=t.clockwise,this.rotate=t.rotate,this}}function ta(r,t){const e=r.rx,n=r.ry,i=Math.cos(r.rotate),s=Math.sin(r.rotate),o=new k(e*i,e*s),a=new k(-n*s,n*i),l=o.applyMatrix3(t),c=a.applyMatrix3(t),h=Jo.set(l.x,c.x,0,l.y,c.y,0,0,0,1),u=oi.copy(h).invert(),f=ai.copy(u).transpose().multiply(u).elements,y=ra(f[0],f[1],f[4]),g=Math.sqrt(y.rt1),M=Math.sqrt(y.rt2);if(r.rx=1/g,r.ry=1/M,r.rotate=Math.atan2(y.sn,y.cs),!((r.endAngle-r.startAngle)%(2*Math.PI)<Number.EPSILON)){const x=oi.set(g,0,0,0,M,0,0,0,1),C=ai.set(y.cs,y.sn,0,-y.sn,y.cs,0,0,0,1),w=x.multiply(C).multiply(h),v=S=>{const{x:b,y:D}=new k(Math.cos(S),Math.sin(S)).applyMatrix3(w);return Math.atan2(D,b)};r.startAngle=v(r.startAngle),r.endAngle=v(r.endAngle),li(t)&&(r.clockwise=!r.clockwise)}}function ea(r,t){const e=ci(t),n=hi(t);r.rx*=e,r.ry*=n;const i=e>Number.EPSILON?Math.atan2(t.elements[1],t.elements[0]):Math.atan2(-t.elements[3],t.elements[4]);r.rotate+=i,li(t)&&(r.startAngle*=-1,r.endAngle*=-1,r.clockwise=!r.clockwise)}function li(r){const t=r.elements;return t[0]*t[4]-t[1]*t[3]<0}function na(r){const t=r.elements,e=t[0]*t[3]+t[1]*t[4];if(e===0)return!1;const n=ci(r),i=hi(r);return Math.abs(e/(n*i))>Number.EPSILON}function ci(r){const t=r.elements;return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function hi(r){const t=r.elements;return Math.sqrt(t[3]*t[3]+t[4]*t[4])}function ra(r,t,e){let n,i,s,o,a;const l=r+e,c=r-e,h=Math.sqrt(c*c+4*t*t);return l>0?(n=.5*(l+h),a=1/n,i=r*a*e-t*a*t):l<0?i=.5*(l-h):(n=.5*h,i=-.5*h),c>0?s=c+h:s=c-h,Math.abs(s)>2*Math.abs(t)?(a=-2*t/s,o=1/Math.sqrt(1+a*a),s=a*o):Math.abs(t)===0?(s=1,o=0):(a=-.5*s/t,s=1/Math.sqrt(1+a*a),o=a*s),c>0&&(a=s,s=-o,o=a),{rt1:n,rt2:i,cs:s,sn:o}}class ia extends zn{constructor(t=0,e=0,n=1,i=0,s=Math.PI*2,o=!1){super(new k(t,e),new k(n,n),new k,0,i,s,o)}drawTo(t){const{cx:e,cy:n,rx:i,startAngle:s,endAngle:o,clockwise:a}=this;return t.arc(e,n,i,s,o,!a),this}}class Kt extends me{constructor(t=new k,e=new k){super(),this.p1=t,this.p2=e}static from(t,e,n,i){return new Kt(new k(t,e),new k(n,i))}getPoint(t,e=new k){return t===1?e.copy(this.p2):e.copy(this.p2).sub(this.p1).scale(t).add(this.p1),e}getPointAt(t,e=new k){return this.getPoint(t,e)}getTangent(t,e=new k){return e.subVectors(this.p2,this.p1).normalize()}getTangentAt(t,e=new k){return this.getTangent(t,e)}getControlPointRefs(){return[this.p1,this.p2]}getAdaptiveVertices(t=[]){return t.push(this.p1.x,this.p1.y,this.p2.x,this.p2.y),t}getMinMax(t=k.MAX,e=k.MIN){const{p1:n,p2:i}=this;return t.x=Math.min(t.x,n.x,i.x),t.y=Math.min(t.y,n.y,i.y),e.x=Math.max(e.x,n.x,i.x),e.y=Math.max(e.y,n.y,i.y),{min:t.finite(),max:e.finite()}}toCommands(){const{p1:t,p2:e}=this;return[{type:"M",x:t.x,y:t.y},{type:"L",x:e.x,y:e.y}]}getFillVertices(t={}){const e=Math.min(this.p1.x,this.p2.x),n=Math.max(this.p1.x,this.p2.x),i=Math.min(this.p1.y,this.p2.y),s=Math.max(this.p1.y,this.p2.y),o=e,a=i,l=n-e||t.style?.strokeWidth||0,c=s-i||t.style?.strokeWidth||0;return[o,a,o+l,a,o+l,a+c,o,a+c]}drawTo(t){const{p1:e,p2:n}=this;return t.lineTo(e.x,e.y),t.lineTo(n.x,n.y),this}copy(t){return super.copy(t),this.p1.copy(t.p1),this.p2.copy(t.p2),this}}class Ee extends me{constructor(t=[]){super(),this.curves=t}getFlatCurves(){return this.curves.flatMap(t=>t instanceof Ee?t.getFlatCurves():t)}addCurve(t){return this.curves.push(t),this}getPoint(t,e=new k){const n=t*this.getLength(),i=this.getLengths();let s=0;for(;s<i.length;){if(i[s]>=n){const o=i[s]-n,a=this.curves[s],l=a.getLength();return a.getPointAt(l===0?0:1-o/l,e)}s++}return e}getLengths(){return this._lengths.length!==this.curves.length&&this.updateLengths(),this._lengths}updateLengths(){const t=[];for(let e=0,n=0,i=this.curves.length;e<i;e++)n+=this.curves[e].getLength(),t.push(n);this._lengths=t}getControlPointRefs(){return this.curves.flatMap(t=>t.getControlPointRefs())}_removeNextPointIfEqualPrevPoint(t,e){const n=[t[e-1],t[e]],i=[t[e+1],t[e+2]];return n[0]===i[0]&&n[1]===i[1]&&t.splice(e+1,2),t}getSpacedVertices(t=5,e=[]){let n;return this.curves.forEach(i=>{i.getSpacedVertices(t,e),n&&this._removeNextPointIfEqualPrevPoint(e,n),n=e.length-1}),e}getAdaptiveVertices(t=[]){let e;return this.curves.forEach(n=>{n.getAdaptiveVertices(t),e&&this._removeNextPointIfEqualPrevPoint(t,e),e=t.length-1}),t}strokeTriangulate(t){return this.curves.length===1?this.curves[0].strokeTriangulate(t):super.strokeTriangulate(t)}getFillVertices(t){if(this.curves.length===1)return this.curves[0].getFillVertices(t);{const e=[];let n;return this.curves.forEach(i=>{let s;i instanceof Kt?s=i.getAdaptiveVertices():s=i.getFillVertices(t),e.push(...s),n&&this._removeNextPointIfEqualPrevPoint(e,n),n=e.length-1}),e}}applyTransform(t){return this.curves.forEach(e=>e.applyTransform(t)),this}getMinMax(t=k.MAX,e=k.MIN){return this.curves.forEach(n=>n.getMinMax(t,e)),{min:t.finite(),max:e.finite()}}getBoundingBox(){const{min:t,max:e}=this.getMinMax();return new H(t.x,t.y,e.x-t.x,e.y-t.y)}toCommands(){return this.curves.flatMap(t=>t.toCommands())}drawTo(t){const e=this.curves[0]?.getPoint(0);return e&&t.moveTo(e.x,e.y),this.curves.forEach(n=>n.drawTo(t)),this}copy(t){return super.copy(t),this.curves=t.curves.map(e=>e.clone()),this}}class Rn extends me{constructor(t=new k,e=new k,n=new k,i=new k){super(),this.p1=t,this.cp1=e,this.cp2=n,this.p2=i}static from(t,e,n,i,s,o,a,l){return new Rn(new k(t,e),new k(n,i),new k(s,o),new k(a,l))}getPoint(t,e=new k){const{p1:n,cp1:i,cp2:s,p2:o}=this;return e.set(ti(t,n.x,i.x,s.x,o.x),ti(t,n.y,i.y,s.y,o.y))}getAdaptiveVertices(t=[]){return Lo(this.p1.x,this.p1.y,this.cp1.x,this.cp1.y,this.cp2.x,this.cp2.y,this.p2.x,this.p2.y,.5,t)}getControlPointRefs(){return[this.p1,this.cp1,this.cp2,this.p2]}_solveQuadratic(t,e,n){const i=e*e-4*t*n;if(i<0)return[];const s=Math.sqrt(i),o=(-e+s)/(2*t),a=(-e-s)/(2*t);return[o,a].filter(l=>l>=0&&l<=1)}getMinMax(t=k.MAX,e=k.MIN){const{p1:n,cp1:i,cp2:s,p2:o}=this,a=this._solveQuadratic(3*(i.x-n.x),6*(s.x-i.x),3*(o.x-s.x)),l=this._solveQuadratic(3*(i.y-n.y),6*(s.y-i.y),3*(o.y-s.y)),c=[0,1,...a,...l];return((u,p)=>{for(const d of u)for(let f=0;f<=p;f++){const y=f/p-.5,g=Math.min(1,Math.max(0,d+y)),M=this.getPoint(g);t.x=Math.min(t.x,M.x),t.y=Math.min(t.y,M.y),e.x=Math.max(e.x,M.x),e.y=Math.max(e.y,M.y)}})(c,10),{min:t.finite(),max:e.finite()}}toCommands(){const{p1:t,cp1:e,cp2:n,p2:i}=this;return[{type:"M",x:t.x,y:t.y},{type:"C",x1:e.x,y1:e.y,x2:n.x,y2:n.y,x:i.x,y:i.y}]}drawTo(t){const{p1:e,cp1:n,cp2:i,p2:s}=this;return t.lineTo(e.x,e.y),t.bezierCurveTo(n.x,n.y,i.x,i.y,s.x,s.y),this}copy(t){return super.copy(t),this.p1.copy(t.p1),this.cp1.copy(t.cp1),this.cp2.copy(t.cp2),this.p2.copy(t.p2),this}}class sa extends zn{constructor(t=0,e=0,n=1,i=1,s=0,o=0,a=Math.PI*2,l=!1){super(new k(t,e),new k(n,i),new k,s,o,a,l)}drawTo(t){return t.ellipse(this.cx,this.cy,this.rx,this.ry,this.rotate,this.startAngle,this.endAngle,!this.clockwise),this}}class oa extends Ee{}class Vn extends me{constructor(t=new k,e=new k,n=new k){super(),this.p1=t,this.cp=e,this.p2=n}static from(t,e,n,i,s,o){return new Vn(new k(t,e),new k(n,i),new k(s,o))}getPoint(t,e=new k){const{p1:n,cp:i,p2:s}=this;return e.set(ri(t,n.x,i.x,s.x),ri(t,n.y,i.y,s.y)),e}getControlPointRefs(){return[this.p1,this.cp,this.p2]}getAdaptiveVertices(t=[]){return Ro(this.p1.x,this.p1.y,this.cp.x,this.cp.y,this.p2.x,this.p2.y,.5,t)}getMinMax(t=k.MAX,e=k.MIN){const{p1:n,cp:i,p2:s}=this,o=.5*(n.x+i.x),a=.5*(n.y+i.y),l=.5*(n.x+s.x),c=.5*(n.y+s.y);return t.x=Math.min(t.x,n.x,s.x,o,l),t.y=Math.min(t.y,n.y,s.y,a,c),e.x=Math.max(e.x,n.x,s.x,o,l),e.y=Math.max(e.y,n.y,s.y,a,c),{min:t.finite(),max:e.finite()}}toCommands(){const{p1:t,cp:e,p2:n}=this;return[{type:"M",x:t.x,y:t.y},{type:"Q",x1:e.x,y1:e.y,x:n.x,y:n.y}]}drawTo(t){const{p1:e,cp:n,p2:i}=this;return t.lineTo(e.x,e.y),t.quadraticCurveTo(n.x,n.y,i.x,i.y),this}copy(t){return super.copy(t),this.p1.copy(t.p1),this.cp.copy(t.cp),this.p2.copy(t.p2),this}}class aa extends oa{constructor(t=0,e=0,n=0,i=0){super(),this.x=t,this.y=e,this.width=n,this.height=i,this.update()}update(){const{x:t,y:e,width:n,height:i}=this,s=[new k(t,e),new k(t+n,e),new k(t+n,e+i),new k(t,e+i)];return this.curves=[new Kt(s[0],s[1]),new Kt(s[1],s[2]),new Kt(s[2],s[3]),new Kt(s[3],s[0])],this}drawTo(t){return t.rect(this.x,this.y,this.width,this.height),this}getFillVertices(t={}){const{x:e,y:n,width:i,height:s}=this;return[e,n,e+i,n,e+i,n+s,e,n+s]}copy(t){return super.copy(t),this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.update(),this}}class la extends zn{constructor(t=0,e=0,n=1,i=1,s=1){super(),this.x=t,this.y=e,this.width=n,this.height=i,this.radius=s,this.update()}update(){const{x:t,y:e,width:n,height:i,radius:s}=this,o=n/2,a=i/2,l=t+o,c=e+a,h=Math.max(0,Math.min(s,Math.min(o,a))),u=h;return this._center=new k(l,c),this._radius=new k(h,u),this._diff=new k(o-h,a-u),this}drawTo(t){const{x:e,y:n,width:i,height:s,radius:o}=this;return t.roundRect(e,n,i,s,o),this}copy(t){return super.copy(t),this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.radius=t.radius,this.update(),this}}class ca extends me{constructor(t=[]){super(),this.points=t}getPoint(t,e=new k){const{points:n}=this,i=(n.length-1)*t,s=Math.floor(i),o=i-s,a=n[s===0?s:s-1],l=n[s],c=n[s>n.length-2?n.length-1:s+1],h=n[s>n.length-3?n.length-1:s+2];return e.set(Jr(o,a.x,l.x,c.x,h.x),Jr(o,a.y,l.y,c.y,h.y)),e}getControlPointRefs(){return this.points}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++)this.points.push(t.points[e].clone());return this}}class an extends Ee{startPoint;currentPoint;autoClose=!1;constructor(t){super(),t&&this.addPoints(t)}addPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,n=t.length;e<n;e++){const{x:i,y:s}=t[e];this.lineTo(i,s)}return this}addCommands(t){return Vr(t,this),this}addData(t){return this.addCommands(jr(t)),this}_closeVertices(t){return this.autoClose&&t.length>=4&&t[0]!==t[t.length-2]&&t[1]!==t[t.length-1]&&t.push(t[0],t[1]),t}getUnevenVertices(t=40,e=[]){return this._closeVertices(super.getUnevenVertices(t,e))}getSpacedVertices(t=40,e=[]){return this._closeVertices(super.getSpacedVertices(t,e))}getAdaptiveVertices(t=[]){return this._closeVertices(super.getAdaptiveVertices(t))}getFillVertices(t){return this._closeVertices(super.getFillVertices(t))}_setCurrentPoint(t){return this.currentPoint=new k(t.x,t.y),this.startPoint||(this.startPoint=this.currentPoint.clone()),this}_connetLineTo(t){if(this.curves.length>0){const e=t.getPoint(0);(!this.currentPoint||!e.equals(this.currentPoint))&&this.lineTo(e.x,e.y)}return this}closePath(){const t=this.startPoint;if(t){const e=this.currentPoint;e&&!t.equals(e)&&(this.curves.push(new Kt(e.clone(),t.clone())),e.copy(t)),this.startPoint=void 0}return this}moveTo(t,e){return this.currentPoint=new k(t,e),this.startPoint=this.currentPoint.clone(),this}lineTo(t,e){const n=this.currentPoint;return n?.equals({x:t,y:e})||this.curves.push(Kt.from(n?.x??0,n?.y??0,t,e)),this._setCurrentPoint({x:t,y:e}),this}bezierCurveTo(t,e,n,i,s,o){const a=this.currentPoint;return a?.equals({x:s,y:o})||this.curves.push(Rn.from(a?.x??0,a?.y??0,t,e,n,i,s,o)),this._setCurrentPoint({x:s,y:o}),this}quadraticCurveTo(t,e,n,i){const s=this.currentPoint;return s?.equals({x:n,y:i})||this.curves.push(Vn.from(s?.x??0,s?.y??0,t,e,n,i)),this._setCurrentPoint({x:n,y:i}),this}arc(t,e,n,i,s,o){const a=new ia(t,e,n,i,s,!o);return this._connetLineTo(a),this.curves.push(a),this._setCurrentPoint(a.getPoint(1)),this}relativeArc(t,e,n,i,s,o){return t+=this.currentPoint?.x??0,e+=this.currentPoint?.y??0,this.arc(t,e,n,i,s,o),this}arcTo(t,e,n,i,s){return console.warn("Method arcTo not supported yet"),this}ellipse(t,e,n,i,s,o,a,l=!0){const c=new sa(t,e,n,i,s,o,a,!l);return this._connetLineTo(c),this.curves.push(c),this._setCurrentPoint(c.getPoint(1)),this}relativeEllipse(t,e,n,i,s,o,a,l){return t+=this.currentPoint?.x??0,e+=this.currentPoint?.y??0,this.ellipse(t,e,n,i,s,o,a,l),this}rect(t,e,n,i){const s=new aa(t,e,n,i);return this._connetLineTo(s),this.curves.push(s),this._setCurrentPoint({x:t,y:e}),this}roundRect(t,e,n,i,s){const o=new la(t,e,n,i,s);return this._connetLineTo(o),this.curves.push(o),this._setCurrentPoint({x:t,y:e}),this}splineThru(t){const e=this.currentPoint??new k;return this.curves.push(new ca([e].concat(t))),this._setCurrentPoint(t[t.length-1]),this}drawTo(t){const e=this.curves[0]?.getPoint(0);return e&&t.moveTo(e.x,e.y),this.curves.forEach(n=>n.drawTo(t)),this.autoClose&&t.closePath(),this}copy(t){return super.copy(t),this.autoClose=t.autoClose,this.currentPoint=t.currentPoint?.clone(),this}}class Pt extends Ee{_meta;currentCurve=new an;style;get startPoint(){return this.currentCurve.startPoint}get currentPoint(){return this.currentCurve.currentPoint}get strokeWidth(){return this.style.strokeWidth??((this.style.stroke??"none")==="none"?0:1)}constructor(t,e={}){super(),this.curves.push(this.currentCurve),this.style=e,t&&(t instanceof Pt?this.addPath(t):Array.isArray(t)?this.addCommands(t):this.addData(t))}getMeta(){return this._meta}setMeta(t){return this._meta=t,this}addPath(t){const e=t instanceof Pt?t.curves:[t];if(e.filter(n=>n.curves.length).length===0)return this;if(!this.currentCurve.curves.length){const n=this.curves.findIndex(i=>i===this.currentCurve);n>-1&&this.curves.splice(n,1)}return this.curves.push(...e.map(n=>n.clone())),this.currentCurve=this.curves[this.curves.length-1],this}closePath(){const t=this.startPoint;return t&&this.currentCurve.curves.length&&(this.currentCurve.closePath(),this.currentCurve=new an().moveTo(t.x,t.y),this.curves.push(this.currentCurve)),this}moveTo(t,e){return this.currentCurve.currentPoint?.equals({x:t,y:e})||(this.currentCurve.curves.length&&(this.currentCurve=new an,this.curves.push(this.currentCurve)),this.currentCurve.moveTo(t,e)),this}lineTo(t,e){return this.currentCurve.lineTo(t,e),this}bezierCurveTo(t,e,n,i,s,o){return this.currentCurve.bezierCurveTo(t,e,n,i,s,o),this}quadraticCurveTo(t,e,n,i){return this.currentCurve.quadraticCurveTo(t,e,n,i),this}arc(t,e,n,i,s,o){return this.currentCurve.arc(t,e,n,i,s,o),this}arcTo(t,e,n,i,s){return this.currentCurve.arcTo(t,e,n,i,s),this}ellipse(t,e,n,i,s,o,a,l){return this.currentCurve.ellipse(t,e,n,i,s,o,a,l),this}rect(t,e,n,i){return this.currentCurve.rect(t,e,n,i),this}roundRect(t,e,n,i,s){return this.currentCurve.roundRect(t,e,n,i,s),this}reset(){return this.currentCurve=new an,this.curves=[this.currentCurve],this.style={},this}addCommands(t){return Vr(t,this),this}addData(t){return this.addCommands(jr(t)),this}splineThru(t){return this.currentCurve.splineThru(t),this}scale(t,e=t,n={x:0,y:0}){return this.getControlPointRefs().forEach(i=>{i.scale(t,e,n)}),this}skew(t,e=0,n={x:0,y:0}){return this.getControlPointRefs().forEach(i=>{i.skew(t,e,n)}),this}rotate(t,e={x:0,y:0}){return this.getControlPointRefs().forEach(n=>{n.rotate(t,e)}),this}bold(t){if(t===0)return this;const e=this.getFlatCurves(),n=[],i=[],s=[];e.forEach((a,l)=>{const c=a.getControlPointRefs(),h=a.isClockwise();s[l]=c,i[l]=h;const u=c[0],p=c[c.length-1]??u;n.push({start:h?p:u,end:h?u:p,index:l})});const o=[];return n.forEach((a,l)=>{o[l]=[],n.forEach((c,h)=>{c.start&&a.end&&h!==l&&c.start?.equals(a.end)&&o[l].push(c.index)})}),e.forEach((a,l)=>{const c=i[l];s[l].forEach(h=>{h.add(a.getNormal(a.getTForPoint(h)).scale(c?t:-t))})}),o.forEach((a,l)=>{const c=s[l];a.forEach(h=>{const u=s[h],p=jo(c[c.length-1],c[c.length-2]??c[c.length-1],u[0],u[1]??u[0]);p&&(c[c.length-1].copy(p),u[0].copy(p))})}),this}getMinMax(t=k.MAX,e=k.MIN,n=!0){const i=this.strokeWidth;return this.curves.forEach(s=>{if(s.getMinMax(t,e),n&&i>1){const o=i/2,a=s.isClockwise(),l=[];for(let c=0;c<=1;c+=1/s.arcLengthDivision){const h=s.getPoint(c),u=s.getNormal(c),p=u.clone().scale(a?o:-o),d=u.clone().scale(a?-o:o);l.push(h.clone().add(p),h.clone().add(d),h.clone().add({x:o,y:0}),h.clone().add({x:-o,y:0}),h.clone().add({x:0,y:o}),h.clone().add({x:0,y:-o}),h.clone().add({x:o,y:o}),h.clone().add({x:-o,y:-o}))}t.min(...l),e.max(...l)}}),{min:t.finite(),max:e.finite()}}strokeTriangulate(t){const e=t?.indices??[],n=t?.vertices??[];return this.curves.forEach(i=>{i.strokeTriangulate({...t,indices:e,vertices:n,style:{...this.style}})}),{indices:e,vertices:n}}fillTriangulate(t){const e={...t,style:{...this.style,...t?.style}},n=e.indices??[],i=e.vertices??[];if((e.style.fillRule??"nonzero")==="nonzero"){const o=this.curves.map(c=>c.getFillVertices(e)),a=Wo(o),l=a.length;for(let c=0;c<l;c++){const h=a[c],u=o[c];if(h.winding||!u.length)continue;const p=u.slice(),d=[];for(let f=0;f<l;f++){const y=a[f];y.parentIndex===c&&(d.push(p.length/2),p.push(...o[y.index]))}ei(p,{...t,indices:n,vertices:i,holes:d,style:{...this.style}})}}else this.curves.forEach(o=>{o.fillTriangulate({...t,indices:n,vertices:i,style:{...this.style}})});return{indices:n,vertices:i}}getBoundingBox(t=!0){const{min:e,max:n}=this.getMinMax(void 0,void 0,t);return new H(e.x,e.y,n.x-e.x,n.y-e.y)}drawTo(t,e={}){e={...this.style,...e};const{fill:n="#000",stroke:i="none"}=e;return t.beginPath(),t.save(),Fn(t,e),this.curves.forEach(s=>{s.drawTo(t)}),n!=="none"&&t.fill(),i!=="none"&&t.stroke(),t.restore(),this}drawControlPointsTo(t,e={}){e={...this.style,...e};const{fill:n="#000",stroke:i="none"}=e;return t.beginPath(),t.save(),Fn(t,e),this.getControlPointRefs().forEach(s=>{ho(t,s.x,s.y,{radius:4})}),n!=="none"&&t.fill(),i!=="none"&&t.stroke(),t.restore(),this}toCommands(){return this.curves.flatMap(t=>t.toCommands())}toData(){return this.curves.filter(t=>t.curves.length).map(t=>t.toData()).join(" ")}toSvgPathString(){const t={...this.style,fill:this.style.fill??"#000",stroke:this.style.stroke??"none"},e={};for(const i in t)t[i]!==void 0&&(e[Vo(i)]=t[i]);Object.assign(e,{"stroke-width":`${this.strokeWidth}px`});let n="";for(const i in e)e[i]!==void 0&&(n+=`${i}:${e[i]};`);return`<path d="${this.toData()}" style="${n}"></path>`}copy(t){return super.copy(t),this.currentCurve=t.currentCurve.clone(),this.style={...t.style},this}}class ee{constructor(t=[],e){this.paths=t,this.viewBox=e}getBoundingBox(t=!0){if(!this.paths.length)return;const e=k.MAX,n=k.MIN;return this.paths.forEach(i=>i.getMinMax(e,n,t)),new H(e.x,e.y,n.x-e.x,n.y-e.y)}toTriangulatedSvgString(t=this.paths.map(n=>n.fillTriangulate()),e=0){let n="",i="";const s={x:-e,y:-e},o={x:e,y:e};(Array.isArray(t)?t:[t]).forEach(({vertices:h,indices:u,points:p=[]})=>{const d=f=>{const y=h[f*2],g=h[f*2+1];return s.x=Math.min(s.x,y+e),o.x=Math.max(o.x,y+e),s.y=Math.min(s.y,g+e),o.y=Math.max(o.y,g+e),[y,g]};for(let f=0,y=u.length;f<y;f+=3){const g=d(u[f]),M=d(u[f+1]),P=d(u[f+2]);n+=`<polygon
4
4
  points="${g.join(",")} ${M.join(",")} ${P.join(",")}"
5
5
  stroke="#28a745"
6
6
  stroke-width="#stroke-width"
@@ -27,9 +27,9 @@ ${t}`);return e.documentElement}else return r}const yo="px",mo=90,Xr=["mm","cm",
27
27
  xmlns="http://www.w3.org/2000/svg"
28
28
  >
29
29
  ${s}
30
- </svg>`}toSvgUrl(){return`data:image/svg+xml;base64,${btoa(this.toSvgString())}`}toSvg(){return new DOMParser().parseFromString(this.toSvgString(),"image/svg+xml").documentElement}toCanvas(t={}){const{pixelRatio:e=2,...n}=t,{left:i,top:s,width:o,height:a}=this.getBoundingBox(),l=document.createElement("canvas");l.width=o*e,l.height=a*e,l.style.width=`${o}px`,l.style.height=`${a}px`;const c=l.getContext("2d");return c&&(c.scale(e,e),c.translate(-i,-s),this.paths.forEach(h=>{h.drawTo(c,n)})),l}}class ui{constructor(t,e){this.text=t,this.context=e}pixelRatio=window?.devicePixelRatio||1;_setupView=()=>{const t=this.pixelRatio,e=this.context,{left:n,top:i,width:s,height:o}=this.text.boundingBox,a=e.canvas;a.dataset.viewBox=`${n} ${i} ${s} ${o}`,a.dataset.pixelRatio=String(t);const l=s,c=o;a.width=Math.max(1,Math.ceil(l*t)),a.height=Math.max(1,Math.ceil(c*t)),a.style.width=`${l}px`,a.style.height=`${c}px`,e.clearRect(0,0,a.width,a.height),e.scale(t,t),e.translate(-n,-i)};_setupColors=()=>{const{paragraphs:t,computedStyle:e,glyphBox:n}=this.text;this.uploadColor(e,n),t.forEach(i=>{this.uploadColor(i.computedStyle,i.lineBox),i.fragments.forEach(s=>{this.uploadColor(s.computedStyle,s.inlineBox)})})};setup=()=>(this._setupView(),this._setupColors(),this);_parseColor=(t,e)=>{if(typeof t=="string"&&_e(t)){const n=Or(t)[0];if(n)switch(n.type){case"linear-gradient":{let i=0;if(n.orientation)switch(n.orientation.type){case"angular":i=Number(n.orientation.value);break}const{left:s,top:o,width:a,height:l}=e,c=i*Math.PI/180,h=a*Math.sin(c),u=l*Math.cos(c),p=this.context.createLinearGradient(s+a/2-h,o+l/2+u,s+a/2+h,o+l/2-u);return n.colorStops.forEach(d=>{let f=0;if(d.length)switch(d.length.type){case"%":f=Number(d.length.value)/100;break}switch(d.type){case"rgb":p.addColorStop(f,`rgb(${d.value.join(", ")})`);break;case"rgba":p.addColorStop(f,`rgba(${d.value.join(", ")})`);break;case"hex":p.addColorStop(f,`#${d.value}`);break}}),p}}}return t};_uploadedStyles=["color","backgroundColor","textStrokeColor"];uploadColor=(t,e)=>{this._uploadedStyles.forEach(n=>{t[n]=this._parseColor(t[n],e)})};drawPath=(t,e={})=>{const{clipRect:n}=e,i=this.context;i.save(),i.beginPath(),n&&(i.rect(n.left,n.top,n.width,n.height),i.clip(),i.beginPath()),t.drawTo(i,this._mergePathStyle(t,e)),i.restore()};_mergePathStyle(t,e){const{fontSize:n=this.text.computedStyle.fontSize}=e,i=t.style,s=e.stroke??i.stroke,o=e.strokeWidth?e.strokeWidth*n:i.strokeWidth;return{...i,...e,fill:e.fill??i.fill,stroke:o===void 0||o>0?s:void 0,strokeLinecap:e.strokeLinecap??i.strokeLinecap??"round",strokeLinejoin:e.strokeLinejoin??i.strokeLinejoin??"round",strokeWidth:o,shadowOffsetX:(e.shadowOffsetX??0)*n,shadowOffsetY:(e.shadowOffsetY??0)*n,shadowBlur:(e.shadowBlur??0)*n,shadowColor:e.shadowColor}}drawCharacter=(t,e={})=>{const n=this.context,{computedStyle:i,path:s,glyphBox:o,isVertical:a,content:l,inlineBox:c,baseline:h,computedFill:u,computedOutline:p}=t,d={...i,...e},f={strokeLinecap:p?.lineCap,strokeLinejoin:p?.lineJoin,...d,fill:e.color??u?.color??i.color,strokeWidth:e.textStrokeWidth??p?.width??i.textStrokeWidth,stroke:e.textStrokeColor??p?.color??i.textStrokeColor};o?this.drawPath(s,f):(n.save(),n.beginPath(),Fn(n,this._mergePathStyle(s,f)),n.font=`${d.fontSize}px ${d.fontFamily}`,a?(n.textBaseline="middle",n.fillText(l,c.left,c.top+c.height/2)):(n.textBaseline="alphabetic",n.fillText(l,c.left,c.top+h)),n.restore())}}var ut=Uint8Array,At=Uint16Array,jn=Int32Array,ln=new ut([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]),cn=new ut([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]),Gn=new ut([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),fi=function(r,t){for(var e=new At(31),n=0;n<31;++n)e[n]=t+=1<<r[n-1];for(var i=new jn(e[30]),n=1;n<30;++n)for(var s=e[n];s<e[n+1];++s)i[s]=s-e[n]<<5|n;return{b:e,r:i}},pi=fi(ln,2),di=pi.b,qn=pi.r;di[28]=258,qn[258]=28;for(var gi=fi(cn,0),ha=gi.b,yi=gi.r,Wn=new At(32768),K=0;K<32768;++K){var ne=(K&43690)>>1|(K&21845)<<1;ne=(ne&52428)>>2|(ne&13107)<<2,ne=(ne&61680)>>4|(ne&3855)<<4,Wn[K]=((ne&65280)>>8|(ne&255)<<8)>>1}for(var Wt=(function(r,t,e){for(var n=r.length,i=0,s=new At(t);i<n;++i)r[i]&&++s[r[i]-1];var o=new At(t);for(i=1;i<t;++i)o[i]=o[i-1]+s[i-1]<<1;var a;if(e){a=new At(1<<t);var l=15-t;for(i=0;i<n;++i)if(r[i])for(var c=i<<4|r[i],h=t-r[i],u=o[r[i]-1]++<<h,p=u|(1<<h)-1;u<=p;++u)a[Wn[u]>>l]=c}else for(a=new At(n),i=0;i<n;++i)r[i]&&(a[i]=Wn[o[r[i]-1]++]>>15-r[i]);return a}),re=new ut(288),K=0;K<144;++K)re[K]=8;for(var K=144;K<256;++K)re[K]=9;for(var K=256;K<280;++K)re[K]=7;for(var K=280;K<288;++K)re[K]=8;for(var Be=new ut(32),K=0;K<32;++K)Be[K]=5;var ua=Wt(re,9,0),fa=Wt(re,9,1),pa=Wt(Be,5,0),da=Wt(Be,5,1),Hn=function(r){for(var t=r[0],e=1;e<r.length;++e)r[e]>t&&(t=r[e]);return t},Lt=function(r,t,e){var n=t/8|0;return(r[n]|r[n+1]<<8)>>(t&7)&e},Xn=function(r,t){var e=t/8|0;return(r[e]|r[e+1]<<8|r[e+2]<<16)>>(t&7)},Yn=function(r){return(r+7)/8|0},mi=function(r,t,e){return(e==null||e>r.length)&&(e=r.length),new ut(r.subarray(t,e))},ga=["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"],$t=function(r,t,e){var n=new Error(t||ga[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,$t),!e)throw n;return n},ya=function(r,t,e,n){var i=r.length,s=0;if(!i||t.f&&!t.l)return e||new ut(0);var o=!e,a=o||t.i!=2,l=t.i;o&&(e=new ut(i*3));var c=function(Mt){var Tt=e.length;if(Mt>Tt){var ht=new ut(Math.max(Tt*2,Mt));ht.set(e),e=ht}},h=t.f||0,u=t.p||0,p=t.b||0,d=t.l,f=t.d,y=t.m,g=t.n,M=i*8;do{if(!d){h=Lt(r,u,1);var P=Lt(r,u+1,3);if(u+=3,P)if(P==1)d=fa,f=da,y=9,g=5;else if(P==2){var v=Lt(r,u,31)+257,S=Lt(r,u+10,15)+4,b=v+Lt(r,u+5,31)+1;u+=14;for(var D=new ut(b),z=new ut(19),E=0;E<S;++E)z[Gn[E]]=Lt(r,u+E*3,7);u+=S*3;for(var F=Hn(z),N=(1<<F)-1,B=Wt(z,F,1),E=0;E<b;){var A=B[Lt(r,u,N)];u+=A&15;var x=A>>4;if(x<16)D[E++]=x;else{var W=0,O=0;for(x==16?(O=3+Lt(r,u,3),u+=2,W=D[E-1]):x==17?(O=3+Lt(r,u,7),u+=3):x==18&&(O=11+Lt(r,u,127),u+=7);O--;)D[E++]=W}}var L=D.subarray(0,v),V=D.subarray(v);y=Hn(L),g=Hn(V),d=Wt(L,y,1),f=Wt(V,g,1)}else $t(1);else{var x=Yn(u)+4,C=r[x-4]|r[x-3]<<8,w=x+C;if(w>i){l&&$t(0);break}a&&c(p+C),e.set(r.subarray(x,w),p),t.b=p+=C,t.p=u=w*8,t.f=h;continue}if(u>M){l&&$t(0);break}}a&&c(p+131072);for(var I=(1<<y)-1,R=(1<<g)-1,T=u;;T=u){var W=d[Xn(r,u)&I],_=W>>4;if(u+=W&15,u>M){l&&$t(0);break}if(W||$t(2),_<256)e[p++]=_;else if(_==256){T=u,d=null;break}else{var U=_-254;if(_>264){var E=_-257,$=ln[E];U=Lt(r,u,(1<<$)-1)+di[E],u+=$}var q=f[Xn(r,u)&R],X=q>>4;q||$t(3),u+=q&15;var V=ha[X];if(X>3){var $=cn[X];V+=Xn(r,u)&(1<<$)-1,u+=$}if(u>M){l&&$t(0);break}a&&c(p+131072);var nt=p+U;if(p<V){var Yt=s-V,Dt=Math.min(V,nt);for(Yt+p<0&&$t(3);p<Dt;++p)e[p]=n[Yt+p]}for(;p<nt;++p)e[p]=e[p-V]}}t.l=d,t.p=T,t.b=p,t.f=h,d&&(h=1,t.m=y,t.d=f,t.n=g)}while(!h);return p!=e.length&&o?mi(e,0,p):e.subarray(0,p)},Qt=function(r,t,e){e<<=t&7;var n=t/8|0;r[n]|=e,r[n+1]|=e>>8},De=function(r,t,e){e<<=t&7;var n=t/8|0;r[n]|=e,r[n+1]|=e>>8,r[n+2]|=e>>16},Zn=function(r,t){for(var e=[],n=0;n<r.length;++n)r[n]&&e.push({s:n,f:r[n]});var i=e.length,s=e.slice();if(!i)return{t:bi,l:0};if(i==1){var o=new ut(e[0].s+1);return o[e[0].s]=1,{t:o,l:1}}e.sort(function(w,v){return w.f-v.f}),e.push({s:-1,f:25001});var a=e[0],l=e[1],c=0,h=1,u=2;for(e[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=i-1;)a=e[e[c].f<e[u].f?c++:u++],l=e[c!=h&&e[c].f<e[u].f?c++:u++],e[h++]={s:-1,f:a.f+l.f,l:a,r:l};for(var p=s[0].s,n=1;n<i;++n)s[n].s>p&&(p=s[n].s);var d=new At(p+1),f=Kn(e[h-1],d,0);if(f>t){var n=0,y=0,g=f-t,M=1<<g;for(s.sort(function(v,S){return d[S.s]-d[v.s]||v.f-S.f});n<i;++n){var P=s[n].s;if(d[P]>t)y+=M-(1<<f-d[P]),d[P]=t;else break}for(y>>=g;y>0;){var x=s[n].s;d[x]<t?y-=1<<t-d[x]++-1:++n}for(;n>=0&&y;--n){var C=s[n].s;d[C]==t&&(--d[C],++y)}f=t}return{t:new ut(d),l:f}},Kn=function(r,t,e){return r.s==-1?Math.max(Kn(r.l,t,e+1),Kn(r.r,t,e+1)):t[r.s]=e},xi=function(r){for(var t=r.length;t&&!r[--t];);for(var e=new At(++t),n=0,i=r[0],s=1,o=function(l){e[n++]=l},a=1;a<=t;++a)if(r[a]==i&&a!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=r[a]}return{c:e.subarray(0,n),n:t}},Fe=function(r,t){for(var e=0,n=0;n<t.length;++n)e+=r[n]*t[n];return e},vi=function(r,t,e){var n=e.length,i=Yn(t+2);r[i]=n&255,r[i+1]=n>>8,r[i+2]=r[i]^255,r[i+3]=r[i+1]^255;for(var s=0;s<n;++s)r[i+s+4]=e[s];return(i+4+n)*8},wi=function(r,t,e,n,i,s,o,a,l,c,h){Qt(t,h++,e),++i[256];for(var u=Zn(i,15),p=u.t,d=u.l,f=Zn(s,15),y=f.t,g=f.l,M=xi(p),P=M.c,x=M.n,C=xi(y),w=C.c,v=C.n,S=new At(19),b=0;b<P.length;++b)++S[P[b]&31];for(var b=0;b<w.length;++b)++S[w[b]&31];for(var D=Zn(S,7),z=D.t,E=D.l,F=19;F>4&&!z[Gn[F-1]];--F);var N=c+5<<3,B=Fe(i,re)+Fe(s,Be)+o,A=Fe(i,p)+Fe(s,y)+o+14+3*F+Fe(S,z)+2*S[16]+3*S[17]+7*S[18];if(l>=0&&N<=B&&N<=A)return vi(t,h,r.subarray(l,l+c));var W,O,L,V;if(Qt(t,h,1+(A<B)),h+=2,A<B){W=Wt(p,d,0),O=p,L=Wt(y,g,0),V=y;var I=Wt(z,E,0);Qt(t,h,x-257),Qt(t,h+5,v-1),Qt(t,h+10,F-4),h+=14;for(var b=0;b<F;++b)Qt(t,h+3*b,z[Gn[b]]);h+=3*F;for(var R=[P,w],T=0;T<2;++T)for(var _=R[T],b=0;b<_.length;++b){var U=_[b]&31;Qt(t,h,I[U]),h+=z[U],U>15&&(Qt(t,h,_[b]>>5&127),h+=_[b]>>12)}}else W=ua,O=re,L=pa,V=Be;for(var b=0;b<a;++b){var $=n[b];if($>255){var U=$>>18&31;De(t,h,W[U+257]),h+=O[U+257],U>7&&(Qt(t,h,$>>23&31),h+=ln[U]);var q=$&31;De(t,h,L[q]),h+=V[q],q>3&&(De(t,h,$>>5&8191),h+=cn[q])}else De(t,h,W[$]),h+=O[$]}return De(t,h,W[256]),h+O[256]},ma=new jn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),bi=new ut(0),xa=function(r,t,e,n,i,s){var o=s.z||r.length,a=new ut(n+o+5*(1+Math.ceil(o/7e3))+i),l=a.subarray(n,a.length-i),c=s.l,h=(s.r||0)&7;if(t){h&&(l[0]=s.r>>3);for(var u=ma[t-1],p=u>>13,d=u&8191,f=(1<<e)-1,y=s.p||new At(32768),g=s.h||new At(f+1),M=Math.ceil(e/3),P=2*M,x=function(kt){return(r[kt]^r[kt+1]<<M^r[kt+2]<<P)&f},C=new jn(25e3),w=new At(288),v=new At(32),S=0,b=0,D=s.i||0,z=0,E=s.w||0,F=0;D+2<o;++D){var N=x(D),B=D&32767,A=g[N];if(y[B]=A,g[N]=B,E<=D){var W=o-D;if((S>7e3||z>24576)&&(W>423||!c)){h=wi(r,l,0,C,w,v,b,z,F,D-F,h),z=S=b=0,F=D;for(var O=0;O<286;++O)w[O]=0;for(var O=0;O<30;++O)v[O]=0}var L=2,V=0,I=d,R=B-A&32767;if(W>2&&N==x(D-R))for(var T=Math.min(p,W)-1,_=Math.min(32767,D),U=Math.min(258,W);R<=_&&--I&&B!=A;){if(r[D+L]==r[D+L-R]){for(var $=0;$<U&&r[D+$]==r[D+$-R];++$);if($>L){if(L=$,V=R,$>T)break;for(var q=Math.min(R,$-2),X=0,O=0;O<q;++O){var nt=D-R+O&32767,Yt=y[nt],Dt=nt-Yt&32767;Dt>X&&(X=Dt,A=nt)}}}B=A,A=y[B],R+=B-A&32767}if(V){C[z++]=268435456|qn[L]<<18|yi[V];var Mt=qn[L]&31,Tt=yi[V]&31;b+=ln[Mt]+cn[Tt],++w[257+Mt],++v[Tt],E=D+L,++S}else C[z++]=r[D],++w[r[D]]}}for(D=Math.max(D,E);D<o;++D)C[z++]=r[D],++w[r[D]];h=wi(r,l,c,C,w,v,b,z,F,D-F,h),c||(s.r=h&7|l[h/8|0]<<3,h-=7,s.h=g,s.p=y,s.i=D,s.w=E)}else{for(var D=s.w||0;D<o+c;D+=65535){var ht=D+65535;ht>=o&&(l[h/8|0]=c,ht=o),h=vi(l,h+1,r.subarray(D,ht))}s.i=o}return mi(a,0,n+Yn(h)+i)},Si=function(){var r=1,t=0;return{p:function(e){for(var n=r,i=t,s=e.length|0,o=0;o!=s;){for(var a=Math.min(o+2655,s);o<a;++o)i+=n+=e[o];n=(n&65535)+15*(n>>16),i=(i&65535)+15*(i>>16)}r=n,t=i},d:function(){return r%=65521,t%=65521,(r&255)<<24|(r&65280)<<8|(t&255)<<8|t>>8}}},va=function(r,t,e,n,i){if(!i&&(i={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),o=new ut(s.length+r.length);o.set(s),o.set(r,s.length),r=o,i.w=s.length}return xa(r,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+t.mem,e,n,i)},Ci=function(r,t,e){for(;e;++t)r[t]=e,e>>>=8},wa=function(r,t){var e=t.level,n=e==0?0:e<6?1:e==9?3:2;if(r[0]=120,r[1]=n<<6|(t.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,t.dictionary){var i=Si();i.p(t.dictionary),Ci(r,2,i.d())}},ba=function(r,t){return((r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31)&&$t(6,"invalid zlib data"),(r[1]>>5&1)==1&&$t(6,"invalid zlib data: "+(r[1]&32?"need":"unexpected")+" dictionary"),(r[1]>>3&4)+2};function Sa(r,t){t||(t={});var e=Si();e.p(r);var n=va(r,t,t.dictionary?6:2,4);return wa(n,t),Ci(n,n.length-4,e.d()),n}function Ca(r,t){return ya(r.subarray(ba(r),-4),{i:2},t,t)}var Ma=typeof TextDecoder<"u"&&new TextDecoder,Pa=0;try{Ma.decode(bi,{stream:!0}),Pa=1}catch{}const _a="modern-font";function Ue(r,t){if(!r)throw new Error(`[${_a}] ${t}`)}function Ta(r){if("buffer"in r){const t=r.buffer;return r.byteOffset>0||r.byteLength<r.buffer.byteLength?t.slice(r.byteOffset,r.byteOffset+r.byteLength):t}else return r}function xe(r){return"buffer"in r?new DataView(r.buffer,r.byteOffset,r.byteLength):new DataView(r)}function ka(r){let t="";for(let e=0,n=r.length,i;e<n;e++)i=r.charCodeAt(e),i!==0&&(t+=String.fromCharCode(i));return t}function hn(r){r=ka(r);const t=[];for(let e=0,n=r.length,i;e<n;e++)i=r.charCodeAt(e),t.push(i>>8),t.push(i&255);return t}function Aa(r){let t="";for(let e=0,n=r.length;e<n;e++)r[e]<127?t+=String.fromCharCode(r[e]):t+=`%${(256+r[e]).toString(16).slice(1)}`;return unescape(t)}function Oa(r){let t="";for(let e=0,n=r.length;e<n;e+=2)t+=String.fromCharCode((r[e]<<8)+r[e+1]);return t}var Ia=Object.defineProperty,ft=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Ia(t,e,i),i};const un={int8:1,int16:2,int32:4,uint8:1,uint16:2,uint32:4,float32:4,float64:8,fixed:4,longDateTime:8,char:1};function pt(){return function(r,t){Object.defineProperty(r.constructor.prototype,t,{get(){if(typeof t=="string"){if(t.startsWith("read"))return(...e)=>this.read(t.substring(4).toLowerCase(),...e);if(t.startsWith("write"))return(...e)=>this.write(t.substring(5).toLowerCase(),...e)}},configurable:!0,enumerable:!0})}}class lt extends DataView{constructor(t,e,n,i){super(Ta(t),e,n),this.littleEndian=i}cursor=0;readColumn(t){if(t.size){const e=Array.from({length:t.size},(n,i)=>this.read(t.type,t.offset+i));switch(t.type){case"char":return e.join("");default:return e}}else return this.read(t.type,t.offset)}writeColumn(t,e){t.size?Array.from({length:t.size},(n,i)=>{this.write(t.type,e[i],t.offset+i)}):this.write(t.type,e,t.offset)}read(t,e=this.cursor,n=this.littleEndian){switch(t){case"char":return this.readChar(e);case"fixed":return this.readFixed(e,n);case"longDateTime":return this.readLongDateTime(e,n)}const i=`get${t.replace(/^\S/,l=>l.toUpperCase())}`,s=this,a=s[i]?.bind(s)?.(e,n);return this.cursor+=un[t],a}readUint24(t=this.cursor){const[e,n,i]=this.readBytes(t,3);return(e<<16)+(n<<8)+i}readBytes(t,e){e==null&&(e=t,t=this.cursor);const n=[];for(let i=0;i<e;++i)n.push(this.getUint8(t+i));return this.cursor=t+e,n}readString(t,e){const n=this.readBytes(t,e);let i="";for(let s=0,o=n.length;s<o;s++)i+=String.fromCharCode(n[s]);return i}readFixed(t,e){const n=this.readInt32(t,e)/65536;return Math.ceil(n*1e5)/1e5}readLongDateTime(t=this.cursor,e){const n=this.readUint32(t+4,e),i=new Date;return i.setTime(n*1e3+-20775456e5),i}readChar(t){return this.readString(t,1)}write(t,e,n=this.cursor,i=this.littleEndian){switch(t){case"char":return this.writeChar(e,n);case"fixed":return this.writeFixed(e,n);case"longDateTime":return this.writeLongDateTime(e,n)}const s=`set${t.replace(/^\S/,c=>c.toUpperCase())}`,o=this,l=o[s]?.bind(o)?.(n,e,i);return this.cursor+=un[t.toLowerCase()],l}writeString(t="",e=this.cursor){const n=t.replace(/[^\x00-\xFF]/g,"11").length;this.seek(e);for(let i=0,s=t.length,o;i<s;++i)o=t.charCodeAt(i)||0,o>127?this.writeUint16(o):this.writeUint8(o);return this.cursor+=n,this}writeChar(t,e){return this.writeString(t,e)}writeFixed(t,e){return this.writeInt32(Math.round(t*65536),e),this}writeLongDateTime(t,e=this.cursor){typeof t>"u"?t=-20775456e5:typeof t.getTime=="function"?t=t.getTime():/^\d+$/.test(t)?t=+t:t=Date.parse(t);const i=Math.round((t- -20775456e5)/1e3);return this.writeUint32(0,e),this.writeUint32(i,e+4),this}writeBytes(t,e=this.cursor){let n;if(Array.isArray(t)){n=t.length;for(let i=0;i<n;++i)this.setUint8(e+i,t[i])}else{const i=xe(t);n=i.byteLength;for(let s=0;s<n;++s)this.setUint8(e+s,i.getUint8(s))}return this.cursor=e+n,this}seek(t){return this.cursor=t,this}}ft([pt()],lt.prototype,"readInt8"),ft([pt()],lt.prototype,"readInt16"),ft([pt()],lt.prototype,"readInt32"),ft([pt()],lt.prototype,"readUint8"),ft([pt()],lt.prototype,"readUint16"),ft([pt()],lt.prototype,"readUint32"),ft([pt()],lt.prototype,"readFloat32"),ft([pt()],lt.prototype,"readFloat64"),ft([pt()],lt.prototype,"writeInt8"),ft([pt()],lt.prototype,"writeInt16"),ft([pt()],lt.prototype,"writeInt32"),ft([pt()],lt.prototype,"writeUint8"),ft([pt()],lt.prototype,"writeUint16"),ft([pt()],lt.prototype,"writeUint32"),ft([pt()],lt.prototype,"writeFloat32"),ft([pt()],lt.prototype,"writeFloat64");const Mi=new WeakMap;function m(r){const t=typeof r=="object"?r:{type:r},{size:e=1,type:n}=t;return(i,s)=>{if(typeof s!="string")return;let o=Mi.get(i);o||(o={columns:[],byteLength:0},Mi.set(i,o));const a={...t,name:s,byteLength:e*un[n],offset:t.offset??o.columns.reduce((l,c)=>l+c.byteLength,0)};o.columns.push(a),o.byteLength=o.columns.reduce((l,c)=>l+un[c.type]*(c.size??1),0),Object.defineProperty(i.constructor.prototype,s,{get(){return this.view.readColumn(a)},set(l){this.view.writeColumn(a,l)},configurable:!0,enumerable:!0})}}class Bt{view;constructor(t,e,n,i){this.view=new lt(t,e,n,i)}}class Qn extends Bt{get buffer(){return this.view.buffer}toBuffer(){return this.view.buffer.slice(this.view.byteOffset,this.view.byteOffset+this.view.byteLength)}toBlob(){return new Blob([new Uint8Array(this.view.buffer,this.view.byteOffset,this.view.byteLength)],{type:this.mimeType})}toFontFace(t){return new FontFace(t,this.view.buffer)}}var Ea=Object.defineProperty,wt=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Ea(t,e,i),i};const bt=class Ki extends Qn{format="EmbeddedOpenType";mimeType="application/vnd.ms-fontobject";static from(t){const e=t.sfnt,i=e.name.names,s=hn(i.fontFamily||""),o=s.length,a=hn(i.fontStyle||""),l=a.length,c=hn(i.version||""),h=c.length,u=hn(i.fullName||""),p=u.length,d=86+o+4+l+4+h+4+p+2+t.view.byteLength,f=new Ki(new ArrayBuffer(d),0,d,!0);f.EOTSize=f.view.byteLength,f.FontDataSize=t.view.byteLength,f.Version=131073,f.Flags=0,f.Charset=1,f.MagicNumber=20556,f.Padding1=0,f.CheckSumAdjustment=e.head.checkSumAdjustment;const y=e.os2;return y&&(f.FontPANOSE=y.fontPANOSE,f.Italic=y.fsSelection,f.Weight=y.usWeightClass,f.fsType=y.fsType,f.UnicodeRange=y.ulUnicodeRange,f.CodePageRange=y.ulCodePageRange),f.view.writeUint16(o),f.view.writeBytes(s),f.view.writeUint16(0),f.view.writeUint16(l),f.view.writeBytes(a),f.view.writeUint16(0),f.view.writeUint16(h),f.view.writeBytes(c),f.view.writeUint16(0),f.view.writeUint16(p),f.view.writeBytes(u),f.view.writeUint16(0),f.view.writeUint16(0),f.view.writeBytes(t.view),f}};wt([m("uint32")],bt.prototype,"EOTSize"),wt([m("uint32")],bt.prototype,"FontDataSize"),wt([m("uint32")],bt.prototype,"Version"),wt([m("uint32")],bt.prototype,"Flags"),wt([m({type:"uint8",size:10})],bt.prototype,"FontPANOSE"),wt([m("uint8")],bt.prototype,"Charset"),wt([m("uint8")],bt.prototype,"Italic"),wt([m("uint32")],bt.prototype,"Weight"),wt([m("uint16")],bt.prototype,"fsType"),wt([m("uint16")],bt.prototype,"MagicNumber"),wt([m({type:"uint8",size:16})],bt.prototype,"UnicodeRange"),wt([m({type:"uint8",size:8})],bt.prototype,"CodePageRange"),wt([m("uint32")],bt.prototype,"CheckSumAdjustment"),wt([m({type:"uint8",size:16})],bt.prototype,"Reserved"),wt([m("uint16")],bt.prototype,"Padding1");var Ba=Object.defineProperty,fn=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Ba(t,e,i),i};class Le extends Bt{constructor(t,e){super(t,e,16)}}fn([m({type:"char",size:4})],Le.prototype,"tag"),fn([m("uint32")],Le.prototype,"checkSum"),fn([m("uint32")],Le.prototype,"offset"),fn([m("uint32")],Le.prototype,"length");const Jn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],Da=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"];class Pi{index;name;isComposite=!1;components=[];pathCommands=[];constructor(t){const e={...t};if(this.index=e.index??0,e.name===".notdef"?e.unicode=void 0:e.name===".null"&&(e.unicode=0),e.unicode===0&&e.name!==".null")throw new Error('The unicode value "0" is reserved for the glyph name ".null" and cannot be used by any other glyph.');this.name=e.name??null,e.unicode&&(this.unicode=e.unicode),e.unicodes?this.unicodes=e.unicodes:e.unicode&&(this.unicodes=[e.unicode])}getPathCommands(t=0,e=0,n=72,i={},s){const o=1/(s?.unitsPerEm??1e3)*n,{xScale:a=o,yScale:l=o}=i,c=this.pathCommands,h=[];for(let u=0,p=c.length;u<p;u+=1){const d=c[u];d.type==="M"?h.push({type:"M",x:t+d.x*a,y:e+-d.y*l}):d.type==="L"?h.push({type:"L",x:t+d.x*a,y:e+-d.y*l}):d.type==="Q"?h.push({type:"Q",x1:t+d.x1*a,y1:e+-d.y1*l,x:t+d.x*a,y:e+-d.y*l}):d.type==="C"?h.push({type:"C",x1:t+d.x1*a,y1:e+-d.y1*l,x2:t+d.x2*a,y2:e+-d.y2*l,x:t+d.x*a,y:e+-d.y*l}):d.type==="Z"&&h.push({type:"Z"})}return h}}class Fa extends Pi{parse(t,e,n){const i=this,{nominalWidthX:s,defaultWidthX:o,gsubrsBias:a,subrsBias:l}=t,c=t.topDict.paintType,h=this.index;let u,p,d,f;const y=[],g=[];let M=0,P=!1,x=!1,C=o,w=0,v=0;function S(B,A){y.push({type:"L",x:B,y:A})}function b(B,A,W,O,L,V){y.push({type:"C",x1:B,y1:A,x2:W,y2:O,x:L,y:V})}function D(B,A){x&&c!==2&&z(),x=!0,y.push({type:"M",x:B,y:A})}function z(){y.push({type:"Z"})}function E(B){y.push(...B)}function F(){g.length%2!==0&&!P&&(C=g.shift()+s),M+=g.length>>1,g.length=0,P=!0}function N(B){let A,W,O,L,V,I,R,T,_,U,$,q,X=0;for(;X<B.length;){let nt=B[X++];switch(nt){case 1:F();break;case 3:F();break;case 4:g.length>1&&!P&&(C=g.shift()+s,P=!0),v+=g.pop(),D(w,v);break;case 5:for(;g.length>0;)w+=g.shift(),v+=g.shift(),S(w,v);break;case 6:for(;g.length>0&&(w+=g.shift(),S(w,v),g.length!==0);)v+=g.shift(),S(w,v);break;case 7:for(;g.length>0&&(v+=g.shift(),S(w,v),g.length!==0);)w+=g.shift(),S(w,v);break;case 8:for(;g.length>0;)u=w+g.shift(),p=v+g.shift(),d=u+g.shift(),f=p+g.shift(),w=d+g.shift(),v=f+g.shift(),b(u,p,d,f,w,v);break;case 10:V=g.pop()+l,I=t.subrs[V],I&&N(I);break;case 11:return;case 12:switch(nt=B[X],X+=1,nt){case 35:u=w+g.shift(),p=v+g.shift(),d=u+g.shift(),f=p+g.shift(),R=d+g.shift(),T=f+g.shift(),_=R+g.shift(),U=T+g.shift(),$=_+g.shift(),q=U+g.shift(),w=$+g.shift(),v=q+g.shift(),g.shift(),b(u,p,d,f,R,T),b(_,U,$,q,w,v);break;case 34:u=w+g.shift(),p=v,d=u+g.shift(),f=p+g.shift(),R=d+g.shift(),T=f,_=R+g.shift(),U=f,$=_+g.shift(),q=v,w=$+g.shift(),b(u,p,d,f,R,T),b(_,U,$,q,w,v);break;case 36:u=w+g.shift(),p=v+g.shift(),d=u+g.shift(),f=p+g.shift(),R=d+g.shift(),T=f,_=R+g.shift(),U=f,$=_+g.shift(),q=U+g.shift(),w=$+g.shift(),b(u,p,d,f,R,T),b(_,U,$,q,w,v);break;case 37:u=w+g.shift(),p=v+g.shift(),d=u+g.shift(),f=p+g.shift(),R=d+g.shift(),T=f+g.shift(),_=R+g.shift(),U=T+g.shift(),$=_+g.shift(),q=U+g.shift(),Math.abs($-w)>Math.abs(q-v)?w=$+g.shift():v=q+g.shift(),b(u,p,d,f,R,T),b(_,U,$,q,w,v);break;default:console.warn(`Glyph ${h}: unknown operator ${1200+nt}`),g.length=0}break;case 14:if(g.length>=4){const Yt=Jn[g.pop()],Dt=Jn[g.pop()],Mt=g.pop(),Tt=g.pop();if(Yt&&Dt){i.isComposite=!0,i.components=[];const ht=t.charset.indexOf(Yt),kt=t.charset.indexOf(Dt);i.components.push({glyphIndex:kt,dx:0,dy:0}),i.components.push({glyphIndex:ht,dx:Tt,dy:Mt}),E(n.get(kt).pathCommands);const Rt=JSON.parse(JSON.stringify(n.get(ht).pathCommands));for(let Vt=0;Vt<Rt.length;Vt+=1){const Ft=Rt[Vt];Ft.type!=="Z"&&(Ft.x+=Tt,Ft.y+=Mt),(Ft.type==="Q"||Ft.type==="C")&&(Ft.x1+=Tt,Ft.y1+=Mt),Ft.type==="C"&&(Ft.x2+=Tt,Ft.y2+=Mt)}E(Rt)}}else g.length>0&&!P&&(C=g.shift()+s,P=!0);x&&c!==2&&(z(),x=!1);break;case 18:F();break;case 19:case 20:F(),X+=M+7>>3;break;case 21:g.length>2&&!P&&(C=g.shift()+s,P=!0),v+=g.pop(),w+=g.pop(),D(w,v);break;case 22:g.length>1&&!P&&(C=g.shift()+s,P=!0),w+=g.pop(),D(w,v);break;case 23:F();break;case 24:for(;g.length>2;)u=w+g.shift(),p=v+g.shift(),d=u+g.shift(),f=p+g.shift(),w=d+g.shift(),v=f+g.shift(),b(u,p,d,f,w,v);w+=g.shift(),v+=g.shift(),S(w,v);break;case 25:for(;g.length>6;)w+=g.shift(),v+=g.shift(),S(w,v);u=w+g.shift(),p=v+g.shift(),d=u+g.shift(),f=p+g.shift(),w=d+g.shift(),v=f+g.shift(),b(u,p,d,f,w,v);break;case 26:for(g.length%2&&(w+=g.shift());g.length>0;)u=w,p=v+g.shift(),d=u+g.shift(),f=p+g.shift(),w=d,v=f+g.shift(),b(u,p,d,f,w,v);break;case 27:for(g.length%2&&(v+=g.shift());g.length>0;)u=w+g.shift(),p=v,d=u+g.shift(),f=p+g.shift(),w=d+g.shift(),v=f,b(u,p,d,f,w,v);break;case 28:A=B[X],W=B[X+1],g.push((A<<24|W<<16)>>16),X+=2;break;case 29:V=g.pop()+a,I=t.gsubrs[V],I&&N(I);break;case 30:for(;g.length>0&&(u=w,p=v+g.shift(),d=u+g.shift(),f=p+g.shift(),w=d+g.shift(),v=f+(g.length===1?g.shift():0),b(u,p,d,f,w,v),g.length!==0);)u=w+g.shift(),p=v,d=u+g.shift(),f=p+g.shift(),v=f+g.shift(),w=d+(g.length===1?g.shift():0),b(u,p,d,f,w,v);break;case 31:for(;g.length>0&&(u=w+g.shift(),p=v,d=u+g.shift(),f=p+g.shift(),v=f+g.shift(),w=d+(g.length===1?g.shift():0),b(u,p,d,f,w,v),g.length!==0);)u=w,p=v+g.shift(),d=u+g.shift(),f=p+g.shift(),w=d+g.shift(),v=f+(g.length===1?g.shift():0),b(u,p,d,f,w,v);break;default:nt<32?console.warn(`Glyph ${h}: unknown operator ${nt}`):nt<247?g.push(nt-139):nt<251?(A=B[X],X+=1,g.push((nt-247)*256+A+108)):nt<255?(A=B[X],X+=1,g.push(-(nt-251)*256-A-108)):(A=B[X],W=B[X+1],O=B[X+2],L=B[X+3],X+=4,g.push((A<<24|W<<16|O<<8|L)/65536))}}}N(e),this.pathCommands=y,P&&(this.advanceWidth=C)}}class _i{constructor(t){this._sfnt=t}_items=[];get(t){const e=this._items[t];let n;if(e)n=e;else{n=this._get(t);const i=this._sfnt.hmtx.metrics[t];i&&(n.advanceWidth=n.advanceWidth||i.advanceWidth,n.leftSideBearing=n.leftSideBearing||i.leftSideBearing);const s=this._sfnt.cmap.glyphIndexToUnicodesMap.get(t);s&&(n.unicode??=s[0],n.unicodes??=s),this._items[t]=n}return n}}class Ua extends _i{get length(){return this._sfnt.cff.charStringsIndex.offsets.length-1}_get(t){const e=this._sfnt.cff,n=new Fa({index:t});return n.parse(e,e.charStringsIndex.get(t),this),n.name=e.charset[t],n}}var La=Object.defineProperty,Ti=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&La(t,e,i),i};class pn extends Bt{_offsets;get offsets(){return this._offsets??=this.readOffsets()}_objects;get objects(){return this._objects??=this.readObjects()}constructor(t,e,n,i){super(t,e,n,i),this._init()}_init(){const t=this.view,e=this.count,n=this.offsetSize;this.objectOffset=(e+1)*n+2,this.endOffset=t.byteOffset+this.objectOffset+this.offsets[e]}readOffsets(){const t=this.view,e=this.count,n=this.offsetSize;t.seek(3);const i=[];for(let s=0,o=e+1;s<o;s++){const a=this.view;let l=0;for(let c=0;c<n;c++)l<<=8,l+=a.readUint8();i.push(l)}return i}readObjects(){const t=[];for(let e=0,n=this.count;e<n;e++)t.push(this.get(e));return t}get(t){const e=this.offsets,n=this.objectOffset,i=n+e[t],o=n+e[t+1]-i;return this._isString?this.view.readString(i,o):this.view.readBytes(i,o)}}Ti([m("uint16")],pn.prototype,"count"),Ti([m("uint8")],pn.prototype,"offsetSize");class dn extends pn{_isString=!1}class ki extends pn{_isString=!0}const $a=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],Na=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron"],za=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],Ra=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"];function gn(r,t){return t<=390?$a[t]:r[t-391]}function Q(r,t="number",e){return(n,i)=>{if(typeof i!="string")return;const s={type:t,operator:r,default:e??t==="number"?0:void 0};Object.defineProperty(n.constructor.prototype,i,{get(){return this._getProp(s)},set(o){this._setProp(s,o)},configurable:!0,enumerable:!0})}}class Ai extends Bt{_dict;get dict(){return this._dict??=this._readDict()}_stringIndex;setStringIndex(t){return this._stringIndex=t,this}_readFloatOperand(){const t=this.view;let e="";const n=15,i=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];for(;;){const s=t.readUint8(),o=s>>4,a=s&15;if(o===n||(e+=i[o],a===n))break;e+=i[a]}return Number.parseFloat(e)}_readOperand(t){const e=this.view;let n,i,s,o;if(t===28)return n=e.readUint8(),i=e.readUint8(),n<<8|i;if(t===29)return n=e.readUint8(),i=e.readUint8(),s=e.readUint8(),o=e.readUint8(),n<<24|i<<16|s<<8|o;if(t===30)return this._readFloatOperand();if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return n=e.readUint8(),(t-247)*256+n+108;if(t>=251&&t<=254)return n=e.readUint8(),-(t-251)*256-n-108;throw new Error(`invalid b0 ${t}, at: ${e.cursor}`)}_readDict(){const t=this.view;t.seek(0);let e=[];const n=t.cursor+t.byteLength,i={};for(;t.cursor<n;){let s=t.readUint8();s<=21?(s===12&&(s=1200+t.readUint8()),i[s]=e,e=[]):e.push(this._readOperand(s))}return i}_getProp(t){const e=this.dict[t.operator]??t.default;switch(t.type){case"number":return e[0];case"string":return gn(this._stringIndex?.objects??[],e[0]);case"number[]":return e}return e}_setProp(t,e){}}var Va=Object.defineProperty,tr=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Va(t,e,i),i};class yn extends Ai{}tr([Q(19)],yn.prototype,"subrs"),tr([Q(20)],yn.prototype,"defaultWidthX"),tr([Q(21)],yn.prototype,"nominalWidthX");var ja=Object.defineProperty,it=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&ja(t,e,i),i};class et extends Ai{}it([Q(0,"string")],et.prototype,"version"),it([Q(1,"string")],et.prototype,"notice"),it([Q(1200,"string")],et.prototype,"copyright"),it([Q(2,"string")],et.prototype,"fullName"),it([Q(3,"string")],et.prototype,"familyName"),it([Q(4,"string")],et.prototype,"weight"),it([Q(1201)],et.prototype,"isFixedPitch"),it([Q(1202)],et.prototype,"italicAngle"),it([Q(1203,"number",-100)],et.prototype,"underlinePosition"),it([Q(1204,"number",50)],et.prototype,"underlineThickness"),it([Q(1205)],et.prototype,"paintType"),it([Q(1206,"number",2)],et.prototype,"charstringType"),it([Q(1207,"number[]",[.001,0,0,.001,0,0])],et.prototype,"fontMatrix"),it([Q(13)],et.prototype,"uniqueId"),it([Q(5,"number[]",[0,0,0,0])],et.prototype,"fontBBox"),it([Q(1208)],et.prototype,"strokeWidth"),it([Q(14)],et.prototype,"xuid"),it([Q(15)],et.prototype,"charset"),it([Q(16)],et.prototype,"encoding"),it([Q(17)],et.prototype,"charStrings"),it([Q(18,"number[]",[0,0])],et.prototype,"private");function dt(r,t=r){return e=>{Jt.tableDefinitions.set(r,{tag:r,prop:t,class:e}),Object.defineProperty(Jt.prototype,t,{get(){return this.get(r)},set(n){return this.set(r,n)},configurable:!0,enumerable:!0})}}class Jt{static tableDefinitions=new Map;tables=new Map;tableViews=new Map;get hasGlyf(){return this.tableViews.has("glyf")}get names(){return this.name.names}get unitsPerEm(){return this.head.unitsPerEm}get ascender(){return this.hhea.ascent}get descender(){return this.hhea.descent}get createdTimestamp(){return this.head.created}get modifiedTimestamp(){return this.head.modified}get numGlyphs(){return this.maxp.numGlyphs}get unicodes(){return this.cmap.glyphIndexToUnicodesMap}get glyphs(){return this.hasGlyf?this.glyf.glyphs:this.cff.glyphs}charToGlyphIndex(t){let e=this.cmap.unicodeToGlyphIndexMap.get(t.codePointAt(0));if(e===void 0&&!this.hasGlyf){const{encoding:n,charset:i}=this.cff;e=i.indexOf(n[t.codePointAt(0)])}return e??0}charToGlyph(t){return this.glyphs.get(this.charToGlyphIndex(t))}textToGlyphIndexes(t){const e=[];for(const n of t)e.push(this.charToGlyphIndex(n));return e}textToGlyphs(t){const e=this.glyphs,n=this.textToGlyphIndexes(t),i=n.length,s=Array.from({length:i}),o=e.get(0);for(let a=0;a<i;a+=1)s[a]=e.get(n[a])||o;return s}getPathCommands(t,e,n,i,s){const o=[];return this.forEachGlyph(t,e,n,i,s,(a,l,c,h,u)=>{o.push(...a.getPathCommands(l,c,h,u,this))}),o}getAdvanceWidth(t,e,n){return this.forEachGlyph(t,0,0,e,n,()=>{})}forEachGlyph(t,e=0,n=0,i=72,s={},o){const a=1/this.unitsPerEm*i,l=this.textToGlyphs(t);for(let c=0;c<l.length;c+=1){const h=l[c];o.call(this,h,e,n,i,s),h.advanceWidth&&(e+=h.advanceWidth*a),s.letterSpacing?e+=s.letterSpacing*i:s.tracking&&(e+=s.tracking/1e3*i)}return e}constructor(t){(t instanceof Map?t:new Map(Object.entries(t))).forEach((n,i)=>{this.tableViews.set(i,new DataView(n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength)))})}clone(){return new Jt(this.tableViews)}delete(t){const e=Jt.tableDefinitions.get(t);return e?(this.tableViews.delete(t),this.tables.delete(e.prop),this):this}set(t,e){const n=Jt.tableDefinitions.get(t);return n&&this.tables.set(n.prop,e),this.tableViews.set(t,e.view),this}get(t){const e=Jt.tableDefinitions.get(t);if(!e)return;let n=this.tables.get(e.prop);if(!n){const i=e.class;if(i){const s=this.tableViews.get(t);if(!s)return;n=new i(s.buffer,s.byteOffset,s.byteLength).setSFNT(this),this.tables.set(e.prop,n)}}return n}}class gt extends Bt{setSFNT(t){return this._sfnt=t,this}getSFNT(){return this._sfnt}}var Ga=Object.defineProperty,qa=Object.getOwnPropertyDescriptor,$e=(r,t,e,n)=>{for(var i=n>1?void 0:n?qa(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(t,e,i):o(i))||i);return n&&i&&Ga(t,e,i),i};let ve=class extends gt{_glyphs;get glyphs(){return this._glyphs??=new Ua(this._sfnt)}get gsubrs(){return this.globalSubrIndex.objects}get gsubrsBias(){return this._calcSubroutineBias(this.globalSubrIndex.objects)}privateDict;subrsIndex;get defaultWidthX(){return this.privateDict?.defaultWidthX??0}get nominalWidthX(){return this.privateDict?.nominalWidthX??0}get subrs(){return this.subrsIndex?.objects??[]}get subrsBias(){return this._calcSubroutineBias(this.subrs)}constructor(r,t,e,n){super(r,t,e,n),this._init()}_init(){const r=this.view,{buffer:t,byteOffset:e}=r,n=e+4;this.nameIndex=new ki(t,n),this.topDictIndex=new dn(t,this.nameIndex.endOffset),this.stringIndex=new ki(t,this.topDictIndex.endOffset),this.globalSubrIndex=new dn(t,this.stringIndex.endOffset),this.topDict=new et(new Uint8Array(this.topDictIndex.objects[0]).buffer).setStringIndex(this.stringIndex);const i=this.topDict.private[0],s=this.topDict.private[1];i&&(this.privateDict=new yn(t,e+s,i).setStringIndex(this.stringIndex),this.privateDict.subrs&&(this.subrsIndex=new dn(t,e+s+this.privateDict.subrs))),this.charStringsIndex=new dn(t,e+this.topDict.charStrings);const o=this.charStringsIndex.offsets.length-1;this.topDict.charset===0?this.charset=Na:this.topDict.charset===1?this.charset=za:this.topDict.charset===2?this.charset=Ra:this.charset=this._readCharset(e+this.topDict.charset,o,this.stringIndex.objects),this.topDict.encoding===0?this.encoding=Jn:this.topDict.encoding===1?this.encoding=Da:this.encoding=this._readEncoding(e+this.topDict.encoding)}_readCharset(r,t,e){const n=this.view;n.seek(r);let i,s,o;t-=1;const a=[".notdef"],l=n.readUint8();if(l===0)for(i=0;i<t;i+=1)s=n.readUint16(),a.push(gn(e,s));else if(l===1)for(;a.length<=t;)for(s=n.readUint16(),o=n.readUint8(),i=0;i<=o;i+=1)a.push(gn(e,s)),s+=1;else if(l===2)for(;a.length<=t;)for(s=n.readUint16(),o=n.readUint16(),i=0;i<=o;i+=1)a.push(gn(e,s)),s+=1;else throw new Error(`Unknown charset format ${l}`);return a}_readEncoding(r){const t=this.view;t.seek(r);let e,n;const i={},s=t.readUint8();if(s===0){const o=t.readUint8();for(e=0;e<o;e+=1)n=t.readUint8(),i[n]=e}else if(s===1){const o=t.readUint8();for(n=1,e=0;e<o;e+=1){const a=t.readUint8(),l=t.readUint8();for(let c=a;c<=a+l;c+=1)i[c]=n,n+=1}}else console.warn(`unknown encoding format:${s}`);return i}_calcSubroutineBias(r){let t;return r.length<1240?t=107:r.length<33900?t=1131:t=32768,t}};$e([m("uint8")],ve.prototype,"majorVersion",2),$e([m("uint8")],ve.prototype,"minorVersion",2),$e([m("uint8")],ve.prototype,"headerSize",2),$e([m("uint8")],ve.prototype,"offsetSize",2),ve=$e([dt("CFF ","cff")],ve);var Wa=Object.defineProperty,mn=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Wa(t,e,i),i};const Ne=class Qi extends Bt{constructor(t=new ArrayBuffer(262),e){super(t,e,262)}static from(t){const e=new Qi;return e.format=0,e.length=e.view.byteLength,e.language=0,t.forEach((n,i)=>{i<256&&n<256&&e.view.writeUint8(n,6+i)}),e}getUnicodeToGlyphIndexMap(){const t=new Map;return this.glyphIndexArray.forEach((e,n)=>{t.set(n,e)}),t}};mn([m("uint16")],Ne.prototype,"format"),mn([m("uint16")],Ne.prototype,"length"),mn([m("uint16")],Ne.prototype,"language"),mn([m({type:"uint8",size:256})],Ne.prototype,"glyphIndexArray");let Oi=Ne;var Ha=Object.defineProperty,er=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Ha(t,e,i),i};class xn extends Bt{get subHeaderKeys(){return this.view.seek(6),Array.from({length:256},()=>this.view.readUint16()/8)}get maxSubHeaderKey(){return this.subHeaderKeys.reduce((t,e)=>Math.max(t,e),0)}get subHeaders(){const t=this.maxSubHeaderKey;return this.view.seek(6+256*2),Array.from({length:t},(e,n)=>({firstCode:this.view.readUint16(),entryCount:this.view.readUint16(),idDelta:this.view.readUint16(),idRangeOffset:(this.view.readUint16()-(t-n)*8-2)/2}))}get glyphIndexArray(){const t=this.maxSubHeaderKey,e=6+256*2+t*8;this.view.seek(e);const n=(this.view.byteLength-e)/2;return Array.from({length:n},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(t){const e=new Map,n=this.subHeaderKeys,i=this.maxSubHeaderKey,s=this.subHeaders,o=this.glyphIndexArray,a=n.findIndex(c=>c===i);let l=0;for(let c=0;c<256;c++)if(n[c]===0)c>=a||c<s[0].firstCode||c>=s[0].firstCode+s[0].entryCount||s[0].idRangeOffset+(c-s[0].firstCode)>=o.length?l=0:(l=o[s[0].idRangeOffset+(c-s[0].firstCode)],l!==0&&(l=l+s[0].idDelta)),l!==0&&l<t&&e.set(c,l);else{const h=n[c];for(let u=0,p=s[h].entryCount;u<p;u++)if(s[h].idRangeOffset+u>=o.length?l=0:(l=o[s[h].idRangeOffset+u],l!==0&&(l=l+s[h].idDelta)),l!==0&&l<t){const d=(c<<8|u+s[h].firstCode)%65535;e.set(d,l)}}return e}}er([m("uint16")],xn.prototype,"format"),er([m("uint16")],xn.prototype,"length"),er([m("uint16")],xn.prototype,"language");function Ii(r){return r>32767?r-65536:r<-32767?r+65536:r}function Ei(r,t){let e;const n=[];let i={};return r.forEach((s,o)=>{t&&o>t||((!e||o!==e.unicode+1||s!==e.glyphIndex+1)&&(e?(i.end=e.unicode,n.push(i),i={start:o,startId:s,delta:Ii(s-o)}):(i.start=Number(o),i.startId=s,i.delta=Ii(s-o))),e={unicode:o,glyphIndex:s})}),e&&(i.end=e.unicode,n.push(i)),n}var Xa=Object.defineProperty,ue=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Xa(t,e,i),i};const ie=class Ji extends Bt{get endCode(){const t=this.segCountX2;return this.view.seek(14),Array.from({length:t/2},()=>this.view.readUint16())}set endCode(t){this.view.seek(14),t.forEach(e=>this.view.writeUint16(e))}get reservedPad(){return this.view.readUint16(14+this.segCountX2)}set reservedPad(t){this.view.writeUint16(t,14+this.segCountX2)}get startCode(){const t=this.segCountX2;return this.view.seek(14+t+2),Array.from({length:t/2},()=>this.view.readUint16())}set startCode(t){this.view.seek(14+this.segCountX2+2),t.forEach(e=>this.view.writeUint16(e))}get idDelta(){const t=this.segCountX2;return this.view.seek(14+t+2+t),Array.from({length:t/2},()=>this.view.readUint16())}set idDelta(t){const e=this.segCountX2;this.view.seek(14+e+2+e),t.forEach(n=>this.view.writeUint16(n))}get idRangeOffsetCursor(){const t=this.segCountX2;return 14+t+2+t*2}get idRangeOffset(){const t=this.segCountX2;return this.view.seek(this.idRangeOffsetCursor),Array.from({length:t/2},()=>this.view.readUint16())}set idRangeOffset(t){this.view.seek(this.idRangeOffsetCursor),t.forEach(e=>this.view.writeUint16(e))}get glyphIndexArrayCursor(){const t=this.segCountX2;return 14+t+2+t*3}get glyphIndexArray(){const t=this.glyphIndexArrayCursor;this.view.seek(t);const e=(this.view.byteLength-t)/2;return Array.from({length:e},()=>this.view.readUint16())}static from(t){const e=Ei(t,65535),n=e.length+1,i=Math.floor(Math.log(n)/Math.LN2),s=2*2**i,o=new Ji(new ArrayBuffer(24+e.length*8));return o.format=4,o.length=o.view.byteLength,o.language=0,o.segCountX2=n*2,o.searchRange=s,o.entrySelector=i,o.rangeShift=2*n-s,o.endCode=[...e.map(a=>a.end),65535],o.reservedPad=0,o.startCode=[...e.map(a=>a.start),65535],o.idDelta=[...e.map(a=>a.delta),1],o.idRangeOffset=Array.from({length:n},()=>0),o}getUnicodeToGlyphIndexMap(){const t=new Map,e=this.segCountX2/2,n=(this.glyphIndexArrayCursor-this.idRangeOffsetCursor)/2,i=this.startCode,s=this.endCode,o=this.idRangeOffset,a=this.idDelta,l=this.glyphIndexArray;for(let c=0;c<e;++c)for(let h=i[c],u=s[c];h<=u;++h)if(o[c]===0)t.set(h,(h+a[c])%65536);else{const p=c+o[c]/2+(h-i[c])-n,d=l[p];d!==0?t.set(h,(d+a[c])%65536):t.set(h,0)}return t.delete(65535),t}};ue([m("uint16")],ie.prototype,"format"),ue([m("uint16")],ie.prototype,"length"),ue([m("uint16")],ie.prototype,"language"),ue([m("uint16")],ie.prototype,"segCountX2"),ue([m("uint16")],ie.prototype,"searchRange"),ue([m("uint16")],ie.prototype,"entrySelector"),ue([m("uint16")],ie.prototype,"rangeShift");let Bi=ie;var Ya=Object.defineProperty,ze=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Ya(t,e,i),i};class we extends Bt{get glyphIndexArray(){return this.view.seek(12),Array.from({length:this.entryCount},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(){const t=this.glyphIndexArray,e=new Map;return t.forEach((n,i)=>{e.set(i,n)}),e}}ze([m("uint16")],we.prototype,"format"),ze([m("uint16")],we.prototype,"length"),ze([m("uint16")],we.prototype,"language"),ze([m("uint16")],we.prototype,"firstCode"),ze([m("uint16")],we.prototype,"entryCount");var Za=Object.defineProperty,Re=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Za(t,e,i),i};const be=class ts extends Bt{get groups(){const t=this.nGroups;return this.view.seek(16),Array.from({length:t},()=>({startCharCode:this.view.readUint32(),endCharCode:this.view.readUint32(),startGlyphCode:this.view.readUint32()}))}static from(t){const e=Ei(t),n=new ts(new ArrayBuffer(16+e.length*12));return n.format=12,n.reserved=0,n.length=n.view.byteLength,n.language=0,n.nGroups=e.length,e.forEach(i=>{n.view.writeUint32(i.start),n.view.writeUint32(i.end),n.view.writeUint32(i.startId)}),n}getUnicodeToGlyphIndexMap(){const t=new Map,e=this.groups;for(let n=0,i=e.length;n<i;n++){const s=e[n];let o=s.startGlyphCode,a=s.startCharCode;const l=s.endCharCode;for(;a<=l;)t.set(a++,o++)}return t}};Re([m("uint16")],be.prototype,"format"),Re([m("uint16")],be.prototype,"reserved"),Re([m("uint32")],be.prototype,"length"),Re([m("uint32")],be.prototype,"language"),Re([m("uint32")],be.prototype,"nGroups");let Di=be;var Ka=Object.defineProperty,nr=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Ka(t,e,i),i};class vn extends Bt{getVarSelectorRecords(){const t=this.numVarSelectorRecords;return this.view.seek(10),Array.from({length:t},()=>{const e={varSelector:this.view.readUint24(),defaultUVSOffset:this.view.readUint32(),unicodeValueRanges:[],nonDefaultUVSOffset:this.view.readUint32(),uVSMappings:[]};if(e.defaultUVSOffset){this.view.seek(e.defaultUVSOffset);const n=this.view.readUint32();e.unicodeValueRanges=Array.from({length:n},()=>({startUnicodeValue:this.view.readUint24(),additionalCount:this.view.readUint8()}))}if(e.nonDefaultUVSOffset){this.view.seek(e.nonDefaultUVSOffset);const n=this.view.readUint32();e.uVSMappings=Array.from({length:n},()=>({unicodeValue:this.view.readUint24(),glyphID:this.view.readUint16()}))}return e})}getUnicodeToGlyphIndexMap(){const t=new Map,e=this.getVarSelectorRecords();for(let n=0,i=e.length;n<i;n++){const{uVSMappings:s}=e[n];s.forEach(o=>{t.set(o.unicodeValue,o.glyphID)})}return t}}nr([m("uint16")],vn.prototype,"format"),nr([m("uint32")],vn.prototype,"length"),nr([m("uint32")],vn.prototype,"numVarSelectorRecords");var Qa=Object.defineProperty,Ja=Object.getOwnPropertyDescriptor,rr=(r,t,e,n)=>{for(var i=n>1?void 0:n?Ja(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(t,e,i):o(i))||i);return n&&i&&Qa(t,e,i),i};let Ve=class extends gt{static from(r){const t=Array.from(r.keys()).some(h=>h>65535),e=Bi.from(r),n=Oi.from(r),i=t?Di.from(r):void 0,s=4+(i?32:24),o=s+e.view.byteLength,a=o+n.view.byteLength,l=[{platformID:0,platformSpecificID:3,offset:s},{platformID:1,platformSpecificID:0,offset:o},{platformID:3,platformSpecificID:1,offset:s},i&&{platformID:3,platformSpecificID:10,offset:a}].filter(Boolean),c=new Ve(new ArrayBuffer(4+8*l.length+e.view.byteLength+n.view.byteLength+(i?.view.byteLength??0)));return c.numberSubtables=l.length,c.view.seek(4),l.forEach(h=>{c.view.writeUint16(h.platformID),c.view.writeUint16(h.platformSpecificID),c.view.writeUint32(h.offset)}),c.view.writeBytes(e.view,s),c.view.writeBytes(n.view,o),i&&c.view.writeBytes(i.view,a),c}_unicodeToGlyphIndexMap;get unicodeToGlyphIndexMap(){return this._unicodeToGlyphIndexMap??=this.readunicodeToGlyphIndexMap()}_glyphIndexToUnicodesMap;get glyphIndexToUnicodesMap(){if(!this._glyphIndexToUnicodesMap){const r=new Map,t=this.unicodeToGlyphIndexMap,e=Array.from(t.keys());for(let n=0,i=e.length;n<i;n++){const s=e[n],o=t.get(s);r.has(o)?r.get(o).push(s):r.set(o,[s])}this._glyphIndexToUnicodesMap=r}return this._glyphIndexToUnicodesMap}readSubtables(){const r=this.numberSubtables;return this.view.seek(4),Array.from({length:r},()=>({platformID:this.view.readUint16(),platformSpecificID:this.view.readUint16(),offset:this.view.readUint32()})).map(t=>{this.view.seek(t.offset);const e=this.view.readUint16();let n;switch(e){case 0:n=new Oi(this.view.buffer,t.offset);break;case 2:n=new xn(this.view.buffer,t.offset,this.view.readUint16());break;case 4:n=new Bi(this.view.buffer,t.offset,this.view.readUint16());break;case 6:n=new we(this.view.buffer,t.offset,this.view.readUint16());break;case 12:n=new Di(this.view.buffer,t.offset,this.view.readUint32(t.offset+4));break;case 14:default:n=new vn(this.view.buffer,t.offset,this.view.readUint32());break}return{...t,format:e,view:n}})}readunicodeToGlyphIndexMap(){const r=this.readSubtables(),t=r.find(o=>o.format===0)?.view,e=r.find(o=>o.platformID===3&&o.platformSpecificID===3&&o.format===2)?.view,n=r.find(o=>o.platformID===3&&o.platformSpecificID===1&&o.format===4)?.view,i=r.find(o=>o.platformID===3&&o.platformSpecificID===10&&o.format===12)?.view,s=r.find(o=>o.platformID===0&&o.platformSpecificID===5&&o.format===14)?.view;return new Map([...t?.getUnicodeToGlyphIndexMap()??[],...e?.getUnicodeToGlyphIndexMap(this._sfnt.maxp.numGlyphs)??[],...n?.getUnicodeToGlyphIndexMap()??[],...i?.getUnicodeToGlyphIndexMap()??[],...s?.getUnicodeToGlyphIndexMap()??[]])}};rr([m("uint16")],Ve.prototype,"version",2),rr([m("uint16")],Ve.prototype,"numberSubtables",2),Ve=rr([dt("cmap")],Ve);class tl extends Pi{_parseContours(t){const e=[];let n=[];for(let i=0;i<t.length;i+=1){const s=t[i];n.push(s),s.lastPointOfContour&&(e.push(n),n=[])}return Ue(n.length===0,"There are still points left in the current contour."),e}_transformPoints(t,e){const n=[];for(let i=0;i<t.length;i+=1){const s=t[i],o={x:e.xScale*s.x+e.scale10*s.y+e.dx,y:e.scale01*s.x+e.yScale*s.y+e.dy,onCurve:s.onCurve,lastPointOfContour:s.lastPointOfContour};n.push(o)}return n}_parseGlyphCoordinate(t,e,n,i,s){let o;return(e&i)>0?(o=t.view.readUint8(),(e&s)===0&&(o=-o),o=n+o):(e&s)>0?o=n:o=n+t.view.readInt16(),o}parse(t,e,n){t.view.seek(e);const i=this.numberOfContours=t.view.readInt16();if(this.xMin=t.view.readInt16(),this.yMin=t.view.readInt16(),this.xMax=t.view.readInt16(),this.yMax=t.view.readInt16(),i>0){const a=this.endPointIndices=[];for(let y=0;y<i;y++)a.push(t.view.readUint16());const l=this.instructionLength=t.view.readUint16();Ue(l<5e3,`Bad instructionLength:${l}`);const c=this.instructions=[];for(let y=0;y<l;++y)c.push(t.view.readUint8());const h=t.view.byteOffset,u=a[a.length-1]+1;Ue(u<2e4,`Bad numberOfCoordinates:${h}`);const p=[];let d,f=0;for(;f<u;)if(d=t.view.readUint8(),p.push(d),f++,d&8&&f<u){const y=t.view.readUint8();for(let g=0;g<y;g++)p.push(d),f++}if(Ue(p.length===u,`Bad flags length: ${p.length}, numberOfCoordinates: ${u}`),a.length>0){const y=[];let g;if(u>0){for(let x=0;x<u;x+=1)d=p[x],g={},g.onCurve=!!(d&1),g.lastPointOfContour=a.includes(x),y.push(g);let M=0;for(let x=0;x<u;x+=1)d=p[x],g=y[x],g.x=this._parseGlyphCoordinate(t,d,M,2,16),M=g.x;let P=0;for(let x=0;x<u;x+=1)d=p[x],g=y[x],g.y=this._parseGlyphCoordinate(t,d,P,4,32),P=g.y}this.points=y}else this.points=[]}else if(i===0)this.points=[];else{this.isComposite=!0,this.points=[],this.components=[];let a,l=!0;for(;l;){a=t.view.readUint16();const c={glyphIndex:t.view.readUint16(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(a&1)>0?(a&2)>0?(c.dx=t.view.readInt16(),c.dy=t.view.readInt16()):c.matchedPoints=[t.view.readUint16(),t.view.readUint16()]:(a&2)>0?(c.dx=t.view.readInt8(),c.dy=t.view.readInt8()):c.matchedPoints=[t.view.readUint8(),t.view.readUint8()],(a&8)>0?c.xScale=c.yScale=t.view.readInt16()/16384:(a&64)>0?(c.xScale=t.view.readInt16()/16384,c.yScale=t.view.readInt16()/16384):(a&128)>0&&(c.xScale=t.view.readInt16()/16384,c.scale01=t.view.readInt16()/16384,c.scale10=t.view.readInt16()/16384,c.yScale=t.view.readInt16()/16384),this.components.push(c),l=!!(a&32)}if(a&256){this.instructionLength=t.view.readUint16(),this.instructions=[];for(let c=0;c<this.instructionLength;c+=1)this.instructions.push(t.view.readUint8())}}if(this.isComposite)for(let a=0;a<this.components.length;a+=1){const l=this.components[a],c=n.get(l.glyphIndex);if(c.getPathCommands(),c.points){let h;if(l.matchedPoints===void 0)h=this._transformPoints(c.points,l);else{Ue(l.matchedPoints[0]>this.points.length-1||l.matchedPoints[1]>c.points.length-1,`Matched points out of range in ${this.name}`);const u=this.points[l.matchedPoints[0]];let p=c.points[l.matchedPoints[1]];const d={xScale:l.xScale,scale01:l.scale01,scale10:l.scale10,yScale:l.yScale,dx:0,dy:0};p=this._transformPoints([p],d)[0],d.dx=u.x-p.x,d.dy=u.y-p.y,h=this._transformPoints(c.points,d)}this.points=this.points.concat(h)}}const s=[],o=this._parseContours(this.points);for(let a=0,l=o.length;a<l;++a){const c=o[a];let h=c[c.length-1],u=c[0];h.onCurve?s.push({type:"M",x:h.x,y:h.y}):u.onCurve?s.push({type:"M",x:u.x,y:u.y}):s.push({type:"M",x:(h.x+u.x)*.5,y:(h.y+u.y)*.5});for(let p=0,d=c.length;p<d;++p)if(h=u,u=c[(p+1)%d],h.onCurve)s.push({type:"L",x:h.x,y:h.y});else{let f=u;u.onCurve||(f={x:(h.x+u.x)*.5,y:(h.y+u.y)*.5}),s.push({type:"Q",x1:h.x,y1:h.y,x:f.x,y:f.y})}s.push({type:"Z"})}this.pathCommands=s}}class el extends _i{get length(){return this._sfnt.loca.locations.length}_get(t){const e=this._sfnt.loca.locations,n=e[t],i=new tl({index:t});return n!==e[t+1]&&i.parse(this._sfnt.glyf,n,this),i}}var nl=Object.getOwnPropertyDescriptor,rl=(r,t,e,n)=>{for(var i=n>1?void 0:n?nl(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(i)||i);return i};let ir=class extends gt{static from(r){const t=r.reduce((n,i)=>n+i.byteLength,0),e=new ir(new ArrayBuffer(t));return r.forEach(n=>{e.view.writeBytes(n)}),e}_glyphs;get glyphs(){return this._glyphs??=new el(this._sfnt)}};ir=rl([dt("glyf")],ir);var il=Object.getOwnPropertyDescriptor,sl=(r,t,e,n)=>{for(var i=n>1?void 0:n?il(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(i)||i);return i};let Fi=class extends gt{};Fi=sl([dt("GPOS","gpos")],Fi);var ol=Object.defineProperty,al=Object.getOwnPropertyDescriptor,fe=(r,t,e,n)=>{for(var i=n>1?void 0:n?al(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(t,e,i):o(i))||i);return n&&i&&ol(t,e,i),i};let se=class extends gt{};fe([m("uint16")],se.prototype,"majorVersion",2),fe([m("uint16")],se.prototype,"minorVersion",2),fe([m("uint16")],se.prototype,"scriptListOffset",2),fe([m("uint16")],se.prototype,"featureListOffset",2),fe([m("uint16")],se.prototype,"lookupListOffset",2),fe([m("uint16")],se.prototype,"featureVariationsOffset",2),se=fe([dt("GSUB","gsub")],se);var ll=Object.defineProperty,cl=Object.getOwnPropertyDescriptor,at=(r,t,e,n)=>{for(var i=n>1?void 0:n?cl(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(t,e,i):o(i))||i);return n&&i&&ll(t,e,i),i};let st=class extends gt{constructor(r=new ArrayBuffer(54),t){super(r,t,Math.min(54,r.byteLength-(t??0)))}};at([m("fixed")],st.prototype,"version",2),at([m("fixed")],st.prototype,"fontRevision",2),at([m("uint32")],st.prototype,"checkSumAdjustment",2),at([m("uint32")],st.prototype,"magickNumber",2),at([m("uint16")],st.prototype,"flags",2),at([m("uint16")],st.prototype,"unitsPerEm",2),at([m({type:"longDateTime"})],st.prototype,"created",2),at([m({type:"longDateTime"})],st.prototype,"modified",2),at([m("int16")],st.prototype,"xMin",2),at([m("int16")],st.prototype,"yMin",2),at([m("int16")],st.prototype,"xMax",2),at([m("int16")],st.prototype,"yMax",2),at([m("uint16")],st.prototype,"macStyle",2),at([m("uint16")],st.prototype,"lowestRecPPEM",2),at([m("int16")],st.prototype,"fontDirectionHint",2),at([m("int16")],st.prototype,"indexToLocFormat",2),at([m("int16")],st.prototype,"glyphDataFormat",2),st=at([dt("head")],st);var hl=Object.defineProperty,ul=Object.getOwnPropertyDescriptor,St=(r,t,e,n)=>{for(var i=n>1?void 0:n?ul(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(t,e,i):o(i))||i);return n&&i&&hl(t,e,i),i};let yt=class extends gt{constructor(r=new ArrayBuffer(36),t){super(r,t,Math.min(36,r.byteLength-(t??0)))}};St([m("fixed")],yt.prototype,"version",2),St([m("int16")],yt.prototype,"ascent",2),St([m("int16")],yt.prototype,"descent",2),St([m("int16")],yt.prototype,"lineGap",2),St([m("uint16")],yt.prototype,"advanceWidthMax",2),St([m("int16")],yt.prototype,"minLeftSideBearing",2),St([m("int16")],yt.prototype,"minRightSideBearing",2),St([m("int16")],yt.prototype,"xMaxExtent",2),St([m("int16")],yt.prototype,"caretSlopeRise",2),St([m("int16")],yt.prototype,"caretSlopeRun",2),St([m("int16")],yt.prototype,"caretOffset",2),St([m({type:"int16",size:4})],yt.prototype,"reserved",2),St([m("int16")],yt.prototype,"metricDataFormat",2),St([m("uint16")],yt.prototype,"numOfLongHorMetrics",2),yt=St([dt("hhea")],yt);var fl=Object.getOwnPropertyDescriptor,pl=(r,t,e,n)=>{for(var i=n>1?void 0:n?fl(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(i)||i);return i};let sr=class extends gt{static from(r){const t=r.length*4,e=new sr(new ArrayBuffer(t));return r.forEach(n=>{e.view.writeUint16(n.advanceWidth),e.view.writeUint16(n.leftSideBearing)}),e}_metrics;get metrics(){return this._metrics??=this.readMetrics()}readMetrics(){const r=this._sfnt.maxp.numGlyphs,t=this._sfnt.hhea.numOfLongHorMetrics;let e=0;const n=this.view;return n.seek(0),Array.from({length:r}).map((i,s)=>(s<t&&(e=n.readUint16()),{advanceWidth:e,leftSideBearing:n.readUint16()}))}};sr=pl([dt("hmtx")],sr);var dl=Object.getOwnPropertyDescriptor,gl=(r,t,e,n)=>{for(var i=n>1?void 0:n?dl(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(i)||i);return i};let Ui=class extends gt{};Ui=gl([dt("kern","kern")],Ui);var yl=Object.getOwnPropertyDescriptor,ml=(r,t,e,n)=>{for(var i=n>1?void 0:n?yl(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(i)||i);return i};let or=class extends gt{static from(r,t=1){const e=r.length*(t?4:2),n=new or(new ArrayBuffer(e));return r.forEach(i=>{t?n.view.writeUint32(i):n.view.writeUint16(i/2)}),n}_locations;get locations(){return this._locations??=this.readLocations()}readLocations(){const r=this._sfnt.maxp.numGlyphs,t=this._sfnt.head.indexToLocFormat,e=this.view;return e.seek(0),Array.from({length:r}).map(()=>t?e.readUint32():e.readUint16()*2)}};or=ml([dt("loca")],or);var xl=Object.defineProperty,vl=Object.getOwnPropertyDescriptor,mt=(r,t,e,n)=>{for(var i=n>1?void 0:n?vl(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(t,e,i):o(i))||i);return n&&i&&xl(t,e,i),i};let ct=class extends gt{constructor(r=new ArrayBuffer(32),t){super(r,t,Math.min(32,r.byteLength-(t??0)))}};mt([m("fixed")],ct.prototype,"version",2),mt([m("uint16")],ct.prototype,"numGlyphs",2),mt([m("uint16")],ct.prototype,"maxPoints",2),mt([m("uint16")],ct.prototype,"maxContours",2),mt([m("uint16")],ct.prototype,"maxComponentPoints",2),mt([m("uint16")],ct.prototype,"maxComponentContours",2),mt([m("uint16")],ct.prototype,"maxZones",2),mt([m("uint16")],ct.prototype,"maxTwilightPoints",2),mt([m("uint16")],ct.prototype,"maxStorage",2),mt([m("uint16")],ct.prototype,"maxFunctionDefs",2),mt([m("uint16")],ct.prototype,"maxInstructionDefs",2),mt([m("uint16")],ct.prototype,"maxStackElements",2),mt([m("uint16")],ct.prototype,"maxSizeOfInstructions",2),mt([m("uint16")],ct.prototype,"maxComponentElements",2),mt([m("uint16")],ct.prototype,"maxComponentDepth",2),ct=mt([dt("maxp")],ct);var wl=Object.defineProperty,bl=Object.getOwnPropertyDescriptor,wn=(r,t,e,n)=>{for(var i=n>1?void 0:n?bl(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(t,e,i):o(i))||i);return n&&i&&wl(t,e,i),i};const Li={0:"copyright",1:"fontFamily",2:"fontSubFamily",3:"uniqueSubFamily",4:"fullName",5:"version",6:"postScriptName",7:"tradeMark",8:"manufacturer",9:"designer",10:"description",11:"urlOfFontVendor",12:"urlOfFontDesigner",13:"licence",14:"urlOfLicence",16:"preferredFamily",17:"preferredSubFamily",18:"compatibleFull",19:"sampleText"},ar={Macintosh:1,Microsoft:3},Sl={Default:0},$i={UCS2:1};let je=class extends gt{_names;get names(){return this._names??=this.readNames()}readNames(){const r=this.count;this.view.seek(6);const t=[];for(let a=0;a<r;++a)t.push({platform:this.view.readUint16(),encoding:this.view.readUint16(),language:this.view.readUint16(),nameId:this.view.readUint16(),length:this.view.readUint16(),offset:this.view.readUint16()});const e=this.stringOffset;for(let a=0;a<r;++a){const l=t[a];l.name=this.view.readBytes(e+l.offset,l.length)}let n=ar.Macintosh,i=Sl.Default,s=0;t.some(a=>a.platform===ar.Microsoft&&a.encoding===$i.UCS2&&a.language===1033)&&(n=ar.Microsoft,i=$i.UCS2,s=1033);const o={};for(let a=0;a<r;++a){const l=t[a];l.platform===n&&l.encoding===i&&l.language===s&&Li[l.nameId]&&(o[Li[l.nameId]]=s===0?Aa(l.name):Oa(l.name))}return o}};wn([m("uint16")],je.prototype,"format",2),wn([m("uint16")],je.prototype,"count",2),wn([m("uint16")],je.prototype,"stringOffset",2),je=wn([dt("name")],je);var Cl=Object.defineProperty,Ml=Object.getOwnPropertyDescriptor,G=(r,t,e,n)=>{for(var i=n>1?void 0:n?Ml(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(t,e,i):o(i))||i);return n&&i&&Cl(t,e,i),i};let j=class extends gt{get fontPANOSE(){return[this.bFamilyType,this.bSerifStyle,this.bWeight,this.bProportion,this.bContrast,this.bStrokeVariation,this.bArmStyle,this.bLetterform,this.bMidline,this.bXHeight]}};G([m("uint16")],j.prototype,"version",2),G([m("int16")],j.prototype,"xAvgCharWidth",2),G([m("uint16")],j.prototype,"usWeightClass",2),G([m("uint16")],j.prototype,"usWidthClass",2),G([m("uint16")],j.prototype,"fsType",2),G([m("uint16")],j.prototype,"ySubscriptXSize",2),G([m("uint16")],j.prototype,"ySubscriptYSize",2),G([m("uint16")],j.prototype,"ySubscriptXOffset",2),G([m("uint16")],j.prototype,"ySubscriptYOffset",2),G([m("uint16")],j.prototype,"ySuperscriptXSize",2),G([m("uint16")],j.prototype,"ySuperscriptYSize",2),G([m("uint16")],j.prototype,"ySuperscriptXOffset",2),G([m("uint16")],j.prototype,"ySuperscriptYOffset",2),G([m("uint16")],j.prototype,"yStrikeoutSize",2),G([m("uint16")],j.prototype,"yStrikeoutPosition",2),G([m("uint16")],j.prototype,"sFamilyClass",2),G([m({type:"uint8"})],j.prototype,"bFamilyType",2),G([m({type:"uint8"})],j.prototype,"bSerifStyle",2),G([m({type:"uint8"})],j.prototype,"bWeight",2),G([m({type:"uint8"})],j.prototype,"bProportion",2),G([m({type:"uint8"})],j.prototype,"bContrast",2),G([m({type:"uint8"})],j.prototype,"bStrokeVariation",2),G([m({type:"uint8"})],j.prototype,"bArmStyle",2),G([m({type:"uint8"})],j.prototype,"bLetterform",2),G([m({type:"uint8"})],j.prototype,"bMidline",2),G([m({type:"uint8"})],j.prototype,"bXHeight",2),G([m({type:"uint8",size:16})],j.prototype,"ulUnicodeRange",2),G([m({type:"char",size:4})],j.prototype,"achVendID",2),G([m("uint16")],j.prototype,"fsSelection",2),G([m("uint16")],j.prototype,"usFirstCharIndex",2),G([m("uint16")],j.prototype,"usLastCharIndex",2),G([m("int16")],j.prototype,"sTypoAscender",2),G([m("int16")],j.prototype,"sTypoDescender",2),G([m("int16")],j.prototype,"sTypoLineGap",2),G([m("uint16")],j.prototype,"usWinAscent",2),G([m("uint16")],j.prototype,"usWinDescent",2),G([m({offset:72,type:"uint8",size:8})],j.prototype,"ulCodePageRange",2),G([m({offset:72,type:"int16"})],j.prototype,"sxHeight",2),G([m("int16")],j.prototype,"sCapHeight",2),G([m("uint16")],j.prototype,"usDefaultChar",2),G([m("uint16")],j.prototype,"usBreakChar",2),G([m("uint16")],j.prototype,"usMaxContext",2),j=G([dt("OS/2","os2")],j);var Pl=Object.defineProperty,_l=Object.getOwnPropertyDescriptor,Ht=(r,t,e,n)=>{for(var i=n>1?void 0:n?_l(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(t,e,i):o(i))||i);return n&&i&&Pl(t,e,i),i};let Nt=class extends gt{constructor(r=new ArrayBuffer(32),t,e){super(r,t,e)}};Ht([m("fixed")],Nt.prototype,"format",2),Ht([m("fixed")],Nt.prototype,"italicAngle",2),Ht([m("int16")],Nt.prototype,"underlinePosition",2),Ht([m("int16")],Nt.prototype,"underlineThickness",2),Ht([m("uint32")],Nt.prototype,"isFixedPitch",2),Ht([m("uint32")],Nt.prototype,"minMemType42",2),Ht([m("uint32")],Nt.prototype,"maxMemType42",2),Ht([m("uint32")],Nt.prototype,"minMemType1",2),Ht([m("uint32")],Nt.prototype,"maxMemType1",2),Nt=Ht([dt("post")],Nt);var Tl=Object.defineProperty,kl=Object.getOwnPropertyDescriptor,Ct=(r,t,e,n)=>{for(var i=n>1?void 0:n?kl(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(t,e,i):o(i))||i);return n&&i&&Tl(t,e,i),i};let xt=class extends gt{constructor(r=new ArrayBuffer(36),t){super(r,t,Math.min(36,r.byteLength-(t??0)))}};Ct([m("fixed")],xt.prototype,"version",2),Ct([m("int16")],xt.prototype,"vertTypoAscender",2),Ct([m("int16")],xt.prototype,"vertTypoDescender",2),Ct([m("int16")],xt.prototype,"vertTypoLineGap",2),Ct([m("int16")],xt.prototype,"advanceHeightMax",2),Ct([m("int16")],xt.prototype,"minTopSideBearing",2),Ct([m("int16")],xt.prototype,"minBottomSideBearing",2),Ct([m("int16")],xt.prototype,"yMaxExtent",2),Ct([m("int16")],xt.prototype,"caretSlopeRise",2),Ct([m("int16")],xt.prototype,"caretSlopeRun",2),Ct([m("int16")],xt.prototype,"caretOffset",2),Ct([m({type:"int16",size:4})],xt.prototype,"reserved",2),Ct([m("int16")],xt.prototype,"metricDataFormat",2),Ct([m("int16")],xt.prototype,"numOfLongVerMetrics",2),xt=Ct([dt("vhea")],xt);var Al=Object.getOwnPropertyDescriptor,Ol=(r,t,e,n)=>{for(var i=n>1?void 0:n?Al(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(i)||i);return i};let lr=class extends gt{static from(r){const t=r.length*4,e=new lr(new ArrayBuffer(t));return r.forEach(n=>{e.view.writeUint16(n.advanceHeight),e.view.writeInt16(n.topSideBearing)}),e}_metrics;get metrics(){return this._metrics??=this.readMetrics()}readMetrics(){const r=this._sfnt.maxp.numGlyphs,t=this._sfnt.vhea?.numOfLongVerMetrics??0,e=this.view;e.seek(0);let n=0;return Array.from({length:r}).map((i,s)=>(s<t&&(n=e.readUint16()),{advanceHeight:n,topSideBearing:e.readUint8()}))}};lr=Ol([dt("vmtx")],lr);var Il=Object.defineProperty,Ge=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Il(t,e,i),i};class Xt extends Qn{format="TrueType";mimeType="font/ttf";_sfnt;get sfnt(){return this._sfnt||(this._sfnt=this.createSFNT()),this._sfnt}static signature=new Set([65536,1953658213,1954115633]);static is(t){return typeof t=="number"?this.signature.has(t):this.signature.has(xe(t).getUint32(0))}static checksum(t){const e=xe(t);let n=e.byteLength;for(;n%4;)n++;let i=0;for(let s=0,o=n/4;s<o;s+=4)s*4<n-4&&(i+=e.getUint32(s*4,!1));return i&4294967295}static from(t){const e=u=>u+3&-4,n=t.tableViews.size,i=Array.from(t.tableViews.values()).reduce((u,p)=>u+e(p.byteLength),0),s=new this(new ArrayBuffer(12+n*16+i));s.scalerType=65536,s.numTables=n;const o=Math.log(2);s.searchRange=Math.floor(Math.log(n)/o)*16,s.entrySelector=Math.floor(s.searchRange/o),s.rangeShift=n*16-s.searchRange;let a=12+n*16,l=0;const c=s.getDirectories();t.tableViews.forEach((u,p)=>{const d=c[l++];d.tag=p,d.checkSum=this.checksum(u),d.offset=a,d.length=u.byteLength,s.view.writeBytes(u,a),a+=e(d.length)});const h=s.createSFNT().head;return h.checkSumAdjustment=0,h.checkSumAdjustment=2981146554-this.checksum(s.view),s}getDirectories(){let t=this.view.byteOffset+12;return Array.from({length:this.numTables},()=>{const e=new Le(this.view.buffer,t);return t+=e.view.byteLength,e})}createSFNT(){return new Jt(this.getDirectories().reduce((t,e)=>(t[e.tag]=new DataView(this.view.buffer,this.view.byteOffset+e.offset,e.length),t),{}))}}Ge([m("uint32")],Xt.prototype,"scalerType"),Ge([m("uint16")],Xt.prototype,"numTables"),Ge([m("uint16")],Xt.prototype,"searchRange"),Ge([m("uint16")],Xt.prototype,"entrySelector"),Ge([m("uint16")],Xt.prototype,"rangeShift");class cr extends Xt{format="OpenType";mimeType="font/otf";static signature=new Set([1330926671]);static from(t){return super.from(t)}}var El=Object.defineProperty,qe=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&El(t,e,i),i};class Se extends Bt{constructor(t,e){super(t,e,20)}}qe([m({type:"char",size:4})],Se.prototype,"tag"),qe([m("uint32")],Se.prototype,"offset"),qe([m("uint32")],Se.prototype,"compLength"),qe([m("uint32")],Se.prototype,"origLength"),qe([m("uint32")],Se.prototype,"origChecksum");var Bl=Object.defineProperty,Ot=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Bl(t,e,i),i};const _t=class gr extends Qn{format="WOFF";mimeType="font/woff";get subfontFormat(){return Xt.is(this.flavor)?"TrueType":cr.is(this.flavor)?"OpenType":"Open"}_sfnt;get sfnt(){return this._sfnt||(this._sfnt=this.createSFNT()),this._sfnt}static signature=new Set([2001684038]);static is(t){return typeof t=="number"?this.signature.has(t):this.signature.has(xe(t).getUint32(0))}static checkSum(t){const e=xe(t),n=e.byteLength,i=Math.floor(n/4);let s=0,o=0;for(;o<i;)s+=e.getUint32(4*o++,!1);let a=n-i*4;if(a){let l=i*4;for(;a>0;)s+=e.getUint8(l)<<a*8,l++,a--}return s%4294967296}static from(t,e=new ArrayBuffer(0)){const n=u=>u+3&-4,i=[];t.tableViews.forEach((u,p)=>{const d=xe(Sa(new Uint8Array(u.buffer,u.byteOffset,u.byteLength)));i.push({tag:p,view:d.byteLength<u.byteLength?d:u,rawView:u})});const s=i.length,o=i.reduce((u,p)=>u+n(p.view.byteLength),0),a=new gr(new ArrayBuffer(44+20*s+o+e.byteLength));a.signature=2001684038,a.flavor=65536,a.length=a.view.byteLength,a.numTables=s,a.totalSFNTSize=12+16*s+i.reduce((u,p)=>u+n(p.rawView.byteLength),0);let l=44+s*20,c=0;const h=a.getDirectories();return i.forEach(u=>{const p=h[c++];p.tag=u.tag,p.offset=l,p.compLength=u.view.byteLength,p.origChecksum=gr.checkSum(u.rawView),p.origLength=u.rawView.byteLength,a.view.writeBytes(u.view,l),l+=n(p.compLength)}),a.view.writeBytes(e),a}getDirectories(){let t=44;return Array.from({length:this.numTables},()=>{const e=new Se(this.view.buffer,t);return t+=e.view.byteLength,e})}createSFNT(){return new Jt(this.getDirectories().reduce((t,e)=>{const n=e.tag,i=this.view.byteOffset+e.offset,s=e.compLength,o=e.origLength,a=i+s;return t[n]=s>=o?new DataView(this.view.buffer,i,s):new DataView(Ca(new Uint8Array(this.view.buffer.slice(i,a))).buffer),t},{}))}};Ot([m("uint32")],_t.prototype,"signature"),Ot([m("uint32")],_t.prototype,"flavor"),Ot([m("uint32")],_t.prototype,"length"),Ot([m("uint16")],_t.prototype,"numTables"),Ot([m("uint16")],_t.prototype,"reserved"),Ot([m("uint32")],_t.prototype,"totalSFNTSize"),Ot([m("uint16")],_t.prototype,"majorVersion"),Ot([m("uint16")],_t.prototype,"minorVersion"),Ot([m("uint32")],_t.prototype,"metaOffset"),Ot([m("uint32")],_t.prototype,"metaLength"),Ot([m("uint32")],_t.prototype,"metaOrigLength"),Ot([m("uint32")],_t.prototype,"privOffset"),Ot([m("uint32")],_t.prototype,"privLength");let hr=_t;function Dl(r,t=!0){if(Xt.is(r))return new Xt(r);if(cr.is(r))return new cr(r);if(hr.is(r))return new hr(r);if(t)throw new Error("Failed to parseFont")}function Fl(r,t=!0){const e=Dl(r,!1);if(e)return e;if(t)throw new Error("Failed to parseFont")}class ur{static defaultRequestInit={cache:"force-cache"};fallbackFont;loading=new Map;loaded=new Map;familyToUrl=new Map;setFallbackFont(t){this.fallbackFont=t}async loadFallbackFont(t,e={}){this.fallbackFont=await this.load(t,e)}_createRequest(t,e){const n=new AbortController;return{url:t,when:fetch(t,{...ur.defaultRequestInit,...e,signal:n.signal}).then(i=>i.arrayBuffer()),cancel:()=>n.abort()}}injectFontFace(t,e){return document.fonts.check(`14px ${t}`)||document.fonts.add(new FontFace(t,e)),this}injectStyleTag(t,e){const n=CSS.escape(t);if(!document.querySelector(`style[data-family="${n}"]`)){const i=document.createElement("style");i.type="text/css",i.dataset.family=t,i.appendChild(document.createTextNode(`@font-face {
30
+ </svg>`}toSvgUrl(){return`data:image/svg+xml;base64,${btoa(this.toSvgString())}`}toSvg(){return new DOMParser().parseFromString(this.toSvgString(),"image/svg+xml").documentElement}toCanvas(t={}){const{pixelRatio:e=2,...n}=t,{left:i,top:s,width:o,height:a}=this.getBoundingBox(),l=document.createElement("canvas");l.width=o*e,l.height=a*e,l.style.width=`${o}px`,l.style.height=`${a}px`;const c=l.getContext("2d");return c&&(c.scale(e,e),c.translate(-i,-s),this.paths.forEach(h=>{h.drawTo(c,n)})),l}}class ui{constructor(t,e){this.text=t,this.context=e}pixelRatio=window?.devicePixelRatio||1;_setupView=()=>{const t=this.pixelRatio,e=this.context,{left:n,top:i,width:s,height:o}=this.text.boundingBox,a=e.canvas;a.dataset.viewBox=`${n} ${i} ${s} ${o}`,a.dataset.pixelRatio=String(t);const l=s,c=o;a.width=Math.max(1,Math.ceil(l*t)),a.height=Math.max(1,Math.ceil(c*t)),a.style.width=`${l}px`,a.style.height=`${c}px`,e.clearRect(0,0,a.width,a.height),e.scale(t,t),e.translate(-n,-i)};_setupColors=()=>{const{paragraphs:t,computedStyle:e,glyphBox:n}=this.text;this.uploadColor(e,n),t.forEach(i=>{this.uploadColor(i.computedStyle,i.lineBox),i.fragments.forEach(s=>{this.uploadColor(s.computedStyle,s.inlineBox)})})};setup=()=>(this._setupView(),this._setupColors(),this);_parseColor=(t,e)=>{if(typeof t=="string"&&_e(t)){const n=Or(t)[0];if(n&&n.type==="linear-gradient"){let i=0;n.orientation&&n.orientation.type==="angular"&&(i=Number(n.orientation.value));const{left:s,top:o,width:a,height:l}=e,c=i*Math.PI/180,h=a*Math.sin(c),u=l*Math.cos(c),p=this.context.createLinearGradient(s+a/2-h,o+l/2+u,s+a/2+h,o+l/2-u);return n.colorStops.forEach(d=>{let f=0;switch(d.length&&d.length.type==="%"&&(f=Number(d.length.value)/100),d.type){case"rgb":p.addColorStop(f,`rgb(${d.value.join(", ")})`);break;case"rgba":p.addColorStop(f,`rgba(${d.value.join(", ")})`);break;case"hex":p.addColorStop(f,`#${d.value}`);break}}),p}}return t};_uploadedStyles=["color","backgroundColor","textStrokeColor"];uploadColor=(t,e)=>{this._uploadedStyles.forEach(n=>{t[n]=this._parseColor(t[n],e)})};drawPath=(t,e={})=>{const{clipRect:n}=e,i=this.context;i.save(),i.beginPath(),n&&(i.rect(n.left,n.top,n.width,n.height),i.clip(),i.beginPath()),t.drawTo(i,this._mergePathStyle(t,e)),i.restore()};_mergePathStyle(t,e){const{fontSize:n=this.text.computedStyle.fontSize}=e,i=t.style,s=e.stroke??i.stroke,o=e.strokeWidth?e.strokeWidth*n:i.strokeWidth;return{...i,...e,fill:e.fill??i.fill,stroke:o===void 0||o>0?s:void 0,strokeLinecap:e.strokeLinecap??i.strokeLinecap??"round",strokeLinejoin:e.strokeLinejoin??i.strokeLinejoin??"round",strokeWidth:o,shadowOffsetX:(e.shadowOffsetX??0)*n,shadowOffsetY:(e.shadowOffsetY??0)*n,shadowBlur:(e.shadowBlur??0)*n,shadowColor:e.shadowColor}}drawCharacter=(t,e={})=>{const n=this.context,{computedStyle:i,path:s,glyphBox:o,isVertical:a,content:l,inlineBox:c,baseline:h,computedFill:u,computedOutline:p}=t,d={...i,...e},f={strokeLinecap:p?.lineCap,strokeLinejoin:p?.lineJoin,...d,fill:e.color??u?.color??i.color,strokeWidth:e.textStrokeWidth??p?.width??i.textStrokeWidth,stroke:e.textStrokeColor??p?.color??i.textStrokeColor};o?this.drawPath(s,f):(n.save(),n.beginPath(),Fn(n,this._mergePathStyle(s,f)),n.font=`${d.fontSize}px ${d.fontFamily}`,a?(n.textBaseline="middle",n.fillText(l,c.left,c.top+c.height/2)):(n.textBaseline="alphabetic",n.fillText(l,c.left,c.top+h)),n.restore())}}var ut=Uint8Array,Ot=Uint16Array,jn=Int32Array,ln=new ut([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]),cn=new ut([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]),Gn=new ut([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),fi=function(r,t){for(var e=new Ot(31),n=0;n<31;++n)e[n]=t+=1<<r[n-1];for(var i=new jn(e[30]),n=1;n<30;++n)for(var s=e[n];s<e[n+1];++s)i[s]=s-e[n]<<5|n;return{b:e,r:i}},pi=fi(ln,2),di=pi.b,qn=pi.r;di[28]=258,qn[258]=28;for(var gi=fi(cn,0),ha=gi.b,yi=gi.r,Wn=new Ot(32768),K=0;K<32768;++K){var ne=(K&43690)>>1|(K&21845)<<1;ne=(ne&52428)>>2|(ne&13107)<<2,ne=(ne&61680)>>4|(ne&3855)<<4,Wn[K]=((ne&65280)>>8|(ne&255)<<8)>>1}for(var Wt=(function(r,t,e){for(var n=r.length,i=0,s=new Ot(t);i<n;++i)r[i]&&++s[r[i]-1];var o=new Ot(t);for(i=1;i<t;++i)o[i]=o[i-1]+s[i-1]<<1;var a;if(e){a=new Ot(1<<t);var l=15-t;for(i=0;i<n;++i)if(r[i])for(var c=i<<4|r[i],h=t-r[i],u=o[r[i]-1]++<<h,p=u|(1<<h)-1;u<=p;++u)a[Wn[u]>>l]=c}else for(a=new Ot(n),i=0;i<n;++i)r[i]&&(a[i]=Wn[o[r[i]-1]++]>>15-r[i]);return a}),re=new ut(288),K=0;K<144;++K)re[K]=8;for(var K=144;K<256;++K)re[K]=9;for(var K=256;K<280;++K)re[K]=7;for(var K=280;K<288;++K)re[K]=8;for(var Be=new ut(32),K=0;K<32;++K)Be[K]=5;var ua=Wt(re,9,0),fa=Wt(re,9,1),pa=Wt(Be,5,0),da=Wt(Be,5,1),Hn=function(r){for(var t=r[0],e=1;e<r.length;++e)r[e]>t&&(t=r[e]);return t},Lt=function(r,t,e){var n=t/8|0;return(r[n]|r[n+1]<<8)>>(t&7)&e},Xn=function(r,t){var e=t/8|0;return(r[e]|r[e+1]<<8|r[e+2]<<16)>>(t&7)},Yn=function(r){return(r+7)/8|0},mi=function(r,t,e){return(e==null||e>r.length)&&(e=r.length),new ut(r.subarray(t,e))},ga=["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"],$t=function(r,t,e){var n=new Error(t||ga[r]);if(n.code=r,Error.captureStackTrace&&Error.captureStackTrace(n,$t),!e)throw n;return n},ya=function(r,t,e,n){var i=r.length,s=0;if(!i||t.f&&!t.l)return e||new ut(0);var o=!e,a=o||t.i!=2,l=t.i;o&&(e=new ut(i*3));var c=function(Mt){var Tt=e.length;if(Mt>Tt){var ht=new ut(Math.max(Tt*2,Mt));ht.set(e),e=ht}},h=t.f||0,u=t.p||0,p=t.b||0,d=t.l,f=t.d,y=t.m,g=t.n,M=i*8;do{if(!d){h=Lt(r,u,1);var P=Lt(r,u+1,3);if(u+=3,P)if(P==1)d=fa,f=da,y=9,g=5;else if(P==2){var v=Lt(r,u,31)+257,S=Lt(r,u+10,15)+4,b=v+Lt(r,u+5,31)+1;u+=14;for(var D=new ut(b),z=new ut(19),E=0;E<S;++E)z[Gn[E]]=Lt(r,u+E*3,7);u+=S*3;for(var F=Hn(z),N=(1<<F)-1,B=Wt(z,F,1),E=0;E<b;){var A=B[Lt(r,u,N)];u+=A&15;var x=A>>4;if(x<16)D[E++]=x;else{var W=0,O=0;for(x==16?(O=3+Lt(r,u,3),u+=2,W=D[E-1]):x==17?(O=3+Lt(r,u,7),u+=3):x==18&&(O=11+Lt(r,u,127),u+=7);O--;)D[E++]=W}}var L=D.subarray(0,v),V=D.subarray(v);y=Hn(L),g=Hn(V),d=Wt(L,y,1),f=Wt(V,g,1)}else $t(1);else{var x=Yn(u)+4,C=r[x-4]|r[x-3]<<8,w=x+C;if(w>i){l&&$t(0);break}a&&c(p+C),e.set(r.subarray(x,w),p),t.b=p+=C,t.p=u=w*8,t.f=h;continue}if(u>M){l&&$t(0);break}}a&&c(p+131072);for(var I=(1<<y)-1,R=(1<<g)-1,T=u;;T=u){var W=d[Xn(r,u)&I],_=W>>4;if(u+=W&15,u>M){l&&$t(0);break}if(W||$t(2),_<256)e[p++]=_;else if(_==256){T=u,d=null;break}else{var U=_-254;if(_>264){var E=_-257,$=ln[E];U=Lt(r,u,(1<<$)-1)+di[E],u+=$}var q=f[Xn(r,u)&R],X=q>>4;q||$t(3),u+=q&15;var V=ha[X];if(X>3){var $=cn[X];V+=Xn(r,u)&(1<<$)-1,u+=$}if(u>M){l&&$t(0);break}a&&c(p+131072);var nt=p+U;if(p<V){var Yt=s-V,Dt=Math.min(V,nt);for(Yt+p<0&&$t(3);p<Dt;++p)e[p]=n[Yt+p]}for(;p<nt;++p)e[p]=e[p-V]}}t.l=d,t.p=T,t.b=p,t.f=h,d&&(h=1,t.m=y,t.d=f,t.n=g)}while(!h);return p!=e.length&&o?mi(e,0,p):e.subarray(0,p)},Qt=function(r,t,e){e<<=t&7;var n=t/8|0;r[n]|=e,r[n+1]|=e>>8},De=function(r,t,e){e<<=t&7;var n=t/8|0;r[n]|=e,r[n+1]|=e>>8,r[n+2]|=e>>16},Zn=function(r,t){for(var e=[],n=0;n<r.length;++n)r[n]&&e.push({s:n,f:r[n]});var i=e.length,s=e.slice();if(!i)return{t:bi,l:0};if(i==1){var o=new ut(e[0].s+1);return o[e[0].s]=1,{t:o,l:1}}e.sort(function(w,v){return w.f-v.f}),e.push({s:-1,f:25001});var a=e[0],l=e[1],c=0,h=1,u=2;for(e[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=i-1;)a=e[e[c].f<e[u].f?c++:u++],l=e[c!=h&&e[c].f<e[u].f?c++:u++],e[h++]={s:-1,f:a.f+l.f,l:a,r:l};for(var p=s[0].s,n=1;n<i;++n)s[n].s>p&&(p=s[n].s);var d=new Ot(p+1),f=Kn(e[h-1],d,0);if(f>t){var n=0,y=0,g=f-t,M=1<<g;for(s.sort(function(v,S){return d[S.s]-d[v.s]||v.f-S.f});n<i;++n){var P=s[n].s;if(d[P]>t)y+=M-(1<<f-d[P]),d[P]=t;else break}for(y>>=g;y>0;){var x=s[n].s;d[x]<t?y-=1<<t-d[x]++-1:++n}for(;n>=0&&y;--n){var C=s[n].s;d[C]==t&&(--d[C],++y)}f=t}return{t:new ut(d),l:f}},Kn=function(r,t,e){return r.s==-1?Math.max(Kn(r.l,t,e+1),Kn(r.r,t,e+1)):t[r.s]=e},xi=function(r){for(var t=r.length;t&&!r[--t];);for(var e=new Ot(++t),n=0,i=r[0],s=1,o=function(l){e[n++]=l},a=1;a<=t;++a)if(r[a]==i&&a!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=r[a]}return{c:e.subarray(0,n),n:t}},Fe=function(r,t){for(var e=0,n=0;n<t.length;++n)e+=r[n]*t[n];return e},vi=function(r,t,e){var n=e.length,i=Yn(t+2);r[i]=n&255,r[i+1]=n>>8,r[i+2]=r[i]^255,r[i+3]=r[i+1]^255;for(var s=0;s<n;++s)r[i+s+4]=e[s];return(i+4+n)*8},wi=function(r,t,e,n,i,s,o,a,l,c,h){Qt(t,h++,e),++i[256];for(var u=Zn(i,15),p=u.t,d=u.l,f=Zn(s,15),y=f.t,g=f.l,M=xi(p),P=M.c,x=M.n,C=xi(y),w=C.c,v=C.n,S=new Ot(19),b=0;b<P.length;++b)++S[P[b]&31];for(var b=0;b<w.length;++b)++S[w[b]&31];for(var D=Zn(S,7),z=D.t,E=D.l,F=19;F>4&&!z[Gn[F-1]];--F);var N=c+5<<3,B=Fe(i,re)+Fe(s,Be)+o,A=Fe(i,p)+Fe(s,y)+o+14+3*F+Fe(S,z)+2*S[16]+3*S[17]+7*S[18];if(l>=0&&N<=B&&N<=A)return vi(t,h,r.subarray(l,l+c));var W,O,L,V;if(Qt(t,h,1+(A<B)),h+=2,A<B){W=Wt(p,d,0),O=p,L=Wt(y,g,0),V=y;var I=Wt(z,E,0);Qt(t,h,x-257),Qt(t,h+5,v-1),Qt(t,h+10,F-4),h+=14;for(var b=0;b<F;++b)Qt(t,h+3*b,z[Gn[b]]);h+=3*F;for(var R=[P,w],T=0;T<2;++T)for(var _=R[T],b=0;b<_.length;++b){var U=_[b]&31;Qt(t,h,I[U]),h+=z[U],U>15&&(Qt(t,h,_[b]>>5&127),h+=_[b]>>12)}}else W=ua,O=re,L=pa,V=Be;for(var b=0;b<a;++b){var $=n[b];if($>255){var U=$>>18&31;De(t,h,W[U+257]),h+=O[U+257],U>7&&(Qt(t,h,$>>23&31),h+=ln[U]);var q=$&31;De(t,h,L[q]),h+=V[q],q>3&&(De(t,h,$>>5&8191),h+=cn[q])}else De(t,h,W[$]),h+=O[$]}return De(t,h,W[256]),h+O[256]},ma=new jn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),bi=new ut(0),xa=function(r,t,e,n,i,s){var o=s.z||r.length,a=new ut(n+o+5*(1+Math.ceil(o/7e3))+i),l=a.subarray(n,a.length-i),c=s.l,h=(s.r||0)&7;if(t){h&&(l[0]=s.r>>3);for(var u=ma[t-1],p=u>>13,d=u&8191,f=(1<<e)-1,y=s.p||new Ot(32768),g=s.h||new Ot(f+1),M=Math.ceil(e/3),P=2*M,x=function(kt){return(r[kt]^r[kt+1]<<M^r[kt+2]<<P)&f},C=new jn(25e3),w=new Ot(288),v=new Ot(32),S=0,b=0,D=s.i||0,z=0,E=s.w||0,F=0;D+2<o;++D){var N=x(D),B=D&32767,A=g[N];if(y[B]=A,g[N]=B,E<=D){var W=o-D;if((S>7e3||z>24576)&&(W>423||!c)){h=wi(r,l,0,C,w,v,b,z,F,D-F,h),z=S=b=0,F=D;for(var O=0;O<286;++O)w[O]=0;for(var O=0;O<30;++O)v[O]=0}var L=2,V=0,I=d,R=B-A&32767;if(W>2&&N==x(D-R))for(var T=Math.min(p,W)-1,_=Math.min(32767,D),U=Math.min(258,W);R<=_&&--I&&B!=A;){if(r[D+L]==r[D+L-R]){for(var $=0;$<U&&r[D+$]==r[D+$-R];++$);if($>L){if(L=$,V=R,$>T)break;for(var q=Math.min(R,$-2),X=0,O=0;O<q;++O){var nt=D-R+O&32767,Yt=y[nt],Dt=nt-Yt&32767;Dt>X&&(X=Dt,A=nt)}}}B=A,A=y[B],R+=B-A&32767}if(V){C[z++]=268435456|qn[L]<<18|yi[V];var Mt=qn[L]&31,Tt=yi[V]&31;b+=ln[Mt]+cn[Tt],++w[257+Mt],++v[Tt],E=D+L,++S}else C[z++]=r[D],++w[r[D]]}}for(D=Math.max(D,E);D<o;++D)C[z++]=r[D],++w[r[D]];h=wi(r,l,c,C,w,v,b,z,F,D-F,h),c||(s.r=h&7|l[h/8|0]<<3,h-=7,s.h=g,s.p=y,s.i=D,s.w=E)}else{for(var D=s.w||0;D<o+c;D+=65535){var ht=D+65535;ht>=o&&(l[h/8|0]=c,ht=o),h=vi(l,h+1,r.subarray(D,ht))}s.i=o}return mi(a,0,n+Yn(h)+i)},Si=function(){var r=1,t=0;return{p:function(e){for(var n=r,i=t,s=e.length|0,o=0;o!=s;){for(var a=Math.min(o+2655,s);o<a;++o)i+=n+=e[o];n=(n&65535)+15*(n>>16),i=(i&65535)+15*(i>>16)}r=n,t=i},d:function(){return r%=65521,t%=65521,(r&255)<<24|(r&65280)<<8|(t&255)<<8|t>>8}}},va=function(r,t,e,n,i){if(!i&&(i={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),o=new ut(s.length+r.length);o.set(s),o.set(r,s.length),r=o,i.w=s.length}return xa(r,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(r.length)))*1.5):20:12+t.mem,e,n,i)},Ci=function(r,t,e){for(;e;++t)r[t]=e,e>>>=8},wa=function(r,t){var e=t.level,n=e==0?0:e<6?1:e==9?3:2;if(r[0]=120,r[1]=n<<6|(t.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,t.dictionary){var i=Si();i.p(t.dictionary),Ci(r,2,i.d())}},ba=function(r,t){return((r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31)&&$t(6,"invalid zlib data"),(r[1]>>5&1)==1&&$t(6,"invalid zlib data: "+(r[1]&32?"need":"unexpected")+" dictionary"),(r[1]>>3&4)+2};function Sa(r,t){t||(t={});var e=Si();e.p(r);var n=va(r,t,t.dictionary?6:2,4);return wa(n,t),Ci(n,n.length-4,e.d()),n}function Ca(r,t){return ya(r.subarray(ba(r),-4),{i:2},t,t)}var Ma=typeof TextDecoder<"u"&&new TextDecoder,Pa=0;try{Ma.decode(bi,{stream:!0}),Pa=1}catch{}const _a="modern-font";function Ue(r,t){if(!r)throw new Error(`[${_a}] ${t}`)}function Ta(r){if("buffer"in r){const t=r.buffer;return r.byteOffset>0||r.byteLength<r.buffer.byteLength?t.slice(r.byteOffset,r.byteOffset+r.byteLength):t}else return r}function xe(r){return"buffer"in r?new DataView(r.buffer,r.byteOffset,r.byteLength):new DataView(r)}function ka(r){let t="";for(let e=0,n=r.length,i;e<n;e++)i=r.charCodeAt(e),i!==0&&(t+=String.fromCharCode(i));return t}function hn(r){r=ka(r);const t=[];for(let e=0,n=r.length,i;e<n;e++)i=r.charCodeAt(e),t.push(i>>8),t.push(i&255);return t}function Aa(r){let t="";for(let e=0,n=r.length;e<n;e++)r[e]<127?t+=String.fromCharCode(r[e]):t+=`%${(256+r[e]).toString(16).slice(1)}`;return unescape(t)}function Oa(r){let t="";for(let e=0,n=r.length;e<n;e+=2)t+=String.fromCharCode((r[e]<<8)+r[e+1]);return t}var Ia=Object.defineProperty,ft=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Ia(t,e,i),i};const un={int8:1,int16:2,int32:4,uint8:1,uint16:2,uint32:4,float32:4,float64:8,fixed:4,longDateTime:8,char:1};function pt(){return function(r,t){Object.defineProperty(r.constructor.prototype,t,{get(){if(typeof t=="string"){if(t.startsWith("read"))return(...e)=>this.read(t.substring(4).toLowerCase(),...e);if(t.startsWith("write"))return(...e)=>this.write(t.substring(5).toLowerCase(),...e)}},configurable:!0,enumerable:!0})}}class lt extends DataView{constructor(t,e,n,i){super(Ta(t),e,n),this.littleEndian=i}cursor=0;readColumn(t){if(t.size){const e=Array.from({length:t.size},(n,i)=>this.read(t.type,t.offset+i));return t.type==="char"?e.join(""):e}else return this.read(t.type,t.offset)}writeColumn(t,e){t.size?Array.from({length:t.size},(n,i)=>{this.write(t.type,e[i],t.offset+i)}):this.write(t.type,e,t.offset)}read(t,e=this.cursor,n=this.littleEndian){switch(t){case"char":return this.readChar(e);case"fixed":return this.readFixed(e,n);case"longDateTime":return this.readLongDateTime(e,n)}const i=`get${t.replace(/^\S/,l=>l.toUpperCase())}`,s=this,a=s[i]?.bind(s)?.(e,n);return this.cursor+=un[t],a}readUint24(t=this.cursor){const[e,n,i]=this.readBytes(t,3);return(e<<16)+(n<<8)+i}readBytes(t,e){e==null&&(e=t,t=this.cursor);const n=[];for(let i=0;i<e;++i)n.push(this.getUint8(t+i));return this.cursor=t+e,n}readString(t,e){const n=this.readBytes(t,e);let i="";for(let s=0,o=n.length;s<o;s++)i+=String.fromCharCode(n[s]);return i}readFixed(t,e){const n=this.readInt32(t,e)/65536;return Math.ceil(n*1e5)/1e5}readLongDateTime(t=this.cursor,e){const n=this.readUint32(t+4,e),i=new Date;return i.setTime(n*1e3+-20775456e5),i}readChar(t){return this.readString(t,1)}write(t,e,n=this.cursor,i=this.littleEndian){switch(t){case"char":return this.writeChar(e,n);case"fixed":return this.writeFixed(e,n);case"longDateTime":return this.writeLongDateTime(e,n)}const s=`set${t.replace(/^\S/,c=>c.toUpperCase())}`,o=this,l=o[s]?.bind(o)?.(n,e,i);return this.cursor+=un[t.toLowerCase()],l}writeString(t="",e=this.cursor){const n=t.replace(/[^\x00-\xFF]/g,"11").length;this.seek(e);for(let i=0,s=t.length,o;i<s;++i)o=t.charCodeAt(i)||0,o>127?this.writeUint16(o):this.writeUint8(o);return this.cursor+=n,this}writeChar(t,e){return this.writeString(t,e)}writeFixed(t,e){return this.writeInt32(Math.round(t*65536),e),this}writeLongDateTime(t,e=this.cursor){typeof t>"u"?t=-20775456e5:typeof t.getTime=="function"?t=t.getTime():/^\d+$/.test(t)?t=+t:t=Date.parse(t);const i=Math.round((t- -20775456e5)/1e3);return this.writeUint32(0,e),this.writeUint32(i,e+4),this}writeBytes(t,e=this.cursor){let n;if(Array.isArray(t)){n=t.length;for(let i=0;i<n;++i)this.setUint8(e+i,t[i])}else{const i=xe(t);n=i.byteLength;for(let s=0;s<n;++s)this.setUint8(e+s,i.getUint8(s))}return this.cursor=e+n,this}seek(t){return this.cursor=t,this}}ft([pt()],lt.prototype,"readInt8"),ft([pt()],lt.prototype,"readInt16"),ft([pt()],lt.prototype,"readInt32"),ft([pt()],lt.prototype,"readUint8"),ft([pt()],lt.prototype,"readUint16"),ft([pt()],lt.prototype,"readUint32"),ft([pt()],lt.prototype,"readFloat32"),ft([pt()],lt.prototype,"readFloat64"),ft([pt()],lt.prototype,"writeInt8"),ft([pt()],lt.prototype,"writeInt16"),ft([pt()],lt.prototype,"writeInt32"),ft([pt()],lt.prototype,"writeUint8"),ft([pt()],lt.prototype,"writeUint16"),ft([pt()],lt.prototype,"writeUint32"),ft([pt()],lt.prototype,"writeFloat32"),ft([pt()],lt.prototype,"writeFloat64");const Mi=new WeakMap;function m(r){const t=typeof r=="object"?r:{type:r},{size:e=1,type:n}=t;return(i,s)=>{if(typeof s!="string")return;let o=Mi.get(i);o||(o={columns:[],byteLength:0},Mi.set(i,o));const a={...t,name:s,byteLength:e*un[n],offset:t.offset??o.columns.reduce((l,c)=>l+c.byteLength,0)};o.columns.push(a),o.byteLength=o.columns.reduce((l,c)=>l+un[c.type]*(c.size??1),0),Object.defineProperty(i.constructor.prototype,s,{get(){return this.view.readColumn(a)},set(l){this.view.writeColumn(a,l)},configurable:!0,enumerable:!0})}}class Bt{view;constructor(t,e,n,i){this.view=new lt(t,e,n,i)}}class Qn extends Bt{get buffer(){return this.view.buffer}toBuffer(){return this.view.buffer.slice(this.view.byteOffset,this.view.byteOffset+this.view.byteLength)}toBlob(){return new Blob([new Uint8Array(this.view.buffer,this.view.byteOffset,this.view.byteLength)],{type:this.mimeType})}toFontFace(t){return new FontFace(t,this.view.buffer)}}var Ea=Object.defineProperty,wt=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Ea(t,e,i),i};const bt=class Ki extends Qn{format="EmbeddedOpenType";mimeType="application/vnd.ms-fontobject";static from(t){const e=t.sfnt,i=e.name.names,s=hn(i.fontFamily||""),o=s.length,a=hn(i.fontStyle||""),l=a.length,c=hn(i.version||""),h=c.length,u=hn(i.fullName||""),p=u.length,d=86+o+4+l+4+h+4+p+2+t.view.byteLength,f=new Ki(new ArrayBuffer(d),0,d,!0);f.EOTSize=f.view.byteLength,f.FontDataSize=t.view.byteLength,f.Version=131073,f.Flags=0,f.Charset=1,f.MagicNumber=20556,f.Padding1=0,f.CheckSumAdjustment=e.head.checkSumAdjustment;const y=e.os2;return y&&(f.FontPANOSE=y.fontPANOSE,f.Italic=y.fsSelection,f.Weight=y.usWeightClass,f.fsType=y.fsType,f.UnicodeRange=y.ulUnicodeRange,f.CodePageRange=y.ulCodePageRange),f.view.writeUint16(o),f.view.writeBytes(s),f.view.writeUint16(0),f.view.writeUint16(l),f.view.writeBytes(a),f.view.writeUint16(0),f.view.writeUint16(h),f.view.writeBytes(c),f.view.writeUint16(0),f.view.writeUint16(p),f.view.writeBytes(u),f.view.writeUint16(0),f.view.writeUint16(0),f.view.writeBytes(t.view),f}};wt([m("uint32")],bt.prototype,"EOTSize"),wt([m("uint32")],bt.prototype,"FontDataSize"),wt([m("uint32")],bt.prototype,"Version"),wt([m("uint32")],bt.prototype,"Flags"),wt([m({type:"uint8",size:10})],bt.prototype,"FontPANOSE"),wt([m("uint8")],bt.prototype,"Charset"),wt([m("uint8")],bt.prototype,"Italic"),wt([m("uint32")],bt.prototype,"Weight"),wt([m("uint16")],bt.prototype,"fsType"),wt([m("uint16")],bt.prototype,"MagicNumber"),wt([m({type:"uint8",size:16})],bt.prototype,"UnicodeRange"),wt([m({type:"uint8",size:8})],bt.prototype,"CodePageRange"),wt([m("uint32")],bt.prototype,"CheckSumAdjustment"),wt([m({type:"uint8",size:16})],bt.prototype,"Reserved"),wt([m("uint16")],bt.prototype,"Padding1");var Ba=Object.defineProperty,fn=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Ba(t,e,i),i};class Le extends Bt{constructor(t,e){super(t,e,16)}}fn([m({type:"char",size:4})],Le.prototype,"tag"),fn([m("uint32")],Le.prototype,"checkSum"),fn([m("uint32")],Le.prototype,"offset"),fn([m("uint32")],Le.prototype,"length");const Jn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],Da=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"];class Pi{index;name;isComposite=!1;components=[];pathCommands=[];constructor(t){const e={...t};if(this.index=e.index??0,e.name===".notdef"?e.unicode=void 0:e.name===".null"&&(e.unicode=0),e.unicode===0&&e.name!==".null")throw new Error('The unicode value "0" is reserved for the glyph name ".null" and cannot be used by any other glyph.');this.name=e.name??null,e.unicode&&(this.unicode=e.unicode),e.unicodes?this.unicodes=e.unicodes:e.unicode&&(this.unicodes=[e.unicode])}getPathCommands(t=0,e=0,n=72,i={},s){const o=1/(s?.unitsPerEm??1e3)*n,{xScale:a=o,yScale:l=o}=i,c=this.pathCommands,h=[];for(let u=0,p=c.length;u<p;u+=1){const d=c[u];d.type==="M"?h.push({type:"M",x:t+d.x*a,y:e+-d.y*l}):d.type==="L"?h.push({type:"L",x:t+d.x*a,y:e+-d.y*l}):d.type==="Q"?h.push({type:"Q",x1:t+d.x1*a,y1:e+-d.y1*l,x:t+d.x*a,y:e+-d.y*l}):d.type==="C"?h.push({type:"C",x1:t+d.x1*a,y1:e+-d.y1*l,x2:t+d.x2*a,y2:e+-d.y2*l,x:t+d.x*a,y:e+-d.y*l}):d.type==="Z"&&h.push({type:"Z"})}return h}}class Fa extends Pi{parse(t,e,n){const i=this,{nominalWidthX:s,defaultWidthX:o,gsubrsBias:a,subrsBias:l}=t,c=t.topDict.paintType,h=this.index;let u,p,d,f;const y=[],g=[];let M=0,P=!1,x=!1,C=o,w=0,v=0;function S(B,A){y.push({type:"L",x:B,y:A})}function b(B,A,W,O,L,V){y.push({type:"C",x1:B,y1:A,x2:W,y2:O,x:L,y:V})}function D(B,A){x&&c!==2&&z(),x=!0,y.push({type:"M",x:B,y:A})}function z(){y.push({type:"Z"})}function E(B){y.push(...B)}function F(){g.length%2!==0&&!P&&(C=g.shift()+s),M+=g.length>>1,g.length=0,P=!0}function N(B){let A,W,O,L,V,I,R,T,_,U,$,q,X=0;for(;X<B.length;){let nt=B[X++];switch(nt){case 1:F();break;case 3:F();break;case 4:g.length>1&&!P&&(C=g.shift()+s,P=!0),v+=g.pop(),D(w,v);break;case 5:for(;g.length>0;)w+=g.shift(),v+=g.shift(),S(w,v);break;case 6:for(;g.length>0&&(w+=g.shift(),S(w,v),g.length!==0);)v+=g.shift(),S(w,v);break;case 7:for(;g.length>0&&(v+=g.shift(),S(w,v),g.length!==0);)w+=g.shift(),S(w,v);break;case 8:for(;g.length>0;)u=w+g.shift(),p=v+g.shift(),d=u+g.shift(),f=p+g.shift(),w=d+g.shift(),v=f+g.shift(),b(u,p,d,f,w,v);break;case 10:V=g.pop()+l,I=t.subrs[V],I&&N(I);break;case 11:return;case 12:switch(nt=B[X],X+=1,nt){case 35:u=w+g.shift(),p=v+g.shift(),d=u+g.shift(),f=p+g.shift(),R=d+g.shift(),T=f+g.shift(),_=R+g.shift(),U=T+g.shift(),$=_+g.shift(),q=U+g.shift(),w=$+g.shift(),v=q+g.shift(),g.shift(),b(u,p,d,f,R,T),b(_,U,$,q,w,v);break;case 34:u=w+g.shift(),p=v,d=u+g.shift(),f=p+g.shift(),R=d+g.shift(),T=f,_=R+g.shift(),U=f,$=_+g.shift(),q=v,w=$+g.shift(),b(u,p,d,f,R,T),b(_,U,$,q,w,v);break;case 36:u=w+g.shift(),p=v+g.shift(),d=u+g.shift(),f=p+g.shift(),R=d+g.shift(),T=f,_=R+g.shift(),U=f,$=_+g.shift(),q=U+g.shift(),w=$+g.shift(),b(u,p,d,f,R,T),b(_,U,$,q,w,v);break;case 37:u=w+g.shift(),p=v+g.shift(),d=u+g.shift(),f=p+g.shift(),R=d+g.shift(),T=f+g.shift(),_=R+g.shift(),U=T+g.shift(),$=_+g.shift(),q=U+g.shift(),Math.abs($-w)>Math.abs(q-v)?w=$+g.shift():v=q+g.shift(),b(u,p,d,f,R,T),b(_,U,$,q,w,v);break;default:console.warn(`Glyph ${h}: unknown operator ${1200+nt}`),g.length=0}break;case 14:if(g.length>=4){const Yt=Jn[g.pop()],Dt=Jn[g.pop()],Mt=g.pop(),Tt=g.pop();if(Yt&&Dt){i.isComposite=!0,i.components=[];const ht=t.charset.indexOf(Yt),kt=t.charset.indexOf(Dt);i.components.push({glyphIndex:kt,dx:0,dy:0}),i.components.push({glyphIndex:ht,dx:Tt,dy:Mt}),E(n.get(kt).pathCommands);const Rt=JSON.parse(JSON.stringify(n.get(ht).pathCommands));for(let Vt=0;Vt<Rt.length;Vt+=1){const Ft=Rt[Vt];Ft.type!=="Z"&&(Ft.x+=Tt,Ft.y+=Mt),(Ft.type==="Q"||Ft.type==="C")&&(Ft.x1+=Tt,Ft.y1+=Mt),Ft.type==="C"&&(Ft.x2+=Tt,Ft.y2+=Mt)}E(Rt)}}else g.length>0&&!P&&(C=g.shift()+s,P=!0);x&&c!==2&&(z(),x=!1);break;case 18:F();break;case 19:case 20:F(),X+=M+7>>3;break;case 21:g.length>2&&!P&&(C=g.shift()+s,P=!0),v+=g.pop(),w+=g.pop(),D(w,v);break;case 22:g.length>1&&!P&&(C=g.shift()+s,P=!0),w+=g.pop(),D(w,v);break;case 23:F();break;case 24:for(;g.length>2;)u=w+g.shift(),p=v+g.shift(),d=u+g.shift(),f=p+g.shift(),w=d+g.shift(),v=f+g.shift(),b(u,p,d,f,w,v);w+=g.shift(),v+=g.shift(),S(w,v);break;case 25:for(;g.length>6;)w+=g.shift(),v+=g.shift(),S(w,v);u=w+g.shift(),p=v+g.shift(),d=u+g.shift(),f=p+g.shift(),w=d+g.shift(),v=f+g.shift(),b(u,p,d,f,w,v);break;case 26:for(g.length%2&&(w+=g.shift());g.length>0;)u=w,p=v+g.shift(),d=u+g.shift(),f=p+g.shift(),w=d,v=f+g.shift(),b(u,p,d,f,w,v);break;case 27:for(g.length%2&&(v+=g.shift());g.length>0;)u=w+g.shift(),p=v,d=u+g.shift(),f=p+g.shift(),w=d+g.shift(),v=f,b(u,p,d,f,w,v);break;case 28:A=B[X],W=B[X+1],g.push((A<<24|W<<16)>>16),X+=2;break;case 29:V=g.pop()+a,I=t.gsubrs[V],I&&N(I);break;case 30:for(;g.length>0&&(u=w,p=v+g.shift(),d=u+g.shift(),f=p+g.shift(),w=d+g.shift(),v=f+(g.length===1?g.shift():0),b(u,p,d,f,w,v),g.length!==0);)u=w+g.shift(),p=v,d=u+g.shift(),f=p+g.shift(),v=f+g.shift(),w=d+(g.length===1?g.shift():0),b(u,p,d,f,w,v);break;case 31:for(;g.length>0&&(u=w+g.shift(),p=v,d=u+g.shift(),f=p+g.shift(),v=f+g.shift(),w=d+(g.length===1?g.shift():0),b(u,p,d,f,w,v),g.length!==0);)u=w,p=v+g.shift(),d=u+g.shift(),f=p+g.shift(),w=d+g.shift(),v=f+(g.length===1?g.shift():0),b(u,p,d,f,w,v);break;default:nt<32?console.warn(`Glyph ${h}: unknown operator ${nt}`):nt<247?g.push(nt-139):nt<251?(A=B[X],X+=1,g.push((nt-247)*256+A+108)):nt<255?(A=B[X],X+=1,g.push(-(nt-251)*256-A-108)):(A=B[X],W=B[X+1],O=B[X+2],L=B[X+3],X+=4,g.push((A<<24|W<<16|O<<8|L)/65536))}}}N(e),this.pathCommands=y,P&&(this.advanceWidth=C)}}class _i{constructor(t){this._sfnt=t}_items=[];get(t){const e=this._items[t];let n;if(e)n=e;else{n=this._get(t);const i=this._sfnt.hmtx.metrics[t];i&&(n.advanceWidth=n.advanceWidth||i.advanceWidth,n.leftSideBearing=n.leftSideBearing||i.leftSideBearing);const s=this._sfnt.cmap.glyphIndexToUnicodesMap.get(t);s&&(n.unicode??=s[0],n.unicodes??=s),this._items[t]=n}return n}}class Ua extends _i{get length(){return this._sfnt.cff.charStringsIndex.offsets.length-1}_get(t){const e=this._sfnt.cff,n=new Fa({index:t});return n.parse(e,e.charStringsIndex.get(t),this),n.name=e.charset[t],n}}var La=Object.defineProperty,Ti=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&La(t,e,i),i};class pn extends Bt{_offsets;get offsets(){return this._offsets??=this.readOffsets()}_objects;get objects(){return this._objects??=this.readObjects()}constructor(t,e,n,i){super(t,e,n,i),this._init()}_init(){const t=this.view,e=this.count,n=this.offsetSize;this.objectOffset=(e+1)*n+2,this.endOffset=t.byteOffset+this.objectOffset+this.offsets[e]}readOffsets(){const t=this.view,e=this.count,n=this.offsetSize;t.seek(3);const i=[];for(let s=0,o=e+1;s<o;s++){const a=this.view;let l=0;for(let c=0;c<n;c++)l<<=8,l+=a.readUint8();i.push(l)}return i}readObjects(){const t=[];for(let e=0,n=this.count;e<n;e++)t.push(this.get(e));return t}get(t){const e=this.offsets,n=this.objectOffset,i=n+e[t],o=n+e[t+1]-i;return this._isString?this.view.readString(i,o):this.view.readBytes(i,o)}}Ti([m("uint16")],pn.prototype,"count"),Ti([m("uint8")],pn.prototype,"offsetSize");class dn extends pn{_isString=!1}class ki extends pn{_isString=!0}const $a=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],Na=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron"],za=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],Ra=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"];function gn(r,t){return t<=390?$a[t]:r[t-391]}function J(r,t="number",e){return(n,i)=>{if(typeof i!="string")return;const s={type:t,operator:r,default:e??t==="number"?0:void 0};Object.defineProperty(n.constructor.prototype,i,{get(){return this._getProp(s)},set(o){this._setProp(s,o)},configurable:!0,enumerable:!0})}}class Ai extends Bt{_dict;get dict(){return this._dict??=this._readDict()}_stringIndex;setStringIndex(t){return this._stringIndex=t,this}_readFloatOperand(){const t=this.view;let e="";const n=15,i=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];for(;;){const s=t.readUint8(),o=s>>4,a=s&15;if(o===n||(e+=i[o],a===n))break;e+=i[a]}return Number.parseFloat(e)}_readOperand(t){const e=this.view;let n,i,s,o;if(t===28)return n=e.readUint8(),i=e.readUint8(),n<<8|i;if(t===29)return n=e.readUint8(),i=e.readUint8(),s=e.readUint8(),o=e.readUint8(),n<<24|i<<16|s<<8|o;if(t===30)return this._readFloatOperand();if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return n=e.readUint8(),(t-247)*256+n+108;if(t>=251&&t<=254)return n=e.readUint8(),-(t-251)*256-n-108;throw new Error(`invalid b0 ${t}, at: ${e.cursor}`)}_readDict(){const t=this.view;t.seek(0);let e=[];const n=t.cursor+t.byteLength,i={};for(;t.cursor<n;){let s=t.readUint8();s<=21?(s===12&&(s=1200+t.readUint8()),i[s]=e,e=[]):e.push(this._readOperand(s))}return i}_getProp(t){const e=this.dict[t.operator]??t.default;switch(t.type){case"number":return e[0];case"string":return gn(this._stringIndex?.objects??[],e[0]);case"number[]":return e}return e}_setProp(t,e){}}var Va=Object.defineProperty,tr=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Va(t,e,i),i};class yn extends Ai{}tr([J(19)],yn.prototype,"subrs"),tr([J(20)],yn.prototype,"defaultWidthX"),tr([J(21)],yn.prototype,"nominalWidthX");var ja=Object.defineProperty,it=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&ja(t,e,i),i};class et extends Ai{}it([J(0,"string")],et.prototype,"version"),it([J(1,"string")],et.prototype,"notice"),it([J(1200,"string")],et.prototype,"copyright"),it([J(2,"string")],et.prototype,"fullName"),it([J(3,"string")],et.prototype,"familyName"),it([J(4,"string")],et.prototype,"weight"),it([J(1201)],et.prototype,"isFixedPitch"),it([J(1202)],et.prototype,"italicAngle"),it([J(1203,"number",-100)],et.prototype,"underlinePosition"),it([J(1204,"number",50)],et.prototype,"underlineThickness"),it([J(1205)],et.prototype,"paintType"),it([J(1206,"number",2)],et.prototype,"charstringType"),it([J(1207,"number[]",[.001,0,0,.001,0,0])],et.prototype,"fontMatrix"),it([J(13)],et.prototype,"uniqueId"),it([J(5,"number[]",[0,0,0,0])],et.prototype,"fontBBox"),it([J(1208)],et.prototype,"strokeWidth"),it([J(14)],et.prototype,"xuid"),it([J(15)],et.prototype,"charset"),it([J(16)],et.prototype,"encoding"),it([J(17)],et.prototype,"charStrings"),it([J(18,"number[]",[0,0])],et.prototype,"private");function dt(r,t=r){return e=>{Jt.tableDefinitions.set(r,{tag:r,prop:t,class:e}),Object.defineProperty(Jt.prototype,t,{get(){return this.get(r)},set(n){return this.set(r,n)},configurable:!0,enumerable:!0})}}class Jt{static tableDefinitions=new Map;tables=new Map;tableViews=new Map;get hasGlyf(){return this.tableViews.has("glyf")}get names(){return this.name.names}get unitsPerEm(){return this.head.unitsPerEm}get ascender(){return this.hhea.ascent}get descender(){return this.hhea.descent}get createdTimestamp(){return this.head.created}get modifiedTimestamp(){return this.head.modified}get numGlyphs(){return this.maxp.numGlyphs}get unicodes(){return this.cmap.glyphIndexToUnicodesMap}get glyphs(){return this.hasGlyf?this.glyf.glyphs:this.cff.glyphs}charToGlyphIndex(t){let e=this.cmap.unicodeToGlyphIndexMap.get(t.codePointAt(0));if(e===void 0&&!this.hasGlyf){const{encoding:n,charset:i}=this.cff;e=i.indexOf(n[t.codePointAt(0)])}return e??0}charToGlyph(t){return this.glyphs.get(this.charToGlyphIndex(t))}textToGlyphIndexes(t){const e=[];for(const n of t)e.push(this.charToGlyphIndex(n));return e}textToGlyphs(t){const e=this.glyphs,n=this.textToGlyphIndexes(t),i=n.length,s=Array.from({length:i}),o=e.get(0);for(let a=0;a<i;a+=1)s[a]=e.get(n[a])||o;return s}getPathCommands(t,e,n,i,s){const o=[];return this.forEachGlyph(t,e,n,i,s,(a,l,c,h,u)=>{o.push(...a.getPathCommands(l,c,h,u,this))}),o}getAdvanceWidth(t,e,n){return this.forEachGlyph(t,0,0,e,n,()=>{})}forEachGlyph(t,e=0,n=0,i=72,s={},o){const a=1/this.unitsPerEm*i,l=this.textToGlyphs(t);for(let c=0;c<l.length;c+=1){const h=l[c];o.call(this,h,e,n,i,s),h.advanceWidth&&(e+=h.advanceWidth*a),s.letterSpacing?e+=s.letterSpacing*i:s.tracking&&(e+=s.tracking/1e3*i)}return e}constructor(t){(t instanceof Map?t:new Map(Object.entries(t))).forEach((n,i)=>{this.tableViews.set(i,new DataView(n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength)))})}clone(){return new Jt(this.tableViews)}delete(t){const e=Jt.tableDefinitions.get(t);return e?(this.tableViews.delete(t),this.tables.delete(e.prop),this):this}set(t,e){const n=Jt.tableDefinitions.get(t);return n&&this.tables.set(n.prop,e),this.tableViews.set(t,e.view),this}get(t){const e=Jt.tableDefinitions.get(t);if(!e)return;let n=this.tables.get(e.prop);if(!n){const i=e.class;if(i){const s=this.tableViews.get(t);if(!s)return;n=new i(s.buffer,s.byteOffset,s.byteLength).setSFNT(this),this.tables.set(e.prop,n)}}return n}}class gt extends Bt{setSFNT(t){return this._sfnt=t,this}getSFNT(){return this._sfnt}}var Ga=Object.defineProperty,qa=Object.getOwnPropertyDescriptor,$e=(r,t,e,n)=>{for(var i=n>1?void 0:n?qa(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(t,e,i):o(i))||i);return n&&i&&Ga(t,e,i),i};let ve=class extends gt{_glyphs;get glyphs(){return this._glyphs??=new Ua(this._sfnt)}get gsubrs(){return this.globalSubrIndex.objects}get gsubrsBias(){return this._calcSubroutineBias(this.globalSubrIndex.objects)}privateDict;subrsIndex;get defaultWidthX(){return this.privateDict?.defaultWidthX??0}get nominalWidthX(){return this.privateDict?.nominalWidthX??0}get subrs(){return this.subrsIndex?.objects??[]}get subrsBias(){return this._calcSubroutineBias(this.subrs)}constructor(r,t,e,n){super(r,t,e,n),this._init()}_init(){const r=this.view,{buffer:t,byteOffset:e}=r,n=e+4;this.nameIndex=new ki(t,n),this.topDictIndex=new dn(t,this.nameIndex.endOffset),this.stringIndex=new ki(t,this.topDictIndex.endOffset),this.globalSubrIndex=new dn(t,this.stringIndex.endOffset),this.topDict=new et(new Uint8Array(this.topDictIndex.objects[0]).buffer).setStringIndex(this.stringIndex);const i=this.topDict.private[0],s=this.topDict.private[1];i&&(this.privateDict=new yn(t,e+s,i).setStringIndex(this.stringIndex),this.privateDict.subrs&&(this.subrsIndex=new dn(t,e+s+this.privateDict.subrs))),this.charStringsIndex=new dn(t,e+this.topDict.charStrings);const o=this.charStringsIndex.offsets.length-1;this.topDict.charset===0?this.charset=Na:this.topDict.charset===1?this.charset=za:this.topDict.charset===2?this.charset=Ra:this.charset=this._readCharset(e+this.topDict.charset,o,this.stringIndex.objects),this.topDict.encoding===0?this.encoding=Jn:this.topDict.encoding===1?this.encoding=Da:this.encoding=this._readEncoding(e+this.topDict.encoding)}_readCharset(r,t,e){const n=this.view;n.seek(r);let i,s,o;t-=1;const a=[".notdef"],l=n.readUint8();if(l===0)for(i=0;i<t;i+=1)s=n.readUint16(),a.push(gn(e,s));else if(l===1)for(;a.length<=t;)for(s=n.readUint16(),o=n.readUint8(),i=0;i<=o;i+=1)a.push(gn(e,s)),s+=1;else if(l===2)for(;a.length<=t;)for(s=n.readUint16(),o=n.readUint16(),i=0;i<=o;i+=1)a.push(gn(e,s)),s+=1;else throw new Error(`Unknown charset format ${l}`);return a}_readEncoding(r){const t=this.view;t.seek(r);let e,n;const i={},s=t.readUint8();if(s===0){const o=t.readUint8();for(e=0;e<o;e+=1)n=t.readUint8(),i[n]=e}else if(s===1){const o=t.readUint8();for(n=1,e=0;e<o;e+=1){const a=t.readUint8(),l=t.readUint8();for(let c=a;c<=a+l;c+=1)i[c]=n,n+=1}}else console.warn(`unknown encoding format:${s}`);return i}_calcSubroutineBias(r){let t;return r.length<1240?t=107:r.length<33900?t=1131:t=32768,t}};$e([m("uint8")],ve.prototype,"majorVersion",2),$e([m("uint8")],ve.prototype,"minorVersion",2),$e([m("uint8")],ve.prototype,"headerSize",2),$e([m("uint8")],ve.prototype,"offsetSize",2),ve=$e([dt("CFF ","cff")],ve);var Wa=Object.defineProperty,mn=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Wa(t,e,i),i};const Ne=class Qi extends Bt{constructor(t=new ArrayBuffer(262),e){super(t,e,262)}static from(t){const e=new Qi;return e.format=0,e.length=e.view.byteLength,e.language=0,t.forEach((n,i)=>{i<256&&n<256&&e.view.writeUint8(n,6+i)}),e}getUnicodeToGlyphIndexMap(){const t=new Map;return this.glyphIndexArray.forEach((e,n)=>{t.set(n,e)}),t}};mn([m("uint16")],Ne.prototype,"format"),mn([m("uint16")],Ne.prototype,"length"),mn([m("uint16")],Ne.prototype,"language"),mn([m({type:"uint8",size:256})],Ne.prototype,"glyphIndexArray");let Oi=Ne;var Ha=Object.defineProperty,er=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Ha(t,e,i),i};class xn extends Bt{get subHeaderKeys(){return this.view.seek(6),Array.from({length:256},()=>this.view.readUint16()/8)}get maxSubHeaderKey(){return this.subHeaderKeys.reduce((t,e)=>Math.max(t,e),0)}get subHeaders(){const t=this.maxSubHeaderKey;return this.view.seek(6+256*2),Array.from({length:t},(e,n)=>({firstCode:this.view.readUint16(),entryCount:this.view.readUint16(),idDelta:this.view.readUint16(),idRangeOffset:(this.view.readUint16()-(t-n)*8-2)/2}))}get glyphIndexArray(){const t=this.maxSubHeaderKey,e=6+256*2+t*8;this.view.seek(e);const n=(this.view.byteLength-e)/2;return Array.from({length:n},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(t){const e=new Map,n=this.subHeaderKeys,i=this.maxSubHeaderKey,s=this.subHeaders,o=this.glyphIndexArray,a=n.findIndex(c=>c===i);let l=0;for(let c=0;c<256;c++)if(n[c]===0)c>=a||c<s[0].firstCode||c>=s[0].firstCode+s[0].entryCount||s[0].idRangeOffset+(c-s[0].firstCode)>=o.length?l=0:(l=o[s[0].idRangeOffset+(c-s[0].firstCode)],l!==0&&(l=l+s[0].idDelta)),l!==0&&l<t&&e.set(c,l);else{const h=n[c];for(let u=0,p=s[h].entryCount;u<p;u++)if(s[h].idRangeOffset+u>=o.length?l=0:(l=o[s[h].idRangeOffset+u],l!==0&&(l=l+s[h].idDelta)),l!==0&&l<t){const d=(c<<8|u+s[h].firstCode)%65535;e.set(d,l)}}return e}}er([m("uint16")],xn.prototype,"format"),er([m("uint16")],xn.prototype,"length"),er([m("uint16")],xn.prototype,"language");function Ii(r){return r>32767?r-65536:r<-32767?r+65536:r}function Ei(r,t){let e;const n=[];let i={};return r.forEach((s,o)=>{t&&o>t||((!e||o!==e.unicode+1||s!==e.glyphIndex+1)&&(e?(i.end=e.unicode,n.push(i),i={start:o,startId:s,delta:Ii(s-o)}):(i.start=Number(o),i.startId=s,i.delta=Ii(s-o))),e={unicode:o,glyphIndex:s})}),e&&(i.end=e.unicode,n.push(i)),n}var Xa=Object.defineProperty,ue=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Xa(t,e,i),i};const ie=class Ji extends Bt{get endCode(){const t=this.segCountX2;return this.view.seek(14),Array.from({length:t/2},()=>this.view.readUint16())}set endCode(t){this.view.seek(14),t.forEach(e=>this.view.writeUint16(e))}get reservedPad(){return this.view.readUint16(14+this.segCountX2)}set reservedPad(t){this.view.writeUint16(t,14+this.segCountX2)}get startCode(){const t=this.segCountX2;return this.view.seek(14+t+2),Array.from({length:t/2},()=>this.view.readUint16())}set startCode(t){this.view.seek(14+this.segCountX2+2),t.forEach(e=>this.view.writeUint16(e))}get idDelta(){const t=this.segCountX2;return this.view.seek(14+t+2+t),Array.from({length:t/2},()=>this.view.readUint16())}set idDelta(t){const e=this.segCountX2;this.view.seek(14+e+2+e),t.forEach(n=>this.view.writeUint16(n))}get idRangeOffsetCursor(){const t=this.segCountX2;return 14+t+2+t*2}get idRangeOffset(){const t=this.segCountX2;return this.view.seek(this.idRangeOffsetCursor),Array.from({length:t/2},()=>this.view.readUint16())}set idRangeOffset(t){this.view.seek(this.idRangeOffsetCursor),t.forEach(e=>this.view.writeUint16(e))}get glyphIndexArrayCursor(){const t=this.segCountX2;return 14+t+2+t*3}get glyphIndexArray(){const t=this.glyphIndexArrayCursor;this.view.seek(t);const e=(this.view.byteLength-t)/2;return Array.from({length:e},()=>this.view.readUint16())}static from(t){const e=Ei(t,65535),n=e.length+1,i=Math.floor(Math.log(n)/Math.LN2),s=2*2**i,o=new Ji(new ArrayBuffer(24+e.length*8));return o.format=4,o.length=o.view.byteLength,o.language=0,o.segCountX2=n*2,o.searchRange=s,o.entrySelector=i,o.rangeShift=2*n-s,o.endCode=[...e.map(a=>a.end),65535],o.reservedPad=0,o.startCode=[...e.map(a=>a.start),65535],o.idDelta=[...e.map(a=>a.delta),1],o.idRangeOffset=Array.from({length:n},()=>0),o}getUnicodeToGlyphIndexMap(){const t=new Map,e=this.segCountX2/2,n=(this.glyphIndexArrayCursor-this.idRangeOffsetCursor)/2,i=this.startCode,s=this.endCode,o=this.idRangeOffset,a=this.idDelta,l=this.glyphIndexArray;for(let c=0;c<e;++c)for(let h=i[c],u=s[c];h<=u;++h)if(o[c]===0)t.set(h,(h+a[c])%65536);else{const p=c+o[c]/2+(h-i[c])-n,d=l[p];d!==0?t.set(h,(d+a[c])%65536):t.set(h,0)}return t.delete(65535),t}};ue([m("uint16")],ie.prototype,"format"),ue([m("uint16")],ie.prototype,"length"),ue([m("uint16")],ie.prototype,"language"),ue([m("uint16")],ie.prototype,"segCountX2"),ue([m("uint16")],ie.prototype,"searchRange"),ue([m("uint16")],ie.prototype,"entrySelector"),ue([m("uint16")],ie.prototype,"rangeShift");let Bi=ie;var Ya=Object.defineProperty,ze=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Ya(t,e,i),i};class we extends Bt{get glyphIndexArray(){return this.view.seek(12),Array.from({length:this.entryCount},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(){const t=this.glyphIndexArray,e=new Map;return t.forEach((n,i)=>{e.set(i,n)}),e}}ze([m("uint16")],we.prototype,"format"),ze([m("uint16")],we.prototype,"length"),ze([m("uint16")],we.prototype,"language"),ze([m("uint16")],we.prototype,"firstCode"),ze([m("uint16")],we.prototype,"entryCount");var Za=Object.defineProperty,Re=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Za(t,e,i),i};const be=class ts extends Bt{get groups(){const t=this.nGroups;return this.view.seek(16),Array.from({length:t},()=>({startCharCode:this.view.readUint32(),endCharCode:this.view.readUint32(),startGlyphCode:this.view.readUint32()}))}static from(t){const e=Ei(t),n=new ts(new ArrayBuffer(16+e.length*12));return n.format=12,n.reserved=0,n.length=n.view.byteLength,n.language=0,n.nGroups=e.length,e.forEach(i=>{n.view.writeUint32(i.start),n.view.writeUint32(i.end),n.view.writeUint32(i.startId)}),n}getUnicodeToGlyphIndexMap(){const t=new Map,e=this.groups;for(let n=0,i=e.length;n<i;n++){const s=e[n];let o=s.startGlyphCode,a=s.startCharCode;const l=s.endCharCode;for(;a<=l;)t.set(a++,o++)}return t}};Re([m("uint16")],be.prototype,"format"),Re([m("uint16")],be.prototype,"reserved"),Re([m("uint32")],be.prototype,"length"),Re([m("uint32")],be.prototype,"language"),Re([m("uint32")],be.prototype,"nGroups");let Di=be;var Ka=Object.defineProperty,nr=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Ka(t,e,i),i};class vn extends Bt{getVarSelectorRecords(){const t=this.numVarSelectorRecords;return this.view.seek(10),Array.from({length:t},()=>{const e={varSelector:this.view.readUint24(),defaultUVSOffset:this.view.readUint32(),unicodeValueRanges:[],nonDefaultUVSOffset:this.view.readUint32(),uVSMappings:[]};if(e.defaultUVSOffset){this.view.seek(e.defaultUVSOffset);const n=this.view.readUint32();e.unicodeValueRanges=Array.from({length:n},()=>({startUnicodeValue:this.view.readUint24(),additionalCount:this.view.readUint8()}))}if(e.nonDefaultUVSOffset){this.view.seek(e.nonDefaultUVSOffset);const n=this.view.readUint32();e.uVSMappings=Array.from({length:n},()=>({unicodeValue:this.view.readUint24(),glyphID:this.view.readUint16()}))}return e})}getUnicodeToGlyphIndexMap(){const t=new Map,e=this.getVarSelectorRecords();for(let n=0,i=e.length;n<i;n++){const{uVSMappings:s}=e[n];s.forEach(o=>{t.set(o.unicodeValue,o.glyphID)})}return t}}nr([m("uint16")],vn.prototype,"format"),nr([m("uint32")],vn.prototype,"length"),nr([m("uint32")],vn.prototype,"numVarSelectorRecords");var Qa=Object.defineProperty,Ja=Object.getOwnPropertyDescriptor,rr=(r,t,e,n)=>{for(var i=n>1?void 0:n?Ja(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(t,e,i):o(i))||i);return n&&i&&Qa(t,e,i),i};let Ve=class extends gt{static from(r){const t=Array.from(r.keys()).some(h=>h>65535),e=Bi.from(r),n=Oi.from(r),i=t?Di.from(r):void 0,s=4+(i?32:24),o=s+e.view.byteLength,a=o+n.view.byteLength,l=[{platformID:0,platformSpecificID:3,offset:s},{platformID:1,platformSpecificID:0,offset:o},{platformID:3,platformSpecificID:1,offset:s},i&&{platformID:3,platformSpecificID:10,offset:a}].filter(Boolean),c=new Ve(new ArrayBuffer(4+8*l.length+e.view.byteLength+n.view.byteLength+(i?.view.byteLength??0)));return c.numberSubtables=l.length,c.view.seek(4),l.forEach(h=>{c.view.writeUint16(h.platformID),c.view.writeUint16(h.platformSpecificID),c.view.writeUint32(h.offset)}),c.view.writeBytes(e.view,s),c.view.writeBytes(n.view,o),i&&c.view.writeBytes(i.view,a),c}_unicodeToGlyphIndexMap;get unicodeToGlyphIndexMap(){return this._unicodeToGlyphIndexMap??=this.readunicodeToGlyphIndexMap()}_glyphIndexToUnicodesMap;get glyphIndexToUnicodesMap(){if(!this._glyphIndexToUnicodesMap){const r=new Map,t=this.unicodeToGlyphIndexMap,e=Array.from(t.keys());for(let n=0,i=e.length;n<i;n++){const s=e[n],o=t.get(s);r.has(o)?r.get(o).push(s):r.set(o,[s])}this._glyphIndexToUnicodesMap=r}return this._glyphIndexToUnicodesMap}readSubtables(){const r=this.numberSubtables;return this.view.seek(4),Array.from({length:r},()=>({platformID:this.view.readUint16(),platformSpecificID:this.view.readUint16(),offset:this.view.readUint32()})).map(t=>{this.view.seek(t.offset);const e=this.view.readUint16();let n;switch(e){case 0:n=new Oi(this.view.buffer,t.offset);break;case 2:n=new xn(this.view.buffer,t.offset,this.view.readUint16());break;case 4:n=new Bi(this.view.buffer,t.offset,this.view.readUint16());break;case 6:n=new we(this.view.buffer,t.offset,this.view.readUint16());break;case 12:n=new Di(this.view.buffer,t.offset,this.view.readUint32(t.offset+4));break;default:n=new vn(this.view.buffer,t.offset,this.view.readUint32());break}return{...t,format:e,view:n}})}readunicodeToGlyphIndexMap(){const r=this.readSubtables(),t=r.find(o=>o.format===0)?.view,e=r.find(o=>o.platformID===3&&o.platformSpecificID===3&&o.format===2)?.view,n=r.find(o=>o.platformID===3&&o.platformSpecificID===1&&o.format===4)?.view,i=r.find(o=>o.platformID===3&&o.platformSpecificID===10&&o.format===12)?.view,s=r.find(o=>o.platformID===0&&o.platformSpecificID===5&&o.format===14)?.view;return new Map([...t?.getUnicodeToGlyphIndexMap()??[],...e?.getUnicodeToGlyphIndexMap(this._sfnt.maxp.numGlyphs)??[],...n?.getUnicodeToGlyphIndexMap()??[],...i?.getUnicodeToGlyphIndexMap()??[],...s?.getUnicodeToGlyphIndexMap()??[]])}};rr([m("uint16")],Ve.prototype,"version",2),rr([m("uint16")],Ve.prototype,"numberSubtables",2),Ve=rr([dt("cmap")],Ve);class tl extends Pi{_parseContours(t){const e=[];let n=[];for(let i=0;i<t.length;i+=1){const s=t[i];n.push(s),s.lastPointOfContour&&(e.push(n),n=[])}return Ue(n.length===0,"There are still points left in the current contour."),e}_transformPoints(t,e){const n=[];for(let i=0;i<t.length;i+=1){const s=t[i],o={x:e.xScale*s.x+e.scale10*s.y+e.dx,y:e.scale01*s.x+e.yScale*s.y+e.dy,onCurve:s.onCurve,lastPointOfContour:s.lastPointOfContour};n.push(o)}return n}_parseGlyphCoordinate(t,e,n,i,s){let o;return(e&i)>0?(o=t.view.readUint8(),(e&s)===0&&(o=-o),o=n+o):(e&s)>0?o=n:o=n+t.view.readInt16(),o}parse(t,e,n){t.view.seek(e);const i=this.numberOfContours=t.view.readInt16();if(this.xMin=t.view.readInt16(),this.yMin=t.view.readInt16(),this.xMax=t.view.readInt16(),this.yMax=t.view.readInt16(),i>0){const a=this.endPointIndices=[];for(let y=0;y<i;y++)a.push(t.view.readUint16());const l=this.instructionLength=t.view.readUint16();Ue(l<5e3,`Bad instructionLength:${l}`);const c=this.instructions=[];for(let y=0;y<l;++y)c.push(t.view.readUint8());const h=t.view.byteOffset,u=a[a.length-1]+1;Ue(u<2e4,`Bad numberOfCoordinates:${h}`);const p=[];let d,f=0;for(;f<u;)if(d=t.view.readUint8(),p.push(d),f++,d&8&&f<u){const y=t.view.readUint8();for(let g=0;g<y;g++)p.push(d),f++}if(Ue(p.length===u,`Bad flags length: ${p.length}, numberOfCoordinates: ${u}`),a.length>0){const y=[];let g;if(u>0){for(let x=0;x<u;x+=1)d=p[x],g={},g.onCurve=!!(d&1),g.lastPointOfContour=a.includes(x),y.push(g);let M=0;for(let x=0;x<u;x+=1)d=p[x],g=y[x],g.x=this._parseGlyphCoordinate(t,d,M,2,16),M=g.x;let P=0;for(let x=0;x<u;x+=1)d=p[x],g=y[x],g.y=this._parseGlyphCoordinate(t,d,P,4,32),P=g.y}this.points=y}else this.points=[]}else if(i===0)this.points=[];else{this.isComposite=!0,this.points=[],this.components=[];let a,l=!0;for(;l;){a=t.view.readUint16();const c={glyphIndex:t.view.readUint16(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(a&1)>0?(a&2)>0?(c.dx=t.view.readInt16(),c.dy=t.view.readInt16()):c.matchedPoints=[t.view.readUint16(),t.view.readUint16()]:(a&2)>0?(c.dx=t.view.readInt8(),c.dy=t.view.readInt8()):c.matchedPoints=[t.view.readUint8(),t.view.readUint8()],(a&8)>0?c.xScale=c.yScale=t.view.readInt16()/16384:(a&64)>0?(c.xScale=t.view.readInt16()/16384,c.yScale=t.view.readInt16()/16384):(a&128)>0&&(c.xScale=t.view.readInt16()/16384,c.scale01=t.view.readInt16()/16384,c.scale10=t.view.readInt16()/16384,c.yScale=t.view.readInt16()/16384),this.components.push(c),l=!!(a&32)}if(a&256){this.instructionLength=t.view.readUint16(),this.instructions=[];for(let c=0;c<this.instructionLength;c+=1)this.instructions.push(t.view.readUint8())}}if(this.isComposite)for(let a=0;a<this.components.length;a+=1){const l=this.components[a],c=n.get(l.glyphIndex);if(c.getPathCommands(),c.points){let h;if(l.matchedPoints===void 0)h=this._transformPoints(c.points,l);else{Ue(l.matchedPoints[0]>this.points.length-1||l.matchedPoints[1]>c.points.length-1,`Matched points out of range in ${this.name}`);const u=this.points[l.matchedPoints[0]];let p=c.points[l.matchedPoints[1]];const d={xScale:l.xScale,scale01:l.scale01,scale10:l.scale10,yScale:l.yScale,dx:0,dy:0};p=this._transformPoints([p],d)[0],d.dx=u.x-p.x,d.dy=u.y-p.y,h=this._transformPoints(c.points,d)}this.points=this.points.concat(h)}}const s=[],o=this._parseContours(this.points);for(let a=0,l=o.length;a<l;++a){const c=o[a];let h=c[c.length-1],u=c[0];h.onCurve?s.push({type:"M",x:h.x,y:h.y}):u.onCurve?s.push({type:"M",x:u.x,y:u.y}):s.push({type:"M",x:(h.x+u.x)*.5,y:(h.y+u.y)*.5});for(let p=0,d=c.length;p<d;++p)if(h=u,u=c[(p+1)%d],h.onCurve)s.push({type:"L",x:h.x,y:h.y});else{let f=u;u.onCurve||(f={x:(h.x+u.x)*.5,y:(h.y+u.y)*.5}),s.push({type:"Q",x1:h.x,y1:h.y,x:f.x,y:f.y})}s.push({type:"Z"})}this.pathCommands=s}}class el extends _i{get length(){return this._sfnt.loca.locations.length}_get(t){const e=this._sfnt.loca.locations,n=e[t],i=new tl({index:t});return n!==e[t+1]&&i.parse(this._sfnt.glyf,n,this),i}}var nl=Object.getOwnPropertyDescriptor,rl=(r,t,e,n)=>{for(var i=n>1?void 0:n?nl(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(i)||i);return i};let ir=class extends gt{static from(r){const t=r.reduce((n,i)=>n+i.byteLength,0),e=new ir(new ArrayBuffer(t));return r.forEach(n=>{e.view.writeBytes(n)}),e}_glyphs;get glyphs(){return this._glyphs??=new el(this._sfnt)}};ir=rl([dt("glyf")],ir);var il=Object.getOwnPropertyDescriptor,sl=(r,t,e,n)=>{for(var i=n>1?void 0:n?il(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(i)||i);return i};let Fi=class extends gt{};Fi=sl([dt("GPOS","gpos")],Fi);var ol=Object.defineProperty,al=Object.getOwnPropertyDescriptor,fe=(r,t,e,n)=>{for(var i=n>1?void 0:n?al(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(t,e,i):o(i))||i);return n&&i&&ol(t,e,i),i};let se=class extends gt{};fe([m("uint16")],se.prototype,"majorVersion",2),fe([m("uint16")],se.prototype,"minorVersion",2),fe([m("uint16")],se.prototype,"scriptListOffset",2),fe([m("uint16")],se.prototype,"featureListOffset",2),fe([m("uint16")],se.prototype,"lookupListOffset",2),fe([m("uint16")],se.prototype,"featureVariationsOffset",2),se=fe([dt("GSUB","gsub")],se);var ll=Object.defineProperty,cl=Object.getOwnPropertyDescriptor,at=(r,t,e,n)=>{for(var i=n>1?void 0:n?cl(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(t,e,i):o(i))||i);return n&&i&&ll(t,e,i),i};let st=class extends gt{constructor(r=new ArrayBuffer(54),t){super(r,t,Math.min(54,r.byteLength-(t??0)))}};at([m("fixed")],st.prototype,"version",2),at([m("fixed")],st.prototype,"fontRevision",2),at([m("uint32")],st.prototype,"checkSumAdjustment",2),at([m("uint32")],st.prototype,"magickNumber",2),at([m("uint16")],st.prototype,"flags",2),at([m("uint16")],st.prototype,"unitsPerEm",2),at([m({type:"longDateTime"})],st.prototype,"created",2),at([m({type:"longDateTime"})],st.prototype,"modified",2),at([m("int16")],st.prototype,"xMin",2),at([m("int16")],st.prototype,"yMin",2),at([m("int16")],st.prototype,"xMax",2),at([m("int16")],st.prototype,"yMax",2),at([m("uint16")],st.prototype,"macStyle",2),at([m("uint16")],st.prototype,"lowestRecPPEM",2),at([m("int16")],st.prototype,"fontDirectionHint",2),at([m("int16")],st.prototype,"indexToLocFormat",2),at([m("int16")],st.prototype,"glyphDataFormat",2),st=at([dt("head")],st);var hl=Object.defineProperty,ul=Object.getOwnPropertyDescriptor,St=(r,t,e,n)=>{for(var i=n>1?void 0:n?ul(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(t,e,i):o(i))||i);return n&&i&&hl(t,e,i),i};let yt=class extends gt{constructor(r=new ArrayBuffer(36),t){super(r,t,Math.min(36,r.byteLength-(t??0)))}};St([m("fixed")],yt.prototype,"version",2),St([m("int16")],yt.prototype,"ascent",2),St([m("int16")],yt.prototype,"descent",2),St([m("int16")],yt.prototype,"lineGap",2),St([m("uint16")],yt.prototype,"advanceWidthMax",2),St([m("int16")],yt.prototype,"minLeftSideBearing",2),St([m("int16")],yt.prototype,"minRightSideBearing",2),St([m("int16")],yt.prototype,"xMaxExtent",2),St([m("int16")],yt.prototype,"caretSlopeRise",2),St([m("int16")],yt.prototype,"caretSlopeRun",2),St([m("int16")],yt.prototype,"caretOffset",2),St([m({type:"int16",size:4})],yt.prototype,"reserved",2),St([m("int16")],yt.prototype,"metricDataFormat",2),St([m("uint16")],yt.prototype,"numOfLongHorMetrics",2),yt=St([dt("hhea")],yt);var fl=Object.getOwnPropertyDescriptor,pl=(r,t,e,n)=>{for(var i=n>1?void 0:n?fl(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(i)||i);return i};let sr=class extends gt{static from(r){const t=r.length*4,e=new sr(new ArrayBuffer(t));return r.forEach(n=>{e.view.writeUint16(n.advanceWidth),e.view.writeUint16(n.leftSideBearing)}),e}_metrics;get metrics(){return this._metrics??=this.readMetrics()}readMetrics(){const r=this._sfnt.maxp.numGlyphs,t=this._sfnt.hhea.numOfLongHorMetrics;let e=0;const n=this.view;return n.seek(0),Array.from({length:r}).map((i,s)=>(s<t&&(e=n.readUint16()),{advanceWidth:e,leftSideBearing:n.readUint16()}))}};sr=pl([dt("hmtx")],sr);var dl=Object.getOwnPropertyDescriptor,gl=(r,t,e,n)=>{for(var i=n>1?void 0:n?dl(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(i)||i);return i};let Ui=class extends gt{};Ui=gl([dt("kern","kern")],Ui);var yl=Object.getOwnPropertyDescriptor,ml=(r,t,e,n)=>{for(var i=n>1?void 0:n?yl(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(i)||i);return i};let or=class extends gt{static from(r,t=1){const e=r.length*(t?4:2),n=new or(new ArrayBuffer(e));return r.forEach(i=>{t?n.view.writeUint32(i):n.view.writeUint16(i/2)}),n}_locations;get locations(){return this._locations??=this.readLocations()}readLocations(){const r=this._sfnt.maxp.numGlyphs,t=this._sfnt.head.indexToLocFormat,e=this.view;return e.seek(0),Array.from({length:r}).map(()=>t?e.readUint32():e.readUint16()*2)}};or=ml([dt("loca")],or);var xl=Object.defineProperty,vl=Object.getOwnPropertyDescriptor,mt=(r,t,e,n)=>{for(var i=n>1?void 0:n?vl(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(t,e,i):o(i))||i);return n&&i&&xl(t,e,i),i};let ct=class extends gt{constructor(r=new ArrayBuffer(32),t){super(r,t,Math.min(32,r.byteLength-(t??0)))}};mt([m("fixed")],ct.prototype,"version",2),mt([m("uint16")],ct.prototype,"numGlyphs",2),mt([m("uint16")],ct.prototype,"maxPoints",2),mt([m("uint16")],ct.prototype,"maxContours",2),mt([m("uint16")],ct.prototype,"maxComponentPoints",2),mt([m("uint16")],ct.prototype,"maxComponentContours",2),mt([m("uint16")],ct.prototype,"maxZones",2),mt([m("uint16")],ct.prototype,"maxTwilightPoints",2),mt([m("uint16")],ct.prototype,"maxStorage",2),mt([m("uint16")],ct.prototype,"maxFunctionDefs",2),mt([m("uint16")],ct.prototype,"maxInstructionDefs",2),mt([m("uint16")],ct.prototype,"maxStackElements",2),mt([m("uint16")],ct.prototype,"maxSizeOfInstructions",2),mt([m("uint16")],ct.prototype,"maxComponentElements",2),mt([m("uint16")],ct.prototype,"maxComponentDepth",2),ct=mt([dt("maxp")],ct);var wl=Object.defineProperty,bl=Object.getOwnPropertyDescriptor,wn=(r,t,e,n)=>{for(var i=n>1?void 0:n?bl(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(t,e,i):o(i))||i);return n&&i&&wl(t,e,i),i};const Li={0:"copyright",1:"fontFamily",2:"fontSubFamily",3:"uniqueSubFamily",4:"fullName",5:"version",6:"postScriptName",7:"tradeMark",8:"manufacturer",9:"designer",10:"description",11:"urlOfFontVendor",12:"urlOfFontDesigner",13:"licence",14:"urlOfLicence",16:"preferredFamily",17:"preferredSubFamily",18:"compatibleFull",19:"sampleText"},ar={Macintosh:1,Microsoft:3},Sl={Default:0},$i={UCS2:1};let je=class extends gt{_names;get names(){return this._names??=this.readNames()}readNames(){const r=this.count;this.view.seek(6);const t=[];for(let a=0;a<r;++a)t.push({platform:this.view.readUint16(),encoding:this.view.readUint16(),language:this.view.readUint16(),nameId:this.view.readUint16(),length:this.view.readUint16(),offset:this.view.readUint16()});const e=this.stringOffset;for(let a=0;a<r;++a){const l=t[a];l.name=this.view.readBytes(e+l.offset,l.length)}let n=ar.Macintosh,i=Sl.Default,s=0;t.some(a=>a.platform===ar.Microsoft&&a.encoding===$i.UCS2&&a.language===1033)&&(n=ar.Microsoft,i=$i.UCS2,s=1033);const o={};for(let a=0;a<r;++a){const l=t[a];l.platform===n&&l.encoding===i&&l.language===s&&Li[l.nameId]&&(o[Li[l.nameId]]=s===0?Aa(l.name):Oa(l.name))}return o}};wn([m("uint16")],je.prototype,"format",2),wn([m("uint16")],je.prototype,"count",2),wn([m("uint16")],je.prototype,"stringOffset",2),je=wn([dt("name")],je);var Cl=Object.defineProperty,Ml=Object.getOwnPropertyDescriptor,G=(r,t,e,n)=>{for(var i=n>1?void 0:n?Ml(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(t,e,i):o(i))||i);return n&&i&&Cl(t,e,i),i};let j=class extends gt{get fontPANOSE(){return[this.bFamilyType,this.bSerifStyle,this.bWeight,this.bProportion,this.bContrast,this.bStrokeVariation,this.bArmStyle,this.bLetterform,this.bMidline,this.bXHeight]}};G([m("uint16")],j.prototype,"version",2),G([m("int16")],j.prototype,"xAvgCharWidth",2),G([m("uint16")],j.prototype,"usWeightClass",2),G([m("uint16")],j.prototype,"usWidthClass",2),G([m("uint16")],j.prototype,"fsType",2),G([m("uint16")],j.prototype,"ySubscriptXSize",2),G([m("uint16")],j.prototype,"ySubscriptYSize",2),G([m("uint16")],j.prototype,"ySubscriptXOffset",2),G([m("uint16")],j.prototype,"ySubscriptYOffset",2),G([m("uint16")],j.prototype,"ySuperscriptXSize",2),G([m("uint16")],j.prototype,"ySuperscriptYSize",2),G([m("uint16")],j.prototype,"ySuperscriptXOffset",2),G([m("uint16")],j.prototype,"ySuperscriptYOffset",2),G([m("uint16")],j.prototype,"yStrikeoutSize",2),G([m("uint16")],j.prototype,"yStrikeoutPosition",2),G([m("uint16")],j.prototype,"sFamilyClass",2),G([m({type:"uint8"})],j.prototype,"bFamilyType",2),G([m({type:"uint8"})],j.prototype,"bSerifStyle",2),G([m({type:"uint8"})],j.prototype,"bWeight",2),G([m({type:"uint8"})],j.prototype,"bProportion",2),G([m({type:"uint8"})],j.prototype,"bContrast",2),G([m({type:"uint8"})],j.prototype,"bStrokeVariation",2),G([m({type:"uint8"})],j.prototype,"bArmStyle",2),G([m({type:"uint8"})],j.prototype,"bLetterform",2),G([m({type:"uint8"})],j.prototype,"bMidline",2),G([m({type:"uint8"})],j.prototype,"bXHeight",2),G([m({type:"uint8",size:16})],j.prototype,"ulUnicodeRange",2),G([m({type:"char",size:4})],j.prototype,"achVendID",2),G([m("uint16")],j.prototype,"fsSelection",2),G([m("uint16")],j.prototype,"usFirstCharIndex",2),G([m("uint16")],j.prototype,"usLastCharIndex",2),G([m("int16")],j.prototype,"sTypoAscender",2),G([m("int16")],j.prototype,"sTypoDescender",2),G([m("int16")],j.prototype,"sTypoLineGap",2),G([m("uint16")],j.prototype,"usWinAscent",2),G([m("uint16")],j.prototype,"usWinDescent",2),G([m({offset:72,type:"uint8",size:8})],j.prototype,"ulCodePageRange",2),G([m({offset:72,type:"int16"})],j.prototype,"sxHeight",2),G([m("int16")],j.prototype,"sCapHeight",2),G([m("uint16")],j.prototype,"usDefaultChar",2),G([m("uint16")],j.prototype,"usBreakChar",2),G([m("uint16")],j.prototype,"usMaxContext",2),j=G([dt("OS/2","os2")],j);var Pl=Object.defineProperty,_l=Object.getOwnPropertyDescriptor,Ht=(r,t,e,n)=>{for(var i=n>1?void 0:n?_l(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(t,e,i):o(i))||i);return n&&i&&Pl(t,e,i),i};let Nt=class extends gt{constructor(r=new ArrayBuffer(32),t,e){super(r,t,e)}};Ht([m("fixed")],Nt.prototype,"format",2),Ht([m("fixed")],Nt.prototype,"italicAngle",2),Ht([m("int16")],Nt.prototype,"underlinePosition",2),Ht([m("int16")],Nt.prototype,"underlineThickness",2),Ht([m("uint32")],Nt.prototype,"isFixedPitch",2),Ht([m("uint32")],Nt.prototype,"minMemType42",2),Ht([m("uint32")],Nt.prototype,"maxMemType42",2),Ht([m("uint32")],Nt.prototype,"minMemType1",2),Ht([m("uint32")],Nt.prototype,"maxMemType1",2),Nt=Ht([dt("post")],Nt);var Tl=Object.defineProperty,kl=Object.getOwnPropertyDescriptor,Ct=(r,t,e,n)=>{for(var i=n>1?void 0:n?kl(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=(n?o(t,e,i):o(i))||i);return n&&i&&Tl(t,e,i),i};let xt=class extends gt{constructor(r=new ArrayBuffer(36),t){super(r,t,Math.min(36,r.byteLength-(t??0)))}};Ct([m("fixed")],xt.prototype,"version",2),Ct([m("int16")],xt.prototype,"vertTypoAscender",2),Ct([m("int16")],xt.prototype,"vertTypoDescender",2),Ct([m("int16")],xt.prototype,"vertTypoLineGap",2),Ct([m("int16")],xt.prototype,"advanceHeightMax",2),Ct([m("int16")],xt.prototype,"minTopSideBearing",2),Ct([m("int16")],xt.prototype,"minBottomSideBearing",2),Ct([m("int16")],xt.prototype,"yMaxExtent",2),Ct([m("int16")],xt.prototype,"caretSlopeRise",2),Ct([m("int16")],xt.prototype,"caretSlopeRun",2),Ct([m("int16")],xt.prototype,"caretOffset",2),Ct([m({type:"int16",size:4})],xt.prototype,"reserved",2),Ct([m("int16")],xt.prototype,"metricDataFormat",2),Ct([m("int16")],xt.prototype,"numOfLongVerMetrics",2),xt=Ct([dt("vhea")],xt);var Al=Object.getOwnPropertyDescriptor,Ol=(r,t,e,n)=>{for(var i=n>1?void 0:n?Al(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(i)||i);return i};let lr=class extends gt{static from(r){const t=r.length*4,e=new lr(new ArrayBuffer(t));return r.forEach(n=>{e.view.writeUint16(n.advanceHeight),e.view.writeInt16(n.topSideBearing)}),e}_metrics;get metrics(){return this._metrics??=this.readMetrics()}readMetrics(){const r=this._sfnt.maxp.numGlyphs,t=this._sfnt.vhea?.numOfLongVerMetrics??0,e=this.view;e.seek(0);let n=0;return Array.from({length:r}).map((i,s)=>(s<t&&(n=e.readUint16()),{advanceHeight:n,topSideBearing:e.readUint8()}))}};lr=Ol([dt("vmtx")],lr);var Il=Object.defineProperty,Ge=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Il(t,e,i),i};class Xt extends Qn{format="TrueType";mimeType="font/ttf";_sfnt;get sfnt(){return this._sfnt||(this._sfnt=this.createSFNT()),this._sfnt}static signature=new Set([65536,1953658213,1954115633]);static is(t){return typeof t=="number"?this.signature.has(t):this.signature.has(xe(t).getUint32(0))}static checksum(t){const e=xe(t);let n=e.byteLength;for(;n%4;)n++;let i=0;for(let s=0,o=n/4;s<o;s+=4)s*4<n-4&&(i+=e.getUint32(s*4,!1));return i&4294967295}static from(t){const e=u=>u+3&-4,n=t.tableViews.size,i=Array.from(t.tableViews.values()).reduce((u,p)=>u+e(p.byteLength),0),s=new this(new ArrayBuffer(12+n*16+i));s.scalerType=65536,s.numTables=n;const o=Math.log(2);s.searchRange=Math.floor(Math.log(n)/o)*16,s.entrySelector=Math.floor(s.searchRange/o),s.rangeShift=n*16-s.searchRange;let a=12+n*16,l=0;const c=s.getDirectories();t.tableViews.forEach((u,p)=>{const d=c[l++];d.tag=p,d.checkSum=this.checksum(u),d.offset=a,d.length=u.byteLength,s.view.writeBytes(u,a),a+=e(d.length)});const h=s.createSFNT().head;return h.checkSumAdjustment=0,h.checkSumAdjustment=2981146554-this.checksum(s.view),s}getDirectories(){let t=this.view.byteOffset+12;return Array.from({length:this.numTables},()=>{const e=new Le(this.view.buffer,t);return t+=e.view.byteLength,e})}createSFNT(){return new Jt(this.getDirectories().reduce((t,e)=>(t[e.tag]=new DataView(this.view.buffer,this.view.byteOffset+e.offset,e.length),t),{}))}}Ge([m("uint32")],Xt.prototype,"scalerType"),Ge([m("uint16")],Xt.prototype,"numTables"),Ge([m("uint16")],Xt.prototype,"searchRange"),Ge([m("uint16")],Xt.prototype,"entrySelector"),Ge([m("uint16")],Xt.prototype,"rangeShift");class cr extends Xt{format="OpenType";mimeType="font/otf";static signature=new Set([1330926671]);static from(t){return super.from(t)}}var El=Object.defineProperty,qe=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&El(t,e,i),i};class Se extends Bt{constructor(t,e){super(t,e,20)}}qe([m({type:"char",size:4})],Se.prototype,"tag"),qe([m("uint32")],Se.prototype,"offset"),qe([m("uint32")],Se.prototype,"compLength"),qe([m("uint32")],Se.prototype,"origLength"),qe([m("uint32")],Se.prototype,"origChecksum");var Bl=Object.defineProperty,It=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Bl(t,e,i),i};const _t=class gr extends Qn{format="WOFF";mimeType="font/woff";get subfontFormat(){return Xt.is(this.flavor)?"TrueType":cr.is(this.flavor)?"OpenType":"Open"}_sfnt;get sfnt(){return this._sfnt||(this._sfnt=this.createSFNT()),this._sfnt}static signature=new Set([2001684038]);static is(t){return typeof t=="number"?this.signature.has(t):this.signature.has(xe(t).getUint32(0))}static checkSum(t){const e=xe(t),n=e.byteLength,i=Math.floor(n/4);let s=0,o=0;for(;o<i;)s+=e.getUint32(4*o++,!1);let a=n-i*4;if(a){let l=i*4;for(;a>0;)s+=e.getUint8(l)<<a*8,l++,a--}return s%4294967296}static from(t,e=new ArrayBuffer(0)){const n=u=>u+3&-4,i=[];t.tableViews.forEach((u,p)=>{const d=xe(Sa(new Uint8Array(u.buffer,u.byteOffset,u.byteLength)));i.push({tag:p,view:d.byteLength<u.byteLength?d:u,rawView:u})});const s=i.length,o=i.reduce((u,p)=>u+n(p.view.byteLength),0),a=new gr(new ArrayBuffer(44+20*s+o+e.byteLength));a.signature=2001684038,a.flavor=65536,a.length=a.view.byteLength,a.numTables=s,a.totalSFNTSize=12+16*s+i.reduce((u,p)=>u+n(p.rawView.byteLength),0);let l=44+s*20,c=0;const h=a.getDirectories();return i.forEach(u=>{const p=h[c++];p.tag=u.tag,p.offset=l,p.compLength=u.view.byteLength,p.origChecksum=gr.checkSum(u.rawView),p.origLength=u.rawView.byteLength,a.view.writeBytes(u.view,l),l+=n(p.compLength)}),a.view.writeBytes(e),a}getDirectories(){let t=44;return Array.from({length:this.numTables},()=>{const e=new Se(this.view.buffer,t);return t+=e.view.byteLength,e})}createSFNT(){return new Jt(this.getDirectories().reduce((t,e)=>{const n=e.tag,i=this.view.byteOffset+e.offset,s=e.compLength,o=e.origLength,a=i+s;return t[n]=s>=o?new DataView(this.view.buffer,i,s):new DataView(Ca(new Uint8Array(this.view.buffer.slice(i,a))).buffer),t},{}))}};It([m("uint32")],_t.prototype,"signature"),It([m("uint32")],_t.prototype,"flavor"),It([m("uint32")],_t.prototype,"length"),It([m("uint16")],_t.prototype,"numTables"),It([m("uint16")],_t.prototype,"reserved"),It([m("uint32")],_t.prototype,"totalSFNTSize"),It([m("uint16")],_t.prototype,"majorVersion"),It([m("uint16")],_t.prototype,"minorVersion"),It([m("uint32")],_t.prototype,"metaOffset"),It([m("uint32")],_t.prototype,"metaLength"),It([m("uint32")],_t.prototype,"metaOrigLength"),It([m("uint32")],_t.prototype,"privOffset"),It([m("uint32")],_t.prototype,"privLength");let hr=_t;function Dl(r,t=!0){if(Xt.is(r))return new Xt(r);if(cr.is(r))return new cr(r);if(hr.is(r))return new hr(r);if(t)throw new Error("Failed to parseFont")}function Fl(r,t=!0){const e=Dl(r,!1);if(e)return e;if(t)throw new Error("Failed to parseFont")}class ur{static defaultRequestInit={cache:"force-cache"};fallbackFont;loading=new Map;loaded=new Map;familyToUrl=new Map;setFallbackFont(t){this.fallbackFont=t}async loadFallbackFont(t,e={}){this.fallbackFont=await this.load(t,e)}_createRequest(t,e){const n=new AbortController;return{url:t,when:fetch(t,{...ur.defaultRequestInit,...e,signal:n.signal}).then(i=>i.arrayBuffer()),cancel:()=>n.abort()}}injectFontFace(t,e){return document.fonts.check(`14px ${t}`)||document.fonts.add(new FontFace(t,e)),this}injectStyleTag(t,e){const n=CSS.escape(t);if(!document.querySelector(`style[data-family="${n}"]`)){const i=document.createElement("style");i.type="text/css",i.dataset.family=t,i.appendChild(document.createTextNode(`@font-face {
31
31
  font-family: "${t}";
32
32
  src: url(${e});
33
- }`)),document.head.appendChild(i)}return this}_parseUrls(t){const e=Array.from(new Set([...t.split(","),t]));return Array.from(new Set(e.map(n=>this.familyToUrl.get(n.trim())??this.familyToUrl.get(n)??n)))}get(t){let e;return t&&(e=this._parseUrls(t).reduce((i,s)=>i||this.loaded.get(s),void 0)),e??this.fallbackFont}set(t,e){return this.familyToUrl.set(t,e.src),this.loaded.set(e.src,e),this}delete(t){return this._parseUrls(t).forEach(e=>{this.familyToUrl.delete(e),this.loaded.delete(e)}),this}clear(){return this.familyToUrl.clear(),this.loading.clear(),this.loaded.clear(),this}_parseFamilies(t){return t?(Array.isArray(t)?t:[t]).flatMap(e=>e.split(",").map(n=>n.trim())):[]}async load(t,e={}){const{cancelOther:n,injectFontFace:i=!0,injectStyleTag:s=!0,...o}=e;let a,l;typeof t=="string"?a=t:{src:a,family:l}=t;const c=this._parseFamilies(l);if(this.loaded.has(a))return n&&(this.loading.forEach(d=>d.cancel()),this.loading.clear()),u(this.loaded.get(a));let h=this.loading.get(a);return h||(h=this._createRequest(a,o),this.loading.set(a,h)),n&&this.loading.forEach((d,f)=>{d!==h&&(d.cancel(),this.loading.delete(f))}),h.when.then(d=>{let f;return this.loaded.has(a)?f=u(this.loaded.get(a)):(f=p(d),e.noAdd||this.loaded.set(a,f)),Promise.all(Array.from(f.familySet).map(y=>(this.familyToUrl.set(y,a),typeof document<"u"&&(i&&this.injectFontFace(y,d),s&&this.injectStyleTag(y,a),i||s)?document.fonts.load(`14px ${y}`):Promise.resolve()))).then(()=>f)}).catch(d=>{if(d instanceof DOMException&&d.message==="The user aborted a request.")return p();throw d}).finally(()=>{this.loading.delete(a)});function u(d){return c.forEach(f=>{d.familySet.add(f)}),d}function p(d=new ArrayBuffer(0)){let f;function y(){return f||(f=d.byteLength?Fl(d,!1):void 0),f}function g(){const M=y();if(M instanceof Xt||M instanceof hr)return M.sfnt}return{src:a,family:l,buffer:d,familySet:new Set(c),getFont:y,getSFNT:g}}}async waitUntilLoad(){await Promise.all(Array.from(this.loading.values()).map(t=>t.when))}}const Ul=new ur,Ll=new Set(["©","®","÷"]),$l=new Set(["—","…","“","”","﹏","﹋","﹌","‘","’","˜"]),Nl={1:"italic",32:"bold"},zl={1:"italic",2:"bold"},Ni={100:-.2,200:-.1,300:0,400:0,normal:0,500:.1,600:.2,700:.3,bold:.3,800:.4,900:.5};class zi{constructor(t,e,n){this.content=t,this.index=e,this.parent=n}path=new Pt().setMeta(this);lineBox=new H;inlineBox=new H;glyphBox;advanceWidth=0;advanceHeight=0;underlinePosition=0;underlineThickness=0;strikeoutPosition=0;strikeoutSize=0;ascender=0;descender=0;typoAscender=0;typoDescender=0;typoLineGap=0;winAscent=0;winDescent=0;xHeight=0;capHeight=0;baseline=0;centerDiviation=0;fontStyle;get compatibleGlyphBox(){const t=this.computedStyle.fontSize*.8;return this.glyphBox??(this.isVertical?new H(this.lineBox.left+this.lineBox.width/2-t/2,this.lineBox.top,t,this.lineBox.height):new H(this.lineBox.left,this.lineBox.top+this.lineBox.height/2-t/2,this.lineBox.width,t))}get center(){return this.compatibleGlyphBox.center}get computedFill(){return this.parent.computedFill}get computedOutline(){return this.parent.computedOutline}get computedStyle(){return this.parent.computedStyle}get isVertical(){return this.computedStyle.writingMode.includes("vertical")}get fontSize(){return this.computedStyle.fontSize}get fontHeight(){return this.fontSize*this.computedStyle.lineHeight}_getFontSFNT(t){const e=this.computedStyle.fontFamily,n=t??Ul;let s=(e?n.get(e):n.fallbackFont)?.getSFNT();return s?.textToGlyphIndexes(this.content).includes(0)&&(s=n.fallbackFont?.getSFNT()),s}updateGlyph(t=this._getFontSFNT()){if(!t)return this;const{hhea:e,os2:n,post:i,head:s}=t,o=s.unitsPerEm,a=e.ascent,l=e.descent,{content:c,computedStyle:h,isVertical:u}=this,{fontSize:p}=h,d=o/p,f=t.getAdvanceWidth(c,p),y=(a+Math.abs(l))/d,g=a/d;return this.advanceWidth=f,this.advanceHeight=y,this.inlineBox.width=u?y:f,this.inlineBox.height=u?f:y,this.underlinePosition=(a-i.underlinePosition)/d,this.underlineThickness=i.underlineThickness/d,this.strikeoutPosition=(a-n.yStrikeoutPosition)/d,this.strikeoutSize=n.yStrikeoutSize/d,this.ascender=a/d,this.descender=l/d,this.typoAscender=n.sTypoAscender/d,this.typoDescender=n.sTypoDescender/d,this.typoLineGap=n.sTypoLineGap/d,this.winAscent=n.usWinAscent/d,this.winDescent=n.usWinDescent/d,this.xHeight=n.sxHeight/d,this.capHeight=n.sCapHeight/d,this.baseline=g,this.centerDiviation=y/2-g,this.fontStyle=Nl[n.fsSelection]??zl[s.macStyle],this}update(t){const e=this._getFontSFNT(t);if(!e)return this;this.updateGlyph(e);const{isVertical:n,content:i,computedStyle:s,baseline:o,inlineBox:a,ascender:l,descender:c,typoAscender:h,fontStyle:u,advanceWidth:p,advanceHeight:d}=this,{left:f,top:y}=a,g=s.fontStyle==="italic"&&u!=="italic";let M=f,P=y+o,x;const C=new Pt().setMeta(this);if(n&&(M+=(d-p)/2,Math.abs(p-d)>.1&&(P-=(l-h)/(l+Math.abs(c))*d),x=void 0),n&&!Ll.has(i)&&(i.codePointAt(0)<=256||$l.has(i))){C.addCommands(e.getPathCommands(i,M,y+o-(d-p)/2,s.fontSize));const v={y:y-(d-p)/2+d/2,x:M+p/2};g&&this._italic(C,n?{x:v.x,y:y-(d-p)/2+o}:void 0),C.rotate(90,v)}else x!==void 0?(C.addCommands(e.glyphs.get(x).getPathCommands(M,P,s.fontSize)),g&&this._italic(C,n?{x:M+p/2,y:y+h/(l+Math.abs(c))*d}:void 0)):(C.addCommands(e.getPathCommands(i,M,P,s.fontSize)),g&&this._italic(C,n?{x:M+d/2,y:P}:void 0));const w=s.fontWeight??400;return w in Ni&&(w===700||w==="bold")&&u!=="bold"&&C.bold(Ni[w]*s.fontSize*.05),C.style={fill:this.computedFill??s.color,fillRule:"nonzero",stroke:this.computedOutline??(s.textStrokeWidth?s.textStrokeColor:"none"),strokeWidth:s.textStrokeWidth?s.textStrokeWidth*s.fontSize*.03:0},this.path=C,this.glyphBox=this.getGlyphBoundingBox(),this}_italic(t,e){t.skew(-.24,0,e||{y:this.inlineBox.top+this.baseline,x:this.inlineBox.left+this.inlineBox.width/2})}getGlyphMinMax(t,e,n){if(this.path.curves[0]?.curves.length)return this.path.getMinMax(t,e,n)}getGlyphBoundingBox(t){const e=this.getGlyphMinMax(void 0,void 0,t);if(!e)return;const{min:n,max:i}=e;return new H(n.x,n.y,i.x-n.x,i.y-n.y)}}function fr(){const r=new Map;async function t(n){if(!r.has(n)){r.set(n,n);try{r.set(n,await fetch(n).then(i=>i.text()))}catch(i){console.warn(i),r.delete(n)}}}function e(n){return n.startsWith("http://")||n.startsWith("https://")||n.startsWith("blob://")}return{loaded:r,needsLoad:e,load:t}}function pr(r){const t=new Map;function e(n){let i=t.get(n);if(!i){const s=Hr(r.needsLoad(n)?r.loaded.get(n)??n:n),o=Qr(s);i={dom:s,pathSet:o},t.set(n,i)}return i}return{parsed:t,parse:e}}function bn(r,t){return typeof r=="number"?r:r.endsWith("%")?(r=r.substring(0,r.length-1),Math.ceil(Number(r)/100*t.total)):r.endsWith("rem")?(r=r.substring(0,r.length-3),Number(r)*t.fontSize):r.endsWith("em")?(r=r.substring(0,r.length-2),Number(r)*t.fontSize):Number(r)}function Sn(r){return J(r)?{}:r}function Ri(r,t){const e=Object.keys(r),n=Object.keys(t);return Array.from(new Set([...e,...n])).every(s=>pe(r[s],t[s]))}function pe(r,t){const e=typeof r;return e===typeof t?e==="object"?Ri(r,t):r===t:!1}function Rl(r){const t=r.startsWith("#")?r.slice(1):r;if(!/^(?:[0-9A-F]{3}|[0-9A-F]{6})$/i.test(t))return null;const n=t.length===3?t.split("").map(a=>a+a).join(""):t,i=Number.parseInt(n.slice(0,2),16),s=Number.parseInt(n.slice(2,4),16),o=Number.parseInt(n.slice(4,6),16);return`rgb(${i}, ${s}, ${o})`}function Cn(r){if(!r)return r;const t={};for(const e in r)r[e]!==""&&r[e]!==void 0&&(t[e]=r[e]);return t}class Vi{constructor(t,e={},n,i){this.content=t,this.style=e,this.index=n,this.parent=i,this.updateComputedStyle().initCharacters()}inlineBox=new H;fill;outline;get computedFill(){return this.fill??this.parent.computedFill}get computedOutline(){return this.outline??this.parent.computedOutline}get computedContent(){const t=this.computedStyle;return t.textTransform==="uppercase"?this.content.toUpperCase():t.textTransform==="lowercase"?this.content.toLowerCase():this.content}updateComputedStyle(){return this.computedStyle={...this.parent.computedStyle,...Cn(this.style)},this}initCharacters(){const t=[];let e=0;for(const n of this.computedContent)t.push(new zi(n,e++,this));return this.characters=t,this}}class ji{constructor(t,e,n){this.style=t,this.index=e,this.parent=n,this.updateComputedStyle()}lineBox=new H;fragments=[];fill;outline;get computedFill(){return this.fill??this.parent.fill}get computedOutline(){return this.outline??this.parent.outline}updateComputedStyle(){return this.computedStyle={...Cn(this.parent.computedStyle),...Cn(this.style)},this}}function Vl(r){return r}class We{static notZeroStyles=new Set(["width","height"]);static pxStyles=new Set(["width","height","fontSize","letterSpacing","textStrokeWidth","textIndent","shadowOffsetX","shadowOffsetY","shadowBlur","margin","marginLeft","marginTop","marginRight","marginBottom","padding","paddingLeft","paddingTop","paddingRight","paddingBottom"]);_toDomStyle(t){const e={};for(const n in t){const i=t[n];We.notZeroStyles.has(n)&&i===0||(typeof i=="number"&&We.pxStyles.has(n)?e[n]=`${i}px`:e[n]=i)}return e}createDom(t,e){const n=document.createElement("section"),i={...e},s=e.writingMode.includes("horizontal");switch(e.textAlign){case"start":case"left":i.justifyContent="flex-start";break;case"center":i.justifyContent="center";break;case"end":case"right":i.justifyContent="flex-end";break}switch(e.verticalAlign){case"top":i.alignItems="flex-start";break;case"middle":i.alignItems="center";break;case"bottom":i.alignItems="flex-end";break}const o=!!(i.justifyContent||i.alignItems);Object.assign(n.style,{...this._toDomStyle({...i,boxSizing:i.boxSizing??"border-box",display:i.display??(o?"inline-flex":void 0),width:i.width??"max-content",height:i.height??"max-content"}),whiteSpace:"pre-wrap",wordBreak:"break-all"});const a=document.createElement("ul");return Object.assign(a.style,{verticalAlign:"inherit",listStyleType:"inherit",padding:"0",margin:"0",width:o&&s?"100%":void 0,height:o&&!s?"100%":void 0}),t.forEach(l=>{const c=document.createElement("li");Object.assign(c.style,{verticalAlign:"inherit",...this._toDomStyle(l.style)}),l.fragments.forEach(h=>{const u=document.createElement("span");Object.assign(u.style,{verticalAlign:"inherit",...this._toDomStyle(h.style)}),u.appendChild(document.createTextNode(h.content)),c.appendChild(u)}),a.appendChild(c)}),n.appendChild(a),n}measureDomText(t){const e=document.createRange();e.selectNodeContents(t);const n=t.data??"";let i=0;return Array.from(n).map(s=>{const o=i+=n.substring(i).indexOf(s),a=o+s.length;i+=s.length,e.setStart(t,Math.max(o,0)),e.setEnd(t,a);const l=e.getClientRects?.()??[e.getBoundingClientRect()];let c=l[l.length-1];l.length>1&&c.width<2&&(c=l[l.length-2]);const h=e.toString();if(h!==""&&c&&c.width+c.height!==0)return{content:h,top:c.top,left:c.left,height:c.height,width:c.width}}).filter(Boolean)}measureDom(t){const e=[],n=[],i=[];return t.querySelectorAll("li").forEach((s,o)=>{const a=s.getBoundingClientRect();e.push({paragraphIndex:o,left:a.left,top:a.top,width:a.width,height:a.height}),s.querySelectorAll(":scope > *").forEach((l,c)=>{const h=l.getBoundingClientRect();n.push({paragraphIndex:o,fragmentIndex:c,left:h.left,top:h.top,width:h.width,height:h.height});let u=0;!l.children.length&&l.firstChild instanceof window.Text?this.measureDomText(l.firstChild).forEach(p=>{i.push({...p,newParagraphIndex:-1,paragraphIndex:o,fragmentIndex:c,characterIndex:u++,textWidth:-1,textHeight:-1})}):l.querySelectorAll(":scope > *").forEach(p=>{p.firstChild instanceof window.Text&&this.measureDomText(p.firstChild).forEach(d=>{i.push({...d,newParagraphIndex:-1,paragraphIndex:o,fragmentIndex:c,characterIndex:u++,textWidth:-1,textHeight:-1})})})})}),{paragraphs:e,fragments:n,characters:i}}measureParagraphDom(t,e){const n=e.getBoundingClientRect(),i=this.measureDom(e);i.paragraphs.forEach(a=>{const l=t[a.paragraphIndex];l.lineBox.left=a.left-n.left,l.lineBox.top=a.top-n.top,l.lineBox.width=a.width,l.lineBox.height=a.height}),i.fragments.forEach(a=>{const l=t[a.paragraphIndex].fragments[a.fragmentIndex];l.inlineBox.left=a.left-n.left,l.inlineBox.top=a.top-n.top,l.inlineBox.width=a.width,l.inlineBox.height=a.height});const s=[];let o=0;return i.characters.forEach(a=>{const{paragraphIndex:l,fragmentIndex:c,characterIndex:h}=a;s.push({...a,newParagraphIndex:l,left:a.left-n.left,top:a.top-n.top});const u=t[l].fragments[c].characters[h],{fontHeight:p,isVertical:d}=u,f=s[o];u.inlineBox.left=f.left,u.inlineBox.top=f.top,u.inlineBox.width=f.width,u.inlineBox.height=f.height,d?(u.lineBox.left=f.left+(f.width-p)/2,u.lineBox.top=f.top,u.lineBox.width=p,u.lineBox.height=f.height):(u.lineBox.left=f.left,u.lineBox.top=f.top+(f.height-p)/2,u.lineBox.width=f.width,u.lineBox.height=p),o++}),{paragraphs:t,boundingBox:new H(0,0,n.width,n.height)}}measure(t,e,n){let i;n||(n=this.createDom(t,e),Object.assign(n.style,{position:"fixed",visibility:"hidden"}),document.body.appendChild(n),i=()=>n?.parentNode?.removeChild(n));const s=this.measureParagraphDom(t,n);return i?.(),s}}function Gi(){const r=new ee,t=fr(),e=pr(t);return{name:"background",pathSet:r,load:async n=>{const{backgroundImage:i}=n.computedStyle;i&&t.needsLoad(i)&&await t.load(i)},update:n=>{r.paths.length=0;const{computedStyle:i,lineBox:s,isVertical:o}=n,{backgroundImage:a,backgroundSize:l,backgroundColormap:c}=i;if(J(a))return;const{pathSet:h}=e.parse(a),u=h.getBoundingBox(!0);let p,d,f,y;o?{x:d,y:p,width:y,height:f}=s:{x:p,y:d,width:f,height:y}=s;const g=Sn(c??"none"),M=h.paths.map(w=>{const v=w.clone();return v.style.fill&&v.style.fill in g&&(v.style.fill=g[v.style.fill]),v.style.stroke&&v.style.stroke in g&&(v.style.stroke=g[v.style.stroke]),v});let P,x;if(l==="rigid"){P=Math.max(n.fontSize*5/u.width),x=P;const w=new k;w.x=u.width-f/P,w.y=u.height-y/x,M.forEach(v=>{v.applyTransform(S=>{const b=S.x>u.left+u.width/2,D=S.y>u.top+u.height/2;b&&(S.x-=w.x),D&&(S.y-=w.y)})})}else P=f/u.width,x=y/u.height;const C=new vt;C.translate(-u.x,-u.y),C.scale(P,x),o&&(C.translate(-f/2,-y/2),C.rotate(-Math.PI/2),C.translate(y/2,f/2)),C.translate(p,d),M.forEach(w=>{w.applyTransform(v=>{v.applyMatrix3(C)})}),r.paths.push(...M)},renderOrder:-2,render:n=>{const{text:i,context:s}=n,{boundingBox:o,computedStyle:a}=i;J(a.backgroundColor)||(s.fillStyle=a.backgroundColor,s.fillRect(...o.array)),r.paths.forEach(l=>{if(n.drawPath(l),i.debug){const c=new ee([l]).getBoundingBox();c&&s.strokeRect(c.x,c.y,c.width,c.height)}}),i.paragraphs.forEach(l=>{const{lineBox:c,style:h}=l;J(h.backgroundColor)||(s.fillStyle=h.backgroundColor,s.fillRect(...c.array)),l.fragments.forEach(u=>{const{inlineBox:p,style:d}=u;J(d.backgroundColor)||(s.fillStyle=d.backgroundColor,s.fillRect(...p.array))})})}}}function Mn(r){const{highlight:t,highlightImage:e,highlightReferImage:n,highlightColormap:i,highlightLine:s,highlightSize:o,highlightThickness:a}=r;return{image:t?.image??e??"none",referImage:t?.referImage??n??"none",colormap:t?.colormap??i??"none",line:t?.line??s??"none",size:t?.size??o??"cover",thickness:t?.thickness??a??"100%"}}function qi(){const r=new ee,t=[],e=fr(),n=pr(e);return{name:"highlight",pathSet:r,load:async i=>{const s=new Set;i.forEachCharacter(o=>{const{computedStyle:a}=o,{image:l,referImage:c}=Mn(a);l&&e.needsLoad(l)&&s.add(l),c&&e.needsLoad(c)&&s.add(c)}),await Promise.all(Array.from(s).map(o=>e.load(o)))},update:i=>{t.length=0,r.paths.length=0;let s=[],o,a;i.forEachCharacter(l=>{const{computedStyle:c}=l,h=Mn(c),{image:u,colormap:p,line:d,size:f,thickness:y}=h;if(J(u))o?.length&&(o=[],s.push(o));else{const{inlineBox:g,isVertical:M}=l,{fontSize:P}=c;(!a||pe(a.image,u)&&pe(a.colormap,p)&&pe(a.line,d)&&pe(a.size,f)&&pe(a.thickness,y))&&o?.length&&(M?o[0].inlineBox.left===g.left:o[0].inlineBox.top===g.top)&&o[0].fontSize===P?o.push(l):(o=[],o.push(l),s.push(o))}a=h}),s=s.filter(l=>l.length);for(let l=0;l<s.length;l++){const c=s[l],h=c[0],u=H.from(...c.map(I=>I.compatibleGlyphBox));if(!u.height||!u.width)continue;const{computedStyle:p,isVertical:d,inlineBox:f,compatibleGlyphBox:y,strikeoutPosition:g,underlinePosition:M}=h,{fontSize:P}=p,{image:x,referImage:C,colormap:w,line:v,size:S,thickness:b}=Mn(p),D=bn(b,{fontSize:P,total:u.width})/u.width,z=Sn(w),{pathSet:E,dom:F}=n.parse(x),N=E.getBoundingBox(!0),B=P/N.width*2,A=new H().copy(u);d&&(A.width=u.height,A.height=u.width,A.left=u.left+u.width);const W=Math.floor(A.width);let O=W;S!=="cover"&&(O=bn(S,{fontSize:P,total:u.width})||W,A.width=O);const L=!J(C)&&J(v);if(L)N.copy(n.parse(C).pathSet.getBoundingBox(!0));else{let I;if(J(v))if(N.width/N.height>4){I="underline";const R=F.getAttribute("viewBox");if(R){const[T,_,U,$]=R.split(" ").map(X=>Number(X)),q=_+$/2;N.y<q&&N.y+N.height>q?I="line-through":N.y+N.height<q?I="overline":I="underline"}}else I="outline";else I=v;switch(I){case"outline":{const R=A.width*.2,T=A.height*.2;d?(A.x-=T/2,A.y-=R/2,A.x-=A.height):(A.x-=R/2,A.y-=T/2),A.width+=R,A.height+=T;break}case"overline":A.height=N.height*B,d?A.x=f.left+f.width:A.y=f.top;break;case"line-through":A.height=N.height*B,d?A.x=f.left+f.width-g+A.height/2:A.y=f.top+g-A.height/2;break;case"underline":A.height=N.height*B,d?A.x=y.left+y.width-M:A.y=f.top+M;break}}const V=new vt;if(V.translate(-N.x,-N.y),V.scale(A.width/N.width,A.height/N.height),d){const I=A.width/2,R=A.height/2;L||V.translate(-I,-R),V.rotate(-Math.PI/2),L||V.translate(R,I)}V.translate(A.x,A.y);for(let I=0;I<Math.ceil(W/O);I++){const R=V.clone();d?R.translate(0,I*A.width):R.translate(I*A.width,0),E.paths.forEach(T=>{const _=T.clone().applyTransform(R);_.style.strokeWidth&&(_.style.strokeWidth*=B*D),_.style.strokeMiterlimit&&(_.style.strokeMiterlimit*=B),_.style.strokeDashoffset&&(_.style.strokeDashoffset*=B),_.style.strokeDasharray&&(_.style.strokeDasharray=_.style.strokeDasharray.map(U=>U*B)),_.style.fill&&_.style.fill in z&&(_.style.fill=z[_.style.fill]),_.style.stroke&&_.style.stroke in z&&(_.style.stroke=z[_.style.stroke]),r.paths.push(_),W!==O&&(d?t[r.paths.length-1]=new H(u.left-u.width*2,u.top,u.width*4,u.height):t[r.paths.length-1]=new H(u.left,u.top-u.height*2,u.width,u.height*4))})}}},renderOrder:-1,getBoundingBox:()=>{const i=[];return r.paths.forEach((s,o)=>{const a=t[o];let l=s.getBoundingBox();if(a){const c=Math.max(l.x,a.x),h=Math.max(l.y,a.y),u=Math.min(l.right,a.right),p=Math.min(l.bottom,a.bottom);l=new H(c,h,u-c,p-h)}i.push(l)}),H.from(...i)},render:i=>{const{text:s,context:o}=i;r.paths.forEach((a,l)=>{if(i.drawPath(a,{clipRect:t[l]}),s.debug){const c=new ee([a]).getBoundingBox();c&&o.strokeRect(c.x,c.y,c.width,c.height)}})}}}function jl(r,t){return`<svg width="${r*2}" height="${r*2}" xmlns="http://www.w3.org/2000/svg">
33
+ }`)),document.head.appendChild(i)}return this}_parseUrls(t){const e=Array.from(new Set([...t.split(","),t]));return Array.from(new Set(e.map(n=>this.familyToUrl.get(n.trim())??this.familyToUrl.get(n)??n)))}get(t){let e;return t&&(e=this._parseUrls(t).reduce((i,s)=>i||this.loaded.get(s),void 0)),e??this.fallbackFont}set(t,e){return this.familyToUrl.set(t,e.src),this.loaded.set(e.src,e),this}delete(t){return this._parseUrls(t).forEach(e=>{this.familyToUrl.delete(e),this.loaded.delete(e)}),this}clear(){return this.familyToUrl.clear(),this.loading.clear(),this.loaded.clear(),this}_parseFamilies(t){return t?(Array.isArray(t)?t:[t]).flatMap(e=>e.split(",").map(n=>n.trim())):[]}async load(t,e={}){const{cancelOther:n,injectFontFace:i=!0,injectStyleTag:s=!0,...o}=e;let a,l;typeof t=="string"?a=t:{src:a,family:l}=t;const c=this._parseFamilies(l);if(this.loaded.has(a))return n&&(this.loading.forEach(d=>d.cancel()),this.loading.clear()),u(this.loaded.get(a));let h=this.loading.get(a);return h||(h=this._createRequest(a,o),this.loading.set(a,h)),n&&this.loading.forEach((d,f)=>{d!==h&&(d.cancel(),this.loading.delete(f))}),h.when.then(d=>{let f;return this.loaded.has(a)?f=u(this.loaded.get(a)):(f=p(d),e.noAdd||this.loaded.set(a,f)),Promise.all(Array.from(f.familySet).map(y=>(this.familyToUrl.set(y,a),typeof document<"u"&&(i&&this.injectFontFace(y,d),s&&this.injectStyleTag(y,a),i||s)?document.fonts.load(`14px ${y}`):Promise.resolve()))).then(()=>f)}).catch(d=>{if(d instanceof DOMException&&d.message==="The user aborted a request.")return p();throw d}).finally(()=>{this.loading.delete(a)});function u(d){return c.forEach(f=>{d.familySet.add(f)}),d}function p(d=new ArrayBuffer(0)){let f;function y(){return f||(f=d.byteLength?Fl(d,!1):void 0),f}function g(){const M=y();if(M instanceof Xt||M instanceof hr)return M.sfnt}return{src:a,family:l,buffer:d,familySet:new Set(c),getFont:y,getSFNT:g}}}async waitUntilLoad(){await Promise.all(Array.from(this.loading.values()).map(t=>t.when))}}const Ul=new ur,Ll=new Set(["©","®","÷"]),$l=new Set(["—","…","“","”","﹏","﹋","﹌","‘","’","˜"]),Nl={1:"italic",32:"bold"},zl={1:"italic",2:"bold"},Ni={100:-.2,200:-.1,300:0,400:0,normal:0,500:.1,600:.2,700:.3,bold:.3,800:.4,900:.5};class zi{constructor(t,e,n){this.content=t,this.index=e,this.parent=n}path=new Pt().setMeta(this);lineBox=new H;inlineBox=new H;glyphBox;advanceWidth=0;advanceHeight=0;underlinePosition=0;underlineThickness=0;strikeoutPosition=0;strikeoutSize=0;ascender=0;descender=0;typoAscender=0;typoDescender=0;typoLineGap=0;winAscent=0;winDescent=0;xHeight=0;capHeight=0;baseline=0;centerDiviation=0;fontStyle;get compatibleGlyphBox(){const t=this.computedStyle.fontSize*.8;return this.glyphBox??(this.isVertical?new H(this.lineBox.left+this.lineBox.width/2-t/2,this.lineBox.top,t,this.lineBox.height):new H(this.lineBox.left,this.lineBox.top+this.lineBox.height/2-t/2,this.lineBox.width,t))}get center(){return this.compatibleGlyphBox.center}get computedFill(){return this.parent.computedFill}get computedOutline(){return this.parent.computedOutline}get computedStyle(){return this.parent.computedStyle}get isVertical(){return this.computedStyle.writingMode.includes("vertical")}get fontSize(){return this.computedStyle.fontSize}get fontHeight(){return this.fontSize*this.computedStyle.lineHeight}_getFontSFNT(t){const e=this.computedStyle.fontFamily,n=t??Ul;let s=(e?n.get(e):n.fallbackFont)?.getSFNT();return s?.textToGlyphIndexes(this.content).includes(0)&&(s=n.fallbackFont?.getSFNT()),s}updateGlyph(t=this._getFontSFNT()){if(!t)return this;const{hhea:e,os2:n,post:i,head:s}=t,o=s.unitsPerEm,a=e.ascent,l=e.descent,{content:c,computedStyle:h,isVertical:u}=this,{fontSize:p}=h,d=o/p,f=t.getAdvanceWidth(c,p),y=(a+Math.abs(l))/d,g=a/d;return this.advanceWidth=f,this.advanceHeight=y,this.inlineBox.width=u?y:f,this.inlineBox.height=u?f:y,this.underlinePosition=(a-i.underlinePosition)/d,this.underlineThickness=i.underlineThickness/d,this.strikeoutPosition=(a-n.yStrikeoutPosition)/d,this.strikeoutSize=n.yStrikeoutSize/d,this.ascender=a/d,this.descender=l/d,this.typoAscender=n.sTypoAscender/d,this.typoDescender=n.sTypoDescender/d,this.typoLineGap=n.sTypoLineGap/d,this.winAscent=n.usWinAscent/d,this.winDescent=n.usWinDescent/d,this.xHeight=n.sxHeight/d,this.capHeight=n.sCapHeight/d,this.baseline=g,this.centerDiviation=y/2-g,this.fontStyle=Nl[n.fsSelection]??zl[s.macStyle],this}update(t){const e=this._getFontSFNT(t);if(!e)return this;this.updateGlyph(e);const{isVertical:n,content:i,computedStyle:s,baseline:o,inlineBox:a,ascender:l,descender:c,typoAscender:h,fontStyle:u,advanceWidth:p,advanceHeight:d}=this,{left:f,top:y}=a,g=s.fontStyle==="italic"&&u!=="italic";let M=f,P=y+o,x;const C=new Pt().setMeta(this);if(n&&(M+=(d-p)/2,Math.abs(p-d)>.1&&(P-=(l-h)/(l+Math.abs(c))*d),x=void 0),n&&!Ll.has(i)&&(i.codePointAt(0)<=256||$l.has(i))){C.addCommands(e.getPathCommands(i,M,y+o-(d-p)/2,s.fontSize));const v={y:y-(d-p)/2+d/2,x:M+p/2};g&&this._italic(C,n?{x:v.x,y:y-(d-p)/2+o}:void 0),C.rotate(90,v)}else x!==void 0?(C.addCommands(e.glyphs.get(x).getPathCommands(M,P,s.fontSize)),g&&this._italic(C,n?{x:M+p/2,y:y+h/(l+Math.abs(c))*d}:void 0)):(C.addCommands(e.getPathCommands(i,M,P,s.fontSize)),g&&this._italic(C,n?{x:M+d/2,y:P}:void 0));const w=s.fontWeight??400;return w in Ni&&(w===700||w==="bold")&&u!=="bold"&&C.bold(Ni[w]*s.fontSize*.05),C.style={fill:this.computedFill??s.color,fillRule:"nonzero",stroke:this.computedOutline??(s.textStrokeWidth?s.textStrokeColor:"none"),strokeWidth:s.textStrokeWidth?s.textStrokeWidth*s.fontSize*.03:0},this.path=C,this.glyphBox=this.getGlyphBoundingBox(),this}_italic(t,e){t.skew(-.24,0,e||{y:this.inlineBox.top+this.baseline,x:this.inlineBox.left+this.inlineBox.width/2})}getGlyphMinMax(t,e,n){if(this.path.curves[0]?.curves.length)return this.path.getMinMax(t,e,n)}getGlyphBoundingBox(t){const e=this.getGlyphMinMax(void 0,void 0,t);if(!e)return;const{min:n,max:i}=e;return new H(n.x,n.y,i.x-n.x,i.y-n.y)}}function fr(){const r=new Map;async function t(n){if(!r.has(n)){r.set(n,n);try{r.set(n,await fetch(n).then(i=>i.text()))}catch(i){console.warn(i),r.delete(n)}}}function e(n){return n.startsWith("http://")||n.startsWith("https://")||n.startsWith("blob://")}return{loaded:r,needsLoad:e,load:t}}function pr(r){const t=new Map;function e(n){let i=t.get(n);if(!i){const s=Hr(r.needsLoad(n)?r.loaded.get(n)??n:n),o=Qr(s);i={dom:s,pathSet:o},t.set(n,i)}return i}return{parsed:t,parse:e}}function bn(r,t){return typeof r=="number"?r:r.endsWith("%")?(r=r.substring(0,r.length-1),Math.ceil(Number(r)/100*t.total)):r.endsWith("rem")?(r=r.substring(0,r.length-3),Number(r)*t.fontSize):r.endsWith("em")?(r=r.substring(0,r.length-2),Number(r)*t.fontSize):Number(r)}function Sn(r){return Q(r)?{}:r}function Ri(r,t){const e=Object.keys(r),n=Object.keys(t);return Array.from(new Set([...e,...n])).every(s=>pe(r[s],t[s]))}function pe(r,t){const e=typeof r;return e===typeof t?e==="object"?Ri(r,t):r===t:!1}function Rl(r){const t=r.startsWith("#")?r.slice(1):r;if(!/^(?:[0-9A-F]{3}|[0-9A-F]{6})$/i.test(t))return null;const n=t.length===3?t.split("").map(a=>a+a).join(""):t,i=Number.parseInt(n.slice(0,2),16),s=Number.parseInt(n.slice(2,4),16),o=Number.parseInt(n.slice(4,6),16);return`rgb(${i}, ${s}, ${o})`}function Cn(r){if(!r)return r;const t={};for(const e in r)r[e]!==""&&r[e]!==void 0&&(t[e]=r[e]);return t}class Vi{constructor(t,e={},n,i){this.content=t,this.style=e,this.index=n,this.parent=i,this.updateComputedStyle().initCharacters()}inlineBox=new H;fill;outline;get computedFill(){return this.fill??this.parent.computedFill}get computedOutline(){return this.outline??this.parent.computedOutline}get computedContent(){const t=this.computedStyle;return t.textTransform==="uppercase"?this.content.toUpperCase():t.textTransform==="lowercase"?this.content.toLowerCase():this.content}updateComputedStyle(){return this.computedStyle={...this.parent.computedStyle,...Cn(this.style)},this}initCharacters(){const t=[];let e=0;for(const n of this.computedContent)t.push(new zi(n,e++,this));return this.characters=t,this}}class ji{constructor(t,e,n){this.style=t,this.index=e,this.parent=n,this.updateComputedStyle()}lineBox=new H;fragments=[];fill;outline;get computedFill(){return this.fill??this.parent.fill}get computedOutline(){return this.outline??this.parent.outline}updateComputedStyle(){return this.computedStyle={...Cn(this.parent.computedStyle),...Cn(this.style)},this}}function Vl(r){return r}class We{static notZeroStyles=new Set(["width","height"]);static pxStyles=new Set(["width","height","fontSize","letterSpacing","textStrokeWidth","textIndent","shadowOffsetX","shadowOffsetY","shadowBlur","margin","marginLeft","marginTop","marginRight","marginBottom","padding","paddingLeft","paddingTop","paddingRight","paddingBottom"]);_toDomStyle(t){const e={};for(const n in t){const i=t[n];We.notZeroStyles.has(n)&&i===0||(typeof i=="number"&&We.pxStyles.has(n)?e[n]=`${i}px`:e[n]=i)}return e}createDom(t,e){const n=document.createElement("section"),i={...e},s=e.writingMode.includes("horizontal");switch(e.textAlign){case"start":case"left":i.justifyContent="flex-start";break;case"center":i.justifyContent="center";break;case"end":case"right":i.justifyContent="flex-end";break}switch(e.verticalAlign){case"top":i.alignItems="flex-start";break;case"middle":i.alignItems="center";break;case"bottom":i.alignItems="flex-end";break}const o=!!(i.justifyContent||i.alignItems);Object.assign(n.style,{...this._toDomStyle({...i,boxSizing:i.boxSizing??"border-box",display:i.display??(o?"inline-flex":void 0),width:i.width??"max-content",height:i.height??"max-content"}),whiteSpace:"pre-wrap",wordBreak:"break-all"});const a=document.createElement("ul");return Object.assign(a.style,{verticalAlign:"inherit",listStyleType:"inherit",padding:"0",margin:"0",width:o&&s?"100%":void 0,height:o&&!s?"100%":void 0}),t.forEach(l=>{const c=document.createElement("li");Object.assign(c.style,{verticalAlign:"inherit",...this._toDomStyle(l.style)}),l.fragments.forEach(h=>{const u=document.createElement("span");Object.assign(u.style,{verticalAlign:"inherit",...this._toDomStyle(h.style)}),u.appendChild(document.createTextNode(h.content)),c.appendChild(u)}),a.appendChild(c)}),n.appendChild(a),n}measureDomText(t){const e=document.createRange();e.selectNodeContents(t);const n=t.data??"";let i=0;return Array.from(n).map(s=>{const o=i+=n.substring(i).indexOf(s),a=o+s.length;i+=s.length,e.setStart(t,Math.max(o,0)),e.setEnd(t,a);const l=e.getClientRects?.()??[e.getBoundingClientRect()];let c=l[l.length-1];l.length>1&&c.width<2&&(c=l[l.length-2]);const h=e.toString();if(h!==""&&c&&c.width+c.height!==0)return{content:h,top:c.top,left:c.left,height:c.height,width:c.width}}).filter(Boolean)}measureDom(t){const e=[],n=[],i=[];return t.querySelectorAll("li").forEach((s,o)=>{const a=s.getBoundingClientRect();e.push({paragraphIndex:o,left:a.left,top:a.top,width:a.width,height:a.height}),s.querySelectorAll(":scope > *").forEach((l,c)=>{const h=l.getBoundingClientRect();n.push({paragraphIndex:o,fragmentIndex:c,left:h.left,top:h.top,width:h.width,height:h.height});let u=0;!l.children.length&&l.firstChild instanceof window.Text?this.measureDomText(l.firstChild).forEach(p=>{i.push({...p,newParagraphIndex:-1,paragraphIndex:o,fragmentIndex:c,characterIndex:u++,textWidth:-1,textHeight:-1})}):l.querySelectorAll(":scope > *").forEach(p=>{p.firstChild instanceof window.Text&&this.measureDomText(p.firstChild).forEach(d=>{i.push({...d,newParagraphIndex:-1,paragraphIndex:o,fragmentIndex:c,characterIndex:u++,textWidth:-1,textHeight:-1})})})})}),{paragraphs:e,fragments:n,characters:i}}measureParagraphDom(t,e){const n=e.getBoundingClientRect(),i=this.measureDom(e);i.paragraphs.forEach(a=>{const l=t[a.paragraphIndex];l.lineBox.left=a.left-n.left,l.lineBox.top=a.top-n.top,l.lineBox.width=a.width,l.lineBox.height=a.height}),i.fragments.forEach(a=>{const l=t[a.paragraphIndex].fragments[a.fragmentIndex];l.inlineBox.left=a.left-n.left,l.inlineBox.top=a.top-n.top,l.inlineBox.width=a.width,l.inlineBox.height=a.height});const s=[];let o=0;return i.characters.forEach(a=>{const{paragraphIndex:l,fragmentIndex:c,characterIndex:h}=a;s.push({...a,newParagraphIndex:l,left:a.left-n.left,top:a.top-n.top});const u=t[l].fragments[c].characters[h],{fontHeight:p,isVertical:d}=u,f=s[o];u.inlineBox.left=f.left,u.inlineBox.top=f.top,u.inlineBox.width=f.width,u.inlineBox.height=f.height,d?(u.lineBox.left=f.left+(f.width-p)/2,u.lineBox.top=f.top,u.lineBox.width=p,u.lineBox.height=f.height):(u.lineBox.left=f.left,u.lineBox.top=f.top+(f.height-p)/2,u.lineBox.width=f.width,u.lineBox.height=p),o++}),{paragraphs:t,boundingBox:new H(0,0,n.width,n.height)}}measure(t,e,n){let i;n||(n=this.createDom(t,e),Object.assign(n.style,{position:"fixed",visibility:"hidden"}),document.body.appendChild(n),i=()=>n?.parentNode?.removeChild(n));const s=this.measureParagraphDom(t,n);return i?.(),s}}function Gi(){const r=new ee,t=fr(),e=pr(t);return{name:"background",pathSet:r,load:async n=>{const{backgroundImage:i}=n.computedStyle;i&&t.needsLoad(i)&&await t.load(i)},update:n=>{r.paths.length=0;const{computedStyle:i,lineBox:s,isVertical:o}=n,{backgroundImage:a,backgroundSize:l,backgroundColormap:c}=i;if(Q(a))return;const{pathSet:h}=e.parse(a),u=h.getBoundingBox(!0);let p,d,f,y;o?{x:d,y:p,width:y,height:f}=s:{x:p,y:d,width:f,height:y}=s;const g=Sn(c??"none"),M=h.paths.map(w=>{const v=w.clone();return v.style.fill&&v.style.fill in g&&(v.style.fill=g[v.style.fill]),v.style.stroke&&v.style.stroke in g&&(v.style.stroke=g[v.style.stroke]),v});let P,x;if(l==="rigid"){P=Math.max(n.fontSize*5/u.width),x=P;const w=new k;w.x=u.width-f/P,w.y=u.height-y/x,M.forEach(v=>{v.applyTransform(S=>{const b=S.x>u.left+u.width/2,D=S.y>u.top+u.height/2;b&&(S.x-=w.x),D&&(S.y-=w.y)})})}else P=f/u.width,x=y/u.height;const C=new vt;C.translate(-u.x,-u.y),C.scale(P,x),o&&(C.translate(-f/2,-y/2),C.rotate(-Math.PI/2),C.translate(y/2,f/2)),C.translate(p,d),M.forEach(w=>{w.applyTransform(v=>{v.applyMatrix3(C)})}),r.paths.push(...M)},renderOrder:-2,render:n=>{const{text:i,context:s}=n,{boundingBox:o,computedStyle:a}=i;Q(a.backgroundColor)||(s.fillStyle=a.backgroundColor,s.fillRect(...o.array)),r.paths.forEach(l=>{if(n.drawPath(l),i.debug){const c=new ee([l]).getBoundingBox();c&&s.strokeRect(c.x,c.y,c.width,c.height)}}),i.paragraphs.forEach(l=>{const{lineBox:c,style:h}=l;Q(h.backgroundColor)||(s.fillStyle=h.backgroundColor,s.fillRect(...c.array)),l.fragments.forEach(u=>{const{inlineBox:p,style:d}=u;Q(d.backgroundColor)||(s.fillStyle=d.backgroundColor,s.fillRect(...p.array))})})}}}function Mn(r){const{highlight:t,highlightImage:e,highlightReferImage:n,highlightColormap:i,highlightLine:s,highlightSize:o,highlightThickness:a}=r;return{image:t?.image??e??"none",referImage:t?.referImage??n??"none",colormap:t?.colormap??i??"none",line:t?.line??s??"none",size:t?.size??o??"cover",thickness:t?.thickness??a??"100%"}}function qi(){const r=new ee,t=[],e=fr(),n=pr(e);return{name:"highlight",pathSet:r,load:async i=>{const s=new Set;i.forEachCharacter(o=>{const{computedStyle:a}=o,{image:l,referImage:c}=Mn(a);l&&e.needsLoad(l)&&s.add(l),c&&e.needsLoad(c)&&s.add(c)}),await Promise.all(Array.from(s).map(o=>e.load(o)))},update:i=>{t.length=0,r.paths.length=0;let s=[],o,a;i.forEachCharacter(l=>{const{computedStyle:c}=l,h=Mn(c),{image:u,colormap:p,line:d,size:f,thickness:y}=h;if(Q(u))o?.length&&(o=[],s.push(o));else{const{inlineBox:g,isVertical:M}=l,{fontSize:P}=c;(!a||pe(a.image,u)&&pe(a.colormap,p)&&pe(a.line,d)&&pe(a.size,f)&&pe(a.thickness,y))&&o?.length&&(M?o[0].inlineBox.left===g.left:o[0].inlineBox.top===g.top)&&o[0].fontSize===P?o.push(l):(o=[],o.push(l),s.push(o))}a=h}),s=s.filter(l=>l.length);for(let l=0;l<s.length;l++){const c=s[l],h=c[0],u=H.from(...c.map(I=>I.compatibleGlyphBox));if(!u.height||!u.width)continue;const{computedStyle:p,isVertical:d,inlineBox:f,compatibleGlyphBox:y,strikeoutPosition:g,underlinePosition:M}=h,{fontSize:P}=p,{image:x,referImage:C,colormap:w,line:v,size:S,thickness:b}=Mn(p),D=bn(b,{fontSize:P,total:u.width})/u.width,z=Sn(w),{pathSet:E,dom:F}=n.parse(x),N=E.getBoundingBox(!0),B=P/N.width*2,A=new H().copy(u);d&&(A.width=u.height,A.height=u.width,A.left=u.left+u.width);const W=Math.floor(A.width);let O=W;S!=="cover"&&(O=bn(S,{fontSize:P,total:u.width})||W,A.width=O);const L=!Q(C)&&Q(v);if(L)N.copy(n.parse(C).pathSet.getBoundingBox(!0));else{let I;if(Q(v))if(N.width/N.height>4){I="underline";const R=F.getAttribute("viewBox");if(R){const[T,_,U,$]=R.split(" ").map(X=>Number(X)),q=_+$/2;N.y<q&&N.y+N.height>q?I="line-through":N.y+N.height<q?I="overline":I="underline"}}else I="outline";else I=v;switch(I){case"outline":{const R=A.width*.2,T=A.height*.2;d?(A.x-=T/2,A.y-=R/2,A.x-=A.height):(A.x-=R/2,A.y-=T/2),A.width+=R,A.height+=T;break}case"overline":A.height=N.height*B,d?A.x=f.left+f.width:A.y=f.top;break;case"line-through":A.height=N.height*B,d?A.x=f.left+f.width-g+A.height/2:A.y=f.top+g-A.height/2;break;case"underline":A.height=N.height*B,d?A.x=y.left+y.width-M:A.y=f.top+M;break}}const V=new vt;if(V.translate(-N.x,-N.y),V.scale(A.width/N.width,A.height/N.height),d){const I=A.width/2,R=A.height/2;L||V.translate(-I,-R),V.rotate(-Math.PI/2),L||V.translate(R,I)}V.translate(A.x,A.y);for(let I=0;I<Math.ceil(W/O);I++){const R=V.clone();d?R.translate(0,I*A.width):R.translate(I*A.width,0),E.paths.forEach(T=>{const _=T.clone().applyTransform(R);_.style.strokeWidth&&(_.style.strokeWidth*=B*D),_.style.strokeMiterlimit&&(_.style.strokeMiterlimit*=B),_.style.strokeDashoffset&&(_.style.strokeDashoffset*=B),_.style.strokeDasharray&&(_.style.strokeDasharray=_.style.strokeDasharray.map(U=>U*B)),_.style.fill&&_.style.fill in z&&(_.style.fill=z[_.style.fill]),_.style.stroke&&_.style.stroke in z&&(_.style.stroke=z[_.style.stroke]),r.paths.push(_),W!==O&&(d?t[r.paths.length-1]=new H(u.left-u.width*2,u.top,u.width*4,u.height):t[r.paths.length-1]=new H(u.left,u.top-u.height*2,u.width,u.height*4))})}}},renderOrder:-1,getBoundingBox:()=>{const i=[];return r.paths.forEach((s,o)=>{const a=t[o];let l=s.getBoundingBox();if(a){const c=Math.max(l.x,a.x),h=Math.max(l.y,a.y),u=Math.min(l.right,a.right),p=Math.min(l.bottom,a.bottom);l=new H(c,h,u-c,p-h)}i.push(l)}),H.from(...i)},render:i=>{const{text:s,context:o}=i;r.paths.forEach((a,l)=>{if(i.drawPath(a,{clipRect:t[l]}),s.debug){const c=new ee([a]).getBoundingBox();c&&o.strokeRect(c.x,c.y,c.width,c.height)}})}}}function jl(r,t){return`<svg width="${r*2}" height="${r*2}" xmlns="http://www.w3.org/2000/svg">
34
34
  <circle cx="${r}" cy="${r}" r="${r}" fill="${t}" />
35
- </svg>`}function Wi(){const r=new ee;return{name:"listStyle",pathSet:r,update:t=>{r.paths.length=0;const{paragraphs:e,isVertical:n,fontSize:i}=t,s=i*.45;e.forEach(o=>{const{computedStyle:a}=o,{color:l,listStyleImage:c,listStyleColormap:h,listStyleSize:u,listStyleType:p}=a,d=Sn(h);let f=u,y;if(!J(c))y=c;else if(!J(p)){const v=i*.38/2;switch(f=f==="cover"?v*2:f,p){case"disc":y=jl(v,String(l));break}}if(!y)return;const g=Qr(y),M=g.getBoundingBox(),P=o.fragments[0]?.characters[0];if(!P)return;const{inlineBox:x}=P,C=f==="cover"?1:bn(f,{total:i,fontSize:i})/i,w=new vt;if(n){const v=i/M.height*C;w.translate(-M.left,-M.top).rotate(Math.PI/2).scale(v,v).translate(x.left+(x.width-M.height*v)/2,x.top-s)}else{const v=i/M.height*C;w.translate(-M.left,-M.top).scale(v,v).translate(x.left-M.width*v-s,x.top+(x.height-M.height*v)/2)}r.paths.push(...g.paths.map(v=>{const S=v.clone();return S.applyTransform(w),S.style.fill&&S.style.fill in d&&(S.style.fill=d[S.style.fill]),S.style.stroke&&S.style.stroke in d&&(S.style.stroke=d[S.style.stroke]),S}))})}}}function Hi(){return{name:"outline"}}const oe=new k,Ce=new vt,ae=new vt;function Xi(){const r=new ee;return{name:"render",pathSet:r,update:t=>{r.paths.length=0;const{paragraphs:e}=t;e.forEach(n=>{n.fragments.forEach(i=>{i.characters.forEach(s=>{r.paths.push(s.path)})})})},getBoundingBox:t=>{const{characters:e,fontSize:n,computedEffects:i}=t,s=[];return e.forEach(o=>{i.forEach(a=>{if(!o.glyphBox)return;const l=o.glyphBox.clone(),c=Pn(t,a);oe.set(l.left,l.top),oe.applyMatrix3(c),l.left=oe.x,l.top=oe.y,oe.set(l.right,l.bottom),oe.applyMatrix3(c),l.width=oe.x-l.left,l.height=oe.y-l.top;const h=(a.shadowOffsetX??0)*n,u=(a.shadowOffsetY??0)*n,p=Math.max(.1,a.textStrokeWidth??0)*n;l.left+=h-p,l.top+=u-p,l.width+=p*2,l.height+=p*2,s.push(l)})}),s.length?H.from(...s):void 0},render:t=>{const{text:e,context:n}=t,{paragraphs:i,glyphBox:s,computedEffects:o}=e;o.length?o.forEach(a=>{t.uploadColor(a,s),n.save();const[l,c,h,u,p,d]=Pn(e,a).transpose().elements;n.transform(l,u,c,p,h,d),e.forEachCharacter(f=>{t.drawCharacter(f,a)}),n.restore()}):i.forEach(a=>{a.fragments.forEach(l=>{l.characters.forEach(c=>{t.drawCharacter(c)})})}),e.debug&&i.forEach(a=>{n.strokeRect(a.lineBox.x,a.lineBox.y,a.lineBox.width,a.lineBox.height)})}}}function Pn(r,t){const{fontSize:e,glyphBox:n}=r,i=(t.translateX??0)*e,s=(t.translateY??0)*e,o=Math.PI*2,a=(t.skewX??0)/360*o,l=(t.skewY??0)/360*o,{left:c,top:h,width:u,height:p}=n,d=c+u/2,f=h+p/2;return Ce.identity(),ae.makeTranslation(i,s),Ce.multiply(ae),ae.makeTranslation(d,f),Ce.multiply(ae),ae.set(1,Math.tan(a),0,Math.tan(l),1,0,0,0,1),Ce.multiply(ae),ae.makeTranslation(-d,-f),Ce.multiply(ae),Ce.clone()}function Yi(){const r=new ee;return{name:"textDecoration",pathSet:r,update:t=>{r.paths.length=0;const e=[];let n,i;t.forEachCharacter(s=>{const{computedStyle:o,isVertical:a,inlineBox:l,underlinePosition:c,underlineThickness:h,strikeoutPosition:u,strikeoutSize:p}=s,{color:d,textDecoration:f,writingMode:y}=o;if(J(f))i=void 0;else{let g=!1;if(i?.textDecoration===f&&i?.writingMode===y&&i?.color===d&&(a?n[0].inlineBox.left===l.left:n[0].inlineBox.top===l.top))switch(f){case"underline":n[0].underlinePosition===c&&n[0].underlineThickness===h&&(g=!0);break;case"line-through":n[0].strikeoutPosition===u&&n[0].strikeoutSize===p&&(g=!0);break}g?n.push(s):(n=[],n.push(s),e.push(n)),i=o}}),e.forEach(s=>{const{computedStyle:o,isVertical:a,underlinePosition:l,underlineThickness:c,strikeoutPosition:h,strikeoutSize:u}=s[0],{color:p,textDecoration:d}=o,f=H.from(...s.map(S=>S.inlineBox)),{left:y,top:g,width:M,height:P}=f;let x=a?y+M:g;const C=a?-1:1;let w=0;switch(d){case"overline":w=c*2;break;case"underline":x+=C*l,w=c*2;break;case"line-through":x+=C*h,w=u*2;break}x-=w;let v;a?v=new Pt([{type:"M",x,y:g},{type:"L",x,y:g+P},{type:"L",x:x+w,y:g+P},{type:"L",x:x+w,y:g},{type:"Z"}],{fill:p}):v=new Pt([{type:"M",x:y,y:x},{type:"L",x:y+M,y:x},{type:"L",x:y+M,y:x+w},{type:"L",x:y,y:x+w},{type:"Z"}],{fill:p}),r.paths.push(v)})},render:t=>{const{text:e,context:n}=t,{computedEffects:i}=e;i.length?i.forEach(s=>{n.save();const[o,a,l,c,h,u]=Pn(e,s).transpose().elements;n.transform(o,c,a,h,l,u),r.paths.forEach(p=>{t.drawPath(p,s)}),n.restore()}):r.paths.forEach(s=>{t.drawPath(s)})}}}var Gl=Object.defineProperty,le=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Gl(t,e,i),i};const dr=zs();class zt extends ds{needsUpdate=!0;computedStyle={...dr};computedEffects=[];paragraphs=[];lineBox=new H;rawGlyphBox=new H;glyphBox=new H;pathBox=new H;boundingBox=new H;measurer=new We;plugins=new Map;pathSets=[];get fontSize(){return this.computedStyle.fontSize}get isVertical(){return this.computedStyle.writingMode.includes("vertical")}get characters(){return this.paragraphs.flatMap(t=>t.fragments.flatMap(e=>e.characters))}constructor(t={}){super(),this.set(t)}set(t={}){const{content:e,effects:n,style:i,measureDom:s,fonts:o,fill:a,outline:l}=Ws(t);this.debug=t.debug??!1,this.content=e,this.effects=n,this.style=i,this.measureDom=s,this.fonts=o,this.fill=a,this.outline=l,this.use(Gi()).use(Hi()).use(Wi()).use(Yi()).use(qi()).use(Xi()),(t.plugins??[]).forEach(c=>{this.use(c)}),this._update()}use(t){return this.plugins.set(t.name,t),this}forEachCharacter(t){return this.paragraphs.forEach((e,n)=>{e.fragments.forEach((i,s)=>{i.characters.forEach((o,a)=>{t(o,{paragraphIndex:n,fragmentIndex:s,characterIndex:a})})})}),this}async load(){await Promise.all(Array.from(this.plugins.values()).map(t=>t.load?.(this)))}_update(){this.computedStyle={...dr,...this.style},this.computedEffects=this.effects?.map(n=>({...n}))??[];const{content:t}=this,e=[];return t.forEach((n,i)=>{const{fragments:s,fill:o,outline:a,...l}=n,c=new ji(l,i,this);c.fill=o,c.outline=a,s.forEach((h,u)=>{const{content:p,fill:d,outline:f,...y}=h;if(p!==void 0){const g=new Vi(p,y,u,c);c.fragments.push(g),g.fill=d,g.outline=f}}),e.push(c)}),this.paragraphs=e,this}createDom(){return this._update(),this.measurer.createDom(this.paragraphs,this.computedStyle)}measure(t=this.measureDom){const e={paragraphs:this.paragraphs,lineBox:this.lineBox,rawGlyphBox:this.rawGlyphBox,glyphBox:this.glyphBox,pathBox:this.pathBox,boundingBox:this.boundingBox};this._update();const n=this.measurer.measure(this.paragraphs,this.computedStyle,t);this.paragraphs=n.paragraphs,this.lineBox=n.boundingBox,this.characters.forEach(i=>{i.update(this.fonts)}),this.rawGlyphBox=this.getGlyphBox(),Array.from(this.plugins.values()).sort((i,s)=>(i.updateOrder??0)-(s.updateOrder??0)).forEach(i=>{i.update?.(this)}),this.pathSets.length=0,Array.from(this.plugins.values()).sort((i,s)=>(i.renderOrder??0)-(s.renderOrder??0)).forEach(i=>{i.pathSet?.paths.length&&this.pathSets.push(i.pathSet)}),this.glyphBox=this.getGlyphBox(),this._updatePathBox()._updateBoundingBox();for(const i in e)n[i]=this[i],this[i]=e[i];return this.emit("measure",{text:this,result:n}),n}getGlyphBox(){const t=k.MAX,e=k.MIN;return this.characters.forEach(n=>{if(!n.getGlyphMinMax(t,e)){const{inlineBox:i}=n,{left:s,top:o,width:a,height:l}=i,c=new k(s,o),h=new k(s+a,o+l);t.min(c,h),e.max(c,h)}}),new H(t.x,t.y,e.x-t.x,e.y-t.y)}_updatePathBox(){return this.pathBox=H.from(this.glyphBox,...Array.from(this.plugins.values()).map(t=>t.getBoundingBox?t.getBoundingBox(this):t.pathSet?.getBoundingBox()).filter(Boolean)),this}_updateBoundingBox(){return this.boundingBox=H.from(this.rawGlyphBox,this.lineBox,this.pathBox),this}requestUpdate(){return this.needsUpdate=!0,this}update(t=this.measureDom){this.needsUpdate=!1;const e=this.measure(t);for(const n in e)this[n]=e[n];return this.emit("update",{text:this}),this}render(t){const{view:e,pixelRatio:n=2}=t,i=e.getContext("2d");if(!i)return;this.needsUpdate&&this.update();const s=new ui(this,i);s.pixelRatio=n,s.setup(),Array.from(this.plugins.values()).sort((o,a)=>(o.renderOrder??0)-(a.renderOrder??0)).forEach(o=>{o.render?o.render?.(s):o.pathSet&&o.pathSet.paths.forEach(a=>{s.drawPath(a)})}),this.emit("render",{text:this,view:e,pixelRatio:n}),t.onContext?.(i)}toString(){return this.content.flatMap(t=>t.fragments.map(e=>e.content)).join("")}}le([te({internal:!0})],zt.prototype,"debug"),le([te()],zt.prototype,"content"),le([te()],zt.prototype,"style"),le([te()],zt.prototype,"effects"),le([te()],zt.prototype,"fill"),le([te()],zt.prototype,"outline"),le([te({internal:!0})],zt.prototype,"measureDom"),le([te({internal:!0})],zt.prototype,"fonts");function ql(r,t){const e=new zt(r);return t?e.load().then(()=>e.measure()):e.measure()}function Wl(r,t){const e=new zt(r);return t?e.load().then(()=>e.render(r)):e.render(r)}Y.Canvas2DRenderer=ui,Y.Character=zi,Y.Fragment=Vi,Y.Measurer=We,Y.Paragraph=ji,Y.Text=zt,Y.backgroundPlugin=Gi,Y.createSvgLoader=fr,Y.createSvgParser=pr,Y.definePlugin=Vl,Y.filterEmpty=Cn,Y.getHighlightStyle=Mn,Y.getTransform2D=Pn,Y.hexToRgb=Rl,Y.highlightPlugin=qi,Y.isEqualObject=Ri,Y.isEqualValue=pe,Y.listStylePlugin=Wi,Y.measureText=ql,Y.outlinePlugin=Hi,Y.parseColormap=Sn,Y.parseValueNumber=bn,Y.renderPlugin=Xi,Y.renderText=Wl,Y.textDecorationPlugin=Yi,Y.textDefaultStyle=dr,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})}));
35
+ </svg>`}function Wi(){const r=new ee;return{name:"listStyle",pathSet:r,update:t=>{r.paths.length=0;const{paragraphs:e,isVertical:n,fontSize:i}=t,s=i*.45;e.forEach(o=>{const{computedStyle:a}=o,{color:l,listStyleImage:c,listStyleColormap:h,listStyleSize:u,listStyleType:p}=a,d=Sn(h);let f=u,y;if(!Q(c))y=c;else if(!Q(p)){const v=i*.38/2;f=f==="cover"?v*2:f,p==="disc"&&(y=jl(v,String(l)))}if(!y)return;const g=Qr(y),M=g.getBoundingBox(),P=o.fragments[0]?.characters[0];if(!P)return;const{inlineBox:x}=P,C=f==="cover"?1:bn(f,{total:i,fontSize:i})/i,w=new vt;if(n){const v=i/M.height*C;w.translate(-M.left,-M.top).rotate(Math.PI/2).scale(v,v).translate(x.left+(x.width-M.height*v)/2,x.top-s)}else{const v=i/M.height*C;w.translate(-M.left,-M.top).scale(v,v).translate(x.left-M.width*v-s,x.top+(x.height-M.height*v)/2)}r.paths.push(...g.paths.map(v=>{const S=v.clone();return S.applyTransform(w),S.style.fill&&S.style.fill in d&&(S.style.fill=d[S.style.fill]),S.style.stroke&&S.style.stroke in d&&(S.style.stroke=d[S.style.stroke]),S}))})}}}function Hi(){return{name:"outline"}}const oe=new k,Ce=new vt,ae=new vt;function Xi(){const r=new ee;return{name:"render",pathSet:r,update:t=>{r.paths.length=0;const{paragraphs:e}=t;e.forEach(n=>{n.fragments.forEach(i=>{i.characters.forEach(s=>{r.paths.push(s.path)})})})},getBoundingBox:t=>{const{characters:e,fontSize:n,computedEffects:i}=t,s=[];return e.forEach(o=>{i.forEach(a=>{if(!o.glyphBox)return;const l=o.glyphBox.clone(),c=Pn(t,a);oe.set(l.left,l.top),oe.applyMatrix3(c),l.left=oe.x,l.top=oe.y,oe.set(l.right,l.bottom),oe.applyMatrix3(c),l.width=oe.x-l.left,l.height=oe.y-l.top;const h=(a.shadowOffsetX??0)*n,u=(a.shadowOffsetY??0)*n,p=Math.max(.1,a.textStrokeWidth??0)*n;l.left+=h-p,l.top+=u-p,l.width+=p*2,l.height+=p*2,s.push(l)})}),s.length?H.from(...s):void 0},render:t=>{const{text:e,context:n}=t,{paragraphs:i,glyphBox:s,computedEffects:o}=e;o.length?o.forEach(a=>{t.uploadColor(a,s),n.save();const[l,c,h,u,p,d]=Pn(e,a).transpose().elements;n.transform(l,u,c,p,h,d),e.forEachCharacter(f=>{t.drawCharacter(f,a)}),n.restore()}):i.forEach(a=>{a.fragments.forEach(l=>{l.characters.forEach(c=>{t.drawCharacter(c)})})}),e.debug&&i.forEach(a=>{n.strokeRect(a.lineBox.x,a.lineBox.y,a.lineBox.width,a.lineBox.height)})}}}function Pn(r,t){const{fontSize:e,glyphBox:n}=r,i=(t.translateX??0)*e,s=(t.translateY??0)*e,o=Math.PI*2,a=(t.skewX??0)/360*o,l=(t.skewY??0)/360*o,{left:c,top:h,width:u,height:p}=n,d=c+u/2,f=h+p/2;return Ce.identity(),ae.makeTranslation(i,s),Ce.multiply(ae),ae.makeTranslation(d,f),Ce.multiply(ae),ae.set(1,Math.tan(a),0,Math.tan(l),1,0,0,0,1),Ce.multiply(ae),ae.makeTranslation(-d,-f),Ce.multiply(ae),Ce.clone()}function Yi(){const r=new ee;return{name:"textDecoration",pathSet:r,update:t=>{r.paths.length=0;const e=[];let n,i;t.forEachCharacter(s=>{const{computedStyle:o,isVertical:a,inlineBox:l,underlinePosition:c,underlineThickness:h,strikeoutPosition:u,strikeoutSize:p}=s,{color:d,textDecoration:f,writingMode:y}=o;if(Q(f))i=void 0;else{let g=!1;if(i?.textDecoration===f&&i?.writingMode===y&&i?.color===d&&(a?n[0].inlineBox.left===l.left:n[0].inlineBox.top===l.top))switch(f){case"underline":n[0].underlinePosition===c&&n[0].underlineThickness===h&&(g=!0);break;case"line-through":n[0].strikeoutPosition===u&&n[0].strikeoutSize===p&&(g=!0);break}g?n.push(s):(n=[],n.push(s),e.push(n)),i=o}}),e.forEach(s=>{const{computedStyle:o,isVertical:a,underlinePosition:l,underlineThickness:c,strikeoutPosition:h,strikeoutSize:u}=s[0],{color:p,textDecoration:d}=o,f=H.from(...s.map(S=>S.inlineBox)),{left:y,top:g,width:M,height:P}=f;let x=a?y+M:g;const C=a?-1:1;let w=0;switch(d){case"overline":w=c*2;break;case"underline":x+=C*l,w=c*2;break;case"line-through":x+=C*h,w=u*2;break}x-=w;let v;a?v=new Pt([{type:"M",x,y:g},{type:"L",x,y:g+P},{type:"L",x:x+w,y:g+P},{type:"L",x:x+w,y:g},{type:"Z"}],{fill:p}):v=new Pt([{type:"M",x:y,y:x},{type:"L",x:y+M,y:x},{type:"L",x:y+M,y:x+w},{type:"L",x:y,y:x+w},{type:"Z"}],{fill:p}),r.paths.push(v)})},render:t=>{const{text:e,context:n}=t,{computedEffects:i}=e;i.length?i.forEach(s=>{n.save();const[o,a,l,c,h,u]=Pn(e,s).transpose().elements;n.transform(o,c,a,h,l,u),r.paths.forEach(p=>{t.drawPath(p,s)}),n.restore()}):r.paths.forEach(s=>{t.drawPath(s)})}}}var Gl=Object.defineProperty,le=(r,t,e,n)=>{for(var i=void 0,s=r.length-1,o;s>=0;s--)(o=r[s])&&(i=o(t,e,i)||i);return i&&Gl(t,e,i),i};const dr=zs();class zt extends ds{needsUpdate=!0;computedStyle={...dr};computedEffects=[];paragraphs=[];lineBox=new H;rawGlyphBox=new H;glyphBox=new H;pathBox=new H;boundingBox=new H;measurer=new We;plugins=new Map;pathSets=[];get fontSize(){return this.computedStyle.fontSize}get isVertical(){return this.computedStyle.writingMode.includes("vertical")}get characters(){return this.paragraphs.flatMap(t=>t.fragments.flatMap(e=>e.characters))}constructor(t={}){super(),this.set(t)}set(t={}){const{content:e,effects:n,style:i,measureDom:s,fonts:o,fill:a,outline:l}=Ws(t);this.debug=t.debug??!1,this.content=e,this.effects=n,this.style=i,this.measureDom=s,this.fonts=o,this.fill=a,this.outline=l,this.use(Gi()).use(Hi()).use(Wi()).use(Yi()).use(qi()).use(Xi()),(t.plugins??[]).forEach(c=>{this.use(c)}),this._update()}use(t){return this.plugins.set(t.name,t),this}forEachCharacter(t){return this.paragraphs.forEach((e,n)=>{e.fragments.forEach((i,s)=>{i.characters.forEach((o,a)=>{t(o,{paragraphIndex:n,fragmentIndex:s,characterIndex:a})})})}),this}async load(){await Promise.all(Array.from(this.plugins.values()).map(t=>t.load?.(this)))}_update(){this.computedStyle={...dr,...this.style},this.computedEffects=this.effects?.map(n=>({...n}))??[];const{content:t}=this,e=[];return t.forEach((n,i)=>{const{fragments:s,fill:o,outline:a,...l}=n,c=new ji(l,i,this);c.fill=o,c.outline=a,s.forEach((h,u)=>{const{content:p,fill:d,outline:f,...y}=h;if(p!==void 0){const g=new Vi(p,y,u,c);c.fragments.push(g),g.fill=d,g.outline=f}}),e.push(c)}),this.paragraphs=e,this}createDom(){return this._update(),this.measurer.createDom(this.paragraphs,this.computedStyle)}measure(t=this.measureDom){const e={paragraphs:this.paragraphs,lineBox:this.lineBox,rawGlyphBox:this.rawGlyphBox,glyphBox:this.glyphBox,pathBox:this.pathBox,boundingBox:this.boundingBox};this._update();const n=this.measurer.measure(this.paragraphs,this.computedStyle,t);this.paragraphs=n.paragraphs,this.lineBox=n.boundingBox,this.characters.forEach(i=>{i.update(this.fonts)}),this.rawGlyphBox=this.getGlyphBox(),Array.from(this.plugins.values()).sort((i,s)=>(i.updateOrder??0)-(s.updateOrder??0)).forEach(i=>{i.update?.(this)}),this.pathSets.length=0,Array.from(this.plugins.values()).sort((i,s)=>(i.renderOrder??0)-(s.renderOrder??0)).forEach(i=>{i.pathSet?.paths.length&&this.pathSets.push(i.pathSet)}),this.glyphBox=this.getGlyphBox(),this._updatePathBox()._updateBoundingBox();for(const i in e)n[i]=this[i],this[i]=e[i];return this.emit("measure",{text:this,result:n}),n}getGlyphBox(){const t=k.MAX,e=k.MIN;return this.characters.forEach(n=>{if(!n.getGlyphMinMax(t,e)){const{inlineBox:i}=n,{left:s,top:o,width:a,height:l}=i,c=new k(s,o),h=new k(s+a,o+l);t.min(c,h),e.max(c,h)}}),new H(t.x,t.y,e.x-t.x,e.y-t.y)}_updatePathBox(){return this.pathBox=H.from(this.glyphBox,...Array.from(this.plugins.values()).map(t=>t.getBoundingBox?t.getBoundingBox(this):t.pathSet?.getBoundingBox()).filter(Boolean)),this}_updateBoundingBox(){return this.boundingBox=H.from(this.rawGlyphBox,this.lineBox,this.pathBox),this}requestUpdate(){return this.needsUpdate=!0,this}update(t=this.measureDom){this.needsUpdate=!1;const e=this.measure(t);for(const n in e)this[n]=e[n];return this.emit("update",{text:this}),this}render(t){const{view:e,pixelRatio:n=2}=t,i=e.getContext("2d");if(!i)return;this.needsUpdate&&this.update();const s=new ui(this,i);s.pixelRatio=n,s.setup(),Array.from(this.plugins.values()).sort((o,a)=>(o.renderOrder??0)-(a.renderOrder??0)).forEach(o=>{o.render?o.render?.(s):o.pathSet&&o.pathSet.paths.forEach(a=>{s.drawPath(a)})}),this.emit("render",{text:this,view:e,pixelRatio:n}),t.onContext?.(i)}toString(){return this.content.flatMap(t=>t.fragments.map(e=>e.content)).join("")}}le([te({internal:!0})],zt.prototype,"debug"),le([te()],zt.prototype,"content"),le([te()],zt.prototype,"style"),le([te()],zt.prototype,"effects"),le([te()],zt.prototype,"fill"),le([te()],zt.prototype,"outline"),le([te({internal:!0})],zt.prototype,"measureDom"),le([te({internal:!0})],zt.prototype,"fonts");function ql(r,t){const e=new zt(r);return t?e.load().then(()=>e.measure()):e.measure()}function Wl(r,t){const e=new zt(r);return t?e.load().then(()=>e.render(r)):e.render(r)}Y.Canvas2DRenderer=ui,Y.Character=zi,Y.Fragment=Vi,Y.Measurer=We,Y.Paragraph=ji,Y.Text=zt,Y.backgroundPlugin=Gi,Y.createSvgLoader=fr,Y.createSvgParser=pr,Y.definePlugin=Vl,Y.filterEmpty=Cn,Y.getHighlightStyle=Mn,Y.getTransform2D=Pn,Y.hexToRgb=Rl,Y.highlightPlugin=qi,Y.isEqualObject=Ri,Y.isEqualValue=pe,Y.listStylePlugin=Wi,Y.measureText=ql,Y.outlinePlugin=Hi,Y.parseColormap=Sn,Y.parseValueNumber=bn,Y.renderPlugin=Xi,Y.renderText=Wl,Y.textDecorationPlugin=Yi,Y.textDefaultStyle=dr,Object.defineProperty(Y,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "modern-text",
3
3
  "type": "module",
4
- "version": "1.10.5",
4
+ "version": "1.10.6",
5
5
  "packageManager": "pnpm@10.18.1",
6
6
  "description": "Measure and render text in a way that describes the DOM.",
7
7
  "author": "wxm",
@@ -56,18 +56,18 @@
56
56
  "dependencies": {
57
57
  "diff": "^8.0.2",
58
58
  "modern-font": "^0.4.4",
59
- "modern-idoc": "^0.10.6",
60
- "modern-path2d": "^1.4.15"
59
+ "modern-idoc": "^0.10.8",
60
+ "modern-path2d": "^1.4.16"
61
61
  },
62
62
  "devDependencies": {
63
- "@antfu/eslint-config": "^6.6.1",
64
- "@types/node": "^24.10.2",
63
+ "@antfu/eslint-config": "^6.7.3",
64
+ "@types/node": "^25.0.3",
65
65
  "bumpp": "^10.3.2",
66
66
  "conventional-changelog-cli": "^5.0.0",
67
- "eslint": "^9.39.1",
67
+ "eslint": "^9.39.2",
68
68
  "typescript": "^5.9.3",
69
69
  "unbuild": "^3.6.1",
70
- "vite": "^7.2.7",
71
- "vitest": "^4.0.15"
70
+ "vite": "^7.3.0",
71
+ "vitest": "^4.0.16"
72
72
  }
73
73
  }