UNPKG

convex-pixel

Version:

The library for creating pseudo 3d interactive scenes based on webgl

1 lines 524 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("tslib"),require("url")):"function"==typeof define&&define.amd?define(["tslib","url"],e):(t=t||self).ConvexPixel=e(t.tslib_1,t.url)}(this,function(a,r){"use strict";var i="default"in r?r.default:r,h=(Object.defineProperty(n,"poolCount",{get:function(){return this._pool.length},enumerable:!0,configurable:!0}),n.new=function(t,e){if(void 0===t&&(t=0),void 0===e&&(e=0),0<n._pool.length){var i=n._pool.pop();if(i)return i.set(t,e)}return new n(t,e)},n.prototype.set=function(t,e){return this.x=t,this.y=e,this},n.prototype.move=function(t,e){return this.x=t,this.y=e,this},n.prototype.from=function(t){return this.x=t.x,this.y=t.y,this},n.prototype.free=function(){n._pool.push(this)},n.prototype.valueOf=function(){return{x:this.x,y:this.y}},n.prototype.clone=function(){return n.new(this.x,this.y)},n.prototype.add=function(t,e){return void 0===e&&(e=!0),e?n.new(this.x+t.x,this.y+t.y):(this.x+=t.x,this.y+=t.y,this)},n.prototype.deduct=function(t,e){return void 0===e&&(e=!0),e?n.new(this.x-t.x,this.y-t.y):(this.x-=t.x,this.y-=t.y,this)},n.prototype.measureDistance=function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!0);var r=Math.max(this.x,t.x)-Math.min(this.x,t.x),t=Math.max(this.y,t.y)-Math.min(this.y,t.y);return e&&i?Math.sqrt(Math.pow(r,2)+Math.pow(t,2)):e?r:i?t:0},n.prototype.comparePoint=function(t){return this.x===t.x&&this.y===t.y},n.prototype.empty=function(){this.x=this.y=0},n._pool=new Array,n);function n(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}var t=(Object.defineProperty(o,"poolCount",{get:function(){return this._pool.length},enumerable:!0,configurable:!0}),o.new=function(t,e,i){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),0<o._pool.length){var r=o._pool.pop();if(r)return r.set(t,e,i)}return new o(t,e,i)},o.prototype.set=function(t,e,i){return this.x=t,this.y=e,this.z=i,this},o.prototype.free=function(){o._pool.push(this)},o.prototype.valueOf=function(){return{x:this.x,y:this.y,z:this.z}},o._pool=new Array,o);function o(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this.z=i}var u,d=(Object.defineProperty(s,"poolCount",{get:function(){return this._pool.length},enumerable:!0,configurable:!0}),s.new=function(t,e,i,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),0<s._pool.length){var n=s._pool.pop();if(n)return n.set(t,e,i,r)}return new s(t,e,i,r)},s.prototype.set=function(t,e,i,r){return this.x=t,this.y=e,this.z=i,this.t=r,this},s.prototype.free=function(){s._pool.push(this)},s.prototype.valueOf=function(){return{x:this.x,y:this.y,z:this.z,t:this.t}},s._pool=new Array,s);function s(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=t,this.y=e,this.z=i,this.t=r}(Io=u=u||{})[Io.NONE=0]="NONE",Io[Io.FILL=1]="FILL",Io[Io.SHOW_ALL=2]="SHOW_ALL",Io[Io.O_FILL=3]="O_FILL",Io[Io.O_SHOW_ALL=4]="O_SHOW_ALL";function e(t,e,i,r,n){var o,s;switch(void 0===n&&(n=u.NONE),n){case u.SHOW_ALL:return o=i/t,s=r/e,Math.min(o,s);case u.FILL:return o=i/t,s=r/e,Math.max(o,s);case u.O_SHOW_ALL:case u.O_FILL:return o=i<t?i/t:t/i,s=r<e?r/e:e/r,Math.min(o,s);case u.NONE:default:return 1}}var l,c=function(t,e,i){var r;if(void 0===i&&(i=0),e&&e.to&&(r=e.to),!t)return d.new();var n=d.new(t.x,t.y,t.scale.x,t.scale.y);return t.parent&&(r&&t.parent,i=c(t.parent,e,i++),n.x+=i.x||0,n.y+=i.y||0,n.z*=i.z||1,n.t*=i.t||1,i.free()),n},p=Object.freeze({get RatioFitTypes(){return u},getRatio:e,getAbsolutePosition:c});(Qo=l=l||{}).CHANGE="change",Qo.LOST_CONTEXT="lost-context";var f=(_.create=function(){return _.instance||(_.instance=new _),_.instance},_.prototype.run=function(){this._timerId=setInterval(this._tickHandler,this._interval)},_.prototype.stop=function(){this._timerId&&(clearInterval(this._timerId),this._timerId=void 0)},_.prototype.add=function(t){-1<this._poolDetectors.indexOf(t)||this._poolDetectors.push(t)},_.prototype.remove=function(t){t=this._poolDetectors.indexOf(t);-1!==t&&this._poolDetectors.splice(t,1)},_.prototype.removeAll=function(){for(;0<this._poolDetectors.length;){var t=this._poolDetectors.pop();t&&t.destroy()}},_.prototype.destroy=function(){this.stop(),this.removeAll(),this._poolDetectors.length=0},_);function _(t){var i=this;void 0===t&&(t=500),this._poolDetectors=new Array,this._timerId=void 0,this._tickHandler=function(){for(var t=0,e=i._poolDetectors.length;t<e;t++)i._poolDetectors[t].detectChanges()},this._interval=t}var m="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function y(t,e){return t(e={exports:{}},e.exports),e.exports}var g=y(function(t,P){!function(t){var e,i=t.Promise,r=i&&"resolve"in i&&"reject"in i&&"all"in i&&"race"in i&&(new i(function(t){e=t}),"function"==typeof e);P?(P.Promise=r?i:E,P.Polyfill=E):r||(t.Promise=E);function n(){}var o="pending",s="sealed",a="fulfilled",h="rejected";function u(t){return"[object Array]"===Object.prototype.toString.call(t)}var l,c="undefined"!=typeof setImmediate?setImmediate:setTimeout,p=[];function d(){for(var t=0;t<p.length;t++)p[t][0](p[t][1]);l=!(p=[])}function f(t,e){p.push([t,e]),l||(l=!0,c(d,0))}function _(t,e){function i(t){x(e,t)}try{t(function(t){g(e,t)},i)}catch(t){i(t)}}function m(e){var t=e.owner,i=t.state_,r=t.data_,n=e[i],e=e.then;if("function"==typeof n){i=a;try{r=n(r)}catch(t){x(e,t)}}y(e,r)||(i===a&&g(e,r),i===h&&x(e,r))}function y(e,i){var r;try{if(e===i)throw new TypeError("A promises callback cannot return that same promise.");if(i&&("function"==typeof i||"object"==typeof i)){var t=i.then;if("function"==typeof t)return t.call(i,function(t){r||(r=!0,(i!==t?g:v)(e,t))},function(t){r||(r=!0,x(e,t))}),1}}catch(t){return r||x(e,t),1}}function g(t,e){t!==e&&y(t,e)||v(t,e)}function v(t,e){t.state_===o&&(t.state_=s,t.data_=e,f(T,t))}function x(t,e){t.state_===o&&(t.state_=s,t.data_=e,f(w,t))}function b(t){var e=t.then_;t.then_=void 0;for(var i=0;i<e.length;i++)m(e[i])}function T(t){t.state_=a,b(t)}function w(t){t.state_=h,b(t)}function E(t){if("function"!=typeof t)throw new TypeError("Promise constructor takes a function argument");if(this instanceof E==!1)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this.then_=[],_(t,this)}E.prototype={constructor:E,state_:o,then_:null,data_:void 0,then:function(t,e){e={owner:this,then:new this.constructor(n),fulfilled:t,rejected:e};return this.state_===a||this.state_===h?f(m,e):this.then_.push(e),e.then},catch:function(t){return this.then(null,t)}},E.all=function(s){if(!u(s))throw new TypeError("You must pass an array to Promise.all().");return new this(function(i,t){var r=[],n=0;for(var e,o=0;o<s.length;o++)(e=s[o])&&"function"==typeof e.then?e.then(function(e){return n++,function(t){r[e]=t,--n||i(r)}}(o),t):r[o]=e;n||i(r)})},E.race=function(n){if(!u(n))throw new TypeError("You must pass an array to Promise.race().");return new this(function(t,e){for(var i,r=0;r<n.length;r++)(i=n[r])&&"function"==typeof i.then?i.then(t,e):t(i)})},E.resolve=function(e){return e&&"object"==typeof e&&e.constructor===this?e:new this(function(t){t(e)})},E.reject=function(i){return new this(function(t,e){e(i)})}}("undefined"!=typeof window?window:0?self:m)}),v=(g.Promise,g.Polyfill),x=Object.getOwnPropertySymbols,b=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var w=function(){try{if(!Object.assign)return;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return;for(var e={},i=0;i<10;i++)e["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},r)).join("")?void 0:1}catch(t){return}}()?Object.assign:function(t,e){for(var i,r,n=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),o=1;o<arguments.length;o++){for(var s in i=Object(arguments[o]))b.call(i,s)&&(n[s]=i[s]);if(x){r=x(i);for(var a=0;a<r.length;a++)T.call(i,r[a])&&(n[r[a]]=i[r[a]])}}return n};window.Promise||(window.Promise=v),Object.assign||(Object.assign=w);var E;Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),window.performance&&window.performance.now||(E=Date.now(),window.performance||(window.performance={}),window.performance.now=function(){return Date.now()-E});for(var P=Date.now(),O=["ms","moz","webkit","o"],S=0;S<O.length&&!window.requestAnimationFrame;++S){var A=O[S];window.requestAnimationFrame=window[A+"RequestAnimationFrame"],window.cancelAnimationFrame=window[A+"CancelAnimationFrame"]||window[A+"CancelRequestAnimationFrame"]}window.requestAnimationFrame||(window.requestAnimationFrame=function(t){if("function"!=typeof t)throw new TypeError(t+"is not a function");var e=Date.now(),i=16+P-e;return i<0&&(i=0),P=e,window.setTimeout(function(){P=Date.now(),t(performance.now())},i)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){return clearTimeout(t)}),Math.sign||(Math.sign=function(t){return 0===(t=Number(t))||isNaN(t)?t:0<t?1:-1}),Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array);function C(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&1<t.maxTouchPoints&&"undefined"==typeof MSStream}var I=/iPhone/i,M=/iPod/i,R=/iPad/i,D=/\biOS-universal(?:.+)Mac\b/i,L=/\bAndroid(?:.+)Mobile\b/i,N=/Android/i,F=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,k=/Silk/i,U=/Windows Phone/i,B=/\bWindows(?:.+)ARM\b/i,j=/BlackBerry/i,X=/BB10/i,H=/Opera Mini/i,z=/\b(CriOS|Chrome)(?:.+)Mobile/i,G=/Mobile(?:.+)Firefox\b/i;var V=function(t){var e={userAgent:"",platform:"",maxTouchPoints:0};t||"undefined"==typeof navigator?"string"==typeof t?e.userAgent=t:t&&t.userAgent&&(e={userAgent:t.userAgent,platform:t.platform,maxTouchPoints:t.maxTouchPoints||0}):e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var i,r=e.userAgent;return void 0!==(t=r.split("[FBAN"))[1]&&(r=t[0]),void 0!==(t=r.split("Twitter"))[1]&&(r=t[0]),(r={apple:{phone:(r=(i=r,function(t){return t.test(i)}))(I)&&!r(U),ipod:r(M),tablet:!r(I)&&(r(R)||C(e))&&!r(U),universal:r(D),device:(r(I)||r(M)||r(R)||r(D)||C(e))&&!r(U)},amazon:{phone:r(F),tablet:!r(F)&&r(k),device:r(F)||r(k)},android:{phone:!r(U)&&r(F)||!r(U)&&r(L),tablet:!r(U)&&!r(F)&&!r(L)&&(r(k)||r(N)),device:!r(U)&&(r(F)||r(k)||r(L)||r(N))||r(/\bokhttp\b/i)},windows:{phone:r(U),tablet:r(B),device:r(U)||r(B)},other:{blackberry:r(j),blackberry10:r(X),opera:r(H),firefox:r(G),chrome:r(z),device:r(j)||r(X)||r(H)||r(G)||r(z)},any:!1,phone:!1,tablet:!1}).any=r.apple.device||r.android.device||r.windows.device||r.other.device,r.phone=r.apple.phone||r.android.phone||r.windows.phone,r.tablet=r.apple.tablet||r.android.tablet||r.windows.tablet,r}(window.navigator);var Y,W,q,Z,K={MIPMAP_TEXTURES:1,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:(Y=32,q=!0,(V.tablet||V.phone)&&(V.apple.device&&(W=navigator.userAgent.match(/OS (\d+)_(\d+)?/))&&parseInt(W[1],10)<11&&(q=!1),V.android.device&&(W=navigator.userAgent.match(/Android\s([0-9.]*)/))&&parseInt(W[1],10)<7&&(q=!1)),q?Y:4),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:V.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!V.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},J=2*Math.PI,Q=180/Math.PI,$=Math.PI/180;(kh=Z=Z||{})[kh.POLY=0]="POLY",kh[kh.RECT=1]="RECT",kh[kh.CIRC=2]="CIRC",kh[kh.ELIP=3]="ELIP",kh[kh.RREC=4]="RREC";var tt=(Object.defineProperty(et.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(et,"EMPTY",{get:function(){return new et(0,0,0,0)},enumerable:!1,configurable:!0}),et.prototype.clone=function(){return new et(this.x,this.y,this.width,this.height)},et.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},et.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},et.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)},et.prototype.pad=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this},et.prototype.fit=function(t){var e=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),t=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(i-e,0),this.y=r,this.height=Math.max(t-r,0),this},et.prototype.ceil=function(t,e){void 0===t&&(t=1),void 0===e&&(e=.001);var i=Math.ceil((this.x+this.width-e)*t)/t,r=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=i-this.x,this.height=r-this.y,this},et.prototype.enlarge=function(t){var e=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),t=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=i-e,this.y=r,this.height=t-r,this},et);function et(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r),this.type=Z.RECT}var it=(rt.prototype.clone=function(){return new rt(this.x,this.y,this.radius)},rt.prototype.contains=function(t,e){if(this.radius<=0)return!1;var i=this.radius*this.radius,t=this.x-t,e=this.y-e;return(t*=t)+(e*=e)<=i},rt.prototype.getBounds=function(){return new tt(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},rt);function rt(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this.radius=i,this.type=Z.CIRC}var nt=(ot.prototype.clone=function(){return new ot(this.x,this.y,this.width,this.height)},ot.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;t=(t-this.x)/this.width,e=(e-this.y)/this.height;return(t*=t)+(e*=e)<=1},ot.prototype.getBounds=function(){return new tt(this.x-this.width,this.y-this.height,this.width,this.height)},ot);function ot(t,e,i,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),this.x=t,this.y=e,this.width=i,this.height=r,this.type=Z.ELIP}var st=(at.prototype.clone=function(){var t=new at(this.points.slice());return t.closeStroke=this.closeStroke,t},at.prototype.contains=function(t,e){for(var i=!1,r=this.points.length/2,n=0,o=r-1;n<r;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];e<a!=e<u&&t<(e-a)/(u-a)*(h-s)+s&&(i=!i)}return i},at);function at(){for(var t=arguments,e=[],i=0;i<arguments.length;i++)e[i]=t[i];var r=Array.isArray(e[0])?e[0]:e;if("number"!=typeof r[0]){for(var n=[],o=0,s=r.length;o<s;o++)n.push(r[o].x,r[o].y);r=n}this.points=r,this.type=Z.POLY,this.closeStroke=!0}var ht=(ut.prototype.clone=function(){return new ut(this.x,this.y,this.width,this.height,this.radius)},ut.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var i=t-(this.x+this.radius),r=e-(this.y+this.radius),n=this.radius*this.radius;if(i*i+r*r<=n)return!0;if((i=t-(this.x+this.width-this.radius))*i+r*r<=n)return!0;if(i*i+(r=e-(this.y+this.height-this.radius))*r<=n)return!0;if((i=t-(this.x+this.radius))*i+r*r<=n)return!0}return!1},ut);function ut(t,e,i,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===n&&(n=20),this.x=t,this.y=e,this.width=i,this.height=r,this.radius=n,this.type=Z.RREC}var lt=(ct.prototype.clone=function(){return new ct(this.x,this.y)},ct.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},ct.prototype.copyTo=function(t){return t.set(this.x,this.y),t},ct.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},ct.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this},ct);function ct(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}var pt=(dt.prototype.clone=function(t,e){return void 0===t&&(t=this.cb),void 0===e&&(e=this.scope),new dt(t,e,this._x,this._y)},dt.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._x===t&&this._y===e||(this._x=t,this._y=e,this.cb.call(this.scope)),this},dt.prototype.copyFrom=function(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this},dt.prototype.copyTo=function(t){return t.set(this._x,this._y),t},dt.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},Object.defineProperty(dt.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(dt.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),dt);function dt(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0),this._x=i,this._y=r,this.cb=t,this.scope=e}var ft=(_t.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},_t.prototype.set=function(t,e,i,r,n,o){return this.a=t,this.b=e,this.c=i,this.d=r,this.tx=n,this.ty=o,this},_t.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));e=e||this.array;return t?(e[0]=this.a,e[1]=this.b,e[2]=0,e[3]=this.c,e[4]=this.d,e[5]=0,e[6]=this.tx,e[7]=this.ty):(e[0]=this.a,e[1]=this.c,e[2]=this.tx,e[3]=this.b,e[4]=this.d,e[5]=this.ty,e[6]=0,e[7]=0),e[8]=1,e},_t.prototype.apply=function(t,e){e=e||new lt;var i=t.x,t=t.y;return e.x=this.a*i+this.c*t+this.tx,e.y=this.b*i+this.d*t+this.ty,e},_t.prototype.applyInverse=function(t,e){e=e||new lt;var i=1/(this.a*this.d+this.c*-this.b),r=t.x,t=t.y;return e.x=this.d*i*r+-this.c*i*t+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*t+-this.b*i*r+(-this.ty*this.a+this.tx*this.b)*i,e},_t.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},_t.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},_t.prototype.rotate=function(t){var e=Math.cos(t),i=Math.sin(t),r=this.a,n=this.c,t=this.tx;return this.a=r*e-this.b*i,this.b=r*i+this.b*e,this.c=n*e-this.d*i,this.d=n*i+this.d*e,this.tx=t*e-this.ty*i,this.ty=t*i+this.ty*e,this},_t.prototype.append=function(t){var e=this.a,i=this.b,r=this.c,n=this.d;return this.a=t.a*e+t.b*r,this.b=t.a*i+t.b*n,this.c=t.c*e+t.d*r,this.d=t.c*i+t.d*n,this.tx=t.tx*e+t.ty*r+this.tx,this.ty=t.tx*i+t.ty*n+this.ty,this},_t.prototype.setTransform=function(t,e,i,r,n,o,s,a,h){return this.a=Math.cos(s+h)*n,this.b=Math.sin(s+h)*n,this.c=-Math.sin(s-a)*o,this.d=Math.cos(s-a)*o,this.tx=t-(i*this.a+r*this.c),this.ty=e-(i*this.b+r*this.d),this},_t.prototype.prepend=function(t){var e,i,r=this.tx;return 1===t.a&&0===t.b&&0===t.c&&1===t.d||(e=this.a,i=this.c,this.a=e*t.a+this.b*t.c,this.b=e*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d),this.tx=r*t.a+this.ty*t.c+t.tx,this.ty=r*t.b+this.ty*t.d+t.ty,this},_t.prototype.decompose=function(t){var e=this.a,i=this.b,r=this.c,n=this.d,o=-Math.atan2(-r,n),s=Math.atan2(i,e),a=Math.abs(o+s);return a<1e-5||Math.abs(J-a)<1e-5?(t.rotation=s,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=o,t.skew.y=s),t.scale.x=Math.sqrt(e*e+i*i),t.scale.y=Math.sqrt(r*r+n*n),t.position.x=this.tx,t.position.y=this.ty,t},_t.prototype.invert=function(){var t=this.a,e=this.b,i=this.c,r=this.d,n=this.tx,o=t*r-e*i;return this.a=r/o,this.b=-e/o,this.c=-i/o,this.d=t/o,this.tx=(i*this.ty-r*n)/o,this.ty=-(t*this.ty-e*n)/o,this},_t.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},_t.prototype.clone=function(){var t=new _t;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},_t.prototype.copyTo=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},_t.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},Object.defineProperty(_t,"IDENTITY",{get:function(){return new _t},enumerable:!1,configurable:!0}),Object.defineProperty(_t,"TEMP_MATRIX",{get:function(){return new _t},enumerable:!1,configurable:!0}),_t);function _t(t,e,i,r,n,o){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=1),void 0===n&&(n=0),void 0===o&&(o=0),this.array=null,this.a=t,this.b=e,this.c=i,this.d=r,this.tx=n,this.ty=o}var mt=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],yt=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],gt=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],vt=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],xt=[],bt=[],Tt=Math.sign;!function(){for(var t=0;t<16;t++){var e=[];xt.push(e);for(var i=0;i<16;i++)for(var r=Tt(mt[t]*mt[i]+gt[t]*yt[i]),n=Tt(yt[t]*mt[i]+vt[t]*yt[i]),o=Tt(mt[t]*gt[i]+gt[t]*vt[i]),s=Tt(yt[t]*gt[i]+vt[t]*vt[i]),a=0;a<16;a++)if(mt[a]===r&&yt[a]===n&&gt[a]===o&&vt[a]===s){e.push(a);break}}for(t=0;t<16;t++){var h=new ft;h.set(mt[t],yt[t],gt[t],vt[t],0,0),bt.push(h)}}();var wt={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:function(t){return mt[t]},uY:function(t){return yt[t]},vX:function(t){return gt[t]},vY:function(t){return vt[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return xt[t][e]},sub:function(t,e){return xt[t][wt.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?0<=e?wt.S:wt.N:2*Math.abs(e)<=Math.abs(t)?0<t?wt.E:wt.W:0<e?0<t?wt.SE:wt.SW:0<t?wt.NE:wt.NW},matrixAppendRotationInv:function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0);e=bt[wt.inv(e)];e.tx=i,e.ty=r,t.append(e)}},Et=(Pt.prototype.onChange=function(){this._localID++},Pt.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},Pt.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},Pt.prototype.updateTransform=function(t){var e,i,r=this.localTransform;this._localID!==this._currentLocalID&&(r.a=this._cx*this.scale.x,r.b=this._sx*this.scale.x,r.c=this._cy*this.scale.y,r.d=this._sy*this.scale.y,r.tx=this.position.x-(this.pivot.x*r.a+this.pivot.y*r.c),r.ty=this.position.y-(this.pivot.x*r.b+this.pivot.y*r.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID&&(e=t.worldTransform,(i=this.worldTransform).a=r.a*e.a+r.b*e.c,i.b=r.a*e.b+r.b*e.d,i.c=r.c*e.a+r.d*e.c,i.d=r.c*e.b+r.d*e.d,i.tx=r.tx*e.a+r.ty*e.c+e.tx,i.ty=r.tx*e.b+r.ty*e.d+e.ty,this._parentID=t._worldID,this._worldID++)},Pt.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(Pt.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),Pt.IDENTITY=new Pt,Pt);function Pt(){this.worldTransform=new ft,this.localTransform=new ft,this.position=new pt(this.onChange,this,0,0),this.scale=new pt(this.onChange,this,1,1),this.pivot=new pt(this.onChange,this,0,0),this.skew=new pt(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}var Ot,St,At,Ct,It,Mt,Rt,Dt,Lt,Nt,Ft,kt,Ut,Bt,jt,Xt,Ht,zt=y(function(t){var r=Object.prototype.hasOwnProperty,d="~";function i(){}function o(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function n(t,e,i,r,n){if("function"!=typeof i)throw new TypeError("The listener must be a function");n=new o(i,r||t,n),e=d?d+e:e;return t._events[e]?t._events[e].fn?t._events[e]=[t._events[e],n]:t._events[e].push(n):(t._events[e]=n,t._eventsCount++),t}function h(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function e(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(d=!1)),e.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)r.call(t,e)&&i.push(d?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},e.prototype.listeners=function(t){var t=d?d+t:t,e=this._events[t];if(!e)return[];if(e.fn)return[e.fn];for(var i=0,r=e.length,n=new Array(r);i<r;i++)n[i]=e[i].fn;return n},e.prototype.listenerCount=function(t){t=d?d+t:t,t=this._events[t];return t?t.fn?1:t.length:0},e.prototype.emit=function(t,e,i,r,n,o){var s=d?d+t:t;if(!this._events[s])return!1;var a,h=this._events[s],u=arguments.length;if(h.fn){switch(h.once&&this.removeListener(t,h.fn,void 0,!0),u){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,e),!0;case 3:return h.fn.call(h.context,e,i),!0;case 4:return h.fn.call(h.context,e,i,r),!0;case 5:return h.fn.call(h.context,e,i,r,n),!0;case 6:return h.fn.call(h.context,e,i,r,n,o),!0}for(p=1,a=new Array(u-1);p<u;p++)a[p-1]=arguments[p];h.fn.apply(h.context,a)}else for(var l,c=h.length,p=0;p<c;p++)switch(h[p].once&&this.removeListener(t,h[p].fn,void 0,!0),u){case 1:h[p].fn.call(h[p].context);break;case 2:h[p].fn.call(h[p].context,e);break;case 3:h[p].fn.call(h[p].context,e,i);break;case 4:h[p].fn.call(h[p].context,e,i,r);break;default:if(!a)for(l=1,a=new Array(u-1);l<u;l++)a[l-1]=arguments[l];h[p].fn.apply(h[p].context,a)}return!0},e.prototype.on=function(t,e,i){return n(this,t,e,i,!1)},e.prototype.once=function(t,e,i){return n(this,t,e,i,!0)},e.prototype.removeListener=function(t,e,i,r){t=d?d+t:t;if(!this._events[t])return this;if(!e)return h(this,t),this;var n=this._events[t];if(n.fn)n.fn!==e||r&&!n.once||i&&n.context!==i||h(this,t);else{for(var o=0,s=[],a=n.length;o<a;o++)(n[o].fn!==e||r&&!n[o].once||i&&n[o].context!==i)&&s.push(n[o]);s.length?this._events[t]=1===s.length?s[0]:s:h(this,t)}return this},e.prototype.removeAllListeners=function(t){return t?(t=d?d+t:t,this._events[t]&&h(this,t)):(this._events=new i,this._eventsCount=0),this},e.prototype.off=e.prototype.removeListener,e.prototype.addListener=e.prototype.on,e.prefixed=d,e.EventEmitter=e,t.exports=e}),Gt=Yt,Vt=Yt;function Yt(t,e,i){i=i||2;var r,n,o,s,a,h,u,l=e&&e.length,c=l?e[0]*i:t.length,p=Wt(t,0,c,i,!0),d=[];if(!p||p.next===p.prev)return d;if(l&&(p=function(t,e,i,r){var n,o,s,a,h=[];for(n=0,o=e.length;n<o;n++)s=e[n]*r,a=n<o-1?e[n+1]*r:t.length,(a=Wt(t,s,a,r,!1))===a.next&&(a.steiner=!0),h.push(function(t){var e=t,i=t;for(;(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next,e!==t;);return i}(a));for(h.sort(Kt),n=0;n<h.length;n++)!function(t,e){(e=function(t,e){var i,r=e,n=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=n&&s<a){if((s=a)===n){if(o===r.y)return r;if(o===r.next.y)return r.next}i=r.x<r.next.x?r:r.next}}}while(r=r.next,r!==e);if(!i)return null;if(n===s)return i;var h,u=i,l=i.x,c=i.y,p=1/0;r=i;for(;n>=r.x&&r.x>=l&&n!==r.x&&Qt(o<c?n:s,o,l,c,o<c?s:n,o,r.x,r.y)&&(h=Math.abs(o-r.y)/(n-r.x),ne(r,t)&&(h<p||h===p&&(r.x>i.x||r.x===i.x&&function(t,e){return $t(t.prev,t,e.prev)<0&&$t(e.next,t,t.next)<0}(i,r)))&&(i=r,p=h)),r=r.next,r!==u;);return i}(t,e))&&(t=oe(e,t),qt(e,e.next),qt(t,t.next))}(h[n],i),i=qt(i,i.next);return i}(t,e,p,i)),t.length>80*i){r=o=t[0],n=s=t[1];for(var f=i;f<c;f+=i)(a=t[f])<r&&(r=a),(h=t[f+1])<n&&(n=h),o<a&&(o=a),s<h&&(s=h);u=0!==(u=Math.max(o-r,s-n))?1/u:0}return Zt(p,d,i,r,n,u),d}function Wt(t,e,i,r,n){var o,s;if(n===0<ue(t,e,i,r))for(o=e;o<i;o+=r)s=se(o,t[o],t[o+1],s);else for(o=i-r;e<=o;o-=r)s=se(o,t[o],t[o+1],s);return s&&te(s,s.next)&&(ae(s),s=s.next),s}function qt(t,e){if(!t)return t;e=e||t;var i,r=t;do{if(i=!1,r.steiner||!te(r,r.next)&&0!==$t(r.prev,r,r.next))r=r.next;else{if(ae(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function Zt(t,e,i,r,n,o,s){if(t){!s&&o&&function(t,e,i,r){var n=t;for(;null===n.z&&(n.z=Jt(n.x,n.y,e,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next,n!==t;);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,i,r,n,o,s,a,h,u=1;do{for(i=t,o=t=null,s=0;i;){for(s++,r=i,e=a=0;e<u&&(a++,r=r.nextZ);e++);for(h=u;0<a||0<h&&r;)0!==a&&(0===h||!r||i.z<=r.z)?(i=(n=i).nextZ,a--):(r=(n=r).nextZ,h--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;i=r}}while(o.nextZ=null,u*=2,1<s)}(n)}(t,r,n,o);for(var a,h,u=t;t.prev!==t.next;)if(a=t.prev,h=t.next,o?function(t,e,i,r){var n=t.prev,o=t,s=t.next;if(0<=$t(n,o,s))return!1;var a=(n.x<o.x?n.x<s.x?n:s:o.x<s.x?o:s).x,h=(n.y<o.y?n.y<s.y?n:s:o.y<s.y?o:s).y,u=(n.x>o.x?n.x>s.x?n:s:o.x>s.x?o:s).x,l=(n.y>o.y?n.y>s.y?n:s:o.y>s.y?o:s).y,c=Jt(a,h,e,i,r),p=Jt(u,l,e,i,r),d=t.prevZ,f=t.nextZ;for(;d&&d.z>=c&&f&&f.z<=p;){if(d!==t.prev&&d!==t.next&&Qt(n.x,n.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=$t(d.prev,d,d.next))return!1;if(d=d.prevZ,f!==t.prev&&f!==t.next&&Qt(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&0<=$t(f.prev,f,f.next))return!1;f=f.nextZ}for(;d&&d.z>=c;){if(d!==t.prev&&d!==t.next&&Qt(n.x,n.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=$t(d.prev,d,d.next))return!1;d=d.prevZ}for(;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&Qt(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&0<=$t(f.prev,f,f.next))return!1;f=f.nextZ}return!0}(t,r,n,o):function(t){var e=t.prev,i=t,r=t.next;if(0<=$t(e,i,r))return!1;var n=t.next.next;for(;n!==t.prev;){if(Qt(e.x,e.y,i.x,i.y,r.x,r.y,n.x,n.y)&&0<=$t(n.prev,n,n.next))return!1;n=n.next}return!0}(t))e.push(a.i/i),e.push(t.i/i),e.push(h.i/i),ae(t),t=h.next,u=h.next;else if((t=h)===u){s?1===s?Zt(t=function(t,e,i){var r=t;do{var n=r.prev,o=r.next.next}while(!te(n,o)&&ee(n,r,r.next,o)&&ne(n,o)&&ne(o,n)&&(e.push(n.i/i),e.push(r.i/i),e.push(o.i/i),ae(r),ae(r.next),r=t=o),r=r.next,r!==t);return qt(r)}(qt(t),e,i),e,i,r,n,o,2):2===s&&function(t,e,i,r,n,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&ee(i,i.next,t,e))return!0}while(i=i.next,i!==t);return!1}(t,e)&&(ne(t,e)&&ne(e,t)&&function(t,e){var i=t,r=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;for(;i.y>o!=i.next.y>o&&i.next.y!==i.y&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next,i!==t;);return r}(t,e)&&($t(t.prev,t,e.prev)||$t(t,e.prev,e))||te(t,e)&&0<$t(t.prev,t,t.next)&&0<$t(e.prev,e,e.next))}(s,a)){var h=oe(s,a);return s=qt(s,s.next),h=qt(h,h.next),Zt(s,e,i,r,n,o),Zt(h,e,i,r,n,o)}a=a.next}}while(s=s.next,s!==t)}(t,e,i,r,n,o):Zt(qt(t),e,i,r,n,o,1);break}}}function Kt(t,e){return t.x-e.x}function Jt(t,e,i,r,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Qt(t,e,i,r,n,o,s,a){return 0<=(n-s)*(e-a)-(t-s)*(o-a)&&0<=(t-s)*(r-a)-(i-s)*(e-a)&&0<=(i-s)*(o-a)-(n-s)*(r-a)}function $t(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function te(t,e){return t.x===e.x&&t.y===e.y}function ee(t,e,i,r){var n=re($t(t,e,i)),o=re($t(t,e,r)),s=re($t(i,r,t)),a=re($t(i,r,e));return n!==o&&s!==a||(0===n&&ie(t,i,e)||(0===o&&ie(t,r,e)||(0===s&&ie(i,t,r)||!(0!==a||!ie(i,e,r)))))}function ie(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function re(t){return 0<t?1:t<0?-1:0}function ne(t,e){return $t(t.prev,t,t.next)<0?0<=$t(t,e,t.next)&&0<=$t(t,t.prev,e):$t(t,e,t.prev)<0||$t(t,t.next,e)<0}function oe(t,e){var i=new he(t.i,t.x,t.y),r=new he(e.i,e.x,e.y),n=t.next,o=e.prev;return(t.next=e).prev=t,(i.next=n).prev=i,(r.next=i).prev=r,(o.next=r).prev=o,r}function se(t,e,i,r){i=new he(t,e,i);return r?(i.next=r.next,(i.prev=r).next.prev=i,r.next=i):(i.prev=i).next=i,i}function ae(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 he(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ue(t,e,i,r){for(var n=0,o=e,s=i-r;o<i;o+=r)n+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return n}Yt.deviation=function(t,e,i,r){var n=e&&e.length,o=n?e[0]*i:t.length,s=Math.abs(ue(t,0,o,i));if(n)for(var a=0,h=e.length;a<h;a++){var u=e[a]*i,l=a<h-1?e[a+1]*i:t.length;s-=Math.abs(ue(t,u,l,i))}for(var c=0,a=0;a<r.length;a+=3){var p=r[a]*i,d=r[a+1]*i,f=r[a+2]*i;c+=Math.abs((t[p]-t[f])*(t[1+d]-t[1+p])-(t[p]-t[d])*(t[1+f]-t[1+p]))}return 0===s&&0===c?0:Math.abs((c-s)/s)},Yt.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},r=0,n=0;n<t.length;n++){for(var o=0;o<t[n].length;o++)for(var s=0;s<e;s++)i.vertices.push(t[n][o][s]);0<n&&(r+=t[n-1].length,i.holes.push(r))}return i},Gt.default=Vt,(qe=Ot=Ot||{})[qe.WEBGL_LEGACY=0]="WEBGL_LEGACY",qe[qe.WEBGL=1]="WEBGL",qe[qe.WEBGL2=2]="WEBGL2",(Xh=St=St||{})[Xh.UNKNOWN=0]="UNKNOWN",Xh[Xh.WEBGL=1]="WEBGL",Xh[Xh.CANVAS=2]="CANVAS",(ri=At=At||{})[ri.COLOR=16384]="COLOR",ri[ri.DEPTH=256]="DEPTH",ri[ri.STENCIL=1024]="STENCIL",(vi=Ct=Ct||{})[vi.NORMAL=0]="NORMAL",vi[vi.ADD=1]="ADD",vi[vi.MULTIPLY=2]="MULTIPLY",vi[vi.SCREEN=3]="SCREEN",vi[vi.OVERLAY=4]="OVERLAY",vi[vi.DARKEN=5]="DARKEN",vi[vi.LIGHTEN=6]="LIGHTEN",vi[vi.COLOR_DODGE=7]="COLOR_DODGE",vi[vi.COLOR_BURN=8]="COLOR_BURN",vi[vi.HARD_LIGHT=9]="HARD_LIGHT",vi[vi.SOFT_LIGHT=10]="SOFT_LIGHT",vi[vi.DIFFERENCE=11]="DIFFERENCE",vi[vi.EXCLUSION=12]="EXCLUSION",vi[vi.HUE=13]="HUE",vi[vi.SATURATION=14]="SATURATION",vi[vi.COLOR=15]="COLOR",vi[vi.LUMINOSITY=16]="LUMINOSITY",vi[vi.NORMAL_NPM=17]="NORMAL_NPM",vi[vi.ADD_NPM=18]="ADD_NPM",vi[vi.SCREEN_NPM=19]="SCREEN_NPM",vi[vi.NONE=20]="NONE",vi[vi.SRC_OVER=0]="SRC_OVER",vi[vi.SRC_IN=21]="SRC_IN",vi[vi.SRC_OUT=22]="SRC_OUT",vi[vi.SRC_ATOP=23]="SRC_ATOP",vi[vi.DST_OVER=24]="DST_OVER",vi[vi.DST_IN=25]="DST_IN",vi[vi.DST_OUT=26]="DST_OUT",vi[vi.DST_ATOP=27]="DST_ATOP",vi[vi.ERASE=26]="ERASE",vi[vi.SUBTRACT=28]="SUBTRACT",vi[vi.XOR=29]="XOR",(Ti=It=It||{})[Ti.POINTS=0]="POINTS",Ti[Ti.LINES=1]="LINES",Ti[Ti.LINE_LOOP=2]="LINE_LOOP",Ti[Ti.LINE_STRIP=3]="LINE_STRIP",Ti[Ti.TRIANGLES=4]="TRIANGLES",Ti[Ti.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",Ti[Ti.TRIANGLE_FAN=6]="TRIANGLE_FAN",(Mi=Mt=Mt||{})[Mi.RGBA=6408]="RGBA",Mi[Mi.RGB=6407]="RGB",Mi[Mi.ALPHA=6406]="ALPHA",Mi[Mi.LUMINANCE=6409]="LUMINANCE",Mi[Mi.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",Mi[Mi.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",Mi[Mi.DEPTH_STENCIL=34041]="DEPTH_STENCIL",(ki=Rt=Rt||{})[ki.TEXTURE_2D=3553]="TEXTURE_2D",ki[ki.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",ki[ki.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",ki[ki.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",ki[ki.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",ki[ki.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",ki[ki.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",ki[ki.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",ki[ki.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",(ji=Dt=Dt||{})[ji.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",ji[ji.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",ji[ji.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",ji[ji.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",ji[ji.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",ji[ji.FLOAT=5126]="FLOAT",ji[ji.HALF_FLOAT=36193]="HALF_FLOAT",(zi=Lt=Lt||{})[zi.NEAREST=0]="NEAREST",zi[zi.LINEAR=1]="LINEAR",(Vi=Nt=Nt||{})[Vi.CLAMP=33071]="CLAMP",Vi[Vi.REPEAT=10497]="REPEAT",Vi[Vi.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",(Wn=Ft=Ft||{})[Wn.OFF=0]="OFF",Wn[Wn.POW2=1]="POW2",Wn[Wn.ON=2]="ON",(Io=kt=kt||{})[Io.NPM=0]="NPM",Io[Io.UNPACK=1]="UNPACK",Io[Io.PMA=2]="PMA",Io[Io.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",Io[Io.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",Io[Io.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",(Qo=Ut=Ut||{})[Qo.NO=0]="NO",Qo[Qo.YES=1]="YES",Qo[Qo.AUTO=2]="AUTO",Qo[Qo.BLEND=0]="BLEND",Qo[Qo.CLEAR=1]="CLEAR",Qo[Qo.BLIT=2]="BLIT",(g=Bt=Bt||{})[g.AUTO=0]="AUTO",g[g.MANUAL=1]="MANUAL",(v=jt=jt||{}).LOW="lowp",v.MEDIUM="mediump",v.HIGH="highp",(w=Xt=Xt||{})[w.NONE=0]="NONE",w[w.SCISSOR=1]="SCISSOR",w[w.STENCIL=2]="STENCIL",w[w.SPRITE=3]="SPRITE",(kh=Ht=Ht||{})[kh.NONE=0]="NONE",kh[kh.LOW=2]="LOW",kh[kh.MEDIUM=4]="MEDIUM",kh[kh.HIGH=8]="HIGH",K.RETINA_PREFIX=/@([0-9\.]+)x/;var le,ce=!(K.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!0),pe="5.3.3";function de(t,e){return void 0===e&&(e=[]),e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e}function fe(t){t=t.toString(16);return"#"+(t="000000".substr(0,6-t.length)+t)}function _e(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}var me=function(){for(var t=[],e=[],i=0;i<32;i++)e[t[i]=i]=i;t[Ct.NORMAL_NPM]=Ct.NORMAL,t[Ct.ADD_NPM]=Ct.ADD,t[Ct.SCREEN_NPM]=Ct.SCREEN,e[Ct.NORMAL]=Ct.NORMAL_NPM,e[Ct.ADD]=Ct.ADD_NPM,e[Ct.SCREEN]=Ct.SCREEN_NPM;var r=[];return r.push(e),r.push(t),r}();function ye(t,e){return me[e?1:0][t]}function ge(t,e){return 1===e?(255*e<<24)+t:0===e?0:(255*e<<24)+(((t>>16&255)*e+.5|0)<<16)+(((t>>8&255)*e+.5|0)<<8)+((255&t)*e+.5|0)}function ve(t,e,i,r){return(i=i||new Float32Array(4))[0]=(t>>16&255)/255,i[1]=(t>>8&255)/255,i[2]=(255&t)/255,!r&&void 0!==r||(i[0]*=e,i[1]*=e,i[2]*=e),i[3]=e,i}function xe(t){return t+=0===t?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function be(t){return!(t&t-1||!t)}function Te(t){var e=(65535<t?1:0)<<4,i=(255<(t>>>=e)?1:0)<<3;return e|=i,e|=i=(15<(t>>>=i)?1:0)<<2,(e|=i=(3<(t>>>=i)?1:0)<<1)|(t>>>=i)>>1}function we(t,e,i){var r=t.length;if(!(r<=e||0===i)){for(var n=r-(i=r<e+i?r-e:i),o=e;o<n;++o)t[o]=t[o+i];t.length=n}}function Ee(t){return 0===t?0:t<0?-1:1}var Pe=0;var Oe={};function Se(t,e,i){var r;void 0===i&&(i=3),Oe[e]||(void 0===(r=(new Error).stack)?console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t):(r=r.split("\n").splice(i).join("\n"),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",e+"\nDeprecated since v"+t),console.warn(r),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",e+"\nDeprecated since v"+t),console.warn(r))),Oe[e]=!0)}var Ae,Ce={},Ie=Object.create(null),Me=Object.create(null),Re=(De.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},De.prototype.resize=function(t,e){this.canvas.width=t*this.resolution,this.canvas.height=e*this.resolution},De.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(De.prototype,"width",{get:function(){return this.canvas.width},set:function(t){this.canvas.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(De.prototype,"height",{get:function(){return this.canvas.height},set:function(t){this.canvas.height=t},enumerable:!1,configurable:!0}),De);function De(t,e,i){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=i||K.RESOLUTION,this.resize(t,e)}function Le(t,e){t=K.RETINA_PREFIX.exec(t);return t?parseFloat(t[1]):void 0!==e?e:1}K.SORTABLE_CHILDREN=!1;var Ne=(Fe.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},Fe.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},Fe.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?tt.EMPTY:((t=t||new tt(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},Fe.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},Fe.prototype.addQuad=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY,o=t[0],s=t[1],e=o<e?o:e,i=s<i?s:i,r=r<o?o:r,n=n<s?s:n;e=(o=t[2])<e?o:e,i=(s=t[3])<i?s:i,r=r<o?o:r,n=n<s?s:n,e=(o=t[4])<e?o:e,i=(s=t[5])<i?s:i,r=r<o?o:r,n=n<s?s:n,e=(o=t[6])<e?o:e,i=(s=t[7])<i?s:i,r=r<o?o:r,n=n<s?s:n,this.minX=e,this.minY=i,this.maxX=r,this.maxY=n},Fe.prototype.addFrame=function(t,e,i,r,n){this.addFrameMatrix(t.worldTransform,e,i,r,n)},Fe.prototype.addFrameMatrix=function(t,e,i,r,n){var o=t.a,s=t.b,a=t.c,h=t.d,u=t.tx,l=t.ty,c=o*e+a*i+u,p=s*e+h*i+l,d=c<(d=this.minX)?c:d,f=p<(f=this.minY)?p:f,_=(_=this.maxX)<c?c:_,t=(t=this.maxY)<p?p:t;d=(c=o*r+a*i+u)<d?c:d,f=(p=s*r+h*i+l)<f?p:f,_=_<c?c:_,t=t<p?p:t,d=(c=o*e+a*n+u)<d?c:d,f=(p=s*e+h*n+l)<f?p:f,_=_<c?c:_,t=t<p?p:t,d=(c=o*r+a*n+u)<d?c:d,f=(p=s*r+h*n+l)<f?p:f,_=_<c?c:_,t=t<p?p:t,this.minX=d,this.minY=f,this.maxX=_,this.maxY=t},Fe.prototype.addVertexData=function(t,e,i){for(var r=this.minX,n=this.minY,o=this.maxX,s=this.maxY,a=e;a<i;a+=2)var h=t[a],u=t[a+1],r=h<r?h:r,n=u<n?u:n,o=o<h?h:o,s=s<u?u:s;this.minX=r,this.minY=n,this.maxX=o,this.maxY=s},Fe.prototype.addVertices=function(t,e,i,r){this.addVerticesMatrix(t.worldTransform,e,i,r)},Fe.prototype.addVerticesMatrix=function(t,e,i,r,n,o){void 0===n&&(n=0),void 0===o&&(o=n);for(var s=t.a,a=t.b,h=t.c,u=t.d,l=t.tx,c=t.ty,p=this.minX,d=this.minY,f=this.maxX,_=this.maxY,m=i;m<r;m+=2)var y=e[m],g=e[m+1],v=s*y+h*g+l,y=u*g+a*y+c,p=Math.min(p,v-n),f=Math.max(f,v+n),d=Math.min(d,y-o),_=Math.max(_,y+o);this.minX=p,this.minY=d,this.maxX=f,this.maxY=_},Fe.prototype.addBounds=function(t){var e=this.minX,i=this.minY,r=this.maxX,n=this.maxY;this.minX=t.minX<e?t.minX:e,this.minY=t.minY<i?t.minY:i,this.maxX=t.maxX>r?t.maxX:r,this.maxY=t.maxY>n?t.maxY:n},Fe.prototype.addBoundsMask=function(t,e){var i,r,n=(t.minX>e.minX?t:e).minX,o=(t.minY>e.minY?t:e).minY,s=(t.maxX<e.maxX?t:e).maxX,a=(t.maxY<e.maxY?t:e).maxY;n<=s&&o<=a&&(i=this.minX,r=this.minY,t=this.maxX,e=this.maxY,this.minX=n<i?n:i,this.minY=o<r?o:r,this.maxX=t<s?s:t,this.maxY=e<a?a:e)},Fe.prototype.addBoundsMatrix=function(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)},Fe.prototype.addBoundsArea=function(t,e){var i,r,n=t.minX>e.x?t.minX:e.x,o=t.minY>e.y?t.minY:e.y,s=t.maxX<e.x+e.width?t.maxX:e.x+e.width,a=t.maxY<e.y+e.height?t.maxY:e.y+e.height;n<=s&&o<=a&&(i=this.minX,r=this.minY,t=this.maxX,e=this.maxY,this.minX=n<i?n:i,this.minY=o<r?o:r,this.maxX=t<s?s:t,this.maxY=e<a?a:e)},Fe.prototype.pad=function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)},Fe.prototype.addFramePad=function(t,e,i,r,n,o){t-=n,e-=o,i+=n,r+=o,this.minX=this.minX<t?this.minX:t,this.maxX=this.maxX>i?this.maxX:i,this.minY=this.minY<e?this.minY:e,this.maxY=this.maxY>r?this.maxY:r},Fe);function Fe(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}var ke=function(t,e){return(ke=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function Ue(t,e){function i(){this.constructor=t}ke(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var Be,Vt=(Ue(je,Be=zt),je.mixin=function(t){for(var e=Object.keys(t),i=0;i<e.length;++i){var r=e[i];Object.defineProperty(je.prototype,r,Object.getOwnPropertyDescriptor(t,r))}},je.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},je.prototype.updateTransform=function(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha},je.prototype.getBounds=function(t,e){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),e||(this._boundsRect||(this._boundsRect=new tt),e=this._boundsRect),this._bounds.getRectangle(e)},je.prototype.getLocalBounds=function(t){t||(this._localBoundsRect||(this._localBoundsRect=new tt),t=this._localBoundsRect),this._localBounds||(this._localBounds=new Ne);var e=this.transform,i=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;var r=this._bounds,n=this._boundsID;this._bounds=this._localBounds;t=this.getBounds(!1,t);return this.parent=i,this.transform=e,this._bounds=r,this._bounds.updateID+=this._boundsID-n,t},je.prototype.toGlobal=function(t,e,i){return void 0===i&&(i=!1),i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,e)},je.prototype.toLocal=function(t,e,i,r){return e&&(t=e.toGlobal(t,i,r)),r||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,i)},je.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},je.prototype.setTransform=function(t,e,i,r,n,o,s,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=1),void 0===r&&(r=1),void 0===n&&(n=0),void 0===o&&(o=0),void 0===s&&(s=0),void 0===a&&(a=0),void 0===h&&(h=0),this.position.x=t,this.position.y=e,this.scale.x=i||1,this.scale.y=r||1,this.rotation=n,this.skew.x=o,this.skew.y=s,this.pivot.x=a,this.pivot.y=h,this},je.prototype.destroy=function(t){this.parent&&this.parent.removeChild(this),this.removeAllListeners(),this.transform=null,this.parent=null,this._bounds=null,this._mask=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.interactive=!1,this.interactiveChildren=!1,this._destroyed=!0},Object.defineProperty(je.prototype,"_tempDisplayObjectParent",{get:function(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new He),this.tempDisplayObjectParent},enumerable:!1,configurable:!0}),je.prototype.enableTempParent=function(){var t=this.parent;return this.parent=this._tempDisplayObjectParent,t},je.prototype.disableTempParent=function(t){this.parent=t},Object.defineProperty(je.prototype,"x",{get:function(){return this.position.x},set:function(t){this.transform.position.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"y",{get:function(){return this.position.y},set:function(t){this.transform.position.y=t},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"worldTransform",{get:function(){return this.transform.worldTransform},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"localTransform",{get:function(){return this.transform.localTransform},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"position",{get:function(){return this.transform.position},set:function(t){this.transform.position.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"scale",{get:function(){return this.transform.scale},set:function(t){this.transform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"pivot",{get:function(){return this.transform.pivot},set:function(t){this.transform.pivot.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"skew",{get:function(){return this.transform.skew},set:function(t){this.transform.skew.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(t){this.transform.rotation=t},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"angle",{get:function(){return this.transform.rotation*Q},set:function(t){this.transform.rotation=t*$},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"zIndex",{get:function(){return this._zIndex},set:function(t){this._zIndex=t,this.parent&&(this.parent.sortDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"worldVisible",{get:function(){var t=this;do{if(!t.visible)return!1}while(t=t.parent);return!0},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"mask",{get:function(){return this._mask},set:function(t){var e;this._mask&&((e=this._mask.maskObject||this._mask).renderable=!0,e.isMask=!1),this._mask=t,this._mask&&((e=this._mask.maskObject||this._mask).renderable=!1,e.isMask=!0)},enumerable:!1,configurable:!0}),je);function je(){var t=Be.call(this)||this;return t.tempDisplayObjectParent=null,t.transform=new Et,t.alpha=1,t.visible=!0,t.renderable=!0,t.parent=null,t.worldAlpha=1,t._lastSortedIndex=0,t._zIndex=0,t.filterArea=null,t.filters=null,t._enabledFilters=null,t._bounds=new Ne,t._localBounds=null,t._bou