UNPKG

@flashport/flashport

Version:

FlashPort is a TypeScript 2D graphics library that largely replicates the Flash ActionScript 3.0 library

8 lines 284 kB
(function(d,X){typeof exports=="object"&&typeof module!="undefined"?X(exports):typeof define=="function"&&define.amd?define(["exports"],X):(d=typeof globalThis!="undefined"?globalThis:d||self,X(d.flashport={}))})(this,function(d){"use strict";var Fa=Object.defineProperty;var ka=(d,X,x)=>X in d?Fa(d,X,{enumerable:!0,configurable:!0,writable:!0,value:x}):d[X]=x;var e=(d,X,x)=>(ka(d,typeof X!="symbol"?X+"":X,x),x);class X extends Object{constructor(){super()}}e(X,"EULER_ANGLES","eulerAngles"),e(X,"AXIS_ANGLE","axisAngle"),e(X,"QUATERNION","quaternion");const Ft=class extends Object{constructor(t=0,s=0,i=0,r=0){super();e(this,"x");e(this,"y");e(this,"z");e(this,"w");this.x=t,this.y=s,this.z=i,this.w=r}static angleBetween(t,s){var i=t.x*s.x+t.y*s.y+t.z*s.z,r=t.length,n=s.length;return i=i/(r*n),Math.acos(i)}static distance(t,s){return t.subtract(s).length}clone(){return new Ft(this.x,this.y,this.z,this.w)}dotProduct(t){return this.x*t.x+this.y*t.y+this.z*t.z}crossProduct(t){return new Ft(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x,1)}get length(){var t=this.x*this.x+this.y*this.y+this.z*this.z;return t<=0?0:Math.sqrt(t)}get lengthSquared(){return this.x*this.x+this.y*this.y+this.z*this.z}normalize(){var t=this.length,s=t!=0?1/t:0;return this.x=this.x*s,this.y=this.y*s,this.z=this.z*s,t}scaleBy(t){this.x=this.x*t,this.y=this.y*t,this.z=this.z*t}incrementBy(t){this.x=this.x+t.x,this.y=this.y+t.y,this.z=this.z+t.z}decrementBy(t){this.x=this.x-t.x,this.y=this.y-t.y,this.z=this.z-t.z}add(t){return new Ft(this.x+t.x,this.y+t.y,this.z+t.z)}subtract(t){return new Ft(this.x-t.x,this.y-t.y,this.z-t.z)}negate(){this.x=-this.x,this.y=-this.y,this.z=-this.z}equals(t,s=!1){return this.x===t.x&&this.y===t.y&&this.z===t.z&&(s?this.w===t.w:!0)}nearEquals(t,s,i=!1){var r=this.x-t.x;r=r<0?0-r:r;var n=r<s;return n&&(r=this.y-t.y,r=r<0?0-r:r,n=r<s,n&&(r=this.z-t.z,r=r<0?0-r:r,n=r<s,n&&i&&(r=this.w=t.w,r=r<0?0-r:r,n=r<s))),n}project(){var t=1/this.w;this.x=this.x*t,this.y=this.y*t,this.z=this.z*t}toString(){var t="Vector3D("+this.x+", "+this.y+", "+this.z;return t=t+")",t}copyFrom(t){this.x=t.x,this.y=t.y,this.z=t.z}setTo(t,s,i){this.x=t,this.y=s,this.z=i}};let x=Ft;e(x,"X_AXIS",new Ft(1,0,0)),e(x,"Y_AXIS",new Ft(0,1,0)),e(x,"Z_AXIS",new Ft(0,0,1));const kt=class{constructor(a=null){e(this,"rawData");a!=null&&a.length===16?this.rawData=a:this.rawData=new Array(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}get determinant(){return(this.rawData[0]*this.rawData[5]-this.rawData[4]*this.rawData[1])*(this.rawData[10]*this.rawData[15]-this.rawData[14]*this.rawData[11])-(this.rawData[0]*this.rawData[9]-this.rawData[8]*this.rawData[1])*(this.rawData[6]*this.rawData[15]-this.rawData[14]*this.rawData[7])+(this.rawData[0]*this.rawData[13]-this.rawData[12]*this.rawData[1])*(this.rawData[6]*this.rawData[11]-this.rawData[10]*this.rawData[7])+(this.rawData[4]*this.rawData[9]-this.rawData[8]*this.rawData[5])*(this.rawData[2]*this.rawData[15]-this.rawData[14]*this.rawData[3])-(this.rawData[4]*this.rawData[13]-this.rawData[12]*this.rawData[5])*(this.rawData[2]*this.rawData[11]-this.rawData[10]*this.rawData[3])+(this.rawData[8]*this.rawData[13]-this.rawData[12]*this.rawData[9])*(this.rawData[2]*this.rawData[7]-this.rawData[6]*this.rawData[3])}get position(){return new x(this.rawData[12],this.rawData[13],this.rawData[14])}set position(a){this.rawData[12]=a.x,this.rawData[13]=a.y,this.rawData[14]=a.z}append(a){var t=this.rawData[0],s=this.rawData[4],i=this.rawData[8],r=this.rawData[12],n=this.rawData[1],l=this.rawData[5],h=this.rawData[9],c=this.rawData[13],u=this.rawData[2],g=this.rawData[6],m=this.rawData[10],E=this.rawData[14],T=this.rawData[3],y=this.rawData[7],M=this.rawData[11],A=this.rawData[15],P=a.rawData[0],L=a.rawData[4],B=a.rawData[8],G=a.rawData[12],H=a.rawData[1],C=a.rawData[5],at=a.rawData[9],rt=a.rawData[13],j=a.rawData[2],J=a.rawData[6],ht=a.rawData[10],wt=a.rawData[14],tt=a.rawData[3],Tt=a.rawData[7],yt=a.rawData[11],St=a.rawData[15];this.rawData[0]=t*P+n*L+u*B+T*G,this.rawData[1]=t*H+n*C+u*at+T*rt,this.rawData[2]=t*j+n*J+u*ht+T*wt,this.rawData[3]=t*tt+n*Tt+u*yt+T*St,this.rawData[4]=s*P+l*L+g*B+y*G,this.rawData[5]=s*H+l*C+g*at+y*rt,this.rawData[6]=s*j+l*J+g*ht+y*wt,this.rawData[7]=s*tt+l*Tt+g*yt+y*St,this.rawData[8]=i*P+h*L+m*B+M*G,this.rawData[9]=i*H+h*C+m*at+M*rt,this.rawData[10]=i*j+h*J+m*ht+M*wt,this.rawData[11]=i*tt+h*Tt+m*yt+M*St,this.rawData[12]=r*P+c*L+E*B+A*G,this.rawData[13]=r*H+c*C+E*at+A*rt,this.rawData[14]=r*j+c*J+E*ht+A*wt,this.rawData[15]=r*tt+c*Tt+E*yt+A*St}appendRotation(a,t,s=null){var i=kt.getAxisRotation(t.x,t.y,t.z,a);if(s!=null){var r=s;i.appendTranslation(r.x,r.y,r.z)}this.append(i)}appendScale(a,t,s){this.rawData[0]*=a,this.rawData[1]*=a,this.rawData[2]*=a,this.rawData[3]*=a,this.rawData[4]*=t,this.rawData[5]*=t,this.rawData[6]*=t,this.rawData[7]*=t,this.rawData[8]*=s,this.rawData[9]*=s,this.rawData[10]*=s,this.rawData[11]*=s}appendTranslation(a,t,s){this.rawData[12]+=a,this.rawData[13]+=t,this.rawData[14]+=s}clone(){return new kt(this.rawData.concat())}copyColumnFrom(a,t){switch(a){case 0:this.rawData[0]=t.x,this.rawData[1]=t.y,this.rawData[2]=t.z,this.rawData[3]=t.w;break;case 1:this.rawData[4]=t.x,this.rawData[5]=t.y,this.rawData[6]=t.z,this.rawData[7]=t.w;break;case 2:this.rawData[8]=t.x,this.rawData[9]=t.y,this.rawData[10]=t.z,this.rawData[11]=t.w;break;case 3:this.rawData[12]=t.x,this.rawData[13]=t.y,this.rawData[14]=t.z,this.rawData[15]=t.w;break;default:throw new Error("Error, Column "+a+" out of bounds [0, ..., 3]")}}copyColumnTo(a,t){var s=a*4;t.x=this.rawData[s],t.y=this.rawData[1+s],t.z=this.rawData[2+s],t.w=this.rawData[3+s]}copyFrom(a){this.rawData=a.rawData.concat()}copyRawDataFrom(a,t=0,s=!1){s&&this.transpose();for(var i=a.length-t,r=0;r<Number(i);){var n=r++;this.rawData[n]=a[n+t]}s&&this.transpose()}copyRawDataTo(a,t=0,s=!1){s&&this.transpose();for(var i=this.rawData.length,r=0;r<i;){var n=r++;a[n+t]=this.rawData[n]}s&&this.transpose()}copyRowFrom(a,t){switch(a){case 0:this.rawData[0]=t.x,this.rawData[4]=t.y,this.rawData[8]=t.z,this.rawData[12]=t.w;break;case 1:this.rawData[1]=t.x,this.rawData[5]=t.y,this.rawData[9]=t.z,this.rawData[13]=t.w;break;case 2:this.rawData[2]=t.x,this.rawData[6]=t.y,this.rawData[10]=t.z,this.rawData[14]=t.w;break;case 3:this.rawData[3]=t.x,this.rawData[7]=t.y,this.rawData[11]=t.z,this.rawData[15]=t.w;break;default:throw new Error("Error, Row "+(""+a)+" out of bounds [0, ..., 3]")}}copyRowTo(a,t){t.x=this.rawData[a],t.y=this.rawData[4+a],t.z=this.rawData[8+a],t.w=this.rawData[12+a]}copyToMatrix3D(a){a.rawData=this.rawData.concat()}decompose(a=null){a==null&&(a=X.EULER_ANGLES);var t=[],s=this.clone(),i=s.rawData.concat(),r=new x(i[12],i[13],i[14]),n=new x;n.x=Math.sqrt(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]),n.y=Math.sqrt(i[4]*i[4]+i[5]*i[5]+i[6]*i[6]),n.z=Math.sqrt(i[8]*i[8]+i[9]*i[9]+i[10]*i[10]),i[0]*(i[5]*i[10]-i[6]*i[9])-i[1]*(i[4]*i[10]-i[6]*i[8])+i[2]*(i[4]*i[9]-i[5]*i[8])<0&&(n.z=-n.z),i[0]/=n.x,i[1]/=n.x,i[2]/=n.x,i[4]/=n.y,i[5]/=n.y,i[6]/=n.y,i[8]/=n.z,i[9]/=n.z,i[10]/=n.z;var l=new x;switch(a){case X.AXIS_ANGLE:{l.w=Math.acos((i[0]+i[5]+i[10]-1)/2);var h=Math.sqrt((i[6]-i[9])*(i[6]-i[9])+(i[8]-i[2])*(i[8]-i[2])+(i[1]-i[4])*(i[1]-i[4]));h!=0?(l.x=(i[6]-i[9])/h,l.y=(i[8]-i[2])/h,l.z=(i[1]-i[4])/h):l.x=l.y=l.z=0}break;case X.QUATERNION:{var c=i[0]+i[5]+i[10];c>0?(l.w=Math.sqrt(1+c)/2,l.x=(i[6]-i[9])/(4*l.w),l.y=(i[8]-i[2])/(4*l.w),l.z=(i[1]-i[4])/(4*l.w)):i[0]>i[5]&&i[0]>i[10]?(l.x=Math.sqrt(1+i[0]-i[5]-i[10])/2,l.w=(i[6]-i[9])/(4*l.x),l.y=(i[1]+i[4])/(4*l.x),l.z=(i[8]+i[2])/(4*l.x)):i[5]>i[10]?(l.y=Math.sqrt(1+i[5]-i[0]-i[10])/2,l.x=(i[1]+i[4])/(4*l.y),l.w=(i[8]-i[2])/(4*l.y),l.z=(i[6]+i[9])/(4*l.y)):(l.z=Math.sqrt(1+i[10]-i[0]-i[5])/2,l.x=(i[8]+i[2])/(4*l.z),l.y=(i[6]+i[9])/(4*l.z),l.w=(i[1]-i[4])/(4*l.z))}break;case X.EULER_ANGLES:l.y=Math.asin(-i[2]),i[2]!=1&&i[2]!=-1?(l.x=Math.atan2(i[6],i[10]),l.z=Math.atan2(i[1],i[0])):(l.z=0,l.x=Math.atan2(i[4],i[5]));break}return t.push(r),t.push(l),t.push(n),t}deltaTransformVector(a){var t=a.x,s=a.y,i=a.z;return new x(t*this.rawData[0]+s*this.rawData[4]+i*this.rawData[8]+this.rawData[3],t*this.rawData[1]+s*this.rawData[5]+i*this.rawData[9]+this.rawData[7],t*this.rawData[2]+s*this.rawData[6]+i*this.rawData[10]+this.rawData[11],0)}identity(){this.rawData[0]=1,this.rawData[1]=0,this.rawData[2]=0,this.rawData[3]=0,this.rawData[4]=0,this.rawData[5]=1,this.rawData[6]=0,this.rawData[7]=0,this.rawData[8]=0,this.rawData[9]=0,this.rawData[10]=1,this.rawData[11]=0,this.rawData[12]=0,this.rawData[13]=0,this.rawData[14]=0,this.rawData[15]=1}interpolateTo(a,t){for(var s=0;s<16;){var i=s++;this.rawData[i]=this.rawData[i]+(a.rawData[i]-this.rawData[i])*t}}invert(){var a=this.determinant,t=Math.abs(a)>1e-11;if(t){a=1/a;var s=this.rawData[0],i=this.rawData[4],r=this.rawData[8],n=this.rawData[12],l=this.rawData[1],h=this.rawData[5],c=this.rawData[9],u=this.rawData[13],g=this.rawData[2],m=this.rawData[6],E=this.rawData[10],T=this.rawData[14],y=this.rawData[3],M=this.rawData[7],A=this.rawData[11],P=this.rawData[15];this.rawData[0]=a*(h*(E*P-T*A)-c*(m*P-T*M)+u*(m*A-E*M)),this.rawData[1]=-a*(l*(E*P-T*A)-c*(g*P-T*y)+u*(g*A-E*y)),this.rawData[2]=a*(l*(m*P-T*M)-h*(g*P-T*y)+u*(g*M-m*y)),this.rawData[3]=-a*(l*(m*A-E*M)-h*(g*A-E*y)+c*(g*M-m*y)),this.rawData[4]=-a*(i*(E*P-T*A)-r*(m*P-T*M)+n*(m*A-E*M)),this.rawData[5]=a*(s*(E*P-T*A)-r*(g*P-T*y)+n*(g*A-E*y)),this.rawData[6]=-a*(s*(m*P-T*M)-i*(g*P-T*y)+n*(g*M-m*y)),this.rawData[7]=a*(s*(m*A-E*M)-i*(g*A-E*y)+r*(g*M-m*y)),this.rawData[8]=a*(i*(c*P-u*A)-r*(h*P-u*M)+n*(h*A-c*M)),this.rawData[9]=-a*(s*(c*P-u*A)-r*(l*P-u*y)+n*(l*A-c*y)),this.rawData[10]=a*(s*(h*P-u*M)-i*(l*P-u*y)+n*(l*M-h*y)),this.rawData[11]=-a*(s*(h*A-c*M)-i*(l*A-c*y)+r*(l*M-h*y)),this.rawData[12]=-a*(i*(c*T-u*E)-r*(h*T-u*m)+n*(h*E-c*m)),this.rawData[13]=a*(s*(c*T-u*E)-r*(l*T-u*g)+n*(l*E-c*g)),this.rawData[14]=-a*(s*(h*T-u*m)-i*(l*T-u*g)+n*(l*m-h*g)),this.rawData[15]=a*(s*(h*E-c*m)-i*(l*E-c*g)+r*(l*m-h*g))}return t}pointAt(a,t=null,s=null){t==null&&(t=new x(0,0,-1)),s==null&&(s=new x(0,-1,0));var i=t.subtract(a),r=s.clone(),n;i.normalize(),r.normalize();var l=i.clone();l.scaleBy(r.dotProduct(i)),r=r.subtract(l),r.length>0?r.normalize():i.x!=0?r=new x(-i.y,i.x,0):r=new x(1,0,0),n=r.crossProduct(i),n.normalize(),this.rawData[0]=n.x,this.rawData[4]=n.y,this.rawData[8]=n.z,this.rawData[12]=0,this.rawData[1]=r.x,this.rawData[5]=r.y,this.rawData[9]=r.z,this.rawData[13]=0,this.rawData[2]=i.x,this.rawData[6]=i.y,this.rawData[10]=i.z,this.rawData[14]=0,this.rawData[3]=a.x,this.rawData[7]=a.y,this.rawData[11]=a.z,this.rawData[15]=1}prepend(a){var t=a.rawData[0],s=a.rawData[4],i=a.rawData[8],r=a.rawData[12],n=a.rawData[1],l=a.rawData[5],h=a.rawData[9],c=a.rawData[13],u=a.rawData[2],g=a.rawData[6],m=a.rawData[10],E=a.rawData[14],T=a.rawData[3],y=a.rawData[7],M=a.rawData[11],A=a.rawData[15],P=this.rawData[0],L=this.rawData[4],B=this.rawData[8],G=this.rawData[12],H=this.rawData[1],C=this.rawData[5],at=this.rawData[9],rt=this.rawData[13],j=this.rawData[2],J=this.rawData[6],ht=this.rawData[10],wt=this.rawData[14],tt=this.rawData[3],Tt=this.rawData[7],yt=this.rawData[11],St=this.rawData[15];this.rawData[0]=t*P+n*L+u*B+T*G,this.rawData[1]=t*H+n*C+u*at+T*rt,this.rawData[2]=t*j+n*J+u*ht+T*wt,this.rawData[3]=t*tt+n*Tt+u*yt+T*St,this.rawData[4]=s*P+l*L+g*B+y*G,this.rawData[5]=s*H+l*C+g*at+y*rt,this.rawData[6]=s*j+l*J+g*ht+y*wt,this.rawData[7]=s*tt+l*Tt+g*yt+y*St,this.rawData[8]=i*P+h*L+m*B+M*G,this.rawData[9]=i*H+h*C+m*at+M*rt,this.rawData[10]=i*j+h*J+m*ht+M*wt,this.rawData[11]=i*tt+h*Tt+m*yt+M*St,this.rawData[12]=r*P+c*L+E*B+A*G,this.rawData[13]=r*H+c*C+E*at+A*rt,this.rawData[14]=r*j+c*J+E*ht+A*wt,this.rawData[15]=r*tt+c*Tt+E*yt+A*St}prependRotation(a,t,s=null){var i=kt.getAxisRotation(t.x,t.y,t.z,a);if(s!=null){var r=s;i.appendTranslation(r.x,r.y,r.z)}this.prepend(i)}prependScale(a,t,s){this.rawData[0]*=a,this.rawData[1]*=t,this.rawData[2]*=s,this.rawData[4]*=a,this.rawData[5]*=t,this.rawData[6]*=s,this.rawData[8]*=a,this.rawData[9]*=t,this.rawData[10]*=s,this.rawData[12]*=a,this.rawData[13]*=t,this.rawData[14]*=s}prependTranslation(a,t,s){var i=kt.TEMP;i.identity(),i.position=new x(a,t,s),this.prepend(i)}recompose(a,t=null){if(a.length<3||a[2].x==0||a[2].y==0||a[2].z==0)return!1;t==null&&(t=X.EULER_ANGLES),this.identity();var s=[];switch(s[0]=s[1]=s[2]=a[2].x,s[4]=s[5]=s[6]=a[2].y,s[8]=s[9]=s[10]=a[2].z,t){case X.EULER_ANGLES:{var i=Math.cos(a[1].x),r=Math.cos(a[1].y),n=Math.cos(a[1].z),l=Math.sin(a[1].x),h=Math.sin(a[1].y),c=Math.sin(a[1].z);this.rawData[0]=r*n*s[0],this.rawData[1]=r*c*s[1],this.rawData[2]=-h*s[2],this.rawData[3]=0,this.rawData[4]=(l*h*n-i*c)*s[4],this.rawData[5]=(l*h*c+i*n)*s[5],this.rawData[6]=l*r*s[6],this.rawData[7]=0,this.rawData[8]=(i*h*n+l*c)*s[8],this.rawData[9]=(i*h*c-l*n)*s[9],this.rawData[10]=i*r*s[10],this.rawData[11]=0,this.rawData[12]=a[0].x,this.rawData[13]=a[0].y,this.rawData[14]=a[0].z,this.rawData[15]=1}break;default:{var u=a[1].x,g=a[1].y,m=a[1].z,E=a[1].w;t==X.AXIS_ANGLE&&(u*=Math.sin(E/2),g*=Math.sin(E/2),m*=Math.sin(E/2),E=Math.cos(E/2)),this.rawData[0]=(1-2*g*g-2*m*m)*s[0],this.rawData[1]=(2*u*g+2*E*m)*s[1],this.rawData[2]=(2*u*m-2*E*g)*s[2],this.rawData[3]=0,this.rawData[4]=(2*u*g-2*E*m)*s[4],this.rawData[5]=(1-2*u*u-2*m*m)*s[5],this.rawData[6]=(2*g*m+2*E*u)*s[6],this.rawData[7]=0,this.rawData[8]=(2*u*m+2*E*g)*s[8],this.rawData[9]=(2*g*m-2*E*u)*s[9],this.rawData[10]=(1-2*u*u-2*g*g)*s[10],this.rawData[11]=0,this.rawData[12]=a[0].x,this.rawData[13]=a[0].y,this.rawData[14]=a[0].z,this.rawData[15]=1}break}return a[2].x===0&&(this.rawData[0]=1e-15),a[2].y===0&&(this.rawData[5]=1e-15),a[2].z===0&&(this.rawData[10]=1e-15),!(a[2].x===0||a[2].y===0||a[2].y===0)}transformVector(a){var t=a.x,s=a.y,i=a.z;return new x(t*this.rawData[0]+s*this.rawData[4]+i*this.rawData[8]+this.rawData[12],t*this.rawData[1]+s*this.rawData[5]+i*this.rawData[9]+this.rawData[13],t*this.rawData[2]+s*this.rawData[6]+i*this.rawData[10]+this.rawData[14],t*this.rawData[3]+s*this.rawData[7]+i*this.rawData[11]+this.rawData[15])}transformVectors(a,t){for(var s=0;s+3<=a.length;){var i=a[s],r=a[s+1],n=a[s+2];t[s]=i*this.rawData[0]+r*this.rawData[4]+n*this.rawData[8]+this.rawData[12],t[s+1]=i*this.rawData[1]+r*this.rawData[5]+n*this.rawData[9]+this.rawData[13],t[s+2]=i*this.rawData[2]+r*this.rawData[6]+n*this.rawData[10]+this.rawData[14],s+=3}}transpose(){var a=this.rawData.concat();this.rawData[1]=a[4],this.rawData[2]=a[8],this.rawData[3]=a[12],this.rawData[4]=a[1],this.rawData[6]=a[9],this.rawData[7]=a[13],this.rawData[8]=a[2],this.rawData[9]=a[6],this.rawData[11]=a[14],this.rawData[12]=a[3],this.rawData[13]=a[7],this.rawData[14]=a[11]}static interpolate(a,t,s){for(var i=new kt,r=0;r<16;){var n=r++;i.rawData[n]=a.rawData[n]+(t.rawData[n]-a.rawData[n])*s}return i}static getAxisRotation(a,t,s,i,r=null){var n=r||new kt,l=-i*(Math.PI/180),h=Math.cos(l),c=Math.sin(l),u=1-h;n.rawData[0]=h+a*a*u,n.rawData[5]=h+t*t*u,n.rawData[10]=h+s*s*u;var g=a*t*u,m=s*c;return n.rawData[4]=g+m,n.rawData[1]=g-m,g=a*s*u,m=t*c,n.rawData[8]=g-m,n.rawData[2]=g+m,g=t*s*u,m=a*c,n.rawData[9]=g+m,n.rawData[6]=g-m,n}};let Ut=kt;e(Ut,"TEMP",new kt);class ei extends Ut{constructor(t=null){super(t);e(this,"lookAtLH",(t,s,i)=>{this._z.copyFrom(s),this._z.subtract(t),this._z.normalize(),this._z.w=0,this._x.copyFrom(i),this._crossProductTo(this._x,this._z),this._x.normalize(),this._x.w=0,this._y.copyFrom(this._z),this._crossProductTo(this._y,this._x),this._y.w=0,this._w.x=this._x.dotProduct(t),this._w.y=this._y.dotProduct(t),this._w.z=this._z.dotProduct(t),this._w.w=1,this.copyRowFrom(0,this._x),this.copyRowFrom(1,this._y),this.copyRowFrom(2,this._z),this.copyRowFrom(3,this._w)});e(this,"lookAtRH",(t,s,i)=>{this._z.copyFrom(t),this._z.subtract(s),this._z.normalize(),this._z.w=0,this._x.copyFrom(i),this._crossProductTo(this._x,this._z),this._x.normalize(),this._x.w=0,this._y.copyFrom(this._z),this._crossProductTo(this._y,this._x),this._y.w=0,this._w.x=this._x.dotProduct(t),this._w.y=this._y.dotProduct(t),this._w.z=this._z.dotProduct(t),this._w.w=1,this.copyRowFrom(0,this._x),this.copyRowFrom(1,this._y),this.copyRowFrom(2,this._z),this.copyRowFrom(3,this._w)});e(this,"perspectiveLH",(t,s,i,r)=>{this.copyRawDataFrom([2*i/t,0,0,0,0,2*i/s,0,0,0,0,r/(r-i),1,0,0,i*r/(i-r),0])});e(this,"perspectiveRH",(t,s,i,r)=>{this.copyRawDataFrom([2*i/t,0,0,0,0,2*i/s,0,0,0,0,r/(i-r),-1,0,0,i*r/(i-r),0])});e(this,"perspectiveFieldOfViewLH",(t,s,i,r)=>{var n=1/Math.tan(t/2),l=n/s;this.copyRawDataFrom([l,0,0,0,0,n,0,0,0,0,r/(r-i),1,0,0,i*r/(i-r),0])});e(this,"perspectiveFieldOfViewRH",(t,s,i,r)=>{var n=1/Math.tan(t/2),l=n/s;this.copyRawDataFrom([l,0,0,0,0,n,0,0,0,0,r/(i-r),-1,0,0,i*r/(i-r),0])});e(this,"perspectiveOffCenterLH",(t,s,i,r,n,l)=>{this.copyRawDataFrom([2*n/(s-t),0,0,0,0,-2*n/(i-r),0,0,-1-2*t/(s-t),1+2*r/(i-r),-l/(n-l),1,0,0,n*l/(n-l),0])});e(this,"perspectiveOffCenterRH",(t,s,i,r,n,l)=>{this.copyRawDataFrom([2*n/(s-t),0,0,0,0,-2*n/(i-r),0,0,1+2*t/(s-t),-1-2*r/(i-r),l/(n-l),-1,0,0,n*l/(n-l),0])});e(this,"orthoLH",(t,s,i,r)=>{this.copyRawDataFrom([2/t,0,0,0,0,2/s,0,0,0,0,1/(r-i),0,0,0,i/(i-r),1])});e(this,"orthoRH",(t,s,i,r)=>{this.copyRawDataFrom([2/t,0,0,0,0,2/s,0,0,0,0,1/(i-i),0,0,0,i/(i-r),1])});e(this,"orthoOffCenterLH",(t,s,i,r,n,l)=>{this.copyRawDataFrom([2/(s-t),0,0,0,0,2*n/(r-i),0,0,-1-2*t/(s-t),1+2*r/(i-r),1/(l-n),0,0,0,n/(n-l),1])});e(this,"orthoOffCenterRH",(t,s,i,r,n,l)=>{this.copyRawDataFrom([2/(s-t),0,0,0,0,2*n/(r-i),0,0,-1-2*t/(s-t),1+2*r/(i-r),1/(n-l),0,0,0,n/(n-l),1])});e(this,"_x",new x);e(this,"_y",new x);e(this,"_z",new x);e(this,"_w",new x);e(this,"_crossProductTo",(t,s)=>{this._w.x=t.y*s.z-t.z*s.y,this._w.y=t.z*s.x-t.x*s.z,this._w.z=t.x*s.y-t.y*s.x,this._w.w=1,t.copyFrom(this._w)})}}class f{}e(f,"stageWidth",800),e(f,"stageHeight",600),e(f,"autoSize",!1),e(f,"startTime",0),e(f,"drawCounter"),e(f,"batDrawCounter"),e(f,"debug",!1),e(f,"rootHTMLElement"),e(f,"renderer"),e(f,"canvasKit"),e(f,"dirtyGraphics",!0),e(f,"highDPI",!1),e(f,"images",{}),e(f,"sounds",{}),e(f,"videos",{}),e(f,"fonts",{}),e(f,"requestAnimationFrame",window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)});class nt extends Object{constructor(t=1,s=1,i=1,r=1,n=0,l=0,h=0,c=0){super();e(this,"_hexColor");e(this,"_redMultiplier");e(this,"_greenMultiplier");e(this,"_blueMultiplier");e(this,"_alphaMultiplier");e(this,"_rgba");e(this,"redOffset");e(this,"greenOffset");e(this,"blueOffset");e(this,"alphaOffset");e(this,"tint",4294967295);e(this,"updateRGBA",()=>{this._rgba=f.canvasKit.Color(this.color>>16&255,this.color>>8&255,this.color&255,this.alphaOffset)});this.redMultiplier=t,this.greenMultiplier=s,this.blueMultiplier=i,this.alphaMultiplier=r,this.redOffset=n,this.greenOffset=l,this.blueOffset=h,this.alphaOffset=c,this.updateRGBA()}get color(){return this.redOffset<<16|this.greenOffset<<8|this.blueOffset}set color(t){this.redMultiplier=this.greenMultiplier=this.blueMultiplier=0,this.redOffset=t>>16&255,this.greenOffset=t>>8&255,this.blueOffset=t&255,this.updateRGBA()}get rgba(){return this._rgba}get redMultiplier(){return this._redMultiplier}set redMultiplier(t){this._redMultiplier=t,this.tint=this._redMultiplier*255<<0|this._greenMultiplier*255<<8|this._blueMultiplier*255<<16|this._alphaMultiplier*255<<24,this.updateRGBA()}get greenMultiplier(){return this._greenMultiplier}set greenMultiplier(t){this._greenMultiplier=t,this.tint=this._redMultiplier*255<<0|this._greenMultiplier*255<<8|this._blueMultiplier*255<<16|this._alphaMultiplier*255<<24,this.updateRGBA()}get blueMultiplier(){return this._blueMultiplier}set blueMultiplier(t){this._blueMultiplier=t,this.tint=this._redMultiplier*255<<0|this._greenMultiplier*255<<8|this._blueMultiplier*255<<16|this._alphaMultiplier*255<<24,this.updateRGBA()}get alphaMultiplier(){return this._alphaMultiplier}set alphaMultiplier(t){this._alphaMultiplier=t,this.tint=this._redMultiplier*255<<0|this._greenMultiplier*255<<8|this._blueMultiplier*255<<16|this._alphaMultiplier*255<<24,this.updateRGBA()}concat(t){this.alphaOffset=this.alphaOffset+this.alphaMultiplier*t.alphaOffset,this.alphaMultiplier=this.alphaMultiplier*t.alphaMultiplier,this.redOffset=this.redOffset+this.redMultiplier*t.redOffset,this.redMultiplier=this.redMultiplier*t.redMultiplier,this.greenOffset=this.greenOffset+this.greenMultiplier*t.greenOffset,this.greenMultiplier=this.greenMultiplier*t.greenMultiplier,this.blueOffset=this.blueOffset+this.blueMultiplier*t.blueOffset,this.blueMultiplier=this.blueMultiplier*t.blueMultiplier,this.updateRGBA()}toString(){return"(redMultiplier="+this.redMultiplier+", greenMultiplier="+this.greenMultiplier+", blueMultiplier="+this.blueMultiplier+", alphaMultiplier="+this.alphaMultiplier+", redOffset="+this.redOffset+", greenOffset="+this.greenOffset+", blueOffset="+this.blueOffset+", alphaOffset="+this.alphaOffset+")"}}class he extends Object{constructor(){super();e(this,"_offsetX",0);e(this,"_offsetY",0)}_applyFilter(t,s,i,r,n,l){return null}clone(){return null}get offsetX(){return this._offsetX}get offsetY(){return this._offsetY}}class Ge extends he{get matrix(){return null}set matrix(a){}constructor(a=null){super()}}class Q{}e(Q,"numberToR",a=>(a&16711680)>>16),e(Q,"numberToG",a=>(a&65280)>>8),e(Q,"numberToB",a=>a&255),e(Q,"getObjectLength",a=>{var t=0;for(let s in a)t++;return t}),e(Q,"concatObjects",(...a)=>{for(var t={},s,i=0;i<a.length;i++){s=a[i];for(let r in s)s[r]==null?delete t[r]:t[r]=s[r]}return t});const ds=class{constructor(a,t,s,i,r,n){e(this,"scope");e(this,"properties");e(this,"timeStart");e(this,"timeComplete");e(this,"useFrames");e(this,"transition");e(this,"transitionParams");e(this,"onStart");e(this,"onUpdate");e(this,"onComplete");e(this,"onOverwrite");e(this,"onError");e(this,"onStartParams");e(this,"onUpdateParams");e(this,"onCompleteParams");e(this,"onOverwriteParams");e(this,"onStartScope");e(this,"onUpdateScope");e(this,"onCompleteScope");e(this,"onOverwriteScope");e(this,"onErrorScope");e(this,"rounded");e(this,"isPaused");e(this,"timePaused");e(this,"isCaller");e(this,"count");e(this,"timesCalled");e(this,"waitFrames");e(this,"skipUpdates");e(this,"updatesSkipped");e(this,"hasStarted");e(this,"isComplete");e(this,"clone",a=>{var t=new ds(this.scope,this.timeStart,this.timeComplete,this.useFrames,this.transition,this.transitionParams);t.properties=new Array;for(var s in this.properties)t.properties[s]=this.properties[s].clone();return t.skipUpdates=this.skipUpdates,t.updatesSkipped=this.updatesSkipped,a||(t.onStart=this.onStart,t.onUpdate=this.onUpdate,t.onComplete=this.onComplete,t.onOverwrite=this.onOverwrite,t.onError=this.onError,t.onStartParams=this.onStartParams,t.onUpdateParams=this.onUpdateParams,t.onCompleteParams=this.onCompleteParams,t.onOverwriteParams=this.onOverwriteParams,t.onStartScope=this.onStartScope,t.onUpdateScope=this.onUpdateScope,t.onCompleteScope=this.onCompleteScope,t.onOverwriteScope=this.onOverwriteScope,t.onErrorScope=this.onErrorScope),t.rounded=this.rounded,t.isPaused=this.isPaused,t.timePaused=this.timePaused,t.isCaller=this.isCaller,t.count=this.count,t.timesCalled=this.timesCalled,t.waitFrames=this.waitFrames,t.hasStarted=this.hasStarted,t});e(this,"toString",()=>{var a=` [TweenListObj `;a+="scope:"+String(this.scope),a+=", properties:";var t=!0;for(var s in this.properties)t||(a+=","),a+="[name:"+this.properties[s].name,a+=",valueStart:"+this.properties[s].valueStart,a+=",valueComplete:"+this.properties[s].valueComplete,a+="]",t=!1;return a+=", timeStart:"+String(this.timeStart),a+=", timeComplete:"+String(this.timeComplete),a+=", useFrames:"+String(this.useFrames),a+=", transition:"+String(this.transition),a+=", transitionParams:"+String(this.transitionParams),this.skipUpdates&&(a+=", skipUpdates:"+String(this.skipUpdates)),this.updatesSkipped&&(a+=", updatesSkipped:"+String(this.updatesSkipped)),Boolean(this.onStart)&&(a+=", onStart:"+String(this.onStart)),Boolean(this.onUpdate)&&(a+=", onUpdate:"+String(this.onUpdate)),Boolean(this.onComplete)&&(a+=", onComplete:"+String(this.onComplete)),Boolean(this.onOverwrite)&&(a+=", onOverwrite:"+String(this.onOverwrite)),Boolean(this.onError)&&(a+=", onError:"+String(this.onError)),this.onStartParams&&(a+=", onStartParams:"+String(this.onStartParams)),this.onUpdateParams&&(a+=", onUpdateParams:"+String(this.onUpdateParams)),this.onCompleteParams&&(a+=", onCompleteParams:"+String(this.onCompleteParams)),this.onOverwriteParams&&(a+=", onOverwriteParams:"+String(this.onOverwriteParams)),this.onStartScope&&(a+=", onStartScope:"+String(this.onStartScope)),this.onUpdateScope&&(a+=", onUpdateScope:"+String(this.onUpdateScope)),this.onCompleteScope&&(a+=", onCompleteScope:"+String(this.onCompleteScope)),this.onOverwriteScope&&(a+=", onOverwriteScope:"+String(this.onOverwriteScope)),this.onErrorScope&&(a+=", onErrorScope:"+String(this.onErrorScope)),this.rounded&&(a+=", rounded:"+String(this.rounded)),this.isPaused&&(a+=", isPaused:"+String(this.isPaused)),this.timePaused&&(a+=", timePaused:"+String(this.timePaused)),this.isCaller&&(a+=", isCaller:"+String(this.isCaller)),this.count&&(a+=", count:"+String(this.count)),this.timesCalled&&(a+=", timesCalled:"+String(this.timesCalled)),this.waitFrames&&(a+=", waitFrames:"+String(this.waitFrames)),this.hasStarted&&(a+=", hasStarted:"+String(this.hasStarted)),a+=`] `,a});this.scope=a,this.timeStart=t,this.timeComplete=s,this.useFrames=i,this.transition=r,this.transitionParams=n,this.properties=new Object,this.isPaused=!1,this.timePaused=void 0,this.isCaller=!1,this.updatesSkipped=0,this.timesCalled=0,this.skipUpdates=0,this.hasStarted=!1}};let Dt=ds;e(Dt,"makePropertiesChain",a=>{var t=a.base;if(t){var s={},i;if(t instanceof Array){i=[];for(var r=0;r<t.length;r++)i.push(t[r])}else i=[t];i.push(a);for(var n,l=i.length,h=0;h<l;h++)i[h].base?n=Q.concatObjects(ds.makePropertiesChain(i[h].base),i[h]):n=i[h],s=Q.concatObjects(s,n);return s.base&&delete s.base,s}else return a});class He{constructor(a,t,s,i,r,n,l,h){e(this,"valueStart");e(this,"valueComplete");e(this,"originalValueComplete");e(this,"arrayIndex");e(this,"extra");e(this,"isSpecialProperty");e(this,"hasModifier");e(this,"modifierFunction");e(this,"modifierParameters");e(this,"clone",()=>{var a=new He(this.valueStart,this.valueComplete,this.originalValueComplete,this.arrayIndex,this.extra,this.isSpecialProperty,this.modifierFunction,this.modifierParameters);return a});e(this,"toString",()=>{var a=` [PropertyInfoObj `;return a+="valueStart:"+String(this.valueStart),a+=", ",a+="valueComplete:"+String(this.valueComplete),a+=", ",a+="originalValueComplete:"+String(this.originalValueComplete),a+=", ",a+="arrayIndex:"+String(this.arrayIndex),a+=", ",a+="extra:"+String(this.extra),a+=", ",a+="isSpecialProperty:"+String(this.isSpecialProperty),a+=", ",a+="hasModifier:"+String(this.hasModifier),a+=", ",a+="modifierFunction:"+String(this.modifierFunction),a+=", ",a+="modifierParameters:"+String(this.modifierParameters),a+=`] `,a});this.valueStart=a,this.valueComplete=t,this.originalValueComplete=s,this.arrayIndex=i,this.extra=r,this.isSpecialProperty=n,this.hasModifier=Boolean(l),this.modifierFunction=l,this.modifierParameters=h}}class si{constructor(a,t){e(this,"parameters");e(this,"splitValues");e(this,"toString",()=>{var a="";return a+="[SpecialPropertySplitter ",a+="splitValues:"+this.splitValues.toString(),a+=", ",a+="parameters:"+this.parameters.toString(),a+="]",a});this.splitValues=a,this.parameters=t}}class ii{constructor(a,t,s=null,i=null){e(this,"getValue");e(this,"setValue");e(this,"parameters");e(this,"preProcess");e(this,"toString",()=>{var a="";return a+="[SpecialProperty ",a+="getValue:"+String(this.getValue),a+=", ",a+="setValue:"+String(this.setValue),a+=", ",a+="parameters:"+String(this.parameters),a+=", ",a+="preProcess:"+String(this.preProcess),a+="]",a});this.getValue=a,this.setValue=t,this.parameters=s,this.preProcess=i}}class ai{constructor(a,t){e(this,"modifyValues");e(this,"getValue");e(this,"toString",()=>{var a="";return a+="[SpecialPropertyModifier ",a+="modifyValues:"+this.modifyValues.toString(),a+=", ",a+="getValue:"+this.getValue.toString(),a+="]",a});this.modifyValues=a,this.getValue=t}}const ks=class extends Object{constructor(t,s=!1,i=!1){super();e(this,"_type");e(this,"_bubbles");e(this,"_cancelable");e(this,"_target");e(this,"_currentTarget");e(this,"_stopImmediatePropagation",!1);e(this,"ctor",(t,s,i)=>{this._type=t,this._bubbles=s,this._cancelable=i});this.ctor(t,s,i)}formatToString(t,...s){return null}clone(){return new ks(this.type,this.bubbles,this.cancelable)}toString(){return this.formatToString("Event","type","bubbles","cancelable","eventPhase")}get type(){return this._type}get bubbles(){return this._bubbles}get cancelable(){return this._cancelable}get target(){return this._target}set target(t){this._target=t}get currentTarget(){return this._currentTarget}set currentTarget(t){this._currentTarget=t}get eventPhase(){return 0}stopPropagation(){}stopImmediatePropagation(){this._stopImmediatePropagation=!0}preventDefault(){}isDefaultPrevented(){return!1}};let w=ks;e(w,"ACTIVATE","activate"),e(w,"ADDED","added"),e(w,"ADDED_TO_STAGE","addedToStage"),e(w,"BROWSER_ZOOM_CHANGE","browserZoomChange"),e(w,"CANCEL","cancel"),e(w,"CHANGE","change"),e(w,"CLEAR","clear"),e(w,"CLOSE","close"),e(w,"COMPLETE","complete"),e(w,"CONNECT","connect"),e(w,"COPY","copy"),e(w,"CUT","cut"),e(w,"DEACTIVATE","deactivate"),e(w,"ENTER_FRAME","enterFrame"),e(w,"FRAME_CONSTRUCTED","frameConstructed"),e(w,"EXIT_FRAME","exitFrame"),e(w,"FRAME_LABEL","frameLabel"),e(w,"ID3","id3"),e(w,"INIT","init"),e(w,"MOUSE_LEAVE","mouseLeave"),e(w,"OPEN","open"),e(w,"PASTE","paste"),e(w,"REMOVED","removed"),e(w,"REMOVED_FROM_STAGE","removedFromStage"),e(w,"RENDER","render"),e(w,"RESIZE","resize"),e(w,"SCROLL","scroll"),e(w,"TEXT_INTERACTION_MODE_CHANGE","textInteractionModeChange"),e(w,"SELECT","select"),e(w,"SELECT_ALL","selectAll"),e(w,"SOUND_COMPLETE","soundComplete"),e(w,"TAB_CHILDREN_CHANGE","tabChildrenChange"),e(w,"TAB_ENABLED_CHANGE","tabEnabledChange"),e(w,"TAB_INDEX_CHANGE","tabIndexChange"),e(w,"UNLOAD","unload"),e(w,"FULLSCREEN","fullScreen"),e(w,"CONTEXT3D_CREATE","context3DCreate"),e(w,"TEXTURE_READY","textureReady"),e(w,"VIDEO_FRAME","videoFrame"),e(w,"SUSPEND","suspend"),e(w,"CHANNEL_MESSAGE","channelMessage"),e(w,"CHANNEL_STATE","channelState"),e(w,"WORKER_STATE","workerState");function ye(){return Date.now()-f.startTime}const p=class{constructor(){console.log("Tweener is a static class and should not be instantiated.")}static setController(a){p.__tweener_controller__=a}};let v=p;e(v,"_mainTimeline"),e(v,"__tweener_controller__"),e(v,"_engineExists",!1),e(v,"_inited",!1),e(v,"_currentTime"),e(v,"_currentTimeFrame"),e(v,"_tweenList"),e(v,"_timeScale",1),e(v,"_transitionList"),e(v,"_specialPropertyList"),e(v,"_specialPropertyModifierList"),e(v,"_specialPropertySplitterList"),e(v,"autoOverwrite",!0),e(v,"addTween",(a=null,t=null)=>{if(!Boolean(a))return!1;var s,i,r,n;a instanceof Array?n=a.concat():n=[a];var l=Dt.makePropertiesChain(t);p._inited||p.init(),(!p._engineExists||!Boolean(p.__tweener_controller__))&&p.startEngine();var h=isNaN(l.time)?0:l.time,c=isNaN(l.delay)?0:l.delay,u=new Array,g={overwrite:!0,time:!0,delay:!0,useFrames:!0,skipUpdates:!0,transition:!0,transitionParams:!0,onStart:!0,onUpdate:!0,onComplete:!0,onOverwrite:!0,onError:!0,rounded:!0,onStartParams:!0,onUpdateParams:!0,onCompleteParams:!0,onOverwriteParams:!0,onStartScope:!0,onUpdateScope:!0,onCompleteScope:!0,onOverwriteScope:!0,onErrorScope:!0},m=new Object;for(r in l)if(!g[r])if(p._specialPropertySplitterList[r]){var E=p._specialPropertySplitterList[r].splitValues(l[r],p._specialPropertySplitterList[r].parameters);for(s=0;s<E.length;s++)if(p._specialPropertySplitterList[E[s].name]){var T=p._specialPropertySplitterList[E[s].name].splitValues(E[s].value,p._specialPropertySplitterList[E[s].name].parameters);for(i=0;i<T.length;i++)u[T[i].name]={valueStart:void 0,valueComplete:T[i].value,arrayIndex:T[i].arrayIndex,isSpecialProperty:!1}}else u[E[s].name]={valueStart:void 0,valueComplete:E[s].value,arrayIndex:E[s].arrayIndex,isSpecialProperty:!1}}else if(p._specialPropertyModifierList[r]!=null){var y=p._specialPropertyModifierList[r].modifyValues(l[r]);for(s=0;s<y.length;s++)m[y[s].name]={modifierParameters:y[s].parameters,modifierFunction:p._specialPropertyModifierList[r].getValue}}else u[r]={valueStart:void 0,valueComplete:l[r]};for(r in u)p._specialPropertyList[r]!=null?u[r].isSpecialProperty=!0:n[0][r]==null&&p.printError("The property '"+r+"' doesn't seem to be a normal object property of "+String(n[0])+" or a registered special property.");for(r in m)u[r]!=null&&(u[r].modifierParameters=m[r].modifierParameters,u[r].modifierFunction=m[r].modifierFunction);var M;if(typeof l.transition=="string"){var A=l.transition.toLowerCase();M=p._transitionList[A]}else M=l.transition;Boolean(M)||(M=p._transitionList.easeoutexpo);var P,L,B;for(s=0;s<n.length;s++){P=new Object;for(r in u)P[r]=new He(u[r].valueStart,u[r].valueComplete,u[r].valueComplete,u[r].arrayIndex,{},u[r].isSpecialProperty,u[r].modifierFunction,u[r].modifierParameters);l.useFrames==!0?L=new Dt(n[s],p._currentTimeFrame+c/p._timeScale,p._currentTimeFrame+(c+h)/p._timeScale,!0,M,l.transitionParams):L=new Dt(n[s],p._currentTime+c*1e3/p._timeScale,p._currentTime+(c*1e3+h*1e3)/p._timeScale,!1,M,l.transitionParams),L.isComplete=!1,L.properties=P,L.onStart=l.onStart,L.onUpdate=l.onUpdate,L.onComplete=l.onComplete,L.onOverwrite=l.onOverwrite,L.onError=l.onError,L.onStartParams=l.onStartParams,L.onUpdateParams=l.onUpdateParams,L.onCompleteParams=l.onCompleteParams,L.onOverwriteParams=l.onOverwriteParams,L.onStartScope=l.onStartScope,L.onUpdateScope=l.onUpdateScope,L.onCompleteScope=l.onCompleteScope,L.onOverwriteScope=l.onOverwriteScope,L.onErrorScope=l.onErrorScope,L.rounded=l.rounded,L.skipUpdates=l.skipUpdates,(l.overwrite==null?p.autoOverwrite:l.overwrite)&&p.removeTweensByTime(L.scope,L.properties,L.timeStart,L.timeComplete),p._tweenList.push(L),h==0&&c==0&&(B=p._tweenList.length-1,p.updateTweenByIndex(B),p.removeTweenByIndex(B))}return!0}),e(v,"addCaller",(a=null,t=null)=>{if(!Boolean(a))return!1;var s,i;a instanceof Array?i=a.concat():i=[a];var r=t;p._inited||p.init(),(!p._engineExists||!Boolean(p.__tweener_controller__))&&p.startEngine();var n=isNaN(r.time)?0:r.time,l=isNaN(r.delay)?0:r.delay,h;if(typeof r.transition=="string"){var c=r.transition.toLowerCase();h=p._transitionList[c]}else h=r.transition;Boolean(h)||(h=p._transitionList.easeoutexpo);var u,g;for(s=0;s<i.length;s++)r.useFrames==!0?u=new Dt(i[s],p._currentTimeFrame+l/p._timeScale,p._currentTimeFrame+(l+n)/p._timeScale,!0,h,r.transitionParams):u=new Dt(i[s],p._currentTime+l*1e3/p._timeScale,p._currentTime+(l*1e3+n*1e3)/p._timeScale,!1,h,r.transitionParams),u.properties=null,u.onStart=r.onStart,u.onUpdate=r.onUpdate,u.onComplete=r.onComplete,u.onOverwrite=r.onOverwrite,u.onStartParams=r.onStartParams,u.onUpdateParams=r.onUpdateParams,u.onCompleteParams=r.onCompleteParams,u.onOverwriteParams=r.onOverwriteParams,u.onStartScope=r.onStartScope,u.onUpdateScope=r.onUpdateScope,u.onCompleteScope=r.onCompleteScope,u.onOverwriteScope=r.onOverwriteScope,u.onErrorScope=r.onErrorScope,u.isCaller=!0,u.count=r.count,u.waitFrames=r.waitFrames,p._tweenList.push(u),n==0&&l==0&&(g=p._tweenList.length-1,p.updateTweenByIndex(g),p.removeTweenByIndex(g));return!0}),e(v,"removeTweensByTime",(a,t,s,i)=>{var r=!1,n,l,h=p._tweenList.length,c;for(l=0;l<h;l++)if(Boolean(p._tweenList[l])&&a==p._tweenList[l].scope&&i>p._tweenList[l].timeStart&&s<p._tweenList[l].timeComplete){n=!1;for(c in p._tweenList[l].properties)if(Boolean(t[c])){if(Boolean(p._tweenList[l].onOverwrite)){var u=Boolean(p._tweenList[l].onOverwriteScope)?p._tweenList[l].onOverwriteScope:p._tweenList[l].scope;try{p._tweenList[l].onOverwrite.apply(u,p._tweenList[l].onOverwriteParams)}catch(g){p.handleError(p._tweenList[l],g,"onOverwrite")}}p._tweenList[l].properties[c]=void 0,delete p._tweenList[l].properties[c],n=!0,r=!0}n&&Q.getObjectLength(p._tweenList[l].properties)==0&&p.removeTweenByIndex(l)}return r}),e(v,"removeTweens",(a,...t)=>{var s=new Array,i;for(i=0;i<t.length;i++)if(typeof t[i]=="string"&&s.indexOf(t[i])==-1)if(p._specialPropertySplitterList[t[i]])for(var r=p._specialPropertySplitterList[t[i]],n=r.splitValues(a,null),l=0;l<n.length;l++)s.push(n[l].name);else s.push(t[i]);return p.affectTweens(p.removeTweenByIndex,a,s)}),e(v,"removeAllTweens",()=>{if(!Boolean(p._tweenList))return!1;var a=!1,t;for(t=0;t<p._tweenList.length;t++)p.removeTweenByIndex(t),a=!0;return a}),e(v,"pauseTweens",(a,...t)=>{var s=new Array,i;for(i=0;i<t.length;i++)typeof t[i]=="string"&&s.indexOf(t[i])==-1&&s.push(t[i]);return p.affectTweens(p.pauseTweenByIndex,a,s)}),e(v,"pauseAllTweens",()=>{if(!Boolean(p._tweenList))return!1;var a=!1,t;for(t=0;t<p._tweenList.length;t++)p.pauseTweenByIndex(t),a=!0;return a}),e(v,"resumeTweens",(a,...t)=>{var s=new Array,i;for(i=0;i<t.length;i++)typeof t[i]=="string"&&s.indexOf(t[i])==-1&&s.push(t[i]);return p.affectTweens(p.resumeTweenByIndex,a,s)}),e(v,"resumeAllTweens",()=>{if(!Boolean(p._tweenList))return!1;var a=!1,t;for(t=0;t<p._tweenList.length;t++)p.resumeTweenByIndex(t),a=!0;return a}),e(v,"affectTweens",(a,t,s)=>{var i=!1,r;if(!Boolean(p._tweenList))return!1;for(r=0;r<p._tweenList.length;r++)if(p._tweenList[r]&&p._tweenList[r].scope==t)if(s.length==0)a(r),i=!0;else{var n=new Array,l;for(l=0;l<s.length;l++)Boolean(p._tweenList[r].properties[s[l]])&&n.push(s[l]);if(n.length>0){var h=Q.getObjectLength(p._tweenList[r].properties);if(h==n.length)a(r),i=!0;else{var c=p.splitTweens(r,n);a(c),i=!0}}}return i}),e(v,"splitTweens",(a,t)=>{var s=p._tweenList[a],i=s.clone(!1),r,n;for(r=0;r<t.length;r++)n=t[r],Boolean(s.properties[n])&&(s.properties[n]=void 0,delete s.properties[n]);var l;for(n in i.properties){for(l=!1,r=0;r<t.length;r++)if(t[r]==n){l=!0;break}l||(i.properties[n]=void 0,delete i.properties[n])}return p._tweenList.push(i),p._tweenList.length-1}),e(v,"updateTweens",()=>{if(p._tweenList.length==0)return!1;var a;for(a=0;a<p._tweenList.length;a++)(p._tweenList[a]==null||!p._tweenList[a].isPaused)&&(p.updateTweenByIndex(a)||p.removeTweenByIndex(a),p._tweenList[a]==null&&(p.removeTweenByIndex(a,!0),a--));return!0}),e(v,"removeTweenByIndex",(a,t=!1)=>(p._tweenList[a]=null,t&&p._tweenList.splice(a,1),!0)),e(v,"pauseTweenByIndex",a=>{var t=p._tweenList[a];return t==null||t.isPaused?!1:(t.timePaused=p.getCurrentTweeningTime(t),t.isPaused=!0,!0)}),e(v,"resumeTweenByIndex",a=>{var t=p._tweenList[a];if(t==null||!t.isPaused)return!1;var s=p.getCurrentTweeningTime(t);return t.timeStart+=s-t.timePaused,t.timeComplete+=s-t.timePaused,t.timePaused=0,t.isPaused=!1,!0}),e(v,"updateTweenByIndex",a=>{var t=p._tweenList[a];if(t==null||!Boolean(t.scope))return!1;var s=!1,i,r,n,l,h,c,u,g,m,E=p.getCurrentTweeningTime(t),T;if(E>=t.timeStart){if(m=t.scope,t.isCaller){if(!t.hasStarted){if(Boolean(t.onStart)){g=Boolean(t.onStartScope)?t.onStartScope:m;try{t.onStart.apply(g,t.onStartParams)}catch(M){p.handleError(t,M,"onStart")}}t.hasStarted=!0}do if(n=(t.timeComplete-t.timeStart)/t.count*(t.timesCalled+1),l=t.timeStart,h=t.timeComplete-t.timeStart,c=t.timeComplete-t.timeStart,r=t.transition(n,l,h,c),E>=r){if(Boolean(t.onUpdate)){g=Boolean(t.onUpdateScope)?t.onUpdateScope:m;try{t.onUpdate.apply(g,t.onUpdateParams)}catch(M){p.handleError(t,M,"onUpdate")}}if(t.timesCalled++,t.timesCalled>=t.count){s=!0;break}if(t.waitFrames)break}while(E>=r)}else{if(i=t.skipUpdates<1||!t.skipUpdates||t.updatesSkipped>=t.skipUpdates,E>=t.timeComplete&&(s=!0,i=!0),!t.hasStarted){if(Boolean(t.onStart)){g=Boolean(t.onStartScope)?t.onStartScope:m;try{t.onStart.apply(g,t.onStartParams)}catch(M){p.handleError(t,M,"onStart")}}var y;for(u in t.properties)t.properties[u].isSpecialProperty?(Boolean(p._specialPropertyList[u].preProcess)&&(t.properties[u].valueComplete=p._specialPropertyList[u].preProcess(m,p._specialPropertyList[u].parameters,t.properties[u].originalValueComplete,t.properties[u].extra)),y=p._specialPropertyList[u].getValue(m,p._specialPropertyList[u].parameters,t.properties[u].extra)):y=m[u],t.properties[u].valueStart=isNaN(y)?t.properties[u].valueComplete:y;i=!0,t.hasStarted=!0}if(i){for(u in t.properties)T=t.properties[u],s?r=T.valueComplete:T.hasModifier?(n=E-t.timeStart,c=t.timeComplete-t.timeStart,r=t.transition(n,0,1,c,t.transitionParams),r=T.modifierFunction(T.valueStart,T.valueComplete,r,T.modifierParameters)):(n=E-t.timeStart,l=T.valueStart,h=T.valueComplete-T.valueStart,c=t.timeComplete-t.timeStart,r=t.transition(n,l,h,c,t.transitionParams)),t.rounded&&(r=Math.round(r)),T.isSpecialProperty?p._specialPropertyList[u].setValue(m,r,p._specialPropertyList[u].parameters,t.properties[u].extra):m[u]=r;if(t.updatesSkipped=0,Boolean(t.onUpdate)){g=Boolean(t.onUpdateScope)?t.onUpdateScope:m;try{t.onUpdate.apply(g,t.onUpdateParams)}catch(M){p.handleError(t,M,"onUpdate")}}}else t.updatesSkipped++}if(s&&Boolean(t.onComplete)){g=Boolean(t.onCompleteScope)?t.onCompleteScope:m;try{t.isComplete=!0,t.onComplete.apply(g,t.onCompleteParams)}catch(M){p.handleError(t,M,"onComplete")}}return!s}return!0}),e(v,"init",(...a)=>{p._inited=!0,p._transitionList=new Object,p._specialPropertyList=new Object,p._specialPropertyModifierList=new Object,p._specialPropertySplitterList=new Object}),e(v,"registerTransition",(a,t)=>{p._inited||p.init(),p._transitionList[a]=t}),e(v,"registerSpecialProperty",(a,t,s,i=[],r)=>{p._inited||p.init();var n=new ii(t,s,i,r);p._specialPropertyList[a]=n}),e(v,"registerSpecialPropertyModifier",(a,t,s)=>{p._inited||p.init();var i=new ai(t,s);p._specialPropertyModifierList[a]=i}),e(v,"registerSpecialPropertySplitter",(a,t,s=[])=>{p._inited||p.init();var i=new si(t,s);p._specialPropertySplitterList[a]=i}),e(v,"startEngine",()=>{p._tweenList=new Array,p._engineExists=!0,p.__tweener_controller__.addEventListener(w.ENTER_FRAME,p.onEnterFrame),p._currentTimeFrame=0,p.updateTime()}),e(v,"stopEngine",()=>{p._engineExists=!1,p._tweenList=[],p._currentTime=0,p._currentTimeFrame=0,p.__tweener_controller__.removeEventListener(w.ENTER_FRAME,p.onEnterFrame)}),e(v,"updateTime",()=>{p._currentTime=ye()}),e(v,"updateFrame",()=>{p._currentTimeFrame++}),e(v,"onEnterFrame",a=>{p.updateTime(),p.updateFrame();var t=!1;t=p.updateTweens(),t||p.stopEngine()}),e(v,"setTimeScale",a=>{var t,s;if(isNaN(a)&&(a=1),a<1e-5&&(a=1e-5),a!=p._timeScale){if(p._tweenList!=null)for(t=0;t<p._tweenList.length;t++)s=p.getCurrentTweeningTime(p._tweenList[t]),p._tweenList[t].timeStart=s-(s-p._tweenList[t].timeStart)*p._timeScale/a,p._tweenList[t].timeComplete=s-(s-p._tweenList[t].timeComplete)*p._timeScale/a,p._tweenList[t].timePaused!=null&&(p._tweenList[t].timePaused=s-(s-p._tweenList[t].timePaused)*p._timeScale/a);p._timeScale=a}}),e(v,"isTweening",a=>{if(!Boolean(p._tweenList))return!1;var t;for(t=0;t<p._tweenList.length;t++)if(Boolean(p._tweenList[t])&&p._tweenList[t].scope==a&&!p._tweenList[t].isComplete)return!0;return!1}),e(v,"getTweens",a=>{if(!Boolean(p._tweenList))return[];var t,s,i=new Array;for(t=0;t<p._tweenList.length;t++)if(Boolean(p._tweenList[t])&&p._tweenList[t].scope==a)for(s in p._tweenList[t].properties)i.push(s);return i}),e(v,"getTweenCount",a=>{if(!Boolean(p._tweenList))return 0;var t,s=0;for(t=0;t<p._tweenList.length;t++)Boolean(p._tweenList[t])&&p._tweenList[t].scope==a&&(s+=Q.getObjectLength(p._tweenList[t].properties));return s}),e(v,"handleError",(a,t,s)=>{if(Boolean(a.onError)&&a.onError instanceof Function){var i=Boolean(a.onErrorScope)?a.onErrorScope:a.scope;try{a.onError.apply(i,[a.scope,t])}catch(r){p.printError(String(a.scope)+` raised an error while executing the 'onError' handler. Original error: `+t.stack+` onError error: `+r.stack)}}else Boolean(a.onError)||p.printError(String(a.scope)+" raised an error while executing the '"+s+`'handler. `+t.stack)}),e(v,"getCurrentTweeningTime",a=>a.useFrames?p._currentTimeFrame:p._currentTime),e(v,"getVersion",()=>"AS3 1.33.74"),e(v,"printError",a=>{console.log("## [Tweener] Error: "+a)});const N=class{constructor(){console.log("This is an static class and should not be instantiated.")}};let U=N;e(U,"LUMINANCE_R",.212671),e(U,"LUMINANCE_G",.71516),e(U,"LUMINANCE_B",.072169),e(U,"init",()=>{v.registerSpecialProperty("_color_ra",N._oldColor_property_get,N._oldColor_property_set,["redMultiplier"]),v.registerSpecialProperty("_color_rb",N._color_property_get,N._color_property_set,["redOffset"]),v.registerSpecialProperty("_color_ga",N._oldColor_property_get,N._oldColor_property_set,["greenMultiplier"]),v.registerSpecialProperty("_color_gb",N._color_property_get,N._color_property_set,["greenOffset"]),v.registerSpecialProperty("_color_ba",N._oldColor_property_get,N._oldColor_property_set,["blueMultiplier"]),v.registerSpecialProperty("_color_bb",N._color_property_get,N._color_property_set,["blueOffset"]),v.registerSpecialProperty("_color_aa",N._oldColor_property_get,N._oldColor_property_set,["alphaMultiplier"]),v.registerSpecialProperty("_color_ab",N._color_property_get,N._color_property_set,["alphaOffset"]),v.registerSpecialProperty("_color_redMultiplier",N._color_property_get,N._color_property_set,["redMultiplier"]),v.registerSpecialProperty("_color_redOffset",N._color_property_get,N._color_property_set,["redOffset"]),v.registerSpecialProperty("_color_greenMultiplier",N._color_property_get,N._color_property_set,["greenMultiplier"]),v.registerSpecialProperty("_color_greenOffset",N._color_property_get,N._color_property_set,["greenOffset"]),v.registerSpecialProperty("_color_blueMultiplier",N._color_property_get,N._color_property_set,["blueMultiplier"]),v.registerSpecialProperty("_color_blueOffset",N._color_property_get,N._color_property_set,["blueOffset"]),v.registerSpecialProperty("_color_alphaMultiplier",N._color_property_get,N._color_property_set,["alphaMultiplier"]),v.registerSpecialProperty("_color_alphaOffset",N._color_property_get,N._color_property_set,["alphaOffset"]),v.registerSpecialPropertySplitter("_color",N._color_splitter),v.registerSpecialPropertySplitter("_colorTransform",N._colorTransform_splitter),v.registerSpecialProperty("_brightness",N._brightness_get,N._brightness_set,[!1]),v.registerSpecialProperty("_tintBrightness",N._brightness_get,N._brightness_set,[!0]),v.registerSpecialProperty("_contrast",N._contrast_get,N._contrast_set),v.registerSpecialProperty("_hue",N._hue_get,N._hue_set),v.registerSpecialProperty("_saturation",N._saturation_get,N._saturation_set,[!1]),v.registerSpecialProperty("_dumbSaturation",N._saturation_get,N._saturation_set,[!0])}),e(U,"_color_splitter",(a,t)=>{var s=new Array;return a==null?(s.push({name:"_color_redMultiplier",value:1}),s.push({name:"_color_redOffset",value:0}),s.push({name:"_color_greenMultiplier",value:1}),s.push({name:"_color_greenOffset",value:0}),s.push({name:"_color_blueMultiplier",value:1}),s.push({name:"_color_blueOffset",value:0})):(s.push({name:"_color_redMultiplier",value:0}),s.push({name:"_color_redOffset",value:Q.numberToR(a)}),s.push({name:"_color_greenMultiplier",value:0}),s.push({name:"_color_greenOffset",value:Q.numberToG(a)}),s.push({name:"_color_blueMultiplier",value:0}),s.push({name:"_color_blueOffset",value:Q.numberToB(a)})),s}),e(U,"_colorTransform_splitter",(a,t)=>{var s=new Array;return a==null?(s.push({name:"_color_redMultiplier",value:1}),s.push({name:"_color_redOffset",value:0}),s.push({name:"_color_greenMultiplier",value:1}),s.push({name:"_color_greenOffset",value:0}),s.push({name:"_color_blueMultiplier",value:1}),s.push({name:"_color_blueOffset",value:0})):(s.push({name:"_color_redMultiplier",value:a.redMultiplier}),s.push({name:"_color_redOffset",value:a.redOffset}),s.push({name:"_color_blueMultiplier",value:a.blueMultiplier}),s.push({name:"_color_blueOffset",value:a.blueOffset}),s.push({name:"_color_greenMultiplier",value:a.greenMultiplier}),s.push({name:"_color_greenOffset",value:a.greenOffset}),s.push({name:"_color_alphaMultiplier",value:a.alphaMultiplier}),s.push({name:"_color_alphaOffset",value:a.alphaOffset})),s}),e(U,"_oldColor_property_get",(a,t,s=null)=>a.transform.colorTransform[t[0]]*100),e(U,"_oldColor_property_set",(a,t,s,i=null)=>{var r=a.transform.colorTransform;r[s[0]]=t/100,a.transform.colorTransform=r}),e(U,"_color_property_get",(a,t,s=null)=>a.transform.colorTransform[t[0]]),e(U,"_color_property_set",(a,t,s,i=null)=>{var r=a.transform.colorTransform;r[s[0]]=t,a.transform.colorTransform=r}),e(U,"_brightness_get",(a,t,s=null)=>{var i=t[0],r=a.transform.colorTransform,n=1-(r.redMultiplier+r.greenMultiplier+r.blueMultiplier)/3,l=(r.redOffset+r.greenOffset+r.blueOffset)/3;return i?l>0?l/255:-n:l/100}),e(U,"_brightness_set",(a,t,s,i=null)=>{var r=s[0],n,l;r?(n=1-Math.abs(t),l=t>0?Math.round(t*255):0):(n=1,l=Math.round(t*100));var h=new nt(n,n,n,1,l,l,l,0);a.transform.colorTransform=h}),e(U,"_saturation_get",(a,t,s=null)=>{var i=N.getObjectMatrix(a),r=t[0],n=r?1/3:N.LUMINANCE_R,l=r?1/3:N.LUMINANCE_G,h=r?1/3:N.LUMINANCE_B,c=((i[0]-n)/(1-n)+(i[6]-l)/(1-l)+(i[12]-h)/(1-h))/3,u=1-(i[1]/l+i[2]/h+i[5]/n+i[7]/h+i[10]/n+i[11]/l)/6;return(c+u)/2}),e(U,"_saturation_set",(a,t,s,i=null)=>{var r=s[0],n=r?1/3:N.LUMINANCE_R,l=r?1/3:N.LUMINANCE_G,h=r?1/3:N.LUMINANCE_B,c=t,u=1-c,g=n*u,m=l*u,E=h*u,T=[g+c,m,E,0,0,g,m+c,E,0,0,g,m,E+c,0,0,0,0,0,1,0];N.setObjectMatrix(a,T)}),e(U,"_contrast_get",(a,t,s=null)=>{var i=a.transform.colorTransform,r,n;return r=(i.redMultiplier+i.greenMultiplier+i.blueMultiplier)/3-1,n=(i.redOffset+i.greenOffset+i.blueOffset)/3/-128,(r+n)/2}),e(U,"_contrast_set",(a,t,s,i=null)=>{var r,n;r=t+1,n=Math.round(t*-128);var l=new nt(r,r,r,1,n,n,n,0);a.transform.colorTransform=l}),e(U,"_hue_get",(a,t,s=null)=>{var i=N.getObjectMatrix(a),r=[],n;for(r[0]={angle:-179.9,matrix:N.getHueMatrix(-179.9)},r[1]={angle:180,matrix:N.getHueMatrix(180)},n=