New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@pixi/graphics

Package Overview
Dependencies
Maintainers
3
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/graphics - npm Package Compare versions

Comparing version 7.0.0-beta.3 to 7.0.0-beta.4

10

dist/cjs/graphics.js
/*!
* @pixi/graphics - v7.0.0-beta.3
* Compiled Thu, 13 Oct 2022 15:35:43 UTC
* @pixi/graphics - v7.0.0-beta.4
* Compiled Thu, 20 Oct 2022 19:45:44 UTC
*

@@ -287,2 +287,5 @@ * @pixi/graphics is licensed under the MIT License.

points.length = 0;
if (!(width >= 0 && height >= 0)) {
return;
}
points.push(x, y, x + width, y, x + width, y + height, x, y + height);

@@ -293,2 +296,5 @@ },

const verts = graphicsGeometry.points;
if (points.length === 0) {
return;
}
const vertPos = verts.length / 2;

@@ -295,0 +301,0 @@ verts.push(points[0], points[1], points[2], points[3], points[6], points[7], points[4], points[5]);

6

dist/cjs/graphics.min.js
"use strict";/*!
* @pixi/graphics - v7.0.0-beta.3
* Compiled Thu, 13 Oct 2022 15:35:43 UTC
* @pixi/graphics - v7.0.0-beta.4
* Compiled Thu, 20 Oct 2022 19:45:44 UTC
*
* @pixi/graphics is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/Object.defineProperty(exports,"__esModule",{value:!0});var x=require("@pixi/core"),yt=require("@pixi/display"),I=(t=>(t.MITER="miter",t.BEVEL="bevel",t.ROUND="round",t))(I||{}),L=(t=>(t.BUTT="butt",t.ROUND="round",t.SQUARE="square",t))(L||{});const F={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(t,e=20){if(!this.adaptive||!t||isNaN(t))return e;let i=Math.ceil(t/this.maxLength);return i<this.minSegments?i=this.minSegments:i>this.maxSegments&&(i=this.maxSegments),i}};class W{constructor(){this.color=16777215,this.alpha=1,this.texture=x.Texture.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const e=new W;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e}reset(){this.color=16777215,this.alpha=1,this.texture=x.Texture.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}function bt(t,e=!1){const i=t.length;if(i<6)return;let s=0;for(let h=0,r=t[i-2],a=t[i-1];h<i;h+=2){const l=t[h],o=t[h+1];s+=(l-r)*(o+a),r=l,a=o}if(!e&&s>0||e&&s<=0){const h=i/2;for(let r=h+h%2;r<i;r+=2){const a=i-r-2,l=i-r-1,o=r,c=r+1;[t[a],t[o]]=[t[o],t[a]],[t[l],t[c]]=[t[c],t[l]]}}}const nt={build(t){t.points=t.shape.points.slice()},triangulate(t,e){let i=t.points;const s=t.holes,h=e.points,r=e.indices;if(i.length>=6){bt(i,!1);const a=[];for(let c=0;c<s.length;c++){const n=s[c];bt(n.points,!0),a.push(i.length/2),i=i.concat(n.points)}const l=x.utils.earcut(i,a,2);if(!l)return;const o=h.length/2;for(let c=0;c<l.length;c+=3)r.push(l[c]+o),r.push(l[c+1]+o),r.push(l[c+2]+o);for(let c=0;c<i.length;c++)h.push(i[c])}}},j={build(t){const e=t.points;let i,s,h,r,a,l;if(t.type===x.SHAPES.CIRC){const u=t.shape;i=u.x,s=u.y,a=l=u.radius,h=r=0}else if(t.type===x.SHAPES.ELIP){const u=t.shape;i=u.x,s=u.y,a=u.width,l=u.height,h=r=0}else{const u=t.shape,m=u.width/2,S=u.height/2;i=u.x+m,s=u.y+S,a=l=Math.max(0,Math.min(u.radius,Math.min(m,S))),h=m-a,r=S-l}if(!(a>=0&&l>=0&&h>=0&&r>=0)){e.length=0;return}const o=Math.ceil(2.3*Math.sqrt(a+l)),c=o*8+(h?4:0)+(r?4:0);if(e.length=c,c===0)return;if(o===0){e.length=8,e[0]=e[6]=i+h,e[1]=e[3]=s+r,e[2]=e[4]=i-h,e[5]=e[7]=s-r;return}let n=0,p=o*4+(h?2:0)+2,d=p,b=c;{const u=h+a,m=r,S=i+u,f=i-u,_=s+m;if(e[n++]=S,e[n++]=_,e[--p]=_,e[--p]=f,r){const g=s-m;e[d++]=f,e[d++]=g,e[--b]=g,e[--b]=S}}for(let u=1;u<o;u++){const m=Math.PI/2*(u/o),S=h+Math.cos(m)*a,f=r+Math.sin(m)*l,_=i+S,g=i-S,y=s+f,A=s-f;e[n++]=_,e[n++]=y,e[--p]=y,e[--p]=g,e[d++]=g,e[d++]=A,e[--b]=A,e[--b]=_}{const u=h,m=r+l,S=i+u,f=i-u,_=s+m,g=s-m;e[n++]=S,e[n++]=_,e[--b]=g,e[--b]=S,h&&(e[n++]=f,e[n++]=_,e[--b]=g,e[--b]=f)}},triangulate(t,e){const i=t.points,s=e.points,h=e.indices;if(i.length===0)return;let r=s.length/2;const a=r;let l,o;if(t.type!==x.SHAPES.RREC){const n=t.shape;l=n.x,o=n.y}else{const n=t.shape;l=n.x+n.width/2,o=n.y+n.height/2}const c=t.matrix;s.push(t.matrix?c.a*l+c.c*o+c.tx:l,t.matrix?c.b*l+c.d*o+c.ty:o),r++,s.push(i[0],i[1]);for(let n=2;n<i.length;n+=2)s.push(i[n],i[n+1]),h.push(r++,a,r);h.push(a+1,a,r)}},ft={build(t){const e=t.shape,i=e.x,s=e.y,h=e.width,r=e.height,a=t.points;a.length=0,a.push(i,s,i+h,s,i+h,s+r,i,s+r)},triangulate(t,e){const i=t.points,s=e.points,h=s.length/2;s.push(i[0],i[1],i[2],i[3],i[6],i[7],i[4],i[5]),e.indices.push(h,h+1,h+2,h+1,h+2,h+3)}},xt={build(t){j.build(t)},triangulate(t,e){j.triangulate(t,e)}};function mt(t,e,i,s,h,r,a,l){const o=t-i*h,c=e-s*h,n=t+i*r,p=e+s*r;let d,b;a?(d=s,b=-i):(d=-s,b=i);const u=o+d,m=c+b,S=n+d,f=p+b;return l.push(u,m),l.push(S,f),2}function G(t,e,i,s,h,r,a,l){const o=i-t,c=s-e;let n=Math.atan2(o,c),p=Math.atan2(h-t,r-e);l&&n<p?n+=Math.PI*2:!l&&n>p&&(p+=Math.PI*2);let d=n;const b=p-n,u=Math.abs(b),m=Math.sqrt(o*o+c*c),S=(15*u*Math.sqrt(m)/Math.PI>>0)+1,f=b/S;if(d+=f,l){a.push(t,e),a.push(i,s);for(let _=1,g=d;_<S;_++,g+=f)a.push(t,e),a.push(t+Math.sin(g)*m,e+Math.cos(g)*m);a.push(t,e),a.push(h,r)}else{a.push(i,s),a.push(t,e);for(let _=1,g=d;_<S;_++,g+=f)a.push(t+Math.sin(g)*m,e+Math.cos(g)*m),a.push(t,e);a.push(h,r),a.push(t,e)}return S*2}function At(t,e){const i=t.shape;let s=t.points||i.points.slice();const h=e.closePointEps;if(s.length===0)return;const r=t.lineStyle,a=new x.Point(s[0],s[1]),l=new x.Point(s[s.length-2],s[s.length-1]),o=i.type!==x.SHAPES.POLY||i.closeStroke,c=Math.abs(a.x-l.x)<h&&Math.abs(a.y-l.y)<h;if(o){s=s.slice(),c&&(s.pop(),s.pop(),l.set(s[s.length-2],s[s.length-1]));const D=(a.x+l.x)*.5,B=(l.y+a.y)*.5;s.unshift(D,B),s.push(D,B)}const n=e.points,p=s.length/2;let d=s.length;const b=n.length/2,u=r.width/2,m=u*u,S=r.miterLimit*r.miterLimit;let f=s[0],_=s[1],g=s[2],y=s[3],A=0,C=0,w=-(_-y),P=f-g,T=0,E=0,R=Math.sqrt(w*w+P*P);w/=R,P/=R,w*=u,P*=u;const ut=r.alignment,M=(1-ut)*2,v=ut*2;o||(r.cap===L.ROUND?d+=G(f-w*(M-v)*.5,_-P*(M-v)*.5,f-w*M,_-P*M,f+w*v,_+P*v,n,!0)+2:r.cap===L.SQUARE&&(d+=mt(f,_,w,P,M,v,!0,n))),n.push(f-w*M,_-P*M),n.push(f+w*v,_+P*v);for(let D=1;D<p-1;++D){f=s[(D-1)*2],_=s[(D-1)*2+1],g=s[D*2],y=s[D*2+1],A=s[(D+1)*2],C=s[(D+1)*2+1],w=-(_-y),P=f-g,R=Math.sqrt(w*w+P*P),w/=R,P/=R,w*=u,P*=u,T=-(y-C),E=g-A,R=Math.sqrt(T*T+E*E),T/=R,E/=R,T*=u,E*=u;const B=g-f,Y=_-y,Q=g-A,X=C-y,J=Y*Q-X*B,z=J<0;if(Math.abs(J)<.1){n.push(g-w*M,y-P*M),n.push(g+w*v,y+P*v);continue}const pt=(-w+f)*(-P+y)-(-w+g)*(-P+_),dt=(-T+A)*(-E+y)-(-T+g)*(-E+C),Z=(B*dt-Q*pt)/J,K=(X*pt-Y*dt)/J,ht=(Z-g)*(Z-g)+(K-y)*(K-y),U=g+(Z-g)*M,O=y+(K-y)*M,N=g-(Z-g)*v,H=y-(K-y)*v,vt=Math.min(B*B+Y*Y,Q*Q+X*X),gt=z?M:v,Dt=vt+gt*gt*m;ht<=Dt?r.join===I.BEVEL||ht/m>S?(z?(n.push(U,O),n.push(g+w*v,y+P*v),n.push(U,O),n.push(g+T*v,y+E*v)):(n.push(g-w*M,y-P*M),n.push(N,H),n.push(g-T*M,y-E*M),n.push(N,H)),d+=2):r.join===I.ROUND?z?(n.push(U,O),n.push(g+w*v,y+P*v),d+=G(g,y,g+w*v,y+P*v,g+T*v,y+E*v,n,!0)+4,n.push(U,O),n.push(g+T*v,y+E*v)):(n.push(g-w*M,y-P*M),n.push(N,H),d+=G(g,y,g-w*M,y-P*M,g-T*M,y-E*M,n,!1)+4,n.push(g-T*M,y-E*M),n.push(N,H)):(n.push(U,O),n.push(N,H)):(n.push(g-w*M,y-P*M),n.push(g+w*v,y+P*v),r.join===I.ROUND?z?d+=G(g,y,g+w*v,y+P*v,g+T*v,y+E*v,n,!0)+2:d+=G(g,y,g-w*M,y-P*M,g-T*M,y-E*M,n,!1)+2:r.join===I.MITER&&ht/m<=S&&(z?(n.push(N,H),n.push(N,H)):(n.push(U,O),n.push(U,O)),d+=2),n.push(g-T*M,y-E*M),n.push(g+T*v,y+E*v),d+=2)}f=s[(p-2)*2],_=s[(p-2)*2+1],g=s[(p-1)*2],y=s[(p-1)*2+1],w=-(_-y),P=f-g,R=Math.sqrt(w*w+P*P),w/=R,P/=R,w*=u,P*=u,n.push(g-w*M,y-P*M),n.push(g+w*v,y+P*v),o||(r.cap===L.ROUND?d+=G(g-w*(M-v)*.5,y-P*(M-v)*.5,g-w*M,y-P*M,g+w*v,y+P*v,n,!1)+2:r.cap===L.SQUARE&&(d+=mt(g,y,w,P,M,v,!1,n)));const Pt=e.indices,Mt=F.epsilon*F.epsilon;for(let D=b;D<d+b-2;++D)f=n[D*2],_=n[D*2+1],g=n[(D+1)*2],y=n[(D+1)*2+1],A=n[(D+2)*2],C=n[(D+2)*2+1],!(Math.abs(f*(y-C)+g*(C-_)+A*(_-y))<Mt)&&Pt.push(D,D+1,D+2)}function Tt(t,e){let i=0;const s=t.shape,h=t.points||s.points,r=s.type!==x.SHAPES.POLY||s.closeStroke;if(h.length===0)return;const a=e.points,l=e.indices,o=h.length/2,c=a.length/2;let n=c;for(a.push(h[0],h[1]),i=1;i<o;i++)a.push(h[i*2],h[i*2+1]),l.push(n,n+1),n++;r&&l.push(n,c)}function rt(t,e){t.lineStyle.native?Tt(t,e):At(t,e)}class lt{static curveTo(e,i,s,h,r,a){const l=a[a.length-2],o=a[a.length-1]-i,c=l-e,n=h-i,p=s-e,d=Math.abs(o*p-c*n);if(d<1e-8||r===0)return(a[a.length-2]!==e||a[a.length-1]!==i)&&a.push(e,i),null;const b=o*o+c*c,u=n*n+p*p,m=o*n+c*p,S=r*Math.sqrt(b)/d,f=r*Math.sqrt(u)/d,_=S*m/b,g=f*m/u,y=S*p+f*c,A=S*n+f*o,C=c*(f+_),w=o*(f+_),P=p*(S+g),T=n*(S+g),E=Math.atan2(w-A,C-y),R=Math.atan2(T-A,P-y);return{cx:y+e,cy:A+i,radius:r,startAngle:E,endAngle:R,anticlockwise:c*n>p*o}}static arc(e,i,s,h,r,a,l,o,c){const n=l-a,p=F._segmentsCount(Math.abs(n)*r,Math.ceil(Math.abs(n)/x.PI_2)*40),d=n/(p*2),b=d*2,u=Math.cos(d),m=Math.sin(d),S=p-1,f=S%1/S;for(let _=0;_<=S;++_){const g=_+f*_,y=d+a+b*g,A=Math.cos(y),C=-Math.sin(y);c.push((u*A+m*C)*r+s,(u*-C+m*A)*r+h)}}}class et{static curveLength(e,i,s,h,r,a,l,o){let c=0,n=0,p=0,d=0,b=0,u=0,m=0,S=0,f=0,_=0,g=0,y=e,A=i;for(let C=1;C<=10;++C)n=C/10,p=n*n,d=p*n,b=1-n,u=b*b,m=u*b,S=m*e+3*u*n*s+3*b*p*r+d*l,f=m*i+3*u*n*h+3*b*p*a+d*o,_=y-S,g=A-f,y=S,A=f,c+=Math.sqrt(_*_+g*g);return c}static curveTo(e,i,s,h,r,a,l){const o=l[l.length-2],c=l[l.length-1];l.length-=2;const n=F._segmentsCount(et.curveLength(o,c,e,i,s,h,r,a));let p=0,d=0,b=0,u=0,m=0;l.push(o,c);for(let S=1,f=0;S<=n;++S)f=S/n,p=1-f,d=p*p,b=d*p,u=f*f,m=u*f,l.push(b*o+3*d*f*e+3*p*u*s+m*r,b*c+3*d*f*i+3*p*u*h+m*a)}}class st{static curveLength(e,i,s,h,r,a){const l=e-2*s+r,o=i-2*h+a,c=2*s-2*e,n=2*h-2*i,p=4*(l*l+o*o),d=4*(l*c+o*n),b=c*c+n*n,u=2*Math.sqrt(p+d+b),m=Math.sqrt(p),S=2*p*m,f=2*Math.sqrt(b),_=d/m;return(S*u+m*d*(u-f)+(4*b*p-d*d)*Math.log((2*m+_+u)/(_+f)))/(4*S)}static curveTo(e,i,s,h,r){const a=r[r.length-2],l=r[r.length-1],o=F._segmentsCount(st.curveLength(a,l,e,i,s,h));let c=0,n=0;for(let p=1;p<=o;++p){const d=p/o;c=a+(e-a)*d,n=l+(i-l)*d,r.push(c+(e+(s-e)*d-c)*d,n+(i+(h-i)*d-n)*d)}}}class St{constructor(){this.reset()}begin(e,i,s){this.reset(),this.style=e,this.start=i,this.attribStart=s}end(e,i){this.attribSize=i-this.attribStart,this.size=e-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}const $={[x.SHAPES.POLY]:nt,[x.SHAPES.CIRC]:j,[x.SHAPES.ELIP]:j,[x.SHAPES.RECT]:ft,[x.SHAPES.RREC]:xt},at=[],k=[];class V{constructor(e,i=null,s=null,h=null){this.points=[],this.holes=[],this.shape=e,this.lineStyle=s,this.fillStyle=i,this.matrix=h,this.type=e.type}clone(){return new V(this.shape,this.fillStyle,this.lineStyle,this.matrix)}destroy(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null}}const q=new x.Point,_t=class extends x.BatchGeometry{constructor(){super(),this.closePointEps=1e-4,this.boundsPadding=0,this.uvsFloat32=null,this.indicesUint16=null,this.batchable=!1,this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.drawCalls=[],this.batchDirty=-1,this.batches=[],this.dirty=0,this.cacheDirty=-1,this.clearDirty=0,this.shapeIndex=0,this._bounds=new yt.Bounds,this.boundsDirty=-1}get bounds(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds}invalidate(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(let t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),k.push(this.drawCalls[t]);this.drawCalls.length=0;for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e.reset(),at.push(e)}this.batches.length=0}clear(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(t,e=null,i=null,s=null){const h=new V(t,e,i,s);return this.graphicsData.push(h),this.dirty++,this}drawHole(t,e=null){if(!this.graphicsData.length)return null;const i=new V(t,null,null,e),s=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=s.lineStyle,s.holes.push(i),this.dirty++,this}destroy(){super.destroy();for(let t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null}containsPoint(t){const e=this.graphicsData;for(let i=0;i<e.length;++i){const s=e[i];if(!!s.fillStyle.visible&&s.shape&&(s.matrix?s.matrix.applyInverse(t,q):q.copyFrom(t),s.shape.contains(q.x,q.y))){let h=!1;if(s.holes){for(let r=0;r<s.holes.length;r++)if(s.holes[r].shape.contains(q.x,q.y)){h=!0;break}}if(!h)return!0}}return!1}updateBatches(){if(!this.graphicsData.length){this.batchable=!0;return}if(!this.validateBatching())return;this.cacheDirty=this.dirty;const t=this.uvs,e=this.graphicsData;let i=null,s=null;this.batches.length>0&&(i=this.batches[this.batches.length-1],s=i.style);for(let l=this.shapeIndex;l<e.length;l++){this.shapeIndex++;const o=e[l],c=o.fillStyle,n=o.lineStyle;$[o.type].build(o),o.matrix&&this.transformPoints(o.points,o.matrix),(c.visible||n.visible)&&this.processHoles(o.holes);for(let p=0;p<2;p++){const d=p===0?c:n;if(!d.visible)continue;const b=d.texture.baseTexture,u=this.indices.length,m=this.points.length/2;b.wrapMode=x.WRAP_MODES.REPEAT,p===0?this.processFill(o):this.processLine(o);const S=this.points.length/2-m;S!==0&&(i&&!this._compareStyles(s,d)&&(i.end(u,m),i=null),i||(i=at.pop()||new St,i.begin(d,u,m),this.batches.push(i),s=d),this.addUvs(this.points,t,d.texture,m,S,d.matrix))}}const h=this.indices.length,r=this.points.length/2;if(i&&i.end(h,r),this.batches.length===0){this.batchable=!0;return}const a=r>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&a===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=a?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(t,e){return!(!t||!e||t.texture.baseTexture!==e.texture.baseTexture||t.color+t.alpha!==e.color+e.alpha||!!t.native!=!!e.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let t=0,e=this.graphicsData.length;t<e;t++){const i=this.graphicsData[t],s=i.fillStyle,h=i.lineStyle;if(s&&!s.texture.baseTexture.valid||h&&!h.texture.baseTexture.valid)return!1}return!0}packBatches(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);const t=this.batches;for(let e=0,i=t.length;e<i;e++){const s=t[e];for(let h=0;h<s.size;h++){const r=s.start+h;this.indicesUint16[r]=this.indicesUint16[r]-s.attribStart}}}isBatchable(){if(this.points.length>65535*2)return!1;const t=this.batches;for(let e=0;e<t.length;e++)if(t[e].style.native)return!1;return this.points.length<_t.BATCHABLE_SIZE*2}buildDrawCalls(){let t=++x.BaseTexture._globalBatch;for(let n=0;n<this.drawCalls.length;n++)this.drawCalls[n].texArray.clear(),k.push(this.drawCalls[n]);this.drawCalls.length=0;const e=this.colors,i=this.textureIds;let s=k.pop();s||(s=new x.BatchDrawCall,s.texArray=new x.BatchTextureArray),s.texArray.count=0,s.start=0,s.size=0,s.type=x.DRAW_MODES.TRIANGLES;let h=0,r=null,a=0,l=!1,o=x.DRAW_MODES.TRIANGLES,c=0;this.drawCalls.push(s);for(let n=0;n<this.batches.length;n++){const p=this.batches[n],d=8,b=p.style,u=b.texture.baseTexture;l!==!!b.native&&(l=!!b.native,o=l?x.DRAW_MODES.LINES:x.DRAW_MODES.TRIANGLES,r=null,h=d,t++),r!==u&&(r=u,u._batchEnabled!==t&&(h===d&&(t++,h=0,s.size>0&&(s=k.pop(),s||(s=new x.BatchDrawCall,s.texArray=new x.BatchTextureArray),this.drawCalls.push(s)),s.start=c,s.size=0,s.texArray.count=0,s.type=o),u.touched=1,u._batchEnabled=t,u._batchLocation=h,u.wrapMode=x.WRAP_MODES.REPEAT,s.texArray.elements[s.texArray.count++]=u,h++)),s.size+=p.size,c+=p.size,a=u._batchLocation,this.addColors(e,b.color,b.alpha,p.attribSize,p.attribStart),this.addTextureIds(i,a,p.attribSize,p.attribStart)}x.BaseTexture._globalBatch=t,this.packAttributes()}packAttributes(){const t=this.points,e=this.uvs,i=this.colors,s=this.textureIds,h=new ArrayBuffer(t.length*3*4),r=new Float32Array(h),a=new Uint32Array(h);let l=0;for(let o=0;o<t.length/2;o++)r[l++]=t[o*2],r[l++]=t[o*2+1],r[l++]=e[o*2],r[l++]=e[o*2+1],a[l++]=i[o],r[l++]=s[o];this._buffer.update(h),this._indexBuffer.update(this.indicesUint16)}processFill(t){t.holes.length?nt.triangulate(t,this):$[t.type].triangulate(t,this)}processLine(t){rt(t,this);for(let e=0;e<t.holes.length;e++)rt(t.holes[e],this)}processHoles(t){for(let e=0;e<t.length;e++){const i=t[e];$[i.type].build(i),i.matrix&&this.transformPoints(i.points,i.matrix)}}calculateBounds(){const t=this._bounds;t.clear(),t.addVertexData(this.points,0,this.points.length),t.pad(this.boundsPadding,this.boundsPadding)}transformPoints(t,e){for(let i=0;i<t.length/2;i++){const s=t[i*2],h=t[i*2+1];t[i*2]=e.a*s+e.c*h+e.tx,t[i*2+1]=e.b*s+e.d*h+e.ty}}addColors(t,e,i,s,h=0){const r=(e>>16)+(e&65280)+((e&255)<<16),a=x.utils.premultiplyTint(r,i);t.length=Math.max(t.length,h+s);for(let l=0;l<s;l++)t[h+l]=a}addTextureIds(t,e,i,s=0){t.length=Math.max(t.length,s+i);for(let h=0;h<i;h++)t[s+h]=e}addUvs(t,e,i,s,h,r=null){let a=0;const l=e.length,o=i.frame;for(;a<h;){let n=t[(s+a)*2],p=t[(s+a)*2+1];if(r){const d=r.a*n+r.c*p+r.tx;p=r.b*n+r.d*p+r.ty,n=d}a++,e.push(n/o.width,p/o.height)}const c=i.baseTexture;(o.width<c.width||o.height<c.height)&&this.adjustUvs(e,i,l,h)}adjustUvs(t,e,i,s){const h=e.baseTexture,r=1e-6,a=i+s*2,l=e.frame,o=l.width/h.width,c=l.height/h.height;let n=l.x/l.width,p=l.y/l.height,d=Math.floor(t[i]+r),b=Math.floor(t[i+1]+r);for(let u=i+2;u<a;u+=2)d=Math.min(d,Math.floor(t[u]+r)),b=Math.min(b,Math.floor(t[u+1]+r));n-=d,p-=b;for(let u=i;u<a;u+=2)t[u]=(t[u]+n)*o,t[u+1]=(t[u+1]+p)*c}};let ot=_t;ot.BATCHABLE_SIZE=100;class it extends W{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=L.BUTT,this.join=I.MITER,this.miterLimit=10}clone(){const e=new it;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e.width=this.width,e.alignment=this.alignment,e.native=this.native,e.cap=this.cap,e.join=this.join,e.miterLimit=this.miterLimit,e}reset(){super.reset(),this.color=0,this.alignment=.5,this.width=0,this.native=!1}}const Et=new Float32Array(3),ct={},tt=class extends yt.Container{constructor(t=null){super(),this.shader=null,this.pluginName="batch",this.currentPath=null,this.batches=[],this.batchTint=-1,this.batchDirty=-1,this.vertexData=null,this._fillStyle=new W,this._lineStyle=new it,this._matrix=null,this._holeMode=!1,this.state=x.State.for2d(),this._geometry=t||new ot,this._geometry.refCount++,this._transformID=-1,this.tint=16777215,this.blendMode=x.BLEND_MODES.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new tt(this._geometry)}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}get tint(){return this._tint}set tint(t){this._tint=t}get fill(){return this._fillStyle}get line(){return this._lineStyle}lineStyle(t=null,e=0,i=1,s=.5,h=!1){return typeof t=="number"&&(t={width:t,color:e,alpha:i,alignment:s,native:h}),this.lineTextureStyle(t)}lineTextureStyle(t){t=Object.assign({width:0,texture:x.Texture.WHITE,color:t?.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:L.BUTT,join:I.MITER,miterLimit:10},t),this.currentPath&&this.startPoly();const e=t.width>0&&t.alpha>0;return e?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:e},t)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new x.Polygon,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new x.Polygon,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this}lineTo(t,e){this.currentPath||this.moveTo(0,0);const i=this.currentPath.points,s=i[i.length-2],h=i[i.length-1];return(s!==t||h!==e)&&i.push(t,e),this}_initCurve(t=0,e=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[t,e]):this.moveTo(t,e)}quadraticCurveTo(t,e,i,s){this._initCurve();const h=this.currentPath.points;return h.length===0&&this.moveTo(0,0),st.curveTo(t,e,i,s,h),this}bezierCurveTo(t,e,i,s,h,r){return this._initCurve(),et.curveTo(t,e,i,s,h,r,this.currentPath.points),this}arcTo(t,e,i,s,h){this._initCurve(t,e);const r=this.currentPath.points,a=lt.curveTo(t,e,i,s,h,r);if(a){const{cx:l,cy:o,radius:c,startAngle:n,endAngle:p,anticlockwise:d}=a;this.arc(l,o,c,n,p,d)}return this}arc(t,e,i,s,h,r=!1){if(s===h)return this;if(!r&&h<=s?h+=x.PI_2:r&&s<=h&&(s+=x.PI_2),h-s===0)return this;const a=t+Math.cos(s)*i,l=e+Math.sin(s)*i,o=this._geometry.closePointEps;let c=this.currentPath?this.currentPath.points:null;if(c){const n=Math.abs(c[c.length-2]-a),p=Math.abs(c[c.length-1]-l);n<o&&p<o||c.push(a,l)}else this.moveTo(a,l),c=this.currentPath.points;return lt.arc(a,l,t,e,i,s,h,r,c),this}beginFill(t=0,e=1){return this.beginTextureFill({texture:x.Texture.WHITE,color:t,alpha:e})}beginTextureFill(t){t=Object.assign({texture:x.Texture.WHITE,color:16777215,alpha:1,matrix:null},t),this.currentPath&&this.startPoly();const e=t.alpha>0;return e?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:e},t)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(t,e,i,s){return this.drawShape(new x.Rectangle(t,e,i,s))}drawRoundedRect(t,e,i,s,h){return this.drawShape(new x.RoundedRectangle(t,e,i,s,h))}drawCircle(t,e,i){return this.drawShape(new x.Circle(t,e,i))}drawEllipse(t,e,i,s){return this.drawShape(new x.Ellipse(t,e,i,s))}drawPolygon(...t){let e,i=!0;const s=t[0];s.points?(i=s.closeStroke,e=s.points):Array.isArray(t[0])?e=t[0]:e=t;const h=new x.Polygon(e);return h.closeStroke=i,this.drawShape(h),this}drawShape(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const t=this._geometry.graphicsData;return t.length===1&&t[0].shape.type===x.SHAPES.RECT&&!t[0].matrix&&!t[0].holes.length&&!(t[0].lineStyle.visible&&t[0].lineStyle.width)}_render(t){this.finishPoly();const e=this._geometry;e.updateBatches(),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))}_populateBatches(){const t=this._geometry,e=this.blendMode,i=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(t.points);for(let s=0;s<i;s++){const h=t.batches[s],r=h.style.color,a=new Float32Array(this.vertexData.buffer,h.attribStart*4*2,h.attribSize*2),l=new Float32Array(t.uvsFloat32.buffer,h.attribStart*4*2,h.attribSize*2),o=new Uint16Array(t.indicesUint16.buffer,h.start*2,h.size),c={vertexData:a,blendMode:e,indices:o,uvs:l,_batchRGB:x.utils.hex2rgb(r),_tintRGB:r,_texture:h.style.texture,alpha:h.style.alpha,worldAlpha:1};this.batches[s]=c}}_renderBatched(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(let e=0,i=this.batches.length;e<i;e++){const s=this.batches[e];s.worldAlpha=this.worldAlpha*s.alpha,t.plugins[this.pluginName].render(s)}}}_renderDirect(t){const e=this._resolveDirectShader(t),i=this._geometry,s=this.tint,h=this.worldAlpha,r=e.uniforms,a=i.drawCalls;r.translationMatrix=this.transform.worldTransform,r.tint[0]=(s>>16&255)/255*h,r.tint[1]=(s>>8&255)/255*h,r.tint[2]=(s&255)/255*h,r.tint[3]=h,t.shader.bind(e),t.geometry.bind(i,e),t.state.set(this.state);for(let l=0,o=a.length;l<o;l++)this._renderDrawCallDirect(t,i.drawCalls[l])}_renderDrawCallDirect(t,e){const{texArray:i,type:s,size:h,start:r}=e,a=i.count;for(let l=0;l<a;l++)t.texture.bind(i.elements[l],l);t.geometry.draw(s,h,r)}_resolveDirectShader(t){let e=this.shader;const i=this.pluginName;if(!e){if(!ct[i]){const{MAX_TEXTURES:s}=t.plugins[i],h=new Int32Array(s);for(let l=0;l<s;l++)h[l]=l;const r={tint:new Float32Array([1,1,1,1]),translationMatrix:new x.Matrix,default:x.UniformGroup.from({uSamplers:h},!0)},a=t.plugins[i]._shader.program;ct[i]=new x.Shader(a,r)}e=ct[i]}return e}_calculateBounds(){this.finishPoly();const t=this._geometry;if(!t.graphicsData.length)return;const{minX:e,minY:i,maxX:s,maxY:h}=t.bounds;this._bounds.addFrame(this.transform,e,i,s,h)}containsPoint(t){return this.worldTransform.applyInverse(t,tt._TEMP_POINT),this._geometry.containsPoint(tt._TEMP_POINT)}calculateTints(){if(this.batchTint!==this.tint){this.batchTint=this.tint;const t=x.utils.hex2rgb(this.tint,Et);for(let e=0;e<this.batches.length;e++){const i=this.batches[e],s=i._batchRGB,h=t[0]*s[0]*255,r=t[1]*s[1]*255,a=t[2]*s[2]*255,l=(h<<16)+(r<<8)+(a|0);i._tintRGB=(l>>16)+(l&65280)+((l&255)<<16)}}}calculateVertices(){const t=this.transform._worldID;if(this._transformID===t)return;this._transformID=t;const e=this.transform.worldTransform,i=e.a,s=e.b,h=e.c,r=e.d,a=e.tx,l=e.ty,o=this._geometry.points,c=this.vertexData;let n=0;for(let p=0;p<o.length;p+=2){const d=o[p],b=o[p+1];c[n++]=i*d+h*b+a,c[n++]=r*b+s*d+l}}closePath(){const t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this}setMatrix(t){return this._matrix=t,this}beginHole(){return this.finishPoly(),this._holeMode=!0,this}endHole(){return this.finishPoly(),this._holeMode=!1,this}destroy(t){this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,super.destroy(t)}};let wt=tt;wt._TEMP_POINT=new x.Point;const Ct={buildPoly:nt,buildCircle:j,buildRectangle:ft,buildRoundedRectangle:xt,buildLine:rt,ArcUtils:lt,BezierUtils:et,QuadraticUtils:st,BatchPart:St,FILL_COMMANDS:$,BATCH_POOL:at,DRAW_CALL_POOL:k};exports.FillStyle=W,exports.GRAPHICS_CURVES=F,exports.Graphics=wt,exports.GraphicsData=V,exports.GraphicsGeometry=ot,exports.LINE_CAP=L,exports.LINE_JOIN=I,exports.LineStyle=it,exports.graphicsUtils=Ct;
*/Object.defineProperty(exports,"__esModule",{value:!0});var x=require("@pixi/core"),yt=require("@pixi/display"),I=(t=>(t.MITER="miter",t.BEVEL="bevel",t.ROUND="round",t))(I||{}),L=(t=>(t.BUTT="butt",t.ROUND="round",t.SQUARE="square",t))(L||{});const F={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(t,e=20){if(!this.adaptive||!t||isNaN(t))return e;let s=Math.ceil(t/this.maxLength);return s<this.minSegments?s=this.minSegments:s>this.maxSegments&&(s=this.maxSegments),s}};class W{constructor(){this.color=16777215,this.alpha=1,this.texture=x.Texture.WHITE,this.matrix=null,this.visible=!1,this.reset()}clone(){const e=new W;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e}reset(){this.color=16777215,this.alpha=1,this.texture=x.Texture.WHITE,this.matrix=null,this.visible=!1}destroy(){this.texture=null,this.matrix=null}}function bt(t,e=!1){const s=t.length;if(s<6)return;let i=0;for(let h=0,r=t[s-2],a=t[s-1];h<s;h+=2){const l=t[h],o=t[h+1];i+=(l-r)*(o+a),r=l,a=o}if(!e&&i>0||e&&i<=0){const h=s/2;for(let r=h+h%2;r<s;r+=2){const a=s-r-2,l=s-r-1,o=r,c=r+1;[t[a],t[o]]=[t[o],t[a]],[t[l],t[c]]=[t[c],t[l]]}}}const nt={build(t){t.points=t.shape.points.slice()},triangulate(t,e){let s=t.points;const i=t.holes,h=e.points,r=e.indices;if(s.length>=6){bt(s,!1);const a=[];for(let c=0;c<i.length;c++){const n=i[c];bt(n.points,!0),a.push(s.length/2),s=s.concat(n.points)}const l=x.utils.earcut(s,a,2);if(!l)return;const o=h.length/2;for(let c=0;c<l.length;c+=3)r.push(l[c]+o),r.push(l[c+1]+o),r.push(l[c+2]+o);for(let c=0;c<s.length;c++)h.push(s[c])}}},j={build(t){const e=t.points;let s,i,h,r,a,l;if(t.type===x.SHAPES.CIRC){const u=t.shape;s=u.x,i=u.y,a=l=u.radius,h=r=0}else if(t.type===x.SHAPES.ELIP){const u=t.shape;s=u.x,i=u.y,a=u.width,l=u.height,h=r=0}else{const u=t.shape,m=u.width/2,S=u.height/2;s=u.x+m,i=u.y+S,a=l=Math.max(0,Math.min(u.radius,Math.min(m,S))),h=m-a,r=S-l}if(!(a>=0&&l>=0&&h>=0&&r>=0)){e.length=0;return}const o=Math.ceil(2.3*Math.sqrt(a+l)),c=o*8+(h?4:0)+(r?4:0);if(e.length=c,c===0)return;if(o===0){e.length=8,e[0]=e[6]=s+h,e[1]=e[3]=i+r,e[2]=e[4]=s-h,e[5]=e[7]=i-r;return}let n=0,p=o*4+(h?2:0)+2,d=p,b=c;{const u=h+a,m=r,S=s+u,f=s-u,_=i+m;if(e[n++]=S,e[n++]=_,e[--p]=_,e[--p]=f,r){const g=i-m;e[d++]=f,e[d++]=g,e[--b]=g,e[--b]=S}}for(let u=1;u<o;u++){const m=Math.PI/2*(u/o),S=h+Math.cos(m)*a,f=r+Math.sin(m)*l,_=s+S,g=s-S,y=i+f,A=i-f;e[n++]=_,e[n++]=y,e[--p]=y,e[--p]=g,e[d++]=g,e[d++]=A,e[--b]=A,e[--b]=_}{const u=h,m=r+l,S=s+u,f=s-u,_=i+m,g=i-m;e[n++]=S,e[n++]=_,e[--b]=g,e[--b]=S,h&&(e[n++]=f,e[n++]=_,e[--b]=g,e[--b]=f)}},triangulate(t,e){const s=t.points,i=e.points,h=e.indices;if(s.length===0)return;let r=i.length/2;const a=r;let l,o;if(t.type!==x.SHAPES.RREC){const n=t.shape;l=n.x,o=n.y}else{const n=t.shape;l=n.x+n.width/2,o=n.y+n.height/2}const c=t.matrix;i.push(t.matrix?c.a*l+c.c*o+c.tx:l,t.matrix?c.b*l+c.d*o+c.ty:o),r++,i.push(s[0],s[1]);for(let n=2;n<s.length;n+=2)i.push(s[n],s[n+1]),h.push(r++,a,r);h.push(a+1,a,r)}},ft={build(t){const e=t.shape,s=e.x,i=e.y,h=e.width,r=e.height,a=t.points;a.length=0,h>=0&&r>=0&&a.push(s,i,s+h,i,s+h,i+r,s,i+r)},triangulate(t,e){const s=t.points,i=e.points;if(s.length===0)return;const h=i.length/2;i.push(s[0],s[1],s[2],s[3],s[6],s[7],s[4],s[5]),e.indices.push(h,h+1,h+2,h+1,h+2,h+3)}},xt={build(t){j.build(t)},triangulate(t,e){j.triangulate(t,e)}};function mt(t,e,s,i,h,r,a,l){const o=t-s*h,c=e-i*h,n=t+s*r,p=e+i*r;let d,b;a?(d=i,b=-s):(d=-i,b=s);const u=o+d,m=c+b,S=n+d,f=p+b;return l.push(u,m),l.push(S,f),2}function G(t,e,s,i,h,r,a,l){const o=s-t,c=i-e;let n=Math.atan2(o,c),p=Math.atan2(h-t,r-e);l&&n<p?n+=Math.PI*2:!l&&n>p&&(p+=Math.PI*2);let d=n;const b=p-n,u=Math.abs(b),m=Math.sqrt(o*o+c*c),S=(15*u*Math.sqrt(m)/Math.PI>>0)+1,f=b/S;if(d+=f,l){a.push(t,e),a.push(s,i);for(let _=1,g=d;_<S;_++,g+=f)a.push(t,e),a.push(t+Math.sin(g)*m,e+Math.cos(g)*m);a.push(t,e),a.push(h,r)}else{a.push(s,i),a.push(t,e);for(let _=1,g=d;_<S;_++,g+=f)a.push(t+Math.sin(g)*m,e+Math.cos(g)*m),a.push(t,e);a.push(h,r),a.push(t,e)}return S*2}function At(t,e){const s=t.shape;let i=t.points||s.points.slice();const h=e.closePointEps;if(i.length===0)return;const r=t.lineStyle,a=new x.Point(i[0],i[1]),l=new x.Point(i[i.length-2],i[i.length-1]),o=s.type!==x.SHAPES.POLY||s.closeStroke,c=Math.abs(a.x-l.x)<h&&Math.abs(a.y-l.y)<h;if(o){i=i.slice(),c&&(i.pop(),i.pop(),l.set(i[i.length-2],i[i.length-1]));const D=(a.x+l.x)*.5,B=(l.y+a.y)*.5;i.unshift(D,B),i.push(D,B)}const n=e.points,p=i.length/2;let d=i.length;const b=n.length/2,u=r.width/2,m=u*u,S=r.miterLimit*r.miterLimit;let f=i[0],_=i[1],g=i[2],y=i[3],A=0,C=0,w=-(_-y),P=f-g,T=0,E=0,R=Math.sqrt(w*w+P*P);w/=R,P/=R,w*=u,P*=u;const ut=r.alignment,M=(1-ut)*2,v=ut*2;o||(r.cap===L.ROUND?d+=G(f-w*(M-v)*.5,_-P*(M-v)*.5,f-w*M,_-P*M,f+w*v,_+P*v,n,!0)+2:r.cap===L.SQUARE&&(d+=mt(f,_,w,P,M,v,!0,n))),n.push(f-w*M,_-P*M),n.push(f+w*v,_+P*v);for(let D=1;D<p-1;++D){f=i[(D-1)*2],_=i[(D-1)*2+1],g=i[D*2],y=i[D*2+1],A=i[(D+1)*2],C=i[(D+1)*2+1],w=-(_-y),P=f-g,R=Math.sqrt(w*w+P*P),w/=R,P/=R,w*=u,P*=u,T=-(y-C),E=g-A,R=Math.sqrt(T*T+E*E),T/=R,E/=R,T*=u,E*=u;const B=g-f,Y=_-y,Q=g-A,X=C-y,J=Y*Q-X*B,z=J<0;if(Math.abs(J)<.1){n.push(g-w*M,y-P*M),n.push(g+w*v,y+P*v);continue}const pt=(-w+f)*(-P+y)-(-w+g)*(-P+_),dt=(-T+A)*(-E+y)-(-T+g)*(-E+C),Z=(B*dt-Q*pt)/J,K=(X*pt-Y*dt)/J,ht=(Z-g)*(Z-g)+(K-y)*(K-y),U=g+(Z-g)*M,O=y+(K-y)*M,N=g-(Z-g)*v,H=y-(K-y)*v,vt=Math.min(B*B+Y*Y,Q*Q+X*X),gt=z?M:v,Dt=vt+gt*gt*m;ht<=Dt?r.join===I.BEVEL||ht/m>S?(z?(n.push(U,O),n.push(g+w*v,y+P*v),n.push(U,O),n.push(g+T*v,y+E*v)):(n.push(g-w*M,y-P*M),n.push(N,H),n.push(g-T*M,y-E*M),n.push(N,H)),d+=2):r.join===I.ROUND?z?(n.push(U,O),n.push(g+w*v,y+P*v),d+=G(g,y,g+w*v,y+P*v,g+T*v,y+E*v,n,!0)+4,n.push(U,O),n.push(g+T*v,y+E*v)):(n.push(g-w*M,y-P*M),n.push(N,H),d+=G(g,y,g-w*M,y-P*M,g-T*M,y-E*M,n,!1)+4,n.push(g-T*M,y-E*M),n.push(N,H)):(n.push(U,O),n.push(N,H)):(n.push(g-w*M,y-P*M),n.push(g+w*v,y+P*v),r.join===I.ROUND?z?d+=G(g,y,g+w*v,y+P*v,g+T*v,y+E*v,n,!0)+2:d+=G(g,y,g-w*M,y-P*M,g-T*M,y-E*M,n,!1)+2:r.join===I.MITER&&ht/m<=S&&(z?(n.push(N,H),n.push(N,H)):(n.push(U,O),n.push(U,O)),d+=2),n.push(g-T*M,y-E*M),n.push(g+T*v,y+E*v),d+=2)}f=i[(p-2)*2],_=i[(p-2)*2+1],g=i[(p-1)*2],y=i[(p-1)*2+1],w=-(_-y),P=f-g,R=Math.sqrt(w*w+P*P),w/=R,P/=R,w*=u,P*=u,n.push(g-w*M,y-P*M),n.push(g+w*v,y+P*v),o||(r.cap===L.ROUND?d+=G(g-w*(M-v)*.5,y-P*(M-v)*.5,g-w*M,y-P*M,g+w*v,y+P*v,n,!1)+2:r.cap===L.SQUARE&&(d+=mt(g,y,w,P,M,v,!1,n)));const Pt=e.indices,Mt=F.epsilon*F.epsilon;for(let D=b;D<d+b-2;++D)f=n[D*2],_=n[D*2+1],g=n[(D+1)*2],y=n[(D+1)*2+1],A=n[(D+2)*2],C=n[(D+2)*2+1],!(Math.abs(f*(y-C)+g*(C-_)+A*(_-y))<Mt)&&Pt.push(D,D+1,D+2)}function Tt(t,e){let s=0;const i=t.shape,h=t.points||i.points,r=i.type!==x.SHAPES.POLY||i.closeStroke;if(h.length===0)return;const a=e.points,l=e.indices,o=h.length/2,c=a.length/2;let n=c;for(a.push(h[0],h[1]),s=1;s<o;s++)a.push(h[s*2],h[s*2+1]),l.push(n,n+1),n++;r&&l.push(n,c)}function rt(t,e){t.lineStyle.native?Tt(t,e):At(t,e)}class lt{static curveTo(e,s,i,h,r,a){const l=a[a.length-2],o=a[a.length-1]-s,c=l-e,n=h-s,p=i-e,d=Math.abs(o*p-c*n);if(d<1e-8||r===0)return(a[a.length-2]!==e||a[a.length-1]!==s)&&a.push(e,s),null;const b=o*o+c*c,u=n*n+p*p,m=o*n+c*p,S=r*Math.sqrt(b)/d,f=r*Math.sqrt(u)/d,_=S*m/b,g=f*m/u,y=S*p+f*c,A=S*n+f*o,C=c*(f+_),w=o*(f+_),P=p*(S+g),T=n*(S+g),E=Math.atan2(w-A,C-y),R=Math.atan2(T-A,P-y);return{cx:y+e,cy:A+s,radius:r,startAngle:E,endAngle:R,anticlockwise:c*n>p*o}}static arc(e,s,i,h,r,a,l,o,c){const n=l-a,p=F._segmentsCount(Math.abs(n)*r,Math.ceil(Math.abs(n)/x.PI_2)*40),d=n/(p*2),b=d*2,u=Math.cos(d),m=Math.sin(d),S=p-1,f=S%1/S;for(let _=0;_<=S;++_){const g=_+f*_,y=d+a+b*g,A=Math.cos(y),C=-Math.sin(y);c.push((u*A+m*C)*r+i,(u*-C+m*A)*r+h)}}}class et{static curveLength(e,s,i,h,r,a,l,o){let c=0,n=0,p=0,d=0,b=0,u=0,m=0,S=0,f=0,_=0,g=0,y=e,A=s;for(let C=1;C<=10;++C)n=C/10,p=n*n,d=p*n,b=1-n,u=b*b,m=u*b,S=m*e+3*u*n*i+3*b*p*r+d*l,f=m*s+3*u*n*h+3*b*p*a+d*o,_=y-S,g=A-f,y=S,A=f,c+=Math.sqrt(_*_+g*g);return c}static curveTo(e,s,i,h,r,a,l){const o=l[l.length-2],c=l[l.length-1];l.length-=2;const n=F._segmentsCount(et.curveLength(o,c,e,s,i,h,r,a));let p=0,d=0,b=0,u=0,m=0;l.push(o,c);for(let S=1,f=0;S<=n;++S)f=S/n,p=1-f,d=p*p,b=d*p,u=f*f,m=u*f,l.push(b*o+3*d*f*e+3*p*u*i+m*r,b*c+3*d*f*s+3*p*u*h+m*a)}}class st{static curveLength(e,s,i,h,r,a){const l=e-2*i+r,o=s-2*h+a,c=2*i-2*e,n=2*h-2*s,p=4*(l*l+o*o),d=4*(l*c+o*n),b=c*c+n*n,u=2*Math.sqrt(p+d+b),m=Math.sqrt(p),S=2*p*m,f=2*Math.sqrt(b),_=d/m;return(S*u+m*d*(u-f)+(4*b*p-d*d)*Math.log((2*m+_+u)/(_+f)))/(4*S)}static curveTo(e,s,i,h,r){const a=r[r.length-2],l=r[r.length-1],o=F._segmentsCount(st.curveLength(a,l,e,s,i,h));let c=0,n=0;for(let p=1;p<=o;++p){const d=p/o;c=a+(e-a)*d,n=l+(s-l)*d,r.push(c+(e+(i-e)*d-c)*d,n+(s+(h-s)*d-n)*d)}}}class St{constructor(){this.reset()}begin(e,s,i){this.reset(),this.style=e,this.start=s,this.attribStart=i}end(e,s){this.attribSize=s-this.attribStart,this.size=e-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}const $={[x.SHAPES.POLY]:nt,[x.SHAPES.CIRC]:j,[x.SHAPES.ELIP]:j,[x.SHAPES.RECT]:ft,[x.SHAPES.RREC]:xt},at=[],k=[];class V{constructor(e,s=null,i=null,h=null){this.points=[],this.holes=[],this.shape=e,this.lineStyle=i,this.fillStyle=s,this.matrix=h,this.type=e.type}clone(){return new V(this.shape,this.fillStyle,this.lineStyle,this.matrix)}destroy(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null}}const q=new x.Point,_t=class extends x.BatchGeometry{constructor(){super(),this.closePointEps=1e-4,this.boundsPadding=0,this.uvsFloat32=null,this.indicesUint16=null,this.batchable=!1,this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.drawCalls=[],this.batchDirty=-1,this.batches=[],this.dirty=0,this.cacheDirty=-1,this.clearDirty=0,this.shapeIndex=0,this._bounds=new yt.Bounds,this.boundsDirty=-1}get bounds(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds}invalidate(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(let t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),k.push(this.drawCalls[t]);this.drawCalls.length=0;for(let t=0;t<this.batches.length;t++){const e=this.batches[t];e.reset(),at.push(e)}this.batches.length=0}clear(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(t,e=null,s=null,i=null){const h=new V(t,e,s,i);return this.graphicsData.push(h),this.dirty++,this}drawHole(t,e=null){if(!this.graphicsData.length)return null;const s=new V(t,null,null,e),i=this.graphicsData[this.graphicsData.length-1];return s.lineStyle=i.lineStyle,i.holes.push(s),this.dirty++,this}destroy(){super.destroy();for(let t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null}containsPoint(t){const e=this.graphicsData;for(let s=0;s<e.length;++s){const i=e[s];if(!!i.fillStyle.visible&&i.shape&&(i.matrix?i.matrix.applyInverse(t,q):q.copyFrom(t),i.shape.contains(q.x,q.y))){let h=!1;if(i.holes){for(let r=0;r<i.holes.length;r++)if(i.holes[r].shape.contains(q.x,q.y)){h=!0;break}}if(!h)return!0}}return!1}updateBatches(){if(!this.graphicsData.length){this.batchable=!0;return}if(!this.validateBatching())return;this.cacheDirty=this.dirty;const t=this.uvs,e=this.graphicsData;let s=null,i=null;this.batches.length>0&&(s=this.batches[this.batches.length-1],i=s.style);for(let l=this.shapeIndex;l<e.length;l++){this.shapeIndex++;const o=e[l],c=o.fillStyle,n=o.lineStyle;$[o.type].build(o),o.matrix&&this.transformPoints(o.points,o.matrix),(c.visible||n.visible)&&this.processHoles(o.holes);for(let p=0;p<2;p++){const d=p===0?c:n;if(!d.visible)continue;const b=d.texture.baseTexture,u=this.indices.length,m=this.points.length/2;b.wrapMode=x.WRAP_MODES.REPEAT,p===0?this.processFill(o):this.processLine(o);const S=this.points.length/2-m;S!==0&&(s&&!this._compareStyles(i,d)&&(s.end(u,m),s=null),s||(s=at.pop()||new St,s.begin(d,u,m),this.batches.push(s),i=d),this.addUvs(this.points,t,d.texture,m,S,d.matrix))}}const h=this.indices.length,r=this.points.length/2;if(s&&s.end(h,r),this.batches.length===0){this.batchable=!0;return}const a=r>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&a===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=a?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(t,e){return!(!t||!e||t.texture.baseTexture!==e.texture.baseTexture||t.color+t.alpha!==e.color+e.alpha||!!t.native!=!!e.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let t=0,e=this.graphicsData.length;t<e;t++){const s=this.graphicsData[t],i=s.fillStyle,h=s.lineStyle;if(i&&!i.texture.baseTexture.valid||h&&!h.texture.baseTexture.valid)return!1}return!0}packBatches(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);const t=this.batches;for(let e=0,s=t.length;e<s;e++){const i=t[e];for(let h=0;h<i.size;h++){const r=i.start+h;this.indicesUint16[r]=this.indicesUint16[r]-i.attribStart}}}isBatchable(){if(this.points.length>65535*2)return!1;const t=this.batches;for(let e=0;e<t.length;e++)if(t[e].style.native)return!1;return this.points.length<_t.BATCHABLE_SIZE*2}buildDrawCalls(){let t=++x.BaseTexture._globalBatch;for(let n=0;n<this.drawCalls.length;n++)this.drawCalls[n].texArray.clear(),k.push(this.drawCalls[n]);this.drawCalls.length=0;const e=this.colors,s=this.textureIds;let i=k.pop();i||(i=new x.BatchDrawCall,i.texArray=new x.BatchTextureArray),i.texArray.count=0,i.start=0,i.size=0,i.type=x.DRAW_MODES.TRIANGLES;let h=0,r=null,a=0,l=!1,o=x.DRAW_MODES.TRIANGLES,c=0;this.drawCalls.push(i);for(let n=0;n<this.batches.length;n++){const p=this.batches[n],d=8,b=p.style,u=b.texture.baseTexture;l!==!!b.native&&(l=!!b.native,o=l?x.DRAW_MODES.LINES:x.DRAW_MODES.TRIANGLES,r=null,h=d,t++),r!==u&&(r=u,u._batchEnabled!==t&&(h===d&&(t++,h=0,i.size>0&&(i=k.pop(),i||(i=new x.BatchDrawCall,i.texArray=new x.BatchTextureArray),this.drawCalls.push(i)),i.start=c,i.size=0,i.texArray.count=0,i.type=o),u.touched=1,u._batchEnabled=t,u._batchLocation=h,u.wrapMode=x.WRAP_MODES.REPEAT,i.texArray.elements[i.texArray.count++]=u,h++)),i.size+=p.size,c+=p.size,a=u._batchLocation,this.addColors(e,b.color,b.alpha,p.attribSize,p.attribStart),this.addTextureIds(s,a,p.attribSize,p.attribStart)}x.BaseTexture._globalBatch=t,this.packAttributes()}packAttributes(){const t=this.points,e=this.uvs,s=this.colors,i=this.textureIds,h=new ArrayBuffer(t.length*3*4),r=new Float32Array(h),a=new Uint32Array(h);let l=0;for(let o=0;o<t.length/2;o++)r[l++]=t[o*2],r[l++]=t[o*2+1],r[l++]=e[o*2],r[l++]=e[o*2+1],a[l++]=s[o],r[l++]=i[o];this._buffer.update(h),this._indexBuffer.update(this.indicesUint16)}processFill(t){t.holes.length?nt.triangulate(t,this):$[t.type].triangulate(t,this)}processLine(t){rt(t,this);for(let e=0;e<t.holes.length;e++)rt(t.holes[e],this)}processHoles(t){for(let e=0;e<t.length;e++){const s=t[e];$[s.type].build(s),s.matrix&&this.transformPoints(s.points,s.matrix)}}calculateBounds(){const t=this._bounds;t.clear(),t.addVertexData(this.points,0,this.points.length),t.pad(this.boundsPadding,this.boundsPadding)}transformPoints(t,e){for(let s=0;s<t.length/2;s++){const i=t[s*2],h=t[s*2+1];t[s*2]=e.a*i+e.c*h+e.tx,t[s*2+1]=e.b*i+e.d*h+e.ty}}addColors(t,e,s,i,h=0){const r=(e>>16)+(e&65280)+((e&255)<<16),a=x.utils.premultiplyTint(r,s);t.length=Math.max(t.length,h+i);for(let l=0;l<i;l++)t[h+l]=a}addTextureIds(t,e,s,i=0){t.length=Math.max(t.length,i+s);for(let h=0;h<s;h++)t[i+h]=e}addUvs(t,e,s,i,h,r=null){let a=0;const l=e.length,o=s.frame;for(;a<h;){let n=t[(i+a)*2],p=t[(i+a)*2+1];if(r){const d=r.a*n+r.c*p+r.tx;p=r.b*n+r.d*p+r.ty,n=d}a++,e.push(n/o.width,p/o.height)}const c=s.baseTexture;(o.width<c.width||o.height<c.height)&&this.adjustUvs(e,s,l,h)}adjustUvs(t,e,s,i){const h=e.baseTexture,r=1e-6,a=s+i*2,l=e.frame,o=l.width/h.width,c=l.height/h.height;let n=l.x/l.width,p=l.y/l.height,d=Math.floor(t[s]+r),b=Math.floor(t[s+1]+r);for(let u=s+2;u<a;u+=2)d=Math.min(d,Math.floor(t[u]+r)),b=Math.min(b,Math.floor(t[u+1]+r));n-=d,p-=b;for(let u=s;u<a;u+=2)t[u]=(t[u]+n)*o,t[u+1]=(t[u+1]+p)*c}};let ot=_t;ot.BATCHABLE_SIZE=100;class it extends W{constructor(){super(...arguments),this.width=0,this.alignment=.5,this.native=!1,this.cap=L.BUTT,this.join=I.MITER,this.miterLimit=10}clone(){const e=new it;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e.width=this.width,e.alignment=this.alignment,e.native=this.native,e.cap=this.cap,e.join=this.join,e.miterLimit=this.miterLimit,e}reset(){super.reset(),this.color=0,this.alignment=.5,this.width=0,this.native=!1}}const Et=new Float32Array(3),ct={},tt=class extends yt.Container{constructor(t=null){super(),this.shader=null,this.pluginName="batch",this.currentPath=null,this.batches=[],this.batchTint=-1,this.batchDirty=-1,this.vertexData=null,this._fillStyle=new W,this._lineStyle=new it,this._matrix=null,this._holeMode=!1,this.state=x.State.for2d(),this._geometry=t||new ot,this._geometry.refCount++,this._transformID=-1,this.tint=16777215,this.blendMode=x.BLEND_MODES.NORMAL}get geometry(){return this._geometry}clone(){return this.finishPoly(),new tt(this._geometry)}set blendMode(t){this.state.blendMode=t}get blendMode(){return this.state.blendMode}get tint(){return this._tint}set tint(t){this._tint=t}get fill(){return this._fillStyle}get line(){return this._lineStyle}lineStyle(t=null,e=0,s=1,i=.5,h=!1){return typeof t=="number"&&(t={width:t,color:e,alpha:s,alignment:i,native:h}),this.lineTextureStyle(t)}lineTextureStyle(t){t=Object.assign({width:0,texture:x.Texture.WHITE,color:t?.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:L.BUTT,join:I.MITER,miterLimit:10},t),this.currentPath&&this.startPoly();const e=t.width>0&&t.alpha>0;return e?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:e},t)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new x.Polygon,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new x.Polygon,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this}lineTo(t,e){this.currentPath||this.moveTo(0,0);const s=this.currentPath.points,i=s[s.length-2],h=s[s.length-1];return(i!==t||h!==e)&&s.push(t,e),this}_initCurve(t=0,e=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[t,e]):this.moveTo(t,e)}quadraticCurveTo(t,e,s,i){this._initCurve();const h=this.currentPath.points;return h.length===0&&this.moveTo(0,0),st.curveTo(t,e,s,i,h),this}bezierCurveTo(t,e,s,i,h,r){return this._initCurve(),et.curveTo(t,e,s,i,h,r,this.currentPath.points),this}arcTo(t,e,s,i,h){this._initCurve(t,e);const r=this.currentPath.points,a=lt.curveTo(t,e,s,i,h,r);if(a){const{cx:l,cy:o,radius:c,startAngle:n,endAngle:p,anticlockwise:d}=a;this.arc(l,o,c,n,p,d)}return this}arc(t,e,s,i,h,r=!1){if(i===h)return this;if(!r&&h<=i?h+=x.PI_2:r&&i<=h&&(i+=x.PI_2),h-i===0)return this;const a=t+Math.cos(i)*s,l=e+Math.sin(i)*s,o=this._geometry.closePointEps;let c=this.currentPath?this.currentPath.points:null;if(c){const n=Math.abs(c[c.length-2]-a),p=Math.abs(c[c.length-1]-l);n<o&&p<o||c.push(a,l)}else this.moveTo(a,l),c=this.currentPath.points;return lt.arc(a,l,t,e,s,i,h,r,c),this}beginFill(t=0,e=1){return this.beginTextureFill({texture:x.Texture.WHITE,color:t,alpha:e})}beginTextureFill(t){t=Object.assign({texture:x.Texture.WHITE,color:16777215,alpha:1,matrix:null},t),this.currentPath&&this.startPoly();const e=t.alpha>0;return e?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:e},t)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(t,e,s,i){return this.drawShape(new x.Rectangle(t,e,s,i))}drawRoundedRect(t,e,s,i,h){return this.drawShape(new x.RoundedRectangle(t,e,s,i,h))}drawCircle(t,e,s){return this.drawShape(new x.Circle(t,e,s))}drawEllipse(t,e,s,i){return this.drawShape(new x.Ellipse(t,e,s,i))}drawPolygon(...t){let e,s=!0;const i=t[0];i.points?(s=i.closeStroke,e=i.points):Array.isArray(t[0])?e=t[0]:e=t;const h=new x.Polygon(e);return h.closeStroke=s,this.drawShape(h),this}drawShape(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const t=this._geometry.graphicsData;return t.length===1&&t[0].shape.type===x.SHAPES.RECT&&!t[0].matrix&&!t[0].holes.length&&!(t[0].lineStyle.visible&&t[0].lineStyle.width)}_render(t){this.finishPoly();const e=this._geometry;e.updateBatches(),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))}_populateBatches(){const t=this._geometry,e=this.blendMode,s=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=s,this.vertexData=new Float32Array(t.points);for(let i=0;i<s;i++){const h=t.batches[i],r=h.style.color,a=new Float32Array(this.vertexData.buffer,h.attribStart*4*2,h.attribSize*2),l=new Float32Array(t.uvsFloat32.buffer,h.attribStart*4*2,h.attribSize*2),o=new Uint16Array(t.indicesUint16.buffer,h.start*2,h.size),c={vertexData:a,blendMode:e,indices:o,uvs:l,_batchRGB:x.utils.hex2rgb(r),_tintRGB:r,_texture:h.style.texture,alpha:h.style.alpha,worldAlpha:1};this.batches[i]=c}}_renderBatched(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(let e=0,s=this.batches.length;e<s;e++){const i=this.batches[e];i.worldAlpha=this.worldAlpha*i.alpha,t.plugins[this.pluginName].render(i)}}}_renderDirect(t){const e=this._resolveDirectShader(t),s=this._geometry,i=this.tint,h=this.worldAlpha,r=e.uniforms,a=s.drawCalls;r.translationMatrix=this.transform.worldTransform,r.tint[0]=(i>>16&255)/255*h,r.tint[1]=(i>>8&255)/255*h,r.tint[2]=(i&255)/255*h,r.tint[3]=h,t.shader.bind(e),t.geometry.bind(s,e),t.state.set(this.state);for(let l=0,o=a.length;l<o;l++)this._renderDrawCallDirect(t,s.drawCalls[l])}_renderDrawCallDirect(t,e){const{texArray:s,type:i,size:h,start:r}=e,a=s.count;for(let l=0;l<a;l++)t.texture.bind(s.elements[l],l);t.geometry.draw(i,h,r)}_resolveDirectShader(t){let e=this.shader;const s=this.pluginName;if(!e){if(!ct[s]){const{MAX_TEXTURES:i}=t.plugins[s],h=new Int32Array(i);for(let l=0;l<i;l++)h[l]=l;const r={tint:new Float32Array([1,1,1,1]),translationMatrix:new x.Matrix,default:x.UniformGroup.from({uSamplers:h},!0)},a=t.plugins[s]._shader.program;ct[s]=new x.Shader(a,r)}e=ct[s]}return e}_calculateBounds(){this.finishPoly();const t=this._geometry;if(!t.graphicsData.length)return;const{minX:e,minY:s,maxX:i,maxY:h}=t.bounds;this._bounds.addFrame(this.transform,e,s,i,h)}containsPoint(t){return this.worldTransform.applyInverse(t,tt._TEMP_POINT),this._geometry.containsPoint(tt._TEMP_POINT)}calculateTints(){if(this.batchTint!==this.tint){this.batchTint=this.tint;const t=x.utils.hex2rgb(this.tint,Et);for(let e=0;e<this.batches.length;e++){const s=this.batches[e],i=s._batchRGB,h=t[0]*i[0]*255,r=t[1]*i[1]*255,a=t[2]*i[2]*255,l=(h<<16)+(r<<8)+(a|0);s._tintRGB=(l>>16)+(l&65280)+((l&255)<<16)}}}calculateVertices(){const t=this.transform._worldID;if(this._transformID===t)return;this._transformID=t;const e=this.transform.worldTransform,s=e.a,i=e.b,h=e.c,r=e.d,a=e.tx,l=e.ty,o=this._geometry.points,c=this.vertexData;let n=0;for(let p=0;p<o.length;p+=2){const d=o[p],b=o[p+1];c[n++]=s*d+h*b+a,c[n++]=r*b+i*d+l}}closePath(){const t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this}setMatrix(t){return this._matrix=t,this}beginHole(){return this.finishPoly(),this._holeMode=!0,this}endHole(){return this.finishPoly(),this._holeMode=!1,this}destroy(t){this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,super.destroy(t)}};let wt=tt;wt._TEMP_POINT=new x.Point;const Ct={buildPoly:nt,buildCircle:j,buildRectangle:ft,buildRoundedRectangle:xt,buildLine:rt,ArcUtils:lt,BezierUtils:et,QuadraticUtils:st,BatchPart:St,FILL_COMMANDS:$,BATCH_POOL:at,DRAW_CALL_POOL:k};exports.FillStyle=W,exports.GRAPHICS_CURVES=F,exports.Graphics=wt,exports.GraphicsData=V,exports.GraphicsGeometry=ot,exports.LINE_CAP=L,exports.LINE_JOIN=I,exports.LineStyle=it,exports.graphicsUtils=Ct;
//# sourceMappingURL=graphics.min.js.map
{
"name": "@pixi/graphics",
"version": "7.0.0-beta.3",
"version": "7.0.0-beta.4",
"main": "dist/cjs/graphics.js",

@@ -43,3 +43,3 @@ "module": "dist/esm/graphics.mjs",

],
"gitHead": "8055ae1c16d4c0f8dabda86cafd8e68c356450e8"
"gitHead": "a4581e4a49d23afc98fcf726765c9d54e51c3c39"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc