@rel-packages/osu-beatmap-preview 0.11.6 → 0.12.0
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/assets/default_skin_archive.d.ts +1 -1
- package/dist/{chunk-zc79wdxj.js → chunk-029sagwa.js} +2 -2
- package/dist/{chunk-fsbv6vcn.js → chunk-0we37sfj.js} +2 -2
- package/dist/chunk-1d7vwgnw.js +15 -0
- package/dist/chunk-3baewprq.js +1 -0
- package/dist/{chunk-0e4ebmdy.js → chunk-3wjb2nvs.js} +2 -2
- package/dist/{chunk-pn7re3na.js → chunk-598ehnf5.js} +2 -2
- package/dist/{chunk-sngkm5ds.js → chunk-8wvq4dfz.js} +2 -2
- package/dist/{chunk-rp8z1jh7.js → chunk-aeeawe99.js} +2 -2
- package/dist/chunk-amhps2v2.js +1 -0
- package/dist/chunk-bxvb53d0.js +1 -0
- package/dist/{chunk-dvctxyxp.js → chunk-cs4e65d1.js} +1 -1
- package/dist/chunk-d7xgaxzy.js +1 -0
- package/dist/chunk-gsjxh2hw.js +1 -0
- package/dist/chunk-hbfgn274.js +1 -0
- package/dist/{chunk-kkmq6cvb.js → chunk-jyb1nvnr.js} +2 -2
- package/dist/chunk-n2mqbpq5.js +11 -0
- package/dist/chunk-p0te881m.js +1 -0
- package/dist/{chunk-5v6x1wpn.js → chunk-shgm3fs6.js} +2 -2
- package/dist/{chunk-1sw3e1ar.js → chunk-sqnzgty6.js} +5 -5
- package/dist/{chunk-vzfdvw38.js → chunk-tj1dwy5a.js} +1 -1
- package/dist/{chunk-eb5gmq04.js → chunk-tqbn5m4a.js} +2 -2
- package/dist/{chunk-edbhr7zr.js → chunk-vkkhj28s.js} +2 -2
- package/dist/chunk-w1tshfsy.js +2 -0
- package/dist/chunk-xtab1dnq.js +1 -0
- package/dist/{chunk-a7wf9wxx.js → chunk-z898rh1p.js} +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/parser/osz_loader.d.ts.map +1 -1
- package/dist/player/audio_engine.d.ts +93 -0
- package/dist/player/audio_engine.d.ts.map +1 -0
- package/dist/player/player.d.ts +6 -15
- package/dist/player/player.d.ts.map +1 -1
- package/dist/player/player_hitsound.d.ts +20 -3
- package/dist/player/player_hitsound.d.ts.map +1 -1
- package/dist/renderer/backend/pixi_backend.d.ts +3 -0
- package/dist/renderer/backend/pixi_backend.d.ts.map +1 -1
- package/dist/renderer/backend/render_backend.d.ts +1 -0
- package/dist/renderer/backend/render_backend.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-21p7cseg.js +0 -1
- package/dist/chunk-525kvqgh.js +0 -1
- package/dist/chunk-5evxnj3k.js +0 -9
- package/dist/chunk-7qazncxz.js +0 -15
- package/dist/chunk-ay0z741j.js +0 -1
- package/dist/chunk-ef1ghrsq.js +0 -1
- package/dist/chunk-f3y92gm3.js +0 -1
- package/dist/chunk-kmf5rpya.js +0 -1
- package/dist/chunk-kt3t4zv0.js +0 -2
- package/dist/chunk-shb5s568.js +0 -1
- package/dist/chunk-tb8nqrjk.js +0 -1
- package/dist/player/audio_controller.d.ts +0 -40
- package/dist/player/audio_controller.d.ts.map +0 -1
- package/dist/player/audio_node_controller.d.ts +0 -8
- package/dist/player/audio_node_controller.d.ts.map +0 -1
- package/dist/player/hitsound_controller.d.ts +0 -21
- package/dist/player/hitsound_controller.d.ts.map +0 -1
|
@@ -1,2 +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
|
|
1
|
+
import{ta as XJ}from"./chunk-598ehnf5.js";import{ua as WK}from"./chunk-3wjb2nvs.js";import{Ia as OK,Ja as YK,va as DK}from"./chunk-8wvq4dfz.js";import{$a as VK,Ka as h,La as mJ,Ma as tK,Na as g,Qa as x,Ra as f,Sa as l,Ta as JZ,Ua as AK,Va as c,Wa as o,Ya as e,Za as v,_a as WJ,ab as kK,cb as QK,ib as y,jb as NK}from"./chunk-sqnzgty6.js";import{wb as IZ,xb as zZ}from"./chunk-cs4e65d1.js";var TK=zZ((d0,RK)=>{RK.exports=DZ;var fJ={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},LZ=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function DZ(K){var J=[];return K.replace(LZ,function(Z,$,Q){var N=$.toLowerCase();if(Q=MZ(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 BZ=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function MZ(K){var J=K.match(BZ);return J?J.map(Number):[]}});var BJ=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 M=_+L,B=V+E,I=U+L,D=z+E;return q.push(M,B),q.push(I,D),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,M=Math.abs(E),B=Math.sqrt(_*_+V*V),I=(15*M*Math.sqrt(B)/Math.PI>>0)+1,D=E/I;if(L+=D,q){H.push(K,J),H.push(Z,$);for(let C=1,A=L;C<I;C++,A+=D)H.push(K,J),H.push(K+Math.sin(A)*B,J+Math.cos(A)*B);H.push(K,J),H.push(Q,N)}else{H.push(Z,$),H.push(K,J);for(let C=1,A=L;C<I;C++,A+=D)H.push(K+Math.sin(A)*B,J+Math.cos(A)*B),H.push(K,J);H.push(Q,N),H.push(K,J)}return I*2}function JK(K,J,Z,$,Q,N){let H=BJ;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,M=K.length/2,B=K.length,I=E.length/2,D=q.width/2,C=D*D,A=q.miterLimit*q.miterLimit,R=K[0],W=K[1],F=K[2],w=K[3],X=0,Y=0,T=-(W-w),G=R-F,O=0,b=0,S=Math.sqrt(T*T+G*G);T/=S,G/=S,T*=D,G*=D;let JJ=_,j=(1-JJ)*2,k=JJ*2;if(!z){if(q.cap==="round")B+=s(R-T*(j-k)*0.5,W-G*(j-k)*0.5,R-T*j,W-G*j,R+T*k,W+G*k,E,!0)+2;else if(q.cap==="square")B+=tJ(R,W,T,G,j,k,!0,E)}E.push(R-T*j,W-G*j),E.push(R+T*k,W+G*k);for(let P=1;P<M-1;++P){R=K[(P-1)*2],W=K[(P-1)*2+1],F=K[P*2],w=K[P*2+1],X=K[(P+1)*2],Y=K[(P+1)*2+1],T=-(W-w),G=R-F,S=Math.sqrt(T*T+G*G),T/=S,G/=S,T*=D,G*=D,O=-(w-Y),b=F-X,S=Math.sqrt(O*O+b*b),O/=S,b/=S,O*=D,b*=D;let d=F-R,HJ=W-w,qJ=F-X,_J=Y-w,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-T*j,w-G*j),E.push(F+T*k,w+G*k),aJ>=0){if(q.join==="round")B+=s(F,w,F-T*j,w-G*j,F-O*j,w-b*j,E,!1)+4;else B+=2;E.push(F-O*k,w-b*k),E.push(F+O*j,w+b*j)}continue}let rJ=(-T+R)*(-G+w)-(-T+F)*(-G+W),iJ=(-O+X)*(-b+w)-(-O+F)*(-b+Y),LJ=(d*iJ-qJ*rJ)/zJ,DJ=(_J*rJ-HJ*iJ)/zJ,OJ=(LJ-F)*(LJ-F)+(DJ-w)*(DJ-w),n=F+(LJ-F)*j,a=w+(DJ-w)*j,r=F-(LJ-F)*k,i=w-(DJ-w)*k,KZ=Math.min(d*d+HJ*HJ,qJ*qJ+_J*_J),sJ=UJ?j:k,ZZ=KZ+sJ*sJ*C;if(OJ<=ZZ)if(q.join==="bevel"||OJ/C>A){if(UJ)E.push(n,a),E.push(F+T*k,w+G*k),E.push(n,a),E.push(F+O*k,w+b*k);else E.push(F-T*j,w-G*j),E.push(r,i),E.push(F-O*j,w-b*j),E.push(r,i);B+=2}else if(q.join==="round")if(UJ)E.push(n,a),E.push(F+T*k,w+G*k),B+=s(F,w,F+T*k,w+G*k,F+O*k,w+b*k,E,!0)+4,E.push(n,a),E.push(F+O*k,w+b*k);else E.push(F-T*j,w-G*j),E.push(r,i),B+=s(F,w,F-T*j,w-G*j,F-O*j,w-b*j,E,!1)+4,E.push(F-O*j,w-b*j),E.push(r,i);else E.push(n,a),E.push(r,i);else{if(E.push(F-T*j,w-G*j),E.push(F+T*k,w+G*k),q.join==="round")if(UJ)B+=s(F,w,F+T*k,w+G*k,F+O*k,w+b*k,E,!0)+2;else B+=s(F,w,F-T*j,w-G*j,F-O*j,w-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);B+=2}E.push(F-O*j,w-b*j),E.push(F+O*k,w+b*k),B+=2}}if(R=K[(M-2)*2],W=K[(M-2)*2+1],F=K[(M-1)*2],w=K[(M-1)*2+1],T=-(W-w),G=R-F,S=Math.sqrt(T*T+G*G),T/=S,G/=S,T*=D,G*=D,E.push(F-T*j,w-G*j),E.push(F+T*k,w+G*k),!z){if(q.cap==="round")B+=s(F-T*(j-k)*0.5,w-G*(j-k)*0.5,F-T*j,w-G*j,F+T*k,w+G*k,E,!1)+2;else if(q.cap==="square")B+=tJ(F,w,T,G,j,k,!1,E)}let NJ=YJ*YJ;for(let P=I;P<B+I-2;++P){if(R=E[P*2],W=E[P*2+1],F=E[(P+1)*2],w=E[(P+1)*2+1],X=E[(P+2)*2],Y=E[(P+2)*2+1],Math.abs(R*(w-Y)+F*(Y-W)+X*(W-w))<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=$Z(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 I=J;J=$,$=I,N*=-1}if(H<0){let I=Z;Z=Q,Q=I,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),M=Math.atan2(H,N),B=new f;if(B.scale(E/V,1),B.rotate(M),B.translate(J,Z),this.textureSpace==="local")B.scale(V,V);this.transform=B}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),M=(N-z)*E,B=(H-L)*E,I=Q.createRadialGradient(M,B,V*E,(q-z)*E,(_-L)*E,U*E);ZK(I,J),Q.fillStyle=J[J.length-1].color,Q.fillRect(0,0,Z,Z),Q.fillStyle=I,Q.translate(M,B),Q.rotate(this.rotation),Q.scale(1,this.scale),Q.translate(-M,-B),Q.fillRect(0,0,Z,Z),this.texture=new y({source:new XJ({resource:$,addressMode:this._wrapMode})});let D=new f;if(D.scale(1/E,1/E),D.translate(z,L),this.textureSpace==="local")D.scale(Z,Z);this.transform=D}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 $Z(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 QZ=new f,NZ=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(NZ);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,M=Q.b,B=Q.c,I=Q.d;Q.a*=V,Q.b*=V,Q.c*=U,Q.d*=U,Q.tx=z*E+L*B+Q.tx,Q.ty=z*M+L*I+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(QZ.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:M}=q;while(_<H){let B=K[Z],I=K[Z+1];$[Q]=V*B+z*I+E,$[Q+1]=U*B+L*I+M,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],M=K[z+1];K[z]=N*E+q*M+V,K[z+1]=H*E+_*M+U,z+=$}}var HZ=new f;class MJ{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||HZ}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 R=K;if(H=q=R.radius,H<=0)return!1;Z=R.x,$=R.y,Q=N=0}else if(K.type==="ellipse"){let R=K;if(H=R.halfWidth,q=R.halfHeight,H<=0||q<=0)return!1;Z=R.x,$=R.y,Q=N=0}else{let R=K,W=R.width/2,F=R.height/2;Z=R.x+W,$=R.y+F,H=q=Math.max(0,Math.min(R.radius,Math.min(W,F))),Q=W-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,M=Q+H,B=N,I=Z+M,D=Z-M,C=$+B;if(J[U++]=I,J[U++]=C,J[--z]=C,J[--z]=D,N){let R=$-B;J[L++]=D,J[L++]=R,J[--E]=R,J[--E]=I}for(let R=1;R<_;R++){let W=Math.PI/2*(R/_),F=Q+Math.cos(W)*H,w=N+Math.sin(W)*q,X=Z+F,Y=Z-F,T=$+w,G=$-w;J[U++]=X,J[U++]=T,J[--z]=T,J[--z]=Y,J[L++]=Y,J[L++]=G,J[--E]=G,J[--E]=X}M=Q,B=N+q,I=Z+M,D=Z-M,C=$+B;let A=$-B;if(J[U++]=I,J[U++]=C,J[--E]=A,J[--E]=I,Q)J[U++]=D,J[U++]=C,J[--E]=A,J[--E]=D;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=BJ;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 IJ(K,J,Z,$,Q,N,H){let q=DK(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 qZ=[],BK={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){IJ(K,qZ,J,Z,$,Q,N)}};var MK={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 IK={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(MK,BK,IK,KJ,EK,zK);var _Z=new v,UZ=new f;function wK(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")VZ(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 VZ(K,J,Z){let $=[],Q=FJ.rectangle,N=_Z;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 M=e.get(MJ);M.indexOffset=U,M.indexSize=V.length-U,M.attributeOffset=z,M.attributeSize=q.length/2-z,M.baseColor=K.style,M.alpha=K.alpha,M.texture=L,M.geometryData=Z,J.push(M)}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,M=N.length/2,B="triangle-list";if(V)SJ(z,V);if(!Z)if(U){let A=[],R=z.slice();EZ(U).forEach((F)=>{A.push(R.length/2),R.push(...F)}),IJ(R,A,N,2,M,q,E)}else L.triangulate(z,N,2,M,q,E);else{let A=_.closePath??!0,R=J;if(!R.pixelLine)JK(z,R,!1,A,N,q);else LK(z,A,N,q),B="line-list"}let I=H.length/2,D=J.texture;if(D!==y.WHITE){let A=qK(UZ,J,_,V);_K(N,2,M,H,I,2,N.length/2-M,A)}else UK(H,I,2,N.length/2-M);let C=e.get(MJ);C.indexOffset=E,C.indexSize=q.length-E,C.attributeOffset=M,C.attributeSize=N.length/2-M,C.baseColor=J.color,C.alpha=J.alpha,C.texture=D,C.geometryData=Q,C.topology=B,$.push(C)})}function EZ(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 CK(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 wJ{constructor(K=0,J=0,Z=0){this.type="circle",this.x=K,this.y=J,this.radius=Z}clone(){return new wJ(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 RJ{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 RJ(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,M=L*L/(_*_)+E*E/(V*V),B=L*L/(U*U)+E*E/(z*z);return M>1&&B<=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 jK(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,M;if(L<0)E=Z,M=$;else if(L>1)E=Q,M=N;else E=Z+L*_,M=$+L*V;let B=K-E,I=J-M;return B*B+I*I}var FZ,wZ;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(FZ),Z=K.getBounds(wZ);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],M=jK(K,J,U,z,L,E),B=Math.sign((L-U)*(J-z)-(E-z)*(K-U));if(M<=(B<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,M=q-_*2,B=Q+H,I=N+q;if((K>=Q-V&&K<=Q+U||K>=B-U&&K<=B+V)&&J>=L&&J<=L+M)return!0;if((J>=N-V&&J<=N+U||J>=I-U&&J<=I+V)&&K>=z&&K<=z+E)return!0;return K<z&&J<L&&TJ(K,J,z,L,_,U,V)||K>B-_&&J<L&&TJ(K,J,B-_,L,_,U,V)||K>B-_&&J>I-_&&TJ(K,J,B-_,I-_,_,U,V)||K<z&&J>I-_&&TJ(K,J,z,I-_,_,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();wK(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 CJ=vJ;var RZ=8,jJ=0.00000011920929,TZ=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??CJ.defaultOptions.bezierSmoothness)),L=(TZ-z)/1;return L*=L,GZ(J,Z,$,Q,N,H,q,_,K,L),K}function GZ(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,M=(Z+Q)/2,B=($+N)/2,I=(Q+H)/2,D=(N+q)/2,C=(L+M)/2,A=(E+B)/2,R=(M+I)/2,W=(B+D)/2,F=(C+R)/2,w=(A+W)/2;if(U>0){let X=H-K,Y=q-J,T=Math.abs((Z-H)*Y-($-q)*X),G=Math.abs((Q-H)*Y-(N-q)*X),O,b;if(T>jJ&&G>jJ){if((T+G)*(T+G)<=V*(X*X+Y*Y)){if($J<gJ){_.push(F,w);return}let S=Math.atan2(N-$,Q-Z);if(O=Math.abs(S-Math.atan2($-J,Z-K)),b=Math.abs(Math.atan2(q-N,H-Q)-S),O>=z)O=2*z-O;if(b>=z)b=2*z-b;if(O+b<$J){_.push(F,w);return}if(t!==0){if(O>t){_.push(Z,$);return}if(b>t){_.push(Q,N);return}}}}else if(T>jJ){if(T*T<=V*(X*X+Y*Y)){if($J<gJ){_.push(F,w);return}if(O=Math.abs(Math.atan2(N-$,Q-Z)-Math.atan2($-J,Z-K)),O>=z)O=2*z-O;if(O<$J){_.push(Z,$),_.push(Q,N);return}if(t!==0){if(O>t){_.push(Z,$);return}}}}else if(G>jJ){if(G*G<=V*(X*X+Y*Y)){if($J<gJ){_.push(F,w);return}if(O=Math.abs(Math.atan2(q-N,H-Q)-Math.atan2(N-$,Q-Z)),O>=z)O=2*z-O;if(O<$J){_.push(Z,$),_.push(Q,N);return}if(t!==0){if(O>t){_.push(Q,N);return}}}}else if(X=F-(K+H)/2,Y=w-(J+q)/2,X*X+Y*Y<=V){_.push(F,w);return}}hJ(K,J,L,E,C,A,F,w,_,V,U+1),hJ(F,w,R,W,I,D,H,q,_,V,U+1)}var CZ=8,jZ=0.00000011920929,AZ=1,kZ=0.01,bK=0;function SK(K,J,Z,$,Q,N,H,q){let V=Math.min(0.99,Math.max(0,q??CJ.defaultOptions.bezierSmoothness)),U=(AZ-V)/1;return U*=U,WZ(J,Z,$,Q,N,H,K,U),K}function WZ(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(_>CZ)return;let V=Math.PI,U=(J+$)/2,z=(Z+Q)/2,L=($+N)/2,E=(Q+H)/2,M=(U+L)/2,B=(z+E)/2,I=N-J,D=H-Z,C=Math.abs(($-N)*D-(Q-H)*I);if(C>jZ){if(C*C<=q*(I*I+D*D)){if(bK<kZ){K.push(M,B);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(M,B);return}}}else if(I=M-(J+N)/2,D=B-(Z+H)/2,I*I+D*D<=q){K.push(M,B);return}uJ(K,J,Z,U,z,M,B,q,_+1),uJ(K,M,B,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),M=J+L*$,B=Z+E*$;K.push(M,B),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,M=U*U+z*z,B=_*U+V*z,I=N*Math.sqrt(E)/L,D=N*Math.sqrt(M)/L,C=I*B/E,A=D*B/M,R=I*z+D*V,W=I*U+D*_,F=V*(D+C),w=_*(D+C),X=z*(I+A),Y=U*(I+A),T=Math.atan2(w-W,F-R),G=Math.atan2(Y-W,X-R);kJ(K,R+J,W+Z,N,T,G,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 OZ(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)},YZ=(K,J,Z,$,Q,N,H,q,_,V,U,z,L)=>{let E=Math.pow(Q,2),M=Math.pow(N,2),B=Math.pow(U,2),I=Math.pow(z,2),D=E*M-E*I-M*B;if(D<0)D=0;D/=E*I+M*B,D=Math.sqrt(D)*(H===q?-1:1);let C=D*Q/N*z,A=D*-N/Q*U,R=V*C-_*A+(K+Z)/2,W=_*C+V*A+(J+$)/2,F=(U-C)/Q,w=(z-A)/N,X=(-U-C)/Q,Y=(-z-A)/N,T=fK(1,0,F,w),G=fK(F,w,X,Y);if(q===0&&G>0)G-=VJ;if(q===1&&G<0)G+=VJ;L.centerX=R,L.centerY=W,L.ang1=T,L.ang2=G};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 M=Math.pow(L,2)/Math.pow(N,2)+Math.pow(E,2)/Math.pow(H,2);if(M>1)N*=Math.sqrt(M),H*=Math.sqrt(M);YZ(J,Z,$,Q,N,H,_,V,U,z,L,E,yJ);let{ang1:B,ang2:I}=yJ,{centerX:D,centerY:C}=yJ,A=Math.abs(I)/(VJ/4);if(Math.abs(1-A)<0.0000001)A=1;let R=Math.max(Math.ceil(A),1);I/=R;let W=K[K.length-2],F=K[K.length-1],w={x:0,y:0};for(let X=0;X<R;X++){let Y=OZ(B,I),{x:T,y:G}=xJ(Y[0],N,H,z,U,D,C,w),{x:O,y:b}=xJ(Y[1],N,H,z,U,D,C,w),{x:S,y:JJ}=xJ(Y[2],N,H,z,U,D,C,w);AJ(K,W,F,T,G,O,b,S,JJ),W=S,F=JJ,B+=I}}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,M=!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,M=!0;else if(L>0)E=-1,M=!0;let B=L/2,I,D=Math.abs(Math.cos(B)*_/Math.sin(B));if(D>Math.min(U.len/2,z.len/2))D=Math.min(U.len/2,z.len/2),I=Math.abs(D*Math.sin(B)/Math.cos(B));else I=_;let C=q.x+z.nx*D+-z.ny*I*E,A=q.y+z.ny*D+z.nx*I*E,R=Math.atan2(U.ny,U.nx)+Math.PI/2*E,W=Math.atan2(z.ny,z.nx)-Math.PI/2*E;if(H===0)K.moveTo(C+Math.cos(R)*I,A+Math.sin(R)*I);K.arc(C,A,I,R,W,M),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 I=Math.min(L/2,V);E=N(_,U,I/L)}let M=Q(z,_),B;if(M<0.0001)B=_;else{let I=Math.min(M/2,V);B=N(_,z,I/M)}if(q===0)K.moveTo(E.x,E.y);else K.lineTo(E.x,E.y);K.quadraticCurveTo(_.x,_.y,B.x,B.y,$)}}var XZ=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 wJ(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),M=J+Z*Math.sin(L),B=L+Math.PI+U,I=L-Math.PI-U,D=E+Q*Math.cos(B),C=M+Q*Math.sin(B),A=E+Q*Math.cos(I),R=M+Q*Math.sin(I);if(z===0)this.moveTo(D,C);else this.lineTo(D,C);this.quadraticCurveTo(E,M,A,R,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 RJ(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(XZ);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")CK(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,M=0;for(let B=0;B<this.instructions.length;B++){let I=this.instructions[B],D=I.data;switch(I.action){case"moveTo":case"lineTo":q=D[0],_=D[1],D[0]=J*q+$*_+N,D[1]=Z*q+Q*_+H;break;case"bezierCurveTo":V=D[0],U=D[1],z=D[2],L=D[3],q=D[4],_=D[5],D[0]=J*V+$*U+N,D[1]=Z*V+Q*U+H,D[2]=J*z+$*L+N,D[3]=Z*z+Q*L+H,D[4]=J*q+$*_+N,D[5]=Z*q+Q*_+H;break;case"quadraticCurveTo":V=D[0],U=D[1],q=D[2],_=D[3],D[0]=J*V+$*U+N,D[1]=Z*V+Q*U+H,D[2]=J*q+$*_+N,D[3]=Z*q+Q*_+H;break;case"arcToSvg":q=D[5],_=D[6],E=D[0],M=D[1],D[0]=J*E+$*M,D[1]=Z*E+Q*M,D[5]=J*q+$*_+N,D[6]=Z*q+Q*_+H;break;case"circle":D[4]=EJ(D[3],K);break;case"rect":D[4]=EJ(D[4],K);break;case"ellipse":D[8]=EJ(D[8],K);break;case"roundRect":D[5]=EJ(D[5],K);break;case"addPath":D[0].transform(K);break;case"poly":D[2]=EJ(D[2],K);break;default:o("unknown transform action",I.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]=PZ(H);break;case"radialgradient":J.defs[H.id]=bZ(H);break;default:break}}}}function PZ(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 bZ(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,M,B,I,D,C,A,R,W,F,w,X;switch(K.nodeName.toLowerCase()){case"path":{W=K.getAttribute("d");let Y=K.getAttribute("fill-rule"),T=dK(W),G=Y==="evenodd",O=T.length>1;if(G&&O){let S=T.map((j)=>({path:j,area:lK(j)}));if(S.sort((j,k)=>k.area-j.area),T.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(W,Y?Y==="evenodd":!0),J.context.path(F),Z)J.context.fill(Z);if($)J.context.stroke($)}break}case"circle":if(M=m(K,"cx",0),B=m(K,"cy",0),I=m(K,"r",0),J.context.ellipse(M,B,I,I),Z)J.context.fill(Z);if($)J.context.stroke($);break;case"rect":if(_=m(K,"x",0),V=m(K,"y",0),w=m(K,"width",0),X=m(K,"height",0),D=m(K,"rx",0),C=m(K,"ry",0),D||C)J.context.roundRect(_,V,w,X,D||C);else J.context.rect(_,V,w,X);if(Z)J.context.fill(Z);if($)J.context.stroke($);break;case"ellipse":if(M=m(K,"cx",0),B=m(K,"cy",0),D=m(K,"rx",0),C=m(K,"ry",0),J.context.beginPath(),J.context.ellipse(M,B,D,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(R=K.getAttribute("points"),A=R.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(R=K.getAttribute("points"),A=R.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 SZ(K){return g.isColorLike(K)}function nK(K){return K instanceof bJ}function aK(K){return K instanceof p}function mZ(K){return K instanceof y}function fZ(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 vZ(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 gZ(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(SZ(K))return fZ(Z,K,J);else if(mZ(K))return vZ(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 gZ($,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}}function sK(K,J){let Z=1,$=K.shapePath.shapePrimitives;for(let Q=0;Q<$.length;Q++){let N=$[Q].shape;if(N.type!=="polygon")continue;let H=N.points,q=H.length;if(q<6)continue;let _=N.closePath;for(let V=0;V<q;V+=2){if(!_&&(V===0||V===q-2))continue;let U=(V-2+q)%q,z=(V+2)%q,L=H[U],E=H[U+1],M=H[V],B=H[V+1],I=H[z],D=H[z+1],C=L-M,A=E-B,R=I-M,W=D-B,F=C*C+A*A,w=R*R+W*W;if(F<0.000000000001||w<0.000000000001)continue;let T=(C*R+A*W)/Math.sqrt(F*w);if(T<-1)T=-1;else if(T>1)T=1;let G=Math.sqrt((1-T)*0.5);if(G<0.000001)continue;let O=Math.min(1/G,J);if(O>Z)Z=O}}return Z}var hZ=new x,eK=new f,nJ=class K extends tK{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(JZ,"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 eK.set(J,Z,$,Q,N,H),this._transform.append(eK),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(){this._boundsDirty=!0,this.dirty=!0,this.emit("update",this,16)}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);if(N.style.join==="miter")q*=sK(N.path,N.style.miterLimit);let _=N.path.bounds;J.addFrame(_.minX-q,_.minY-q,_.maxX+q,_.maxY+q)}}if(!J.isValid)J.set(0,0,0,0);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,hZ):J;if(N.action==="fill")$=z.contains(E.x,E.y);else{let B=_;$=z.strokeContains(E.x,E.y,B.width,B.alignment)}let M=H.hole;if(M){let B=M.shapePath?.shapePrimitives;if(B){for(let I=0;I<B.length;I++)if(B[I].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 k7=nJ;
|
|
2
|
+
export{JK as ja,p as ka,bJ as la,MJ as ma,qK as na,FJ as oa,CJ as pa,QJ as qa,oJ as ra,k7 as sa};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{x as a}from"./chunk-3baewprq.js";import"./chunk-z898rh1p.js";import"./chunk-w1tshfsy.js";import"./chunk-aeeawe99.js";import"./chunk-598ehnf5.js";import"./chunk-3wjb2nvs.js";import"./chunk-8wvq4dfz.js";import"./chunk-sqnzgty6.js";import"./chunk-cs4e65d1.js";export{a as CanvasRenderer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as a}from"./chunk-029sagwa.js";import"./chunk-tqbn5m4a.js";import"./chunk-z898rh1p.js";import"./chunk-w1tshfsy.js";import"./chunk-0we37sfj.js";import"./chunk-3wjb2nvs.js";import"./chunk-8wvq4dfz.js";import"./chunk-sqnzgty6.js";import"./chunk-cs4e65d1.js";export{a as WebGPURenderer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
var j=Object.create;var{getPrototypeOf:k,defineProperty:i,getOwnPropertyNames:l}=Object;var m=Object.prototype.hasOwnProperty;function n(a){return this[a]}var o,p,q=(a,b,c)=>{var f=a!=null&&typeof a==="object";if(f){var g=b?o??=new WeakMap:p??=new WeakMap,h=g.get(a);if(h)return h}c=a!=null?j(k(a)):{};let d=b||!a||!a.__esModule?i(c,"default",{value:a,enumerable:!0}):c;for(let e of l(a))if(!m.call(d,e))i(d,e,{get:n.bind(a,e),enumerable:!0});if(f)g.set(a,d);return d};var r=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var s=((a)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});
|
|
2
|
-
export{q as
|
|
2
|
+
export{q as wb,r as xb,s as yb};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as z,b as B,c as G,d as H,e as I}from"./chunk-1d7vwgnw.js";import"./chunk-gsjxh2hw.js";import"./chunk-shgm3fs6.js";import{Z as q}from"./chunk-w1tshfsy.js";import"./chunk-jyb1nvnr.js";import"./chunk-598ehnf5.js";import{La as k}from"./chunk-sqnzgty6.js";import"./chunk-cs4e65d1.js";k.add(z);k.mixin(q,B);k.add(G);k.add(H);k.mixin(q,I);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as d,g as f}from"./chunk-shgm3fs6.js";import{La as b}from"./chunk-sqnzgty6.js";b.add(f);b.add(d);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-gsjxh2hw.js";import"./chunk-shgm3fs6.js";import"./chunk-w1tshfsy.js";import"./chunk-jyb1nvnr.js";import"./chunk-598ehnf5.js";import"./chunk-sqnzgty6.js";import"./chunk-cs4e65d1.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{I as
|
|
1
|
+
import{Wa as F}from"./chunk-sqnzgty6.js";var I=(q,z,D=!1)=>{if(!Array.isArray(q))q=[q];if(!z)return q;return q.map((B)=>{if(typeof B==="string"||D)return z(B);return B})};class J{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(q){return this._cache.has(q)}get(q){let z=this._cache.get(q);if(!z)F(`[Assets] Asset id ${q} was not found in the Cache`);return z}set(q,z){let D=I(q),B;for(let x=0;x<this.parsers.length;x++){let E=this.parsers[x];if(E.test(z)){B=E.getCacheableAssets(D,z);break}}let G=new Map(Object.entries(B||{}));if(!B)D.forEach((x)=>{G.set(x,z)});let H=[...G.keys()],N={cacheKeys:H,keys:D};D.forEach((x)=>{this._cacheMap.set(x,N)}),H.forEach((x)=>{let E=B?B[x]:z;if(this._cache.has(x)&&this._cache.get(x)!==E)F("[Cache] already has key:",x);this._cache.set(x,G.get(x))})}remove(q){if(!this._cacheMap.has(q)){F(`[Assets] Asset id ${q} was not found in the Cache`);return}let z=this._cacheMap.get(q);z.cacheKeys.forEach((B)=>{this._cache.delete(B)}),z.keys.forEach((B)=>{this._cacheMap.delete(B)})}get parsers(){return this._parsers}}var S=new J;
|
|
2
|
+
export{I as ga,S as ha};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{ha as d}from"./chunk-jyb1nvnr.js";import{ia as MQ}from"./chunk-0we37sfj.js";import{ka as t,la as qQ,qa as AQ,ra as jQ,sa as c}from"./chunk-aeeawe99.js";import{ta as mQ}from"./chunk-598ehnf5.js";import{Ma as zQ,Na as h,Ra as BQ,Sa as SQ,Ta as S,Va as g,Wa as e,Za as VQ,db as DQ,fb as yQ,ib as u,jb as OQ}from"./chunk-sqnzgty6.js";class $Q extends zQ{constructor(){super(...arguments);this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.applyFillAsTint=!0,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100}get font(){return g(S,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return g(S,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return g(S,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return g(S,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return g(S,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(Z=!1){this.emit("destroy",this),this.removeAllListeners();for(let Q in this.chars)this.chars[Q].texture?.destroy();if(this.chars=null,Z)this.pages.forEach((Q)=>Q.texture.destroy(!0)),this.pages=null}}class wQ{constructor(Z=0,Q=0,$=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=Z,this.resetTtl=$,this.size=0,this.ttl=Q}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(Z){if(this.has(Z)){let Q=this.items[Z];if(delete this.items[Z],this.size--,Q.prev!==null)Q.prev.next=Q.next;if(Q.next!==null)Q.next.prev=Q.prev;if(this.first===Q)this.first=Q.next;if(this.last===Q)this.last=Q.prev}return this}entries(Z=this.keys()){let Q=Array(Z.length);for(let $=0;$<Z.length;$++){let q=Z[$];Q[$]=[q,this.get(q)]}return Q}evict(Z=!1){if(Z||this.size>0){let Q=this.first;if(delete this.items[Q.key],--this.size===0)this.first=null,this.last=null;else this.first=Q.next,this.first.prev=null}return this}expiresAt(Z){let Q;if(this.has(Z))Q=this.items[Z].expiry;return Q}get(Z){let Q=this.items[Z];if(Q!==void 0){if(this.ttl>0){if(Q.expiry<=Date.now()){this.delete(Z);return}}return this.moveToEnd(Q),Q.value}return}has(Z){return Z in this.items}moveToEnd(Z){if(this.last===Z)return;if(Z.prev!==null)Z.prev.next=Z.next;if(Z.next!==null)Z.next.prev=Z.prev;if(this.first===Z)this.first=Z.next;if(Z.prev=this.last,Z.next=null,this.last!==null)this.last.next=Z;if(this.last=Z,this.first===null)this.first=Z}keys(){let Z=Array(this.size),Q=this.first,$=0;while(Q!==null)Z[$++]=Q.key,Q=Q.next;return Z}setWithEvicted(Z,Q,$=this.resetTtl){let q=null;if(this.has(Z))this.set(Z,Q,!0,$);else{if(this.max>0&&this.size===this.max)q={...this.first},this.evict(!0);let J=this.items[Z]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:Z,prev:this.last,next:null,value:Q};if(++this.size===1)this.first=J;else this.last.next=J;this.last=J}return q}set(Z,Q,$=!1,q=this.resetTtl){let J=this.items[Z];if($||J!==void 0){if(J.value=Q,$===!1&&q)J.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl;this.moveToEnd(J)}else{if(this.max>0&&this.size===this.max)this.evict(!0);if(J=this.items[Z]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:Z,prev:this.last,next:null,value:Q},++this.size===1)this.first=J;else this.last.next=J;this.last=J}return this}values(Z=this.keys()){let Q=Array(Z.length);for(let $=0;$<Z.length;$++)Q[$]=this.get(Z[$]);return Q}}function UQ(Z=1000,Q=0,$=!1){if(isNaN(Z)||Z<0)throw TypeError("Invalid max value");if(isNaN(Q)||Q<0)throw TypeError("Invalid ttl value");if(typeof $!=="boolean")throw TypeError("Invalid resetTtl value");return new wQ(Z,Q,$)}function NQ(Z){return!!Z.tagStyles&&Object.keys(Z.tagStyles).length>0}function GQ(Z){return Z.includes("<")}function uQ(Z,Q){return Z.clone().assign(Q)}function FQ(Z,Q){let $=[],q=Q.tagStyles;if(!NQ(Q)||!GQ(Z))return $.push({text:Z,style:Q}),$;let J=[Q],V=[],Y="",X=0;while(X<Z.length){let z=Z[X];if(z==="<"){let U=Z.indexOf(">",X);if(U===-1){Y+=z,X++;continue}let K=Z.slice(X+1,U);if(K.startsWith("/")){let H=K.slice(1).trim();if(V.length>0&&V[V.length-1]===H){if(Y.length>0)$.push({text:Y,style:J[J.length-1]}),Y="";J.pop(),V.pop(),X=U+1;continue}else{Y+=Z.slice(X,U+1),X=U+1;continue}}else{let H=K.trim();if(q[H]){if(Y.length>0)$.push({text:Y,style:J[J.length-1]}),Y="";let D=J[J.length-1],A=uQ(D,q[H]);J.push(A),V.push(H),X=U+1;continue}else{Y+=Z.slice(X,U+1),X=U+1;continue}}}else Y+=z,X++}if(Y.length>0)$.push({text:Y,style:J[J.length-1]});return $}var cQ=[10,13],oQ=new Set(cQ),lQ=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288],iQ=new Set(lQ),rQ=[9,32],nQ=new Set(rQ),sQ=[45,8208,8211,8212,173],aQ=new Set(sQ),WQ=/(\r\n|\r|\n)/,CQ=/(?:\r\n|\r|\n)/;function r(Z){if(typeof Z!=="string")return!1;return oQ.has(Z.charCodeAt(0))}function f(Z,Q){if(typeof Z!=="string")return!1;return iQ.has(Z.charCodeAt(0))}function IQ(Z){if(typeof Z!=="string")return!1;return nQ.has(Z.charCodeAt(0))}function PQ(Z){if(typeof Z!=="string")return!1;return aQ.has(Z.charCodeAt(0))}function n(Z){return Z==="normal"||Z==="pre-line"}function s(Z){return Z==="normal"}function p(Z){if(typeof Z!=="string")return"";let Q=Z.length-1;while(Q>=0&&f(Z[Q]))Q--;return Q<Z.length-1?Z.slice(0,Q+1):Z}function XQ(Z){let Q=[],$=[];if(typeof Z!=="string")return Q;for(let q=0;q<Z.length;q++){let J=Z[q],V=Z[q+1];if(f(J,V)||r(J)){if($.length>0)Q.push($.join("")),$.length=0;if(J==="\r"&&V===`
|
|
2
|
+
`)Q.push(`\r
|
|
3
|
+
`),q++;else Q.push(J);continue}if($.push(J),PQ(J)&&V&&!f(V)&&!r(V))Q.push($.join("")),$.length=0}if($.length>0)Q.push($.join(""));return Q}function KQ(Z,Q,$,q){let J=$(Z),V=[];for(let Y=0;Y<J.length;Y++){let X=J[Y],z=X,U=1;while(J[Y+U]){let K=J[Y+U];if(!q(z,K,Z,Y,Q))X+=K,z=K,U++;else break}Y+=U-1,V.push(X)}return V}var tQ=/\r\n|\r|\n/g;function fQ(Z,Q,$,q,J,V,Y,X){let z=FQ(Z,Q);if(s(Q.whiteSpace))for(let w=0;w<z.length;w++){let k=z[w];z[w]={text:k.text.replace(tQ," "),style:k.style}}let K=[],H=[];for(let w of z){let k=w.text.split(WQ);for(let m=0;m<k.length;m++){let L=k[m];if(L===`\r
|
|
4
|
+
`||L==="\r"||L===`
|
|
5
|
+
`)K.push(H),H=[];else if(L.length>0)H.push({text:L,style:w.style})}}if(H.length>0||K.length===0)K.push(H);let D=$?eQ(K,Q,q,J,Y,X):K,A=[],j=[],M=[],B=[],G=[],E=0,P=Q._fontString,N=V(P);if(N.fontSize===0)N.fontSize=Q.fontSize,N.ascent=Q.fontSize;let O="",I=!!Q.dropShadow,W=Q._stroke?.width||0;for(let w of D){let k=0,m=N.ascent,L=N.descent,v="";for(let x of w){let l=x.style._fontString,i=V(l);if(l!==O)q.font=l,O=l;let YQ=J(x.text,x.style.letterSpacing,q);k+=YQ,m=Math.max(m,i.ascent),L=Math.max(L,i.descent),v+=x.text;let LQ=x.style._stroke?.width||0;if(LQ>W)W=LQ;if(!I&&x.style.dropShadow)I=!0}if(w.length===0)m=N.ascent,L=N.descent;A.push(k),j.push(m),M.push(L),G.push(v);let ZQ=Q.lineHeight||m+L;B.push(ZQ+Q.leading),E=Math.max(E,k)}let b=W,R=($&&Q.align!=="left"?Math.max(E,Q.wordWrapWidth):E)+b+(Q.dropShadow?Q.dropShadow.distance:0),_=0;for(let w=0;w<B.length;w++)_+=B[w];_=Math.max(_,B[0]+b);let F=_+(Q.dropShadow?Q.dropShadow.distance:0),o=Q.lineHeight||N.fontSize;return{width:R,height:F,lines:G,lineWidths:A,lineHeight:o+Q.leading,maxLineWidth:E,fontProperties:N,runsByLine:D,lineAscents:j,lineDescents:M,lineHeights:B,hasDropShadow:I}}function eQ(Z,Q,$,q,J,V){let{letterSpacing:Y,whiteSpace:X,wordWrapWidth:z,breakWords:U}=Q,K=n(X),H=z+Y,D={},A="",j=(B,G)=>{let E=`${B}|${G.styleKey}`,P=D[E];if(P===void 0){let N=G._fontString;if(N!==A)$.font=N,A=N;P=q(B,G.letterSpacing,$)+G.letterSpacing,D[E]=P}return P},M=[];for(let B of Z){let G=QZ(B),E=M.length,P=(R)=>{let _=0,F=R;do{let{token:o,style:w}=G[F];_+=j(o,w),F++}while(F<G.length&&G[F].continuesFromPrevious);return _},N=(R)=>{let _=[],F=R;do _.push({token:G[F].token,style:G[F].style}),F++;while(F<G.length&&G[F].continuesFromPrevious);return _},O=[],I=0,W=!K,b=null,T=()=>{if(b&&b.text.length>0)O.push(b);b=null},C=()=>{if(T(),O.length>0){let R=O[O.length-1];if(R.text=p(R.text),R.text.length===0)O.pop()}M.push(O),O=[],I=0,W=!1};for(let R=0;R<G.length;R++){let{token:_,style:F,continuesFromPrevious:o}=G[R],w=j(_,F);if(K){let L=f(_),v=b?.text[b.text.length-1]??O[O.length-1]?.text.slice(-1)??"",ZQ=v?f(v):!1;if(L&&ZQ)continue}let k=!o,m=k?P(R):w;if(m>H&&k){if(I>0)C();if(U){let L=N(R);for(let v=0;v<L.length;v++){let ZQ=L[v].token,x=L[v].style,l=KQ(ZQ,U,V,J);for(let i of l){let YQ=j(i,x);if(YQ+I>H)C();if(!b||b.style!==x)T(),b={text:i,style:x};else b.text+=i;I+=YQ}}R+=L.length-1}else{let L=N(R);T(),M.push(L.map((v)=>({text:v.token,style:v.style}))),W=!1,R+=L.length-1}}else if(m+I>H&&k){if(f(_)){W=!1;continue}C(),b={text:_,style:F},I=w}else if(o&&!U){if(!b||b.style!==F)T(),b={text:_,style:F};else b.text+=_;I+=w}else{let L=f(_);if(I===0&&L&&!W)continue;if(!b||b.style!==F)T(),b={text:_,style:F};else b.text+=_;I+=w}}if(T(),O.length>0){let R=O[O.length-1];if(R.text=p(R.text),R.text.length===0)O.pop()}if(O.length>0||M.length===E)M.push(O)}return M}function QZ(Z){let Q=[],$=!1;for(let q of Z){let J=XQ(q.text),V=!0;for(let Y of J){let X=f(Y)||r(Y),z=V&&$&&!X;Q.push({token:Y,style:q.style,continuesFromPrevious:z}),$=!X,V=!1}}return Q}var ZZ={willReadFrequently:!0};function TQ(Z,Q,$,q,J){let V=$[Z];if(typeof V!=="number")V=J(Z,Q,q)+Q,$[Z]=V;return V}function kQ(Z,Q,$,q,J,V,Y){let X=$.getContext("2d",ZZ);X.font=Q._fontString;let z=0,U="",K=[],H=Object.create(null),{letterSpacing:D,whiteSpace:A}=Q,j=n(A),M=s(A),B=!j,G=Q.wordWrapWidth+D,E=XQ(Z);for(let N=0;N<E.length;N++){let O=E[N];if(r(O)){if(!M){K.push(p(U)),B=!j,U="",z=0;continue}O=" "}if(j){let W=f(O),b=f(U[U.length-1]);if(W&&b)continue}let I=TQ(O,D,H,X,q);if(I>G){if(U!=="")K.push(p(U)),U="",z=0;if(J(O,Q.breakWords)){let W=KQ(O,Q.breakWords,Y,V);for(let b of W){let T=TQ(b,D,H,X,q);if(T+z>G)K.push(p(U)),B=!1,U="",z=0;U+=b,z+=T}}else{if(U.length>0)K.push(p(U)),U="",z=0;K.push(p(O)),B=!1,U="",z=0}}else{if(I+z>G)B=!1,K.push(p(U)),U="",z=0;if(U.length>0||!f(O)||B)U+=O,z+=I}}let P=p(U);if(P.length>0)K.push(P);return K.join(`
|
|
6
|
+
`)}var vQ={willReadFrequently:!0},y=class Z{static get experimentalLetterSpacingSupported(){let Q=Z._experimentalLetterSpacingSupported;if(Q===void 0){let $=OQ.get().getCanvasRenderingContext2D().prototype;Q=Z._experimentalLetterSpacingSupported="letterSpacing"in $||"textLetterSpacing"in $}return Q}constructor(Q,$,q,J,V,Y,X,z,U,K){if(this.text=Q,this.style=$,this.width=q,this.height=J,this.lines=V,this.lineWidths=Y,this.lineHeight=X,this.maxLineWidth=z,this.fontProperties=U,K)this.runsByLine=K.runsByLine,this.lineAscents=K.lineAscents,this.lineDescents=K.lineDescents,this.lineHeights=K.lineHeights,this.hasDropShadow=K.hasDropShadow}static measureText(Q=" ",$,q=Z._canvas,J=$.wordWrap){let V=`${Q}-${$.styleKey}-wordWrap-${J}`;if(Z._measurementCache.has(V))return Z._measurementCache.get(V);if(NQ($)&&GQ(Q)){let O=fQ(Q,$,J,Z._context,Z._measureText,Z.measureFont,Z.canBreakChars,Z.wordWrapSplit),I=new Z(Q,$,O.width,O.height,O.lines,O.lineWidths,O.lineHeight,O.maxLineWidth,O.fontProperties,{runsByLine:O.runsByLine,lineAscents:O.lineAscents,lineDescents:O.lineDescents,lineHeights:O.lineHeights,hasDropShadow:O.hasDropShadow});return Z._measurementCache.set(V,I),I}let X=$._fontString,z=Z.measureFont(X);if(z.fontSize===0)z.fontSize=$.fontSize,z.ascent=$.fontSize,z.descent=0;let U=Z._context;U.font=X;let H=(J?Z._wordWrap(Q,$,q):Q).split(CQ),D=Array(H.length),A=0;for(let O=0;O<H.length;O++){let I=Z._measureText(H[O],$.letterSpacing,U);D[O]=I,A=Math.max(A,I)}let j=$._stroke?.width??0,M=$.lineHeight||z.fontSize,B=Z._getAlignWidth(A,$,J),G=Z._adjustWidthForStyle(B,$),E=Math.max(M,z.fontSize+j)+(H.length-1)*(M+$.leading),P=Z._adjustHeightForStyle(E,$),N=new Z(Q,$,G,P,H,D,M+$.leading,A,z);return Z._measurementCache.set(V,N),N}static _adjustWidthForStyle(Q,$){let q=$._stroke?.width||0,J=Q+q;if($.dropShadow)J+=$.dropShadow.distance;return J}static _adjustHeightForStyle(Q,$){let q=Q;if($.dropShadow)q+=$.dropShadow.distance;return q}static _getAlignWidth(Q,$,q){return q&&$.align!=="left"?Math.max(Q,$.wordWrapWidth):Q}static _measureText(Q,$,q){let J=!1;if(Z.experimentalLetterSpacingSupported)if(Z.experimentalLetterSpacing)q.letterSpacing=`${$}px`,q.textLetterSpacing=`${$}px`,J=!0;else q.letterSpacing="0px",q.textLetterSpacing="0px";let V=q.measureText(Q),Y=V.width,X=-(V.actualBoundingBoxLeft??0),U=(V.actualBoundingBoxRight??0)-X;if(Y>0)if(J)Y-=$,U-=$;else{let K=(Z.graphemeSegmenter(Q).length-1)*$;Y+=K,U+=K}return Math.max(Y,U)}static _wordWrap(Q,$,q=Z._canvas){return kQ(Q,$,q,Z._measureText,Z.canBreakWords,Z.canBreakChars,Z.wordWrapSplit)}static isBreakingSpace(Q,$){return f(Q,$)}static canBreakWords(Q,$){return $}static canBreakChars(Q,$,q,J,V){return!0}static wordWrapSplit(Q){return Z.graphemeSegmenter(Q)}static measureFont(Q){if(Z._fonts[Q])return Z._fonts[Q];let $=Z._context;$.font=Q;let q=$.measureText(Z.METRICS_STRING+Z.BASELINE_SYMBOL),J=q.actualBoundingBoxAscent??0,V=q.actualBoundingBoxDescent??0,Y={ascent:J,descent:V,fontSize:J+V};return Z._fonts[Q]=Y,Y}static clearMetrics(Q=""){if(Q)delete Z._fonts[Q];else Z._fonts={}}static get _canvas(){if(!Z.__canvas){let Q;try{let $=new OffscreenCanvas(0,0);if($.getContext("2d",vQ)?.measureText)return Z.__canvas=$,$;Q=OQ.get().createCanvas()}catch($){Q=OQ.get().createCanvas()}Q.width=Q.height=10,Z.__canvas=Q}return Z.__canvas}static get _context(){if(!Z.__context)Z.__context=Z._canvas.getContext("2d",vQ);return Z.__context}};y.METRICS_STRING="|ÉqÅ";y.BASELINE_SYMBOL="M";y.BASELINE_MULTIPLIER=1.4;y.HEIGHT_MULTIPLIER=2;y.graphemeSegmenter=(()=>{if(typeof Intl?.Segmenter==="function"){let Z=new Intl.Segmenter;return(Q)=>{let $=Z.segment(Q),q=[],J=0;for(let V of $)q[J++]=V.segment;return q}}return(Z)=>[...Z]})();y.experimentalLetterSpacing=!1;y._fonts={};y._measurementCache=UQ(1000);var a=y;var $Z=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function JQ(Z){let Q=typeof Z.fontSize==="number"?`${Z.fontSize}px`:Z.fontSize,$=Z.fontFamily;if(!Array.isArray(Z.fontFamily))$=Z.fontFamily.split(",");for(let q=$.length-1;q>=0;q--){let J=$[q].trim();if(!/([\"\'])[^\'\"]+\1/.test(J)&&!$Z.includes(J))J=`"${J}"`;$[q]=J}return`${Z.fontStyle} ${Z.fontVariant} ${Z.fontWeight} ${Q} ${$.join(",")}`}var EQ=class Z extends zQ{constructor(Q={}){super();this.uid=SQ("textStyle"),this._tick=0,this._cachedFontString=null,JZ(Q);let $=Q instanceof Z,q=Q;if($)Q=q._toObject();let J={...Z.defaultTextStyle,...Q};for(let V in J){let Y=V;this[Y]=J[V]}this._tagStyles=Q.tagStyles??void 0,this.update(),this._tick=0}get align(){return this._align}set align(Q){if(this._align===Q)return;this._align=Q,this.update()}get breakWords(){return this._breakWords}set breakWords(Q){if(this._breakWords===Q)return;this._breakWords=Q,this.update()}get dropShadow(){return this._dropShadow}set dropShadow(Q){if(this._dropShadow===Q)return;if(Q!==null&&typeof Q==="object")this._dropShadow=this._createProxy({...Z.defaultDropShadow,...Q});else this._dropShadow=Q?this._createProxy({...Z.defaultDropShadow}):null;this.update()}get fontFamily(){return this._fontFamily}set fontFamily(Q){if(this._fontFamily===Q)return;this._fontFamily=Q,this.update()}get fontSize(){return this._fontSize}set fontSize(Q){if(this._fontSize===Q)return;if(typeof Q==="string")this._fontSize=parseInt(Q,10);else this._fontSize=Q;this.update()}get fontStyle(){return this._fontStyle}set fontStyle(Q){if(this._fontStyle===Q)return;this._fontStyle=Q.toLowerCase(),this.update()}get fontVariant(){return this._fontVariant}set fontVariant(Q){if(this._fontVariant===Q)return;this._fontVariant=Q,this.update()}get fontWeight(){return this._fontWeight}set fontWeight(Q){if(this._fontWeight===Q)return;this._fontWeight=Q,this.update()}get leading(){return this._leading}set leading(Q){if(this._leading===Q)return;this._leading=Q,this.update()}get letterSpacing(){return this._letterSpacing}set letterSpacing(Q){if(this._letterSpacing===Q)return;this._letterSpacing=Q,this.update()}get lineHeight(){return this._lineHeight}set lineHeight(Q){if(this._lineHeight===Q)return;this._lineHeight=Q,this.update()}get padding(){return this._padding}set padding(Q){if(this._padding===Q)return;this._padding=Q,this.update()}get filters(){return this._filters}set filters(Q){if(this._filters===Q)return;this._filters=Object.freeze(Q),this.update()}get trim(){return this._trim}set trim(Q){if(this._trim===Q)return;this._trim=Q,this.update()}get textBaseline(){return this._textBaseline}set textBaseline(Q){if(this._textBaseline===Q)return;this._textBaseline=Q,this.update()}get whiteSpace(){return this._whiteSpace}set whiteSpace(Q){if(this._whiteSpace===Q)return;this._whiteSpace=Q,this.update()}get wordWrap(){return this._wordWrap}set wordWrap(Q){if(this._wordWrap===Q)return;this._wordWrap=Q,this.update()}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(Q){if(this._wordWrapWidth===Q)return;this._wordWrapWidth=Q,this.update()}get fill(){return this._originalFill}set fill(Q){if(Q===this._originalFill)return;if(this._originalFill=Q,this._isFillStyle(Q))this._originalFill=this._createProxy({...c.defaultFillStyle,...Q},()=>{this._fill=AQ({...this._originalFill},c.defaultFillStyle)});this._fill=AQ(Q===0?"black":Q,c.defaultFillStyle),this.update()}get stroke(){return this._originalStroke}set stroke(Q){if(Q===this._originalStroke)return;if(this._originalStroke=Q,this._isFillStyle(Q))this._originalStroke=this._createProxy({...c.defaultStrokeStyle,...Q},()=>{this._stroke=jQ({...this._originalStroke},c.defaultStrokeStyle)});this._stroke=jQ(Q,c.defaultStrokeStyle),this.update()}get tagStyles(){return this._tagStyles}set tagStyles(Q){if(this._tagStyles===Q)return;this._tagStyles=Q??void 0,this.update()}update(){this._tick++,this._cachedFontString=null,this.emit("update",this)}reset(){let Q=Z.defaultTextStyle;for(let $ in Q)this[$]=Q[$]}assign(Q){for(let $ in Q){let q=$;this[q]=Q[$]}return this}get styleKey(){return`${this.uid}-${this._tick}`}get _fontString(){if(this._cachedFontString===null)this._cachedFontString=JQ(this);return this._cachedFontString}_toObject(){return{align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill?{...this._fill}:void 0,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke?{...this._stroke}:void 0,textBaseline:this.textBaseline,trim:this.trim,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0,tagStyles:this._tagStyles?{...this._tagStyles}:void 0}}clone(){return new Z(this._toObject())}_getFinalPadding(){let Q=0;if(this._filters)for(let $=0;$<this._filters.length;$++)Q+=this._filters[$].padding;return Math.max(this._padding,Q)}destroy(Q=!1){if(this.removeAllListeners(),typeof Q==="boolean"?Q:Q?.texture){let q=typeof Q==="boolean"?Q:Q?.textureSource;if(this._fill?.texture)this._fill.texture.destroy(q);if(this._originalFill?.texture)this._originalFill.texture.destroy(q);if(this._stroke?.texture)this._stroke.texture.destroy(q);if(this._originalStroke?.texture)this._originalStroke.texture.destroy(q)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(Q,$){return new Proxy(Q,{set:(q,J,V)=>{if(q[J]===V)return!0;return q[J]=V,$?.(J,V),this.update(),!0}})}_isFillStyle(Q){return(Q??null)!==null&&!(h.isColorLike(Q)||Q instanceof t||Q instanceof qQ)}};EQ.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};EQ.defaultTextStyle={align:"left",breakWords:!1,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};var QQ=EQ;function JZ(Z){let Q=Z;if(typeof Q.dropShadow==="boolean"&&Q.dropShadow){let $=QQ.defaultDropShadow;Z.dropShadow={alpha:Q.dropShadowAlpha??$.alpha,angle:Q.dropShadowAngle??$.angle,blur:Q.dropShadowBlur??$.blur,color:Q.dropShadowColor??$.color,distance:Q.dropShadowDistance??$.distance}}if(Q.strokeThickness!==void 0){g(S,"strokeThickness is now a part of stroke");let $=Q.stroke,q={};if(h.isColorLike($))q.color=$;else if($ instanceof t||$ instanceof qQ)q.fill=$;else if(Object.hasOwnProperty.call($,"color")||Object.hasOwnProperty.call($,"fill"))q=$;else throw Error("Invalid stroke value.");Z.stroke={...q,width:Q.strokeThickness}}if(Array.isArray(Q.fillGradientStops)){if(g(S,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(Q.fill)||Q.fill.length===0)throw Error("Invalid fill value. Expected an array of colors for gradient fill.");if(Q.fill.length!==Q.fillGradientStops.length)e("The number of fill colors must match the number of fill gradient stops.");let $=new t({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),q=Q.fillGradientStops.slice(),J=Q.fill.map((V)=>h.shared.setValue(V).toNumber());q.forEach((V,Y)=>{$.addColorStop(V,J[Y])}),Z.fill={fill:$}}}var gQ=1e5;function bQ(Z,Q,$,q=0,J=0,V=0){if(Z.texture===u.WHITE&&!Z.fill)return h.shared.setValue(Z.color).setAlpha(Z.alpha??1).toHexa();else if(!Z.fill){let Y=Q.createPattern(Z.texture.source.resource,"repeat"),X=Z.matrix.copyTo(BQ.shared);return X.scale(Z.texture.source.pixelWidth,Z.texture.source.pixelHeight),Y.setTransform(X),Y}else if(Z.fill instanceof qQ){let Y=Z.fill,X=Q.createPattern(Y.texture.source.resource,"repeat"),z=Y.transform.copyTo(BQ.shared);return z.scale(Y.texture.source.pixelWidth,Y.texture.source.pixelHeight),X.setTransform(z),X}else if(Z.fill instanceof t){let Y=Z.fill,X=Y.type==="linear",z=Y.textureSpace==="local",U=1,K=1;if(z&&$)U=$.width+q,K=$.height+q;let H,D=!1;if(X){let{start:A,end:j}=Y;H=Q.createLinearGradient(A.x*U+J,A.y*K+V,j.x*U+J,j.y*K+V),D=Math.abs(j.x-A.x)<Math.abs((j.y-A.y)*0.1)}else{let{center:A,innerRadius:j,outerCenter:M,outerRadius:B}=Y;H=Q.createRadialGradient(A.x*U+J,A.y*K+V,j*U,M.x*U+J,M.y*K+V,B*U)}if(D&&z&&$){let A=$.lineHeight/K;for(let j=0;j<$.lines.length;j++){let M=(j*$.lineHeight+q/2)/K;Y.colorStops.forEach((B)=>{let G=M+B.offset*A;G=Math.max(0,Math.min(1,G)),H.addColorStop(Math.floor(G*gQ)/gQ,h.shared.setValue(B.color).toHex())})}}else Y.colorStops.forEach((A)=>{H.addColorStop(A.offset,h.shared.setValue(A.color).toHex())});return H}return e("FillStyle not recognised",Z),"red"}var pQ=class Z extends $Q{constructor(Q){super();this.resolution=1,this.pages=[],this._padding=0,this._measureCache=Object.create(null),this._currentChars=[],this._currentX=0,this._currentY=0,this._currentMaxCharHeight=0,this._currentPageIndex=-1,this._skipKerning=!1;let $={...Z.defaultOptions,...Q};this._textureSize=$.textureSize,this._mipmap=$.mipmap;let q=$.style.clone();if($.overrideFill)q._fill.color=16777215,q._fill.alpha=1,q._fill.texture=u.WHITE,q._fill.fill=null;this.applyFillAsTint=$.overrideFill;let J=q.fontSize;q.fontSize=this.baseMeasurementFontSize;let V=JQ(q);if($.overrideSize){if(q._stroke)q._stroke.width*=this.baseRenderedFontSize/J;if(q.dropShadow)q.dropShadow.blur*=this.baseRenderedFontSize/J,q.dropShadow.distance*=this.baseRenderedFontSize/J}else q.fontSize=this.baseRenderedFontSize=J;if(this._style=q,this._skipKerning=$.skipKerning??!1,this.resolution=$.resolution??1,this._padding=$.padding??4,$.textureStyle)this._textureStyle=$.textureStyle instanceof DQ?$.textureStyle:new DQ($.textureStyle);this.fontMetrics=a.measureFont(V),this.lineHeight=q.lineHeight||this.fontMetrics.fontSize||q.fontSize}ensureCharacters(Q){let $=a.graphemeSegmenter(Q).filter((G)=>!this._currentChars.includes(G)).filter((G,E,P)=>P.indexOf(G)===E);if(!$.length)return;this._currentChars=[...this._currentChars,...$];let q;if(this._currentPageIndex===-1)q=this._nextPage();else q=this.pages[this._currentPageIndex];let{canvas:J,context:V}=q.canvasAndContext,Y=q.texture.source,X=this._style,z=this._currentX,U=this._currentY,K=this._currentMaxCharHeight,H=this.baseRenderedFontSize/this.baseMeasurementFontSize,D=(X.dropShadow?.distance??0)+(X._stroke?.width??0),A=this._padding+D,j=!1,M=J.width/this.resolution,B=J.height/this.resolution;for(let G=0;G<$.length;G++){let E=$[G],P=a.measureText(E,X,J,!1);P.lineHeight=P.height;let N=P.width*H,O=Math.ceil((X.fontStyle==="italic"?2:1)*N),I=P.height*H,W=O+A*2,b=I+A*2;if(j=!1,E!==`
|
|
7
|
+
`&&E!=="\r"&&E!=="\t"&&E!==" ")j=!0,K=Math.ceil(Math.max(b,K));if(z+W>M){if(U+=K,K=b,z=0,U+K>B){Y.update();let C=this._nextPage();J=C.canvasAndContext.canvas,V=C.canvasAndContext.context,Y=C.texture.source,z=0,U=0,K=0}}let T=V.measureText(E).width/H;if(this.chars[E]={id:E.codePointAt(0),xOffset:-(A/H),yOffset:-(A/H),xAdvance:T,kerning:{}},j){this._drawGlyph(V,P,z+A,U+A,H,X);let C=Y.width*H,R=Y.height*H,_=new VQ(z/C*Y.width,U/R*Y.height,W/C*Y.width,b/R*Y.height);this.chars[E].texture=new u({source:Y,frame:_}),z+=Math.ceil(W)}}if(Y.update(),this._currentX=z,this._currentY=U,this._currentMaxCharHeight=K,!this._skipKerning)this._applyKerning($,V,H)}get pageTextures(){return g(S,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}_applyKerning(Q,$,q){let J=this._measureCache;for(let V=0;V<Q.length;V++){let Y=Q[V];for(let X=0;X<this._currentChars.length;X++){let z=this._currentChars[X],U=J[Y];if(!U)U=J[Y]=$.measureText(Y).width;let K=J[z];if(!K)K=J[z]=$.measureText(z).width;let H=$.measureText(Y+z).width,D=H-(U+K);if(D&&this.chars[Y])this.chars[Y].kerning[z]=D/q;if(H=$.measureText(Y+z).width,D=H-(U+K),D&&this.chars[z])this.chars[z].kerning[Y]=D/q}}}_nextPage(){this._currentPageIndex++;let Q=this.resolution,$=MQ.getOptimalCanvasAndContext(this._textureSize,this._textureSize,Q);this._setupContext($.context,this._style,Q);let q=Q*(this.baseRenderedFontSize/this.baseMeasurementFontSize),J=new u({source:new mQ({resource:$.canvas,resolution:q,alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:this._mipmap})});if(this._textureStyle)J.source.style=this._textureStyle;let V={canvasAndContext:$,texture:J};return this.pages[this._currentPageIndex]=V,V}_setupContext(Q,$,q){$.fontSize=this.baseRenderedFontSize,Q.scale(q,q),Q.font=JQ($),$.fontSize=this.baseMeasurementFontSize,Q.textBaseline=$.textBaseline;let J=$._stroke,V=J?.width??0;if(J)Q.lineWidth=V,Q.lineJoin=J.join,Q.miterLimit=J.miterLimit,Q.strokeStyle=bQ(J,Q);if($._fill)Q.fillStyle=bQ($._fill,Q);if($.dropShadow){let Y=$.dropShadow,X=h.shared.setValue(Y.color).toArray(),z=Y.blur*q,U=Y.distance*q;Q.shadowColor=`rgba(${X[0]*255},${X[1]*255},${X[2]*255},${Y.alpha})`,Q.shadowBlur=z,Q.shadowOffsetX=Math.cos(Y.angle)*U,Q.shadowOffsetY=Math.sin(Y.angle)*U}else Q.shadowColor="black",Q.shadowBlur=0,Q.shadowOffsetX=0,Q.shadowOffsetY=0}_drawGlyph(Q,$,q,J,V,Y){let{text:X,fontProperties:z}=$,K=(Y._stroke?.width??0)*V,H=q+K/2,D=J-K/2,A=z.descent*V,j=$.lineHeight*V,M=!1;if(Y.stroke&&K)M=!0,Q.strokeText(X,H,D+j-A);let{shadowBlur:B,shadowOffsetX:G,shadowOffsetY:E}=Q;if(Y._fill){if(M)Q.shadowBlur=0,Q.shadowOffsetX=0,Q.shadowOffsetY=0;Q.fillText(X,H,D+j-A)}if(M)Q.shadowBlur=B,Q.shadowOffsetX=G,Q.shadowOffsetY=E}destroy(){super.destroy();for(let Q=0;Q<this.pages.length;Q++){let{canvasAndContext:$,texture:q}=this.pages[Q];MQ.returnCanvasAndContext($),q.destroy(!0)}this.pages=null}};pQ.defaultOptions={textureSize:512,style:new QQ,mipmap:!0};var RQ=pQ;function xQ(Z,Q,$,q){let J={width:0,height:0,offsetY:0,scale:Q.fontSize/$.baseMeasurementFontSize,lines:[{width:0,charPositions:[],spaceWidth:0,spacesIndex:[],chars:[]}]};J.offsetY=$.baseLineOffset;let V=J.lines[0],Y=null,X=!0,z={spaceWord:!1,width:0,start:0,index:0,positions:[],chars:[]},U=$.baseMeasurementFontSize/Q.fontSize,K=Q.letterSpacing*U,H=Q.wordWrapWidth*U,D=Q.lineHeight?Q.lineHeight*U:$.lineHeight,A=Q.wordWrap&&Q.breakWords,j=n(Q.whiteSpace),M=s(Q.whiteSpace);if(j||M){let P=[],N=j;for(let O=0;O<Z.length;O++){let I=Z[O];if(I==="\r"||I===`
|
|
8
|
+
`)if(M){if(I==="\r"&&Z[O+1]===`
|
|
9
|
+
`)O++;I=" "}else{if(j)N=!0;P.push(I);continue}if(f(I))if(j&&IQ(I)){if(N)continue;N=!0,P.push(" ")}else N=!1,P.push(I);else N=!1,P.push(I)}Z=P}let B=(P)=>{let N=V.width;for(let O=0;O<z.index;O++){let I=P.positions[O];V.chars.push(P.chars[O]),V.charPositions.push(I+N)}if(V.width+=P.width,z.index>0||!j)X=!1;z.width=0,z.index=0,z.chars.length=0},G=()=>{let P=V.chars.length-1;if(q){let N=V.chars[P];while(IQ(N))V.width-=$.chars[N].xAdvance,V.spacesIndex.pop(),N=V.chars[--P]}J.width=Math.max(J.width,V.width),V={width:0,charPositions:[],chars:[],spaceWidth:0,spacesIndex:[]},X=!0,J.lines.push(V),J.height+=D},E=(P)=>P-K>H;for(let P=0;P<Z.length+1;P++){let N,O=P===Z.length;if(!O)N=Z[P];let I=$.chars[N];if(/(?:\s)/.test(N)||N==="\r"||N===`
|
|
10
|
+
`||O){if(!X&&Q.wordWrap&&E(V.width+z.width)){if(G(),B(z),!O)V.charPositions.push(0)}else if(z.start=V.width,B(z),!O)V.charPositions.push(0);if(N==="\r"||N===`
|
|
11
|
+
`)G();else if(!O&&I){let C=I.xAdvance+(I.kerning?.[Y]||0)+K;V.width+=C,V.spaceWidth=C,V.spacesIndex.push(V.charPositions.length),V.chars.push(N)}}else if(I){let T=I.kerning?.[Y]||0,C=I.xAdvance+T+K;if(A&&E(z.width+C)){if(!X)G();B(z),G()}if(z.positions[z.index++]=z.width+T,z.chars.push(N),z.width+=C,PQ(N)){if(!X&&Q.wordWrap&&E(V.width+z.width))G();B(z)}}Y=N}if(G(),Q.wordWrap&&Q.align!=="left")J.width=Math.max(J.width,H);if(Q.align==="center")qZ(J);else if(Q.align==="right")VZ(J);else if(Q.align==="justify")YZ(J);return J}function qZ(Z){for(let Q=0;Q<Z.lines.length;Q++){let $=Z.lines[Q],q=Z.width/2-$.width/2;for(let J=0;J<$.charPositions.length;J++)$.charPositions[J]+=q}}function VZ(Z){for(let Q=0;Q<Z.lines.length;Q++){let $=Z.lines[Q],q=Z.width-$.width;for(let J=0;J<$.charPositions.length;J++)$.charPositions[J]+=q}}function YZ(Z){let Q=Z.width;for(let $=0;$<Z.lines.length-2;$++){let q=Z.lines[$],J=0,V=q.spacesIndex[J++],Y=0,X=q.spacesIndex.length,U=(Q-q.width)/X;for(let K=0;K<q.charPositions.length;K++){if(K===V)V=q.spacesIndex[J++],Y+=U;q.charPositions[K]+=Y}}}function hQ(Z){if(Z==="")return[];if(typeof Z==="string")Z=[Z];let Q=[];for(let $=0,q=Z.length;$<q;$++){let J=Z[$];if(Array.isArray(J)){if(J.length!==2)throw Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${J.length}.`);if(J[0].length===0||J[1].length===0)throw Error("[BitmapFont]: Invalid character delimiter.");let V=J[0].charCodeAt(0),Y=J[1].charCodeAt(0);if(Y<V)throw Error("[BitmapFont]: Invalid character range.");for(let X=V,z=Y;X<=z;X++)Q.push(String.fromCharCode(X))}else Q.push(...Array.from(J))}if(Q.length===0)throw Error("[BitmapFont]: Empty set when resolving characters.");return Q}var HQ=0;class dQ{constructor(){this.ALPHA=[["a","z"],["A","Z"]," "],this.NUMERIC=[["0","9"]],this.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],this.ASCII=[[" ","~"]],this.defaultOptions={chars:this.ALPHANUMERIC,resolution:1,padding:4,skipKerning:!1,textureStyle:null},this.measureCache=UQ(1000)}getFont(Z,Q){let $=`${Q.fontFamily}-bitmap`,q=!0;if(d.has($)){let V=d.get($);return V.ensureCharacters?.(Z),V}if(Q._fill.fill&&!Q._stroke)$+=Q._fill.fill.styleKey,q=!1;else if(Q._stroke||Q.dropShadow)$=`${Q.styleKey}-bitmap`,q=!1;if($+=`-${Q.fontStyle}`,$+=`-${Q.fontVariant}`,$+=`-${Q.fontWeight}`,!d.has($)){let V=Object.create(Q);V._lineHeight=0;let Y=new RQ({style:V,overrideFill:q,overrideSize:!0,...this.defaultOptions});if(HQ++,HQ>50)e("BitmapText",`You have dynamically created ${HQ} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``);Y.once("destroy",()=>{HQ--,d.remove($)}),d.set($,Y)}let J=d.get($);return J.ensureCharacters?.(Z),J}getLayout(Z,Q,$=!0){let q=this.getFont(Z,Q),J=`${Z}-${Q.styleKey}-${$}`;if(this.measureCache.has(J))return this.measureCache.get(J);let V=a.graphemeSegmenter(Z),Y=xQ(V,Q,q,$);return this.measureCache.set(J,Y),Y}measureText(Z,Q,$=!0){return this.getLayout(Z,Q,$)}install(...Z){let Q=Z[0];if(typeof Q==="string")Q={name:Q,style:Z[1],chars:Z[2]?.chars,resolution:Z[2]?.resolution,padding:Z[2]?.padding,skipKerning:Z[2]?.skipKerning},g(S,"BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})");let $=Q?.name;if(!$)throw Error("[BitmapFontManager] Property `name` is required.");Q={...this.defaultOptions,...Q};let q=Q.style,J=q instanceof QQ?q:new QQ(q),V=Q.dynamicFill??this._canUseTintForStyle(J),Y=new RQ({style:J,overrideFill:V,skipKerning:Q.skipKerning,padding:Q.padding,resolution:Q.resolution,overrideSize:!1,textureStyle:Q.textureStyle}),X=hQ(Q.chars);return Y.ensureCharacters(X.join("")),d.set(`${$}-bitmap`,Y),Y.once("destroy",()=>d.remove(`${$}-bitmap`)),Y}uninstall(Z){let Q=`${Z}-bitmap`,$=d.get(Q);if($)$.destroy()}_canUseTintForStyle(Z){return!Z._stroke&&(!Z.dropShadow||Z.dropShadow.color===0)&&!Z._fill.fill&&Z._fill.color===16777215}}var _Q=new dQ;class zZ extends $Q{constructor(Z,Q){super();let{textures:$,data:q}=Z;Object.keys(q.pages).forEach((J)=>{let V=q.pages[parseInt(J,10)],Y=$[V.id];this.pages.push({texture:Y})}),Object.keys(q.chars).forEach((J)=>{let V=q.chars[J],{frame:Y,source:X,rotate:z}=$[V.page],U=yQ.transformRectCoords(V,Y,z,new VQ),K=new u({frame:U,orig:new VQ(0,0,V.width,V.height),source:X,rotate:z});this.chars[J]={id:J.codePointAt(0),xOffset:V.xOffset,yOffset:V.yOffset,xAdvance:V.xAdvance,kerning:V.kerning??{},texture:K}}),this.baseRenderedFontSize=q.fontSize,this.baseMeasurementFontSize=q.fontSize,this.fontMetrics={ascent:0,descent:0,fontSize:q.fontSize},this.baseLineOffset=q.baseLineOffset,this.lineHeight=q.lineHeight,this.fontFamily=q.fontFamily,this.distanceField=q.distanceField??{type:"none",range:0},this.url=Q}destroy(){super.destroy();for(let Z=0;Z<this.pages.length;Z++){let{texture:Q}=this.pages[Z];Q.destroy(!0)}this.pages=null}static install(Z){_Q.install(Z)}static uninstall(Z){_Q.uninstall(Z)}}export{zZ as fa};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as a}from"./chunk-vkkhj28s.js";import"./chunk-tqbn5m4a.js";import"./chunk-z898rh1p.js";import"./chunk-w1tshfsy.js";import"./chunk-8wvq4dfz.js";import"./chunk-sqnzgty6.js";import"./chunk-cs4e65d1.js";export{a as WebGLRenderer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{N as l,O as n,P as $J,S as HJ,T as j,Y as qJ,_ as T,aa as i,ba as NJ,da as BJ}from"./chunk-kt3t4zv0.js";import{fa as R,ga as I}from"./chunk-kkmq6cvb.js";import{sa as OJ}from"./chunk-pn7re3na.js";import{Ja as G,Ka as A,Qa as c,Va as M,Ya as y,Za as P,db as U,fb as YJ,hb as B,ib as S,lb as wJ,nb as CJ,ob as UJ,pb as jJ,qb as FJ,ub as MJ}from"./chunk-1sw3e1ar.js";var h=((J)=>{return J[J.Low=0]="Low",J[J.Normal=1]="Normal",J[J.High=2]="High",J})(h||{});function E(J){if(typeof J!=="string")throw TypeError(`Path must be a string. Received ${JSON.stringify(J)}`)}function v(J){return J.split("?")[0].split("#")[0]}function AJ(J){return J.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vJ(J,Q,Z){return J.replace(new RegExp(AJ(Q),"g"),Z)}function yJ(J,Q){let Z="",$=0,H=-1,W=0,K=-1;for(let q=0;q<=J.length;++q){if(q<J.length)K=J.charCodeAt(q);else if(K===47)break;else K=47;if(K===47){if(H===q-1||W===1);else if(H!==q-1&&W===2){if(Z.length<2||$!==2||Z.charCodeAt(Z.length-1)!==46||Z.charCodeAt(Z.length-2)!==46){if(Z.length>2){let _=Z.lastIndexOf("/");if(_!==Z.length-1){if(_===-1)Z="",$=0;else Z=Z.slice(0,_),$=Z.length-1-Z.lastIndexOf("/");H=q,W=0;continue}}else if(Z.length===2||Z.length===1){Z="",$=0,H=q,W=0;continue}}if(Q){if(Z.length>0)Z+="/..";else Z="..";$=2}}else{if(Z.length>0)Z+=`/${J.slice(H+1,q)}`;else Z=J.slice(H+1,q);$=q-H-1}H=q,W=0}else if(K===46&&W!==-1)++W;else W=-1}return Z}var F={toPosix(J){return vJ(J,"\\","/")},isUrl(J){return/^https?:/.test(this.toPosix(J))},isDataUrl(J){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(J)},isBlobUrl(J){return J.startsWith("blob:")},hasProtocol(J){return/^[^/:]+:/.test(this.toPosix(J))},getProtocol(J){E(J),J=this.toPosix(J);let Q=/^file:\/\/\//.exec(J);if(Q)return Q[0];let Z=/^[^/:]+:\/{0,2}/.exec(J);if(Z)return Z[0];return""},toAbsolute(J,Q,Z){if(E(J),this.isDataUrl(J)||this.isBlobUrl(J))return J;let $=v(this.toPosix(Q??S.get().getBaseUrl())),H=v(this.toPosix(Z??this.rootname($)));if(J=this.toPosix(J),J.startsWith("/"))return F.join(H,J.slice(1));return this.isAbsolute(J)?J:this.join($,J)},normalize(J){if(E(J),J.length===0)return".";if(this.isDataUrl(J)||this.isBlobUrl(J))return J;J=this.toPosix(J);let Q="",Z=J.startsWith("/");if(this.hasProtocol(J))Q=this.rootname(J),J=J.slice(Q.length);let $=J.endsWith("/");if(J=yJ(J,!1),J.length>0&&$)J+="/";if(Z)return`/${J}`;return Q+J},isAbsolute(J){if(E(J),J=this.toPosix(J),this.hasProtocol(J))return!0;return J.startsWith("/")},join(...J){if(J.length===0)return".";let Q;for(let Z=0;Z<J.length;++Z){let $=J[Z];if(E($),$.length>0)if(Q===void 0)Q=$;else{let H=J[Z-1]??"";if(this.joinExtensions.includes(this.extname(H).toLowerCase()))Q+=`/../${$}`;else Q+=`/${$}`}}if(Q===void 0)return".";return this.normalize(Q)},dirname(J){if(E(J),J.length===0)return".";J=this.toPosix(J);let Q=J.charCodeAt(0),Z=Q===47,$=-1,H=!0,W=this.getProtocol(J),K=J;J=J.slice(W.length);for(let q=J.length-1;q>=1;--q)if(Q=J.charCodeAt(q),Q===47){if(!H){$=q;break}}else H=!1;if($===-1)return Z?"/":this.isUrl(K)?W+J:W;if(Z&&$===1)return"//";return W+J.slice(0,$)},rootname(J){E(J),J=this.toPosix(J);let Q="";if(J.startsWith("/"))Q="/";else Q=this.getProtocol(J);if(this.isUrl(J)){let Z=J.indexOf("/",Q.length);if(Z!==-1)Q=J.slice(0,Z);else Q=J;if(!Q.endsWith("/"))Q+="/"}return Q},basename(J,Q){if(E(J),Q)E(Q);J=v(this.toPosix(J));let Z=0,$=-1,H=!0,W;if(Q!==void 0&&Q.length>0&&Q.length<=J.length){if(Q.length===J.length&&Q===J)return"";let K=Q.length-1,q=-1;for(W=J.length-1;W>=0;--W){let _=J.charCodeAt(W);if(_===47){if(!H){Z=W+1;break}}else{if(q===-1)H=!1,q=W+1;if(K>=0)if(_===Q.charCodeAt(K)){if(--K===-1)$=W}else K=-1,$=q}}if(Z===$)$=q;else if($===-1)$=J.length;return J.slice(Z,$)}for(W=J.length-1;W>=0;--W)if(J.charCodeAt(W)===47){if(!H){Z=W+1;break}}else if($===-1)H=!1,$=W+1;if($===-1)return"";return J.slice(Z,$)},extname(J){E(J),J=v(this.toPosix(J));let Q=-1,Z=0,$=-1,H=!0,W=0;for(let K=J.length-1;K>=0;--K){let q=J.charCodeAt(K);if(q===47){if(!H){Z=K+1;break}continue}if($===-1)H=!1,$=K+1;if(q===46){if(Q===-1)Q=K;else if(W!==1)W=1}else if(Q!==-1)W=-1}if(Q===-1||$===-1||W===0||W===1&&Q===$-1&&Q===Z+1)return"";return J.slice(Q,$)},parse(J){E(J);let Q={root:"",dir:"",base:"",ext:"",name:""};if(J.length===0)return Q;J=v(this.toPosix(J));let Z=J.charCodeAt(0),$=this.isAbsolute(J),H,W="";if(Q.root=this.rootname(J),$||this.hasProtocol(J))H=1;else H=0;let K=-1,q=0,_=-1,Y=!0,N=J.length-1,z=0;for(;N>=H;--N){if(Z=J.charCodeAt(N),Z===47){if(!Y){q=N+1;break}continue}if(_===-1)Y=!1,_=N+1;if(Z===46){if(K===-1)K=N;else if(z!==1)z=1}else if(K!==-1)z=-1}if(K===-1||_===-1||z===0||z===1&&K===_-1&&K===q+1){if(_!==-1)if(q===0&&$)Q.base=Q.name=J.slice(1,_);else Q.base=Q.name=J.slice(q,_)}else{if(q===0&&$)Q.name=J.slice(1,K),Q.base=J.slice(1,_);else Q.name=J.slice(q,K),Q.base=J.slice(q,_);Q.ext=J.slice(K,_)}if(Q.dir=this.dirname(J),W)Q.dir=W+Q.dir;return Q},sep:"/",delimiter:":",joinExtensions:[".html"]};function t(J,Q,Z,$,H){let W=Q[Z];for(let K=0;K<W.length;K++){let q=W[K];if(Z<Q.length-1)t(J.replace($[Z],q),Q,Z+1,$,H);else H.push(J.replace($[Z],q))}}function e(J){let Q=/\{(.*?)\}/g,Z=J.match(Q),$=[];if(Z){let H=[];Z.forEach((W)=>{let K=W.substring(1,W.length-1).split(",");H.push(K)}),t(J,H,0,Z,$)}else $.push(J);return $}var d=(J)=>!Array.isArray(J);class D{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(J,Q)=>`${J}${this._bundleIdConnector}${Q}`,extractAssetIdFromBundle:(J,Q)=>Q.replace(`${J}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(J){if(this._bundleIdConnector=J.connector??this._bundleIdConnector,this._createBundleAssetId=J.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=J.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...J){J.forEach((Q)=>{if(this._preferredOrder.push(Q),!Q.priority)Q.priority=Object.keys(Q.params)}),this._resolverHash={}}set basePath(J){this._basePath=J}get basePath(){return this._basePath}set rootPath(J){this._rootPath=J}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(J){if(typeof J==="string")this._defaultSearchParams=J;else{let Q=J;this._defaultSearchParams=Object.keys(Q).map((Z)=>`${encodeURIComponent(Z)}=${encodeURIComponent(Q[Z])}`).join("&")}}getAlias(J){let{alias:Q,src:Z}=J;return R(Q||Z,(H)=>{if(typeof H==="string")return H;if(Array.isArray(H))return H.map((W)=>W?.src??W);if(H?.src)return H.src;return H},!0)}addManifest(J){if(this._manifest)M("[Resolver] Manifest already exists, this will be overwritten");this._manifest=J,J.bundles.forEach((Q)=>{this.addBundle(Q.name,Q.assets)})}addBundle(J,Q){let Z=[],$=Q;if(!Array.isArray(Q))$=Object.entries(Q).map(([H,W])=>{if(typeof W==="string"||Array.isArray(W))return{alias:H,src:W};return{alias:H,...W}});$.forEach((H)=>{let{src:W,alias:K}=H,q;if(typeof K==="string"){let _=this._createBundleAssetId(J,K);Z.push(_),q=[K,_]}else{let _=K.map((Y)=>this._createBundleAssetId(J,Y));Z.push(..._),q=[...K,..._]}this.add({...H,...{alias:q,src:W}})}),this._bundles[J]=Z}add(J){let Q=[];if(Array.isArray(J))Q.push(...J);else Q.push(J);let Z;Z=(H)=>{if(this.hasKey(H))M(`[Resolver] already has key: ${H} overwriting`)},R(Q).forEach((H)=>{let{src:W}=H,{data:K,format:q,loadParser:_,parser:Y}=H,N=R(W).map((O)=>{if(typeof O==="string")return e(O);return Array.isArray(O)?O:[O]}),z=this.getAlias(H);Array.isArray(z)?z.forEach(Z):Z(z);let X=[],V=(O)=>{let w=this._parsers.find((C)=>C.test(O));return{src:O,...w?.parse(O)}};N.forEach((O)=>{O.forEach((w)=>{let C={};if(typeof w!=="object")C=V(w);else{if(K=w.data??K,q=w.format??q,w.loadParser||w.parser)_=w.loadParser??_,Y=w.parser??Y;C={...V(w.src),...w}}if(!z)throw Error(`[Resolver] alias is undefined for this asset: ${C.src}`);C=this._buildResolvedAsset(C,{aliases:z,data:K,format:q,loadParser:_,parser:Y,progressSize:H.progressSize}),X.push(C)})}),z.forEach((O)=>{this._assetMap[O]=X})})}resolveBundle(J){let Q=d(J);J=R(J);let Z={};return J.forEach(($)=>{let H=this._bundles[$];if(H){let W=this.resolve(H),K={};for(let q in W){let _=W[q];K[this._extractAssetIdFromBundle($,q)]=_}Z[$]=K}}),Q?Z[J[0]]:Z}resolveUrl(J){let Q=this.resolve(J);if(typeof J!=="string"){let Z={};for(let $ in Q)Z[$]=Q[$].src;return Z}return Q.src}resolve(J){let Q=d(J);J=R(J);let Z={};return J.forEach(($)=>{if(!this._resolverHash[$])if(this._assetMap[$]){let H=this._assetMap[$],W=this._getPreferredOrder(H);W?.priority.forEach((K)=>{W.params[K].forEach((q)=>{let _=H.filter((Y)=>{if(Y[K])return Y[K]===q;return!1});if(_.length)H=_})}),this._resolverHash[$]=H[0]}else this._resolverHash[$]=this._buildResolvedAsset({alias:[$],src:$},{});Z[$]=this._resolverHash[$]}),Q?Z[J[0]]:Z}hasKey(J){return!!this._assetMap[J]}hasBundle(J){return!!this._bundles[J]}_getPreferredOrder(J){for(let Q=0;Q<J.length;Q++){let Z=J[Q],$=this._preferredOrder.find((H)=>H.params.format.includes(Z.format));if($)return $}return this._preferredOrder[0]}_appendDefaultSearchParams(J){if(!this._defaultSearchParams)return J;let Q=/\?/.test(J)?"&":"?";return`${J}${Q}${this._defaultSearchParams}`}_buildResolvedAsset(J,Q){let{aliases:Z,data:$,loadParser:H,parser:W,format:K,progressSize:q}=Q;if(this._basePath||this._rootPath)J.src=F.toAbsolute(J.src,this._basePath,this._rootPath);if(J.alias=Z??J.alias??[J.src],J.src=this._appendDefaultSearchParams(J.src),J.data={...$||{},...J.data},J.loadParser=H??J.loadParser,J.parser=W??J.parser,J.format=K??J.format??TJ(J.src),q!==void 0)J.progressSize=q;return J}}D.RETINA_PREFIX=/@([0-9\.]+)x/;function TJ(J){return J.split(".").pop().split("?").shift().split("#").shift()}var p=(J,Q)=>{let Z=Q.split("?")[1];if(Z)J+=`?${Z}`;return J};var JJ=class J{constructor(Q,Z){this.linkedSheets=[];let $=Q;if(Q?.source instanceof U)$={texture:Q,data:Z};let{texture:H,data:W,cachePrefix:K=""}=$;this.cachePrefix=K,this._texture=H instanceof B?H:null,this.textureSource=H.source,this.textures={},this.animations={},this.data=W;let q=parseFloat(W.meta.scale);if(q)this.resolution=q,H.source.resolution=this.resolution;else this.resolution=H.source._resolution;this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise((Q)=>{if(this._callback=Q,this._batchIndex=0,this._frameKeys.length<=J.BATCH_SIZE)this._processFrames(0),this._processAnimations(),this._parseComplete();else this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(Q,Z=!1){let $=Q,H=Z?1/0:J.BATCH_SIZE;while($-Q<H&&$<this._frameKeys.length){let W=this._frameKeys[$],K=this._frames[W],q=K.frame;if(q){let _=null,Y=null,N=K.trimmed!==!1&&K.sourceSize?K.sourceSize:K.frame,z=new y(0,0,Math.floor(N.w)/this.resolution,Math.floor(N.h)/this.resolution);if(K.rotated)_=new y(Math.floor(q.x)/this.resolution,Math.floor(q.y)/this.resolution,Math.floor(q.h)/this.resolution,Math.floor(q.w)/this.resolution);else _=new y(Math.floor(q.x)/this.resolution,Math.floor(q.y)/this.resolution,Math.floor(q.w)/this.resolution,Math.floor(q.h)/this.resolution);if(K.trimmed!==!1&&K.spriteSourceSize)Y=new y(Math.floor(K.spriteSourceSize.x)/this.resolution,Math.floor(K.spriteSourceSize.y)/this.resolution,Math.floor(q.w)/this.resolution,Math.floor(q.h)/this.resolution);this.textures[W]=new B({source:this.textureSource,frame:_,orig:z,trim:Y,rotate:K.rotated?2:0,defaultAnchor:K.anchor,defaultBorders:K.borders,label:W.toString()})}$++}}_processAnimations(){let Q=this.data.animations||{};for(let Z in Q){this.animations[Z]=[];for(let $=0;$<Q[Z].length;$++){let H=Q[Z][$];this.animations[Z].push(this.textures[H])}}}_parseComplete(){let Q=this._callback;this._callback=null,this._batchIndex=0,Q.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*J.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{if(this._batchIndex*J.BATCH_SIZE<this._frameKeys.length)this._nextBatch();else this._processAnimations(),this._parseComplete()},0)}destroy(Q=!1){for(let Z in this.textures)this.textures[Z].destroy();if(this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,Q)this._texture?.destroy(),this.textureSource.destroy();this._texture=null,this.textureSource=null,this.linkedSheets=[]}};JJ.BATCH_SIZE=1000;var u=JJ;var SJ=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function QJ(J,Q,Z){let $={};if(J.forEach((H)=>{$[H]=Q}),Object.keys(Q.textures).forEach((H)=>{$[`${Q.cachePrefix}${H}`]=Q.textures[H]}),!Z){let H=F.dirname(J[0]);Q.linkedSheets.forEach((W,K)=>{let q=QJ([`${H}/${Q.data.meta.related_multi_packs[K]}`],W,!0);Object.assign($,q)})}return $}var ZJ={extension:G.Asset,cache:{test:(J)=>J instanceof u,getCacheableAssets:(J,Q)=>QJ(J,Q,!1)},resolver:{extension:{type:G.ResolveParser,name:"resolveSpritesheet"},test:(J)=>{let Z=J.split("?")[0].split("."),$=Z.pop(),H=Z.pop();return $==="json"&&SJ.includes(H)},parse:(J)=>{let Q=J.split(".");return{resolution:parseFloat(D.RETINA_PREFIX.exec(J)?.[1]??"1"),format:Q[Q.length-2],src:J}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:G.LoadParser,priority:h.Normal,name:"spritesheetLoader"},async testParse(J,Q){return F.extname(Q.src).toLowerCase()===".json"&&!!J.frames},async parse(J,Q,Z){let{texture:$,imageFilename:H,textureOptions:W,cachePrefix:K}=Q?.data??{},q=F.dirname(Q.src);if(q&&q.lastIndexOf("/")!==q.length-1)q+="/";let _;if($ instanceof B)_=$;else{let z=p(q+(H??J.meta.image),Q.src);_=(await Z.load([{src:z,data:W}]))[z]}let Y=new u({texture:_.source,data:J,cachePrefix:K});await Y.parse();let N=J?.meta?.related_multi_packs;if(Array.isArray(N)){let z=[];for(let V of N){if(typeof V!=="string")continue;let O=q+V;if(Q.data?.ignoreMultiPack)continue;O=p(O,Q.src),z.push(Z.load({src:O,data:{textureOptions:W,ignoreMultiPack:!0}}))}let X=await Promise.all(z);Y.linkedSheets=X,X.forEach((V)=>{V.linkedSheets=[Y].concat(Y.linkedSheets.filter((O)=>O!==V))})}return Y},async unload(J,Q,Z){await Z.unload(J.textureSource._sourceOrigin),J.destroy(!1)}}};A.add(ZJ);var DJ=new P;function k(J,Q,Z){let $=DJ;J.measurable=!0,$J(J,Z,$),Q.addBoundsMask($),J.measurable=!1}function g(J,Q,Z){let $=n.get();J.measurable=!0;let H=l.get().identity(),W=WJ(J,Z,H);HJ(J,$,W),J.measurable=!1,Q.addBoundsMask($),l.return(H),n.return($)}function WJ(J,Q,Z){if(!J)return M("Mask bounds, renderable is not inside the root container"),Z;if(J!==Q)WJ(J.parent,Q,Z),J.updateLocalTransform(),Z.append(J.localTransform);return Z}class b{constructor(J){if(this.priority=0,this.inverse=!1,this.pipe="alphaMask",J?.mask)this.init(J.mask)}init(J){this.mask=J,this.renderMaskToTexture=!(J instanceof i),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){if(this.mask===null)return;this.mask.measurable=!0,this.mask=null}addBounds(J,Q){if(!this.inverse)k(this.mask,J,Q)}addLocalBounds(J,Q){g(this.mask,J,Q)}containsPoint(J,Q){let Z=this.mask;return Q(Z,J)}destroy(){this.reset()}static test(J){return J instanceof i}}b.extension=G.MaskEffect;class x{constructor(J){if(this.priority=0,this.pipe="colorMask",J?.mask)this.init(J.mask)}init(J){this.mask=J}destroy(){}static test(J){return typeof J==="number"}}x.extension=G.MaskEffect;class f{constructor(J){if(this.priority=0,this.pipe="stencilMask",J?.mask)this.init(J.mask)}init(J){this.mask=J,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){if(this.mask===null)return;this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null}addBounds(J,Q){k(this.mask,J,Q)}addLocalBounds(J,Q){g(this.mask,J,Q)}containsPoint(J,Q){let Z=this.mask;return Q(Z,J)}destroy(){this.reset()}static test(J){return J instanceof qJ}}f.extension=G.MaskEffect;var o;async function KJ(){return o??(o=(async()=>{let Q=S.get().createCanvas(1,1).getContext("webgl");if(!Q)return"premultiply-alpha-on-upload";let Z=await new Promise((K)=>{let q=document.createElement("video");q.onloadeddata=()=>K(q),q.onerror=()=>K(null),q.autoplay=!1,q.crossOrigin="anonymous",q.preload="auto",q.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",q.load()});if(!Z)return"premultiply-alpha-on-upload";let $=Q.createTexture();Q.bindTexture(Q.TEXTURE_2D,$);let H=Q.createFramebuffer();Q.bindFramebuffer(Q.FRAMEBUFFER,H),Q.framebufferTexture2D(Q.FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_2D,$,0),Q.pixelStorei(Q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),Q.pixelStorei(Q.UNPACK_COLORSPACE_CONVERSION_WEBGL,Q.NONE),Q.texImage2D(Q.TEXTURE_2D,0,Q.RGBA,Q.RGBA,Q.UNSIGNED_BYTE,Z);let W=new Uint8Array(4);return Q.readPixels(0,0,1,1,Q.RGBA,Q.UNSIGNED_BYTE,W),Q.deleteFramebuffer(H),Q.deleteTexture($),Q.getExtension("WEBGL_lose_context")?.loseContext(),W[0]<=W[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),o}var m=class J extends U{constructor(Q){super(Q);if(this.isReady=!1,this.uploadMethodId="video",Q={...J.defaultOptions,...Q},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=Q.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=Q.autoPlay!==!1,this.alphaMode=Q.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),Q.autoLoad!==!1)this.load()}updateFrame(){if(this.destroyed)return;if(this._updateFPS){let Q=T.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-Q)}if(!this._updateFPS||this._msToNextUpdate<=0)this._msToNextUpdate=this._updateFPS?Math.floor(1000/this._updateFPS):0;if(this.isValid)this.update()}_videoFrameRequestCallback(){if(this.updateFrame(),this.destroyed)this._videoFrameRequestCallbackHandle=null;else this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;let Q=this.resource,Z=this.options;if((Q.readyState===Q.HAVE_ENOUGH_DATA||Q.readyState===Q.HAVE_FUTURE_DATA)&&Q.width&&Q.height)Q.complete=!0;if(Q.addEventListener("play",this._onPlayStart),Q.addEventListener("pause",this._onPlayStop),Q.addEventListener("seeked",this._onSeeked),!this._isSourceReady()){if(!Z.preload)Q.addEventListener("canplay",this._onCanPlay);Q.addEventListener("canplaythrough",this._onCanPlayThrough),Q.addEventListener("error",this._onError,!0)}else this._mediaReady();return this.alphaMode=await KJ(),this._load=new Promise(($,H)=>{if(this.isValid)$(this);else{if(this._resolve=$,this._reject=H,Z.preloadTimeoutMs!==void 0)this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${Z.preloadTimeoutMs}ms`))});Q.load()}}),this._load}_onError(Q){if(this.resource.removeEventListener("error",this._onError,!0),this.emit("error",Q),this._reject)this._reject(Q),this._reject=null,this._resolve=null}_isSourcePlaying(){let Q=this.resource;return!Q.paused&&!Q.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){if(!this.isValid)this._mediaReady();this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){if(this._autoUpdate&&!this._isSourcePlaying())this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){if(this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout)clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0;this._mediaReady()}_mediaReady(){let Q=this.resource;if(this.isValid)this.isReady=!0,this.resize(Q.videoWidth,Q.videoHeight);if(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve)this._resolve(this),this._resolve=null,this._reject=null;if(this._isSourcePlaying())this._onPlayStart();else if(this.autoPlay)this.resource.play()}destroy(){this._configureAutoUpdate();let Q=this.resource;if(Q)Q.removeEventListener("play",this._onPlayStart),Q.removeEventListener("pause",this._onPlayStop),Q.removeEventListener("seeked",this._onSeeked),Q.removeEventListener("canplay",this._onCanPlay),Q.removeEventListener("canplaythrough",this._onCanPlayThrough),Q.removeEventListener("error",this._onError,!0),Q.pause(),Q.src="",Q.load();super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(Q){if(Q!==this._autoUpdate)this._autoUpdate=Q,this._configureAutoUpdate()}get updateFPS(){return this._updateFPS}set updateFPS(Q){if(Q!==this._updateFPS)this._updateFPS=Q,this._configureAutoUpdate()}_configureAutoUpdate(){if(this._autoUpdate&&this._isSourcePlaying())if(!this._updateFPS&&this.resource.requestVideoFrameCallback){if(this._isConnectedToTicker)T.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0;if(this._videoFrameRequestCallbackHandle===null)this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}else{if(this._videoFrameRequestCallbackHandle!==null)this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null;if(!this._isConnectedToTicker)T.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0}else{if(this._videoFrameRequestCallbackHandle!==null)this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null;if(this._isConnectedToTicker)T.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0}}static test(Q){return globalThis.HTMLVideoElement&&Q instanceof HTMLVideoElement}};m.extension=G.TextureSource;m.defaultOptions={...U.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};m.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};var _J=m;var a=[];A.handleByList(G.TextureSource,a);function zJ(J={}){let Q=J&&J.resource,Z=Q?J.resource:J,$=Q?J:{resource:J};for(let H=0;H<a.length;H++){let W=a[H];if(W.test(Z))return new W($)}throw Error(`Could not find a source type for resource: ${$.resource}`)}function PJ(J={},Q=!1){let Z=J&&J.resource,$=Z?J.resource:J,H=Z?J:{resource:J};if(!Q&&I.has($))return I.get($);let W=new B({source:zJ(H)});if(W.on("destroy",()=>{if(I.has($))I.remove($)}),!Q)I.set($,W);return W}function kJ(J,Q=!1){if(typeof J==="string")return I.get(J);else if(J instanceof U)return new B({source:J});return PJ(J,Q)}B.from=kJ;U.from=zJ;A.add(b,x,f,_J,OJ,NJ,YJ);class XJ{constructor(J){this._renderer=J}push(J,Q,Z){this._renderer.renderPipes.batch.break(Z),Z.add({renderPipeId:"filter",canBundle:!1,action:"pushFilter",container:Q,filterEffect:J})}pop(J,Q,Z){this._renderer.renderPipes.batch.break(Z),Z.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}execute(J){if(J.action==="pushFilter")this._renderer.filter.push(J);else if(J.action==="popFilter")this._renderer.filter.pop()}destroy(){this._renderer=null}}XJ.extension={type:[G.WebGLPipes,G.WebGPUPipes,G.CanvasPipes],name:"filter"};var GJ=`in vec2 aPosition;
|
|
1
|
+
import{$ as T,O as l,P as n,Q as $J,T as HJ,U as j,Z as qJ,ba as i,ca as NJ,ea as BJ}from"./chunk-w1tshfsy.js";import{ga as R,ha as I}from"./chunk-jyb1nvnr.js";import{ta as OJ}from"./chunk-598ehnf5.js";import{Ka as G,La as A,Ra as c,Wa as M,Za as y,_a as P,eb as U,gb as YJ,ib as B,jb as S,mb as wJ,ob as CJ,pb as UJ,qb as jJ,rb as FJ,vb as MJ}from"./chunk-sqnzgty6.js";var h=((J)=>{return J[J.Low=0]="Low",J[J.Normal=1]="Normal",J[J.High=2]="High",J})(h||{});function E(J){if(typeof J!=="string")throw TypeError(`Path must be a string. Received ${JSON.stringify(J)}`)}function v(J){return J.split("?")[0].split("#")[0]}function AJ(J){return J.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vJ(J,Q,Z){return J.replace(new RegExp(AJ(Q),"g"),Z)}function yJ(J,Q){let Z="",$=0,H=-1,W=0,K=-1;for(let q=0;q<=J.length;++q){if(q<J.length)K=J.charCodeAt(q);else if(K===47)break;else K=47;if(K===47){if(H===q-1||W===1);else if(H!==q-1&&W===2){if(Z.length<2||$!==2||Z.charCodeAt(Z.length-1)!==46||Z.charCodeAt(Z.length-2)!==46){if(Z.length>2){let _=Z.lastIndexOf("/");if(_!==Z.length-1){if(_===-1)Z="",$=0;else Z=Z.slice(0,_),$=Z.length-1-Z.lastIndexOf("/");H=q,W=0;continue}}else if(Z.length===2||Z.length===1){Z="",$=0,H=q,W=0;continue}}if(Q){if(Z.length>0)Z+="/..";else Z="..";$=2}}else{if(Z.length>0)Z+=`/${J.slice(H+1,q)}`;else Z=J.slice(H+1,q);$=q-H-1}H=q,W=0}else if(K===46&&W!==-1)++W;else W=-1}return Z}var F={toPosix(J){return vJ(J,"\\","/")},isUrl(J){return/^https?:/.test(this.toPosix(J))},isDataUrl(J){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(J)},isBlobUrl(J){return J.startsWith("blob:")},hasProtocol(J){return/^[^/:]+:/.test(this.toPosix(J))},getProtocol(J){E(J),J=this.toPosix(J);let Q=/^file:\/\/\//.exec(J);if(Q)return Q[0];let Z=/^[^/:]+:\/{0,2}/.exec(J);if(Z)return Z[0];return""},toAbsolute(J,Q,Z){if(E(J),this.isDataUrl(J)||this.isBlobUrl(J))return J;let $=v(this.toPosix(Q??S.get().getBaseUrl())),H=v(this.toPosix(Z??this.rootname($)));if(J=this.toPosix(J),J.startsWith("/"))return F.join(H,J.slice(1));return this.isAbsolute(J)?J:this.join($,J)},normalize(J){if(E(J),J.length===0)return".";if(this.isDataUrl(J)||this.isBlobUrl(J))return J;J=this.toPosix(J);let Q="",Z=J.startsWith("/");if(this.hasProtocol(J))Q=this.rootname(J),J=J.slice(Q.length);let $=J.endsWith("/");if(J=yJ(J,!1),J.length>0&&$)J+="/";if(Z)return`/${J}`;return Q+J},isAbsolute(J){if(E(J),J=this.toPosix(J),this.hasProtocol(J))return!0;return J.startsWith("/")},join(...J){if(J.length===0)return".";let Q;for(let Z=0;Z<J.length;++Z){let $=J[Z];if(E($),$.length>0)if(Q===void 0)Q=$;else{let H=J[Z-1]??"";if(this.joinExtensions.includes(this.extname(H).toLowerCase()))Q+=`/../${$}`;else Q+=`/${$}`}}if(Q===void 0)return".";return this.normalize(Q)},dirname(J){if(E(J),J.length===0)return".";J=this.toPosix(J);let Q=J.charCodeAt(0),Z=Q===47,$=-1,H=!0,W=this.getProtocol(J),K=J;J=J.slice(W.length);for(let q=J.length-1;q>=1;--q)if(Q=J.charCodeAt(q),Q===47){if(!H){$=q;break}}else H=!1;if($===-1)return Z?"/":this.isUrl(K)?W+J:W;if(Z&&$===1)return"//";return W+J.slice(0,$)},rootname(J){E(J),J=this.toPosix(J);let Q="";if(J.startsWith("/"))Q="/";else Q=this.getProtocol(J);if(this.isUrl(J)){let Z=J.indexOf("/",Q.length);if(Z!==-1)Q=J.slice(0,Z);else Q=J;if(!Q.endsWith("/"))Q+="/"}return Q},basename(J,Q){if(E(J),Q)E(Q);J=v(this.toPosix(J));let Z=0,$=-1,H=!0,W;if(Q!==void 0&&Q.length>0&&Q.length<=J.length){if(Q.length===J.length&&Q===J)return"";let K=Q.length-1,q=-1;for(W=J.length-1;W>=0;--W){let _=J.charCodeAt(W);if(_===47){if(!H){Z=W+1;break}}else{if(q===-1)H=!1,q=W+1;if(K>=0)if(_===Q.charCodeAt(K)){if(--K===-1)$=W}else K=-1,$=q}}if(Z===$)$=q;else if($===-1)$=J.length;return J.slice(Z,$)}for(W=J.length-1;W>=0;--W)if(J.charCodeAt(W)===47){if(!H){Z=W+1;break}}else if($===-1)H=!1,$=W+1;if($===-1)return"";return J.slice(Z,$)},extname(J){E(J),J=v(this.toPosix(J));let Q=-1,Z=0,$=-1,H=!0,W=0;for(let K=J.length-1;K>=0;--K){let q=J.charCodeAt(K);if(q===47){if(!H){Z=K+1;break}continue}if($===-1)H=!1,$=K+1;if(q===46){if(Q===-1)Q=K;else if(W!==1)W=1}else if(Q!==-1)W=-1}if(Q===-1||$===-1||W===0||W===1&&Q===$-1&&Q===Z+1)return"";return J.slice(Q,$)},parse(J){E(J);let Q={root:"",dir:"",base:"",ext:"",name:""};if(J.length===0)return Q;J=v(this.toPosix(J));let Z=J.charCodeAt(0),$=this.isAbsolute(J),H,W="";if(Q.root=this.rootname(J),$||this.hasProtocol(J))H=1;else H=0;let K=-1,q=0,_=-1,Y=!0,N=J.length-1,z=0;for(;N>=H;--N){if(Z=J.charCodeAt(N),Z===47){if(!Y){q=N+1;break}continue}if(_===-1)Y=!1,_=N+1;if(Z===46){if(K===-1)K=N;else if(z!==1)z=1}else if(K!==-1)z=-1}if(K===-1||_===-1||z===0||z===1&&K===_-1&&K===q+1){if(_!==-1)if(q===0&&$)Q.base=Q.name=J.slice(1,_);else Q.base=Q.name=J.slice(q,_)}else{if(q===0&&$)Q.name=J.slice(1,K),Q.base=J.slice(1,_);else Q.name=J.slice(q,K),Q.base=J.slice(q,_);Q.ext=J.slice(K,_)}if(Q.dir=this.dirname(J),W)Q.dir=W+Q.dir;return Q},sep:"/",delimiter:":",joinExtensions:[".html"]};function t(J,Q,Z,$,H){let W=Q[Z];for(let K=0;K<W.length;K++){let q=W[K];if(Z<Q.length-1)t(J.replace($[Z],q),Q,Z+1,$,H);else H.push(J.replace($[Z],q))}}function e(J){let Q=/\{(.*?)\}/g,Z=J.match(Q),$=[];if(Z){let H=[];Z.forEach((W)=>{let K=W.substring(1,W.length-1).split(",");H.push(K)}),t(J,H,0,Z,$)}else $.push(J);return $}var d=(J)=>!Array.isArray(J);class D{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(J,Q)=>`${J}${this._bundleIdConnector}${Q}`,extractAssetIdFromBundle:(J,Q)=>Q.replace(`${J}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(J){if(this._bundleIdConnector=J.connector??this._bundleIdConnector,this._createBundleAssetId=J.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=J.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...J){J.forEach((Q)=>{if(this._preferredOrder.push(Q),!Q.priority)Q.priority=Object.keys(Q.params)}),this._resolverHash={}}set basePath(J){this._basePath=J}get basePath(){return this._basePath}set rootPath(J){this._rootPath=J}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(J){if(typeof J==="string")this._defaultSearchParams=J;else{let Q=J;this._defaultSearchParams=Object.keys(Q).map((Z)=>`${encodeURIComponent(Z)}=${encodeURIComponent(Q[Z])}`).join("&")}}getAlias(J){let{alias:Q,src:Z}=J;return R(Q||Z,(H)=>{if(typeof H==="string")return H;if(Array.isArray(H))return H.map((W)=>W?.src??W);if(H?.src)return H.src;return H},!0)}removeAlias(J,Q){if(!this._assetMap[J])return;if(Q&&Q!==this._resolverHash[J])return;delete this._resolverHash[J],delete this._assetMap[J]}addManifest(J){if(this._manifest)M("[Resolver] Manifest already exists, this will be overwritten");this._manifest=J,J.bundles.forEach((Q)=>{this.addBundle(Q.name,Q.assets)})}addBundle(J,Q){let Z=[],$=Q;if(!Array.isArray(Q))$=Object.entries(Q).map(([H,W])=>{if(typeof W==="string"||Array.isArray(W))return{alias:H,src:W};return{alias:H,...W}});$.forEach((H)=>{let{src:W,alias:K}=H,q;if(typeof K==="string"){let _=this._createBundleAssetId(J,K);Z.push(_),q=[K,_]}else{let _=K.map((Y)=>this._createBundleAssetId(J,Y));Z.push(..._),q=[...K,..._]}this.add({...H,...{alias:q,src:W}})}),this._bundles[J]=Z}add(J){let Q=[];if(Array.isArray(J))Q.push(...J);else Q.push(J);let Z;Z=(H)=>{if(this.hasKey(H))M(`[Resolver] already has key: ${H} overwriting`)},R(Q).forEach((H)=>{let{src:W}=H,{data:K,format:q,loadParser:_,parser:Y}=H,N=R(W).map((O)=>{if(typeof O==="string")return e(O);return Array.isArray(O)?O:[O]}),z=this.getAlias(H);Array.isArray(z)?z.forEach(Z):Z(z);let X=[],V=(O)=>{let w=this._parsers.find((C)=>C.test(O));return{src:O,...w?.parse(O)}};N.forEach((O)=>{O.forEach((w)=>{let C={};if(typeof w!=="object")C=V(w);else{if(K=w.data??K,q=w.format??q,w.loadParser||w.parser)_=w.loadParser??_,Y=w.parser??Y;C={...V(w.src),...w}}if(!z)throw Error(`[Resolver] alias is undefined for this asset: ${C.src}`);C=this._buildResolvedAsset(C,{aliases:z,data:K,format:q,loadParser:_,parser:Y,progressSize:H.progressSize}),X.push(C)})}),z.forEach((O)=>{this._assetMap[O]=X})})}resolveBundle(J){let Q=d(J);J=R(J);let Z={};return J.forEach(($)=>{let H=this._bundles[$];if(H){let W=this.resolve(H),K={};for(let q in W){let _=W[q];K[this._extractAssetIdFromBundle($,q)]=_}Z[$]=K}}),Q?Z[J[0]]:Z}resolveUrl(J){let Q=this.resolve(J);if(typeof J!=="string"){let Z={};for(let $ in Q)Z[$]=Q[$].src;return Z}return Q.src}resolve(J){let Q=d(J);J=R(J);let Z={};return J.forEach(($)=>{if(!this._resolverHash[$])if(this._assetMap[$]){let H=this._assetMap[$],W=this._getPreferredOrder(H);W?.priority.forEach((K)=>{W.params[K].forEach((q)=>{let _=H.filter((Y)=>{if(Y[K])return Y[K]===q;return!1});if(_.length)H=_})}),this._resolverHash[$]=H[0]}else this._resolverHash[$]=this._buildResolvedAsset({alias:[$],src:$},{});Z[$]=this._resolverHash[$]}),Q?Z[J[0]]:Z}hasKey(J){return!!this._assetMap[J]}hasBundle(J){return!!this._bundles[J]}_getPreferredOrder(J){for(let Q=0;Q<J.length;Q++){let Z=J[Q],$=this._preferredOrder.find((H)=>H.params.format.includes(Z.format));if($)return $}return this._preferredOrder[0]}_appendDefaultSearchParams(J){if(!this._defaultSearchParams)return J;let Q=/\?/.test(J)?"&":"?";return`${J}${Q}${this._defaultSearchParams}`}_buildResolvedAsset(J,Q){let{aliases:Z,data:$,loadParser:H,parser:W,format:K,progressSize:q}=Q;if(this._basePath||this._rootPath)J.src=F.toAbsolute(J.src,this._basePath,this._rootPath);if(J.alias=Z??J.alias??[J.src],J.src=this._appendDefaultSearchParams(J.src),J.data={...$||{},...J.data},J.loadParser=H??J.loadParser,J.parser=W??J.parser,J.format=K??J.format??TJ(J.src),q!==void 0)J.progressSize=q;return J}}D.RETINA_PREFIX=/@([0-9\.]+)x/;function TJ(J){return J.split(".").pop().split("?").shift().split("#").shift()}var p=(J,Q)=>{let Z=Q.split("?")[1];if(Z)J+=`?${Z}`;return J};var JJ=class J{constructor(Q,Z){this.linkedSheets=[];let $=Q;if(Q?.source instanceof U)$={texture:Q,data:Z};let{texture:H,data:W,cachePrefix:K=""}=$;this.cachePrefix=K,this._texture=H instanceof B?H:null,this.textureSource=H.source,this.textures={},this.animations={},this.data=W;let q=parseFloat(W.meta.scale);if(q)this.resolution=q,H.source.resolution=this.resolution;else this.resolution=H.source._resolution;this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise((Q)=>{if(this._callback=Q,this._batchIndex=0,this._frameKeys.length<=J.BATCH_SIZE)this._processFrames(0),this._processAnimations(),this._parseComplete();else this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(Q,Z=!1){let $=Q,H=Z?1/0:J.BATCH_SIZE;while($-Q<H&&$<this._frameKeys.length){let W=this._frameKeys[$],K=this._frames[W],q=K.frame;if(q){let _=null,Y=null,N=K.trimmed!==!1&&K.sourceSize?K.sourceSize:K.frame,z=new y(0,0,Math.floor(N.w)/this.resolution,Math.floor(N.h)/this.resolution);if(K.rotated)_=new y(Math.floor(q.x)/this.resolution,Math.floor(q.y)/this.resolution,Math.floor(q.h)/this.resolution,Math.floor(q.w)/this.resolution);else _=new y(Math.floor(q.x)/this.resolution,Math.floor(q.y)/this.resolution,Math.floor(q.w)/this.resolution,Math.floor(q.h)/this.resolution);if(K.trimmed!==!1&&K.spriteSourceSize)Y=new y(Math.floor(K.spriteSourceSize.x)/this.resolution,Math.floor(K.spriteSourceSize.y)/this.resolution,Math.floor(q.w)/this.resolution,Math.floor(q.h)/this.resolution);this.textures[W]=new B({source:this.textureSource,frame:_,orig:z,trim:Y,rotate:K.rotated?2:0,defaultAnchor:K.anchor,defaultBorders:K.borders,label:W.toString()})}$++}}_processAnimations(){let Q=this.data.animations||{};for(let Z in Q){this.animations[Z]=[];for(let $=0;$<Q[Z].length;$++){let H=Q[Z][$];this.animations[Z].push(this.textures[H])}}}_parseComplete(){let Q=this._callback;this._callback=null,this._batchIndex=0,Q.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*J.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{if(this._batchIndex*J.BATCH_SIZE<this._frameKeys.length)this._nextBatch();else this._processAnimations(),this._parseComplete()},0)}destroy(Q=!1){for(let Z in this.textures)this.textures[Z].destroy();if(this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,Q)this._texture?.destroy(),this.textureSource.destroy();this._texture=null,this.textureSource=null,this.linkedSheets=[]}};JJ.BATCH_SIZE=1000;var u=JJ;var SJ=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function QJ(J,Q,Z){let $={};if(J.forEach((H)=>{$[H]=Q}),Object.keys(Q.textures).forEach((H)=>{$[`${Q.cachePrefix}${H}`]=Q.textures[H]}),!Z){let H=F.dirname(J[0]);Q.linkedSheets.forEach((W,K)=>{let q=QJ([`${H}/${Q.data.meta.related_multi_packs[K]}`],W,!0);Object.assign($,q)})}return $}var ZJ={extension:G.Asset,cache:{test:(J)=>J instanceof u,getCacheableAssets:(J,Q)=>QJ(J,Q,!1)},resolver:{extension:{type:G.ResolveParser,name:"resolveSpritesheet"},test:(J)=>{let Z=J.split("?")[0].split("."),$=Z.pop(),H=Z.pop();return $==="json"&&SJ.includes(H)},parse:(J)=>{let Q=J.split(".");return{resolution:parseFloat(D.RETINA_PREFIX.exec(J)?.[1]??"1"),format:Q[Q.length-2],src:J}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:G.LoadParser,priority:h.Normal,name:"spritesheetLoader"},async testParse(J,Q){return F.extname(Q.src).toLowerCase()===".json"&&!!J.frames},async parse(J,Q,Z){let{texture:$,imageFilename:H,textureOptions:W,cachePrefix:K}=Q?.data??{},q=F.dirname(Q.src);if(q&&q.lastIndexOf("/")!==q.length-1)q+="/";let _;if($ instanceof B)_=$;else{let z=p(q+(H??J.meta.image),Q.src);_=(await Z.load([{src:z,data:W}]))[z]}let Y=new u({texture:_.source,data:J,cachePrefix:K});await Y.parse();let N=J?.meta?.related_multi_packs;if(Array.isArray(N)){let z=[];for(let V of N){if(typeof V!=="string")continue;let O=q+V;if(Q.data?.ignoreMultiPack)continue;O=p(O,Q.src),z.push(Z.load({src:O,data:{textureOptions:W,ignoreMultiPack:!0}}))}let X=await Promise.all(z);Y.linkedSheets=X,X.forEach((V)=>{V.linkedSheets=[Y].concat(Y.linkedSheets.filter((O)=>O!==V))})}return Y},async unload(J,Q,Z){await Z.unload(J.textureSource._sourceOrigin),J.destroy(!1)}}};A.add(ZJ);var DJ=new P;function k(J,Q,Z){let $=DJ;J.measurable=!0,$J(J,Z,$),Q.addBoundsMask($),J.measurable=!1}function g(J,Q,Z){let $=n.get();J.measurable=!0;let H=l.get().identity(),W=WJ(J,Z,H);HJ(J,$,W),J.measurable=!1,Q.addBoundsMask($),l.return(H),n.return($)}function WJ(J,Q,Z){if(!J)return M("Mask bounds, renderable is not inside the root container"),Z;if(J!==Q)WJ(J.parent,Q,Z),J.updateLocalTransform(),Z.append(J.localTransform);return Z}class b{constructor(J){if(this.priority=0,this.inverse=!1,this.pipe="alphaMask",J?.mask)this.init(J.mask)}init(J){this.mask=J,this.renderMaskToTexture=!(J instanceof i),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){if(this.mask===null)return;this.mask.measurable=!0,this.mask=null}addBounds(J,Q){if(!this.inverse)k(this.mask,J,Q)}addLocalBounds(J,Q){g(this.mask,J,Q)}containsPoint(J,Q){let Z=this.mask;return Q(Z,J)}destroy(){this.reset()}static test(J){return J instanceof i}}b.extension=G.MaskEffect;class x{constructor(J){if(this.priority=0,this.pipe="colorMask",J?.mask)this.init(J.mask)}init(J){this.mask=J}destroy(){}static test(J){return typeof J==="number"}}x.extension=G.MaskEffect;class f{constructor(J){if(this.priority=0,this.pipe="stencilMask",J?.mask)this.init(J.mask)}init(J){this.mask=J,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){if(this.mask===null)return;this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null}addBounds(J,Q){k(this.mask,J,Q)}addLocalBounds(J,Q){g(this.mask,J,Q)}containsPoint(J,Q){let Z=this.mask;return Q(Z,J)}destroy(){this.reset()}static test(J){return J instanceof qJ}}f.extension=G.MaskEffect;var o;async function KJ(){return o??(o=(async()=>{let Q=S.get().createCanvas(1,1).getContext("webgl");if(!Q)return"premultiply-alpha-on-upload";let Z=await new Promise((K)=>{let q=document.createElement("video");q.onloadeddata=()=>K(q),q.onerror=()=>K(null),q.autoplay=!1,q.crossOrigin="anonymous",q.preload="auto",q.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",q.load()});if(!Z)return"premultiply-alpha-on-upload";let $=Q.createTexture();Q.bindTexture(Q.TEXTURE_2D,$);let H=Q.createFramebuffer();Q.bindFramebuffer(Q.FRAMEBUFFER,H),Q.framebufferTexture2D(Q.FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_2D,$,0),Q.pixelStorei(Q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),Q.pixelStorei(Q.UNPACK_COLORSPACE_CONVERSION_WEBGL,Q.NONE),Q.texImage2D(Q.TEXTURE_2D,0,Q.RGBA,Q.RGBA,Q.UNSIGNED_BYTE,Z);let W=new Uint8Array(4);return Q.readPixels(0,0,1,1,Q.RGBA,Q.UNSIGNED_BYTE,W),Q.deleteFramebuffer(H),Q.deleteTexture($),Q.getExtension("WEBGL_lose_context")?.loseContext(),W[0]<=W[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),o}var m=class J extends U{constructor(Q){super(Q);if(this.isReady=!1,this.uploadMethodId="video",Q={...J.defaultOptions,...Q},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=Q.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=Q.autoPlay!==!1,this.alphaMode=Q.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),Q.autoLoad!==!1)this.load()}updateFrame(){if(this.destroyed)return;if(this._updateFPS){let Q=T.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-Q)}if(!this._updateFPS||this._msToNextUpdate<=0)this._msToNextUpdate=this._updateFPS?Math.floor(1000/this._updateFPS):0;if(this.isValid)this.update()}_videoFrameRequestCallback(){if(this.updateFrame(),this.destroyed)this._videoFrameRequestCallbackHandle=null;else this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;let Q=this.resource,Z=this.options;if((Q.readyState===Q.HAVE_ENOUGH_DATA||Q.readyState===Q.HAVE_FUTURE_DATA)&&Q.width&&Q.height)Q.complete=!0;if(Q.addEventListener("play",this._onPlayStart),Q.addEventListener("pause",this._onPlayStop),Q.addEventListener("seeked",this._onSeeked),!this._isSourceReady()){if(!Z.preload)Q.addEventListener("canplay",this._onCanPlay);Q.addEventListener("canplaythrough",this._onCanPlayThrough),Q.addEventListener("error",this._onError,!0)}else this._mediaReady();return this.alphaMode=await KJ(),this._load=new Promise(($,H)=>{if(this.isValid)$(this);else{if(this._resolve=$,this._reject=H,Z.preloadTimeoutMs!==void 0)this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${Z.preloadTimeoutMs}ms`))});Q.load()}}),this._load}_onError(Q){if(this.resource.removeEventListener("error",this._onError,!0),this.emit("error",Q),this._reject)this._reject(Q),this._reject=null,this._resolve=null}_isSourcePlaying(){let Q=this.resource;return!Q.paused&&!Q.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){if(!this.isValid)this._mediaReady();this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){if(this._autoUpdate&&!this._isSourcePlaying())this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){if(this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout)clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0;this._mediaReady()}_mediaReady(){let Q=this.resource;if(this.isValid)this.isReady=!0,this.resize(Q.videoWidth,Q.videoHeight);if(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve)this._resolve(this),this._resolve=null,this._reject=null;if(this._isSourcePlaying())this._onPlayStart();else if(this.autoPlay)this.resource.play()}destroy(){this._configureAutoUpdate();let Q=this.resource;if(Q)Q.removeEventListener("play",this._onPlayStart),Q.removeEventListener("pause",this._onPlayStop),Q.removeEventListener("seeked",this._onSeeked),Q.removeEventListener("canplay",this._onCanPlay),Q.removeEventListener("canplaythrough",this._onCanPlayThrough),Q.removeEventListener("error",this._onError,!0),Q.pause(),Q.src="",Q.load();super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(Q){if(Q!==this._autoUpdate)this._autoUpdate=Q,this._configureAutoUpdate()}get updateFPS(){return this._updateFPS}set updateFPS(Q){if(Q!==this._updateFPS)this._updateFPS=Q,this._configureAutoUpdate()}_configureAutoUpdate(){if(this._autoUpdate&&this._isSourcePlaying())if(!this._updateFPS&&this.resource.requestVideoFrameCallback){if(this._isConnectedToTicker)T.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0;if(this._videoFrameRequestCallbackHandle===null)this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}else{if(this._videoFrameRequestCallbackHandle!==null)this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null;if(!this._isConnectedToTicker)T.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0}else{if(this._videoFrameRequestCallbackHandle!==null)this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null;if(this._isConnectedToTicker)T.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0}}static test(Q){return globalThis.HTMLVideoElement&&Q instanceof HTMLVideoElement}};m.extension=G.TextureSource;m.defaultOptions={...U.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};m.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};var _J=m;var a=[];A.handleByList(G.TextureSource,a);function zJ(J={}){let Q=J&&J.resource,Z=Q?J.resource:J,$=Q?J:{resource:J};for(let H=0;H<a.length;H++){let W=a[H];if(W.test(Z))return new W($)}throw Error(`Could not find a source type for resource: ${$.resource}`)}function PJ(J={},Q=!1){let Z=J&&J.resource,$=Z?J.resource:J,H=Z?J:{resource:J};if(!Q&&I.has($))return I.get($);let W=new B({source:zJ(H)});if(W.on("destroy",()=>{if(I.has($))I.remove($)}),!Q)I.set($,W);return W}function kJ(J,Q=!1){if(typeof J==="string")return I.get(J);else if(J instanceof U)return new B({source:J});return PJ(J,Q)}B.from=kJ;U.from=zJ;A.add(b,x,f,_J,OJ,NJ,YJ);class XJ{constructor(J){this._renderer=J}push(J,Q,Z){this._renderer.renderPipes.batch.break(Z),Z.add({renderPipeId:"filter",canBundle:!1,action:"pushFilter",container:Q,filterEffect:J})}pop(J,Q,Z){this._renderer.renderPipes.batch.break(Z),Z.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}execute(J){if(J.action==="pushFilter")this._renderer.filter.push(J);else if(J.action==="popFilter")this._renderer.filter.pop()}destroy(){this._renderer=null}}XJ.extension={type:[G.WebGLPipes,G.WebGPUPipes,G.CanvasPipes],name:"filter"};var GJ=`in vec2 aPosition;
|
|
2
2
|
out vec2 vTextureCoord;
|
|
3
3
|
|
|
4
4
|
uniform vec4 uInputSize;
|
|
@@ -81,4 +81,4 @@ fn mainFragment(
|
|
|
81
81
|
return textureSample(uTexture, uSampler, uv);
|
|
82
82
|
}
|
|
83
83
|
`;class r extends BJ{constructor(){let J=CJ.from({vertex:{source:s,entryPoint:"mainVertex"},fragment:{source:s,entryPoint:"mainFragment"},name:"passthrough-filter"}),Q=wJ.from({vertex:GJ,fragment:VJ,name:"passthrough-filter"});super({gpuProgram:J,glProgram:Q})}}var EJ=new c;function LJ(J,Q){Q.clear();let Z=Q.matrix;for(let $=0;$<J.length;$++){let H=J[$];if(H.globalDisplayStatus<7)continue;let W=H.renderGroup??H.parentRenderGroup;if(W?.isCachedAsTexture)Q.matrix=EJ.copyFrom(W.textureOffsetInverseTransform).append(H.worldTransform);else if(W?._parentCacheAsTextureRenderGroup)Q.matrix=EJ.copyFrom(W._parentCacheAsTextureRenderGroup.inverseWorldTransform).append(H.groupTransform);else Q.matrix=H.worldTransform;Q.addBounds(H.bounds)}return Q.matrix=Z,Q}var gJ=new MJ({attributes:{aPosition:{buffer:new Float32Array([0,0,1,0,1,1,0,1]),format:"float32x2",stride:8,offset:0}},indexBuffer:new Uint32Array([0,1,2,0,2,3])});class IJ{constructor(){this.skip=!1,this.inputTexture=null,this.backTexture=null,this.filters=null,this.bounds=new P,this.container=null,this.blendRequired=!1,this.outputRenderSurface=null,this.globalFrame={x:0,y:0,width:0,height:0},this.firstEnabledIndex=-1,this.lastEnabledIndex=-1}}class RJ{constructor(J){this._filterStackIndex=0,this._filterStack=[],this._filterGlobalUniforms=new FJ({uInputSize:{value:new Float32Array(4),type:"vec4<f32>"},uInputPixel:{value:new Float32Array(4),type:"vec4<f32>"},uInputClamp:{value:new Float32Array(4),type:"vec4<f32>"},uOutputFrame:{value:new Float32Array(4),type:"vec4<f32>"},uGlobalFrame:{value:new Float32Array(4),type:"vec4<f32>"},uOutputTexture:{value:new Float32Array(4),type:"vec4<f32>"}}),this._globalFilterBindGroup=new UJ({}),this.renderer=J}get activeBackTexture(){return this._activeFilterData?.backTexture}push(J){let Q=this.renderer,Z=J.filterEffect.filters,$=this._pushFilterData();$.skip=!1,$.filters=Z,$.container=J.container,$.outputRenderSurface=Q.renderTarget.renderSurface;let H=Q.renderTarget.renderTarget.colorTexture.source,W=H.resolution,K=H.antialias;if(Z.every((X)=>!X.enabled)){$.skip=!0;return}let q=$.bounds;if(this._calculateFilterArea(J,q),this._calculateFilterBounds($,Q.renderTarget.rootViewPort,K,W,1),$.skip)return;let _=this._getPreviousFilterData(),Y=this._findFilterResolution(W),N=0,z=0;if(_)N=_.bounds.minX,z=_.bounds.minY;this._calculateGlobalFrame($,N,z,Y,H.width,H.height),this._setupFilterTextures($,q,Q,_)}generateFilteredTexture({texture:J,filters:Q}){let Z=this._pushFilterData();this._activeFilterData=Z,Z.skip=!1,Z.filters=Q;let $=J.source,H=$.resolution,W=$.antialias;if(Q.every((X)=>!X.enabled))return Z.skip=!0,J;let K=Z.bounds;if(K.addRect(J.frame),this._calculateFilterBounds(Z,K.rectangle,W,H,0),Z.skip)return J;let q=H,_=0,Y=0;this._calculateGlobalFrame(Z,_,Y,q,$.width,$.height),Z.outputRenderSurface=j.getOptimalTexture(K.width,K.height,Z.resolution,Z.antialias),Z.backTexture=B.EMPTY,Z.inputTexture=J,this.renderer.renderTarget.finishRenderPass(),this._applyFiltersToTexture(Z,!0);let z=Z.outputRenderSurface;return z.source.alphaMode="premultiplied-alpha",z}pop(){let J=this.renderer,Q=this._popFilterData();if(Q.skip)return;if(J.globalUniforms.pop(),J.renderTarget.finishRenderPass(),this._activeFilterData=Q,this._applyFiltersToTexture(Q,!1),Q.blendRequired)j.returnTexture(Q.backTexture);j.returnTexture(Q.inputTexture)}getBackTexture(J,Q,Z){let $=J.colorTexture.source._resolution,H=j.getOptimalTexture(Q.width,Q.height,$,!1),W=Q.minX,K=Q.minY;if(Z)W-=Z.minX,K-=Z.minY;W=Math.floor(W*$),K=Math.floor(K*$);let q=Math.ceil(Q.width*$),_=Math.ceil(Q.height*$);return this.renderer.renderTarget.copyToTexture(J,H,{x:W,y:K},{width:q,height:_},{x:0,y:0}),H}applyFilter(J,Q,Z,$){let H=this.renderer,W=this._activeFilterData,q=W.outputRenderSurface===Z,_=H.renderTarget.rootRenderTarget.colorTexture.source._resolution,Y=this._findFilterResolution(_),N=0,z=0;if(q){let V=this._findPreviousFilterOffset();N=V.x,z=V.y}this._updateFilterUniforms(Q,Z,W,N,z,Y,q,$);let X=J.enabled?J:this._getPassthroughFilter();this._setupBindGroupsAndRender(X,Q,H)}calculateSpriteMatrix(J,Q){let Z=this._activeFilterData,$=J.set(Z.inputTexture._source.width,0,0,Z.inputTexture._source.height,Z.bounds.minX,Z.bounds.minY),H=Q.worldTransform.copyTo(c.shared),W=Q.renderGroup||Q.parentRenderGroup;if(W&&W.cacheToLocalTransform)H.prepend(W.cacheToLocalTransform);return H.invert(),$.prepend(H),$.scale(1/Q.texture.orig.width,1/Q.texture.orig.height),$.translate(Q.anchor.x,Q.anchor.y),$}destroy(){this._passthroughFilter?.destroy(!0),this._passthroughFilter=null}_getPassthroughFilter(){return this._passthroughFilter??(this._passthroughFilter=new r),this._passthroughFilter}_setupBindGroupsAndRender(J,Q,Z){if(Z.renderPipes.uniformBatch){let $=Z.renderPipes.uniformBatch.getUboResource(this._filterGlobalUniforms);this._globalFilterBindGroup.setResource($,0)}else this._globalFilterBindGroup.setResource(this._filterGlobalUniforms,0);if(this._globalFilterBindGroup.setResource(Q.source,1),this._globalFilterBindGroup.setResource(Q.source.style,2),J.groups[0]=this._globalFilterBindGroup,Z.encoder.draw({geometry:gJ,shader:J,state:J._state,topology:"triangle-list"}),Z.type===jJ.WEBGL)Z.renderTarget.finishRenderPass()}_setupFilterTextures(J,Q,Z,$){if(J.backTexture=B.EMPTY,J.inputTexture=j.getOptimalTexture(Q.width,Q.height,J.resolution,J.antialias),J.blendRequired){Z.renderTarget.finishRenderPass();let H=Z.renderTarget.getRenderTarget(J.outputRenderSurface);J.backTexture=this.getBackTexture(H,Q,$?.bounds)}Z.renderTarget.bind(J.inputTexture,!0),Z.globalUniforms.push({offset:Q})}_calculateGlobalFrame(J,Q,Z,$,H,W){let K=J.globalFrame;K.x=Q*$,K.y=Z*$,K.width=H*$,K.height=W*$}_updateFilterUniforms(J,Q,Z,$,H,W,K,q){let _=this._filterGlobalUniforms.uniforms,Y=_.uOutputFrame,N=_.uInputSize,z=_.uInputPixel,X=_.uInputClamp,V=_.uGlobalFrame,O=_.uOutputTexture;if(K)Y[0]=Z.bounds.minX-$,Y[1]=Z.bounds.minY-H;else Y[0]=0,Y[1]=0;Y[2]=J.frame.width,Y[3]=J.frame.height,N[0]=J.source.width,N[1]=J.source.height,N[2]=1/N[0],N[3]=1/N[1],z[0]=J.source.pixelWidth,z[1]=J.source.pixelHeight,z[2]=1/z[0],z[3]=1/z[1],X[0]=0.5*z[2],X[1]=0.5*z[3],X[2]=J.frame.width*N[2]-0.5*z[2],X[3]=J.frame.height*N[3]-0.5*z[3];let w=this.renderer.renderTarget.rootRenderTarget.colorTexture;if(V[0]=$*W,V[1]=H*W,V[2]=w.source.width*W,V[3]=w.source.height*W,Q instanceof B)Q.source.resource=null;let C=this.renderer.renderTarget.getRenderTarget(Q);if(this.renderer.renderTarget.bind(Q,!!q),Q instanceof B)O[0]=Q.frame.width,O[1]=Q.frame.height;else O[0]=C.width,O[1]=C.height;O[2]=C.isRoot?-1:1,this._filterGlobalUniforms.update()}_findFilterResolution(J){let Q=this._filterStackIndex-1;while(Q>0&&this._filterStack[Q].skip)--Q;return Q>0&&this._filterStack[Q].inputTexture?this._filterStack[Q].inputTexture.source._resolution:J}_findPreviousFilterOffset(){let J=0,Q=0,Z=this._filterStackIndex;while(Z>0){Z--;let $=this._filterStack[Z];if(!$.skip){J=$.bounds.minX,Q=$.bounds.minY;break}}return{x:J,y:Q}}_calculateFilterArea(J,Q){if(J.renderables)LJ(J.renderables,Q);else if(J.filterEffect.filterArea)Q.clear(),Q.addRect(J.filterEffect.filterArea),Q.applyMatrix(J.container.worldTransform);else J.container.getFastGlobalBounds(!0,Q);if(J.container){let $=(J.container.renderGroup||J.container.parentRenderGroup).cacheToLocalTransform;if($)Q.applyMatrix($)}}_applyFiltersToTexture(J,Q){let{inputTexture:Z,bounds:$,filters:H,firstEnabledIndex:W,lastEnabledIndex:K}=J;if(this._globalFilterBindGroup.setResource(Z.source.style,2),this._globalFilterBindGroup.setResource(J.backTexture.source,3),W===K)H[W].apply(this,Z,J.outputRenderSurface,Q);else{let q=J.inputTexture,_=j.getOptimalTexture($.width,$.height,q.source._resolution,!1),Y=_;for(let N=W;N<K;N++){let z=H[N];if(!z.enabled)continue;z.apply(this,q,Y,!0);let X=q;q=Y,Y=X}H[K].apply(this,q,J.outputRenderSurface,Q),j.returnTexture(_)}}_calculateFilterBounds(J,Q,Z,$,H){let W=this.renderer,K=J.bounds,q=J.filters,_=1/0,Y=0,N=!0,z=!1,X=!1,V=!0,O=-1,w=-1;for(let C=0;C<q.length;C++){let L=q[C];if(!L.enabled)continue;if(O===-1)O=C;if(w=C,_=Math.min(_,L.resolution==="inherit"?$:L.resolution),Y+=L.padding,L.antialias==="off")N=!1;else if(L.antialias==="inherit")N&&(N=Z);if(!L.clipToViewport)V=!1;if(!(L.compatibleRenderers&W.type)){X=!1;break}if(L.blendRequired&&!(W.backBuffer?.useBackBuffer??!0)){M("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."),X=!1;break}X=!0,z||(z=L.blendRequired)}if(!X){J.skip=!0;return}if(V)K.fitBounds(0,Q.width/$,0,Q.height/$);if(K.scale(_).ceil().scale(1/_).pad((Y|0)*H),!K.isPositive){J.skip=!0;return}J.antialias=N,J.resolution=_,J.blendRequired=z,J.firstEnabledIndex=O,J.lastEnabledIndex=w}_popFilterData(){return this._filterStackIndex--,this._filterStack[this._filterStackIndex]}_getPreviousFilterData(){let J,Q=this._filterStackIndex-1;while(Q>0)if(Q--,J=this._filterStack[Q],!J.skip)break;return J}_pushFilterData(){let J=this._filterStack[this._filterStackIndex];if(!J)J=this._filterStack[this._filterStackIndex]=new IJ;return this._filterStackIndex++,J}}RJ.extension={type:[G.WebGLSystem,G.WebGPUSystem],name:"filter"};
|
|
84
|
-
export{XJ as
|
|
84
|
+
export{XJ as f,RJ as g};
|