Socket
Socket
Sign inDemoInstall

@pixi/math

Package Overview
Dependencies
Maintainers
2
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/math - npm Package Compare versions

Comparing version 6.2.2 to 6.3.0

6

dist/browser/math.min.js
/*!
* @pixi/math - v6.2.2
* Compiled Wed, 26 Jan 2022 16:23:27 UTC
* @pixi/math - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
*

@@ -8,3 +8,3 @@ * @pixi/math is licensed under the MIT License.

*/
this.PIXI=this.PIXI||{};var _pixi_math=function(t){"use strict";var i,h=2*Math.PI,s=180/Math.PI,o=Math.PI/180;(i=t.SHAPES||(t.SHAPES={}))[i.POLY=0]="POLY",i[i.RECT=1]="RECT",i[i.CIRC=2]="CIRC",i[i.ELIP=3]="ELIP",i[i.RREC=4]="RREC";var n=function(){function i(i,h,s,o){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),this.x=Number(i),this.y=Number(h),this.width=Number(s),this.height=Number(o),this.type=t.SHAPES.RECT}return Object.defineProperty(i.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(i,"EMPTY",{get:function(){return new i(0,0,0,0)},enumerable:!1,configurable:!0}),i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},i.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},i.prototype.contains=function(t,i){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&i>=this.y&&i<this.y+this.height)},i.prototype.pad=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x-=t,this.y-=i,this.width+=2*t,this.height+=2*i,this},i.prototype.fit=function(t){var i=Math.max(this.x,t.x),h=Math.min(this.x+this.width,t.x+t.width),s=Math.max(this.y,t.y),o=Math.min(this.y+this.height,t.y+t.height);return this.x=i,this.width=Math.max(h-i,0),this.y=s,this.height=Math.max(o-s,0),this},i.prototype.ceil=function(t,i){void 0===t&&(t=1),void 0===i&&(i=.001);var h=Math.ceil((this.x+this.width-i)*t)/t,s=Math.ceil((this.y+this.height-i)*t)/t;return this.x=Math.floor((this.x+i)*t)/t,this.y=Math.floor((this.y+i)*t)/t,this.width=h-this.x,this.height=s-this.y,this},i.prototype.enlarge=function(t){var i=Math.min(this.x,t.x),h=Math.max(this.x+this.width,t.x+t.width),s=Math.min(this.y,t.y),o=Math.max(this.y+this.height,t.y+t.height);return this.x=i,this.width=h-i,this.y=s,this.height=o-s,this},i}(),r=function(){function i(i,h,s){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),this.x=i,this.y=h,this.radius=s,this.type=t.SHAPES.CIRC}return i.prototype.clone=function(){return new i(this.x,this.y,this.radius)},i.prototype.contains=function(t,i){if(this.radius<=0)return!1;var h=this.radius*this.radius,s=this.x-t,o=this.y-i;return(s*=s)+(o*=o)<=h},i.prototype.getBounds=function(){return new n(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},i}(),e=function(){function i(i,h,s,o){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),this.x=i,this.y=h,this.width=s,this.height=o,this.type=t.SHAPES.ELIP}return i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;var h=(t-this.x)/this.width,s=(i-this.y)/this.height;return(h*=h)+(s*=s)<=1},i.prototype.getBounds=function(){return new n(this.x-this.width,this.y-this.height,this.width,this.height)},i}(),a=function(){function i(){for(var i=arguments,h=[],s=0;s<arguments.length;s++)h[s]=i[s];var o=Array.isArray(h[0])?h[0]:h;if("number"!=typeof o[0]){for(var n=[],r=0,e=o.length;r<e;r++)n.push(o[r].x,o[r].y);o=n}this.points=o,this.type=t.SHAPES.POLY,this.closeStroke=!0}return i.prototype.clone=function(){var t=new i(this.points.slice());return t.closeStroke=this.closeStroke,t},i.prototype.contains=function(t,i){for(var h=!1,s=this.points.length/2,o=0,n=s-1;o<s;n=o++){var r=this.points[2*o],e=this.points[2*o+1],a=this.points[2*n],c=this.points[2*n+1];e>i!=c>i&&t<(i-e)/(c-e)*(a-r)+r&&(h=!h)}return h},i}(),c=function(){function i(i,h,s,o,n){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===n&&(n=20),this.x=i,this.y=h,this.width=s,this.height=o,this.radius=n,this.type=t.SHAPES.RREC}return i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.radius)},i.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&i>=this.y&&i<=this.y+this.height){var h=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(i>=this.y+h&&i<=this.y+this.height-h||t>=this.x+h&&t<=this.x+this.width-h)return!0;var s=t-(this.x+h),o=i-(this.y+h),n=h*h;if(s*s+o*o<=n)return!0;if((s=t-(this.x+this.width-h))*s+o*o<=n)return!0;if(s*s+(o=i-(this.y+this.height-h))*o<=n)return!0;if((s=t-(this.x+h))*s+o*o<=n)return!0}return!1},i}(),u=function(){function t(t,i){void 0===t&&(t=0),void 0===i&&(i=0),this.x=0,this.y=0,this.x=t,this.y=i}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x=t,this.y=i,this},t}(),y=function(){function t(t,i,h,s){void 0===h&&(h=0),void 0===s&&(s=0),this._x=h,this._y=s,this.cb=t,this.scope=i}return t.prototype.clone=function(i,h){return void 0===i&&(i=this.cb),void 0===h&&(h=this.scope),new t(i,h,this._x,this._y)},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this._x===t&&this._y===i||(this._x=t,this._y=i,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),p=function(){function t(t,i,h,s,o,n){void 0===t&&(t=1),void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=1),void 0===o&&(o=0),void 0===n&&(n=0),this.array=null,this.a=t,this.b=i,this.c=h,this.d=s,this.tx=o,this.ty=n}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,i,h,s,o,n){return this.a=t,this.b=i,this.c=h,this.d=s,this.tx=o,this.ty=n,this},t.prototype.toArray=function(t,i){this.array||(this.array=new Float32Array(9));var h=i||this.array;return t?(h[0]=this.a,h[1]=this.b,h[2]=0,h[3]=this.c,h[4]=this.d,h[5]=0,h[6]=this.tx,h[7]=this.ty,h[8]=1):(h[0]=this.a,h[1]=this.c,h[2]=this.tx,h[3]=this.b,h[4]=this.d,h[5]=this.ty,h[6]=0,h[7]=0,h[8]=1),h},t.prototype.apply=function(t,i){i=i||new u;var h=t.x,s=t.y;return i.x=this.a*h+this.c*s+this.tx,i.y=this.b*h+this.d*s+this.ty,i},t.prototype.applyInverse=function(t,i){i=i||new u;var h=1/(this.a*this.d+this.c*-this.b),s=t.x,o=t.y;return i.x=this.d*h*s+-this.c*h*o+(this.ty*this.c-this.tx*this.d)*h,i.y=this.a*h*o+-this.b*h*s+(-this.ty*this.a+this.tx*this.b)*h,i},t.prototype.translate=function(t,i){return this.tx+=t,this.ty+=i,this},t.prototype.scale=function(t,i){return this.a*=t,this.d*=i,this.c*=t,this.b*=i,this.tx*=t,this.ty*=i,this},t.prototype.rotate=function(t){var i=Math.cos(t),h=Math.sin(t),s=this.a,o=this.c,n=this.tx;return this.a=s*i-this.b*h,this.b=s*h+this.b*i,this.c=o*i-this.d*h,this.d=o*h+this.d*i,this.tx=n*i-this.ty*h,this.ty=n*h+this.ty*i,this},t.prototype.append=function(t){var i=this.a,h=this.b,s=this.c,o=this.d;return this.a=t.a*i+t.b*s,this.b=t.a*h+t.b*o,this.c=t.c*i+t.d*s,this.d=t.c*h+t.d*o,this.tx=t.tx*i+t.ty*s+this.tx,this.ty=t.tx*h+t.ty*o+this.ty,this},t.prototype.setTransform=function(t,i,h,s,o,n,r,e,a){return this.a=Math.cos(r+a)*o,this.b=Math.sin(r+a)*o,this.c=-Math.sin(r-e)*n,this.d=Math.cos(r-e)*n,this.tx=t-(h*this.a+s*this.c),this.ty=i-(h*this.b+s*this.d),this},t.prototype.prepend=function(t){var i=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var h=this.a,s=this.c;this.a=h*t.a+this.b*t.c,this.b=h*t.b+this.b*t.d,this.c=s*t.a+this.d*t.c,this.d=s*t.b+this.d*t.d}return this.tx=i*t.a+this.ty*t.c+t.tx,this.ty=i*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var i=this.a,s=this.b,o=this.c,n=this.d,r=t.pivot,e=-Math.atan2(-o,n),a=Math.atan2(s,i),c=Math.abs(e+a);return c<1e-5||Math.abs(h-c)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=e,t.skew.y=a),t.scale.x=Math.sqrt(i*i+s*s),t.scale.y=Math.sqrt(o*o+n*n),t.position.x=this.tx+(r.x*i+r.y*o),t.position.y=this.ty+(r.x*s+r.y*n),t},t.prototype.invert=function(){var t=this.a,i=this.b,h=this.c,s=this.d,o=this.tx,n=t*s-i*h;return this.a=s/n,this.b=-i/n,this.c=-h/n,this.d=t/n,this.tx=(h*this.ty-s*o)/n,this.ty=-(t*this.ty-i*o)/n,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var i=new t;return i.a=this.a,i.b=this.b,i.c=this.c,i.d=this.d,i.tx=this.tx,i.ty=this.ty,i},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),d=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],f=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],x=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],l=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],b=[],v=[],_=Math.sign;!function(){for(var t=0;t<16;t++){var i=[];b.push(i);for(var h=0;h<16;h++)for(var s=_(d[t]*d[h]+x[t]*f[h]),o=_(f[t]*d[h]+l[t]*f[h]),n=_(d[t]*x[h]+x[t]*l[h]),r=_(f[t]*x[h]+l[t]*l[h]),e=0;e<16;e++)if(d[e]===s&&f[e]===o&&x[e]===n&&l[e]===r){i.push(e);break}}for(t=0;t<16;t++){var a=new p;a.set(d[t],f[t],x[t],l[t],0,0),v.push(a)}}();var w={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return d[t]},uY:function(t){return f[t]},vX:function(t){return x[t]},vY:function(t){return l[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,i){return b[t][i]},sub:function(t,i){return b[t][w.inv(i)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,i){return 2*Math.abs(t)<=Math.abs(i)?i>=0?w.S:w.N:2*Math.abs(i)<=Math.abs(t)?t>0?w.E:w.W:i>0?t>0?w.SE:w.SW:t>0?w.NE:w.NW},matrixAppendRotationInv:function(t,i,h,s){void 0===h&&(h=0),void 0===s&&(s=0);var o=v[w.inv(i)];o.tx=h,o.ty=s,t.append(o)}},g=function(){function t(){this.worldTransform=new p,this.localTransform=new p,this.position=new y(this.onChange,this,0,0),this.scale=new y(this.onChange,this,1,1),this.pivot=new y(this.onChange,this,0,0),this.skew=new y(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var i=this.localTransform;if(this._localID!==this._currentLocalID&&(i.a=this._cx*this.scale.x,i.b=this._sx*this.scale.x,i.c=this._cy*this.scale.y,i.d=this._sy*this.scale.y,i.tx=this.position.x-(this.pivot.x*i.a+this.pivot.y*i.c),i.ty=this.position.y-(this.pivot.x*i.b+this.pivot.y*i.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var h=t.worldTransform,s=this.worldTransform;s.a=i.a*h.a+i.b*h.c,s.b=i.a*h.b+i.b*h.d,s.c=i.c*h.a+i.d*h.c,s.d=i.c*h.b+i.d*h.d,s.tx=i.tx*h.a+i.ty*h.c+h.tx,s.ty=i.tx*h.b+i.ty*h.d+h.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}();return t.Circle=r,t.DEG_TO_RAD=o,t.Ellipse=e,t.Matrix=p,t.ObservablePoint=y,t.PI_2=h,t.Point=u,t.Polygon=a,t.RAD_TO_DEG=s,t.Rectangle=n,t.RoundedRectangle=c,t.Transform=g,t.groupD8=w,t}({});Object.assign(this.PIXI,_pixi_math);
this.PIXI=this.PIXI||{};var _pixi_math=function(t){"use strict";var i,h=2*Math.PI,s=180/Math.PI,o=Math.PI/180;(i=t.SHAPES||(t.SHAPES={}))[i.POLY=0]="POLY",i[i.RECT=1]="RECT",i[i.CIRC=2]="CIRC",i[i.ELIP=3]="ELIP",i[i.RREC=4]="RREC";var n=function(){function t(t,i){void 0===t&&(t=0),void 0===i&&(i=0),this.x=0,this.y=0,this.x=t,this.y=i}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x=t,this.y=i,this},t}(),r=[new n,new n,new n,new n],e=function(){function i(i,h,s,o){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),this.x=Number(i),this.y=Number(h),this.width=Number(s),this.height=Number(o),this.type=t.SHAPES.RECT}return Object.defineProperty(i.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(i,"EMPTY",{get:function(){return new i(0,0,0,0)},enumerable:!1,configurable:!0}),i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},i.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},i.prototype.contains=function(t,i){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&i>=this.y&&i<this.y+this.height)},i.prototype.intersects=function(t,i){if(!i){var h=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=h)return!1;var s=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>s}var o=this.left,n=this.right,e=this.top,a=this.bottom;if(n<=o||a<=e)return!1;var c=r[0].set(t.left,t.top),y=r[1].set(t.left,t.bottom),u=r[2].set(t.right,t.top),p=r[3].set(t.right,t.bottom);if(u.x<=c.x||y.y<=c.y)return!1;var x=Math.sign(i.a*i.d-i.b*i.c);if(0===x)return!1;if(i.apply(c,c),i.apply(y,y),i.apply(u,u),i.apply(p,p),Math.max(c.x,y.x,u.x,p.x)<=o||Math.min(c.x,y.x,u.x,p.x)>=n||Math.max(c.y,y.y,u.y,p.y)<=e||Math.min(c.y,y.y,u.y,p.y)>=a)return!1;var d=x*(y.y-c.y),f=x*(c.x-y.x),l=d*o+f*e,b=d*n+f*e,v=d*o+f*a,_=d*n+f*a;if(Math.max(l,b,v,_)<=d*c.x+f*c.y||Math.min(l,b,v,_)>=d*p.x+f*p.y)return!1;var w=x*(c.y-u.y),g=x*(u.x-c.x),m=w*o+g*e,M=w*n+g*e,I=w*o+g*a,P=w*n+g*a;return!(Math.max(m,M,I,P)<=w*c.x+g*c.y||Math.min(m,M,I,P)>=w*p.x+g*p.y)},i.prototype.pad=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x-=t,this.y-=i,this.width+=2*t,this.height+=2*i,this},i.prototype.fit=function(t){var i=Math.max(this.x,t.x),h=Math.min(this.x+this.width,t.x+t.width),s=Math.max(this.y,t.y),o=Math.min(this.y+this.height,t.y+t.height);return this.x=i,this.width=Math.max(h-i,0),this.y=s,this.height=Math.max(o-s,0),this},i.prototype.ceil=function(t,i){void 0===t&&(t=1),void 0===i&&(i=.001);var h=Math.ceil((this.x+this.width-i)*t)/t,s=Math.ceil((this.y+this.height-i)*t)/t;return this.x=Math.floor((this.x+i)*t)/t,this.y=Math.floor((this.y+i)*t)/t,this.width=h-this.x,this.height=s-this.y,this},i.prototype.enlarge=function(t){var i=Math.min(this.x,t.x),h=Math.max(this.x+this.width,t.x+t.width),s=Math.min(this.y,t.y),o=Math.max(this.y+this.height,t.y+t.height);return this.x=i,this.width=h-i,this.y=s,this.height=o-s,this},i}(),a=function(){function i(i,h,s){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),this.x=i,this.y=h,this.radius=s,this.type=t.SHAPES.CIRC}return i.prototype.clone=function(){return new i(this.x,this.y,this.radius)},i.prototype.contains=function(t,i){if(this.radius<=0)return!1;var h=this.radius*this.radius,s=this.x-t,o=this.y-i;return(s*=s)+(o*=o)<=h},i.prototype.getBounds=function(){return new e(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},i}(),c=function(){function i(i,h,s,o){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),this.x=i,this.y=h,this.width=s,this.height=o,this.type=t.SHAPES.ELIP}return i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;var h=(t-this.x)/this.width,s=(i-this.y)/this.height;return(h*=h)+(s*=s)<=1},i.prototype.getBounds=function(){return new e(this.x-this.width,this.y-this.height,this.width,this.height)},i}(),y=function(){function i(){for(var i=arguments,h=[],s=0;s<arguments.length;s++)h[s]=i[s];var o=Array.isArray(h[0])?h[0]:h;if("number"!=typeof o[0]){for(var n=[],r=0,e=o.length;r<e;r++)n.push(o[r].x,o[r].y);o=n}this.points=o,this.type=t.SHAPES.POLY,this.closeStroke=!0}return i.prototype.clone=function(){var t=new i(this.points.slice());return t.closeStroke=this.closeStroke,t},i.prototype.contains=function(t,i){for(var h=!1,s=this.points.length/2,o=0,n=s-1;o<s;n=o++){var r=this.points[2*o],e=this.points[2*o+1],a=this.points[2*n],c=this.points[2*n+1];e>i!=c>i&&t<(i-e)/(c-e)*(a-r)+r&&(h=!h)}return h},i}(),u=function(){function i(i,h,s,o,n){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===n&&(n=20),this.x=i,this.y=h,this.width=s,this.height=o,this.radius=n,this.type=t.SHAPES.RREC}return i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.radius)},i.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&i>=this.y&&i<=this.y+this.height){var h=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(i>=this.y+h&&i<=this.y+this.height-h||t>=this.x+h&&t<=this.x+this.width-h)return!0;var s=t-(this.x+h),o=i-(this.y+h),n=h*h;if(s*s+o*o<=n)return!0;if((s=t-(this.x+this.width-h))*s+o*o<=n)return!0;if(s*s+(o=i-(this.y+this.height-h))*o<=n)return!0;if((s=t-(this.x+h))*s+o*o<=n)return!0}return!1},i}(),p=function(){function t(t,i,h,s){void 0===h&&(h=0),void 0===s&&(s=0),this._x=h,this._y=s,this.cb=t,this.scope=i}return t.prototype.clone=function(i,h){return void 0===i&&(i=this.cb),void 0===h&&(h=this.scope),new t(i,h,this._x,this._y)},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this._x===t&&this._y===i||(this._x=t,this._y=i,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),x=function(){function t(t,i,h,s,o,n){void 0===t&&(t=1),void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=1),void 0===o&&(o=0),void 0===n&&(n=0),this.array=null,this.a=t,this.b=i,this.c=h,this.d=s,this.tx=o,this.ty=n}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,i,h,s,o,n){return this.a=t,this.b=i,this.c=h,this.d=s,this.tx=o,this.ty=n,this},t.prototype.toArray=function(t,i){this.array||(this.array=new Float32Array(9));var h=i||this.array;return t?(h[0]=this.a,h[1]=this.b,h[2]=0,h[3]=this.c,h[4]=this.d,h[5]=0,h[6]=this.tx,h[7]=this.ty,h[8]=1):(h[0]=this.a,h[1]=this.c,h[2]=this.tx,h[3]=this.b,h[4]=this.d,h[5]=this.ty,h[6]=0,h[7]=0,h[8]=1),h},t.prototype.apply=function(t,i){i=i||new n;var h=t.x,s=t.y;return i.x=this.a*h+this.c*s+this.tx,i.y=this.b*h+this.d*s+this.ty,i},t.prototype.applyInverse=function(t,i){i=i||new n;var h=1/(this.a*this.d+this.c*-this.b),s=t.x,o=t.y;return i.x=this.d*h*s+-this.c*h*o+(this.ty*this.c-this.tx*this.d)*h,i.y=this.a*h*o+-this.b*h*s+(-this.ty*this.a+this.tx*this.b)*h,i},t.prototype.translate=function(t,i){return this.tx+=t,this.ty+=i,this},t.prototype.scale=function(t,i){return this.a*=t,this.d*=i,this.c*=t,this.b*=i,this.tx*=t,this.ty*=i,this},t.prototype.rotate=function(t){var i=Math.cos(t),h=Math.sin(t),s=this.a,o=this.c,n=this.tx;return this.a=s*i-this.b*h,this.b=s*h+this.b*i,this.c=o*i-this.d*h,this.d=o*h+this.d*i,this.tx=n*i-this.ty*h,this.ty=n*h+this.ty*i,this},t.prototype.append=function(t){var i=this.a,h=this.b,s=this.c,o=this.d;return this.a=t.a*i+t.b*s,this.b=t.a*h+t.b*o,this.c=t.c*i+t.d*s,this.d=t.c*h+t.d*o,this.tx=t.tx*i+t.ty*s+this.tx,this.ty=t.tx*h+t.ty*o+this.ty,this},t.prototype.setTransform=function(t,i,h,s,o,n,r,e,a){return this.a=Math.cos(r+a)*o,this.b=Math.sin(r+a)*o,this.c=-Math.sin(r-e)*n,this.d=Math.cos(r-e)*n,this.tx=t-(h*this.a+s*this.c),this.ty=i-(h*this.b+s*this.d),this},t.prototype.prepend=function(t){var i=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var h=this.a,s=this.c;this.a=h*t.a+this.b*t.c,this.b=h*t.b+this.b*t.d,this.c=s*t.a+this.d*t.c,this.d=s*t.b+this.d*t.d}return this.tx=i*t.a+this.ty*t.c+t.tx,this.ty=i*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var i=this.a,s=this.b,o=this.c,n=this.d,r=t.pivot,e=-Math.atan2(-o,n),a=Math.atan2(s,i),c=Math.abs(e+a);return c<1e-5||Math.abs(h-c)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=e,t.skew.y=a),t.scale.x=Math.sqrt(i*i+s*s),t.scale.y=Math.sqrt(o*o+n*n),t.position.x=this.tx+(r.x*i+r.y*o),t.position.y=this.ty+(r.x*s+r.y*n),t},t.prototype.invert=function(){var t=this.a,i=this.b,h=this.c,s=this.d,o=this.tx,n=t*s-i*h;return this.a=s/n,this.b=-i/n,this.c=-h/n,this.d=t/n,this.tx=(h*this.ty-s*o)/n,this.ty=-(t*this.ty-i*o)/n,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var i=new t;return i.a=this.a,i.b=this.b,i.c=this.c,i.d=this.d,i.tx=this.tx,i.ty=this.ty,i},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),d=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],f=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],l=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],b=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],v=[],_=[],w=Math.sign;!function(){for(var t=0;t<16;t++){var i=[];v.push(i);for(var h=0;h<16;h++)for(var s=w(d[t]*d[h]+l[t]*f[h]),o=w(f[t]*d[h]+b[t]*f[h]),n=w(d[t]*l[h]+l[t]*b[h]),r=w(f[t]*l[h]+b[t]*b[h]),e=0;e<16;e++)if(d[e]===s&&f[e]===o&&l[e]===n&&b[e]===r){i.push(e);break}}for(t=0;t<16;t++){var a=new x;a.set(d[t],f[t],l[t],b[t],0,0),_.push(a)}}();var g={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return d[t]},uY:function(t){return f[t]},vX:function(t){return l[t]},vY:function(t){return b[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,i){return v[t][i]},sub:function(t,i){return v[t][g.inv(i)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,i){return 2*Math.abs(t)<=Math.abs(i)?i>=0?g.S:g.N:2*Math.abs(i)<=Math.abs(t)?t>0?g.E:g.W:i>0?t>0?g.SE:g.SW:t>0?g.NE:g.NW},matrixAppendRotationInv:function(t,i,h,s){void 0===h&&(h=0),void 0===s&&(s=0);var o=_[g.inv(i)];o.tx=h,o.ty=s,t.append(o)}},m=function(){function t(){this.worldTransform=new x,this.localTransform=new x,this.position=new p(this.onChange,this,0,0),this.scale=new p(this.onChange,this,1,1),this.pivot=new p(this.onChange,this,0,0),this.skew=new p(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var i=this.localTransform;if(this._localID!==this._currentLocalID&&(i.a=this._cx*this.scale.x,i.b=this._sx*this.scale.x,i.c=this._cy*this.scale.y,i.d=this._sy*this.scale.y,i.tx=this.position.x-(this.pivot.x*i.a+this.pivot.y*i.c),i.ty=this.position.y-(this.pivot.x*i.b+this.pivot.y*i.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var h=t.worldTransform,s=this.worldTransform;s.a=i.a*h.a+i.b*h.c,s.b=i.a*h.b+i.b*h.d,s.c=i.c*h.a+i.d*h.c,s.d=i.c*h.b+i.d*h.d,s.tx=i.tx*h.a+i.ty*h.c+h.tx,s.ty=i.tx*h.b+i.ty*h.d+h.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}();return t.Circle=a,t.DEG_TO_RAD=o,t.Ellipse=c,t.Matrix=x,t.ObservablePoint=p,t.PI_2=h,t.Point=n,t.Polygon=y,t.RAD_TO_DEG=s,t.Rectangle=e,t.RoundedRectangle=u,t.Transform=m,t.groupD8=g,t}({});Object.assign(this.PIXI,_pixi_math);
//# sourceMappingURL=math.min.js.map
/*!
* @pixi/math - v6.2.2
* Compiled Wed, 26 Jan 2022 16:23:27 UTC
* @pixi/math - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
*

@@ -45,2 +45,82 @@ * @pixi/math is licensed under the MIT License.

/**
* The Point object represents a location in a two-dimensional coordinate system, where `x` represents
* the position on the horizontal axis and `y` represents the position on the vertical axis
*
* @class
* @memberof PIXI
* @implements IPoint
*/
var Point = /** @class */ (function () {
/** Creates a new `Point`
* @param {number} [x=0] - position of the point on the x axis
* @param {number} [y=0] - position of the point on the y axis
*/
function Point(x, y) {
if (x === void 0) { x = 0; }
if (y === void 0) { y = 0; }
/** Position of the point on the x axis */
this.x = 0;
/** Position of the point on the y axis */
this.y = 0;
this.x = x;
this.y = y;
}
/** Creates a clone of this point
* @returns A clone of this point
*/
Point.prototype.clone = function () {
return new Point(this.x, this.y);
};
/**
* Copies `x` and `y` from the given point into this point
*
* @param p - The point to copy from
* @returns The point instance itself
*/
Point.prototype.copyFrom = function (p) {
this.set(p.x, p.y);
return this;
};
/**
* Copies this point's x and y into the given point (`p`).
*
* @param p - The point to copy to. Can be any of type that is or extends `IPointData`
* @returns The point (`p`) with values updated
*/
Point.prototype.copyTo = function (p) {
p.set(this.x, this.y);
return p;
};
/**
* Accepts another point (`p`) and returns `true` if the given point is equal to this point
*
* @param p - The point to check
* @returns Returns `true` if both `x` and `y` are equal
*/
Point.prototype.equals = function (p) {
return (p.x === this.x) && (p.y === this.y);
};
/**
* Sets the point to a new `x` and `y` position.
* If `y` is omitted, both `x` and `y` will be set to `x`.
*
* @param {number} [x=0] - position of the point on the `x` axis
* @param {number} [y=x] - position of the point on the `y` axis
* @returns The point instance itself
*/
Point.prototype.set = function (x, y) {
if (x === void 0) { x = 0; }
if (y === void 0) { y = x; }
this.x = x;
this.y = y;
return this;
};
Point.prototype.toString = function () {
return "[@pixi/math:Point x=" + this.x + " y=" + this.y + "]";
};
return Point;
}());
var tempPoints = [new Point(), new Point(), new Point(), new Point()];
/**
* Size object, contains width and height

@@ -168,2 +248,73 @@ *

/**
* Determines whether the `other` Rectangle transformed by `transform` intersects with `this` Rectangle object.
* Returns true only if the area of the intersection is >0, this means that Rectangles
* sharing a side are not overlapping. Another side effect is that an arealess rectangle
* (width or height equal to zero) can't intersect any other rectangle.
*
* @param {Rectangle} other - The Rectangle to intersect with `this`.
* @param {Matrix} transform - The transformation matrix of `other`.
* @returns {boolean} A value of `true` if the transformed `other` Rectangle intersects with `this`; otherwise `false`.
*/
Rectangle.prototype.intersects = function (other, transform) {
if (!transform) {
var x0_1 = this.x < other.x ? other.x : this.x;
var x1_1 = this.right > other.right ? other.right : this.right;
if (x1_1 <= x0_1) {
return false;
}
var y0_1 = this.y < other.y ? other.y : this.y;
var y1_1 = this.bottom > other.bottom ? other.bottom : this.bottom;
return y1_1 > y0_1;
}
var x0 = this.left;
var x1 = this.right;
var y0 = this.top;
var y1 = this.bottom;
if (x1 <= x0 || y1 <= y0) {
return false;
}
var lt = tempPoints[0].set(other.left, other.top);
var lb = tempPoints[1].set(other.left, other.bottom);
var rt = tempPoints[2].set(other.right, other.top);
var rb = tempPoints[3].set(other.right, other.bottom);
if (rt.x <= lt.x || lb.y <= lt.y) {
return false;
}
var s = Math.sign((transform.a * transform.d) - (transform.b * transform.c));
if (s === 0) {
return false;
}
transform.apply(lt, lt);
transform.apply(lb, lb);
transform.apply(rt, rt);
transform.apply(rb, rb);
if (Math.max(lt.x, lb.x, rt.x, rb.x) <= x0
|| Math.min(lt.x, lb.x, rt.x, rb.x) >= x1
|| Math.max(lt.y, lb.y, rt.y, rb.y) <= y0
|| Math.min(lt.y, lb.y, rt.y, rb.y) >= y1) {
return false;
}
var nx = s * (lb.y - lt.y);
var ny = s * (lt.x - lb.x);
var n00 = (nx * x0) + (ny * y0);
var n10 = (nx * x1) + (ny * y0);
var n01 = (nx * x0) + (ny * y1);
var n11 = (nx * x1) + (ny * y1);
if (Math.max(n00, n10, n01, n11) <= (nx * lt.x) + (ny * lt.y)
|| Math.min(n00, n10, n01, n11) >= (nx * rb.x) + (ny * rb.y)) {
return false;
}
var mx = s * (lt.y - rt.y);
var my = s * (rt.x - lt.x);
var m00 = (mx * x0) + (my * y0);
var m10 = (mx * x1) + (my * y0);
var m01 = (mx * x0) + (my * y1);
var m11 = (mx * x1) + (my * y1);
if (Math.max(m00, m10, m01, m11) <= (mx * lt.x) + (my * lt.y)
|| Math.min(m00, m10, m01, m11) >= (mx * rb.x) + (my * rb.y)) {
return false;
}
return true;
};
/**
* Pads the rectangle making it grow in all directions.

@@ -446,3 +597,2 @@ * If paddingY is omitted, both paddingX and paddingY will be set to paddingX.

*
* @class
* @memberof PIXI

@@ -452,7 +602,7 @@ */

/**
* @param {number} [x=0] - The X coordinate of the upper-left corner of the rounded rectangle
* @param {number} [y=0] - The Y coordinate of the upper-left corner of the rounded rectangle
* @param {number} [width=0] - The overall width of this rounded rectangle
* @param {number} [height=0] - The overall height of this rounded rectangle
* @param {number} [radius=20] - Controls the radius of the rounded corners
* @param x - The X coordinate of the upper-left corner of the rounded rectangle
* @param y - The Y coordinate of the upper-left corner of the rounded rectangle
* @param width - The overall width of this rounded rectangle
* @param height - The overall height of this rounded rectangle
* @param radius - Controls the radius of the rounded corners
*/

@@ -465,41 +615,13 @@ function RoundedRectangle(x, y, width, height, radius) {

if (radius === void 0) { radius = 20; }
/**
* @member {number}
* @default 0
*/
this.x = x;
/**
* @member {number}
* @default 0
*/
this.y = y;
/**
* @member {number}
* @default 0
*/
this.width = width;
/**
* @member {number}
* @default 0
*/
this.height = height;
/**
* @member {number}
* @default 20
*/
this.radius = radius;
/**
* The type of the object, mainly used to avoid `instanceof` checks
*
* @member {number}
* @readonly
* @default PIXI.SHAPES.RREC
* @see PIXI.SHAPES
*/
this.type = exports.SHAPES.RREC;
}
/**
* Creates a clone of this Rounded Rectangle
* Creates a clone of this Rounded Rectangle.
*
* @return {PIXI.RoundedRectangle} a copy of the rounded rectangle
* @return - A copy of the rounded rectangle.
*/

@@ -512,5 +634,5 @@ RoundedRectangle.prototype.clone = function () {

*
* @param {number} x - The X coordinate of the point to test
* @param {number} y - The Y coordinate of the point to test
* @return {boolean} Whether the x/y coordinates are within this Rounded Rectangle
* @param x - The X coordinate of the point to test.
* @param y - The Y coordinate of the point to test.
* @return - Whether the x/y coordinates are within this Rounded Rectangle.
*/

@@ -558,81 +680,2 @@ RoundedRectangle.prototype.contains = function (x, y) {

/**
* The Point object represents a location in a two-dimensional coordinate system, where `x` represents
* the position on the horizontal axis and `y` represents the position on the vertical axis
*
* @class
* @memberof PIXI
* @implements IPoint
*/
var Point = /** @class */ (function () {
/** Creates a new `Point`
* @param {number} [x=0] - position of the point on the x axis
* @param {number} [y=0] - position of the point on the y axis
*/
function Point(x, y) {
if (x === void 0) { x = 0; }
if (y === void 0) { y = 0; }
/** Position of the point on the x axis */
this.x = 0;
/** Position of the point on the y axis */
this.y = 0;
this.x = x;
this.y = y;
}
/** Creates a clone of this point
* @returns A clone of this point
*/
Point.prototype.clone = function () {
return new Point(this.x, this.y);
};
/**
* Copies `x` and `y` from the given point into this point
*
* @param p - The point to copy from
* @returns The point instance itself
*/
Point.prototype.copyFrom = function (p) {
this.set(p.x, p.y);
return this;
};
/**
* Copies this point's x and y into the given point (`p`).
*
* @param p - The point to copy to. Can be any of type that is or extends `IPointData`
* @returns The point (`p`) with values updated
*/
Point.prototype.copyTo = function (p) {
p.set(this.x, this.y);
return p;
};
/**
* Accepts another point (`p`) and returns `true` if the given point is equal to this point
*
* @param p - The point to check
* @returns Returns `true` if both `x` and `y` are equal
*/
Point.prototype.equals = function (p) {
return (p.x === this.x) && (p.y === this.y);
};
/**
* Sets the point to a new `x` and `y` position.
* If `y` is omitted, both `x` and `y` will be set to `x`.
*
* @param {number} [x=0] - position of the point on the `x` axis
* @param {number} [y=x] - position of the point on the `y` axis
* @returns The point instance itself
*/
Point.prototype.set = function (x, y) {
if (x === void 0) { x = 0; }
if (y === void 0) { y = x; }
this.x = x;
this.y = y;
return this;
};
Point.prototype.toString = function () {
return "[@pixi/math:Point x=" + this.x + " y=" + this.y + "]";
};
return Point;
}());
/**
* The ObservablePoint object represents a location in a two-dimensional coordinate system, where `x` represents

@@ -639,0 +682,0 @@ * the position on the horizontal axis and `y` represents the position on the vertical axis.

/*!
* @pixi/math - v6.2.2
* Compiled Wed, 26 Jan 2022 16:23:27 UTC
* @pixi/math - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
*

@@ -8,3 +8,3 @@ * @pixi/math is licensed under the MIT License.

*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var PI_2=2*Math.PI,RAD_TO_DEG=180/Math.PI,DEG_TO_RAD=Math.PI/180;!function(t){t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC"}(exports.SHAPES||(exports.SHAPES={}));var Rectangle=function(){function t(t,i,s,h){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===h&&(h=0),this.x=Number(t),this.y=Number(i),this.width=Number(s),this.height=Number(h),this.type=exports.SHAPES.RECT}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t,"EMPTY",{get:function(){return new t(0,0,0,0)},enumerable:!1,configurable:!0}),t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},t.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},t.prototype.contains=function(t,i){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&i>=this.y&&i<this.y+this.height)},t.prototype.pad=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x-=t,this.y-=i,this.width+=2*t,this.height+=2*i,this},t.prototype.fit=function(t){var i=Math.max(this.x,t.x),s=Math.min(this.x+this.width,t.x+t.width),h=Math.max(this.y,t.y),o=Math.min(this.y+this.height,t.y+t.height);return this.x=i,this.width=Math.max(s-i,0),this.y=h,this.height=Math.max(o-h,0),this},t.prototype.ceil=function(t,i){void 0===t&&(t=1),void 0===i&&(i=.001);var s=Math.ceil((this.x+this.width-i)*t)/t,h=Math.ceil((this.y+this.height-i)*t)/t;return this.x=Math.floor((this.x+i)*t)/t,this.y=Math.floor((this.y+i)*t)/t,this.width=s-this.x,this.height=h-this.y,this},t.prototype.enlarge=function(t){var i=Math.min(this.x,t.x),s=Math.max(this.x+this.width,t.x+t.width),h=Math.min(this.y,t.y),o=Math.max(this.y+this.height,t.y+t.height);return this.x=i,this.width=s-i,this.y=h,this.height=o-h,this},t}(),Circle=function(){function t(t,i,s){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=0),this.x=t,this.y=i,this.radius=s,this.type=exports.SHAPES.CIRC}return t.prototype.clone=function(){return new t(this.x,this.y,this.radius)},t.prototype.contains=function(t,i){if(this.radius<=0)return!1;var s=this.radius*this.radius,h=this.x-t,o=this.y-i;return(h*=h)+(o*=o)<=s},t.prototype.getBounds=function(){return new Rectangle(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},t}(),Ellipse=function(){function t(t,i,s,h){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===h&&(h=0),this.x=t,this.y=i,this.width=s,this.height=h,this.type=exports.SHAPES.ELIP}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;var s=(t-this.x)/this.width,h=(i-this.y)/this.height;return(s*=s)+(h*=h)<=1},t.prototype.getBounds=function(){return new Rectangle(this.x-this.width,this.y-this.height,this.width,this.height)},t}(),Polygon=function(){function t(){for(var t=arguments,i=[],s=0;s<arguments.length;s++)i[s]=t[s];var h=Array.isArray(i[0])?i[0]:i;if("number"!=typeof h[0]){for(var o=[],r=0,e=h.length;r<e;r++)o.push(h[r].x,h[r].y);h=o}this.points=h,this.type=exports.SHAPES.POLY,this.closeStroke=!0}return t.prototype.clone=function(){var i=new t(this.points.slice());return i.closeStroke=this.closeStroke,i},t.prototype.contains=function(t,i){for(var s=!1,h=this.points.length/2,o=0,r=h-1;o<h;r=o++){var e=this.points[2*o],n=this.points[2*o+1],a=this.points[2*r],u=this.points[2*r+1];n>i!=u>i&&t<(i-n)/(u-n)*(a-e)+e&&(s=!s)}return s},t}(),RoundedRectangle=function(){function t(t,i,s,h,o){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===h&&(h=0),void 0===o&&(o=20),this.x=t,this.y=i,this.width=s,this.height=h,this.radius=o,this.type=exports.SHAPES.RREC}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height,this.radius)},t.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&i>=this.y&&i<=this.y+this.height){var s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(i>=this.y+s&&i<=this.y+this.height-s||t>=this.x+s&&t<=this.x+this.width-s)return!0;var h=t-(this.x+s),o=i-(this.y+s),r=s*s;if(h*h+o*o<=r)return!0;if((h=t-(this.x+this.width-s))*h+o*o<=r)return!0;if(h*h+(o=i-(this.y+this.height-s))*o<=r)return!0;if((h=t-(this.x+s))*h+o*o<=r)return!0}return!1},t}(),Point=function(){function t(t,i){void 0===t&&(t=0),void 0===i&&(i=0),this.x=0,this.y=0,this.x=t,this.y=i}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x=t,this.y=i,this},t}(),ObservablePoint=function(){function t(t,i,s,h){void 0===s&&(s=0),void 0===h&&(h=0),this._x=s,this._y=h,this.cb=t,this.scope=i}return t.prototype.clone=function(i,s){return void 0===i&&(i=this.cb),void 0===s&&(s=this.scope),new t(i,s,this._x,this._y)},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this._x===t&&this._y===i||(this._x=t,this._y=i,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),Matrix=function(){function t(t,i,s,h,o,r){void 0===t&&(t=1),void 0===i&&(i=0),void 0===s&&(s=0),void 0===h&&(h=1),void 0===o&&(o=0),void 0===r&&(r=0),this.array=null,this.a=t,this.b=i,this.c=s,this.d=h,this.tx=o,this.ty=r}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,i,s,h,o,r){return this.a=t,this.b=i,this.c=s,this.d=h,this.tx=o,this.ty=r,this},t.prototype.toArray=function(t,i){this.array||(this.array=new Float32Array(9));var s=i||this.array;return t?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s},t.prototype.apply=function(t,i){i=i||new Point;var s=t.x,h=t.y;return i.x=this.a*s+this.c*h+this.tx,i.y=this.b*s+this.d*h+this.ty,i},t.prototype.applyInverse=function(t,i){i=i||new Point;var s=1/(this.a*this.d+this.c*-this.b),h=t.x,o=t.y;return i.x=this.d*s*h+-this.c*s*o+(this.ty*this.c-this.tx*this.d)*s,i.y=this.a*s*o+-this.b*s*h+(-this.ty*this.a+this.tx*this.b)*s,i},t.prototype.translate=function(t,i){return this.tx+=t,this.ty+=i,this},t.prototype.scale=function(t,i){return this.a*=t,this.d*=i,this.c*=t,this.b*=i,this.tx*=t,this.ty*=i,this},t.prototype.rotate=function(t){var i=Math.cos(t),s=Math.sin(t),h=this.a,o=this.c,r=this.tx;return this.a=h*i-this.b*s,this.b=h*s+this.b*i,this.c=o*i-this.d*s,this.d=o*s+this.d*i,this.tx=r*i-this.ty*s,this.ty=r*s+this.ty*i,this},t.prototype.append=function(t){var i=this.a,s=this.b,h=this.c,o=this.d;return this.a=t.a*i+t.b*h,this.b=t.a*s+t.b*o,this.c=t.c*i+t.d*h,this.d=t.c*s+t.d*o,this.tx=t.tx*i+t.ty*h+this.tx,this.ty=t.tx*s+t.ty*o+this.ty,this},t.prototype.setTransform=function(t,i,s,h,o,r,e,n,a){return this.a=Math.cos(e+a)*o,this.b=Math.sin(e+a)*o,this.c=-Math.sin(e-n)*r,this.d=Math.cos(e-n)*r,this.tx=t-(s*this.a+h*this.c),this.ty=i-(s*this.b+h*this.d),this},t.prototype.prepend=function(t){var i=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var s=this.a,h=this.c;this.a=s*t.a+this.b*t.c,this.b=s*t.b+this.b*t.d,this.c=h*t.a+this.d*t.c,this.d=h*t.b+this.d*t.d}return this.tx=i*t.a+this.ty*t.c+t.tx,this.ty=i*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var i=this.a,s=this.b,h=this.c,o=this.d,r=t.pivot,e=-Math.atan2(-h,o),n=Math.atan2(s,i),a=Math.abs(e+n);return a<1e-5||Math.abs(PI_2-a)<1e-5?(t.rotation=n,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=e,t.skew.y=n),t.scale.x=Math.sqrt(i*i+s*s),t.scale.y=Math.sqrt(h*h+o*o),t.position.x=this.tx+(r.x*i+r.y*h),t.position.y=this.ty+(r.x*s+r.y*o),t},t.prototype.invert=function(){var t=this.a,i=this.b,s=this.c,h=this.d,o=this.tx,r=t*h-i*s;return this.a=h/r,this.b=-i/r,this.c=-s/r,this.d=t/r,this.tx=(s*this.ty-h*o)/r,this.ty=-(t*this.ty-i*o)/r,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var i=new t;return i.a=this.a,i.b=this.b,i.c=this.c,i.d=this.d,i.tx=this.tx,i.ty=this.ty,i},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),ux=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],uy=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],vx=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],vy=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],rotationCayley=[],rotationMatrices=[],signum=Math.sign;function init(){for(var t=0;t<16;t++){var i=[];rotationCayley.push(i);for(var s=0;s<16;s++)for(var h=signum(ux[t]*ux[s]+vx[t]*uy[s]),o=signum(uy[t]*ux[s]+vy[t]*uy[s]),r=signum(ux[t]*vx[s]+vx[t]*vy[s]),e=signum(uy[t]*vx[s]+vy[t]*vy[s]),n=0;n<16;n++)if(ux[n]===h&&uy[n]===o&&vx[n]===r&&vy[n]===e){i.push(n);break}}for(t=0;t<16;t++){var a=new Matrix;a.set(ux[t],uy[t],vx[t],vy[t],0,0),rotationMatrices.push(a)}}init();var groupD8={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return ux[t]},uY:function(t){return uy[t]},vX:function(t){return vx[t]},vY:function(t){return vy[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,i){return rotationCayley[t][i]},sub:function(t,i){return rotationCayley[t][groupD8.inv(i)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,i){return 2*Math.abs(t)<=Math.abs(i)?i>=0?groupD8.S:groupD8.N:2*Math.abs(i)<=Math.abs(t)?t>0?groupD8.E:groupD8.W:i>0?t>0?groupD8.SE:groupD8.SW:t>0?groupD8.NE:groupD8.NW},matrixAppendRotationInv:function(t,i,s,h){void 0===s&&(s=0),void 0===h&&(h=0);var o=rotationMatrices[groupD8.inv(i)];o.tx=s,o.ty=h,t.append(o)}},Transform=function(){function t(){this.worldTransform=new Matrix,this.localTransform=new Matrix,this.position=new ObservablePoint(this.onChange,this,0,0),this.scale=new ObservablePoint(this.onChange,this,1,1),this.pivot=new ObservablePoint(this.onChange,this,0,0),this.skew=new ObservablePoint(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var i=this.localTransform;if(this._localID!==this._currentLocalID&&(i.a=this._cx*this.scale.x,i.b=this._sx*this.scale.x,i.c=this._cy*this.scale.y,i.d=this._sy*this.scale.y,i.tx=this.position.x-(this.pivot.x*i.a+this.pivot.y*i.c),i.ty=this.position.y-(this.pivot.x*i.b+this.pivot.y*i.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var s=t.worldTransform,h=this.worldTransform;h.a=i.a*s.a+i.b*s.c,h.b=i.a*s.b+i.b*s.d,h.c=i.c*s.a+i.d*s.c,h.d=i.c*s.b+i.d*s.d,h.tx=i.tx*s.a+i.ty*s.c+s.tx,h.ty=i.tx*s.b+i.ty*s.d+s.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}();exports.Circle=Circle,exports.DEG_TO_RAD=DEG_TO_RAD,exports.Ellipse=Ellipse,exports.Matrix=Matrix,exports.ObservablePoint=ObservablePoint,exports.PI_2=PI_2,exports.Point=Point,exports.Polygon=Polygon,exports.RAD_TO_DEG=RAD_TO_DEG,exports.Rectangle=Rectangle,exports.RoundedRectangle=RoundedRectangle,exports.Transform=Transform,exports.groupD8=groupD8;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var PI_2=2*Math.PI,RAD_TO_DEG=180/Math.PI,DEG_TO_RAD=Math.PI/180;!function(t){t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC"}(exports.SHAPES||(exports.SHAPES={}));var Point=function(){function t(t,i){void 0===t&&(t=0),void 0===i&&(i=0),this.x=0,this.y=0,this.x=t,this.y=i}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x=t,this.y=i,this},t}(),tempPoints=[new Point,new Point,new Point,new Point],Rectangle=function(){function t(t,i,s,h){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===h&&(h=0),this.x=Number(t),this.y=Number(i),this.width=Number(s),this.height=Number(h),this.type=exports.SHAPES.RECT}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t,"EMPTY",{get:function(){return new t(0,0,0,0)},enumerable:!1,configurable:!0}),t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},t.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},t.prototype.contains=function(t,i){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&i>=this.y&&i<this.y+this.height)},t.prototype.intersects=function(t,i){if(!i){var s=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=s)return!1;var h=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>h}var o=this.left,r=this.right,e=this.top,n=this.bottom;if(r<=o||n<=e)return!1;var a=tempPoints[0].set(t.left,t.top),y=tempPoints[1].set(t.left,t.bottom),u=tempPoints[2].set(t.right,t.top),c=tempPoints[3].set(t.right,t.bottom);if(u.x<=a.x||y.y<=a.y)return!1;var p=Math.sign(i.a*i.d-i.b*i.c);if(0===p)return!1;if(i.apply(a,a),i.apply(y,y),i.apply(u,u),i.apply(c,c),Math.max(a.x,y.x,u.x,c.x)<=o||Math.min(a.x,y.x,u.x,c.x)>=r||Math.max(a.y,y.y,u.y,c.y)<=e||Math.min(a.y,y.y,u.y,c.y)>=n)return!1;var x=p*(y.y-a.y),d=p*(a.x-y.x),f=x*o+d*e,l=x*r+d*e,v=x*o+d*n,b=x*r+d*n;if(Math.max(f,l,v,b)<=x*a.x+d*a.y||Math.min(f,l,v,b)>=x*c.x+d*c.y)return!1;var g=p*(a.y-u.y),_=p*(u.x-a.x),w=g*o+_*e,m=g*r+_*e,M=g*o+_*n,P=g*r+_*n;return!(Math.max(w,m,M,P)<=g*a.x+_*a.y||Math.min(w,m,M,P)>=g*c.x+_*c.y)},t.prototype.pad=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x-=t,this.y-=i,this.width+=2*t,this.height+=2*i,this},t.prototype.fit=function(t){var i=Math.max(this.x,t.x),s=Math.min(this.x+this.width,t.x+t.width),h=Math.max(this.y,t.y),o=Math.min(this.y+this.height,t.y+t.height);return this.x=i,this.width=Math.max(s-i,0),this.y=h,this.height=Math.max(o-h,0),this},t.prototype.ceil=function(t,i){void 0===t&&(t=1),void 0===i&&(i=.001);var s=Math.ceil((this.x+this.width-i)*t)/t,h=Math.ceil((this.y+this.height-i)*t)/t;return this.x=Math.floor((this.x+i)*t)/t,this.y=Math.floor((this.y+i)*t)/t,this.width=s-this.x,this.height=h-this.y,this},t.prototype.enlarge=function(t){var i=Math.min(this.x,t.x),s=Math.max(this.x+this.width,t.x+t.width),h=Math.min(this.y,t.y),o=Math.max(this.y+this.height,t.y+t.height);return this.x=i,this.width=s-i,this.y=h,this.height=o-h,this},t}(),Circle=function(){function t(t,i,s){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=0),this.x=t,this.y=i,this.radius=s,this.type=exports.SHAPES.CIRC}return t.prototype.clone=function(){return new t(this.x,this.y,this.radius)},t.prototype.contains=function(t,i){if(this.radius<=0)return!1;var s=this.radius*this.radius,h=this.x-t,o=this.y-i;return(h*=h)+(o*=o)<=s},t.prototype.getBounds=function(){return new Rectangle(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},t}(),Ellipse=function(){function t(t,i,s,h){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===h&&(h=0),this.x=t,this.y=i,this.width=s,this.height=h,this.type=exports.SHAPES.ELIP}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;var s=(t-this.x)/this.width,h=(i-this.y)/this.height;return(s*=s)+(h*=h)<=1},t.prototype.getBounds=function(){return new Rectangle(this.x-this.width,this.y-this.height,this.width,this.height)},t}(),Polygon=function(){function t(){for(var t=arguments,i=[],s=0;s<arguments.length;s++)i[s]=t[s];var h=Array.isArray(i[0])?i[0]:i;if("number"!=typeof h[0]){for(var o=[],r=0,e=h.length;r<e;r++)o.push(h[r].x,h[r].y);h=o}this.points=h,this.type=exports.SHAPES.POLY,this.closeStroke=!0}return t.prototype.clone=function(){var i=new t(this.points.slice());return i.closeStroke=this.closeStroke,i},t.prototype.contains=function(t,i){for(var s=!1,h=this.points.length/2,o=0,r=h-1;o<h;r=o++){var e=this.points[2*o],n=this.points[2*o+1],a=this.points[2*r],y=this.points[2*r+1];n>i!=y>i&&t<(i-n)/(y-n)*(a-e)+e&&(s=!s)}return s},t}(),RoundedRectangle=function(){function t(t,i,s,h,o){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===h&&(h=0),void 0===o&&(o=20),this.x=t,this.y=i,this.width=s,this.height=h,this.radius=o,this.type=exports.SHAPES.RREC}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height,this.radius)},t.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&i>=this.y&&i<=this.y+this.height){var s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(i>=this.y+s&&i<=this.y+this.height-s||t>=this.x+s&&t<=this.x+this.width-s)return!0;var h=t-(this.x+s),o=i-(this.y+s),r=s*s;if(h*h+o*o<=r)return!0;if((h=t-(this.x+this.width-s))*h+o*o<=r)return!0;if(h*h+(o=i-(this.y+this.height-s))*o<=r)return!0;if((h=t-(this.x+s))*h+o*o<=r)return!0}return!1},t}(),ObservablePoint=function(){function t(t,i,s,h){void 0===s&&(s=0),void 0===h&&(h=0),this._x=s,this._y=h,this.cb=t,this.scope=i}return t.prototype.clone=function(i,s){return void 0===i&&(i=this.cb),void 0===s&&(s=this.scope),new t(i,s,this._x,this._y)},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this._x===t&&this._y===i||(this._x=t,this._y=i,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),Matrix=function(){function t(t,i,s,h,o,r){void 0===t&&(t=1),void 0===i&&(i=0),void 0===s&&(s=0),void 0===h&&(h=1),void 0===o&&(o=0),void 0===r&&(r=0),this.array=null,this.a=t,this.b=i,this.c=s,this.d=h,this.tx=o,this.ty=r}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,i,s,h,o,r){return this.a=t,this.b=i,this.c=s,this.d=h,this.tx=o,this.ty=r,this},t.prototype.toArray=function(t,i){this.array||(this.array=new Float32Array(9));var s=i||this.array;return t?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s},t.prototype.apply=function(t,i){i=i||new Point;var s=t.x,h=t.y;return i.x=this.a*s+this.c*h+this.tx,i.y=this.b*s+this.d*h+this.ty,i},t.prototype.applyInverse=function(t,i){i=i||new Point;var s=1/(this.a*this.d+this.c*-this.b),h=t.x,o=t.y;return i.x=this.d*s*h+-this.c*s*o+(this.ty*this.c-this.tx*this.d)*s,i.y=this.a*s*o+-this.b*s*h+(-this.ty*this.a+this.tx*this.b)*s,i},t.prototype.translate=function(t,i){return this.tx+=t,this.ty+=i,this},t.prototype.scale=function(t,i){return this.a*=t,this.d*=i,this.c*=t,this.b*=i,this.tx*=t,this.ty*=i,this},t.prototype.rotate=function(t){var i=Math.cos(t),s=Math.sin(t),h=this.a,o=this.c,r=this.tx;return this.a=h*i-this.b*s,this.b=h*s+this.b*i,this.c=o*i-this.d*s,this.d=o*s+this.d*i,this.tx=r*i-this.ty*s,this.ty=r*s+this.ty*i,this},t.prototype.append=function(t){var i=this.a,s=this.b,h=this.c,o=this.d;return this.a=t.a*i+t.b*h,this.b=t.a*s+t.b*o,this.c=t.c*i+t.d*h,this.d=t.c*s+t.d*o,this.tx=t.tx*i+t.ty*h+this.tx,this.ty=t.tx*s+t.ty*o+this.ty,this},t.prototype.setTransform=function(t,i,s,h,o,r,e,n,a){return this.a=Math.cos(e+a)*o,this.b=Math.sin(e+a)*o,this.c=-Math.sin(e-n)*r,this.d=Math.cos(e-n)*r,this.tx=t-(s*this.a+h*this.c),this.ty=i-(s*this.b+h*this.d),this},t.prototype.prepend=function(t){var i=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var s=this.a,h=this.c;this.a=s*t.a+this.b*t.c,this.b=s*t.b+this.b*t.d,this.c=h*t.a+this.d*t.c,this.d=h*t.b+this.d*t.d}return this.tx=i*t.a+this.ty*t.c+t.tx,this.ty=i*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var i=this.a,s=this.b,h=this.c,o=this.d,r=t.pivot,e=-Math.atan2(-h,o),n=Math.atan2(s,i),a=Math.abs(e+n);return a<1e-5||Math.abs(PI_2-a)<1e-5?(t.rotation=n,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=e,t.skew.y=n),t.scale.x=Math.sqrt(i*i+s*s),t.scale.y=Math.sqrt(h*h+o*o),t.position.x=this.tx+(r.x*i+r.y*h),t.position.y=this.ty+(r.x*s+r.y*o),t},t.prototype.invert=function(){var t=this.a,i=this.b,s=this.c,h=this.d,o=this.tx,r=t*h-i*s;return this.a=h/r,this.b=-i/r,this.c=-s/r,this.d=t/r,this.tx=(s*this.ty-h*o)/r,this.ty=-(t*this.ty-i*o)/r,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var i=new t;return i.a=this.a,i.b=this.b,i.c=this.c,i.d=this.d,i.tx=this.tx,i.ty=this.ty,i},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),ux=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],uy=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],vx=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],vy=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],rotationCayley=[],rotationMatrices=[],signum=Math.sign;function init(){for(var t=0;t<16;t++){var i=[];rotationCayley.push(i);for(var s=0;s<16;s++)for(var h=signum(ux[t]*ux[s]+vx[t]*uy[s]),o=signum(uy[t]*ux[s]+vy[t]*uy[s]),r=signum(ux[t]*vx[s]+vx[t]*vy[s]),e=signum(uy[t]*vx[s]+vy[t]*vy[s]),n=0;n<16;n++)if(ux[n]===h&&uy[n]===o&&vx[n]===r&&vy[n]===e){i.push(n);break}}for(t=0;t<16;t++){var a=new Matrix;a.set(ux[t],uy[t],vx[t],vy[t],0,0),rotationMatrices.push(a)}}init();var groupD8={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return ux[t]},uY:function(t){return uy[t]},vX:function(t){return vx[t]},vY:function(t){return vy[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,i){return rotationCayley[t][i]},sub:function(t,i){return rotationCayley[t][groupD8.inv(i)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,i){return 2*Math.abs(t)<=Math.abs(i)?i>=0?groupD8.S:groupD8.N:2*Math.abs(i)<=Math.abs(t)?t>0?groupD8.E:groupD8.W:i>0?t>0?groupD8.SE:groupD8.SW:t>0?groupD8.NE:groupD8.NW},matrixAppendRotationInv:function(t,i,s,h){void 0===s&&(s=0),void 0===h&&(h=0);var o=rotationMatrices[groupD8.inv(i)];o.tx=s,o.ty=h,t.append(o)}},Transform=function(){function t(){this.worldTransform=new Matrix,this.localTransform=new Matrix,this.position=new ObservablePoint(this.onChange,this,0,0),this.scale=new ObservablePoint(this.onChange,this,1,1),this.pivot=new ObservablePoint(this.onChange,this,0,0),this.skew=new ObservablePoint(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var i=this.localTransform;if(this._localID!==this._currentLocalID&&(i.a=this._cx*this.scale.x,i.b=this._sx*this.scale.x,i.c=this._cy*this.scale.y,i.d=this._sy*this.scale.y,i.tx=this.position.x-(this.pivot.x*i.a+this.pivot.y*i.c),i.ty=this.position.y-(this.pivot.x*i.b+this.pivot.y*i.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var s=t.worldTransform,h=this.worldTransform;h.a=i.a*s.a+i.b*s.c,h.b=i.a*s.b+i.b*s.d,h.c=i.c*s.a+i.d*s.c,h.d=i.c*s.b+i.d*s.d,h.tx=i.tx*s.a+i.ty*s.c+s.tx,h.ty=i.tx*s.b+i.ty*s.d+s.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}();exports.Circle=Circle,exports.DEG_TO_RAD=DEG_TO_RAD,exports.Ellipse=Ellipse,exports.Matrix=Matrix,exports.ObservablePoint=ObservablePoint,exports.PI_2=PI_2,exports.Point=Point,exports.Polygon=Polygon,exports.RAD_TO_DEG=RAD_TO_DEG,exports.Rectangle=Rectangle,exports.RoundedRectangle=RoundedRectangle,exports.Transform=Transform,exports.groupD8=groupD8;
//# sourceMappingURL=math.min.js.map
/*!
* @pixi/math - v6.2.2
* Compiled Wed, 26 Jan 2022 16:23:27 UTC
* @pixi/math - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
*

@@ -54,2 +54,82 @@ * @pixi/math is licensed under the MIT License.

/**
* The Point object represents a location in a two-dimensional coordinate system, where `x` represents
* the position on the horizontal axis and `y` represents the position on the vertical axis
*
* @class
* @memberof PIXI
* @implements IPoint
*/
var Point = /** @class */ (function () {
/** Creates a new `Point`
* @param {number} [x=0] - position of the point on the x axis
* @param {number} [y=0] - position of the point on the y axis
*/
function Point(x, y) {
if (x === void 0) { x = 0; }
if (y === void 0) { y = 0; }
/** Position of the point on the x axis */
this.x = 0;
/** Position of the point on the y axis */
this.y = 0;
this.x = x;
this.y = y;
}
/** Creates a clone of this point
* @returns A clone of this point
*/
Point.prototype.clone = function () {
return new Point(this.x, this.y);
};
/**
* Copies `x` and `y` from the given point into this point
*
* @param p - The point to copy from
* @returns The point instance itself
*/
Point.prototype.copyFrom = function (p) {
this.set(p.x, p.y);
return this;
};
/**
* Copies this point's x and y into the given point (`p`).
*
* @param p - The point to copy to. Can be any of type that is or extends `IPointData`
* @returns The point (`p`) with values updated
*/
Point.prototype.copyTo = function (p) {
p.set(this.x, this.y);
return p;
};
/**
* Accepts another point (`p`) and returns `true` if the given point is equal to this point
*
* @param p - The point to check
* @returns Returns `true` if both `x` and `y` are equal
*/
Point.prototype.equals = function (p) {
return (p.x === this.x) && (p.y === this.y);
};
/**
* Sets the point to a new `x` and `y` position.
* If `y` is omitted, both `x` and `y` will be set to `x`.
*
* @param {number} [x=0] - position of the point on the `x` axis
* @param {number} [y=x] - position of the point on the `y` axis
* @returns The point instance itself
*/
Point.prototype.set = function (x, y) {
if (x === void 0) { x = 0; }
if (y === void 0) { y = x; }
this.x = x;
this.y = y;
return this;
};
Point.prototype.toString = function () {
return "[@pixi/math:Point x=" + this.x + " y=" + this.y + "]";
};
return Point;
}());
var tempPoints = [new Point(), new Point(), new Point(), new Point()];
/**
* Size object, contains width and height

@@ -177,2 +257,73 @@ *

/**
* Determines whether the `other` Rectangle transformed by `transform` intersects with `this` Rectangle object.
* Returns true only if the area of the intersection is >0, this means that Rectangles
* sharing a side are not overlapping. Another side effect is that an arealess rectangle
* (width or height equal to zero) can't intersect any other rectangle.
*
* @param {Rectangle} other - The Rectangle to intersect with `this`.
* @param {Matrix} transform - The transformation matrix of `other`.
* @returns {boolean} A value of `true` if the transformed `other` Rectangle intersects with `this`; otherwise `false`.
*/
Rectangle.prototype.intersects = function (other, transform) {
if (!transform) {
var x0_1 = this.x < other.x ? other.x : this.x;
var x1_1 = this.right > other.right ? other.right : this.right;
if (x1_1 <= x0_1) {
return false;
}
var y0_1 = this.y < other.y ? other.y : this.y;
var y1_1 = this.bottom > other.bottom ? other.bottom : this.bottom;
return y1_1 > y0_1;
}
var x0 = this.left;
var x1 = this.right;
var y0 = this.top;
var y1 = this.bottom;
if (x1 <= x0 || y1 <= y0) {
return false;
}
var lt = tempPoints[0].set(other.left, other.top);
var lb = tempPoints[1].set(other.left, other.bottom);
var rt = tempPoints[2].set(other.right, other.top);
var rb = tempPoints[3].set(other.right, other.bottom);
if (rt.x <= lt.x || lb.y <= lt.y) {
return false;
}
var s = Math.sign((transform.a * transform.d) - (transform.b * transform.c));
if (s === 0) {
return false;
}
transform.apply(lt, lt);
transform.apply(lb, lb);
transform.apply(rt, rt);
transform.apply(rb, rb);
if (Math.max(lt.x, lb.x, rt.x, rb.x) <= x0
|| Math.min(lt.x, lb.x, rt.x, rb.x) >= x1
|| Math.max(lt.y, lb.y, rt.y, rb.y) <= y0
|| Math.min(lt.y, lb.y, rt.y, rb.y) >= y1) {
return false;
}
var nx = s * (lb.y - lt.y);
var ny = s * (lt.x - lb.x);
var n00 = (nx * x0) + (ny * y0);
var n10 = (nx * x1) + (ny * y0);
var n01 = (nx * x0) + (ny * y1);
var n11 = (nx * x1) + (ny * y1);
if (Math.max(n00, n10, n01, n11) <= (nx * lt.x) + (ny * lt.y)
|| Math.min(n00, n10, n01, n11) >= (nx * rb.x) + (ny * rb.y)) {
return false;
}
var mx = s * (lt.y - rt.y);
var my = s * (rt.x - lt.x);
var m00 = (mx * x0) + (my * y0);
var m10 = (mx * x1) + (my * y0);
var m01 = (mx * x0) + (my * y1);
var m11 = (mx * x1) + (my * y1);
if (Math.max(m00, m10, m01, m11) <= (mx * lt.x) + (my * lt.y)
|| Math.min(m00, m10, m01, m11) >= (mx * rb.x) + (my * rb.y)) {
return false;
}
return true;
};
/**
* Pads the rectangle making it grow in all directions.

@@ -455,3 +606,2 @@ * If paddingY is omitted, both paddingX and paddingY will be set to paddingX.

*
* @class
* @memberof PIXI

@@ -461,7 +611,7 @@ */

/**
* @param {number} [x=0] - The X coordinate of the upper-left corner of the rounded rectangle
* @param {number} [y=0] - The Y coordinate of the upper-left corner of the rounded rectangle
* @param {number} [width=0] - The overall width of this rounded rectangle
* @param {number} [height=0] - The overall height of this rounded rectangle
* @param {number} [radius=20] - Controls the radius of the rounded corners
* @param x - The X coordinate of the upper-left corner of the rounded rectangle
* @param y - The Y coordinate of the upper-left corner of the rounded rectangle
* @param width - The overall width of this rounded rectangle
* @param height - The overall height of this rounded rectangle
* @param radius - Controls the radius of the rounded corners
*/

@@ -474,41 +624,13 @@ function RoundedRectangle(x, y, width, height, radius) {

if (radius === void 0) { radius = 20; }
/**
* @member {number}
* @default 0
*/
this.x = x;
/**
* @member {number}
* @default 0
*/
this.y = y;
/**
* @member {number}
* @default 0
*/
this.width = width;
/**
* @member {number}
* @default 0
*/
this.height = height;
/**
* @member {number}
* @default 20
*/
this.radius = radius;
/**
* The type of the object, mainly used to avoid `instanceof` checks
*
* @member {number}
* @readonly
* @default PIXI.SHAPES.RREC
* @see PIXI.SHAPES
*/
this.type = SHAPES.RREC;
}
/**
* Creates a clone of this Rounded Rectangle
* Creates a clone of this Rounded Rectangle.
*
* @return {PIXI.RoundedRectangle} a copy of the rounded rectangle
* @return - A copy of the rounded rectangle.
*/

@@ -521,5 +643,5 @@ RoundedRectangle.prototype.clone = function () {

*
* @param {number} x - The X coordinate of the point to test
* @param {number} y - The Y coordinate of the point to test
* @return {boolean} Whether the x/y coordinates are within this Rounded Rectangle
* @param x - The X coordinate of the point to test.
* @param y - The Y coordinate of the point to test.
* @return - Whether the x/y coordinates are within this Rounded Rectangle.
*/

@@ -567,81 +689,2 @@ RoundedRectangle.prototype.contains = function (x, y) {

/**
* The Point object represents a location in a two-dimensional coordinate system, where `x` represents
* the position on the horizontal axis and `y` represents the position on the vertical axis
*
* @class
* @memberof PIXI
* @implements IPoint
*/
var Point = /** @class */ (function () {
/** Creates a new `Point`
* @param {number} [x=0] - position of the point on the x axis
* @param {number} [y=0] - position of the point on the y axis
*/
function Point(x, y) {
if (x === void 0) { x = 0; }
if (y === void 0) { y = 0; }
/** Position of the point on the x axis */
this.x = 0;
/** Position of the point on the y axis */
this.y = 0;
this.x = x;
this.y = y;
}
/** Creates a clone of this point
* @returns A clone of this point
*/
Point.prototype.clone = function () {
return new Point(this.x, this.y);
};
/**
* Copies `x` and `y` from the given point into this point
*
* @param p - The point to copy from
* @returns The point instance itself
*/
Point.prototype.copyFrom = function (p) {
this.set(p.x, p.y);
return this;
};
/**
* Copies this point's x and y into the given point (`p`).
*
* @param p - The point to copy to. Can be any of type that is or extends `IPointData`
* @returns The point (`p`) with values updated
*/
Point.prototype.copyTo = function (p) {
p.set(this.x, this.y);
return p;
};
/**
* Accepts another point (`p`) and returns `true` if the given point is equal to this point
*
* @param p - The point to check
* @returns Returns `true` if both `x` and `y` are equal
*/
Point.prototype.equals = function (p) {
return (p.x === this.x) && (p.y === this.y);
};
/**
* Sets the point to a new `x` and `y` position.
* If `y` is omitted, both `x` and `y` will be set to `x`.
*
* @param {number} [x=0] - position of the point on the `x` axis
* @param {number} [y=x] - position of the point on the `y` axis
* @returns The point instance itself
*/
Point.prototype.set = function (x, y) {
if (x === void 0) { x = 0; }
if (y === void 0) { y = x; }
this.x = x;
this.y = y;
return this;
};
Point.prototype.toString = function () {
return "[@pixi/math:Point x=" + this.x + " y=" + this.y + "]";
};
return Point;
}());
/**
* The ObservablePoint object represents a location in a two-dimensional coordinate system, where `x` represents

@@ -648,0 +691,0 @@ * the position on the horizontal axis and `y` represents the position on the vertical axis.

/*!
* @pixi/math - v6.2.2
* Compiled Wed, 26 Jan 2022 16:23:27 UTC
* @pixi/math - v6.3.0
* Compiled Wed, 23 Mar 2022 18:58:56 UTC
*

@@ -8,3 +8,3 @@ * @pixi/math is licensed under the MIT License.

*/
var t,i=2*Math.PI,h=180/Math.PI,s=Math.PI/180;!function(t){t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC"}(t||(t={}));var o=function(){function i(i,h,s,o){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),this.x=Number(i),this.y=Number(h),this.width=Number(s),this.height=Number(o),this.type=t.RECT}return Object.defineProperty(i.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(i,"EMPTY",{get:function(){return new i(0,0,0,0)},enumerable:!1,configurable:!0}),i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},i.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},i.prototype.contains=function(t,i){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&i>=this.y&&i<this.y+this.height)},i.prototype.pad=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x-=t,this.y-=i,this.width+=2*t,this.height+=2*i,this},i.prototype.fit=function(t){var i=Math.max(this.x,t.x),h=Math.min(this.x+this.width,t.x+t.width),s=Math.max(this.y,t.y),o=Math.min(this.y+this.height,t.y+t.height);return this.x=i,this.width=Math.max(h-i,0),this.y=s,this.height=Math.max(o-s,0),this},i.prototype.ceil=function(t,i){void 0===t&&(t=1),void 0===i&&(i=.001);var h=Math.ceil((this.x+this.width-i)*t)/t,s=Math.ceil((this.y+this.height-i)*t)/t;return this.x=Math.floor((this.x+i)*t)/t,this.y=Math.floor((this.y+i)*t)/t,this.width=h-this.x,this.height=s-this.y,this},i.prototype.enlarge=function(t){var i=Math.min(this.x,t.x),h=Math.max(this.x+this.width,t.x+t.width),s=Math.min(this.y,t.y),o=Math.max(this.y+this.height,t.y+t.height);return this.x=i,this.width=h-i,this.y=s,this.height=o-s,this},i}(),n=function(){function i(i,h,s){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),this.x=i,this.y=h,this.radius=s,this.type=t.CIRC}return i.prototype.clone=function(){return new i(this.x,this.y,this.radius)},i.prototype.contains=function(t,i){if(this.radius<=0)return!1;var h=this.radius*this.radius,s=this.x-t,o=this.y-i;return(s*=s)+(o*=o)<=h},i.prototype.getBounds=function(){return new o(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},i}(),r=function(){function i(i,h,s,o){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),this.x=i,this.y=h,this.width=s,this.height=o,this.type=t.ELIP}return i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;var h=(t-this.x)/this.width,s=(i-this.y)/this.height;return(h*=h)+(s*=s)<=1},i.prototype.getBounds=function(){return new o(this.x-this.width,this.y-this.height,this.width,this.height)},i}(),e=function(){function i(){for(var i=arguments,h=[],s=0;s<arguments.length;s++)h[s]=i[s];var o=Array.isArray(h[0])?h[0]:h;if("number"!=typeof o[0]){for(var n=[],r=0,e=o.length;r<e;r++)n.push(o[r].x,o[r].y);o=n}this.points=o,this.type=t.POLY,this.closeStroke=!0}return i.prototype.clone=function(){var t=new i(this.points.slice());return t.closeStroke=this.closeStroke,t},i.prototype.contains=function(t,i){for(var h=!1,s=this.points.length/2,o=0,n=s-1;o<s;n=o++){var r=this.points[2*o],e=this.points[2*o+1],a=this.points[2*n],c=this.points[2*n+1];e>i!=c>i&&t<(i-e)/(c-e)*(a-r)+r&&(h=!h)}return h},i}(),a=function(){function i(i,h,s,o,n){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===n&&(n=20),this.x=i,this.y=h,this.width=s,this.height=o,this.radius=n,this.type=t.RREC}return i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.radius)},i.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&i>=this.y&&i<=this.y+this.height){var h=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(i>=this.y+h&&i<=this.y+this.height-h||t>=this.x+h&&t<=this.x+this.width-h)return!0;var s=t-(this.x+h),o=i-(this.y+h),n=h*h;if(s*s+o*o<=n)return!0;if((s=t-(this.x+this.width-h))*s+o*o<=n)return!0;if(s*s+(o=i-(this.y+this.height-h))*o<=n)return!0;if((s=t-(this.x+h))*s+o*o<=n)return!0}return!1},i}(),c=function(){function t(t,i){void 0===t&&(t=0),void 0===i&&(i=0),this.x=0,this.y=0,this.x=t,this.y=i}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x=t,this.y=i,this},t}(),u=function(){function t(t,i,h,s){void 0===h&&(h=0),void 0===s&&(s=0),this._x=h,this._y=s,this.cb=t,this.scope=i}return t.prototype.clone=function(i,h){return void 0===i&&(i=this.cb),void 0===h&&(h=this.scope),new t(i,h,this._x,this._y)},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this._x===t&&this._y===i||(this._x=t,this._y=i,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),y=function(){function t(t,i,h,s,o,n){void 0===t&&(t=1),void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=1),void 0===o&&(o=0),void 0===n&&(n=0),this.array=null,this.a=t,this.b=i,this.c=h,this.d=s,this.tx=o,this.ty=n}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,i,h,s,o,n){return this.a=t,this.b=i,this.c=h,this.d=s,this.tx=o,this.ty=n,this},t.prototype.toArray=function(t,i){this.array||(this.array=new Float32Array(9));var h=i||this.array;return t?(h[0]=this.a,h[1]=this.b,h[2]=0,h[3]=this.c,h[4]=this.d,h[5]=0,h[6]=this.tx,h[7]=this.ty,h[8]=1):(h[0]=this.a,h[1]=this.c,h[2]=this.tx,h[3]=this.b,h[4]=this.d,h[5]=this.ty,h[6]=0,h[7]=0,h[8]=1),h},t.prototype.apply=function(t,i){i=i||new c;var h=t.x,s=t.y;return i.x=this.a*h+this.c*s+this.tx,i.y=this.b*h+this.d*s+this.ty,i},t.prototype.applyInverse=function(t,i){i=i||new c;var h=1/(this.a*this.d+this.c*-this.b),s=t.x,o=t.y;return i.x=this.d*h*s+-this.c*h*o+(this.ty*this.c-this.tx*this.d)*h,i.y=this.a*h*o+-this.b*h*s+(-this.ty*this.a+this.tx*this.b)*h,i},t.prototype.translate=function(t,i){return this.tx+=t,this.ty+=i,this},t.prototype.scale=function(t,i){return this.a*=t,this.d*=i,this.c*=t,this.b*=i,this.tx*=t,this.ty*=i,this},t.prototype.rotate=function(t){var i=Math.cos(t),h=Math.sin(t),s=this.a,o=this.c,n=this.tx;return this.a=s*i-this.b*h,this.b=s*h+this.b*i,this.c=o*i-this.d*h,this.d=o*h+this.d*i,this.tx=n*i-this.ty*h,this.ty=n*h+this.ty*i,this},t.prototype.append=function(t){var i=this.a,h=this.b,s=this.c,o=this.d;return this.a=t.a*i+t.b*s,this.b=t.a*h+t.b*o,this.c=t.c*i+t.d*s,this.d=t.c*h+t.d*o,this.tx=t.tx*i+t.ty*s+this.tx,this.ty=t.tx*h+t.ty*o+this.ty,this},t.prototype.setTransform=function(t,i,h,s,o,n,r,e,a){return this.a=Math.cos(r+a)*o,this.b=Math.sin(r+a)*o,this.c=-Math.sin(r-e)*n,this.d=Math.cos(r-e)*n,this.tx=t-(h*this.a+s*this.c),this.ty=i-(h*this.b+s*this.d),this},t.prototype.prepend=function(t){var i=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var h=this.a,s=this.c;this.a=h*t.a+this.b*t.c,this.b=h*t.b+this.b*t.d,this.c=s*t.a+this.d*t.c,this.d=s*t.b+this.d*t.d}return this.tx=i*t.a+this.ty*t.c+t.tx,this.ty=i*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var h=this.a,s=this.b,o=this.c,n=this.d,r=t.pivot,e=-Math.atan2(-o,n),a=Math.atan2(s,h),c=Math.abs(e+a);return c<1e-5||Math.abs(i-c)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=e,t.skew.y=a),t.scale.x=Math.sqrt(h*h+s*s),t.scale.y=Math.sqrt(o*o+n*n),t.position.x=this.tx+(r.x*h+r.y*o),t.position.y=this.ty+(r.x*s+r.y*n),t},t.prototype.invert=function(){var t=this.a,i=this.b,h=this.c,s=this.d,o=this.tx,n=t*s-i*h;return this.a=s/n,this.b=-i/n,this.c=-h/n,this.d=t/n,this.tx=(h*this.ty-s*o)/n,this.ty=-(t*this.ty-i*o)/n,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var i=new t;return i.a=this.a,i.b=this.b,i.c=this.c,i.d=this.d,i.tx=this.tx,i.ty=this.ty,i},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),p=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],d=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],f=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],x=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],l=[],b=[],v=Math.sign;!function(){for(var t=0;t<16;t++){var i=[];l.push(i);for(var h=0;h<16;h++)for(var s=v(p[t]*p[h]+f[t]*d[h]),o=v(d[t]*p[h]+x[t]*d[h]),n=v(p[t]*f[h]+f[t]*x[h]),r=v(d[t]*f[h]+x[t]*x[h]),e=0;e<16;e++)if(p[e]===s&&d[e]===o&&f[e]===n&&x[e]===r){i.push(e);break}}for(t=0;t<16;t++){var a=new y;a.set(p[t],d[t],f[t],x[t],0,0),b.push(a)}}();var w={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return p[t]},uY:function(t){return d[t]},vX:function(t){return f[t]},vY:function(t){return x[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,i){return l[t][i]},sub:function(t,i){return l[t][w.inv(i)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,i){return 2*Math.abs(t)<=Math.abs(i)?i>=0?w.S:w.N:2*Math.abs(i)<=Math.abs(t)?t>0?w.E:w.W:i>0?t>0?w.SE:w.SW:t>0?w.NE:w.NW},matrixAppendRotationInv:function(t,i,h,s){void 0===h&&(h=0),void 0===s&&(s=0);var o=b[w.inv(i)];o.tx=h,o.ty=s,t.append(o)}},_=function(){function t(){this.worldTransform=new y,this.localTransform=new y,this.position=new u(this.onChange,this,0,0),this.scale=new u(this.onChange,this,1,1),this.pivot=new u(this.onChange,this,0,0),this.skew=new u(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var i=this.localTransform;if(this._localID!==this._currentLocalID&&(i.a=this._cx*this.scale.x,i.b=this._sx*this.scale.x,i.c=this._cy*this.scale.y,i.d=this._sy*this.scale.y,i.tx=this.position.x-(this.pivot.x*i.a+this.pivot.y*i.c),i.ty=this.position.y-(this.pivot.x*i.b+this.pivot.y*i.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var h=t.worldTransform,s=this.worldTransform;s.a=i.a*h.a+i.b*h.c,s.b=i.a*h.b+i.b*h.d,s.c=i.c*h.a+i.d*h.c,s.d=i.c*h.b+i.d*h.d,s.tx=i.tx*h.a+i.ty*h.c+h.tx,s.ty=i.tx*h.b+i.ty*h.d+h.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}();export{n as Circle,s as DEG_TO_RAD,r as Ellipse,y as Matrix,u as ObservablePoint,i as PI_2,c as Point,e as Polygon,h as RAD_TO_DEG,o as Rectangle,a as RoundedRectangle,t as SHAPES,_ as Transform,w as groupD8};
var t,i=2*Math.PI,h=180/Math.PI,s=Math.PI/180;!function(t){t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC"}(t||(t={}));var o=function(){function t(t,i){void 0===t&&(t=0),void 0===i&&(i=0),this.x=0,this.y=0,this.x=t,this.y=i}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x=t,this.y=i,this},t}(),n=[new o,new o,new o,new o],r=function(){function i(i,h,s,o){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),this.x=Number(i),this.y=Number(h),this.width=Number(s),this.height=Number(o),this.type=t.RECT}return Object.defineProperty(i.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(i,"EMPTY",{get:function(){return new i(0,0,0,0)},enumerable:!1,configurable:!0}),i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},i.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},i.prototype.contains=function(t,i){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&i>=this.y&&i<this.y+this.height)},i.prototype.intersects=function(t,i){if(!i){var h=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=h)return!1;var s=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>s}var o=this.left,r=this.right,e=this.top,a=this.bottom;if(r<=o||a<=e)return!1;var c=n[0].set(t.left,t.top),y=n[1].set(t.left,t.bottom),u=n[2].set(t.right,t.top),p=n[3].set(t.right,t.bottom);if(u.x<=c.x||y.y<=c.y)return!1;var x=Math.sign(i.a*i.d-i.b*i.c);if(0===x)return!1;if(i.apply(c,c),i.apply(y,y),i.apply(u,u),i.apply(p,p),Math.max(c.x,y.x,u.x,p.x)<=o||Math.min(c.x,y.x,u.x,p.x)>=r||Math.max(c.y,y.y,u.y,p.y)<=e||Math.min(c.y,y.y,u.y,p.y)>=a)return!1;var d=x*(y.y-c.y),f=x*(c.x-y.x),l=d*o+f*e,b=d*r+f*e,v=d*o+f*a,w=d*r+f*a;if(Math.max(l,b,v,w)<=d*c.x+f*c.y||Math.min(l,b,v,w)>=d*p.x+f*p.y)return!1;var _=x*(c.y-u.y),g=x*(u.x-c.x),m=_*o+g*e,M=_*r+g*e,I=_*o+g*a,D=_*r+g*a;return!(Math.max(m,M,I,D)<=_*c.x+g*c.y||Math.min(m,M,I,D)>=_*p.x+g*p.y)},i.prototype.pad=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this.x-=t,this.y-=i,this.width+=2*t,this.height+=2*i,this},i.prototype.fit=function(t){var i=Math.max(this.x,t.x),h=Math.min(this.x+this.width,t.x+t.width),s=Math.max(this.y,t.y),o=Math.min(this.y+this.height,t.y+t.height);return this.x=i,this.width=Math.max(h-i,0),this.y=s,this.height=Math.max(o-s,0),this},i.prototype.ceil=function(t,i){void 0===t&&(t=1),void 0===i&&(i=.001);var h=Math.ceil((this.x+this.width-i)*t)/t,s=Math.ceil((this.y+this.height-i)*t)/t;return this.x=Math.floor((this.x+i)*t)/t,this.y=Math.floor((this.y+i)*t)/t,this.width=h-this.x,this.height=s-this.y,this},i.prototype.enlarge=function(t){var i=Math.min(this.x,t.x),h=Math.max(this.x+this.width,t.x+t.width),s=Math.min(this.y,t.y),o=Math.max(this.y+this.height,t.y+t.height);return this.x=i,this.width=h-i,this.y=s,this.height=o-s,this},i}(),e=function(){function i(i,h,s){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),this.x=i,this.y=h,this.radius=s,this.type=t.CIRC}return i.prototype.clone=function(){return new i(this.x,this.y,this.radius)},i.prototype.contains=function(t,i){if(this.radius<=0)return!1;var h=this.radius*this.radius,s=this.x-t,o=this.y-i;return(s*=s)+(o*=o)<=h},i.prototype.getBounds=function(){return new r(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},i}(),a=function(){function i(i,h,s,o){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),this.x=i,this.y=h,this.width=s,this.height=o,this.type=t.ELIP}return i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;var h=(t-this.x)/this.width,s=(i-this.y)/this.height;return(h*=h)+(s*=s)<=1},i.prototype.getBounds=function(){return new r(this.x-this.width,this.y-this.height,this.width,this.height)},i}(),c=function(){function i(){for(var i=arguments,h=[],s=0;s<arguments.length;s++)h[s]=i[s];var o=Array.isArray(h[0])?h[0]:h;if("number"!=typeof o[0]){for(var n=[],r=0,e=o.length;r<e;r++)n.push(o[r].x,o[r].y);o=n}this.points=o,this.type=t.POLY,this.closeStroke=!0}return i.prototype.clone=function(){var t=new i(this.points.slice());return t.closeStroke=this.closeStroke,t},i.prototype.contains=function(t,i){for(var h=!1,s=this.points.length/2,o=0,n=s-1;o<s;n=o++){var r=this.points[2*o],e=this.points[2*o+1],a=this.points[2*n],c=this.points[2*n+1];e>i!=c>i&&t<(i-e)/(c-e)*(a-r)+r&&(h=!h)}return h},i}(),y=function(){function i(i,h,s,o,n){void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===n&&(n=20),this.x=i,this.y=h,this.width=s,this.height=o,this.radius=n,this.type=t.RREC}return i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.radius)},i.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&i>=this.y&&i<=this.y+this.height){var h=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(i>=this.y+h&&i<=this.y+this.height-h||t>=this.x+h&&t<=this.x+this.width-h)return!0;var s=t-(this.x+h),o=i-(this.y+h),n=h*h;if(s*s+o*o<=n)return!0;if((s=t-(this.x+this.width-h))*s+o*o<=n)return!0;if(s*s+(o=i-(this.y+this.height-h))*o<=n)return!0;if((s=t-(this.x+h))*s+o*o<=n)return!0}return!1},i}(),u=function(){function t(t,i,h,s){void 0===h&&(h=0),void 0===s&&(s=0),this._x=h,this._y=s,this.cb=t,this.scope=i}return t.prototype.clone=function(i,h){return void 0===i&&(i=this.cb),void 0===h&&(h=this.scope),new t(i,h,this._x,this._y)},t.prototype.set=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=t),this._x===t&&this._y===i||(this._x=t,this._y=i,this.cb.call(this.scope)),this},t.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),t}(),p=function(){function t(t,i,h,s,o,n){void 0===t&&(t=1),void 0===i&&(i=0),void 0===h&&(h=0),void 0===s&&(s=1),void 0===o&&(o=0),void 0===n&&(n=0),this.array=null,this.a=t,this.b=i,this.c=h,this.d=s,this.tx=o,this.ty=n}return t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},t.prototype.set=function(t,i,h,s,o,n){return this.a=t,this.b=i,this.c=h,this.d=s,this.tx=o,this.ty=n,this},t.prototype.toArray=function(t,i){this.array||(this.array=new Float32Array(9));var h=i||this.array;return t?(h[0]=this.a,h[1]=this.b,h[2]=0,h[3]=this.c,h[4]=this.d,h[5]=0,h[6]=this.tx,h[7]=this.ty,h[8]=1):(h[0]=this.a,h[1]=this.c,h[2]=this.tx,h[3]=this.b,h[4]=this.d,h[5]=this.ty,h[6]=0,h[7]=0,h[8]=1),h},t.prototype.apply=function(t,i){i=i||new o;var h=t.x,s=t.y;return i.x=this.a*h+this.c*s+this.tx,i.y=this.b*h+this.d*s+this.ty,i},t.prototype.applyInverse=function(t,i){i=i||new o;var h=1/(this.a*this.d+this.c*-this.b),s=t.x,n=t.y;return i.x=this.d*h*s+-this.c*h*n+(this.ty*this.c-this.tx*this.d)*h,i.y=this.a*h*n+-this.b*h*s+(-this.ty*this.a+this.tx*this.b)*h,i},t.prototype.translate=function(t,i){return this.tx+=t,this.ty+=i,this},t.prototype.scale=function(t,i){return this.a*=t,this.d*=i,this.c*=t,this.b*=i,this.tx*=t,this.ty*=i,this},t.prototype.rotate=function(t){var i=Math.cos(t),h=Math.sin(t),s=this.a,o=this.c,n=this.tx;return this.a=s*i-this.b*h,this.b=s*h+this.b*i,this.c=o*i-this.d*h,this.d=o*h+this.d*i,this.tx=n*i-this.ty*h,this.ty=n*h+this.ty*i,this},t.prototype.append=function(t){var i=this.a,h=this.b,s=this.c,o=this.d;return this.a=t.a*i+t.b*s,this.b=t.a*h+t.b*o,this.c=t.c*i+t.d*s,this.d=t.c*h+t.d*o,this.tx=t.tx*i+t.ty*s+this.tx,this.ty=t.tx*h+t.ty*o+this.ty,this},t.prototype.setTransform=function(t,i,h,s,o,n,r,e,a){return this.a=Math.cos(r+a)*o,this.b=Math.sin(r+a)*o,this.c=-Math.sin(r-e)*n,this.d=Math.cos(r-e)*n,this.tx=t-(h*this.a+s*this.c),this.ty=i-(h*this.b+s*this.d),this},t.prototype.prepend=function(t){var i=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var h=this.a,s=this.c;this.a=h*t.a+this.b*t.c,this.b=h*t.b+this.b*t.d,this.c=s*t.a+this.d*t.c,this.d=s*t.b+this.d*t.d}return this.tx=i*t.a+this.ty*t.c+t.tx,this.ty=i*t.b+this.ty*t.d+t.ty,this},t.prototype.decompose=function(t){var h=this.a,s=this.b,o=this.c,n=this.d,r=t.pivot,e=-Math.atan2(-o,n),a=Math.atan2(s,h),c=Math.abs(e+a);return c<1e-5||Math.abs(i-c)<1e-5?(t.rotation=a,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=e,t.skew.y=a),t.scale.x=Math.sqrt(h*h+s*s),t.scale.y=Math.sqrt(o*o+n*n),t.position.x=this.tx+(r.x*h+r.y*o),t.position.y=this.ty+(r.x*s+r.y*n),t},t.prototype.invert=function(){var t=this.a,i=this.b,h=this.c,s=this.d,o=this.tx,n=t*s-i*h;return this.a=s/n,this.b=-i/n,this.c=-h/n,this.d=t/n,this.tx=(h*this.ty-s*o)/n,this.ty=-(t*this.ty-i*o)/n,this},t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},t.prototype.clone=function(){var i=new t;return i.a=this.a,i.b=this.b,i.c=this.c,i.d=this.d,i.tx=this.tx,i.ty=this.ty,i},t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},Object.defineProperty(t,"IDENTITY",{get:function(){return new t},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEMP_MATRIX",{get:function(){return new t},enumerable:!1,configurable:!0}),t}(),x=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],d=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],f=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],l=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],b=[],v=[],w=Math.sign;!function(){for(var t=0;t<16;t++){var i=[];b.push(i);for(var h=0;h<16;h++)for(var s=w(x[t]*x[h]+f[t]*d[h]),o=w(d[t]*x[h]+l[t]*d[h]),n=w(x[t]*f[h]+f[t]*l[h]),r=w(d[t]*f[h]+l[t]*l[h]),e=0;e<16;e++)if(x[e]===s&&d[e]===o&&f[e]===n&&l[e]===r){i.push(e);break}}for(t=0;t<16;t++){var a=new p;a.set(x[t],d[t],f[t],l[t],0,0),v.push(a)}}();var _={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return x[t]},uY:function(t){return d[t]},vX:function(t){return f[t]},vY:function(t){return l[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,i){return b[t][i]},sub:function(t,i){return b[t][_.inv(i)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,i){return 2*Math.abs(t)<=Math.abs(i)?i>=0?_.S:_.N:2*Math.abs(i)<=Math.abs(t)?t>0?_.E:_.W:i>0?t>0?_.SE:_.SW:t>0?_.NE:_.NW},matrixAppendRotationInv:function(t,i,h,s){void 0===h&&(h=0),void 0===s&&(s=0);var o=v[_.inv(i)];o.tx=h,o.ty=s,t.append(o)}},g=function(){function t(){this.worldTransform=new p,this.localTransform=new p,this.position=new u(this.onChange,this,0,0),this.scale=new u(this.onChange,this,1,1),this.pivot=new u(this.onChange,this,0,0),this.skew=new u(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var i=this.localTransform;if(this._localID!==this._currentLocalID&&(i.a=this._cx*this.scale.x,i.b=this._sx*this.scale.x,i.c=this._cy*this.scale.y,i.d=this._sy*this.scale.y,i.tx=this.position.x-(this.pivot.x*i.a+this.pivot.y*i.c),i.ty=this.position.y-(this.pivot.x*i.b+this.pivot.y*i.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var h=t.worldTransform,s=this.worldTransform;s.a=i.a*h.a+i.b*h.c,s.b=i.a*h.b+i.b*h.d,s.c=i.c*h.a+i.d*h.c,s.d=i.c*h.b+i.d*h.d,s.tx=i.tx*h.a+i.ty*h.c+h.tx,s.ty=i.tx*h.b+i.ty*h.d+h.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}();export{e as Circle,s as DEG_TO_RAD,a as Ellipse,p as Matrix,u as ObservablePoint,i as PI_2,o as Point,c as Polygon,h as RAD_TO_DEG,r as Rectangle,y as RoundedRectangle,t as SHAPES,g as Transform,_ as groupD8};
//# sourceMappingURL=math.min.js.map

@@ -827,2 +827,13 @@ /// <reference path="./global.d.ts" />

/**
* Determines whether the `other` Rectangle transformed by `transform` intersects with `this` Rectangle object.
* Returns true only if the area of the intersection is >0, this means that Rectangles
* sharing a side are not overlapping. Another side effect is that an arealess rectangle
* (width or height equal to zero) can't intersect any other rectangle.
*
* @param {Rectangle} other - The Rectangle to intersect with `this`.
* @param {Matrix} transform - The transformation matrix of `other`.
* @returns {boolean} A value of `true` if the transformed `other` Rectangle intersects with `this`; otherwise `false`.
*/
intersects(other: Rectangle, transform?: Matrix): boolean;
/**
* Pads the rectangle making it grow in all directions.

@@ -865,24 +876,34 @@ * If paddingY is omitted, both paddingX and paddingY will be set to paddingX.

*
* @class
* @memberof PIXI
*/
export declare class RoundedRectangle {
/** @default 0 */
x: number;
/** @default 0 */
y: number;
/** @default 0 */
width: number;
/** @default 0 */
height: number;
/** @default 20 */
radius: number;
/**
* The type of the object, mainly used to avoid `instanceof` checks
*
* @default PIXI.SHAPES.RREC
* @see PIXI.SHAPES
*/
readonly type: SHAPES.RREC;
/**
* @param {number} [x=0] - The X coordinate of the upper-left corner of the rounded rectangle
* @param {number} [y=0] - The Y coordinate of the upper-left corner of the rounded rectangle
* @param {number} [width=0] - The overall width of this rounded rectangle
* @param {number} [height=0] - The overall height of this rounded rectangle
* @param {number} [radius=20] - Controls the radius of the rounded corners
* @param x - The X coordinate of the upper-left corner of the rounded rectangle
* @param y - The Y coordinate of the upper-left corner of the rounded rectangle
* @param width - The overall width of this rounded rectangle
* @param height - The overall height of this rounded rectangle
* @param radius - Controls the radius of the rounded corners
*/
constructor(x?: number, y?: number, width?: number, height?: number, radius?: number);
/**
* Creates a clone of this Rounded Rectangle
* Creates a clone of this Rounded Rectangle.
*
* @return {PIXI.RoundedRectangle} a copy of the rounded rectangle
* @return - A copy of the rounded rectangle.
*/

@@ -893,5 +914,5 @@ clone(): RoundedRectangle;

*
* @param {number} x - The X coordinate of the point to test
* @param {number} y - The Y coordinate of the point to test
* @return {boolean} Whether the x/y coordinates are within this Rounded Rectangle
* @param x - The X coordinate of the point to test.
* @param y - The Y coordinate of the point to test.
* @return - Whether the x/y coordinates are within this Rounded Rectangle.
*/

@@ -898,0 +919,0 @@ contains(x: number, y: number): boolean;

{
"name": "@pixi/math",
"version": "6.2.2",
"version": "6.3.0",
"main": "dist/cjs/math.js",

@@ -27,3 +27,3 @@ "module": "dist/esm/math.js",

],
"gitHead": "23c4599ad83dbb128d71a1010aa6c4fb96779270"
"gitHead": "dc311cdd7a28e6817556cdc674fd15ef71069467"
}

Sorry, the diff of this file is too big to display

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