@erikwatson/snowfall 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.LICENSE.txt +90 -2
- package/package.json +2 -6
package/README.md
CHANGED
|
@@ -39,7 +39,9 @@ Then, at the bottom of your page body add the following, this will run snowfall
|
|
|
39
39
|
```html
|
|
40
40
|
<script src="https://cdn.jsdelivr.net/npm/@erikwatson/snowfall@4/dist/index.min.js"></script>
|
|
41
41
|
<script>
|
|
42
|
-
snowfall.start(
|
|
42
|
+
snowfall.start({
|
|
43
|
+
layers: [{}]
|
|
44
|
+
})
|
|
43
45
|
</script>
|
|
44
46
|
```
|
|
45
47
|
|
|
@@ -51,7 +53,7 @@ Same as above but we pass a config object. Your config overrides the default set
|
|
|
51
53
|
snowfall.start({
|
|
52
54
|
layers: [
|
|
53
55
|
{
|
|
54
|
-
colour: '#
|
|
56
|
+
colour: '#8d90b7'
|
|
55
57
|
}
|
|
56
58
|
]
|
|
57
59
|
})
|
|
@@ -69,7 +71,7 @@ const userSchedule = {
|
|
|
69
71
|
snowfall.schedule(userSchedule, {
|
|
70
72
|
layers: [
|
|
71
73
|
{
|
|
72
|
-
colour: '#
|
|
74
|
+
colour: '#8d90b7'
|
|
73
75
|
}
|
|
74
76
|
]
|
|
75
77
|
})
|
package/dist/index.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.min.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.snowfall=e():t.snowfall=e()}(this,(()=>(()=>{var t={399:t=>{var e;window,e=function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/js/",n(n.s="./src/bramble.ts")}({"./src/assets.ts":function(t,e,n){"use strict";function i(t){return new Promise((function(e,n){var i=new XMLHttpRequest;i.addEventListener("load",(function(t){e(i.responseText)})),i.addEventListener("error",(function(t){n(t)})),i.open("GET",t),i.send()}))}function o(t){return void 0===t&&(t=[]),Promise.all(t.map((function(t){return i(t)})))}function r(t){return new Promise((function(e,n){var i=new Image;i.addEventListener("load",(function(t){e(i)})),i.addEventListener("error",(function(t){n(t)})),i.src=t}))}function a(t){return void 0===t&&(t=[]),Promise.all(t.map((function(t){return r(t)})))}function s(t){var e;return i(t).then((function(t){return r((e=JSON.parse(t)).path)})).then((function(t){return{name:e.name,type:e.type,image:t,tiles:e.tiles}}))}function u(t){return void 0===t&&(t=[]),Promise.all(t.map((function(t){return s(t)})))}Object.defineProperty(e,"__esModule",{value:!0}),e.loadAllTerrain=e.loadTerrain=e.loadAllImages=e.loadImage=e.loadAllText=e.loadText=void 0,e.loadText=i,e.loadAllText=o,e.loadImage=r,e.loadAllImages=a,e.loadTerrain=s,e.loadAllTerrain=u,e.default={loadImage:r,loadText:i,loadAllText:o,loadAllImages:a,loadTerrain:s,loadAllTerrain:u}},"./src/bramble.ts":function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,o)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.collisions=e.load=e.save=e.vec2=e.sprite=e.mouse=e.keyboard=e.graphics=e.grid=e.game=e.assets=void 0;var r=n("./src/assets.ts");Object.defineProperty(e,"assets",{enumerable:!0,get:function(){return r.default}});var a=n("./src/game.ts");Object.defineProperty(e,"game",{enumerable:!0,get:function(){return a.default}});var s=n("./src/grid.ts");Object.defineProperty(e,"grid",{enumerable:!0,get:function(){return s.default}});var u=n("./src/graphics.ts");Object.defineProperty(e,"graphics",{enumerable:!0,get:function(){return u.default}});var c=n("./src/input.ts");Object.defineProperty(e,"keyboard",{enumerable:!0,get:function(){return c.keyboard}}),Object.defineProperty(e,"mouse",{enumerable:!0,get:function(){return c.mouse}});var d=n("./src/sprite.ts");Object.defineProperty(e,"sprite",{enumerable:!0,get:function(){return d.default}});var l=n("./src/vec2.ts");Object.defineProperty(e,"vec2",{enumerable:!0,get:function(){return l.default}});var f=n("./src/storage.ts");Object.defineProperty(e,"save",{enumerable:!0,get:function(){return f.save}}),Object.defineProperty(e,"load",{enumerable:!0,get:function(){return f.load}});var h=n("./src/collision.ts");Object.defineProperty(e,"collisions",{enumerable:!0,get:function(){return h.default}}),o(n("./src/types.ts"),e)},"./src/collision.ts":function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var o=n("./src/bramble.ts");function r(t,e){var n=o.vec2.create(t.from.x,t.from.y),r=o.vec2.create(t.to.x,t.to.y),a=o.vec2.clone(r);a.subtract(n);var s=1/a.x,u=1/a.y,c={x:(e.x-t.from.x)*s,y:(e.y-t.from.y)*u},d={x:(e.x+e.width-t.from.x)*s,y:(e.y+e.height-t.from.y)*u};if(isNaN(c.x)||isNaN(c.y))return!1;if(isNaN(d.x)||isNaN(d.y))return!1;var l=i({},c),f=i({},d);if(l.x>f.x&&(c.x=f.x,d.x=l.x),l=i({},c),f=i({},d),l.y>f.y&&(c.y=f.y,d.y=l.y),c.x>d.y||c.y>d.x)return!1;var h=Math.max(c.x,c.y),v=Math.min(d.x,d.y);if(v<0)return!1;if(h>1)return!1;if(h<0)return!1;var p=o.vec2.create(0,0);return c.x>c.y?s<0?(p.x=1,p.y=0):(p.x=-1,p.y=0):c.x<c.y?u<0?(p.x=0,p.y=1):(p.x=0,p.y=-1):c.x===c.y&&(s<0&&u<0?(p.x=-1,p.y=1):s>0&&u<0?(p.x=1,p.y=1):s<0&&u>0?(p.x=-1,p.y=-1):s>0&&u>0&&(p.x=1,p.y=-1)),{normal:p,near:o.vec2.create(n.x+h*a.x,n.y+h*a.y),far:o.vec2.create(n.x+v*a.x,n.y+v*a.y),timeOfCollision:h}}e.default={dynamicRectVsStaticRect:function(t,e){if(0===t.velocity.x&&0===t.velocity.y)return!1;var n=t.width/2,i=t.height/2,a=o.vec2.clone(t.position);return a.add(t.velocity),a.x+=t.width/2,a.y+=t.height/2,r({from:{x:t.position.x+n,y:t.position.y+i},to:a},{x:e.position.x-n,y:e.position.y-i,width:e.width+t.width,height:e.height+t.height})},rectVsRect:function(t,e){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y},lineVsRect:r,pointVsRect:function(t,e){return t.x>=e.x&&t.y>=e.y&&t.x<e.x+e.width&&t.y<e.y+e.height},lineVsCubicBezierCurve:function(t,e,n,i,r,a){var s=[],u=-t.x+3*e.x-3*n.x+i.x,c=-t.y+3*e.y-3*n.y+i.y,d=3*t.x-6*e.x+3*n.x,l=3*t.y-6*e.y+3*n.y,f=-3*t.x+3*e.x,h=-3*t.y+3*e.y,v=t.x,p=t.y,g=a.x-r.x,y=a.y-r.y,m=r.x,_=r.y;return function(t,e,n,i){if(Math.abs(t)<1e-10)return function(t,e,n){var i=e*e-4*t*n;if(i<0)return[];if(0===i)return[-e/(2*t)];var o=Math.sqrt(i);return[(-e+o)/(2*t),(-e-o)/(2*t)]}(e,n,i);var o=e/t,r=n/t,a=(3*r-o*o)/3,s=(2*o*o*o-9*o*r+i/t*27)/27,u=s*s/4+a*a*a/27,c=[];if(u>0){var d=Math.cbrt(-s/2+Math.sqrt(u)),l=Math.cbrt(-s/2-Math.sqrt(u));c.push(d+l-o/3)}else if(0===u)d=Math.cbrt(-s/2),c.push(2*d-o/3),c.push(-d-o/3);else{var f=Math.sqrt(-a*a*a/27),h=Math.acos(-s/(2*f));c.push(2*Math.cbrt(f)*Math.cos(h/3)-o/3),c.push(2*Math.cbrt(f)*Math.cos((h+2*Math.PI)/3)-o/3),c.push(2*Math.cbrt(f)*Math.cos((h+4*Math.PI)/3)-o/3)}return c.filter((function(t){return t>=0&&t<=1}))}(u*y-c*g,d*y-l*g,f*y-h*g,(v-m)*y-(p-_)*g).forEach((function(a){var u=function(t,e,n,i,r){var a=(1-r)*(1-r)*(1-r)*t.x+3*(1-r)*(1-r)*r*e.x+3*(1-r)*r*r*n.x+r*r*r*i.x,s=(1-r)*(1-r)*(1-r)*t.y+3*(1-r)*(1-r)*r*e.y+3*(1-r)*r*r*n.y+r*r*r*i.y;return o.vec2.create(a,s)}(t,e,n,i,a),c=function(t,e,n,i,r){var a=3*(1-r)*(1-r)*(e.x-t.x)+6*(1-r)*r*(n.x-e.x)+3*r*r*(i.x-n.x),s=3*(1-r)*(1-r)*(e.y-t.y)+6*(1-r)*r*(n.y-e.y)+3*r*r*(i.y-n.y);return o.vec2.create(a,s)}(t,e,n,i,a),d=Math.atan2(c.y,c.x),l=d*(180/Math.PI),f=o.vec2.fromDegrees(l),h=o.vec2.create(f.y,-f.x),v=u.x-r.x,p=u.y-r.y,A=Math.sqrt(v*v+p*p),w=Math.sqrt(g*g+y*y)-A,x=(u.x-m)/g,D=(u.y-_)/y;(x>=0&&x<=1||D>=0&&D<=1)&&s.push({point:o.vec2.create(u.x,u.y),distance:A,remainderLength:w,angleRadians:d,angleDegrees:l,direction:o.vec2.fromDegrees(l),normal:h})})),s}}},"./src/game.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n("./src/graphics.ts"),o=n("./src/input.ts");e.default={create:function(){var t=null,e=null,n=null,r=0,a=document.createElement("canvas"),s=a.getContext("2d"),u=i.default.create(s);a.id="bramble-game";var c=o.mouse.create(a),d=o.keyboard.create(a),l={keyboard:d.getState(),mouse:c.getState()},f=function(){e&&(l.keyboard=d.getState(),l.mouse=c.getState(),e((performance.now()-r)/1e3,l)),n&&(t&&u.clear(t),n(u)),c.update(),d.update(),window.requestAnimationFrame(f),r=performance.now()};return{attachTo:function(t){t.appendChild(a)},setSize:function(t,e){a.width=t,a.height=e},setUpdate:function(t){e=t},setRender:function(t){n=t},setBackgroundColor:function(e){t=e},canvas:a,disableContextMenu:function(){a.addEventListener("contextmenu",(function(t){t.preventDefault()}))},setSmoothing:function(t){void 0===t&&(t=!0),s.imageSmoothingEnabled=t},start:function(){c.start(),d.start(),window.requestAnimationFrame(f)}}}}},"./src/graphics.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n("./src/utils/number.ts"),o=n("./src/utils/object.ts");function r(t,e){t.save(),e(),t.restore()}function a(t,e){e?d(t,{x:0,y:0,width:t.canvas.width,height:t.canvas.height},{fill:{colour:e},line:{width:0}}):t.clearRect(0,0,t.canvas.width,t.canvas.height)}function s(t,e,n){n?d(t,e,{fill:{colour:n},line:{width:0}}):t.clearRect(e.x,e.y,e.width,e.height)}function u(t,e,n,i){void 0===i&&(i=c),d(t,{x:e.x,y:e.y,width:n,height:n},i)}var c={fill:{colour:"#000000",opacity:1},line:{width:1,colour:"#FFFFFF",opacity:1}};function d(t,e,n){void 0===n&&(n=c),r(t,(function(){n=(0,o.merge)(c,n),t.globalAlpha=n.fill.opacity,t.fillStyle=n.fill.colour,t.fillRect(e.x,e.y,e.width,e.height),t.globalAlpha=1,0!==n.line.width&&(t.globalAlpha=n.line.opacity,t.strokeStyle=n.line.colour,t.lineWidth=n.line.width,t.strokeRect(e.x,e.y,e.width,e.height),t.globalAlpha=1)}))}var l={width:1,colour:"#FFFFFF",opacity:1};function f(t,e,n,i){void 0===i&&(i=l),r(t,(function(){i=(0,o.merge)(l,i),t.globalAlpha=i.opacity,t.strokeStyle=i.colour,t.lineWidth=i.width,t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(n.x,n.y),t.stroke(),t.globalAlpha=1,t.closePath()}))}function h(t,e,n,i,a){void 0===a&&(a=l),i.cp1&&i.cp2?function(t,e,n,i,a,s){void 0===s&&(s=l),r(t,(function(){s=(0,o.merge)(l,s),t.globalAlpha=s.opacity,t.strokeStyle=s.colour,t.lineWidth=s.width,t.beginPath(),t.moveTo(e.x,e.y),t.bezierCurveTo(i.x,i.y,a.x,a.y,n.x,n.y),t.stroke(),t.globalAlpha=1,t.closePath()}))}(t,e,n,i.cp1,i.cp2,a):i.cp1&&!i.cp2?function(t,e,n,i,a){void 0===a&&(a=l),r(t,(function(){a=(0,o.merge)(l,a),t.globalAlpha=a.opacity,t.strokeStyle=a.colour,t.lineWidth=a.width,t.beginPath(),t.moveTo(e.x,e.y),t.quadraticCurveTo(i.x,i.y,n.x,n.y),t.stroke(),t.globalAlpha=1,t.closePath()}))}(t,e,n,i.cp1,a):f(t,e,n,a)}var v={fill:{colour:"#000000",opacity:1},line:{colour:"#FFFFFF",opacity:1,width:1}};function p(t,e,n,i){void 0===i&&(i=v),r(t,(function(){i=(0,o.merge)(v,i),t.globalAlpha=i.fill.opacity,t.fillStyle=i.fill.colour,t.beginPath(),t.arc(e.x,e.y,n,0,2*Math.PI),t.closePath(),t.fill(),t.globalAlpha=1,0!==i.line.width&&(t.globalAlpha=i.line.opacity,t.strokeStyle=i.line.colour,t.lineWidth=i.line.width,t.beginPath(),t.arc(e.x,e.y,n,0,2*Math.PI),t.closePath(),t.stroke())}))}function g(t,e,n,i){i?t.drawImage(e,n.x,n.y,i.width,i.height):t.drawImage(e,n.x,n.y,e.width,e.height)}function y(t,e,n,i,o,r){t.drawImage(e,o.x,o.y,r.width,r.height,n.x,n.y,i.width,i.height)}function m(t,e){r(t,(function(){var n=e.size.width/2,o=e.size.height/2;t.translate(e.position.x+n,e.position.y+o),t.rotate(i.default.toRadians(e.rotation)),e.frames.length>1?y(t,e.texture,{x:-n,y:-o},{width:e.size.width,height:e.size.height},{x:e.frames[e.frame].position.x,y:e.frames[e.frame].position.y},{width:e.frames[e.frame].size.width,height:e.frames[e.frame].size.height}):g(t,e.texture,{x:-n,y:-o},{width:e.size.width,height:e.size.height})}))}function _(t,e,n,i,o){void 0===n&&(n=""),void 0===i&&(i="#000000"),void 0===o&&(o="16pt sans-serif"),r(t,(function(){t.fillStyle=i,t.font=o,t.textAlign="left",t.textBaseline="top",t.fillText(n,e.x,e.y)}))}function A(t,e,n,i,o){for(var r=function(r){for(var a=function(a){if(0===n[r][a])return"continue";var s=r>0?n[r-1][a-1]:0,u=r>0?n[r-1][a]:0,c=r>0?n[r-1][a+1]:0,d=n[r][a-1],l=n[r][a],f=n[r][a+1],h=r<n.length-1?n[r+1][a-1]:0,v=r<n.length-1?n[r+1][a]:0,p=r<n.length-1?n[r+1][a+1]:0,g=1*(l===u&&l===d&&l===s?1:0)+2*(l===u?1:0)+4*(l===u&&l===f&&l===c?1:0)+8*(l===f?1:0)+16*(l===v&&l===f&&l===p?1:0)+32*(l===v?1:0)+64*(l===v&&l===d&&l===h?1:0)+128*(l===d?1:0),m=i.filter((function(t){return t.type===n[r][a]}))[0];if(!m)return console.error("Sheet ".concat(n[r][a]," not found!")),{value:void 0};var _=m.tiles.filter((function(t){return t.type===g})),A=_[Math.floor(Math.random()*_.length)];A?function(t,e,n,i,o,r,a){y(t,n,{x:e.x+r*(i.x*a.width),y:e.y+r*(i.y*a.height)},{width:r*a.width,height:r*a.height},{x:a.width*o.x,y:a.height*o.y},{width:a.width,height:a.height})}(t,e,m.image,{x:a,y:r},A.position,o,A.size):console.error("Tile not defined ".concat(g))},s=0;s<n[r].length;s++){var u=a(s);if("object"==typeof u)return u}},a=0;a<n.length;a++){var s=r(a);if("object"==typeof s)return s.value}}var w={shadowcolour:"#000000",shadowBlur:6,shadowOffsetX:4,shadowOffsetY:4};function x(t,e,n){void 0===n&&(n=w),r(t,(function(){n=(0,o.merge)(w,n),t.shadowColor=n.shadowcolour,t.shadowBlur=n.shadowBlur,t.shadowOffsetX=n.shadowOffsetX,t.shadowOffsetY=n.shadowOffsetY,e()}))}function D(t,e){r(t,(function(){t.globalCompositeOperation="color-dodge",e()}))}function T(t,e){r(t,(function(){t.globalCompositeOperation="overlay",e()}))}function b(t,e,n,o){r(t,(function(){t.translate(o.x,o.y),t.rotate(i.default.toRadians(n)),t.translate(-o.x,-o.y),e()}))}function M(t,e,n){void 0===n&&(n=.25),r(t,(function(){t.globalAlpha=n,e()}))}e.default={circle:p,clear:a,clearRect:s,create:function(t){return{circle:function(e,n,i){void 0===i&&(i=v),p(t,e,n,i)},clear:function(e){a(t,e)},clearRect:function(e,n){s(t,e,n)},curve:function(e,n,i,o){h(t,e,n,i,o)},square:function(e,n,i){void 0===i&&(i=c),u(t,e,n,i)},rect:function(e,n){void 0===n&&(n=c),d(t,e,n)},image:function(e,n,i){g(t,e,n,i)},line:function(e,n,i){void 0===i&&(i=l),f(t,e,n,i)},sprite:function(e){m(t,e)},subImage:function(e,n,i,o,r){y(t,e,n,i,o,r)},text:function(e,n,i,o){void 0===e&&(e={x:0,y:0}),void 0===n&&(n=""),void 0===i&&(i="#000000"),void 0===o&&(o="16pt sans-serif"),_(t,e,n,i,o)},tiles:function(e,n,i,o){A(t,e,n,i,o)},shadow:function(e,n){void 0===n&&(n=w),x(t,e,n)},dodge:function(e){D(t,e)},overlay:function(e){T(t,e)},transparency:function(e,n){void 0===n&&(n=.25),M(t,e,n)},rotation:function(e,n,i){void 0===n&&(n=0),void 0===i&&(i={x:0,y:0}),b(t,e,n,i)}}},curve:h,dodge:D,image:g,line:f,overlay:T,rotation:b,rect:d,shadow:x,sprite:m,square:u,subImage:y,text:_,tiles:A,transparency:M}},"./src/grid.ts":function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};function o(t){return t.map((function(t){return t.slice()}))}Object.defineProperty(e,"__esModule",{value:!0});var r={pos:{x:0,y:0},visible:!0,divisions:4,tileWidth:8,tileHeight:8,scale:1};e.default={create:function(t,e){void 0===e&&(e=r),e=i(i({},r),e);var n=function(t,e,n){void 0===t&&(t=1),void 0===e&&(e=1),void 0===n&&(n=null);for(var i=[],o=0;o<e;o++){for(var r=[],a=0;a<t;a++)r.push(n);i.push(r)}return i}(t.width,t.height,0),o={x:e.pos.x,y:e.pos.y},a=e.visible,s=e.divisions,u=e.tileWidth;return{divisions:s,pos:o,tileHeight:e.tileHeight,tiles:n,tileWidth:u,visible:a,size:t,tileSize:e.tileWidth,scale:e.scale}},fill:function(t,e,n,i){var r=o(t);return function t(e,n,i){n!==i&&r[e.y][e.x]===n&&e.x<r[e.y].length&&e.x>=0&&e.y<r.length&&e.y>=0&&(r[e.y][e.x]=i,e.y<r.length-1&&t({x:e.x,y:e.y+1},n,i),e.y>0&&t({x:e.x,y:e.y-1},n,i),e.x<r[0].length-1&&t({x:e.x+1,y:e.y},n,i),e.x>0&&t({x:e.x-1,y:e.y},n,i))}(e,n,i),r},copyTiles:o}},"./src/input.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.gamepad=e.keyboard=e.mouse=void 0;var i=n("./src/input/mouse.ts"),o=n("./src/input/keyboard.ts"),r=n("./src/input/gamepad.ts");e.mouse={create:function(t){var e=i.default.create(t);return{start:function(){return e.start()},update:function(){return e.update()},getState:function(){return e.getState()}}}},e.keyboard={create:function(t){var e=o.default.create(t);return{start:function(){return e.start()},update:function(){return e.update()},getState:function(){return e.getState()}}}},e.gamepad={create:function(){var t=r.default.create();return{start:function(){return t.start()},update:function(){return t.update()},getState:function(){return t.getState()}}}}},"./src/input/gamepad.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={create:function(){var t={},e=function(t){console.log(t.gamepad)},n=function(t){console.log(t.gamepad)};return{getState:function(){return t},start:function(){window.addEventListener("gamepadconnected",e),window.addEventListener("gamepaddisconnected",n)},update:function(){}}}}},"./src/input/keyboard.ts":function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var o,r=n("./src/input/keys.ts"),a=(o={pressed:!1,justPressed:!1,released:!1,justReleased:!1},r.default.reduce((function(t,e){var n=e.name;return delete e.label,t[n]=i(i({},e),o),t}),{}));function s(t,e){for(var n=null,i=Object.keys(e),o=0;o<i.length;o++)e[i[o]].code===t.code&&(n=e[i[o]]);return n||console.error("No key definition found for ".concat(t.code)),n}function u(t){!function(t){["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(t.key)&&t.preventDefault()}(t);var e=s(t,a);e.pressed||(e.justPressed=!0),e.pressed=!0}function c(t){var e=s(t,a);e.released||(e.justReleased=!0),e.pressed=!1,e.released=!0}function d(){Object.keys(a).forEach((function(t){a[t].justPressed=!1,a[t].justReleased=!1}))}e.default={create:function(t){return{start:function(){t.addEventListener("keydown",u),t.addEventListener("keyup",c)},update:d,getState:function(){return a}}}}},"./src/input/keys.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=[{code:"Backspace",name:"backspace"},{code:"Tab",name:"tab"},{code:"Enter",name:"enter"},{code:"ShiftLeft",name:"shift"},{code:"ControlLeft",name:"ctrl"},{code:"AltLeft",name:"alt"},{code:"CapsLock",name:"caps"},{code:"Escape",name:"escape"},{code:"Space",name:"space"},{code:"PageUp",name:"pageUp"},{code:"PageDown",name:"pageDown"},{code:"End",name:"end"},{code:"Home",name:"home"},{code:"ArrowLeft",name:"left"},{code:"ArrowUp",name:"up"},{code:"ArrowRight",name:"right"},{code:"ArrowDown",name:"down"},{code:"Insert",name:"insert"},{code:"Delete",name:"delete"},{code:"Digit0",name:"zero"},{code:"Digit1",name:"one"},{code:"Digit2",name:"two"},{code:"Digit3",name:"three"},{code:"Digit4",name:"four"},{code:"Digit5",name:"five"},{code:"Digit6",name:"six"},{code:"Digit7",name:"seven"},{code:"Digit8",name:"eight"},{code:"Digit9",name:"nine"},{code:"KeyA",name:"A"},{code:"KeyB",name:"B"},{code:"KeyC",name:"C"},{code:"KeyD",name:"D"},{code:"KeyE",name:"E"},{code:"KeyF",name:"F"},{code:"KeyG",name:"G"},{code:"KeyH",name:"H"},{code:"KeyI",name:"I"},{code:"KeyJ",name:"J"},{code:"KeyK",name:"K"},{code:"KeyL",name:"L"},{code:"KeyM",name:"M"},{code:"KeyN",name:"N"},{code:"KeyO",name:"O"},{code:"KeyP",name:"P"},{code:"KeyQ",name:"Q"},{code:"KeyR",name:"R"},{code:"KeyS",name:"S"},{code:"KeyT",name:"T"},{code:"KeyU",name:"U"},{code:"KeyV",name:"V"},{code:"KeyW",name:"W"},{code:"KeyX",name:"X"},{code:"KeyY",name:"Y"},{code:"KeyZ",name:"Z"},{code:"OSLeft",name:"superLeft"},{code:"OSRight",name:"superRight"},{code:"ContextMenu",name:"menu"},{code:"Numpad0",name:"num0"},{code:"Numpad1",name:"num1"},{code:"Numpad2",name:"num2"},{code:"Numpad3",name:"num3"},{code:"Numpad4",name:"num4"},{code:"Numpad5",name:"num5"},{code:"Numpad6",name:"num6"},{code:"Numpad7",name:"num7"},{code:"Numpad8",name:"num8"},{code:"Numpad9",name:"num9"},{code:"NumpadMultiply",name:"multiply"},{code:"NumpaddAdd",name:"add"},{code:"NumpaddDivide",name:"divide"},{code:"NumpadDecimal",name:"point"},{code:"NumpadMinus",name:"minus"},{code:"F1",name:"F1"},{code:"F2",name:"F2"},{code:"F3",name:"F3"},{code:"F4",name:"F4"},{code:"F5",name:"F5"},{code:"F6",name:"F6"},{code:"F7",name:"F7"},{code:"F8",name:"F8"},{code:"F9",name:"F9"},{code:"F10",name:"F10"},{code:"F11",name:"F11"},{code:"F12",name:"F12"},{code:"NumLock",name:"numLock"},{code:"ScrollLock",name:"scrollLock"},{code:"Semicolon",name:"semiColon"},{code:"Equal",name:"equals"},{code:"Comma",name:"comma"},{code:"Minus",name:"dash"},{code:"Period",name:"dot"},{code:"Slash",name:"forewardSlash"},{code:"BracketLeft",name:"openBracket"},{code:"IntlBackslash",name:"backSlash"},{code:"BracketRight",name:"closeBracket"},{code:"Quote",name:"quote"},{code:"MetaLeft",name:"metaLeft"}]},"./src/input/mouse.ts":function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.default={create:function(t){var e=function(){return{position:{x:0,y:0},left:n(),wheel:o(),right:n()}},n=function(){return{pressed:!1,justPressed:!1,released:!1,justReleased:!1}},o=function(){var t=n();return i(i({},t),{moved:!1,direction:"up"})},r=(e(),e()),a=function(e){var n=function(e){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}(e);r.position=n},s=function(t){switch(t.which){case 1:r.left.pressed||(r.left.justPressed=!0),r.left.pressed=!0;break;case 2:r.wheel.pressed||(r.wheel.justPressed=!0),r.wheel.pressed=!0;break;case 3:r.right.pressed||(r.right.justPressed=!0),r.right.pressed=!0}},u=function(t){switch(t.which){case 1:r.left.released||(r.left.justReleased=!0),r.left.released=!0,r.left.pressed=!1;break;case 2:r.wheel.released||(r.wheel.justReleased=!0),r.wheel.released=!0,r.wheel.pressed=!1;break;case 3:r.right.released||(r.right.justReleased=!0),r.right.released=!0,r.right.pressed=!1}},c=function(t){r.wheel.moved=0!==t.deltaY,!1!==r.wheel.moved&&(r.wheel.direction=t.deltaY<0?"up":"down")};return{getState:function(){return r},start:function(){t.addEventListener("mousemove",a),t.addEventListener("mousedown",s),t.addEventListener("mouseup",u),t.addEventListener("wheel",c),r.position.x=t.width/2,r.position.y=t.height/2},update:function(){var t;r.wheel.moved=!1,r.left.justPressed=!1,r.right.justPressed=!1,r.left.justReleased=!1,r.right.justReleased=!1,r.wheel.justPressed=!1,r.wheel.justReleased=!1,t=r,Object.assign({},t)}}}}},"./src/sprite.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={create:function(t,e,n,i,o){void 0===n&&(n=0),void 0===o&&(o="#ffffff");var r=[];return{size:e,texture:i,colour:o,frame:0,position:t,setFrames:function(t){r=t},addFrame:function(t){r.push(t)},get frames(){return r},get rotation(){return n},set rotation(t){n=t>=360?360-t:t}}}}},"./src/storage.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.clear=e.remove=e.load=e.save=void 0,e.save=function(t,e){localStorage.setItem(t,e)},e.load=function(t){return localStorage.getItem(t)},e.remove=function(t){localStorage.removeItem(t)},e.clear=function(){localStorage.clear()}},"./src/types.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},"./src/utils/number.ts":function(t,e,n){"use strict";function i(t){return t*(Math.PI/180)}function o(t){return t*(180/Math.PI)}Object.defineProperty(e,"__esModule",{value:!0}),e.clamp=e.toDegrees=e.toRadians=void 0,e.toRadians=i,e.toDegrees=o,e.clamp=function(t,e,n){return e>n?(console.error("clamp: the minimum (".concat(e,") and maximum (").concat(n,") have been passed in the wrong order")),t):t<e?e:t>n?n:t},e.default={toRadians:i,toDegrees:o}},"./src/utils/object.ts":function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};function o(t){var e={};return Object.keys(t).forEach((function(n){"object"==typeof t[n]?e[n]=o(t[n]):e[n]=t[n]})),e}function r(t,e){return void 0===e&&(e=!0),!0===e?o(t):function(t){return i({},t)}(t)}function a(t,e,n){return void 0===n&&(n=!0),!0===n?function(t,e){var n={};return Object.keys(t).forEach((function(i){"object"==typeof t[i]?n[i]=void 0===e[i]?t[i]:a(t[i],e[i]):n[i]=void 0===e[i]?t[i]:e[i]})),Object.keys(e).forEach((function(i){void 0===t[i]&&(n[i]=e[i])})),n}(t,e):function(t,e){return i(i({},t),e)}(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.merge=e.clone=void 0,e.clone=r,e.merge=a,e.default={merge:a,clone:r}},"./src/vec2.ts":function(t,e,n){"use strict";function i(t,e){var n=t,r=e,a=function(){return Math.sqrt(n*n+r*r)},s=function(t){n*=t,r*=t},u=function(){var t=a();n/=t,r/=t};return{add:function(t){n+=t.x,r+=t.y},addScalar:function(t){n+=t,r+=t},clone:o,divide:function(t){n/=t.x,r/=t.y},divideScalar:function(t){n/=t,r/=t},dot:function(t){return n*t.x+r*t.y},getLength:a,getOpposite:function(){return i(-n,-r)},getPerp:function(){return i(-r,n)},isEqualTo:function(t){return n==t.x&&r==t.y},multiply:function(t){n*=t.x,r*=t.y},multiplyScalar:s,normalise:u,setLength:function(t){u(),s(t)},subtract:function(t){n-=t.x,r-=t.y},subtractScalar:function(t){n-=t,r-=t},set x(t){n=t},get x(){return n},set y(t){r=t},get y(){return r}}}Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){return i(t.x,t.y)};e.default={clone:o,create:i,fromDegrees:function(t){var e=t*(Math.PI/180);return i(Math.cos(e),Math.sin(e))}}}})},t.exports=e()},711:(t,e,n)=>{var i=n(308),o=n(989),r=n(679),a=n(875),s=n(993),u=n(813),c=n(713);c.alea=i,c.xor128=o,c.xorwow=r,c.xorshift7=a,c.xor4096=s,c.tychei=u,t.exports=c},308:function(t,e,n){var i;!function(t,o){function r(t){var e,n=this,i=(e=4022871197,function(t){t=String(t);for(var n=0;n<t.length;n++){var i=.02519603282416938*(e+=t.charCodeAt(n));i-=e=i>>>0,e=(i*=e)>>>0,e+=4294967296*(i-=e)}return 2.3283064365386963e-10*(e>>>0)});n.next=function(){var t=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=t-(n.c=0|t)},n.c=1,n.s0=i(" "),n.s1=i(" "),n.s2=i(" "),n.s0-=i(t),n.s0<0&&(n.s0+=1),n.s1-=i(t),n.s1<0&&(n.s1+=1),n.s2-=i(t),n.s2<0&&(n.s2+=1),i=null}function a(t,e){return e.c=t.c,e.s0=t.s0,e.s1=t.s1,e.s2=t.s2,e}function s(t,e){var n=new r(t),i=e&&e.state,o=n.next;return o.int32=function(){return 4294967296*n.next()|0},o.double=function(){return o()+11102230246251565e-32*(2097152*o()|0)},o.quick=o,i&&("object"==typeof i&&a(i,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=s:n.amdD&&n.amdO?void 0===(i=function(){return s}.call(e,n,e,o))||(o.exports=i):this.alea=s}(0,t=n.nmd(t),n.amdD)},813:function(t,e,n){var i;!function(t,o){function r(t){var e=this,n="";e.next=function(){var t=e.b,n=e.c,i=e.d,o=e.a;return t=t<<25^t>>>7^n,n=n-i|0,i=i<<24^i>>>8^o,o=o-t|0,e.b=t=t<<20^t>>>12^n,e.c=n=n-i|0,e.d=i<<16^n>>>16^o,e.a=o-t|0},e.a=0,e.b=0,e.c=-1640531527,e.d=1367130551,t===Math.floor(t)?(e.a=t/4294967296|0,e.b=0|t):n+=t;for(var i=0;i<n.length+20;i++)e.b^=0|n.charCodeAt(i),e.next()}function a(t,e){return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e}function s(t,e){var n=new r(t),i=e&&e.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,i&&("object"==typeof i&&a(i,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=s:n.amdD&&n.amdO?void 0===(i=function(){return s}.call(e,n,e,o))||(o.exports=i):this.tychei=s}(0,t=n.nmd(t),n.amdD)},989:function(t,e,n){var i;!function(t,o){function r(t){var e=this,n="";e.x=0,e.y=0,e.z=0,e.w=0,e.next=function(){var t=e.x^e.x<<11;return e.x=e.y,e.y=e.z,e.z=e.w,e.w^=e.w>>>19^t^t>>>8},t===(0|t)?e.x=t:n+=t;for(var i=0;i<n.length+64;i++)e.x^=0|n.charCodeAt(i),e.next()}function a(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e}function s(t,e){var n=new r(t),i=e&&e.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,i&&("object"==typeof i&&a(i,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=s:n.amdD&&n.amdO?void 0===(i=function(){return s}.call(e,n,e,o))||(o.exports=i):this.xor128=s}(0,t=n.nmd(t),n.amdD)},993:function(t,e,n){var i;!function(t,o){function r(t){var e=this;e.next=function(){var t,n,i=e.w,o=e.X,r=e.i;return e.w=i=i+1640531527|0,n=o[r+34&127],t=o[r=r+1&127],n^=n<<13,t^=t<<17,n^=n>>>15,t^=t>>>12,n=o[r]=n^t,e.i=r,n+(i^i>>>16)|0},function(t,e){var n,i,o,r,a,s=[],u=128;for(e===(0|e)?(i=e,e=null):(e+="\0",i=0,u=Math.max(u,e.length)),o=0,r=-32;r<u;++r)e&&(i^=e.charCodeAt((r+32)%e.length)),0===r&&(a=i),i^=i<<10,i^=i>>>15,i^=i<<4,i^=i>>>13,r>=0&&(a=a+1640531527|0,o=0==(n=s[127&r]^=i+a)?o+1:0);for(o>=128&&(s[127&(e&&e.length||0)]=-1),o=127,r=512;r>0;--r)i=s[o+34&127],n=s[o=o+1&127],i^=i<<13,n^=n<<17,i^=i>>>15,n^=n>>>12,s[o]=i^n;t.w=a,t.X=s,t.i=o}(e,t)}function a(t,e){return e.i=t.i,e.w=t.w,e.X=t.X.slice(),e}function s(t,e){null==t&&(t=+new Date);var n=new r(t),i=e&&e.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,i&&(i.X&&a(i,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=s:n.amdD&&n.amdO?void 0===(i=function(){return s}.call(e,n,e,o))||(o.exports=i):this.xor4096=s}(0,t=n.nmd(t),n.amdD)},875:function(t,e,n){var i;!function(t,o){function r(t){var e=this;e.next=function(){var t,n,i=e.x,o=e.i;return t=i[o],n=(t^=t>>>7)^t<<24,n^=(t=i[o+1&7])^t>>>10,n^=(t=i[o+3&7])^t>>>3,n^=(t=i[o+4&7])^t<<7,t=i[o+7&7],n^=(t^=t<<13)^t<<9,i[o]=n,e.i=o+1&7,n},function(t,e){var n,i=[];if(e===(0|e))i[0]=e;else for(e=""+e,n=0;n<e.length;++n)i[7&n]=i[7&n]<<15^e.charCodeAt(n)+i[n+1&7]<<13;for(;i.length<8;)i.push(0);for(n=0;n<8&&0===i[n];++n);for(8==n?i[7]=-1:i[n],t.x=i,t.i=0,n=256;n>0;--n)t.next()}(e,t)}function a(t,e){return e.x=t.x.slice(),e.i=t.i,e}function s(t,e){null==t&&(t=+new Date);var n=new r(t),i=e&&e.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,i&&(i.x&&a(i,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=s:n.amdD&&n.amdO?void 0===(i=function(){return s}.call(e,n,e,o))||(o.exports=i):this.xorshift7=s}(0,t=n.nmd(t),n.amdD)},679:function(t,e,n){var i;!function(t,o){function r(t){var e=this,n="";e.next=function(){var t=e.x^e.x>>>2;return e.x=e.y,e.y=e.z,e.z=e.w,e.w=e.v,(e.d=e.d+362437|0)+(e.v=e.v^e.v<<4^t^t<<1)|0},e.x=0,e.y=0,e.z=0,e.w=0,e.v=0,t===(0|t)?e.x=t:n+=t;for(var i=0;i<n.length+64;i++)e.x^=0|n.charCodeAt(i),i==n.length&&(e.d=e.x<<10^e.x>>>4),e.next()}function a(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e.v=t.v,e.d=t.d,e}function s(t,e){var n=new r(t),i=e&&e.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,i&&("object"==typeof i&&a(i,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=s:n.amdD&&n.amdO?void 0===(i=function(){return s}.call(e,n,e,o))||(o.exports=i):this.xorwow=s}(0,t=n.nmd(t),n.amdD)},713:function(t,e,n){var i;!function(o,r,a){var s,u=256,c=a.pow(u,6),d=a.pow(2,52),l=2*d,f=255;function h(t,e,n){var i=[],f=y(g((e=1==e?{entropy:!0}:e||{}).entropy?[t,m(r)]:null==t?function(){try{var t;return s&&(t=s.randomBytes)?t=t(u):(t=new Uint8Array(u),(o.crypto||o.msCrypto).getRandomValues(t)),m(t)}catch(t){var e=o.navigator,n=e&&e.plugins;return[+new Date,o,n,o.screen,m(r)]}}():t,3),i),h=new v(i),_=function(){for(var t=h.g(6),e=c,n=0;t<d;)t=(t+n)*u,e*=u,n=h.g(1);for(;t>=l;)t/=2,e/=2,n>>>=1;return(t+n)/e};return _.int32=function(){return 0|h.g(4)},_.quick=function(){return h.g(4)/4294967296},_.double=_,y(m(h.S),r),(e.pass||n||function(t,e,n,i){return i&&(i.S&&p(i,h),t.state=function(){return p(h,{})}),n?(a.random=t,e):t})(_,f,"global"in e?e.global:this==a,e.state)}function v(t){var e,n=t.length,i=this,o=0,r=i.i=i.j=0,a=i.S=[];for(n||(t=[n++]);o<u;)a[o]=o++;for(o=0;o<u;o++)a[o]=a[r=f&r+t[o%n]+(e=a[o])],a[r]=e;(i.g=function(t){for(var e,n=0,o=i.i,r=i.j,a=i.S;t--;)e=a[o=f&o+1],n=n*u+a[f&(a[o]=a[r=f&r+e])+(a[r]=e)];return i.i=o,i.j=r,n})(u)}function p(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function g(t,e){var n,i=[],o=typeof t;if(e&&"object"==o)for(n in t)try{i.push(g(t[n],e-1))}catch(t){}return i.length?i:"string"==o?t:t+"\0"}function y(t,e){for(var n,i=t+"",o=0;o<i.length;)e[f&o]=f&(n^=19*e[f&o])+i.charCodeAt(o++);return m(e)}function m(t){return String.fromCharCode.apply(0,t)}if(y(a.random(),r),t.exports){t.exports=h;try{s=n(222)}catch(t){}}else void 0===(i=function(){return h}.call(e,n,e,t))||(t.exports=i)}("undefined"!=typeof self?self:this,[],Math)},222:()=>{}},e={};function n(i){var o=e[i];if(void 0!==o)return o.exports;var r=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}n.amdD=function(){throw new Error("define cannot be used indirect")},n.amdO={},n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var i={};return(()=>{"use strict";n.r(i),n.d(i,{BASE_LAYER_CONFIG:()=>st,DEFAULT_AMPLITUDE:()=>U,DEFAULT_BASE_CONFIG:()=>lt,DEFAULT_CONTAINER_ID:()=>y,DEFAULT_DENSITY:()=>_,DEFAULT_FREQUENCY:()=>F,DEFAULT_GRAVITY:()=>C,DEFAULT_GRAVITY_ANGLE:()=>L,DEFAULT_GRAVITY_STRENGTH:()=>P,DEFAULT_IMAGE:()=>M,DEFAULT_IMAGE_LAYER:()=>ct,DEFAULT_LAYERS:()=>dt,DEFAULT_MASS:()=>S,DEFAULT_MASS_MAX:()=>w,DEFAULT_MASS_MIN:()=>A,DEFAULT_MODE:()=>b,DEFAULT_OPACITY:()=>N,DEFAULT_OPACITY_MAX:()=>E,DEFAULT_OPACITY_MIN:()=>I,DEFAULT_ROTATE:()=>T,DEFAULT_SIMPLE_LAYER:()=>ut,DEFAULT_SIZE:()=>O,DEFAULT_SIZE_MAX:()=>D,DEFAULT_SIZE_MIN:()=>x,DEFAULT_SNOW_COLOR:()=>m,DEFAULT_SWAY:()=>W,DEFAULT_USER_CONFIG:()=>ht,DEFAULT_WIND:()=>at,DEFAULT_WIND_ANGLE:()=>j,DEFAULT_WIND_GUSTS:()=>rt,DEFAULT_WIND_GUSTS_ACTIVE:()=>nt,DEFAULT_WIND_GUSTS_CHANGE_CHANCE:()=>et,DEFAULT_WIND_GUSTS_IN:()=>ot,DEFAULT_WIND_GUSTS_OUT:()=>it,DEFAULT_WIND_IN_ADDITIONAL_STRENGTH:()=>Y,DEFAULT_WIND_IN_ADDITIONAL_STRENGTH_MAX:()=>G,DEFAULT_WIND_IN_ADDITIONAL_STRENGTH_MIN:()=>k,DEFAULT_WIND_IN_DELAY:()=>V,DEFAULT_WIND_IN_DELAY_MAX:()=>q,DEFAULT_WIND_IN_DELAY_MIN:()=>X,DEFAULT_WIND_IN_DURATION:()=>K,DEFAULT_WIND_IN_DURATION_MAX:()=>B,DEFAULT_WIND_IN_DURATION_MIN:()=>z,DEFAULT_WIND_OUT_DELAY:()=>Z,DEFAULT_WIND_OUT_DELAY_MAX:()=>H,DEFAULT_WIND_OUT_DELAY_MIN:()=>J,DEFAULT_WIND_OUT_DURATION:()=>tt,DEFAULT_WIND_OUT_DURATION_MAX:()=>Q,DEFAULT_WIND_OUT_DURATION_MIN:()=>$,DEFAULT_WIND_STRENGTH:()=>R,Types:()=>e,clone:()=>h,default:()=>xe,diff:()=>bt,getDefaultConfig:()=>ft,isSimpleLayer:()=>p,merge2:()=>At,restart:()=>Kt,schedule:()=>qt,setAmplitude:()=>Ht,setColour:()=>Vt,setDensity:()=>Jt,setFrequency:()=>Zt,setGravity:()=>oe,setGravityAngle:()=>re,setGravityStrength:()=>ae,setGusts:()=>ie,setMassMax:()=>_e,setMassMin:()=>me,setPaused:()=>Qt,setSizeMax:()=>we,setSizeMin:()=>Ae,setWind:()=>te,setWindAngle:()=>ee,setWindInAdditionalStrengthMax:()=>ue,setWindInAdditionalStrengthMin:()=>se,setWindInDelayMax:()=>fe,setWindInDelayMin:()=>le,setWindInDurationMax:()=>de,setWindInDurationMin:()=>ce,setWindOutChangeChance:()=>ye,setWindOutDelayMax:()=>ge,setWindOutDelayMin:()=>pe,setWindOutDurationMax:()=>ve,setWindOutDurationMin:()=>he,setWindStrength:()=>ne,start:()=>Bt,stop:()=>Xt,togglePaused:()=>$t});var t={};n.r(t),n.d(t,{BASE_LAYER_CONFIG:()=>st,DEFAULT_AMPLITUDE:()=>U,DEFAULT_BASE_CONFIG:()=>lt,DEFAULT_CONTAINER_ID:()=>y,DEFAULT_DENSITY:()=>_,DEFAULT_FREQUENCY:()=>F,DEFAULT_GRAVITY:()=>C,DEFAULT_GRAVITY_ANGLE:()=>L,DEFAULT_GRAVITY_STRENGTH:()=>P,DEFAULT_IMAGE:()=>M,DEFAULT_IMAGE_LAYER:()=>ct,DEFAULT_LAYERS:()=>dt,DEFAULT_MASS:()=>S,DEFAULT_MASS_MAX:()=>w,DEFAULT_MASS_MIN:()=>A,DEFAULT_MODE:()=>b,DEFAULT_OPACITY:()=>N,DEFAULT_OPACITY_MAX:()=>E,DEFAULT_OPACITY_MIN:()=>I,DEFAULT_ROTATE:()=>T,DEFAULT_SIMPLE_LAYER:()=>ut,DEFAULT_SIZE:()=>O,DEFAULT_SIZE_MAX:()=>D,DEFAULT_SIZE_MIN:()=>x,DEFAULT_SNOW_COLOR:()=>m,DEFAULT_SWAY:()=>W,DEFAULT_USER_CONFIG:()=>ht,DEFAULT_WIND:()=>at,DEFAULT_WIND_ANGLE:()=>j,DEFAULT_WIND_GUSTS:()=>rt,DEFAULT_WIND_GUSTS_ACTIVE:()=>nt,DEFAULT_WIND_GUSTS_CHANGE_CHANCE:()=>et,DEFAULT_WIND_GUSTS_IN:()=>ot,DEFAULT_WIND_GUSTS_OUT:()=>it,DEFAULT_WIND_IN_ADDITIONAL_STRENGTH:()=>Y,DEFAULT_WIND_IN_ADDITIONAL_STRENGTH_MAX:()=>G,DEFAULT_WIND_IN_ADDITIONAL_STRENGTH_MIN:()=>k,DEFAULT_WIND_IN_DELAY:()=>V,DEFAULT_WIND_IN_DELAY_MAX:()=>q,DEFAULT_WIND_IN_DELAY_MIN:()=>X,DEFAULT_WIND_IN_DURATION:()=>K,DEFAULT_WIND_IN_DURATION_MAX:()=>B,DEFAULT_WIND_IN_DURATION_MIN:()=>z,DEFAULT_WIND_OUT_DELAY:()=>Z,DEFAULT_WIND_OUT_DELAY_MAX:()=>H,DEFAULT_WIND_OUT_DELAY_MIN:()=>J,DEFAULT_WIND_OUT_DURATION:()=>tt,DEFAULT_WIND_OUT_DURATION_MAX:()=>Q,DEFAULT_WIND_OUT_DURATION_MIN:()=>$,DEFAULT_WIND_STRENGTH:()=>R,clone:()=>h,diff:()=>bt,getDefaultConfig:()=>ft,isSimpleLayer:()=>p,restart:()=>Kt,schedule:()=>qt,setAmplitude:()=>Ht,setColour:()=>Vt,setDensity:()=>Jt,setFrequency:()=>Zt,setGravity:()=>oe,setGravityAngle:()=>re,setGravityStrength:()=>ae,setGusts:()=>ie,setMassMax:()=>_e,setMassMin:()=>me,setPaused:()=>Qt,setSizeMax:()=>we,setSizeMin:()=>Ae,setWind:()=>te,setWindAngle:()=>ee,setWindInAdditionalStrengthMax:()=>ue,setWindInAdditionalStrengthMin:()=>se,setWindInDelayMax:()=>fe,setWindInDelayMin:()=>le,setWindInDurationMax:()=>de,setWindInDurationMin:()=>ce,setWindOutChangeChance:()=>ye,setWindOutDelayMax:()=>ge,setWindOutDelayMin:()=>pe,setWindOutDurationMax:()=>ve,setWindOutDurationMin:()=>he,setWindStrength:()=>ne,start:()=>Bt,stop:()=>Xt,togglePaused:()=>$t});var e={};n.r(e);var o=n(399),r=n(711),a=n.n(r);function s(t,e){return 1===arguments.length&&(e=t,t=0),void 0===t&&void 0===e?Math.random():void 0!==t&&void 0!==e?t+Math.random()*(e-t):0}function u(t,e){var n=a()("layer");return void 0===t&&void 0===e?n():void 0!==t&&void 0!==e?t+n()*(e-t):0}function c(t){return Math.atan2(t.x,t.y)*(180/Math.PI)}function d(t,e){var n=e*(Math.PI/180),i=Math.cos(n),o=Math.sin(n),r=t.x*i-t.y*o,a=t.x*o+t.y*i;return t.x=r,t.y=a,t}function l(t){var e=document.getElementById(t);if(!e)throw new Error("Error: Element #".concat(t," not found."));return e}function f(t,e,n){var i=t*e;return Math.round(n*(i/2073600))}function h(t){return JSON.parse(JSON.stringify(t))}function v(t,e,n,i){return Array.from({length:t},(function(){var t=s(n),r=s(i),a=o.vec2.create(t,r),u=e.size.min+s()*(e.size.max-e.mass.min);return{position:a,mass:e.mass.min+s()*(e.mass.max-e.mass.min),size:u,renderedSize:u,noise:s(10),amplitude:s(e.sway.amplitude),frequency:s(e.sway.frequency),random:s(),rotation:s(360),time:0,opacity:s(e.opacity.min,e.opacity.max)}}))}function p(t){return"simple"===t.mode||void 0===t.mode}var g=function(){return g=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},g.apply(this,arguments)},y="snowfall",m="#ffffff",_=200,A=1,w=3,x=1,D=3,T=!1,b="simple",M="data:image/png;base64,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",I=0,E=1,S={min:A,max:w},O={min:x,max:D},N={min:I,max:E},U=1,F=.02,W={frequency:F,amplitude:U},L=90,P=.7,C={angle:L,strength:P},j=0,R=0,k=1,G=3,Y={min:k,max:G},z=1e3,B=3e3,K={min:z,max:B},X=1e3,q=1e4,V={min:X,max:q},J=5e3,H=1e4,Z={min:J,max:H},Q=1e4,$=1e3,tt={min:$,max:Q},et=.25,nt=!0,it={duration:tt,delay:Z},ot={additionalStrength:Y,duration:K,delay:V},rt={active:nt,changeChance:et,in:ot,out:it},at={angle:j,strength:R,gusts:rt},st={density:_,mass:S,size:O,sway:W,gravity:C,wind:at,opacity:N},ut=g(g({},st),{colour:m,mode:"simple"}),ct=g(g({},st),{mode:"image",image:M,rotate:T}),dt=[],lt={layers:dt};function ft(){return g(g({},lt),{attachTo:l(y)})}var ht=g(g({},lt),{attachTo:y}),vt=function(){return vt=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},vt.apply(this,arguments)},pt=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]])}return n},gt=function(t,e){var n,i,o,r,a,s,u,c,d,l,f,h,v,p,g,y,A,w,x,D,T,b,M,I,E,U,F,L,P,j,R,k,G,z,B,X,q,J,H,Q,$=e<dt.length?dt[e]:ut;return{colour:t.colour||$.colour||m,opacity:t.opacity||$.opacity||N,density:t.density||$.density||_,mode:"simple",mass:vt(vt(vt({},S),$.mass),t.mass),size:vt(vt(vt({},O),$.size),t.size),sway:vt(vt(vt({},W),$.sway),t.sway),gravity:vt(vt(vt({},C),$.gravity),t.gravity),wind:vt(vt(vt(vt({},at),$.wind),t.wind),{gusts:vt(vt(vt(vt({},rt),null===(n=$.wind)||void 0===n?void 0:n.gusts),null===(i=t.wind)||void 0===i?void 0:i.gusts),{in:vt(vt(vt(vt({},ot),null===(r=null===(o=$.wind)||void 0===o?void 0:o.gusts)||void 0===r?void 0:r.in),null===(s=null===(a=t.wind)||void 0===a?void 0:a.gusts)||void 0===s?void 0:s.in),{additionalStrength:vt(vt(vt({},Y),null===(d=null===(c=null===(u=$.wind)||void 0===u?void 0:u.gusts)||void 0===c?void 0:c.in)||void 0===d?void 0:d.additionalStrength),null===(h=null===(f=null===(l=t.wind)||void 0===l?void 0:l.gusts)||void 0===f?void 0:f.in)||void 0===h?void 0:h.additionalStrength),duration:vt(vt(vt({},K),null===(g=null===(p=null===(v=$.wind)||void 0===v?void 0:v.gusts)||void 0===p?void 0:p.in)||void 0===g?void 0:g.duration),null===(w=null===(A=null===(y=t.wind)||void 0===y?void 0:y.gusts)||void 0===A?void 0:A.in)||void 0===w?void 0:w.duration),delay:vt(vt(vt({},V),null===(T=null===(D=null===(x=$.wind)||void 0===x?void 0:x.gusts)||void 0===D?void 0:D.in)||void 0===T?void 0:T.delay),null===(I=null===(M=null===(b=t.wind)||void 0===b?void 0:b.gusts)||void 0===M?void 0:M.in)||void 0===I?void 0:I.delay)}),out:vt(vt(vt(vt({},it),null===(U=null===(E=$.wind)||void 0===E?void 0:E.gusts)||void 0===U?void 0:U.out),null===(L=null===(F=t.wind)||void 0===F?void 0:F.gusts)||void 0===L?void 0:L.out),{duration:vt(vt(vt({},tt),null===(R=null===(j=null===(P=$.wind)||void 0===P?void 0:P.gusts)||void 0===j?void 0:j.out)||void 0===R?void 0:R.duration),null===(z=null===(G=null===(k=t.wind)||void 0===k?void 0:k.gusts)||void 0===G?void 0:G.out)||void 0===z?void 0:z.duration),delay:vt(vt(vt({},Z),null===(q=null===(X=null===(B=$.wind)||void 0===B?void 0:B.gusts)||void 0===X?void 0:X.out)||void 0===q?void 0:q.delay),null===(Q=null===(H=null===(J=t.wind)||void 0===J?void 0:J.gusts)||void 0===H?void 0:H.out)||void 0===Q?void 0:Q.delay)})})})}},yt=function(t,e){var n,i,o,r,a,s,u,c,d,l,f,h,v,p,g,y,m,A,w,x,D,b,I,E,U,F,L,P,j,R,k,G,z,B,X,q,J,H,Q,$,et=ct;return{density:t.density||et.density||_,mode:"image",image:t.image||et.image||M,opacity:t.opacity||et.opacity||N,rotate:t.rotate||et.rotate||T,mass:vt(vt(vt({},S),et.mass),t.mass),size:vt(vt(vt({},O),et.size),t.size),sway:vt(vt(vt({},W),et.sway),t.sway),gravity:vt(vt(vt({},C),et.gravity),t.gravity),wind:vt(vt(vt(vt({},at),et.wind),t.wind),{gusts:vt(vt(vt(vt({},rt),null===(n=et.wind)||void 0===n?void 0:n.gusts),null===(i=t.wind)||void 0===i?void 0:i.gusts),{in:vt(vt(vt(vt({},ot),null===(r=null===(o=et.wind)||void 0===o?void 0:o.gusts)||void 0===r?void 0:r.in),null===(s=null===(a=t.wind)||void 0===a?void 0:a.gusts)||void 0===s?void 0:s.in),{additionalStrength:vt(vt(vt({},Y),null===(d=null===(c=null===(u=et.wind)||void 0===u?void 0:u.gusts)||void 0===c?void 0:c.in)||void 0===d?void 0:d.additionalStrength),null===(h=null===(f=null===(l=t.wind)||void 0===l?void 0:l.gusts)||void 0===f?void 0:f.in)||void 0===h?void 0:h.additionalStrength),duration:vt(vt(vt({},K),null===(g=null===(p=null===(v=et.wind)||void 0===v?void 0:v.gusts)||void 0===p?void 0:p.in)||void 0===g?void 0:g.duration),null===(A=null===(m=null===(y=t.wind)||void 0===y?void 0:y.gusts)||void 0===m?void 0:m.in)||void 0===A?void 0:A.duration),delay:vt(vt(vt({},V),null===(D=null===(x=null===(w=et.wind)||void 0===w?void 0:w.gusts)||void 0===x?void 0:x.in)||void 0===D?void 0:D.delay),null===(E=null===(I=null===(b=t.wind)||void 0===b?void 0:b.gusts)||void 0===I?void 0:I.in)||void 0===E?void 0:E.delay)}),out:vt(vt(vt(vt({},it),null===(F=null===(U=et.wind)||void 0===U?void 0:U.gusts)||void 0===F?void 0:F.out),null===(P=null===(L=t.wind)||void 0===L?void 0:L.gusts)||void 0===P?void 0:P.out),{duration:vt(vt(vt({},tt),null===(k=null===(R=null===(j=et.wind)||void 0===j?void 0:j.gusts)||void 0===R?void 0:R.out)||void 0===k?void 0:k.duration),null===(B=null===(z=null===(G=t.wind)||void 0===G?void 0:G.gusts)||void 0===z?void 0:z.out)||void 0===B?void 0:B.duration),delay:vt(vt(vt({},Z),null===(J=null===(q=null===(X=et.wind)||void 0===X?void 0:X.gusts)||void 0===q?void 0:q.out)||void 0===J?void 0:J.delay),null===($=null===(Q=null===(H=t.wind)||void 0===H?void 0:H.gusts)||void 0===Q?void 0:Q.out)||void 0===$?void 0:$.delay)})})})}};function mt(t){var e;return vt(vt(vt({},lt),t),{layers:(null!==(e=t.layers)&&void 0!==e?e:[]).map((function(t,e){return p(t)?gt(t,e):yt(t,e)}))})}function _t(t){t.attachTo;var e=mt(pt(t,["attachTo"]));return vt(vt({},e),{attachTo:t.attachTo?l(t.attachTo):l(y)})}function At(t){t.attachTo;var e,n=mt(pt(t,["attachTo"]));return vt(vt({},n),{attachTo:null!==(e=t.attachTo)&&void 0!==e?e:y})}function wt(t){return null!==t&&"object"==typeof t&&t.constructor===Object}function xt(t,e){if(!wt(t))return t;var n={};for(var i in t){var o=t[i],r=e[i];if(o!==r)if(Array.isArray(o)){var a=Dt(o,e[i]||[]);a.length>0&&(n[i]=a)}else if(wt(o)){var s=xt(o,r||{});Object.keys(s).length>0&&(n[i]=s)}else n[i]=o}return n}function Dt(t,e){for(var n,i,o=[],r=0;r<t.length;r++){var a=t[r],s=xt(a,e[r]||(Tt(a)?ct:ut));Tt(a)&&void 0===s.mode&&(s.mode="image"),o.push(s)}return i=e,(n=o).filter((function(t,e){return n.length>i.length||Object.keys(t).length>0||!n.slice(e).every((function(t){return 0===Object.keys(t).length}))}))}function Tt(t){return"image"===t.mode||void 0!==t.image||void 0!==t.rotate}function bt(t){return xt(t,ht)}var Mt,It=Object.freeze({Linear:Object.freeze({None:function(t){return t},In:function(t){return t},Out:function(t){return t},InOut:function(t){return t}}),Quadratic:Object.freeze({In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}}),Cubic:Object.freeze({In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}}),Quartic:Object.freeze({In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}}),Quintic:Object.freeze({In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}}),Sinusoidal:Object.freeze({In:function(t){return 1-Math.sin((1-t)*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.sin(Math.PI*(.5-t)))}}),Exponential:Object.freeze({In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}}),Circular:Object.freeze({In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}}),Elastic:Object.freeze({In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(t){var e=1.70158;return 1===t?1:t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return 0===t?0:--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}}),Bounce:Object.freeze({In:function(t){return 1-It.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*It.Bounce.In(2*t):.5*It.Bounce.Out(2*t-1)+.5}}),generatePow:function(t){return void 0===t&&(t=4),t=(t=t<Number.EPSILON?Number.EPSILON:t)>1e4?1e4:t,{In:function(e){return Math.pow(e,t)},Out:function(e){return 1-Math.pow(1-e,t)},InOut:function(e){return e<.5?Math.pow(2*e,t)/2:(1-Math.pow(2-2*e,t))/2+.5}}}}),Et=function(){return performance.now()},St=function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={}}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},t.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},t.prototype.update=function(t,e){void 0===t&&(t=Et()),void 0===e&&(e=!1);var n=Object.keys(this._tweens);if(0===n.length)return!1;for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<n.length;i++){var o=this._tweens[n[i]],r=!e;o&&!1===o.update(t,r)&&!e&&delete this._tweens[n[i]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0},t}(),Ot={Linear:function(t,e){var n=t.length-1,i=n*e,o=Math.floor(i),r=Ot.Utils.Linear;return e<0?r(t[0],t[1],i):e>1?r(t[n],t[n-1],n-i):r(t[o],t[o+1>n?n:o+1],i-o)},Bezier:function(t,e){for(var n=0,i=t.length-1,o=Math.pow,r=Ot.Utils.Bernstein,a=0;a<=i;a++)n+=o(1-e,i-a)*o(e,a)*t[a]*r(i,a);return n},CatmullRom:function(t,e){var n=t.length-1,i=n*e,o=Math.floor(i),r=Ot.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(o=Math.floor(i=n*(1+e))),r(t[(o-1+n)%n],t[o],t[(o+1)%n],t[(o+2)%n],i-o)):e<0?t[0]-(r(t[0],t[0],t[1],t[1],-i)-t[0]):e>1?t[n]-(r(t[n],t[n],t[n-1],t[n-1],i-n)-t[n]):r(t[o?o-1:0],t[o],t[n<o+1?n:o+1],t[n<o+2?n:o+2],i-o)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=Ot.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:(Mt=[1],function(t){var e=1;if(Mt[t])return Mt[t];for(var n=t;n>1;n--)e*=n;return Mt[t]=e,e}),CatmullRom:function(t,e,n,i,o){var r=.5*(n-t),a=.5*(i-e),s=o*o;return(2*e-2*n+r+a)*(o*s)+(-3*e+3*n-2*r-a)*s+r*o+e}}},Nt=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),Ut=new St,Ft=function(){function t(t,e){void 0===e&&(e=Ut),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=It.Linear.None,this._interpolationFunction=Ot.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Nt.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.getDuration=function(){return this._duration},t.prototype.to=function(t,e){if(void 0===e&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},t.prototype.duration=function(t){return void 0===t&&(t=1e3),this._duration=t<0?0:t,this},t.prototype.dynamic=function(t){return void 0===t&&(t=!1),this._isDynamic=t,this},t.prototype.start=function(t,e){if(void 0===t&&(t=Et()),void 0===e&&(e=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var n in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var i={};for(var o in this._valuesEnd)i[o]=this._valuesEnd[o];this._valuesEnd=i}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},t.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},t.prototype._setupProperties=function(t,e,n,i,o){for(var r in n){var a=t[r],s=Array.isArray(a),u=s?"array":typeof a,c=!s&&Array.isArray(n[r]);if("undefined"!==u&&"function"!==u){if(c){if(0===(g=n[r]).length)continue;for(var d=[a],l=0,f=g.length;l<f;l+=1){var h=this._handleRelativeValue(a,g[l]);if(isNaN(h)){c=!1,console.warn("Found invalid interpolation list. Skipping.");break}d.push(h)}c&&(n[r]=d)}if("object"!==u&&!s||!a||c)(void 0===e[r]||o)&&(e[r]=a),s||(e[r]*=1),i[r]=c?n[r].slice().reverse():e[r]||0;else{e[r]=s?[]:{};var v=a;for(var p in v)e[r][p]=v[p];i[r]=s?[]:{};var g=n[r];if(!this._isDynamic){var y={};for(var p in g)y[p]=g[p];n[r]=g=y}this._setupProperties(v,e[r],g,i[r],o)}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},t.prototype.pause=function(t){return void 0===t&&(t=Et()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this)),this},t.prototype.resume=function(t){return void 0===t&&(t=Et()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},t.prototype.group=function(t){return void 0===t&&(t=Ut),this._group=t,this},t.prototype.delay=function(t){return void 0===t&&(t=0),this._delayTime=t,this},t.prototype.repeat=function(t){return void 0===t&&(t=0),this._initialRepeat=t,this._repeat=t,this},t.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},t.prototype.yoyo=function(t){return void 0===t&&(t=!1),this._yoyo=t,this},t.prototype.easing=function(t){return void 0===t&&(t=It.Linear.None),this._easingFunction=t,this},t.prototype.interpolation=function(t){return void 0===t&&(t=Ot.Linear),this._interpolationFunction=t,this},t.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},t.prototype.onStart=function(t){return this._onStartCallback=t,this},t.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},t.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},t.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},t.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},t.prototype.onStop=function(t){return this._onStopCallback=t,this},t.prototype.update=function(t,e){var n,i,o=this;if(void 0===t&&(t=Et()),void 0===e&&(e=!0),this._isPaused)return!0;var r=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t,!0)}if(this._goToEnd=!1,t<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),!1===this._onEveryStartCallbackFired&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=t-this._startTime,s=this._duration+(null!==(n=this._repeatDelayTime)&&void 0!==n?n:this._delayTime),u=this._duration+this._repeat*s,c=function(){if(0===o._duration)return 1;if(a>u)return 1;var t=Math.trunc(a/s),e=a-t*s,n=Math.min(e/o._duration,1);return 0===n&&a===o._duration?1:n}(),d=this._easingFunction(c);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,d),this._onUpdateCallback&&this._onUpdateCallback(this._object,c),0===this._duration||a>=this._duration){if(this._repeat>0){var l=Math.min(Math.trunc((a-this._duration)/s)+1,this._repeat);for(i in isFinite(this._repeat)&&(this._repeat-=l),this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[i]||(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=s*l,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var f=0,h=this._chainedTweens.length;f<h;f++)this._chainedTweens[f].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(t,e,n,i){for(var o in n)if(void 0!==e[o]){var r=e[o]||0,a=n[o],s=Array.isArray(t[o]),u=Array.isArray(a);!s&&u?t[o]=this._interpolationFunction(a,i):"object"==typeof a&&a?this._updateProperties(t[o],r,a,i):"number"==typeof(a=this._handleRelativeValue(r,a))&&(t[o]=r+(a-r)*i)}},t.prototype._handleRelativeValue=function(t,e){return"string"!=typeof e?e:"+"===e.charAt(0)||"-"===e.charAt(0)?t+parseFloat(e):parseFloat(e)},t.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],n=this._valuesEnd[t];this._valuesStartRepeat[t]="string"==typeof n?this._valuesStartRepeat[t]+parseFloat(n):this._valuesEnd[t],this._valuesEnd[t]=e},t}(),Wt=(Nt.nextId,Ut),Lt=(Wt.getAll.bind(Wt),Wt.removeAll.bind(Wt),Wt.add.bind(Wt),Wt.remove.bind(Wt),Wt.update.bind(Wt));var Pt,Ct,jt=function(){function t(t,e,n,i,r,a,s,u,d){var l=this;this.snowflakes=[],this.paused=!1,this.originalConfig=t,this.config=t,this.width=e,this.height=n,this.windVector=o.vec2.create(0,0),this.gravityVector=o.vec2.create(0,0);var f=this.config.wind.strength;this.config.wind.gusts.active&&(this.fadeWindIn=new Ft(t).to({wind:{strength:i}},r).easing(It.Quadratic.InOut).delay(a).onUpdate((function(){l.setWind(l.config.wind.angle,l.config.wind.strength)})),this.fadeWindOut=new Ft(t).to({wind:{strength:f}},s).easing(It.Quadratic.Out).delay(u).onUpdate((function(){l.setWind(l.config.wind.angle,l.config.wind.strength)})).onComplete((function(){if(d<l.config.wind.gusts.changeChance){var t=c(l.windVector.getOpposite(l.windVector));l.setWindAngle(t)}})))}return t.prototype.setAmplitude=function(t){this.config.sway.amplitude=t},t.prototype.setFrequency=function(t){this.config.sway.frequency=t},t.prototype.setGravity=function(t,e){this.config.gravity.angle=t,this.config.gravity.strength=e,this.originalConfig=h(this.config),this.gravityVector=o.vec2.fromDegrees(t),this.gravityVector.multiplyScalar(e)},t.prototype.setGravityAngle=function(t){this.config.gravity.angle=t,this.originalConfig=h(this.config);var e=this.gravityVector.getLength();this.gravityVector=o.vec2.fromDegrees(t),this.gravityVector.multiplyScalar(e)},t.prototype.setGravityStrength=function(t){this.config.gravity.strength=t,this.originalConfig=h(this.config);var e=c(this.gravityVector);this.gravityVector=o.vec2.fromDegrees(e),this.gravityVector.multiplyScalar(t)},t.prototype.setPaused=function(t){this.paused=t},t.prototype.setWind=function(t,e){this.config.wind.angle=t,this.config.wind.strength=e,this.windVector=o.vec2.fromDegrees(t),this.windVector.multiplyScalar(e)},t.prototype.setWindAngle=function(t){this.config.wind.angle=t,this.originalConfig=h(this.config);var e=this.windVector.getLength();this.windVector=o.vec2.fromDegrees(t),this.windVector.multiplyScalar(e)},t.prototype.setWindStrength=function(t){this.config.wind.strength=t,this.originalConfig=h(this.config);var e=c(this.windVector);this.windVector=o.vec2.fromDegrees(e),this.windVector.multiplyScalar(t)},t.prototype.setGusts=function(t){this.config.wind.gusts.active=t,this.originalConfig=h(this.config),this.restart()},t.prototype.togglePaused=function(){this.paused=!this.paused},t.prototype.setWindInAdditionalStrengthMin=function(t){this.config.wind.gusts.in.additionalStrength.min=t,this.originalConfig=h(this.config)},t.prototype.setWindInAdditionalStrengthMax=function(t){this.config.wind.gusts.in.additionalStrength.max=t,this.originalConfig=h(this.config)},t.prototype.setWindInDurationMin=function(t){this.config.wind.gusts.in.duration.min=t,this.originalConfig=h(this.config)},t.prototype.setWindInDurationMax=function(t){this.config.wind.gusts.in.duration.max=t,this.originalConfig=h(this.config)},t.prototype.setWindInDelayMin=function(t){this.config.wind.gusts.in.delay.min=t,this.originalConfig=h(this.config)},t.prototype.setWindInDelayMax=function(t){this.config.wind.gusts.in.delay.max=t,this.originalConfig=h(this.config)},t.prototype.setWindOutDurationMin=function(t){this.config.wind.gusts.out.duration.min=t,this.originalConfig=h(this.config)},t.prototype.setWindOutDurationMax=function(t){this.config.wind.gusts.out.duration.max=t,this.originalConfig=h(this.config)},t.prototype.setWindOutDelayMin=function(t){this.config.wind.gusts.out.delay.min=t,this.originalConfig=h(this.config)},t.prototype.setWindOutDelayMax=function(t){this.config.wind.gusts.out.delay.max=t,this.originalConfig=h(this.config)},t.prototype.setWindOutChangeChance=function(t){this.config.wind.gusts.changeChance=t,this.originalConfig=h(this.config)},t.prototype.update=function(t){var e=this;if(!this.paused){var n=this.config,i=n.sway,r=n.gravity,a=n.wind;this.snowflakes.forEach((function(n){n.time+=t,function(t,e,n){var i=o.vec2.create(0,0),r=o.vec2.fromDegrees(e);r.multiplyScalar(n),i.x=r.x,i.y=r.y,i.multiplyScalar(t.mass+t.random),t.position.add(i)}(n,a.angle,a.strength),function(t){t.rotation++}(n),function(t,e,n){var i=o.vec2.create(0,0),r=o.vec2.fromDegrees(e);r.multiplyScalar(n),i.x=r.x,i.y=r.y,i.multiplyScalar(t.mass+t.random),t.position.add(i)}(n,r.angle,r.strength),function(t,e,n){var i=t.time+t.noise,r=n.amplitude*Math.sin(n.frequency*t.time+i);d(o.vec2.create(1,0),e.angle);var a=o.vec2.create(r,0);d(a,e.angle+90),t.position.add(a)}(n,r,i),function(t,e,n,i){var r=o.vec2.clone(t.position);(function(t,e,n){var i=t.size,o=t.position.x+i>=0&&t.position.x-i<=e,r=t.position.y+i>=0&&t.position.y-i<=n;return o&&r})(t,e,n)||function(t,e,n,i,r){var a;a=t.position.y>n?"bottom":t.position.y<0?"top":t.position.x<0?"left":t.position.x>e?"right":"bottom";var u=o.vec2.create(t.position.x-r.x,t.position.y-r.y),c=[];u.x>0&&c.push("right"),u.x<0&&c.push("left"),u.y>0&&c.push("bottom"),u.y<0&&c.push("top");var d=["top","bottom","left","right"].filter((function(t){return t!==a&&!c.includes(t)})),l=d[Math.floor(s(0,d.length))],f={top:"bottom",bottom:"top",left:"right",right:"left"}[a];"top"===l?function(t,e){t.position.y=-t.size,t.position.x=s(e)}(t,e):"bottom"===l?function(t,e,n){t.position.y=n+t.size,t.position.x=s(e)}(t,e,n):"left"===l?function(t,e){t.position.y=s(e),t.position.x=-t.size}(t,n):"right"===l&&function(t,e,n){t.position.y=s(n),t.position.x=e+t.size}(t,e,n),l===f&&function(t,e,n){var i=o.vec2.clone(t.position),r=o.vec2.clone(i);r.subtract(n);var a=o.vec2.fromDegrees(e.angle),s=o.vec2.create(-a.x,-a.y);r.dot(s)>0&&(t.renderedSize=function(t,e){return.75*t+.25*e}(t.renderedSize,t.size))}(t,i,r)}(t,e,n,i,r)}(n,e.width,e.height,r)}))}},t.prototype.render=function(t){},t.prototype.start=function(){this.snowflakes=v(f(this.width,this.height,this.config.density),this.config,this.width,this.height),this.setWind(this.config.wind.angle,this.config.wind.strength),this.setGravity(this.config.gravity.angle,this.config.gravity.strength),this.config.wind.gusts.active&&this.fadeWindIn&&this.fadeWindOut&&(this.fadeWindIn.chain(this.fadeWindOut),this.fadeWindOut.chain(this.fadeWindIn),this.fadeWindIn.start())},t.prototype.pause=function(){this.paused=!0},t.prototype.resume=function(){this.paused=!1},t.prototype.restart=function(){var t,e,n;null===(t=this.fadeWindIn)||void 0===t||t.stopChainedTweens(),null===(e=this.fadeWindOut)||void 0===e||e.stopChainedTweens(),this.setWind(this.originalConfig.wind.angle,this.originalConfig.wind.strength),this.config.wind.gusts.active&&(null===(n=this.fadeWindIn)||void 0===n||n.start()),this.snowflakes=v(f(this.width,this.height,this.config.density),this.config,this.width,this.height)},t.prototype.setDensity=function(t){this.config.density=t,this.restart()},t.prototype.setMassMin=function(t){this.config.mass.min=t,this.restart()},t.prototype.setMassMax=function(t){this.config.mass.max=t,this.restart()},t.prototype.setSizeMin=function(t){this.config.size.min=t,this.restart()},t.prototype.setSizeMax=function(t){this.config.size.max=t,this.restart()},t}(),Rt=(Pt=function(t,e){return Pt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Pt(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Pt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),kt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.mode="simple",e}return Rt(e,t),e.prototype.setColour=function(t){throw new Error("Method not implemented.")},e.prototype.render=function(t){var e=this;this.snowflakes.forEach((function(n){t.circle(n.position,n.renderedSize,{fill:{colour:e.config.colour,opacity:n.opacity},line:{width:0}})}))},e}(jt),Gt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Yt=function(t){function e(e,n,i,o,r,a,s,u,c){var d=t.call(this,e,n,i,o,r,a,s,u,c)||this;return d.mode="image",d.image=new Image,d.image.src=e.image,d}return Gt(e,t),e.prototype.setImage=function(t){throw new Error("Method not implemented.")},e.prototype.render=function(t){var e=this;this.snowflakes.forEach((function(n){var i=n.renderedSize,o=i/2;e.config.rotate?t.rotation((function(){t.image(e.image,{x:n.position.x-o,y:n.position.y-o},{width:i,height:i})}),n.rotation,n.position):t.image(e.image,{x:n.position.x-o,y:n.position.y-o},{width:i,height:i})}))},e}(jt);function zt(){if(!Ct)throw new Error("Snowfall simulation not started. Call snowfall.start() first.")}function Bt(t){void 0===t&&(t={});try{Ct||(Ct=function(){var t,e=[],n=o.game.create();function i(){e=[],t.layers.forEach((function(n){var i,o=u(n.wind.strength+n.wind.gusts.in.additionalStrength.min,n.wind.strength+n.wind.gusts.in.additionalStrength.max),r=u(n.wind.gusts.in.delay.min,n.wind.gusts.in.delay.max),a=u(n.wind.gusts.in.delay.min,n.wind.gusts.in.delay.max),s=u(n.wind.gusts.out.duration.min,n.wind.gusts.out.duration.max),c=u(n.wind.gusts.out.delay.min,n.wind.gusts.out.delay.max),d=u();"simple"===n.mode?i=new kt(n,t.attachTo.offsetWidth,t.attachTo.offsetHeight,o,r,a,s,c,d):"image"===n.mode&&(i=new Yt(n,t.attachTo.offsetWidth,t.attachTo.offsetHeight,o,r,a,s,c,d)),i&&(e.push(i),i.start())}))}function r(){e.forEach((function(e){e.width=t.attachTo.offsetWidth,e.height=t.attachTo.offsetHeight,e.restart()})),a()}function a(o){n.setSize(t.attachTo.offsetWidth,t.attachTo.offsetHeight),o?i():e.forEach((function(t){return t.restart()}))}return{start:function(o){void 0===o&&(o={}),function(e){(t=_t(e)).attachTo?i():console.error("Unable to start the application, the specified container could not be found.")}(o),t.attachTo?(window.onresize=r,n.attachTo(t.attachTo),n.setSize(t.attachTo.offsetWidth,t.attachTo.offsetHeight),n.setUpdate((function(t){return function(t){Lt(),e.forEach((function(e){e.update(t)}))}(t)})),n.setRender((function(t){return function(t){t.clear(),e.forEach((function(e){e.render(t)}))}(t)})),n.start()):console.error("Unable to start the application, the specified container could not be found.")},setAmplitude:function(t,n){var i;null===(i=e[n])||void 0===i||i.setAmplitude(t)},setDensity:function(t,n){var i;null===(i=e[n])||void 0===i||i.setDensity(t)},setFrequency:function(t,n){var i;null===(i=e[n])||void 0===i||i.setFrequency(t)},setGravity:function(t,n,i){var o;null===(o=e[i])||void 0===o||o.setGravity(t,n)},setGravityAngle:function(t,n){var i;null===(i=e[n])||void 0===i||i.setGravityAngle(t)},setGravityStrength:function(t,n){var i;null===(i=e[n])||void 0===i||i.setGravityStrength(t)},setPaused:function(t,n){var i;null===(i=e[n])||void 0===i||i.setPaused(t)},setWind:function(t,n,i){var o;null===(o=e[i])||void 0===o||o.setWind(t,n)},setWindAngle:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindAngle(t)},setWindStrength:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindStrength(t)},setGusts:function(t,n){var i;null===(i=e[n])||void 0===i||i.setGusts(t)},togglePaused:function(t){var n;null===(n=e[t])||void 0===n||n.togglePaused()},setWindInAdditionalStrengthMin:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindInAdditionalStrengthMin(t)},setWindInAdditionalStrengthMax:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindInAdditionalStrengthMax(t)},setWindInDurationMin:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindInDurationMin(t)},setWindInDurationMax:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindInDurationMax(t)},setWindInDelayMin:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindInDelayMin(t)},setWindInDelayMax:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindInDelayMax(t)},setWindOutDurationMin:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindOutDurationMin(t)},setWindOutDurationMax:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindOutDurationMax(t)},setWindOutDelayMin:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindOutDelayMin(t)},setWindOutDelayMax:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindOutDelayMax(t)},setWindOutChangeChance:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindOutChangeChance(t)},setColour:function(t,n){"simple"===e[n].mode?e[n].setColour(t):console.error("attempting to set a colour on a layer that does not have a colour property")},setMassMin:function(t,n){var i;null===(i=e[n])||void 0===i||i.setMassMin(t)},setMassMax:function(t,n){var i;null===(i=e[n])||void 0===i||i.setMassMax(t)},setSizeMin:function(t,n){var i;null===(i=e[n])||void 0===i||i.setSizeMin(t)},setSizeMax:function(t,n){var i;null===(i=e[n])||void 0===i||i.setSizeMax(t)},restart:function(t){a(t?_t(t):t)},stop:function(){t=_t(ht),e=[],n.canvas.remove()}}}()),Ct.start(t)}catch(t){console.error(t)}}function Kt(t){void 0===t&&(t={}),Xt(),Bt(t)}function Xt(){null==Ct||Ct.stop(),Ct=void 0}function qt(t,e){void 0===e&&(e={}),function(t){var e=[0,31,29,31,30,31,30,31,31,30,31,30,31];if(t.from.month<1||t.from.month>12||t.from.day<1||t.from.day>e[t.from.month]||t.to.month<1||t.to.month>12||t.to.day<1||t.to.day>e[t.to.month])throw new Error("Invalid date in schedule");var n=new Date,i=100*(n.getUTCMonth()+1)+n.getUTCDate(),o=100*t.from.month+t.from.day,r=100*t.to.month+t.to.day;return o<=r?i>=o&&i<=r:i>=o||i<=r}(t)&&(Xt(),Bt(e))}function Vt(t,e){zt(),Ct.setColour(t,e)}function Jt(t,e){zt(),Ct.setDensity(t,e)}function Ht(t,e){zt(),Ct.setAmplitude(t,e)}function Zt(t,e){zt(),Ct.setFrequency(t,e)}function Qt(t,e){zt(),Ct.setPaused(t,e)}function $t(t){zt(),Ct.togglePaused(t)}function te(t,e,n){zt(),Ct.setWind(t,e,n)}function ee(t,e){zt(),Ct.setWindAngle(t,e)}function ne(t,e){zt(),Ct.setWindStrength(t,e)}function ie(t,e){zt(),Ct.setGusts(t,e)}function oe(t,e,n){zt(),Ct.setGravity(t,e,n)}function re(t,e){zt(),Ct.setGravityAngle(t,e)}function ae(t,e){zt(),Ct.setGravityStrength(t,e)}function se(t,e){zt(),Ct.setWindInAdditionalStrengthMin(t,e)}function ue(t,e){zt(),Ct.setWindInAdditionalStrengthMax(t,e)}function ce(t,e){zt(),Ct.setWindInDurationMin(t,e)}function de(t,e){zt(),Ct.setWindInDurationMax(t,e)}function le(t,e){zt(),Ct.setWindInDelayMin(t,e)}function fe(t,e){zt(),Ct.setWindInDelayMax(t,e)}function he(t,e){zt(),Ct.setWindOutDurationMin(t,e)}function ve(t,e){zt(),Ct.setWindOutDurationMax(t,e)}function pe(t,e){zt(),Ct.setWindOutDelayMin(t,e)}function ge(t,e){zt(),Ct.setWindOutDelayMax(t,e)}function ye(t,e){zt(),Ct.setWindOutChangeChance(t,e)}function me(t,e){zt(),Ct.setMassMin(t,e)}function _e(t,e){zt(),Ct.setMassMax(t,e)}function Ae(t,e){zt(),Ct.setSizeMin(t,e)}function we(t,e){zt(),Ct.setSizeMax(t,e)}const xe=t})(),i})()));
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.snowfall=e():t.snowfall=e()}(this,(()=>(()=>{var t={374:t=>{var e;window,e=function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/js/",n(n.s="./src/bramble.ts")}({"./src/assets.ts":function(t,e,n){"use strict";var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function a(t){try{u(i.next(t))}catch(t){r(t)}}function s(t){try{u(i.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],i=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};function r(t){return new Promise((function(e,n){var i=new XMLHttpRequest;i.addEventListener("load",(function(t){e(i.responseText)})),i.addEventListener("error",(function(t){n(t)})),i.open("GET",t),i.send()}))}function a(t){return new Promise((function(e,n){var i=new Image;i.addEventListener("load",(function(t){e(i)})),i.addEventListener("error",(function(t){n(t)})),i.src=t}))}function s(t){var e;return r(t).then((function(t){return a((e=JSON.parse(t)).path)})).then((function(t){return{name:e.name,type:e.type,image:t,tiles:e.tiles}}))}function u(t){return new Promise((function(e,n){var i=new XMLHttpRequest;i.responseType="arraybuffer",i.addEventListener("load",(function(t){e(i.response)})),i.addEventListener("error",(function(t){n(t)})),i.open("GET",t),i.send()}))}Object.defineProperty(e,"__esModule",{value:!0}),e.loadAllSounds=e.loadSound=e.loadAllTerrain=e.loadTerrain=e.loadAllImages=e.loadImage=e.loadAllText=e.loadText=void 0,e.loadText=r,e.loadAllText=function(t){return void 0===t&&(t=[]),Promise.all(t.map((function(t){return r(t)})))},e.loadImage=a,e.loadAllImages=function(t){return void 0===t&&(t=[]),Promise.all(t.map((function(t){return a(t)})))},e.loadTerrain=s,e.loadAllTerrain=function(t){return void 0===t&&(t=[]),Promise.all(t.map((function(t){return s(t)})))},e.loadSound=u,e.loadAllSounds=function(t){return void 0===t&&(t=[]),Promise.all(t.map((function(t){return u(t)})))},e.default={create:function(){var t=this,e={images:new Map,sounds:new Map,data:new Map};return{add:function(n,s,c){return i(t,void 0,void 0,(function(){var t,i,d;return o(this,(function(o){switch(o.label){case 0:switch(s){case"image":return[3,1];case"sound":return[3,3]}return[3,5];case 1:return[4,a(c)];case 2:return t=o.sent(),e.images.set(n,t),[3,7];case 3:return[4,u(c)];case 4:return i=o.sent(),e.sounds.set(n,i),[3,7];case 5:return[4,r(c)];case 6:d=o.sent(),e.data.set(n,d),o.label=7;case 7:return[2]}}))}))},remove:function(t,n){switch(n){case"image":e.images.delete(t);break;case"sound":e.sounds.delete(t);break;default:e.data.delete(t)}},assets:e}}}},"./src/bramble.ts":function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,o)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.collisions=e.load=e.save=e.vec2=e.sprite=e.mouse=e.keyboard=e.graphics=e.grid=e.game=void 0;var r=n("./src/game.ts");Object.defineProperty(e,"game",{enumerable:!0,get:function(){return r.default}});var a=n("./src/grid.ts");Object.defineProperty(e,"grid",{enumerable:!0,get:function(){return a.default}});var s=n("./src/graphics.ts");Object.defineProperty(e,"graphics",{enumerable:!0,get:function(){return s.default}});var u=n("./src/input.ts");Object.defineProperty(e,"keyboard",{enumerable:!0,get:function(){return u.keyboard}}),Object.defineProperty(e,"mouse",{enumerable:!0,get:function(){return u.mouse}});var c=n("./src/sprite.ts");Object.defineProperty(e,"sprite",{enumerable:!0,get:function(){return c.default}});var d=n("./src/vec2.ts");Object.defineProperty(e,"vec2",{enumerable:!0,get:function(){return d.default}});var l=n("./src/storage.ts");Object.defineProperty(e,"save",{enumerable:!0,get:function(){return l.save}}),Object.defineProperty(e,"load",{enumerable:!0,get:function(){return l.load}});var f=n("./src/collision.ts");Object.defineProperty(e,"collisions",{enumerable:!0,get:function(){return f.default}}),o(n("./src/types.ts"),e)},"./src/collision.ts":function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var o=n("./src/bramble.ts");function r(t,e){var n=o.vec2.create(t.from.x,t.from.y),r=o.vec2.create(t.to.x,t.to.y),a=o.vec2.clone(r);a.subtract(n);var s=1/a.x,u=1/a.y,c={x:(e.x-t.from.x)*s,y:(e.y-t.from.y)*u},d={x:(e.x+e.width-t.from.x)*s,y:(e.y+e.height-t.from.y)*u};if(isNaN(c.x)||isNaN(c.y))return!1;if(isNaN(d.x)||isNaN(d.y))return!1;var l=i({},c),f=i({},d);if(l.x>f.x&&(c.x=f.x,d.x=l.x),l=i({},c),f=i({},d),l.y>f.y&&(c.y=f.y,d.y=l.y),c.x>d.y||c.y>d.x)return!1;var h=Math.max(c.x,c.y),p=Math.min(d.x,d.y);if(p<0)return!1;if(h>1)return!1;if(h<0)return!1;var v=o.vec2.create(0,0);return c.x>c.y?s<0?(v.x=1,v.y=0):(v.x=-1,v.y=0):c.x<c.y?u<0?(v.x=0,v.y=1):(v.x=0,v.y=-1):c.x===c.y&&(s<0&&u<0?(v.x=-1,v.y=1):s>0&&u<0?(v.x=1,v.y=1):s<0&&u>0?(v.x=-1,v.y=-1):s>0&&u>0&&(v.x=1,v.y=-1)),{normal:v,near:o.vec2.create(n.x+h*a.x,n.y+h*a.y),far:o.vec2.create(n.x+p*a.x,n.y+p*a.y),timeOfCollision:h}}e.default={dynamicRectVsStaticRect:function(t,e){if(0===t.velocity.x&&0===t.velocity.y)return!1;var n=t.width/2,i=t.height/2,a=o.vec2.clone(t.position);return a.add(t.velocity),a.x+=t.width/2,a.y+=t.height/2,r({from:{x:t.position.x+n,y:t.position.y+i},to:a},{x:e.position.x-n,y:e.position.y-i,width:e.width+t.width,height:e.height+t.height})},rectVsRect:function(t,e){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y},lineVsRect:r,pointVsRect:function(t,e){return t.x>=e.x&&t.y>=e.y&&t.x<e.x+e.width&&t.y<e.y+e.height},lineVsCubicBezierCurve:function(t,e,n,i,r,a){var s=[],u=-t.x+3*e.x-3*n.x+i.x,c=-t.y+3*e.y-3*n.y+i.y,d=3*t.x-6*e.x+3*n.x,l=3*t.y-6*e.y+3*n.y,f=-3*t.x+3*e.x,h=-3*t.y+3*e.y,p=t.x,v=t.y,y=a.x-r.x,g=a.y-r.y,m=r.x,w=r.y;return function(t,e,n,i){if(Math.abs(t)<1e-10)return function(t,e,n){var i=e*e-4*t*n;if(i<0)return[];if(0===i)return[-e/(2*t)];var o=Math.sqrt(i);return[(-e+o)/(2*t),(-e-o)/(2*t)]}(e,n,i);var o=e/t,r=n/t,a=(3*r-o*o)/3,s=(2*o*o*o-9*o*r+i/t*27)/27,u=s*s/4+a*a*a/27,c=[];if(u>0){var d=Math.cbrt(-s/2+Math.sqrt(u)),l=Math.cbrt(-s/2-Math.sqrt(u));c.push(d+l-o/3)}else if(0===u)d=Math.cbrt(-s/2),c.push(2*d-o/3),c.push(-d-o/3);else{var f=Math.sqrt(-a*a*a/27),h=Math.acos(-s/(2*f));c.push(2*Math.cbrt(f)*Math.cos(h/3)-o/3),c.push(2*Math.cbrt(f)*Math.cos((h+2*Math.PI)/3)-o/3),c.push(2*Math.cbrt(f)*Math.cos((h+4*Math.PI)/3)-o/3)}return c.filter((function(t){return t>=0&&t<=1}))}(u*g-c*y,d*g-l*y,f*g-h*y,(p-m)*g-(v-w)*y).forEach((function(a){var u=function(t,e,n,i,r){var a=(1-r)*(1-r)*(1-r)*t.x+3*(1-r)*(1-r)*r*e.x+3*(1-r)*r*r*n.x+r*r*r*i.x,s=(1-r)*(1-r)*(1-r)*t.y+3*(1-r)*(1-r)*r*e.y+3*(1-r)*r*r*n.y+r*r*r*i.y;return o.vec2.create(a,s)}(t,e,n,i,a),c=function(t,e,n,i,r){var a=3*(1-r)*(1-r)*(e.x-t.x)+6*(1-r)*r*(n.x-e.x)+3*r*r*(i.x-n.x),s=3*(1-r)*(1-r)*(e.y-t.y)+6*(1-r)*r*(n.y-e.y)+3*r*r*(i.y-n.y);return o.vec2.create(a,s)}(t,e,n,i,a),d=Math.atan2(c.y,c.x),l=d*(180/Math.PI),f=o.vec2.fromDegrees(l),h=o.vec2.create(f.y,-f.x),p=u.x-r.x,v=u.y-r.y,_=Math.sqrt(p*p+v*v),x=Math.sqrt(y*y+g*g)-_,A=(u.x-m)/y,b=(u.y-w)/g;(A>=0&&A<=1||b>=0&&b<=1)&&s.push({point:o.vec2.create(u.x,u.y),distance:_,remainderLength:x,angleRadians:d,angleDegrees:l,direction:o.vec2.fromDegrees(l),normal:h})})),s}}},"./src/game.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n("./src/assets.ts"),o=n("./src/graphics.ts"),r=n("./src/input.ts"),a=n("./src/renderer.ts"),s=n("./src/sounds.ts");e.default={create:function(){var t=null,e=null,n=null,u=0,c=document.createElement("canvas"),d=c.getContext("2d"),l=new AudioContext,f=o.default.create(d),h=s.default.create(l),p=i.default.create(),v=a.default.create(d);c.id="bramble-game";var y=r.mouse.create(c),g=r.keyboard.create(c),m={keyboard:g.getState(),mouse:y.getState()},w=function(){e&&(m.keyboard=g.getState(),m.mouse=y.getState(),e({dt:(performance.now()-u)/1e3,input:m,sfx:h,assets:p.assets})),n&&(t&&f.clear(t),n({gfx:v,assets:p.assets}),v.render()),y.update(),g.update(),window.requestAnimationFrame(w),u=performance.now()};return{attachTo:function(t){t.appendChild(c)},setSize:function(t,e){c.width=t,c.height=e},setUpdate:function(t){e=t},setRender:function(t){n=t},setBackgroundColor:function(e){t=e},canvas:c,disableContextMenu:function(){c.addEventListener("contextmenu",(function(t){t.preventDefault()}))},setSmoothing:function(t){void 0===t&&(t=!0),d.imageSmoothingEnabled=t},start:function(){y.start(),g.start(),window.requestAnimationFrame(w)},stop:function(){c.remove()},assets:p}}}},"./src/graphics.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n("./src/graphics/clear.ts"),o=n("./src/graphics/defaults.ts"),r=n("./src/graphics/effects.ts"),a=n("./src/graphics/images.ts"),s=n("./src/graphics/shapes.ts"),u=n("./src/graphics/text.ts"),c=n("./src/graphics/tiles.ts"),d=n("./src/graphics/transforms.ts"),l=n("./src/graphics/sprites.ts"),f=n("./src/graphics/clear.ts");e.default={circle:s.circle,clear:f.clear,clearRect:i.clearRect,create:function(t){return{circle:function(e,n,i){void 0===i&&(i=o.defaultCircle),(0,s.circle)(t,e,n,i)},clear:function(e){(0,f.clear)(t,e)},clearRect:function(e,n){(0,i.clearRect)(t,e,n)},curve:function(e,n,i,o){(0,s.curve)(t,e,n,i,o)},square:function(e,n,i){void 0===i&&(i=o.defaultRect),(0,s.square)(t,e,n,i)},rect:function(e,n){void 0===n&&(n=o.defaultRect),(0,s.rect)(t,e,n)},image:function(e,n,i){(0,a.image)(t,e,n,i)},line:function(e,n,i){void 0===i&&(i=o.defaultLine),(0,s.line)(t,e,n,i)},sprite:function(e){(0,l.sprite)(t,e)},subImage:function(e,n,i,o,r){(0,a.subImage)(t,e,n,i,o,r)},text:function(e,n,i){void 0===e&&(e={x:0,y:0}),void 0===n&&(n=""),void 0===i&&(i=o.defaultText),(0,u.txt)(t,e,n,i)},tiles:function(e,n,i,o){(0,c.tiles)(t,e,n,i,o)},shadow:function(e,n){void 0===n&&(n=o.defaultDropShadow),(0,r.shadow)(t,e,n)},dodge:function(e){(0,r.dodge)(t,e)},overlay:function(e){(0,r.overlay)(t,e)},transparency:function(e,n){void 0===n&&(n=.25),(0,r.transparency)(t,e,n)},rotation:function(e,n,i){void 0===n&&(n=0),void 0===i&&(i={x:0,y:0}),(0,d.rotation)(t,e,n,i)},transform:function(e,n){void 0===n&&(n=o.defaultTransform),(0,d.transform)(t,e,n)},scale:function(e,n){(0,d.scale)(t,e,n)},multiply:function(e){(0,r.multiply)(t,e)},screen:function(e){(0,r.screen)(t,e)},blur:function(e,n){void 0===n&&(n=4),(0,r.blur)(t,e,n)},colourShift:function(e,n){void 0===n&&(n=r.defaultColourShift),(0,r.colourShift)(t,e,n)},strokeGlow:function(e,n){void 0===n&&(n=r.defaultStrokeGlow),(0,r.strokeGlow)(t,e,n)}}},curve:s.curve,dodge:r.dodge,image:a.image,line:s.line,overlay:r.overlay,rotation:d.rotation,rect:s.rect,shadow:r.shadow,sprite:l.sprite,square:s.square,subImage:a.subImage,text:u.txt,tiles:c.tiles,transparency:r.transparency,transform:d.transform,multiply:r.multiply,screen:r.screen,blur:r.blur,colourShift:r.colourShift,strokeGlow:r.strokeGlow}},"./src/graphics/clear.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.clearRect=e.clear=void 0;var i=n("./src/graphics/shapes.ts");e.clear=function(t,e){e?(0,i.rect)(t,{x:0,y:0,width:t.canvas.width,height:t.canvas.height},{fill:{colour:e},line:{width:0}}):t.clearRect(0,0,t.canvas.width,t.canvas.height)},e.clearRect=function(t,e,n){n?(0,i.rect)(t,e,{fill:{colour:n},line:{width:0}}):t.clearRect(e.x,e.y,e.width,e.height)}},"./src/graphics/common.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.freshContext=void 0,e.freshContext=function(t,e){t.save(),e(),t.restore()}},"./src/graphics/defaults.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defaultTransform=e.defaultText=e.defaultCircle=e.defaultLine=e.defaultRect=e.defaultDropShadow=void 0,e.defaultDropShadow={shadowColour:"#000000",shadowBlur:6,shadowOffsetX:4,shadowOffsetY:4},e.defaultRect={fill:{colour:"#000000",opacity:1},line:{width:1,colour:"#FFFFFF",opacity:1}},e.defaultLine={width:1,colour:"#FFFFFF",opacity:1},e.defaultCircle={fill:{colour:"#000000",opacity:1},line:{colour:"#FFFFFF",opacity:1,width:1}},e.defaultText={colour:"#000000",size:"16pt",family:"sans-serif",align:"left",baseline:"top"},e.defaultTransform={rotation:0,scale:1,around:{x:0,y:0}}},"./src/graphics/effects.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.strokeGlow=e.defaultStrokeGlow=e.colourShift=e.defaultColourShift=e.blur=e.screen=e.multiply=e.transparency=e.overlay=e.dodge=e.shadow=void 0;var i=n("./src/utils/object.ts"),o=n("./src/graphics/common.ts"),r=n("./src/graphics/defaults.ts");e.shadow=function(t,e,n){void 0===n&&(n=r.defaultDropShadow),(0,o.freshContext)(t,(function(){n=(0,i.merge)(r.defaultDropShadow,n),t.shadowColor=n.shadowColour,t.shadowBlur=n.shadowBlur,t.shadowOffsetX=n.shadowOffsetX,t.shadowOffsetY=n.shadowOffsetY,e()}))},e.dodge=function(t,e){(0,o.freshContext)(t,(function(){t.globalCompositeOperation="color-dodge",e()}))},e.overlay=function(t,e){(0,o.freshContext)(t,(function(){t.globalCompositeOperation="overlay",e()}))},e.transparency=function(t,e,n){void 0===n&&(n=.25),(0,o.freshContext)(t,(function(){t.globalAlpha*=n,e()}))},e.multiply=function(t,e){(0,o.freshContext)(t,(function(){t.globalCompositeOperation="multiply",e()}))},e.screen=function(t,e){(0,o.freshContext)(t,(function(){t.globalCompositeOperation="screen",e()}))},e.blur=function(t,e,n){void 0===n&&(n=4),t.filter="blur(".concat(n,"px)"),e()},e.defaultColourShift={hue:0,saturate:1},e.colourShift=function(t,n,i){void 0===i&&(i=e.defaultColourShift),(0,o.freshContext)(t,(function(){var e=i.hue,o=i.saturate;t.filter="hue-rotate(".concat(e,"deg) saturate(").concat(o,")"),n()}))},e.defaultStrokeGlow={color:"white",blur:8},e.strokeGlow=function(t,n,i){void 0===i&&(i=e.defaultStrokeGlow),(0,o.freshContext)(t,(function(){var e,o;t.shadowColor=null!==(e=i.color)&&void 0!==e?e:"white",t.shadowBlur=null!==(o=i.blur)&&void 0!==o?o:8,t.shadowOffsetX=0,t.shadowOffsetY=0,n()}))}},"./src/graphics/images.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.subImage=e.image=void 0,e.image=function(t,e,n,i){i?t.drawImage(e,n.x,n.y,i.width,i.height):t.drawImage(e,n.x,n.y,e.width,e.height)},e.subImage=function(t,e,n,i,o,r){t.drawImage(e,o.x,o.y,r.width,r.height,n.x,n.y,i.width,i.height)}},"./src/graphics/shape_utils.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.shouldSinglePass=e.shouldDrawFill=e.shouldDrawOutline=e.shouldDrawLine=void 0,e.shouldDrawLine=function(t){return 0!==t.opacity&&0!==t.width},e.shouldDrawOutline=function(t){return 0!==t.line.opacity&&0!==t.line.width},e.shouldDrawFill=function(t){return 0!==t.fill.opacity},e.shouldSinglePass=function(t){return 1===t.fill.opacity&&1===t.line.opacity&&t.line.width>0}},"./src/graphics/shapes.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.path=e.circle=e.curve=e.quadratic=e.bezier=e.line=e.rect=e.square=void 0;var i=n("./src/utils/object.ts"),o=n("./src/graphics/defaults.ts"),r=n("./src/graphics/effects.ts"),a=n("./src/graphics/shape_utils.ts");function s(t,e,n){void 0===n&&(n=o.defaultRect),n=(0,i.merge)(o.defaultRect,n),(0,a.shouldSinglePass)(n)?function(t,e,n){t.fillStyle=n.fill.colour,t.strokeStyle=n.line.colour,t.lineWidth=n.line.width,t.fillRect(e.x,e.y,e.width,e.height),t.strokeRect(e.x,e.y,e.width,e.height)}(t,e,n):((0,a.shouldDrawFill)(n)&&(0,r.transparency)(t,(function(){return function(t,e,n){t.fillStyle=n.fill.colour,t.fillRect(e.x,e.y,e.width,e.height)}(t,e,n)}),n.fill.opacity),(0,a.shouldDrawOutline)(n)&&(0,r.transparency)(t,(function(){return function(t,e,n){t.strokeStyle=n.line.colour,t.lineWidth=n.line.width,t.strokeRect(e.x,e.y,e.width,e.height)}(t,e,n)}),n.line.opacity))}function u(t,e,n,s){void 0===s&&(s=o.defaultLine),s=(0,i.merge)(o.defaultLine,s),(0,a.shouldDrawLine)(s)&&(0,r.transparency)(t,(function(){t.strokeStyle=s.colour,t.lineWidth=s.width,t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(n.x,n.y),t.stroke(),t.closePath()}),s.opacity)}function c(t,e,n,s,u,c){void 0===c&&(c=o.defaultLine),c=(0,i.merge)(o.defaultLine,c),(0,a.shouldDrawLine)(c)&&(0,r.transparency)(t,(function(){t.strokeStyle=c.colour,t.lineWidth=c.width,t.beginPath(),t.moveTo(e.x,e.y),t.bezierCurveTo(s.x,s.y,u.x,u.y,n.x,n.y),t.stroke(),t.closePath()}),c.opacity)}function d(t,e,n,s,u){void 0===u&&(u=o.defaultLine),u=(0,i.merge)(o.defaultLine,u),(0,a.shouldDrawLine)(u)&&(0,r.transparency)(t,(function(){t.strokeStyle=u.colour,t.lineWidth=u.width,t.beginPath(),t.moveTo(e.x,e.y),t.quadraticCurveTo(s.x,s.y,n.x,n.y),t.stroke(),t.closePath()}))}e.square=function(t,e,n,i){void 0===i&&(i=o.defaultRect),s(t,{x:e.x,y:e.y,width:n,height:n},i)},e.rect=s,e.line=u,e.bezier=c,e.quadratic=d,e.curve=function(t,e,n,i,r){void 0===r&&(r=o.defaultLine),i.cp1&&i.cp2?c(t,e,n,i.cp1,i.cp2,r):i.cp1&&!i.cp2?d(t,e,n,i.cp1,r):u(t,e,n,r)},e.circle=function(t,e,n,s){void 0===s&&(s=o.defaultCircle),s=(0,i.merge)(o.defaultCircle,s),(0,a.shouldSinglePass)(s)?function(t,e,n,i){t.fillStyle=i.fill.colour,t.strokeStyle=i.line.colour,t.lineWidth=i.line.width,t.beginPath(),t.arc(e.x,e.y,n,0,2*Math.PI),t.closePath(),t.fill(),t.stroke()}(t,e,n,s):((0,a.shouldDrawFill)(s)&&(0,r.transparency)(t,(function(){return function(t,e,n,i){t.fillStyle=i.fill.colour,t.beginPath(),t.arc(e.x,e.y,n,0,2*Math.PI),t.closePath(),t.fill()}(t,e,n,s)}),s.fill.opacity),(0,a.shouldDrawOutline)(s)&&(0,r.transparency)(t,(function(){return function(t,e,n,i){t.strokeStyle=i.line.colour,t.lineWidth=i.line.width,t.beginPath(),t.arc(e.x,e.y,n,0,2*Math.PI),t.closePath(),t.stroke()}(t,e,n,s)}),s.line.opacity))},e.path=function(t,e,n){void 0===n&&(n=o.defaultLine),n=(0,i.merge)(o.defaultLine,n),(0,a.shouldDrawLine)(n)&&(0,r.transparency)(t,(function(){t.globalAlpha=n.opacity,t.strokeStyle=n.colour,t.lineWidth=n.width,t.beginPath(),e(),t.stroke()}),n.opacity)}},"./src/graphics/sprites.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sprite=void 0;var i=n("./src/utils/number.ts"),o=n("./src/graphics/common.ts"),r=n("./src/graphics/images.ts");e.sprite=function(t,e){(0,o.freshContext)(t,(function(){var n=e.size.width/2,o=e.size.height/2;t.translate(e.position.x+n,e.position.y+o),t.rotate(i.default.toRadians(e.rotation)),e.frames.length>1?(0,r.subImage)(t,e.texture,{x:-n,y:-o},{width:e.size.width,height:e.size.height},{x:e.frames[e.frame].position.x,y:e.frames[e.frame].position.y},{width:e.frames[e.frame].size.width,height:e.frames[e.frame].size.height}):(0,r.image)(t,e.texture,{x:-n,y:-o},{width:e.size.width,height:e.size.height})}))}},"./src/graphics/text.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.txt=void 0;var i=n("./src/utils/object.ts"),o=n("./src/graphics/common.ts"),r=n("./src/graphics/defaults.ts");e.txt=function(t,e,n,a){void 0===n&&(n=""),void 0===a&&(a=r.defaultText),(0,o.freshContext)(t,(function(){a=(0,i.merge)(r.defaultText,a),t.fillStyle=a.colour,t.font="".concat(a.size," ").concat(a.family),t.textAlign=a.align,t.textBaseline=a.baseline,t.fillText(n,e.x,e.y)}))}},"./src/graphics/tiles.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tiles=e.tile=void 0;var i=n("./src/graphics/images.ts");function o(t,e,n,o,r,a,s){(0,i.subImage)(t,n,{x:e.x+a*(o.x*s.width),y:e.y+a*(o.y*s.height)},{width:a*s.width,height:a*s.height},{x:s.width*r.x,y:s.height*r.y},{width:s.width,height:s.height})}e.tile=o,e.tiles=function(t,e,n,i,r){for(var a=function(a){for(var s=function(s){if(0===n[a][s])return"continue";var u=a>0?n[a-1][s-1]:0,c=a>0?n[a-1][s]:0,d=a>0?n[a-1][s+1]:0,l=n[a][s-1],f=n[a][s],h=n[a][s+1],p=a<n.length-1?n[a+1][s-1]:0,v=a<n.length-1?n[a+1][s]:0,y=a<n.length-1?n[a+1][s+1]:0,g=1*(f===c&&f===l&&f===u?1:0)+2*(f===c?1:0)+4*(f===c&&f===h&&f===d?1:0)+8*(f===h?1:0)+16*(f===v&&f===h&&f===y?1:0)+32*(f===v?1:0)+64*(f===v&&f===l&&f===p?1:0)+128*(f===l?1:0),m=i.filter((function(t){return t.type===n[a][s]}))[0];if(!m)return console.error("Sheet ".concat(n[a][s]," not found!")),{value:void 0};var w=m.tiles.filter((function(t){return t.type===g})),_=w[Math.floor(Math.random()*w.length)];_?o(t,e,m.image,{x:s,y:a},_.position,r,_.size):console.error("Tile not defined ".concat(g))},u=0;u<n[a].length;u++){var c=s(u);if("object"==typeof c)return c}},s=0;s<n.length;s++){var u=a(s);if("object"==typeof u)return u.value}}},"./src/graphics/transforms.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.transform=e.scale=e.rotation=void 0;var i=n("./src/utils/number.ts"),o=n("./src/utils/object.ts"),r=n("./src/graphics/common.ts"),a=n("./src/graphics/defaults.ts");function s(t,e,n,o){(0,r.freshContext)(t,(function(){t.translate(o.x,o.y),t.rotate(i.default.toRadians(n)),t.translate(-o.x,-o.y),e()}))}function u(t,e,n,i){void 0===i&&(i={x:0,y:0}),(0,r.freshContext)(t,(function(){t.translate(i.x,i.y),"number"==typeof n?t.scale(n,n):t.scale(n.x,n.y),t.translate(-i.x,-i.y),e()}))}e.rotation=s,e.scale=u,e.transform=function(t,e,n){void 0===n&&(n=a.defaultTransform),n=(0,o.merge)(a.defaultTransform,n),u(t,(function(){s(t,e,n.rotation,n.around)}),n.scale,n.around)}},"./src/grid.ts":function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};function o(t){return t.map((function(t){return t.slice()}))}Object.defineProperty(e,"__esModule",{value:!0});var r={pos:{x:0,y:0},visible:!0,divisions:4,tileWidth:8,tileHeight:8,scale:1};e.default={create:function(t,e){void 0===e&&(e=r),e=i(i({},r),e);var n=function(t,e,n){void 0===t&&(t=1),void 0===e&&(e=1),void 0===n&&(n=null);for(var i=[],o=0;o<e;o++){for(var r=[],a=0;a<t;a++)r.push(n);i.push(r)}return i}(t.width,t.height,0),o={x:e.pos.x,y:e.pos.y},a=e.visible,s=e.divisions,u=e.tileWidth;return{divisions:s,pos:o,tileHeight:e.tileHeight,tiles:n,tileWidth:u,visible:a,size:t,tileSize:e.tileWidth,scale:e.scale}},fill:function(t,e,n,i){var r=o(t);return function t(e,n,i){n!==i&&r[e.y][e.x]===n&&e.x<r[e.y].length&&e.x>=0&&e.y<r.length&&e.y>=0&&(r[e.y][e.x]=i,e.y<r.length-1&&t({x:e.x,y:e.y+1},n,i),e.y>0&&t({x:e.x,y:e.y-1},n,i),e.x<r[0].length-1&&t({x:e.x+1,y:e.y},n,i),e.x>0&&t({x:e.x-1,y:e.y},n,i))}(e,n,i),r},copyTiles:o}},"./src/input.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.gamepad=e.keyboard=e.mouse=void 0;var i=n("./src/input/mouse.ts"),o=n("./src/input/keyboard.ts"),r=n("./src/input/gamepad.ts");e.mouse={create:function(t){var e=i.default.create(t);return{start:function(){return e.start()},update:function(){return e.update()},getState:function(){return e.getState()}}}},e.keyboard={create:function(t){var e=o.default.create(t);return{start:function(){return e.start()},update:function(){return e.update()},getState:function(){return e.getState()}}}},e.gamepad={create:function(){var t=r.default.create();return{start:function(){return t.start()},update:function(){return t.update()},getState:function(){return t.getState()}}}}},"./src/input/gamepad.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={create:function(){var t={},e=function(t){console.info(t.gamepad)},n=function(t){console.info(t.gamepad)};return{getState:function(){return t},start:function(){window.addEventListener("gamepadconnected",e),window.addEventListener("gamepaddisconnected",n)},update:function(){}}}}},"./src/input/keyboard.ts":function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var o,r=n("./src/input/keys.ts"),a=(o={pressed:!1,justPressed:!1,released:!1,justReleased:!1},r.default.reduce((function(t,e){var n=e.name;return delete e.label,t[n]=i(i({},e),o),t}),{}));function s(t,e){for(var n=null,i=Object.keys(e),o=0;o<i.length;o++)e[i[o]].code===t.code&&(n=e[i[o]]);return n||console.error("No key definition found for ".concat(t.code)),n}function u(t){!function(t){["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(t.key)&&t.preventDefault()}(t);var e=s(t,a);e.pressed||(e.justPressed=!0),e.pressed=!0}function c(t){var e=s(t,a);e.released||(e.justReleased=!0),e.pressed=!1,e.released=!0}function d(){Object.keys(a).forEach((function(t){a[t].justPressed=!1,a[t].justReleased=!1}))}e.default={create:function(t){return{start:function(){t.addEventListener("keydown",u),t.addEventListener("keyup",c)},update:d,getState:function(){return a}}}}},"./src/input/keys.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=[{code:"Backspace",name:"backspace"},{code:"Tab",name:"tab"},{code:"Enter",name:"enter"},{code:"ShiftLeft",name:"shiftLeft"},{code:"ShiftRight",name:"shiftRight"},{code:"ControlLeft",name:"ctrlLeft"},{code:"ControlRight",name:"ctrlRight"},{code:"AltLeft",name:"altLeft"},{code:"AltRight",name:"altRight"},{code:"CapsLock",name:"caps"},{code:"Escape",name:"escape"},{code:"Space",name:"space"},{code:"PageUp",name:"pageUp"},{code:"PageDown",name:"pageDown"},{code:"End",name:"end"},{code:"Home",name:"home"},{code:"ArrowLeft",name:"left"},{code:"ArrowUp",name:"up"},{code:"ArrowRight",name:"right"},{code:"ArrowDown",name:"down"},{code:"Insert",name:"insert"},{code:"Delete",name:"delete"},{code:"Digit0",name:"zero"},{code:"Digit1",name:"one"},{code:"Digit2",name:"two"},{code:"Digit3",name:"three"},{code:"Digit4",name:"four"},{code:"Digit5",name:"five"},{code:"Digit6",name:"six"},{code:"Digit7",name:"seven"},{code:"Digit8",name:"eight"},{code:"Digit9",name:"nine"},{code:"KeyA",name:"A"},{code:"KeyB",name:"B"},{code:"KeyC",name:"C"},{code:"KeyD",name:"D"},{code:"KeyE",name:"E"},{code:"KeyF",name:"F"},{code:"KeyG",name:"G"},{code:"KeyH",name:"H"},{code:"KeyI",name:"I"},{code:"KeyJ",name:"J"},{code:"KeyK",name:"K"},{code:"KeyL",name:"L"},{code:"KeyM",name:"M"},{code:"KeyN",name:"N"},{code:"KeyO",name:"O"},{code:"KeyP",name:"P"},{code:"KeyQ",name:"Q"},{code:"KeyR",name:"R"},{code:"KeyS",name:"S"},{code:"KeyT",name:"T"},{code:"KeyU",name:"U"},{code:"KeyV",name:"V"},{code:"KeyW",name:"W"},{code:"KeyX",name:"X"},{code:"KeyY",name:"Y"},{code:"KeyZ",name:"Z"},{code:"OSLeft",name:"superLeft"},{code:"OSRight",name:"superRight"},{code:"ContextMenu",name:"menu"},{code:"Numpad0",name:"num0"},{code:"Numpad1",name:"num1"},{code:"Numpad2",name:"num2"},{code:"Numpad3",name:"num3"},{code:"Numpad4",name:"num4"},{code:"Numpad5",name:"num5"},{code:"Numpad6",name:"num6"},{code:"Numpad7",name:"num7"},{code:"Numpad8",name:"num8"},{code:"Numpad9",name:"num9"},{code:"NumpadMultiply",name:"multiply"},{code:"NumpadAdd",name:"add"},{code:"NumpadDivide",name:"divide"},{code:"NumpadDecimal",name:"point"},{code:"NumpadMinus",name:"minus"},{code:"NumpadEnter",name:"numEnter"},{code:"F1",name:"F1"},{code:"F2",name:"F2"},{code:"F3",name:"F3"},{code:"F4",name:"F4"},{code:"F5",name:"F5"},{code:"F6",name:"F6"},{code:"F7",name:"F7"},{code:"F8",name:"F8"},{code:"F9",name:"F9"},{code:"F10",name:"F10"},{code:"F11",name:"F11"},{code:"F12",name:"F12"},{code:"NumLock",name:"numLock"},{code:"ScrollLock",name:"scrollLock"},{code:"Semicolon",name:"semiColon"},{code:"Equal",name:"equals"},{code:"Comma",name:"comma"},{code:"Minus",name:"dash"},{code:"Period",name:"dot"},{code:"Slash",name:"slash"},{code:"Backquote",name:"backtick"},{code:"Backslash",name:"backSlash"},{code:"IntlBackslash",name:"intlBackslash"},{code:"BracketLeft",name:"openBracket"},{code:"BracketRight",name:"closeBracket"},{code:"Quote",name:"quote"},{code:"MetaLeft",name:"metaLeft"},{code:"MetaRight",name:"metaRight"}]},"./src/input/mouse.ts":function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.default={create:function(t){var e=function(){return{position:{x:0,y:0},left:n(),wheel:o(),right:n()}},n=function(){return{pressed:!1,justPressed:!1,released:!1,justReleased:!1}},o=function(){var t=n();return i(i({},t),{moved:!1,direction:"up"})},r=(e(),e()),a=function(e){var n=function(e){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}(e);r.position=n},s=function(t){switch(t.which){case 1:r.left.pressed||(r.left.justPressed=!0),r.left.pressed=!0;break;case 2:r.wheel.pressed||(r.wheel.justPressed=!0),r.wheel.pressed=!0;break;case 3:r.right.pressed||(r.right.justPressed=!0),r.right.pressed=!0}},u=function(t){switch(t.which){case 1:r.left.released||(r.left.justReleased=!0),r.left.released=!0,r.left.pressed=!1;break;case 2:r.wheel.released||(r.wheel.justReleased=!0),r.wheel.released=!0,r.wheel.pressed=!1;break;case 3:r.right.released||(r.right.justReleased=!0),r.right.released=!0,r.right.pressed=!1}},c=function(t){r.wheel.moved=0!==t.deltaY,!1!==r.wheel.moved&&(r.wheel.direction=t.deltaY<0?"up":"down")};return{getState:function(){return r},start:function(){t.addEventListener("mousemove",a),t.addEventListener("mousedown",s),t.addEventListener("mouseup",u),t.addEventListener("wheel",c),r.position.x=t.width/2,r.position.y=t.height/2},update:function(){var t;r.wheel.moved=!1,r.left.justPressed=!1,r.right.justPressed=!1,r.left.justReleased=!1,r.right.justReleased=!1,r.wheel.justPressed=!1,r.wheel.justReleased=!1,t=r,Object.assign({},t)}}}}},"./src/renderer.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n("./src/graphics/defaults.ts"),o=n("./src/graphics/shapes.ts"),r=n("./src/graphics/clear.ts"),a=n("./src/graphics/effects.ts"),s=n("./src/graphics/images.ts"),u=n("./src/graphics/text.ts"),c=n("./src/graphics/tiles.ts"),d=n("./src/graphics/sprites.ts"),l=n("./src/utils/object.ts");e.default={create:function(t){var e=[],n=[],f=[],h=[],p=[];function v(){t.setTransform(1,0,0,1,0,0);for(var e=0,n=h;e<n.length;e++){var i=n[e];if("scale"in i){var o=i.scale;t.translate(i.around.x,i.around.y),"number"==typeof o?t.scale(o,o):t.scale(o.x,o.y),t.translate(-i.around.x,-i.around.y)}"rotate"in i&&(t.translate(i.around.x,i.around.y),t.rotate(i.rotate*Math.PI/180),t.translate(-i.around.x,-i.around.y))}}function y(){t.globalAlpha=p.reduce((function(t,e){return t*e}),1)}function g(){e.push({type:"popShadow"})}function m(){e.push({type:"pop"})}function w(t){e.push({type:"pushComposite",op:t})}function _(){e.push({type:"popComposite"})}function x(t,n,i){void 0===i&&(i={x:0,y:0}),function(t,n){void 0===n&&(n={x:0,y:0}),e.push({type:"pushTransform",transform:{scale:t,around:n}})}(n,i),t(),e.push({type:"popTransform"})}function A(t,n,i){void 0===i&&(i={x:0,y:0}),function(t,n){e.push({type:"pushTransform",transform:{rotate:t,around:n}})}(n,i),t(),e.push({type:"popTransform"})}return{circle:function(n,r,a){void 0===a&&(a=i.defaultCircle),e.push({type:"draw",fn:function(){return(0,o.circle)(t,n,r,a)}})},clear:function(n){e.push({type:"draw",fn:function(){return(0,r.clear)(t,n)}})},clearRect:function(n,i){e.push({type:"draw",fn:function(){return(0,r.clearRect)(t,n,i)}})},curve:function(n,r,a,s){void 0===s&&(s=i.defaultLine),e.push({type:"draw",fn:function(){return(0,o.curve)(t,n,r,a,s)}})},dodge:function(t){w("color-dodge"),t(),_()},image:function(n,i,o){e.push({type:"draw",fn:function(){return(0,s.image)(t,n,i,o)}})},line:function(n,i,r){e.push({type:"draw",fn:function(){return(0,o.line)(t,n,i,r)}})},overlay:function(t){w("overlay"),t(),_()},rotation:A,rect:function(n,i){e.push({type:"draw",fn:function(){return(0,o.rect)(t,n,i)}})},shadow:function(t,n){void 0===n&&(n=i.defaultDropShadow),function(t){e.push({type:"pushShadow",shadow:t})}((0,l.merge)(i.defaultDropShadow,n)),t(),g()},sprite:function(n){e.push({type:"draw",fn:function(){return(0,d.sprite)(t,n)}})},scale:x,square:function(n,i,r){e.push({type:"draw",fn:function(){return(0,o.square)(t,n,i,r)}})},subImage:function(n,i,o,r,a){e.push({type:"draw",fn:function(){return(0,s.subImage)(t,n,i,o,r,a)}})},text:function(n,i,o){void 0===i&&(i=""),e.push({type:"draw",fn:function(){return(0,u.txt)(t,n,i,o)}})},tiles:function(n,i,o,r){e.push({type:"draw",fn:function(){return(0,c.tiles)(t,n,i,o,r)}})},transparency:function(t,n){void 0===n&&(n=.25),function(t){e.push({type:"pushAlpha",alpha:t})}(n),t(),e.push({type:"popAlpha"})},transform:function(t,e){void 0===e&&(e=i.defaultTransform);var n=(0,l.merge)(i.defaultTransform,e);x((function(){A(t,n.rotation,n.around)}),n.scale,n.around)},multiply:function(t){w("multiply"),t(),_()},screen:function(t){w("screen"),t(),_()},blur:function(t,n){var i;void 0===n&&(n=4),i=n,e.push({type:"push",filter:"blur(".concat(i,"px)")}),t(),m()},colourShift:function(t,n){void 0===n&&(n=a.defaultColourShift),function(t){var n=t.hue,i=t.saturate;e.push({type:"push",filter:"hue-rotate(".concat(n,"deg) saturate(").concat(i,")")})}(n),t(),m()},strokeGlow:function(t,n){void 0===n&&(n=a.defaultStrokeGlow),function(t){var n,i;void 0===t&&(t=a.defaultStrokeGlow),e.push({type:"pushShadow",shadow:{shadowColour:null!==(n=t.color)&&void 0!==n?n:"white",shadowBlur:null!==(i=t.blur)&&void 0!==i?i:8,shadowOffsetX:0,shadowOffsetY:0}})}(n),t(),g()},render:function(){for(var i=0,o=e;i<o.length;i++){var r=o[i];switch(r.type){case"push":n.push(r.filter),t.filter=n.join(" ");break;case"pop":n.pop(),t.filter=n.join(" ");break;case"pushAlpha":p.push(r.alpha),y();break;case"popAlpha":p.pop(),y();break;case"pushComposite":f.push(r.op),t.globalCompositeOperation=f[f.length-1];break;case"popComposite":f.pop(),t.globalCompositeOperation=f[f.length-1]||"source-over";break;case"pushTransform":h.push(r.transform),v();break;case"popTransform":h.pop(),v();break;case"draw":r.fn()}}e=[],n=[],f=[],h=[],p=[]}}}}},"./src/sounds.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={create:function(t){return{play:function(t){},pause:function(t){},mute:function(t){},volume:function(t,e){}}}}},"./src/sprite.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={create:function(t,e,n,i,o){void 0===n&&(n=0),void 0===o&&(o="#ffffff");var r=[];return{size:e,texture:i,colour:o,frame:0,position:t,setFrames:function(t){r=t},addFrame:function(t){r.push(t)},get frames(){return r},get rotation(){return n},set rotation(t){n=t>=360?360-t:t}}}}},"./src/storage.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.clear=e.remove=e.load=e.save=void 0,e.save=function(t,e){localStorage.setItem(t,e)},e.load=function(t){return localStorage.getItem(t)},e.remove=function(t){localStorage.removeItem(t)},e.clear=function(){localStorage.clear()}},"./src/types.ts":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},"./src/utils/number.ts":function(t,e,n){"use strict";function i(t){return t*(Math.PI/180)}function o(t){return t*(180/Math.PI)}Object.defineProperty(e,"__esModule",{value:!0}),e.clamp=e.toDegrees=e.toRadians=void 0,e.toRadians=i,e.toDegrees=o,e.clamp=function(t,e,n){return e>n?(console.error("clamp: the minimum (".concat(e,") and maximum (").concat(n,") have been passed in the wrong order")),t):t<e?e:t>n?n:t},e.default={toRadians:i,toDegrees:o}},"./src/utils/object.ts":function(t,e,n){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};function o(t){var e={};return Object.keys(t).forEach((function(n){"object"==typeof t[n]?e[n]=o(t[n]):e[n]=t[n]})),e}function r(t,e){return void 0===e&&(e=!0),!0===e?o(t):function(t){return i({},t)}(t)}function a(t,e,n){return void 0===n&&(n=!0),!0===n?function(t,e){var n={};return Object.keys(t).forEach((function(i){"object"==typeof t[i]?n[i]=void 0===e[i]?t[i]:a(t[i],e[i]):n[i]=void 0===e[i]?t[i]:e[i]})),Object.keys(e).forEach((function(i){void 0===t[i]&&(n[i]=e[i])})),n}(t,e):function(t,e){return i(i({},t),e)}(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.merge=e.clone=void 0,e.clone=r,e.merge=a,e.default={merge:a,clone:r}},"./src/vec2.ts":function(t,e,n){"use strict";function i(t,e){var n=t,r=e,a=function(){return Math.sqrt(n*n+r*r)},s=function(t){n*=t,r*=t},u=function(){var t=a();n/=t,r/=t};return{add:function(t){n+=t.x,r+=t.y},addScalar:function(t){n+=t,r+=t},clone:o,divide:function(t){n/=t.x,r/=t.y},divideScalar:function(t){n/=t,r/=t},dot:function(t){return n*t.x+r*t.y},getLength:a,getOpposite:function(){return i(-n,-r)},getPerp:function(){return i(-r,n)},isEqualTo:function(t){return n==t.x&&r==t.y},multiply:function(t){n*=t.x,r*=t.y},multiplyScalar:s,normalise:u,setLength:function(t){u(),s(t)},subtract:function(t){n-=t.x,r-=t.y},subtractScalar:function(t){n-=t,r-=t},set x(t){n=t},get x(){return n},set y(t){r=t},get y(){return r}}}Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){return i(t.x,t.y)};e.default={clone:o,create:i,fromDegrees:function(t){var e=t*(Math.PI/180);return i(Math.cos(e),Math.sin(e))}}}})},t.exports=e()},711:(t,e,n)=>{var i=n(308),o=n(989),r=n(679),a=n(875),s=n(993),u=n(813),c=n(713);c.alea=i,c.xor128=o,c.xorwow=r,c.xorshift7=a,c.xor4096=s,c.tychei=u,t.exports=c},308:function(t,e,n){var i;!function(t,o){function r(t){var e,n=this,i=(e=4022871197,function(t){t=String(t);for(var n=0;n<t.length;n++){var i=.02519603282416938*(e+=t.charCodeAt(n));i-=e=i>>>0,e=(i*=e)>>>0,e+=4294967296*(i-=e)}return 2.3283064365386963e-10*(e>>>0)});n.next=function(){var t=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=t-(n.c=0|t)},n.c=1,n.s0=i(" "),n.s1=i(" "),n.s2=i(" "),n.s0-=i(t),n.s0<0&&(n.s0+=1),n.s1-=i(t),n.s1<0&&(n.s1+=1),n.s2-=i(t),n.s2<0&&(n.s2+=1),i=null}function a(t,e){return e.c=t.c,e.s0=t.s0,e.s1=t.s1,e.s2=t.s2,e}function s(t,e){var n=new r(t),i=e&&e.state,o=n.next;return o.int32=function(){return 4294967296*n.next()|0},o.double=function(){return o()+11102230246251565e-32*(2097152*o()|0)},o.quick=o,i&&("object"==typeof i&&a(i,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=s:n.amdD&&n.amdO?void 0===(i=function(){return s}.call(e,n,e,o))||(o.exports=i):this.alea=s}(0,t=n.nmd(t),n.amdD)},813:function(t,e,n){var i;!function(t,o){function r(t){var e=this,n="";e.next=function(){var t=e.b,n=e.c,i=e.d,o=e.a;return t=t<<25^t>>>7^n,n=n-i|0,i=i<<24^i>>>8^o,o=o-t|0,e.b=t=t<<20^t>>>12^n,e.c=n=n-i|0,e.d=i<<16^n>>>16^o,e.a=o-t|0},e.a=0,e.b=0,e.c=-1640531527,e.d=1367130551,t===Math.floor(t)?(e.a=t/4294967296|0,e.b=0|t):n+=t;for(var i=0;i<n.length+20;i++)e.b^=0|n.charCodeAt(i),e.next()}function a(t,e){return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e}function s(t,e){var n=new r(t),i=e&&e.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,i&&("object"==typeof i&&a(i,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=s:n.amdD&&n.amdO?void 0===(i=function(){return s}.call(e,n,e,o))||(o.exports=i):this.tychei=s}(0,t=n.nmd(t),n.amdD)},989:function(t,e,n){var i;!function(t,o){function r(t){var e=this,n="";e.x=0,e.y=0,e.z=0,e.w=0,e.next=function(){var t=e.x^e.x<<11;return e.x=e.y,e.y=e.z,e.z=e.w,e.w^=e.w>>>19^t^t>>>8},t===(0|t)?e.x=t:n+=t;for(var i=0;i<n.length+64;i++)e.x^=0|n.charCodeAt(i),e.next()}function a(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e}function s(t,e){var n=new r(t),i=e&&e.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,i&&("object"==typeof i&&a(i,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=s:n.amdD&&n.amdO?void 0===(i=function(){return s}.call(e,n,e,o))||(o.exports=i):this.xor128=s}(0,t=n.nmd(t),n.amdD)},993:function(t,e,n){var i;!function(t,o){function r(t){var e=this;e.next=function(){var t,n,i=e.w,o=e.X,r=e.i;return e.w=i=i+1640531527|0,n=o[r+34&127],t=o[r=r+1&127],n^=n<<13,t^=t<<17,n^=n>>>15,t^=t>>>12,n=o[r]=n^t,e.i=r,n+(i^i>>>16)|0},function(t,e){var n,i,o,r,a,s=[],u=128;for(e===(0|e)?(i=e,e=null):(e+="\0",i=0,u=Math.max(u,e.length)),o=0,r=-32;r<u;++r)e&&(i^=e.charCodeAt((r+32)%e.length)),0===r&&(a=i),i^=i<<10,i^=i>>>15,i^=i<<4,i^=i>>>13,r>=0&&(a=a+1640531527|0,o=0==(n=s[127&r]^=i+a)?o+1:0);for(o>=128&&(s[127&(e&&e.length||0)]=-1),o=127,r=512;r>0;--r)i=s[o+34&127],n=s[o=o+1&127],i^=i<<13,n^=n<<17,i^=i>>>15,n^=n>>>12,s[o]=i^n;t.w=a,t.X=s,t.i=o}(e,t)}function a(t,e){return e.i=t.i,e.w=t.w,e.X=t.X.slice(),e}function s(t,e){null==t&&(t=+new Date);var n=new r(t),i=e&&e.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,i&&(i.X&&a(i,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=s:n.amdD&&n.amdO?void 0===(i=function(){return s}.call(e,n,e,o))||(o.exports=i):this.xor4096=s}(0,t=n.nmd(t),n.amdD)},875:function(t,e,n){var i;!function(t,o){function r(t){var e=this;e.next=function(){var t,n,i=e.x,o=e.i;return t=i[o],n=(t^=t>>>7)^t<<24,n^=(t=i[o+1&7])^t>>>10,n^=(t=i[o+3&7])^t>>>3,n^=(t=i[o+4&7])^t<<7,t=i[o+7&7],n^=(t^=t<<13)^t<<9,i[o]=n,e.i=o+1&7,n},function(t,e){var n,i=[];if(e===(0|e))i[0]=e;else for(e=""+e,n=0;n<e.length;++n)i[7&n]=i[7&n]<<15^e.charCodeAt(n)+i[n+1&7]<<13;for(;i.length<8;)i.push(0);for(n=0;n<8&&0===i[n];++n);for(8==n?i[7]=-1:i[n],t.x=i,t.i=0,n=256;n>0;--n)t.next()}(e,t)}function a(t,e){return e.x=t.x.slice(),e.i=t.i,e}function s(t,e){null==t&&(t=+new Date);var n=new r(t),i=e&&e.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,i&&(i.x&&a(i,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=s:n.amdD&&n.amdO?void 0===(i=function(){return s}.call(e,n,e,o))||(o.exports=i):this.xorshift7=s}(0,t=n.nmd(t),n.amdD)},679:function(t,e,n){var i;!function(t,o){function r(t){var e=this,n="";e.next=function(){var t=e.x^e.x>>>2;return e.x=e.y,e.y=e.z,e.z=e.w,e.w=e.v,(e.d=e.d+362437|0)+(e.v=e.v^e.v<<4^t^t<<1)|0},e.x=0,e.y=0,e.z=0,e.w=0,e.v=0,t===(0|t)?e.x=t:n+=t;for(var i=0;i<n.length+64;i++)e.x^=0|n.charCodeAt(i),i==n.length&&(e.d=e.x<<10^e.x>>>4),e.next()}function a(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e.v=t.v,e.d=t.d,e}function s(t,e){var n=new r(t),i=e&&e.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,i&&("object"==typeof i&&a(i,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=s:n.amdD&&n.amdO?void 0===(i=function(){return s}.call(e,n,e,o))||(o.exports=i):this.xorwow=s}(0,t=n.nmd(t),n.amdD)},713:function(t,e,n){var i;!function(o,r,a){var s,u=256,c=a.pow(u,6),d=a.pow(2,52),l=2*d,f=255;function h(t,e,n){var i=[],f=g(y((e=1==e?{entropy:!0}:e||{}).entropy?[t,m(r)]:null==t?function(){try{var t;return s&&(t=s.randomBytes)?t=t(u):(t=new Uint8Array(u),(o.crypto||o.msCrypto).getRandomValues(t)),m(t)}catch(t){var e=o.navigator,n=e&&e.plugins;return[+new Date,o,n,o.screen,m(r)]}}():t,3),i),h=new p(i),w=function(){for(var t=h.g(6),e=c,n=0;t<d;)t=(t+n)*u,e*=u,n=h.g(1);for(;t>=l;)t/=2,e/=2,n>>>=1;return(t+n)/e};return w.int32=function(){return 0|h.g(4)},w.quick=function(){return h.g(4)/4294967296},w.double=w,g(m(h.S),r),(e.pass||n||function(t,e,n,i){return i&&(i.S&&v(i,h),t.state=function(){return v(h,{})}),n?(a.random=t,e):t})(w,f,"global"in e?e.global:this==a,e.state)}function p(t){var e,n=t.length,i=this,o=0,r=i.i=i.j=0,a=i.S=[];for(n||(t=[n++]);o<u;)a[o]=o++;for(o=0;o<u;o++)a[o]=a[r=f&r+t[o%n]+(e=a[o])],a[r]=e;(i.g=function(t){for(var e,n=0,o=i.i,r=i.j,a=i.S;t--;)e=a[o=f&o+1],n=n*u+a[f&(a[o]=a[r=f&r+e])+(a[r]=e)];return i.i=o,i.j=r,n})(u)}function v(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function y(t,e){var n,i=[],o=typeof t;if(e&&"object"==o)for(n in t)try{i.push(y(t[n],e-1))}catch(t){}return i.length?i:"string"==o?t:t+"\0"}function g(t,e){for(var n,i=t+"",o=0;o<i.length;)e[f&o]=f&(n^=19*e[f&o])+i.charCodeAt(o++);return m(e)}function m(t){return String.fromCharCode.apply(0,t)}if(g(a.random(),r),t.exports){t.exports=h;try{s=n(222)}catch(t){}}else void 0===(i=function(){return h}.call(e,n,e,t))||(t.exports=i)}("undefined"!=typeof self?self:this,[],Math)},222:()=>{}},e={};function n(i){var o=e[i];if(void 0!==o)return o.exports;var r=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}n.amdD=function(){throw new Error("define cannot be used indirect")},n.amdO={},n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var i={};return(()=>{"use strict";n.r(i),n.d(i,{BASE_LAYER_CONFIG:()=>st,DEFAULT_AMPLITUDE:()=>C,DEFAULT_BASE_CONFIG:()=>lt,DEFAULT_CONTAINER_ID:()=>g,DEFAULT_DENSITY:()=>w,DEFAULT_FREQUENCY:()=>P,DEFAULT_GRAVITY:()=>W,DEFAULT_GRAVITY_ANGLE:()=>N,DEFAULT_GRAVITY_STRENGTH:()=>U,DEFAULT_IMAGE:()=>M,DEFAULT_IMAGE_LAYER:()=>ct,DEFAULT_LAYERS:()=>dt,DEFAULT_MASS:()=>O,DEFAULT_MASS_MAX:()=>x,DEFAULT_MASS_MIN:()=>_,DEFAULT_MODE:()=>T,DEFAULT_OPACITY:()=>L,DEFAULT_OPACITY_MAX:()=>I,DEFAULT_OPACITY_MIN:()=>S,DEFAULT_ROTATE:()=>D,DEFAULT_SIMPLE_LAYER:()=>ut,DEFAULT_SIZE:()=>E,DEFAULT_SIZE_MAX:()=>b,DEFAULT_SIZE_MIN:()=>A,DEFAULT_SNOW_COLOR:()=>m,DEFAULT_SWAY:()=>F,DEFAULT_USER_CONFIG:()=>ht,DEFAULT_WIND:()=>at,DEFAULT_WIND_ANGLE:()=>j,DEFAULT_WIND_GUSTS:()=>rt,DEFAULT_WIND_GUSTS_ACTIVE:()=>nt,DEFAULT_WIND_GUSTS_CHANGE_CHANCE:()=>et,DEFAULT_WIND_GUSTS_IN:()=>ot,DEFAULT_WIND_GUSTS_OUT:()=>it,DEFAULT_WIND_IN_ADDITIONAL_STRENGTH:()=>Y,DEFAULT_WIND_IN_ADDITIONAL_STRENGTH_MAX:()=>G,DEFAULT_WIND_IN_ADDITIONAL_STRENGTH_MIN:()=>R,DEFAULT_WIND_IN_DELAY:()=>V,DEFAULT_WIND_IN_DELAY_MAX:()=>q,DEFAULT_WIND_IN_DELAY_MIN:()=>K,DEFAULT_WIND_IN_DURATION:()=>X,DEFAULT_WIND_IN_DURATION_MAX:()=>B,DEFAULT_WIND_IN_DURATION_MIN:()=>z,DEFAULT_WIND_OUT_DELAY:()=>Z,DEFAULT_WIND_OUT_DELAY_MAX:()=>J,DEFAULT_WIND_OUT_DELAY_MIN:()=>H,DEFAULT_WIND_OUT_DURATION:()=>tt,DEFAULT_WIND_OUT_DURATION_MAX:()=>Q,DEFAULT_WIND_OUT_DURATION_MIN:()=>$,DEFAULT_WIND_STRENGTH:()=>k,Types:()=>e,clone:()=>h,default:()=>Ae,diff:()=>Tt,getDefaultConfig:()=>ft,isSimpleLayer:()=>v,merge2:()=>_t,restart:()=>Xt,schedule:()=>qt,setAmplitude:()=>Jt,setColour:()=>Vt,setDensity:()=>Ht,setFrequency:()=>Zt,setGravity:()=>oe,setGravityAngle:()=>re,setGravityStrength:()=>ae,setGusts:()=>ie,setMassMax:()=>we,setMassMin:()=>me,setPaused:()=>Qt,setSizeMax:()=>xe,setSizeMin:()=>_e,setWind:()=>te,setWindAngle:()=>ee,setWindInAdditionalStrengthMax:()=>ue,setWindInAdditionalStrengthMin:()=>se,setWindInDelayMax:()=>fe,setWindInDelayMin:()=>le,setWindInDurationMax:()=>de,setWindInDurationMin:()=>ce,setWindOutChangeChance:()=>ge,setWindOutDelayMax:()=>ye,setWindOutDelayMin:()=>ve,setWindOutDurationMax:()=>pe,setWindOutDurationMin:()=>he,setWindStrength:()=>ne,start:()=>Bt,stop:()=>Kt,togglePaused:()=>$t});var t={};n.r(t),n.d(t,{BASE_LAYER_CONFIG:()=>st,DEFAULT_AMPLITUDE:()=>C,DEFAULT_BASE_CONFIG:()=>lt,DEFAULT_CONTAINER_ID:()=>g,DEFAULT_DENSITY:()=>w,DEFAULT_FREQUENCY:()=>P,DEFAULT_GRAVITY:()=>W,DEFAULT_GRAVITY_ANGLE:()=>N,DEFAULT_GRAVITY_STRENGTH:()=>U,DEFAULT_IMAGE:()=>M,DEFAULT_IMAGE_LAYER:()=>ct,DEFAULT_LAYERS:()=>dt,DEFAULT_MASS:()=>O,DEFAULT_MASS_MAX:()=>x,DEFAULT_MASS_MIN:()=>_,DEFAULT_MODE:()=>T,DEFAULT_OPACITY:()=>L,DEFAULT_OPACITY_MAX:()=>I,DEFAULT_OPACITY_MIN:()=>S,DEFAULT_ROTATE:()=>D,DEFAULT_SIMPLE_LAYER:()=>ut,DEFAULT_SIZE:()=>E,DEFAULT_SIZE_MAX:()=>b,DEFAULT_SIZE_MIN:()=>A,DEFAULT_SNOW_COLOR:()=>m,DEFAULT_SWAY:()=>F,DEFAULT_USER_CONFIG:()=>ht,DEFAULT_WIND:()=>at,DEFAULT_WIND_ANGLE:()=>j,DEFAULT_WIND_GUSTS:()=>rt,DEFAULT_WIND_GUSTS_ACTIVE:()=>nt,DEFAULT_WIND_GUSTS_CHANGE_CHANCE:()=>et,DEFAULT_WIND_GUSTS_IN:()=>ot,DEFAULT_WIND_GUSTS_OUT:()=>it,DEFAULT_WIND_IN_ADDITIONAL_STRENGTH:()=>Y,DEFAULT_WIND_IN_ADDITIONAL_STRENGTH_MAX:()=>G,DEFAULT_WIND_IN_ADDITIONAL_STRENGTH_MIN:()=>R,DEFAULT_WIND_IN_DELAY:()=>V,DEFAULT_WIND_IN_DELAY_MAX:()=>q,DEFAULT_WIND_IN_DELAY_MIN:()=>K,DEFAULT_WIND_IN_DURATION:()=>X,DEFAULT_WIND_IN_DURATION_MAX:()=>B,DEFAULT_WIND_IN_DURATION_MIN:()=>z,DEFAULT_WIND_OUT_DELAY:()=>Z,DEFAULT_WIND_OUT_DELAY_MAX:()=>J,DEFAULT_WIND_OUT_DELAY_MIN:()=>H,DEFAULT_WIND_OUT_DURATION:()=>tt,DEFAULT_WIND_OUT_DURATION_MAX:()=>Q,DEFAULT_WIND_OUT_DURATION_MIN:()=>$,DEFAULT_WIND_STRENGTH:()=>k,clone:()=>h,diff:()=>Tt,getDefaultConfig:()=>ft,isSimpleLayer:()=>v,restart:()=>Xt,schedule:()=>qt,setAmplitude:()=>Jt,setColour:()=>Vt,setDensity:()=>Ht,setFrequency:()=>Zt,setGravity:()=>oe,setGravityAngle:()=>re,setGravityStrength:()=>ae,setGusts:()=>ie,setMassMax:()=>we,setMassMin:()=>me,setPaused:()=>Qt,setSizeMax:()=>xe,setSizeMin:()=>_e,setWind:()=>te,setWindAngle:()=>ee,setWindInAdditionalStrengthMax:()=>ue,setWindInAdditionalStrengthMin:()=>se,setWindInDelayMax:()=>fe,setWindInDelayMin:()=>le,setWindInDurationMax:()=>de,setWindInDurationMin:()=>ce,setWindOutChangeChance:()=>ge,setWindOutDelayMax:()=>ye,setWindOutDelayMin:()=>ve,setWindOutDurationMax:()=>pe,setWindOutDurationMin:()=>he,setWindStrength:()=>ne,start:()=>Bt,stop:()=>Kt,togglePaused:()=>$t});var e={};n.r(e);var o=n(374),r=n(711),a=n.n(r);function s(t,e){return 1===arguments.length&&(e=t,t=0),void 0===t&&void 0===e?Math.random():void 0!==t&&void 0!==e?t+Math.random()*(e-t):0}function u(t,e){var n=a()("layer");return void 0===t&&void 0===e?n():void 0!==t&&void 0!==e?t+n()*(e-t):0}function c(t){return Math.atan2(t.x,t.y)*(180/Math.PI)}function d(t,e){var n=e*(Math.PI/180),i=Math.cos(n),o=Math.sin(n),r=t.x*i-t.y*o,a=t.x*o+t.y*i;return t.x=r,t.y=a,t}function l(t){var e=document.getElementById(t);if(!e)throw new Error("Error: Element #".concat(t," not found."));return e}function f(t,e,n){var i=t*e;return Math.round(n*(i/2073600))}function h(t){return JSON.parse(JSON.stringify(t))}function p(t,e,n,i){return Array.from({length:t},(function(){var t=s(n),r=s(i),a=o.vec2.create(t,r),u=e.size.min+s()*(e.size.max-e.mass.min);return{position:a,mass:e.mass.min+s()*(e.mass.max-e.mass.min),size:u,renderedSize:u,noise:s(10),amplitude:s(e.sway.amplitude),frequency:s(e.sway.frequency),random:s(),rotation:s(360),time:0,opacity:s(e.opacity.min,e.opacity.max)}}))}function v(t){return"simple"===t.mode||void 0===t.mode}var y=function(){return y=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},y.apply(this,arguments)},g="snowfall",m="#ffffff",w=200,_=1,x=3,A=1,b=3,D=!1,T="simple",M="data:image/png;base64,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",S=0,I=1,O={min:_,max:x},E={min:A,max:b},L={min:S,max:I},C=1,P=.02,F={frequency:P,amplitude:C},N=90,U=.7,W={angle:N,strength:U},j=0,k=0,R=1,G=3,Y={min:R,max:G},z=1e3,B=3e3,X={min:z,max:B},K=1e3,q=1e4,V={min:K,max:q},H=5e3,J=1e4,Z={min:H,max:J},Q=1e4,$=1e3,tt={min:$,max:Q},et=.25,nt=!0,it={duration:tt,delay:Z},ot={additionalStrength:Y,duration:X,delay:V},rt={active:nt,changeChance:et,in:ot,out:it},at={angle:j,strength:k,gusts:rt},st={density:w,mass:O,size:E,sway:F,gravity:W,wind:at,opacity:L},ut=y(y({},st),{colour:m,mode:"simple"}),ct=y(y({},st),{mode:"image",image:M,rotate:D}),dt=[],lt={layers:dt};function ft(){return y(y({},lt),{attachTo:l(g)})}var ht=y(y({},lt),{attachTo:g}),pt=function(){return pt=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},pt.apply(this,arguments)},vt=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]])}return n},yt=function(t,e){var n,i,o,r,a,s,u,c,d,l,f,h,p,v,y,g,_,x,A,b,D,T,M,S,I,C,P,N,U,j,k,R,G,z,B,K,q,H,J,Q,$=e<dt.length?dt[e]:ut;return{colour:t.colour||$.colour||m,opacity:t.opacity||$.opacity||L,density:t.density||$.density||w,mode:"simple",mass:pt(pt(pt({},O),$.mass),t.mass),size:pt(pt(pt({},E),$.size),t.size),sway:pt(pt(pt({},F),$.sway),t.sway),gravity:pt(pt(pt({},W),$.gravity),t.gravity),wind:pt(pt(pt(pt({},at),$.wind),t.wind),{gusts:pt(pt(pt(pt({},rt),null===(n=$.wind)||void 0===n?void 0:n.gusts),null===(i=t.wind)||void 0===i?void 0:i.gusts),{in:pt(pt(pt(pt({},ot),null===(r=null===(o=$.wind)||void 0===o?void 0:o.gusts)||void 0===r?void 0:r.in),null===(s=null===(a=t.wind)||void 0===a?void 0:a.gusts)||void 0===s?void 0:s.in),{additionalStrength:pt(pt(pt({},Y),null===(d=null===(c=null===(u=$.wind)||void 0===u?void 0:u.gusts)||void 0===c?void 0:c.in)||void 0===d?void 0:d.additionalStrength),null===(h=null===(f=null===(l=t.wind)||void 0===l?void 0:l.gusts)||void 0===f?void 0:f.in)||void 0===h?void 0:h.additionalStrength),duration:pt(pt(pt({},X),null===(y=null===(v=null===(p=$.wind)||void 0===p?void 0:p.gusts)||void 0===v?void 0:v.in)||void 0===y?void 0:y.duration),null===(x=null===(_=null===(g=t.wind)||void 0===g?void 0:g.gusts)||void 0===_?void 0:_.in)||void 0===x?void 0:x.duration),delay:pt(pt(pt({},V),null===(D=null===(b=null===(A=$.wind)||void 0===A?void 0:A.gusts)||void 0===b?void 0:b.in)||void 0===D?void 0:D.delay),null===(S=null===(M=null===(T=t.wind)||void 0===T?void 0:T.gusts)||void 0===M?void 0:M.in)||void 0===S?void 0:S.delay)}),out:pt(pt(pt(pt({},it),null===(C=null===(I=$.wind)||void 0===I?void 0:I.gusts)||void 0===C?void 0:C.out),null===(N=null===(P=t.wind)||void 0===P?void 0:P.gusts)||void 0===N?void 0:N.out),{duration:pt(pt(pt({},tt),null===(k=null===(j=null===(U=$.wind)||void 0===U?void 0:U.gusts)||void 0===j?void 0:j.out)||void 0===k?void 0:k.duration),null===(z=null===(G=null===(R=t.wind)||void 0===R?void 0:R.gusts)||void 0===G?void 0:G.out)||void 0===z?void 0:z.duration),delay:pt(pt(pt({},Z),null===(q=null===(K=null===(B=$.wind)||void 0===B?void 0:B.gusts)||void 0===K?void 0:K.out)||void 0===q?void 0:q.delay),null===(Q=null===(J=null===(H=t.wind)||void 0===H?void 0:H.gusts)||void 0===J?void 0:J.out)||void 0===Q?void 0:Q.delay)})})})}},gt=function(t,e){var n,i,o,r,a,s,u,c,d,l,f,h,p,v,y,g,m,_,x,A,b,T,S,I,C,P,N,U,j,k,R,G,z,B,K,q,H,J,Q,$,et=ct;return{density:t.density||et.density||w,mode:"image",image:t.image||et.image||M,opacity:t.opacity||et.opacity||L,rotate:t.rotate||et.rotate||D,mass:pt(pt(pt({},O),et.mass),t.mass),size:pt(pt(pt({},E),et.size),t.size),sway:pt(pt(pt({},F),et.sway),t.sway),gravity:pt(pt(pt({},W),et.gravity),t.gravity),wind:pt(pt(pt(pt({},at),et.wind),t.wind),{gusts:pt(pt(pt(pt({},rt),null===(n=et.wind)||void 0===n?void 0:n.gusts),null===(i=t.wind)||void 0===i?void 0:i.gusts),{in:pt(pt(pt(pt({},ot),null===(r=null===(o=et.wind)||void 0===o?void 0:o.gusts)||void 0===r?void 0:r.in),null===(s=null===(a=t.wind)||void 0===a?void 0:a.gusts)||void 0===s?void 0:s.in),{additionalStrength:pt(pt(pt({},Y),null===(d=null===(c=null===(u=et.wind)||void 0===u?void 0:u.gusts)||void 0===c?void 0:c.in)||void 0===d?void 0:d.additionalStrength),null===(h=null===(f=null===(l=t.wind)||void 0===l?void 0:l.gusts)||void 0===f?void 0:f.in)||void 0===h?void 0:h.additionalStrength),duration:pt(pt(pt({},X),null===(y=null===(v=null===(p=et.wind)||void 0===p?void 0:p.gusts)||void 0===v?void 0:v.in)||void 0===y?void 0:y.duration),null===(_=null===(m=null===(g=t.wind)||void 0===g?void 0:g.gusts)||void 0===m?void 0:m.in)||void 0===_?void 0:_.duration),delay:pt(pt(pt({},V),null===(b=null===(A=null===(x=et.wind)||void 0===x?void 0:x.gusts)||void 0===A?void 0:A.in)||void 0===b?void 0:b.delay),null===(I=null===(S=null===(T=t.wind)||void 0===T?void 0:T.gusts)||void 0===S?void 0:S.in)||void 0===I?void 0:I.delay)}),out:pt(pt(pt(pt({},it),null===(P=null===(C=et.wind)||void 0===C?void 0:C.gusts)||void 0===P?void 0:P.out),null===(U=null===(N=t.wind)||void 0===N?void 0:N.gusts)||void 0===U?void 0:U.out),{duration:pt(pt(pt({},tt),null===(R=null===(k=null===(j=et.wind)||void 0===j?void 0:j.gusts)||void 0===k?void 0:k.out)||void 0===R?void 0:R.duration),null===(B=null===(z=null===(G=t.wind)||void 0===G?void 0:G.gusts)||void 0===z?void 0:z.out)||void 0===B?void 0:B.duration),delay:pt(pt(pt({},Z),null===(H=null===(q=null===(K=et.wind)||void 0===K?void 0:K.gusts)||void 0===q?void 0:q.out)||void 0===H?void 0:H.delay),null===($=null===(Q=null===(J=t.wind)||void 0===J?void 0:J.gusts)||void 0===Q?void 0:Q.out)||void 0===$?void 0:$.delay)})})})}};function mt(t){var e;return pt(pt(pt({},lt),t),{layers:(null!==(e=t.layers)&&void 0!==e?e:[]).map((function(t,e){return v(t)?yt(t,e):gt(t,e)}))})}function wt(t){t.attachTo;var e=mt(vt(t,["attachTo"]));return pt(pt({},e),{attachTo:t.attachTo?l(t.attachTo):l(g)})}function _t(t){t.attachTo;var e,n=mt(vt(t,["attachTo"]));return pt(pt({},n),{attachTo:null!==(e=t.attachTo)&&void 0!==e?e:g})}function xt(t){return null!==t&&"object"==typeof t&&t.constructor===Object}function At(t,e){if(!xt(t))return t;var n={};for(var i in t){var o=t[i],r=e[i];if(o!==r)if(Array.isArray(o)){var a=bt(o,e[i]||[]);a.length>0&&(n[i]=a)}else if(xt(o)){var s=At(o,r||{});Object.keys(s).length>0&&(n[i]=s)}else n[i]=o}return n}function bt(t,e){for(var n,i,o=[],r=0;r<t.length;r++){var a=t[r],s=At(a,e[r]||(Dt(a)?ct:ut));Dt(a)&&void 0===s.mode&&(s.mode="image"),o.push(s)}return i=e,(n=o).filter((function(t,e){return n.length>i.length||Object.keys(t).length>0||!n.slice(e).every((function(t){return 0===Object.keys(t).length}))}))}function Dt(t){return"image"===t.mode||void 0!==t.image||void 0!==t.rotate}function Tt(t){return At(t,ht)}var Mt,St=Object.freeze({Linear:Object.freeze({None:function(t){return t},In:function(t){return t},Out:function(t){return t},InOut:function(t){return t}}),Quadratic:Object.freeze({In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}}),Cubic:Object.freeze({In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}}),Quartic:Object.freeze({In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}}),Quintic:Object.freeze({In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}}),Sinusoidal:Object.freeze({In:function(t){return 1-Math.sin((1-t)*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.sin(Math.PI*(.5-t)))}}),Exponential:Object.freeze({In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}}),Circular:Object.freeze({In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}}),Elastic:Object.freeze({In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(t){var e=1.70158;return 1===t?1:t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return 0===t?0:--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}}),Bounce:Object.freeze({In:function(t){return 1-St.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*St.Bounce.In(2*t):.5*St.Bounce.Out(2*t-1)+.5}}),generatePow:function(t){return void 0===t&&(t=4),t=(t=t<Number.EPSILON?Number.EPSILON:t)>1e4?1e4:t,{In:function(e){return Math.pow(e,t)},Out:function(e){return 1-Math.pow(1-e,t)},InOut:function(e){return e<.5?Math.pow(2*e,t)/2:(1-Math.pow(2-2*e,t))/2+.5}}}}),It=function(){return performance.now()},Ot=function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={}}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},t.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},t.prototype.update=function(t,e){void 0===t&&(t=It()),void 0===e&&(e=!1);var n=Object.keys(this._tweens);if(0===n.length)return!1;for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<n.length;i++){var o=this._tweens[n[i]],r=!e;o&&!1===o.update(t,r)&&!e&&delete this._tweens[n[i]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0},t}(),Et={Linear:function(t,e){var n=t.length-1,i=n*e,o=Math.floor(i),r=Et.Utils.Linear;return e<0?r(t[0],t[1],i):e>1?r(t[n],t[n-1],n-i):r(t[o],t[o+1>n?n:o+1],i-o)},Bezier:function(t,e){for(var n=0,i=t.length-1,o=Math.pow,r=Et.Utils.Bernstein,a=0;a<=i;a++)n+=o(1-e,i-a)*o(e,a)*t[a]*r(i,a);return n},CatmullRom:function(t,e){var n=t.length-1,i=n*e,o=Math.floor(i),r=Et.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(o=Math.floor(i=n*(1+e))),r(t[(o-1+n)%n],t[o],t[(o+1)%n],t[(o+2)%n],i-o)):e<0?t[0]-(r(t[0],t[0],t[1],t[1],-i)-t[0]):e>1?t[n]-(r(t[n],t[n],t[n-1],t[n-1],i-n)-t[n]):r(t[o?o-1:0],t[o],t[n<o+1?n:o+1],t[n<o+2?n:o+2],i-o)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=Et.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:(Mt=[1],function(t){var e=1;if(Mt[t])return Mt[t];for(var n=t;n>1;n--)e*=n;return Mt[t]=e,e}),CatmullRom:function(t,e,n,i,o){var r=.5*(n-t),a=.5*(i-e),s=o*o;return(2*e-2*n+r+a)*(o*s)+(-3*e+3*n-2*r-a)*s+r*o+e}}},Lt=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),Ct=new Ot,Pt=function(){function t(t,e){void 0===e&&(e=Ct),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=St.Linear.None,this._interpolationFunction=Et.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Lt.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.getDuration=function(){return this._duration},t.prototype.to=function(t,e){if(void 0===e&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},t.prototype.duration=function(t){return void 0===t&&(t=1e3),this._duration=t<0?0:t,this},t.prototype.dynamic=function(t){return void 0===t&&(t=!1),this._isDynamic=t,this},t.prototype.start=function(t,e){if(void 0===t&&(t=It()),void 0===e&&(e=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var n in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var i={};for(var o in this._valuesEnd)i[o]=this._valuesEnd[o];this._valuesEnd=i}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},t.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},t.prototype._setupProperties=function(t,e,n,i,o){for(var r in n){var a=t[r],s=Array.isArray(a),u=s?"array":typeof a,c=!s&&Array.isArray(n[r]);if("undefined"!==u&&"function"!==u){if(c){if(0===(y=n[r]).length)continue;for(var d=[a],l=0,f=y.length;l<f;l+=1){var h=this._handleRelativeValue(a,y[l]);if(isNaN(h)){c=!1,console.warn("Found invalid interpolation list. Skipping.");break}d.push(h)}c&&(n[r]=d)}if("object"!==u&&!s||!a||c)(void 0===e[r]||o)&&(e[r]=a),s||(e[r]*=1),i[r]=c?n[r].slice().reverse():e[r]||0;else{e[r]=s?[]:{};var p=a;for(var v in p)e[r][v]=p[v];i[r]=s?[]:{};var y=n[r];if(!this._isDynamic){var g={};for(var v in y)g[v]=y[v];n[r]=y=g}this._setupProperties(p,e[r],y,i[r],o)}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},t.prototype.pause=function(t){return void 0===t&&(t=It()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this)),this},t.prototype.resume=function(t){return void 0===t&&(t=It()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},t.prototype.group=function(t){return void 0===t&&(t=Ct),this._group=t,this},t.prototype.delay=function(t){return void 0===t&&(t=0),this._delayTime=t,this},t.prototype.repeat=function(t){return void 0===t&&(t=0),this._initialRepeat=t,this._repeat=t,this},t.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},t.prototype.yoyo=function(t){return void 0===t&&(t=!1),this._yoyo=t,this},t.prototype.easing=function(t){return void 0===t&&(t=St.Linear.None),this._easingFunction=t,this},t.prototype.interpolation=function(t){return void 0===t&&(t=Et.Linear),this._interpolationFunction=t,this},t.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},t.prototype.onStart=function(t){return this._onStartCallback=t,this},t.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},t.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},t.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},t.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},t.prototype.onStop=function(t){return this._onStopCallback=t,this},t.prototype.update=function(t,e){var n,i,o=this;if(void 0===t&&(t=It()),void 0===e&&(e=!0),this._isPaused)return!0;var r=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t,!0)}if(this._goToEnd=!1,t<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),!1===this._onEveryStartCallbackFired&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=t-this._startTime,s=this._duration+(null!==(n=this._repeatDelayTime)&&void 0!==n?n:this._delayTime),u=this._duration+this._repeat*s,c=function(){if(0===o._duration)return 1;if(a>u)return 1;var t=Math.trunc(a/s),e=a-t*s,n=Math.min(e/o._duration,1);return 0===n&&a===o._duration?1:n}(),d=this._easingFunction(c);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,d),this._onUpdateCallback&&this._onUpdateCallback(this._object,c),0===this._duration||a>=this._duration){if(this._repeat>0){var l=Math.min(Math.trunc((a-this._duration)/s)+1,this._repeat);for(i in isFinite(this._repeat)&&(this._repeat-=l),this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[i]||(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=s*l,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var f=0,h=this._chainedTweens.length;f<h;f++)this._chainedTweens[f].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(t,e,n,i){for(var o in n)if(void 0!==e[o]){var r=e[o]||0,a=n[o],s=Array.isArray(t[o]),u=Array.isArray(a);!s&&u?t[o]=this._interpolationFunction(a,i):"object"==typeof a&&a?this._updateProperties(t[o],r,a,i):"number"==typeof(a=this._handleRelativeValue(r,a))&&(t[o]=r+(a-r)*i)}},t.prototype._handleRelativeValue=function(t,e){return"string"!=typeof e?e:"+"===e.charAt(0)||"-"===e.charAt(0)?t+parseFloat(e):parseFloat(e)},t.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],n=this._valuesEnd[t];this._valuesStartRepeat[t]="string"==typeof n?this._valuesStartRepeat[t]+parseFloat(n):this._valuesEnd[t],this._valuesEnd[t]=e},t}(),Ft=(Lt.nextId,Ct),Nt=(Ft.getAll.bind(Ft),Ft.removeAll.bind(Ft),Ft.add.bind(Ft),Ft.remove.bind(Ft),Ft.update.bind(Ft));var Ut,Wt,jt=function(){function t(t,e,n,i,r,a,s,u,d){var l=this;this.snowflakes=[],this.paused=!1,this.originalConfig=t,this.config=t,this.width=e,this.height=n,this.windVector=o.vec2.create(0,0),this.gravityVector=o.vec2.create(0,0);var f=this.config.wind.strength;this.config.wind.gusts.active&&(this.fadeWindIn=new Pt(t).to({wind:{strength:i}},r).easing(St.Quadratic.InOut).delay(a).onUpdate((function(){l.setWind(l.config.wind.angle,l.config.wind.strength)})),this.fadeWindOut=new Pt(t).to({wind:{strength:f}},s).easing(St.Quadratic.Out).delay(u).onUpdate((function(){l.setWind(l.config.wind.angle,l.config.wind.strength)})).onComplete((function(){if(d<l.config.wind.gusts.changeChance){var t=c(l.windVector.getOpposite(l.windVector));l.setWindAngle(t)}})))}return t.prototype.setAmplitude=function(t){this.config.sway.amplitude=t},t.prototype.setFrequency=function(t){this.config.sway.frequency=t},t.prototype.setGravity=function(t,e){this.config.gravity.angle=t,this.config.gravity.strength=e,this.originalConfig=h(this.config),this.gravityVector=o.vec2.fromDegrees(t),this.gravityVector.multiplyScalar(e)},t.prototype.setGravityAngle=function(t){this.config.gravity.angle=t,this.originalConfig=h(this.config);var e=this.gravityVector.getLength();this.gravityVector=o.vec2.fromDegrees(t),this.gravityVector.multiplyScalar(e)},t.prototype.setGravityStrength=function(t){this.config.gravity.strength=t,this.originalConfig=h(this.config);var e=c(this.gravityVector);this.gravityVector=o.vec2.fromDegrees(e),this.gravityVector.multiplyScalar(t)},t.prototype.setPaused=function(t){this.paused=t},t.prototype.setWind=function(t,e){this.config.wind.angle=t,this.config.wind.strength=e,this.windVector=o.vec2.fromDegrees(t),this.windVector.multiplyScalar(e)},t.prototype.setWindAngle=function(t){this.config.wind.angle=t,this.originalConfig=h(this.config);var e=this.windVector.getLength();this.windVector=o.vec2.fromDegrees(t),this.windVector.multiplyScalar(e)},t.prototype.setWindStrength=function(t){this.config.wind.strength=t,this.originalConfig=h(this.config);var e=c(this.windVector);this.windVector=o.vec2.fromDegrees(e),this.windVector.multiplyScalar(t)},t.prototype.setGusts=function(t){this.config.wind.gusts.active=t,this.originalConfig=h(this.config),this.restart()},t.prototype.togglePaused=function(){this.paused=!this.paused},t.prototype.setWindInAdditionalStrengthMin=function(t){this.config.wind.gusts.in.additionalStrength.min=t,this.originalConfig=h(this.config)},t.prototype.setWindInAdditionalStrengthMax=function(t){this.config.wind.gusts.in.additionalStrength.max=t,this.originalConfig=h(this.config)},t.prototype.setWindInDurationMin=function(t){this.config.wind.gusts.in.duration.min=t,this.originalConfig=h(this.config)},t.prototype.setWindInDurationMax=function(t){this.config.wind.gusts.in.duration.max=t,this.originalConfig=h(this.config)},t.prototype.setWindInDelayMin=function(t){this.config.wind.gusts.in.delay.min=t,this.originalConfig=h(this.config)},t.prototype.setWindInDelayMax=function(t){this.config.wind.gusts.in.delay.max=t,this.originalConfig=h(this.config)},t.prototype.setWindOutDurationMin=function(t){this.config.wind.gusts.out.duration.min=t,this.originalConfig=h(this.config)},t.prototype.setWindOutDurationMax=function(t){this.config.wind.gusts.out.duration.max=t,this.originalConfig=h(this.config)},t.prototype.setWindOutDelayMin=function(t){this.config.wind.gusts.out.delay.min=t,this.originalConfig=h(this.config)},t.prototype.setWindOutDelayMax=function(t){this.config.wind.gusts.out.delay.max=t,this.originalConfig=h(this.config)},t.prototype.setWindOutChangeChance=function(t){this.config.wind.gusts.changeChance=t,this.originalConfig=h(this.config)},t.prototype.update=function(t){var e=this;if(!this.paused){var n=this.config,i=n.sway,r=n.gravity,a=n.wind;this.snowflakes.forEach((function(n){n.time+=t,function(t,e,n){var i=o.vec2.create(0,0),r=o.vec2.fromDegrees(e);r.multiplyScalar(n),i.x=r.x,i.y=r.y,i.multiplyScalar(t.mass+t.random),t.position.add(i)}(n,a.angle,a.strength),function(t){t.rotation++}(n),function(t,e,n){var i=o.vec2.create(0,0),r=o.vec2.fromDegrees(e);r.multiplyScalar(n),i.x=r.x,i.y=r.y,i.multiplyScalar(t.mass+t.random),t.position.add(i)}(n,r.angle,r.strength),function(t,e,n){var i=t.time+t.noise,r=n.amplitude*Math.sin(n.frequency*t.time+i);d(o.vec2.create(1,0),e.angle);var a=o.vec2.create(r,0);d(a,e.angle+90),t.position.add(a)}(n,r,i),function(t,e,n,i){var r=o.vec2.clone(t.position);(function(t,e,n){var i=t.size,o=t.position.x+i>=0&&t.position.x-i<=e,r=t.position.y+i>=0&&t.position.y-i<=n;return o&&r})(t,e,n)||function(t,e,n,i,r){var a;a=t.position.y>n?"bottom":t.position.y<0?"top":t.position.x<0?"left":t.position.x>e?"right":"bottom";var u=o.vec2.create(t.position.x-r.x,t.position.y-r.y),c=[];u.x>0&&c.push("right"),u.x<0&&c.push("left"),u.y>0&&c.push("bottom"),u.y<0&&c.push("top");var d=["top","bottom","left","right"].filter((function(t){return t!==a&&!c.includes(t)})),l=d[Math.floor(s(0,d.length))],f={top:"bottom",bottom:"top",left:"right",right:"left"}[a];"top"===l?function(t,e){t.position.y=-t.size,t.position.x=s(e)}(t,e):"bottom"===l?function(t,e,n){t.position.y=n+t.size,t.position.x=s(e)}(t,e,n):"left"===l?function(t,e){t.position.y=s(e),t.position.x=-t.size}(t,n):"right"===l&&function(t,e,n){t.position.y=s(n),t.position.x=e+t.size}(t,e,n),l===f&&function(t,e,n){var i=o.vec2.clone(t.position),r=o.vec2.clone(i);r.subtract(n);var a=o.vec2.fromDegrees(e.angle),s=o.vec2.create(-a.x,-a.y);r.dot(s)>0&&(t.renderedSize=function(t,e){return.75*t+.25*e}(t.renderedSize,t.size))}(t,i,r)}(t,e,n,i,r)}(n,e.width,e.height,r)}))}},t.prototype.render=function(t){},t.prototype.start=function(){this.snowflakes=p(f(this.width,this.height,this.config.density),this.config,this.width,this.height),this.setWind(this.config.wind.angle,this.config.wind.strength),this.setGravity(this.config.gravity.angle,this.config.gravity.strength),this.config.wind.gusts.active&&this.fadeWindIn&&this.fadeWindOut&&(this.fadeWindIn.chain(this.fadeWindOut),this.fadeWindOut.chain(this.fadeWindIn),this.fadeWindIn.start())},t.prototype.pause=function(){this.paused=!0},t.prototype.resume=function(){this.paused=!1},t.prototype.restart=function(){var t,e,n;null===(t=this.fadeWindIn)||void 0===t||t.stopChainedTweens(),null===(e=this.fadeWindOut)||void 0===e||e.stopChainedTweens(),this.setWind(this.originalConfig.wind.angle,this.originalConfig.wind.strength),this.config.wind.gusts.active&&(null===(n=this.fadeWindIn)||void 0===n||n.start()),this.snowflakes=p(f(this.width,this.height,this.config.density),this.config,this.width,this.height)},t.prototype.setDensity=function(t){this.config.density=t,this.restart()},t.prototype.setMassMin=function(t){this.config.mass.min=t,this.restart()},t.prototype.setMassMax=function(t){this.config.mass.max=t,this.restart()},t.prototype.setSizeMin=function(t){this.config.size.min=t,this.restart()},t.prototype.setSizeMax=function(t){this.config.size.max=t,this.restart()},t}(),kt=(Ut=function(t,e){return Ut=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Ut(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Ut(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),Rt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.mode="simple",e}return kt(e,t),e.prototype.setColour=function(t){throw new Error("Method not implemented.")},e.prototype.render=function(t){var e=this;this.snowflakes.forEach((function(n){t.circle(n.position,n.renderedSize,{fill:{colour:e.config.colour,opacity:n.opacity},line:{width:0}})}))},e}(jt),Gt=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Yt=function(t){function e(e,n,i,o,r,a,s,u,c){var d=t.call(this,e,n,i,o,r,a,s,u,c)||this;return d.mode="image",d.image=new Image,d.image.src=e.image,d}return Gt(e,t),e.prototype.setImage=function(t){throw new Error("Method not implemented.")},e.prototype.render=function(t){var e=this;this.snowflakes.forEach((function(n){var i=n.renderedSize,o=i/2;e.config.rotate?t.rotation((function(){t.image(e.image,{x:n.position.x-o,y:n.position.y-o},{width:i,height:i})}),n.rotation,n.position):t.image(e.image,{x:n.position.x-o,y:n.position.y-o},{width:i,height:i})}))},e}(jt);function zt(){if(!Wt)throw new Error("Snowfall simulation not started. Call snowfall.start() first.")}function Bt(t){void 0===t&&(t={});try{Wt?Wt.restart():(Wt=function(){var t,e=[],n=o.game.create();function i(){e=[],t.layers.forEach((function(n){var i,o=u(n.wind.strength+n.wind.gusts.in.additionalStrength.min,n.wind.strength+n.wind.gusts.in.additionalStrength.max),r=u(n.wind.gusts.in.delay.min,n.wind.gusts.in.delay.max),a=u(n.wind.gusts.in.delay.min,n.wind.gusts.in.delay.max),s=u(n.wind.gusts.out.duration.min,n.wind.gusts.out.duration.max),c=u(n.wind.gusts.out.delay.min,n.wind.gusts.out.delay.max),d=u();"simple"===n.mode?i=new Rt(n,t.attachTo.offsetWidth,t.attachTo.offsetHeight,o,r,a,s,c,d):"image"===n.mode&&(i=new Yt(n,t.attachTo.offsetWidth,t.attachTo.offsetHeight,o,r,a,s,c,d)),i&&(e.push(i),i.start())}))}function r(){e.forEach((function(e){e.width=t.attachTo.offsetWidth,e.height=t.attachTo.offsetHeight,e.restart()})),a()}function a(o){n.setSize(t.attachTo.offsetWidth,t.attachTo.offsetHeight),o?i():e.forEach((function(t){return t.restart()}))}return{start:function(o){void 0===o&&(o={}),function(e){(t=wt(e)).attachTo?i():console.error("Unable to start the application, the specified container could not be found.")}(o),t.attachTo?(window.onresize=r,n.attachTo(t.attachTo),n.setSize(t.attachTo.offsetWidth,t.attachTo.offsetHeight),n.setUpdate((function(t){return n=t.dt,Nt(),void e.forEach((function(t){t.update(n)}));var n})),n.setRender((function(t){return(n=t.gfx).clear(),void e.forEach((function(t){t.render(n)}));var n})),n.start()):console.error("Unable to start the application, the specified container could not be found.")},setAmplitude:function(t,n){var i;null===(i=e[n])||void 0===i||i.setAmplitude(t)},setDensity:function(t,n){var i;null===(i=e[n])||void 0===i||i.setDensity(t)},setFrequency:function(t,n){var i;null===(i=e[n])||void 0===i||i.setFrequency(t)},setGravity:function(t,n,i){var o;null===(o=e[i])||void 0===o||o.setGravity(t,n)},setGravityAngle:function(t,n){var i;null===(i=e[n])||void 0===i||i.setGravityAngle(t)},setGravityStrength:function(t,n){var i;null===(i=e[n])||void 0===i||i.setGravityStrength(t)},setPaused:function(t,n){var i;null===(i=e[n])||void 0===i||i.setPaused(t)},setWind:function(t,n,i){var o;null===(o=e[i])||void 0===o||o.setWind(t,n)},setWindAngle:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindAngle(t)},setWindStrength:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindStrength(t)},setGusts:function(t,n){var i;null===(i=e[n])||void 0===i||i.setGusts(t)},togglePaused:function(t){var n;null===(n=e[t])||void 0===n||n.togglePaused()},setWindInAdditionalStrengthMin:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindInAdditionalStrengthMin(t)},setWindInAdditionalStrengthMax:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindInAdditionalStrengthMax(t)},setWindInDurationMin:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindInDurationMin(t)},setWindInDurationMax:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindInDurationMax(t)},setWindInDelayMin:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindInDelayMin(t)},setWindInDelayMax:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindInDelayMax(t)},setWindOutDurationMin:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindOutDurationMin(t)},setWindOutDurationMax:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindOutDurationMax(t)},setWindOutDelayMin:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindOutDelayMin(t)},setWindOutDelayMax:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindOutDelayMax(t)},setWindOutChangeChance:function(t,n){var i;null===(i=e[n])||void 0===i||i.setWindOutChangeChance(t)},setColour:function(t,n){"simple"===e[n].mode?e[n].setColour(t):console.error("attempting to set a colour on a layer that does not have a colour property")},setMassMin:function(t,n){var i;null===(i=e[n])||void 0===i||i.setMassMin(t)},setMassMax:function(t,n){var i;null===(i=e[n])||void 0===i||i.setMassMax(t)},setSizeMin:function(t,n){var i;null===(i=e[n])||void 0===i||i.setSizeMin(t)},setSizeMax:function(t,n){var i;null===(i=e[n])||void 0===i||i.setSizeMax(t)},restart:function(t){a(t?wt(t):t)},stop:function(){t=wt(ht),e=[],n.stop(),n.canvas.remove()}}}()).start(t)}catch(t){console.error(t)}}function Xt(t){void 0===t&&(t={}),Kt(),Bt(t)}function Kt(){null==Wt||Wt.stop(),Wt=void 0}function qt(t,e){void 0===e&&(e={}),function(t){var e=[0,31,29,31,30,31,30,31,31,30,31,30,31];if(t.from.month<1||t.from.month>12||t.from.day<1||t.from.day>e[t.from.month]||t.to.month<1||t.to.month>12||t.to.day<1||t.to.day>e[t.to.month])throw new Error("Invalid date in schedule");var n=new Date,i=100*(n.getUTCMonth()+1)+n.getUTCDate(),o=100*t.from.month+t.from.day,r=100*t.to.month+t.to.day;return o<=r?i>=o&&i<=r:i>=o||i<=r}(t)&&(Kt(),Bt(e))}function Vt(t,e){zt(),Wt.setColour(t,e)}function Ht(t,e){zt(),Wt.setDensity(t,e)}function Jt(t,e){zt(),Wt.setAmplitude(t,e)}function Zt(t,e){zt(),Wt.setFrequency(t,e)}function Qt(t,e){zt(),Wt.setPaused(t,e)}function $t(t){zt(),Wt.togglePaused(t)}function te(t,e,n){zt(),Wt.setWind(t,e,n)}function ee(t,e){zt(),Wt.setWindAngle(t,e)}function ne(t,e){zt(),Wt.setWindStrength(t,e)}function ie(t,e){zt(),Wt.setGusts(t,e)}function oe(t,e,n){zt(),Wt.setGravity(t,e,n)}function re(t,e){zt(),Wt.setGravityAngle(t,e)}function ae(t,e){zt(),Wt.setGravityStrength(t,e)}function se(t,e){zt(),Wt.setWindInAdditionalStrengthMin(t,e)}function ue(t,e){zt(),Wt.setWindInAdditionalStrengthMax(t,e)}function ce(t,e){zt(),Wt.setWindInDurationMin(t,e)}function de(t,e){zt(),Wt.setWindInDurationMax(t,e)}function le(t,e){zt(),Wt.setWindInDelayMin(t,e)}function fe(t,e){zt(),Wt.setWindInDelayMax(t,e)}function he(t,e){zt(),Wt.setWindOutDurationMin(t,e)}function pe(t,e){zt(),Wt.setWindOutDurationMax(t,e)}function ve(t,e){zt(),Wt.setWindOutDelayMin(t,e)}function ye(t,e){zt(),Wt.setWindOutDelayMax(t,e)}function ge(t,e){zt(),Wt.setWindOutChangeChance(t,e)}function me(t,e){zt(),Wt.setMassMin(t,e)}function we(t,e){zt(),Wt.setMassMax(t,e)}function _e(t,e){zt(),Wt.setSizeMin(t,e)}function xe(t,e){zt(),Wt.setSizeMax(t,e)}const Ae=t})(),i})()));
|
|
@@ -1,15 +1,45 @@
|
|
|
1
|
+
/*! ../utils/number */
|
|
2
|
+
|
|
3
|
+
/*! ../utils/object */
|
|
4
|
+
|
|
1
5
|
/*! ./assets */
|
|
2
6
|
|
|
3
7
|
/*! ./bramble */
|
|
4
8
|
|
|
5
9
|
/*! ./collision */
|
|
6
10
|
|
|
11
|
+
/*! ./common */
|
|
12
|
+
|
|
13
|
+
/*! ./defaults */
|
|
14
|
+
|
|
15
|
+
/*! ./effects */
|
|
16
|
+
|
|
7
17
|
/*! ./game */
|
|
8
18
|
|
|
9
19
|
/*! ./graphics */
|
|
10
20
|
|
|
21
|
+
/*! ./graphics/clear */
|
|
22
|
+
|
|
23
|
+
/*! ./graphics/defaults */
|
|
24
|
+
|
|
25
|
+
/*! ./graphics/effects */
|
|
26
|
+
|
|
27
|
+
/*! ./graphics/images */
|
|
28
|
+
|
|
29
|
+
/*! ./graphics/shapes */
|
|
30
|
+
|
|
31
|
+
/*! ./graphics/sprites */
|
|
32
|
+
|
|
33
|
+
/*! ./graphics/text */
|
|
34
|
+
|
|
35
|
+
/*! ./graphics/tiles */
|
|
36
|
+
|
|
37
|
+
/*! ./graphics/transforms */
|
|
38
|
+
|
|
11
39
|
/*! ./grid */
|
|
12
40
|
|
|
41
|
+
/*! ./images */
|
|
42
|
+
|
|
13
43
|
/*! ./input */
|
|
14
44
|
|
|
15
45
|
/*! ./input/gamepad */
|
|
@@ -20,14 +50,20 @@
|
|
|
20
50
|
|
|
21
51
|
/*! ./keys */
|
|
22
52
|
|
|
53
|
+
/*! ./renderer */
|
|
54
|
+
|
|
55
|
+
/*! ./shape_utils */
|
|
56
|
+
|
|
57
|
+
/*! ./shapes */
|
|
58
|
+
|
|
59
|
+
/*! ./sounds */
|
|
60
|
+
|
|
23
61
|
/*! ./sprite */
|
|
24
62
|
|
|
25
63
|
/*! ./storage */
|
|
26
64
|
|
|
27
65
|
/*! ./types */
|
|
28
66
|
|
|
29
|
-
/*! ./utils/number */
|
|
30
|
-
|
|
31
67
|
/*! ./utils/object */
|
|
32
68
|
|
|
33
69
|
/*! ./vec2 */
|
|
@@ -58,6 +94,10 @@
|
|
|
58
94
|
!*** ./src/assets.ts ***!
|
|
59
95
|
\***********************/
|
|
60
96
|
|
|
97
|
+
/*!***********************!*\
|
|
98
|
+
!*** ./src/sounds.ts ***!
|
|
99
|
+
\***********************/
|
|
100
|
+
|
|
61
101
|
/*!***********************!*\
|
|
62
102
|
!*** ./src/sprite.ts ***!
|
|
63
103
|
\***********************/
|
|
@@ -74,6 +114,10 @@
|
|
|
74
114
|
!*** ./src/graphics.ts ***!
|
|
75
115
|
\*************************/
|
|
76
116
|
|
|
117
|
+
/*!*************************!*\
|
|
118
|
+
!*** ./src/renderer.ts ***!
|
|
119
|
+
\*************************/
|
|
120
|
+
|
|
77
121
|
/*!**************************!*\
|
|
78
122
|
!*** ./src/collision.ts ***!
|
|
79
123
|
\**************************/
|
|
@@ -94,10 +138,54 @@
|
|
|
94
138
|
!*** ./src/utils/object.ts ***!
|
|
95
139
|
\*****************************/
|
|
96
140
|
|
|
141
|
+
/*!******************************!*\
|
|
142
|
+
!*** ./src/graphics/text.ts ***!
|
|
143
|
+
\******************************/
|
|
144
|
+
|
|
97
145
|
/*!******************************!*\
|
|
98
146
|
!*** ./src/input/gamepad.ts ***!
|
|
99
147
|
\******************************/
|
|
100
148
|
|
|
149
|
+
/*!*******************************!*\
|
|
150
|
+
!*** ./src/graphics/clear.ts ***!
|
|
151
|
+
\*******************************/
|
|
152
|
+
|
|
153
|
+
/*!*******************************!*\
|
|
154
|
+
!*** ./src/graphics/tiles.ts ***!
|
|
155
|
+
\*******************************/
|
|
156
|
+
|
|
101
157
|
/*!*******************************!*\
|
|
102
158
|
!*** ./src/input/keyboard.ts ***!
|
|
103
159
|
\*******************************/
|
|
160
|
+
|
|
161
|
+
/*!********************************!*\
|
|
162
|
+
!*** ./src/graphics/common.ts ***!
|
|
163
|
+
\********************************/
|
|
164
|
+
|
|
165
|
+
/*!********************************!*\
|
|
166
|
+
!*** ./src/graphics/images.ts ***!
|
|
167
|
+
\********************************/
|
|
168
|
+
|
|
169
|
+
/*!********************************!*\
|
|
170
|
+
!*** ./src/graphics/shapes.ts ***!
|
|
171
|
+
\********************************/
|
|
172
|
+
|
|
173
|
+
/*!*********************************!*\
|
|
174
|
+
!*** ./src/graphics/effects.ts ***!
|
|
175
|
+
\*********************************/
|
|
176
|
+
|
|
177
|
+
/*!*********************************!*\
|
|
178
|
+
!*** ./src/graphics/sprites.ts ***!
|
|
179
|
+
\*********************************/
|
|
180
|
+
|
|
181
|
+
/*!**********************************!*\
|
|
182
|
+
!*** ./src/graphics/defaults.ts ***!
|
|
183
|
+
\**********************************/
|
|
184
|
+
|
|
185
|
+
/*!************************************!*\
|
|
186
|
+
!*** ./src/graphics/transforms.ts ***!
|
|
187
|
+
\************************************/
|
|
188
|
+
|
|
189
|
+
/*!*************************************!*\
|
|
190
|
+
!*** ./src/graphics/shape_utils.ts ***!
|
|
191
|
+
\*************************************/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@erikwatson/snowfall",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "A beautiful and highly configurable snow effect for your winter themed project",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"webpack-merge": "^6.0.1"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@erikwatson/bramble": "^0.
|
|
43
|
+
"@erikwatson/bramble": "^0.10.0",
|
|
44
44
|
"@tweenjs/tween.js": "^23.1.2",
|
|
45
45
|
"seedrandom": "^3.0.5"
|
|
46
46
|
},
|
|
@@ -66,9 +66,5 @@
|
|
|
66
66
|
"require": "./dist/index.js",
|
|
67
67
|
"types": "./dist/index.d.ts"
|
|
68
68
|
}
|
|
69
|
-
},
|
|
70
|
-
"funding": {
|
|
71
|
-
"type": "github",
|
|
72
|
-
"url": "https://github.com/sponsors/erikwatson"
|
|
73
69
|
}
|
|
74
70
|
}
|