modern-canvas 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +59 -60
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(g,CA){typeof exports=="object"&&typeof module<"u"?CA(exports):typeof define=="function"&&define.amd?define(["exports"],CA):(g=typeof globalThis<"u"?globalThis:g||self,CA(g.modernCanvas={}))})(this,(function(g){"use strict";var CA=typeof document<"u"?document.currentScript:null,Tc={grad:.9,turn:360,rad:360/(2*Math.PI)},He=function(r){return typeof r=="string"?r.length>0:typeof r=="number"},Rt=function(r,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*r)/e+0},de=function(r,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),r>e?e:r>t?r:t},co=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},ho=function(r){return{r:de(r.r,0,255),g:de(r.g,0,255),b:de(r.b,0,255),a:de(r.a)}},ns=function(r){return{r:Rt(r.r),g:Rt(r.g),b:Rt(r.b),a:Rt(r.a,3)}},Lc=/^#([0-9a-f]{3,8})$/i,ji=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},go=function(r){var t=r.r,e=r.g,A=r.b,i=r.a,s=Math.max(t,e,A),n=s-Math.min(t,e,A),o=n?s===t?(e-A)/n:s===e?2+(A-t)/n:4+(t-e)/n:0;return{h:60*(o<0?o+6:o),s:s?n/s*100:0,v:s/255*100,a:i}},uo=function(r){var t=r.h,e=r.s,A=r.v,i=r.a;t=t/360*6,e/=100,A/=100;var s=Math.floor(t),n=A*(1-e),o=A*(1-(t-s)*e),a=A*(1-(1-t+s)*e),l=s%6;return{r:255*[A,o,n,n,a,A][l],g:255*[a,A,A,o,n,n][l],b:255*[n,n,a,A,A,o][l],a:i}},fo=function(r){return{h:co(r.h),s:de(r.s,0,100),l:de(r.l,0,100),a:de(r.a)}},Io=function(r){return{h:Rt(r.h),s:Rt(r.s),l:Rt(r.l),a:Rt(r.a,3)}},po=function(r){return uo((e=(t=r).s,{h:t.h,s:(e*=((A=t.l)<50?A:100-A)/100)>0?2*e/(A+e)*100:0,v:A+e,a:t.a}));var t,e,A},si=function(r){return{h:(t=go(r)).h,s:(i=(200-(e=t.s))*(A=t.v)/100)>0&&i<200?e*A/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,e,A,i},Gc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Oc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Hc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Jc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,os={string:[[function(r){var t=Lc.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?Rt(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?Rt(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=Hc.exec(r)||Jc.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:ho({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=Gc.exec(r)||Oc.exec(r);if(!t)return null;var e,A,i=fo({h:(e=t[1],A=t[2],A===void 0&&(A="deg"),Number(e)*(Tc[A]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return po(i)},"hsl"]],object:[[function(r){var t=r.r,e=r.g,A=r.b,i=r.a,s=i===void 0?1:i;return He(t)&&He(e)&&He(A)?ho({r:Number(t),g:Number(e),b:Number(A),a:Number(s)}):null},"rgb"],[function(r){var t=r.h,e=r.s,A=r.l,i=r.a,s=i===void 0?1:i;if(!He(t)||!He(e)||!He(A))return null;var n=fo({h:Number(t),s:Number(e),l:Number(A),a:Number(s)});return po(n)},"hsl"],[function(r){var t=r.h,e=r.s,A=r.v,i=r.a,s=i===void 0?1:i;if(!He(t)||!He(e)||!He(A))return null;var n=(function(o){return{h:co(o.h),s:de(o.s,0,100),v:de(o.v,0,100),a:de(o.a)}})({h:Number(t),s:Number(e),v:Number(A),a:Number(s)});return uo(n)},"hsv"]]},Eo=function(r,t){for(var e=0;e<t.length;e++){var A=t[e][0](r);if(A)return[A,t[e][1]]}return[null,void 0]},Kc=function(r){return typeof r=="string"?Eo(r.trim(),os.string):typeof r=="object"&&r!==null?Eo(r,os.object):[null,void 0]},as=function(r,t){var e=si(r);return{h:e.h,s:de(e.s+100*t,0,100),l:e.l,a:e.a}},ls=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},Bo=function(r,t){var e=si(r);return{h:e.h,s:e.s,l:de(e.l+100*t,0,100),a:e.a}},cs=(function(){function r(t){this.parsed=Kc(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 Rt(ls(this.rgba),2)},r.prototype.isDark=function(){return ls(this.rgba)<.5},r.prototype.isLight=function(){return ls(this.rgba)>=.5},r.prototype.toHex=function(){return t=ns(this.rgba),e=t.r,A=t.g,i=t.b,n=(s=t.a)<1?ji(Rt(255*s)):"","#"+ji(e)+ji(A)+ji(i)+n;var t,e,A,i,s,n},r.prototype.toRgb=function(){return ns(this.rgba)},r.prototype.toRgbString=function(){return t=ns(this.rgba),e=t.r,A=t.g,i=t.b,(s=t.a)<1?"rgba("+e+", "+A+", "+i+", "+s+")":"rgb("+e+", "+A+", "+i+")";var t,e,A,i,s},r.prototype.toHsl=function(){return Io(si(this.rgba))},r.prototype.toHslString=function(){return t=Io(si(this.rgba)),e=t.h,A=t.s,i=t.l,(s=t.a)<1?"hsla("+e+", "+A+"%, "+i+"%, "+s+")":"hsl("+e+", "+A+"%, "+i+"%)";var t,e,A,i,s},r.prototype.toHsv=function(){return t=go(this.rgba),{h:Rt(t.h),s:Rt(t.s),v:Rt(t.v),a:Rt(t.a,3)};var t},r.prototype.invert=function(){return _e({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),_e(as(this.rgba,t))},r.prototype.desaturate=function(t){return t===void 0&&(t=.1),_e(as(this.rgba,-t))},r.prototype.grayscale=function(){return _e(as(this.rgba,-1))},r.prototype.lighten=function(t){return t===void 0&&(t=.1),_e(Bo(this.rgba,t))},r.prototype.darken=function(t){return t===void 0&&(t=.1),_e(Bo(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"?_e({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):Rt(this.rgba.a,3);var e},r.prototype.hue=function(t){var e=si(this.rgba);return typeof t=="number"?_e({h:t,s:e.s,l:e.l,a:e.a}):Rt(e.h)},r.prototype.isEqual=function(t){return this.toHex()===_e(t).toHex()},r})(),_e=function(r){return r instanceof cs?r:new cs(r)},Co=[],Yc=function(r){r.forEach(function(t){Co.indexOf(t)<0&&(t(cs,os),Co.push(t))})};const Vc="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Wc=(r=21)=>{let t="",e=crypto.getRandomValues(new Uint8Array(r|=0));for(;r--;)t+=Vc[e[r]&63];return t};class Je{eventListeners=new Map;addEventListener(t,e,A){const i={value:e,options:A},s=this.eventListeners.get(t);return s?Array.isArray(s)?s.push(i):this.eventListeners.set(t,[s,i]):this.eventListeners.set(t,i),this}removeEventListener(t,e,A){if(!e)return this.eventListeners.delete(t),this;const i=this.eventListeners.get(t);if(!i)return this;if(Array.isArray(i)){const s=[];for(let n=0,o=i.length;n<o;n++){const a=i[n];(a.value!==e||typeof A=="object"&&A?.once&&(typeof a.options=="boolean"||!a.options?.once))&&s.push(a)}s.length?this.eventListeners.set(t,s.length===1?s[0]:s):this.eventListeners.delete(t)}else i.value===e&&(typeof A=="boolean"||!A?.once||typeof i.options=="boolean"||i.options?.once)&&this.eventListeners.delete(t);return this}removeAllListeners(){return this.eventListeners.clear(),this}hasEventListener(t){return this.eventListeners.has(t)}dispatchEvent(t,...e){const A=this.eventListeners.get(t);if(A){if(Array.isArray(A))for(let i=A.length,s=0;s<i;s++){const n=A[s];typeof n.options=="object"&&n.options?.once&&this.off(t,n.value,n.options),n.value.apply(this,e)}else typeof A.options=="object"&&A.options?.once&&this.off(t,A.value,A.options),A.value.apply(this,e);return!0}else return!1}on(t,e,A){return this.addEventListener(t,e,A)}once(t,e){return this.addEventListener(t,e,{once:!0})}off(t,e,A){return this.removeEventListener(t,e,A)}emit(t,...e){this.dispatchEvent(t,...e)}}function lt(r){return r==null||r==="none"}function TA(r,t=0,e=10**t){return Math.round(e*r)/e+0}function ae(r,t=!1){if(typeof r!="object"||!r)return r;if(Array.isArray(r))return t?r.map(A=>ae(A,t)):r;const e={};for(const A in r){const i=r[A];i!=null&&(t?e[A]=ae(i,t):e[A]=i)}return e}function hs(r,t){const e={};return t.forEach(A=>{A in r&&(e[A]=r[A])}),e}function gs(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(A=>r[A]===t[A])}return!1}function zc(r,t,e){const A=t.length-1;if(A<0)return r===void 0?e:r;for(let i=0;i<A;i++){if(r==null)return e;r=r[t[i]]}return r==null||r[t[A]]===void 0?e:r[t[A]]}function qc(r,t,e){const A=t.length-1;for(let i=0;i<A;i++)typeof r[t[i]]!="object"&&(r[t[i]]={}),r=r[t[i]];r[t[A]]=e}function Xc(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(/^\./,""),zc(r,t.split("."),e))}function jc(r,t,e){if(!(typeof r!="object"||!t))return t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,""),qc(r,t.split("."),e)}let Qo=class{_map=new WeakMap;_toRaw(t){if(t&&typeof t=="object"){const e=t.__v_raw;e&&(t=this._toRaw(e))}return t}delete(t){return this._map.delete(this._toRaw(t))}get(t){return this._map.get(this._toRaw(t))}has(t){return this._map.has(this._toRaw(t))}set(t,e){return this._map.set(this._toRaw(t),this._toRaw(e)),this}};function us(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,_e(t)}function Zc(r){return{r:TA(r.r),g:TA(r.g),b:TA(r.b),a:TA(r.a,3)}}function Zi(r){const t=r.toString(16);return t.length<2?`0${t}`:t}const yo="#000000FF";function $c(r){return us(r).isValid()}function se(r,t=!1){const e=us(r);if(!e.isValid()){if(typeof r=="string")return r;const o=`Failed to normalizeColor ${r}`;if(t)throw new Error(o);return console.warn(o),yo}const{r:A,g:i,b:s,a:n}=Zc(e.rgba);return`#${Zi(A)}${Zi(i)}${Zi(s)}${Zi(TA(n*255))}`}var $i=$i||{};$i.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(U){const P=new Error(`${t}: ${U}`);throw P.source=t,P}function A(){const U=i();return t.length>0&&e("Invalid input not EOF"),U}function i(){return w(s)}function s(){return n("linear-gradient",r.linearGradient,a)||n("repeating-linear-gradient",r.repeatingLinearGradient,a)||n("radial-gradient",r.radialGradient,h)||n("repeating-radial-gradient",r.repeatingRadialGradient,h)}function n(U,P,q){return o(P,$=>{const nt=q();return nt&&(K(r.comma)||e("Missing comma before color stops")),{type:U,orientation:nt,colorStops:w(S)}})}function o(U,P){const q=K(U);if(q){K(r.startCall)||e("Missing (");const $=P(q);return K(r.endCall)||e("Missing )"),$}}function a(){const U=l();if(U)return U;const P=tt("position-keyword",r.positionKeywords,1);return P?{type:"directional",value:P.value}:c()}function l(){return tt("directional",r.sideOrCorner,1)}function c(){return tt("angular",r.angleValue,1)||tt("angular",r.radianValue,1)}function h(){let U,P=u(),q;return P&&(U=[],U.push(P),q=t,K(r.comma)&&(P=u(),P?U.push(P):t=q)),U}function u(){let U=d()||f();if(U)U.at=p();else{const P=B();if(P){U=P;const q=p();q&&(U.at=q)}else{const q=p();if(q)U={type:"default-radial",at:q};else{const $=D();$&&(U={type:"default-radial",at:$})}}}return U}function d(){const U=tt("shape",/^(circle)/i,0);return U&&(U.style=z()||B()),U}function f(){const U=tt("shape",/^(ellipse)/i,0);return U&&(U.style=D()||T()||B()),U}function B(){return tt("extent-keyword",r.extentKeywords,1)}function p(){if(tt("position",/^at/,0)){const U=D();return U||e("Missing positioning value"),U}}function D(){const U=R();if(U.x||U.y)return{type:"position",value:U}}function R(){return{x:T(),y:T()}}function w(U){let P=U();const q=[];if(P)for(q.push(P);K(r.comma);)P=U(),P?q.push(P):e("One extra comma");return q}function S(){const U=Q();return U||e("Expected color definition"),U.length=T(),U}function Q(){return x()||H()||W()||V()||M()||et()||m()}function m(){return tt("literal",r.literalColor,0)}function x(){return tt("hex",r.hexColor,1)}function M(){return o(r.rgbColor,()=>({type:"rgb",value:w(J)}))}function V(){return o(r.rgbaColor,()=>({type:"rgba",value:w(J)}))}function et(){return o(r.varColor,()=>({type:"var",value:Z()}))}function W(){return o(r.hslColor,()=>{K(r.percentageValue)&&e("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");const P=J();K(r.comma);let q=K(r.percentageValue);const $=q?q[1]:null;K(r.comma),q=K(r.percentageValue);const nt=q?q[1]:null;return(!$||!nt)&&e("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[P,$,nt]}})}function H(){return o(r.hslaColor,()=>{const U=J();K(r.comma);let P=K(r.percentageValue);const q=P?P[1]:null;K(r.comma),P=K(r.percentageValue);const $=P?P[1]:null;K(r.comma);const nt=J();return(!q||!$)&&e("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[U,q,$,nt]}})}function Z(){return K(r.variableName)[1]}function J(){return K(r.number)[1]}function T(){return tt("%",r.percentageValue,1)||it()||L()||z()}function it(){return tt("position-keyword",r.positionKeywords,1)}function L(){return o(r.calcValue,()=>{let U=1,P=0;for(;U>0&&P<t.length;){const $=t.charAt(P);$==="("?U++:$===")"&&U--,P++}U>0&&e("Missing closing parenthesis in calc() expression");const q=t.substring(0,P-1);return At(P-1),{type:"calc",value:q}})}function z(){return tt("px",r.pixelValue,1)||tt("em",r.emValue,1)}function tt(U,P,q){const $=K(P);if($)return{type:U,value:$[q]}}function K(U){let P,q;return q=/^\s+/.exec(t),q&&At(q[0].length),P=U.exec(t),P&&At(P[0].length),P}function At(U){t=t.substr(U)}return function(U){return t=U.toString().trim(),t.endsWith(";")&&(t=t.slice(0,-1)),A()}})();const th=$i.parse.bind($i);var tr=tr||{};tr.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,A=r.visit(t.at),i=r.visit(t.style);return i&&(e+=" "+i),A&&(e+=" at "+A),e},"visit_default-radial":function(t){var e="",A=r.visit(t.at);return A&&(e+=A),e},"visit_extent-keyword":function(t){var e=t.value,A=r.visit(t.at);return A&&(e+=" at "+A),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 A=t,i=r.visit(e.length);return i&&(A+=" "+i),A},visit_angular:function(t){return t.value+"deg"},visit_directional:function(t){return"to "+t.value},visit_array:function(t){var e="",A=t.length;return t.forEach(function(i,s){e+=r.visit(i),s<A-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)}})(),tr.stringify.bind(tr);function mo(r){const t=r.length-1;return r.map((e,A)=>{const i=e.value;let s=TA(A/t,3),n="#00000000";switch(e.type){case"rgb":n=se({r:Number(i[0]??0),g:Number(i[1]??0),b:Number(i[2]??0)});break;case"rgba":n=se({r:Number(i[0]??0),g:Number(i[1]??0),b:Number(i[2]??0),a:Number(i[3]??0)});break;case"literal":n=se(e.value);break;case"hex":n=se(`#${e.value}`);break}switch(e.length?.type){case"%":s=Number(e.length.value)/100;break}return{offset:s,color:n}})}function wo(r){let t=0;switch(r.orientation?.type){case"angular":t=Number(r.orientation.value);break}return{type:"linear-gradient",angle:t,stops:mo(r.colorStops)}}function vo(r){return r.orientation?.map(t=>{switch(t?.type){case"shape":case"default-radial":case"extent-keyword":default:return null}}),{type:"radial-gradient",stops:mo(r.colorStops)}}function ni(r){return r.startsWith("linear-gradient(")||r.startsWith("radial-gradient(")}function eh(r){return th(r).map(t=>{switch(t?.type){case"linear-gradient":return wo(t);case"repeating-linear-gradient":return{...wo(t),repeat:!0};case"radial-gradient":return vo(t);case"repeating-radial-gradient":return{...vo(t),repeat:!0};default:return}}).filter(Boolean)}function Ah(r){let t;return typeof r=="string"?t={color:r}:t=r,{color:se(t.color)}}function ih(r){let t;if(typeof r=="string"?t={image:r}:t=r,t.image){const{type:e,...A}=eh(t.image)[0]??{};switch(e){case"radial-gradient":return{radialGradient:A};case"linear-gradient":return{linearGradient:A}}}return t}function rh(r){let t;return typeof r=="string"?t={image:r}:t=r,t}function sh(r){let t;return typeof r=="string"?t={preset:r}:t=r,{preset:t.preset,foregroundColor:lt(t.foregroundColor)?void 0:se(t.foregroundColor),backgroundColor:lt(t.backgroundColor)?void 0:se(t.backgroundColor)}}function fs(r){return!lt(r.color)}function nh(r){return typeof r=="string"?$c(r):fs(r)}function oh(r){return!lt(r.image)&&ni(r.image)||!!r.linearGradient||!!r.radialGradient}function ah(r){return typeof r=="string"?ni(r):oh(r)}function lh(r){return!lt(r.image)&&!ni(r.image)}function ch(r){return typeof r=="string"?!ni(r):lh(r)}function hh(r){return!lt(r.preset)}function gh(r){return typeof r=="string"?!1:hh(r)}function be(r){const t=r&&typeof r=="object"?r.enabled:void 0;return nh(r)?ae({enabled:t,...Ah(r)}):ah(r)?ae({enabled:t,...ih(r)}):ch(r)?ae({enabled:t,...rh(r)}):gh(r)?ae({enabled:t,...sh(r)}):{}}function uh(r){return typeof r=="string"?{...be(r)}:{...be(r),...hs(r,["fillWithShape"])}}const ds=Symbol("properties"),_o=Symbol("defaultValueInited");function Is(r){let t;if(Object.hasOwn(r,ds))t=r[ds];else{const e=Object.getPrototypeOf(r);t=new Map(e?Is(e):void 0),r[ds]=t}return t}function fh(r,t={}){const e=Symbol.for(r),{default:A,fallback:i,alias:s}=t,n={declaration:t,internalKey:e},o=()=>typeof A=="function"?A():A,a=()=>typeof i=="function"?i():i;function l(){let h;if(s&&s!==r?h=Xc(this,s):typeof this.getter<"u"?h=this.getter(r,n):h=this[e],h=h??a(),h===void 0&&A!==void 0&&!this[_o]){this[_o]=!0;const u=o();u!==void 0&&(c.call(this,u),h=u)}return h}function c(h){s&&s!==r?jc(this,s,h):typeof this.setter<"u"?this.setter(r,h,n):this[e]=h}return{get:l,set:c}}function er(r,t,e={}){Is(r).set(t,e);const A=fh(t,e);Object.defineProperty(r.prototype,t,{get(){return A.get.call(this)},set(i){const s=A.get.call(this);A.set.call(this,i),this.onUpdateProperty?.(t,i,s,e)},configurable:!0,enumerable:!0})}function v(r){return function(t,e){if(typeof e!="string")throw new TypeError("Failed to @property decorator, prop name cannot be a symbol");er(t.constructor,e,r)}}function dh(r){return typeof r=="string"?{...be(r)}:{...be(r),...hs(r,["fillWithShape"])}}const bo=()=>Wc(10);function Ar(r){return typeof r=="string"?{...be(r)}:{...be(r),...hs(r,["width","style","lineCap","lineJoin","headEnd","tailEnd"])}}function Ih(r){return typeof r=="string"?{color:se(r)}:{...r,color:lt(r.color)?yo:se(r.color)}}function ph(){return{boxShadow:"none"}}function Eh(r){return typeof r=="string"?r.startsWith("<svg")?{svg:r}:{paths:[{data:r}]}:Array.isArray(r)?{paths:r.map(t=>typeof t=="string"?{data:t}:t)}:r}function Bh(){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 Ch(){return{rotate:0,scaleX:1,scaleY:1,skewX:0,skewY:0,translateX:0,translateY:0,transform:"none",transformOrigin:"center"}}function Qh(){return{...Bh(),...Ch(),...ph(),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 yh(){return{highlight:{},highlightImage:"none",highlightReferImage:"none",highlightColormap:"none",highlightLine:"none",highlightSize:"cover",highlightThickness:"100%"}}function mh(){return{listStyle:{},listStyleType:"none",listStyleImage:"none",listStyleColormap:"none",listStyleSize:"cover",listStylePosition:"outside"}}function wh(){return{...yh(),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 vh(){return{...mh(),writingMode:"horizontal-tb",textWrap:"wrap",textAlign:"start",textIndent:0,lineHeight:1.2}}function _h(){return{...vh(),...wh(),textStrokeWidth:0,textStrokeColor:"rgb(0, 0, 0)"}}function ir(r){return ae({...r,color:lt(r.color)?void 0:se(r.color),backgroundColor:lt(r.backgroundColor)?void 0:se(r.backgroundColor),borderColor:lt(r.borderColor)?void 0:se(r.borderColor),outlineColor:lt(r.outlineColor)?void 0:se(r.outlineColor),shadowColor:lt(r.shadowColor)?void 0:se(r.shadowColor)})}function Do(){return{...Qh(),..._h()}}const bh=/\r\n|\n\r|\n|\r/,Dh=new RegExp(`^(${bh.source})$`),xh=`
|
|
2
|
-
`;function Sh(r){return Dh.test(r)}function ps(r){const t=[];function e(){return t[t.length-1]}function A(o,a,l){const c=o?ir(o):{},h=a?be(a):void 0,u=l?Ar(l):void 0,d=ae({...c,fill:h,outline:u,fragments:[]});return t[t.length-1]?.fragments.length===0?t[t.length-1]=d:t.push(d),d}function i(o="",a,l,c){const h=a?ir(a):{},u=l?be(l):void 0,d=c?Ar(c):void 0;Array.from(o).forEach(f=>{if(Sh(f)){const{fragments:B,fill:p,outline:D,...R}=e()||A();B.length||B.push(ae({...h,fill:u,outline:d,content:xh})),A(R,p,D)}else{const B=e()||A(),p=B.fragments[B.fragments.length-1];if(p){const{content:D,fill:R,outline:w,...S}=p;if(gs(u,R)&&gs(d,w)&&gs(h,S)){p.content=`${D}${f}`;return}}B.fragments.push(ae({...h,fill:u,outline:d,content:f}))}})}(Array.isArray(r)?r:[r]).forEach(o=>{if(typeof o=="string")A(),i(o);else if(xo(o)){const{content:a,fill:l,outline:c,...h}=o;A(h,l,c),i(a)}else if(Mh(o)){const{fragments:a,fill:l,outline:c,...h}=o;A(h,l,c),a.forEach(u=>{const{content:d,fill:f,outline:B,...p}=u;i(d,p,f,B)})}else Array.isArray(o)?(A(),o.forEach(a=>{if(typeof a=="string")i(a);else if(xo(a)){const{content:l,fill:c,outline:h,...u}=a;i(l,u,c,h)}})):console.warn("Failed to parse text content",o)});const n=e();return n&&!n.fragments.length&&n.fragments.push({content:""}),t}function Mh(r){return r&&typeof r=="object"&&"fragments"in r&&Array.isArray(r.fragments)}function xo(r){return r&&typeof r=="object"&&"content"in r&&typeof r.content=="string"}function So(r){return typeof r=="string"||Array.isArray(r)?{content:ps(r)}:ae({...r,content:ps(r.content??""),style:r.style?ir(r.style):void 0,effects:r.effects?r.effects.map(t=>ir(t)):void 0,measureDom:r.measureDom,fonts:r.fonts,fill:r.fill?be(r.fill):void 0,outline:r.outline?Ar(r.outline):void 0})}const rr=new Map;function st(r,t){return function(e){Object.defineProperty(e.prototype,"is",{value:r,enumerable:!0,configurable:!0}),t&&Object.keys(t).forEach(A=>{er(e,A,{fallback:t[A]})}),rr.set(r,e)}}function Rh(r="node",t={}){const e=rr.get(r);if(!e)throw new Error(`Failed to createNode, tag: ${r}`);return new e().setProperties(t)}class Kt{static _queue=[];static _currentTime=0;static _elapsed=0;static _requestId;static get currentTime(){return this._currentTime}static get elapsed(){return this._elapsed}static on(t,e={}){const{sort:A=0,once:i=!1}=e;this._queue[A]||(this._queue[A]=[]),this._queue[A].push({cb:t,once:i})}static off(t,e={}){const{sort:A=0}=e,i=this._queue[A];if(!i)return;const s=[];for(let n=i.length,o=0;o<n;o++){const a=i[o];a.cb!==t&&s.push(a)}s.length?this._queue[A]=s:this._queue.splice(A,1)}static start(){"requestAnimationFrame"in globalThis&&(this._currentTime=performance.now(),this._requestId=requestAnimationFrame(t=>this._update(t)))}static stop(){this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=void 0)}static _update(t){this._elapsed=t-this._currentTime,this._currentTime=t,this._requestId=requestAnimationFrame(e=>this._update(e)),this._performUpdate()}static _performUpdate(){const t=this._queue,e=[];for(let A=t.length,i=A;i>=0;i--){const s=t[i];if(!s)continue;const n=[];for(let o=s.length,a=0;a<o;a++){const l=s[a];try{l.cb()}catch(c){console.warn(c)}l.once||n.push(l)}n.length&&(e[i]=n)}this._queue=e}}Kt.start();async function Es(r){return new Promise(t=>{Kt.on(()=>{r?.(),t()},{sort:1,once:!0})})}const sr=Math.PI,ne=sr*2;let kh=0;function Mo(r){return r?.__SPECTOR_Object_TAG?.id??++kh}function Bs(r){return!(r&r-1)&&!!r}const Ph=/([\w-]+)\((.+?)\)/g,Uh=/[^,]+/g,Nh=/([-e.\d]+)(.*)/;function Cs(r){return Array.isArray(r)?r.map(t=>({name:t.name,args:t.args.map(e=>({...e,normalizedIntValue:e.normalizedDefaultIntValue}))})):{...r,normalizedIntValue:r.normalizedDefaultIntValue}}function oi(r,t,e={}){const A=ai(t,e);return A.length?A:Ro(r,t,e)}function ai(r,t={}){const e=[];let A;for(;(A=Ph.exec(r))!==null;){const[,i,s]=A;i&&e.push({name:i,args:Fh(i,s,t)})}return e}function Fh(r,t,e={}){const A=[];let i,s=0;for(;(i=Uh.exec(t))!==null;)A.push(Ro(r,i[0],{...e,index:s++}));return A}function Ro(r,t,e={}){const{width:A=1,height:i=1,index:s=0}=e,n=t.match(Nh),o={unit:n?.[2]??null,value:t,intValue:Number(n?.[1]),normalizedIntValue:0,normalizedDefaultIntValue:0};switch(r){case"scale":case"scaleX":case"scaleY":case"scale3d":o.normalizedDefaultIntValue=1;break}switch(o.unit){case"%":o.normalizedIntValue=o.intValue/100;break;case"rad":o.normalizedIntValue=o.intValue/ne;break;case"deg":o.normalizedIntValue=o.intValue/360;break;case"px":switch(s){case 0:o.normalizedIntValue=o.intValue/A;break;case 1:o.normalizedIntValue=o.intValue/i;break}break;case"turn":case"em":case"rem":default:o.normalizedIntValue=o.intValue;break}return o}const ko="WebGL2RenderingContext"in globalThis,Po="ImageBitmap"in globalThis,Uo="ResizeObserver"in globalThis,LA="PointerEvent"in globalThis,No="WheelEvent"in globalThis,Th="MouseEvent"in globalThis,Ke="ontouchstart"in globalThis,Fo="onclick"in globalThis,Qs="createImageBitmap"in globalThis,ys="AudioContext"in globalThis,ms="webkitAudioContext"in globalThis,ws="OfflineAudioContext"in globalThis,To="webkitOfflineAudioContext"in globalThis,Lo=ys||ms,li=typeof window<"u",vs=globalThis.devicePixelRatio||1,_s=r=>r!==null&&typeof r=="object"&&r.nodeType===1,Go=r=>_s(r)&&r.tagName==="VIDEO",Lh=r=>_s(r)&&r.tagName==="IMG";function Oo(r){return typeof r=="object"&&r!==null&&r.nodeType===1&&r.tagName==="CANVAS"}function Ho(r){return ko&&r instanceof globalThis.WebGL2RenderingContext}function Jo(){if(li)return globalThis.document.createElement("canvas")}function Ko(r,t=globalThis.location){if(r.startsWith("data:"))return"";t=t||globalThis.location;const e=new URL(r,document.baseURI);return e.hostname!==t.hostname||e.port!==t.port||e.protocol!==t.protocol?"anonymous":""}function Yo(r,t,e){e===null&&!t.startsWith("data:")?r.crossOrigin=Ko(t):e!==!1&&(r.crossOrigin=typeof e=="string"?e:"anonymous")}class bs{_map=new WeakMap;_toRaw(t){if(t&&typeof t=="object"){const e=t.__v_raw;e&&(t=this._toRaw(e))}return t}delete(t){return this._map.delete(this._toRaw(t))}get(t){return this._map.get(this._toRaw(t))}has(t){return this._map.has(this._toRaw(t))}set(t,e){return this._map.set(this._toRaw(t),this._toRaw(e)),this}}class ci{cursor;bubbles=!1;cancelBubble=!1;cancelable=!1;composed=!1;defaultPrevented=!1;eventPhase=ci.prototype.NONE;isTrusted=!1;timeStamp=0;type="";composedPath(){return this.path}initEvent(...t){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){"preventDefault"in this.nativeEvent&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}propagationImmediatelyStopped=!1;stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}propagationStopped=!1;stopPropagation(){"stopPropagation"in this.nativeEvent&&this.nativeEvent.stopPropagation(),this.propagationStopped=!0}NONE=0;CAPTURING_PHASE=1;AT_TARGET=2;BUBBLING_PHASE=3;initUIEvent(...t){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}}class Vo extends ci{getModifierState(...t){throw new Error("getModifierState() is a legacy DOM API. It is not implemented in the Federated Events API.")}initKeyboardEvent(...t){throw new Error("initKeyboardEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}}class Ds extends ci{client={x:0,y:0};get clientX(){return this.client.x}get clientY(){return this.client.y}layer={x:0,y:0};get layerX(){return this.layer.x}get layerY(){return this.layer.y}movement={x:0,y:0};get movementX(){return this.movement.x}get movementY(){return this.movement.y}offset={x:0,y:0};get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}page={x:0,y:0};get pageX(){return this.page.x}get pageY(){return this.page.y}screen={x:0,y:0};get screenX(){return this.screen.x}get screenY(){return this.screen.y}get x(){return this.clientX}get y(){return this.clientY}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(...t){throw new Error("Method not implemented.")}global={x:0,y:0};get globalX(){return this.global.x}get globalY(){return this.global.y}}class Wo extends Ds{width=0;height=0;isPrimary=!1;getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class zo extends Ds{static DOM_DELTA_PIXEL=0;DOM_DELTA_PIXEL=0;static DOM_DELTA_LINE=1;DOM_DELTA_LINE=1;static DOM_DELTA_PAGE=2;DOM_DELTA_PAGE=2}const Gh={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class qo extends Je{event;target;cursor="default";cursorStyles={default:"inherit",pointer:"pointer"};setuped=!1;enableMoveEvent=!0;enableWheelEvent=!0;enableClickEvent=!0;setTarget(t){this.removeEventListeners(),this.target=t,this.addEventListeners()}removeEventListeners(){if(!this.setuped||!this.target)return;const t=this.target.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):LA&&(t.touchAction=""),LA?(this.target.removeEventListener("pointerdown",this._onPointerDown),this.target.removeEventListener("pointerleave",this._onPointerOver),this.target.removeEventListener("pointerover",this._onPointerOver),this.target.removeEventListener("pointermove",this._onPointerMove),this.target.removeEventListener("pointerup",this._onPointerUp)):(this.target.removeEventListener("mousedown",this._onPointerDown),this.target.removeEventListener("mouseout",this._onPointerOver),this.target.removeEventListener("mouseover",this._onPointerOver),this.target.removeEventListener("mousemove",this._onPointerMove),this.target.removeEventListener("mouseup",this._onPointerUp)),Ke&&(this.target.removeEventListener("touchstart",this._onPointerDown),this.target.removeEventListener("touchmove",this._onPointerMove),this.target.removeEventListener("touchend",this._onPointerUp)),this.target.removeEventListener("wheel",this._onWheel),document.removeEventListener("keydown",this._onKeyDown),document.removeEventListener("keypress",this._onKeyPress),document.removeEventListener("keyup",this._onKeyUp),this.target=void 0,this.setuped=!1}addEventListeners(){if(this.setuped||!this.target)return;const t=this.target.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):LA&&(t.touchAction="none")),LA?(this.target.addEventListener("pointerdown",this._onPointerDown),this.target.addEventListener("pointerleave",this._onPointerOver),this.target.addEventListener("pointerover",this._onPointerOver),this.target.addEventListener("pointermove",this._onPointerMove),this.target.addEventListener("pointerup",this._onPointerUp)):(this.target.addEventListener("mousedown",this._onPointerDown),this.target.addEventListener("mouseout",this._onPointerOver),this.target.addEventListener("mouseover",this._onPointerOver),this.target.addEventListener("mousemove",this._onPointerMove),this.target.addEventListener("mouseup",this._onPointerUp)),Ke&&(this.target.addEventListener("touchstart",this._onPointerDown),this.target.addEventListener("touchmove",this._onPointerMove),this.target.addEventListener("touchend",this._onPointerUp)),this.target.addEventListener("wheel",this._onWheel),document.addEventListener("keydown",this._onKeyDown),document.addEventListener("keypress",this._onKeyPress),document.addEventListener("keyup",this._onKeyUp),this.setuped=!0}normalize(t){const e=[];if(Ke&&t instanceof globalThis.TouchEvent)for(let A=0,i=t.changedTouches.length;A<i;A++){const s=t.changedTouches[A];typeof s.button>"u"&&(s.button=0),typeof s.buttons>"u"&&(s.buttons=1),typeof s.isPrimary>"u"&&(s.isPrimary=t.touches.length===1&&t.type==="touchstart"),typeof s.width>"u"&&(s.width=s.radiusX||1),typeof s.height>"u"&&(s.height=s.radiusY||1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="touch"),typeof s.pointerId>"u"&&(s.pointerId=s.identifier||0),typeof s.pressure>"u"&&(s.pressure=s.force||.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),typeof s.layerX>"u"&&(s.layerX=s.offsetX=s.clientX),typeof s.layerY>"u"&&(s.layerY=s.offsetY=s.clientY),s.type=t.type,e.push(s)}else if(No&&t instanceof globalThis.WheelEvent)e.push(t);else if(LA&&t instanceof globalThis.PointerEvent)e.push(t);else{const A=t;typeof A.isPrimary>"u"&&(A.isPrimary=!0),typeof A.width>"u"&&(A.width=1),typeof A.height>"u"&&(A.height=1),typeof A.tiltX>"u"&&(A.tiltX=0),typeof A.tiltY>"u"&&(A.tiltY=0),typeof A.pointerType>"u"&&(A.pointerType="mouse"),typeof A.pointerId>"u"&&(A.pointerId=1),typeof A.pressure>"u"&&(A.pressure=.5),typeof A.twist>"u"&&(A.twist=0),typeof A.tangentialPressure>"u"&&(A.tangentialPressure=0),e.push(A)}return e}_clonePointerEvent(t){const e=new Wo;return e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,e.isTrusted=t.isTrusted,this._copyMouseEvent(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.x=e.screen.x,e.global.y=e.screen.y,e.offset.x=e.screen.x,e.offset.y=e.screen.y,e.type==="pointerleave"?e.type="pointerout":e.type.startsWith("mouse")?e.type=e.type.replace("mouse","pointer"):e.type.startsWith("touch")&&(e.type=Gh[e.type]||e.type),e}_copyInputEvent(t,e){t.nativeEvent=e,t.bubbles=e.bubbles,t.cancelBubble=e.cancelBubble,t.cancelable=e.cancelable,t.composed=e.composed,t.currentTarget=e.currentTarget,t.defaultPrevented=e.defaultPrevented,t.eventPhase=e.eventPhase,t.isTrusted=e.isTrusted,t.returnValue=e.returnValue,t.srcElement=e.srcElement,t.timeStamp=e.timeStamp,t.type=e.type}_copyMouseEvent(t,e){this._copyInputEvent(t,e),t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null,t.shiftKey=e.shiftKey}_cloneWheelEvent(t){const e=new zo;return this._copyMouseEvent(e,t),e.wheelDeltaY=t.wheelDeltaY,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,e.deltaMode=t.deltaMode,this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.x=e.screen.x,e.global.y=e.screen.y,e.offset.x=e.screen.x,e.offset.y=e.screen.y,e}_cloneKeyboardEvent(t){const e=new Vo;return this._copyInputEvent(e,t),e.altKey=t.altKey,e.charCode=t.charCode,e.code=t.code,e.ctrlKey=t.ctrlKey,e.isComposing=t.isComposing,e.key=t.key,e.keyCode=t.keyCode,e.location=t.location,e.metaKey=t.metaKey,e.repeat=t.repeat,e.shiftKey=t.shiftKey,e}setCursor(t="default"){if(!this.target||this.cursor===t)return;this.cursor=t;const e=!(globalThis.OffscreenCanvas&&this.target instanceof OffscreenCanvas),A=this.cursorStyles[t];if(A)switch(typeof A){case"string":e&&(this.target.style.cursor=A);break;case"function":A(t);break;case"object":e&&Object.assign(this.target.style,A);break}else e&&typeof t=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.target.style.cursor=t)}mapPositionToPoint(t,e,A){if(!this.target)return;const i=this.target.isConnected?this.target.getBoundingClientRect():void 0,s=Number(this.target.getAttribute("data-pixel-ratio"))||1,n=Number(this.target.getAttribute("width"))||(i?i.width*s:0),o=Number(this.target.getAttribute("height"))||(i?i.height*s:0),a=i??{width:n,height:o,left:0,top:0},l=1/s;t.x=(e-a.left)*(n/a.width)*l,t.y=(A-a.top)*(o/a.height)*l}_onKeyDown=t=>{const e=this.normalize(t);for(let A=0,i=e.length;A<i;A++)this.emit("keydown",this.event=this._cloneKeyboardEvent(e[A]));this.event?.cursor&&this.setCursor(this.event.cursor)};_onKeyPress=t=>{const e=this.normalize(t);for(let A=0,i=e.length;A<i;A++)this.emit("keypress",this.event=this._cloneKeyboardEvent(e[A]));this.event?.cursor&&this.setCursor(this.event.cursor)};_onKeyUp=t=>{const e=this.normalize(t);for(let A=0,i=e.length;A<i;A++)this.emit("keyup",this.event=this._cloneKeyboardEvent(e[A]));this.event?.cursor&&this.setCursor(this.event.cursor)};_onPointerDown=t=>{if(Ke&&t.pointerType==="touch")return;const e=this.normalize(t);for(let A=0,i=e.length;A<i;A++)this.emit("pointerdown",this.event=this._clonePointerEvent(e[A]));this.event?.cursor&&this.setCursor(this.event.cursor)};_onPointerOver=t=>{if(!this.enableClickEvent||Ke&&t.pointerType==="touch")return;const e=this.normalize(t);for(let A=0,i=e.length;A<i;A++)this.emit("pointerover",this.event=this._clonePointerEvent(e[A]));this.event?.cursor&&this.setCursor(this.event.cursor)};_onPointerMove=t=>{if(!this.enableMoveEvent||Ke&&t.pointerType==="touch")return;const e=this.normalize(t);for(let A=0,i=e.length;A<i;A++)this.emit("pointermove",this.event=this._clonePointerEvent(e[A]));this.event?.cursor&&this.setCursor(this.event.cursor)};_onPointerUp=t=>{if(!this.enableClickEvent||Ke&&t.pointerType==="touch")return;let e=t.target;t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]);const A=e!==this.target?"outside":"",i=this.normalize(t);for(let s=0,n=i.length;s<n;s++){const o=this._clonePointerEvent(i[s]);o.type+=A,this.emit("pointerup",this.event=o)}this.event?.cursor&&this.setCursor(this.event.cursor)};_onWheel=t=>{if(!this.enableWheelEvent)return;const e=this.normalize(t);for(let A=0,i=e.length;A<i;A++)this.emit("wheel",this.event=this._cloneWheelEvent(e[A]));this.event?.cursor&&this.setCursor(this.event.cursor)}}let Oh=0;class sA extends Je{instanceId=++Oh;_customPropertyAccessor;_properties=new Map;_updatedProperties=new Map;_changedProperties=new Set;_updatingPromise=Promise.resolve();_updating=!1;useCustomPropertyAccessor(t){return this._customPropertyAccessor=t,this.getPropertyDeclarations().forEach((e,A)=>{const i=t.get(A,()=>{}),s=this._properties.get(A);i===void 0?s!==void 0&&t.set(A,s):i!==s&&(e.alias&&e.alias!==A?this.setProperty(A,i):this._properties.set(A,i),this._updateProperty(A,i,s,e),this.emit("updateProperty",A,i,s,e))}),this}getter(t,e){return e?.declaration.protected?this[e.internalKey]:this._customPropertyAccessor?this._customPropertyAccessor.get(t,()=>this._properties.get(t)):this._properties.get(t)}setter(t,e,A){A?.declaration.protected?this[A.internalKey]=e:(this._customPropertyAccessor&&this._customPropertyAccessor.set(t,e),this._properties.set(t,e))}equal(t){return!!(t&&this.instanceId===t.instanceId)}async _enqueueUpdate(){this._updating=!0;try{await this._updatingPromise}catch(t){Promise.reject(t)}await Es(),this._updating&&(this.update(),this._updating=!1)}update(){this._update(this._updatedProperties),this._updatedProperties=new Map}_update(t){}_updateProperty(t,e,A,i){}isDirty(t){return this._updatedProperties.has(t)}getPropertyDeclarations(){return Is(this.constructor)}getPropertyDeclaration(t){return this.getPropertyDeclarations().get(t)}getProperty(t){return this[t]}setProperty(t,e){return this[t]=e,this}getProperties(t){const e={};for(const[A,i]of this.getPropertyDeclarations())!i.protected&&!i.alias&&(!t||t.includes(A))&&(e[A]=this.getProperty(A));return e}setProperties(t){if(t&&typeof t=="object")for(const[e]of this.getPropertyDeclarations())e in t&&this.setProperty(e,t[e]);return this}resetProperties(){for(const[t,e]of this.getPropertyDeclarations())this.setProperty(t,typeof e.fallback=="function"?e.fallback():e.fallback);return this}onUpdateProperty(t,e,A,i){this.requestUpdate(t,e,A,i)}requestUpdate(t,e,A,i){if(t!==void 0)if(!Object.is(e,A))this._updatedProperties.set(t,A),this._changedProperties.add(t),i??=this.getPropertyDeclaration(t),this._updateProperty(t,e,A,i),this.emit("updateProperty",t,e,A,i);else return;this._updating||(this._updatingPromise=this._enqueueUpdate())}toJSON(){const t={};return this._properties.forEach((e,A)=>{e!==void 0&&(e&&typeof e=="object"?"toJSON"in e&&typeof e.toJSON=="function"?t[A]=e.toJSON():Array.isArray(e)?t[A]=[...e]:t[A]={...e}:t[A]=e)}),t}clone(){return new this.constructor(this.toJSON())}free(){this.removeAllListeners()}}class Xo extends sA{}class Ye extends Xo{}function Hh(r,t){var e={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},A={};for(var i in e)A[e[i]]=i;var s={};r.prototype.toName=function(n){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,a,l=A[this.toHex()];if(l)return l;if(n?.closest){var c=this.toRgb(),h=1/0,u="black";if(!s.length)for(var d in e)s[d]=new r(e[d]).toRgb();for(var f in e){var B=(o=c,a=s[f],Math.pow(o.r-a.r,2)+Math.pow(o.g-a.g,2)+Math.pow(o.b-a.b,2));B<h&&(h=B,u=f)}return u}},t.string.push([function(n){var o=n.toLowerCase(),a=o==="transparent"?"#0000":e[o];return a?new r(a).toRgb():null},"name"])}Yc([Hh]);class De{get value(){return this._value}set value(t){this._colord=us(t??"none")}get r8(){return this._colord.rgba.r}get g8(){return this._colord.rgba.g}get b8(){return this._colord.rgba.b}get a8(){return this._colord.rgba.a*255&255}get r(){return this.r8/255}get g(){return this.g8/255}get b(){return this.b8/255}get a(){return this._colord.rgba.a}get rgb(){return(this.r8<<16)+(this.g8<<8)+this.b8}get bgr(){return(this.b8<<16)+(this.g8<<8)+this.r8}get abgr(){return(this.a8<<24)+this.bgr}constructor(t=0){this.value=t}toHex(){return this._colord.toHex()}toRgb(){return this._colord.toRgb()}toRgbString(){return this._colord.toRgbString()}toHsl(){return this._colord.toHsl()}toHslString(){return this._colord.toHslString()}toHsv(){return this._colord.toHsv()}toArgb(t=this.a,e=!0){if(t===1)return(255<<24)+this.rgb;if(t===0)return e?0:this.rgb;let A=this.r8,i=this.g8,s=this.b8;return e&&(A=A*t+.5|0,i=i*t+.5|0,s=s*t+.5|0),(t*255<<24)+(A<<16)+(i<<8)+s}toArray(){return[this.r,this.g,this.b,this.a]}}class Ee extends Je{constructor(t){super(),this.dim=t}_array=[];get length(){return this.dim}operate(t,e,A){const{dim:i,_array:s}=this;let n;typeof e=="number"?n=Array.from({length:i},()=>e):e instanceof xe||e instanceof Ee?n=e.toArray():n=e;let o,a=[];if(A?A instanceof Ee?o=A:a=A:o=this,e instanceof xe){const{cols:l}=e;switch(t){case"*":for(let c=0;c<i;c++){let h=0;for(let u=0;u<i;u++)h+=s[c]*n[u*l+c];a[c]=h}break;default:throw new Error(`Not support operator in '${this.toName()} ${t} ${e.toName()}'`)}}else switch(t){case"+":for(let l=0;l<i;l++)a[l]=s[l]+n[l];break;case"-":for(let l=0;l<i;l++)a[l]=s[l]-n[l];break;case"*":for(let l=0;l<i;l++)a[l]=s[l]*n[l];break;case"/":for(let l=0;l<i;l++)a[l]=s[l]/n[l];break;case"rot":{const l=Math.cos(n[0]),c=Math.sin(n[0]);a[0]=s[0]*l-s[1]*c,a[1]=s[1]*l+s[0]*c;break}case"==":{let l=!0;for(let c=0;c<i;c++)l=l&&s[c]===n[c];return l}case"=":for(let l=0;l<i;l++){const c=n[l];c!==void 0&&(s[l]=c)}return this._onUpdate(s),this.emit("update",s),this;default:throw new Error(`Not support operator in '${this.toName()} ${t} Vector'`)}return o?.set(a)??a}add(t,...e){return e.length&&typeof t=="number"&&(t=[t,...e]),this.operate("+",t)}sub(t,...e){return e.length&&typeof t=="number"&&(t=[t,...e]),this.operate("-",t)}multiply(t,...e){return e.length&&typeof t=="number"&&(t=[t,...e]),this.operate("*",t)}divide(t,...e){return e.length&&typeof t=="number"&&(t=[t,...e]),this.operate("/",t)}rotate(t){return this.operate("rot",t)}set(t,...e){return e.length&&typeof t=="number"&&(t=[t,...e]),this.operate("=",t)}equals(t){return this.operate("==",t)}copy(t){return this.set(t)}clone(){const t=new this.constructor;return t.set(this.toArray()),t}_onUpdate(t){}toName(){return`Vector${this.dim}`}toArray(){return this._array.slice()}toJSON(){return this.toArray()}}class xe extends Je{constructor(t,e,A){super(),this.rows=t,this.cols=e,A?this.set(A):this.identity()}_array=[];dirtyId=0;get length(){return this.cols*this.rows}operate(t,e,A){const{cols:i,rows:s,length:n,_array:o}=this;let a;typeof e=="number"?a=Array.from({length:n},()=>e):e instanceof Ee||e instanceof xe?a=e.toArray():a=e;let l,c=[];if(A?A instanceof Ee||A instanceof xe?l=A:c=A:e instanceof Ee?l=new e.constructor:l=this,e instanceof Ee){const{dim:h}=e;switch(t){case"*":for(let u=0;u<h;u++){let d=0;for(let f=0;f<i;f++)f<h&&(d+=o[u*i+f]*(a[f]??0));c[u]=d}break;default:throw new Error(`Not support operator in '${this.toName()} ${t} ${e.toName()}'`)}}else switch(t){case"*":for(let h=0;h<i;h++)for(let u=0;u<s;u++){const d=u*i;let f=0;for(let B=0;B<s;B++){const p=d+B,D=B*i+h;f+=o[p]*(a[D]??0)}c[d+h]=f}break;case"=":for(let h=0;h<n;h++){const u=a[h];u!==void 0&&(o[h]=u)}return this._onUpdate(o),this.emit("update",o),this;default:throw new Error(`Not support operator in '${this.toName()} ${t} Matrix2'`)}return l?.set(c)??c}identity(){const{cols:t,rows:e}=this,A=[];for(let i=0;i<t;i++)for(let s=0;s<e;s++){const n=s*t,o=i+n;A[o]=s+n===o?1:0}return this.set(A)}set(t){return this.operate("=",t)}copy(t){return this.set(t)}clone(){const t=new this.constructor;return t.set(this.toArray()),t}multiply(t,e){return this.operate("*",t,e)}_onUpdate(t){this.dirtyId++}toArray(t=!1){const{cols:e,rows:A,_array:i}=this;if(t){const s=[];for(let n=0;n<A;n++)for(let o=0;o<e;o++)s[n+o*e]=i[o+n*e];return s}return i.slice()}toName(){return`Matrix${this.rows}(${this.rows}x${this.cols})`}toJSON(){return this._array.slice()}}class jo extends xe{constructor(t){super(4,4,t)}}const Zo=sr/180,Jh=180/sr;function le(r,t,e){return Math.max(t,Math.min(r,e))}function bt(r,t,e){return(1-e)*r+e*t}const Kh={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(r,t=20){if(!this.adaptive||!r||Number.isNaN(r))return t;let e=Math.ceil(r/this.maxLength);return e<this.minSegments?e=this.minSegments:e>this.maxSegments&&(e=this.maxSegments),e}};class $o extends Ee{constructor(t=0,e=0,A=0,i=0){super(4),this.set(t,e,A,i)}}class xs extends xe{constructor(t){super(4,5,t)}hueRotate(t=0){const e=Math.sin(t),A=Math.cos(t),i=.213,s=.715,n=.072;return this.multiply([i+A*(1-i)+e*-i,s+A*-s+e*-s,n+A*-n+e*(1-n),0,0,i+A*-i+e*.143,s+A*(1-s)+e*.14,n+A*-n+e*-.283,0,0,i+A*-i+e*-.787,s+A*-s+e*s,n+A*(1-n)+e*n,0,0,0,0,0,1,0])}saturate(t=1){const e=(t-1)*2/3+1,A=(e-1)*-.5;return this.multiply([e,A,A,0,0,A,e,A,0,0,A,A,e,0,0,0,0,0,1,0])}brightness(t=1){const e=t;return this.multiply([e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0])}contrast(t=1){const e=t,A=-128*(e-1);return this.multiply([e,0,0,0,A,0,e,0,0,A,0,0,e,0,A,0,0,0,1,0])}invert(t=1){const e=bt(1,-1,t),A=bt(0,255,t);return this.multiply([e,0,0,0,A,0,e,0,0,A,0,0,e,0,A,0,0,0,1,0])}sepia(t=1){const e=le(t,0,1);return this.multiply([bt(1,.393,e),bt(0,.7689999,e),bt(0,.18899999,e),0,0,bt(0,.349,e),bt(1,.6859999,e),bt(0,.16799999,e),0,0,bt(0,.272,e),bt(0,.5339999,e),bt(1,.13099999,e),0,0,0,0,0,1,0])}opacity(t=1){return this.multiply([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,t,0])}grayscale(t=1){const e=le(t,0,1),A=bt(1,.3,e),i=bt(0,.3,e),s=bt(1,.59,e),n=bt(0,.59,e),o=bt(1,.11,e),a=bt(0,.11,e);return this.multiply([A,n,a,0,0,i,s,a,0,0,i,n,o,0,0,0,0,0,1,0])}multiply(t){const e=t,A=this._array;return this.set([A[0]*e[0]+A[1]*e[5]+A[2]*e[10]+A[3]*e[15],A[0]*e[1]+A[1]*e[6]+A[2]*e[11]+A[3]*e[16],A[0]*e[2]+A[1]*e[7]+A[2]*e[12]+A[3]*e[17],A[0]*e[3]+A[1]*e[8]+A[2]*e[13]+A[3]*e[18],A[0]*e[4]+A[1]*e[9]+A[2]*e[14]+A[3]*e[19]+A[4],A[5]*e[0]+A[6]*e[5]+A[7]*e[10]+A[8]*e[15],A[5]*e[1]+A[6]*e[6]+A[7]*e[11]+A[8]*e[16],A[5]*e[2]+A[6]*e[7]+A[7]*e[12]+A[8]*e[17],A[5]*e[3]+A[6]*e[8]+A[7]*e[13]+A[8]*e[18],A[5]*e[4]+A[6]*e[9]+A[7]*e[14]+A[8]*e[19]+A[9],A[10]*e[0]+A[11]*e[5]+A[12]*e[10]+A[13]*e[15],A[10]*e[1]+A[11]*e[6]+A[12]*e[11]+A[13]*e[16],A[10]*e[2]+A[11]*e[7]+A[12]*e[12]+A[13]*e[17],A[10]*e[3]+A[11]*e[8]+A[12]*e[13]+A[13]*e[18],A[10]*e[4]+A[11]*e[9]+A[12]*e[14]+A[13]*e[19]+A[14],A[15]*e[0]+A[16]*e[5]+A[17]*e[10]+A[18]*e[15],A[15]*e[1]+A[16]*e[6]+A[17]*e[11]+A[18]*e[16],A[15]*e[2]+A[16]*e[7]+A[17]*e[12]+A[18]*e[17],A[15]*e[3]+A[16]*e[8]+A[17]*e[13]+A[18]*e[18],A[15]*e[4]+A[16]*e[9]+A[17]*e[14]+A[18]*e[19]+A[19]])}toMatrix4(){const t=this._array;return new jo([t[0],t[1],t[2],t[3],t[5],t[6],t[7],t[8],t[10],t[11],t[12],t[13],t[15],t[16],t[17],t[18]])}toVector4(){const t=this._array;return new $o(t[4]/255,t[9]/255,t[14]/255,t[19]/255)}}class Yh extends xe{constructor(t){super(2,2,t)}}let Ss=class extends xe{constructor(t){super(3,3,t)}affineInvert(){const[t,e,A,i,s,n,o,a,l]=this._array,c=l*s-n*a,h=n*o-l*i,u=a*i-s*o,d=t*c+e*h+A*u;if(d===0)return this.set([0,0,0,0,0,0,0,0,0]);const f=1/d;return this.set([c*f,(A*a-l*e)*f,(n*e-A*s)*f,h*f,(l*t-A*o)*f,(A*i-n*t)*f,u*f,(e*o-a*t)*f,(s*t-e*i)*f])}};class ta extends Ss{constructor(t=0,e=0,A=0,i=0,s=!1){super(),this._x=t,this._y=e,this._width=A,this._height=i,this._flipY=s,this._performUpdateArray()}flipY(t){return this._flipY!==t&&(this._flipY=t,this._performUpdateArray()),this}translate(t,e){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this._performUpdateArray()),this}resize(t,e){return(this._width!==t||this._height!==e)&&(this._width=t,this._height=e,this._performUpdateArray()),this}_performUpdateArray(){const t=this._width,e=this._height;if(!t||!e)return;const A=this._x,i=this._y,s=this._flipY?-1:1,n=1/t*2,o=s*(1/e*2),a=-1-A*n,l=-s-i*o;this.set([n,0,a,0,o,l,0,0,1])}}let Mt=class Rc extends Ee{get x(){return this._array[0]}set x(t){const[e,A]=this._array;e!==t&&this.set(t,A)}get y(){return this._array[1]}set y(t){const[e,A]=this._array;A!==t&&this.set(e,t)}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}get left(){return this.x}set left(t){this.x=t}get top(){return this.y}set top(t){this.y=t}constructor(t=0,e){super(2),this.set(typeof t=="number"?[t,e??t]:t)}update(t,e){const[A,i]=this._array;return(A!==t||i!==e)&&this.set(t,e),this}getLength(){const[t,e]=this._array;return Math.sqrt(t*t+e*e)}getAngle(){const[t,e]=this._array;return Math.atan2(-t,-e)+Math.PI}distanceTo(t){return Math.hypot(t.x-this.x,t.y-this.y)}normalize(){const[t,e]=this._array,A=1/(this.getLength()||1);return this.set(t*A,e*A),this}static lerp(t,e,A){return new Rc(e).clone().sub(t).multiply(A).add(t)}};class nA{get x(){return this.position.x}get y(){return this.position.y}get left(){return this.position.x}get top(){return this.position.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get width(){return this.size.x}get height(){return this.size.y}end=new Mt;position;size;constructor(...t){const e=new Mt,A=new Mt;switch(t.length){case 0:break;case 1:{const i=t[0];if(i instanceof nA)e.set(i.position),A.set(i.size);else{const s=i.map(h=>h.x),n=i.map(h=>h.y),o=Math.min(...s),a=Math.max(...s),l=Math.min(...n),c=Math.max(...n);e.set(o,l),A.set(a-o,c-l)}break}case 2:e.set(t[0]),A.set(t[1]);break;default:e.set(t[0],t[1]),A.set(t[2],t[3]);break}this.update=this.update.bind(this),this.position=e.on("update",this.update),this.size=A.on("update",this.update),this.update()}update(){return this.end.set(this.position.x+this.size.x,this.position.y+this.size.y),this}toMinmax(){return{minX:this.position.x,minY:this.position.y,maxX:this.end.x,maxY:this.end.y}}toArray(){return[this.x,this.y,this.width,this.height]}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}}class Yt extends Ss{static _t2d=new Yt;premultiply(t){return t.multiply(this,this)}skewX(t){return this.skew(t,0)}skewY(t){return this.skew(0,t)}skew(t,e){return this.premultiply(Yt._t2d.makeSkew(t,e))}makeSkew(t,e){const A=Math.tan(t),i=Math.tan(e);return this.set([1,i,0,A,1,0,0,0,1]),this}translateX(t){return this.translate(t,0)}translateY(t){return this.translate(0,t)}translateZ(t){return this.translate(0,0,t)}translate3d(t,e,A){return this.translate(t,e,A)}translate(t,e,A=0){return this.premultiply(Yt._t2d.makeTranslation(t,e,A))}makeTranslation(t,e,A=0){return this.set([1,0,t,0,1,e,0,0,1]),this}scaleX(t){return this.scale(t,1)}scaleY(t){return this.scale(1,t)}scale3d(t,e,A=1){return this.scale(t,e,A)}scale(t,e,A=1){return this.premultiply(Yt._t2d.makeScale(t,e,A))}makeScale(t,e,A=1){return this.set([t,0,0,0,e,0,0,0,1]),this}rotateX(t){return this.scaleY(this._rotateToScale(t))}rotateY(t){return this.scaleX(this._rotateToScale(t))}rotateZ(t){return this.rotate(t)}rotate(t){return this.premultiply(Yt._t2d.makeRotation(t))}rotate3d(t,e,A,i){const[s,n,o]=this._rotate3d(t,e,A,i);return s&&this.rotateX(s),n&&this.rotateY(n),o&&this.rotateZ(o),this}_rotateToScale(t){const e=t/ne;return e<=.5?e*-4+1:(e-1)*4+1}_rotate3d(t,e,A,i){if(t===1&&e===0&&A===0)return[i,0,0];if(t===0&&e===1&&A===0)return[0,i,0];if(t===0&&e===0)return[0,0,i];{const s=Math.cos(i),n=Math.sin(i),o=s+t*t*(1-s),a=t*e*(1-s)-A*n,l=t*A*(1-s)+e*n,c=s+e*e*(1-s),h=e*A*(1-s)-t*n,u=s+A*A*(1-s),d=-Math.atan2(-h,c),f=-Math.atan2(l,Math.sqrt(h*h+u*u)),B=-Math.atan2(-a,o);return[d,f,B]}}makeRotation(t){const e=Math.cos(t),A=Math.sin(t);return this.set([e,-A,0,A,e,0,0,0,1]),this}decompose(t={x:0,y:0},e={position:{x:0,y:0},scale:{x:0,y:0},skew:{x:0,y:0},rotation:0}){const{a:A,b:i,c:s,d:n,tx:o,ty:a}=this.toObject(),l=-Math.atan2(-s,n),c=Math.atan2(i,A),h=Math.abs(l+c);return h<1e-5||Math.abs(ne-h)<1e-5?(e.rotation=c,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=l,e.skew.y=c),e.scale.x=Math.sqrt(A*A+i*i),e.scale.y=Math.sqrt(s*s+n*n),e.position.x=o+(t.x*A+t.y*s),e.position.y=a+(t.x*i+t.y*n),e}apply(t,e){e=e||new Mt;const{a:A,c:i,tx:s,b:n,d:o,ty:a}=this.toObject(),l=t.x,c=t.y;return e.x=A*l+i*c+s,e.y=n*l+o*c+a,e}affineInverse(){return this.clone().affineInvert()}applyAffineInverse(t,e){e=e||new Mt;const{a:A,b:i,c:s,d:n,tx:o,ty:a}=this.toObject(),l=1/(A*n+s*-i),c=t.x,h=t.y;return e.x=n*l*c+-s*l*h+(a*s-o*n)*l,e.y=A*l*h+-i*l*c+(-a*A+o*i)*l,e}isIdentity(){const{a:t,b:e,c:A,d:i,tx:s,ty:n}=this.toObject();return t===1&&e===0&&A===0&&i===1&&s===0&&n===0}toObject(){const[t,e,A,i,s,n,,,o]=this._array;return{a:t,c:e,tx:A,b:i,d:s,ty:n,tz:o}}}class Vh extends Ee{constructor(){super(3)}}var Wh=Object.defineProperty,ea=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&Wh(t,e,i),i};class nr extends sA{_starting=!1;_nextDeltaTime=0;get starting(){return this._starting}get spf(){return this.fps?Math.floor(1e3/this.fps):0}constructor(){super(),this._onNextTick=this._onNextTick.bind(this)}start(t){this._starting||(this._starting=!0,this.off("process"),this.on("process",t),Kt.on(this._onNextTick,{sort:0}))}stop(){this._starting&&(this._starting=!1,Kt.off(this._onNextTick,{sort:0}))}_onNextTick(){const t=Kt.elapsed*this.speed;if((this._nextDeltaTime-=t)<=0){const A=(this._nextDeltaTime=this.spf)||t;this.emit("process",A)}}free(){super.free(),this.stop()}}ea([v({fallback:60})],nr.prototype,"fps"),ea([v({fallback:1})],nr.prototype,"speed");class Aa{view;pixelRatio=vs;screen={x:0,y:0,width:0,height:0};related=new bs;getRelated(t,e){let A=this.related.get(t);return A||(e?(this.related.set(t,A=e()),A):(console.warn("Failed to get related",t),null))}resize(t,e,A=!0){this.view&&(this.view.width=Math.floor(t*this.pixelRatio),this.view.height=Math.floor(e*this.pixelRatio)),this.screen.width=t,this.screen.height=e,A&&this.view&&(this.view.style.width=`${t}px`,this.view.style.height=`${e}px`)}}var GA=(r=>(r.NORMAL="normal",r.ADD="add",r.MULTIPLY="multiply",r.SCREEN="screen",r.NONE="none",r.NORMAL_NPM="normal_npm",r.ADD_NPM="add_npm",r.SCREEN_NPM="screen_npm",r.SRC_IN="src_in",r.SRC_OUT="src_out",r.SRC_ATOP="src_atop",r.DST_OVER="dst_over",r.DST_IN="dst_in",r.DST_OUT="dst_out",r.DST_ATOP="dst_atop",r.XOR="xor",r.SUBTRACT="subtract",r))(GA||{});function ia(r){return{normal:[r.ONE,r.ONE_MINUS_SRC_ALPHA],add:[r.ONE,r.ONE],multiply:[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],screen:[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],none:[0,0],normal_npm:[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],add_npm:[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],screen_npm:[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],src_in:[r.DST_ALPHA,r.ZERO],src_out:[r.ONE_MINUS_DST_ALPHA,r.ZERO],src_atop:[r.DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],dst_over:[r.ONE_MINUS_DST_ALPHA,r.ONE],dst_in:[r.ZERO,r.SRC_ALPHA],dst_out:[r.ZERO,r.ONE_MINUS_SRC_ALPHA],dst_atop:[r.ONE_MINUS_DST_ALPHA,r.SRC_ALPHA],xor:[r.ONE_MINUS_DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],subtract:[r.ONE,r.ONE,r.ONE,r.ONE,r.FUNC_REVERSE_SUBTRACT,r.FUNC_ADD]}}class Ie{get gl(){return this._renderer.gl}install(t){this._renderer=t}onUpdateContext(){}flush(){}reset(){}free(){}}class QA{static _properties=["blend","offsets","culling","depthTest","clockwiseFrontFace","depthMask"];static _init(){this._properties.forEach((t,e)=>{Object.defineProperty(this.prototype,t,{get(){return!!(this.bitmap&1<<e)},set(A){!!(this.bitmap&1<<e)!==A&&(this.bitmap^=1<<e)},enumerable:!0,configurable:!0})})}static for2D(){const t=new QA;return t.depthTest=!1,t.blend=!0,t}_blendMode=GA.NORMAL;_polygonOffset=0;bitmap=0;get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!==GA.NONE,this._blendMode=t}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}constructor(t){if(t)for(const e in t)this[e]=t[e]}}QA._init();class ra extends Ie{install(t){super.install(t),t.state=this}_blendEq=!1;_setters=QA._properties.map(t=>this[`set${t.replace(/^\S/,e=>e.toUpperCase())}`]);boundStateBitmap=0;boundBlendMode;blendModes;defaultState=new QA({blend:!0});onUpdateContext(){super.onUpdateContext(),this.blendModes=ia(this._renderer.gl)}toggle(t,e){this._renderer.gl[e?"enable":"disable"](t)}setBlend(t){this.toggle(this._renderer.gl.BLEND,t)}setOffsets(t){this.toggle(this._renderer.gl.POLYGON_OFFSET_FILL,t)}setCulling(t){this.toggle(this._renderer.gl.CULL_FACE,t)}setDepthTest(t){this.toggle(this._renderer.gl.DEPTH_TEST,t)}setDepthMask(t){this._renderer.gl.depthMask(t)}setClockwiseFrontFace(t){const e=this._renderer.gl;e.frontFace(e[t?"CW":"CCW"])}setBlendMode(t){if(t===this.boundBlendMode)return;this.boundBlendMode=t;const e=this.blendModes[t],A=this._renderer.gl;e.length===2?A.blendFunc(e[0],e[1]):A.blendFuncSeparate(e[0],e[1],e[2],e[3]),e.length===6?(this._blendEq=!0,A.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,A.blendEquationSeparate(A.FUNC_ADD,A.FUNC_ADD))}setPolygonOffset(t,e){this._renderer.gl.polygonOffset(t,e)}bind(t){if(this.boundStateBitmap!==t.bitmap){let e=this.boundStateBitmap^t.bitmap,A=0;for(;e;)e&1&&this._setters[A]?.call(this,!!(t.bitmap&1<<A)),e=e>>1,A++;this.boundStateBitmap=t.bitmap}t.blend&&this.setBlendMode(t.blendMode),t.offsets&&this.setPolygonOffset(1,t.polygonOffset)}reset(){super.reset();const t=this._renderer.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!1),this.bind(this.defaultState),this._blendEq=!0,this.setBlendMode(GA.NORMAL)}}class sa extends Ie{install(t){super.install(t),t.batch2D=this}_state=QA.for2D();_batchSize=4096*4;_drawCallUid=0;_defaultModulate=4294967295;_defaultBackgroundColor=0;_batchables=[];_vertexCount=0;_indexCount=0;_attributeBuffer=[];_indexBuffers=[];_shaders=new Map;_attributes={aTextureId:{size:1,normalized:!0,type:"float"},aPosition:{size:2,normalized:!1,type:"float"},aUv:{size:2,normalized:!1,type:"float"},aModulate:{size:4,normalized:!0,type:"unsigned_byte"},aBackgroundColor:{size:4,normalized:!0,type:"unsigned_byte"},aDisableWrapMode:{size:4,normalized:!0,type:"unsigned_byte"}};_vertexSize=8;_getShader(t){let e=this._shaders.get(t);return e||this._shaders.set(t,e=this._createShader(t)),e}_createShader(t){const e=this._renderer,A=e.program.create({vert:`precision highp float;
|
|
1
|
+
(function(u,Cr){typeof exports=="object"&&typeof module<"u"?Cr(exports):typeof define=="function"&&define.amd?define(["exports"],Cr):(u=typeof globalThis<"u"?globalThis:u||self,Cr(u.modernCanvas={}))})(this,(function(u){"use strict";var Cr={grad:.9,turn:360,rad:360/(2*Math.PI)},bt=function(s){return typeof s=="string"?s.length>0:typeof s=="number"},pe=function(s,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*s)/t+0},He=function(s,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),s>t?t:s>e?s:e},Kn=function(s){return(s=isFinite(s)?s%360:0)>0?s:s+360},Zn=function(s){return{r:He(s.r,0,255),g:He(s.g,0,255),b:He(s.b,0,255),a:He(s.a)}},as=function(s){return{r:pe(s.r),g:pe(s.g),b:pe(s.b),a:pe(s.a,3)}},fc=/^#([0-9a-f]{3,8})$/i,pi=function(s){var e=s.toString(16);return e.length<2?"0"+e:e},Jn=function(s){var e=s.r,t=s.g,r=s.b,i=s.a,n=Math.max(e,t,r),o=n-Math.min(e,t,r),a=o?n===e?(t-r)/o:n===t?2+(r-e)/o:4+(e-t)/o:0;return{h:60*(a<0?a+6:a),s:n?o/n*100:0,v:n/255*100,a:i}},Qn=function(s){var e=s.h,t=s.s,r=s.v,i=s.a;e=e/360*6,t/=100,r/=100;var n=Math.floor(e),o=r*(1-t),a=r*(1-(e-n)*t),l=r*(1-(1-e+n)*t),c=n%6;return{r:255*[r,a,o,o,l,r][c],g:255*[l,r,r,a,o,o][c],b:255*[o,o,l,r,r,a][c],a:i}},eo=function(s){return{h:Kn(s.h),s:He(s.s,0,100),l:He(s.l,0,100),a:He(s.a)}},to=function(s){return{h:pe(s.h),s:pe(s.s),l:pe(s.l),a:pe(s.a,3)}},ro=function(s){return Qn((t=(e=s).s,{h:e.h,s:(t*=((r=e.l)<50?r:100-r)/100)>0?2*t/(r+t)*100:0,v:r+t,a:e.a}));var e,t,r},Tr=function(s){return{h:(e=Jn(s)).h,s:(i=(200-(t=e.s))*(r=e.v)/100)>0&&i<200?t*r/100/(i<=100?i:200-i)*100:0,l:i/2,a:e.a};var e,t,r,i},dc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,pc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,mc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ls={string:[[function(s){var e=fc.exec(s);return e?(s=e[1]).length<=4?{r:parseInt(s[0]+s[0],16),g:parseInt(s[1]+s[1],16),b:parseInt(s[2]+s[2],16),a:s.length===4?pe(parseInt(s[3]+s[3],16)/255,2):1}:s.length===6||s.length===8?{r:parseInt(s.substr(0,2),16),g:parseInt(s.substr(2,2),16),b:parseInt(s.substr(4,2),16),a:s.length===8?pe(parseInt(s.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(s){var e=gc.exec(s)||mc.exec(s);return e?e[2]!==e[4]||e[4]!==e[6]?null:Zn({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(s){var e=dc.exec(s)||pc.exec(s);if(!e)return null;var t,r,i=eo({h:(t=e[1],r=e[2],r===void 0&&(r="deg"),Number(t)*(Cr[r]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return ro(i)},"hsl"]],object:[[function(s){var e=s.r,t=s.g,r=s.b,i=s.a,n=i===void 0?1:i;return bt(e)&&bt(t)&&bt(r)?Zn({r:Number(e),g:Number(t),b:Number(r),a:Number(n)}):null},"rgb"],[function(s){var e=s.h,t=s.s,r=s.l,i=s.a,n=i===void 0?1:i;if(!bt(e)||!bt(t)||!bt(r))return null;var o=eo({h:Number(e),s:Number(t),l:Number(r),a:Number(n)});return ro(o)},"hsl"],[function(s){var e=s.h,t=s.s,r=s.v,i=s.a,n=i===void 0?1:i;if(!bt(e)||!bt(t)||!bt(r))return null;var o=(function(a){return{h:Kn(a.h),s:He(a.s,0,100),v:He(a.v,0,100),a:He(a.a)}})({h:Number(e),s:Number(t),v:Number(r),a:Number(n)});return Qn(o)},"hsv"]]},io=function(s,e){for(var t=0;t<e.length;t++){var r=e[t][0](s);if(r)return[r,e[t][1]]}return[null,void 0]},yc=function(s){return typeof s=="string"?io(s.trim(),ls.string):typeof s=="object"&&s!==null?io(s,ls.object):[null,void 0]},cs=function(s,e){var t=Tr(s);return{h:t.h,s:He(t.s+100*e,0,100),l:t.l,a:t.a}},hs=function(s){return(299*s.r+587*s.g+114*s.b)/1e3/255},so=function(s,e){var t=Tr(s);return{h:t.h,s:t.s,l:He(t.l+100*e,0,100),a:t.a}},us=(function(){function s(e){this.parsed=yc(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return s.prototype.isValid=function(){return this.parsed!==null},s.prototype.brightness=function(){return pe(hs(this.rgba),2)},s.prototype.isDark=function(){return hs(this.rgba)<.5},s.prototype.isLight=function(){return hs(this.rgba)>=.5},s.prototype.toHex=function(){return e=as(this.rgba),t=e.r,r=e.g,i=e.b,o=(n=e.a)<1?pi(pe(255*n)):"","#"+pi(t)+pi(r)+pi(i)+o;var e,t,r,i,n,o},s.prototype.toRgb=function(){return as(this.rgba)},s.prototype.toRgbString=function(){return e=as(this.rgba),t=e.r,r=e.g,i=e.b,(n=e.a)<1?"rgba("+t+", "+r+", "+i+", "+n+")":"rgb("+t+", "+r+", "+i+")";var e,t,r,i,n},s.prototype.toHsl=function(){return to(Tr(this.rgba))},s.prototype.toHslString=function(){return e=to(Tr(this.rgba)),t=e.h,r=e.s,i=e.l,(n=e.a)<1?"hsla("+t+", "+r+"%, "+i+"%, "+n+")":"hsl("+t+", "+r+"%, "+i+"%)";var e,t,r,i,n},s.prototype.toHsv=function(){return e=Jn(this.rgba),{h:pe(e.h),s:pe(e.s),v:pe(e.v),a:pe(e.a,3)};var e},s.prototype.invert=function(){return ot({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},s.prototype.saturate=function(e){return e===void 0&&(e=.1),ot(cs(this.rgba,e))},s.prototype.desaturate=function(e){return e===void 0&&(e=.1),ot(cs(this.rgba,-e))},s.prototype.grayscale=function(){return ot(cs(this.rgba,-1))},s.prototype.lighten=function(e){return e===void 0&&(e=.1),ot(so(this.rgba,e))},s.prototype.darken=function(e){return e===void 0&&(e=.1),ot(so(this.rgba,-e))},s.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},s.prototype.alpha=function(e){return typeof e=="number"?ot({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):pe(this.rgba.a,3);var t},s.prototype.hue=function(e){var t=Tr(this.rgba);return typeof e=="number"?ot({h:e,s:t.s,l:t.l,a:t.a}):pe(t.h)},s.prototype.isEqual=function(e){return this.toHex()===ot(e).toHex()},s})(),ot=function(s){return s instanceof us?s:new us(s)},no=[],vc=function(s){s.forEach(function(e){no.indexOf(e)<0&&(e(us,ls),no.push(e))})};const _c="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let bc=(s=21)=>{let e="",t=crypto.getRandomValues(new Uint8Array(s|=0));for(;s--;)e+=_c[t[s]&63];return e};class wt{eventListeners=new Map;addEventListener(e,t,r){const i={value:t,options:r},n=this.eventListeners.get(e);return n?Array.isArray(n)?n.push(i):this.eventListeners.set(e,[n,i]):this.eventListeners.set(e,i),this}removeEventListener(e,t,r){if(!t)return this.eventListeners.delete(e),this;const i=this.eventListeners.get(e);if(!i)return this;if(Array.isArray(i)){const n=[];for(let o=0,a=i.length;o<a;o++){const l=i[o];(l.value!==t||typeof r=="object"&&r?.once&&(typeof l.options=="boolean"||!l.options?.once))&&n.push(l)}n.length?this.eventListeners.set(e,n.length===1?n[0]:n):this.eventListeners.delete(e)}else i.value===t&&(typeof r=="boolean"||!r?.once||typeof i.options=="boolean"||i.options?.once)&&this.eventListeners.delete(e);return this}removeAllListeners(){return this.eventListeners.clear(),this}hasEventListener(e){return this.eventListeners.has(e)}dispatchEvent(e,...t){const r=this.eventListeners.get(e);if(r){if(Array.isArray(r))for(let i=r.length,n=0;n<i;n++){const o=r[n];typeof o.options=="object"&&o.options?.once&&this.off(e,o.value,o.options),o.value.apply(this,t)}else typeof r.options=="object"&&r.options?.once&&this.off(e,r.value,r.options),r.value.apply(this,t);return!0}else return!1}on(e,t,r){return this.addEventListener(e,t,r)}once(e,t){return this.addEventListener(e,t,{once:!0})}off(e,t,r){return this.removeEventListener(e,t,r)}emit(e,...t){this.dispatchEvent(e,...t)}}function K(s){return s==null||s==="none"}function or(s,e=0,t=10**e){return Math.round(t*s)/t+0}function Ve(s,e=!1){if(typeof s!="object"||!s)return s;if(Array.isArray(s))return e?s.map(r=>Ve(r,e)):s;const t={};for(const r in s){const i=s[r];i!=null&&(e?t[r]=Ve(i,e):t[r]=i)}return t}function fs(s,e){const t={};return e.forEach(r=>{r in s&&(t[r]=s[r])}),t}function ds(s,e){if(s===e)return!0;if(s&&e&&typeof s=="object"&&typeof e=="object"){const t=Array.from(new Set([...Object.keys(s),...Object.keys(e)]));return!t.length||t.every(r=>s[r]===e[r])}return!1}function wc(s,e,t){const r=e.length-1;if(r<0)return s===void 0?t:s;for(let i=0;i<r;i++){if(s==null)return t;s=s[e[i]]}return s==null||s[e[r]]===void 0?t:s[e[r]]}function xc(s,e,t){const r=e.length-1;for(let i=0;i<r;i++)typeof s[e[i]]!="object"&&(s[e[i]]={}),s=s[e[i]];s[e[r]]=t}function Pc(s,e,t){return s==null||!e||typeof e!="string"?t:s[e]!==void 0?s[e]:(e=e.replace(/\[(\w+)\]/g,".$1"),e=e.replace(/^\./,""),wc(s,e.split("."),t))}function Sc(s,e,t){if(!(typeof s!="object"||!e))return e=e.replace(/\[(\w+)\]/g,".$1"),e=e.replace(/^\./,""),xc(s,e.split("."),t)}let oo=class{_map=new WeakMap;_toRaw(e){if(e&&typeof e=="object"){const t=e.__v_raw;t&&(e=this._toRaw(t))}return e}delete(e){return this._map.delete(this._toRaw(e))}get(e){return this._map.get(this._toRaw(e))}has(e){return this._map.has(this._toRaw(e))}set(e,t){return this._map.set(this._toRaw(e),this._toRaw(t)),this}};function ps(s){let e;return typeof s=="number"?e={r:s>>24&255,g:s>>16&255,b:s>>8&255,a:(s&255)/255}:e=s,ot(e)}function Cc(s){return{r:or(s.r),g:or(s.g),b:or(s.b),a:or(s.a,3)}}function gi(s){const e=s.toString(16);return e.length<2?`0${e}`:e}const ao="#000000FF";function Tc(s){return ps(s).isValid()}function Le(s,e=!1){const t=ps(s);if(!t.isValid()){if(typeof s=="string")return s;const a=`Failed to normalizeColor ${s}`;if(e)throw new Error(a);return console.warn(a),ao}const{r,g:i,b:n,a:o}=Cc(t.rgba);return`#${gi(r)}${gi(i)}${gi(n)}${gi(or(o*255))}`}var mi=mi||{};mi.parse=(function(){const s={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 e="";function t(A){const M=new Error(`${e}: ${A}`);throw M.source=e,M}function r(){const A=i();return e.length>0&&t("Invalid input not EOF"),A}function i(){return x(n)}function n(){return o("linear-gradient",s.linearGradient,l)||o("repeating-linear-gradient",s.repeatingLinearGradient,l)||o("radial-gradient",s.radialGradient,f)||o("repeating-radial-gradient",s.repeatingRadialGradient,f)}function o(A,M,F){return a(M,z=>{const Y=F();return Y&&(I(s.comma)||t("Missing comma before color stops")),{type:A,orientation:Y,colorStops:x(C)}})}function a(A,M){const F=I(A);if(F){I(s.startCall)||t("Missing (");const z=M(F);return I(s.endCall)||t("Missing )"),z}}function l(){const A=c();if(A)return A;const M=$("position-keyword",s.positionKeywords,1);return M?{type:"directional",value:M.value}:h()}function c(){return $("directional",s.sideOrCorner,1)}function h(){return $("angular",s.angleValue,1)||$("angular",s.radianValue,1)}function f(){let A,M=d(),F;return M&&(A=[],A.push(M),F=e,I(s.comma)&&(M=d(),M?A.push(M):e=F)),A}function d(){let A=g()||p();if(A)A.at=m();else{const M=y();if(M){A=M;const F=m();F&&(A.at=F)}else{const F=m();if(F)A={type:"default-radial",at:F};else{const z=P();z&&(A={type:"default-radial",at:z})}}}return A}function g(){const A=$("shape",/^(circle)/i,0);return A&&(A.style=N()||y()),A}function p(){const A=$("shape",/^(ellipse)/i,0);return A&&(A.style=P()||k()||y()),A}function y(){return $("extent-keyword",s.extentKeywords,1)}function m(){if($("position",/^at/,0)){const A=P();return A||t("Missing positioning value"),A}}function P(){const A=E();if(A.x||A.y)return{type:"position",value:A}}function E(){return{x:k(),y:k()}}function x(A){let M=A();const F=[];if(M)for(F.push(M);I(s.comma);)M=A(),M?F.push(M):t("One extra comma");return F}function C(){const A=v();return A||t("Expected color definition"),A.length=k(),A}function v(){return S()||L()||U()||R()||T()||G()||b()}function b(){return $("literal",s.literalColor,0)}function S(){return $("hex",s.hexColor,1)}function T(){return a(s.rgbColor,()=>({type:"rgb",value:x(B)}))}function R(){return a(s.rgbaColor,()=>({type:"rgba",value:x(B)}))}function G(){return a(s.varColor,()=>({type:"var",value:V()}))}function U(){return a(s.hslColor,()=>{I(s.percentageValue)&&t("HSL hue value must be a number in degrees (0-360) or normalized (-360 to 360), not a percentage");const M=B();I(s.comma);let F=I(s.percentageValue);const z=F?F[1]:null;I(s.comma),F=I(s.percentageValue);const Y=F?F[1]:null;return(!z||!Y)&&t("Expected percentage value for saturation and lightness in HSL"),{type:"hsl",value:[M,z,Y]}})}function L(){return a(s.hslaColor,()=>{const A=B();I(s.comma);let M=I(s.percentageValue);const F=M?M[1]:null;I(s.comma),M=I(s.percentageValue);const z=M?M[1]:null;I(s.comma);const Y=B();return(!F||!z)&&t("Expected percentage value for saturation and lightness in HSLA"),{type:"hsla",value:[A,F,z,Y]}})}function V(){return I(s.variableName)[1]}function B(){return I(s.number)[1]}function k(){return $("%",s.percentageValue,1)||H()||D()||N()}function H(){return $("position-keyword",s.positionKeywords,1)}function D(){return a(s.calcValue,()=>{let A=1,M=0;for(;A>0&&M<e.length;){const z=e.charAt(M);z==="("?A++:z===")"&&A--,M++}A>0&&t("Missing closing parenthesis in calc() expression");const F=e.substring(0,M-1);return j(M-1),{type:"calc",value:F}})}function N(){return $("px",s.pixelValue,1)||$("em",s.emValue,1)}function $(A,M,F){const z=I(M);if(z)return{type:A,value:z[F]}}function I(A){let M,F;return F=/^\s+/.exec(e),F&&j(F[0].length),M=A.exec(e),M&&j(M[0].length),M}function j(A){e=e.substr(A)}return function(A){return e=A.toString().trim(),e.endsWith(";")&&(e=e.slice(0,-1)),r()}})();const Ec=mi.parse.bind(mi);var yi=yi||{};yi.stringify=(function(){var s={"visit_linear-gradient":function(e){return s.visit_gradient(e)},"visit_repeating-linear-gradient":function(e){return s.visit_gradient(e)},"visit_radial-gradient":function(e){return s.visit_gradient(e)},"visit_repeating-radial-gradient":function(e){return s.visit_gradient(e)},visit_gradient:function(e){var t=s.visit(e.orientation);return t&&(t+=", "),e.type+"("+t+s.visit(e.colorStops)+")"},visit_shape:function(e){var t=e.value,r=s.visit(e.at),i=s.visit(e.style);return i&&(t+=" "+i),r&&(t+=" at "+r),t},"visit_default-radial":function(e){var t="",r=s.visit(e.at);return r&&(t+=r),t},"visit_extent-keyword":function(e){var t=e.value,r=s.visit(e.at);return r&&(t+=" at "+r),t},"visit_position-keyword":function(e){return e.value},visit_position:function(e){return s.visit(e.value.x)+" "+s.visit(e.value.y)},"visit_%":function(e){return e.value+"%"},visit_em:function(e){return e.value+"em"},visit_px:function(e){return e.value+"px"},visit_calc:function(e){return"calc("+e.value+")"},visit_literal:function(e){return s.visit_color(e.value,e)},visit_hex:function(e){return s.visit_color("#"+e.value,e)},visit_rgb:function(e){return s.visit_color("rgb("+e.value.join(", ")+")",e)},visit_rgba:function(e){return s.visit_color("rgba("+e.value.join(", ")+")",e)},visit_hsl:function(e){return s.visit_color("hsl("+e.value[0]+", "+e.value[1]+"%, "+e.value[2]+"%)",e)},visit_hsla:function(e){return s.visit_color("hsla("+e.value[0]+", "+e.value[1]+"%, "+e.value[2]+"%, "+e.value[3]+")",e)},visit_var:function(e){return s.visit_color("var("+e.value+")",e)},visit_color:function(e,t){var r=e,i=s.visit(t.length);return i&&(r+=" "+i),r},visit_angular:function(e){return e.value+"deg"},visit_directional:function(e){return"to "+e.value},visit_array:function(e){var t="",r=e.length;return e.forEach(function(i,n){t+=s.visit(i),n<r-1&&(t+=", ")}),t},visit_object:function(e){return e.width&&e.height?s.visit(e.width)+" "+s.visit(e.height):""},visit:function(e){if(!e)return"";if(e instanceof Array)return s.visit_array(e);if(typeof e=="object"&&!e.type)return s.visit_object(e);if(e.type){var t=s["visit_"+e.type];if(t)return t(e);throw Error("Missing visitor visit_"+e.type)}else throw Error("Invalid node.")}};return function(e){return s.visit(e)}})(),yi.stringify.bind(yi);function lo(s){const e=s.length-1;return s.map((t,r)=>{const i=t.value;let n=or(r/e,3),o="#00000000";switch(t.type){case"rgb":o=Le({r:Number(i[0]??0),g:Number(i[1]??0),b:Number(i[2]??0)});break;case"rgba":o=Le({r:Number(i[0]??0),g:Number(i[1]??0),b:Number(i[2]??0),a:Number(i[3]??0)});break;case"literal":o=Le(t.value);break;case"hex":o=Le(`#${t.value}`);break}switch(t.length?.type){case"%":n=Number(t.length.value)/100;break}return{offset:n,color:o}})}function co(s){let e=0;switch(s.orientation?.type){case"angular":e=Number(s.orientation.value);break}return{type:"linear-gradient",angle:e,stops:lo(s.colorStops)}}function ho(s){return s.orientation?.map(e=>{switch(e?.type){case"shape":case"default-radial":case"extent-keyword":default:return null}}),{type:"radial-gradient",stops:lo(s.colorStops)}}function Er(s){return s.startsWith("linear-gradient(")||s.startsWith("radial-gradient(")}function Mc(s){return Ec(s).map(e=>{switch(e?.type){case"linear-gradient":return co(e);case"repeating-linear-gradient":return{...co(e),repeat:!0};case"radial-gradient":return ho(e);case"repeating-radial-gradient":return{...ho(e),repeat:!0};default:return}}).filter(Boolean)}function Ac(s){let e;return typeof s=="string"?e={color:s}:e=s,{color:Le(e.color)}}function Oc(s){let e;if(typeof s=="string"?e={image:s}:e=s,e.image){const{type:t,...r}=Mc(e.image)[0]??{};switch(t){case"radial-gradient":return{radialGradient:r};case"linear-gradient":return{linearGradient:r}}}return e}function kc(s){let e;return typeof s=="string"?e={image:s}:e=s,e}function Dc(s){let e;return typeof s=="string"?e={preset:s}:e=s,{preset:e.preset,foregroundColor:K(e.foregroundColor)?void 0:Le(e.foregroundColor),backgroundColor:K(e.backgroundColor)?void 0:Le(e.backgroundColor)}}function gs(s){return!K(s.color)}function Ic(s){return typeof s=="string"?Tc(s):gs(s)}function Rc(s){return!K(s.image)&&Er(s.image)||!!s.linearGradient||!!s.radialGradient}function Uc(s){return typeof s=="string"?Er(s):Rc(s)}function Bc(s){return!K(s.image)&&!Er(s.image)}function Lc(s){return typeof s=="string"?!Er(s):Bc(s)}function Nc(s){return!K(s.preset)}function Fc(s){return typeof s=="string"?!1:Nc(s)}function at(s){const e=s&&typeof s=="object"?s.enabled:void 0;return Ic(s)?Ve({enabled:e,...Ac(s)}):Uc(s)?Ve({enabled:e,...Oc(s)}):Lc(s)?Ve({enabled:e,...kc(s)}):Fc(s)?Ve({enabled:e,...Dc(s)}):{}}function $c(s){return typeof s=="string"?{...at(s)}:{...at(s),...fs(s,["fillWithShape"])}}const ms=Symbol("properties"),uo=Symbol("defaultValueInited");function ys(s){let e;if(Object.hasOwn(s,ms))e=s[ms];else{const t=Object.getPrototypeOf(s);e=new Map(t?ys(t):void 0),s[ms]=e}return e}function zc(s,e={}){const t=Symbol.for(s),{default:r,fallback:i,alias:n}=e,o={declaration:e,internalKey:t},a=()=>typeof r=="function"?r():r,l=()=>typeof i=="function"?i():i;function c(){let f;if(n&&n!==s?f=Pc(this,n):typeof this.getter<"u"?f=this.getter(s,o):f=this[t],f=f??l(),f===void 0&&r!==void 0&&!this[uo]){this[uo]=!0;const d=a();d!==void 0&&(h.call(this,d),f=d)}return f}function h(f){n&&n!==s?Sc(this,n,f):typeof this.setter<"u"?this.setter(s,f,o):this[t]=f}return{get:c,set:h}}function vi(s,e,t={}){ys(s).set(e,t);const r=zc(e,t);Object.defineProperty(s.prototype,e,{get(){return r.get.call(this)},set(i){const n=r.get.call(this);r.set.call(this,i),this.onUpdateProperty?.(e,i,n,t)},configurable:!0,enumerable:!0})}function w(s){return function(e,t){if(typeof t!="string")throw new TypeError("Failed to @property decorator, prop name cannot be a symbol");vi(e.constructor,t,s)}}function Vc(s){return typeof s=="string"?{...at(s)}:{...at(s),...fs(s,["fillWithShape"])}}const fo=()=>bc(10);function _i(s){return typeof s=="string"?{...at(s)}:{...at(s),...fs(s,["width","style","lineCap","lineJoin","headEnd","tailEnd"])}}function Gc(s){return typeof s=="string"?{color:Le(s)}:{...s,color:K(s.color)?ao:Le(s.color)}}function jc(){return{boxShadow:"none"}}function Wc(s){return typeof s=="string"?s.startsWith("<svg")?{svg:s}:{paths:[{data:s}]}:Array.isArray(s)?{paths:s.map(e=>typeof e=="string"?{data:e}:e)}:s}function qc(){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 Xc(){return{rotate:0,scaleX:1,scaleY:1,skewX:0,skewY:0,translateX:0,translateY:0,transform:"none",transformOrigin:"center"}}function Hc(){return{...qc(),...Xc(),...jc(),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 Yc(){return{highlight:{},highlightImage:"none",highlightReferImage:"none",highlightColormap:"none",highlightLine:"none",highlightSize:"cover",highlightThickness:"100%"}}function Kc(){return{listStyle:{},listStyleType:"none",listStyleImage:"none",listStyleColormap:"none",listStyleSize:"cover",listStylePosition:"outside"}}function Zc(){return{...Yc(),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 Jc(){return{...Kc(),writingMode:"horizontal-tb",textWrap:"wrap",textAlign:"start",textIndent:0,lineHeight:1.2}}function Qc(){return{...Jc(),...Zc(),textStrokeWidth:0,textStrokeColor:"rgb(0, 0, 0)"}}function bi(s){return Ve({...s,color:K(s.color)?void 0:Le(s.color),backgroundColor:K(s.backgroundColor)?void 0:Le(s.backgroundColor),borderColor:K(s.borderColor)?void 0:Le(s.borderColor),outlineColor:K(s.outlineColor)?void 0:Le(s.outlineColor),shadowColor:K(s.shadowColor)?void 0:Le(s.shadowColor)})}function po(){return{...Hc(),...Qc()}}const eh=/\r\n|\n\r|\n|\r/,th=new RegExp(`^(${eh.source})$`),rh=`
|
|
2
|
+
`;function ih(s){return th.test(s)}function vs(s){const e=[];function t(){return e[e.length-1]}function r(a,l,c){const h=a?bi(a):{},f=l?at(l):void 0,d=c?_i(c):void 0,g=Ve({...h,fill:f,outline:d,fragments:[]});return e[e.length-1]?.fragments.length===0?e[e.length-1]=g:e.push(g),g}function i(a="",l,c,h){const f=l?bi(l):{},d=c?at(c):void 0,g=h?_i(h):void 0;Array.from(a).forEach(p=>{if(ih(p)){const{fragments:y,fill:m,outline:P,...E}=t()||r();y.length||y.push(Ve({...f,fill:d,outline:g,content:rh})),r(E,m,P)}else{const y=t()||r(),m=y.fragments[y.fragments.length-1];if(m){const{content:P,fill:E,outline:x,...C}=m;if(ds(d,E)&&ds(g,x)&&ds(f,C)){m.content=`${P}${p}`;return}}y.fragments.push(Ve({...f,fill:d,outline:g,content:p}))}})}(Array.isArray(s)?s:[s]).forEach(a=>{if(typeof a=="string")r(),i(a);else if(go(a)){const{content:l,fill:c,outline:h,...f}=a;r(f,c,h),i(l)}else if(sh(a)){const{fragments:l,fill:c,outline:h,...f}=a;r(f,c,h),l.forEach(d=>{const{content:g,fill:p,outline:y,...m}=d;i(g,m,p,y)})}else Array.isArray(a)?(r(),a.forEach(l=>{if(typeof l=="string")i(l);else if(go(l)){const{content:c,fill:h,outline:f,...d}=l;i(c,d,h,f)}})):console.warn("Failed to parse text content",a)});const o=t();return o&&!o.fragments.length&&o.fragments.push({content:""}),e}function sh(s){return s&&typeof s=="object"&&"fragments"in s&&Array.isArray(s.fragments)}function go(s){return s&&typeof s=="object"&&"content"in s&&typeof s.content=="string"}function mo(s){return typeof s=="string"||Array.isArray(s)?{content:vs(s)}:Ve({...s,content:vs(s.content??""),style:s.style?bi(s.style):void 0,effects:s.effects?s.effects.map(e=>bi(e)):void 0,measureDom:s.measureDom,fonts:s.fonts,fill:s.fill?at(s.fill):void 0,outline:s.outline?_i(s.outline):void 0})}const wi=new Map;function W(s,e){return function(t){Object.defineProperty(t.prototype,"is",{value:s,enumerable:!0,configurable:!0}),e&&Object.keys(e).forEach(r=>{vi(t,r,{fallback:e[r]})}),wi.set(s,t)}}function nh(s="node",e={}){const t=wi.get(s);if(!t)throw new Error(`Failed to createNode, tag: ${s}`);return new t().setProperties(e)}class Se{static _queue=[];static _currentTime=0;static _elapsed=0;static _requestId;static get currentTime(){return this._currentTime}static get elapsed(){return this._elapsed}static on(e,t={}){const{sort:r=0,once:i=!1}=t;this._queue[r]||(this._queue[r]=[]),this._queue[r].push({cb:e,once:i})}static off(e,t={}){const{sort:r=0}=t,i=this._queue[r];if(!i)return;const n=[];for(let o=i.length,a=0;a<o;a++){const l=i[a];l.cb!==e&&n.push(l)}n.length?this._queue[r]=n:this._queue.splice(r,1)}static start(){"requestAnimationFrame"in globalThis&&(this._currentTime=performance.now(),this._requestId=requestAnimationFrame(e=>this._update(e)))}static stop(){this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=void 0)}static _update(e){this._elapsed=e-this._currentTime,this._currentTime=e,this._requestId=requestAnimationFrame(t=>this._update(t)),this._performUpdate()}static _performUpdate(){const e=this._queue,t=[];for(let r=e.length,i=r;i>=0;i--){const n=e[i];if(!n)continue;const o=[];for(let a=n.length,l=0;l<a;l++){const c=n[l];try{c.cb()}catch(h){console.warn(h)}c.once||o.push(c)}o.length&&(t[i]=o)}this._queue=t}}Se.start();async function _s(s){return new Promise(e=>{Se.on(()=>{s?.(),e()},{sort:1,once:!0})})}const xi=Math.PI,Ne=xi*2;let oh=0;function yo(s){return s?.__SPECTOR_Object_TAG?.id??++oh}function bs(s){return!(s&s-1)&&!!s}const ah=/([\w-]+)\((.+?)\)/g,lh=/[^,]+/g,ch=/([-e.\d]+)(.*)/;function ws(s){return Array.isArray(s)?s.map(e=>({name:e.name,args:e.args.map(t=>({...t,normalizedIntValue:t.normalizedDefaultIntValue}))})):{...s,normalizedIntValue:s.normalizedDefaultIntValue}}function Mr(s,e,t={}){const r=Ar(e,t);return r.length?r:vo(s,e,t)}function Ar(s,e={}){const t=[];let r;for(;(r=ah.exec(s))!==null;){const[,i,n]=r;i&&t.push({name:i,args:hh(i,n,e)})}return t}function hh(s,e,t={}){const r=[];let i,n=0;for(;(i=lh.exec(e))!==null;)r.push(vo(s,i[0],{...t,index:n++}));return r}function vo(s,e,t={}){const{width:r=1,height:i=1,index:n=0}=t,o=e.match(ch),a={unit:o?.[2]??null,value:e,intValue:Number(o?.[1]),normalizedIntValue:0,normalizedDefaultIntValue:0};switch(s){case"scale":case"scaleX":case"scaleY":case"scale3d":a.normalizedDefaultIntValue=1;break}switch(a.unit){case"%":a.normalizedIntValue=a.intValue/100;break;case"rad":a.normalizedIntValue=a.intValue/Ne;break;case"deg":a.normalizedIntValue=a.intValue/360;break;case"px":switch(n){case 0:a.normalizedIntValue=a.intValue/r;break;case 1:a.normalizedIntValue=a.intValue/i;break}break;case"turn":case"em":case"rem":default:a.normalizedIntValue=a.intValue;break}return a}const _o="WebGL2RenderingContext"in globalThis,bo="ImageBitmap"in globalThis,wo="ResizeObserver"in globalThis,ar="PointerEvent"in globalThis,xo="WheelEvent"in globalThis,uh="MouseEvent"in globalThis,xt="ontouchstart"in globalThis,Po="onclick"in globalThis,xs="createImageBitmap"in globalThis,Ps="AudioContext"in globalThis,Ss="webkitAudioContext"in globalThis,Cs="OfflineAudioContext"in globalThis,So="webkitOfflineAudioContext"in globalThis,Co=Ps||Ss,Or=typeof window<"u",Ts=globalThis.devicePixelRatio||1,Es=s=>s!==null&&typeof s=="object"&&s.nodeType===1,To=s=>Es(s)&&s.tagName==="VIDEO",fh=s=>Es(s)&&s.tagName==="IMG";function Eo(s){return typeof s=="object"&&s!==null&&s.nodeType===1&&s.tagName==="CANVAS"}function Mo(s){return _o&&s instanceof globalThis.WebGL2RenderingContext}function Ao(){if(Or)return globalThis.document.createElement("canvas")}function Oo(s,e=globalThis.location){if(s.startsWith("data:"))return"";e=e||globalThis.location;const t=new URL(s,document.baseURI);return t.hostname!==e.hostname||t.port!==e.port||t.protocol!==e.protocol?"anonymous":""}function ko(s,e,t){t===null&&!e.startsWith("data:")?s.crossOrigin=Oo(e):t!==!1&&(s.crossOrigin=typeof t=="string"?t:"anonymous")}class Ms{_map=new WeakMap;_toRaw(e){if(e&&typeof e=="object"){const t=e.__v_raw;t&&(e=this._toRaw(t))}return e}delete(e){return this._map.delete(this._toRaw(e))}get(e){return this._map.get(this._toRaw(e))}has(e){return this._map.has(this._toRaw(e))}set(e,t){return this._map.set(this._toRaw(e),this._toRaw(t)),this}}class kr{cursor;bubbles=!1;cancelBubble=!1;cancelable=!1;composed=!1;defaultPrevented=!1;eventPhase=kr.prototype.NONE;isTrusted=!1;timeStamp=0;type="";composedPath(){return this.path}initEvent(...e){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){"preventDefault"in this.nativeEvent&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}propagationImmediatelyStopped=!1;stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}propagationStopped=!1;stopPropagation(){"stopPropagation"in this.nativeEvent&&this.nativeEvent.stopPropagation(),this.propagationStopped=!0}NONE=0;CAPTURING_PHASE=1;AT_TARGET=2;BUBBLING_PHASE=3;initUIEvent(...e){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}}class Do extends kr{getModifierState(...e){throw new Error("getModifierState() is a legacy DOM API. It is not implemented in the Federated Events API.")}initKeyboardEvent(...e){throw new Error("initKeyboardEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}}class As extends kr{client={x:0,y:0};get clientX(){return this.client.x}get clientY(){return this.client.y}layer={x:0,y:0};get layerX(){return this.layer.x}get layerY(){return this.layer.y}movement={x:0,y:0};get movementX(){return this.movement.x}get movementY(){return this.movement.y}offset={x:0,y:0};get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}page={x:0,y:0};get pageX(){return this.page.x}get pageY(){return this.page.y}screen={x:0,y:0};get screenX(){return this.screen.x}get screenY(){return this.screen.y}get x(){return this.clientX}get y(){return this.clientY}getModifierState(e){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(...e){throw new Error("Method not implemented.")}global={x:0,y:0};get globalX(){return this.global.x}get globalY(){return this.global.y}}class Io extends As{width=0;height=0;isPrimary=!1;getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class Ro extends As{static DOM_DELTA_PIXEL=0;DOM_DELTA_PIXEL=0;static DOM_DELTA_LINE=1;DOM_DELTA_LINE=1;static DOM_DELTA_PAGE=2;DOM_DELTA_PAGE=2}const dh={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class Uo extends wt{event;target;cursor="default";cursorStyles={default:"inherit",pointer:"pointer"};setuped=!1;enableMoveEvent=!0;enableWheelEvent=!0;enableClickEvent=!0;setTarget(e){this.removeEventListeners(),this.target=e,this.addEventListeners()}removeEventListeners(){if(!this.setuped||!this.target)return;const e=this.target.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):ar&&(e.touchAction=""),ar?(this.target.removeEventListener("pointerdown",this._onPointerDown),this.target.removeEventListener("pointerleave",this._onPointerOver),this.target.removeEventListener("pointerover",this._onPointerOver),this.target.removeEventListener("pointermove",this._onPointerMove),this.target.removeEventListener("pointerup",this._onPointerUp)):(this.target.removeEventListener("mousedown",this._onPointerDown),this.target.removeEventListener("mouseout",this._onPointerOver),this.target.removeEventListener("mouseover",this._onPointerOver),this.target.removeEventListener("mousemove",this._onPointerMove),this.target.removeEventListener("mouseup",this._onPointerUp)),xt&&(this.target.removeEventListener("touchstart",this._onPointerDown),this.target.removeEventListener("touchmove",this._onPointerMove),this.target.removeEventListener("touchend",this._onPointerUp)),this.target.removeEventListener("wheel",this._onWheel),document.removeEventListener("keydown",this._onKeyDown),document.removeEventListener("keypress",this._onKeyPress),document.removeEventListener("keyup",this._onKeyUp),this.target=void 0,this.setuped=!1}addEventListeners(){if(this.setuped||!this.target)return;const e=this.target.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):ar&&(e.touchAction="none")),ar?(this.target.addEventListener("pointerdown",this._onPointerDown),this.target.addEventListener("pointerleave",this._onPointerOver),this.target.addEventListener("pointerover",this._onPointerOver),this.target.addEventListener("pointermove",this._onPointerMove),this.target.addEventListener("pointerup",this._onPointerUp)):(this.target.addEventListener("mousedown",this._onPointerDown),this.target.addEventListener("mouseout",this._onPointerOver),this.target.addEventListener("mouseover",this._onPointerOver),this.target.addEventListener("mousemove",this._onPointerMove),this.target.addEventListener("mouseup",this._onPointerUp)),xt&&(this.target.addEventListener("touchstart",this._onPointerDown),this.target.addEventListener("touchmove",this._onPointerMove),this.target.addEventListener("touchend",this._onPointerUp)),this.target.addEventListener("wheel",this._onWheel),document.addEventListener("keydown",this._onKeyDown),document.addEventListener("keypress",this._onKeyPress),document.addEventListener("keyup",this._onKeyUp),this.setuped=!0}normalize(e){const t=[];if(xt&&e instanceof globalThis.TouchEvent)for(let r=0,i=e.changedTouches.length;r<i;r++){const n=e.changedTouches[r];typeof n.button>"u"&&(n.button=0),typeof n.buttons>"u"&&(n.buttons=1),typeof n.isPrimary>"u"&&(n.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof n.width>"u"&&(n.width=n.radiusX||1),typeof n.height>"u"&&(n.height=n.radiusY||1),typeof n.tiltX>"u"&&(n.tiltX=0),typeof n.tiltY>"u"&&(n.tiltY=0),typeof n.pointerType>"u"&&(n.pointerType="touch"),typeof n.pointerId>"u"&&(n.pointerId=n.identifier||0),typeof n.pressure>"u"&&(n.pressure=n.force||.5),typeof n.twist>"u"&&(n.twist=0),typeof n.tangentialPressure>"u"&&(n.tangentialPressure=0),typeof n.layerX>"u"&&(n.layerX=n.offsetX=n.clientX),typeof n.layerY>"u"&&(n.layerY=n.offsetY=n.clientY),n.type=e.type,t.push(n)}else if(xo&&e instanceof globalThis.WheelEvent)t.push(e);else if(ar&&e instanceof globalThis.PointerEvent)t.push(e);else{const r=e;typeof r.isPrimary>"u"&&(r.isPrimary=!0),typeof r.width>"u"&&(r.width=1),typeof r.height>"u"&&(r.height=1),typeof r.tiltX>"u"&&(r.tiltX=0),typeof r.tiltY>"u"&&(r.tiltY=0),typeof r.pointerType>"u"&&(r.pointerType="mouse"),typeof r.pointerId>"u"&&(r.pointerId=1),typeof r.pressure>"u"&&(r.pressure=.5),typeof r.twist>"u"&&(r.twist=0),typeof r.tangentialPressure>"u"&&(r.tangentialPressure=0),t.push(r)}return t}_clonePointerEvent(e){const t=new Io;return t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,t.isTrusted=e.isTrusted,this._copyMouseEvent(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.x=t.screen.x,t.global.y=t.screen.y,t.offset.x=t.screen.x,t.offset.y=t.screen.y,t.type==="pointerleave"?t.type="pointerout":t.type.startsWith("mouse")?t.type=t.type.replace("mouse","pointer"):t.type.startsWith("touch")&&(t.type=dh[t.type]||t.type),t}_copyInputEvent(e,t){e.nativeEvent=t,e.bubbles=t.bubbles,e.cancelBubble=t.cancelBubble,e.cancelable=t.cancelable,e.composed=t.composed,e.currentTarget=t.currentTarget,e.defaultPrevented=t.defaultPrevented,e.eventPhase=t.eventPhase,e.isTrusted=t.isTrusted,e.returnValue=t.returnValue,e.srcElement=t.srcElement,e.timeStamp=t.timeStamp,e.type=t.type}_copyMouseEvent(e,t){this._copyInputEvent(e,t),e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}_cloneWheelEvent(e){const t=new Ro;return this._copyMouseEvent(t,e),t.wheelDeltaY=e.wheelDeltaY,t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.x=t.screen.x,t.global.y=t.screen.y,t.offset.x=t.screen.x,t.offset.y=t.screen.y,t}_cloneKeyboardEvent(e){const t=new Do;return this._copyInputEvent(t,e),t.altKey=e.altKey,t.charCode=e.charCode,t.code=e.code,t.ctrlKey=e.ctrlKey,t.isComposing=e.isComposing,t.key=e.key,t.keyCode=e.keyCode,t.location=e.location,t.metaKey=e.metaKey,t.repeat=e.repeat,t.shiftKey=e.shiftKey,t}setCursor(e="default"){if(!this.target||this.cursor===e)return;this.cursor=e;const t=!(globalThis.OffscreenCanvas&&this.target instanceof OffscreenCanvas),r=this.cursorStyles[e];if(r)switch(typeof r){case"string":t&&(this.target.style.cursor=r);break;case"function":r(e);break;case"object":t&&Object.assign(this.target.style,r);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.target.style.cursor=e)}mapPositionToPoint(e,t,r){if(!this.target)return;const i=this.target.isConnected?this.target.getBoundingClientRect():void 0,n=Number(this.target.getAttribute("data-pixel-ratio"))||1,o=Number(this.target.getAttribute("width"))||(i?i.width*n:0),a=Number(this.target.getAttribute("height"))||(i?i.height*n:0),l=i??{width:o,height:a,left:0,top:0},c=1/n;e.x=(t-l.left)*(o/l.width)*c,e.y=(r-l.top)*(a/l.height)*c}_onKeyDown=e=>{const t=this.normalize(e);for(let r=0,i=t.length;r<i;r++)this.emit("keydown",this.event=this._cloneKeyboardEvent(t[r]));this.event?.cursor&&this.setCursor(this.event.cursor)};_onKeyPress=e=>{const t=this.normalize(e);for(let r=0,i=t.length;r<i;r++)this.emit("keypress",this.event=this._cloneKeyboardEvent(t[r]));this.event?.cursor&&this.setCursor(this.event.cursor)};_onKeyUp=e=>{const t=this.normalize(e);for(let r=0,i=t.length;r<i;r++)this.emit("keyup",this.event=this._cloneKeyboardEvent(t[r]));this.event?.cursor&&this.setCursor(this.event.cursor)};_onPointerDown=e=>{if(xt&&e.pointerType==="touch")return;const t=this.normalize(e);for(let r=0,i=t.length;r<i;r++)this.emit("pointerdown",this.event=this._clonePointerEvent(t[r]));this.event?.cursor&&this.setCursor(this.event.cursor)};_onPointerOver=e=>{if(!this.enableClickEvent||xt&&e.pointerType==="touch")return;const t=this.normalize(e);for(let r=0,i=t.length;r<i;r++)this.emit("pointerover",this.event=this._clonePointerEvent(t[r]));this.event?.cursor&&this.setCursor(this.event.cursor)};_onPointerMove=e=>{if(!this.enableMoveEvent||xt&&e.pointerType==="touch")return;const t=this.normalize(e);for(let r=0,i=t.length;r<i;r++)this.emit("pointermove",this.event=this._clonePointerEvent(t[r]));this.event?.cursor&&this.setCursor(this.event.cursor)};_onPointerUp=e=>{if(!this.enableClickEvent||xt&&e.pointerType==="touch")return;let t=e.target;e.composedPath&&e.composedPath().length>0&&(t=e.composedPath()[0]);const r=t!==this.target?"outside":"",i=this.normalize(e);for(let n=0,o=i.length;n<o;n++){const a=this._clonePointerEvent(i[n]);a.type+=r,this.emit("pointerup",this.event=a)}this.event?.cursor&&this.setCursor(this.event.cursor)};_onWheel=e=>{if(!this.enableWheelEvent)return;const t=this.normalize(e);for(let r=0,i=t.length;r<i;r++)this.emit("wheel",this.event=this._cloneWheelEvent(t[r]));this.event?.cursor&&this.setCursor(this.event.cursor)}}let ph=0;class It extends wt{instanceId=++ph;_customPropertyAccessor;_properties=new Map;_updatedProperties=new Map;_changedProperties=new Set;_updatingPromise=Promise.resolve();_updating=!1;useCustomPropertyAccessor(e){return this._customPropertyAccessor=e,this.getPropertyDeclarations().forEach((t,r)=>{const i=e.get(r,()=>{}),n=this._properties.get(r);i===void 0?n!==void 0&&e.set(r,n):i!==n&&(t.alias&&t.alias!==r?this.setProperty(r,i):this._properties.set(r,i),this._updateProperty(r,i,n,t),this.emit("updateProperty",r,i,n,t))}),this}getter(e,t){return t?.declaration.protected?this[t.internalKey]:this._customPropertyAccessor?this._customPropertyAccessor.get(e,()=>this._properties.get(e)):this._properties.get(e)}setter(e,t,r){r?.declaration.protected?this[r.internalKey]=t:(this._customPropertyAccessor&&this._customPropertyAccessor.set(e,t),this._properties.set(e,t))}equal(e){return!!(e&&this.instanceId===e.instanceId)}async _enqueueUpdate(){this._updating=!0;try{await this._updatingPromise}catch(e){Promise.reject(e)}await _s(),this._updating&&(this.update(),this._updating=!1)}update(){this._update(this._updatedProperties),this._updatedProperties=new Map}_update(e){}_updateProperty(e,t,r,i){}isDirty(e){return this._updatedProperties.has(e)}getPropertyDeclarations(){return ys(this.constructor)}getPropertyDeclaration(e){return this.getPropertyDeclarations().get(e)}getProperty(e){return this[e]}setProperty(e,t){return this[e]=t,this}getProperties(e){const t={};for(const[r,i]of this.getPropertyDeclarations())!i.protected&&!i.alias&&(!e||e.includes(r))&&(t[r]=this.getProperty(r));return t}setProperties(e){if(e&&typeof e=="object")for(const[t]of this.getPropertyDeclarations())t in e&&this.setProperty(t,e[t]);return this}resetProperties(){for(const[e,t]of this.getPropertyDeclarations())this.setProperty(e,typeof t.fallback=="function"?t.fallback():t.fallback);return this}onUpdateProperty(e,t,r,i){this.requestUpdate(e,t,r,i)}requestUpdate(e,t,r,i){if(e!==void 0)if(!Object.is(t,r))this._updatedProperties.set(e,r),this._changedProperties.add(e),i??=this.getPropertyDeclaration(e),this._updateProperty(e,t,r,i),this.emit("updateProperty",e,t,r,i);else return;this._updating||(this._updatingPromise=this._enqueueUpdate())}toJSON(){const e={};return this._properties.forEach((t,r)=>{t!==void 0&&(t&&typeof t=="object"?"toJSON"in t&&typeof t.toJSON=="function"?e[r]=t.toJSON():Array.isArray(t)?e[r]=[...t]:e[r]={...t}:e[r]=t)}),e}clone(){return new this.constructor(this.toJSON())}free(){this.removeAllListeners()}}class Bo extends It{}class Pt extends Bo{}function gh(s,e){var t={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var i in t)r[t[i]]=i;var n={};s.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,l,c=r[this.toHex()];if(c)return c;if(o?.closest){var h=this.toRgb(),f=1/0,d="black";if(!n.length)for(var g in t)n[g]=new s(t[g]).toRgb();for(var p in t){var y=(a=h,l=n[p],Math.pow(a.r-l.r,2)+Math.pow(a.g-l.g,2)+Math.pow(a.b-l.b,2));y<f&&(f=y,d=p)}return d}},e.string.push([function(o){var a=o.toLowerCase(),l=a==="transparent"?"#0000":t[a];return l?new s(l).toRgb():null},"name"])}vc([gh]);class lt{get value(){return this._value}set value(e){this._colord=ps(e??"none")}get r8(){return this._colord.rgba.r}get g8(){return this._colord.rgba.g}get b8(){return this._colord.rgba.b}get a8(){return this._colord.rgba.a*255&255}get r(){return this.r8/255}get g(){return this.g8/255}get b(){return this.b8/255}get a(){return this._colord.rgba.a}get rgb(){return(this.r8<<16)+(this.g8<<8)+this.b8}get bgr(){return(this.b8<<16)+(this.g8<<8)+this.r8}get abgr(){return(this.a8<<24)+this.bgr}constructor(e=0){this.value=e}toHex(){return this._colord.toHex()}toRgb(){return this._colord.toRgb()}toRgbString(){return this._colord.toRgbString()}toHsl(){return this._colord.toHsl()}toHslString(){return this._colord.toHslString()}toHsv(){return this._colord.toHsv()}toArgb(e=this.a,t=!0){if(e===1)return(255<<24)+this.rgb;if(e===0)return t?0:this.rgb;let r=this.r8,i=this.g8,n=this.b8;return t&&(r=r*e+.5|0,i=i*e+.5|0,n=n*e+.5|0),(e*255<<24)+(r<<16)+(i<<8)+n}toArray(){return[this.r,this.g,this.b,this.a]}}class Qe extends wt{constructor(e){super(),this.dim=e}_array=[];get length(){return this.dim}operate(e,t,r){const{dim:i,_array:n}=this;let o;typeof t=="number"?o=Array.from({length:i},()=>t):t instanceof ct||t instanceof Qe?o=t.toArray():o=t;let a,l=[];if(r?r instanceof Qe?a=r:l=r:a=this,t instanceof ct){const{cols:c}=t;switch(e){case"*":for(let h=0;h<i;h++){let f=0;for(let d=0;d<i;d++)f+=n[h]*o[d*c+h];l[h]=f}break;default:throw new Error(`Not support operator in '${this.toName()} ${e} ${t.toName()}'`)}}else switch(e){case"+":for(let c=0;c<i;c++)l[c]=n[c]+o[c];break;case"-":for(let c=0;c<i;c++)l[c]=n[c]-o[c];break;case"*":for(let c=0;c<i;c++)l[c]=n[c]*o[c];break;case"/":for(let c=0;c<i;c++)l[c]=n[c]/o[c];break;case"rot":{const c=Math.cos(o[0]),h=Math.sin(o[0]);l[0]=n[0]*c-n[1]*h,l[1]=n[1]*c+n[0]*h;break}case"==":{let c=!0;for(let h=0;h<i;h++)c=c&&n[h]===o[h];return c}case"=":for(let c=0;c<i;c++){const h=o[c];h!==void 0&&(n[c]=h)}return this._onUpdate(n),this.emit("update",n),this;default:throw new Error(`Not support operator in '${this.toName()} ${e} Vector'`)}return a?.set(l)??l}add(e,...t){return t.length&&typeof e=="number"&&(e=[e,...t]),this.operate("+",e)}sub(e,...t){return t.length&&typeof e=="number"&&(e=[e,...t]),this.operate("-",e)}multiply(e,...t){return t.length&&typeof e=="number"&&(e=[e,...t]),this.operate("*",e)}divide(e,...t){return t.length&&typeof e=="number"&&(e=[e,...t]),this.operate("/",e)}rotate(e){return this.operate("rot",e)}set(e,...t){return t.length&&typeof e=="number"&&(e=[e,...t]),this.operate("=",e)}equals(e){return this.operate("==",e)}copy(e){return this.set(e)}clone(){const e=new this.constructor;return e.set(this.toArray()),e}_onUpdate(e){}toName(){return`Vector${this.dim}`}toArray(){return this._array.slice()}toJSON(){return this.toArray()}}class ct extends wt{constructor(e,t,r){super(),this.rows=e,this.cols=t,r?this.set(r):this.identity()}_array=[];dirtyId=0;get length(){return this.cols*this.rows}operate(e,t,r){const{cols:i,rows:n,length:o,_array:a}=this;let l;typeof t=="number"?l=Array.from({length:o},()=>t):t instanceof Qe||t instanceof ct?l=t.toArray():l=t;let c,h=[];if(r?r instanceof Qe||r instanceof ct?c=r:h=r:t instanceof Qe?c=new t.constructor:c=this,t instanceof Qe){const{dim:f}=t;switch(e){case"*":for(let d=0;d<f;d++){let g=0;for(let p=0;p<i;p++)p<f&&(g+=a[d*i+p]*(l[p]??0));h[d]=g}break;default:throw new Error(`Not support operator in '${this.toName()} ${e} ${t.toName()}'`)}}else switch(e){case"*":for(let f=0;f<i;f++)for(let d=0;d<n;d++){const g=d*i;let p=0;for(let y=0;y<n;y++){const m=g+y,P=y*i+f;p+=a[m]*(l[P]??0)}h[g+f]=p}break;case"=":for(let f=0;f<o;f++){const d=l[f];d!==void 0&&(a[f]=d)}return this._onUpdate(a),this.emit("update",a),this;default:throw new Error(`Not support operator in '${this.toName()} ${e} Matrix2'`)}return c?.set(h)??h}identity(){const{cols:e,rows:t}=this,r=[];for(let i=0;i<e;i++)for(let n=0;n<t;n++){const o=n*e,a=i+o;r[a]=n+o===a?1:0}return this.set(r)}set(e){return this.operate("=",e)}copy(e){return this.set(e)}clone(){const e=new this.constructor;return e.set(this.toArray()),e}multiply(e,t){return this.operate("*",e,t)}_onUpdate(e){this.dirtyId++}toArray(e=!1){const{cols:t,rows:r,_array:i}=this;if(e){const n=[];for(let o=0;o<r;o++)for(let a=0;a<t;a++)n[o+a*t]=i[a+o*t];return n}return i.slice()}toName(){return`Matrix${this.rows}(${this.rows}x${this.cols})`}toJSON(){return this._array.slice()}}class Lo extends ct{constructor(e){super(4,4,e)}}const No=xi/180,mh=180/xi;function Ge(s,e,t){return Math.max(e,Math.min(s,t))}function he(s,e,t){return(1-t)*s+t*e}const yh={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(s,e=20){if(!this.adaptive||!s||Number.isNaN(s))return e;let t=Math.ceil(s/this.maxLength);return t<this.minSegments?t=this.minSegments:t>this.maxSegments&&(t=this.maxSegments),t}};class Fo extends Qe{constructor(e=0,t=0,r=0,i=0){super(4),this.set(e,t,r,i)}}class Os extends ct{constructor(e){super(4,5,e)}hueRotate(e=0){const t=Math.sin(e),r=Math.cos(e),i=.213,n=.715,o=.072;return this.multiply([i+r*(1-i)+t*-i,n+r*-n+t*-n,o+r*-o+t*(1-o),0,0,i+r*-i+t*.143,n+r*(1-n)+t*.14,o+r*-o+t*-.283,0,0,i+r*-i+t*-.787,n+r*-n+t*n,o+r*(1-o)+t*o,0,0,0,0,0,1,0])}saturate(e=1){const t=(e-1)*2/3+1,r=(t-1)*-.5;return this.multiply([t,r,r,0,0,r,t,r,0,0,r,r,t,0,0,0,0,0,1,0])}brightness(e=1){const t=e;return this.multiply([t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0])}contrast(e=1){const t=e,r=-128*(t-1);return this.multiply([t,0,0,0,r,0,t,0,0,r,0,0,t,0,r,0,0,0,1,0])}invert(e=1){const t=he(1,-1,e),r=he(0,255,e);return this.multiply([t,0,0,0,r,0,t,0,0,r,0,0,t,0,r,0,0,0,1,0])}sepia(e=1){const t=Ge(e,0,1);return this.multiply([he(1,.393,t),he(0,.7689999,t),he(0,.18899999,t),0,0,he(0,.349,t),he(1,.6859999,t),he(0,.16799999,t),0,0,he(0,.272,t),he(0,.5339999,t),he(1,.13099999,t),0,0,0,0,0,1,0])}opacity(e=1){return this.multiply([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,e,0])}grayscale(e=1){const t=Ge(e,0,1),r=he(1,.3,t),i=he(0,.3,t),n=he(1,.59,t),o=he(0,.59,t),a=he(1,.11,t),l=he(0,.11,t);return this.multiply([r,o,l,0,0,i,n,l,0,0,i,o,a,0,0,0,0,0,1,0])}multiply(e){const t=e,r=this._array;return this.set([r[0]*t[0]+r[1]*t[5]+r[2]*t[10]+r[3]*t[15],r[0]*t[1]+r[1]*t[6]+r[2]*t[11]+r[3]*t[16],r[0]*t[2]+r[1]*t[7]+r[2]*t[12]+r[3]*t[17],r[0]*t[3]+r[1]*t[8]+r[2]*t[13]+r[3]*t[18],r[0]*t[4]+r[1]*t[9]+r[2]*t[14]+r[3]*t[19]+r[4],r[5]*t[0]+r[6]*t[5]+r[7]*t[10]+r[8]*t[15],r[5]*t[1]+r[6]*t[6]+r[7]*t[11]+r[8]*t[16],r[5]*t[2]+r[6]*t[7]+r[7]*t[12]+r[8]*t[17],r[5]*t[3]+r[6]*t[8]+r[7]*t[13]+r[8]*t[18],r[5]*t[4]+r[6]*t[9]+r[7]*t[14]+r[8]*t[19]+r[9],r[10]*t[0]+r[11]*t[5]+r[12]*t[10]+r[13]*t[15],r[10]*t[1]+r[11]*t[6]+r[12]*t[11]+r[13]*t[16],r[10]*t[2]+r[11]*t[7]+r[12]*t[12]+r[13]*t[17],r[10]*t[3]+r[11]*t[8]+r[12]*t[13]+r[13]*t[18],r[10]*t[4]+r[11]*t[9]+r[12]*t[14]+r[13]*t[19]+r[14],r[15]*t[0]+r[16]*t[5]+r[17]*t[10]+r[18]*t[15],r[15]*t[1]+r[16]*t[6]+r[17]*t[11]+r[18]*t[16],r[15]*t[2]+r[16]*t[7]+r[17]*t[12]+r[18]*t[17],r[15]*t[3]+r[16]*t[8]+r[17]*t[13]+r[18]*t[18],r[15]*t[4]+r[16]*t[9]+r[17]*t[14]+r[18]*t[19]+r[19]])}toMatrix4(){const e=this._array;return new Lo([e[0],e[1],e[2],e[3],e[5],e[6],e[7],e[8],e[10],e[11],e[12],e[13],e[15],e[16],e[17],e[18]])}toVector4(){const e=this._array;return new Fo(e[4]/255,e[9]/255,e[14]/255,e[19]/255)}}class vh extends ct{constructor(e){super(2,2,e)}}let ks=class extends ct{constructor(e){super(3,3,e)}affineInvert(){const[e,t,r,i,n,o,a,l,c]=this._array,h=c*n-o*l,f=o*a-c*i,d=l*i-n*a,g=e*h+t*f+r*d;if(g===0)return this.set([0,0,0,0,0,0,0,0,0]);const p=1/g;return this.set([h*p,(r*l-c*t)*p,(o*t-r*n)*p,f*p,(c*e-r*a)*p,(r*i-o*e)*p,d*p,(t*a-l*e)*p,(n*e-t*i)*p])}};class $o extends ks{constructor(e=0,t=0,r=0,i=0,n=!1){super(),this._x=e,this._y=t,this._width=r,this._height=i,this._flipY=n,this._performUpdateArray()}flipY(e){return this._flipY!==e&&(this._flipY=e,this._performUpdateArray()),this}translate(e,t){return(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this._performUpdateArray()),this}resize(e,t){return(this._width!==e||this._height!==t)&&(this._width=e,this._height=t,this._performUpdateArray()),this}_performUpdateArray(){const e=this._width,t=this._height;if(!e||!t)return;const r=this._x,i=this._y,n=this._flipY?-1:1,o=1/e*2,a=n*(1/t*2),l=-1-r*o,c=-n-i*a;this.set([o,0,l,0,a,c,0,0,1])}}let de=class oc extends Qe{get x(){return this._array[0]}set x(e){const[t,r]=this._array;t!==e&&this.set(e,r)}get y(){return this._array[1]}set y(e){const[t,r]=this._array;r!==e&&this.set(t,e)}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}get left(){return this.x}set left(e){this.x=e}get top(){return this.y}set top(e){this.y=e}constructor(e=0,t){super(2),this.set(typeof e=="number"?[e,t??e]:e)}update(e,t){const[r,i]=this._array;return(r!==e||i!==t)&&this.set(e,t),this}getLength(){const[e,t]=this._array;return Math.sqrt(e*e+t*t)}getAngle(){const[e,t]=this._array;return Math.atan2(-e,-t)+Math.PI}distanceTo(e){return Math.hypot(e.x-this.x,e.y-this.y)}normalize(){const[e,t]=this._array,r=1/(this.getLength()||1);return this.set(e*r,t*r),this}static lerp(e,t,r){return new oc(t).clone().sub(e).multiply(r).add(e)}};class Rt{get x(){return this.position.x}get y(){return this.position.y}get left(){return this.position.x}get top(){return this.position.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get width(){return this.size.x}get height(){return this.size.y}end=new de;position;size;constructor(...e){const t=new de,r=new de;switch(e.length){case 0:break;case 1:{const i=e[0];if(i instanceof Rt)t.set(i.position),r.set(i.size);else{const n=i.map(f=>f.x),o=i.map(f=>f.y),a=Math.min(...n),l=Math.max(...n),c=Math.min(...o),h=Math.max(...o);t.set(a,c),r.set(l-a,h-c)}break}case 2:t.set(e[0]),r.set(e[1]);break;default:t.set(e[0],e[1]),r.set(e[2],e[3]);break}this.update=this.update.bind(this),this.position=t.on("update",this.update),this.size=r.on("update",this.update),this.update()}update(){return this.end.set(this.position.x+this.size.x,this.position.y+this.size.y),this}toMinmax(){return{minX:this.position.x,minY:this.position.y,maxX:this.end.x,maxY:this.end.y}}toArray(){return[this.x,this.y,this.width,this.height]}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}}class Ce extends ks{static _t2d=new Ce;premultiply(e){return e.multiply(this,this)}skewX(e){return this.skew(e,0)}skewY(e){return this.skew(0,e)}skew(e,t){return this.premultiply(Ce._t2d.makeSkew(e,t))}makeSkew(e,t){const r=Math.tan(e),i=Math.tan(t);return this.set([1,i,0,r,1,0,0,0,1]),this}translateX(e){return this.translate(e,0)}translateY(e){return this.translate(0,e)}translateZ(e){return this.translate(0,0,e)}translate3d(e,t,r){return this.translate(e,t,r)}translate(e,t,r=0){return this.premultiply(Ce._t2d.makeTranslation(e,t,r))}makeTranslation(e,t,r=0){return this.set([1,0,e,0,1,t,0,0,1]),this}scaleX(e){return this.scale(e,1)}scaleY(e){return this.scale(1,e)}scale3d(e,t,r=1){return this.scale(e,t,r)}scale(e,t,r=1){return this.premultiply(Ce._t2d.makeScale(e,t,r))}makeScale(e,t,r=1){return this.set([e,0,0,0,t,0,0,0,1]),this}rotateX(e){return this.scaleY(this._rotateToScale(e))}rotateY(e){return this.scaleX(this._rotateToScale(e))}rotateZ(e){return this.rotate(e)}rotate(e){return this.premultiply(Ce._t2d.makeRotation(e))}rotate3d(e,t,r,i){const[n,o,a]=this._rotate3d(e,t,r,i);return n&&this.rotateX(n),o&&this.rotateY(o),a&&this.rotateZ(a),this}_rotateToScale(e){const t=e/Ne;return t<=.5?t*-4+1:(t-1)*4+1}_rotate3d(e,t,r,i){if(e===1&&t===0&&r===0)return[i,0,0];if(e===0&&t===1&&r===0)return[0,i,0];if(e===0&&t===0)return[0,0,i];{const n=Math.cos(i),o=Math.sin(i),a=n+e*e*(1-n),l=e*t*(1-n)-r*o,c=e*r*(1-n)+t*o,h=n+t*t*(1-n),f=t*r*(1-n)-e*o,d=n+r*r*(1-n),g=-Math.atan2(-f,h),p=-Math.atan2(c,Math.sqrt(f*f+d*d)),y=-Math.atan2(-l,a);return[g,p,y]}}makeRotation(e){const t=Math.cos(e),r=Math.sin(e);return this.set([t,-r,0,r,t,0,0,0,1]),this}decompose(e={x:0,y:0},t={position:{x:0,y:0},scale:{x:0,y:0},skew:{x:0,y:0},rotation:0}){const{a:r,b:i,c:n,d:o,tx:a,ty:l}=this.toObject(),c=-Math.atan2(-n,o),h=Math.atan2(i,r),f=Math.abs(c+h);return f<1e-5||Math.abs(Ne-f)<1e-5?(t.rotation=h,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=c,t.skew.y=h),t.scale.x=Math.sqrt(r*r+i*i),t.scale.y=Math.sqrt(n*n+o*o),t.position.x=a+(e.x*r+e.y*n),t.position.y=l+(e.x*i+e.y*o),t}apply(e,t){t=t||new de;const{a:r,c:i,tx:n,b:o,d:a,ty:l}=this.toObject(),c=e.x,h=e.y;return t.x=r*c+i*h+n,t.y=o*c+a*h+l,t}affineInverse(){return this.clone().affineInvert()}applyAffineInverse(e,t){t=t||new de;const{a:r,b:i,c:n,d:o,tx:a,ty:l}=this.toObject(),c=1/(r*o+n*-i),h=e.x,f=e.y;return t.x=o*c*h+-n*c*f+(l*n-a*o)*c,t.y=r*c*f+-i*c*h+(-l*r+a*i)*c,t}isIdentity(){const{a:e,b:t,c:r,d:i,tx:n,ty:o}=this.toObject();return e===1&&t===0&&r===0&&i===1&&n===0&&o===0}toObject(){const[e,t,r,i,n,o,,,a]=this._array;return{a:e,c:t,tx:r,b:i,d:n,ty:o,tz:a}}}class _h extends Qe{constructor(){super(3)}}var bh=Object.defineProperty,zo=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&bh(e,t,i),i};class Pi extends It{_starting=!1;_nextDeltaTime=0;get starting(){return this._starting}get spf(){return this.fps?Math.floor(1e3/this.fps):0}constructor(){super(),this._onNextTick=this._onNextTick.bind(this)}start(e){this._starting||(this._starting=!0,this.off("process"),this.on("process",e),Se.on(this._onNextTick,{sort:0}))}stop(){this._starting&&(this._starting=!1,Se.off(this._onNextTick,{sort:0}))}_onNextTick(){const e=Se.elapsed*this.speed;if((this._nextDeltaTime-=e)<=0){const r=(this._nextDeltaTime=this.spf)||e;this.emit("process",r)}}free(){super.free(),this.stop()}}zo([w({fallback:60})],Pi.prototype,"fps"),zo([w({fallback:1})],Pi.prototype,"speed");class Vo{view;pixelRatio=Ts;screen={x:0,y:0,width:0,height:0};related=new Ms;getRelated(e,t){let r=this.related.get(e);return r||(t?(this.related.set(e,r=t()),r):(console.warn("Failed to get related",e),null))}resize(e,t,r=!0){this.view&&(this.view.width=Math.floor(e*this.pixelRatio),this.view.height=Math.floor(t*this.pixelRatio)),this.screen.width=e,this.screen.height=t,r&&this.view&&(this.view.style.width=`${e}px`,this.view.style.height=`${t}px`)}}var lr=(s=>(s.NORMAL="normal",s.ADD="add",s.MULTIPLY="multiply",s.SCREEN="screen",s.NONE="none",s.NORMAL_NPM="normal_npm",s.ADD_NPM="add_npm",s.SCREEN_NPM="screen_npm",s.SRC_IN="src_in",s.SRC_OUT="src_out",s.SRC_ATOP="src_atop",s.DST_OVER="dst_over",s.DST_IN="dst_in",s.DST_OUT="dst_out",s.DST_ATOP="dst_atop",s.XOR="xor",s.SUBTRACT="subtract",s))(lr||{});function Go(s){return{normal:[s.ONE,s.ONE_MINUS_SRC_ALPHA],add:[s.ONE,s.ONE],multiply:[s.DST_COLOR,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA],screen:[s.ONE,s.ONE_MINUS_SRC_COLOR,s.ONE,s.ONE_MINUS_SRC_ALPHA],none:[0,0],normal_npm:[s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA],add_npm:[s.SRC_ALPHA,s.ONE,s.ONE,s.ONE],screen_npm:[s.SRC_ALPHA,s.ONE_MINUS_SRC_COLOR,s.ONE,s.ONE_MINUS_SRC_ALPHA],src_in:[s.DST_ALPHA,s.ZERO],src_out:[s.ONE_MINUS_DST_ALPHA,s.ZERO],src_atop:[s.DST_ALPHA,s.ONE_MINUS_SRC_ALPHA],dst_over:[s.ONE_MINUS_DST_ALPHA,s.ONE],dst_in:[s.ZERO,s.SRC_ALPHA],dst_out:[s.ZERO,s.ONE_MINUS_SRC_ALPHA],dst_atop:[s.ONE_MINUS_DST_ALPHA,s.SRC_ALPHA],xor:[s.ONE_MINUS_DST_ALPHA,s.ONE_MINUS_SRC_ALPHA],subtract:[s.ONE,s.ONE,s.ONE,s.ONE,s.FUNC_REVERSE_SUBTRACT,s.FUNC_ADD]}}class Ye{get gl(){return this._renderer.gl}install(e){this._renderer=e}onUpdateContext(){}flush(){}reset(){}free(){}}class qt{static _properties=["blend","offsets","culling","depthTest","clockwiseFrontFace","depthMask"];static _init(){this._properties.forEach((e,t)=>{Object.defineProperty(this.prototype,e,{get(){return!!(this.bitmap&1<<t)},set(r){!!(this.bitmap&1<<t)!==r&&(this.bitmap^=1<<t)},enumerable:!0,configurable:!0})})}static for2D(){const e=new qt;return e.depthTest=!1,e.blend=!0,e}_blendMode=lr.NORMAL;_polygonOffset=0;bitmap=0;get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!==lr.NONE,this._blendMode=e}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}constructor(e){if(e)for(const t in e)this[t]=e[t]}}qt._init();class jo extends Ye{install(e){super.install(e),e.state=this}_blendEq=!1;_setters=qt._properties.map(e=>this[`set${e.replace(/^\S/,t=>t.toUpperCase())}`]);boundStateBitmap=0;boundBlendMode;blendModes;defaultState=new qt({blend:!0});onUpdateContext(){super.onUpdateContext(),this.blendModes=Go(this._renderer.gl)}toggle(e,t){this._renderer.gl[t?"enable":"disable"](e)}setBlend(e){this.toggle(this._renderer.gl.BLEND,e)}setOffsets(e){this.toggle(this._renderer.gl.POLYGON_OFFSET_FILL,e)}setCulling(e){this.toggle(this._renderer.gl.CULL_FACE,e)}setDepthTest(e){this.toggle(this._renderer.gl.DEPTH_TEST,e)}setDepthMask(e){this._renderer.gl.depthMask(e)}setClockwiseFrontFace(e){const t=this._renderer.gl;t.frontFace(t[e?"CW":"CCW"])}setBlendMode(e){if(e===this.boundBlendMode)return;this.boundBlendMode=e;const t=this.blendModes[e],r=this._renderer.gl;t.length===2?r.blendFunc(t[0],t[1]):r.blendFuncSeparate(t[0],t[1],t[2],t[3]),t.length===6?(this._blendEq=!0,r.blendEquationSeparate(t[4],t[5])):this._blendEq&&(this._blendEq=!1,r.blendEquationSeparate(r.FUNC_ADD,r.FUNC_ADD))}setPolygonOffset(e,t){this._renderer.gl.polygonOffset(e,t)}bind(e){if(this.boundStateBitmap!==e.bitmap){let t=this.boundStateBitmap^e.bitmap,r=0;for(;t;)t&1&&this._setters[r]?.call(this,!!(e.bitmap&1<<r)),t=t>>1,r++;this.boundStateBitmap=e.bitmap}e.blend&&this.setBlendMode(e.blendMode),e.offsets&&this.setPolygonOffset(1,e.polygonOffset)}reset(){super.reset();const e=this._renderer.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),this.bind(this.defaultState),this._blendEq=!0,this.setBlendMode(lr.NORMAL)}}class Wo extends Ye{install(e){super.install(e),e.batch2D=this}_state=qt.for2D();_batchSize=4096*4;_drawCallUid=0;_defaultModulate=4294967295;_defaultBackgroundColor=0;_batchables=[];_vertexCount=0;_indexCount=0;_attributeBuffer=[];_indexBuffers=[];_shaders=new Map;_attributes={aTextureId:{size:1,normalized:!0,type:"float"},aPosition:{size:2,normalized:!1,type:"float"},aUv:{size:2,normalized:!1,type:"float"},aModulate:{size:4,normalized:!0,type:"unsigned_byte"},aBackgroundColor:{size:4,normalized:!0,type:"unsigned_byte"},aDisableWrapMode:{size:4,normalized:!0,type:"unsigned_byte"}};_vertexSize=8;_getShader(e){let t=this._shaders.get(e);return t||this._shaders.set(e,t=this._createShader(e)),t}_createShader(e){const t=this._renderer,r=t.program.create({vert:`precision highp float;
|
|
3
3
|
attribute float aTextureId;
|
|
4
4
|
attribute vec2 aPosition;
|
|
5
5
|
attribute vec2 aUv;
|
|
@@ -44,7 +44,7 @@ varying vec4 vModulate;
|
|
|
44
44
|
varying vec4 vBackgroundColor;
|
|
45
45
|
varying vec4 vDisableWrapMode;
|
|
46
46
|
|
|
47
|
-
uniform sampler2D samplers[${
|
|
47
|
+
uniform sampler2D samplers[${e}];
|
|
48
48
|
|
|
49
49
|
void main(void) {
|
|
50
50
|
vec4 color;
|
|
@@ -56,11 +56,11 @@ void main(void) {
|
|
|
56
56
|
if (vTextureId < 0.0)
|
|
57
57
|
{
|
|
58
58
|
color = vec4(0.0, 0.0, 0.0, 0.0);
|
|
59
|
-
}${Array.from({length:
|
|
60
|
-
else `),
|
|
61
|
-
if (vTextureId < ${
|
|
59
|
+
}${Array.from({length:e},(c,h)=>{let f=" ";return h>=0&&(f+=`
|
|
60
|
+
else `),h<e-1&&(f+=`
|
|
61
|
+
if (vTextureId < ${h}.5)`),`${f}
|
|
62
62
|
{
|
|
63
|
-
color = texture2D(samplers[${
|
|
63
|
+
color = texture2D(samplers[${h}], vUv);
|
|
64
64
|
}`}).join("")}
|
|
65
65
|
|
|
66
66
|
color += (1.0 - color.a) * vBackgroundColor;
|
|
@@ -68,40 +68,40 @@ void main(void) {
|
|
|
68
68
|
color *= vModulate;
|
|
69
69
|
}
|
|
70
70
|
gl_FragColor = color;
|
|
71
|
-
}`}),i=e.buffer.create({target:"array_buffer",data:new Float32Array(1),usage:"dynamic_draw"}),s=e.buffer.create({target:"element_array_buffer",data:new Uint16Array(1),usage:"dynamic_draw"}),n={attributes:Object.fromEntries(Object.entries(this._attributes).map(([l,c])=>[l,{...c,buffer:i}])),elementArrayBuffer:s},o=e.vertexArray.create(A,n),a=new Int32Array(Array.from({length:t},(l,c)=>c));return{update:(l,c)=>{e.vertexArray.bind(o??n),e.buffer.update(i,{target:"array_buffer",data:l}),e.buffer.update(s,{target:"element_array_buffer",data:c})},draw:l=>{const c=this._renderer;c.program.bind(A),c.program.updateUniforms(A,{samplers:a,modulate:[1,1,1,1],canvasWidth:c.gl.drawingBufferWidth,canvasHeight:c.gl.drawingBufferHeight,...c.program.uniforms}),c.vertexArray.bind(o??n),c.draw(l)}}}render(t){const{vertices:e,indices:A}=t,i=e.length/2;this._vertexCount+i>this._batchSize&&this.flush(),this._vertexCount+=i,this._indexCount+=A.length,this._batchables.push(t)}flush(){if(super.flush(),this._vertexCount===0)return;const t=this._vertexCount,e=this._indexCount,A=this._batchables;this._batchables=[],this._vertexCount=0,this._indexCount=0;const i=this._renderer.texture.maxUnits,s=this._getAttributeBuffer(t),n=new Float32Array(s),o=new Uint32Array(s),a=this._getIndexBuffer(e);let l=0,c=0;const h=[];for(let d=A.length,f={id:++this._drawCallUid},B=[],p=new Map,D=0,R=0,w=0;w<d;w++){const S=A[w].texture,Q=w===d-1;if(!S||p.has(S)){if(!Q)continue}else B.push(S),p.set(S,D++);if(Q||D>=i){f.textures=B,f.textureLocationMap=p,D=0,f.first=c;for(let m=R;m<=w;m++){const{indices:x,vertices:M,uvs:V=[],texture:et,modulate:W=this._defaultModulate,backgroundColor:H=this._defaultBackgroundColor,blendMode:Z=GA.NORMAL,disableWrapMode:J=!1}=A[m];R<m&&f.blendMode!==Z&&(f.count=c-f.first,h.push(f),R=m,f={id:++this._drawCallUid},f.textures=B,f.first=c);const T=l/this._vertexSize,it=(et?p.get(et):255)??255,L=J?1:0;for(let z=M.length,tt=0;tt<z;tt+=2)n[l++]=it,n[l++]=M[tt],n[l++]=M[tt+1],n[l++]=V[tt],n[l++]=V[tt+1],o[l++]=W,o[l++]=H,o[l++]=L;for(let z=x.length,tt=0;tt<z;tt++)a[c++]=T+x[tt];f.blendMode=Z}R=w+1,f.count=c-f.first,h.push(f),f={id:++this._drawCallUid},B=[],p=new Map}}const u=this._getShader(i);u.update(s,a);for(let d=h.length,f=0;f<d;f++){const B=h[f],{first:p=0,textures:D,textureLocationMap:R}=B;for(let w=D.length,S=0;S<w;S++){const Q=D[S],m=R.get(Q);m!==void 0&&this._renderer.texture.bind({target:"texture_2d",location:m,value:Q})}this._state.blendMode=B.blendMode,this._renderer.state.bind(this._state),u.draw({mode:"triangles",count:B.count,first:p,bytesPerElement:2})}}_getAttributeBuffer(t){const e=Ms(Math.ceil(t/8)),A=Rs(e),i=e*8;this._attributeBuffer.length<=A&&(this._indexBuffers.length=A+1);let s=this._attributeBuffer[i];return s||(this._attributeBuffer[i]=s=new ArrayBuffer(i*this._vertexSize*4)),s}_getIndexBuffer(t){const e=Ms(Math.ceil(t/12)),A=Rs(e),i=e*12;this._indexBuffers.length<=A&&(this._indexBuffers.length=A+1);let s=this._indexBuffers[A];return s||(this._indexBuffers[A]=s=new Uint16Array(i)),s}}function Ms(r){return r+=r===0?1:0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function Rs(r){let t=(r>65535?1:0)<<4;r>>>=t;let e=(r>255?1:0)<<3;return r>>>=e,t|=e,e=(r>15?1:0)<<2,r>>>=e,t|=e,e=(r>3?1:0)<<1,r>>>=e,t|=e,t|r>>1}class na extends Ie{install(t){super.install(t),t.buffer=this}boundArrayBuffer=null;boundTarget="array_buffer";create(t){const e=this.gl.createBuffer();if(!e)throw new Error("failed to create");return t&&(this.bind({target:t.target,value:e}),this.update(t)),e}getMeta(t){return this._renderer.getRelated(t,()=>({id:Mo(t),length:0,byteLength:0,bytesPerElement:0}))}update(...t){if(t.length>1){this.bind({target:t[1].target,value:t[0]}),this.update(t[1]);return}const e=t[0],A=(e.target??this.boundTarget)==="array_buffer"?this.boundArrayBuffer:this._renderer.vertexArray.boundVertexArray.elementArrayBuffer;if(!A)return;const i=this.getMeta(A);Object.assign(i,{target:e.target,usage:e.usage});const s=i.target??this.boundTarget,n=i.usage??"static_draw",o=e.data,a=this.gl;let l;Array.isArray(o)?s==="array_buffer"?l=new Float32Array(o):l=new Uint32Array(o):l=o;const c=this._renderer.getBindPoint(s);l&&l.byteLength<=i.byteLength?a.bufferSubData(c,0,l):(a.bufferData(c,l,this._renderer.getBindPoint(n)),i.length=l?.length??0,i.byteLength=l?.byteLength??0,i.bytesPerElement=i.length?i.byteLength/i.length:0)}bind(t){let{target:e,value:A}=t;if(A){const s=this.getMeta(A);e??=s.target??this.boundTarget,s.target=e}else e??=this.boundTarget;const i=this._renderer.getBindPoint(e);this._renderer.gl.bindBuffer(i,A),e==="array_buffer"?this.boundArrayBuffer=A:this._renderer.vertexArray.boundVertexArray.elementArrayBuffer=A,this.boundTarget=e}unbind(t){return this.bind({target:t,value:null})}reset(){super.reset(),this.boundArrayBuffer=null,this.boundTarget="array_buffer"}}class oa extends Ie{install(t){super.install(t),t.framebuffer=this}boundFramebuffer=null;_msaaSamples=[];_hasMRT=!0;_writeDepthTexture=!0;onUpdateContext(){if(this._hasMRT=!0,this._writeDepthTexture=!0,this._renderer.version===1){const t=this._renderer.gl,e=this._renderer.extensions.drawBuffers,A=this._renderer.extensions.depthTexture;e?t.drawBuffers=i=>e.drawBuffersWEBGL(i):(this._hasMRT=!1,t.drawBuffers=()=>{}),A||(this._writeDepthTexture=!1)}else{const t=this._renderer.gl;this._msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)}}create(t){const e=this._renderer.gl.createFramebuffer();if(!e)throw new Error("Unable to create framebuffer");return t&&(this.bind(e),this.update(t)),e}getMeta(t){return this._renderer.getRelated(t,()=>({width:0,height:0,mipLevel:0,stencil:!1,depth:!1,depthTexture:null,colorTextures:[],multisample:0}))}update(...t){if(t.length>1)return this.bind(t[0]),this.update(t[1]);const e=this.boundFramebuffer;if(!e)return;const A=t[0],i=this.getMeta(e);Object.assign(i,{...A});const s=this._renderer.gl;let n=i.colorTextures.length;"drawBuffers"in s||(n=Math.min(n,1));for(let o=0;o<n;o++){const a=i.colorTextures[o];this._renderer.texture.bind({location:0,target:"texture_2d",value:a,forceUpdateLocation:!0}),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+o,s.TEXTURE_2D,a,i.mipLevel),this._renderer.texture.unbind(a)}if(n>1&&s.drawBuffers(i.colorTextures.map((o,a)=>s.COLOR_ATTACHMENT0+a)),i.depthTexture&&(this._renderer.version>1||this._renderer.extensions.depthTexture)&&(this._renderer.texture.bind({location:0,target:"texture_2d",value:i.depthTexture,forceUpdateLocation:!0}),s.framebufferTexture2D(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.TEXTURE_2D,i.depthTexture,i.mipLevel),this._renderer.texture.unbind(i.depthTexture)),(i.stencilBuffer||i.stencil||i.depth)&&!(i.depthTexture&&this._writeDepthTexture)){i.stencilBuffer??=s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,i.stencilBuffer);const{attachment:o,format:a}=this._getAttachmentAndFormat(i);i.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,i.multisample,a,i.width,i.height):s.renderbufferStorage(s.RENDERBUFFER,a,i.width*this._renderer.pixelRatio,i.height*this._renderer.pixelRatio),s.framebufferRenderbuffer(s.FRAMEBUFFER,o,s.RENDERBUFFER,i.stencilBuffer)}else i.stencilBuffer&&(s.deleteRenderbuffer(i.stencilBuffer),i.stencilBuffer=null)}_getAttachmentAndFormat(t){const e=this.gl;let A,i;return this._renderer.version===1?(A=e.DEPTH_STENCIL_ATTACHMENT,i=e.DEPTH_STENCIL):t.depth&&t.stencil?(A=e.DEPTH_STENCIL_ATTACHMENT,i=e.DEPTH24_STENCIL8):t.depth?(A=e.DEPTH_ATTACHMENT,i=e.DEPTH_COMPONENT24):(A=e.STENCIL_ATTACHMENT,i=e.STENCIL_INDEX8),{attachment:A,format:i}}resize(t,e,A){const i=this.gl,s=this.getMeta(t);if(Object.assign(s,{width:e,height:A}),s.stencil){const{format:o}=this._getAttachmentAndFormat(s);i.bindRenderbuffer(i.RENDERBUFFER,s.stencil),s.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,s.multisample,o,s.width,s.height):i.renderbufferStorage(i.RENDERBUFFER,o,s.width,s.height)}let n=s.colorTextures.length;i.drawBuffers||(n=Math.min(n,1));for(let o=0;o<n;o++){const a=s.colorTextures[o];this._renderer.texture.update(a,{value:{pixels:null,width:s.width,height:s.height}}),o===0&&s.msaaBuffer&&(i.bindRenderbuffer(i.RENDERBUFFER,s.msaaBuffer),i.renderbufferStorageMultisample(i.RENDERBUFFER,s.multisample,i.RGBA,s.width,s.height))}s.depthTexture&&this._renderer.texture.update(s.depthTexture,{value:{pixels:null,width:s.width,height:s.height}})}bind(t){const e=this._renderer.gl,A=t;if({value:this.boundFramebuffer!==A}.value&&(e.bindFramebuffer(e.FRAMEBUFFER,A),this.boundFramebuffer=A),A){const n=this.getMeta(A);for(let l=0;l<n.colorTextures.length;l++)this._renderer.texture.unbind(n.colorTextures[l]);n.depthTexture&&this._renderer.texture.unbind(n.depthTexture);const o=n.width>>n.mipLevel,a=n.height>>n.mipLevel;this._renderer.viewport.bind({x:0,y:0,width:o*this._renderer.pixelRatio,height:a*this._renderer.pixelRatio})}else this._renderer.viewport.bind({x:0,y:0,width:this._renderer.screen.width*this._renderer.pixelRatio,height:this._renderer.screen.height*this._renderer.pixelRatio})}forceStencil(){const t=this.boundFramebuffer;if(!t)return;const e=this.getMeta(t);if(!e||e.stencilBuffer)return;const A=this._renderer.gl;e.stencilBuffer=A.createRenderbuffer(),A.bindRenderbuffer(A.RENDERBUFFER,e.stencilBuffer);let i,s;this._renderer.version===1?(i=A.DEPTH_STENCIL_ATTACHMENT,s=A.DEPTH_STENCIL):e.depth?(i=A.DEPTH_STENCIL_ATTACHMENT,s=A.DEPTH24_STENCIL8):(i=A.STENCIL_ATTACHMENT,s=A.STENCIL_INDEX8),e.msaaBuffer?A.renderbufferStorageMultisample(A.RENDERBUFFER,e.multisample,s,e.width*this._renderer.pixelRatio,e.height*this._renderer.pixelRatio):A.renderbufferStorage(A.RENDERBUFFER,s,e.width*this._renderer.pixelRatio,e.height*this._renderer.pixelRatio),A.framebufferRenderbuffer(A.FRAMEBUFFER,i,A.RENDERBUFFER,e.stencilBuffer)}reset(){super.reset(),this.boundFramebuffer=null}}class aa extends Ie{install(t){super.install(t),t.mask=this}stack=[];get length(){return this.stack.length}get last(){return this.stack[this.length-1]}push(t,e){const A={source:t,mask:e};this.stack.push(A),typeof A.mask=="number"?this.pushColorMask(A):"render"in A.mask?this._renderer.stencil.push(A):this._renderer.scissor.push(A)}pop(t){const e=this.stack.pop();!e||e.source!==t||(typeof e.mask=="number"?this.popColorMask(e):"render"in e.mask?this._renderer.stencil.pop(e):this._renderer.scissor.pop(e))}pushColorMask(t){const e=t.preComputedColor??15,A=t.preComputedColor=e&t.mask;A!==e&&this.useColorMask(A)}popColorMask(t){const e=t.preComputedColor??15,A=this.length>0?this.last.preComputedColor??15:15;A!==e&&this.useColorMask(A)}useColorMask(t){this._renderer.gl.colorMask((t&1)!==0,(t&2)!==0,(t&4)!==0,(t&8)!==0)}}class la extends Ie{install(t){super.install(t),t.program=this}boundProgram=null;uniforms={projectionMatrix:[1,0,0,0,1,0,0,0,1],viewMatrix:[1,0,0,0,1,0,0,0,1]};create(t){const e=this.gl.createProgram();if(!e)throw new Error("Unable to create program");return t&&this.update(e,t),e}getMeta(t){return this._renderer.getRelated(t,()=>({attributes:new Map,uniforms:new Map,boundUniforms:new Qo}))}update(...t){if(t.length>1){const a=this.boundProgram;this.boundProgram=t[0],this.update(t[1]),this.boundProgram=a;return}const e=t[0],A=this.boundProgram;if(!A)return;const i=this.gl,s=this.getMeta(A),n=this.createShader(e.vert,"vertex_shader"),o=this.createShader(e.frag,"fragment_shader");if(i.attachShader(A,n),i.attachShader(A,o),i.linkProgram(A),i.deleteShader(n),i.deleteShader(o),!i.getProgramParameter(A,i.LINK_STATUS))throw new Error(`Unable to link program: ${i.getProgramInfoLog(A)}`);s.attributes.clear(),s.uniforms.clear();for(let a=i.getProgramParameter(A,i.ACTIVE_ATTRIBUTES),l=0;l<a;l++){const c=i.getActiveAttrib(A,l);if(!c||c.name.startsWith("gl_"))continue;const h=this._renderer.bindPoints.get(c.type)??String(c.type);s.attributes.set(c.name,{type:h,name:c.name,size:zh(h),location:i.getAttribLocation(A,c.name)})}for(let a=i.getProgramParameter(A,i.ACTIVE_UNIFORMS),l=0;l<a;l++){const c=i.getActiveUniform(A,l);if(!c)continue;const h=c.name.replace(/\[.*?\]$/,"");let u=i.getUniformLocation(A,h);u||(u=i.getUniformLocation(A,c.name)),s.uniforms.set(h,{name:h,index:l,type:this._renderer.bindPoints.get(c.type)??String(c.type),size:c.size,isArray:h!==c.name,location:u})}}bind(t){const e=this.gl;({value:this.boundProgram!==t}).value&&(e.useProgram(t),this.boundProgram=t)}createShader(t,e){const A=this.gl,i=A.createShader(this._renderer.getBindPoint(e));if(!i)throw new Error("Unable to create shader");if(A.shaderSource(i,t),A.compileShader(i),!A.getShaderParameter(i,A.COMPILE_STATUS))throw new Error(`Unable to compiling shader :
|
|
72
|
-
${
|
|
73
|
-
${A.getShaderInfoLog(i)}`);return i}updateUniforms(...t){if(t.length>1){this.bind(t[0]),this.updateUniforms(t[1]);return}const e=this.boundProgram;if(!e)return;const A=this.gl,i=t[0],{uniforms:s,boundUniforms:n}=this.getMeta(e);for(const o in i){const a=i[o],l=s.get(o);if(!l)continue;const{type:c,isArray:h,location:u}=l;if(!(!u||n.get(u)===a))switch(n.set(u,a),c){case"float":h?A.uniform1fv(u,a):A.uniform1f(u,a);break;case"unsigned_int":h?A.uniform1uiv(u,a):A.uniform1ui(u,a);break;case"bool":case"int":case"sampler_2d":case"sampler_cube":case"sampler_2d_array":h?A.uniform1iv(u,a):A.uniform1i(u,a);break;case"bool_vec2":case"int_vec2":A.uniform2iv(u,a);break;case"unsigned_int_vec2":A.uniform2uiv(u,a);break;case"float_vec2":A.uniform2fv(u,a);break;case"bool_vec3":case"int_vec3":A.uniform3iv(u,a);break;case"unsigned_int_vec3":A.uniform3uiv(u,a);break;case"float_vec3":A.uniform3fv(u,a);break;case"bool_vec4":case"int_vec4":A.uniform4iv(u,a);break;case"unsigned_int_vec4":A.uniform4uiv(u,a);break;case"float_vec4":A.uniform4fv(u,a);break;case"float_mat2":A.uniformMatrix2fv(u,!1,a);break;case"float_mat3":A.uniformMatrix3fv(u,!1,a);break;case"float_mat4":A.uniformMatrix4fv(u,!1,a);break}}}reset(){super.reset(),this.boundProgram=null,this.uniforms={projectionMatrix:[1,0,0,0,1,0,0,0,1],viewMatrix:[1,0,0,0,1,0,0,0,1]}}free(){super.free(),this.bind(null)}}function zh(r){switch(r){case"float":case"int":case"unsigned_int":case"bool":case"sampler_2d":return 1;case"float_vec2":case"int_vec2":case"unsigned_int_vec2":case"bool_vec2":return 2;case"float_vec3":case"int_vec3":case"unsigned_int_vec3":case"bool_vec3":return 3;case"float_vec4":case"int_vec4":case"unsigned_int_vec4":case"bool_vec4":case"float_mat2":return 4;case"float_mat3":return 9;case"float_mat4":return 16;default:return 1}}function or(r,t,e){const[A,i,s,n,o,a,l,c,h]=r,u=A*t+n*e+l,d=i*t+o*e+c,f=s*t+a*e+h;return{x:u/f,y:d/f}}function qh(r,t){const{x:e,y:A,width:i,height:s}=t,n=or(r,e,A),o=or(r,e+i,A),a=or(r,e+i,A+s),l=or(r,e,A+s),c=[n,o,a,l],h=c.map(D=>D.x),u=c.map(D=>D.y),d=Math.min(...h),f=Math.max(...h),B=Math.min(...u),p=Math.max(...u);return{x:d,y:B,width:f-d,height:p-B}}class ca extends Ie{install(t){super.install(t),t.scissor=this}get length(){return this._renderer.mask.last?.scissorCounter??0}push(t){const e=this._renderer.gl;e.enable(e.SCISSOR_TEST),t.scissorCounter??=0,t.scissorCounter++,this.use()}pop(t){if(this.length>0)this.use();else{const e=this._renderer.gl;e.disable(e.SCISSOR_TEST)}}use(){const t=this._renderer,{pixelRatio:e,mask:A,viewport:i,screen:s,gl:n,program:o}=t,{viewMatrix:a}=o.uniforms,l=qh(a,A.last.mask),{x:c,y:h,width:u,height:d}=l;let f;i.boundViewport?f=i.boundViewport.height-(d+h)*e:f=(s.height-(d+h))*e,n.scissor(c*e,f,u*e,d*e)}}class ha extends Ie{install(t){super.install(t),t.stencil=this}get length(){return this._renderer.mask.last?.stencilCounter??0}push(t){const e=this._renderer.gl,A=t.mask,i=t.stencilCounter??=0;t.stencilCounter===0&&(this._renderer.framebuffer.forceStencil(),e.clearStencil(0),e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST)),t.stencilCounter++;const s=t.color;s&&(t.color=0,e.colorMask(!1,!1,!1,!1)),e.stencilFunc(e.EQUAL,i,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.INCR),A.render(this._renderer),this._renderer.flush(),s&&(t.color=s,e.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this.use()}pop(t){const e=this._renderer.gl,A=t.mask;if(!this.length)e.disable(e.STENCIL_TEST);else{const i=this._renderer.mask.last,s=i?.color??15;s!==0&&(i.color=0,e.colorMask(!1,!1,!1,!1)),e.stencilOp(e.KEEP,e.KEEP,e.DECR),A.render(this._renderer),this._renderer.flush(),s!==0&&(i.color=s,e.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this.use()}}use(){const t=this._renderer.gl;t.stencilFunc(t.EQUAL,this.length,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)}}function Xh(r,t){const e=new Set([...Object.keys(r),...Object.keys(t)]),A={};return e.forEach(i=>{A[i]=r[i]!==t[i]}),A}class ga extends Ie{install(t){super.install(t),t.texture=this}maxUnits=0;boundLocation=0;boundTarget="texture_2d";boundTextures=[];emptyTextures={texture_2d:null,texture_cube_map:null};onUpdateContext(){super.onUpdateContext();const t=this.gl;this.maxUnits=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);for(let i=0;i<this.maxUnits;i++)this.boundTextures[i]={texture_2d:null,texture_cube_map:null};const e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(4));const A=t.createTexture();t.bindTexture(t.TEXTURE_CUBE_MAP,A);for(let i=0;i<6;i++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null);t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.LINEAR),this.emptyTextures={texture_2d:e,texture_cube_map:A};for(let i=this.boundTextures.length,s=0;s<i;s++)this.unbind(s)}create(t){const e=this.gl.createTexture();if(!e)throw new Error("Unable to create texture");return t&&(this.bind({location:t.location,target:t.target,value:e,forceUpdateLocation:!0}),this.update({filterMode:"linear",wrapMode:"repeat",...t})),e}getMeta(t){return this._renderer.getRelated(t,()=>({}))}update(...t){if(t.length>1){this.bind({location:t[1].location,target:t[1].target,value:t[0],forceUpdateLocation:!0}),this.update(t[1]);return}const e=t[0],{value:A,...i}=e,s=this.boundTextures[this.boundLocation][e.target??this.boundTarget];if(!s)return;const n=this.gl,o=this.getMeta(s),a=Xh(o,i);Object.assign(o,i);const l=this._renderer.getBindPoint(o.target??this.boundTarget);if(A!==void 0&&(A===null?n.texImage2D(l,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,null):"pixels"in A?n.texImage2D(l,0,n.RGBA,A.width,A.height,0,n.RGBA,n.UNSIGNED_BYTE,A.pixels):n.texImage2D(l,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,A)),a.wrapMode&&o.wrapMode){const h=this._renderer.getBindPoint(o.wrapMode);n.texParameteri(l,n.TEXTURE_WRAP_S,h),n.texParameteri(l,n.TEXTURE_WRAP_T,h)}const c=o.filterMode;if(a.filterMode&&c){const h=this._renderer.getBindPoint(c.split("_")[0]);c.includes("_")?n.texParameteri(l,n.TEXTURE_MIN_FILTER,this._renderer.getBindPoint(c)):n.texParameteri(l,n.TEXTURE_MIN_FILTER,h),n.texParameteri(l,n.TEXTURE_MAG_FILTER,h)}if(o.anisoLevel&&c==="linear"&&this._renderer.extensions.anisotropicFiltering&&a.anisoLevel){const{MAX_TEXTURE_MAX_ANISOTROPY_EXT:h,TEXTURE_MAX_ANISOTROPY_EXT:u}=this._renderer.extensions.anisotropicFiltering;n.texParameterf(l,u,Math.min(o.anisoLevel,n.getParameter(h)))}}bind(t){const e=this.gl;let A,i,s,n;if(t&&"value"in t?{target:i,value:A,location:s,forceUpdateLocation:n}=t:A=t,A){const d=this.getMeta(A);d.target=i??=d.target??"texture_2d",d.location=s??=d.location??0}else i??="texture_2d",s??=0;let o=this.boundTextures[s];o||(this.boundTextures[s]=o={texture_2d:null,texture_cube_map:null});const a=o[i]??null,l=this.boundLocation,c=A!==a,h={location:s!==l&&(c||n),texture:c},u=this._renderer.getBindPoint(i);h.location&&(e.activeTexture(e.TEXTURE0+s),this.boundLocation=s),h.texture&&(e.bindTexture(u,A??this.emptyTextures[i]),o[i]=A),this.boundTarget=i}unbind(t,e="texture_2d"){const A=this._renderer.gl;if(typeof t=="number")this.bind({value:null,target:e,location:t});else{const i=this.getMeta(t),{target:s=this.boundTarget}=i,n=this._renderer.getBindPoint(s);for(let o=0;o<this.boundTextures.length;o++)this.boundTextures[o][s]===t&&(this.boundLocation!==o&&(A.activeTexture(A.TEXTURE0+o),this.boundLocation=o),A.bindTexture(n,this.emptyTextures[s]),this.boundTextures[o][s]=null)}}reset(){super.reset(),this.boundLocation=0,this.boundTarget="texture_2d",this.boundTextures=[],this.maxUnits=0}}class ua extends Ie{install(t){super.install(t),t.vertexArray=this}boundVertexArrayNull={attributes:{},elementArrayBuffer:null};boundVertexArrayObject=null;boundVertexArray=this.boundVertexArrayNull;enableVertexAttrib(t,e,A,i=1){const{buffer:s,size:n=0,type:o="float",normalized:a=!1,stride:l=0,offset:c=0,divisor:h}=A,u=this._renderer.gl;this._renderer.buffer.bind({target:"array_buffer",value:s});for(let d=0;d<i;d++)u.enableVertexAttribArray(e+d),u.vertexAttribPointer(e+d,n,this._renderer.getBindPoint(o),a,l,c+(l-c)/i*d);h&&("vertexAttribDivisor"in u?u.vertexAttribDivisor(e,h):console.warn("Failed to active vertex array object, GPU Instancing is not supported on this device")),this.boundVertexArray.attributes[t]={enable:!0,...A}}create(...t){const e=this._renderer.gl;if(!("createVertexArray"in e))return null;const A=e.createVertexArray();if(!A)throw new Error("Unable to create vertex array");return t.length===2?this.update(t[0],A,t[1]):t.length===1&&this.update(A,t[0]),A}getVertexArrayMeta(t){return this._renderer.getRelated(t,()=>({attributes:{},elementArrayBuffer:null}))}update(...t){if(t.length>2){this._renderer.program.bind(t[0]),this.update(t[1],t[2]);return}else if(t.length===2)if(t[0]){const s=t[0],n=t[1],o=this.getVertexArrayMeta(s);this.bind(s),this.update(n),o.attributes=this.boundVertexArray.attributes,o.elementArrayBuffer=this.boundVertexArray.elementArrayBuffer,this.unbind(),this._renderer.buffer.unbind("array_buffer");return}else return this.update(t[1]);const e=this._renderer.program.boundProgram;if(!e)return;const A=t[0];if(A.attributes){const s=this._renderer.program.getMeta(e),n={},o={};for(const l in A.attributes){const c=A.attributes[l],h=s.attributes.get(l);let u;"buffer"in c?u={...c}:u={buffer:c},u.size=u.size||h?.size||0;const d=this._renderer.buffer.getMeta(u.buffer),f=Number(h?.type.match(/mat(\d)/)?.[1]??1);let B;switch(u.type){case"unsigned_byte":B=u.size;break;case"unsigned_short":B=u.size*2;break;case"float":default:B=u.size*4;break}B*=f,n[d.id]??=0,n[d.id]+=B,o[l]={attrib:u,meta:d,info:h,byteLength:B,dimension:f}}const a={};for(const l in o){const{attrib:c,meta:h,info:u,byteLength:d,dimension:f}=o[l];u?.location!==void 0&&(a[h.id]??=0,c.offset??=a[h.id],c.stride??=n[h.id]===d?0:n[h.id],this.enableVertexAttrib(l,u.location,c,f),a[h.id]+=d)}}const i=A.elementArrayBuffer??null;this._renderer.buffer.bind({target:"element_array_buffer",value:i}),this.boundVertexArray.elementArrayBuffer=i}bind(t){const e=this._renderer.gl;if(t&&"attributes"in t)this.update(t);else if("bindVertexArray"in e){const A=this.boundVertexArrayObject;({value:t!==A}).value&&(e.bindVertexArray(t),this.boundVertexArrayObject=t,t?this.boundVertexArray={...this.getVertexArrayMeta(t)}:this.boundVertexArray=this.boundVertexArrayNull)}}unbind(){return this.bind(null)}reset(){super.reset(),this.boundVertexArrayNull={attributes:{},elementArrayBuffer:null},this.boundVertexArray=this.boundVertexArrayNull,this.boundVertexArrayObject=null}}class fa extends Ie{install(t){super.install(t),t.viewport=this}boundViewport={x:0,y:0,width:0,height:0};bind(t){const e=this.boundViewport,A=Math.floor(t.x),i=Math.floor(t.y),s=Math.floor(t.width),n=Math.floor(t.height);e.x===A&&e.y===i&&e.width===s&&e.height===n||(this._renderer.gl.viewport(A,i,s,n),e.x=A,e.y=i,e.width=s,e.height=n)}reset(){super.reset(),this.boundViewport={x:0,y:0,width:0,height:0}}}class da extends Aa{_modules=[new ga,new na,new oa,new la,new ua,new fa,new ra,new aa,new ca,new ha,new sa];bindPoints=new Map;constructor(t=Jo(),e){if(super(),!t)throw new Error("Failed to createHTMLCanvas");Oo(t)?this._setupContext(t,e):(this.gl=t,this.version=Ho(this.gl)?2:1),this._setupBindPoints()._setupExtensions()._setupPolyfill(),this.gl.pixelStorei(this.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),this._modules.forEach(A=>A.install(this)),this._modules.forEach(A=>A.onUpdateContext())}_setupContext(t,e){this.view=t;let A=t.getContext("webgl2",e)||t.getContext("experimental-webgl2",e),i=2;if(A||(A=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),i=1),!A)throw new Error("Unable to getContext");return this.gl=A,this.version=i,this._onContextLost=this._onContextLost.bind(this),this._onContextRestored=this._onContextRestored.bind(this),t.addEventListener("webglcontextlost",this._onContextLost,!1),t.addEventListener("webglcontextrestored",this._onContextRestored,!1),this}_setupExtensions(){const t=this.gl,e={loseContext:t.getExtension("WEBGL_lose_context"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tcSRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};return this.version===1?(e.instancedArrays=t.getExtension("ANGLE_instanced_arrays"),e.drawBuffers=t.getExtension("WEBGL_draw_buffers"),e.depthTexture=t.getExtension("WEBGL_depth_texture"),e.vertexArrayObject=t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),e.uint32ElementIndex=t.getExtension("OES_element_index_uint"),e.floatTexture=t.getExtension("OES_texture_float"),e.textureHalfFloat=t.getExtension("OES_texture_half_float"),e.textureHalfFloatLinear=t.getExtension("OES_texture_half_float_linear")):this.version===2&&(e.colorBufferFloat=t.getExtension("EXT_color_buffer_float")),this.extensions=e,this}_setupBindPoints(){for(const t in this.gl)if(t===t.toUpperCase()){const e=this.gl[t];typeof e=="number"&&this.bindPoints.set(e,t.toLowerCase())}return this}_setupPolyfill(){if(this.version===1){const{instancedArrays:t,vertexArrayObject:e,drawBuffers:A}=this.extensions,i=this.gl;e&&(i.createVertexArray=()=>e.createVertexArrayOES(),i.bindVertexArray=s=>e.bindVertexArrayOES(s),i.deleteVertexArray=s=>e.deleteVertexArrayOES(s)),t&&(i.vertexAttribDivisor=(s,n)=>t.vertexAttribDivisorANGLE(s,n),i.drawElementsInstanced=(s,n,o,a,l)=>t.drawElementsInstancedANGLE(s,n,o,a,l),i.drawArraysInstanced=(s,n,o,a)=>t.drawArraysInstancedANGLE(s,n,o,a)),A&&(i.drawBuffers=s=>A.drawBuffersWEBGL(s))}return this}_onContextLost(t){t.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext()},0)}_onContextRestored(){}getBindPoint(t){return this.gl[t.toUpperCase()]}clear(t=this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT){this.gl.clear(t)}draw(t={}){const{mode:e="triangles",first:A=0,instanceCount:i}=t;let{count:s=0,bytesPerElement:n=0}=t;if(!s||!n){const a=this.vertexArray.boundVertexArray.elementArrayBuffer??Object.values(this.vertexArray.boundVertexArray.attributes)[0];if(a){const l=this.buffer.getMeta(a);s||(s=l.length),n||(n=l.bytesPerElement)}}const o=this.getBindPoint(e);if(n)if(n===2||n===4&&this.extensions.uint32ElementIndex){const a=n===2?this.gl.UNSIGNED_SHORT:this.gl.UNSIGNED_INT;i&&"drawElementsInstanced"in this.gl?this.gl.drawElementsInstanced(o,s,a,A*n,i):this.gl.drawElements(o,s,a,A*n)}else console.warn("Unsupported index buffer type: uint32");else i&&"drawArraysInstanced"in this.gl?this.gl.drawArraysInstanced(o,A,s,i):this.gl.drawArrays(o,A,s)}reset(){this._modules.forEach(t=>t.reset())}flush(){this._modules.forEach(t=>t.flush())}free(){this._modules.forEach(t=>t.free()),this.view?.removeEventListener("webglcontextlost",this._onContextLost,!1),this.view?.removeEventListener("webglcontextrestored",this._onContextRestored,!1),this.extensions.loseContext?.loseContext()}toPixels(t=0,e=0,A=this.gl.drawingBufferWidth,i=this.gl.drawingBufferHeight){const s=A*i*4,n=A*4,o=(i-1)*n,a=new Uint8Array(s),l=new Uint8ClampedArray(s);this.gl.readPixels(t,e,A,i,this.gl.RGBA,this.gl.UNSIGNED_BYTE,a);for(let c=0;c<s;c+=n)l.set(a.subarray(c,c+n),o-c);return l}}class oA{}class Ia extends oA{install(t){const e=async A=>{const{parseFont:i}=await Promise.resolve().then(()=>QI);return await t.fetch(A).then(s=>s.arrayBuffer()).then(s=>i(s))};return this.load=A=>t.loadBy(A,()=>e(A)),["woff","ttf","otf"].forEach(A=>{t.register(A,e)}),t.font=this,this}}function jh(r,t,e=2){const A=t&&t.length,i=A?t[0]*e:r.length;let s=pa(r,0,i,e,!0);const n=[];if(!s||s.next===s.prev)return n;let o,a,l;if(A&&(s=Ag(r,t,s,e)),r.length>80*e){o=r[0],a=r[1];let c=o,h=a;for(let u=e;u<i;u+=e){const d=r[u],f=r[u+1];d<o&&(o=d),f<a&&(a=f),d>c&&(c=d),f>h&&(h=f)}l=Math.max(c-o,h-a),l=l!==0?32767/l:0}return hi(s,n,e,o,a,l,0),n}function pa(r,t,e,A,i){let s;if(i===ug(r,t,e,A)>0)for(let n=t;n<e;n+=A)s=Qa(n/A|0,r[n],r[n+1],s);else for(let n=e-A;n>=t;n-=A)s=Qa(n/A|0,r[n],r[n+1],s);return s&&OA(s,s.next)&&(fi(s),s=s.next),s}function yA(r,t){if(!r)return r;t||(t=r);let e=r,A;do if(A=!1,!e.steiner&&(OA(e,e.next)||Bt(e.prev,e,e.next)===0)){if(fi(e),e=t=e.prev,e===e.next)break;A=!0}else e=e.next;while(A||e!==t);return t}function hi(r,t,e,A,i,s,n){if(!r)return;!n&&s&&og(r,A,i,s);let o=r;for(;r.prev!==r.next;){const a=r.prev,l=r.next;if(s?$h(r,A,i,s):Zh(r)){t.push(a.i,r.i,l.i),fi(r),r=l.next,o=l.next;continue}if(r=l,r===o){n?n===1?(r=tg(yA(r),t),hi(r,t,e,A,i,s,2)):n===2&&eg(r,t,e,A,i,s):hi(yA(r),t,e,A,i,s,1);break}}}function Zh(r){const t=r.prev,e=r,A=r.next;if(Bt(t,e,A)>=0)return!1;const i=t.x,s=e.x,n=A.x,o=t.y,a=e.y,l=A.y,c=Math.min(i,s,n),h=Math.min(o,a,l),u=Math.max(i,s,n),d=Math.max(o,a,l);let f=A.next;for(;f!==t;){if(f.x>=c&&f.x<=u&&f.y>=h&&f.y<=d&&gi(i,o,s,a,n,l,f.x,f.y)&&Bt(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function $h(r,t,e,A){const i=r.prev,s=r,n=r.next;if(Bt(i,s,n)>=0)return!1;const o=i.x,a=s.x,l=n.x,c=i.y,h=s.y,u=n.y,d=Math.min(o,a,l),f=Math.min(c,h,u),B=Math.max(o,a,l),p=Math.max(c,h,u),D=ks(d,f,t,e,A),R=ks(B,p,t,e,A);let w=r.prevZ,S=r.nextZ;for(;w&&w.z>=D&&S&&S.z<=R;){if(w.x>=d&&w.x<=B&&w.y>=f&&w.y<=p&&w!==i&&w!==n&&gi(o,c,a,h,l,u,w.x,w.y)&&Bt(w.prev,w,w.next)>=0||(w=w.prevZ,S.x>=d&&S.x<=B&&S.y>=f&&S.y<=p&&S!==i&&S!==n&&gi(o,c,a,h,l,u,S.x,S.y)&&Bt(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;w&&w.z>=D;){if(w.x>=d&&w.x<=B&&w.y>=f&&w.y<=p&&w!==i&&w!==n&&gi(o,c,a,h,l,u,w.x,w.y)&&Bt(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;S&&S.z<=R;){if(S.x>=d&&S.x<=B&&S.y>=f&&S.y<=p&&S!==i&&S!==n&&gi(o,c,a,h,l,u,S.x,S.y)&&Bt(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function tg(r,t){let e=r;do{const A=e.prev,i=e.next.next;!OA(A,i)&&Ba(A,e,e.next,i)&&ui(A,i)&&ui(i,A)&&(t.push(A.i,e.i,i.i),fi(e),fi(e.next),e=r=i),e=e.next}while(e!==r);return yA(e)}function eg(r,t,e,A,i,s){let n=r;do{let o=n.next.next;for(;o!==n.prev;){if(n.i!==o.i&&cg(n,o)){let a=Ca(n,o);n=yA(n,n.next),a=yA(a,a.next),hi(n,t,e,A,i,s,0),hi(a,t,e,A,i,s,0);return}o=o.next}n=n.next}while(n!==r)}function Ag(r,t,e,A){const i=[];for(let s=0,n=t.length;s<n;s++){const o=t[s]*A,a=s<n-1?t[s+1]*A:r.length,l=pa(r,o,a,A,!1);l===l.next&&(l.steiner=!0),i.push(lg(l))}i.sort(ig);for(let s=0;s<i.length;s++)e=rg(i[s],e);return e}function ig(r,t){let e=r.x-t.x;if(e===0&&(e=r.y-t.y,e===0)){const A=(r.next.y-r.y)/(r.next.x-r.x),i=(t.next.y-t.y)/(t.next.x-t.x);e=A-i}return e}function rg(r,t){const e=sg(r,t);if(!e)return t;const A=Ca(e,r);return yA(A,A.next),yA(e,e.next)}function sg(r,t){let e=t;const A=r.x,i=r.y;let s=-1/0,n;if(OA(r,e))return e;do{if(OA(r,e.next))return e.next;if(i<=e.y&&i>=e.next.y&&e.next.y!==e.y){const h=e.x+(i-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(h<=A&&h>s&&(s=h,n=e.x<e.next.x?e:e.next,h===A))return n}e=e.next}while(e!==t);if(!n)return null;const o=n,a=n.x,l=n.y;let c=1/0;e=n;do{if(A>=e.x&&e.x>=a&&A!==e.x&&Ea(i<l?A:s,i,a,l,i<l?s:A,i,e.x,e.y)){const h=Math.abs(i-e.y)/(A-e.x);ui(e,r)&&(h<c||h===c&&(e.x>n.x||e.x===n.x&&ng(n,e)))&&(n=e,c=h)}e=e.next}while(e!==o);return n}function ng(r,t){return Bt(r.prev,r,t.prev)<0&&Bt(t.next,r,r.next)<0}function og(r,t,e,A){let i=r;do i.z===0&&(i.z=ks(i.x,i.y,t,e,A)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,ag(i)}function ag(r){let t,e=1;do{let A=r,i;r=null;let s=null;for(t=0;A;){t++;let n=A,o=0;for(let l=0;l<e&&(o++,n=n.nextZ,!!n);l++);let a=e;for(;o>0||a>0&&n;)o!==0&&(a===0||!n||A.z<=n.z)?(i=A,A=A.nextZ,o--):(i=n,n=n.nextZ,a--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;A=n}s.nextZ=null,e*=2}while(t>1);return r}function ks(r,t,e,A,i){return r=(r-e)*i|0,t=(t-A)*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 lg(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 Ea(r,t,e,A,i,s,n,o){return(i-n)*(t-o)>=(r-n)*(s-o)&&(r-n)*(A-o)>=(e-n)*(t-o)&&(e-n)*(s-o)>=(i-n)*(A-o)}function gi(r,t,e,A,i,s,n,o){return!(r===n&&t===o)&&Ea(r,t,e,A,i,s,n,o)}function cg(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!hg(r,t)&&(ui(r,t)&&ui(t,r)&&gg(r,t)&&(Bt(r.prev,r,t.prev)||Bt(r,t.prev,t))||OA(r,t)&&Bt(r.prev,r,r.next)>0&&Bt(t.prev,t,t.next)>0)}function Bt(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function OA(r,t){return r.x===t.x&&r.y===t.y}function Ba(r,t,e,A){const i=lr(Bt(r,t,e)),s=lr(Bt(r,t,A)),n=lr(Bt(e,A,r)),o=lr(Bt(e,A,t));return!!(i!==s&&n!==o||i===0&&ar(r,e,t)||s===0&&ar(r,A,t)||n===0&&ar(e,r,A)||o===0&&ar(e,t,A))}function ar(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 lr(r){return r>0?1:r<0?-1:0}function hg(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&&Ba(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function ui(r,t){return Bt(r.prev,r,r.next)<0?Bt(r,t,r.next)>=0&&Bt(r,r.prev,t)>=0:Bt(r,t,r.prev)<0||Bt(r,r.next,t)<0}function gg(r,t){let e=r,A=!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&&(A=!A),e=e.next;while(e!==r);return A}function Ca(r,t){const e=Ps(r.i,r.x,r.y),A=Ps(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,A.next=e,e.prev=A,s.next=A,A.prev=s,A}function Qa(r,t,e,A){const i=Ps(r,t,e);return A?(i.next=A.next,i.prev=A,A.next.prev=i,A.next=i):(i.prev=i,i.next=i),i}function fi(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 Ps(r,t,e){return{i:r,x:t,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function ug(r,t,e,A){let i=0;for(let s=t,n=e-A;s<e;s+=A)i+=(r[n]-r[s])*(r[s+1]+r[n+1]),n=s;return i}function fg(r,t,e,A={}){const{radius:i=1}=A;r.moveTo(t,e),r.arc(t,e,i,0,Math.PI*2)}const dg={arcs:"bevel",bevel:"bevel",miter:"miter","miter-clip":"miter",round:"round"};function Us(r,t){const{fill:e="#000",stroke:A="none",strokeWidth:i=A==="none"?0:1,strokeLinecap:s="round",strokeLinejoin:n="miter",strokeMiterlimit:o=0,strokeDasharray:a=[],strokeDashoffset:l=0,shadowOffsetX:c=0,shadowOffsetY:h=0,shadowBlur:u=0,shadowColor:d="rgba(0, 0, 0, 0)"}=t;r.fillStyle=e,r.strokeStyle=A,r.lineWidth=i,r.lineCap=s,r.lineJoin=dg[n],r.miterLimit=o,r.setLineDash(a),r.lineDashOffset=l,r.shadowOffsetX=c,r.shadowOffsetY=h,r.shadowBlur=u,r.shadowColor=d}class G{constructor(t=0,e=0){this.x=t,this.y=e}static get MAX(){return new G(1/0,1/0)}static get MIN(){return new G(-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 A=-t/180*Math.PI,i=this.x-e.x,s=-(this.y-e.y),n=Math.sin(A),o=Math.cos(A);return this.set(e.x+(i*o-s*n),e.y-(i*n+s*o)),this}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,A=this.y-t.y;return e*e+A*A}lengthSquared(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.lengthSquared())}scale(t,e=t,A={x:0,y:0}){const i=t<0?A.x-this.x+A.x:this.x,s=e<0?A.y-this.y+A.y:this.y;return this.x=i*Math.abs(t),this.y=s*Math.abs(e),this}skew(t,e=0,A={x:0,y:0}){const i=this.x-A.x,s=this.y-A.y;return this.x=A.x+(i+Math.tan(t)*s),this.y=A.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,A){return this.x=t.x+(e.x-t.x)*A,this.y=t.y+(e.y-t.y)*A,this}equals(t){return this.x===t.x&&this.y===t.y}applyMatrix3(t){const e=this.x,A=this.y,i=t.elements;return this.x=i[0]*e+i[3]*A+i[6],this.y=i[1]*e+i[4]*A+i[7],this}copy(t){return this.x=t.x,this.y=t.y,this}clone(){return new G(this.x,this.y)}}class ct{constructor(t=0,e=0,A=0,i=0){this.left=t,this.top=e,this.width=A,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 G((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 ct;if(t.length===1)return t[0].clone();const e=t[0],A=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 ct(A.left,A.top,A.right-A.left,A.bottom-A.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 ct(this.left,this.top,this.width,this.height)}}class Lt{elements=[];constructor(t=1,e=0,A=0,i=0,s=1,n=0,o=0,a=0,l=1){this.set(t,e,A,i,s,n,o,a,l)}set(t,e,A,i,s,n,o,a,l){const c=this.elements;return c[0]=t,c[1]=i,c[2]=o,c[3]=e,c[4]=s,c[5]=a,c[6]=A,c[7]=n,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,A=t.elements;return e[0]=A[0],e[1]=A[1],e[2]=A[2],e[3]=A[3],e[4]=A[4],e[5]=A[5],e[6]=A[6],e[7]=A[7],e[8]=A[8],this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const A=t.elements,i=e.elements,s=this.elements,n=A[0],o=A[3],a=A[6],l=A[1],c=A[4],h=A[7],u=A[2],d=A[5],f=A[8],B=i[0],p=i[3],D=i[6],R=i[1],w=i[4],S=i[7],Q=i[2],m=i[5],x=i[8];return s[0]=n*B+o*R+a*Q,s[3]=n*p+o*w+a*m,s[6]=n*D+o*S+a*x,s[1]=l*B+c*R+h*Q,s[4]=l*p+c*w+h*m,s[7]=l*D+c*S+h*x,s[2]=u*B+d*R+f*Q,s[5]=u*p+d*w+f*m,s[8]=u*D+d*S+f*x,this}invert(){const t=this.elements,e=t[0],A=t[1],i=t[2],s=t[3],n=t[4],o=t[5],a=t[6],l=t[7],c=t[8],h=c*n-o*l,u=o*a-c*s,d=l*s-n*a,f=e*h+A*u+i*d;if(f===0)return this.set(0,0,0,0,0,0,0,0,0);const B=1/f;return t[0]=h*B,t[1]=(i*l-c*A)*B,t[2]=(o*A-i*n)*B,t[3]=u*B,t[4]=(c*e-i*a)*B,t[5]=(i*s-o*e)*B,t[6]=d*B,t[7]=(A*a-l*e)*B,t[8]=(n*e-A*s)*B,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(Ns.makeScale(t,e)),this}rotate(t){return this.premultiply(Ns.makeRotation(-t)),this}translate(t,e){return this.premultiply(Ns.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),A=Math.sin(t);return this.set(e,-A,0,A,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 A=0;A<9;A++)this.elements[A]=t[A+e];return this}clone(){return new this.constructor().fromArray(this.elements)}}const Ns=new Lt;function ya(r,t,e,A){const i=r*e+t*A,s=Math.sqrt(r*r+t*t)*Math.sqrt(e*e+A*A);let n=Math.acos(Math.max(-1,Math.min(1,i/s)));return r*A-t*e<0&&(n=-n),n}function Ig(r,t,e,A,i,s,n,o){if(t===0||e===0){r.lineTo(o.x,o.y);return}A=A*Math.PI/180,t=Math.abs(t),e=Math.abs(e);const a=(n.x-o.x)/2,l=(n.y-o.y)/2,c=Math.cos(A)*a+Math.sin(A)*l,h=-Math.sin(A)*a+Math.cos(A)*l;let u=t*t,d=e*e;const f=c*c,B=h*h,p=f/u+B/d;if(p>1){const et=Math.sqrt(p);t=et*t,e=et*e,u=t*t,d=e*e}const D=u*B+d*f,R=(u*d-D)/D;let w=Math.sqrt(Math.max(0,R));i===s&&(w=-w);const S=w*t*h/e,Q=-w*e*c/t,m=Math.cos(A)*S-Math.sin(A)*Q+(n.x+o.x)/2,x=Math.sin(A)*S+Math.cos(A)*Q+(n.y+o.y)/2,M=ya(1,0,(c-S)/t,(h-Q)/e),V=ya((c-S)/t,(h-Q)/e,(-c-S)/t,(-h-Q)/e)%(Math.PI*2);r.ellipse(m,x,t,e,A,M,M+V,s===0)}const wt={WHITESPACE:/[ \t\r\n]/,DIGIT:/\d/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};function Se(r,t,e=0){let o=0,a=!0,l="",c="";const h=[];function u(p,D,R){const w=new SyntaxError(`Unexpected character "${p}" at index ${D}.`);throw w.partial=R,w}function d(){l!==""&&(c===""?h.push(Number(l)):h.push(Number(l)*10**Number(c))),l="",c=""}let f;const B=r.length;for(let p=0;p<B;p++){if(f=r[p],Array.isArray(t)&&t.includes(h.length%e)&&wt.FLAGS.test(f)){o=1,l=f,d();continue}if(o===0){if(wt.WHITESPACE.test(f))continue;if(wt.DIGIT.test(f)||wt.SIGN.test(f)){o=1,l=f;continue}if(wt.POINT.test(f)){o=2,l=f;continue}wt.COMMA.test(f)&&(a&&u(f,p,h),a=!0)}if(o===1){if(wt.DIGIT.test(f)){l+=f;continue}if(wt.POINT.test(f)){l+=f,o=2;continue}if(wt.EXP.test(f)){o=3;continue}wt.SIGN.test(f)&&l.length===1&&wt.SIGN.test(l[0])&&u(f,p,h)}if(o===2){if(wt.DIGIT.test(f)){l+=f;continue}if(wt.EXP.test(f)){o=3;continue}wt.POINT.test(f)&&l[l.length-1]==="."&&u(f,p,h)}if(o===3){if(wt.DIGIT.test(f)){c+=f;continue}if(wt.SIGN.test(f)){if(c===""){c+=f;continue}c.length===1&&wt.SIGN.test(c)&&u(f,p,h)}}wt.WHITESPACE.test(f)?(d(),o=0,a=!1):wt.COMMA.test(f)?(d(),o=0,a=!0):wt.SIGN.test(f)?(d(),o=1,l=f):wt.POINT.test(f)?(d(),o=2,l=f):u(f,p,h)}return d(),h}function HA(r,t){return r-(t-r)}function ma(r,t){const e=new G,A=new G;for(let i=0,s=r.length;i<s;i++){const n=r[i];if(n.type==="m"||n.type==="M")n.type==="m"?e.add(n):e.copy(n),t.moveTo(e.x,e.y),A.copy(e);else if(n.type==="h"||n.type==="H")n.type==="h"?e.x+=n.x:e.x=n.x,t.lineTo(e.x,e.y),A.copy(e);else if(n.type==="v"||n.type==="V")n.type==="v"?e.y+=n.y:e.y=n.y,t.lineTo(e.x,e.y),A.copy(e);else if(n.type==="l"||n.type==="L")n.type==="l"?e.add(n):e.copy(n),t.lineTo(e.x,e.y),A.copy(e);else if(n.type==="c"||n.type==="C")n.type==="c"?(t.bezierCurveTo(e.x+n.x1,e.y+n.y1,e.x+n.x2,e.y+n.y2,e.x+n.x,e.y+n.y),A.x=e.x+n.x2,A.y=e.y+n.y2,e.add(n)):(t.bezierCurveTo(n.x1,n.y1,n.x2,n.y2,n.x,n.y),A.x=n.x2,A.y=n.y2,e.copy(n));else if(n.type==="s"||n.type==="S")n.type==="s"?(t.bezierCurveTo(HA(e.x,A.x),HA(e.y,A.y),e.x+n.x2,e.y+n.y2,e.x+n.x,e.y+n.y),A.x=e.x+n.x2,A.y=e.y+n.y2,e.add(n)):(t.bezierCurveTo(HA(e.x,A.x),HA(e.y,A.y),n.x2,n.y2,n.x,n.y),A.x=n.x2,A.y=n.y2,e.copy(n));else if(n.type==="q"||n.type==="Q")n.type==="q"?(t.quadraticCurveTo(e.x+n.x1,e.y+n.y1,e.x+n.x,e.y+n.y),A.x=e.x+n.x1,A.y=e.y+n.y1,e.add(n)):(t.quadraticCurveTo(n.x1,n.y1,n.x,n.y),A.x=n.x1,A.y=n.y1,e.copy(n));else if(n.type==="t"||n.type==="T"){const o=HA(e.x,A.x),a=HA(e.y,A.y);A.x=o,A.y=a,n.type==="t"?(t.quadraticCurveTo(o,a,e.x+n.x,e.y+n.y),e.add(n)):(t.quadraticCurveTo(o,a,n.x,n.y),e.copy(n))}else if(n.type==="a"||n.type==="A"){const o=e.clone();if(n.type==="a"){if(n.x===0&&n.y===0)continue;e.add(n)}else{if(e.equals(n))continue;e.copy(n)}A.copy(e),Ig(t,n.rx,n.ry,n.angle,n.largeArcFlag,n.sweepFlag,o,e)}else n.type==="z"||n.type==="Z"?(t.startPoint&&e.copy(t.startPoint),t.closePath()):console.warn("Unsupported commands",n)}}function pg(r){let t,e;const A=[];for(let i=0,s=r.length;i<s;i++){const n=r[i];switch(n.type){case"m":case"M":if(n.x.toFixed(4)===e?.x.toFixed(4)&&n.y.toFixed(4)===e?.y.toFixed(4))continue;A.push(`${n.type} ${n.x} ${n.y}`),e={x:n.x,y:n.y},t={x:n.x,y:n.y};break;case"h":case"H":A.push(`${n.type} ${n.x}`),e={x:n.x,y:e?.y??0};break;case"v":case"V":A.push(`${n.type} ${n.y}`),e={x:e?.x??0,y:n.y};break;case"l":case"L":A.push(`${n.type} ${n.x} ${n.y}`),e={x:n.x,y:n.y};break;case"c":case"C":A.push(`${n.type} ${n.x1} ${n.y1} ${n.x2} ${n.y2} ${n.x} ${n.y}`),e={x:n.x,y:n.y};break;case"s":case"S":A.push(`${n.type} ${n.x2} ${n.y2} ${n.x} ${n.y}`),e={x:n.x,y:n.y};break;case"q":case"Q":A.push(`${n.type} ${n.x1} ${n.y1} ${n.x} ${n.y}`),e={x:n.x,y:n.y};break;case"t":case"T":A.push(`${n.type} ${n.x} ${n.y}`),e={x:n.x,y:n.y};break;case"a":case"A":A.push(`${n.type} ${n.rx} ${n.ry} ${n.angle} ${n.largeArcFlag} ${n.sweepFlag} ${n.x} ${n.y}`),e={x:n.x,y:n.y};break;case"z":case"Z":A.push(n.type),t&&(e={x:t.x,y:t.y});break}}return A.join(" ")}const Eg=/[a-df-z][^a-df-z]*/gi;function wa(r){const t=[],e=r.match(Eg);if(!e)return t;for(let A=0,i=e.length;A<i;A++){const s=e[A],n=s.charAt(0),o=s.slice(1).trim();let a;switch(n){case"m":case"M":a=Se(o);for(let l=0,c=a.length;l<c;l+=2)l===0?t.push({type:n,x:a[l],y:a[l+1]}):t.push({type:n==="m"?"l":"L",x:a[l],y:a[l+1]});break;case"h":case"H":a=Se(o);for(let l=0,c=a.length;l<c;l++)t.push({type:n,x:a[l]});break;case"v":case"V":a=Se(o);for(let l=0,c=a.length;l<c;l++)t.push({type:n,y:a[l]});break;case"l":case"L":a=Se(o);for(let l=0,c=a.length;l<c;l+=2)t.push({type:n,x:a[l],y:a[l+1]});break;case"c":case"C":a=Se(o);for(let l=0,c=a.length;l<c;l+=6)t.push({type:n,x1:a[l],y1:a[l+1],x2:a[l+2],y2:a[l+3],x:a[l+4],y:a[l+5]});break;case"s":case"S":a=Se(o);for(let l=0,c=a.length;l<c;l+=4)t.push({type:n,x2:a[l],y2:a[l+1],x:a[l+2],y:a[l+3]});break;case"q":case"Q":a=Se(o);for(let l=0,c=a.length;l<c;l+=4)t.push({type:n,x1:a[l],y1:a[l+1],x:a[l+2],y:a[l+3]});break;case"t":case"T":a=Se(o);for(let l=0,c=a.length;l<c;l+=2)t.push({type:n,x:a[l],y:a[l+1]});break;case"a":case"A":a=Se(o,[3,4],7);for(let l=0,c=a.length;l<c;l+=7)t.push({type:n,rx:a[l],ry:a[l+1],angle:a[l+2],largeArcFlag:a[l+3],sweepFlag:a[l+4],x:a[l+5],y:a[l+6]});break;case"z":case"Z":t.push({type:n});break;default:console.warn(s)}}return t}const va="data:image/svg+xml;",_a=`${va}base64,`,ba=`${va}charset=utf8,`;function Fs(r){if(typeof r=="string"){let t;r.startsWith(_a)?(r=r.substring(_a.length,r.length),t=atob(r)):r.startsWith(ba)?(r=r.substring(ba.length,r.length),t=decodeURIComponent(r)):t=r;const e=new DOMParser().parseFromString(t,"text/xml"),A=e.querySelector("parsererror");if(A)throw new Error(`${A.textContent??"parser error"}
|
|
74
|
-
${t}`);return e.documentElement}else return r}const Bg="px",Cg=90,Da=["mm","cm","in","pt","pc","px"],xa={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 It(r){let t="px";if(typeof r=="string")for(let A=0,i=Da.length;A<i;A++){const s=Da[A];if(r.endsWith(s)){t=s,r=r.substring(0,r.length-s.length);break}}let e;return e=xa[t][Bg],e<0&&(e=xa[t].in*Cg),e*Number.parseFloat(r)}const Qg=new Lt,cr=new Lt,Sa=new Lt,Ma=new Lt;function yg(r,t,e){if(!(r.hasAttribute("transform")||r.nodeName==="use"&&(r.hasAttribute("x")||r.hasAttribute("y"))))return null;const A=mg(r);return e.length>0&&A.premultiply(e[e.length-1]),t.copy(A),e.push(A),A}function mg(r){const t=new Lt,e=Qg;if(r.nodeName==="use"&&(r.hasAttribute("x")||r.hasAttribute("y"))&&t.translate(It(r.getAttribute("x")),It(r.getAttribute("y"))),r.hasAttribute("transform")){const A=r.getAttribute("transform").split(")");for(let i=A.length-1;i>=0;i--){const s=A[i].trim();if(s==="")continue;const n=s.indexOf("("),o=s.length;if(n>0&&n<o){const a=s.slice(0,n),l=Se(s.slice(n+1));switch(e.identity(),a){case"translate":if(l.length>=1){const c=l[0];let h=0;l.length>=2&&(h=l[1]),e.translate(c,h)}break;case"rotate":if(l.length>=1){let c=0,h=0,u=0;c=l[0]*Math.PI/180,l.length>=3&&(h=l[1],u=l[2]),cr.makeTranslation(-h,-u),Sa.makeRotation(c),Ma.multiplyMatrices(Sa,cr),cr.makeTranslation(h,u),e.multiplyMatrices(cr,Ma)}break;case"scale":l.length>=1&&e.scale(l[0],l[1]??l[0]);break;case"skewX":l.length===1&&e.set(1,Math.tan(l[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":l.length===1&&e.set(1,0,0,Math.tan(l[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":l.length===6&&e.set(l[0],l[2],l[4],l[1],l[3],l[5],0,0,1);break}}t.premultiply(e)}}return t}function wg(r){return new kt().arc(It(r.getAttribute("cx")||0),It(r.getAttribute("cy")||0),It(r.getAttribute("r")||0),0,Math.PI*2)}function vg(r,t){if(!(!r.sheet||!r.sheet.cssRules||!r.sheet.cssRules.length))for(let e=0;e<r.sheet.cssRules.length;e++){const A=r.sheet.cssRules[e];if(A.type!==1)continue;const i=A.selectorText.split(/,/g).filter(Boolean).map(n=>n.trim()),s={};for(let n=A.style.length,o=0;o<n;o++){const a=A.style.item(o);s[a]=A.style.getPropertyValue(a)}for(let n=0;n<i.length;n++)t[i[n]]=Object.assign(t[i[n]]||{},{...s})}}function _g(r){return new kt().ellipse(It(r.getAttribute("cx")||0),It(r.getAttribute("cy")||0),It(r.getAttribute("rx")||0),It(r.getAttribute("ry")||0),0,0,Math.PI*2)}function bg(r){return new kt().moveTo(It(r.getAttribute("x1")||0),It(r.getAttribute("y1")||0)).lineTo(It(r.getAttribute("x2")||0),It(r.getAttribute("y2")||0))}function Dg(r){const t=new kt,e=r.getAttribute("d");return!e||e==="none"?null:(t.addData(e),t)}const xg=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function Sg(r){const t=new kt;let e=0;return r.getAttribute("points")?.replace(xg,(A,i,s)=>{const n=It(i),o=It(s);return e===0?t.moveTo(n,o):t.lineTo(n,o),e++,A}),t.currentCurve.autoClose=!0,t}const Mg=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function Rg(r){const t=new kt;let e=0;return r.getAttribute("points")?.replace(Mg,(A,i,s)=>{const n=It(i),o=It(s);return e===0?t.moveTo(n,o):t.lineTo(n,o),e++,A}),t.currentCurve.autoClose=!1,t}function kg(r){const t=It(r.getAttribute("x")||0),e=It(r.getAttribute("y")||0),A=It(r.getAttribute("rx")||r.getAttribute("ry")||0),i=It(r.getAttribute("ry")||r.getAttribute("rx")||0),s=It(r.getAttribute("width")),n=It(r.getAttribute("height")),o=1-.551915024494,a=new kt;return a.moveTo(t+A,e),a.lineTo(t+s-A,e),(A!==0||i!==0)&&a.bezierCurveTo(t+s-A*o,e,t+s,e+i*o,t+s,e+i),a.lineTo(t+s,e+n-i),(A!==0||i!==0)&&a.bezierCurveTo(t+s,e+n-i*o,t+s-A*o,e+n,t+s-A,e+n),a.lineTo(t+A,e+n),(A!==0||i!==0)&&a.bezierCurveTo(t+A*o,e+n,t,e+n-i*o,t,e+n-i),a.lineTo(t,e+i),(A!==0||i!==0)&&a.bezierCurveTo(t,e+i*o,t+A*o,e,t+A,e),a}function Me(r,t,e){t=Object.assign({},t);let A={};if(r.hasAttribute("class")){const l=r.getAttribute("class").split(/\s/).filter(Boolean).map(c=>c.trim());for(let c=0;c<l.length;c++)A=Object.assign(A,e[`.${l[c]}`])}r.hasAttribute("id")&&(A=Object.assign(A,e[`#${r.getAttribute("id")}`]));for(let l=r.style.length,c=0;c<l;c++){const h=r.style.item(c),u=r.style.getPropertyValue(h);t[h]=u,A[h]=u}function i(l,c,h=s){r.hasAttribute(l)&&(t[c]=h(r.getAttribute(l))),A[l]&&(t[c]=h(A[l]))}function s(l){return l.startsWith("url")&&console.warn("url access in attributes is not implemented."),l}function n(l){return Math.max(0,Math.min(1,It(l)))}function o(l){return Math.max(0,It(l))}function a(l){return l.split(" ").filter(c=>c!=="").map(c=>It(c))}return i("fill","fill"),i("fill-opacity","fillOpacity",n),i("fill-rule","fillRule"),i("opacity","opacity",n),i("stroke","stroke"),i("stroke-opacity","strokeOpacity",n),i("stroke-width","strokeWidth",o),i("stroke-linecap","strokeLinecap"),i("stroke-linejoin","strokeLinejoin"),i("stroke-miterlimit","strokeMiterlimit",o),i("stroke-dasharray","strokeDasharray",a),i("stroke-dashoffset","strokeDashoffset",It),i("visibility","visibility"),t}function Ts(r,t,e=[],A={}){if(r.nodeType!==1)return e;let i=!1,s=null,n={...t};switch(r.nodeName){case"svg":n=Me(r,n,A);break;case"style":vg(r,A);break;case"g":n=Me(r,n,A);break;case"path":n=Me(r,n,A),r.hasAttribute("d")&&(s=Dg(r));break;case"rect":n=Me(r,n,A),s=kg(r);break;case"polygon":n=Me(r,n,A),s=Sg(r);break;case"polyline":n=Me(r,n,A),s=Rg(r);break;case"circle":n=Me(r,n,A),s=wg(r);break;case"ellipse":n=Me(r,n,A),s=_g(r);break;case"line":n=Me(r,n,A),s=bg(r);break;case"defs":i=!0;break;case"use":{n=Me(r,n,A);const u=(r.getAttributeNS("http://www.w3.org/1999/xlink","href")||r.getAttribute("href")||"").substring(1),d=r.viewportElement?.getElementById(u);d?Ts(d,n,e,A):console.warn(`'use node' references non-existent node id: ${u}`);break}default:console.warn(r);break}if(n.display==="none")return e;const o=new Lt,a=[],l=yg(r,o,a);s&&(s.applyTransform(o),e.push(s),s.style={...n});const c=r.childNodes;for(let h=0,u=c.length;h<u;h++){const d=c[h];i&&d.nodeName!=="style"&&d.nodeName!=="defs"||Ts(d,n,e,A)}return l&&(a.pop(),a.length>0?o.copy(a[a.length-1]):o.identity()),e}function Ls(r){const t=Fs(r);return new We(Ts(t,{}),t.getAttribute("viewBox")?.trim().split(" ").map(e=>Number(e)))}function Ra(r,t,e,A,i){const s=(A-t)*.5,n=(i-e)*.5,o=r*r,a=r*o;return(2*e-2*A+s+n)*a+(-3*e+3*A-2*s-n)*o+s*r+e}function Pg(r,t){const e=1-r;return e*e*e*t}function Ug(r,t){const e=1-r;return 3*e*e*r*t}function Ng(r,t){return 3*(1-r)*r*r*t}function Fg(r,t){return r*r*r*t}function ka(r,t,e,A,i){return Pg(r,t)+Ug(r,e)+Ng(r,A)+Fg(r,i)}function Pa(r,t={}){let{vertices:e=[],indices:A=[],holes:i=[],verticesStride:s=2,verticesOffset:n=e.length/s,indicesOffset:o=A.length}=t;const a=jh(r,i,2);if(a.length){for(let c=0;c<a.length;c+=3)A[o++]=a[c]+n,A[o++]=a[c+1]+n,A[o++]=a[c+2]+n;let l=n*s;for(let c=0;c<r.length;c+=2)e[l]=r[c],e[l+1]=r[c+1],l+=s}return{vertices:e,indices:A}}const Tg=8,hr=11920929e-14,Lg=1;function Gg(r,t,e,A,i,s,n,o,a=.5,l=[]){const h=Math.min(.99,Math.max(0,a));let u=(Lg-h)/1;return u*=u,Gs(r,t,e,A,i,s,n,o,l,u,0),l.push(n,o),l}function Gs(r,t,e,A,i,s,n,o,a,l,c){if(c>Tg)return;const h=(r+e)/2,u=(t+A)/2,d=(e+i)/2,f=(A+s)/2,B=(i+n)/2,p=(s+o)/2,D=(h+d)/2,R=(u+f)/2,w=(d+B)/2,S=(f+p)/2,Q=(D+w)/2,m=(R+S)/2;if(c>0){let x=n-r,M=o-t;const V=Math.abs((e-n)*M-(A-o)*x),et=Math.abs((i-n)*M-(s-o)*x);if(V>hr&&et>hr){if((V+et)*(V+et)<=l*(x*x+M*M)){a.push(Q,m);return}}else if(V>hr){if(V*V<=l*(x*x+M*M)){a.push(Q,m);return}}else if(et>hr){if(et*et<=l*(x*x+M*M)){a.push(Q,m);return}}else if(x=Q-(r+n)/2,M=m-(t+o)/2,x*x+M*M<=l){a.push(Q,m);return}}Gs(r,t,h,u,D,R,Q,m,a,l,c+1),Gs(Q,m,w,S,B,p,n,o,a,l,c+1)}const Og=8,Hg=11920929e-14,Jg=1;function Kg(r,t,e,A,i,s,n=.5,o=[]){const l=Math.min(.99,Math.max(0,n));let c=(Jg-l)/1;return c*=c,Os(o,r,t,e,A,i,s,c,0),o.push(i,s),o}function Os(r,t,e,A,i,s,n,o,a){if(a>Og)return;const l=(t+A)/2,c=(e+i)/2,h=(A+s)/2,u=(i+n)/2,d=(l+h)/2,f=(c+u)/2;let B=s-t,p=n-e;const D=Math.abs((A-s)*p-(i-n)*B);if(D>Hg){if(D*D<=o*(B*B+p*p)){r.push(d,f);return}}else if(B=d-(t+s)/2,p=f-(e+n)/2,B*B+p*p<=o){r.push(d,f);return}Os(r,t,e,l,c,d,f,o,a+1),Os(r,d,f,h,u,s,n,o,a+1)}function Yg(r){return r.replace(/[^a-z0-9]/gi,"-").replace(/\B([A-Z])/g,"-$1").toLowerCase()}function Vg(r,t,e,A){const i=t.clone().sub(r),s=A.clone().sub(e),n=e.clone().sub(r),o=i.cross(s);if(o===0)return new G((r.x+e.x)/2,(r.y+e.y)/2);const a=n.cross(s)/o;return Math.abs(a)>1?new G((r.x+e.x)/2,(r.y+e.y)/2):new G(r.x+a*i.x,r.y+a*i.y)}function Wg(r){let t=0;const e=r.length/2;for(let A=0;A<e;A++){const i=r[2*A],s=r[2*A+1],n=(A+1)%e,o=r[2*n],a=r[2*n+1];t+=(o-i)*(a+s)}return t}function Ua(r,t,e,A,i,s){return(e-r)*(s-t)-(i-r)*(A-t)}function zg(r,t,e){const A=e.length;let i=0;for(let s=0,n=A-2;s<A;n=s,s+=2){const o=e[s],a=e[s+1],l=e[n],c=e[n+1];a<=t?c>t&&Ua(l,c,o,a,r,t)>0&&i++:c<=t&&Ua(l,c,o,a,r,t)<0&&i--}return i}function qg(r){const t=r.length,e=r.map((A,i)=>({index:i,parentIndex:null,wn:0}));for(let A=0;A<t;A++){let i=null;if(Wg(r[A])<0)continue;const s=[r[A][0],r[A][1]];for(let n=0;n<t;n++){if(A===n)continue;let o=0;for(let l=0;l<s.length&&(o=o||zg(s[l],s[l+1],r[n]),!o);l+=2);const a=Math.abs(o);a!==0&&(!i||a>Math.abs(i.wn))&&(i={idx:n,wn:o})}i&&(e[A].parentIndex=i.idx,e[A].wn=i.wn)}return e}function Xg(r,t){const e=1-r;return e*e*t}function jg(r,t){return 2*(1-r)*r*t}function Zg(r,t){return r*r*t}function Na(r,t,e,A){return Xg(r,t)+jg(r,e)+Zg(r,A)}const $g=1e-4,Fa=1e-4;function tu(r,t={}){const{vertices:e=[],indices:A=[],lineStyle:i={alignment:.5,cap:"butt",join:"miter",width:1,miterLimit:10},flipAlignment:s=!1,closed:n=!0}=t,o=$g;if(r.length===0)return{vertices:e,indices:A};const a=i;let l=a.alignment;if(i.alignment!==.5){let K=eu(r);s&&(K*=-1),l=(l-.5)*K+.5}const c={x:r[0],y:r[1]},h={x:r[r.length-2],y:r[r.length-1]},u=n,d=Math.abs(c.x-h.x)<o&&Math.abs(c.y-h.y)<o;if(u){r=r.slice(),d&&(r.pop(),r.pop(),h.x=r[r.length-2],h.y=r[r.length-1]);const K=(c.x+h.x)*.5,At=(h.y+c.y)*.5;r.unshift(K,At),r.push(K,At)}const f=e,B=r.length/2;let p=r.length;const D=f.length/2,R=a.width/2,w=R*R,S=a.miterLimit*a.miterLimit;let Q=r[0],m=r[1],x=r[2],M=r[3],V=0,et=0,W=-(m-M),H=Q-x,Z=0,J=0,T=Math.sqrt(W*W+H*H);W/=T,H/=T,W*=R,H*=R;const it=l,L=(1-it)*2,z=it*2;u||(a.cap==="round"?p+=mA(Q-W*(L-z)*.5,m-H*(L-z)*.5,Q-W*L,m-H*L,Q+W*z,m+H*z,f,!0)+2:a.cap==="square"&&(p+=Ta(Q,m,W,H,L,z,!0,f))),f.push(Q-W*L,m-H*L),f.push(Q+W*z,m+H*z);for(let K=1;K<B-1;++K){Q=r[(K-1)*2],m=r[(K-1)*2+1],x=r[K*2],M=r[K*2+1],V=r[(K+1)*2],et=r[(K+1)*2+1],W=-(m-M),H=Q-x,T=Math.sqrt(W*W+H*H),W/=T,H/=T,W*=R,H*=R,Z=-(M-et),J=x-V,T=Math.sqrt(Z*Z+J*J),Z/=T,J/=T,Z*=R,J*=R;const At=x-Q,U=m-M,P=x-V,q=et-M,$=At*P+U*q,nt=U*P-q*At,X=nt<0;if(Math.abs(nt)<.001*Math.abs($)){f.push(x-W*L,M-H*L),f.push(x+W*z,M+H*z),$>=0&&(a.join==="round"?p+=mA(x,M,x-W*L,M-H*L,x-Z*L,M-J*L,f,!1)+4:p+=2,f.push(x-Z*z,M-J*z),f.push(x+Z*L,M+J*L));continue}const dt=(-W+Q)*(-H+M)-(-W+x)*(-H+m),ie=(-Z+V)*(-J+M)-(-Z+x)*(-J+et),re=(At*ie-P*dt)/nt,Ft=(q*dt-U*ie)/nt,ht=(re-x)*(re-x)+(Ft-M)*(Ft-M),Qt=x+(re-x)*L,Tt=M+(Ft-M)*L,Jt=x-(re-x)*z,_t=M-(Ft-M)*z,Zt=Math.min(At*At+U*U,P*P+q*q),Oe=X?L:z,Xr=Zt+Oe*Oe*w;ht<=Xr?a.join==="bevel"||ht/w>S?(X?(f.push(Qt,Tt),f.push(x+W*z,M+H*z),f.push(Qt,Tt),f.push(x+Z*z,M+J*z)):(f.push(x-W*L,M-H*L),f.push(Jt,_t),f.push(x-Z*L,M-J*L),f.push(Jt,_t)),p+=2):a.join==="round"?X?(f.push(Qt,Tt),f.push(x+W*z,M+H*z),p+=mA(x,M,x+W*z,M+H*z,x+Z*z,M+J*z,f,!0)+4,f.push(Qt,Tt),f.push(x+Z*z,M+J*z)):(f.push(x-W*L,M-H*L),f.push(Jt,_t),p+=mA(x,M,x-W*L,M-H*L,x-Z*L,M-J*L,f,!1)+4,f.push(x-Z*L,M-J*L),f.push(Jt,_t)):(f.push(Qt,Tt),f.push(Jt,_t)):(f.push(x-W*L,M-H*L),f.push(x+W*z,M+H*z),a.join==="round"?X?p+=mA(x,M,x+W*z,M+H*z,x+Z*z,M+J*z,f,!0)+2:p+=mA(x,M,x-W*L,M-H*L,x-Z*L,M-J*L,f,!1)+2:a.join==="miter"&&ht/w<=S&&(X?(f.push(Jt,_t),f.push(Jt,_t)):(f.push(Qt,Tt),f.push(Qt,Tt)),p+=2),f.push(x-Z*L,M-J*L),f.push(x+Z*z,M+J*z),p+=2)}Q=r[(B-2)*2],m=r[(B-2)*2+1],x=r[(B-1)*2],M=r[(B-1)*2+1],W=-(m-M),H=Q-x,T=Math.sqrt(W*W+H*H),W/=T,H/=T,W*=R,H*=R,f.push(x-W*L,M-H*L),f.push(x+W*z,M+H*z),u||(a.cap==="round"?p+=mA(x-W*(L-z)*.5,M-H*(L-z)*.5,x-W*L,M-H*L,x+W*z,M+H*z,f,!1)+2:a.cap==="square"&&(p+=Ta(x,M,W,H,L,z,!1,f)));const tt=Fa*Fa;for(let K=D;K<p+D-2;++K)Q=f[K*2],m=f[K*2+1],x=f[(K+1)*2],M=f[(K+1)*2+1],V=f[(K+2)*2],et=f[(K+2)*2+1],!(Math.abs(Q*(M-et)+x*(et-m)+V*(m-M))<tt)&&A.push(K,K+1,K+2);return{vertices:e,indices:A}}function eu(r){const t=r.length;if(t<6)return 1;let e=0;for(let A=0,i=r[t-2],s=r[t-1];A<t;A+=2){const n=r[A],o=r[A+1];e+=(n-i)*(o+s),i=n,s=o}return e<0?-1:1}function Ta(r,t,e,A,i,s,n,o){const a=r-e*i,l=t-A*i,c=r+e*s,h=t+A*s;let u,d;n?(u=A,d=-e):(u=-A,d=e);const f=a+u,B=l+d,p=c+u,D=h+d;return o.push(f,B),o.push(p,D),2}function mA(r,t,e,A,i,s,n,o){const a=e-r,l=A-t;let c=Math.atan2(a,l),h=Math.atan2(i-r,s-t);o&&c<h?c+=Math.PI*2:!o&&c>h&&(h+=Math.PI*2);let u=c;const d=h-c,f=Math.abs(d),B=Math.sqrt(a*a+l*l),p=(15*f*Math.sqrt(B)/Math.PI>>0)+1,D=d/p;if(u+=D,o){n.push(r,t),n.push(e,A);for(let R=1,w=u;R<p;R++,w+=D)n.push(r,t),n.push(r+Math.sin(w)*B,t+Math.cos(w)*B);n.push(r,t),n.push(i,s)}else{n.push(e,A),n.push(r,t);for(let R=1,w=u;R<p;R++,w+=D)n.push(r+Math.sin(w)*B,t+Math.cos(w)*B),n.push(r,t);n.push(i,s),n.push(r,t)}return p*2}class JA{arcLengthDivision=200;_arcLengths;getPointAt(t,e=new G){return this.getPoint(this.getUToTMapping(t),e)}isClockwise(){return!1}getControlPointRefs(){return[]}applyTransform(t){const e=typeof t=="function";return this.getControlPointRefs().forEach(A=>{e?t(A):A.applyMatrix3(t)}),this}getUnevenVertices(t=5,e=[]){const A=new G;for(let i=0,s=Math.max(1,t)-1;i<=s;i++)this.getPoint(i/s,A),e.push(A.x,A.y);return e}getSpacedVertices(t=5,e=[]){const A=new G;for(let i=0,s=Math.max(1,t)-1;i<=s;i++)this.getPointAt(i/s,A),e.push(A.x,A.y);return e}getAdaptiveVertices(t=[]){return this.getUnevenVertices(5,t)}_verticesToPoints(t,e=[]){for(let A=0,i=t.length;A<i;A+=2){const s=t[A],n=t[A+1];e.push(new G(s,n))}return e}getSpacedPoints(t,e=[]){const A=this.getSpacedVertices(t);return this._verticesToPoints(A,e),e}getUnevenPoints(t,e=[]){const A=this.getUnevenVertices(t);return this._verticesToPoints(A,e),e}getAdaptivePoints(t=[]){const e=this.getAdaptiveVertices();return this._verticesToPoints(e,t),t}getPoints(t,e=[]){let A;return t?A=this.getUnevenVertices(t):A=this.getAdaptiveVertices(),this._verticesToPoints(A,e),e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(){return(!this._arcLengths||this._arcLengths.length!==this.arcLengthDivision+1)&&this.updateLengths(),this._arcLengths}updateLengths(){const t=this.arcLengthDivision,e=[0];for(let A=0,i=this.getPoint(0),s=1;s<=t;s++){const n=this.getPoint(s/t);A+=n.distanceTo(i),e.push(A),i=n}this._arcLengths=e}getUToTMapping(t,e){const A=this.getLengths(),i=A.length,s=e??t*A[i-1];if(i<2)return s/A[0];let n=0,o=0,a=i-1,l;for(;o<=a;)if(n=Math.floor(o+(a-o)/2),l=A[n]-s,l<0)o=n+1;else if(l>0)a=n-1;else{a=n;break}if(n=a,A[n]===s)return n/(i-1);const c=A[n],u=A[n+1]-c,d=(s-c)/u;return(n+d)/(i-1)}getTangent(t,e=new G){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 G){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 A=0,i=1,s=(A+i)/2;for(;i-A>e;){s=(A+i)/2;const n=this.getPoint(s);if(n.distanceTo(t)<e)return s;n.x<t.x?A=s:i=s}return s}getMinMax(t=G.MAX,e=G.MIN){const A=this.getPoints();for(let i=0,s=A.length;i<s;i++){const n=A[i];t.min(n),e.max(n)}return{min:t.finite(),max:e.finite()}}getBoundingBox(){const{min:t,max:e}=this.getMinMax();return new ct(t.x,t.y,e.x-t.x,e.y-t.y)}getFillVertices(t){return this.getAdaptiveVertices()}fillTriangulate(t){return Pa(this.getFillVertices(t),t)}strokeTriangulate(t){return tu(this.getAdaptiveVertices(),t)}toCommands(){const t=[],e=this.getPoints();for(let A=0,i=e.length;A<i;A++){const s=e[A];A===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 pg(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 Au=new Lt,La=new Lt,Ga=new Lt,gr=new G;class Hs extends JA{constructor(t=new G,e=new G,A=new G,i=0,s=0,n=Math.PI*2,o=!1){super(),this._center=t,this._radius=e,this._diff=A,this.rotate=i,this.startAngle=s,this.endAngle=n,this.clockwise=o}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 A=Math.abs(e)<Number.EPSILON;return e=(e%t+t)%t,A?e=0:this.clockwise||(e=e===0?-t:e-t),e}getPoint(t,e=new G){const A=this._getDeltaAngle(),i=this.startAngle+t*A;let s=this.cx+this.rx*Math.cos(i),n=this.cy+this.ry*Math.sin(i);if(this.rotate!==0){const o=Math.cos(this.rotate),a=Math.sin(this.rotate),l=s-this.cx,c=n-this.cy;s=l*o-c*a+this.cx,n=l*a+c*o+this.cy}return e.set(s,n)}toCommands(){const{cx:t,cy:e,rx:A,ry:i,startAngle:s,endAngle:n,clockwise:o,rotate:a}=this,l=t+A*Math.cos(s)*Math.cos(a)-i*Math.sin(s)*Math.sin(a),c=e+A*Math.cos(s)*Math.sin(a)+i*Math.sin(s)*Math.cos(a),h=Math.abs(s-n),u=h>Math.PI?1:0,d=o?1:0,f=a*180/Math.PI;if(h>=2*Math.PI){const B=s+Math.PI,p=t+A*Math.cos(B)*Math.cos(a)-i*Math.sin(B)*Math.sin(a),D=e+A*Math.cos(B)*Math.sin(a)+i*Math.sin(B)*Math.cos(a);return[{type:"M",x:l,y:c},{type:"A",rx:A,ry:i,angle:f,largeArcFlag:0,sweepFlag:d,x:p,y:D},{type:"A",rx:A,ry:i,angle:f,largeArcFlag:0,sweepFlag:d,x:l,y:c}]}else{const B=t+A*Math.cos(n)*Math.cos(a)-i*Math.sin(n)*Math.sin(a),p=e+A*Math.cos(n)*Math.sin(a)+i*Math.sin(n)*Math.cos(a);return[{type:"M",x:l,y:c},{type:"A",rx:A,ry:i,angle:f,largeArcFlag:u,sweepFlag:d,x:B,y:p}]}}drawTo(t){const{cx:e,cy:A,rx:i,ry:s,rotate:n,startAngle:o,endAngle:a,clockwise:l}=this;return t.ellipse(e,A,i,s,n,o,a,!l),this}applyTransform(t){return gr.set(this.cx,this.cy),gr.applyMatrix3(t),this.cx=gr.x,this.cy=gr.y,su(t)?iu(this,t):ru(this,t),this}getControlPointRefs(){return[this._center]}_getAdaptiveVerticesByArc(t=[]){const{cx:e,cy:A,rx:i,ry:s,dx:n,dy:o,startAngle:a,endAngle:l,clockwise:c,rotate:h}=this,u=!c;let d=Math.abs(a-l);(!u&&a>l||u&&l>a)&&(d=2*Math.PI-d);const f=Math.max(12,Math.floor(12*i**(1/3)*(d/Math.PI)));let B=d/f,p=a;B*=u?-1:1;const D=Math.cos(u?h:-h),R=Math.sin(u?h:-h);for(let w=0;w<f+1;w++){const S=n+Math.cos(p)*i,Q=o+Math.sin(p)*s,m=S*D-Q*R,x=S*R+Q*D;t.push(e+m,A+x),p+=B}return t}_getAdaptiveVerticesByCircle(t=[]){const{cx:e,cy:A,rx:i,ry:s,dx:n,dy:o,rotate:a,clockwise:l}=this;if(!(i>=0&&s>=0&&n>=0&&o>=0))return t;const c=Math.ceil(2.3*Math.sqrt(i+s)),h=c*8+(n?4:0)+(o?4:0),u=[];if(h===0)return t;{const B=u.length;if(c===0)u[B]=u[B+6]=e+n,u[B+1]=u[B+3]=A+o,u[B+2]=u[B+4]=e-n,u[B+5]=u[B+7]=A-o;else{let p=B,D=B+c*4+(n?2:0)+2,R=D,w=h,S=n+i,Q=o,m=e+S,x=e-S,M=A+Q;if(u[p++]=m,u[p++]=M,u[--D]=M,u[--D]=x,o){const et=A-Q;u[R++]=x,u[R++]=et,u[--w]=et,u[--w]=m}for(let et=1;et<c;et++){const W=Math.PI/2*(et/c),H=n+Math.cos(W)*i,Z=o+Math.sin(W)*s,J=e+H,T=e-H,it=A+Z,L=A-Z;u[p++]=J,u[p++]=it,u[--D]=it,u[--D]=T,u[R++]=T,u[R++]=L,u[--w]=L,u[--w]=J}S=n,Q=o+s,m=e+S,x=e-S,M=A+Q;const V=A-Q;u[p++]=m,u[p++]=M,u[--w]=V,u[--w]=m,n&&(u[p++]=x,u[p++]=M,u[--w]=V,u[--w]=x)}}const d=Math.cos(l?-a:a),f=Math.sin(l?-a:a);for(let B=0;B<u.length;B+=2){const p=u[B],D=u[B+1],R=p-e,w=D-A,S=R*d-w*f,Q=R*f+w*d;t.push(e+S,A+Q)}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 iu(r,t){const e=r.rx,A=r.ry,i=Math.cos(r.rotate),s=Math.sin(r.rotate),n=new G(e*i,e*s),o=new G(-A*s,A*i),a=n.applyMatrix3(t),l=o.applyMatrix3(t),c=Au.set(a.x,l.x,0,a.y,l.y,0,0,0,1),h=La.copy(c).invert(),f=Ga.copy(h).transpose().multiply(h).elements,B=nu(f[0],f[1],f[4]),p=Math.sqrt(B.rt1),D=Math.sqrt(B.rt2);if(r.rx=1/p,r.ry=1/D,r.rotate=Math.atan2(B.sn,B.cs),!((r.endAngle-r.startAngle)%(2*Math.PI)<Number.EPSILON)){const w=La.set(p,0,0,0,D,0,0,0,1),S=Ga.set(B.cs,B.sn,0,-B.sn,B.cs,0,0,0,1),Q=w.multiply(S).multiply(c),m=x=>{const{x:M,y:V}=new G(Math.cos(x),Math.sin(x)).applyMatrix3(Q);return Math.atan2(V,M)};r.startAngle=m(r.startAngle),r.endAngle=m(r.endAngle),Oa(t)&&(r.clockwise=!r.clockwise)}}function ru(r,t){const e=Ha(t),A=Ja(t);r.rx*=e,r.ry*=A;const i=e>Number.EPSILON?Math.atan2(t.elements[1],t.elements[0]):Math.atan2(-t.elements[3],t.elements[4]);r.rotate+=i,Oa(t)&&(r.startAngle*=-1,r.endAngle*=-1,r.clockwise=!r.clockwise)}function Oa(r){const t=r.elements;return t[0]*t[4]-t[1]*t[3]<0}function su(r){const t=r.elements,e=t[0]*t[3]+t[1]*t[4];if(e===0)return!1;const A=Ha(r),i=Ja(r);return Math.abs(e/(A*i))>Number.EPSILON}function Ha(r){const t=r.elements;return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ja(r){const t=r.elements;return Math.sqrt(t[3]*t[3]+t[4]*t[4])}function nu(r,t,e){let A,i,s,n,o;const a=r+e,l=r-e,c=Math.sqrt(l*l+4*t*t);return a>0?(A=.5*(a+c),o=1/A,i=r*o*e-t*o*t):a<0?i=.5*(a-c):(A=.5*c,i=-.5*c),l>0?s=l+c:s=l-c,Math.abs(s)>2*Math.abs(t)?(o=-2*t/s,n=1/Math.sqrt(1+o*o),s=o*n):Math.abs(t)===0?(s=1,n=0):(o=-.5*s/t,s=1/Math.sqrt(1+o*o),n=o*s),l>0&&(o=s,s=-n,n=o),{rt1:A,rt2:i,cs:s,sn:n}}class ou extends Hs{constructor(t=0,e=0,A=1,i=0,s=Math.PI*2,n=!1){super(new G(t,e),new G(A,A),new G,0,i,s,n)}drawTo(t){const{cx:e,cy:A,rx:i,startAngle:s,endAngle:n,clockwise:o}=this;return t.arc(e,A,i,s,n,!o),this}}class Ve extends JA{constructor(t=new G,e=new G){super(),this.p1=t,this.p2=e}static from(t,e,A,i){return new Ve(new G(t,e),new G(A,i))}getPoint(t,e=new G){return t===1?e.copy(this.p2):e.copy(this.p2).sub(this.p1).scale(t).add(this.p1),e}getPointAt(t,e=new G){return this.getPoint(t,e)}getTangent(t,e=new G){return e.subVectors(this.p2,this.p1).normalize()}getTangentAt(t,e=new G){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=G.MAX,e=G.MIN){const{p1:A,p2:i}=this;return t.x=Math.min(t.x,A.x,i.x),t.y=Math.min(t.y,A.y,i.y),e.x=Math.max(e.x,A.x,i.x),e.y=Math.max(e.y,A.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),A=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),n=e,o=i,a=A-e||t.style?.strokeWidth||0,l=s-i||t.style?.strokeWidth||0;return[n,o,n+a,o,n+a,o+l,n,o+l]}drawTo(t){const{p1:e,p2:A}=this;return t.lineTo(e.x,e.y),t.lineTo(A.x,A.y),this}copy(t){return super.copy(t),this.p1.copy(t.p1),this.p2.copy(t.p2),this}}class di extends JA{constructor(t=[]){super(),this.curves=t}getFlatCurves(){return this.curves.flatMap(t=>t instanceof di?t.getFlatCurves():t)}addCurve(t){return this.curves.push(t),this}getPoint(t,e=new G){const A=t*this.getLength(),i=this.getLengths();let s=0;for(;s<i.length;){if(i[s]>=A){const n=i[s]-A,o=this.curves[s],a=o.getLength();return o.getPointAt(a===0?0:1-n/a,e)}s++}return e}updateLengths(){const t=[];for(let e=0,A=0,i=this.curves.length;e<i;e++)A+=this.curves[e].getLength(),t.push(A);this._arcLengths=t}getControlPointRefs(){return this.curves.flatMap(t=>t.getControlPointRefs())}_removeNextPointIfEqualPrevPoint(t,e){const A=[t[e-1],t[e]],i=[t[e+1],t[e+2]];return A[0]===i[0]&&A[1]===i[1]&&t.splice(e+1,2),t}getSpacedVertices(t=5,e=[]){let A;return this.curves.forEach(i=>{i.getSpacedVertices(t,e),A&&this._removeNextPointIfEqualPrevPoint(e,A),A=e.length-1}),e}getAdaptiveVertices(t=[]){let e;return this.curves.forEach(A=>{A.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 A;return this.curves.forEach(i=>{let s;i instanceof Ve?s=i.getAdaptiveVertices():s=i.getFillVertices(t),e.push(...s),A&&this._removeNextPointIfEqualPrevPoint(e,A),A=e.length-1}),e}}applyTransform(t){return this.curves.forEach(e=>e.applyTransform(t)),this}getMinMax(t=G.MAX,e=G.MIN){return this.curves.forEach(A=>A.getMinMax(t,e)),{min:t.finite(),max:e.finite()}}getBoundingBox(){const{min:t,max:e}=this.getMinMax();return new ct(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(A=>A.drawTo(t)),this}copy(t){return super.copy(t),this.curves=t.curves.map(e=>e.clone()),this}}class Js extends JA{constructor(t=new G,e=new G,A=new G,i=new G){super(),this.p1=t,this.cp1=e,this.cp2=A,this.p2=i}static from(t,e,A,i,s,n,o,a){return new Js(new G(t,e),new G(A,i),new G(s,n),new G(o,a))}getPoint(t,e=new G){const{p1:A,cp1:i,cp2:s,p2:n}=this;return e.set(ka(t,A.x,i.x,s.x,n.x),ka(t,A.y,i.y,s.y,n.y))}getAdaptiveVertices(t=[]){return Gg(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,A){const i=e*e-4*t*A;if(i<0)return[];const s=Math.sqrt(i),n=(-e+s)/(2*t),o=(-e-s)/(2*t);return[n,o].filter(a=>a>=0&&a<=1)}getMinMax(t=G.MAX,e=G.MIN){const{p1:A,cp1:i,cp2:s,p2:n}=this,o=this._solveQuadratic(3*(i.x-A.x),6*(s.x-i.x),3*(n.x-s.x)),a=this._solveQuadratic(3*(i.y-A.y),6*(s.y-i.y),3*(n.y-s.y)),l=[0,1,...o,...a];return((h,u)=>{for(const d of h)for(let f=0;f<=u;f++){const B=f/u-.5,p=Math.min(1,Math.max(0,d+B)),D=this.getPoint(p);t.x=Math.min(t.x,D.x),t.y=Math.min(t.y,D.y),e.x=Math.max(e.x,D.x),e.y=Math.max(e.y,D.y)}})(l,10),{min:t.finite(),max:e.finite()}}toCommands(){const{p1:t,cp1:e,cp2:A,p2:i}=this;return[{type:"M",x:t.x,y:t.y},{type:"C",x1:e.x,y1:e.y,x2:A.x,y2:A.y,x:i.x,y:i.y}]}drawTo(t){const{p1:e,cp1:A,cp2:i,p2:s}=this;return t.lineTo(e.x,e.y),t.bezierCurveTo(A.x,A.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 au extends Hs{constructor(t=0,e=0,A=1,i=1,s=0,n=0,o=Math.PI*2,a=!1){super(new G(t,e),new G(A,i),new G,s,n,o,a)}drawTo(t){return t.ellipse(this.cx,this.cy,this.rx,this.ry,this.rotate,this.startAngle,this.endAngle,!this.clockwise),this}}class lu extends di{}class Ks extends JA{constructor(t=new G,e=new G,A=new G){super(),this.p1=t,this.cp=e,this.p2=A}static from(t,e,A,i,s,n){return new Ks(new G(t,e),new G(A,i),new G(s,n))}getPoint(t,e=new G){const{p1:A,cp:i,p2:s}=this;return e.set(Na(t,A.x,i.x,s.x),Na(t,A.y,i.y,s.y)),e}getControlPointRefs(){return[this.p1,this.cp,this.p2]}getAdaptiveVertices(t=[]){return Kg(this.p1.x,this.p1.y,this.cp.x,this.cp.y,this.p2.x,this.p2.y,.5,t)}getMinMax(t=G.MAX,e=G.MIN){const{p1:A,cp:i,p2:s}=this,n=.5*(A.x+i.x),o=.5*(A.y+i.y),a=.5*(A.x+s.x),l=.5*(A.y+s.y);return t.x=Math.min(t.x,A.x,s.x,n,a),t.y=Math.min(t.y,A.y,s.y,o,l),e.x=Math.max(e.x,A.x,s.x,n,a),e.y=Math.max(e.y,A.y,s.y,o,l),{min:t.finite(),max:e.finite()}}toCommands(){const{p1:t,cp:e,p2:A}=this;return[{type:"M",x:t.x,y:t.y},{type:"Q",x1:e.x,y1:e.y,x:A.x,y:A.y}]}drawTo(t){const{p1:e,cp:A,p2:i}=this;return t.lineTo(e.x,e.y),t.quadraticCurveTo(A.x,A.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 cu extends lu{constructor(t=0,e=0,A=0,i=0){super(),this.x=t,this.y=e,this.width=A,this.height=i,this.update()}update(){const{x:t,y:e,width:A,height:i}=this,s=[new G(t,e),new G(t+A,e),new G(t+A,e+i),new G(t,e+i)];return this.curves=[new Ve(s[0],s[1]),new Ve(s[1],s[2]),new Ve(s[2],s[3]),new Ve(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:A,width:i,height:s}=this;return[e,A,e+i,A,e+i,A+s,e,A+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 hu extends Hs{constructor(t=0,e=0,A=1,i=1,s=1){super(),this.x=t,this.y=e,this.width=A,this.height=i,this.radius=s,this.update()}update(){const{x:t,y:e,width:A,height:i,radius:s}=this,n=A/2,o=i/2,a=t+n,l=e+o,c=Math.max(0,Math.min(s,Math.min(n,o))),h=c;return this._center=new G(a,l),this._radius=new G(c,h),this._diff=new G(n-c,o-h),this}drawTo(t){const{x:e,y:A,width:i,height:s,radius:n}=this;return t.roundRect(e,A,i,s,n),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 gu extends JA{constructor(t=[]){super(),this.points=t}getPoint(t,e=new G){const{points:A}=this,i=(A.length-1)*t,s=Math.floor(i),n=i-s,o=A[s===0?s:s-1],a=A[s],l=A[s>A.length-2?A.length-1:s+1],c=A[s>A.length-3?A.length-1:s+2];return e.set(Ra(n,o.x,a.x,l.x,c.x),Ra(n,o.y,a.y,l.y,c.y)),e}getControlPointRefs(){return this.points}copy(t){super.copy(t),this.points=[];for(let e=0,A=t.points.length;e<A;e++)this.points.push(t.points[e].clone());return this}}class ur extends di{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,A=t.length;e<A;e++){const{x:i,y:s}=t[e];this.lineTo(i,s)}return this}addCommands(t){return ma(t,this),this}addData(t){return this.addCommands(wa(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 G(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 Ve(e.clone(),t.clone())),e.copy(t)),this.startPoint=void 0}return this}moveTo(t,e){return this.currentPoint=new G(t,e),this.startPoint=this.currentPoint.clone(),this}lineTo(t,e){const A=this.currentPoint;return A?.equals({x:t,y:e})||this.curves.push(Ve.from(A?.x??0,A?.y??0,t,e)),this._setCurrentPoint({x:t,y:e}),this}bezierCurveTo(t,e,A,i,s,n){const o=this.currentPoint;return o?.equals({x:s,y:n})||this.curves.push(Js.from(o?.x??0,o?.y??0,t,e,A,i,s,n)),this._setCurrentPoint({x:s,y:n}),this}quadraticCurveTo(t,e,A,i){const s=this.currentPoint;return s?.equals({x:A,y:i})||this.curves.push(Ks.from(s?.x??0,s?.y??0,t,e,A,i)),this._setCurrentPoint({x:A,y:i}),this}arc(t,e,A,i,s,n){const o=new ou(t,e,A,i,s,!n);return this._connetLineTo(o),this.curves.push(o),this._setCurrentPoint(o.getPoint(1)),this}relativeArc(t,e,A,i,s,n){return t+=this.currentPoint?.x??0,e+=this.currentPoint?.y??0,this.arc(t,e,A,i,s,n),this}arcTo(t,e,A,i,s){return console.warn("Method arcTo not supported yet"),this}ellipse(t,e,A,i,s,n,o,a=!0){const l=new au(t,e,A,i,s,n,o,!a);return this._connetLineTo(l),this.curves.push(l),this._setCurrentPoint(l.getPoint(1)),this}relativeEllipse(t,e,A,i,s,n,o,a){return t+=this.currentPoint?.x??0,e+=this.currentPoint?.y??0,this.ellipse(t,e,A,i,s,n,o,a),this}rect(t,e,A,i){const s=new cu(t,e,A,i);return this._connetLineTo(s),this.curves.push(s),this._setCurrentPoint({x:t,y:e}),this}roundRect(t,e,A,i,s){const n=new hu(t,e,A,i,s);return this._connetLineTo(n),this.curves.push(n),this._setCurrentPoint({x:t,y:e}),this}splineThru(t){const e=this.currentPoint??new G;return this.curves.push(new gu([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(A=>A.drawTo(t)),this.autoClose&&t.closePath(),this}copy(t){return super.copy(t),this.autoClose=t.autoClose,this.currentPoint=t.currentPoint?.clone(),this}}class kt extends di{currentCurve=new ur;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 kt?this.addPath(t):Array.isArray(t)?this.addCommands(t):this.addData(t))}addPath(t){const e=this.curves.findIndex(A=>A===this.currentCurve);return e>-1&&this.curves.splice(e,1),t instanceof kt?this.curves.push(...t.curves.filter(A=>A.curves.length).map(A=>A.clone())):t.curves.length&&this.curves.push(t),this.curves.push(this.currentCurve),this}closePath(){const t=this.startPoint;return t&&(this.currentCurve.closePath(),this.currentCurve.curves.length&&(this.currentCurve=new ur().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 ur,this.curves.push(this.currentCurve)),this.currentCurve.moveTo(t,e)),this}lineTo(t,e){return this.currentCurve.lineTo(t,e),this}bezierCurveTo(t,e,A,i,s,n){return this.currentCurve.bezierCurveTo(t,e,A,i,s,n),this}quadraticCurveTo(t,e,A,i){return this.currentCurve.quadraticCurveTo(t,e,A,i),this}arc(t,e,A,i,s,n){return this.currentCurve.arc(t,e,A,i,s,n),this}arcTo(t,e,A,i,s){return this.currentCurve.arcTo(t,e,A,i,s),this}ellipse(t,e,A,i,s,n,o,a){return this.currentCurve.ellipse(t,e,A,i,s,n,o,a),this}rect(t,e,A,i){return this.currentCurve.rect(t,e,A,i),this}roundRect(t,e,A,i,s){return this.currentCurve.roundRect(t,e,A,i,s),this}reset(){return this.currentCurve=new ur,this.curves=[this.currentCurve],this.style={},this}addCommands(t){return ma(t,this),this}addData(t){return this.addCommands(wa(t)),this}splineThru(t){return this.currentCurve.splineThru(t),this}scale(t,e=t,A={x:0,y:0}){return this.getControlPointRefs().forEach(i=>{i.scale(t,e,A)}),this}skew(t,e=0,A={x:0,y:0}){return this.getControlPointRefs().forEach(i=>{i.skew(t,e,A)}),this}rotate(t,e={x:0,y:0}){return this.getControlPointRefs().forEach(A=>{A.rotate(t,e)}),this}bold(t){if(t===0)return this;const e=this.getFlatCurves(),A=[],i=[],s=[];e.forEach((o,a)=>{const l=o.getControlPointRefs(),c=o.isClockwise();s[a]=l,i[a]=c;const h=l[0],u=l[l.length-1]??h;A.push({start:c?u:h,end:c?h:u,index:a})});const n=[];return A.forEach((o,a)=>{n[a]=[],A.forEach((l,c)=>{l.start&&o.end&&c!==a&&l.start?.equals(o.end)&&n[a].push(l.index)})}),e.forEach((o,a)=>{const l=i[a];s[a].forEach(c=>{c.add(o.getNormal(o.getTForPoint(c)).scale(l?t:-t))})}),n.forEach((o,a)=>{const l=s[a];o.forEach(c=>{const h=s[c],u=Vg(l[l.length-1],l[l.length-2]??l[l.length-1],h[0],h[1]??h[0]);u&&(l[l.length-1].copy(u),h[0].copy(u))})}),this}getMinMax(t=G.MAX,e=G.MIN,A=!0){const i=this.strokeWidth;return this.curves.forEach(s=>{if(s.getMinMax(t,e),A&&i>1){const n=i/2,o=s.isClockwise(),a=[];for(let l=0;l<=1;l+=1/s.arcLengthDivision){const c=s.getPoint(l),h=s.getNormal(l),u=h.clone().scale(o?n:-n),d=h.clone().scale(o?-n:n);a.push(c.clone().add(u),c.clone().add(d),c.clone().add({x:n,y:0}),c.clone().add({x:-n,y:0}),c.clone().add({x:0,y:n}),c.clone().add({x:0,y:-n}),c.clone().add({x:n,y:n}),c.clone().add({x:-n,y:-n}))}t.min(...a),e.max(...a)}}),{min:t.finite(),max:e.finite()}}strokeTriangulate(t){const e=t?.indices??[],A=t?.vertices??[];return this.curves.forEach(i=>{i.strokeTriangulate({...t,indices:e,vertices:A,style:{...this.style}})}),{indices:e,vertices:A}}fillTriangulate(t){const e={...t,style:{...this.style,...t?.style}},A=e.indices??[],i=e.vertices??[];if((e.style.fillRule??"nonzero")==="nonzero"){const n=this.curves.map(l=>l.getFillVertices(e)),o=qg(n),a=o.length;for(let l=0;l<a;l++){const c=o[l],h=n[l];if(c.wn||!h.length)continue;const u=h.slice(),d=[];for(let f=0;f<a;f++){const B=o[f];B.parentIndex===l&&(d.push(u.length/2),u.push(...n[B.index]))}Pa(u,{...t,indices:A,vertices:i,holes:d,style:{...this.style}})}}else this.curves.forEach(n=>{n.fillTriangulate({...t,indices:A,vertices:i,style:{...this.style}})});return{indices:A,vertices:i}}getBoundingBox(t=!0){const{min:e,max:A}=this.getMinMax(void 0,void 0,t);return new ct(e.x,e.y,A.x-e.x,A.y-e.y)}drawTo(t,e={}){e={...this.style,...e};const{fill:A="#000",stroke:i="none"}=e;return t.beginPath(),t.save(),Us(t,e),this.curves.forEach(s=>{s.drawTo(t)}),A!=="none"&&t.fill(),i!=="none"&&t.stroke(),t.restore(),this}drawControlPointsTo(t,e={}){e={...this.style,...e};const{fill:A="#000",stroke:i="none"}=e;return t.beginPath(),t.save(),Us(t,e),this.getControlPointRefs().forEach(s=>{fg(t,s.x,s.y,{radius:4})}),A!=="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[Yg(i)]=t[i]);Object.assign(e,{"stroke-width":`${this.strokeWidth}px`});let A="";for(const i in e)e[i]!==void 0&&(A+=`${i}:${e[i]};`);return`<path d="${this.toData()}" style="${A}"></path>`}copy(t){return super.copy(t),this.currentCurve=t.currentCurve.clone(),this.style={...t.style},this}}class We{constructor(t=[],e){this.paths=t,this.viewBox=e}getBoundingBox(t=!0){if(!this.paths.length)return;const e=G.MAX,A=G.MIN;return this.paths.forEach(i=>i.getMinMax(e,A,t)),new ct(e.x,e.y,A.x-e.x,A.y-e.y)}toTriangulatedSvgString(t=this.paths.map(A=>A.fillTriangulate()),e=0){let A="";const i={x:-e,y:-e},s={x:e,y:e};(Array.isArray(t)?t:[t]).forEach(({vertices:a,indices:l})=>{const c=h=>{const u=a[h*2],d=a[h*2+1];return i.x=Math.min(i.x,u+e),s.x=Math.max(s.x,u+e),i.y=Math.min(i.y,d+e),s.y=Math.max(s.y,d+e),[u,d]};for(let h=0,u=l.length;h<u;h+=3){const d=c(l[h]),f=c(l[h+1]),B=c(l[h+2]);A+=`<polygon points="${d.join(",")} ${f.join(",")} ${B.join(",")}" stroke="none" fill="black" />`}});const o=[i.x,i.y,s.x-i.x,s.y-i.y];return`<svg width="${o[2]}" height="${o[3]}" viewBox="${o.join(" ")}" xmlns="http://www.w3.org/2000/svg">${A}</svg>`}toTriangulatedSvg(t,e){return new DOMParser().parseFromString(this.toTriangulatedSvgString(t,e),"image/svg+xml").documentElement}toSvgString(){const{x:t,y:e,width:A,height:i}=this.getBoundingBox(),s=this.paths.map(n=>n.toSvgPathString()).join("");return`<svg viewBox="${t} ${e} ${A} ${i}" width="${A}px" height="${i}px" xmlns="http://www.w3.org/2000/svg">${s}</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,...A}=t,{left:i,top:s,width:n,height:o}=this.getBoundingBox(),a=document.createElement("canvas");a.width=n*e,a.height=o*e,a.style.width=`${n}px`,a.style.height=`${o}px`;const l=a.getContext("2d");return l&&(l.scale(e,e),l.translate(-i,-s),this.paths.forEach(c=>{c.drawTo(l,A)})),a}}class fr extends Ye{vertexAttributes;indexBuffer;instanceCount;mode;_materialWeakMap=new bs;constructor(t={}){super(),this.vertexAttributes=new Map(Object.entries(t?.vertexAttributes??{})),this.indexBuffer=t?.indexBuffer,this.instanceCount=t?.instanceCount,this.mode=t?.mode??"triangles"}_glVertexArray(t){return{attributes:Object.fromEntries(Array.from(this.vertexAttributes).map(([e,A])=>[e,{buffer:A.buffer._glBuffer(t),size:A.size,type:A.type,normalized:A.normalized,stride:A.stride,offset:A.offset,divisor:A.divisor}])),elementArrayBuffer:this.indexBuffer?._glBuffer(t)}}_glVertexArrayObject(t,e){let A=this._materialWeakMap.get(e);return A||(A={material:e.instanceId,geometry:this.instanceId},this._materialWeakMap.set(e,A)),t.getRelated(A,()=>t.vertexArray.create(e._glProgram(t),this._glVertexArray(t)))}draw(t,e,A){t.flush(),e.activate(t,A);const i=this._glVertexArrayObject(t,e);let s=!1,n;this.vertexAttributes.forEach(o=>{n?.instanceId!==o.buffer.instanceId&&(n=o.buffer,n.upload(t)&&(s=!0)),o.upload()&&(s=!0)}),this.indexBuffer?.upload(t)&&(s=!0),s&&i&&t.vertexArray.update(e._glProgram(t),i,this._glVertexArray(t)),t.vertexArray.bind(i??this._glVertexArray(t)),t.draw({mode:this.mode,instanceCount:this.instanceCount}),t.vertexArray.unbind()}}var uu=Object.defineProperty,Ka=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&uu(t,e,i),i};class KA extends Ye{needsUpload=!1;constructor(t){super(),this.setProperties(t)}_glBufferOptions(){return{target:"element_array_buffer",data:this.data,usage:this.dynamic?"dynamic_draw":"static_draw"}}_glBuffer(t){return t.getRelated(this,()=>t.buffer.create(this._glBufferOptions()))}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"data":case"dynamic":this.needsUpload=!0;break}}upload(t){const e=this.needsUpload;return e&&(this.needsUpload=!1,t.buffer.update(this._glBuffer(t),this._glBufferOptions())),e}}Ka([v({protected:!0,default:null})],KA.prototype,"data"),Ka([v({protected:!0,fallback:!1})],KA.prototype,"dynamic");var fu=Object.defineProperty,Ya=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&fu(t,e,i),i};class ze extends Ye{needsUpload=!1;constructor(t){super(),this.setProperties(t)}_glBufferOptions(){return{target:"array_buffer",data:this.data,usage:this.dynamic?"dynamic_draw":"static_draw"}}_glBuffer(t){return t.getRelated(this,()=>t.buffer.create(this._glBufferOptions()))}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"data":case"dynamic":this.needsUpload=!0;break}}upload(t){const e=this.needsUpload;return e&&(this.needsUpload=!1,t.buffer.update(this._glBuffer(t),this._glBufferOptions())),e}}Ya([v({protected:!0,default:null})],ze.prototype,"data"),Ya([v({protected:!0,fallback:!1})],ze.prototype,"dynamic");var du=Object.defineProperty,wA=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&du(t,e,i),i};class ce extends Ye{needsUpload=!1;constructor(t){super(),this.setProperties({buffer:new ze,...t})}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"buffer":case"size":case"normalized":case"type":case"stride":case"offset":case"divisor":this.needsUpload=!0;break}}upload(){const t=this.needsUpload;return t&&(this.needsUpload=!1),t}}wA([v({protected:!0})],ce.prototype,"buffer"),wA([v({fallback:0})],ce.prototype,"size"),wA([v({fallback:!1})],ce.prototype,"normalized"),wA([v({fallback:"float"})],ce.prototype,"type"),wA([v()],ce.prototype,"stride"),wA([v()],ce.prototype,"offset"),wA([v()],ce.prototype,"divisor");class Iu extends fr{constructor(){super({vertexAttributes:{position:new ce({buffer:new ze({data:new Float32Array([0,0,1,0,1,1,0,1]),dynamic:!1}),size:2,normalized:!1,type:"float"})},indexBuffer:new KA({data:new Uint16Array([0,1,3,2]),dynamic:!1}),mode:"triangle_strip"})}}class Ct extends Ye{static instance=new this;vert;frag;uniforms;constructor(t={}){super(),this.vert=t.vert??`precision highp float;
|
|
71
|
+
}`}),i=t.buffer.create({target:"array_buffer",data:new Float32Array(1),usage:"dynamic_draw"}),n=t.buffer.create({target:"element_array_buffer",data:new Uint16Array(1),usage:"dynamic_draw"}),o={attributes:Object.fromEntries(Object.entries(this._attributes).map(([c,h])=>[c,{...h,buffer:i}])),elementArrayBuffer:n},a=t.vertexArray.create(r,o),l=new Int32Array(Array.from({length:e},(c,h)=>h));return{update:(c,h)=>{t.vertexArray.bind(a??o),t.buffer.update(i,{target:"array_buffer",data:c}),t.buffer.update(n,{target:"element_array_buffer",data:h})},draw:c=>{const h=this._renderer;h.program.bind(r),h.program.updateUniforms(r,{samplers:l,modulate:[1,1,1,1],canvasWidth:h.gl.drawingBufferWidth,canvasHeight:h.gl.drawingBufferHeight,...h.program.uniforms}),h.vertexArray.bind(a??o),h.draw(c)}}}render(e){const{vertices:t,indices:r}=e,i=t.length/2;this._vertexCount+i>this._batchSize&&this.flush(),this._vertexCount+=i,this._indexCount+=r.length,this._batchables.push(e)}flush(){if(super.flush(),this._vertexCount===0)return;const e=this._vertexCount,t=this._indexCount,r=this._batchables;this._batchables=[],this._vertexCount=0,this._indexCount=0;const i=this._renderer.texture.maxUnits,n=this._getAttributeBuffer(e),o=new Float32Array(n),a=new Uint32Array(n),l=this._getIndexBuffer(t);let c=0,h=0;const f=[];for(let g=r.length,p={id:++this._drawCallUid},y=[],m=new Map,P=0,E=0,x=0;x<g;x++){const C=r[x].texture,v=x===g-1;if(!C||m.has(C)){if(!v)continue}else y.push(C),m.set(C,P++);if(v||P>=i){p.textures=y,p.textureLocationMap=m,P=0,p.first=h;for(let b=E;b<=x;b++){const{indices:S,vertices:T,uvs:R=[],texture:G,modulate:U=this._defaultModulate,backgroundColor:L=this._defaultBackgroundColor,blendMode:V=lr.NORMAL,disableWrapMode:B=!1}=r[b];E<b&&p.blendMode!==V&&(p.count=h-p.first,f.push(p),E=b,p={id:++this._drawCallUid},p.textures=y,p.first=h);const k=c/this._vertexSize,H=(G?m.get(G):255)??255,D=B?1:0;for(let N=T.length,$=0;$<N;$+=2)o[c++]=H,o[c++]=T[$],o[c++]=T[$+1],o[c++]=R[$],o[c++]=R[$+1],a[c++]=U,a[c++]=L,a[c++]=D;for(let N=S.length,$=0;$<N;$++)l[h++]=k+S[$];p.blendMode=V}E=x+1,p.count=h-p.first,f.push(p),p={id:++this._drawCallUid},y=[],m=new Map}}const d=this._getShader(i);d.update(n,l);for(let g=f.length,p=0;p<g;p++){const y=f[p],{first:m=0,textures:P,textureLocationMap:E}=y;for(let x=P.length,C=0;C<x;C++){const v=P[C],b=E.get(v);b!==void 0&&this._renderer.texture.bind({target:"texture_2d",location:b,value:v})}this._state.blendMode=y.blendMode,this._renderer.state.bind(this._state),d.draw({mode:"triangles",count:y.count,first:m,bytesPerElement:2})}}_getAttributeBuffer(e){const t=Ds(Math.ceil(e/8)),r=Is(t),i=t*8;this._attributeBuffer.length<=r&&(this._indexBuffers.length=r+1);let n=this._attributeBuffer[i];return n||(this._attributeBuffer[i]=n=new ArrayBuffer(i*this._vertexSize*4)),n}_getIndexBuffer(e){const t=Ds(Math.ceil(e/12)),r=Is(t),i=t*12;this._indexBuffers.length<=r&&(this._indexBuffers.length=r+1);let n=this._indexBuffers[r];return n||(this._indexBuffers[r]=n=new Uint16Array(i)),n}}function Ds(s){return s+=s===0?1:0,--s,s|=s>>>1,s|=s>>>2,s|=s>>>4,s|=s>>>8,s|=s>>>16,s+1}function Is(s){let e=(s>65535?1:0)<<4;s>>>=e;let t=(s>255?1:0)<<3;return s>>>=t,e|=t,t=(s>15?1:0)<<2,s>>>=t,e|=t,t=(s>3?1:0)<<1,s>>>=t,e|=t,e|s>>1}class qo extends Ye{install(e){super.install(e),e.buffer=this}boundArrayBuffer=null;boundTarget="array_buffer";create(e){const t=this.gl.createBuffer();if(!t)throw new Error("failed to create");return e&&(this.bind({target:e.target,value:t}),this.update(e)),t}getMeta(e){return this._renderer.getRelated(e,()=>({id:yo(e),length:0,byteLength:0,bytesPerElement:0}))}update(...e){if(e.length>1){this.bind({target:e[1].target,value:e[0]}),this.update(e[1]);return}const t=e[0],r=(t.target??this.boundTarget)==="array_buffer"?this.boundArrayBuffer:this._renderer.vertexArray.boundVertexArray.elementArrayBuffer;if(!r)return;const i=this.getMeta(r);Object.assign(i,{target:t.target,usage:t.usage});const n=i.target??this.boundTarget,o=i.usage??"static_draw",a=t.data,l=this.gl;let c;Array.isArray(a)?n==="array_buffer"?c=new Float32Array(a):c=new Uint32Array(a):c=a;const h=this._renderer.getBindPoint(n);c&&c.byteLength<=i.byteLength?l.bufferSubData(h,0,c):(l.bufferData(h,c,this._renderer.getBindPoint(o)),i.length=c?.length??0,i.byteLength=c?.byteLength??0,i.bytesPerElement=i.length?i.byteLength/i.length:0)}bind(e){let{target:t,value:r}=e;if(r){const n=this.getMeta(r);t??=n.target??this.boundTarget,n.target=t}else t??=this.boundTarget;const i=this._renderer.getBindPoint(t);this._renderer.gl.bindBuffer(i,r),t==="array_buffer"?this.boundArrayBuffer=r:this._renderer.vertexArray.boundVertexArray.elementArrayBuffer=r,this.boundTarget=t}unbind(e){return this.bind({target:e,value:null})}reset(){super.reset(),this.boundArrayBuffer=null,this.boundTarget="array_buffer"}}class Xo extends Ye{install(e){super.install(e),e.framebuffer=this}boundFramebuffer=null;_msaaSamples=[];_hasMRT=!0;_writeDepthTexture=!0;onUpdateContext(){if(this._hasMRT=!0,this._writeDepthTexture=!0,this._renderer.version===1){const e=this._renderer.gl,t=this._renderer.extensions.drawBuffers,r=this._renderer.extensions.depthTexture;t?e.drawBuffers=i=>t.drawBuffersWEBGL(i):(this._hasMRT=!1,e.drawBuffers=()=>{}),r||(this._writeDepthTexture=!1)}else{const e=this._renderer.gl;this._msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)}}create(e){const t=this._renderer.gl.createFramebuffer();if(!t)throw new Error("Unable to create framebuffer");return e&&(this.bind(t),this.update(e)),t}getMeta(e){return this._renderer.getRelated(e,()=>({width:0,height:0,mipLevel:0,stencil:!1,depth:!1,depthTexture:null,colorTextures:[],multisample:0}))}update(...e){if(e.length>1)return this.bind(e[0]),this.update(e[1]);const t=this.boundFramebuffer;if(!t)return;const r=e[0],i=this.getMeta(t);Object.assign(i,{...r});const n=this._renderer.gl;let o=i.colorTextures.length;"drawBuffers"in n||(o=Math.min(o,1));for(let a=0;a<o;a++){const l=i.colorTextures[a];this._renderer.texture.bind({location:0,target:"texture_2d",value:l,forceUpdateLocation:!0}),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+a,n.TEXTURE_2D,l,i.mipLevel),this._renderer.texture.unbind(l)}if(o>1&&n.drawBuffers(i.colorTextures.map((a,l)=>n.COLOR_ATTACHMENT0+l)),i.depthTexture&&(this._renderer.version>1||this._renderer.extensions.depthTexture)&&(this._renderer.texture.bind({location:0,target:"texture_2d",value:i.depthTexture,forceUpdateLocation:!0}),n.framebufferTexture2D(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.TEXTURE_2D,i.depthTexture,i.mipLevel),this._renderer.texture.unbind(i.depthTexture)),(i.stencilBuffer||i.stencil||i.depth)&&!(i.depthTexture&&this._writeDepthTexture)){i.stencilBuffer??=n.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,i.stencilBuffer);const{attachment:a,format:l}=this._getAttachmentAndFormat(i);i.msaaBuffer?n.renderbufferStorageMultisample(n.RENDERBUFFER,i.multisample,l,i.width,i.height):n.renderbufferStorage(n.RENDERBUFFER,l,i.width*this._renderer.pixelRatio,i.height*this._renderer.pixelRatio),n.framebufferRenderbuffer(n.FRAMEBUFFER,a,n.RENDERBUFFER,i.stencilBuffer)}else i.stencilBuffer&&(n.deleteRenderbuffer(i.stencilBuffer),i.stencilBuffer=null)}_getAttachmentAndFormat(e){const t=this.gl;let r,i;return this._renderer.version===1?(r=t.DEPTH_STENCIL_ATTACHMENT,i=t.DEPTH_STENCIL):e.depth&&e.stencil?(r=t.DEPTH_STENCIL_ATTACHMENT,i=t.DEPTH24_STENCIL8):e.depth?(r=t.DEPTH_ATTACHMENT,i=t.DEPTH_COMPONENT24):(r=t.STENCIL_ATTACHMENT,i=t.STENCIL_INDEX8),{attachment:r,format:i}}resize(e,t,r){const i=this.gl,n=this.getMeta(e);if(Object.assign(n,{width:t,height:r}),n.stencil){const{format:a}=this._getAttachmentAndFormat(n);i.bindRenderbuffer(i.RENDERBUFFER,n.stencil),n.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,a,n.width,n.height):i.renderbufferStorage(i.RENDERBUFFER,a,n.width,n.height)}let o=n.colorTextures.length;i.drawBuffers||(o=Math.min(o,1));for(let a=0;a<o;a++){const l=n.colorTextures[a];this._renderer.texture.update(l,{value:{pixels:null,width:n.width,height:n.height}}),a===0&&n.msaaBuffer&&(i.bindRenderbuffer(i.RENDERBUFFER,n.msaaBuffer),i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,i.RGBA,n.width,n.height))}n.depthTexture&&this._renderer.texture.update(n.depthTexture,{value:{pixels:null,width:n.width,height:n.height}})}bind(e){const t=this._renderer.gl,r=e;if({value:this.boundFramebuffer!==r}.value&&(t.bindFramebuffer(t.FRAMEBUFFER,r),this.boundFramebuffer=r),r){const o=this.getMeta(r);for(let c=0;c<o.colorTextures.length;c++)this._renderer.texture.unbind(o.colorTextures[c]);o.depthTexture&&this._renderer.texture.unbind(o.depthTexture);const a=o.width>>o.mipLevel,l=o.height>>o.mipLevel;this._renderer.viewport.bind({x:0,y:0,width:a*this._renderer.pixelRatio,height:l*this._renderer.pixelRatio})}else this._renderer.viewport.bind({x:0,y:0,width:this._renderer.screen.width*this._renderer.pixelRatio,height:this._renderer.screen.height*this._renderer.pixelRatio})}forceStencil(){const e=this.boundFramebuffer;if(!e)return;const t=this.getMeta(e);if(!t||t.stencilBuffer)return;const r=this._renderer.gl;t.stencilBuffer=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,t.stencilBuffer);let i,n;this._renderer.version===1?(i=r.DEPTH_STENCIL_ATTACHMENT,n=r.DEPTH_STENCIL):t.depth?(i=r.DEPTH_STENCIL_ATTACHMENT,n=r.DEPTH24_STENCIL8):(i=r.STENCIL_ATTACHMENT,n=r.STENCIL_INDEX8),t.msaaBuffer?r.renderbufferStorageMultisample(r.RENDERBUFFER,t.multisample,n,t.width*this._renderer.pixelRatio,t.height*this._renderer.pixelRatio):r.renderbufferStorage(r.RENDERBUFFER,n,t.width*this._renderer.pixelRatio,t.height*this._renderer.pixelRatio),r.framebufferRenderbuffer(r.FRAMEBUFFER,i,r.RENDERBUFFER,t.stencilBuffer)}reset(){super.reset(),this.boundFramebuffer=null}}class Ho extends Ye{install(e){super.install(e),e.mask=this}stack=[];get length(){return this.stack.length}get last(){return this.stack[this.length-1]}push(e,t){const r={source:e,mask:t};this.stack.push(r),typeof r.mask=="number"?this.pushColorMask(r):"render"in r.mask?this._renderer.stencil.push(r):this._renderer.scissor.push(r)}pop(e){const t=this.stack.pop();!t||t.source!==e||(typeof t.mask=="number"?this.popColorMask(t):"render"in t.mask?this._renderer.stencil.pop(t):this._renderer.scissor.pop(t))}pushColorMask(e){const t=e.preComputedColor??15,r=e.preComputedColor=t&e.mask;r!==t&&this.useColorMask(r)}popColorMask(e){const t=e.preComputedColor??15,r=this.length>0?this.last.preComputedColor??15:15;r!==t&&this.useColorMask(r)}useColorMask(e){this._renderer.gl.colorMask((e&1)!==0,(e&2)!==0,(e&4)!==0,(e&8)!==0)}}class Yo extends Ye{install(e){super.install(e),e.program=this}boundProgram=null;uniforms={projectionMatrix:[1,0,0,0,1,0,0,0,1],viewMatrix:[1,0,0,0,1,0,0,0,1]};create(e){const t=this.gl.createProgram();if(!t)throw new Error("Unable to create program");return e&&this.update(t,e),t}getMeta(e){return this._renderer.getRelated(e,()=>({attributes:new Map,uniforms:new Map,boundUniforms:new oo}))}update(...e){if(e.length>1){const l=this.boundProgram;this.boundProgram=e[0],this.update(e[1]),this.boundProgram=l;return}const t=e[0],r=this.boundProgram;if(!r)return;const i=this.gl,n=this.getMeta(r),o=this.createShader(t.vert,"vertex_shader"),a=this.createShader(t.frag,"fragment_shader");if(i.attachShader(r,o),i.attachShader(r,a),i.linkProgram(r),i.deleteShader(o),i.deleteShader(a),!i.getProgramParameter(r,i.LINK_STATUS))throw new Error(`Unable to link program: ${i.getProgramInfoLog(r)}`);n.attributes.clear(),n.uniforms.clear();for(let l=i.getProgramParameter(r,i.ACTIVE_ATTRIBUTES),c=0;c<l;c++){const h=i.getActiveAttrib(r,c);if(!h||h.name.startsWith("gl_"))continue;const f=this._renderer.bindPoints.get(h.type)??String(h.type);n.attributes.set(h.name,{type:f,name:h.name,size:wh(f),location:i.getAttribLocation(r,h.name)})}for(let l=i.getProgramParameter(r,i.ACTIVE_UNIFORMS),c=0;c<l;c++){const h=i.getActiveUniform(r,c);if(!h)continue;const f=h.name.replace(/\[.*?\]$/,"");let d=i.getUniformLocation(r,f);d||(d=i.getUniformLocation(r,h.name)),n.uniforms.set(f,{name:f,index:c,type:this._renderer.bindPoints.get(h.type)??String(h.type),size:h.size,isArray:f!==h.name,location:d})}}bind(e){const t=this.gl;({value:this.boundProgram!==e}).value&&(t.useProgram(e),this.boundProgram=e)}createShader(e,t){const r=this.gl,i=r.createShader(this._renderer.getBindPoint(t));if(!i)throw new Error("Unable to create shader");if(r.shaderSource(i,e),r.compileShader(i),!r.getShaderParameter(i,r.COMPILE_STATUS))throw new Error(`Unable to compiling shader :
|
|
72
|
+
${e}
|
|
73
|
+
${r.getShaderInfoLog(i)}`);return i}updateUniforms(...e){if(e.length>1){this.bind(e[0]),this.updateUniforms(e[1]);return}const t=this.boundProgram;if(!t)return;const r=this.gl,i=e[0],{uniforms:n,boundUniforms:o}=this.getMeta(t);for(const a in i){const l=i[a],c=n.get(a);if(!c)continue;const{type:h,isArray:f,location:d}=c;if(!(!d||o.get(d)===l))switch(o.set(d,l),h){case"float":f?r.uniform1fv(d,l):r.uniform1f(d,l);break;case"unsigned_int":f?r.uniform1uiv(d,l):r.uniform1ui(d,l);break;case"bool":case"int":case"sampler_2d":case"sampler_cube":case"sampler_2d_array":f?r.uniform1iv(d,l):r.uniform1i(d,l);break;case"bool_vec2":case"int_vec2":r.uniform2iv(d,l);break;case"unsigned_int_vec2":r.uniform2uiv(d,l);break;case"float_vec2":r.uniform2fv(d,l);break;case"bool_vec3":case"int_vec3":r.uniform3iv(d,l);break;case"unsigned_int_vec3":r.uniform3uiv(d,l);break;case"float_vec3":r.uniform3fv(d,l);break;case"bool_vec4":case"int_vec4":r.uniform4iv(d,l);break;case"unsigned_int_vec4":r.uniform4uiv(d,l);break;case"float_vec4":r.uniform4fv(d,l);break;case"float_mat2":r.uniformMatrix2fv(d,!1,l);break;case"float_mat3":r.uniformMatrix3fv(d,!1,l);break;case"float_mat4":r.uniformMatrix4fv(d,!1,l);break}}}reset(){super.reset(),this.boundProgram=null,this.uniforms={projectionMatrix:[1,0,0,0,1,0,0,0,1],viewMatrix:[1,0,0,0,1,0,0,0,1]}}free(){super.free(),this.bind(null)}}function wh(s){switch(s){case"float":case"int":case"unsigned_int":case"bool":case"sampler_2d":return 1;case"float_vec2":case"int_vec2":case"unsigned_int_vec2":case"bool_vec2":return 2;case"float_vec3":case"int_vec3":case"unsigned_int_vec3":case"bool_vec3":return 3;case"float_vec4":case"int_vec4":case"unsigned_int_vec4":case"bool_vec4":case"float_mat2":return 4;case"float_mat3":return 9;case"float_mat4":return 16;default:return 1}}function Si(s,e,t){const[r,i,n,o,a,l,c,h,f]=s,d=r*e+o*t+c,g=i*e+a*t+h,p=n*e+l*t+f;return{x:d/p,y:g/p}}function xh(s,e){const{x:t,y:r,width:i,height:n}=e,o=Si(s,t,r),a=Si(s,t+i,r),l=Si(s,t+i,r+n),c=Si(s,t,r+n),h=[o,a,l,c],f=h.map(P=>P.x),d=h.map(P=>P.y),g=Math.min(...f),p=Math.max(...f),y=Math.min(...d),m=Math.max(...d);return{x:g,y,width:p-g,height:m-y}}class Ko extends Ye{install(e){super.install(e),e.scissor=this}get length(){return this._renderer.mask.last?.scissorCounter??0}push(e){const t=this._renderer.gl;t.enable(t.SCISSOR_TEST),e.scissorCounter??=0,e.scissorCounter++,this.use()}pop(e){if(this.length>0)this.use();else{const t=this._renderer.gl;t.disable(t.SCISSOR_TEST)}}use(){const e=this._renderer,{pixelRatio:t,mask:r,viewport:i,screen:n,gl:o,program:a}=e,{viewMatrix:l}=a.uniforms,c=xh(l,r.last.mask),{x:h,y:f,width:d,height:g}=c;let p;i.boundViewport?p=i.boundViewport.height-(g+f)*t:p=(n.height-(g+f))*t,o.scissor(h*t,p,d*t,g*t)}}class Zo extends Ye{install(e){super.install(e),e.stencil=this}get length(){return this._renderer.mask.last?.stencilCounter??0}push(e){const t=this._renderer.gl,r=e.mask,i=e.stencilCounter??=0;e.stencilCounter===0&&(this._renderer.framebuffer.forceStencil(),t.clearStencil(0),t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST)),e.stencilCounter++;const n=e.color;n&&(e.color=0,t.colorMask(!1,!1,!1,!1)),t.stencilFunc(t.EQUAL,i,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.INCR),r.render(this._renderer),this._renderer.flush(),n&&(e.color=n,t.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)),this.use()}pop(e){const t=this._renderer.gl,r=e.mask;if(!this.length)t.disable(t.STENCIL_TEST);else{const i=this._renderer.mask.last,n=i?.color??15;n!==0&&(i.color=0,t.colorMask(!1,!1,!1,!1)),t.stencilOp(t.KEEP,t.KEEP,t.DECR),r.render(this._renderer),this._renderer.flush(),n!==0&&(i.color=n,t.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)),this.use()}}use(){const e=this._renderer.gl;e.stencilFunc(e.EQUAL,this.length,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)}}function Ph(s,e){const t=new Set([...Object.keys(s),...Object.keys(e)]),r={};return t.forEach(i=>{r[i]=s[i]!==e[i]}),r}class Jo extends Ye{install(e){super.install(e),e.texture=this}maxUnits=0;boundLocation=0;boundTarget="texture_2d";boundTextures=[];emptyTextures={texture_2d:null,texture_cube_map:null};onUpdateContext(){super.onUpdateContext();const e=this.gl;this.maxUnits=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);for(let i=0;i<this.maxUnits;i++)this.boundTextures[i]={texture_2d:null,texture_cube_map:null};const t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array(4));const r=e.createTexture();e.bindTexture(e.TEXTURE_CUBE_MAP,r);for(let i=0;i<6;i++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null);e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,e.LINEAR),this.emptyTextures={texture_2d:t,texture_cube_map:r};for(let i=this.boundTextures.length,n=0;n<i;n++)this.unbind(n)}create(e){const t=this.gl.createTexture();if(!t)throw new Error("Unable to create texture");return e&&(this.bind({location:e.location,target:e.target,value:t,forceUpdateLocation:!0}),this.update({filterMode:"linear",wrapMode:"repeat",...e})),t}getMeta(e){return this._renderer.getRelated(e,()=>({}))}update(...e){if(e.length>1){this.bind({location:e[1].location,target:e[1].target,value:e[0],forceUpdateLocation:!0}),this.update(e[1]);return}const t=e[0],{value:r,...i}=t,n=this.boundTextures[this.boundLocation][t.target??this.boundTarget];if(!n)return;const o=this.gl,a=this.getMeta(n),l=Ph(a,i);Object.assign(a,i);const c=this._renderer.getBindPoint(a.target??this.boundTarget);if(r!==void 0&&(r===null?o.texImage2D(c,0,o.RGBA,1,1,0,o.RGBA,o.UNSIGNED_BYTE,null):"pixels"in r?o.texImage2D(c,0,o.RGBA,r.width,r.height,0,o.RGBA,o.UNSIGNED_BYTE,r.pixels):o.texImage2D(c,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,r)),l.wrapMode&&a.wrapMode){const f=this._renderer.getBindPoint(a.wrapMode);o.texParameteri(c,o.TEXTURE_WRAP_S,f),o.texParameteri(c,o.TEXTURE_WRAP_T,f)}const h=a.filterMode;if(l.filterMode&&h){const f=this._renderer.getBindPoint(h.split("_")[0]);h.includes("_")?o.texParameteri(c,o.TEXTURE_MIN_FILTER,this._renderer.getBindPoint(h)):o.texParameteri(c,o.TEXTURE_MIN_FILTER,f),o.texParameteri(c,o.TEXTURE_MAG_FILTER,f)}if(a.anisoLevel&&h==="linear"&&this._renderer.extensions.anisotropicFiltering&&l.anisoLevel){const{MAX_TEXTURE_MAX_ANISOTROPY_EXT:f,TEXTURE_MAX_ANISOTROPY_EXT:d}=this._renderer.extensions.anisotropicFiltering;o.texParameterf(c,d,Math.min(a.anisoLevel,o.getParameter(f)))}}bind(e){const t=this.gl;let r,i,n,o;if(e&&"value"in e?{target:i,value:r,location:n,forceUpdateLocation:o}=e:r=e,r){const g=this.getMeta(r);g.target=i??=g.target??"texture_2d",g.location=n??=g.location??0}else i??="texture_2d",n??=0;let a=this.boundTextures[n];a||(this.boundTextures[n]=a={texture_2d:null,texture_cube_map:null});const l=a[i]??null,c=this.boundLocation,h=r!==l,f={location:n!==c&&(h||o),texture:h},d=this._renderer.getBindPoint(i);f.location&&(t.activeTexture(t.TEXTURE0+n),this.boundLocation=n),f.texture&&(t.bindTexture(d,r??this.emptyTextures[i]),a[i]=r),this.boundTarget=i}unbind(e,t="texture_2d"){const r=this._renderer.gl;if(typeof e=="number")this.bind({value:null,target:t,location:e});else{const i=this.getMeta(e),{target:n=this.boundTarget}=i,o=this._renderer.getBindPoint(n);for(let a=0;a<this.boundTextures.length;a++)this.boundTextures[a][n]===e&&(this.boundLocation!==a&&(r.activeTexture(r.TEXTURE0+a),this.boundLocation=a),r.bindTexture(o,this.emptyTextures[n]),this.boundTextures[a][n]=null)}}reset(){super.reset(),this.boundLocation=0,this.boundTarget="texture_2d",this.boundTextures=[],this.maxUnits=0}}class Qo extends Ye{install(e){super.install(e),e.vertexArray=this}boundVertexArrayNull={attributes:{},elementArrayBuffer:null};boundVertexArrayObject=null;boundVertexArray=this.boundVertexArrayNull;enableVertexAttrib(e,t,r,i=1){const{buffer:n,size:o=0,type:a="float",normalized:l=!1,stride:c=0,offset:h=0,divisor:f}=r,d=this._renderer.gl;this._renderer.buffer.bind({target:"array_buffer",value:n});for(let g=0;g<i;g++)d.enableVertexAttribArray(t+g),d.vertexAttribPointer(t+g,o,this._renderer.getBindPoint(a),l,c,h+(c-h)/i*g);f&&("vertexAttribDivisor"in d?d.vertexAttribDivisor(t,f):console.warn("Failed to active vertex array object, GPU Instancing is not supported on this device")),this.boundVertexArray.attributes[e]={enable:!0,...r}}create(...e){const t=this._renderer.gl;if(!("createVertexArray"in t))return null;const r=t.createVertexArray();if(!r)throw new Error("Unable to create vertex array");return e.length===2?this.update(e[0],r,e[1]):e.length===1&&this.update(r,e[0]),r}getVertexArrayMeta(e){return this._renderer.getRelated(e,()=>({attributes:{},elementArrayBuffer:null}))}update(...e){if(e.length>2){this._renderer.program.bind(e[0]),this.update(e[1],e[2]);return}else if(e.length===2)if(e[0]){const n=e[0],o=e[1],a=this.getVertexArrayMeta(n);this.bind(n),this.update(o),a.attributes=this.boundVertexArray.attributes,a.elementArrayBuffer=this.boundVertexArray.elementArrayBuffer,this.unbind(),this._renderer.buffer.unbind("array_buffer");return}else return this.update(e[1]);const t=this._renderer.program.boundProgram;if(!t)return;const r=e[0];if(r.attributes){const n=this._renderer.program.getMeta(t),o={},a={};for(const c in r.attributes){const h=r.attributes[c],f=n.attributes.get(c);let d;"buffer"in h?d={...h}:d={buffer:h},d.size=d.size||f?.size||0;const g=this._renderer.buffer.getMeta(d.buffer),p=Number(f?.type.match(/mat(\d)/)?.[1]??1);let y;switch(d.type){case"unsigned_byte":y=d.size;break;case"unsigned_short":y=d.size*2;break;case"float":default:y=d.size*4;break}y*=p,o[g.id]??=0,o[g.id]+=y,a[c]={attrib:d,meta:g,info:f,byteLength:y,dimension:p}}const l={};for(const c in a){const{attrib:h,meta:f,info:d,byteLength:g,dimension:p}=a[c];d?.location!==void 0&&(l[f.id]??=0,h.offset??=l[f.id],h.stride??=o[f.id]===g?0:o[f.id],this.enableVertexAttrib(c,d.location,h,p),l[f.id]+=g)}}const i=r.elementArrayBuffer??null;this._renderer.buffer.bind({target:"element_array_buffer",value:i}),this.boundVertexArray.elementArrayBuffer=i}bind(e){const t=this._renderer.gl;if(e&&"attributes"in e)this.update(e);else if("bindVertexArray"in t){const r=this.boundVertexArrayObject;({value:e!==r}).value&&(t.bindVertexArray(e),this.boundVertexArrayObject=e,e?this.boundVertexArray={...this.getVertexArrayMeta(e)}:this.boundVertexArray=this.boundVertexArrayNull)}}unbind(){return this.bind(null)}reset(){super.reset(),this.boundVertexArrayNull={attributes:{},elementArrayBuffer:null},this.boundVertexArray=this.boundVertexArrayNull,this.boundVertexArrayObject=null}}class ea extends Ye{install(e){super.install(e),e.viewport=this}boundViewport={x:0,y:0,width:0,height:0};bind(e){const t=this.boundViewport,r=Math.floor(e.x),i=Math.floor(e.y),n=Math.floor(e.width),o=Math.floor(e.height);t.x===r&&t.y===i&&t.width===n&&t.height===o||(this._renderer.gl.viewport(r,i,n,o),t.x=r,t.y=i,t.width=n,t.height=o)}reset(){super.reset(),this.boundViewport={x:0,y:0,width:0,height:0}}}class ta extends Vo{_modules=[new Jo,new qo,new Xo,new Yo,new Qo,new ea,new jo,new Ho,new Ko,new Zo,new Wo];bindPoints=new Map;constructor(e=Ao(),t){if(super(),!e)throw new Error("Failed to createHTMLCanvas");Eo(e)?this._setupContext(e,t):(this.gl=e,this.version=Mo(this.gl)?2:1),this._setupBindPoints()._setupExtensions()._setupPolyfill(),this.gl.pixelStorei(this.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),this._modules.forEach(r=>r.install(this)),this._modules.forEach(r=>r.onUpdateContext())}_setupContext(e,t){this.view=e;let r=e.getContext("webgl2",t)||e.getContext("experimental-webgl2",t),i=2;if(r||(r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=1),!r)throw new Error("Unable to getContext");return this.gl=r,this.version=i,this._onContextLost=this._onContextLost.bind(this),this._onContextRestored=this._onContextRestored.bind(this),e.addEventListener("webglcontextlost",this._onContextLost,!1),e.addEventListener("webglcontextrestored",this._onContextRestored,!1),this}_setupExtensions(){const e=this.gl,t={loseContext:e.getExtension("WEBGL_lose_context"),anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tcSRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};return this.version===1?(t.instancedArrays=e.getExtension("ANGLE_instanced_arrays"),t.drawBuffers=e.getExtension("WEBGL_draw_buffers"),t.depthTexture=e.getExtension("WEBGL_depth_texture"),t.vertexArrayObject=e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),t.uint32ElementIndex=e.getExtension("OES_element_index_uint"),t.floatTexture=e.getExtension("OES_texture_float"),t.textureHalfFloat=e.getExtension("OES_texture_half_float"),t.textureHalfFloatLinear=e.getExtension("OES_texture_half_float_linear")):this.version===2&&(t.colorBufferFloat=e.getExtension("EXT_color_buffer_float")),this.extensions=t,this}_setupBindPoints(){for(const e in this.gl)if(e===e.toUpperCase()){const t=this.gl[e];typeof t=="number"&&this.bindPoints.set(t,e.toLowerCase())}return this}_setupPolyfill(){if(this.version===1){const{instancedArrays:e,vertexArrayObject:t,drawBuffers:r}=this.extensions,i=this.gl;t&&(i.createVertexArray=()=>t.createVertexArrayOES(),i.bindVertexArray=n=>t.bindVertexArrayOES(n),i.deleteVertexArray=n=>t.deleteVertexArrayOES(n)),e&&(i.vertexAttribDivisor=(n,o)=>e.vertexAttribDivisorANGLE(n,o),i.drawElementsInstanced=(n,o,a,l,c)=>e.drawElementsInstancedANGLE(n,o,a,l,c),i.drawArraysInstanced=(n,o,a,l)=>e.drawArraysInstancedANGLE(n,o,a,l)),r&&(i.drawBuffers=n=>r.drawBuffersWEBGL(n))}return this}_onContextLost(e){e.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext()},0)}_onContextRestored(){}getBindPoint(e){return this.gl[e.toUpperCase()]}clear(e=this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT){this.gl.clear(e)}draw(e={}){const{mode:t="triangles",first:r=0,instanceCount:i}=e;let{count:n=0,bytesPerElement:o=0}=e;if(!n||!o){const l=this.vertexArray.boundVertexArray.elementArrayBuffer??Object.values(this.vertexArray.boundVertexArray.attributes)[0];if(l){const c=this.buffer.getMeta(l);n||(n=c.length),o||(o=c.bytesPerElement)}}const a=this.getBindPoint(t);if(o)if(o===2||o===4&&this.extensions.uint32ElementIndex){const l=o===2?this.gl.UNSIGNED_SHORT:this.gl.UNSIGNED_INT;i&&"drawElementsInstanced"in this.gl?this.gl.drawElementsInstanced(a,n,l,r*o,i):this.gl.drawElements(a,n,l,r*o)}else console.warn("Unsupported index buffer type: uint32");else i&&"drawArraysInstanced"in this.gl?this.gl.drawArraysInstanced(a,r,n,i):this.gl.drawArrays(a,r,n)}reset(){this._modules.forEach(e=>e.reset())}flush(){this._modules.forEach(e=>e.flush())}free(){this._modules.forEach(e=>e.free()),this.view?.removeEventListener("webglcontextlost",this._onContextLost,!1),this.view?.removeEventListener("webglcontextrestored",this._onContextRestored,!1),this.extensions.loseContext?.loseContext()}toPixels(e=0,t=0,r=this.gl.drawingBufferWidth,i=this.gl.drawingBufferHeight){const n=r*i*4,o=r*4,a=(i-1)*o,l=new Uint8Array(n),c=new Uint8ClampedArray(n);this.gl.readPixels(e,t,r,i,this.gl.RGBA,this.gl.UNSIGNED_BYTE,l);for(let h=0;h<n;h+=o)c.set(l.subarray(h,h+o),a-h);return c}}class Ut{}class ra extends Ut{install(e){const t=async r=>{const{parseFont:i}=await Promise.resolve().then(()=>Hp);return await e.fetch(r).then(n=>n.arrayBuffer()).then(n=>i(n))};return this.load=r=>e.loadBy(r,()=>t(r)),["woff","ttf","otf"].forEach(r=>{e.register(r,t)}),e.font=this,this}}function Sh(s,e,t=2){const r=e&&e.length,i=r?e[0]*t:s.length;let n=ia(s,0,i,t,!0);const o=[];if(!n||n.next===n.prev)return o;let a,l,c;if(r&&(n=Ah(s,e,n,t)),s.length>80*t){a=s[0],l=s[1];let h=a,f=l;for(let d=t;d<i;d+=t){const g=s[d],p=s[d+1];g<a&&(a=g),p<l&&(l=p),g>h&&(h=g),p>f&&(f=p)}c=Math.max(h-a,f-l),c=c!==0?32767/c:0}return Dr(n,o,t,a,l,c,0),o}function ia(s,e,t,r,i){let n;if(i===$h(s,e,t,r)>0)for(let o=e;o<t;o+=r)n=aa(o/r|0,s[o],s[o+1],n);else for(let o=t-r;o>=e;o-=r)n=aa(o/r|0,s[o],s[o+1],n);return n&&cr(n,n.next)&&(Ur(n),n=n.next),n}function Xt(s,e){if(!s)return s;e||(e=s);let t=s,r;do if(r=!1,!t.steiner&&(cr(t,t.next)||ie(t.prev,t,t.next)===0)){if(Ur(t),t=e=t.prev,t===t.next)break;r=!0}else t=t.next;while(r||t!==e);return e}function Dr(s,e,t,r,i,n,o){if(!s)return;!o&&n&&Rh(s,r,i,n);let a=s;for(;s.prev!==s.next;){const l=s.prev,c=s.next;if(n?Th(s,r,i,n):Ch(s)){e.push(l.i,s.i,c.i),Ur(s),s=c.next,a=c.next;continue}if(s=c,s===a){o?o===1?(s=Eh(Xt(s),e),Dr(s,e,t,r,i,n,2)):o===2&&Mh(s,e,t,r,i,n):Dr(Xt(s),e,t,r,i,n,1);break}}}function Ch(s){const e=s.prev,t=s,r=s.next;if(ie(e,t,r)>=0)return!1;const i=e.x,n=t.x,o=r.x,a=e.y,l=t.y,c=r.y,h=Math.min(i,n,o),f=Math.min(a,l,c),d=Math.max(i,n,o),g=Math.max(a,l,c);let p=r.next;for(;p!==e;){if(p.x>=h&&p.x<=d&&p.y>=f&&p.y<=g&&Ir(i,a,n,l,o,c,p.x,p.y)&&ie(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Th(s,e,t,r){const i=s.prev,n=s,o=s.next;if(ie(i,n,o)>=0)return!1;const a=i.x,l=n.x,c=o.x,h=i.y,f=n.y,d=o.y,g=Math.min(a,l,c),p=Math.min(h,f,d),y=Math.max(a,l,c),m=Math.max(h,f,d),P=Rs(g,p,e,t,r),E=Rs(y,m,e,t,r);let x=s.prevZ,C=s.nextZ;for(;x&&x.z>=P&&C&&C.z<=E;){if(x.x>=g&&x.x<=y&&x.y>=p&&x.y<=m&&x!==i&&x!==o&&Ir(a,h,l,f,c,d,x.x,x.y)&&ie(x.prev,x,x.next)>=0||(x=x.prevZ,C.x>=g&&C.x<=y&&C.y>=p&&C.y<=m&&C!==i&&C!==o&&Ir(a,h,l,f,c,d,C.x,C.y)&&ie(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;x&&x.z>=P;){if(x.x>=g&&x.x<=y&&x.y>=p&&x.y<=m&&x!==i&&x!==o&&Ir(a,h,l,f,c,d,x.x,x.y)&&ie(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;C&&C.z<=E;){if(C.x>=g&&C.x<=y&&C.y>=p&&C.y<=m&&C!==i&&C!==o&&Ir(a,h,l,f,c,d,C.x,C.y)&&ie(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function Eh(s,e){let t=s;do{const r=t.prev,i=t.next.next;!cr(r,i)&&na(r,t,t.next,i)&&Rr(r,i)&&Rr(i,r)&&(e.push(r.i,t.i,i.i),Ur(t),Ur(t.next),t=s=i),t=t.next}while(t!==s);return Xt(t)}function Mh(s,e,t,r,i,n){let o=s;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&Lh(o,a)){let l=oa(o,a);o=Xt(o,o.next),l=Xt(l,l.next),Dr(o,e,t,r,i,n,0),Dr(l,e,t,r,i,n,0);return}a=a.next}o=o.next}while(o!==s)}function Ah(s,e,t,r){const i=[];for(let n=0,o=e.length;n<o;n++){const a=e[n]*r,l=n<o-1?e[n+1]*r:s.length,c=ia(s,a,l,r,!1);c===c.next&&(c.steiner=!0),i.push(Bh(c))}i.sort(Oh);for(let n=0;n<i.length;n++)t=kh(i[n],t);return t}function Oh(s,e){let t=s.x-e.x;if(t===0&&(t=s.y-e.y,t===0)){const r=(s.next.y-s.y)/(s.next.x-s.x),i=(e.next.y-e.y)/(e.next.x-e.x);t=r-i}return t}function kh(s,e){const t=Dh(s,e);if(!t)return e;const r=oa(t,s);return Xt(r,r.next),Xt(t,t.next)}function Dh(s,e){let t=e;const r=s.x,i=s.y;let n=-1/0,o;if(cr(s,t))return t;do{if(cr(s,t.next))return t.next;if(i<=t.y&&i>=t.next.y&&t.next.y!==t.y){const f=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(f<=r&&f>n&&(n=f,o=t.x<t.next.x?t:t.next,f===r))return o}t=t.next}while(t!==e);if(!o)return null;const a=o,l=o.x,c=o.y;let h=1/0;t=o;do{if(r>=t.x&&t.x>=l&&r!==t.x&&sa(i<c?r:n,i,l,c,i<c?n:r,i,t.x,t.y)){const f=Math.abs(i-t.y)/(r-t.x);Rr(t,s)&&(f<h||f===h&&(t.x>o.x||t.x===o.x&&Ih(o,t)))&&(o=t,h=f)}t=t.next}while(t!==a);return o}function Ih(s,e){return ie(s.prev,s,e.prev)<0&&ie(e.next,s,s.next)<0}function Rh(s,e,t,r){let i=s;do i.z===0&&(i.z=Rs(i.x,i.y,e,t,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==s);i.prevZ.nextZ=null,i.prevZ=null,Uh(i)}function Uh(s){let e,t=1;do{let r=s,i;s=null;let n=null;for(e=0;r;){e++;let o=r,a=0;for(let c=0;c<t&&(a++,o=o.nextZ,!!o);c++);let l=t;for(;a>0||l>0&&o;)a!==0&&(l===0||!o||r.z<=o.z)?(i=r,r=r.nextZ,a--):(i=o,o=o.nextZ,l--),n?n.nextZ=i:s=i,i.prevZ=n,n=i;r=o}n.nextZ=null,t*=2}while(e>1);return s}function Rs(s,e,t,r,i){return s=(s-t)*i|0,e=(e-r)*i|0,s=(s|s<<8)&16711935,s=(s|s<<4)&252645135,s=(s|s<<2)&858993459,s=(s|s<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,s|e<<1}function Bh(s){let e=s,t=s;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==s);return t}function sa(s,e,t,r,i,n,o,a){return(i-o)*(e-a)>=(s-o)*(n-a)&&(s-o)*(r-a)>=(t-o)*(e-a)&&(t-o)*(n-a)>=(i-o)*(r-a)}function Ir(s,e,t,r,i,n,o,a){return!(s===o&&e===a)&&sa(s,e,t,r,i,n,o,a)}function Lh(s,e){return s.next.i!==e.i&&s.prev.i!==e.i&&!Nh(s,e)&&(Rr(s,e)&&Rr(e,s)&&Fh(s,e)&&(ie(s.prev,s,e.prev)||ie(s,e.prev,e))||cr(s,e)&&ie(s.prev,s,s.next)>0&&ie(e.prev,e,e.next)>0)}function ie(s,e,t){return(e.y-s.y)*(t.x-e.x)-(e.x-s.x)*(t.y-e.y)}function cr(s,e){return s.x===e.x&&s.y===e.y}function na(s,e,t,r){const i=Ti(ie(s,e,t)),n=Ti(ie(s,e,r)),o=Ti(ie(t,r,s)),a=Ti(ie(t,r,e));return!!(i!==n&&o!==a||i===0&&Ci(s,t,e)||n===0&&Ci(s,r,e)||o===0&&Ci(t,s,r)||a===0&&Ci(t,e,r))}function Ci(s,e,t){return e.x<=Math.max(s.x,t.x)&&e.x>=Math.min(s.x,t.x)&&e.y<=Math.max(s.y,t.y)&&e.y>=Math.min(s.y,t.y)}function Ti(s){return s>0?1:s<0?-1:0}function Nh(s,e){let t=s;do{if(t.i!==s.i&&t.next.i!==s.i&&t.i!==e.i&&t.next.i!==e.i&&na(t,t.next,s,e))return!0;t=t.next}while(t!==s);return!1}function Rr(s,e){return ie(s.prev,s,s.next)<0?ie(s,e,s.next)>=0&&ie(s,s.prev,e)>=0:ie(s,e,s.prev)<0||ie(s,s.next,e)<0}function Fh(s,e){let t=s,r=!1;const i=(s.x+e.x)/2,n=(s.y+e.y)/2;do t.y>n!=t.next.y>n&&t.next.y!==t.y&&i<(t.next.x-t.x)*(n-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next;while(t!==s);return r}function oa(s,e){const t=Us(s.i,s.x,s.y),r=Us(e.i,e.x,e.y),i=s.next,n=e.prev;return s.next=e,e.prev=s,t.next=i,i.prev=t,r.next=t,t.prev=r,n.next=r,r.prev=n,r}function aa(s,e,t,r){const i=Us(s,e,t);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Ur(s){s.next.prev=s.prev,s.prev.next=s.next,s.prevZ&&(s.prevZ.nextZ=s.nextZ),s.nextZ&&(s.nextZ.prevZ=s.prevZ)}function Us(s,e,t){return{i:s,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function $h(s,e,t,r){let i=0;for(let n=e,o=t-r;n<t;n+=r)i+=(s[o]-s[n])*(s[n+1]+s[o+1]),o=n;return i}function zh(s,e,t,r={}){const{radius:i=1}=r;s.moveTo(e,t),s.arc(e,t,i,0,Math.PI*2)}const Vh={arcs:"bevel",bevel:"bevel",miter:"miter","miter-clip":"miter",round:"round"};function Bs(s,e){const{fill:t="#000",stroke:r="none",strokeWidth:i=r==="none"?0:1,strokeLinecap:n="round",strokeLinejoin:o="miter",strokeMiterlimit:a=0,strokeDasharray:l=[],strokeDashoffset:c=0,shadowOffsetX:h=0,shadowOffsetY:f=0,shadowBlur:d=0,shadowColor:g="rgba(0, 0, 0, 0)"}=e;s.fillStyle=t,s.strokeStyle=r,s.lineWidth=i,s.lineCap=n,s.lineJoin=Vh[o],s.miterLimit=a,s.setLineDash(l),s.lineDashOffset=c,s.shadowOffsetX=h,s.shadowOffsetY=f,s.shadowBlur=d,s.shadowColor=g}class O{constructor(e=0,t=0){this.x=e,this.y=t}static get MAX(){return new O(1/0,1/0)}static get MIN(){return new O(-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(e,t){return this.x=e,this.y=t,this}add(e){return this.x+=e.x,this.y+=e.y,this}sub(e){return this.x-=e.x,this.y-=e.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}divide(e){return this.x/=e.x,this.y/=e.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}rotate(e,t={x:0,y:0}){const r=-e/180*Math.PI,i=this.x-t.x,n=-(this.y-t.y),o=Math.sin(r),a=Math.cos(r);return this.set(t.x+(i*a-n*o),t.y-(i*o+n*a)),this}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,r=this.y-e.y;return t*t+r*r}lengthSquared(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.lengthSquared())}scale(e,t=e,r={x:0,y:0}){const i=e<0?r.x-this.x+r.x:this.x,n=t<0?r.y-this.y+r.y:this.y;return this.x=i*Math.abs(e),this.y=n*Math.abs(t),this}skew(e,t=0,r={x:0,y:0}){const i=this.x-r.x,n=this.y-r.y;return this.x=r.x+(i+Math.tan(e)*n),this.y=r.y+(n+Math.tan(t)*i),this}min(...e){return this.x=Math.min(this.x,...e.map(t=>t.x)),this.y=Math.min(this.y,...e.map(t=>t.y)),this}max(...e){return this.x=Math.max(this.x,...e.map(t=>t.x)),this.y=Math.max(this.y,...e.map(t=>t.y)),this}normalize(){return this.scale(1/(this.length()||1))}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this}divideVectors(e,t){return this.x=e.x/t.x,this.y=e.y/t.y,this}lerpVectors(e,t,r){return this.x=e.x+(t.x-e.x)*r,this.y=e.y+(t.y-e.y)*r,this}equals(e){return this.x===e.x&&this.y===e.y}applyMatrix3(e){const t=this.x,r=this.y,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6],this.y=i[1]*t+i[4]*r+i[7],this}copy(e){return this.x=e.x,this.y=e.y,this}clone(){return new O(this.x,this.y)}}class Z{constructor(e=0,t=0,r=0,i=0){this.left=e,this.top=t,this.width=r,this.height=i}get x(){return this.left}set x(e){this.left=e}get y(){return this.top}set y(e){this.top=e}get right(){return this.left+this.width}get bottom(){return this.top+this.height}get center(){return new O((this.left+this.right)/2,(this.top+this.bottom)/2)}get array(){return[this.left,this.top,this.width,this.height]}static from(...e){if(e.length===0)return new Z;if(e.length===1)return e[0].clone();const t=e[0],r=e.slice(1).reduce((i,n)=>(i.left=Math.min(i.left,n.left),i.top=Math.min(i.top,n.top),i.right=Math.max(i.right,n.right),i.bottom=Math.max(i.bottom,n.bottom),i),{left:t?.left??0,top:t?.top??0,right:t?.right??0,bottom:t?.bottom??0});return new Z(r.left,r.top,r.right-r.left,r.bottom-r.top)}translate(e,t){return this.left+=e,this.top+=t,this}copy(e){return this.left=e.left,this.top=e.top,this.width=e.width,this.height=e.height,this}clone(){return new Z(this.left,this.top,this.width,this.height)}}class _e{elements=[];constructor(e=1,t=0,r=0,i=0,n=1,o=0,a=0,l=0,c=1){this.set(e,t,r,i,n,o,a,l,c)}set(e,t,r,i,n,o,a,l,c){const h=this.elements;return h[0]=e,h[1]=i,h[2]=a,h[3]=t,h[4]=n,h[5]=l,h[6]=r,h[7]=o,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const r=e.elements,i=t.elements,n=this.elements,o=r[0],a=r[3],l=r[6],c=r[1],h=r[4],f=r[7],d=r[2],g=r[5],p=r[8],y=i[0],m=i[3],P=i[6],E=i[1],x=i[4],C=i[7],v=i[2],b=i[5],S=i[8];return n[0]=o*y+a*E+l*v,n[3]=o*m+a*x+l*b,n[6]=o*P+a*C+l*S,n[1]=c*y+h*E+f*v,n[4]=c*m+h*x+f*b,n[7]=c*P+h*C+f*S,n[2]=d*y+g*E+p*v,n[5]=d*m+g*x+p*b,n[8]=d*P+g*C+p*S,this}invert(){const e=this.elements,t=e[0],r=e[1],i=e[2],n=e[3],o=e[4],a=e[5],l=e[6],c=e[7],h=e[8],f=h*o-a*c,d=a*l-h*n,g=c*n-o*l,p=t*f+r*d+i*g;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const y=1/p;return e[0]=f*y,e[1]=(i*c-h*r)*y,e[2]=(a*r-i*o)*y,e[3]=d*y,e[4]=(h*t-i*l)*y,e[5]=(i*n-a*t)*y,e[6]=g*y,e[7]=(r*l-c*t)*y,e[8]=(o*t-r*n)*y,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}scale(e,t){return this.premultiply(Ls.makeScale(e,t)),this}rotate(e){return this.premultiply(Ls.makeRotation(-e)),this}translate(e,t){return this.premultiply(Ls.makeTranslation(e,t)),this}makeTranslation(e,t){return this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,r,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}fromArray(e,t=0){for(let r=0;r<9;r++)this.elements[r]=e[r+t];return this}clone(){return new this.constructor().fromArray(this.elements)}}const Ls=new _e;function la(s,e,t,r){const i=s*t+e*r,n=Math.sqrt(s*s+e*e)*Math.sqrt(t*t+r*r);let o=Math.acos(Math.max(-1,Math.min(1,i/n)));return s*r-e*t<0&&(o=-o),o}function Gh(s,e,t,r,i,n,o,a){if(e===0||t===0){s.lineTo(a.x,a.y);return}r=r*Math.PI/180,e=Math.abs(e),t=Math.abs(t);const l=(o.x-a.x)/2,c=(o.y-a.y)/2,h=Math.cos(r)*l+Math.sin(r)*c,f=-Math.sin(r)*l+Math.cos(r)*c;let d=e*e,g=t*t;const p=h*h,y=f*f,m=p/d+y/g;if(m>1){const G=Math.sqrt(m);e=G*e,t=G*t,d=e*e,g=t*t}const P=d*y+g*p,E=(d*g-P)/P;let x=Math.sqrt(Math.max(0,E));i===n&&(x=-x);const C=x*e*f/t,v=-x*t*h/e,b=Math.cos(r)*C-Math.sin(r)*v+(o.x+a.x)/2,S=Math.sin(r)*C+Math.cos(r)*v+(o.y+a.y)/2,T=la(1,0,(h-C)/e,(f-v)/t),R=la((h-C)/e,(f-v)/t,(-h-C)/e,(-f-v)/t)%(Math.PI*2);s.ellipse(b,S,e,t,r,T,T+R,n===0)}const le={WHITESPACE:/[ \t\r\n]/,DIGIT:/\d/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};function ht(s,e,t=0){let a=0,l=!0,c="",h="";const f=[];function d(m,P,E){const x=new SyntaxError(`Unexpected character "${m}" at index ${P}.`);throw x.partial=E,x}function g(){c!==""&&(h===""?f.push(Number(c)):f.push(Number(c)*10**Number(h))),c="",h=""}let p;const y=s.length;for(let m=0;m<y;m++){if(p=s[m],Array.isArray(e)&&e.includes(f.length%t)&&le.FLAGS.test(p)){a=1,c=p,g();continue}if(a===0){if(le.WHITESPACE.test(p))continue;if(le.DIGIT.test(p)||le.SIGN.test(p)){a=1,c=p;continue}if(le.POINT.test(p)){a=2,c=p;continue}le.COMMA.test(p)&&(l&&d(p,m,f),l=!0)}if(a===1){if(le.DIGIT.test(p)){c+=p;continue}if(le.POINT.test(p)){c+=p,a=2;continue}if(le.EXP.test(p)){a=3;continue}le.SIGN.test(p)&&c.length===1&&le.SIGN.test(c[0])&&d(p,m,f)}if(a===2){if(le.DIGIT.test(p)){c+=p;continue}if(le.EXP.test(p)){a=3;continue}le.POINT.test(p)&&c[c.length-1]==="."&&d(p,m,f)}if(a===3){if(le.DIGIT.test(p)){h+=p;continue}if(le.SIGN.test(p)){if(h===""){h+=p;continue}h.length===1&&le.SIGN.test(h)&&d(p,m,f)}}le.WHITESPACE.test(p)?(g(),a=0,l=!1):le.COMMA.test(p)?(g(),a=0,l=!0):le.SIGN.test(p)?(g(),a=1,c=p):le.POINT.test(p)?(g(),a=2,c=p):d(p,m,f)}return g(),f}function hr(s,e){return s-(e-s)}function ca(s,e){const t=new O,r=new O;for(let i=0,n=s.length;i<n;i++){const o=s[i];if(o.type==="m"||o.type==="M")o.type==="m"?t.add(o):t.copy(o),e.moveTo(t.x,t.y),r.copy(t);else if(o.type==="h"||o.type==="H")o.type==="h"?t.x+=o.x:t.x=o.x,e.lineTo(t.x,t.y),r.copy(t);else if(o.type==="v"||o.type==="V")o.type==="v"?t.y+=o.y:t.y=o.y,e.lineTo(t.x,t.y),r.copy(t);else if(o.type==="l"||o.type==="L")o.type==="l"?t.add(o):t.copy(o),e.lineTo(t.x,t.y),r.copy(t);else if(o.type==="c"||o.type==="C")o.type==="c"?(e.bezierCurveTo(t.x+o.x1,t.y+o.y1,t.x+o.x2,t.y+o.y2,t.x+o.x,t.y+o.y),r.x=t.x+o.x2,r.y=t.y+o.y2,t.add(o)):(e.bezierCurveTo(o.x1,o.y1,o.x2,o.y2,o.x,o.y),r.x=o.x2,r.y=o.y2,t.copy(o));else if(o.type==="s"||o.type==="S")o.type==="s"?(e.bezierCurveTo(hr(t.x,r.x),hr(t.y,r.y),t.x+o.x2,t.y+o.y2,t.x+o.x,t.y+o.y),r.x=t.x+o.x2,r.y=t.y+o.y2,t.add(o)):(e.bezierCurveTo(hr(t.x,r.x),hr(t.y,r.y),o.x2,o.y2,o.x,o.y),r.x=o.x2,r.y=o.y2,t.copy(o));else if(o.type==="q"||o.type==="Q")o.type==="q"?(e.quadraticCurveTo(t.x+o.x1,t.y+o.y1,t.x+o.x,t.y+o.y),r.x=t.x+o.x1,r.y=t.y+o.y1,t.add(o)):(e.quadraticCurveTo(o.x1,o.y1,o.x,o.y),r.x=o.x1,r.y=o.y1,t.copy(o));else if(o.type==="t"||o.type==="T"){const a=hr(t.x,r.x),l=hr(t.y,r.y);r.x=a,r.y=l,o.type==="t"?(e.quadraticCurveTo(a,l,t.x+o.x,t.y+o.y),t.add(o)):(e.quadraticCurveTo(a,l,o.x,o.y),t.copy(o))}else if(o.type==="a"||o.type==="A"){const a=t.clone();if(o.type==="a"){if(o.x===0&&o.y===0)continue;t.add(o)}else{if(t.equals(o))continue;t.copy(o)}r.copy(t),Gh(e,o.rx,o.ry,o.angle,o.largeArcFlag,o.sweepFlag,a,t)}else o.type==="z"||o.type==="Z"?(e.startPoint&&t.copy(e.startPoint),e.closePath()):console.warn("Unsupported commands",o)}}function jh(s){let e,t;const r=[];for(let i=0,n=s.length;i<n;i++){const o=s[i];switch(o.type){case"m":case"M":if(o.x.toFixed(4)===t?.x.toFixed(4)&&o.y.toFixed(4)===t?.y.toFixed(4))continue;r.push(`${o.type} ${o.x} ${o.y}`),t={x:o.x,y:o.y},e={x:o.x,y:o.y};break;case"h":case"H":r.push(`${o.type} ${o.x}`),t={x:o.x,y:t?.y??0};break;case"v":case"V":r.push(`${o.type} ${o.y}`),t={x:t?.x??0,y:o.y};break;case"l":case"L":r.push(`${o.type} ${o.x} ${o.y}`),t={x:o.x,y:o.y};break;case"c":case"C":r.push(`${o.type} ${o.x1} ${o.y1} ${o.x2} ${o.y2} ${o.x} ${o.y}`),t={x:o.x,y:o.y};break;case"s":case"S":r.push(`${o.type} ${o.x2} ${o.y2} ${o.x} ${o.y}`),t={x:o.x,y:o.y};break;case"q":case"Q":r.push(`${o.type} ${o.x1} ${o.y1} ${o.x} ${o.y}`),t={x:o.x,y:o.y};break;case"t":case"T":r.push(`${o.type} ${o.x} ${o.y}`),t={x:o.x,y:o.y};break;case"a":case"A":r.push(`${o.type} ${o.rx} ${o.ry} ${o.angle} ${o.largeArcFlag} ${o.sweepFlag} ${o.x} ${o.y}`),t={x:o.x,y:o.y};break;case"z":case"Z":r.push(o.type),e&&(t={x:e.x,y:e.y});break}}return r.join(" ")}const Wh=/[a-df-z][^a-df-z]*/gi;function ha(s){const e=[],t=s.match(Wh);if(!t)return e;for(let r=0,i=t.length;r<i;r++){const n=t[r],o=n.charAt(0),a=n.slice(1).trim();let l;switch(o){case"m":case"M":l=ht(a);for(let c=0,h=l.length;c<h;c+=2)c===0?e.push({type:o,x:l[c],y:l[c+1]}):e.push({type:o==="m"?"l":"L",x:l[c],y:l[c+1]});break;case"h":case"H":l=ht(a);for(let c=0,h=l.length;c<h;c++)e.push({type:o,x:l[c]});break;case"v":case"V":l=ht(a);for(let c=0,h=l.length;c<h;c++)e.push({type:o,y:l[c]});break;case"l":case"L":l=ht(a);for(let c=0,h=l.length;c<h;c+=2)e.push({type:o,x:l[c],y:l[c+1]});break;case"c":case"C":l=ht(a);for(let c=0,h=l.length;c<h;c+=6)e.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=ht(a);for(let c=0,h=l.length;c<h;c+=4)e.push({type:o,x2:l[c],y2:l[c+1],x:l[c+2],y:l[c+3]});break;case"q":case"Q":l=ht(a);for(let c=0,h=l.length;c<h;c+=4)e.push({type:o,x1:l[c],y1:l[c+1],x:l[c+2],y:l[c+3]});break;case"t":case"T":l=ht(a);for(let c=0,h=l.length;c<h;c+=2)e.push({type:o,x:l[c],y:l[c+1]});break;case"a":case"A":l=ht(a,[3,4],7);for(let c=0,h=l.length;c<h;c+=7)e.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":e.push({type:o});break;default:console.warn(n)}}return e}const ua="data:image/svg+xml;",fa=`${ua}base64,`,da=`${ua}charset=utf8,`;function Ns(s){if(typeof s=="string"){let e;s.startsWith(fa)?(s=s.substring(fa.length,s.length),e=atob(s)):s.startsWith(da)?(s=s.substring(da.length,s.length),e=decodeURIComponent(s)):e=s;const t=new DOMParser().parseFromString(e,"text/xml"),r=t.querySelector("parsererror");if(r)throw new Error(`${r.textContent??"parser error"}
|
|
74
|
+
${e}`);return t.documentElement}else return s}const qh="px",Xh=90,pa=["mm","cm","in","pt","pc","px"],ga={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 ee(s){let e="px";if(typeof s=="string")for(let r=0,i=pa.length;r<i;r++){const n=pa[r];if(s.endsWith(n)){e=n,s=s.substring(0,s.length-n.length);break}}let t;return t=ga[e][qh],t<0&&(t=ga[e].in*Xh),t*Number.parseFloat(s)}const Hh=new _e,Ei=new _e,ma=new _e,ya=new _e;function Yh(s,e,t){if(!(s.hasAttribute("transform")||s.nodeName==="use"&&(s.hasAttribute("x")||s.hasAttribute("y"))))return null;const r=Kh(s);return t.length>0&&r.premultiply(t[t.length-1]),e.copy(r),t.push(r),r}function Kh(s){const e=new _e,t=Hh;if(s.nodeName==="use"&&(s.hasAttribute("x")||s.hasAttribute("y"))&&e.translate(ee(s.getAttribute("x")),ee(s.getAttribute("y"))),s.hasAttribute("transform")){const r=s.getAttribute("transform").split(")");for(let i=r.length-1;i>=0;i--){const n=r[i].trim();if(n==="")continue;const o=n.indexOf("("),a=n.length;if(o>0&&o<a){const l=n.slice(0,o),c=ht(n.slice(o+1));switch(t.identity(),l){case"translate":if(c.length>=1){const h=c[0];let f=0;c.length>=2&&(f=c[1]),t.translate(h,f)}break;case"rotate":if(c.length>=1){let h=0,f=0,d=0;h=c[0]*Math.PI/180,c.length>=3&&(f=c[1],d=c[2]),Ei.makeTranslation(-f,-d),ma.makeRotation(h),ya.multiplyMatrices(ma,Ei),Ei.makeTranslation(f,d),t.multiplyMatrices(Ei,ya)}break;case"scale":c.length>=1&&t.scale(c[0],c[1]??c[0]);break;case"skewX":c.length===1&&t.set(1,Math.tan(c[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":c.length===1&&t.set(1,0,0,Math.tan(c[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":c.length===6&&t.set(c[0],c[2],c[4],c[1],c[3],c[5],0,0,1);break}}e.premultiply(t)}}return e}function Zh(s){return new ge().arc(ee(s.getAttribute("cx")||0),ee(s.getAttribute("cy")||0),ee(s.getAttribute("r")||0),0,Math.PI*2)}function Jh(s,e){if(!(!s.sheet||!s.sheet.cssRules||!s.sheet.cssRules.length))for(let t=0;t<s.sheet.cssRules.length;t++){const r=s.sheet.cssRules[t];if(r.type!==1)continue;const i=r.selectorText.split(/,/g).filter(Boolean).map(o=>o.trim()),n={};for(let o=r.style.length,a=0;a<o;a++){const l=r.style.item(a);n[l]=r.style.getPropertyValue(l)}for(let o=0;o<i.length;o++)e[i[o]]=Object.assign(e[i[o]]||{},{...n})}}function Qh(s){return new ge().ellipse(ee(s.getAttribute("cx")||0),ee(s.getAttribute("cy")||0),ee(s.getAttribute("rx")||0),ee(s.getAttribute("ry")||0),0,0,Math.PI*2)}function eu(s){return new ge().moveTo(ee(s.getAttribute("x1")||0),ee(s.getAttribute("y1")||0)).lineTo(ee(s.getAttribute("x2")||0),ee(s.getAttribute("y2")||0))}function tu(s){const e=new ge,t=s.getAttribute("d");return!t||t==="none"?null:(e.addData(t),e)}const ru=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function iu(s){const e=new ge;let t=0;return s.getAttribute("points")?.replace(ru,(r,i,n)=>{const o=ee(i),a=ee(n);return t===0?e.moveTo(o,a):e.lineTo(o,a),t++,r}),e.currentCurve.autoClose=!0,e}const su=/([+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g;function nu(s){const e=new ge;let t=0;return s.getAttribute("points")?.replace(su,(r,i,n)=>{const o=ee(i),a=ee(n);return t===0?e.moveTo(o,a):e.lineTo(o,a),t++,r}),e.currentCurve.autoClose=!1,e}function ou(s){const e=ee(s.getAttribute("x")||0),t=ee(s.getAttribute("y")||0),r=ee(s.getAttribute("rx")||s.getAttribute("ry")||0),i=ee(s.getAttribute("ry")||s.getAttribute("rx")||0),n=ee(s.getAttribute("width")),o=ee(s.getAttribute("height")),a=1-.551915024494,l=new ge;return l.moveTo(e+r,t),l.lineTo(e+n-r,t),(r!==0||i!==0)&&l.bezierCurveTo(e+n-r*a,t,e+n,t+i*a,e+n,t+i),l.lineTo(e+n,t+o-i),(r!==0||i!==0)&&l.bezierCurveTo(e+n,t+o-i*a,e+n-r*a,t+o,e+n-r,t+o),l.lineTo(e+r,t+o),(r!==0||i!==0)&&l.bezierCurveTo(e+r*a,t+o,e,t+o-i*a,e,t+o-i),l.lineTo(e,t+i),(r!==0||i!==0)&&l.bezierCurveTo(e,t+i*a,e+r*a,t,e+r,t),l}function ut(s,e,t){e=Object.assign({},e);let r={};if(s.hasAttribute("class")){const c=s.getAttribute("class").split(/\s/).filter(Boolean).map(h=>h.trim());for(let h=0;h<c.length;h++)r=Object.assign(r,t[`.${c[h]}`])}s.hasAttribute("id")&&(r=Object.assign(r,t[`#${s.getAttribute("id")}`]));for(let c=s.style.length,h=0;h<c;h++){const f=s.style.item(h),d=s.style.getPropertyValue(f);e[f]=d,r[f]=d}function i(c,h,f=n){s.hasAttribute(c)&&(e[h]=f(s.getAttribute(c))),r[c]&&(e[h]=f(r[c]))}function n(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,ee(c)))}function a(c){return Math.max(0,ee(c))}function l(c){return c.split(" ").filter(h=>h!=="").map(h=>ee(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",ee),i("visibility","visibility"),e}function Fs(s,e,t=[],r={}){if(s.nodeType!==1)return t;let i=!1,n=null,o={...e};switch(s.nodeName){case"svg":o=ut(s,o,r);break;case"style":Jh(s,r);break;case"g":o=ut(s,o,r);break;case"path":o=ut(s,o,r),s.hasAttribute("d")&&(n=tu(s));break;case"rect":o=ut(s,o,r),n=ou(s);break;case"polygon":o=ut(s,o,r),n=iu(s);break;case"polyline":o=ut(s,o,r),n=nu(s);break;case"circle":o=ut(s,o,r),n=Zh(s);break;case"ellipse":o=ut(s,o,r),n=Qh(s);break;case"line":o=ut(s,o,r),n=eu(s);break;case"defs":i=!0;break;case"use":{o=ut(s,o,r);const d=(s.getAttributeNS("http://www.w3.org/1999/xlink","href")||s.getAttribute("href")||"").substring(1),g=s.viewportElement?.getElementById(d);g?Fs(g,o,t,r):console.warn(`'use node' references non-existent node id: ${d}`);break}default:console.warn(s);break}if(o.display==="none")return t;const a=new _e,l=[],c=Yh(s,a,l);n&&(n.applyTransform(a),t.push(n),n.style={...o});const h=s.childNodes;for(let f=0,d=h.length;f<d;f++){const g=h[f];i&&g.nodeName!=="style"&&g.nodeName!=="defs"||Fs(g,o,t,r)}return c&&(l.pop(),l.length>0?a.copy(l[l.length-1]):a.identity()),t}function $s(s){const e=Ns(s);return new Ct(Fs(e,{}),e.getAttribute("viewBox")?.trim().split(" ").map(t=>Number(t)))}function va(s,e,t,r,i){const n=(r-e)*.5,o=(i-t)*.5,a=s*s,l=s*a;return(2*t-2*r+n+o)*l+(-3*t+3*r-2*n-o)*a+n*s+t}function au(s,e){const t=1-s;return t*t*t*e}function lu(s,e){const t=1-s;return 3*t*t*s*e}function cu(s,e){return 3*(1-s)*s*s*e}function hu(s,e){return s*s*s*e}function _a(s,e,t,r,i){return au(s,e)+lu(s,t)+cu(s,r)+hu(s,i)}function ba(s,e={}){let{vertices:t=[],indices:r=[],holes:i=[],verticesStride:n=2,verticesOffset:o=t.length/n,indicesOffset:a=r.length}=e;const l=Sh(s,i,2);if(l.length){for(let h=0;h<l.length;h+=3)r[a++]=l[h]+o,r[a++]=l[h+1]+o,r[a++]=l[h+2]+o;let c=o*n;for(let h=0;h<s.length;h+=2)t[c]=s[h],t[c+1]=s[h+1],c+=n}return{vertices:t,indices:r}}const uu=8,Mi=11920929e-14,fu=1;function du(s,e,t,r,i,n,o,a,l=.5,c=[]){const f=Math.min(.99,Math.max(0,l));let d=(fu-f)/1;return d*=d,zs(s,e,t,r,i,n,o,a,c,d,0),c.push(o,a),c}function zs(s,e,t,r,i,n,o,a,l,c,h){if(h>uu)return;const f=(s+t)/2,d=(e+r)/2,g=(t+i)/2,p=(r+n)/2,y=(i+o)/2,m=(n+a)/2,P=(f+g)/2,E=(d+p)/2,x=(g+y)/2,C=(p+m)/2,v=(P+x)/2,b=(E+C)/2;if(h>0){let S=o-s,T=a-e;const R=Math.abs((t-o)*T-(r-a)*S),G=Math.abs((i-o)*T-(n-a)*S);if(R>Mi&&G>Mi){if((R+G)*(R+G)<=c*(S*S+T*T)){l.push(v,b);return}}else if(R>Mi){if(R*R<=c*(S*S+T*T)){l.push(v,b);return}}else if(G>Mi){if(G*G<=c*(S*S+T*T)){l.push(v,b);return}}else if(S=v-(s+o)/2,T=b-(e+a)/2,S*S+T*T<=c){l.push(v,b);return}}zs(s,e,f,d,P,E,v,b,l,c,h+1),zs(v,b,x,C,y,m,o,a,l,c,h+1)}const pu=8,gu=11920929e-14,mu=1;function yu(s,e,t,r,i,n,o=.5,a=[]){const c=Math.min(.99,Math.max(0,o));let h=(mu-c)/1;return h*=h,Vs(a,s,e,t,r,i,n,h,0),a.push(i,n),a}function Vs(s,e,t,r,i,n,o,a,l){if(l>pu)return;const c=(e+r)/2,h=(t+i)/2,f=(r+n)/2,d=(i+o)/2,g=(c+f)/2,p=(h+d)/2;let y=n-e,m=o-t;const P=Math.abs((r-n)*m-(i-o)*y);if(P>gu){if(P*P<=a*(y*y+m*m)){s.push(g,p);return}}else if(y=g-(e+n)/2,m=p-(t+o)/2,y*y+m*m<=a){s.push(g,p);return}Vs(s,e,t,c,h,g,p,a,l+1),Vs(s,g,p,f,d,n,o,a,l+1)}function vu(s){return s.replace(/[^a-z0-9]/gi,"-").replace(/\B([A-Z])/g,"-$1").toLowerCase()}function _u(s,e,t,r){const i=e.clone().sub(s),n=r.clone().sub(t),o=t.clone().sub(s),a=i.cross(n);if(a===0)return new O((s.x+t.x)/2,(s.y+t.y)/2);const l=o.cross(n)/a;return Math.abs(l)>1?new O((s.x+t.x)/2,(s.y+t.y)/2):new O(s.x+l*i.x,s.y+l*i.y)}function bu(s){let e=0;const t=s.length/2;for(let r=0;r<t;r++){const i=s[2*r],n=s[2*r+1],o=(r+1)%t,a=s[2*o],l=s[2*o+1];e+=(a-i)*(l+n)}return e}function wa(s,e,t,r,i,n){return(t-s)*(n-e)-(i-s)*(r-e)}function wu(s,e,t){const r=t.length;let i=0;for(let n=0,o=r-2;n<r;o=n,n+=2){const a=t[n],l=t[n+1],c=t[o],h=t[o+1];l<=e?h>e&&wa(c,h,a,l,s,e)>0&&i++:h<=e&&wa(c,h,a,l,s,e)<0&&i--}return i}function xu(s){const e=s.length,t=s.map((r,i)=>({index:i,parentIndex:null,wn:0}));for(let r=0;r<e;r++){let i=null;if(bu(s[r])<0)continue;const n=[s[r][0],s[r][1]];for(let o=0;o<e;o++){if(r===o)continue;let a=0;for(let c=0;c<n.length&&(a=a||wu(n[c],n[c+1],s[o]),!a);c+=2);const l=Math.abs(a);l!==0&&(!i||l>Math.abs(i.wn))&&(i={idx:o,wn:a})}i&&(t[r].parentIndex=i.idx,t[r].wn=i.wn)}return t}function Pu(s,e){const t=1-s;return t*t*e}function Su(s,e){return 2*(1-s)*s*e}function Cu(s,e){return s*s*e}function xa(s,e,t,r){return Pu(s,e)+Su(s,t)+Cu(s,r)}const Tu=1e-4,Pa=1e-4;function Eu(s,e={}){const{vertices:t=[],indices:r=[],lineStyle:i={alignment:.5,cap:"butt",join:"miter",width:1,miterLimit:10},flipAlignment:n=!1,closed:o=!0}=e,a=Tu;if(s.length===0)return{vertices:t,indices:r};const l=i;let c=l.alignment;if(i.alignment!==.5){let I=Mu(s);n&&(I*=-1),c=(c-.5)*I+.5}const h={x:s[0],y:s[1]},f={x:s[s.length-2],y:s[s.length-1]},d=o,g=Math.abs(h.x-f.x)<a&&Math.abs(h.y-f.y)<a;if(d){s=s.slice(),g&&(s.pop(),s.pop(),f.x=s[s.length-2],f.y=s[s.length-1]);const I=(h.x+f.x)*.5,j=(f.y+h.y)*.5;s.unshift(I,j),s.push(I,j)}const p=t,y=s.length/2;let m=s.length;const P=p.length/2,E=l.width/2,x=E*E,C=l.miterLimit*l.miterLimit;let v=s[0],b=s[1],S=s[2],T=s[3],R=0,G=0,U=-(b-T),L=v-S,V=0,B=0,k=Math.sqrt(U*U+L*L);U/=k,L/=k,U*=E,L*=E;const H=c,D=(1-H)*2,N=H*2;d||(l.cap==="round"?m+=Ht(v-U*(D-N)*.5,b-L*(D-N)*.5,v-U*D,b-L*D,v+U*N,b+L*N,p,!0)+2:l.cap==="square"&&(m+=Sa(v,b,U,L,D,N,!0,p))),p.push(v-U*D,b-L*D),p.push(v+U*N,b+L*N);for(let I=1;I<y-1;++I){v=s[(I-1)*2],b=s[(I-1)*2+1],S=s[I*2],T=s[I*2+1],R=s[(I+1)*2],G=s[(I+1)*2+1],U=-(b-T),L=v-S,k=Math.sqrt(U*U+L*L),U/=k,L/=k,U*=E,L*=E,V=-(T-G),B=S-R,k=Math.sqrt(V*V+B*B),V/=k,B/=k,V*=E,B*=E;const j=S-v,A=b-T,M=S-R,F=G-T,z=j*M+A*F,Y=A*M-F*j,J=Y<0;if(Math.abs(Y)<.001*Math.abs(z)){p.push(S-U*D,T-L*D),p.push(S+U*N,T+L*N),z>=0&&(l.join==="round"?m+=Ht(S,T,S-U*D,T-L*D,S-V*D,T-B*D,p,!1)+4:m+=2,p.push(S-V*N,T-B*N),p.push(S+V*D,T+B*D));continue}const ae=(-U+v)*(-L+T)-(-U+S)*(-L+b),_t=(-V+R)*(-B+T)-(-V+S)*(-B+G),Ze=(j*_t-M*ae)/Y,Be=(F*ae-A*_t)/Y,$e=(Ze-S)*(Ze-S)+(Be-T)*(Be-T),Pe=S+(Ze-S)*D,ze=T+(Be-T)*D,st=S-(Ze-S)*N,nt=T-(Be-T)*N,Je=Math.min(j*j+A*A,M*M+F*F),nc=J?D:N,Om=Je+nc*nc*x;$e<=Om?l.join==="bevel"||$e/x>C?(J?(p.push(Pe,ze),p.push(S+U*N,T+L*N),p.push(Pe,ze),p.push(S+V*N,T+B*N)):(p.push(S-U*D,T-L*D),p.push(st,nt),p.push(S-V*D,T-B*D),p.push(st,nt)),m+=2):l.join==="round"?J?(p.push(Pe,ze),p.push(S+U*N,T+L*N),m+=Ht(S,T,S+U*N,T+L*N,S+V*N,T+B*N,p,!0)+4,p.push(Pe,ze),p.push(S+V*N,T+B*N)):(p.push(S-U*D,T-L*D),p.push(st,nt),m+=Ht(S,T,S-U*D,T-L*D,S-V*D,T-B*D,p,!1)+4,p.push(S-V*D,T-B*D),p.push(st,nt)):(p.push(Pe,ze),p.push(st,nt)):(p.push(S-U*D,T-L*D),p.push(S+U*N,T+L*N),l.join==="round"?J?m+=Ht(S,T,S+U*N,T+L*N,S+V*N,T+B*N,p,!0)+2:m+=Ht(S,T,S-U*D,T-L*D,S-V*D,T-B*D,p,!1)+2:l.join==="miter"&&$e/x<=C&&(J?(p.push(st,nt),p.push(st,nt)):(p.push(Pe,ze),p.push(Pe,ze)),m+=2),p.push(S-V*D,T-B*D),p.push(S+V*N,T+B*N),m+=2)}v=s[(y-2)*2],b=s[(y-2)*2+1],S=s[(y-1)*2],T=s[(y-1)*2+1],U=-(b-T),L=v-S,k=Math.sqrt(U*U+L*L),U/=k,L/=k,U*=E,L*=E,p.push(S-U*D,T-L*D),p.push(S+U*N,T+L*N),d||(l.cap==="round"?m+=Ht(S-U*(D-N)*.5,T-L*(D-N)*.5,S-U*D,T-L*D,S+U*N,T+L*N,p,!1)+2:l.cap==="square"&&(m+=Sa(S,T,U,L,D,N,!1,p)));const $=Pa*Pa;for(let I=P;I<m+P-2;++I)v=p[I*2],b=p[I*2+1],S=p[(I+1)*2],T=p[(I+1)*2+1],R=p[(I+2)*2],G=p[(I+2)*2+1],!(Math.abs(v*(T-G)+S*(G-b)+R*(b-T))<$)&&r.push(I,I+1,I+2);return{vertices:t,indices:r}}function Mu(s){const e=s.length;if(e<6)return 1;let t=0;for(let r=0,i=s[e-2],n=s[e-1];r<e;r+=2){const o=s[r],a=s[r+1];t+=(o-i)*(a+n),i=o,n=a}return t<0?-1:1}function Sa(s,e,t,r,i,n,o,a){const l=s-t*i,c=e-r*i,h=s+t*n,f=e+r*n;let d,g;o?(d=r,g=-t):(d=-r,g=t);const p=l+d,y=c+g,m=h+d,P=f+g;return a.push(p,y),a.push(m,P),2}function Ht(s,e,t,r,i,n,o,a){const l=t-s,c=r-e;let h=Math.atan2(l,c),f=Math.atan2(i-s,n-e);a&&h<f?h+=Math.PI*2:!a&&h>f&&(f+=Math.PI*2);let d=h;const g=f-h,p=Math.abs(g),y=Math.sqrt(l*l+c*c),m=(15*p*Math.sqrt(y)/Math.PI>>0)+1,P=g/m;if(d+=P,a){o.push(s,e),o.push(t,r);for(let E=1,x=d;E<m;E++,x+=P)o.push(s,e),o.push(s+Math.sin(x)*y,e+Math.cos(x)*y);o.push(s,e),o.push(i,n)}else{o.push(t,r),o.push(s,e);for(let E=1,x=d;E<m;E++,x+=P)o.push(s+Math.sin(x)*y,e+Math.cos(x)*y),o.push(s,e);o.push(i,n),o.push(s,e)}return m*2}class ur{arcLengthDivision=200;_arcLengths;getPointAt(e,t=new O){return this.getPoint(this.getUToTMapping(e),t)}isClockwise(){return!1}getControlPointRefs(){return[]}applyTransform(e){const t=typeof e=="function";return this.getControlPointRefs().forEach(r=>{t?e(r):r.applyMatrix3(e)}),this}getUnevenVertices(e=5,t=[]){const r=new O;for(let i=0,n=Math.max(1,e)-1;i<=n;i++)this.getPoint(i/n,r),t.push(r.x,r.y);return t}getSpacedVertices(e=5,t=[]){const r=new O;for(let i=0,n=Math.max(1,e)-1;i<=n;i++)this.getPointAt(i/n,r),t.push(r.x,r.y);return t}getAdaptiveVertices(e=[]){return this.getUnevenVertices(5,e)}_verticesToPoints(e,t=[]){for(let r=0,i=e.length;r<i;r+=2){const n=e[r],o=e[r+1];t.push(new O(n,o))}return t}getSpacedPoints(e,t=[]){const r=this.getSpacedVertices(e);return this._verticesToPoints(r,t),t}getUnevenPoints(e,t=[]){const r=this.getUnevenVertices(e);return this._verticesToPoints(r,t),t}getAdaptivePoints(e=[]){const t=this.getAdaptiveVertices();return this._verticesToPoints(t,e),e}getPoints(e,t=[]){let r;return e?r=this.getUnevenVertices(e):r=this.getAdaptiveVertices(),this._verticesToPoints(r,t),t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(){return(!this._arcLengths||this._arcLengths.length!==this.arcLengthDivision+1)&&this.updateLengths(),this._arcLengths}updateLengths(){const e=this.arcLengthDivision,t=[0];for(let r=0,i=this.getPoint(0),n=1;n<=e;n++){const o=this.getPoint(n/e);r+=o.distanceTo(i),t.push(r),i=o}this._arcLengths=t}getUToTMapping(e,t){const r=this.getLengths(),i=r.length,n=t??e*r[i-1];if(i<2)return n/r[0];let o=0,a=0,l=i-1,c;for(;a<=l;)if(o=Math.floor(a+(l-a)/2),c=r[o]-n,c<0)a=o+1;else if(c>0)l=o-1;else{l=o;break}if(o=l,r[o]===n)return o/(i-1);const h=r[o],d=r[o+1]-h,g=(n-h)/d;return(o+g)/(i-1)}getTangent(e,t=new O){const i=Math.max(0,e-1e-4),n=Math.min(1,e+1e-4);return t.copy(this.getPoint(n).sub(this.getPoint(i)).normalize())}getTangentAt(e,t){return this.getTangent(this.getUToTMapping(e),t)}getNormal(e,t=new O){return this.getTangent(e,t),t.set(-t.y,t.x).normalize()}getNormalAt(e,t){return this.getNormal(this.getUToTMapping(e),t)}getTForPoint(e,t=.001){let r=0,i=1,n=(r+i)/2;for(;i-r>t;){n=(r+i)/2;const o=this.getPoint(n);if(o.distanceTo(e)<t)return n;o.x<e.x?r=n:i=n}return n}getMinMax(e=O.MAX,t=O.MIN){const r=this.getPoints();for(let i=0,n=r.length;i<n;i++){const o=r[i];e.min(o),t.max(o)}return{min:e.finite(),max:t.finite()}}getBoundingBox(){const{min:e,max:t}=this.getMinMax();return new Z(e.x,e.y,t.x-e.x,t.y-e.y)}getFillVertices(e){return this.getAdaptiveVertices()}fillTriangulate(e){return ba(this.getFillVertices(e),e)}strokeTriangulate(e){return Eu(this.getAdaptiveVertices(),e)}toCommands(){const e=[],t=this.getPoints();for(let r=0,i=t.length;r<i;r++){const n=t[r];r===0?e.push({type:"M",x:n.x,y:n.y}):e.push({type:"L",x:n.x,y:n.y})}return e}toData(){return jh(this.toCommands())}drawTo(e){return this.toCommands().forEach(t=>{switch(t.type){case"M":e.moveTo(t.x,t.y);break;case"L":e.lineTo(t.x,t.y);break}}),this}copy(e){return this.arcLengthDivision=e.arcLengthDivision,this}clone(){return new this.constructor().copy(this)}}const Au=new _e,Ca=new _e,Ta=new _e,Ai=new O;class Gs extends ur{constructor(e=new O,t=new O,r=new O,i=0,n=0,o=Math.PI*2,a=!1){super(),this._center=e,this._radius=t,this._diff=r,this.rotate=i,this.startAngle=n,this.endAngle=o,this.clockwise=a}get cx(){return this._center.x}set cx(e){this._center.x=e}get cy(){return this._center.y}set cy(e){this._center.y=e}get rx(){return this._radius.x}set rx(e){this._radius.x=e}get ry(){return this._radius.y}set ry(e){this._radius.y=e}get dx(){return this._diff.x}set dx(e){this._diff.x=e}get dy(){return this._diff.y}set dy(e){this._diff.y=e}isClockwise(){return this.clockwise}_getDeltaAngle(){const e=Math.PI*2;let t=this.endAngle-this.startAngle;const r=Math.abs(t)<Number.EPSILON;return t=(t%e+e)%e,r?t=0:this.clockwise||(t=t===0?-e:t-e),t}getPoint(e,t=new O){const r=this._getDeltaAngle(),i=this.startAngle+e*r;let n=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=n-this.cx,h=o-this.cy;n=c*a-h*l+this.cx,o=c*l+h*a+this.cy}return t.set(n,o)}toCommands(){const{cx:e,cy:t,rx:r,ry:i,startAngle:n,endAngle:o,clockwise:a,rotate:l}=this,c=e+r*Math.cos(n)*Math.cos(l)-i*Math.sin(n)*Math.sin(l),h=t+r*Math.cos(n)*Math.sin(l)+i*Math.sin(n)*Math.cos(l),f=Math.abs(n-o),d=f>Math.PI?1:0,g=a?1:0,p=l*180/Math.PI;if(f>=2*Math.PI){const y=n+Math.PI,m=e+r*Math.cos(y)*Math.cos(l)-i*Math.sin(y)*Math.sin(l),P=t+r*Math.cos(y)*Math.sin(l)+i*Math.sin(y)*Math.cos(l);return[{type:"M",x:c,y:h},{type:"A",rx:r,ry:i,angle:p,largeArcFlag:0,sweepFlag:g,x:m,y:P},{type:"A",rx:r,ry:i,angle:p,largeArcFlag:0,sweepFlag:g,x:c,y:h}]}else{const y=e+r*Math.cos(o)*Math.cos(l)-i*Math.sin(o)*Math.sin(l),m=t+r*Math.cos(o)*Math.sin(l)+i*Math.sin(o)*Math.cos(l);return[{type:"M",x:c,y:h},{type:"A",rx:r,ry:i,angle:p,largeArcFlag:d,sweepFlag:g,x:y,y:m}]}}drawTo(e){const{cx:t,cy:r,rx:i,ry:n,rotate:o,startAngle:a,endAngle:l,clockwise:c}=this;return e.ellipse(t,r,i,n,o,a,l,!c),this}applyTransform(e){return Ai.set(this.cx,this.cy),Ai.applyMatrix3(e),this.cx=Ai.x,this.cy=Ai.y,Du(e)?Ou(this,e):ku(this,e),this}getControlPointRefs(){return[this._center]}_getAdaptiveVerticesByArc(e=[]){const{cx:t,cy:r,rx:i,ry:n,dx:o,dy:a,startAngle:l,endAngle:c,clockwise:h,rotate:f}=this,d=!h;let g=Math.abs(l-c);(!d&&l>c||d&&c>l)&&(g=2*Math.PI-g);const p=Math.max(12,Math.floor(12*i**(1/3)*(g/Math.PI)));let y=g/p,m=l;y*=d?-1:1;const P=Math.cos(d?f:-f),E=Math.sin(d?f:-f);for(let x=0;x<p+1;x++){const C=o+Math.cos(m)*i,v=a+Math.sin(m)*n,b=C*P-v*E,S=C*E+v*P;e.push(t+b,r+S),m+=y}return e}_getAdaptiveVerticesByCircle(e=[]){const{cx:t,cy:r,rx:i,ry:n,dx:o,dy:a,rotate:l,clockwise:c}=this;if(!(i>=0&&n>=0&&o>=0&&a>=0))return e;const h=Math.ceil(2.3*Math.sqrt(i+n)),f=h*8+(o?4:0)+(a?4:0),d=[];if(f===0)return e;{const y=d.length;if(h===0)d[y]=d[y+6]=t+o,d[y+1]=d[y+3]=r+a,d[y+2]=d[y+4]=t-o,d[y+5]=d[y+7]=r-a;else{let m=y,P=y+h*4+(o?2:0)+2,E=P,x=f,C=o+i,v=a,b=t+C,S=t-C,T=r+v;if(d[m++]=b,d[m++]=T,d[--P]=T,d[--P]=S,a){const G=r-v;d[E++]=S,d[E++]=G,d[--x]=G,d[--x]=b}for(let G=1;G<h;G++){const U=Math.PI/2*(G/h),L=o+Math.cos(U)*i,V=a+Math.sin(U)*n,B=t+L,k=t-L,H=r+V,D=r-V;d[m++]=B,d[m++]=H,d[--P]=H,d[--P]=k,d[E++]=k,d[E++]=D,d[--x]=D,d[--x]=B}C=o,v=a+n,b=t+C,S=t-C,T=r+v;const R=r-v;d[m++]=b,d[m++]=T,d[--x]=R,d[--x]=b,o&&(d[m++]=S,d[m++]=T,d[--x]=R,d[--x]=S)}}const g=Math.cos(c?-l:l),p=Math.sin(c?-l:l);for(let y=0;y<d.length;y+=2){const m=d[y],P=d[y+1],E=m-t,x=P-r,C=E*g-x*p,v=E*p+x*g;e.push(t+C,r+v)}return e}getAdaptiveVertices(e=[]){return this.startAngle===0&&this.endAngle===Math.PI*2?this._getAdaptiveVerticesByCircle(e):this._getAdaptiveVerticesByArc(e)}copy(e){return super.copy(e),this.cx=e.cx,this.cy=e.cy,this.rx=e.rx,this.ry=e.ry,this.dx=e.dx,this.dy=e.dy,this.startAngle=e.startAngle,this.endAngle=e.endAngle,this.clockwise=e.clockwise,this.rotate=e.rotate,this}}function Ou(s,e){const t=s.rx,r=s.ry,i=Math.cos(s.rotate),n=Math.sin(s.rotate),o=new O(t*i,t*n),a=new O(-r*n,r*i),l=o.applyMatrix3(e),c=a.applyMatrix3(e),h=Au.set(l.x,c.x,0,l.y,c.y,0,0,0,1),f=Ca.copy(h).invert(),p=Ta.copy(f).transpose().multiply(f).elements,y=Iu(p[0],p[1],p[4]),m=Math.sqrt(y.rt1),P=Math.sqrt(y.rt2);if(s.rx=1/m,s.ry=1/P,s.rotate=Math.atan2(y.sn,y.cs),!((s.endAngle-s.startAngle)%(2*Math.PI)<Number.EPSILON)){const x=Ca.set(m,0,0,0,P,0,0,0,1),C=Ta.set(y.cs,y.sn,0,-y.sn,y.cs,0,0,0,1),v=x.multiply(C).multiply(h),b=S=>{const{x:T,y:R}=new O(Math.cos(S),Math.sin(S)).applyMatrix3(v);return Math.atan2(R,T)};s.startAngle=b(s.startAngle),s.endAngle=b(s.endAngle),Ea(e)&&(s.clockwise=!s.clockwise)}}function ku(s,e){const t=Ma(e),r=Aa(e);s.rx*=t,s.ry*=r;const i=t>Number.EPSILON?Math.atan2(e.elements[1],e.elements[0]):Math.atan2(-e.elements[3],e.elements[4]);s.rotate+=i,Ea(e)&&(s.startAngle*=-1,s.endAngle*=-1,s.clockwise=!s.clockwise)}function Ea(s){const e=s.elements;return e[0]*e[4]-e[1]*e[3]<0}function Du(s){const e=s.elements,t=e[0]*e[3]+e[1]*e[4];if(t===0)return!1;const r=Ma(s),i=Aa(s);return Math.abs(t/(r*i))>Number.EPSILON}function Ma(s){const e=s.elements;return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Aa(s){const e=s.elements;return Math.sqrt(e[3]*e[3]+e[4]*e[4])}function Iu(s,e,t){let r,i,n,o,a;const l=s+t,c=s-t,h=Math.sqrt(c*c+4*e*e);return l>0?(r=.5*(l+h),a=1/r,i=s*a*t-e*a*e):l<0?i=.5*(l-h):(r=.5*h,i=-.5*h),c>0?n=c+h:n=c-h,Math.abs(n)>2*Math.abs(e)?(a=-2*e/n,o=1/Math.sqrt(1+a*a),n=a*o):Math.abs(e)===0?(n=1,o=0):(a=-.5*n/e,n=1/Math.sqrt(1+a*a),o=a*n),c>0&&(a=n,n=-o,o=a),{rt1:r,rt2:i,cs:n,sn:o}}class Ru extends Gs{constructor(e=0,t=0,r=1,i=0,n=Math.PI*2,o=!1){super(new O(e,t),new O(r,r),new O,0,i,n,o)}drawTo(e){const{cx:t,cy:r,rx:i,startAngle:n,endAngle:o,clockwise:a}=this;return e.arc(t,r,i,n,o,!a),this}}class St extends ur{constructor(e=new O,t=new O){super(),this.p1=e,this.p2=t}static from(e,t,r,i){return new St(new O(e,t),new O(r,i))}getPoint(e,t=new O){return e===1?t.copy(this.p2):t.copy(this.p2).sub(this.p1).scale(e).add(this.p1),t}getPointAt(e,t=new O){return this.getPoint(e,t)}getTangent(e,t=new O){return t.subVectors(this.p2,this.p1).normalize()}getTangentAt(e,t=new O){return this.getTangent(e,t)}getControlPointRefs(){return[this.p1,this.p2]}getAdaptiveVertices(e=[]){return e.push(this.p1.x,this.p1.y,this.p2.x,this.p2.y),e}getMinMax(e=O.MAX,t=O.MIN){const{p1:r,p2:i}=this;return e.x=Math.min(e.x,r.x,i.x),e.y=Math.min(e.y,r.y,i.y),t.x=Math.max(t.x,r.x,i.x),t.y=Math.max(t.y,r.y,i.y),{min:e.finite(),max:t.finite()}}toCommands(){const{p1:e,p2:t}=this;return[{type:"M",x:e.x,y:e.y},{type:"L",x:t.x,y:t.y}]}getFillVertices(e={}){const t=Math.min(this.p1.x,this.p2.x),r=Math.max(this.p1.x,this.p2.x),i=Math.min(this.p1.y,this.p2.y),n=Math.max(this.p1.y,this.p2.y),o=t,a=i,l=r-t||e.style?.strokeWidth||0,c=n-i||e.style?.strokeWidth||0;return[o,a,o+l,a,o+l,a+c,o,a+c]}drawTo(e){const{p1:t,p2:r}=this;return e.lineTo(t.x,t.y),e.lineTo(r.x,r.y),this}copy(e){return super.copy(e),this.p1.copy(e.p1),this.p2.copy(e.p2),this}}class Br extends ur{constructor(e=[]){super(),this.curves=e}getFlatCurves(){return this.curves.flatMap(e=>e instanceof Br?e.getFlatCurves():e)}addCurve(e){return this.curves.push(e),this}getPoint(e,t=new O){const r=e*this.getLength(),i=this.getLengths();let n=0;for(;n<i.length;){if(i[n]>=r){const o=i[n]-r,a=this.curves[n],l=a.getLength();return a.getPointAt(l===0?0:1-o/l,t)}n++}return t}updateLengths(){const e=[];for(let t=0,r=0,i=this.curves.length;t<i;t++)r+=this.curves[t].getLength(),e.push(r);this._arcLengths=e}getControlPointRefs(){return this.curves.flatMap(e=>e.getControlPointRefs())}_removeNextPointIfEqualPrevPoint(e,t){const r=[e[t-1],e[t]],i=[e[t+1],e[t+2]];return r[0]===i[0]&&r[1]===i[1]&&e.splice(t+1,2),e}getSpacedVertices(e=5,t=[]){let r;return this.curves.forEach(i=>{i.getSpacedVertices(e,t),r&&this._removeNextPointIfEqualPrevPoint(t,r),r=t.length-1}),t}getAdaptiveVertices(e=[]){let t;return this.curves.forEach(r=>{r.getAdaptiveVertices(e),t&&this._removeNextPointIfEqualPrevPoint(e,t),t=e.length-1}),e}strokeTriangulate(e){return this.curves.length===1?this.curves[0].strokeTriangulate(e):super.strokeTriangulate(e)}getFillVertices(e){if(this.curves.length===1)return this.curves[0].getFillVertices(e);{const t=[];let r;return this.curves.forEach(i=>{let n;i instanceof St?n=i.getAdaptiveVertices():n=i.getFillVertices(e),t.push(...n),r&&this._removeNextPointIfEqualPrevPoint(t,r),r=t.length-1}),t}}applyTransform(e){return this.curves.forEach(t=>t.applyTransform(e)),this}getMinMax(e=O.MAX,t=O.MIN){return this.curves.forEach(r=>r.getMinMax(e,t)),{min:e.finite(),max:t.finite()}}getBoundingBox(){const{min:e,max:t}=this.getMinMax();return new Z(e.x,e.y,t.x-e.x,t.y-e.y)}toCommands(){return this.curves.flatMap(e=>e.toCommands())}drawTo(e){const t=this.curves[0]?.getPoint(0);return t&&e.moveTo(t.x,t.y),this.curves.forEach(r=>r.drawTo(e)),this}copy(e){return super.copy(e),this.curves=e.curves.map(t=>t.clone()),this}}class js extends ur{constructor(e=new O,t=new O,r=new O,i=new O){super(),this.p1=e,this.cp1=t,this.cp2=r,this.p2=i}static from(e,t,r,i,n,o,a,l){return new js(new O(e,t),new O(r,i),new O(n,o),new O(a,l))}getPoint(e,t=new O){const{p1:r,cp1:i,cp2:n,p2:o}=this;return t.set(_a(e,r.x,i.x,n.x,o.x),_a(e,r.y,i.y,n.y,o.y))}getAdaptiveVertices(e=[]){return du(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,e)}getControlPointRefs(){return[this.p1,this.cp1,this.cp2,this.p2]}_solveQuadratic(e,t,r){const i=t*t-4*e*r;if(i<0)return[];const n=Math.sqrt(i),o=(-t+n)/(2*e),a=(-t-n)/(2*e);return[o,a].filter(l=>l>=0&&l<=1)}getMinMax(e=O.MAX,t=O.MIN){const{p1:r,cp1:i,cp2:n,p2:o}=this,a=this._solveQuadratic(3*(i.x-r.x),6*(n.x-i.x),3*(o.x-n.x)),l=this._solveQuadratic(3*(i.y-r.y),6*(n.y-i.y),3*(o.y-n.y)),c=[0,1,...a,...l];return((f,d)=>{for(const g of f)for(let p=0;p<=d;p++){const y=p/d-.5,m=Math.min(1,Math.max(0,g+y)),P=this.getPoint(m);e.x=Math.min(e.x,P.x),e.y=Math.min(e.y,P.y),t.x=Math.max(t.x,P.x),t.y=Math.max(t.y,P.y)}})(c,10),{min:e.finite(),max:t.finite()}}toCommands(){const{p1:e,cp1:t,cp2:r,p2:i}=this;return[{type:"M",x:e.x,y:e.y},{type:"C",x1:t.x,y1:t.y,x2:r.x,y2:r.y,x:i.x,y:i.y}]}drawTo(e){const{p1:t,cp1:r,cp2:i,p2:n}=this;return e.lineTo(t.x,t.y),e.bezierCurveTo(r.x,r.y,i.x,i.y,n.x,n.y),this}copy(e){return super.copy(e),this.p1.copy(e.p1),this.cp1.copy(e.cp1),this.cp2.copy(e.cp2),this.p2.copy(e.p2),this}}class Uu extends Gs{constructor(e=0,t=0,r=1,i=1,n=0,o=0,a=Math.PI*2,l=!1){super(new O(e,t),new O(r,i),new O,n,o,a,l)}drawTo(e){return e.ellipse(this.cx,this.cy,this.rx,this.ry,this.rotate,this.startAngle,this.endAngle,!this.clockwise),this}}class Bu extends Br{}class Ws extends ur{constructor(e=new O,t=new O,r=new O){super(),this.p1=e,this.cp=t,this.p2=r}static from(e,t,r,i,n,o){return new Ws(new O(e,t),new O(r,i),new O(n,o))}getPoint(e,t=new O){const{p1:r,cp:i,p2:n}=this;return t.set(xa(e,r.x,i.x,n.x),xa(e,r.y,i.y,n.y)),t}getControlPointRefs(){return[this.p1,this.cp,this.p2]}getAdaptiveVertices(e=[]){return yu(this.p1.x,this.p1.y,this.cp.x,this.cp.y,this.p2.x,this.p2.y,.5,e)}getMinMax(e=O.MAX,t=O.MIN){const{p1:r,cp:i,p2:n}=this,o=.5*(r.x+i.x),a=.5*(r.y+i.y),l=.5*(r.x+n.x),c=.5*(r.y+n.y);return e.x=Math.min(e.x,r.x,n.x,o,l),e.y=Math.min(e.y,r.y,n.y,a,c),t.x=Math.max(t.x,r.x,n.x,o,l),t.y=Math.max(t.y,r.y,n.y,a,c),{min:e.finite(),max:t.finite()}}toCommands(){const{p1:e,cp:t,p2:r}=this;return[{type:"M",x:e.x,y:e.y},{type:"Q",x1:t.x,y1:t.y,x:r.x,y:r.y}]}drawTo(e){const{p1:t,cp:r,p2:i}=this;return e.lineTo(t.x,t.y),e.quadraticCurveTo(r.x,r.y,i.x,i.y),this}copy(e){return super.copy(e),this.p1.copy(e.p1),this.cp.copy(e.cp),this.p2.copy(e.p2),this}}class Lu extends Bu{constructor(e=0,t=0,r=0,i=0){super(),this.x=e,this.y=t,this.width=r,this.height=i,this.update()}update(){const{x:e,y:t,width:r,height:i}=this,n=[new O(e,t),new O(e+r,t),new O(e+r,t+i),new O(e,t+i)];return this.curves=[new St(n[0],n[1]),new St(n[1],n[2]),new St(n[2],n[3]),new St(n[3],n[0])],this}drawTo(e){return e.rect(this.x,this.y,this.width,this.height),this}getFillVertices(e={}){const{x:t,y:r,width:i,height:n}=this;return[t,r,t+i,r,t+i,r+n,t,r+n]}copy(e){return super.copy(e),this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this.update(),this}}class Nu extends Gs{constructor(e=0,t=0,r=1,i=1,n=1){super(),this.x=e,this.y=t,this.width=r,this.height=i,this.radius=n,this.update()}update(){const{x:e,y:t,width:r,height:i,radius:n}=this,o=r/2,a=i/2,l=e+o,c=t+a,h=Math.max(0,Math.min(n,Math.min(o,a))),f=h;return this._center=new O(l,c),this._radius=new O(h,f),this._diff=new O(o-h,a-f),this}drawTo(e){const{x:t,y:r,width:i,height:n,radius:o}=this;return e.roundRect(t,r,i,n,o),this}copy(e){return super.copy(e),this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this.radius=e.radius,this.update(),this}}class Fu extends ur{constructor(e=[]){super(),this.points=e}getPoint(e,t=new O){const{points:r}=this,i=(r.length-1)*e,n=Math.floor(i),o=i-n,a=r[n===0?n:n-1],l=r[n],c=r[n>r.length-2?r.length-1:n+1],h=r[n>r.length-3?r.length-1:n+2];return t.set(va(o,a.x,l.x,c.x,h.x),va(o,a.y,l.y,c.y,h.y)),t}getControlPointRefs(){return this.points}copy(e){super.copy(e),this.points=[];for(let t=0,r=e.points.length;t<r;t++)this.points.push(e.points[t].clone());return this}}class Oi extends Br{startPoint;currentPoint;autoClose=!1;constructor(e){super(),e&&this.addPoints(e)}addPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,r=e.length;t<r;t++){const{x:i,y:n}=e[t];this.lineTo(i,n)}return this}addCommands(e){return ca(e,this),this}addData(e){return this.addCommands(ha(e)),this}_closeVertices(e){return this.autoClose&&e.length>=4&&e[0]!==e[e.length-2]&&e[1]!==e[e.length-1]&&e.push(e[0],e[1]),e}getUnevenVertices(e=40,t=[]){return this._closeVertices(super.getUnevenVertices(e,t))}getSpacedVertices(e=40,t=[]){return this._closeVertices(super.getSpacedVertices(e,t))}getAdaptiveVertices(e=[]){return this._closeVertices(super.getAdaptiveVertices(e))}getFillVertices(e){return this._closeVertices(super.getFillVertices(e))}_setCurrentPoint(e){return this.currentPoint=new O(e.x,e.y),this.startPoint||(this.startPoint=this.currentPoint.clone()),this}_connetLineTo(e){if(this.curves.length>0){const t=e.getPoint(0);(!this.currentPoint||!t.equals(this.currentPoint))&&this.lineTo(t.x,t.y)}return this}closePath(){const e=this.startPoint;if(e){const t=this.currentPoint;t&&!e.equals(t)&&(this.curves.push(new St(t.clone(),e.clone())),t.copy(e)),this.startPoint=void 0}return this}moveTo(e,t){return this.currentPoint=new O(e,t),this.startPoint=this.currentPoint.clone(),this}lineTo(e,t){const r=this.currentPoint;return r?.equals({x:e,y:t})||this.curves.push(St.from(r?.x??0,r?.y??0,e,t)),this._setCurrentPoint({x:e,y:t}),this}bezierCurveTo(e,t,r,i,n,o){const a=this.currentPoint;return a?.equals({x:n,y:o})||this.curves.push(js.from(a?.x??0,a?.y??0,e,t,r,i,n,o)),this._setCurrentPoint({x:n,y:o}),this}quadraticCurveTo(e,t,r,i){const n=this.currentPoint;return n?.equals({x:r,y:i})||this.curves.push(Ws.from(n?.x??0,n?.y??0,e,t,r,i)),this._setCurrentPoint({x:r,y:i}),this}arc(e,t,r,i,n,o){const a=new Ru(e,t,r,i,n,!o);return this._connetLineTo(a),this.curves.push(a),this._setCurrentPoint(a.getPoint(1)),this}relativeArc(e,t,r,i,n,o){return e+=this.currentPoint?.x??0,t+=this.currentPoint?.y??0,this.arc(e,t,r,i,n,o),this}arcTo(e,t,r,i,n){return console.warn("Method arcTo not supported yet"),this}ellipse(e,t,r,i,n,o,a,l=!0){const c=new Uu(e,t,r,i,n,o,a,!l);return this._connetLineTo(c),this.curves.push(c),this._setCurrentPoint(c.getPoint(1)),this}relativeEllipse(e,t,r,i,n,o,a,l){return e+=this.currentPoint?.x??0,t+=this.currentPoint?.y??0,this.ellipse(e,t,r,i,n,o,a,l),this}rect(e,t,r,i){const n=new Lu(e,t,r,i);return this._connetLineTo(n),this.curves.push(n),this._setCurrentPoint({x:e,y:t}),this}roundRect(e,t,r,i,n){const o=new Nu(e,t,r,i,n);return this._connetLineTo(o),this.curves.push(o),this._setCurrentPoint({x:e,y:t}),this}splineThru(e){const t=this.currentPoint??new O;return this.curves.push(new Fu([t].concat(e))),this._setCurrentPoint(e[e.length-1]),this}drawTo(e){const t=this.curves[0]?.getPoint(0);return t&&e.moveTo(t.x,t.y),this.curves.forEach(r=>r.drawTo(e)),this.autoClose&&e.closePath(),this}copy(e){return super.copy(e),this.autoClose=e.autoClose,this.currentPoint=e.currentPoint?.clone(),this}}class ge extends Br{currentCurve=new Oi;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(e,t={}){super(),this.curves.push(this.currentCurve),this.style=t,e&&(e instanceof ge?this.addPath(e):Array.isArray(e)?this.addCommands(e):this.addData(e))}addPath(e){const t=this.curves.findIndex(r=>r===this.currentCurve);return t>-1&&this.curves.splice(t,1),e instanceof ge?this.curves.push(...e.curves.filter(r=>r.curves.length).map(r=>r.clone())):e.curves.length&&this.curves.push(e),this.curves.push(this.currentCurve),this}closePath(){const e=this.startPoint;return e&&(this.currentCurve.closePath(),this.currentCurve.curves.length&&(this.currentCurve=new Oi().moveTo(e.x,e.y),this.curves.push(this.currentCurve))),this}moveTo(e,t){return this.currentCurve.currentPoint?.equals({x:e,y:t})||(this.currentCurve.curves.length&&(this.currentCurve=new Oi,this.curves.push(this.currentCurve)),this.currentCurve.moveTo(e,t)),this}lineTo(e,t){return this.currentCurve.lineTo(e,t),this}bezierCurveTo(e,t,r,i,n,o){return this.currentCurve.bezierCurveTo(e,t,r,i,n,o),this}quadraticCurveTo(e,t,r,i){return this.currentCurve.quadraticCurveTo(e,t,r,i),this}arc(e,t,r,i,n,o){return this.currentCurve.arc(e,t,r,i,n,o),this}arcTo(e,t,r,i,n){return this.currentCurve.arcTo(e,t,r,i,n),this}ellipse(e,t,r,i,n,o,a,l){return this.currentCurve.ellipse(e,t,r,i,n,o,a,l),this}rect(e,t,r,i){return this.currentCurve.rect(e,t,r,i),this}roundRect(e,t,r,i,n){return this.currentCurve.roundRect(e,t,r,i,n),this}reset(){return this.currentCurve=new Oi,this.curves=[this.currentCurve],this.style={},this}addCommands(e){return ca(e,this),this}addData(e){return this.addCommands(ha(e)),this}splineThru(e){return this.currentCurve.splineThru(e),this}scale(e,t=e,r={x:0,y:0}){return this.getControlPointRefs().forEach(i=>{i.scale(e,t,r)}),this}skew(e,t=0,r={x:0,y:0}){return this.getControlPointRefs().forEach(i=>{i.skew(e,t,r)}),this}rotate(e,t={x:0,y:0}){return this.getControlPointRefs().forEach(r=>{r.rotate(e,t)}),this}bold(e){if(e===0)return this;const t=this.getFlatCurves(),r=[],i=[],n=[];t.forEach((a,l)=>{const c=a.getControlPointRefs(),h=a.isClockwise();n[l]=c,i[l]=h;const f=c[0],d=c[c.length-1]??f;r.push({start:h?d:f,end:h?f:d,index:l})});const o=[];return r.forEach((a,l)=>{o[l]=[],r.forEach((c,h)=>{c.start&&a.end&&h!==l&&c.start?.equals(a.end)&&o[l].push(c.index)})}),t.forEach((a,l)=>{const c=i[l];n[l].forEach(h=>{h.add(a.getNormal(a.getTForPoint(h)).scale(c?e:-e))})}),o.forEach((a,l)=>{const c=n[l];a.forEach(h=>{const f=n[h],d=_u(c[c.length-1],c[c.length-2]??c[c.length-1],f[0],f[1]??f[0]);d&&(c[c.length-1].copy(d),f[0].copy(d))})}),this}getMinMax(e=O.MAX,t=O.MIN,r=!0){const i=this.strokeWidth;return this.curves.forEach(n=>{if(n.getMinMax(e,t),r&&i>1){const o=i/2,a=n.isClockwise(),l=[];for(let c=0;c<=1;c+=1/n.arcLengthDivision){const h=n.getPoint(c),f=n.getNormal(c),d=f.clone().scale(a?o:-o),g=f.clone().scale(a?-o:o);l.push(h.clone().add(d),h.clone().add(g),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}))}e.min(...l),t.max(...l)}}),{min:e.finite(),max:t.finite()}}strokeTriangulate(e){const t=e?.indices??[],r=e?.vertices??[];return this.curves.forEach(i=>{i.strokeTriangulate({...e,indices:t,vertices:r,style:{...this.style}})}),{indices:t,vertices:r}}fillTriangulate(e){const t={...e,style:{...this.style,...e?.style}},r=t.indices??[],i=t.vertices??[];if((t.style.fillRule??"nonzero")==="nonzero"){const o=this.curves.map(c=>c.getFillVertices(t)),a=xu(o),l=a.length;for(let c=0;c<l;c++){const h=a[c],f=o[c];if(h.wn||!f.length)continue;const d=f.slice(),g=[];for(let p=0;p<l;p++){const y=a[p];y.parentIndex===c&&(g.push(d.length/2),d.push(...o[y.index]))}ba(d,{...e,indices:r,vertices:i,holes:g,style:{...this.style}})}}else this.curves.forEach(o=>{o.fillTriangulate({...e,indices:r,vertices:i,style:{...this.style}})});return{indices:r,vertices:i}}getBoundingBox(e=!0){const{min:t,max:r}=this.getMinMax(void 0,void 0,e);return new Z(t.x,t.y,r.x-t.x,r.y-t.y)}drawTo(e,t={}){t={...this.style,...t};const{fill:r="#000",stroke:i="none"}=t;return e.beginPath(),e.save(),Bs(e,t),this.curves.forEach(n=>{n.drawTo(e)}),r!=="none"&&e.fill(),i!=="none"&&e.stroke(),e.restore(),this}drawControlPointsTo(e,t={}){t={...this.style,...t};const{fill:r="#000",stroke:i="none"}=t;return e.beginPath(),e.save(),Bs(e,t),this.getControlPointRefs().forEach(n=>{zh(e,n.x,n.y,{radius:4})}),r!=="none"&&e.fill(),i!=="none"&&e.stroke(),e.restore(),this}toCommands(){return this.curves.flatMap(e=>e.toCommands())}toData(){return this.curves.filter(e=>e.curves.length).map(e=>e.toData()).join(" ")}toSvgPathString(){const e={...this.style,fill:this.style.fill??"#000",stroke:this.style.stroke??"none"},t={};for(const i in e)e[i]!==void 0&&(t[vu(i)]=e[i]);Object.assign(t,{"stroke-width":`${this.strokeWidth}px`});let r="";for(const i in t)t[i]!==void 0&&(r+=`${i}:${t[i]};`);return`<path d="${this.toData()}" style="${r}"></path>`}copy(e){return super.copy(e),this.currentCurve=e.currentCurve.clone(),this.style={...e.style},this}}class Ct{constructor(e=[],t){this.paths=e,this.viewBox=t}getBoundingBox(e=!0){if(!this.paths.length)return;const t=O.MAX,r=O.MIN;return this.paths.forEach(i=>i.getMinMax(t,r,e)),new Z(t.x,t.y,r.x-t.x,r.y-t.y)}toTriangulatedSvgString(e=this.paths.map(r=>r.fillTriangulate()),t=0){let r="";const i={x:-t,y:-t},n={x:t,y:t};(Array.isArray(e)?e:[e]).forEach(({vertices:l,indices:c})=>{const h=f=>{const d=l[f*2],g=l[f*2+1];return i.x=Math.min(i.x,d+t),n.x=Math.max(n.x,d+t),i.y=Math.min(i.y,g+t),n.y=Math.max(n.y,g+t),[d,g]};for(let f=0,d=c.length;f<d;f+=3){const g=h(c[f]),p=h(c[f+1]),y=h(c[f+2]);r+=`<polygon points="${g.join(",")} ${p.join(",")} ${y.join(",")}" stroke="none" fill="black" />`}});const a=[i.x,i.y,n.x-i.x,n.y-i.y];return`<svg width="${a[2]}" height="${a[3]}" viewBox="${a.join(" ")}" xmlns="http://www.w3.org/2000/svg">${r}</svg>`}toTriangulatedSvg(e,t){return new DOMParser().parseFromString(this.toTriangulatedSvgString(e,t),"image/svg+xml").documentElement}toSvgString(){const{x:e,y:t,width:r,height:i}=this.getBoundingBox(),n=this.paths.map(o=>o.toSvgPathString()).join("");return`<svg viewBox="${e} ${t} ${r} ${i}" width="${r}px" height="${i}px" xmlns="http://www.w3.org/2000/svg">${n}</svg>`}toSvgUrl(){return`data:image/svg+xml;base64,${btoa(this.toSvgString())}`}toSvg(){return new DOMParser().parseFromString(this.toSvgString(),"image/svg+xml").documentElement}toCanvas(e={}){const{pixelRatio:t=2,...r}=e,{left:i,top:n,width:o,height:a}=this.getBoundingBox(),l=document.createElement("canvas");l.width=o*t,l.height=a*t,l.style.width=`${o}px`,l.style.height=`${a}px`;const c=l.getContext("2d");return c&&(c.scale(t,t),c.translate(-i,-n),this.paths.forEach(h=>{h.drawTo(c,r)})),l}}class ki extends Pt{vertexAttributes;indexBuffer;instanceCount;mode;_materialWeakMap=new Ms;constructor(e={}){super(),this.vertexAttributes=new Map(Object.entries(e?.vertexAttributes??{})),this.indexBuffer=e?.indexBuffer,this.instanceCount=e?.instanceCount,this.mode=e?.mode??"triangles"}_glVertexArray(e){return{attributes:Object.fromEntries(Array.from(this.vertexAttributes).map(([t,r])=>[t,{buffer:r.buffer._glBuffer(e),size:r.size,type:r.type,normalized:r.normalized,stride:r.stride,offset:r.offset,divisor:r.divisor}])),elementArrayBuffer:this.indexBuffer?._glBuffer(e)}}_glVertexArrayObject(e,t){let r=this._materialWeakMap.get(t);return r||(r={material:t.instanceId,geometry:this.instanceId},this._materialWeakMap.set(t,r)),e.getRelated(r,()=>e.vertexArray.create(t._glProgram(e),this._glVertexArray(e)))}draw(e,t,r){e.flush(),t.activate(e,r);const i=this._glVertexArrayObject(e,t);let n=!1,o;this.vertexAttributes.forEach(a=>{o?.instanceId!==a.buffer.instanceId&&(o=a.buffer,o.upload(e)&&(n=!0)),a.upload()&&(n=!0)}),this.indexBuffer?.upload(e)&&(n=!0),n&&i&&e.vertexArray.update(t._glProgram(e),i,this._glVertexArray(e)),e.vertexArray.bind(i??this._glVertexArray(e)),e.draw({mode:this.mode,instanceCount:this.instanceCount}),e.vertexArray.unbind()}}var $u=Object.defineProperty,Oa=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&$u(e,t,i),i};class fr extends Pt{needsUpload=!1;constructor(e){super(),this.setProperties(e)}_glBufferOptions(){return{target:"element_array_buffer",data:this.data,usage:this.dynamic?"dynamic_draw":"static_draw"}}_glBuffer(e){return e.getRelated(this,()=>e.buffer.create(this._glBufferOptions()))}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"data":case"dynamic":this.needsUpload=!0;break}}upload(e){const t=this.needsUpload;return t&&(this.needsUpload=!1,e.buffer.update(this._glBuffer(e),this._glBufferOptions())),t}}Oa([w({protected:!0,default:null})],fr.prototype,"data"),Oa([w({protected:!0,fallback:!1})],fr.prototype,"dynamic");var zu=Object.defineProperty,ka=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&zu(e,t,i),i};class Tt extends Pt{needsUpload=!1;constructor(e){super(),this.setProperties(e)}_glBufferOptions(){return{target:"array_buffer",data:this.data,usage:this.dynamic?"dynamic_draw":"static_draw"}}_glBuffer(e){return e.getRelated(this,()=>e.buffer.create(this._glBufferOptions()))}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"data":case"dynamic":this.needsUpload=!0;break}}upload(e){const t=this.needsUpload;return t&&(this.needsUpload=!1,e.buffer.update(this._glBuffer(e),this._glBufferOptions())),t}}ka([w({protected:!0,default:null})],Tt.prototype,"data"),ka([w({protected:!0,fallback:!1})],Tt.prototype,"dynamic");var Vu=Object.defineProperty,Yt=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&Vu(e,t,i),i};class je extends Pt{needsUpload=!1;constructor(e){super(),this.setProperties({buffer:new Tt,...e})}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"buffer":case"size":case"normalized":case"type":case"stride":case"offset":case"divisor":this.needsUpload=!0;break}}upload(){const e=this.needsUpload;return e&&(this.needsUpload=!1),e}}Yt([w({protected:!0})],je.prototype,"buffer"),Yt([w({fallback:0})],je.prototype,"size"),Yt([w({fallback:!1})],je.prototype,"normalized"),Yt([w({fallback:"float"})],je.prototype,"type"),Yt([w()],je.prototype,"stride"),Yt([w()],je.prototype,"offset"),Yt([w()],je.prototype,"divisor");class Gu extends ki{constructor(){super({vertexAttributes:{position:new je({buffer:new Tt({data:new Float32Array([0,0,1,0,1,1,0,1]),dynamic:!1}),size:2,normalized:!1,type:"float"})},indexBuffer:new fr({data:new Uint16Array([0,1,3,2]),dynamic:!1}),mode:"triangle_strip"})}}class se extends Pt{static instance=new this;vert;frag;uniforms;constructor(e={}){super(),this.vert=e.vert??`precision highp float;
|
|
75
75
|
attribute vec2 position;
|
|
76
76
|
uniform mat3 projectionMatrix;
|
|
77
77
|
uniform mat3 modelViewMatrix;
|
|
78
78
|
void main(void) {
|
|
79
79
|
gl_Position = vec4((projectionMatrix * modelViewMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
|
|
80
|
-
}`,this.frag=
|
|
80
|
+
}`,this.frag=e.frag??`uniform vec4 tint;
|
|
81
81
|
void main(void) {
|
|
82
82
|
gl_FragColor = tint;
|
|
83
|
-
}`,this.uniforms=new Map(Object.entries(
|
|
84
|
-
${
|
|
85
|
-
${
|
|
83
|
+
}`,this.uniforms=new Map(Object.entries(e.uniforms??{projectionMatrix:new Float32Array([1,0,0,0,1,0,0,0,1]),modelViewMatrix:new Float32Array([1,0,0,0,1,0,0,0,1]),tint:new Float32Array([1,1,1,1])}))}_glProgram(e){return e.getRelated(this,()=>{let t=this.vert,r=this.frag;return r.includes("precision")||(r=`precision mediump float;
|
|
84
|
+
${r}`),t.includes("precision")||(t=`precision mediump float;
|
|
85
|
+
${t}`),e.program.create({vert:t,frag:r})})}activate(e,t){e.program.bind(this._glProgram(e)),(t||this.uniforms.size>0)&&e.program.updateUniforms({...Object.fromEntries(this.uniforms.entries()),...t})}}const ju=/^uniform \w+ (.+?);\s*\/\/\s*=\s*([^;]+?)[\s;]*$/gm,Wu=/vec(\d)\((.*)\)/;function qu(s){s=s.trim();const e=s.match(Wu);if(e){const t=Array.from({length:Number(e[1])},()=>0);return e[2].split(",").forEach((r,i)=>{t[i]=Number(r.trim())}),t}return Number(s)}class Lr extends se{vert=`attribute vec2 position;
|
|
86
86
|
attribute vec2 uv;
|
|
87
87
|
varying vec2 vUv;
|
|
88
88
|
void main() {
|
|
89
89
|
gl_Position = vec4(position, 0.0, 1.0);
|
|
90
90
|
vUv = uv;
|
|
91
|
-
}`;uniforms=new Map([["ratio",0],["from",0],["to",1],["progress",0]]);static RE={getColor:/\sgetColor\s*\(/,getFromColor:/\sgetFromColor\s*\(/,getToColor:/\sgetToColor\s*\(/,transform:/\stransform\s*\(/,transition:/\stransition\s*\(/};has={getColor:!1,getFromColor:!1,getToColor:!1,transform:!1,transition:!1};constructor(
|
|
91
|
+
}`;uniforms=new Map([["ratio",0],["from",0],["to",1],["progress",0]]);static RE={getColor:/\sgetColor\s*\(/,getFromColor:/\sgetFromColor\s*\(/,getToColor:/\sgetToColor\s*\(/,transform:/\stransform\s*\(/,transition:/\stransition\s*\(/};has={getColor:!1,getFromColor:!1,getToColor:!1,transform:!1,transition:!1};constructor(e){super();const t=this.has;for(const i in Lr.RE)t[i]=Lr.RE[i].test(e);this.frag=`precision highp float;
|
|
92
92
|
varying vec2 vUv;
|
|
93
93
|
uniform float ratio;
|
|
94
94
|
uniform float progress;
|
|
95
|
-
${
|
|
96
|
-
uniform sampler2D from;`:""}${
|
|
95
|
+
${t.getColor||t.getFromColor||t.getToColor?`
|
|
96
|
+
uniform sampler2D from;`:""}${t.getFromColor||t.getToColor?`
|
|
97
97
|
uniform sampler2D to;`:""}
|
|
98
|
-
${
|
|
99
|
-
vec4 getColor(vec2 uv) { return texture2D(from, uv); }`:""}${
|
|
98
|
+
${t.getColor?`
|
|
99
|
+
vec4 getColor(vec2 uv) { return texture2D(from, uv); }`:""}${t.getFromColor||t.getToColor?`
|
|
100
100
|
vec4 getFromColor(vec2 uv) { return texture2D(from, uv); }
|
|
101
101
|
vec4 getToColor(vec2 uv) { return texture2D(to, uv); }`:""}
|
|
102
|
-
${
|
|
103
|
-
void main(void) { gl_FragColor = transform(vUv); }`:
|
|
104
|
-
void main(void) { gl_FragColor = transition(vUv); }`:""}`;const
|
|
102
|
+
${e}${t.transform?`
|
|
103
|
+
void main(void) { gl_FragColor = transform(vUv); }`:t.transition?`
|
|
104
|
+
void main(void) { gl_FragColor = transition(vUv); }`:""}`;const r=e.matchAll(ju);for(const i of r)i[1]&&i[2]&&i[1].split(",").forEach(n=>{this.uniforms.set(n.trim(),qu(i[2]))})}}class Nr extends se{static _instance;static get instance(){return this._instance??=new this}constructor(){super({vert:`precision highp float;
|
|
105
105
|
attribute vec2 position;
|
|
106
106
|
attribute vec2 uv;
|
|
107
107
|
uniform mat3 projectionMatrix;
|
|
@@ -115,7 +115,7 @@ uniform sampler2D sampler;
|
|
|
115
115
|
uniform vec4 tint;
|
|
116
116
|
void main(void) {
|
|
117
117
|
gl_FragColor = texture2D(sampler, vUv) * tint;
|
|
118
|
-
}`,uniforms:{sampler:0,projectionMatrix:new Float32Array([1,0,0,0,1,0,0,0,1]),modelViewMatrix:new Float32Array([1,0,0,0,1,0,0,0,1]),tint:new Float32Array([1,1,1,1])}})}}class ut extends fr{static _instance;static get instance(){return this._instance??=new this}static draw(t,e=pi.instance,A){this.instance.draw(t,e,A)}constructor(){super({vertexAttributes:{position:new ce({buffer:new ze({data:new Float32Array([-1,-1,1,-1,1,1,-1,1]),dynamic:!1}),size:2,normalized:!1,type:"float"}),uv:new ce({buffer:new ze({data:new Float32Array([0,0,1,0,1,1,0,1]),dynamic:!1}),size:2,normalized:!1,type:"float"})},indexBuffer:new KA({data:new Uint16Array([0,1,2,0,2,3]),dynamic:!1})})}}class Cu extends fr{positionBuffer;uvBuffer;constructor(){const t=new ze({data:new Float32Array,dynamic:!0}),e=new ze({data:new Float32Array,dynamic:!0});super({vertexAttributes:{position:new ce({buffer:t,size:2,normalized:!1,type:"float"}),uv:new ce({buffer:e,size:2,normalized:!1,type:"float"})},indexBuffer:new KA({data:new Uint16Array,dynamic:!0})}),this.positionBuffer=t,this.uvBuffer=e}}var Qu=Object.defineProperty,YA=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&Qu(t,e,i),i};class yt extends Ye{static get EMPTY(){return new this({width:1,height:1,pixels:null})}static get WHITE(){return new this({width:1,height:1,pixels:new Uint8Array([255,255,255,255])})}static get BLACK(){return new this({width:1,height:1,pixels:new Uint8Array([0,0,0,255])})}static get RED(){return new this({width:1,height:1,pixels:new Uint8Array([255,0,0,255])})}static get GREEN(){return new this({width:1,height:1,pixels:new Uint8Array([0,255,0,255])})}static get BLUE(){return new this({width:1,height:1,pixels:new Uint8Array([0,0,255,255])})}_isPowerOfTwo=!1;_needsUpload=!1;get valid(){return!!(this.width&&this.height)}get realWidth(){return Math.round(this.width*this.pixelRatio)}get realHeight(){return Math.round(this.height*this.pixelRatio)}constructor(t){super(),this.source=t,this._updateSize()}_glTextureOptions(t,e){let A=this.wrapMode;return t.version===1&&!this._isPowerOfTwo&&(A="clamp_to_edge"),{value:this.source,target:"texture_2d",location:0,filterMode:this.filterMode,wrapMode:A,...e}}_glTexture(t,e){return t.getRelated(this,()=>t.texture.create(this._glTextureOptions(t,e)))}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"width":case"height":this._updatePOT();break;case"source":this._updateSize();break;case"filterMode":case"wrapMode":case"pixelRatio":this.requestUpload();break}}_updatePOT(){this._isPowerOfTwo=Bs(this.realWidth)&&Bs(this.realHeight),this.requestUpload()}_updateSize(){const t=this.source;"pixels"in t?(this.width=t.width/this.pixelRatio,this.height=t.height/this.pixelRatio):(this.width=Number(t.naturalWidth||t.videoWidth||t.width||0)/this.pixelRatio,this.height=Number(t.naturalHeight||t.videoHeight||t.height||0)/this.pixelRatio),this.requestUpload()}requestUpload(){this._needsUpload=!0}upload(t,e){return this._needsUpload&&this.valid?(this._needsUpload=!1,t.texture.update(this._glTexture(t,e),this._glTextureOptions(t,e)),!0):!1}activate(t,e=0){return this.valid?(t.texture.bind({target:"texture_2d",value:this._glTexture(t,{location:e}),location:e}),this.upload(t,{location:e}),!0):!1}inactivate(t){t.texture.unbind(this._glTexture(t))}free(){Po&&this.source instanceof ImageBitmap&&this.source.close()}}YA([v({protected:!0})],yt.prototype,"source"),YA([v({fallback:0})],yt.prototype,"width"),YA([v({fallback:0})],yt.prototype,"height"),YA([v({fallback:"linear"})],yt.prototype,"filterMode"),YA([v({fallback:"clamp_to_edge"})],yt.prototype,"wrapMode"),YA([v({fallback:1})],yt.prototype,"pixelRatio");class dr extends Ye{frames;constructor(t){super();let e;if(Array.isArray(t))e=t;else if(t instanceof yt)e=[{texture:t,duration:0}];else throw new TypeError("Failed new AnimatedTexture");this.frames=e,this.updateDuration()}updateDuration(){return this.duration=this.frames.reduce((t,e)=>e.duration+t,0),this}free(){this.frames.forEach(t=>{t.texture.free()})}}var yu=Object.defineProperty,mu=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&yu(t,e,i),i};class Ir extends yt{constructor(t=document.createElement("canvas")){super(t)}_updateProperty(t,e,A,i){switch(t){case"width":this.source.width=Math.max(1,Math.ceil(e*this.pixelRatio));break;case"height":this.source.height=Math.max(1,Math.ceil(e*this.pixelRatio));break}super._updateProperty(t,e,A,i)}}mu([v({fallback:2})],Ir.prototype,"pixelRatio");class Va extends yt{static _cached=new Map;static get(t){const e=new De(t),A=e.toHex();let i=this._cached.get(A);return i||(i=new yt({width:1,height:1,pixels:new Uint8Array([e.r8,e.g8,e.b8,e.a8])}),this._cached.set(A,i)),i}constructor(t){const e=new De(t);super({width:1,height:1,pixels:new Uint8Array([e.r8,e.g8,e.b8,e.a8])})}}class pr extends yt{static test(t){return ni(t)}static linearGradient(t,e,A){e=e||1,A=A||1;const i=document.createElement("canvas");i.width=e,i.height=A;const s=i.getContext("2d");if(!s)throw new Error("Failed to parse linear gradient, get canvas context is null.");let{angle:n=0,stops:o}=t;n-=Math.PI/2;const a=e/2,l=A/2,c=Math.sqrt(e*e+A*A)/2,h=a+c*Math.cos(n+Math.PI),u=l+c*Math.sin(n+Math.PI),d=a+c*Math.cos(n),f=l+c*Math.sin(n),B=s.createLinearGradient(h,u,d,f);o.forEach(D=>{B.addColorStop(D.offset,D.color)}),s.fillStyle=B,s.fillRect(0,0,i.width,i.height);const p=s.getImageData(0,0,i.width,i.height);return{width:p.width,height:p.height,pixels:new Uint8Array(p.data.buffer)}}constructor(t,e,A){super(pr.linearGradient(t,e,A))}}function wu(r){return{autoLoad:!!(r?.autoLoad??!0),useBitmap:!!(r?.useBitmap??!0)&&Qs,crossorigin:r?.crossorigin??null}}class vu extends yt{bitmap;useBitmap;preserveBitmap=!1;_loadSource;_loadBitmap;constructor(t,e){const A=wu(e);super(t);const i=t.src,s=i.includes(".svg")||i.startsWith("data:image/svg+xml");this.useBitmap=A.useBitmap&&!s,A.autoLoad&&this.load()}async load(){return this._loadSource||(this._loadSource=new Promise(t=>{this._loadSource=void 0;const e=this.source,A=()=>{e.onload=null,e.onerror=null},i=()=>{A(),this.requestUpload(),this.useBitmap?this.genBitmap().finally(()=>t(this)):t(this)},s=n=>{A(),console.warn(`Failed to load ImageTexture, src: ${e.src}`,n),this.emit("error",n),t(this)};e.complete&&e.src?i():(e.onload=i,e.onerror=s)})),this._loadSource}genBitmap(){if(this._loadBitmap)return this._loadBitmap;if(this.bitmap||!Qs)return Promise.resolve(this);const t=this.source,e=!t.crossOrigin||t.crossOrigin==="anonymous";return this._loadBitmap=fetch(t.src,{mode:e?"cors":"no-cors"}).then(A=>A.blob()).then(A=>createImageBitmap(A,0,0,t.width,t.height,{premultiplyAlpha:"premultiply"})).then(A=>(this.bitmap=A,this.requestUpload(),this._loadBitmap=void 0,this)).catch(A=>(console.warn("Failed to genBitmap",A),this)),this._loadBitmap}_glTextureOptions(t){return{...super._glTextureOptions(t),value:this.bitmap??this.source}}upload(t){if(this.useBitmap){if(!this.bitmap)return this.genBitmap(),!1}else{const A=this.source;if(li&&A instanceof HTMLImageElement&&(!A.complete||A.naturalWidth===0))return!1}const e=super.upload(t);return this.preserveBitmap&&this.bitmap&&(this.bitmap.close(),this.bitmap=void 0),e}}class Ys extends yt{constructor(t,e=1,A=1){const i={width:e,height:A,pixels:null};t&&(ArrayBuffer.isView(t)?i.pixels=new Uint8Array(t.buffer):i.pixels=new Uint8Array(t)),super(i)}_updateProperty(t,e,A,i){switch(t){case"width":this.source.width=Math.round(this.width*this.pixelRatio);break;case"height":this.source.height=Math.round(this.height*this.pixelRatio);break;case"pixelRatio":this.source.width=Math.round(this.width*this.pixelRatio),this.source.height=Math.round(this.height*this.pixelRatio);break}super._updateProperty(t,e,A,i)}}var _u=Object.defineProperty,Wa=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&_u(t,e,i),i};function bu(r){return{autoLoad:!!(r?.autoLoad??!0),autoPlay:!!(r?.autoPlay??!1),fps:Number(r?.fps??0),crossorigin:r?.crossorigin??null,loop:!!(r?.loop??!1),muted:!!(r?.muted??!1),playsinline:!!(r?.playsinline??!0)}}const Vs=class kc extends yt{static mimeTypes=new Map(Object.entries({ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"}));get isReady(){return this.source.readyState>2}get isPlaying(){return!this.source.paused&&!this.source.ended&&this.isReady}get duration(){return this.source.duration}get seeking(){return this.source.seeking}get currentTime(){return this.source.currentTime}set currentTime(t){this.source.currentTime=t}_spf=0;_autoPlay=!1;_sourceLoad;_nextTime=0;_connected=!1;_requestId;_resolve;_reject;constructor(t,e){const A=bu(e);if(!Go(t)){typeof t=="string"&&(t=[t]);const i=t[0].src||t[0],s=document.createElement("video");A.autoLoad&&s.setAttribute("preload","auto"),A.playsinline&&(s.setAttribute("webkit-playsinline",""),s.setAttribute("playsinline","")),A.muted&&(s.setAttribute("muted",""),s.muted=!0),A.loop&&s.setAttribute("loop",""),A.autoPlay&&s.setAttribute("autoplay",""),Yo(s,i,A.crossorigin);for(let n=0;n<t.length;++n){let{src:o,mime:a}=t[n];if(o=o||t[n],o.startsWith("data:"))a=o.slice(5,o.indexOf(";"));else if(!o.startsWith("blob:")){const c=o.split("?").shift().toLowerCase(),h=c.slice(c.lastIndexOf(".")+1);a=a||kc.mimeTypes.get(h)||`video/${h}`}const l=document.createElement("source");l.src=o,a&&(l.type=a),s.appendChild(l)}t=s}super(t),this.fps=A.fps,this._autoPlay=A.autoPlay,A.autoPlay&&this.load(),this._setupAutoUpdate()}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"fps":this._spf=e?Math.floor(1e3/e):0,this._setupAutoUpdate();break;case"autoUpdate":this._setupAutoUpdate();break}}_onPlayStart=()=>{this.valid||this._onCanPlay(),this._setupAutoUpdate()};_onPlayStop=()=>{this._setupAutoUpdate()};_onCanPlay=()=>{const t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);const e=this.valid;this._nextTime=0,this._updateSize(),this.requestUpload(),this._nextTime=0,!e&&this._resolve&&(this._resolve(this),this._sourceLoad=void 0,this._resolve=void 0,this._reject=void 0),this.isPlaying?this._onPlayStart():this._autoPlay&&t.play()};_onError=t=>{this.source.removeEventListener("error",this._onError,!0),this.emit("error",t),this._reject&&(this._reject(t),this._reject=void 0,this._resolve=void 0)};_onSeeked=()=>{this.autoUpdate&&!this.isPlaying&&(this._nextTime=0,this.requestUpload(),this._nextTime=0)};_setupAutoUpdate(){this.autoUpdate&&this.isPlaying?!this.fps&&this.source.requestVideoFrameCallback?(this._connected&&(Kt.off(this.requestUpload),this._connected=!1,this._nextTime=0),this._requestId===void 0&&(this._requestId=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._requestId!==void 0&&(this.source.cancelVideoFrameCallback(this._requestId),this._requestId=void 0),this._connected||(Kt.on(this.requestUpload),this._connected=!0,this._nextTime=0)):(this._requestId!==void 0&&(this.source.cancelVideoFrameCallback(this._requestId),this._requestId=void 0),this._connected&&(Kt.off(this.requestUpload),this._connected=!1,this._nextTime=0))}_videoFrameRequestCallback=()=>{this.requestUpload(),this._requestId=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback)};requestUpload=()=>{const t=Math.floor(Kt.elapsed*this.source.playbackRate);this._nextTime-=t,(!this._spf||this._nextTime<=0)&&(super.requestUpload(),this._nextTime=this._spf||0)};async load(){if(!this._sourceLoad){const t=this.source;(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this.isReady?this._onCanPlay():(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("error",this._onError,!0)),this._sourceLoad=new Promise((e,A)=>{this.valid?(this._sourceLoad=void 0,e(this)):(this._resolve=e,this._reject=A,t.load())})}return this._sourceLoad}free(){this._setupAutoUpdate();const t=this.source;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load())}};Wa([v({protected:!0,fallback:!0})],Vs.prototype,"autoUpdate"),Wa([v({protected:!0,fallback:0})],Vs.prototype,"fps");let za=Vs;class Ws extends Ys{}class qa extends kt{fillStyle;strokeStyle;strokeAlignment;lineCap;lineJoin;lineWidth;miterLimit;uvTransform;vertTransform;_defaultStyle=yt.EMPTY;_draws=[];_toTexture(t){return t instanceof yt?t:Va.get(t)}stroke(t){if(!this.curves.length)return;let e=this.strokeStyle;if(!e&&this.style.stroke)switch(typeof this.style.stroke){case"string":e=this.style.stroke;break;case"object":fs(this.style.stroke)&&(e=this.style.stroke.color);break}this._draws.push({...t,type:"stroke",path:new kt(this),texture:e?this._toTexture(e):this._defaultStyle,uvTransform:this.uvTransform,vertTransform:this.vertTransform,style:{alignment:this.strokeAlignment??.5,cap:this.lineCap??"butt",join:this.lineJoin??"miter",width:this.lineWidth??1,miterLimit:this.miterLimit??10}}),this.resetStatus()}fillRect(t,e,A,i){this.rect(t,e,A,i).fill()}strokeRect(t,e,A,i){this.rect(t,e,A,i).stroke()}fill(t){if(!this.curves.length)return;let e=this.fillStyle;if(!e&&this.style.fill)switch(typeof this.style.fill){case"string":e=this.style.fill;break;case"object":fs(this.style.fill)&&(e=this.style.fill.color);break}this._draws.push({...t,type:"fill",path:new kt(this),texture:e?this._toTexture(e):this._defaultStyle,uvTransform:this.uvTransform,vertTransform:this.vertTransform}),this.resetStatus()}copy(t){return super.copy(t),this.strokeStyle=t.strokeStyle,this.fillStyle=t.fillStyle,this.uvTransform=t.uvTransform,this.vertTransform=t.vertTransform,this.strokeAlignment=t.strokeAlignment,this.lineCap=t.lineCap,this.lineJoin=t.lineJoin,this.lineWidth=t.lineWidth,this.miterLimit=t.miterLimit,this._draws=t._draws.slice(),this}resetStatus(){super.reset(),this.strokeStyle=void 0,this.fillStyle=void 0,this.uvTransform=void 0,this.vertTransform=void 0,this.strokeAlignment=void 0,this.lineCap=void 0,this.lineJoin=void 0,this.lineWidth=void 0,this.miterLimit=void 0}reset(){return this.resetStatus(),this._draws.length=0,this}buildUvs(t,e,A,i,s){if(i){const n=s&&(typeof s=="function"?s:(l,c)=>s.apply({x:l,y:c}).toArray()),o=i.width,a=i.height;for(let l=e.length,c=t;c<l;c+=2){const h=e[c],u=e[c+1];let d,f;n?[d,f]=n(h,u):[d,f]=[h/o,u/a],A.push(d,f)}}else for(let n=e.length,o=t;o<n;o+=2)A.push(0,0)}toBatchables(){const t=[];for(let e=this._draws.length,A=0;A<e;A++){const i=this._draws[A],s=[],n=[],o=[];i.type==="fill"?i.path.fillTriangulate({vertices:s,indices:n}):i.path.strokeTriangulate({vertices:s,indices:n,lineStyle:i.style,flipAlignment:!1,closed:!0}),this.buildUvs(0,s,o,i.texture,i.uvTransform),t.push({vertices:new Float32Array(s),indices:new Float32Array(n),uvs:new Float32Array(o),texture:i.texture,type:i.type,disableWrapMode:i.disableWrapMode,vertTransform:i.vertTransform})}return t}}class Xa extends Array{front=[];back=[];get internal(){return[...this.front,...this,...this.back]}constructor(...t){super(),this.set(t)}set(t){return this.front.length=0,this.length=0,this.back.length=0,t.forEach(e=>{switch(e.internalMode){case"front":this.front.push(e);break;case"default":this.push(e);break;case"back":this.back.push(e);break}}),this}getInternal(t){switch(t){case"front":return this.front;case"default":return this;case"back":return this.back;default:throw new Error(`Unknown internal mode: ${t}`)}}toJSON(){return[...this]}}var Du=Object.defineProperty,xu=Object.getOwnPropertyDescriptor,qe=(r,t,e,A)=>{for(var i=A>1?void 0:A?xu(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&Du(t,e,i),i};const ja={};function Su(r){let t=ja[r]??0;return t++,ja[r]=t,t}g.Node=class extends sA{_readyed=!1;constructor(t,e=[]){super(),this._onTreeEnter=this._onTreeEnter.bind(this),this._onTreeExit=this._onTreeExit.bind(this),this._onParented=this._onParented.bind(this),this._onUnparented=this._onUnparented.bind(this),this._onReady=this._onReady.bind(this),this._onProcess=this._onProcess.bind(this),this.setProperties({name:`${this.is}:${Su(this.is)}`,...t}).append(e),this.on("treeEnter",this._onTreeEnter).on("treeExit",this._onTreeExit).on("parented",this._onParented).on("unparented",this._onUnparented).on("ready",this._onReady).on("process",this._onProcess)}setProperties(t){if(t){const{meta:e,...A}=t;if(e)for(const i in e)this.meta[i]=e[i];super.setProperties(A)}return this}getName(){return this.name}setName(t){return this.name=t,this}_tree;get tree(){return this.getTree()}set tree(t){this.setTree(t)}getTree(){return this._tree}getViewport(){return this.parent?.getViewport()??this.getWindow()}getWindow(){return this._tree?.root}isInsideTree(){return!!this._tree}setTree(t){const e=this._tree;if(!t?.equal(e)){e&&this.emit("treeExit",e),this._tree=t,t&&this.emit("treeEnter",t);const A=this._children.internal;for(let i=A.length,s=0;s<i;s++){const n=A[s];!t&&this.emit("childExitingTree",n),n.setTree(t),t&&this.emit("childEnteredTree",n)}t&&(this.emit("treePostEnter",t),this._readyed||(this._readyed=!0,this.emit("ready")))}return this}log(...t){this._tree?.log(...t)}_parent;get parent(){return this._parent}set parent(t){this.setParent(t)}hasParent(){return!!this._parent}getParent(){return this._parent}setParent(t){if(!this._parent?.equal(t)){const e=this._parent;e&&this.emit("unparented",e),this._parent=t,t&&this.emit("parented",t),this.setTree(t?._tree)}return this}_children=new Xa;get children(){return this._children}set children(t){t instanceof Xa?this._children=t:this._children.set(t)}getChild(t=0){return this._children[t]}get siblingIndex(){return this.getIndex()}set siblingIndex(t){this._parent?.moveChild(this,t)}get previousSibling(){return this._parent?.children[this.getIndex()-1]}get nextSibling(){return this._parent?.children[this.getIndex()+1]}get firstSibling(){return this._parent?.children[0]}get lastSibling(){const t=this._parent?.children;return t?t[t.length-1]:void 0}canProcess(){if(!this._tree)return!1;switch(this.processMode){case"inherit":return this._parent?.canProcess()??!0;case"pausable":return!this._tree.processPaused;case"when_paused":return this._tree.processPaused;case"always":return!0;case"disabled":default:return!1}}canRender(){if(!this._tree)return!1;switch(this.renderMode){case"inherit":return this._parent?.canRender()??!0;case"always":return!0;case"disabled":default:return!1}}_updateProperty(t,e,A,i){super._updateProperty(t,e,A,i)}_onTreeEnter(t){this._treeEnter(t),this.emit("treeEntered",t)}_onTreeExit(t){this.emit("treeExiting",t),this._treeExit(t),this.emit("treeExited",t)}_onParented(t){this._parented(t)}_onUnparented(t){this._unparented(t)}_onReady(){this._ready()}_onProcess(t=0){const e=this._tree,A=this.canRender(),i=this.canProcess(),s=[],n=[];this._children.internal.forEach(a=>{switch(a.processSortMode){case"default":n.push(a);break;case"parent_before":s.push(a);break}}),s.forEach(a=>{a.emit("process",t)}),i&&(e?.emit("nodeProcessing",this),this.emit("processing",t),this._process(t));let o;if(A){const a=e.renderStack.push(this);o=e.renderStack.currentCall,e.renderStack.currentCall=a}if(this.mask instanceof g.Node)this.getNode("__$mask")||(this.mask.processMode="disabled",this.appendChild(this.mask,"front"));else{const a=this.getNode("__$mask");a&&this.removeChild(a)}n.forEach(a=>{a.emit("process",t)}),A&&(e.renderStack.currentCall=o),i&&(this.emit("processed",t),e?.emit("nodeProcessed",this))}render(t,e){const A=this.mask;A&&(t.flush(),t.mask.push(this,A)),this._render(t),e?.(),A&&(t.flush(),t.mask.pop(this))}input(t,e){if(t.propagationStopped)return;const A=this._children.internal;for(let i=A.length-1;i>=0;i--)A[i].input(t,e);t.propagationStopped||this._input(t,e)}getIndex(){return this._parent?.children.getInternal(this.internalMode).indexOf(this)??0}getNode(t){return this._children.internal.find(e=>e.name===t)}removeNode(t){this.getNode(t)?.remove()}addSibling(t){return this.equal(t)||!this.hasParent()||t.hasParent()?this:(t.internalMode=this.internalMode,this._parent.moveChild(t,this.getIndex()+1),this)}prepend(...t){let e;Array.isArray(t[0])?e=t[0]:e=t,e.forEach(A=>{this.moveChild(A,0)})}append(...t){let e;Array.isArray(t[0])?e=t[0]:e=t,e.forEach(A=>{this.appendChild(A)})}before(...t){let e;Array.isArray(t[0])?e=t[0]:e=t,e.forEach(A=>{this._parent?.moveChild(A,this.getIndex())})}after(...t){let e;Array.isArray(t[0])?e=t[0]:e=t,e.forEach(A=>{this._parent?.moveChild(A,this.getIndex()+1)})}insertBefore(t,e){return!e.hasParent()||!this.equal(e.parent)||this.moveChild(t,e.getIndex()),t}appendChild(t,e=t.internalMode){if(this.equal(t)||t.hasParent())return t;switch(e){case"front":this._children.front.push(t);break;case"default":this._children.push(t);break;case"back":this._children.back.push(t);break}return t.internalMode!==e&&(t.internalMode=e),t.setParent(this),this.emit("appendChild",t),t}moveChild(t,e,A=t.internalMode){if(this.equal(t)||t.hasParent()&&!this.equal(t.parent))return this;const i=this._children.getInternal(t.internalMode),s=i.indexOf(t),n=this._children.getInternal(A);return(t.internalMode!==A||e!==s)&&(s>-1&&i.splice(s,1),t.setParent(this),e>-1&&e<n.length?n.splice(e,0,t):n.push(t),s>-1?this.emit("moveChild",t,e,s):this.emit("appendChild",t)),t.internalMode!==A&&(t.internalMode=A),this}removeChild(t){const e=t.getIndex();return this.equal(t.parent)&&e>-1&&(this._children.getInternal(t.internalMode).splice(e,1),t.setParent(void 0),this.emit("removeChild",t,e)),t}removeChildren(){this._children.forEach(t=>this.removeChild(t))}remove(){this._parent?.removeChild(this)}forEachChild(t){return this._children.forEach(t),this}forEachDescendant(t){return this._children.forEach(e=>{t(e),e.forEachDescendant(t)}),this}forEachAncestor(t){const e=this.parent;return e&&(t(e),e.forEachAncestor(t)),this}_ready(){}_treeEnter(t){}_treeExit(t){}_parented(t){}_unparented(t){}_process(t){}_input(t,e){}_render(t){}clone(){return new this.constructor(this.toJSON(),this._children.internal)}toJSON(){return ae({...super.toJSON(),children:this._children.length?[...this._children.map(t=>t.toJSON())]:void 0,meta:{...this.meta,inCanvasIs:this.is}})}static parse(t){if(Array.isArray(t))return t.map(a=>this.parse(a));const{meta:e={},children:A,...i}=t,{inCanvasIs:s="Node"}=e,n=rr.get(s)??g.Node,o=new n({...i,meta:e});return A?.forEach(a=>o.appendChild(this.parse(a))),o}},qe([v({fallback:bo()})],g.Node.prototype,"id",2),qe([v({fallback:bo()})],g.Node.prototype,"name",2),qe([v({default:()=>({})})],g.Node.prototype,"meta",2),qe([v({protected:!0,fallback:"inherit"})],g.Node.prototype,"processMode",2),qe([v({protected:!0,fallback:"default"})],g.Node.prototype,"processSortMode",2),qe([v({protected:!0,fallback:"inherit"})],g.Node.prototype,"renderMode",2),qe([v({protected:!0,fallback:"default"})],g.Node.prototype,"internalMode",2),qe([v({protected:!0})],g.Node.prototype,"mask",2),g.Node=qe([st("Node")],g.Node);var Mu=Object.defineProperty,Ru=Object.getOwnPropertyDescriptor,Ei=(r,t,e,A)=>{for(var i=A>1?void 0:A?Ru(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&Mu(t,e,i),i};g.TimelineNode=class extends g.Node{constructor(t,e=[]){super(),this.setProperties(t).append(e)}computedDuration=0;_currentTime=0;_startTime=0;get timeline(){return this._tree?.timeline}get timelineCurrentTime(){return this.timeline?.currentTime??0}get parentStartTime(){return this._parent?.startTime??0}get currentTime(){return le(this._currentTime,0,this.computedDuration)}get startTime(){return this._startTime}set startTime(t){this.delay=t-this.parentStartTime,this._updateCurrentTime(!0)}get endTime(){return this._startTime+this.computedDuration}get currentTimeProgress(){return this.computedDuration?le(this._currentTime/this.computedDuration,0,1):0}isInsideTimeRange(){const t=this._currentTime;return this.computedDuration?t>=0&&t<=this.computedDuration:t>=0}_updateCurrentTime(t=!1){if(t||!this.paused){const e=this._parent;this._startTime=this.delay+this.parentStartTime,this.computedDuration=e?.computedDuration?Math.min(this._startTime+this.duration,e.endTime)-this._startTime:this.duration,this._currentTime=this.timelineCurrentTime-this._startTime,this.emit("updateCurrentTime",this._currentTime),this.insideTimeRange=this.isInsideTimeRange()}}_process(t){super._process(t),this._updateCurrentTime()}},Ei([v({fallback:0})],g.TimelineNode.prototype,"delay",2),Ei([v({fallback:0})],g.TimelineNode.prototype,"duration",2),Ei([v({fallback:!1})],g.TimelineNode.prototype,"paused",2),Ei([v({protected:!0,fallback:!1})],g.TimelineNode.prototype,"insideTimeRange",2),g.TimelineNode=Ei([st("TimelineNode")],g.TimelineNode);var ku=Object.defineProperty,Pu=Object.getOwnPropertyDescriptor,Bi=(r,t,e,A)=>{for(var i=A>1?void 0:A?Pu(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&ku(t,e,i),i};g.CanvasItem=class extends g.TimelineNode{_parentGlobalVisible;_globalVisible;get globalVisible(){return this._globalVisible??!0}_parentGlobalOpacity;_globalOpacity;get globalOpacity(){return this._globalOpacity??1}_modulate=new De(4294967295);context=new qa;_resetContext=!0;_redrawing=!0;_relayouting=!1;_repainting=!1;_originalBatchables=[];_layoutedBatchables=[];_batchables=[];constructor(t,e=[]){super(),this.setProperties(t).append(e)}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"modulate":this._modulate.value=e,this.requestRepaint();break;case"blendMode":this.requestRepaint();break;case"opacity":this._updateGlobalOpacity();break;case"visible":case"insideTimeRange":this._updateGlobalVisible();break}}show(){this.visible=!0}hide(){this.visible=!1}isVisibleInTree(){return this.globalOpacity>0&&this.globalVisible}canRender(){return super.canRender()&&this.isVisibleInTree()}requestRedraw(){this._redrawing=!0}requestRelayout(){this._relayouting=!0}requestRepaint(){this._repainting=!0}_updateGlobalVisible(){this._parentGlobalVisible=this.getParent()?.globalVisible,this._globalVisible=(this._parentGlobalVisible??!0)&&this.visible&&this.insideTimeRange}_updateGlobalOpacity(){this._parentGlobalOpacity=this.getParent()?.opacity;const t=le(this.opacity,0,1)*(this._parentGlobalOpacity??1);this._globalOpacity!==t&&(this._globalOpacity=t,this.requestRepaint())}_draw(){this.emit("draw")}_redraw(){return this.log(this.name,"drawing"),this._draw(),this.context.toBatchables()}_relayout(t){return this.log(this.name,"layouting"),t}_repaint(t){return this.log(this.name,"painting"),t.map(e=>({...e,modulate:this._modulate.toArgb(this.globalOpacity,!0),blendMode:this.blendMode}))}_process(t){super._process(t);const e=this.getParent();this._parentGlobalVisible!==e?.globalVisible&&this._updateGlobalVisible(),this._parentGlobalOpacity!==e?.globalOpacity&&this._updateGlobalOpacity()}_updateBatchables(){const t=this._redrawing;let e=this._relayouting,A=this._repainting,i;t&&(this._originalBatchables=this._redraw(),e=!0),e&&(this._layoutedBatchables=this._relayout(this._originalBatchables),A=!0),A&&(i=this._repaint(this._layoutedBatchables)),t&&this._resetContext&&this.context.reset(),i&&(this._batchables=i,this._redrawing=!1,this._relayouting=!1,this._repainting=!1)}_render(t){this._updateBatchables(),this._batchables.forEach(e=>{e.texture?.upload(t),t.batch2D.render({...e,texture:e.texture?._glTexture(t)})}),super._render(t)}},Bi([v()],g.CanvasItem.prototype,"modulate",2),Bi([v()],g.CanvasItem.prototype,"blendMode",2),Bi([v({protected:!0,fallback:!0})],g.CanvasItem.prototype,"visible",2),Bi([v({protected:!0,fallback:1})],g.CanvasItem.prototype,"opacity",2),g.CanvasItem=Bi([st("CanvasItem")],g.CanvasItem);var Uu=Object.defineProperty,Nu=Object.getOwnPropertyDescriptor,Ci=(r,t,e,A)=>{for(var i=A>1?void 0:A?Nu(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&Uu(t,e,i),i};g.Viewport=class extends g.Node{constructor(t=!1){super(),this.flipY=t,this.projection.flipY(t)}projection=new ta;canvasTransform=new Yt;_framebufferIndex=0;_framebuffers=[{texture:new Ws,needsUpload:!1},{texture:new Ws,needsUpload:!1}];get valid(){return!!(this.width&&this.height)}get framebuffer(){return this._framebuffers[this._framebufferIndex]}get texture(){return this.framebuffer.texture}getViewport(){return this}_glFramebufferOptions(t){const{width:e,height:A}=this,{pixelRatio:i}=t;return this._framebuffers.forEach(s=>{const n=s.texture;n.width=e,n.height=A,n.pixelRatio=i,n.upload(t)}),{width:e,height:A,colorTextures:[this.texture._glTexture(t)]}}_glFramebuffer(t){return t.getRelated(this.framebuffer,()=>t.framebuffer.create(this._glFramebufferOptions(t)))}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"x":case"y":this.requestUpload(),this.projection.translate(this.x,this.y),this.emit("updateRect");break;case"width":case"height":this.requestUpload(),this.projection.resize(this.width,this.height),this.emit("updateRect");break}}requestUpload(){this._framebuffers.forEach(t=>t.needsUpload=!0)}resize(t,e){this.width=t,this.height=e}upload(t){const e=this.framebuffer;return e.needsUpload&&this.valid?(e.needsUpload=!1,t.framebuffer.update(this._glFramebuffer(t),this._glFramebufferOptions(t)),!0):!1}activate(t){return this.valid?(t.flush(),this._tree?.setCurrentViewport(this),this.upload(t),t.framebuffer.bind(this._glFramebuffer(t)),!0):!1}redraw(t,e){if(this.valid){t.flush();const A=this.framebuffer.texture;return this._framebufferIndex=(this._framebufferIndex+1)%this._framebuffers.length,this.activate(t),t.clear(),A.activate(t,0),e(),!0}return!1}activateWithCopy(t,e){this.resize(e.width,e.height),this.activate(t)&&(t.clear(),e.texture.activate(t,0),ut.draw(t,pi.instance,{sampler:0}))}render(t,e){const A=this._tree?.getCurrentViewport();t.program.uniforms.projectionMatrix=this.projection.toArray(!0),t.program.uniforms.viewMatrix=this.canvasTransform.toArray(!0),this.activate(t),t.clear(),super.render(t,e),t.flush(),A?A.activate(t):(t.framebuffer.bind(null),this._tree?.setCurrentViewport(void 0))}getRect(){return new nA(this.x,this.y,this.width,this.height)}toCanvasGlobal(t,e){return this.canvasTransform.applyAffineInverse(t,e)}toCanvasScreen(t,e){return this.canvasTransform.apply(t,e)}},Ci([v({fallback:0})],g.Viewport.prototype,"x",2),Ci([v({fallback:0})],g.Viewport.prototype,"y",2),Ci([v({fallback:0})],g.Viewport.prototype,"width",2),Ci([v({fallback:0})],g.Viewport.prototype,"height",2),g.Viewport=Ci([st("Viewport")],g.Viewport);var Fu=Object.defineProperty,Tu=Object.getOwnPropertyDescriptor,Qi=(r,t,e,A)=>{for(var i=A>1?void 0:A?Tu(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&Fu(t,e,i),i};g.Effect=class extends g.TimelineNode{material;get _effectMode(){return this.effectMode??"parent"}viewport1=new g.Viewport;viewport2=new g.Viewport;_renderId=0;_renderViewport;_previousSibling;_nextSibling;constructor(t,e=[]){super(),this._onProcessing=this._onProcessing.bind(this),this._onNodeProcessed=this._onNodeProcessed.bind(this),this.setProperties(t).append(e)}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"glsl":{const s=new Ii(e);!this.effectMode&&s.has.transition&&(this.effectMode="transition"),this.material=s;break}case"glslSrc":{e?Fe.text.load(e).then(s=>this.glsl=s):this.glsl="";break}}}_treeEnter(t){t.on("processing",this._onProcessing),t.on("nodeProcessed",this._onNodeProcessed),this.viewport1.setTree(t),this.viewport2.setTree(t)}_treeExit(t){t.off("processing",this._onProcessing),t.off("nodeProcessed",this._onNodeProcessed),this.viewport1.setTree(void 0),this.viewport2.setTree(void 0)}_onProcessing(){if(this.canProcess())switch(this._updateCurrentTime(),this._effectMode){case"transition":this._previousSibling=this.previousSibling,this._nextSibling=this.nextSibling;break;default:this._previousSibling=void 0,this._nextSibling=void 0;break}}_onNodeProcessed(t){if(!this.canProcess()||!this.isInsideTimeRange())return;const e=this._tree?.renderStack;if(e)switch(this._effectMode){case"transition":t.equal(this._previousSibling)?(this._previousSibling=void 0,e.push(this)):t.equal(this._nextSibling)&&(this._nextSibling=void 0,e.push(this));break}}_processParent(){const t=this._tree?.renderStack;if(!t)return;const e=t.currentCall?.parentCall;if(!e)return;const A=e.calls;let i,s;A.forEach((n,o)=>{(n.renderable.equal(this._parent)||n.renderable.parent?.equal(this._parent))&&(i=i??o,s=o)}),!(i===void 0||s===void 0)&&(A.splice(s+1,0,t.createCall(this)),A.splice(i,0,t.createCall(this)))}_processChildren(){this._children.length&&(super.emit("process"),this._tree?.renderStack.push(this))}_onProcess(t=0){if(this.canProcess())switch(this._renderId=0,this._effectMode){case"before":super._onProcess(t);break;case"parent":this._processParent();break;case"children":this._processChildren();break}}_renderBefore(t){const e=this._tree?.getCurrentViewport();e&&this.apply(t,e,{redraw:!0})}_renderTransition(t){if(this._renderId%2===0)this._renderViewport=this._tree?.getCurrentViewport(),this._renderViewport&&(this.viewport1.activateWithCopy(t,this._renderViewport),this.viewport2.resize(this._renderViewport.width,this._renderViewport.height)),this.viewport2.activate(t),t.clear();else{const e=this._renderViewport;this._renderViewport=void 0,e&&(e.activate(t),t.clear(),this.viewport1.texture.activate(t,0),this.viewport2.texture.activate(t,1),this.apply(t,e,{from:this.viewport1,to:this.viewport2}),t.texture.unbind(0),t.texture.unbind(1))}}_renderParentOrChildren(t){if(this._renderId%2===0)this._renderViewport=this._tree?.getCurrentViewport(),this._renderViewport&&this.viewport1.resize(this._renderViewport.width,this._renderViewport.height),this.viewport1.activate(t),t.clear();else{const e=this._renderViewport;this._renderViewport=void 0,e&&(this.viewport1.activate(t),this.apply(t,this.viewport1,{redraw:!0,target:this._effectMode==="parent"?this._parent??void 0:void 0,targetArea:this._parseTargetArea()}),e.activate(t),this.viewport1.texture.activate(t,0),ut.draw(t))}}_parseTargetArea(){if(this._effectMode==="parent"&&this._parent&&"getRect"in this._parent){const t=this._parent.getRect();if(t)return[t.left/this.viewport1.width,t.top/this.viewport1.height,t.width/this.viewport1.width,t.height/this.viewport1.height]}}_render(t){switch(this._effectMode){case"before":this._renderBefore(t);break;case"transition":this._renderTransition(t);break;case"parent":case"children":default:this._renderParentOrChildren(t);break}this._renderId++}apply(t,e,A){this.material&&(A?.redraw?e.redraw(t,()=>{ut.draw(t,this.material,{from:0,to:1,progress:this.currentTimeProgress,ratio:e.width/e.height})}):ut.draw(t,this.material,{from:0,to:1,progress:this.currentTimeProgress,ratio:A?.from?A.from.width/A.from.height:0}))}},Qi([v({protected:!0})],g.Effect.prototype,"material",2),Qi([v()],g.Effect.prototype,"effectMode",2),Qi([v({fallback:""})],g.Effect.prototype,"glsl",2),Qi([v({fallback:""})],g.Effect.prototype,"glslSrc",2),g.Effect=Qi([st("Effect")],g.Effect);class Lu{currentCall;calls=[];createCall(t){return{renderable:t,parentCall:this.currentCall,fn:t.render.bind(t),calls:[]}}push(t){const e=this.createCall(t);return(this.currentCall?.calls??this.calls).push(e),e}render(t){this.calls.forEach(function e(A){A.fn(t,()=>{A.calls.forEach(e)})}),this.calls=[]}}var Gu=Object.defineProperty,Ou=Object.getOwnPropertyDescriptor,yi=(r,t,e,A)=>{for(var i=A>1?void 0:A?Ou(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&Gu(t,e,i),i};g.Timeline=class extends g.Node{static from(t,e=!1){const[A,i]=t?Array.isArray(t)?t:[0,t]:[];return new g.Timeline({startTime:A,endTime:i,loop:e})}constructor(t){super(),this.setProperties(t)}_updateProperty(t,e,A){switch(super._updateProperty(t,e,A),t){case"startTime":this.startTime=Math.min(e,this.endTime);break;case"endTime":this.endTime=e||Number.MAX_SAFE_INTEGER;break}}addTime(t){const e=this.startTime,A=this.endTime;let i=this.currentTime;return i=i+t,this.loop&&i>A&&(i=e+i%A),i=le(i,e,A),this.currentTime=i,this.emit("updateCurrentTime",i,t),this}_process(t){super._process(t),this.addTime(t)}},yi([v({fallback:0})],g.Timeline.prototype,"startTime",2),yi([v({fallback:0})],g.Timeline.prototype,"currentTime",2),yi([v({fallback:Number.MAX_SAFE_INTEGER})],g.Timeline.prototype,"endTime",2),yi([v({fallback:!1})],g.Timeline.prototype,"loop",2),g.Timeline=yi([st("Timeline")],g.Timeline);var Hu=Object.getOwnPropertyDescriptor,Ju=(r,t,e,A)=>{for(var i=A>1?void 0:A?Hu(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};g.Window=class extends g.Viewport{},g.Window=Ju([st("Window")],g.Window);var Ku=Object.defineProperty,zs=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&Ku(t,e,i),i};class mi extends nr{input=new qo;renderStack=new Lu;root=new g.Window(!0).setTree(this);timeline;_backgroundColor=new De;_currentViewport;getCurrentViewport(){return this._currentViewport}setCurrentViewport(t){this._currentViewport=t}constructor(t=new g.Timeline){super(),this.timeline=t.setTree(this)}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"backgroundColor":this._backgroundColor.value=e;break}}log(...t){this.debug&&console.log(`[modern-canvas][${performance.now().toFixed(4)}ms]`,...t)}_process(t=0){this.timeline.emit("process",t),this.emit("processing"),this.root.emit("process",t),this.emit("processed")}_render(t){this.emit("rendering"),this.renderStack.render(t),this._renderScreen(t),this.emit("rendered")}_renderScreen(t){t.state.reset(),t.framebuffer.bind(null),t.viewport.bind({x:0,y:0,width:this.root.width*t.pixelRatio,height:this.root.height*t.pixelRatio}),this.backgroundColor&&t.gl.clearColor(...this._backgroundColor.toArray()),t.clear(),this.backgroundColor&&t.gl.clearColor(0,0,0,0);const e=this.root.texture;e.activate(t,0),ut.draw(t),t.texture.unbind(e)}free(){super.free(),this.root.children.internal.forEach(t=>this.root.removeChild(t)),this.input.removeEventListeners()}}zs([v({protected:!0,fallback:!1})],mi.prototype,"processPaused"),zs([v()],mi.prototype,"backgroundColor"),zs([v({protected:!0,fallback:!1})],mi.prototype,"debug");var Yu=Object.getOwnPropertyDescriptor,Vu=(r,t,e,A)=>{for(var i=A>1?void 0:A?Yu(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};g.Transition=class extends g.Effect{constructor(t,e=[]){super(),this.setProperties(t).append(e)}},g.Transition=Vu([st("Transition",{effectMode:"transition",processMode:"pausable",duration:2e3})],g.Transition);var Wu=Object.defineProperty,zu=Object.getOwnPropertyDescriptor,qs=(r,t,e,A)=>{for(var i=A>1?void 0:A?zu(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&Wu(t,e,i),i};g.Node2D=class extends g.CanvasItem{position=new Mt().on("update",()=>this.updateGlobalTransform());scale=new Mt(1,1).on("update",()=>this.updateGlobalTransform());skew=new Mt().on("update",()=>this.updateGlobalTransform());transform=new Yt;globalPosition=new Mt;globalScale=new Mt;globalSkew=new Mt;globalTransform=new Yt;_parentTransformDirtyId;constructor(t,e=[]){super(),this.setProperties(t).append(e)}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"rotation":this.requestRelayout();break}}getTransformOrigin(){return new Mt(0,0)}updateTransform(t){const e=this.getTransformOrigin(),A=this.transform.identity().translate(-e.x,-e.y).scale(this.scale.x,this.scale.y).skew(this.skew.x,this.skew.y).rotate(this.rotation);t?.(A),A.translate(this.position.x,this.position.y).translate(e.x,e.y)}updateGlobalTransform(){this.updateTransform();const t=this.getParent();if(t?.globalTransform){const{globalPosition:e,globalScale:A,globalSkew:i,globalTransform:s,globalRotation:n}=t;this._parentTransformDirtyId=s.dirtyId,this.globalPosition.set(e.x+this.position.x,e.y+this.position.y),this.globalScale.set(A.x*this.scale.x,A.y*this.scale.y),this.globalSkew.set(i.x*this.skew.x,i.y*this.skew.y),this.globalRotation=n+this.rotation,t.globalTransform.multiply(this.transform,this.globalTransform)}else this.globalPosition.copy(this.position),this.globalScale.copy(this.scale),this.globalSkew.copy(this.skew),this.globalRotation=this.rotation,this.globalTransform.copy(this.transform);this.requestRelayout()}_transformVertices(t,e){let A,i,s,n,o,a;if(e){const c=this.globalTransform.clone();c.multiply(typeof e=="function"?e?.():e),[A,i,s,n,o,a]=c.toArray()}else[A,i,s,n,o,a]=this.globalTransform.toArray();const l=t.slice();for(let c=t.length,h=0;h<c;h+=2){const u=t[h],d=t[h+1];l[h]=A*u+i*d+s,l[h+1]=n*u+o*d+a}return l}_relayout(t){return t=super._relayout(t),this.updateGlobalTransform(),t.map(e=>({...e,vertices:this._transformVertices(e.vertices,e.vertTransform)}))}_process(t){super._process(t);const e=this.getParent();e?.globalTransform&&this._parentTransformDirtyId!==e?.globalTransform?.dirtyId&&this.requestRelayout()}toLocal(t,e){return this.globalTransform.applyAffineInverse(t,e)}toGlobal(t,e){return this.globalTransform.apply(t,e)}},qs([v({protected:!0,fallback:0})],g.Node2D.prototype,"rotation",2),qs([v({protected:!0,fallback:0})],g.Node2D.prototype,"globalRotation",2),g.Node2D=qs([st("Node2D")],g.Node2D);var qu=Object.defineProperty,Xu=Object.getOwnPropertyDescriptor,Xs=(r,t,e,A)=>{for(var i=A>1?void 0:A?Xu(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&qu(t,e,i),i};g.Camera2D=class extends g.Node2D{zoom=new Mt(1,1).on("update",()=>this.updateCanvasTransform());maxZoom=new Mt(6,6);minZoom=new Mt(.1,.1);_screenOffset={x:0,y:0};constructor(t,e=[]){super(),this.setProperties(t).append(e)}addZoom(t,e=t){return this.zoom.set(le(this.zoom.x+t,this.minZoom.x,this.maxZoom.x),le(this.zoom.y+e,this.minZoom.y,this.maxZoom.y)),this}setZoom(t,e=t){return this.zoom.set(le(t,this.minZoom.x,this.maxZoom.x),le(e,this.minZoom.y,this.maxZoom.y)),this}_input(t,e){if(super._input(t,e),e==="keydown"){const A=t;!this.spaceKey&&A.code==="Space"&&(A.cursor="grab",this.spaceKey=!0)}else if(e==="keyup"){const A=t;A.code==="Space"&&(A.cursor="default",this.spaceKey=!1,this.grabbing=!1)}else if(e==="pointerdown"){const A=t;!this.grabbing&&(this.spaceKey||A.button===1)&&(this.grabbing=!0,A.cursor="grabbing",this._screenOffset={x:A.screenX,y:A.screenY})}else if(e==="pointermove"){const A=t;this.grabbing&&(this.position.add(-(this._screenOffset.x-A.screenX),-(this._screenOffset.y-A.screenY)),this._screenOffset={x:A.screenX,y:A.screenY})}else if(e==="pointerup"){const A=t;this.grabbing&&(this.grabbing=!1,this.spaceKey?A.cursor="grab":A.cursor="default")}else e==="wheel"&&this._onWheel(t)}_onWheel(t){if(t.ctrlKey){if(!(t.wheelDeltaY?Math.abs(Math.abs(t.wheelDeltaY)-Math.abs(3*t.deltaY))<3:t.deltaMode===0)){t.preventDefault();const A=this.zoom.x;this.addZoom(t.deltaY*-.015);const i=1-this.zoom.x/A;this.position.add((t.screenX-this.position.x)*i,(t.screenY-this.position.y)*i)}}else t.preventDefault(),this.position.add(-t.deltaX,-t.deltaY)}updateTransform(){super.updateTransform(),this.updateCanvasTransform()}updateCanvasTransform(){const t=this.getViewport();t&&(t.canvasTransform.identity().scale(this.zoom.x,this.zoom.y).translate(this.position.x,this.position.y),this.emit("updateCanvasTransform"))}toGlobal(t,e){const A=this.getViewport();if(!A)throw new Error("Failed to toGlobal, viewport is empty");return A.toCanvasGlobal(t,e)}toScreen(t,e){const A=this.getViewport();if(!A)throw new Error("Failed to toScreen, viewport is empty");return A.toCanvasScreen(t,e)}},Xs([v({protected:!0,fallback:!1})],g.Camera2D.prototype,"spaceKey",2),Xs([v({protected:!0,fallback:!1})],g.Camera2D.prototype,"grabbing",2),g.Camera2D=Xs([st("Camera2D",{processMode:"disabled",renderMode:"disabled"})],g.Camera2D);const Za={brightness:1,contrast:1,grayscale:0,"hue-rotate":0,invert:0,opacity:1,saturate:1,sepia:0};function ju(r){const t=new xs;if(r==="none")return t;const e=ai(r).reduce((A,{name:i,args:s})=>(A[i]=s[0].normalizedIntValue,A),{});Object.keys(Za).forEach(A=>{e[A]=e[A]??Za[A]});for(const A in e){const i=e[A];switch(A){case"hue-rotate":t.hueRotate(i*ne);break;case"saturate":t.saturate(i);break;case"brightness":t.brightness(i);break;case"contrast":t.contrast(i);break;case"invert":t.invert(i);break;case"sepia":t.sepia(i);break;case"opacity":t.opacity(i);break;case"grayscale":t.grayscale(i);break}}return t}function $a(r,t,e,A=new Yt){return r=!r||r==="none"?"":r,ai(r,{width:t,height:e}).reverse().forEach(({name:i,args:s})=>{const n=s.map(o=>o.normalizedIntValue);switch(i){case"translate":A.translate(n[0]*t,(n[1]??n[0])*e);break;case"translateX":A.translateX(n[0]*t);break;case"translateY":A.translateY(n[0]*e);break;case"translateZ":A.translateZ(n[0]);break;case"translate3d":A.translate3d(n[0]*t,(n[1]??n[0])*e,n[2]??n[1]??n[0]);break;case"scale":A.scale(n[0],n[1]??n[0]);break;case"scaleX":A.scaleX(n[0]);break;case"scaleY":A.scaleY(n[0]);break;case"scale3d":A.scale3d(n[0],n[1]??n[0],n[2]??n[1]??n[0]);break;case"rotate":A.rotate(n[0]*ne);break;case"rotateX":A.rotateX(n[0]*ne);break;case"rotateY":A.rotateY(n[0]*ne);break;case"rotateZ":A.rotateZ(n[0]*ne);break;case"rotate3d":A.rotate3d(n[0]*ne,(n[1]??n[0])*ne,(n[2]??n[1]??n[0])*ne,(n[3]??n[2]??n[1]??n[0])*ne);break;case"skew":A.skew(n[0],n[0]??n[1]);break;case"skewX":A.skewX(n[0]);break;case"skewY":A.skewY(n[0]);break;case"matrix":A.set(n);break}}),A}function tl(r){const[t,e=t]=r.split(" ");return[t,e].map(A=>{switch(A=A.trim(),A){case"left":case"top":return 0;case"center":return .5;case"right":case"bottom":return 1;default:return Number(A)}})}var el=Object.defineProperty,Zu=Object.getOwnPropertyDescriptor,$u=(r,t,e)=>t in r?el(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Xe=(r,t,e,A)=>{for(var i=A>1?void 0:A?Zu(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&el(t,e,i),i},tf=(r,t,e)=>$u(r,t+"",e);g.ColorAdjustEffect=class extends g.Effect{constructor(t,e=[]){super(),this.setProperties(t).append(e)}apply(t,e){e.redraw(t,()=>{ut.draw(t,g.ColorAdjustEffect.material,{sampler:0,saturation:this.saturation,contrast:this.contrast,brightness:this.brightness,red:this.red,green:this.green,blue:this.blue,alpha:this.alpha,gamma:Math.max(this.gamma??1,1e-4)})})}},tf(g.ColorAdjustEffect,"material",new Ct({vert:`precision mediump float;
|
|
118
|
+
}`,uniforms:{sampler:0,projectionMatrix:new Float32Array([1,0,0,0,1,0,0,0,1]),modelViewMatrix:new Float32Array([1,0,0,0,1,0,0,0,1]),tint:new Float32Array([1,1,1,1])}})}}class Q extends ki{static _instance;static get instance(){return this._instance??=new this}static draw(e,t=Nr.instance,r){this.instance.draw(e,t,r)}constructor(){super({vertexAttributes:{position:new je({buffer:new Tt({data:new Float32Array([-1,-1,1,-1,1,1,-1,1]),dynamic:!1}),size:2,normalized:!1,type:"float"}),uv:new je({buffer:new Tt({data:new Float32Array([0,0,1,0,1,1,0,1]),dynamic:!1}),size:2,normalized:!1,type:"float"})},indexBuffer:new fr({data:new Uint16Array([0,1,2,0,2,3]),dynamic:!1})})}}class Xu extends ki{positionBuffer;uvBuffer;constructor(){const e=new Tt({data:new Float32Array,dynamic:!0}),t=new Tt({data:new Float32Array,dynamic:!0});super({vertexAttributes:{position:new je({buffer:e,size:2,normalized:!1,type:"float"}),uv:new je({buffer:t,size:2,normalized:!1,type:"float"})},indexBuffer:new fr({data:new Uint16Array,dynamic:!0})}),this.positionBuffer=e,this.uvBuffer=t}}var Hu=Object.defineProperty,dr=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&Hu(e,t,i),i};class ne extends Pt{static get EMPTY(){return new this({width:1,height:1,pixels:null})}static get WHITE(){return new this({width:1,height:1,pixels:new Uint8Array([255,255,255,255])})}static get BLACK(){return new this({width:1,height:1,pixels:new Uint8Array([0,0,0,255])})}static get RED(){return new this({width:1,height:1,pixels:new Uint8Array([255,0,0,255])})}static get GREEN(){return new this({width:1,height:1,pixels:new Uint8Array([0,255,0,255])})}static get BLUE(){return new this({width:1,height:1,pixels:new Uint8Array([0,0,255,255])})}_isPowerOfTwo=!1;_needsUpload=!1;get valid(){return!!(this.width&&this.height)}get realWidth(){return Math.round(this.width*this.pixelRatio)}get realHeight(){return Math.round(this.height*this.pixelRatio)}constructor(e){super(),this.source=e,this._updateSize()}_glTextureOptions(e,t){let r=this.wrapMode;return e.version===1&&!this._isPowerOfTwo&&(r="clamp_to_edge"),{value:this.source,target:"texture_2d",location:0,filterMode:this.filterMode,wrapMode:r,...t}}_glTexture(e,t){return e.getRelated(this,()=>e.texture.create(this._glTextureOptions(e,t)))}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"width":case"height":this._updatePOT();break;case"source":this._updateSize();break;case"filterMode":case"wrapMode":case"pixelRatio":this.requestUpload();break}}_updatePOT(){this._isPowerOfTwo=bs(this.realWidth)&&bs(this.realHeight),this.requestUpload()}_updateSize(){const e=this.source;"pixels"in e?(this.width=e.width/this.pixelRatio,this.height=e.height/this.pixelRatio):(this.width=Number(e.naturalWidth||e.videoWidth||e.width||0)/this.pixelRatio,this.height=Number(e.naturalHeight||e.videoHeight||e.height||0)/this.pixelRatio),this.requestUpload()}requestUpload(){this._needsUpload=!0}upload(e,t){return this._needsUpload&&this.valid?(this._needsUpload=!1,e.texture.update(this._glTexture(e,t),this._glTextureOptions(e,t)),!0):!1}activate(e,t=0){return this.valid?(e.texture.bind({target:"texture_2d",value:this._glTexture(e,{location:t}),location:t}),this.upload(e,{location:t}),!0):!1}inactivate(e){e.texture.unbind(this._glTexture(e))}free(){bo&&this.source instanceof ImageBitmap&&this.source.close()}}dr([w({protected:!0})],ne.prototype,"source"),dr([w({fallback:0})],ne.prototype,"width"),dr([w({fallback:0})],ne.prototype,"height"),dr([w({fallback:"linear"})],ne.prototype,"filterMode"),dr([w({fallback:"clamp_to_edge"})],ne.prototype,"wrapMode"),dr([w({fallback:1})],ne.prototype,"pixelRatio");class Di extends Pt{frames;constructor(e){super();let t;if(Array.isArray(e))t=e;else if(e instanceof ne)t=[{texture:e,duration:0}];else throw new TypeError("Failed new AnimatedTexture");this.frames=t,this.updateDuration()}updateDuration(){return this.duration=this.frames.reduce((e,t)=>t.duration+e,0),this}free(){this.frames.forEach(e=>{e.texture.free()})}}var Yu=Object.defineProperty,Ku=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&Yu(e,t,i),i};class Ii extends ne{constructor(e=document.createElement("canvas")){super(e)}_updateProperty(e,t,r,i){switch(e){case"width":this.source.width=Math.max(1,Math.ceil(t*this.pixelRatio));break;case"height":this.source.height=Math.max(1,Math.ceil(t*this.pixelRatio));break}super._updateProperty(e,t,r,i)}}Ku([w({fallback:2})],Ii.prototype,"pixelRatio");class Da extends ne{static _cached=new Map;static get(e){const t=new lt(e),r=t.toHex();let i=this._cached.get(r);return i||(i=new ne({width:1,height:1,pixels:new Uint8Array([t.r8,t.g8,t.b8,t.a8])}),this._cached.set(r,i)),i}constructor(e){const t=new lt(e);super({width:1,height:1,pixels:new Uint8Array([t.r8,t.g8,t.b8,t.a8])})}}class Ri extends ne{static test(e){return Er(e)}static linearGradient(e,t,r){t=t||1,r=r||1;const i=document.createElement("canvas");i.width=t,i.height=r;const n=i.getContext("2d");if(!n)throw new Error("Failed to parse linear gradient, get canvas context is null.");let{angle:o=0,stops:a}=e;o-=Math.PI/2;const l=t/2,c=r/2,h=Math.sqrt(t*t+r*r)/2,f=l+h*Math.cos(o+Math.PI),d=c+h*Math.sin(o+Math.PI),g=l+h*Math.cos(o),p=c+h*Math.sin(o),y=n.createLinearGradient(f,d,g,p);a.forEach(P=>{y.addColorStop(P.offset,P.color)}),n.fillStyle=y,n.fillRect(0,0,i.width,i.height);const m=n.getImageData(0,0,i.width,i.height);return{width:m.width,height:m.height,pixels:new Uint8Array(m.data.buffer)}}constructor(e,t,r){super(Ri.linearGradient(e,t,r))}}function Zu(s){return{autoLoad:!!(s?.autoLoad??!0),useBitmap:!!(s?.useBitmap??!0)&&xs,crossorigin:s?.crossorigin??null}}class Ju extends ne{bitmap;useBitmap;preserveBitmap=!1;_loadSource;_loadBitmap;constructor(e,t){const r=Zu(t);super(e);const i=e.src,n=i.includes(".svg")||i.startsWith("data:image/svg+xml");this.useBitmap=r.useBitmap&&!n,r.autoLoad&&this.load()}async load(){return this._loadSource||(this._loadSource=new Promise(e=>{this._loadSource=void 0;const t=this.source,r=()=>{t.onload=null,t.onerror=null},i=()=>{r(),this.requestUpload(),this.useBitmap?this.genBitmap().finally(()=>e(this)):e(this)},n=o=>{r(),console.warn(`Failed to load ImageTexture, src: ${t.src}`,o),this.emit("error",o),e(this)};t.complete&&t.src?i():(t.onload=i,t.onerror=n)})),this._loadSource}genBitmap(){if(this._loadBitmap)return this._loadBitmap;if(this.bitmap||!xs)return Promise.resolve(this);const e=this.source,t=!e.crossOrigin||e.crossOrigin==="anonymous";return this._loadBitmap=fetch(e.src,{mode:t?"cors":"no-cors"}).then(r=>r.blob()).then(r=>createImageBitmap(r,0,0,e.width,e.height,{premultiplyAlpha:"premultiply"})).then(r=>(this.bitmap=r,this.requestUpload(),this._loadBitmap=void 0,this)).catch(r=>(console.warn("Failed to genBitmap",r),this)),this._loadBitmap}_glTextureOptions(e){return{...super._glTextureOptions(e),value:this.bitmap??this.source}}upload(e){if(this.useBitmap){if(!this.bitmap)return this.genBitmap(),!1}else{const r=this.source;if(Or&&r instanceof HTMLImageElement&&(!r.complete||r.naturalWidth===0))return!1}const t=super.upload(e);return this.preserveBitmap&&this.bitmap&&(this.bitmap.close(),this.bitmap=void 0),t}}class qs extends ne{constructor(e,t=1,r=1){const i={width:t,height:r,pixels:null};e&&(ArrayBuffer.isView(e)?i.pixels=new Uint8Array(e.buffer):i.pixels=new Uint8Array(e)),super(i)}_updateProperty(e,t,r,i){switch(e){case"width":this.source.width=Math.round(this.width*this.pixelRatio);break;case"height":this.source.height=Math.round(this.height*this.pixelRatio);break;case"pixelRatio":this.source.width=Math.round(this.width*this.pixelRatio),this.source.height=Math.round(this.height*this.pixelRatio);break}super._updateProperty(e,t,r,i)}}var Qu=Object.defineProperty,Ia=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&Qu(e,t,i),i};function ef(s){return{autoLoad:!!(s?.autoLoad??!0),autoPlay:!!(s?.autoPlay??!1),fps:Number(s?.fps??0),crossorigin:s?.crossorigin??null,loop:!!(s?.loop??!1),muted:!!(s?.muted??!1),playsinline:!!(s?.playsinline??!0)}}const Xs=class ac extends ne{static mimeTypes=new Map(Object.entries({ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"}));get isReady(){return this.source.readyState>2}get isPlaying(){return!this.source.paused&&!this.source.ended&&this.isReady}get duration(){return this.source.duration}get seeking(){return this.source.seeking}get currentTime(){return this.source.currentTime}set currentTime(e){this.source.currentTime=e}_spf=0;_autoPlay=!1;_sourceLoad;_nextTime=0;_connected=!1;_requestId;_resolve;_reject;constructor(e,t){const r=ef(t);if(!To(e)){typeof e=="string"&&(e=[e]);const i=e[0].src||e[0],n=document.createElement("video");r.autoLoad&&n.setAttribute("preload","auto"),r.playsinline&&(n.setAttribute("webkit-playsinline",""),n.setAttribute("playsinline","")),r.muted&&(n.setAttribute("muted",""),n.muted=!0),r.loop&&n.setAttribute("loop",""),r.autoPlay&&n.setAttribute("autoplay",""),ko(n,i,r.crossorigin);for(let o=0;o<e.length;++o){let{src:a,mime:l}=e[o];if(a=a||e[o],a.startsWith("data:"))l=a.slice(5,a.indexOf(";"));else if(!a.startsWith("blob:")){const h=a.split("?").shift().toLowerCase(),f=h.slice(h.lastIndexOf(".")+1);l=l||ac.mimeTypes.get(f)||`video/${f}`}const c=document.createElement("source");c.src=a,l&&(c.type=l),n.appendChild(c)}e=n}super(e),this.fps=r.fps,this._autoPlay=r.autoPlay,r.autoPlay&&this.load(),this._setupAutoUpdate()}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"fps":this._spf=t?Math.floor(1e3/t):0,this._setupAutoUpdate();break;case"autoUpdate":this._setupAutoUpdate();break}}_onPlayStart=()=>{this.valid||this._onCanPlay(),this._setupAutoUpdate()};_onPlayStop=()=>{this._setupAutoUpdate()};_onCanPlay=()=>{const e=this.source;e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay);const t=this.valid;this._nextTime=0,this._updateSize(),this.requestUpload(),this._nextTime=0,!t&&this._resolve&&(this._resolve(this),this._sourceLoad=void 0,this._resolve=void 0,this._reject=void 0),this.isPlaying?this._onPlayStart():this._autoPlay&&e.play()};_onError=e=>{this.source.removeEventListener("error",this._onError,!0),this.emit("error",e),this._reject&&(this._reject(e),this._reject=void 0,this._resolve=void 0)};_onSeeked=()=>{this.autoUpdate&&!this.isPlaying&&(this._nextTime=0,this.requestUpload(),this._nextTime=0)};_setupAutoUpdate(){this.autoUpdate&&this.isPlaying?!this.fps&&this.source.requestVideoFrameCallback?(this._connected&&(Se.off(this.requestUpload),this._connected=!1,this._nextTime=0),this._requestId===void 0&&(this._requestId=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._requestId!==void 0&&(this.source.cancelVideoFrameCallback(this._requestId),this._requestId=void 0),this._connected||(Se.on(this.requestUpload),this._connected=!0,this._nextTime=0)):(this._requestId!==void 0&&(this.source.cancelVideoFrameCallback(this._requestId),this._requestId=void 0),this._connected&&(Se.off(this.requestUpload),this._connected=!1,this._nextTime=0))}_videoFrameRequestCallback=()=>{this.requestUpload(),this._requestId=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback)};requestUpload=()=>{const e=Math.floor(Se.elapsed*this.source.playbackRate);this._nextTime-=e,(!this._spf||this._nextTime<=0)&&(super.requestUpload(),this._nextTime=this._spf||0)};async load(){if(!this._sourceLoad){const e=this.source;(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart),e.addEventListener("pause",this._onPlayStop),e.addEventListener("seeked",this._onSeeked),this.isReady?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._sourceLoad=new Promise((t,r)=>{this.valid?(this._sourceLoad=void 0,t(this)):(this._resolve=t,this._reject=r,e.load())})}return this._sourceLoad}free(){this._setupAutoUpdate();const e=this.source;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlay),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load())}};Ia([w({protected:!0,fallback:!0})],Xs.prototype,"autoUpdate"),Ia([w({protected:!0,fallback:0})],Xs.prototype,"fps");let Ra=Xs;class Hs extends qs{}class Ua extends ge{fillStyle;strokeStyle;strokeAlignment;lineCap;lineJoin;lineWidth;miterLimit;uvTransform;vertTransform;_defaultStyle=ne.EMPTY;_draws=[];_toTexture(e){return e instanceof ne?e:Da.get(e)}stroke(e){if(!this.curves.length)return;let t=this.strokeStyle;if(!t&&this.style.stroke)switch(typeof this.style.stroke){case"string":t=this.style.stroke;break;case"object":gs(this.style.stroke)&&(t=this.style.stroke.color);break}this._draws.push({...e,type:"stroke",path:new ge(this),texture:t?this._toTexture(t):this._defaultStyle,uvTransform:this.uvTransform,vertTransform:this.vertTransform,style:{alignment:this.strokeAlignment??.5,cap:this.lineCap??"butt",join:this.lineJoin??"miter",width:this.lineWidth??1,miterLimit:this.miterLimit??10}}),this.resetStatus()}fillRect(e,t,r,i){this.rect(e,t,r,i).fill()}strokeRect(e,t,r,i){this.rect(e,t,r,i).stroke()}fill(e){if(!this.curves.length)return;let t=this.fillStyle;if(!t&&this.style.fill)switch(typeof this.style.fill){case"string":t=this.style.fill;break;case"object":gs(this.style.fill)&&(t=this.style.fill.color);break}this._draws.push({...e,type:"fill",path:new ge(this),texture:t?this._toTexture(t):this._defaultStyle,uvTransform:this.uvTransform,vertTransform:this.vertTransform}),this.resetStatus()}copy(e){return super.copy(e),this.strokeStyle=e.strokeStyle,this.fillStyle=e.fillStyle,this.uvTransform=e.uvTransform,this.vertTransform=e.vertTransform,this.strokeAlignment=e.strokeAlignment,this.lineCap=e.lineCap,this.lineJoin=e.lineJoin,this.lineWidth=e.lineWidth,this.miterLimit=e.miterLimit,this._draws=e._draws.slice(),this}resetStatus(){super.reset(),this.strokeStyle=void 0,this.fillStyle=void 0,this.uvTransform=void 0,this.vertTransform=void 0,this.strokeAlignment=void 0,this.lineCap=void 0,this.lineJoin=void 0,this.lineWidth=void 0,this.miterLimit=void 0}reset(){return this.resetStatus(),this._draws.length=0,this}buildUvs(e,t,r,i,n){if(i){const o=n&&(typeof n=="function"?n:(c,h)=>n.apply({x:c,y:h}).toArray()),a=i.width,l=i.height;for(let c=t.length,h=e;h<c;h+=2){const f=t[h],d=t[h+1];let g,p;o?[g,p]=o(f,d):[g,p]=[f/a,d/l],r.push(g,p)}}else for(let o=t.length,a=e;a<o;a+=2)r.push(0,0)}toBatchables(){const e=[];for(let t=this._draws.length,r=0;r<t;r++){const i=this._draws[r],n=[],o=[],a=[];i.type==="fill"?i.path.fillTriangulate({vertices:n,indices:o}):i.path.strokeTriangulate({vertices:n,indices:o,lineStyle:i.style,flipAlignment:!1,closed:!0}),this.buildUvs(0,n,a,i.texture,i.uvTransform),e.push({vertices:new Float32Array(n),indices:new Float32Array(o),uvs:new Float32Array(a),texture:i.texture,type:i.type,disableWrapMode:i.disableWrapMode,vertTransform:i.vertTransform})}return e}}class Ba extends Array{front=[];back=[];get internal(){return[...this.front,...this,...this.back]}constructor(...e){super(),this.set(e)}set(e){return this.front.length=0,this.length=0,this.back.length=0,e.forEach(t=>{switch(t.internalMode){case"front":this.front.push(t);break;case"default":this.push(t);break;case"back":this.back.push(t);break}}),this}getInternal(e){switch(e){case"front":return this.front;case"default":return this;case"back":return this.back;default:throw new Error(`Unknown internal mode: ${e}`)}}toJSON(){return[...this]}}var tf=Object.defineProperty,rf=Object.getOwnPropertyDescriptor,Et=(s,e,t,r)=>{for(var i=r>1?void 0:r?rf(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&tf(e,t,i),i};const La={};function sf(s){let e=La[s]??0;return e++,La[s]=e,e}u.Node=class extends It{_readyed=!1;constructor(e,t=[]){super(),this._onTreeEnter=this._onTreeEnter.bind(this),this._onTreeExit=this._onTreeExit.bind(this),this._onParented=this._onParented.bind(this),this._onUnparented=this._onUnparented.bind(this),this._onReady=this._onReady.bind(this),this._onProcess=this._onProcess.bind(this),this.setProperties({name:`${this.is}:${sf(this.is)}`,...e}).append(t),this.on("treeEnter",this._onTreeEnter).on("treeExit",this._onTreeExit).on("parented",this._onParented).on("unparented",this._onUnparented).on("ready",this._onReady).on("process",this._onProcess)}setProperties(e){if(e){const{meta:t,...r}=e;if(t)for(const i in t)this.meta[i]=t[i];super.setProperties(r)}return this}getName(){return this.name}setName(e){return this.name=e,this}_tree;get tree(){return this.getTree()}set tree(e){this.setTree(e)}getTree(){return this._tree}getViewport(){return this.parent?.getViewport()??this.getWindow()}getWindow(){return this._tree?.root}isInsideTree(){return!!this._tree}setTree(e){const t=this._tree;if(!e?.equal(t)){t&&this.emit("treeExit",t),this._tree=e,e&&this.emit("treeEnter",e);const r=this._children.internal;for(let i=r.length,n=0;n<i;n++){const o=r[n];!e&&this.emit("childExitingTree",o),o.setTree(e),e&&this.emit("childEnteredTree",o)}e&&(this.emit("treePostEnter",e),this._readyed||(this._readyed=!0,this.emit("ready")))}return this}log(...e){this._tree?.log(...e)}_parent;get parent(){return this._parent}set parent(e){this.setParent(e)}hasParent(){return!!this._parent}getParent(){return this._parent}setParent(e){if(!this._parent?.equal(e)){const t=this._parent;t&&this.emit("unparented",t),this._parent=e,e&&this.emit("parented",e),this.setTree(e?._tree)}return this}_children=new Ba;get children(){return this._children}set children(e){e instanceof Ba?this._children=e:this._children.set(e)}getChild(e=0){return this._children[e]}get siblingIndex(){return this.getIndex()}set siblingIndex(e){this._parent?.moveChild(this,e)}get previousSibling(){return this._parent?.children[this.getIndex()-1]}get nextSibling(){return this._parent?.children[this.getIndex()+1]}get firstSibling(){return this._parent?.children[0]}get lastSibling(){const e=this._parent?.children;return e?e[e.length-1]:void 0}canProcess(){if(!this._tree)return!1;switch(this.processMode){case"inherit":return this._parent?.canProcess()??!0;case"pausable":return!this._tree.processPaused;case"when_paused":return this._tree.processPaused;case"always":return!0;case"disabled":default:return!1}}canRender(){if(!this._tree)return!1;switch(this.renderMode){case"inherit":return this._parent?.canRender()??!0;case"always":return!0;case"disabled":default:return!1}}_updateProperty(e,t,r,i){super._updateProperty(e,t,r,i)}_onTreeEnter(e){this._treeEnter(e),this.emit("treeEntered",e)}_onTreeExit(e){this.emit("treeExiting",e),this._treeExit(e),this.emit("treeExited",e)}_onParented(e){this._parented(e)}_onUnparented(e){this._unparented(e)}_onReady(){this._ready()}_onProcess(e=0){const t=this._tree,r=this.canRender(),i=this.canProcess(),n=[],o=[];this._children.internal.forEach(l=>{switch(l.processSortMode){case"default":o.push(l);break;case"parent_before":n.push(l);break}}),n.forEach(l=>{l.emit("process",e)}),i&&(t?.emit("nodeProcessing",this),this.emit("processing",e),this._process(e));let a;if(r){const l=t.renderStack.push(this);a=t.renderStack.currentCall,t.renderStack.currentCall=l}if(this.mask instanceof u.Node)this.getNode("__$mask")||(this.mask.processMode="disabled",this.appendChild(this.mask,"front"));else{const l=this.getNode("__$mask");l&&this.removeChild(l)}o.forEach(l=>{l.emit("process",e)}),r&&(t.renderStack.currentCall=a),i&&(this.emit("processed",e),t?.emit("nodeProcessed",this))}render(e,t){const r=this.mask;r&&(e.flush(),e.mask.push(this,r)),this._render(e),t?.(),r&&(e.flush(),e.mask.pop(this))}input(e,t){if(e.propagationStopped)return;const r=this._children.internal;for(let i=r.length-1;i>=0;i--)r[i].input(e,t);e.propagationStopped||this._input(e,t)}getIndex(){return this._parent?.children.getInternal(this.internalMode).indexOf(this)??0}getNode(e){return this._children.internal.find(t=>t.name===e)}removeNode(e){this.getNode(e)?.remove()}addSibling(e){return this.equal(e)||!this.hasParent()||e.hasParent()?this:(e.internalMode=this.internalMode,this._parent.moveChild(e,this.getIndex()+1),this)}prepend(...e){let t;Array.isArray(e[0])?t=e[0]:t=e,t.forEach(r=>{this.moveChild(r,0)})}append(...e){let t;Array.isArray(e[0])?t=e[0]:t=e,t.forEach(r=>{this.appendChild(r)})}before(...e){let t;Array.isArray(e[0])?t=e[0]:t=e,t.forEach(r=>{this._parent?.moveChild(r,this.getIndex())})}after(...e){let t;Array.isArray(e[0])?t=e[0]:t=e,t.forEach(r=>{this._parent?.moveChild(r,this.getIndex()+1)})}insertBefore(e,t){return!t.hasParent()||!this.equal(t.parent)||this.moveChild(e,t.getIndex()),e}appendChild(e,t=e.internalMode){if(this.equal(e)||e.hasParent())return e;switch(t){case"front":this._children.front.push(e);break;case"default":this._children.push(e);break;case"back":this._children.back.push(e);break}return e.internalMode!==t&&(e.internalMode=t),e.setParent(this),this.emit("appendChild",e),e}moveChild(e,t,r=e.internalMode){if(this.equal(e)||e.hasParent()&&!this.equal(e.parent))return this;const i=this._children.getInternal(e.internalMode),n=i.indexOf(e),o=this._children.getInternal(r);return(e.internalMode!==r||t!==n)&&(n>-1&&i.splice(n,1),e.setParent(this),t>-1&&t<o.length?o.splice(t,0,e):o.push(e),n>-1?this.emit("moveChild",e,t,n):this.emit("appendChild",e)),e.internalMode!==r&&(e.internalMode=r),this}removeChild(e){const t=e.getIndex();return this.equal(e.parent)&&t>-1&&(this._children.getInternal(e.internalMode).splice(t,1),e.setParent(void 0),this.emit("removeChild",e,t)),e}removeChildren(){this._children.forEach(e=>this.removeChild(e))}remove(){this._parent?.removeChild(this)}forEachChild(e){return this._children.forEach(e),this}forEachDescendant(e){return this._children.forEach(t=>{e(t),t.forEachDescendant(e)}),this}forEachAncestor(e){const t=this.parent;return t&&(e(t),t.forEachAncestor(e)),this}_ready(){}_treeEnter(e){}_treeExit(e){}_parented(e){}_unparented(e){}_process(e){}_input(e,t){}_render(e){}clone(){return new this.constructor(this.toJSON(),this._children.internal)}toJSON(){return Ve({...super.toJSON(),children:this._children.length?[...this._children.map(e=>e.toJSON())]:void 0,meta:{...this.meta,inCanvasIs:this.is}})}static parse(e){if(Array.isArray(e))return e.map(l=>this.parse(l));const{meta:t={},children:r,...i}=e,{inCanvasIs:n="Node"}=t,o=wi.get(n)??u.Node,a=new o({...i,meta:t});return r?.forEach(l=>a.appendChild(this.parse(l))),a}},Et([w({fallback:fo()})],u.Node.prototype,"id",2),Et([w({fallback:fo()})],u.Node.prototype,"name",2),Et([w({default:()=>({})})],u.Node.prototype,"meta",2),Et([w({protected:!0,fallback:"inherit"})],u.Node.prototype,"processMode",2),Et([w({protected:!0,fallback:"default"})],u.Node.prototype,"processSortMode",2),Et([w({protected:!0,fallback:"inherit"})],u.Node.prototype,"renderMode",2),Et([w({protected:!0,fallback:"default"})],u.Node.prototype,"internalMode",2),Et([w({protected:!0})],u.Node.prototype,"mask",2),u.Node=Et([W("Node")],u.Node);var nf=Object.defineProperty,of=Object.getOwnPropertyDescriptor,Fr=(s,e,t,r)=>{for(var i=r>1?void 0:r?of(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&nf(e,t,i),i};u.TimelineNode=class extends u.Node{constructor(e,t=[]){super(),this.setProperties(e).append(t)}computedDuration=0;_currentTime=0;_startTime=0;get timeline(){return this._tree?.timeline}get timelineCurrentTime(){return this.timeline?.currentTime??0}get parentStartTime(){return this._parent?.startTime??0}get currentTime(){return Ge(this._currentTime,0,this.computedDuration)}get startTime(){return this._startTime}set startTime(e){this.delay=e-this.parentStartTime,this._updateCurrentTime(!0)}get endTime(){return this._startTime+this.computedDuration}get currentTimeProgress(){return this.computedDuration?Ge(this._currentTime/this.computedDuration,0,1):0}isInsideTimeRange(){const e=this._currentTime;return this.computedDuration?e>=0&&e<=this.computedDuration:e>=0}_updateCurrentTime(e=!1){if(e||!this.paused){const t=this._parent;this._startTime=this.delay+this.parentStartTime,this.computedDuration=t?.computedDuration?Math.min(this._startTime+this.duration,t.endTime)-this._startTime:this.duration,this._currentTime=this.timelineCurrentTime-this._startTime,this.emit("updateCurrentTime",this._currentTime),this.insideTimeRange=this.isInsideTimeRange()}}_process(e){super._process(e),this._updateCurrentTime()}},Fr([w({fallback:0})],u.TimelineNode.prototype,"delay",2),Fr([w({fallback:0})],u.TimelineNode.prototype,"duration",2),Fr([w({fallback:!1})],u.TimelineNode.prototype,"paused",2),Fr([w({protected:!0,fallback:!1})],u.TimelineNode.prototype,"insideTimeRange",2),u.TimelineNode=Fr([W("TimelineNode")],u.TimelineNode);var af=Object.defineProperty,lf=Object.getOwnPropertyDescriptor,$r=(s,e,t,r)=>{for(var i=r>1?void 0:r?lf(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&af(e,t,i),i};u.CanvasItem=class extends u.TimelineNode{_parentGlobalVisible;_globalVisible;get globalVisible(){return this._globalVisible??!0}_parentGlobalOpacity;_globalOpacity;get globalOpacity(){return this._globalOpacity??1}_modulate=new lt(4294967295);context=new Ua;_resetContext=!0;_redrawing=!0;_relayouting=!1;_repainting=!1;_originalBatchables=[];_layoutedBatchables=[];_batchables=[];constructor(e,t=[]){super(),this.setProperties(e).append(t)}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"modulate":this._modulate.value=t,this.requestRepaint();break;case"blendMode":this.requestRepaint();break;case"opacity":this._updateGlobalOpacity();break;case"visible":case"insideTimeRange":this._updateGlobalVisible();break}}show(){this.visible=!0}hide(){this.visible=!1}isVisibleInTree(){return this.globalOpacity>0&&this.globalVisible}canRender(){return super.canRender()&&this.isVisibleInTree()}requestRedraw(){this._redrawing=!0}requestRelayout(){this._relayouting=!0}requestRepaint(){this._repainting=!0}_updateGlobalVisible(){this._parentGlobalVisible=this.getParent()?.globalVisible,this._globalVisible=(this._parentGlobalVisible??!0)&&this.visible&&this.insideTimeRange}_updateGlobalOpacity(){this._parentGlobalOpacity=this.getParent()?.opacity;const e=Ge(this.opacity,0,1)*(this._parentGlobalOpacity??1);this._globalOpacity!==e&&(this._globalOpacity=e,this.requestRepaint())}_draw(){this.emit("draw")}_redraw(){return this.log(this.name,"drawing"),this._draw(),this.context.toBatchables()}_relayout(e){return this.log(this.name,"layouting"),e}_repaint(e){return this.log(this.name,"painting"),e.map(t=>({...t,modulate:this._modulate.toArgb(this.globalOpacity,!0),blendMode:this.blendMode}))}_process(e){super._process(e);const t=this.getParent();this._parentGlobalVisible!==t?.globalVisible&&this._updateGlobalVisible(),this._parentGlobalOpacity!==t?.globalOpacity&&this._updateGlobalOpacity()}_updateBatchables(){const e=this._redrawing;let t=this._relayouting,r=this._repainting,i;e&&(this._originalBatchables=this._redraw(),t=!0),t&&(this._layoutedBatchables=this._relayout(this._originalBatchables),r=!0),r&&(i=this._repaint(this._layoutedBatchables)),e&&this._resetContext&&this.context.reset(),i&&(this._batchables=i,this._redrawing=!1,this._relayouting=!1,this._repainting=!1)}_render(e){this._updateBatchables(),this._batchables.forEach(t=>{t.texture?.upload(e),e.batch2D.render({...t,texture:t.texture?._glTexture(e)})}),super._render(e)}},$r([w()],u.CanvasItem.prototype,"modulate",2),$r([w()],u.CanvasItem.prototype,"blendMode",2),$r([w({protected:!0,fallback:!0})],u.CanvasItem.prototype,"visible",2),$r([w({protected:!0,fallback:1})],u.CanvasItem.prototype,"opacity",2),u.CanvasItem=$r([W("CanvasItem")],u.CanvasItem);var cf=Object.defineProperty,hf=Object.getOwnPropertyDescriptor,zr=(s,e,t,r)=>{for(var i=r>1?void 0:r?hf(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&cf(e,t,i),i};u.Viewport=class extends u.Node{constructor(e=!1){super(),this.flipY=e,this.projection.flipY(e)}projection=new $o;canvasTransform=new Ce;_framebufferIndex=0;_framebuffers=[{texture:new Hs,needsUpload:!1},{texture:new Hs,needsUpload:!1}];get valid(){return!!(this.width&&this.height)}get framebuffer(){return this._framebuffers[this._framebufferIndex]}get texture(){return this.framebuffer.texture}getViewport(){return this}_glFramebufferOptions(e){const{width:t,height:r}=this,{pixelRatio:i}=e;return this._framebuffers.forEach(n=>{const o=n.texture;o.width=t,o.height=r,o.pixelRatio=i,o.upload(e)}),{width:t,height:r,colorTextures:[this.texture._glTexture(e)]}}_glFramebuffer(e){return e.getRelated(this.framebuffer,()=>e.framebuffer.create(this._glFramebufferOptions(e)))}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"x":case"y":this.requestUpload(),this.projection.translate(this.x,this.y),this.emit("updateRect");break;case"width":case"height":this.requestUpload(),this.projection.resize(this.width,this.height),this.emit("updateRect");break}}requestUpload(){this._framebuffers.forEach(e=>e.needsUpload=!0)}resize(e,t){this.width=e,this.height=t}upload(e){const t=this.framebuffer;return t.needsUpload&&this.valid?(t.needsUpload=!1,e.framebuffer.update(this._glFramebuffer(e),this._glFramebufferOptions(e)),!0):!1}activate(e){return this.valid?(e.flush(),this._tree?.setCurrentViewport(this),this.upload(e),e.framebuffer.bind(this._glFramebuffer(e)),!0):!1}redraw(e,t){if(this.valid){e.flush();const r=this.framebuffer.texture;return this._framebufferIndex=(this._framebufferIndex+1)%this._framebuffers.length,this.activate(e),e.clear(),r.activate(e,0),t(),!0}return!1}activateWithCopy(e,t){this.resize(t.width,t.height),this.activate(e)&&(e.clear(),t.texture.activate(e,0),Q.draw(e,Nr.instance,{sampler:0}))}render(e,t){const r=this._tree?.getCurrentViewport();e.program.uniforms.projectionMatrix=this.projection.toArray(!0),e.program.uniforms.viewMatrix=this.canvasTransform.toArray(!0),this.activate(e),e.clear(),super.render(e,t),e.flush(),r?r.activate(e):(e.framebuffer.bind(null),this._tree?.setCurrentViewport(void 0))}getRect(){return new Rt(this.x,this.y,this.width,this.height)}toCanvasGlobal(e,t){return this.canvasTransform.applyAffineInverse(e,t)}toCanvasScreen(e,t){return this.canvasTransform.apply(e,t)}},zr([w({fallback:0})],u.Viewport.prototype,"x",2),zr([w({fallback:0})],u.Viewport.prototype,"y",2),zr([w({fallback:0})],u.Viewport.prototype,"width",2),zr([w({fallback:0})],u.Viewport.prototype,"height",2),u.Viewport=zr([W("Viewport")],u.Viewport);var uf=Object.defineProperty,ff=Object.getOwnPropertyDescriptor,Vr=(s,e,t,r)=>{for(var i=r>1?void 0:r?ff(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&uf(e,t,i),i};u.Effect=class extends u.TimelineNode{material;get _effectMode(){return this.effectMode??"parent"}viewport1=new u.Viewport;viewport2=new u.Viewport;_renderId=0;_renderViewport;_previousSibling;_nextSibling;constructor(e,t=[]){super(),this._onProcessing=this._onProcessing.bind(this),this._onNodeProcessed=this._onNodeProcessed.bind(this),this.setProperties(e).append(t)}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"glsl":{const n=new Lr(t);!this.effectMode&&n.has.transition&&(this.effectMode="transition"),this.material=n;break}case"glslSrc":{t?yt.text.load(t).then(n=>this.glsl=n):this.glsl="";break}}}_treeEnter(e){e.on("processing",this._onProcessing),e.on("nodeProcessed",this._onNodeProcessed),this.viewport1.setTree(e),this.viewport2.setTree(e)}_treeExit(e){e.off("processing",this._onProcessing),e.off("nodeProcessed",this._onNodeProcessed),this.viewport1.setTree(void 0),this.viewport2.setTree(void 0)}_onProcessing(){if(this.canProcess())switch(this._updateCurrentTime(),this._effectMode){case"transition":this._previousSibling=this.previousSibling,this._nextSibling=this.nextSibling;break;default:this._previousSibling=void 0,this._nextSibling=void 0;break}}_onNodeProcessed(e){if(!this.canProcess()||!this.isInsideTimeRange())return;const t=this._tree?.renderStack;if(t)switch(this._effectMode){case"transition":e.equal(this._previousSibling)?(this._previousSibling=void 0,t.push(this)):e.equal(this._nextSibling)&&(this._nextSibling=void 0,t.push(this));break}}_processParent(){const e=this._tree?.renderStack;if(!e)return;const t=e.currentCall?.parentCall;if(!t)return;const r=t.calls;let i,n;r.forEach((o,a)=>{(o.renderable.equal(this._parent)||o.renderable.parent?.equal(this._parent))&&(i=i??a,n=a)}),!(i===void 0||n===void 0)&&(r.splice(n+1,0,e.createCall(this)),r.splice(i,0,e.createCall(this)))}_processChildren(){this._children.length&&(super.emit("process"),this._tree?.renderStack.push(this))}_onProcess(e=0){if(this.canProcess())switch(this._renderId=0,this._effectMode){case"before":super._onProcess(e);break;case"parent":this._processParent();break;case"children":this._processChildren();break}}_renderBefore(e){const t=this._tree?.getCurrentViewport();t&&this.apply(e,t,{redraw:!0})}_renderTransition(e){if(this._renderId%2===0)this._renderViewport=this._tree?.getCurrentViewport(),this._renderViewport&&(this.viewport1.activateWithCopy(e,this._renderViewport),this.viewport2.resize(this._renderViewport.width,this._renderViewport.height)),this.viewport2.activate(e),e.clear();else{const t=this._renderViewport;this._renderViewport=void 0,t&&(t.activate(e),e.clear(),this.viewport1.texture.activate(e,0),this.viewport2.texture.activate(e,1),this.apply(e,t,{from:this.viewport1,to:this.viewport2}),e.texture.unbind(0),e.texture.unbind(1))}}_renderParentOrChildren(e){if(this._renderId%2===0)this._renderViewport=this._tree?.getCurrentViewport(),this._renderViewport&&this.viewport1.resize(this._renderViewport.width,this._renderViewport.height),this.viewport1.activate(e),e.clear();else{const t=this._renderViewport;this._renderViewport=void 0,t&&(this.viewport1.activate(e),this.apply(e,this.viewport1,{redraw:!0,target:this._effectMode==="parent"?this._parent??void 0:void 0,targetArea:this._parseTargetArea()}),t.activate(e),this.viewport1.texture.activate(e,0),Q.draw(e))}}_parseTargetArea(){if(this._effectMode==="parent"&&this._parent&&"getRect"in this._parent){const e=this._parent.getRect();if(e)return[e.left/this.viewport1.width,e.top/this.viewport1.height,e.width/this.viewport1.width,e.height/this.viewport1.height]}}_render(e){switch(this._effectMode){case"before":this._renderBefore(e);break;case"transition":this._renderTransition(e);break;case"parent":case"children":default:this._renderParentOrChildren(e);break}this._renderId++}apply(e,t,r){this.material&&(r?.redraw?t.redraw(e,()=>{Q.draw(e,this.material,{from:0,to:1,progress:this.currentTimeProgress,ratio:t.width/t.height})}):Q.draw(e,this.material,{from:0,to:1,progress:this.currentTimeProgress,ratio:r?.from?r.from.width/r.from.height:0}))}},Vr([w({protected:!0})],u.Effect.prototype,"material",2),Vr([w()],u.Effect.prototype,"effectMode",2),Vr([w({fallback:""})],u.Effect.prototype,"glsl",2),Vr([w({fallback:""})],u.Effect.prototype,"glslSrc",2),u.Effect=Vr([W("Effect")],u.Effect);class df{currentCall;calls=[];createCall(e){return{renderable:e,parentCall:this.currentCall,fn:e.render.bind(e),calls:[]}}push(e){const t=this.createCall(e);return(this.currentCall?.calls??this.calls).push(t),t}render(e){this.calls.forEach(function t(r){r.fn(e,()=>{r.calls.forEach(t)})}),this.calls=[]}}var pf=Object.defineProperty,gf=Object.getOwnPropertyDescriptor,Gr=(s,e,t,r)=>{for(var i=r>1?void 0:r?gf(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&pf(e,t,i),i};u.Timeline=class extends u.Node{static from(e,t=!1){const[r,i]=e?Array.isArray(e)?e:[0,e]:[];return new u.Timeline({startTime:r,endTime:i,loop:t})}constructor(e){super(),this.setProperties(e)}_updateProperty(e,t,r){switch(super._updateProperty(e,t,r),e){case"startTime":this.startTime=Math.min(t,this.endTime);break;case"endTime":this.endTime=t||Number.MAX_SAFE_INTEGER;break}}addTime(e){const t=this.startTime,r=this.endTime;let i=this.currentTime;return i=i+e,this.loop&&i>r&&(i=t+i%r),i=Ge(i,t,r),this.currentTime=i,this.emit("updateCurrentTime",i,e),this}_process(e){super._process(e),this.addTime(e)}},Gr([w({fallback:0})],u.Timeline.prototype,"startTime",2),Gr([w({fallback:0})],u.Timeline.prototype,"currentTime",2),Gr([w({fallback:Number.MAX_SAFE_INTEGER})],u.Timeline.prototype,"endTime",2),Gr([w({fallback:!1})],u.Timeline.prototype,"loop",2),u.Timeline=Gr([W("Timeline")],u.Timeline);var mf=Object.getOwnPropertyDescriptor,yf=(s,e,t,r)=>{for(var i=r>1?void 0:r?mf(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(i)||i);return i};u.Window=class extends u.Viewport{},u.Window=yf([W("Window")],u.Window);var vf=Object.defineProperty,Ys=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&vf(e,t,i),i};class jr extends Pi{input=new Uo;renderStack=new df;root=new u.Window(!0).setTree(this);timeline;_backgroundColor=new lt;_currentViewport;getCurrentViewport(){return this._currentViewport}setCurrentViewport(e){this._currentViewport=e}constructor(e=new u.Timeline){super(),this.timeline=e.setTree(this)}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"backgroundColor":this._backgroundColor.value=t;break}}log(...e){this.debug&&console.log(`[modern-canvas][${performance.now().toFixed(4)}ms]`,...e)}_process(e=0){this.timeline.emit("process",e),this.emit("processing"),this.root.emit("process",e),this.emit("processed")}_render(e){this.emit("rendering"),this.renderStack.render(e),this._renderScreen(e),this.emit("rendered")}_renderScreen(e){e.state.reset(),e.framebuffer.bind(null),e.viewport.bind({x:0,y:0,width:this.root.width*e.pixelRatio,height:this.root.height*e.pixelRatio}),this.backgroundColor&&e.gl.clearColor(...this._backgroundColor.toArray()),e.clear(),this.backgroundColor&&e.gl.clearColor(0,0,0,0);const t=this.root.texture;t.activate(e,0),Q.draw(e),e.texture.unbind(t)}free(){super.free(),this.root.children.internal.forEach(e=>this.root.removeChild(e)),this.input.removeEventListeners()}}Ys([w({protected:!0,fallback:!1})],jr.prototype,"processPaused"),Ys([w()],jr.prototype,"backgroundColor"),Ys([w({protected:!0,fallback:!1})],jr.prototype,"debug");var _f=Object.getOwnPropertyDescriptor,bf=(s,e,t,r)=>{for(var i=r>1?void 0:r?_f(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(i)||i);return i};u.Transition=class extends u.Effect{constructor(e,t=[]){super(),this.setProperties(e).append(t)}},u.Transition=bf([W("Transition",{effectMode:"transition",processMode:"pausable",duration:2e3})],u.Transition);var wf=Object.defineProperty,xf=Object.getOwnPropertyDescriptor,Ks=(s,e,t,r)=>{for(var i=r>1?void 0:r?xf(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&wf(e,t,i),i};u.Node2D=class extends u.CanvasItem{position=new de().on("update",()=>this.updateGlobalTransform());scale=new de(1,1).on("update",()=>this.updateGlobalTransform());skew=new de().on("update",()=>this.updateGlobalTransform());transform=new Ce;globalPosition=new de;globalScale=new de;globalSkew=new de;globalTransform=new Ce;_parentTransformDirtyId;constructor(e,t=[]){super(),this.setProperties(e).append(t)}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"rotation":this.requestRelayout();break}}getTransformOrigin(){return new de(0,0)}updateTransform(e){const t=this.getTransformOrigin(),r=this.transform.identity().translate(-t.x,-t.y).scale(this.scale.x,this.scale.y).skew(this.skew.x,this.skew.y).rotate(this.rotation);e?.(r),r.translate(this.position.x,this.position.y).translate(t.x,t.y)}updateGlobalTransform(){this.updateTransform();const e=this.getParent();if(e?.globalTransform){const{globalPosition:t,globalScale:r,globalSkew:i,globalTransform:n,globalRotation:o}=e;this._parentTransformDirtyId=n.dirtyId,this.globalPosition.set(t.x+this.position.x,t.y+this.position.y),this.globalScale.set(r.x*this.scale.x,r.y*this.scale.y),this.globalSkew.set(i.x*this.skew.x,i.y*this.skew.y),this.globalRotation=o+this.rotation,e.globalTransform.multiply(this.transform,this.globalTransform)}else this.globalPosition.copy(this.position),this.globalScale.copy(this.scale),this.globalSkew.copy(this.skew),this.globalRotation=this.rotation,this.globalTransform.copy(this.transform);this.requestRelayout()}_transformVertices(e,t){let r,i,n,o,a,l;if(t){const h=this.globalTransform.clone();h.multiply(typeof t=="function"?t?.():t),[r,i,n,o,a,l]=h.toArray()}else[r,i,n,o,a,l]=this.globalTransform.toArray();const c=e.slice();for(let h=e.length,f=0;f<h;f+=2){const d=e[f],g=e[f+1];c[f]=r*d+i*g+n,c[f+1]=o*d+a*g+l}return c}_relayout(e){return e=super._relayout(e),this.updateGlobalTransform(),e.map(t=>({...t,vertices:this._transformVertices(t.vertices,t.vertTransform)}))}_process(e){super._process(e);const t=this.getParent();t?.globalTransform&&this._parentTransformDirtyId!==t?.globalTransform?.dirtyId&&this.requestRelayout()}toLocal(e,t){return this.globalTransform.applyAffineInverse(e,t)}toGlobal(e,t){return this.globalTransform.apply(e,t)}},Ks([w({protected:!0,fallback:0})],u.Node2D.prototype,"rotation",2),Ks([w({protected:!0,fallback:0})],u.Node2D.prototype,"globalRotation",2),u.Node2D=Ks([W("Node2D")],u.Node2D);var Pf=Object.defineProperty,Sf=Object.getOwnPropertyDescriptor,Zs=(s,e,t,r)=>{for(var i=r>1?void 0:r?Sf(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&Pf(e,t,i),i};u.Camera2D=class extends u.Node2D{zoom=new de(1,1).on("update",()=>this.updateCanvasTransform());maxZoom=new de(6,6);minZoom=new de(.1,.1);_screenOffset={x:0,y:0};constructor(e,t=[]){super(),this.setProperties(e).append(t)}addZoom(e,t=e){return this.zoom.set(Ge(this.zoom.x+e,this.minZoom.x,this.maxZoom.x),Ge(this.zoom.y+t,this.minZoom.y,this.maxZoom.y)),this}setZoom(e,t=e){return this.zoom.set(Ge(e,this.minZoom.x,this.maxZoom.x),Ge(t,this.minZoom.y,this.maxZoom.y)),this}_input(e,t){if(super._input(e,t),t==="keydown"){const r=e;!this.spaceKey&&r.code==="Space"&&(r.cursor="grab",this.spaceKey=!0)}else if(t==="keyup"){const r=e;r.code==="Space"&&(r.cursor="default",this.spaceKey=!1,this.grabbing=!1)}else if(t==="pointerdown"){const r=e;!this.grabbing&&(this.spaceKey||r.button===1)&&(this.grabbing=!0,r.cursor="grabbing",this._screenOffset={x:r.screenX,y:r.screenY})}else if(t==="pointermove"){const r=e;this.grabbing&&(this.position.add(-(this._screenOffset.x-r.screenX),-(this._screenOffset.y-r.screenY)),this._screenOffset={x:r.screenX,y:r.screenY})}else if(t==="pointerup"){const r=e;this.grabbing&&(this.grabbing=!1,this.spaceKey?r.cursor="grab":r.cursor="default")}else t==="wheel"&&this._onWheel(e)}_onWheel(e){if(e.ctrlKey){if(!(e.wheelDeltaY?Math.abs(Math.abs(e.wheelDeltaY)-Math.abs(3*e.deltaY))<3:e.deltaMode===0)){e.preventDefault();const r=this.zoom.x;this.addZoom(e.deltaY*-.015);const i=1-this.zoom.x/r;this.position.add((e.screenX-this.position.x)*i,(e.screenY-this.position.y)*i)}}else e.preventDefault(),this.position.add(-e.deltaX,-e.deltaY)}updateTransform(){super.updateTransform(),this.updateCanvasTransform()}updateCanvasTransform(){const e=this.getViewport();e&&(e.canvasTransform.identity().scale(this.zoom.x,this.zoom.y).translate(this.position.x,this.position.y),this.emit("updateCanvasTransform"))}toGlobal(e,t){const r=this.getViewport();if(!r)throw new Error("Failed to toGlobal, viewport is empty");return r.toCanvasGlobal(e,t)}toScreen(e,t){const r=this.getViewport();if(!r)throw new Error("Failed to toScreen, viewport is empty");return r.toCanvasScreen(e,t)}},Zs([w({protected:!0,fallback:!1})],u.Camera2D.prototype,"spaceKey",2),Zs([w({protected:!0,fallback:!1})],u.Camera2D.prototype,"grabbing",2),u.Camera2D=Zs([W("Camera2D",{processMode:"disabled",renderMode:"disabled"})],u.Camera2D);const Na={brightness:1,contrast:1,grayscale:0,"hue-rotate":0,invert:0,opacity:1,saturate:1,sepia:0};function Cf(s){const e=new Os;if(s==="none")return e;const t=Ar(s).reduce((r,{name:i,args:n})=>(r[i]=n[0].normalizedIntValue,r),{});Object.keys(Na).forEach(r=>{t[r]=t[r]??Na[r]});for(const r in t){const i=t[r];switch(r){case"hue-rotate":e.hueRotate(i*Ne);break;case"saturate":e.saturate(i);break;case"brightness":e.brightness(i);break;case"contrast":e.contrast(i);break;case"invert":e.invert(i);break;case"sepia":e.sepia(i);break;case"opacity":e.opacity(i);break;case"grayscale":e.grayscale(i);break}}return e}function Fa(s,e,t,r=new Ce){return s=!s||s==="none"?"":s,Ar(s,{width:e,height:t}).reverse().forEach(({name:i,args:n})=>{const o=n.map(a=>a.normalizedIntValue);switch(i){case"translate":r.translate(o[0]*e,(o[1]??o[0])*t);break;case"translateX":r.translateX(o[0]*e);break;case"translateY":r.translateY(o[0]*t);break;case"translateZ":r.translateZ(o[0]);break;case"translate3d":r.translate3d(o[0]*e,(o[1]??o[0])*t,o[2]??o[1]??o[0]);break;case"scale":r.scale(o[0],o[1]??o[0]);break;case"scaleX":r.scaleX(o[0]);break;case"scaleY":r.scaleY(o[0]);break;case"scale3d":r.scale3d(o[0],o[1]??o[0],o[2]??o[1]??o[0]);break;case"rotate":r.rotate(o[0]*Ne);break;case"rotateX":r.rotateX(o[0]*Ne);break;case"rotateY":r.rotateY(o[0]*Ne);break;case"rotateZ":r.rotateZ(o[0]*Ne);break;case"rotate3d":r.rotate3d(o[0]*Ne,(o[1]??o[0])*Ne,(o[2]??o[1]??o[0])*Ne,(o[3]??o[2]??o[1]??o[0])*Ne);break;case"skew":r.skew(o[0],o[0]??o[1]);break;case"skewX":r.skewX(o[0]);break;case"skewY":r.skewY(o[0]);break;case"matrix":r.set(o);break}}),r}function $a(s){const[e,t=e]=s.split(" ");return[e,t].map(r=>{switch(r=r.trim(),r){case"left":case"top":return 0;case"center":return .5;case"right":case"bottom":return 1;default:return Number(r)}})}var za=Object.defineProperty,Tf=Object.getOwnPropertyDescriptor,Ef=(s,e,t)=>e in s?za(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Mt=(s,e,t,r)=>{for(var i=r>1?void 0:r?Tf(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&za(e,t,i),i},Mf=(s,e,t)=>Ef(s,e+"",t);u.ColorAdjustEffect=class extends u.Effect{constructor(e,t=[]){super(),this.setProperties(e).append(t)}apply(e,t){t.redraw(e,()=>{Q.draw(e,u.ColorAdjustEffect.material,{sampler:0,saturation:this.saturation,contrast:this.contrast,brightness:this.brightness,red:this.red,green:this.green,blue:this.blue,alpha:this.alpha,gamma:Math.max(this.gamma??1,1e-4)})})}},Mf(u.ColorAdjustEffect,"material",new se({vert:`precision mediump float;
|
|
119
119
|
attribute vec2 position;
|
|
120
120
|
attribute vec2 uv;
|
|
121
121
|
varying vec2 vUv;
|
|
@@ -146,7 +146,7 @@ void main(void) {
|
|
|
146
146
|
c.rgb *= c.a;
|
|
147
147
|
}
|
|
148
148
|
gl_FragColor = c * alpha;
|
|
149
|
-
}`})),
|
|
149
|
+
}`})),Mt([w({fallback:1})],u.ColorAdjustEffect.prototype,"saturation",2),Mt([w({fallback:1})],u.ColorAdjustEffect.prototype,"contrast",2),Mt([w({fallback:1})],u.ColorAdjustEffect.prototype,"brightness",2),Mt([w({fallback:1})],u.ColorAdjustEffect.prototype,"red",2),Mt([w({fallback:1})],u.ColorAdjustEffect.prototype,"green",2),Mt([w({fallback:1})],u.ColorAdjustEffect.prototype,"blue",2),Mt([w({fallback:1})],u.ColorAdjustEffect.prototype,"alpha",2),Mt([w({fallback:1})],u.ColorAdjustEffect.prototype,"gamma",2),u.ColorAdjustEffect=Mt([W("ColorAdjustEffect")],u.ColorAdjustEffect);var Va=Object.defineProperty,Af=Object.getOwnPropertyDescriptor,Of=(s,e,t)=>e in s?Va(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Ga=(s,e,t,r)=>{for(var i=r>1?void 0:r?Af(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&Va(e,t,i),i},kf=(s,e,t)=>Of(s,e+"",t);u.ColorFilterEffect=class extends u.Effect{_colorMatrix=new Os;constructor(e,t=[]){super(),this.setProperties(e).append(t)}apply(e,t){if(!this.filter)return;const r=Ar(this.filter),i=this._colorMatrix.identity();r.forEach(({name:n,args:o})=>{const a=o.map(l=>l.normalizedIntValue);switch(n){case"hue-rotate":case"hueRotate":i.hueRotate(a[0]*Ne);break;case"saturate":i.saturate(a[0]);break;case"brightness":i.brightness(a[0]);break;case"contrast":i.contrast(a[0]);break;case"invert":i.invert(a[0]);break;case"sepia":i.sepia(a[0]);break;case"opacity":i.opacity(a[0]);break;case"grayscale":i.grayscale(a[0]);break}}),t.redraw(e,()=>{Q.draw(e,u.ColorFilterEffect.material,{sampler:0,m:i.toArray()})})}},kf(u.ColorFilterEffect,"material",new se({vert:`precision mediump float;
|
|
150
150
|
attribute vec2 position;
|
|
151
151
|
attribute vec2 uv;
|
|
152
152
|
varying vec2 vUv;
|
|
@@ -169,7 +169,7 @@ void main(void) {
|
|
|
169
169
|
m[10] * c.r + m[11] * c.g + m[12] * c.b + m[13] * c.a + m[14] / 255.0,
|
|
170
170
|
m[15] * c.r + m[16] * c.g + m[17] * c.b + m[18] * c.a + m[19] / 255.0
|
|
171
171
|
);
|
|
172
|
-
}`})),
|
|
172
|
+
}`})),Ga([w()],u.ColorFilterEffect.prototype,"filter",2),u.ColorFilterEffect=Ga([W("ColorFilterEffect")],u.ColorFilterEffect);var ja=Object.defineProperty,Df=Object.getOwnPropertyDescriptor,If=(s,e,t)=>e in s?ja(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Js=(s,e,t,r)=>{for(var i=r>1?void 0:r?Df(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&ja(e,t,i),i},Rf=(s,e,t)=>If(s,e+"",t);const Wr=50;u.ColorOverlayEffect=class extends u.Effect{_color=new lt;constructor(e,t=[]){super(),this.setProperties(e).append(t)}apply(e,t){t.redraw(e,()=>{const r=this.colors.map(i=>{this._color.value=i;const n=this._color.toArray();return n[3]=this.alpha,n});for(;r.length<Wr;)r.push([0,0,0,0]);Q.draw(e,u.ColorOverlayEffect.material,{sampler:0,colors:r.slice(0,Wr).flatMap(i=>i)})})}},Rf(u.ColorOverlayEffect,"material",new se({vert:`precision mediump float;
|
|
173
173
|
attribute vec2 position;
|
|
174
174
|
attribute vec2 uv;
|
|
175
175
|
varying vec2 vUv;
|
|
@@ -178,7 +178,7 @@ void main() {
|
|
|
178
178
|
vUv = uv;
|
|
179
179
|
}`,frag:`precision mediump float;
|
|
180
180
|
uniform sampler2D sampler;
|
|
181
|
-
uniform vec4 colors[${
|
|
181
|
+
uniform vec4 colors[${Wr}];
|
|
182
182
|
varying vec2 vUv;
|
|
183
183
|
|
|
184
184
|
float calcWidth() {
|
|
@@ -187,7 +187,7 @@ float calcWidth() {
|
|
|
187
187
|
|
|
188
188
|
int calcCount() {
|
|
189
189
|
int count = 0;
|
|
190
|
-
for (int i = 0; i < ${
|
|
190
|
+
for (int i = 0; i < ${Wr}; i++) {
|
|
191
191
|
if (colors[i] != vec4(0,0,0,0)){
|
|
192
192
|
count++;
|
|
193
193
|
}
|
|
@@ -199,7 +199,7 @@ vec4 calcColor(float x) {
|
|
|
199
199
|
float perUnit = calcWidth() / float(calcCount());
|
|
200
200
|
int index = int(x / perUnit);
|
|
201
201
|
|
|
202
|
-
for(int i=0; i<${
|
|
202
|
+
for(int i=0; i<${Wr}; i++){
|
|
203
203
|
if(i==index){
|
|
204
204
|
return colors[i];
|
|
205
205
|
}
|
|
@@ -212,7 +212,7 @@ void main(void) {
|
|
|
212
212
|
vec4 color = texture2D(sampler, vUv);
|
|
213
213
|
vec4 mask = calcColor(vUv.x);
|
|
214
214
|
gl_FragColor = vec4(mix(color.rgb, mask.rgb, color.a * mask.a), color.a);
|
|
215
|
-
}`})),
|
|
215
|
+
}`})),Js([w({default:()=>[]})],u.ColorOverlayEffect.prototype,"colors",2),Js([w({fallback:.5})],u.ColorOverlayEffect.prototype,"alpha",2),u.ColorOverlayEffect=Js([W("ColorOverlayEffect")],u.ColorOverlayEffect);var Wa=Object.defineProperty,Uf=Object.getOwnPropertyDescriptor,Bf=(s,e,t)=>e in s?Wa(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Qs=(s,e,t,r)=>{for(var i=r>1?void 0:r?Uf(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&Wa(e,t,i),i},Lf=(s,e,t)=>Bf(s,e+"",t);u.ColorRemoveEffect=class extends u.Effect{_color=new lt;constructor(e,t=[]){super(),this.setProperties(e).append(t)}apply(e,t){const i=new Float32Array(150),n=this.colors.map(o=>(this._color.value=o,this._color.toArray().slice(0,3)));for(;n.length<50;)n.push([-1,0,0]);n.slice(0,50).forEach((o,a)=>{i[a*3]=o[0],i[a*3+1]=o[1],i[a*3+2]=o[2]}),t.redraw(e,()=>{Q.draw(e,u.ColorRemoveEffect.material,{sampler:0,epsilon:this.epsilon,originalColors:i})})}},Lf(u.ColorRemoveEffect,"material",new se({vert:`precision mediump float;
|
|
216
216
|
attribute vec2 position;
|
|
217
217
|
attribute vec2 uv;
|
|
218
218
|
varying vec2 vUv;
|
|
@@ -241,7 +241,7 @@ void main(void) {
|
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
gl_FragColor = color;
|
|
244
|
-
}`})),
|
|
244
|
+
}`})),Qs([w({default:()=>[]})],u.ColorRemoveEffect.prototype,"colors",2),Qs([w({fallback:.5})],u.ColorRemoveEffect.prototype,"epsilon",2),u.ColorRemoveEffect=Qs([W("ColorRemoveEffect")],u.ColorRemoveEffect);var qa=Object.defineProperty,Nf=Object.getOwnPropertyDescriptor,Ff=(s,e,t)=>e in s?qa(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,en=(s,e,t,r)=>{for(var i=r>1?void 0:r?Nf(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&qa(e,t,i),i},$f=(s,e,t)=>Ff(s,e+"",t);const qr=50;u.ColorReplaceEffect=class extends u.Effect{_color=new lt;constructor(e,t=[]){super(),this.setProperties(e).append(t)}apply(e,t){const r=this.colors.map(a=>{this._color.value=a[0];const l=this._color.toArray().slice(0,3);this._color.value=a[1];const c=this._color.toArray().slice(0,3);return[l,c]}),i=this.epsilon,n=new Float32Array(qr*3),o=new Float32Array(qr*3);for(;r.length<qr;)r.push([[-1,0,0],[0,0,0,1]]);r.slice(0,qr).forEach(([a,l],c)=>{n[c*3]=a[0],n[c*3+1]=a[1],n[c*3+2]=a[2],o[c*3]=l[0],o[c*3+1]=l[1],o[c*3+2]=l[2]}),t.redraw(e,()=>{Q.draw(e,u.ColorReplaceEffect.material,{sampler:0,epsilon:i,originalColors:n,targetColors:o})})}},$f(u.ColorReplaceEffect,"material",new se({vert:`precision mediump float;
|
|
245
245
|
attribute vec2 position;
|
|
246
246
|
attribute vec2 uv;
|
|
247
247
|
varying vec2 vUv;
|
|
@@ -251,7 +251,7 @@ void main() {
|
|
|
251
251
|
}`,frag:`varying vec2 vUv;
|
|
252
252
|
uniform sampler2D sampler;
|
|
253
253
|
uniform float epsilon;
|
|
254
|
-
const int MAX_COLORS = ${
|
|
254
|
+
const int MAX_COLORS = ${qr};
|
|
255
255
|
uniform vec3 originalColors[MAX_COLORS];
|
|
256
256
|
uniform vec3 targetColors[MAX_COLORS];
|
|
257
257
|
|
|
@@ -277,7 +277,7 @@ void main(void) {
|
|
|
277
277
|
return;
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
|
-
}`}))
|
|
280
|
+
}`})),en([w({default:()=>[]})],u.ColorReplaceEffect.prototype,"colors",2),en([w({fallback:.05})],u.ColorReplaceEffect.prototype,"epsilon",2),u.ColorReplaceEffect=en([W("ColorReplaceEffect")],u.ColorReplaceEffect);var Xa=Object.defineProperty,zf=Object.getOwnPropertyDescriptor,Vf=(s,e,t)=>e in s?Xa(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,tn=(s,e,t,r)=>{for(var i=r>1?void 0:r?zf(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&Xa(e,t,i),i},Ha=(s,e,t)=>Vf(s,typeof e!="symbol"?e+"":e,t);const Ya=`varying vec2 vUv[9];
|
|
281
281
|
uniform sampler2D sampler;
|
|
282
282
|
|
|
283
283
|
void main(void) {
|
|
@@ -311,7 +311,7 @@ void main(void) {
|
|
|
311
311
|
gl_FragColor += texture2D(sampler, vUv[7]) * 0.067234;
|
|
312
312
|
gl_FragColor += texture2D(sampler, vUv[8]) * 0.028532;
|
|
313
313
|
}
|
|
314
|
-
}`;
|
|
314
|
+
}`;u.GaussianBlurEffect=class extends u.Effect{constructor(e,t=[]){super(),this.setProperties(e).append(t)}apply(e,t){const r=1/t.width,i=1/t.height,n=Math.max(this.quality,1);for(let o=0;o<n;o++)t.redraw(e,()=>{Q.draw(e,u.GaussianBlurEffect.materialX,{sampler:0,uStrength:r*(this.strength/n)})});for(let o=0;o<n;o++)t.redraw(e,()=>{Q.draw(e,u.GaussianBlurEffect.materialY,{sampler:0,uStrength:i*(this.strength/n)})})}},Ha(u.GaussianBlurEffect,"materialX",new se({vert:`attribute vec2 position;
|
|
315
315
|
attribute vec2 uv;
|
|
316
316
|
uniform float uStrength;
|
|
317
317
|
varying vec2 vUv[9];
|
|
@@ -327,7 +327,7 @@ void main(void) {
|
|
|
327
327
|
vUv[6] = uv + vec2(2.0 * uStrength, 0.0);
|
|
328
328
|
vUv[7] = uv + vec2(3.0 * uStrength, 0.0);
|
|
329
329
|
vUv[8] = uv + vec2(4.0 * uStrength, 0.0);
|
|
330
|
-
}`,frag:
|
|
330
|
+
}`,frag:Ya})),Ha(u.GaussianBlurEffect,"materialY",new se({vert:`attribute vec2 position;
|
|
331
331
|
attribute vec2 uv;
|
|
332
332
|
uniform float uStrength;
|
|
333
333
|
varying vec2 vUv[9];
|
|
@@ -343,7 +343,7 @@ void main(void) {
|
|
|
343
343
|
vUv[6] = uv + vec2(0.0, 2.0 * uStrength);
|
|
344
344
|
vUv[7] = uv + vec2(0.0, 3.0 * uStrength);
|
|
345
345
|
vUv[8] = uv + vec2(0.0, 4.0 * uStrength);
|
|
346
|
-
}`,frag:
|
|
346
|
+
}`,frag:Ya})),tn([w({fallback:4})],u.GaussianBlurEffect.prototype,"strength",2),tn([w({fallback:3})],u.GaussianBlurEffect.prototype,"quality",2),u.GaussianBlurEffect=tn([W("GaussianBlurEffect")],u.GaussianBlurEffect);var Ka=Object.defineProperty,Gf=Object.getOwnPropertyDescriptor,jf=(s,e,t)=>e in s?Ka(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,pr=(s,e,t,r)=>{for(var i=r>1?void 0:r?Gf(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&Ka(e,t,i),i},Wf=(s,e,t)=>jf(s,e+"",t);u.DropShadowEffect=class extends u.Effect{blurEffect=new u.GaussianBlurEffect;viewport3=new u.Viewport;_color=new lt;constructor(e,t=[]){super(),this.setProperties(e).append(t)}apply(e,t){this.viewport3.activateWithCopy(e,t),this.viewport3.redraw(e,()=>{this._color.value=this.color,Q.draw(e,u.DropShadowEffect.material,{sampler:0,uAlpha:this._color.a,uColor:this._color.toArray().slice(0,3),uOffset:[-this.offsetX,this.offsetY],uInputSize:[t.width,t.height,1/t.width,1/t.height]})}),this.blurEffect.strength=this.blur,this.blurEffect.apply(e,this.viewport3),t.redraw(e,()=>{this.viewport3.texture.activate(e,1),Q.draw(e,Nr.instance,{sampler:1}),this.shadowOnly||Q.draw(e,Nr.instance,{sampler:0}),e.texture.unbind(1)})}},Wf(u.DropShadowEffect,"material",new se({vert:`precision mediump float;
|
|
347
347
|
attribute vec2 position;
|
|
348
348
|
attribute vec2 uv;
|
|
349
349
|
varying vec2 vUv;
|
|
@@ -363,7 +363,7 @@ void main(void) {
|
|
|
363
363
|
sample.rgb = uColor.rgb * sample.a;
|
|
364
364
|
sample *= uAlpha;
|
|
365
365
|
gl_FragColor = sample;
|
|
366
|
-
}`})),
|
|
366
|
+
}`})),pr([w({fallback:"#000000FF"})],u.DropShadowEffect.prototype,"color",2),pr([w({fallback:4})],u.DropShadowEffect.prototype,"blur",2),pr([w({fallback:4})],u.DropShadowEffect.prototype,"offsetX",2),pr([w({fallback:4})],u.DropShadowEffect.prototype,"offsetY",2),pr([w({fallback:!1})],u.DropShadowEffect.prototype,"shadowOnly",2),u.DropShadowEffect=pr([W("DropShadowEffect")],u.DropShadowEffect);var Za=Object.defineProperty,qf=Object.getOwnPropertyDescriptor,Xf=(s,e,t)=>e in s?Za(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Ja=(s,e,t,r)=>{for(var i=r>1?void 0:r?qf(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&Za(e,t,i),i},Hf=(s,e,t)=>Xf(s,e+"",t);u.EmbossEffect=class extends u.Effect{constructor(e,t=[]){super(),this.setProperties(e).append(t)}apply(e,t){t.redraw(e,()=>{Q.draw(e,u.EmbossEffect.material,{sampler:0,strength:this.strength,inputSize:[t.width,t.height,1/t.width,1/t.height]})})}},Hf(u.EmbossEffect,"material",new se({vert:`precision mediump float;
|
|
367
367
|
attribute vec2 position;
|
|
368
368
|
attribute vec2 uv;
|
|
369
369
|
varying vec2 vUv;
|
|
@@ -385,7 +385,7 @@ void main(void) {
|
|
|
385
385
|
color.rgb = vec3((color.r + color.g + color.b) / 3.0);
|
|
386
386
|
float alpha = texture2D(sampler, vUv).a;
|
|
387
387
|
gl_FragColor = vec4(color.rgb * alpha, alpha);
|
|
388
|
-
}`})),
|
|
388
|
+
}`})),Ja([w({fallback:5})],u.EmbossEffect.prototype,"strength",2),u.EmbossEffect=Ja([W("EmbossEffect")],u.EmbossEffect);var Qa=Object.defineProperty,Yf=Object.getOwnPropertyDescriptor,Kf=(s,e,t)=>e in s?Qa(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,ft=(s,e,t,r)=>{for(var i=r>1?void 0:r?Yf(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&Qa(e,t,i),i},Zf=(s,e,t)=>Kf(s,e+"",t);u.GlitchEffect=class extends u.Effect{_canvas;_texture;_sizes;_offsets;_needsRedraw=!1;constructor(e,t=[]){super(),this.setProperties(e).append(t),this._canvas=document.createElement("canvas"),this._canvas.width=4,this._canvas.height=this.sampleSize,this._texture=new ne(this._canvas),this._sizes=new Float32Array(this.slices),this._offsets=new Float32Array(this.slices)}redraw(){const e=this.sampleSize,t=this._texture,r=this._canvas.getContext("2d");r.clearRect(0,0,8,e);let i,n=0;for(let o=0;o<this.slices;o++){i=Math.floor(this._offsets[o]*256);const a=this._sizes[o]*e,l=i>0?i:0,c=i<0?-i:0;r.fillStyle=`rgba(${l}, ${c}, 0, 1)`,r.fillRect(0,n>>0,e,a+1>>0),n+=a}t.requestUpload()}apply(e,t){this._needsRedraw||(this._needsRedraw=!0,this.redraw());const r=t.width,i=t.height,n=this.direction*(Math.PI/180),o=Math.sin(n),a=Math.cos(n);t.redraw(e,()=>{this._texture.activate(e,1),Q.draw(e,u.GlitchEffect.material,{sampler:0,filterClamp:[0,0,1,1],filterArea:[r,i,0,0],dimensions:[r,i],aspect:i/r,displacementMap:1,offset:this.offset,sinDir:o,cosDir:a,fillMode:this.fillMode,seed:this.seed,red:this.red,green:this.green,blue:this.blue})})}},Zf(u.GlitchEffect,"material",new se({vert:`precision mediump float;
|
|
389
389
|
attribute vec2 position;
|
|
390
390
|
attribute vec2 uv;
|
|
391
391
|
varying vec2 vUv;
|
|
@@ -486,7 +486,7 @@ void main(void) {
|
|
|
486
486
|
gl_FragColor.g = texture2D(sampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;
|
|
487
487
|
gl_FragColor.b = texture2D(sampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;
|
|
488
488
|
gl_FragColor.a = texture2D(sampler, coord).a;
|
|
489
|
-
}`})),
|
|
489
|
+
}`})),ft([w({fallback:10})],u.GlitchEffect.prototype,"slices",2),ft([w({fallback:512})],u.GlitchEffect.prototype,"sampleSize",2),ft([w({fallback:100})],u.GlitchEffect.prototype,"offset",2),ft([w({fallback:0})],u.GlitchEffect.prototype,"direction",2),ft([w({fallback:2})],u.GlitchEffect.prototype,"fillMode",2),ft([w({fallback:0})],u.GlitchEffect.prototype,"seed",2),ft([w({default:()=>[2,2]})],u.GlitchEffect.prototype,"red",2),ft([w({default:()=>[-10,4]})],u.GlitchEffect.prototype,"green",2),ft([w({default:()=>[10,-4]})],u.GlitchEffect.prototype,"blue",2),u.GlitchEffect=ft([W("GlitchEffect")],u.GlitchEffect);var el=Object.defineProperty,Jf=Object.getOwnPropertyDescriptor,Qf=(s,e,t)=>e in s?el(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Bt=(s,e,t,r)=>{for(var i=r>1?void 0:r?Jf(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&el(e,t,i),i},ed=(s,e,t)=>Qf(s,e+"",t);const td=`vec3 mod289(vec3 x)
|
|
490
490
|
{
|
|
491
491
|
return x - floor(x * (1.0 / 289.0)) * 289.0;
|
|
492
492
|
}
|
|
@@ -580,7 +580,7 @@ float turb(vec3 P, vec3 rep, float lacunarity, float gain)
|
|
|
580
580
|
totalgain *= gain;
|
|
581
581
|
}
|
|
582
582
|
return abs(sum);
|
|
583
|
-
}`;
|
|
583
|
+
}`;u.GodrayEffect=class extends u.Effect{constructor(e,t=[]){super(),this.setProperties(e).append(t)}apply(e,t){const r=this.angle*(Math.PI/180),i=this.parallel?[Math.cos(r),Math.sin(r)]:this.center;t.redraw(e,()=>{Q.draw(e,u.GodrayEffect.material,{sampler:0,uDimensions:[t.width,t.height],uParallel:this.parallel?1:0,uLight:i,uAspect:t.height/t.width,uTime:this.time,uRay:[this.gain,this.lacunarity,this.alpha],uInputSize:[t.width,t.height,0,0]})})}},ed(u.GodrayEffect,"material",new se({vert:`precision mediump float;
|
|
584
584
|
attribute vec2 position;
|
|
585
585
|
attribute vec2 uv;
|
|
586
586
|
varying vec2 vUv;
|
|
@@ -598,7 +598,7 @@ uniform float uTime;
|
|
|
598
598
|
uniform vec3 uRay;
|
|
599
599
|
uniform vec4 uInputSize;
|
|
600
600
|
|
|
601
|
-
${
|
|
601
|
+
${td}
|
|
602
602
|
|
|
603
603
|
void main(void) {
|
|
604
604
|
bool uParallel = uParallel > 0.5;
|
|
@@ -629,7 +629,7 @@ void main(void) {
|
|
|
629
629
|
|
|
630
630
|
vec4 color = texture2D(sampler, vUv);
|
|
631
631
|
gl_FragColor = vec4(color.rgb + mist.rgb, color.a);
|
|
632
|
-
}`})),
|
|
632
|
+
}`})),Bt([w({fallback:0})],u.GodrayEffect.prototype,"time",2),Bt([w({fallback:30})],u.GodrayEffect.prototype,"angle",2),Bt([w({fallback:.5})],u.GodrayEffect.prototype,"gain",2),Bt([w({fallback:2.5})],u.GodrayEffect.prototype,"lacunarity",2),Bt([w({fallback:!0})],u.GodrayEffect.prototype,"parallel",2),Bt([w({default:()=>[0,0]})],u.GodrayEffect.prototype,"center",2),Bt([w({fallback:1})],u.GodrayEffect.prototype,"alpha",2),u.GodrayEffect=Bt([W("GodrayEffect")],u.GodrayEffect);var rd=Object.defineProperty,id=Object.getOwnPropertyDescriptor,Ui=(s,e,t,r)=>{for(var i=r>1?void 0:r?id(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&rd(e,t,i),i};const tl=`varying vec2 vUv;
|
|
633
633
|
uniform sampler2D sampler;
|
|
634
634
|
uniform vec2 uOffset;
|
|
635
635
|
|
|
@@ -641,7 +641,7 @@ void main(void) {
|
|
|
641
641
|
color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y - uOffset.y));
|
|
642
642
|
color *= 0.25;
|
|
643
643
|
gl_FragColor = color;
|
|
644
|
-
}`,
|
|
644
|
+
}`,rl=`precision highp float;
|
|
645
645
|
varying vec2 vUv;
|
|
646
646
|
uniform sampler2D sampler;
|
|
647
647
|
uniform vec2 uOffset;
|
|
@@ -654,14 +654,14 @@ void main(void) {
|
|
|
654
654
|
color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));
|
|
655
655
|
color *= 0.25;
|
|
656
656
|
gl_FragColor = color;
|
|
657
|
-
}`;
|
|
657
|
+
}`;u.KawaseBlurEffect=class extends u.Effect{_kernels=[0];constructor(e,t=[]){super(),this.material=new se({vert:`precision mediump float;
|
|
658
658
|
attribute vec2 position;
|
|
659
659
|
attribute vec2 uv;
|
|
660
660
|
varying vec2 vUv;
|
|
661
661
|
void main() {
|
|
662
662
|
gl_Position = vec4(position, 0.0, 1.0);
|
|
663
663
|
vUv = uv;
|
|
664
|
-
}`,frag:
|
|
664
|
+
}`,frag:e?.clamp?rl:tl}),this.setProperties(e).append(t),this._generateKernels()}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"quality":case"strength":this._generateKernels();break}}_generateKernels(){const e=Math.max(1,Math.round(this.strength)),t=Math.max(1,Math.round(this.quality)),r=[e];if(e>0){let i=e;const n=e/t;for(let o=1;o<t;o++)i-=n,r.push(i)}this._kernels=r}apply(e,t){const r=this.pixelSize[0]/t.width,i=this.pixelSize[1]/t.height;this._kernels.forEach(n=>{const o=n+.5;t.redraw(e,()=>{Q.draw(e,this.material,{sampler:0,uOffset:[o*r,o*i],uInputClamp:[0,0,1,1]})})})}},Ui([w({fallback:4})],u.KawaseBlurEffect.prototype,"strength",2),Ui([w({fallback:3})],u.KawaseBlurEffect.prototype,"quality",2),Ui([w({default:()=>[1,1]})],u.KawaseBlurEffect.prototype,"pixelSize",2),u.KawaseBlurEffect=Ui([W("KawaseBlurEffect")],u.KawaseBlurEffect);var il=Object.defineProperty,sd=Object.getOwnPropertyDescriptor,nd=(s,e,t)=>e in s?il(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,rn=(s,e,t,r)=>{for(var i=r>1?void 0:r?sd(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&il(e,t,i),i},od=(s,e,t)=>nd(s,e+"",t);u.MaskEffect=class extends u.Effect{constructor(e,t=[]){super(),this.setProperties(e).append(t)}async load(){this.texture=void 0,this.src&&(this.texture=await yt.texture.load(this.src))}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"src":this.load();break;case"texture":r?.free?.();break}}apply(e,t,r){this.texture&&r.targetArea&&t.redraw(e,()=>{this.texture.activate(e,1),Q.draw(e,u.MaskEffect.material,{sampler:0,mask:1,area:r.targetArea,rotation:r.target?.globalRotation??0}),e.texture.unbind(1)})}},od(u.MaskEffect,"material",new se({vert:`precision mediump float;
|
|
665
665
|
attribute vec2 position;
|
|
666
666
|
attribute vec2 uv;
|
|
667
667
|
varying vec2 vUv;
|
|
@@ -704,7 +704,7 @@ void main(void) {
|
|
|
704
704
|
} else {
|
|
705
705
|
gl_FragColor = vec4(0.);
|
|
706
706
|
}
|
|
707
|
-
}`})),
|
|
707
|
+
}`})),rn([w({protected:!0})],u.MaskEffect.prototype,"texture",2),rn([w({fallback:""})],u.MaskEffect.prototype,"src",2),u.MaskEffect=rn([W("MaskEffect")],u.MaskEffect);var sl=Object.defineProperty,ad=Object.getOwnPropertyDescriptor,ld=(s,e,t)=>e in s?sl(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Lt=(s,e,t,r)=>{for(var i=r>1?void 0:r?ad(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&sl(e,t,i),i},nl=(s,e,t)=>ld(s,typeof e!="symbol"?e+"":e,t);const cd=`precision highp float;
|
|
708
708
|
varying vec2 vUv;
|
|
709
709
|
uniform sampler2D sampler;
|
|
710
710
|
uniform vec2 uThickness;
|
|
@@ -738,14 +738,14 @@ void main(void) {
|
|
|
738
738
|
float outlineAlpha = uAlpha * outlineMaxAlphaAtPos(vUv.xy) * (1.-sourceColor.a);
|
|
739
739
|
vec4 outlineColor = vec4(vec3(uColor) * outlineAlpha, outlineAlpha);
|
|
740
740
|
gl_FragColor = contentColor + outlineColor;
|
|
741
|
-
}`;
|
|
741
|
+
}`;u.OutlineEffect=class extends u.Effect{static getAngleStep(e){return Number.parseFloat((Math.PI*2/Math.max(e*u.OutlineEffect.MAX_SAMPLES,u.OutlineEffect.MIN_SAMPLES)).toFixed(7))}_color=new lt;constructor(e,t=[]){super(),this.setProperties(e).append(t),this.material=new se({vert:`precision mediump float;
|
|
742
742
|
attribute vec2 position;
|
|
743
743
|
attribute vec2 uv;
|
|
744
744
|
varying vec2 vUv;
|
|
745
745
|
void main() {
|
|
746
746
|
gl_Position = vec4(position, 0.0, 1.0);
|
|
747
747
|
vUv = uv;
|
|
748
|
-
}`,frag:
|
|
748
|
+
}`,frag:cd.replace(/\{ANGLE_STEP\}/,u.OutlineEffect.getAngleStep(this.quality).toFixed(7))})}apply(e,t){t.redraw(e,()=>{this._color.value=this.color,Q.draw(e,this.material,{sampler:0,uThickness:[this.width/t.width,this.width/t.height],uColor:this._color.toArray().slice(0,3),uAlpha:this.opacity!==1?this.opacity:this._color.a,uAngleStep:u.OutlineEffect.getAngleStep(this.quality),uKnockout:this.knockout?1:0,uInputClamp:[0,0,1,1]})})}},nl(u.OutlineEffect,"MIN_SAMPLES",1),nl(u.OutlineEffect,"MAX_SAMPLES",100),Lt([w({fallback:"#000000ff"})],u.OutlineEffect.prototype,"color",2),Lt([w({fallback:1})],u.OutlineEffect.prototype,"width",2),Lt([w({fallback:"solid"})],u.OutlineEffect.prototype,"style",2),Lt([w()],u.OutlineEffect.prototype,"image",2),Lt([w({fallback:1})],u.OutlineEffect.prototype,"opacity",2),Lt([w({fallback:.1})],u.OutlineEffect.prototype,"quality",2),Lt([w({fallback:!1})],u.OutlineEffect.prototype,"knockout",2),u.OutlineEffect=Lt([W("OutlineEffect")],u.OutlineEffect);var ol=Object.defineProperty,hd=Object.getOwnPropertyDescriptor,ud=(s,e,t)=>e in s?ol(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,al=(s,e,t,r)=>{for(var i=r>1?void 0:r?hd(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&ol(e,t,i),i},fd=(s,e,t)=>ud(s,e+"",t);u.PixelateEffect=class extends u.Effect{constructor(e,t=[]){super(),this.setProperties(e).append(t)}apply(e,t){t.redraw(e,()=>{Q.draw(e,u.PixelateEffect.material,{sampler:0,uSize:[this.strength,this.strength],uInputSize:[t.width,t.height,1/t.width,1/t.height]})})}},fd(u.PixelateEffect,"material",new se({vert:`precision mediump float;
|
|
749
749
|
attribute vec2 position;
|
|
750
750
|
attribute vec2 uv;
|
|
751
751
|
varying vec2 vUv;
|
|
@@ -778,7 +778,7 @@ void main(void) {
|
|
|
778
778
|
coord = pixelate(coord, uSize);
|
|
779
779
|
coord = unmapCoord(coord);
|
|
780
780
|
gl_FragColor = texture2D(sampler, coord);
|
|
781
|
-
}`})),
|
|
781
|
+
}`})),al([w({fallback:10})],u.PixelateEffect.prototype,"strength",2),u.PixelateEffect=al([W("PixelateEffect")],u.PixelateEffect);var ll=Object.defineProperty,dd=Object.getOwnPropertyDescriptor,pd=(s,e,t)=>e in s?ll(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Xr=(s,e,t,r)=>{for(var i=r>1?void 0:r?dd(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&ll(e,t,i),i},gd=(s,e,t)=>pd(s,e+"",t);u.ZoomBlurEffect=class extends u.Effect{constructor(e,t=[]){super(),this.setProperties(e).append(t)}apply(e,t,r){let i=this.center;r.targetArea&&(i=[(r.targetArea[0]+r.targetArea[2]/2)*t.width,(r.targetArea[1]+r.targetArea[3]/2)*t.height]),t.redraw(e,()=>{Q.draw(e,u.ZoomBlurEffect.material,{sampler:0,uCenter:i??[t.width/2,t.height/2],uInnerRadius:this.innerRadius,uRadius:this.radius,uStrength:this.strength,uInputSize:[t.width,t.height,1/t.width,1/t.height]})})}},gd(u.ZoomBlurEffect,"material",new se({vert:`attribute vec2 position;
|
|
782
782
|
attribute vec2 uv;
|
|
783
783
|
varying vec2 vUv;
|
|
784
784
|
void main() {
|
|
@@ -858,12 +858,12 @@ void main() {
|
|
|
858
858
|
color /= total;
|
|
859
859
|
|
|
860
860
|
gl_FragColor = color;
|
|
861
|
-
}`})),_i([v()],g.ZoomBlurEffect.prototype,"center",2),_i([v({fallback:20})],g.ZoomBlurEffect.prototype,"innerRadius",2),_i([v({fallback:-1})],g.ZoomBlurEffect.prototype,"radius",2),_i([v({fallback:.1})],g.ZoomBlurEffect.prototype,"strength",2),g.ZoomBlurEffect=_i([st("ZoomBlurEffect")],g.ZoomBlurEffect);var Jf=Object.defineProperty,Be=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&Jf(t,e,i),i};class Vt extends sA{constructor(t){super(),this.parent=t}_texture;_setProperties(t){return super.setProperties(t)}setProperties(t){return this._setProperties(lt(t)?void 0:be(t))}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"color":case"cropRect":case"stretchRect":case"dpi":case"rotateWithShape":case"tile":case"opacity":case"enabled":this.parent.requestRedraw();break;case"image":case"linearGradient":case"radialGradient":this._updateTexture();break}}async loadTexture(){return this.linearGradient||this.radialGradient?new pr(this.linearGradient??this.radialGradient,this.parent.size.width,this.parent.size.height):lt(this.image)?void 0:(this.parent.tree?.log(`load image ${this.image}`),await Fe.texture.load(this.image))}async _updateTexture(){this._texture=await this.loadTexture(),this.parent.requestRedraw()}canDraw(){return!!(this.enabled&&(this._texture||this.color))}_getDrawOptions(){let t=!1;const{width:e,height:A}=this.parent.size,i=new Yt().scale(1/e,1/A);if(this.cropRect){const{left:s=0,top:n=0,right:o=0,bottom:a=0}=this.cropRect;i.scale(Math.abs(1-(s+o)),Math.abs(1-(n+a))).translate(s,n),t=!0}if(this.tile){const{translateX:s=0,translateY:n=0,scaleX:o=1,scaleY:a=1}=this.tile;i.translate(-s/e,-n/A).scale(1/o,1/a),t=!0}else if(this.stretchRect){const{left:s=0,top:n=0,right:o=0,bottom:a=0}=this.stretchRect;i.scale(Math.abs(1-(-s+-o)),Math.abs(1-(-n+-a))).translate(-s,-n),t=!0}return{disableWrapMode:t,uvTransform:i}}draw(){const t=this.parent.context,{uvTransform:e,disableWrapMode:A}=this._getDrawOptions();t.uvTransform=e,t.fillStyle=this._texture??this.color,t.fill({disableWrapMode:A})}}Be([v({fallback:!0})],Vt.prototype,"enabled"),Be([v()],Vt.prototype,"color"),Be([v()],Vt.prototype,"image"),Be([v()],Vt.prototype,"linearGradient"),Be([v()],Vt.prototype,"radialGradient"),Be([v()],Vt.prototype,"cropRect"),Be([v()],Vt.prototype,"stretchRect"),Be([v()],Vt.prototype,"dpi"),Be([v()],Vt.prototype,"rotateWithShape"),Be([v()],Vt.prototype,"tile"),Be([v()],Vt.prototype,"opacity");var Kf=Object.defineProperty,Yf=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&Kf(t,e,i),i};class An extends Vt{setProperties(t){return super._setProperties(lt(t)?void 0:uh(t))}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"fillWithShape":this.parent.requestRedraw();break}}}Yf([v()],An.prototype,"fillWithShape");var Vf=Object.defineProperty,Wf=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&Vf(t,e,i),i};class rn extends Vt{setProperties(t){return super._setProperties(lt(t)?void 0:dh(t))}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"fillWithShape":this.parent.requestRedraw();break}}}Wf([v()],rn.prototype,"fillWithShape");var zf=Object.defineProperty,bi=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&zf(t,e,i),i};class vA extends Vt{setProperties(t){return super._setProperties(lt(t)?void 0:Ar(t))}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"width":case"style":case"lineCap":case"lineJoin":case"enabled":this.parent.requestRedraw();break}}canDraw(){return!!(this.enabled&&(this.width||this.color||super.canDraw()))}draw(){const t=this.parent.context,{uvTransform:e,disableWrapMode:A}=this._getDrawOptions();t.lineWidth=this.width||1,t.uvTransform=e,t.strokeStyle=this._texture??this.color,t.lineCap=this.lineCap,t.lineJoin=this.lineJoin,t.stroke({disableWrapMode:A})}}bi([v({fallback:"#00000000"})],vA.prototype,"color"),bi([v({fallback:0})],vA.prototype,"width"),bi([v({fallback:"solid"})],vA.prototype,"style"),bi([v({fallback:"butt"})],vA.prototype,"lineCap"),bi([v({fallback:"miter"})],vA.prototype,"lineJoin");var qf=Object.defineProperty,Di=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&qf(t,e,i),i};class _A extends sA{constructor(t){super(),this.parent=t}setProperties(t){return super.setProperties(lt(t)?void 0:Ih(t))}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"color":case"blur":case"offsetX":case"offsetY":this.updateEffect();break}}updateEffect(){const t="__$shadow";let e=this.parent.getNode(t);this.blur||this.offsetX||this.offsetY?(e||(e=new g.DropShadowEffect({name:t}),this.parent.appendChild(e,"back")),e.setProperties(this.getProperties())):e&&this.parent.removeChild(e)}}Di([v({fallback:!0})],_A.prototype,"enabled"),Di([v({fallback:"#000000FF"})],_A.prototype,"color"),Di([v({fallback:0})],_A.prototype,"blur"),Di([v({fallback:0})],_A.prototype,"offsetY"),Di([v({fallback:0})],_A.prototype,"offsetX");var Xf=Object.defineProperty,xi=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&Xf(t,e,i),i};class bA extends sA{constructor(t){super(),this.parent=t,this._updatePath2DSet()}_path2DSet=new We;setProperties(t){return super.setProperties(lt(t)?void 0:Eh(t))}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"svg":case"paths":case"viewBox":case"enabled":this._updatePath2DSet(),this.parent.requestRedraw();break}}_updatePath2DSet(){let t;if(this.svg){const n=Fs(this.svg);this._path2DSet=Ls(n),t=this._path2DSet.viewBox}else this.paths?.forEach((n,o)=>{const{data:a,...l}=n,c=new kt;c.style=l,c.addData(a),this._path2DSet.paths[o]=c});if(!t){const n=this._path2DSet.getBoundingBox();t=n?[n.x,n.y,n.width,n.height]:[0,0,1,1]}const[e,A,i,s]=t;this._path2DSet.paths.forEach(n=>{n.applyTransform(new Lt().translate(-e,-A).scale(1/i,1/s))})}draw(){if(this.enabled&&this._path2DSet.paths.length){const t=this.parent.context,{width:e,height:A}=this.parent.size;this._path2DSet.paths.forEach(i=>{t.addPath(i.clone().applyTransform(new Lt().scale(e,A)))})}else this.drawRect()}drawRect(){const t=this.parent.context,{width:e,height:A}=this.parent.size,{borderRadius:i}=this.parent.style;e&&A&&(i?t.roundRect(0,0,e,A,i):t.rect(0,0,e,A))}}xi([v({fallback:!0})],bA.prototype,"enabled"),xi([v()],bA.prototype,"preset"),xi([v()],bA.prototype,"svg"),xi([v()],bA.prototype,"viewBox"),xi([v()],bA.prototype,"paths");class Si extends Ye{constructor(t){super(),this.setProperties(t)}}const ml=Do();for(const r in ml){const t=ml[r];er(Si,r,{fallback:t})}var Wt=Uint8Array,he=Uint16Array,sn=Int32Array,Br=new Wt([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]),Cr=new Wt([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]),nn=new Wt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),wl=function(r,t){for(var e=new he(31),A=0;A<31;++A)e[A]=t+=1<<r[A-1];for(var i=new sn(e[30]),A=1;A<30;++A)for(var s=e[A];s<e[A+1];++s)i[s]=s-e[A]<<5|A;return{b:e,r:i}},vl=wl(Br,2),_l=vl.b,on=vl.r;_l[28]=258,on[258]=28;for(var bl=wl(Cr,0),jf=bl.b,Dl=bl.r,an=new he(32768),pt=0;pt<32768;++pt){var cA=(pt&43690)>>1|(pt&21845)<<1;cA=(cA&52428)>>2|(cA&13107)<<2,cA=(cA&61680)>>4|(cA&3855)<<4,an[pt]=((cA&65280)>>8|(cA&255)<<8)>>1}for(var ke=(function(r,t,e){for(var A=r.length,i=0,s=new he(t);i<A;++i)r[i]&&++s[r[i]-1];var n=new he(t);for(i=1;i<t;++i)n[i]=n[i-1]+s[i-1]<<1;var o;if(e){o=new he(1<<t);var a=15-t;for(i=0;i<A;++i)if(r[i])for(var l=i<<4|r[i],c=t-r[i],h=n[r[i]-1]++<<c,u=h|(1<<c)-1;h<=u;++h)o[an[h]>>a]=l}else for(o=new he(A),i=0;i<A;++i)r[i]&&(o[i]=an[n[r[i]-1]++]>>15-r[i]);return o}),hA=new Wt(288),pt=0;pt<144;++pt)hA[pt]=8;for(var pt=144;pt<256;++pt)hA[pt]=9;for(var pt=256;pt<280;++pt)hA[pt]=7;for(var pt=280;pt<288;++pt)hA[pt]=8;for(var Mi=new Wt(32),pt=0;pt<32;++pt)Mi[pt]=5;var Zf=ke(hA,9,0),$f=ke(hA,9,1),td=ke(Mi,5,0),ed=ke(Mi,5,1),ln=function(r){for(var t=r[0],e=1;e<r.length;++e)r[e]>t&&(t=r[e]);return t},Ce=function(r,t,e){var A=t/8|0;return(r[A]|r[A+1]<<8)>>(t&7)&e},cn=function(r,t){var e=t/8|0;return(r[e]|r[e+1]<<8|r[e+2]<<16)>>(t&7)},hn=function(r){return(r+7)/8|0},xl=function(r,t,e){return(e==null||e>r.length)&&(e=r.length),new Wt(r.subarray(t,e))},Ad=["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"],Qe=function(r,t,e){var A=new Error(t||Ad[r]);if(A.code=r,Error.captureStackTrace&&Error.captureStackTrace(A,Qe),!e)throw A;return A},id=function(r,t,e,A){var i=r.length,s=0;if(!i||t.f&&!t.l)return e||new Wt(0);var n=!e,o=n||t.i!=2,a=t.i;n&&(e=new Wt(i*3));var l=function(Ft){var ht=e.length;if(Ft>ht){var Qt=new Wt(Math.max(ht*2,Ft));Qt.set(e),e=Qt}},c=t.f||0,h=t.p||0,u=t.b||0,d=t.l,f=t.d,B=t.m,p=t.n,D=i*8;do{if(!d){c=Ce(r,h,1);var R=Ce(r,h+1,3);if(h+=3,R)if(R==1)d=$f,f=ed,B=9,p=5;else if(R==2){var m=Ce(r,h,31)+257,x=Ce(r,h+10,15)+4,M=m+Ce(r,h+5,31)+1;h+=14;for(var V=new Wt(M),et=new Wt(19),W=0;W<x;++W)et[nn[W]]=Ce(r,h+W*3,7);h+=x*3;for(var H=ln(et),Z=(1<<H)-1,J=ke(et,H,1),W=0;W<M;){var T=J[Ce(r,h,Z)];h+=T&15;var w=T>>4;if(w<16)V[W++]=w;else{var it=0,L=0;for(w==16?(L=3+Ce(r,h,3),h+=2,it=V[W-1]):w==17?(L=3+Ce(r,h,7),h+=3):w==18&&(L=11+Ce(r,h,127),h+=7);L--;)V[W++]=it}}var z=V.subarray(0,m),tt=V.subarray(m);B=ln(z),p=ln(tt),d=ke(z,B,1),f=ke(tt,p,1)}else Qe(1);else{var w=hn(h)+4,S=r[w-4]|r[w-3]<<8,Q=w+S;if(Q>i){a&&Qe(0);break}o&&l(u+S),e.set(r.subarray(w,Q),u),t.b=u+=S,t.p=h=Q*8,t.f=c;continue}if(h>D){a&&Qe(0);break}}o&&l(u+131072);for(var K=(1<<B)-1,At=(1<<p)-1,U=h;;U=h){var it=d[cn(r,h)&K],P=it>>4;if(h+=it&15,h>D){a&&Qe(0);break}if(it||Qe(2),P<256)e[u++]=P;else if(P==256){U=h,d=null;break}else{var q=P-254;if(P>264){var W=P-257,$=Br[W];q=Ce(r,h,(1<<$)-1)+_l[W],h+=$}var nt=f[cn(r,h)&At],X=nt>>4;nt||Qe(3),h+=nt&15;var tt=jf[X];if(X>3){var $=Cr[X];tt+=cn(r,h)&(1<<$)-1,h+=$}if(h>D){a&&Qe(0);break}o&&l(u+131072);var dt=u+q;if(u<tt){var ie=s-tt,re=Math.min(tt,dt);for(ie+u<0&&Qe(3);u<re;++u)e[u]=A[ie+u]}for(;u<dt;++u)e[u]=e[u-tt]}}t.l=d,t.p=U,t.b=u,t.f=c,d&&(c=1,t.m=B,t.d=f,t.n=p)}while(!c);return u!=e.length&&n?xl(e,0,u):e.subarray(0,u)},je=function(r,t,e){e<<=t&7;var A=t/8|0;r[A]|=e,r[A+1]|=e>>8},Ri=function(r,t,e){e<<=t&7;var A=t/8|0;r[A]|=e,r[A+1]|=e>>8,r[A+2]|=e>>16},gn=function(r,t){for(var e=[],A=0;A<r.length;++A)r[A]&&e.push({s:A,f:r[A]});var i=e.length,s=e.slice();if(!i)return{t:kl,l:0};if(i==1){var n=new Wt(e[0].s+1);return n[e[0].s]=1,{t:n,l:1}}e.sort(function(Q,m){return Q.f-m.f}),e.push({s:-1,f:25001});var o=e[0],a=e[1],l=0,c=1,h=2;for(e[0]={s:-1,f:o.f+a.f,l:o,r:a};c!=i-1;)o=e[e[l].f<e[h].f?l++:h++],a=e[l!=c&&e[l].f<e[h].f?l++:h++],e[c++]={s:-1,f:o.f+a.f,l:o,r:a};for(var u=s[0].s,A=1;A<i;++A)s[A].s>u&&(u=s[A].s);var d=new he(u+1),f=un(e[c-1],d,0);if(f>t){var A=0,B=0,p=f-t,D=1<<p;for(s.sort(function(m,x){return d[x.s]-d[m.s]||m.f-x.f});A<i;++A){var R=s[A].s;if(d[R]>t)B+=D-(1<<f-d[R]),d[R]=t;else break}for(B>>=p;B>0;){var w=s[A].s;d[w]<t?B-=1<<t-d[w]++-1:++A}for(;A>=0&&B;--A){var S=s[A].s;d[S]==t&&(--d[S],++B)}f=t}return{t:new Wt(d),l:f}},un=function(r,t,e){return r.s==-1?Math.max(un(r.l,t,e+1),un(r.r,t,e+1)):t[r.s]=e},Sl=function(r){for(var t=r.length;t&&!r[--t];);for(var e=new he(++t),A=0,i=r[0],s=1,n=function(a){e[A++]=a},o=1;o<=t;++o)if(r[o]==i&&o!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)n(32754);s>2&&(n(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(n(i),--s;s>6;s-=6)n(8304);s>2&&(n(s-3<<5|8208),s=0)}for(;s--;)n(i);s=1,i=r[o]}return{c:e.subarray(0,A),n:t}},ki=function(r,t){for(var e=0,A=0;A<t.length;++A)e+=r[A]*t[A];return e},Ml=function(r,t,e){var A=e.length,i=hn(t+2);r[i]=A&255,r[i+1]=A>>8,r[i+2]=r[i]^255,r[i+3]=r[i+1]^255;for(var s=0;s<A;++s)r[i+s+4]=e[s];return(i+4+A)*8},Rl=function(r,t,e,A,i,s,n,o,a,l,c){je(t,c++,e),++i[256];for(var h=gn(i,15),u=h.t,d=h.l,f=gn(s,15),B=f.t,p=f.l,D=Sl(u),R=D.c,w=D.n,S=Sl(B),Q=S.c,m=S.n,x=new he(19),M=0;M<R.length;++M)++x[R[M]&31];for(var M=0;M<Q.length;++M)++x[Q[M]&31];for(var V=gn(x,7),et=V.t,W=V.l,H=19;H>4&&!et[nn[H-1]];--H);var Z=l+5<<3,J=ki(i,hA)+ki(s,Mi)+n,T=ki(i,u)+ki(s,B)+n+14+3*H+ki(x,et)+2*x[16]+3*x[17]+7*x[18];if(a>=0&&Z<=J&&Z<=T)return Ml(t,c,r.subarray(a,a+l));var it,L,z,tt;if(je(t,c,1+(T<J)),c+=2,T<J){it=ke(u,d,0),L=u,z=ke(B,p,0),tt=B;var K=ke(et,W,0);je(t,c,w-257),je(t,c+5,m-1),je(t,c+10,H-4),c+=14;for(var M=0;M<H;++M)je(t,c+3*M,et[nn[M]]);c+=3*H;for(var At=[R,Q],U=0;U<2;++U)for(var P=At[U],M=0;M<P.length;++M){var q=P[M]&31;je(t,c,K[q]),c+=et[q],q>15&&(je(t,c,P[M]>>5&127),c+=P[M]>>12)}}else it=Zf,L=hA,z=td,tt=Mi;for(var M=0;M<o;++M){var $=A[M];if($>255){var q=$>>18&31;Ri(t,c,it[q+257]),c+=L[q+257],q>7&&(je(t,c,$>>23&31),c+=Br[q]);var nt=$&31;Ri(t,c,z[nt]),c+=tt[nt],nt>3&&(Ri(t,c,$>>5&8191),c+=Cr[nt])}else Ri(t,c,it[$]),c+=L[$]}return Ri(t,c,it[256]),c+L[256]},rd=new sn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),kl=new Wt(0),sd=function(r,t,e,A,i,s){var n=s.z||r.length,o=new Wt(A+n+5*(1+Math.ceil(n/7e3))+i),a=o.subarray(A,o.length-i),l=s.l,c=(s.r||0)&7;if(t){c&&(a[0]=s.r>>3);for(var h=rd[t-1],u=h>>13,d=h&8191,f=(1<<e)-1,B=s.p||new he(32768),p=s.h||new he(f+1),D=Math.ceil(e/3),R=2*D,w=function(Tt){return(r[Tt]^r[Tt+1]<<D^r[Tt+2]<<R)&f},S=new sn(25e3),Q=new he(288),m=new he(32),x=0,M=0,V=s.i||0,et=0,W=s.w||0,H=0;V+2<n;++V){var Z=w(V),J=V&32767,T=p[Z];if(B[J]=T,p[Z]=J,W<=V){var it=n-V;if((x>7e3||et>24576)&&(it>423||!l)){c=Rl(r,a,0,S,Q,m,M,et,H,V-H,c),et=x=M=0,H=V;for(var L=0;L<286;++L)Q[L]=0;for(var L=0;L<30;++L)m[L]=0}var z=2,tt=0,K=d,At=J-T&32767;if(it>2&&Z==w(V-At))for(var U=Math.min(u,it)-1,P=Math.min(32767,V),q=Math.min(258,it);At<=P&&--K&&J!=T;){if(r[V+z]==r[V+z-At]){for(var $=0;$<q&&r[V+$]==r[V+$-At];++$);if($>z){if(z=$,tt=At,$>U)break;for(var nt=Math.min(At,$-2),X=0,L=0;L<nt;++L){var dt=V-At+L&32767,ie=B[dt],re=dt-ie&32767;re>X&&(X=re,T=dt)}}}J=T,T=B[J],At+=J-T&32767}if(tt){S[et++]=268435456|on[z]<<18|Dl[tt];var Ft=on[z]&31,ht=Dl[tt]&31;M+=Br[Ft]+Cr[ht],++Q[257+Ft],++m[ht],W=V+z,++x}else S[et++]=r[V],++Q[r[V]]}}for(V=Math.max(V,W);V<n;++V)S[et++]=r[V],++Q[r[V]];c=Rl(r,a,l,S,Q,m,M,et,H,V-H,c),l||(s.r=c&7|a[c/8|0]<<3,c-=7,s.h=p,s.p=B,s.i=V,s.w=W)}else{for(var V=s.w||0;V<n+l;V+=65535){var Qt=V+65535;Qt>=n&&(a[c/8|0]=l,Qt=n),c=Ml(a,c+1,r.subarray(V,Qt))}s.i=n}return xl(o,0,A+hn(c)+i)},Pl=function(){var r=1,t=0;return{p:function(e){for(var A=r,i=t,s=e.length|0,n=0;n!=s;){for(var o=Math.min(n+2655,s);n<o;++n)i+=A+=e[n];A=(A&65535)+15*(A>>16),i=(i&65535)+15*(i>>16)}r=A,t=i},d:function(){return r%=65521,t%=65521,(r&255)<<24|(r&65280)<<8|(t&255)<<8|t>>8}}},nd=function(r,t,e,A,i){if(!i&&(i={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),n=new Wt(s.length+r.length);n.set(s),n.set(r,s.length),r=n,i.w=s.length}return sd(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,A,i)},Ul=function(r,t,e){for(;e;++t)r[t]=e,e>>>=8},od=function(r,t){var e=t.level,A=e==0?0:e<6?1:e==9?3:2;if(r[0]=120,r[1]=A<<6|(t.dictionary&&32),r[1]|=31-(r[0]<<8|r[1])%31,t.dictionary){var i=Pl();i.p(t.dictionary),Ul(r,2,i.d())}},ad=function(r,t){return((r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31)&&Qe(6,"invalid zlib data"),(r[1]>>5&1)==1&&Qe(6,"invalid zlib data: "+(r[1]&32?"need":"unexpected")+" dictionary"),(r[1]>>3&4)+2};function ld(r,t){t||(t={});var e=Pl();e.p(r);var A=nd(r,t,t.dictionary?6:2,4);return od(A,t),Ul(A,A.length-4,e.d()),A}function cd(r,t){return id(r.subarray(ad(r),-4),{i:2},t,t)}var hd=typeof TextDecoder<"u"&&new TextDecoder,gd=0;try{hd.decode(kl,{stream:!0}),gd=1}catch{}const ud="modern-font";function Pi(r,t){if(!r)throw new Error(`[${ud}] ${t}`)}function fd(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 WA(r){return"buffer"in r?new DataView(r.buffer,r.byteOffset,r.byteLength):new DataView(r)}function dd(r){let t="";for(let e=0,A=r.length,i;e<A;e++)i=r.charCodeAt(e),i!==0&&(t+=String.fromCharCode(i));return t}function Qr(r){r=dd(r);const t=[];for(let e=0,A=r.length,i;e<A;e++)i=r.charCodeAt(e),t.push(i>>8),t.push(i&255);return t}function Id(r){let t="";for(let e=0,A=r.length;e<A;e++)r[e]<127?t+=String.fromCharCode(r[e]):t+=`%${(256+r[e]).toString(16).slice(1)}`;return unescape(t)}function pd(r){let t="";for(let e=0,A=r.length;e<A;e+=2)t+=String.fromCharCode((r[e]<<8)+r[e+1]);return t}var Ed=Object.defineProperty,zt=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&Ed(t,e,i),i};const Ui={int8:1,int16:2,int32:4,uint8:1,uint16:2,uint32:4,float32:4,float64:8,fixed:4,longDateTime:8,char:1};function qt(){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 Pt extends DataView{constructor(t,e,A,i){super(fd(t),e,A),this.littleEndian=i}cursor=0;readColumn(t){if(t.size){const e=Array.from({length:t.size},(A,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},(A,i)=>{this.write(t.type,e[i],t.offset+i)}):this.write(t.type,e,t.offset)}read(t,e=this.cursor,A=this.littleEndian){switch(t){case"char":return this.readChar(e);case"fixed":return this.readFixed(e,A);case"longDateTime":return this.readLongDateTime(e,A)}const i=`get${t.replace(/^\S/,a=>a.toUpperCase())}`,s=this,o=s[i]?.bind(s)?.(e,A);return this.cursor+=Ui[t],o}readUint24(t=this.cursor){const[e,A,i]=this.readBytes(t,3);return(e<<16)+(A<<8)+i}readBytes(t,e){e==null&&(e=t,t=this.cursor);const A=[];for(let i=0;i<e;++i)A.push(this.getUint8(t+i));return this.cursor=t+e,A}readString(t,e){const A=this.readBytes(t,e);let i="";for(let s=0,n=A.length;s<n;s++)i+=String.fromCharCode(A[s]);return i}readFixed(t,e){const A=this.readInt32(t,e)/65536;return Math.ceil(A*1e5)/1e5}readLongDateTime(t=this.cursor,e){const A=this.readUint32(t+4,e),i=new Date;return i.setTime(A*1e3+-20775456e5),i}readChar(t){return this.readString(t,1)}write(t,e,A=this.cursor,i=this.littleEndian){switch(t){case"char":return this.writeChar(e,A);case"fixed":return this.writeFixed(e,A);case"longDateTime":return this.writeLongDateTime(e,A)}const s=`set${t.replace(/^\S/,l=>l.toUpperCase())}`,n=this,a=n[s]?.bind(n)?.(A,e,i);return this.cursor+=Ui[t.toLowerCase()],a}writeString(t="",e=this.cursor){const A=t.replace(/[^\x00-\xFF]/g,"11").length;this.seek(e);for(let i=0,s=t.length,n;i<s;++i)n=t.charCodeAt(i)||0,n>127?this.writeUint16(n):this.writeUint8(n);return this.cursor+=A,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 A;if(Array.isArray(t)){A=t.length;for(let i=0;i<A;++i)this.setUint8(e+i,t[i])}else{const i=WA(t);A=i.byteLength;for(let s=0;s<A;++s)this.setUint8(e+s,i.getUint8(s))}return this.cursor=e+A,this}seek(t){return this.cursor=t,this}}zt([qt()],Pt.prototype,"readInt8"),zt([qt()],Pt.prototype,"readInt16"),zt([qt()],Pt.prototype,"readInt32"),zt([qt()],Pt.prototype,"readUint8"),zt([qt()],Pt.prototype,"readUint16"),zt([qt()],Pt.prototype,"readUint32"),zt([qt()],Pt.prototype,"readFloat32"),zt([qt()],Pt.prototype,"readFloat64"),zt([qt()],Pt.prototype,"writeInt8"),zt([qt()],Pt.prototype,"writeInt16"),zt([qt()],Pt.prototype,"writeInt32"),zt([qt()],Pt.prototype,"writeUint8"),zt([qt()],Pt.prototype,"writeUint16"),zt([qt()],Pt.prototype,"writeUint32"),zt([qt()],Pt.prototype,"writeFloat32"),zt([qt()],Pt.prototype,"writeFloat64");const Nl=new WeakMap;function y(r){const t=typeof r=="object"?r:{type:r},{size:e=1,type:A}=t;return(i,s)=>{if(typeof s!="string")return;let n=Nl.get(i);n||(n={columns:[],byteLength:0},Nl.set(i,n));const o={...t,name:s,byteLength:e*Ui[A],offset:t.offset??n.columns.reduce((a,l)=>a+l.byteLength,0)};n.columns.push(o),n.byteLength=n.columns.reduce((a,l)=>a+Ui[l.type]*(l.size??1),0),Object.defineProperty(i.constructor.prototype,s,{get(){return this.view.readColumn(o)},set(a){this.view.writeColumn(o,a)},configurable:!0,enumerable:!0})}}class ge{view;constructor(t,e,A,i){this.view=new Pt(t,e,A,i)}}class yr extends ge{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 Bd=Object.defineProperty,$t=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&Bd(t,e,i),i};const te=class Pc extends yr{format="EmbeddedOpenType";mimeType="application/vnd.ms-fontobject";static from(t){const e=t.sfnt,i=e.name.names,s=Qr(i.fontFamily||""),n=s.length,o=Qr(i.fontStyle||""),a=o.length,l=Qr(i.version||""),c=l.length,h=Qr(i.fullName||""),u=h.length,d=86+n+4+a+4+c+4+u+2+t.view.byteLength,f=new Pc(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 B=e.os2;return B&&(f.FontPANOSE=B.fontPANOSE,f.Italic=B.fsSelection,f.Weight=B.usWeightClass,f.fsType=B.fsType,f.UnicodeRange=B.ulUnicodeRange,f.CodePageRange=B.ulCodePageRange),f.view.writeUint16(n),f.view.writeBytes(s),f.view.writeUint16(0),f.view.writeUint16(a),f.view.writeBytes(o),f.view.writeUint16(0),f.view.writeUint16(c),f.view.writeBytes(l),f.view.writeUint16(0),f.view.writeUint16(u),f.view.writeBytes(h),f.view.writeUint16(0),f.view.writeUint16(0),f.view.writeBytes(t.view),f}};$t([y("uint32")],te.prototype,"EOTSize"),$t([y("uint32")],te.prototype,"FontDataSize"),$t([y("uint32")],te.prototype,"Version"),$t([y("uint32")],te.prototype,"Flags"),$t([y({type:"uint8",size:10})],te.prototype,"FontPANOSE"),$t([y("uint8")],te.prototype,"Charset"),$t([y("uint8")],te.prototype,"Italic"),$t([y("uint32")],te.prototype,"Weight"),$t([y("uint16")],te.prototype,"fsType"),$t([y("uint16")],te.prototype,"MagicNumber"),$t([y({type:"uint8",size:16})],te.prototype,"UnicodeRange"),$t([y({type:"uint8",size:8})],te.prototype,"CodePageRange"),$t([y("uint32")],te.prototype,"CheckSumAdjustment"),$t([y({type:"uint8",size:16})],te.prototype,"Reserved"),$t([y("uint16")],te.prototype,"Padding1");var Cd=Object.defineProperty,mr=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&Cd(t,e,i),i};class zA extends ge{constructor(t,e){super(t,e,16)}}mr([y({type:"char",size:4})],zA.prototype,"tag"),mr([y("uint32")],zA.prototype,"checkSum"),mr([y("uint32")],zA.prototype,"offset"),mr([y("uint32")],zA.prototype,"length");const fn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],Qd=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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 dn{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,A=72,i={},s){const n=1/(s?.unitsPerEm??1e3)*A,{xScale:o=n,yScale:a=n}=i,l=this.pathCommands,c=[];for(let h=0,u=l.length;h<u;h+=1){const d=l[h];d.type==="M"?c.push({type:"M",x:t+d.x*o,y:e+-d.y*a}):d.type==="L"?c.push({type:"L",x:t+d.x*o,y:e+-d.y*a}):d.type==="Q"?c.push({type:"Q",x1:t+d.x1*o,y1:e+-d.y1*a,x:t+d.x*o,y:e+-d.y*a}):d.type==="C"?c.push({type:"C",x1:t+d.x1*o,y1:e+-d.y1*a,x2:t+d.x2*o,y2:e+-d.y2*a,x:t+d.x*o,y:e+-d.y*a}):d.type==="Z"&&c.push({type:"Z"})}return c}}class yd extends dn{parse(t,e,A){const i=this,{nominalWidthX:s,defaultWidthX:n,gsubrsBias:o,subrsBias:a}=t,l=t.topDict.paintType,c=this.index;let h,u,d,f;const B=[],p=[];let D=0,R=!1,w=!1,S=n,Q=0,m=0;function x(J,T){B.push({type:"L",x:J,y:T})}function M(J,T,it,L,z,tt){B.push({type:"C",x1:J,y1:T,x2:it,y2:L,x:z,y:tt})}function V(J,T){w&&l!==2&&et(),w=!0,B.push({type:"M",x:J,y:T})}function et(){B.push({type:"Z"})}function W(J){B.push(...J)}function H(){p.length%2!==0&&!R&&(S=p.shift()+s),D+=p.length>>1,p.length=0,R=!0}function Z(J){let T,it,L,z,tt,K,At,U,P,q,$,nt,X=0;for(;X<J.length;){let dt=J[X++];switch(dt){case 1:H();break;case 3:H();break;case 4:p.length>1&&!R&&(S=p.shift()+s,R=!0),m+=p.pop(),V(Q,m);break;case 5:for(;p.length>0;)Q+=p.shift(),m+=p.shift(),x(Q,m);break;case 6:for(;p.length>0&&(Q+=p.shift(),x(Q,m),p.length!==0);)m+=p.shift(),x(Q,m);break;case 7:for(;p.length>0&&(m+=p.shift(),x(Q,m),p.length!==0);)Q+=p.shift(),x(Q,m);break;case 8:for(;p.length>0;)h=Q+p.shift(),u=m+p.shift(),d=h+p.shift(),f=u+p.shift(),Q=d+p.shift(),m=f+p.shift(),M(h,u,d,f,Q,m);break;case 10:tt=p.pop()+a,K=t.subrs[tt],K&&Z(K);break;case 11:return;case 12:switch(dt=J[X],X+=1,dt){case 35:h=Q+p.shift(),u=m+p.shift(),d=h+p.shift(),f=u+p.shift(),At=d+p.shift(),U=f+p.shift(),P=At+p.shift(),q=U+p.shift(),$=P+p.shift(),nt=q+p.shift(),Q=$+p.shift(),m=nt+p.shift(),p.shift(),M(h,u,d,f,At,U),M(P,q,$,nt,Q,m);break;case 34:h=Q+p.shift(),u=m,d=h+p.shift(),f=u+p.shift(),At=d+p.shift(),U=f,P=At+p.shift(),q=f,$=P+p.shift(),nt=m,Q=$+p.shift(),M(h,u,d,f,At,U),M(P,q,$,nt,Q,m);break;case 36:h=Q+p.shift(),u=m+p.shift(),d=h+p.shift(),f=u+p.shift(),At=d+p.shift(),U=f,P=At+p.shift(),q=f,$=P+p.shift(),nt=q+p.shift(),Q=$+p.shift(),M(h,u,d,f,At,U),M(P,q,$,nt,Q,m);break;case 37:h=Q+p.shift(),u=m+p.shift(),d=h+p.shift(),f=u+p.shift(),At=d+p.shift(),U=f+p.shift(),P=At+p.shift(),q=U+p.shift(),$=P+p.shift(),nt=q+p.shift(),Math.abs($-Q)>Math.abs(nt-m)?Q=$+p.shift():m=nt+p.shift(),M(h,u,d,f,At,U),M(P,q,$,nt,Q,m);break;default:console.warn(`Glyph ${c}: unknown operator ${1200+dt}`),p.length=0}break;case 14:if(p.length>=4){const ie=fn[p.pop()],re=fn[p.pop()],Ft=p.pop(),ht=p.pop();if(ie&&re){i.isComposite=!0,i.components=[];const Qt=t.charset.indexOf(ie),Tt=t.charset.indexOf(re);i.components.push({glyphIndex:Tt,dx:0,dy:0}),i.components.push({glyphIndex:Qt,dx:ht,dy:Ft}),W(A.get(Tt).pathCommands);const Jt=JSON.parse(JSON.stringify(A.get(Qt).pathCommands));for(let _t=0;_t<Jt.length;_t+=1){const Zt=Jt[_t];Zt.type!=="Z"&&(Zt.x+=ht,Zt.y+=Ft),(Zt.type==="Q"||Zt.type==="C")&&(Zt.x1+=ht,Zt.y1+=Ft),Zt.type==="C"&&(Zt.x2+=ht,Zt.y2+=Ft)}W(Jt)}}else p.length>0&&!R&&(S=p.shift()+s,R=!0);w&&l!==2&&(et(),w=!1);break;case 18:H();break;case 19:case 20:H(),X+=D+7>>3;break;case 21:p.length>2&&!R&&(S=p.shift()+s,R=!0),m+=p.pop(),Q+=p.pop(),V(Q,m);break;case 22:p.length>1&&!R&&(S=p.shift()+s,R=!0),Q+=p.pop(),V(Q,m);break;case 23:H();break;case 24:for(;p.length>2;)h=Q+p.shift(),u=m+p.shift(),d=h+p.shift(),f=u+p.shift(),Q=d+p.shift(),m=f+p.shift(),M(h,u,d,f,Q,m);Q+=p.shift(),m+=p.shift(),x(Q,m);break;case 25:for(;p.length>6;)Q+=p.shift(),m+=p.shift(),x(Q,m);h=Q+p.shift(),u=m+p.shift(),d=h+p.shift(),f=u+p.shift(),Q=d+p.shift(),m=f+p.shift(),M(h,u,d,f,Q,m);break;case 26:for(p.length%2&&(Q+=p.shift());p.length>0;)h=Q,u=m+p.shift(),d=h+p.shift(),f=u+p.shift(),Q=d,m=f+p.shift(),M(h,u,d,f,Q,m);break;case 27:for(p.length%2&&(m+=p.shift());p.length>0;)h=Q+p.shift(),u=m,d=h+p.shift(),f=u+p.shift(),Q=d+p.shift(),m=f,M(h,u,d,f,Q,m);break;case 28:T=J[X],it=J[X+1],p.push((T<<24|it<<16)>>16),X+=2;break;case 29:tt=p.pop()+o,K=t.gsubrs[tt],K&&Z(K);break;case 30:for(;p.length>0&&(h=Q,u=m+p.shift(),d=h+p.shift(),f=u+p.shift(),Q=d+p.shift(),m=f+(p.length===1?p.shift():0),M(h,u,d,f,Q,m),p.length!==0);)h=Q+p.shift(),u=m,d=h+p.shift(),f=u+p.shift(),m=f+p.shift(),Q=d+(p.length===1?p.shift():0),M(h,u,d,f,Q,m);break;case 31:for(;p.length>0&&(h=Q+p.shift(),u=m,d=h+p.shift(),f=u+p.shift(),m=f+p.shift(),Q=d+(p.length===1?p.shift():0),M(h,u,d,f,Q,m),p.length!==0);)h=Q,u=m+p.shift(),d=h+p.shift(),f=u+p.shift(),Q=d+p.shift(),m=f+(p.length===1?p.shift():0),M(h,u,d,f,Q,m);break;default:dt<32?console.warn(`Glyph ${c}: unknown operator ${dt}`):dt<247?p.push(dt-139):dt<251?(T=J[X],X+=1,p.push((dt-247)*256+T+108)):dt<255?(T=J[X],X+=1,p.push(-(dt-251)*256-T-108)):(T=J[X],it=J[X+1],L=J[X+2],z=J[X+3],X+=4,p.push((T<<24|it<<16|L<<8|z)/65536))}}}Z(e),this.pathCommands=B,R&&(this.advanceWidth=S)}}class In{constructor(t){this._sfnt=t}_items=[];get(t){const e=this._items[t];let A;if(e)A=e;else{A=this._get(t);const i=this._sfnt.hmtx.metrics[t];i&&(A.advanceWidth=A.advanceWidth||i.advanceWidth,A.leftSideBearing=A.leftSideBearing||i.leftSideBearing);const s=this._sfnt.cmap.glyphIndexToUnicodesMap.get(t);s&&(A.unicode??=s[0],A.unicodes??=s),this._items[t]=A}return A}}class md extends In{get length(){return this._sfnt.cff.charStringsIndex.offsets.length-1}_get(t){const e=this._sfnt.cff,A=new yd({index:t});return A.parse(e,e.charStringsIndex.get(t),this),A.name=e.charset[t],A}}var wd=Object.defineProperty,Fl=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&wd(t,e,i),i};class wr extends ge{_offsets;get offsets(){return this._offsets??=this.readOffsets()}_objects;get objects(){return this._objects??=this.readObjects()}constructor(t,e,A,i){super(t,e,A,i),this._init()}_init(){const t=this.view,e=this.count,A=this.offsetSize;this.objectOffset=(e+1)*A+2,this.endOffset=t.byteOffset+this.objectOffset+this.offsets[e]}readOffsets(){const t=this.view,e=this.count,A=this.offsetSize;t.seek(3);const i=[];for(let s=0,n=e+1;s<n;s++){const o=this.view;let a=0;for(let l=0;l<A;l++)a<<=8,a+=o.readUint8();i.push(a)}return i}readObjects(){const t=[];for(let e=0,A=this.count;e<A;e++)t.push(this.get(e));return t}get(t){const e=this.offsets,A=this.objectOffset,i=A+e[t],n=A+e[t+1]-i;return this._isString?this.view.readString(i,n):this.view.readBytes(i,n)}}Fl([y("uint16")],wr.prototype,"count"),Fl([y("uint8")],wr.prototype,"offsetSize");class vr extends wr{_isString=!1}class Tl extends wr{_isString=!0}const vd=[".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"],_d=[".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"],bd=[".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"],Dd=[".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 _r(r,t){return t<=390?vd[t]:r[t-391]}function Et(r,t="number",e){return(A,i)=>{if(typeof i!="string")return;const s={type:t,operator:r,default:e??t==="number"?0:void 0};Object.defineProperty(A.constructor.prototype,i,{get(){return this._getProp(s)},set(n){this._setProp(s,n)},configurable:!0,enumerable:!0})}}class Ll extends ge{_dict;get dict(){return this._dict??=this._readDict()}_stringIndex;setStringIndex(t){return this._stringIndex=t,this}_readFloatOperand(){const t=this.view;let e="";const A=15,i=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];for(;;){const s=t.readUint8(),n=s>>4,o=s&15;if(n===A||(e+=i[n],o===A))break;e+=i[o]}return Number.parseFloat(e)}_readOperand(t){const e=this.view;let A,i,s,n;if(t===28)return A=e.readUint8(),i=e.readUint8(),A<<8|i;if(t===29)return A=e.readUint8(),i=e.readUint8(),s=e.readUint8(),n=e.readUint8(),A<<24|i<<16|s<<8|n;if(t===30)return this._readFloatOperand();if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return A=e.readUint8(),(t-247)*256+A+108;if(t>=251&&t<=254)return A=e.readUint8(),-(t-251)*256-A-108;throw new Error(`invalid b0 ${t}, at: ${e.cursor}`)}_readDict(){const t=this.view;t.seek(0);let e=[];const A=t.cursor+t.byteLength,i={};for(;t.cursor<A;){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 _r(this._stringIndex?.objects??[],e[0]);case"number[]":return e}return e}_setProp(t,e){}}var xd=Object.defineProperty,pn=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&xd(t,e,i),i};class br extends Ll{}pn([Et(19)],br.prototype,"subrs"),pn([Et(20)],br.prototype,"defaultWidthX"),pn([Et(21)],br.prototype,"nominalWidthX");var Sd=Object.defineProperty,vt=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&Sd(t,e,i),i};class mt extends Ll{}vt([Et(0,"string")],mt.prototype,"version"),vt([Et(1,"string")],mt.prototype,"notice"),vt([Et(1200,"string")],mt.prototype,"copyright"),vt([Et(2,"string")],mt.prototype,"fullName"),vt([Et(3,"string")],mt.prototype,"familyName"),vt([Et(4,"string")],mt.prototype,"weight"),vt([Et(1201)],mt.prototype,"isFixedPitch"),vt([Et(1202)],mt.prototype,"italicAngle"),vt([Et(1203,"number",-100)],mt.prototype,"underlinePosition"),vt([Et(1204,"number",50)],mt.prototype,"underlineThickness"),vt([Et(1205)],mt.prototype,"paintType"),vt([Et(1206,"number",2)],mt.prototype,"charstringType"),vt([Et(1207,"number[]",[.001,0,0,.001,0,0])],mt.prototype,"fontMatrix"),vt([Et(13)],mt.prototype,"uniqueId"),vt([Et(5,"number[]",[0,0,0,0])],mt.prototype,"fontBBox"),vt([Et(1208)],mt.prototype,"strokeWidth"),vt([Et(14)],mt.prototype,"xuid"),vt([Et(15)],mt.prototype,"charset"),vt([Et(16)],mt.prototype,"encoding"),vt([Et(17)],mt.prototype,"charStrings"),vt([Et(18,"number[]",[0,0])],mt.prototype,"private");function Gt(r,t=r){return e=>{Pe.tableDefinitions.set(r,{tag:r,prop:t,class:e}),Object.defineProperty(Pe.prototype,t,{get(){return this.get(r)},set(A){return this.set(r,A)},configurable:!0,enumerable:!0})}}class Pe{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:A,charset:i}=this.cff;e=i.indexOf(A[t.codePointAt(0)])}return e??0}charToGlyph(t){return this.glyphs.get(this.charToGlyphIndex(t))}textToGlyphIndexes(t){const e=[];for(const A of t)e.push(this.charToGlyphIndex(A));return e}textToGlyphs(t){const e=this.glyphs,A=this.textToGlyphIndexes(t),i=A.length,s=Array.from({length:i}),n=e.get(0);for(let o=0;o<i;o+=1)s[o]=e.get(A[o])||n;return s}getPathCommands(t,e,A,i,s){const n=[];return this.forEachGlyph(t,e,A,i,s,(o,a,l,c,h)=>{n.push(...o.getPathCommands(a,l,c,h,this))}),n}getAdvanceWidth(t,e,A){return this.forEachGlyph(t,0,0,e,A,()=>{})}forEachGlyph(t,e=0,A=0,i=72,s={},n){const o=1/this.unitsPerEm*i,a=this.textToGlyphs(t);for(let l=0;l<a.length;l+=1){const c=a[l];n.call(this,c,e,A,i,s),c.advanceWidth&&(e+=c.advanceWidth*o),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((A,i)=>{this.tableViews.set(i,new DataView(A.buffer.slice(A.byteOffset,A.byteOffset+A.byteLength)))})}clone(){return new Pe(this.tableViews)}delete(t){const e=Pe.tableDefinitions.get(t);return e?(this.tableViews.delete(t),this.tables.delete(e.prop),this):this}set(t,e){const A=Pe.tableDefinitions.get(t);return A&&this.tables.set(A.prop,e),this.tableViews.set(t,e.view),this}get(t){const e=Pe.tableDefinitions.get(t);if(!e)return;let A=this.tables.get(e.prop);if(!A){const i=e.class;if(i){const s=this.tableViews.get(t);if(!s)return;A=new i(s.buffer,s.byteOffset,s.byteLength).setSFNT(this),this.tables.set(e.prop,A)}}return A}}class Xt extends ge{setSFNT(t){return this._sfnt=t,this}getSFNT(){return this._sfnt}}var Md=Object.defineProperty,Rd=Object.getOwnPropertyDescriptor,Ni=(r,t,e,A)=>{for(var i=A>1?void 0:A?Rd(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&Md(t,e,i),i};let DA=class extends Xt{_glyphs;get glyphs(){return this._glyphs??=new md(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,A){super(r,t,e,A),this._init()}_init(){const r=this.view,{buffer:t,byteOffset:e}=r,A=e+4;this.nameIndex=new Tl(t,A),this.topDictIndex=new vr(t,this.nameIndex.endOffset),this.stringIndex=new Tl(t,this.topDictIndex.endOffset),this.globalSubrIndex=new vr(t,this.stringIndex.endOffset),this.topDict=new mt(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 br(t,e+s,i).setStringIndex(this.stringIndex),this.privateDict.subrs&&(this.subrsIndex=new vr(t,e+s+this.privateDict.subrs))),this.charStringsIndex=new vr(t,e+this.topDict.charStrings);const n=this.charStringsIndex.offsets.length-1;this.topDict.charset===0?this.charset=_d:this.topDict.charset===1?this.charset=bd:this.topDict.charset===2?this.charset=Dd:this.charset=this._readCharset(e+this.topDict.charset,n,this.stringIndex.objects),this.topDict.encoding===0?this.encoding=fn:this.topDict.encoding===1?this.encoding=Qd:this.encoding=this._readEncoding(e+this.topDict.encoding)}_readCharset(r,t,e){const A=this.view;A.seek(r);let i,s,n;t-=1;const o=[".notdef"],a=A.readUint8();if(a===0)for(i=0;i<t;i+=1)s=A.readUint16(),o.push(_r(e,s));else if(a===1)for(;o.length<=t;)for(s=A.readUint16(),n=A.readUint8(),i=0;i<=n;i+=1)o.push(_r(e,s)),s+=1;else if(a===2)for(;o.length<=t;)for(s=A.readUint16(),n=A.readUint16(),i=0;i<=n;i+=1)o.push(_r(e,s)),s+=1;else throw new Error(`Unknown charset format ${a}`);return o}_readEncoding(r){const t=this.view;t.seek(r);let e,A;const i={},s=t.readUint8();if(s===0){const n=t.readUint8();for(e=0;e<n;e+=1)A=t.readUint8(),i[A]=e}else if(s===1){const n=t.readUint8();for(A=1,e=0;e<n;e+=1){const o=t.readUint8(),a=t.readUint8();for(let l=o;l<=o+a;l+=1)i[l]=A,A+=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}};Ni([y("uint8")],DA.prototype,"majorVersion",2),Ni([y("uint8")],DA.prototype,"minorVersion",2),Ni([y("uint8")],DA.prototype,"headerSize",2),Ni([y("uint8")],DA.prototype,"offsetSize",2),DA=Ni([Gt("CFF ","cff")],DA);var kd=Object.defineProperty,Dr=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&kd(t,e,i),i};const Fi=class Uc extends ge{constructor(t=new ArrayBuffer(262),e){super(t,e,262)}static from(t){const e=new Uc;return e.format=0,e.length=e.view.byteLength,e.language=0,t.forEach((A,i)=>{i<256&&A<256&&e.view.writeUint8(A,6+i)}),e}getUnicodeToGlyphIndexMap(){const t=new Map;return this.glyphIndexArray.forEach((e,A)=>{t.set(A,e)}),t}};Dr([y("uint16")],Fi.prototype,"format"),Dr([y("uint16")],Fi.prototype,"length"),Dr([y("uint16")],Fi.prototype,"language"),Dr([y({type:"uint8",size:256})],Fi.prototype,"glyphIndexArray");let En=Fi;var Pd=Object.defineProperty,Bn=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&Pd(t,e,i),i};class Ti extends ge{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,A)=>({firstCode:this.view.readUint16(),entryCount:this.view.readUint16(),idDelta:this.view.readUint16(),idRangeOffset:(this.view.readUint16()-(t-A)*8-2)/2}))}get glyphIndexArray(){const t=this.maxSubHeaderKey,e=6+256*2+t*8;this.view.seek(e);const A=(this.view.byteLength-e)/2;return Array.from({length:A},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(t){const e=new Map,A=this.subHeaderKeys,i=this.maxSubHeaderKey,s=this.subHeaders,n=this.glyphIndexArray,o=A.findIndex(l=>l===i);let a=0;for(let l=0;l<256;l++)if(A[l]===0)l>=o||l<s[0].firstCode||l>=s[0].firstCode+s[0].entryCount||s[0].idRangeOffset+(l-s[0].firstCode)>=n.length?a=0:(a=n[s[0].idRangeOffset+(l-s[0].firstCode)],a!==0&&(a=a+s[0].idDelta)),a!==0&&a<t&&e.set(l,a);else{const c=A[l];for(let h=0,u=s[c].entryCount;h<u;h++)if(s[c].idRangeOffset+h>=n.length?a=0:(a=n[s[c].idRangeOffset+h],a!==0&&(a=a+s[c].idDelta)),a!==0&&a<t){const d=(l<<8|h+s[c].firstCode)%65535;e.set(d,a)}}return e}}Bn([y("uint16")],Ti.prototype,"format"),Bn([y("uint16")],Ti.prototype,"length"),Bn([y("uint16")],Ti.prototype,"language");function Gl(r){return r>32767?r-65536:r<-32767?r+65536:r}function Cn(r,t){let e;const A=[];let i={};return r.forEach((s,n)=>{t&&n>t||((!e||n!==e.unicode+1||s!==e.glyphIndex+1)&&(e?(i.end=e.unicode,A.push(i),i={start:n,startId:s,delta:Gl(s-n)}):(i.start=Number(n),i.startId=s,i.delta=Gl(s-n))),e={unicode:n,glyphIndex:s})}),e&&(i.end=e.unicode,A.push(i)),A}var Ud=Object.defineProperty,xA=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&Ud(t,e,i),i};const gA=class Nc extends ge{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(A=>this.view.writeUint16(A))}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=Cn(t,65535),A=e.length+1,i=Math.floor(Math.log(A)/Math.LN2),s=2*2**i,n=new Nc(new ArrayBuffer(24+e.length*8));return n.format=4,n.length=n.view.byteLength,n.language=0,n.segCountX2=A*2,n.searchRange=s,n.entrySelector=i,n.rangeShift=2*A-s,n.endCode=[...e.map(o=>o.end),65535],n.reservedPad=0,n.startCode=[...e.map(o=>o.start),65535],n.idDelta=[...e.map(o=>o.delta),1],n.idRangeOffset=Array.from({length:A},()=>0),n}getUnicodeToGlyphIndexMap(){const t=new Map,e=this.segCountX2/2,A=(this.glyphIndexArrayCursor-this.idRangeOffsetCursor)/2,i=this.startCode,s=this.endCode,n=this.idRangeOffset,o=this.idDelta,a=this.glyphIndexArray;for(let l=0;l<e;++l)for(let c=i[l],h=s[l];c<=h;++c)if(n[l]===0)t.set(c,(c+o[l])%65536);else{const u=l+n[l]/2+(c-i[l])-A,d=a[u];d!==0?t.set(c,(d+o[l])%65536):t.set(c,0)}return t.delete(65535),t}};xA([y("uint16")],gA.prototype,"format"),xA([y("uint16")],gA.prototype,"length"),xA([y("uint16")],gA.prototype,"language"),xA([y("uint16")],gA.prototype,"segCountX2"),xA([y("uint16")],gA.prototype,"searchRange"),xA([y("uint16")],gA.prototype,"entrySelector"),xA([y("uint16")],gA.prototype,"rangeShift");let Qn=gA;var Nd=Object.defineProperty,Li=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&Nd(t,e,i),i};class SA extends ge{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((A,i)=>{e.set(i,A)}),e}}Li([y("uint16")],SA.prototype,"format"),Li([y("uint16")],SA.prototype,"length"),Li([y("uint16")],SA.prototype,"language"),Li([y("uint16")],SA.prototype,"firstCode"),Li([y("uint16")],SA.prototype,"entryCount");var Fd=Object.defineProperty,Gi=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&Fd(t,e,i),i};const qA=class Fc extends ge{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=Cn(t),A=new Fc(new ArrayBuffer(16+e.length*12));return A.format=12,A.reserved=0,A.length=A.view.byteLength,A.language=0,A.nGroups=e.length,e.forEach(i=>{A.view.writeUint32(i.start),A.view.writeUint32(i.end),A.view.writeUint32(i.startId)}),A}getUnicodeToGlyphIndexMap(){const t=new Map,e=this.groups;for(let A=0,i=e.length;A<i;A++){const s=e[A];let n=s.startGlyphCode,o=s.startCharCode;const a=s.endCharCode;for(;o<=a;)t.set(o++,n++)}return t}};Gi([y("uint16")],qA.prototype,"format"),Gi([y("uint16")],qA.prototype,"reserved"),Gi([y("uint32")],qA.prototype,"length"),Gi([y("uint32")],qA.prototype,"language"),Gi([y("uint32")],qA.prototype,"nGroups");let yn=qA;var Td=Object.defineProperty,mn=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&Td(t,e,i),i};class Oi extends ge{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 A=this.view.readUint32();e.unicodeValueRanges=Array.from({length:A},()=>({startUnicodeValue:this.view.readUint24(),additionalCount:this.view.readUint8()}))}if(e.nonDefaultUVSOffset){this.view.seek(e.nonDefaultUVSOffset);const A=this.view.readUint32();e.uVSMappings=Array.from({length:A},()=>({unicodeValue:this.view.readUint24(),glyphID:this.view.readUint16()}))}return e})}getUnicodeToGlyphIndexMap(){const t=new Map,e=this.getVarSelectorRecords();for(let A=0,i=e.length;A<i;A++){const{uVSMappings:s}=e[A];s.forEach(n=>{t.set(n.unicodeValue,n.glyphID)})}return t}}mn([y("uint16")],Oi.prototype,"format"),mn([y("uint32")],Oi.prototype,"length"),mn([y("uint32")],Oi.prototype,"numVarSelectorRecords");var Ld=Object.defineProperty,Gd=Object.getOwnPropertyDescriptor,wn=(r,t,e,A)=>{for(var i=A>1?void 0:A?Gd(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&Ld(t,e,i),i};let XA=class extends Xt{static from(r){const t=Array.from(r.keys()).some(c=>c>65535),e=Qn.from(r),A=En.from(r),i=t?yn.from(r):void 0,s=4+(i?32:24),n=s+e.view.byteLength,o=n+A.view.byteLength,a=[{platformID:0,platformSpecificID:3,offset:s},{platformID:1,platformSpecificID:0,offset:n},{platformID:3,platformSpecificID:1,offset:s},i&&{platformID:3,platformSpecificID:10,offset:o}].filter(Boolean),l=new XA(new ArrayBuffer(4+8*a.length+e.view.byteLength+A.view.byteLength+(i?.view.byteLength??0)));return l.numberSubtables=a.length,l.view.seek(4),a.forEach(c=>{l.view.writeUint16(c.platformID),l.view.writeUint16(c.platformSpecificID),l.view.writeUint32(c.offset)}),l.view.writeBytes(e.view,s),l.view.writeBytes(A.view,n),i&&l.view.writeBytes(i.view,o),l}_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 A=0,i=e.length;A<i;A++){const s=e[A],n=t.get(s);r.has(n)?r.get(n).push(s):r.set(n,[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 A;switch(e){case 0:A=new En(this.view.buffer,t.offset);break;case 2:A=new Ti(this.view.buffer,t.offset,this.view.readUint16());break;case 4:A=new Qn(this.view.buffer,t.offset,this.view.readUint16());break;case 6:A=new SA(this.view.buffer,t.offset,this.view.readUint16());break;case 12:A=new yn(this.view.buffer,t.offset,this.view.readUint32(t.offset+4));break;case 14:default:A=new Oi(this.view.buffer,t.offset,this.view.readUint32());break}return{...t,format:e,view:A}})}readunicodeToGlyphIndexMap(){const r=this.readSubtables(),t=r.find(n=>n.format===0)?.view,e=r.find(n=>n.platformID===3&&n.platformSpecificID===3&&n.format===2)?.view,A=r.find(n=>n.platformID===3&&n.platformSpecificID===1&&n.format===4)?.view,i=r.find(n=>n.platformID===3&&n.platformSpecificID===10&&n.format===12)?.view,s=r.find(n=>n.platformID===0&&n.platformSpecificID===5&&n.format===14)?.view;return new Map([...t?.getUnicodeToGlyphIndexMap()??[],...e?.getUnicodeToGlyphIndexMap(this._sfnt.maxp.numGlyphs)??[],...A?.getUnicodeToGlyphIndexMap()??[],...i?.getUnicodeToGlyphIndexMap()??[],...s?.getUnicodeToGlyphIndexMap()??[]])}};wn([y("uint16")],XA.prototype,"version",2),wn([y("uint16")],XA.prototype,"numberSubtables",2),XA=wn([Gt("cmap")],XA);class Od extends dn{_parseContours(t){const e=[];let A=[];for(let i=0;i<t.length;i+=1){const s=t[i];A.push(s),s.lastPointOfContour&&(e.push(A),A=[])}return Pi(A.length===0,"There are still points left in the current contour."),e}_transformPoints(t,e){const A=[];for(let i=0;i<t.length;i+=1){const s=t[i],n={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};A.push(n)}return A}_parseGlyphCoordinate(t,e,A,i,s){let n;return(e&i)>0?(n=t.view.readUint8(),(e&s)===0&&(n=-n),n=A+n):(e&s)>0?n=A:n=A+t.view.readInt16(),n}parse(t,e,A){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 o=this.endPointIndices=[];for(let B=0;B<i;B++)o.push(t.view.readUint16());const a=this.instructionLength=t.view.readUint16();Pi(a<5e3,`Bad instructionLength:${a}`);const l=this.instructions=[];for(let B=0;B<a;++B)l.push(t.view.readUint8());const c=t.view.byteOffset,h=o[o.length-1]+1;Pi(h<2e4,`Bad numberOfCoordinates:${c}`);const u=[];let d,f=0;for(;f<h;)if(d=t.view.readUint8(),u.push(d),f++,d&8&&f<h){const B=t.view.readUint8();for(let p=0;p<B;p++)u.push(d),f++}if(Pi(u.length===h,`Bad flags length: ${u.length}, numberOfCoordinates: ${h}`),o.length>0){const B=[];let p;if(h>0){for(let w=0;w<h;w+=1)d=u[w],p={},p.onCurve=!!(d&1),p.lastPointOfContour=o.includes(w),B.push(p);let D=0;for(let w=0;w<h;w+=1)d=u[w],p=B[w],p.x=this._parseGlyphCoordinate(t,d,D,2,16),D=p.x;let R=0;for(let w=0;w<h;w+=1)d=u[w],p=B[w],p.y=this._parseGlyphCoordinate(t,d,R,4,32),R=p.y}this.points=B}else this.points=[]}else if(i===0)this.points=[];else{this.isComposite=!0,this.points=[],this.components=[];let o,a=!0;for(;a;){o=t.view.readUint16();const l={glyphIndex:t.view.readUint16(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(o&1)>0?(o&2)>0?(l.dx=t.view.readInt16(),l.dy=t.view.readInt16()):l.matchedPoints=[t.view.readUint16(),t.view.readUint16()]:(o&2)>0?(l.dx=t.view.readInt8(),l.dy=t.view.readInt8()):l.matchedPoints=[t.view.readUint8(),t.view.readUint8()],(o&8)>0?l.xScale=l.yScale=t.view.readInt16()/16384:(o&64)>0?(l.xScale=t.view.readInt16()/16384,l.yScale=t.view.readInt16()/16384):(o&128)>0&&(l.xScale=t.view.readInt16()/16384,l.scale01=t.view.readInt16()/16384,l.scale10=t.view.readInt16()/16384,l.yScale=t.view.readInt16()/16384),this.components.push(l),a=!!(o&32)}if(o&256){this.instructionLength=t.view.readUint16(),this.instructions=[];for(let l=0;l<this.instructionLength;l+=1)this.instructions.push(t.view.readUint8())}}if(this.isComposite)for(let o=0;o<this.components.length;o+=1){const a=this.components[o],l=A.get(a.glyphIndex);if(l.getPathCommands(),l.points){let c;if(a.matchedPoints===void 0)c=this._transformPoints(l.points,a);else{Pi(a.matchedPoints[0]>this.points.length-1||a.matchedPoints[1]>l.points.length-1,`Matched points out of range in ${this.name}`);const h=this.points[a.matchedPoints[0]];let u=l.points[a.matchedPoints[1]];const d={xScale:a.xScale,scale01:a.scale01,scale10:a.scale10,yScale:a.yScale,dx:0,dy:0};u=this._transformPoints([u],d)[0],d.dx=h.x-u.x,d.dy=h.y-u.y,c=this._transformPoints(l.points,d)}this.points=this.points.concat(c)}}const s=[],n=this._parseContours(this.points);for(let o=0,a=n.length;o<a;++o){const l=n[o];let c=l[l.length-1],h=l[0];c.onCurve?s.push({type:"M",x:c.x,y:c.y}):h.onCurve?s.push({type:"M",x:h.x,y:h.y}):s.push({type:"M",x:(c.x+h.x)*.5,y:(c.y+h.y)*.5});for(let u=0,d=l.length;u<d;++u)if(c=h,h=l[(u+1)%d],c.onCurve)s.push({type:"L",x:c.x,y:c.y});else{let f=h;h.onCurve||(f={x:(c.x+h.x)*.5,y:(c.y+h.y)*.5}),s.push({type:"Q",x1:c.x,y1:c.y,x:f.x,y:f.y})}s.push({type:"Z"})}this.pathCommands=s}}class Hd extends In{get length(){return this._sfnt.loca.locations.length}_get(t){const e=this._sfnt.loca.locations,A=e[t],i=new Od({index:t});return A!==e[t+1]&&i.parse(this._sfnt.glyf,A,this),i}}var Jd=Object.getOwnPropertyDescriptor,Kd=(r,t,e,A)=>{for(var i=A>1?void 0:A?Jd(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};let xr=class extends Xt{static from(r){const t=r.reduce((A,i)=>A+i.byteLength,0),e=new xr(new ArrayBuffer(t));return r.forEach(A=>{e.view.writeBytes(A)}),e}_glyphs;get glyphs(){return this._glyphs??=new Hd(this._sfnt)}};xr=Kd([Gt("glyf")],xr);var Yd=Object.getOwnPropertyDescriptor,Vd=(r,t,e,A)=>{for(var i=A>1?void 0:A?Yd(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};let vn=class extends Xt{};vn=Vd([Gt("GPOS","gpos")],vn);var Wd=Object.defineProperty,zd=Object.getOwnPropertyDescriptor,MA=(r,t,e,A)=>{for(var i=A>1?void 0:A?zd(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&Wd(t,e,i),i};let Ze=class extends Xt{};MA([y("uint16")],Ze.prototype,"majorVersion",2),MA([y("uint16")],Ze.prototype,"minorVersion",2),MA([y("uint16")],Ze.prototype,"scriptListOffset",2),MA([y("uint16")],Ze.prototype,"featureListOffset",2),MA([y("uint16")],Ze.prototype,"lookupListOffset",2),MA([y("uint16")],Ze.prototype,"featureVariationsOffset",2),Ze=MA([Gt("GSUB","gsub")],Ze);var qd=Object.defineProperty,Xd=Object.getOwnPropertyDescriptor,Ut=(r,t,e,A)=>{for(var i=A>1?void 0:A?Xd(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&qd(t,e,i),i};let Dt=class extends Xt{constructor(r=new ArrayBuffer(54),t){super(r,t,Math.min(54,r.byteLength-(t??0)))}};Ut([y("fixed")],Dt.prototype,"version",2),Ut([y("fixed")],Dt.prototype,"fontRevision",2),Ut([y("uint32")],Dt.prototype,"checkSumAdjustment",2),Ut([y("uint32")],Dt.prototype,"magickNumber",2),Ut([y("uint16")],Dt.prototype,"flags",2),Ut([y("uint16")],Dt.prototype,"unitsPerEm",2),Ut([y({type:"longDateTime"})],Dt.prototype,"created",2),Ut([y({type:"longDateTime"})],Dt.prototype,"modified",2),Ut([y("int16")],Dt.prototype,"xMin",2),Ut([y("int16")],Dt.prototype,"yMin",2),Ut([y("int16")],Dt.prototype,"xMax",2),Ut([y("int16")],Dt.prototype,"yMax",2),Ut([y("uint16")],Dt.prototype,"macStyle",2),Ut([y("uint16")],Dt.prototype,"lowestRecPPEM",2),Ut([y("int16")],Dt.prototype,"fontDirectionHint",2),Ut([y("int16")],Dt.prototype,"indexToLocFormat",2),Ut([y("int16")],Dt.prototype,"glyphDataFormat",2),Dt=Ut([Gt("head")],Dt);var jd=Object.defineProperty,Zd=Object.getOwnPropertyDescriptor,ee=(r,t,e,A)=>{for(var i=A>1?void 0:A?Zd(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&jd(t,e,i),i};let Ot=class extends Xt{constructor(r=new ArrayBuffer(36),t){super(r,t,Math.min(36,r.byteLength-(t??0)))}};ee([y("fixed")],Ot.prototype,"version",2),ee([y("int16")],Ot.prototype,"ascent",2),ee([y("int16")],Ot.prototype,"descent",2),ee([y("int16")],Ot.prototype,"lineGap",2),ee([y("uint16")],Ot.prototype,"advanceWidthMax",2),ee([y("int16")],Ot.prototype,"minLeftSideBearing",2),ee([y("int16")],Ot.prototype,"minRightSideBearing",2),ee([y("int16")],Ot.prototype,"xMaxExtent",2),ee([y("int16")],Ot.prototype,"caretSlopeRise",2),ee([y("int16")],Ot.prototype,"caretSlopeRun",2),ee([y("int16")],Ot.prototype,"caretOffset",2),ee([y({type:"int16",size:4})],Ot.prototype,"reserved",2),ee([y("int16")],Ot.prototype,"metricDataFormat",2),ee([y("uint16")],Ot.prototype,"numOfLongHorMetrics",2),Ot=ee([Gt("hhea")],Ot);var $d=Object.getOwnPropertyDescriptor,tI=(r,t,e,A)=>{for(var i=A>1?void 0:A?$d(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};let Sr=class extends Xt{static from(r){const t=r.length*4,e=new Sr(new ArrayBuffer(t));return r.forEach(A=>{e.view.writeUint16(A.advanceWidth),e.view.writeUint16(A.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 A=this.view;return A.seek(0),Array.from({length:r}).map((i,s)=>(s<t&&(e=A.readUint16()),{advanceWidth:e,leftSideBearing:A.readUint16()}))}};Sr=tI([Gt("hmtx")],Sr);var eI=Object.getOwnPropertyDescriptor,AI=(r,t,e,A)=>{for(var i=A>1?void 0:A?eI(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};let _n=class extends Xt{};_n=AI([Gt("kern","kern")],_n);var iI=Object.getOwnPropertyDescriptor,rI=(r,t,e,A)=>{for(var i=A>1?void 0:A?iI(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};let Mr=class extends Xt{static from(r,t=1){const e=r.length*(t?4:2),A=new Mr(new ArrayBuffer(e));return r.forEach(i=>{t?A.view.writeUint32(i):A.view.writeUint16(i/2)}),A}_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)}};Mr=rI([Gt("loca")],Mr);var sI=Object.defineProperty,nI=Object.getOwnPropertyDescriptor,jt=(r,t,e,A)=>{for(var i=A>1?void 0:A?nI(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&sI(t,e,i),i};let Nt=class extends Xt{constructor(r=new ArrayBuffer(32),t){super(r,t,Math.min(32,r.byteLength-(t??0)))}};jt([y("fixed")],Nt.prototype,"version",2),jt([y("uint16")],Nt.prototype,"numGlyphs",2),jt([y("uint16")],Nt.prototype,"maxPoints",2),jt([y("uint16")],Nt.prototype,"maxContours",2),jt([y("uint16")],Nt.prototype,"maxComponentPoints",2),jt([y("uint16")],Nt.prototype,"maxComponentContours",2),jt([y("uint16")],Nt.prototype,"maxZones",2),jt([y("uint16")],Nt.prototype,"maxTwilightPoints",2),jt([y("uint16")],Nt.prototype,"maxStorage",2),jt([y("uint16")],Nt.prototype,"maxFunctionDefs",2),jt([y("uint16")],Nt.prototype,"maxInstructionDefs",2),jt([y("uint16")],Nt.prototype,"maxStackElements",2),jt([y("uint16")],Nt.prototype,"maxSizeOfInstructions",2),jt([y("uint16")],Nt.prototype,"maxComponentElements",2),jt([y("uint16")],Nt.prototype,"maxComponentDepth",2),Nt=jt([Gt("maxp")],Nt);var oI=Object.defineProperty,aI=Object.getOwnPropertyDescriptor,Rr=(r,t,e,A)=>{for(var i=A>1?void 0:A?aI(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&oI(t,e,i),i};const Ol={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"},bn={Macintosh:1,Microsoft:3},lI={Default:0},Hl={UCS2:1};let jA=class extends Xt{_names;get names(){return this._names??=this.readNames()}readNames(){const r=this.count;this.view.seek(6);const t=[];for(let o=0;o<r;++o)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 o=0;o<r;++o){const a=t[o];a.name=this.view.readBytes(e+a.offset,a.length)}let A=bn.Macintosh,i=lI.Default,s=0;t.some(o=>o.platform===bn.Microsoft&&o.encoding===Hl.UCS2&&o.language===1033)&&(A=bn.Microsoft,i=Hl.UCS2,s=1033);const n={};for(let o=0;o<r;++o){const a=t[o];a.platform===A&&a.encoding===i&&a.language===s&&Ol[a.nameId]&&(n[Ol[a.nameId]]=s===0?Id(a.name):pd(a.name))}return n}};Rr([y("uint16")],jA.prototype,"format",2),Rr([y("uint16")],jA.prototype,"count",2),Rr([y("uint16")],jA.prototype,"stringOffset",2),jA=Rr([Gt("name")],jA);var cI=Object.defineProperty,hI=Object.getOwnPropertyDescriptor,at=(r,t,e,A)=>{for(var i=A>1?void 0:A?hI(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&cI(t,e,i),i};let ot=class extends Xt{get fontPANOSE(){return[this.bFamilyType,this.bSerifStyle,this.bWeight,this.bProportion,this.bContrast,this.bStrokeVariation,this.bArmStyle,this.bLetterform,this.bMidline,this.bXHeight]}};at([y("uint16")],ot.prototype,"version",2),at([y("int16")],ot.prototype,"xAvgCharWidth",2),at([y("uint16")],ot.prototype,"usWeightClass",2),at([y("uint16")],ot.prototype,"usWidthClass",2),at([y("uint16")],ot.prototype,"fsType",2),at([y("uint16")],ot.prototype,"ySubscriptXSize",2),at([y("uint16")],ot.prototype,"ySubscriptYSize",2),at([y("uint16")],ot.prototype,"ySubscriptXOffset",2),at([y("uint16")],ot.prototype,"ySubscriptYOffset",2),at([y("uint16")],ot.prototype,"ySuperscriptXSize",2),at([y("uint16")],ot.prototype,"ySuperscriptYSize",2),at([y("uint16")],ot.prototype,"ySuperscriptXOffset",2),at([y("uint16")],ot.prototype,"ySuperscriptYOffset",2),at([y("uint16")],ot.prototype,"yStrikeoutSize",2),at([y("uint16")],ot.prototype,"yStrikeoutPosition",2),at([y("uint16")],ot.prototype,"sFamilyClass",2),at([y({type:"uint8"})],ot.prototype,"bFamilyType",2),at([y({type:"uint8"})],ot.prototype,"bSerifStyle",2),at([y({type:"uint8"})],ot.prototype,"bWeight",2),at([y({type:"uint8"})],ot.prototype,"bProportion",2),at([y({type:"uint8"})],ot.prototype,"bContrast",2),at([y({type:"uint8"})],ot.prototype,"bStrokeVariation",2),at([y({type:"uint8"})],ot.prototype,"bArmStyle",2),at([y({type:"uint8"})],ot.prototype,"bLetterform",2),at([y({type:"uint8"})],ot.prototype,"bMidline",2),at([y({type:"uint8"})],ot.prototype,"bXHeight",2),at([y({type:"uint8",size:16})],ot.prototype,"ulUnicodeRange",2),at([y({type:"char",size:4})],ot.prototype,"achVendID",2),at([y("uint16")],ot.prototype,"fsSelection",2),at([y("uint16")],ot.prototype,"usFirstCharIndex",2),at([y("uint16")],ot.prototype,"usLastCharIndex",2),at([y("int16")],ot.prototype,"sTypoAscender",2),at([y("int16")],ot.prototype,"sTypoDescender",2),at([y("int16")],ot.prototype,"sTypoLineGap",2),at([y("uint16")],ot.prototype,"usWinAscent",2),at([y("uint16")],ot.prototype,"usWinDescent",2),at([y({offset:72,type:"uint8",size:8})],ot.prototype,"ulCodePageRange",2),at([y({offset:72,type:"int16"})],ot.prototype,"sxHeight",2),at([y("int16")],ot.prototype,"sCapHeight",2),at([y("uint16")],ot.prototype,"usDefaultChar",2),at([y("uint16")],ot.prototype,"usBreakChar",2),at([y("uint16")],ot.prototype,"usMaxContext",2),ot=at([Gt("OS/2","os2")],ot);var gI=Object.defineProperty,uI=Object.getOwnPropertyDescriptor,Ue=(r,t,e,A)=>{for(var i=A>1?void 0:A?uI(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&gI(t,e,i),i};let pe=class extends Xt{constructor(r=new ArrayBuffer(32),t,e){super(r,t,e)}};Ue([y("fixed")],pe.prototype,"format",2),Ue([y("fixed")],pe.prototype,"italicAngle",2),Ue([y("int16")],pe.prototype,"underlinePosition",2),Ue([y("int16")],pe.prototype,"underlineThickness",2),Ue([y("uint32")],pe.prototype,"isFixedPitch",2),Ue([y("uint32")],pe.prototype,"minMemType42",2),Ue([y("uint32")],pe.prototype,"maxMemType42",2),Ue([y("uint32")],pe.prototype,"minMemType1",2),Ue([y("uint32")],pe.prototype,"maxMemType1",2),pe=Ue([Gt("post")],pe);var fI=Object.defineProperty,dI=Object.getOwnPropertyDescriptor,Ae=(r,t,e,A)=>{for(var i=A>1?void 0:A?dI(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&fI(t,e,i),i};let Ht=class extends Xt{constructor(r=new ArrayBuffer(36),t){super(r,t,Math.min(36,r.byteLength-(t??0)))}};Ae([y("fixed")],Ht.prototype,"version",2),Ae([y("int16")],Ht.prototype,"vertTypoAscender",2),Ae([y("int16")],Ht.prototype,"vertTypoDescender",2),Ae([y("int16")],Ht.prototype,"vertTypoLineGap",2),Ae([y("int16")],Ht.prototype,"advanceHeightMax",2),Ae([y("int16")],Ht.prototype,"minTopSideBearing",2),Ae([y("int16")],Ht.prototype,"minBottomSideBearing",2),Ae([y("int16")],Ht.prototype,"yMaxExtent",2),Ae([y("int16")],Ht.prototype,"caretSlopeRise",2),Ae([y("int16")],Ht.prototype,"caretSlopeRun",2),Ae([y("int16")],Ht.prototype,"caretOffset",2),Ae([y({type:"int16",size:4})],Ht.prototype,"reserved",2),Ae([y("int16")],Ht.prototype,"metricDataFormat",2),Ae([y("int16")],Ht.prototype,"numOfLongVerMetrics",2),Ht=Ae([Gt("vhea")],Ht);var II=Object.getOwnPropertyDescriptor,pI=(r,t,e,A)=>{for(var i=A>1?void 0:A?II(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};let kr=class extends Xt{static from(r){const t=r.length*4,e=new kr(new ArrayBuffer(t));return r.forEach(A=>{e.view.writeUint16(A.advanceHeight),e.view.writeInt16(A.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 A=0;return Array.from({length:r}).map((i,s)=>(s<t&&(A=e.readUint16()),{advanceHeight:A,topSideBearing:e.readUint8()}))}};kr=pI([Gt("vmtx")],kr);var EI=Object.defineProperty,Hi=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&EI(t,e,i),i};class ye extends yr{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(WA(t).getUint32(0))}static checksum(t){const e=WA(t);let A=e.byteLength;for(;A%4;)A++;let i=0;for(let s=0,n=A/4;s<n;s+=4)s*4<A-4&&(i+=e.getUint32(s*4,!1));return i&4294967295}static from(t){const e=h=>h+3&-4,A=t.tableViews.size,i=Array.from(t.tableViews.values()).reduce((h,u)=>h+e(u.byteLength),0),s=new this(new ArrayBuffer(12+A*16+i));s.scalerType=65536,s.numTables=A;const n=Math.log(2);s.searchRange=Math.floor(Math.log(A)/n)*16,s.entrySelector=Math.floor(s.searchRange/n),s.rangeShift=A*16-s.searchRange;let o=12+A*16,a=0;const l=s.getDirectories();t.tableViews.forEach((h,u)=>{const d=l[a++];d.tag=u,d.checkSum=this.checksum(h),d.offset=o,d.length=h.byteLength,s.view.writeBytes(h,o),o+=e(d.length)});const c=s.createSFNT().head;return c.checkSumAdjustment=0,c.checkSumAdjustment=2981146554-this.checksum(s.view),s}getDirectories(){let t=this.view.byteOffset+12;return Array.from({length:this.numTables},()=>{const e=new zA(this.view.buffer,t);return t+=e.view.byteLength,e})}createSFNT(){return new Pe(this.getDirectories().reduce((t,e)=>(t[e.tag]=new DataView(this.view.buffer,this.view.byteOffset+e.offset,e.length),t),{}))}}Hi([y("uint32")],ye.prototype,"scalerType"),Hi([y("uint16")],ye.prototype,"numTables"),Hi([y("uint16")],ye.prototype,"searchRange"),Hi([y("uint16")],ye.prototype,"entrySelector"),Hi([y("uint16")],ye.prototype,"rangeShift");class Dn extends ye{format="OpenType";mimeType="font/otf";static signature=new Set([1330926671]);static from(t){return super.from(t)}}var BI=Object.defineProperty,Ji=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&BI(t,e,i),i};class RA extends ge{constructor(t,e){super(t,e,20)}}Ji([y({type:"char",size:4})],RA.prototype,"tag"),Ji([y("uint32")],RA.prototype,"offset"),Ji([y("uint32")],RA.prototype,"compLength"),Ji([y("uint32")],RA.prototype,"origLength"),Ji([y("uint32")],RA.prototype,"origChecksum");var CI=Object.defineProperty,ue=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&CI(t,e,i),i};const oe=class lo extends yr{format="WOFF";mimeType="font/woff";get subfontFormat(){return ye.is(this.flavor)?"TrueType":Dn.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(WA(t).getUint32(0))}static checkSum(t){const e=WA(t),A=e.byteLength,i=Math.floor(A/4);let s=0,n=0;for(;n<i;)s+=e.getUint32(4*n++,!1);let o=A-i*4;if(o){let a=i*4;for(;o>0;)s+=e.getUint8(a)<<o*8,a++,o--}return s%4294967296}static from(t,e=new ArrayBuffer(0)){const A=h=>h+3&-4,i=[];t.tableViews.forEach((h,u)=>{const d=WA(ld(new Uint8Array(h.buffer,h.byteOffset,h.byteLength)));i.push({tag:u,view:d.byteLength<h.byteLength?d:h,rawView:h})});const s=i.length,n=i.reduce((h,u)=>h+A(u.view.byteLength),0),o=new lo(new ArrayBuffer(44+20*s+n+e.byteLength));o.signature=2001684038,o.flavor=65536,o.length=o.view.byteLength,o.numTables=s,o.totalSFNTSize=12+16*s+i.reduce((h,u)=>h+A(u.rawView.byteLength),0);let a=44+s*20,l=0;const c=o.getDirectories();return i.forEach(h=>{const u=c[l++];u.tag=h.tag,u.offset=a,u.compLength=h.view.byteLength,u.origChecksum=lo.checkSum(h.rawView),u.origLength=h.rawView.byteLength,o.view.writeBytes(h.view,a),a+=A(u.compLength)}),o.view.writeBytes(e),o}getDirectories(){let t=44;return Array.from({length:this.numTables},()=>{const e=new RA(this.view.buffer,t);return t+=e.view.byteLength,e})}createSFNT(){return new Pe(this.getDirectories().reduce((t,e)=>{const A=e.tag,i=this.view.byteOffset+e.offset,s=e.compLength,n=e.origLength,o=i+s;return t[A]=s>=n?new DataView(this.view.buffer,i,s):new DataView(cd(new Uint8Array(this.view.buffer.slice(i,o))).buffer),t},{}))}};ue([y("uint32")],oe.prototype,"signature"),ue([y("uint32")],oe.prototype,"flavor"),ue([y("uint32")],oe.prototype,"length"),ue([y("uint16")],oe.prototype,"numTables"),ue([y("uint16")],oe.prototype,"reserved"),ue([y("uint32")],oe.prototype,"totalSFNTSize"),ue([y("uint16")],oe.prototype,"majorVersion"),ue([y("uint16")],oe.prototype,"minorVersion"),ue([y("uint32")],oe.prototype,"metaOffset"),ue([y("uint32")],oe.prototype,"metaLength"),ue([y("uint32")],oe.prototype,"metaOrigLength"),ue([y("uint32")],oe.prototype,"privOffset"),ue([y("uint32")],oe.prototype,"privLength");let Pr=oe;function Jl(r,t=!0){if(ye.is(r))return new ye(r);if(Dn.is(r))return new Dn(r);if(Pr.is(r))return new Pr(r);if(t)throw new Error("Failed to parseFont")}function Kl(r,t=!0){const e=Jl(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 A=new AbortController;return{url:t,when:fetch(t,{...Ur.defaultRequestInit,...e,signal:A.signal}).then(i=>i.arrayBuffer()),cancel:()=>A.abort()}}injectFontFace(t,e){return document.fonts.add(new FontFace(t,e)),this}injectStyleTag(t,e){const A=document.createElement("style");return A.appendChild(document.createTextNode(`@font-face {
|
|
862
|
-
font-family: "${
|
|
863
|
-
src: url(${
|
|
864
|
-
}`)),document.head.appendChild(A),this}_parseUrls(t){const e=Array.from(new Set([...t.split(","),t]));return Array.from(new Set(e.map(A=>this.familyToUrl.get(A.trim())??this.familyToUrl.get(A)??A)))}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}async load(t,e={}){const{cancelOther:A,injectFontFace:i=!0,injectStyleTag:s=!0,...n}=e;let o,a;if(typeof t=="string"?o=t:{src:o,family:a}=t,this.loaded.has(o))return A&&(this.loading.forEach(d=>d.cancel()),this.loading.clear()),h(this.loaded.get(o));let l=this.loading.get(o);return l||(l=this._createRequest(o,n),this.loading.set(o,l)),A&&this.loading.forEach((d,f)=>{d!==l&&(d.cancel(),this.loading.delete(f))}),l.when.then(d=>{if(this.loaded.has(o))return h(this.loaded.get(o));{const f=u(d);return e.noAdd||this.loaded.set(o,f),f.familySet.forEach(B=>{this.familyToUrl.set(B,o),typeof document<"u"&&(i&&this.injectFontFace(B,d),s&&this.injectStyleTag(B,o))}),f}}).catch(d=>{if(d instanceof DOMException&&d.message==="The user aborted a request.")return u();throw d}).finally(()=>{this.loading.delete(o)});function c(){return a?Array.isArray(a)?a:[a]:[]}function h(d){return c().forEach(f=>{d.familySet.add(f)}),d}function u(d=new ArrayBuffer(0)){let f;function B(){return f||(f=d.byteLength?Kl(d,!1):void 0),f}function p(){const D=B();if(D instanceof ye||D instanceof Pr)return D.sfnt}return{src:o,family:a,buffer:d,familySet:new Set(c()),getFont:B,getSFNT:p}}}async waitUntilLoad(){await Promise.all(Array.from(this.loading.values()).map(t=>t.when))}}const Yl=new Ur,QI=Object.freeze(Object.defineProperty({__proto__:null,BaseFont:yr,get Cff(){return DA},get Cmap(){return XA},CmapSubtableFormat0:En,CmapSubtableFormat12:yn,CmapSubtableFormat14:Oi,CmapSubtableFormat2:Ti,CmapSubtableFormat4:Qn,CmapSubtableFormat6:SA,FontDataObject:ge,FontDataView:Pt,Fonts:Ur,get Glyf(){return xr},Glyph:dn,GlyphSet:In,get Gpos(){return vn},get Gsub(){return Ze},get Head(){return Dt},get Hhea(){return Ot},get Hmtx(){return Sr},get Kern(){return _n},get Loca(){return Mr},get Maxp(){return Nt},get Name(){return jA},get Os2(){return ot},get Post(){return pe},SFNT:Pe,TTF:ye,TableDirectory:zA,get Vhea(){return Ht},get Vmtx(){return kr},WOFF:Pr,WOFFTableDirectoryEntry:RA,createCmapSegments:Cn,dataTypeToByteLength:Ui,defineColumn:y,defineSFNTTable:Gt,fonts:Yl,parseFont:Kl,parseSFNTFont:Jl},Symbol.toStringTag,{value:"Module"}));function xn(r,t,e){if(typeof t=="string"&&t.startsWith("linear-gradient")){const{x0:A,y0:i,x1:s,y1:n,stops:o}=yI(t,e.left,e.top,e.width,e.height),a=r.createLinearGradient(A,i,s,n);return o.forEach(l=>a.addColorStop(l.offset,l.color)),a}return t}function Nr(r,t,e){r?.color&&(r.color=xn(e,r.color,t)),r?.backgroundColor&&(r.backgroundColor=xn(e,r.backgroundColor,t)),r?.textStrokeColor&&(r.textStrokeColor=xn(e,r.textStrokeColor,t))}function yI(r,t,e,A,i){const s=r.match(/linear-gradient\((.+)\)$/)?.[1]??"",n=s.split(",")[0],o=n.includes("deg")?n:"0deg",a=s.replace(o,"").matchAll(/(#|rgba|rgb)(.+?) ([\d.]+%)/gi),c=(Number(o.replace("deg",""))||0)*Math.PI/180,h=A*Math.sin(c),u=i*Math.cos(c);return{x0:t+A/2-h,y0:e+i/2+u,x1:t+A/2+h,y1:e+i/2-u,stops:Array.from(a).map(d=>{let f=d[2];return f.startsWith("(")?f=f.split(",").length>3?`rgba${f}`:`rgb${f}`:f=`#${f}`,{offset:Number(d[3].replace("%",""))/100,color:f}})}}function ZA(r){const{ctx:t,path:e,fontSize:A,clipRect:i}=r;t.save(),t.beginPath();const s=e.style,n={...s,fill:r.color??s.fill,stroke:r.textStrokeColor??s.stroke,strokeWidth:r.textStrokeWidth?r.textStrokeWidth*A:s.strokeWidth,strokeLinecap:"round",strokeLinejoin:"round",shadowOffsetX:(r.shadowOffsetX??0)*A,shadowOffsetY:(r.shadowOffsetY??0)*A,shadowBlur:(r.shadowBlur??0)*A,shadowColor:r.shadowColor};i&&(t.rect(i.left,i.top,i.width,i.height),t.clip(),t.beginPath()),e.drawTo(t,n),t.restore()}function mI(r,t,e){const{left:A,top:i,width:s,height:n}=e,o=r.canvas;o.dataset.viewBox=`${A} ${i} ${s} ${n}`,o.dataset.pixelRatio=String(t);const a=s,l=n;o.width=Math.max(1,Math.ceil(a*t)),o.height=Math.max(1,Math.ceil(l*t)),o.style.width=`${a}px`,o.style.height=`${l}px`,r.clearRect(0,0,o.width,o.height),r.scale(t,t),r.translate(-A,-i)}function wI(r,t){const{paragraphs:e,computedStyle:A,glyphBox:i}=t;Nr(A,i,r),e.forEach(s=>{Nr(s.computedStyle,s.lineBox,r),s.fragments.forEach(n=>{Nr(n.computedStyle,n.inlineBox,r)})})}const vI=new Set(["©","®","÷"]),_I=new Set(["—","…","“","”","﹏","﹋","﹌","‘","’","˜"]),bI={1:"italic",32:"bold"},DI={1:"italic",2:"bold"},Vl={100:-.2,200:-.1,300:0,400:0,normal:0,500:.1,600:.2,700:.3,bold:.3,800:.4,900:.5};class xI{constructor(t,e,A){this.content=t,this.index=e,this.parent=A}path=new kt;lineBox=new ct;inlineBox=new ct;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 ct(this.lineBox.left+this.lineBox.width/2-t/2,this.lineBox.top,t,this.lineBox.height):new ct(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,A=t??Yl;let s=(e?A.get(e):A.fallbackFont)?.getSFNT();return s?.textToGlyphIndexes(this.content).includes(0)&&(s=A.fallbackFont?.getSFNT()),s}updateGlyph(t=this._getFontSFNT()){if(!t)return this;const{hhea:e,os2:A,post:i,head:s}=t,n=s.unitsPerEm,o=e.ascent,a=e.descent,{content:l,computedStyle:c,isVertical:h}=this,{fontSize:u}=c,d=n/u,f=t.getAdvanceWidth(l,u),B=(o+Math.abs(a))/d,p=o/d;return this.advanceWidth=f,this.advanceHeight=B,this.inlineBox.width=h?B:f,this.inlineBox.height=h?f:B,this.underlinePosition=(o-i.underlinePosition)/d,this.underlineThickness=i.underlineThickness/d,this.strikeoutPosition=(o-A.yStrikeoutPosition)/d,this.strikeoutSize=A.yStrikeoutSize/d,this.ascender=o/d,this.descender=a/d,this.typoAscender=A.sTypoAscender/d,this.typoDescender=A.sTypoDescender/d,this.typoLineGap=A.sTypoLineGap/d,this.winAscent=A.usWinAscent/d,this.winDescent=A.usWinDescent/d,this.xHeight=A.sxHeight/d,this.capHeight=A.sCapHeight/d,this.baseline=p,this.centerDiviation=B/2-p,this.fontStyle=bI[A.fsSelection]??DI[s.macStyle],this}update(t){const e=this._getFontSFNT(t);if(!e)return this;this.updateGlyph(e);const{isVertical:A,content:i,computedStyle:s,baseline:n,inlineBox:o,ascender:a,descender:l,typoAscender:c,fontStyle:h,advanceWidth:u,advanceHeight:d}=this,{left:f,top:B}=o,p=s.fontStyle==="italic"&&h!=="italic";let D=f,R=B+n,w;const S=new kt;if(A&&(D+=(d-u)/2,Math.abs(u-d)>.1&&(R-=(a-c)/(a+Math.abs(l))*d),w=void 0),A&&!vI.has(i)&&(i.codePointAt(0)<=256||_I.has(i))){S.addCommands(e.getPathCommands(i,D,B+n-(d-u)/2,s.fontSize));const m={y:B-(d-u)/2+d/2,x:D+u/2};p&&this._italic(S,A?{x:m.x,y:B-(d-u)/2+n}:void 0),S.rotate(90,m)}else w!==void 0?(S.addCommands(e.glyphs.get(w).getPathCommands(D,R,s.fontSize)),p&&this._italic(S,A?{x:D+u/2,y:B+c/(a+Math.abs(l))*d}:void 0)):(S.addCommands(e.getPathCommands(i,D,R,s.fontSize)),p&&this._italic(S,A?{x:D+d/2,y:R}:void 0));const Q=s.fontWeight??400;return Q in Vl&&(Q===700||Q==="bold")&&h!=="bold"&&S.bold(Vl[Q]*s.fontSize*.05),S.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=S,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,A){if(this.path.curves[0]?.curves.length)return this.path.getMinMax(t,e,A)}getGlyphBoundingBox(t){const e=this.getGlyphMinMax(void 0,void 0,t);if(!e)return;const{min:A,max:i}=e;return new ct(A.x,A.y,i.x-A.x,i.y-A.y)}drawTo(t,e={}){const A=this.computedStyle,i={ctx:t,path:this.path,fontSize:A.fontSize,color:A.color,...e};if(this.glyphBox)ZA(i);else{t.save(),t.beginPath();const s=this.path.style,n={...s,fill:i.color??s.fill,stroke:i.textStrokeColor??s.stroke,strokeWidth:i.textStrokeWidth?i.textStrokeWidth*i.fontSize:s.strokeWidth,shadowOffsetX:(i.shadowOffsetX??0)*i.fontSize,shadowOffsetY:(i.shadowOffsetY??0)*i.fontSize,shadowBlur:(i.shadowBlur??0)*i.fontSize,shadowColor:i.shadowColor};Us(t,n),t.font=`${i.fontSize}px ${i.fontFamily}`,this.isVertical?(t.textBaseline="middle",t.fillText(this.content,this.inlineBox.left,this.inlineBox.top+this.inlineBox.height/2)):(t.textBaseline="alphabetic",t.fillText(this.content,this.inlineBox.left,this.inlineBox.top+this.baseline)),t.restore()}}}function Wl(){const r=new Map;async function t(A){if(!r.has(A)){r.set(A,A);try{r.set(A,await fetch(A).then(i=>i.text()))}catch(i){console.warn(i),r.delete(A)}}}function e(A){return A.startsWith("http://")||A.startsWith("https://")||A.startsWith("blob://")}return{loaded:r,needsLoad:e,load:t}}function zl(r){const t=new Map;function e(A){let i=t.get(A);if(!i){const s=Fs(r.needsLoad(A)?r.loaded.get(A)??A:A),n=Ls(s);i={dom:s,pathSet:n},t.set(A,i)}return i}return{parsed:t,parse:e}}function Sn(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 Mn(r){return lt(r)?{}:r}function SI(r,t){const e=Object.keys(r),A=Object.keys(t);return Array.from(new Set([...e,...A])).every(s=>$A(r[s],t[s]))}function $A(r,t){const e=typeof r;return e===typeof t?e==="object"?SI(r,t):r===t:!1}function Rn(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 MI{constructor(t,e={},A){this.content=t,this.style=e,this.parent=A,this.updateComputedStyle().initCharacters()}inlineBox=new ct;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,...Rn(this.style)},this}initCharacters(){const t=[];let e=0;for(const A of this.computedContent)t.push(new xI(A,e++,this));return this.characters=t,this}}class RI{constructor(t,e){this.style=t,this.parent=e,this.updateComputedStyle()}lineBox=new ct;fragments=[];fill;outline;get computedFill(){return this.fill??this.parent.fill}get computedOutline(){return this.outline??this.parent.outline}updateComputedStyle(){return this.computedStyle={...Rn(this.parent.computedStyle),...Rn(this.style)},this}addFragment(t,e){const A=new MI(t,e,this);return this.fragments.push(A),A}}function ME(r){return r}class Fr{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 A in t){const i=t[A];Fr.notZeroStyles.has(A)&&i===0||(typeof i=="number"&&Fr.pxStyles.has(A)?e[A]=`${i}px`:e[A]=i)}return e}createDom(t,e){const A=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 n=!!(i.justifyContent||i.alignItems);Object.assign(A.style,{...this._toDomStyle({...i,boxSizing:i.boxSizing??"border-box",display:i.display??(n?"inline-flex":void 0),width:i.width??"max-content",height:i.height??"max-content"}),whiteSpace:"pre-wrap",wordBreak:"break-all"});const o=document.createElement("ul");return Object.assign(o.style,{verticalAlign:"inherit",listStyleType:"inherit",padding:"0",margin:"0",width:n&&s?"100%":void 0,height:n&&!s?"100%":void 0}),t.forEach(a=>{const l=document.createElement("li");Object.assign(l.style,{verticalAlign:"inherit",...this._toDomStyle(a.style)}),a.fragments.forEach(c=>{const h=document.createElement("span");Object.assign(h.style,{verticalAlign:"inherit",...this._toDomStyle(c.style)}),h.appendChild(document.createTextNode(c.content)),l.appendChild(h)}),o.appendChild(l)}),A.appendChild(o),A}measureDOMText(t){const e=document.createRange();e.selectNodeContents(t);const A=t.data??"";let i=0;return Array.from(A).map(s=>{const n=i+=A.substring(i).indexOf(s),o=n+s.length;i+=s.length,e.setStart(t,Math.max(n,0)),e.setEnd(t,o);const a=e.getClientRects?.()??[e.getBoundingClientRect()];let l=a[a.length-1];a.length>1&&l.width<2&&(l=a[a.length-2]);const c=e.toString();if(c!==""&&l&&l.width+l.height!==0)return{content:c,top:l.top,left:l.left,height:l.height,width:l.width}}).filter(Boolean)}measureDOM(t){const e=[],A=[],i=[];return t.querySelectorAll("li").forEach((s,n)=>{const o=s.getBoundingClientRect();e.push({paragraphIndex:n,left:o.left,top:o.top,width:o.width,height:o.height}),s.querySelectorAll(":scope > *").forEach((a,l)=>{const c=a.getBoundingClientRect();A.push({paragraphIndex:n,fragmentIndex:l,left:c.left,top:c.top,width:c.width,height:c.height});let h=0;!a.children.length&&a.firstChild instanceof window.Text?this.measureDOMText(a.firstChild).forEach(u=>{i.push({...u,newParagraphIndex:-1,paragraphIndex:n,fragmentIndex:l,characterIndex:h++,textWidth:-1,textHeight:-1})}):a.querySelectorAll(":scope > *").forEach(u=>{u.firstChild instanceof window.Text&&this.measureDOMText(u.firstChild).forEach(d=>{i.push({...d,newParagraphIndex:-1,paragraphIndex:n,fragmentIndex:l,characterIndex:h++,textWidth:-1,textHeight:-1})})})})}),{paragraphs:e,fragments:A,characters:i}}measureParagraphDOM(t,e){const A=e.getBoundingClientRect(),i=this.measureDOM(e);i.paragraphs.forEach(o=>{const a=t[o.paragraphIndex];a.lineBox.left=o.left-A.left,a.lineBox.top=o.top-A.top,a.lineBox.width=o.width,a.lineBox.height=o.height}),i.fragments.forEach(o=>{const a=t[o.paragraphIndex].fragments[o.fragmentIndex];a.inlineBox.left=o.left-A.left,a.inlineBox.top=o.top-A.top,a.inlineBox.width=o.width,a.inlineBox.height=o.height});const s=[];let n=0;return i.characters.forEach(o=>{const{paragraphIndex:a,fragmentIndex:l,characterIndex:c}=o;s.push({...o,newParagraphIndex:a,left:o.left-A.left,top:o.top-A.top});const h=t[a].fragments[l].characters[c],{fontHeight:u,isVertical:d}=h,f=s[n];h.inlineBox.left=f.left,h.inlineBox.top=f.top,h.inlineBox.width=f.width,h.inlineBox.height=f.height,d?(h.lineBox.left=f.left+(f.width-u)/2,h.lineBox.top=f.top,h.lineBox.width=u,h.lineBox.height=f.height):(h.lineBox.left=f.left,h.lineBox.top=f.top+(f.height-u)/2,h.lineBox.width=f.width,h.lineBox.height=u),n++}),{paragraphs:t,boundingBox:new ct(0,0,A.width,A.height)}}measure(t,e,A){let i;A||(A=this.createDom(t,e),Object.assign(A.style,{position:"fixed",visibility:"hidden"}),document.body.appendChild(A),i=()=>A?.parentNode?.removeChild(A));const s=this.measureParagraphDOM(t,A);return i?.(),s}}function kI(){const r=new We,t=Wl(),e=zl(t);return{name:"background",pathSet:r,load:async A=>{const{backgroundImage:i}=A.computedStyle;i&&t.needsLoad(i)&&await t.load(i)},update:A=>{r.paths.length=0;const{computedStyle:i,lineBox:s,isVertical:n}=A,{backgroundImage:o,backgroundSize:a,backgroundColormap:l}=i;if(lt(o))return;const{pathSet:c}=e.parse(o),h=c.getBoundingBox(!0);let u,d,f,B;n?{x:d,y:u,width:B,height:f}=s:{x:u,y:d,width:f,height:B}=s;const p=Mn(l??"none"),D=c.paths.map(Q=>{const m=Q.clone();return m.style.fill&&m.style.fill in p&&(m.style.fill=p[m.style.fill]),m.style.stroke&&m.style.stroke in p&&(m.style.stroke=p[m.style.stroke]),m});let R,w;if(a==="rigid"){R=Math.max(A.fontSize*5/h.width),w=R;const Q=new G;Q.x=h.width-f/R,Q.y=h.height-B/w,D.forEach(m=>{m.applyTransform(x=>{const M=x.x>h.left+h.width/2,V=x.y>h.top+h.height/2;M&&(x.x-=Q.x),V&&(x.y-=Q.y)})})}else R=f/h.width,w=B/h.height;const S=new Lt;S.translate(-h.x,-h.y),S.scale(R,w),n&&(S.translate(-f/2,-B/2),S.rotate(-Math.PI/2),S.translate(B/2,f/2)),S.translate(u,d),D.forEach(Q=>{Q.applyTransform(m=>{m.applyMatrix3(S)})}),r.paths.push(...D)},renderOrder:-2,render:(A,i)=>{const{boundingBox:s,computedStyle:n}=i;lt(n.backgroundColor)||(A.fillStyle=n.backgroundColor,A.fillRect(...s.array)),r.paths.forEach(o=>{if(ZA({ctx:A,path:o,fontSize:n.fontSize}),i.debug){const a=new We([o]).getBoundingBox();a&&A.strokeRect(a.x,a.y,a.width,a.height)}}),i.paragraphs.forEach(o=>{const{lineBox:a,style:l}=o;lt(l.backgroundColor)||(A.fillStyle=l.backgroundColor,A.fillRect(...a.array)),o.fragments.forEach(c=>{const{inlineBox:h,style:u}=c;lt(u.backgroundColor)||(A.fillStyle=u.backgroundColor,A.fillRect(...h.array))})})}}}function kn(r){const{highlight:t,highlightImage:e,highlightReferImage:A,highlightColormap:i,highlightLine:s,highlightSize:n,highlightThickness:o}=r;return{image:t?.image??e??"none",referImage:t?.referImage??A??"none",colormap:t?.colormap??i??"none",line:t?.line??s??"none",size:t?.size??n??"cover",thickness:t?.thickness??o??"100%"}}function PI(){const r=new We,t=[],e=Wl(),A=zl(e);return{name:"highlight",pathSet:r,load:async i=>{const s=new Set;i.forEachCharacter(n=>{const{computedStyle:o}=n,{image:a,referImage:l}=kn(o);a&&e.needsLoad(a)&&s.add(a),l&&e.needsLoad(l)&&s.add(l)}),await Promise.all(Array.from(s).map(n=>e.load(n)))},update:i=>{t.length=0,r.paths.length=0;let s=[],n,o;i.forEachCharacter(a=>{const{computedStyle:l}=a,c=kn(l),{image:h,colormap:u,line:d,size:f,thickness:B}=c;if(lt(h))n?.length&&(n=[],s.push(n));else{const{inlineBox:p,isVertical:D}=a,{fontSize:R}=l;(!o||$A(o.image,h)&&$A(o.colormap,u)&&$A(o.line,d)&&$A(o.size,f)&&$A(o.thickness,B))&&n?.length&&(D?n[0].inlineBox.left===p.left:n[0].inlineBox.top===p.top)&&n[0].fontSize===R?n.push(a):(n=[],n.push(a),s.push(n))}o=c}),s=s.filter(a=>a.length);for(let a=0;a<s.length;a++){const l=s[a],c=l[0],h=ct.from(...l.map(K=>K.compatibleGlyphBox));if(!h.height||!h.width)continue;const{computedStyle:u,isVertical:d,inlineBox:f,compatibleGlyphBox:B,strikeoutPosition:p,underlinePosition:D}=c,{fontSize:R}=u,{image:w,referImage:S,colormap:Q,line:m,size:x,thickness:M}=kn(u),V=Sn(M,{fontSize:R,total:h.width})/h.width,et=Mn(Q),{pathSet:W,dom:H}=A.parse(w),Z=W.getBoundingBox(!0),J=R/Z.width*2,T=new ct().copy(h);d&&(T.width=h.height,T.height=h.width,T.left=h.left+h.width);const it=Math.floor(T.width);let L=it;x!=="cover"&&(L=Sn(x,{fontSize:R,total:h.width})||it,T.width=L);const z=!lt(S)&<(m);if(z)Z.copy(A.parse(S).pathSet.getBoundingBox(!0));else{let K;if(lt(m))if(Z.width/Z.height>4){K="underline";const At=H.getAttribute("viewBox");if(At){const[U,P,q,$]=At.split(" ").map(X=>Number(X)),nt=P+$/2;Z.y<nt&&Z.y+Z.height>nt?K="line-through":Z.y+Z.height<nt?K="overline":K="underline"}}else K="outline";else K=m;switch(K){case"outline":{const At=T.width*.2,U=T.height*.2;d?(T.x-=U/2,T.y-=At/2,T.x-=T.height):(T.x-=At/2,T.y-=U/2),T.width+=At,T.height+=U;break}case"overline":T.height=Z.height*J,d?T.x=f.left+f.width:T.y=f.top;break;case"line-through":T.height=Z.height*J,d?T.x=f.left+f.width-p+T.height/2:T.y=f.top+p-T.height/2;break;case"underline":T.height=Z.height*J,d?T.x=B.left+B.width-D:T.y=f.top+D;break}}const tt=new Lt;if(tt.translate(-Z.x,-Z.y),tt.scale(T.width/Z.width,T.height/Z.height),d){const K=T.width/2,At=T.height/2;z||tt.translate(-K,-At),tt.rotate(-Math.PI/2),z||tt.translate(At,K)}tt.translate(T.x,T.y);for(let K=0;K<Math.ceil(it/L);K++){const At=tt.clone();d?At.translate(0,K*T.width):At.translate(K*T.width,0),W.paths.forEach(U=>{const P=U.clone().applyTransform(At);P.style.strokeWidth&&(P.style.strokeWidth*=J*V),P.style.strokeMiterlimit&&(P.style.strokeMiterlimit*=J),P.style.strokeDashoffset&&(P.style.strokeDashoffset*=J),P.style.strokeDasharray&&(P.style.strokeDasharray=P.style.strokeDasharray.map(q=>q*J)),P.style.fill&&P.style.fill in et&&(P.style.fill=et[P.style.fill]),P.style.stroke&&P.style.stroke in et&&(P.style.stroke=et[P.style.stroke]),r.paths.push(P),it!==L&&(d?t[r.paths.length-1]=new ct(h.left-h.width*2,h.top,h.width*4,h.height):t[r.paths.length-1]=new ct(h.left,h.top-h.height*2,h.width,h.height*4))})}}},renderOrder:-1,getBoundingBox:()=>{const i=[];return r.paths.forEach((s,n)=>{const o=t[n];let a=s.getBoundingBox();if(o){const l=Math.max(a.x,o.x),c=Math.max(a.y,o.y),h=Math.min(a.right,o.right),u=Math.min(a.bottom,o.bottom);a=new ct(l,c,h-l,u-c)}i.push(a)}),ct.from(...i)},render:(i,s)=>{r.paths.forEach((n,o)=>{if(ZA({ctx:i,path:n,fontSize:s.computedStyle.fontSize,clipRect:t[o]}),s.debug){const a=new We([n]).getBoundingBox();a&&i.strokeRect(a.x,a.y,a.width,a.height)}})}}}function UI(r,t){return`<svg width="${r*2}" height="${r*2}" xmlns="http://www.w3.org/2000/svg">
|
|
865
|
-
<circle cx="${
|
|
866
|
-
</svg>`}function NI(){const r=new We;return{name:"listStyle",pathSet:r,update:t=>{r.paths.length=0;const{paragraphs:e,isVertical:A,fontSize:i}=t,s=i*.45;e.forEach(n=>{const{computedStyle:o}=n,{color:a,listStyleImage:l,listStyleColormap:c,listStyleSize:h,listStyleType:u}=o,d=Mn(c);let f=h,B;if(!lt(l))B=l;else if(!lt(u)){const m=i*.38/2;switch(f=f==="cover"?m*2:f,u){case"disc":B=UI(m,String(a));break}}if(!B)return;const p=Ls(B),D=p.getBoundingBox(),R=n.fragments[0]?.characters[0];if(!R)return;const{inlineBox:w}=R,S=f==="cover"?1:Sn(f,{total:i,fontSize:i})/i,Q=new Lt;if(A){const m=i/D.height*S;Q.translate(-D.left,-D.top).rotate(Math.PI/2).scale(m,m).translate(w.left+(w.width-D.height*m)/2,w.top-s)}else{const m=i/D.height*S;Q.translate(-D.left,-D.top).scale(m,m).translate(w.left-D.width*m-s,w.top+(w.height-D.height*m)/2)}r.paths.push(...p.paths.map(m=>{const x=m.clone();return x.applyTransform(Q),x.style.fill&&x.style.fill in d&&(x.style.fill=d[x.style.fill]),x.style.stroke&&x.style.stroke in d&&(x.style.stroke=d[x.style.stroke]),x}))})}}}function FI(){return{name:"outline"}}const uA=new G,ti=new Lt,fA=new Lt;function TI(){const r=new We;return{name:"render",pathSet:r,update:t=>{r.paths.length=0;const{paragraphs:e}=t;e.forEach(A=>{A.fragments.forEach(i=>{i.characters.forEach(s=>{r.paths.push(s.path)})})})},getBoundingBox:t=>{const{characters:e,fontSize:A,effects:i}=t,s=[];return e.forEach(n=>{i?.forEach(o=>{if(!n.glyphBox)return;const a=n.glyphBox.clone(),l=Pn(t,o);uA.set(a.left,a.top),uA.applyMatrix3(l),a.left=uA.x,a.top=uA.y,uA.set(a.right,a.bottom),uA.applyMatrix3(l),a.width=uA.x-a.left,a.height=uA.y-a.top;const c=(o.shadowOffsetX??0)*A,h=(o.shadowOffsetY??0)*A,u=Math.max(.1,o.textStrokeWidth??0)*A;a.left+=c-u,a.top+=h-u,a.width+=u*2,a.height+=u*2,s.push(a)})}),s.length?ct.from(...s):void 0},render:(t,e)=>{const{paragraphs:A,glyphBox:i,effects:s}=e;s?s.forEach(n=>{Nr(n,i,t),t.save();const[o,a,l,c,h,u]=Pn(e,n).transpose().elements;t.transform(o,c,a,h,l,u),e.forEachCharacter(d=>{d.drawTo(t,n)}),t.restore()}):A.forEach(n=>{n.fragments.forEach(o=>{o.characters.forEach(a=>{a.drawTo(t)})})}),e.debug&&A.forEach(n=>{t.strokeRect(n.lineBox.x,n.lineBox.y,n.lineBox.width,n.lineBox.height)})}}}function Pn(r,t){const{fontSize:e,glyphBox:A}=r,i=(t.translateX??0)*e,s=(t.translateY??0)*e,n=Math.PI*2,o=(t.skewX??0)/360*n,a=(t.skewY??0)/360*n,{left:l,top:c,width:h,height:u}=A,d=l+h/2,f=c+u/2;return ti.identity(),fA.makeTranslation(i,s),ti.multiply(fA),fA.makeTranslation(d,f),ti.multiply(fA),fA.set(1,Math.tan(o),0,Math.tan(a),1,0,0,0,1),ti.multiply(fA),fA.makeTranslation(-d,-f),ti.multiply(fA),ti.clone()}function LI(){const r=new We;return{name:"textDecoration",pathSet:r,update:t=>{r.paths.length=0;const e=[];let A,i;t.forEachCharacter(s=>{const{computedStyle:n,isVertical:o,inlineBox:a,underlinePosition:l,underlineThickness:c,strikeoutPosition:h,strikeoutSize:u}=s,{color:d,textDecoration:f,writingMode:B}=n;if(lt(f))i=void 0;else{let p=!1;if(i?.textDecoration===f&&i?.writingMode===B&&i?.color===d&&(o?A[0].inlineBox.left===a.left:A[0].inlineBox.top===a.top))switch(f){case"underline":A[0].underlinePosition===l&&A[0].underlineThickness===c&&(p=!0);break;case"line-through":A[0].strikeoutPosition===h&&A[0].strikeoutSize===u&&(p=!0);break}p?A.push(s):(A=[],A.push(s),e.push(A)),i=n}}),e.forEach(s=>{const{computedStyle:n,isVertical:o,underlinePosition:a,underlineThickness:l,strikeoutPosition:c,strikeoutSize:h}=s[0],{color:u,textDecoration:d}=n,f=ct.from(...s.map(x=>x.inlineBox)),{left:B,top:p,width:D,height:R}=f;let w=o?B+D:p;const S=o?-1:1;let Q=0;switch(d){case"overline":Q=l*2;break;case"underline":w+=S*a,Q=l*2;break;case"line-through":w+=S*c,Q=h*2;break}w-=Q;let m;o?m=new kt([{type:"M",x:w,y:p},{type:"L",x:w,y:p+R},{type:"L",x:w+Q,y:p+R},{type:"L",x:w+Q,y:p},{type:"Z"}],{fill:u}):m=new kt([{type:"M",x:B,y:w},{type:"L",x:B+D,y:w},{type:"L",x:B+D,y:w+Q},{type:"L",x:B,y:w+Q},{type:"Z"}],{fill:u}),r.paths.push(m)})},render:(t,e)=>{const{effects:A,computedStyle:i}=e;A?A.forEach(s=>{t.save();const[n,o,a,l,c,h]=Pn(e,s).transpose().elements;t.transform(n,l,o,c,a,h),r.paths.forEach(u=>{ZA({ctx:t,path:u,fontSize:i.fontSize,...s})}),t.restore()}):r.paths.forEach(s=>{ZA({ctx:t,path:s,fontSize:i.fontSize})})}}}var GI=Object.defineProperty,dA=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&GI(t,e,i),i};const ql=Do();class $e extends Je{needsUpdate=!0;computedStyle={...ql};paragraphs=[];lineBox=new ct;rawGlyphBox=new ct;glyphBox=new ct;pathBox=new ct;boundingBox=new ct;measurer=new Fr;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:A,style:i,measureDom:s,fonts:n,fill:o,outline:a}=So(t);this.debug=t.debug??!1,this.content=e,this.effects=A,this.style=i,this.measureDom=s,this.fonts=n,this.fill=o,this.outline=a,this.use(kI()).use(FI()).use(NI()).use(LI()).use(PI()).use(TI()),(t.plugins??[]).forEach(l=>{this.use(l)}),this.updateParagraphs()}onUpdateProperty(t,e,A,i){this.emit("updateProperty",t,e,A,i)}use(t){return this.plugins.set(t.name,t),this}forEachCharacter(t){return this.paragraphs.forEach((e,A)=>{e.fragments.forEach((i,s)=>{i.characters.forEach((n,o)=>{t(n,{paragraphIndex:A,fragmentIndex:s,characterIndex:o})})})}),this}async load(){await Promise.all(Array.from(this.plugins.values()).map(t=>t.load?.(this)))}updateParagraphs(){this.computedStyle={...ql,...this.style};const{content:t}=this,e=[];return t.forEach(A=>{const{fragments:i,fill:s,outline:n,...o}=A,a=new RI(o,this);a.fill=s,a.outline=n,i.forEach(l=>{const{content:c,fill:h,outline:u,...d}=l;if(c!==void 0){const f=a.addFragment(c,d);f.fill=h,f.outline=u}}),e.push(a)}),this.paragraphs=e,this}createDom(){return this.updateParagraphs(),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.updateParagraphs();const A=this.measurer.measure(this.paragraphs,this.computedStyle,t);this.paragraphs=A.paragraphs,this.lineBox=A.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)A[i]=this[i],this[i]=e[i];return this.emit("measure",{text:this,result:A}),A}getGlyphBox(){const t=G.MAX,e=G.MIN;return this.characters.forEach(A=>{if(!A.getGlyphMinMax(t,e)){const{inlineBox:i}=A,{left:s,top:n,width:o,height:a}=i,l=new G(s,n),c=new G(s+o,n+a);t.min(l,c),e.max(l,c)}}),new ct(t.x,t.y,e.x-t.x,e.y-t.y)}updatePathBox(){return this.pathBox=ct.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=ct.from(this.rawGlyphBox,this.lineBox,this.pathBox),this}requestUpdate(){return this.needsUpdate=!0,this}update(t=this.measureDom){const e=this.measure(t);for(const A in e)this[A]=e[A];return this.emit("update",{text:this}),this.needsUpdate=!1,this}render(t){const{view:e,pixelRatio:A=2}=t,i=e.getContext("2d");i&&(this.needsUpdate&&this.update(),mI(i,A,this.boundingBox),wI(i,this),Array.from(this.plugins.values()).sort((s,n)=>(s.renderOrder??0)-(n.renderOrder??0)).forEach(s=>{if(s.render)s.render?.(i,this);else if(s.pathSet){const n=this.computedStyle;s.pathSet.paths.forEach(o=>{ZA({ctx:i,path:o,fontSize:n.fontSize})})}}),this.emit("render",{text:this,view:e,pixelRatio:A}),t.onContext?.(i))}toString(){return this.content.flatMap(t=>t.fragments.map(e=>e.content)).join("")}}dA([v()],$e.prototype,"debug"),dA([v()],$e.prototype,"content"),dA([v()],$e.prototype,"style"),dA([v()],$e.prototype,"effects"),dA([v()],$e.prototype,"fill"),dA([v()],$e.prototype,"outline"),dA([v()],$e.prototype,"measureDom"),dA([v()],$e.prototype,"fonts");var OI=Object.defineProperty,kA=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&OI(t,e,i),i};class tA extends sA{constructor(t){super(),this.parent=t,this.base.on("updateProperty",(...e)=>{switch(e[0]){case"content":case"effects":case"fill":case"outline":this.setter(e[0],e[1]);break}this._updateProperty(...e)})}base=new $e;measureResult;setProperties(t){return super.setProperties(lt(t)?void 0:So(t))}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"enabled":case"content":case"effects":case"measureDom":case"fonts":case"fill":case"outline":this.parent.requestRedraw();break}}setContent(t){this.content=ps(t)}measure(){return this.base.style={justifyContent:"center",alignItems:"center",textAlign:"center",...this.parent.style.toJSON()},this.base.requestUpdate(),this.base.measure()}updateMeasure(){return this.measureResult=this.measure(),this}canDraw(){return!!(this.enabled&&!/^\s*$/.test(this.base.toString()))}draw(){const t=this.parent.context;this.base.update(),this.base.pathSets.forEach(e=>{e.paths.forEach(A=>{t.addPath(A),t.style={...A.style},t.fill()})})}}kA([v({fallback:!0})],tA.prototype,"enabled"),kA([v({alias:"base.content",fallback:()=>[]})],tA.prototype,"content"),kA([v({alias:"base.effects"})],tA.prototype,"effects"),kA([v({alias:"base.fill"})],tA.prototype,"fill"),kA([v({alias:"base.outline"})],tA.prototype,"outline"),kA([v({protected:!0,alias:"base.measureDom"})],tA.prototype,"measureDom"),kA([v({protected:!0,alias:"base.fonts"})],tA.prototype,"fonts");var HI=Object.getOwnPropertyDescriptor,JI=(r,t,e,A)=>{for(var i=A>1?void 0:A?HI(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};g.BaseElement2D=class extends g.Node2D{size=new Mt().on("update",()=>{this.updateGlobalTransform(),this.requestRedraw()});get style(){return this._style}set style(t){const e=(...A)=>{this.emit("updateStyleProperty",...A),this._updateStyleProperty(A[0],A[1],A[2],A[3])};t.on("updateProperty",e),this._style?.off("updateProperty",e),this._style=t}_background=new An(this);get background(){return this._background}set background(t){this._background.resetProperties().setProperties(t)}_shape=new bA(this);get shape(){return this._shape}set shape(t){this._shape.resetProperties().setProperties(t)}_fill=new Vt(this);get fill(){return this._fill}set fill(t){this._fill.resetProperties().setProperties(t)}_outline=new vA(this);get outline(){return this._outline}set outline(t){this._outline.resetProperties().setProperties(t)}_foreground=new rn(this);get foreground(){return this._foreground}set foreground(t){this._foreground.resetProperties().setProperties(t)}_text=new tA(this);get text(){return this._text}set text(t){this._text.resetProperties().setProperties(t)}_shadow=new _A(this);get shadow(){return this._shadow}set shadow(t){this._shadow.resetProperties().setProperties(t)}constructor(t,e=[]){super(),this._updateStyleProperty=this._updateStyleProperty.bind(this),this.style=new Si,this.setProperties(t).append(e)}setProperties(t){if(t){const{style:e,text:A,shape:i,background:s,fill:n,outline:o,foreground:a,shadow:l,...c}=t;e&&this.style.setProperties(e),s&&this.background.setProperties(s),i&&this.shape.setProperties(i),n&&this.fill.setProperties(n),o&&this.outline.setProperties(o),A&&this.text.setProperties(A),a&&this.foreground.setProperties(a),l&&this.shadow.setProperties(l),super.setProperties(c)}return this}_updateStyleProperty(t,e,A,i){switch(t){case"rotate":this.rotation=this.style.rotate*Zo;break;case"scaleX":this.scale.x=this.style.scaleX;break;case"scaleY":this.scale.y=this.style.scaleY;break;case"skewX":this.skew.x=this.style.skewX;break;case"skewY":this.skew.y=this.style.skewY;break;case"transform":case"transformOrigin":this.updateGlobalTransform();break;case"opacity":this.opacity=this.style.opacity;break;case"visibility":this.visible=this.style.visibility==="visible";break;case"filter":this.requestRepaint();break;case"maskImage":this._updateMaskImage();break;case"backgroundColor":this.background.color=this.style.backgroundColor;break;case"backgroundImage":this.background.image=this.style.backgroundImage;break;case"borderStyle":case"outlineStyle":this.outline.style=e;break;case"borderWidth":case"outlineWidth":this.outline.width=e;break;case"borderColor":case"outlineColor":this.outline.color=e;break;case"borderRadius":default:this.requestRedraw();break}}_updateMaskImage(){const t="__$style.maskImage",e=this.style.maskImage;if(e&&e!=="none"){const A=this.getNode(t);A?A.src=e:this.appendChild(new g.MaskEffect({name:t,src:e}),"back")}else{const A=this.getNode(t);A&&this.removeChild(A)}}getTransformOrigin(){const{width:t,height:e}=this.size,[A,i]=tl(this.style.transformOrigin);return new Mt(A*t,i*e)}updateTransform(t){const{width:e,height:A}=this.size;super.updateTransform(i=>{$a(this.style.transform??"",e,A,i),t?.(i)})}updateGlobalTransform(){super.updateGlobalTransform(),this._updateOverflow()}getRect(){return this.getGlobalAabb()}_getPointArray(){const{width:t,height:e}=this.size,A=0,i=0,s=A+t,n=i+e;return[{x:A,y:i},{x:A,y:n},{x:s,y:i},{x:s,y:n}]}getAabb(){return new nA(this._getPointArray().map(t=>this.transform.apply(t)))}getGlobalAabb(){return new nA(this._getPointArray().map(t=>this.globalTransform.apply(t)))}getObb(){const t=this.getTransformOrigin(),e=this.transform.apply(t).sub(t);return{rect:new nA(this._getPointArray().map(A=>(A.x+=e.x,A.y+=e.y,A))),rotation:this.rotation}}getGlobalObb(){const t=this.getTransformOrigin(),e=this.globalTransform.apply(t).sub(t);return{rect:new nA(this._getPointArray().map(A=>(A.x+=e.x,A.y+=e.y,A))),rotation:this.globalRotation}}_updateOverflow(){this.style.overflow==="hidden"?this.mask=this.getRect().toJSON():this.mask=void 0}_draw(){super._draw(),this._text.canDraw()&&this._text.updateMeasure(),this._background.canDraw()&&(this._tree?.log(this.name,"background drawing"),this._background.fillWithShape?this._shape.draw():this._shape.drawRect(),this._background.draw()),this._fill.canDraw()&&(this._tree?.log(this.name,"fill drawing"),this._shape.draw(),this._fill.draw()),this._outline.canDraw()&&(this._tree?.log(this.name,"outline drawing"),this._shape.draw(),this._outline.draw()),this._foreground.canDraw()&&(this._tree?.log(this.name,"foreground drawing"),this._foreground.fillWithShape?this._shape.draw():this._shape.drawRect(),this._foreground.draw()),this._text.canDraw()&&(this._tree?.log(this.name,"text drawing"),this._text.draw()),this._drawContent()}_drawContent(){}_repaint(t){return super._repaint(t).map(e=>({...e}))}canPointerEvents(){return this.style.pointerEvents!=="none"}input(t,e){const A=this._children.internal;for(let i=A.length-1;i>=0;i--)A[i].input(t,e);this.isVisibleInTree()&&this._input(t,e)}_positionInput(t,e){const{width:A,height:i}=this.size;return t.x>=0&&t.x<A&&t.y>=0&&t.y<i}_input(t,e){switch(e){case"pointerdown":case"pointermove":case"pointerup":{if(this.canPointerEvents()){const{screenX:A,screenY:i}=t;if(A&&i){const s=new Mt(A,i),n=this.getViewport();n&&n.toCanvasGlobal(s,s),this.toLocal(s,s),this._positionInput(s,e)&&(t.target||(t.target=this),this.emit(e,t))}}break}}}toJSON(){const t=e=>Object.keys(e).length>0?e:void 0;return ae({...super.toJSON(),style:t(this.style.toJSON()),background:t(this.background.toJSON()),shape:t(this.shape.toJSON()),fill:t(this.fill.toJSON()),outline:t(this.outline.toJSON()),text:t(this.text.toJSON()),foreground:t(this.foreground.toJSON()),shadow:t(this.shadow.toJSON())})}},g.BaseElement2D=JI([st("BaseElement2D")],g.BaseElement2D);class Un extends Si{constructor(t){super(),this.setProperties(t)}}const Xl={left:0,top:0,width:0,height:0};for(const r in Xl)er(Un,r,{fallback:Xl[r]});class jl extends Si{constructor(t){super(),this.setProperties(t)}}var KI=Object.getOwnPropertyDescriptor,YI=(r,t,e,A)=>{for(var i=A>1?void 0:A?KI(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};g.Element2D=class extends g.BaseElement2D{get style(){return this._style}set style(t){const e=(...A)=>{this.emit("updateStyleProperty",...A),this._updateStyleProperty(A[0],A[1],A[2],A[3])};t.on("updateProperty",e),this._style?.off("updateProperty",e),this._style=t}constructor(t,e=[]){super(),this.style=new Un,this.setProperties(t).append(e)}_updateStyleProperty(t,e,A,i){switch(super._updateStyleProperty(t,e,A,i),t){case"left":this.position.x=Number(e);break;case"top":this.position.y=Number(e);break;case"width":this.size.width=Number(e);break;case"height":this.size.height=Number(e);break}switch(t){case"width":case"height":this.mask instanceof g.BaseElement2D&&(this.mask.size.width=this.size.width,this.mask.size.height=this.size.height);break}}},g.Element2D=YI([st("Element2D")],g.Element2D);const xt={left:0,top:1,right:2,bottom:3,start:4,end:5,horizontal:6,vertical:7,all:8},Zl={column:0,row:1,all:2},PA={auto:0,"flex-start":1,center:2,"flex-end":3,stretch:4,baseline:5,"space-between":6,"space-around":7,"space-evenly":8},Nn={flex:0,none:1,contents:2},Tr={inherit:0,ltr:1,rtl:2},Fn={column:0,"column-reverse":1,row:2,"row-reverse":3},Tn={"no-wrap":0,wrap:1,"Wrap-reverse":2},Ln={"flex-start":0,center:1,"flex-end":2,"space-between":3,"space-around":4,"space-evenly":5},Gn={visible:0,hidden:1,scroll:2},On={static:0,relative:1,absolute:2},Hn={"border-box":0,"content-box":1};class Lr{constructor(t){this._element=t}static _yoga;static async load(){const{loadYoga:t}=await Promise.resolve().then(()=>oE);this._yoga=await t()}_node=Lr._yoga.Node.create();get _style(){return this._element.style}get offsetLeft(){return this._node.getComputedLeft()}get offsetTop(){return this._node.getComputedTop()}get offsetWidth(){return this._node.getComputedWidth()}get offsetHeight(){return this._node.getComputedHeight()}calculateLayout(t,e,A){return this._node.calculateLayout(t,e,A)}getComputedLayout(){return this._node.getComputedLayout()}updateStyleProperty(t,e,A,i){switch(t){case"alignContent":this._node.setAlignContent(e?PA[e]:PA["flex-start"]);break;case"alignItems":this._node.setAlignItems(e?PA[e]:PA["flex-start"]);break;case"alignSelf":this._node.setAlignSelf(e?PA[e]:PA["flex-start"]);break;case"aspectRatio":this._node.setAspectRatio(e);break;case"borderTop":this._node.setBorder(xt.top,this._style.borderWidth);break;case"borderBottom":this._node.setBorder(xt.bottom,this._style.borderWidth);break;case"borderLeft":this._node.setBorder(xt.left,this._style.borderWidth);break;case"borderRight":this._node.setBorder(xt.right,this._style.borderWidth);break;case"border":this._node.setBorder(xt.all,this._style.borderWidth);break;case"direction":this._node.setDirection(e?Tr[e]:Tr.inherit);break;case"display":this._node.setDisplay(e?Nn[e]:Nn.flex);break;case"flex":this._node.setFlex(this._style.flex);break;case"flexBasis":this._node.setFlexBasis(this._style.flexBasis);break;case"flexDirection":this._node.setFlexDirection(e?Fn[e]:Fn.row);break;case"flexGrow":this._node.setFlexGrow(this._style.flexGrow);break;case"flexShrink":this._node.setFlexShrink(this._style.flexShrink);break;case"flexWrap":this._node.setFlexWrap(e?Tn[e]:Tn.wrap);break;case"height":this._node.setHeight(this._style.height);break;case"justifyContent":this._node.setJustifyContent(e?Ln[e]:Ln["flex-start"]);break;case"gap":e!==void 0&&this._node.setGap(Zl.all,e);break;case"marginTop":this._node.setMargin(xt.top,e);break;case"marginBottom":this._node.setMargin(xt.bottom,e);break;case"marginLeft":this._node.setMargin(xt.left,e);break;case"marginRight":this._node.setMargin(xt.right,e);break;case"margin":this._node.setMargin(xt.all,e);break;case"maxHeight":this._node.setMaxHeight(e);break;case"maxWidth":this._node.setMaxWidth(e);break;case"minHeight":this._node.setMinHeight(this._style.minHeight);break;case"minWidth":this._node.setMinWidth(this._style.minWidth);break;case"overflow":this._node.setOverflow(e?Gn[e]:Gn.visible);break;case"paddingTop":this._node.setPadding(xt.top,this._style.paddingTop);break;case"paddingBottom":this._node.setPadding(xt.bottom,this._style.paddingBottom);break;case"paddingLeft":this._node.setPadding(xt.left,this._style.paddingLeft);break;case"paddingRight":this._node.setPadding(xt.right,this._style.paddingRight);break;case"padding":this._node.setPadding(xt.all,this._style.padding);break;case"top":this._node.setPosition(xt.top,this._style.top);break;case"bottom":this._node.setPosition(xt.bottom,this._style.bottom);break;case"left":this._node.setPosition(xt.left,this._style.left);break;case"right":this._node.setPosition(xt.right,this._style.right);break;case"position":this._node.setPositionType(e?On[e]:On.static);break;case"boxSizing":this._node.setBoxSizing(e?Hn[e]:Hn["content-box"]);break;case"width":this._node.setWidth(this._style.width);break}}}var VI=Object.getOwnPropertyDescriptor,WI=(r,t,e,A)=>{for(var i=A>1?void 0:A?VI(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};g.FlexElement2D=class extends g.BaseElement2D{get style(){return this._style}set style(t){const e=(...A)=>{this.emit("updateStyleProperty",...A),this._updateStyleProperty(A[0],A[1],A[2],A[3])};t.on("updateProperty",e),this._style?.off("updateProperty",e),this._style=t}_layout=new Lr(this);get offsetLeft(){return this._layout.offsetLeft}get offsetTop(){return this._layout.offsetTop}get offsetWidth(){return this._layout.offsetWidth}get offsetHeight(){return this._layout.offsetHeight}constructor(t,e=[]){super(),this.style=new jl,this.setProperties(t).append(e)}_parented(t){super._parented(t),t._layout&&this._layout._node&&t._layout._node.insertChild(this._layout._node,t._layout._node.getChildCount())}_unparented(t){super._unparented(t),t._layout?._node&&t._layout._node.removeChild(this._layout._node)}_updateStyleProperty(t,e,A,i){super._updateStyleProperty(t,e,A,i),this._layout.updateStyleProperty(t,e,A,i),this._layout._node.isDirty()&&this.requestRelayout()}updateTransform(){this.calculateLayout(void 0,void 0,Tr.ltr);const{left:t,top:e,width:A,height:i}=this._layout.getComputedLayout();this.position.x=t,this.position.y=e,this.size.x=A,this.size.y=i,super.updateTransform()}calculateLayout(t,e,A){const i=this.getParent();i?._layout?.calculateLayout?i?._layout.calculateLayout(t,e,A):this._layout.calculateLayout(t,e,A)}},g.FlexElement2D=WI([st("FlexElement2D")],g.FlexElement2D);var zI=Object.defineProperty,qI=Object.getOwnPropertyDescriptor,Ki=(r,t,e,A)=>{for(var i=A>1?void 0:A?qI(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&zI(t,e,i),i};g.Image2D=class extends g.Element2D{get currentFrameTexture(){return this.texture?.frames[this._frameIndex]?.texture}get textureDuration(){return this.texture?.duration??0}get naturalWidth(){return this.currentFrameTexture?.realWidth??0}get naturalHeight(){return this.currentFrameTexture?.realHeight??0}get complete(){return this._complete}_frameIndex=0;_complete=!1;_wait=Promise.resolve();constructor(t,e=[]){super(),this.setProperties(t),this.append(e)}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"src":this._wait=this._load(e);break;case"srcRect":this.requestRedraw();break}}decode(){return this._wait}setResource(t){let e;if(t instanceof dr?e=t:e=new dr(t),this.texture=e.updateDuration(),this.currentFrameTexture&&(!this.style.width||!this.style.height)){const A=this.currentFrameTexture;this.style.width=A.realWidth,this.style.height=A.realHeight}return this}async _load(t){if(this._complete=!1,t)try{this.setResource(this.gif||t?.includes(".gif")?await Fe.gif.load(t):await Fe.texture.load(t)),this.requestRedraw(),this.emit("load")}catch(e){console.warn(e),this.emit("error",e)}else this.texture=void 0;this._complete=!0}_getFrameCurrentTime(){const t=this.textureDuration;if(!t||!this._tree)return 0;const e=this._currentTime;return e<0?0:e%t}_updateFrameIndex(){if(!this.texture)return this;const t=this._getFrameCurrentTime(),e=this.texture.frames,A=e.length;if(A<=1&&this._frameIndex===0)return this;let i=A-1;for(let s=0,n=0;n<A;n++)if(s+=e[n].duration??0,s>=t){i=n;break}return this._frameIndex!==i&&(this._frameIndex=i,this.requestRedraw()),this}_process(t){this._updateFrameIndex(),super._process(t)}_drawContent(){const t=this.currentFrameTexture;if(t?.valid){const{left:e=0,top:A=0,right:i=0,bottom:s=0}=this.srcRect??{},{width:n,height:o}=this.size;this.context.fillStyle=t;const a=Math.abs(1+(e+i))*n,l=Math.abs(1+(A+s))*o,c=1/a,h=1/l,u=e*n*c,d=A*o*h;this.context.uvTransform=new Yt().scale(c,h).translate(u,d),this.shape.draw(),this.context.fill()}}_repaint(t){return super._repaint(t).map(e=>({...e,disableWrapMode:!0}))}},Ki([v({protected:!0})],g.Image2D.prototype,"texture",2),Ki([v({fallback:""})],g.Image2D.prototype,"src",2),Ki([v()],g.Image2D.prototype,"srcRect",2),Ki([v({fallback:!1})],g.Image2D.prototype,"gif",2),g.Image2D=Ki([st("Image2D")],g.Image2D);class Jn extends g.Element2D{texture;constructor(t,e=[]){super(),this.setProperties(t).append(e)}_drawContent(){if(this.texture?.valid){const{width:t,height:e}=this.size;this.context.fillStyle=this.texture,this.context.uvTransform=new Yt().scale(1/t,1/e),this.shape.drawRect(),this.context.fill()}}}var XI=Object.defineProperty,jI=Object.getOwnPropertyDescriptor,$l=(r,t,e,A)=>{for(var i=A>1?void 0:A?jI(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&XI(t,e,i),i};g.Lottie2D=class extends Jn{texture=new Ir;animation;constructor(t,e=[]){super(),this.setProperties(t),this.append(e)}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"src":this._load();break}}_updateStyleProperty(t,e,A){switch(super._updateStyleProperty(t,e,A),t){case"width":this.texture.width=this.style.width;break;case"height":this.texture.height=this.style.height;break}}async _load(){this.animation=await Fe.lottie.load(this.src,this.texture.source),this.duration=this.animation.getDuration(!1)*1e3,this.texture.requestUpload(),this.requestRedraw()}_process(t){this.animation?.goToAndStop(this.currentTime,!1),this.texture.requestUpload(),this.requestRedraw(),super._process(t)}},$l([v({fallback:""})],g.Lottie2D.prototype,"src",2),g.Lottie2D=$l([st("Lottie2D")],g.Lottie2D);var ZI=Object.defineProperty,$I=(r,t,e,A)=>{for(var i=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(t,e,i)||i);return i&&ZI(t,e,i),i};class Kn extends g.Element2D{constructor(t,e=[]){super(),this.setProperties(t).append(e)}_updateStyleProperty(t,e,A,i){switch(super._updateStyleProperty(t,e,A,i),t){case"width":case"height":this.requestRedraw();break}}_drawCircle(t,e){this.context.arc(t,e,this.handleSize,0,Math.PI*2,!0),this.context.fillStyle=yt.WHITE,this.context.fill(),this.context.arc(t,e,this.handleSize,0,Math.PI*2,!0),this.context.strokeStyle="rgba(0, 0, 0, 0.2)",this.context.stroke()}_drawEllipse(t,e){this.context.roundRect(t-this.handleSize,e-this.handleSize*2,this.handleSize*2,this.handleSize*4,this.handleSize),this.context.fillStyle=yt.WHITE,this.context.fill(),this.context.roundRect(t-this.handleSize,e-this.handleSize*2,this.handleSize*2,this.handleSize*4,this.handleSize),this.context.strokeStyle="rgba(0, 0, 0, 0.2)",this.context.stroke()}_draw(){const{width:t,height:e}=this.getRect();this.context.rect(0,0,t,e),this.context.strokeStyle="#00FF00",this.context.stroke(),this._drawCircle(0,0),this._drawCircle(t,e),this._drawCircle(0,e),this._drawEllipse(0,e/2),this._drawCircle(t,0),this._drawEllipse(t,e/2)}}$I([v({fallback:6})],Kn.prototype,"handleSize");var tp=Object.defineProperty,ep=Object.getOwnPropertyDescriptor,tc=(r,t,e,A)=>{for(var i=A>1?void 0:A?ep(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&tp(t,e,i),i};g.Video2D=class extends Jn{get videoDuration(){return(this.texture?.duration??0)*1e3}_wait=Promise.resolve();constructor(t,e=[]){super(),this.setProperties(t),this.append(e)}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"src":this._wait=this._load(e);break}}waitLoad(){return this._wait}async _load(t){this.texture=await Fe.video.load(t),(!this.style.width||!this.style.height)&&(this.style.width=this.texture.width,this.style.height=this.texture.height),this.requestRedraw()}_updateVideoCurrentTime(){let t=this._currentTime;if(t<0)return;const e=this.texture;if(!e)return;const A=e.duration;t=A?t%(A*1e3):0,!e.isPlaying&&!e.seeking&&(t=~~t/1e3,e.currentTime!==t&&(e.currentTime=t))}_process(t){this._updateVideoCurrentTime(),super._process(t)}},tc([v({fallback:""})],g.Video2D.prototype,"src",2),g.Video2D=tc([st("Video2D")],g.Video2D);var Ap=Object.defineProperty,ip=Object.getOwnPropertyDescriptor,Yi=(r,t,e,A)=>{for(var i=A>1?void 0:A?ip(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&Ap(t,e,i),i};const ec=r=>r,Ac=ei(.25,.1,.25,1),ic=ei(.42,0,1,1),rc=ei(0,0,.58,1),sc=ei(.42,0,.58,1);function ei(r,t,e,A){const s=3*r-3*e+1,n=3*e-6*r,o=3*r,a=3*t-3*A+1,l=3*A-6*t,c=3*t,h=B=>(3*s*B+2*n)*B+o,u=B=>((s*B+n)*B+o)*B,d=B=>((a*B+l)*B+c)*B;function f(B){let p=B,D,R;for(let Q=0;Q<8;Q++){if(R=u(p)-B,Math.abs(R)<1e-6)return p;if(D=h(p),Math.abs(D)<1e-6)break;p-=R/D}let w=1,S=0;for(p=B;w>S;){if(R=u(p)-B,Math.abs(R)<1e-6)return p;R>0?w=p:S=p,p=(w+S)/2}return p}return B=>d(f(B))}const Gr={linear:ec,ease:Ac,easeIn:ic,easeOut:rc,easeInOut:sc};g.Animation=class extends g.TimelineNode{_keyframes=[];_isFirstUpdatePosition=!1;_cachedProps=new Qo;_stoped=!1;constructor(t,e=[]){super(),this.setProperties(t).append(e)}_parented(t){super._parented(t),this._updateCachedProps()}_unparented(t){super._unparented(t),this.cancel()}_process(){this.canProcess()&&this.commitStyles()}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"effectMode":case"keyframes":this._updateKeyframes();break}}_getTargets(){let t;switch(this.effectMode){case"sibling":t=this.getParent()?.children.internal.filter(e=>e instanceof g.CanvasItem)??[];break;case"parent":default:t=[this.getParent()].filter(Boolean);break}return t.map(e=>e.style)}_updateKeyframes(){const t=[],e=this.keyframes;for(let s=e.length,n=0;n<s;n++){const{offset:o=n===0?0:n/(s-1),easing:a="linear",...l}=e[n];t.push({offset:o,easing:this._parseEasing(a),props:l})}const A=t[0],i=t[t.length-1];A&&A.offset!==0&&t.unshift({offset:0,easing:this._parseEasing("linear"),props:{}}),i&&i.offset!==1&&t.push({offset:1,easing:this._parseEasing("linear"),props:{}}),this._keyframes=t,this._updateCachedProps()}commitStyles(){if(!this.keyframes.length)return;if(this._updateCurrentTime(),this.isInsideTimeRange())this._isFirstUpdatePosition||(this._isFirstUpdatePosition=!0,this._updateCachedProps());else{if(!this._isFirstUpdatePosition)return;this._isFirstUpdatePosition=!1}const t=this._getTargets(),e=1/t.length,A=this.currentTimeProgress;t.forEach((i,s)=>{const n=e===1?A:le(Math.max(0,A-e*s)/e,0,1),o=this._cachedProps.get(i);if(!o)return;const a=this._parseKeyframes(n,o);a?.length&&this._commitStyle(n,i,o,a[0],a[1])})}_updateCachedProps(){this.cancel(),this._getTargets().forEach(t=>{const e=new Map,A=this._keyframes;for(let i=A.length,s=0;s<i;s++)Object.keys(A[s].props).forEach(n=>{e.set(n,t[n])});this._cachedProps.set(t,e)})}_parseEasing(t){if(!t)return Gr.linear;if(t in Gr)return Gr[t];const e=t.replace(/cubic-bezier\((.+)\)/,"$1").split(",").map(A=>Number(A));return ei(e[0],e[1],e[2],e[3])}_parseKeyframes(t,e){let A;const i=this._keyframes;for(let s=i.length,n=0;n<s;n++){const o=i[n],{offset:a,easing:l}=o,c={...o.props};if(A&&t<=a){const{offset:h,easing:u}=A,d={...A.props};return e.forEach((f,B)=>{(!(B in d)||d[B]===null)&&(d[B]=f),(!(B in c)||c[B]===null)&&(c[B]=f)}),[{offset:h,easing:u,props:d},{offset:a,easing:l,props:c}]}A=o}return null}_commitStyle(t,e,A,i,s){const{offset:n,easing:o,props:a}=i,{offset:l,props:c}=s,h=l-n,u=o((t-n)/h),d={width:e.width,height:e.height,fontSize:e.fontSize};A.forEach((f,B)=>{e[B]=this._getDiffValue(B,a[B],c[B],u,d)})}_getDiffValue(t,e,A,i,s){let n,o;if(e==="none"&&(e=void 0),A==="none"&&(A=void 0),e===void 0||A===void 0)if(e!==void 0)n=oi(t,String(e),s),o=Cs(n);else if(A!==void 0)o=oi(t,String(A),s),n=Cs(o);else return;else n=oi(t,String(e),s),o=oi(t,String(A),s);if(Array.isArray(n)&&Array.isArray(o)){const a=new Set,l={},c={};n.forEach(({name:u,args:d})=>{l[u]=d,a.add(u)}),o.forEach(({name:u,args:d})=>{c[u]=d,a.add(u)});let h="";return a.forEach(u=>{const d=Math.max(l[u]?.length??0,c[u]?.length??0),f=l[u],B=c[u];h+=`${u}(${Array.from({length:d},(p,D)=>{const R=f?.[D],w=B?.[D],S=R?.normalizedIntValue??0,Q=w?.normalizedIntValue??0;return Number.isNaN(S)||Number.isNaN(Q)?w?.value??0:bt(S,Q,i)}).join(", ")}) `}),h}else if(!Array.isArray(n)&&!Array.isArray(o))return Number.isNaN(n.normalizedIntValue)||Number.isNaN(o.normalizedIntValue)?o.value:bt(n.normalizedIntValue,o.normalizedIntValue,i)}isPlaying(){return!this.paused&&this.isInsideTimeRange()}play(){return this._stoped?(this._stoped=!1,this.startTime=this.timelineCurrentTime):this.startTime=this.timelineCurrentTime-this.currentTime,this.paused=!1,!0}pause(){return this.paused=!0,!0}stop(){return this._stoped=!0,this.paused=!0,this._currentTime=0,!0}cancel(){this._getTargets().forEach(t=>{this._cachedProps.get(t)?.forEach((e,A)=>{t[A]=e}),this._cachedProps.delete(t)})}},Yi([v({fallback:"parent"})],g.Animation.prototype,"effectMode",2),Yi([v({fallback:!1})],g.Animation.prototype,"loop",2),Yi([v({default:()=>[]})],g.Animation.prototype,"keyframes",2),Yi([v()],g.Animation.prototype,"easing",2),g.Animation=Yi([st("Animation",{renderMode:"disabled",processMode:"pausable",processSortMode:"parent_before",duration:2e3})],g.Animation);class Or extends Je{static _instance;static get instance(){return this._instance||(this._instance=new Or),this._instance}playbackRate=1;muted=!1;volume=1;paused=!1;refresh(){this.emit("refresh")}refreshPaused(){this.emit("refreshPaused")}get processors(){return console.warn("HTML Audio does not support processors"),[]}set processors(t){console.warn("HTML Audio does not support processors")}get audioContext(){return console.warn("HTML Audio does not support audioContext"),null}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this.paused}free(){this.removeAllListeners()}}class Vi extends Je{static PADDING=.1;_source=null;_audio=null;_end=0;_pausedReal=!1;_duration=0;_start=0;_playing=!1;get progress(){return(this._source?.currentTime??0)/this._duration}_paused=!1;get paused(){return this._paused}set paused(t){this._paused!==t&&(this._paused=t,this.refreshPaused())}_playbackRate=1;get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate!==t&&(this._playbackRate=t,this.refresh())}_volume=1;get volume(){return this._volume}set volume(t){this._volume!==t&&(this._volume=t,this.refresh())}_loop=!1;get loop(){return this._loop}set loop(t){this._loop!==t&&(this._loop=t,this.refresh())}_muted=!1;get muted(){return this._muted}set muted(t){this._muted!==t&&(this._muted=t,this.refresh())}set(t,e){if(this[t]===void 0)throw new Error(`Property with name ${t} does not exist.`);switch(t){case"playbackRate":this.playbackRate=e;break;case"volume":this.volume=e;break;case"paused":this.paused=e;break;case"loop":this.loop=e;break;case"muted":this.muted=e;break}return this}_onPlay(){this._playing=!0}_onPause(){this._playing=!1}init(t){this._playing=!1,this._duration=t.source.duration;const e=this._source=t.source.cloneNode(!1);return e.src=t.parent.src,e.onplay=this._onPlay.bind(this),e.onpause=this._onPause.bind(this),t.context.on("refresh",this.refresh),t.context.on("refreshPaused",this.refreshPaused),this._audio=t,this}_stop(){this._source&&this._playing&&(this._source.onended=null,this._source.pause())}stop(){this._stop(),this._source&&this.emit("stop")}get processors(){return console.warn("HTML Audio does not support processors"),[]}set processors(t){console.warn("HTML Audio does not support processors")}refresh(){if(!this._audio||!this._source)return;const t=this._audio.context,e=this._audio.parent;this._source.loop=this._loop||e.loop;const A=t.volume*(t.muted?0:1),i=e.volume*(e.muted?0:1),s=this._volume*(this._muted?0:1);this._source.volume=s*A*i,this._source.playbackRate=this._playbackRate*t.playbackRate*e.playbackRate}refreshPaused(){if(!this._source||!this._audio)return;const t=this._paused||this._audio.parent.paused||this._audio.context.paused;t!==this._pausedReal&&(this._pausedReal=t,t?(this._stop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,playbackRate:this._playbackRate,loop:this._loop})),this.emit("pause",t))}play(t={}){if(!this._source)return;const{start:e=0,end:A=0}=t;A&&console.assert(A>e,"End time is before start time"),t.playbackRate!==void 0&&(this._playbackRate=t.playbackRate),t.volume!==void 0&&(this._volume=t.volume),t.loop!==void 0&&(this._loop=t.loop),t.muted!==void 0&&(this._muted=t.muted),this.refresh(),this.loop&&A!==null&&(console.warn('Looping not support when specifying an "end" time'),this.loop=!1),this._start=e,this._end=A||this._duration,this._start=Math.max(0,this._start-Vi.PADDING),this._end=Math.min(this._end+Vi.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=e,this._source.onloadedmetadata=null,this.emit("progress",e,this._duration),Kt.on(this._onUpdate))},this._source.onended=this._onComplete.bind(this),this._source.play(),this.emit("start")}_onUpdate=()=>{this._source&&(this.emit("progress",this.progress,this._duration),this._source.currentTime>=this._end&&!this._source.loop&&this._onComplete())};_onComplete(){Kt.off(this._onUpdate),this._stop(),this.emit("progress",1,this._duration),this.emit("end",this)}free(){Kt.off(this._onUpdate),this.removeAllListeners();const t=this._source;t&&(t.onended=null,t.onplay=null,t.onpause=null,this._stop()),this._source=null,this._playbackRate=1,this._volume=1,this._loop=!1,this._end=0,this._start=0,this._duration=0,this._playing=!1,this._pausedReal=!1,this._paused=!1,this._muted=!1,this._audio&&(this._audio.context.off("refresh",this.refresh),this._audio.context.off("refreshPaused",this.refreshPaused),this._audio=null)}}class nc{constructor(t){this.parent=t}source=new globalThis.Audio;_src="";get src(){return this._src}set src(t){this._src!==t&&(this._src=t,this.load())}get duration(){return this.source.duration}get isPlayable(){return!!this.source&&this.source.readyState===4}get context(){return Or.instance}async load(){return new Promise(t=>{this.source.onload=()=>t(this),this.source.src=this._src,this.source.load()})}createSound(){return new Vi}}class Yn extends Je{constructor(t,e){super(),this._input=t,this._output=e}_processers=[];get processors(){return this._processers}set processors(t){if(this._processers.forEach(e=>e.disconnect()),this._processers.length=0,this._input.connect(this._output),t.length){this._processers=t.slice(0),this._input.disconnect();let e;t.forEach(A=>{e?e.connect(A.destination):this._input.connect(A.destination),e=A}),e.connect(this._output)}}get destination(){return this._input}}class rp{constructor(t,e=null){this.destination=t,this.source=e}connect(t){this.source?.connect(t)}disconnect(){this.source?.disconnect()}}function sp(){if(ys)return new AudioContext;if(ms){const r=globalThis.webkitAudioContext;return new r}else throw new Error("Failed to createAudioContext")}function np(r,t,e){if(ws)return new OfflineAudioContext(r,t,e);if(To){const A=globalThis.webkitOfflineAudioContext;return new A(r,t,e)}else throw new Error("Failed to createOfflineAudioContext")}class IA extends Yn{static _instance;static get instance(){return this._instance||(this._instance=new IA),this._instance}static get audioContext(){return this.instance.audioContext}static get offlineContext(){return this.instance.offlineContext}static setParamValue(t,e){this.instance.setParamValue(t,e)}static decode(t){return this.instance.decode(t)}_context;_offlineContext;get audioContext(){return this._context}get offlineContext(){return this._offlineContext}_locked;muted=!1;volume=1;playbackRate=1;autoPause=!0;_paused=!1;_pausedOnBlur=!1;get paused(){return this._paused}set paused(t){t&&this._context.state==="running"?this._context.suspend():!t&&this._context.state==="suspended"&&this._context.resume(),this._paused=t}_compressor;_analyser;constructor(){const t=sp(),e=np(1,2,ws?Math.max(8e3,Math.min(96e3,t.sampleRate)):44100),A=t.createDynamicsCompressor(),i=t.createAnalyser();i.connect(A),A.connect(t.destination),super(i,A),this._context=t,this._offlineContext=e,this._compressor=A,this._analyser=i,this._locked=t.state==="suspended"&&(Ke||Fo),li&&(this._locked&&(this._unlock(),document.addEventListener("mousedown",this._unlock,!0),document.addEventListener("touchstart",this._unlock,!0),document.addEventListener("touchend",this._unlock,!0)),globalThis.addEventListener("focus",this._onFocus),globalThis.addEventListener("blur",this._onBlur))}_onFocus(){if(!this.autoPause)return;const t=this._context.state;(t==="suspended"||t==="interrupted"||!this._locked)&&(this.paused=this._pausedOnBlur,this.refreshPaused())}_onBlur(){this.autoPause&&(this._locked||(this._pausedOnBlur=this._paused,this.paused=!0,this.refreshPaused()))}_unlock=()=>{this._locked&&(this.playEmptySound(),this._context.state==="running"&&(document.removeEventListener("mousedown",this._unlock,!0),document.removeEventListener("touchend",this._unlock,!0),document.removeEventListener("touchstart",this._unlock,!0),this._locked=!1))};playEmptySound(){const t=this._context.createBufferSource();t.buffer=this._context.createBuffer(1,1,22050),t.connect(this._context.destination),t.start(0,0,0),t.context.state==="suspended"&&t.context.resume()}refresh(){this.emit("refresh")}refreshPaused(){this.emit("refreshPaused")}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this._paused}decode(t){return new Promise((e,A)=>{const i=n=>{A(new Error(n?.message||"Unable to decode file"))},s=this._offlineContext.decodeAudioData(t,e,i);s&&s.catch(i)})}setParamValue(t,e){t.setValueAtTime?t.setValueAtTime(e,this._context.currentTime):t.value=e}}class oc extends Je{_audio=null;_sourceNode=null;_gain=null;_progress=0;get progress(){return this._progress}_pausedReal=!1;_paused=!1;get paused(){return this._paused}set paused(t){this._paused!==t&&(this._paused=t,this.refreshPaused())}_volume=1;get volume(){return this._volume}set volume(t){this._volume!==t&&(this._volume=t,this.refresh())}_playbackRate=1;get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate!==t&&(this._playbackRate=t,this.refresh(),this._update(!0))}_loop=!1;get loop(){return this._loop}set loop(t){this._loop!==t&&(this._loop=t,this.refresh())}_muted=!1;get muted(){return this._muted}set muted(t){this._muted!==t&&(this._muted=t,this.refresh())}_duration=0;_end=0;_elapsed=0;_lastUpdate=this._now();_processors=[];init(t){return this._audio=t,t.context.on("refresh",this.refresh),t.context.on("refreshPaused",this.refreshPaused),this}_now(){return this._audio?.context.audioContext.currentTime??0}play(t={}){if(!this._audio)return;const{end:e=0,start:A=0}=t;e&&console.assert(e>A,"End time is before start time"),this._end=e,this._elapsed=A,t.volume!==void 0&&(this._volume=t.volume),t.playbackRate!==void 0&&(this._playbackRate=t.playbackRate),t.muted!==void 0&&(this._muted=t.muted),t.loop!==void 0&&(this._loop=t.loop),t.processors!==void 0&&(this._processors=t.processors),this._paused=!1;const{source:i,gain:s}=this._audio.cloneSource();this._sourceNode=i,this._gain=s,this.refresh(),i.onended=this._onComplete.bind(this),this._duration=i.buffer?.duration??0,this._lastUpdate=this._now(),this._loop?(i.loopStart=A,i.loopEnd=e,i.start(0,A)):e?i.start(0,A,e-A):i.start(0,A),this.emit("start"),this._update(!0),this._enableTicker(!0)}_stop(){if(this._sourceNode){this._enableTicker(!1),this._sourceNode.onended=null,this._sourceNode.stop(0),this._sourceNode.disconnect();try{this._sourceNode.buffer=null}catch(t){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",t)}this._sourceNode=null}}stop(){this._sourceNode&&(this._stop(),this.emit("stop"))}_update(t=!1){if(this._sourceNode){const e=this._now(),A=e-this._lastUpdate;if(A>0||t){this._elapsed+=A*this._sourceNode.playbackRate.value,this._lastUpdate=e;const i=this._duration;let s;if(this._sourceNode.loopStart){const n=this._sourceNode.loopEnd-this._sourceNode.loopStart;s=(this._sourceNode.loopStart+this._elapsed%n)/i}else s=this._elapsed%i/i;this._progress=s,this.emit("progress",s,i)}}}refresh(){if(!this._audio||!this._sourceNode)return;const t=this._audio.context,e=this._audio.parent;this._sourceNode.loop=this._loop||e.loop,t.setParamValue(this._gain.gain,this._volume*(this._muted?0:1)*e.volume*(e.muted?0:1)*t.volume*(t.muted?0:1)),t.setParamValue(this._sourceNode.playbackRate,this._playbackRate*e.playbackRate*t.playbackRate),this.applyProcessors()}applyProcessors(){if(this._sourceNode&&this._processors.length){this._sourceNode.disconnect();let t=this._sourceNode;this._processors.forEach(e=>{t.connect(e.destination),t=e}),t.connect(this._gain)}}refreshPaused(){if(!this._audio)return;const t=this._paused||this._audio.parent.paused||this._audio.context.paused;t!==this._pausedReal&&(this._pausedReal=t,t?(this._stop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,playbackRate:this._playbackRate,loop:this._loop,volume:this._volume})),this.emit("pause",t))}_onComplete=()=>{if(this._sourceNode){this._enableTicker(!1),this._sourceNode.onended=null,this._sourceNode.disconnect();try{this._sourceNode.buffer=null}catch(t){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",t)}}this._sourceNode=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this)};_updateListener=()=>this._update();_enableTicker(t){Kt.off(this._updateListener),t&&Kt.on(this._updateListener)}free(){this.removeAllListeners(),this._stop(),this._gain?.disconnect(),this._gain=null,this._audio?.context.off("refresh",this.refresh),this._audio?.context.off("refreshPaused",this.refreshPaused),this._audio=null,this._processors.forEach(t=>t.disconnect()),this._processors.length=0,this._end=0,this._playbackRate=1,this._volume=1,this._loop=!1,this._elapsed=0,this._duration=0,this._paused=!1,this._muted=!1,this._pausedReal=!1}}class ac extends Yn{constructor(t){const e=IA.audioContext,A=e.createBufferSource(),i=e.createGain(),s=e.createAnalyser();A.connect(s),s.connect(i),i.connect(IA.instance.destination),super(s,i),this.parent=t,this._sourceNode=A,this.gain=i,this.analyser=s}_sourceBuffer;_sourceNode;_sourceLoad;gain;analyser;get context(){return IA.instance}get isPlayable(){return!!this._sourceNode.buffer}get duration(){return this._sourceNode.buffer?.duration??0}get buffer(){return this._sourceNode.buffer}set buffer(t){this._sourceNode.buffer=t}async load(){return this._sourceLoad||(this._sourceLoad=new Promise(t=>{this._sourceBuffer?this._decode(this._sourceBuffer).then(()=>t(this)):this.parent.src?this._loadUrl(this.parent.src).then(()=>t(this)):t(this)})),this._sourceLoad}_loadUrl(t){return new Promise(e=>{fetch(t).then(A=>A.arrayBuffer()).then(A=>this._decode(A)).finally(()=>e(this))})}_decode(t){return Promise.resolve(t instanceof AudioBuffer?t:IA.decode(t)).then(e=>(this.parent.isLoaded=!0,this.buffer=e,e))}cloneSource(){const t=this.context,e=this._sourceNode,A=t.audioContext.createBufferSource(),i=t.audioContext.createGain();return A.buffer=e.buffer,A.loop=e.loop,t.setParamValue(A.playbackRate,e.playbackRate.value),A.connect(i),i.connect(this.destination),{source:A,gain:i}}createSound(){return new oc}}var op=Object.defineProperty,ap=Object.getOwnPropertyDescriptor,lp=(r,t,e)=>t in r?op(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,cp=(r,t,e,A)=>{for(var i=A>1?void 0:A?ap(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i},hp=(r,t,e)=>lp(r,t+"",e);g.Audio=class extends g.TimelineNode{_sounds=[];_platformAudio=Lo?new ac(this):new nc(this);get platformAudio(){return this._platformAudio}_src;get src(){return this._src}set src(t){this._src!==t&&(this._src=t,this.load())}isLoaded=!1;get isPlayable(){return this.isLoaded&&this._platformAudio.isPlayable}get audioDuration(){return this._platformAudio.duration*1e3}_volume=1;get volume(){return this._volume}set volume(t){this._volume!==t&&(this._volume=t,this.refresh())}_muted=!1;get muted(){return this._muted}set muted(t){this._muted!==t&&(this._muted=t,this.refresh())}_loop=!1;get loop(){return this._loop}set loop(t){this._loop!==t&&(this._loop=t,this.refresh())}_playbackRate=1;get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate!==t&&(this._playbackRate=t,this.refresh())}_isPlaying=!1;get isPlaying(){return this._isPlaying}multiple=!1;start=0;end=0;constructor(t=""){super(),this.src=t}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"paused":this.refreshPaused();break}}async load(){return await this._platformAudio.load(),this}pause(){return this._isPlaying=!1,this.paused=!0,this}resume(){return this._isPlaying=this._sounds.length>0,this.paused=!1,this}stop(){if(!this.isPlayable)return this;this._isPlaying=!1;for(let t=this._sounds.length-1;t>=0;t--)this._sounds[t].stop();return this}play(t={}){if(!this.isLoaded)return;this.multiple||this._removeSounds(),this._isPlaying=!0;const e=this._createSound();this._sounds.push(e),e.once("end",()=>{t.complete?.(),this._onComplete(e)}),e.once("stop",()=>this._onComplete(e));const A=(t?.start??this.start)/1e3,i=(t?.end??this.end)/1e3;return e.play({...t,start:A,end:i}),e}_removeSounds(){for(let t=this._sounds.length-1;t>=0;t--)this._recycleSound(this._sounds[t]);this._sounds.length=0}_createSound(){return g.Audio._soundPool.length>0?g.Audio._soundPool.pop().init(this._platformAudio):this._platformAudio.createSound().init(this._platformAudio)}refresh(){for(let t=this._sounds.length,e=0;e<t;e++)this._sounds[e].refresh()}refreshPaused(){for(let t=this._sounds.length,e=0;e<t;e++)this._sounds[e].refreshPaused()}_onComplete=t=>{if(this._sounds){const e=this._sounds.indexOf(t);e>-1&&this._sounds.splice(e,1),this._isPlaying=this._sounds.length>0}this._recycleSound(t)};_recycleSound(t){t.free(),g.Audio._soundPool.includes(t)||g.Audio._soundPool.push(t)}_prevTime=0;_timer=0;_process(t){if(super._process(t),this.canProcess()){const e=this._tree?.timeline.currentTime??0;e-this._prevTime>0&&(this._timer||(this._setTimeStop(),this.play({start:this.start+(e-this.delay)%this.duration})),this._isPlaying&&this._setTimeStop()),this._prevTime=e}}_setTimeStop(){this._timer&&clearTimeout(this._timer),this._timer=setTimeout(()=>{this.stop(),this._timer=0},100)}},hp(g.Audio,"_soundPool",[]),g.Audio=cp([st("Audio")],g.Audio);class gp extends g.Node2D{}var up=Object.defineProperty,fp=Object.getOwnPropertyDescriptor,Hr=(r,t,e,A)=>{for(var i=A>1?void 0:A?fp(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&up(t,e,i),i};g.AudioWaveform=class extends g.Element2D{_audioBuffer;_src=li?new yt(document.createElement("canvas")):void 0;_needsUpdateTexture=!1;constructor(t={}){super(),this.setProperties(t)}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"src":this._loadSrc(e);break;case"gap":case"color":case"width":case"height":this._needsUpdateTexture=!0;break}}async _loadSrc(t){await globalThis.fetch(t).then(e=>e.arrayBuffer()).then(e=>IA.decode(e)).then(e=>{this._audioBuffer=e,this.syncTexture(!0)})}syncTexture(t=!1){const e=this._audioBuffer;if(!e||!t&&!this._needsUpdateTexture)return;this._needsUpdateTexture=!1;const A=this._src?.source;if(!A)return;const{width:i=0,height:s=0}=this.style;A.width=i,A.height=s;const n=A.getContext("2d");if(!n){console.warn("Failed to getContext('2d') in syncTexture");return}n.fillStyle=this.color;const o=e.getChannelData(0),a=Math.ceil(o.length/i),l=s/2;for(let c=1,h=-1,u=0;u<i;u++){for(let d=0;d<a;d++){const f=o[u*a+d];f<c&&(c=f),f>h&&(h=f)}if(!this.gap||u%(this.gap*2)===0){const d=u,f=(1+c)*l,B=this.gap||1,p=Math.max(1,(h-c)*l);n.fillRect(d,f,B,p),c=1,h=-1}}this._src?.requestUpload(),this.requestRedraw()}_process(t){this.syncTexture(),super._process(t)}_drawSrc(){const t=this._src;t?.valid&&(this.context.fillStyle=t,this.context.uvTransform=new Yt().scale(1/this.style.width,1/this.style.height))}},Hr([v()],g.AudioWaveform.prototype,"src",2),Hr([v()],g.AudioWaveform.prototype,"gap",2),Hr([v()],g.AudioWaveform.prototype,"color",2),g.AudioWaveform=Hr([st("AudioWaveform")],g.AudioWaveform);var dp=Object.getOwnPropertyDescriptor,Ip=(r,t,e,A)=>{for(var i=A>1?void 0:A?dp(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};g.Control=class extends g.Element2D{constructor(t,e=[]){super(),this._parentUpdateRect=this._parentUpdateRect.bind(this),this.setProperties(t),this.append(e)}_parented(t){super._parented(t),t.on("updateRect",this._parentUpdateRect)}_unparented(t){super._unparented(t),t.off("updateRect",this._parentUpdateRect)}_parentUpdateRect(){const t=this._parent.getRect();this.style.left=t.left,this.style.top=t.top,this.style.width=t.width,this.style.height=t.height}_input(t,e){super._input(t,e),this._guiInput(t,e)}_updateStyleProperty(t,e,A,i){switch(super._updateStyleProperty(t,e,A,i),t){case"width":case"height":case"left":case"top":this.emit("updateRect");break}}_guiInput(t,e){}},g.Control=Ip([st("Control")],g.Control);var pp=Object.defineProperty,Ep=Object.getOwnPropertyDescriptor,pA=(r,t,e,A)=>{for(var i=A>1?void 0:A?Ep(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&pp(t,e,i),i};g.Range=class extends g.Control{constructor(t,e=[]){super(),this.setProperties(t).append(e)}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"allowGreater":case"allowLesser":case"page":case"minValue":case"maxValue":case"step":case"value":this.requestRedraw();break}}},pA([v({fallback:!1})],g.Range.prototype,"allowGreater",2),pA([v({fallback:!1})],g.Range.prototype,"allowLesser",2),pA([v({fallback:1})],g.Range.prototype,"page",2),pA([v({fallback:0})],g.Range.prototype,"minValue",2),pA([v({fallback:100})],g.Range.prototype,"maxValue",2),pA([v({fallback:.01})],g.Range.prototype,"step",2),pA([v({fallback:0})],g.Range.prototype,"value",2),g.Range=pA([st("Range")],g.Range);var Bp=Object.defineProperty,Cp=Object.getOwnPropertyDescriptor,Ne=(r,t,e,A)=>{for(var i=A>1?void 0:A?Cp(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&Bp(t,e,i),i};g.Ruler=class extends g.Control{texture=new Ir;constructor(t,e=[]){super(),this.setProperties(t),this.append(e)}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"offsetX":case"offsetY":case"thickness":case"markHeight":case"color":case"markBackgroundColor":case"markColor":case"gap":case"scale":this.requestRedraw();break}}_updateStyleProperty(t,e,A,i){switch(super._updateStyleProperty(t,e,A,i),t){case"width":case"height":this.texture[t]=e,this.requestRedraw();break}}_drawTexture(){const{width:t,height:e}=this.size,{offsetX:A,offsetY:i,thickness:s,markHeight:n,markBackgroundColor:o,markColor:a,color:l,gap:c,gapScale:h}=this,d=this.texture.source.getContext("2d");d.reset(),d.scale(this.texture.pixelRatio,this.texture.pixelRatio);const f=Math.round(A),B=Math.round(i);d.beginPath(),d.fillStyle=o||"#EEE",d.fillRect(0,0,t,s),d.fillRect(0,0,s,e),d.fill(),d.strokeStyle=a||"#000",d.moveTo(s,0),d.lineTo(s,e),d.moveTo(0,s),d.lineTo(t,s),d.stroke();const p=c,D=c*h;let R,w,S,Q,m;for(p>=D?(R=p/D,w=Math.floor(R)*p/20,S=p/20*Math.floor(R)/R):(R=D/p,w=Math.floor(p/20/R),w>=2?w=Math.floor(w/2)*2:w=1,S=w*R),d.fillStyle=d.strokeStyle,Q=f,m=0;Q<t;m++,Q+=S)d.moveTo(Q,s-(m%5?n:2*n)),d.lineTo(Q,s);for(Q=f,m=0;Q>s;m++,Q-=S)d.moveTo(Q,s-(m%5?n:2*n)),d.lineTo(Q,s);let x=0;for(Q=B,m=0;Q>s;m++,Q-=S)d.moveTo(s-(m%5?n:2*n),Q),d.lineTo(s,Q);for(Q=B,m=0;Q<e;m++,Q+=S)d.moveTo(s-(m%5?n:2*n),Q),d.lineTo(s,Q);for(d.save(),d.fillStyle=l,d.scale(.8,.8),x=s-8,Q=f,m=0;Q<t;m++,Q+=S)m%10===0&&d.fillText(String(Math.ceil(w*m)),Q*1.25-3,x*1.25);for(Q=f,m=0;Q>s;m++,Q-=S)m%10===0&&d.fillText(String(Math.ceil(-w*m)),Q*1.25-3,x*1.25);for(x=0,Q=B,m=0;Q>s;m++,Q-=S)m%10===0&&d.fillText(String(Math.ceil(w*m)),x*1.25,Q*1.25+3);for(Q=B,m=0;Q<e;m++,Q+=S)m%10===0&&d.fillText(String(Math.ceil(-w*m)),x*1.25,Q*1.25+3);d.restore(),d.stroke(),this.texture.requestUpload()}_draw(){this._drawTexture();const t=this.texture;t?.valid&&(this.context.fillStyle=t,this.context.uvTransform=new Yt().scale(1/this.size.width,1/this.size.height),this.context.rect(0,0,t.width,t.height),this.context.fill())}},Ne([v({fallback:0})],g.Ruler.prototype,"offsetX",2),Ne([v({fallback:0})],g.Ruler.prototype,"offsetY",2),Ne([v({fallback:20})],g.Ruler.prototype,"thickness",2),Ne([v({fallback:3})],g.Ruler.prototype,"markHeight",2),Ne([v({fallback:"#b2b6bc"})],g.Ruler.prototype,"color",2),Ne([v({fallback:"#f9f9fa"})],g.Ruler.prototype,"markBackgroundColor",2),Ne([v({fallback:"#b2b6bc"})],g.Ruler.prototype,"markColor",2),Ne([v({fallback:300})],g.Ruler.prototype,"gap",2),Ne([v({fallback:1})],g.Ruler.prototype,"gapScale",2),g.Ruler=Ne([st("Ruler")],g.Ruler);var Qp=Object.defineProperty,yp=Object.getOwnPropertyDescriptor,lc=(r,t,e,A)=>{for(var i=A>1?void 0:A?yp(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&Qp(t,e,i),i};g.ScrollBar=class extends g.Range{constructor(t,e=[]){super(),this.setProperties(t).append(e)}_updateStyleProperty(t,e,A,i){switch(super._updateStyleProperty(t,e,A,i),t){case"width":case"height":case"left":case"top":this.requestRedraw();break}}_rect(){const{size:t,position:e}=this;let A,i,s,n,o;return this.direction==="vertical"?(s=10,n=t.height*(this.page/(this.maxValue-this.minValue)),A=e.left+t.width-s,i=t.height*(this.value/(this.maxValue-this.minValue)),o=s/2):(s=t.width*(this.page/(this.maxValue-this.minValue)),n=10,A=t.width*(this.value/(this.maxValue-this.minValue)),i=e.top+t.height-n,o=n/2),{left:A,top:i,width:s,height:n,radii:o}}_draw(){const{left:t,top:e,width:A,height:i,radii:s}=this._rect();this.context.roundRect(t,e,A,i,s),this.context.fillStyle=34,this.context.fill()}_pointerInput(t,e){const{left:A,top:i,width:s,height:n}=this._rect(),o=t.x>=A&&t.x<A+s&&t.y>=i&&t.y<i+n;switch(e){case"pointerdown":case"pointermove":o?this._tree?.input.setCursor("pointer"):this._tree?.input.setCursor(void 0);break}return!1}},lc([v({fallback:"vertical"})],g.ScrollBar.prototype,"direction",2),g.ScrollBar=lc([st("ScrollBar")],g.ScrollBar);var mp=Object.getOwnPropertyDescriptor,wp=(r,t,e,A)=>{for(var i=A>1?void 0:A?mp(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};g.XScrollBar=class extends g.ScrollBar{constructor(t,e=[]){super(),this.setProperties(t).append(e)}},g.XScrollBar=wp([st("XScrollBar",{direction:"horizontal"})],g.XScrollBar);var vp=Object.getOwnPropertyDescriptor,_p=(r,t,e,A)=>{for(var i=A>1?void 0:A?vp(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};g.YScrollBar=class extends g.ScrollBar{constructor(t,e=[]){super(),this.setProperties(t).append(e)}},g.YScrollBar=_p([st("YScrollBar",{direction:"vertical"})],g.YScrollBar);var bp=Object.defineProperty,Dp=Object.getOwnPropertyDescriptor,Ai=(r,t,e,A)=>{for(var i=A>1?void 0:A?Dp(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=(A?n(t,e,i):n(i))||i);return A&&i&&bp(t,e,i),i};g.Scaler=class extends g.Node{get target(){if(this.parent?.style)return this.parent}constructor(t,e=[]){super(),this.setProperties(t),this.append(e)}_updateProperty(t,e,A,i){switch(super._updateProperty(t,e,A,i),t){case"translateY":case"translateX":case"scale":case"min":case"max":{this.scale=le(this.scale,this.minScale,this.maxScale),this._updateTarget();break}}}_updateTarget(){const t=this.target;t&&(t.style.transform=`translate(${this.translateX}px, ${this.translateY}px) scale(${this.scale})`,this.emit("updateScale",this.scale))}_onWheel(t){this.target&&(t.preventDefault(),t.ctrlKey?(t.wheelDeltaY?Math.abs(Math.abs(t.wheelDeltaY)-Math.abs(3*t.deltaY))<3:t.deltaMode===0)||(t.preventDefault(),this.scale+=t.deltaY*-.015):(this.translateX-=t.deltaX,this.translateY-=t.deltaY))}_input(t,e){switch(super._input(t,e),e){case"wheel":this._onWheel(t);break}}},Ai([v({default:1})],g.Scaler.prototype,"translateX",2),Ai([v({default:1})],g.Scaler.prototype,"translateY",2),Ai([v({default:1})],g.Scaler.prototype,"scale",2),Ai([v({default:.05})],g.Scaler.prototype,"minScale",2),Ai([v({default:10})],g.Scaler.prototype,"maxScale",2),g.Scaler=Ai([st("Scaler",{processMode:"disabled",renderMode:"disabled"})],g.Scaler);var xp=Object.defineProperty,Sp=Object.getOwnPropertyDescriptor,Mp=(r,t,e)=>t in r?xp(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Rp=(r,t,e,A)=>{for(var i=A>1?void 0:A?Sp(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i},kp=(r,t,e)=>Mp(r,t+"",e);g.KawaseTransition=class extends g.Transition{blur=10;quality=10;apply(t,e){const A=this.currentTimeProgress;let i,s;A<.5?(i=0,s=(.5-A)/.5):(i=1,s=(A-.5)/.5);const n=this.blur,o=this.quality,a=e.width,l=e.height,c=[],h=[n];if(n>0){let D=n;const R=n/o;for(let w=1;w<o;w++)D-=R,h.push(D)}const u=1/a,d=1/l,f=[];let B;const p=o-1;for(let D=0;D<p;D++)B=h[D]+.5,f[0]=B*u,f[1]=B*d,c.push({offset:f});B=h[p]+.5,f[0]=B*u,f[1]=B*d,c.push({offset:f}),c.forEach(D=>{ut.draw(t,g.KawaseTransition.material,{sampler:i,progress:s,...D})})}},kp(g.KawaseTransition,"material",new Ct({vert:`attribute vec2 position;
|
|
861
|
+
}`})),Xr([w()],u.ZoomBlurEffect.prototype,"center",2),Xr([w({fallback:20})],u.ZoomBlurEffect.prototype,"innerRadius",2),Xr([w({fallback:-1})],u.ZoomBlurEffect.prototype,"radius",2),Xr([w({fallback:.1})],u.ZoomBlurEffect.prototype,"strength",2),u.ZoomBlurEffect=Xr([W("ZoomBlurEffect")],u.ZoomBlurEffect);var md=Object.defineProperty,et=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&md(e,t,i),i};class Te extends It{constructor(e){super(),this.parent=e}_texture;_setProperties(e){return super.setProperties(e)}setProperties(e){return this._setProperties(K(e)?void 0:at(e))}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"color":case"cropRect":case"stretchRect":case"dpi":case"rotateWithShape":case"tile":case"opacity":case"enabled":this.parent.requestRedraw();break;case"image":case"linearGradient":case"radialGradient":this._updateTexture();break}}async loadTexture(){return this.linearGradient||this.radialGradient?new Ri(this.linearGradient??this.radialGradient,this.parent.size.width,this.parent.size.height):K(this.image)?void 0:(this.parent.tree?.log(`load image ${this.image}`),await yt.texture.load(this.image))}async _updateTexture(){this._texture=await this.loadTexture(),this.parent.requestRedraw()}canDraw(){return!!(this.enabled&&(this._texture||this.color))}_getDrawOptions(){let e=!1;const{width:t,height:r}=this.parent.size,i=new Ce().scale(1/t,1/r);if(this.cropRect){const{left:n=0,top:o=0,right:a=0,bottom:l=0}=this.cropRect;i.scale(Math.abs(1-(n+a)),Math.abs(1-(o+l))).translate(n,o),e=!0}if(this.tile){const{translateX:n=0,translateY:o=0,scaleX:a=1,scaleY:l=1}=this.tile;i.translate(-n/t,-o/r).scale(1/a,1/l),e=!0}else if(this.stretchRect){const{left:n=0,top:o=0,right:a=0,bottom:l=0}=this.stretchRect;i.scale(Math.abs(1-(-n+-a)),Math.abs(1-(-o+-l))).translate(-n,-o),e=!0}return{disableWrapMode:e,uvTransform:i}}draw(){const e=this.parent.context,{uvTransform:t,disableWrapMode:r}=this._getDrawOptions();e.uvTransform=t,e.fillStyle=this._texture??this.color,e.fill({disableWrapMode:r})}}et([w({fallback:!0})],Te.prototype,"enabled"),et([w()],Te.prototype,"color"),et([w()],Te.prototype,"image"),et([w()],Te.prototype,"linearGradient"),et([w()],Te.prototype,"radialGradient"),et([w()],Te.prototype,"cropRect"),et([w()],Te.prototype,"stretchRect"),et([w()],Te.prototype,"dpi"),et([w()],Te.prototype,"rotateWithShape"),et([w()],Te.prototype,"tile"),et([w()],Te.prototype,"opacity");var yd=Object.defineProperty,vd=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&yd(e,t,i),i};class sn extends Te{setProperties(e){return super._setProperties(K(e)?void 0:$c(e))}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"fillWithShape":this.parent.requestRedraw();break}}}vd([w()],sn.prototype,"fillWithShape");var _d=Object.defineProperty,bd=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&_d(e,t,i),i};class nn extends Te{setProperties(e){return super._setProperties(K(e)?void 0:Vc(e))}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"fillWithShape":this.parent.requestRedraw();break}}}bd([w()],nn.prototype,"fillWithShape");var wd=Object.defineProperty,Hr=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&wd(e,t,i),i};class Kt extends Te{setProperties(e){return super._setProperties(K(e)?void 0:_i(e))}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"width":case"style":case"lineCap":case"lineJoin":case"enabled":this.parent.requestRedraw();break}}canDraw(){return!!(this.enabled&&(this.width||this.color||super.canDraw()))}draw(){const e=this.parent.context,{uvTransform:t,disableWrapMode:r}=this._getDrawOptions();e.lineWidth=this.width||1,e.uvTransform=t,e.strokeStyle=this._texture??this.color,e.lineCap=this.lineCap,e.lineJoin=this.lineJoin,e.stroke({disableWrapMode:r})}}Hr([w({fallback:"#00000000"})],Kt.prototype,"color"),Hr([w({fallback:0})],Kt.prototype,"width"),Hr([w({fallback:"solid"})],Kt.prototype,"style"),Hr([w({fallback:"butt"})],Kt.prototype,"lineCap"),Hr([w({fallback:"miter"})],Kt.prototype,"lineJoin");var xd=Object.defineProperty,Yr=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&xd(e,t,i),i};class Zt extends It{constructor(e){super(),this.parent=e}setProperties(e){return super.setProperties(K(e)?void 0:Gc(e))}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"color":case"blur":case"offsetX":case"offsetY":this.updateEffect();break}}updateEffect(){const e="__$shadow";let t=this.parent.getNode(e);this.blur||this.offsetX||this.offsetY?(t||(t=new u.DropShadowEffect({name:e}),this.parent.appendChild(t,"back")),t.setProperties(this.getProperties())):t&&this.parent.removeChild(t)}}Yr([w({fallback:!0})],Zt.prototype,"enabled"),Yr([w({fallback:"#000000FF"})],Zt.prototype,"color"),Yr([w({fallback:0})],Zt.prototype,"blur"),Yr([w({fallback:0})],Zt.prototype,"offsetY"),Yr([w({fallback:0})],Zt.prototype,"offsetX");var Pd=Object.defineProperty,Kr=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&Pd(e,t,i),i};class Jt extends It{constructor(e){super(),this.parent=e,this._updatePath2DSet()}_path2DSet=new Ct;setProperties(e){return super.setProperties(K(e)?void 0:Wc(e))}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"svg":case"paths":case"viewBox":case"enabled":this._updatePath2DSet(),this.parent.requestRedraw();break}}_updatePath2DSet(){let e;if(this.svg){const o=Ns(this.svg);this._path2DSet=$s(o),e=this._path2DSet.viewBox}else this.paths?.forEach((o,a)=>{const{data:l,...c}=o,h=new ge;h.style=c,h.addData(l),this._path2DSet.paths[a]=h});if(!e){const o=this._path2DSet.getBoundingBox();e=o?[o.x,o.y,o.width,o.height]:[0,0,1,1]}const[t,r,i,n]=e;this._path2DSet.paths.forEach(o=>{o.applyTransform(new _e().translate(-t,-r).scale(1/i,1/n))})}draw(){if(this.enabled&&this._path2DSet.paths.length){const e=this.parent.context,{width:t,height:r}=this.parent.size;this._path2DSet.paths.forEach(i=>{e.addPath(i.clone().applyTransform(new _e().scale(t,r)))})}else this.drawRect()}drawRect(){const e=this.parent.context,{width:t,height:r}=this.parent.size,{borderRadius:i}=this.parent.style;t&&r&&(i?e.roundRect(0,0,t,r,i):e.rect(0,0,t,r))}}Kr([w({fallback:!0})],Jt.prototype,"enabled"),Kr([w()],Jt.prototype,"preset"),Kr([w()],Jt.prototype,"svg"),Kr([w()],Jt.prototype,"viewBox"),Kr([w()],Jt.prototype,"paths");class Zr extends Pt{constructor(e){super(),this.setProperties(e)}}const cl=po();for(const s in cl){const e=cl[s];vi(Zr,s,{fallback:e})}var Ee=Uint8Array,We=Uint16Array,on=Int32Array,Bi=new Ee([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]),Li=new Ee([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]),an=new Ee([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),hl=function(s,e){for(var t=new We(31),r=0;r<31;++r)t[r]=e+=1<<s[r-1];for(var i=new on(t[30]),r=1;r<30;++r)for(var n=t[r];n<t[r+1];++n)i[n]=n-t[r]<<5|r;return{b:t,r:i}},ul=hl(Bi,2),fl=ul.b,ln=ul.r;fl[28]=258,ln[258]=28;for(var dl=hl(Li,0),Sd=dl.b,pl=dl.r,cn=new We(32768),te=0;te<32768;++te){var Nt=(te&43690)>>1|(te&21845)<<1;Nt=(Nt&52428)>>2|(Nt&13107)<<2,Nt=(Nt&61680)>>4|(Nt&3855)<<4,cn[te]=((Nt&65280)>>8|(Nt&255)<<8)>>1}for(var dt=(function(s,e,t){for(var r=s.length,i=0,n=new We(e);i<r;++i)s[i]&&++n[s[i]-1];var o=new We(e);for(i=1;i<e;++i)o[i]=o[i-1]+n[i-1]<<1;var a;if(t){a=new We(1<<e);var l=15-e;for(i=0;i<r;++i)if(s[i])for(var c=i<<4|s[i],h=e-s[i],f=o[s[i]-1]++<<h,d=f|(1<<h)-1;f<=d;++f)a[cn[f]>>l]=c}else for(a=new We(r),i=0;i<r;++i)s[i]&&(a[i]=cn[o[s[i]-1]++]>>15-s[i]);return a}),Ft=new Ee(288),te=0;te<144;++te)Ft[te]=8;for(var te=144;te<256;++te)Ft[te]=9;for(var te=256;te<280;++te)Ft[te]=7;for(var te=280;te<288;++te)Ft[te]=8;for(var Jr=new Ee(32),te=0;te<32;++te)Jr[te]=5;var Cd=dt(Ft,9,0),Td=dt(Ft,9,1),Ed=dt(Jr,5,0),Md=dt(Jr,5,1),hn=function(s){for(var e=s[0],t=1;t<s.length;++t)s[t]>e&&(e=s[t]);return e},tt=function(s,e,t){var r=e/8|0;return(s[r]|s[r+1]<<8)>>(e&7)&t},un=function(s,e){var t=e/8|0;return(s[t]|s[t+1]<<8|s[t+2]<<16)>>(e&7)},fn=function(s){return(s+7)/8|0},gl=function(s,e,t){return(t==null||t>s.length)&&(t=s.length),new Ee(s.subarray(e,t))},Ad=["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"],rt=function(s,e,t){var r=new Error(e||Ad[s]);if(r.code=s,Error.captureStackTrace&&Error.captureStackTrace(r,rt),!t)throw r;return r},Od=function(s,e,t,r){var i=s.length,n=0;if(!i||e.f&&!e.l)return t||new Ee(0);var o=!t,a=o||e.i!=2,l=e.i;o&&(t=new Ee(i*3));var c=function(Be){var $e=t.length;if(Be>$e){var Pe=new Ee(Math.max($e*2,Be));Pe.set(t),t=Pe}},h=e.f||0,f=e.p||0,d=e.b||0,g=e.l,p=e.d,y=e.m,m=e.n,P=i*8;do{if(!g){h=tt(s,f,1);var E=tt(s,f+1,3);if(f+=3,E)if(E==1)g=Td,p=Md,y=9,m=5;else if(E==2){var b=tt(s,f,31)+257,S=tt(s,f+10,15)+4,T=b+tt(s,f+5,31)+1;f+=14;for(var R=new Ee(T),G=new Ee(19),U=0;U<S;++U)G[an[U]]=tt(s,f+U*3,7);f+=S*3;for(var L=hn(G),V=(1<<L)-1,B=dt(G,L,1),U=0;U<T;){var k=B[tt(s,f,V)];f+=k&15;var x=k>>4;if(x<16)R[U++]=x;else{var H=0,D=0;for(x==16?(D=3+tt(s,f,3),f+=2,H=R[U-1]):x==17?(D=3+tt(s,f,7),f+=3):x==18&&(D=11+tt(s,f,127),f+=7);D--;)R[U++]=H}}var N=R.subarray(0,b),$=R.subarray(b);y=hn(N),m=hn($),g=dt(N,y,1),p=dt($,m,1)}else rt(1);else{var x=fn(f)+4,C=s[x-4]|s[x-3]<<8,v=x+C;if(v>i){l&&rt(0);break}a&&c(d+C),t.set(s.subarray(x,v),d),e.b=d+=C,e.p=f=v*8,e.f=h;continue}if(f>P){l&&rt(0);break}}a&&c(d+131072);for(var I=(1<<y)-1,j=(1<<m)-1,A=f;;A=f){var H=g[un(s,f)&I],M=H>>4;if(f+=H&15,f>P){l&&rt(0);break}if(H||rt(2),M<256)t[d++]=M;else if(M==256){A=f,g=null;break}else{var F=M-254;if(M>264){var U=M-257,z=Bi[U];F=tt(s,f,(1<<z)-1)+fl[U],f+=z}var Y=p[un(s,f)&j],J=Y>>4;Y||rt(3),f+=Y&15;var $=Sd[J];if(J>3){var z=Li[J];$+=un(s,f)&(1<<z)-1,f+=z}if(f>P){l&&rt(0);break}a&&c(d+131072);var ae=d+F;if(d<$){var _t=n-$,Ze=Math.min($,ae);for(_t+d<0&&rt(3);d<Ze;++d)t[d]=r[_t+d]}for(;d<ae;++d)t[d]=t[d-$]}}e.l=g,e.p=A,e.b=d,e.f=h,g&&(h=1,e.m=y,e.d=p,e.n=m)}while(!h);return d!=t.length&&o?gl(t,0,d):t.subarray(0,d)},At=function(s,e,t){t<<=e&7;var r=e/8|0;s[r]|=t,s[r+1]|=t>>8},Qr=function(s,e,t){t<<=e&7;var r=e/8|0;s[r]|=t,s[r+1]|=t>>8,s[r+2]|=t>>16},dn=function(s,e){for(var t=[],r=0;r<s.length;++r)s[r]&&t.push({s:r,f:s[r]});var i=t.length,n=t.slice();if(!i)return{t:_l,l:0};if(i==1){var o=new Ee(t[0].s+1);return o[t[0].s]=1,{t:o,l:1}}t.sort(function(v,b){return v.f-b.f}),t.push({s:-1,f:25001});var a=t[0],l=t[1],c=0,h=1,f=2;for(t[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=i-1;)a=t[t[c].f<t[f].f?c++:f++],l=t[c!=h&&t[c].f<t[f].f?c++:f++],t[h++]={s:-1,f:a.f+l.f,l:a,r:l};for(var d=n[0].s,r=1;r<i;++r)n[r].s>d&&(d=n[r].s);var g=new We(d+1),p=pn(t[h-1],g,0);if(p>e){var r=0,y=0,m=p-e,P=1<<m;for(n.sort(function(b,S){return g[S.s]-g[b.s]||b.f-S.f});r<i;++r){var E=n[r].s;if(g[E]>e)y+=P-(1<<p-g[E]),g[E]=e;else break}for(y>>=m;y>0;){var x=n[r].s;g[x]<e?y-=1<<e-g[x]++-1:++r}for(;r>=0&&y;--r){var C=n[r].s;g[C]==e&&(--g[C],++y)}p=e}return{t:new Ee(g),l:p}},pn=function(s,e,t){return s.s==-1?Math.max(pn(s.l,e,t+1),pn(s.r,e,t+1)):e[s.s]=t},ml=function(s){for(var e=s.length;e&&!s[--e];);for(var t=new We(++e),r=0,i=s[0],n=1,o=function(l){t[r++]=l},a=1;a<=e;++a)if(s[a]==i&&a!=e)++n;else{if(!i&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(i),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(i);n=1,i=s[a]}return{c:t.subarray(0,r),n:e}},ei=function(s,e){for(var t=0,r=0;r<e.length;++r)t+=s[r]*e[r];return t},yl=function(s,e,t){var r=t.length,i=fn(e+2);s[i]=r&255,s[i+1]=r>>8,s[i+2]=s[i]^255,s[i+3]=s[i+1]^255;for(var n=0;n<r;++n)s[i+n+4]=t[n];return(i+4+r)*8},vl=function(s,e,t,r,i,n,o,a,l,c,h){At(e,h++,t),++i[256];for(var f=dn(i,15),d=f.t,g=f.l,p=dn(n,15),y=p.t,m=p.l,P=ml(d),E=P.c,x=P.n,C=ml(y),v=C.c,b=C.n,S=new We(19),T=0;T<E.length;++T)++S[E[T]&31];for(var T=0;T<v.length;++T)++S[v[T]&31];for(var R=dn(S,7),G=R.t,U=R.l,L=19;L>4&&!G[an[L-1]];--L);var V=c+5<<3,B=ei(i,Ft)+ei(n,Jr)+o,k=ei(i,d)+ei(n,y)+o+14+3*L+ei(S,G)+2*S[16]+3*S[17]+7*S[18];if(l>=0&&V<=B&&V<=k)return yl(e,h,s.subarray(l,l+c));var H,D,N,$;if(At(e,h,1+(k<B)),h+=2,k<B){H=dt(d,g,0),D=d,N=dt(y,m,0),$=y;var I=dt(G,U,0);At(e,h,x-257),At(e,h+5,b-1),At(e,h+10,L-4),h+=14;for(var T=0;T<L;++T)At(e,h+3*T,G[an[T]]);h+=3*L;for(var j=[E,v],A=0;A<2;++A)for(var M=j[A],T=0;T<M.length;++T){var F=M[T]&31;At(e,h,I[F]),h+=G[F],F>15&&(At(e,h,M[T]>>5&127),h+=M[T]>>12)}}else H=Cd,D=Ft,N=Ed,$=Jr;for(var T=0;T<a;++T){var z=r[T];if(z>255){var F=z>>18&31;Qr(e,h,H[F+257]),h+=D[F+257],F>7&&(At(e,h,z>>23&31),h+=Bi[F]);var Y=z&31;Qr(e,h,N[Y]),h+=$[Y],Y>3&&(Qr(e,h,z>>5&8191),h+=Li[Y])}else Qr(e,h,H[z]),h+=D[z]}return Qr(e,h,H[256]),h+D[256]},kd=new on([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),_l=new Ee(0),Dd=function(s,e,t,r,i,n){var o=n.z||s.length,a=new Ee(r+o+5*(1+Math.ceil(o/7e3))+i),l=a.subarray(r,a.length-i),c=n.l,h=(n.r||0)&7;if(e){h&&(l[0]=n.r>>3);for(var f=kd[e-1],d=f>>13,g=f&8191,p=(1<<t)-1,y=n.p||new We(32768),m=n.h||new We(p+1),P=Math.ceil(t/3),E=2*P,x=function(ze){return(s[ze]^s[ze+1]<<P^s[ze+2]<<E)&p},C=new on(25e3),v=new We(288),b=new We(32),S=0,T=0,R=n.i||0,G=0,U=n.w||0,L=0;R+2<o;++R){var V=x(R),B=R&32767,k=m[V];if(y[B]=k,m[V]=B,U<=R){var H=o-R;if((S>7e3||G>24576)&&(H>423||!c)){h=vl(s,l,0,C,v,b,T,G,L,R-L,h),G=S=T=0,L=R;for(var D=0;D<286;++D)v[D]=0;for(var D=0;D<30;++D)b[D]=0}var N=2,$=0,I=g,j=B-k&32767;if(H>2&&V==x(R-j))for(var A=Math.min(d,H)-1,M=Math.min(32767,R),F=Math.min(258,H);j<=M&&--I&&B!=k;){if(s[R+N]==s[R+N-j]){for(var z=0;z<F&&s[R+z]==s[R+z-j];++z);if(z>N){if(N=z,$=j,z>A)break;for(var Y=Math.min(j,z-2),J=0,D=0;D<Y;++D){var ae=R-j+D&32767,_t=y[ae],Ze=ae-_t&32767;Ze>J&&(J=Ze,k=ae)}}}B=k,k=y[B],j+=B-k&32767}if($){C[G++]=268435456|ln[N]<<18|pl[$];var Be=ln[N]&31,$e=pl[$]&31;T+=Bi[Be]+Li[$e],++v[257+Be],++b[$e],U=R+N,++S}else C[G++]=s[R],++v[s[R]]}}for(R=Math.max(R,U);R<o;++R)C[G++]=s[R],++v[s[R]];h=vl(s,l,c,C,v,b,T,G,L,R-L,h),c||(n.r=h&7|l[h/8|0]<<3,h-=7,n.h=m,n.p=y,n.i=R,n.w=U)}else{for(var R=n.w||0;R<o+c;R+=65535){var Pe=R+65535;Pe>=o&&(l[h/8|0]=c,Pe=o),h=yl(l,h+1,s.subarray(R,Pe))}n.i=o}return gl(a,0,r+fn(h)+i)},bl=function(){var s=1,e=0;return{p:function(t){for(var r=s,i=e,n=t.length|0,o=0;o!=n;){for(var a=Math.min(o+2655,n);o<a;++o)i+=r+=t[o];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}s=r,e=i},d:function(){return s%=65521,e%=65521,(s&255)<<24|(s&65280)<<8|(e&255)<<8|e>>8}}},Id=function(s,e,t,r,i){if(!i&&(i={l:1},e.dictionary)){var n=e.dictionary.subarray(-32768),o=new Ee(n.length+s.length);o.set(n),o.set(s,n.length),s=o,i.w=n.length}return Dd(s,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(s.length)))*1.5):20:12+e.mem,t,r,i)},wl=function(s,e,t){for(;t;++e)s[e]=t,t>>>=8},Rd=function(s,e){var t=e.level,r=t==0?0:t<6?1:t==9?3:2;if(s[0]=120,s[1]=r<<6|(e.dictionary&&32),s[1]|=31-(s[0]<<8|s[1])%31,e.dictionary){var i=bl();i.p(e.dictionary),wl(s,2,i.d())}},Ud=function(s,e){return((s[0]&15)!=8||s[0]>>4>7||(s[0]<<8|s[1])%31)&&rt(6,"invalid zlib data"),(s[1]>>5&1)==1&&rt(6,"invalid zlib data: "+(s[1]&32?"need":"unexpected")+" dictionary"),(s[1]>>3&4)+2};function Bd(s,e){e||(e={});var t=bl();t.p(s);var r=Id(s,e,e.dictionary?6:2,4);return Rd(r,e),wl(r,r.length-4,t.d()),r}function Ld(s,e){return Od(s.subarray(Ud(s),-4),{i:2},e,e)}var Nd=typeof TextDecoder<"u"&&new TextDecoder,Fd=0;try{Nd.decode(_l,{stream:!0}),Fd=1}catch{}const $d="modern-font";function ti(s,e){if(!s)throw new Error(`[${$d}] ${e}`)}function zd(s){if("buffer"in s){const e=s.buffer;return s.byteOffset>0||s.byteLength<s.buffer.byteLength?e.slice(s.byteOffset,s.byteOffset+s.byteLength):e}else return s}function gr(s){return"buffer"in s?new DataView(s.buffer,s.byteOffset,s.byteLength):new DataView(s)}function Vd(s){let e="";for(let t=0,r=s.length,i;t<r;t++)i=s.charCodeAt(t),i!==0&&(e+=String.fromCharCode(i));return e}function Ni(s){s=Vd(s);const e=[];for(let t=0,r=s.length,i;t<r;t++)i=s.charCodeAt(t),e.push(i>>8),e.push(i&255);return e}function Gd(s){let e="";for(let t=0,r=s.length;t<r;t++)s[t]<127?e+=String.fromCharCode(s[t]):e+=`%${(256+s[t]).toString(16).slice(1)}`;return unescape(e)}function jd(s){let e="";for(let t=0,r=s.length;t<r;t+=2)e+=String.fromCharCode((s[t]<<8)+s[t+1]);return e}var Wd=Object.defineProperty,Me=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&Wd(e,t,i),i};const ri={int8:1,int16:2,int32:4,uint8:1,uint16:2,uint32:4,float32:4,float64:8,fixed:4,longDateTime:8,char:1};function Ae(){return function(s,e){Object.defineProperty(s.constructor.prototype,e,{get(){if(typeof e=="string"){if(e.startsWith("read"))return(...t)=>this.read(e.substring(4).toLowerCase(),...t);if(e.startsWith("write"))return(...t)=>this.write(e.substring(5).toLowerCase(),...t)}},configurable:!0,enumerable:!0})}}class me extends DataView{constructor(e,t,r,i){super(zd(e),t,r),this.littleEndian=i}cursor=0;readColumn(e){if(e.size){const t=Array.from({length:e.size},(r,i)=>this.read(e.type,e.offset+i));switch(e.type){case"char":return t.join("");default:return t}}else return this.read(e.type,e.offset)}writeColumn(e,t){e.size?Array.from({length:e.size},(r,i)=>{this.write(e.type,t[i],e.offset+i)}):this.write(e.type,t,e.offset)}read(e,t=this.cursor,r=this.littleEndian){switch(e){case"char":return this.readChar(t);case"fixed":return this.readFixed(t,r);case"longDateTime":return this.readLongDateTime(t,r)}const i=`get${e.replace(/^\S/,l=>l.toUpperCase())}`,n=this,a=n[i]?.bind(n)?.(t,r);return this.cursor+=ri[e],a}readUint24(e=this.cursor){const[t,r,i]=this.readBytes(e,3);return(t<<16)+(r<<8)+i}readBytes(e,t){t==null&&(t=e,e=this.cursor);const r=[];for(let i=0;i<t;++i)r.push(this.getUint8(e+i));return this.cursor=e+t,r}readString(e,t){const r=this.readBytes(e,t);let i="";for(let n=0,o=r.length;n<o;n++)i+=String.fromCharCode(r[n]);return i}readFixed(e,t){const r=this.readInt32(e,t)/65536;return Math.ceil(r*1e5)/1e5}readLongDateTime(e=this.cursor,t){const r=this.readUint32(e+4,t),i=new Date;return i.setTime(r*1e3+-20775456e5),i}readChar(e){return this.readString(e,1)}write(e,t,r=this.cursor,i=this.littleEndian){switch(e){case"char":return this.writeChar(t,r);case"fixed":return this.writeFixed(t,r);case"longDateTime":return this.writeLongDateTime(t,r)}const n=`set${e.replace(/^\S/,c=>c.toUpperCase())}`,o=this,l=o[n]?.bind(o)?.(r,t,i);return this.cursor+=ri[e.toLowerCase()],l}writeString(e="",t=this.cursor){const r=e.replace(/[^\x00-\xFF]/g,"11").length;this.seek(t);for(let i=0,n=e.length,o;i<n;++i)o=e.charCodeAt(i)||0,o>127?this.writeUint16(o):this.writeUint8(o);return this.cursor+=r,this}writeChar(e,t){return this.writeString(e,t)}writeFixed(e,t){return this.writeInt32(Math.round(e*65536),t),this}writeLongDateTime(e,t=this.cursor){typeof e>"u"?e=-20775456e5:typeof e.getTime=="function"?e=e.getTime():/^\d+$/.test(e)?e=+e:e=Date.parse(e);const i=Math.round((e- -20775456e5)/1e3);return this.writeUint32(0,t),this.writeUint32(i,t+4),this}writeBytes(e,t=this.cursor){let r;if(Array.isArray(e)){r=e.length;for(let i=0;i<r;++i)this.setUint8(t+i,e[i])}else{const i=gr(e);r=i.byteLength;for(let n=0;n<r;++n)this.setUint8(t+n,i.getUint8(n))}return this.cursor=t+r,this}seek(e){return this.cursor=e,this}}Me([Ae()],me.prototype,"readInt8"),Me([Ae()],me.prototype,"readInt16"),Me([Ae()],me.prototype,"readInt32"),Me([Ae()],me.prototype,"readUint8"),Me([Ae()],me.prototype,"readUint16"),Me([Ae()],me.prototype,"readUint32"),Me([Ae()],me.prototype,"readFloat32"),Me([Ae()],me.prototype,"readFloat64"),Me([Ae()],me.prototype,"writeInt8"),Me([Ae()],me.prototype,"writeInt16"),Me([Ae()],me.prototype,"writeInt32"),Me([Ae()],me.prototype,"writeUint8"),Me([Ae()],me.prototype,"writeUint16"),Me([Ae()],me.prototype,"writeUint32"),Me([Ae()],me.prototype,"writeFloat32"),Me([Ae()],me.prototype,"writeFloat64");const xl=new WeakMap;function _(s){const e=typeof s=="object"?s:{type:s},{size:t=1,type:r}=e;return(i,n)=>{if(typeof n!="string")return;let o=xl.get(i);o||(o={columns:[],byteLength:0},xl.set(i,o));const a={...e,name:n,byteLength:t*ri[r],offset:e.offset??o.columns.reduce((l,c)=>l+c.byteLength,0)};o.columns.push(a),o.byteLength=o.columns.reduce((l,c)=>l+ri[c.type]*(c.size??1),0),Object.defineProperty(i.constructor.prototype,n,{get(){return this.view.readColumn(a)},set(l){this.view.writeColumn(a,l)},configurable:!0,enumerable:!0})}}class qe{view;constructor(e,t,r,i){this.view=new me(e,t,r,i)}}class Fi extends qe{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(e){return new FontFace(e,this.view.buffer)}}var qd=Object.defineProperty,De=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&qd(e,t,i),i};const Ie=class lc extends Fi{format="EmbeddedOpenType";mimeType="application/vnd.ms-fontobject";static from(e){const t=e.sfnt,i=t.name.names,n=Ni(i.fontFamily||""),o=n.length,a=Ni(i.fontStyle||""),l=a.length,c=Ni(i.version||""),h=c.length,f=Ni(i.fullName||""),d=f.length,g=86+o+4+l+4+h+4+d+2+e.view.byteLength,p=new lc(new ArrayBuffer(g),0,g,!0);p.EOTSize=p.view.byteLength,p.FontDataSize=e.view.byteLength,p.Version=131073,p.Flags=0,p.Charset=1,p.MagicNumber=20556,p.Padding1=0,p.CheckSumAdjustment=t.head.checkSumAdjustment;const y=t.os2;return y&&(p.FontPANOSE=y.fontPANOSE,p.Italic=y.fsSelection,p.Weight=y.usWeightClass,p.fsType=y.fsType,p.UnicodeRange=y.ulUnicodeRange,p.CodePageRange=y.ulCodePageRange),p.view.writeUint16(o),p.view.writeBytes(n),p.view.writeUint16(0),p.view.writeUint16(l),p.view.writeBytes(a),p.view.writeUint16(0),p.view.writeUint16(h),p.view.writeBytes(c),p.view.writeUint16(0),p.view.writeUint16(d),p.view.writeBytes(f),p.view.writeUint16(0),p.view.writeUint16(0),p.view.writeBytes(e.view),p}};De([_("uint32")],Ie.prototype,"EOTSize"),De([_("uint32")],Ie.prototype,"FontDataSize"),De([_("uint32")],Ie.prototype,"Version"),De([_("uint32")],Ie.prototype,"Flags"),De([_({type:"uint8",size:10})],Ie.prototype,"FontPANOSE"),De([_("uint8")],Ie.prototype,"Charset"),De([_("uint8")],Ie.prototype,"Italic"),De([_("uint32")],Ie.prototype,"Weight"),De([_("uint16")],Ie.prototype,"fsType"),De([_("uint16")],Ie.prototype,"MagicNumber"),De([_({type:"uint8",size:16})],Ie.prototype,"UnicodeRange"),De([_({type:"uint8",size:8})],Ie.prototype,"CodePageRange"),De([_("uint32")],Ie.prototype,"CheckSumAdjustment"),De([_({type:"uint8",size:16})],Ie.prototype,"Reserved"),De([_("uint16")],Ie.prototype,"Padding1");var Xd=Object.defineProperty,$i=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&Xd(e,t,i),i};class mr extends qe{constructor(e,t){super(e,t,16)}}$i([_({type:"char",size:4})],mr.prototype,"tag"),$i([_("uint32")],mr.prototype,"checkSum"),$i([_("uint32")],mr.prototype,"offset"),$i([_("uint32")],mr.prototype,"length");const gn=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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"],Hd=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","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 mn{index;name;isComposite=!1;components=[];pathCommands=[];constructor(e){const t={...e};if(this.index=t.index??0,t.name===".notdef"?t.unicode=void 0:t.name===".null"&&(t.unicode=0),t.unicode===0&&t.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=t.name??null,t.unicode&&(this.unicode=t.unicode),t.unicodes?this.unicodes=t.unicodes:t.unicode&&(this.unicodes=[t.unicode])}getPathCommands(e=0,t=0,r=72,i={},n){const o=1/(n?.unitsPerEm??1e3)*r,{xScale:a=o,yScale:l=o}=i,c=this.pathCommands,h=[];for(let f=0,d=c.length;f<d;f+=1){const g=c[f];g.type==="M"?h.push({type:"M",x:e+g.x*a,y:t+-g.y*l}):g.type==="L"?h.push({type:"L",x:e+g.x*a,y:t+-g.y*l}):g.type==="Q"?h.push({type:"Q",x1:e+g.x1*a,y1:t+-g.y1*l,x:e+g.x*a,y:t+-g.y*l}):g.type==="C"?h.push({type:"C",x1:e+g.x1*a,y1:t+-g.y1*l,x2:e+g.x2*a,y2:t+-g.y2*l,x:e+g.x*a,y:t+-g.y*l}):g.type==="Z"&&h.push({type:"Z"})}return h}}class Yd extends mn{parse(e,t,r){const i=this,{nominalWidthX:n,defaultWidthX:o,gsubrsBias:a,subrsBias:l}=e,c=e.topDict.paintType,h=this.index;let f,d,g,p;const y=[],m=[];let P=0,E=!1,x=!1,C=o,v=0,b=0;function S(B,k){y.push({type:"L",x:B,y:k})}function T(B,k,H,D,N,$){y.push({type:"C",x1:B,y1:k,x2:H,y2:D,x:N,y:$})}function R(B,k){x&&c!==2&&G(),x=!0,y.push({type:"M",x:B,y:k})}function G(){y.push({type:"Z"})}function U(B){y.push(...B)}function L(){m.length%2!==0&&!E&&(C=m.shift()+n),P+=m.length>>1,m.length=0,E=!0}function V(B){let k,H,D,N,$,I,j,A,M,F,z,Y,J=0;for(;J<B.length;){let ae=B[J++];switch(ae){case 1:L();break;case 3:L();break;case 4:m.length>1&&!E&&(C=m.shift()+n,E=!0),b+=m.pop(),R(v,b);break;case 5:for(;m.length>0;)v+=m.shift(),b+=m.shift(),S(v,b);break;case 6:for(;m.length>0&&(v+=m.shift(),S(v,b),m.length!==0);)b+=m.shift(),S(v,b);break;case 7:for(;m.length>0&&(b+=m.shift(),S(v,b),m.length!==0);)v+=m.shift(),S(v,b);break;case 8:for(;m.length>0;)f=v+m.shift(),d=b+m.shift(),g=f+m.shift(),p=d+m.shift(),v=g+m.shift(),b=p+m.shift(),T(f,d,g,p,v,b);break;case 10:$=m.pop()+l,I=e.subrs[$],I&&V(I);break;case 11:return;case 12:switch(ae=B[J],J+=1,ae){case 35:f=v+m.shift(),d=b+m.shift(),g=f+m.shift(),p=d+m.shift(),j=g+m.shift(),A=p+m.shift(),M=j+m.shift(),F=A+m.shift(),z=M+m.shift(),Y=F+m.shift(),v=z+m.shift(),b=Y+m.shift(),m.shift(),T(f,d,g,p,j,A),T(M,F,z,Y,v,b);break;case 34:f=v+m.shift(),d=b,g=f+m.shift(),p=d+m.shift(),j=g+m.shift(),A=p,M=j+m.shift(),F=p,z=M+m.shift(),Y=b,v=z+m.shift(),T(f,d,g,p,j,A),T(M,F,z,Y,v,b);break;case 36:f=v+m.shift(),d=b+m.shift(),g=f+m.shift(),p=d+m.shift(),j=g+m.shift(),A=p,M=j+m.shift(),F=p,z=M+m.shift(),Y=F+m.shift(),v=z+m.shift(),T(f,d,g,p,j,A),T(M,F,z,Y,v,b);break;case 37:f=v+m.shift(),d=b+m.shift(),g=f+m.shift(),p=d+m.shift(),j=g+m.shift(),A=p+m.shift(),M=j+m.shift(),F=A+m.shift(),z=M+m.shift(),Y=F+m.shift(),Math.abs(z-v)>Math.abs(Y-b)?v=z+m.shift():b=Y+m.shift(),T(f,d,g,p,j,A),T(M,F,z,Y,v,b);break;default:console.warn(`Glyph ${h}: unknown operator ${1200+ae}`),m.length=0}break;case 14:if(m.length>=4){const _t=gn[m.pop()],Ze=gn[m.pop()],Be=m.pop(),$e=m.pop();if(_t&&Ze){i.isComposite=!0,i.components=[];const Pe=e.charset.indexOf(_t),ze=e.charset.indexOf(Ze);i.components.push({glyphIndex:ze,dx:0,dy:0}),i.components.push({glyphIndex:Pe,dx:$e,dy:Be}),U(r.get(ze).pathCommands);const st=JSON.parse(JSON.stringify(r.get(Pe).pathCommands));for(let nt=0;nt<st.length;nt+=1){const Je=st[nt];Je.type!=="Z"&&(Je.x+=$e,Je.y+=Be),(Je.type==="Q"||Je.type==="C")&&(Je.x1+=$e,Je.y1+=Be),Je.type==="C"&&(Je.x2+=$e,Je.y2+=Be)}U(st)}}else m.length>0&&!E&&(C=m.shift()+n,E=!0);x&&c!==2&&(G(),x=!1);break;case 18:L();break;case 19:case 20:L(),J+=P+7>>3;break;case 21:m.length>2&&!E&&(C=m.shift()+n,E=!0),b+=m.pop(),v+=m.pop(),R(v,b);break;case 22:m.length>1&&!E&&(C=m.shift()+n,E=!0),v+=m.pop(),R(v,b);break;case 23:L();break;case 24:for(;m.length>2;)f=v+m.shift(),d=b+m.shift(),g=f+m.shift(),p=d+m.shift(),v=g+m.shift(),b=p+m.shift(),T(f,d,g,p,v,b);v+=m.shift(),b+=m.shift(),S(v,b);break;case 25:for(;m.length>6;)v+=m.shift(),b+=m.shift(),S(v,b);f=v+m.shift(),d=b+m.shift(),g=f+m.shift(),p=d+m.shift(),v=g+m.shift(),b=p+m.shift(),T(f,d,g,p,v,b);break;case 26:for(m.length%2&&(v+=m.shift());m.length>0;)f=v,d=b+m.shift(),g=f+m.shift(),p=d+m.shift(),v=g,b=p+m.shift(),T(f,d,g,p,v,b);break;case 27:for(m.length%2&&(b+=m.shift());m.length>0;)f=v+m.shift(),d=b,g=f+m.shift(),p=d+m.shift(),v=g+m.shift(),b=p,T(f,d,g,p,v,b);break;case 28:k=B[J],H=B[J+1],m.push((k<<24|H<<16)>>16),J+=2;break;case 29:$=m.pop()+a,I=e.gsubrs[$],I&&V(I);break;case 30:for(;m.length>0&&(f=v,d=b+m.shift(),g=f+m.shift(),p=d+m.shift(),v=g+m.shift(),b=p+(m.length===1?m.shift():0),T(f,d,g,p,v,b),m.length!==0);)f=v+m.shift(),d=b,g=f+m.shift(),p=d+m.shift(),b=p+m.shift(),v=g+(m.length===1?m.shift():0),T(f,d,g,p,v,b);break;case 31:for(;m.length>0&&(f=v+m.shift(),d=b,g=f+m.shift(),p=d+m.shift(),b=p+m.shift(),v=g+(m.length===1?m.shift():0),T(f,d,g,p,v,b),m.length!==0);)f=v,d=b+m.shift(),g=f+m.shift(),p=d+m.shift(),v=g+m.shift(),b=p+(m.length===1?m.shift():0),T(f,d,g,p,v,b);break;default:ae<32?console.warn(`Glyph ${h}: unknown operator ${ae}`):ae<247?m.push(ae-139):ae<251?(k=B[J],J+=1,m.push((ae-247)*256+k+108)):ae<255?(k=B[J],J+=1,m.push(-(ae-251)*256-k-108)):(k=B[J],H=B[J+1],D=B[J+2],N=B[J+3],J+=4,m.push((k<<24|H<<16|D<<8|N)/65536))}}}V(t),this.pathCommands=y,E&&(this.advanceWidth=C)}}class yn{constructor(e){this._sfnt=e}_items=[];get(e){const t=this._items[e];let r;if(t)r=t;else{r=this._get(e);const i=this._sfnt.hmtx.metrics[e];i&&(r.advanceWidth=r.advanceWidth||i.advanceWidth,r.leftSideBearing=r.leftSideBearing||i.leftSideBearing);const n=this._sfnt.cmap.glyphIndexToUnicodesMap.get(e);n&&(r.unicode??=n[0],r.unicodes??=n),this._items[e]=r}return r}}class Kd extends yn{get length(){return this._sfnt.cff.charStringsIndex.offsets.length-1}_get(e){const t=this._sfnt.cff,r=new Yd({index:e});return r.parse(t,t.charStringsIndex.get(e),this),r.name=t.charset[e],r}}var Zd=Object.defineProperty,Pl=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&Zd(e,t,i),i};class zi extends qe{_offsets;get offsets(){return this._offsets??=this.readOffsets()}_objects;get objects(){return this._objects??=this.readObjects()}constructor(e,t,r,i){super(e,t,r,i),this._init()}_init(){const e=this.view,t=this.count,r=this.offsetSize;this.objectOffset=(t+1)*r+2,this.endOffset=e.byteOffset+this.objectOffset+this.offsets[t]}readOffsets(){const e=this.view,t=this.count,r=this.offsetSize;e.seek(3);const i=[];for(let n=0,o=t+1;n<o;n++){const a=this.view;let l=0;for(let c=0;c<r;c++)l<<=8,l+=a.readUint8();i.push(l)}return i}readObjects(){const e=[];for(let t=0,r=this.count;t<r;t++)e.push(this.get(t));return e}get(e){const t=this.offsets,r=this.objectOffset,i=r+t[e],o=r+t[e+1]-i;return this._isString?this.view.readString(i,o):this.view.readBytes(i,o)}}Pl([_("uint16")],zi.prototype,"count"),Pl([_("uint8")],zi.prototype,"offsetSize");class Vi extends zi{_isString=!1}class Sl extends zi{_isString=!0}const Jd=[".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"],Qd=[".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"],ep=[".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"],tp=[".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 Gi(s,e){return e<=390?Jd[e]:s[e-391]}function re(s,e="number",t){return(r,i)=>{if(typeof i!="string")return;const n={type:e,operator:s,default:t??e==="number"?0:void 0};Object.defineProperty(r.constructor.prototype,i,{get(){return this._getProp(n)},set(o){this._setProp(n,o)},configurable:!0,enumerable:!0})}}class Cl extends qe{_dict;get dict(){return this._dict??=this._readDict()}_stringIndex;setStringIndex(e){return this._stringIndex=e,this}_readFloatOperand(){const e=this.view;let t="";const r=15,i=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];for(;;){const n=e.readUint8(),o=n>>4,a=n&15;if(o===r||(t+=i[o],a===r))break;t+=i[a]}return Number.parseFloat(t)}_readOperand(e){const t=this.view;let r,i,n,o;if(e===28)return r=t.readUint8(),i=t.readUint8(),r<<8|i;if(e===29)return r=t.readUint8(),i=t.readUint8(),n=t.readUint8(),o=t.readUint8(),r<<24|i<<16|n<<8|o;if(e===30)return this._readFloatOperand();if(e>=32&&e<=246)return e-139;if(e>=247&&e<=250)return r=t.readUint8(),(e-247)*256+r+108;if(e>=251&&e<=254)return r=t.readUint8(),-(e-251)*256-r-108;throw new Error(`invalid b0 ${e}, at: ${t.cursor}`)}_readDict(){const e=this.view;e.seek(0);let t=[];const r=e.cursor+e.byteLength,i={};for(;e.cursor<r;){let n=e.readUint8();n<=21?(n===12&&(n=1200+e.readUint8()),i[n]=t,t=[]):t.push(this._readOperand(n))}return i}_getProp(e){const t=this.dict[e.operator]??e.default;switch(e.type){case"number":return t[0];case"string":return Gi(this._stringIndex?.objects??[],t[0]);case"number[]":return t}return t}_setProp(e,t){}}var rp=Object.defineProperty,vn=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&rp(e,t,i),i};class ji extends Cl{}vn([re(19)],ji.prototype,"subrs"),vn([re(20)],ji.prototype,"defaultWidthX"),vn([re(21)],ji.prototype,"nominalWidthX");var ip=Object.defineProperty,ce=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&ip(e,t,i),i};class oe extends Cl{}ce([re(0,"string")],oe.prototype,"version"),ce([re(1,"string")],oe.prototype,"notice"),ce([re(1200,"string")],oe.prototype,"copyright"),ce([re(2,"string")],oe.prototype,"fullName"),ce([re(3,"string")],oe.prototype,"familyName"),ce([re(4,"string")],oe.prototype,"weight"),ce([re(1201)],oe.prototype,"isFixedPitch"),ce([re(1202)],oe.prototype,"italicAngle"),ce([re(1203,"number",-100)],oe.prototype,"underlinePosition"),ce([re(1204,"number",50)],oe.prototype,"underlineThickness"),ce([re(1205)],oe.prototype,"paintType"),ce([re(1206,"number",2)],oe.prototype,"charstringType"),ce([re(1207,"number[]",[.001,0,0,.001,0,0])],oe.prototype,"fontMatrix"),ce([re(13)],oe.prototype,"uniqueId"),ce([re(5,"number[]",[0,0,0,0])],oe.prototype,"fontBBox"),ce([re(1208)],oe.prototype,"strokeWidth"),ce([re(14)],oe.prototype,"xuid"),ce([re(15)],oe.prototype,"charset"),ce([re(16)],oe.prototype,"encoding"),ce([re(17)],oe.prototype,"charStrings"),ce([re(18,"number[]",[0,0])],oe.prototype,"private");function be(s,e=s){return t=>{pt.tableDefinitions.set(s,{tag:s,prop:e,class:t}),Object.defineProperty(pt.prototype,e,{get(){return this.get(s)},set(r){return this.set(s,r)},configurable:!0,enumerable:!0})}}class pt{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(e){let t=this.cmap.unicodeToGlyphIndexMap.get(e.codePointAt(0));if(t===void 0&&!this.hasGlyf){const{encoding:r,charset:i}=this.cff;t=i.indexOf(r[e.codePointAt(0)])}return t??0}charToGlyph(e){return this.glyphs.get(this.charToGlyphIndex(e))}textToGlyphIndexes(e){const t=[];for(const r of e)t.push(this.charToGlyphIndex(r));return t}textToGlyphs(e){const t=this.glyphs,r=this.textToGlyphIndexes(e),i=r.length,n=Array.from({length:i}),o=t.get(0);for(let a=0;a<i;a+=1)n[a]=t.get(r[a])||o;return n}getPathCommands(e,t,r,i,n){const o=[];return this.forEachGlyph(e,t,r,i,n,(a,l,c,h,f)=>{o.push(...a.getPathCommands(l,c,h,f,this))}),o}getAdvanceWidth(e,t,r){return this.forEachGlyph(e,0,0,t,r,()=>{})}forEachGlyph(e,t=0,r=0,i=72,n={},o){const a=1/this.unitsPerEm*i,l=this.textToGlyphs(e);for(let c=0;c<l.length;c+=1){const h=l[c];o.call(this,h,t,r,i,n),h.advanceWidth&&(t+=h.advanceWidth*a),n.letterSpacing?t+=n.letterSpacing*i:n.tracking&&(t+=n.tracking/1e3*i)}return t}constructor(e){(e instanceof Map?e:new Map(Object.entries(e))).forEach((r,i)=>{this.tableViews.set(i,new DataView(r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength)))})}clone(){return new pt(this.tableViews)}delete(e){const t=pt.tableDefinitions.get(e);return t?(this.tableViews.delete(e),this.tables.delete(t.prop),this):this}set(e,t){const r=pt.tableDefinitions.get(e);return r&&this.tables.set(r.prop,t),this.tableViews.set(e,t.view),this}get(e){const t=pt.tableDefinitions.get(e);if(!t)return;let r=this.tables.get(t.prop);if(!r){const i=t.class;if(i){const n=this.tableViews.get(e);if(!n)return;r=new i(n.buffer,n.byteOffset,n.byteLength).setSFNT(this),this.tables.set(t.prop,r)}}return r}}class Oe extends qe{setSFNT(e){return this._sfnt=e,this}getSFNT(){return this._sfnt}}var sp=Object.defineProperty,np=Object.getOwnPropertyDescriptor,ii=(s,e,t,r)=>{for(var i=r>1?void 0:r?np(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&sp(e,t,i),i};let Qt=class extends Oe{_glyphs;get glyphs(){return this._glyphs??=new Kd(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(s,e,t,r){super(s,e,t,r),this._init()}_init(){const s=this.view,{buffer:e,byteOffset:t}=s,r=t+4;this.nameIndex=new Sl(e,r),this.topDictIndex=new Vi(e,this.nameIndex.endOffset),this.stringIndex=new Sl(e,this.topDictIndex.endOffset),this.globalSubrIndex=new Vi(e,this.stringIndex.endOffset),this.topDict=new oe(new Uint8Array(this.topDictIndex.objects[0]).buffer).setStringIndex(this.stringIndex);const i=this.topDict.private[0],n=this.topDict.private[1];i&&(this.privateDict=new ji(e,t+n,i).setStringIndex(this.stringIndex),this.privateDict.subrs&&(this.subrsIndex=new Vi(e,t+n+this.privateDict.subrs))),this.charStringsIndex=new Vi(e,t+this.topDict.charStrings);const o=this.charStringsIndex.offsets.length-1;this.topDict.charset===0?this.charset=Qd:this.topDict.charset===1?this.charset=ep:this.topDict.charset===2?this.charset=tp:this.charset=this._readCharset(t+this.topDict.charset,o,this.stringIndex.objects),this.topDict.encoding===0?this.encoding=gn:this.topDict.encoding===1?this.encoding=Hd:this.encoding=this._readEncoding(t+this.topDict.encoding)}_readCharset(s,e,t){const r=this.view;r.seek(s);let i,n,o;e-=1;const a=[".notdef"],l=r.readUint8();if(l===0)for(i=0;i<e;i+=1)n=r.readUint16(),a.push(Gi(t,n));else if(l===1)for(;a.length<=e;)for(n=r.readUint16(),o=r.readUint8(),i=0;i<=o;i+=1)a.push(Gi(t,n)),n+=1;else if(l===2)for(;a.length<=e;)for(n=r.readUint16(),o=r.readUint16(),i=0;i<=o;i+=1)a.push(Gi(t,n)),n+=1;else throw new Error(`Unknown charset format ${l}`);return a}_readEncoding(s){const e=this.view;e.seek(s);let t,r;const i={},n=e.readUint8();if(n===0){const o=e.readUint8();for(t=0;t<o;t+=1)r=e.readUint8(),i[r]=t}else if(n===1){const o=e.readUint8();for(r=1,t=0;t<o;t+=1){const a=e.readUint8(),l=e.readUint8();for(let c=a;c<=a+l;c+=1)i[c]=r,r+=1}}else console.warn(`unknown encoding format:${n}`);return i}_calcSubroutineBias(s){let e;return s.length<1240?e=107:s.length<33900?e=1131:e=32768,e}};ii([_("uint8")],Qt.prototype,"majorVersion",2),ii([_("uint8")],Qt.prototype,"minorVersion",2),ii([_("uint8")],Qt.prototype,"headerSize",2),ii([_("uint8")],Qt.prototype,"offsetSize",2),Qt=ii([be("CFF ","cff")],Qt);var op=Object.defineProperty,Wi=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&op(e,t,i),i};const si=class cc extends qe{constructor(e=new ArrayBuffer(262),t){super(e,t,262)}static from(e){const t=new cc;return t.format=0,t.length=t.view.byteLength,t.language=0,e.forEach((r,i)=>{i<256&&r<256&&t.view.writeUint8(r,6+i)}),t}getUnicodeToGlyphIndexMap(){const e=new Map;return this.glyphIndexArray.forEach((t,r)=>{e.set(r,t)}),e}};Wi([_("uint16")],si.prototype,"format"),Wi([_("uint16")],si.prototype,"length"),Wi([_("uint16")],si.prototype,"language"),Wi([_({type:"uint8",size:256})],si.prototype,"glyphIndexArray");let _n=si;var ap=Object.defineProperty,bn=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&ap(e,t,i),i};class ni extends qe{get subHeaderKeys(){return this.view.seek(6),Array.from({length:256},()=>this.view.readUint16()/8)}get maxSubHeaderKey(){return this.subHeaderKeys.reduce((e,t)=>Math.max(e,t),0)}get subHeaders(){const e=this.maxSubHeaderKey;return this.view.seek(6+256*2),Array.from({length:e},(t,r)=>({firstCode:this.view.readUint16(),entryCount:this.view.readUint16(),idDelta:this.view.readUint16(),idRangeOffset:(this.view.readUint16()-(e-r)*8-2)/2}))}get glyphIndexArray(){const e=this.maxSubHeaderKey,t=6+256*2+e*8;this.view.seek(t);const r=(this.view.byteLength-t)/2;return Array.from({length:r},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(e){const t=new Map,r=this.subHeaderKeys,i=this.maxSubHeaderKey,n=this.subHeaders,o=this.glyphIndexArray,a=r.findIndex(c=>c===i);let l=0;for(let c=0;c<256;c++)if(r[c]===0)c>=a||c<n[0].firstCode||c>=n[0].firstCode+n[0].entryCount||n[0].idRangeOffset+(c-n[0].firstCode)>=o.length?l=0:(l=o[n[0].idRangeOffset+(c-n[0].firstCode)],l!==0&&(l=l+n[0].idDelta)),l!==0&&l<e&&t.set(c,l);else{const h=r[c];for(let f=0,d=n[h].entryCount;f<d;f++)if(n[h].idRangeOffset+f>=o.length?l=0:(l=o[n[h].idRangeOffset+f],l!==0&&(l=l+n[h].idDelta)),l!==0&&l<e){const g=(c<<8|f+n[h].firstCode)%65535;t.set(g,l)}}return t}}bn([_("uint16")],ni.prototype,"format"),bn([_("uint16")],ni.prototype,"length"),bn([_("uint16")],ni.prototype,"language");function Tl(s){return s>32767?s-65536:s<-32767?s+65536:s}function wn(s,e){let t;const r=[];let i={};return s.forEach((n,o)=>{e&&o>e||((!t||o!==t.unicode+1||n!==t.glyphIndex+1)&&(t?(i.end=t.unicode,r.push(i),i={start:o,startId:n,delta:Tl(n-o)}):(i.start=Number(o),i.startId=n,i.delta=Tl(n-o))),t={unicode:o,glyphIndex:n})}),t&&(i.end=t.unicode,r.push(i)),r}var lp=Object.defineProperty,er=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&lp(e,t,i),i};const $t=class hc extends qe{get endCode(){const e=this.segCountX2;return this.view.seek(14),Array.from({length:e/2},()=>this.view.readUint16())}set endCode(e){this.view.seek(14),e.forEach(t=>this.view.writeUint16(t))}get reservedPad(){return this.view.readUint16(14+this.segCountX2)}set reservedPad(e){this.view.writeUint16(e,14+this.segCountX2)}get startCode(){const e=this.segCountX2;return this.view.seek(14+e+2),Array.from({length:e/2},()=>this.view.readUint16())}set startCode(e){this.view.seek(14+this.segCountX2+2),e.forEach(t=>this.view.writeUint16(t))}get idDelta(){const e=this.segCountX2;return this.view.seek(14+e+2+e),Array.from({length:e/2},()=>this.view.readUint16())}set idDelta(e){const t=this.segCountX2;this.view.seek(14+t+2+t),e.forEach(r=>this.view.writeUint16(r))}get idRangeOffsetCursor(){const e=this.segCountX2;return 14+e+2+e*2}get idRangeOffset(){const e=this.segCountX2;return this.view.seek(this.idRangeOffsetCursor),Array.from({length:e/2},()=>this.view.readUint16())}set idRangeOffset(e){this.view.seek(this.idRangeOffsetCursor),e.forEach(t=>this.view.writeUint16(t))}get glyphIndexArrayCursor(){const e=this.segCountX2;return 14+e+2+e*3}get glyphIndexArray(){const e=this.glyphIndexArrayCursor;this.view.seek(e);const t=(this.view.byteLength-e)/2;return Array.from({length:t},()=>this.view.readUint16())}static from(e){const t=wn(e,65535),r=t.length+1,i=Math.floor(Math.log(r)/Math.LN2),n=2*2**i,o=new hc(new ArrayBuffer(24+t.length*8));return o.format=4,o.length=o.view.byteLength,o.language=0,o.segCountX2=r*2,o.searchRange=n,o.entrySelector=i,o.rangeShift=2*r-n,o.endCode=[...t.map(a=>a.end),65535],o.reservedPad=0,o.startCode=[...t.map(a=>a.start),65535],o.idDelta=[...t.map(a=>a.delta),1],o.idRangeOffset=Array.from({length:r},()=>0),o}getUnicodeToGlyphIndexMap(){const e=new Map,t=this.segCountX2/2,r=(this.glyphIndexArrayCursor-this.idRangeOffsetCursor)/2,i=this.startCode,n=this.endCode,o=this.idRangeOffset,a=this.idDelta,l=this.glyphIndexArray;for(let c=0;c<t;++c)for(let h=i[c],f=n[c];h<=f;++h)if(o[c]===0)e.set(h,(h+a[c])%65536);else{const d=c+o[c]/2+(h-i[c])-r,g=l[d];g!==0?e.set(h,(g+a[c])%65536):e.set(h,0)}return e.delete(65535),e}};er([_("uint16")],$t.prototype,"format"),er([_("uint16")],$t.prototype,"length"),er([_("uint16")],$t.prototype,"language"),er([_("uint16")],$t.prototype,"segCountX2"),er([_("uint16")],$t.prototype,"searchRange"),er([_("uint16")],$t.prototype,"entrySelector"),er([_("uint16")],$t.prototype,"rangeShift");let xn=$t;var cp=Object.defineProperty,oi=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&cp(e,t,i),i};class tr extends qe{get glyphIndexArray(){return this.view.seek(12),Array.from({length:this.entryCount},()=>this.view.readUint16())}getUnicodeToGlyphIndexMap(){const e=this.glyphIndexArray,t=new Map;return e.forEach((r,i)=>{t.set(i,r)}),t}}oi([_("uint16")],tr.prototype,"format"),oi([_("uint16")],tr.prototype,"length"),oi([_("uint16")],tr.prototype,"language"),oi([_("uint16")],tr.prototype,"firstCode"),oi([_("uint16")],tr.prototype,"entryCount");var hp=Object.defineProperty,ai=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&hp(e,t,i),i};const yr=class uc extends qe{get groups(){const e=this.nGroups;return this.view.seek(16),Array.from({length:e},()=>({startCharCode:this.view.readUint32(),endCharCode:this.view.readUint32(),startGlyphCode:this.view.readUint32()}))}static from(e){const t=wn(e),r=new uc(new ArrayBuffer(16+t.length*12));return r.format=12,r.reserved=0,r.length=r.view.byteLength,r.language=0,r.nGroups=t.length,t.forEach(i=>{r.view.writeUint32(i.start),r.view.writeUint32(i.end),r.view.writeUint32(i.startId)}),r}getUnicodeToGlyphIndexMap(){const e=new Map,t=this.groups;for(let r=0,i=t.length;r<i;r++){const n=t[r];let o=n.startGlyphCode,a=n.startCharCode;const l=n.endCharCode;for(;a<=l;)e.set(a++,o++)}return e}};ai([_("uint16")],yr.prototype,"format"),ai([_("uint16")],yr.prototype,"reserved"),ai([_("uint32")],yr.prototype,"length"),ai([_("uint32")],yr.prototype,"language"),ai([_("uint32")],yr.prototype,"nGroups");let Pn=yr;var up=Object.defineProperty,Sn=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&up(e,t,i),i};class li extends qe{getVarSelectorRecords(){const e=this.numVarSelectorRecords;return this.view.seek(10),Array.from({length:e},()=>{const t={varSelector:this.view.readUint24(),defaultUVSOffset:this.view.readUint32(),unicodeValueRanges:[],nonDefaultUVSOffset:this.view.readUint32(),uVSMappings:[]};if(t.defaultUVSOffset){this.view.seek(t.defaultUVSOffset);const r=this.view.readUint32();t.unicodeValueRanges=Array.from({length:r},()=>({startUnicodeValue:this.view.readUint24(),additionalCount:this.view.readUint8()}))}if(t.nonDefaultUVSOffset){this.view.seek(t.nonDefaultUVSOffset);const r=this.view.readUint32();t.uVSMappings=Array.from({length:r},()=>({unicodeValue:this.view.readUint24(),glyphID:this.view.readUint16()}))}return t})}getUnicodeToGlyphIndexMap(){const e=new Map,t=this.getVarSelectorRecords();for(let r=0,i=t.length;r<i;r++){const{uVSMappings:n}=t[r];n.forEach(o=>{e.set(o.unicodeValue,o.glyphID)})}return e}}Sn([_("uint16")],li.prototype,"format"),Sn([_("uint32")],li.prototype,"length"),Sn([_("uint32")],li.prototype,"numVarSelectorRecords");var fp=Object.defineProperty,dp=Object.getOwnPropertyDescriptor,Cn=(s,e,t,r)=>{for(var i=r>1?void 0:r?dp(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&fp(e,t,i),i};let vr=class extends Oe{static from(s){const e=Array.from(s.keys()).some(h=>h>65535),t=xn.from(s),r=_n.from(s),i=e?Pn.from(s):void 0,n=4+(i?32:24),o=n+t.view.byteLength,a=o+r.view.byteLength,l=[{platformID:0,platformSpecificID:3,offset:n},{platformID:1,platformSpecificID:0,offset:o},{platformID:3,platformSpecificID:1,offset:n},i&&{platformID:3,platformSpecificID:10,offset:a}].filter(Boolean),c=new vr(new ArrayBuffer(4+8*l.length+t.view.byteLength+r.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(t.view,n),c.view.writeBytes(r.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 s=new Map,e=this.unicodeToGlyphIndexMap,t=Array.from(e.keys());for(let r=0,i=t.length;r<i;r++){const n=t[r],o=e.get(n);s.has(o)?s.get(o).push(n):s.set(o,[n])}this._glyphIndexToUnicodesMap=s}return this._glyphIndexToUnicodesMap}readSubtables(){const s=this.numberSubtables;return this.view.seek(4),Array.from({length:s},()=>({platformID:this.view.readUint16(),platformSpecificID:this.view.readUint16(),offset:this.view.readUint32()})).map(e=>{this.view.seek(e.offset);const t=this.view.readUint16();let r;switch(t){case 0:r=new _n(this.view.buffer,e.offset);break;case 2:r=new ni(this.view.buffer,e.offset,this.view.readUint16());break;case 4:r=new xn(this.view.buffer,e.offset,this.view.readUint16());break;case 6:r=new tr(this.view.buffer,e.offset,this.view.readUint16());break;case 12:r=new Pn(this.view.buffer,e.offset,this.view.readUint32(e.offset+4));break;case 14:default:r=new li(this.view.buffer,e.offset,this.view.readUint32());break}return{...e,format:t,view:r}})}readunicodeToGlyphIndexMap(){const s=this.readSubtables(),e=s.find(o=>o.format===0)?.view,t=s.find(o=>o.platformID===3&&o.platformSpecificID===3&&o.format===2)?.view,r=s.find(o=>o.platformID===3&&o.platformSpecificID===1&&o.format===4)?.view,i=s.find(o=>o.platformID===3&&o.platformSpecificID===10&&o.format===12)?.view,n=s.find(o=>o.platformID===0&&o.platformSpecificID===5&&o.format===14)?.view;return new Map([...e?.getUnicodeToGlyphIndexMap()??[],...t?.getUnicodeToGlyphIndexMap(this._sfnt.maxp.numGlyphs)??[],...r?.getUnicodeToGlyphIndexMap()??[],...i?.getUnicodeToGlyphIndexMap()??[],...n?.getUnicodeToGlyphIndexMap()??[]])}};Cn([_("uint16")],vr.prototype,"version",2),Cn([_("uint16")],vr.prototype,"numberSubtables",2),vr=Cn([be("cmap")],vr);class pp extends mn{_parseContours(e){const t=[];let r=[];for(let i=0;i<e.length;i+=1){const n=e[i];r.push(n),n.lastPointOfContour&&(t.push(r),r=[])}return ti(r.length===0,"There are still points left in the current contour."),t}_transformPoints(e,t){const r=[];for(let i=0;i<e.length;i+=1){const n=e[i],o={x:t.xScale*n.x+t.scale10*n.y+t.dx,y:t.scale01*n.x+t.yScale*n.y+t.dy,onCurve:n.onCurve,lastPointOfContour:n.lastPointOfContour};r.push(o)}return r}_parseGlyphCoordinate(e,t,r,i,n){let o;return(t&i)>0?(o=e.view.readUint8(),(t&n)===0&&(o=-o),o=r+o):(t&n)>0?o=r:o=r+e.view.readInt16(),o}parse(e,t,r){e.view.seek(t);const i=this.numberOfContours=e.view.readInt16();if(this.xMin=e.view.readInt16(),this.yMin=e.view.readInt16(),this.xMax=e.view.readInt16(),this.yMax=e.view.readInt16(),i>0){const a=this.endPointIndices=[];for(let y=0;y<i;y++)a.push(e.view.readUint16());const l=this.instructionLength=e.view.readUint16();ti(l<5e3,`Bad instructionLength:${l}`);const c=this.instructions=[];for(let y=0;y<l;++y)c.push(e.view.readUint8());const h=e.view.byteOffset,f=a[a.length-1]+1;ti(f<2e4,`Bad numberOfCoordinates:${h}`);const d=[];let g,p=0;for(;p<f;)if(g=e.view.readUint8(),d.push(g),p++,g&8&&p<f){const y=e.view.readUint8();for(let m=0;m<y;m++)d.push(g),p++}if(ti(d.length===f,`Bad flags length: ${d.length}, numberOfCoordinates: ${f}`),a.length>0){const y=[];let m;if(f>0){for(let x=0;x<f;x+=1)g=d[x],m={},m.onCurve=!!(g&1),m.lastPointOfContour=a.includes(x),y.push(m);let P=0;for(let x=0;x<f;x+=1)g=d[x],m=y[x],m.x=this._parseGlyphCoordinate(e,g,P,2,16),P=m.x;let E=0;for(let x=0;x<f;x+=1)g=d[x],m=y[x],m.y=this._parseGlyphCoordinate(e,g,E,4,32),E=m.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=e.view.readUint16();const c={glyphIndex:e.view.readUint16(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(a&1)>0?(a&2)>0?(c.dx=e.view.readInt16(),c.dy=e.view.readInt16()):c.matchedPoints=[e.view.readUint16(),e.view.readUint16()]:(a&2)>0?(c.dx=e.view.readInt8(),c.dy=e.view.readInt8()):c.matchedPoints=[e.view.readUint8(),e.view.readUint8()],(a&8)>0?c.xScale=c.yScale=e.view.readInt16()/16384:(a&64)>0?(c.xScale=e.view.readInt16()/16384,c.yScale=e.view.readInt16()/16384):(a&128)>0&&(c.xScale=e.view.readInt16()/16384,c.scale01=e.view.readInt16()/16384,c.scale10=e.view.readInt16()/16384,c.yScale=e.view.readInt16()/16384),this.components.push(c),l=!!(a&32)}if(a&256){this.instructionLength=e.view.readUint16(),this.instructions=[];for(let c=0;c<this.instructionLength;c+=1)this.instructions.push(e.view.readUint8())}}if(this.isComposite)for(let a=0;a<this.components.length;a+=1){const l=this.components[a],c=r.get(l.glyphIndex);if(c.getPathCommands(),c.points){let h;if(l.matchedPoints===void 0)h=this._transformPoints(c.points,l);else{ti(l.matchedPoints[0]>this.points.length-1||l.matchedPoints[1]>c.points.length-1,`Matched points out of range in ${this.name}`);const f=this.points[l.matchedPoints[0]];let d=c.points[l.matchedPoints[1]];const g={xScale:l.xScale,scale01:l.scale01,scale10:l.scale10,yScale:l.yScale,dx:0,dy:0};d=this._transformPoints([d],g)[0],g.dx=f.x-d.x,g.dy=f.y-d.y,h=this._transformPoints(c.points,g)}this.points=this.points.concat(h)}}const n=[],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],f=c[0];h.onCurve?n.push({type:"M",x:h.x,y:h.y}):f.onCurve?n.push({type:"M",x:f.x,y:f.y}):n.push({type:"M",x:(h.x+f.x)*.5,y:(h.y+f.y)*.5});for(let d=0,g=c.length;d<g;++d)if(h=f,f=c[(d+1)%g],h.onCurve)n.push({type:"L",x:h.x,y:h.y});else{let p=f;f.onCurve||(p={x:(h.x+f.x)*.5,y:(h.y+f.y)*.5}),n.push({type:"Q",x1:h.x,y1:h.y,x:p.x,y:p.y})}n.push({type:"Z"})}this.pathCommands=n}}class gp extends yn{get length(){return this._sfnt.loca.locations.length}_get(e){const t=this._sfnt.loca.locations,r=t[e],i=new pp({index:e});return r!==t[e+1]&&i.parse(this._sfnt.glyf,r,this),i}}var mp=Object.getOwnPropertyDescriptor,yp=(s,e,t,r)=>{for(var i=r>1?void 0:r?mp(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(i)||i);return i};let qi=class extends Oe{static from(s){const e=s.reduce((r,i)=>r+i.byteLength,0),t=new qi(new ArrayBuffer(e));return s.forEach(r=>{t.view.writeBytes(r)}),t}_glyphs;get glyphs(){return this._glyphs??=new gp(this._sfnt)}};qi=yp([be("glyf")],qi);var vp=Object.getOwnPropertyDescriptor,_p=(s,e,t,r)=>{for(var i=r>1?void 0:r?vp(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(i)||i);return i};let Tn=class extends Oe{};Tn=_p([be("GPOS","gpos")],Tn);var bp=Object.defineProperty,wp=Object.getOwnPropertyDescriptor,rr=(s,e,t,r)=>{for(var i=r>1?void 0:r?wp(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&bp(e,t,i),i};let Ot=class extends Oe{};rr([_("uint16")],Ot.prototype,"majorVersion",2),rr([_("uint16")],Ot.prototype,"minorVersion",2),rr([_("uint16")],Ot.prototype,"scriptListOffset",2),rr([_("uint16")],Ot.prototype,"featureListOffset",2),rr([_("uint16")],Ot.prototype,"lookupListOffset",2),rr([_("uint16")],Ot.prototype,"featureVariationsOffset",2),Ot=rr([be("GSUB","gsub")],Ot);var xp=Object.defineProperty,Pp=Object.getOwnPropertyDescriptor,ye=(s,e,t,r)=>{for(var i=r>1?void 0:r?Pp(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&xp(e,t,i),i};let ue=class extends Oe{constructor(s=new ArrayBuffer(54),e){super(s,e,Math.min(54,s.byteLength-(e??0)))}};ye([_("fixed")],ue.prototype,"version",2),ye([_("fixed")],ue.prototype,"fontRevision",2),ye([_("uint32")],ue.prototype,"checkSumAdjustment",2),ye([_("uint32")],ue.prototype,"magickNumber",2),ye([_("uint16")],ue.prototype,"flags",2),ye([_("uint16")],ue.prototype,"unitsPerEm",2),ye([_({type:"longDateTime"})],ue.prototype,"created",2),ye([_({type:"longDateTime"})],ue.prototype,"modified",2),ye([_("int16")],ue.prototype,"xMin",2),ye([_("int16")],ue.prototype,"yMin",2),ye([_("int16")],ue.prototype,"xMax",2),ye([_("int16")],ue.prototype,"yMax",2),ye([_("uint16")],ue.prototype,"macStyle",2),ye([_("uint16")],ue.prototype,"lowestRecPPEM",2),ye([_("int16")],ue.prototype,"fontDirectionHint",2),ye([_("int16")],ue.prototype,"indexToLocFormat",2),ye([_("int16")],ue.prototype,"glyphDataFormat",2),ue=ye([be("head")],ue);var Sp=Object.defineProperty,Cp=Object.getOwnPropertyDescriptor,Re=(s,e,t,r)=>{for(var i=r>1?void 0:r?Cp(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&Sp(e,t,i),i};let we=class extends Oe{constructor(s=new ArrayBuffer(36),e){super(s,e,Math.min(36,s.byteLength-(e??0)))}};Re([_("fixed")],we.prototype,"version",2),Re([_("int16")],we.prototype,"ascent",2),Re([_("int16")],we.prototype,"descent",2),Re([_("int16")],we.prototype,"lineGap",2),Re([_("uint16")],we.prototype,"advanceWidthMax",2),Re([_("int16")],we.prototype,"minLeftSideBearing",2),Re([_("int16")],we.prototype,"minRightSideBearing",2),Re([_("int16")],we.prototype,"xMaxExtent",2),Re([_("int16")],we.prototype,"caretSlopeRise",2),Re([_("int16")],we.prototype,"caretSlopeRun",2),Re([_("int16")],we.prototype,"caretOffset",2),Re([_({type:"int16",size:4})],we.prototype,"reserved",2),Re([_("int16")],we.prototype,"metricDataFormat",2),Re([_("uint16")],we.prototype,"numOfLongHorMetrics",2),we=Re([be("hhea")],we);var Tp=Object.getOwnPropertyDescriptor,Ep=(s,e,t,r)=>{for(var i=r>1?void 0:r?Tp(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(i)||i);return i};let Xi=class extends Oe{static from(s){const e=s.length*4,t=new Xi(new ArrayBuffer(e));return s.forEach(r=>{t.view.writeUint16(r.advanceWidth),t.view.writeUint16(r.leftSideBearing)}),t}_metrics;get metrics(){return this._metrics??=this.readMetrics()}readMetrics(){const s=this._sfnt.maxp.numGlyphs,e=this._sfnt.hhea.numOfLongHorMetrics;let t=0;const r=this.view;return r.seek(0),Array.from({length:s}).map((i,n)=>(n<e&&(t=r.readUint16()),{advanceWidth:t,leftSideBearing:r.readUint16()}))}};Xi=Ep([be("hmtx")],Xi);var Mp=Object.getOwnPropertyDescriptor,Ap=(s,e,t,r)=>{for(var i=r>1?void 0:r?Mp(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(i)||i);return i};let En=class extends Oe{};En=Ap([be("kern","kern")],En);var Op=Object.getOwnPropertyDescriptor,kp=(s,e,t,r)=>{for(var i=r>1?void 0:r?Op(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(i)||i);return i};let Hi=class extends Oe{static from(s,e=1){const t=s.length*(e?4:2),r=new Hi(new ArrayBuffer(t));return s.forEach(i=>{e?r.view.writeUint32(i):r.view.writeUint16(i/2)}),r}_locations;get locations(){return this._locations??=this.readLocations()}readLocations(){const s=this._sfnt.maxp.numGlyphs,e=this._sfnt.head.indexToLocFormat,t=this.view;return t.seek(0),Array.from({length:s}).map(()=>e?t.readUint32():t.readUint16()*2)}};Hi=kp([be("loca")],Hi);var Dp=Object.defineProperty,Ip=Object.getOwnPropertyDescriptor,ke=(s,e,t,r)=>{for(var i=r>1?void 0:r?Ip(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&Dp(e,t,i),i};let ve=class extends Oe{constructor(s=new ArrayBuffer(32),e){super(s,e,Math.min(32,s.byteLength-(e??0)))}};ke([_("fixed")],ve.prototype,"version",2),ke([_("uint16")],ve.prototype,"numGlyphs",2),ke([_("uint16")],ve.prototype,"maxPoints",2),ke([_("uint16")],ve.prototype,"maxContours",2),ke([_("uint16")],ve.prototype,"maxComponentPoints",2),ke([_("uint16")],ve.prototype,"maxComponentContours",2),ke([_("uint16")],ve.prototype,"maxZones",2),ke([_("uint16")],ve.prototype,"maxTwilightPoints",2),ke([_("uint16")],ve.prototype,"maxStorage",2),ke([_("uint16")],ve.prototype,"maxFunctionDefs",2),ke([_("uint16")],ve.prototype,"maxInstructionDefs",2),ke([_("uint16")],ve.prototype,"maxStackElements",2),ke([_("uint16")],ve.prototype,"maxSizeOfInstructions",2),ke([_("uint16")],ve.prototype,"maxComponentElements",2),ke([_("uint16")],ve.prototype,"maxComponentDepth",2),ve=ke([be("maxp")],ve);var Rp=Object.defineProperty,Up=Object.getOwnPropertyDescriptor,Yi=(s,e,t,r)=>{for(var i=r>1?void 0:r?Up(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&Rp(e,t,i),i};const El={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"},Mn={Macintosh:1,Microsoft:3},Bp={Default:0},Ml={UCS2:1};let _r=class extends Oe{_names;get names(){return this._names??=this.readNames()}readNames(){const s=this.count;this.view.seek(6);const e=[];for(let a=0;a<s;++a)e.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 t=this.stringOffset;for(let a=0;a<s;++a){const l=e[a];l.name=this.view.readBytes(t+l.offset,l.length)}let r=Mn.Macintosh,i=Bp.Default,n=0;e.some(a=>a.platform===Mn.Microsoft&&a.encoding===Ml.UCS2&&a.language===1033)&&(r=Mn.Microsoft,i=Ml.UCS2,n=1033);const o={};for(let a=0;a<s;++a){const l=e[a];l.platform===r&&l.encoding===i&&l.language===n&&El[l.nameId]&&(o[El[l.nameId]]=n===0?Gd(l.name):jd(l.name))}return o}};Yi([_("uint16")],_r.prototype,"format",2),Yi([_("uint16")],_r.prototype,"count",2),Yi([_("uint16")],_r.prototype,"stringOffset",2),_r=Yi([be("name")],_r);var Lp=Object.defineProperty,Np=Object.getOwnPropertyDescriptor,X=(s,e,t,r)=>{for(var i=r>1?void 0:r?Np(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&Lp(e,t,i),i};let q=class extends Oe{get fontPANOSE(){return[this.bFamilyType,this.bSerifStyle,this.bWeight,this.bProportion,this.bContrast,this.bStrokeVariation,this.bArmStyle,this.bLetterform,this.bMidline,this.bXHeight]}};X([_("uint16")],q.prototype,"version",2),X([_("int16")],q.prototype,"xAvgCharWidth",2),X([_("uint16")],q.prototype,"usWeightClass",2),X([_("uint16")],q.prototype,"usWidthClass",2),X([_("uint16")],q.prototype,"fsType",2),X([_("uint16")],q.prototype,"ySubscriptXSize",2),X([_("uint16")],q.prototype,"ySubscriptYSize",2),X([_("uint16")],q.prototype,"ySubscriptXOffset",2),X([_("uint16")],q.prototype,"ySubscriptYOffset",2),X([_("uint16")],q.prototype,"ySuperscriptXSize",2),X([_("uint16")],q.prototype,"ySuperscriptYSize",2),X([_("uint16")],q.prototype,"ySuperscriptXOffset",2),X([_("uint16")],q.prototype,"ySuperscriptYOffset",2),X([_("uint16")],q.prototype,"yStrikeoutSize",2),X([_("uint16")],q.prototype,"yStrikeoutPosition",2),X([_("uint16")],q.prototype,"sFamilyClass",2),X([_({type:"uint8"})],q.prototype,"bFamilyType",2),X([_({type:"uint8"})],q.prototype,"bSerifStyle",2),X([_({type:"uint8"})],q.prototype,"bWeight",2),X([_({type:"uint8"})],q.prototype,"bProportion",2),X([_({type:"uint8"})],q.prototype,"bContrast",2),X([_({type:"uint8"})],q.prototype,"bStrokeVariation",2),X([_({type:"uint8"})],q.prototype,"bArmStyle",2),X([_({type:"uint8"})],q.prototype,"bLetterform",2),X([_({type:"uint8"})],q.prototype,"bMidline",2),X([_({type:"uint8"})],q.prototype,"bXHeight",2),X([_({type:"uint8",size:16})],q.prototype,"ulUnicodeRange",2),X([_({type:"char",size:4})],q.prototype,"achVendID",2),X([_("uint16")],q.prototype,"fsSelection",2),X([_("uint16")],q.prototype,"usFirstCharIndex",2),X([_("uint16")],q.prototype,"usLastCharIndex",2),X([_("int16")],q.prototype,"sTypoAscender",2),X([_("int16")],q.prototype,"sTypoDescender",2),X([_("int16")],q.prototype,"sTypoLineGap",2),X([_("uint16")],q.prototype,"usWinAscent",2),X([_("uint16")],q.prototype,"usWinDescent",2),X([_({offset:72,type:"uint8",size:8})],q.prototype,"ulCodePageRange",2),X([_({offset:72,type:"int16"})],q.prototype,"sxHeight",2),X([_("int16")],q.prototype,"sCapHeight",2),X([_("uint16")],q.prototype,"usDefaultChar",2),X([_("uint16")],q.prototype,"usBreakChar",2),X([_("uint16")],q.prototype,"usMaxContext",2),q=X([be("OS/2","os2")],q);var Fp=Object.defineProperty,$p=Object.getOwnPropertyDescriptor,gt=(s,e,t,r)=>{for(var i=r>1?void 0:r?$p(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&Fp(e,t,i),i};let Ke=class extends Oe{constructor(s=new ArrayBuffer(32),e,t){super(s,e,t)}};gt([_("fixed")],Ke.prototype,"format",2),gt([_("fixed")],Ke.prototype,"italicAngle",2),gt([_("int16")],Ke.prototype,"underlinePosition",2),gt([_("int16")],Ke.prototype,"underlineThickness",2),gt([_("uint32")],Ke.prototype,"isFixedPitch",2),gt([_("uint32")],Ke.prototype,"minMemType42",2),gt([_("uint32")],Ke.prototype,"maxMemType42",2),gt([_("uint32")],Ke.prototype,"minMemType1",2),gt([_("uint32")],Ke.prototype,"maxMemType1",2),Ke=gt([be("post")],Ke);var zp=Object.defineProperty,Vp=Object.getOwnPropertyDescriptor,Ue=(s,e,t,r)=>{for(var i=r>1?void 0:r?Vp(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&zp(e,t,i),i};let xe=class extends Oe{constructor(s=new ArrayBuffer(36),e){super(s,e,Math.min(36,s.byteLength-(e??0)))}};Ue([_("fixed")],xe.prototype,"version",2),Ue([_("int16")],xe.prototype,"vertTypoAscender",2),Ue([_("int16")],xe.prototype,"vertTypoDescender",2),Ue([_("int16")],xe.prototype,"vertTypoLineGap",2),Ue([_("int16")],xe.prototype,"advanceHeightMax",2),Ue([_("int16")],xe.prototype,"minTopSideBearing",2),Ue([_("int16")],xe.prototype,"minBottomSideBearing",2),Ue([_("int16")],xe.prototype,"yMaxExtent",2),Ue([_("int16")],xe.prototype,"caretSlopeRise",2),Ue([_("int16")],xe.prototype,"caretSlopeRun",2),Ue([_("int16")],xe.prototype,"caretOffset",2),Ue([_({type:"int16",size:4})],xe.prototype,"reserved",2),Ue([_("int16")],xe.prototype,"metricDataFormat",2),Ue([_("int16")],xe.prototype,"numOfLongVerMetrics",2),xe=Ue([be("vhea")],xe);var Gp=Object.getOwnPropertyDescriptor,jp=(s,e,t,r)=>{for(var i=r>1?void 0:r?Gp(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(i)||i);return i};let Ki=class extends Oe{static from(s){const e=s.length*4,t=new Ki(new ArrayBuffer(e));return s.forEach(r=>{t.view.writeUint16(r.advanceHeight),t.view.writeInt16(r.topSideBearing)}),t}_metrics;get metrics(){return this._metrics??=this.readMetrics()}readMetrics(){const s=this._sfnt.maxp.numGlyphs,e=this._sfnt.vhea?.numOfLongVerMetrics??0,t=this.view;t.seek(0);let r=0;return Array.from({length:s}).map((i,n)=>(n<e&&(r=t.readUint16()),{advanceHeight:r,topSideBearing:t.readUint8()}))}};Ki=jp([be("vmtx")],Ki);var Wp=Object.defineProperty,ci=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&Wp(e,t,i),i};class it extends Fi{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(e){return typeof e=="number"?this.signature.has(e):this.signature.has(gr(e).getUint32(0))}static checksum(e){const t=gr(e);let r=t.byteLength;for(;r%4;)r++;let i=0;for(let n=0,o=r/4;n<o;n+=4)n*4<r-4&&(i+=t.getUint32(n*4,!1));return i&4294967295}static from(e){const t=f=>f+3&-4,r=e.tableViews.size,i=Array.from(e.tableViews.values()).reduce((f,d)=>f+t(d.byteLength),0),n=new this(new ArrayBuffer(12+r*16+i));n.scalerType=65536,n.numTables=r;const o=Math.log(2);n.searchRange=Math.floor(Math.log(r)/o)*16,n.entrySelector=Math.floor(n.searchRange/o),n.rangeShift=r*16-n.searchRange;let a=12+r*16,l=0;const c=n.getDirectories();e.tableViews.forEach((f,d)=>{const g=c[l++];g.tag=d,g.checkSum=this.checksum(f),g.offset=a,g.length=f.byteLength,n.view.writeBytes(f,a),a+=t(g.length)});const h=n.createSFNT().head;return h.checkSumAdjustment=0,h.checkSumAdjustment=2981146554-this.checksum(n.view),n}getDirectories(){let e=this.view.byteOffset+12;return Array.from({length:this.numTables},()=>{const t=new mr(this.view.buffer,e);return e+=t.view.byteLength,t})}createSFNT(){return new pt(this.getDirectories().reduce((e,t)=>(e[t.tag]=new DataView(this.view.buffer,this.view.byteOffset+t.offset,t.length),e),{}))}}ci([_("uint32")],it.prototype,"scalerType"),ci([_("uint16")],it.prototype,"numTables"),ci([_("uint16")],it.prototype,"searchRange"),ci([_("uint16")],it.prototype,"entrySelector"),ci([_("uint16")],it.prototype,"rangeShift");class An extends it{format="OpenType";mimeType="font/otf";static signature=new Set([1330926671]);static from(e){return super.from(e)}}var qp=Object.defineProperty,hi=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&qp(e,t,i),i};class ir extends qe{constructor(e,t){super(e,t,20)}}hi([_({type:"char",size:4})],ir.prototype,"tag"),hi([_("uint32")],ir.prototype,"offset"),hi([_("uint32")],ir.prototype,"compLength"),hi([_("uint32")],ir.prototype,"origLength"),hi([_("uint32")],ir.prototype,"origChecksum");var Xp=Object.defineProperty,Xe=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&Xp(e,t,i),i};const Fe=class Yn extends Fi{format="WOFF";mimeType="font/woff";get subfontFormat(){return it.is(this.flavor)?"TrueType":An.is(this.flavor)?"OpenType":"Open"}_sfnt;get sfnt(){return this._sfnt||(this._sfnt=this.createSFNT()),this._sfnt}static signature=new Set([2001684038]);static is(e){return typeof e=="number"?this.signature.has(e):this.signature.has(gr(e).getUint32(0))}static checkSum(e){const t=gr(e),r=t.byteLength,i=Math.floor(r/4);let n=0,o=0;for(;o<i;)n+=t.getUint32(4*o++,!1);let a=r-i*4;if(a){let l=i*4;for(;a>0;)n+=t.getUint8(l)<<a*8,l++,a--}return n%4294967296}static from(e,t=new ArrayBuffer(0)){const r=f=>f+3&-4,i=[];e.tableViews.forEach((f,d)=>{const g=gr(Bd(new Uint8Array(f.buffer,f.byteOffset,f.byteLength)));i.push({tag:d,view:g.byteLength<f.byteLength?g:f,rawView:f})});const n=i.length,o=i.reduce((f,d)=>f+r(d.view.byteLength),0),a=new Yn(new ArrayBuffer(44+20*n+o+t.byteLength));a.signature=2001684038,a.flavor=65536,a.length=a.view.byteLength,a.numTables=n,a.totalSFNTSize=12+16*n+i.reduce((f,d)=>f+r(d.rawView.byteLength),0);let l=44+n*20,c=0;const h=a.getDirectories();return i.forEach(f=>{const d=h[c++];d.tag=f.tag,d.offset=l,d.compLength=f.view.byteLength,d.origChecksum=Yn.checkSum(f.rawView),d.origLength=f.rawView.byteLength,a.view.writeBytes(f.view,l),l+=r(d.compLength)}),a.view.writeBytes(t),a}getDirectories(){let e=44;return Array.from({length:this.numTables},()=>{const t=new ir(this.view.buffer,e);return e+=t.view.byteLength,t})}createSFNT(){return new pt(this.getDirectories().reduce((e,t)=>{const r=t.tag,i=this.view.byteOffset+t.offset,n=t.compLength,o=t.origLength,a=i+n;return e[r]=n>=o?new DataView(this.view.buffer,i,n):new DataView(Ld(new Uint8Array(this.view.buffer.slice(i,a))).buffer),e},{}))}};Xe([_("uint32")],Fe.prototype,"signature"),Xe([_("uint32")],Fe.prototype,"flavor"),Xe([_("uint32")],Fe.prototype,"length"),Xe([_("uint16")],Fe.prototype,"numTables"),Xe([_("uint16")],Fe.prototype,"reserved"),Xe([_("uint32")],Fe.prototype,"totalSFNTSize"),Xe([_("uint16")],Fe.prototype,"majorVersion"),Xe([_("uint16")],Fe.prototype,"minorVersion"),Xe([_("uint32")],Fe.prototype,"metaOffset"),Xe([_("uint32")],Fe.prototype,"metaLength"),Xe([_("uint32")],Fe.prototype,"metaOrigLength"),Xe([_("uint32")],Fe.prototype,"privOffset"),Xe([_("uint32")],Fe.prototype,"privLength");let Zi=Fe;function Al(s,e=!0){if(it.is(s))return new it(s);if(An.is(s))return new An(s);if(Zi.is(s))return new Zi(s);if(e)throw new Error("Failed to parseFont")}function Ol(s,e=!0){const t=Al(s,!1);if(t)return t;if(e)throw new Error("Failed to parseFont")}class Ji{static defaultRequestInit={cache:"force-cache"};fallbackFont;loading=new Map;loaded=new Map;familyToUrl=new Map;setFallbackFont(e){this.fallbackFont=e}async loadFallbackFont(e,t={}){this.fallbackFont=await this.load(e,t)}_createRequest(e,t){const r=new AbortController;return{url:e,when:fetch(e,{...Ji.defaultRequestInit,...t,signal:r.signal}).then(i=>i.arrayBuffer()),cancel:()=>r.abort()}}injectFontFace(e,t){return document.fonts.add(new FontFace(e,t)),this}injectStyleTag(e,t){const r=document.createElement("style");return r.appendChild(document.createTextNode(`@font-face {
|
|
862
|
+
font-family: "${e}";
|
|
863
|
+
src: url(${t});
|
|
864
|
+
}`)),document.head.appendChild(r),this}_parseUrls(e){const t=Array.from(new Set([...e.split(","),e]));return Array.from(new Set(t.map(r=>this.familyToUrl.get(r.trim())??this.familyToUrl.get(r)??r)))}get(e){let t;return e&&(t=this._parseUrls(e).reduce((i,n)=>i||this.loaded.get(n),void 0)),t??this.fallbackFont}set(e,t){return this.familyToUrl.set(e,t.src),this.loaded.set(t.src,t),this}delete(e){return this._parseUrls(e).forEach(t=>{this.familyToUrl.delete(t),this.loaded.delete(t)}),this}clear(){return this.familyToUrl.clear(),this.loading.clear(),this.loaded.clear(),this}async load(e,t={}){const{cancelOther:r,injectFontFace:i=!0,injectStyleTag:n=!0,...o}=t;let a,l;if(typeof e=="string"?a=e:{src:a,family:l}=e,this.loaded.has(a))return r&&(this.loading.forEach(g=>g.cancel()),this.loading.clear()),f(this.loaded.get(a));let c=this.loading.get(a);return c||(c=this._createRequest(a,o),this.loading.set(a,c)),r&&this.loading.forEach((g,p)=>{g!==c&&(g.cancel(),this.loading.delete(p))}),c.when.then(g=>{if(this.loaded.has(a))return f(this.loaded.get(a));{const p=d(g);return t.noAdd||this.loaded.set(a,p),p.familySet.forEach(y=>{this.familyToUrl.set(y,a),typeof document<"u"&&(i&&this.injectFontFace(y,g),n&&this.injectStyleTag(y,a))}),p}}).catch(g=>{if(g instanceof DOMException&&g.message==="The user aborted a request.")return d();throw g}).finally(()=>{this.loading.delete(a)});function h(){return l?Array.isArray(l)?l:[l]:[]}function f(g){return h().forEach(p=>{g.familySet.add(p)}),g}function d(g=new ArrayBuffer(0)){let p;function y(){return p||(p=g.byteLength?Ol(g,!1):void 0),p}function m(){const P=y();if(P instanceof it||P instanceof Zi)return P.sfnt}return{src:a,family:l,buffer:g,familySet:new Set(h()),getFont:y,getSFNT:m}}}async waitUntilLoad(){await Promise.all(Array.from(this.loading.values()).map(e=>e.when))}}const kl=new Ji,Hp=Object.freeze(Object.defineProperty({__proto__:null,BaseFont:Fi,get Cff(){return Qt},get Cmap(){return vr},CmapSubtableFormat0:_n,CmapSubtableFormat12:Pn,CmapSubtableFormat14:li,CmapSubtableFormat2:ni,CmapSubtableFormat4:xn,CmapSubtableFormat6:tr,FontDataObject:qe,FontDataView:me,Fonts:Ji,get Glyf(){return qi},Glyph:mn,GlyphSet:yn,get Gpos(){return Tn},get Gsub(){return Ot},get Head(){return ue},get Hhea(){return we},get Hmtx(){return Xi},get Kern(){return En},get Loca(){return Hi},get Maxp(){return ve},get Name(){return _r},get Os2(){return q},get Post(){return Ke},SFNT:pt,TTF:it,TableDirectory:mr,get Vhea(){return xe},get Vmtx(){return Ki},WOFF:Zi,WOFFTableDirectoryEntry:ir,createCmapSegments:wn,dataTypeToByteLength:ri,defineColumn:_,defineSFNTTable:be,fonts:kl,parseFont:Ol,parseSFNTFont:Al},Symbol.toStringTag,{value:"Module"}));function On(s,e,t){if(typeof e=="string"&&e.startsWith("linear-gradient")){const{x0:r,y0:i,x1:n,y1:o,stops:a}=Yp(e,t.left,t.top,t.width,t.height),l=s.createLinearGradient(r,i,n,o);return a.forEach(c=>l.addColorStop(c.offset,c.color)),l}return e}function Qi(s,e,t){s?.color&&(s.color=On(t,s.color,e)),s?.backgroundColor&&(s.backgroundColor=On(t,s.backgroundColor,e)),s?.textStrokeColor&&(s.textStrokeColor=On(t,s.textStrokeColor,e))}function Yp(s,e,t,r,i){const n=s.match(/linear-gradient\((.+)\)$/)?.[1]??"",o=n.split(",")[0],a=o.includes("deg")?o:"0deg",l=n.replace(a,"").matchAll(/(#|rgba|rgb)(.+?) ([\d.]+%)/gi),h=(Number(a.replace("deg",""))||0)*Math.PI/180,f=r*Math.sin(h),d=i*Math.cos(h);return{x0:e+r/2-f,y0:t+i/2+d,x1:e+r/2+f,y1:t+i/2-d,stops:Array.from(l).map(g=>{let p=g[2];return p.startsWith("(")?p=p.split(",").length>3?`rgba${p}`:`rgb${p}`:p=`#${p}`,{offset:Number(g[3].replace("%",""))/100,color:p}})}}function br(s){const{ctx:e,path:t,fontSize:r,clipRect:i}=s;e.save(),e.beginPath();const n=t.style,o={...n,fill:s.color??n.fill,stroke:s.textStrokeColor??n.stroke,strokeWidth:s.textStrokeWidth?s.textStrokeWidth*r:n.strokeWidth,strokeLinecap:"round",strokeLinejoin:"round",shadowOffsetX:(s.shadowOffsetX??0)*r,shadowOffsetY:(s.shadowOffsetY??0)*r,shadowBlur:(s.shadowBlur??0)*r,shadowColor:s.shadowColor};i&&(e.rect(i.left,i.top,i.width,i.height),e.clip(),e.beginPath()),t.drawTo(e,o),e.restore()}function Kp(s,e,t){const{left:r,top:i,width:n,height:o}=t,a=s.canvas;a.dataset.viewBox=`${r} ${i} ${n} ${o}`,a.dataset.pixelRatio=String(e);const l=n,c=o;a.width=Math.max(1,Math.ceil(l*e)),a.height=Math.max(1,Math.ceil(c*e)),a.style.width=`${l}px`,a.style.height=`${c}px`,s.clearRect(0,0,a.width,a.height),s.scale(e,e),s.translate(-r,-i)}function Zp(s,e){const{paragraphs:t,computedStyle:r,glyphBox:i}=e;Qi(r,i,s),t.forEach(n=>{Qi(n.computedStyle,n.lineBox,s),n.fragments.forEach(o=>{Qi(o.computedStyle,o.inlineBox,s)})})}const Jp=new Set(["©","®","÷"]),Qp=new Set(["—","…","“","”","﹏","﹋","﹌","‘","’","˜"]),eg={1:"italic",32:"bold"},tg={1:"italic",2:"bold"},Dl={100:-.2,200:-.1,300:0,400:0,normal:0,500:.1,600:.2,700:.3,bold:.3,800:.4,900:.5};class rg{constructor(e,t,r){this.content=e,this.index=t,this.parent=r}path=new ge;lineBox=new Z;inlineBox=new Z;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 e=this.computedStyle.fontSize*.8;return this.glyphBox??(this.isVertical?new Z(this.lineBox.left+this.lineBox.width/2-e/2,this.lineBox.top,e,this.lineBox.height):new Z(this.lineBox.left,this.lineBox.top+this.lineBox.height/2-e/2,this.lineBox.width,e))}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(e){const t=this.computedStyle.fontFamily,r=e??kl;let n=(t?r.get(t):r.fallbackFont)?.getSFNT();return n?.textToGlyphIndexes(this.content).includes(0)&&(n=r.fallbackFont?.getSFNT()),n}updateGlyph(e=this._getFontSFNT()){if(!e)return this;const{hhea:t,os2:r,post:i,head:n}=e,o=n.unitsPerEm,a=t.ascent,l=t.descent,{content:c,computedStyle:h,isVertical:f}=this,{fontSize:d}=h,g=o/d,p=e.getAdvanceWidth(c,d),y=(a+Math.abs(l))/g,m=a/g;return this.advanceWidth=p,this.advanceHeight=y,this.inlineBox.width=f?y:p,this.inlineBox.height=f?p:y,this.underlinePosition=(a-i.underlinePosition)/g,this.underlineThickness=i.underlineThickness/g,this.strikeoutPosition=(a-r.yStrikeoutPosition)/g,this.strikeoutSize=r.yStrikeoutSize/g,this.ascender=a/g,this.descender=l/g,this.typoAscender=r.sTypoAscender/g,this.typoDescender=r.sTypoDescender/g,this.typoLineGap=r.sTypoLineGap/g,this.winAscent=r.usWinAscent/g,this.winDescent=r.usWinDescent/g,this.xHeight=r.sxHeight/g,this.capHeight=r.sCapHeight/g,this.baseline=m,this.centerDiviation=y/2-m,this.fontStyle=eg[r.fsSelection]??tg[n.macStyle],this}update(e){const t=this._getFontSFNT(e);if(!t)return this;this.updateGlyph(t);const{isVertical:r,content:i,computedStyle:n,baseline:o,inlineBox:a,ascender:l,descender:c,typoAscender:h,fontStyle:f,advanceWidth:d,advanceHeight:g}=this,{left:p,top:y}=a,m=n.fontStyle==="italic"&&f!=="italic";let P=p,E=y+o,x;const C=new ge;if(r&&(P+=(g-d)/2,Math.abs(d-g)>.1&&(E-=(l-h)/(l+Math.abs(c))*g),x=void 0),r&&!Jp.has(i)&&(i.codePointAt(0)<=256||Qp.has(i))){C.addCommands(t.getPathCommands(i,P,y+o-(g-d)/2,n.fontSize));const b={y:y-(g-d)/2+g/2,x:P+d/2};m&&this._italic(C,r?{x:b.x,y:y-(g-d)/2+o}:void 0),C.rotate(90,b)}else x!==void 0?(C.addCommands(t.glyphs.get(x).getPathCommands(P,E,n.fontSize)),m&&this._italic(C,r?{x:P+d/2,y:y+h/(l+Math.abs(c))*g}:void 0)):(C.addCommands(t.getPathCommands(i,P,E,n.fontSize)),m&&this._italic(C,r?{x:P+g/2,y:E}:void 0));const v=n.fontWeight??400;return v in Dl&&(v===700||v==="bold")&&f!=="bold"&&C.bold(Dl[v]*n.fontSize*.05),C.style={fill:this.computedFill??n.color,fillRule:"nonzero",stroke:this.computedOutline??(n.textStrokeWidth?n.textStrokeColor:"none"),strokeWidth:n.textStrokeWidth?n.textStrokeWidth*n.fontSize*.03:0},this.path=C,this.glyphBox=this.getGlyphBoundingBox(),this}_italic(e,t){e.skew(-.24,0,t||{y:this.inlineBox.top+this.baseline,x:this.inlineBox.left+this.inlineBox.width/2})}getGlyphMinMax(e,t,r){if(this.path.curves[0]?.curves.length)return this.path.getMinMax(e,t,r)}getGlyphBoundingBox(e){const t=this.getGlyphMinMax(void 0,void 0,e);if(!t)return;const{min:r,max:i}=t;return new Z(r.x,r.y,i.x-r.x,i.y-r.y)}drawTo(e,t={}){const r=this.computedStyle,i={ctx:e,path:this.path,fontSize:r.fontSize,color:r.color,...t};if(this.glyphBox)br(i);else{e.save(),e.beginPath();const n=this.path.style,o={...n,fill:i.color??n.fill,stroke:i.textStrokeColor??n.stroke,strokeWidth:i.textStrokeWidth?i.textStrokeWidth*i.fontSize:n.strokeWidth,shadowOffsetX:(i.shadowOffsetX??0)*i.fontSize,shadowOffsetY:(i.shadowOffsetY??0)*i.fontSize,shadowBlur:(i.shadowBlur??0)*i.fontSize,shadowColor:i.shadowColor};Bs(e,o),e.font=`${i.fontSize}px ${i.fontFamily}`,this.isVertical?(e.textBaseline="middle",e.fillText(this.content,this.inlineBox.left,this.inlineBox.top+this.inlineBox.height/2)):(e.textBaseline="alphabetic",e.fillText(this.content,this.inlineBox.left,this.inlineBox.top+this.baseline)),e.restore()}}}function Il(){const s=new Map;async function e(r){if(!s.has(r)){s.set(r,r);try{s.set(r,await fetch(r).then(i=>i.text()))}catch(i){console.warn(i),s.delete(r)}}}function t(r){return r.startsWith("http://")||r.startsWith("https://")||r.startsWith("blob://")}return{loaded:s,needsLoad:t,load:e}}function Rl(s){const e=new Map;function t(r){let i=e.get(r);if(!i){const n=Ns(s.needsLoad(r)?s.loaded.get(r)??r:r),o=$s(n);i={dom:n,pathSet:o},e.set(r,i)}return i}return{parsed:e,parse:t}}function kn(s,e){return typeof s=="number"?s:s.endsWith("%")?(s=s.substring(0,s.length-1),Math.ceil(Number(s)/100*e.total)):s.endsWith("rem")?(s=s.substring(0,s.length-3),Number(s)*e.fontSize):s.endsWith("em")?(s=s.substring(0,s.length-2),Number(s)*e.fontSize):Number(s)}function Dn(s){return K(s)?{}:s}function ig(s,e){const t=Object.keys(s),r=Object.keys(e);return Array.from(new Set([...t,...r])).every(n=>wr(s[n],e[n]))}function wr(s,e){const t=typeof s;return t===typeof e?t==="object"?ig(s,e):s===e:!1}function In(s){if(!s)return s;const e={};for(const t in s)s[t]!==""&&s[t]!==void 0&&(e[t]=s[t]);return e}class sg{constructor(e,t={},r){this.content=e,this.style=t,this.parent=r,this.updateComputedStyle().initCharacters()}inlineBox=new Z;fill;outline;get computedFill(){return this.fill??this.parent.computedFill}get computedOutline(){return this.outline??this.parent.computedOutline}get computedContent(){const e=this.computedStyle;return e.textTransform==="uppercase"?this.content.toUpperCase():e.textTransform==="lowercase"?this.content.toLowerCase():this.content}updateComputedStyle(){return this.computedStyle={...this.parent.computedStyle,...In(this.style)},this}initCharacters(){const e=[];let t=0;for(const r of this.computedContent)e.push(new rg(r,t++,this));return this.characters=e,this}}class ng{constructor(e,t){this.style=e,this.parent=t,this.updateComputedStyle()}lineBox=new Z;fragments=[];fill;outline;get computedFill(){return this.fill??this.parent.fill}get computedOutline(){return this.outline??this.parent.outline}updateComputedStyle(){return this.computedStyle={...In(this.parent.computedStyle),...In(this.style)},this}addFragment(e,t){const r=new sg(e,t,this);return this.fragments.push(r),r}}function Dm(s){return s}class es{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(e){const t={};for(const r in e){const i=e[r];es.notZeroStyles.has(r)&&i===0||(typeof i=="number"&&es.pxStyles.has(r)?t[r]=`${i}px`:t[r]=i)}return t}createDom(e,t){const r=document.createElement("section"),i={...t},n=t.writingMode.includes("horizontal");switch(t.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(t.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(r.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&&n?"100%":void 0,height:o&&!n?"100%":void 0}),e.forEach(l=>{const c=document.createElement("li");Object.assign(c.style,{verticalAlign:"inherit",...this._toDomStyle(l.style)}),l.fragments.forEach(h=>{const f=document.createElement("span");Object.assign(f.style,{verticalAlign:"inherit",...this._toDomStyle(h.style)}),f.appendChild(document.createTextNode(h.content)),c.appendChild(f)}),a.appendChild(c)}),r.appendChild(a),r}measureDOMText(e){const t=document.createRange();t.selectNodeContents(e);const r=e.data??"";let i=0;return Array.from(r).map(n=>{const o=i+=r.substring(i).indexOf(n),a=o+n.length;i+=n.length,t.setStart(e,Math.max(o,0)),t.setEnd(e,a);const l=t.getClientRects?.()??[t.getBoundingClientRect()];let c=l[l.length-1];l.length>1&&c.width<2&&(c=l[l.length-2]);const h=t.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(e){const t=[],r=[],i=[];return e.querySelectorAll("li").forEach((n,o)=>{const a=n.getBoundingClientRect();t.push({paragraphIndex:o,left:a.left,top:a.top,width:a.width,height:a.height}),n.querySelectorAll(":scope > *").forEach((l,c)=>{const h=l.getBoundingClientRect();r.push({paragraphIndex:o,fragmentIndex:c,left:h.left,top:h.top,width:h.width,height:h.height});let f=0;!l.children.length&&l.firstChild instanceof window.Text?this.measureDOMText(l.firstChild).forEach(d=>{i.push({...d,newParagraphIndex:-1,paragraphIndex:o,fragmentIndex:c,characterIndex:f++,textWidth:-1,textHeight:-1})}):l.querySelectorAll(":scope > *").forEach(d=>{d.firstChild instanceof window.Text&&this.measureDOMText(d.firstChild).forEach(g=>{i.push({...g,newParagraphIndex:-1,paragraphIndex:o,fragmentIndex:c,characterIndex:f++,textWidth:-1,textHeight:-1})})})})}),{paragraphs:t,fragments:r,characters:i}}measureParagraphDOM(e,t){const r=t.getBoundingClientRect(),i=this.measureDOM(t);i.paragraphs.forEach(a=>{const l=e[a.paragraphIndex];l.lineBox.left=a.left-r.left,l.lineBox.top=a.top-r.top,l.lineBox.width=a.width,l.lineBox.height=a.height}),i.fragments.forEach(a=>{const l=e[a.paragraphIndex].fragments[a.fragmentIndex];l.inlineBox.left=a.left-r.left,l.inlineBox.top=a.top-r.top,l.inlineBox.width=a.width,l.inlineBox.height=a.height});const n=[];let o=0;return i.characters.forEach(a=>{const{paragraphIndex:l,fragmentIndex:c,characterIndex:h}=a;n.push({...a,newParagraphIndex:l,left:a.left-r.left,top:a.top-r.top});const f=e[l].fragments[c].characters[h],{fontHeight:d,isVertical:g}=f,p=n[o];f.inlineBox.left=p.left,f.inlineBox.top=p.top,f.inlineBox.width=p.width,f.inlineBox.height=p.height,g?(f.lineBox.left=p.left+(p.width-d)/2,f.lineBox.top=p.top,f.lineBox.width=d,f.lineBox.height=p.height):(f.lineBox.left=p.left,f.lineBox.top=p.top+(p.height-d)/2,f.lineBox.width=p.width,f.lineBox.height=d),o++}),{paragraphs:e,boundingBox:new Z(0,0,r.width,r.height)}}measure(e,t,r){let i;r||(r=this.createDom(e,t),Object.assign(r.style,{position:"fixed",visibility:"hidden"}),document.body.appendChild(r),i=()=>r?.parentNode?.removeChild(r));const n=this.measureParagraphDOM(e,r);return i?.(),n}}function og(){const s=new Ct,e=Il(),t=Rl(e);return{name:"background",pathSet:s,load:async r=>{const{backgroundImage:i}=r.computedStyle;i&&e.needsLoad(i)&&await e.load(i)},update:r=>{s.paths.length=0;const{computedStyle:i,lineBox:n,isVertical:o}=r,{backgroundImage:a,backgroundSize:l,backgroundColormap:c}=i;if(K(a))return;const{pathSet:h}=t.parse(a),f=h.getBoundingBox(!0);let d,g,p,y;o?{x:g,y:d,width:y,height:p}=n:{x:d,y:g,width:p,height:y}=n;const m=Dn(c??"none"),P=h.paths.map(v=>{const b=v.clone();return b.style.fill&&b.style.fill in m&&(b.style.fill=m[b.style.fill]),b.style.stroke&&b.style.stroke in m&&(b.style.stroke=m[b.style.stroke]),b});let E,x;if(l==="rigid"){E=Math.max(r.fontSize*5/f.width),x=E;const v=new O;v.x=f.width-p/E,v.y=f.height-y/x,P.forEach(b=>{b.applyTransform(S=>{const T=S.x>f.left+f.width/2,R=S.y>f.top+f.height/2;T&&(S.x-=v.x),R&&(S.y-=v.y)})})}else E=p/f.width,x=y/f.height;const C=new _e;C.translate(-f.x,-f.y),C.scale(E,x),o&&(C.translate(-p/2,-y/2),C.rotate(-Math.PI/2),C.translate(y/2,p/2)),C.translate(d,g),P.forEach(v=>{v.applyTransform(b=>{b.applyMatrix3(C)})}),s.paths.push(...P)},renderOrder:-2,render:(r,i)=>{const{boundingBox:n,computedStyle:o}=i;K(o.backgroundColor)||(r.fillStyle=o.backgroundColor,r.fillRect(...n.array)),s.paths.forEach(a=>{if(br({ctx:r,path:a,fontSize:o.fontSize}),i.debug){const l=new Ct([a]).getBoundingBox();l&&r.strokeRect(l.x,l.y,l.width,l.height)}}),i.paragraphs.forEach(a=>{const{lineBox:l,style:c}=a;K(c.backgroundColor)||(r.fillStyle=c.backgroundColor,r.fillRect(...l.array)),a.fragments.forEach(h=>{const{inlineBox:f,style:d}=h;K(d.backgroundColor)||(r.fillStyle=d.backgroundColor,r.fillRect(...f.array))})})}}}function Rn(s){const{highlight:e,highlightImage:t,highlightReferImage:r,highlightColormap:i,highlightLine:n,highlightSize:o,highlightThickness:a}=s;return{image:e?.image??t??"none",referImage:e?.referImage??r??"none",colormap:e?.colormap??i??"none",line:e?.line??n??"none",size:e?.size??o??"cover",thickness:e?.thickness??a??"100%"}}function ag(){const s=new Ct,e=[],t=Il(),r=Rl(t);return{name:"highlight",pathSet:s,load:async i=>{const n=new Set;i.forEachCharacter(o=>{const{computedStyle:a}=o,{image:l,referImage:c}=Rn(a);l&&t.needsLoad(l)&&n.add(l),c&&t.needsLoad(c)&&n.add(c)}),await Promise.all(Array.from(n).map(o=>t.load(o)))},update:i=>{e.length=0,s.paths.length=0;let n=[],o,a;i.forEachCharacter(l=>{const{computedStyle:c}=l,h=Rn(c),{image:f,colormap:d,line:g,size:p,thickness:y}=h;if(K(f))o?.length&&(o=[],n.push(o));else{const{inlineBox:m,isVertical:P}=l,{fontSize:E}=c;(!a||wr(a.image,f)&&wr(a.colormap,d)&&wr(a.line,g)&&wr(a.size,p)&&wr(a.thickness,y))&&o?.length&&(P?o[0].inlineBox.left===m.left:o[0].inlineBox.top===m.top)&&o[0].fontSize===E?o.push(l):(o=[],o.push(l),n.push(o))}a=h}),n=n.filter(l=>l.length);for(let l=0;l<n.length;l++){const c=n[l],h=c[0],f=Z.from(...c.map(I=>I.compatibleGlyphBox));if(!f.height||!f.width)continue;const{computedStyle:d,isVertical:g,inlineBox:p,compatibleGlyphBox:y,strikeoutPosition:m,underlinePosition:P}=h,{fontSize:E}=d,{image:x,referImage:C,colormap:v,line:b,size:S,thickness:T}=Rn(d),R=kn(T,{fontSize:E,total:f.width})/f.width,G=Dn(v),{pathSet:U,dom:L}=r.parse(x),V=U.getBoundingBox(!0),B=E/V.width*2,k=new Z().copy(f);g&&(k.width=f.height,k.height=f.width,k.left=f.left+f.width);const H=Math.floor(k.width);let D=H;S!=="cover"&&(D=kn(S,{fontSize:E,total:f.width})||H,k.width=D);const N=!K(C)&&K(b);if(N)V.copy(r.parse(C).pathSet.getBoundingBox(!0));else{let I;if(K(b))if(V.width/V.height>4){I="underline";const j=L.getAttribute("viewBox");if(j){const[A,M,F,z]=j.split(" ").map(J=>Number(J)),Y=M+z/2;V.y<Y&&V.y+V.height>Y?I="line-through":V.y+V.height<Y?I="overline":I="underline"}}else I="outline";else I=b;switch(I){case"outline":{const j=k.width*.2,A=k.height*.2;g?(k.x-=A/2,k.y-=j/2,k.x-=k.height):(k.x-=j/2,k.y-=A/2),k.width+=j,k.height+=A;break}case"overline":k.height=V.height*B,g?k.x=p.left+p.width:k.y=p.top;break;case"line-through":k.height=V.height*B,g?k.x=p.left+p.width-m+k.height/2:k.y=p.top+m-k.height/2;break;case"underline":k.height=V.height*B,g?k.x=y.left+y.width-P:k.y=p.top+P;break}}const $=new _e;if($.translate(-V.x,-V.y),$.scale(k.width/V.width,k.height/V.height),g){const I=k.width/2,j=k.height/2;N||$.translate(-I,-j),$.rotate(-Math.PI/2),N||$.translate(j,I)}$.translate(k.x,k.y);for(let I=0;I<Math.ceil(H/D);I++){const j=$.clone();g?j.translate(0,I*k.width):j.translate(I*k.width,0),U.paths.forEach(A=>{const M=A.clone().applyTransform(j);M.style.strokeWidth&&(M.style.strokeWidth*=B*R),M.style.strokeMiterlimit&&(M.style.strokeMiterlimit*=B),M.style.strokeDashoffset&&(M.style.strokeDashoffset*=B),M.style.strokeDasharray&&(M.style.strokeDasharray=M.style.strokeDasharray.map(F=>F*B)),M.style.fill&&M.style.fill in G&&(M.style.fill=G[M.style.fill]),M.style.stroke&&M.style.stroke in G&&(M.style.stroke=G[M.style.stroke]),s.paths.push(M),H!==D&&(g?e[s.paths.length-1]=new Z(f.left-f.width*2,f.top,f.width*4,f.height):e[s.paths.length-1]=new Z(f.left,f.top-f.height*2,f.width,f.height*4))})}}},renderOrder:-1,getBoundingBox:()=>{const i=[];return s.paths.forEach((n,o)=>{const a=e[o];let l=n.getBoundingBox();if(a){const c=Math.max(l.x,a.x),h=Math.max(l.y,a.y),f=Math.min(l.right,a.right),d=Math.min(l.bottom,a.bottom);l=new Z(c,h,f-c,d-h)}i.push(l)}),Z.from(...i)},render:(i,n)=>{s.paths.forEach((o,a)=>{if(br({ctx:i,path:o,fontSize:n.computedStyle.fontSize,clipRect:e[a]}),n.debug){const l=new Ct([o]).getBoundingBox();l&&i.strokeRect(l.x,l.y,l.width,l.height)}})}}}function lg(s,e){return`<svg width="${s*2}" height="${s*2}" xmlns="http://www.w3.org/2000/svg">
|
|
865
|
+
<circle cx="${s}" cy="${s}" r="${s}" fill="${e}" />
|
|
866
|
+
</svg>`}function cg(){const s=new Ct;return{name:"listStyle",pathSet:s,update:e=>{s.paths.length=0;const{paragraphs:t,isVertical:r,fontSize:i}=e,n=i*.45;t.forEach(o=>{const{computedStyle:a}=o,{color:l,listStyleImage:c,listStyleColormap:h,listStyleSize:f,listStyleType:d}=a,g=Dn(h);let p=f,y;if(!K(c))y=c;else if(!K(d)){const b=i*.38/2;switch(p=p==="cover"?b*2:p,d){case"disc":y=lg(b,String(l));break}}if(!y)return;const m=$s(y),P=m.getBoundingBox(),E=o.fragments[0]?.characters[0];if(!E)return;const{inlineBox:x}=E,C=p==="cover"?1:kn(p,{total:i,fontSize:i})/i,v=new _e;if(r){const b=i/P.height*C;v.translate(-P.left,-P.top).rotate(Math.PI/2).scale(b,b).translate(x.left+(x.width-P.height*b)/2,x.top-n)}else{const b=i/P.height*C;v.translate(-P.left,-P.top).scale(b,b).translate(x.left-P.width*b-n,x.top+(x.height-P.height*b)/2)}s.paths.push(...m.paths.map(b=>{const S=b.clone();return S.applyTransform(v),S.style.fill&&S.style.fill in g&&(S.style.fill=g[S.style.fill]),S.style.stroke&&S.style.stroke in g&&(S.style.stroke=g[S.style.stroke]),S}))})}}}function hg(){return{name:"outline"}}const zt=new O,xr=new _e,Vt=new _e;function ug(){const s=new Ct;return{name:"render",pathSet:s,update:e=>{s.paths.length=0;const{paragraphs:t}=e;t.forEach(r=>{r.fragments.forEach(i=>{i.characters.forEach(n=>{s.paths.push(n.path)})})})},getBoundingBox:e=>{const{characters:t,fontSize:r,effects:i}=e,n=[];return t.forEach(o=>{i?.forEach(a=>{if(!o.glyphBox)return;const l=o.glyphBox.clone(),c=Un(e,a);zt.set(l.left,l.top),zt.applyMatrix3(c),l.left=zt.x,l.top=zt.y,zt.set(l.right,l.bottom),zt.applyMatrix3(c),l.width=zt.x-l.left,l.height=zt.y-l.top;const h=(a.shadowOffsetX??0)*r,f=(a.shadowOffsetY??0)*r,d=Math.max(.1,a.textStrokeWidth??0)*r;l.left+=h-d,l.top+=f-d,l.width+=d*2,l.height+=d*2,n.push(l)})}),n.length?Z.from(...n):void 0},render:(e,t)=>{const{paragraphs:r,glyphBox:i,effects:n}=t;n?n.forEach(o=>{Qi(o,i,e),e.save();const[a,l,c,h,f,d]=Un(t,o).transpose().elements;e.transform(a,h,l,f,c,d),t.forEachCharacter(g=>{g.drawTo(e,o)}),e.restore()}):r.forEach(o=>{o.fragments.forEach(a=>{a.characters.forEach(l=>{l.drawTo(e)})})}),t.debug&&r.forEach(o=>{e.strokeRect(o.lineBox.x,o.lineBox.y,o.lineBox.width,o.lineBox.height)})}}}function Un(s,e){const{fontSize:t,glyphBox:r}=s,i=(e.translateX??0)*t,n=(e.translateY??0)*t,o=Math.PI*2,a=(e.skewX??0)/360*o,l=(e.skewY??0)/360*o,{left:c,top:h,width:f,height:d}=r,g=c+f/2,p=h+d/2;return xr.identity(),Vt.makeTranslation(i,n),xr.multiply(Vt),Vt.makeTranslation(g,p),xr.multiply(Vt),Vt.set(1,Math.tan(a),0,Math.tan(l),1,0,0,0,1),xr.multiply(Vt),Vt.makeTranslation(-g,-p),xr.multiply(Vt),xr.clone()}function fg(){const s=new Ct;return{name:"textDecoration",pathSet:s,update:e=>{s.paths.length=0;const t=[];let r,i;e.forEachCharacter(n=>{const{computedStyle:o,isVertical:a,inlineBox:l,underlinePosition:c,underlineThickness:h,strikeoutPosition:f,strikeoutSize:d}=n,{color:g,textDecoration:p,writingMode:y}=o;if(K(p))i=void 0;else{let m=!1;if(i?.textDecoration===p&&i?.writingMode===y&&i?.color===g&&(a?r[0].inlineBox.left===l.left:r[0].inlineBox.top===l.top))switch(p){case"underline":r[0].underlinePosition===c&&r[0].underlineThickness===h&&(m=!0);break;case"line-through":r[0].strikeoutPosition===f&&r[0].strikeoutSize===d&&(m=!0);break}m?r.push(n):(r=[],r.push(n),t.push(r)),i=o}}),t.forEach(n=>{const{computedStyle:o,isVertical:a,underlinePosition:l,underlineThickness:c,strikeoutPosition:h,strikeoutSize:f}=n[0],{color:d,textDecoration:g}=o,p=Z.from(...n.map(S=>S.inlineBox)),{left:y,top:m,width:P,height:E}=p;let x=a?y+P:m;const C=a?-1:1;let v=0;switch(g){case"overline":v=c*2;break;case"underline":x+=C*l,v=c*2;break;case"line-through":x+=C*h,v=f*2;break}x-=v;let b;a?b=new ge([{type:"M",x,y:m},{type:"L",x,y:m+E},{type:"L",x:x+v,y:m+E},{type:"L",x:x+v,y:m},{type:"Z"}],{fill:d}):b=new ge([{type:"M",x:y,y:x},{type:"L",x:y+P,y:x},{type:"L",x:y+P,y:x+v},{type:"L",x:y,y:x+v},{type:"Z"}],{fill:d}),s.paths.push(b)})},render:(e,t)=>{const{effects:r,computedStyle:i}=t;r?r.forEach(n=>{e.save();const[o,a,l,c,h,f]=Un(t,n).transpose().elements;e.transform(o,c,a,h,l,f),s.paths.forEach(d=>{br({ctx:e,path:d,fontSize:i.fontSize,...n})}),e.restore()}):s.paths.forEach(n=>{br({ctx:e,path:n,fontSize:i.fontSize})})}}}var dg=Object.defineProperty,Gt=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&dg(e,t,i),i};const Ul=po();class kt extends wt{needsUpdate=!0;computedStyle={...Ul};paragraphs=[];lineBox=new Z;rawGlyphBox=new Z;glyphBox=new Z;pathBox=new Z;boundingBox=new Z;measurer=new es;plugins=new Map;pathSets=[];get fontSize(){return this.computedStyle.fontSize}get isVertical(){return this.computedStyle.writingMode.includes("vertical")}get characters(){return this.paragraphs.flatMap(e=>e.fragments.flatMap(t=>t.characters))}constructor(e={}){super(),this.set(e)}set(e={}){const{content:t,effects:r,style:i,measureDom:n,fonts:o,fill:a,outline:l}=mo(e);this.debug=e.debug??!1,this.content=t,this.effects=r,this.style=i,this.measureDom=n,this.fonts=o,this.fill=a,this.outline=l,this.use(og()).use(hg()).use(cg()).use(fg()).use(ag()).use(ug()),(e.plugins??[]).forEach(c=>{this.use(c)}),this.updateParagraphs()}onUpdateProperty(e,t,r,i){this.emit("updateProperty",e,t,r,i)}use(e){return this.plugins.set(e.name,e),this}forEachCharacter(e){return this.paragraphs.forEach((t,r)=>{t.fragments.forEach((i,n)=>{i.characters.forEach((o,a)=>{e(o,{paragraphIndex:r,fragmentIndex:n,characterIndex:a})})})}),this}async load(){await Promise.all(Array.from(this.plugins.values()).map(e=>e.load?.(this)))}updateParagraphs(){this.computedStyle={...Ul,...this.style};const{content:e}=this,t=[];return e.forEach(r=>{const{fragments:i,fill:n,outline:o,...a}=r,l=new ng(a,this);l.fill=n,l.outline=o,i.forEach(c=>{const{content:h,fill:f,outline:d,...g}=c;if(h!==void 0){const p=l.addFragment(h,g);p.fill=f,p.outline=d}}),t.push(l)}),this.paragraphs=t,this}createDom(){return this.updateParagraphs(),this.measurer.createDom(this.paragraphs,this.computedStyle)}measure(e=this.measureDom){const t={paragraphs:this.paragraphs,lineBox:this.lineBox,rawGlyphBox:this.rawGlyphBox,glyphBox:this.glyphBox,pathBox:this.pathBox,boundingBox:this.boundingBox};this.updateParagraphs();const r=this.measurer.measure(this.paragraphs,this.computedStyle,e);this.paragraphs=r.paragraphs,this.lineBox=r.boundingBox,this.characters.forEach(i=>{i.update(this.fonts)}),this.rawGlyphBox=this.getGlyphBox(),Array.from(this.plugins.values()).sort((i,n)=>(i.updateOrder??0)-(n.updateOrder??0)).forEach(i=>{i.update?.(this)}),this.pathSets.length=0,Array.from(this.plugins.values()).sort((i,n)=>(i.renderOrder??0)-(n.renderOrder??0)).forEach(i=>{i.pathSet?.paths.length&&this.pathSets.push(i.pathSet)}),this.glyphBox=this.getGlyphBox(),this.updatePathBox().updateBoundingBox();for(const i in t)r[i]=this[i],this[i]=t[i];return this.emit("measure",{text:this,result:r}),r}getGlyphBox(){const e=O.MAX,t=O.MIN;return this.characters.forEach(r=>{if(!r.getGlyphMinMax(e,t)){const{inlineBox:i}=r,{left:n,top:o,width:a,height:l}=i,c=new O(n,o),h=new O(n+a,o+l);e.min(c,h),t.max(c,h)}}),new Z(e.x,e.y,t.x-e.x,t.y-e.y)}updatePathBox(){return this.pathBox=Z.from(this.glyphBox,...Array.from(this.plugins.values()).map(e=>e.getBoundingBox?e.getBoundingBox(this):e.pathSet?.getBoundingBox()).filter(Boolean)),this}updateBoundingBox(){return this.boundingBox=Z.from(this.rawGlyphBox,this.lineBox,this.pathBox),this}requestUpdate(){return this.needsUpdate=!0,this}update(e=this.measureDom){const t=this.measure(e);for(const r in t)this[r]=t[r];return this.emit("update",{text:this}),this.needsUpdate=!1,this}render(e){const{view:t,pixelRatio:r=2}=e,i=t.getContext("2d");i&&(this.needsUpdate&&this.update(),Kp(i,r,this.boundingBox),Zp(i,this),Array.from(this.plugins.values()).sort((n,o)=>(n.renderOrder??0)-(o.renderOrder??0)).forEach(n=>{if(n.render)n.render?.(i,this);else if(n.pathSet){const o=this.computedStyle;n.pathSet.paths.forEach(a=>{br({ctx:i,path:a,fontSize:o.fontSize})})}}),this.emit("render",{text:this,view:t,pixelRatio:r}),e.onContext?.(i))}toString(){return this.content.flatMap(e=>e.fragments.map(t=>t.content)).join("")}}Gt([w()],kt.prototype,"debug"),Gt([w()],kt.prototype,"content"),Gt([w()],kt.prototype,"style"),Gt([w()],kt.prototype,"effects"),Gt([w()],kt.prototype,"fill"),Gt([w()],kt.prototype,"outline"),Gt([w()],kt.prototype,"measureDom"),Gt([w()],kt.prototype,"fonts");var pg=Object.defineProperty,sr=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&pg(e,t,i),i};class Dt extends It{constructor(e){super(),this.parent=e,this.base.on("updateProperty",(...t)=>{switch(t[0]){case"content":case"effects":case"fill":case"outline":this.setter(t[0],t[1]);break}this._updateProperty(...t)})}base=new kt;measureResult;setProperties(e){return super.setProperties(K(e)?void 0:mo(e))}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"enabled":case"content":case"effects":case"measureDom":case"fonts":case"fill":case"outline":this.parent.requestRedraw();break}}setContent(e){this.content=vs(e)}measure(){return this.base.style={justifyContent:"center",alignItems:"center",textAlign:"center",...this.parent.style.toJSON()},this.base.requestUpdate(),this.base.measure()}updateMeasure(){return this.measureResult=this.measure(),this}canDraw(){return!!(this.enabled&&!/^\s*$/.test(this.base.toString()))}draw(){const e=this.parent.context;this.base.update(),this.base.pathSets.forEach(t=>{t.paths.forEach(r=>{e.addPath(r),e.style={...r.style},e.fill()})})}}sr([w({fallback:!0})],Dt.prototype,"enabled"),sr([w({alias:"base.content",fallback:()=>[]})],Dt.prototype,"content"),sr([w({alias:"base.effects"})],Dt.prototype,"effects"),sr([w({alias:"base.fill"})],Dt.prototype,"fill"),sr([w({alias:"base.outline"})],Dt.prototype,"outline"),sr([w({protected:!0,alias:"base.measureDom"})],Dt.prototype,"measureDom"),sr([w({protected:!0,alias:"base.fonts"})],Dt.prototype,"fonts");var gg=Object.getOwnPropertyDescriptor,mg=(s,e,t,r)=>{for(var i=r>1?void 0:r?gg(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(i)||i);return i};u.BaseElement2D=class extends u.Node2D{size=new de().on("update",()=>{this.updateGlobalTransform(),this.requestRedraw()});get style(){return this._style}set style(e){const t=(...r)=>{this.emit("updateStyleProperty",...r),this._updateStyleProperty(r[0],r[1],r[2],r[3])};e.on("updateProperty",t),this._style?.off("updateProperty",t),this._style=e}_background=new sn(this);get background(){return this._background}set background(e){this._background.resetProperties().setProperties(e)}_shape=new Jt(this);get shape(){return this._shape}set shape(e){this._shape.resetProperties().setProperties(e)}_fill=new Te(this);get fill(){return this._fill}set fill(e){this._fill.resetProperties().setProperties(e)}_outline=new Kt(this);get outline(){return this._outline}set outline(e){this._outline.resetProperties().setProperties(e)}_foreground=new nn(this);get foreground(){return this._foreground}set foreground(e){this._foreground.resetProperties().setProperties(e)}_text=new Dt(this);get text(){return this._text}set text(e){this._text.resetProperties().setProperties(e)}_shadow=new Zt(this);get shadow(){return this._shadow}set shadow(e){this._shadow.resetProperties().setProperties(e)}constructor(e,t=[]){super(),this._updateStyleProperty=this._updateStyleProperty.bind(this),this.style=new Zr,this.setProperties(e).append(t)}setProperties(e){if(e){const{style:t,text:r,shape:i,background:n,fill:o,outline:a,foreground:l,shadow:c,...h}=e;t&&this.style.setProperties(t),n&&this.background.setProperties(n),i&&this.shape.setProperties(i),o&&this.fill.setProperties(o),a&&this.outline.setProperties(a),r&&this.text.setProperties(r),l&&this.foreground.setProperties(l),c&&this.shadow.setProperties(c),super.setProperties(h)}return this}_updateStyleProperty(e,t,r,i){switch(e){case"rotate":this.rotation=this.style.rotate*No;break;case"scaleX":this.scale.x=this.style.scaleX;break;case"scaleY":this.scale.y=this.style.scaleY;break;case"skewX":this.skew.x=this.style.skewX;break;case"skewY":this.skew.y=this.style.skewY;break;case"transform":case"transformOrigin":this.updateGlobalTransform();break;case"opacity":this.opacity=this.style.opacity;break;case"visibility":this.visible=this.style.visibility==="visible";break;case"filter":this.requestRepaint();break;case"maskImage":this._updateMaskImage();break;case"backgroundColor":this.background.color=this.style.backgroundColor;break;case"backgroundImage":this.background.image=this.style.backgroundImage;break;case"borderStyle":case"outlineStyle":this.outline.style=t;break;case"borderWidth":case"outlineWidth":this.outline.width=t;break;case"borderColor":case"outlineColor":this.outline.color=t;break;case"borderRadius":default:this.requestRedraw();break}}_updateMaskImage(){const e="__$style.maskImage",t=this.style.maskImage;if(t&&t!=="none"){const r=this.getNode(e);r?r.src=t:this.appendChild(new u.MaskEffect({name:e,src:t}),"back")}else{const r=this.getNode(e);r&&this.removeChild(r)}}getTransformOrigin(){const{width:e,height:t}=this.size,[r,i]=$a(this.style.transformOrigin);return new de(r*e,i*t)}updateTransform(e){const{width:t,height:r}=this.size;super.updateTransform(i=>{Fa(this.style.transform??"",t,r,i),e?.(i)})}updateGlobalTransform(){super.updateGlobalTransform(),this._updateOverflow()}getRect(){return this.getGlobalAabb()}_getPointArray(){const{width:e,height:t}=this.size,r=0,i=0,n=r+e,o=i+t;return[{x:r,y:i},{x:r,y:o},{x:n,y:i},{x:n,y:o}]}getAabb(){return new Rt(this._getPointArray().map(e=>this.transform.apply(e)))}getGlobalAabb(){return new Rt(this._getPointArray().map(e=>this.globalTransform.apply(e)))}getObb(){const e=this.getTransformOrigin(),t=this.transform.apply(e).sub(e);return{rect:new Rt(this._getPointArray().map(r=>(r.x+=t.x,r.y+=t.y,r))),rotation:this.rotation}}getGlobalObb(){const e=this.getTransformOrigin(),t=this.globalTransform.apply(e).sub(e);return{rect:new Rt(this._getPointArray().map(r=>(r.x+=t.x,r.y+=t.y,r))),rotation:this.globalRotation}}_updateOverflow(){this.style.overflow==="hidden"?this.mask=this.getRect().toJSON():this.mask=void 0}_draw(){super._draw(),this._text.canDraw()&&this._text.updateMeasure(),this._background.canDraw()&&(this._tree?.log(this.name,"background drawing"),this._background.fillWithShape?this._shape.draw():this._shape.drawRect(),this._background.draw()),this._fill.canDraw()&&(this._tree?.log(this.name,"fill drawing"),this._shape.draw(),this._fill.draw()),this._outline.canDraw()&&(this._tree?.log(this.name,"outline drawing"),this._shape.draw(),this._outline.draw()),this._foreground.canDraw()&&(this._tree?.log(this.name,"foreground drawing"),this._foreground.fillWithShape?this._shape.draw():this._shape.drawRect(),this._foreground.draw()),this._text.canDraw()&&(this._tree?.log(this.name,"text drawing"),this._text.draw()),this._drawContent()}_drawContent(){}_repaint(e){return super._repaint(e).map(t=>({...t}))}canPointerEvents(){return this.style.pointerEvents!=="none"}input(e,t){const r=this._children.internal;for(let i=r.length-1;i>=0;i--)r[i].input(e,t);this.isVisibleInTree()&&this._input(e,t)}_positionInput(e,t){const{width:r,height:i}=this.size;return e.x>=0&&e.x<r&&e.y>=0&&e.y<i}_input(e,t){switch(t){case"pointerdown":case"pointermove":case"pointerup":{if(this.canPointerEvents()){const{screenX:r,screenY:i}=e;if(r&&i){const n=new de(r,i),o=this.getViewport();o&&o.toCanvasGlobal(n,n),this.toLocal(n,n),this._positionInput(n,t)&&(e.target||(e.target=this),this.emit(t,e))}}break}}}toJSON(){const e=t=>Object.keys(t).length>0?t:void 0;return Ve({...super.toJSON(),style:e(this.style.toJSON()),background:e(this.background.toJSON()),shape:e(this.shape.toJSON()),fill:e(this.fill.toJSON()),outline:e(this.outline.toJSON()),text:e(this.text.toJSON()),foreground:e(this.foreground.toJSON()),shadow:e(this.shadow.toJSON())})}},u.BaseElement2D=mg([W("BaseElement2D")],u.BaseElement2D);class Bn extends Zr{constructor(e){super(),this.setProperties(e)}}const Bl={left:0,top:0,width:0,height:0};for(const s in Bl)vi(Bn,s,{fallback:Bl[s]});class Ll extends Zr{constructor(e){super(),this.setProperties(e)}}var yg=Object.getOwnPropertyDescriptor,vg=(s,e,t,r)=>{for(var i=r>1?void 0:r?yg(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(i)||i);return i};u.Element2D=class extends u.BaseElement2D{get style(){return this._style}set style(e){const t=(...r)=>{this.emit("updateStyleProperty",...r),this._updateStyleProperty(r[0],r[1],r[2],r[3])};e.on("updateProperty",t),this._style?.off("updateProperty",t),this._style=e}constructor(e,t=[]){super(),this.style=new Bn,this.setProperties(e).append(t)}_updateStyleProperty(e,t,r,i){switch(super._updateStyleProperty(e,t,r,i),e){case"left":this.position.x=Number(t);break;case"top":this.position.y=Number(t);break;case"width":this.size.width=Number(t);break;case"height":this.size.height=Number(t);break}switch(e){case"width":case"height":this.mask instanceof u.BaseElement2D&&(this.mask.size.width=this.size.width,this.mask.size.height=this.size.height);break}}},u.Element2D=vg([W("Element2D")],u.Element2D);const fe={left:0,top:1,right:2,bottom:3,start:4,end:5,horizontal:6,vertical:7,all:8},Nl={column:0,row:1,all:2},nr={auto:0,"flex-start":1,center:2,"flex-end":3,stretch:4,baseline:5,"space-between":6,"space-around":7,"space-evenly":8},Ln={flex:0,none:1,contents:2},ts={inherit:0,ltr:1,rtl:2},Nn={column:0,"column-reverse":1,row:2,"row-reverse":3},Fn={"no-wrap":0,wrap:1,"Wrap-reverse":2},$n={"flex-start":0,center:1,"flex-end":2,"space-between":3,"space-around":4,"space-evenly":5},zn={visible:0,hidden:1,scroll:2},Vn={static:0,relative:1,absolute:2},Gn={"border-box":0,"content-box":1};class rs{constructor(e){this._element=e}static _yoga;static async load(){const{loadYoga:e}=await import("yoga-layout/load");this._yoga=await e()}_node=rs._yoga.Node.create();get _style(){return this._element.style}get offsetLeft(){return this._node.getComputedLeft()}get offsetTop(){return this._node.getComputedTop()}get offsetWidth(){return this._node.getComputedWidth()}get offsetHeight(){return this._node.getComputedHeight()}calculateLayout(e,t,r){return this._node.calculateLayout(e,t,r)}getComputedLayout(){return this._node.getComputedLayout()}updateStyleProperty(e,t,r,i){switch(e){case"alignContent":this._node.setAlignContent(t?nr[t]:nr["flex-start"]);break;case"alignItems":this._node.setAlignItems(t?nr[t]:nr["flex-start"]);break;case"alignSelf":this._node.setAlignSelf(t?nr[t]:nr["flex-start"]);break;case"aspectRatio":this._node.setAspectRatio(t);break;case"borderTop":this._node.setBorder(fe.top,this._style.borderWidth);break;case"borderBottom":this._node.setBorder(fe.bottom,this._style.borderWidth);break;case"borderLeft":this._node.setBorder(fe.left,this._style.borderWidth);break;case"borderRight":this._node.setBorder(fe.right,this._style.borderWidth);break;case"border":this._node.setBorder(fe.all,this._style.borderWidth);break;case"direction":this._node.setDirection(t?ts[t]:ts.inherit);break;case"display":this._node.setDisplay(t?Ln[t]:Ln.flex);break;case"flex":this._node.setFlex(this._style.flex);break;case"flexBasis":this._node.setFlexBasis(this._style.flexBasis);break;case"flexDirection":this._node.setFlexDirection(t?Nn[t]:Nn.row);break;case"flexGrow":this._node.setFlexGrow(this._style.flexGrow);break;case"flexShrink":this._node.setFlexShrink(this._style.flexShrink);break;case"flexWrap":this._node.setFlexWrap(t?Fn[t]:Fn.wrap);break;case"height":this._node.setHeight(this._style.height);break;case"justifyContent":this._node.setJustifyContent(t?$n[t]:$n["flex-start"]);break;case"gap":t!==void 0&&this._node.setGap(Nl.all,t);break;case"marginTop":this._node.setMargin(fe.top,t);break;case"marginBottom":this._node.setMargin(fe.bottom,t);break;case"marginLeft":this._node.setMargin(fe.left,t);break;case"marginRight":this._node.setMargin(fe.right,t);break;case"margin":this._node.setMargin(fe.all,t);break;case"maxHeight":this._node.setMaxHeight(t);break;case"maxWidth":this._node.setMaxWidth(t);break;case"minHeight":this._node.setMinHeight(this._style.minHeight);break;case"minWidth":this._node.setMinWidth(this._style.minWidth);break;case"overflow":this._node.setOverflow(t?zn[t]:zn.visible);break;case"paddingTop":this._node.setPadding(fe.top,this._style.paddingTop);break;case"paddingBottom":this._node.setPadding(fe.bottom,this._style.paddingBottom);break;case"paddingLeft":this._node.setPadding(fe.left,this._style.paddingLeft);break;case"paddingRight":this._node.setPadding(fe.right,this._style.paddingRight);break;case"padding":this._node.setPadding(fe.all,this._style.padding);break;case"top":this._node.setPosition(fe.top,this._style.top);break;case"bottom":this._node.setPosition(fe.bottom,this._style.bottom);break;case"left":this._node.setPosition(fe.left,this._style.left);break;case"right":this._node.setPosition(fe.right,this._style.right);break;case"position":this._node.setPositionType(t?Vn[t]:Vn.static);break;case"boxSizing":this._node.setBoxSizing(t?Gn[t]:Gn["content-box"]);break;case"width":this._node.setWidth(this._style.width);break}}}var _g=Object.getOwnPropertyDescriptor,bg=(s,e,t,r)=>{for(var i=r>1?void 0:r?_g(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(i)||i);return i};u.FlexElement2D=class extends u.BaseElement2D{get style(){return this._style}set style(e){const t=(...r)=>{this.emit("updateStyleProperty",...r),this._updateStyleProperty(r[0],r[1],r[2],r[3])};e.on("updateProperty",t),this._style?.off("updateProperty",t),this._style=e}_layout=new rs(this);get offsetLeft(){return this._layout.offsetLeft}get offsetTop(){return this._layout.offsetTop}get offsetWidth(){return this._layout.offsetWidth}get offsetHeight(){return this._layout.offsetHeight}constructor(e,t=[]){super(),this.style=new Ll,this.setProperties(e).append(t)}_parented(e){super._parented(e),e._layout&&this._layout._node&&e._layout._node.insertChild(this._layout._node,e._layout._node.getChildCount())}_unparented(e){super._unparented(e),e._layout?._node&&e._layout._node.removeChild(this._layout._node)}_updateStyleProperty(e,t,r,i){super._updateStyleProperty(e,t,r,i),this._layout.updateStyleProperty(e,t,r,i),this._layout._node.isDirty()&&this.requestRelayout()}updateTransform(){this.calculateLayout(void 0,void 0,ts.ltr);const{left:e,top:t,width:r,height:i}=this._layout.getComputedLayout();this.position.x=e,this.position.y=t,this.size.x=r,this.size.y=i,super.updateTransform()}calculateLayout(e,t,r){const i=this.getParent();i?._layout?.calculateLayout?i?._layout.calculateLayout(e,t,r):this._layout.calculateLayout(e,t,r)}},u.FlexElement2D=bg([W("FlexElement2D")],u.FlexElement2D);var wg=Object.defineProperty,xg=Object.getOwnPropertyDescriptor,ui=(s,e,t,r)=>{for(var i=r>1?void 0:r?xg(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&wg(e,t,i),i};u.Image2D=class extends u.Element2D{get currentFrameTexture(){return this.texture?.frames[this._frameIndex]?.texture}get textureDuration(){return this.texture?.duration??0}get naturalWidth(){return this.currentFrameTexture?.realWidth??0}get naturalHeight(){return this.currentFrameTexture?.realHeight??0}get complete(){return this._complete}_frameIndex=0;_complete=!1;_wait=Promise.resolve();constructor(e,t=[]){super(),this.setProperties(e),this.append(t)}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"src":this._wait=this._load(t);break;case"srcRect":this.requestRedraw();break}}decode(){return this._wait}setResource(e){let t;if(e instanceof Di?t=e:t=new Di(e),this.texture=t.updateDuration(),this.currentFrameTexture&&(!this.style.width||!this.style.height)){const r=this.currentFrameTexture;this.style.width=r.realWidth,this.style.height=r.realHeight}return this}async _load(e){if(this._complete=!1,e)try{this.setResource(this.gif||e?.includes(".gif")?await yt.gif.load(e):await yt.texture.load(e)),this.requestRedraw(),this.emit("load")}catch(t){console.warn(t),this.emit("error",t)}else this.texture=void 0;this._complete=!0}_getFrameCurrentTime(){const e=this.textureDuration;if(!e||!this._tree)return 0;const t=this._currentTime;return t<0?0:t%e}_updateFrameIndex(){if(!this.texture)return this;const e=this._getFrameCurrentTime(),t=this.texture.frames,r=t.length;if(r<=1&&this._frameIndex===0)return this;let i=r-1;for(let n=0,o=0;o<r;o++)if(n+=t[o].duration??0,n>=e){i=o;break}return this._frameIndex!==i&&(this._frameIndex=i,this.requestRedraw()),this}_process(e){this._updateFrameIndex(),super._process(e)}_drawContent(){const e=this.currentFrameTexture;if(e?.valid){const{left:t=0,top:r=0,right:i=0,bottom:n=0}=this.srcRect??{},{width:o,height:a}=this.size;this.context.fillStyle=e;const l=Math.abs(1+(t+i))*o,c=Math.abs(1+(r+n))*a,h=1/l,f=1/c,d=t*o*h,g=r*a*f;this.context.uvTransform=new Ce().scale(h,f).translate(d,g),this.shape.draw(),this.context.fill()}}_repaint(e){return super._repaint(e).map(t=>({...t,disableWrapMode:!0}))}},ui([w({protected:!0})],u.Image2D.prototype,"texture",2),ui([w({fallback:""})],u.Image2D.prototype,"src",2),ui([w()],u.Image2D.prototype,"srcRect",2),ui([w({fallback:!1})],u.Image2D.prototype,"gif",2),u.Image2D=ui([W("Image2D")],u.Image2D);class jn extends u.Element2D{texture;constructor(e,t=[]){super(),this.setProperties(e).append(t)}_drawContent(){if(this.texture?.valid){const{width:e,height:t}=this.size;this.context.fillStyle=this.texture,this.context.uvTransform=new Ce().scale(1/e,1/t),this.shape.drawRect(),this.context.fill()}}}var Pg=Object.defineProperty,Sg=Object.getOwnPropertyDescriptor,Fl=(s,e,t,r)=>{for(var i=r>1?void 0:r?Sg(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&Pg(e,t,i),i};u.Lottie2D=class extends jn{texture=new Ii;animation;constructor(e,t=[]){super(),this.setProperties(e),this.append(t)}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"src":this._load();break}}_updateStyleProperty(e,t,r){switch(super._updateStyleProperty(e,t,r),e){case"width":this.texture.width=this.style.width;break;case"height":this.texture.height=this.style.height;break}}async _load(){this.animation=await yt.lottie.load(this.src,this.texture.source),this.duration=this.animation.getDuration(!1)*1e3,this.texture.requestUpload(),this.requestRedraw()}_process(e){this.animation?.goToAndStop(this.currentTime,!1),this.texture.requestUpload(),this.requestRedraw(),super._process(e)}},Fl([w({fallback:""})],u.Lottie2D.prototype,"src",2),u.Lottie2D=Fl([W("Lottie2D")],u.Lottie2D);var Cg=Object.defineProperty,Tg=(s,e,t,r)=>{for(var i=void 0,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(e,t,i)||i);return i&&Cg(e,t,i),i};class Wn extends u.Element2D{constructor(e,t=[]){super(),this.setProperties(e).append(t)}_updateStyleProperty(e,t,r,i){switch(super._updateStyleProperty(e,t,r,i),e){case"width":case"height":this.requestRedraw();break}}_drawCircle(e,t){this.context.arc(e,t,this.handleSize,0,Math.PI*2,!0),this.context.fillStyle=ne.WHITE,this.context.fill(),this.context.arc(e,t,this.handleSize,0,Math.PI*2,!0),this.context.strokeStyle="rgba(0, 0, 0, 0.2)",this.context.stroke()}_drawEllipse(e,t){this.context.roundRect(e-this.handleSize,t-this.handleSize*2,this.handleSize*2,this.handleSize*4,this.handleSize),this.context.fillStyle=ne.WHITE,this.context.fill(),this.context.roundRect(e-this.handleSize,t-this.handleSize*2,this.handleSize*2,this.handleSize*4,this.handleSize),this.context.strokeStyle="rgba(0, 0, 0, 0.2)",this.context.stroke()}_draw(){const{width:e,height:t}=this.getRect();this.context.rect(0,0,e,t),this.context.strokeStyle="#00FF00",this.context.stroke(),this._drawCircle(0,0),this._drawCircle(e,t),this._drawCircle(0,t),this._drawEllipse(0,t/2),this._drawCircle(e,0),this._drawEllipse(e,t/2)}}Tg([w({fallback:6})],Wn.prototype,"handleSize");var Eg=Object.defineProperty,Mg=Object.getOwnPropertyDescriptor,$l=(s,e,t,r)=>{for(var i=r>1?void 0:r?Mg(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&Eg(e,t,i),i};u.Video2D=class extends jn{get videoDuration(){return(this.texture?.duration??0)*1e3}_wait=Promise.resolve();constructor(e,t=[]){super(),this.setProperties(e),this.append(t)}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"src":this._wait=this._load(t);break}}waitLoad(){return this._wait}async _load(e){this.texture=await yt.video.load(e),(!this.style.width||!this.style.height)&&(this.style.width=this.texture.width,this.style.height=this.texture.height),this.requestRedraw()}_updateVideoCurrentTime(){let e=this._currentTime;if(e<0)return;const t=this.texture;if(!t)return;const r=t.duration;e=r?e%(r*1e3):0,!t.isPlaying&&!t.seeking&&(e=~~e/1e3,t.currentTime!==e&&(t.currentTime=e))}_process(e){this._updateVideoCurrentTime(),super._process(e)}},$l([w({fallback:""})],u.Video2D.prototype,"src",2),u.Video2D=$l([W("Video2D")],u.Video2D);var Ag=Object.defineProperty,Og=Object.getOwnPropertyDescriptor,fi=(s,e,t,r)=>{for(var i=r>1?void 0:r?Og(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&Ag(e,t,i),i};const zl=s=>s,Vl=Pr(.25,.1,.25,1),Gl=Pr(.42,0,1,1),jl=Pr(0,0,.58,1),Wl=Pr(.42,0,.58,1);function Pr(s,e,t,r){const n=3*s-3*t+1,o=3*t-6*s,a=3*s,l=3*e-3*r+1,c=3*r-6*e,h=3*e,f=y=>(3*n*y+2*o)*y+a,d=y=>((n*y+o)*y+a)*y,g=y=>((l*y+c)*y+h)*y;function p(y){let m=y,P,E;for(let v=0;v<8;v++){if(E=d(m)-y,Math.abs(E)<1e-6)return m;if(P=f(m),Math.abs(P)<1e-6)break;m-=E/P}let x=1,C=0;for(m=y;x>C;){if(E=d(m)-y,Math.abs(E)<1e-6)return m;E>0?x=m:C=m,m=(x+C)/2}return m}return y=>g(p(y))}const is={linear:zl,ease:Vl,easeIn:Gl,easeOut:jl,easeInOut:Wl};u.Animation=class extends u.TimelineNode{_keyframes=[];_isFirstUpdatePosition=!1;_cachedProps=new oo;_stoped=!1;constructor(e,t=[]){super(),this.setProperties(e).append(t)}_parented(e){super._parented(e),this._updateCachedProps()}_unparented(e){super._unparented(e),this.cancel()}_process(){this.canProcess()&&this.commitStyles()}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"effectMode":case"keyframes":this._updateKeyframes();break}}_getTargets(){let e;switch(this.effectMode){case"sibling":e=this.getParent()?.children.internal.filter(t=>t instanceof u.CanvasItem)??[];break;case"parent":default:e=[this.getParent()].filter(Boolean);break}return e.map(t=>t.style)}_updateKeyframes(){const e=[],t=this.keyframes;for(let n=t.length,o=0;o<n;o++){const{offset:a=o===0?0:o/(n-1),easing:l="linear",...c}=t[o];e.push({offset:a,easing:this._parseEasing(l),props:c})}const r=e[0],i=e[e.length-1];r&&r.offset!==0&&e.unshift({offset:0,easing:this._parseEasing("linear"),props:{}}),i&&i.offset!==1&&e.push({offset:1,easing:this._parseEasing("linear"),props:{}}),this._keyframes=e,this._updateCachedProps()}commitStyles(){if(!this.keyframes.length)return;if(this._updateCurrentTime(),this.isInsideTimeRange())this._isFirstUpdatePosition||(this._isFirstUpdatePosition=!0,this._updateCachedProps());else{if(!this._isFirstUpdatePosition)return;this._isFirstUpdatePosition=!1}const e=this._getTargets(),t=1/e.length,r=this.currentTimeProgress;e.forEach((i,n)=>{const o=t===1?r:Ge(Math.max(0,r-t*n)/t,0,1),a=this._cachedProps.get(i);if(!a)return;const l=this._parseKeyframes(o,a);l?.length&&this._commitStyle(o,i,a,l[0],l[1])})}_updateCachedProps(){this.cancel(),this._getTargets().forEach(e=>{const t=new Map,r=this._keyframes;for(let i=r.length,n=0;n<i;n++)Object.keys(r[n].props).forEach(o=>{t.set(o,e[o])});this._cachedProps.set(e,t)})}_parseEasing(e){if(!e)return is.linear;if(e in is)return is[e];const t=e.replace(/cubic-bezier\((.+)\)/,"$1").split(",").map(r=>Number(r));return Pr(t[0],t[1],t[2],t[3])}_parseKeyframes(e,t){let r;const i=this._keyframes;for(let n=i.length,o=0;o<n;o++){const a=i[o],{offset:l,easing:c}=a,h={...a.props};if(r&&e<=l){const{offset:f,easing:d}=r,g={...r.props};return t.forEach((p,y)=>{(!(y in g)||g[y]===null)&&(g[y]=p),(!(y in h)||h[y]===null)&&(h[y]=p)}),[{offset:f,easing:d,props:g},{offset:l,easing:c,props:h}]}r=a}return null}_commitStyle(e,t,r,i,n){const{offset:o,easing:a,props:l}=i,{offset:c,props:h}=n,f=c-o,d=a((e-o)/f),g={width:t.width,height:t.height,fontSize:t.fontSize};r.forEach((p,y)=>{t[y]=this._getDiffValue(y,l[y],h[y],d,g)})}_getDiffValue(e,t,r,i,n){let o,a;if(t==="none"&&(t=void 0),r==="none"&&(r=void 0),t===void 0||r===void 0)if(t!==void 0)o=Mr(e,String(t),n),a=ws(o);else if(r!==void 0)a=Mr(e,String(r),n),o=ws(a);else return;else o=Mr(e,String(t),n),a=Mr(e,String(r),n);if(Array.isArray(o)&&Array.isArray(a)){const l=new Set,c={},h={};o.forEach(({name:d,args:g})=>{c[d]=g,l.add(d)}),a.forEach(({name:d,args:g})=>{h[d]=g,l.add(d)});let f="";return l.forEach(d=>{const g=Math.max(c[d]?.length??0,h[d]?.length??0),p=c[d],y=h[d];f+=`${d}(${Array.from({length:g},(m,P)=>{const E=p?.[P],x=y?.[P],C=E?.normalizedIntValue??0,v=x?.normalizedIntValue??0;return Number.isNaN(C)||Number.isNaN(v)?x?.value??0:he(C,v,i)}).join(", ")}) `}),f}else if(!Array.isArray(o)&&!Array.isArray(a))return Number.isNaN(o.normalizedIntValue)||Number.isNaN(a.normalizedIntValue)?a.value:he(o.normalizedIntValue,a.normalizedIntValue,i)}isPlaying(){return!this.paused&&this.isInsideTimeRange()}play(){return this._stoped?(this._stoped=!1,this.startTime=this.timelineCurrentTime):this.startTime=this.timelineCurrentTime-this.currentTime,this.paused=!1,!0}pause(){return this.paused=!0,!0}stop(){return this._stoped=!0,this.paused=!0,this._currentTime=0,!0}cancel(){this._getTargets().forEach(e=>{this._cachedProps.get(e)?.forEach((t,r)=>{e[r]=t}),this._cachedProps.delete(e)})}},fi([w({fallback:"parent"})],u.Animation.prototype,"effectMode",2),fi([w({fallback:!1})],u.Animation.prototype,"loop",2),fi([w({default:()=>[]})],u.Animation.prototype,"keyframes",2),fi([w()],u.Animation.prototype,"easing",2),u.Animation=fi([W("Animation",{renderMode:"disabled",processMode:"pausable",processSortMode:"parent_before",duration:2e3})],u.Animation);class ss extends wt{static _instance;static get instance(){return this._instance||(this._instance=new ss),this._instance}playbackRate=1;muted=!1;volume=1;paused=!1;refresh(){this.emit("refresh")}refreshPaused(){this.emit("refreshPaused")}get processors(){return console.warn("HTML Audio does not support processors"),[]}set processors(e){console.warn("HTML Audio does not support processors")}get audioContext(){return console.warn("HTML Audio does not support audioContext"),null}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this.paused}free(){this.removeAllListeners()}}class di extends wt{static PADDING=.1;_source=null;_audio=null;_end=0;_pausedReal=!1;_duration=0;_start=0;_playing=!1;get progress(){return(this._source?.currentTime??0)/this._duration}_paused=!1;get paused(){return this._paused}set paused(e){this._paused!==e&&(this._paused=e,this.refreshPaused())}_playbackRate=1;get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate!==e&&(this._playbackRate=e,this.refresh())}_volume=1;get volume(){return this._volume}set volume(e){this._volume!==e&&(this._volume=e,this.refresh())}_loop=!1;get loop(){return this._loop}set loop(e){this._loop!==e&&(this._loop=e,this.refresh())}_muted=!1;get muted(){return this._muted}set muted(e){this._muted!==e&&(this._muted=e,this.refresh())}set(e,t){if(this[e]===void 0)throw new Error(`Property with name ${e} does not exist.`);switch(e){case"playbackRate":this.playbackRate=t;break;case"volume":this.volume=t;break;case"paused":this.paused=t;break;case"loop":this.loop=t;break;case"muted":this.muted=t;break}return this}_onPlay(){this._playing=!0}_onPause(){this._playing=!1}init(e){this._playing=!1,this._duration=e.source.duration;const t=this._source=e.source.cloneNode(!1);return t.src=e.parent.src,t.onplay=this._onPlay.bind(this),t.onpause=this._onPause.bind(this),e.context.on("refresh",this.refresh),e.context.on("refreshPaused",this.refreshPaused),this._audio=e,this}_stop(){this._source&&this._playing&&(this._source.onended=null,this._source.pause())}stop(){this._stop(),this._source&&this.emit("stop")}get processors(){return console.warn("HTML Audio does not support processors"),[]}set processors(e){console.warn("HTML Audio does not support processors")}refresh(){if(!this._audio||!this._source)return;const e=this._audio.context,t=this._audio.parent;this._source.loop=this._loop||t.loop;const r=e.volume*(e.muted?0:1),i=t.volume*(t.muted?0:1),n=this._volume*(this._muted?0:1);this._source.volume=n*r*i,this._source.playbackRate=this._playbackRate*e.playbackRate*t.playbackRate}refreshPaused(){if(!this._source||!this._audio)return;const e=this._paused||this._audio.parent.paused||this._audio.context.paused;e!==this._pausedReal&&(this._pausedReal=e,e?(this._stop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,playbackRate:this._playbackRate,loop:this._loop})),this.emit("pause",e))}play(e={}){if(!this._source)return;const{start:t=0,end:r=0}=e;r&&console.assert(r>t,"End time is before start time"),e.playbackRate!==void 0&&(this._playbackRate=e.playbackRate),e.volume!==void 0&&(this._volume=e.volume),e.loop!==void 0&&(this._loop=e.loop),e.muted!==void 0&&(this._muted=e.muted),this.refresh(),this.loop&&r!==null&&(console.warn('Looping not support when specifying an "end" time'),this.loop=!1),this._start=t,this._end=r||this._duration,this._start=Math.max(0,this._start-di.PADDING),this._end=Math.min(this._end+di.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=t,this._source.onloadedmetadata=null,this.emit("progress",t,this._duration),Se.on(this._onUpdate))},this._source.onended=this._onComplete.bind(this),this._source.play(),this.emit("start")}_onUpdate=()=>{this._source&&(this.emit("progress",this.progress,this._duration),this._source.currentTime>=this._end&&!this._source.loop&&this._onComplete())};_onComplete(){Se.off(this._onUpdate),this._stop(),this.emit("progress",1,this._duration),this.emit("end",this)}free(){Se.off(this._onUpdate),this.removeAllListeners();const e=this._source;e&&(e.onended=null,e.onplay=null,e.onpause=null,this._stop()),this._source=null,this._playbackRate=1,this._volume=1,this._loop=!1,this._end=0,this._start=0,this._duration=0,this._playing=!1,this._pausedReal=!1,this._paused=!1,this._muted=!1,this._audio&&(this._audio.context.off("refresh",this.refresh),this._audio.context.off("refreshPaused",this.refreshPaused),this._audio=null)}}class ql{constructor(e){this.parent=e}source=new globalThis.Audio;_src="";get src(){return this._src}set src(e){this._src!==e&&(this._src=e,this.load())}get duration(){return this.source.duration}get isPlayable(){return!!this.source&&this.source.readyState===4}get context(){return ss.instance}async load(){return new Promise(e=>{this.source.onload=()=>e(this),this.source.src=this._src,this.source.load()})}createSound(){return new di}}class qn extends wt{constructor(e,t){super(),this._input=e,this._output=t}_processers=[];get processors(){return this._processers}set processors(e){if(this._processers.forEach(t=>t.disconnect()),this._processers.length=0,this._input.connect(this._output),e.length){this._processers=e.slice(0),this._input.disconnect();let t;e.forEach(r=>{t?t.connect(r.destination):this._input.connect(r.destination),t=r}),t.connect(this._output)}}get destination(){return this._input}}class kg{constructor(e,t=null){this.destination=e,this.source=t}connect(e){this.source?.connect(e)}disconnect(){this.source?.disconnect()}}function Dg(){if(Ps)return new AudioContext;if(Ss){const s=globalThis.webkitAudioContext;return new s}else throw new Error("Failed to createAudioContext")}function Ig(s,e,t){if(Cs)return new OfflineAudioContext(s,e,t);if(So){const r=globalThis.webkitOfflineAudioContext;return new r(s,e,t)}else throw new Error("Failed to createOfflineAudioContext")}class jt extends qn{static _instance;static get instance(){return this._instance||(this._instance=new jt),this._instance}static get audioContext(){return this.instance.audioContext}static get offlineContext(){return this.instance.offlineContext}static setParamValue(e,t){this.instance.setParamValue(e,t)}static decode(e){return this.instance.decode(e)}_context;_offlineContext;get audioContext(){return this._context}get offlineContext(){return this._offlineContext}_locked;muted=!1;volume=1;playbackRate=1;autoPause=!0;_paused=!1;_pausedOnBlur=!1;get paused(){return this._paused}set paused(e){e&&this._context.state==="running"?this._context.suspend():!e&&this._context.state==="suspended"&&this._context.resume(),this._paused=e}_compressor;_analyser;constructor(){const e=Dg(),t=Ig(1,2,Cs?Math.max(8e3,Math.min(96e3,e.sampleRate)):44100),r=e.createDynamicsCompressor(),i=e.createAnalyser();i.connect(r),r.connect(e.destination),super(i,r),this._context=e,this._offlineContext=t,this._compressor=r,this._analyser=i,this._locked=e.state==="suspended"&&(xt||Po),Or&&(this._locked&&(this._unlock(),document.addEventListener("mousedown",this._unlock,!0),document.addEventListener("touchstart",this._unlock,!0),document.addEventListener("touchend",this._unlock,!0)),globalThis.addEventListener("focus",this._onFocus),globalThis.addEventListener("blur",this._onBlur))}_onFocus(){if(!this.autoPause)return;const e=this._context.state;(e==="suspended"||e==="interrupted"||!this._locked)&&(this.paused=this._pausedOnBlur,this.refreshPaused())}_onBlur(){this.autoPause&&(this._locked||(this._pausedOnBlur=this._paused,this.paused=!0,this.refreshPaused()))}_unlock=()=>{this._locked&&(this.playEmptySound(),this._context.state==="running"&&(document.removeEventListener("mousedown",this._unlock,!0),document.removeEventListener("touchend",this._unlock,!0),document.removeEventListener("touchstart",this._unlock,!0),this._locked=!1))};playEmptySound(){const e=this._context.createBufferSource();e.buffer=this._context.createBuffer(1,1,22050),e.connect(this._context.destination),e.start(0,0,0),e.context.state==="suspended"&&e.context.resume()}refresh(){this.emit("refresh")}refreshPaused(){this.emit("refreshPaused")}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this._paused}decode(e){return new Promise((t,r)=>{const i=o=>{r(new Error(o?.message||"Unable to decode file"))},n=this._offlineContext.decodeAudioData(e,t,i);n&&n.catch(i)})}setParamValue(e,t){e.setValueAtTime?e.setValueAtTime(t,this._context.currentTime):e.value=t}}class Xl extends wt{_audio=null;_sourceNode=null;_gain=null;_progress=0;get progress(){return this._progress}_pausedReal=!1;_paused=!1;get paused(){return this._paused}set paused(e){this._paused!==e&&(this._paused=e,this.refreshPaused())}_volume=1;get volume(){return this._volume}set volume(e){this._volume!==e&&(this._volume=e,this.refresh())}_playbackRate=1;get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate!==e&&(this._playbackRate=e,this.refresh(),this._update(!0))}_loop=!1;get loop(){return this._loop}set loop(e){this._loop!==e&&(this._loop=e,this.refresh())}_muted=!1;get muted(){return this._muted}set muted(e){this._muted!==e&&(this._muted=e,this.refresh())}_duration=0;_end=0;_elapsed=0;_lastUpdate=this._now();_processors=[];init(e){return this._audio=e,e.context.on("refresh",this.refresh),e.context.on("refreshPaused",this.refreshPaused),this}_now(){return this._audio?.context.audioContext.currentTime??0}play(e={}){if(!this._audio)return;const{end:t=0,start:r=0}=e;t&&console.assert(t>r,"End time is before start time"),this._end=t,this._elapsed=r,e.volume!==void 0&&(this._volume=e.volume),e.playbackRate!==void 0&&(this._playbackRate=e.playbackRate),e.muted!==void 0&&(this._muted=e.muted),e.loop!==void 0&&(this._loop=e.loop),e.processors!==void 0&&(this._processors=e.processors),this._paused=!1;const{source:i,gain:n}=this._audio.cloneSource();this._sourceNode=i,this._gain=n,this.refresh(),i.onended=this._onComplete.bind(this),this._duration=i.buffer?.duration??0,this._lastUpdate=this._now(),this._loop?(i.loopStart=r,i.loopEnd=t,i.start(0,r)):t?i.start(0,r,t-r):i.start(0,r),this.emit("start"),this._update(!0),this._enableTicker(!0)}_stop(){if(this._sourceNode){this._enableTicker(!1),this._sourceNode.onended=null,this._sourceNode.stop(0),this._sourceNode.disconnect();try{this._sourceNode.buffer=null}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e)}this._sourceNode=null}}stop(){this._sourceNode&&(this._stop(),this.emit("stop"))}_update(e=!1){if(this._sourceNode){const t=this._now(),r=t-this._lastUpdate;if(r>0||e){this._elapsed+=r*this._sourceNode.playbackRate.value,this._lastUpdate=t;const i=this._duration;let n;if(this._sourceNode.loopStart){const o=this._sourceNode.loopEnd-this._sourceNode.loopStart;n=(this._sourceNode.loopStart+this._elapsed%o)/i}else n=this._elapsed%i/i;this._progress=n,this.emit("progress",n,i)}}}refresh(){if(!this._audio||!this._sourceNode)return;const e=this._audio.context,t=this._audio.parent;this._sourceNode.loop=this._loop||t.loop,e.setParamValue(this._gain.gain,this._volume*(this._muted?0:1)*t.volume*(t.muted?0:1)*e.volume*(e.muted?0:1)),e.setParamValue(this._sourceNode.playbackRate,this._playbackRate*t.playbackRate*e.playbackRate),this.applyProcessors()}applyProcessors(){if(this._sourceNode&&this._processors.length){this._sourceNode.disconnect();let e=this._sourceNode;this._processors.forEach(t=>{e.connect(t.destination),e=t}),e.connect(this._gain)}}refreshPaused(){if(!this._audio)return;const e=this._paused||this._audio.parent.paused||this._audio.context.paused;e!==this._pausedReal&&(this._pausedReal=e,e?(this._stop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,playbackRate:this._playbackRate,loop:this._loop,volume:this._volume})),this.emit("pause",e))}_onComplete=()=>{if(this._sourceNode){this._enableTicker(!1),this._sourceNode.onended=null,this._sourceNode.disconnect();try{this._sourceNode.buffer=null}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e)}}this._sourceNode=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this)};_updateListener=()=>this._update();_enableTicker(e){Se.off(this._updateListener),e&&Se.on(this._updateListener)}free(){this.removeAllListeners(),this._stop(),this._gain?.disconnect(),this._gain=null,this._audio?.context.off("refresh",this.refresh),this._audio?.context.off("refreshPaused",this.refreshPaused),this._audio=null,this._processors.forEach(e=>e.disconnect()),this._processors.length=0,this._end=0,this._playbackRate=1,this._volume=1,this._loop=!1,this._elapsed=0,this._duration=0,this._paused=!1,this._muted=!1,this._pausedReal=!1}}class Hl extends qn{constructor(e){const t=jt.audioContext,r=t.createBufferSource(),i=t.createGain(),n=t.createAnalyser();r.connect(n),n.connect(i),i.connect(jt.instance.destination),super(n,i),this.parent=e,this._sourceNode=r,this.gain=i,this.analyser=n}_sourceBuffer;_sourceNode;_sourceLoad;gain;analyser;get context(){return jt.instance}get isPlayable(){return!!this._sourceNode.buffer}get duration(){return this._sourceNode.buffer?.duration??0}get buffer(){return this._sourceNode.buffer}set buffer(e){this._sourceNode.buffer=e}async load(){return this._sourceLoad||(this._sourceLoad=new Promise(e=>{this._sourceBuffer?this._decode(this._sourceBuffer).then(()=>e(this)):this.parent.src?this._loadUrl(this.parent.src).then(()=>e(this)):e(this)})),this._sourceLoad}_loadUrl(e){return new Promise(t=>{fetch(e).then(r=>r.arrayBuffer()).then(r=>this._decode(r)).finally(()=>t(this))})}_decode(e){return Promise.resolve(e instanceof AudioBuffer?e:jt.decode(e)).then(t=>(this.parent.isLoaded=!0,this.buffer=t,t))}cloneSource(){const e=this.context,t=this._sourceNode,r=e.audioContext.createBufferSource(),i=e.audioContext.createGain();return r.buffer=t.buffer,r.loop=t.loop,e.setParamValue(r.playbackRate,t.playbackRate.value),r.connect(i),i.connect(this.destination),{source:r,gain:i}}createSound(){return new Xl}}var Rg=Object.defineProperty,Ug=Object.getOwnPropertyDescriptor,Bg=(s,e,t)=>e in s?Rg(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Lg=(s,e,t,r)=>{for(var i=r>1?void 0:r?Ug(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(i)||i);return i},Ng=(s,e,t)=>Bg(s,e+"",t);u.Audio=class extends u.TimelineNode{_sounds=[];_platformAudio=Co?new Hl(this):new ql(this);get platformAudio(){return this._platformAudio}_src;get src(){return this._src}set src(e){this._src!==e&&(this._src=e,this.load())}isLoaded=!1;get isPlayable(){return this.isLoaded&&this._platformAudio.isPlayable}get audioDuration(){return this._platformAudio.duration*1e3}_volume=1;get volume(){return this._volume}set volume(e){this._volume!==e&&(this._volume=e,this.refresh())}_muted=!1;get muted(){return this._muted}set muted(e){this._muted!==e&&(this._muted=e,this.refresh())}_loop=!1;get loop(){return this._loop}set loop(e){this._loop!==e&&(this._loop=e,this.refresh())}_playbackRate=1;get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate!==e&&(this._playbackRate=e,this.refresh())}_isPlaying=!1;get isPlaying(){return this._isPlaying}multiple=!1;start=0;end=0;constructor(e=""){super(),this.src=e}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"paused":this.refreshPaused();break}}async load(){return await this._platformAudio.load(),this}pause(){return this._isPlaying=!1,this.paused=!0,this}resume(){return this._isPlaying=this._sounds.length>0,this.paused=!1,this}stop(){if(!this.isPlayable)return this;this._isPlaying=!1;for(let e=this._sounds.length-1;e>=0;e--)this._sounds[e].stop();return this}play(e={}){if(!this.isLoaded)return;this.multiple||this._removeSounds(),this._isPlaying=!0;const t=this._createSound();this._sounds.push(t),t.once("end",()=>{e.complete?.(),this._onComplete(t)}),t.once("stop",()=>this._onComplete(t));const r=(e?.start??this.start)/1e3,i=(e?.end??this.end)/1e3;return t.play({...e,start:r,end:i}),t}_removeSounds(){for(let e=this._sounds.length-1;e>=0;e--)this._recycleSound(this._sounds[e]);this._sounds.length=0}_createSound(){return u.Audio._soundPool.length>0?u.Audio._soundPool.pop().init(this._platformAudio):this._platformAudio.createSound().init(this._platformAudio)}refresh(){for(let e=this._sounds.length,t=0;t<e;t++)this._sounds[t].refresh()}refreshPaused(){for(let e=this._sounds.length,t=0;t<e;t++)this._sounds[t].refreshPaused()}_onComplete=e=>{if(this._sounds){const t=this._sounds.indexOf(e);t>-1&&this._sounds.splice(t,1),this._isPlaying=this._sounds.length>0}this._recycleSound(e)};_recycleSound(e){e.free(),u.Audio._soundPool.includes(e)||u.Audio._soundPool.push(e)}_prevTime=0;_timer=0;_process(e){if(super._process(e),this.canProcess()){const t=this._tree?.timeline.currentTime??0;t-this._prevTime>0&&(this._timer||(this._setTimeStop(),this.play({start:this.start+(t-this.delay)%this.duration})),this._isPlaying&&this._setTimeStop()),this._prevTime=t}}_setTimeStop(){this._timer&&clearTimeout(this._timer),this._timer=setTimeout(()=>{this.stop(),this._timer=0},100)}},Ng(u.Audio,"_soundPool",[]),u.Audio=Lg([W("Audio")],u.Audio);class Fg extends u.Node2D{}var $g=Object.defineProperty,zg=Object.getOwnPropertyDescriptor,ns=(s,e,t,r)=>{for(var i=r>1?void 0:r?zg(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&$g(e,t,i),i};u.AudioWaveform=class extends u.Element2D{_audioBuffer;_src=Or?new ne(document.createElement("canvas")):void 0;_needsUpdateTexture=!1;constructor(e={}){super(),this.setProperties(e)}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"src":this._loadSrc(t);break;case"gap":case"color":case"width":case"height":this._needsUpdateTexture=!0;break}}async _loadSrc(e){await globalThis.fetch(e).then(t=>t.arrayBuffer()).then(t=>jt.decode(t)).then(t=>{this._audioBuffer=t,this.syncTexture(!0)})}syncTexture(e=!1){const t=this._audioBuffer;if(!t||!e&&!this._needsUpdateTexture)return;this._needsUpdateTexture=!1;const r=this._src?.source;if(!r)return;const{width:i=0,height:n=0}=this.style;r.width=i,r.height=n;const o=r.getContext("2d");if(!o){console.warn("Failed to getContext('2d') in syncTexture");return}o.fillStyle=this.color;const a=t.getChannelData(0),l=Math.ceil(a.length/i),c=n/2;for(let h=1,f=-1,d=0;d<i;d++){for(let g=0;g<l;g++){const p=a[d*l+g];p<h&&(h=p),p>f&&(f=p)}if(!this.gap||d%(this.gap*2)===0){const g=d,p=(1+h)*c,y=this.gap||1,m=Math.max(1,(f-h)*c);o.fillRect(g,p,y,m),h=1,f=-1}}this._src?.requestUpload(),this.requestRedraw()}_process(e){this.syncTexture(),super._process(e)}_drawSrc(){const e=this._src;e?.valid&&(this.context.fillStyle=e,this.context.uvTransform=new Ce().scale(1/this.style.width,1/this.style.height))}},ns([w()],u.AudioWaveform.prototype,"src",2),ns([w()],u.AudioWaveform.prototype,"gap",2),ns([w()],u.AudioWaveform.prototype,"color",2),u.AudioWaveform=ns([W("AudioWaveform")],u.AudioWaveform);var Vg=Object.getOwnPropertyDescriptor,Gg=(s,e,t,r)=>{for(var i=r>1?void 0:r?Vg(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(i)||i);return i};u.Control=class extends u.Element2D{constructor(e,t=[]){super(),this._parentUpdateRect=this._parentUpdateRect.bind(this),this.setProperties(e),this.append(t)}_parented(e){super._parented(e),e.on("updateRect",this._parentUpdateRect)}_unparented(e){super._unparented(e),e.off("updateRect",this._parentUpdateRect)}_parentUpdateRect(){const e=this._parent.getRect();this.style.left=e.left,this.style.top=e.top,this.style.width=e.width,this.style.height=e.height}_input(e,t){super._input(e,t),this._guiInput(e,t)}_updateStyleProperty(e,t,r,i){switch(super._updateStyleProperty(e,t,r,i),e){case"width":case"height":case"left":case"top":this.emit("updateRect");break}}_guiInput(e,t){}},u.Control=Gg([W("Control")],u.Control);var jg=Object.defineProperty,Wg=Object.getOwnPropertyDescriptor,Wt=(s,e,t,r)=>{for(var i=r>1?void 0:r?Wg(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&jg(e,t,i),i};u.Range=class extends u.Control{constructor(e,t=[]){super(),this.setProperties(e).append(t)}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"allowGreater":case"allowLesser":case"page":case"minValue":case"maxValue":case"step":case"value":this.requestRedraw();break}}},Wt([w({fallback:!1})],u.Range.prototype,"allowGreater",2),Wt([w({fallback:!1})],u.Range.prototype,"allowLesser",2),Wt([w({fallback:1})],u.Range.prototype,"page",2),Wt([w({fallback:0})],u.Range.prototype,"minValue",2),Wt([w({fallback:100})],u.Range.prototype,"maxValue",2),Wt([w({fallback:.01})],u.Range.prototype,"step",2),Wt([w({fallback:0})],u.Range.prototype,"value",2),u.Range=Wt([W("Range")],u.Range);var qg=Object.defineProperty,Xg=Object.getOwnPropertyDescriptor,mt=(s,e,t,r)=>{for(var i=r>1?void 0:r?Xg(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&qg(e,t,i),i};u.Ruler=class extends u.Control{texture=new Ii;constructor(e,t=[]){super(),this.setProperties(e),this.append(t)}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"offsetX":case"offsetY":case"thickness":case"markHeight":case"color":case"markBackgroundColor":case"markColor":case"gap":case"scale":this.requestRedraw();break}}_updateStyleProperty(e,t,r,i){switch(super._updateStyleProperty(e,t,r,i),e){case"width":case"height":this.texture[e]=t,this.requestRedraw();break}}_drawTexture(){const{width:e,height:t}=this.size,{offsetX:r,offsetY:i,thickness:n,markHeight:o,markBackgroundColor:a,markColor:l,color:c,gap:h,gapScale:f}=this,g=this.texture.source.getContext("2d");g.reset(),g.scale(this.texture.pixelRatio,this.texture.pixelRatio);const p=Math.round(r),y=Math.round(i);g.beginPath(),g.fillStyle=a||"#EEE",g.fillRect(0,0,e,n),g.fillRect(0,0,n,t),g.fill(),g.strokeStyle=l||"#000",g.moveTo(n,0),g.lineTo(n,t),g.moveTo(0,n),g.lineTo(e,n),g.stroke();const m=h,P=h*f;let E,x,C,v,b;for(m>=P?(E=m/P,x=Math.floor(E)*m/20,C=m/20*Math.floor(E)/E):(E=P/m,x=Math.floor(m/20/E),x>=2?x=Math.floor(x/2)*2:x=1,C=x*E),g.fillStyle=g.strokeStyle,v=p,b=0;v<e;b++,v+=C)g.moveTo(v,n-(b%5?o:2*o)),g.lineTo(v,n);for(v=p,b=0;v>n;b++,v-=C)g.moveTo(v,n-(b%5?o:2*o)),g.lineTo(v,n);let S=0;for(v=y,b=0;v>n;b++,v-=C)g.moveTo(n-(b%5?o:2*o),v),g.lineTo(n,v);for(v=y,b=0;v<t;b++,v+=C)g.moveTo(n-(b%5?o:2*o),v),g.lineTo(n,v);for(g.save(),g.fillStyle=c,g.scale(.8,.8),S=n-8,v=p,b=0;v<e;b++,v+=C)b%10===0&&g.fillText(String(Math.ceil(x*b)),v*1.25-3,S*1.25);for(v=p,b=0;v>n;b++,v-=C)b%10===0&&g.fillText(String(Math.ceil(-x*b)),v*1.25-3,S*1.25);for(S=0,v=y,b=0;v>n;b++,v-=C)b%10===0&&g.fillText(String(Math.ceil(x*b)),S*1.25,v*1.25+3);for(v=y,b=0;v<t;b++,v+=C)b%10===0&&g.fillText(String(Math.ceil(-x*b)),S*1.25,v*1.25+3);g.restore(),g.stroke(),this.texture.requestUpload()}_draw(){this._drawTexture();const e=this.texture;e?.valid&&(this.context.fillStyle=e,this.context.uvTransform=new Ce().scale(1/this.size.width,1/this.size.height),this.context.rect(0,0,e.width,e.height),this.context.fill())}},mt([w({fallback:0})],u.Ruler.prototype,"offsetX",2),mt([w({fallback:0})],u.Ruler.prototype,"offsetY",2),mt([w({fallback:20})],u.Ruler.prototype,"thickness",2),mt([w({fallback:3})],u.Ruler.prototype,"markHeight",2),mt([w({fallback:"#b2b6bc"})],u.Ruler.prototype,"color",2),mt([w({fallback:"#f9f9fa"})],u.Ruler.prototype,"markBackgroundColor",2),mt([w({fallback:"#b2b6bc"})],u.Ruler.prototype,"markColor",2),mt([w({fallback:300})],u.Ruler.prototype,"gap",2),mt([w({fallback:1})],u.Ruler.prototype,"gapScale",2),u.Ruler=mt([W("Ruler")],u.Ruler);var Hg=Object.defineProperty,Yg=Object.getOwnPropertyDescriptor,Yl=(s,e,t,r)=>{for(var i=r>1?void 0:r?Yg(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&Hg(e,t,i),i};u.ScrollBar=class extends u.Range{constructor(e,t=[]){super(),this.setProperties(e).append(t)}_updateStyleProperty(e,t,r,i){switch(super._updateStyleProperty(e,t,r,i),e){case"width":case"height":case"left":case"top":this.requestRedraw();break}}_rect(){const{size:e,position:t}=this;let r,i,n,o,a;return this.direction==="vertical"?(n=10,o=e.height*(this.page/(this.maxValue-this.minValue)),r=t.left+e.width-n,i=e.height*(this.value/(this.maxValue-this.minValue)),a=n/2):(n=e.width*(this.page/(this.maxValue-this.minValue)),o=10,r=e.width*(this.value/(this.maxValue-this.minValue)),i=t.top+e.height-o,a=o/2),{left:r,top:i,width:n,height:o,radii:a}}_draw(){const{left:e,top:t,width:r,height:i,radii:n}=this._rect();this.context.roundRect(e,t,r,i,n),this.context.fillStyle=34,this.context.fill()}_pointerInput(e,t){const{left:r,top:i,width:n,height:o}=this._rect(),a=e.x>=r&&e.x<r+n&&e.y>=i&&e.y<i+o;switch(t){case"pointerdown":case"pointermove":a?this._tree?.input.setCursor("pointer"):this._tree?.input.setCursor(void 0);break}return!1}},Yl([w({fallback:"vertical"})],u.ScrollBar.prototype,"direction",2),u.ScrollBar=Yl([W("ScrollBar")],u.ScrollBar);var Kg=Object.getOwnPropertyDescriptor,Zg=(s,e,t,r)=>{for(var i=r>1?void 0:r?Kg(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(i)||i);return i};u.XScrollBar=class extends u.ScrollBar{constructor(e,t=[]){super(),this.setProperties(e).append(t)}},u.XScrollBar=Zg([W("XScrollBar",{direction:"horizontal"})],u.XScrollBar);var Jg=Object.getOwnPropertyDescriptor,Qg=(s,e,t,r)=>{for(var i=r>1?void 0:r?Jg(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(i)||i);return i};u.YScrollBar=class extends u.ScrollBar{constructor(e,t=[]){super(),this.setProperties(e).append(t)}},u.YScrollBar=Qg([W("YScrollBar",{direction:"vertical"})],u.YScrollBar);var em=Object.defineProperty,tm=Object.getOwnPropertyDescriptor,Sr=(s,e,t,r)=>{for(var i=r>1?void 0:r?tm(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&em(e,t,i),i};u.Scaler=class extends u.Node{get target(){if(this.parent?.style)return this.parent}constructor(e,t=[]){super(),this.setProperties(e),this.append(t)}_updateProperty(e,t,r,i){switch(super._updateProperty(e,t,r,i),e){case"translateY":case"translateX":case"scale":case"min":case"max":{this.scale=Ge(this.scale,this.minScale,this.maxScale),this._updateTarget();break}}}_updateTarget(){const e=this.target;e&&(e.style.transform=`translate(${this.translateX}px, ${this.translateY}px) scale(${this.scale})`,this.emit("updateScale",this.scale))}_onWheel(e){this.target&&(e.preventDefault(),e.ctrlKey?(e.wheelDeltaY?Math.abs(Math.abs(e.wheelDeltaY)-Math.abs(3*e.deltaY))<3:e.deltaMode===0)||(e.preventDefault(),this.scale+=e.deltaY*-.015):(this.translateX-=e.deltaX,this.translateY-=e.deltaY))}_input(e,t){switch(super._input(e,t),t){case"wheel":this._onWheel(e);break}}},Sr([w({default:1})],u.Scaler.prototype,"translateX",2),Sr([w({default:1})],u.Scaler.prototype,"translateY",2),Sr([w({default:1})],u.Scaler.prototype,"scale",2),Sr([w({default:.05})],u.Scaler.prototype,"minScale",2),Sr([w({default:10})],u.Scaler.prototype,"maxScale",2),u.Scaler=Sr([W("Scaler",{processMode:"disabled",renderMode:"disabled"})],u.Scaler);var rm=Object.defineProperty,im=Object.getOwnPropertyDescriptor,sm=(s,e,t)=>e in s?rm(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,nm=(s,e,t,r)=>{for(var i=r>1?void 0:r?im(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(i)||i);return i},om=(s,e,t)=>sm(s,e+"",t);u.KawaseTransition=class extends u.Transition{blur=10;quality=10;apply(e,t){const r=this.currentTimeProgress;let i,n;r<.5?(i=0,n=(.5-r)/.5):(i=1,n=(r-.5)/.5);const o=this.blur,a=this.quality,l=t.width,c=t.height,h=[],f=[o];if(o>0){let P=o;const E=o/a;for(let x=1;x<a;x++)P-=E,f.push(P)}const d=1/l,g=1/c,p=[];let y;const m=a-1;for(let P=0;P<m;P++)y=f[P]+.5,p[0]=y*d,p[1]=y*g,h.push({offset:p});y=f[m]+.5,p[0]=y*d,p[1]=y*g,h.push({offset:p}),h.forEach(P=>{Q.draw(e,u.KawaseTransition.material,{sampler:i,progress:n,...P})})}},om(u.KawaseTransition,"material",new se({vert:`attribute vec2 position;
|
|
867
867
|
attribute vec2 uv;
|
|
868
868
|
varying vec2 vUv;
|
|
869
869
|
void main() {
|
|
@@ -884,7 +884,7 @@ void main(void) {
|
|
|
884
884
|
color += texture2D(sampler, vec2(vUv.x - offset1.x, vUv.y - offset1.y));
|
|
885
885
|
color *= 0.25;
|
|
886
886
|
gl_FragColor = color;
|
|
887
|
-
}`})),
|
|
887
|
+
}`})),u.KawaseTransition=nm([W("KawaseTransition")],u.KawaseTransition);var am=Object.defineProperty,lm=Object.getOwnPropertyDescriptor,cm=(s,e,t)=>e in s?am(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,hm=(s,e,t,r)=>{for(var i=r>1?void 0:r?lm(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(i)||i);return i},um=(s,e,t)=>cm(s,e+"",t);u.LeftEraseTransition=class extends u.Transition{apply(e){Q.draw(e,u.LeftEraseTransition.material,{previous:0,next:1,progress:this.currentTimeProgress})}},um(u.LeftEraseTransition,"material",new se({vert:`attribute vec2 position;
|
|
888
888
|
attribute vec2 uv;
|
|
889
889
|
varying vec2 vUv;
|
|
890
890
|
void main() {
|
|
@@ -909,7 +909,7 @@ void main() {
|
|
|
909
909
|
mixPercent = 1.0;
|
|
910
910
|
}
|
|
911
911
|
gl_FragColor = mix(src2Color, src1Color, mixPercent);
|
|
912
|
-
}`})),
|
|
912
|
+
}`})),u.LeftEraseTransition=hm([W("LeftEraseTransition")],u.LeftEraseTransition);var fm=Object.defineProperty,dm=Object.getOwnPropertyDescriptor,pm=(s,e,t)=>e in s?fm(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,gm=(s,e,t,r)=>{for(var i=r>1?void 0:r?dm(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(i)||i);return i},mm=(s,e,t)=>pm(s,e+"",t);u.TiltShiftTransition=class extends u.Transition{blur=100;gradientBlur=600;apply(e,t){const r=this.currentTimeProgress;let i,n;r<.5?(i=0,n=(.5-r)/.5):(i=1,n=(r-.5)/.5);const o=t.width,a=t.height,l=[0,a/2],c=[600,a/2],h=[o,a],f=c[0]-l[0],d=c[1]-l[1],g=Math.sqrt(f*f+d*d);Q.draw(e,u.TiltShiftTransition.material,{sampler:i,progress:n,blur:this.blur,gradientBlur:this.gradientBlur,start:l,end:c,delta:[f/g,d/g],texSize:h}),Q.draw(e,u.TiltShiftTransition.material,{sampler:i,progress:n,blur:this.blur,gradientBlur:this.gradientBlur,start:l,end:c,delta:[-d/g,f/g],texSize:h})}},mm(u.TiltShiftTransition,"material",new se({vert:`attribute vec2 position;
|
|
913
913
|
attribute vec2 uv;
|
|
914
914
|
varying vec2 vUv;
|
|
915
915
|
void main() {
|
|
@@ -953,7 +953,7 @@ void main(void) {
|
|
|
953
953
|
color.rgb /= color.a + 0.00001;
|
|
954
954
|
|
|
955
955
|
gl_FragColor = color;
|
|
956
|
-
}`})),
|
|
956
|
+
}`})),u.TiltShiftTransition=gm([W("TiltShiftTransition")],u.TiltShiftTransition);var ym=Object.defineProperty,vm=Object.getOwnPropertyDescriptor,_m=(s,e,t)=>e in s?ym(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,bm=(s,e,t,r)=>{for(var i=r>1?void 0:r?vm(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(i)||i);return i},wm=(s,e,t)=>_m(s,e+"",t);u.TwistTransition=class extends u.Transition{radius;angle=4;padding=20;offset;apply(e,t){const r=this.currentTimeProgress;let i,n;r<.5?(i=0,n=(.5-r)/.5):(i=1,n=(r-.5)/.5);const o=t.width,a=t.height;Q.draw(e,u.TwistTransition.material,{sampler:i,progress:n,filterArea:[o,a,0,0],radius:this.radius??o,angle:this.angle,padding:this.padding,offset:this.offset??[o/2,a/2]})}},wm(u.TwistTransition,"material",new se({vert:`attribute vec2 position;
|
|
957
957
|
attribute vec2 uv;
|
|
958
958
|
varying vec2 vUv;
|
|
959
959
|
void main() {
|
|
@@ -999,5 +999,4 @@ void main(void) {
|
|
|
999
999
|
coord = twist(coord, radius - (progress * radius));
|
|
1000
1000
|
coord = unmapCoord(coord);
|
|
1001
1001
|
gl_FragColor = texture2D(sampler, coord);
|
|
1002
|
-
}`})),g.TwistTransition=Wp([st("TwistTransition")],g.TwistTransition);class cc extends oA{install(t){const e=async A=>{const{decodeFrames:i}=await import("modern-gif");return await t.fetch(A).then(s=>s.arrayBuffer()).then(s=>i(s)).then(s=>new dr(s.map(n=>({duration:n.delay,texture:new Ys(n.data,n.width,n.height)}))))};return this.load=A=>t.loadBy(A,()=>e(A)),["image/gif"].forEach(A=>{t.register(A,e)}),t.gif=this,this}}class hc extends oA{install(t){const e=A=>t.fetch(A).then(i=>i.json());return this.load=A=>t.loadBy(A,()=>e(A)),["json"].forEach(A=>{t.register(A,e)}),t.json=this,this}}class gc extends oA{install(t){const e=async(A,i)=>(await import("lottie-web").then(n=>n.default)).loadAnimation({container:null,renderer:"canvas",rendererSettings:{context:i.getContext("2d")},loop:!1,autoplay:!1,animationData:await t.fetch(A).then(n=>n.json())});return this.load=(A,i)=>t.loadBy(A,()=>e(A,i)),["lottie"].forEach(A=>{t.register(A,e)}),t.lottie=this,this}}class uc extends oA{install(t){const e=async A=>await t.fetch(A).then(i=>i.text());return this.load=A=>t.loadBy(A,()=>e(A)),t.text=this,this}}class fc extends oA{install(t){const e=A=>t.fetchImageBitmap(A,{premultiplyAlpha:"premultiply"}).then(i=>new yt(i));return this.load=A=>t.loadBy(A,()=>e(A)),["image/gif","image/jpeg","image/png","image/tiff","image/vnd.wap.wbmp","image/x-icon","image/x-jng","image/x-ms-bmp","image/svg+xml","image/webp"].forEach(A=>{t.register(A,e)}),t.texture=this,this}}class dc extends oA{install(t){const e=A=>new za(A).load();return this.load=A=>t.loadBy(A,()=>e(A)),["video/3gpp","video/mpeg","video/quicktime","video/x-flv","video/x-mng","video/x-ms-asf","video/x-ms-wmv","video/x-msvideo","video/mp4"].forEach(A=>{t.register(A,e)}),t.video=this,this}}const qp=Object.entries({"text/html":["html","htm","shtml"],"text/css":["css"],"text/xml":["xml"],"image/gif":["gif"],"image/jpeg":["jpeg","jpg"],"application/x-javascript":["js"],"application/atom+xml":["atom"],"application/rss+xml":["rss"],"text/mathml":["mml"],"text/plain":["txt"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/x-component":["htc"],"image/png":["png"],"image/tiff":["tif","tiff"],"image/vnd.wap.wbmp":["wbmp"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-ms-bmp":["bmp"],"image/svg+xml":["svg"],"image/webp":["webp"],"application/java-archive":["jar","war","ear"],"application/mac-binhex40":["hqx"],"application/msword":["doc"],"application/pdf":["pdf"],"application/postscript":["ps","eps","ai"],"application/rtf":["rtf"],"application/vnd.ms-excel":["xls"],"application/vnd.ms-powerpoint":["ppt"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/x-7z-compressed":["7z"],"application/x-cocoa":["cco"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-makeself":["run"],"application/x-perl":["pl","pm"],"application/x-pilot":["prc","pdb"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-sea":["sea"],"application/x-shockwave-flash":["swf"],"application/x-stuffit":["sit"],"application/x-tcl":["tcl","tk"],"application/x-x509-ca-cert":["der","pem","crt"],"application/x-xpinstall":["xpi"],"application/xhtml+xml":["xhtml"],"application/zip":["zip"],"application/octet-stream":["bin","exe","dll","deb","dmg","eot","iso","img","msi","msp","msm"],"audio/midi":["mid","midi","kar"],"audio/mpeg":["mp3"],"audio/ogg":["ogg"],"audio/x-realaudio":["ra"],"video/3gpp":["3gpp","3gp"],"video/mpeg":["mpeg","mpg"],"video/quicktime":["mov"],"video/x-flv":["flv"],"video/x-mng":["mng"],"video/x-ms-asf":["asx","asf"],"video/x-ms-wmv":["wmv"],"video/x-msvideo":["avi"],"video/mp4":["m4v","mp4"]});function Xp(r){for(const[t,e]of qp)if(e.includes(r))return t}async function jp(r){let t;if(r.startsWith("data:"))t=r.match(/^data:(.+?);/)?.[1];else if(r.startsWith("http")){const e=r.split(/[#?]/)[0].split(".").pop()?.trim();e&&(t=Xp(e))}return t??await fetch(r).then(e=>e.headers.get("Content-Type"))??""}const Jr="WeakRef"in globalThis;class Ic{defaultHandler=t=>this.fetch(t);_handlers=new Map;_handleing=new Map;_handled=new Map;_gc=Jr?new FinalizationRegistry(t=>{const e=this.get(t);e&&"free"in e&&e.free(),this._handled.delete(t)}):void 0;constructor(){Jr||Kt.on(this.gc.bind(this),{sort:2})}use(t){return t.install(this),this}register(t,e){return this._handlers.set(t,e),this}fetch(t){return fetch(t)}_fixSVG(t){let e;t.includes(";base64,")?e=atob(t.split(",")[1]):e=decodeURIComponent(t.split(",")[1]);const A=new DOMParser().parseFromString(e,"image/svg+xml").documentElement,i=A.getAttribute("width"),s=A.getAttribute("height"),n=i&&/^[\d.]+$/.test(i),o=s&&/^[\d.]+$/.test(s);if(!n||!o){const a=A.getAttribute("viewBox")?.split(" ").map(l=>Number(l));n||A.setAttribute("width",String(a?a[2]-a[0]:512)),o||A.setAttribute("height",String(a?a[3]-a[1]:512))}return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(A.outerHTML)}`}async fetchImageBitmap(t,e){return t.startsWith("http")?await this.fetch(t).then(A=>A.blob()).then(A=>A.type==="image/svg+xml"?A.text().then(i=>this.fetchImageBitmap(this._fixSVG(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(i)}`),e)):createImageBitmap(A,e)):(t.startsWith("data:image/svg+xml;")&&(t=this._fixSVG(t)),new Promise(A=>{const i=new Image;i.src=t,i.onload=()=>{i.decode().finally(()=>{A(i)})}}).then(A=>createImageBitmap(A,e)))}get(t){let e=this._handled.get(t);return Jr&&e instanceof WeakRef&&(e=e.deref(),e||this._handleing.delete(t)),e}set(t,e){let A=e;Jr&&typeof e=="object"&&(this._gc.register(e,t),A=new WeakRef(e)),this._handled.set(t,A)}async loadBy(t,e){const A=this.get(t)??this._handleing.get(t);if(A)return A;const i=e().then(s=>(this.set(t,s),s)).finally(()=>{this._handleing.delete(t)});return this._handleing.set(t,i),i}async load(t,e){return this.loadBy(t,async()=>{const A=await jp(t);return(this._handlers.get(A)??this.defaultHandler)(t,e)})}async waitUntilLoad(){await Promise.all(Array.from(this._handleing.values()).map(t=>t.catch(e=>{console.error(e)})))}gc(){this._handled.forEach((t,e)=>{const A=this.get(e);A&&"free"in A&&A.free()}),this._handled.clear()}}const Fe=new Ic().use(new Ia).use(new cc).use(new hc).use(new gc).use(new uc).use(new fc).use(new dc);var Zp=Object.getOwnPropertyDescriptor,$p=(r,t,e,A)=>{for(var i=A>1?void 0:A?Zp(t,e):t,s=r.length-1,n;s>=0;s--)(n=r[s])&&(i=n(i)||i);return i};g.CanvasItemEditor=class extends g.Control{_pointerStart;_pointerOffset;selected;dragging;hovered;hover=new g.Element2D({name:"hover",internalMode:"back",style:{visibility:"hidden",outlineStyle:"solid",outlineColor:"#00FF00FF",outlineWidth:2,pointerEvents:"none"}});transformRect=new Kn({name:"transformRect",internalMode:"back",style:{visibility:"hidden",pointerEvents:"none"}});scaler=new g.Scaler({name:"Scaler",internalMode:"back"}).on("updateScale",t=>{this.ruler.gapScale=t,this._updateScrollbars(),this._updateSelectionRect()});xScrollBar=new g.XScrollBar({name:"XScrollBar",internalMode:"back",style:{visibility:"hidden"}});yScrollBar=new g.YScrollBar({name:"yScrollBar",internalMode:"back",style:{visibility:"hidden"}});drawboard=new g.Element2D({name:"drawboard",style:{width:500,height:500,backgroundColor:"#00FFFFFF",pointerEvents:"none"}},[this.scaler]);ruler=new g.Ruler({name:"ruler",offsetX:100,offsetY:100,style:{pointerEvents:"none"}},[this.drawboard,this.hover,this.transformRect,this.xScrollBar,this.yScrollBar]);constructor(){super(),this._onPointerdown=this._onPointerdown.bind(this),this._onPointermove=this._onPointermove.bind(this),this._onPointerup=this._onPointerup.bind(this),this.append(this.ruler)}_updateStyleProperty(t,e,A,i){switch(super._updateStyleProperty(t,e,A,i),t){case"width":this.drawboard.style.left=(this.size.width-this.drawboard.size.width)/2,this.ruler.offsetX=this.drawboard.style.left;break;case"height":this.drawboard.style.top=(this.size.height-this.drawboard.size.height)/2,this.ruler.offsetY=this.drawboard.style.top;break}}_guiInput(t,e){switch(super._guiInput(t,e),e){case"pointerdown":this._onPointerdown(t);break;case"pointermove":this._onPointermove(t);break;case"pointerup":this._onPointerup();break}}_onPointerdown(t){let e=t.target;e?.equal(this)&&(e=void 0),e?.equal(this.transformRect)&&(e=this.selected),this._pointerOffset={x:t.offsetX,y:t.offsetY},this.selected=e,this.dragging=e,e instanceof g.Element2D?this._pointerStart=e.style.clone():this._pointerStart=void 0,this._updateHover(),this._updateSelectionRect()}_onPointermove(t){let e=t.target;e?.equal(this)&&(e=void 0),e?.equal(this.transformRect)&&(e=this.selected);const{selected:A,dragging:i,_pointerStart:s,_pointerOffset:n}=this;A&&e?.equal(A)?this.hovered=void 0:this.hovered=e;const o=n?{x:t.offsetX-n.x,y:t.offsetY-n.y}:{x:0,y:0};i&&s&&(i.style.left=s.left+o.x/this.scaler.scale,i.style.top=s.top+o.y/this.scaler.scale,i.update()),this._updateHover(),this._updateSelectionRect()}_onPointerup(){this.dragging=void 0,this._updateHover(),this._updateSelectionRect()}_copyGlobalTransform(t,e){t.style.visibility="visible",t.style.width=e.globalScale.x*e.size.x,t.style.height=e.globalScale.y*e.size.y,t.style.left=e.globalPosition.x,t.style.top=e.globalPosition.y,t.style.rotate=e.globalRotation,t.update()}_updateHover(){const t=this.hovered;t instanceof g.Element2D?(this.hover.style.visibility="visible",this._copyGlobalTransform(this.hover,t),this.hover.requestRedraw()):this.hover.style.visibility="hidden"}_updateSelectionRect(){this.selected?(this.transformRect.style.visibility="visible",this._copyGlobalTransform(this.transformRect,this.selected)):this.transformRect.style.visibility="hidden"}_updateScrollbars(){const t=this.ruler.gapScale,e=this.drawboard.size.height*t,A=this.drawboard.size.width*t;e>this.size.height?(this.yScrollBar.style.visibility="visible",this.yScrollBar.maxValue=e,this.yScrollBar.page=this.size.height):this.yScrollBar.style.visibility="hidden",A>this.size.width?(this.xScrollBar.style.visibility="visible",this.xScrollBar.maxValue=A,this.xScrollBar.page=this.size.width):this.xScrollBar.style.visibility="hidden"}},g.CanvasItemEditor=$p([st("CanvasItemEditor")],g.CanvasItemEditor);const pc={alpha:!0,stencil:!0,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"};class Ec extends mi{renderer;get view(){return this.renderer.view}get gl(){return this.renderer.gl}get screen(){return this.renderer.screen}get width(){return this.screen.width}get height(){return this.screen.height}get pixelRatio(){return this.renderer.pixelRatio}set pixelRatio(t){this.renderer.pixelRatio=t,this.resize(this.width,this.height),this.view&&(this.view.dataset.pixelRatio=String(t))}_resizeObserver=Uo?new ResizeObserver(t=>{const e=t[0];if(e.target===this.view){const{inlineSize:A,blockSize:i}=Array.isArray(e.contentBoxSize)?e.contentBoxSize[0]:e.contentBoxSize;this.resize(A,i)}}):void 0;constructor(t={}){const{debug:e=!1,view:A,width:i,height:s,pixelRatio:n=vs,backgroundColor:o=0,autoResize:a,autoStart:l,timeline:c,...h}=t;super(c),this.debug=e,this.renderer=new da(A,{...pc,...h}),this._setupInput(),this.pixelRatio=n,this.backgroundColor=o,a?(!A&&this.renderer.view&&(this.renderer.view.style.width="100%",this.renderer.view.style.height="100%"),this.enableAutoResize(a)):this.resize(i||this.gl.drawingBufferWidth||this.view?.clientWidth||200,s||this.gl.drawingBufferHeight||this.view?.clientHeight||200,!A),l&&this.start()}_setupInput(){return this.view&&(this.input.setTarget(this.view),["pointerdown","pointerover","pointermove","pointerup","wheel","keydown","keypress","keyup"].forEach(t=>{this.input.on(t,e=>{this.root.input(e,t),this.emit(t,e)})})),this}enableAutoResize(t=!0){return this.view&&(t?this._resizeObserver?.observe(this.view):this._resizeObserver?.unobserve(this.view)),this}resize(t,e,A=!1){return this.renderer.resize(t,e,A),this.root.width=t,this.root.height=e,this.root.requestUpload(),this.render(),this}nextTick(){return Es()}async waitUntilLoad(){await Fe.waitUntilLoad(),await this.nextTick()}async waitAndRender(t=0){await Fe.waitUntilLoad(),this._process(t),await this.nextTick(),this._render(this.renderer)}render(t=0){this._process(t),this._render(this.renderer)}async start(){await this.waitAndRender(),super.start(t=>{this._process(t),this._render(this.renderer)})}free(){super.free(),this.enableAutoResize(!1),this.renderer.free()}toPixels(){return this.renderer.toPixels()}toImageData(){return new ImageData(this.toPixels(),this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}toCanvas2D(){const t=this.toImageData(),e=document.createElement("canvas");e.width=t.width,e.height=t.height,e.getContext("2d")?.putImageData(t,0,0);const A=document.createElement("canvas");return A.width=this.width,A.height=this.height,A.getContext("2d")?.drawImage(e,0,0,e.width,e.height,0,0,A.width,A.height),A}}let Te;const Vn=[];let Wn=!1;async function tE(r=100){if(!Wn){for(Wn=!0;Vn.length;){const t=Vn.shift();if(t)try{await t()}catch(e){console.error(e)}else await new Promise(e=>setTimeout(e,r))}Wn=!1}}async function eE(r){const{data:t,width:e,height:A,debug:i=!1,time:s=0}=r;return Te??=new Ec({width:1,height:1,preserveDrawingBuffer:!0}),Te.debug=i,Te.root.removeChildren(),Te.timeline.currentTime=s,Te.resize(e,A,!0),(Array.isArray(t)?t:[t]).forEach(n=>{n instanceof g.Node?(n.parent=void 0,Te.root.appendChild(n)):Te.root.appendChild(g.Node.parse(n))}),await r.onBeforeRender?.(Te),await Te.waitAndRender(),Te.toCanvas2D()}async function AE(r){return new Promise(t=>{Vn.push(async()=>t(await eE(r))),tE()})}var iE=(()=>{var r=typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:CA&&CA.tagName.toUpperCase()==="SCRIPT"&&CA.src||new URL("index.js",document.baseURI).href;return(function(t){t=t||{};var e;e||(e=typeof t<"u"?t:{});var A,i;e.ready=new Promise(function(I,E){A=I,i=E});var s=Object.assign({},e),n="";typeof document<"u"&&document.currentScript&&(n=document.currentScript.src),r&&(n=r),n.indexOf("blob:")!==0?n=n.substr(0,n.replace(/[?#].*/,"").lastIndexOf("/")+1):n="";var o=e.print||console.log.bind(console),a=e.printErr||console.warn.bind(console);Object.assign(e,s),s=null;var l;e.wasmBinary&&(l=e.wasmBinary),e.noExitRuntime,typeof WebAssembly!="object"&&J("no native wasm support detected");var c,h=!1;function u(I,E,C){C=E+C;for(var _="";!(E>=C);){var b=I[E++];if(!b)break;if(b&128){var k=I[E++]&63;if((b&224)==192)_+=String.fromCharCode((b&31)<<6|k);else{var N=I[E++]&63;b=(b&240)==224?(b&15)<<12|k<<6|N:(b&7)<<18|k<<12|N<<6|I[E++]&63,65536>b?_+=String.fromCharCode(b):(b-=65536,_+=String.fromCharCode(55296|b>>10,56320|b&1023))}}else _+=String.fromCharCode(b)}return _}var d,f,B,p,D,R,w,S,Q;function m(){var I=c.buffer;d=I,e.HEAP8=f=new Int8Array(I),e.HEAP16=p=new Int16Array(I),e.HEAP32=R=new Int32Array(I),e.HEAPU8=B=new Uint8Array(I),e.HEAPU16=D=new Uint16Array(I),e.HEAPU32=w=new Uint32Array(I),e.HEAPF32=S=new Float32Array(I),e.HEAPF64=Q=new Float64Array(I)}var x,M=[],V=[],et=[];function W(){var I=e.preRun.shift();M.unshift(I)}var H=0,Z=null;function J(I){throw e.onAbort&&e.onAbort(I),I="Aborted("+I+")",a(I),h=!0,I=new WebAssembly.RuntimeError(I+". Build with -sASSERTIONS for more info."),i(I),I}function T(I){return I.startsWith("data:application/octet-stream;base64,")}var it;if(it="data:application/octet-stream;base64,AGFzbQEAAAABugM3YAF/AGACf38AYAF/AX9gA39/fwBgAn98AGACf38Bf2ADf39/AX9gBH9/f30BfWADf398AGAAAGAEf39/fwBgAX8BfGACf38BfGAFf39/f38Bf2AAAX9gA39/fwF9YAZ/f31/fX8AYAV/f39/fwBgAn9/AX1gBX9/f319AX1gAX8BfWADf35/AX5gB39/f39/f38AYAZ/f39/f38AYAR/f39/AX9gBn9/f319fQF9YAR/f31/AGADf399AX1gBn98f39/fwF/YAR/fHx/AGACf30AYAh/f39/f39/fwBgDX9/f39/f39/f39/f38AYAp/f39/f39/f39/AGAFf39/f38BfGAEfHx/fwF9YA1/fX1/f399fX9/f39/AX9gB39/f319f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gACgC9AMoAgAiAQRAIAIgACAGIAERBgAiAQ0BC0GIBBAeIgEgAigCEDYCECABIAIpAgg3AgggASACKQIANwIAIAFBFGogAkEUakHoABArGiABQgA3AoABIAFB/ABqIgNBADsBACABQgA3AogBIAFCADcCkAEgAyACQfwAahCgASABQZgBaiACQZgBakHQAhArGiABQQA2AvADIAFCADcC6AMgAigC7AMiAyACKALoAyIERwRAIAMgBGsiBEEASA0FIAEgBBAeIgM2AuwDIAEgAzYC6AMgASADIARqNgLwAyACKALoAyIEIAIoAuwDIghHBEADQCADIAQoAgA2AgAgA0EEaiEDIARBBGoiBCAIRw0ACwsgASADNgLsAwsgASACKQL0AzcC9AMgASACKAKEBDYChAQgASACKQL8AzcC/AMgAUEANgLkAwsgBSABNgIAIAEgADYC5AMLIAZBAWohBiAFQQRqIgUgB0cNAAsLDwsQAgALUAACQAJAAkACQAJAIAIOBAQAAQIDCyAAIAEgAUEwahBDDwsgACABIAFBMGogAxBEDwsgACABIAFBMGoQQg8LECQACyAAIAEgAUEwaiADEEULcAIBfwF9IwBBEGsiBCQAIARBCGogACABQQJ0QdwlaigCACACEDZDAADAfyEFAkACQAJAIAQtAAxBAWsOAgABAgsgBCoCCCEFDAELIAQqAgggA5RDCtcjPJQhBQsgBEEQaiQAIAVDAAAAACAFIAVbGwt5AgF/AX0jAEEQayIDJAAgA0EIaiAAIAFBAnRB7CVqKAIAIAIQU0MAAMB/IQQCQAJAAkAgAy0ADEEBaw4CAAECCyADKgIIIQQMAQsgAyoCCEMAAAAAlEMK1yM8lCEECyADQRBqJAAgBEMAAAAAl0MAAAAAIAQgBFsbC1QAAkACQAJAAkACQCACDgQEAAECAwsgACABIAFBwgBqEEMPCyAAIAEgAUHCAGogAxBEDwsgACABIAFBwgBqEEIPCxAkAAsgACABIAFBwgBqIAMQRQsvACAAIAJFQQF0IgIgASADEGAgACACIAEQS5IgACACIAEgAxB/IAAgAiABEFKSkgvOAQIDfwJ9IwBBEGsiAyQAQQEhBCADQQhqI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CACQf8BcUYNAQsgBSABIAYgAhA5A0AgAC0AACIBQQRxDQEgACABQQRyOgAAIAAoAhAiAQRAIAAgAREAAAsgAEGAgID+BzYCnAEgACgC5AMiAA0ACwsgA0EQaiQAC0ABAX8CQEGsOy0AAEEBcQRAQag7KAIAIQIMAQtBAUGAJxAMIQJBrDtBAToAAEGoOyACNgIACyACIAAgAUEAEBMLzQECA38CfSMAQRBrIgMkAEEBIQQgA0EIaiAAQfwAaiIFIAAgAUEBdGpBMmoiAS8BABAfAkACQCADKgIIIgcgAioCACIGXARAIAcgB1sEQCACLQAEIQIMAgsgBiAGXCEECyACLQAEIQIgBEUNACADLQAMIAJB/wFxRg0BCyAFIAEgBiACEDkDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCyADQRBqJAALDwAgASAAKAIAaiACOQMACw0AIAEgACgCAGorAwALCwAgAARAIAAQIwsLxwECBH8CfSMAQRBrIgIkACACQQhqIABB/ABqIgQgAEEeaiIFLwEAEB9BASEDAkACQCACKgIIIgcgASoCACIGXARAIAcgB1sEQCABLQAEIQEMAgsgBiAGXCEDCyABLQAEIQEgA0UNACACLQAMIAFB/wFxRg0BCyAEIAUgBiABEDkDQCAALQAAIgFBBHENASAAIAFBBHI6AAAgACgCECIBBEAgACABEQAACyAAQYCAgP4HNgKcASAAKALkAyIADQALCyACQRBqJAALlgMCA34CfyAAvSICQjSIp0H/D3EiBEH/D0YEQCAARAAAAAAAAPA/oiIAIACjDwsgAkIBhiIBQoCAgICAgIDw/wBYBEAgAEQAAAAAAAAAAKIgACABQoCAgICAgIDw/wBRGw8LAn4gBEUEQEEAIQQgAkIMhiIBQgBZBEADQCAEQQFrIQQgAUIBhiIBQgBZDQALCyACQQEgBGuthgwBCyACQv////////8Hg0KAgICAgICACIQLIQEgBEH/B0oEQANAAkAgAUKAgICAgICACH0iA0IAUw0AIAMiAUIAUg0AIABEAAAAAAAAAACiDwsgA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QQJxRQRAIAYgACoCzAOSIQYLAkACQCAEDgQBAQMAAgsgASoClAMgAioClAOTIQdBAiEDDAMLIAEqApgDIAIqApgDkyEHQQEhAwJAIAQOAgMAAQtBAyEDDAILECQACyABKgKUAyACKgKUA5MhB0EAIQMLIAIgA0ECdGogByAGkzgCnAMMAQsgBEECdEHcJWooAgAhACAIIAQgAyAGEEEgASAAQQJ0IgBqIgEqArwDkiEGIAAgAmogAigC9AMtABRBAnEEfSAGBSAGIAEqAswDkgs4ApwDCyAJQRBqJAALcAIBfwF9IwBBEGsiBCQAIARBCGogACABQQJ0QewlaigCACACEDZDAADAfyEFAkACQAJAIAQtAAxBAWsOAgABAgsgBCoCCCEFDAELIAQqAgggA5RDCtcjPJQhBQsgBEEQaiQAIAVDAAAAACAFIAVbGwscACAAIAFBCCACpyACQiCIpyADpyADQiCIpxAVCwUAEFgACzkAIABFBEBBAA8LAn8gAUGAf3FBgL8DRiABQf8ATXJFBEBB/DtBGTYCAEF/DAELIAAgAToAAEEBCwvEAgACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABQQlrDhIACgsMCgsCAwQFDAsMDAoLBwgJCyACIAIoAgAiAUEEajYCACAAIAEoAgA2AgAPCwALIAIgAigCACIBQQRqNgIAIAAgATIBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATMBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATAAADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATEAADcDAA8LAAsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKwMAOQMADwsgACACIAMRAQALDwsgAiACKAIAIgFBBGo2AgAgACABNAIANwMADwsgAiACKAIAIgFBBGo2AgAgACABNQIANwMADwsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKQMANwMAC84BAgN/An0jAEEQayIDJABBASEEIANBCGogAEH8AGoiBSAAIAFBAXRqQegAaiIBLwEAEB8CQAJAIAMqAggiByACKgIAIgZcBEAgByAHWwRAIAItAAQhAgwCCyAGIAZcI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gASkDCCEGIwBBIGsiCCQAAkAgBkL///////////8AgyIEQoCAgICAgMCAPH0gBEKAgICAgIDA/8MAfVQEQCAGQgSGIANCPIiEIQQgA0L//////////w+DIgNCgYCAgICAgIAIWgRAIARCgYCAgICAgIDAAHwhAgwCCyAEQoCAgICAgICAQH0hAiADQoCAgICAgICACFINASACIARCAYN8IQIMAQsgA1AgBEKAgICAgIDA//8AVCAEQoCAgICAgMD//wBRG0UEQCAGQgSGIANCPIiEQv////////8Dg0KAgICAgICA/P8AhCECDAELQoCAgICAgID4/wAhAiAEQv///////7//wwBWDQBCACECIARCMIinIgBBkfcASQ0AIAMhAiAGQv///////z+DQoCAgICAgMAAhCIFIQcCQCAAQYH3AGsiAUHAAHEEQCACIAFBQGqthiEHQgAhAgwBCyABRQ0AIAcgAa0iBIYgAkHAACABa62IhCEHIAIgBIYhAgsgCCACNwMQIAggBzcDGAJAQYH4ACAAayIAQcAAcQRAIAUgAEFAaq2IIQNCACEFDAELIABFDQAgBUHAACAAa62GIAMgAK0iAoiEIQMgBSACiCEFCyAIIAM3AwAgCCAFNwMIIAgpAwhCBIYgCCkDACIDQjyIhCECIAgpAxAgCCkDGIRCAFKtIANC//////////8Pg4QiA0KBgICAgICAgAhaBEAgAkIBfCECDAELIANCgICAgICAgIAIUg0AIAJCAYMgAnwhAgsgCEEgaiQAIAkgAiAGQoCAgICAgICAgH+DhL85AwALmRgDEn8BfAN+IwBBsARrIgwkACAMQQA2AiwCQCABvSIZQgBTBEBBASERQZkJIRMgAZoiAb0hGQwBCyAEQYAQcQRAQQEhEUGcCSETDAELQZ8JQZoJIARBAXEiERshEyARRSEVCwJAIBlCgICAgICAgPj/AINCgICAgICAgPj/AFEEQCAAQSAgAiARQQNqIgMgBEH//3txECkgACATIBEQJiAAQe0VQdweIAVBIHEiBRtB4RpB4B4gBRsgASABYhtBAxAmIABBICACIAMgBEGAwABzECkgAyACIAIgA0gbIQoMAQsgDEEQaiESAkACfwJAIAEgDEEsahCMASIBIAG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ASgCACAAaigCAAUgAAsRCwALYQECfyMAQRBrIgIkACABIAAoAgQiA0EBdWohASAAKAIAIQAgAiABIANBAXEEfyABKAIAIABqKAIABSAACxEBAEEQEB4iACACKQMINwMIIAAgAikDADcDACACQRBqJAAgAAtjAQJ/IwBBEGsiAyQAIAEgACgCBCIEQQF1aiEBIAAoAgAhACADIAEgAiAEQQFxBH8gASgCACAAaigCAAUgAAsRAwBBEBAeIgAgAykDCDcDCCAAIAMpAwA3AwAgA0EQaiQAIAALNwEBfyABIAAoAgQiA0EBdWohASAAKAIAIQAgASACIANBAXEEfyABKAIAIABqKAIABSAACxEEAAs5AQF/IAEgACgCBCIEQQF1aiEBIAAoAgAhACABIAIgAyAEQQFxBH8gASgCACAAaigCAAUgAAsRCAALCQAgASAAEQIACwUAQcM7Cw8AIAEgACgCAGogAjYCAAsNACABIAAoAgBqKAIACxgBAX9BEBAeIgBCADcDCCAAQQA2AgAgAAsYAQF/QRAQHiIAQgA3AwAgAEIANwMIIAALDABBMBAeQQBBMBAqCzcBAX8gASAAKAIEIgNBAXVqIQEgACgCACEAIAEgAiADQQFxBH8gASgCACAAaigCAAUgAAsRHgALBQBBvjsLIQAgACABKAIAIAEgASwAC0EASBtBuzsgAigCABAQNgIACyoBAX9BDBAeIgFBADoABCABIAAoAgA2AgggAEEANgIAIAFB2Cc2AgAgAQsFAEG7OwsFAEG4OwshACAAIAEoAgAgASABLAALQQBIG0GkOyACKAIAEBA2AgAL2AEBBH8jAEEgayIDJAAgASgCACIEQfD///8HSQRAAkACQCAEQQtPBEAgBEEPckEBaiIFEB4hBiADIAVBgICAgHhyNgIQIAMgBjYCCCADIAQ2AgwgBCAGaiEFDAELIAMgBDoAEyADQQhqIgYgBGohBSAERQ0BCyAGIAFBBGogBBArGgsgBUEAOgAAIAMgAjYCACADQRhqIANBCGogAyAAEQMAIAMoAhgQHSADKAIYIgAQBiADKAIAEAYgAywAE0EASARAIAMoAggQIwsgA0EgaiQAIAAPCxACAAsqAQF/QQ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iEAQQEhAyAEIQZBASEEIAZFDQALIAVB9gBqIQAgAUH2AGohCUEAIQRBACEDA0ACQCAJIANBAXRqLwAAIgZBB3FFBEAgAC0AAEEHcUUNAQsgAkEIaiAIIAYQHyACIAcgAC8AABAfQQEhAyACKgIIIgogAioCACILXAR/IAogClsNAyALIAtcBSADC0UNAiACLQAMIAItAARHDQILIABBAmohAEEBIQMgBCEGQQEhBCAGRQ0ACyABLwB6IgBBB3FFBEAgBS0AekEHcUUNAgsgCCAAECAiCiAHIAUvAHoQICILWw0BIAogClsNACALIAtcDQELIAFBFGogBUEUakHoABArGiABQfwAaiAFQfwAahCgAQNAIAEtAAAiAEEEcQ0BIAEgAEEEcjoAACABKAIQIgAEQCABIAARAAALIAFBgICA/gc2ApwBIAEoAuQDIgENAAsLIAJBEGokAAvGAwEEfyMAQaAEayICJAAgACgCBCEBIABBADYCBCABBEAgASABKAIAKAIEEQAACyAAKAIIIQEgAEEANgIIIAEEQCABIAEoAgAoAgQRAAALAkAgACgCACIAKALoAyAAKALsA0YEQCAAKALkAw0BIAAgAkEYaiAAKAL0AxBcIgEpAgA3AgAgACABKAIQNgIQIAAgASkCCDcCCCAAQRRqIAFBFGpB6AAQKxogACABKQKMATcCjAEgACABKQKEATcChAEgACABKQJ8NwJ8IAEoApQBIQQgAUEANgKUASAAKAKUASEDIAAgBDYClAEgAwRAIAMQWwsgAEGYAWogAUGYAWpB0AIQKxogACgC6AMiAwRAIAAgAzYC7AMgAxAjCyAAIAEoAugDNgLoAyAAIAEoAuwDNgLsAyAAIAEoAvADNgLwAyABQQA2AvADIAFCADcC6AMgACABKQL8AzcC/AMgACABKQL0AzcC9AMgACABKAKEBDYChAQgASgClAEhACABQQA2ApQBIAAEQCAAEFsLIAJBoARqJAAPCyACQfAcNgIQIABBBUHYJSACQRBqECwQJAALIAJB5hE2AgAgAEEFQdglIAIQLBAkAAsLAEEMEB4gABCiAQsLAEEMEB5BABCiAQsNACAAKAIALQAIQQFxCwoAIAAoAgAo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AAAAUAAAAAAAAJAAAAAAsAAAAAAAAAABkAEQoZGRkDCgcAAQAJCxgAAAkGCwAACwAGGQAAABkZGQBBkSwLIQ4AAAAAAAAAABkACg0ZGRkADQAAAgAJDgAAAAkADgAADgBByywLAQwAQdcsCxUTAAAAABMAAAAACQwAAAAAAAwAAAwAQYUtCwEQAEGRLQsVDwAAAAQPAAAAAAkQAAAAAAAQAAAQAEG/LQsBEgBByy0LHhEAAAAAEQAAAAAJEgAAAAAAEgAAEgAAGgAAABoaGgBBgi4LDhoAAAAaGhoAAAAAAAAJAEGzLgsBFABBvy4LFRcAAAAAFwAAAAAJFAAAAAAAFAAAFABB7S4LARYAQfkuCycVAAAAABUAAAAACRYAAAAAABYAABYAADAxMjM0NTY3ODlBQkNERUYAQcQvCwHSAEHsLwsI//////////8AQbAwCwkQIgEAAAAAAAUAQcQwCwHNAEHcMAsKzgAAAM8AAAD8HQBB9DALAQIAQYQxCwj//////////wBByDELAQUAQdQxCwHQAEHsMQsOzgAAANEAAAAIHgAAAAQAQYQyCwEBAEGUMgsF/////woAQdgyCwHT",!T(it)){var L=it;it=e.locateFile?e.locateFile(L,n):n+L}function z(){var I=it;try{if(I==it&&l)return new Uint8Array(l);if(T(I))try{var E=DE(I.slice(37)),C=new Uint8Array(E.length);for(I=0;I<E.length;++I)C[I]=E.charCodeAt(I);var _=C}catch{throw Error("Converting base64 string to bytes failed.")}else _=void 0;var b=_;if(b)return b;throw"both async and sync fetching of the wasm failed"}catch(k){J(k)}}function tt(){return l||typeof fetch!="function"?Promise.resolve().then(function(){return z()}):fetch(it,{credentials:"same-origin"}).then(function(I){if(!I.ok)throw"failed to load wasm binary file at '"+it+"'";return I.arrayBuffer()}).catch(function(){return z()})}function K(I){for(;0<I.length;)I.shift()(e)}function At(I){if(I===void 0)return"_unknown";I=I.replace(/[^a-zA-Z0-9_]/g,"$");var E=I.charCodeAt(0);return 48<=E&&57>=E?"_"+I:I}function U(I,E){return I=At(I),function(){return E.apply(this,arguments)}}var P=[{},{value:void 0},{value:null},{value:!0},{value:!1}],q=[];function $(I){var E=Error,C=U(I,function(_){this.name=I,this.message=_,_=Error(_).stack,_!==void 0&&(this.stack=this.toString()+`
|
|
1003
|
-
`+_.replace(/^Error(:[^\n]*)?\n/,""))});return C.prototype=Object.create(E.prototype),C.prototype.constructor=C,C.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},C}var nt=void 0;function X(I){throw new nt(I)}var dt=I=>(I||X("Cannot use deleted val. handle = "+I),P[I].value),ie=I=>{switch(I){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var E=q.length?q.pop():P.length;return P[E]={ga:1,value:I},E}},re=void 0,Ft=void 0;function ht(I){for(var E="";B[I];)E+=Ft[B[I++]];return E}var Qt=[];function Tt(){for(;Qt.length;){var I=Qt.pop();I.M.$=!1,I.delete()}}var Jt=void 0,_t={};function Zt(I,E){for(E===void 0&&X("ptr should not be undefined");I.R;)E=I.ba(E),I=I.R;return E}var Oe={};function Xr(I){I=Dc(I);var E=ht(I);return iA(I),E}function jn(I,E){var C=Oe[I];return C===void 0&&X(E+" has unknown type "+Xr(I)),C}function jr(){}var Zn=!1;function Cc(I){--I.count.value,I.count.value===0&&(I.T?I.U.W(I.T):I.P.N.W(I.O))}function Qc(I,E,C){return E===C?I:C.R===void 0?null:(I=Qc(I,E,C.R),I===null?null:C.na(I))}var yc={};function aE(I,E){return E=Zt(I,E),_t[E]}var mc=void 0;function Zr(I){throw new mc(I)}function $r(I,E){return E.P&&E.O||Zr("makeClassHandle requires ptr and ptrType"),!!E.U!=!!E.T&&Zr("Both smartPtrType and smartPtr must be specified"),E.count={value:1},ii(Object.create(I,{M:{value:E}}))}function ii(I){return typeof FinalizationRegistry>"u"?(ii=E=>E,I):(Zn=new FinalizationRegistry(E=>{Cc(E.M)}),ii=E=>{var C=E.M;return C.T&&Zn.register(E,{M:C},E),E},jr=E=>{Zn.unregister(E)},ii(I))}var ts={};function $n(I){for(;I.length;){var E=I.pop();I.pop()(E)}}function qi(I){return this.fromWireType(R[I>>2])}var ri={},es={};function EA(I,E,C){function _(F){F=C(F),F.length!==I.length&&Zr("Mismatched type converter count");for(var Y=0;Y<I.length;++Y)eA(I[Y],F[Y])}I.forEach(function(F){es[F]=E});var b=Array(E.length),k=[],N=0;E.forEach((F,Y)=>{Oe.hasOwnProperty(F)?b[Y]=Oe[F]:(k.push(F),ri.hasOwnProperty(F)||(ri[F]=[]),ri[F].push(()=>{b[Y]=Oe[F],++N,N===k.length&&_(b)}))}),k.length===0&&_(b)}function to(I){switch(I){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+I)}}function eA(I,E,C={}){if(!("argPackAdvance"in E))throw new TypeError("registerType registeredInstance requires argPackAdvance");var _=E.name;if(I||X('type "'+_+'" must have a positive integer typeid pointer'),Oe.hasOwnProperty(I)){if(C.ua)return;X("Cannot register type '"+_+"' twice")}Oe[I]=E,delete es[I],ri.hasOwnProperty(I)&&(E=ri[I],delete ri[I],E.forEach(b=>b()))}function eo(I){X(I.M.P.N.name+" instance already deleted")}function BA(){}function Ao(I,E,C){if(I[E].S===void 0){var _=I[E];I[E]=function(){return I[E].S.hasOwnProperty(arguments.length)||X("Function '"+C+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+I[E].S+")!"),I[E].S[arguments.length].apply(this,arguments)},I[E].S=[],I[E].S[_.Z]=_}}function lE(I,E){e.hasOwnProperty(I)?(X("Cannot register public name '"+I+"' twice"),Ao(e,I,I),e.hasOwnProperty(void 0)&&X("Cannot register multiple overloads of a function with the same number of arguments (undefined)!"),e[I].S[void 0]=E):e[I]=E}function cE(I,E,C,_,b,k,N,F){this.name=I,this.constructor=E,this.X=C,this.W=_,this.R=b,this.pa=k,this.ba=N,this.na=F,this.ja=[]}function io(I,E,C){for(;E!==C;)E.ba||X("Expected null or instance of "+C.name+", got an instance of "+E.name),I=E.ba(I),E=E.R;return I}function hE(I,E){return E===null?(this.ea&&X("null is not a valid "+this.name),0):(E.M||X('Cannot pass "'+oo(E)+'" as a '+this.name),E.M.O||X("Cannot pass deleted object as a pointer of type "+this.name),io(E.M.O,E.M.P.N,this.N))}function gE(I,E){if(E===null){if(this.ea&&X("null is not a valid "+this.name),this.da){var C=this.fa();return I!==null&&I.push(this.W,C),C}return 0}if(E.M||X('Cannot pass "'+oo(E)+'" as a '+this.name),E.M.O||X("Cannot pass deleted object as a pointer of type "+this.name),!this.ca&&E.M.P.ca&&X("Cannot convert argument of type "+(E.M.U?E.M.U.name:E.M.P.name)+" to parameter type "+this.name),C=io(E.M.O,E.M.P.N,this.N),this.da)switch(E.M.T===void 0&&X("Passing raw pointer to smart pointer is illegal"),this.Ba){case 0:E.M.U===this?C=E.M.T:X("Cannot convert argument of type "+(E.M.U?E.M.U.name:E.M.P.name)+" to parameter type "+this.name);break;case 1:C=E.M.T;break;case 2:if(E.M.U===this)C=E.M.T;else{var _=E.clone();C=this.xa(C,ie(function(){_.delete()})),I!==null&&I.push(this.W,C)}break;default:X("Unsupporting sharing policy")}return C}function uE(I,E){return E===null?(this.ea&&X("null is not a valid "+this.name),0):(E.M||X('Cannot pass "'+oo(E)+'" as a '+this.name),E.M.O||X("Cannot pass deleted object as a pointer of type "+this.name),E.M.P.ca&&X("Cannot convert argument of type "+E.M.P.name+" to parameter type "+this.name),io(E.M.O,E.M.P.N,this.N))}function AA(I,E,C,_){this.name=I,this.N=E,this.ea=C,this.ca=_,this.da=!1,this.W=this.xa=this.fa=this.ka=this.Ba=this.wa=void 0,E.R!==void 0?this.toWireType=gE:(this.toWireType=_?hE:uE,this.V=null)}function fE(I,E){e.hasOwnProperty(I)||Zr("Replacing nonexistant public symbol"),e[I]=E,e[I].Z=void 0}function dE(I,E){var C=[];return function(){if(C.length=0,Object.assign(C,arguments),I.includes("j")){var _=e["dynCall_"+I];_=C&&C.length?_.apply(null,[E].concat(C)):_.call(null,E)}else _=x.get(E).apply(null,C);return _}}function we(I,E){I=ht(I);var C=I.includes("j")?dE(I,E):x.get(E);return typeof C!="function"&&X("unknown function pointer with signature "+I+": "+E),C}var wc=void 0;function As(I,E){function C(k){b[k]||Oe[k]||(es[k]?es[k].forEach(C):(_.push(k),b[k]=!0))}var _=[],b={};throw E.forEach(C),new wc(I+": "+_.map(Xr).join([", "]))}function ro(I,E,C,_,b){var k=E.length;2>k&&X("argTypes array size mismatch! Must at least get return value and 'this' types!");var N=E[1]!==null&&C!==null,F=!1;for(C=1;C<E.length;++C)if(E[C]!==null&&E[C].V===void 0){F=!0;break}var Y=E[0].name!=="void",O=k-2,j=Array(O),rt=[],gt=[];return function(){if(arguments.length!==O&&X("function "+I+" called with "+arguments.length+" arguments, expected "+O+" args!"),gt.length=0,rt.length=N?2:1,rt[0]=b,N){var St=E[1].toWireType(gt,this);rt[1]=St}for(var ft=0;ft<O;++ft)j[ft]=E[ft+2].toWireType(gt,arguments[ft]),rt.push(j[ft]);if(ft=_.apply(null,rt),F)$n(gt);else for(var fe=N?1:2;fe<E.length;fe++){var ve=fe===1?St:j[fe-2];E[fe].V!==null&&E[fe].V(ve)}return St=Y?E[0].fromWireType(ft):void 0,St}}function so(I,E){for(var C=[],_=0;_<I;_++)C.push(w[E+4*_>>2]);return C}function no(I){4<I&&--P[I].ga===0&&(P[I]=void 0,q.push(I))}function oo(I){if(I===null)return"null";var E=typeof I;return E==="object"||E==="array"||E==="function"?I.toString():""+I}function IE(I,E){switch(E){case 2:return function(C){return this.fromWireType(S[C>>2])};case 3:return function(C){return this.fromWireType(Q[C>>3])};default:throw new TypeError("Unknown float type: "+I)}}function pE(I,E,C){switch(E){case 0:return C?function(_){return f[_]}:function(_){return B[_]};case 1:return C?function(_){return p[_>>1]}:function(_){return D[_>>1]};case 2:return C?function(_){return R[_>>2]}:function(_){return w[_>>2]};default:throw new TypeError("Unknown integer type: "+I)}}function EE(I,E){for(var C="",_=0;!(_>=E/2);++_){var b=p[I+2*_>>1];if(b==0)break;C+=String.fromCharCode(b)}return C}function BE(I,E,C){if(C===void 0&&(C=2147483647),2>C)return 0;C-=2;var _=E;C=C<2*I.length?C/2:I.length;for(var b=0;b<C;++b)p[E>>1]=I.charCodeAt(b),E+=2;return p[E>>1]=0,E-_}function CE(I){return 2*I.length}function QE(I,E){for(var C=0,_="";!(C>=E/4);){var b=R[I+4*C>>2];if(b==0)break;++C,65536<=b?(b-=65536,_+=String.fromCharCode(55296|b>>10,56320|b&1023)):_+=String.fromCharCode(b)}return _}function yE(I,E,C){if(C===void 0&&(C=2147483647),4>C)return 0;var _=E;C=_+C-4;for(var b=0;b<I.length;++b){var k=I.charCodeAt(b);if(55296<=k&&57343>=k){var N=I.charCodeAt(++b);k=65536+((k&1023)<<10)|N&1023}if(R[E>>2]=k,E+=4,E+4>C)break}return R[E>>2]=0,E-_}function mE(I){for(var E=0,C=0;C<I.length;++C){var _=I.charCodeAt(C);55296<=_&&57343>=_&&++C,E+=4}return E}var wE={};function vc(I){var E=wE[I];return E===void 0?ht(I):E}var is=[];function vE(I){var E=is.length;return is.push(I),E}function _E(I,E){for(var C=Array(I),_=0;_<I;++_)C[_]=jn(w[E+4*_>>2],"parameter "+_);return C}var _c=[],bE=[null,[],[]];nt=e.BindingError=$("BindingError"),e.count_emval_handles=function(){for(var I=0,E=5;E<P.length;++E)P[E]!==void 0&&++I;return I},e.get_first_emval=function(){for(var I=5;I<P.length;++I)if(P[I]!==void 0)return P[I];return null},re=e.PureVirtualError=$("PureVirtualError");for(var bc=Array(256),rs=0;256>rs;++rs)bc[rs]=String.fromCharCode(rs);Ft=bc,e.getInheritedInstanceCount=function(){return Object.keys(_t).length},e.getLiveInheritedInstances=function(){var I=[],E;for(E in _t)_t.hasOwnProperty(E)&&I.push(_t[E]);return I},e.flushPendingDeletes=Tt,e.setDelayFunction=function(I){Jt=I,Qt.length&&Jt&&Jt(Tt)},mc=e.InternalError=$("InternalError"),BA.prototype.isAliasOf=function(I){if(!(this instanceof BA&&I instanceof BA))return!1;var E=this.M.P.N,C=this.M.O,_=I.M.P.N;for(I=I.M.O;E.R;)C=E.ba(C),E=E.R;for(;_.R;)I=_.ba(I),_=_.R;return E===_&&C===I},BA.prototype.clone=function(){if(this.M.O||eo(this),this.M.aa)return this.M.count.value+=1,this;var I=ii,E=Object,C=E.create,_=Object.getPrototypeOf(this),b=this.M;return I=I(C.call(E,_,{M:{value:{count:b.count,$:b.$,aa:b.aa,O:b.O,P:b.P,T:b.T,U:b.U}}})),I.M.count.value+=1,I.M.$=!1,I},BA.prototype.delete=function(){this.M.O||eo(this),this.M.$&&!this.M.aa&&X("Object already scheduled for deletion"),jr(this),Cc(this.M),this.M.aa||(this.M.T=void 0,this.M.O=void 0)},BA.prototype.isDeleted=function(){return!this.M.O},BA.prototype.deleteLater=function(){return this.M.O||eo(this),this.M.$&&!this.M.aa&&X("Object already scheduled for deletion"),Qt.push(this),Qt.length===1&&Jt&&Jt(Tt),this.M.$=!0,this},AA.prototype.qa=function(I){return this.ka&&(I=this.ka(I)),I},AA.prototype.ha=function(I){this.W&&this.W(I)},AA.prototype.argPackAdvance=8,AA.prototype.readValueFromPointer=qi,AA.prototype.deleteObject=function(I){I!==null&&I.delete()},AA.prototype.fromWireType=function(I){function E(){return this.da?$r(this.N.X,{P:this.wa,O:C,U:this,T:I}):$r(this.N.X,{P:this,O:I})}var C=this.qa(I);if(!C)return this.ha(I),null;var _=aE(this.N,C);if(_!==void 0)return _.M.count.value===0?(_.M.O=C,_.M.T=I,_.clone()):(_=_.clone(),this.ha(I),_);if(_=this.N.pa(C),_=yc[_],!_)return E.call(this);_=this.ca?_.la:_.pointerType;var b=Qc(C,this.N,_.N);return b===null?E.call(this):this.da?$r(_.N.X,{P:_,O:b,U:this,T:I}):$r(_.N.X,{P:_,O:b})},wc=e.UnboundTypeError=$("UnboundTypeError");var DE=typeof atob=="function"?atob:function(I){var E="",C=0;I=I.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var _="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(I.charAt(C++)),b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(I.charAt(C++)),k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(I.charAt(C++)),N="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(I.charAt(C++));_=_<<2|b>>4,b=(b&15)<<4|k>>2;var F=(k&3)<<6|N;E+=String.fromCharCode(_),k!==64&&(E+=String.fromCharCode(b)),N!==64&&(E+=String.fromCharCode(F))}while(C<I.length);return E},xE={l:function(I,E,C,_){J("Assertion failed: "+(I?u(B,I):"")+", at: "+[E?E?u(B,E):"":"unknown filename",C,_?_?u(B,_):"":"unknown function"])},q:function(I,E,C){I=ht(I),E=jn(E,"wrapper"),C=dt(C);var _=[].slice,b=E.N,k=b.X,N=b.R.X,F=b.R.constructor;I=U(I,function(){b.R.ja.forEach((function(O){if(this[O]===N[O])throw new re("Pure virtual function "+O+" must be implemented in JavaScript")}).bind(this)),Object.defineProperty(this,"__parent",{value:k}),this.__construct.apply(this,_.call(arguments))}),k.__construct=function(){this===k&&X("Pass correct 'this' to __construct");var O=F.implement.apply(void 0,[this].concat(_.call(arguments)));jr(O);var j=O.M;O.notifyOnDestruction(),j.aa=!0,Object.defineProperties(this,{M:{value:j}}),ii(this),O=j.O,O=Zt(b,O),_t.hasOwnProperty(O)?X("Tried to register registered instance: "+O):_t[O]=this},k.__destruct=function(){this===k&&X("Pass correct 'this' to __destruct"),jr(this);var O=this.M.O;O=Zt(b,O),_t.hasOwnProperty(O)?delete _t[O]:X("Tried to unregister unregistered instance: "+O)},I.prototype=Object.create(k);for(var Y in C)I.prototype[Y]=C[Y];return ie(I)},j:function(I){var E=ts[I];delete ts[I];var C=E.fa,_=E.W,b=E.ia,k=b.map(N=>N.ta).concat(b.map(N=>N.za));EA([I],k,N=>{var F={};return b.forEach((Y,O)=>{var j=N[O],rt=Y.ra,gt=Y.sa,St=N[O+b.length],ft=Y.ya,fe=Y.Aa;F[Y.oa]={read:ve=>j.fromWireType(rt(gt,ve)),write:(ve,Xi)=>{var rA=[];ft(fe,ve,St.toWireType(rA,Xi)),$n(rA)}}}),[{name:E.name,fromWireType:function(Y){var O={},j;for(j in F)O[j]=F[j].read(Y);return _(Y),O},toWireType:function(Y,O){for(var j in F)if(!(j in O))throw new TypeError('Missing field: "'+j+'"');var rt=C();for(j in F)F[j].write(rt,O[j]);return Y!==null&&Y.push(_,rt),rt},argPackAdvance:8,readValueFromPointer:qi,V:_}]})},v:function(){},B:function(I,E,C,_,b){var k=to(C);E=ht(E),eA(I,{name:E,fromWireType:function(N){return!!N},toWireType:function(N,F){return F?_:b},argPackAdvance:8,readValueFromPointer:function(N){if(C===1)var F=f;else if(C===2)F=p;else if(C===4)F=R;else throw new TypeError("Unknown boolean type size: "+E);return this.fromWireType(F[N>>k])},V:null})},f:function(I,E,C,_,b,k,N,F,Y,O,j,rt,gt){j=ht(j),k=we(b,k),F&&(F=we(N,F)),O&&(O=we(Y,O)),gt=we(rt,gt);var St=At(j);lE(St,function(){As("Cannot construct "+j+" due to unbound types",[_])}),EA([I,E,C],_?[_]:[],function(ft){if(ft=ft[0],_)var fe=ft.N,ve=fe.X;else ve=BA.prototype;ft=U(St,function(){if(Object.getPrototypeOf(this)!==Xi)throw new nt("Use 'new' to construct "+j);if(rA.Y===void 0)throw new nt(j+" has no accessible constructor");var Mc=rA.Y[arguments.length];if(Mc===void 0)throw new nt("Tried to invoke ctor of "+j+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(rA.Y).toString()+") parameters instead!");return Mc.apply(this,arguments)});var Xi=Object.create(ve,{constructor:{value:ft}});ft.prototype=Xi;var rA=new cE(j,ft,Xi,gt,fe,k,F,O);fe=new AA(j,rA,!0,!1),ve=new AA(j+"*",rA,!1,!1);var Sc=new AA(j+" const*",rA,!1,!0);return yc[I]={pointerType:ve,la:Sc},fE(St,ft),[fe,ve,Sc]})},d:function(I,E,C,_,b,k,N){var F=so(C,_);E=ht(E),k=we(b,k),EA([],[I],function(Y){function O(){As("Cannot call "+j+" due to unbound types",F)}Y=Y[0];var j=Y.name+"."+E;E.startsWith("@@")&&(E=Symbol[E.substring(2)]);var rt=Y.N.constructor;return rt[E]===void 0?(O.Z=C-1,rt[E]=O):(Ao(rt,E,j),rt[E].S[C-1]=O),EA([],F,function(gt){return gt=ro(j,[gt[0],null].concat(gt.slice(1)),null,k,N),rt[E].S===void 0?(gt.Z=C-1,rt[E]=gt):rt[E].S[C-1]=gt,[]}),[]})},p:function(I,E,C,_,b,k){0<E||J();var N=so(E,C);b=we(_,b),EA([],[I],function(F){F=F[0];var Y="constructor "+F.name;if(F.N.Y===void 0&&(F.N.Y=[]),F.N.Y[E-1]!==void 0)throw new nt("Cannot register multiple constructors with identical number of parameters ("+(E-1)+") for class '"+F.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return F.N.Y[E-1]=()=>{As("Cannot construct "+F.name+" due to unbound types",N)},EA([],N,function(O){return O.splice(1,0,null),F.N.Y[E-1]=ro(Y,O,null,b,k),[]}),[]})},a:function(I,E,C,_,b,k,N,F){var Y=so(C,_);E=ht(E),k=we(b,k),EA([],[I],function(O){function j(){As("Cannot call "+rt+" due to unbound types",Y)}O=O[0];var rt=O.name+"."+E;E.startsWith("@@")&&(E=Symbol[E.substring(2)]),F&&O.N.ja.push(E);var gt=O.N.X,St=gt[E];return St===void 0||St.S===void 0&&St.className!==O.name&&St.Z===C-2?(j.Z=C-2,j.className=O.name,gt[E]=j):(Ao(gt,E,rt),gt[E].S[C-2]=j),EA([],Y,function(ft){return ft=ro(rt,ft,O,k,N),gt[E].S===void 0?(ft.Z=C-2,gt[E]=ft):gt[E].S[C-2]=ft,[]}),[]})},A:function(I,E){E=ht(E),eA(I,{name:E,fromWireType:function(C){var _=dt(C);return no(C),_},toWireType:function(C,_){return ie(_)},argPackAdvance:8,readValueFromPointer:qi,V:null})},n:function(I,E,C){C=to(C),E=ht(E),eA(I,{name:E,fromWireType:function(_){return _},toWireType:function(_,b){return b},argPackAdvance:8,readValueFromPointer:IE(E,C),V:null})},e:function(I,E,C,_,b){E=ht(E),b===-1&&(b=4294967295),b=to(C);var k=F=>F;if(_===0){var N=32-8*C;k=F=>F<<N>>>N}C=E.includes("unsigned")?function(F,Y){return Y>>>0}:function(F,Y){return Y},eA(I,{name:E,fromWireType:k,toWireType:C,argPackAdvance:8,readValueFromPointer:pE(E,b,_!==0),V:null})},b:function(I,E,C){function _(k){k>>=2;var N=w;return new b(d,N[k+1],N[k])}var b=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][E];C=ht(C),eA(I,{name:C,fromWireType:_,argPackAdvance:8,readValueFromPointer:_},{ua:!0})},o:function(I,E){E=ht(E);var C=E==="std::string";eA(I,{name:E,fromWireType:function(_){var b=w[_>>2],k=_+4;if(C)for(var N=k,F=0;F<=b;++F){var Y=k+F;if(F==b||B[Y]==0){if(N=N?u(B,N,Y-N):"",O===void 0)var O=N;else O+="\0",O+=N;N=Y+1}}else{for(O=Array(b),F=0;F<b;++F)O[F]=String.fromCharCode(B[k+F]);O=O.join("")}return iA(_),O},toWireType:function(_,b){b instanceof ArrayBuffer&&(b=new Uint8Array(b));var k,N=typeof b=="string";if(N||b instanceof Uint8Array||b instanceof Uint8ClampedArray||b instanceof Int8Array||X("Cannot pass non-string to std::string"),C&&N){var F=0;for(k=0;k<b.length;++k){var Y=b.charCodeAt(k);127>=Y?F++:2047>=Y?F+=2:55296<=Y&&57343>=Y?(F+=4,++k):F+=3}k=F}else k=b.length;if(F=ao(4+k+1),Y=F+4,w[F>>2]=k,C&&N){if(N=Y,Y=k+1,k=B,0<Y){Y=N+Y-1;for(var O=0;O<b.length;++O){var j=b.charCodeAt(O);if(55296<=j&&57343>=j){var rt=b.charCodeAt(++O);j=65536+((j&1023)<<10)|rt&1023}if(127>=j){if(N>=Y)break;k[N++]=j}else{if(2047>=j){if(N+1>=Y)break;k[N++]=192|j>>6}else{if(65535>=j){if(N+2>=Y)break;k[N++]=224|j>>12}else{if(N+3>=Y)break;k[N++]=240|j>>18,k[N++]=128|j>>12&63}k[N++]=128|j>>6&63}k[N++]=128|j&63}}k[N]=0}}else if(N)for(N=0;N<k;++N)O=b.charCodeAt(N),255<O&&(iA(Y),X("String has UTF-16 code units that do not fit in 8 bits")),B[Y+N]=O;else for(N=0;N<k;++N)B[Y+N]=b[N];return _!==null&&_.push(iA,F),F},argPackAdvance:8,readValueFromPointer:qi,V:function(_){iA(_)}})},i:function(I,E,C){if(C=ht(C),E===2)var _=EE,b=BE,k=CE,N=()=>D,F=1;else E===4&&(_=QE,b=yE,k=mE,N=()=>w,F=2);eA(I,{name:C,fromWireType:function(Y){for(var O=w[Y>>2],j=N(),rt,gt=Y+4,St=0;St<=O;++St){var ft=Y+4+St*E;(St==O||j[ft>>F]==0)&&(gt=_(gt,ft-gt),rt===void 0?rt=gt:(rt+="\0",rt+=gt),gt=ft+E)}return iA(Y),rt},toWireType:function(Y,O){typeof O!="string"&&X("Cannot pass non-string to C++ string type "+C);var j=k(O),rt=ao(4+j+E);return w[rt>>2]=j>>F,b(O,rt+4,j+E),Y!==null&&Y.push(iA,rt),rt},argPackAdvance:8,readValueFromPointer:qi,V:function(Y){iA(Y)}})},k:function(I,E,C,_,b,k){ts[I]={name:ht(E),fa:we(C,_),W:we(b,k),ia:[]}},h:function(I,E,C,_,b,k,N,F,Y,O){ts[I].ia.push({oa:ht(E),ta:C,ra:we(_,b),sa:k,za:N,ya:we(F,Y),Aa:O})},C:function(I,E){E=ht(E),eA(I,{va:!0,name:E,argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},s:function(I,E,C,_,b){I=is[I],E=dt(E),C=vc(C);var k=[];return w[_>>2]=ie(k),I(E,C,k,b)},t:function(I,E,C,_){I=is[I],E=dt(E),C=vc(C),I(E,C,null,_)},g:no,m:function(I,E){var C=_E(I,E),_=C[0];E=_.name+"_$"+C.slice(1).map(function(N){return N.name}).join("_")+"$";var b=_c[E];if(b!==void 0)return b;var k=Array(I-1);return b=vE((N,F,Y,O)=>{for(var j=0,rt=0;rt<I-1;++rt)k[rt]=C[rt+1].readValueFromPointer(O+j),j+=C[rt+1].argPackAdvance;for(N=N[F].apply(N,k),rt=0;rt<I-1;++rt)C[rt+1].ma&&C[rt+1].ma(k[rt]);if(!_.va)return _.toWireType(Y,N)}),_c[E]=b},D:function(I){4<I&&(P[I].ga+=1)},r:function(I){var E=dt(I);$n(E),no(I)},c:function(){J("")},x:function(I,E,C){B.copyWithin(I,E,E+C)},w:function(I){var E=B.length;if(I>>>=0,2147483648<I)return!1;for(var C=1;4>=C;C*=2){var _=E*(1+.2/C);_=Math.min(_,I+100663296);var b=Math;_=Math.max(I,_),b=b.min.call(b,2147483648,_+(65536-_%65536)%65536);t:{try{c.grow(b-d.byteLength+65535>>>16),m();var k=1;break t}catch{}k=void 0}if(k)return!0}return!1},z:function(){return 52},u:function(){return 70},y:function(I,E,C,_){for(var b=0,k=0;k<C;k++){var N=w[E>>2],F=w[E+4>>2];E+=8;for(var Y=0;Y<F;Y++){var O=B[N+Y],j=bE[I];O===0||O===10?((I===1?o:a)(u(j,0)),j.length=0):j.push(O)}b+=F}return w[_>>2]=b,0}};(function(){function I(b){e.asm=b.exports,c=e.asm.E,m(),x=e.asm.J,V.unshift(e.asm.F),H--,e.monitorRunDependencies&&e.monitorRunDependencies(H),H==0&&Z&&(b=Z,Z=null,b())}function E(b){I(b.instance)}function C(b){return tt().then(function(k){return WebAssembly.instantiate(k,_)}).then(function(k){return k}).then(b,function(k){a("failed to asynchronously prepare wasm: "+k),J(k)})}var _={a:xE};if(H++,e.monitorRunDependencies&&e.monitorRunDependencies(H),e.instantiateWasm)try{return e.instantiateWasm(_,I)}catch(b){a("Module.instantiateWasm callback failed with error: "+b),i(b)}return(function(){return l||typeof WebAssembly.instantiateStreaming!="function"||T(it)||typeof fetch!="function"?C(E):fetch(it,{credentials:"same-origin"}).then(function(b){return WebAssembly.instantiateStreaming(b,_).then(E,function(k){return a("wasm streaming compile failed: "+k),a("falling back to ArrayBuffer instantiation"),C(E)})})})().catch(i),{}})(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.F).apply(null,arguments)};var Dc=e.___getTypeName=function(){return(Dc=e.___getTypeName=e.asm.G).apply(null,arguments)};e.__embind_initialize_bindings=function(){return(e.__embind_initialize_bindings=e.asm.H).apply(null,arguments)};var ao=e._malloc=function(){return(ao=e._malloc=e.asm.I).apply(null,arguments)},iA=e._free=function(){return(iA=e._free=e.asm.K).apply(null,arguments)};e.dynCall_jiji=function(){return(e.dynCall_jiji=e.asm.L).apply(null,arguments)};var ss;Z=function I(){ss||xc(),ss||(Z=I)};function xc(){function I(){if(!ss&&(ss=!0,e.calledRun=!0,!h)){if(K(V),A(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for(typeof e.postRun=="function"&&(e.postRun=[e.postRun]);e.postRun.length;){var E=e.postRun.shift();et.unshift(E)}K(et)}}if(!(0<H)){if(e.preRun)for(typeof e.preRun=="function"&&(e.preRun=[e.preRun]);e.preRun.length;)W();K(M),0<H||(e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),I()},1)):I())}}if(e.preInit)for(typeof e.preInit=="function"&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();return xc(),t.ready})})();let Le=(function(r){return r[r.Auto=0]="Auto",r[r.FlexStart=1]="FlexStart",r[r.Center=2]="Center",r[r.FlexEnd=3]="FlexEnd",r[r.Stretch=4]="Stretch",r[r.Baseline=5]="Baseline",r[r.SpaceBetween=6]="SpaceBetween",r[r.SpaceAround=7]="SpaceAround",r[r.SpaceEvenly=8]="SpaceEvenly",r})({}),zn=(function(r){return r[r.BorderBox=0]="BorderBox",r[r.ContentBox=1]="ContentBox",r})({}),qn=(function(r){return r[r.Width=0]="Width",r[r.Height=1]="Height",r})({}),Wi=(function(r){return r[r.Inherit=0]="Inherit",r[r.LTR=1]="LTR",r[r.RTL=2]="RTL",r})({}),Kr=(function(r){return r[r.Flex=0]="Flex",r[r.None=1]="None",r[r.Contents=2]="Contents",r})({}),Ge=(function(r){return r[r.Left=0]="Left",r[r.Top=1]="Top",r[r.Right=2]="Right",r[r.Bottom=3]="Bottom",r[r.Start=4]="Start",r[r.End=5]="End",r[r.Horizontal=6]="Horizontal",r[r.Vertical=7]="Vertical",r[r.All=8]="All",r})({}),UA=(function(r){return r[r.None=0]="None",r[r.StretchFlexBasis=1]="StretchFlexBasis",r[r.AbsolutePositionWithoutInsetsExcludesPadding=2]="AbsolutePositionWithoutInsetsExcludesPadding",r[r.AbsolutePercentAgainstInnerSize=4]="AbsolutePercentAgainstInnerSize",r[r.All=2147483647]="All",r[r.Classic=2147483646]="Classic",r})({}),Bc=(function(r){return r[r.WebFlexBasis=0]="WebFlexBasis",r})({}),zi=(function(r){return r[r.Column=0]="Column",r[r.ColumnReverse=1]="ColumnReverse",r[r.Row=2]="Row",r[r.RowReverse=3]="RowReverse",r})({}),Yr=(function(r){return r[r.Column=0]="Column",r[r.Row=1]="Row",r[r.All=2]="All",r})({}),NA=(function(r){return r[r.FlexStart=0]="FlexStart",r[r.Center=1]="Center",r[r.FlexEnd=2]="FlexEnd",r[r.SpaceBetween=3]="SpaceBetween",r[r.SpaceAround=4]="SpaceAround",r[r.SpaceEvenly=5]="SpaceEvenly",r})({}),FA=(function(r){return r[r.Error=0]="Error",r[r.Warn=1]="Warn",r[r.Info=2]="Info",r[r.Debug=3]="Debug",r[r.Verbose=4]="Verbose",r[r.Fatal=5]="Fatal",r})({}),Vr=(function(r){return r[r.Undefined=0]="Undefined",r[r.Exactly=1]="Exactly",r[r.AtMost=2]="AtMost",r})({}),Xn=(function(r){return r[r.Default=0]="Default",r[r.Text=1]="Text",r})({}),Wr=(function(r){return r[r.Visible=0]="Visible",r[r.Hidden=1]="Hidden",r[r.Scroll=2]="Scroll",r})({}),zr=(function(r){return r[r.Static=0]="Static",r[r.Relative=1]="Relative",r[r.Absolute=2]="Absolute",r})({}),me=(function(r){return r[r.Undefined=0]="Undefined",r[r.Point=1]="Point",r[r.Percent=2]="Percent",r[r.Auto=3]="Auto",r})({}),qr=(function(r){return r[r.NoWrap=0]="NoWrap",r[r.Wrap=1]="Wrap",r[r.WrapReverse=2]="WrapReverse",r})({});const rE={ALIGN_AUTO:Le.Auto,ALIGN_FLEX_START:Le.FlexStart,ALIGN_CENTER:Le.Center,ALIGN_FLEX_END:Le.FlexEnd,ALIGN_STRETCH:Le.Stretch,ALIGN_BASELINE:Le.Baseline,ALIGN_SPACE_BETWEEN:Le.SpaceBetween,ALIGN_SPACE_AROUND:Le.SpaceAround,ALIGN_SPACE_EVENLY:Le.SpaceEvenly,BOX_SIZING_BORDER_BOX:zn.BorderBox,BOX_SIZING_CONTENT_BOX:zn.ContentBox,DIMENSION_WIDTH:qn.Width,DIMENSION_HEIGHT:qn.Height,DIRECTION_INHERIT:Wi.Inherit,DIRECTION_LTR:Wi.LTR,DIRECTION_RTL:Wi.RTL,DISPLAY_FLEX:Kr.Flex,DISPLAY_NONE:Kr.None,DISPLAY_CONTENTS:Kr.Contents,EDGE_LEFT:Ge.Left,EDGE_TOP:Ge.Top,EDGE_RIGHT:Ge.Right,EDGE_BOTTOM:Ge.Bottom,EDGE_START:Ge.Start,EDGE_END:Ge.End,EDGE_HORIZONTAL:Ge.Horizontal,EDGE_VERTICAL:Ge.Vertical,EDGE_ALL:Ge.All,ERRATA_NONE:UA.None,ERRATA_STRETCH_FLEX_BASIS:UA.StretchFlexBasis,ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING:UA.AbsolutePositionWithoutInsetsExcludesPadding,ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE:UA.AbsolutePercentAgainstInnerSize,ERRATA_ALL:UA.All,ERRATA_CLASSIC:UA.Classic,EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS:Bc.WebFlexBasis,FLEX_DIRECTION_COLUMN:zi.Column,FLEX_DIRECTION_COLUMN_REVERSE:zi.ColumnReverse,FLEX_DIRECTION_ROW:zi.Row,FLEX_DIRECTION_ROW_REVERSE:zi.RowReverse,GUTTER_COLUMN:Yr.Column,GUTTER_ROW:Yr.Row,GUTTER_ALL:Yr.All,JUSTIFY_FLEX_START:NA.FlexStart,JUSTIFY_CENTER:NA.Center,JUSTIFY_FLEX_END:NA.FlexEnd,JUSTIFY_SPACE_BETWEEN:NA.SpaceBetween,JUSTIFY_SPACE_AROUND:NA.SpaceAround,JUSTIFY_SPACE_EVENLY:NA.SpaceEvenly,LOG_LEVEL_ERROR:FA.Error,LOG_LEVEL_WARN:FA.Warn,LOG_LEVEL_INFO:FA.Info,LOG_LEVEL_DEBUG:FA.Debug,LOG_LEVEL_VERBOSE:FA.Verbose,LOG_LEVEL_FATAL:FA.Fatal,MEASURE_MODE_UNDEFINED:Vr.Undefined,MEASURE_MODE_EXACTLY:Vr.Exactly,MEASURE_MODE_AT_MOST:Vr.AtMost,NODE_TYPE_DEFAULT:Xn.Default,NODE_TYPE_TEXT:Xn.Text,OVERFLOW_VISIBLE:Wr.Visible,OVERFLOW_HIDDEN:Wr.Hidden,OVERFLOW_SCROLL:Wr.Scroll,POSITION_TYPE_STATIC:zr.Static,POSITION_TYPE_RELATIVE:zr.Relative,POSITION_TYPE_ABSOLUTE:zr.Absolute,UNIT_UNDEFINED:me.Undefined,UNIT_POINT:me.Point,UNIT_PERCENT:me.Percent,UNIT_AUTO:me.Auto,WRAP_NO_WRAP:qr.NoWrap,WRAP_WRAP:qr.Wrap,WRAP_WRAP_REVERSE:qr.WrapReverse};function sE(r){function t(i,s,n){const o=i[s];i[s]=function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return n.call(this,o,...l)}}for(const i of["setPosition","setMargin","setFlexBasis","setWidth","setHeight","setMinWidth","setMinHeight","setMaxWidth","setMaxHeight","setPadding","setGap"]){const s={[me.Point]:r.Node.prototype[i],[me.Percent]:r.Node.prototype[`${i}Percent`],[me.Auto]:r.Node.prototype[`${i}Auto`]};t(r.Node.prototype,i,function(n){for(var o=arguments.length,a=new Array(o>1?o-1:0),l=1;l<o;l++)a[l-1]=arguments[l];const c=a.pop();let h,u;if(c==="auto")h=me.Auto,u=void 0;else if(typeof c=="object")h=c.unit,u=c.valueOf();else if(h=typeof c=="string"&&c.endsWith("%")?me.Percent:me.Point,u=parseFloat(c),c!==void 0&&!Number.isNaN(c)&&Number.isNaN(u))throw new Error(`Invalid value ${c} for ${i}`);if(!s[h])throw new Error(`Failed to execute "${i}": Unsupported unit '${c}'`);return u!==void 0?s[h].call(this,...a,u):s[h].call(this,...a)})}function e(i){return r.MeasureCallback.implement({measure:function(){const{width:s,height:n}=i(...arguments);return{width:s??NaN,height:n??NaN}}})}t(r.Node.prototype,"setMeasureFunc",function(i,s){return s?i.call(this,e(s)):this.unsetMeasureFunc()});function A(i){return r.DirtiedCallback.implement({dirtied:i})}return t(r.Node.prototype,"setDirtiedFunc",function(i,s){i.call(this,A(s))}),t(r.Config.prototype,"free",function(){r.Config.destroy(this)}),t(r.Node,"create",(i,s)=>s?r.Node.createWithConfig(s):r.Node.createDefault()),t(r.Node.prototype,"free",function(){r.Node.destroy(this)}),t(r.Node.prototype,"freeRecursive",function(){for(let i=0,s=this.getChildCount();i<s;++i)this.getChild(0).freeRecursive();this.free()}),t(r.Node.prototype,"calculateLayout",function(i){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:NaN,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Wi.LTR;return i.call(this,s,n,o)}),{Config:r.Config,Node:r.Node,...rE}}async function nE(){return sE(await iE())}const oE=Object.freeze(Object.defineProperty({__proto__:null,Align:Le,BoxSizing:zn,Dimension:qn,Direction:Wi,Display:Kr,Edge:Ge,Errata:UA,ExperimentalFeature:Bc,FlexDirection:zi,Gutter:Yr,Justify:NA,LogLevel:FA,MeasureMode:Vr,NodeType:Xn,Overflow:Wr,PositionType:zr,Unit:me,Wrap:qr,loadYoga:nE},Symbol.toStringTag,{value:"Module"}));g.AnimatedTexture=dr,g.Assets=Ic,g.AudioPipeline=Yn,g.AudioProcessor=rp,g.AudioSpectrum=gp,g.BaseElement2DBackground=An,g.BaseElement2DFill=Vt,g.BaseElement2DForeground=rn,g.BaseElement2DOutline=vA,g.BaseElement2DShadow=_A,g.BaseElement2DShape=bA,g.BaseElement2DStyle=Si,g.BaseElement2DText=tA,g.CanvasContext=qa,g.CanvasTexture=Ir,g.Color=De,g.ColorMatrix=xs,g.ColorTexture=Va,g.CoreObject=sA,g.DEG_TO_RAD=Zo,g.DEVICE_PIXEL_RATIO=vs,g.EffectMaterial=Ii,g.Element2DStyle=Un,g.Engine=Ec,g.FlexElement2DStyle=jl,g.FlexLayout=Lr,g.FontLoader=Ia,g.Geometry=fr,g.GifLoader=cc,g.GradientTexture=pr,g.HTMLAudio=nc,g.HTMLAudioContext=Or,g.HTMLSound=Vi,g.IN_BROWSER=li,g.ImageTexture=vu,g.IndexBuffer=KA,g.Input=qo,g.InputEvent=ci,g.JsonLoader=hc,g.KeyboardInputEvent=Vo,g.Loader=oA,g.LottieLoader=gc,g.MainLoop=nr,g.Material=Ct,g.Matrix=xe,g.Matrix2=Yh,g.Matrix3=Ss,g.Matrix4=jo,g.MouseInputEvent=Ds,g.PI=sr,g.PI_2=ne,g.PixelsTexture=Ys,g.PointerInputEvent=Wo,g.Projection2D=ta,g.QuadGeometry=Iu,g.QuadUvGeometry=ut,g.RAD_TO_DEG=Jh,g.RawWeakMap=bs,g.Rect2=nA,g.RefCounted=Xo,g.Renderer=Aa,g.Resource=Ye,g.SUPPORTS_AUDIO_CONTEXT=ys,g.SUPPORTS_CLICK_EVENTS=Fo,g.SUPPORTS_CREATE_IMAGE_BITMAP=Qs,g.SUPPORTS_IMAGE_BITMAP=Po,g.SUPPORTS_MOUSE_EVENTS=Th,g.SUPPORTS_OFFLINE_AUDIO_CONTEXT=ws,g.SUPPORTS_POINTER_EVENTS=LA,g.SUPPORTS_RESIZE_OBSERVER=Uo,g.SUPPORTS_TOUCH_EVENTS=Ke,g.SUPPORTS_WEBGL2=ko,g.SUPPORTS_WEBKIT_AUDIO_CONTEXT=ms,g.SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT=To,g.SUPPORTS_WEB_AUDIO=Lo,g.SUPPORTS_WHEEL_EVENTS=No,g.SceneTree=mi,g.TextLoader=uc,g.Texture2D=yt,g.TextureLoader=fc,g.TextureRect2D=Jn,g.Ticker=Kt,g.Transform2D=Yt,g.TransformRect2D=Kn,g.UvGeometry=Cu,g.UvMaterial=pi,g.Vector=Ee,g.Vector2=Mt,g.Vector3=Vh,g.Vector4=$o,g.VertexAttribute=ce,g.VertexBuffer=ze,g.VideoLoader=dc,g.VideoTexture=za,g.ViewportTexture=Ws,g.WebAudio=ac,g.WebAudioContext=IA,g.WebGLBatch2DModule=sa,g.WebGLBlendMode=GA,g.WebGLBufferModule=na,g.WebGLFramebufferModule=oa,g.WebGLMaskModule=aa,g.WebGLModule=Ie,g.WebGLProgramModule=la,g.WebGLRenderer=da,g.WebGLScissorModule=ca,g.WebGLState=QA,g.WebGLStateModule=ra,g.WebGLStencilModule=ha,g.WebGLTextureModule=ga,g.WebGLVertexArrayModule=ua,g.WebGLViewportModule=fa,g.WebSound=oc,g.WheelInputEvent=zo,g.alignMap=PA,g.assets=Fe,g.boxSizingMap=Hn,g.clamp=le,g.clampFrag=Il,g.createHTMLCanvas=Jo,g.createNode=Rh,g.crossOrigin=Yo,g.cubicBezier=ei,g.curves=Kh,g.customNode=st,g.customNodes=rr,g.defaultOptions=pc,g.determineCrossOrigin=Ko,g.directionMap=Tr,g.displayMap=Nn,g.ease=Ac,g.easeIn=ic,g.easeInOut=sc,g.easeOut=rc,g.edgeMap=xt,g.flexDirectionMap=Fn,g.flexWrapMap=Tn,g.frag=dl,g.getDefaultCssPropertyValue=Cs,g.gutterMap=Zl,g.isCanvasElement=Oo,g.isElementNode=_s,g.isImageElement=Lh,g.isPow2=Bs,g.isVideoElement=Go,g.isWebgl2=Ho,g.justifyMap=Ln,g.lerp=bt,g.linear=ec,g.log2=Rs,g.mapWebGLBlendModes=ia,g.nextPow2=Ms,g.nextTick=Es,g.overflowMap=Gn,g.parseCSSFilter=ju,g.parseCSSTransform=$a,g.parseCSSTransformOrigin=tl,g.parseCssFunctions=ai,g.parseCssProperty=oi,g.positionTypeMap=On,g.render=AE,g.timingFunctions=Gr,g.uid=Mo,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})}));
|
|
1002
|
+
}`})),u.TwistTransition=bm([W("TwistTransition")],u.TwistTransition);class Kl extends Ut{install(e){const t=async r=>{const{decodeFrames:i}=await import("modern-gif");return await e.fetch(r).then(n=>n.arrayBuffer()).then(n=>i(n)).then(n=>new Di(n.map(o=>({duration:o.delay,texture:new qs(o.data,o.width,o.height)}))))};return this.load=r=>e.loadBy(r,()=>t(r)),["image/gif"].forEach(r=>{e.register(r,t)}),e.gif=this,this}}class Zl extends Ut{install(e){const t=r=>e.fetch(r).then(i=>i.json());return this.load=r=>e.loadBy(r,()=>t(r)),["json"].forEach(r=>{e.register(r,t)}),e.json=this,this}}class Jl extends Ut{install(e){const t=async(r,i)=>(await import("lottie-web").then(o=>o.default)).loadAnimation({container:null,renderer:"canvas",rendererSettings:{context:i.getContext("2d")},loop:!1,autoplay:!1,animationData:await e.fetch(r).then(o=>o.json())});return this.load=(r,i)=>e.loadBy(r,()=>t(r,i)),["lottie"].forEach(r=>{e.register(r,t)}),e.lottie=this,this}}class Ql extends Ut{install(e){const t=async r=>await e.fetch(r).then(i=>i.text());return this.load=r=>e.loadBy(r,()=>t(r)),e.text=this,this}}class ec extends Ut{install(e){const t=r=>e.fetchImageBitmap(r,{premultiplyAlpha:"premultiply"}).then(i=>new ne(i));return this.load=r=>e.loadBy(r,()=>t(r)),["image/gif","image/jpeg","image/png","image/tiff","image/vnd.wap.wbmp","image/x-icon","image/x-jng","image/x-ms-bmp","image/svg+xml","image/webp"].forEach(r=>{e.register(r,t)}),e.texture=this,this}}class tc extends Ut{install(e){const t=r=>new Ra(r).load();return this.load=r=>e.loadBy(r,()=>t(r)),["video/3gpp","video/mpeg","video/quicktime","video/x-flv","video/x-mng","video/x-ms-asf","video/x-ms-wmv","video/x-msvideo","video/mp4"].forEach(r=>{e.register(r,t)}),e.video=this,this}}const xm=Object.entries({"text/html":["html","htm","shtml"],"text/css":["css"],"text/xml":["xml"],"image/gif":["gif"],"image/jpeg":["jpeg","jpg"],"application/x-javascript":["js"],"application/atom+xml":["atom"],"application/rss+xml":["rss"],"text/mathml":["mml"],"text/plain":["txt"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/x-component":["htc"],"image/png":["png"],"image/tiff":["tif","tiff"],"image/vnd.wap.wbmp":["wbmp"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-ms-bmp":["bmp"],"image/svg+xml":["svg"],"image/webp":["webp"],"application/java-archive":["jar","war","ear"],"application/mac-binhex40":["hqx"],"application/msword":["doc"],"application/pdf":["pdf"],"application/postscript":["ps","eps","ai"],"application/rtf":["rtf"],"application/vnd.ms-excel":["xls"],"application/vnd.ms-powerpoint":["ppt"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/x-7z-compressed":["7z"],"application/x-cocoa":["cco"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-makeself":["run"],"application/x-perl":["pl","pm"],"application/x-pilot":["prc","pdb"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-sea":["sea"],"application/x-shockwave-flash":["swf"],"application/x-stuffit":["sit"],"application/x-tcl":["tcl","tk"],"application/x-x509-ca-cert":["der","pem","crt"],"application/x-xpinstall":["xpi"],"application/xhtml+xml":["xhtml"],"application/zip":["zip"],"application/octet-stream":["bin","exe","dll","deb","dmg","eot","iso","img","msi","msp","msm"],"audio/midi":["mid","midi","kar"],"audio/mpeg":["mp3"],"audio/ogg":["ogg"],"audio/x-realaudio":["ra"],"video/3gpp":["3gpp","3gp"],"video/mpeg":["mpeg","mpg"],"video/quicktime":["mov"],"video/x-flv":["flv"],"video/x-mng":["mng"],"video/x-ms-asf":["asx","asf"],"video/x-ms-wmv":["wmv"],"video/x-msvideo":["avi"],"video/mp4":["m4v","mp4"]});function Pm(s){for(const[e,t]of xm)if(t.includes(s))return e}async function Sm(s){let e;if(s.startsWith("data:"))e=s.match(/^data:(.+?);/)?.[1];else if(s.startsWith("http")){const t=s.split(/[#?]/)[0].split(".").pop()?.trim();t&&(e=Pm(t))}return e??await fetch(s).then(t=>t.headers.get("Content-Type"))??""}const os="WeakRef"in globalThis;class rc{defaultHandler=e=>this.fetch(e);_handlers=new Map;_handleing=new Map;_handled=new Map;_gc=os?new FinalizationRegistry(e=>{const t=this.get(e);t&&"free"in t&&t.free(),this._handled.delete(e)}):void 0;constructor(){os||Se.on(this.gc.bind(this),{sort:2})}use(e){return e.install(this),this}register(e,t){return this._handlers.set(e,t),this}fetch(e){return fetch(e)}_fixSVG(e){let t;e.includes(";base64,")?t=atob(e.split(",")[1]):t=decodeURIComponent(e.split(",")[1]);const r=new DOMParser().parseFromString(t,"image/svg+xml").documentElement,i=r.getAttribute("width"),n=r.getAttribute("height"),o=i&&/^[\d.]+$/.test(i),a=n&&/^[\d.]+$/.test(n);if(!o||!a){const l=r.getAttribute("viewBox")?.split(" ").map(c=>Number(c));o||r.setAttribute("width",String(l?l[2]-l[0]:512)),a||r.setAttribute("height",String(l?l[3]-l[1]:512))}return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(r.outerHTML)}`}async fetchImageBitmap(e,t){return e.startsWith("http")?await this.fetch(e).then(r=>r.blob()).then(r=>r.type==="image/svg+xml"?r.text().then(i=>this.fetchImageBitmap(this._fixSVG(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(i)}`),t)):createImageBitmap(r,t)):(e.startsWith("data:image/svg+xml;")&&(e=this._fixSVG(e)),new Promise(r=>{const i=new Image;i.src=e,i.onload=()=>{i.decode().finally(()=>{r(i)})}}).then(r=>createImageBitmap(r,t)))}get(e){let t=this._handled.get(e);return os&&t instanceof WeakRef&&(t=t.deref(),t||this._handleing.delete(e)),t}set(e,t){let r=t;os&&typeof t=="object"&&(this._gc.register(t,e),r=new WeakRef(t)),this._handled.set(e,r)}async loadBy(e,t){const r=this.get(e)??this._handleing.get(e);if(r)return r;const i=t().then(n=>(this.set(e,n),n)).finally(()=>{this._handleing.delete(e)});return this._handleing.set(e,i),i}async load(e,t){return this.loadBy(e,async()=>{const r=await Sm(e);return(this._handlers.get(r)??this.defaultHandler)(e,t)})}async waitUntilLoad(){await Promise.all(Array.from(this._handleing.values()).map(e=>e.catch(t=>{console.error(t)})))}gc(){this._handled.forEach((e,t)=>{const r=this.get(t);r&&"free"in r&&r.free()}),this._handled.clear()}}const yt=new rc().use(new ra).use(new Kl).use(new Zl).use(new Jl).use(new Ql).use(new ec).use(new tc);var Cm=Object.getOwnPropertyDescriptor,Tm=(s,e,t,r)=>{for(var i=r>1?void 0:r?Cm(e,t):e,n=s.length-1,o;n>=0;n--)(o=s[n])&&(i=o(i)||i);return i};u.CanvasItemEditor=class extends u.Control{_pointerStart;_pointerOffset;selected;dragging;hovered;hover=new u.Element2D({name:"hover",internalMode:"back",style:{visibility:"hidden",outlineStyle:"solid",outlineColor:"#00FF00FF",outlineWidth:2,pointerEvents:"none"}});transformRect=new Wn({name:"transformRect",internalMode:"back",style:{visibility:"hidden",pointerEvents:"none"}});scaler=new u.Scaler({name:"Scaler",internalMode:"back"}).on("updateScale",e=>{this.ruler.gapScale=e,this._updateScrollbars(),this._updateSelectionRect()});xScrollBar=new u.XScrollBar({name:"XScrollBar",internalMode:"back",style:{visibility:"hidden"}});yScrollBar=new u.YScrollBar({name:"yScrollBar",internalMode:"back",style:{visibility:"hidden"}});drawboard=new u.Element2D({name:"drawboard",style:{width:500,height:500,backgroundColor:"#00FFFFFF",pointerEvents:"none"}},[this.scaler]);ruler=new u.Ruler({name:"ruler",offsetX:100,offsetY:100,style:{pointerEvents:"none"}},[this.drawboard,this.hover,this.transformRect,this.xScrollBar,this.yScrollBar]);constructor(){super(),this._onPointerdown=this._onPointerdown.bind(this),this._onPointermove=this._onPointermove.bind(this),this._onPointerup=this._onPointerup.bind(this),this.append(this.ruler)}_updateStyleProperty(e,t,r,i){switch(super._updateStyleProperty(e,t,r,i),e){case"width":this.drawboard.style.left=(this.size.width-this.drawboard.size.width)/2,this.ruler.offsetX=this.drawboard.style.left;break;case"height":this.drawboard.style.top=(this.size.height-this.drawboard.size.height)/2,this.ruler.offsetY=this.drawboard.style.top;break}}_guiInput(e,t){switch(super._guiInput(e,t),t){case"pointerdown":this._onPointerdown(e);break;case"pointermove":this._onPointermove(e);break;case"pointerup":this._onPointerup();break}}_onPointerdown(e){let t=e.target;t?.equal(this)&&(t=void 0),t?.equal(this.transformRect)&&(t=this.selected),this._pointerOffset={x:e.offsetX,y:e.offsetY},this.selected=t,this.dragging=t,t instanceof u.Element2D?this._pointerStart=t.style.clone():this._pointerStart=void 0,this._updateHover(),this._updateSelectionRect()}_onPointermove(e){let t=e.target;t?.equal(this)&&(t=void 0),t?.equal(this.transformRect)&&(t=this.selected);const{selected:r,dragging:i,_pointerStart:n,_pointerOffset:o}=this;r&&t?.equal(r)?this.hovered=void 0:this.hovered=t;const a=o?{x:e.offsetX-o.x,y:e.offsetY-o.y}:{x:0,y:0};i&&n&&(i.style.left=n.left+a.x/this.scaler.scale,i.style.top=n.top+a.y/this.scaler.scale,i.update()),this._updateHover(),this._updateSelectionRect()}_onPointerup(){this.dragging=void 0,this._updateHover(),this._updateSelectionRect()}_copyGlobalTransform(e,t){e.style.visibility="visible",e.style.width=t.globalScale.x*t.size.x,e.style.height=t.globalScale.y*t.size.y,e.style.left=t.globalPosition.x,e.style.top=t.globalPosition.y,e.style.rotate=t.globalRotation,e.update()}_updateHover(){const e=this.hovered;e instanceof u.Element2D?(this.hover.style.visibility="visible",this._copyGlobalTransform(this.hover,e),this.hover.requestRedraw()):this.hover.style.visibility="hidden"}_updateSelectionRect(){this.selected?(this.transformRect.style.visibility="visible",this._copyGlobalTransform(this.transformRect,this.selected)):this.transformRect.style.visibility="hidden"}_updateScrollbars(){const e=this.ruler.gapScale,t=this.drawboard.size.height*e,r=this.drawboard.size.width*e;t>this.size.height?(this.yScrollBar.style.visibility="visible",this.yScrollBar.maxValue=t,this.yScrollBar.page=this.size.height):this.yScrollBar.style.visibility="hidden",r>this.size.width?(this.xScrollBar.style.visibility="visible",this.xScrollBar.maxValue=r,this.xScrollBar.page=this.size.width):this.xScrollBar.style.visibility="hidden"}},u.CanvasItemEditor=Tm([W("CanvasItemEditor")],u.CanvasItemEditor);const ic={alpha:!0,stencil:!0,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"};class sc extends jr{renderer;get view(){return this.renderer.view}get gl(){return this.renderer.gl}get screen(){return this.renderer.screen}get width(){return this.screen.width}get height(){return this.screen.height}get pixelRatio(){return this.renderer.pixelRatio}set pixelRatio(e){this.renderer.pixelRatio=e,this.resize(this.width,this.height),this.view&&(this.view.dataset.pixelRatio=String(e))}_resizeObserver=wo?new ResizeObserver(e=>{const t=e[0];if(t.target===this.view){const{inlineSize:r,blockSize:i}=Array.isArray(t.contentBoxSize)?t.contentBoxSize[0]:t.contentBoxSize;this.resize(r,i)}}):void 0;constructor(e={}){const{debug:t=!1,view:r,width:i,height:n,pixelRatio:o=Ts,backgroundColor:a=0,autoResize:l,autoStart:c,timeline:h,...f}=e;super(h),this.debug=t,this.renderer=new ta(r,{...ic,...f}),this._setupInput(),this.pixelRatio=o,this.backgroundColor=a,l?(!r&&this.renderer.view&&(this.renderer.view.style.width="100%",this.renderer.view.style.height="100%"),this.enableAutoResize(l)):this.resize(i||this.gl.drawingBufferWidth||this.view?.clientWidth||200,n||this.gl.drawingBufferHeight||this.view?.clientHeight||200,!r),c&&this.start()}_setupInput(){return this.view&&(this.input.setTarget(this.view),["pointerdown","pointerover","pointermove","pointerup","wheel","keydown","keypress","keyup"].forEach(e=>{this.input.on(e,t=>{this.root.input(t,e),this.emit(e,t)})})),this}enableAutoResize(e=!0){return this.view&&(e?this._resizeObserver?.observe(this.view):this._resizeObserver?.unobserve(this.view)),this}resize(e,t,r=!1){return this.renderer.resize(e,t,r),this.root.width=e,this.root.height=t,this.root.requestUpload(),this.render(),this}nextTick(){return _s()}async waitUntilLoad(){await yt.waitUntilLoad(),await this.nextTick()}async waitAndRender(e=0){await yt.waitUntilLoad(),this._process(e),await this.nextTick(),this._render(this.renderer)}render(e=0){this._process(e),this._render(this.renderer)}async start(){await this.waitAndRender(),super.start(e=>{this._process(e),this._render(this.renderer)})}free(){super.free(),this.enableAutoResize(!1),this.renderer.free()}toPixels(){return this.renderer.toPixels()}toImageData(){return new ImageData(this.toPixels(),this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}toCanvas2D(){const e=this.toImageData(),t=document.createElement("canvas");t.width=e.width,t.height=e.height,t.getContext("2d")?.putImageData(e,0,0);const r=document.createElement("canvas");return r.width=this.width,r.height=this.height,r.getContext("2d")?.drawImage(t,0,0,t.width,t.height,0,0,r.width,r.height),r}}let vt;const Xn=[];let Hn=!1;async function Em(s=100){if(!Hn){for(Hn=!0;Xn.length;){const e=Xn.shift();if(e)try{await e()}catch(t){console.error(t)}else await new Promise(t=>setTimeout(t,s))}Hn=!1}}async function Mm(s){const{data:e,width:t,height:r,debug:i=!1,time:n=0}=s;return vt??=new sc({width:1,height:1,preserveDrawingBuffer:!0}),vt.debug=i,vt.root.removeChildren(),vt.timeline.currentTime=n,vt.resize(t,r,!0),(Array.isArray(e)?e:[e]).forEach(o=>{o instanceof u.Node?(o.parent=void 0,vt.root.appendChild(o)):vt.root.appendChild(u.Node.parse(o))}),await s.onBeforeRender?.(vt),await vt.waitAndRender(),vt.toCanvas2D()}async function Am(s){return new Promise(e=>{Xn.push(async()=>e(await Mm(s))),Em()})}u.AnimatedTexture=Di,u.Assets=rc,u.AudioPipeline=qn,u.AudioProcessor=kg,u.AudioSpectrum=Fg,u.BaseElement2DBackground=sn,u.BaseElement2DFill=Te,u.BaseElement2DForeground=nn,u.BaseElement2DOutline=Kt,u.BaseElement2DShadow=Zt,u.BaseElement2DShape=Jt,u.BaseElement2DStyle=Zr,u.BaseElement2DText=Dt,u.CanvasContext=Ua,u.CanvasTexture=Ii,u.Color=lt,u.ColorMatrix=Os,u.ColorTexture=Da,u.CoreObject=It,u.DEG_TO_RAD=No,u.DEVICE_PIXEL_RATIO=Ts,u.EffectMaterial=Lr,u.Element2DStyle=Bn,u.Engine=sc,u.FlexElement2DStyle=Ll,u.FlexLayout=rs,u.FontLoader=ra,u.Geometry=ki,u.GifLoader=Kl,u.GradientTexture=Ri,u.HTMLAudio=ql,u.HTMLAudioContext=ss,u.HTMLSound=di,u.IN_BROWSER=Or,u.ImageTexture=Ju,u.IndexBuffer=fr,u.Input=Uo,u.InputEvent=kr,u.JsonLoader=Zl,u.KeyboardInputEvent=Do,u.Loader=Ut,u.LottieLoader=Jl,u.MainLoop=Pi,u.Material=se,u.Matrix=ct,u.Matrix2=vh,u.Matrix3=ks,u.Matrix4=Lo,u.MouseInputEvent=As,u.PI=xi,u.PI_2=Ne,u.PixelsTexture=qs,u.PointerInputEvent=Io,u.Projection2D=$o,u.QuadGeometry=Gu,u.QuadUvGeometry=Q,u.RAD_TO_DEG=mh,u.RawWeakMap=Ms,u.Rect2=Rt,u.RefCounted=Bo,u.Renderer=Vo,u.Resource=Pt,u.SUPPORTS_AUDIO_CONTEXT=Ps,u.SUPPORTS_CLICK_EVENTS=Po,u.SUPPORTS_CREATE_IMAGE_BITMAP=xs,u.SUPPORTS_IMAGE_BITMAP=bo,u.SUPPORTS_MOUSE_EVENTS=uh,u.SUPPORTS_OFFLINE_AUDIO_CONTEXT=Cs,u.SUPPORTS_POINTER_EVENTS=ar,u.SUPPORTS_RESIZE_OBSERVER=wo,u.SUPPORTS_TOUCH_EVENTS=xt,u.SUPPORTS_WEBGL2=_o,u.SUPPORTS_WEBKIT_AUDIO_CONTEXT=Ss,u.SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT=So,u.SUPPORTS_WEB_AUDIO=Co,u.SUPPORTS_WHEEL_EVENTS=xo,u.SceneTree=jr,u.TextLoader=Ql,u.Texture2D=ne,u.TextureLoader=ec,u.TextureRect2D=jn,u.Ticker=Se,u.Transform2D=Ce,u.TransformRect2D=Wn,u.UvGeometry=Xu,u.UvMaterial=Nr,u.Vector=Qe,u.Vector2=de,u.Vector3=_h,u.Vector4=Fo,u.VertexAttribute=je,u.VertexBuffer=Tt,u.VideoLoader=tc,u.VideoTexture=Ra,u.ViewportTexture=Hs,u.WebAudio=Hl,u.WebAudioContext=jt,u.WebGLBatch2DModule=Wo,u.WebGLBlendMode=lr,u.WebGLBufferModule=qo,u.WebGLFramebufferModule=Xo,u.WebGLMaskModule=Ho,u.WebGLModule=Ye,u.WebGLProgramModule=Yo,u.WebGLRenderer=ta,u.WebGLScissorModule=Ko,u.WebGLState=qt,u.WebGLStateModule=jo,u.WebGLStencilModule=Zo,u.WebGLTextureModule=Jo,u.WebGLVertexArrayModule=Qo,u.WebGLViewportModule=ea,u.WebSound=Xl,u.WheelInputEvent=Ro,u.alignMap=nr,u.assets=yt,u.boxSizingMap=Gn,u.clamp=Ge,u.clampFrag=rl,u.createHTMLCanvas=Ao,u.createNode=nh,u.crossOrigin=ko,u.cubicBezier=Pr,u.curves=yh,u.customNode=W,u.customNodes=wi,u.defaultOptions=ic,u.determineCrossOrigin=Oo,u.directionMap=ts,u.displayMap=Ln,u.ease=Vl,u.easeIn=Gl,u.easeInOut=Wl,u.easeOut=jl,u.edgeMap=fe,u.flexDirectionMap=Nn,u.flexWrapMap=Fn,u.frag=tl,u.getDefaultCssPropertyValue=ws,u.gutterMap=Nl,u.isCanvasElement=Eo,u.isElementNode=Es,u.isImageElement=fh,u.isPow2=bs,u.isVideoElement=To,u.isWebgl2=Mo,u.justifyMap=$n,u.lerp=he,u.linear=zl,u.log2=Is,u.mapWebGLBlendModes=Go,u.nextPow2=Ds,u.nextTick=_s,u.overflowMap=zn,u.parseCSSFilter=Cf,u.parseCSSTransform=Fa,u.parseCSSTransformOrigin=$a,u.parseCssFunctions=Ar,u.parseCssProperty=Mr,u.positionTypeMap=Vn,u.render=Am,u.timingFunctions=is,u.uid=yo,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}));
|