this.PIXI=this.PIXI||{},function(t,e,i,s,r,a,n,h){"use strict";class o{constructor(t,e,i){this.value=t,this.time=e,this.next=null,this.isStepped=!1,this.ease=i?"function"==typeof i?i:x(i):null}static createList(t){if("list"in t){const e=t.list;let i;const{value:s,time:r}=e[0],a=i=new o("string"==typeof s?g(s):s,r,t.ease);if(e.length>2||2===e.length&&e[1].value!==s)for(let t=1;tn.time;)r=n,n=t[++a];h=(h-r.time)/(n.time-r.time);const l=g(r.value),c=g(n.value),d={r:(c.r-l.r)*h+l.r,g:(c.g-l.g)*h+l.g,b:(c.b-l.b)*h+l.b};s.next=new o(d,i/e),s=s.next}return i}};class P extends s.Sprite{constructor(t){super(),this.prevChild=this.nextChild=null,this.emitter=t,this.config={},this.anchor.x=this.anchor.y=.5,this.maxLife=0,this.age=0,this.agePercent=0,this.oneOverLife=0,this.next=null,this.prev=null,this.init=this.init,this.kill=this.kill}init(t){this.maxLife=t,this.age=this.agePercent=0,this.rotation=0,this.position.x=this.position.y=0,this.scale.x=this.scale.y=1,this.tint=16777215,this.alpha=1,this.oneOverLife=1/this.maxLife,this.visible=!0}kill(){this.emitter.recycle(this)}destroy(){this.parent&&this.parent.removeChild(this),this.emitter=this.next=this.prev=null,super.destroy()}}!function(t){t[t.Spawn=0]="Spawn",t[t.Normal=2]="Normal",t[t.Late=5]="Late"}(_||(_={}));const w=n.Ticker.shared,b=Symbol("Position particle per emitter position");class S{constructor(t,e){this.initBehaviors=[],this.updateBehaviors=[],this.recycleBehaviors=[],this.minLifetime=0,this.maxLifetime=0,this.customEase=null,this._frequency=1,this.spawnChance=1,this.maxParticles=1e3,this.emitterLifetime=-1,this.spawnPos=new a.Point,this.particlesPerWave=1,this.rotation=0,this.ownerPos=new a.Point,this._prevEmitterPos=new a.Point,this._prevPosIsValid=!1,this._posChanged=!1,this._parent=null,this.addAtBack=!1,this.particleCount=0,this._emit=!1,this._spawnTimer=0,this._emitterLife=-1,this._activeParticlesFirst=null,this._activeParticlesLast=null,this._poolFirst=null,this._origConfig=null,this._autoUpdate=!1,this._destroyWhenComplete=!1,this._completeCallback=null,this.parent=t,e&&this.init(e),this.recycle=this.recycle,this.update=this.update,this.rotate=this.rotate,this.updateSpawnPos=this.updateSpawnPos,this.updateOwnerPos=this.updateOwnerPos}static registerBehavior(t){S.knownBehaviors[t.type]=t}get frequency(){return this._frequency}set frequency(t){this._frequency="number"==typeof t&&t>0?t:1}get parent(){return this._parent}set parent(t){this.cleanup(),this._parent=t}init(t){if(!t)return;this.cleanup(),this._origConfig=t,this.minLifetime=t.lifetime.min,this.maxLifetime=t.lifetime.max,t.ease?this.customEase="function"==typeof t.ease?t.ease:x(t.ease):this.customEase=null,this.particlesPerWave=1,t.particlesPerWave&&t.particlesPerWave>1&&(this.particlesPerWave=t.particlesPerWave),this.frequency=t.frequency,this.spawnChance="number"==typeof t.spawnChance&&t.spawnChance>0?t.spawnChance:1,this.emitterLifetime=t.emitterLifetime||-1,this.maxParticles=t.maxParticles>0?t.maxParticles:1e3,this.addAtBack=!!t.addAtBack,this.rotation=0,this.ownerPos.set(0),t.pos?this.spawnPos.copyFrom(t.pos):this.spawnPos.set(0),this._prevEmitterPos.copyFrom(this.spawnPos),this._prevPosIsValid=!1,this._spawnTimer=0,this.emit=void 0===t.emit||!!t.emit,this.autoUpdate=!!t.autoUpdate;const e=t.behaviors.map(t=>{const e=S.knownBehaviors[t.type];return e?new e(t.config):(console.error(`Unknown behavior: ${t.type}`),null)}).filter(t=>!!t);e.push(b),e.sort((t,e)=>t===b?e.order===_.Spawn?1:-1:e===b?t.order===_.Spawn?-1:1:t.order-e.order),this.initBehaviors=e.slice(),this.updateBehaviors=e.filter(t=>t!==b&&t.updateParticle),this.recycleBehaviors=e.filter(t=>t!==b&&t.recycleParticle)}getBehavior(t){return this.initBehaviors.find(e=>e instanceof S.knownBehaviors[t])||null}fillPool(t){for(;t>0;--t){const t=new P(this);t.next=this._poolFirst,this._poolFirst=t}}recycle(t,e=!1){for(let i=0;ii.maxLife||i.age<0)this.recycle(i);else{let e=i.age*i.oneOverLife;this.customEase&&(e=4===this.customEase.length?this.customEase(e,0,1,1):this.customEase(e)),i.agePercent=e;for(let e=0;e=0&&(this._emitterLife-=this._frequency,this._emitterLife<=0)){this._spawnTimer=0,this._emitterLife=0,this.emit=!1;break}if(this.particleCount>=this.maxParticles){this._spawnTimer+=this._frequency;continue}let r,n;if(this._prevPosIsValid&&this._posChanged){const h=1+this._spawnTimer/t;r=(s-e)*h+e,n=(a-i)*h+i}else r=s,n=a;let h=null,o=null;for(let t=Math.min(this.particlesPerWave,this.maxParticles-this.particleCount),e=0;e=this.spawnChance)continue;let t,e;(t=this.minLifetime===this.maxLifetime?this.minLifetime:Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,-this._spawnTimer>=t)||(this._poolFirst?(e=this._poolFirst,this._poolFirst=this._poolFirst.next,e.next=null):e=new P(this),e.init(t),this.addAtBack?this._parent.addChildAt(e,0):this._parent.addChild(e),h?(o.next=e,e.prev=o,o=e):o=h=e,++this.particleCount)}if(h){this._activeParticlesLast?(this._activeParticlesLast.next=h,h.prev=this._activeParticlesLast,this._activeParticlesLast=o):(this._activeParticlesFirst=h,this._activeParticlesLast=o);for(let e=0;e=this.spawnChance)continue;let t,e;this._poolFirst?(t=this._poolFirst,this._poolFirst=this._poolFirst.next,t.next=null):t=new P(this),e=this.minLifetime===this.maxLifetime?this.minLifetime:Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,t.init(e),this.addAtBack?this._parent.addChildAt(t,0):this._parent.addChild(t),i?(s.next=t,t.prev=s,s=t):s=i=t,++this.particleCount}if(i){this._activeParticlesLast?(this._activeParticlesLast.next=i,i.prev=this._activeParticlesLast,this._activeParticlesLast=s):(this._activeParticlesFirst=i,this._activeParticlesLast=s);for(let s=0;sthis.maxSpeed&&v(i,this.maxSpeed/t)}t.x+=(s+i.x)/2*e,t.y+=(r+i.y)/2*e,this.rotate&&(t.rotation=Math.atan2(i.y,i.x))}}function A(t){return this.ease&&(t=this.ease(t)),(this.first.next.value-this.first.value)*t+this.first.value}function R(t){this.ease&&(t=this.ease(t));const e=this.first.value,i=this.first.next.value;return u((i.r-e.r)*t+e.r,(i.g-e.g)*t+e.g,(i.b-e.b)*t+e.b)}function T(t){this.ease&&(t=this.ease(t));let e=this.first,i=e.next;for(;t>i.time;)e=i,i=i.next;return t=(t-e.time)/(i.time-e.time),(i.value-e.value)*t+e.value}function k(t){this.ease&&(t=this.ease(t));let e=this.first,i=e.next;for(;t>i.time;)e=i,i=i.next;t=(t-e.time)/(i.time-e.time);const s=e.value,r=i.value;return u((r.r-s.r)*t+s.r,(r.g-s.g)*t+s.g,(r.b-s.b)*t+s.b)}function D(t){this.ease&&(t=this.ease(t));let e=this.first;for(;e.next&&t>e.next.time;)e=e.next;return e.value}function F(t){this.ease&&(t=this.ease(t));let e=this.first;for(;e.next&&t>e.next.time;)e=e.next;const i=e.value;return u(i.r,i.g,i.b)}I.type="moveAcceleration",I.editorConfig=null;class O{constructor(t=!1){this.first=null,this.isColor=!!t,this.interpolate=null,this.ease=null}reset(t){this.first=t,t.next&&t.next.time>=1?this.interpolate=this.isColor?R:A:t.isStepped?this.interpolate=this.isColor?F:D:this.interpolate=this.isColor?k:T,this.ease=this.first.ease}}class N{constructor(t){this.order=_.Normal,this.list=new O(!1),this.list.reset(o.createList(t.alpha))}initParticles(t){let e=t;for(;e;)e.alpha=this.list.first.value,e=e.next}updateParticle(t){t.alpha=this.list.interpolate(t.agePercent)}}N.type="alpha",N.editorConfig=null;class U{constructor(t){this.order=_.Normal,this.value=t.alpha}initParticles(t){let e=t;for(;e;)e.alpha=this.value,e=e.next}}function q(t){const i=[];for(let s=0;s0;--t)i.push(r)}}return i}U.type="alphaStatic",U.editorConfig=null;class W{constructor(t){this.order=_.Normal,this.anims=[];for(let e=0;e0?i.framerate:60,a={textures:s,duration:r>0?s.length/r:0,framerate:r,loop:r>0&&!!i.loop};this.anims.push(a)}}initParticles(t){let e=t;for(;e;){const t=Math.floor(Math.random()*this.anims.length),i=e.config.anim=this.anims[t];e.texture=i.textures[0],e.config.animElapsed=0,-1===i.framerate?(e.config.animDuration=e.maxLife,e.config.animFramerate=i.textures.length/e.maxLife):(e.config.animDuration=i.duration,e.config.animFramerate=i.framerate),e=e.next}}updateParticle(t,i){const s=t.config,r=s.anim;s.animElapsed+=i,s.animElapsed>=s.animDuration&&(s.anim.loop?s.animElapsed=s.animElapsed%s.animDuration:s.animElapsed=s.animDuration-1e-6);const a=s.animElapsed*s.animFramerate+1e-7|0;t.texture=r.textures[a]||r.textures[r.textures.length-1]||e.Texture.EMPTY}}W.type="animatedRandom",W.editorConfig=null;class X{constructor(t){this.order=_.Normal;const e=t.anim,i=q(e.textures),s=e.framerate<0?-1:e.framerate>0?e.framerate:60;this.anim={textures:i,duration:s>0?i.length/s:0,framerate:s,loop:s>0&&!!e.loop}}initParticles(t){let e=t;const i=this.anim;for(;e;)e.texture=i.textures[0],e.config.animElapsed=0,-1===i.framerate?(e.config.animDuration=e.maxLife,e.config.animFramerate=i.textures.length/e.maxLife):(e.config.animDuration=i.duration,e.config.animFramerate=i.framerate),e=e.next}updateParticle(t,i){const s=this.anim,r=t.config;r.animElapsed+=i,r.animElapsed>=r.animDuration&&(r.anim.loop?r.animElapsed=r.animElapsed%r.animDuration:r.animElapsed=r.animDuration-1e-6);const a=r.animElapsed*r.animFramerate+1e-7|0;t.texture=s.textures[a]||s.textures[s.textures.length-1]||e.Texture.EMPTY}}X.type="animatedSingle",X.editorConfig=null;class ${constructor(t){this.order=_.Normal,this.value=t.blendMode}initParticles(t){let e=t;for(;e;)e.blendMode=C(this.value),e=e.next}}$.type="blendMode",$.editorConfig=null;class G{constructor(t){this.order=_.Spawn,this.spacing=t.spacing*d,this.start=t.start*d,this.distance=t.distance}initParticles(t){let e=0,i=t;for(;i;){let t;t=this.spacing?this.start+this.spacing*e:Math.random()*Math.PI*2,i.rotation=t,this.distance&&(i.position.x=this.distance,p(t,i.position)),i=i.next,++e}}}G.type="spawnBurst",G.editorConfig=null;class j{constructor(t){this.order=_.Normal,this.list=new O(!0),this.list.reset(o.createList(t.color))}initParticles(t){let e=t;const i=this.list.first.value,s=u(i.r,i.g,i.b);for(;e;)e.tint=s,e=e.next}updateParticle(t){t.tint=this.list.interpolate(t.agePercent)}}j.type="color",j.editorConfig=null;class V{constructor(t){this.order=_.Normal;let e=t.color;"#"===e.charAt(0)?e=e.substr(1):0===e.indexOf("0x")&&(e=e.substr(2)),this.value=parseInt(e,16)}initParticles(t){let e=t;for(;e;)e.tint=this.value,e=e.next}}V.type="colorStatic",V.editorConfig=null;class Q{constructor(t){this.order=_.Normal,this.index=0,this.textures=t.textures.map(t=>"string"==typeof t?l(t):t)}initParticles(t){let e=t;for(;e;)e.texture=this.textures[this.index],++this.index>=this.textures.length&&(this.index=0),e=e.next}}Q.type="textureOrdered",Q.editorConfig=null;const Y=new a.Point,z=["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2","abs","acos","acosh","asin","asinh","atan","atanh","atan2","cbrt","ceil","cos","cosh","exp","expm1","floor","fround","hypot","log","log1p","log10","log2","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh"],H=new RegExp(["[01234567890\\.\\*\\-\\+\\/\\(\\)x ,]"].concat(z).join("|"),"g");class J{constructor(t){var e;if(this.order=_.Late,t.path)if("function"==typeof t.path)this.path=t.path;else try{this.path=function(t){const e=t.match(H);for(let t=e.length-1;t>=0;--t)z.indexOf(e[t])>=0&&(e[t]=`Math.${e[t]}`);return t=e.join(""),new Function("x",`return ${t};`)}(t.path)}catch(t){c&&console.error("PathParticle: error in parsing path expression",t),this.path=null}else c&&console.error("PathParticle requires a path value in its config!"),this.path=(t=>t);this.list=new O(!1),this.list.reset(o.createList(t.speed)),this.minMult=null!==(e=t.minMult)&&void 0!==e?e:1}initParticles(t){let e=t;for(;e;){e.config.initRotation=e.rotation,e.config.initPosition?e.config.initPosition.copyFrom(e.position):e.config.initPosition=new a.Point(e.x,e.y),e.config.movement=0;const t=Math.random()*(1-this.minMult)+this.minMult;e.config.speedMult=t,e=e.next}}updateParticle(t,e){const i=this.list.interpolate(t.agePercent)*t.config.speedMult;t.config.movement+=i*e,Y.x=t.config.movement,Y.y=this.path(Y.x),p(t.config.initRotation,Y),t.position.x=t.config.initPosition.x+Y.x,t.position.y=t.config.initPosition.y+Y.y}}J.type="movePath",J.editorConfig=null;class K{constructor(){this.order=_.Spawn}initParticles(t){}}K.type="spawnPoint",K.editorConfig=null;class Z{constructor(t){this.order=_.Normal,this.textures=t.textures.map(t=>"string"==typeof t?l(t):t)}initParticles(t){let e=t;for(;e;){const t=Math.floor(Math.random()*this.textures.length);e.texture=this.textures[t],e=e.next}}}Z.type="textureRandom",Z.editorConfig=null;class tt{constructor(t){this.order=_.Normal,this.minStart=t.minStart*d,this.maxStart=t.maxStart*d,this.minSpeed=t.minSpeed*d,this.maxSpeed=t.maxSpeed*d,this.accel=t.accel*d}initParticles(t){let e=t;for(;e;)this.minStart===this.maxStart?e.rotation+=this.maxStart:e.rotation+=Math.random()*(this.maxStart-this.minStart)+this.minStart,e.config.rotSpeed=Math.random()*(this.maxSpeed-this.minSpeed)+this.minSpeed,e=e.next}updateParticle(t,e){if(this.accel){const i=t.config.rotSpeed;t.config.rotSpeed+=this.accel*e,t.rotation+=(t.config.rotSpeed+i)/2*e}else t.rotation+=t.config.rotSpeed*e}}tt.type="rotation",tt.editorConfig=null;class et{constructor(t){this.order=_.Normal,this.min=t.min*d,this.max=t.max*d}initParticles(t){let e=t;for(;e;)this.min===this.max?e.rotation+=this.max:e.rotation+=Math.random()*(this.max-this.min)+this.min,e=e.next}}et.type="rotationStatic",et.editorConfig=null;class it{constructor(){this.order=_.Late+1}initParticles(t){let e=t;for(;e;)e.rotation=0,e=e.next}}it.type="noRotation",it.editorConfig=null;class st{constructor(t){this.order=_.Normal,this.list=new O(!1),this.list.reset(o.createList(t.scale)),this.minMult=t.minMult}initParticles(t){let e=t;for(;e;){const t=Math.random()*(1-this.minMult)+this.minMult;e.config.scaleMult=t,e.scale.x=e.scale.y=this.list.first.value*t,e=e.next}}updateParticle(t){t.scale.x=t.scale.y=this.list.interpolate(t.agePercent)*t.config.scaleMult}}st.type="scale",st.editorConfig=null;class rt{constructor(t){this.order=_.Normal,this.min=t.min,this.max=t.max}initParticles(t){let e=t;for(;e;){const t=Math.random()*(this.max-this.min)+this.min;e.scale.x=e.scale.y=t,e=e.next}}}rt.type="scaleStatic",rt.editorConfig=null;class at{constructor(t){this.order=_.Spawn;const e=at.shapes[t.type];if(!e)throw new Error(`No shape found with type '${t.type}'`);this.shape=new e(t.data)}static registerShape(t,e){at.shapes[e||t.type]=t}initParticles(t){let e=t;for(;e;)this.shape.getRandPos(e),e=e.next}}at.type="spawnShape",at.editorConfig=null,at.shapes={},at.registerShape(M),at.registerShape(B),at.registerShape(L),at.registerShape(L,"circle");class nt{constructor(t){this.order=_.Normal,this.texture="string"==typeof t.texture?l(t.texture):t.texture}initParticles(t){let e=t;for(;e;)e.texture=this.texture,e=e.next}}nt.type="textureSingle",nt.editorConfig=null;class ht{constructor(t){var e;this.order=_.Late,this.list=new O(!1),this.list.reset(o.createList(t.speed)),this.minMult=null!==(e=t.minMult)&&void 0!==e?e:1}initParticles(t){let e=t;for(;e;){const t=Math.random()*(1-this.minMult)+this.minMult;e.config.speedMult=t,e.config.velocity?e.config.velocity.set(this.list.first.value*t,0):e.config.velocity=new a.Point(this.list.first.value*t,0),p(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=this.list.interpolate(t.agePercent)*t.config.speedMult,s=t.config.velocity;f(s),v(s,i),t.x+=s.x*e,t.y+=s.y*e}}ht.type="moveSpeed",ht.editorConfig=null;class ot{constructor(t){this.order=_.Late,this.min=t.min,this.max=t.max}initParticles(t){let e=t;for(;e;){const t=Math.random()*(this.max-this.min)+this.min;e.config.velocity?e.config.velocity.set(t,0):e.config.velocity=new a.Point(t,0),p(e.rotation,e.config.velocity),e=e.next}}updateParticle(t,e){const i=t.config.velocity;t.x+=i.x*e,t.y+=i.y*e}}ot.type="moveSpeedStatic",ot.editorConfig=null;var lt={__proto__:null,spawnShapes:E,editor:{__proto__:null},get BehaviorOrder(){return _},AccelerationBehavior:I,AlphaBehavior:N,StaticAlphaBehavior:U,RandomAnimatedTextureBehavior:W,SingleAnimatedTextureBehavior:X,BlendModeBehavior:$,BurstSpawn:G,ColorBehavior:j,StaticColorBehavior:V,OrderedTextureBehavior:Q,PathBehavior:J,PointSpawn:K,RandomTextureBehavior:Z,RotationBehavior:tt,StaticRotationBehavior:et,NoRotationBehavior:it,ScaleBehavior:st,StaticScaleBehavior:rt,ShapeSpawn:at,SingleTextureBehavior:nt,SpeedBehavior:ht,StaticSpeedBehavior:ot};S.registerBehavior(I),S.registerBehavior(N),S.registerBehavior(U),S.registerBehavior(W),S.registerBehavior(X),S.registerBehavior($),S.registerBehavior(G),S.registerBehavior(j),S.registerBehavior(V),S.registerBehavior(Q),S.registerBehavior(J),S.registerBehavior(K),S.registerBehavior(Z),S.registerBehavior(tt),S.registerBehavior(et),S.registerBehavior(it),S.registerBehavior(st),S.registerBehavior(rt),S.registerBehavior(at),S.registerBehavior(nt),S.registerBehavior(ht),S.registerBehavior(ot),t.Emitter=S,t.LinkedListContainer=class extends h.Container{constructor(){super(...arguments),this._firstChild=null,this._lastChild=null,this._childCount=0}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get childCount(){return this._childCount}addChild(...t){if(t.length>1)for(let e=0;ethis._childCount)throw new Error(`addChildAt: The index ${e} supplied is out of bounds ${this._childCount}`);t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1;const i=t;if(this._firstChild)if(0===e)this._firstChild.prevChild=i,i.nextChild=this._firstChild,this._firstChild=i;else if(e===this._childCount)this._lastChild.nextChild=i,i.prevChild=this._lastChild,this._lastChild=i;else{let t=0,s=this._firstChild;for(;t=this._childCount)throw new Error(`The index ${e} supplied is out of bounds ${this._childCount}`);if(t.parent!==this)throw new Error("The supplied DisplayObject must be a child of the caller");if(t.nextChild&&(t.nextChild.prevChild=t.prevChild),t.prevChild&&(t.prevChild.nextChild=t.nextChild),this._firstChild===t&&(this._firstChild=t.nextChild),this._lastChild===t&&(this._lastChild=t.prevChild),t.nextChild=null,t.prevChild=null,this._firstChild)if(0===e)this._firstChild.prevChild=t,t.nextChild=this._firstChild,this._firstChild=t;else if(e===this._childCount)this._lastChild.nextChild=t,t.prevChild=this._lastChild,this._lastChild=t;else{let i=0,s=this._firstChild;for(;i1)for(let e=0;e=this._childCount)throw new Error(`getChildAt: Index (${t}) does not exist.`);if(0===t)return this._firstChild;if(t===this._childCount)return this._lastChild;let e=0,i=this._firstChild;for(;e0&&r<=s){const e=[];let r=this._firstChild;for(let t=0;t<=s&&r;++t,r=r.nextChild)t>=i&&e.push(r);const a=e[0].prevChild,n=e[e.length-1].nextChild;n?n.prevChild=a:this._lastChild=a,a?a.nextChild=n:this._firstChild=n;for(let t=0;t