@rel-packages/osu-beatmap-preview 0.11.4 → 0.11.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/assets/default_skin_archive.d.ts +2 -0
  2. package/dist/assets/default_skin_archive.d.ts.map +1 -0
  3. package/dist/assets/default_skin_embedded.d.ts.map +1 -1
  4. package/dist/chunk-0e4ebmdy.js +2 -0
  5. package/dist/chunk-1sw3e1ar.js +23 -0
  6. package/dist/chunk-21p7cseg.js +1 -0
  7. package/dist/chunk-525kvqgh.js +1 -0
  8. package/dist/chunk-5evxnj3k.js +9 -0
  9. package/dist/chunk-5v6x1wpn.js +84 -0
  10. package/dist/chunk-7qazncxz.js +15 -0
  11. package/dist/chunk-a7wf9wxx.js +173 -0
  12. package/dist/chunk-ay0z741j.js +1 -0
  13. package/dist/chunk-dvctxyxp.js +2 -0
  14. package/dist/chunk-eb5gmq04.js +186 -0
  15. package/dist/chunk-edbhr7zr.js +156 -0
  16. package/dist/chunk-ef1ghrsq.js +1 -0
  17. package/dist/chunk-f3y92gm3.js +1 -0
  18. package/dist/chunk-fsbv6vcn.js +2 -0
  19. package/dist/chunk-kkmq6cvb.js +2 -0
  20. package/dist/chunk-kmf5rpya.js +1 -0
  21. package/dist/chunk-kt3t4zv0.js +2 -0
  22. package/dist/chunk-pn7re3na.js +2 -0
  23. package/dist/chunk-rp8z1jh7.js +2 -0
  24. package/dist/chunk-shb5s568.js +1 -0
  25. package/dist/chunk-sngkm5ds.js +218 -0
  26. package/dist/chunk-tb8nqrjk.js +1 -0
  27. package/dist/chunk-vzfdvw38.js +1 -0
  28. package/dist/chunk-zc79wdxj.js +41 -0
  29. package/dist/config/standard.d.ts +2 -2
  30. package/dist/index.js +1 -1146
  31. package/dist/player/audio_controller.d.ts +9 -0
  32. package/dist/player/audio_controller.d.ts.map +1 -1
  33. package/dist/player/player.d.ts +2 -0
  34. package/dist/player/player.d.ts.map +1 -1
  35. package/dist/renderer/backend/pixi_backend.d.ts +10 -1
  36. package/dist/renderer/backend/pixi_backend.d.ts.map +1 -1
  37. package/dist/renderer/backend/render_backend.d.ts +1 -1
  38. package/dist/renderer/backend/render_backend.d.ts.map +1 -1
  39. package/dist/renderer/drawable/drawable_slider.d.ts +2 -0
  40. package/dist/renderer/drawable/drawable_slider.d.ts.map +1 -1
  41. package/dist/renderer/mania/mania_renderer.d.ts +11 -0
  42. package/dist/renderer/mania/mania_renderer.d.ts.map +1 -1
  43. package/dist/renderer/standard/standard_renderer.d.ts +3 -1
  44. package/dist/renderer/standard/standard_renderer.d.ts.map +1 -1
  45. package/dist/renderer/standard/timing_state.d.ts +1 -0
  46. package/dist/renderer/standard/timing_state.d.ts.map +1 -1
  47. package/dist/utils/lru.d.ts +32 -0
  48. package/dist/utils/lru.d.ts.map +1 -0
  49. package/package.json +2 -2
  50. package/dist/index.js.map +0 -357
@@ -0,0 +1,2 @@
1
+ import{sa as XJ}from"./chunk-pn7re3na.js";import{ta as WK}from"./chunk-0e4ebmdy.js";import{Ha as OK,Ia as YK,ua as MK}from"./chunk-sngkm5ds.js";import{$a as kK,Ja as h,Ka as mJ,La as eK,Ma as g,Pa as x,Qa as f,Ra as l,Sa as tK,Ta as AK,Ua as c,Va as o,Xa as e,Ya as v,Za as WJ,_a as VK,bb as QK,hb as y,ib as NK}from"./chunk-1sw3e1ar.js";import{vb as IZ,wb as EZ}from"./chunk-dvctxyxp.js";var TK=EZ((c0,wK)=>{wK.exports=LZ;var fJ={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},zZ=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function LZ(K){var J=[];return K.replace(zZ,function(Z,$,Q){var N=$.toLowerCase();if(Q=DZ(Q),N=="m"&&Q.length>2)J.push([$].concat(Q.splice(0,2))),N="l",$=$=="m"?"l":"L";while(!0){if(Q.length==fJ[N])return Q.unshift($),J.push(Q);if(Q.length<fJ[N])throw Error("malformed path data");J.push([$].concat(Q.splice(0,fJ[N])))}}),J}var MZ=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function DZ(K){var J=K.match(MZ);return J?J.map(Number):[]}});var DJ=0.0001,YJ=0.0001;function eJ(K){let J=K.length;if(J<6)return 1;let Z=0;for(let $=0,Q=K[J-2],N=K[J-1];$<J;$+=2){let H=K[$],q=K[$+1];Z+=(H-Q)*(q+N),Q=H,N=q}if(Z<0)return-1;return 1}function tJ(K,J,Z,$,Q,N,H,q){let _=K-Z*Q,V=J-$*Q,U=K+Z*N,z=J+$*N,L,E;if(H)L=$,E=-Z;else L=-$,E=Z;let I=_+L,D=V+E,B=U+L,M=z+E;return q.push(I,D),q.push(B,M),2}function s(K,J,Z,$,Q,N,H,q){let _=Z-K,V=$-J,U=Math.atan2(_,V),z=Math.atan2(Q-K,N-J);if(q&&U<z)U+=Math.PI*2;else if(!q&&U>z)z+=Math.PI*2;let L=U,E=z-U,I=Math.abs(E),D=Math.sqrt(_*_+V*V),B=(15*I*Math.sqrt(D)/Math.PI>>0)+1,M=E/B;if(L+=M,q){H.push(K,J),H.push(Z,$);for(let C=1,A=L;C<B;C++,A+=M)H.push(K,J),H.push(K+Math.sin(A)*D,J+Math.cos(A)*D);H.push(K,J),H.push(Q,N)}else{H.push(Z,$),H.push(K,J);for(let C=1,A=L;C<B;C++,A+=M)H.push(K+Math.sin(A)*D,J+Math.cos(A)*D),H.push(K,J);H.push(Q,N),H.push(K,J)}return B*2}function JK(K,J,Z,$,Q,N){let H=DJ;if(K.length===0)return;let q=J,_=q.alignment;if(J.alignment!==0.5){let P=eJ(K);if(Z)P*=-1;_=(_-0.5)*P+0.5}let V=new x(K[0],K[1]),U=new x(K[K.length-2],K[K.length-1]),z=$,L=Math.abs(V.x-U.x)<H&&Math.abs(V.y-U.y)<H;if(z){if(K=K.slice(),L)K.pop(),K.pop(),U.set(K[K.length-2],K[K.length-1]);let P=(V.x+U.x)*0.5,d=(U.y+V.y)*0.5;K.unshift(P,d),K.push(P,d)}let E=Q,I=K.length/2,D=K.length,B=E.length/2,M=q.width/2,C=M*M,A=q.miterLimit*q.miterLimit,w=K[0],O=K[1],F=K[2],R=K[3],X=0,Y=0,G=-(O-R),T=w-F,W=0,b=0,S=Math.sqrt(G*G+T*T);G/=S,T/=S,G*=M,T*=M;let JJ=_,j=(1-JJ)*2,k=JJ*2;if(!z){if(q.cap==="round")D+=s(w-G*(j-k)*0.5,O-T*(j-k)*0.5,w-G*j,O-T*j,w+G*k,O+T*k,E,!0)+2;else if(q.cap==="square")D+=tJ(w,O,G,T,j,k,!0,E)}E.push(w-G*j,O-T*j),E.push(w+G*k,O+T*k);for(let P=1;P<I-1;++P){w=K[(P-1)*2],O=K[(P-1)*2+1],F=K[P*2],R=K[P*2+1],X=K[(P+1)*2],Y=K[(P+1)*2+1],G=-(O-R),T=w-F,S=Math.sqrt(G*G+T*T),G/=S,T/=S,G*=M,T*=M,W=-(R-Y),b=F-X,S=Math.sqrt(W*W+b*b),W/=S,b/=S,W*=M,b*=M;let d=F-w,HJ=O-R,qJ=F-X,_J=Y-R,aJ=d*qJ+HJ*_J,zJ=HJ*qJ-_J*d,UJ=zJ<0;if(Math.abs(zJ)<0.001*Math.abs(aJ)){if(E.push(F-G*j,R-T*j),E.push(F+G*k,R+T*k),aJ>=0){if(q.join==="round")D+=s(F,R,F-G*j,R-T*j,F-W*j,R-b*j,E,!1)+4;else D+=2;E.push(F-W*k,R-b*k),E.push(F+W*j,R+b*j)}continue}let rJ=(-G+w)*(-T+R)-(-G+F)*(-T+O),iJ=(-W+X)*(-b+R)-(-W+F)*(-b+Y),LJ=(d*iJ-qJ*rJ)/zJ,MJ=(_J*rJ-HJ*iJ)/zJ,OJ=(LJ-F)*(LJ-F)+(MJ-R)*(MJ-R),n=F+(LJ-F)*j,a=R+(MJ-R)*j,r=F-(LJ-F)*k,i=R-(MJ-R)*k,JZ=Math.min(d*d+HJ*HJ,qJ*qJ+_J*_J),sJ=UJ?j:k,KZ=JZ+sJ*sJ*C;if(OJ<=KZ)if(q.join==="bevel"||OJ/C>A){if(UJ)E.push(n,a),E.push(F+G*k,R+T*k),E.push(n,a),E.push(F+W*k,R+b*k);else E.push(F-G*j,R-T*j),E.push(r,i),E.push(F-W*j,R-b*j),E.push(r,i);D+=2}else if(q.join==="round")if(UJ)E.push(n,a),E.push(F+G*k,R+T*k),D+=s(F,R,F+G*k,R+T*k,F+W*k,R+b*k,E,!0)+4,E.push(n,a),E.push(F+W*k,R+b*k);else E.push(F-G*j,R-T*j),E.push(r,i),D+=s(F,R,F-G*j,R-T*j,F-W*j,R-b*j,E,!1)+4,E.push(F-W*j,R-b*j),E.push(r,i);else E.push(n,a),E.push(r,i);else{if(E.push(F-G*j,R-T*j),E.push(F+G*k,R+T*k),q.join==="round")if(UJ)D+=s(F,R,F+G*k,R+T*k,F+W*k,R+b*k,E,!0)+2;else D+=s(F,R,F-G*j,R-T*j,F-W*j,R-b*j,E,!1)+2;else if(q.join==="miter"&&OJ/C<=A){if(UJ)E.push(r,i),E.push(r,i);else E.push(n,a),E.push(n,a);D+=2}E.push(F-W*j,R-b*j),E.push(F+W*k,R+b*k),D+=2}}if(w=K[(I-2)*2],O=K[(I-2)*2+1],F=K[(I-1)*2],R=K[(I-1)*2+1],G=-(O-R),T=w-F,S=Math.sqrt(G*G+T*T),G/=S,T/=S,G*=M,T*=M,E.push(F-G*j,R-T*j),E.push(F+G*k,R+T*k),!z){if(q.cap==="round")D+=s(F-G*(j-k)*0.5,R-T*(j-k)*0.5,F-G*j,R-T*j,F+G*k,R+T*k,E,!1)+2;else if(q.cap==="square")D+=tJ(F,R,G,T,j,k,!1,E)}let NJ=YJ*YJ;for(let P=B;P<D+B-2;++P){if(w=E[P*2],O=E[P*2+1],F=E[(P+1)*2],R=E[(P+1)*2+1],X=E[(P+2)*2],Y=E[(P+2)*2+1],Math.abs(w*(R-Y)+F*(Y-O)+X*(O-R))<NJ)continue;N.push(P,P+1,P+2)}}var KK=[{offset:0,color:"white"},{offset:1,color:"black"}],PJ=class K{constructor(...J){this.uid=l("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let Z=ZZ(J);if(Z={...Z.type==="radial"?K.defaultRadialOptions:K.defaultLinearOptions,...QK(Z)},this._textureSize=Z.textureSize,this._wrapMode=Z.wrapMode,Z.type==="radial")this.center=Z.center,this.outerCenter=Z.outerCenter??this.center,this.innerRadius=Z.innerRadius,this.outerRadius=Z.outerRadius,this.scale=Z.scale,this.rotation=Z.rotation;else this.start=Z.start,this.end=Z.end;this.textureSpace=Z.textureSpace,this.type=Z.type,Z.colorStops.forEach((Q)=>{this.addColorStop(Q.offset,Q.color)})}addColorStop(J,Z){return this.colorStops.push({offset:J,color:g.shared.setValue(Z).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:J,y:Z}=this.start,{x:$,y:Q}=this.end,N=$-J,H=Q-Z,q=N<0||H<0;if(this._wrapMode==="clamp-to-edge"){if(N<0){let B=J;J=$,$=B,N*=-1}if(H<0){let B=Z;Z=Q,Q=B,H*=-1}}let _=this.colorStops.length?this.colorStops:KK,V=this._textureSize,{canvas:U,context:z}=$K(V,1),L=!q?z.createLinearGradient(0,0,this._textureSize,0):z.createLinearGradient(this._textureSize,0,0,0);ZK(L,_),z.fillStyle=L,z.fillRect(0,0,V,1),this.texture=new y({source:new XJ({resource:U,addressMode:this._wrapMode})});let E=Math.sqrt(N*N+H*H),I=Math.atan2(H,N),D=new f;if(D.scale(E/V,1),D.rotate(I),D.translate(J,Z),this.textureSpace==="local")D.scale(V,V);this.transform=D}buildGradient(){if(!this.texture)this._tick++;if(this.type==="linear")this.buildLinearGradient();else this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;let J=this.colorStops.length?this.colorStops:KK,Z=this._textureSize,{canvas:$,context:Q}=$K(Z,Z),{x:N,y:H}=this.center,{x:q,y:_}=this.outerCenter,V=this.innerRadius,U=this.outerRadius,z=q-U,L=_-U,E=Z/(U*2),I=(N-z)*E,D=(H-L)*E,B=Q.createRadialGradient(I,D,V*E,(q-z)*E,(_-L)*E,U*E);ZK(B,J),Q.fillStyle=J[J.length-1].color,Q.fillRect(0,0,Z,Z),Q.fillStyle=B,Q.translate(I,D),Q.rotate(this.rotation),Q.scale(1,this.scale),Q.translate(-I,-D),Q.fillRect(0,0,Z,Z),this.texture=new y({source:new XJ({resource:$,addressMode:this._wrapMode})});let M=new f;if(M.scale(1/E,1/E),M.translate(z,L),this.textureSpace==="local")M.scale(Z,Z);this.transform=M}destroy(){this.texture?.destroy(!0),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null}get styleKey(){return`fill-gradient-${this.uid}-${this._tick}`}};PJ.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};PJ.defaultRadialOptions={center:{x:0.5,y:0.5},innerRadius:0,outerRadius:0.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};var p=PJ;function ZK(K,J){for(let Z=0;Z<J.length;Z++){let $=J[Z];K.addColorStop($.offset,$.color)}}function $K(K,J){let Z=NK.get().createCanvas(K,J),$=Z.getContext("2d");return{canvas:Z,context:$}}function ZZ(K){let J=K[0]??{};if(typeof J==="number"||K[1])c("8.5.2","use options object instead"),J={type:"linear",start:{x:K[0],y:K[1]},end:{x:K[2],y:K[3]},textureSpace:K[4],textureSize:K[5]??p.defaultLinearOptions.textureSize};return J}var HK={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}};class bJ{constructor(K,J){if(this.uid=l("fillPattern"),this._tick=0,this.transform=new f,this.texture=K,this.transform.scale(1/K.frame.width,1/K.frame.height),J)K.source.style.addressModeU=HK[J].addressModeU,K.source.style.addressModeV=HK[J].addressModeV}setTransform(K){let J=this.texture;this.transform.copyFrom(K),this.transform.invert(),this.transform.scale(1/J.frame.width,1/J.frame.height),this._tick++}get texture(){return this._texture}set texture(K){if(this._texture===K)return;this._texture=K,this._tick++}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}}var $Z=new f,QZ=new v;function qK(K,J,Z,$){let Q=J.matrix?K.copyFrom(J.matrix).invert():K.identity();if(J.textureSpace==="local"){let H=Z.getBounds(QZ);if(J.width)H.pad(J.width);let{x:q,y:_}=H,V=1/H.width,U=1/H.height,z=-q*V,L=-_*U,E=Q.a,I=Q.b,D=Q.c,B=Q.d;Q.a*=V,Q.b*=V,Q.c*=U,Q.d*=U,Q.tx=z*E+L*D+Q.tx,Q.ty=z*I+L*B+Q.ty}else Q.translate(J.texture.frame.x,J.texture.frame.y),Q.scale(1/J.texture.source.width,1/J.texture.source.height);let N=J.texture.source.style;if(!(J.fill instanceof p)&&N.addressMode==="clamp-to-edge")N.addressMode="repeat",N.update();if($)Q.append($Z.copyFrom($).invert());return Q}function _K(K,J,Z,$,Q,N,H,q=null){let _=0;Z*=J,Q*=N;let{a:V,b:U,c:z,d:L,tx:E,ty:I}=q;while(_<H){let D=K[Z],B=K[Z+1];$[Q]=V*D+z*B+E,$[Q+1]=U*D+L*B+I,Q+=N,Z+=J,_++}}function UK(K,J,Z,$){let Q=0;J*=Z;while(Q<$)K[J]=0,K[J+1]=0,J+=Z,Q++}function SJ(K,J,Z,$,Q){let{a:N,b:H,c:q,d:_,tx:V,ty:U}=J;Z||(Z=0),$||($=2),Q||(Q=K.length/$-Z);let z=Z*$;for(let L=0;L<Q;L++){let E=K[z],I=K[z+1];K[z]=N*E+q*I+V,K[z+1]=H*E+_*I+U,z+=$}}var NZ=new f;class IJ{constructor(){this.packAsQuad=!1,this.batcherName="default",this.topology="triangle-list",this.applyTransform=!0,this.roundPixels=0,this._batcher=null,this._batch=null}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){if(this.renderable&&this.applyTransform)return this.renderable.groupBlendMode;return"normal"}get color(){let K=this.baseColor,J=K>>16|K&65280|(K&255)<<16,Z=this.renderable;if(Z)return VK(J,Z.groupColor)+(this.alpha*Z.groupAlpha*255<<24);return J+(this.alpha*255<<24)}get transform(){return this.renderable?.groupTransform||NZ}copyTo(K){K.indexOffset=this.indexOffset,K.indexSize=this.indexSize,K.attributeOffset=this.attributeOffset,K.attributeSize=this.attributeSize,K.baseColor=this.baseColor,K.alpha=this.alpha,K.texture=this.texture,K.geometryData=this.geometryData,K.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology="triangle-list"}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher=null,this._batch=null}}var KJ={extension:{type:h.ShapeBuilder,name:"circle"},build(K,J){let Z,$,Q,N,H,q;if(K.type==="circle"){let w=K;if(H=q=w.radius,H<=0)return!1;Z=w.x,$=w.y,Q=N=0}else if(K.type==="ellipse"){let w=K;if(H=w.halfWidth,q=w.halfHeight,H<=0||q<=0)return!1;Z=w.x,$=w.y,Q=N=0}else{let w=K,O=w.width/2,F=w.height/2;Z=w.x+O,$=w.y+F,H=q=Math.max(0,Math.min(w.radius,Math.min(O,F))),Q=O-H,N=F-q}if(Q<0||N<0)return!1;let _=Math.ceil(2.3*Math.sqrt(H+q)),V=_*8+(Q?4:0)+(N?4:0);if(V===0)return!1;if(_===0)return J[0]=J[6]=Z+Q,J[1]=J[3]=$+N,J[2]=J[4]=Z-Q,J[5]=J[7]=$-N,!0;let U=0,z=_*4+(Q?2:0)+2,L=z,E=V,I=Q+H,D=N,B=Z+I,M=Z-I,C=$+D;if(J[U++]=B,J[U++]=C,J[--z]=C,J[--z]=M,N){let w=$-D;J[L++]=M,J[L++]=w,J[--E]=w,J[--E]=B}for(let w=1;w<_;w++){let O=Math.PI/2*(w/_),F=Q+Math.cos(O)*H,R=N+Math.sin(O)*q,X=Z+F,Y=Z-F,G=$+R,T=$-R;J[U++]=X,J[U++]=G,J[--z]=G,J[--z]=Y,J[L++]=Y,J[L++]=T,J[--E]=T,J[--E]=X}I=Q,D=N+q,B=Z+I,M=Z-I,C=$+D;let A=$-D;if(J[U++]=B,J[U++]=C,J[--E]=A,J[--E]=B,Q)J[U++]=M,J[U++]=C,J[--E]=A,J[--E]=M;return!0},triangulate(K,J,Z,$,Q,N){if(K.length===0)return;let H=0,q=0;for(let U=0;U<K.length;U+=2)H+=K[U],q+=K[U+1];H/=K.length/2,q/=K.length/2;let _=$;J[_*Z]=H,J[_*Z+1]=q;let V=_++;for(let U=0;U<K.length;U+=2){if(J[_*Z]=K[U],J[_*Z+1]=K[U+1],U>0)Q[N++]=_,Q[N++]=V,Q[N++]=_-1;_++}Q[N++]=V+1,Q[N++]=V,Q[N++]=_-1}},EK={...KJ,extension:{...KJ.extension,name:"ellipse"}},zK={...KJ,extension:{...KJ.extension,name:"roundedRectangle"}};function LK(K,J,Z,$){let Q=DJ;if(K.length===0)return;let N=K[0],H=K[1],q=K[K.length-2],_=K[K.length-1],V=J||Math.abs(N-q)<Q&&Math.abs(H-_)<Q,U=Z,z=K.length/2,L=U.length/2;for(let E=0;E<z;E++)U.push(K[E*2]),U.push(K[E*2+1]);for(let E=0;E<z-1;E++)$.push(L+E,L+E+1);if(V)$.push(L+z-1,L)}function BJ(K,J,Z,$,Q,N,H){let q=MK(K,J,2);if(!q)return;for(let V=0;V<q.length;V+=3)N[H++]=q[V]+Q,N[H++]=q[V+1]+Q,N[H++]=q[V+2]+Q;let _=Q*$;for(let V=0;V<K.length;V+=2)Z[_]=K[V],Z[_+1]=K[V+1],_+=$}var HZ=[],DK={extension:{type:h.ShapeBuilder,name:"polygon"},build(K,J){for(let Z=0;Z<K.points.length;Z++)J[Z]=K.points[Z];return!0},triangulate(K,J,Z,$,Q,N){BJ(K,HZ,J,Z,$,Q,N)}};var IK={extension:{type:h.ShapeBuilder,name:"rectangle"},build(K,J){let Z=K,$=Z.x,Q=Z.y,N=Z.width,H=Z.height;if(!(N>0&&H>0))return!1;return J[0]=$,J[1]=Q,J[2]=$+N,J[3]=Q,J[4]=$+N,J[5]=Q+H,J[6]=$,J[7]=Q+H,!0},triangulate(K,J,Z,$,Q,N){let H=0;$*=Z,J[$+H]=K[0],J[$+H+1]=K[1],H+=Z,J[$+H]=K[2],J[$+H+1]=K[3],H+=Z,J[$+H]=K[6],J[$+H+1]=K[7],H+=Z,J[$+H]=K[4],J[$+H+1]=K[5],H+=Z;let q=$/Z;Q[N++]=q,Q[N++]=q+1,Q[N++]=q+2,Q[N++]=q+1,Q[N++]=q+3,Q[N++]=q+2}};var BK={extension:{type:h.ShapeBuilder,name:"triangle"},build(K,J){return J[0]=K.x,J[1]=K.y,J[2]=K.x2,J[3]=K.y2,J[4]=K.x3,J[5]=K.y3,!0},triangulate(K,J,Z,$,Q,N){let H=0;$*=Z,J[$+H]=K[0],J[$+H+1]=K[1],H+=Z,J[$+H]=K[2],J[$+H+1]=K[3],H+=Z,J[$+H]=K[4],J[$+H+1]=K[5];let q=$/Z;Q[N++]=q,Q[N++]=q+1,Q[N++]=q+2}};var FJ={};mJ.handleByMap(h.ShapeBuilder,FJ);mJ.add(IK,DK,BK,KJ,EK,zK);var qZ=new v,_Z=new f;function RK(K,J){let{geometryData:Z,batches:$}=J;$.length=0,Z.indices.length=0,Z.vertices.length=0,Z.uvs.length=0;for(let Q=0;Q<K.instructions.length;Q++){let N=K.instructions[Q];if(N.action==="texture")UZ(N.data,$,Z);else if(N.action==="fill"||N.action==="stroke"){let H=N.action==="stroke",q=N.data.path.shapePath,_=N.data.style,V=N.data.hole;if(H&&V)FK(V.shapePath,_,!0,$,Z);if(V)q.shapePrimitives[q.shapePrimitives.length-1].holes=V.shapePath.shapePrimitives;FK(q,_,H,$,Z)}}}function UZ(K,J,Z){let $=[],Q=FJ.rectangle,N=qZ;N.x=K.dx,N.y=K.dy,N.width=K.dw,N.height=K.dh;let H=K.transform;if(!Q.build(N,$))return;let{vertices:q,uvs:_,indices:V}=Z,U=V.length,z=q.length/2;if(H)SJ($,H);Q.triangulate($,q,2,z,V,U);let L=K.image,E=L.uvs;_.push(E.x0,E.y0,E.x1,E.y1,E.x3,E.y3,E.x2,E.y2);let I=e.get(IJ);I.indexOffset=U,I.indexSize=V.length-U,I.attributeOffset=z,I.attributeSize=q.length/2-z,I.baseColor=K.style,I.alpha=K.alpha,I.texture=L,I.geometryData=Z,J.push(I)}function FK(K,J,Z,$,Q){let{vertices:N,uvs:H,indices:q}=Q;K.shapePrimitives.forEach(({shape:_,transform:V,holes:U})=>{let z=[],L=FJ[_.type];if(!L.build(_,z))return;let E=q.length,I=N.length/2,D="triangle-list";if(V)SJ(z,V);if(!Z)if(U){let A=[],w=z.slice();VZ(U).forEach((F)=>{A.push(w.length/2),w.push(...F)}),BJ(w,A,N,2,I,q,E)}else L.triangulate(z,N,2,I,q,E);else{let A=_.closePath??!0,w=J;if(!w.pixelLine)JK(z,w,!1,A,N,q);else LK(z,A,N,q),D="line-list"}let B=H.length/2,M=J.texture;if(M!==y.WHITE){let A=qK(_Z,J,_,V);_K(N,2,I,H,B,2,N.length/2-I,A)}else UK(H,B,2,N.length/2-I);let C=e.get(IJ);C.indexOffset=E,C.indexSize=q.length-E,C.attributeOffset=I,C.attributeSize=N.length/2-I,C.baseColor=J.color,C.alpha=J.alpha,C.texture=M,C.geometryData=Q,C.topology=D,$.push(C)})}function VZ(K){let J=[];for(let Z=0;Z<K.length;Z++){let $=K[Z].shape,Q=[];if(FJ[$.type].build($,Q))J.push(Q)}return J}var GK=IZ(TK(),1);function jK(K,J){let Z=GK.default(K),$=[],Q=null,N=0,H=0;for(let q=0;q<Z.length;q++){let _=Z[q],V=_[0],U=_;switch(V){case"M":N=U[1],H=U[2],J.moveTo(N,H);break;case"m":N+=U[1],H+=U[2],J.moveTo(N,H);break;case"H":N=U[1],J.lineTo(N,H);break;case"h":N+=U[1],J.lineTo(N,H);break;case"V":H=U[1],J.lineTo(N,H);break;case"v":H+=U[1],J.lineTo(N,H);break;case"L":N=U[1],H=U[2],J.lineTo(N,H);break;case"l":N+=U[1],H+=U[2],J.lineTo(N,H);break;case"C":N=U[5],H=U[6],J.bezierCurveTo(U[1],U[2],U[3],U[4],N,H);break;case"c":J.bezierCurveTo(N+U[1],H+U[2],N+U[3],H+U[4],N+U[5],H+U[6]),N+=U[5],H+=U[6];break;case"S":N=U[3],H=U[4],J.bezierCurveToShort(U[1],U[2],N,H);break;case"s":J.bezierCurveToShort(N+U[1],H+U[2],N+U[3],H+U[4]),N+=U[3],H+=U[4];break;case"Q":N=U[3],H=U[4],J.quadraticCurveTo(U[1],U[2],N,H);break;case"q":J.quadraticCurveTo(N+U[1],H+U[2],N+U[3],H+U[4]),N+=U[3],H+=U[4];break;case"T":N=U[1],H=U[2],J.quadraticCurveToShort(N,H);break;case"t":N+=U[1],H+=U[2],J.quadraticCurveToShort(N,H);break;case"A":N=U[6],H=U[7],J.arcToSvg(U[1],U[2],U[3],U[4],U[5],N,H);break;case"a":N+=U[6],H+=U[7],J.arcToSvg(U[1],U[2],U[3],U[4],U[5],N,H);break;case"Z":case"z":if(J.closePath(),$.length>0)if(Q=$.pop(),Q)N=Q.startX,H=Q.startY;else N=0,H=0;Q=null;break;default:o(`Unknown SVG path command: ${V}`)}if(V!=="Z"&&V!=="z"){if(Q===null)Q={startX:N,startY:H},$.push(Q)}}return J}class RJ{constructor(K=0,J=0,Z=0){this.type="circle",this.x=K,this.y=J,this.radius=Z}clone(){return new RJ(this.x,this.y,this.radius)}contains(K,J){if(this.radius<=0)return!1;let Z=this.radius*this.radius,$=this.x-K,Q=this.y-J;return $*=$,Q*=Q,$+Q<=Z}strokeContains(K,J,Z,$=0.5){if(this.radius===0)return!1;let Q=this.x-K,N=this.y-J,H=this.radius,q=(1-$)*Z,_=Math.sqrt(Q*Q+N*N);return _<=H+q&&_>H-(Z-q)}getBounds(K){return K||(K=new v),K.x=this.x-this.radius,K.y=this.y-this.radius,K.width=this.radius*2,K.height=this.radius*2,K}copyFrom(K){return this.x=K.x,this.y=K.y,this.radius=K.radius,this}copyTo(K){return K.copyFrom(this),K}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class wJ{constructor(K=0,J=0,Z=0,$=0){this.type="ellipse",this.x=K,this.y=J,this.halfWidth=Z,this.halfHeight=$}clone(){return new wJ(this.x,this.y,this.halfWidth,this.halfHeight)}contains(K,J){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let Z=(K-this.x)/this.halfWidth,$=(J-this.y)/this.halfHeight;return Z*=Z,$*=$,Z+$<=1}strokeContains(K,J,Z,$=0.5){let{halfWidth:Q,halfHeight:N}=this;if(Q<=0||N<=0)return!1;let H=Z*(1-$),q=Z-H,_=Q-q,V=N-q,U=Q+H,z=N+H,L=K-this.x,E=J-this.y,I=L*L/(_*_)+E*E/(V*V),D=L*L/(U*U)+E*E/(z*z);return I>1&&D<=1}getBounds(K){return K||(K=new v),K.x=this.x-this.halfWidth,K.y=this.y-this.halfHeight,K.width=this.halfWidth*2,K.height=this.halfHeight*2,K}copyFrom(K){return this.x=K.x,this.y=K.y,this.halfWidth=K.halfWidth,this.halfHeight=K.halfHeight,this}copyTo(K){return K.copyFrom(this),K}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function CK(K,J,Z,$,Q,N){let H=K-Z,q=J-$,_=Q-Z,V=N-$,U=H*_+q*V,z=_*_+V*V,L=-1;if(z!==0)L=U/z;let E,I;if(L<0)E=Z,I=$;else if(L>1)E=Q,I=N;else E=Z+L*_,I=$+L*V;let D=K-E,B=J-I;return D*D+B*B}var BZ,FZ;class ZJ{constructor(...K){this.type="polygon";let J=Array.isArray(K[0])?K[0]:K;if(typeof J[0]!=="number"){let Z=[];for(let $=0,Q=J.length;$<Q;$++)Z.push(J[$].x,J[$].y);J=Z}this.points=J,this.closePath=!0}isClockwise(){let K=0,J=this.points,Z=J.length;for(let $=0;$<Z;$+=2){let Q=J[$],N=J[$+1],H=J[($+2)%Z],q=J[($+3)%Z];K+=(H-Q)*(q+N)}return K<0}containsPolygon(K){let J=this.getBounds(BZ),Z=K.getBounds(FZ);if(!J.containsRect(Z))return!1;let $=K.points;for(let Q=0;Q<$.length;Q+=2){let N=$[Q],H=$[Q+1];if(!this.contains(N,H))return!1}return!0}clone(){let K=this.points.slice(),J=new ZJ(K);return J.closePath=this.closePath,J}contains(K,J){let Z=!1,$=this.points.length/2;for(let Q=0,N=$-1;Q<$;N=Q++){let H=this.points[Q*2],q=this.points[Q*2+1],_=this.points[N*2],V=this.points[N*2+1];if(q>J!==V>J&&K<(_-H)*((J-q)/(V-q))+H)Z=!Z}return Z}strokeContains(K,J,Z,$=0.5){let Q=Z*Z,N=Q*(1-$),H=Q-N,{points:q}=this,_=q.length-(this.closePath?0:2);for(let V=0;V<_;V+=2){let U=q[V],z=q[V+1],L=q[(V+2)%q.length],E=q[(V+3)%q.length],I=CK(K,J,U,z,L,E),D=Math.sign((L-U)*(J-z)-(E-z)*(K-U));if(I<=(D<0?H:N))return!0}return!1}getBounds(K){K||(K=new v);let J=this.points,Z=1/0,$=-1/0,Q=1/0,N=-1/0;for(let H=0,q=J.length;H<q;H+=2){let _=J[H],V=J[H+1];Z=_<Z?_:Z,$=_>$?_:$,Q=V<Q?V:Q,N=V>N?V:N}return K.x=Z,K.width=$-Z,K.y=Q,K.height=N-Q,K}copyFrom(K){return this.points=K.points.slice(),this.closePath=K.closePath,this}copyTo(K){return K.copyFrom(this),K}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((K,J)=>`${K}, ${J}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return c("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return c("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}}var TJ=(K,J,Z,$,Q,N,H)=>{let q=K-Z,_=J-$,V=Math.sqrt(q*q+_*_);return V>=Q-N&&V<=Q+H};class GJ{constructor(K=0,J=0,Z=0,$=0,Q=20){this.type="roundedRectangle",this.x=K,this.y=J,this.width=Z,this.height=$,this.radius=Q}getBounds(K){return K||(K=new v),K.x=this.x,K.y=this.y,K.width=this.width,K.height=this.height,K}clone(){return new GJ(this.x,this.y,this.width,this.height,this.radius)}copyFrom(K){return this.x=K.x,this.y=K.y,this.width=K.width,this.height=K.height,this}copyTo(K){return K.copyFrom(this),K}contains(K,J){if(this.width<=0||this.height<=0)return!1;if(K>=this.x&&K<=this.x+this.width){if(J>=this.y&&J<=this.y+this.height){let Z=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(J>=this.y+Z&&J<=this.y+this.height-Z||K>=this.x+Z&&K<=this.x+this.width-Z)return!0;let $=K-(this.x+Z),Q=J-(this.y+Z),N=Z*Z;if($*$+Q*Q<=N)return!0;if($=K-(this.x+this.width-Z),$*$+Q*Q<=N)return!0;if(Q=J-(this.y+this.height-Z),$*$+Q*Q<=N)return!0;if($=K-(this.x+Z),$*$+Q*Q<=N)return!0}}return!1}strokeContains(K,J,Z,$=0.5){let{x:Q,y:N,width:H,height:q,radius:_}=this,V=Z*(1-$),U=Z-V,z=Q+_,L=N+_,E=H-_*2,I=q-_*2,D=Q+H,B=N+q;if((K>=Q-V&&K<=Q+U||K>=D-U&&K<=D+V)&&J>=L&&J<=L+I)return!0;if((J>=N-V&&J<=N+U||J>=B-U&&J<=B+V)&&K>=z&&K<=z+E)return!0;return K<z&&J<L&&TJ(K,J,z,L,_,U,V)||K>D-_&&J<L&&TJ(K,J,D-_,L,_,U,V)||K>D-_&&J>B-_&&TJ(K,J,D-_,B-_,_,U,V)||K<z&&J>B-_&&TJ(K,J,z,B-_,_,U,V)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}class XK{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){if(this.batches)this.batches.forEach((K)=>{e.return(K)});if(this.graphicsData)e.return(this.graphicsData);this.isBatchable=!1,this.context=null,this.batches.length=0,this.geometryData.indices.length=0,this.geometryData.vertices.length=0,this.geometryData.uvs.length=0,this.graphicsData=null}destroy(){this.reset(),this.batches=null,this.geometryData=null}}class PK{constructor(){this.instructions=new kK}init(K){let J=K.maxTextures;this.batcher?this.batcher._updateMaxTextures(J):this.batcher=new OK({maxTextures:J}),this.instructions.reset()}get geometry(){return c(AK,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}destroy(){this.batcher.destroy(),this.instructions.destroy(),this.batcher=null,this.instructions=null}}var vJ=class K{constructor(J){this._renderer=J,this._managedContexts=new YK({renderer:J,type:"resource",name:"graphicsContext"})}init(J){K.defaultOptions.bezierSmoothness=J?.bezierSmoothness??K.defaultOptions.bezierSmoothness}getContextRenderData(J){return J._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(J)}updateGpuContext(J){let Z=!!J._gpuData[this._renderer.uid],$=J._gpuData[this._renderer.uid]||this._initContext(J);if(J.dirty||!Z){if(Z)$.reset();RK(J,$);let Q=J.batchMode;if(J.customShader||Q==="no-batch")$.isBatchable=!1;else if(Q==="auto")$.isBatchable=$.geometryData.vertices.length<400;else $.isBatchable=!0;J.dirty=!1}return $}getGpuContext(J){return J._gpuData[this._renderer.uid]||this._initContext(J)}_initContextRenderData(J){let Z=e.get(PK,{maxTextures:this._renderer.limits.maxBatchableTextures}),$=J._gpuData[this._renderer.uid],{batches:Q,geometryData:N}=$;$.graphicsData=Z;let H=N.vertices.length,q=N.indices.length;for(let z=0;z<Q.length;z++)Q[z].applyTransform=!1;let _=Z.batcher;_.ensureAttributeBuffer(H),_.ensureIndexBuffer(q),_.begin();for(let z=0;z<Q.length;z++){let L=Q[z];_.add(L)}_.finish(Z.instructions);let V=_.geometry;V.indexBuffer.setDataWithSize(_.indexBuffer,_.indexSize,!0),V.buffers[0].setDataWithSize(_.attributeBuffer.float32View,_.attributeSize,!0);let U=_.batches;for(let z=0;z<U.length;z++){let L=U[z];L.bindGroup=WK(L.textures.textures,L.textures.count,this._renderer.limits.maxBatchableTextures)}return Z}_initContext(J){let Z=new XK;return Z.context=J,J._gpuData[this._renderer.uid]=Z,this._managedContexts.add(J),Z}destroy(){this._managedContexts.destroy(),this._renderer=null}};vJ.extension={type:[h.WebGLSystem,h.WebGPUSystem],name:"graphicsContext"};vJ.defaultOptions={bezierSmoothness:0.5};var jJ=vJ;var RZ=8,CJ=0.00000011920929,wZ=1,gJ=0.01,$J=0,t=0;function AJ(K,J,Z,$,Q,N,H,q,_,V){let z=Math.min(0.99,Math.max(0,V??jJ.defaultOptions.bezierSmoothness)),L=(wZ-z)/1;return L*=L,TZ(J,Z,$,Q,N,H,q,_,K,L),K}function TZ(K,J,Z,$,Q,N,H,q,_,V){hJ(K,J,Z,$,Q,N,H,q,_,V,0),_.push(H,q)}function hJ(K,J,Z,$,Q,N,H,q,_,V,U){if(U>RZ)return;let z=Math.PI,L=(K+Z)/2,E=(J+$)/2,I=(Z+Q)/2,D=($+N)/2,B=(Q+H)/2,M=(N+q)/2,C=(L+I)/2,A=(E+D)/2,w=(I+B)/2,O=(D+M)/2,F=(C+w)/2,R=(A+O)/2;if(U>0){let X=H-K,Y=q-J,G=Math.abs((Z-H)*Y-($-q)*X),T=Math.abs((Q-H)*Y-(N-q)*X),W,b;if(G>CJ&&T>CJ){if((G+T)*(G+T)<=V*(X*X+Y*Y)){if($J<gJ){_.push(F,R);return}let S=Math.atan2(N-$,Q-Z);if(W=Math.abs(S-Math.atan2($-J,Z-K)),b=Math.abs(Math.atan2(q-N,H-Q)-S),W>=z)W=2*z-W;if(b>=z)b=2*z-b;if(W+b<$J){_.push(F,R);return}if(t!==0){if(W>t){_.push(Z,$);return}if(b>t){_.push(Q,N);return}}}}else if(G>CJ){if(G*G<=V*(X*X+Y*Y)){if($J<gJ){_.push(F,R);return}if(W=Math.abs(Math.atan2(N-$,Q-Z)-Math.atan2($-J,Z-K)),W>=z)W=2*z-W;if(W<$J){_.push(Z,$),_.push(Q,N);return}if(t!==0){if(W>t){_.push(Z,$);return}}}}else if(T>CJ){if(T*T<=V*(X*X+Y*Y)){if($J<gJ){_.push(F,R);return}if(W=Math.abs(Math.atan2(q-N,H-Q)-Math.atan2(N-$,Q-Z)),W>=z)W=2*z-W;if(W<$J){_.push(Z,$),_.push(Q,N);return}if(t!==0){if(W>t){_.push(Q,N);return}}}}else if(X=F-(K+H)/2,Y=R-(J+q)/2,X*X+Y*Y<=V){_.push(F,R);return}}hJ(K,J,L,E,C,A,F,R,_,V,U+1),hJ(F,R,w,O,B,M,H,q,_,V,U+1)}var GZ=8,jZ=0.00000011920929,CZ=1,AZ=0.01,bK=0;function SK(K,J,Z,$,Q,N,H,q){let V=Math.min(0.99,Math.max(0,q??jJ.defaultOptions.bezierSmoothness)),U=(CZ-V)/1;return U*=U,kZ(J,Z,$,Q,N,H,K,U),K}function kZ(K,J,Z,$,Q,N,H,q){uJ(H,K,J,Z,$,Q,N,q,0),H.push(Q,N)}function uJ(K,J,Z,$,Q,N,H,q,_){if(_>GZ)return;let V=Math.PI,U=(J+$)/2,z=(Z+Q)/2,L=($+N)/2,E=(Q+H)/2,I=(U+L)/2,D=(z+E)/2,B=N-J,M=H-Z,C=Math.abs(($-N)*M-(Q-H)*B);if(C>jZ){if(C*C<=q*(B*B+M*M)){if(bK<AZ){K.push(I,D);return}let A=Math.abs(Math.atan2(H-Q,N-$)-Math.atan2(Q-Z,$-J));if(A>=V)A=2*V-A;if(A<bK){K.push(I,D);return}}}else if(B=I-(J+N)/2,M=D-(Z+H)/2,B*B+M*M<=q){K.push(I,D);return}uJ(K,J,Z,U,z,I,D,q,_+1),uJ(K,I,D,L,E,N,H,q,_+1)}function kJ(K,J,Z,$,Q,N,H,q){let _=Math.abs(Q-N);if(!H&&Q>N)_=2*Math.PI-_;else if(H&&N>Q)_=2*Math.PI-_;q||(q=Math.max(6,Math.floor(6*Math.pow($,0.3333333333333333)*(_/Math.PI)))),q=Math.max(q,3);let V=_/q,U=Q;V*=H?-1:1;for(let z=0;z<q+1;z++){let L=Math.cos(U),E=Math.sin(U),I=J+L*$,D=Z+E*$;K.push(I,D),U+=V}}function mK(K,J,Z,$,Q,N){let H=K[K.length-2],_=K[K.length-1]-Z,V=H-J,U=Q-Z,z=$-J,L=Math.abs(_*z-V*U);if(L<0.00000001||N===0){if(K[K.length-2]!==J||K[K.length-1]!==Z)K.push(J,Z);return}let E=_*_+V*V,I=U*U+z*z,D=_*U+V*z,B=N*Math.sqrt(E)/L,M=N*Math.sqrt(I)/L,C=B*D/E,A=M*D/I,w=B*z+M*V,O=B*U+M*_,F=V*(M+C),R=_*(M+C),X=z*(B+A),Y=U*(B+A),G=Math.atan2(R-O,F-w),T=Math.atan2(Y-O,X-w);kJ(K,w+J,O+Z,N,G,T,V*U>z*_)}var VJ=Math.PI*2,yJ={centerX:0,centerY:0,ang1:0,ang2:0},xJ=({x:K,y:J},Z,$,Q,N,H,q,_)=>{K*=Z,J*=$;let V=Q*K-N*J,U=N*K+Q*J;return _.x=V+H,_.y=U+q,_};function WZ(K,J){let Z=J===-1.5707963267948966?-0.551915024494:1.3333333333333333*Math.tan(J/4),$=J===1.5707963267948966?0.551915024494:Z,Q=Math.cos(K),N=Math.sin(K),H=Math.cos(K+J),q=Math.sin(K+J);return[{x:Q-N*$,y:N+Q*$},{x:H+q*$,y:q-H*$},{x:H,y:q}]}var fK=(K,J,Z,$)=>{let Q=K*$-J*Z<0?-1:1,N=K*Z+J*$;if(N>1)N=1;if(N<-1)N=-1;return Q*Math.acos(N)},OZ=(K,J,Z,$,Q,N,H,q,_,V,U,z,L)=>{let E=Math.pow(Q,2),I=Math.pow(N,2),D=Math.pow(U,2),B=Math.pow(z,2),M=E*I-E*B-I*D;if(M<0)M=0;M/=E*B+I*D,M=Math.sqrt(M)*(H===q?-1:1);let C=M*Q/N*z,A=M*-N/Q*U,w=V*C-_*A+(K+Z)/2,O=_*C+V*A+(J+$)/2,F=(U-C)/Q,R=(z-A)/N,X=(-U-C)/Q,Y=(-z-A)/N,G=fK(1,0,F,R),T=fK(F,R,X,Y);if(q===0&&T>0)T-=VJ;if(q===1&&T<0)T+=VJ;L.centerX=w,L.centerY=O,L.ang1=G,L.ang2=T};function vK(K,J,Z,$,Q,N,H,q=0,_=0,V=0){if(N===0||H===0)return;let U=Math.sin(q*VJ/360),z=Math.cos(q*VJ/360),L=z*(J-$)/2+U*(Z-Q)/2,E=-U*(J-$)/2+z*(Z-Q)/2;if(L===0&&E===0)return;N=Math.abs(N),H=Math.abs(H);let I=Math.pow(L,2)/Math.pow(N,2)+Math.pow(E,2)/Math.pow(H,2);if(I>1)N*=Math.sqrt(I),H*=Math.sqrt(I);OZ(J,Z,$,Q,N,H,_,V,U,z,L,E,yJ);let{ang1:D,ang2:B}=yJ,{centerX:M,centerY:C}=yJ,A=Math.abs(B)/(VJ/4);if(Math.abs(1-A)<0.0000001)A=1;let w=Math.max(Math.ceil(A),1);B/=w;let O=K[K.length-2],F=K[K.length-1],R={x:0,y:0};for(let X=0;X<w;X++){let Y=WZ(D,B),{x:G,y:T}=xJ(Y[0],N,H,z,U,M,C,R),{x:W,y:b}=xJ(Y[1],N,H,z,U,M,C,R),{x:S,y:JJ}=xJ(Y[2],N,H,z,U,M,C,R);AJ(K,O,F,G,T,W,b,S,JJ),O=S,F=JJ,D+=B}}function gK(K,J,Z){let $=(H,q)=>{let _=q.x-H.x,V=q.y-H.y,U=Math.sqrt(_*_+V*V),z=_/U,L=V/U;return{len:U,nx:z,ny:L}},Q=(H,q)=>{if(H===0)K.moveTo(q.x,q.y);else K.lineTo(q.x,q.y)},N=J[J.length-1];for(let H=0;H<J.length;H++){let q=J[H%J.length],_=q.radius??Z;if(_<=0){Q(H,q),N=q;continue}let V=J[(H+1)%J.length],U=$(q,N),z=$(q,V);if(U.len<0.0001||z.len<0.0001){Q(H,q),N=q;continue}let L=Math.asin(U.nx*z.ny-U.ny*z.nx),E=1,I=!1;if(U.nx*z.nx-U.ny*-z.ny<0)if(L<0)L=Math.PI+L;else L=Math.PI-L,E=-1,I=!0;else if(L>0)E=-1,I=!0;let D=L/2,B,M=Math.abs(Math.cos(D)*_/Math.sin(D));if(M>Math.min(U.len/2,z.len/2))M=Math.min(U.len/2,z.len/2),B=Math.abs(M*Math.sin(D)/Math.cos(D));else B=_;let C=q.x+z.nx*M+-z.ny*B*E,A=q.y+z.ny*M+z.nx*B*E,w=Math.atan2(U.ny,U.nx)+Math.PI/2*E,O=Math.atan2(z.ny,z.nx)-Math.PI/2*E;if(H===0)K.moveTo(C+Math.cos(w)*B,A+Math.sin(w)*B);K.arc(C,A,B,w,O,I),N=q}}function hK(K,J,Z,$){let Q=(q,_)=>Math.sqrt((q.x-_.x)**2+(q.y-_.y)**2),N=(q,_,V)=>({x:q.x+(_.x-q.x)*V,y:q.y+(_.y-q.y)*V}),H=J.length;for(let q=0;q<H;q++){let _=J[(q+1)%H],V=_.radius??Z;if(V<=0){if(q===0)K.moveTo(_.x,_.y);else K.lineTo(_.x,_.y);continue}let U=J[q],z=J[(q+2)%H],L=Q(U,_),E;if(L<0.0001)E=_;else{let B=Math.min(L/2,V);E=N(_,U,B/L)}let I=Q(z,_),D;if(I<0.0001)D=_;else{let B=Math.min(I/2,V);D=N(_,z,B/I)}if(q===0)K.moveTo(E.x,E.y);else K.lineTo(E.x,E.y);K.quadraticCurveTo(_.x,_.y,D.x,D.y,$)}}var YZ=new v;class cJ{constructor(K){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new WJ,this._graphicsPath2D=K,this.signed=K.checkForHoles}moveTo(K,J){return this.startPoly(K,J),this}lineTo(K,J){this._ensurePoly();let Z=this._currentPoly.points,$=Z[Z.length-2],Q=Z[Z.length-1];if($!==K||Q!==J)Z.push(K,J);return this}arc(K,J,Z,$,Q,N){this._ensurePoly(!1);let H=this._currentPoly.points;return kJ(H,K,J,Z,$,Q,N),this}arcTo(K,J,Z,$,Q){this._ensurePoly();let N=this._currentPoly.points;return mK(N,K,J,Z,$,Q),this}arcToSvg(K,J,Z,$,Q,N,H){let q=this._currentPoly.points;return vK(q,this._currentPoly.lastX,this._currentPoly.lastY,N,H,K,J,Z,$,Q),this}bezierCurveTo(K,J,Z,$,Q,N,H){this._ensurePoly();let q=this._currentPoly;return AJ(this._currentPoly.points,q.lastX,q.lastY,K,J,Z,$,Q,N,H),this}quadraticCurveTo(K,J,Z,$,Q){this._ensurePoly();let N=this._currentPoly;return SK(this._currentPoly.points,N.lastX,N.lastY,K,J,Z,$,Q),this}closePath(){return this.endPoly(!0),this}addPath(K,J){if(this.endPoly(),J&&!J.isIdentity())K=K.clone(!0),K.transform(J);let Z=this.shapePrimitives,$=Z.length;for(let Q=0;Q<K.instructions.length;Q++){let N=K.instructions[Q];this[N.action](...N.data)}if(K.checkForHoles&&Z.length-$>1){let Q=null;for(let N=$;N<Z.length;N++){let H=Z[N];if(H.shape.type==="polygon"){let q=H.shape,_=Q?.shape;if(_&&_.containsPolygon(q))Q.holes||(Q.holes=[]),Q.holes.push(H),Z.copyWithin(N,N+1),Z.length--,N--;else Q=H}}}return this}finish(K=!1){this.endPoly(K)}rect(K,J,Z,$,Q){return this.drawShape(new v(K,J,Z,$),Q),this}circle(K,J,Z,$){return this.drawShape(new RJ(K,J,Z),$),this}poly(K,J,Z){let $=new ZJ(K);return $.closePath=J,this.drawShape($,Z),this}regularPoly(K,J,Z,$,Q=0,N){$=Math.max($|0,3);let H=-1*Math.PI/2+Q,q=Math.PI*2/$,_=[];for(let V=0;V<$;V++){let U=H-V*q;_.push(K+Z*Math.cos(U),J+Z*Math.sin(U))}return this.poly(_,!0,N),this}roundPoly(K,J,Z,$,Q,N=0,H){if($=Math.max($|0,3),Q<=0)return this.regularPoly(K,J,Z,$,N);let q=Z*Math.sin(Math.PI/$)-0.001;Q=Math.min(Q,q);let _=-1*Math.PI/2+N,V=Math.PI*2/$,U=($-2)*Math.PI/$/2;for(let z=0;z<$;z++){let L=z*V+_,E=K+Z*Math.cos(L),I=J+Z*Math.sin(L),D=L+Math.PI+U,B=L-Math.PI-U,M=E+Q*Math.cos(D),C=I+Q*Math.sin(D),A=E+Q*Math.cos(B),w=I+Q*Math.sin(B);if(z===0)this.moveTo(M,C);else this.lineTo(M,C);this.quadraticCurveTo(E,I,A,w,H)}return this.closePath()}roundShape(K,J,Z=!1,$){if(K.length<3)return this;if(Z)hK(this,K,J,$);else gK(this,K,J);return this.closePath()}filletRect(K,J,Z,$,Q){if(Q===0)return this.rect(K,J,Z,$);let N=Math.min(Z,$)/2,H=Math.min(N,Math.max(-N,Q)),q=K+Z,_=J+$,V=H<0?-H:0,U=Math.abs(H);return this.moveTo(K,J+U).arcTo(K+V,J+V,K+U,J,U).lineTo(q-U,J).arcTo(q-V,J+V,q,J+U,U).lineTo(q,_-U).arcTo(q-V,_-V,K+Z-U,_,U).lineTo(K+U,_).arcTo(K+V,_-V,K,_-U,U).closePath()}chamferRect(K,J,Z,$,Q,N){if(Q<=0)return this.rect(K,J,Z,$);let H=Math.min(Q,Math.min(Z,$)/2),q=K+Z,_=J+$,V=[K+H,J,q-H,J,q,J+H,q,_-H,q-H,_,K+H,_,K,_-H,K,J+H];for(let U=V.length-1;U>=2;U-=2)if(V[U]===V[U-2]&&V[U-1]===V[U-3])V.splice(U-1,2);return this.poly(V,!0,N)}ellipse(K,J,Z,$,Q){return this.drawShape(new wJ(K,J,Z,$),Q),this}roundRect(K,J,Z,$,Q,N){return this.drawShape(new GJ(K,J,Z,$,Q),N),this}drawShape(K,J){return this.endPoly(),this.shapePrimitives.push({shape:K,transform:J}),this}startPoly(K,J){let Z=this._currentPoly;if(Z)this.endPoly();return Z=new ZJ,Z.points.push(K,J),this._currentPoly=Z,this}endPoly(K=!1){let J=this._currentPoly;if(J&&J.points.length>2)J.closePath=K,this.shapePrimitives.push({shape:J});return this._currentPoly=null,this}_ensurePoly(K=!0){if(this._currentPoly)return;if(this._currentPoly=new ZJ,K){let J=this.shapePrimitives[this.shapePrimitives.length-1];if(J){let Z=J.shape.x,$=J.shape.y;if(J.transform&&!J.transform.isIdentity()){let Q=J.transform,N=Z;Z=Q.a*Z+Q.c*$+Q.tx,$=Q.b*N+Q.d*$+Q.ty}this._currentPoly.points.push(Z,$)}else this._currentPoly.points.push(0,0)}}buildPath(){let K=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let J=0;J<K.instructions.length;J++){let Z=K.instructions[J];this[Z.action](...Z.data)}this.finish()}get bounds(){let K=this._bounds;K.clear();let J=this.shapePrimitives;for(let Z=0;Z<J.length;Z++){let $=J[Z],Q=$.shape.getBounds(YZ);if($.transform)K.addRect(Q,$.transform);else K.addRect(Q)}return K}}class u{constructor(K,J=!1){if(this.instructions=[],this.uid=l("graphicsPath"),this._dirty=!0,this.checkForHoles=J,typeof K==="string")jK(K,this);else this.instructions=K?.slice()??[]}get shapePath(){if(!this._shapePath)this._shapePath=new cJ(this);if(this._dirty)this._dirty=!1,this._shapePath.buildPath();return this._shapePath}addPath(K,J){return K=K.clone(),this.instructions.push({action:"addPath",data:[K,J]}),this._dirty=!0,this}arc(...K){return this.instructions.push({action:"arc",data:K}),this._dirty=!0,this}arcTo(...K){return this.instructions.push({action:"arcTo",data:K}),this._dirty=!0,this}arcToSvg(...K){return this.instructions.push({action:"arcToSvg",data:K}),this._dirty=!0,this}bezierCurveTo(...K){return this.instructions.push({action:"bezierCurveTo",data:K}),this._dirty=!0,this}bezierCurveToShort(K,J,Z,$,Q){let N=this.instructions[this.instructions.length-1],H=this.getLastPoint(x.shared),q=0,_=0;if(!N||N.action!=="bezierCurveTo")q=H.x,_=H.y;else{q=N.data[2],_=N.data[3];let{x:V,y:U}=H;q=V+(V-q),_=U+(U-_)}return this.instructions.push({action:"bezierCurveTo",data:[q,_,K,J,Z,$,Q]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=!0,this}ellipse(...K){return this.instructions.push({action:"ellipse",data:K}),this._dirty=!0,this}lineTo(...K){return this.instructions.push({action:"lineTo",data:K}),this._dirty=!0,this}moveTo(...K){return this.instructions.push({action:"moveTo",data:K}),this}quadraticCurveTo(...K){return this.instructions.push({action:"quadraticCurveTo",data:K}),this._dirty=!0,this}quadraticCurveToShort(K,J,Z){let $=this.instructions[this.instructions.length-1],Q=this.getLastPoint(x.shared),N=0,H=0;if(!$||$.action!=="quadraticCurveTo")N=Q.x,H=Q.y;else{N=$.data[0],H=$.data[1];let{x:q,y:_}=Q;N=q+(q-N),H=_+(_-H)}return this.instructions.push({action:"quadraticCurveTo",data:[N,H,K,J,Z]}),this._dirty=!0,this}rect(K,J,Z,$,Q){return this.instructions.push({action:"rect",data:[K,J,Z,$,Q]}),this._dirty=!0,this}circle(K,J,Z,$){return this.instructions.push({action:"circle",data:[K,J,Z,$]}),this._dirty=!0,this}roundRect(...K){return this.instructions.push({action:"roundRect",data:K}),this._dirty=!0,this}poly(...K){return this.instructions.push({action:"poly",data:K}),this._dirty=!0,this}regularPoly(...K){return this.instructions.push({action:"regularPoly",data:K}),this._dirty=!0,this}roundPoly(...K){return this.instructions.push({action:"roundPoly",data:K}),this._dirty=!0,this}roundShape(...K){return this.instructions.push({action:"roundShape",data:K}),this._dirty=!0,this}filletRect(...K){return this.instructions.push({action:"filletRect",data:K}),this._dirty=!0,this}chamferRect(...K){return this.instructions.push({action:"chamferRect",data:K}),this._dirty=!0,this}star(K,J,Z,$,Q,N,H){Q||(Q=$/2);let q=-1*Math.PI/2+N,_=Z*2,V=Math.PI*2/_,U=[];for(let z=0;z<_;z++){let L=z%2?Q:$,E=z*V+q;U.push(K+L*Math.cos(E),J+L*Math.sin(E))}return this.poly(U,!0,H),this}clone(K=!1){let J=new u;if(J.checkForHoles=this.checkForHoles,!K)J.instructions=this.instructions.slice();else for(let Z=0;Z<this.instructions.length;Z++){let $=this.instructions[Z];J.instructions.push({action:$.action,data:$.data.slice()})}return J}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(K){if(K.isIdentity())return this;let{a:J,b:Z,c:$,d:Q,tx:N,ty:H}=K,q=0,_=0,V=0,U=0,z=0,L=0,E=0,I=0;for(let D=0;D<this.instructions.length;D++){let B=this.instructions[D],M=B.data;switch(B.action){case"moveTo":case"lineTo":q=M[0],_=M[1],M[0]=J*q+$*_+N,M[1]=Z*q+Q*_+H;break;case"bezierCurveTo":V=M[0],U=M[1],z=M[2],L=M[3],q=M[4],_=M[5],M[0]=J*V+$*U+N,M[1]=Z*V+Q*U+H,M[2]=J*z+$*L+N,M[3]=Z*z+Q*L+H,M[4]=J*q+$*_+N,M[5]=Z*q+Q*_+H;break;case"quadraticCurveTo":V=M[0],U=M[1],q=M[2],_=M[3],M[0]=J*V+$*U+N,M[1]=Z*V+Q*U+H,M[2]=J*q+$*_+N,M[3]=Z*q+Q*_+H;break;case"arcToSvg":q=M[5],_=M[6],E=M[0],I=M[1],M[0]=J*E+$*I,M[1]=Z*E+Q*I,M[5]=J*q+$*_+N,M[6]=Z*q+Q*_+H;break;case"circle":M[4]=EJ(M[3],K);break;case"rect":M[4]=EJ(M[4],K);break;case"ellipse":M[8]=EJ(M[8],K);break;case"roundRect":M[5]=EJ(M[5],K);break;case"addPath":M[0].transform(K);break;case"poly":M[2]=EJ(M[2],K);break;default:o("unknown transform action",B.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(K){let J=this.instructions.length-1,Z=this.instructions[J];if(!Z)return K.x=0,K.y=0,K;while(Z.action==="closePath"){if(J--,J<0)return K.x=0,K.y=0,K;Z=this.instructions[J]}switch(Z.action){case"moveTo":case"lineTo":K.x=Z.data[0],K.y=Z.data[1];break;case"quadraticCurveTo":K.x=Z.data[2],K.y=Z.data[3];break;case"bezierCurveTo":K.x=Z.data[4],K.y=Z.data[5];break;case"arc":case"arcToSvg":K.x=Z.data[5],K.y=Z.data[6];break;case"addPath":Z.data[0].getLastPoint(K);break}return K}}function EJ(K,J){if(K)return K.prepend(J);return J.clone()}function m(K,J,Z){let $=K.getAttribute(J);return $?Number($):Z}function uK(K,J){let Z=K.querySelectorAll("defs");for(let $=0;$<Z.length;$++){let Q=Z[$];for(let N=0;N<Q.children.length;N++){let H=Q.children[N];switch(H.nodeName.toLowerCase()){case"lineargradient":J.defs[H.id]=XZ(H);break;case"radialgradient":J.defs[H.id]=PZ(H);break;default:break}}}}function XZ(K){let J=m(K,"x1",0),Z=m(K,"y1",0),$=m(K,"x2",1),Q=m(K,"y2",0),N=K.getAttribute("gradientUnits")||"objectBoundingBox",H=new p(J,Z,$,Q,N==="objectBoundingBox"?"local":"global");for(let q=0;q<K.children.length;q++){let _=K.children[q],V=m(_,"offset",0),U=g.shared.setValue(_.getAttribute("stop-color")).toNumber();H.addColorStop(V,U)}return H}function PZ(K){return o("[SVG Parser] Radial gradients are not yet supported"),new p(0,0,1,0)}function dJ(K){let J=K.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return J?J[1]:""}var yK={fill:{type:"paint",default:0},"fill-opacity":{type:"number",default:1},stroke:{type:"paint",default:0},"stroke-width":{type:"number",default:1},"stroke-opacity":{type:"number",default:1},"stroke-linecap":{type:"string",default:"butt"},"stroke-linejoin":{type:"string",default:"miter"},"stroke-miterlimit":{type:"number",default:10},"stroke-dasharray":{type:"string",default:"none"},"stroke-dashoffset":{type:"number",default:0},opacity:{type:"number",default:1}};function lJ(K,J){let Z=K.getAttribute("style"),$={},Q={},N={strokeStyle:$,fillStyle:Q,useFill:!1,useStroke:!1};for(let H in yK){let q=K.getAttribute(H);if(q)xK(J,N,H,q.trim())}if(Z){let H=Z.split(";");for(let q=0;q<H.length;q++){let _=H[q].trim(),[V,U]=_.split(":");if(yK[V])xK(J,N,V,U.trim())}}return{strokeStyle:N.useStroke?$:null,fillStyle:N.useFill?Q:null,useFill:N.useFill,useStroke:N.useStroke}}function xK(K,J,Z,$){switch(Z){case"stroke":if($!=="none"){if($.startsWith("url(")){let Q=dJ($);J.strokeStyle.fill=K.defs[Q]}else J.strokeStyle.color=g.shared.setValue($).toNumber();J.useStroke=!0}break;case"stroke-width":J.strokeStyle.width=Number($);break;case"fill":if($!=="none"){if($.startsWith("url(")){let Q=dJ($);J.fillStyle.fill=K.defs[Q]}else J.fillStyle.color=g.shared.setValue($).toNumber();J.useFill=!0}break;case"fill-opacity":J.fillStyle.alpha=Number($);break;case"stroke-opacity":J.strokeStyle.alpha=Number($);break;case"opacity":J.fillStyle.alpha=Number($),J.strokeStyle.alpha=Number($);break}}function cK(K){if(K.length<=2)return!0;let J=K.map((q)=>q.area).sort((q,_)=>_-q),[Z,$]=J,Q=J[J.length-1],N=Z/$,H=$/Q;if(N>3&&H<2)return!1;return!0}function dK(K){return K.split(/(?=[Mm])/).filter(($)=>$.trim().length>0)}function lK(K){let J=K.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!J||J.length<4)return 0;let Z=J.map(Number),$=[],Q=[];for(let U=0;U<Z.length;U+=2)if(U+1<Z.length)$.push(Z[U]),Q.push(Z[U+1]);if($.length===0||Q.length===0)return 0;let N=Math.min(...$),H=Math.max(...$),q=Math.min(...Q),_=Math.max(...Q);return(H-N)*(_-q)}function pJ(K,J){let Z=new u(K,!1);for(let $ of Z.instructions)J.instructions.push($)}function pK(K,J){if(typeof K==="string"){let H=document.createElement("div");H.innerHTML=K.trim(),K=H.querySelector("svg")}let Z={context:J,defs:{},path:new u};uK(K,Z);let $=K.children,{fillStyle:Q,strokeStyle:N}=lJ(K,Z);for(let H=0;H<$.length;H++){let q=$[H];if(q.nodeName.toLowerCase()==="defs")continue;oK(q,Z,Q,N)}return J}function oK(K,J,Z,$){let Q=K.children,{fillStyle:N,strokeStyle:H}=lJ(K,J);if(N&&Z)Z={...Z,...N};else if(N)Z=N;if(H&&$)$={...$,...H};else if(H)$=H;let q=!Z&&!$;if(q)Z={color:0};let _,V,U,z,L,E,I,D,B,M,C,A,w,O,F,R,X;switch(K.nodeName.toLowerCase()){case"path":{O=K.getAttribute("d");let Y=K.getAttribute("fill-rule"),G=dK(O),T=Y==="evenodd",W=G.length>1;if(T&&W){let S=G.map((j)=>({path:j,area:lK(j)}));if(S.sort((j,k)=>k.area-j.area),G.length>3||!cK(S))for(let j=0;j<S.length;j++){let k=S[j],NJ=j===0;J.context.beginPath();let P=new u(void 0,!0);if(pJ(k.path,P),J.context.path(P),NJ){if(Z)J.context.fill(Z);if($)J.context.stroke($)}else J.context.cut()}else for(let j=0;j<S.length;j++){let k=S[j],NJ=j%2===1;J.context.beginPath();let P=new u(void 0,!0);if(pJ(k.path,P),J.context.path(P),NJ)J.context.cut();else{if(Z)J.context.fill(Z);if($)J.context.stroke($)}}}else{if(F=new u(O,Y?Y==="evenodd":!0),J.context.path(F),Z)J.context.fill(Z);if($)J.context.stroke($)}break}case"circle":if(I=m(K,"cx",0),D=m(K,"cy",0),B=m(K,"r",0),J.context.ellipse(I,D,B,B),Z)J.context.fill(Z);if($)J.context.stroke($);break;case"rect":if(_=m(K,"x",0),V=m(K,"y",0),R=m(K,"width",0),X=m(K,"height",0),M=m(K,"rx",0),C=m(K,"ry",0),M||C)J.context.roundRect(_,V,R,X,M||C);else J.context.rect(_,V,R,X);if(Z)J.context.fill(Z);if($)J.context.stroke($);break;case"ellipse":if(I=m(K,"cx",0),D=m(K,"cy",0),M=m(K,"rx",0),C=m(K,"ry",0),J.context.beginPath(),J.context.ellipse(I,D,M,C),Z)J.context.fill(Z);if($)J.context.stroke($);break;case"line":if(U=m(K,"x1",0),z=m(K,"y1",0),L=m(K,"x2",0),E=m(K,"y2",0),J.context.beginPath(),J.context.moveTo(U,z),J.context.lineTo(L,E),$)J.context.stroke($);break;case"polygon":if(w=K.getAttribute("points"),A=w.match(/-?\d+/g).map((Y)=>parseInt(Y,10)),J.context.poly(A,!0),Z)J.context.fill(Z);if($)J.context.stroke($);break;case"polyline":if(w=K.getAttribute("points"),A=w.match(/-?\d+/g).map((Y)=>parseInt(Y,10)),J.context.poly(A,!1),$)J.context.stroke($);break;case"g":case"svg":break;default:{o(`[SVG parser] <${K.nodeName}> elements unsupported`);break}}if(q)Z=null;for(let Y=0;Y<Q.length;Y++)oK(Q[Y],J,Z,$)}function bZ(K){return g.isColorLike(K)}function nK(K){return K instanceof bJ}function aK(K){return K instanceof p}function SZ(K){return K instanceof y}function mZ(K,J,Z){let $=g.shared.setValue(J??0);return K.color=$.toNumber(),K.alpha=$.alpha===1?Z.alpha:$.alpha,K.texture=y.WHITE,{...Z,...K}}function fZ(K,J,Z){return K.texture=J,{...Z,...K}}function rK(K,J,Z){return K.fill=J,K.color=16777215,K.texture=J.texture,K.matrix=J.transform,{...Z,...K}}function iK(K,J,Z){return J.buildGradient(),K.fill=J,K.color=16777215,K.texture=J.texture,K.matrix=J.transform,K.textureSpace=J.textureSpace,{...Z,...K}}function vZ(K,J){let Z={...J,...K},$=g.shared.setValue(Z.color);return Z.alpha*=$.alpha,Z.color=$.toNumber(),Z}function QJ(K,J){if(K===void 0||K===null)return null;let Z={},$=K;if(bZ(K))return mZ(Z,K,J);else if(SZ(K))return fZ(Z,K,J);else if(nK(K))return rK(Z,K,J);else if(aK(K))return iK(Z,K,J);else if($.fill&&nK($.fill))return rK($,$.fill,J);else if($.fill&&aK($.fill))return iK($,$.fill,J);return vZ($,J)}function oJ(K,J){let{width:Z,alignment:$,miterLimit:Q,cap:N,join:H,pixelLine:q,..._}=J,V=QJ(K,_);if(!V)return null;return{width:Z,alignment:$,miterLimit:Q,cap:N,join:H,pixelLine:q,...V}}var gZ=new x,sK=new f,nJ=class K extends eK{constructor(){super(...arguments);this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=l("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this.destroyed=!1,this._activePath=new u,this._transform=new f,this._fillStyle={...K.defaultFillStyle},this._strokeStyle={...K.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new WJ,this._boundsDirty=!0}clone(){let J=new K;return J.batchMode=this.batchMode,J.instructions=this.instructions.slice(),J._activePath=this._activePath.clone(),J._transform=this._transform.clone(),J._fillStyle={...this._fillStyle},J._strokeStyle={...this._strokeStyle},J._stateStack=this._stateStack.slice(),J._bounds=this._bounds.clone(),J._boundsDirty=!0,J}get fillStyle(){return this._fillStyle}set fillStyle(J){this._fillStyle=QJ(J,K.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(J){this._strokeStyle=oJ(J,K.defaultStrokeStyle)}setFillStyle(J){return this._fillStyle=QJ(J,K.defaultFillStyle),this}setStrokeStyle(J){return this._strokeStyle=QJ(J,K.defaultStrokeStyle),this}texture(J,Z,$,Q,N,H){return this.instructions.push({action:"texture",data:{image:J,dx:$||0,dy:Q||0,dw:N||J.frame.width,dh:H||J.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:Z||Z===0?g.shared.setValue(Z).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new u,this}fill(J,Z){let $,Q=this.instructions[this.instructions.length-1];if(this._tick===0&&Q?.action==="stroke")$=Q.data.path;else $=this._activePath.clone();if(!$)return this;if(J!=null){if(Z!==void 0&&typeof J==="number")c(tK,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),J={color:J,alpha:Z};this._fillStyle=QJ(J,K.defaultFillStyle)}return this.instructions.push({action:"fill",data:{style:this.fillStyle,path:$}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this}_initNextPathLocation(){let{x:J,y:Z}=this._activePath.getLastPoint(x.shared);this._activePath.clear(),this._activePath.moveTo(J,Z)}stroke(J){let Z,$=this.instructions[this.instructions.length-1];if(this._tick===0&&$?.action==="fill")Z=$.data.path;else Z=this._activePath.clone();if(!Z)return this;if(J!=null)this._strokeStyle=oJ(J,K.defaultStrokeStyle);return this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:Z}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this}cut(){for(let J=0;J<2;J++){let Z=this.instructions[this.instructions.length-1-J],$=this._activePath.clone();if(Z){if(Z.action==="stroke"||Z.action==="fill")if(Z.data.hole)Z.data.hole.addPath($);else{Z.data.hole=$;break}}}return this._initNextPathLocation(),this}arc(J,Z,$,Q,N,H){this._tick++;let q=this._transform;return this._activePath.arc(q.a*J+q.c*Z+q.tx,q.b*J+q.d*Z+q.ty,$,Q,N,H),this}arcTo(J,Z,$,Q,N){this._tick++;let H=this._transform;return this._activePath.arcTo(H.a*J+H.c*Z+H.tx,H.b*J+H.d*Z+H.ty,H.a*$+H.c*Q+H.tx,H.b*$+H.d*Q+H.ty,N),this}arcToSvg(J,Z,$,Q,N,H,q){this._tick++;let _=this._transform;return this._activePath.arcToSvg(J,Z,$,Q,N,_.a*H+_.c*q+_.tx,_.b*H+_.d*q+_.ty),this}bezierCurveTo(J,Z,$,Q,N,H,q){this._tick++;let _=this._transform;return this._activePath.bezierCurveTo(_.a*J+_.c*Z+_.tx,_.b*J+_.d*Z+_.ty,_.a*$+_.c*Q+_.tx,_.b*$+_.d*Q+_.ty,_.a*N+_.c*H+_.tx,_.b*N+_.d*H+_.ty,q),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(J,Z,$,Q){return this._tick++,this._activePath.ellipse(J,Z,$,Q,this._transform.clone()),this}circle(J,Z,$){return this._tick++,this._activePath.circle(J,Z,$,this._transform.clone()),this}path(J){return this._tick++,this._activePath.addPath(J,this._transform.clone()),this}lineTo(J,Z){this._tick++;let $=this._transform;return this._activePath.lineTo($.a*J+$.c*Z+$.tx,$.b*J+$.d*Z+$.ty),this}moveTo(J,Z){this._tick++;let $=this._transform,Q=this._activePath.instructions,N=$.a*J+$.c*Z+$.tx,H=$.b*J+$.d*Z+$.ty;if(Q.length===1&&Q[0].action==="moveTo")return Q[0].data[0]=N,Q[0].data[1]=H,this;return this._activePath.moveTo(N,H),this}quadraticCurveTo(J,Z,$,Q,N){this._tick++;let H=this._transform;return this._activePath.quadraticCurveTo(H.a*J+H.c*Z+H.tx,H.b*J+H.d*Z+H.ty,H.a*$+H.c*Q+H.tx,H.b*$+H.d*Q+H.ty,N),this}rect(J,Z,$,Q){return this._tick++,this._activePath.rect(J,Z,$,Q,this._transform.clone()),this}roundRect(J,Z,$,Q,N){return this._tick++,this._activePath.roundRect(J,Z,$,Q,N,this._transform.clone()),this}poly(J,Z){return this._tick++,this._activePath.poly(J,Z,this._transform.clone()),this}regularPoly(J,Z,$,Q,N=0,H){return this._tick++,this._activePath.regularPoly(J,Z,$,Q,N,H),this}roundPoly(J,Z,$,Q,N,H){return this._tick++,this._activePath.roundPoly(J,Z,$,Q,N,H),this}roundShape(J,Z,$,Q){return this._tick++,this._activePath.roundShape(J,Z,$,Q),this}filletRect(J,Z,$,Q,N){return this._tick++,this._activePath.filletRect(J,Z,$,Q,N),this}chamferRect(J,Z,$,Q,N,H){return this._tick++,this._activePath.chamferRect(J,Z,$,Q,N,H),this}star(J,Z,$,Q,N=0,H=0){return this._tick++,this._activePath.star(J,Z,$,Q,N,H,this._transform.clone()),this}svg(J){return this._tick++,pK(J,this),this}restore(){let J=this._stateStack.pop();if(J)this._transform=J.transform,this._fillStyle=J.fillStyle,this._strokeStyle=J.strokeStyle;return this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(J){return this._transform.rotate(J),this}scale(J,Z=J){return this._transform.scale(J,Z),this}setTransform(J,Z,$,Q,N,H){if(J instanceof f)return this._transform.set(J.a,J.b,J.c,J.d,J.tx,J.ty),this;return this._transform.set(J,Z,$,Q,N,H),this}transform(J,Z,$,Q,N,H){if(J instanceof f)return this._transform.append(J),this;return sK.set(J,Z,$,Q,N,H),this._transform.append(sK),this}translate(J,Z=J){return this._transform.translate(J,Z),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){if(this._boundsDirty=!0,this.dirty)return;this.emit("update",this,16),this.dirty=!0}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=!1;let J=this._bounds;J.clear();for(let Z=0;Z<this.instructions.length;Z++){let $=this.instructions[Z],Q=$.action;if(Q==="fill"){let N=$.data;J.addBounds(N.path.bounds)}else if(Q==="texture"){let N=$.data;J.addFrame(N.dx,N.dy,N.dx+N.dw,N.dy+N.dh,N.transform)}if(Q==="stroke"){let N=$.data,H=N.style.alignment,q=N.style.width*(1-H),_=N.path.bounds;J.addFrame(_.minX-q,_.minY-q,_.maxX+q,_.maxY+q)}}return J}containsPoint(J){if(!this.bounds.containsPoint(J.x,J.y))return!1;let Z=this.instructions,$=!1;for(let Q=0;Q<Z.length;Q++){let N=Z[Q],H=N.data,q=H.path;if(!N.action||!q)continue;let _=H.style,V=q.shapePath.shapePrimitives;for(let U=0;U<V.length;U++){let z=V[U].shape;if(!_||!z)continue;let L=V[U].transform,E=L?L.applyInverse(J,gZ):J;if(N.action==="fill")$=z.contains(E.x,E.y);else{let D=_;$=z.strokeContains(E.x,E.y,D.width,D.alignment)}let I=H.hole;if(I){let D=I.shapePath?.shapePrimitives;if(D){for(let B=0;B<D.length;B++)if(D[B].shape.contains(E.x,E.y))$=!1}}if($)return!0}}return $}unload(){this.emit("unload",this);for(let J in this._gpuData)this._gpuData[J]?.destroy();this._gpuData=Object.create(null)}destroy(J=!1){if(this.destroyed)return;if(this.destroyed=!0,this._stateStack.length=0,this._transform=null,this.unload(),this.emit("destroy",this),this.removeAllListeners(),typeof J==="boolean"?J:J?.texture){let $=typeof J==="boolean"?J:J?.textureSource;if(this._fillStyle.texture)this._fillStyle.fill&&"uid"in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy($);if(this._strokeStyle.texture)this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy($)}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}};nJ.defaultFillStyle={color:16777215,alpha:1,texture:y.WHITE,matrix:null,fill:null,textureSpace:"local"};nJ.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:0.5,miterLimit:10,cap:"butt",join:"miter",texture:y.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:!1};var j7=nJ;
2
+ export{JK as ia,p as ja,bJ as ka,IJ as la,qK as ma,FJ as na,jJ as oa,QJ as pa,oJ as qa,j7 as ra};
@@ -0,0 +1 @@
1
+ import"./chunk-f3y92gm3.js";import"./chunk-5v6x1wpn.js";import"./chunk-kt3t4zv0.js";import"./chunk-kkmq6cvb.js";import"./chunk-pn7re3na.js";import"./chunk-1sw3e1ar.js";import"./chunk-dvctxyxp.js";
@@ -0,0 +1,218 @@
1
+ import{Ja as nQ,Ra as xQ,Ua as cQ,Va as kQ,Wa as pQ,kb as hQ,lb as LQ,nb as vQ,qb as BQ,rb as sQ,sb as y,tb as e,ub as mQ}from"./chunk-1sw3e1ar.js";function f(Q,W,$=2){let J=W&&W.length,Z=J?W[0]*$:Q.length,F=JQ(Q,0,Z,$,!0),K=[];if(!F||F.next===F.prev)return K;let k,R,X;if(J)F=QW(Q,W,F,$);if(Q.length>80*$){k=Q[0],R=Q[1];let U=k,D=R;for(let G=$;G<Z;G+=$){let N=Q[G],_=Q[G+1];if(N<k)k=N;if(_<R)R=_;if(N>U)U=N;if(_>D)D=_}X=Math.max(U-k,D-R),X=X!==0?32767/X:0}return w(F,K,$,k,R,X,0),K}function JQ(Q,W,$,J,Z){let F;if(Z===AW(Q,W,$,J)>0)for(let K=W;K<$;K+=J)F=$Q(K/J|0,Q[K],Q[K+1],F);else for(let K=$-J;K>=W;K-=J)F=$Q(K/J|0,Q[K],Q[K+1],F);if(F&&V(F,F.next))T(F),F=F.next;return F}function j(Q,W){if(!Q)return Q;if(!W)W=Q;let $=Q,J;do if(J=!1,!$.steiner&&(V($,$.next)||P($.prev,$,$.next)===0)){if(T($),$=W=$.prev,$===$.next)break;J=!0}else $=$.next;while(J||$!==W);return W}function w(Q,W,$,J,Z,F,K){if(!Q)return;if(!K&&F)KW(Q,J,Z,F);let k=Q;while(Q.prev!==Q.next){let{prev:R,next:X}=Q;if(F?aQ(Q,J,Z,F):iQ(Q)){W.push(R.i,Q.i,X.i),T(Q),Q=X.next,k=X.next;continue}if(Q=X,Q===k){if(!K)w(j(Q),W,$,J,Z,F,1);else if(K===1)Q=tQ(j(Q),W),w(Q,W,$,J,Z,F,2);else if(K===2)eQ(Q,W,$,J,Z,F);break}}}function iQ(Q){let W=Q.prev,$=Q,J=Q.next;if(P(W,$,J)>=0)return!1;let Z=W.x,F=$.x,K=J.x,k=W.y,R=$.y,X=J.y,U=Math.min(Z,F,K),D=Math.min(k,R,X),G=Math.max(Z,F,K),N=Math.max(k,R,X),_=J.next;while(_!==W){if(_.x>=U&&_.x<=G&&_.y>=D&&_.y<=N&&M(Z,k,F,R,K,X,_.x,_.y)&&P(_.prev,_,_.next)>=0)return!1;_=_.next}return!0}function aQ(Q,W,$,J){let Z=Q.prev,F=Q,K=Q.next;if(P(Z,F,K)>=0)return!1;let k=Z.x,R=F.x,X=K.x,U=Z.y,D=F.y,G=K.y,N=Math.min(k,R,X),_=Math.min(U,D,G),C=Math.max(k,R,X),q=Math.max(U,D,G),A=c(N,_,W,$,J),L=c(C,q,W,$,J),Y=Q.prevZ,H=Q.nextZ;while(Y&&Y.z>=A&&H&&H.z<=L){if(Y.x>=N&&Y.x<=C&&Y.y>=_&&Y.y<=q&&Y!==Z&&Y!==K&&M(k,U,R,D,X,G,Y.x,Y.y)&&P(Y.prev,Y,Y.next)>=0)return!1;if(Y=Y.prevZ,H.x>=N&&H.x<=C&&H.y>=_&&H.y<=q&&H!==Z&&H!==K&&M(k,U,R,D,X,G,H.x,H.y)&&P(H.prev,H,H.next)>=0)return!1;H=H.nextZ}while(Y&&Y.z>=A){if(Y.x>=N&&Y.x<=C&&Y.y>=_&&Y.y<=q&&Y!==Z&&Y!==K&&M(k,U,R,D,X,G,Y.x,Y.y)&&P(Y.prev,Y,Y.next)>=0)return!1;Y=Y.prevZ}while(H&&H.z<=L){if(H.x>=N&&H.x<=C&&H.y>=_&&H.y<=q&&H!==Z&&H!==K&&M(k,U,R,D,X,G,H.x,H.y)&&P(H.prev,H,H.next)>=0)return!1;H=H.nextZ}return!0}function tQ(Q,W){let $=Q;do{let J=$.prev,Z=$.next.next;if(!V(J,Z)&&KQ(J,$,$.next,Z)&&O(J,Z)&&O(Z,J))W.push(J.i,$.i,Z.i),T($),T($.next),$=Q=Z;$=$.next}while($!==Q);return j($)}function eQ(Q,W,$,J,Z,F){let K=Q;do{let k=K.next.next;while(k!==K.prev){if(K.i!==k.i&&RW(K,k)){let R=FQ(K,k);K=j(K,K.next),R=j(R,R.next),w(K,W,$,J,Z,F,0),w(R,W,$,J,Z,F,0);return}k=k.next}K=K.next}while(K!==Q)}function QW(Q,W,$,J){let Z=[];for(let F=0,K=W.length;F<K;F++){let k=W[F]*J,R=F<K-1?W[F+1]*J:Q.length,X=JQ(Q,k,R,J,!1);if(X===X.next)X.steiner=!0;Z.push(kW(X))}Z.sort(WW);for(let F=0;F<Z.length;F++)$=$W(Z[F],$);return $}function WW(Q,W){let $=Q.x-W.x;if($===0){if($=Q.y-W.y,$===0){let J=(Q.next.y-Q.y)/(Q.next.x-Q.x),Z=(W.next.y-W.y)/(W.next.x-W.x);$=J-Z}}return $}function $W(Q,W){let $=JW(Q,W);if(!$)return W;let J=FQ($,Q);return j(J,J.next),j($,$.next)}function JW(Q,W){let $=W,J=Q.x,Z=Q.y,F=-1/0,K;if(V(Q,$))return $;do{if(V(Q,$.next))return $.next;else if(Z<=$.y&&Z>=$.next.y&&$.next.y!==$.y){let D=$.x+(Z-$.y)*($.next.x-$.x)/($.next.y-$.y);if(D<=J&&D>F){if(F=D,K=$.x<$.next.x?$:$.next,D===J)return K}}$=$.next}while($!==W);if(!K)return null;let k=K,R=K.x,X=K.y,U=1/0;$=K;do{if(J>=$.x&&$.x>=R&&J!==$.x&&ZQ(Z<X?J:F,Z,R,X,Z<X?F:J,Z,$.x,$.y)){let D=Math.abs(Z-$.y)/(J-$.x);if(O($,Q)&&(D<U||D===U&&($.x>K.x||$.x===K.x&&ZW(K,$))))K=$,U=D}$=$.next}while($!==k);return K}function ZW(Q,W){return P(Q.prev,Q,W.prev)<0&&P(W.next,Q,Q.next)<0}function KW(Q,W,$,J){let Z=Q;do{if(Z.z===0)Z.z=c(Z.x,Z.y,W,$,J);Z.prevZ=Z.prev,Z.nextZ=Z.next,Z=Z.next}while(Z!==Q);Z.prevZ.nextZ=null,Z.prevZ=null,FW(Z)}function FW(Q){let W,$=1;do{let J=Q,Z;Q=null;let F=null;W=0;while(J){W++;let K=J,k=0;for(let X=0;X<$;X++)if(k++,K=K.nextZ,!K)break;let R=$;while(k>0||R>0&&K){if(k!==0&&(R===0||!K||J.z<=K.z))Z=J,J=J.nextZ,k--;else Z=K,K=K.nextZ,R--;if(F)F.nextZ=Z;else Q=Z;Z.prevZ=F,F=Z}J=K}F.nextZ=null,$*=2}while(W>1);return Q}function c(Q,W,$,J,Z){return Q=(Q-$)*Z|0,W=(W-J)*Z|0,Q=(Q|Q<<8)&16711935,Q=(Q|Q<<4)&252645135,Q=(Q|Q<<2)&858993459,Q=(Q|Q<<1)&1431655765,W=(W|W<<8)&16711935,W=(W|W<<4)&252645135,W=(W|W<<2)&858993459,W=(W|W<<1)&1431655765,Q|W<<1}function kW(Q){let W=Q,$=Q;do{if(W.x<$.x||W.x===$.x&&W.y<$.y)$=W;W=W.next}while(W!==Q);return $}function ZQ(Q,W,$,J,Z,F,K,k){return(Z-K)*(W-k)>=(Q-K)*(F-k)&&(Q-K)*(J-k)>=($-K)*(W-k)&&($-K)*(F-k)>=(Z-K)*(J-k)}function M(Q,W,$,J,Z,F,K,k){return!(Q===K&&W===k)&&ZQ(Q,W,$,J,Z,F,K,k)}function RW(Q,W){return Q.next.i!==W.i&&Q.prev.i!==W.i&&!XW(Q,W)&&(O(Q,W)&&O(W,Q)&&YW(Q,W)&&(P(Q.prev,Q,W.prev)||P(Q,W.prev,W))||V(Q,W)&&P(Q.prev,Q,Q.next)>0&&P(W.prev,W,W.next)>0)}function P(Q,W,$){return(W.y-Q.y)*($.x-W.x)-(W.x-Q.x)*($.y-W.y)}function V(Q,W){return Q.x===W.x&&Q.y===W.y}function KQ(Q,W,$,J){let Z=h(P(Q,W,$)),F=h(P(Q,W,J)),K=h(P($,J,Q)),k=h(P($,J,W));if(Z!==F&&K!==k)return!0;if(Z===0&&g(Q,$,W))return!0;if(F===0&&g(Q,J,W))return!0;if(K===0&&g($,Q,J))return!0;if(k===0&&g($,W,J))return!0;return!1}function g(Q,W,$){return W.x<=Math.max(Q.x,$.x)&&W.x>=Math.min(Q.x,$.x)&&W.y<=Math.max(Q.y,$.y)&&W.y>=Math.min(Q.y,$.y)}function h(Q){return Q>0?1:Q<0?-1:0}function XW(Q,W){let $=Q;do{if($.i!==Q.i&&$.next.i!==Q.i&&$.i!==W.i&&$.next.i!==W.i&&KQ($,$.next,Q,W))return!0;$=$.next}while($!==Q);return!1}function O(Q,W){return P(Q.prev,Q,Q.next)<0?P(Q,W,Q.next)>=0&&P(Q,Q.prev,W)>=0:P(Q,W,Q.prev)<0||P(Q,Q.next,W)<0}function YW(Q,W){let $=Q,J=!1,Z=(Q.x+W.x)/2,F=(Q.y+W.y)/2;do{if($.y>F!==$.next.y>F&&$.next.y!==$.y&&Z<($.next.x-$.x)*(F-$.y)/($.next.y-$.y)+$.x)J=!J;$=$.next}while($!==Q);return J}function FQ(Q,W){let $=p(Q.i,Q.x,Q.y),J=p(W.i,W.x,W.y),Z=Q.next,F=W.prev;return Q.next=W,W.prev=Q,$.next=Z,Z.prev=$,J.next=$,$.prev=J,F.next=J,J.prev=F,J}function $Q(Q,W,$,J){let Z=p(Q,W,$);if(!J)Z.prev=Z,Z.next=Z;else Z.next=J.next,Z.prev=J,J.next.prev=Z,J.next=Z;return Z}function T(Q){if(Q.next.prev=Q.prev,Q.prev.next=Q.next,Q.prevZ)Q.prevZ.nextZ=Q.nextZ;if(Q.nextZ)Q.nextZ.prevZ=Q.prevZ}function p(Q,W,$){return{i:Q,x:W,y:$,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function AW(Q,W,$,J){let Z=0;for(let F=W,K=$-J;F<$;F+=J)Z+=(Q[K]-Q[F])*(Q[F+1]+Q[K+1]),K=F;return Z}var OW=f.default||f;function o(Q,W,$){if(Q)for(let J in Q){let Z=J.toLocaleLowerCase(),F=W[Z];if(F){let K=Q[J];if(J==="header")K=K.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"");if($)F.push(`//----${$}----//`);F.push(K)}else kQ(`${J} placement hook does not exist in shader`)}}var HW=/\{\{(.*?)\}\}/g;function d(Q){let W={};return(Q.match(HW)?.map((J)=>J.replace(/[{()}]/g,""))??[]).forEach((J)=>{W[J]=[]}),W}function RQ(Q,W){let $,J=/@in\s+([^;]+);/g;while(($=J.exec(Q))!==null)W.push($[1])}function l(Q,W,$=!1){let J=[];RQ(W,J),Q.forEach((k)=>{if(k.header)RQ(k.header,J)});let Z=J;if($)Z.sort();let F=Z.map((k,R)=>` @location(${R}) ${k},`).join(`
2
+ `),K=W.replace(/@in\s+[^;]+;\s*/g,"");return K=K.replace("{{in}}",`
3
+ ${F}
4
+ `),K}function XQ(Q,W){let $,J=/@out\s+([^;]+);/g;while(($=J.exec(Q))!==null)W.push($[1])}function _W(Q){let $=/\b(\w+)\s*:/g.exec(Q);return $?$[1]:""}function DW(Q){let W=/@.*?\s+/g;return Q.replace(W,"")}function YQ(Q,W){let $=[];XQ(W,$),Q.forEach((R)=>{if(R.header)XQ(R.header,$)});let J=0,Z=$.sort().map((R)=>{if(R.indexOf("builtin")>-1)return R;return`@location(${J++}) ${R}`}).join(`,
5
+ `),F=$.sort().map((R)=>` var ${DW(R)};`).join(`
6
+ `),K=`return VSOutput(
7
+ ${$.sort().map((R)=>` ${_W(R)}`).join(`,
8
+ `)});`,k=W.replace(/@out\s+[^;]+;\s*/g,"");return k=k.replace("{{struct}}",`
9
+ ${Z}
10
+ `),k=k.replace("{{start}}",`
11
+ ${F}
12
+ `),k=k.replace("{{return}}",`
13
+ ${K}
14
+ `),k}function m(Q,W){let $=Q;for(let J in W){let Z=W[J];if(Z.join(`
15
+ `).length)$=$.replace(`{{${J}}}`,`//-----${J} START-----//
16
+ ${Z.join(`
17
+ `)}
18
+ //----${J} FINISH----//`);else $=$.replace(`{{${J}}}`,"")}return $}var E=Object.create(null),s=new Map,UW=0;function AQ({template:Q,bits:W}){let $=_Q(Q,W);if(E[$])return E[$];let{vertex:J,fragment:Z}=GW(Q,W);return E[$]=DQ(J,Z,W),E[$]}function HQ({template:Q,bits:W}){let $=_Q(Q,W);if(E[$])return E[$];return E[$]=DQ(Q.vertex,Q.fragment,W),E[$]}function GW(Q,W){let $=W.map((K)=>K.vertex).filter((K)=>!!K),J=W.map((K)=>K.fragment).filter((K)=>!!K),Z=l($,Q.vertex,!0);Z=YQ($,Z);let F=l(J,Q.fragment,!0);return{vertex:Z,fragment:F}}function _Q(Q,W){return W.map(($)=>{if(!s.has($))s.set($,UW++);return s.get($)}).sort(($,J)=>$-J).join("-")+Q.vertex+Q.fragment}function DQ(Q,W,$){let J=d(Q),Z=d(W);return $.forEach((F)=>{o(F.vertex,J,F.name),o(F.fragment,Z,F.name)}),{vertex:m(Q,J),fragment:m(W,Z)}}var UQ=`
19
+ @in aPosition: vec2<f32>;
20
+ @in aUV: vec2<f32>;
21
+
22
+ @out @builtin(position) vPosition: vec4<f32>;
23
+ @out vUV : vec2<f32>;
24
+ @out vColor : vec4<f32>;
25
+
26
+ {{header}}
27
+
28
+ struct VSOutput {
29
+ {{struct}}
30
+ };
31
+
32
+ @vertex
33
+ fn main( {{in}} ) -> VSOutput {
34
+
35
+ var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;
36
+ var modelMatrix = mat3x3<f32>(
37
+ 1.0, 0.0, 0.0,
38
+ 0.0, 1.0, 0.0,
39
+ 0.0, 0.0, 1.0
40
+ );
41
+ var position = aPosition;
42
+ var uv = aUV;
43
+
44
+ {{start}}
45
+
46
+ vColor = vec4<f32>(1., 1., 1., 1.);
47
+
48
+ {{main}}
49
+
50
+ vUV = uv;
51
+
52
+ var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;
53
+
54
+ vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);
55
+
56
+ vColor *= globalUniforms.uWorldColorAlpha;
57
+
58
+ {{end}}
59
+
60
+ {{return}}
61
+ };
62
+ `,GQ=`
63
+ @in vUV : vec2<f32>;
64
+ @in vColor : vec4<f32>;
65
+
66
+ {{header}}
67
+
68
+ @fragment
69
+ fn main(
70
+ {{in}}
71
+ ) -> @location(0) vec4<f32> {
72
+
73
+ {{start}}
74
+
75
+ var outColor:vec4<f32>;
76
+
77
+ {{main}}
78
+
79
+ var finalColor:vec4<f32> = outColor * vColor;
80
+
81
+ {{end}}
82
+
83
+ return finalColor;
84
+ };
85
+ `,NQ=`
86
+ in vec2 aPosition;
87
+ in vec2 aUV;
88
+
89
+ out vec4 vColor;
90
+ out vec2 vUV;
91
+
92
+ {{header}}
93
+
94
+ void main(void){
95
+
96
+ mat3 worldTransformMatrix = uWorldTransformMatrix;
97
+ mat3 modelMatrix = mat3(
98
+ 1.0, 0.0, 0.0,
99
+ 0.0, 1.0, 0.0,
100
+ 0.0, 0.0, 1.0
101
+ );
102
+ vec2 position = aPosition;
103
+ vec2 uv = aUV;
104
+
105
+ {{start}}
106
+
107
+ vColor = vec4(1.);
108
+
109
+ {{main}}
110
+
111
+ vUV = uv;
112
+
113
+ mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;
114
+
115
+ gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
116
+
117
+ vColor *= uWorldColorAlpha;
118
+
119
+ {{end}}
120
+ }
121
+ `,PQ=`
122
+
123
+ in vec4 vColor;
124
+ in vec2 vUV;
125
+
126
+ out vec4 finalColor;
127
+
128
+ {{header}}
129
+
130
+ void main(void) {
131
+
132
+ {{start}}
133
+
134
+ vec4 outColor;
135
+
136
+ {{main}}
137
+
138
+ finalColor = outColor * vColor;
139
+
140
+ {{end}}
141
+ }
142
+ `;var qQ={name:"global-uniforms-bit",vertex:{header:`
143
+ struct GlobalUniforms {
144
+ uProjectionMatrix:mat3x3<f32>,
145
+ uWorldTransformMatrix:mat3x3<f32>,
146
+ uWorldColorAlpha: vec4<f32>,
147
+ uResolution: vec2<f32>,
148
+ }
149
+
150
+ @group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;
151
+ `}};var CQ={name:"global-uniforms-bit",vertex:{header:`
152
+ uniform mat3 uProjectionMatrix;
153
+ uniform mat3 uWorldTransformMatrix;
154
+ uniform vec4 uWorldColorAlpha;
155
+ uniform vec2 uResolution;
156
+ `}};function EQ({bits:Q,name:W}){let $=AQ({template:{fragment:GQ,vertex:UQ},bits:[qQ,...Q]});return vQ.from({name:W,vertex:{source:$.vertex,entryPoint:"main"},fragment:{source:$.fragment,entryPoint:"main"}})}function jQ({bits:Q,name:W}){return new LQ({name:W,...HQ({template:{vertex:NQ,fragment:PQ},bits:[CQ,...Q]})})}var VQ={name:"color-bit",vertex:{header:`
157
+ @in aColor: vec4<f32>;
158
+ `,main:`
159
+ vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);
160
+ `}},zQ={name:"color-bit",vertex:{header:`
161
+ in vec4 aColor;
162
+ `,main:`
163
+ vColor *= vec4(aColor.rgb * aColor.a, aColor.a);
164
+ `}};var n={};function NW(Q){let W=[];if(Q===1)W.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),W.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let $=0;for(let J=0;J<Q;J++)W.push(`@group(1) @binding(${$++}) var textureSource${J+1}: texture_2d<f32>;`),W.push(`@group(1) @binding(${$++}) var textureSampler${J+1}: sampler;`)}return W.join(`
165
+ `)}function PW(Q){let W=[];if(Q===1)W.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{W.push("switch vTextureId {");for(let $=0;$<Q;$++){if($===Q-1)W.push(" default:{");else W.push(` case ${$}:{`);W.push(` outColor = textureSampleGrad(textureSource${$+1}, textureSampler${$+1}, vUV, uvDx, uvDy);`),W.push(" break;}")}W.push("}")}return W.join(`
166
+ `)}function MQ(Q){if(!n[Q])n[Q]={name:"texture-batch-bit",vertex:{header:`
167
+ @in aTextureIdAndRound: vec2<u32>;
168
+ @out @interpolate(flat) vTextureId : u32;
169
+ `,main:`
170
+ vTextureId = aTextureIdAndRound.y;
171
+ `,end:`
172
+ if(aTextureIdAndRound.x == 1)
173
+ {
174
+ vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
175
+ }
176
+ `},fragment:{header:`
177
+ @in @interpolate(flat) vTextureId: u32;
178
+
179
+ ${NW(Q)}
180
+ `,main:`
181
+ var uvDx = dpdx(vUV);
182
+ var uvDy = dpdy(vUV);
183
+
184
+ ${PW(Q)}
185
+ `}};return n[Q]}var r={};function qW(Q){let W=[];for(let $=0;$<Q;$++){if($>0)W.push("else");if($<Q-1)W.push(`if(vTextureId < ${$}.5)`);W.push("{"),W.push(` outColor = texture(uTextures[${$}], vUV);`),W.push("}")}return W.join(`
186
+ `)}function wQ(Q){if(!r[Q])r[Q]={name:"texture-batch-bit",vertex:{header:`
187
+ in vec2 aTextureIdAndRound;
188
+ out float vTextureId;
189
+
190
+ `,main:`
191
+ vTextureId = aTextureIdAndRound.y;
192
+ `,end:`
193
+ if(aTextureIdAndRound.x == 1.)
194
+ {
195
+ gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
196
+ }
197
+ `},fragment:{header:`
198
+ in float vTextureId;
199
+
200
+ uniform sampler2D uTextures[${Q}];
201
+
202
+ `,main:`
203
+
204
+ ${qW(Q)}
205
+ `}};return r[Q]}var OQ={name:"round-pixels-bit",vertex:{header:`
206
+ fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>
207
+ {
208
+ return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
209
+ }
210
+ `}},TQ={name:"round-pixels-bit",vertex:{header:`
211
+ vec2 roundPixels(vec2 position, vec2 targetSize)
212
+ {
213
+ return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
214
+ }
215
+ `}};function i(Q,W,$,J){if($??($=0),J??(J=Math.min(Q.byteLength-$,W.byteLength)),!($&7)&&!(J&7)){let Z=J/8;new Float64Array(W,0,Z).set(new Float64Array(Q,$,Z))}else if(!($&3)&&!(J&3)){let Z=J/4;new Float32Array(W,0,Z).set(new Float32Array(Q,$,Z))}else new Uint8Array(W).set(new Uint8Array(Q,$,J))}var IQ={normal:"normal-npm",add:"add-npm",screen:"screen-npm"},CW=((Q)=>{return Q[Q.DISABLED=0]="DISABLED",Q[Q.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",Q[Q.MASK_ACTIVE=2]="MASK_ACTIVE",Q[Q.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",Q[Q.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",Q[Q.NONE=5]="NONE",Q})(CW||{});var LW=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
216
+ `);function vW(Q){let W="";for(let $=0;$<Q;++$){if($>0)W+=`
217
+ else `;if($<Q-1)W+=`if(test == ${$}.0){}`}return W}function SQ(Q,W){if(Q===0)throw Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");let $=W.createShader(W.FRAGMENT_SHADER);try{while(!0){let J=LW.replace(/%forloop%/gi,vW(Q));if(W.shaderSource($,J),W.compileShader($),!W.getShaderParameter($,W.COMPILE_STATUS))Q=Q/2|0;else break}}finally{W.deleteShader($)}return Q}var yQ={};function gQ(Q){let W=yQ[Q];if(W)return W;let $=new Int32Array(Q);for(let J=0;J<Q;J++)$[J]=J;return W=yQ[Q]=new BQ({uTextures:{value:$,type:"i32",size:Q}},{isStatic:!0}),W}class b{constructor(Q){if(typeof Q==="number")this.rawBinaryData=new ArrayBuffer(Q);else if(Q instanceof Uint8Array)this.rawBinaryData=Q.buffer;else this.rawBinaryData=Q;this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){if(!this._int8View)this._int8View=new Int8Array(this.rawBinaryData);return this._int8View}get uint8View(){if(!this._uint8View)this._uint8View=new Uint8Array(this.rawBinaryData);return this._uint8View}get int16View(){if(!this._int16View)this._int16View=new Int16Array(this.rawBinaryData);return this._int16View}get int32View(){if(!this._int32View)this._int32View=new Int32Array(this.rawBinaryData);return this._int32View}get float64View(){if(!this._float64Array)this._float64Array=new Float64Array(this.rawBinaryData);return this._float64Array}get bigUint64View(){if(!this._bigUint64Array)this._bigUint64Array=new BigUint64Array(this.rawBinaryData);return this._bigUint64Array}view(Q){return this[`${Q}View`]}destroy(){this.rawBinaryData=null,this.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=null}static sizeOf(Q){switch(Q){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw Error(`${Q} isn't a valid view type`)}}}function a(Q,W){if(W.alphaMode==="no-premultiply-alpha")return IQ[Q]||Q;return Q}var z=null;function fQ(){if(z)return z;let Q=hQ();return z=Q.getParameter(Q.MAX_TEXTURE_IMAGE_UNITS),z=SQ(z,Q),Q.getExtension("WEBGL_lose_context")?.loseContext(),z}class t{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let Q=0;Q<this.count;Q++){let W=this.textures[Q];this.textures[Q]=null,this.ids[W.uid]=null}this.count=0}}class oQ{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new t,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=!0}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null,this.elements=null}}var S=[],u=0;pQ.register({clear:()=>{if(S.length>0){for(let Q of S)if(Q)Q.destroy()}S.length=0,u=0}});function bQ(){return u>0?S[--u]:new oQ}function uQ(Q){Q.elements=null,S[u++]=Q}var I=0,dQ=class Q{constructor(W){if(this.uid=xQ("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],W={...Q.defaultOptions,...W},!W.maxTextures)cQ("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),W.maxTextures=fQ();let{maxTextures:$,attributesInitialSize:J,indicesInitialSize:Z}=W;this.attributeBuffer=new b(J*4),this.indexBuffer=new Uint16Array(Z),this.maxTextures=$}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let W=0;W<this.batchIndex;W++)uQ(this.batches[W]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(W){this._elements[this.elementSize++]=W,W._indexStart=this.indexSize,W._attributeStart=this.attributeSize,W._batcher=this,this.indexSize+=W.indexSize,this.attributeSize+=W.attributeSize*this.vertexSize}checkAndUpdateTexture(W,$){let J=W._batch.textures.ids[$._source.uid];if(!J&&J!==0)return!1;return W._textureId=J,W.texture=$,!0}updateElement(W){this.dirty=!0;let $=this.attributeBuffer;if(W.packAsQuad)this.packQuadAttributes(W,$.float32View,$.uint32View,W._attributeStart,W._textureId);else this.packAttributes(W,$.float32View,$.uint32View,W._attributeStart,W._textureId)}break(W){let $=this._elements;if(!$[this.elementStart])return;let J=bQ(),Z=J.textures;Z.clear();let F=$[this.elementStart],K=a(F.blendMode,F.texture._source),k=F.topology;if(this.attributeSize*4>this.attributeBuffer.size)this._resizeAttributeBuffer(this.attributeSize*4);if(this.indexSize>this.indexBuffer.length)this._resizeIndexBuffer(this.indexSize);let R=this.attributeBuffer.float32View,X=this.attributeBuffer.uint32View,U=this.indexBuffer,D=this._batchIndexSize,G=this._batchIndexStart,N="startBatch",_=[],C=this.maxTextures;for(let q=this.elementStart;q<this.elementSize;++q){let A=$[q];$[q]=null;let Y=A.texture._source,H=a(A.blendMode,Y),v=K!==H||k!==A.topology;if(Y._batchTick===I&&!v){if(A._textureId=Y._textureBindLocation,D+=A.indexSize,A.packAsQuad)this.packQuadAttributes(A,R,X,A._attributeStart,A._textureId),this.packQuadIndex(U,A._indexStart,A._attributeStart/this.vertexSize);else this.packAttributes(A,R,X,A._attributeStart,A._textureId),this.packIndex(A,U,A._indexStart,A._attributeStart/this.vertexSize);A._batch=J,_.push(A);continue}if(Y._batchTick=I,Z.count>=C||v)this._finishBatch(J,G,D-G,Z,K,k,W,N,_),N="renderBatch",G=D,K=H,k=A.topology,J=bQ(),Z=J.textures,Z.clear(),_=[],++I;if(A._textureId=Y._textureBindLocation=Z.count,Z.ids[Y.uid]=Z.count,Z.textures[Z.count++]=Y,A._batch=J,_.push(A),D+=A.indexSize,A.packAsQuad)this.packQuadAttributes(A,R,X,A._attributeStart,A._textureId),this.packQuadIndex(U,A._indexStart,A._attributeStart/this.vertexSize);else this.packAttributes(A,R,X,A._attributeStart,A._textureId),this.packIndex(A,U,A._indexStart,A._attributeStart/this.vertexSize)}if(Z.count>0)this._finishBatch(J,G,D-G,Z,K,k,W,N,_),G=D,++I;this.elementStart=this.elementSize,this._batchIndexStart=G,this._batchIndexSize=D}_finishBatch(W,$,J,Z,F,K,k,R,X){W.gpuBindGroup=null,W.bindGroup=null,W.action=R,W.batcher=this,W.textures=Z,W.blendMode=F,W.topology=K,W.start=$,W.size=J,W.elements=X,++I,this.batches[this.batchIndex++]=W,k.add(W)}finish(W){this.break(W)}ensureAttributeBuffer(W){if(W*4<=this.attributeBuffer.size)return;this._resizeAttributeBuffer(W*4)}ensureIndexBuffer(W){if(W<=this.indexBuffer.length)return;this._resizeIndexBuffer(W)}_resizeAttributeBuffer(W){let $=Math.max(W,this.attributeBuffer.size*2),J=new b($);i(this.attributeBuffer.rawBinaryData,J.rawBinaryData),this.attributeBuffer=J}_resizeIndexBuffer(W){let $=this.indexBuffer,J=Math.max(W,$.length*1.5);J+=J%2;let Z=J>65535?new Uint32Array(J):new Uint16Array(J);if(Z.BYTES_PER_ELEMENT!==$.BYTES_PER_ELEMENT)for(let F=0;F<$.length;F++)Z[F]=$[F];else i($.buffer,Z.buffer);this.indexBuffer=Z}packQuadIndex(W,$,J){W[$]=J+0,W[$+1]=J+1,W[$+2]=J+2,W[$+3]=J+0,W[$+4]=J+2,W[$+5]=J+3}packIndex(W,$,J,Z){let{indices:F,indexSize:K,indexOffset:k,attributeOffset:R}=W;for(let X=0;X<K;X++)$[J++]=Z+F[X+k]-R}destroy(W={}){if(this.batches===null)return;for(let $=0;$<this.batchIndex;$++)uQ(this.batches[$]);if(this.batches=null,this.geometry.destroy(!0),this.geometry=null,W.shader)this.shader?.destroy(),this.shader=null;for(let $=0;$<this._elements.length;$++)if(this._elements[$])this._elements[$]._batch=null;this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}};dQ.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};var lQ=dQ;var EW=new Float32Array(1),jW=new Uint32Array(1);class QQ extends mQ{constructor(){let W=new e({data:EW,label:"attribute-batch-buffer",usage:y.VERTEX|y.COPY_DST,shrinkToFit:!1}),$=new e({data:jW,label:"index-batch-buffer",usage:y.INDEX|y.COPY_DST,shrinkToFit:!1}),J=24;super({attributes:{aPosition:{buffer:W,format:"float32x2",stride:24,offset:0},aUV:{buffer:W,format:"float32x2",stride:24,offset:8},aColor:{buffer:W,format:"unorm8x4",stride:24,offset:16},aTextureIdAndRound:{buffer:W,format:"uint16x2",stride:24,offset:20}},indexBuffer:$})}}class x extends sQ{constructor(Q){let W=jQ({name:"batch",bits:[zQ,wQ(Q),TQ]}),$=EQ({name:"batch",bits:[VQ,MQ(Q),OQ]});super({glProgram:W,gpuProgram:$,resources:{batchSamplers:gQ(Q)}});this.maxTextures=Q}}var B=null,rQ=class Q extends lQ{constructor(W){super(W);this.geometry=new QQ,this.name=Q.extension.name,this.vertexSize=6,B??(B=new x(W.maxTextures)),this.shader=B}packAttributes(W,$,J,Z,F){let K=F<<16|W.roundPixels&65535,k=W.transform,R=k.a,X=k.b,U=k.c,D=k.d,G=k.tx,N=k.ty,{positions:_,uvs:C}=W,q=W.color,A=W.attributeOffset,L=A+W.attributeSize;for(let Y=A;Y<L;Y++){let H=Y*2,v=_[H],WQ=_[H+1];$[Z++]=R*v+U*WQ+G,$[Z++]=D*WQ+X*v+N,$[Z++]=C[H],$[Z++]=C[H+1],J[Z++]=q,J[Z++]=K}}packQuadAttributes(W,$,J,Z,F){let{texture:K,transform:k}=W,R=k.a,X=k.b,U=k.c,D=k.d,G=k.tx,N=k.ty,_=W.bounds,C=_.maxX,q=_.minX,A=_.maxY,L=_.minY,Y=K.uvs,H=W.color,v=F<<16|W.roundPixels&65535;$[Z+0]=R*q+U*L+G,$[Z+1]=D*L+X*q+N,$[Z+2]=Y.x0,$[Z+3]=Y.y0,J[Z+4]=H,J[Z+5]=v,$[Z+6]=R*C+U*L+G,$[Z+7]=D*L+X*C+N,$[Z+8]=Y.x1,$[Z+9]=Y.y1,J[Z+10]=H,J[Z+11]=v,$[Z+12]=R*C+U*A+G,$[Z+13]=D*A+X*C+N,$[Z+14]=Y.x2,$[Z+15]=Y.y2,J[Z+16]=H,J[Z+17]=v,$[Z+18]=R*q+U*A+G,$[Z+19]=D*A+X*q+N,$[Z+20]=Y.x3,$[Z+21]=Y.y3,J[Z+22]=H,J[Z+23]=v}_updateMaxTextures(W){if(this.shader.maxTextures===W)return;B=new x(W),this.shader=B}destroy(){this.shader=null,super.destroy()}};rQ.extension={type:[nQ.Batcher],name:"default"};var f0=rQ;class VW{constructor(Q){this.items=Object.create(null);let{renderer:W,type:$,onUnload:J,priority:Z,name:F}=Q;this._renderer=W,W.gc.addResourceHash(this,"items",$,Z??0),this._onUnload=J,this.name=F}add(Q){if(this.items[Q.uid])return!1;return this.items[Q.uid]=Q,Q.once("unload",this.remove,this),Q._gcLastUsed=this._renderer.gc.now,!0}remove(Q,...W){if(!this.items[Q.uid])return;let $=Q._gpuData[this._renderer.uid];if(!$)return;this._onUnload?.(Q,...W),$.destroy(),Q._gpuData[this._renderer.uid]=null,this.items[Q.uid]=null}removeAll(...Q){Object.values(this.items).forEach((W)=>W&&this.remove(W,...Q))}destroy(...Q){this.removeAll(...Q),this.items=Object.create(null),this._renderer=null,this._onUnload=null}}
218
+ export{OW as ua,EQ as va,jQ as wa,VQ as xa,zQ as ya,MQ as za,wQ as Aa,OQ as Ba,TQ as Ca,i as Da,CW as Ea,SQ as Fa,gQ as Ga,f0 as Ha,VW as Ia};
@@ -0,0 +1 @@
1
+ import{ea as a}from"./chunk-5evxnj3k.js";import"./chunk-kkmq6cvb.js";import"./chunk-fsbv6vcn.js";import"./chunk-rp8z1jh7.js";import"./chunk-pn7re3na.js";import"./chunk-0e4ebmdy.js";import"./chunk-sngkm5ds.js";import"./chunk-1sw3e1ar.js";import"./chunk-dvctxyxp.js";export{a as BitmapFont};