text: !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.PIXI=t()}}(function(){var t;return function e(t,r,i){function n(s,a){if(!r[s]){if(!t[s]){var h="function"==typeof require&&require;if(!a&&h)return h(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return n(r?r:e)},l,l.exports,e,t,r,i)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s<i.length;s++)n(i[s]);return n}({1:[function(e,r,i){(function(e,i){!function(){function n(){}function o(t){return t}function s(t){return!!t}function a(t){return!t}function h(t){return function(){if(null===t)throw new Error("Callback was already called.");t.apply(this,arguments),t=null}}function u(t){return function(){null!==t&&(t.apply(this,arguments),t=null)}}function l(t){return k(t)||"number"==typeof t.length&&t.length>=0&&t.length%1===0}function c(t,e){for(var r=-1,i=t.length;++r<i;)e(t[r],r,t)}function d(t,e){for(var r=-1,i=t.length,n=Array(i);++r<i;)n[r]=e(t[r],r,t);return n}function p(t){return d(Array(t),function(t,e){return e})}function f(t,e,r){return c(t,function(t,i,n){r=e(r,t,i,n)}),r}function y(t,e){c(G(t),function(r){e(t[r],r)})}function m(t,e){for(var r=0;r<t.length;r++)if(t[r]===e)return r;return-1}function v(t){var e,r,i=-1;return l(t)?(e=t.length,function(){return i++,i<e?i:null}):(r=G(t),e=r.length,function(){return i++,i<e?r[i]:null})}function x(t,e){return e=null==e?t.length-1:+e,function(){for(var r=Math.max(arguments.length-e,0),i=Array(r),n=0;n<r;n++)i[n]=arguments[n+e];switch(e){case 0:return t.call(this,i);case 1:return t.call(this,arguments[0],i)}}}function g(t){return function(e,r,i){return t(e,i)}}function _(t){return function(e,r,i){i=u(i||n),e=e||[];var o=v(e);if(t<=0)return i(null);var s=!1,a=0,l=!1;!function c(){if(s&&a<=0)return i(null);for(;a<t&&!l;){var n=o();if(null===n)return s=!0,void(a<=0&&i(null));a+=1,r(e[n],n,h(function(t){a-=1,t?(i(t),l=!0):c()}))}}()}}function b(t){return function(e,r,i){return t(j.eachOf,e,r,i)}}function T(t){return function(e,r,i,n){return t(_(r),e,i,n)}}function M(t){return function(e,r,i){return t(j.eachOfSeries,e,r,i)}}function S(t,e,r,i){i=u(i||n),e=e||[];var o=l(e)?[]:{};t(e,function(t,e,i){r(t,function(t,r){o[e]=r,i(t)})},function(t){i(t,o)})}function w(t,e,r,i){var n=[];t(e,function(t,e,i){r(t,function(r){r&&n.push({index:e,value:t}),i()})},function(){i(d(n.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})}function E(t,e,r,i){w(t,e,function(t,e){r(t,function(t){e(!t)})},i)}function D(t,e,r){return function(i,n,o,s){function a(){s&&s(r(!1,void 0))}function h(t,i,n){return s?void o(t,function(i){s&&e(i)&&(s(r(!0,t)),s=o=!1),n()}):n()}arguments.length>3?t(i,n,h,a):(s=o,o=n,t(i,h,a))}}function C(t,e){return e}function P(t,e,r){r=r||n;var i=l(e)?[]:{};t(e,function(t,e,r){t(x(function(t,n){n.length<=1&&(n=n[0]),i[e]=n,r(t)}))},function(t){r(t,i)})}function O(t,e,r,i){var n=[];t(e,function(t,e,i){r(t,function(t,e){n=n.concat(e||[]),i(t)})},function(t){i(t,n)})}function R(t,e,r){function i(t,e,r,i){if(null!=i&&"function"!=typeof i)throw new Error("task callback must be a function");return t.started=!0,k(e)||(e=[e]),0===e.length&&t.idle()?j.setImmediate(function(){t.drain()}):(c(e,function(e){var o={data:e,callback:i||n};r?t.tasks.unshift(o):t.tasks.push(o),t.tasks.length===t.concurrency&&t.saturated()}),void j.setImmediate(t.process))}function o(t,e){return function(){s-=1;var r=!1,i=arguments;c(e,function(t){c(a,function(e,i){e!==t||r||(a.splice(i,1),r=!0)}),t.callback.apply(t,i)}),t.tasks.length+s===0&&t.drain(),t.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var s=0,a=[],u={tasks:[],concurrency:e,payload:r,saturated:n,empty:n,drain:n,started:!1,paused:!1,push:function(t,e){i(u,t,!1,e)},kill:function(){u.drain=n,u.tasks=[]},unshift:function(t,e){i(u,t,!0,e)},process:function(){for(;!u.paused&&s<u.concurrency&&u.tasks.length;){var e=u.payload?u.tasks.splice(0,u.payload):u.tasks.splice(0,u.tasks.length),r=d(e,function(t){return t.data});0===u.tasks.length&&u.empty(),s+=1,a.push(e[0]);var i=h(o(u,e));t(r,i)}},length:function(){return u.tasks.length},running:function(){return s},workersList:function(){return a},idle:function(){return u.tasks.length+s===0},pause:function(){u.paused=!0},resume:function(){if(u.paused!==!1){u.paused=!1;for(var t=Math.min(u.concurrency,u.tasks.length),e=1;e<=t;e++)j.setImmediate(u.process)}}};return u}function I(t){return x(function(e,r){e.apply(null,r.concat([x(function(e,r){"object"==typeof console&&(e?console.error&&console.error(e):console[t]&&c(r,function(e){console[t](e)}))})]))})}function A(t){return function(e,r,i){t(p(e),r,i)}}function F(t){return x(function(e,r){var i=x(function(r){var i=this,n=r.pop();return t(e,function(t,e,n){t.apply(i,r.concat([n]))},n)});return r.length?i.apply(this,r):i})}function L(t){return x(function(e){var r=e.pop();e.push(function(){var t=arguments;i?j.setImmediate(function(){r.apply(null,t)}):r.apply(null,t)});var i=!0;t.apply(this,e),i=!1})}var B,j={},N="object"==typeof self&&self.self===self&&self||"object"==typeof i&&i.global===i&&i||this;null!=N&&(B=N.async),j.noConflict=function(){return N.async=B,j};var U=Object.prototype.toString,k=Array.isArray||function(t){return"[object Array]"===U.call(t)},z=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},G=Object.keys||function(t){var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e},V="function"==typeof setImmediate&&setImmediate,W=V?function(t){V(t)}:function(t){setTimeout(t,0)};"object"==typeof e&&"function"==typeof e.nextTick?j.nextTick=e.nextTick:j.nextTick=W,j.setImmediate=V?W:j.nextTick,j.forEach=j.each=function(t,e,r){return j.eachOf(t,g(e),r)},j.forEachSeries=j.eachSeries=function(t,e,r){return j.eachOfSeries(t,g(e),r)},j.forEachLimit=j.eachLimit=function(t,e,r,i){return _(e)(t,g(r),i)},j.forEachOf=j.eachOf=function(t,e,r){function i(t){a--,t?r(t):null===o&&a<=0&&r(null)}r=u(r||n),t=t||[];for(var o,s=v(t),a=0;null!=(o=s());)a+=1,e(t[o],o,h(i));0===a&&r(null)},j.forEachOfSeries=j.eachOfSeries=function(t,e,r){function i(){var n=!0;return null===s?r(null):(e(t[s],s,h(function(t){if(t)r(t);else{if(s=o(),null===s)return r(null);n?j.setImmediate(i):i()}})),void(n=!1))}r=u(r||n),t=t||[];var o=v(t),s=o();i()},j.forEachOfLimit=j.eachOfLimit=function(t,e,r,i){_(e)(t,r,i)},j.map=b(S),j.mapSeries=M(S),j.mapLimit=T(S),j.inject=j.foldl=j.reduce=function(t,e,r,i){j.eachOfSeries(t,function(t,i,n){r(e,t,function(t,r){e=r,n(t)})},function(t){i(t,e)})},j.foldr=j.reduceRight=function(t,e,r,i){var n=d(t,o).reverse();j.reduce(n,e,r,i)},j.transform=function(t,e,r,i){3===arguments.length&&(i=r,r=e,e=k(t)?[]:{}),j.eachOf(t,function(t,i,n){r(e,t,i,n)},function(t){i(t,e)})},j.select=j.filter=b(w),j.selectLimit=j.filterLimit=T(w),j.selectSeries=j.filterSeries=M(w),j.reject=b(E),j.rejectLimit=T(E),j.rejectSeries=M(E),j.any=j.some=D(j.eachOf,s,o),j.someLimit=D(j.eachOfLimit,s,o),j.all=j.every=D(j.eachOf,a,a),j.everyLimit=D(j.eachOfLimit,a,a),j.detect=D(j.eachOf,o,C),j.detectSeries=D(j.eachOfSeries,o,C),j.detectLimit=D(j.eachOfLimit,o,C),j.sortBy=function(t,e,r){function i(t,e){var r=t.criteria,i=e.criteria;return r<i?-1:r>i?1:0}j.map(t,function(t,r){e(t,function(e,i){e?r(e):r(null,{value:t,criteria:i})})},function(t,e){return t?r(t):void r(null,d(e.sort(i),function(t){return t.value}))})},j.auto=function(t,e,r){function i(t){v.unshift(t)}function o(t){var e=m(v,t);e>=0&&v.splice(e,1)}function s(){h--,c(v.slice(0),function(t){t()})}"function"==typeof arguments[1]&&(r=e,e=null),r=u(r||n);var a=G(t),h=a.length;if(!h)return r(null);e||(e=h);var l={},d=0,p=!1,v=[];i(function(){h||r(null,l)}),c(a,function(n){function a(){return d<e&&f(g,function(t,e){return t&&l.hasOwnProperty(e)},!0)&&!l.hasOwnProperty(n)}function h(){a()&&(d++,o(h),c[c.length-1](v,l))}if(!p){for(var u,c=k(t[n])?t[n]:[t[n]],v=x(function(t,e){if(d--,e.length<=1&&(e=e[0]),t){var i={};y(l,function(t,e){i[e]=t}),i[n]=e,p=!0,r(t,i)}else l[n]=e,j.setImmediate(s)}),g=c.slice(0,c.length-1),_=g.length;_--;){if(!(u=t[g[_]]))throw new Error("Has nonexistent dependency in "+g.join(", "));if(k(u)&&m(u,n)>=0)throw new Error("Has cyclic dependencies")}a()?(d++,c[c.length-1](v,l)):i(h)}})},j.retry=function(t,e,r){function i(t,e){if("number"==typeof e)t.times=parseInt(e,10)||o;else{if("object"!=typeof e)throw new Error("Unsupported argument type for 'times': "+typeof e);t.times=parseInt(e.times,10)||o,t.interval=parseInt(e.interval,10)||s}}function n(t,e){function r(t,r){return function(i){t(function(t,e){i(!t||r,{err:t,result:e})},e)}}function i(t){return function(e){setTimeout(function(){e(null)},t)}}for(;h.times;){var n=!(h.times-=1);a.push(r(h.task,n)),!n&&h.interval>0&&a.push(i(h.interval))}j.series(a,function(e,r){r=r[r.length-1],(t||h.callback)(r.err,r.result)})}var o=5,s=0,a=[],h={times:o,interval:s},u=arguments.length;if(u<1||u>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return u<=2&&"function"==typeof t&&(r=e,e=t),"function"!=typeof t&&i(h,t),h.callback=r,h.task=e,h.callback?n():n},j.waterfall=function(t,e){function r(t){return x(function(i,n){if(i)e.apply(null,[i].concat(n));else{var o=t.next();o?n.push(r(o)):n.push(e),L(t).apply(null,n)}})}if(e=u(e||n),!k(t)){var i=new Error("First argument to waterfall must be an array of functions");return e(i)}return t.length?void r(j.iterator(t))():e()},j.parallel=function(t,e){P(j.eachOf,t,e)},j.parallelLimit=function(t,e,r){P(_(e),t,r)},j.series=function(t,e){P(j.eachOfSeries,t,e)},j.iterator=function(t){function e(r){function i(){return t.length&&t[r].apply(null,arguments),i.next()}return i.next=function(){return r<t.length-1?e(r+1):null},i}return e(0)},j.apply=x(function(t,e){return x(function(r){return t.apply(null,e.concat(r))})}),j.concat=b(O),j.concatSeries=M(O),j.whilst=function(t,e,r){if(r=r||n,t()){var i=x(function(n,o){n?r(n):t.apply(this,o)?e(i):r.apply(null,[null].concat(o))});e(i)}else r(null)},j.doWhilst=function(t,e,r){var i=0;return j.whilst(function(){return++i<=1||e.apply(this,arguments)},t,r)},j.until=function(t,e,r){return j.whilst(function(){return!t.apply(this,arguments)},e,r)},j.doUntil=function(t,e,r){return j.doWhilst(t,function(){return!e.apply(this,arguments)},r)},j.during=function(t,e,r){r=r||n;var i=x(function(e,i){e?r(e):(i.push(o),t.apply(this,i))}),o=function(t,n){t?r(t):n?e(i):r(null)};t(o)},j.doDuring=function(t,e,r){var i=0;j.during(function(t){i++<1?t(null,!0):e.apply(this,arguments)},t,r)},j.queue=function(t,e){var r=R(function(e,r){t(e[0],r)},e,1);return r},j.priorityQueue=function(t,e){function r(t,e){return t.priority-e.priority}function i(t,e,r){for(var i=-1,n=t.length-1;i<n;){var o=i+(n-i+1>>>1);r(e,t[o])>=0?i=o:n=o-1}return i}function o(t,e,o,s){if(null!=s&&"function"!=typeof s)throw new Error("task callback must be a function");return t.started=!0,k(e)||(e=[e]),0===e.length?j.setImmediate(function(){t.drain()}):void c(e,function(e){var a={data:e,priority:o,callback:"function"==typeof s?s:n};t.tasks.splice(i(t.tasks,a,r)+1,0,a),t.tasks.length===t.concurrency&&t.saturated(),j.setImmediate(t.process)})}var s=j.queue(t,e);return s.push=function(t,e,r){o(s,t,e,r)},delete s.unshift,s},j.cargo=function(t,e){return R(t,1,e)},j.log=I("log"),j.dir=I("dir"),j.memoize=function(t,e){var r={},i={},n=Object.prototype.hasOwnProperty;e=e||o;var s=x(function(o){var s=o.pop(),a=e.apply(null,o);n.call(r,a)?j.setImmediate(function(){s.apply(null,r[a])}):n.call(i,a)?i[a].push(s):(i[a]=[s],t.apply(null,o.concat([x(function(t){r[a]=t;var e=i[a];delete i[a];for(var n=0,o=e.length;n<o;n++)e[n].apply(null,t)})])))});return s.memo=r,s.unmemoized=t,s},j.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},j.times=A(j.map),j.timesSeries=A(j.mapSeries),j.timesLimit=function(t,e,r,i){return j.mapLimit(p(t),e,r,i)},j.seq=function(){var t=arguments;return x(function(e){var r=this,i=e[e.length-1];"function"==typeof i?e.pop():i=n,j.reduce(t,e,function(t,e,i){e.apply(r,t.concat([x(function(t,e){i(t,e)})]))},function(t,e){i.apply(r,[t].concat(e))})})},j.compose=function(){return j.seq.apply(null,Array.prototype.reverse.call(arguments))},j.applyEach=F(j.eachOf),j.applyEachSeries=F(j.eachOfSeries),j.forever=function(t,e){function r(t){return t?i(t):void o(r)}var i=h(e||n),o=L(t);r()},j.ensureAsync=L,j.constant=x(function(t){var e=[null].concat(t);return function(t){return t.apply(this,e)}}),j.wrapSync=j.asyncify=function(t){return x(function(e){var r,i=e.pop();try{r=t.apply(this,e)}catch(n){return i(n)}z(r)&&"function"==typeof r.then?r.then(function(t){i(null,t)})["catch"](function(t){i(t.message?t:new Error(t))}):i(null,r)})},"object"==typeof r&&r.exports?r.exports=j:"function"==typeof t&&t.amd?t([],function(){return j}):N.async=j}()}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:36}],2:[function(t,e,r){"use strict";"use restrict";function i(t){var e=32;return t&=-t,t&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}var n=32;r.INT_BITS=n,r.INT_MAX=2147483647,r.INT_MIN=-1<<n-1,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>n-1;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t<e)},r.max=function(t,e){return t^(t^e)&-(t<e)},r.isPow2=function(t){return!(t&t-1||!t)},r.log2=function(t){var e,r;return e=(t>65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,e|=r,e|t>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return t-=t>>>1&1431655765,t=(858993459&t)+(t>>>2&858993459),16843009*(t+(t>>>4)&252645135)>>>24},r.countTrailingZeros=i,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,t&=15,27030>>>t&1};var o=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,i=e,n=7;for(r>>>=1;r;r>>>=1)i<<=1,i|=1&r,--n;t[e]=i<<n&255}}(o),r.reverse=function(t){return o[255&t]<<24|o[t>>>8&255]<<16|o[t>>>16&255]<<8|o[t>>>24&255]},r.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},r.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),t=65535&(t|t>>>16),t<<16>>16},r.interleave3=function(t,e,r){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),t|r<<2},r.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),t=1023&(t|t>>>16),t<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>i(t)+1}},{}],3:[function(t,e,r){"use strict";function i(t,e,r){r=r||2;var i=e&&e.length,o=i?e[0]*r:t.length,a=n(t,0,o,r,!0),h=[];if(!a)return h;var u,l,d,p,f,y,m;if(i&&(a=c(t,e,a,r)),t.length>80*r){u=d=t[0],l=p=t[1];for(var v=r;v<o;v+=r)f=t[v],y=t[v+1],f<u&&(u=f),y<l&&(l=y),f>d&&(d=f),y>p&&(p=y);m=Math.max(d-u,p-l)}return s(a,h,r,u,l,m),h}function n(t,e,r,i,n){var o,s;if(n===R(t,e,r,i)>0)for(o=e;o<r;o+=i)s=C(o,t[o],t[o+1],s);else for(o=r-i;o>=e;o-=i)s=C(o,t[o],t[o+1],s);return s&&T(s,s.next)&&(P(s),s=s.next),s}function o(t,e){if(!t)return t;e||(e=t);var r,i=t;do if(r=!1,i.steiner||!T(i,i.next)&&0!==b(i.prev,i,i.next))i=i.next;else{if(P(i),i=e=i.prev,i===i.next)return null;r=!0}while(r||i!==e);return e}function s(t,e,r,i,n,c,d){if(t){!d&&c&&y(t,i,n,c);for(var p,f,m=t;t.prev!==t.next;)if(p=t.prev,f=t.next,c?h(t,i,n,c):a(t))e.push(p.i/r),e.push(t.i/r),e.push(f.i/r),P(t),t=f.next,m=f.next;else if(t=f,t===m){d?1===d?(t=u(t,e,r),s(t,e,r,i,n,c,2)):2===d&&l(t,e,r,i,n,c):s(o(t),e,r,i,n,c,1);break}}}function a(t){var e=t.prev,r=t,i=t.next;if(b(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(g(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&b(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function h(t,e,r,i){var n=t.prev,o=t,s=t.next;if(b(n,o,s)>=0)return!1;for(var a=n.x<o.x?n.x<s.x?n.x:s.x:o.x<s.x?o.x:s.x,h=n.y<o.y?n.y<s.y?n.y:s.y:o.y<s.y?o.y:s.y,u=n.x>o.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=v(a,h,e,r,i),d=v(u,l,e,r,i),p=t.nextZ;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&g(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&g(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function u(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!T(n,o)&&M(n,i,i.next,o)&&w(n,o)&&w(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),P(i),P(i.next),i=t=o),i=i.next}while(i!==t);return i}function l(t,e,r,i,n,a){var h=t;do{for(var u=h.next.next;u!==h.prev;){if(h.i!==u.i&&_(h,u)){var l=D(h,u);return h=o(h,h.next),l=o(l,l.next),s(h,e,r,i,n,a),void s(l,e,r,i,n,a)}u=u.next}h=h.next}while(h!==t)}function c(t,e,r,i){var s,a,h,u,l,c=[];for(s=0,a=e.length;s<a;s++)h=e[s]*i,u=s<a-1?e[s+1]*i:t.length,l=n(t,h,u,i,!1),l===l.next&&(l.steiner=!0),c.push(x(l));for(c.sort(d),s=0;s<c.length;s++)p(c[s],r),r=o(r,r.next);return r}function d(t,e){return t.x-e.x}function p(t,e){if(e=f(t,e)){var r=D(e,t);o(r,r.next)}}function f(t,e){var r,i=e,n=t.x,o=t.y,s=-(1/0);do{if(o<=i.y&&o>=i.next.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s){if(s=a,a===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!r)return null;if(n===s)return r.prev;var h,u=r,l=r.x,c=r.y,d=1/0;for(i=r.next;i!==u;)n>=i.x&&i.x>=l&&g(o<c?n:s,o,l,c,o<c?s:n,o,i.x,i.y)&&(h=Math.abs(o-i.y)/(n-i.x),(h<d||h===d&&i.x>r.x)&&w(i,t)&&(r=i,d=h)),i=i.next;return r}function y(t,e,r,i){var n=t;do null===n.z&&(n.z=v(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,m(n)}function m(t){var e,r,i,n,o,s,a,h,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;e<u&&(a++,i=i.nextZ,i);e++);for(h=u;a>0||h>0&&i;)0===a?(n=i,i=i.nextZ,h--):0!==h&&i?r.z<=i.z?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--):(n=r,r=r.nextZ,a--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(s>1);return t}function v(t,e,r,i,n){return t=32767*(t-r)/n,e=32767*(e-i)/n,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function x(t){var e=t,r=t;do e.x<r.x&&(r=e),e=e.next;while(e!==t);return r}function g(t,e,r,i,n,o,s,a){return(n-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function _(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!S(t,e)&&w(t,e)&&w(e,t)&&E(t,e)}function b(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function T(t,e){return t.x===e.x&&t.y===e.y}function M(t,e,r,i){return!!(T(t,e)&&T(r,i)||T(t,i)&&T(r,e))||b(t,e,r)>0!=b(t,e,i)>0&&b(r,i,t)>0!=b(r,i,e)>0}function S(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&M(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function w(t,e){return b(t.prev,t,t.next)<0?b(t,e,t.next)>=0&&b(t,t.prev,e)>=0:b(t,e,t.prev)<0||b(t,t.next,e)<0}function E(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do r.y>o!=r.next.y>o&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next;while(r!==t);return i}function D(t,e){var r=new O(t.i,t.x,t.y),i=new O(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function C(t,e,r,i){var n=new O(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function P(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function O(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function R(t,e,r,i){for(var n=0,o=e,s=r-i;o<r;o+=i)n+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return n}e.exports=i,i.deviation=function(t,e,r,i){var n=e&&e.length,o=n?e[0]*r:t.length,s=Math.abs(R(t,0,o,r));if(n)for(var a=0,h=e.length;a<h;a++){var u=e[a]*r,l=a<h-1?e[a+1]*r:t.length;s-=Math.abs(R(t,u,l,r))}var c=0;for(a=0;a<i.length;a+=3){var d=i[a]*r,p=i[a+1]*r,f=i[a+2]*r;c+=Math.abs((t[d]-t[f])*(t[p+1]-t[d+1])-(t[d]-t[p])*(t[f+1]-t[d+1]))}return 0===s&&0===c?0:Math.abs((c-s)/s)},i.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},i=0,n=0;n<t.length;n++){for(var o=0;o<t[n].length;o++)for(var s=0;s<e;s++)r.vertices.push(t[n][o][s]);n>0&&(i+=t[n-1].length,r.holes.push(i))}return r}},{}],4:[function(t,e,r){"use strict";function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function n(){}var o=Object.prototype.hasOwnProperty,s="function"!=typeof Object.create&&"~";n.prototype._events=void 0,n.prototype.eventNames=function(){var t,e=this._events,r=[];if(!e)return r;for(t in e)o.call(e,t)&&r.push(s?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},n.prototype.listeners=function(t,e){var r=s?s+t:t,i=this._events&&this._events[r];if(e)return!!i;if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,a=new Array(o);n<o;n++)a[n]=i[n].fn;return a},n.prototype.emit=function(t,e,r,i,n,o){var a=s?s+t:t;if(!this._events||!this._events[a])return!1;var h,u,l=this._events[a],c=arguments.length;if("function"==typeof l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,n),!0;case 6:return l.fn.call(l.context,e,r,i,n,o),!0}for(u=1,h=new Array(c-1);u<c;u++)h[u-1]=arguments[u];l.fn.apply(l.context,h)}else{var d,p=l.length;for(u=0;u<p;u++)switch(l[u].once&&this.removeListener(t,l[u].fn,void 0,!0),c){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,e);break;case 3:l[u].fn.call(l[u].context,e,r);break;default:if(!h)for(d=1,h=new Array(c-1);d<c;d++)h[d-1]=arguments[d];l[u].fn.apply(l[u].context,h)}}return!0},n.prototype.on=function(t,e,r){var n=new i(e,r||this),o=s?s+t:t;return this._events||(this._events=s?{}:Object.create(null)),this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],n]:this._events[o].push(n):this._events[o]=n,this},n.prototype.once=function(t,e,r){var n=new i(e,r||this,(!0)),o=s?s+t:t;return this._events||(this._events=s?{}:Object.create(null)),this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],n]:this._events[o].push(n):this._events[o]=n,this},n.prototype.removeListener=function(t,e,r,i){var n=s?s+t:t;if(!this._events||!this._events[n])return this;var o=this._events[n],a=[];if(e)if(o.fn)(o.fn!==e||i&&!o.once||r&&o.context!==r)&&a.push(o);else for(var h=0,u=o.length;h<u;h++)(o[h].fn!==e||i&&!o[h].once||r&&o[h].context!==r)&&a.push(o[h]);return a.length?this._events[n]=1===a.length?a[0]:a:delete this._events[n],this},n.prototype.removeAllListeners=function(t){return this._events?(t?delete this._events[s?s+t:t]:this._events=s?{}:Object.create(null),this):this},n.prototype.off=n.prototype.removeListener,n.prototype.addListener=n.prototype.on,n.prototype.setMaxListeners=function(){return this},n.prefixed=s,"undefined"!=typeof e&&(e.exports=n)},{}],5:[function(t,e,r){r.glMatrix=t("./gl-matrix/common.js"),r.mat2=t("./gl-matrix/mat2.js"),r.mat2d=t("./gl-matrix/mat2d.js"),r.mat3=t("./gl-matrix/mat3.js"),r.mat4=t("./gl-matrix/mat4.js"),r.quat=t("./gl-matrix/quat.js"),r.vec2=t("./gl-matrix/vec2.js"),r.vec3=t("./gl-matrix/vec3.js"),r.vec4=t("./gl-matrix/vec4.js")},{"./gl-matrix/common.js":6,"./gl-matrix/mat2.js":7,"./gl-matrix/mat2d.js":8,"./gl-matrix/mat3.js":9,"./gl-matrix/mat4.js":10,"./gl-matrix/quat.js":11,"./gl-matrix/vec2.js":12,"./gl-matrix/vec3.js":13,"./gl-matrix/vec4.js":14}],6:[function(t,e,r){var i={};i.EPSILON=1e-6,i.ARRAY_TYPE="undefined"!=typeof Float32Array?Float32Array:Array,i.RANDOM=Math.random,i.ENABLE_SIMD=!1,i.SIMD_AVAILABLE=i.ARRAY_TYPE===Float32Array&&"SIMD"in this,i.USE_SIMD=i.ENABLE_SIMD&&i.SIMD_AVAILABLE,i.setMatrixArrayType=function(t){i.ARRAY_TYPE=t};var n=Math.PI/180;i.toRadian=function(t){return t*n},i.equals=function(t,e){return Math.abs(t-e)<=i.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))},e.exports=i},{}],7:[function(t,e,r){var i=t("./common.js"),n={};n.create=function(){var t=new i.ARRAY_TYPE(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},n.clone=function(t){var e=new i.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},n.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},n.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},n.fromValues=function(t,e,r,n){var o=new i.ARRAY_TYPE(4);return o[0]=t,o[1]=e,o[2]=r,o[3]=n,o},n.set=function(t,e,r,i,n){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t},n.transpose=function(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},n.invert=function(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],s=r*o-n*i;return s?(s=1/s,t[0]=o*s,t[1]=-i*s,t[2]=-n*s,t[3]=r*s,t):null},n.adjoint=function(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t},n.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},n.multiply=function(t,e,r){var i=e[0],n=e[1],o=e[2],s=e[3],a=r[0],h=r[1],u=r[2],l=r[3];return t[0]=i*a+o*h,t[1]=n*a+s*h,t[2]=i*u+o*l,t[3]=n*u+s*l,t},n.mul=n.multiply,n.rotate=function(t,e,r){var i=e[0],n=e[1],o=e[2],s=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=i*h+o*a,t[1]=n*h+s*a,t[2]=i*-a+o*h,t[3]=n*-a+s*h,t},n.scale=function(t,e,r){var i=e[0],n=e[1],o=e[2],s=e[3],a=r[0],h=r[1];return t[0]=i*a,t[1]=n*a,t[2]=o*h,t[3]=s*h,t},n.fromRotation=function(t,e){var r=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=r,t[2]=-r,t[3]=i,t},n.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},n.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},n.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},n.LDU=function(t,e,r,i){return t[2]=i[2]/i[0],r[0]=i[0],r[1]=i[1],r[3]=i[3]-t[2]*r[1],[t,e,r]},n.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t},n.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t},n.sub=n.subtract,n.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},n.equals=function(t,e){var r=t[0],n=t[1],o=t[2],s=t[3],a=e[0],h=e[1],u=e[2],l=e[3];return Math.abs(r-a)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-h)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(o-u)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))&&Math.abs(s-l)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(l))},n.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},n.multiplyScalarAndAdd=function(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t[2]=e[2]+r[2]*i,t[3]=e[3]+r[3]*i,t},e.exports=n},{"./common.js":6}],8:[function(t,e,r){var i=t("./common.js"),n={};n.create=function(){var t=new i.ARRAY_TYPE(6);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},n.clone=function(t){var e=new i.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},n.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},n.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},n.fromValues=function(t,e,r,n,o,s){var a=new i.ARRAY_TYPE(6);return a[0]=t,a[1]=e,a[2]=r,a[3]=n,a[4]=o,a[5]=s,a},n.set=function(t,e,r,i,n,o,s){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t[4]=o,t[5]=s,t},n.invert=function(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],h=r*o-i*n;return h?(h=1/h,t[0]=o*h,t[1]=-i*h,t[2]=-n*h,t[3]=r*h,t[4]=(n*a-o*s)*h,t[5]=(i*s-r*a)*h,t):null},n.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},n.multiply=function(t,e,r){var i=e[0],n=e[1],o=e[2],s=e[3],a=e[4],h=e[5],u=r[0],l=r[1],c=r[2],d=r[3],p=r[4],f=r[5];return t[0]=i*u+o*l,t[1]=n*u+s*l,t[2]=i*c+o*d,t[3]=n*c+s*d,t[4]=i*p+o*f+a,t[5]=n*p+s*f+h,t},n.mul=n.multiply,n.rotate=function(t,e,r){var i=e[0],n=e[1],o=e[2],s=e[3],a=e[4],h=e[5],u=Math.sin(r),l=Math.cos(r);return t[0]=i*l+o*u,t[1]=n*l+s*u,t[2]=i*-u+o*l,t[3]=n*-u+s*l,t[4]=a,t[5]=h,t},n.scale=function(t,e,r){var i=e[0],n=e[1],o=e[2],s=e[3],a=e[4],h=e[5],u=r[0],l=r[1];return t[0]=i*u,t[1]=n*u,t[2]=o*l,t[3]=s*l,t[4]=a,t[5]=h,t},n.translate=function(t,e,r){var i=e[0],n=e[1],o=e[2],s=e[3],a=e[4],h=e[5],u=r[0],l=r[1];return t[0]=i,t[1]=n,t[2]=o,t[3]=s,t[4]=i*u+o*l+a,t[5]=n*u+s*l+h,t},n.fromRotation=function(t,e){var r=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=r,t[2]=-r,t[3]=i,t[4]=0,t[5]=0,t},n.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},n.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},n.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},n.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},n.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t},n.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t},n.sub=n.subtract,n.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t},n.multiplyScalarAndAdd=function(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t[2]=e[2]+r[2]*i,t[3]=e[3]+r[3]*i,t[4]=e[4]+r[4]*i,t[5]=e[5]+r[5]*i,t},n.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},n.equals=function(t,e){var r=t[0],n=t[1],o=t[2],s=t[3],a=t[4],h=t[5],u=e[0],l=e[1],c=e[2],d=e[3],p=e[4],f=e[5];return Math.abs(r-u)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-l)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(o-c)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(s-d)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(a-p)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(h-f)<=i.EPSILON*Math.max(1,Math.abs(h),Math.abs(f))},e.exports=n},{"./common.js":6}],9:[function(t,e,r){var i=t("./common.js"),n={};n.create=function(){var t=new i.ARRAY_TYPE(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},n.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},n.clone=function(t){var e=new i.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},n.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},n.fromValues=function(t,e,r,n,o,s,a,h,u){var l=new i.ARRAY_TYPE(9);return l[0]=t,l[1]=e,l[2]=r,l[3]=n,l[4]=o,l[5]=s,l[6]=a,l[7]=h,l[8]=u,l},n.set=function(t,e,r,i,n,o,s,a,h,u){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t[4]=o,t[5]=s,t[6]=a,t[7]=h,t[8]=u,t},n.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},n.transpose=function(t,e){if(t===e){var r=e[1],i=e[2],n=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=i,t[7]=n}else t[0]=e[0],t[1]=e[3],t[2]=e[6],
  t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},n.invert=function(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],h=e[6],u=e[7],l=e[8],c=l*s-a*u,d=-l*o+a*h,p=u*o-s*h,f=r*c+i*d+n*p;return f?(f=1/f,t[0]=c*f,t[1]=(-l*i+n*u)*f,t[2]=(a*i-n*s)*f,t[3]=d*f,t[4]=(l*r-n*h)*f,t[5]=(-a*r+n*o)*f,t[6]=p*f,t[7]=(-u*r+i*h)*f,t[8]=(s*r-i*o)*f,t):null},n.adjoint=function(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],h=e[6],u=e[7],l=e[8];return t[0]=s*l-a*u,t[1]=n*u-i*l,t[2]=i*a-n*s,t[3]=a*h-o*l,t[4]=r*l-n*h,t[5]=n*o-r*a,t[6]=o*u-s*h,t[7]=i*h-r*u,t[8]=r*s-i*o,t},n.determinant=function(t){var e=t[0],r=t[1],i=t[2],n=t[3],o=t[4],s=t[5],a=t[6],h=t[7],u=t[8];return e*(u*o-s*h)+r*(-u*n+s*a)+i*(h*n-o*a)},n.multiply=function(t,e,r){var i=e[0],n=e[1],o=e[2],s=e[3],a=e[4],h=e[5],u=e[6],l=e[7],c=e[8],d=r[0],p=r[1],f=r[2],y=r[3],m=r[4],v=r[5],x=r[6],g=r[7],_=r[8];return t[0]=d*i+p*s+f*u,t[1]=d*n+p*a+f*l,t[2]=d*o+p*h+f*c,t[3]=y*i+m*s+v*u,t[4]=y*n+m*a+v*l,t[5]=y*o+m*h+v*c,t[6]=x*i+g*s+_*u,t[7]=x*n+g*a+_*l,t[8]=x*o+g*h+_*c,t},n.mul=n.multiply,n.translate=function(t,e,r){var i=e[0],n=e[1],o=e[2],s=e[3],a=e[4],h=e[5],u=e[6],l=e[7],c=e[8],d=r[0],p=r[1];return t[0]=i,t[1]=n,t[2]=o,t[3]=s,t[4]=a,t[5]=h,t[6]=d*i+p*s+u,t[7]=d*n+p*a+l,t[8]=d*o+p*h+c,t},n.rotate=function(t,e,r){var i=e[0],n=e[1],o=e[2],s=e[3],a=e[4],h=e[5],u=e[6],l=e[7],c=e[8],d=Math.sin(r),p=Math.cos(r);return t[0]=p*i+d*s,t[1]=p*n+d*a,t[2]=p*o+d*h,t[3]=p*s-d*i,t[4]=p*a-d*n,t[5]=p*h-d*o,t[6]=u,t[7]=l,t[8]=c,t},n.scale=function(t,e,r){var i=r[0],n=r[1];return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=n*e[3],t[4]=n*e[4],t[5]=n*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},n.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},n.fromRotation=function(t,e){var r=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=r,t[2]=0,t[3]=-r,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},n.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},n.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},n.fromQuat=function(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],s=r+r,a=i+i,h=n+n,u=r*s,l=i*s,c=i*a,d=n*s,p=n*a,f=n*h,y=o*s,m=o*a,v=o*h;return t[0]=1-c-f,t[3]=l-v,t[6]=d+m,t[1]=l+v,t[4]=1-u-f,t[7]=p-y,t[2]=d-m,t[5]=p+y,t[8]=1-u-c,t},n.normalFromMat4=function(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],h=e[6],u=e[7],l=e[8],c=e[9],d=e[10],p=e[11],f=e[12],y=e[13],m=e[14],v=e[15],x=r*a-i*s,g=r*h-n*s,_=r*u-o*s,b=i*h-n*a,T=i*u-o*a,M=n*u-o*h,S=l*y-c*f,w=l*m-d*f,E=l*v-p*f,D=c*m-d*y,C=c*v-p*y,P=d*v-p*m,O=x*P-g*C+_*D+b*E-T*w+M*S;return O?(O=1/O,t[0]=(a*P-h*C+u*D)*O,t[1]=(h*E-s*P-u*w)*O,t[2]=(s*C-a*E+u*S)*O,t[3]=(n*C-i*P-o*D)*O,t[4]=(r*P-n*E+o*w)*O,t[5]=(i*E-r*C-o*S)*O,t[6]=(y*M-m*T+v*b)*O,t[7]=(m*_-f*M-v*g)*O,t[8]=(f*T-y*_+v*x)*O,t):null},n.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},n.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},n.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t},n.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t},n.sub=n.subtract,n.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t},n.multiplyScalarAndAdd=function(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t[2]=e[2]+r[2]*i,t[3]=e[3]+r[3]*i,t[4]=e[4]+r[4]*i,t[5]=e[5]+r[5]*i,t[6]=e[6]+r[6]*i,t[7]=e[7]+r[7]*i,t[8]=e[8]+r[8]*i,t},n.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},n.equals=function(t,e){var r=t[0],n=t[1],o=t[2],s=t[3],a=t[4],h=t[5],u=t[6],l=t[7],c=t[8],d=e[0],p=e[1],f=e[2],y=e[3],m=e[4],v=e[5],x=t[6],g=e[7],_=e[8];return Math.abs(r-d)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(n-p)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(p))&&Math.abs(o-f)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(s-y)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(y))&&Math.abs(a-m)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(h-v)<=i.EPSILON*Math.max(1,Math.abs(h),Math.abs(v))&&Math.abs(u-x)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(x))&&Math.abs(l-g)<=i.EPSILON*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(c-_)<=i.EPSILON*Math.max(1,Math.abs(c),Math.abs(_))},e.exports=n},{"./common.js":6}],10:[function(t,e,r){var i=t("./common.js"),n={scalar:{},SIMD:{}};n.create=function(){var t=new i.ARRAY_TYPE(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},n.clone=function(t){var e=new i.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},n.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},n.fromValues=function(t,e,r,n,o,s,a,h,u,l,c,d,p,f,y,m){var v=new i.ARRAY_TYPE(16);return v[0]=t,v[1]=e,v[2]=r,v[3]=n,v[4]=o,v[5]=s,v[6]=a,v[7]=h,v[8]=u,v[9]=l,v[10]=c,v[11]=d,v[12]=p,v[13]=f,v[14]=y,v[15]=m,v},n.set=function(t,e,r,i,n,o,s,a,h,u,l,c,d,p,f,y,m){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t[4]=o,t[5]=s,t[6]=a,t[7]=h,t[8]=u,t[9]=l,t[10]=c,t[11]=d,t[12]=p,t[13]=f,t[14]=y,t[15]=m,t},n.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},n.scalar.transpose=function(t,e){if(t===e){var r=e[1],i=e[2],n=e[3],o=e[6],s=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=o,t[11]=e[14],t[12]=n,t[13]=s,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},n.SIMD.transpose=function(t,e){var r,i,n,o,s,a,h,u,l,c;return r=SIMD.Float32x4.load(e,0),i=SIMD.Float32x4.load(e,4),n=SIMD.Float32x4.load(e,8),o=SIMD.Float32x4.load(e,12),s=SIMD.Float32x4.shuffle(r,i,0,1,4,5),a=SIMD.Float32x4.shuffle(n,o,0,1,4,5),h=SIMD.Float32x4.shuffle(s,a,0,2,4,6),u=SIMD.Float32x4.shuffle(s,a,1,3,5,7),SIMD.Float32x4.store(t,0,h),SIMD.Float32x4.store(t,4,u),s=SIMD.Float32x4.shuffle(r,i,2,3,6,7),a=SIMD.Float32x4.shuffle(n,o,2,3,6,7),l=SIMD.Float32x4.shuffle(s,a,0,2,4,6),c=SIMD.Float32x4.shuffle(s,a,1,3,5,7),SIMD.Float32x4.store(t,8,l),SIMD.Float32x4.store(t,12,c),t},n.transpose=i.USE_SIMD?n.SIMD.transpose:n.scalar.transpose,n.scalar.invert=function(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],h=e[6],u=e[7],l=e[8],c=e[9],d=e[10],p=e[11],f=e[12],y=e[13],m=e[14],v=e[15],x=r*a-i*s,g=r*h-n*s,_=r*u-o*s,b=i*h-n*a,T=i*u-o*a,M=n*u-o*h,S=l*y-c*f,w=l*m-d*f,E=l*v-p*f,D=c*m-d*y,C=c*v-p*y,P=d*v-p*m,O=x*P-g*C+_*D+b*E-T*w+M*S;return O?(O=1/O,t[0]=(a*P-h*C+u*D)*O,t[1]=(n*C-i*P-o*D)*O,t[2]=(y*M-m*T+v*b)*O,t[3]=(d*T-c*M-p*b)*O,t[4]=(h*E-s*P-u*w)*O,t[5]=(r*P-n*E+o*w)*O,t[6]=(m*_-f*M-v*g)*O,t[7]=(l*M-d*_+p*g)*O,t[8]=(s*C-a*E+u*S)*O,t[9]=(i*E-r*C-o*S)*O,t[10]=(f*T-y*_+v*x)*O,t[11]=(c*_-l*T-p*x)*O,t[12]=(a*w-s*D-h*S)*O,t[13]=(r*D-i*w+n*S)*O,t[14]=(y*g-f*b-m*x)*O,t[15]=(l*b-c*g+d*x)*O,t):null},n.SIMD.invert=function(t,e){var r,i,n,o,s,a,h,u,l,c,d=SIMD.Float32x4.load(e,0),p=SIMD.Float32x4.load(e,4),f=SIMD.Float32x4.load(e,8),y=SIMD.Float32x4.load(e,12);return s=SIMD.Float32x4.shuffle(d,p,0,1,4,5),i=SIMD.Float32x4.shuffle(f,y,0,1,4,5),r=SIMD.Float32x4.shuffle(s,i,0,2,4,6),i=SIMD.Float32x4.shuffle(i,s,1,3,5,7),s=SIMD.Float32x4.shuffle(d,p,2,3,6,7),o=SIMD.Float32x4.shuffle(f,y,2,3,6,7),n=SIMD.Float32x4.shuffle(s,o,0,2,4,6),o=SIMD.Float32x4.shuffle(o,s,1,3,5,7),s=SIMD.Float32x4.mul(n,o),s=SIMD.Float32x4.swizzle(s,1,0,3,2),a=SIMD.Float32x4.mul(i,s),h=SIMD.Float32x4.mul(r,s),s=SIMD.Float32x4.swizzle(s,2,3,0,1),a=SIMD.Float32x4.sub(SIMD.Float32x4.mul(i,s),a),h=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,s),h),h=SIMD.Float32x4.swizzle(h,2,3,0,1),s=SIMD.Float32x4.mul(i,n),s=SIMD.Float32x4.swizzle(s,1,0,3,2),a=SIMD.Float32x4.add(SIMD.Float32x4.mul(o,s),a),l=SIMD.Float32x4.mul(r,s),s=SIMD.Float32x4.swizzle(s,2,3,0,1),a=SIMD.Float32x4.sub(a,SIMD.Float32x4.mul(o,s)),l=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,s),l),l=SIMD.Float32x4.swizzle(l,2,3,0,1),s=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(i,2,3,0,1),o),s=SIMD.Float32x4.swizzle(s,1,0,3,2),n=SIMD.Float32x4.swizzle(n,2,3,0,1),a=SIMD.Float32x4.add(SIMD.Float32x4.mul(n,s),a),u=SIMD.Float32x4.mul(r,s),s=SIMD.Float32x4.swizzle(s,2,3,0,1),a=SIMD.Float32x4.sub(a,SIMD.Float32x4.mul(n,s)),u=SIMD.Float32x4.sub(SIMD.Float32x4.mul(r,s),u),u=SIMD.Float32x4.swizzle(u,2,3,0,1),s=SIMD.Float32x4.mul(r,i),s=SIMD.Float32x4.swizzle(s,1,0,3,2),u=SIMD.Float32x4.add(SIMD.Float32x4.mul(o,s),u),l=SIMD.Float32x4.sub(SIMD.Float32x4.mul(n,s),l),s=SIMD.Float32x4.swizzle(s,2,3,0,1),u=SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,s),u),l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(n,s)),s=SIMD.Float32x4.mul(r,o),s=SIMD.Float32x4.swizzle(s,1,0,3,2),h=SIMD.Float32x4.sub(h,SIMD.Float32x4.mul(n,s)),u=SIMD.Float32x4.add(SIMD.Float32x4.mul(i,s),u),s=SIMD.Float32x4.swizzle(s,2,3,0,1),h=SIMD.Float32x4.add(SIMD.Float32x4.mul(n,s),h),u=SIMD.Float32x4.sub(u,SIMD.Float32x4.mul(i,s)),s=SIMD.Float32x4.mul(r,n),s=SIMD.Float32x4.swizzle(s,1,0,3,2),h=SIMD.Float32x4.add(SIMD.Float32x4.mul(o,s),h),l=SIMD.Float32x4.sub(l,SIMD.Float32x4.mul(i,s)),s=SIMD.Float32x4.swizzle(s,2,3,0,1),h=SIMD.Float32x4.sub(h,SIMD.Float32x4.mul(o,s)),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(i,s),l),c=SIMD.Float32x4.mul(r,a),c=SIMD.Float32x4.add(SIMD.Float32x4.swizzle(c,2,3,0,1),c),c=SIMD.Float32x4.add(SIMD.Float32x4.swizzle(c,1,0,3,2),c),s=SIMD.Float32x4.reciprocalApproximation(c),c=SIMD.Float32x4.sub(SIMD.Float32x4.add(s,s),SIMD.Float32x4.mul(c,SIMD.Float32x4.mul(s,s))),(c=SIMD.Float32x4.swizzle(c,0,0,0,0))?(SIMD.Float32x4.store(t,0,SIMD.Float32x4.mul(c,a)),SIMD.Float32x4.store(t,4,SIMD.Float32x4.mul(c,h)),SIMD.Float32x4.store(t,8,SIMD.Float32x4.mul(c,u)),SIMD.Float32x4.store(t,12,SIMD.Float32x4.mul(c,l)),t):null},n.invert=i.USE_SIMD?n.SIMD.invert:n.scalar.invert,n.scalar.adjoint=function(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],h=e[6],u=e[7],l=e[8],c=e[9],d=e[10],p=e[11],f=e[12],y=e[13],m=e[14],v=e[15];return t[0]=a*(d*v-p*m)-c*(h*v-u*m)+y*(h*p-u*d),t[1]=-(i*(d*v-p*m)-c*(n*v-o*m)+y*(n*p-o*d)),t[2]=i*(h*v-u*m)-a*(n*v-o*m)+y*(n*u-o*h),t[3]=-(i*(h*p-u*d)-a*(n*p-o*d)+c*(n*u-o*h)),t[4]=-(s*(d*v-p*m)-l*(h*v-u*m)+f*(h*p-u*d)),t[5]=r*(d*v-p*m)-l*(n*v-o*m)+f*(n*p-o*d),t[6]=-(r*(h*v-u*m)-s*(n*v-o*m)+f*(n*u-o*h)),t[7]=r*(h*p-u*d)-s*(n*p-o*d)+l*(n*u-o*h),t[8]=s*(c*v-p*y)-l*(a*v-u*y)+f*(a*p-u*c),t[9]=-(r*(c*v-p*y)-l*(i*v-o*y)+f*(i*p-o*c)),t[10]=r*(a*v-u*y)-s*(i*v-o*y)+f*(i*u-o*a),t[11]=-(r*(a*p-u*c)-s*(i*p-o*c)+l*(i*u-o*a)),t[12]=-(s*(c*m-d*y)-l*(a*m-h*y)+f*(a*d-h*c)),t[13]=r*(c*m-d*y)-l*(i*m-n*y)+f*(i*d-n*c),t[14]=-(r*(a*m-h*y)-s*(i*m-n*y)+f*(i*h-n*a)),t[15]=r*(a*d-h*c)-s*(i*d-n*c)+l*(i*h-n*a),t},n.SIMD.adjoint=function(t,e){var r,i,n,o,s,a,h,u,l,c,d,p,f,r=SIMD.Float32x4.load(e,0),i=SIMD.Float32x4.load(e,4),n=SIMD.Float32x4.load(e,8),o=SIMD.Float32x4.load(e,12);return l=SIMD.Float32x4.shuffle(r,i,0,1,4,5),a=SIMD.Float32x4.shuffle(n,o,0,1,4,5),s=SIMD.Float32x4.shuffle(l,a,0,2,4,6),a=SIMD.Float32x4.shuffle(a,l,1,3,5,7),l=SIMD.Float32x4.shuffle(r,i,2,3,6,7),u=SIMD.Float32x4.shuffle(n,o,2,3,6,7),h=SIMD.Float32x4.shuffle(l,u,0,2,4,6),u=SIMD.Float32x4.shuffle(u,l,1,3,5,7),l=SIMD.Float32x4.mul(h,u),l=SIMD.Float32x4.swizzle(l,1,0,3,2),c=SIMD.Float32x4.mul(a,l),d=SIMD.Float32x4.mul(s,l),l=SIMD.Float32x4.swizzle(l,2,3,0,1),c=SIMD.Float32x4.sub(SIMD.Float32x4.mul(a,l),c),d=SIMD.Float32x4.sub(SIMD.Float32x4.mul(s,l),d),d=SIMD.Float32x4.swizzle(d,2,3,0,1),l=SIMD.Float32x4.mul(a,h),l=SIMD.Float32x4.swizzle(l,1,0,3,2),c=SIMD.Float32x4.add(SIMD.Float32x4.mul(u,l),c),f=SIMD.Float32x4.mul(s,l),l=SIMD.Float32x4.swizzle(l,2,3,0,1),c=SIMD.Float32x4.sub(c,SIMD.Float32x4.mul(u,l)),f=SIMD.Float32x4.sub(SIMD.Float32x4.mul(s,l),f),f=SIMD.Float32x4.swizzle(f,2,3,0,1),l=SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(a,2,3,0,1),u),l=SIMD.Float32x4.swizzle(l,1,0,3,2),h=SIMD.Float32x4.swizzle(h,2,3,0,1),c=SIMD.Float32x4.add(SIMD.Float32x4.mul(h,l),c),p=SIMD.Float32x4.mul(s,l),l=SIMD.Float32x4.swizzle(l,2,3,0,1),c=SIMD.Float32x4.sub(c,SIMD.Float32x4.mul(h,l)),p=SIMD.Float32x4.sub(SIMD.Float32x4.mul(s,l),p),p=SIMD.Float32x4.swizzle(p,2,3,0,1),l=SIMD.Float32x4.mul(s,a),l=SIMD.Float32x4.swizzle(l,1,0,3,2),p=SIMD.Float32x4.add(SIMD.Float32x4.mul(u,l),p),f=SIMD.Float32x4.sub(SIMD.Float32x4.mul(h,l),f),l=SIMD.Float32x4.swizzle(l,2,3,0,1),p=SIMD.Float32x4.sub(SIMD.Float32x4.mul(u,l),p),f=SIMD.Float32x4.sub(f,SIMD.Float32x4.mul(h,l)),l=SIMD.Float32x4.mul(s,u),l=SIMD.Float32x4.swizzle(l,1,0,3,2),d=SIMD.Float32x4.sub(d,SIMD.Float32x4.mul(h,l)),p=SIMD.Float32x4.add(SIMD.Float32x4.mul(a,l),p),l=SIMD.Float32x4.swizzle(l,2,3,0,1),d=SIMD.Float32x4.add(SIMD.Float32x4.mul(h,l),d),p=SIMD.Float32x4.sub(p,SIMD.Float32x4.mul(a,l)),l=SIMD.Float32x4.mul(s,h),l=SIMD.Float32x4.swizzle(l,1,0,3,2),d=SIMD.Float32x4.add(SIMD.Float32x4.mul(u,l),d),f=SIMD.Float32x4.sub(f,SIMD.Float32x4.mul(a,l)),l=SIMD.Float32x4.swizzle(l,2,3,0,1),d=SIMD.Float32x4.sub(d,SIMD.Float32x4.mul(u,l)),f=SIMD.Float32x4.add(SIMD.Float32x4.mul(a,l),f),SIMD.Float32x4.store(t,0,c),SIMD.Float32x4.store(t,4,d),SIMD.Float32x4.store(t,8,p),SIMD.Float32x4.store(t,12,f),t},n.adjoint=i.USE_SIMD?n.SIMD.adjoint:n.scalar.adjoint,n.determinant=function(t){var e=t[0],r=t[1],i=t[2],n=t[3],o=t[4],s=t[5],a=t[6],h=t[7],u=t[8],l=t[9],c=t[10],d=t[11],p=t[12],f=t[13],y=t[14],m=t[15],v=e*s-r*o,x=e*a-i*o,g=e*h-n*o,_=r*a-i*s,b=r*h-n*s,T=i*h-n*a,M=u*f-l*p,S=u*y-c*p,w=u*m-d*p,E=l*y-c*f,D=l*m-d*f,C=c*m-d*y;return v*C-x*D+g*E+_*w-b*S+T*M},n.SIMD.multiply=function(t,e,r){var i=SIMD.Float32x4.load(e,0),n=SIMD.Float32x4.load(e,4),o=SIMD.Float32x4.load(e,8),s=SIMD.Float32x4.load(e,12),a=SIMD.Float32x4.load(r,0),h=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(a,0,0,0,0),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(a,1,1,1,1),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(a,2,2,2,2),o),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(a,3,3,3,3),s))));SIMD.Float32x4.store(t,0,h);var u=SIMD.Float32x4.load(r,4),l=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,0,0,0,0),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,1,1,1,1),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,2,2,2,2),o),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(u,3,3,3,3),s))));SIMD.Float32x4.store(t,4,l);var c=SIMD.Float32x4.load(r,8),d=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(c,0,0,0,0),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(c,1,1,1,1),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(c,2,2,2,2),o),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(c,3,3,3,3),s))));SIMD.Float32x4.store(t,8,d);var p=SIMD.Float32x4.load(r,12),f=SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(p,0,0,0,0),i),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(p,1,1,1,1),n),SIMD.Float32x4.add(SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(p,2,2,2,2),o),SIMD.Float32x4.mul(SIMD.Float32x4.swizzle(p,3,3,3,3),s))));return SIMD.Float32x4.store(t,12,f),t},n.scalar.multiply=function(t,e,r){var i=e[0],n=e[1],o=e[2],s=e[3],a=e[4],h=e[5],u=e[6],l=e[7],c=e[8],d=e[9],p=e[10],f=e[11],y=e[12],m=e[13],v=e[14],x=e[15],g=r[0],_=r[1],b=r[2],T=r[3];return t[0]=g*i+_*a+b*c+T*y,t[1]=g*n+_*h+b*d+T*m,t[2]=g*o+_*u+b*p+T*v,t[3]=g*s+_*l+b*f+T*x,g=r[4],_=r[5],b=r[6],T=r[7],t[4]=g*i+_*a+b*c+T*y,t[5]=g*n+_*h+b*d+T*m,t[6]=g*o+_*u+b*p+T*v,t[7]=g*s+_*l+b*f+T*x,g=r[8],_=r[9],b=r[10],T=r[11],t[8]=g*i+_*a+b*c+T*y,t[9]=g*n+_*h+b*d+T*m,t[10]=g*o+_*u+b*p+T*v,t[11]=g*s+_*l+b*f+T*x,g=r[12],_=r[13],b=r[14],T=r[15],t[12]=g*i+_*a+b*c+T*y,t[13]=g*n+_*h+b*d+T*m,t[14]=g*o+_*u+b*p+T*v,t[15]=g*s+_*l+b*f+T*x,t},n.multiply=i.USE_SIMD?n.SIMD.multiply:n.scalar.multiply,n.mul=n.multiply,n.scalar.translate=function(t,e,r){var i,n,o,s,a,h,u,l,c,d,p,f,y=r[0],m=r[1],v=r[2];return e===t?(t[12]=e[0]*y+e[4]*m+e[8]*v+e[12],t[13]=e[1]*y+e[5]*m+e[9]*v+e[13],t[14]=e[2]*y+e[6]*m+e[10]*v+e[14],t[15]=e[3]*y+e[7]*m+e[11]*v+e[15]):(i=e[0],n=e[1],o=e[2],s=e[3],a=e[4],h=e[5],u=e[6],l=e[7],c=e[8],d=e[9],p=e[10],f=e[11],t[0]=i,t[1]=n,t[2]=o,t[3]=s,t[4]=a,t[5]=h,t[6]=u,t[7]=l,t[8]=c,t[9]=d,t[10]=p,t[11]=f,t[12]=i*y+a*m+c*v+e[12],t[13]=n*y+h*m+d*v+e[13],t[14]=o*y+u*m+p*v+e[14],t[15]=s*y+l*m+f*v+e[15]),t},n.SIMD.translate=function(t,e,r){var i=SIMD.Float32x4.load(e,0),n=SIMD.Float32x4.load(e,4),o=SIMD.Float32x4.load(e,8),s=SIMD.Float32x4.load(e,12),a=SIMD.Float32x4(r[0],r[1],r[2],0);e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11]),i=SIMD.Float32x4.mul(i,SIMD.Float32x4.swizzle(a,0,0,0,0)),n=SIMD.Float32x4.mul(n,SIMD.Float32x4.swizzle(a,1,1,1,1)),o=SIMD.Float32x4.mul(o,SIMD.Float32x4.swizzle(a,2,2,2,2));var h=SIMD.Float32x4.add(i,SIMD.Float32x4.add(n,SIMD.Float32x4.add(o,s)));return SIMD.Float32x4.store(t,12,h),t},n.translate=i.USE_SIMD?n.SIMD.translate:n.scalar.translate,n.scalar.scale=function(t,e,r){var i=r[0],n=r[1],o=r[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},n.SIMD.scale=function(t,e,r){var i,n,o,s=SIMD.Float32x4(r[0],r[1],r[2],0);return i=SIMD.Float32x4.load(e,0),SIMD.Float32x4.store(t,0,SIMD.Float32x4.mul(i,SIMD.Float32x4.swizzle(s,0,0,0,0))),n=SIMD.Float32x4.load(e,4),SIMD.Float32x4.store(t,4,SIMD.Float32x4.mul(n,SIMD.Float32x4.swizzle(s,1,1,1,1))),o=SIMD.Float32x4.load(e,8),SIMD.Float32x4.store(t,8,SIMD.Float32x4.mul(o,SIMD.Float32x4.swizzle(s,2,2,2,2))),t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},n.scale=i.USE_SIMD?n.SIMD.scale:n.scalar.scale,n.rotate=function(t,e,r,n){var o,s,a,h,u,l,c,d,p,f,y,m,v,x,g,_,b,T,M,S,w,E,D,C,P=n[0],O=n[1],R=n[2],I=Math.sqrt(P*P+O*O+R*R);return Math.abs(I)<i.EPSILON?null:(I=1/I,P*=I,O*=I,R*=I,o=Math.sin(r),s=Math.cos(r),a=1-s,h=e[0],u=e[1],l=e[2],c=e[3],d=e[4],p=e[5],f=e[6],y=e[7],m=e[8],v=e[9],x=e[10],g=e[11],_=P*P*a+s,b=O*P*a+R*o,T=R*P*a-O*o,M=P*O*a-R*o,S=O*O*a+s,w=R*O*a+P*o,E=P*R*a+O*o,D=O*R*a-P*o,C=R*R*a+s,t[0]=h*_+d*b+m*T,t[1]=u*_+p*b+v*T,t[2]=l*_+f*b+x*T,t[3]=c*_+y*b+g*T,t[4]=h*M+d*S+m*w,t[5]=u*M+p*S+v*w,t[6]=l*M+f*S+x*w,t[7]=c*M+y*S+g*w,t[8]=h*E+d*D+m*C,t[9]=u*E+p*D+v*C,t[10]=l*E+f*D+x*C,t[11]=c*E+y*D+g*C,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},n.scalar.rotateX=function(t,e,r){var i=Math.sin(r),n=Math.cos(r),o=e[4],s=e[5],a=e[6],h=e[7],u=e[8],l=e[9],c=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*n+u*i,t[5]=s*n+l*i,t[6]=a*n+c*i,t[7]=h*n+d*i,t[8]=u*n-o*i,t[9]=l*n-s*i,t[10]=c*n-a*i,t[11]=d*n-h*i,t},n.SIMD.rotateX=function(t,e,r){var i=SIMD.Float32x4.splat(Math.sin(r)),n=SIMD.Float32x4.splat(Math.cos(r));e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);var o=SIMD.Float32x4.load(e,4),s=SIMD.Float32x4.load(e,8);return SIMD.Float32x4.store(t,4,SIMD.Float32x4.add(SIMD.Float32x4.mul(o,n),SIMD.Float32x4.mul(s,i))),SIMD.Float32x4.store(t,8,SIMD.Float32x4.sub(SIMD.Float32x4.mul(s,n),SIMD.Float32x4.mul(o,i))),t},n.rotateX=i.USE_SIMD?n.SIMD.rotateX:n.scalar.rotateX,n.scalar.rotateY=function(t,e,r){var i=Math.sin(r),n=Math.cos(r),o=e[0],s=e[1],a=e[2],h=e[3],u=e[8],l=e[9],c=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*n-u*i,t[1]=s*n-l*i,t[2]=a*n-c*i,t[3]=h*n-d*i,t[8]=o*i+u*n,t[9]=s*i+l*n,t[10]=a*i+c*n,t[11]=h*i+d*n,t},n.SIMD.rotateY=function(t,e,r){var i=SIMD.Float32x4.splat(Math.sin(r)),n=SIMD.Float32x4.splat(Math.cos(r));e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);var o=SIMD.Float32x4.load(e,0),s=SIMD.Float32x4.load(e,8);return SIMD.Float32x4.store(t,0,SIMD.Float32x4.sub(SIMD.Float32x4.mul(o,n),SIMD.Float32x4.mul(s,i))),SIMD.Float32x4.store(t,8,SIMD.Float32x4.add(SIMD.Float32x4.mul(o,i),SIMD.Float32x4.mul(s,n))),t},n.rotateY=i.USE_SIMD?n.SIMD.rotateY:n.scalar.rotateY,n.scalar.rotateZ=function(t,e,r){var i=Math.sin(r),n=Math.cos(r),o=e[0],s=e[1],a=e[2],h=e[3],u=e[4],l=e[5],c=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*n+u*i,t[1]=s*n+l*i,t[2]=a*n+c*i,t[3]=h*n+d*i,t[4]=u*n-o*i,t[5]=l*n-s*i,t[6]=c*n-a*i,t[7]=d*n-h*i,t},n.SIMD.rotateZ=function(t,e,r){var i=SIMD.Float32x4.splat(Math.sin(r)),n=SIMD.Float32x4.splat(Math.cos(r));e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);var o=SIMD.Float32x4.load(e,0),s=SIMD.Float32x4.load(e,4);return SIMD.Float32x4.store(t,0,SIMD.Float32x4.add(SIMD.Float32x4.mul(o,n),SIMD.Float32x4.mul(s,i))),SIMD.Float32x4.store(t,4,SIMD.Float32x4.sub(SIMD.Float32x4.mul(s,n),SIMD.Float32x4.mul(o,i))),t},n.rotateZ=i.USE_SIMD?n.SIMD.rotateZ:n.scalar.rotateZ,n.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t},n.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},n.fromRotation=function(t,e,r){var n,o,s,a=r[0],h=r[1],u=r[2],l=Math.sqrt(a*a+h*h+u*u);return Math.abs(l)<i.EPSILON?null:(l=1/l,a*=l,h*=l,u*=l,n=Math.sin(e),o=Math.cos(e),s=1-o,t[0]=a*a*s+o,t[1]=h*a*s+u*n,t[2]=u*a*s-h*n,t[3]=0,t[4]=a*h*s-u*n,t[5]=h*h*s+o,t[6]=u*h*s+a*n,t[7]=0,t[8]=a*u*s+h*n,t[9]=h*u*s-a*n,t[10]=u*u*s+o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},n.fromXRotation=function(t,e){var r=Math.sin(e),i=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},n.fromYRotation=function(t,e){var r=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},n.fromZRotation=function(t,e){var r=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},n.fromRotationTranslation=function(t,e,r){var i=e[0],n=e[1],o=e[2],s=e[3],a=i+i,h=n+n,u=o+o,l=i*a,c=i*h,d=i*u,p=n*h,f=n*u,y=o*u,m=s*a,v=s*h,x=s*u;return t[0]=1-(p+y),t[1]=c+x,t[2]=d-v,t[3]=0,t[4]=c-x,t[5]=1-(l+y),t[6]=f+m,t[7]=0,t[8]=d+v,t[9]=f-m,t[10]=1-(l+p),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},n.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},n.getRotation=function(t,e){var r=e[0]+e[5]+e[10],i=0;return r>0?(i=2*Math.sqrt(r+1),t[3]=.25*i,t[0]=(e[6]-e[9])/i,t[1]=(e[8]-e[2])/i,t[2]=(e[1]-e[4])/i):e[0]>e[5]&e[0]>e[10]?(i=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/i,t[0]=.25*i,t[1]=(e[1]+e[4])/i,t[2]=(e[8]+e[2])/i):e[5]>e[10]?(i=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/i,t[0]=(e[1]+e[4])/i,t[1]=.25*i,t[2]=(e[6]+e[9])/i):(i=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/i,t[0]=(e[8]+e[2])/i,t[1]=(e[6]+e[9])/i,t[2]=.25*i),t},n.fromRotationTranslationScale=function(t,e,r,i){var n=e[0],o=e[1],s=e[2],a=e[3],h=n+n,u=o+o,l=s+s,c=n*h,d=n*u,p=n*l,f=o*u,y=o*l,m=s*l,v=a*h,x=a*u,g=a*l,_=i[0],b=i[1],T=i[2];return t[0]=(1-(f+m))*_,t[1]=(d+g)*_,t[2]=(p-x)*_,t[3]=0,t[4]=(d-g)*b,t[5]=(1-(c+m))*b,t[6]=(y+v)*b,t[7]=0,t[8]=(p+x)*T,t[9]=(y-v)*T,t[10]=(1-(c+f))*T,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},n.fromRotationTranslationScaleOrigin=function(t,e,r,i,n){var o=e[0],s=e[1],a=e[2],h=e[3],u=o+o,l=s+s,c=a+a,d=o*u,p=o*l,f=o*c,y=s*l,m=s*c,v=a*c,x=h*u,g=h*l,_=h*c,b=i[0],T=i[1],M=i[2],S=n[0],w=n[1],E=n[2];return t[0]=(1-(y+v))*b,t[1]=(p+_)*b,t[2]=(f-g)*b,t[3]=0,t[4]=(p-_)*T,t[5]=(1-(d+v))*T,t[6]=(m+x)*T,t[7]=0,t[8]=(f+g)*M,t[9]=(m-x)*M,t[10]=(1-(d+y))*M,t[11]=0,t[12]=r[0]+S-(t[0]*S+t[4]*w+t[8]*E),t[13]=r[1]+w-(t[1]*S+t[5]*w+t[9]*E),t[14]=r[2]+E-(t[2]*S+t[6]*w+t[10]*E),t[15]=1,t},n.fromQuat=function(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],s=r+r,a=i+i,h=n+n,u=r*s,l=i*s,c=i*a,d=n*s,p=n*a,f=n*h,y=o*s,m=o*a,v=o*h;return t[0]=1-c-f,t[1]=l+v,t[2]=d-m,t[3]=0,t[4]=l-v,t[5]=1-u-f,t[6]=p+y,t[7]=0,t[8]=d+m,t[9]=p-y,t[10]=1-u-c,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},n.frustum=function(t,e,r,i,n,o,s){var a=1/(r-e),h=1/(n-i),u=1/(o-s);return t[0]=2*o*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*h,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(n+i)*h,t[10]=(s+o)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*o*2*u,t[15]=0,t},n.perspective=function(t,e,r,i,n){var o=1/Math.tan(e/2),s=1/(i-n);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(n+i)*s,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*n*i*s,t[15]=0,t},n.perspectiveFromFieldOfView=function(t,e,r,i){var n=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),s=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),h=2/(s+a),u=2/(n+o);return t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-((s-a)*h*.5),t[9]=(n-o)*u*.5,t[10]=i/(r-i),t[11]=-1,t[12]=0,t[13]=0,t[14]=i*r/(r-i),t[15]=0,t},n.ortho=function(t,e,r,i,n,o,s){var a=1/(e-r),h=1/(i-n),u=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*a,t[13]=(n+i)*h,t[14]=(s+o)*u,t[15]=1,t},n.lookAt=function(t,e,r,o){var s,a,h,u,l,c,d,p,f,y,m=e[0],v=e[1],x=e[2],g=o[0],_=o[1],b=o[2],T=r[0],M=r[1],S=r[2];return Math.abs(m-T)<i.EPSILON&&Math.abs(v-M)<i.EPSILON&&Math.abs(x-S)<i.EPSILON?n.identity(t):(d=m-T,p=v-M,f=x-S,y=1/Math.sqrt(d*d+p*p+f*f),d*=y,p*=y,f*=y,s=_*f-b*p,a=b*d-g*f,h=g*p-_*d,y=Math.sqrt(s*s+a*a+h*h),y?(y=1/y,s*=y,a*=y,h*=y):(s=0,a=0,h=0),u=p*h-f*a,l=f*s-d*h,c=d*a-p*s,y=Math.sqrt(u*u+l*l+c*c),y?(y=1/y,u*=y,l*=y,c*=y):(u=0,l=0,c=0),t[0]=s,t[1]=u,t[2]=d,t[3]=0,t[4]=a,t[5]=l,t[6]=p,t[7]=0,t[8]=h,t[9]=c,t[10]=f,t[11]=0,t[12]=-(s*m+a*v+h*x),t[13]=-(u*m+l*v+c*x),t[14]=-(d*m+p*v+f*x),t[15]=1,t)},n.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},n.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},n.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t},n.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t},n.sub=n.subtract,n.multiplyScalar=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t},n.multiplyScalarAndAdd=function(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t[2]=e[2]+r[2]*i,t[3]=e[3]+r[3]*i,t[4]=e[4]+r[4]*i,t[5]=e[5]+r[5]*i,t[6]=e[6]+r[6]*i,t[7]=e[7]+r[7]*i,t[8]=e[8]+r[8]*i,t[9]=e[9]+r[9]*i,t[10]=e[10]+r[10]*i,t[11]=e[11]+r[11]*i,t[12]=e[12]+r[12]*i,t[13]=e[13]+r[13]*i,t[14]=e[14]+r[14]*i,t[15]=e[15]+r[15]*i,t},n.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},n.equals=function(t,e){var r=t[0],n=t[1],o=t[2],s=t[3],a=t[4],h=t[5],u=t[6],l=t[7],c=t[8],d=t[9],p=t[10],f=t[11],y=t[12],m=t[13],v=t[14],x=t[15],g=e[0],_=e[1],b=e[2],T=e[3],M=e[4],S=e[5],w=e[6],E=e[7],D=e[8],C=e[9],P=e[10],O=e[11],R=e[12],I=e[13],A=e[14],F=e[15];return Math.abs(r-g)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(g))&&Math.abs(n-_)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(_))&&Math.abs(o-b)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(s-T)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(T))&&Math.abs(a-M)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(h-S)<=i.EPSILON*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(u-w)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(w))&&Math.abs(l-E)<=i.EPSILON*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(c-D)<=i.EPSILON*Math.max(1,Math.abs(c),Math.abs(D))&&Math.abs(d-C)<=i.EPSILON*Math.max(1,Math.abs(d),Math.abs(C))&&Math.abs(p-P)<=i.EPSILON*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(f-O)<=i.EPSILON*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(y-R)<=i.EPSILON*Math.max(1,Math.abs(y),Math.abs(R))&&Math.abs(m-I)<=i.EPSILON*Math.max(1,Math.abs(m),Math.abs(I))&&Math.abs(v-A)<=i.EPSILON*Math.max(1,Math.abs(v),Math.abs(A))&&Math.abs(x-F)<=i.EPSILON*Math.max(1,Math.abs(x),Math.abs(F))},e.exports=n},{"./common.js":6}],11:[function(t,e,r){var i=t("./common.js"),n=t("./mat3.js"),o=t("./vec3.js"),s=t("./vec4.js"),a={};a.create=function(){var t=new i.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},a.rotationTo=function(){var t=o.create(),e=o.fromValues(1,0,0),r=o.fromValues(0,1,0);return function(i,n,s){var h=o.dot(n,s);return h<-.999999?(o.cross(t,e,n),o.length(t)<1e-6&&o.cross(t,r,n),o.normalize(t,t),a.setAxisAngle(i,t,Math.PI),i):h>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(o.cross(t,n,s),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=1+h,a.normalize(i,i))}}(),a.setAxes=function(){var t=n.create();return function(e,r,i,n){return t[0]=i[0],t[3]=i[1],t[6]=i[2],t[1]=n[0],t[4]=n[1],t[7]=n[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],a.normalize(e,a.fromMat3(e,t))}}(),a.clone=s.clone,a.fromValues=s.fromValues,a.copy=s.copy,a.set=s.set,a.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},a.setAxisAngle=function(t,e,r){r=.5*r;var i=Math.sin(r);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(r),t},a.getAxisAngle=function(t,e){var r=2*Math.acos(e[3]),i=Math.sin(r/2);return 0!=i?(t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i):(t[0]=1,t[1]=0,t[2]=0),r},a.add=s.add,a.multiply=function(t,e,r){var i=e[0],n=e[1],o=e[2],s=e[3],a=r[0],h=r[1],u=r[2],l=r[3];return t[0]=i*l+s*a+n*u-o*h,t[1]=n*l+s*h+o*a-i*u,t[2]=o*l+s*u+i*h-n*a,t[3]=s*l-i*a-n*h-o*u,t},a.mul=a.multiply,a.scale=s.scale,a.rotateX=function(t,e,r){r*=.5;var i=e[0],n=e[1],o=e[2],s=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=i*h+s*a,t[1]=n*h+o*a,t[2]=o*h-n*a,t[3]=s*h-i*a,t},a.rotateY=function(t,e,r){r*=.5;var i=e[0],n=e[1],o=e[2],s=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=i*h-o*a,t[1]=n*h+s*a,t[2]=o*h+i*a,t[3]=s*h-n*a,t},a.rotateZ=function(t,e,r){r*=.5;var i=e[0],n=e[1],o=e[2],s=e[3],a=Math.sin(r),h=Math.cos(r);return t[0]=i*h+n*a,t[1]=n*h-i*a,t[2]=o*h+s*a,t[3]=s*h-o*a,t},a.calculateW=function(t,e){var r=e[0],i=e[1],n=e[2];return t[0]=r,t[1]=i,t[2]=n,t[3]=Math.sqrt(Math.abs(1-r*r-i*i-n*n)),t},a.dot=s.dot,a.lerp=s.lerp,a.slerp=function(t,e,r,i){var n,o,s,a,h,u=e[0],l=e[1],c=e[2],d=e[3],p=r[0],f=r[1],y=r[2],m=r[3];return o=u*p+l*f+c*y+d*m,o<0&&(o=-o,p=-p,f=-f,y=-y,m=-m),1-o>1e-6?(n=Math.acos(o),s=Math.sin(n),a=Math.sin((1-i)*n)/s,h=Math.sin(i*n)/s):(a=1-i,
  h=i),t[0]=a*u+h*p,t[1]=a*l+h*f,t[2]=a*c+h*y,t[3]=a*d+h*m,t},a.sqlerp=function(){var t=a.create(),e=a.create();return function(r,i,n,o,s,h){return a.slerp(t,i,s,h),a.slerp(e,n,o,h),a.slerp(r,t,e,2*h*(1-h)),r}}(),a.invert=function(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],s=r*r+i*i+n*n+o*o,a=s?1/s:0;return t[0]=-r*a,t[1]=-i*a,t[2]=-n*a,t[3]=o*a,t},a.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},a.length=s.length,a.len=a.length,a.squaredLength=s.squaredLength,a.sqrLen=a.squaredLength,a.normalize=s.normalize,a.fromMat3=function(t,e){var r,i=e[0]+e[4]+e[8];if(i>0)r=Math.sqrt(i+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var n=0;e[4]>e[0]&&(n=1),e[8]>e[3*n+n]&&(n=2);var o=(n+1)%3,s=(n+2)%3;r=Math.sqrt(e[3*n+n]-e[3*o+o]-e[3*s+s]+1),t[n]=.5*r,r=.5/r,t[3]=(e[3*o+s]-e[3*s+o])*r,t[o]=(e[3*o+n]+e[3*n+o])*r,t[s]=(e[3*s+n]+e[3*n+s])*r}return t},a.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},a.exactEquals=s.exactEquals,a.equals=s.equals,e.exports=a},{"./common.js":6,"./mat3.js":9,"./vec3.js":13,"./vec4.js":14}],12:[function(t,e,r){var i=t("./common.js"),n={};n.create=function(){var t=new i.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},n.clone=function(t){var e=new i.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},n.fromValues=function(t,e){var r=new i.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r},n.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},n.set=function(t,e,r){return t[0]=e,t[1]=r,t},n.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t},n.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t},n.sub=n.subtract,n.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t},n.mul=n.multiply,n.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t},n.div=n.divide,n.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},n.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},n.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t},n.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t},n.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},n.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t},n.scaleAndAdd=function(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t},n.distance=function(t,e){var r=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(r*r+i*i)},n.dist=n.distance,n.squaredDistance=function(t,e){var r=e[0]-t[0],i=e[1]-t[1];return r*r+i*i},n.sqrDist=n.squaredDistance,n.length=function(t){var e=t[0],r=t[1];return Math.sqrt(e*e+r*r)},n.len=n.length,n.squaredLength=function(t){var e=t[0],r=t[1];return e*e+r*r},n.sqrLen=n.squaredLength,n.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},n.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},n.normalize=function(t,e){var r=e[0],i=e[1],n=r*r+i*i;return n>0&&(n=1/Math.sqrt(n),t[0]=e[0]*n,t[1]=e[1]*n),t},n.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},n.cross=function(t,e,r){var i=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=i,t},n.lerp=function(t,e,r,i){var n=e[0],o=e[1];return t[0]=n+i*(r[0]-n),t[1]=o+i*(r[1]-o),t},n.random=function(t,e){e=e||1;var r=2*i.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t},n.transformMat2=function(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[2]*n,t[1]=r[1]*i+r[3]*n,t},n.transformMat2d=function(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[2]*n+r[4],t[1]=r[1]*i+r[3]*n+r[5],t},n.transformMat3=function(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[3]*n+r[6],t[1]=r[1]*i+r[4]*n+r[7],t},n.transformMat4=function(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[4]*n+r[12],t[1]=r[1]*i+r[5]*n+r[13],t},n.forEach=function(){var t=n.create();return function(e,r,i,n,o,s){var a,h;for(r||(r=2),i||(i=0),h=n?Math.min(n*r+i,e.length):e.length,a=i;a<h;a+=r)t[0]=e[a],t[1]=e[a+1],o(t,t,s),e[a]=t[0],e[a+1]=t[1];return e}}(),n.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},n.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},n.equals=function(t,e){var r=t[0],n=t[1],o=e[0],s=e[1];return Math.abs(r-o)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-s)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))},e.exports=n},{"./common.js":6}],13:[function(t,e,r){var i=t("./common.js"),n={};n.create=function(){var t=new i.ARRAY_TYPE(3);return t[0]=0,t[1]=0,t[2]=0,t},n.clone=function(t){var e=new i.ARRAY_TYPE(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},n.fromValues=function(t,e,r){var n=new i.ARRAY_TYPE(3);return n[0]=t,n[1]=e,n[2]=r,n},n.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},n.set=function(t,e,r,i){return t[0]=e,t[1]=r,t[2]=i,t},n.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t},n.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t},n.sub=n.subtract,n.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t},n.mul=n.multiply,n.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t},n.div=n.divide,n.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},n.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},n.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t},n.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t},n.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},n.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t},n.scaleAndAdd=function(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t[2]=e[2]+r[2]*i,t},n.distance=function(t,e){var r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2];return Math.sqrt(r*r+i*i+n*n)},n.dist=n.distance,n.squaredDistance=function(t,e){var r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2];return r*r+i*i+n*n},n.sqrDist=n.squaredDistance,n.length=function(t){var e=t[0],r=t[1],i=t[2];return Math.sqrt(e*e+r*r+i*i)},n.len=n.length,n.squaredLength=function(t){var e=t[0],r=t[1],i=t[2];return e*e+r*r+i*i},n.sqrLen=n.squaredLength,n.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},n.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t},n.normalize=function(t,e){var r=e[0],i=e[1],n=e[2],o=r*r+i*i+n*n;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t},n.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},n.cross=function(t,e,r){var i=e[0],n=e[1],o=e[2],s=r[0],a=r[1],h=r[2];return t[0]=n*h-o*a,t[1]=o*s-i*h,t[2]=i*a-n*s,t},n.lerp=function(t,e,r,i){var n=e[0],o=e[1],s=e[2];return t[0]=n+i*(r[0]-n),t[1]=o+i*(r[1]-o),t[2]=s+i*(r[2]-s),t},n.hermite=function(t,e,r,i,n,o){var s=o*o,a=s*(2*o-3)+1,h=s*(o-2)+o,u=s*(o-1),l=s*(3-2*o);return t[0]=e[0]*a+r[0]*h+i[0]*u+n[0]*l,t[1]=e[1]*a+r[1]*h+i[1]*u+n[1]*l,t[2]=e[2]*a+r[2]*h+i[2]*u+n[2]*l,t},n.bezier=function(t,e,r,i,n,o){var s=1-o,a=s*s,h=o*o,u=a*s,l=3*o*a,c=3*h*s,d=h*o;return t[0]=e[0]*u+r[0]*l+i[0]*c+n[0]*d,t[1]=e[1]*u+r[1]*l+i[1]*c+n[1]*d,t[2]=e[2]*u+r[2]*l+i[2]*c+n[2]*d,t},n.random=function(t,e){e=e||1;var r=2*i.RANDOM()*Math.PI,n=2*i.RANDOM()-1,o=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*o,t[1]=Math.sin(r)*o,t[2]=n*e,t},n.transformMat4=function(t,e,r){var i=e[0],n=e[1],o=e[2],s=r[3]*i+r[7]*n+r[11]*o+r[15];return s=s||1,t[0]=(r[0]*i+r[4]*n+r[8]*o+r[12])/s,t[1]=(r[1]*i+r[5]*n+r[9]*o+r[13])/s,t[2]=(r[2]*i+r[6]*n+r[10]*o+r[14])/s,t},n.transformMat3=function(t,e,r){var i=e[0],n=e[1],o=e[2];return t[0]=i*r[0]+n*r[3]+o*r[6],t[1]=i*r[1]+n*r[4]+o*r[7],t[2]=i*r[2]+n*r[5]+o*r[8],t},n.transformQuat=function(t,e,r){var i=e[0],n=e[1],o=e[2],s=r[0],a=r[1],h=r[2],u=r[3],l=u*i+a*o-h*n,c=u*n+h*i-s*o,d=u*o+s*n-a*i,p=-s*i-a*n-h*o;return t[0]=l*u+p*-s+c*-h-d*-a,t[1]=c*u+p*-a+d*-s-l*-h,t[2]=d*u+p*-h+l*-a-c*-s,t},n.rotateX=function(t,e,r,i){var n=[],o=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],o[0]=n[0],o[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),o[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t},n.rotateY=function(t,e,r,i){var n=[],o=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],o[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),o[1]=n[1],o[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t},n.rotateZ=function(t,e,r,i){var n=[],o=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],o[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),o[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),o[2]=n[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t},n.forEach=function(){var t=n.create();return function(e,r,i,n,o,s){var a,h;for(r||(r=3),i||(i=0),h=n?Math.min(n*r+i,e.length):e.length,a=i;a<h;a+=r)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],o(t,t,s),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2];return e}}(),n.angle=function(t,e){var r=n.fromValues(t[0],t[1],t[2]),i=n.fromValues(e[0],e[1],e[2]);n.normalize(r,r),n.normalize(i,i);var o=n.dot(r,i);return o>1?0:Math.acos(o)},n.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},n.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},n.equals=function(t,e){var r=t[0],n=t[1],o=t[2],s=e[0],a=e[1],h=e[2];return Math.abs(r-s)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-a)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(o-h)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(h))},e.exports=n},{"./common.js":6}],14:[function(t,e,r){var i=t("./common.js"),n={};n.create=function(){var t=new i.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},n.clone=function(t){var e=new i.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},n.fromValues=function(t,e,r,n){var o=new i.ARRAY_TYPE(4);return o[0]=t,o[1]=e,o[2]=r,o[3]=n,o},n.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},n.set=function(t,e,r,i,n){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t},n.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t},n.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t},n.sub=n.subtract,n.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t},n.mul=n.multiply,n.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t},n.div=n.divide,n.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},n.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},n.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t},n.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t},n.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},n.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},n.scaleAndAdd=function(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t[2]=e[2]+r[2]*i,t[3]=e[3]+r[3]*i,t},n.distance=function(t,e){var r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2],o=e[3]-t[3];return Math.sqrt(r*r+i*i+n*n+o*o)},n.dist=n.distance,n.squaredDistance=function(t,e){var r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2],o=e[3]-t[3];return r*r+i*i+n*n+o*o},n.sqrDist=n.squaredDistance,n.length=function(t){var e=t[0],r=t[1],i=t[2],n=t[3];return Math.sqrt(e*e+r*r+i*i+n*n)},n.len=n.length,n.squaredLength=function(t){var e=t[0],r=t[1],i=t[2],n=t[3];return e*e+r*r+i*i+n*n},n.sqrLen=n.squaredLength,n.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},n.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},n.normalize=function(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],s=r*r+i*i+n*n+o*o;return s>0&&(s=1/Math.sqrt(s),t[0]=r*s,t[1]=i*s,t[2]=n*s,t[3]=o*s),t},n.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},n.lerp=function(t,e,r,i){var n=e[0],o=e[1],s=e[2],a=e[3];return t[0]=n+i*(r[0]-n),t[1]=o+i*(r[1]-o),t[2]=s+i*(r[2]-s),t[3]=a+i*(r[3]-a),t},n.random=function(t,e){return e=e||1,t[0]=i.RANDOM(),t[1]=i.RANDOM(),t[2]=i.RANDOM(),t[3]=i.RANDOM(),n.normalize(t,t),n.scale(t,t,e),t},n.transformMat4=function(t,e,r){var i=e[0],n=e[1],o=e[2],s=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*o+r[12]*s,t[1]=r[1]*i+r[5]*n+r[9]*o+r[13]*s,t[2]=r[2]*i+r[6]*n+r[10]*o+r[14]*s,t[3]=r[3]*i+r[7]*n+r[11]*o+r[15]*s,t},n.transformQuat=function(t,e,r){var i=e[0],n=e[1],o=e[2],s=r[0],a=r[1],h=r[2],u=r[3],l=u*i+a*o-h*n,c=u*n+h*i-s*o,d=u*o+s*n-a*i,p=-s*i-a*n-h*o;return t[0]=l*u+p*-s+c*-h-d*-a,t[1]=c*u+p*-a+d*-s-l*-h,t[2]=d*u+p*-h+l*-a-c*-s,t[3]=e[3],t},n.forEach=function(){var t=n.create();return function(e,r,i,n,o,s){var a,h;for(r||(r=4),i||(i=0),h=n?Math.min(n*r+i,e.length):e.length,a=i;a<h;a+=r)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],t[3]=e[a+3],o(t,t,s),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2],e[a+3]=t[3];return e}}(),n.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},n.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},n.equals=function(t,e){var r=t[0],n=t[1],o=t[2],s=t[3],a=e[0],h=e[1],u=e[2],l=e[3];return Math.abs(r-a)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-h)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(o-u)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))&&Math.abs(s-l)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(l))},e.exports=n},{"./common.js":6}],15:[function(e,r,i){!function(e){var i=/iPhone/i,n=/iPod/i,o=/iPad/i,s=/(?=.*\bAndroid\b)(?=.*\bMobile\b)/i,a=/Android/i,h=/(?=.*\bAndroid\b)(?=.*\bSD4930UR\b)/i,u=/(?=.*\bAndroid\b)(?=.*\b(?:KFOT|KFTT|KFJWI|KFJWA|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|KFARWI|KFASWI|KFSAWI|KFSAWA)\b)/i,l=/Windows Phone/i,c=/(?=.*\bWindows\b)(?=.*\bARM\b)/i,d=/BlackBerry/i,p=/BB10/i,f=/Opera Mini/i,y=/(CriOS|Chrome)(?=.*\bMobile\b)/i,m=/(?=.*\bFirefox\b)(?=.*\bMobile\b)/i,v=new RegExp("(?:Nexus 7|BNTV250|Kindle Fire|Silk|GT-P1000)","i"),x=function(t,e){return t.test(e)},g=function(t){var e=t||navigator.userAgent,r=e.split("[FBAN");if("undefined"!=typeof r[1]&&(e=r[0]),r=e.split("Twitter"),"undefined"!=typeof r[1]&&(e=r[0]),this.apple={phone:x(i,e),ipod:x(n,e),tablet:!x(i,e)&&x(o,e),device:x(i,e)||x(n,e)||x(o,e)},this.amazon={phone:x(h,e),tablet:!x(h,e)&&x(u,e),device:x(h,e)||x(u,e)},this.android={phone:x(h,e)||x(s,e),tablet:!x(h,e)&&!x(s,e)&&(x(u,e)||x(a,e)),device:x(h,e)||x(u,e)||x(s,e)||x(a,e)},this.windows={phone:x(l,e),tablet:x(c,e),device:x(l,e)||x(c,e)},this.other={blackberry:x(d,e),blackberry10:x(p,e),opera:x(f,e),firefox:x(m,e),chrome:x(y,e),device:x(d,e)||x(p,e)||x(f,e)||x(m,e)||x(y,e)},this.seven_inch=x(v,e),this.any=this.apple.device||this.android.device||this.windows.device||this.other.device||this.seven_inch,this.phone=this.apple.phone||this.android.phone||this.windows.phone,this.tablet=this.apple.tablet||this.android.tablet||this.windows.tablet,"undefined"==typeof window)return this},_=function(){var t=new g;return t.Class=g,t};"undefined"!=typeof r&&r.exports&&"undefined"==typeof window?r.exports=g:"undefined"!=typeof r&&r.exports&&"undefined"!=typeof window?r.exports=_():"function"==typeof t&&t.amd?t("isMobile",[],e.isMobile=_()):e.isMobile=_()}(this)},{}],16:[function(t,e,r){"use strict";function i(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function n(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;var i=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==i.join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(o){return!1}}var o=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=n()?Object.assign:function(t,e){for(var r,n,h=i(t),u=1;u<arguments.length;u++){r=Object(arguments[u]);for(var l in r)s.call(r,l)&&(h[l]=r[l]);if(o){n=o(r);for(var c=0;c<n.length;c++)a.call(r,n[c])&&(h[n[c]]=r[n[c]])}}return h}},{}],17:[function(t,e,r){"use strict";e.exports=function(t,e){e=e||{};for(var r={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},i=r.parser[e.strictMode?"strict":"loose"].exec(t),n={},o=14;o--;)n[r.key[o]]=i[o]||"";return n[r.q.name]={},n[r.key[12]].replace(r.q.parser,function(t,e,i){e&&(n[r.q.name][e]=i)}),n}},{}],18:[function(t,e,r){(function(t){function e(t,e){for(var r=0,i=t.length-1;i>=0;i--){var n=t[i];"."===n?t.splice(i,1):".."===n?(t.splice(i,1),r++):r&&(t.splice(i,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function i(t,e){if(t.filter)return t.filter(e);for(var r=[],i=0;i<t.length;i++)e(t[i],i,t)&&r.push(t[i]);return r}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(t){return n.exec(t).slice(1)};r.resolve=function(){for(var r="",n=!1,o=arguments.length-1;o>=-1&&!n;o--){var s=o>=0?arguments[o]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(r=s+"/"+r,n="/"===s.charAt(0))}return r=e(i(r.split("/"),function(t){return!!t}),!n).join("/"),(n?"/":"")+r||"."},r.normalize=function(t){var n=r.isAbsolute(t),o="/"===s(t,-1);return t=e(i(t.split("/"),function(t){return!!t}),!n).join("/"),t||n||(t="."),t&&o&&(t+="/"),(n?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(i(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function i(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;r>=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var n=i(t.split("/")),o=i(e.split("/")),s=Math.min(n.length,o.length),a=s,h=0;h<s;h++)if(n[h]!==o[h]){a=h;break}for(var u=[],h=a;h<n.length;h++)u.push("..");return u=u.concat(o.slice(a)),u.join("/")},r.sep="/",r.delimiter=":",r.dirname=function(t){var e=o(t),r=e[0],i=e[1];return r||i?(i&&(i=i.substr(0,i.length-1)),r+i):"."},r.basename=function(t,e){var r=o(t)[2];return e&&r.substr(-1*e.length)===e&&(r=r.substr(0,r.length-e.length)),r},r.extname=function(t){return o(t)[3]};var s="b"==="ab".substr(-1)?function(t,e,r){return t.substr(e,r)}:function(t,e,r){return e<0&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:36}],19:[function(t,e,r){var i=new ArrayBuffer(0),n=function(t,e,r,n){this.gl=t,this.buffer=t.createBuffer(),this.type=e||t.ARRAY_BUFFER,this.drawType=n||t.STATIC_DRAW,this.data=i,r&&this.upload(r),this._updateID=0};n.prototype.upload=function(t,e,r){r||this.bind();var i=this.gl;t=t||this.data,e=e||0,this.data.byteLength>=t.byteLength?i.bufferSubData(this.type,e,t):i.bufferData(this.type,t,this.drawType),this.data=t},n.prototype.bind=function(){var t=this.gl;t.bindBuffer(this.type,this.buffer)},n.createVertexBuffer=function(t,e,r){return new n(t,t.ARRAY_BUFFER,e,r)},n.createIndexBuffer=function(t,e,r){return new n(t,t.ELEMENT_ARRAY_BUFFER,e,r)},n.create=function(t,e,r,i){return new n(t,e,r,i)},n.prototype.destroy=function(){this.gl.deleteBuffer(this.buffer)},e.exports=n},{}],20:[function(t,e,r){var i=t("./GLTexture"),n=function(t,e,r){this.gl=t,this.framebuffer=t.createFramebuffer(),this.stencil=null,this.texture=null,this.width=e||100,this.height=r||100};n.prototype.enableTexture=function(t){var e=this.gl;this.texture=t||new i(e),this.texture.bind(),this.bind(),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture.texture,0)},n.prototype.enableStencil=function(){if(!this.stencil){var t=this.gl;this.stencil=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,this.stencil),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,this.stencil),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,this.width,this.height)}},n.prototype.clear=function(t,e,r,i){this.bind();var n=this.gl;n.clearColor(t,e,r,i),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT)},n.prototype.bind=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.framebuffer)},n.prototype.unbind=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,null)},n.prototype.resize=function(t,e){var r=this.gl;this.width=t,this.height=e,this.texture&&this.texture.uploadData(null,t,e),this.stencil&&(r.bindRenderbuffer(r.RENDERBUFFER,this.stencil),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e))},n.prototype.destroy=function(){var t=this.gl;this.texture&&this.texture.destroy(),t.deleteFramebuffer(this.framebuffer),this.gl=null,this.stencil=null,this.texture=null},n.createRGBA=function(t,e,r,o){var s=i.fromData(t,null,e,r);s.enableNearestScaling(),s.enableWrapClamp();var a=new n(t,e,r);return a.enableTexture(s),a.unbind(),a},n.createFloat32=function(t,e,r,o){var s=new i.fromData(t,o,e,r);s.enableNearestScaling(),s.enableWrapClamp();var a=new n(t,e,r);return a.enableTexture(s),a.unbind(),a},e.exports=n},{"./GLTexture":22}],21:[function(t,e,r){var i=t("./shader/compileProgram"),n=t("./shader/extractAttributes"),o=t("./shader/extractUniforms"),s=t("./shader/setPrecision"),a=t("./shader/generateUniformAccessObject"),h=function(t,e,r,h,u){this.gl=t,h&&(e=s(e,h),r=s(r,h)),this.program=i(t,e,r,u),this.attributes=n(t,this.program),this.uniformData=o(t,this.program),this.uniforms=a(t,this.uniformData)};h.prototype.bind=function(){this.gl.useProgram(this.program)},h.prototype.destroy=function(){this.attributes=null,this.uniformData=null,this.uniforms=null;var t=this.gl;t.deleteProgram(this.program)},e.exports=h},{"./shader/compileProgram":27,"./shader/extractAttributes":29,"./shader/extractUniforms":30,"./shader/generateUniformAccessObject":31,"./shader/setPrecision":35}],22:[function(t,e,r){var i=function(t,e,r,i,n){this.gl=t,this.texture=t.createTexture(),this.mipmap=!1,this.premultiplyAlpha=!1,this.width=e||-1,this.height=r||-1,this.format=i||t.RGBA,this.type=n||t.UNSIGNED_BYTE};i.prototype.upload=function(t){this.bind();var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha);var r=t.videoWidth||t.width,i=t.videoHeight||t.height;i!==this.height||r!==this.width?e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,this.type,t):e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.format,this.type,t),this.width=r,this.height=i};var n=!1;i.prototype.uploadData=function(t,e,r){this.bind();var i=this.gl;if(t instanceof Float32Array){if(!n){var o=i.getExtension("OES_texture_float");if(!o)throw new Error("floating point textures not available");n=!0}this.type=i.FLOAT}else this.type=this.type||i.UNSIGNED_BYTE;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),e!==this.width||r!==this.height?i.texImage2D(i.TEXTURE_2D,0,this.format,e,r,0,this.format,this.type,t||null):i.texSubImage2D(i.TEXTURE_2D,0,0,0,e,r,this.format,this.type,t||null),this.width=e,this.height=r},i.prototype.bind=function(t){var e=this.gl;void 0!==t&&e.activeTexture(e.TEXTURE0+t),e.bindTexture(e.TEXTURE_2D,this.texture)},i.prototype.unbind=function(){var t=this.gl;t.bindTexture(t.TEXTURE_2D,null)},i.prototype.minFilter=function(t){var e=this.gl;this.bind(),this.mipmap?e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t?e.LINEAR_MIPMAP_LINEAR:e.NEAREST_MIPMAP_NEAREST):e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t?e.LINEAR:e.NEAREST)},i.prototype.magFilter=function(t){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t?e.LINEAR:e.NEAREST)},i.prototype.enableMipmap=function(){var t=this.gl;this.bind(),this.mipmap=!0,t.generateMipmap(t.TEXTURE_2D)},i.prototype.enableLinearScaling=function(){this.minFilter(!0),this.magFilter(!0)},i.prototype.enableNearestScaling=function(){this.minFilter(!1),this.magFilter(!1)},i.prototype.enableWrapClamp=function(){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)},i.prototype.enableWrapRepeat=function(){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT)},i.prototype.enableWrapMirrorRepeat=function(){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.MIRRORED_REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.MIRRORED_REPEAT)},i.prototype.destroy=function(){var t=this.gl;t.deleteTexture(this.texture)},i.fromSource=function(t,e,r){var n=new i(t);return n.premultiplyAlpha=r||!1,n.upload(e),n},i.fromData=function(t,e,r,n){var o=new i(t);return o.uploadData(e,r,n),o},e.exports=i},{}],23:[function(t,e,r){function i(t,e){if(this.nativeVaoExtension=null,i.FORCE_NATIVE||(this.nativeVaoExtension=t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object")),this.nativeState=e,this.nativeVaoExtension){this.nativeVao=this.nativeVaoExtension.createVertexArrayOES();var r=t.getParameter(t.MAX_VERTEX_ATTRIBS);this.nativeState={tempAttribState:new Array(r),attribState:new Array(r)}}this.gl=t,this.attributes=[],this.indexBuffer=null,this.dirty=!1}var n=t("./setVertexAttribArrays");i.prototype.constructor=i,e.exports=i,i.FORCE_NATIVE=!1,i.prototype.bind=function(){return this.nativeVao?(this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao),this.dirty&&(this.dirty=!1,this.activate())):this.activate(),this},i.prototype.unbind=function(){return this.nativeVao&&this.nativeVaoExtension.bindVertexArrayOES(null),this},i.prototype.activate=function(){for(var t=this.gl,e=null,r=0;r<this.attributes.length;r++){var i=this.attributes[r];e!==i.buffer&&(i.buffer.bind(),e=i.buffer),t.vertexAttribPointer(i.attribute.location,i.attribute.size,i.type||t.FLOAT,i.normalized||!1,i.stride||0,i.start||0)}return n(t,this.attributes,this.nativeState),this.indexBuffer&&this.indexBuffer.bind(),this},i.prototype.addAttribute=function(t,e,r,i,n,o){return this.attributes.push({buffer:t,attribute:e,location:e.location,type:r||this.gl.FLOAT,normalized:i||!1,stride:n||0,start:o||0}),this.dirty=!0,this},i.prototype.addIndex=function(t){return this.indexBuffer=t,this.dirty=!0,this},i.prototype.clear=function(){return this.nativeVao&&this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao),this.attributes.length=0,this.indexBuffer=null,this},i.prototype.draw=function(t,e,r){var i=this.gl;return this.indexBuffer?i.drawElements(t,e||this.indexBuffer.data.length,i.UNSIGNED_SHORT,2*(r||0)):i.drawArrays(t,r,e||this.getSize()),this},i.prototype.destroy=function(){this.gl=null,this.indexBuffer=null,this.attributes=null,this.nativeState=null,this.nativeVao&&this.nativeVaoExtension.deleteVertexArrayOES(this.nativeVao),this.nativeVaoExtension=null,this.nativeVao=null},i.prototype.getSize=function(){var t=this.attributes[0];return t.buffer.data.length/(t.stride/4||t.attribute.size)}},{"./setVertexAttribArrays":26}],24:[function(t,e,r){var i=function(t,e){var r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e);if(!r)throw new Error("This browser does not support webGL. Try using the canvas renderer");return r};e.exports=i},{}],25:[function(t,e,r){var i={createContext:t("./createContext"),setVertexAttribArrays:t("./setVertexAttribArrays"),GLBuffer:t("./GLBuffer"),GLFramebuffer:t("./GLFramebuffer"),GLShader:t("./GLShader"),GLTexture:t("./GLTexture"),VertexArrayObject:t("./VertexArrayObject"),shader:t("./shader")};"undefined"!=typeof e&&e.exports&&(e.exports=i),"undefined"!=typeof window&&(window.PIXI=window.PIXI||{},window.PIXI.glCore=i)},{"./GLBuffer":19,"./GLFramebuffer":20,"./GLShader":21,"./GLTexture":22,"./VertexArrayObject":23,"./createContext":24,"./setVertexAttribArrays":26,"./shader":32}],26:[function(t,e,r){var i=function(t,e,r){var i;if(r){var n=r.tempAttribState,o=r.attribState;for(i=0;i<n.length;i++)n[i]=!1;for(i=0;i<e.length;i++)n[e[i].attribute.location]=!0;for(i=0;i<o.length;i++)o[i]!==n[i]&&(o[i]=n[i],r.attribState[i]?t.enableVertexAttribArray(i):t.disableVertexAttribArray(i))}else for(i=0;i<e.length;i++){var s=e[i];t.enableVertexAttribArray(s.attribute.location)}};e.exports=i},{}],27:[function(t,e,r){var i=function(t,e,r,i){var o=n(t,t.VERTEX_SHADER,e),s=n(t,t.FRAGMENT_SHADER,r),a=t.createProgram();if(t.attachShader(a,o),t.attachShader(a,s),i)for(var h in i)t.bindAttribLocation(a,i[h],h);return t.linkProgram(a),t.getProgramParameter(a,t.LINK_STATUS)||(console.error("Pixi.js Error: Could not initialize shader."),console.error("gl.VALIDATE_STATUS",t.getProgramParameter(a,t.VALIDATE_STATUS)),console.error("gl.getError()",t.getError()),""!==t.getProgramInfoLog(a)&&console.warn("Pixi.js Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(a)),t.deleteProgram(a),a=null),t.deleteShader(o),t.deleteShader(s),a},n=function(t,e,r){var i=t.createShader(e);return t.shaderSource(i,r),t.compileShader(i),t.getShaderParameter(i,t.COMPILE_STATUS)?i:(console.log(t.getShaderInfoLog(i)),null)};e.exports=i},{}],28:[function(t,e,r){var i=function(t,e){switch(t){case"float":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"int":case"sampler2D":return 0;case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"bool":return!1;case"bvec2":return n(2*e);case"bvec3":return n(3*e);case"bvec4":return n(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}},n=function(t){for(var e=new Array(t),r=0;r<e.length;r++)e[r]=!1;return e};e.exports=i},{}],29:[function(t,e,r){var i=t("./mapType"),n=t("./mapSize"),o=function(t,e){for(var r={},o=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),a=0;a<o;a++){var h=t.getActiveAttrib(e,a),u=i(t,h.type);r[h.name]={type:u,size:n(u),location:t.getAttribLocation(e,h.name),pointer:s}}return r},s=function(t,e,r,i){gl.vertexAttribPointer(this.location,this.size,t||gl.FLOAT,e||!1,r||0,i||0)};e.exports=o},{"./mapSize":33,"./mapType":34}],30:[function(t,e,r){var i=t("./mapType"),n=t("./defaultValue"),o=function(t,e){for(var r={},o=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),s=0;s<o;s++){var a=t.getActiveUniform(e,s),h=a.name.replace(/\[.*?\]/,""),u=i(t,a.type);r[h]={type:u,size:a.size,location:t.getUniformLocation(e,h),value:n(u,a.size)}}return r};e.exports=o},{"./defaultValue":28,"./mapType":34}],31:[function(t,e,r){var i=function(t,e){var r={data:{}};r.gl=t;for(var i=Object.keys(e),a=0;a<i.length;a++){var h=i[a],u=h.split("."),l=u[u.length-1],c=s(u,r),d=e[h];c.data[l]=d,c.gl=t,Object.defineProperty(c,l,{get:n(l),set:o(l,d)})}return r},n=function(t){var e=a.replace("%%",t);return new Function(e)},o=function(t,e){var r,i=h.replace(/%%/g,t);return r=1===e.size?u[e.type]:l[e.type],r&&(i+="\nthis.gl."+r+";"),new Function("value",i)},s=function(t,e){for(var r=e,i=0;i<t.length-1;i++){var n=r[t[i]]||{data:{}};r[t[i]]=n,r=n}return r},a=["return this.data.%%.value;"].join("\n"),h=["this.data.%%.value = value;","var location = this.data.%%.location;"].join("\n"),u={"float":"uniform1f(location, value)",vec2:"uniform2f(location, value[0], value[1])",vec3:"uniform3f(location, value[0], value[1], value[2])",vec4:"uniform4f(location, value[0], value[1], value[2], value[3])","int":"uniform1i(location, value)",ivec2:"uniform2i(location, value[0], value[1])",ivec3:"uniform3i(location, value[0], value[1], value[2])",ivec4:"uniform4i(location, value[0], value[1], value[2], value[3])",
  bool:"uniform1i(location, value)",bvec2:"uniform2i(location, value[0], value[1])",bvec3:"uniform3i(location, value[0], value[1], value[2])",bvec4:"uniform4i(location, value[0], value[1], value[2], value[3])",mat2:"uniformMatrix2fv(location, false, value)",mat3:"uniformMatrix3fv(location, false, value)",mat4:"uniformMatrix4fv(location, false, value)",sampler2D:"uniform1i(location, value)"},l={"float":"uniform1fv(location, value)",vec2:"uniform2fv(location, value)",vec3:"uniform3fv(location, value)",vec4:"uniform4fv(location, value)","int":"uniform1iv(location, value)",ivec2:"uniform2iv(location, value)",ivec3:"uniform3iv(location, value)",ivec4:"uniform4iv(location, value)",bool:"uniform1iv(location, value)",bvec2:"uniform2iv(location, value)",bvec3:"uniform3iv(location, value)",bvec4:"uniform4iv(location, value)",sampler2D:"uniform1iv(location, value)"};e.exports=i},{}],32:[function(t,e,r){e.exports={compileProgram:t("./compileProgram"),defaultValue:t("./defaultValue"),extractAttributes:t("./extractAttributes"),extractUniforms:t("./extractUniforms"),generateUniformAccessObject:t("./generateUniformAccessObject"),setPrecision:t("./setPrecision"),mapSize:t("./mapSize"),mapType:t("./mapType")}},{"./compileProgram":27,"./defaultValue":28,"./extractAttributes":29,"./extractUniforms":30,"./generateUniformAccessObject":31,"./mapSize":33,"./mapType":34,"./setPrecision":35}],33:[function(t,e,r){var i=function(t){return n[t]},n={"float":1,vec2:2,vec3:3,vec4:4,"int":1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};e.exports=i},{}],34:[function(t,e,r){var i=function(t,e){if(!n){var r=Object.keys(o);n={};for(var i=0;i<r.length;++i){var s=r[i];n[t[s]]=o[s]}}return n[e]},n=null,o={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D"};e.exports=i},{}],35:[function(t,e,r){var i=function(t,e){return"precision"!==t.substring(0,9)?"precision "+e+" float;\n"+t:t};e.exports=i},{}],36:[function(t,e,r){function i(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function o(t){if(c===setTimeout)return setTimeout(t,0);if((c===i||!c)&&setTimeout)return c=setTimeout,setTimeout(t,0);try{return c(t,0)}catch(e){try{return c.call(null,t,0)}catch(e){return c.call(this,t,0)}}}function s(t){if(d===clearTimeout)return clearTimeout(t);if((d===n||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(t);try{return d(t)}catch(e){try{return d.call(null,t)}catch(e){return d.call(this,t)}}}function a(){m&&f&&(m=!1,f.length?y=f.concat(y):v=-1,y.length&&h())}function h(){if(!m){var t=o(a);m=!0;for(var e=y.length;e;){for(f=y,y=[];++v<e;)f&&f[v].run();v=-1,e=y.length}f=null,m=!1,s(t)}}function u(t,e){this.fun=t,this.array=e}function l(){}var c,d,p=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:i}catch(t){c=i}try{d="function"==typeof clearTimeout?clearTimeout:n}catch(t){d=n}}();var f,y=[],m=!1,v=-1;p.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];y.push(new u(t,e)),1!==y.length||m||o(h)},u.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=l,p.addListener=l,p.once=l,p.off=l,p.removeListener=l,p.removeAllListeners=l,p.emit=l,p.prependListener=l,p.prependOnceListener=l,p.listeners=function(t){return[]},p.binding=function(t){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(t){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},{}],37:[function(e,r,i){(function(e){!function(n){function o(t){throw new RangeError(F[t])}function s(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function a(t,e){var r=t.split("@"),i="";r.length>1&&(i=r[0]+"@",t=r[1]),t=t.replace(A,".");var n=t.split("."),o=s(n,e).join(".");return i+o}function h(t){for(var e,r,i=[],n=0,o=t.length;n<o;)e=t.charCodeAt(n++),e>=55296&&e<=56319&&n<o?(r=t.charCodeAt(n++),56320==(64512&r)?i.push(((1023&e)<<10)+(1023&r)+65536):(i.push(e),n--)):i.push(e);return i}function u(t){return s(t,function(t){var e="";return t>65535&&(t-=65536,e+=j(t>>>10&1023|55296),t=56320|1023&t),e+=j(t)}).join("")}function l(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:M}function c(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function d(t,e,r){var i=0;for(t=r?B(t/D):t>>1,t+=B(t/e);t>L*w>>1;i+=M)t=B(t/L);return B(i+(L+1)*t/(t+E))}function p(t){var e,r,i,n,s,a,h,c,p,f,y=[],m=t.length,v=0,x=P,g=C;for(r=t.lastIndexOf(O),r<0&&(r=0),i=0;i<r;++i)t.charCodeAt(i)>=128&&o("not-basic"),y.push(t.charCodeAt(i));for(n=r>0?r+1:0;n<m;){for(s=v,a=1,h=M;n>=m&&o("invalid-input"),c=l(t.charCodeAt(n++)),(c>=M||c>B((T-v)/a))&&o("overflow"),v+=c*a,p=h<=g?S:h>=g+w?w:h-g,!(c<p);h+=M)f=M-p,a>B(T/f)&&o("overflow"),a*=f;e=y.length+1,g=d(v-s,e,0==s),B(v/e)>T-x&&o("overflow"),x+=B(v/e),v%=e,y.splice(v++,0,x)}return u(y)}function f(t){var e,r,i,n,s,a,u,l,p,f,y,m,v,x,g,_=[];for(t=h(t),m=t.length,e=P,r=0,s=C,a=0;a<m;++a)y=t[a],y<128&&_.push(j(y));for(i=n=_.length,n&&_.push(O);i<m;){for(u=T,a=0;a<m;++a)y=t[a],y>=e&&y<u&&(u=y);for(v=i+1,u-e>B((T-r)/v)&&o("overflow"),r+=(u-e)*v,e=u,a=0;a<m;++a)if(y=t[a],y<e&&++r>T&&o("overflow"),y==e){for(l=r,p=M;f=p<=s?S:p>=s+w?w:p-s,!(l<f);p+=M)g=l-f,x=M-f,_.push(j(c(f+g%x,0))),l=B(g/x);_.push(j(c(l,0))),s=d(r,v,i==n),r=0,++i}++r,++e}return _.join("")}function y(t){return a(t,function(t){return R.test(t)?p(t.slice(4).toLowerCase()):t})}function m(t){return a(t,function(t){return I.test(t)?"xn--"+f(t):t})}var v="object"==typeof i&&i&&!i.nodeType&&i,x="object"==typeof r&&r&&!r.nodeType&&r,g="object"==typeof e&&e;g.global!==g&&g.window!==g&&g.self!==g||(n=g);var _,b,T=2147483647,M=36,S=1,w=26,E=38,D=700,C=72,P=128,O="-",R=/^xn--/,I=/[^\x20-\x7E]/,A=/[\x2E\u3002\uFF0E\uFF61]/g,F={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=M-S,B=Math.floor,j=String.fromCharCode;if(_={version:"1.4.1",ucs2:{decode:h,encode:u},decode:p,encode:f,toASCII:m,toUnicode:y},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return _});else if(v&&x)if(r.exports==v)x.exports=_;else for(b in _)_.hasOwnProperty(b)&&(v[b]=_[b]);else n.punycode=_}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],38:[function(t,e,r){"use strict";function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,o){e=e||"&",r=r||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var h=1e3;o&&"number"==typeof o.maxKeys&&(h=o.maxKeys);var u=t.length;h>0&&u>h&&(u=h);for(var l=0;l<u;++l){var c,d,p,f,y=t[l].replace(a,"%20"),m=y.indexOf(r);m>=0?(c=y.substr(0,m),d=y.substr(m+1)):(c=y,d=""),p=decodeURIComponent(c),f=decodeURIComponent(d),i(s,p)?n(s[p])?s[p].push(f):s[p]=[s[p],f]:s[p]=f}return s};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],39:[function(t,e,r){"use strict";function i(t,e){if(t.map)return t.map(e);for(var r=[],i=0;i<t.length;i++)r.push(e(t[i],i));return r}var n=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};e.exports=function(t,e,r,a){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?i(s(t),function(s){var a=encodeURIComponent(n(s))+r;return o(t[s])?i(t[s],function(t){return a+encodeURIComponent(n(t))}).join(e):a+encodeURIComponent(n(t[s]))}).join(e):a?encodeURIComponent(n(a))+r+encodeURIComponent(n(t)):""};var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},s=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},{}],40:[function(t,e,r){"use strict";r.decode=r.parse=t("./decode"),r.encode=r.stringify=t("./encode")},{"./decode":38,"./encode":39}],41:[function(t,e,r){"use strict";function i(){}function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(){this._events=new i,this._eventsCount=0}var s=Object.prototype.hasOwnProperty,a="~";Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(a=!1)),o.prototype.eventNames=function(){var t,e,r=[];if(0===this._eventsCount)return r;for(e in t=this._events)s.call(t,e)&&r.push(a?e.slice(1):e);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t,e){var r=a?a+t:t,i=this._events[r];if(e)return!!i;if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n<o;n++)s[n]=i[n].fn;return s},o.prototype.emit=function(t,e,r,i,n,o){var s=a?a+t:t;if(!this._events[s])return!1;var h,u,l=this._events[s],c=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,n),!0;case 6:return l.fn.call(l.context,e,r,i,n,o),!0}for(u=1,h=new Array(c-1);u<c;u++)h[u-1]=arguments[u];l.fn.apply(l.context,h)}else{var d,p=l.length;for(u=0;u<p;u++)switch(l[u].once&&this.removeListener(t,l[u].fn,void 0,!0),c){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,e);break;case 3:l[u].fn.call(l[u].context,e,r);break;case 4:l[u].fn.call(l[u].context,e,r,i);break;default:if(!h)for(d=1,h=new Array(c-1);d<c;d++)h[d-1]=arguments[d];l[u].fn.apply(l[u].context,h)}}return!0},o.prototype.on=function(t,e,r){var i=new n(e,r||this),o=a?a+t:t;return this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],i]:this._events[o].push(i):(this._events[o]=i,this._eventsCount++),this},o.prototype.once=function(t,e,r){var i=new n(e,r||this,(!0)),o=a?a+t:t;return this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],i]:this._events[o].push(i):(this._events[o]=i,this._eventsCount++),this},o.prototype.removeListener=function(t,e,r,n){var o=a?a+t:t;if(!this._events[o])return this;if(!e)return 0===--this._eventsCount?this._events=new i:delete this._events[o],this;var s=this._events[o];if(s.fn)s.fn!==e||n&&!s.once||r&&s.context!==r||(0===--this._eventsCount?this._events=new i:delete this._events[o]);else{for(var h=0,u=[],l=s.length;h<l;h++)(s[h].fn!==e||n&&!s[h].once||r&&s[h].context!==r)&&u.push(s[h]);u.length?this._events[o]=1===u.length?u[0]:u:0===--this._eventsCount?this._events=new i:delete this._events[o]}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=a?a+t:t,this._events[e]&&(0===--this._eventsCount?this._events=new i:delete this._events[e])):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prototype.setMaxListeners=function(){return this},o.prefixed=a,o.EventEmitter=o,"undefined"!=typeof e&&(e.exports=o)},{}],42:[function(t,e,r){"use strict";function i(t,e){a.call(this),e=e||h,this.baseUrl=t||"",this.progress=0,this.loading=!1,this._progressChunk=0,this._beforeMiddleware=[],this._afterMiddleware=[],this._boundLoadResource=this._loadResource.bind(this),this._buffer=[],this._numToLoad=0,this._queue=o.queue(this._boundLoadResource,e),this.resources={}}var n=t("parse-uri"),o=t("./async"),s=t("./Resource"),a=t("eventemitter3"),h=10,u=100;i.prototype=Object.create(a.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.add=i.prototype.enqueue=function(t,e,r,i){if(Array.isArray(t)){for(var n=0;n<t.length;++n)this.add(t[n]);return this}if("object"==typeof t&&(i=e||t.callback||t.onComplete,r=t,e=t.url,t=t.name||t.key||t.url),"string"!=typeof e&&(i=r,r=e,e=t),"string"!=typeof e)throw new Error("No url passed to add resource to loader.");if("function"==typeof r&&(i=r,r=null),this.resources[t])throw new Error('Resource with name "'+t+'" already exists.');return e=this._prepareUrl(e),this.resources[t]=new s(t,e,r),"function"==typeof i&&this.resources[t].once("afterMiddleware",i),this._numToLoad++,this._queue.started?(this._queue.push(this.resources[t]),this._progressChunk=(u-this.progress)/(this._queue.length()+this._queue.running())):(this._buffer.push(this.resources[t]),this._progressChunk=u/this._buffer.length),this},i.prototype.before=i.prototype.pre=function(t){return this._beforeMiddleware.push(t),this},i.prototype.after=i.prototype.use=function(t){return this._afterMiddleware.push(t),this},i.prototype.reset=function(){this.progress=0,this.loading=!1,this._progressChunk=0,this._buffer.length=0,this._numToLoad=0,this._queue.kill(),this._queue.started=!1;for(var t in this.resources){var e=this.resources[t];e.off("complete",this._onLoad,this),e.isLoading&&e.abort()}return this.resources={},this},i.prototype.load=function(t){if("function"==typeof t&&this.once("complete",t),this._queue.started)return this;this.emit("start",this),this.loading=!0;for(var e=0;e<this._buffer.length;++e)this._queue.push(this._buffer[e]);return this._buffer.length=0,this},i.prototype._prepareUrl=function(t){var e=n(t,{strictMode:!0});return e.protocol||!e.path||0===e.path.indexOf("//")?t:this.baseUrl.length&&this.baseUrl.lastIndexOf("/")!==this.baseUrl.length-1&&"/"!==t.charAt(0)?this.baseUrl+"/"+t:this.baseUrl+t},i.prototype._loadResource=function(t,e){var r=this;t._dequeue=e,o.eachSeries(this._beforeMiddleware,function(e,i){e.call(r,t,function(){i(t.isComplete?{}:null)})},function(){t.isComplete?r._onLoad(t):(t.once("complete",r._onLoad,r),t.load())})},i.prototype._onComplete=function(){this.loading=!1,this.emit("complete",this,this.resources)},i.prototype._onLoad=function(t){var e=this;o.eachSeries(this._afterMiddleware,function(r,i){r.call(e,t,i)},function(){t.emit("afterMiddleware",t),e._numToLoad--,e.progress+=e._progressChunk,e.emit("progress",e,t),t.error?e.emit("error",t.error,e,t):e.emit("load",e,t),0===e._numToLoad&&(e.progress=100,e._onComplete())}),t._dequeue()},i.LOAD_TYPE=s.LOAD_TYPE,i.XHR_RESPONSE_TYPE=s.XHR_RESPONSE_TYPE},{"./Resource":43,"./async":44,eventemitter3:41,"parse-uri":17}],43:[function(t,e,r){"use strict";function i(t,e,r){if(s.call(this),r=r||{},"string"!=typeof t||"string"!=typeof e)throw new Error("Both name and url are required for constructing a resource.");this.name=t,this.url=e,this.isDataUrl=0===this.url.indexOf("data:"),this.data=null,this.crossOrigin=r.crossOrigin===!0?"anonymous":r.crossOrigin,this.loadType=r.loadType||this._determineLoadType(),this.xhrType=r.xhrType,this.metadata=r.metadata||{},this.error=null,this.xhr=null,this.isJson=!1,this.isXml=!1,this.isImage=!1,this.isAudio=!1,this.isVideo=!1,this.isComplete=!1,this.isLoading=!1,this._dequeue=null,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this._boundXdrOnTimeout=this._xdrOnTimeout.bind(this)}function n(t){return t.toString().replace("object ","")}function o(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}var s=t("eventemitter3"),a=t("parse-uri"),h=!(!window.XDomainRequest||"withCredentials"in new XMLHttpRequest),u=null,l=0,c=200,d=204;i.prototype=Object.create(s.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.complete=function(){if(this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError,!1),this.data.removeEventListener("load",this._boundComplete,!1),this.data.removeEventListener("progress",this._boundOnProgress,!1),this.data.removeEventListener("canplaythrough",this._boundComplete,!1)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError,!1),this.xhr.removeEventListener("abort",this._boundXhrOnAbort,!1),this.xhr.removeEventListener("progress",this._boundOnProgress,!1),this.xhr.removeEventListener("load",this._boundXhrOnLoad,!1)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null)),this.isComplete)throw new Error("Complete called again for an already completed resource.");this.isComplete=!0,this.isLoading=!1,this.emit("complete",this)},i.prototype.abort=function(t){if(!this.error){if(this.error=new Error(t),this.xhr)this.xhr.abort();else if(this.xdr)this.xdr.abort();else if(this.data)if("undefined"!=typeof this.data.src)this.data.src="";else for(;this.data.firstChild;)this.data.removeChild(this.data.firstChild);this.complete()}},i.prototype.load=function(t){if(!this.isLoading)if(this.isComplete){if(t){var e=this;setTimeout(function(){t(e)},1)}}else switch(t&&this.once("complete",t),this.isLoading=!0,this.emit("start",this),this.crossOrigin!==!1&&"string"==typeof this.crossOrigin||(this.crossOrigin=this._determineCrossOrigin(this.url)),this.loadType){case i.LOAD_TYPE.IMAGE:this._loadElement("image");break;case i.LOAD_TYPE.AUDIO:this._loadSourceElement("audio");break;case i.LOAD_TYPE.VIDEO:this._loadSourceElement("video");break;case i.LOAD_TYPE.XHR:default:h&&this.crossOrigin?this._loadXdr():this._loadXhr()}},i.prototype._loadElement=function(t){this.metadata.loadElement?this.data=this.metadata.loadElement:"image"===t&&"undefined"!=typeof window.Image?this.data=new Image:this.data=document.createElement(t),this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),this.metadata.skipSource||(this.data.src=this.url);var e="is"+t[0].toUpperCase()+t.substring(1);this[e]===!1&&(this[e]=!0),this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1)},i.prototype._loadSourceElement=function(t){if(this.metadata.loadElement?this.data=this.metadata.loadElement:"audio"===t&&"undefined"!=typeof window.Audio?this.data=new Audio:this.data=document.createElement(t),null===this.data)return void this.abort("Unsupported element "+t);if(!this.metadata.skipSource)if(navigator.isCocoonJS)this.data.src=Array.isArray(this.url)?this.url[0]:this.url;else if(Array.isArray(this.url))for(var e=0;e<this.url.length;++e)this.data.appendChild(this._createSource(t,this.url[e]));else this.data.appendChild(this._createSource(t,this.url));this["is"+t[0].toUpperCase()+t.substring(1)]=!0,this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.data.addEventListener("canplaythrough",this._boundComplete,!1),this.data.load()},i.prototype._loadXhr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var t=this.xhr=new XMLHttpRequest;t.open("GET",this.url,!0),this.xhrType===i.XHR_RESPONSE_TYPE.JSON||this.xhrType===i.XHR_RESPONSE_TYPE.DOCUMENT?t.responseType=i.XHR_RESPONSE_TYPE.TEXT:t.responseType=this.xhrType,t.addEventListener("error",this._boundXhrOnError,!1),t.addEventListener("abort",this._boundXhrOnAbort,!1),t.addEventListener("progress",this._boundOnProgress,!1),t.addEventListener("load",this._boundXhrOnLoad,!1),t.send()},i.prototype._loadXdr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var t=this.xhr=new XDomainRequest;t.timeout=5e3,t.onerror=this._boundXhrOnError,t.ontimeout=this._boundXdrOnTimeout,t.onprogress=this._boundOnProgress,t.onload=this._boundXhrOnLoad,t.open("GET",this.url,!0),setTimeout(function(){t.send()},0)},i.prototype._createSource=function(t,e,r){r||(r=t+"/"+e.substr(e.lastIndexOf(".")+1));var i=document.createElement("source");return i.src=e,i.type=r,i},i.prototype._onError=function(t){this.abort("Failed to load element using "+t.target.nodeName)},i.prototype._onProgress=function(t){t&&t.lengthComputable&&this.emit("progress",this,t.loaded/t.total)},i.prototype._xhrOnError=function(){var t=this.xhr;this.abort(n(t)+" Request failed. Status: "+t.status+', text: "'+t.statusText+'"')},i.prototype._xhrOnAbort=function(){this.abort(n(this.xhr)+" Request was aborted by the user.")},i.prototype._xdrOnTimeout=function(){this.abort(n(this.xhr)+" Request timed out.")},i.prototype._xhrOnLoad=function(){var t=this.xhr,e="undefined"==typeof t.status?t.status:c;if(!(e===c||e===d||e===l&&t.responseText.length>0))return void this.abort("["+t.status+"]"+t.statusText+":"+t.responseURL);if(this.xhrType===i.XHR_RESPONSE_TYPE.TEXT)this.data=t.responseText;else if(this.xhrType===i.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(t.responseText),this.isJson=!0}catch(r){return void this.abort("Error trying to parse loaded json:",r)}else if(this.xhrType===i.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(t.responseText,"text/xml")}else{var o=document.createElement("div");o.innerHTML=t.responseText,this.data=o}this.isXml=!0}catch(r){return void this.abort("Error trying to parse loaded xml:",r)}else this.data=t.response||t.responseText;this.complete()},i.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";e=e||window.location,u||(u=document.createElement("a")),u.href=t,t=a(u.href,{strictMode:!0});var r=!t.port&&""===e.port||t.port===e.port,i=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&i===e.protocol?"":"anonymous"},i.prototype._determineXhrType=function(){return i._xhrTypeMap[this._getExtension()]||i.XHR_RESPONSE_TYPE.TEXT},i.prototype._determineLoadType=function(){return i._loadTypeMap[this._getExtension()]||i.LOAD_TYPE.XHR},i.prototype._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?");i!==-1&&(t=t.substring(0,i)),e=t.substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},i.prototype._getMimeFromXhrType=function(t){switch(t){case i.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case i.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case i.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case i.XHR_RESPONSE_TYPE.JSON:return"application/json";case i.XHR_RESPONSE_TYPE.DEFAULT:case i.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},i.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},i.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},i._loadTypeMap={gif:i.LOAD_TYPE.IMAGE,png:i.LOAD_TYPE.IMAGE,bmp:i.LOAD_TYPE.IMAGE,jpg:i.LOAD_TYPE.IMAGE,jpeg:i.LOAD_TYPE.IMAGE,tif:i.LOAD_TYPE.IMAGE,tiff:i.LOAD_TYPE.IMAGE,webp:i.LOAD_TYPE.IMAGE,tga:i.LOAD_TYPE.IMAGE,"svg+xml":i.LOAD_TYPE.IMAGE},i._xhrTypeMap={xhtml:i.XHR_RESPONSE_TYPE.DOCUMENT,html:i.XHR_RESPONSE_TYPE.DOCUMENT,htm:i.XHR_RESPONSE_TYPE.DOCUMENT,xml:i.XHR_RESPONSE_TYPE.DOCUMENT,tmx:i.XHR_RESPONSE_TYPE.DOCUMENT,tsx:i.XHR_RESPONSE_TYPE.DOCUMENT,svg:i.XHR_RESPONSE_TYPE.DOCUMENT,gif:i.XHR_RESPONSE_TYPE.BLOB,png:i.XHR_RESPONSE_TYPE.BLOB,bmp:i.XHR_RESPONSE_TYPE.BLOB,jpg:i.XHR_RESPONSE_TYPE.BLOB,jpeg:i.XHR_RESPONSE_TYPE.BLOB,tif:i.XHR_RESPONSE_TYPE.BLOB,tiff:i.XHR_RESPONSE_TYPE.BLOB,webp:i.XHR_RESPONSE_TYPE.BLOB,tga:i.XHR_RESPONSE_TYPE.BLOB,json:i.XHR_RESPONSE_TYPE.JSON,text:i.XHR_RESPONSE_TYPE.TEXT,txt:i.XHR_RESPONSE_TYPE.TEXT},i.setExtensionLoadType=function(t,e){o(i._loadTypeMap,t,e)},i.setExtensionXhrType=function(t,e){o(i._xhrTypeMap,t,e)}},{eventemitter3:41,"parse-uri":17}],44:[function(t,e,r){"use strict";function i(){}function n(t,e,r){var i=0,n=t.length;!function o(s){return s||i===n?void(r&&r(s)):void e(t[i++],o)}()}function o(t){return function(){if(null===t)throw new Error("Callback was already called.");var e=t;t=null,e.apply(this,arguments)}}function s(t,e){function r(t,e,r){if(null!=r&&"function"!=typeof r)throw new Error("task callback must be a function");if(a.started=!0,null==t&&a.idle())return void setTimeout(function(){a.drain()},1);var n={data:t,callback:"function"==typeof r?r:i};e?a._tasks.unshift(n):a._tasks.push(n),setTimeout(function(){a.process()},1)}function n(t){return function(){s-=1,t.callback.apply(t,arguments),null!=arguments[0]&&a.error(arguments[0],t.data),s<=a.concurrency-a.buffer&&a.unsaturated(),a.idle()&&a.drain(),a.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var s=0,a={_tasks:[],concurrency:e,saturated:i,unsaturated:i,buffer:e/4,empty:i,drain:i,error:i,started:!1,paused:!1,push:function(t,e){r(t,!1,e)},kill:function(){a.drain=i,a._tasks=[]},unshift:function(t,e){r(t,!0,e)},process:function(){for(;!a.paused&&s<a.concurrency&&a._tasks.length;){var e=a._tasks.shift();0===a._tasks.length&&a.empty(),s+=1,s===a.concurrency&&a.saturated(),t(e.data,o(n(e)))}},length:function(){return a._tasks.length},running:function(){return s},idle:function(){return a._tasks.length+s===0},pause:function(){a.paused!==!0&&(a.paused=!0)},resume:function(){if(a.paused!==!1){a.paused=!1;for(var t=1;t<=a.concurrency;t++)a.process()}}};return a}e.exports={eachSeries:n,queue:s}},{}],45:[function(t,e,r){"use strict";e.exports={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encodeBinary:function(t){for(var e,r="",i=new Array(4),n=0,o=0,s=0;n<t.length;){for(e=new Array(3),o=0;o<e.length;o++)n<t.length?e[o]=255&t.charCodeAt(n++):e[o]=0;switch(i[0]=e[0]>>2,i[1]=(3&e[0])<<4|e[1]>>4,i[2]=(15&e[1])<<2|e[2]>>6,i[3]=63&e[2],s=n-(t.length-1)){case 2:i[3]=64,i[2]=64;break;case 1:i[3]=64}for(o=0;o<i.length;o++)r+=this._keyStr.charAt(i[o])}return r}}},{}],46:[function(t,e,r){"use strict";e.exports=t("./Loader"),e.exports.Resource=t("./Resource"),e.exports.middleware={caching:{memory:t("./middlewares/caching/memory")},parsing:{blob:t("./middlewares/parsing/blob")}},e.exports.async=t("./async")},{"./Loader":42,"./Resource":43,"./async":44,"./middlewares/caching/memory":47,"./middlewares/parsing/blob":48}],47:[function(t,e,r){"use strict";var i={};e.exports=function(){return function(t,e){i[t.url]?(t.data=i[t.url],t.complete()):t.once("complete",function(){i[this.url]=this.data}),e()}}},{}],48:[function(t,e,r){"use strict";var i=t("../../Resource"),n=t("../../b64"),o=window.URL||window.webkitURL;e.exports=function(){return function(t,e){if(!t.data)return void e();if(t.xhr&&t.xhrType===i.XHR_RESPONSE_TYPE.BLOB)if(window.Blob&&"string"!=typeof t.data){if(0===t.data.type.indexOf("image")){var r=o.createObjectURL(t.data);return t.blob=t.data,t.data=new Image,t.data.src=r,t.isImage=!0,void(t.data.onload=function(){o.revokeObjectURL(r),t.data.onload=null,e()})}}else{var s=t.xhr.getResponseHeader("content-type");if(s&&0===s.indexOf("image"))return t.data=new Image,t.data.src="data:"+s+";base64,"+n.encodeBinary(t.xhr.responseText),t.isImage=!0,void(t.data.onload=function(){t.data.onload=null,e()})}e()}}},{"../../Resource":43,"../../b64":45}],49:[function(t,e,r){function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function n(t,e,r){if(t&&u(t)&&t instanceof i)return t;var n=new i;return n.parse(t,e,r),n}function o(t){return h(t)&&(t=n(t)),t instanceof i?t.format():i.prototype.format.call(t)}function s(t,e){return n(t,!1,!0).resolve(e)}function a(t,e){return t?n(t,!1,!0).resolveObject(e):e}function h(t){return"string"==typeof t}function u(t){return"object"==typeof t&&null!==t}function l(t){return null===t}function c(t){return null==t}var d=t("punycode");r.parse=n,r.resolve=s,r.resolveObject=a,r.format=o,r.Url=i;var p=/^([a-z0-9.+-]+:)/i,f=/:[0-9]*$/,y=["<",">",'"',"`"," ","\r","\n","\t"],m=["{","}","|","\\","^","`"].concat(y),v=["'"].concat(m),x=["%","/","?",";","#"].concat(v),g=["/","?","#"],_=255,b=/^[a-z0-9A-Z_-]{0,63}$/,T=/^([a-z0-9A-Z_-]{0,63})(.*)$/,M={javascript:!0,"javascript:":!0},S={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},E=t("querystring");i.prototype.parse=function(t,e,r){if(!h(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t;i=i.trim();var n=p.exec(i);if(n){n=n[0];var o=n.toLowerCase();this.protocol=o,i=i.substr(n.length)}if(r||n||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var s="//"===i.substr(0,2);!s||n&&S[n]||(i=i.substr(2),this.slashes=!0)}if(!S[n]&&(s||n&&!w[n])){for(var a=-1,u=0;u<g.length;u++){var l=i.indexOf(g[u]);l!==-1&&(a===-1||l<a)&&(a=l)}var c,f;f=a===-1?i.lastIndexOf("@"):i.lastIndexOf("@",a),f!==-1&&(c=i.slice(0,f),i=i.slice(f+1),this.auth=decodeURIComponent(c)),a=-1;for(var u=0;u<x.length;u++){var l=i.indexOf(x[u]);l!==-1&&(a===-1||l<a)&&(a=l)}a===-1&&(a=i.length),this.host=i.slice(0,a),i=i.slice(a),this.parseHost(),this.hostname=this.hostname||"";var y="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!y)for(var m=this.hostname.split(/\./),u=0,D=m.length;u<D;u++){var C=m[u];if(C&&!C.match(b)){for(var P="",O=0,R=C.length;O<R;O++)P+=C.charCodeAt(O)>127?"x":C[O];if(!P.match(b)){var I=m.slice(0,u),A=m.slice(u+1),F=C.match(T);F&&(I.push(F[1]),A.unshift(F[2])),A.length&&(i="/"+A.join(".")+i),this.hostname=I.join(".");break}}}if(this.hostname.length>_?this.hostname="":this.hostname=this.hostname.toLowerCase(),!y){for(var L=this.hostname.split("."),B=[],u=0;u<L.length;++u){var j=L[u];B.push(j.match(/[^A-Za-z0-9_-]/)?"xn--"+d.encode(j):j)}this.hostname=B.join(".")}var N=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+N,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==i[0]&&(i="/"+i))}if(!M[o])for(var u=0,D=v.length;u<D;u++){var k=v[u],z=encodeURIComponent(k);z===k&&(z=escape(k)),i=i.split(k).join(z)}var G=i.indexOf("#");G!==-1&&(this.hash=i.substr(G),i=i.slice(0,G));var V=i.indexOf("?");if(V!==-1?(this.search=i.substr(V),this.query=i.substr(V+1),e&&(this.query=E.parse(this.query)),i=i.slice(0,V)):e&&(this.search="",this.query={}),i&&(this.pathname=i),w[o]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var N=this.pathname||"",j=this.search||"";this.path=N+j}return this.href=this.format(),this},i.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,o="";this.host?n=t+this.host:this.hostname&&(n=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&u(this.query)&&Object.keys(this.query).length&&(o=E.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||w[e])&&n!==!1?(n="//"+(n||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):n||(n=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),r=r.replace(/[?#]/g,function(t){return encodeURIComponent(t)}),s=s.replace("#","%23"),e+n+r+s+i},i.prototype.resolve=function(t){return this.resolveObject(n(t,!1,!0)).format()},i.prototype.resolveObject=function(t){if(h(t)){var e=new i;e.parse(t,!1,!0),t=e}var r=new i;if(Object.keys(this).forEach(function(t){r[t]=this[t]},this),r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol)return Object.keys(t).forEach(function(e){"protocol"!==e&&(r[e]=t[e])}),w[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r;if(t.protocol&&t.protocol!==r.protocol){if(!w[t.protocol])return Object.keys(t).forEach(function(e){r[e]=t[e]}),r.href=r.format(),r;if(r.protocol=t.protocol,t.host||S[t.protocol])r.pathname=t.pathname;else{for(var n=(t.pathname||"").split("/");n.length&&!(t.host=n.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==n[0]&&n.unshift(""),n.length<2&&n.unshift(""),r.pathname=n.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var o=r.pathname||"",s=r.search||"";
  r.path=o+s}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var a=r.pathname&&"/"===r.pathname.charAt(0),u=t.host||t.pathname&&"/"===t.pathname.charAt(0),d=u||a||r.host&&t.pathname,p=d,f=r.pathname&&r.pathname.split("/")||[],n=t.pathname&&t.pathname.split("/")||[],y=r.protocol&&!w[r.protocol];if(y&&(r.hostname="",r.port=null,r.host&&(""===f[0]?f[0]=r.host:f.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===n[0]?n[0]=t.host:n.unshift(t.host)),t.host=null),d=d&&(""===n[0]||""===f[0])),u)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,f=n;else if(n.length)f||(f=[]),f.pop(),f=f.concat(n),r.search=t.search,r.query=t.query;else if(!c(t.search)){if(y){r.hostname=r.host=f.shift();var m=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");m&&(r.auth=m.shift(),r.host=r.hostname=m.shift())}return r.search=t.search,r.query=t.query,l(r.pathname)&&l(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!f.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var v=f.slice(-1)[0],x=(r.host||t.host)&&("."===v||".."===v)||""===v,g=0,_=f.length;_>=0;_--)v=f[_],"."==v?f.splice(_,1):".."===v?(f.splice(_,1),g++):g&&(f.splice(_,1),g--);if(!d&&!p)for(;g--;g)f.unshift("..");!d||""===f[0]||f[0]&&"/"===f[0].charAt(0)||f.unshift(""),x&&"/"!==f.join("/").substr(-1)&&f.push("");var b=""===f[0]||f[0]&&"/"===f[0].charAt(0);if(y){r.hostname=r.host=b?"":f.length?f.shift():"";var m=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");m&&(r.auth=m.shift(),r.host=r.hostname=m.shift())}return d=d||r.host&&f.length,d&&!b&&f.unshift(""),f.length?r.pathname=f.join("/"):(r.pathname=null,r.path=null),l(r.pathname)&&l(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var t=this.host,e=f.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{punycode:37,querystring:40}],50:[function(t,e,r){function i(t){(o.tablet||o.phone)&&this.createTouchHook();var e=document.createElement("div");e.style.width="100px",e.style.height="100px",e.style.position="absolute",e.style.top=0,e.style.left=0,e.style.zIndex=2,this.div=e,this.pool=[],this.renderId=0,this.debug=!1,this.renderer=t,this.children=[],this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this.isActive=!1,this.isMobileAccessabillity=!1,window.addEventListener("keydown",this._onKeyDown,!1)}var n=t("../core"),o=t("ismobilejs");Object.assign(n.DisplayObject.prototype,t("./accessibleTarget")),i.prototype.constructor=i,e.exports=i,i.prototype.createTouchHook=function(){var t=document.createElement("button");t.style.width="1px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.left="-1000px",t.style.zIndex=2,t.style.backgroundColor="#FF0000",t.title="HOOK DIV",t.addEventListener("focus",function(){this.isMobileAccessabillity=!0,this.activate(),document.body.removeChild(t)}.bind(this)),document.body.appendChild(t)},i.prototype.activate=function(){this.isActive||(this.isActive=!0,window.document.addEventListener("mousemove",this._onMouseMove,!0),window.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),this.renderer.view.parentNode.appendChild(this.div))},i.prototype.deactivate=function(){this.isActive&&!this.isMobileAccessabillity&&(this.isActive=!1,window.document.removeEventListener("mousemove",this._onMouseMove),window.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),this.div.parentNode.removeChild(this.div))},i.prototype.updateAccessibleObjects=function(t){if(t.visible){t.accessible&&t.interactive&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);for(var e=t.children,r=e.length-1;r>=0;r--)this.updateAccessibleObjects(e[r])}},i.prototype.update=function(){if(this.renderer.renderingToScreen){this.updateAccessibleObjects(this.renderer._lastObjectRendered);var t=this.renderer.view.getBoundingClientRect(),e=t.width/this.renderer.width,r=t.height/this.renderer.height,i=this.div;i.style.left=t.left+"px",i.style.top=t.top+"px",i.style.width=this.renderer.width+"px",i.style.height=this.renderer.height+"px";for(var o=0;o<this.children.length;o++){var s=this.children[o];if(s.renderId!==this.renderId)s._accessibleActive=!1,n.utils.removeItems(this.children,o,1),this.div.removeChild(s._accessibleDiv),this.pool.push(s._accessibleDiv),s._accessibleDiv=null,o--,0===this.children.length&&this.deactivate();else{i=s._accessibleDiv;var a=s.hitArea,h=s.projectionMatrix2d;s.hitArea?(i.style.left=(h.tx+a.x*h.a)*e+"px",i.style.top=(h.ty+a.y*h.d)*r+"px",i.style.width=a.width*h.a*e+"px",i.style.height=a.height*h.d*r+"px"):(a=s.getBounds(),this.capHitArea(a),i.style.left=a.x*e+"px",i.style.top=a.y*r+"px",i.style.width=a.width*e+"px",i.style.height=a.height*r+"px")}}this.renderId++}},i.prototype.capHitArea=function(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0),t.x+t.width>this.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},i.prototype.addChild=function(t){var e=this.pool.pop();e||(e=document.createElement("button"),e.style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleTitle||t.accessibleHint||(e.title="displayObject "+this.tabIndex),t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},i.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},i.prototype._onFocus=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},i.prototype._onFocusOut=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},i.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},i.prototype._onMouseMove=function(){this.deactivate()},i.prototype.destroy=function(){this.div=null;for(var t=0;t<this.children.length;t++)this.children[t].div=null;window.document.removeEventListener("mousemove",this._onMouseMove),window.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},n.WebGLRenderer.registerPlugin("accessibility",i),n.CanvasRenderer.registerPlugin("accessibility",i)},{"../core":99,"./accessibleTarget":51,ismobilejs:15}],51:[function(t,e,r){var i={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:!1};e.exports=i},{}],52:[function(t,e,r){e.exports={accessibleTarget:t("./accessibleTarget"),AccessibilityManager:t("./AccessibilityManager")}},{"./AccessibilityManager":50,"./accessibleTarget":51}],53:[function(t,e,r){function i(t){if(t instanceof Array){if("precision"!==t[0].substring(0,9)){var e=t.slice(0);return e.unshift("precision "+o.PRECISION.DEFAULT+" float;"),e}}else if("precision"!==t.substring(0,9))return"precision "+o.PRECISION.DEFAULT+" float;\n"+t;return t}var n=t("pixi-gl-core").GLShader,o=t("./const"),s=function(t,e,r){n.call(this,t,i(e),i(r))};s.prototype=Object.create(n.prototype),s.prototype.constructor=s,e.exports=s,s.prototype.setUniformMatrix=function(t,e){9===this.uniforms[t].length?e.length||(this.uniforms[t]=e.toArray(!0)):e.length?this.uniforms[t]=e:this.uniforms[t]=e.toMat4()}},{"./const":79,"pixi-gl-core":25}],54:[function(t,e,r){function i(){n.call(this),this._transformUid=-1,this._transformVersion=-1,this._geometryUid=-1,this._geometryVersion=-1}var n=t("./Geometry2d");i.prototype=Object.create(n.prototype),i.prototype.constructor=n,e.exports=i,i.prototype.applyTransformStatic=function(t,e){return(this._transformUid!==e.uid||this._transformVersion!==e.version||this._geometryUid!==t.uid||this._geometryVersion!==t.version)&&(this._transformUid=e.uid,this._transformVersion=e.version,this._geometryUid=t.uid,this._geometryVersion=t.version,this.applyTransform(t,e),!0)},i.prototype.applyTransform=function(t,e){this.stride=t.stride,this.vertices&&this.size===t.size||(this.size=t.size),this.applyMatrix(t,e.matrix2d)},i.prototype.applyMatrix=function(t,e){for(var r=e.a,i=e.b,n=e.c,o=e.d,s=e.tx,a=e.ty,h=this.vertices,u=t.stride,l=t.vertices,c=0,d=0,p=l.length;c<p;c+=2,d+=u){var f=l[d],y=l[d+1];h[c]=r*f+n*y+s,h[c+1]=o*y+i*f+a}this.version++}},{"./Geometry2d":58}],55:[function(t,e,r){function i(){this.matrix2d=new n.Matrix,this.version=0,this.uid=o.incTransform(),this.is3d=!1,this.updated=!1,this._dirtyLocalUid=-1,this._dirtyLocalVersion=-1,this._dirtyParentUid=-1,this._dirtyParentVersion=-1,this.computedRaycast=null,this._dirtyRaycastUid=-1,this._dirtyRaycastVersion=-1,this._dirtyRaycastMyVersion=-1}var n=t("../math"),o=t("../utils"),s=t("./ComputedGeometry2d"),a=t("./Raycast2d");i.prototype.constructor=i,i.prototype.getIdentityMatrix=function(){return n.Matrix.IDENTITY},i.prototype.getIdentityTransform=function(){return i.IDENTITY},i.IDENTITY=new i,i.prototype.updateTransform=function(t,e){if(this._dirtyLocalUid===e.uid&&this._dirtyLocalVersion===e.version&&this._dirtyParentUid===t.uid&&this._dirtyParentVersion===t.version)return this.updated=!1,!1;this._dirtyLocalUid=e.uid,this._dirtyLocalVersion=e.version,this._dirtyParentUid=t.uid,this._dirtyParentVersion=t.version;var r=this.matrix2d,i=e.matrix2d,n=t.matrix2d;return r.a=i.a*n.a+i.b*n.c,r.b=i.a*n.b+i.b*n.d,r.c=i.c*n.a+i.d*n.c,r.d=i.c*n.b+i.d*n.d,r.tx=i.tx*n.a+i.ty*n.c+n.tx,r.ty=i.tx*n.b+i.ty*n.d+n.ty,this.updated=!0,this.version++,!0},i.prototype.to2d=function(t){return this.matrix2d.copy(t)},i.prototype.updateSingleChild=function(t){return t||(t=new i),t.updateSingle(this),t},i.prototype.updateSingle=function(t){return this._dirtyLocalUid===t.uid&&this._dirtyLocalVersion===t.version&&this._dirtyParentUid===t.uid&&this._dirtyParentVersion===t.version?(this.updated=!1,!1):(this._dirtyLocalUid=t.uid,this._dirtyLocalVersion=t.version,this._dirtyParentUid=t.uid,this._dirtyParentVersion=t.version,t.matrix2d.copy(this.matrix2d),this.updated=!0,this.version++,!0)},i.prototype.updateRaycast=function(t){return this._dirtyRaycastMyVersion===this.version&&this._dirtyRaycastUid===t.uid&&this._dirtyRaycastVersion===t.version?(this.updated=!1,!1):(this.computedRaycast=this.updateChildRaycast(this.computedRaycast,t),this.computedRaycast)},i.prototype.updateChildTransform=function(t,e){return t=t||new i,t.updateTransform(this,e),t},i.prototype.updateChildReverseTransform=function(t,e){return t=t||new i,t.updateTransform(e,this),t},i.prototype.checkChildReverseTransform=function(t,e){return!t||(t._dirtyLocalUid!==this.uid||t._dirtyLocalVersion!==this.version||t._dirtyParentUid!==e.uid||t._dirtyParentVersion!==e.version)},i.prototype.updateChildGeometry=function(t,e){return e&&e.valid?(t=t||new s,t.applyTransformStatic(e,this),t):null},i.prototype.updateChildRaycast=function(t,e){return e&&e.valid?(t=t||new a,t.applyTransformStatic(e,this),t):null},Object.defineProperties(i.prototype,{matrix:{get:function(){return this.matrix2d}}}),e.exports=i},{"../math":103,"../utils":154,"./ComputedGeometry2d":54,"./Raycast2d":62}],56:[function(t,e,r){function i(){this._point=new n,this.uid=o.incRaycast(),this.is3d=!1,this.version=0,this.valid=!0}var n=t("../math/Point"),o=t("../utils"),s=t("./Raycast2d");Object.defineProperties(i.prototype,{x:{get:function(){return this._point.x},set:function(t){this._point.x!==t&&(this.version++,this._point.x=t)}},y:{get:function(){return this._point.y},set:function(t){this._point.y!==t&&(this.version++,this._point.y=t)}}}),i.prototype.constructor=i,e.exports=i,i.prototype.set=function(t,e){this.x=t,this.y=e},i.prototype.copy=function(t){this.x=t.x,this.y=t.y},i.prototype.childApplyTransform=function(t,e){t=t||new s,e.updateRayCast(t,this)}},{"../math/Point":102,"../utils":154,"./Raycast2d":62}],57:[function(t,e,r){function i(){this.vertices=null,this.indices=null,this.stride=2,this.is3d=!1,this.uid=o.incGeometry(),this.version=0,this._bounds=new n.Rectangle,this._dirtyBounds=-1,this.currentBounds=null}var n=t("../math"),o=t("../utils");i.prototype.getBounds=function(){if(null===this.vertices)return n.Rectangle.EMPTY;if(this._dirtyBounds!==this.version){this._dirtyBounds=this.version;for(var t=this.vertices,e=t[0],r=t[0],i=t[1],o=t[1],s=this.stride,a=t.length;s<a;s+=this.stride)e>t[s]&&(e=t[s]),r<t[s]&&(r=t[s]),i>t[s+1]&&(i=t[s+1]),o<t[s+1]&&(o=t[s+1]);var h=this._bounds;h.x=e,h.y=i,h.width=r-e,h.height=o-i,this.currentBounds=h}return this.currentBounds},Object.defineProperties(i.prototype,{size:{get:function(){return this.vertices?this.vertices.length/this.stride|0:0},set:function(t){t>0?this.vertices=new Float32Array(t*this.stride):this.vertices=null}},valid:{get:function(){return null!==this.vertices}}}),e.exports=i},{"../math":103,"../utils":154}],58:[function(t,e,r){function i(){n.call(this)}var n=t("./Geometry"),o=t("../math");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.setRectCoords=function(t,e,r,i,n){var o=this.vertices;return o[t++]=e,o[t++]=r,o[t++]=i,o[t++]=r,o[t++]=i,o[t++]=n,o[t++]=e,o[t++]=n,this.version++,t},i.fromBuffers=function(t,e){var r=new i;return r.vertices=t||null,r.indices=e||null,r};var s=new o.Polygon;i.prototype.containsPoint=function(t,e){var r,i,n=this.vertices,o=s.points,a=this.stride;if(e){var h=this.indices;for(i=this.indices.length,r=0;r<i;r+=3){var u=h[r]*a,l=h[r+1]*a,c=h[r+2]*a;if(o[0]=n[u],o[1]=n[u+1],o[2]=n[l],o[3]=n[l+1],o[4]=n[c],o[5]=n[c+1],s.contains(t.x,t.y))return!0}}else for(i=n.length,r=0;r<i;)if(o[0]=n[r],o[1]=n[r+1],r+=a,o[2]=n[r],o[3]=n[r+1],r+=a,o[4]=n[r],o[5]=n[r+1],r+=a,s.contains(t.x,t.y))return!0;return!1}},{"../math":103,"./Geometry":57}],59:[function(t,e,r){function i(t){this.local=t||new n,this.computed=null,this.projected=null,this.valid=!0}var n=t("./Geometry2d");i.prototype.getComputedBounds=function(t){return this.computed=t.updateChildGeometry(this.computed,this.local),this.computed.getBounds()},i.prototype.getBounds=function(t,e){return this.computed=t.updateChildGeometry(this.computed,this.local),e?(this.projected=e.updateChildGeometry(this.projected,this.computed),this.projected.getBounds()):this.computed.getBounds()},e.exports=i},{"./Geometry2d":58}],60:[function(t,e,r){function i(){this.original=null,this.projected=null,this.value=!1}var n=t("./GeometrySet");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,Object.defineProperties(i.prototype,{local:function(){return this.original.local},computed:function(){return this.original.computed}}),i.prototype.wrap=function(t){return this.original=t,this.valid=!!t,this},e.exports=i},{"./GeometrySet":59}],61:[function(t,e,r){function i(t){n.call(this,t)}var n=t("./Transform2d");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,i.prototype.straightUpdate=n.prototype.update,i.prototype.update=function(){if(this.straightUpdate()){var t=this.matrix2d;return t.invert(),!0}return!1},e.exports=i},{"./Transform2d":63}],62:[function(t,e,r){function i(){this._raycastUid=-1,this._raycastVersion=-1,this._transformUid=-1,this._transformVersion=-1,this._point=new n,this.is3d=!1,this.valid=!1,this.intersects=!1,this.version=0,this.uid=o.incRaycast()}var n=t("../math/Point"),o=t("../utils");Object.defineProperties(i.prototype,{x:{get:function(){return this._point.x}},y:{get:function(){return this._point.y}}}),i.prototype.constructor=i,e.exports=i,i.prototype.applyTransformStatic=function(t,e){return(!this._raycastUid||this._transformUid!==e.uid||this._transformVersion!==e.version||this._raycastUid!==t.uid||this._raycastVersion!==t.version)&&(this._transformUid=e.uid,this._transformVersion=e.version,this._raycastUid=t.uid,this._raycastVersion=t.version,this.version++,this.applyTransform(t,e),!0)},i.prototype.childApplyTransform=function(t,e){return this.valid?(t=t||new i,e.updateRaycast(t,this)):t?(t.valid=!1,t.intersects=!1,t):null},i.prototype.applyTransform=function(t,e){this.valid=!0,this.intersects=!1,e.matrix.applyInverse(t._point,this._point)}},{"../math/Point":102,"../utils":154}],63:[function(t,e,r){function i(t){this.matrix2d=new n.Matrix,this.isStatic=!!t,this.position=t?new o(this.makeDirty,this,0,0):new n.Point(0,0),this.scale=t?new o(this.makeDirty,this,1,1):new n.Point(1,1),this.skew=new o(this.updateSkew,this,0,0),this.pivot=t?new o(this.makeDirty,this,0,0):new n.Point(0,0),this._rotation=0,this._sr=Math.sin(0),this._cr=Math.cos(0),this._cy=Math.cos(0),this._sy=Math.sin(0),this._nsx=Math.sin(0),this._cx=Math.cos(0),this._dirtyVersion=0,this.version=0,this.is3d=!1,this.operType=0,this.uid=a.incTransform()}var n=t("../math"),o=t("../display/ObservablePoint"),s=t("./ComputedTransform2d"),a=t("../utils");i.prototype.constructor=i,i.prototype.updateSkew=function(){this._cy=Math.cos(this.skew.y),this._sy=Math.sin(this.skew.y),this._nsx=Math.sin(this.skew.x),this._cx=Math.cos(this.skew.x),this._dirtyVersion++},i.prototype.makeDirty=function(){this._dirtyVersion++},i.prototype.update=function(){if(this.isStatic&&this.version===this._dirtyVersion)return!1;var t,e,r,i,n=this.matrix2d;return t=this._cr*this.scale.x,e=this._sr*this.scale.x,r=-this._sr*this.scale.y,i=this._cr*this.scale.y,n.a=this._cy*t+this._sy*r,n.b=this._cy*e+this._sy*i,n.c=this._nsx*t+this._cx*r,n.d=this._nsx*e+this._cx*i,n.tx=this.position.x-(this.pivot.x*n.a+this.pivot.y*n.c),n.ty=this.position.y-(this.pivot.x*n.b+this.pivot.y*n.d),1===n.a&&0===n.b&&0===n.c&&1===n.d?0===n.tx&&0===n.ty?this.operType=2:this.operType=1:this.operType=0,this.version=++this._dirtyVersion,!0},i.prototype.setFromMatrix=function(t){t.decompose(this),this.updateSkew()},i.prototype.updateSingleChild=s.prototype.updateSingleChild,i.prototype.destroy=function(){this.skew.destroy(),this.isStatic&&(this.position.destroy(),this.scale.destroy(),this.pivot.destroy()),this.position=null,this.scale=null,this.pivot=null,this.skew=null},Object.defineProperties(i.prototype,{rotation:{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this._sr=Math.sin(t),this._cr=Math.cos(t),this._dirtyVersion++)}},matrix:{get:function(){return this.matrix2d}}}),e.exports=i},{"../display/ObservablePoint":86,"../math":103,"../utils":154,"./ComputedTransform2d":55}],64:[function(t,e,r){e.exports={Geometry:t("./Geometry"),GeometrySet:t("./GeometrySet"),GeometrySetProxy:t("./GeometrySetProxy"),Geometry2d:t("./Geometry2d"),ComputedGeometry2d:t("./ComputedGeometry2d"),Transform2d:t("./Transform2d"),ComputedTransform2d:t("./ComputedTransform2d"),DisplayPoint:t("./DisplayPoint"),Raycast2d:t("./Raycast2d")}},{"./ComputedGeometry2d":54,"./ComputedTransform2d":55,"./DisplayPoint":56,"./Geometry":57,"./Geometry2d":58,"./GeometrySet":59,"./GeometrySetProxy":60,"./Raycast2d":62,"./Transform2d":63}],65:[function(t,e,r){function i(){n.call(this)}var n=t("../display/Camera2d"),o=t("./Transform3d"),s=t("./ComputedTransform3d"),a=t("./ProjectionTransform3d"),h=t("../math");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.initTransform=function(){this.transform=new o((!0)),this.computedTransform=new s},i.prototype.initProjection=function(){this.projection=new a((!0)),this.worldProjection=new s((!0))},Object.defineProperties(i.prototype,{z:{get:function(){return this.projection.position.z},set:function(t){this.projection.position.z=t}},lookEuler:{get:function(){return this.projection.euler},set:function(t){this.projection.euler.copy(t)}},eyeVec:{get:function(){return this.projection.eyeVec}},frustrum:{get:function(){return this.projection.frustrum},set:function(t){this.projection.frustrum.copy(t)}}}),i.prototype.easyPerspective=function(t,e,r,i){var n=t.width/t.resolution,o=t.height/t.resolution;this.centralPerspective(0,n,0,o,e,r,i)},i.prototype.centralPerspective=function(t,e,r,i,n,o,s){this.viewport.x=t,this.viewport.width=e-t,this.viewport.y=r,this.viewport.height=i-r;var a=(e+t)/2,h=(r+i)/2;this.projection.pivot.set(a,h),this.projection.frustrum.set(n||0,o||0,s||0)},i.prototype.updateBoundsCulling=function(t,e){function r(t){var e=t.getBounds(),h=t.renderable=t===u||e!==a&&e.x+e.width>=i&&e.x<=n&&e.y+e.height>=o&&e.y<=s;if(!h)return!1;for(var l=t.children,c=0;c<l.length;c++){var d=l[c];d.visible&&r(d)}return!0}var i=t.x,n=t.x+t.width,o=t.y,s=t.y+t.height,a=h.Rectangle.EMPTY,u=this;r(e||this.boundsCullingContainer||this)},i.prototype.updateViewportCulling=function(t,e){t=t||this.viewport,this.updateBoundsCulling(t,e)}},{"../display/Camera2d":80,"../math":103,"./ComputedTransform3d":67,"./ProjectionTransform3d":74,"./Transform3d":77}],66:[function(t,e,r){function i(){n.call(this),this._transformUid=-1,this._transformVersion=-1,this._geometryUid=-1,this._geometryVersion=-1}var n=t("./Geometry3d"),o=t("gl-matrix"),s=o.vec4,a=o.vec3,h=t("../math"),u=s.create(),l=a.create();i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.applyTransformStatic=function(t,e){return(this._transformUid!==e.uid||this._transformVersion!==e.version||this._geometryUid!==t.uid||this._geometryVersion!==t.version)&&(this._transformUid=e.uid,this._transformVersion=e.version,this._geometryUid=t.uid,this._geometryVersion=t.version,this.applyTransform(t,e),!0)},i.prototype.applyTransform=function(t,e){this.vertices&&this.size===t.size||(this.size=t.size),this.applyMatrix(t,e.is3d?e.matrix3d:e.matrix2d.toMat4(u))},i.prototype.applyMatrix=function(t,e){var r=l,i=this.vertices,n=t.stride,o=t.vertices,s=t.is3d;this.version++;for(var u=0,c=0,d=o.length;c<d;u+=3,c+=n)r[0]=o[c],r[1]=o[c+1],r[2]=s?o[c+2]:0,a.transformMat4(r,r,e),i[u]=r[0],i[u+1]=r[1],i[u+2]=r[2],(r[2]<0||r[2]>1)&&(this._dirtyBounds=this.version,this.currentBounds=h.Rectangle.EMPTY)}},{"../math":103,"./Geometry3d":71,"gl-matrix":5}],67:[function(t,e,r){function i(){this.matrix3d=new h.create,this.inverse3d=null,this.version=0,this.uid=n.incTransform(),this.is3d=!0,this.updated=!1,this._dirtyLocalUid=-1,this._dirtyLocalVersion=-1,this._dirtyParentUid=-1,this._dirtyParentVersion=-1,this.computedRaycast=null,this._dirtyRaycastUid=-1,this._dirtyRaycastVersion=-1,this._dirtyRaycastMyVersion=-1,this._dirtyInverse=-1,this.eyeVec=null}var n=t("../utils"),o=t("./ComputedGeometry3d"),s=t("./Raycast3d"),a=t("gl-matrix"),h=a.mat4,u=a.vec3,l=h.create(),c=h.create(),d=u.create();i.prototype.constructor=i,i.prototype.getIdentityMatrix=function(){return i.IDENTITY.matrix3d},i.prototype.getIdentityTransform=function(){return i.IDENTITY},i.IDENTITY=new i,i.prototype.updateTransform=function(t,e){if(this._dirtyLocalUid===e.uid&&this._dirtyLocalVersion===e.version&&this._dirtyParentUid===t.uid&&this._dirtyParentVersion===t.version)return this.updated=!1,!1;this._dirtyLocalUid=e.uid,this._dirtyLocalVersion=e.version,this._dirtyParentUid=t.uid,this._dirtyParentVersion=t.version;var r=this.matrix3d,i=t.is3d?t.matrix3d:t.matrix2d.toMat4(l);if(2===e.operType)h.copy(r,i);else{var n=e.is3d?e.matrix3d:e.matrix2d.toMat4(c);1===e.operType?h.translate(r,i,h.getTranslation(d,n)):h.multiply(r,i,n)}return this.eyeVec=t.eyeVec||e.eyeVec,this.updated=!0,this.version++,!0},i.prototype.updateSingleChild=function(t){return t&&t.is3d||(t=new i),t.updateSingle(this),t},i.prototype.updateSingle=function(t){if(this._dirtyLocalUid===t.uid&&this._dirtyLocalVersion===t.version&&this._dirtyParentUid===t.uid&&this._dirtyParentVersion===t.version)return this.updated=!1,!1;this._dirtyLocalUid=t.uid,this._dirtyLocalVersion=t.version,this._dirtyParentUid=t.uid,this._dirtyParentVersion=t.version;var e=this.matrix3d;return t.is3d?h.copy(e,t.matrix3d):t.matrix2d.toMat4(e),this.eyeVec=t.eyeVec,this.updated=!0,this.version++,!0},i.prototype.to2d=function(t){return t.copyFromMat4(this.matrix3d)},i.prototype.updateRaycast=function(t){return this._dirtyRaycastMyVersion===this.version&&this._dirtyRaycastUid===t.uid&&this._dirtyRaycastVersion===t.version?(this.updated=!1,!1):(this.computedRaycast=this.updateChildRaycast(this.computedRaycast,t),this.computedRaycast)},i.prototype.updateChildTransform=function(t,e){return t&&t.is3d||(t=new i),t.updateTransform(this,e),t},i.prototype.updateChildReverseTransform=function(t,e){return t&&t.is3d||(t=new i),t.updateTransform(e,this),t},i.prototype.checkChildReverseTransform=function(t,e){return!t||(t._dirtyLocalUid!==this.uid||t._dirtyLocalVersion!==this.version||t._dirtyParentUid!==e.uid||t._dirtyParentVersion!==e.version)},i.prototype.getVisibleSide=function(t){var e=this.getInverse();return u.transformMat4(d,t,e),d[2]>0?1:-1},i.prototype.updateChildGeometry=function(t,e){return e&&e.valid?(t&&t.is3d||(t=new o),t.applyTransformStatic(e,this),t):null},i.prototype.updateChildRaycast=function(t,e){return e?(t&&t.is3d||(t=new s),t.applyTransformStatic(e,this),t):null},i.prototype.getInverse=function(){return this._dirtyInverse===this.version?this.inverse3d:(this._dirtyInverse=this.version,this.inverse3d||(this.inverse3d=h.create()),h.invert(this.inverse3d,this.matrix3d),this.inverse3d)},Object.defineProperties(i.prototype,{matrix:{get:function(){return this.matrix3d}}}),e.exports=i},{"../utils":154,"./ComputedGeometry3d":66,"./Raycast3d":75,"gl-matrix":5}],68:[function(t,e,r){function i(){n.call(this)}var n=t("../display/Container"),o=t("./Transform3d"),s=t("./ComputedTransform3d");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.initTransform=function(){this.transform=new o((!0)),this.computedTransform=new s},Object.defineProperties(i.prototype,{z:{get:function(){return this.transform.position.z},set:function(t){this.transform.position.z=t}},euler:{get:function(){return this.transform.euler},set:function(t){this.transform.euler.copy(t)}}})},{"../display/Container":82,"./ComputedTransform3d":67,"./Transform3d":77}],69:[function(t,e,r){function i(t,e,r){this._x=t||0,this._y=e||0,this._z=r||0,this.quaternion=n.create(),this.version=0,this._dirtyVersion=1,this._sign=1,this.update()}var n=t("gl-matrix").quat;Object.defineProperties(i.prototype,{yaw:{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._dirtyVersion++)}},pitch:{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._dirtyVersion++)}},roll:{get:function(){return this._z},set:function(t){this._z!==t&&(this._z=t,this._dirtyVersion++)}},y:{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._dirtyVersion++)}},x:{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._dirtyVersion++)}},z:{get:function(){return this._z},set:function(t){this._z!==t&&(this._z=t,this._dirtyVersion++)}}}),i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.x,this.y,this.z)},i.prototype.set=function(t,e,r){var i=t||0,n=e||0,o=r||0;this._x===i&&this._y===n&&this._z===o||(this._x=i,this._y=n,this._z=o,this._dirtyVersion++)},i.prototype.copy=function(t){var e=t.x,r=t.y,i=t.z;this._x===e&&this._y===r&&this._z===i||(this._x=e,this._y=r,this._z=i,this._dirtyVersion++)},i.prototype.update=function(){if(this.version===this._dirtyVersion)return!1;this.version=this._dirtyVersion;var t=Math.cos(this._x/2),e=Math.cos(this._y/2),r=Math.cos(this._z/2),i=this._sign,n=i*Math.sin(this._x/2),o=i*Math.sin(this._y/2),s=i*Math.sin(this._z/2),a=this.quaternion;return a[0]=n*e*r+t*o*s,a[1]=t*o*r-n*e*s,a[2]=t*e*s+n*o*r,a[3]=t*e*r-n*o*s,!0}},{"gl-matrix":5}],70:[function(t,e,r){function i(){this._focus=0,this._near=0,this._far=0,this.version=0}Object.defineProperties(i.prototype,{focus:{get:function(){return this._focus}},near:{get:function(){return this._near}},far:{get:function(){return this._far}}}),i.prototype.constructor=i,e.exports=i,i.prototype.set=function(t,e,r){this._focus===t&&this._near===e&&this._far===r||(this._focus=t,this._near=e,this._far=r,this.version++)},i.prototype.copy=function(t){var e=t._focus,r=t._near,i=t._far;this._focus===e&&this._near===r&&this._far===i||(this._focus=e,this._near=r,this._far=i,this.version++)}},{}],71:[function(t,e,r){function i(){n.call(this),this.stride=3,this.is3d=!0}var n=t("../c2d/Geometry");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.fromBuffers=function(t,e){var r=new i;return r.vertices=t||null,r.indices=e||null,r}},{"../c2d/Geometry":57}],72:[function(t,e,r){function i(t,e,r,i,o){n.call(this,t,e,r,i),this._z=o||0}var n=t("../display/ObservablePoint"),o=t("./Point3d");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{z:{get:function(){return this._z},set:function(t){this._z!==t&&(this._z=t,this.cb.call(this.scope))}}}),n.prototype.set=function(t,e,r){var i=t||0,n=e||(0!==e?i:0),o=r||(0!==r?this._z:0);this._x===i&&this._y===n&&this._z===r||(this._x=i,this._y=n,this._z=o,this.cb.call(this.scope))},n.prototype.clone=function(){return new o(this.x,this.y,this.z)},n.prototype.copy=function(t){var e=t.x,r=t.y,i=t.z||0;this._x===e&&this._y===r&&this._z===i||(this._x=e,this._y=r,this._z=i,this.cb.call(this.scope))}},{"../display/ObservablePoint":86,"./Point3d":73}],73:[function(t,e,r){function i(t,e,r){this.x=t||0,this.y=e||0,this.z=r||0}i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.x,this.y,this.z)},i.prototype.set=function(t,e,r){this.x=t||0,this.y=e||(0!==e?this.x:0),this.z=r||(0!==r?this.z:0)}},{}],74:[function(t,e,r){function i(){o.call(this,!0),this.frustrum=new n,this.euler._sign=-1,this._frustrumVersion=0,this.eyeVec=h.create()}var n=t("./Frustrum"),o=t("./Transform3d"),s=t("gl-matrix"),a=s.mat4,h=s.vec3,u=s.quat,l=a.create(),c=h.create();i.prototype=Object.create(o.prototype),i.prototype.constructor=o,i.prototype.update=function(){if(this.euler.update(),this.version===this._dirtyVersion&&this._eulerVersion===this.euler.version&&this._frustrumVersion===this.frustrum.version)return!1;this.version=++this._dirtyVersion,this._eulerVersion=this.euler.version,this._frustrumVersion=this.frustrum.version;var t=this.matrix3d;a.identity(t),t[12]=this.pivot.x,t[13]=this.pivot.y,t[14]=this.pivot.z;var e=this.frustrum._focus,r=this.frustrum._near,i=this.frustrum._far;(e||r||i)&&(a.identity(l),l[10]=1/(i-r),l[14]=(e-r)/(i-r),l[11]=1/e,a.multiply(t,t,l)),a.fromQuat(l,this.euler.quaternion),a.multiply(t,t,l);var n=this.eyeVec;return h.set(n,0,0,-e),u.invert(l,this.euler.quaternion),a.fromQuat(l,l),h.transformMat4(n,n,l),c[0]=1/this.scale.x,c[1]=1/this.scale.y,c[2]=1/this.scale.z,a.scale(t,t,c),h.multiply(n,n,c),c[0]=-this.position.x,c[1]=-this.position.y,c[2]=-this.position.z,a.translate(t,t,c),h.subtract(n,n,c),!0},e.exports=i},{"./Frustrum":70,"./Transform3d":77,"gl-matrix":5}],75:[function(t,e,r){function i(){n.call(this),this.ray=[s.create(),s.create()],this.is3d=!0}var n=t("../c2d/Raycast2d"),o=t("gl-matrix"),s=o.vec3,a=o.mat4,h=a.create(),u=s.create(),l=s.create();i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.childApplyTransform=function(t,e){return t&&t.is3d||(t=new i),e.updateRaycast(t,this)},i.prototype.applyTransform=function(t,e){this.intersects=!1;var r=t.is3d?t.ray[0]:s.set(u,t.x,t.y,1),i=t.is3d?t.ray[1]:s.set(l,t.x,t.y,0),n=e.is3d?e.getInverse():e.matrix2d.invertMat4(h);s.transformMat4(this.ray[0],r,n),s.transformMat4(this.ray[1],i,n);var a=o.glMatrix.EPSILON,c=this.ray[0][2]-this.ray[1][2];if(c>-a&&c<a)this.valid=!1;else{var d=-this.ray[0][2]/(this.ray[1][2]-this.ray[0][2]);
  d<-a?this.valid=!1:(this.valid=!0,this._point.x=d*(this.ray[1][0]-this.ray[0][0])+this.ray[0][0],this._point.y=d*(this.ray[1][1]-this.ray[0][1])+this.ray[0][1])}}},{"../c2d/Raycast2d":62,"gl-matrix":5}],76:[function(t,e,r){function i(t,e){n.call(this,t,e)}var n=t("../sprites/Sprite"),o=t("./Transform3d"),s=t("./ComputedTransform3d"),a=t("../textures/Texture"),h=t("../utils");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.initTransform=function(){this.transform=new o((!0)),this.computedTransform=new s},Object.defineProperties(i.prototype,{z:{get:function(){return this.transform.position.z},set:function(t){this.transform.position.z=t}},skew:{get:function(){return null},set:function(){}},euler:{get:function(){return this.transform.euler},set:function(t){this.transform.euler.copy(t)}}}),i.fromFrame=function(t){var e=h.TextureCache[t];if(!e)throw new Error('The frameId "'+t+'" does not exist in the texture cache');return new i(e)},i.fromImage=function(t,e,r){return new i(a.fromImage(t,e,r))}},{"../sprites/Sprite":133,"../textures/Texture":147,"../utils":154,"./ComputedTransform3d":67,"./Transform3d":77}],77:[function(t,e,r){function i(t){this.matrix3d=l.create(),this.isStatic=!!t,this.position=t?new n(this.makeDirty,this,0,0,0):new o(0,0,0),this.scale=t?new n(this.makeDirty,this,1,1,1):new o(1,1,1),this.euler=new s(0,0,0),this.pivot=t?new n(this.makeDirty,this,0,0,0):new o(0,0,0),this._dirtyVersion=0,this.version=0,this._eulerVersion=0,this.is3d=!0,this.operType=0,this.uid=h.incTransform()}var n=t("./ObservablePoint3d"),o=t("./Point3d"),s=t("./Euler"),a=t("./ComputedTransform3d"),h=t("../utils"),u=t("gl-matrix"),l=u.mat4,c=l.create();i.prototype.constructor=i,i.prototype.makeDirty=function(){this._dirtyVersion++},i.prototype.update=function(){if(this.euler.update(),this.isStatic&&this.version===this._dirtyVersion&&this._eulerVersion===this.euler.version)return!1;this.version=++this._dirtyVersion,this._eulerVersion=this.euler.version;var t=!0,e=this.matrix3d,r=this.euler._x,i=this.euler._y,n=this.euler._z;return c[0]=this.position.x,c[1]=this.position.y,c[2]=this.position.z,0!==r||0!==i||0!==n?(t=!1,l.fromRotationTranslation(e,this.euler.quaternion,c)):l.fromTranslation(e,c),r=this.scale.x,i=this.scale.y,n=this.scale.z,1===r&&1===i&&1===n||(t=!1,c[0]=r,c[1]=i,c[2]=n,l.scale(e,e,c)),r=this.pivot.x,i=this.pivot.y,n=this.pivot.z,(r||i||n)&&(c[0]=-r,c[1]=-i,c[2]=-n,l.translate(e,e,c)),this.operType=t?1:0,!0},i.prototype.setFromMatrix=function(){console.log("Sorry, but Transform3d.setFromMatrix is not implemented yet")},i.prototype.updateSingleChild=a.prototype.updateSingleChild,i.prototype.destroy=function(){this.isStatic&&(this.position.destroy(),this.scale.destroy(),this.pivot.destroy(),this.euler.destroy()),this.position=null,this.scale=null,this.pivot=null,this.euler=null},Object.defineProperties(i.prototype,{rotation:{get:function(){return this.euler.z},set:function(t){this.euler.z=t}},matrix:{get:function(){return this.matrix3d}}}),e.exports=i},{"../utils":154,"./ComputedTransform3d":67,"./Euler":69,"./ObservablePoint3d":72,"./Point3d":73,"gl-matrix":5}],78:[function(t,e,r){e.exports={Geometry3d:t("./Geometry3d"),ComputedGeometry3d:t("./ComputedGeometry3d"),ObservablePoint3d:t("./ObservablePoint3d"),Transform3d:t("./Transform3d"),ProjectionTransform3d:t("./ProjectionTransform3d"),ComputedTransform3d:t("./ComputedTransform3d"),Raycast3d:t("./Raycast3d"),Point3d:t("./Point3d"),Euler:t("./Euler"),glMat:t("gl-matrix"),Camera3d:t("./Camera3d"),Container3d:t("./Container3d"),Sprite3d:t("./Sprite3d")}},{"./Camera3d":65,"./ComputedGeometry3d":66,"./ComputedTransform3d":67,"./Container3d":68,"./Euler":69,"./Geometry3d":71,"./ObservablePoint3d":72,"./Point3d":73,"./ProjectionTransform3d":74,"./Raycast3d":75,"./Sprite3d":76,"./Transform3d":77,"gl-matrix":5}],79:[function(t,e,r){var i={VERSION:"4.0.0-alpha.1",PI_2:2*Math.PI,RAD_TO_DEG:180/Math.PI,DEG_TO_RAD:Math.PI/180,TARGET_FPMS:.06,RENDERER_TYPE:{UNKNOWN:0,WEBGL:1,CANVAS:2},BLEND_MODES:{NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16},DRAW_MODES:{POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},SCALE_MODES:{DEFAULT:0,LINEAR:0,NEAREST:1},WRAP_MODES:{DEFAULT:0,CLAMP:0,REPEAT:1,MIRRORED_REPEAT:2},GC_MODES:{DEFAULT:1,AUTO:0,MANUAL:1},MIPMAP_TEXTURES:!0,RETINA_PREFIX:/@(.+)x/,RESOLUTION:1,FILTER_RESOLUTION:1,DEFAULT_RENDER_OPTIONS:{view:null,resolution:1,antialias:!1,forceFXAA:!1,autoResize:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,roundPixels:!1},SHAPES:{POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},PRECISION:{DEFAULT:"mediump",LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"},SPRITE_BATCH_SIZE:4096,SPRITE_MAX_TEXTURES:t("./utils/maxRecommendedTextures")(32),TEXT_STYLE_CHANGED:"changed"};e.exports=i},{"./utils/maxRecommendedTextures":155}],80:[function(t,e,r){function i(){n.call(this),this.projection=null,this.computedProjection=null,this.proxyCache=[{},{}],this.initProjection(),this.onZOrder=null,this._displayList=[],this.enableDisplayList=!1,this.displayListSort=function(t,e){return t.zIndex!==e.zIndex?t.zIndex-e.zIndex:t.zOrder!==e.zOrder?e.zOrder-t.zOrder:t.updateOrder-e.updateOrder},this.viewport=new l.Rectangle,this.autoUpdateViewport=!0,this.enableBoundsCulling=!1,this.boundsCullingContainer=null,this._viewportGeom=new s,this._viewportGeom.size=4,this._invProjectedViewport=new a,this._invProjectedViewport.size=4}var n=t("./Container"),o=t("../c2d/ProjectionTransform2d"),s=t("../c2d/Geometry2d"),a=t("../c2d/ComputedGeometry2d"),h=t("../c2d/ComputedTransform2d"),u=t("../utils"),l=t("../math"),c=new l.Matrix;i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{lookPosition:{get:function(){return this.projection.position},set:function(t){this.projection.position.set(t)}},lookScale:{get:function(){return this.projection.scale},set:function(t){this.projection.scale.set(t)}},lookRotation:{get:function(){return this.projection.rotation},set:function(t){this.projection.rotation=t}}}),i.prototype.initTransform=function(){this.displayObjectInitTransform(!0)},i.prototype.initProjection=function(){this.projection=new o((!0)),this.worldProjection=new h((!0))},i.prototype.updateTransform=function(){if(this.visible){this.updateOrder=u.incUpdateOrder(),this.displayOrder=0,this._currentBounds=null;var t=null;this.transform.update(),this.dontInheritTransform?(this.dontInheritTransform=!1,this.computedTransform=this.transform.updateSingleChild(this.computedTransform)):this.computedTransform=this.parent.computedTransform.updateChildTransform(this.computedTransform,this.transform),this.projection.update(),this.computedProjection=this.computedTransform.updateChildTransform(this.computedProjection,this.projection),this.parent?(this.worldAlpha=this.alpha*this.parent.worldAlpha,t=this.parent.worldProjection):(this.worldAlpha=this.alpha,t=null),t?this.worldProjection=t.updateChildTransform(this.worldProjection,this.computedProjection):this.worldProjection=this.computedProjection.updateSingleChild(this.worldProjection);for(var e=0,r=this.children.length;e<r;++e)this.children[e].visible&&(this.children[e].dontInheritTransform=!0,this.children[e].updateTransform());this.updatePostOrder=u.incUpdateOrder(),this.enableBoundsCulling&&this.updateViewportCulling(),this.emit("culling"),this.enableDisplayList&&this.updateDisplayList()}},i.prototype._proxyContainer=function(t,e){var r=this.proxyCache[0],i=this.proxyCache[1],n=t.children,o=e.children;o.length=0;for(var s=0;s<n.length;s++){var a=n[s],h=r[a.uid]||a.createProxy();i[a.uid]=h,o.push(h),h.parent=e,h.children&&this._proxyContainer(a,h)}},i.prototype._proxySwapBuffer=function(){this.proxyCache[0]=this.proxyCache[1],this.proxyCache[1]={}},i.prototype.proxyContainer=function(t,e){e||(e=this),this._proxyContainer(t,e),this._proxySwapBuffer()},i.prototype.containerRenderWebGL=n.prototype.renderWebGL,i.prototype.containerRenderCanvas=n.prototype.renderCanvas,i.prototype.renderWebGL=function(t){if(this.autoUpdateViewport&&(this.viewport.x=0,this.viewport.y=0,this.viewport.width=t.width/t.resolution,this.viewport.height=t.height/t.resolution),this.enableDisplayList)for(var e=this._displayList,r=0;r<e.length;r++)e[r].displayFlag?e[r].renderWebGL(t):(e[r].displayOrder=u.incDisplayOrder(),e[r]._renderWebGL(t));else this.containerRenderWebGL(t)},i.prototype.renderCanvas=function(t){if(this.autoUpdateViewport&&(this.viewport.x=0,this.viewport.y=0,this.viewport.width=t.width,this.viewport.height=t.height),this.enableDisplayList)for(var e=this._displayList,r=0;r<e.length;r++)e[r].displayFlag?e[r].renderCanvas(t):(e[r].displayOrder=u.incDisplayOrder(),e[r]._renderCanvas(t));else this.containerRenderCanvas(t)},i.prototype._addInList=function(t,e,r){if(t.visible&&t.renderable){var i=this._displayList;if(t.displayOrder=i.length,t.inheritZIndex?(t._zIndex=e,t.zOrder=r):this.onZOrder&&this.onZOrder(t),i.push(t),t._mask||t._filters&&t._filters.length)t.displayFlag=1;else{var n=t.children;if(n){t.displayFlag=0;for(var o=0;o<n.length;o++)this._addInList(n[o],t.zIndex,t.zOrder)}else t.displayFlag=2}}},i.prototype.updateDisplayList=function(){var t=this._displayList;t.length=0;for(var e=this.children,r=0;r<e.length;r++)this._addInList(e[r],0,0);t.sort(this.displayListSort)},i.prototype.updateBoundsCulling=function(t,e){function r(t){var e=t.getComputedBounds(),u=t.renderable=t===h||e!==a&&e.x+e.width>=i&&e.x<=n&&e.y+e.height>=o&&e.y<=s;if(!u)return!1;for(var l=t.children,c=0;c<l.length;c++){var d=l[c];d.visible&&r(d)}return!0}var i=t.x,n=t.x+t.width,o=t.y,s=t.y+t.height,a=l.Rectangle.EMPTY,h=this;r(e||this.boundsCullingContainer||this)},i.prototype.updateViewportCulling=function(t,e){t=t||this.viewport,this._viewportGeom.setRectCoords(0,t.x,t.y,t.x+t.width,t.y+t.height),this.projection.matrix2d.copy(c),c.invert(),this._invProjectedViewport.applyMatrix(this._viewportGeom,c);var r=this._invProjectedViewport.getBounds();this.updateBoundsCulling(r,e)}},{"../c2d/ComputedGeometry2d":54,"../c2d/ComputedTransform2d":55,"../c2d/Geometry2d":58,"../c2d/ProjectionTransform2d":61,"../math":103,"../utils":154,"./Container":82}],81:[function(t,e,r){function i(t){n.call(this,t),this.worldProjection=new s,this._displayList=t._displayList,this._displayListFlag=t._displayListFlag,this.enableDisplayList=t.enableDisplayList}var n=t("./ContainerProxy"),o=t("./Camera2d"),s=t("../c2d/ComputedTransform2d");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{projection:{get:function(){return this.original.projection}}}),i.prototype.updateTransform=o.prototype.updateTransform,i.prototype.containerRenderWebGL=o.prototype.containerRenderWebGL,i.prototype.containerRenderCanvas=o.prototype.containerRenderCanvas,i.prototype.renderWebGL=o.prototype.renderWebGL,i.prototype.renderCanvas=o.prototype.renderCanvas,i.prototype.createProxy=function(){return new i(this)},o.prototype.createProxy=function(){return new i(this)}},{"../c2d/ComputedTransform2d":55,"./Camera2d":80,"./ContainerProxy":83}],82:[function(t,e,r){function i(){s.call(this),this.children=[],this.updatePostOrder=0}var n=t("../math"),o=t("../utils"),s=t("./DisplayObject");i.prototype=Object.create(s.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{width:{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(t){var e=this.getLocalBounds().width;0!==e?this.scale.x=t/e:this.scale.x=1,this._width=t}},height:{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(t){var e=this.getLocalBounds().height;0!==e?this.scale.y=t/e:this.scale.y=1,this._height=t}}}),i.prototype.onChildrenChange=function(){},i.prototype.addChild=function(t){var e=arguments.length;if(e>1)for(var r=0;r<e;r++)this.addChild(arguments[r]);else t.parent&&t.parent.removeChild(t),t.parent=this,this.children.push(t),this.onChildrenChange(this.children.length-1),t.emit("added",this);return t},i.prototype.addChildAt=function(t,e){if(e>=0&&e<=this.children.length)return t.parent&&t.parent.removeChild(t),t.parent=this,this.children.splice(e,0,t),this.onChildrenChange(e),t.emit("added",this),t;throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length)},i.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);if(r<0||i<0)throw new Error("swapChildren: Both the supplied DisplayObjects must be children of the caller.");this.children[r]=e,this.children[i]=t,this.onChildrenChange(r<i?r:i)}},i.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(e===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return e},i.prototype.setChildIndex=function(t,e){if(e<0||e>=this.children.length)throw new Error("The supplied index is out of bounds");var r=this.getChildIndex(t);o.removeItems(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},i.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Supplied index "+t+" does not exist in the child list, or the supplied DisplayObject is not a child of the caller");return this.children[t]},i.prototype.removeChild=function(t){var e=arguments.length;if(e>1)for(var r=0;r<e;r++)this.removeChild(arguments[r]);else{var i=this.children.indexOf(t);if(i===-1)return;t.parent=null,o.removeItems(this.children,i,1),this.onChildrenChange(i),t.emit("removed",this)}return t},i.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,o.removeItems(this.children,t,1),this.onChildrenChange(t),e.emit("removed",this),e},i.prototype.removeChildren=function(t,e){var r,i,n=t||0,o="number"==typeof e?e:this.children.length,s=o-n;if(s>0&&s<=o){for(r=this.children.splice(n,s),i=0;i<r.length;++i)r[i].parent=null;for(this.onChildrenChange(t),i=0;i<r.length;++i)r[i].emit("removed",this);return r}if(0===s&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},i.prototype.updateTransform=function(){if(this.visible){this.displayObjectUpdateTransform();for(var t=0,e=this.children.length;t<e;++t)this.children[t].updateTransform();this.updatePostOrder=o.incUpdateOrder()}},i.prototype.containerUpdateTransform=i.prototype.updateTransform,i.prototype._getChildBounds=function(){if(0===this.children.length)return n.Rectangle.EMPTY;for(var t,e,r,i=1/0,o=1/0,s=-(1/0),a=-(1/0),h=!1,u=this._bounds,l=0,c=this.children.length;l<c;++l){var d=this.children[l];d.visible&&(t=this.children[l].getBounds(),t!==n.Rectangle.EMPTY&&(h=!0,i=i<t.x?i:t.x,o=o<t.y?o:t.y,e=t.width+t.x,r=t.height+t.y,s=s>e?s:e,a=a>r?a:r))}return u.x=i,u.y=o,u.width=s-i,u.height=a-o,h?u:n.Rectangle.EMPTY},i.prototype._getChildComputedBounds=function(){if(0===this.children.length)return n.Rectangle.EMPTY;for(var t,e,r,i=1/0,o=1/0,s=-(1/0),a=-(1/0),h=!1,u=this._computedBounds,l=0,c=this.children.length;l<c;++l){var d=this.children[l];d.visible&&(t=this.children[l].getComputedBounds(),t!==n.Rectangle.EMPTY&&(h=!0,i=i<t.x?i:t.x,o=o<t.y?o:t.y,e=t.width+t.x,r=t.height+t.y,s=s>e?s:e,a=a>r?a:r))}return u.x=i,u.y=o,u.width=s-i,u.height=a-o,h?u:n.Rectangle.EMPTY},i.prototype.getBounds=function(){if(this._localBounds)return this._localBounds.getBounds(this.computedTransform,this.worldProjection);if(!this._currentBounds){var t=this.updateProjectedGeometry();t?(this._currentBounds=t.getBounds(),this._currentBounds.enlarge(this._getChildBounds())):this._currentBounds=this._getChildBounds()}return this._currentBounds},i.prototype.getComputedBounds=function(){if(this._localBounds)return this._localBounds.getComputedBounds(this.computedTransform);if(!this._currentComputedBounds){var t=this.updateGeometry();t?(this._currentComputedBounds=t.getBounds(),this._currentComputedBounds.enlarge(this._getChildComputedBounds())):this._currentComputedBounds=this._getChildComputedBounds()}return this._currentComputedBounds},i.prototype.containerGetBounds=i.prototype.getBounds,i.prototype.getLocalBounds=function(){if(this._localBounds)return this._localBounds.local.getBounds();for(var t=this.computedTransform.getIdentityTransform(),e=0,r=this.children.length;e<r;++e)this.children[e].updateTransform(t);var i=this.geometry;return i?(this._currentBounds=i.getBounds(),this._currentBounds.enlarge(this._getChildBounds())):this._currentBounds=this._getChildBounds(),this._currentBounds},i.prototype.renderWebGL=function(t){if(!this.visible)return void(this.displayOrder=0);if(this.displayOrder=o.incDisplayOrder(),!(this.worldAlpha<=0)&&this.renderable){var e,r;if(this._mask||this._filters){for(t.currentRenderer.flush(),this._filters&&this._filters.length&&t.filterManager.pushFilter(this,this._filters),this._mask&&t.maskManager.pushMask(this,this._mask),t.currentRenderer.start(),this._renderWebGL(t),e=0,r=this.children.length;e<r;e++)this.children[e].renderWebGL(t);t.currentRenderer.flush(),this._mask&&t.maskManager.popMask(this,this._mask),this._filters&&t.filterManager.popFilter(),t.currentRenderer.start()}else for(this._renderWebGL(t),e=0,r=this.children.length;e<r;++e)this.children[e].renderWebGL(t)}},i.prototype._renderWebGL=function(t){},i.prototype._renderCanvas=function(t){},i.prototype.renderCanvas=function(t){if(this.visible&&!(this.alpha<=0)&&this.renderable){this._mask&&t.maskManager.pushMask(this._mask,t),this._renderCanvas(t);for(var e=0,r=this.children.length;e<r;++e)this.children[e].renderCanvas(t);this._mask&&t.maskManager.popMask(t)}},i.prototype.destroy=function(t){s.prototype.destroy.call(this);var e="boolean"==typeof t?t:t&&t.children;if(e)for(var r=0,i=this.children.length;r<i;++r)this.children[r].destroy(t);this.removeChildren(),this.children=null}},{"../math":103,"../utils":154,"./DisplayObject":84}],83:[function(t,e,r){function i(t){n.call(this,t),this.children=[]}var n=t("./DisplayObjectProxy"),o=t("./Container");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{}),o.prototype.createProxy=function(){return new i(this)},i.prototype.updateTransform=o.prototype.updateTransform,i.prototype.containerUpdateTransform=o.prototype.updateTransform,i.prototype._getChildBounds=o.prototype._getChildBounds,i.prototype.getBounds=o.prototype.getBounds,i.prototype.containerGetBounds=o.prototype.getBounds,i.prototype.getLocalBounds=o.prototype.getLocalBounds,i.prototype.renderWebGL=o.prototype.renderWebGL,i.prototype.renderCanvas=o.prototype.renderCanvas,i.prototype._renderWebGL=function(t){this.swapContext(),this.original._renderWebGL(t),this.swapContext()},i.prototype._renderCanvas=function(t){this.swapContext(),this.original._renderCanvas(t),this.swapContext()},i.prototype.createProxy=function(){return new i(this)},i.prototype.destroy=o.prototype.destroy},{"./Container":82,"./DisplayObjectProxy":85}],84:[function(t,e,r){function i(){o.call(this),this.uid=h.incDisplayObject(),this.transform=null,this.computedTransform=null,this.projectedTransform=null,this.worldProjection=null,this.geometry=null,this.computedGeometry=null,this.projectedGeometry=null,this._localBounds=null,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this.filterArea=null,this._computedBounds=new n.Rectangle(0,0,1,1),this._bounds=new n.Rectangle(0,0,1,1),this._currentBounds=null,this._currentComputedBounds=null,this.isRaycastCheckingBoundsFirst=!1,this.isRaycastPossible=!1,this._mask=null,this.proxyContext=null,this.updateOrder=0,this.displayOrder=0,this.displayFlag=0,this.inheritZIndex=!0,this.dontInheritTransform=!1,this._zIndex=0,this.zOrder=0,this.initTransform(!0)}var n=t("../math"),o=t("eventemitter3"),s=t("../c2d/Transform2d"),a=t("../c2d/ComputedTransform2d"),h=t("../utils"),u=null;i.prototype=Object.create(o.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{zIndex:{get:function(){return this._zIndex},set:function(t){this._zIndex=t,this.inheritZIndex=!1}},x:{get:function(){return this.transform.position.x},set:function(t){this.transform.position.x=t}},y:{get:function(){return this.transform.position.y},set:function(t){this.transform.position.y=t}},projectionMatrix:{get:function(){return this.updateProjectedTransform().matrix}},projectionMatrix2d:{get:function(){return this.updateProjectedTransform().matrix2d}},localTransform:{get:function(){return this.transform.matrix}},position:{get:function(){return this.transform.position},set:function(t){this.transform.position.copy(t)}},scale:{get:function(){return this.transform.scale},set:function(t){this.transform.scale.copy(t)}},pivot:{get:function(){return this.transform.pivot},set:function(t){this.transform.pivot.copy(t)}},skew:{get:function(){return this.transform.skew},set:function(t){this.transform.skew.copy(t)}},rotation:{get:function(){return this.transform.rotation},set:function(t){this.transform.rotation=t}},worldVisible:{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}},worldTransform:{get:function(){return this.transform.matrix2d}},mask:{get:function(){return this._mask},set:function(t){this._mask&&(this._mask.renderable=!0),this._mask=t,this._mask&&(this._mask.renderable=!1)}},filters:{get:function(){return this._filters&&this._filters.slice()},set:function(t){this._filters=t&&t.slice()}}}),i.prototype.initTransform=function(t){this.transform=new s(t),this.computedTransform=new a},i.prototype.displayObjectInitTransform=i.prototype.initTransform,i.prototype.updateTransform=function(){return this.updateOrder=h.incUpdateOrder(),this.displayOrder=0,this._currentBounds=null,this._currentComputedBounds=null,this.parent?(this.worldAlpha=this.alpha*this.parent.worldAlpha,this.worldProjection=this.parent.worldProjection):(this.worldAlpha=this.alpha,this.worldProjection=null),this.transform.update(),this.dontInheritTransform?(this.dontInheritTransform=!1,this.computedTransform=this.transform.updateSingleChild(this.computedTransform)):this.computedTransform=this.parent.computedTransform.updateChildTransform(this.computedTransform,this.transform),this.computedTransform},i.prototype.updateGeometry=function(){return this.computedGeometry=this.computedTransform.updateChildGeometry(this.computedGeometry,this.geometry),this.computedGeometry},i.prototype.updateProjectedGeometry=function(){return this.computedGeometry=this.computedTransform.updateChildGeometry(this.computedGeometry,this.geometry),this.worldProjection&&this.computedGeometry?(this.projectedGeometry=this.worldProjection.updateChildGeometry(this.projectedGeometry,this.computedGeometry),this.projectedGeometry):(this.projectedGeometry=null,this.computedGeometry)},i.prototype.updateProjectedTransform=function(){var t=this.worldProjection;return t?(this.projectedTransform=t.updateChildTransform(this.projectedTransform||new a,this.computedTransform),this.projectedTransform):this.computedTransform},i.prototype.displayObjectUpdateTransform=i.prototype.updateTransform,i.prototype.getComputedBounds=function(){if(this._localBounds)return this._localBounds.getComputedBounds(this.computedTransform);if(!this._currentComputedBounds){var t=this.updateGeometry();if(!t||!t.valid)return n.Rectangle.EMPTY;this._currentComputedBounds=t.getBounds()}return this._currentComputedBounds},i.prototype.getBounds=function(){if(this._localBounds)return this._localBounds.getBounds(this.computedTransform,this.projectedTransform);var t=this.updateProjectedGeometry();return t&&t.valid?(this._currentBounds||(this._currentBounds=t.getBounds()),this._currentBounds):n.Rectangle.EMPTY},i.prototype.getLocalBounds=function(){if(this._localBounds)return this._localBounds.getBounds(this.computedTransform,this.worldProjection);var t=this.geometry;return t?t.getBounds():n.Rectangle.EMPTY},i.prototype.toGlobal=function(t){return this.parent?this.displayObjectUpdateTransform():(this.parent=u,this.displayObjectUpdateTransform(),this.parent=null),this.projectionMatrix.apply(t)},i.prototype.toLocal=function(t,e,r){return e&&(t=e.toGlobal(t)),this.parent?this.displayObjectUpdateTransform():(this.parent=u,this.displayObjectUpdateTransform(),this.parent=null),this.projectionMatrix.applyInverse(t,r)},i.prototype.raycast=function(t,e){return e||this.hitArea||!this.isRaycastCheckingBoundsFirst||this.getBounds().contains(t.x,t.y)?(this.worldProjection&&(t=this.worldProjection.updateRaycast(t)),t=this.computedTransform.updateRaycast(t),t&&t.valid&&(t.intersects=this.hitArea?this.hitArea.contains(t.x,t.y):this.containsLocalPoint(t)),t):null},i.prototype.containsPoint=function(t){var e=this.raycast(t);return e&&e.valid&&e.intersects},i.prototype.projectionMatrixTo2d=function(t){return this.updateProjectedTransform().to2d(t)},i.prototype.containsLocalPoint=function(){return!1},i.prototype.renderWebGL=function(t){},i.prototype.renderCanvas=function(t){},i.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},i.prototype.setTransform=function(t,e,r,i,n,o,s,a,h){return this.position.x=t||0,this.position.y=e||0,this.scale.x=r?r:1,this.scale.y=i?i:1,this.rotation=n||0,this.skew.x=o||0,this.skew.y=s||0,this.pivot.x=a||0,this.pivot.y=h||0,this},i.prototype.destroy=function(){this.transform.destroy(),this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.transform=null,this.computedTransform=null,this.projectedTransform=null,this.projection=null,this.worldProjection=null,this.filterArea=null},u=new i},{"../c2d/ComputedTransform2d":55,"../c2d/Transform2d":63,"../math":103,"../utils":154,eventemitter3:4}],85:[function(t,e,r){function i(t){this.original=t,this.uid=o.incDisplayObject(),this.projectedTransform=null,this.worldProjection=null,this._localBoundsProxy=null,this._bounds=new n.Rectangle(0,0,1,1),this._currentBounds=null,this.parent=null,this.worldAlpha=1,this.renderable=!0,this.proxyContext=this,this.zOrder=0,this.updateOrder=0,this.displayOrder=0}var n=t("../math"),o=t("../utils"),s=t("./DisplayObject"),a=t("./DisplayObject");i.prototype=Object.create(s.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{transform:{get:function(){return this.original.transform},set:function(t){this.original.transform=t}},computedTransform:{get:function(){return this.original.computedTransform},set:function(t){this.original.computedTransform=t}},geometry:{get:function(){return this.original.geometry},set:function(t){this.original.geometry=t}},computedGeometry:{get:function(){return this.original.computedGeometry},set:function(t){this.original.computedGeometry=t}},_localBounds:{get:function(){return this.original._localBounds?(this._localBoundsProxy||(this._localBoundsProxy=new a),this._localBoundsProxy.wrap(this.original._localBounds),this._localBoundsProxy):(this._localBoundsProxy.wrap(null),null)}},alpha:{get:function(){return this.original.alpha}},isRaycastCheckingBoundsFirst:{get:function(){return this.original.isRaycastCheckingBoundsFirst}},isRaycastPossible:{get:function(){return this.original.isRaycastPossible}},filterArea:{get:function(){return this.original.filterArea}},hitArea:{get:function(){return this.original.hitArea}},_mask:{get:function(){return this.original._mask}},_events:{get:function(){return this.original._events}},visible:{get:function(){return this.original.visible}},zIndex:{get:function(){return this.original.zIndex}}}),i.prototype.swapContext=function(){var t=this.original,e=t.projectedTransform,r=t.worldProjection,i=t._currentBounds,n=t.worldAlpha,o=t.renderable,s=t.proxyContext;t.projectedTransform=this.projectedTransform,t.worldProjection=this.worldProjection,t._currentBounds=this._currentBounds,t.worldAlpha=this.worldAlpha,t.renderable=this.renderable,t.proxyContext=this.proxyContext,this.projectedTransform=e,this.worldProjection=r,this._currentBounds=i,this.worldAlpha=n,this.renderable=o,this.proxyContext=s},i.prototype.renderWebGL=function(t){this.swapContext(),this.original.renderWebGL(t),this.swapContext()},i.prototype.renderCanvas=function(t){this.swapContext(),this.original.renderCanvas(t),this.swapContext()},i.prototype.updateTransform=function(){this.updateOrder=o.incUpdateOrder(),this.displayOrder=0,this._currentBounds=null,this.worldAlpha=this.alpha*this.parent.worldAlpha,this.worldProjection=this.parent.worldProjection},i.prototype.displayObjectUpdateTransform=i.prototype.updateTransform,i.prototype.containsLocalPoint=function(t){return this.original.containsLocalPoint(t)},i.prototype.getComputedBounds=function(){return this.original.getComputedBounds()},i.prototype.destroy=function(){},i.prototype.createProxy=function(){return new i(this)},i.prototype.getOriginal=function(){for(var t=this.original;t.original;)t=t.original;return t},i.prototype.emit=function(t,e){this.original.emit(t,e)},s.prototype.createProxy=function(){return new i(this)}},{"../math":103,"../utils":154,"./DisplayObject":84}],86:[function(t,e,r){function i(t,e,r,i){this._x=r||0,this._y=i||0,this.cb=t,this.scope=e}i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{x:{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))}},y:{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))}}}),i.prototype.set=function(t,e){var r=t||0,i=e||(0!==e?r:0);this._x===r&&this._y===i||(this._x=r,this._y=i,this.cb.call(this.scope))},i.prototype.copy=function(t){var e=t.x,r=t.y;this._x===e&&this._y===r||(this._x=e,this._y=r,this.cb.call(this.scope))},i.prototype.destroy=function(){this.cb=null,this.scope=null}},{}],87:[function(t,e,r){function i(){o.call(this),this.fillAlpha=1,this.lineWidth=0,this.lineColor=0,this.graphicsData=[],this.tint=16777215,this._prevTint=16777215,this.blendMode=d.BLEND_MODES.NORMAL,this.currentPath=null,this._webGL={},this.isMask=!1,this.boundsPadding=0,this._localBounds=new c.Rectangle(0,0,1,1),this.dirty=!0,this.glDirty=!1,this.boundsDirty=!0,this.cachedSpriteDirty=!1,this._spriteRect=null,this._fastRect=!1,this._localBounds=new u,this._localBounds.local.size=4,this.isRaycastCheckingBoundsFirst=!0,this.isRaycastPossible=!0}var n,o=t("../display/Container"),s=t("../textures/RenderTexture"),a=t("../textures/Texture"),h=t("./GraphicsData"),u=t("../c2d/GeometrySet"),l=t("../sprites/Sprite"),c=t("../math"),d=t("../const"),p=t("./utils/bezierCurveTo"),f=t("../renderers/canvas/CanvasRenderer"),y=new c.Matrix;i._SPRITE_TEXTURE=null,i.prototype=Object.create(o.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){var t=new i;t.renderable=this.renderable,t.fillAlpha=this.fillAlpha,t.lineWidth=this.lineWidth,t.lineColor=this.lineColor,t.tint=this.tint,t.blendMode=this.blendMode,t.isMask=this.isMask,t.boundsPadding=this.boundsPadding,t.dirty=!0,t.glDirty=!0,t.cachedSpriteDirty=this.cachedSpriteDirty;for(var e=0;e<this.graphicsData.length;++e)t.graphicsData.push(this.graphicsData[e].clone());return t.currentPath=t.graphicsData[t.graphicsData.length-1],t.updateLocalBounds(),t},i.prototype.lineStyle=function(t,e,r){if(this.lineWidth=t||0,this.lineColor=e||0,this.lineAlpha=void 0===r?1:r,this.currentPath)if(this.currentPath.shape.points.length){var i=new c.Polygon(this.currentPath.shape.points.slice(-2));i.closed=!1,this.drawShape(i)}else this.currentPath.lineWidth=this.lineWidth,this.currentPath.lineColor=this.lineColor,this.currentPath.lineAlpha=this.lineAlpha;return this},i.prototype.moveTo=function(t,e){var r=new c.Polygon([t,e]);return r.closed=!1,this.drawShape(r),this},i.prototype.lineTo=function(t,e){return this.currentPath.shape.points.push(t,e),this.dirty=!0,this},i.prototype.quadraticCurveTo=function(t,e,r,i){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);
  var n,o,s=20,a=this.currentPath.shape.points;0===a.length&&this.moveTo(0,0);for(var h=a[a.length-2],u=a[a.length-1],l=0,c=1;c<=s;++c)l=c/s,n=h+(t-h)*l,o=u+(e-u)*l,a.push(n+(t+(r-t)*l-n)*l,o+(e+(i-e)*l-o)*l);return this.dirty=this.boundsDirty=!0,this},i.prototype.bezierCurveTo=function(t,e,r,i,n,o){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);var s=this.currentPath.shape.points,a=s[s.length-2],h=s[s.length-1];return s.length-=2,p(a,h,t,e,r,i,n,o,s),this.dirty=this.boundsDirty=!0,this},i.prototype.arcTo=function(t,e,r,i,n){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(t,e):this.moveTo(t,e);var o=this.currentPath.shape.points,s=o[o.length-2],a=o[o.length-1],h=a-e,u=s-t,l=i-e,c=r-t,d=Math.abs(h*c-u*l);if(d<1e-8||0===n)o[o.length-2]===t&&o[o.length-1]===e||o.push(t,e);else{var p=h*h+u*u,f=l*l+c*c,y=h*l+u*c,m=n*Math.sqrt(p)/d,v=n*Math.sqrt(f)/d,x=m*y/p,g=v*y/f,_=m*c+v*u,b=m*l+v*h,T=u*(v+x),M=h*(v+x),S=c*(m+g),w=l*(m+g),E=Math.atan2(M-b,T-_),D=Math.atan2(w-b,S-_);this.arc(_+t,b+e,n,E,D,u*l>c*h)}return this.dirty=this.boundsDirty=!0,this},i.prototype.arc=function(t,e,r,i,n,o){if(o=o||!1,i===n)return this;!o&&n<=i?n+=2*Math.PI:o&&i<=n&&(i+=2*Math.PI);var s=o?(i-n)*-1:n-i,a=40*Math.ceil(Math.abs(s)/(2*Math.PI));if(0===s)return this;var h=t+Math.cos(i)*r,u=e+Math.sin(i)*r;this.currentPath?this.currentPath.shape.points.push(h,u):this.moveTo(h,u);for(var l=this.currentPath.shape.points,c=s/(2*a),d=2*c,p=Math.cos(c),f=Math.sin(c),y=a-1,m=y%1/y,v=0;v<=y;v++){var x=v+m*v,g=c+i+d*x,_=Math.cos(g),b=-Math.sin(g);l.push((p*_+f*b)*r+t,(p*-b+f*_)*r+e)}return this.dirty=this.boundsDirty=!0,this},i.prototype.beginFill=function(t,e){return this.filling=!0,this.fillColor=t||0,this.fillAlpha=void 0===e?1:e,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},i.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},i.prototype.drawRect=function(t,e,r,i){return this.drawShape(new c.Rectangle(t,e,r,i)),this},i.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new c.RoundedRectangle(t,e,r,i,n)),this},i.prototype.drawCircle=function(t,e,r){return this.drawShape(new c.Circle(t,e,r)),this},i.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new c.Ellipse(t,e,r,i)),this},i.prototype.drawPolygon=function(t){var e=t,r=!0;if(e instanceof c.Polygon&&(r=e.closed,e=e.points),!Array.isArray(e)){e=new Array(arguments.length);for(var i=0;i<e.length;++i)e[i]=arguments[i]}var n=new c.Polygon(e);return n.closed=r,this.drawShape(n),this},i.prototype.clear=function(){return this.lineWidth=0,this.filling=!1,this.dirty=!0,this.clearDirty=!0,this.graphicsData=[],this},i.prototype._renderWebGL=function(t){this.glDirty&&(this.dirty=!0,this.glDirty=!1,this._fastRect=1===this.graphicsData.length&&this.graphicsData[0].shape.type===d.SHAPES.RECT&&!this.graphicsData[0].lineWidth),this._fastRect?this._renderSpriteRect(t):(t.setObjectRenderer(t.plugins.graphics),t.plugins.graphics.render(this))},i.prototype._renderSpriteRect=function(t){var e=this.graphicsData[0].shape;if(!this._spriteRect){if(!i._SPRITE_TEXTURE){i._SPRITE_TEXTURE=s.create(10,10);var r=t._activeRenderTarget;t.bindRenderTexture(i._SPRITE_TEXTURE),t.clear([1,1,1,1]),t.bindRenderTarget(r)}this._spriteRect=new l(i._SPRITE_TEXTURE),this._spriteRect.tint=this.graphicsData[0].fillColor,this._spriteRect.alpha=this.graphicsData[0].fillAlpha}this._spriteRect.worldAlpha=this.worldAlpha*this._spriteRect.alpha,this._spriteRect.computedTransform=this.computedTransform,this._spriteRect.anchor.x=-e.x/e.width,this._spriteRect.anchor.y=-e.y/e.height,this._spriteRect.size.x=e.width,this._spriteRect.size.y=e.height,this._spriteRect.calculateVertices(),this._spriteRect._renderWebGL(t)},i.prototype._renderCanvas=function(t){this.isMask!==!0&&t.plugins.graphics.render(this)},i.prototype.getBounds=function(){if(!this._currentBounds){if(!this.renderable)return c.Rectangle.EMPTY;this.boundsDirty&&(this.updateLocalBounds(),this.glDirty=!0,this.cachedSpriteDirty=!0,this.boundsDirty=!1),this._currentBounds=this._localBounds.getBounds(this.computedTransform,this.worldProjection)}return this._currentBounds},i.prototype.getLocalBounds=function(){return this.boundsDirty&&(this.updateLocalBounds(),this.glDirty=!0,this.cachedSpriteDirty=!0,this.boundsDirty=!1),this._localBounds.local.getBounds()},i.prototype.containsLocalPoint=function(t){if(!this.getLocalBounds().contains(t.x,t.y))return!1;for(var e=this.graphicsData,r=0;r<e.length;r++){var i=e[r];if(i.fill&&i.shape&&i.shape.contains(t.x,t.y))return!0}return!1},i.prototype.updateLocalBounds=function(){var t=1/0,e=-(1/0),r=1/0,i=-(1/0);if(!this.graphicsData.length)return void(this._localBounds.local.size=0);for(var n,o,s,a,h,u,l=0;l<this.graphicsData.length;l++){var c=this.graphicsData[l],p=c.type,f=c.lineWidth;if(n=c.shape,p===d.SHAPES.RECT||p===d.SHAPES.RREC)s=n.x-f/2,a=n.y-f/2,h=n.width+f,u=n.height+f,t=s<t?s:t,e=s+h>e?s+h:e,r=a<r?a:r,i=a+u>i?a+u:i;else if(p===d.SHAPES.CIRC)s=n.x,a=n.y,h=n.radius+f/2,u=n.radius+f/2,t=s-h<t?s-h:t,e=s+h>e?s+h:e,r=a-u<r?a-u:r,i=a+u>i?a+u:i;else if(p===d.SHAPES.ELIP)s=n.x,a=n.y,h=n.width+f/2,u=n.height+f/2,t=s-h<t?s-h:t,e=s+h>e?s+h:e,r=a-u<r?a-u:r,i=a+u>i?a+u:i;else{o=n.points;for(var y=0;y<o.length;y+=2)s=o[y],a=o[y+1],t=s-f<t?s-f:t,e=s+f>e?s+f:e,r=a-f<r?a-f:r,i=a+f>i?a+f:i}}var m=this.boundsPadding;this._localBounds.local.setRectCoords(0,t-m,r+m,e-m,i+m)},i.prototype.drawShape=function(t){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null;var e=new h(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,t);return this.graphicsData.push(e),e.type===d.SHAPES.POLY&&(e.shape.closed=e.shape.closed||this.filling,this.currentPath=e),this.dirty=this.boundsDirty=!0,e},i.prototype.generateCanvasTexture=function(t,e){e=e||1;var r=this._legacyLocalBounds(),i=new s.create(r.width*e,r.height*e);n||(n=new f),y.tx=-r.x,y.ty=-r.y,n.render(this,i,!1,y);var o=a.fromCanvas(i.baseTexture._canvasRenderTarget.canvas,t);return o.baseTexture.resolution=e,o},i.prototype.closePath=function(){var t=this.currentPath;return t&&t.shape&&t.shape.close(),this},i.prototype.addHole=function(){var t=this.graphicsData.pop();return this.currentPath=this.graphicsData[this.graphicsData.length-1],this.currentPath.addHole(t.shape),this.currentPath=null,this},i.prototype.destroy=function(){o.prototype.destroy.apply(this,arguments);for(var t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();for(var e in this._webgl)for(var r=0;r<this._webgl[e].data.length;++r)this._webgl[e].data[r].destroy();this._spriteRect&&this._spriteRect.destroy(),this.graphicsData=null,this.currentPath=null,this._webgl=null,this._localBounds=null}},{"../c2d/GeometrySet":59,"../const":79,"../display/Container":82,"../math":103,"../renderers/canvas/CanvasRenderer":110,"../sprites/Sprite":133,"../textures/RenderTexture":146,"../textures/Texture":147,"./GraphicsData":88,"./utils/bezierCurveTo":90}],88:[function(t,e,r){function i(t,e,r,i,n,o,s){this.lineWidth=t,this.lineColor=e,this.lineAlpha=r,this._lineTint=e,this.fillColor=i,this.fillAlpha=n,this._fillTint=i,this.fill=o,this.holes=[],this.shape=s,this.type=s.type}i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.fill,this.shape)},i.prototype.addHole=function(t){this.holes.push(t)},i.prototype.destroy=function(){this.shape=null,this.holes=null}},{}],89:[function(t,e,r){function i(t){this.renderer=t}var n=t("../../renderers/canvas/CanvasRenderer"),o=t("../../const");i.prototype.constructor=i,e.exports=i,n.registerPlugin("graphics",i),i.prototype.render=function(t){var e=this.renderer,r=e.context,i=t.worldAlpha,n=t.projectionMatrix2d,s=e.resolution;this._prevTint!==this.tint&&(this.dirty=!0),r.setTransform(n.a*s,n.b*s,n.c*s,n.d*s,n.tx*s,n.ty*s),t.dirty&&(this.updateGraphicsTint(t),t.dirty=!1),e.setBlendMode(t.blendMode);for(var a=0;a<t.graphicsData.length;a++){var h=t.graphicsData[a],u=h.shape,l=h._fillTint,c=h._lineTint;if(r.lineWidth=h.lineWidth,h.type===o.SHAPES.POLY){r.beginPath(),this.renderPolygon(u.points,u.closed,r);for(var d=0;d<h.holes.length;d++){var p=h.holes[d];this.renderPolygon(p.points,!0,r)}h.fill&&(r.globalAlpha=h.fillAlpha*i,r.fillStyle="#"+("00000"+(0|l).toString(16)).substr(-6),r.fill()),h.lineWidth&&(r.globalAlpha=h.lineAlpha*i,r.strokeStyle="#"+("00000"+(0|c).toString(16)).substr(-6),r.stroke())}else if(h.type===o.SHAPES.RECT)(h.fillColor||0===h.fillColor)&&(r.globalAlpha=h.fillAlpha*i,r.fillStyle="#"+("00000"+(0|l).toString(16)).substr(-6),r.fillRect(u.x,u.y,u.width,u.height)),h.lineWidth&&(r.globalAlpha=h.lineAlpha*i,r.strokeStyle="#"+("00000"+(0|c).toString(16)).substr(-6),r.strokeRect(u.x,u.y,u.width,u.height));else if(h.type===o.SHAPES.CIRC)r.beginPath(),r.arc(u.x,u.y,u.radius,0,2*Math.PI),r.closePath(),h.fill&&(r.globalAlpha=h.fillAlpha*i,r.fillStyle="#"+("00000"+(0|l).toString(16)).substr(-6),r.fill()),h.lineWidth&&(r.globalAlpha=h.lineAlpha*i,r.strokeStyle="#"+("00000"+(0|c).toString(16)).substr(-6),r.stroke());else if(h.type===o.SHAPES.ELIP){var f=2*u.width,y=2*u.height,m=u.x-f/2,v=u.y-y/2;r.beginPath();var x=.5522848,g=f/2*x,_=y/2*x,b=m+f,T=v+y,M=m+f/2,S=v+y/2;r.moveTo(m,S),r.bezierCurveTo(m,S-_,M-g,v,M,v),r.bezierCurveTo(M+g,v,b,S-_,b,S),r.bezierCurveTo(b,S+_,M+g,T,M,T),r.bezierCurveTo(M-g,T,m,S+_,m,S),r.closePath(),h.fill&&(r.globalAlpha=h.fillAlpha*i,r.fillStyle="#"+("00000"+(0|l).toString(16)).substr(-6),r.fill()),h.lineWidth&&(r.globalAlpha=h.lineAlpha*i,r.strokeStyle="#"+("00000"+(0|c).toString(16)).substr(-6),r.stroke())}else if(h.type===o.SHAPES.RREC){var w=u.x,E=u.y,D=u.width,C=u.height,P=u.radius,O=Math.min(D,C)/2|0;P=P>O?O:P,r.beginPath(),r.moveTo(w,E+P),r.lineTo(w,E+C-P),r.quadraticCurveTo(w,E+C,w+P,E+C),r.lineTo(w+D-P,E+C),r.quadraticCurveTo(w+D,E+C,w+D,E+C-P),r.lineTo(w+D,E+P),r.quadraticCurveTo(w+D,E,w+D-P,E),r.lineTo(w+P,E),r.quadraticCurveTo(w,E,w,E+P),r.closePath(),(h.fillColor||0===h.fillColor)&&(r.globalAlpha=h.fillAlpha*i,r.fillStyle="#"+("00000"+(0|l).toString(16)).substr(-6),r.fill()),h.lineWidth&&(r.globalAlpha=h.lineAlpha*i,r.strokeStyle="#"+("00000"+(0|c).toString(16)).substr(-6),r.stroke())}}},i.prototype.updateGraphicsTint=function(t){if(16777215!==t.tint||t._prevTint!==t.tint){t._prevTint=t.tint;for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,i=(255&t.tint)/255,n=0;n<t.graphicsData.length;n++){var o=t.graphicsData[n],s=0|o.fillColor,a=0|o.lineColor;o._fillTint=((s>>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255}}},i.prototype.renderPolygon=function(t,e,r){r.moveTo(t[0],t[1]);for(var i=1;i<t.length/2;i++)r.lineTo(t[2*i],t[2*i+1]);e&&r.closePath()},i.prototype.destroy=function(){this.renderer=null}},{"../../const":79,"../../renderers/canvas/CanvasRenderer":110}],90:[function(t,e,r){var i=function(t,e,r,i,n,o,s,a,h){h=h||[];var u,l,c,d,p,f=20;h.push(t,e);for(var y=0,m=1;m<=f;++m)y=m/f,u=1-y,l=u*u,c=l*u,d=y*y,p=d*y,h.push(c*t+3*l*y*r+3*u*d*n+p*s,c*e+3*l*y*i+3*u*d*o+p*a);return h};e.exports=i},{}],91:[function(t,e,r){function i(t){s.call(this,t),this.graphicsDataPool=[],this.primitiveShader=null,this.gl=t.gl,this.CONTEXT_UID=0}var n=t("../../utils"),o=t("../../const"),s=t("../../renderers/webgl/utils/ObjectRenderer"),a=t("../../renderers/webgl/WebGLRenderer"),h=t("./WebGLGraphicsData"),u=t("./shaders/PrimitiveShader"),l=t("./utils/buildPoly"),c=t("./utils/buildRectangle"),d=t("./utils/buildRoundedRectangle"),p=t("./utils/buildCircle");i.prototype=Object.create(s.prototype),i.prototype.constructor=i,e.exports=i,a.registerPlugin("graphics",i),i.prototype.onContextChange=function(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.primitiveShader=new u(this.gl)},i.prototype.destroy=function(){s.prototype.destroy.call(this);for(var t=0;t<this.graphicsDataPool.length;++t)this.graphicsDataPool[t].destroy();this.graphicsDataPool=null},i.prototype.render=function(t){var e,r=this.renderer,i=r.gl;!t.dirty&&t._webGL[this.CONTEXT_UID]||this.updateGraphics(t);var o=t._webGL[this.CONTEXT_UID],s=this.primitiveShader;r.bindShader(s),r.bindProjection(t.worldProjection),r.state.setBlendMode(t.blendMode);for(var a=0,h=o.data.length;a<h;a++){e=o.data[a];var u=e.shader;r.bindShader(u),u.setUniformMatrix("translationMatrix",t.computedTransform.matrix),u.uniforms.tint=n.hex2rgb(t.tint),u.uniforms.alpha=t.worldAlpha,e.vao.bind().draw(i.TRIANGLE_STRIP,e.indices.length).unbind()}},i.prototype.updateGraphics=function(t){var e=this.renderer.gl,r=t._webGL[this.CONTEXT_UID];r||(r=t._webGL[this.CONTEXT_UID]={lastIndex:0,data:[],gl:e}),t.dirty=!1;var i;if(t.clearDirty){for(t.clearDirty=!1,i=0;i<r.data.length;i++){var n=r.data[i];this.graphicsDataPool.push(n)}r.data=[],r.lastIndex=0}var s;for(i=r.lastIndex;i<t.graphicsData.length;i++){var a=t.graphicsData[i];s=this.getWebGLData(r,0),a.type===o.SHAPES.POLY&&l(a,s),a.type===o.SHAPES.RECT?c(a,s):a.type===o.SHAPES.CIRC||a.type===o.SHAPES.ELIP?p(a,s):a.type===o.SHAPES.RREC&&d(a,s),r.lastIndex++}for(i=0;i<r.data.length;i++)s=r.data[i],s.dirty&&s.upload()},i.prototype.getWebGLData=function(t,e){var r=t.data[t.data.length-1];return(!r||r.points.length>32e4)&&(r=this.graphicsDataPool.pop()||new h(this.renderer.gl,this.primitiveShader,this.renderer.state.attribsState),r.reset(e),t.data.push(r)),r.dirty=!0,r}},{"../../const":79,"../../renderers/webgl/WebGLRenderer":117,"../../renderers/webgl/utils/ObjectRenderer":127,"../../utils":154,"./WebGLGraphicsData":92,"./shaders/PrimitiveShader":93,"./utils/buildCircle":94,"./utils/buildPoly":96,"./utils/buildRectangle":97,"./utils/buildRoundedRectangle":98}],92:[function(t,e,r){function i(t,e,r){this.gl=t,this.color=[0,0,0],this.points=[],this.indices=[],this.buffer=n.GLBuffer.createVertexBuffer(t),this.indexBuffer=n.GLBuffer.createIndexBuffer(t),this.dirty=!0,this.glPoints=null,this.glIndices=null,this.shader=e,this.vao=new n.VertexArrayObject(t,r).addIndex(this.indexBuffer).addAttribute(this.buffer,e.attributes.aVertexPosition,t.FLOAT,!1,24,0).addAttribute(this.buffer,e.attributes.aColor,t.FLOAT,!1,24,8)}var n=t("pixi-gl-core");i.prototype.constructor=i,e.exports=i,i.prototype.reset=function(){this.points.length=0,this.indices.length=0},i.prototype.upload=function(){this.glPoints=new Float32Array(this.points),this.buffer.upload(this.glPoints),this.glIndices=new Uint16Array(this.indices),this.indexBuffer.upload(this.glIndices),this.dirty=!1},i.prototype.destroy=function(){this.color=null,this.points=null,this.indices=null,this.vao.destroy(),this.buffer.destroy(),this.indexBuffer.destroy(),this.gl=null,this.buffer=null,this.indexBuffer=null,this.glPoints=null,this.glIndices=null}},{"pixi-gl-core":25}],93:[function(t,e,r){function i(t){n.call(this,t,["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat4 translationMatrix;","uniform mat4 projectionMatrix;","uniform float alpha;","uniform vec3 tint;","varying vec4 vColor;","void main(void){","   gl_Position = projectionMatrix * translationMatrix * vec4(aVertexPosition, 0.0, 1.0);","   vColor = aColor * vec4(tint * alpha, alpha);","}"].join("\n"),["varying vec4 vColor;","void main(void){","   gl_FragColor = vColor;","}"].join("\n"))}var n=t("../../../Shader");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i},{"../../../Shader":53}],94:[function(t,e,r){var i=t("./buildLine"),n=t("../../../const"),o=t("../../../utils"),s=function(t,e){var r,s,a=t.shape,h=a.x,u=a.y;t.type===n.SHAPES.CIRC?(r=a.radius,s=a.radius):(r=a.width,s=a.height);var l=Math.floor(30*Math.sqrt(a.radius))||Math.floor(15*Math.sqrt(a.width+a.height)),c=2*Math.PI/l,d=0;if(t.fill){var p=o.hex2rgb(t.fillColor),f=t.fillAlpha,y=p[0]*f,m=p[1]*f,v=p[2]*f,x=e.points,g=e.indices,_=x.length/6;for(g.push(_),d=0;d<l+1;d++)x.push(h,u,y,m,v,f),x.push(h+Math.sin(c*d)*r,u+Math.cos(c*d)*s,y,m,v,f),g.push(_++,_++);g.push(_-1)}if(t.lineWidth){var b=t.points;for(t.points=[],d=0;d<l+1;d++)t.points.push(h+Math.sin(c*d)*r,u+Math.cos(c*d)*s);i(t,e),t.points=b}};e.exports=s},{"../../../const":79,"../../../utils":154,"./buildLine":95}],95:[function(t,e,r){var i=t("../../../math"),n=t("../../../utils"),o=function(t,e){var r=0,o=t.points;if(0!==o.length){var s=new i.Point(o[0],o[1]),a=new i.Point(o[o.length-2],o[o.length-1]);if(s.x===a.x&&s.y===a.y){o=o.slice(),o.pop(),o.pop(),a=new i.Point(o[o.length-2],o[o.length-1]);var h=a.x+.5*(s.x-a.x),u=a.y+.5*(s.y-a.y);o.unshift(h,u),o.push(h,u)}var l,c,d,p,f,y,m,v,x,g,_,b,T,M,S,w,E,D,C,P,O,R,I,A=e.points,F=e.indices,L=o.length/2,B=o.length,j=A.length/6,N=t.lineWidth/2,U=n.hex2rgb(t.lineColor),k=t.lineAlpha,z=U[0]*k,G=U[1]*k,V=U[2]*k;for(d=o[0],p=o[1],f=o[2],y=o[3],x=-(p-y),g=d-f,I=Math.sqrt(x*x+g*g),x/=I,g/=I,x*=N,g*=N,A.push(d-x,p-g,z,G,V,k),A.push(d+x,p+g,z,G,V,k),r=1;r<L-1;r++)d=o[2*(r-1)],p=o[2*(r-1)+1],f=o[2*r],y=o[2*r+1],m=o[2*(r+1)],v=o[2*(r+1)+1],x=-(p-y),g=d-f,I=Math.sqrt(x*x+g*g),x/=I,g/=I,x*=N,g*=N,_=-(y-v),b=f-m,I=Math.sqrt(_*_+b*b),_/=I,b/=I,_*=N,b*=N,S=-g+p-(-g+y),w=-x+f-(-x+d),E=(-x+d)*(-g+y)-(-x+f)*(-g+p),D=-b+v-(-b+y),C=-_+f-(-_+m),P=(-_+m)*(-b+y)-(-_+f)*(-b+v),O=S*C-D*w,Math.abs(O)<.1?(O+=10.1,A.push(f-x,y-g,z,G,V,k),A.push(f+x,y+g,z,G,V,k)):(l=(w*P-C*E)/O,c=(D*E-S*P)/O,R=(l-f)*(l-f)+(c-y)*(c-y),R>19600?(T=x-_,M=g-b,I=Math.sqrt(T*T+M*M),T/=I,M/=I,T*=N,M*=N,A.push(f-T,y-M),A.push(z,G,V,k),A.push(f+T,y+M),A.push(z,G,V,k),A.push(f-T,y-M),A.push(z,G,V,k),B++):(A.push(l,c),A.push(z,G,V,k),A.push(f-(l-f),y-(c-y)),A.push(z,G,V,k)));for(d=o[2*(L-2)],p=o[2*(L-2)+1],f=o[2*(L-1)],y=o[2*(L-1)+1],x=-(p-y),g=d-f,I=Math.sqrt(x*x+g*g),x/=I,g/=I,x*=N,g*=N,A.push(f-x,y-g),A.push(z,G,V,k),A.push(f+x,y+g),A.push(z,G,V,k),F.push(j),r=0;r<B;r++)F.push(j++);F.push(j-1)}};e.exports=o},{"../../../math":103,"../../../utils":154}],96:[function(t,e,r){var i=t("./buildLine"),n=t("../../../utils"),o=t("earcut"),s=function(t,e){t.points=t.shape.points.slice();var r=t.points;if(t.fill&&r.length>6){for(var s=[],a=t.holes,h=0;h<a.length;h++){var u=a[h];s.push(r.length/2),r=r.concat(u.points)}var l=e.points,c=e.indices,d=r.length/2,p=n.hex2rgb(t.fillColor),f=t.fillAlpha,y=p[0]*f,m=p[1]*f,v=p[2]*f,x=o(r,s,2);if(!x)return;var g=l.length/6;for(h=0;h<x.length;h+=3)c.push(x[h]+g),c.push(x[h]+g),c.push(x[h+1]+g),c.push(x[h+2]+g),c.push(x[h+2]+g);for(h=0;h<d;h++)l.push(r[2*h],r[2*h+1],y,m,v,f)}t.lineWidth>0&&i(t,e)};e.exports=s},{"../../../utils":154,"./buildLine":95,earcut:3}],97:[function(t,e,r){var i=t("./buildLine"),n=t("../../../utils"),o=function(t,e){var r=t.shape,o=r.x,s=r.y,a=r.width,h=r.height;if(t.fill){var u=n.hex2rgb(t.fillColor),l=t.fillAlpha,c=u[0]*l,d=u[1]*l,p=u[2]*l,f=e.points,y=e.indices,m=f.length/6;f.push(o,s),f.push(c,d,p,l),f.push(o+a,s),f.push(c,d,p,l),f.push(o,s+h),f.push(c,d,p,l),f.push(o+a,s+h),f.push(c,d,p,l),y.push(m,m,m+1,m+2,m+3,m+3)}if(t.lineWidth){var v=t.points;t.points=[o,s,o+a,s,o+a,s+h,o,s+h,o,s],i(t,e),t.points=v}};e.exports=o},{"../../../utils":154,"./buildLine":95}],98:[function(t,e,r){var i=t("earcut"),n=t("./buildLine"),o=t("../../../utils"),s=function(t,e){var r=t.shape,s=r.x,h=r.y,u=r.width,l=r.height,c=r.radius,d=[];if(d.push(s,h+c),a(s,h+l-c,s,h+l,s+c,h+l,d),a(s+u-c,h+l,s+u,h+l,s+u,h+l-c,d),a(s+u,h+c,s+u,h,s+u-c,h,d),a(s+c,h,s,h,s,h+c+1e-10,d),t.fill){var p=o.hex2rgb(t.fillColor),f=t.fillAlpha,y=p[0]*f,m=p[1]*f,v=p[2]*f,x=e.points,g=e.indices,_=x.length/6,b=i(d,null,2),T=0;for(T=0;T<b.length;T+=3)g.push(b[T]+_),g.push(b[T]+_),g.push(b[T+1]+_),g.push(b[T+2]+_),g.push(b[T+2]+_);for(T=0;T<d.length;T++)x.push(d[T],d[++T],y,m,v,f)}if(t.lineWidth){var M=t.points;t.points=d,n(t,e),t.points=M}},a=function(t,e,r,i,n,o,s){function a(t,e,r){var i=e-t;return t+i*r}for(var h,u,l,c,d,p,f=20,y=s||[],m=0,v=0;v<=f;v++)m=v/f,h=a(t,r,m),u=a(e,i,m),l=a(r,n,m),c=a(i,o,m),d=a(h,l,m),p=a(u,c,m),y.push(d,p);return y};e.exports=s},{"../../../utils":154,"./buildLine":95,earcut:3}],99:[function(t,e,r){var i=e.exports=Object.assign(t("./const"),t("./math"),t("./c2d"),t("./c3d"),{utils:t("./utils"),ticker:t("./ticker"),DisplayObject:t("./display/DisplayObject"),ObservablePoint:t("./display/ObservablePoint"),Container:t("./display/Container"),Camera2d:t("./display/Camera2d"),DisplayObjectProxy:t("./display/DisplayObjectProxy"),ContainerProxy:t("./display/ContainerProxy"),CameraProxy:t("./display/CameraProxy"),Sprite:t("./sprites/Sprite"),SpriteFrame:t("./sprites/SpriteFrame"),CanvasSpriteRender:t("./sprites/canvas/CanvasSpriteRenderer"),CanvasTinter:t("./sprites/canvas/CanvasTinter"),SpriteRenderer:t("./sprites/webgl/SpriteRenderer"),Text:t("./text/Text"),TextStyle:t("./text/TextStyle"),Graphics:t("./graphics/Graphics"),GraphicsData:t("./graphics/GraphicsData"),GraphicsRenderer:t("./graphics/webgl/GraphicsRenderer"),CanvasGraphicsRenderer:t("./graphics/canvas/CanvasGraphicsRenderer"),Texture:t("./textures/Texture"),ObservableRect:t("./textures/ObservableRect"),DoubleRect:t("./textures/DoubleRect"),BaseTexture:t("./textures/BaseTexture"),RenderTexture:t("./textures/RenderTexture"),BaseRenderTexture:t("./textures/BaseRenderTexture"),VideoBaseTexture:t("./textures/VideoBaseTexture"),TextureUvs:t("./textures/TextureUvs"),CanvasRenderer:t("./renderers/canvas/CanvasRenderer"),CanvasRenderTarget:t("./renderers/canvas/utils/CanvasRenderTarget"),Shader:t("./Shader"),WebGLRenderer:t("./renderers/webgl/WebGLRenderer"),WebGLManager:t("./renderers/webgl/managers/WebGLManager"),ObjectRenderer:t("./renderers/webgl/utils/ObjectRenderer"),RenderTarget:t("./renderers/webgl/utils/RenderTarget"),Quad:t("./renderers/webgl/utils/Quad"),SpriteMaskFilter:t("./renderers/webgl/filters/spriteMask/SpriteMaskFilter"),Filter:t("./renderers/webgl/filters/Filter"),glCore:t("pixi-gl-core"),autoDetectRenderer:function(t,e,r,n){return t=t||800,e=e||600,!n&&i.utils.isWebGLSupported()?new i.WebGLRenderer(t,e,r):new i.CanvasRenderer(t,e,r)}})},{"./Shader":53,"./c2d":64,"./c3d":78,"./const":79,"./display/Camera2d":80,"./display/CameraProxy":81,"./display/Container":82,"./display/ContainerProxy":83,"./display/DisplayObject":84,"./display/DisplayObjectProxy":85,"./display/ObservablePoint":86,"./graphics/Graphics":87,"./graphics/GraphicsData":88,"./graphics/canvas/CanvasGraphicsRenderer":89,"./graphics/webgl/GraphicsRenderer":91,"./math":103,"./renderers/canvas/CanvasRenderer":110,"./renderers/canvas/utils/CanvasRenderTarget":112,"./renderers/webgl/WebGLRenderer":117,"./renderers/webgl/filters/Filter":119,"./renderers/webgl/filters/spriteMask/SpriteMaskFilter":122,"./renderers/webgl/managers/WebGLManager":126,"./renderers/webgl/utils/ObjectRenderer":127,"./renderers/webgl/utils/Quad":128,"./renderers/webgl/utils/RenderTarget":129,"./sprites/Sprite":133,"./sprites/SpriteFrame":134,"./sprites/canvas/CanvasSpriteRenderer":135,"./sprites/canvas/CanvasTinter":136,"./sprites/webgl/SpriteRenderer":138,"./text/Text":140,"./text/TextStyle":141,"./textures/BaseRenderTexture":142,"./textures/BaseTexture":143,"./textures/DoubleRect":144,"./textures/ObservableRect":145,"./textures/RenderTexture":146,"./textures/Texture":147,"./textures/TextureUvs":148,"./textures/VideoBaseTexture":149,"./ticker":151,"./utils":154,"pixi-gl-core":25}],100:[function(t,e,r){function i(t){return t<0?-1:t>0?1:0}function n(){for(var t=0;t<16;t++){var e=[];c.push(e);for(var r=0;r<16;r++)for(var n=i(o[t]*o[r]+a[t]*s[r]),d=i(s[t]*o[r]+h[t]*s[r]),p=i(o[t]*a[r]+a[t]*h[r]),f=i(s[t]*a[r]+h[t]*h[r]),y=0;y<16;y++)if(o[y]===n&&s[y]===d&&a[y]===p&&h[y]===f){e.push(y);break}}for(t=0;t<16;t++){var m=new l;m.set(o[t],s[t],a[t],h[t],0,0),u.push(m)}}var o=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],s=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],a=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],h=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],u=[],l=t("./Matrix"),c=[];n();var d={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return o[t]},uY:function(t){return s[t]},vX:function(t){return a[t]},vY:function(t){return h[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return c[t][e]},sub:function(t,e){return c[t][d.inv(e)]},rotate180:function(t){return 4^t},isSwapWidthHeight:function(t){return 2===(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?d.S:d.N:2*Math.abs(e)<=Math.abs(t)?t>0?d.E:d.W:e>0?t>0?d.SE:d.SW:t>0?d.NE:d.NW},matrixAppendRotationInv:function(t,e,r,i){var n=u[d.inv(e)];r=r||0,i=i||0,n.tx=r,n.ty=i,t.append(n)}};e.exports=d},{"./Matrix":101}],101:[function(t,e,r){function i(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0}var n=t("./Point");i.prototype.constructor=i,e.exports=i,i.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},i.prototype.set=function(t,e,r,i,n,o){return this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=o,this},i.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r},i.prototype.toMat4=function(t){return t=t||new Float32Array(16),t[0]=this.a,t[1]=this.b,t[2]=0,t[3]=0,t[4]=this.c,t[5]=this.d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=this.tx,t[13]=this.ty,t[14]=0,t[15]=1,t},i.prototype.copyFromMat4=function(t){var e=t[15];return this.a=t[0]/e,this.b=t[1]/e,this.c=t[4]/e,this.d=t[5]/e,this.tx=t[12]/e,this.ty=t[13]/e,this},i.prototype.invertMat4=function(t){t=t||new Float32Array(16);var e=this.a,r=this.b,i=this.c,n=this.d,o=this.tx,s=e*n-r*i;return t[0]=n/s,t[1]=-r/s,t[2]=0,t[3]=0,t[4]=-i/s,t[5]=e/s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=(i*this.ty-n*o)/s,t[13]=-(e*this.ty-r*o)/s,t[14]=0,t[15]=1,this},i.prototype.apply=function(t,e){e=e||new n;var r=t.x,i=t.y;return e.x=this.a*r+this.c*i+this.tx,e.y=this.b*r+this.d*i+this.ty,e},i.prototype.applyInverse=function(t,e){e=e||new n;var r=1/(this.a*this.d+this.c*-this.b),i=t.x,o=t.y;return e.x=this.d*r*i+-this.c*r*o+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*o+-this.b*r*i+(-this.ty*this.a+this.tx*this.b)*r,e},i.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},i.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},i.prototype.rotate=function(t){var e=Math.cos(t),r=Math.sin(t),i=this.a,n=this.c,o=this.tx;return this.a=i*e-this.b*r,this.b=i*r+this.b*e,this.c=n*e-this.d*r,this.d=n*r+this.d*e,this.tx=o*e-this.ty*r,this.ty=o*r+this.ty*e,this},i.prototype.append=function(t){var e=this.a,r=this.b,i=this.c,n=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*r+t.b*n,this.c=t.c*e+t.d*i,this.d=t.c*r+t.d*n,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*r+t.ty*n+this.ty,this},i.prototype.setTransform=function(t,e,r,i,n,o,s,a,h){var u,l,c,d,p,f,y,m,v,x;return p=Math.sin(s),f=Math.cos(s),y=Math.cos(h),m=Math.sin(h),v=-Math.sin(a),x=Math.cos(a),u=f*n,l=p*n,c=-p*o,d=f*o,this.a=y*u+m*c,this.b=y*l+m*d,this.c=v*u+x*c,this.d=v*l+x*d,this.tx=t+(r*u+i*c),this.ty=e+(r*l+i*d),this},i.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var r=this.a,i=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},i.prototype.decompose=function(t){var e=this.a,r=this.b,i=this.c,n=this.d,o=Math.atan2(-i,n),s=Math.atan2(r,e),a=Math.abs(1-o/s);return a<1e-5?(t.rotation=s,e<0&&n>=0&&(t.rotation+=t.rotation<=0?Math.PI:-Math.PI),t.skew.x=t.skew.y=0):(t.skew.x=o,t.skew.y=s),t.scale.x=Math.sqrt(e*e+r*r),t.scale.y=Math.sqrt(i*i+n*n),t.position.x=this.tx,t.position.y=this.ty,t},i.prototype.invert=function(){var t=this.a,e=this.b,r=this.c,i=this.d,n=this.tx,o=t*i-e*r;return this.a=i/o,this.b=-e/o,this.c=-r/o,this.d=t/o,this.tx=(r*this.ty-i*n)/o,this.ty=-(t*this.ty-e*n)/o,this},i.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},i.prototype.clone=function(){var t=new i;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},i.prototype.copy=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},i.IDENTITY=new i,i.TEMP_MATRIX=new i},{"./Point":102}],102:[function(t,e,r){function i(t,e){this.x=t||0,this.y=e||0}i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.x,this.y)},i.prototype.copy=function(t){this.set(t.x,t.y)},i.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},i.prototype.set=function(t,e){this.x=t||0,this.y=e||(0!==e?this.x:0)}},{}],103:[function(t,e,r){e.exports={Point:t("./Point"),Matrix:t("./Matrix"),GroupD8:t("./GroupD8"),Circle:t("./shapes/Circle"),Ellipse:t("./shapes/Ellipse"),Polygon:t("./shapes/Polygon"),Rectangle:t("./shapes/Rectangle"),RoundedRectangle:t("./shapes/RoundedRectangle")}},{"./GroupD8":100,"./Matrix":101,"./Point":102,"./shapes/Circle":104,"./shapes/Ellipse":105,"./shapes/Polygon":106,"./shapes/Rectangle":107,"./shapes/RoundedRectangle":108}],104:[function(t,e,r){function i(t,e,r){this.x=t||0,this.y=e||0,this.radius=r||0,this.type=o.SHAPES.CIRC}var n=t("./Rectangle"),o=t("../../const");i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.x,this.y,this.radius)},i.prototype.contains=function(t,e){if(this.radius<=0)return!1;var r=this.x-t,i=this.y-e,n=this.radius*this.radius;return r*=r,i*=i,r+i<=n},i.prototype.getBounds=function(){return new n(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}},{"../../const":79,"./Rectangle":107}],105:[function(t,e,r){function i(t,e,r,i){this.x=t||0,this.y=e||0,this.width=r||0,this.height=i||0,this.type=o.SHAPES.ELIP}var n=t("./Rectangle"),o=t("../../const");i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var r=(t-this.x)/this.width,i=(e-this.y)/this.height;return r*=r,i*=i,r+i<=1},i.prototype.getBounds=function(){return new n(this.x-this.width,this.y-this.height,this.width,this.height)}},{"../../const":79,"./Rectangle":107}],106:[function(t,e,r){function i(t){var e=t;if(!Array.isArray(e)){e=new Array(arguments.length);for(var r=0;r<e.length;++r)e[r]=arguments[r]}if(e[0]instanceof n){for(var i=[],s=0,a=e.length;s<a;s++)i.push(e[s].x,e[s].y);e=i}this.closed=!0,this.points=e,this.type=o.SHAPES.POLY}var n=t("../Point"),o=t("../../const");i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.points.slice())},i.prototype.close=function(){var t=this.points;t[0]===t[t.length-2]&&t[1]===t[t.length-1]||t.push(t[0],t[1])},i.prototype.contains=function(t,e){for(var r=!1,i=this.points.length/2,n=0,o=i-1;n<i;o=n++){var s=this.points[2*n],a=this.points[2*n+1],h=this.points[2*o],u=this.points[2*o+1],l=a>e!=u>e&&t<(h-s)*(e-a)/(u-a)+s;l&&(r=!r)}return r}},{"../../const":79,"../Point":102}],107:[function(t,e,r){function i(t,e,r,i){this.x=t||0,this.y=e||0,this.width=r||0,this.height=i||0,this.type=n.SHAPES.RECT}var n=t("../../const");i.prototype.constructor=i,e.exports=i,i.EMPTY=new i(0,0,0,0),i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},i.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height)},i.prototype.pad=function(t,e){t=t||0,e=e||(0!==e?t:0),this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e},i.prototype.fit=function(t){this.x<t.x&&(this.width+=this.x,this.width<0&&(this.width=0),
  this.x=t.x),this.y<t.y&&(this.height+=this.y,this.height<0&&(this.height=0),this.y=t.y),this.x+this.width>t.x+t.width&&(this.width=t.width-this.x,this.width<0&&(this.width=0)),this.y+this.height>t.y+t.height&&(this.height=t.height-this.y,this.height<0&&(this.height=0))},i.prototype.enlarge=function(t){if(t!==i.EMPTY){var e=Math.min(this.x,t.x),r=Math.max(this.x+this.width,t.x+t.width),n=Math.min(this.y,t.y),o=Math.max(this.y+this.height,t.y+t.height);this.x=e,this.width=r-e,this.y=n,this.height=o-n}}},{"../../const":79}],108:[function(t,e,r){function i(t,e,r,i,o){this.x=t||0,this.y=e||0,this.width=r||0,this.height=i||0,this.radius=o||20,this.type=n.SHAPES.RREC}var n=t("../../const");i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.radius)},i.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height)}},{"../../const":79}],109:[function(t,e,r){function i(t,e,r,i){if(u.call(this),n.sayHello(t),i)for(var o in s.DEFAULT_RENDER_OPTIONS)"undefined"==typeof i[o]&&(i[o]=s.DEFAULT_RENDER_OPTIONS[o]);else i=s.DEFAULT_RENDER_OPTIONS;this.type=s.RENDERER_TYPE.UNKNOWN,this.width=e||800,this.height=r||600,this.view=i.view||document.createElement("canvas"),this.resolution=i.resolution,this.transparent=i.transparent,this.autoResize=i.autoResize||!1,this.blendModes=null,this.preserveDrawingBuffer=i.preserveDrawingBuffer,this.clearBeforeRender=i.clearBeforeRender,this.roundPixels=i.roundPixels,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=i.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new a,this._lastObjectRendered=this._tempDisplayObjectParent}var n=t("../utils"),o=t("../math"),s=t("../const"),a=t("../display/Container"),h=t("../textures/RenderTexture"),u=t("eventemitter3"),l=new o.Matrix;i.prototype=Object.create(u.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{backgroundColor:{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=n.hex2string(t),n.hex2rgb(t,this._backgroundColorRgba)}}}),i.prototype.resize=function(t,e){this.width=t*this.resolution,this.height=e*this.resolution,this.view.width=this.width,this.view.height=this.height,this.autoResize&&(this.view.style.width=this.width/this.resolution+"px",this.view.style.height=this.height/this.resolution+"px")},i.prototype.generateTexture=function(t,e,r){var i=t.getLocalBounds(),n=h.create(0|i.width,0|i.height,e,r);return l.tx=-i.x,l.ty=-i.y,this.render(t,n,!1,l,!0),n},i.prototype.destroy=function(t){t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.type=s.RENDERER_TYPE.UNKNOWN,this.width=0,this.height=0,this.view=null,this.resolution=0,this.transparent=!1,this.autoResize=!1,this.blendModes=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this.roundPixels=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this.backgroundColor=0,this._tempDisplayObjectParent=null,this._lastObjectRendered=null}},{"../const":79,"../display/Container":82,"../math":103,"../textures/RenderTexture":146,"../utils":154,eventemitter3:4}],110:[function(t,e,r){function i(t,e,r){r=r||{},n.call(this,"Canvas",t,e,r),this.type=u.RENDERER_TYPE.CANVAS,this.rootContext=this.view.getContext("2d",{alpha:this.transparent}),this.rootResolution=this.resolution,this.refresh=!0,this.maskManager=new o(this),this.smoothProperty="imageSmoothingEnabled",this.rootContext.imageSmoothingEnabled||(this.rootContext.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.rootContext.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.rootContext.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.rootContext.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(),this.blendModes=a(),this._activeBlendMode=null,this.context=null,this.renderingToScreen=!1,this.resize(t,e)}var n=t("../SystemRenderer"),o=t("./utils/CanvasMaskManager"),s=t("./utils/CanvasRenderTarget"),a=t("./utils/mapCanvasBlendModesToPixi"),h=t("../../utils"),u=t("../../const");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,h.pluginTarget.mixin(i),i.prototype.render=function(t,e,r,i,n){if(this.view){this.renderingToScreen=!e,this.emit("prerender"),e?(e=e.baseTexture||e,e._canvasRenderTarget||(e._canvasRenderTarget=new s(e.width,e.height,e.resolution),e.source=e._canvasRenderTarget.canvas,e.valid=!0),this.context=e._canvasRenderTarget.context,this.resolution=e._canvasRenderTarget.resolution):(this.context=this.rootContext,this.resolution=this.rootResolution);var o=this.context;e||(this._lastObjectRendered=t),n||(h.resetUpdateOrder(),t.dontInheritTransform=!0,t.updateTransform()),o.setTransform(1,0,0,1,0,0),o.globalAlpha=1,o.globalCompositeOperation=this.blendModes[u.BLEND_MODES.NORMAL],navigator.isCocoonJS&&this.view.screencanvas&&(o.fillStyle="black",o.clear()),(void 0!==r?r:this.clearBeforeRender)&&this.renderingToScreen&&(this.transparent?o.clearRect(0,0,this.width,this.height):(o.fillStyle=this._backgroundColorString,o.fillRect(0,0,this.width,this.height)));var a=this.context;this.context=o,t.renderCanvas(this),this.context=a,this.emit("postrender")}},i.prototype.setBlendMode=function(t){this._activeBlendMode!==t&&(this.context.globalCompositeOperation=this.blendModes[t])},i.prototype.destroy=function(t){this.destroyPlugins(),n.prototype.destroy.call(this,t),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},i.prototype.resize=function(t,e){n.prototype.resize.call(this,t,e),this.smoothProperty&&(this.rootContext[this.smoothProperty]=u.SCALE_MODES.DEFAULT===u.SCALE_MODES.LINEAR)}},{"../../const":79,"../../utils":154,"../SystemRenderer":109,"./utils/CanvasMaskManager":111,"./utils/CanvasRenderTarget":112,"./utils/mapCanvasBlendModesToPixi":114}],111:[function(t,e,r){function i(t){this.renderer=t}var n=t("../../../const");i.prototype.constructor=i,e.exports=i,i.prototype.pushMask=function(t){var e=this.renderer;e.context.save();var r=t.alpha,i=t.projectionMatrix2d,n=e.resolution;e.context.setTransform(i.a*n,i.b*n,i.c*n,i.d*n,i.tx*n,i.ty*n),t._texture||(this.renderGraphicsShape(t),e.context.clip()),t.worldAlpha=r},i.prototype.renderGraphicsShape=function(t){var e=this.renderer.context,r=t.graphicsData.length;if(0!==r){e.beginPath();for(var i=0;i<r;i++){var o=t.graphicsData[i],s=o.shape;if(o.type===n.SHAPES.POLY){var a=s.points;e.moveTo(a[0],a[1]);for(var h=1;h<a.length/2;h++)e.lineTo(a[2*h],a[2*h+1]);a[0]===a[a.length-2]&&a[1]===a[a.length-1]&&e.closePath()}else if(o.type===n.SHAPES.RECT)e.rect(s.x,s.y,s.width,s.height),e.closePath();else if(o.type===n.SHAPES.CIRC)e.arc(s.x,s.y,s.radius,0,2*Math.PI),e.closePath();else if(o.type===n.SHAPES.ELIP){var u=2*s.width,l=2*s.height,c=s.x-u/2,d=s.y-l/2,p=.5522848,f=u/2*p,y=l/2*p,m=c+u,v=d+l,x=c+u/2,g=d+l/2;e.moveTo(c,g),e.bezierCurveTo(c,g-y,x-f,d,x,d),e.bezierCurveTo(x+f,d,m,g-y,m,g),e.bezierCurveTo(m,g+y,x+f,v,x,v),e.bezierCurveTo(x-f,v,c,g+y,c,g),e.closePath()}else if(o.type===n.SHAPES.RREC){var _=s.x,b=s.y,T=s.width,M=s.height,S=s.radius,w=Math.min(T,M)/2|0;S=S>w?w:S,e.moveTo(_,b+S),e.lineTo(_,b+M-S),e.quadraticCurveTo(_,b+M,_+S,b+M),e.lineTo(_+T-S,b+M),e.quadraticCurveTo(_+T,b+M,_+T,b+M-S),e.lineTo(_+T,b+S),e.quadraticCurveTo(_+T,b,_+T-S,b),e.lineTo(_+S,b),e.quadraticCurveTo(_,b,_,b+S),e.closePath()}}}},i.prototype.popMask=function(t){t.context.restore()},i.prototype.destroy=function(){}},{"../../../const":79}],112:[function(t,e,r){function i(t,e,r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||n.RESOLUTION,this.resize(t,e)}var n=t("../../../const");i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{width:{get:function(){return this.canvas.width},set:function(t){this.canvas.width=t}},height:{get:function(){return this.canvas.height},set:function(t){this.canvas.height=t}}}),i.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},i.prototype.resize=function(t,e){this.canvas.width=t*this.resolution,this.canvas.height=e*this.resolution},i.prototype.destroy=function(){this.context=null,this.canvas=null}},{"../../../const":79}],113:[function(t,e,r){var i=function(){if("undefined"==typeof document)return!1;var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",e="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",r=new Image;r.src=t+"AP804Oa6"+e;var i=new Image;i.src=t+"/wCKxvRF"+e;var n=document.createElement("canvas");n.width=6,n.height=1;var o=n.getContext("2d");o.globalCompositeOperation="multiply",o.drawImage(r,0,0),o.drawImage(i,2,0);var s=o.getImageData(2,0,1,1).data;return 255===s[0]&&0===s[1]&&0===s[2]};e.exports=i},{}],114:[function(t,e,r){function i(t){return t=t||[],o()?(t[n.BLEND_MODES.NORMAL]="source-over",t[n.BLEND_MODES.ADD]="lighter",t[n.BLEND_MODES.MULTIPLY]="multiply",t[n.BLEND_MODES.SCREEN]="screen",t[n.BLEND_MODES.OVERLAY]="overlay",t[n.BLEND_MODES.DARKEN]="darken",t[n.BLEND_MODES.LIGHTEN]="lighten",t[n.BLEND_MODES.COLOR_DODGE]="color-dodge",t[n.BLEND_MODES.COLOR_BURN]="color-burn",t[n.BLEND_MODES.HARD_LIGHT]="hard-light",t[n.BLEND_MODES.SOFT_LIGHT]="soft-light",t[n.BLEND_MODES.DIFFERENCE]="difference",t[n.BLEND_MODES.EXCLUSION]="exclusion",t[n.BLEND_MODES.HUE]="hue",t[n.BLEND_MODES.SATURATION]="saturate",t[n.BLEND_MODES.COLOR]="color",t[n.BLEND_MODES.LUMINOSITY]="luminosity"):(t[n.BLEND_MODES.NORMAL]="source-over",t[n.BLEND_MODES.ADD]="lighter",t[n.BLEND_MODES.MULTIPLY]="source-over",t[n.BLEND_MODES.SCREEN]="source-over",t[n.BLEND_MODES.OVERLAY]="source-over",t[n.BLEND_MODES.DARKEN]="source-over",t[n.BLEND_MODES.LIGHTEN]="source-over",t[n.BLEND_MODES.COLOR_DODGE]="source-over",t[n.BLEND_MODES.COLOR_BURN]="source-over",t[n.BLEND_MODES.HARD_LIGHT]="source-over",t[n.BLEND_MODES.SOFT_LIGHT]="source-over",t[n.BLEND_MODES.DIFFERENCE]="source-over",t[n.BLEND_MODES.EXCLUSION]="source-over",t[n.BLEND_MODES.HUE]="source-over",t[n.BLEND_MODES.SATURATION]="source-over",t[n.BLEND_MODES.COLOR]="source-over",t[n.BLEND_MODES.LUMINOSITY]="source-over"),t}var n=t("../../../const"),o=t("./canUseNewCanvasBlendModes");e.exports=i},{"../../../const":79,"./canUseNewCanvasBlendModes":113}],115:[function(t,e,r){function i(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=3600,this.checkCountMax=600,this.mode=n.GC_MODES.DEFAULT}var n=t("../../const");i.prototype.constructor=i,e.exports=i,i.prototype.update=function(){this.count++,this.mode!==n.GC_MODES.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run()))},i.prototype.run=function(){var t,e,r=this.renderer.textureManager,i=r._managedTextures,n=!1;for(t=0;t<i.length;t++){var o=i[t];!o._glRenderTargets&&this.count-o.touched>this.maxIdle&&(r.destroyTexture(o,!0),i[t]=null,n=!0)}if(n){for(e=0,t=0;t<i.length;t++)null!==i[t]&&(i[e++]=i[t]);i.length=e}},i.prototype.unload=function(t){var e=this.renderer.textureManager;t._texture&&e.destroyTexture(t._texture,!0);for(var r=t.children.length-1;r>=0;r--)this.unload(t.children[r])}},{"../../const":79}],116:[function(t,e,r){var i=t("pixi-gl-core").GLTexture,n=t("../../const"),o=t("./utils/RenderTarget"),s=t("../../utils"),a=function(t){this.renderer=t,this.gl=t.gl,this._managedTextures=[]};a.prototype.bindTexture=function(){},a.prototype.getTexture=function(){},a.prototype.updateTexture=function(t){t=t.baseTexture||t;var e=!!t._glRenderTargets;if(t.hasLoaded){var r=t._glTextures[this.renderer.CONTEXT_UID];if(r)e?t._glRenderTargets[this.renderer.CONTEXT_UID].resize(t.width,t.height):r.upload(t.source);else{if(e){var s=new o(this.gl,t.width,t.height,t.scaleMode,t.resolution);s.resize(t.width,t.height),t._glRenderTargets[this.renderer.CONTEXT_UID]=s,r=s.texture}else r=new i(this.gl),r.premultiplyAlpha=!0,r.upload(t.source);t._glTextures[this.renderer.CONTEXT_UID]=r,t.on("update",this.updateTexture,this),t.on("dispose",this.destroyTexture,this),this._managedTextures.push(t),t.isPowerOfTwo?(t.mipmap&&r.enableMipmap(),t.wrapMode===n.WRAP_MODES.CLAMP?r.enableWrapClamp():t.wrapMode===n.WRAP_MODES.REPEAT?r.enableWrapRepeat():r.enableWrapMirrorRepeat()):r.enableWrapClamp(),t.scaleMode===n.SCALE_MODES.NEAREST?r.enableNearestScaling():r.enableLinearScaling()}return r}},a.prototype.destroyTexture=function(t,e){if(t=t.baseTexture||t,t.hasLoaded&&t._glTextures[this.renderer.CONTEXT_UID]&&(t._glTextures[this.renderer.CONTEXT_UID].destroy(),t.off("update",this.updateTexture,this),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.renderer.CONTEXT_UID],!e)){var r=this._managedTextures.indexOf(t);r!==-1&&s.removeItems(this._managedTextures,r,1)}},a.prototype.removeAll=function(){for(var t=0;t<this._managedTextures.length;++t){var e=this._managedTextures[t];e._glTextures[this.renderer.CONTEXT_UID]&&delete e._glTextures[this.renderer.CONTEXT_UID]}},a.prototype.destroy=function(){for(var t=0;t<this._managedTextures.length;++t){var e=this._managedTextures[t];this.destroyTexture(e,!0),e.off("update",this.updateTexture,this),e.off("dispose",this.destroyTexture,this)}this._managedTextures=null},e.exports=a},{"../../const":79,"../../utils":154,"./utils/RenderTarget":129,"pixi-gl-core":25}],117:[function(t,e,r){function i(t,e,r){r=r||{},n.call(this,"WebGL",t,e,r),this.type=v.RENDERER_TYPE.WEBGL,this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),this.view.addEventListener("webglcontextlost",this.handleContextLost,!1),this.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1),this._contextOptions={alpha:this.transparent,antialias:r.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:r.preserveDrawingBuffer},this._backgroundColorRgba[3]=this.transparent?0:1,this.maskManager=new o(this),this.stencilManager=new s(this),this.emptyRenderer=new u(this),this.currentRenderer=this.emptyRenderer,this.initPlugins(),this.gl=r.context||p(this.view,this._contextOptions),this.CONTEXT_UID=x++,this.state=new d(this.gl),this.renderingToScreen=!0,this._initContext(),this.filterManager=new a(this),this.drawModes=f(this.gl),this._activeShader=null,this._activeRenderTarget=null,this._activeTextureLocation=999,this._activeTexture=null,this.setBlendMode(0)}var n=t("../SystemRenderer"),o=t("./managers/MaskManager"),s=t("./managers/StencilManager"),a=t("./managers/FilterManager"),h=t("./utils/RenderTarget"),u=t("./utils/ObjectRenderer"),l=t("./TextureManager"),c=t("./TextureGarbageCollector"),d=t("./WebGLState"),p=t("pixi-gl-core").createContext,f=t("./utils/mapWebGLDrawModesToPixi"),y=t("../../utils"),m=t("pixi-gl-core"),v=t("../../const"),x=0;i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,y.pluginTarget.mixin(i),i.prototype._initContext=function(){var t=this.gl;this.textureManager=new l(this),this.textureGC=new c(this),this.state.resetToDefault(),this.rootRenderTarget=new h(t,this.width,this.height,null,this.resolution,(!0)),this.rootRenderTarget.clearColor=this._backgroundColorRgba,this.bindRenderTarget(this.rootRenderTarget),this.emit("context",t),this.resize(this.width,this.height)},i.prototype.render=function(t,e,r,i,n){this.renderingToScreen=!e,this.emit("prerender"),this.gl&&!this.gl.isContextLost()&&(e||(this._lastObjectRendered=t),n||(y.resetUpdateOrder(),t.dontInheritTransform=!0,t.updateTransform()),this.bindRenderTexture(e,i),this.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this._activeRenderTarget.clear(),y.resetDisplayOrder(),t.renderWebGL(this),this.currentRenderer.flush(),this.renderingToScreen&&this.textureGC.update(),this.emit("postrender"))},i.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},i.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},i.prototype.resize=function(t,e){n.prototype.resize.call(this,t,e),this.rootRenderTarget.resize(t,e),this._activeRenderTarget===this.rootRenderTarget&&(this.rootRenderTarget.activate(),this._activeShader&&this._activeShader.setUniformMatrix("projectionMatrix",this.rootRenderTarget.projectionMatrix))},i.prototype.setBlendMode=function(t){this.state.setBlendMode(t)},i.prototype.clear=function(t){this._activeRenderTarget.clear(t)},i.prototype.setTransform=function(t){this._activeRenderTarget.transform=t},i.prototype.bindRenderTexture=function(t,e){var r;if(t){var i=t.baseTexture,n=this.gl;i._glRenderTargets[this.CONTEXT_UID]?(this._activeTextureLocation=i._id,n.activeTexture(n.TEXTURE0+i._id),n.bindTexture(n.TEXTURE_2D,null)):(this.textureManager.updateTexture(i),n.bindTexture(n.TEXTURE_2D,null)),r=i._glRenderTargets[this.CONTEXT_UID],r.setFrame(t.frame)}else r=this.rootRenderTarget;return r.transform=e,this.bindRenderTarget(r),this},i.prototype.bindProjection=function(t){var e=this._activeRenderTarget,r=this._activeShader;return!(!e||!e.checkWorldProjection(t))&&(e.setWorldProjection(t),r&&r.setUniformMatrix("projectionMatrix",e.projectionMatrix),!0)},i.prototype.bindRenderTarget=function(t){var e=this._activeShader;return t!==this._activeRenderTarget&&(this._activeRenderTarget=t,t.activate(),e&&e.setUniformMatrix("projectionMatrix",t.projectionMatrix),this.stencilManager.setMaskStack(t.stencilMaskStack)),this},i.prototype.bindShader=function(t){return this._activeShader!==t&&(this._activeShader=t,t.bind(),t.setUniformMatrix("projectionMatrix",this._activeRenderTarget.projectionMatrix)),this},i.prototype.bindTexture=function(t,e){t=t.baseTexture||t;var r=this.gl;return e=e||0,this._activeTextureLocation!==e&&(this._activeTextureLocation=e,r.activeTexture(r.TEXTURE0+e)),this._activeTexture=t,t._glTextures[this.CONTEXT_UID]?(t.touched=this.textureGC.count,t._glTextures[this.CONTEXT_UID].bind()):this.textureManager.updateTexture(t),this},i.prototype.createVao=function(){return new m.VertexArrayObject(this.gl,this.state.attribState)},i.prototype.reset=function(){return this.currentRenderer.stop(),this._activeShader=null,this._activeRenderTarget=null,this._activeTextureLocation=999,this._activeTexture=null,this.rootRenderTarget.activate(),this.state.resetToDefault(),this},i.prototype.handleContextLost=function(t){t.preventDefault()},i.prototype.handleContextRestored=function(){this._initContext(),this.textureManager.removeAll()},i.prototype.destroy=function(t){this.destroyPlugins(),this.view.removeEventListener("webglcontextlost",this.handleContextLost),this.view.removeEventListener("webglcontextrestored",this.handleContextRestored),this.textureManager.destroy(),n.prototype.destroy.call(this,t),this.uid=0,this.maskManager.destroy(),this.stencilManager.destroy(),this.filterManager.destroy(),this.maskManager=null,this.filterManager=null,this.textureManager=null,this.currentRenderer=null,this.handleContextLost=null,this.handleContextRestored=null,this._contextOptions=null,this.gl.useProgram(null),this.gl.getExtension("WEBGL_lose_context")&&this.gl.getExtension("WEBGL_lose_context").loseContext(),this.gl=null}},{"../../const":79,"../../utils":154,"../SystemRenderer":109,"./TextureGarbageCollector":115,"./TextureManager":116,"./WebGLState":118,"./managers/FilterManager":123,"./managers/MaskManager":124,"./managers/StencilManager":125,"./utils/ObjectRenderer":127,"./utils/RenderTarget":129,"./utils/mapWebGLDrawModesToPixi":132,"pixi-gl-core":25}],118:[function(t,e,r){var i=t("./utils/mapWebGLBlendModesToPixi"),n=function(t){this.activeState=new Uint8Array(16),this.defaultState=new Uint8Array(16),this.defaultState[0]=1,this.stackIndex=0,this.stack=[],this.gl=t,this.maxAttribs=t.getParameter(t.MAX_VERTEX_ATTRIBS),this.attribState={tempAttribState:new Array(this.maxAttribs),attribState:new Array(this.maxAttribs)},this.blendModes=i(t),this.nativeVaoExtension=t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object")};n.prototype.push=function(){var t=this.state[++this.stackIndex];t||(t=this.state[this.stackIndex]=new Uint8Array(16));for(var e=0;e<this.activeState.length;e++)this.activeState[e]=t[e]};var o=0,s=1,a=2,h=3,u=4;n.prototype.pop=function(){var t=this.state[--this.stackIndex];this.setState(t)},n.prototype.setState=function(t){this.setBlend(t[o]),this.setDepthTest(t[s]),this.setFrontFace(t[a]),this.setCullFace(t[h]),this.setBlendMode(t[u])},n.prototype.setBlend=function(t){if(!(this.activeState[o]===t|0)){this.activeState[o]=0|t;var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND)}},n.prototype.setBlendMode=function(t){t!==this.activeState[u]&&(this.activeState[u]=t,this.gl.blendFunc(this.blendModes[t][0],this.blendModes[t][1]))},n.prototype.setDepthTest=function(t){if(!(this.activeState[s]===t|0)){this.activeState[s]=0|t;var e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST)}},n.prototype.setCullFace=function(t){if(!(this.activeState[h]===t|0)){this.activeState[h]=0|t;var e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE)}},n.prototype.setFrontFace=function(t){if(!(this.activeState[a]===t|0)){this.activeState[a]=0|t;var e=this.gl;t?e.frontFace(e.CW):e.frontFace(e.CCW)}},n.prototype.resetAttributes=function(){var t;for(t=0;t<this.attribState.tempAttribState.length;t++)this.attribState.tempAttribState[t]=0;for(t=0;t<this.attribState.attribState.length;t++)this.attribState.attribState[t]=0;var e=this.gl;for(t=1;t<this.maxAttribs;t++)e.disableVertexAttribArray(t)},n.prototype.resetToDefault=function(){this.nativeVaoExtension&&this.nativeVaoExtension.bindVertexArrayOES(null),this.resetAttributes();for(var t=0;t<this.activeState.length;t++)this.activeState[t]=2;var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),this.setState(this.defaultState)},e.exports=n},{"./utils/mapWebGLBlendModesToPixi":131}],119:[function(t,e,r){function i(t,e,r){this.vertexSrc=t||i.defaultVertexSrc,this.fragmentSrc=e||i.defaultFragmentSrc,this.blendMode=s.BLEND_MODES.NORMAL,this.uniformData=r||n(this.vertexSrc,this.fragmentSrc,"projectionMatrix|uSampler"),this.uniforms={};for(var h in this.uniformData)this.uniforms[h]=this.uniformData[h].value;this.glShaders=[],a[this.vertexSrc+this.fragmentSrc]||(a[this.vertexSrc+this.fragmentSrc]=o.uid()),this.glShaderKey=a[this.vertexSrc+this.fragmentSrc],this.padding=4,this.resolution=1}var n=t("./extractUniformsFromSrc"),o=t("../../../utils"),s=t("../../../const"),a={};e.exports=i,i.prototype.apply=function(t,e,r,i){t.applyFilter(this,e,r,i)},i.defaultVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","uniform mat3 projectionMatrix;","uniform mat3 filterMatrix;","varying vec2 vTextureCoord;","varying vec2 vFilterCoord;","void main(void){","   gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);","   vFilterCoord = ( filterMatrix * vec3( aTextureCoord, 1.0)  ).xy;","   vTextureCoord = aTextureCoord ;","}"].join("\n"),i.defaultFragmentSrc=["varying vec2 vTextureCoord;","varying vec2 vFilterCoord;","uniform sampler2D uSampler;","uniform sampler2D filterSampler;","void main(void){","   vec4 masky = texture2D(filterSampler, vFilterCoord);","   vec4 sample = texture2D(uSampler, vTextureCoord);","   vec4 color;","   if(mod(vFilterCoord.x, 1.0) > 0.5)","   {","     color = vec4(1.0, 0.0, 0.0, 1.0);","   }","   else","   {","     color = vec4(0.0, 1.0, 0.0, 1.0);","   }","   gl_FragColor = mix(sample, masky, 0.5);","   gl_FragColor *= sample.a;","}"].join("\n")},{"../../../const":79,"../../../utils":154,"./extractUniformsFromSrc":120}],120:[function(t,e,r){function i(t,e,r){var i=n(t,r),o=n(e,r);return Object.assign(i,o)}function n(t){for(var e,r=new RegExp("^(projectionMatrix|uSampler|filterArea)$"),i={},n=t.replace(/\s+/g," ").split(/\s*;\s*/),a=0;a<n.length;a++){var h=n[a].trim();if(h.indexOf("uniform")>-1){var u=h.split(" "),l=u[1],c=u[2],d=s(l);c.indexOf("[")>-1&&(e=c.split(/\[|\]/),c=e[0],d*=Number(e[1])),c.match(r)||(i[c]={value:o(l,d),name:c,type:l})}}return i}var o=t("pixi-gl-core").shader.defaultValue,s=t("pixi-gl-core").shader.mapSize;e.exports=i},{"pixi-gl-core":25}],121:[function(t,e,r){var i=t("../../../math"),n=function(t,e,r){var i=t.identity();return i.translate(e.x/r.width,e.y/r.height),i.scale(r.width,r.height),i},o=function(t,e,r){var i=t.identity();i.translate(e.x/r.width,e.y/r.height);var n=r.width/e.width,o=r.height/e.height;return i.scale(n,o),i},s=function(t,e,r,n){var o=n.projectionMatrixTo2d(i.Matrix.TEMP_MATRIX),s=n._texture.baseTexture,a=t.identity(),h=r.height/r.width;a.translate(e.x/r.width,e.y/r.height),a.scale(1,h);var u=r.width/s.width,l=r.height/s.height;return o.tx/=s.width*u,o.ty/=s.width*u,o.invert(),a.prepend(o),a.scale(1,1/h),a.scale(u,l),a.translate(n.anchor.x,n.anchor.y),a};e.exports={calculateScreenSpaceMatrix:n,calculateNormalizedScreenSpaceMatrix:o,calculateSpriteMatrix:s}},{"../../../math":103}],122:[function(t,e,r){function i(t){var e=new o.Matrix;n.call(this,"#define GLSLIFY 1\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n    vTextureCoord = aTextureCoord;\n    vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0)  ).xy;\n}\n","#define GLSLIFY 1\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform sampler2D mask;\n\nvoid main(void)\n{\n    // check clip! this will stop the mask bleeding out from the edges\n    vec2 text = abs( vMaskCoord - 0.5 );\n    text = step(0.5, text);\n    float clip = 1.0 - max(text.y, text.x);\n    vec4 original = texture2D(uSampler, vTextureCoord);\n    vec4 masky = texture2D(mask, vMaskCoord);\n    original *= (masky.r * masky.a * alpha * clip);\n    gl_FragColor = original;\n}\n"),t.renderable=!1,this.maskSprite=t,this.maskMatrix=e}var n=t("../Filter"),o=t("../../../../math");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.apply=function(t,e,r){var i=this.maskSprite;this.uniforms.mask=i._texture,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,i),this.uniforms.alpha=i.worldAlpha,t.applyFilter(this,e,r)}},{"../../../../math":103,"../Filter":119}],123:[function(t,e,r){function i(t){n.call(this,t),this.gl=this.renderer.gl,this.quad=new s(this.gl,t.state.attribState),this.shaderCache={},this.pool={}}var n=t("./WebGLManager"),o=t("../utils/RenderTarget"),s=t("../utils/Quad"),a=t("../../../math"),h=t("../../../Shader"),u=t("../filters/filterTransforms"),l=t("bit-twiddle"),c=function(){this.renderTarget=null,this.sourceFrame=new a.Rectangle,this.destinationFrame=new a.Rectangle,this.filters=[],this.target=null,this.resolution=1};i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.pushFilter=function(t,e){var r=this.renderer,i=this.filterData;if(!i){i=this.renderer._activeRenderTarget.filterStack;var n=new c;n.sourceFrame=n.destinationFrame=this.renderer._activeRenderTarget.size,n.renderTarget=r._activeRenderTarget,this.renderer._activeRenderTarget.filterData=i={index:0,stack:[n]},this.filterData=i}var o=i.stack[++i.index];o||(o=i.stack[i.index]=new c);var s=e[0].resolution,a=e[0].padding,h=t.filterArea||t.getBounds(),u=o.sourceFrame,l=o.destinationFrame;u.x=((h.x-a)*s|0)/s,u.y=((h.y-a)*s|0)/s,u.width=((h.width+2*a)*s|0)/s,u.height=((h.height+2*a)*s|0)/s,u.fit(i.stack[0].destinationFrame),l.width=u.width,l.height=u.height;var d=this.getPotRenderTarget(r.gl,u.width,u.height,s);o.target=t,o.filters=e,o.resolution=s,o.renderTarget=d,d.setFrame(l,u),r.bindRenderTarget(d),r.clear()},i.prototype.popFilter=function(){var t=this.filterData,e=t.stack[t.index-1],r=t.stack[t.index];this.quad.map(r.renderTarget.size,r.sourceFrame).upload();var i=r.filters;if(1===i.length)i[0].apply(this,r.renderTarget,e.renderTarget,!1),this.freePotRenderTarget(r.renderTarget);else{var n=r.renderTarget,o=this.getPotRenderTarget(this.renderer.gl,r.sourceFrame.width,r.sourceFrame.height,1);o.setFrame(r.destinationFrame,r.sourceFrame);for(var s=0;s<i.length-1;s++){i[s].apply(this,n,o,!0);var a=n;n=o,o=a}i[s].apply(this,n,e.renderTarget,!1),this.freePotRenderTarget(n),this.freePotRenderTarget(o)}t.index--,0===t.index&&(this.filterData=null)},i.prototype.applyFilter=function(t,e,r,i){var n=this.renderer,o=t.glShaders[n.CONTEXT_UID];if(o||(t.glShaderKey?(o=this.shaderCache[t.glShaderKey],o||(o=t.glShaders[n.CONTEXT_UID]=this.shaderCache[t.glShaderKey]=new h(this.gl,t.vertexSrc,t.fragmentSrc))):o=t.glShaders[n.CONTEXT_UID]=new h(this.gl,t.vertexSrc,t.fragmentSrc),this.quad.initVao(o)),n.bindRenderTarget(r),i){var s=n.gl;s.disable(s.SCISSOR_TEST),n.clear(),s.enable(s.SCISSOR_TEST)}r===n.maskManager.scissorRenderTarget&&n.maskManager.pushScissorMask(null,n.maskManager.scissorData),n.bindShader(o),this.syncUniforms(o,t),e.texture.bind(0),n._activeTextureLocation=0,n.state.setBlendMode(t.blendMode),this.quad.draw()},i.prototype.syncUniforms=function(t,e){var r,i=e.uniformData,n=e.uniforms,o=1;if(t.uniforms.data.filterArea){r=this.filterData.stack[this.filterData.index];var s=t.uniforms.filterArea;s[0]=r.renderTarget.size.width,s[1]=r.renderTarget.size.height,s[2]=r.sourceFrame.x,s[3]=r.sourceFrame.y,t.uniforms.filterArea=s}if(t.uniforms.data.filterClamp){r=this.filterData.stack[this.filterData.index];var a=t.uniforms.filterClamp;a[0]=.5/r.renderTarget.size.width,a[1]=.5/r.renderTarget.size.height,a[2]=(r.sourceFrame.width-.5)/r.renderTarget.size.width,a[3]=(r.sourceFrame.height-.5)/r.renderTarget.size.height,t.uniforms.filterClamp=a}var h;for(var u in i)"sampler2D"===i[u].type?(t.uniforms[u]=o,this.renderer.bindTexture(n[u].baseTexture,o),o++):"mat3"===i[u].type?void 0!==n[u].a?t.uniforms[u]=n[u].toArray(!0):t.uniforms[u]=n[u]:"vec2"===i[u].type?void 0!==n[u].x?(h=t.uniforms[u],h[0]=n[u].x,h[1]=n[u].y,t.uniforms[u]=h):t.uniforms[u]=n[u]:"float"===i[u].type?t.uniforms.data[u].value!==i[u]&&(t.uniforms[u]=n[u]):t.uniforms[u]=n[u]},i.prototype.getRenderTarget=function(){var t=this.filterData.stack[this.filterData.index],e=this.getPotRenderTarget(this.renderer.gl,t.sourceFrame.width,t.sourceFrame.height,t.resolution);return e.setFrame(t.destinationFrame,t.sourceFrame),e},i.prototype.returnRenderTarget=function(t){return this.freePotRenderTarget(t)},i.prototype.calculateScreenSpaceMatrix=function(t){var e=this.filterData.stack[this.filterData.index];return u.calculateScreenSpaceMatrix(t,e.sourceFrame,e.renderTarget.size)},i.prototype.calculateNormalizedScreenSpaceMatrix=function(t){var e=this.filterData.stack[this.filterData.index];return u.calculateNormalizedScreenSpaceMatrix(t,e.sourceFrame,e.renderTarget.size,e.destinationFrame)},i.prototype.calculateSpriteMatrix=function(t,e){var r=this.filterData.stack[this.filterData.index];return u.calculateSpriteMatrix(t,r.sourceFrame,r.renderTarget.size,e)},i.prototype.destroy=function(){this.shaderCache=[],this.emptyPool()},i.prototype.getPotRenderTarget=function(t,e,r,i){e=l.nextPow2(e*i),r=l.nextPow2(r*i);var n=(65535&e)<<16|65535&r;this.pool[n]||(this.pool[n]=[]);var s=this.pool[n].pop()||new o(t,e,r,null,1);return s.resolution=i,s.defaultFrame.width=s.size.width=e/i,s.defaultFrame.height=s.size.height=r/i,s},i.prototype.emptyPool=function(){for(var t in this.pool){var e=this.pool[t];if(e)for(var r=0;r<e.length;r++)e[r].destroy(!0)}this.pool={}},i.prototype.freePotRenderTarget=function(t){var e=t.size.width*t.resolution,r=t.size.height*t.resolution,i=(65535&e)<<16|65535&r;this.pool[i].push(t)}},{"../../../Shader":53,
  "../../../math":103,"../filters/filterTransforms":121,"../utils/Quad":128,"../utils/RenderTarget":129,"./WebGLManager":126,"bit-twiddle":2}],124:[function(t,e,r){function i(t){n.call(this,t),this.scissor=!1,this.scissorData=null,this.scissorRenderTarget=null,this.enableScissor=!0,this.alphaMaskPool=[],this.alphaMaskIndex=0}var n=t("./WebGLManager"),o=t("../filters/spriteMask/SpriteMaskFilter");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.pushMask=function(t,e){if(e.texture)this.pushSpriteMask(t,e);else if(!this.enableScissor||this.scissor||this.renderer.stencilManager.stencilMaskStack.length||1!==e.graphicsData[0].shape.type)this.pushStencilMask(e);else{var r=e.projectionMatrix2d,i=Math.atan2(r.b,r.a);i=Math.round(i*(180/Math.PI)),i%90?this.pushStencilMask(e):this.pushScissorMask(t,e)}},i.prototype.popMask=function(t,e){e.texture?this.popSpriteMask(t,e):this.enableScissor&&!this.renderer.stencilManager.stencilMaskStack.length?this.popScissorMask(t,e):this.popStencilMask(t,e)},i.prototype.pushSpriteMask=function(t,e){var r=this.alphaMaskPool[this.alphaMaskIndex];r||(r=this.alphaMaskPool[this.alphaMaskIndex]=[new o(e)]),r[0].maskSprite=e,t.filterArea=e.getBounds(),this.renderer.filterManager.pushFilter(t,r),this.alphaMaskIndex++},i.prototype.popSpriteMask=function(){this.renderer.filterManager.popFilter(),this.alphaMaskIndex--},i.prototype.pushStencilMask=function(t){this.renderer.currentRenderer.stop(),this.renderer.stencilManager.pushStencil(t)},i.prototype.popStencilMask=function(){this.renderer.currentRenderer.stop(),this.renderer.stencilManager.popStencil()},i.prototype.pushScissorMask=function(t,e){e.renderable=!0;var r=this.renderer._activeRenderTarget,i=e.getBounds();i.fit(r.size),e.renderable=!1,this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST);var n=this.renderer.resolution;this.renderer.gl.scissor(i.x*n,(r.root?r.size.height-i.y-i.height:i.y)*n,i.width*n,i.height*n),this.scissorRenderTarget=r,this.scissorData=e,this.scissor=!0},i.prototype.popScissorMask=function(){this.scissorRenderTarget=null,this.scissorData=null,this.scissor=!1;var t=this.renderer.gl;t.disable(t.SCISSOR_TEST)}},{"../filters/spriteMask/SpriteMaskFilter":122,"./WebGLManager":126}],125:[function(t,e,r){function i(t){n.call(this,t),this.stencilMaskStack=null}var n=t("./WebGLManager");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.setMaskStack=function(t){this.stencilMaskStack=t;var e=this.renderer.gl;0===t.length?e.disable(e.STENCIL_TEST):e.enable(e.STENCIL_TEST)},i.prototype.pushStencil=function(t){this.renderer.setObjectRenderer(this.renderer.plugins.graphics),this.renderer._activeRenderTarget.attachStencilBuffer();var e=this.renderer.gl,r=this.stencilMaskStack;0===r.length&&(e.enable(e.STENCIL_TEST),e.clear(e.STENCIL_BUFFER_BIT),e.stencilFunc(e.ALWAYS,1,1)),r.push(t),e.colorMask(!1,!1,!1,!1),e.stencilOp(e.KEEP,e.KEEP,e.INCR),this.renderer.plugins.graphics.render(t),e.colorMask(!0,!0,!0,!0),e.stencilFunc(e.NOTEQUAL,0,r.length),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)},i.prototype.popStencil=function(){this.renderer.setObjectRenderer(this.renderer.plugins.graphics);var t=this.renderer.gl,e=this.stencilMaskStack,r=e.pop();0===e.length?t.disable(t.STENCIL_TEST):(t.colorMask(!1,!1,!1,!1),t.stencilOp(t.KEEP,t.KEEP,t.DECR),this.renderer.plugins.graphics.render(r),t.colorMask(!0,!0,!0,!0),t.stencilFunc(t.NOTEQUAL,0,e.length),t.stencilOp(t.KEEP,t.KEEP,t.KEEP))},i.prototype.destroy=function(){n.prototype.destroy.call(this),this.stencilMaskStack.stencilStack=null}},{"./WebGLManager":126}],126:[function(t,e,r){function i(t){this.renderer=t,this.renderer.on("context",this.onContextChange,this)}i.prototype.constructor=i,e.exports=i,i.prototype.onContextChange=function(){},i.prototype.destroy=function(){this.renderer.off("context",this.onContextChange,this),this.renderer=null}},{}],127:[function(t,e,r){function i(t){n.call(this,t)}var n=t("../managers/WebGLManager");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.start=function(){},i.prototype.stop=function(){this.flush()},i.prototype.flush=function(){},i.prototype.render=function(t){}},{"../managers/WebGLManager":126}],128:[function(t,e,r){function i(t,e){this.gl=t,this.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.interleaved=new Float32Array(16);for(var r=0;r<4;r++)this.interleaved[4*r]=this.vertices[2*r],this.interleaved[4*r+1]=this.vertices[2*r+1],this.interleaved[4*r+2]=this.uvs[2*r],this.interleaved[4*r+3]=this.uvs[2*r+1];this.indices=o(1),this.vertexBuffer=n.GLBuffer.createVertexBuffer(t,this.interleaved,t.STATIC_DRAW),this.indexBuffer=n.GLBuffer.createIndexBuffer(t,this.indices,t.STATIC_DRAW),this.vao=new n.VertexArrayObject(t,e)}var n=t("pixi-gl-core"),o=t("../../../utils/createIndicesForQuads");i.prototype.constructor=i,i.prototype.initVao=function(t){this.vao.clear().addIndex(this.indexBuffer).addAttribute(this.vertexBuffer,t.attributes.aVertexPosition,this.gl.FLOAT,!1,16,0).addAttribute(this.vertexBuffer,t.attributes.aTextureCoord,this.gl.FLOAT,!1,16,8)},i.prototype.map=function(t,e){var r=0,i=0;return this.uvs[0]=r,this.uvs[1]=i,this.uvs[2]=r+e.width/t.width,this.uvs[3]=i,this.uvs[4]=r+e.width/t.width,this.uvs[5]=i+e.height/t.height,this.uvs[6]=r,this.uvs[7]=i+e.height/t.height,r=e.x,i=e.y,this.vertices[0]=r,this.vertices[1]=i,this.vertices[2]=r+e.width,this.vertices[3]=i,this.vertices[4]=r+e.width,this.vertices[5]=i+e.height,this.vertices[6]=r,this.vertices[7]=i+e.height,this},i.prototype.draw=function(){return this.vao.bind().draw(this.gl.TRIANGLES,6,0).unbind(),this},i.prototype.upload=function(){for(var t=0;t<4;t++)this.interleaved[4*t]=this.vertices[2*t],this.interleaved[4*t+1]=this.vertices[2*t+1],this.interleaved[4*t+2]=this.uvs[2*t],this.interleaved[4*t+3]=this.uvs[2*t+1];return this.vertexBuffer.upload(this.interleaved),this},i.prototype.destroy=function(){var t=this.gl;t.deleteBuffer(this.vertexBuffer),t.deleteBuffer(this.indexBuffer)},e.exports=i},{"../../../utils/createIndicesForQuads":152,"pixi-gl-core":25}],129:[function(t,e,r){var i=t("../../../math"),n=t("../../../const"),o=t("../../../c2d/Transform2d"),s=t("pixi-gl-core").GLFramebuffer,a=function(t,e,r,a,h,u){this.gl=t,this.frameBuffer=null,this.texture=null,this.clearColor=[0,0,0,0],this.size=new i.Rectangle(0,0,1,1),this.resolution=h||n.RESOLUTION,this.projection2d=new o,this.worldProjection=null,this.transform=null,this.frame=null,this.defaultFrame=new i.Rectangle,this.destinationFrame=null,this.sourceFrame=null,this.stencilBuffer=null,this.stencilMaskStack=[],this.filterData=null,this.scaleMode=a||n.SCALE_MODES.DEFAULT,this.root=u,this.root?(this.frameBuffer=new s(t,100,100),this.frameBuffer.framebuffer=null):(this.frameBuffer=s.createRGBA(t,100,100),this.scaleMode===n.SCALE_MODES.NEAREST?this.frameBuffer.texture.enableNearestScaling():this.frameBuffer.texture.enableLinearScaling(),this.texture=this.frameBuffer.texture),this.setFrame(),this.resize(e,r)};a.prototype.constructor=a,e.exports=a,Object.defineProperties(a.prototype,{projectionMatrix:{get:function(){return this.worldProjection?this.worldProjection.matrix:this.projection2d.matrix2d}}}),a.prototype.setWorldProjection=function(t){t?this.worldProjection=t.updateChildReverseTransform(this.worldProjection,this.projection2d):this.worldProjection=null},a.prototype.checkWorldProjection=function(t){return t?!this.worldProjection||t.checkChildReverseTransform(this.worldProjection,this.projection2d):null!==this.worldProjection},a.prototype.clear=function(t){var e=t||this.clearColor;this.frameBuffer.clear(e[0],e[1],e[2],e[3])},a.prototype.attachStencilBuffer=function(){this.root||this.frameBuffer.enableStencil()},a.prototype.setFrame=function(t,e){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t},a.prototype.activate=function(t){var e=this.gl;this.frameBuffer.bind(),this.calculateProjection(this.destinationFrame,this.sourceFrame),this.transform&&this.projection2d.matrix2d.append(this.transform),this.setWorldProjection(t),this.destinationFrame!==this.sourceFrame?(e.enable(e.SCISSOR_TEST),e.scissor(0|this.destinationFrame.x,0|this.destinationFrame.y,this.destinationFrame.width*this.resolution|0,this.destinationFrame.height*this.resolution|0)):e.disable(e.SCISSOR_TEST),e.viewport(0|this.destinationFrame.x,0|this.destinationFrame.y,this.destinationFrame.width*this.resolution|0,this.destinationFrame.height*this.resolution|0)},a.prototype.calculateProjection=function(t,e){var r=this.projection2d,i=r.matrix2d;r.version++,e=e||t,i.identity(),this.root?(i.a=1/t.width*2,i.d=-1/t.height*2,i.tx=-1-e.x*i.a,i.ty=1-e.y*i.d):(i.a=1/t.width*2,i.d=1/t.height*2,i.tx=-1-e.x*i.a,i.ty=-1-e.y*i.d)},a.prototype.resize=function(t,e){if(t=0|t,e=0|e,this.size.width!==t||this.size.height!==e){this.size.width=t,this.size.height=e,this.defaultFrame.width=t,this.defaultFrame.height=e,this.frameBuffer.resize(t*this.resolution,e*this.resolution);var r=this.frame||this.size;this.calculateProjection(r)}},a.prototype.destroy=function(){this.frameBuffer.destroy(),this.frameBuffer=null,this.texture=null}},{"../../../c2d/Transform2d":63,"../../../const":79,"../../../math":103,"pixi-gl-core":25}],130:[function(t,e,r){function i(t){for(var e="",r=0;r<t;r++)r>0&&(e+="\nelse "),r<t-1&&(e+="if(test == "+r+".0){}");return e}var n=t("pixi-gl-core"),o=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n"),s=function(t,e){var r=!e;if(r){var s=document.createElement("canvas");s.width=1,s.height=1,e=n.createContext(s)}for(var a=e.createShader(e.FRAGMENT_SHADER);;){var h=o.replace(/%forloop%/gi,i(t));if(e.shaderSource(a,h),e.compileShader(a),e.getShaderParameter(a,e.COMPILE_STATUS))break;t=t/2|0}return r&&e.getExtension("WEBGL_lose_context")&&e.getExtension("WEBGL_lose_context").loseContext(),t};e.exports=s},{"pixi-gl-core":25}],131:[function(t,e,r){function i(t,e){return e=e||[],e[n.BLEND_MODES.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.ADD]=[t.ONE,t.DST_ALPHA],e[n.BLEND_MODES.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR],e[n.BLEND_MODES.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e}var n=t("../../../const");e.exports=i},{"../../../const":79}],132:[function(t,e,r){function i(t,e){e=e||{},e[n.DRAW_MODES.POINTS]=t.POINTS,e[n.DRAW_MODES.LINES]=t.LINES,e[n.DRAW_MODES.LINE_LOOP]=t.LINE_LOOP,e[n.DRAW_MODES.LINE_STRIP]=t.LINE_STRIP,e[n.DRAW_MODES.TRIANGLES]=t.TRIANGLES,e[n.DRAW_MODES.TRIANGLE_STRIP]=t.TRIANGLE_STRIP,e[n.DRAW_MODES.TRIANGLE_FAN]=t.TRIANGLE_FAN}var n=t("../../../const");e.exports=i},{"../../../const":79}],133:[function(t,e,r){function i(t,e){s.call(this),this._frame=e||new a,this._sharedFrame=e,this._frameVersion=-1,this._width=0,this._height=0,this._texture=null,this.tint=16777215,this.blendMode=u.BLEND_MODES.NORMAL,this.shader=null,this.cachedTint=16777215,this.geometry=new o,this.geometry.size=4,this.texture=t||n.EMPTY,this.textureDirty=!0,this.isRaycastPossible=!0}var n=t("../textures/Texture"),o=t("../c2d/Geometry2d"),s=t("../display/Container"),a=t("./SpriteFrame"),h=t("../utils"),u=t("../const");i.prototype=Object.create(s.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{width:{get:function(){return Math.abs(this.scale.x)*this._frame.spriteWidth},set:function(t){var e=h.sign(this.scale.x)||1;this.scale.x=e*t/this._frame.spriteWidth,this._width=t}},height:{get:function(){return Math.abs(this.scale.y)*this._frame.spriteHeight},set:function(t){var e=h.sign(this.scale.y)||1;this.scale.y=e*t/this._frame.spriteHeight,this._height=t}},texture:{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture=t,this.cachedTint=16777215,this.textureDirty=!0,t&&(this._sharedFrame||(this._frame.textureFrame=t.orig),t.baseTexture.hasLoaded?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}},anchor:{get:function(){return this._frame.anchor},set:function(t){"number"==typeof t?this._frame.anchor.set(t):this._frame.anchor.copy(t)}},size:{get:function(){return this._frame.size},set:function(t){"number"==typeof t?this._frame.size.set(t):this._frame.size.copy(t)}}}),i.prototype.calculateVertices=function(t){var e=this._frame;if(e.update(),!t||this._frameVersion!==e.version){this._frameVersion=e.version;var r=e.inner||e;this.geometry.setRectCoords(0,r.x,r.y,r.x+r.width,r.y+r.height)}},i.prototype._onTextureUpdate=function(){this._sharedFrame||this.calculateVertices(),this._width&&(this.scale.x=h.sign(this.scale.x)*this._width/this._frame.width),this._height&&(this.scale.y=h.sign(this.scale.y)*this._height/this._frame.height)},i.prototype._renderWebGL=function(t){this.updateGeometry(),t.setObjectRenderer(t.plugins.sprite),t.plugins.sprite.render(this)},i.prototype.updateTransform=function(){this.calculateVertices(),this.containerUpdateTransform()},i.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)},i.prototype.containsLocalPoint=function(t){var e=this.geometry.vertices;return t.x>e[0]&&t.x<e[4]&&t.y>e[1]&&t.y<e[5]},i.prototype.destroy=function(t){s.prototype.destroy.call(this,t),this._anchor.destroy(),this._size.destroy(),this._anchor=null,this._size=null;var e="boolean"==typeof t?t:t&&t.texture;if(e){var r="boolean"==typeof t?t:t&&t.baseTexture;this._texture.destroy(!!r)}this._texture=null,this.shader=null},i.from=function(t){return new i(n.from(t))},i.fromFrame=function(t){var e=h.TextureCache[t];if(!e)throw new Error('The frameId "'+t+'" does not exist in the texture cache');return new i(e)},i.fromImage=function(t,e,r){return new i(n.fromImage(t,e,r))}},{"../c2d/Geometry2d":58,"../const":79,"../display/Container":82,"../textures/Texture":147,"../utils":154,"./SpriteFrame":134}],134:[function(t,e,r){function i(t){n.Rectangle.call(this,0,0,1,1),this.inner=null,this._textureFrame=t,this.anchor=new o(this.makeDirty,this,0,0),this.size=new o(this.makeDirty,this,0,0),this._dirtyVersion=0,this._textureVersion=0}var n=t("../math"),o=t("../display/ObservablePoint");i.prototype=Object.create(n.Rectangle.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{textureFrame:{get:function(){return this._textureFrame},set:function(t){this._textureFrame=t,this._dirtyVersion++}},spriteWidth:{get:function(){return(this.inner||this).width}},spriteHeight:{get:function(){return(this.inner||this).height}}}),i.prototype._update=function(){var t=this.size,e=t._x,r=t._y,i=this.textureFrame;0===e?0===r?(e=i.width,r=i.height):e=i.width*r/i.height:0===r&&(r=i.height*e/i.width);var o=e/i.width,s=r/i.height;this.width=e,this.height=r,this.x=-this.anchor._x*e,this.y=-this.anchor._y*r;var a=i.inner;if(a){var h=this.inner=this.inner||new n.Rectangle(0,0,1,1);h.width=a.width*o,h.height=a.height*s,h.x=this.x+a.x*o,h.y=this.y+a.y*s}else this.inner=null},i.prototype.makeDirty=function(){this._dirtyVersion++},i.prototype.update=function(){this.version===this._dirtyVersion&&this._textureVersion===this._textureFrame.version||(this.version=this._dirtyVersion,this._textureVersion=this.textureFrame.version,this._update())}},{"../display/ObservablePoint":86,"../math":103}],135:[function(t,e,r){function i(t){this.renderer=t}var n=t("../../renderers/canvas/CanvasRenderer"),o=t("../../const"),s=t("../../math"),a=new s.Matrix,h=t("./CanvasTinter");i.prototype.constructor=i,e.exports=i,n.registerPlugin("sprite",i),i.prototype.render=function(t){var e,r,i=t._texture,n=this.renderer,u=t.projectionMatrix2d,l=i._frame,c=t._frame.inner||t._frame,d=c.width,p=c.height;if(!(d<=0||p<=0)&&i.baseTexture.source&&(n.setBlendMode(t.blendMode),i.valid)){n.context.globalAlpha=t.worldAlpha;var f=i.baseTexture.scaleMode===o.SCALE_MODES.LINEAR;if(n.smoothProperty&&n.context[n.smoothProperty]!==f&&(n.context[n.smoothProperty]=f),i.rotate){if(u.copy(a),u=a,s.GroupD8.matrixAppendRotationInv(u,i.rotate,c.x+d/2,c.y+p/2),s.GroupD8.isSwapWidthHeight(i.rotate)){var y=d;d=p,p=y}e=-d/2,r=-p/2}else e=c.x,r=c.y;n.roundPixels?(n.context.setTransform(u.a,u.b,u.c,u.d,u.tx*n.resolution|0,u.ty*n.resolution|0),e=0|e,r=0|r):n.context.setTransform(u.a,u.b,u.c,u.d,u.tx*n.resolution,u.ty*n.resolution);var m=i.baseTexture.resolution;16777215!==t.tint?(t.cachedTint!==t.tint&&(t.cachedTint=t.tint,t.tintedTexture=h.getTintedTexture(t,t.tint)),n.context.drawImage(t.tintedTexture,0,0,l.width*m,l.height*m,e*n.resolution,r*n.resolution,d*n.resolution,p*n.resolution)):n.context.drawImage(i.baseTexture.source,l.x*m,l.y*m,l.width*m,l.height*m,e*n.resolution,r*n.resolution,d*n.resolution,p*n.resolution)}},i.prototype.destroy=function(){this.renderer=null}},{"../../const":79,"../../math":103,"../../renderers/canvas/CanvasRenderer":110,"./CanvasTinter":136}],136:[function(t,e,r){var i=t("../../utils"),n=t("../../renderers/canvas/utils/canUseNewCanvasBlendModes"),o={};e.exports=o,o.getTintedTexture=function(t,e){var r=t.texture;e=o.roundColor(e);var i="#"+("00000"+(0|e).toString(16)).substr(-6);if(r.tintCache=r.tintCache||{},r.tintCache[i])return r.tintCache[i];var n=o.canvas||document.createElement("canvas");if(o.tintMethod(r,e,n),o.convertTintToImage){var s=new Image;s.src=n.toDataURL(),r.tintCache[i]=s}else r.tintCache[i]=n,o.canvas=null;return n},o.tintWithMultiply=function(t,e,r){var i=r.getContext("2d"),n=t._frame;r.width=n.width,r.height=n.height,i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply",i.drawImage(t.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height)},o.tintWithOverlay=function(t,e,r){var i=r.getContext("2d"),n=t._frame;r.width=n.width,r.height=n.height,i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height)},o.tintWithPerPixel=function(t,e,r){var n=r.getContext("2d"),o=t._frame;r.width=o.width,r.height=o.height,n.globalCompositeOperation="copy",n.drawImage(t.baseTexture.source,o.x,o.y,o.width,o.height,0,0,o.width,o.height);for(var s=i.hex2rgb(e),a=s[0],h=s[1],u=s[2],l=n.getImageData(0,0,o.width,o.height),c=l.data,d=0;d<c.length;d+=4)c[d+0]*=a,c[d+1]*=h,c[d+2]*=u;n.putImageData(l,0,0)},o.roundColor=function(t){var e=o.cacheStepsPerColorChannel,r=i.hex2rgb(t);return r[0]=Math.min(255,r[0]/e*e),r[1]=Math.min(255,r[1]/e*e),r[2]=Math.min(255,r[2]/e*e),i.rgb2hex(r)},o.cacheStepsPerColorChannel=8,o.convertTintToImage=!1,o.canUseMultiply=n(),o.tintMethod=o.canUseMultiply?o.tintWithMultiply:o.tintWithPerPixel},{"../../renderers/canvas/utils/canUseNewCanvasBlendModes":113,"../../utils":154}],137:[function(t,e,r){var i=function(t){this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)};e.exports=i,i.prototype.destroy=function(){this.vertices=null,this.positions=null,this.uvs=null,this.colors=null}},{}],138:[function(t,e,r){function i(t){n.call(this,t),this.vertSize=6,this.vertByteSize=4*this.vertSize,this.size=l.SPRITE_BATCH_SIZE,this.buffers=[];for(var e=1;e<=d.nextPow2(this.size);e*=2){var r=4*e*this.vertByteSize;this.buffers.push(new u(r))}this.indices=s(this.size),this.shaders=null,this.textureCount=0,this.currentIndex=0,this.tick=0,this.groups=[];for(var i=0;i<this.size;i++)this.groups[i]={textures:[],textureCount:0,ids:[],size:0,start:0,blend:0};this.sprites=[],this.vertexBuffers=[],this.vaos=[],this.vaoMax=2,this.vertexCount=0,this.renderer.on("prerender",this.onPrerender,this)}var n=t("../../renderers/webgl/utils/ObjectRenderer"),o=t("../../renderers/webgl/WebGLRenderer"),s=t("../../utils/createIndicesForQuads"),a=t("./generateMultiTextureShader"),h=t("../../renderers/webgl/utils/checkMaxIfStatmentsInShader"),u=t("./BatchBuffer"),l=t("../../const"),c=t("pixi-gl-core"),d=t("bit-twiddle");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,o.registerPlugin("sprite",i),i.prototype.onContextChange=function(){var t=this.renderer.gl;this.MAX_TEXTURES=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),l.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=h(this.MAX_TEXTURES,t),this.shaders=new Array(this.MAX_TEXTURES),this.shaders[0]=a(t,1),this.shaders[1]=a(t,2),this.indexBuffer=c.GLBuffer.createIndexBuffer(t,this.indices,t.STATIC_DRAW);for(var e=this.shaders[1],r=0;r<this.vaoMax;r++)this.vertexBuffers[r]=c.GLBuffer.createVertexBuffer(t,null,t.STREAM_DRAW),this.vaos[r]=this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(this.vertexBuffers[r],e.attributes.aVertexPosition,t.FLOAT,!1,this.vertByteSize,0).addAttribute(this.vertexBuffers[r],e.attributes.aTextureCoord,t.UNSIGNED_SHORT,!0,this.vertByteSize,12).addAttribute(this.vertexBuffers[r],e.attributes.aColor,t.UNSIGNED_BYTE,!0,this.vertByteSize,16).addAttribute(this.vertexBuffers[r],e.attributes.aTextureId,t.FLOAT,!1,this.vertByteSize,20);this.vao=this.vaos[0],this.currentBlendMode=99999},i.prototype.onPrerender=function(){this.vertexCount=0},i.prototype.render=function(t){this.currentIndex>=this.size&&this.flush(),t.texture._uvs&&(this.sprites[this.currentIndex++]=t)},i.prototype.flush=function(){if(0!==this.currentIndex){var t,e,r,i,n,o,s,h=this.renderer.gl,u=d.nextPow2(this.currentIndex),l=d.log2(u),p=this.buffers[l],f=this.sprites,y=this.groups,m=p.float32View,v=p.uint32View,x=0,g=1,_=0,b=y[0],T=f[0].blendMode,M=f[0].worldProjection;b.textureCount=0,b.start=0,b.blend=T,b.worldProjection=M,this.tick++;for(var S=0;S<this.currentIndex;S++){var w=f[S];t=w._texture.baseTexture,T===w.blendMode&&M===w.worldProjection||(T=w.blendMode,M=w.worldProjection,e=null,_=this.MAX_TEXTURES,this.tick++),e!==t&&(e=t,t._enabled!==this.tick&&(_===this.MAX_TEXTURES&&(this.tick++,_=0,b.size=S-b.start,b=y[g++],b.textureCount=0,b.blend=T,b.worldProjection=M,b.start=S),t._enabled=this.tick,t._id=_,b.textures[b.textureCount++]=t,_++)),r=w.computedGeometry.vertices,i=(w.tint>>16)+(65280&w.tint)+((255&w.tint)<<16)+(255*w.worldAlpha<<24),n=w._texture._uvs.uvsUint32,o=t._id;var E=0,D=w.computedGeometry.is3d;m[x++]=r[E++],m[x++]=r[E++],m[x++]=D?r[E++]:0,v[x++]=n[0],v[x++]=i,m[x++]=o,m[x++]=r[E++],m[x++]=r[E++],m[x++]=D?r[E++]:0,v[x++]=n[1],v[x++]=i,m[x++]=o,m[x++]=r[E++],m[x++]=r[E++],m[x++]=D?r[E++]:0,v[x++]=n[2],v[x++]=i,m[x++]=o,m[x++]=r[E++],m[x++]=r[E++],m[x++]=D?r[E++]:0,v[x++]=n[3],v[x++]=i,m[x++]=o}for(b.size=S-b.start,this.vertexCount++,this.vaoMax<=this.vertexCount&&(this.vaoMax++,s=this.shaders[1],this.vertexBuffers[this.vertexCount]=c.GLBuffer.createVertexBuffer(h,null,h.STREAM_DRAW),this.vaos[this.vertexCount]=this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(this.vertexBuffers[this.vertexCount],s.attributes.aVertexPosition,h.FLOAT,!1,this.vertByteSize,0).addAttribute(this.vertexBuffers[this.vertexCount],s.attributes.aTextureCoord,h.UNSIGNED_SHORT,!0,this.vertByteSize,12).addAttribute(this.vertexBuffers[this.vertexCount],s.attributes.aColor,h.UNSIGNED_BYTE,!0,this.vertByteSize,16).addAttribute(this.vertexBuffers[this.vertexCount],s.attributes.aTextureId,h.FLOAT,!1,this.vertByteSize,20)),this.vertexBuffers[this.vertexCount].upload(p.vertices,0),this.vao=this.vaos[this.vertexCount].bind(),S=0;S<g;S++){var C=y[S],P=C.textureCount;s=this.shaders[P-1],this.renderer.bindProjection(C.worldProjection),s||(s=this.shaders[P-1]=a(h,P)),this.renderer.bindShader(s);for(var O=0;O<P;O++)this.renderer.bindTexture(C.textures[O],O);this.renderer.state.setBlendMode(C.blend),h.drawElements(h.TRIANGLES,6*C.size,h.UNSIGNED_SHORT,6*C.start*2)}this.currentIndex=0}},i.prototype.start=function(){this.tick%=1e3},i.prototype.stop=function(){this.flush(),this.vao.unbind()},i.prototype.destroy=function(){for(var t=0;t<this.vertexCount;t++)this.vertexBuffers[t].destroy(),this.vaos[t].destroy();for(this.indexBuffer.destroy(),this.renderer.off("prerender",this.onPrerender,this),n.prototype.destroy.call(this),t=0;t<this.shaders.length;t++)this.shaders[t]&&this.shaders[t].destroy();for(this.vertexBuffers=null,this.vaos=null,this.indexBuffer=null,this.indices=null,this.sprites=null,t=0;t<this.buffers.length;t++)this.buffers[t].destroy()}},{"../../const":79,"../../renderers/webgl/WebGLRenderer":117,"../../renderers/webgl/utils/ObjectRenderer":127,"../../renderers/webgl/utils/checkMaxIfStatmentsInShader":130,"../../utils/createIndicesForQuads":152,"./BatchBuffer":137,"./generateMultiTextureShader":139,"bit-twiddle":2,"pixi-gl-core":25}],139:[function(t,e,r){function i(t,e){var r="#define GLSLIFY 1\nattribute vec3 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat4 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n   gl_Position = projectionMatrix * vec4(aVertexPosition, 1.0);\n   vTextureCoord = aTextureCoord;\n   vTextureId = aTextureId;\n   vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n",i=s;i=i.replace(/%count%/gi,e),i=i.replace(/%forloop%/gi,n(e));for(var a=new o(t,r,i),h=[],u=0;u<e;u++)h[u]=u;return a.bind(),a.uniforms.uSamplers=h,a}function n(t){var e="";e+="\n",e+="\n";for(var r=0;r<t;r++)r>0&&(e+="\nelse "),r<t-1&&(e+="if(textureId == "+r+".0)"),e+="\n{",e+="\n\tcolor = texture2D(uSamplers["+r+"], vTextureCoord);",e+="\n}";return e+="\n",e+="\n"}var o=t("../../Shader"),s=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","float textureId = floor(vTextureId+0.01);","%forloop%","gl_FragColor = color * vColor;","}"].join("\n");e.exports=i},{"../../Shader":53}],140:[function(t,e,r){function i(t,e,r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||a.RESOLUTION,this._text=null,this._style=null,this._styleListener=null,this._font="";var i=o.fromCanvas(this.canvas);i.trim=new s.Rectangle,n.call(this,i),this.text=t,this.style=e}var n=t("../sprites/Sprite"),o=t("../textures/Texture"),s=t("../math"),a=t("../const"),h=t("./TextStyle");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.fontPropertiesCache={},i.fontPropertiesCanvas=document.createElement("canvas"),i.fontPropertiesContext=i.fontPropertiesCanvas.getContext("2d"),Object.defineProperties(i.prototype,{width:{get:function(){return this.updateText(!0),this.scale.x*this._texture._frame.width},set:function(t){this.updateText(!0),this.scale.x=t/this._texture._frame.width,this._width=t}},height:{get:function(){return this.updateText(!0),this.scale.y*this._texture._frame.height},set:function(t){this.updateText(!0),this.scale.y=t/this._texture._frame.height,this._height=t}},style:{get:function(){return this._style},set:function(t){this._style&&this._style.off(a.TEXT_STYLE_CHANGED,this._onStyleChange,this),t=t||{},t instanceof h?this._style=t:this._style=new h(t),this._style.on(a.TEXT_STYLE_CHANGED,this._onStyleChange,this),this.dirty=!0}},text:{get:function(){return this._text},set:function(t){t=t||" ",t=t.toString(),this._text!==t&&(this._text=t,this.dirty=!0)}}}),i.prototype.updateText=function(t){if(this.dirty||!t){var e=this._style,r="number"==typeof e.fontSize?e.fontSize+"px":e.fontSize;this._font=e.fontStyle+" "+e.fontVariant+" "+e.fontWeight+" "+r+" "+e.fontFamily,this.context.font=this._font;var i,n=e.wordWrap?this.wordWrap(this._text):this._text,o=n.split(/(?:\r\n|\r|\n)/),s=new Array(o.length),a=0,h=this.determineFontProperties(this._font);for(i=0;i<o.length;i++){var u=this.context.measureText(o[i]).width+(o[i].length-1)*e.letterSpacing;s[i]=u,a=Math.max(a,u)}var l=a+e.strokeThickness;e.dropShadow&&(l+=e.dropShadowDistance),this.canvas.width=Math.ceil((l+this.context.lineWidth)*this.resolution);var c=this.style.lineHeight||h.fontSize+e.strokeThickness,d=c*o.length;e.dropShadow&&(d+=e.dropShadowDistance),this.canvas.height=Math.ceil((d+2*this._style.padding)*this.resolution),this.context.scale(this.resolution,this.resolution),navigator.isCocoonJS&&this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.font=this._font,this.context.strokeStyle=e.stroke,this.context.lineWidth=e.strokeThickness,this.context.textBaseline=e.textBaseline,this.context.lineJoin=e.lineJoin,this.context.miterLimit=e.miterLimit;var p,f;if(e.dropShadow){e.dropShadowBlur>0?(this.context.shadowColor=e.dropShadowColor,this.context.shadowBlur=e.dropShadowBlur):this.context.fillStyle=e.dropShadowColor;var y=Math.cos(e.dropShadowAngle)*e.dropShadowDistance,m=Math.sin(e.dropShadowAngle)*e.dropShadowDistance;for(i=0;i<o.length;i++)p=e.strokeThickness/2,f=e.strokeThickness/2+i*c+h.ascent,"right"===e.align?p+=a-s[i]:"center"===e.align&&(p+=(a-s[i])/2),e.fill&&this.drawLetterSpacing(o[i],p+y,f+m+e.padding)}for(this.context.fillStyle=e.fill,i=0;i<o.length;i++)p=e.strokeThickness/2,f=e.strokeThickness/2+i*c+h.ascent,"right"===e.align?p+=a-s[i]:"center"===e.align&&(p+=(a-s[i])/2),e.stroke&&e.strokeThickness&&this.drawLetterSpacing(o[i],p,f+e.padding,!0),e.fill&&this.drawLetterSpacing(o[i],p,f+e.padding);this.updateTexture()}},i.prototype.drawLetterSpacing=function(t,e,r,i){var n=this._style,o=n.letterSpacing;if(0===o)return void(i?this.context.strokeText(t,e,r):this.context.fillText(t,e,r));for(var s,a=String.prototype.split.call(t,""),h=0,u=e;h<t.length;)s=a[h++],i?this.context.strokeText(s,u,r):this.context.fillText(s,u,r),u+=this.context.measureText(s).width+o},i.prototype.updateTexture=function(){var t=this._texture,e=this._style;t.baseTexture.hasLoaded=!0,t.baseTexture.resolution=this.resolution,t.baseTexture.width=this.canvas.width/this.resolution,t.baseTexture.height=this.canvas.height/this.resolution,t.orig.width=t._frame.width=this.canvas.width/this.resolution,t.orig.height=t._frame.height=this.canvas.height/this.resolution,t.trim.x=0,t.trim.y=-e.padding,t.trim.width=t._frame.width,t.trim.height=t._frame.height-2*e.padding,this._width=this.canvas.width/this.resolution,this._height=this.canvas.height/this.resolution,t.baseTexture.emit("update",t.baseTexture),this.dirty=!1},i.prototype._renderWebGL=function(t){this.updateText(!0),n.prototype._renderWebGL.call(this,t)},i.prototype._renderCanvas=function(t){this.updateText(!0),n.prototype._renderCanvas.call(this,t)},i.prototype.determineFontProperties=function(t){var e=i.fontPropertiesCache[t];if(!e){e={};var r=i.fontPropertiesCanvas,n=i.fontPropertiesContext;n.font=t;var o=Math.ceil(n.measureText("|MÉq").width),s=Math.ceil(n.measureText("M").width),a=2*s;s=1.4*s|0,r.width=o,r.height=a,n.fillStyle="#f00",n.fillRect(0,0,o,a),n.font=t,n.textBaseline="alphabetic",n.fillStyle="#000",n.fillText("|MÉq",0,s);var h,u,l=n.getImageData(0,0,o,a).data,c=l.length,d=4*o,p=0,f=!1;for(h=0;h<s;h++){for(u=0;u<d;u+=4)if(255!==l[p+u]){f=!0;break}if(f)break;p+=d}for(e.ascent=s-h,p=c-d,f=!1,h=a;h>s;h--){for(u=0;u<d;u+=4)if(255!==l[p+u]){f=!0;break}if(f)break;p-=d}e.descent=h-s,e.fontSize=e.ascent+e.descent,i.fontPropertiesCache[t]=e}return e},i.prototype.wordWrap=function(t){for(var e="",r=t.split("\n"),i=this._style.wordWrapWidth,n=0;n<r.length;n++){
  for(var o=i,s=r[n].split(" "),a=0;a<s.length;a++){var h=this.context.measureText(s[a]).width;if(this._style.breakWords&&h>i)for(var u=s[a].split(""),l=0;l<u.length;l++){var c=this.context.measureText(u[l]).width;c>o?(e+="\n"+u[l],o=i-c):(0===l&&(e+=" "),e+=u[l],o-=c)}else{var d=h+this.context.measureText(" ").width;0===a||d>o?(a>0&&(e+="\n"),e+=s[a],o=i-h):(o-=d,e+=" "+s[a])}}n<r.length-1&&(e+="\n")}return e},i.prototype.getBounds=function(){return this.updateText(!0),n.prototype.getBounds.call(this)},i.prototype._onStyleChange=function(){this.dirty=!0},i.prototype.destroy=function(t){n.prototype.destroy.call(this,t),this.context=null,this.canvas=null,this._style.off(a.TEXT_STYLE_CHANGED,this._onStyleChange,this),this._style=null}},{"../const":79,"../math":103,"../sprites/Sprite":133,"../textures/Texture":147,"./TextStyle":141}],141:[function(t,e,r){function i(t){o.call(this),Object.assign(this,this._defaults,t)}function n(t){return"number"==typeof t?a.hex2string(t):t}var o=t("eventemitter3"),s=t("../const"),a=t("../utils");i.prototype=Object.create(o.prototype),i.prototype.constructor=i,e.exports=i,i.prototype._defaults={align:"left",breakWords:!1,dropShadow:!1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"#000000",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",wordWrap:!1,wordWrapWidth:100},i.prototype.clone=function(){var t={};for(var e in this._defaults)t[e]=this[e];return new i(t)},i.prototype.reset=function(){Object.assign(this,this._defaults)},Object.defineProperties(i.prototype,{align:{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.emit(s.TEXT_STYLE_CHANGED))}},breakWords:{get:function(){return this._breakWords},set:function(t){this._breakWords!==t&&(this._breakWords=t,this.emit(s.TEXT_STYLE_CHANGED))}},dropShadow:{get:function(){return this._dropShadow},set:function(t){this._dropShadow!==t&&(this._dropShadow=t,this.emit(s.TEXT_STYLE_CHANGED))}},dropShadowAngle:{get:function(){return this._dropShadowAngle},set:function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.emit(s.TEXT_STYLE_CHANGED))}},dropShadowBlur:{get:function(){return this._dropShadowBlur},set:function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.emit(s.TEXT_STYLE_CHANGED))}},dropShadowColor:{get:function(){return this._dropShadowColor},set:function(t){var e=n(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.emit(s.TEXT_STYLE_CHANGED))}},dropShadowDistance:{get:function(){return this._dropShadowDistance},set:function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.emit(s.TEXT_STYLE_CHANGED))}},fill:{get:function(){return this._fill},set:function(t){var e=n(t);this._fill!==e&&(this._fill=e,this.emit(s.TEXT_STYLE_CHANGED))}},fontFamily:{get:function(){return this._fontFamily},set:function(t){this.fontFamily!==t&&(this._fontFamily=t,this.emit(s.TEXT_STYLE_CHANGED))}},fontSize:{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.emit(s.TEXT_STYLE_CHANGED))}},fontStyle:{get:function(){return this._fontStyle},set:function(t){this._fontStyle!==t&&(this._fontStyle=t,this.emit(s.TEXT_STYLE_CHANGED))}},fontVariant:{get:function(){return this._fontVariant},set:function(t){this._fontVariant!==t&&(this._fontVariant=t,this.emit(s.TEXT_STYLE_CHANGED))}},fontWeight:{get:function(){return this._fontWeight},set:function(t){this._fontWeight!==t&&(this._fontWeight=t,this.emit(s.TEXT_STYLE_CHANGED))}},letterSpacing:{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.emit(s.TEXT_STYLE_CHANGED))}},lineHeight:{get:function(){return this._lineHeight},set:function(t){this._lineHeight!==t&&(this._lineHeight=t,this.emit(s.TEXT_STYLE_CHANGED))}},lineJoin:{get:function(){return this._lineJoin},set:function(t){this._lineJoin!==t&&(this._lineJoin=t,this.emit(s.TEXT_STYLE_CHANGED))}},miterLimit:{get:function(){return this._miterLimit},set:function(t){this._miterLimit!==t&&(this._miterLimit=t,this.emit(s.TEXT_STYLE_CHANGED))}},padding:{get:function(){return this._padding},set:function(t){this._padding!==t&&(this._padding=t,this.emit(s.TEXT_STYLE_CHANGED))}},stroke:{get:function(){return this._stroke},set:function(t){var e=n(t);this._stroke!==e&&(this._stroke=e,this.emit(s.TEXT_STYLE_CHANGED))}},strokeThickness:{get:function(){return this._strokeThickness},set:function(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.emit(s.TEXT_STYLE_CHANGED))}},textBaseline:{get:function(){return this._textBaseline},set:function(t){this._textBaseline!==t&&(this._textBaseline=t,this.emit(s.TEXT_STYLE_CHANGED))}},wordWrap:{get:function(){return this._wordWrap},set:function(t){this._wordWrap!==t&&(this._wordWrap=t,this.emit(s.TEXT_STYLE_CHANGED))}},wordWrapWidth:{get:function(){return this._wordWrapWidth},set:function(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.emit(s.TEXT_STYLE_CHANGED))}}})},{"../const":79,"../utils":154,eventemitter3:4}],142:[function(t,e,r){function i(t,e,r,i){n.call(this,null,r),this.width=t||100,this.height=e||100,this.resolution=i||o.RESOLUTION,this.scaleMode=r||o.SCALE_MODES.DEFAULT,this.hasLoaded=!0,this._glRenderTargets=[],this._canvasRenderTarget=null,this.valid=!1}var n=t("./BaseTexture"),o=t("../const");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.resize=function(t,e){t===this.width&&e===this.height||(this.valid=t>0&&e>0,this.width=t,this.height=e,this.valid&&(this.emit("update",this),this.filterManager&&this.filterManager.resize(this.width,this.height)))},i.prototype.destroy=function(){n.prototype.destroy.call(this,!0),this.filterManager&&this.filterManager.destroy(),this.renderer=null}},{"../const":79,"./BaseTexture":143}],143:[function(t,e,r){function i(t,e,r){s.call(this),this.uid=n.uid(),this.touched=0,this.resolution=r||o.RESOLUTION,this.width=100,this.height=100,this.realWidth=100,this.realHeight=100,this.scaleMode=e||o.SCALE_MODES.DEFAULT,this.hasLoaded=!1,this.isLoading=!1,this.source=null,this.premultipliedAlpha=!0,this.imageUrl=null,this.isPowerOfTwo=!1,this.mipmap=o.MIPMAP_TEXTURES,this.wrapMode=o.WRAP_MODES.DEFAULT,this._glTextures=[],this._enabled=0,this._id=0,t&&this.loadSource(t)}var n=t("../utils"),o=t("../const"),s=t("eventemitter3"),a=t("../utils/determineCrossOrigin"),h=t("bit-twiddle");i.prototype=Object.create(s.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.update=function(){this.realWidth=this.source.naturalWidth||this.source.videoWidth||this.source.width,this.realHeight=this.source.naturalHeight||this.source.videoHeight||this.source.height,this.width=this.realWidth/this.resolution,this.height=this.realHeight/this.resolution,this.isPowerOfTwo=h.isPow2(this.realWidth)&&h.isPow2(this.realHeight),this.emit("update",this)},i.prototype.loadSource=function(t){var e=this.isLoading;if(this.hasLoaded=!1,this.isLoading=!1,e&&this.source&&(this.source.onload=null,this.source.onerror=null),this.source=t,(this.source.complete||this.source.getContext)&&this.source.width&&this.source.height)this._sourceLoaded();else if(!t.getContext){this.isLoading=!0;var r=this;t.onload=function(){t.onload=null,t.onerror=null,r.isLoading&&(r.isLoading=!1,r._sourceLoaded(),r.emit("loaded",r))},t.onerror=function(){t.onload=null,t.onerror=null,r.isLoading&&(r.isLoading=!1,r.emit("error",r))},t.complete&&t.src&&(this.isLoading=!1,t.onload=null,t.onerror=null,t.width&&t.height?(this._sourceLoaded(),e&&this.emit("loaded",this)):e&&this.emit("error",this))}},i.prototype._sourceLoaded=function(){this.hasLoaded=!0,this.update()},i.prototype.destroy=function(){this.imageUrl?(delete n.BaseTextureCache[this.imageUrl],delete n.TextureCache[this.imageUrl],this.imageUrl=null,navigator.isCocoonJS||(this.source.src="")):this.source&&this.source._pixiId&&delete n.BaseTextureCache[this.source._pixiId],this.source=null,this.dispose()},i.prototype.dispose=function(){this.emit("dispose",this)},i.prototype.updateSourceImage=function(t){this.source.src=t,this.loadSource(this.source)},i.fromImage=function(t,e,r){var o=n.BaseTextureCache[t];if(!o){var s=new Image;void 0===e&&0!==t.indexOf("data:")&&(s.crossOrigin=a(t)),o=new i(s,r),o.imageUrl=t,s.src=t,n.BaseTextureCache[t]=o,o.resolution=n.getResolutionOfUrl(t)}return o},i.fromCanvas=function(t,e){t._pixiId||(t._pixiId="canvas_"+n.uid());var r=n.BaseTextureCache[t._pixiId];return r||(r=new i(t,e),n.BaseTextureCache[t._pixiId]=r),r}},{"../const":79,"../utils":154,"../utils/determineCrossOrigin":153,"bit-twiddle":2,eventemitter3:4}],144:[function(t,e,r){function i(t,e){n.call(this,this.makeDirty,this),t&&this.copy(t),this._inner=null,this.inner=e||null,this.version=0}var n=t("./ObservableRect");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{inner:{get:function(){return this._inner},set:function(t){t?(this._inner=this._inner||new n(this.makeDirty,this),this._inner.copy(t)):this._inner=null}}}),i.prototype.makeDirty=function(){this.version++}},{"./ObservableRect":145}],145:[function(t,e,r){function i(t,e,r,i,n,o){this._x=r||0,this._y=i||0,this._width=n||1,this._height=o||1,this.cb=t,this.scope=e}i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{x:{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))}},y:{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))}},width:{get:function(){return this._width},set:function(t){this._width!==t&&(this._width=t,this.cb.call(this.scope))}},height:{get:function(){return this._height},set:function(t){this._height!==t&&(this._height=t,this.cb.call(this.scope))}}}),i.prototype.set=function(t,e,r,i){this._x===t&&this._y===e&&this._width===r&&this._height===i||(this._x=t,this._y=e,this._width=r,this._height=i,this.cb.call(this.scope))},i.prototype.copy=function(t){this._x===t.x&&this._y===t.y&&this._width===t.width&&this._height===t.height||(this._x=t.x,this._y=t.y,this._width=t.width,this._height=t.height,this.cb.call(this.scope))}},{}],146:[function(t,e,r){function i(t,e){if(this.legacyRenderer=null,!(t instanceof n)){var r=arguments[1],i=arguments[2],s=arguments[3]||0,a=arguments[4]||1;console.warn("v4 RenderTexture now expects a new BaseRenderTexture. Please use RenderTexture.create("+r+", "+i+")"),this.legacyRenderer=arguments[0],e=null,t=new n(r,i,s,a)}o.call(this,t,e),this.valid=!0,this._updateUvs()}var n=t("./BaseRenderTexture"),o=t("./Texture");i.prototype=Object.create(o.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.resize=function(t,e,r){this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,r||this.baseTexture.resize(t,e),this._updateUvs()},i.create=function(t,e,r,o){return new i(new n(t,e,r,o))}},{"./BaseRenderTexture":142,"./Texture":147}],147:[function(t,e,r){function i(t,e,r,n,o){if(a.call(this),this.noFrame=!1,e||(this.noFrame=!0,e=new u.Rectangle(0,0,1,1)),t instanceof i&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.valid=!1,this.requiresUpdate=!1,this._uvs=null,this._orig=new h(r||e,n),this._rotate=+(o||0),o===!0)this._rotate=2;else if(this._rotate%2!==0)throw"attempt to use diamond-shaped UVs. If you are sure, set rotation manually";t.hasLoaded?(this.noFrame&&(e=new u.Rectangle(0,0,t.width,t.height),t.on("update",this.onBaseTextureUpdated,this)),this.frame=e):t.once("loaded",this.onBaseTextureLoaded,this)}var n=t("./BaseTexture"),o=t("./VideoBaseTexture"),s=t("./TextureUvs"),a=t("eventemitter3"),h=t("./DoubleRect"),u=t("../math"),l=t("../utils");i.prototype=Object.create(a.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{frame:{get:function(){return this._frame},set:function(t){if(this._frame=t,this.noFrame=!1,t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height)throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.valid=t&&t.width&&t.height&&this.baseTexture.hasLoaded,this._orig.inner||this.rotate||this._orig.copy(t),this.valid&&this._updateUvs()}},orig:{get:function(){return this._orig},set:function(t){this._orig.copy(t)}},trim:{get:function(){return this._orig.inner},set:function(t){this._orig.inner=t}},rotate:{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this._updateUvs()}},width:{get:function(){return this._orig.width}},height:{get:function(){return this._orig.height}}}),i.prototype.update=function(){this.baseTexture.update()},i.prototype.onBaseTextureLoaded=function(t){this.noFrame?this.frame=new u.Rectangle(0,0,t.width,t.height):this.frame=this._frame,this.baseTexture.on("update",this.onBaseTextureUpdated,this),this.emit("update",this)},i.prototype.onBaseTextureUpdated=function(t){this._frame.width=t.width,this._frame.height=t.height,this.emit("update",this)},i.prototype.destroy=function(t){this.baseTexture&&(t&&this.baseTexture.destroy(),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture.off("loaded",this.onBaseTextureLoaded,this),this.baseTexture=null),this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,this.off("dispose",this.dispose,this),this.off("update",this.update,this)},i.prototype.clone=function(){return new i(this.baseTexture,this.frame,this.orig,this.trim,this.rotate)},i.prototype._updateUvs=function(){this._uvs||(this._uvs=new s),this._uvs.set(this._frame,this.baseTexture,this.rotate)},i.fromImage=function(t,e,r){var o=l.TextureCache[t];return o||(o=new i(n.fromImage(t,e,r)),l.TextureCache[t]=o),o},i.fromFrame=function(t){var e=l.TextureCache[t];if(!e)throw new Error('The frameId "'+t+'" does not exist in the texture cache');return e},i.fromCanvas=function(t,e){return new i(n.fromCanvas(t,e))},i.fromVideo=function(t,e){return"string"==typeof t?i.fromVideoUrl(t,e):new i(o.fromVideo(t,e))},i.fromVideoUrl=function(t,e){return new i(o.fromUrl(t,e))},i.from=function(t){if("string"==typeof t){var e=l.TextureCache[t];if(!e){var r=null!==t.match(/\.(mp4|webm|ogg|h264|avi|mov)$/);return r?i.fromVideoUrl(t):i.fromImage(t)}return e}return t instanceof HTMLCanvasElement?i.fromCanvas(t):t instanceof HTMLVideoElement?i.fromVideo(t):t instanceof n?new i(n):void 0},i.addTextureToCache=function(t,e){l.TextureCache[e]=t},i.removeTextureFromCache=function(t){var e=l.TextureCache[t];return delete l.TextureCache[t],delete l.BaseTextureCache[t],e},i.EMPTY=new i(new n),i.EMPTY.destroy=function(){},i.EMPTY.on=function(){},i.EMPTY.once=function(){},i.EMPTY.emit=function(){}},{"../math":103,"../utils":154,"./BaseTexture":143,"./DoubleRect":144,"./TextureUvs":148,"./VideoBaseTexture":149,eventemitter3:4}],148:[function(t,e,r){function i(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsUint32=new Uint32Array(4)}e.exports=i;var n=t("../math/GroupD8");i.prototype.set=function(t,e,r){var i=e.width,o=e.height;if(r){var s=t.width/2/i,a=t.height/2/o,h=t.x/i+s,u=t.y/o+a;r=n.add(r,n.NW),this.x0=h+s*n.uX(r),this.y0=u+a*n.uY(r),r=n.add(r,2),this.x1=h+s*n.uX(r),this.y1=u+a*n.uY(r),r=n.add(r,2),this.x2=h+s*n.uX(r),this.y2=u+a*n.uY(r),r=n.add(r,2),this.x3=h+s*n.uX(r),this.y3=u+a*n.uY(r)}else this.x0=t.x/i,this.y0=t.y/o,this.x1=(t.x+t.width)/i,this.y1=t.y/o,this.x2=(t.x+t.width)/i,this.y2=(t.y+t.height)/o,this.x3=t.x/i,this.y3=(t.y+t.height)/o;this.uvsUint32[0]=(65535*this.y0&65535)<<16|65535*this.x0&65535,this.uvsUint32[1]=(65535*this.y1&65535)<<16|65535*this.x1&65535,this.uvsUint32[2]=(65535*this.y2&65535)<<16|65535*this.x2&65535,this.uvsUint32[3]=(65535*this.y3&65535)<<16|65535*this.x3&65535}},{"../math/GroupD8":100}],149:[function(t,e,r){function i(t,e){if(!t)throw new Error("No video source element specified.");(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),o.call(this,t,e),this.autoUpdate=!1,this._onUpdate=this._onUpdate.bind(this),this._onCanPlay=this._onCanPlay.bind(this),t.complete||(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("play",this._onPlayStart.bind(this)),t.addEventListener("pause",this._onPlayStop.bind(this))),this.__loaded=!1}function n(t,e){e||(e="video/"+t.substr(t.lastIndexOf(".")+1));var r=document.createElement("source");return r.src=t,r.type=e,r}var o=t("./BaseTexture"),s=t("../utils");i.prototype=Object.create(o.prototype),i.prototype.constructor=i,e.exports=i,i.prototype._onUpdate=function(){this.autoUpdate&&(window.requestAnimationFrame(this._onUpdate),this.update())},i.prototype._onPlayStart=function(){this.autoUpdate||(window.requestAnimationFrame(this._onUpdate),this.autoUpdate=!0)},i.prototype._onPlayStop=function(){this.autoUpdate=!1},i.prototype._onCanPlay=function(){this.hasLoaded=!0,this.source&&(this.source.removeEventListener("canplay",this._onCanPlay),this.source.removeEventListener("canplaythrough",this._onCanPlay),this.width=this.source.videoWidth,this.height=this.source.videoHeight,this.source.play(),this.__loaded||(this.__loaded=!0,this.emit("loaded",this)))},i.prototype.destroy=function(){this.source&&this.source._pixiId&&(delete s.BaseTextureCache[this.source._pixiId],delete this.source._pixiId),o.prototype.destroy.call(this)},i.fromVideo=function(t,e){t._pixiId||(t._pixiId="video_"+s.uid());var r=s.BaseTextureCache[t._pixiId];return r||(r=new i(t,e),s.BaseTextureCache[t._pixiId]=r),r},i.fromUrl=function(t,e){var r=document.createElement("video");if(Array.isArray(t))for(var o=0;o<t.length;++o)r.appendChild(n(t[o].src||t[o],t[o].mime));else r.appendChild(n(t.src||t,t.mime));return r.load(),r.play(),i.fromVideo(r,e)},i.fromUrls=i.fromUrl},{"../utils":154,"./BaseTexture":143}],150:[function(t,e,r){function i(){var t=this;this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._emitter.listeners(s,!0)&&(t._requestId=requestAnimationFrame(t._tick)))},this._emitter=new o,this._requestId=null,this._maxElapsedMS=100,this.autoStart=!1,this.deltaTime=1,this.elapsedMS=1/n.TARGET_FPMS,this.lastTime=0,this.speed=1,this.started=!1}var n=t("../const"),o=t("eventemitter3"),s="tick";Object.defineProperties(i.prototype,{FPS:{get:function(){return 1e3/this.elapsedMS}},minFPS:{get:function(){return 1e3/this._maxElapsedMS},set:function(t){var e=Math.min(Math.max(0,t)/1e3,n.TARGET_FPMS);this._maxElapsedMS=1/e}}}),i.prototype._requestIfNeeded=function(){null===this._requestId&&this._emitter.listeners(s,!0)&&(this.lastTime=performance.now(),this._requestId=requestAnimationFrame(this._tick))},i.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},i.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},i.prototype.add=function(t,e){return this._emitter.on(s,t,e),this._startIfPossible(),this},i.prototype.addOnce=function(t,e){return this._emitter.once(s,t,e),this._startIfPossible(),this},i.prototype.remove=function(t,e){return this._emitter.off(s,t,e),this._emitter.listeners(s,!0)||this._cancelIfNeeded(),this},i.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},i.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},i.prototype.update=function(t){var e;t=t||performance.now(),Math.max(0,e=this.elapsedMS=t-this.lastTime),e>this._maxElapsedMS&&(e=this._maxElapsedMS),this.deltaTime=e*n.TARGET_FPMS*this.speed,this._emitter.emit(s,this.deltaTime),this.lastTime=t},e.exports=i},{"../const":79,eventemitter3:4}],151:[function(t,e,r){var i=t("./Ticker"),n=new i;n.autoStart=!0,e.exports={shared:n,Ticker:i}},{"./Ticker":150}],152:[function(t,e,r){var i=function(t){for(var e=6*t,r=new Uint16Array(e),i=0,n=0;i<e;i+=6,n+=4)r[i+0]=n+0,r[i+1]=n+1,r[i+2]=n+2,r[i+3]=n+0,r[i+4]=n+2,r[i+5]=n+3;return r};e.exports=i},{}],153:[function(t,e,r){var i,n=t("url"),o=function(t,e){if(0===t.indexOf("data:"))return"";e=e||window.location,i||(i=document.createElement("a")),i.href=t,t=n.parse(i.href);var r=!t.port&&""===e.port||t.port===e.port;return t.hostname===e.hostname&&r&&t.protocol===e.protocol?"":"anonymous"};e.exports=o},{url:49}],154:[function(t,e,r){var i=t("../const"),n=e.exports={_uid:0,_saidHello:!1,EventEmitter:t("eventemitter3"),pluginTarget:t("./pluginTarget"),uid:function(){return++n._uid},_uidTransform:0,_uidUpdateOrder:0,_uidDisplayOrder:0,_uidDisplayObject:0,_uidGeometry:0,_uidRaycast:0,incTransform:function(){return++n._uidTransform},incUpdateOrder:function(){return++n._uidUpdateOrder},incDisplayOrder:function(){return++n._uidDisplayOrder},incDisplayObject:function(){return++n._uidDisplayObject},incGeometry:function(){return++n._uidGeometry},incRaycast:function(){return++n._uidRaycast},resetUpdateOrder:function(){this._uidUpdateOrder=0},resetDisplayOrder:function(){this._uidDisplayOrder=0},hex2rgb:function(t,e){return e=e||[],e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e},hex2string:function(t){return t=t.toString(16),t="000000".substr(0,6-t.length)+t,"#"+t},rgb2hex:function(t){return(255*t[0]<<16)+(255*t[1]<<8)+255*t[2]},getResolutionOfUrl:function(t){var e=i.RETINA_PREFIX.exec(t);return e?parseFloat(e[1]):1},sayHello:function(t){if(!n._saidHello){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c Pixi.js gameofbombs fork "+i.VERSION+" - ✰ "+t+" ✰  %c  %c  http://www.pixijs.com/ https://github.com/gameofbombs/pixi.js %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("Pixi.js gameofbombs fork "+i.VERSION+" - "+t+" - http://www.pixijs.com/ https://github.com/gameofbombs/pixi.js");n._saidHello=!0}},isWebGLSupported:function(){var t={stencil:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(o){return!1}},sign:function(t){return t?t<0?-1:1:0},removeItems:function(t,e,r){var i=t.length;if(!(e>=i||0===r)){r=e+r>i?i-e:r;for(var n=e,o=i-r;n<o;++n)t[n]=t[n+r];t.length=o}},TextureCache:{},BaseTextureCache:{}}},{"../const":79,"./pluginTarget":156,eventemitter3:4}],155:[function(t,e,r){var i=t("ismobilejs"),n=function(t){return i.tablet||i.phone?2:t};e.exports=n},{ismobilejs:15}],156:[function(t,e,r){function i(t){t.__plugins={},t.registerPlugin=function(e,r){t.__plugins[e]=r},t.prototype.initPlugins=function(){this.plugins=this.plugins||{};for(var e in t.__plugins)this.plugins[e]=new t.__plugins[e](this)},t.prototype.destroyPlugins=function(){for(var t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null;this.plugins=null}}e.exports={mixin:function(t){i(t)}}},{}],157:[function(t,e,r){function i(t){var e=(new Error).stack;"undefined"==typeof e?console.warn("Deprecation Warning: ",t):(e=e.split("\n").splice(3).join("\n"),console.groupCollapsed?(console.groupCollapsed("%cDeprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",t),console.warn(e),console.groupEnd()):(console.warn("Deprecation Warning: ",t),console.warn(e)))}var n=t("./core"),o=t("./mesh"),s=t("./particles"),a=t("./extras"),h=t("./filters"),u=t("./core/const");n.SpriteBatch=function(){throw new ReferenceError("SpriteBatch does not exist any more, please use the new ParticleContainer instead.")},n.AssetLoader=function(){throw new ReferenceError("The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class.")},Object.defineProperties(n,{Stage:{get:function(){return i("You do not need to use a PIXI Stage any more, you can simply render any container."),n.Container}},DisplayObjectContainer:{get:function(){return i("DisplayObjectContainer has been shortened to Container, please use Container from now on."),n.Container}},Strip:{get:function(){return i("The Strip class has been renamed to Mesh and moved to mesh.Mesh, please use mesh.Mesh from now on."),o.Mesh}},Rope:{get:function(){return i("The Rope class has been moved to mesh.Rope, please use mesh.Rope from now on."),o.Rope}},ParticleContainer:{get:function(){return i("The ParticleContainer class has been moved to particles.ParticleContainer, please use particles.ParticleContainer from now on."),s.ParticleContainer}},MovieClip:{get:function(){return i("The MovieClip class has been moved to extras.MovieClip, please use extras.MovieClip from now on."),a.MovieClip}},TilingSprite:{get:function(){return i("The TilingSprite class has been moved to extras.TilingSprite, please use extras.TilingSprite from now on."),a.TilingSprite}},BitmapText:{get:function(){return i("The BitmapText class has been moved to extras.BitmapText, please use extras.BitmapText from now on."),a.BitmapText}},blendModes:{get:function(){return i("The blendModes has been moved to BLEND_MODES, please use BLEND_MODES from now on."),n.BLEND_MODES}},scaleModes:{get:function(){return i("The scaleModes has been moved to SCALE_MODES, please use SCALE_MODES from now on."),n.SCALE_MODES}},BaseTextureCache:{get:function(){return i("The BaseTextureCache class has been moved to utils.BaseTextureCache, please use utils.BaseTextureCache from now on."),n.utils.BaseTextureCache}},TextureCache:{get:function(){return i("The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on."),n.utils.TextureCache}},math:{get:function(){return i("The math namespace is deprecated, please access members already accessible on PIXI."),n}},AbstractFilter:{get:function(){return i("AstractFilter has been renamed to Filter, please use PIXI.Filter"),n.Filter}}}),n.DisplayObject.prototype.generateTexture=function(t,e,r){return i("generateTexture has moved to the renderer, please use renderer.generateTexture(displayObject)"),t.generateTexture(this,e,r)},n.Graphics.prototype.generateTexture=function(t,e){return i("graphics generate texture has moved to the renderer. Or to render a graphics to a texture using canvas please use generateCanvasTexture"),this.generateCanvasTexture(t,e)},n.RenderTexture.prototype.render=function(t,e,r,n){this.legacyRenderer.render(t,this,r,e,!n),i("RenderTexture.render is now deprecated, please use renderer.render(displayObject, renderTexture)")},n.RenderTexture.prototype.getImage=function(t){return i("RenderTexture.getImage is now deprecated, please use renderer.extract.image(target)"),this.legacyRenderer.extract.image(t)},n.RenderTexture.prototype.getBase64=function(t){return i("RenderTexture.getBase64 is now deprecated, please use renderer.extract.base64(target)"),this.legacyRenderer.extract.base64(t)},n.RenderTexture.prototype.getCanvas=function(t){return i("RenderTexture.getCanvas is now deprecated, please use renderer.extract.canvas(target)"),this.legacyRenderer.extract.canvas(t)},n.RenderTexture.prototype.getPixels=function(t){return i("RenderTexture.getPixels is now deprecated, please use renderer.extract.pixels(target)"),this.legacyRenderer.pixels(t)},n.Sprite.prototype.setTexture=function(t){this.texture=t,i("setTexture is now deprecated, please use the texture property, e.g : sprite.texture = texture;")},a.BitmapText.prototype.setText=function(t){this.text=t,i("setText is now deprecated, please use the text property, e.g : myBitmapText.text = 'my text';")},n.Text.prototype.setText=function(t){this.text=t,i("setText is now deprecated, please use the text property, e.g : myText.text = 'my text';")},n.Text.prototype.setStyle=function(t){this.style=t,i("setStyle is now deprecated, please use the style property, e.g : myText.style = style;")},Object.defineProperties(n.TextStyle.prototype,{font:{get:function(){i("text style property 'font' is now deprecated, please use the 'fontFamily','fontSize',fontStyle','fontVariant' and 'fontWeight' properties from now on");var t="number"==typeof this._fontSize?this._fontSize+"px":this._fontSize;return this._fontStyle+" "+this._fontVariant+" "+this._fontWeight+" "+t+" "+this._fontFamily},set:function(t){i("text style property 'font' is now deprecated, please use the 'fontFamily','fontSize',fontStyle','fontVariant' and 'fontWeight' properties from now on"),t.indexOf("italic")>1?this._fontStyle="italic":t.indexOf("oblique")>-1?this._fontStyle="oblique":this._fontStyle="normal",t.indexOf("small-caps")>-1?this._fontVariant="small-caps":this._fontVariant="normal";var e,r=t.split(" "),n=-1;for(this._fontSize=26,e=0;e<r.length;++e)if(r[e].match(/(px|pt|em|%)/)){n=e,this._fontSize=r[e];break}for(this._fontWeight="normal",e=0;e<n;++e)if(r[e].match(/(bold|bolder|lighter|100|200|300|400|500|600|700|800|900)/)){this._fontWeight=r[e];break}if(n>-1&&n<r.length-1){for(this._fontFamily="",e=n+1;e<r.length;++e)this._fontFamily+=r[e]+" ";this._fontFamily=this._fontFamily.slice(0,-1)}else this._fontFamily="Arial";this.emit(u.TEXT_STYLE_CHANGED)}}}),n.Texture.prototype.setFrame=function(t){this.frame=t,i("setFrame is now deprecated, please use the frame property, e.g : myTexture.frame = frame;")},Object.defineProperties(h,{AbstractFilter:{get:function(){return i("AstractFilter has been renamed to Filter, please use PIXI.Filter"),n.AbstractFilter}},FXAAFilter:{get:function(){return i("filters.FXAAFilter is an undocumented alias, please use FXAAFilter from now on."),n.FXAAFilter}},SpriteMaskFilter:{get:function(){return i("filters.SpriteMaskFilter is an undocumented alias, please use SpriteMaskFilter from now on."),n.SpriteMaskFilter}}}),n.utils.uuid=function(){return i("utils.uuid() is deprecated, please use utils.uid() from now on."),n.utils.uid()},n.utils.canUseNewCanvasBlendModes=function(){return i("utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on"),n.CanvasTinter.canUseMultiply}},{"./core":99,"./core/const":79,"./extras":167,"./filters":179,"./mesh":196,"./particles":199}],158:[function(t,e,r){function i(t){this.renderer=t,t.extract=this}var n=t("../../core"),o=new n.Rectangle;i.prototype.constructor=i,e.exports=i,i.prototype.image=function(t){var e=new Image;return e.src=this.base64(t),e},i.prototype.base64=function(t){return this.canvas(t).toDataURL()},i.prototype.canvas=function(t){var e,r,i,s,a=this.renderer;t&&(s=t instanceof n.RenderTexture?t:a.generateTexture(t)),s?(e=s.baseTexture._canvasRenderTarget.context,r=s.baseTexture._canvasRenderTarget.resolution,i=s.frame):(e=a.rootContext,r=a.rootResolution,i=o,i.width=this.renderer.width,i.height=this.renderer.height);var h=i.width*r,u=i.height*r,l=new n.CanvasRenderTarget(h,u),c=e.getImageData(i.x*r,i.y*r,h,u);return l.context.putImageData(c,0,0),l.canvas},i.prototype.pixels=function(t){var e,r,i,s,a=this.renderer;return t&&(s=t instanceof n.RenderTexture?t:a.generateTexture(t)),s?(e=s.baseTexture._canvasRenderTarget.context,r=s.baseTexture._canvasRenderTarget.resolution,i=s.frame):(e=a.rootContext,r=a.rootResolution,i=o,i.width=a.width,i.height=a.height),e.getImageData(0,0,i.width*r,i.height*r).data},i.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null},n.CanvasRenderer.registerPlugin("extract",i)},{"../../core":99}],159:[function(t,e,r){e.exports={webGL:t("./webgl/WebGLExtract"),canvas:t("./canvas/CanvasExtract")}},{"./canvas/CanvasExtract":158,"./webgl/WebGLExtract":160}],160:[function(t,e,r){function i(t){this.renderer=t,
  t.extract=this}var n=t("../../core"),o=new n.Rectangle;i.prototype.constructor=i,e.exports=i,i.prototype.image=function(t){var e=new Image;return e.src=this.base64(t),e},i.prototype.base64=function(t){return this.canvas(t).toDataURL()},i.prototype.canvas=function(t){var e,r,i,s,a=this.renderer,h=!1;t&&(s=t instanceof n.RenderTexture?t:this.renderer.generateTexture(t)),s?(e=s.baseTexture._glRenderTargets[this.renderer.CONTEXT_UID],r=e.resolution,i=s.frame,h=!1):(e=this.renderer.rootRenderTarget,r=e.resolution,h=!0,i=o,i.width=e.size.width,i.height=e.size.height);var u=i.width*r,l=i.height*r,c=new n.CanvasRenderTarget(u,l);if(e){a.bindRenderTarget(e);var d=new Uint8Array(4*u*l),p=a.gl;p.readPixels(i.x*r,i.y*r,u,l,p.RGBA,p.UNSIGNED_BYTE,d);var f=c.context.getImageData(0,0,u,l);f.data.set(d),c.context.putImageData(f,0,0),h&&(c.context.scale(1,-1),c.context.drawImage(c.canvas,0,-l))}return c.canvas},i.prototype.pixels=function(t){var e,r,i,s,a=this.renderer;t&&(s=t instanceof n.RenderTexture?t:this.renderer.generateTexture(t)),s?(e=s.baseTexture._glRenderTargets[this.renderer.CONTEXT_UID],r=e.resolution,i=s.frame):(e=this.renderer.rootRenderTarget,r=e.resolution,i=o,i.width=e.size.width,i.height=e.size.height);var h=i.width*r,u=i.height*r,l=new Uint8Array(4*h*u);if(e){a.bindRenderTarget(e);var c=a.gl;c.readPixels(i.x*r,i.y*r,h,u,c.RGBA,c.UNSIGNED_BYTE,l)}return l},i.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null},n.WebGLRenderer.registerPlugin("extract",i)},{"../../core":99}],161:[function(t,e,r){function i(t,e){n.Container.call(this),e=e||{},this.textWidth=0,this.textHeight=0,this._glyphs=[],this._font={tint:void 0!==e.tint?e.tint:16777215,align:e.align||"left",name:null,size:0},this.font=e.font,this._text=t,this.maxWidth=0,this.maxLineHeight=0,this._anchor=new o(this.makeDirty,this,0,0),this.dirty=!1,this.updateText()}var n=t("../core"),o=t("../core/display/ObservablePoint");i.prototype=Object.create(n.Container.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{tint:{get:function(){return this._font.tint},set:function(t){this._font.tint="number"==typeof t&&t>=0?t:16777215,this.dirty=!0}},align:{get:function(){return this._font.align},set:function(t){this._font.align=t||"left",this.dirty=!0}},anchor:{get:function(){return this._anchor},set:function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copy(t)}},font:{get:function(){return this._font},set:function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):i.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)}},text:{get:function(){return this._text},set:function(t){t=t.toString()||" ",this._text!==t&&(this._text=t,this.dirty=!0)}}}),i.prototype.updateText=function(){for(var t=i.fonts[this._font.name],e=new n.Point,r=null,o=[],s=0,a=0,h=[],u=0,l=this._font.size/t.size,c=-1,d=0,p=0;p<this.text.length;p++){var f=this.text.charCodeAt(p);if(c=/(\s)/.test(this.text.charAt(p))?p:c,/(?:\r\n|\r|\n)/.test(this.text.charAt(p)))h.push(s),a=Math.max(a,s),u++,e.x=0,e.y+=t.lineHeight,r=null;else if(c!==-1&&this.maxWidth>0&&e.x*l>this.maxWidth)n.utils.removeItems(o,c,p-c),p=c,c=-1,h.push(s),a=Math.max(a,s),u++,e.x=0,e.y+=t.lineHeight,r=null;else{var y=t.chars[f];y&&(r&&y.kerning[r]&&(e.x+=y.kerning[r]),o.push({texture:y.texture,line:u,charCode:f,position:new n.Point(e.x+y.xOffset,e.y+y.yOffset)}),s=e.x+(y.texture.width+y.xOffset),e.x+=y.xAdvance,d=Math.max(d,y.yOffset+y.texture.height),r=f)}}h.push(s),a=Math.max(a,s);var m=[];for(p=0;p<=u;p++){var v=0;"right"===this._font.align?v=a-h[p]:"center"===this._font.align&&(v=(a-h[p])/2),m.push(v)}var x=o.length,g=this.tint;for(p=0;p<x;p++){var _=this._glyphs[p];_?_.texture=o[p].texture:(_=new n.Sprite(o[p].texture),this._glyphs.push(_)),_.position.x=(o[p].position.x+m[o[p].line])*l,_.position.y=o[p].position.y*l,_.scale.x=_.scale.y=l,_.tint=g,_.parent||this.addChild(_)}for(p=x;p<this._glyphs.length;++p)this.removeChild(this._glyphs[p]);if(this.textWidth=a*l,this.textHeight=(e.y+t.lineHeight)*l,0!==this.anchor.x||0!==this.anchor.y)for(p=0;p<x;p++)this._glyphs[p].x-=this.textWidth*this.anchor.x,this._glyphs[p].y-=this.textHeight*this.anchor.y;this.maxLineHeight=d*l},i.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},i.prototype.getLocalBounds=function(){return this.validate(),n.Container.prototype.getLocalBounds.call(this)},i.prototype.validate=function(){this.dirty&&(this.updateText(),this.dirty=!1)},i.prototype.makeDirty=function(){this.dirty=!0},i.fonts={}},{"../core":99,"../core/display/ObservablePoint":86}],162:[function(t,e,r){function i(t){n.Sprite.call(this,t[0]instanceof n.Texture?t[0]:t[0].texture),this._textures=null,this._durations=null,this.textures=t,this.animationSpeed=1,this.loop=!0,this.onComplete=null,this._currentTime=0,this.playing=!1}var n=t("../core");i.prototype=Object.create(n.Sprite.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{totalFrames:{get:function(){return this._textures.length}},textures:{get:function(){return this._textures},set:function(t){if(t[0]instanceof n.Texture)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(var e=0;e<t.length;e++)this._textures.push(t[e].texture),this._durations.push(t[e].time)}}},currentFrame:{get:function(){var t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t}}}),i.prototype.stop=function(){this.playing&&(this.playing=!1,n.ticker.shared.remove(this.update,this))},i.prototype.play=function(){this.playing||(this.playing=!0,n.ticker.shared.add(this.update,this))},i.prototype.gotoAndStop=function(t){this.stop(),this._currentTime=t,this.texture=this._textures[this.currentFrame]},i.prototype.gotoAndPlay=function(t){this._currentTime=t,this.play()},i.prototype.update=function(t){var e=this.animationSpeed*t;if(null!==this._durations){var r=this._currentTime%1*this._durations[this.currentFrame];for(r+=e/60*1e3;r<0;)this._currentTime--,r+=this._durations[this.currentFrame];var i=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);r>=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*i,this._currentTime+=i;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):this.texture=this._textures[this.currentFrame]},i.prototype.destroy=function(){this.stop(),n.Sprite.prototype.destroy.call(this)},i.fromFrames=function(t){for(var e=[],r=0;r<t.length;++r)e.push(new n.Texture.fromFrame(t[r]));return new i(e)},i.fromImages=function(t){for(var e=[],r=0;r<t.length;++r)e.push(new n.Texture.fromImage(t[r]));return new i(e)}},{"../core":99}],163:[function(t,e,r){function i(t,e,r){n.Sprite.call(this,t),this.tileScale=new n.Point(1,1),this.tilePosition=new n.Point(0,0),this._width=e||100,this._height=r||100,this._uvs=new n.TextureUvs,this._canvasPattern=null,this._glDatas=[]}var n=t("../core"),o=t("../core/sprites/canvas/CanvasTinter"),s=t("./webgl/TilingShader"),a=new Float32Array(4);Object.defineProperties(i.prototype,{width:{get:function(){return this._width},set:function(t){this._width=t}},height:{get:function(){return this._height},set:function(t){this._height=t}}}),i.prototype=Object.create(n.Sprite.prototype),i.prototype.constructor=i,e.exports=i,i.prototype._onTextureUpdate=function(){},i.prototype._renderWebGL=function(t){var e=this._texture;if(e&&e._uvs){t.flush();var r=t.gl,i=this._glDatas[t.CONTEXT_UID];i||(i={shader:new s(r),quad:new n.Quad(r)},this._glDatas[t.CONTEXT_UID]=i,i.quad.initVao(i.shader));for(var o=i.quad.vertices,h=this.geometry.vertices,u=0;u<8;u++)o[u]=h[u];i.quad.upload(),t.bindShader(i.shader),t.bindProjection(this.worldProjection);var l=e._uvs,c=e._frame.width,d=e._frame.height,p=e.baseTexture.width,f=e.baseTexture.height,y=i.shader.uniforms.uPixelSize;y[0]=1/p,y[1]=1/f,i.shader.uniforms.uPixelSize=y;var m=i.shader.uniforms.uFrame;m[0]=l.x0,m[1]=l.y0,m[2]=l.x1-l.x0,m[3]=l.y2-l.y0,i.shader.uniforms.uFrame=m;var v=this._width,x=this._height,g=i.shader.uniforms.uTransform;g[0]=this.tilePosition.x%(c*this.tileScale.x)/v,g[1]=this.tilePosition.y%(d*this.tileScale.y)/x,g[2]=p/v*this.tileScale.x,g[3]=f/x*this.tileScale.y,i.shader.setUniformMatrix("translationMatrix",this.computedTransform.matrix),i.shader.uniforms.uTransform=g,i.shader.uniforms.alpha=this.worldAlpha;var _=a;n.utils.hex2rgb(this.tint,_),_[3]=this.worldAlpha,i.shader.uniforms.uColor=_,t.bindTexture(this._texture,0),t.state.setBlendMode(this.blendMode),i.quad.draw()}},i.prototype._renderCanvas=function(t){var e=this._texture;if(e.baseTexture.hasLoaded){var r=t.context,i=this.projectionMatrix2d,s=t.resolution,a=e.baseTexture,h=this.tilePosition.x/this.tileScale.x%e._frame.width,u=this.tilePosition.y/this.tileScale.y%e._frame.height;if(!this._canvasPattern){var l=new n.CanvasRenderTarget(e._frame.width,e._frame.height);16777215!==this.tint?(this.cachedTint!==this.tint&&(this.cachedTint=this.tint,this.tintedTexture=o.getTintedTexture(this,this.tint)),l.context.drawImage(this.tintedTexture,0,0)):l.context.drawImage(a.source,-e._frame.x,-e._frame.y),this._canvasPattern=l.context.createPattern(l.canvas,"repeat")}var c=this._width,d=this._height;r.globalAlpha=this.worldAlpha,r.setTransform(i.a*s,i.b*s,i.c*s,i.d*s,i.tx*s,i.ty*s),r.scale(this.tileScale.x,this.tileScale.y),r.translate(h+this.anchor.x*c,u+this.anchor.y*d);var p=t.blendModes[this.blendMode];p!==t.context.globalCompositeOperation&&(r.globalCompositeOperation=p),r.fillStyle=this._canvasPattern,r.fillRect(-h,-u,c/this.tileScale.x,d/this.tileScale.y)}},i.prototype.calculateVertices=function(){var t=this._width,e=this._height,r=t*(1-this.anchor.x),i=t*-this.anchor.x,n=e*(1-this.anchor.y),o=e*-this.anchor.y;this.geometry.setRectCoords(0,i,o,r,n)},i.prototype.destroy=function(){n.Sprite.prototype.destroy.call(this),this.tileScale=null,this._tileScaleOffset=null,this.tilePosition=null,this._uvs=null},i.fromFrame=function(t,e,r){var o=n.utils.TextureCache[t];if(!o)throw new Error('The frameId "'+t+'" does not exist in the texture cache '+this);return new i(o,e,r)},i.fromImage=function(t,e,r,o,s){return new i(n.Texture.fromImage(t,o,s),e,r)}},{"../core":99,"../core/sprites/canvas/CanvasTinter":136,"./webgl/TilingShader":168}],164:[function(t,e,r){var i=t("../core"),n=i.DisplayObject,o=new i.Matrix;n.prototype._cacheAsBitmap=!1,n.prototype._originalRenderWebGL=null,n.prototype._originalRenderCanvas=null,n.prototype._originalUpdateTransform=null,n.prototype._originalHitTest=null,n.prototype._originalDestroy=null,n.prototype._cachedSprite=null,Object.defineProperties(n.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._originalRenderWebGL=this.renderWebGL,this._originalRenderCanvas=this.renderCanvas,this._originalUpdateTransform=this.updateTransform,this._originalGetBounds=this.getBounds,this._originalDestroy=this.destroy,this._originalContainsPoint=this.containsPoint,this.renderWebGL=this._renderCachedWebGL,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):(this._cachedSprite&&this._destroyCachedDisplayObject(),this.renderWebGL=this._originalRenderWebGL,this.renderCanvas=this._originalRenderCanvas,this.getBounds=this._originalGetBounds,this.destroy=this._originalDestroy,this.updateTransform=this._originalUpdateTransform,this.containsPoint=this._originalContainsPoint))}}}),n.prototype._renderCachedWebGL=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cachedSprite.worldAlpha=this.worldAlpha,this._cachedSprite._renderWebGL(t))},n.prototype._initCachedDisplayObject=function(t){if(!this._cachedSprite){t.currentRenderer.flush();var e=this.getLocalBounds().clone();if(this._filters){var r=this._filters[0].padding;e.x-=r,e.y-=r,e.width+=2*r,e.height+=2*r}var n=t._activeRenderTarget,s=t.filterManager.filterStack,a=i.RenderTexture.create(0|e.width,0|e.height),h=o;h.tx=-e.x,h.ty=-e.y,this.renderWebGL=this._originalRenderWebGL,t.render(this,a,!0,h,!0),t.bindRenderTarget(n),t.filterManager.filterStack=s,this.renderWebGL=this._renderCachedWebGL,this.updateTransform=this.displayObjectUpdateTransform,this.getBounds=this._getCachedBounds,this._cachedSprite=new i.Sprite(a),this._cachedSprite.computedTransform=this.computedTransform,this._cachedSprite.anchor.x=-(e.x/e.width),this._cachedSprite.anchor.y=-(e.y/e.height),this.updateTransform(),this.containsPoint=this._cachedSprite.containsPoint.bind(this._cachedSprite)}},n.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cachedSprite.worldAlpha=this.worldAlpha,this._cachedSprite.renderCanvas(t))},n.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cachedSprite){var e=this.getLocalBounds(),r=t.context,n=new i.RenderTexture.create(0|e.width,0|e.height),s=o;this.projectionMatrix2d.copy(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=r,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.getBounds=this._getCachedBounds,this._cachedSprite=new i.Sprite(n),this._cachedSprite.computedTransform=this.computedTransform,this._cachedSprite.anchor.x=-(e.x/e.width),this._cachedSprite.anchor.y=-(e.y/e.height),this.updateTransform(),this.containsPoint=this._cachedSprite.containsPoint.bind(this._cachedSprite)}},n.prototype._getCachedBounds=function(){return this._cachedSprite._currentBounds=null,this._cachedSprite.getBounds()},n.prototype._destroyCachedDisplayObject=function(){this._cachedSprite._texture.destroy(!0),this._cachedSprite=null},n.prototype._cacheAsBitmapDestroy=function(){this.cacheAsBitmap=!1,this._originalDestroy()}},{"../core":99}],165:[function(t,e,r){var i=t("../core");i.DisplayObject.prototype.name=null,i.Container.prototype.getChildByName=function(t){for(var e=0;e<this.children.length;e++)if(this.children[e].name===t)return this.children[e];return null}},{"../core":99}],166:[function(t,e,r){var i=t("../core");i.DisplayObject.prototype.getGlobalPosition=function(t){return t=t||new i.Point,this.parent?(this.displayObjectUpdateTransform(),t.x=this.projectionMatrix2d.tx,t.y=this.projectionMatrix2d.ty):(t.x=this.position.x,t.y=this.position.y),t}},{"../core":99}],167:[function(t,e,r){t("./cacheAsBitmap"),t("./getChildByName"),t("./getGlobalPosition"),e.exports={MovieClip:t("./MovieClip"),TilingSprite:t("./TilingSprite"),BitmapText:t("./BitmapText")}},{"./BitmapText":161,"./MovieClip":162,"./TilingSprite":163,"./cacheAsBitmap":164,"./getChildByName":165,"./getGlobalPosition":166}],168:[function(t,e,r){function i(t){n.call(this,t,"#define GLSLIFY 1\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat4 projectionMatrix;\nuniform mat4 translationMatrix;\n\nuniform vec4 uFrame;\nuniform vec4 uTransform;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void)\n{\n    gl_Position = projectionMatrix * translationMatrix * vec4(aVertexPosition, 0.0, 1.0);\n\n    vec2 coord = aTextureCoord;\n    coord -= uTransform.xy;\n    coord /= uTransform.zw;\n    vTextureCoord = coord;\n\n    vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","#define GLSLIFY 1\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform vec4 uFrame;\nuniform vec2 uPixelSize;\n\nvoid main(void)\n{\n\n   \tvec2 coord = mod(vTextureCoord, uFrame.zw);\n   \tcoord = clamp(coord, uPixelSize, uFrame.zw - uPixelSize);\n   \tcoord += uFrame.xy;\n\n   \tvec4 sample = texture2D(uSampler, coord);\n  \tvec4 color = vec4(uColor.rgb * uColor.a, uColor.a);\n\n   \tgl_FragColor = sample * color ;\n}\n")}var n=t("../../core/Shader");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i},{"../../core/Shader":53}],169:[function(t,e,r){function i(){n.Filter.call(this),this.blurXFilter=new o,this.blurYFilter=new s,this.resolution=.5,this.blurYFilter.passes=this.blurXFilter.passes=1,this.blurYFilter.strength=this.blurXFilter.strength=4,this.padding=40,this.passes=2}var n=t("../../core"),o=t("./BlurXFilter"),s=t("./BlurYFilter");i.prototype=Object.create(n.Filter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.apply=function(t,e,r){var i=t.getRenderTarget(!0);this.blurXFilter.apply(t,e,i,!0),this.blurYFilter.apply(t,i,r,!1),t.returnRenderTarget(i)},Object.defineProperties(i.prototype,{blur:{get:function(){return this.blurXFilter.blur},set:function(t){this.padding=2*Math.max(Math.abs(this.blurYFilter.strength),Math.abs(this.blurYFilter.strength)),this.blurXFilter.blur=this.blurYFilter.blur=t}},passes:{get:function(){return this.blurXFilter.passes},set:function(t){this.blurXFilter.passes=this.blurYFilter.passes=t}},blurX:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t,this.padding=2*Math.max(Math.abs(this.blurYFilter.strength),Math.abs(this.blurYFilter.strength))}},blurY:{get:function(){return this.blurYFilter.blur},set:function(t){this.blurYFilter.blur=t,this.padding=2*Math.max(Math.abs(this.blurYFilter.strength),Math.abs(this.blurYFilter.strength))}}})},{"../../core":99,"./BlurXFilter":170,"./BlurYFilter":171}],170:[function(t,e,r){function i(){var t=o(5,!0),e=s(5);n.Filter.call(this,t,e),this.passes=1,this.resolution=1,this.strength=4,this.firstRun=!0}var n=t("../../core"),o=t("./generateBlurVertSource"),s=t("./generateBlurFragSource"),a=t("./getMaxBlurKernelSize");i.prototype=Object.create(n.Filter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.apply=function(t,e,r,i){if(this.firstRun){var n=t.renderer.gl,h=a(n);this.vertexSrc=o(h,!0),this.fragmentSrc=s(h),this.firstRun=!1}if(this.uniforms.strength=1/r.size.width*(r.size.width/e.size.width),this.uniforms.strength*=this.strength,1===this.passes)t.applyFilter(this,e,r,i);else{for(var u=t.getRenderTarget(!0),l=e,c=u,d=0;d<this.passes-1;d++){t.applyFilter(this,l,c,!0);var p=c;c=l,l=p}t.applyFilter(this,l,r,i),t.returnRenderTarget(u)}},Object.defineProperties(i.prototype,{blur:{get:function(){return this.strength},set:function(t){this.padding=2*Math.abs(t),this.strength=t}}})},{"../../core":99,"./generateBlurFragSource":172,"./generateBlurVertSource":173,"./getMaxBlurKernelSize":174}],171:[function(t,e,r){function i(){var t=o(5,!1),e=s(5);n.Filter.call(this,t,e),this.passes=1,this.resolution=1,this.strength=4,this.firstRun=!0}var n=t("../../core"),o=t("./generateBlurVertSource"),s=t("./generateBlurFragSource"),a=t("./getMaxBlurKernelSize");i.prototype=Object.create(n.Filter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.apply=function(t,e,r,i){if(this.firstRun){var n=t.renderer.gl,h=a(n);this.vertexSrc=o(h,!1),this.fragmentSrc=s(h),this.firstRun=!1}if(this.uniforms.strength=1/r.size.height*(r.size.height/e.size.height),this.uniforms.strength*=this.strength,1===this.passes)t.applyFilter(this,e,r,i);else{for(var u=t.getRenderTarget(!0),l=e,c=u,d=0;d<this.passes-1;d++){t.applyFilter(this,l,c,!0);var p=c;c=l,l=p}t.applyFilter(this,l,r,i),t.returnRenderTarget(u)}},Object.defineProperties(i.prototype,{blur:{get:function(){return this.strength},set:function(t){this.padding=2*Math.abs(t),this.strength=t}}})},{"../../core":99,"./generateBlurFragSource":172,"./generateBlurVertSource":173,"./getMaxBlurKernelSize":174}],172:[function(t,e,r){var i={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},n=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{","\tgl_FragColor = vec4(0.0);","\t%blur%","}"].join("\n"),o=function(t){for(var e,r=i[t],o=r.length,s=n,a="",h="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;",u=0;u<t;u++){var l=h.replace("%index%",u);e=u,u>=o&&(e=t-u-1),l=l.replace("%value%",r[e]),a+=l,a+="\n"}return s=s.replace("%blur%",a),s=s.replace("%size%",t)};e.exports=o},{}],173:[function(t,e,r){var i=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","uniform float strength;","uniform mat3 projectionMatrix;","varying vec2 vBlurTexCoords[%size%];","void main(void)","{","gl_Position = vec4((projectionMatrix * vec3((aVertexPosition), 1.0)).xy, 0.0, 1.0);","%blur%","}"].join("\n"),n=function(t,e){var r,n,o=Math.ceil(t/2),s=i,a="";r=e?"vBlurTexCoords[%index%] = aTextureCoord + vec2(%sampleIndex% * strength, 0.0);":"vBlurTexCoords[%index%] = aTextureCoord + vec2(0.0, %sampleIndex% * strength);";for(var h=0;h<t;h++){var u=r.replace("%index%",h);n=h,h>=o&&(n=t-h-1),u=u.replace("%sampleIndex%",h-(o-1)+".0"),a+=u,a+="\n"}return s=s.replace("%blur%",a),s=s.replace("%size%",t)};e.exports=n},{}],174:[function(t,e,r){var i=function(t){for(var e=t.getParameter(t.MAX_VARYING_VECTORS),r=15;r>e;)r-=2;return r};e.exports=i},{}],175:[function(t,e,r){function i(){n.Filter.call(this,"#define GLSLIFY 1\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n    vTextureCoord = aTextureCoord;\n}\n","#define GLSLIFY 1\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\n\nvoid main(void)\n{\n\n    vec4 c = texture2D(uSampler, vTextureCoord);\n\n    gl_FragColor.r = (m[0] * c.r);\n        gl_FragColor.r += (m[1] * c.g);\n        gl_FragColor.r += (m[2] * c.b);\n        gl_FragColor.r += (m[3] * c.a);\n        gl_FragColor.r += m[4] * c.a;\n\n    gl_FragColor.g = (m[5] * c.r);\n        gl_FragColor.g += (m[6] * c.g);\n        gl_FragColor.g += (m[7] * c.b);\n        gl_FragColor.g += (m[8] * c.a);\n        gl_FragColor.g += m[9] * c.a;\n\n     gl_FragColor.b = (m[10] * c.r);\n        gl_FragColor.b += (m[11] * c.g);\n        gl_FragColor.b += (m[12] * c.b);\n        gl_FragColor.b += (m[13] * c.a);\n        gl_FragColor.b += m[14] * c.a;\n\n     gl_FragColor.a = (m[15] * c.r);\n        gl_FragColor.a += (m[16] * c.g);\n        gl_FragColor.a += (m[17] * c.b);\n        gl_FragColor.a += (m[18] * c.a);\n        gl_FragColor.a += m[19] * c.a;\n\n//    gl_FragColor = vec4(m[0]);\n}\n"),this.uniforms.m=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]}var n=t("../../core");i.prototype=Object.create(n.Filter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype._loadMatrix=function(t,e){e=!!e;var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},i.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19],t},i.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},i.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},i.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},i.prototype.grayscale=i.prototype.greyscale,i.prototype.blackAndWhite=function(t){var e=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=.213,o=.715,s=.072,a=[n+r*(1-n)+i*-n,o+r*-o+i*-o,s+r*-s+i*(1-s),0,0,n+r*-n+.143*i,o+r*(1-o)+.14*i,s+r*-s+i*-.283,0,0,n+r*-n+i*-(1-n),o+r*-o+i*o,s+r*(1-s)+i*s,0,0,0,0,0,1,0];this._loadMatrix(a,e)},i.prototype.contrast=function(t,e){var r=(t||0)+1,i=-128*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},i.prototype.saturate=function(t,e){var r=2*(t||0)/3+1,i=(r-1)*-.5,n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},i.prototype.desaturate=function(){this.saturate(-1)},i.prototype.negative=function(t){var e=[0,1,1,0,0,1,0,1,0,0,1,1,0,0,0,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.sepia=function(t){var e=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.technicolor=function(t){var e=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.polaroid=function(t){var e=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.toBGR=function(t){var e=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.kodachrome=function(t){var e=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.browni=function(t){var e=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.vintage=function(t){var e=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.colorTone=function(t,e,r,i,n){t=t||.2,e=e||.15,r=r||16770432,i=i||3375104;var o=(r>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=(i>>16&255)/255,u=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t,0,h,u,l,e,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},i.prototype.night=function(t,e){t=t||.1;var r=[t*-2,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},i.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},i.prototype.lsd=function(t){var e=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.reset=function(){var t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)},Object.defineProperties(i.prototype,{matrix:{get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t}}})},{"../../core":99}],176:[function(t,e,r){function i(t,e){var r=new n.Matrix;t.renderable=!1,n.Filter.call(this,"#define GLSLIFY 1\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMapCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n   gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n   vTextureCoord = aTextureCoord;\n   vMapCoord = ( otherMatrix * vec3( aTextureCoord, 1.0)  ).xy;\n}\n","#define GLSLIFY 1\nvarying vec2 vMapCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\n\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform vec4 filterClamp;\n\nvoid main(void)\n{\n   vec4 map =  texture2D(mapSampler, vMapCoord);\n\n   map -= 0.5;\n   map.xy *= scale;\n\n   gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), filterClamp.xy, filterClamp.zw));\n}\n"),this.maskSprite=t,this.maskMatrix=r,this.uniforms.mapSampler=t.texture,this.uniforms.otherMatrix=r.toArray(!0),this.uniforms.scale={x:1,y:1},null!==e&&void 0!==e||(e=20),this.scale=new n.Point(e,e)}var n=t("../../core");i.prototype=Object.create(n.Filter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.apply=function(t,e,r){var i=1/r.destinationFrame.width*(r.size.width/e.size.width);this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x*i,this.uniforms.scale.y=this.scale.y*i,t.applyFilter(this,e,r)},Object.defineProperties(i.prototype,{map:{get:function(){return this.uniforms.mapSampler},set:function(t){this.uniforms.mapSampler=t}}})},{"../../core":99}],177:[function(t,e,r){function i(){n.Filter.call(this,"#define GLSLIFY 1\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n    vTextureCoord = aTextureCoord;\n}\n\n","#define GLSLIFY 1\nvarying vec2 vTextureCoord;\nuniform float exposure;\nuniform float decay;\nuniform float density;\nuniform float weight;\nuniform vec2 lightPositionOnScreen;\nuniform sampler2D uSampler;\n\nconst int NUM_SAMPLES = 100;\n\nvoid main()\n{\n    vec2 deltaTextCoord = vec2( vTextureCoord - lightPositionOnScreen.xy );\n    vec2 textCoo = vTextureCoord;\n    deltaTextCoord *= 1.0 /  float(NUM_SAMPLES) * density;\n    float illuminationDecay = 1.0;\n\n    for(int i=0; i < NUM_SAMPLES ; i++)\n    {\n             textCoo -= deltaTextCoord;\n             vec4 sample = texture2D(uSampler, textCoo );\n\n             sample *= illuminationDecay * weight;\n\n             gl_FragColor += sample;\n\n             illuminationDecay *= decay;\n     }\n\n     gl_FragColor *= exposure;\n}\n"),this.uniforms.exposure=.0034,this.uniforms.decay=1,this.uniforms.density=.84,this.uniforms.weight=5.65,this.uniforms.lightPositionOnScreen[0]=.5,this.uniforms.lightPositionOnScreen[1]=.5}var n=t("../../core");i.prototype=Object.create(n.Filter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.apply=function(t,e,r,i){t.applyFilter(this,e,r,i)},Object.defineProperties(i.prototype,{offset:{get:function(){return this.uniforms.offset},set:function(t){this.uniforms.offset=t}},radius:{get:function(){return this.uniforms.radius},set:function(t){this.uniforms.radius=t}},angle:{get:function(){return this.uniforms.angle},set:function(t){this.uniforms.angle=t}}})},{"../../core":99}],178:[function(t,e,r){function i(){n.Filter.call(this,"#define GLSLIFY 1\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n    vTextureCoord = aTextureCoord;\n}\n","#define GLSLIFY 1\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float gray;\n\nvoid main(void)\n{\n   gl_FragColor = texture2D(uSampler, vTextureCoord);\n   gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(0.2126*gl_FragColor.r + 0.7152*gl_FragColor.g + 0.0722*gl_FragColor.b), gray);\n}\n"),
  this.uniforms.gray=1,this.glShaderKey="gray"}var n=t("../../core");i.prototype=Object.create(n.Filter.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{gray:{get:function(){return this.uniforms.gray},set:function(t){this.uniforms.gray=t}}})},{"../../core":99}],179:[function(t,e,r){e.exports={DisplacementFilter:t("./displacement/DisplacementFilter"),BlurFilter:t("./blur/BlurFilter"),BlurXFilter:t("./blur/BlurXFilter"),BlurYFilter:t("./blur/BlurYFilter"),ColorMatrixFilter:t("./colormatrix/ColorMatrixFilter"),TwistFilter:t("./twist/TwistFilter"),GrayFilter:t("./gray/GrayFilter"),GodrayFilter:t("./godray/GodrayFilter"),VoidFilter:t("./void/VoidFilter")}},{"./blur/BlurFilter":169,"./blur/BlurXFilter":170,"./blur/BlurYFilter":171,"./colormatrix/ColorMatrixFilter":175,"./displacement/DisplacementFilter":176,"./godray/GodrayFilter":177,"./gray/GrayFilter":178,"./twist/TwistFilter":180,"./void/VoidFilter":181}],180:[function(t,e,r){function i(){n.Filter.call(this,"#define GLSLIFY 1\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n    vTextureCoord = aTextureCoord;\n}\n\n","#define GLSLIFY 1\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform vec4 filterArea;\n\nvec2 mapCoord( vec2 coord )\n{\n    coord *= filterArea.xy;\n    coord += filterArea.zw;\n\n    return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n    coord -= filterArea.zw;\n    coord /= filterArea.xy;\n\n    return coord;\n}\n\nvec2 twist(vec2 coord)\n{\n    coord -= offset;\n\n    float dist = length(coord);\n\n    if (dist < radius)\n    {\n        float ratioDist = (radius - dist) / radius;\n        float angleMod = ratioDist * ratioDist * angle;\n        float s = sin(angleMod);\n        float c = cos(angleMod);\n        coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n    }\n\n    coord += offset;\n\n    return coord;\n}\n\nvoid main(void)\n{\n\n    vec2 coord = mapCoord(vTextureCoord);\n\n    coord = twist(coord);\n\n    coord = unmapCoord(coord);\n\n    gl_FragColor = texture2D(uSampler, coord );\n\n}\n"),this.uniforms.radius=400,this.uniforms.angle=3,this.uniforms.offset=[400,300],this.transform=new n.math.Matrix,this.padding=200}var n=t("../../core");i.prototype=Object.create(n.Filter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.apply=function(t,e,r,i){t.applyFilter(this,e,r,i)},Object.defineProperties(i.prototype,{offset:{get:function(){return this.uniforms.offset},set:function(t){this.uniforms.offset=t}},radius:{get:function(){return this.uniforms.radius},set:function(t){this.uniforms.radius=t}},angle:{get:function(){return this.uniforms.angle},set:function(t){this.uniforms.angle=t}}})},{"../../core":99}],181:[function(t,e,r){function i(){n.Filter.call(this,"#define GLSLIFY 1\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n    gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n    vTextureCoord = aTextureCoord;\n}\n","#define GLSLIFY 1\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n   gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"),this.glShaderKey="void"}var n=t("../../core");i.prototype=Object.create(n.Filter.prototype),i.prototype.constructor=i,e.exports=i},{"../../core":99}],182:[function(t,e,r){(function(r){t("./polyfill");var i=e.exports=t("./core");i.extras=t("./extras"),i.filters=t("./filters"),i.interaction=t("./interaction"),i.loaders=t("./loaders"),i.mesh=t("./mesh"),i.particles=t("./particles"),i.accessibility=t("./accessibility"),i.extract=t("./extract"),i.prepare=t("./prepare"),i.loader=new i.loaders.Loader,Object.assign(i,t("./deprecation")),r.PIXI=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./accessibility":52,"./core":99,"./deprecation":157,"./extract":159,"./extras":167,"./filters":179,"./interaction":185,"./loaders":189,"./mesh":196,"./particles":199,"./polyfill":205,"./prepare":208}],183:[function(t,e,r){function i(){this.global=new n.DisplayPoint,this._target=null,this.targetProxy=null,this.originalEvent=null}var n=t("../core");i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{target:{get:function(){return this._target},set:function(t){t&&t.original?(this._target=t.getOriginal(),this.targetProxy=t):(this._target=t,this.targetProxy=null)}}}),i.prototype.getLocalPosition=function(t,e,r){return e=e||new n.Point,e.copy(t.raycast(r||this.global,!0)),e}},{"../core":99}],184:[function(t,e,r){function i(t,e){e=e||{},this.renderer=t,this.autoPreventDefault=void 0===e.autoPreventDefault||e.autoPreventDefault,this.interactionFrequency=e.interactionFrequency||10,this.mouse=new o,this.eventData={stopped:!1,target:null,type:null,data:this.mouse,stopPropagation:function(){this.stopped=!0}},this.interactiveDataPool=[],this.interactionDOMElement=null,this.moveWhenInside=!1,this.eventsAdded=!1,this.onMouseUp=this.onMouseUp.bind(this),this.processMouseUp=this.processMouseUp.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.processMouseDown=this.processMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.processMouseMove=this.processMouseMove.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.processMouseOverOut=this.processMouseOverOut.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.processTouchStart=this.processTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.processTouchEnd=this.processTouchEnd.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.processTouchMove=this.processTouchMove.bind(this),this.last=0,this.defaultCursorStyle="inherit",this.currentCursorStyle="inherit",this._tempPoint=new n.Point,this._queue=[[],[]],this._eventDisplayOrder=0,this.resolution=1,this.setTargetElement(this.renderer.view,this.renderer.resolution)}var n=t("../core"),o=t("./InteractionData");Object.assign(n.DisplayObject.prototype,t("./interactiveTarget")),Object.defineProperties(n.DisplayObjectProxy.prototype,t("./interactiveTargetProxy")),i.prototype.constructor=i,e.exports=i,i.prototype.setTargetElement=function(t,e){this.removeEvents(),this.interactionDOMElement=t,this.resolution=e||1,this.addEvents()},i.prototype.addEvents=function(){this.interactionDOMElement&&(n.ticker.shared.add(this.update,this),window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="none",this.interactionDOMElement.style["-ms-touch-action"]="none"),window.document.addEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.addEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.addEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.addEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.addEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.addEventListener("touchmove",this.onTouchMove,!0),window.addEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!0)},i.prototype.removeEvents=function(){this.interactionDOMElement&&(n.ticker.shared.remove(this.update),window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]=""),window.document.removeEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.removeEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.removeEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onTouchMove,!0),this.interactionDOMElement=null,window.removeEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!1)},i.prototype.update=function(t){if(this._deltaTime+=t,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this.interactionDOMElement)){if(this.didMove)return void(this.didMove=!1);this.cursor=this.defaultCursorStyle,this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseOverOut,!0),this.currentCursorStyle!==this.cursor&&(this.currentCursorStyle=this.cursor,this.interactionDOMElement.style.cursor=this.cursor)}},i.prototype.dispatchEvent=function(t,e,r){r.stopped||(r.target=t,r.type=e,t.emit(e,r),t[e]&&t[e](r))},i.prototype.mapPositionToPoint=function(t,e,r){var i;i=this.interactionDOMElement.parentElement?this.interactionDOMElement.getBoundingClientRect():{x:0,y:0,width:0,height:0},t.x=(e-i.left)*(this.interactionDOMElement.width/i.width)/this.resolution,t.y=(r-i.top)*(this.interactionDOMElement.height/i.height)/this.resolution},i.prototype._processInteractive=function(t,e,r,i){if(!e||!e.visible)return!1;var n=0,o=i=e.interactive||i;if(e.hitArea&&(o=!1),r<1/0&&e._mask&&(e._mask.containsPoint(t)||(r=1/0)),r<1/0&&e.filterArea&&(e.filterArea.contains(t.x,t.y)||(r=1/0)),e.interactiveChildren)for(var s=e.children,a=s.length-1;a>=0;a--){var h=s[a],u=this._processInteractive(t,h,r,o);u&&(n=u,r=u)}return i&&(r<e.displayOrder&&(e.hitArea||e.isRaycastPossible)&&e.containsPoint(t)&&(n=e.displayOrder),e.interactive&&this._queueAdd(e,n)),n},i.prototype.processInteractive=function(t,e,r,i){this._startInteractionProcess(),this._processInteractive(t,e,i?0:1/0,!1),this._finishInteractionProcess(r)},i.prototype._startInteractionProcess=function(){this._eventDisplayOrder=1,this._queue[0].length=0,this._queue[1].length=0},i.prototype._queueAdd=function(t,e){var r=this._queue;if(e<this._eventDisplayOrder)r[0].push(t);else{if(e>this._eventDisplayOrder){this._eventDisplayOrder=e;for(var i=r[1],n=0;n<i.length;n++)r[0].push(i[n]);r[1].length=0}r[1].push(t)}},i.prototype._finishInteractionProcess=function(t){for(var e=this._queue,r=e[0],i=0;i<r.length;i++)t(r[i],!1);for(r=e[1],i=r.length-1;i>=0;i--)t(r[i],!0)},i.prototype.onMouseDown=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.autoPreventDefault&&this.mouse.originalEvent.preventDefault(),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseDown,!0)},i.prototype.processMouseDown=function(t,e){var r=this.mouse.originalEvent,i=2===r.button||3===r.which;e&&(t[i?"_isRightDown":"_isLeftDown"]=!0,this.dispatchEvent(t,i?"rightdown":"mousedown",this.eventData))},i.prototype.onMouseUp=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseUp,!0)},i.prototype.processMouseUp=function(t,e){var r=this.mouse.originalEvent,i=2===r.button||3===r.which,n=i?"_isRightDown":"_isLeftDown";e?(this.dispatchEvent(t,i?"rightup":"mouseup",this.eventData),t[n]&&(t[n]=!1,this.dispatchEvent(t,i?"rightclick":"click",this.eventData))):t[n]&&(t[n]=!1,this.dispatchEvent(t,i?"rightupoutside":"mouseupoutside",this.eventData))},i.prototype.onMouseMove=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.didMove=!0,this.cursor=this.defaultCursorStyle,this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseMove,!0),this.currentCursorStyle!==this.cursor&&(this.currentCursorStyle=this.cursor,this.interactionDOMElement.style.cursor=this.cursor)},i.prototype.processMouseMove=function(t,e){this.processMouseOverOut(t,e),this.moveWhenInside&&!e||this.dispatchEvent(t,"mousemove",this.eventData)},i.prototype.onMouseOut=function(t){this.mouse.originalEvent=t,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.interactionDOMElement.style.cursor=this.defaultCursorStyle,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseOverOut,!1)},i.prototype.processMouseOverOut=function(t,e){e?(t._over||(t._over=!0,this.dispatchEvent(t,"mouseover",this.eventData)),t.buttonMode&&(this.cursor=t.defaultCursor)):t._over&&(t._over=!1,this.dispatchEvent(t,"mouseout",this.eventData))},i.prototype.onTouchStart=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,i=0;i<r;i++){var n=e[i],o=this.getTouchData(n);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchStart,!0),this.returnTouchData(o)}},i.prototype.processTouchStart=function(t,e){e&&(t._touchDown=!0,this.dispatchEvent(t,"touchstart",this.eventData))},i.prototype.onTouchEnd=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,i=0;i<r;i++){var n=e[i],o=this.getTouchData(n);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchEnd,!0),this.returnTouchData(o)}},i.prototype.processTouchEnd=function(t,e){e?(this.dispatchEvent(t,"touchend",this.eventData),t._touchDown&&(t._touchDown=!1,this.dispatchEvent(t,"tap",this.eventData))):t._touchDown&&(t._touchDown=!1,this.dispatchEvent(t,"touchendoutside",this.eventData))},i.prototype.onTouchMove=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,i=0;i<r;i++){var n=e[i],o=this.getTouchData(n);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchMove,this.moveWhenInside),this.returnTouchData(o)}},i.prototype.processTouchMove=function(t,e){this.moveWhenInside&&!e||this.dispatchEvent(t,"touchmove",this.eventData)},i.prototype.getTouchData=function(t){var e=this.interactiveDataPool.pop();return e||(e=new o),e.identifier=t.identifier,this.mapPositionToPoint(e.global,t.clientX,t.clientY),navigator.isCocoonJS&&(e.global.x=e.global.x/this.resolution,e.global.y=e.global.y/this.resolution),t.globalX=e.global.x,t.globalY=e.global.y,e},i.prototype.returnTouchData=function(t){this.interactiveDataPool.push(t)},i.prototype.destroy=function(){this.removeEvents(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactiveDataPool=null,this.interactionDOMElement=null,this.onMouseUp=null,this.processMouseUp=null,this.onMouseDown=null,this.processMouseDown=null,this.onMouseMove=null,this.processMouseMove=null,this.onMouseOut=null,this.processMouseOverOut=null,this.onTouchStart=null,this.processTouchStart=null,this.onTouchEnd=null,this.processTouchEnd=null,this.onTouchMove=null,this.processTouchMove=null,this._tempPoint=null},n.WebGLRenderer.registerPlugin("interaction",i),n.CanvasRenderer.registerPlugin("interaction",i)},{"../core":99,"./InteractionData":183,"./interactiveTarget":186,"./interactiveTargetProxy":187}],185:[function(t,e,r){e.exports={InteractionData:t("./InteractionData"),InteractionManager:t("./InteractionManager"),interactiveTarget:t("./interactiveTarget")}},{"./InteractionData":183,"./InteractionManager":184,"./interactiveTarget":186}],186:[function(t,e,r){var i={interactive:!1,interactiveChildren:!0,hitArea:null,buttonMode:!1,defaultCursor:"pointer",_over:!1,_isLeftDown:!1,_isRightDown:!1,_touchDown:!1};e.exports=i},{}],187:[function(t,e,r){var i={interactive:{get:function(){return this.original.interactive}},buttonMode:{get:function(){return this.original.buttonMode}},interactiveChildren:{get:function(){return this.original.interactiveChildren}},defaultCursor:{get:function(){return this.original.defaultCursor}}};e.exports=i},{}],188:[function(t,e,r){function i(t,e){var r={},i=t.data.getElementsByTagName("info")[0],n=t.data.getElementsByTagName("common")[0];r.font=i.getAttribute("face"),r.size=parseInt(i.getAttribute("size"),10),r.lineHeight=parseInt(n.getAttribute("lineHeight"),10),r.chars={};for(var a=t.data.getElementsByTagName("char"),h=0;h<a.length;h++){var u=parseInt(a[h].getAttribute("id"),10),l=new o.Rectangle(parseInt(a[h].getAttribute("x"),10)+e.frame.x,parseInt(a[h].getAttribute("y"),10)+e.frame.y,parseInt(a[h].getAttribute("width"),10),parseInt(a[h].getAttribute("height"),10));r.chars[u]={xOffset:parseInt(a[h].getAttribute("xoffset"),10),yOffset:parseInt(a[h].getAttribute("yoffset"),10),xAdvance:parseInt(a[h].getAttribute("xadvance"),10),kerning:{},texture:new o.Texture(e.baseTexture,l)}}var c=t.data.getElementsByTagName("kerning");for(h=0;h<c.length;h++){var d=parseInt(c[h].getAttribute("first"),10),p=parseInt(c[h].getAttribute("second"),10),f=parseInt(c[h].getAttribute("amount"),10);r.chars[p]&&(r.chars[p].kerning[d]=f)}t.bitmapFont=r,s.BitmapText.fonts[r.font]=r}var n=t("resource-loader").Resource,o=t("../core"),s=t("../extras"),a=t("path");e.exports=function(){return function(t,e){if(!t.data||!t.isXml)return e();if(0===t.data.getElementsByTagName("page").length||0===t.data.getElementsByTagName("info").length||null===t.data.getElementsByTagName("info")[0].getAttribute("face"))return e();var r=a.dirname(t.url);"."===r&&(r=""),this.baseUrl&&r&&("/"===this.baseUrl.charAt(this.baseUrl.length-1)&&(r+="/"),r=r.replace(this.baseUrl,"")),r&&"/"!==r.charAt(r.length-1)&&(r+="/");var s=r+t.data.getElementsByTagName("page")[0].getAttribute("file");if(o.utils.TextureCache[s])i(t,o.utils.TextureCache[s]),e();else{var h={crossOrigin:t.crossOrigin,loadType:n.LOAD_TYPE.IMAGE,metadata:t.metadata.imageMetadata};this.add(t.name+"_image",s,h,function(r){i(t,r.texture),e()})}}}},{"../core":99,"../extras":167,path:18,"resource-loader":46}],189:[function(t,e,r){e.exports={Loader:t("./loader"),bitmapFontParser:t("./bitmapFontParser"),spritesheetParser:t("./spritesheetParser"),textureParser:t("./textureParser"),Resource:t("resource-loader").Resource}},{"./bitmapFontParser":188,"./loader":190,"./spritesheetParser":191,"./textureParser":192,"resource-loader":46}],190:[function(t,e,r){function i(t,e){n.call(this,t,e);for(var r=0;r<i._pixiMiddleware.length;++r)this.use(i._pixiMiddleware[r]())}var n=t("resource-loader"),o=t("./textureParser"),s=t("./spritesheetParser"),a=t("./bitmapFontParser");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i._pixiMiddleware=[n.middleware.parsing.blob,o,s,a],i.addPixiMiddleware=function(t){i._pixiMiddleware.push(t)};var h=n.Resource;h.setExtensionXhrType("fnt",h.XHR_RESPONSE_TYPE.DOCUMENT)},{"./bitmapFontParser":188,"./spritesheetParser":191,"./textureParser":192,"resource-loader":46}],191:[function(t,e,r){var i=t("resource-loader").Resource,n=t("path"),o=t("../core"),s=t("async"),a=1e3;e.exports=function(){return function(t,e){var r,h=t.name+"_image";if(!t.data||!t.isJson||!t.data.frames||this.resources[h])return e();var u={crossOrigin:t.crossOrigin,loadType:i.LOAD_TYPE.IMAGE,metadata:t.metadata.imageMetadata};r=t.isDataUrl?t.data.meta.image:n.dirname(t.url.replace(this.baseUrl,""))+"/"+t.data.meta.image,this.add(h,r,u,function(r){function i(e,i){for(var n=e;n-e<i&&n<l.length;){var s=l[n],a=u[s].frame;if(a){var h=null,d=null,p=new o.Rectangle(0,0,u[s].sourceSize.w/c,u[s].sourceSize.h/c);h=u[s].rotated?new o.Rectangle(a.x/c,a.y/c,a.h/c,a.w/c):new o.Rectangle(a.x/c,a.y/c,a.w/c,a.h/c),u[s].trimmed&&(d=new o.Rectangle(u[s].spriteSourceSize.x/c,u[s].spriteSourceSize.y/c,u[s].spriteSourceSize.w/c,u[s].spriteSourceSize.h/c)),t.textures[s]=new o.Texture(r.texture.baseTexture,h,p,d,u[s].rotated?2:0),o.utils.TextureCache[s]=t.textures[s]}n++}}function n(){return d*a<l.length}function h(t){i(d*a,a),d++,setTimeout(t,0)}t.textures={};var u=t.data.frames,l=Object.keys(u),c=o.utils.getResolutionOfUrl(t.url),d=0;l.length<=a?(i(0,a),e()):s.whilst(n,h,e)})}}},{"../core":99,async:1,path:18,"resource-loader":46}],192:[function(t,e,r){var i=t("../core");e.exports=function(){return function(t,e){if(t.data&&t.isImage){var r=new i.BaseTexture(t.data,null,i.utils.getResolutionOfUrl(t.url));r.imageUrl=t.url,t.texture=new i.Texture(r),i.utils.BaseTextureCache[t.url]=r,i.utils.TextureCache[t.url]=t.texture}e()}}},{"../core":99}],193:[function(t,e,r){function i(t,e,r,o,s){n.Container.call(this),e=e||new Float32Array([0,0,100,0,100,100,0,100]),o=o||new Uint16Array([0,1,3,2]),this.geometry=n.Geometry2d.fromBuffers(e,o),this._texture=null,this.uvs=r||new Float32Array([0,0,1,0,1,1,0,1]),this.dirty=!0,this.indexDirty=!0,this.dirtyVertex=!1,this._geometryVersion=-1,this.blendMode=n.BLEND_MODES.NORMAL,this.canvasPadding=0,this.drawMode=s||i.DRAW_MODES.TRIANGLE_MESH,this.texture=t,this.shader=null,this._glDatas=[],this.isRaycastCheckingBounds=!0,this.isRaycastPossible=!0}var n=t("../core"),o=t("pixi-gl-core"),s=t("./webgl/MeshShader");i.prototype=Object.create(n.Container.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{vertices:{get:function(){return this.geometry.vertices}},indices:{get:function(){return this.geometry.indices}},texture:{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture=t,t&&(t.baseTexture.hasLoaded?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}}),i.prototype._renderWebGL=function(t){t.flush();var e=t.gl,r=this._glDatas[t.CONTEXT_UID];r||(r={shader:new s(e),vertexBuffer:o.GLBuffer.createVertexBuffer(e,this.vertices,e.STREAM_DRAW),uvBuffer:o.GLBuffer.createVertexBuffer(e,this.uvs,e.STREAM_DRAW),indexBuffer:o.GLBuffer.createIndexBuffer(e,this.indices,e.STATIC_DRAW),vao:new o.VertexArrayObject(e)},r.vao=new o.VertexArrayObject(e).addIndex(r.indexBuffer).addAttribute(r.vertexBuffer,r.shader.attributes.aVertexPosition,e.FLOAT,!1,8,0).addAttribute(r.uvBuffer,r.shader.attributes.aTextureCoord,e.FLOAT,!1,8,0),this._glDatas[t.CONTEXT_UID]=r),(this.dirtyVertex||this._geometryVersion!==this.geometry.version)&&(this.dirtyVertex=!1,this._geometryVersion=this.geometry.version,r.vertexBuffer.upload()),this.dirty&&(this.dirty=!1,r.uvBuffer.upload()),this.indexDirty&&(this.indexDirty=!1,r.indexBuffer.upload()),r.vertexBuffer.upload(),t.bindShader(r.shader),t.bindProjection(this.worldProjection),t.bindTexture(this._texture,0),r.shader.uniforms.translationMatrix=this.computedTransform.is3d?this.computedTransform.matrix3d:this.computedTransform.matrix2d.toMat4(),r.shader.uniforms.alpha=this.worldAlpha;var n=this.drawMode===i.DRAW_MODES.TRIANGLE_MESH?e.TRIANGLE_STRIP:e.TRIANGLES;r.vao.bind().draw(n,this.indices.length).unbind()},i.prototype._renderCanvas=function(t){var e=t.context,r=this.projectionMatrix2d;t.roundPixels?e.setTransform(r.a,r.b,r.c,r.d,0|r.tx,0|r.ty):e.setTransform(r.a,r.b,r.c,r.d,r.tx,r.ty),this.drawMode===i.DRAW_MODES.TRIANGLE_MESH?this._renderCanvasTriangleMesh(e):this._renderCanvasTriangles(e)},i.prototype._renderCanvasTriangleMesh=function(t){for(var e=this.vertices,r=this.uvs,i=e.length/2,n=0;n<i-2;n++){var o=2*n;this._renderCanvasDrawTriangle(t,e,r,o,o+2,o+4)}},i.prototype._renderCanvasTriangles=function(t){for(var e=this.vertices,r=this.uvs,i=this.indices,n=i.length,o=0;o<n;o+=3){var s=2*i[o],a=2*i[o+1],h=2*i[o+2];this._renderCanvasDrawTriangle(t,e,r,s,a,h)}},i.prototype._renderCanvasDrawTriangle=function(t,e,r,i,n,o){var s=this._texture.baseTexture.source,a=this._texture.baseTexture.width,h=this._texture.baseTexture.height,u=e[i],l=e[n],c=e[o],d=e[i+1],p=e[n+1],f=e[o+1],y=r[i]*a,m=r[n]*a,v=r[o]*a,x=r[i+1]*h,g=r[n+1]*h,_=r[o+1]*h;if(this.canvasPadding>0){var b=this.canvasPadding/this.projectionMatrix2d.a,T=this.canvasPadding/this.projectionMatrix2d.d,M=(u+l+c)/3,S=(d+p+f)/3,w=u-M,E=d-S,D=Math.sqrt(w*w+E*E);u=M+w/D*(D+b),d=S+E/D*(D+T),w=l-M,E=p-S,D=Math.sqrt(w*w+E*E),l=M+w/D*(D+b),p=S+E/D*(D+T),w=c-M,E=f-S,D=Math.sqrt(w*w+E*E),c=M+w/D*(D+b),f=S+E/D*(D+T)}t.save(),t.beginPath(),t.moveTo(u,d),t.lineTo(l,p),t.lineTo(c,f),t.closePath(),t.clip();var C=y*g+x*v+m*_-g*v-x*m-y*_,P=u*g+x*c+l*_-g*c-x*l-u*_,O=y*l+u*v+m*c-l*v-u*m-y*c,R=y*g*c+x*l*v+u*m*_-u*g*v-x*m*c-y*l*_,I=d*g+x*f+p*_-g*f-x*p-d*_,A=y*p+d*v+m*f-p*v-d*m-y*f,F=y*g*f+x*p*v+d*m*_-d*g*v-x*m*f-y*p*_;t.transform(P/C,I/C,O/C,A/C,R/C,F/C),t.drawImage(s,0,0),t.restore()},i.prototype.renderMeshFlat=function(t){var e=this.context,r=t.vertices,i=r.length/2;e.beginPath();for(var n=1;n<i-2;n++){var o=2*n,s=r[o],a=r[o+2],h=r[o+4],u=r[o+1],l=r[o+3],c=r[o+5];e.moveTo(s,u),e.lineTo(a,l),e.lineTo(h,c)}e.fillStyle="#FF0000",e.fill(),e.closePath()},i.prototype._onTextureUpdate=function(){this.updateFrame=!0},i.prototype.containsLocalPoint=function(t){return this.geometry.getBounds().containsPoint(t.x,t.y)&&this.geometry.containsPoint(t,this.drawMode===i.DRAW_MODES.TRIANGLE_MESH)},i.DRAW_MODES={TRIANGLE_MESH:0,TRIANGLES:1}},{"../core":99,"./webgl/MeshShader":197,"pixi-gl-core":25}],194:[function(t,e,r){function i(t,e,r){n.call(this,t),this._ready=!0,this.segmentsX=e||10,this.segmentsY=r||10,this.drawMode=n.DRAW_MODES.TRIANGLES,this.refresh()}var n=t("./Mesh");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.refresh=function(){var t=this.segmentsX*this.segmentsY,e=[],r=[],i=[],n=[],o=this.texture,s=this.segmentsX-1,a=this.segmentsY-1,h=0,u=o.width/s,l=o.height/a;for(h=0;h<t;h++){var c=h%this.segmentsX,d=h/this.segmentsX|0;e.push(c*u,d*l),i.push(o._uvs.x0+(o._uvs.x1-o._uvs.x0)*(c/(this.segmentsX-1)),o._uvs.y0+(o._uvs.y3-o._uvs.y0)*(d/(this.segmentsY-1)))}var p=s*a;for(h=0;h<p;h++){var f=h%s,y=h/s|0,m=y*this.segmentsX+f,v=y*this.segmentsX+f+1,x=(y+1)*this.segmentsX+f,g=(y+1)*this.segmentsX+f+1;n.push(m,v,x),n.push(v,g,x)}this.vertices=new Float32Array(e),this.uvs=new Float32Array(i),this.colors=new Float32Array(r),this.indices=new Uint16Array(n),this.indexDirty=!0},i.prototype._onTextureUpdate=function(){n.prototype._onTextureUpdate.call(this),this._ready&&this.refresh()}},{"./Mesh":193}],195:[function(t,e,r){function i(t,e){n.call(this,t,new Float32Array(4*e.length),new Float32Array(4*e.length),new Uint16Array(2*e.length)),this.points=e,this.colors=new Float32Array(2*e.length),this._ready=!0,this.refresh()}var n=t("./Mesh"),o=t("../core");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.refresh=function(){var t=this.points;if(!(t.length<1)&&this._texture._uvs){var e=this.uvs,r=this.indices,i=this.colors,n=this._texture._uvs,s=new o.Point(n.x0,n.y0),a=new o.Point(n.x2-n.x0,n.y2-n.y0);e[0]=0+s.x,e[1]=0+s.y,e[2]=0+s.x,e[3]=1*a.y+s.y,i[0]=1,i[1]=1,r[0]=0,r[1]=1;for(var h,u,l,c=t.length,d=1;d<c;d++)h=t[d],u=4*d,l=d/(c-1),e[u]=l*a.x+s.x,e[u+1]=0+s.y,e[u+2]=l*a.x+s.x,e[u+3]=1*a.y+s.y,u=2*d,i[u]=1,i[u+1]=1,u=2*d,r[u]=u,r[u+1]=u+1;this.dirty=!0,this.indexDirty=!0}},i.prototype._onTextureUpdate=function(){n.prototype._onTextureUpdate.call(this),this._ready&&this.refresh()},i.prototype.updateTransform=function(){var t=this.points;if(!(t.length<1)){for(var e,r,i,n,o,s,a=t[0],h=0,u=0,l=this.geometry,c=l.vertices,d=t.length,p=0;p<d;p++)r=t[p],i=4*p,e=p<t.length-1?t[p+1]:r,u=-(e.x-a.x),h=e.y-a.y,n=10*(1-p/(d-1)),n>1&&(n=1),o=Math.sqrt(h*h+u*u),s=this._texture.height/2,h/=o,u/=o,h*=s,u*=s,c[i]=r.x+h,c[i+1]=r.y+u,c[i+2]=r.x-h,c[i+3]=r.y-u,a=r;l.version++,this.containerUpdateTransform()}}},{"../core":99,"./Mesh":193}],196:[function(t,e,r){e.exports={Mesh:t("./Mesh"),Plane:t("./Plane"),Rope:t("./Rope"),MeshShader:t("./webgl/MeshShader")}},{"./Mesh":193,"./Plane":194,"./Rope":195,"./webgl/MeshShader":197}],197:[function(t,e,r){function i(t){n.call(this,t,["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","uniform mat4 translationMatrix;","uniform mat4 projectionMatrix;","varying vec2 vTextureCoord;","void main(void){","   gl_Position = projectionMatrix * translationMatrix * vec4(aVertexPosition, 0.0, 1.0);","   vTextureCoord = aTextureCoord;","}"].join("\n"),["varying vec2 vTextureCoord;","uniform float alpha;","uniform sampler2D uSampler;","void main(void){","   gl_FragColor = texture2D(uSampler, vTextureCoord) * alpha ;","}"].join("\n"))}var n=t("../../core/Shader");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i},{"../../core/Shader":53}],198:[function(t,e,r){function i(t,e,r){n.Container.call(this),r=r||15e3,t=t||15e3;var i=16384;r>i&&(r=i),r>t&&(r=t),this._properties=[!1,!0,!1,!1,!1],this._maxSize=t,this._batchSize=r,this._glBuffers=[],this._bufferToUpdate=0,this.interactiveChildren=!1,this.blendMode=n.BLEND_MODES.NORMAL,this.roundPixels=!0,this.baseTexture=null,this.setProperties(e)}var n=t("../core");i.prototype=Object.create(n.Container.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.setProperties=function(t){t&&(this._properties[0]="scale"in t?!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="alpha"in t?!!t.alpha:this._properties[4])},i.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},i.prototype.renderWebGL=function(t){this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.hasLoaded||this.baseTexture.once("update",function(){this.onChildrenChange(0)},this)),t.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},i.prototype.onChildrenChange=function(t){var e=Math.floor(t/this._batchSize);e<this._bufferToUpdate&&(this._bufferToUpdate=e)},i.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.projectionMatrix2d,i=!0,n=0,o=0,s=0,a=0,h=t.blendModes[this.blendMode];h!==e.globalCompositeOperation&&(e.globalCompositeOperation=h),e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var u=0;u<this.children.length;++u){var l=this.children[u];if(l.visible){var c=l.texture.frame;if(e.globalAlpha=this.worldAlpha*l.alpha,l.rotation%(2*Math.PI)===0)i&&(e.setTransform(r.a,r.b,r.c,r.d,r.tx,r.ty),i=!1),n=l.anchor.x*(-c.width*l.scale.x)+l.position.x+.5,o=l.anchor.y*(-c.height*l.scale.y)+l.position.y+.5,s=c.width*l.scale.x,a=c.height*l.scale.y;else{i||(i=!0),l.displayObjectUpdateTransform();var d=l.projectionMatrix2d;t.roundPixels?e.setTransform(d.a,d.b,d.c,d.d,0|d.tx,0|d.ty):e.setTransform(d.a,d.b,d.c,d.d,d.tx,d.ty),n=l.anchor.x*-c.width+.5,o=l.anchor.y*-c.height+.5,s=c.width,a=c.height}e.drawImage(l.texture.baseTexture.source,c.x,c.y,c.width,c.height,n,o,s,a)}}}},i.prototype.destroy=function(){if(n.Container.prototype.destroy.apply(this,arguments),this._buffers)for(var t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._properties=null,this._buffers=null}},{"../core":99}],199:[function(t,e,r){e.exports={ParticleContainer:t("./ParticleContainer"),ParticleRenderer:t("./webgl/ParticleRenderer")}},{"./ParticleContainer":198,"./webgl/ParticleRenderer":201}],200:[function(t,e,r){function i(t,e,r,i){this.gl=t,this.vertSize=2,this.vertByteSize=4*this.vertSize,this.size=i,this.dynamicProperties=[],this.staticProperties=[];for(var n=0;n<e.length;n++){var o=e[n];r[n]?this.dynamicProperties.push(o):this.staticProperties.push(o)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.initBuffers()}var n=t("pixi-gl-core"),o=t("../../core/utils/createIndicesForQuads");i.prototype.constructor=i,e.exports=i,i.prototype.initBuffers=function(){var t,e,r=this.gl,i=0;for(this.indices=o(this.size),this.indexBuffer=n.GLBuffer.createIndexBuffer(r,this.indices,r.STATIC_DRAW),this.dynamicStride=0,t=0;t<this.dynamicProperties.length;t++)e=this.dynamicProperties[t],
  e.offset=i,i+=e.size,this.dynamicStride+=e.size;this.dynamicData=new Float32Array(this.size*this.dynamicStride*4),this.dynamicBuffer=n.GLBuffer.createVertexBuffer(r,this.dynamicData,r.STREAM_DRAW);var s=0;for(this.staticStride=0,t=0;t<this.staticProperties.length;t++)e=this.staticProperties[t],e.offset=s,s+=e.size,this.staticStride+=e.size;for(this.staticData=new Float32Array(this.size*this.staticStride*4),this.staticBuffer=n.GLBuffer.createVertexBuffer(r,this.staticData,r.STATIC_DRAW),this.vao=new n.VertexArrayObject(r).addIndex(this.indexBuffer),t=0;t<this.dynamicProperties.length;t++)e=this.dynamicProperties[t],this.vao.addAttribute(this.dynamicBuffer,e.attribute,r.FLOAT,!1,4*this.dynamicStride,4*e.offset);for(t=0;t<this.staticProperties.length;t++)e=this.staticProperties[t],this.vao.addAttribute(this.staticBuffer,e.attribute,r.FLOAT,!1,4*this.staticStride,4*e.offset)},i.prototype.uploadDynamic=function(t,e,r){for(var i=0;i<this.dynamicProperties.length;i++){var n=this.dynamicProperties[i];n.uploadFunction(t,e,r,this.dynamicData,this.dynamicStride,n.offset)}this.dynamicBuffer.upload()},i.prototype.uploadStatic=function(t,e,r){for(var i=0;i<this.staticProperties.length;i++){var n=this.staticProperties[i];n.uploadFunction(t,e,r,this.staticData,this.staticStride,n.offset)}this.staticBuffer.upload()},i.prototype.bind=function(){this.vao.bind()},i.prototype.destroy=function(){this.dynamicProperties=null,this.dynamicData=null,this.dynamicBuffer.destroy(),this.staticProperties=null,this.staticData=null,this.staticBuffer.destroy()}},{"../../core/utils/createIndicesForQuads":152,"pixi-gl-core":25}],201:[function(t,e,r){function i(t){n.ObjectRenderer.call(this,t),this.shader=null,this.indexBuffer=null,this.properties=null,this.tempMatrix=new n.Matrix,this.CONTEXT_UID=0}var n=t("../../core"),o=t("./ParticleShader"),s=t("./ParticleBuffer");i.prototype=Object.create(n.ObjectRenderer.prototype),i.prototype.constructor=i,e.exports=i,n.WebGLRenderer.registerPlugin("particle",i),i.prototype.onContextChange=function(){var t=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.shader=new o(t),this.properties=[{attribute:this.shader.attributes.aVertexPosition,size:2,uploadFunction:this.uploadVertices,offset:0},{attribute:this.shader.attributes.aPositionCoord,size:2,uploadFunction:this.uploadPosition,offset:0},{attribute:this.shader.attributes.aRotation,size:1,uploadFunction:this.uploadRotation,offset:0},{attribute:this.shader.attributes.aTextureCoord,size:2,uploadFunction:this.uploadUvs,offset:0},{attribute:this.shader.attributes.aColor,size:1,uploadFunction:this.uploadAlpha,offset:0}]},i.prototype.start=function(){this.renderer.bindShader(this.shader)},i.prototype.render=function(t){var e=t.children,r=e.length,i=t._maxSize,n=t._batchSize;if(0!==r){r>i&&(r=i);var o=t._glBuffers[this.renderer.CONTEXT_UID];o||(o=t._glBuffers[this.renderer.CONTEXT_UID]=this.generateBuffers(t)),this.renderer.setBlendMode(t.blendMode);var s=this.renderer.gl,a=t.worldTransform.copy(this.tempMatrix);a.prepend(this.renderer._activeRenderTarget.projectionMatrix),this.shader.uniforms.projectionMatrix=a.toArray(!0),this.shader.uniforms.uAlpha=t.worldAlpha;var h=e[0]._texture.baseTexture;this.renderer.bindTexture(h);for(var u=0,l=0;u<r;u+=n,l+=1){var c=r-u;c>n&&(c=n);var d=o[l];d.uploadDynamic(e,u,c),t._bufferToUpdate===l&&(d.uploadStatic(e,u,c),t._bufferToUpdate=l+1),d.vao.bind().draw(s.TRIANGLES,6*c).unbind()}}},i.prototype.generateBuffers=function(t){var e,r=this.renderer.gl,i=[],n=t._maxSize,o=t._batchSize,a=t._properties;for(e=0;e<n;e+=o)i.push(new s(r,this.properties,a,o));return i},i.prototype.uploadVertices=function(t,e,r,i,n,o){for(var s,a,h,u,l,c,d,p,f=0;f<r;f++)s=t[e+f],a=s._frame.inner||s._frame,h=s.scale.x,u=s.scale.y,c=a.x,p=a.y,l=c+a.width,d=p+a.height,i[o]=c*h,i[o+1]=p*u,i[o+n]=l*h,i[o+n+1]=p*u,i[o+2*n]=l*h,i[o+2*n+1]=d*u,i[o+3*n]=c*h,i[o+3*n+1]=d*u,o+=4*n},i.prototype.uploadPosition=function(t,e,r,i,n,o){for(var s=0;s<r;s++){var a=t[e+s].position;i[o]=a.x,i[o+1]=a.y,i[o+n]=a.x,i[o+n+1]=a.y,i[o+2*n]=a.x,i[o+2*n+1]=a.y,i[o+3*n]=a.x,i[o+3*n+1]=a.y,o+=4*n}},i.prototype.uploadRotation=function(t,e,r,i,n,o){for(var s=0;s<r;s++){var a=t[e+s].rotation;i[o]=a,i[o+n]=a,i[o+2*n]=a,i[o+3*n]=a,o+=4*n}},i.prototype.uploadUvs=function(t,e,r,i,n,o){for(var s=0;s<r;s++){var a=t[e+s]._texture._uvs;a?(i[o]=a.x0,i[o+1]=a.y0,i[o+n]=a.x1,i[o+n+1]=a.y1,i[o+2*n]=a.x2,i[o+2*n+1]=a.y2,i[o+3*n]=a.x3,i[o+3*n+1]=a.y3,o+=4*n):(i[o]=0,i[o+1]=0,i[o+n]=0,i[o+n+1]=0,i[o+2*n]=0,i[o+2*n+1]=0,i[o+3*n]=0,i[o+3*n+1]=0,o+=4*n)}},i.prototype.uploadAlpha=function(t,e,r,i,n,o){for(var s=0;s<r;s++){var a=t[e+s].alpha;i[o]=a,i[o+n]=a,i[o+2*n]=a,i[o+3*n]=a,o+=4*n}},i.prototype.destroy=function(){this.renderer.gl&&this.renderer.gl.deleteBuffer(this.indexBuffer),n.ObjectRenderer.prototype.destroy.apply(this,arguments),this.shader.destroy(),this.indices=null,this.tempMatrix=null}},{"../../core":99,"./ParticleBuffer":200,"./ParticleShader":202}],202:[function(t,e,r){function i(t){n.call(this,t,["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void){","   vec2 v = aVertexPosition;","   v.x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);","   v.y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);","   v = v + aPositionCoord;","   gl_Position = vec4((projectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);","   vTextureCoord = aTextureCoord;","   vColor = aColor;","}"].join("\n"),["varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","uniform float uAlpha;","void main(void){","  vec4 color = texture2D(uSampler, vTextureCoord) * vColor * uAlpha;","  if (color.a == 0.0) discard;","  gl_FragColor = color;","}"].join("\n"))}var n=t("../../core/Shader");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i},{"../../core/Shader":53}],203:[function(t,e,r){Math.sign||(Math.sign=function(t){return t=+t,0===t||isNaN(t)?t:t>0?1:-1})},{}],204:[function(t,e,r){Object.assign||(Object.assign=t("object-assign"))},{"object-assign":16}],205:[function(t,e,r){t("./Object.assign"),t("./requestAnimationFrame"),t("./Math.sign"),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array)},{"./Math.sign":203,"./Object.assign":204,"./requestAnimationFrame":206}],206:[function(t,e,r){(function(t){if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!t.performance||!t.performance.now){var e=Date.now();t.performance||(t.performance={}),t.performance.now=function(){return Date.now()-e}}for(var r=Date.now(),i=["ms","moz","webkit","o"],n=0;n<i.length&&!t.requestAnimationFrame;++n)t.requestAnimationFrame=t[i[n]+"RequestAnimationFrame"],t.cancelAnimationFrame=t[i[n]+"CancelAnimationFrame"]||t[i[n]+"CancelRequestAnimationFrame"];t.requestAnimationFrame||(t.requestAnimationFrame=function(t){if("function"!=typeof t)throw new TypeError(t+"is not a function");var e=Date.now(),i=16+r-e;return i<0&&(i=0),r=e,setTimeout(function(){r=Date.now(),t(performance.now())},i)}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(t){clearTimeout(t)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],207:[function(t,e,r){function i(){}var n=t("../../core");i.prototype.constructor=i,e.exports=i,i.prototype.upload=function(t,e){"function"==typeof t&&(e=t,t=null),e()},i.prototype.register=function(){return this},i.prototype.add=function(){return this},n.CanvasRenderer.registerPlugin("prepare",i)},{"../../core":99}],208:[function(t,e,r){e.exports={webGL:t("./webgl/WebGLPrepare"),canvas:t("./canvas/CanvasPrepare")}},{"./canvas/CanvasPrepare":207,"./webgl/WebGLPrepare":209}],209:[function(t,e,r){function i(t){this.renderer=t,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.complete=null,this.register(s,n).register(a,o)}function n(t,e){return e instanceof h.BaseTexture&&(t.textureManager.updateTexture(e),!0)}function o(t,e){return e instanceof h.Graphics&&(t.plugins.graphics.updateGraphics(e),!0)}function s(t,e){if(t instanceof h.BaseTexture)return e.indexOf(t)===-1&&e.push(t),!0;if(t._texture&&t._texture instanceof h.Texture){var r=t._texture.baseTexture;return e.indexOf(r)===-1&&e.push(r),!0}return!1}function a(t,e){return t instanceof h.Graphics&&(e.push(t),!0)}var h=t("../../core"),u=h.ticker.shared;i.UPLOADS_PER_FRAME=4,i.prototype.constructor=i,e.exports=i,i.prototype.upload=function(t,e){"function"==typeof t&&(e=t,t=null),t&&this.add(t),this.queue.length?(this.numLeft=i.UPLOADS_PER_FRAME,this.complete=e,u.add(this.tick,this)):e()},i.prototype.tick=function(){for(;this.queue.length&&this.numLeft>0;){for(var t=this.queue[0],e=!1,r=0,n=this.uploadHooks.length;r<n;r++)if(this.uploadHooks[r](this.renderer,t)){this.numLeft--,this.queue.shift(),e=!0;break}e||this.queue.shift()}if(this.queue.length)this.numLeft=i.UPLOADS_PER_FRAME;else{u.remove(this.tick,this);var o=this.complete;this.complete=null,o()}},i.prototype.register=function(t,e){return t&&this.addHooks.push(t),e&&this.uploadHooks.push(e),this},i.prototype.add=function(t){var e,r;for(e=0,r=this.addHooks.length;e<r&&!this.addHooks[e](t,this.queue);e++);if(t instanceof h.Container)for(e=t.children.length-1;e>=0;e--)this.add(t.children[e]);return this},h.WebGLRenderer.registerPlugin("prepare",i)},{"../../core":99}]},{},[182])(182)});
  //# sourceMappingURL=pixi.min.js.map
  