subway-12/js/dependencies.bundle.js
2023-04-18 22:01:55 -05:00

2 lines
1.5 MiB
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! For license information please see dependencies.bundle.js.LICENSE.txt */
((self||this).webpackJsonp=(self||this).webpackJsonp||[]).push([[0],[function(t,e,i){"use strict";i.r(e),i.d(e,"utils",(function(){return c})),i.d(e,"AccessibilityManager",(function(){return x})),i.d(e,"accessibleTarget",(function(){return w})),i.d(e,"InteractionData",(function(){return S})),i.d(e,"InteractionEvent",(function(){return A})),i.d(e,"InteractionManager",(function(){return k})),i.d(e,"InteractionTrackingData",(function(){return E})),i.d(e,"interactiveTarget",(function(){return M})),i.d(e,"Application",(function(){return R})),i.d(e,"AbstractBatchRenderer",(function(){return O.a})),i.d(e,"AbstractRenderer",(function(){return O.b})),i.d(e,"Attribute",(function(){return O.c})),i.d(e,"BaseRenderTexture",(function(){return O.d})),i.d(e,"BaseTexture",(function(){return O.e})),i.d(e,"BatchDrawCall",(function(){return O.f})),i.d(e,"BatchGeometry",(function(){return O.g})),i.d(e,"BatchPluginFactory",(function(){return O.h})),i.d(e,"BatchRenderer",(function(){return O.i})),i.d(e,"BatchShaderGenerator",(function(){return O.j})),i.d(e,"BatchTextureArray",(function(){return O.k})),i.d(e,"Buffer",(function(){return O.l})),i.d(e,"Filter",(function(){return O.m})),i.d(e,"FilterState",(function(){return O.n})),i.d(e,"Framebuffer",(function(){return O.o})),i.d(e,"GLFramebuffer",(function(){return O.p})),i.d(e,"GLProgram",(function(){return O.q})),i.d(e,"GLTexture",(function(){return O.r})),i.d(e,"Geometry",(function(){return O.s})),i.d(e,"IGLUniformData",(function(){return O.t})),i.d(e,"MaskData",(function(){return O.u})),i.d(e,"ObjectRenderer",(function(){return O.v})),i.d(e,"Program",(function(){return O.w})),i.d(e,"Quad",(function(){return O.x})),i.d(e,"QuadUv",(function(){return O.y})),i.d(e,"RenderTexture",(function(){return O.z})),i.d(e,"RenderTexturePool",(function(){return O.A})),i.d(e,"Renderer",(function(){return O.B})),i.d(e,"Shader",(function(){return O.C})),i.d(e,"SpriteMaskFilter",(function(){return O.D})),i.d(e,"State",(function(){return O.E})),i.d(e,"System",(function(){return O.F})),i.d(e,"Texture",(function(){return O.G})),i.d(e,"TextureMatrix",(function(){return O.H})),i.d(e,"TextureUvs",(function(){return O.I})),i.d(e,"UniformGroup",(function(){return O.J})),i.d(e,"ViewableBuffer",(function(){return O.K})),i.d(e,"autoDetectRenderer",(function(){return O.L})),i.d(e,"checkMaxIfStatementsInShader",(function(){return O.M})),i.d(e,"defaultFilterVertex",(function(){return O.N})),i.d(e,"defaultVertex",(function(){return O.O})),i.d(e,"resources",(function(){return O.P})),i.d(e,"systems",(function(){return O.Q})),i.d(e,"uniformParsers",(function(){return O.R})),i.d(e,"Extract",(function(){return N})),i.d(e,"AppLoaderPlugin",(function(){return ht})),i.d(e,"Loader",(function(){return st})),i.d(e,"LoaderResource",(function(){return rt})),i.d(e,"TextureLoader",(function(){return at})),i.d(e,"ParticleContainer",(function(){return ft})),i.d(e,"ParticleRenderer",(function(){return gt})),i.d(e,"BasePrepare",(function(){return be})),i.d(e,"CountLimiter",(function(){return ce})),i.d(e,"Prepare",(function(){return Ce})),i.d(e,"TimeLimiter",(function(){return Se})),i.d(e,"Spritesheet",(function(){return Te})),i.d(e,"SpritesheetLoader",(function(){return Ae})),i.d(e,"TilingSprite",(function(){return Ie})),i.d(e,"TilingSpriteRenderer",(function(){return Re})),i.d(e,"BitmapFont",(function(){return Ze})),i.d(e,"BitmapFontData",(function(){return He})),i.d(e,"BitmapFontLoader",(function(){return ei})),i.d(e,"BitmapText",(function(){return ti})),i.d(e,"Ticker",(function(){return C.a})),i.d(e,"TickerPlugin",(function(){return C.b})),i.d(e,"UPDATE_PRIORITY",(function(){return C.c})),i.d(e,"ALPHA_MODES",(function(){return ut.a})),i.d(e,"BLEND_MODES",(function(){return ut.b})),i.d(e,"BUFFER_BITS",(function(){return ut.c})),i.d(e,"CLEAR_MODES",(function(){return ut.d})),i.d(e,"DRAW_MODES",(function(){return ut.e})),i.d(e,"ENV",(function(){return ut.f})),i.d(e,"FORMATS",(function(){return ut.g})),i.d(e,"GC_MODES",(function(){return ut.h})),i.d(e,"MASK_TYPES",(function(){return ut.i})),i.d(e,"MIPMAP_MODES",(function(){return ut.j})),i.d(e,"MSAA_QUALITY",(function(){return ut.k})),i.d(e,"PRECISION",(function(){return ut.l})),i.d(e,"RENDERER_TYPE",(function(){return ut.m})),i.d(e,"SCALE_MODES",(function(){return ut.n})),i.d(e,"TARGETS",(function(){return ut.o})),i.d(e,"TYPES",(function(){return ut.p})),i.d(e,"WRAP_MODES",(function(){return ut.q})),i.d(e,"Bounds",(function(){return f})),i.d(e,"Container",(function(){return _})),i.d(e,"DisplayObject",(function(){return y})),i.d(e,"TemporaryDisplayObject",(function(){return v})),i.d(e,"FillStyle",(function(){return vt})),i.d(e,"GRAPHICS_CURVES",(function(){return yt})),i.d(e,"Graphics",(function(){return Yt})),i.d(e,"GraphicsData",(function(){return jt})),i.d(e,"GraphicsGeometry",(function(){return Ht})),i.d(e,"LINE_CAP",(function(){return pt})),i.d(e,"LINE_JOIN",(function(){return dt})),i.d(e,"LineStyle",(function(){return Vt})),i.d(e,"graphicsUtils",(function(){return zt})),i.d(e,"Circle",(function(){return p.a})),i.d(e,"DEG_TO_RAD",(function(){return p.b})),i.d(e,"Ellipse",(function(){return p.c})),i.d(e,"Matrix",(function(){return p.d})),i.d(e,"ObservablePoint",(function(){return p.e})),i.d(e,"PI_2",(function(){return p.f})),i.d(e,"Point",(function(){return p.g})),i.d(e,"Polygon",(function(){return p.h})),i.d(e,"RAD_TO_DEG",(function(){return p.i})),i.d(e,"Rectangle",(function(){return p.j})),i.d(e,"RoundedRectangle",(function(){return p.k})),i.d(e,"SHAPES",(function(){return p.l})),i.d(e,"Transform",(function(){return p.m})),i.d(e,"groupD8",(function(){return p.n})),i.d(e,"Mesh",(function(){return ze})),i.d(e,"MeshBatchUvs",(function(){return Ne})),i.d(e,"MeshGeometry",(function(){return Ge})),i.d(e,"MeshMaterial",(function(){return je})),i.d(e,"NineSlicePlane",(function(){return Vi})),i.d(e,"PlaneGeometry",(function(){return zi})),i.d(e,"RopeGeometry",(function(){return ji})),i.d(e,"SimpleMesh",(function(){return Hi})),i.d(e,"SimplePlane",(function(){return Ui})),i.d(e,"SimpleRope",(function(){return Gi})),i.d(e,"Runner",(function(){return Wi.a})),i.d(e,"Sprite",(function(){return Qt})),i.d(e,"AnimatedSprite",(function(){return Yi})),i.d(e,"TEXT_GRADIENT",(function(){return Kt})),i.d(e,"Text",(function(){return ue})),i.d(e,"TextMetrics",(function(){return ae})),i.d(e,"TextStyle",(function(){return ie})),i.d(e,"isMobile",(function(){return d.a})),i.d(e,"settings",(function(){return d.b})),i.d(e,"VERSION",(function(){return Qi})),i.d(e,"filters",(function(){return $i})),i.d(e,"useDeprecated",(function(){return Zi}));var n=i(221),r=i(222),o=i.n(r);window.Promise||(window.Promise=n.Polyfill),Object.assign||(Object.assign=o.a);if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!window.performance||!window.performance.now){var a=Date.now();window.performance||(window.performance={}),window.performance.now=function(){return Date.now()-a}}for(var s=Date.now(),h=["ms","moz","webkit","o"],u=0;u<h.length&&!window.requestAnimationFrame;++u){var l=h[u];window.requestAnimationFrame=window[l+"RequestAnimationFrame"],window.cancelAnimationFrame=window[l+"CancelAnimationFrame"]||window[l+"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+s-e;return i<0&&(i=0),s=e,window.setTimeout((function(){s=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:t>0?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);var c=i(4),d=i(15),p=i(8);d.b.SORTABLE_CHILDREN=!1;var f=function(){function t(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return t.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},t.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},t.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?p.j.EMPTY:((t=t||new p.j(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},t.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)},t.prototype.addQuad=function(t){var e=this.minX,i=this.minY,n=this.maxX,r=this.maxY,o=t[0],a=t[1];e=o<e?o:e,i=a<i?a:i,n=o>n?o:n,r=a>r?a:r,e=(o=t[2])<e?o:e,i=(a=t[3])<i?a:i,n=o>n?o:n,r=a>r?a:r,e=(o=t[4])<e?o:e,i=(a=t[5])<i?a:i,n=o>n?o:n,r=a>r?a:r,e=(o=t[6])<e?o:e,i=(a=t[7])<i?a:i,n=o>n?o:n,r=a>r?a:r,this.minX=e,this.minY=i,this.maxX=n,this.maxY=r},t.prototype.addFrame=function(t,e,i,n,r){this.addFrameMatrix(t.worldTransform,e,i,n,r)},t.prototype.addFrameMatrix=function(t,e,i,n,r){var o=t.a,a=t.b,s=t.c,h=t.d,u=t.tx,l=t.ty,c=this.minX,d=this.minY,p=this.maxX,f=this.maxY,m=o*e+s*i+u,g=a*e+h*i+l;c=m<c?m:c,d=g<d?g:d,p=m>p?m:p,f=g>f?g:f,c=(m=o*n+s*i+u)<c?m:c,d=(g=a*n+h*i+l)<d?g:d,p=m>p?m:p,f=g>f?g:f,c=(m=o*e+s*r+u)<c?m:c,d=(g=a*e+h*r+l)<d?g:d,p=m>p?m:p,f=g>f?g:f,c=(m=o*n+s*r+u)<c?m:c,d=(g=a*n+h*r+l)<d?g:d,p=m>p?m:p,f=g>f?g:f,this.minX=c,this.minY=d,this.maxX=p,this.maxY=f},t.prototype.addVertexData=function(t,e,i){for(var n=this.minX,r=this.minY,o=this.maxX,a=this.maxY,s=e;s<i;s+=2){var h=t[s],u=t[s+1];n=h<n?h:n,r=u<r?u:r,o=h>o?h:o,a=u>a?u:a}this.minX=n,this.minY=r,this.maxX=o,this.maxY=a},t.prototype.addVertices=function(t,e,i,n){this.addVerticesMatrix(t.worldTransform,e,i,n)},t.prototype.addVerticesMatrix=function(t,e,i,n,r,o){void 0===r&&(r=0),void 0===o&&(o=r);for(var a=t.a,s=t.b,h=t.c,u=t.d,l=t.tx,c=t.ty,d=this.minX,p=this.minY,f=this.maxX,m=this.maxY,g=i;g<n;g+=2){var y=e[g],v=e[g+1],b=a*y+h*v+l,_=u*v+s*y+c;d=Math.min(d,b-r),f=Math.max(f,b+r),p=Math.min(p,_-o),m=Math.max(m,_+o)}this.minX=d,this.minY=p,this.maxX=f,this.maxY=m},t.prototype.addBounds=function(t){var e=this.minX,i=this.minY,n=this.maxX,r=this.maxY;this.minX=t.minX<e?t.minX:e,this.minY=t.minY<i?t.minY:i,this.maxX=t.maxX>n?t.maxX:n,this.maxY=t.maxY>r?t.maxY:r},t.prototype.addBoundsMask=function(t,e){var i=t.minX>e.minX?t.minX:e.minX,n=t.minY>e.minY?t.minY:e.minY,r=t.maxX<e.maxX?t.maxX:e.maxX,o=t.maxY<e.maxY?t.maxY:e.maxY;if(i<=r&&n<=o){var a=this.minX,s=this.minY,h=this.maxX,u=this.maxY;this.minX=i<a?i:a,this.minY=n<s?n:s,this.maxX=r>h?r:h,this.maxY=o>u?o:u}},t.prototype.addBoundsMatrix=function(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)},t.prototype.addBoundsArea=function(t,e){var i=t.minX>e.x?t.minX:e.x,n=t.minY>e.y?t.minY:e.y,r=t.maxX<e.x+e.width?t.maxX:e.x+e.width,o=t.maxY<e.y+e.height?t.maxY:e.y+e.height;if(i<=r&&n<=o){var a=this.minX,s=this.minY,h=this.maxX,u=this.maxY;this.minX=i<a?i:a,this.minY=n<s?n:s,this.maxX=r>h?r:h,this.maxY=o>u?o:u}},t.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)},t.prototype.addFramePad=function(t,e,i,n,r,o){t-=r,e-=o,i+=r,n+=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>n?this.maxY:n},t}(),m=function(t,e){return(m=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 g(t,e){function i(){this.constructor=t}m(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var y=function(t){function e(){var e=t.call(this)||this;return e.tempDisplayObjectParent=null,e.transform=new p.m,e.alpha=1,e.visible=!0,e.renderable=!0,e.parent=null,e.worldAlpha=1,e._lastSortedIndex=0,e._zIndex=0,e.filterArea=null,e.filters=null,e._enabledFilters=null,e._bounds=new f,e._localBounds=null,e._boundsID=0,e._boundsRect=null,e._localBoundsRect=null,e._mask=null,e._destroyed=!1,e.isSprite=!1,e.isMask=!1,e}return g(e,t),e.mixin=function(t){for(var i=Object.keys(t),n=0;n<i.length;++n){var r=i[n];Object.defineProperty(e.prototype,r,Object.getOwnPropertyDescriptor(t,r))}},e.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},e.prototype.updateTransform=function(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha},e.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 p.j),e=this._boundsRect),this._bounds.getRectangle(e)},e.prototype.getLocalBounds=function(t){t||(this._localBoundsRect||(this._localBoundsRect=new p.j),t=this._localBoundsRect),this._localBounds||(this._localBounds=new f);var e=this.transform,i=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;var n=this._bounds,r=this._boundsID;this._bounds=this._localBounds;var o=this.getBounds(!1,t);return this.parent=i,this.transform=e,this._bounds=n,this._bounds.updateID+=this._boundsID-r,o},e.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)},e.prototype.toLocal=function(t,e,i,n){return e&&(t=e.toGlobal(t,i,n)),n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,i)},e.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},e.prototype.setTransform=function(t,e,i,n,r,o,a,s,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=1),void 0===n&&(n=1),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a=0),void 0===s&&(s=0),void 0===h&&(h=0),this.position.x=t,this.position.y=e,this.scale.x=i||1,this.scale.y=n||1,this.rotation=r,this.skew.x=o,this.skew.y=a,this.pivot.x=s,this.pivot.y=h,this},e.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(e.prototype,"_tempDisplayObjectParent",{get:function(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new v),this.tempDisplayObjectParent},enumerable:!1,configurable:!0}),e.prototype.enableTempParent=function(){var t=this.parent;return this.parent=this._tempDisplayObjectParent,t},e.prototype.disableTempParent=function(t){this.parent=t},Object.defineProperty(e.prototype,"x",{get:function(){return this.position.x},set:function(t){this.transform.position.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.position.y},set:function(t){this.transform.position.y=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.transform.worldTransform},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localTransform",{get:function(){return this.transform.localTransform},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.transform.position},set:function(t){this.transform.position.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){return this.transform.scale},set:function(t){this.transform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pivot",{get:function(){return this.transform.pivot},set:function(t){this.transform.pivot.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"skew",{get:function(){return this.transform.skew},set:function(t){this.transform.skew.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(t){this.transform.rotation=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"angle",{get:function(){return this.transform.rotation*p.i},set:function(t){this.transform.rotation=t*p.b},enumerable:!1,configurable:!0}),Object.defineProperty(e.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(e.prototype,"worldVisible",{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.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}),e}(c.EventEmitter),v=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.sortDirty=null,e}return g(e,t),e}(y);function b(t,e){return t.zIndex===e.zIndex?t._lastSortedIndex-e._lastSortedIndex:t.zIndex-e.zIndex}y.prototype.displayObjectUpdateTransform=y.prototype.updateTransform;var _=function(t){function e(){var e=t.call(this)||this;return e.children=[],e.sortableChildren=d.b.SORTABLE_CHILDREN,e.sortDirty=!1,e}return g(e,t),e.prototype.onChildrenChange=function(t){},e.prototype.addChild=function(){for(var t=arguments,e=[],i=0;i<arguments.length;i++)e[i]=t[i];if(e.length>1)for(var n=0;n<e.length;n++)this.addChild(e[n]);else{var r=e[0];r.parent&&r.parent.removeChild(r),r.parent=this,this.sortDirty=!0,r.transform._parentID=-1,this.children.push(r),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",r,this,this.children.length-1),r.emit("added",this)}return e[0]},e.prototype.addChildAt=function(t,e){if(e<0||e>this.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t},e.prototype.swapChildren=function(t,e){if(t!==e){var i=this.getChildIndex(t),n=this.getChildIndex(e);this.children[i]=e,this.children[n]=t,this.onChildrenChange(i<n?i:n)}},e.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e},e.prototype.setChildIndex=function(t,e){if(e<0||e>=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var i=this.getChildIndex(t);Object(c.removeItems)(this.children,i,1),this.children.splice(e,0,t),this.onChildrenChange(e)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(){for(var t=arguments,e=[],i=0;i<arguments.length;i++)e[i]=t[i];if(e.length>1)for(var n=0;n<e.length;n++)this.removeChild(e[n]);else{var r=e[0],o=this.children.indexOf(r);if(-1===o)return null;r.parent=null,r.transform._parentID=-1,Object(c.removeItems)(this.children,o,1),this._boundsID++,this.onChildrenChange(o),r.emit("removed",this),this.emit("childRemoved",r,this,o)}return e[0]},e.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,Object(c.removeItems)(this.children,t,1),this._boundsID++,this.onChildrenChange(t),e.emit("removed",this),this.emit("childRemoved",e,this,t),e},e.prototype.removeChildren=function(t,e){void 0===t&&(t=0),void 0===e&&(e=this.children.length);var i,n=t,r=e-n;if(r>0&&r<=e){i=this.children.splice(n,r);for(var o=0;o<i.length;++o)i[o].parent=null,i[o].transform&&(i[o].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(o=0;o<i.length;++o)i[o].emit("removed",this),this.emit("childRemoved",i[o],this,o);return i}if(0===r&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},e.prototype.sortChildren=function(){for(var t=!1,e=0,i=this.children.length;e<i;++e){var n=this.children[e];n._lastSortedIndex=e,t||0===n.zIndex||(t=!0)}t&&this.children.length>1&&this.children.sort(b),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;t<e;++t){var i=this.children[t];i.visible&&i.updateTransform()}},e.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var t=0;t<this.children.length;t++){var e=this.children[t];if(e.visible&&e.renderable)if(e.calculateBounds(),e._mask){var i=e._mask.maskObject||e._mask;i.calculateBounds(),this._bounds.addBoundsMask(e._bounds,i._bounds)}else e.filterArea?this._bounds.addBoundsArea(e._bounds,e.filterArea):this._bounds.addBounds(e._bounds)}this._bounds.updateID=this._boundsID},e.prototype.getLocalBounds=function(e,i){void 0===i&&(i=!1);var n=t.prototype.getLocalBounds.call(this,e);if(!i)for(var r=0,o=this.children.length;r<o;++r){var a=this.children[r];a.visible&&a.updateTransform()}return n},e.prototype._calculateBounds=function(){},e.prototype.render=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this.filters&&this.filters.length)this.renderAdvanced(t);else{this._render(t);for(var e=0,i=this.children.length;e<i;++e)this.children[e].render(t)}},e.prototype.renderAdvanced=function(t){t.batch.flush();var e=this.filters,i=this._mask;if(e){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var n=0;n<e.length;n++)e[n].enabled&&this._enabledFilters.push(e[n]);this._enabledFilters.length&&t.filter.push(this,this._enabledFilters)}i&&t.mask.push(this,this._mask),this._render(t);n=0;for(var r=this.children.length;n<r;n++)this.children[n].render(t);t.batch.flush(),i&&t.mask.pop(this),e&&this._enabledFilters&&this._enabledFilters.length&&t.filter.pop()},e.prototype._render=function(t){},e.prototype.destroy=function(e){t.prototype.destroy.call(this),this.sortDirty=!1;var i="boolean"==typeof e?e:e&&e.children,n=this.removeChildren(0,this.children.length);if(i)for(var r=0;r<n.length;++r)n[r].destroy(e)},Object.defineProperty(e.prototype,"width",{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(t){var e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(t){var e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t},enumerable:!1,configurable:!0}),e}(y);_.prototype.containerUpdateTransform=_.prototype.updateTransform;var w={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};y.mixin(w);var x=function(){function t(t){this._hookDiv=null,(c.isMobile.tablet||c.isMobile.phone)&&this.createTouchHook();var e=document.createElement("div");e.style.width="100px",e.style.height="100px",e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.zIndex=2..toString(),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._isMobileAccessibility=!1,this.androidUpdateCount=0,this.androidUpdateFrequency=500,window.addEventListener("keydown",this._onKeyDown,!1)}return Object.defineProperty(t.prototype,"isActive",{get:function(){return this._isActive},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMobileAccessibility",{get:function(){return this._isMobileAccessibility},enumerable:!1,configurable:!0}),t.prototype.createTouchHook=function(){var t=this,e=document.createElement("button");e.style.width="1px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.left="-1000px",e.style.zIndex=2..toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessability for this content",e.addEventListener("focus",(function(){t._isMobileAccessibility=!0,t.activate(),t.destroyTouchHook()})),document.body.appendChild(e),this._hookDiv=e},t.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},t.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&&this.renderer.view.parentNode.appendChild(this.div))},t.prototype.deactivate=function(){this._isActive&&!this._isMobileAccessibility&&(this._isActive=!1,window.document.removeEventListener("mousemove",this._onMouseMove,!0),window.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),this.div.parentNode&&this.div.parentNode.removeChild(this.div))},t.prototype.updateAccessibleObjects=function(t){if(t.visible&&t.accessibleChildren){t.accessible&&t.interactive&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);for(var e=t.children,i=0;i<e.length;i++)this.updateAccessibleObjects(e[i])}},t.prototype.update=function(){var t=performance.now();if(!(c.isMobile.android.device&&t<this.androidUpdateCount)&&(this.androidUpdateCount=t+this.androidUpdateFrequency,this.renderer.renderingToScreen)){this.renderer._lastObjectRendered&&this.updateAccessibleObjects(this.renderer._lastObjectRendered);var e=this.renderer.view.getBoundingClientRect(),i=this.renderer.resolution,n=e.width/this.renderer.width*i,r=e.height/this.renderer.height*i,o=this.div;o.style.left=e.left+"px",o.style.top=e.top+"px",o.style.width=this.renderer.width+"px",o.style.height=this.renderer.height+"px";for(var a=0;a<this.children.length;a++){var s=this.children[a];if(s.renderId!==this.renderId)s._accessibleActive=!1,Object(c.removeItems)(this.children,a,1),this.div.removeChild(s._accessibleDiv),this.pool.push(s._accessibleDiv),s._accessibleDiv=null,a--;else{o=s._accessibleDiv;var h=s.hitArea,u=s.worldTransform;s.hitArea?(o.style.left=(u.tx+h.x*u.a)*n+"px",o.style.top=(u.ty+h.y*u.d)*r+"px",o.style.width=h.width*u.a*n+"px",o.style.height=h.height*u.d*r+"px"):(h=s.getBounds(),this.capHitArea(h),o.style.left=h.x*n+"px",o.style.top=h.y*r+"px",o.style.width=h.width*n+"px",o.style.height=h.height*r+"px",o.title!==s.accessibleTitle&&null!==s.accessibleTitle&&(o.title=s.accessibleTitle),o.getAttribute("aria-label")!==s.accessibleHint&&null!==s.accessibleHint&&o.setAttribute("aria-label",s.accessibleHint)),s.accessibleTitle===o.title&&s.tabIndex===o.tabIndex||(o.title=s.accessibleTitle,o.tabIndex=s.tabIndex,this.debug&&this.updateDebugHTML(o))}}this.renderId++}},t.prototype.updateDebugHTML=function(t){t.innerHTML="type: "+t.type+"</br> title : "+t.title+"</br> tabIndex: "+t.tabIndex},t.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)},t.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2..toString(),e.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=t.accessiblePointerEvents,e.type=t.accessibleType,t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),this.debug&&this.updateDebugHTML(e),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},t.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData),e.dispatchEvent(t.target.displayObject,"pointertap",e.eventData),e.dispatchEvent(t.target.displayObject,"tap",e.eventData)},t.prototype._onFocus=function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},t.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},t.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},t.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},t.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,window.document.removeEventListener("mousemove",this._onMouseMove,!0),window.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},t}(),C=i(33),S=function(){function t(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new p.g,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(t.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),t.prototype.getLocalPosition=function(t,e,i){return t.worldTransform.applyInverse(i||this.global,e)},t.prototype.copyEvent=function(t){"isPrimary"in t&&t.isPrimary&&(this.isPrimary=!0),this.button="button"in t&&t.button;var e="buttons"in t&&t.buttons;this.buttons=Number.isInteger(e)?e:"which"in t&&t.which,this.width="width"in t&&t.width,this.height="height"in t&&t.height,this.tiltX="tiltX"in t&&t.tiltX,this.tiltY="tiltY"in t&&t.tiltY,this.pointerType="pointerType"in t&&t.pointerType,this.pressure="pressure"in t&&t.pressure,this.rotationAngle="rotationAngle"in t&&t.rotationAngle,this.twist="twist"in t&&t.twist||0,this.tangentialPressure="tangentialPressure"in t&&t.tangentialPressure||0},t.prototype.reset=function(){this.isPrimary=!1},t}(),T=function(t,e){return(T=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)};var A=function(){function t(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return t.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},t.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},t}(),E=function(){function t(e){this._pointerId=e,this._flags=t.FLAGS.NONE}return t.prototype._doSet=function(t,e){this._flags=e?this._flags|t:this._flags&~t},Object.defineProperty(t.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"flags",{get:function(){return this._flags},set:function(t){this._flags=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"none",{get:function(){return this._flags===t.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"over",{get:function(){return 0!=(this._flags&t.FLAGS.OVER)},set:function(e){this._doSet(t.FLAGS.OVER,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightDown",{get:function(){return 0!=(this._flags&t.FLAGS.RIGHT_DOWN)},set:function(e){this._doSet(t.FLAGS.RIGHT_DOWN,e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leftDown",{get:function(){return 0!=(this._flags&t.FLAGS.LEFT_DOWN)},set:function(e){this._doSet(t.FLAGS.LEFT_DOWN,e)},enumerable:!1,configurable:!0}),t.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),t}(),P=function(){function t(){this._tempPoint=new p.g}return t.prototype.recursiveFindHit=function(t,e,i,n,r){if(!e||!e.visible)return!1;var o=t.data.global,a=!1,s=r=e.interactive||r,h=!0;if(e.hitArea?(n&&(e.worldTransform.applyInverse(o,this._tempPoint),e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?a=!0:(n=!1,h=!1)),s=!1):e._mask&&n&&(e._mask.containsPoint&&e._mask.containsPoint(o)||(n=!1)),h&&e.interactiveChildren&&e.children)for(var u=e.children,l=u.length-1;l>=0;l--){var c=u[l],d=this.recursiveFindHit(t,c,i,n,s);if(d){if(!c.parent)continue;s=!1,d&&(t.target&&(n=!1),a=!0)}}return r&&(n&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(a=!0),e.interactive&&(a&&!t.target&&(t.target=e),i&&i(t,e,!!a))),a},t.prototype.findHit=function(t,e,i,n){this.recursiveFindHit(t,e,i,n,!1)},t}(),M={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return"pointer"===this.cursor},set buttonMode(t){t?this.cursor="pointer":"pointer"===this.cursor&&(this.cursor=null)},cursor:null,get trackedPointers(){return void 0===this._trackedPointers&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};y.mixin(M);var I={target:null,data:{global:null}},k=function(t){function e(e,i){var n=t.call(this)||this;return i=i||{},n.renderer=e,n.autoPreventDefault=void 0===i.autoPreventDefault||i.autoPreventDefault,n.interactionFrequency=i.interactionFrequency||10,n.mouse=new S,n.mouse.identifier=1,n.mouse.global.set(-999999),n.activeInteractionData={},n.activeInteractionData[1]=n.mouse,n.interactionDataPool=[],n.eventData=new A,n.interactionDOMElement=null,n.moveWhenInside=!1,n.eventsAdded=!1,n.tickerAdded=!1,n.mouseOverRenderer=!1,n.supportsTouchEvents="ontouchstart"in window,n.supportsPointerEvents=!!window.PointerEvent,n.onPointerUp=n.onPointerUp.bind(n),n.processPointerUp=n.processPointerUp.bind(n),n.onPointerCancel=n.onPointerCancel.bind(n),n.processPointerCancel=n.processPointerCancel.bind(n),n.onPointerDown=n.onPointerDown.bind(n),n.processPointerDown=n.processPointerDown.bind(n),n.onPointerMove=n.onPointerMove.bind(n),n.processPointerMove=n.processPointerMove.bind(n),n.onPointerOut=n.onPointerOut.bind(n),n.processPointerOverOut=n.processPointerOverOut.bind(n),n.onPointerOver=n.onPointerOver.bind(n),n.cursorStyles={default:"inherit",pointer:"pointer"},n.currentCursorMode=null,n.cursor=null,n.resolution=1,n.delayedEvents=[],n.search=new P,n._tempDisplayObject=new v,n._useSystemTicker=void 0===i.useSystemTicker||i.useSystemTicker,n.setTargetElement(n.renderer.view,n.renderer.resolution),n}return function(t,e){function i(){this.constructor=t}T(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),Object.defineProperty(e.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(t){this._useSystemTicker=t,t?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),e.prototype.hitTest=function(t,e){return I.target=null,I.data.global=t,e||(e=this.lastObjectRendered),this.processInteractive(I,e,null,!0),I.target},e.prototype.setTargetElement=function(t,e){void 0===e&&(e=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=t,this.resolution=e,this.addEvents(),this.addTickerListener()},e.prototype.addTickerListener=function(){!this.tickerAdded&&this.interactionDOMElement&&this._useSystemTicker&&(C.a.system.add(this.tickerUpdate,this,C.c.INTERACTION),this.tickerAdded=!0)},e.prototype.removeTickerListener=function(){this.tickerAdded&&(C.a.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},e.prototype.addEvents=function(){if(!this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;window.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none"),this.supportsPointerEvents?(window.document.addEventListener("pointermove",this.onPointerMove,!0),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,!0),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,!0),window.addEventListener("pointercancel",this.onPointerCancel,!0),window.addEventListener("pointerup",this.onPointerUp,!0)):(window.document.addEventListener("mousemove",this.onPointerMove,!0),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,!0),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,!0),window.addEventListener("mouseup",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,!0),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,!0),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,!0)),this.eventsAdded=!0}},e.prototype.removeEvents=function(){if(this.eventsAdded&&this.interactionDOMElement){var t=this.interactionDOMElement.style;window.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction=""),this.supportsPointerEvents?(window.document.removeEventListener("pointermove",this.onPointerMove,!0),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,!0),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,!0),window.removeEventListener("pointercancel",this.onPointerCancel,!0),window.removeEventListener("pointerup",this.onPointerUp,!0)):(window.document.removeEventListener("mousemove",this.onPointerMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,!0),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,!0),window.removeEventListener("mouseup",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,!0),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,!0)),this.interactionDOMElement=null,this.eventsAdded=!1}},e.prototype.tickerUpdate=function(t){this._deltaTime+=t,this._deltaTime<this.interactionFrequency||(this._deltaTime=0,this.update())},e.prototype.update=function(){if(this.interactionDOMElement)if(this._didMove)this._didMove=!1;else{for(var t in this.cursor=null,this.activeInteractionData)if(this.activeInteractionData.hasOwnProperty(t)){var e=this.activeInteractionData[t];if(e.originalEvent&&"touch"!==e.pointerType){var i=this.configureInteractionEventForDOMEvent(this.eventData,e.originalEvent,e);this.processInteractive(i,this.lastObjectRendered,this.processPointerOverOut,!0)}}this.setCursorMode(this.cursor)}},e.prototype.setCursorMode=function(t){if(t=t||"default",this.currentCursorMode!==t){this.currentCursorMode=t;var e=this.cursorStyles[t];if(e)switch(typeof e){case"string":this.interactionDOMElement.style.cursor=e;break;case"function":e(t);break;case"object":Object.assign(this.interactionDOMElement.style,e)}else"string"!=typeof t||Object.prototype.hasOwnProperty.call(this.cursorStyles,t)||(this.interactionDOMElement.style.cursor=t)}},e.prototype.dispatchEvent=function(t,e,i){i.stopPropagationHint&&t!==i.stopsPropagatingAt||(i.currentTarget=t,i.type=e,t.emit(e,i),t[e]&&t[e](i))},e.prototype.delayDispatchEvent=function(t,e,i){this.delayedEvents.push({displayObject:t,eventString:e,eventData:i})},e.prototype.mapPositionToPoint=function(t,e,i){var n;n=this.interactionDOMElement.parentElement?this.interactionDOMElement.getBoundingClientRect():{x:0,y:0,width:0,height:0};var r=1/this.resolution;t.x=(e-n.left)*(this.interactionDOMElement.width/n.width)*r,t.y=(i-n.top)*(this.interactionDOMElement.height/n.height)*r},e.prototype.processInteractive=function(t,e,i,n){var r=this.search.findHit(t,e,i,n),o=this.delayedEvents;if(!o.length)return r;t.stopPropagationHint=!1;var a=o.length;this.delayedEvents=[];for(var s=0;s<a;s++){var h=o[s],u=h.displayObject,l=h.eventString,c=h.eventData;c.stopsPropagatingAt===u&&(c.stopPropagationHint=!0),this.dispatchEvent(u,l,c)}return r},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var i=e.length,n=0;n<i;n++){var r=e[n],o=this.getInteractionDataForPointerId(r),a=this.configureInteractionEventForDOMEvent(this.eventData,r,o);if(a.data.originalEvent=t,this.processInteractive(a,this.lastObjectRendered,this.processPointerDown,!0),this.emit("pointerdown",a),"touch"===r.pointerType)this.emit("touchstart",a);else if("mouse"===r.pointerType||"pen"===r.pointerType){var s=2===r.button;this.emit(s?"rightdown":"mousedown",this.eventData)}}}},e.prototype.processPointerDown=function(t,e,i){var n=t.data,r=t.data.identifier;if(i)if(e.trackedPointers[r]||(e.trackedPointers[r]=new E(r)),this.dispatchEvent(e,"pointerdown",t),"touch"===n.pointerType)this.dispatchEvent(e,"touchstart",t);else if("mouse"===n.pointerType||"pen"===n.pointerType){var o=2===n.button;o?e.trackedPointers[r].rightDown=!0:e.trackedPointers[r].leftDown=!0,this.dispatchEvent(e,o?"rightdown":"mousedown",t)}},e.prototype.onPointerComplete=function(t,e,i){for(var n=this.normalizeToPointerData(t),r=n.length,o=t.target!==this.interactionDOMElement?"outside":"",a=0;a<r;a++){var s=n[a],h=this.getInteractionDataForPointerId(s),u=this.configureInteractionEventForDOMEvent(this.eventData,s,h);if(u.data.originalEvent=t,this.processInteractive(u,this.lastObjectRendered,i,e||!o),this.emit(e?"pointercancel":"pointerup"+o,u),"mouse"===s.pointerType||"pen"===s.pointerType){var l=2===s.button;this.emit(l?"rightup"+o:"mouseup"+o,u)}else"touch"===s.pointerType&&(this.emit(e?"touchcancel":"touchend"+o,u),this.releaseInteractionDataForPointerId(s.pointerId))}},e.prototype.onPointerCancel=function(t){this.supportsTouchEvents&&"touch"===t.pointerType||this.onPointerComplete(t,!0,this.processPointerCancel)},e.prototype.processPointerCancel=function(t,e){var i=t.data,n=t.data.identifier;void 0!==e.trackedPointers[n]&&(delete e.trackedPointers[n],this.dispatchEvent(e,"pointercancel",t),"touch"===i.pointerType&&this.dispatchEvent(e,"touchcancel",t))},e.prototype.onPointerUp=function(t){this.supportsTouchEvents&&"touch"===t.pointerType||this.onPointerComplete(t,!1,this.processPointerUp)},e.prototype.processPointerUp=function(t,e,i){var n=t.data,r=t.data.identifier,o=e.trackedPointers[r],a="touch"===n.pointerType,s="mouse"===n.pointerType||"pen"===n.pointerType,h=!1;if(s){var u=2===n.button,l=E.FLAGS,c=u?l.RIGHT_DOWN:l.LEFT_DOWN,d=void 0!==o&&o.flags&c;i?(this.dispatchEvent(e,u?"rightup":"mouseup",t),d&&(this.dispatchEvent(e,u?"rightclick":"click",t),h=!0)):d&&this.dispatchEvent(e,u?"rightupoutside":"mouseupoutside",t),o&&(u?o.rightDown=!1:o.leftDown=!1)}i?(this.dispatchEvent(e,"pointerup",t),a&&this.dispatchEvent(e,"touchend",t),o&&(s&&!h||this.dispatchEvent(e,"pointertap",t),a&&(this.dispatchEvent(e,"tap",t),o.over=!1))):o&&(this.dispatchEvent(e,"pointerupoutside",t),a&&this.dispatchEvent(e,"touchendoutside",t)),o&&o.none&&delete e.trackedPointers[r]},e.prototype.onPointerMove=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);"mouse"!==e[0].pointerType&&"pen"!==e[0].pointerType||(this._didMove=!0,this.cursor=null);for(var i=e.length,n=0;n<i;n++){var r=e[n],o=this.getInteractionDataForPointerId(r),a=this.configureInteractionEventForDOMEvent(this.eventData,r,o);a.data.originalEvent=t,this.processInteractive(a,this.lastObjectRendered,this.processPointerMove,!0),this.emit("pointermove",a),"touch"===r.pointerType&&this.emit("touchmove",a),"mouse"!==r.pointerType&&"pen"!==r.pointerType||this.emit("mousemove",a)}"mouse"===e[0].pointerType&&this.setCursorMode(this.cursor)}},e.prototype.processPointerMove=function(t,e,i){var n=t.data,r="touch"===n.pointerType,o="mouse"===n.pointerType||"pen"===n.pointerType;o&&this.processPointerOverOut(t,e,i),this.moveWhenInside&&!i||(this.dispatchEvent(e,"pointermove",t),r&&this.dispatchEvent(e,"touchmove",t),o&&this.dispatchEvent(e,"mousemove",t))},e.prototype.onPointerOut=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t)[0];"mouse"===e.pointerType&&(this.mouseOverRenderer=!1,this.setCursorMode(null));var i=this.getInteractionDataForPointerId(e),n=this.configureInteractionEventForDOMEvent(this.eventData,e,i);n.data.originalEvent=e,this.processInteractive(n,this.lastObjectRendered,this.processPointerOverOut,!1),this.emit("pointerout",n),"mouse"===e.pointerType||"pen"===e.pointerType?this.emit("mouseout",n):this.releaseInteractionDataForPointerId(i.identifier)}},e.prototype.processPointerOverOut=function(t,e,i){var n=t.data,r=t.data.identifier,o="mouse"===n.pointerType||"pen"===n.pointerType,a=e.trackedPointers[r];i&&!a&&(a=e.trackedPointers[r]=new E(r)),void 0!==a&&(i&&this.mouseOverRenderer?(a.over||(a.over=!0,this.delayDispatchEvent(e,"pointerover",t),o&&this.delayDispatchEvent(e,"mouseover",t)),o&&null===this.cursor&&(this.cursor=e.cursor)):a.over&&(a.over=!1,this.dispatchEvent(e,"pointerout",this.eventData),o&&this.dispatchEvent(e,"mouseout",t),a.none&&delete e.trackedPointers[r]))},e.prototype.onPointerOver=function(t){var e=this.normalizeToPointerData(t)[0],i=this.getInteractionDataForPointerId(e),n=this.configureInteractionEventForDOMEvent(this.eventData,e,i);n.data.originalEvent=e,"mouse"===e.pointerType&&(this.mouseOverRenderer=!0),this.emit("pointerover",n),"mouse"!==e.pointerType&&"pen"!==e.pointerType||this.emit("mouseover",n)},e.prototype.getInteractionDataForPointerId=function(t){var e,i=t.pointerId;return 1===i||"mouse"===t.pointerType?e=this.mouse:this.activeInteractionData[i]?e=this.activeInteractionData[i]:((e=this.interactionDataPool.pop()||new S).identifier=i,this.activeInteractionData[i]=e),e.copyEvent(t),e},e.prototype.releaseInteractionDataForPointerId=function(t){var e=this.activeInteractionData[t];e&&(delete this.activeInteractionData[t],e.reset(),this.interactionDataPool.push(e))},e.prototype.configureInteractionEventForDOMEvent=function(t,e,i){return t.data=i,this.mapPositionToPoint(i.global,e.clientX,e.clientY),"touch"===e.pointerType&&(e.globalX=i.global.x,e.globalY=i.global.y),i.originalEvent=e,t.reset(),t},e.prototype.normalizeToPointerData=function(t){var e=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(var i=0,n=t.changedTouches.length;i<n;i++){var r=t.changedTouches[i];void 0===r.button&&(r.button=t.touches.length?1:0),void 0===r.buttons&&(r.buttons=t.touches.length?1:0),void 0===r.isPrimary&&(r.isPrimary=1===t.touches.length&&"touchstart"===t.type),void 0===r.width&&(r.width=r.radiusX||1),void 0===r.height&&(r.height=r.radiusY||1),void 0===r.tiltX&&(r.tiltX=0),void 0===r.tiltY&&(r.tiltY=0),void 0===r.pointerType&&(r.pointerType="touch"),void 0===r.pointerId&&(r.pointerId=r.identifier||0),void 0===r.pressure&&(r.pressure=r.force||.5),void 0===r.twist&&(r.twist=0),void 0===r.tangentialPressure&&(r.tangentialPressure=0),void 0===r.layerX&&(r.layerX=r.offsetX=r.clientX),void 0===r.layerY&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,e.push(r)}else if(!(t instanceof MouseEvent)||this.supportsPointerEvents&&t instanceof window.PointerEvent)e.push(t);else{var o=t;void 0===o.isPrimary&&(o.isPrimary=!0),void 0===o.width&&(o.width=1),void 0===o.height&&(o.height=1),void 0===o.tiltX&&(o.tiltX=0),void 0===o.tiltY&&(o.tiltY=0),void 0===o.pointerType&&(o.pointerType="mouse"),void 0===o.pointerId&&(o.pointerId=1),void 0===o.pressure&&(o.pressure=.5),void 0===o.twist&&(o.twist=0),void 0===o.tangentialPressure&&(o.tangentialPressure=0),o.isNormalized=!0,e.push(o)}return e},e.prototype.destroy=function(){this.removeEvents(),this.removeTickerListener(),this.removeAllListeners(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactionDOMElement=null,this.onPointerDown=null,this.processPointerDown=null,this.onPointerUp=null,this.processPointerUp=null,this.onPointerCancel=null,this.processPointerCancel=null,this.onPointerMove=null,this.processPointerMove=null,this.onPointerOut=null,this.processPointerOverOut=null,this.onPointerOver=null,this.search=null},e}(c.EventEmitter),O=i(7),R=function(){function t(e){var i=this;e=Object.assign({forceCanvas:!1},e),this.renderer=Object(O.L)(e),this.stage=new _,t._plugins.forEach((function(t){t.init.call(i,e)}))}return t.registerPlugin=function(e){t._plugins.push(e)},t.prototype.render=function(){this.renderer.render(this.stage)},Object.defineProperty(t.prototype,"view",{get:function(){return this.renderer.view},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"screen",{get:function(){return this.renderer.screen},enumerable:!1,configurable:!0}),t.prototype.destroy=function(e,i){var n=this,r=t._plugins.slice(0);r.reverse(),r.forEach((function(t){t.destroy.call(n)})),this.stage.destroy(i),this.stage=null,this.renderer.destroy(e),this.renderer=null},t}();R._plugins=[];var D=function(){function t(){}return t.init=function(t){var e=this;Object.defineProperty(this,"resizeTo",{set:function(t){window.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(window.addEventListener("resize",this.queueResize),this.resize())},get:function(){return this._resizeTo}}),this.queueResize=function(){e._resizeTo&&(e.cancelResize(),e._resizeId=requestAnimationFrame((function(){return e.resize()})))},this.cancelResize=function(){e._resizeId&&(cancelAnimationFrame(e._resizeId),e._resizeId=null)},this.resize=function(){if(e._resizeTo){var t,i;if(e.cancelResize(),e._resizeTo===window)t=window.innerWidth,i=window.innerHeight;else{var n=e._resizeTo;t=n.clientWidth,i=n.clientHeight}e.renderer.resize(t,i)}},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null},t.destroy=function(){window.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null},t}();R.registerPlugin(D);var L=new p.j,N=function(){function t(t){this.renderer=t,t.extract=this}return t.prototype.image=function(t,e,i){var n=new Image;return n.src=this.base64(t,e,i),n},t.prototype.base64=function(t,e,i){return this.canvas(t).toDataURL(e,i)},t.prototype.canvas=function(e){var i,n,r,o=this.renderer,a=!1,s=!1;e&&(e instanceof O.z?r=e:(r=this.renderer.generateTexture(e),s=!0)),r?(i=r.baseTexture.resolution,n=r.frame,a=!1,o.renderTexture.bind(r)):(i=this.renderer.resolution,a=!0,(n=L).width=this.renderer.width,n.height=this.renderer.height,o.renderTexture.bind(null));var h=Math.floor(n.width*i+1e-4),u=Math.floor(n.height*i+1e-4),l=new c.CanvasRenderTarget(h,u,1),d=new Uint8Array(4*h*u),p=o.gl;p.readPixels(n.x*i,n.y*i,h,u,p.RGBA,p.UNSIGNED_BYTE,d);var f=l.context.getImageData(0,0,h,u);if(t.arrayPostDivide(d,f.data),l.context.putImageData(f,0,0),a){var m=new c.CanvasRenderTarget(l.width,l.height,1);m.context.scale(1,-1),m.context.drawImage(l.canvas,0,-u),l.destroy(),l=m}return s&&r.destroy(!0),l.canvas},t.prototype.pixels=function(e){var i,n,r,o=this.renderer,a=!1;e&&(e instanceof O.z?r=e:(r=this.renderer.generateTexture(e),a=!0)),r?(i=r.baseTexture.resolution,n=r.frame,o.renderTexture.bind(r)):(i=o.resolution,(n=L).width=o.width,n.height=o.height,o.renderTexture.bind(null));var s=n.width*i,h=n.height*i,u=new Uint8Array(4*s*h),l=o.gl;return l.readPixels(n.x*i,n.y*i,s,h,l.RGBA,l.UNSIGNED_BYTE,u),a&&r.destroy(!0),t.arrayPostDivide(u,u),u},t.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null},t.arrayPostDivide=function(t,e){for(var i=0;i<t.length;i+=4){var n=e[i+3]=t[i+3];0!==n?(e[i]=Math.round(Math.min(255*t[i]/n,255)),e[i+1]=Math.round(Math.min(255*t[i+1]/n,255)),e[i+2]=Math.round(Math.min(255*t[i+2]/n,255))):(e[i]=t[i],e[i+1]=t[i+1],e[i+2]=t[i+2])}},t}(),B=i(182),F=i.n(B),z=i(78),j=i.n(z);function G(){}function U(t,e,i,n){var r=0,o=t.length;!function a(s){s||r===o?i&&i(s):n?setTimeout((function(){e(t[r++],a)}),1):e(t[r++],a)}()}function H(t){return function(){if(null===t)throw new Error("Callback was already called.");var e=t;t=null,e.apply(this,arguments)}}function V(t,e){if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var i=0,n={_tasks:[],concurrency:e,saturated:G,unsaturated:G,buffer:e/4,empty:G,drain:G,error:G,started:!1,paused:!1,push:function(t,e){r(t,!1,e)},kill:function(){i=0,n.drain=G,n.started=!1,n._tasks=[]},unshift:function(t,e){r(t,!0,e)},process:function(){for(;!n.paused&&i<n.concurrency&&n._tasks.length;){var e=n._tasks.shift();0===n._tasks.length&&n.empty(),(i+=1)===n.concurrency&&n.saturated(),t(e.data,H(o(e)))}},length:function(){return n._tasks.length},running:function(){return i},idle:function(){return n._tasks.length+i===0},pause:function(){!0!==n.paused&&(n.paused=!0)},resume:function(){if(!1!==n.paused){n.paused=!1;for(var t=1;t<=n.concurrency;t++)n.process()}}};function r(t,e,i){if(null!=i&&"function"!=typeof i)throw new Error("task callback must be a function");if(n.started=!0,null==t&&n.idle())setTimeout((function(){return n.drain()}),1);else{var r={data:t,callback:"function"==typeof i?i:G};e?n._tasks.unshift(r):n._tasks.push(r),setTimeout((function(){return n.process()}),1)}}function o(t){return function(){i-=1,t.callback.apply(t,arguments),null!=arguments[0]&&n.error(arguments[0],t.data),i<=n.concurrency-n.buffer&&n.unsaturated(),n.idle()&&n.drain(),n.process()}}return n}var W={};function X(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Y(t,e,i){return e&&X(t.prototype,e),i&&X(t,i),t}var q=!(!window.XDomainRequest||"withCredentials"in new XMLHttpRequest),K=null;function J(){}var Z=function(){function t(e,i,n){if("string"!=typeof e||"string"!=typeof i)throw new Error("Both name and url are required for constructing a resource.");n=n||{},this._flags=0,this._setFlag(t.STATUS_FLAGS.DATA_URL,0===i.indexOf("data:")),this.name=e,this.url=i,this.extension=this._getExtension(),this.data=null,this.crossOrigin=!0===n.crossOrigin?"anonymous":n.crossOrigin,this.timeout=n.timeout||0,this.loadType=n.loadType||this._determineLoadType(),this.xhrType=n.xhrType,this.metadata=n.metadata||{},this.error=null,this.xhr=null,this.children=[],this.type=t.TYPE.UNKNOWN,this.progressChunk=0,this._dequeue=J,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundOnTimeout=this._onTimeout.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnTimeout=this._xhrOnTimeout.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this.onStart=new j.a,this.onProgress=new j.a,this.onComplete=new j.a,this.onAfterMiddleware=new j.a}t.setExtensionLoadType=function(e,i){Q(t._loadTypeMap,e,i)},t.setExtensionXhrType=function(e,i){Q(t._xhrTypeMap,e,i)};var e=t.prototype;return e.complete=function(){this._clearEvents(),this._finish()},e.abort=function(e){if(!this.error){if(this.error=new Error(e),this._clearEvents(),this.xhr)this.xhr.abort();else if(this.xdr)this.xdr.abort();else if(this.data)if(this.data.src)this.data.src=t.EMPTY_GIF;else for(;this.data.firstChild;)this.data.removeChild(this.data.firstChild);this._finish()}},e.load=function(e){var i=this;if(!this.isLoading)if(this.isComplete)e&&setTimeout((function(){return e(i)}),1);else switch(e&&this.onComplete.once(e),this._setFlag(t.STATUS_FLAGS.LOADING,!0),this.onStart.dispatch(this),!1!==this.crossOrigin&&"string"==typeof this.crossOrigin||(this.crossOrigin=this._determineCrossOrigin(this.url)),this.loadType){case t.LOAD_TYPE.IMAGE:this.type=t.TYPE.IMAGE,this._loadElement("image");break;case t.LOAD_TYPE.AUDIO:this.type=t.TYPE.AUDIO,this._loadSourceElement("audio");break;case t.LOAD_TYPE.VIDEO:this.type=t.TYPE.VIDEO,this._loadSourceElement("video");break;case t.LOAD_TYPE.XHR:default:q&&this.crossOrigin?this._loadXdr():this._loadXhr()}},e._hasFlag=function(t){return 0!=(this._flags&t)},e._setFlag=function(t,e){this._flags=e?this._flags|t:this._flags&~t},e._clearEvents=function(){clearTimeout(this._elementTimer),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("timeout",this._boundXhrOnTimeout,!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))},e._finish=function(){if(this.isComplete)throw new Error("Complete called again for an already completed resource.");this._setFlag(t.STATUS_FLAGS.COMPLETE,!0),this._setFlag(t.STATUS_FLAGS.LOADING,!1),this.onComplete.dispatch(this)},e._loadElement=function(t){this.metadata.loadElement?this.data=this.metadata.loadElement:"image"===t&&void 0!==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),this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},e._loadSourceElement=function(t){if(this.metadata.loadElement?this.data=this.metadata.loadElement:"audio"===t&&void 0!==window.Audio?this.data=new Audio:this.data=document.createElement(t),null!==this.data){if(this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),!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=this.metadata.mimeType,i=0;i<this.url.length;++i)this.data.appendChild(this._createSource(t,this.url[i],Array.isArray(e)?e[i]:e));else{var n=this.metadata.mimeType;this.data.appendChild(this._createSource(t,this.url,Array.isArray(n)?n[0]:n))}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(),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))}else this.abort("Unsupported element: "+t)},e._loadXhr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var e=this.xhr=new XMLHttpRequest;e.open("GET",this.url,!0),e.timeout=this.timeout,this.xhrType===t.XHR_RESPONSE_TYPE.JSON||this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT?e.responseType=t.XHR_RESPONSE_TYPE.TEXT:e.responseType=this.xhrType,e.addEventListener("error",this._boundXhrOnError,!1),e.addEventListener("timeout",this._boundXhrOnTimeout,!1),e.addEventListener("abort",this._boundXhrOnAbort,!1),e.addEventListener("progress",this._boundOnProgress,!1),e.addEventListener("load",this._boundXhrOnLoad,!1),e.send()},e._loadXdr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var t=this.xhr=new XDomainRequest;t.timeout=this.timeout||5e3,t.onerror=this._boundXhrOnError,t.ontimeout=this._boundXhrOnTimeout,t.onprogress=this._boundOnProgress,t.onload=this._boundXhrOnLoad,t.open("GET",this.url,!0),setTimeout((function(){return t.send()}),1)},e._createSource=function(t,e,i){i||(i=t+"/"+this._getExtension(e));var n=document.createElement("source");return n.src=e,n.type=i,n},e._onError=function(t){this.abort("Failed to load element using: "+t.target.nodeName)},e._onProgress=function(t){t&&t.lengthComputable&&this.onProgress.dispatch(this,t.loaded/t.total)},e._onTimeout=function(){this.abort("Load timed out.")},e._xhrOnError=function(){var t=this.xhr;this.abort($(t)+" Request failed. Status: "+t.status+', text: "'+t.statusText+'"')},e._xhrOnTimeout=function(){var t=this.xhr;this.abort($(t)+" Request timed out.")},e._xhrOnAbort=function(){var t=this.xhr;this.abort($(t)+" Request was aborted by the user.")},e._xhrOnLoad=function(){var e=this.xhr,i="",n=void 0===e.status?200:e.status;if(""!==e.responseType&&"text"!==e.responseType&&void 0!==e.responseType||(i=e.responseText),0===n&&(i.length>0||e.responseType===t.XHR_RESPONSE_TYPE.BUFFER)?n=200:1223===n&&(n=204),2===(n/100|0)){if(this.xhrType===t.XHR_RESPONSE_TYPE.TEXT)this.data=i,this.type=t.TYPE.TEXT;else if(this.xhrType===t.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(i),this.type=t.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===t.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var r=new DOMParser;this.data=r.parseFromString(i,"text/xml")}else{var o=document.createElement("div");o.innerHTML=i,this.data=o}this.type=t.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=e.response||i;this.complete()}else this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL)},e._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,K||(K=document.createElement("a")),K.href=t;var i=!(t=F()(K.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,n=t.protocol?t.protocol+":":"";return t.host===e.hostname&&i&&n===e.protocol?"":"anonymous"},e._determineXhrType=function(){return t._xhrTypeMap[this.extension]||t.XHR_RESPONSE_TYPE.TEXT},e._determineLoadType=function(){return t._loadTypeMap[this.extension]||t.LOAD_TYPE.XHR},e._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var i=t.indexOf("/");e=t.substring(i+1,t.indexOf(";",i))}else{var n=t.indexOf("?"),r=t.indexOf("#"),o=Math.min(n>-1?n:t.length,r>-1?r:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},e._getMimeFromXhrType=function(e){switch(e){case t.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case t.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case t.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case t.XHR_RESPONSE_TYPE.JSON:return"application/json";case t.XHR_RESPONSE_TYPE.DEFAULT:case t.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},Y(t,[{key:"isDataUrl",get:function(){return this._hasFlag(t.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(t.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(t.STATUS_FLAGS.LOADING)}}]),t}();function Q(t,e,i){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=i)}function $(t){return t.toString().replace("object ","")}Z.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},Z.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},Z.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},Z.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},Z._loadTypeMap={gif:Z.LOAD_TYPE.IMAGE,png:Z.LOAD_TYPE.IMAGE,bmp:Z.LOAD_TYPE.IMAGE,jpg:Z.LOAD_TYPE.IMAGE,jpeg:Z.LOAD_TYPE.IMAGE,tif:Z.LOAD_TYPE.IMAGE,tiff:Z.LOAD_TYPE.IMAGE,webp:Z.LOAD_TYPE.IMAGE,tga:Z.LOAD_TYPE.IMAGE,svg:Z.LOAD_TYPE.IMAGE,"svg+xml":Z.LOAD_TYPE.IMAGE,mp3:Z.LOAD_TYPE.AUDIO,ogg:Z.LOAD_TYPE.AUDIO,wav:Z.LOAD_TYPE.AUDIO,mp4:Z.LOAD_TYPE.VIDEO,webm:Z.LOAD_TYPE.VIDEO},Z._xhrTypeMap={xhtml:Z.XHR_RESPONSE_TYPE.DOCUMENT,html:Z.XHR_RESPONSE_TYPE.DOCUMENT,htm:Z.XHR_RESPONSE_TYPE.DOCUMENT,xml:Z.XHR_RESPONSE_TYPE.DOCUMENT,tmx:Z.XHR_RESPONSE_TYPE.DOCUMENT,svg:Z.XHR_RESPONSE_TYPE.DOCUMENT,tsx:Z.XHR_RESPONSE_TYPE.DOCUMENT,gif:Z.XHR_RESPONSE_TYPE.BLOB,png:Z.XHR_RESPONSE_TYPE.BLOB,bmp:Z.XHR_RESPONSE_TYPE.BLOB,jpg:Z.XHR_RESPONSE_TYPE.BLOB,jpeg:Z.XHR_RESPONSE_TYPE.BLOB,tif:Z.XHR_RESPONSE_TYPE.BLOB,tiff:Z.XHR_RESPONSE_TYPE.BLOB,webp:Z.XHR_RESPONSE_TYPE.BLOB,tga:Z.XHR_RESPONSE_TYPE.BLOB,json:Z.XHR_RESPONSE_TYPE.JSON,text:Z.XHR_RESPONSE_TYPE.TEXT,txt:Z.XHR_RESPONSE_TYPE.TEXT,ttf:Z.XHR_RESPONSE_TYPE.BUFFER,otf:Z.XHR_RESPONSE_TYPE.BUFFER},Z.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";var tt=window.URL||window.webkitURL;var et={caching:function(t,e){var i=this;W[t.url]?(t.data=W[t.url],t.complete()):t.onComplete.once((function(){return W[i.url]=i.data})),e()},parsing:function(t,e){if(t.data){if(t.xhr&&t.xhrType===Z.XHR_RESPONSE_TYPE.BLOB)if(window.Blob&&"string"!=typeof t.data){if(0===t.data.type.indexOf("image")){var i=tt.createObjectURL(t.data);return t.blob=t.data,t.data=new Image,t.data.src=i,t.type=Z.TYPE.IMAGE,void(t.data.onload=function(){tt.revokeObjectURL(i),t.data.onload=null,e()})}}else{var n=t.xhr.getResponseHeader("content-type");if(n&&0===n.indexOf("image"))return t.data=new Image,t.data.src="data:"+n+";base64,"+function(t){for(var e="",i=0;i<t.length;){for(var n=[0,0,0],r=[0,0,0,0],o=0;o<n.length;++o)i<t.length?n[o]=255&t.charCodeAt(i++):n[o]=0;switch(r[0]=n[0]>>2,r[1]=(3&n[0])<<4|n[1]>>4,r[2]=(15&n[1])<<2|n[2]>>6,r[3]=63&n[2],i-(t.length-1)){case 2:r[3]=64,r[2]=64;break;case 1:r[3]=64}for(var a=0;a<r.length;++a)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(r[a])}return e}(t.xhr.responseText),t.type=Z.TYPE.IMAGE,void(t.data.onload=function(){t.data.onload=null,e()})}e()}else e()}},it=/(#[\w-]+)?$/,nt=function(){function t(e,i){var n=this;void 0===e&&(e=""),void 0===i&&(i=10),this.baseUrl=e,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,e){return n._loadResource(t,e)},this._queue=V(this._boundLoadResource,i),this._queue.pause(),this.resources={},this.onProgress=new j.a,this.onError=new j.a,this.onLoad=new j.a,this.onStart=new j.a,this.onComplete=new j.a;for(var r=0;r<t._defaultBeforeMiddleware.length;++r)this.pre(t._defaultBeforeMiddleware[r]);for(var o=0;o<t._defaultAfterMiddleware.length;++o)this.use(t._defaultAfterMiddleware[o])}var e=t.prototype;return e.add=function(t,e,i,n){if(Array.isArray(t)){for(var r=0;r<t.length;++r)this.add(t[r]);return this}if("object"==typeof t&&(n=e||t.callback||t.onComplete,i=t,e=t.url,t=t.name||t.key||t.url),"string"!=typeof e&&(n=i,i=e,e=t),"string"!=typeof e)throw new Error("No url passed to add resource to loader.");if("function"==typeof i&&(n=i,i=null),this.loading&&(!i||!i.parentResource))throw new Error("Cannot add resources while the loader is running.");if(this.resources[t])throw new Error('Resource named "'+t+'" already exists.');if(e=this._prepareUrl(e),this.resources[t]=new Z(t,e,i),"function"==typeof n&&this.resources[t].onAfterMiddleware.once(n),this.loading){for(var o=i.parentResource,a=[],s=0;s<o.children.length;++s)o.children[s].isComplete||a.push(o.children[s]);var h=o.progressChunk*(a.length+1)/(a.length+2);o.children.push(this.resources[t]),o.progressChunk=h;for(var u=0;u<a.length;++u)a[u].progressChunk=h;this.resources[t].progressChunk=h}return this._queue.push(this.resources[t]),this},e.pre=function(t){return this._beforeMiddleware.push(t),this},e.use=function(t){return this._afterMiddleware.push(t),this},e.reset=function(){for(var t in this.progress=0,this.loading=!1,this._queue.kill(),this._queue.pause(),this.resources){var e=this.resources[t];e._onLoadBinding&&e._onLoadBinding.detach(),e.isLoading&&e.abort()}return this.resources={},this},e.load=function(t){if("function"==typeof t&&this.onComplete.once(t),this.loading)return this;if(this._queue.idle())this._onStart(),this._onComplete();else{for(var e=100/this._queue._tasks.length,i=0;i<this._queue._tasks.length;++i)this._queue._tasks[i].data.progressChunk=e;this._onStart(),this._queue.resume()}return this},e._prepareUrl=function(t){var e,i=F()(t,{strictMode:!0});if(e=i.protocol||!i.path||0===t.indexOf("//")?t:this.baseUrl.length&&this.baseUrl.lastIndexOf("/")!==this.baseUrl.length-1&&"/"!==t.charAt(0)?this.baseUrl+"/"+t:this.baseUrl+t,this.defaultQueryString){var n=it.exec(e)[0];-1!==(e=e.substr(0,e.length-n.length)).indexOf("?")?e+="&"+this.defaultQueryString:e+="?"+this.defaultQueryString,e+=n}return e},e._loadResource=function(t,e){var i=this;t._dequeue=e,U(this._beforeMiddleware,(function(e,n){e.call(i,t,(function(){n(t.isComplete?{}:null)}))}),(function(){t.isComplete?i._onLoad(t):(t._onLoadBinding=t.onComplete.once(i._onLoad,i),t.load())}),!0)},e._onStart=function(){this.progress=0,this.loading=!0,this.onStart.dispatch(this)},e._onComplete=function(){this.progress=100,this.loading=!1,this.onComplete.dispatch(this,this.resources)},e._onLoad=function(t){var e=this;t._onLoadBinding=null,this._resourcesParsing.push(t),t._dequeue(),U(this._afterMiddleware,(function(i,n){i.call(e,t,n)}),(function(){t.onAfterMiddleware.dispatch(t),e.progress=Math.min(100,e.progress+t.progressChunk),e.onProgress.dispatch(e,t),t.error?e.onError.dispatch(t.error,e,t):e.onLoad.dispatch(e,t),e._resourcesParsing.splice(e._resourcesParsing.indexOf(t),1),e._queue.idle()&&0===e._resourcesParsing.length&&e._onComplete()}),!0)},Y(t,[{key:"concurrency",get:function(){return this._queue.concurrency},set:function(t){this._queue.concurrency=t}}]),t}();nt._defaultBeforeMiddleware=[],nt._defaultAfterMiddleware=[],nt.pre=function(t){return nt._defaultBeforeMiddleware.push(t),nt},nt.use=function(t){return nt._defaultAfterMiddleware.push(t),nt};var rt=Z,ot=function(t,e){return(ot=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)};var at=function(){function t(){}return t.use=function(t,e){t.data&&t.type===Z.TYPE.IMAGE&&(t.texture=O.G.fromLoader(t.data,t.url,t.name)),e()},t}(),st=function(t){function e(i,n){for(var r=t.call(this,i,n)||this,o=0;o<e._plugins.length;++o){var a=e._plugins[o],s=a.pre,h=a.use;s&&r.pre(s),h&&r.use(h)}return r._protected=!1,r}return function(t,e){function i(){this.constructor=t}ot(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e.prototype.destroy=function(){this._protected||this.reset()},Object.defineProperty(e,"shared",{get:function(){var t=e._shared;return t||((t=new e)._protected=!0,e._shared=t),t},enumerable:!1,configurable:!0}),e.registerPlugin=function(t){return e._plugins.push(t),t.add&&t.add(),e},e._plugins=[],e}(nt);st.registerPlugin({use:et.parsing}),st.registerPlugin(at);var ht=function(){function t(){}return t.init=function(t){t=Object.assign({sharedLoader:!1},t),this.loader=t.sharedLoader?st.shared:new st},t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t}(),ut=i(5),lt=function(t,e){return(lt=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 ct(t,e){function i(){this.constructor=t}lt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var dt,pt,ft=function(t){function e(e,i,n,r){void 0===e&&(e=1500),void 0===n&&(n=16384),void 0===r&&(r=!1);var o=t.call(this)||this;return n>16384&&(n=16384),o._properties=[!1,!0,!1,!1,!1],o._maxSize=e,o._batchSize=n,o._buffers=null,o._bufferUpdateIDs=[],o._updateID=0,o.interactiveChildren=!1,o.blendMode=ut.b.NORMAL,o.autoResize=r,o.roundPixels=!0,o.baseTexture=null,o.setProperties(i),o._tint=0,o.tintRgb=new Float32Array(4),o.tint=16777215,o}return ct(e,t),e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!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]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,Object(c.hex2rgb)(t,this.tintRgb)},enumerable:!1,configurable:!0}),e.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",(function(){return e.onChildrenChange(0)}))),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.length<e;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[e]=++this._updateID},e.prototype.dispose=function(){if(this._buffers){for(var t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._buffers=null}},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null},e}(_),mt=function(){function t(t,e,i){this.geometry=new O.s,this.indexBuffer=null,this.size=i,this.dynamicProperties=[],this.staticProperties=[];for(var n=0;n<t.length;++n){var r=t[n];r={attributeName:r.attributeName,size:r.size,uploadFunction:r.uploadFunction,type:r.type||ut.p.FLOAT,offset:r.offset},e[n]?this.dynamicProperties.push(r):this.staticProperties.push(r)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()}return t.prototype.initBuffers=function(){var t=this.geometry,e=0;this.indexBuffer=new O.l(Object(c.createIndicesForQuads)(this.size),!0,!0),t.addIndex(this.indexBuffer),this.dynamicStride=0;for(var i=0;i<this.dynamicProperties.length;++i){(a=this.dynamicProperties[i]).offset=e,e+=a.size,this.dynamicStride+=a.size}var n=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(n),this.dynamicDataUint32=new Uint32Array(n),this.dynamicBuffer=new O.l(this.dynamicData,!1,!1);var r=0;this.staticStride=0;for(i=0;i<this.staticProperties.length;++i){(a=this.staticProperties[i]).offset=r,r+=a.size,this.staticStride+=a.size}var o=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(o),this.staticDataUint32=new Uint32Array(o),this.staticBuffer=new O.l(this.staticData,!0,!1);for(i=0;i<this.dynamicProperties.length;++i){var a=this.dynamicProperties[i];t.addAttribute(a.attributeName,this.dynamicBuffer,0,a.type===ut.p.UNSIGNED_BYTE,a.type,4*this.dynamicStride,4*a.offset)}for(i=0;i<this.staticProperties.length;++i){a=this.staticProperties[i];t.addAttribute(a.attributeName,this.staticBuffer,0,a.type===ut.p.UNSIGNED_BYTE,a.type,4*this.staticStride,4*a.offset)}},t.prototype.uploadDynamic=function(t,e,i){for(var n=0;n<this.dynamicProperties.length;n++){var r=this.dynamicProperties[n];r.uploadFunction(t,e,i,r.type===ut.p.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,r.offset)}this.dynamicBuffer._updateID++},t.prototype.uploadStatic=function(t,e,i){for(var n=0;n<this.staticProperties.length;n++){var r=this.staticProperties[n];r.uploadFunction(t,e,i,r.type===ut.p.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,r.offset)}this.staticBuffer._updateID++},t.prototype.destroy=function(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()},t}(),gt=function(t){function e(e){var i=t.call(this,e)||this;return i.shader=null,i.properties=null,i.tempMatrix=new p.d,i.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:i.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:i.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:i.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:i.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:ut.p.UNSIGNED_BYTE,uploadFunction:i.uploadTint,offset:0}],i.shader=O.C.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nattribute vec2 aPositionCoord;\nattribute float aRotation;\n\nuniform mat3 translationMatrix;\nuniform vec4 uColor;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void){\n float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\n float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);\n\n vec2 v = vec2(x, y);\n v = v + aPositionCoord;\n\n gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vColor = aColor * uColor;\n}\n","varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 color = texture2D(uSampler, vTextureCoord) * vColor;\n gl_FragColor = color;\n}",{}),i.state=O.E.for2d(),i}return ct(e,t),e.prototype.render=function(t){var e=t.children,i=t._maxSize,n=t._batchSize,r=this.renderer,o=e.length;if(0!==o){o>i&&!t.autoResize&&(o=i);var a=t._buffers;a||(a=t._buffers=this.generateBuffers(t));var s=e[0]._texture.baseTexture;this.state.blendMode=Object(c.correctBlendMode)(t.blendMode,s.alphaMode),r.state.set(this.state);var h=r.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(r.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=Object(c.premultiplyRgba)(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,s.alphaMode),this.shader.uniforms.uSampler=s,this.renderer.shader.bind(this.shader);for(var l=!1,d=0,p=0;d<o;d+=n,p+=1){var f=o-d;f>n&&(f=n),p>=a.length&&a.push(this._generateOneMoreBuffer(t));var m=a[p];m.uploadDynamic(e,d,f);var g=t._bufferUpdateIDs[p]||0;(l=l||m._updateID<g)&&(m._updateID=t._updateID,m.uploadStatic(e,d,f)),r.geometry.bind(m.geometry),h.drawElements(h.TRIANGLES,6*f,h.UNSIGNED_SHORT,0)}}},e.prototype.generateBuffers=function(t){for(var e=[],i=t._maxSize,n=t._batchSize,r=t._properties,o=0;o<i;o+=n)e.push(new mt(this.properties,r,n));return e},e.prototype._generateOneMoreBuffer=function(t){var e=t._batchSize,i=t._properties;return new mt(this.properties,i,e)},e.prototype.uploadVertices=function(t,e,i,n,r,o){for(var a=0,s=0,h=0,u=0,l=0;l<i;++l){var c=t[e+l],d=c._texture,p=c.scale.x,f=c.scale.y,m=d.trim,g=d.orig;m?(a=(s=m.x-c.anchor.x*g.width)+m.width,h=(u=m.y-c.anchor.y*g.height)+m.height):(a=g.width*(1-c.anchor.x),s=g.width*-c.anchor.x,h=g.height*(1-c.anchor.y),u=g.height*-c.anchor.y),n[o]=s*p,n[o+1]=u*f,n[o+r]=a*p,n[o+r+1]=u*f,n[o+2*r]=a*p,n[o+2*r+1]=h*f,n[o+3*r]=s*p,n[o+3*r+1]=h*f,o+=4*r}},e.prototype.uploadPosition=function(t,e,i,n,r,o){for(var a=0;a<i;a++){var s=t[e+a].position;n[o]=s.x,n[o+1]=s.y,n[o+r]=s.x,n[o+r+1]=s.y,n[o+2*r]=s.x,n[o+2*r+1]=s.y,n[o+3*r]=s.x,n[o+3*r+1]=s.y,o+=4*r}},e.prototype.uploadRotation=function(t,e,i,n,r,o){for(var a=0;a<i;a++){var s=t[e+a].rotation;n[o]=s,n[o+r]=s,n[o+2*r]=s,n[o+3*r]=s,o+=4*r}},e.prototype.uploadUvs=function(t,e,i,n,r,o){for(var a=0;a<i;++a){var s=t[e+a]._texture._uvs;s?(n[o]=s.x0,n[o+1]=s.y0,n[o+r]=s.x1,n[o+r+1]=s.y1,n[o+2*r]=s.x2,n[o+2*r+1]=s.y2,n[o+3*r]=s.x3,n[o+3*r+1]=s.y3,o+=4*r):(n[o]=0,n[o+1]=0,n[o+r]=0,n[o+r+1]=0,n[o+2*r]=0,n[o+2*r+1]=0,n[o+3*r]=0,n[o+3*r+1]=0,o+=4*r)}},e.prototype.uploadTint=function(t,e,i,n,r,o){for(var a=0;a<i;++a){var s=t[e+a],h=s._texture.baseTexture.alphaMode>0,u=s.alpha,l=u<1&&h?Object(c.premultiplyTint)(s._tintRGB,u):s._tintRGB+(255*u<<24);n[o]=l,n[o+r]=l,n[o+2*r]=l,n[o+3*r]=l,o+=4*r}},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},e}(O.v);!function(t){t.MITER="miter",t.BEVEL="bevel",t.ROUND="round"}(dt||(dt={})),function(t){t.BUTT="butt",t.ROUND="round",t.SQUARE="square"}(pt||(pt={}));var yt={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(t,e){if(void 0===e&&(e=20),!this.adaptive||!t||isNaN(t))return e;var i=Math.ceil(t/this.maxLength);return i<this.minSegments?i=this.minSegments:i>this.maxSegments&&(i=this.maxSegments),i}},vt=function(){function t(){this.color=16777215,this.alpha=1,this.texture=O.G.WHITE,this.matrix=null,this.visible=!1,this.reset()}return t.prototype.clone=function(){var e=new t;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e},t.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=O.G.WHITE,this.matrix=null,this.visible=!1},t.prototype.destroy=function(){this.texture=null,this.matrix=null},t}(),bt=function(t,e){return(bt=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 _t(t,e){function i(){this.constructor=t}bt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var wt={build:function(t){t.points=t.shape.points.slice()},triangulate:function(t,e){var i=t.points,n=t.holes,r=e.points,o=e.indices;if(i.length>=6){for(var a=[],s=0;s<n.length;s++){var h=n[s];a.push(i.length/2),i=i.concat(h.points)}var u=Object(c.earcut)(i,a,2);if(!u)return;var l=r.length/2;for(s=0;s<u.length;s+=3)o.push(u[s]+l),o.push(u[s+1]+l),o.push(u[s+2]+l);for(s=0;s<i.length;s++)r.push(i[s])}}},xt={build:function(t){var e,i,n=t.shape,r=t.points,o=n.x,a=n.y;if(r.length=0,t.type===p.l.CIRC)e=n.radius,i=n.radius;else{var s=t.shape;e=s.width,i=s.height}if(0!==e&&0!==i){var h=Math.floor(30*Math.sqrt(n.radius))||Math.floor(15*Math.sqrt(e+i));h/=2.3;for(var u=2*Math.PI/h,l=0;l<h-.5;l++)r.push(o+Math.sin(-u*l)*e,a+Math.cos(-u*l)*i);r.push(r[0],r[1])}},triangulate:function(t,e){var i=t.points,n=e.points,r=e.indices,o=n.length/2,a=o,s=t.shape,h=t.matrix,u=s.x,l=s.y;n.push(t.matrix?h.a*u+h.c*l+h.tx:u,t.matrix?h.b*u+h.d*l+h.ty:l);for(var c=0;c<i.length;c+=2)n.push(i[c],i[c+1]),r.push(o++,a,o)}},Ct={build:function(t){var e=t.shape,i=e.x,n=e.y,r=e.width,o=e.height,a=t.points;a.length=0,a.push(i,n,i+r,n,i+r,n+o,i,n+o)},triangulate:function(t,e){var i=t.points,n=e.points,r=n.length/2;n.push(i[0],i[1],i[2],i[3],i[6],i[7],i[4],i[5]),e.indices.push(r,r+1,r+2,r+1,r+2,r+3)}};function St(t,e,i){return t+(e-t)*i}function Tt(t,e,i,n,r,o,a){void 0===a&&(a=[]);for(var s=a,h=0,u=0,l=0,c=0,d=0,p=0,f=0,m=0;f<=20;++f)h=St(t,i,m=f/20),u=St(e,n,m),l=St(i,r,m),c=St(n,o,m),d=St(h,l,m),p=St(u,c,m),s.push(d,p);return s}var At={build:function(t){var e=t.shape,i=t.points,n=e.x,r=e.y,o=e.width,a=e.height,s=Math.max(0,Math.min(e.radius,Math.min(o,a)/2));i.length=0,s?(Tt(n,r+s,n,r,n+s,r,i),Tt(n+o-s,r,n+o,r,n+o,r+s,i),Tt(n+o,r+a-s,n+o,r+a,n+o-s,r+a,i),Tt(n+s,r+a,n,r+a,n,r+a-s,i)):i.push(n,r,n+o,r,n+o,r+a,n,r+a)},triangulate:function(t,e){for(var i=t.points,n=e.points,r=e.indices,o=n.length/2,a=Object(c.earcut)(i,null,2),s=0,h=a.length;s<h;s+=3)r.push(a[s]+o),r.push(a[s+1]+o),r.push(a[s+2]+o);for(s=0,h=i.length;s<h;s++)n.push(i[s],i[++s])}};function Et(t,e,i,n,r,o,a,s){var h,u;a?(h=n,u=-i):(h=-n,u=i);var l=t-i*r+h,c=e-n*r+u,d=t+i*o+h,p=e+n*o+u;return s.push(l,c),s.push(d,p),2}function Pt(t,e,i,n,r,o,a,s){var h=i-t,u=n-e,l=Math.atan2(h,u),c=Math.atan2(r-t,o-e);s&&l<c?l+=2*Math.PI:!s&&l>c&&(c+=2*Math.PI);var d=l,p=c-l,f=Math.abs(p),m=Math.sqrt(h*h+u*u),g=1+(15*f*Math.sqrt(m)/Math.PI>>0),y=p/g;if(d+=y,s){a.push(t,e),a.push(i,n);for(var v=1,b=d;v<g;v++,b+=y)a.push(t,e),a.push(t+Math.sin(b)*m,e+Math.cos(b)*m);a.push(t,e),a.push(r,o)}else{a.push(i,n),a.push(t,e);for(v=1,b=d;v<g;v++,b+=y)a.push(t+Math.sin(b)*m,e+Math.cos(b)*m),a.push(t,e);a.push(r,o),a.push(t,e)}return 2*g}function Mt(t,e){t.lineStyle.native?function(t,e){var i=0,n=t.shape,r=t.points||n.points,o=n.type!==p.l.POLY||n.closeStroke;if(0!==r.length){var a=e.points,s=e.indices,h=r.length/2,u=a.length/2,l=u;for(a.push(r[0],r[1]),i=1;i<h;i++)a.push(r[2*i],r[2*i+1]),s.push(l,l+1),l++;o&&s.push(l,u)}}(t,e):function(t,e){var i=t.shape,n=t.points||i.points.slice(),r=e.closePointEps;if(0!==n.length){var o=t.lineStyle,a=new p.g(n[0],n[1]),s=new p.g(n[n.length-2],n[n.length-1]),h=i.type!==p.l.POLY||i.closeStroke,u=Math.abs(a.x-s.x)<r&&Math.abs(a.y-s.y)<r;if(h){n=n.slice(),u&&(n.pop(),n.pop(),s.set(n[n.length-2],n[n.length-1]));var l=.5*(a.x+s.x),c=.5*(s.y+a.y);n.unshift(l,c),n.push(l,c)}var d=e.points,f=n.length/2,m=n.length,g=d.length/2,y=o.width/2,v=y*y,b=o.miterLimit*o.miterLimit,_=n[0],w=n[1],x=n[2],C=n[3],S=0,T=0,A=-(w-C),E=_-x,P=0,M=0,I=Math.sqrt(A*A+E*E);A/=I,E/=I,A*=y,E*=y;var k=o.alignment,O=2*(1-k),R=2*k;h||(o.cap===pt.ROUND?m+=Pt(_-A*(O-R)*.5,w-E*(O-R)*.5,_-A*O,w-E*O,_+A*R,w+E*R,d,!0)+2:o.cap===pt.SQUARE&&(m+=Et(_,w,A,E,O,R,!0,d))),d.push(_-A*O,w-E*O),d.push(_+A*R,w+E*R);for(var D=1;D<f-1;++D){_=n[2*(D-1)],w=n[2*(D-1)+1],x=n[2*D],C=n[2*D+1],S=n[2*(D+1)],T=n[2*(D+1)+1],A=-(w-C),E=_-x,A/=I=Math.sqrt(A*A+E*E),E/=I,A*=y,E*=y,P=-(C-T),M=x-S,P/=I=Math.sqrt(P*P+M*M),M/=I,P*=y,M*=y;var L=x-_,N=w-C,B=x-S,F=T-C,z=N*B-F*L,j=z<0;if(Math.abs(z)<.1)d.push(x-A*O,C-E*O),d.push(x+A*R,C+E*R);else{var G=(-A+_)*(-E+C)-(-A+x)*(-E+w),U=(-P+S)*(-M+C)-(-P+x)*(-M+T),H=(L*U-B*G)/z,V=(F*G-N*U)/z,W=(H-x)*(H-x)+(V-C)*(V-C),X=x+(H-x)*O,Y=C+(V-C)*O,q=x-(H-x)*R,K=C-(V-C)*R,J=j?O:R;W<=Math.min(L*L+N*N,B*B+F*F)+J*J*v?o.join===dt.BEVEL||W/v>b?(j?(d.push(X,Y),d.push(x+A*R,C+E*R),d.push(X,Y),d.push(x+P*R,C+M*R)):(d.push(x-A*O,C-E*O),d.push(q,K),d.push(x-P*O,C-M*O),d.push(q,K)),m+=2):o.join===dt.ROUND?j?(d.push(X,Y),d.push(x+A*R,C+E*R),m+=Pt(x,C,x+A*R,C+E*R,x+P*R,C+M*R,d,!0)+4,d.push(X,Y),d.push(x+P*R,C+M*R)):(d.push(x-A*O,C-E*O),d.push(q,K),m+=Pt(x,C,x-A*O,C-E*O,x-P*O,C-M*O,d,!1)+4,d.push(x-P*O,C-M*O),d.push(q,K)):(d.push(X,Y),d.push(q,K)):(d.push(x-A*O,C-E*O),d.push(x+A*R,C+E*R),o.join===dt.BEVEL||W/v>b||(o.join===dt.ROUND?m+=j?Pt(x,C,x+A*R,C+E*R,x+P*R,C+M*R,d,!0)+2:Pt(x,C,x-A*O,C-E*O,x-P*O,C-M*O,d,!1)+2:(j?(d.push(q,K),d.push(q,K)):(d.push(X,Y),d.push(X,Y)),m+=2)),d.push(x-P*O,C-M*O),d.push(x+P*R,C+M*R),m+=2)}}_=n[2*(f-2)],w=n[2*(f-2)+1],x=n[2*(f-1)],A=-(w-(C=n[2*(f-1)+1])),E=_-x,A/=I=Math.sqrt(A*A+E*E),E/=I,A*=y,E*=y,d.push(x-A*O,C-E*O),d.push(x+A*R,C+E*R),h||(o.cap===pt.ROUND?m+=Pt(x-A*(O-R)*.5,C-E*(O-R)*.5,x-A*O,C-E*O,x+A*R,C+E*R,d,!1)+2:o.cap===pt.SQUARE&&(m+=Et(x,C,A,E,O,R,!1,d)));var Z=e.indices,Q=yt.epsilon*yt.epsilon;for(D=g;D<m+g-2;++D)_=d[2*D],w=d[2*D+1],x=d[2*(D+1)],C=d[2*(D+1)+1],S=d[2*(D+2)],T=d[2*(D+2)+1],Math.abs(_*(C-T)+x*(T-w)+S*(w-C))<Q||Z.push(D,D+1,D+2)}}(t,e)}var It,kt=function(t){function e(e,i,n,r,o,a){void 0===a&&(a=0);o=o||r/2;for(var s=-1*Math.PI/2+a,h=2*n,u=p.f/h,l=[],c=0;c<h;c++){var d=c%2?o:r,f=c*u+s;l.push(e+d*Math.cos(f),i+d*Math.sin(f))}return t.call(this,l)||this}return _t(e,t),e}(p.h),Ot=function(){function t(){}return t.curveTo=function(t,e,i,n,r,o){var a=o[o.length-2],s=o[o.length-1]-e,h=a-t,u=n-e,l=i-t,c=Math.abs(s*l-h*u);if(c<1e-8||0===r)return o[o.length-2]===t&&o[o.length-1]===e||o.push(t,e),null;var d=s*s+h*h,p=u*u+l*l,f=s*u+h*l,m=r*Math.sqrt(d)/c,g=r*Math.sqrt(p)/c,y=m*f/d,v=g*f/p,b=m*l+g*h,_=m*u+g*s,w=h*(g+y),x=s*(g+y),C=l*(m+v),S=u*(m+v);return{cx:b+t,cy:_+e,radius:r,startAngle:Math.atan2(x-_,w-b),endAngle:Math.atan2(S-_,C-b),anticlockwise:h*u>l*s}},t.arc=function(t,e,i,n,r,o,a,s,h){for(var u=a-o,l=yt._segmentsCount(Math.abs(u)*r,40*Math.ceil(Math.abs(u)/p.f)),c=u/(2*l),d=2*c,f=Math.cos(c),m=Math.sin(c),g=l-1,y=g%1/g,v=0;v<=g;++v){var b=c+o+d*(v+y*v),_=Math.cos(b),w=-Math.sin(b);h.push((f*_+m*w)*r+i,(f*-w+m*_)*r+n)}},t}(),Rt=function(){function t(){}return t.curveLength=function(t,e,i,n,r,o,a,s){for(var h=0,u=0,l=0,c=0,d=0,p=0,f=0,m=0,g=0,y=0,v=0,b=t,_=e,w=1;w<=10;++w)y=b-(m=(f=(p=(d=1-(u=w/10))*d)*d)*t+3*p*u*i+3*d*(l=u*u)*r+(c=l*u)*a),v=_-(g=f*e+3*p*u*n+3*d*l*o+c*s),b=m,_=g,h+=Math.sqrt(y*y+v*v);return h},t.curveTo=function(e,i,n,r,o,a,s){var h=s[s.length-2],u=s[s.length-1];s.length-=2;var l=yt._segmentsCount(t.curveLength(h,u,e,i,n,r,o,a)),c=0,d=0,p=0,f=0,m=0;s.push(h,u);for(var g=1,y=0;g<=l;++g)p=(d=(c=1-(y=g/l))*c)*c,m=(f=y*y)*y,s.push(p*h+3*d*y*e+3*c*f*n+m*o,p*u+3*d*y*i+3*c*f*r+m*a)},t}(),Dt=function(){function t(){}return t.curveLength=function(t,e,i,n,r,o){var a=t-2*i+r,s=e-2*n+o,h=2*i-2*t,u=2*n-2*e,l=4*(a*a+s*s),c=4*(a*h+s*u),d=h*h+u*u,p=2*Math.sqrt(l+c+d),f=Math.sqrt(l),m=2*l*f,g=2*Math.sqrt(d),y=c/f;return(m*p+f*c*(p-g)+(4*d*l-c*c)*Math.log((2*f+y+p)/(y+g)))/(4*m)},t.curveTo=function(e,i,n,r,o){for(var a=o[o.length-2],s=o[o.length-1],h=yt._segmentsCount(t.curveLength(a,s,e,i,n,r)),u=0,l=0,c=1;c<=h;++c){var d=c/h;u=a+(e-a)*d,l=s+(i-s)*d,o.push(u+(e+(n-e)*d-u)*d,l+(i+(r-i)*d-l)*d)}},t}(),Lt=function(){function t(){this.reset()}return t.prototype.begin=function(t,e,i){this.reset(),this.style=t,this.start=e,this.attribStart=i},t.prototype.end=function(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start},t.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},t}(),Nt=((It={})[p.l.POLY]=wt,It[p.l.CIRC]=xt,It[p.l.ELIP]=xt,It[p.l.RECT]=Ct,It[p.l.RREC]=At,It),Bt=[],Ft=[],zt={buildPoly:wt,buildCircle:xt,buildRectangle:Ct,buildRoundedRectangle:At,FILL_COMMANDS:Nt,BATCH_POOL:Bt,DRAW_CALL_POOL:Ft,buildLine:Mt,Star:kt,ArcUtils:Ot,BezierUtils:Rt,QuadraticUtils:Dt,BatchPart:Lt},jt=function(){function t(t,e,i,n){void 0===e&&(e=null),void 0===i&&(i=null),void 0===n&&(n=null),this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=n,this.type=t.type,this.points=[],this.holes=[]}return t.prototype.clone=function(){return new t(this.shape,this.fillStyle,this.lineStyle,this.matrix)},t.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},t}(),Gt=new p.g,Ut=new f,Ht=function(t){function e(){var e=t.call(this)||this;return e.uvsFloat32=null,e.indicesUint16=null,e.points=[],e.colors=[],e.uvs=[],e.indices=[],e.textureIds=[],e.graphicsData=[],e.dirty=0,e.batchDirty=-1,e.cacheDirty=-1,e.clearDirty=0,e.drawCalls=[],e.batches=[],e.shapeIndex=0,e._bounds=new f,e.boundsDirty=-1,e.boundsPadding=0,e.batchable=!1,e.indicesUint16=null,e.uvsFloat32=null,e.closePointEps=1e-4,e}return _t(e,t),Object.defineProperty(e.prototype,"bounds",{get:function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),e.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),Ft.push(this.drawCalls[t]);this.drawCalls.length=0;for(t=0;t<this.batches.length;t++){var e=this.batches[t];e.reset(),Bt.push(e)}this.batches.length=0},e.prototype.clear=function(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},e.prototype.drawShape=function(t,e,i,n){void 0===e&&(e=null),void 0===i&&(i=null),void 0===n&&(n=null);var r=new jt(t,e,i,n);return this.graphicsData.push(r),this.dirty++,this},e.prototype.drawHole=function(t,e){if(void 0===e&&(e=null),!this.graphicsData.length)return null;var i=new jt(t,null,null,e),n=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=n.lineStyle,n.holes.push(i),this.dirty++,this},e.prototype.destroy=function(){t.prototype.destroy.call(this);for(var e=0;e<this.graphicsData.length;++e)this.graphicsData[e].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null},e.prototype.containsPoint=function(t){for(var e=this.graphicsData,i=0;i<e.length;++i){var n=e[i];if(n.fillStyle.visible&&(n.shape&&(n.matrix?n.matrix.applyInverse(t,Gt):Gt.copyFrom(t),n.shape.contains(Gt.x,Gt.y)))){var r=!1;if(n.holes)for(var o=0;o<n.holes.length;o++){if(n.holes[o].shape.contains(Gt.x,Gt.y)){r=!0;break}}if(!r)return!0}}return!1},e.prototype.updateBatches=function(t){if(this.graphicsData.length){if(this.validateBatching()){this.cacheDirty=this.dirty;var e=this.uvs,i=this.graphicsData,n=null,r=null;this.batches.length>0&&(r=(n=this.batches[this.batches.length-1]).style);for(var o=this.shapeIndex;o<i.length;o++){this.shapeIndex++;var a=i[o],s=a.fillStyle,h=a.lineStyle;Nt[a.type].build(a),a.matrix&&this.transformPoints(a.points,a.matrix);for(var u=0;u<2;u++){var l=0===u?s:h;if(l.visible){var c=l.texture.baseTexture,d=this.indices.length,p=this.points.length/2;c.wrapMode=ut.q.REPEAT,0===u?this.processFill(a):this.processLine(a);var f=this.points.length/2-p;0!==f&&(n&&!this._compareStyles(r,l)&&(n.end(d,p),n=null),n||((n=Bt.pop()||new Lt).begin(l,d,p),this.batches.push(n),r=l),this.addUvs(this.points,e,l.texture,p,f,l.matrix))}}}var m=this.indices.length,g=this.points.length/2;if(n&&n.end(m,g),0!==this.batches.length){if(this.indicesUint16&&this.indices.length===this.indicesUint16.length)this.indicesUint16.set(this.indices);else{var y=g>65535&&t;this.indicesUint16=y?new Uint32Array(this.indices):new Uint16Array(this.indices)}this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0},e.prototype._compareStyles=function(t,e){return!(!t||!e)&&(t.texture.baseTexture===e.texture.baseTexture&&(t.color+t.alpha===e.color+e.alpha&&!!t.native==!!e.native))},e.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,e=this.graphicsData.length;t<e;t++){var i=this.graphicsData[t],n=i.fillStyle,r=i.lineStyle;if(n&&!n.texture.baseTexture.valid)return!1;if(r&&!r.texture.baseTexture.valid)return!1}return!0},e.prototype.packBatches=function(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);for(var t=this.batches,e=0,i=t.length;e<i;e++)for(var n=t[e],r=0;r<n.size;r++){var o=n.start+r;this.indicesUint16[o]=this.indicesUint16[o]-n.attribStart}},e.prototype.isBatchable=function(){if(this.points.length>131070)return!1;for(var t=this.batches,i=0;i<t.length;i++)if(t[i].style.native)return!1;return this.points.length<2*e.BATCHABLE_SIZE},e.prototype.buildDrawCalls=function(){for(var t=++O.e._globalBatch,e=0;e<this.drawCalls.length;e++)this.drawCalls[e].texArray.clear(),Ft.push(this.drawCalls[e]);this.drawCalls.length=0;var i=this.colors,n=this.textureIds,r=Ft.pop();r||((r=new O.f).texArray=new O.k),r.texArray.count=0,r.start=0,r.size=0,r.type=ut.e.TRIANGLES;var o=0,a=null,s=0,h=!1,u=ut.e.TRIANGLES,l=0;this.drawCalls.push(r);for(e=0;e<this.batches.length;e++){var c=this.batches[e],d=c.style,p=d.texture.baseTexture;h!==!!d.native&&(u=(h=!!d.native)?ut.e.LINES:ut.e.TRIANGLES,a=null,o=8,t++),a!==p&&(a=p,p._batchEnabled!==t&&(8===o&&(t++,o=0,r.size>0&&((r=Ft.pop())||((r=new O.f).texArray=new O.k),this.drawCalls.push(r)),r.start=l,r.size=0,r.texArray.count=0,r.type=u),p.touched=1,p._batchEnabled=t,p._batchLocation=o,p.wrapMode=10497,r.texArray.elements[r.texArray.count++]=p,o++)),r.size+=c.size,l+=c.size,s=p._batchLocation,this.addColors(i,d.color,d.alpha,c.attribSize,c.attribStart),this.addTextureIds(n,s,c.attribSize,c.attribStart)}O.e._globalBatch=t,this.packAttributes()},e.prototype.packAttributes=function(){for(var t=this.points,e=this.uvs,i=this.colors,n=this.textureIds,r=new ArrayBuffer(3*t.length*4),o=new Float32Array(r),a=new Uint32Array(r),s=0,h=0;h<t.length/2;h++)o[s++]=t[2*h],o[s++]=t[2*h+1],o[s++]=e[2*h],o[s++]=e[2*h+1],a[s++]=i[h],o[s++]=n[h];this._buffer.update(r),this._indexBuffer.update(this.indicesUint16)},e.prototype.processFill=function(t){t.holes.length?(this.processHoles(t.holes),wt.triangulate(t,this)):Nt[t.type].triangulate(t,this)},e.prototype.processLine=function(t){Mt(t,this);for(var e=0;e<t.holes.length;e++)Mt(t.holes[e],this)},e.prototype.processHoles=function(t){for(var e=0;e<t.length;e++){var i=t[e];Nt[i.type].build(i),i.matrix&&this.transformPoints(i.points,i.matrix)}},e.prototype.calculateBounds=function(){var t=this._bounds,e=Ut,i=p.d.IDENTITY;this._bounds.clear(),e.clear();for(var n=0;n<this.graphicsData.length;n++){var r=this.graphicsData[n],o=r.shape,a=r.type,s=r.lineStyle,h=r.matrix||p.d.IDENTITY,u=0;if(s&&s.visible){var l=s.alignment;u=s.width,a===p.l.POLY?u*=.5+Math.abs(.5-l):u*=Math.max(0,l)}if(i!==h&&(e.isEmpty()||(t.addBoundsMatrix(e,i),e.clear()),i=h),a===p.l.RECT||a===p.l.RREC){var c=o;e.addFramePad(c.x,c.y,c.x+c.width,c.y+c.height,u,u)}else if(a===p.l.CIRC){var d=o;e.addFramePad(d.x,d.y,d.x,d.y,d.radius+u,d.radius+u)}else if(a===p.l.ELIP){var f=o;e.addFramePad(f.x,f.y,f.x,f.y,f.width+u,f.height+u)}else{var m=o;t.addVerticesMatrix(i,m.points,0,m.points.length,u,u)}}e.isEmpty()||t.addBoundsMatrix(e,i),t.pad(this.boundsPadding,this.boundsPadding)},e.prototype.transformPoints=function(t,e){for(var i=0;i<t.length/2;i++){var n=t[2*i],r=t[2*i+1];t[2*i]=e.a*n+e.c*r+e.tx,t[2*i+1]=e.b*n+e.d*r+e.ty}},e.prototype.addColors=function(t,e,i,n,r){void 0===r&&(r=0);var o=(e>>16)+(65280&e)+((255&e)<<16),a=Object(c.premultiplyTint)(o,i);t.length=Math.max(t.length,r+n);for(var s=0;s<n;s++)t[r+s]=a},e.prototype.addTextureIds=function(t,e,i,n){void 0===n&&(n=0),t.length=Math.max(t.length,n+i);for(var r=0;r<i;r++)t[n+r]=e},e.prototype.addUvs=function(t,e,i,n,r,o){void 0===o&&(o=null);for(var a=0,s=e.length,h=i.frame;a<r;){var u=t[2*(n+a)],l=t[2*(n+a)+1];if(o){var c=o.a*u+o.c*l+o.tx;l=o.b*u+o.d*l+o.ty,u=c}a++,e.push(u/h.width,l/h.height)}var d=i.baseTexture;(h.width<d.width||h.height<d.height)&&this.adjustUvs(e,i,s,r)},e.prototype.adjustUvs=function(t,e,i,n){for(var r=e.baseTexture,o=1e-6,a=i+2*n,s=e.frame,h=s.width/r.width,u=s.height/r.height,l=s.x/s.width,c=s.y/s.height,d=Math.floor(t[i]+o),p=Math.floor(t[i+1]+o),f=i+2;f<a;f+=2)d=Math.min(d,Math.floor(t[f]+o)),p=Math.min(p,Math.floor(t[f+1]+o));l-=d,c-=p;for(f=i;f<a;f+=2)t[f]=(t[f]+l)*h,t[f+1]=(t[f+1]+c)*u},e.BATCHABLE_SIZE=100,e}(O.g),Vt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.width=0,e.alignment=.5,e.native=!1,e.cap=pt.BUTT,e.join=dt.MITER,e.miterLimit=10,e}return _t(e,t),e.prototype.clone=function(){var t=new e;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t.cap=this.cap,t.join=this.join,t.miterLimit=this.miterLimit,t},e.prototype.reset=function(){t.prototype.reset.call(this),this.color=0,this.alignment=.5,this.width=0,this.native=!1},e}(vt),Wt=new Float32Array(3),Xt={},Yt=function(t){function e(e){void 0===e&&(e=null);var i=t.call(this)||this;return i._geometry=e||new Ht,i._geometry.refCount++,i.shader=null,i.state=O.E.for2d(),i._fillStyle=new vt,i._lineStyle=new Vt,i._matrix=null,i._holeMode=!1,i.currentPath=null,i.batches=[],i.batchTint=-1,i.batchDirty=-1,i.vertexData=null,i.pluginName="batch",i._transformID=-1,i.tint=16777215,i.blendMode=ut.b.NORMAL,i}return _t(e,t),Object.defineProperty(e.prototype,"geometry",{get:function(){return this._geometry},enumerable:!1,configurable:!0}),e.prototype.clone=function(){return this.finishPoly(),new e(this._geometry)},Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fill",{get:function(){return this._fillStyle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"line",{get:function(){return this._lineStyle},enumerable:!1,configurable:!0}),e.prototype.lineStyle=function(t){if(void 0===t&&(t=null),"number"==typeof t){var e=arguments;t={width:e[0]||0,color:e[1]||0,alpha:void 0!==e[2]?e[2]:1,alignment:void 0!==e[3]?e[3]:.5,native:!!e[4]}}return this.lineTextureStyle(t)},e.prototype.lineTextureStyle=function(t){if("number"==typeof t){Object(c.deprecation)("v5.2.0","Please use object-based options for Graphics#lineTextureStyle");var e=arguments,i=e[0],n=e[1],r=e[2],o=e[3],a=e[4],s=e[5],h=e[6];t={width:i,texture:n,color:r,alpha:o,matrix:a,alignment:s,native:h},Object.keys(t).forEach((function(e){return void 0===t[e]&&delete t[e]}))}t=Object.assign({width:0,texture:O.G.WHITE,color:t&&t.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:pt.BUTT,join:dt.MITER,miterLimit:10},t),this.currentPath&&this.startPoly();var u=t.width>0&&t.alpha>0;return u?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:u},t)):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new p.h,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new p.h,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},e.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,n=i[i.length-2],r=i[i.length-1];return n===t&&r===e||i.push(t,e),this},e.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},e.prototype.quadraticCurveTo=function(t,e,i,n){this._initCurve();var r=this.currentPath.points;return 0===r.length&&this.moveTo(0,0),Dt.curveTo(t,e,i,n,r),this},e.prototype.bezierCurveTo=function(t,e,i,n,r,o){return this._initCurve(),Rt.curveTo(t,e,i,n,r,o,this.currentPath.points),this},e.prototype.arcTo=function(t,e,i,n,r){this._initCurve(t,e);var o=this.currentPath.points,a=Ot.curveTo(t,e,i,n,r,o);if(a){var s=a.cx,h=a.cy,u=a.radius,l=a.startAngle,c=a.endAngle,d=a.anticlockwise;this.arc(s,h,u,l,c,d)}return this},e.prototype.arc=function(t,e,i,n,r,o){if(void 0===o&&(o=!1),n===r)return this;if(!o&&r<=n?r+=p.f:o&&n<=r&&(n+=p.f),0===r-n)return this;var a=t+Math.cos(n)*i,s=e+Math.sin(n)*i,h=this._geometry.closePointEps,u=this.currentPath?this.currentPath.points:null;if(u){var l=Math.abs(u[u.length-2]-a),c=Math.abs(u[u.length-1]-s);l<h&&c<h||u.push(a,s)}else this.moveTo(a,s),u=this.currentPath.points;return Ot.arc(a,s,t,e,i,n,r,o,u),this},e.prototype.beginFill=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=1),this.beginTextureFill({texture:O.G.WHITE,color:t,alpha:e})},e.prototype.beginTextureFill=function(t){if(t instanceof O.G){Object(c.deprecation)("v5.2.0","Please use object-based options for Graphics#beginTextureFill");var e=arguments,i=e[0],n=e[1],r=e[2],o=e[3];t={texture:i,color:n,alpha:r,matrix:o},Object.keys(t).forEach((function(e){return void 0===t[e]&&delete t[e]}))}t=Object.assign({texture:O.G.WHITE,color:16777215,alpha:1,matrix:null},t),this.currentPath&&this.startPoly();var a=t.alpha>0;return a?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:a},t)):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,e,i,n){return this.drawShape(new p.j(t,e,i,n))},e.prototype.drawRoundedRect=function(t,e,i,n,r){return this.drawShape(new p.k(t,e,i,n,r))},e.prototype.drawCircle=function(t,e,i){return this.drawShape(new p.a(t,e,i))},e.prototype.drawEllipse=function(t,e,i,n){return this.drawShape(new p.c(t,e,i,n))},e.prototype.drawPolygon=function(){for(var t,e=arguments,i=[],n=0;n<arguments.length;n++)i[n]=e[n];var r=!0,o=i[0];o.points?(r=o.closeStroke,t=o.points):t=Array.isArray(i[0])?i[0]:i;var a=new p.h(t);return a.closeStroke=r,this.drawShape(a),this},e.prototype.drawShape=function(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this},e.prototype.drawStar=function(t,e,i,n,r,o){return void 0===o&&(o=0),this.drawPolygon(new kt(t,e,i,n,r,o))},e.prototype.clear=function(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this},e.prototype.isFastRect=function(){var t=this._geometry.graphicsData;return 1===t.length&&t[0].shape.type===p.l.RECT&&!(t[0].lineStyle.visible&&t[0].lineStyle.width)},e.prototype._render=function(t){this.finishPoly();var e=this._geometry,i=t.context.supports.uint32Indices;e.updateBatches(i),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))},e.prototype._populateBatches=function(){var t=this._geometry,e=this.blendMode,i=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(t.points);for(var n=0;n<i;n++){var r=t.batches[n],o=r.style.color,a=new Float32Array(this.vertexData.buffer,4*r.attribStart*2,2*r.attribSize),s=new Float32Array(t.uvsFloat32.buffer,4*r.attribStart*2,2*r.attribSize),h={vertexData:a,blendMode:e,indices:new Uint16Array(t.indicesUint16.buffer,2*r.start,r.size),uvs:s,_batchRGB:Object(c.hex2rgb)(o),_tintRGB:o,_texture:r.style.texture,alpha:r.style.alpha,worldAlpha:1};this.batches[n]=h}},e.prototype._renderBatched=function(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(var e=0,i=this.batches.length;e<i;e++){var n=this.batches[e];n.worldAlpha=this.worldAlpha*n.alpha,t.plugins[this.pluginName].render(n)}}},e.prototype._renderDirect=function(t){var e=this._resolveDirectShader(t),i=this._geometry,n=this.tint,r=this.worldAlpha,o=e.uniforms,a=i.drawCalls;o.translationMatrix=this.transform.worldTransform,o.tint[0]=(n>>16&255)/255*r,o.tint[1]=(n>>8&255)/255*r,o.tint[2]=(255&n)/255*r,o.tint[3]=r,t.shader.bind(e),t.geometry.bind(i,e),t.state.set(this.state);for(var s=0,h=a.length;s<h;s++)this._renderDrawCallDirect(t,i.drawCalls[s])},e.prototype._renderDrawCallDirect=function(t,e){for(var i=e.texArray,n=e.type,r=e.size,o=e.start,a=i.count,s=0;s<a;s++)t.texture.bind(i.elements[s],s);t.geometry.draw(n,r,o)},e.prototype._resolveDirectShader=function(t){var e=this.shader,i=this.pluginName;if(!e){if(!Xt[i]){for(var n=t.plugins.batch.MAX_TEXTURES,r=new Int32Array(n),o=0;o<n;o++)r[o]=o;var a={tint:new Float32Array([1,1,1,1]),translationMatrix:new p.d,default:O.J.from({uSamplers:r},!0)},s=t.plugins[i]._shader.program;Xt[i]=new O.C(s,a)}e=Xt[i]}return e},e.prototype._calculateBounds=function(){this.finishPoly();var t=this._geometry;if(t.graphicsData.length){var e=t.bounds,i=e.minX,n=e.minY,r=e.maxX,o=e.maxY;this._bounds.addFrame(this.transform,i,n,r,o)}},e.prototype.containsPoint=function(t){return this.worldTransform.applyInverse(t,e._TEMP_POINT),this._geometry.containsPoint(e._TEMP_POINT)},e.prototype.calculateTints=function(){if(this.batchTint!==this.tint){this.batchTint=this.tint;for(var t=Object(c.hex2rgb)(this.tint,Wt),e=0;e<this.batches.length;e++){var i=this.batches[e],n=i._batchRGB,r=(t[0]*n[0]*255<<16)+(t[1]*n[1]*255<<8)+(0|t[2]*n[2]*255);i._tintRGB=(r>>16)+(65280&r)+((255&r)<<16)}}},e.prototype.calculateVertices=function(){var t=this.transform._worldID;if(this._transformID!==t){this._transformID=t;for(var e=this.transform.worldTransform,i=e.a,n=e.b,r=e.c,o=e.d,a=e.tx,s=e.ty,h=this._geometry.points,u=this.vertexData,l=0,c=0;c<h.length;c+=2){var d=h[c],p=h[c+1];u[l++]=i*d+r*p+a,u[l++]=o*p+n*d+s}}},e.prototype.closePath=function(){var t=this.currentPath;return t&&(t.closeStroke=!0),this},e.prototype.setMatrix=function(t){return this._matrix=t,this},e.prototype.beginHole=function(){return this.finishPoly(),this._holeMode=!0,this},e.prototype.endHole=function(){return this.finishPoly(),this._holeMode=!1,this},e.prototype.destroy=function(e){this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,t.prototype.destroy.call(this,e)},e._TEMP_POINT=new p.g,e}(_),qt=function(t,e){return(qt=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)};var Kt,Jt=new p.g,Zt=new Uint16Array([0,1,2,0,2,3]),Qt=function(t){function e(e){var i=t.call(this)||this;return i._anchor=new p.e(i._onAnchorUpdate,i,e?e.defaultAnchor.x:0,e?e.defaultAnchor.y:0),i._texture=null,i._width=0,i._height=0,i._tint=null,i._tintRGB=null,i.tint=16777215,i.blendMode=ut.b.NORMAL,i._cachedTint=16777215,i.uvs=null,i.texture=e||O.G.EMPTY,i.vertexData=new Float32Array(8),i.vertexTrimmedData=null,i._transformID=-1,i._textureID=-1,i._transformTrimmedID=-1,i._textureTrimmedID=-1,i.indices=Zt,i.pluginName="batch",i.isSprite=!0,i._roundPixels=d.b.ROUND_PIXELS,i}return function(t,e){function i(){this.constructor=t}qt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=Object(c.sign)(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=Object(c.sign)(this.scale.y)*this._height/this._texture.orig.height)},e.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},e.prototype.calculateVertices=function(){var t=this._texture;if(this._transformID!==this.transform._worldID||this._textureID!==t._updateID){this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;var e=this.transform.worldTransform,i=e.a,n=e.b,r=e.c,o=e.d,a=e.tx,s=e.ty,h=this.vertexData,u=t.trim,l=t.orig,c=this._anchor,p=0,f=0,m=0,g=0;if(u?(p=(f=u.x-c._x*l.width)+u.width,m=(g=u.y-c._y*l.height)+u.height):(p=(f=-c._x*l.width)+l.width,m=(g=-c._y*l.height)+l.height),h[0]=i*f+r*g+a,h[1]=o*g+n*f+s,h[2]=i*p+r*g+a,h[3]=o*g+n*p+s,h[4]=i*p+r*m+a,h[5]=o*m+n*p+s,h[6]=i*f+r*m+a,h[7]=o*m+n*f+s,this._roundPixels)for(var y=d.b.RESOLUTION,v=0;v<h.length;++v)h[v]=Math.round((h[v]*y|0)/y)}},e.prototype.calculateTrimmedVertices=function(){if(this.vertexTrimmedData){if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var t=this._texture,e=this.vertexTrimmedData,i=t.orig,n=this._anchor,r=this.transform.worldTransform,o=r.a,a=r.b,s=r.c,h=r.d,u=r.tx,l=r.ty,c=-n._x*i.width,d=c+i.width,p=-n._y*i.height,f=p+i.height;e[0]=o*c+s*p+u,e[1]=h*p+a*c+l,e[2]=o*d+s*p+u,e[3]=h*p+a*d+l,e[4]=o*d+s*f+u,e[5]=h*f+a*d+l,e[6]=o*c+s*f+u,e[7]=h*f+a*c+l},e.prototype._render=function(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)},e.prototype._calculateBounds=function(){var t=this._texture.trim,e=this._texture.orig;!t||t.width===e.width&&t.height===e.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},e.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._bounds.minX=this._texture.orig.width*-this._anchor._x,this._bounds.minY=this._texture.orig.height*-this._anchor._y,this._bounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._bounds.maxY=this._texture.orig.height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new p.j),e=this._localBoundsRect),this._bounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,Jt);var e=this._texture.orig.width,i=this._texture.orig.height,n=-e*this.anchor.x,r=0;return Jt.x>=n&&Jt.x<n+e&&(r=-i*this.anchor.y,Jt.y>=r&&Jt.y<r+i)},e.prototype.destroy=function(e){if(t.prototype.destroy.call(this,e),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,"boolean"==typeof e?e:e&&e.texture){var i="boolean"==typeof e?e:e&&e.baseTexture;this._texture.destroy(!!i)}this._texture=null},e.from=function(t,i){return new e(t instanceof O.G?t:O.G.from(t,i))},Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){var e=Object(c.sign)(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){var e=Object(c.sign)(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||O.G.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),e}(_),$t=function(t,e){return($t=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(t){t[t.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",t[t.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"}(Kt||(Kt={}));var te={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Kt.LINEAR_VERTICAL,fillGradientStops:[],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",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},ee=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],ie=function(){function t(t){this.styleID=0,this.reset(),oe(this,t,t)}return t.prototype.clone=function(){var e={};return oe(e,this,te),new t(e)},t.prototype.reset=function(){oe(this,te,te)},Object.defineProperty(t.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"breakWords",{get:function(){return this._breakWords},set:function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(t){var e=re(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this._fill},set:function(t){var e=re(t);this._fill!==e&&(this._fill=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(t){(function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(var i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0})(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontVariant",{get:function(){return this._fontVariant},set:function(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineHeight",{get:function(){return this._lineHeight},set:function(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leading",{get:function(){return this._leading},set:function(t){this._leading!==t&&(this._leading=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineJoin",{get:function(){return this._lineJoin},set:function(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"miterLimit",{get:function(){return this._miterLimit},set:function(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"padding",{get:function(){return this._padding},set:function(t){this._padding!==t&&(this._padding=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stroke",{get:function(){return this._stroke},set:function(t){var e=re(t);this._stroke!==e&&(this._stroke=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"strokeThickness",{get:function(){return this._strokeThickness},set:function(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textBaseline",{get:function(){return this._textBaseline},set:function(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trim",{get:function(){return this._trim},set:function(t){this._trim!==t&&(this._trim=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"whiteSpace",{get:function(){return this._whiteSpace},set:function(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrap",{get:function(){return this._wordWrap},set:function(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrapWidth",{get:function(){return this._wordWrapWidth},set:function(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)},enumerable:!1,configurable:!0}),t.prototype.toFontString=function(){var t="number"==typeof this.fontSize?this.fontSize+"px":this.fontSize,e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(var i=e.length-1;i>=0;i--){var n=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(n)&&ee.indexOf(n)<0&&(n='"'+n+'"'),e[i]=n}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},t}();function ne(t){return"number"==typeof t?Object(c.hex2string)(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function re(t){if(Array.isArray(t)){for(var e=0;e<t.length;++e)t[e]=ne(t[e]);return t}return ne(t)}function oe(t,e,i){for(var n in i)Array.isArray(e[n])?t[n]=e[n].slice():t[n]=e[n]}var ae=function(){function t(t,e,i,n,r,o,a,s,h){this.text=t,this.style=e,this.width=i,this.height=n,this.lines=r,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=s,this.fontProperties=h}return t.measureText=function(e,i,n,r){void 0===r&&(r=t._canvas),n=null==n?i.wordWrap:n;var o=i.toFontString(),a=t.measureFont(o);0===a.fontSize&&(a.fontSize=i.fontSize,a.ascent=i.fontSize);var s=r.getContext("2d");s.font=o;for(var h=(n?t.wordWrap(e,i,r):e).split(/(?:\r\n|\r|\n)/),u=new Array(h.length),l=0,c=0;c<h.length;c++){var d=s.measureText(h[c]).width+(h[c].length-1)*i.letterSpacing;u[c]=d,l=Math.max(l,d)}var p=l+i.strokeThickness;i.dropShadow&&(p+=i.dropShadowDistance);var f=i.lineHeight||a.fontSize+i.strokeThickness,m=Math.max(f,a.fontSize+i.strokeThickness)+(h.length-1)*(f+i.leading);return i.dropShadow&&(m+=i.dropShadowDistance),new t(e,i,p,m,h,u,f+i.leading,l,a)},t.wordWrap=function(e,i,n){void 0===n&&(n=t._canvas);for(var r=n.getContext("2d"),o=0,a="",s="",h=Object.create(null),u=i.letterSpacing,l=i.whiteSpace,c=t.collapseSpaces(l),d=t.collapseNewlines(l),p=!c,f=i.wordWrapWidth+u,m=t.tokenize(e),g=0;g<m.length;g++){var y=m[g];if(t.isNewline(y)){if(!d){s+=t.addLine(a),p=!c,a="",o=0;continue}y=" "}if(c){var v=t.isBreakingSpace(y),b=t.isBreakingSpace(a[a.length-1]);if(v&&b)continue}var _=t.getFromCache(y,u,h,r);if(_>f)if(""!==a&&(s+=t.addLine(a),a="",o=0),t.canBreakWords(y,i.breakWords))for(var w=t.wordWrapSplit(y),x=0;x<w.length;x++){for(var C=w[x],S=1;w[x+S];){var T=w[x+S],A=C[C.length-1];if(t.canBreakChars(A,T,y,x,i.breakWords))break;C+=T,S++}x+=C.length-1;var E=t.getFromCache(C,u,h,r);E+o>f&&(s+=t.addLine(a),p=!1,a="",o=0),a+=C,o+=E}else{a.length>0&&(s+=t.addLine(a),a="",o=0);var P=g===m.length-1;s+=t.addLine(y,!P),p=!1,a="",o=0}else _+o>f&&(p=!1,s+=t.addLine(a),a="",o=0),(a.length>0||!t.isBreakingSpace(y)||p)&&(a+=y,o+=_)}return s+=t.addLine(a,!1)},t.addLine=function(e,i){return void 0===i&&(i=!0),e=t.trimRight(e),e=i?e+"\n":e},t.getFromCache=function(t,e,i,n){var r=i[t];if("number"!=typeof r){var o=t.length*e;r=n.measureText(t).width+o,i[t]=r}return r},t.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},t.collapseNewlines=function(t){return"normal"===t},t.trimRight=function(e){if("string"!=typeof e)return"";for(var i=e.length-1;i>=0;i--){var n=e[i];if(!t.isBreakingSpace(n))break;e=e.slice(0,-1)}return e},t.isNewline=function(e){return"string"==typeof e&&t._newlines.indexOf(e.charCodeAt(0))>=0},t.isBreakingSpace=function(e){return"string"==typeof e&&t._breakingSpaces.indexOf(e.charCodeAt(0))>=0},t.tokenize=function(e){var i=[],n="";if("string"!=typeof e)return i;for(var r=0;r<e.length;r++){var o=e[r];t.isBreakingSpace(o)||t.isNewline(o)?(""!==n&&(i.push(n),n=""),i.push(o)):n+=o}return""!==n&&i.push(n),i},t.canBreakWords=function(t,e){return e},t.canBreakChars=function(t,e,i,n,r){return!0},t.wordWrapSplit=function(t){return t.split("")},t.measureFont=function(e){if(t._fonts[e])return t._fonts[e];var i={ascent:0,descent:0,fontSize:0},n=t._canvas,r=t._context;r.font=e;var o=t.METRICS_STRING+t.BASELINE_SYMBOL,a=Math.ceil(r.measureText(o).width),s=Math.ceil(r.measureText(t.BASELINE_SYMBOL).width),h=2*s;s=s*t.BASELINE_MULTIPLIER|0,n.width=a,n.height=h,r.fillStyle="#f00",r.fillRect(0,0,a,h),r.font=e,r.textBaseline="alphabetic",r.fillStyle="#000",r.fillText(o,0,s);var u=r.getImageData(0,0,a,h).data,l=u.length,c=4*a,d=0,p=0,f=!1;for(d=0;d<s;++d){for(var m=0;m<c;m+=4)if(255!==u[p+m]){f=!0;break}if(f)break;p+=c}for(i.ascent=s-d,p=l-c,f=!1,d=h;d>s;--d){for(m=0;m<c;m+=4)if(255!==u[p+m]){f=!0;break}if(f)break;p-=c}return i.descent=d-s,i.fontSize=i.ascent+i.descent,t._fonts[e]=i,i},t.clearMetrics=function(e){void 0===e&&(e=""),e?delete t._fonts[e]:t._fonts={}},t}(),se=function(){try{var t=new OffscreenCanvas(0,0),e=t.getContext("2d");return e&&e.measureText?t:document.createElement("canvas")}catch(t){return document.createElement("canvas")}}();se.width=se.height=10,ae._canvas=se,ae._context=se.getContext("2d"),ae._fonts={},ae.METRICS_STRING="|ÉqÅ",ae.BASELINE_SYMBOL="M",ae.BASELINE_MULTIPLIER=1.4,ae._newlines=[10,13],ae._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var he={texture:!0,children:!1,baseTexture:!0},ue=function(t){function e(e,i,n){var r=this,o=!1;n||(n=document.createElement("canvas"),o=!0),n.width=3,n.height=3;var a=O.G.from(n);return a.orig=new p.j,a.trim=new p.j,(r=t.call(this,a)||this)._ownCanvas=o,r.canvas=n,r.context=r.canvas.getContext("2d"),r._resolution=d.b.RESOLUTION,r._autoResolution=!0,r._text=null,r._style=null,r._styleListener=null,r._font="",r.text=e,r.style=i,r.localStyleID=-1,r}return function(t,e){function i(){this.constructor=t}$t(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e.prototype.updateText=function(t){var e=this._style;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),this.dirty||!t){this._font=this._style.toFontString();var i,n,r=this.context,o=ae.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),a=o.width,s=o.height,h=o.lines,u=o.lineHeight,l=o.lineWidths,d=o.maxLineWidth,p=o.fontProperties;this.canvas.width=Math.ceil((Math.max(1,a)+2*e.padding)*this._resolution),this.canvas.height=Math.ceil((Math.max(1,s)+2*e.padding)*this._resolution),r.scale(this._resolution,this._resolution),r.clearRect(0,0,this.canvas.width,this.canvas.height),r.font=this._font,r.lineWidth=e.strokeThickness,r.textBaseline=e.textBaseline,r.lineJoin=e.lineJoin,r.miterLimit=e.miterLimit;for(var f=e.dropShadow?2:1,m=0;m<f;++m){var g=e.dropShadow&&0===m,y=g?Math.ceil(Math.max(1,s)+2*e.padding):0,v=y*this._resolution;if(g){r.fillStyle="black",r.strokeStyle="black";var b=e.dropShadowColor,_=Object(c.hex2rgb)("number"==typeof b?b:Object(c.string2hex)(b));r.shadowColor="rgba("+255*_[0]+","+255*_[1]+","+255*_[2]+","+e.dropShadowAlpha+")",r.shadowBlur=e.dropShadowBlur,r.shadowOffsetX=Math.cos(e.dropShadowAngle)*e.dropShadowDistance,r.shadowOffsetY=Math.sin(e.dropShadowAngle)*e.dropShadowDistance+v}else r.fillStyle=this._generateFillStyle(e,h,o),r.strokeStyle=e.stroke,r.shadowColor="black",r.shadowBlur=0,r.shadowOffsetX=0,r.shadowOffsetY=0;for(var w=0;w<h.length;w++)i=e.strokeThickness/2,n=e.strokeThickness/2+w*u+p.ascent,"right"===e.align?i+=d-l[w]:"center"===e.align&&(i+=(d-l[w])/2),e.stroke&&e.strokeThickness&&this.drawLetterSpacing(h[w],i+e.padding,n+e.padding-y,!0),e.fill&&this.drawLetterSpacing(h[w],i+e.padding,n+e.padding-y)}this.updateTexture()}},e.prototype.drawLetterSpacing=function(t,e,i,n){void 0===n&&(n=!1);var r=this._style.letterSpacing;if(0!==r)for(var o=e,a=Array.from?Array.from(t):t.split(""),s=this.context.measureText(t).width,h=0,u=0;u<a.length;++u){var l=a[u];n?this.context.strokeText(l,o,i):this.context.fillText(l,o,i),o+=s-(h=this.context.measureText(t.substring(u+1)).width)+r,s=h}else n?this.context.strokeText(t,e,i):this.context.fillText(t,e,i)},e.prototype.updateTexture=function(){var t=this.canvas;if(this._style.trim){var e=Object(c.trimCanvas)(t);e.data&&(t.width=e.width,t.height=e.height,this.context.putImageData(e.data,0,0))}var i=this._texture,n=this._style,r=n.trim?0:n.padding,o=i.baseTexture;i.trim.width=i._frame.width=Math.ceil(t.width/this._resolution),i.trim.height=i._frame.height=Math.ceil(t.height/this._resolution),i.trim.x=-r,i.trim.y=-r,i.orig.width=i._frame.width-2*r,i.orig.height=i._frame.height-2*r,this._onTextureUpdate(),o.setRealSize(t.width,t.height,this._resolution),this._recursivePostUpdateTransform(),this.dirty=!1},e.prototype._render=function(e){this._autoResolution&&this._resolution!==e.resolution&&(this._resolution=e.resolution,this.dirty=!0),this.updateText(!0),t.prototype._render.call(this,e)},e.prototype.getLocalBounds=function(e){return this.updateText(!0),t.prototype.getLocalBounds.call(this,e)},e.prototype._calculateBounds=function(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)},e.prototype._generateFillStyle=function(t,e,i){var n,r=t.fill;if(!Array.isArray(r))return r;if(1===r.length)return r[0];var o=t.dropShadow?t.dropShadowDistance:0,a=t.padding||0,s=Math.ceil(this.canvas.width/this._resolution)-o-2*a,h=Math.ceil(this.canvas.height/this._resolution)-o-2*a,u=r.slice(),l=t.fillGradientStops.slice();if(!l.length)for(var c=u.length+1,d=1;d<c;++d)l.push(d/c);if(u.unshift(r[0]),l.unshift(0),u.push(r[r.length-1]),l.push(1),t.fillGradientType===Kt.LINEAR_VERTICAL){n=this.context.createLinearGradient(s/2,a,s/2,h+a);var p=0,f=(i.fontProperties.fontSize+t.strokeThickness)/h;for(d=0;d<e.length;d++)for(var m=i.lineHeight*d,g=0;g<u.length;g++){var y=m/h+("number"==typeof l[g]?l[g]:g/u.length)*f,v=Math.max(p,y);v=Math.min(v,1),n.addColorStop(v,u[g]),p=v}}else{n=this.context.createLinearGradient(a,h/2,s+a,h/2);var b=u.length+1,_=1;for(d=0;d<u.length;d++){var w=void 0;w="number"==typeof l[d]?l[d]:_/b,n.addColorStop(w,u[d]),_++}}return n},e.prototype.destroy=function(e){"boolean"==typeof e&&(e={children:e}),e=Object.assign({},he,e),t.prototype.destroy.call(this,e),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null},Object.defineProperty(e.prototype,"width",{get:function(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){this.updateText(!0);var e=Object(c.sign)(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){this.updateText(!0);var e=Object(c.sign)(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return this._style},set:function(t){t=t||{},this._style=t instanceof ie?t:new ie(t),this.localStyleID=-1,this.dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)},enumerable:!1,configurable:!0}),e}(Qt);d.b.UPLOADS_PER_FRAME=4;var le=function(t,e){return(le=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)};var ce=function(){function t(t){this.maxItemsPerFrame=t,this.itemsLeft=0}return t.prototype.beginFrame=function(){this.itemsLeft=this.maxItemsPerFrame},t.prototype.allowedToUpload=function(){return this.itemsLeft-- >0},t}();function de(t,e){var i=!1;if(t&&t._textures&&t._textures.length)for(var n=0;n<t._textures.length;n++)if(t._textures[n]instanceof O.G){var r=t._textures[n].baseTexture;-1===e.indexOf(r)&&(e.push(r),i=!0)}return i}function pe(t,e){if(t.baseTexture instanceof O.e){var i=t.baseTexture;return-1===e.indexOf(i)&&e.push(i),!0}return!1}function fe(t,e){if(t._texture&&t._texture instanceof O.G){var i=t._texture.baseTexture;return-1===e.indexOf(i)&&e.push(i),!0}return!1}function me(t,e){return e instanceof ue&&(e.updateText(!0),!0)}function ge(t,e){if(e instanceof ie){var i=e.toFontString();return ae.measureFont(i),!0}return!1}function ye(t,e){if(t instanceof ue){-1===e.indexOf(t.style)&&e.push(t.style),-1===e.indexOf(t)&&e.push(t);var i=t._texture.baseTexture;return-1===e.indexOf(i)&&e.push(i),!0}return!1}function ve(t,e){return t instanceof ie&&(-1===e.indexOf(t)&&e.push(t),!0)}var be=function(){function t(t){var e=this;this.limiter=new ce(d.b.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(ye),this.registerFindHook(ve),this.registerFindHook(de),this.registerFindHook(pe),this.registerFindHook(fe),this.registerUploadHook(me),this.registerUploadHook(ge)}return t.prototype.upload=function(t,e){"function"==typeof t&&(e=t,t=null),t&&this.add(t),this.queue.length?(e&&this.completes.push(e),this.ticking||(this.ticking=!0,C.a.system.addOnce(this.tick,this,C.c.UTILITY))):e&&e()},t.prototype.tick=function(){setTimeout(this.delayedTick,0)},t.prototype.prepareItems=function(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){var t=this.queue[0],e=!1;if(t&&!t._destroyed)for(var i=0,n=this.uploadHooks.length;i<n;i++)if(this.uploadHooks[i](this.uploadHookHelper,t)){this.queue.shift(),e=!0;break}e||this.queue.shift()}if(this.queue.length)C.a.system.addOnce(this.tick,this,C.c.UTILITY);else{this.ticking=!1;var r=this.completes.slice(0);this.completes.length=0;for(i=0,n=r.length;i<n;i++)r[i]()}},t.prototype.registerFindHook=function(t){return t&&this.addHooks.push(t),this},t.prototype.registerUploadHook=function(t){return t&&this.uploadHooks.push(t),this},t.prototype.add=function(t){for(var e=0,i=this.addHooks.length;e<i&&!this.addHooks[e](t,this.queue);e++);if(t instanceof _)for(e=t.children.length-1;e>=0;e--)this.add(t.children[e]);return this},t.prototype.destroy=function(){this.ticking&&C.a.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},t}();function _e(t,e){return e instanceof O.e&&(e._glTextures[t.CONTEXT_UID]||t.texture.bind(e),!0)}function we(t,e){if(!(e instanceof Yt))return!1;var i=e.geometry;e.finishPoly(),i.updateBatches();for(var n=i.batches,r=0;r<n.length;r++){var o=n[r].style.texture;o&&_e(t,o.baseTexture)}return i.batchable||t.geometry.bind(i,e._resolveDirectShader(t)),!0}function xe(t,e){return t instanceof Yt&&(e.push(t),!0)}var Ce=function(t){function e(e){var i=t.call(this,e)||this;return i.uploadHookHelper=i.renderer,i.registerFindHook(xe),i.registerUploadHook(_e),i.registerUploadHook(we),i}return function(t,e){function i(){this.constructor=t}le(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e}(be),Se=function(){function t(t){this.maxMilliseconds=t,this.frameStart=0}return t.prototype.beginFrame=function(){this.frameStart=Date.now()},t.prototype.allowedToUpload=function(){return Date.now()-this.frameStart<this.maxMilliseconds},t}(),Te=function(){function t(t,e,i){void 0===i&&(i=null),this._texture=t instanceof O.G?t:null,this.baseTexture=t instanceof O.e?t:this._texture.baseTexture,this.textures={},this.animations={},this.data=e;var n=this.baseTexture.resource;this.resolution=this._updateResolution(i||(n?n.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}return t.prototype._updateResolution=function(t){void 0===t&&(t=null);var e=this.data.meta.scale,i=Object(c.getResolutionOfUrl)(t,null);return null===i&&(i=void 0!==e?parseFloat(e):1),1!==i&&this.baseTexture.setResolution(i),i},t.prototype.parse=function(e){this._batchIndex=0,this._callback=e,this._frameKeys.length<=t.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()},t.prototype._processFrames=function(e){for(var i=e,n=t.BATCH_SIZE;i-e<n&&i<this._frameKeys.length;){var r=this._frameKeys[i],o=this._frames[r],a=o.frame;if(a){var s=null,h=null,u=!1!==o.trimmed&&o.sourceSize?o.sourceSize:o.frame,l=new p.j(0,0,Math.floor(u.w)/this.resolution,Math.floor(u.h)/this.resolution);s=o.rotated?new p.j(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.h)/this.resolution,Math.floor(a.w)/this.resolution):new p.j(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution),!1!==o.trimmed&&o.spriteSourceSize&&(h=new p.j(Math.floor(o.spriteSourceSize.x)/this.resolution,Math.floor(o.spriteSourceSize.y)/this.resolution,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution)),this.textures[r]=new O.G(this.baseTexture,s,l,h,o.rotated?2:0,o.anchor),O.G.addToCache(this.textures[r],r)}i++}},t.prototype._processAnimations=function(){var t=this.data.animations||{};for(var e in t){this.animations[e]=[];for(var i=0;i<t[e].length;i++){var n=t[e][i];this.animations[e].push(this.textures[n])}}},t.prototype._parseComplete=function(){var t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)},t.prototype._nextBatch=function(){var e=this;this._processFrames(this._batchIndex*t.BATCH_SIZE),this._batchIndex++,setTimeout((function(){e._batchIndex*t.BATCH_SIZE<e._frameKeys.length?e._nextBatch():(e._processAnimations(),e._parseComplete())}),0)},t.prototype.destroy=function(t){var e;for(var i in void 0===t&&(t=!1),this.textures)this.textures[i].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&(null===(e=this._texture)||void 0===e||e.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null},t.BATCH_SIZE=1e3,t}(),Ae=function(){function t(){}return t.use=function(e,i){var n=e.name+"_image";if(e.data&&e.type===rt.TYPE.JSON&&e.data.frames&&!this.resources[n]){var r={crossOrigin:e.crossOrigin,metadata:e.metadata.imageMetadata,parentResource:e},o=t.getResourcePath(e,this.baseUrl);this.add(n,o,r,(function(t){if(t.error)i(t.error);else{var n=new Te(t.texture,e.data,e.url);n.parse((function(){e.spritesheet=n,e.textures=n.textures,i()}))}}))}else i()},t.getResourcePath=function(t,e){return t.isDataUrl?t.data.meta.image:c.url.resolve(t.url.replace(e,""),t.data.meta.image)},t}(),Ee=function(t,e){return(Ee=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 Pe(t,e){function i(){this.constructor=t}Ee(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var Me=new p.g,Ie=function(t){function e(e,i,n){void 0===i&&(i=100),void 0===n&&(n=100);var r=t.call(this,e)||this;return r.tileTransform=new p.m,r._width=i,r._height=n,r.uvMatrix=r.texture.uvMatrix||new O.H(e),r.pluginName="tilingSprite",r.uvRespectAnchor=!1,r}return Pe(e,t),Object.defineProperty(e.prototype,"clampMargin",{get:function(){return this.uvMatrix.clampMargin},set:function(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileScale",{get:function(){return this.tileTransform.scale},set:function(t){this.tileTransform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tilePosition",{get:function(){return this.tileTransform.position},set:function(t){this.tileTransform.position.copyFrom(t)},enumerable:!1,configurable:!0}),e.prototype._onTextureUpdate=function(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215},e.prototype._render=function(t){var e=this._texture;e&&e.valid&&(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))},e.prototype._calculateBounds=function(){var t=this._width*-this._anchor._x,e=this._height*-this._anchor._y,i=this._width*(1-this._anchor._x),n=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,e,i,n)},e.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new p.j),e=this._localBoundsRect),this._bounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,Me);var e=this._width,i=this._height,n=-e*this.anchor._x;if(Me.x>=n&&Me.x<n+e){var r=-i*this.anchor._y;if(Me.y>=r&&Me.y<r+i)return!0}return!1},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.tileTransform=null,this.uvMatrix=null},e.from=function(t,i){return"number"==typeof i&&(Object(c.deprecation)("5.3.0","TilingSprite.from use options instead of width and height args"),i={width:i,height:arguments[2]}),new e(O.G.from(t,i),i.width,i.height)},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),e}(Qt),ke="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n",Oe=new p.d,Re=function(t){function e(e){var i=t.call(this,e)||this,n={globals:i.renderer.globalUniforms};return i.shader=O.C.from(ke,"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture2D(uSampler, coord);\n gl_FragColor = texSample * uColor;\n}\n",n),i.simpleShader=O.C.from(ke,"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 sample = texture2D(uSampler, vTextureCoord);\n gl_FragColor = sample * uColor;\n}\n",n),i.quad=new O.y,i.state=O.E.for2d(),i}return Pe(e,t),e.prototype.render=function(t){var e=this.renderer,i=this.quad,n=i.vertices;n[0]=n[6]=t._width*-t.anchor.x,n[1]=n[3]=t._height*-t.anchor.y,n[2]=n[4]=t._width*(1-t.anchor.x),n[5]=n[7]=t._height*(1-t.anchor.y),t.uvRespectAnchor&&((n=i.uvs)[0]=n[6]=-t.anchor.x,n[1]=n[3]=-t.anchor.y,n[2]=n[4]=1-t.anchor.x,n[5]=n[7]=1-t.anchor.y),i.invalidate();var r=t._texture,o=r.baseTexture,a=t.tileTransform.localTransform,s=t.uvMatrix,h=o.isPowerOfTwo&&r.frame.width===o.width&&r.frame.height===o.height;h&&(o._glTextures[e.CONTEXT_UID]?h=o.wrapMode!==ut.q.CLAMP:o.wrapMode===ut.q.CLAMP&&(o.wrapMode=ut.q.REPEAT));var u=h?this.simpleShader:this.shader,l=r.width,d=r.height,p=t._width,f=t._height;Oe.set(a.a*l/p,a.b*l/f,a.c*d/p,a.d*d/f,a.tx/p,a.ty/f),Oe.invert(),h?Oe.prepend(s.mapCoord):(u.uniforms.uMapCoord=s.mapCoord.toArray(!0),u.uniforms.uClampFrame=s.uClampFrame,u.uniforms.uClampOffset=s.uClampOffset),u.uniforms.uTransform=Oe.toArray(!0),u.uniforms.uColor=Object(c.premultiplyTintToRgba)(t.tint,t.worldAlpha,u.uniforms.uColor,o.alphaMode),u.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),u.uniforms.uSampler=r,e.shader.bind(u),e.geometry.bind(i),this.state.blendMode=Object(c.correctBlendMode)(t.blendMode,o.alphaMode),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},e}(O.v),De=function(t,e){return(De=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 Le(t,e){function i(){this.constructor=t}De(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var Ne=function(){function t(t,e){this.uvBuffer=t,this.uvMatrix=e,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}return t.prototype.update=function(t){if(t||this._bufferUpdateId!==this.uvBuffer._updateID||this._textureUpdateId!==this.uvMatrix._updateID){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var e=this.uvBuffer.data;this.data&&this.data.length===e.length||(this.data=new Float32Array(e.length)),this.uvMatrix.multiplyUvs(e,this.data),this._updateID++}},t}(),Be=new p.g,Fe=new p.h,ze=function(t){function e(e,i,n,r){void 0===r&&(r=ut.e.TRIANGLES);var o=t.call(this)||this;return o.geometry=e,e.refCount++,o.shader=i,o.state=n||O.E.for2d(),o.drawMode=r,o.start=0,o.size=0,o.uvs=null,o.indices=null,o.vertexData=new Float32Array(1),o.vertexDirty=0,o._transformID=-1,o._roundPixels=d.b.ROUND_PIXELS,o.batchUvs=null,o}return Le(e,t),Object.defineProperty(e.prototype,"uvBuffer",{get:function(){return this.geometry.buffers[1]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"verticesBuffer",{get:function(){return this.geometry.buffers[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"material",{get:function(){return this.shader},set:function(t){this.shader=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this.shader.tint},set:function(t){this.shader.tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this.shader.texture},set:function(t){this.shader.texture=t},enumerable:!1,configurable:!0}),e.prototype._render=function(t){var i=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===ut.e.TRIANGLES&&i.length<2*e.BATCHABLE_SIZE?this._renderToBatch(t):this._renderDefault(t)},e.prototype._renderDefault=function(t){var e=this.shader;e.alpha=this.worldAlpha,e.update&&e.update(),t.batch.flush(),e.program.uniformData.translationMatrix&&(e.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0)),t.shader.bind(e),t.state.set(this.state),t.geometry.bind(this.geometry,e),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},e.prototype._renderToBatch=function(t){var e=this.geometry;this.shader.uvMatrix&&(this.shader.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=e.indexBuffer.data,this._tintRGB=this.shader._tintRGB,this._texture=this.shader.texture;var i=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[i]),t.plugins[i].render(this)},e.prototype.calculateVertices=function(){var t=this.geometry,e=t.buffers[0].data;if(t.vertexDirtyId!==this.vertexDirty||this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID,this.vertexData.length!==e.length&&(this.vertexData=new Float32Array(e.length));for(var i=this.transform.worldTransform,n=i.a,r=i.b,o=i.c,a=i.d,s=i.tx,h=i.ty,u=this.vertexData,l=0;l<u.length/2;l++){var c=e[2*l],p=e[2*l+1];u[2*l]=n*c+o*p+s,u[2*l+1]=r*c+a*p+h}if(this._roundPixels){var f=d.b.RESOLUTION;for(l=0;l<u.length;++l)u[l]=Math.round((u[l]*f|0)/f)}this.vertexDirty=t.vertexDirtyId}},e.prototype.calculateUvs=function(){var t=this.geometry.buffers[1];this.shader.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new Ne(t,this.shader.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)},e.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)},e.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,Be);for(var e=this.geometry.getBuffer("aVertexPosition").data,i=Fe.points,n=this.geometry.getIndex().data,r=n.length,o=4===this.drawMode?3:1,a=0;a+2<r;a+=o){var s=2*n[a],h=2*n[a+1],u=2*n[a+2];if(i[0]=e[s],i[1]=e[s+1],i[2]=e[h],i[3]=e[h+1],i[4]=e[u],i[5]=e[u+1],Fe.contains(Be.x,Be.y))return!0}return!1},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.geometry.refCount--,0===this.geometry.refCount&&this.geometry.dispose(),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null},e.BATCHABLE_SIZE=100,e}(_),je=function(t){function e(e,i){var n=this,r={uSampler:e,alpha:1,uTextureMatrix:p.d.IDENTITY,uColor:new Float32Array([1,1,1,1])};return(i=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},i)).uniforms&&Object.assign(r,i.uniforms),(n=t.call(this,i.program||O.w.from("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTextureMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\n}\n","varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}\n"),r)||this)._colorDirty=!1,n.uvMatrix=new O.H(e),n.batchable=void 0===i.program,n.pluginName=i.pluginName,n.tint=i.tint,n.alpha=i.alpha,n}return Le(e,t),Object.defineProperty(e.prototype,"texture",{get:function(){return this.uniforms.uSampler},set:function(t){this.uniforms.uSampler!==t&&(this.uniforms.uSampler=t,this.uvMatrix.texture=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this._alpha},set:function(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){t!==this._tint&&(this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;Object(c.premultiplyTintToRgba)(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},e}(O.C),Ge=function(t){function e(e,i,n){var r=t.call(this)||this,o=new O.l(e),a=new O.l(i,!0),s=new O.l(n,!0,!0);return r.addAttribute("aVertexPosition",o,2,!1,ut.p.FLOAT).addAttribute("aTextureCoord",a,2,!1,ut.p.FLOAT).addIndex(s),r._updateId=-1,r}return Le(e,t),Object.defineProperty(e.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),e}(O.s),Ue=function(t,e){return(Ue=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)};var He=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[]},Ve=function(){function t(){}return t.test=function(t){return"string"==typeof t&&0===t.indexOf("info face=")},t.parse=function(t){var e=t.match(/^[a-z]+\s+.+$/gm),i={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[]};for(var n in e){var r=e[n].match(/^[a-z]+/gm)[0],o=e[n].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),a={};for(var s in o){var h=o[s].split("="),u=h[0],l=h[1].replace(/"/gm,""),c=parseFloat(l),d=isNaN(c)?l:c;a[u]=d}i[r].push(a)}var p=new He;return i.info.forEach((function(t){return p.info.push({face:t.face,size:parseInt(t.size,10)})})),i.common.forEach((function(t){return p.common.push({lineHeight:parseInt(t.lineHeight,10)})})),i.page.forEach((function(t){return p.page.push({id:parseInt(t.id,10),file:t.file})})),i.char.forEach((function(t){return p.char.push({id:parseInt(t.id,10),page:parseInt(t.page,10),x:parseInt(t.x,10),y:parseInt(t.y,10),width:parseInt(t.width,10),height:parseInt(t.height,10),xoffset:parseInt(t.xoffset,10),yoffset:parseInt(t.yoffset,10),xadvance:parseInt(t.xadvance,10)})})),i.kerning.forEach((function(t){return p.kerning.push({first:parseInt(t.first,10),second:parseInt(t.second,10),amount:parseInt(t.amount,10)})})),p},t}(),We=function(){function t(){}return t.test=function(t){return t instanceof XMLDocument&&t.getElementsByTagName("page").length&&null!==t.getElementsByTagName("info")[0].getAttribute("face")},t.parse=function(t){for(var e=new He,i=t.getElementsByTagName("info"),n=t.getElementsByTagName("common"),r=t.getElementsByTagName("page"),o=t.getElementsByTagName("char"),a=t.getElementsByTagName("kerning"),s=0;s<i.length;s++)e.info.push({face:i[s].getAttribute("face"),size:parseInt(i[s].getAttribute("size"),10)});for(s=0;s<n.length;s++)e.common.push({lineHeight:parseInt(n[s].getAttribute("lineHeight"),10)});for(s=0;s<r.length;s++)e.page.push({id:parseInt(r[s].getAttribute("id"),10)||0,file:r[s].getAttribute("file")});for(s=0;s<o.length;s++){var h=o[s];e.char.push({id:parseInt(h.getAttribute("id"),10),page:parseInt(h.getAttribute("page"),10)||0,x:parseInt(h.getAttribute("x"),10),y:parseInt(h.getAttribute("y"),10),width:parseInt(h.getAttribute("width"),10),height:parseInt(h.getAttribute("height"),10),xoffset:parseInt(h.getAttribute("xoffset"),10),yoffset:parseInt(h.getAttribute("yoffset"),10),xadvance:parseInt(h.getAttribute("xadvance"),10)})}for(s=0;s<a.length;s++)e.kerning.push({first:parseInt(a[s].getAttribute("first"),10),second:parseInt(a[s].getAttribute("second"),10),amount:parseInt(a[s].getAttribute("amount"),10)});return e},t}(),Xe=function(){function t(){}return t.test=function(t){if("string"==typeof t&&t.indexOf("<font>")>-1){var e=(new self.DOMParser).parseFromString(t,"text/xml");return We.test(e)}return!1},t.parse=function(t){var e=(new window.DOMParser).parseFromString(t,"text/xml");return We.parse(e)},t}(),Ye=[Ve,We,Xe];function qe(t){for(var e=0;e<Ye.length;e++)if(Ye[e].test(t))return Ye[e];return null}function Ke(t,e,i,n,r,o){var a,s=i.fill;if(!Array.isArray(s))return s;if(1===s.length)return s[0];var h=i.dropShadow?i.dropShadowDistance:0,u=i.padding||0,l=Math.ceil(t.width/n)-h-2*u,c=Math.ceil(t.height/n)-h-2*u,d=s.slice(),p=i.fillGradientStops.slice();if(!p.length)for(var f=d.length+1,m=1;m<f;++m)p.push(m/f);if(d.unshift(s[0]),p.unshift(0),d.push(s[s.length-1]),p.push(1),i.fillGradientType===Kt.LINEAR_VERTICAL){a=e.createLinearGradient(l/2,u,l/2,c+u);var g=0,y=(o.fontProperties.fontSize+i.strokeThickness)/c;for(m=0;m<r.length;m++)for(var v=o.lineHeight*m,b=0;b<d.length;b++){var _=v/c+("number"==typeof p[b]?p[b]:b/d.length)*y,w=Math.max(g,_);w=Math.min(w,1),a.addColorStop(w,d[b]),g=w}}else{a=e.createLinearGradient(u,c/2,l+u,c/2);var x=d.length+1,C=1;for(m=0;m<d.length;m++){var S=void 0;S="number"==typeof p[m]?p[m]:C/x,a.addColorStop(S,d[m]),C++}}return a}function Je(t,e,i,n,r,o,a){var s=i.text,h=i.fontProperties;e.translate(n,r),e.scale(o,o);var u=a.strokeThickness/2,l=-a.strokeThickness/2;e.font=a.toFontString(),e.lineWidth=a.strokeThickness,e.textBaseline=a.textBaseline,e.lineJoin=a.lineJoin,e.miterLimit=a.miterLimit,e.fillStyle=Ke(t,e,a,o,[s],i),e.strokeStyle=a.stroke,e.font=a.toFontString(),e.lineWidth=a.strokeThickness,e.textBaseline=a.textBaseline,e.lineJoin=a.lineJoin,e.miterLimit=a.miterLimit,e.fillStyle=Ke(t,e,a,o,[s],i),e.strokeStyle=a.stroke;var d=a.dropShadowColor,p=Object(c.hex2rgb)("number"==typeof d?d:Object(c.string2hex)(d));a.dropShadow?(e.shadowColor="rgba("+255*p[0]+","+255*p[1]+","+255*p[2]+","+a.dropShadowAlpha+")",e.shadowBlur=a.dropShadowBlur,e.shadowOffsetX=Math.cos(a.dropShadowAngle)*a.dropShadowDistance,e.shadowOffsetY=Math.sin(a.dropShadowAngle)*a.dropShadowDistance):(e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),a.stroke&&a.strokeThickness&&e.strokeText(s,u,l+i.lineHeight-h.descent),a.fill&&e.fillText(s,u,l+i.lineHeight-h.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}var Ze=function(){function t(t,e,i){var n=t.info[0],r=t.common[0],o=t.page[0],a=Object(c.getResolutionOfUrl)(o.file),s={};this._ownsTextures=i,this.font=n.face,this.size=n.size,this.lineHeight=r.lineHeight/a,this.chars={},this.pageTextures=s;for(var h=0;h<t.page.length;h++){var u=t.page[h],l=u.id,d=u.file;s[l]=e instanceof Array?e[h]:e[d]}for(h=0;h<t.char.length;h++){var f=t.char[h],m=(l=f.id,f.page),g=t.char[h],y=g.x,v=g.y,b=g.width,_=g.height,w=g.xoffset,x=g.yoffset,C=g.xadvance;y/=a,v/=a,b/=a,_/=a,w/=a,x/=a,C/=a;var S=new p.j(y+s[m].frame.x/a,v+s[m].frame.y/a,b,_);this.chars[l]={xOffset:w,yOffset:x,xAdvance:C,kerning:{},texture:new O.G(s[m].baseTexture,S),page:m}}for(h=0;h<t.kerning.length;h++){var T=t.kerning[h],A=T.first,E=T.second,P=T.amount;A/=a,E/=a,P/=a,this.chars[E]&&(this.chars[E].kerning[A]=P)}}return t.prototype.destroy=function(){for(var t in this.chars)this.chars[t].texture.destroy(),this.chars[t].texture=null;for(var t in this.pageTextures)this._ownsTextures&&this.pageTextures[t].destroy(!0),this.pageTextures[t]=null;this.chars=null,this.pageTextures=null},t.install=function(e,i,n){var r;if(e instanceof He)r=e;else{var o=qe(e);if(!o)throw new Error("Unrecognized data format for font.");r=o.parse(e)}i instanceof O.G&&(i=[i]);var a=new t(r,i,n);return t.available[a.font]=a,a},t.uninstall=function(e){var i=t.available[e];if(!i)throw new Error("No font found named '"+e+"'");i.destroy(),delete t.available[e]},t.from=function(e,i,n){if(!e)throw new Error("[BitmapFont] Property `name` is required.");var r=Object.assign({},t.defaultOptions,n),o=r.chars,a=r.padding,s=r.resolution,h=r.textureWidth,u=r.textureHeight,l=function(t){"string"==typeof t&&(t=[t]);for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i];if(Array.isArray(r)){if(2!==r.length)throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got "+r.length+".");var o=r[0].charCodeAt(0),a=r[1].charCodeAt(0);if(a<o)throw new Error("[BitmapFont]: Invalid character range.");for(var s=o,h=a;s<=h;s++)e.push(String.fromCharCode(s))}else e.push.apply(e,r.split(""))}if(0===e.length)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}(o),c=i instanceof ie?i:new ie(i),d=h,p=new He;p.info[0]={face:c.fontFamily,size:c.fontSize},p.common[0]={lineHeight:c.fontSize};for(var f,m,g,y=0,v=0,b=0,_=[],w=0;w<l.length;w++){f||((f=document.createElement("canvas")).width=h,f.height=u,m=f.getContext("2d"),g=new O.e(f,{resolution:s}),_.push(new O.G(g)),p.page.push({id:_.length-1,file:""}));var x=ae.measureText(l[w],c,!1,f),C=x.width,S=Math.ceil(x.height),T=Math.ceil(("italic"===c.fontStyle?2:1)*C);if(v>=u-S*s){if(0===v)throw new Error("[BitmapFont] textureHeight "+u+"px is too small for "+c.fontSize+"px fonts");--w,f=null,m=null,g=null,v=0,y=0,b=0}else if(b=Math.max(S+x.fontProperties.descent,b),T*s+y>=d)--w,v+=b*s,v=Math.ceil(v),y=0,b=0;else{Je(f,m,x,y,v,s,c);var A=x.text.charCodeAt(0);p.char.push({id:A,page:_.length-1,x:y/s,y:v/s,width:T,height:S,xoffset:0,yoffset:0,xadvance:Math.ceil(C-(c.dropShadow?c.dropShadowDistance:0)-(c.stroke?c.strokeThickness:0))}),y+=(T+2*a)*s,y=Math.ceil(y)}}var E=new t(p,_,!0);return void 0!==t.available[e]&&t.uninstall(e),t.available[e]=E,E},t.ALPHA=[["a","z"],["A","Z"]," "],t.NUMERIC=[["0","9"]],t.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],t.ASCII=[[" ","~"]],t.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:t.ALPHANUMERIC},t.available={},t}(),Qe=[],$e=[],ti=function(t){function e(i,n){void 0===n&&(n={});var r=t.call(this)||this;r._tint=16777215,n.font&&(Object(c.deprecation)("5.3.0","PIXI.BitmapText constructor style.font property is deprecated."),r._upgradeStyle(n));var o=Object.assign({},e.styleDefaults,n),a=o.align,s=o.tint,h=o.maxWidth,u=o.letterSpacing,l=o.fontName,f=o.fontSize;if(!Ze.available[l])throw new Error('Missing BitmapFont "'+l+'"');return r._activePagesMeshData=[],r._textWidth=0,r._textHeight=0,r._align=a,r._tint=s,r._fontName=l,r._fontSize=f||Ze.available[l].size,r._text=i,r._maxWidth=h,r._maxLineHeight=0,r._letterSpacing=u,r._anchor=new p.e((function(){r.dirty=!0}),r,0,0),r._roundPixels=d.b.ROUND_PIXELS,r.dirty=!0,r._textureCache={},r}return function(t,e){function i(){this.constructor=t}Ue(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e.prototype.updateText=function(){for(var t,e=Ze.available[this._fontName],i=this._fontSize/e.size,n=new p.g,r=[],o=[],a=this._text.replace(/(?:\r\n|\r)/g,"\n")||" ",s=a.length,h=this._maxWidth*e.size/this._fontSize,u=null,l=0,d=0,f=0,m=-1,g=0,y=0,v=0,b=0;b<s;b++){var _=a.charCodeAt(b),w=a.charAt(b);if(/(?:\s)/.test(w)&&(m=b,g=l),"\r"!==w&&"\n"!==w){var x=e.chars[_];if(x){u&&x.kerning[u]&&(n.x+=x.kerning[u]);var C=$e.pop()||{texture:O.G.EMPTY,line:0,charCode:0,position:new p.g};C.texture=x.texture,C.line=f,C.charCode=_,C.position.x=n.x+x.xOffset+this._letterSpacing/2,C.position.y=n.y+x.yOffset,r.push(C),n.x+=x.xAdvance+this._letterSpacing,l=n.x,v=Math.max(v,x.yOffset+x.texture.height),u=_,-1!==m&&h>0&&n.x>h&&(++y,Object(c.removeItems)(r,1+m-y,1+b-m),b=m,m=-1,o.push(g),d=Math.max(d,g),f++,n.x=0,n.y+=e.lineHeight,u=null)}}else o.push(l),d=Math.max(d,l),++f,++y,n.x=0,n.y+=e.lineHeight,u=null}var S=a.charAt(a.length-1);"\r"!==S&&"\n"!==S&&(/(?:\s)/.test(S)&&(l=g),o.push(l),d=Math.max(d,l));var T=[];for(b=0;b<=f;b++){var A=0;"right"===this._align?A=d-o[b]:"center"===this._align&&(A=(d-o[b])/2),T.push(A)}var E=r.length,P={},M=[],I=this._activePagesMeshData;for(b=0;b<I.length;b++)Qe.push(I[b]);for(b=0;b<E;b++){var k=(G=r[b].texture).baseTexture.uid;if(!P[k]){if(!(q=Qe.pop())){var R=new Ge,D=new je(O.G.EMPTY);q={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:new ze(R,D),vertices:null,uvs:null,indices:null}}q.index=0,q.indexCount=0,q.vertexCount=0,q.uvsCount=0,q.total=0;var L=this._textureCache;L[k]=L[k]||new O.G(G.baseTexture),q.mesh.texture=L[k],q.mesh.tint=this._tint,M.push(q),P[k]=q}P[k].total++}for(b=0;b<I.length;b++)-1===M.indexOf(I[b])&&this.removeChild(I[b].mesh);for(b=0;b<M.length;b++)M[b].mesh.parent!==this&&this.addChild(M[b].mesh);for(var b in this._activePagesMeshData=M,P){var N=(q=P[b]).total;if(!((null===(t=q.indices)||void 0===t?void 0:t.length)>6*N)||q.vertices.length<2*ze.BATCHABLE_SIZE)q.vertices=new Float32Array(8*N),q.uvs=new Float32Array(8*N),q.indices=new Uint16Array(6*N);else for(var B=q.total,F=q.vertices,z=4*B*2;z<F.length;z++)F[z]=0;q.mesh.size=6*N}for(b=0;b<E;b++){var j=(w=r[b]).position.x+T[w.line];this._roundPixels&&(j=Math.round(j));var G,U=j*i,H=w.position.y*i,V=P[(G=w.texture).baseTexture.uid],W=G.frame,X=G._uvs,Y=V.index++;V.indices[6*Y+0]=0+4*Y,V.indices[6*Y+1]=1+4*Y,V.indices[6*Y+2]=2+4*Y,V.indices[6*Y+3]=0+4*Y,V.indices[6*Y+4]=2+4*Y,V.indices[6*Y+5]=3+4*Y,V.vertices[8*Y+0]=U,V.vertices[8*Y+1]=H,V.vertices[8*Y+2]=U+W.width*i,V.vertices[8*Y+3]=H,V.vertices[8*Y+4]=U+W.width*i,V.vertices[8*Y+5]=H+W.height*i,V.vertices[8*Y+6]=U,V.vertices[8*Y+7]=H+W.height*i,V.uvs[8*Y+0]=X.x0,V.uvs[8*Y+1]=X.y0,V.uvs[8*Y+2]=X.x1,V.uvs[8*Y+3]=X.y1,V.uvs[8*Y+4]=X.x2,V.uvs[8*Y+5]=X.y2,V.uvs[8*Y+6]=X.x3,V.uvs[8*Y+7]=X.y3}for(var b in this._textWidth=d*i,this._textHeight=(n.y+e.lineHeight)*i,P){var q=P[b];if(0!==this.anchor.x||0!==this.anchor.y)for(var K=0,J=this._textWidth*this.anchor.x,Z=this._textHeight*this.anchor.y,Q=0;Q<q.total;Q++)q.vertices[K++]-=J,q.vertices[K++]-=Z,q.vertices[K++]-=J,q.vertices[K++]-=Z,q.vertices[K++]-=J,q.vertices[K++]-=Z,q.vertices[K++]-=J,q.vertices[K++]-=Z;this._maxLineHeight=v*i;var $=q.mesh.geometry.getBuffer("aVertexPosition"),tt=q.mesh.geometry.getBuffer("aTextureCoord"),et=q.mesh.geometry.getIndex();$.data=q.vertices,tt.data=q.uvs,et.data=q.indices,$.update(),tt.update(),et.update()}for(b=0;b<r.length;b++)$e.push(r[b])},e.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},e.prototype.getLocalBounds=function(){return this.validate(),t.prototype.getLocalBounds.call(this)},e.prototype.validate=function(){this.dirty&&(this.updateText(),this.dirty=!1)},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){if(this._tint!==t){this._tint=t;for(var e=0;e<this._activePagesMeshData.length;e++)this._activePagesMeshData[e].mesh.tint=t}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontName",{get:function(){return this._fontName},set:function(t){if(!Ze.available[t])throw new Error('Missing BitmapFont "'+t+'"');this._fontName!==t&&(this._fontName=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxWidth",{get:function(){return this._maxWidth},set:function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxLineHeight",{get:function(){return this.validate(),this._maxLineHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textWidth",{get:function(){return this.validate(),this._textWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){t!==this._roundPixels&&(this._roundPixels=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textHeight",{get:function(){return this.validate(),this._textHeight},enumerable:!1,configurable:!0}),e.prototype._upgradeStyle=function(t){if("string"==typeof t.font){var e=t.font.split(" ");t.fontName=1===e.length?e[0]:e.slice(1).join(" "),e.length>=2&&(t.fontSize=parseInt(e[0],10))}else t.fontName=t.font.name,t.fontSize="number"==typeof t.font.size?t.font.size:parseInt(t.font.size,10)},e.prototype.destroy=function(e){var i=this._textureCache;for(var n in i){i[n].destroy(),delete i[n]}this._textureCache=null,t.prototype.destroy.call(this,e)},e.registerFont=function(t,e){return Object(c.deprecation)("5.3.0","PIXI.BitmapText.registerFont is deprecated, use PIXI.BitmapFont.install"),Ze.install(t,e)},Object.defineProperty(e,"fonts",{get:function(){return Object(c.deprecation)("5.3.0","PIXI.BitmapText.fonts is deprecated, use PIXI.BitmapFont.available"),Ze.available},enumerable:!1,configurable:!0}),e.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0},e}(_),ei=function(){function t(){}return t.add=function(){rt.setExtensionXhrType("fnt",rt.XHR_RESPONSE_TYPE.TEXT)},t.use=function(e,i){var n=qe(e.data);if(n)for(var r=t.getBaseUrl(this,e),o=n.parse(e.data),a={},s=function(t){a[t.metadata.pageFile]=t.texture,Object.keys(a).length===o.page.length&&(e.bitmapFont=Ze.install(o,a,!0),i())},h=0;h<o.page.length;++h){var u=o.page[h].file,l=r+u,c=!1;for(var d in this.resources){var p=this.resources[d];if(p.url===l){p.metadata.pageFile=u,p.texture?s(p):p.onAfterMiddleware.add(s),c=!0;break}}if(!c){var f={crossOrigin:e.crossOrigin,loadType:rt.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:u},e.metadata.imageMetadata),parentResource:e};this.add(l,f,s)}}else i()},t.getBaseUrl=function(e,i){var n=i.isDataUrl?"":t.dirname(i.url);return i.isDataUrl&&("."===n&&(n=""),e.baseUrl&&n&&"/"===e.baseUrl.charAt(e.baseUrl.length-1)&&(n+="/")),(n=n.replace(e.baseUrl,""))&&"/"!==n.charAt(n.length-1)&&(n+="/"),n},t.dirname=function(t){var e=t.replace(/\\/g,"/").replace(/\/$/,"").replace(/\/[^\/]*$/,"");return e===t?".":""===e?"/":e},t}(),ii=function(t,e){return(ii=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)};var ni=function(t){function e(e){void 0===e&&(e=1);var i=t.call(this,O.O,"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float uAlpha;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\n}\n",{uAlpha:1})||this;return i.alpha=e,i}return function(t,e){function i(){this.constructor=t}ii(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),e}(O.m),ri=function(t,e){return(ri=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 oi(t,e){function i(){this.constructor=t}ri(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var ai,si,hi,ui,li,ci,di,pi,fi,mi,gi,yi,vi,bi,_i,wi,xi,Ci={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]},Si=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{"," gl_FragColor = vec4(0.0);"," %blur%","}"].join("\n");!function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(ai||(ai={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(si||(si={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(hi||(hi={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(ui||(ui={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(li||(li={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(ci||(ci={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(di||(di={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.FLOAT=5126]="FLOAT",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(pi||(pi={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(fi||(fi={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(mi||(mi={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON"}(gi||(gi={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA"}(yi||(yi={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(vi||(vi={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(bi||(bi={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(_i||(_i={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(wi||(wi={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(xi||(xi={}));var Ti=function(t){function e(e,i,n,r,o){void 0===i&&(i=8),void 0===n&&(n=4),void 0===r&&(r=d.b.FILTER_RESOLUTION),void 0===o&&(o=5);var a=this,s=function(t,e){var i,n=Math.ceil(t/2),r="\n attribute vec2 aVertexPosition;\n\n uniform mat3 projectionMatrix;\n\n uniform float strength;\n\n varying vec2 vBlurTexCoords[%size%];\n\n uniform vec4 inputSize;\n uniform vec4 outputFrame;\n\n vec4 filterVertexPosition( void )\n {\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n }\n\n vec2 filterTextureCoord( void )\n {\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n }\n\n void main(void)\n {\n gl_Position = filterVertexPosition();\n\n vec2 textureCoord = filterTextureCoord();\n %blur%\n }",o="";i=e?"vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":"vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(var a=0;a<t;a++){var s=i.replace("%index%",a.toString());o+=s=s.replace("%sampleIndex%",a-(n-1)+".0"),o+="\n"}return r=(r=r.replace("%blur%",o)).replace("%size%",t.toString())}(o,e),h=function(t){for(var e,i=Ci[t],n=i.length,r=Si,o="",a=0;a<t;a++){var s="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;".replace("%index%",a.toString());e=a,a>=n&&(e=t-a-1),o+=s=s.replace("%value%",i[e].toString()),o+="\n"}return r=(r=r.replace("%blur%",o)).replace("%size%",t.toString())}(o);return(a=t.call(this,s,h)||this).horizontal=e,a.resolution=r,a._quality=0,a.quality=n,a.blur=i,a}return oi(e,t),e.prototype.apply=function(t,e,i,n){if(i?this.horizontal?this.uniforms.strength=1/i.width*(i.width/e.width):this.uniforms.strength=1/i.height*(i.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,i,n);else{var r=t.getFilterTexture(),o=t.renderer,a=e,s=r;this.state.blend=!1,t.applyFilter(this,a,s,vi.CLEAR);for(var h=1;h<this.passes-1;h++){t.bindAndClear(a,vi.BLIT),this.uniforms.uSampler=s;var u=s;s=a,a=u,o.shader.bind(this),o.geometry.draw(5)}this.state.blend=!0,t.applyFilter(this,s,i,n),t.returnFilterTexture(r)}},Object.defineProperty(e.prototype,"blur",{get:function(){return this.strength},set:function(t){this.padding=1+2*Math.abs(t),this.strength=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quality",{get:function(){return this._quality},set:function(t){this._quality=t,this.passes=t},enumerable:!1,configurable:!0}),e}(O.m),Ai=function(t){function e(e,i,n,r){void 0===e&&(e=8),void 0===i&&(i=4),void 0===n&&(n=d.b.FILTER_RESOLUTION),void 0===r&&(r=5);var o=t.call(this)||this;return o.blurXFilter=new Ti(!0,e,i,n,r),o.blurYFilter=new Ti(!1,e,i,n,r),o.resolution=n,o.quality=i,o.blur=e,o.repeatEdgePixels=!1,o}return oi(e,t),e.prototype.apply=function(t,e,i,n){var r=Math.abs(this.blurXFilter.strength),o=Math.abs(this.blurYFilter.strength);if(r&&o){var a=t.getFilterTexture();this.blurXFilter.apply(t,e,a,vi.CLEAR),this.blurYFilter.apply(t,a,i,n),t.returnFilterTexture(a)}else o?this.blurYFilter.apply(t,e,i,n):this.blurXFilter.apply(t,e,i,n)},e.prototype.updatePadding=function(){this._repeatEdgePixels?this.padding=0:this.padding=2*Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))},Object.defineProperty(e.prototype,"blur",{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=this.blurYFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quality",{get:function(){return this.blurXFilter.quality},set:function(t){this.blurXFilter.quality=this.blurYFilter.quality=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blurX",{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blurY",{get:function(){return this.blurYFilter.blur},set:function(t){this.blurYFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.blurYFilter.blendMode},set:function(t){this.blurYFilter.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"repeatEdgePixels",{get:function(){return this._repeatEdgePixels},set:function(t){this._repeatEdgePixels=t,this.updatePadding()},enumerable:!1,configurable:!0}),e}(O.m),Ei=function(t,e){return(Ei=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)};var Pi=function(t){function e(){var e=this,i={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};return(e=t.call(this,O.N,"varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\nuniform float uAlpha;\n\nvoid main(void)\n{\n vec4 c = texture2D(uSampler, vTextureCoord);\n\n if (uAlpha == 0.0) {\n gl_FragColor = c;\n return;\n }\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (c.a > 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",i)||this).alpha=1,e}return function(t,e){function i(){this.constructor=t}Ei(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e.prototype._loadMatrix=function(t,e){void 0===e&&(e=!1);var i=t;e&&(this._multiply(i,this.uniforms.m,t),i=this._colorMatrix(i)),this.uniforms.m=i},e.prototype._multiply=function(t,e,i){return t[0]=e[0]*i[0]+e[1]*i[5]+e[2]*i[10]+e[3]*i[15],t[1]=e[0]*i[1]+e[1]*i[6]+e[2]*i[11]+e[3]*i[16],t[2]=e[0]*i[2]+e[1]*i[7]+e[2]*i[12]+e[3]*i[17],t[3]=e[0]*i[3]+e[1]*i[8]+e[2]*i[13]+e[3]*i[18],t[4]=e[0]*i[4]+e[1]*i[9]+e[2]*i[14]+e[3]*i[19]+e[4],t[5]=e[5]*i[0]+e[6]*i[5]+e[7]*i[10]+e[8]*i[15],t[6]=e[5]*i[1]+e[6]*i[6]+e[7]*i[11]+e[8]*i[16],t[7]=e[5]*i[2]+e[6]*i[7]+e[7]*i[12]+e[8]*i[17],t[8]=e[5]*i[3]+e[6]*i[8]+e[7]*i[13]+e[8]*i[18],t[9]=e[5]*i[4]+e[6]*i[9]+e[7]*i[14]+e[8]*i[19]+e[9],t[10]=e[10]*i[0]+e[11]*i[5]+e[12]*i[10]+e[13]*i[15],t[11]=e[10]*i[1]+e[11]*i[6]+e[12]*i[11]+e[13]*i[16],t[12]=e[10]*i[2]+e[11]*i[7]+e[12]*i[12]+e[13]*i[17],t[13]=e[10]*i[3]+e[11]*i[8]+e[12]*i[13]+e[13]*i[18],t[14]=e[10]*i[4]+e[11]*i[9]+e[12]*i[14]+e[13]*i[19]+e[14],t[15]=e[15]*i[0]+e[16]*i[5]+e[17]*i[10]+e[18]*i[15],t[16]=e[15]*i[1]+e[16]*i[6]+e[17]*i[11]+e[18]*i[16],t[17]=e[15]*i[2]+e[16]*i[7]+e[17]*i[12]+e[18]*i[17],t[18]=e[15]*i[3]+e[16]*i[8]+e[17]*i[13]+e[18]*i[18],t[19]=e[15]*i[4]+e[16]*i[9]+e[17]*i[14]+e[18]*i[19]+e[19],t},e.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},e.prototype.brightness=function(t,e){var i=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.greyscale=function(t,e){var i=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},e.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var i=Math.cos(t),n=Math.sin(t),r=1/3,o=(0,Math.sqrt)(r),a=[i+(1-i)*r,r*(1-i)-o*n,r*(1-i)+o*n,0,0,r*(1-i)+o*n,i+r*(1-i),r*(1-i)-o*n,0,0,r*(1-i)-o*n,r*(1-i)+o*n,i+r*(1-i),0,0,0,0,0,1,0];this._loadMatrix(a,e)},e.prototype.contrast=function(t,e){var i=(t||0)+1,n=-.5*(i-1),r=[i,0,0,0,n,0,i,0,0,n,0,0,i,0,n,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.saturate=function(t,e){void 0===t&&(t=0);var i=2*t/3+1,n=-.5*(i-1),r=[i,n,n,0,0,n,i,n,0,0,n,n,i,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},e.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},e.prototype.technicolor=function(t){this._loadMatrix([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],t)},e.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},e.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},e.prototype.kodachrome=function(t){this._loadMatrix([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],t)},e.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},e.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},e.prototype.colorTone=function(t,e,i,n,r){var o=((i=i||16770432)>>16&255)/255,a=(i>>8&255)/255,s=(255&i)/255,h=((n=n||3375104)>>16&255)/255,u=(n>>8&255)/255,l=(255&n)/255,c=[.3,.59,.11,0,0,o,a,s,t=t||.2,0,h,u,l,e=e||.15,0,o-h,a-u,s-l,0,0];this._loadMatrix(c,r)},e.prototype.night=function(t,e){var i=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(i,e)},e.prototype.predator=function(t,e){var i=[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(i,e)},e.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},e.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},Object.defineProperty(e.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),e}(O.m);Pi.prototype.grayscale=Pi.prototype.greyscale;var Mi=function(t,e){return(Mi=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)};var Ii=function(t){function e(e,i){var n=this,r=new p.d;return e.renderable=!1,(n=t.call(this,"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n","varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",{mapSampler:e._texture,filterMatrix:r,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this).maskSprite=e,n.maskMatrix=r,null==i&&(i=20),n.scale=new p.g(i,i),n}return function(t,e){function i(){this.constructor=t}Mi(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e.prototype.apply=function(t,e,i,n){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var r=this.maskSprite.worldTransform,o=Math.sqrt(r.a*r.a+r.b*r.b),a=Math.sqrt(r.c*r.c+r.d*r.d);0!==o&&0!==a&&(this.uniforms.rotation[0]=r.a/o,this.uniforms.rotation[1]=r.b/o,this.uniforms.rotation[2]=r.c/a,this.uniforms.rotation[3]=r.d/a),t.applyFilter(this,e,i,n)},Object.defineProperty(e.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(t){this.uniforms.mapSampler=t},enumerable:!1,configurable:!0}),e}(O.m),ki=function(t,e){return(ki=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)};var Oi=function(t){function e(){return t.call(this,"\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n')||this}return function(t,e){function i(){this.constructor=t}ki(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e}(O.m),Ri=function(t,e){return(Ri=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)};var Di=function(t){function e(e,i){void 0===e&&(e=.5),void 0===i&&(i=Math.random());var n=t.call(this,O.N,"precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",{uNoise:0,uSeed:0})||this;return n.noise=e,n.seed=i,n}return function(t,e){function i(){this.constructor=t}Ri(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),Object.defineProperty(e.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(t){this.uniforms.uNoise=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(t){this.uniforms.uSeed=t},enumerable:!1,configurable:!0}),e}(O.m),Li=new p.d;y.prototype._cacheAsBitmap=!1,y.prototype._cacheData=null;var Ni=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null};Object.defineProperties(y.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var e;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new Ni),(e=this._cacheData).originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea))}}}),y.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},y.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.batch.flush();var i=this.getLocalBounds(null,!0).clone();if(this.filters){var n=this.filters[0].padding;i.pad(n)}i.ceil(d.b.RESOLUTION);var r=t.renderTexture.current,o=t.renderTexture.sourceFrame.clone(),a=t.renderTexture.destinationFrame.clone(),s=t.projection.transform,h=O.z.create({width:i.width,height:i.height}),u="cacheAsBitmap_"+Object(c.uid)();this._cacheData.textureCacheId=u,O.e.addToCache(h.baseTexture,u),O.G.addToCache(h,u);var l=this.transform.localTransform.copyTo(Li).invert().translate(-i.x,-i.y);this.render=this._cacheData.originalRender,t.render(this,h,!0,l,!1),t.projection.transform=s,t.renderTexture.bind(r,o,a),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var p=new Qt(h);p.transform.worldTransform=this.transform.worldTransform,p.anchor.x=-i.x/i.width,p.anchor.y=-i.y/i.height,p.alpha=e,p._bounds=this._bounds,this._cacheData.sprite=p,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=p.containsPoint.bind(p)}},y.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},y.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(null,!0),i=this.alpha;this.alpha=1;var n=t.context,r=t._projTransform;e.ceil(d.b.RESOLUTION);var o=O.z.create({width:e.width,height:e.height}),a="cacheAsBitmap_"+Object(c.uid)();this._cacheData.textureCacheId=a,O.e.addToCache(o.baseTexture,a),O.G.addToCache(o,a);var s=Li;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,o,!0,s,!1),t.context=n,t._projTransform=r,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new Qt(o);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-e.x/e.width,h.anchor.y=-e.y/e.height,h.alpha=i,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},y.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},y.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},y.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,O.e.removeFromCache(this._cacheData.textureCacheId),O.G.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},y.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)},y.prototype.name=null,_.prototype.getChildByName=function(t,e){for(var i=0,n=this.children.length;i<n;i++)if(this.children[i].name===t)return this.children[i];if(e)for(i=0,n=this.children.length;i<n;i++){if(this.children[i].getChildByName){var r=this.children[i].getChildByName(t,!0);if(r)return r}}return null},y.prototype.getGlobalPosition=function(t,e){return void 0===t&&(t=new p.g),void 0===e&&(e=!1),this.parent?this.parent.toGlobal(this.position,t,e):(t.x=this.position.x,t.y=this.position.y),t};var Bi=function(t,e){return(Bi=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 Fi(t,e){function i(){this.constructor=t}Bi(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var zi=function(t){function e(e,i,n,r){void 0===e&&(e=100),void 0===i&&(i=100),void 0===n&&(n=10),void 0===r&&(r=10);var o=t.call(this)||this;return o.segWidth=n,o.segHeight=r,o.width=e,o.height=i,o.build(),o}return Fi(e,t),e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],i=[],n=[],r=this.segWidth-1,o=this.segHeight-1,a=this.width/r,s=this.height/o,h=0;h<t;h++){var u=h%this.segWidth,l=h/this.segWidth|0;e.push(u*a,l*s),i.push(u/r,l/o)}var c=r*o;for(h=0;h<c;h++){var d=h%r,p=h/r|0,f=p*this.segWidth+d,m=p*this.segWidth+d+1,g=(p+1)*this.segWidth+d,y=(p+1)*this.segWidth+d+1;n.push(f,m,g,m,y,g)}this.buffers[0].data=new Float32Array(e),this.buffers[1].data=new Float32Array(i),this.indexBuffer.data=new Uint16Array(n),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()},e}(Ge),ji=function(t){function e(e,i,n){void 0===e&&(e=200),void 0===n&&(n=0);var r=t.call(this,new Float32Array(4*i.length),new Float32Array(4*i.length),new Uint16Array(6*(i.length-1)))||this;return r.points=i,r._width=e,r.textureScale=n,r.build(),r}return Fi(e,t),Object.defineProperty(e.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),e.prototype.build=function(){var t=this.points;if(t){var e=this.getBuffer("aVertexPosition"),i=this.getBuffer("aTextureCoord"),n=this.getIndex();if(!(t.length<1)){e.data.length/4!==t.length&&(e.data=new Float32Array(4*t.length),i.data=new Float32Array(4*t.length),n.data=new Uint16Array(6*(t.length-1)));var r=i.data,o=n.data;r[0]=0,r[1]=0,r[2]=0,r[3]=1;for(var a=0,s=t[0],h=this._width*this.textureScale,u=t.length,l=0;l<u;l++){var c=4*l;if(this.textureScale>0){var d=s.x-t[l].x,p=s.y-t[l].y,f=Math.sqrt(d*d+p*p);s=t[l],a+=f/h}else a=l/(u-1);r[c]=a,r[c+1]=0,r[c+2]=a,r[c+3]=1}var m=0;for(l=0;l<u-1;l++){c=2*l;o[m++]=c,o[m++]=c+1,o[m++]=c+2,o[m++]=c+2,o[m++]=c+1,o[m++]=c+3}i.update(),n.update(),this.updateVertices()}}},e.prototype.updateVertices=function(){var t=this.points;if(!(t.length<1)){for(var e,i=t[0],n=0,r=0,o=this.buffers[0].data,a=t.length,s=0;s<a;s++){var h=t[s],u=4*s;r=-((e=s<t.length-1?t[s+1]:h).x-i.x),n=e.y-i.y;var l=Math.sqrt(n*n+r*r),c=this.textureScale>0?this.textureScale*this._width/2:this._width/2;n/=l,r/=l,n*=c,r*=c,o[u]=h.x+n,o[u+1]=h.y+r,o[u+2]=h.x-n,o[u+3]=h.y-r,i=h}this.buffers[0].update()}},e.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},e}(Ge),Gi=function(t){function e(e,i,n){void 0===n&&(n=0);var r=this,o=new ji(e.height,i,n),a=new je(e);return n>0&&(e.baseTexture.wrapMode=ut.q.REPEAT),(r=t.call(this,o,a)||this).autoUpdate=!0,r}return Fi(e,t),e.prototype._render=function(e){var i=this.geometry;(this.autoUpdate||i._width!==this.shader.texture.height)&&(i._width=this.shader.texture.height,i.update()),t.prototype._render.call(this,e)},e}(ze),Ui=function(t){function e(e,i,n){var r=this,o=new zi(e.width,e.height,i,n),a=new je(O.G.WHITE);return(r=t.call(this,o,a)||this).texture=e,r}return Fi(e,t),e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var t=this.geometry;t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build()},Object.defineProperty(e.prototype,"texture",{get:function(){return this.shader.texture},set:function(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),e.prototype._render=function(e){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),t.prototype._render.call(this,e)},e.prototype.destroy=function(e){this.shader.texture.off("update",this.textureUpdated,this),t.prototype.destroy.call(this,e)},e}(ze),Hi=function(t){function e(e,i,n,r,o){void 0===e&&(e=O.G.EMPTY);var a=this,s=new Ge(i,n,r);s.getBuffer("aVertexPosition").static=!1;var h=new je(e);return(a=t.call(this,s,h,null,o)||this).autoUpdate=!0,a}return Fi(e,t),Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype._render=function(e){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),t.prototype._render.call(this,e)},e}(ze),Vi=function(t){function e(e,i,n,r,o){void 0===i&&(i=10),void 0===n&&(n=10),void 0===r&&(r=10),void 0===o&&(o=10);var a=t.call(this,O.G.WHITE,4,4)||this;return a._origWidth=e.orig.width,a._origHeight=e.orig.height,a._width=a._origWidth,a._height=a._origHeight,a._leftWidth=i,a._rightWidth=r,a._topHeight=n,a._bottomHeight=o,a.texture=e,a}return Fi(e,t),e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype.updateHorizontalVertices=function(){var t=this.vertices,e=this._getMinScale();t[9]=t[11]=t[13]=t[15]=this._topHeight*e,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*e,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._getMinScale();t[2]=t[10]=t[18]=t[26]=this._leftWidth*e,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*e,t[6]=t[14]=t[22]=t[30]=this._width},e.prototype._getMinScale=function(){var t=this._leftWidth+this._rightWidth,e=this._width>t?1:this._width/t,i=this._topHeight+this._bottomHeight,n=this._height>i?1:this._height/i;return Math.min(e,n)},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(t){this._leftWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(t){this._rightWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topHeight",{get:function(){return this._topHeight},set:function(t){this._topHeight=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(t){this._bottomHeight=t,this._refresh()},enumerable:!1,configurable:!0}),e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var i=1/this._origWidth,n=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=i*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-i*this._rightWidth,e[9]=e[11]=e[13]=e[15]=n*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-n*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},e}(Ui),Wi=i(53),Xi=function(t,e){return(Xi=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)};var Yi=function(t){function e(e,i){void 0===i&&(i=!0);var n=t.call(this,e[0]instanceof O.G?e[0]:e[0].texture)||this;return n._textures=null,n._durations=null,n._autoUpdate=i,n._isConnectedToTicker=!1,n.animationSpeed=1,n.loop=!0,n.updateAnchor=!1,n.onComplete=null,n.onFrameChange=null,n.onLoop=null,n._currentTime=0,n._playing=!1,n._previousFrame=null,n.textures=e,n}return function(t,e){function i(){this.constructor=t}Xi(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(C.a.shared.remove(this.update,this),this._isConnectedToTicker=!1))},e.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(C.a.shared.add(this.update,this,C.c.HIGH),this._isConnectedToTicker=!0))},e.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){if(this._playing){var e=this.animationSpeed*t,i=this.currentFrame;if(null!==this._durations){var n=this._currentTime%1*this._durations[this.currentFrame];for(n+=e/60*1e3;n<0;)this._currentTime--,n+=this._durations[this.currentFrame];var r=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);n>=this._durations[this.currentFrame];)n-=this._durations[this.currentFrame]*r,this._currentTime+=r;this._currentTime+=n/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()):i!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<i||this.animationSpeed<0&&this.currentFrame>i)&&this.onLoop(),this.updateTexture())}},e.prototype.updateTexture=function(){var t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this._texture=this._textures[t],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},e.prototype.destroy=function(e){this.stop(),t.prototype.destroy.call(this,e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var i=[],n=0;n<t.length;++n)i.push(O.G.from(t[n]));return new e(i)},e.fromImages=function(t){for(var i=[],n=0;n<t.length;++n)i.push(O.G.from(t[n]));return new e(i)},Object.defineProperty(e.prototype,"totalFrames",{get:function(){return this._textures.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textures",{get:function(){return this._textures},set:function(t){if(t[0]instanceof O.G)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)}this._previousFrame=null,this.gotoAndStop(0),this.updateTexture()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentFrame",{get:function(){var t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playing",{get:function(){return this._playing},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(C.a.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(C.a.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),e}(Qt),qi=function(t,e){return(qi=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 Ki(t,e){function i(){this.constructor=t}qi(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var Ji="5.0.0";function Zi(){var t=this;Object.defineProperties(t,{SVG_SIZE:{get:function(){return Object(c.deprecation)(Ji,"PIXI.utils.SVG_SIZE property has moved to PIXI.resources.SVGResource.SVG_SIZE"),t.SVGResource.SVG_SIZE}},TransformStatic:{get:function(){return Object(c.deprecation)(Ji,"PIXI.TransformStatic class has been removed, use PIXI.Transform"),t.Transform}},TransformBase:{get:function(){return Object(c.deprecation)(Ji,"PIXI.TransformBase class has been removed, use PIXI.Transform"),t.Transform}},TRANSFORM_MODE:{get:function(){return Object(c.deprecation)(Ji,"PIXI.TRANSFORM_MODE property has been removed"),{STATIC:0,DYNAMIC:1}}},WebGLRenderer:{get:function(){return Object(c.deprecation)(Ji,"PIXI.WebGLRenderer class has moved to PIXI.Renderer"),t.Renderer}},CanvasRenderTarget:{get:function(){return Object(c.deprecation)(Ji,"PIXI.CanvasRenderTarget class has moved to PIXI.utils.CanvasRenderTarget"),t.utils.CanvasRenderTarget}},loader:{get:function(){return Object(c.deprecation)(Ji,"PIXI.loader instance has moved to PIXI.Loader.shared"),t.Loader.shared}},FilterManager:{get:function(){return Object(c.deprecation)(Ji,"PIXI.FilterManager class has moved to PIXI.systems.FilterSystem"),t.systems.FilterSystem}},CanvasTinter:{get:function(){return Object(c.deprecation)("5.2.0","PIXI.CanvasTinter namespace has moved to PIXI.canvasUtils"),t.canvasUtils}},GroupD8:{get:function(){return Object(c.deprecation)("5.2.0","PIXI.GroupD8 namespace has moved to PIXI.groupD8"),t.groupD8}}}),t.accessibility={},Object.defineProperties(t.accessibility,{AccessibilityManager:{get:function(){return Object(c.deprecation)("5.3.0","PIXI.accessibility.AccessibilityManager moved to PIXI.AccessibilityManager"),t.AccessibilityManager}}}),t.interaction={},Object.defineProperties(t.interaction,{InteractionManager:{get:function(){return Object(c.deprecation)("5.3.0","PIXI.interaction.InteractionManager moved to PIXI.InteractionManager"),t.InteractionManager}},InteractionData:{get:function(){return Object(c.deprecation)("5.3.0","PIXI.interaction.InteractionData moved to PIXI.InteractionData"),t.InteractionData}},InteractionEvent:{get:function(){return Object(c.deprecation)("5.3.0","PIXI.interaction.InteractionEvent moved to PIXI.InteractionEvent"),t.InteractionEvent}}}),t.prepare={},Object.defineProperties(t.prepare,{BasePrepare:{get:function(){return Object(c.deprecation)("5.2.1","PIXI.prepare.BasePrepare moved to PIXI.BasePrepare"),t.BasePrepare}},Prepare:{get:function(){return Object(c.deprecation)("5.2.1","PIXI.prepare.Prepare moved to PIXI.Prepare"),t.Prepare}},CanvasPrepare:{get:function(){return Object(c.deprecation)("5.2.1","PIXI.prepare.CanvasPrepare moved to PIXI.CanvasPrepare"),t.CanvasPrepare}}}),t.extract={},Object.defineProperties(t.extract,{Extract:{get:function(){return Object(c.deprecation)("5.2.1","PIXI.extract.Extract moved to PIXI.Extract"),t.Extract}},CanvasExtract:{get:function(){return Object(c.deprecation)("5.2.1","PIXI.extract.CanvasExtract moved to PIXI.CanvasExtract"),t.CanvasExtract}}}),t.extras={},Object.defineProperties(t.extras,{TilingSprite:{get:function(){return Object(c.deprecation)(Ji,"PIXI.extras.TilingSprite class has moved to PIXI.TilingSprite"),t.TilingSprite}},TilingSpriteRenderer:{get:function(){return Object(c.deprecation)(Ji,"PIXI.extras.TilingSpriteRenderer class has moved to PIXI.TilingSpriteRenderer"),t.TilingSpriteRenderer}},AnimatedSprite:{get:function(){return Object(c.deprecation)(Ji,"PIXI.extras.AnimatedSprite class has moved to PIXI.AnimatedSprite"),t.AnimatedSprite}},BitmapText:{get:function(){return Object(c.deprecation)(Ji,"PIXI.extras.BitmapText class has moved to PIXI.BitmapText"),t.BitmapText}}}),t.TilingSprite.fromFrame=function(e,i,n){return Object(c.deprecation)("5.3.0","TilingSprite.fromFrame is deprecated, use TilingSprite.from"),t.TilingSprite.from(e,{width:i,height:n})},t.TilingSprite.fromImage=function(e,i,n,r){return void 0===r&&(r={}),Object(c.deprecation)("5.3.0","TilingSprite.fromImage is deprecated, use TilingSprite.from"),r&&"object"!=typeof r&&(r={scaleMode:arguments[4],resourceOptions:{crossorigin:arguments[3]}}),r.width=i,r.height=n,t.TilingSprite.from(e,r)},Object.defineProperties(t.utils,{getSvgSize:{get:function(){return Object(c.deprecation)(Ji,"PIXI.utils.getSvgSize function has moved to PIXI.resources.SVGResource.getSize"),t.resources.SVGResource.getSize}}}),t.mesh={},Object.defineProperties(t.mesh,{Mesh:{get:function(){return Object(c.deprecation)(Ji,"PIXI.mesh.Mesh class has moved to PIXI.SimpleMesh"),t.SimpleMesh}},NineSlicePlane:{get:function(){return Object(c.deprecation)(Ji,"PIXI.mesh.NineSlicePlane class has moved to PIXI.NineSlicePlane"),t.NineSlicePlane}},Plane:{get:function(){return Object(c.deprecation)(Ji,"PIXI.mesh.Plane class has moved to PIXI.SimplePlane"),t.SimplePlane}},Rope:{get:function(){return Object(c.deprecation)(Ji,"PIXI.mesh.Rope class has moved to PIXI.SimpleRope"),t.SimpleRope}},RawMesh:{get:function(){return Object(c.deprecation)(Ji,"PIXI.mesh.RawMesh class has moved to PIXI.Mesh"),t.Mesh}},CanvasMeshRenderer:{get:function(){return Object(c.deprecation)(Ji,"PIXI.mesh.CanvasMeshRenderer class has moved to PIXI.CanvasMeshRenderer"),t.CanvasMeshRenderer}},MeshRenderer:{get:function(){return Object(c.deprecation)(Ji,"PIXI.mesh.MeshRenderer class has moved to PIXI.MeshRenderer"),t.MeshRenderer}}}),t.particles={},Object.defineProperties(t.particles,{ParticleContainer:{get:function(){return Object(c.deprecation)(Ji,"PIXI.particles.ParticleContainer class has moved to PIXI.ParticleContainer"),t.ParticleContainer}},ParticleRenderer:{get:function(){return Object(c.deprecation)(Ji,"PIXI.particles.ParticleRenderer class has moved to PIXI.ParticleRenderer"),t.ParticleRenderer}}}),t.ticker={},Object.defineProperties(t.ticker,{Ticker:{get:function(){return Object(c.deprecation)(Ji,"PIXI.ticker.Ticker class has moved to PIXI.Ticker"),t.Ticker}},shared:{get:function(){return Object(c.deprecation)(Ji,"PIXI.ticker.shared instance has moved to PIXI.Ticker.shared"),t.Ticker.shared}}}),t.loaders={},Object.defineProperties(t.loaders,{Loader:{get:function(){return Object(c.deprecation)(Ji,"PIXI.loaders.Loader class has moved to PIXI.Loader"),t.Loader}},Resource:{get:function(){return Object(c.deprecation)(Ji,"PIXI.loaders.Resource class has moved to PIXI.LoaderResource"),t.LoaderResource}},bitmapFontParser:{get:function(){return Object(c.deprecation)(Ji,"PIXI.loaders.bitmapFontParser function has moved to PIXI.BitmapFontLoader.use"),t.BitmapFontLoader.use}},parseBitmapFontData:{get:function(){Object(c.deprecation)(Ji,"PIXI.loaders.parseBitmapFontData function has removed")}},spritesheetParser:{get:function(){return Object(c.deprecation)(Ji,"PIXI.loaders.spritesheetParser function has moved to PIXI.SpritesheetLoader.use"),t.SpritesheetLoader.use}},getResourcePath:{get:function(){return Object(c.deprecation)(Ji,"PIXI.loaders.getResourcePath property has moved to PIXI.SpritesheetLoader.getResourcePath"),t.SpritesheetLoader.getResourcePath}}}),t.Loader.addPixiMiddleware=function(e){return Object(c.deprecation)(Ji,"PIXI.loaders.Loader.addPixiMiddleware function is deprecated, use PIXI.loaders.Loader.registerPlugin"),t.loaders.Loader.registerPlugin({use:e()})};var e=function(t){return"on"+t.charAt(0).toUpperCase()+t.slice(1)};Object.assign(t.Loader.prototype,{on:function(t){var i=e(t);Object(c.deprecation)(Ji,"PIXI.Loader#on is completely deprecated, use PIXI.Loader#"+i+".add")},once:function(t){var i=e(t);Object(c.deprecation)(Ji,"PIXI.Loader#once is completely deprecated, use PIXI.Loader#"+i+".once")},off:function(t){var i=e(t);Object(c.deprecation)(Ji,"PIXI.Loader#off is completely deprecated, use PIXI.Loader#"+i+".detach")}}),Object.defineProperty(t.extract,"WebGLExtract",{get:function(){return Object(c.deprecation)(Ji,"PIXI.extract.WebGLExtract method has moved to PIXI.Extract"),t.Extract}}),Object.defineProperty(t.prepare,"WebGLPrepare",{get:function(){return Object(c.deprecation)(Ji,"PIXI.prepare.WebGLPrepare class has moved to PIXI.Prepare"),t.Prepare}}),t.Container.prototype._renderWebGL=function(t){Object(c.deprecation)(Ji,"PIXI.Container._renderWebGL method has moved to PIXI.Container._render"),this._render(t)},t.Container.prototype.renderWebGL=function(t){Object(c.deprecation)(Ji,"PIXI.Container.renderWebGL method has moved to PIXI.Container.render"),this.render(t)},t.DisplayObject.prototype.renderWebGL=function(t){Object(c.deprecation)(Ji,"PIXI.DisplayObject.renderWebGL method has moved to PIXI.DisplayObject.render"),this.render(t)},t.Container.prototype.renderAdvancedWebGL=function(t){Object(c.deprecation)(Ji,"PIXI.Container.renderAdvancedWebGL method has moved to PIXI.Container.renderAdvanced"),this.renderAdvanced(t)},Object.defineProperties(t.settings,{TRANSFORM_MODE:{get:function(){return Object(c.deprecation)(Ji,"PIXI.settings.TRANSFORM_MODE property has been removed"),0},set:function(){Object(c.deprecation)(Ji,"PIXI.settings.TRANSFORM_MODE property has been removed")}}});var i=t.BaseTexture;i.prototype.loadSource=function(e){Object(c.deprecation)(Ji,"PIXI.BaseTexture.loadSource method has been deprecated");var i=t.resources.autoDetectResource(e);i.internal=!0,this.setResource(i),this.update()};var n=!1;Object.defineProperties(i.prototype,{hasLoaded:{get:function(){return Object(c.deprecation)(Ji,"PIXI.BaseTexture.hasLoaded property has been removed, use PIXI.BaseTexture.valid"),this.valid}},imageUrl:{get:function(){var t;return Object(c.deprecation)(Ji,"PIXI.BaseTexture.imageUrl property has been removed, use PIXI.BaseTexture.resource.url"),null===(t=this.resource)||void 0===t?void 0:t.url},set:function(t){Object(c.deprecation)(Ji,"PIXI.BaseTexture.imageUrl property has been removed, use PIXI.BaseTexture.resource.url"),this.resource&&(this.resource.url=t)}},source:{get:function(){return Object(c.deprecation)(Ji,"PIXI.BaseTexture.source property has been moved, use `PIXI.BaseTexture.resource.source`"),this.resource.source},set:function(t){Object(c.deprecation)(Ji,"PIXI.BaseTexture.source property has been moved, use `PIXI.BaseTexture.resource.source` if you want to set HTMLCanvasElement. Otherwise, create new BaseTexture."),this.resource&&(this.resource.source=t)}},premultiplyAlpha:{get:function(){return Object(c.deprecation)("5.2.0","PIXI.BaseTexture.premultiplyAlpha property has been changed to `alphaMode`, see `PIXI.ALPHA_MODES`"),0!==this.alphaMode},set:function(t){Object(c.deprecation)("5.2.0","PIXI.BaseTexture.premultiplyAlpha property has been changed to `alphaMode`, see `PIXI.ALPHA_MODES`"),this.alphaMode=Number(t)}},_id:{get:function(){return n||(Object(c.deprecation)("5.2.0","PIXI.BaseTexture._id batch local field has been changed to `_batchLocation`"),n=!0),this._batchLocation},set:function(t){this._batchLocation=t}}}),i.fromImage=function(t,e,n,r){Object(c.deprecation)(Ji,"PIXI.BaseTexture.fromImage method has been replaced with PIXI.BaseTexture.from");var o={scale:r,crossorigin:e};return i.from(t,{scaleMode:n,resourceOptions:o})},i.fromCanvas=function(t,e){return Object(c.deprecation)(Ji,"PIXI.BaseTexture.fromCanvas method has been replaced with PIXI.BaseTexture.from"),i.from(t,{scaleMode:e})},i.fromSVG=function(t,e,n,r){Object(c.deprecation)(Ji,"PIXI.BaseTexture.fromSVG method has been replaced with PIXI.BaseTexture.from");var o={scale:r,crossorigin:e};return i.from(t,{scaleMode:n,resourceOptions:o})},Object.defineProperties(t.resources.ImageResource.prototype,{premultiplyAlpha:{get:function(){return Object(c.deprecation)("5.2.0","PIXI.resources.ImageResource.premultiplyAlpha property has been changed to `alphaMode`, see `PIXI.ALPHA_MODES`"),0!==this.alphaMode},set:function(t){Object(c.deprecation)("5.2.0","PIXI.resources.ImageResource.premultiplyAlpha property has been changed to `alphaMode`, see `PIXI.ALPHA_MODES`"),this.alphaMode=Number(t)}}}),t.Point.prototype.copy=function(t){return Object(c.deprecation)(Ji,"PIXI.Point.copy method has been replaced with PIXI.Point.copyFrom"),this.copyFrom(t)},t.ObservablePoint.prototype.copy=function(t){return Object(c.deprecation)(Ji,"PIXI.ObservablePoint.copy method has been replaced with PIXI.ObservablePoint.copyFrom"),this.copyFrom(t)},t.Rectangle.prototype.copy=function(t){return Object(c.deprecation)(Ji,"PIXI.Rectangle.copy method has been replaced with PIXI.Rectangle.copyFrom"),this.copyFrom(t)},t.Matrix.prototype.copy=function(t){return Object(c.deprecation)(Ji,"PIXI.Matrix.copy method has been replaced with PIXI.Matrix.copyTo"),this.copyTo(t)},t.systems.StateSystem.prototype.setState=function(t){return Object(c.deprecation)("v5.1.0","StateSystem.setState has been renamed to StateSystem.set"),this.set(t)},Object.assign(t.systems.FilterSystem.prototype,{getRenderTarget:function(t,e){return Object(c.deprecation)(Ji,"PIXI.FilterManager.getRenderTarget method has been replaced with PIXI.systems.FilterSystem#getFilterTexture"),this.getFilterTexture(null,e)},returnRenderTarget:function(t){Object(c.deprecation)(Ji,"PIXI.FilterManager.returnRenderTarget method has been replaced with PIXI.systems.FilterSystem.returnFilterTexture"),this.returnFilterTexture(t)},calculateScreenSpaceMatrix:function(t){Object(c.deprecation)(Ji,"PIXI.systems.FilterSystem.calculateScreenSpaceMatrix method is removed, use `(vTextureCoord * inputSize.xy) + outputFrame.xy` instead");var e=t.identity(),i=this.activeState,n=i.sourceFrame,r=i.destinationFrame;return e.translate(n.x/r.width,n.y/r.height),e.scale(r.width,r.height),e},calculateNormalizedScreenSpaceMatrix:function(t){Object(c.deprecation)(Ji,"PIXI.systems.FilterManager.calculateNormalizedScreenSpaceMatrix method is removed, use `((vTextureCoord * inputSize.xy) + outputFrame.xy) / outputFrame.zw` instead.");var e=this.activeState,i=e.sourceFrame,n=e.destinationFrame,r=t.identity();r.translate(i.x/n.width,i.y/n.height);var o=n.width/i.width,a=n.height/i.height;return r.scale(o,a),r}}),Object.defineProperties(t.RenderTexture.prototype,{sourceFrame:{get:function(){return Object(c.deprecation)(Ji,"PIXI.RenderTexture.sourceFrame property has been removed"),this.filterFrame}},size:{get:function(){return Object(c.deprecation)(Ji,"PIXI.RenderTexture.size property has been removed"),this._frame}}});var r=function(t){function e(e,i,n,r){return Object(c.deprecation)(Ji,"PIXI.filters.BlurXFilter class is deprecated, use PIXI.filters.BlurFilterPass"),t.call(this,!0,e,i,n,r)||this}return Ki(e,t),e}(t.filters.BlurFilterPass),o=function(t){function e(e,i,n,r){return Object(c.deprecation)(Ji,"PIXI.filters.BlurYFilter class is deprecated, use PIXI.filters.BlurFilterPass"),t.call(this,!1,e,i,n,r)||this}return Ki(e,t),e}(t.filters.BlurFilterPass);Object.assign(t.filters,{BlurXFilter:r,BlurYFilter:o});var a=t.Sprite,s=t.Texture,h=t.Graphics;function u(t,e,i,n){return Object(c.deprecation)(Ji,"PIXI.Sprite."+t+" method is deprecated, use PIXI.Sprite.from"),a.from(e,{resourceOptions:{scale:n,crossorigin:i}})}function l(t,e,i,n){return Object(c.deprecation)(Ji,"PIXI.Texture."+t+" method is deprecated, use PIXI.Texture.from"),s.from(e,{resourceOptions:{scale:n,crossorigin:i}})}h.prototype.generateCanvasTexture||(h.prototype.generateCanvasTexture=function(){Object(c.deprecation)(Ji,'PIXI.Graphics.generateCanvasTexture method is only available in "pixi.js-legacy"')}),Object.defineProperty(h.prototype,"graphicsData",{get:function(){return Object(c.deprecation)(Ji,"PIXI.Graphics.graphicsData property is deprecated, use PIXI.Graphics.geometry.graphicsData"),this.geometry.graphicsData}}),a.fromImage=u.bind(null,"fromImage"),a.fromSVG=u.bind(null,"fromSVG"),a.fromCanvas=u.bind(null,"fromCanvas"),a.fromVideo=u.bind(null,"fromVideo"),a.fromFrame=u.bind(null,"fromFrame"),s.fromImage=l.bind(null,"fromImage"),s.fromSVG=l.bind(null,"fromSVG"),s.fromCanvas=l.bind(null,"fromCanvas"),s.fromVideo=l.bind(null,"fromVideo"),s.fromFrame=l.bind(null,"fromFrame"),Object.defineProperty(t.AbstractRenderer.prototype,"autoResize",{get:function(){return Object(c.deprecation)(Ji,"PIXI.AbstractRenderer.autoResize property is deprecated, use PIXI.AbstractRenderer.autoDensity"),this.autoDensity},set:function(t){Object(c.deprecation)(Ji,"PIXI.AbstractRenderer.autoResize property is deprecated, use PIXI.AbstractRenderer.autoDensity"),this.autoDensity=t}}),Object.defineProperty(t.Renderer.prototype,"textureManager",{get:function(){return Object(c.deprecation)(Ji,"PIXI.Renderer.textureManager property is deprecated, use PIXI.Renderer.texture"),this.texture}}),t.utils.mixins={mixin:function(){Object(c.deprecation)(Ji,"PIXI.utils.mixins.mixin function is no longer available")},delayMixin:function(){Object(c.deprecation)(Ji,"PIXI.utils.mixins.delayMixin function is no longer available")},performMixins:function(){Object(c.deprecation)(Ji,"PIXI.utils.mixins.performMixins function is no longer available")}},Object.defineProperty(t.BitmapText.prototype,"font",{get:function(){return Object(c.deprecation)("5.3.0","PIXI.BitmapText.font property is deprecated, use fontName, fontSize, tint or align properties"),{name:this._fontName,size:this._fontSize,tint:this._tint,align:this._align}},set:function(e){if(Object(c.deprecation)("5.3.0","PIXI.BitmapText.font property is deprecated, use fontName, fontSize, tint or align properties"),e){var i={font:e};this._upgradeStyle(i),i.fontSize=i.fontSize||t.BitmapFont.available[i.fontName].size,this._fontName=i.fontName,this._fontSize=i.fontSize,this.dirty=!0}}})}O.B.registerPlugin("accessibility",x),O.B.registerPlugin("extract",N),O.B.registerPlugin("interaction",k),O.B.registerPlugin("particle",gt),O.B.registerPlugin("prepare",Ce),O.B.registerPlugin("batch",O.i),O.B.registerPlugin("tilingSprite",Re),st.registerPlugin(ei),st.registerPlugin(Ae),R.registerPlugin(C.b),R.registerPlugin(ht);var Qi="5.3.10",$i={AlphaFilter:ni,BlurFilter:Ai,BlurFilterPass:Ti,ColorMatrixFilter:Pi,DisplacementFilter:Ii,FXAAFilter:Oi,NoiseFilter:Di}},,,function(t,e,i){"use strict";(function(t){i.d(e,"a",(function(){return m})),i.d(e,"b",(function(){return S})),i.d(e,"c",(function(){return B})),i.d(e,"d",(function(){return s})),i.d(e,"e",(function(){return h})),i.d(e,"f",(function(){return l})),i.d(e,"g",(function(){return c})),i.d(e,"h",(function(){return O})),i.d(e,"i",(function(){return g})),i.d(e,"j",(function(){return F})),i.d(e,"k",(function(){return p})),i.d(e,"l",(function(){return f})),i.d(e,"m",(function(){return U})),i.d(e,"n",(function(){return Y})),i.d(e,"o",(function(){return k})),i.d(e,"p",(function(){return _})),i.d(e,"q",(function(){return D})),i.d(e,"r",(function(){return v})),i.d(e,"s",(function(){return b})),i.d(e,"t",(function(){return x})),i.d(e,"u",(function(){return w})),i.d(e,"v",(function(){return I})),i.d(e,"w",(function(){return E})),i.d(e,"x",(function(){return L})),i.d(e,"y",(function(){return N})),i.d(e,"z",(function(){return R})),i.d(e,"A",(function(){return X})),i.d(e,"B",(function(){return W})),i.d(e,"C",(function(){return P})),i.d(e,"D",(function(){return G})),i.d(e,"E",(function(){return H})),i.d(e,"F",(function(){return V}));var n=i(12),r=!1,o=!1,a="${JSCORE_VERSION}",s=function(t,e){if(!t)throw h(e)},h=function(t){return new Error("Firebase Database ("+a+") INTERNAL ASSERT FAILED: "+t)},u=function(t){for(var e=[],i=0,n=0;n<t.length;n++){var r=t.charCodeAt(n);r<128?e[i++]=r:r<2048?(e[i++]=r>>6|192,e[i++]=63&r|128):55296==(64512&r)&&n+1<t.length&&56320==(64512&t.charCodeAt(n+1))?(r=65536+((1023&r)<<10)+(1023&t.charCodeAt(++n)),e[i++]=r>>18|240,e[i++]=r>>12&63|128,e[i++]=r>>6&63|128,e[i++]=63&r|128):(e[i++]=r>>12|224,e[i++]=r>>6&63|128,e[i++]=63&r|128)}return e},l={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray:function(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var i=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,n=[],r=0;r<t.length;r+=3){var o=t[r],a=r+1<t.length,s=a?t[r+1]:0,h=r+2<t.length,u=h?t[r+2]:0,l=o>>2,c=(3&o)<<4|s>>4,d=(15&s)<<2|u>>6,p=63&u;h||(p=64,a||(d=64)),n.push(i[l],i[c],i[d],i[p])}return n.join("")},encodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(u(t),e)},decodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){for(var e=[],i=0,n=0;i<t.length;){var r=t[i++];if(r<128)e[n++]=String.fromCharCode(r);else if(r>191&&r<224){var o=t[i++];e[n++]=String.fromCharCode((31&r)<<6|63&o)}else if(r>239&&r<365){var a=((7&r)<<18|(63&(o=t[i++]))<<12|(63&(s=t[i++]))<<6|63&t[i++])-65536;e[n++]=String.fromCharCode(55296+(a>>10)),e[n++]=String.fromCharCode(56320+(1023&a))}else{o=t[i++];var s=t[i++];e[n++]=String.fromCharCode((15&r)<<12|(63&o)<<6|63&s)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray:function(t,e){this.init_();for(var i=e?this.charToByteMapWebSafe_:this.charToByteMap_,n=[],r=0;r<t.length;){var o=i[t.charAt(r++)],a=r<t.length?i[t.charAt(r)]:0,s=++r<t.length?i[t.charAt(r)]:64,h=++r<t.length?i[t.charAt(r)]:64;if(++r,null==o||null==a||null==s||null==h)throw Error();var u=o<<2|a>>4;if(n.push(u),64!==s){var l=a<<4&240|s>>2;if(n.push(l),64!==h){var c=s<<6&192|h;n.push(c)}}}return n},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},c=function(t){var e=u(t);return l.encodeByteArray(e,!0)},d=function(t){try{return l.decodeString(t,!0)}catch(t){}return null};function p(t){return f(void 0,t)}function f(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:return new Date(e.getTime());case Object:void 0===t&&(t={});break;case Array:t=[];break;default:return e}for(var i in e)e.hasOwnProperty(i)&&"__proto__"!==i&&(t[i]=f(t[i],e[i]));return t}var m=function(){function t(){var t=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise((function(e,i){t.resolve=e,t.reject=i}))}return t.prototype.wrapCallback=function(t){var e=this;return function(i,n){i?e.reject(i):e.resolve(n),"function"==typeof t&&(e.promise.catch((function(){})),1===t.length?t(i):t(i,n))}},t}();function g(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');var i=e||"demo-project",r=t.iat||0,o=t.sub||t.user_id;if(!o)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");var a=Object(n.a)({iss:"https://securetoken.google.com/"+i,aud:i,iat:r,exp:r+3600,auth_time:r,sub:o,user_id:o,firebase:{sign_in_provider:"custom",identities:{}}},t);return[l.encodeString(JSON.stringify({alg:"none",type:"JWT"}),!1),l.encodeString(JSON.stringify(a),!1),""].join(".")}function y(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function v(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(y())}function b(){try{return"[object process]"===Object.prototype.toString.call(t.process)}catch(t){return!1}}function _(){return"object"==typeof self&&self.self===self}function w(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function x(){return!0===r||!0===o}var C=function(t){function e(i,n,r){var o=t.call(this,n)||this;return o.code=i,o.customData=r,o.name="FirebaseError",Object.setPrototypeOf(o,e.prototype),Error.captureStackTrace&&Error.captureStackTrace(o,S.prototype.create),o}return Object(n.c)(e,t),e}(Error),S=function(){function t(t,e,i){this.service=t,this.serviceName=e,this.errors=i}return t.prototype.create=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var n=e[0]||{},r=this.service+"/"+t,o=this.errors[t],a=o?T(o,n):"Error",s=this.serviceName+": "+a+" ("+r+").",h=new C(r,s,n);return h},t}();function T(t,e){return t.replace(A,(function(t,i){var n=e[i];return null!=n?String(n):"<"+i+"?>"}))}var A=/\{\$([^}]+)}/g;function E(t){return JSON.parse(t)}function P(t){return JSON.stringify(t)}var M=function(t){var e={},i={},n={},r="";try{var o=t.split(".");e=E(d(o[0])||""),i=E(d(o[1])||""),r=o[2],n=i.d||{},delete i.d}catch(t){}return{header:e,claims:i,data:n,signature:r}},I=function(t){var e=M(t).claims;return!!e&&"object"==typeof e&&e.hasOwnProperty("iat")},k=function(t){var e=M(t).claims;return"object"==typeof e&&!0===e.admin};function O(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function R(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}function D(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function L(t,e,i){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=e.call(i,t[r],r,t));return n}function N(t){for(var e=[],i=function(t,i){Array.isArray(i)?i.forEach((function(i){e.push(encodeURIComponent(t)+"="+encodeURIComponent(i))})):e.push(encodeURIComponent(t)+"="+encodeURIComponent(i))},n=0,r=Object.entries(t);n<r.length;n++){var o=r[n];i(o[0],o[1])}return e.length?"&"+e.join("&"):""}var B=function(){function t(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(var t=1;t<this.blockSize;++t)this.pad_[t]=0;this.reset()}return t.prototype.reset=function(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0},t.prototype.compress_=function(t,e){e||(e=0);var i=this.W_;if("string"==typeof t)for(var n=0;n<16;n++)i[n]=t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|t.charCodeAt(e+3),e+=4;else for(n=0;n<16;n++)i[n]=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3],e+=4;for(n=16;n<80;n++){var r=i[n-3]^i[n-8]^i[n-14]^i[n-16];i[n]=4294967295&(r<<1|r>>>31)}var o,a,s=this.chain_[0],h=this.chain_[1],u=this.chain_[2],l=this.chain_[3],c=this.chain_[4];for(n=0;n<80;n++){n<40?n<20?(o=l^h&(u^l),a=1518500249):(o=h^u^l,a=1859775393):n<60?(o=h&u|l&(h|u),a=2400959708):(o=h^u^l,a=3395469782);r=(s<<5|s>>>27)+o+c+a+i[n]&4294967295;c=l,l=u,u=4294967295&(h<<30|h>>>2),h=s,s=r}this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+h&4294967295,this.chain_[2]=this.chain_[2]+u&4294967295,this.chain_[3]=this.chain_[3]+l&4294967295,this.chain_[4]=this.chain_[4]+c&4294967295},t.prototype.update=function(t,e){if(null!=t){void 0===e&&(e=t.length);for(var i=e-this.blockSize,n=0,r=this.buf_,o=this.inbuf_;n<e;){if(0===o)for(;n<=i;)this.compress_(t,n),n+=this.blockSize;if("string"==typeof t){for(;n<e;)if(r[o]=t.charCodeAt(n),++n,++o===this.blockSize){this.compress_(r),o=0;break}}else for(;n<e;)if(r[o]=t[n],++n,++o===this.blockSize){this.compress_(r),o=0;break}}this.inbuf_=o,this.total_+=e}},t.prototype.digest=function(){var t=[],e=8*this.total_;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(var i=this.blockSize-1;i>=56;i--)this.buf_[i]=255&e,e/=256;this.compress_(this.buf_);var n=0;for(i=0;i<5;i++)for(var r=24;r>=0;r-=8)t[n]=this.chain_[i]>>r&255,++n;return t},t}();function F(t,e){var i=new z(t,e);return i.subscribe.bind(i)}var z=function(){function t(t,e){var i=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=e,this.task.then((function(){t(i)})).catch((function(t){i.error(t)}))}return t.prototype.next=function(t){this.forEachObserver((function(e){e.next(t)}))},t.prototype.error=function(t){this.forEachObserver((function(e){e.error(t)})),this.close(t)},t.prototype.complete=function(){this.forEachObserver((function(t){t.complete()})),this.close()},t.prototype.subscribe=function(t,e,i){var n,r=this;if(void 0===t&&void 0===e&&void 0===i)throw new Error("Missing Observer.");void 0===(n=function(t,e){if("object"!=typeof t||null===t)return!1;for(var i=0,n=e;i<n.length;i++){var r=n[i];if(r in t&&"function"==typeof t[r])return!0}return!1}(t,["next","error","complete"])?t:{next:t,error:e,complete:i}).next&&(n.next=j),void 0===n.error&&(n.error=j),void 0===n.complete&&(n.complete=j);var o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((function(){try{r.finalError?n.error(r.finalError):n.complete()}catch(t){}})),this.observers.push(n),o},t.prototype.unsubscribeOne=function(t){void 0!==this.observers&&void 0!==this.observers[t]&&(delete this.observers[t],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},t.prototype.forEachObserver=function(t){if(!this.finalized)for(var e=0;e<this.observers.length;e++)this.sendOne(e,t)},t.prototype.sendOne=function(t,e){var i=this;this.task.then((function(){if(void 0!==i.observers&&void 0!==i.observers[t])try{e(i.observers[t])}catch(t){"undefined"!=typeof console&&console.error}}))},t.prototype.close=function(t){var e=this;this.finalized||(this.finalized=!0,void 0!==t&&(this.finalError=t),this.task.then((function(){e.observers=void 0,e.onNoObservers=void 0})))},t}();function j(){}var G=function(t,e,i,n){var r;if(n<e?r="at least "+e:n>i&&(r=0===i?"none":"no more than "+i),r)throw new Error(t+" failed: Was called with "+n+(1===n?" argument.":" arguments.")+" Expects "+r+".")};function U(t,e){return t+" failed: "+e+" argument "}function H(t,e,i,n){if((!n||i)&&"function"!=typeof i)throw new Error(U(t,e)+"must be a valid function.")}function V(t,e,i,n){if((!n||i)&&("object"!=typeof i||null===i))throw new Error(U(t,e)+"must be a valid context object.")}var W=function(t){for(var e=[],i=0,n=0;n<t.length;n++){var r=t.charCodeAt(n);if(r>=55296&&r<=56319){var o=r-55296;n++,s(n<t.length,"Surrogate pair missing trail surrogate."),r=65536+(o<<10)+(t.charCodeAt(n)-56320)}r<128?e[i++]=r:r<2048?(e[i++]=r>>6|192,e[i++]=63&r|128):r<65536?(e[i++]=r>>12|224,e[i++]=r>>6&63|128,e[i++]=63&r|128):(e[i++]=r>>18|240,e[i++]=r>>12&63|128,e[i++]=r>>6&63|128,e[i++]=63&r|128)}return e},X=function(t){for(var e=0,i=0;i<t.length;i++){var n=t.charCodeAt(i);n<128?e++:n<2048?e+=2:n>=55296&&n<=56319?(e+=4,i++):e+=3}return e};function Y(t){return t&&t._delegate?t._delegate:t}}).call(this,i(82))},function(t,e,i){"use strict";i.r(e),i.d(e,"BaseTextureCache",(function(){return j})),i.d(e,"CanvasRenderTarget",(function(){return H})),i.d(e,"DATA_URI",(function(){return X})),i.d(e,"ProgramCache",(function(){return F})),i.d(e,"TextureCache",(function(){return z})),i.d(e,"clearTextureCache",(function(){return U})),i.d(e,"correctBlendMode",(function(){return w})),i.d(e,"createIndicesForQuads",(function(){return T})),i.d(e,"decomposeDataUri",(function(){return Y})),i.d(e,"deprecation",(function(){return B})),i.d(e,"destroyTextureCache",(function(){return G})),i.d(e,"determineCrossOrigin",(function(){return q})),i.d(e,"getBufferType",(function(){return A})),i.d(e,"getResolutionOfUrl",(function(){return K})),i.d(e,"hex2rgb",(function(){return g})),i.d(e,"hex2string",(function(){return y})),i.d(e,"interleaveTypedArrays",(function(){return P})),i.d(e,"isPow2",(function(){return I})),i.d(e,"isWebGLSupported",(function(){return m})),i.d(e,"log2",(function(){return k})),i.d(e,"nextPow2",(function(){return M})),i.d(e,"premultiplyBlendMode",(function(){return _})),i.d(e,"premultiplyRgba",(function(){return x})),i.d(e,"premultiplyTint",(function(){return C})),i.d(e,"premultiplyTintToRgba",(function(){return S})),i.d(e,"removeItems",(function(){return O})),i.d(e,"rgb2hex",(function(){return b})),i.d(e,"sayHello",(function(){return f})),i.d(e,"sign",(function(){return R})),i.d(e,"skipHello",(function(){return p})),i.d(e,"string2hex",(function(){return v})),i.d(e,"trimCanvas",(function(){return V})),i.d(e,"uid",(function(){return L}));var n=i(15);i.d(e,"isMobile",(function(){return n.a}));var r=i(203),o=i.n(r);i.d(e,"EventEmitter",(function(){return o.a}));var a=i(204),s=i.n(a);i.d(e,"earcut",(function(){return s.a}));var h=i(134),u=i.n(h);i.d(e,"url",(function(){return u.a}));var l=i(5);n.b.RETINA_PREFIX=/@([0-9\.]+)x/,n.b.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!0;var c,d=!1;function p(){d=!0}function f(t){var e;if(!d){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var i=["\n %c %c %c PixiJS 5.3.10 - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %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;"];(e=window.console).log.apply(e,i)}else window.console&&window.console.log("PixiJS 5.3.10 - "+t+" - http://www.pixijs.com/");d=!0}}function m(){return void 0===c&&(c=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:n.b.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),r=!(!i||!i.getContextAttributes().stencil);if(i){var o=i.getExtension("WEBGL_lose_context");o&&o.loseContext()}return i=null,r}catch(t){return!1}}()),c}function g(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 y(t){var e=t.toString(16);return"#"+(e="000000".substr(0,6-e.length)+e)}function v(t){return"string"==typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}function b(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}var _=function(){for(var t=[],e=[],i=0;i<32;i++)t[i]=i,e[i]=i;t[l.b.NORMAL_NPM]=l.b.NORMAL,t[l.b.ADD_NPM]=l.b.ADD,t[l.b.SCREEN_NPM]=l.b.SCREEN,e[l.b.NORMAL]=l.b.NORMAL_NPM,e[l.b.ADD]=l.b.ADD_NPM,e[l.b.SCREEN]=l.b.SCREEN_NPM;var n=[];return n.push(e),n.push(t),n}();function w(t,e){return _[e?1:0][t]}function x(t,e,i,n){return i=i||new Float32Array(4),n||void 0===n?(i[0]=t[0]*e,i[1]=t[1]*e,i[2]=t[2]*e):(i[0]=t[0],i[1]=t[1],i[2]=t[2]),i[3]=e,i}function C(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var i=t>>16&255,n=t>>8&255,r=255&t;return(255*e<<24)+((i=i*e+.5|0)<<16)+((n=n*e+.5|0)<<8)+(r=r*e+.5|0)}function S(t,e,i,n){return(i=i||new Float32Array(4))[0]=(t>>16&255)/255,i[1]=(t>>8&255)/255,i[2]=(255&t)/255,(n||void 0===n)&&(i[0]*=e,i[1]*=e,i[2]*=e),i[3]=e,i}function T(t,e){void 0===e&&(e=null);var i=6*t;if((e=e||new Uint16Array(i)).length!==i)throw new Error("Out buffer length is incorrect, got "+e.length+" and expected "+i);for(var n=0,r=0;n<i;n+=6,r+=4)e[n+0]=r+0,e[n+1]=r+1,e[n+2]=r+2,e[n+3]=r+0,e[n+4]=r+2,e[n+5]=r+3;return e}function A(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}var E={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};function P(t,e){for(var i=0,n=0,r={},o=0;o<t.length;o++)n+=e[o],i+=t[o].length;var a=new ArrayBuffer(4*i),s=null,h=0;for(o=0;o<t.length;o++){var u=e[o],l=t[o],c=A(l);r[c]||(r[c]=new E[c](a)),s=r[c];for(var d=0;d<l.length;d++){s[(d/u|0)*n+h+d%u]=l[d]}h+=u}return new Float32Array(a)}function M(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 I(t){return!(t&t-1||!t)}function k(t){var e=(t>65535?1:0)<<4,i=((t>>>=e)>255?1:0)<<3;return e|=i,e|=i=((t>>>=i)>15?1:0)<<2,(e|=i=((t>>>=i)>3?1:0)<<1)|(t>>>=i)>>1}function O(t,e,i){var n,r=t.length;if(!(e>=r||0===i)){var o=r-(i=e+i>r?r-e:i);for(n=e;n<o;++n)t[n]=t[n+i];t.length=o}}function R(t){return 0===t?0:t<0?-1:1}var D=0;function L(){return++D}var N={};function B(t,e,i){if(void 0===i&&(i=3),!N[e]){var n=(new Error).stack;void 0===n||(n=n.split("\n").splice(i).join("\n"),console.groupCollapsed),N[e]=!0}}var F={},z=Object.create(null),j=Object.create(null);function G(){var t;for(t in z)z[t].destroy();for(t in j)j[t].destroy()}function U(){var t;for(t in z)delete z[t];for(t in j)delete j[t]}var H=function(){function t(t,e,i){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=i||n.b.RESOLUTION,this.resize(t,e)}return t.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},t.prototype.resize=function(t,e){this.canvas.width=t*this.resolution,this.canvas.height=e*this.resolution},t.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(t.prototype,"width",{get:function(){return this.canvas.width},set:function(t){this.canvas.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.canvas.height},set:function(t){this.canvas.height=t},enumerable:!1,configurable:!0}),t}();function V(t){var e,i,n,r=t.width,o=t.height,a=t.getContext("2d"),s=a.getImageData(0,0,r,o).data,h=s.length,u={top:null,left:null,right:null,bottom:null},l=null;for(e=0;e<h;e+=4)0!==s[e+3]&&(i=e/4%r,n=~~(e/4/r),null===u.top&&(u.top=n),(null===u.left||i<u.left)&&(u.left=i),(null===u.right||u.right<i)&&(u.right=i+1),(null===u.bottom||u.bottom<n)&&(u.bottom=n));return null!==u.top&&(r=u.right-u.left,o=u.bottom-u.top+1,l=a.getImageData(u.left,u.top,r,o)),{height:o,width:r,data:l}}var W,X=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i;function Y(t){var e=X.exec(t);if(e)return{mediaType:e[1]?e[1].toLowerCase():void 0,subType:e[2]?e[2].toLowerCase():void 0,charset:e[3]?e[3].toLowerCase():void 0,encoding:e[4]?e[4].toLowerCase():void 0,data:e[5]}}function q(t,e){if(void 0===e&&(e=window.location),0===t.indexOf("data:"))return"";e=e||window.location,W||(W=document.createElement("a")),W.href=t;var i=Object(h.parse)(W.href),n=!i.port&&""===e.port||i.port===e.port;return i.hostname===e.hostname&&n&&i.protocol===e.protocol?"":"anonymous"}function K(t,e){var i=n.b.RETINA_PREFIX.exec(t);return i?parseFloat(i[1]):void 0!==e?e:1}},function(t,e,i){"use strict";var n,r,o,a,s,h,u,l,c,d,p,f,m,g,y,v,b;i.d(e,"a",(function(){return f})),i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return o})),i.d(e,"d",(function(){return m})),i.d(e,"e",(function(){return s})),i.d(e,"f",(function(){return n})),i.d(e,"g",(function(){return h})),i.d(e,"h",(function(){return g})),i.d(e,"i",(function(){return v})),i.d(e,"j",(function(){return p})),i.d(e,"k",(function(){return b})),i.d(e,"l",(function(){return y})),i.d(e,"m",(function(){return r})),i.d(e,"n",(function(){return c})),i.d(e,"o",(function(){return u})),i.d(e,"p",(function(){return l})),i.d(e,"q",(function(){return d})),function(t){t[t.WEBGL_LEGACY=0]="WEBGL_LEGACY",t[t.WEBGL=1]="WEBGL",t[t.WEBGL2=2]="WEBGL2"}(n||(n={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.WEBGL=1]="WEBGL",t[t.CANVAS=2]="CANVAS"}(r||(r={})),function(t){t[t.COLOR=16384]="COLOR",t[t.DEPTH=256]="DEPTH",t[t.STENCIL=1024]="STENCIL"}(o||(o={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.ADD=1]="ADD",t[t.MULTIPLY=2]="MULTIPLY",t[t.SCREEN=3]="SCREEN",t[t.OVERLAY=4]="OVERLAY",t[t.DARKEN=5]="DARKEN",t[t.LIGHTEN=6]="LIGHTEN",t[t.COLOR_DODGE=7]="COLOR_DODGE",t[t.COLOR_BURN=8]="COLOR_BURN",t[t.HARD_LIGHT=9]="HARD_LIGHT",t[t.SOFT_LIGHT=10]="SOFT_LIGHT",t[t.DIFFERENCE=11]="DIFFERENCE",t[t.EXCLUSION=12]="EXCLUSION",t[t.HUE=13]="HUE",t[t.SATURATION=14]="SATURATION",t[t.COLOR=15]="COLOR",t[t.LUMINOSITY=16]="LUMINOSITY",t[t.NORMAL_NPM=17]="NORMAL_NPM",t[t.ADD_NPM=18]="ADD_NPM",t[t.SCREEN_NPM=19]="SCREEN_NPM",t[t.NONE=20]="NONE",t[t.SRC_OVER=0]="SRC_OVER",t[t.SRC_IN=21]="SRC_IN",t[t.SRC_OUT=22]="SRC_OUT",t[t.SRC_ATOP=23]="SRC_ATOP",t[t.DST_OVER=24]="DST_OVER",t[t.DST_IN=25]="DST_IN",t[t.DST_OUT=26]="DST_OUT",t[t.DST_ATOP=27]="DST_ATOP",t[t.ERASE=26]="ERASE",t[t.SUBTRACT=28]="SUBTRACT",t[t.XOR=29]="XOR"}(a||(a={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(s||(s={})),function(t){t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(h||(h={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(u||(u={})),function(t){t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.FLOAT=5126]="FLOAT",t[t.HALF_FLOAT=36193]="HALF_FLOAT"}(l||(l={})),function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(c||(c={})),function(t){t[t.CLAMP=33071]="CLAMP",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(d||(d={})),function(t){t[t.OFF=0]="OFF",t[t.POW2=1]="POW2",t[t.ON=2]="ON"}(p||(p={})),function(t){t[t.NPM=0]="NPM",t[t.UNPACK=1]="UNPACK",t[t.PMA=2]="PMA",t[t.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",t[t.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",t[t.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA"}(f||(f={})),function(t){t[t.NO=0]="NO",t[t.YES=1]="YES",t[t.AUTO=2]="AUTO",t[t.BLEND=0]="BLEND",t[t.CLEAR=1]="CLEAR",t[t.BLIT=2]="BLIT"}(m||(m={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(g||(g={})),function(t){t.LOW="lowp",t.MEDIUM="mediump",t.HIGH="highp"}(y||(y={})),function(t){t[t.NONE=0]="NONE",t[t.SCISSOR=1]="SCISSOR",t[t.STENCIL=2]="STENCIL",t[t.SPRITE=3]="SPRITE"}(v||(v={})),function(t){t[t.NONE=0]="NONE",t[t.LOW=2]="LOW",t[t.MEDIUM=4]="MEDIUM",t[t.HIGH=8]="HIGH"}(b||(b={}))},function(t,e,i){"use strict";function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}i.d(e,"b",(function(){return Ge})),i.d(e,"d",(function(){return di})),i.d(e,"D",(function(){return gi})),i.d(e,"c",(function(){return yi})),i.d(e,"a",(function(){return vi})),i.d(e,"g",(function(){return Qe})),i.d(e,"f",(function(){return He})),i.d(e,"e",(function(){return He})),i.d(e,"B",(function(){return gi})),i.d(e,"C",(function(){return ne})),i.d(e,"n",(function(){return xt})),i.d(e,"s",(function(){return $})),i.d(e,"t",(function(){return tt})),i.d(e,"p",(function(){return U})),i.d(e,"q",(function(){return W})),i.d(e,"w",(function(){return ai})),i.d(e,"v",(function(){return it})),i.d(e,"l",(function(){return Ct})),i.d(e,"z",(function(){return ci})),i.d(e,"j",(function(){return Ee})),i.d(e,"x",(function(){return fe})),i.d(e,"h",(function(){return Ye})),i.d(e,"u",(function(){return mt})),i.d(e,"A",(function(){return Pe})),i.d(e,"k",(function(){return R})),i.d(e,"y",(function(){return St})),i.d(e,"r",(function(){return ht})),i.d(e,"o",(function(){return ni})),i.d(e,"m",(function(){return wt})),i.d(e,"i",(function(){return Te}));var o,a,s,h,u,l,c,d,p,f,m,g,y,v,b,_,w,x,C,S,T,A,E,P,M,I,k,O,R={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},D={duration:.5,overwrite:!1,delay:0},L=1e8,N=2*Math.PI,B=N/4,F=0,z=Math.sqrt,j=Math.cos,G=Math.sin,U=function(t){return"string"==typeof t},H=function(t){return"function"==typeof t},V=function(t){return"number"==typeof t},W=function(t){return void 0===t},X=function(t){return"object"==typeof t},Y=function(t){return!1!==t},q=function(){return"undefined"!=typeof window},K=function(t){return H(t)||U(t)},J="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},Z=Array.isArray,Q=/(?:-?\.?\d|\.)+/gi,$=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,tt=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,et=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,it=/[+-]=-?[.\d]+/,nt=/[^,'"\[\]\s]+/gi,rt=/[\d.+\-=]+(?:e[-+]\d*)*/i,ot={},at={},st=function(t){return(at=Ot(t,ot))&&gi},ht=function(t,e){},ut=function(t,e){return!e&&void 0},lt=function(t,e){return t&&(ot[t]=e)&&at&&(at[t]=e)||ot},ct=function(){return 0},dt={},pt=[],ft={},mt={},gt={},yt=30,vt=[],bt="",_t=function(t){var e,i,n=t[0];if(X(n)||H(n)||(t=[t]),!(e=(n._gsap||{}).harness)){for(i=vt.length;i--&&!vt[i].targetTest(n););e=vt[i]}for(i=t.length;i--;)t[i]&&(t[i]._gsap||(t[i]._gsap=new Ge(t[i],e)))||t.splice(i,1);return t},wt=function(t){return t._gsap||_t(se(t))[0]._gsap},xt=function(t,e,i){return(i=t[e])&&H(i)?t[e]():W(i)&&t.getAttribute&&t.getAttribute(e)||i},Ct=function(t,e){return(t=t.split(",")).forEach(e)||t},St=function(t){return Math.round(1e5*t)/1e5||0},Tt=function(t,e){for(var i=e.length,n=0;t.indexOf(e[n])<0&&++n<i;);return n<i},At=function(){var t,e,i=pt.length,n=pt.slice(0);for(ft={},pt.length=0,t=0;t<i;t++)(e=n[t])&&e._lazy&&(e.render(e._lazy[0],e._lazy[1],!0)._lazy=0)},Et=function(t,e,i,n){pt.length&&At(),t.render(e,i,n),pt.length&&At()},Pt=function(t){var e=parseFloat(t);return(e||0===e)&&(t+"").match(nt).length<2?e:U(t)?t.trim():t},Mt=function(t){return t},It=function(t,e){for(var i in e)i in t||(t[i]=e[i]);return t},kt=function(t,e){for(var i in e)i in t||"duration"===i||"ease"===i||(t[i]=e[i])},Ot=function(t,e){for(var i in e)t[i]=e[i];return t},Rt=function t(e,i){for(var n in i)"__proto__"!==n&&"constructor"!==n&&"prototype"!==n&&(e[n]=X(i[n])?t(e[n]||(e[n]={}),i[n]):i[n]);return e},Dt=function(t,e){var i,n={};for(i in t)i in e||(n[i]=t[i]);return n},Lt=function(t){var e=t.parent||a,i=t.keyframes?kt:It;if(Y(t.inherit))for(;e;)i(t,e.vars.defaults),e=e.parent||e._dp;return t},Nt=function(t,e,i,n){void 0===i&&(i="_first"),void 0===n&&(n="_last");var r=e._prev,o=e._next;r?r._next=o:t[i]===e&&(t[i]=o),o?o._prev=r:t[n]===e&&(t[n]=r),e._next=e._prev=e.parent=null},Bt=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove(t),t._act=0},Ft=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var i=t;i;)i._dirty=1,i=i.parent;return t},zt=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},jt=function(t){return t._repeat?Gt(t._tTime,t=t.duration()+t._rDelay)*t:0},Gt=function(t,e){var i=Math.floor(t/=e);return t&&i===t?i-1:i},Ut=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},Ht=function(t){return t._end=St(t._start+(t._tDur/Math.abs(t._ts||t._rts||1e-8)||0))},Vt=function(t,e){var i=t._dp;return i&&i.smoothChildTiming&&t._ts&&(t._start=St(i._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),Ht(t),i._dirty||Ft(i,t)),t},Wt=function(t,e){var i;if((e._time||e._initted&&!e._dur)&&(i=Ut(t.rawTime(),e),(!e._dur||ie(0,e.totalDuration(),i)-e._tTime>1e-8)&&e.render(i,!0)),Ft(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(i=t;i._dp;)i.rawTime()>=0&&i.totalTime(i._tTime),i=i._dp;t._zTime=-1e-8}},Xt=function(t,e,i,n){return e.parent&&Bt(e),e._start=St((V(i)?i:i||t!==a?$t(t,i,e):t._time)+e._delay),e._end=St(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),function(t,e,i,n,r){void 0===i&&(i="_first"),void 0===n&&(n="_last");var o,a=t[n];if(r)for(o=e[r];a&&a[r]>o;)a=a._prev;a?(e._next=a._next,a._next=e):(e._next=t[i],t[i]=e),e._next?e._next._prev=e:t[n]=e,e._prev=a,e.parent=e._dp=t}(t,e,"_first","_last",t._sort?"_start":0),Kt(e)||(t._recent=e),n||Wt(t,e),t},Yt=function(t,e){return(ot.ScrollTrigger||ht("scrollTrigger",e))&&ot.ScrollTrigger.create(e,t)},qt=function(t,e,i,n){return qe(t,e),t._initted?!i&&t._pt&&(t._dur&&!1!==t.vars.lazy||!t._dur&&t.vars.lazy)&&c!==Pe.frame?(pt.push(t),t._lazy=[e,n],1):void 0:1},Kt=function(t){var e=t.data;return"isFromStart"===e||"isStart"===e},Jt=function(t,e,i,n){var r=t._repeat,o=St(e)||0,a=t._tTime/t._tDur;return a&&!n&&(t._time*=o/t._dur),t._dur=o,t._tDur=r?r<0?1e10:St(o*(r+1)+t._rDelay*r):o,a&&!n?Vt(t,t._tTime=t._tDur*a):t.parent&&Ht(t),i||Ft(t.parent,t),t},Zt=function(t){return t instanceof He?Ft(t):Jt(t,t._dur)},Qt={_start:0,endTime:ct,totalDuration:ct},$t=function t(e,i,n){var r,o,a,s=e.labels,h=e._recent||Qt,u=e.duration()>=L?h.endTime(!1):e._dur;return U(i)&&(isNaN(i)||i in s)?(o=i.charAt(0),a="%"===i.substr(-1),r=i.indexOf("="),"<"===o||">"===o?(r>=0&&(i=i.replace(/=/,"")),("<"===o?h._start:h.endTime(h._repeat>=0))+(parseFloat(i.substr(1))||0)*(a?(r<0?h:n).totalDuration()/100:1)):r<0?(i in s||(s[i]=u),s[i]):(o=parseFloat(i.charAt(r-1)+i.substr(r+1)),a&&n&&(o=o/100*(Z(n)?n[0]:n).totalDuration()),r>1?t(e,i.substr(0,r-1),n)+o:u+o)):null==i?u:+i},te=function(t,e,i){var n,r,o=V(e[1]),a=(o?2:1)+(t<2?0:1),s=e[a];if(o&&(s.duration=e[1]),s.parent=i,t){for(n=s,r=i;r&&!("immediateRender"in n);)n=r.vars.defaults||{},r=Y(r.vars.inherit)&&r.parent;s.immediateRender=Y(n.immediateRender),t<2?s.runBackwards=1:s.startAt=e[a-1]}return new Qe(e[0],s,e[a+1])},ee=function(t,e){return t||0===t?e(t):e},ie=function(t,e,i){return i<t?t:i>e?e:i},ne=function(t){if("string"!=typeof t)return"";var e=rt.exec(t);return e?t.substr(e.index+e[0].length):""},re=[].slice,oe=function(t,e){return t&&X(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&X(t[0]))&&!t.nodeType&&t!==s},ae=function(t,e,i){return void 0===i&&(i=[]),t.forEach((function(t){var n;return U(t)&&!e||oe(t,1)?(n=i).push.apply(n,se(t)):i.push(t)}))||i},se=function(t,e,i){return!U(t)||i||!h&&Me()?Z(t)?ae(t,i):oe(t)?re.call(t,0):t?[t]:[]:re.call((e||u).querySelectorAll(t),0)},he=function(t){return t.sort((function(){return.5-Math.random()}))},ue=function(t){if(H(t))return t;var e=X(t)?t:{each:t},i=Ne(e.ease),n=e.from||0,r=parseFloat(e.base)||0,o={},a=n>0&&n<1,s=isNaN(n)||a,h=e.axis,u=n,l=n;return U(n)?u=l={center:.5,edges:.5,end:1}[n]||0:!a&&s&&(u=n[0],l=n[1]),function(t,a,c){var d,p,f,m,g,y,v,b,_,w=(c||e).length,x=o[w];if(!x){if(!(_="auto"===e.grid?0:(e.grid||[1,L])[1])){for(v=-L;v<(v=c[_++].getBoundingClientRect().left)&&_<w;);_--}for(x=o[w]=[],d=s?Math.min(_,w)*u-.5:n%_,p=s?w*l/_-.5:n/_|0,v=0,b=L,y=0;y<w;y++)f=y%_-d,m=p-(y/_|0),x[y]=g=h?Math.abs("y"===h?m:f):z(f*f+m*m),g>v&&(v=g),g<b&&(b=g);"random"===n&&he(x),x.max=v-b,x.min=b,x.v=w=(parseFloat(e.amount)||parseFloat(e.each)*(_>w?w-1:h?"y"===h?w/_:_:Math.max(_,w/_))||0)*("edges"===n?-1:1),x.b=w<0?r-w:r,x.u=ne(e.amount||e.each)||0,i=i&&w<0?De(i):i}return w=(x[t]-x.min)/x.max||0,St(x.b+(i?i(w):w)*x.v)+x.u}},le=function(t){var e=t<1?Math.pow(10,(t+"").length-2):1;return function(i){var n=Math.round(parseFloat(i)/t)*t*e;return(n-n%1)/e+(V(i)?0:ne(i))}},ce=function(t,e){var i,n,r=Z(t);return!r&&X(t)&&(i=r=t.radius||L,t.values?(t=se(t.values),(n=!V(t[0]))&&(i*=i)):t=le(t.increment)),ee(e,r?H(t)?function(e){return n=t(e),Math.abs(n-e)<=i?n:e}:function(e){for(var r,o,a=parseFloat(n?e.x:e),s=parseFloat(n?e.y:0),h=L,u=0,l=t.length;l--;)(r=n?(r=t[l].x-a)*r+(o=t[l].y-s)*o:Math.abs(t[l]-a))<h&&(h=r,u=l);return u=!i||h<=i?t[u]:e,n||u===e||V(e)?u:u+ne(e)}:le(t))},de=function(t,e,i,n){return ee(Z(t)?!e:!0===i?!!(i=0):!n,(function(){return Z(t)?t[~~(Math.random()*t.length)]:(i=i||1e-5)&&(n=i<1?Math.pow(10,(i+"").length-2):1)&&Math.floor(Math.round((t-i/2+Math.random()*(e-t+.99*i))/i)*i*n)/n}))},pe=function(t,e,i){return ee(i,(function(i){return t[~~e(i)]}))},fe=function(t){for(var e,i,n,r,o=0,a="";~(e=t.indexOf("random(",o));)n=t.indexOf(")",e),r="["===t.charAt(e+7),i=t.substr(e+7,n-e-7).match(r?nt:Q),a+=t.substr(o,e-o)+de(r?i:+i[0],r?0:+i[1],+i[2]||1e-5),o=n+1;return a+t.substr(o,t.length-o)},me=function(t,e,i,n,r){var o=e-t,a=n-i;return ee(r,(function(e){return i+((e-t)/o*a||0)}))},ge=function(t,e,i){var n,r,o,a=t.labels,s=L;for(n in a)(r=a[n]-e)<0==!!i&&r&&s>(r=Math.abs(r))&&(o=n,s=r);return o},ye=function(t,e,i){var n,r,o=t.vars,a=o[e];if(a)return n=o[e+"Params"],r=o.callbackScope||t,i&&pt.length&&At(),n?a.apply(r,n):a.call(r)},ve=function(t){return Bt(t),t.scrollTrigger&&t.scrollTrigger.kill(!1),t.progress()<1&&ye(t,"onInterrupt"),t},be=function(t){var e=(t=!t.name&&t.default||t).name,i=H(t),n=e&&!i&&t.init?function(){this._props=[]}:t,r={init:ct,render:si,add:Xe,kill:ui,modifier:hi,rawVars:0},o={targetTest:0,get:0,getSetter:ni,aliases:{},register:0};if(Me(),t!==n){if(mt[e])return;It(n,It(Dt(t,r),o)),Ot(n.prototype,Ot(r,Dt(t,o))),mt[n.prop=e]=n,t.targetTest&&(vt.push(n),dt[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}lt(e,n),t.register&&t.register(gi,n,di)},_e={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},we=function(t,e,i){return 255*(6*(t=t<0?t+1:t>1?t-1:t)<1?e+(i-e)*t*6:t<.5?i:3*t<2?e+(i-e)*(2/3-t)*6:e)+.5|0},xe=function(t,e,i){var n,r,o,a,s,h,u,l,c,d,p=t?V(t)?[t>>16,t>>8&255,255&t]:0:_e.black;if(!p){if(","===t.substr(-1)&&(t=t.substr(0,t.length-1)),_e[t])p=_e[t];else if("#"===t.charAt(0)){if(t.length<6&&(n=t.charAt(1),r=t.charAt(2),o=t.charAt(3),t="#"+n+n+r+r+o+o+(5===t.length?t.charAt(4)+t.charAt(4):"")),9===t.length)return[(p=parseInt(t.substr(1,6),16))>>16,p>>8&255,255&p,parseInt(t.substr(7),16)/255];p=[(t=parseInt(t.substr(1),16))>>16,t>>8&255,255&t]}else if("hsl"===t.substr(0,3))if(p=d=t.match(Q),e){if(~t.indexOf("="))return p=t.match($),i&&p.length<4&&(p[3]=1),p}else a=+p[0]%360/360,s=+p[1]/100,n=2*(h=+p[2]/100)-(r=h<=.5?h*(s+1):h+s-h*s),p.length>3&&(p[3]*=1),p[0]=we(a+1/3,n,r),p[1]=we(a,n,r),p[2]=we(a-1/3,n,r);else p=t.match(Q)||_e.transparent;p=p.map(Number)}return e&&!d&&(n=p[0]/255,r=p[1]/255,o=p[2]/255,h=((u=Math.max(n,r,o))+(l=Math.min(n,r,o)))/2,u===l?a=s=0:(c=u-l,s=h>.5?c/(2-u-l):c/(u+l),a=u===n?(r-o)/c+(r<o?6:0):u===r?(o-n)/c+2:(n-r)/c+4,a*=60),p[0]=~~(a+.5),p[1]=~~(100*s+.5),p[2]=~~(100*h+.5)),i&&p.length<4&&(p[3]=1),p},Ce=function(t){var e=[],i=[],n=-1;return t.split(Te).forEach((function(t){var r=t.match(tt)||[];e.push.apply(e,r),i.push(n+=r.length+1)})),e.c=i,e},Se=function(t,e,i){var n,r,o,a,s="",h=(t+s).match(Te),u=e?"hsla(":"rgba(",l=0;if(!h)return t;if(h=h.map((function(t){return(t=xe(t,e,1))&&u+(e?t[0]+","+t[1]+"%,"+t[2]+"%,"+t[3]:t.join(","))+")"})),i&&(o=Ce(t),(n=i.c).join(s)!==o.c.join(s)))for(a=(r=t.replace(Te,"1").split(tt)).length-1;l<a;l++)s+=r[l]+(~n.indexOf(l)?h.shift()||u+"0,0,0,0)":(o.length?o:h.length?h:i).shift());if(!r)for(a=(r=t.split(Te)).length-1;l<a;l++)s+=r[l]+h[l];return s+r[a]},Te=function(){var t,e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b";for(t in _e)e+="|"+t+"\\b";return new RegExp(e+")","gi")}(),Ae=/hsl[a]?\(/,Ee=function(t){var e,i=t.join(" ");if(Te.lastIndex=0,Te.test(i))return e=Ae.test(i),t[1]=Se(t[1],e),t[0]=Se(t[0],e,Ce(t[1])),!0},Pe=(_=Date.now,w=500,x=33,C=_(),S=C,A=T=1e3/240,P=function t(e){var i,n,r,o,a=_()-S,s=!0===e;if(a>w&&(C+=a-x),((i=(r=(S+=a)-C)-A)>0||s)&&(o=++y.frame,v=r-1e3*y.time,y.time=r/=1e3,A+=i+(i>=T?4:T-i),n=1),s||(f=m(t)),n)for(b=0;b<E.length;b++)E[b](r,v,o,e)},y={time:0,frame:0,tick:function(){P(!0)},deltaRatio:function(t){return v/(1e3/(t||60))},wake:function(){l&&(!h&&q()&&(s=h=window,u=s.document||{},ot.gsap=gi,(s.gsapVersions||(s.gsapVersions=[])).push(gi.version),st(at||s.GreenSockGlobals||!s.gsap&&s||{}),g=s.requestAnimationFrame),f&&y.sleep(),m=g||function(t){return setTimeout(t,A-1e3*y.time+1|0)},p=1,P(2))},sleep:function(){(g?s.cancelAnimationFrame:clearTimeout)(f),p=0,m=ct},lagSmoothing:function(t,e){w=t||1/1e-8,x=Math.min(e,w,0)},fps:function(t){T=1e3/(t||240),A=1e3*y.time+T},add:function(t){E.indexOf(t)<0&&E.push(t),Me()},remove:function(t){var e;~(e=E.indexOf(t))&&E.splice(e,1)&&b>=e&&b--},_listeners:E=[]}),Me=function(){return!p&&Pe.wake()},Ie={},ke=/^[\d.\-M][\d.\-,\s]/,Oe=/["']/g,Re=function(t){for(var e,i,n,r={},o=t.substr(1,t.length-3).split(":"),a=o[0],s=1,h=o.length;s<h;s++)i=o[s],e=s!==h-1?i.lastIndexOf(","):i.length,n=i.substr(0,e),r[a]=isNaN(n)?n.replace(Oe,"").trim():+n,a=i.substr(e+1).trim();return r},De=function(t){return function(e){return 1-t(1-e)}},Le=function t(e,i){for(var n,r=e._first;r;)r instanceof He?t(r,i):!r.vars.yoyoEase||r._yoyo&&r._repeat||r._yoyo===i||(r.timeline?t(r.timeline,i):(n=r._ease,r._ease=r._yEase,r._yEase=n,r._yoyo=i)),r=r._next},Ne=function(t,e){return t&&(H(t)?t:Ie[t]||function(t){var e,i,n,r,o=(t+"").split("("),a=Ie[o[0]];return a&&o.length>1&&a.config?a.config.apply(null,~t.indexOf("{")?[Re(o[1])]:(e=t,i=e.indexOf("(")+1,n=e.indexOf(")"),r=e.indexOf("(",i),e.substring(i,~r&&r<n?e.indexOf(")",n+1):n)).split(",").map(Pt)):Ie._CE&&ke.test(t)?Ie._CE("",t):a}(t))||e},Be=function(t,e,i,n){void 0===i&&(i=function(t){return 1-e(1-t)}),void 0===n&&(n=function(t){return t<.5?e(2*t)/2:1-e(2*(1-t))/2});var r,o={easeIn:e,easeOut:i,easeInOut:n};return Ct(t,(function(t){for(var e in Ie[t]=ot[t]=o,Ie[r=t.toLowerCase()]=i,o)Ie[r+("easeIn"===e?".in":"easeOut"===e?".out":".inOut")]=Ie[t+"."+e]=o[e]})),o},Fe=function(t){return function(e){return e<.5?(1-t(1-2*e))/2:.5+t(2*(e-.5))/2}},ze=function t(e,i,n){var r=i>=1?i:1,o=(n||(e?.3:.45))/(i<1?i:1),a=o/N*(Math.asin(1/r)||0),s=function(t){return 1===t?1:r*Math.pow(2,-10*t)*G((t-a)*o)+1},h="out"===e?s:"in"===e?function(t){return 1-s(1-t)}:Fe(s);return o=N/o,h.config=function(i,n){return t(e,i,n)},h},je=function t(e,i){void 0===i&&(i=1.70158);var n=function(t){return t?--t*t*((i+1)*t+i)+1:0},r="out"===e?n:"in"===e?function(t){return 1-n(1-t)}:Fe(n);return r.config=function(i){return t(e,i)},r};Ct("Linear,Quad,Cubic,Quart,Quint,Strong",(function(t,e){var i=e<5?e+1:e;Be(t+",Power"+(i-1),e?function(t){return Math.pow(t,i)}:function(t){return t},(function(t){return 1-Math.pow(1-t,i)}),(function(t){return t<.5?Math.pow(2*t,i)/2:1-Math.pow(2*(1-t),i)/2}))})),Ie.Linear.easeNone=Ie.none=Ie.Linear.easeIn,Be("Elastic",ze("in"),ze("out"),ze()),M=7.5625,k=1/(I=2.75),Be("Bounce",(function(t){return 1-O(1-t)}),O=function(t){return t<k?M*t*t:t<.7272727272727273?M*Math.pow(t-1.5/I,2)+.75:t<.9090909090909092?M*(t-=2.25/I)*t+.9375:M*Math.pow(t-2.625/I,2)+.984375}),Be("Expo",(function(t){return t?Math.pow(2,10*(t-1)):0})),Be("Circ",(function(t){return-(z(1-t*t)-1)})),Be("Sine",(function(t){return 1===t?1:1-j(t*B)})),Be("Back",je("in"),je("out"),je()),Ie.SteppedEase=Ie.steps=ot.SteppedEase={config:function(t,e){void 0===t&&(t=1);var i=1/t,n=t+(e?0:1),r=e?1:0;return function(t){return((n*ie(0,1-1e-8,t)|0)+r)*i}}},D.ease=Ie["quad.out"],Ct("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",(function(t){return bt+=t+","+t+"Params,"}));var Ge=function(t,e){this.id=F++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:xt,this.set=e?e.getSetter:ni},Ue=function(){function t(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,Jt(this,+t.duration,1,1),this.data=t.data,p||Pe.wake()}var e=t.prototype;return e.delay=function(t){return t||0===t?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay},e.duration=function(t){return arguments.length?this.totalDuration(this._repeat>0?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},e.totalDuration=function(t){return arguments.length?(this._dirty=0,Jt(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(t,e){if(Me(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(Vt(this,t),!i._dp||i.parent||Wt(i,this);i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&t<this._tDur||this._ts<0&&t>0||!this._tDur&&!t)&&Xt(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!e||this._initted&&1e-8===Math.abs(this._zTime)||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),Et(this,t,e)),this},e.time=function(t,e){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+jt(this))%(this._dur+this._rDelay)||(t?this._dur:0),e):this._time},e.totalProgress=function(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.ratio},e.progress=function(t,e){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?t:1-t)+jt(this),e):this.duration()?Math.min(1,this._time/this._dur):this.ratio},e.iteration=function(t,e){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*i,e):this._repeat?Gt(this._tTime,i)+1:1},e.timeScale=function(t){if(!arguments.length)return-1e-8===this._rts?0:this._rts;if(this._rts===t)return this;var e=this.parent&&this._ts?Ut(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||-1e-8===t?0:this._rts,zt(this.totalTime(ie(-this._delay,this._tDur,e),!0))},e.paused=function(t){return arguments.length?(this._ps!==t&&(this._ps=t,t?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Me(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&1e-8!==Math.abs(this._zTime)&&(this._tTime-=1e-8)))),this):this._ps},e.startTime=function(t){if(arguments.length){this._start=t;var e=this.parent||this._dp;return e&&(e._sort||!this.parent)&&Xt(e,this,t-this._delay),this}return this._start},e.endTime=function(t){return this._start+(Y(t)?this.totalDuration():this.duration())/Math.abs(this._ts)},e.rawTime=function(t){var e=this.parent||this._dp;return e?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Ut(e.rawTime(t),this):this._tTime:this._tTime},e.globalTime=function(t){for(var e=this,i=arguments.length?t:e.rawTime();e;)i=e._start+i/(e._ts||1),e=e._dp;return i},e.repeat=function(t){return arguments.length?(this._repeat=t===1/0?-2:t,Zt(this)):-2===this._repeat?1/0:this._repeat},e.repeatDelay=function(t){if(arguments.length){var e=this._time;return this._rDelay=t,Zt(this),e?this.time(e):this}return this._rDelay},e.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},e.seek=function(t,e){return this.totalTime($t(this,t),Y(e))},e.restart=function(t,e){return this.play().totalTime(t?-this._delay:0,Y(e))},e.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},e.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},e.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-1e-8:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-1e-8,this},e.isActive=function(){var t,e=this.parent||this._dp,i=this._start;return!(e&&!(this._ts&&this._initted&&e.isActive()&&(t=e.rawTime(!0))>=i&&t<this.endTime(!0)-1e-8))},e.eventCallback=function(t,e,i){var n=this.vars;return arguments.length>1?(e?(n[t]=e,i&&(n[t+"Params"]=i),"onUpdate"===t&&(this._onUpdate=e)):delete n[t],this):n[t]},e.then=function(t){var e=this;return new Promise((function(i){var n=H(t)?t:Mt,r=function(){var t=e.then;e.then=null,H(n)&&(n=n(e))&&(n.then||n===e)&&(e.then=t),i(n),e.then=t};e._initted&&1===e.totalProgress()&&e._ts>=0||!e._tTime&&e._ts<0?r():e._prom=r}))},e.kill=function(){ve(this)},t}();It(Ue.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-1e-8,_prom:0,_ps:!1,_rts:1});var He=function(t){function e(e,i){var r;return void 0===e&&(e={}),(r=t.call(this,e)||this).labels={},r.smoothChildTiming=!!e.smoothChildTiming,r.autoRemoveChildren=!!e.autoRemoveChildren,r._sort=Y(e.sortChildren),a&&Xt(e.parent||a,n(r),i),e.reversed&&r.reverse(),e.paused&&r.paused(!0),e.scrollTrigger&&Yt(n(r),e.scrollTrigger),r}r(e,t);var i=e.prototype;return i.to=function(t,e,i){return te(0,arguments,this),this},i.from=function(t,e,i){return te(1,arguments,this),this},i.fromTo=function(t,e,i,n){return te(2,arguments,this),this},i.set=function(t,e,i){return e.duration=0,e.parent=this,Lt(e).repeatDelay||(e.repeat=0),e.immediateRender=!!e.immediateRender,new Qe(t,e,$t(this,i),1),this},i.call=function(t,e,i){return Xt(this,Qe.delayedCall(0,t,e),i)},i.staggerTo=function(t,e,i,n,r,o,a){return i.duration=e,i.stagger=i.stagger||n,i.onComplete=o,i.onCompleteParams=a,i.parent=this,new Qe(t,i,$t(this,r)),this},i.staggerFrom=function(t,e,i,n,r,o,a){return i.runBackwards=1,Lt(i).immediateRender=Y(i.immediateRender),this.staggerTo(t,e,i,n,r,o,a)},i.staggerFromTo=function(t,e,i,n,r,o,a,s){return n.startAt=i,Lt(n).immediateRender=Y(n.immediateRender),this.staggerTo(t,e,n,r,o,a,s)},i.render=function(t,e,i){var n,r,o,s,h,u,l,c,d,p,f,m,g=this._time,y=this._dirty?this.totalDuration():this._tDur,v=this._dur,b=this!==a&&t>y-1e-8&&t>=0?y:t<1e-8?0:t,_=this._zTime<0!=t<0&&(this._initted||!v);if(b!==this._tTime||i||_){if(g!==this._time&&v&&(b+=this._time-g,t+=this._time-g),n=b,d=this._start,u=!(c=this._ts),_&&(v||(g=this._zTime),(t||!e)&&(this._zTime=t)),this._repeat){if(f=this._yoyo,h=v+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*h+t,e,i);if(n=St(b%h),b===y?(s=this._repeat,n=v):((s=~~(b/h))&&s===b/h&&(n=v,s--),n>v&&(n=v)),p=Gt(this._tTime,h),!g&&this._tTime&&p!==s&&(p=s),f&&1&s&&(n=v-n,m=1),s!==p&&!this._lock){var w=f&&1&p,x=w===(f&&1&s);if(s<p&&(w=!w),g=w?0:v,this._lock=1,this.render(g||(m?0:St(s*h)),e,!v)._lock=0,this._tTime=b,!e&&this.parent&&ye(this,"onRepeat"),this.vars.repeatRefresh&&!m&&(this.invalidate()._lock=1),g&&g!==this._time||u!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(v=this._dur,y=this._tDur,x&&(this._lock=2,g=w?v:-1e-4,this.render(g,!0),this.vars.repeatRefresh&&!m&&this.invalidate()),this._lock=0,!this._ts&&!u)return this;Le(this,m)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(l=function(t,e,i){var n;if(i>e)for(n=t._first;n&&n._start<=i;){if(!n._dur&&"isPause"===n.data&&n._start>e)return n;n=n._next}else for(n=t._last;n&&n._start>=i;){if(!n._dur&&"isPause"===n.data&&n._start<e)return n;n=n._prev}}(this,St(g),St(n)))&&(b-=n-(n=l._start)),this._tTime=b,this._time=n,this._act=!c,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=t,g=0),!g&&n&&!e&&(ye(this,"onStart"),this._tTime!==b))return this;if(n>=g&&t>=0)for(r=this._first;r;){if(o=r._next,(r._act||n>=r._start)&&r._ts&&l!==r){if(r.parent!==this)return this.render(t,e,i);if(r.render(r._ts>0?(n-r._start)*r._ts:(r._dirty?r.totalDuration():r._tDur)+(n-r._start)*r._ts,e,i),n!==this._time||!this._ts&&!u){l=0,o&&(b+=this._zTime=-1e-8);break}}r=o}else{r=this._last;for(var C=t<0?t:n;r;){if(o=r._prev,(r._act||C<=r._end)&&r._ts&&l!==r){if(r.parent!==this)return this.render(t,e,i);if(r.render(r._ts>0?(C-r._start)*r._ts:(r._dirty?r.totalDuration():r._tDur)+(C-r._start)*r._ts,e,i),n!==this._time||!this._ts&&!u){l=0,o&&(b+=this._zTime=C?-1e-8:1e-8);break}}r=o}}if(l&&!e&&(this.pause(),l.render(n>=g?0:-1e-8)._zTime=n>=g?1:-1,this._ts))return this._start=d,Ht(this),this.render(t,e,i);this._onUpdate&&!e&&ye(this,"onUpdate",!0),(b===y&&y>=this.totalDuration()||!b&&g)&&(d!==this._start&&Math.abs(c)===Math.abs(this._ts)||this._lock||((t||!v)&&(b===y&&this._ts>0||!b&&this._ts<0)&&Bt(this,1),e||t<0&&!g||!b&&!g&&y||(ye(this,b===y&&t>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(b<y&&this.timeScale()>0)&&this._prom())))}return this},i.add=function(t,e){var i=this;if(V(e)||(e=$t(this,e,t)),!(t instanceof Ue)){if(Z(t))return t.forEach((function(t){return i.add(t,e)})),this;if(U(t))return this.addLabel(t,e);if(!H(t))return this;t=Qe.delayedCall(0,t)}return this!==t?Xt(this,t,e):this},i.getChildren=function(t,e,i,n){void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===n&&(n=-L);for(var r=[],o=this._first;o;)o._start>=n&&(o instanceof Qe?e&&r.push(o):(i&&r.push(o),t&&r.push.apply(r,o.getChildren(!0,e,i)))),o=o._next;return r},i.getById=function(t){for(var e=this.getChildren(1,1,1),i=e.length;i--;)if(e[i].vars.id===t)return e[i]},i.remove=function(t){return U(t)?this.removeLabel(t):H(t)?this.killTweensOf(t):(Nt(this,t),t===this._recent&&(this._recent=this._last),Ft(this))},i.totalTime=function(e,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=St(Pe.time-(this._ts>0?e/this._ts:(this.totalDuration()-e)/-this._ts))),t.prototype.totalTime.call(this,e,i),this._forcing=0,this):this._tTime},i.addLabel=function(t,e){return this.labels[t]=$t(this,e),this},i.removeLabel=function(t){return delete this.labels[t],this},i.addPause=function(t,e,i){var n=Qe.delayedCall(0,e||ct,i);return n.data="isPause",this._hasPause=1,Xt(this,n,$t(this,t))},i.removePause=function(t){var e=this._first;for(t=$t(this,t);e;)e._start===t&&"isPause"===e.data&&Bt(e),e=e._next},i.killTweensOf=function(t,e,i){for(var n=this.getTweensOf(t,i),r=n.length;r--;)Ve!==n[r]&&n[r].kill(t,e);return this},i.getTweensOf=function(t,e){for(var i,n=[],r=se(t),o=this._first,a=V(e);o;)o instanceof Qe?Tt(o._targets,r)&&(a?(!Ve||o._initted&&o._ts)&&o.globalTime(0)<=e&&o.globalTime(o.totalDuration())>e:!e||o.isActive())&&n.push(o):(i=o.getTweensOf(r,e)).length&&n.push.apply(n,i),o=o._next;return n},i.tweenTo=function(t,e){e=e||{};var i,n=this,r=$t(n,t),o=e,a=o.startAt,s=o.onStart,h=o.onStartParams,u=o.immediateRender,l=Qe.to(n,It({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:r,overwrite:"auto",duration:e.duration||Math.abs((r-(a&&"time"in a?a.time:n._time))/n.timeScale())||1e-8,onStart:function(){if(n.pause(),!i){var t=e.duration||Math.abs((r-(a&&"time"in a?a.time:n._time))/n.timeScale());l._dur!==t&&Jt(l,t,0,1).render(l._time,!0,!0),i=1}s&&s.apply(l,h||[])}},e));return u?l.render(0):l},i.tweenFromTo=function(t,e,i){return this.tweenTo(e,It({startAt:{time:$t(this,t)}},i))},i.recent=function(){return this._recent},i.nextLabel=function(t){return void 0===t&&(t=this._time),ge(this,$t(this,t))},i.previousLabel=function(t){return void 0===t&&(t=this._time),ge(this,$t(this,t),1)},i.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+1e-8)},i.shiftChildren=function(t,e,i){void 0===i&&(i=0);for(var n,r=this._first,o=this.labels;r;)r._start>=i&&(r._start+=t,r._end+=t),r=r._next;if(e)for(n in o)o[n]>=i&&(o[n]+=t);return Ft(this)},i.invalidate=function(){var e=this._first;for(this._lock=0;e;)e.invalidate(),e=e._next;return t.prototype.invalidate.call(this)},i.clear=function(t){void 0===t&&(t=!0);for(var e,i=this._first;i;)e=i._next,this.remove(i),i=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),Ft(this)},i.totalDuration=function(t){var e,i,n,r=0,o=this,s=o._last,h=L;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-t:t));if(o._dirty){for(n=o.parent;s;)e=s._prev,s._dirty&&s.totalDuration(),(i=s._start)>h&&o._sort&&s._ts&&!o._lock?(o._lock=1,Xt(o,s,i-s._delay,1)._lock=0):h=i,i<0&&s._ts&&(r-=i,(!n&&!o._dp||n&&n.smoothChildTiming)&&(o._start+=i/o._ts,o._time-=i,o._tTime-=i),o.shiftChildren(-i,!1,-Infinity),h=0),s._end>r&&s._ts&&(r=s._end),s=e;Jt(o,o===a&&o._time>r?o._time:r,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(t){if(a._ts&&(Et(a,Ut(t,a)),c=Pe.frame),Pe.frame>=yt){yt+=R.autoSleep||120;var e=a._first;if((!e||!e._ts)&&R.autoSleep&&Pe._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||Pe.sleep()}}},e}(Ue);It(He.prototype,{_lock:0,_hasPause:0,_forcing:0});var Ve,We=function(t,e,i,n,r,o,a){var s,h,u,l,c,d,p,f,m=new di(this._pt,t,e,0,1,ai,null,r),g=0,y=0;for(m.b=i,m.e=n,i+="",(p=~(n+="").indexOf("random("))&&(n=fe(n)),o&&(o(f=[i,n],t,e),i=f[0],n=f[1]),h=i.match(et)||[];s=et.exec(n);)l=s[0],c=n.substring(g,s.index),u?u=(u+1)%5:"rgba("===c.substr(-5)&&(u=1),l!==h[y++]&&(d=parseFloat(h[y-1])||0,m._pt={_next:m._pt,p:c||1===y?c:",",s:d,c:"="===l.charAt(1)?parseFloat(l.substr(2))*("-"===l.charAt(0)?-1:1):parseFloat(l)-d,m:u&&u<4?Math.round:0},g=et.lastIndex);return m.c=g<n.length?n.substring(g,n.length):"",m.fp=a,(it.test(n)||p)&&(m.e=0),this._pt=m,m},Xe=function(t,e,i,n,r,o,a,s,h){H(n)&&(n=n(r||0,t,o));var u,l=t[e],c="get"!==i?i:H(l)?h?t[e.indexOf("set")||!H(t["get"+e.substr(3)])?e:"get"+e.substr(3)](h):t[e]():l,d=H(l)?h?ei:ti:$e;if(U(n)&&(~n.indexOf("random(")&&(n=fe(n)),"="===n.charAt(1)&&((u=parseFloat(c)+parseFloat(n.substr(2))*("-"===n.charAt(0)?-1:1)+(ne(c)||0))||0===u)&&(n=u)),c!==n)return isNaN(c*n)||""===n?(!l&&!(e in t)&&ht(e,n),We.call(this,t,e,c,n,d,s||R.stringFilter,h)):(u=new di(this._pt,t,e,+c||0,n-(c||0),"boolean"==typeof l?oi:ri,0,d),h&&(u.fp=h),a&&u.modifier(a,this,t),this._pt=u)},Ye=function(t,e,i,n,r,o){var a,s,h,u;if(mt[t]&&!1!==(a=new mt[t]).init(r,a.rawVars?e[t]:function(t,e,i,n,r){if(H(t)&&(t=Ke(t,r,e,i,n)),!X(t)||t.style&&t.nodeType||Z(t)||J(t))return U(t)?Ke(t,r,e,i,n):t;var o,a={};for(o in t)a[o]=Ke(t[o],r,e,i,n);return a}(e[t],n,r,o,i),i,n,o)&&(i._pt=s=new di(i._pt,r,t,0,1,a.render,a,0,a.priority),i!==d))for(h=i._ptLookup[i._targets.indexOf(r)],u=a._props.length;u--;)h[a._props[u]]=s;return a},qe=function t(e,i){var n,r,s,h,u,l,c,d,p,f,m,g,y,v=e.vars,b=v.ease,_=v.startAt,w=v.immediateRender,x=v.lazy,C=v.onUpdate,S=v.onUpdateParams,T=v.callbackScope,A=v.runBackwards,E=v.yoyoEase,P=v.keyframes,M=v.autoRevert,I=e._dur,k=e._startAt,O=e._targets,R=e.parent,L=R&&"nested"===R.data?R.parent._targets:O,N="auto"===e._overwrite&&!o,B=e.timeline;if(B&&(!P||!b)&&(b="none"),e._ease=Ne(b,D.ease),e._yEase=E?De(Ne(!0===E?b:E,D.ease)):0,E&&e._yoyo&&!e._repeat&&(E=e._yEase,e._yEase=e._ease,e._ease=E),e._from=!B&&!!v.runBackwards,!B){if(g=(d=O[0]?wt(O[0]).harness:0)&&v[d.prop],n=Dt(v,dt),k&&k.render(-1,!0).kill(),_)if(Bt(e._startAt=Qe.set(O,It({data:"isStart",overwrite:!1,parent:R,immediateRender:!0,lazy:Y(x),startAt:null,delay:0,onUpdate:C,onUpdateParams:S,callbackScope:T,stagger:0},_))),i<0&&!w&&!M&&e._startAt.render(-1,!0),w){if(i>0&&!M&&(e._startAt=0),I&&i<=0)return void(i&&(e._zTime=i))}else!1===M&&(e._startAt=0);else if(A&&I)if(k)!M&&(e._startAt=0);else if(i&&(w=!1),s=It({overwrite:!1,data:"isFromStart",lazy:w&&Y(x),immediateRender:w,stagger:0,parent:R},n),g&&(s[d.prop]=g),Bt(e._startAt=Qe.set(O,s)),i<0&&e._startAt.render(-1,!0),w){if(!i)return}else t(e._startAt,1e-8);for(e._pt=0,x=I&&Y(x)||x&&!I,r=0;r<O.length;r++){if(c=(u=O[r])._gsap||_t(O)[r]._gsap,e._ptLookup[r]=f={},ft[c.id]&&pt.length&&At(),m=L===O?r:L.indexOf(u),d&&!1!==(p=new d).init(u,g||n,e,m,L)&&(e._pt=h=new di(e._pt,u,p.name,0,1,p.render,p,0,p.priority),p._props.forEach((function(t){f[t]=h})),p.priority&&(l=1)),!d||g)for(s in n)mt[s]&&(p=Ye(s,n,e,m,u,L))?p.priority&&(l=1):f[s]=h=Xe.call(e,u,s,"get",n[s],m,L,0,v.stringFilter);e._op&&e._op[r]&&e.kill(u,e._op[r]),N&&e._pt&&(Ve=e,a.killTweensOf(u,f,e.globalTime(0)),y=!e.parent,Ve=0),e._pt&&x&&(ft[c.id]=1)}l&&ci(e),e._onInit&&e._onInit(e)}e._onUpdate=C,e._initted=(!e._op||e._pt)&&!y},Ke=function(t,e,i,n,r){return H(t)?t.call(e,i,n,r):U(t)&&~t.indexOf("random(")?fe(t):t},Je=bt+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase",Ze=(Je+",id,stagger,delay,duration,paused,scrollTrigger").split(","),Qe=function(t){function e(e,i,r,s){var h;"number"==typeof i&&(r.duration=i,i=r,r=null);var u,l,c,d,p,f,m,g,y=(h=t.call(this,s?i:Lt(i))||this).vars,v=y.duration,b=y.delay,_=y.immediateRender,w=y.stagger,x=y.overwrite,C=y.keyframes,S=y.defaults,T=y.scrollTrigger,A=y.yoyoEase,E=i.parent||a,P=(Z(e)||J(e)?V(e[0]):"length"in i)?[e]:se(e);if(h._targets=P.length?_t(P):ut(0,!R.nullTargetWarn)||[],h._ptLookup=[],h._overwrite=x,C||w||K(v)||K(b)){if(i=h.vars,(u=h.timeline=new He({data:"nested",defaults:S||{}})).kill(),u.parent=u._dp=n(h),u._start=0,C)It(u.vars.defaults,{ease:"none"}),w?P.forEach((function(t,e){return C.forEach((function(i,n){return u.to(t,i,n?">":e*w)}))})):C.forEach((function(t){return u.to(P,t,">")}));else{if(d=P.length,m=w?ue(w):ct,X(w))for(p in w)~Je.indexOf(p)&&(g||(g={}),g[p]=w[p]);for(l=0;l<d;l++){for(p in c={},i)Ze.indexOf(p)<0&&(c[p]=i[p]);c.stagger=0,A&&(c.yoyoEase=A),g&&Ot(c,g),f=P[l],c.duration=+Ke(v,n(h),l,f,P),c.delay=(+Ke(b,n(h),l,f,P)||0)-h._delay,!w&&1===d&&c.delay&&(h._delay=b=c.delay,h._start+=b,c.delay=0),u.to(f,c,m(l,f,P))}u.duration()?v=b=0:h.timeline=0}v||h.duration(v=u.duration())}else h.timeline=0;return!0!==x||o||(Ve=n(h),a.killTweensOf(P),Ve=0),Xt(E,n(h),r),i.reversed&&h.reverse(),i.paused&&h.paused(!0),(_||!v&&!C&&h._start===St(E._time)&&Y(_)&&function t(e){return!e||e._ts&&t(e.parent)}(n(h))&&"nested"!==E.data)&&(h._tTime=-1e-8,h.render(Math.max(0,-b))),T&&Yt(n(h),T),h}r(e,t);var i=e.prototype;return i.render=function(t,e,i){var n,r,o,a,s,h,u,l,c,d=this._time,p=this._tDur,f=this._dur,m=t>p-1e-8&&t>=0?p:t<1e-8?0:t;if(f){if(m!==this._tTime||!t||i||!this._initted&&this._tTime||this._startAt&&this._zTime<0!=t<0){if(n=m,l=this.timeline,this._repeat){if(a=f+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*a+t,e,i);if(n=St(m%a),m===p?(o=this._repeat,n=f):((o=~~(m/a))&&o===m/a&&(n=f,o--),n>f&&(n=f)),(h=this._yoyo&&1&o)&&(c=this._yEase,n=f-n),s=Gt(this._tTime,a),n===d&&!i&&this._initted)return this;o!==s&&(l&&this._yEase&&Le(l,h),!this.vars.repeatRefresh||h||this._lock||(this._lock=i=1,this.render(St(a*o),!0).invalidate()._lock=0))}if(!this._initted){if(qt(this,t<0?t:n,i,e))return this._tTime=0,this;if(f!==this._dur)return this.render(t,e,i)}if(this._tTime=m,this._time=n,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=u=(c||this._ease)(n/f),this._from&&(this.ratio=u=1-u),n&&!d&&!e&&(ye(this,"onStart"),this._tTime!==m))return this;for(r=this._pt;r;)r.r(u,r.d),r=r._next;l&&l.render(t<0?t:!n&&h?-1e-8:l._dur*u,e,i)||this._startAt&&(this._zTime=t),this._onUpdate&&!e&&(t<0&&this._startAt&&this._startAt.render(t,!0,i),ye(this,"onUpdate")),this._repeat&&o!==s&&this.vars.onRepeat&&!e&&this.parent&&ye(this,"onRepeat"),m!==this._tDur&&m||this._tTime!==m||(t<0&&this._startAt&&!this._onUpdate&&this._startAt.render(t,!0,!0),(t||!f)&&(m===this._tDur&&this._ts>0||!m&&this._ts<0)&&Bt(this,1),e||t<0&&!d||!m&&!d||(ye(this,m===p?"onComplete":"onReverseComplete",!0),this._prom&&!(m<p&&this.timeScale()>0)&&this._prom()))}}else!function(t,e,i,n){var r,o,a,s=t.ratio,h=e<0||!e&&(!t._start&&function t(e){var i=e.parent;return i&&i._ts&&i._initted&&!i._lock&&(i.rawTime()<0||t(i))}(t)&&(t._initted||!Kt(t))||(t._ts<0||t._dp._ts<0)&&!Kt(t))?0:1,u=t._rDelay,l=0;if(u&&t._repeat&&(l=ie(0,t._tDur,e),o=Gt(l,u),a=Gt(t._tTime,u),t._yoyo&&1&o&&(h=1-h),o!==a&&(s=1-h,t.vars.repeatRefresh&&t._initted&&t.invalidate())),h!==s||n||1e-8===t._zTime||!e&&t._zTime){if(!t._initted&&qt(t,e,n,i))return;for(a=t._zTime,t._zTime=e||(i?1e-8:0),i||(i=e&&!a),t.ratio=h,t._from&&(h=1-h),t._time=0,t._tTime=l,r=t._pt;r;)r.r(h,r.d),r=r._next;t._startAt&&e<0&&t._startAt.render(e,!0,!0),t._onUpdate&&!i&&ye(t,"onUpdate"),l&&t._repeat&&!i&&t.parent&&ye(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===h&&(h&&Bt(t,1),i||(ye(t,h?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,i);return this},i.targets=function(){return this._targets},i.invalidate=function(){return this._pt=this._op=this._startAt=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(),t.prototype.invalidate.call(this)},i.kill=function(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?ve(this):this;if(this.timeline){var i=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,Ve&&!0!==Ve.vars.overwrite)._first||ve(this),this.parent&&i!==this.timeline.totalDuration()&&Jt(this,this._dur*this.timeline._tDur/i,0,1),this}var n,r,o,a,s,h,u,l=this._targets,c=t?se(t):l,d=this._ptLookup,p=this._pt;if((!e||"all"===e)&&function(t,e){for(var i=t.length,n=i===e.length;n&&i--&&t[i]===e[i];);return i<0}(l,c))return"all"===e&&(this._pt=0),ve(this);for(n=this._op=this._op||[],"all"!==e&&(U(e)&&(s={},Ct(e,(function(t){return s[t]=1})),e=s),e=function(t,e){var i,n,r,o,a=t[0]?wt(t[0]).harness:0,s=a&&a.aliases;if(!s)return e;for(n in i=Ot({},e),s)if(n in i)for(r=(o=s[n].split(",")).length;r--;)i[o[r]]=i[n];return i}(l,e)),u=l.length;u--;)if(~c.indexOf(l[u]))for(s in r=d[u],"all"===e?(n[u]=e,a=r,o={}):(o=n[u]=n[u]||{},a=e),a)(h=r&&r[s])&&("kill"in h.d&&!0!==h.d.kill(s)||Nt(this,h,"_pt"),delete r[s]),"all"!==o&&(o[s]=1);return this._initted&&!this._pt&&p&&ve(this),this},e.to=function(t,i){return new e(t,i,arguments[2])},e.from=function(t,e){return te(1,arguments)},e.delayedCall=function(t,i,n,r){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:i,onReverseComplete:i,onCompleteParams:n,onReverseCompleteParams:n,callbackScope:r})},e.fromTo=function(t,e,i){return te(2,arguments)},e.set=function(t,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(t,i)},e.killTweensOf=function(t,e,i){return a.killTweensOf(t,e,i)},e}(Ue);It(Qe.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),Ct("staggerTo,staggerFrom,staggerFromTo",(function(t){Qe[t]=function(){var e=new He,i=re.call(arguments,0);return i.splice("staggerFromTo"===t?5:4,0,0),e[t].apply(e,i)}}));var $e=function(t,e,i){return t[e]=i},ti=function(t,e,i){return t[e](i)},ei=function(t,e,i,n){return t[e](n.fp,i)},ii=function(t,e,i){return t.setAttribute(e,i)},ni=function(t,e){return H(t[e])?ti:W(t[e])&&t.setAttribute?ii:$e},ri=function(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)},oi=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},ai=function(t,e){var i=e._pt,n="";if(!t&&e.b)n=e.b;else if(1===t&&e.e)n=e.e;else{for(;i;)n=i.p+(i.m?i.m(i.s+i.c*t):Math.round(1e4*(i.s+i.c*t))/1e4)+n,i=i._next;n+=e.c}e.set(e.t,e.p,n,e)},si=function(t,e){for(var i=e._pt;i;)i.r(t,i.d),i=i._next},hi=function(t,e,i,n){for(var r,o=this._pt;o;)r=o._next,o.p===n&&o.modifier(t,e,i),o=r},ui=function(t){for(var e,i,n=this._pt;n;)i=n._next,n.p===t&&!n.op||n.op===t?Nt(this,n,"_pt"):n.dep||(e=1),n=i;return!e},li=function(t,e,i,n){n.mSet(t,e,n.m.call(n.tween,i,n.mt),n)},ci=function(t){for(var e,i,n,r,o=t._pt;o;){for(e=o._next,i=n;i&&i.pr>o.pr;)i=i._next;(o._prev=i?i._prev:r)?o._prev._next=o:n=o,(o._next=i)?i._prev=o:r=o,o=e}t._pt=n},di=function(){function t(t,e,i,n,r,o,a,s,h){this.t=e,this.s=n,this.c=r,this.p=i,this.r=o||ri,this.d=a||this,this.set=s||$e,this.pr=h||0,this._next=t,t&&(t._prev=this)}return t.prototype.modifier=function(t,e,i){this.mSet=this.mSet||this.set,this.set=li,this.m=t,this.mt=i,this.tween=e},t}();Ct(bt+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",(function(t){return dt[t]=1})),ot.TweenMax=ot.TweenLite=Qe,ot.TimelineLite=ot.TimelineMax=He,a=new He({sortChildren:!1,defaults:D,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),R.stringFilter=Ee;var pi={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];e.forEach((function(t){return be(t)}))},timeline:function(t){return new He(t)},getTweensOf:function(t,e){return a.getTweensOf(t,e)},getProperty:function(t,e,i,n){U(t)&&(t=se(t)[0]);var r=wt(t||{}).get,o=i?Mt:Pt;return"native"===i&&(i=""),t?e?o((mt[e]&&mt[e].get||r)(t,e,i,n)):function(e,i,n){return o((mt[e]&&mt[e].get||r)(t,e,i,n))}:t},quickSetter:function(t,e,i){if((t=se(t)).length>1){var n=t.map((function(t){return gi.quickSetter(t,e,i)})),r=n.length;return function(t){for(var e=r;e--;)n[e](t)}}t=t[0]||{};var o=mt[e],a=wt(t),s=a.harness&&(a.harness.aliases||{})[e]||e,h=o?function(e){var n=new o;d._pt=0,n.init(t,i?e+i:e,d,0,[t]),n.render(1,n),d._pt&&si(1,d)}:a.set(t,s);return o?h:function(e){return h(t,s,i?e+i:e,a,1)}},isTweening:function(t){return a.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=Ne(t.ease,D.ease)),Rt(D,t||{})},config:function(t){return Rt(R,t||{})},registerEffect:function(t){var e=t.name,i=t.effect,n=t.plugins,r=t.defaults,o=t.extendTimeline;(n||"").split(",").forEach((function(t){return t&&!mt[t]&&!ot[t]&&ut()})),gt[e]=function(t,e,n){return i(se(t),It(e||{},r),n)},o&&(He.prototype[e]=function(t,i,n){return this.add(gt[e](t,X(i)?i:(n=i)&&{},this),n)})},registerEase:function(t,e){Ie[t]=Ne(e)},parseEase:function(t,e){return arguments.length?Ne(t,e):Ie},getById:function(t){return a.getById(t)},exportRoot:function(t,e){void 0===t&&(t={});var i,n,r=new He(t);for(r.smoothChildTiming=Y(t.smoothChildTiming),a.remove(r),r._dp=0,r._time=r._tTime=a._time,i=a._first;i;)n=i._next,!e&&!i._dur&&i instanceof Qe&&i.vars.onComplete===i._targets[0]||Xt(r,i,i._start-i._delay),i=n;return Xt(a,r,0),r},utils:{wrap:function t(e,i,n){var r=i-e;return Z(e)?pe(e,t(0,e.length),i):ee(n,(function(t){return(r+(t-e)%r)%r+e}))},wrapYoyo:function t(e,i,n){var r=i-e,o=2*r;return Z(e)?pe(e,t(0,e.length-1),i):ee(n,(function(t){return e+((t=(o+(t-e)%o)%o||0)>r?o-t:t)}))},distribute:ue,random:de,snap:ce,normalize:function(t,e,i){return me(t,e,0,1,i)},getUnit:ne,clamp:function(t,e,i){return ee(i,(function(i){return ie(t,e,i)}))},splitColor:xe,toArray:se,selector:function(t){return t=se(t)[0]||ut()||{},function(e){var i=t.current||t.nativeElement||t;return se(e,i.querySelectorAll?i:i===t?ut()||u.createElement("div"):t)}},mapRange:me,pipe:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return e.reduce((function(t,e){return e(t)}),t)}},unitize:function(t,e){return function(i){return t(parseFloat(i))+(e||ne(i))}},interpolate:function t(e,i,n,r){var o=isNaN(e+i)?0:function(t){return(1-t)*e+t*i};if(!o){var a,s,h,u,l,c=U(e),d={};if(!0===n&&(r=1)&&(n=null),c)e={p:e},i={p:i};else if(Z(e)&&!Z(i)){for(h=[],u=e.length,l=u-2,s=1;s<u;s++)h.push(t(e[s-1],e[s]));u--,o=function(t){t*=u;var e=Math.min(l,~~t);return h[e](t-e)},n=i}else r||(e=Ot(Z(e)?[]:{},e));if(!h){for(a in i)Xe.call(d,e,a,"get",i[a]);o=function(t){return si(t,d)||(c?e.p:e)}}}return ee(n,o)},shuffle:he},install:st,effects:gt,ticker:Pe,updateRoot:He.updateRoot,plugins:mt,globalTimeline:a,core:{PropTween:di,globals:lt,Tween:Qe,Timeline:He,Animation:Ue,getCache:wt,_removeLinkedListItem:Nt,suppressOverwrites:function(t){return o=t}}};Ct("to,from,fromTo,delayedCall,set,killTweensOf",(function(t){return pi[t]=Qe[t]})),Pe.add(He.updateRoot),d=pi.to({},{duration:0});var fi=function(t,e){for(var i=t._pt;i&&i.p!==e&&i.op!==e&&i.fp!==e;)i=i._next;return i},mi=function(t,e){return{name:t,rawVars:1,init:function(t,i,n){n._onInit=function(t){var n,r;if(U(i)&&(n={},Ct(i,(function(t){return n[t]=1})),i=n),e){for(r in n={},i)n[r]=e(i[r]);i=n}!function(t,e){var i,n,r,o=t._targets;for(i in e)for(n=o.length;n--;)(r=t._ptLookup[n][i])&&(r=r.d)&&(r._pt&&(r=fi(r,i)),r&&r.modifier&&r.modifier(e[i],t,o[n],i))}(t,i)}}}},gi=pi.registerPlugin({name:"attr",init:function(t,e,i,n,r){var o,a;for(o in e)(a=this.add(t,"setAttribute",(t.getAttribute(o)||0)+"",e[o],n,r,0,0,o))&&(a.op=o),this._props.push(o)}},{name:"endArray",init:function(t,e){for(var i=e.length;i--;)this.add(t,i,t[i]||0,e[i])}},mi("roundProps",le),mi("modifiers"),mi("snap",ce))||pi;Qe.version=He.version=gi.version="3.7.1",l=1,q()&&Me();Ie.Power0,Ie.Power1,Ie.Power2,Ie.Power3,Ie.Power4;var yi=Ie.Linear,vi=(Ie.Quad,Ie.Cubic,Ie.Quart,Ie.Quint,Ie.Strong,Ie.Elastic,Ie.Back);Ie.SteppedEase,Ie.Bounce,Ie.Sine,Ie.Expo,Ie.Circ},function(t,e,i){"use strict";i.d(e,"a",(function(){return pe})),i.d(e,"b",(function(){return oe})),i.d(e,"c",(function(){return B})),i.d(e,"d",(function(){return I})),i.d(e,"e",(function(){return g})),i.d(e,"f",(function(){return le})),i.d(e,"g",(function(){return me})),i.d(e,"h",(function(){return ve})),i.d(e,"i",(function(){return be})),i.d(e,"j",(function(){return fe})),i.d(e,"k",(function(){return ce})),i.d(e,"l",(function(){return z})),i.d(e,"m",(function(){return Lt})),i.d(e,"n",(function(){return J})),i.d(e,"o",(function(){return M})),i.d(e,"p",(function(){return it})),i.d(e,"q",(function(){return Kt})),i.d(e,"r",(function(){return ee})),i.d(e,"s",(function(){return W})),i.d(e,"t",(function(){return qt})),i.d(e,"u",(function(){return ht})),i.d(e,"v",(function(){return Q})),i.d(e,"w",(function(){return Ot})),i.d(e,"x",(function(){return X})),i.d(e,"y",(function(){return Y})),i.d(e,"z",(function(){return L})),i.d(e,"A",(function(){return N})),i.d(e,"B",(function(){return ae})),i.d(e,"C",(function(){return Rt})),i.d(e,"D",(function(){return Ft})),i.d(e,"E",(function(){return Dt})),i.d(e,"F",(function(){return E})),i.d(e,"G",(function(){return R})),i.d(e,"H",(function(){return Bt})),i.d(e,"I",(function(){return k})),i.d(e,"J",(function(){return K})),i.d(e,"K",(function(){return de})),i.d(e,"L",(function(){return se})),i.d(e,"M",(function(){return Mt})),i.d(e,"N",(function(){return ue})),i.d(e,"O",(function(){return he})),i.d(e,"P",(function(){return A})),i.d(e,"Q",(function(){return ne})),i.d(e,"R",(function(){return Ct}));var n=i(15),r=i(5),o=i(4),a=i(53),s=i(33),h=i(8);n.b.PREFER_ENV=o.isMobile.any?r.f.WEBGL:r.f.WEBGL2,n.b.STRICT_TEXTURE_CACHE=!1;var u=[];function l(t,e){if(!t)return null;var i="";if("string"==typeof t){var n=/\.(\w{3,4})(?:$|\?|#)/i.exec(t);n&&(i=n[1].toLowerCase())}for(var r=u.length-1;r>=0;--r){var o=u[r];if(o.test&&o.test(t,i))return new o(t,e)}throw new Error("Unrecognized source type to auto-detect Resource")}var c=function(t,e){return(c=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 d(t,e){function i(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var p=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new a.a("setRealSize"),this.onUpdate=new a.a("update"),this.onError=new a.a("onError")}return t.prototype.bind=function(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)},t.prototype.unbind=function(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)},t.prototype.resize=function(t,e){t===this._width&&e===this._height||(this._width=t,this._height=e,this.onResize.emit(t,e))},Object.defineProperty(t.prototype,"valid",{get:function(){return!!this._width&&!!this._height},enumerable:!1,configurable:!0}),t.prototype.update=function(){this.destroyed||this.onUpdate.emit()},t.prototype.load=function(){return Promise.resolve(this)},Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),t.prototype.style=function(t,e,i){return!1},t.prototype.dispose=function(){},t.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)},t.test=function(t,e){return!1},t}(),f=function(t){function e(e,i){var n=this,r=i||{},o=r.width,a=r.height;if(!o||!a)throw new Error("BufferResource width or height invalid");return(n=t.call(this,o,a)||this).data=e,n}return d(e,t),e.prototype.upload=function(t,e,i){var n=t.gl;return n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===r.a.UNPACK),i.width===e.width&&i.height===e.height?n.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(i.width=e.width,i.height=e.height,n.texImage2D(e.target,0,i.internalFormat,e.width,e.height,0,e.format,i.type,this.data)),!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(p),m={scaleMode:r.n.NEAREST,format:r.g.RGBA,alphaMode:r.a.NPM},g=function(t){function e(e,i){void 0===e&&(e=null),void 0===i&&(i=null);var a=t.call(this)||this,s=(i=i||{}).alphaMode,h=i.mipmap,u=i.anisotropicLevel,c=i.scaleMode,d=i.width,f=i.height,m=i.wrapMode,g=i.format,y=i.type,v=i.target,b=i.resolution,_=i.resourceOptions;return!e||e instanceof p||((e=l(e,_)).internal=!0),a.width=d||0,a.height=f||0,a.resolution=b||n.b.RESOLUTION,a.mipmap=void 0!==h?h:n.b.MIPMAP_TEXTURES,a.anisotropicLevel=void 0!==u?u:n.b.ANISOTROPIC_LEVEL,a.wrapMode=m||n.b.WRAP_MODE,a.scaleMode=void 0!==c?c:n.b.SCALE_MODE,a.format=g||r.g.RGBA,a.type=y||r.p.UNSIGNED_BYTE,a.target=v||r.o.TEXTURE_2D,a.alphaMode=void 0!==s?s:r.a.UNPACK,void 0!==i.premultiplyAlpha&&(a.premultiplyAlpha=i.premultiplyAlpha),a.uid=Object(o.uid)(),a.touched=0,a.isPowerOfTwo=!1,a._refreshPOT(),a._glTextures={},a.dirtyId=0,a.dirtyStyleId=0,a.cacheId=null,a.valid=d>0&&f>0,a.textureCacheIds=[],a.destroyed=!1,a.resource=null,a._batchEnabled=0,a._batchLocation=0,a.parentTextureArray=null,a.setResource(e),a}return d(e,t),Object.defineProperty(e.prototype,"realWidth",{get:function(){return Math.ceil(this.width*this.resolution-1e-4)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"realHeight",{get:function(){return Math.ceil(this.height*this.resolution-1e-4)},enumerable:!1,configurable:!0}),e.prototype.setStyle=function(t,e){var i;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,i=!0),i&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,i){return this.resolution=i||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=Object(o.isPow2)(this.realWidth)&&Object(o.isPow2)(this.realHeight)},e.prototype.setResolution=function(t){var e=this.resolution;return e===t||(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT()),this},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.onError=function(t){this.emit("error",this,t)},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete o.BaseTextureCache[this.cacheId],delete o.TextureCache[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.prototype.castToBaseTexture=function(){return this},e.from=function(t,i,r){void 0===r&&(r=n.b.STRICT_TEXTURE_CACHE);var a="string"==typeof t,s=null;a?s=t:(t._pixiId||(t._pixiId="pixiid_"+Object(o.uid)()),s=t._pixiId);var h=o.BaseTextureCache[s];if(a&&r&&!h)throw new Error('The cacheId "'+s+'" does not exist in BaseTextureCache.');return h||((h=new e(t,i)).cacheId=s,e.addToCache(h,s)),h},e.fromBuffer=function(t,i,n,o){t=t||new Float32Array(i*n*4);var a=new f(t,{width:i,height:n}),s=t instanceof Float32Array?r.p.FLOAT:r.p.UNSIGNED_BYTE;return new e(a,Object.assign(m,o||{width:i,height:n,type:s}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),o.BaseTextureCache[e],o.BaseTextureCache[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=o.BaseTextureCache[t];if(e){var i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete o.BaseTextureCache[t],e}}else if(t&&t.textureCacheIds){for(var n=0;n<t.textureCacheIds.length;++n)delete o.BaseTextureCache[t.textureCacheIds[n]];return t.textureCacheIds.length=0,t}return null},e._globalBatch=0,e}(o.EventEmitter),y=function(t){function e(e,i){var n=this,r=i||{},o=r.width,a=r.height;(n=t.call(this,o,a)||this).items=[],n.itemDirtyIds=[];for(var s=0;s<e;s++){var h=new g;n.items.push(h),n.itemDirtyIds.push(-2)}return n.length=e,n._load=null,n.baseTexture=null,n}return d(e,t),e.prototype.initFromArray=function(t,e){for(var i=0;i<this.length;i++)t[i]&&(t[i].castToBaseTexture?this.addBaseTextureAt(t[i].castToBaseTexture(),i):t[i]instanceof p?this.addResourceAt(t[i],i):this.addResourceAt(l(t[i],e),i))},e.prototype.dispose=function(){for(var t=0,e=this.length;t<e;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null},e.prototype.addResourceAt=function(t,e){if(!this.items[e])throw new Error("Index "+e+" is out of bounds");return t.valid&&!this.valid&&this.resize(t.width,t.height),this.items[e].setResource(t),this},e.prototype.bind=function(e){if(null!==this.baseTexture)throw new Error("Only one base texture per TextureArray is allowed");t.prototype.bind.call(this,e);for(var i=0;i<this.length;i++)this.items[i].parentTextureArray=e,this.items[i].on("update",e.update,e)},e.prototype.unbind=function(e){t.prototype.unbind.call(this,e);for(var i=0;i<this.length;i++)this.items[i].parentTextureArray=null,this.items[i].off("update",e.update,e)},e.prototype.load=function(){var t=this;if(this._load)return this._load;var e=this.items.map((function(t){return t.resource})).filter((function(t){return t})).map((function(t){return t.load()}));return this._load=Promise.all(e).then((function(){var e=t.items[0],i=e.realWidth,n=e.realHeight;return t.resize(i,n),Promise.resolve(t)})),this._load},e}(p),v=function(t){function e(e,i){var n,r,o=this,a=i||{},s=a.width,h=a.height;return Array.isArray(e)?(n=e,r=e.length):r=e,o=t.call(this,r,{width:s,height:h})||this,n&&o.initFromArray(n,i),o}return d(e,t),e.prototype.addBaseTextureAt=function(t,e){if(!t.resource)throw new Error("ArrayResource does not support RenderTexture");return this.addResourceAt(t.resource,e),this},e.prototype.bind=function(e){t.prototype.bind.call(this,e),e.target=r.o.TEXTURE_2D_ARRAY},e.prototype.upload=function(t,e,i){var n=this.length,r=this.itemDirtyIds,o=this.items,a=t.gl;i.dirtyId<0&&a.texImage3D(a.TEXTURE_2D_ARRAY,0,e.format,this._width,this._height,n,0,e.format,e.type,null);for(var s=0;s<n;s++){var h=o[s];r[s]<h.dirtyId&&(r[s]=h.dirtyId,h.valid&&a.texSubImage3D(a.TEXTURE_2D_ARRAY,0,0,0,s,h.resource.width,h.resource.height,1,e.format,e.type,h.resource.source))}return!0},e}(y),b=function(t){function e(e){var i=this,n=e,r=n.naturalWidth||n.videoWidth||n.width,o=n.naturalHeight||n.videoHeight||n.height;return(i=t.call(this,r,o)||this).source=e,i.noSubImage=!1,i}return d(e,t),e.crossOrigin=function(t,e,i){void 0===i&&0!==e.indexOf("data:")?t.crossOrigin=Object(o.determineCrossOrigin)(e):!1!==i&&(t.crossOrigin="string"==typeof i?i:"anonymous")},e.prototype.upload=function(t,e,i,n){var o=t.gl,a=e.realWidth,s=e.realHeight;return n=n||this.source,o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===r.a.UNPACK),this.noSubImage||e.target!==o.TEXTURE_2D||i.width!==a||i.height!==s?(i.width=a,i.height=s,o.texImage2D(e.target,0,e.format,e.format,e.type,n)):o.texSubImage2D(o.TEXTURE_2D,0,0,0,e.format,e.type,n),!0},e.prototype.update=function(){if(!this.destroyed){var e=this.source,i=e.naturalWidth||e.videoWidth||e.width,n=e.naturalHeight||e.videoHeight||e.height;this.resize(i,n),t.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(p),_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return d(e,t),e.test=function(t){var e=window.OffscreenCanvas;return!!(e&&t instanceof e)||t instanceof HTMLCanvasElement},e}(b),w=function(t){function e(i,n){var o=this,a=n||{},s=a.width,h=a.height,u=a.autoLoad,l=a.linkBaseTexture;if(i&&i.length!==e.SIDES)throw new Error("Invalid length. Got "+i.length+", expected 6");o=t.call(this,6,{width:s,height:h})||this;for(var c=0;c<e.SIDES;c++)o.items[c].target=r.o.TEXTURE_CUBE_MAP_POSITIVE_X+c;return o.linkBaseTexture=!1!==l,i&&o.initFromArray(i,n),!1!==u&&o.load(),o}return d(e,t),e.prototype.bind=function(e){t.prototype.bind.call(this,e),e.target=r.o.TEXTURE_CUBE_MAP},e.prototype.addBaseTextureAt=function(t,e,i){if(void 0===i&&(i=this.linkBaseTexture),!this.items[e])throw new Error("Index "+e+" is out of bounds");if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0){if(!t.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(t.resource,e)}else t.target=r.o.TEXTURE_CUBE_MAP_POSITIVE_X+e,t.parentTextureArray=this.baseTexture,this.items[e]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[e]=t,this},e.prototype.upload=function(t,i,n){for(var r=this.itemDirtyIds,o=0;o<e.SIDES;o++){var a=this.items[o];r[o]<a.dirtyId&&(a.valid&&a.resource?(a.resource.upload(t,a,n),r[o]=a.dirtyId):r[o]<-1&&(t.gl.texImage2D(a.target,0,n.internalFormat,i.realWidth,i.realHeight,0,i.format,n.type,null),r[o]=-1))}return!0},e.test=function(t){return Array.isArray(t)&&t.length===e.SIDES},e.SIDES=6,e}(y),x=function(t){function e(e,i){var r=this;if(i=i||{},!(e instanceof HTMLImageElement)){var o=new Image;b.crossOrigin(o,e,i.crossorigin),o.src=e,e=o}return r=t.call(this,e)||this,!e.complete&&r._width&&r._height&&(r._width=0,r._height=0),r.url=e.src,r._process=null,r.preserveBitmap=!1,r.createBitmap=(void 0!==i.createBitmap?i.createBitmap:n.b.CREATE_IMAGE_BITMAP)&&!!window.createImageBitmap,r.alphaMode="number"==typeof i.alphaMode?i.alphaMode:null,void 0!==i.premultiplyAlpha&&(r.premultiplyAlpha=i.premultiplyAlpha),r.bitmap=null,r._load=null,!1!==i.autoLoad&&r.load(),r}return d(e,t),e.prototype.load=function(t){var e=this;return this._load||(void 0!==t&&(this.createBitmap=t),this._load=new Promise((function(t,i){var n=e.source;e.url=n.src;var r=function(){e.destroyed||(n.onload=null,n.onerror=null,e.resize(n.width,n.height),e._load=null,e.createBitmap?t(e.process()):t(e))};n.complete&&n.src?r():(n.onload=r,n.onerror=function(t){i(t),e.onError.emit(t)})}))),this._load},e.prototype.process=function(){var t=this,e=this.source;return null!==this._process?this._process:null===this.bitmap&&window.createImageBitmap?(this._process=window.createImageBitmap(e,0,0,e.width,e.height,{premultiplyAlpha:this.alphaMode===r.a.UNPACK?"premultiply":"none"}).then((function(e){return t.destroyed?Promise.reject():(t.bitmap=e,t.update(),t._process=null,Promise.resolve(t))})),this._process):Promise.resolve(this)},e.prototype.upload=function(e,i,n){if("number"==typeof this.alphaMode&&(i.alphaMode=this.alphaMode),!this.createBitmap)return t.prototype.upload.call(this,e,i,n);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(t.prototype.upload.call(this,e,i,n,this.bitmap),!this.preserveBitmap){var r=!0,o=i._glTextures;for(var a in o){var s=o[a];if(s!==n&&s.dirtyId!==i.dirtyId){r=!1;break}}r&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){this.source.onload=null,this.source.onerror=null,t.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e.test=function(t){return"string"==typeof t||t instanceof HTMLImageElement},e}(b),C=function(t){function e(e,i){var n=this;return i=i||{},(n=t.call(this,document.createElement("canvas"))||this)._width=0,n._height=0,n.svg=e,n.scale=i.scale||1,n._overrideWidth=i.width,n._overrideHeight=i.height,n._resolve=null,n._crossorigin=i.crossorigin,n._load=null,!1!==i.autoLoad&&n.load(),n}return d(e,t),e.prototype.load=function(){var t=this;return this._load||(this._load=new Promise((function(e){if(t._resolve=function(){t.resize(t.source.width,t.source.height),e(t)},/^\<svg/.test(t.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");t.svg="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(t.svg)))}t._loadSvg()}))),this._load},e.prototype._loadSvg=function(){var t=this,e=new Image;b.crossOrigin(e,this.svg,this._crossorigin),e.src=this.svg,e.onerror=function(i){t._resolve&&(e.onerror=null,t.onError.emit(i))},e.onload=function(){if(t._resolve){var i=e.width,n=e.height;if(!i||!n)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");var r=i*t.scale,a=n*t.scale;(t._overrideWidth||t._overrideHeight)&&(r=t._overrideWidth||t._overrideHeight/n*i,a=t._overrideHeight||t._overrideWidth/i*n),r=Math.round(r),a=Math.round(a);var s=t.source;s.width=r,s.height=a,s._pixiId="canvas_"+Object(o.uid)(),s.getContext("2d").drawImage(e,0,0,i,n,0,0,r,a),t._resolve(),t._resolve=null}}},e.getSize=function(t){var i=e.SVG_SIZE.exec(t),n={};return i&&(n[i[1]]=Math.round(parseFloat(i[3])),n[i[5]]=Math.round(parseFloat(i[7]))),n},e.prototype.dispose=function(){t.prototype.dispose.call(this),this._resolve=null,this._crossorigin=null},e.test=function(t,e){return"svg"===e||"string"==typeof t&&/^data:image\/svg\+xml(;(charset=utf8|utf8))?;base64/.test(t)||"string"==typeof t&&0===t.indexOf("<svg")},e.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e}(b),S=function(t){function e(i,n){var r=this;if(n=n||{},!(i instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),"string"==typeof i&&(i=[i]);var a=i[0].src||i[0];b.crossOrigin(o,a,n.crossorigin);for(var s=0;s<i.length;++s){var h=document.createElement("source"),u=i[s],l=u.src,c=u.mime,d=(l=l||i[s]).split("?").shift().toLowerCase(),p=d.substr(d.lastIndexOf(".")+1);c=c||e.MIME_TYPES[p]||"video/"+p,h.src=l,h.type=c,o.appendChild(h)}i=o}return(r=t.call(this,i)||this).noSubImage=!0,r._autoUpdate=!0,r._isConnectedToTicker=!1,r._updateFPS=n.updateFPS||0,r._msToNextUpdate=0,r.autoPlay=!1!==n.autoPlay,r._load=null,r._resolve=null,r._onCanPlay=r._onCanPlay.bind(r),r._onError=r._onError.bind(r),!1!==n.autoLoad&&r.load(),r}return d(e,t),e.prototype.update=function(e){if(void 0===e&&(e=0),!this.destroyed){var i=s.a.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-i),(!this._updateFPS||this._msToNextUpdate<=0)&&(t.prototype.update.call(this),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}},e.prototype.load=function(){var t=this;if(this._load)return this._load;var e=this.source;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart.bind(this)),e.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlay),e.addEventListener("error",this._onError,!0)),this._load=new Promise((function(i){t.valid?i(t):(t._resolve=i,e.load())})),this._load},e.prototype._onError=function(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t)},e.prototype._isSourcePlaying=function(){var t=this.source;return t.currentTime>0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){var t=this.source;return 3===t.readyState||4===t.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(s.a.shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&(s.a.shared.remove(this.update,this),this._isConnectedToTicker=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isConnectedToTicker&&s.a.shared.remove(this.update,this);var e=this.source;e&&(e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),t.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(s.a.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(s.a.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(t){t!==this._updateFPS&&(this._updateFPS=t)},enumerable:!1,configurable:!0}),e.test=function(t,i){return t instanceof HTMLVideoElement||e.TYPES.indexOf(i)>-1},e.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],e.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},e}(b),T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return d(e,t),e.test=function(t){return!!window.createImageBitmap&&t instanceof ImageBitmap},e}(b);u.push(x,T,_,S,C,f,w,v);var A={Resource:p,BaseImageResource:b,INSTALLED:u,autoDetectResource:l,AbstractMultiResource:y,ArrayResource:v,BufferResource:f,CanvasResource:_,CubeResource:w,ImageResource:x,SVGResource:C,VideoResource:S,ImageBitmapResource:T},E=function(){function t(t){this.renderer=t}return t.prototype.destroy=function(){this.renderer=null},t}(),P=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return d(e,t),e.prototype.upload=function(t,e,i){var n=t.gl;return n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===r.a.UNPACK),i.width===e.width&&i.height===e.height?n.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(i.width=e.width,i.height=e.height,n.texImage2D(e.target,0,1===t.context.webGLVersion?n.DEPTH_COMPONENT:n.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(f),M=function(){function t(t,e){this.width=Math.ceil(t||100),this.height=Math.ceil(e||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new a.a("disposeFramebuffer"),this.multisample=r.k.NONE}return Object.defineProperty(t.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),t.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new g(null,{scaleMode:r.n.NEAREST,resolution:1,mipmap:r.j.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},t.prototype.addDepthTexture=function(t){return this.depthTexture=t||new g(new P(null,{width:this.width,height:this.height}),{scaleMode:r.n.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:r.j.OFF,format:r.g.DEPTH_COMPONENT,type:r.p.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},t.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},t.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},t.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var i=0;i<this.colorTextures.length;i++){var n=this.colorTextures[i],r=n.resolution;n.setSize(t/r,e/r)}if(this.depthTexture){r=this.depthTexture.resolution;this.depthTexture.setSize(t/r,e/r)}}},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroyDepthTexture=function(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)},t}(),I=function(t){function e(e){var i=this;if("number"==typeof e){var n=arguments[0],r=arguments[1],o=arguments[2],a=arguments[3];e={width:n,height:r,scaleMode:o,resolution:a}}i=t.call(this,null,e)||this;var s=e||{},h=s.width,u=s.height;return i.mipmap=0,i.width=Math.ceil(h)||100,i.height=Math.ceil(u)||100,i.valid=!0,i.clearColor=[0,0,0,0],i.framebuffer=new M(i.width*i.resolution,i.height*i.resolution).addColorTexture(0,i),i.maskStack=[],i.filterStack=[{}],i}return d(e,t),e.prototype.resize=function(t,e){t=Math.ceil(t),e=Math.ceil(e),this.framebuffer.resize(t*this.resolution,e*this.resolution)},e.prototype.dispose=function(){this.framebuffer.dispose(),t.prototype.dispose.call(this)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.framebuffer.destroyDepthTexture(),this.framebuffer=null},e}(g),k=function(){function t(){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.uvsFloat32=new Float32Array(8)}return t.prototype.set=function(t,e,i){var n=e.width,r=e.height;if(i){var o=t.width/2/n,a=t.height/2/r,s=t.x/n+o,u=t.y/r+a;i=h.n.add(i,h.n.NW),this.x0=s+o*h.n.uX(i),this.y0=u+a*h.n.uY(i),i=h.n.add(i,2),this.x1=s+o*h.n.uX(i),this.y1=u+a*h.n.uY(i),i=h.n.add(i,2),this.x2=s+o*h.n.uX(i),this.y2=u+a*h.n.uY(i),i=h.n.add(i,2),this.x3=s+o*h.n.uX(i),this.y3=u+a*h.n.uY(i)}else this.x0=t.x/n,this.y0=t.y/r,this.x1=(t.x+t.width)/n,this.y1=t.y/r,this.x2=(t.x+t.width)/n,this.y2=(t.y+t.height)/r,this.x3=t.x/n,this.y3=(t.y+t.height)/r;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3},t}(),O=new k,R=function(t){function e(i,n,r,o,a,s){var u=t.call(this)||this;if(u.noFrame=!1,n||(u.noFrame=!0,n=new h.j(0,0,1,1)),i instanceof e&&(i=i.baseTexture),u.baseTexture=i,u._frame=n,u.trim=o,u.valid=!1,u._uvs=O,u.uvMatrix=null,u.orig=r||n,u._rotate=Number(a||0),!0===a)u._rotate=2;else if(u._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return u.defaultAnchor=s?new h.g(s.x,s.y):new h.g(0,0),u._updateID=0,u.textureCacheIds=[],i.valid?u.noFrame?i.valid&&u.onBaseTextureUpdated(i):u.frame=n:i.once("loaded",u.onBaseTextureUpdated,u),u.noFrame&&i.on("update",u.onBaseTextureUpdated,u),u}return d(e,t),e.prototype.update=function(){this.baseTexture.resource&&this.baseTexture.resource.update()},e.prototype.onBaseTextureUpdated=function(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)},e.prototype.destroy=function(t){if(this.baseTexture){if(t){var i=this.baseTexture;i&&i.url&&o.TextureCache[i.url]&&e.removeFromCache(i.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,e.removeFromCache(this),this.textureCacheIds=null},e.prototype.clone=function(){return new e(this.baseTexture,this.frame.clone(),this.orig.clone(),this.trim&&this.trim.clone(),this.rotate,this.defaultAnchor)},e.prototype.updateUvs=function(){this._uvs===O&&(this._uvs=new k),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},e.from=function(t,i,r){void 0===i&&(i={}),void 0===r&&(r=n.b.STRICT_TEXTURE_CACHE);var a="string"==typeof t,s=null;a?s=t:(t._pixiId||(t._pixiId="pixiid_"+Object(o.uid)()),s=t._pixiId);var h=o.TextureCache[s];if(a&&r&&!h)throw new Error('The cacheId "'+s+'" does not exist in TextureCache.');return h||(i.resolution||(i.resolution=Object(o.getResolutionOfUrl)(t)),(h=new e(new g(t,i))).baseTexture.cacheId=s,g.addToCache(h.baseTexture,s),e.addToCache(h,s)),h},e.fromURL=function(t,i){var n=Object.assign({autoLoad:!1},null==i?void 0:i.resourceOptions),r=e.from(t,Object.assign({resourceOptions:n},i),!1),o=r.baseTexture.resource;return r.baseTexture.valid?Promise.resolve(r):o.load().then((function(){return Promise.resolve(r)}))},e.fromBuffer=function(t,i,n,r){return new e(g.fromBuffer(t,i,n,r))},e.fromLoader=function(t,i,r){var a=new x(t);a.url=i;var s=new e(new g(a,{scaleMode:n.b.SCALE_MODE,resolution:Object(o.getResolutionOfUrl)(i)}));return r||(r=i),g.addToCache(s.baseTexture,r),e.addToCache(s,r),r!==i&&(g.addToCache(s.baseTexture,i),e.addToCache(s,i)),s},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),o.TextureCache[e],o.TextureCache[e]=t)},e.removeFromCache=function(t){if("string"==typeof t){var e=o.TextureCache[t];if(e){var i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete o.TextureCache[t],e}}else if(t&&t.textureCacheIds){for(var n=0;n<t.textureCacheIds.length;++n)o.TextureCache[t.textureCacheIds[n]]===t&&delete o.TextureCache[t.textureCacheIds[n]];return t.textureCacheIds.length=0,t}return null},Object.defineProperty(e.prototype,"resolution",{get:function(){return this.baseTexture.resolution},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frame",{get:function(){return this._frame},set:function(t){this._frame=t,this.noFrame=!1;var e=t.x,i=t.y,n=t.width,r=t.height,o=e+n>this.baseTexture.width,a=i+r>this.baseTexture.height;if(o||a){var s=o&&a?"and":"or",h="X: "+e+" + "+n+" = "+(e+n)+" > "+this.baseTexture.width,u="Y: "+i+" + "+r+" = "+(i+r)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+s+" "+u)}this.valid=n&&r&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),e.prototype.castToBaseTexture=function(){return this.baseTexture},e}(o.EventEmitter);function D(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}R.EMPTY=new R(new g),D(R.EMPTY),D(R.EMPTY.baseTexture),R.WHITE=function(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new R(new g(new _(t)))}(),D(R.WHITE),D(R.WHITE.baseTexture);var L=function(t){function e(e,i){var n=this,r=null;if(!(e instanceof I)){var o=arguments[1],a=arguments[2],s=arguments[3],h=arguments[4];r=arguments[0],i=null,e=new I({width:o,height:a,scaleMode:s,resolution:h})}return(n=t.call(this,e,i)||this).legacyRenderer=r,n.valid=!0,n.filterFrame=null,n.filterPoolKey=null,n.updateUvs(),n}return d(e,t),Object.defineProperty(e.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,e,i){void 0===i&&(i=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,i&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new I(t))},e}(R),N=function(){function t(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}return t.prototype.createTexture=function(t,e){var i=new I(Object.assign({width:t,height:e,resolution:1},this.textureOptions));return new L(i)},t.prototype.getOptimalTexture=function(e,i,n){void 0===n&&(n=1);var r=t.SCREEN_KEY;e*=n,i*=n,this.enableFullScreen&&e===this._pixelsWidth&&i===this._pixelsHeight||(r=(65535&(e=Object(o.nextPow2)(e)))<<16|65535&(i=Object(o.nextPow2)(i))),this.texturePool[r]||(this.texturePool[r]=[]);var a=this.texturePool[r].pop();return a||(a=this.createTexture(e,i)),a.filterPoolKey=r,a.setResolution(n),a},t.prototype.getFilterTexture=function(t,e){var i=this.getOptimalTexture(t.width,t.height,e||t.resolution);return i.filterFrame=t.filterFrame,i},t.prototype.returnTexture=function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)},t.prototype.returnFilterTexture=function(t){this.returnTexture(t)},t.prototype.clear=function(t){if(t=!1!==t)for(var e in this.texturePool){var i=this.texturePool[e];if(i)for(var n=0;n<i.length;n++)i[n].destroy(!0)}this.texturePool={}},t.prototype.setScreenSize=function(e){if(e.width!==this._pixelsWidth||e.height!==this._pixelsHeight){var i=t.SCREEN_KEY,n=this.texturePool[i];if(this.enableFullScreen=e.width>0&&e.height>0,n)for(var r=0;r<n.length;r++)n[r].destroy(!0);this.texturePool[i]=[],this._pixelsWidth=e.width,this._pixelsHeight=e.height}},t.SCREEN_KEY="screen",t}(),B=function(){function t(t,e,i,n,r,o,a){void 0===e&&(e=0),void 0===i&&(i=!1),void 0===n&&(n=5126),this.buffer=t,this.size=e,this.normalized=i,this.type=n,this.stride=r,this.start=o,this.instance=a}return t.prototype.destroy=function(){this.buffer=null},t.from=function(e,i,n,r,o){return new t(e,i,n,r,o)},t}(),F=0,z=function(){function t(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1),this.data=t||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=e,this.id=F++,this.disposeRunner=new a.a("disposeBuffer")}return t.prototype.update=function(t){this.data=t||this.data,this._updateID++},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroy=function(){this.dispose(),this.data=null},t.from=function(e){return e instanceof Array&&(e=new Float32Array(e)),new t(e)},t}();function j(t){if(4===t.BYTES_PER_ELEMENT)return t instanceof Float32Array?"Float32Array":t instanceof Uint32Array?"Uint32Array":"Int32Array";if(2===t.BYTES_PER_ELEMENT){if(t instanceof Uint16Array)return"Uint16Array"}else if(1===t.BYTES_PER_ELEMENT&&t instanceof Uint8Array)return"Uint8Array";return null}var G={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array};var U={5126:4,5123:2,5121:1},H=0,V={Float32Array:Float32Array,Uint32Array:Uint32Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array},W=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.buffers=t,this.indexBuffer=null,this.attributes=e,this.glVertexArrayObjects={},this.id=H++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new a.a("disposeGeometry"),this.refCount=0}return t.prototype.addAttribute=function(t,e,i,n,r,o,a,s){if(void 0===i&&(i=0),void 0===n&&(n=!1),void 0===s&&(s=!1),!e)throw new Error("You must pass a buffer when creating an attribute");e instanceof z||(e instanceof Array&&(e=new Float32Array(e)),e=new z(e));var h=t.split("|");if(h.length>1){for(var u=0;u<h.length;u++)this.addAttribute(h[u],e,i,n,r);return this}var l=this.buffers.indexOf(e);return-1===l&&(this.buffers.push(e),l=this.buffers.length-1),this.attributes[t]=new B(l,i,n,r,o,a,s),this.instanced=this.instanced||s,this},t.prototype.getAttribute=function(t){return this.attributes[t]},t.prototype.getBuffer=function(t){return this.buffers[this.getAttribute(t).buffer]},t.prototype.addIndex=function(t){return t instanceof z||(t instanceof Array&&(t=new Uint16Array(t)),t=new z(t)),t.index=!0,this.indexBuffer=t,-1===this.buffers.indexOf(t)&&this.buffers.push(t),this},t.prototype.getIndex=function(){return this.indexBuffer},t.prototype.interleave=function(){if(1===this.buffers.length||2===this.buffers.length&&this.indexBuffer)return this;var t,e=[],i=[],n=new z;for(t in this.attributes){var r=this.attributes[t],o=this.buffers[r.buffer];e.push(o.data),i.push(r.size*U[r.type]/4),r.buffer=0}for(n.data=function(t,e){for(var i=0,n=0,r={},o=0;o<t.length;o++)n+=e[o],i+=t[o].length;var a=new ArrayBuffer(4*i),s=null,h=0;for(o=0;o<t.length;o++){var u=e[o],l=t[o],c=j(l);r[c]||(r[c]=new G[c](a)),s=r[c];for(var d=0;d<l.length;d++){s[(d/u|0)*n+h+d%u]=l[d]}h+=u}return new Float32Array(a)}(e,i),t=0;t<this.buffers.length;t++)this.buffers[t]!==this.indexBuffer&&this.buffers[t].destroy();return this.buffers=[n],this.indexBuffer&&this.buffers.push(this.indexBuffer),this},t.prototype.getSize=function(){for(var t in this.attributes){var e=this.attributes[t];return this.buffers[e.buffer].data.length/(e.stride/4||e.size)}return 0},t.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},t.prototype.destroy=function(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null},t.prototype.clone=function(){for(var e=new t,i=0;i<this.buffers.length;i++)e.buffers[i]=new z(this.buffers[i].data.slice(0));for(var i in this.attributes){var n=this.attributes[i];e.attributes[i]=new B(n.buffer,n.size,n.normalized,n.type,n.stride,n.start,n.instance)}return this.indexBuffer&&(e.indexBuffer=e.buffers[this.buffers.indexOf(this.indexBuffer)],e.indexBuffer.index=!0),e},t.merge=function(e){for(var i,n=new t,r=[],o=[],a=[],s=0;s<e.length;s++){i=e[s];for(var h=0;h<i.buffers.length;h++)o[h]=o[h]||0,o[h]+=i.buffers[h].data.length,a[h]=0}for(s=0;s<i.buffers.length;s++)r[s]=new(V[j(i.buffers[s].data)])(o[s]),n.buffers[s]=new z(r[s]);for(s=0;s<e.length;s++){i=e[s];for(h=0;h<i.buffers.length;h++)r[h].set(i.buffers[h].data,a[h]),a[h]+=i.buffers[h].data.length}if(n.attributes=i.attributes,i.indexBuffer){n.indexBuffer=n.buffers[i.buffers.indexOf(i.indexBuffer)],n.indexBuffer.index=!0;var u=0,l=0,c=0,d=0;for(s=0;s<i.buffers.length;s++)if(i.buffers[s]!==i.indexBuffer){d=s;break}for(var s in i.attributes){var p=i.attributes[s];(0|p.buffer)===d&&(l+=p.size*U[p.type]/4)}for(s=0;s<e.length;s++){var f=e[s].indexBuffer.data;for(h=0;h<f.length;h++)n.indexBuffer.data[h+c]+=u;u+=i.buffers[d].data.length/l,c+=f.length}}return n},t}(),X=function(t){function e(){var e=t.call(this)||this;return e.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2]),e}return d(e,t),e}(W),Y=function(t){function e(){var e=t.call(this)||this;return e.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),e.uvs=new Float32Array([0,0,1,0,1,1,0,1]),e.vertexBuffer=new z(e.vertices),e.uvBuffer=new z(e.uvs),e.addAttribute("aVertexPosition",e.vertexBuffer).addAttribute("aTextureCoord",e.uvBuffer).addIndex([0,1,2,0,2,3]),e}return d(e,t),e.prototype.map=function(t,e){var i=0,n=0;return this.uvs[0]=i,this.uvs[1]=n,this.uvs[2]=i+e.width/t.width,this.uvs[3]=n,this.uvs[4]=i+e.width/t.width,this.uvs[5]=n+e.height/t.height,this.uvs[6]=i,this.uvs[7]=n+e.height/t.height,i=e.x,n=e.y,this.vertices[0]=i,this.vertices[1]=n,this.vertices[2]=i+e.width,this.vertices[3]=n,this.vertices[4]=i+e.width,this.vertices[5]=n+e.height,this.vertices[6]=i,this.vertices[7]=n+e.height,this.invalidate(),this},e.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},e}(W),q=0,K=function(){function t(t,e){this.uniforms=t,this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=q++,this.static=!!e}return t.prototype.update=function(){this.dirtyId++},t.prototype.add=function(e,i,n){this.uniforms[e]=new t(i,n)},t.from=function(e,i){return new t(e,i)},t}(),J=function(){function t(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.sourceFrame=new h.j,this.destinationFrame=new h.j,this.filters=[]}return t.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null},t}(),Z=function(t){function e(e){var i=t.call(this,e)||this;return i.defaultFilterStack=[{}],i.texturePool=new N,i.texturePool.setScreenSize(e.view),i.statePool=[],i.quad=new X,i.quadUv=new Y,i.tempRect=new h.j,i.activeState={},i.globalUniforms=new K({outputFrame:i.tempRect,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),i.forceClear=!1,i.useMaxPadding=!1,i}return d(e,t),e.prototype.push=function(t,e){for(var i=this.renderer,n=this.defaultFilterStack,r=this.statePool.pop()||new J,o=e[0].resolution,a=e[0].padding,s=e[0].autoFit,h=e[0].legacy,u=1;u<e.length;u++){var l=e[u];o=Math.min(o,l.resolution),a=this.useMaxPadding?Math.max(a,l.padding):a+l.padding,s=s&&l.autoFit,h=h||l.legacy}1===n.length&&(this.defaultFilterStack[0].renderTexture=i.renderTexture.current),n.push(r),r.resolution=o,r.legacy=h,r.target=t,r.sourceFrame.copyFrom(t.filterArea||t.getBounds(!0)),r.sourceFrame.pad(a),s&&r.sourceFrame.fit(this.renderer.renderTexture.sourceFrame),r.sourceFrame.ceil(o),r.renderTexture=this.getOptimalFilterTexture(r.sourceFrame.width,r.sourceFrame.height,o),r.filters=e,r.destinationFrame.width=r.renderTexture.width,r.destinationFrame.height=r.renderTexture.height;var c=this.tempRect;c.width=r.sourceFrame.width,c.height=r.sourceFrame.height,r.renderTexture.filterFrame=r.sourceFrame,i.renderTexture.bind(r.renderTexture,r.sourceFrame,c),i.renderTexture.clear()},e.prototype.pop=function(){var t=this.defaultFilterStack,e=t.pop(),i=e.filters;this.activeState=e;var n=this.globalUniforms.uniforms;n.outputFrame=e.sourceFrame,n.resolution=e.resolution;var o=n.inputSize,a=n.inputPixel,s=n.inputClamp;if(o[0]=e.destinationFrame.width,o[1]=e.destinationFrame.height,o[2]=1/o[0],o[3]=1/o[1],a[0]=o[0]*e.resolution,a[1]=o[1]*e.resolution,a[2]=1/a[0],a[3]=1/a[1],s[0]=.5*a[2],s[1]=.5*a[3],s[2]=e.sourceFrame.width*o[2]-.5*a[2],s[3]=e.sourceFrame.height*o[3]-.5*a[3],e.legacy){var h=n.filterArea;h[0]=e.destinationFrame.width,h[1]=e.destinationFrame.height,h[2]=e.sourceFrame.x,h[3]=e.sourceFrame.y,n.filterClamp=n.inputClamp}this.globalUniforms.update();var u=t[t.length-1];if(e.renderTexture.framebuffer.multisample>1&&this.renderer.framebuffer.blit(),1===i.length)i[0].apply(this,e.renderTexture,u.renderTexture,r.d.BLEND,e),this.returnFilterTexture(e.renderTexture);else{var l=e.renderTexture,c=this.getOptimalFilterTexture(l.width,l.height,e.resolution);c.filterFrame=l.filterFrame;var d=0;for(d=0;d<i.length-1;++d){i[d].apply(this,l,c,r.d.CLEAR,e);var p=l;l=c,c=p}i[d].apply(this,l,u.renderTexture,r.d.BLEND,e),this.returnFilterTexture(l),this.returnFilterTexture(c)}e.clear(),this.statePool.push(e)},e.prototype.bindAndClear=function(t,e){if(void 0===e&&(e=r.d.CLEAR),t&&t.filterFrame){var i=this.tempRect;i.width=t.filterFrame.width,i.height=t.filterFrame.height,this.renderer.renderTexture.bind(t,t.filterFrame,i)}else this.renderer.renderTexture.bind(t);"boolean"==typeof e&&(e=e?r.d.CLEAR:r.d.BLEND,Object(o.deprecation)("5.2.1","Use CLEAR_MODES when using clear applyFilter option")),(e===r.d.CLEAR||e===r.d.BLIT&&this.forceClear)&&this.renderer.renderTexture.clear()},e.prototype.applyFilter=function(t,e,i,n){var o=this.renderer;this.bindAndClear(i,n),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,o.state.set(t.state),o.shader.bind(t),t.legacy?(this.quadUv.map(e._frame,e.filterFrame),o.geometry.bind(this.quadUv),o.geometry.draw(r.e.TRIANGLES)):(o.geometry.bind(this.quad),o.geometry.draw(r.e.TRIANGLE_STRIP))},e.prototype.calculateSpriteMatrix=function(t,e){var i=this.activeState,n=i.sourceFrame,r=i.destinationFrame,o=e._texture.orig,a=t.set(r.width,0,0,r.height,n.x,n.y),s=e.worldTransform.copyTo(h.d.TEMP_MATRIX);return s.invert(),a.prepend(s),a.scale(1/o.width,1/o.height),a.translate(e.anchor.x,e.anchor.y),a},e.prototype.destroy=function(){this.texturePool.clear(!1)},e.prototype.getOptimalFilterTexture=function(t,e,i){return void 0===i&&(i=1),this.texturePool.getOptimalTexture(t,e,i)},e.prototype.getFilterTexture=function(t,e){if("number"==typeof t){var i=t;t=e,e=i}t=t||this.activeState.renderTexture;var n=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution);return n.filterFrame=t.filterFrame,n},e.prototype.returnFilterTexture=function(t){this.texturePool.returnTexture(t)},e.prototype.emptyPool=function(){this.texturePool.clear(!0)},e.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},e}(E),Q=function(){function t(t){this.renderer=t}return t.prototype.flush=function(){},t.prototype.destroy=function(){this.renderer=null},t.prototype.start=function(){},t.prototype.stop=function(){this.flush()},t.prototype.render=function(t){},t}(),$=function(t){function e(e){var i=t.call(this,e)||this;return i.emptyRenderer=new Q(e),i.currentRenderer=i.emptyRenderer,i}return d(e,t),e.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},e.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},e.prototype.copyBoundTextures=function(t,e){for(var i=this.renderer.texture.boundTextures,n=e-1;n>=0;--n)t[n]=i[n]||null,t[n]&&(t[n]._batchLocation=n)},e.prototype.boundArray=function(t,e,i,n){for(var r=t.elements,o=t.ids,a=t.count,s=0,h=0;h<a;h++){var u=r[h],l=u._batchLocation;if(l>=0&&l<n&&e[l]===u)o[h]=l;else for(;s<n;){var c=e[s];if(!c||c._batchEnabled!==i||c._batchLocation!==s){o[h]=s,u._batchLocation=s,e[s]=u;break}s++}}},e}(E),tt=0,et=function(t){function e(e){var i=t.call(this,e)||this;return i.webGLVersion=1,i.extensions={},i.supports={uint32Indices:!1},i.handleContextLost=i.handleContextLost.bind(i),i.handleContextRestored=i.handleContextRestored.bind(i),e.view.addEventListener("webglcontextlost",i.handleContextLost,!1),e.view.addEventListener("webglcontextrestored",i.handleContextRestored,!1),i}return d(e,t),Object.defineProperty(e.prototype,"isLost",{get:function(){return!this.gl||this.gl.isContextLost()},enumerable:!1,configurable:!0}),e.prototype.contextChange=function(t){this.gl=t,this.renderer.gl=t,this.renderer.CONTEXT_UID=tt++,t.isContextLost()&&t.getExtension("WEBGL_lose_context")&&t.getExtension("WEBGL_lose_context").restoreContext()},e.prototype.initFromContext=function(t){this.gl=t,this.validateContext(t),this.renderer.gl=t,this.renderer.CONTEXT_UID=tt++,this.renderer.runners.contextChange.emit(t)},e.prototype.initFromOptions=function(t){var e=this.createContext(this.renderer.view,t);this.initFromContext(e)},e.prototype.createContext=function(t,e){var i;if(n.b.PREFER_ENV>=r.f.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,!(i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion?Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,{anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),colorBufferFloat:t.getExtension("EXT_color_buffer_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},e.prototype.validateContext=function(t){var e=t.getContextAttributes(),i="WebGL2RenderingContext"in window&&t instanceof window.WebGL2RenderingContext;i&&(this.webGLVersion=2),e.stencil;var n=i||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=n},e}(E),it=function(t){this.framebuffer=t,this.stencil=null,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.multisample=r.k.NONE,this.msaaBuffer=null,this.blitFramebuffer=null},nt=new h.j,rt=function(t){function e(e){var i=t.call(this,e)||this;return i.managedFramebuffers=[],i.unknownFramebuffer=new M(10,10),i.msaaSamples=null,i}return d(e,t),e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new h.j,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;n.b.PREFER_ENV===r.f.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)},e.prototype.bind=function(t,e){var i=this.gl;if(t){var n=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,i.bindFramebuffer(i.FRAMEBUFFER,n.framebuffer)),n.dirtyId!==t.dirtyId&&(n.dirtyId=t.dirtyId,n.dirtyFormat!==t.dirtyFormat?(n.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):n.dirtySize!==t.dirtySize&&(n.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var r=0;r<t.colorTextures.length;r++){var o=t.colorTextures[r];this.renderer.texture.unbind(o.parentTextureArray||o)}t.depthTexture&&this.renderer.texture.unbind(t.depthTexture),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,t.width,t.height)}else this.current&&(this.current=null,i.bindFramebuffer(i.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},e.prototype.setViewport=function(t,e,i,n){var r=this.viewport;r.width===i&&r.height===n&&r.x===t&&r.y===e||(r.x=t,r.y=e,r.width=i,r.height=n,this.gl.viewport(t,e,i,n))},Object.defineProperty(e.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),e.prototype.clear=function(t,e,i,n,o){void 0===o&&(o=r.c.COLOR|r.c.DEPTH);var a=this.gl;a.clearColor(t,e,i,n),a.clear(o)},e.prototype.initFramebuffer=function(t){var e=this.gl,i=new it(e.createFramebuffer());return i.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(t),t.disposeRunner.add(this),i},e.prototype.resizeFramebuffer=function(t){var e=this.gl,i=t.glFramebuffers[this.CONTEXT_UID];i.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height));for(var n=t.colorTextures,r=0;r<n.length;r++)this.renderer.texture.bind(n[r],0);t.depthTexture&&this.renderer.texture.bind(t.depthTexture,0)},e.prototype.updateFramebuffer=function(t){var e=this.gl,i=t.glFramebuffers[this.CONTEXT_UID],n=t.colorTextures.length;e.drawBuffers||(n=Math.min(n,1)),i.multisample>1&&(i.msaaBuffer=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,i.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,e.RGBA8,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,i.msaaBuffer));for(var r=[],o=0;o<n;o++)if(!(0===o&&i.multisample>1)){var a=t.colorTextures[o],s=a.parentTextureArray||a;this.renderer.texture.bind(s,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+o,a.target,s._glTextures[this.CONTEXT_UID].texture,0),r.push(e.COLOR_ATTACHMENT0+o)}if((r.length>1&&e.drawBuffers(r),t.depthTexture)&&this.writeDepthTexture){var h=t.depthTexture;this.renderer.texture.bind(h,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,h._glTextures[this.CONTEXT_UID].texture,0)}i.stencil||!t.stencil&&!t.depth||(i.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,i.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,i.stencil))},e.prototype.detectSamples=function(t){var e=this.msaaSamples,i=r.k.NONE;if(t<=1||null===e)return i;for(var n=0;n<e.length;n++)if(e[n]<=t){i=e[n];break}return 1===i&&(i=r.k.NONE),i},e.prototype.blit=function(t,e,i){var n=this.current,r=this.renderer,o=this.gl,a=this.CONTEXT_UID;if(2===r.context.webGLVersion&&n){var s=n.glFramebuffers[a];if(s){if(!t){if(s.multisample<=1)return;s.blitFramebuffer||(s.blitFramebuffer=new M(n.width,n.height),s.blitFramebuffer.addColorTexture(0,n.colorTextures[0])),(t=s.blitFramebuffer).width=n.width,t.height=n.height}e||((e=nt).width=n.width,e.height=n.height),i||(i=e);var h=e.width===i.width&&e.height===i.height;this.bind(t),o.bindFramebuffer(o.READ_FRAMEBUFFER,s.framebuffer),o.blitFramebuffer(e.x,e.y,e.width,e.height,i.x,i.y,i.width,i.height,o.COLOR_BUFFER_BIT,h?o.NEAREST:o.LINEAR)}}},e.prototype.disposeFramebuffer=function(t,e){var i=t.glFramebuffers[this.CONTEXT_UID],n=this.gl;if(i){delete t.glFramebuffers[this.CONTEXT_UID];var r=this.managedFramebuffers.indexOf(t);r>=0&&this.managedFramebuffers.splice(r,1),t.disposeRunner.remove(this),e||(n.deleteFramebuffer(i.framebuffer),i.stencil&&n.deleteRenderbuffer(i.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var i=0;i<e.length;i++)this.disposeFramebuffer(e[i],t)},e.prototype.forceStencil=function(){var t=this.current;if(t){var e=t.glFramebuffers[this.CONTEXT_UID];if(e&&!e.stencil){t.enableStencil();var i=t.width,n=t.height,r=this.gl,o=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,o),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,i,n),e.stencil=o,r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,o)}}},e.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new h.j},e}(E),ot=function(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0},at={5126:4,5123:2,5121:1},st=function(t){function e(e){var i=t.call(this,e)||this;return i._activeGeometry=null,i._activeVao=null,i.hasVao=!0,i.hasInstance=!0,i.canUseUInt32ElementIndex=!1,i.managedGeometries={},i.managedBuffers={},i}return d(e,t),e.prototype.contextChange=function(){this.disposeAll(!0);var t=this.gl=this.renderer.gl,e=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,2!==e.webGLVersion){var i=this.renderer.context.extensions.vertexArrayObject;n.b.PREFER_ENV===r.f.WEBGL_LEGACY&&(i=null),i?(t.createVertexArray=function(){return i.createVertexArrayOES()},t.bindVertexArray=function(t){return i.bindVertexArrayOES(t)},t.deleteVertexArray=function(t){return i.deleteVertexArrayOES(t)}):(this.hasVao=!1,t.createVertexArray=function(){return null},t.bindVertexArray=function(){return null},t.deleteVertexArray=function(){return null})}if(2!==e.webGLVersion){var o=t.getExtension("ANGLE_instanced_arrays");o?(t.vertexAttribDivisor=function(t,e){return o.vertexAttribDivisorANGLE(t,e)},t.drawElementsInstanced=function(t,e,i,n,r){return o.drawElementsInstancedANGLE(t,e,i,n,r)},t.drawArraysInstanced=function(t,e,i,n){return o.drawArraysInstancedANGLE(t,e,i,n)}):this.hasInstance=!1}this.canUseUInt32ElementIndex=2===e.webGLVersion||!!e.extensions.uint32ElementIndex},e.prototype.bind=function(t,e){e=e||this.renderer.shader.shader;var i=this.gl,n=t.glVertexArrayObjects[this.CONTEXT_UID],r=!1;n||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=n={},r=!0);var o=n[e.program.id]||this.initGeometryVao(t,e.program,r);this._activeGeometry=t,this._activeVao!==o&&(this._activeVao=o,this.hasVao?i.bindVertexArray(o):this.activateVao(t,e.program)),this.updateBuffers()},e.prototype.reset=function(){this.unbind()},e.prototype.updateBuffers=function(){for(var t=this._activeGeometry,e=this.gl,i=0;i<t.buffers.length;i++){var n=t.buffers[i],r=n._glBuffers[this.CONTEXT_UID];if(n._updateID!==r.updateID){r.updateID=n._updateID;var o=n.index?e.ELEMENT_ARRAY_BUFFER:e.ARRAY_BUFFER;if(e.bindBuffer(o,r.buffer),this._boundBuffer=r,r.byteLength>=n.data.byteLength)e.bufferSubData(o,0,n.data);else{var a=n.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;r.byteLength=n.data.byteLength,e.bufferData(o,n.data,a)}}}},e.prototype.checkCompatibility=function(t,e){var i=t.attributes,n=e.attributeData;for(var r in n)if(!i[r])throw new Error('shader and geometry incompatible, geometry missing the "'+r+'" attribute')},e.prototype.getSignature=function(t,e){var i=t.attributes,n=e.attributeData,r=["g",t.id];for(var o in i)n[o]&&r.push(o);return r.join("-")},e.prototype.initGeometryVao=function(t,e,i){void 0===i&&(i=!0),this.checkCompatibility(t,e);var n=this.gl,r=this.CONTEXT_UID,o=this.getSignature(t,e),a=t.glVertexArrayObjects[this.CONTEXT_UID],s=a[o];if(s)return a[e.id]=s,s;var h=t.buffers,u=t.attributes,l={},c={};for(var d in h)l[d]=0,c[d]=0;for(var d in u)!u[d].size&&e.attributeData[d]?u[d].size=e.attributeData[d].size:u[d].size,l[u[d].buffer]+=u[d].size*at[u[d].type];for(var d in u){var p=u[d],f=p.size;void 0===p.stride&&(l[p.buffer]===f*at[p.type]?p.stride=0:p.stride=l[p.buffer]),void 0===p.start&&(p.start=c[p.buffer],c[p.buffer]+=f*at[p.type])}s=n.createVertexArray(),n.bindVertexArray(s);for(var m=0;m<h.length;m++){var g=h[m];g._glBuffers[r]||(g._glBuffers[r]=new ot(n.createBuffer()),this.managedBuffers[g.id]=g,g.disposeRunner.add(this)),i&&g._glBuffers[r].refCount++}return this.activateVao(t,e),this._activeVao=s,a[e.id]=s,a[o]=s,s},e.prototype.disposeBuffer=function(t,e){if(this.managedBuffers[t.id]){delete this.managedBuffers[t.id];var i=t._glBuffers[this.CONTEXT_UID],n=this.gl;t.disposeRunner.remove(this),i&&(e||n.deleteBuffer(i.buffer),delete t._glBuffers[this.CONTEXT_UID])}},e.prototype.disposeGeometry=function(t,e){if(this.managedGeometries[t.id]){delete this.managedGeometries[t.id];var i=t.glVertexArrayObjects[this.CONTEXT_UID],n=this.gl,r=t.buffers;if(t.disposeRunner.remove(this),i){for(var o=0;o<r.length;o++){var a=r[o]._glBuffers[this.CONTEXT_UID];a.refCount--,0!==a.refCount||e||this.disposeBuffer(r[o],e)}if(!e)for(var s in i)if("g"===s[0]){var h=i[s];this._activeVao===h&&this.unbind(),n.deleteVertexArray(h)}delete t.glVertexArrayObjects[this.CONTEXT_UID]}}},e.prototype.disposeAll=function(t){for(var e=Object.keys(this.managedGeometries),i=0;i<e.length;i++)this.disposeGeometry(this.managedGeometries[e[i]],t);e=Object.keys(this.managedBuffers);for(i=0;i<e.length;i++)this.disposeBuffer(this.managedBuffers[e[i]],t)},e.prototype.activateVao=function(t,e){var i=this.gl,n=this.CONTEXT_UID,r=t.buffers,o=t.attributes;t.indexBuffer&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t.indexBuffer._glBuffers[n].buffer);var a=null;for(var s in o){var h=o[s],u=r[h.buffer]._glBuffers[n];if(e.attributeData[s]){a!==u&&(i.bindBuffer(i.ARRAY_BUFFER,u.buffer),a=u);var l=e.attributeData[s].location;if(i.enableVertexAttribArray(l),i.vertexAttribPointer(l,h.size,h.type||i.FLOAT,h.normalized,h.stride,h.start),h.instance){if(!this.hasInstance)throw new Error("geometry error, GPU Instancing is not supported on this device");i.vertexAttribDivisor(l,1)}}}},e.prototype.draw=function(t,e,i,n){var r=this.gl,o=this._activeGeometry;if(o.indexBuffer){var a=o.indexBuffer.data.BYTES_PER_ELEMENT,s=2===a?r.UNSIGNED_SHORT:r.UNSIGNED_INT;(2===a||4===a&&this.canUseUInt32ElementIndex)&&(o.instanced?r.drawElementsInstanced(t,e||o.indexBuffer.data.length,s,(i||0)*a,n||1):r.drawElements(t,e||o.indexBuffer.data.length,s,(i||0)*a))}else o.instanced?r.drawArraysInstanced(t,i,e||o.getSize(),n||1):r.drawArrays(t,i,e||o.getSize());return this},e.prototype.unbind=function(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null},e}(E),ht=function(){function t(t){void 0===t&&(t=null),this.type=r.i.NONE,this.autoDetect=!0,this.maskObject=t||null,this.pooled=!1,this.isMaskData=!0,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._target=null}return t.prototype.reset=function(){this.pooled&&(this.maskObject=null,this.type=r.i.NONE,this.autoDetect=!0),this._target=null},t.prototype.copyCountersOrReset=function(t){t?(this._stencilCounter=t._stencilCounter,this._scissorCounter=t._scissorCounter,this._scissorRect=t._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)},t}();function ut(t,e,i){var n=t.createShader(e);return t.shaderSource(n,i),t.compileShader(n),n}function lt(t,e,i,n){var r=ut(t,t.VERTEX_SHADER,e),o=ut(t,t.FRAGMENT_SHADER,i),a=t.createProgram();if(t.attachShader(a,r),t.attachShader(a,o),n)for(var s in n)t.bindAttribLocation(a,n[s],s);return t.linkProgram(a),t.getProgramParameter(a,t.LINK_STATUS)||(t.getShaderParameter(r,t.COMPILE_STATUS),t.getShaderParameter(o,t.COMPILE_STATUS),t.getProgramInfoLog(a),t.deleteProgram(a),a=null),t.deleteShader(r),t.deleteShader(o),a}function ct(t){for(var e=new Array(t),i=0;i<e.length;i++)e[i]=!1;return e}function dt(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":case"sampler2DArray":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 ct(2*e);case"bvec3":return ct(3*e);case"bvec4":return ct(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])}return null}var pt,ft={},mt=ft;function gt(){if(mt===ft||mt&&mt.isContextLost()){var t=document.createElement("canvas"),e=void 0;n.b.PREFER_ENV>=r.f.WEBGL2&&(e=t.getContext("webgl2",{})),e||((e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}))?e.getExtension("WEBGL_draw_buffers"):e=null),mt=e}return mt}function yt(t,e,i){if("precision"!==t.substring(0,9)){var n=e;return e===r.l.HIGH&&i!==r.l.HIGH&&(n=r.l.MEDIUM),"precision "+n+" float;\n"+t}return i!==r.l.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var vt={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};function bt(t){return vt[t]}var _t=null,wt={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",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function xt(t,e){if(!_t){var i=Object.keys(wt);_t={};for(var n=0;n<i.length;++n){var r=i[n];_t[t[r]]=wt[r]}}return _t[e]}var Ct=[{test:function(t){return"float"===t.type&&1===t.size},code:function(t){return'\n if(uv["'+t+'"] !== ud["'+t+'"].value)\n {\n ud["'+t+'"].value = uv["'+t+'"]\n gl.uniform1f(ud["'+t+'"].location, uv["'+t+'"])\n }\n '}},{test:function(t){return("sampler2D"===t.type||"samplerCube"===t.type||"sampler2DArray"===t.type)&&1===t.size&&!t.isArray},code:function(t){return't = syncData.textureCount++;\n\n renderer.texture.bind(uv["'+t+'"], t);\n\n if(ud["'+t+'"].value !== t)\n {\n ud["'+t+'"].value = t;\n gl.uniform1i(ud["'+t+'"].location, t);\n; // eslint-disable-line max-len\n }'}},{test:function(t,e){return"mat3"===t.type&&1===t.size&&void 0!==e.a},code:function(t){return'\n gl.uniformMatrix3fv(ud["'+t+'"].location, false, uv["'+t+'"].toArray(true));\n '}},{test:function(t,e){return"vec2"===t.type&&1===t.size&&void 0!==e.x},code:function(t){return'\n cv = ud["'+t+'"].value;\n v = uv["'+t+'"];\n\n if(cv[0] !== v.x || cv[1] !== v.y)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n gl.uniform2f(ud["'+t+'"].location, v.x, v.y);\n }'}},{test:function(t){return"vec2"===t.type&&1===t.size},code:function(t){return'\n cv = ud["'+t+'"].value;\n v = uv["'+t+'"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(ud["'+t+'"].location, v[0], v[1]);\n }\n '}},{test:function(t,e){return"vec4"===t.type&&1===t.size&&void 0!==e.width},code:function(t){return'\n cv = ud["'+t+'"].value;\n v = uv["'+t+'"];\n\n if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n cv[2] = v.width;\n cv[3] = v.height;\n gl.uniform4f(ud["'+t+'"].location, v.x, v.y, v.width, v.height)\n }'}},{test:function(t){return"vec4"===t.type&&1===t.size},code:function(t){return'\n cv = ud["'+t+'"].value;\n v = uv["'+t+'"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(ud["'+t+'"].location, v[0], v[1], v[2], v[3])\n }'}}],St={float:"\n if(cv !== v)\n {\n cv.v = v;\n gl.uniform1f(location, v)\n }",vec2:"\n if(cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(location, v[0], v[1])\n }",vec3:"\n if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3f(location, v[0], v[1], v[2])\n }",vec4:"gl.uniform4f(location, v[0], v[1], v[2], v[3])",int:"gl.uniform1i(location, v)",ivec2:"gl.uniform2i(location, v[0], v[1])",ivec3:"gl.uniform3i(location, v[0], v[1], v[2])",ivec4:"gl.uniform4i(location, v[0], v[1], v[2], v[3])",bool:"gl.uniform1i(location, v)",bvec2:"gl.uniform2i(location, v[0], v[1])",bvec3:"gl.uniform3i(location, v[0], v[1], v[2])",bvec4:"gl.uniform4i(location, v[0], v[1], v[2], v[3])",mat2:"gl.uniformMatrix2fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",sampler2D:"gl.uniform1i(location, v)",samplerCube:"gl.uniform1i(location, v)",sampler2DArray:"gl.uniform1i(location, v)"},Tt={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};var At,Et=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function Pt(t){for(var e="",i=0;i<t;++i)i>0&&(e+="\nelse "),i<t-1&&(e+="if(test == "+i+".0){}");return e}function Mt(t,e){if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");for(var i=e.createShader(e.FRAGMENT_SHADER);;){var n=Et.replace(/%forloop%/gi,Pt(t));if(e.shaderSource(i,n),e.compileShader(i),e.getShaderParameter(i,e.COMPILE_STATUS))break;t=t/2|0}return t}var It=0,kt={},Ot=function(){function t(e,i,o){void 0===o&&(o="pixi-shader"),this.id=It++,this.vertexSrc=e||t.defaultVertexSrc,this.fragmentSrc=i||t.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),"#version"!==this.vertexSrc.substring(0,8)&&(o=o.replace(/\s+/g,"-"),kt[o]?(kt[o]++,o+="-"+kt[o]):kt[o]=1,this.vertexSrc="#define SHADER_NAME "+o+"\n"+this.vertexSrc,this.fragmentSrc="#define SHADER_NAME "+o+"\n"+this.fragmentSrc,this.vertexSrc=yt(this.vertexSrc,n.b.PRECISION_VERTEX,r.l.HIGH),this.fragmentSrc=yt(this.fragmentSrc,n.b.PRECISION_FRAGMENT,function(){if(!pt){pt=r.l.MEDIUM;var t=gt();if(t&&t.getShaderPrecisionFormat){var e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);pt=e.precision?r.l.HIGH:r.l.MEDIUM}}return pt}())),this.extractData(this.vertexSrc,this.fragmentSrc),this.glPrograms={},this.syncUniforms=null}return t.prototype.extractData=function(t,e){var i=gt();if(i){var n=lt(i,t,e);this.attributeData=this.getAttributeData(n,i),this.uniformData=this.getUniformData(n,i),i.deleteProgram(n)}else this.uniformData={},this.attributeData={}},t.prototype.getAttributeData=function(t,e){for(var i={},n=[],r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),o=0;o<r;o++){var a=e.getActiveAttrib(t,o),s=xt(e,a.type),h={type:s,name:a.name,size:bt(s),location:0};i[a.name]=h,n.push(h)}n.sort((function(t,e){return t.name>e.name?1:-1}));for(o=0;o<n.length;o++)n[o].location=o;return i},t.prototype.getUniformData=function(t,e){for(var i={},n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),r=0;r<n;r++){var o=e.getActiveUniform(t,r),a=o.name.replace(/\[.*?\]$/,""),s=o.name.match(/\[.*?\]$/),h=xt(e,o.type);i[a]={type:h,size:o.size,isArray:s,value:dt(h,o.size)}}return i},Object.defineProperty(t,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\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"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}"},enumerable:!1,configurable:!0}),t.from=function(e,i,n){var r=e+i,a=o.ProgramCache[r];return a||(o.ProgramCache[r]=a=new t(e,i,n)),a},t}(),Rt=function(){function t(t,e){for(var i in this.program=t,this.uniformGroup=e?e instanceof K?e:new K(e):new K({}),t.uniformData)this.uniformGroup.uniforms[i]instanceof Array&&(this.uniformGroup.uniforms[i]=new Float32Array(this.uniformGroup.uniforms[i]))}return t.prototype.checkUniformExists=function(t,e){if(e.uniforms[t])return!0;for(var i in e.uniforms){var n=e.uniforms[i];if(n.group&&this.checkUniformExists(t,n))return!0}return!1},t.prototype.destroy=function(){this.uniformGroup=null},Object.defineProperty(t.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),t.from=function(e,i,n){return new t(Ot.from(e,i),n)},t}(),Dt=function(){function t(){this.data=0,this.blendMode=r.b.NORMAL,this.polygonOffset=0,this.blend=!0}return Object.defineProperty(t.prototype,"blend",{get:function(){return!!(1&this.data)},set:function(t){!!(1&this.data)!==t&&(this.data^=1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"offsets",{get:function(){return!!(2&this.data)},set:function(t){!!(2&this.data)!==t&&(this.data^=2)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"culling",{get:function(){return!!(4&this.data)},set:function(t){!!(4&this.data)!==t&&(this.data^=4)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"depthTest",{get:function(){return!!(8&this.data)},set:function(t){!!(8&this.data)!==t&&(this.data^=8)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clockwiseFrontFace",{get:function(){return!!(16&this.data)},set:function(t){!!(16&this.data)!==t&&(this.data^=16)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blendMode",{get:function(){return this._blendMode},set:function(t){this.blend=t!==r.b.NONE,this._blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(t){this.offsets=!!t,this._polygonOffset=t},enumerable:!1,configurable:!0}),t.for2d=function(){var e=new t;return e.depthTest=!1,e.blend=!0,e},t}(),Lt=function(t){function e(i,r,o){var a=this,s=Ot.from(i||e.defaultVertexSrc,r||e.defaultFragmentSrc);return(a=t.call(this,s,o)||this).padding=0,a.resolution=n.b.FILTER_RESOLUTION,a.enabled=!0,a.autoFit=!0,a.legacy=!!a.program.attributeData.aTextureCoord,a.state=new Dt,a}return d(e,t),e.prototype.apply=function(t,e,i,n,r){t.applyFilter(this,e,i,n)},Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultVertexSrc",{get:function(){return"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultFragmentSrc",{get:function(){return"varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n"},enumerable:!1,configurable:!0}),e}(Rt),Nt=new h.d,Bt=function(){function t(t,e){this._texture=t,this.mapCoord=new h.d,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===e?.5:e,this.isSimple=!1}return Object.defineProperty(t.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture=t,this._textureID=-1},enumerable:!1,configurable:!0}),t.prototype.multiplyUvs=function(t,e){void 0===e&&(e=t);for(var i=this.mapCoord,n=0;n<t.length;n+=2){var r=t[n],o=t[n+1];e[n]=r*i.a+o*i.c+i.tx,e[n+1]=r*i.b+o*i.d+i.ty}return e},t.prototype.update=function(t){var e=this._texture;if(!e||!e.valid)return!1;if(!t&&this._textureID===e._updateID)return!1;this._textureID=e._updateID,this._updateID++;var i=e._uvs;this.mapCoord.set(i.x1-i.x0,i.y1-i.y0,i.x3-i.x0,i.y3-i.y0,i.x0,i.y0);var n=e.orig,r=e.trim;r&&(Nt.set(n.width/r.width,0,0,n.height/r.height,-r.x/r.width,-r.y/r.height),this.mapCoord.append(Nt));var o=e.baseTexture,a=this.uClampFrame,s=this.clampMargin/o.resolution,h=this.clampOffset;return a[0]=(e._frame.x+s+h)/o.width,a[1]=(e._frame.y+s+h)/o.height,a[2]=(e._frame.x+e._frame.width-s+h)/o.width,a[3]=(e._frame.y+e._frame.height-s+h)/o.height,this.uClampOffset[0]=h/o.realWidth,this.uClampOffset[1]=h/o.realHeight,this.isSimple=e._frame.width===o.width&&e._frame.height===o.height&&0===e.rotate,!0},t}(),Ft=function(t){function e(e){var i=this,n=new h.d;return i=t.call(this,"attribute 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\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n}\n","varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform float npmAlpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n float clip = step(3.5,\n step(maskClamp.x, vMaskCoord.x) +\n step(maskClamp.y, vMaskCoord.y) +\n step(vMaskCoord.x, maskClamp.z) +\n step(vMaskCoord.y, maskClamp.w));\n\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n original *= (alphaMul * masky.r * alpha * clip);\n\n gl_FragColor = original;\n}\n")||this,e.renderable=!1,i.maskSprite=e,i.maskMatrix=n,i}return d(e,t),e.prototype.apply=function(t,e,i,n){var r=this.maskSprite,o=r._texture;o.valid&&(o.uvMatrix||(o.uvMatrix=new Bt(o,0)),o.uvMatrix.update(),this.uniforms.npmAlpha=o.baseTexture.alphaMode?0:1,this.uniforms.mask=o,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,r).prepend(o.uvMatrix.mapCoord),this.uniforms.alpha=r.worldAlpha,this.uniforms.maskClamp=o.uvMatrix.uClampFrame,t.applyFilter(this,e,i,n))},e}(Lt),zt=function(t){function e(e){var i=t.call(this,e)||this;return i.enableScissor=!1,i.alphaMaskPool=[],i.maskDataPool=[],i.maskStack=[],i.alphaMaskIndex=0,i}return d(e,t),e.prototype.setMaskStack=function(t){this.maskStack=t,this.renderer.scissor.setMaskStack(t),this.renderer.stencil.setMaskStack(t)},e.prototype.push=function(t,e){var i=e;if(!i.isMaskData){var n=this.maskDataPool.pop()||new ht;n.pooled=!0,n.maskObject=e,i=n}switch(i.autoDetect&&this.detect(i),i.copyCountersOrReset(this.maskStack[this.maskStack.length-1]),i._target=t,i.type){case r.i.SCISSOR:this.maskStack.push(i),this.renderer.scissor.push(i);break;case r.i.STENCIL:this.maskStack.push(i),this.renderer.stencil.push(i);break;case r.i.SPRITE:i.copyCountersOrReset(null),this.pushSpriteMask(i),this.maskStack.push(i)}},e.prototype.pop=function(t){var e=this.maskStack.pop();if(e&&e._target===t){switch(e.type){case r.i.SCISSOR:this.renderer.scissor.pop();break;case r.i.STENCIL:this.renderer.stencil.pop(e.maskObject);break;case r.i.SPRITE:this.popSpriteMask()}e.reset(),e.pooled&&this.maskDataPool.push(e)}},e.prototype.detect=function(t){var e=t.maskObject;if(e.isSprite)t.type=r.i.SPRITE;else if(t.type=r.i.STENCIL,this.enableScissor&&e.isFastRect&&e.isFastRect()){var i=e.worldTransform,n=Math.atan2(i.b,i.a),o=Math.atan2(i.d,i.c);n=Math.round(n*(180/Math.PI)*100),o=((o=Math.round(o*(180/Math.PI)*100)-n)%18e3+18e3)%18e3,0===(n=(n%9e3+9e3)%9e3)&&9e3===o&&(t.type=r.i.SCISSOR)}},e.prototype.pushSpriteMask=function(t){var e=t.maskObject,i=t._target,n=this.alphaMaskPool[this.alphaMaskIndex];n||(n=this.alphaMaskPool[this.alphaMaskIndex]=[new Ft(e)]),n[0].resolution=this.renderer.resolution,n[0].maskSprite=e;var r=i.filterArea;i.filterArea=e.getBounds(!0),this.renderer.filter.push(i,n),i.filterArea=r,this.alphaMaskIndex++},e.prototype.popSpriteMask=function(){this.renderer.filter.pop(),this.alphaMaskIndex--},e}(E),jt=function(t){function e(e){var i=t.call(this,e)||this;return i.maskStack=[],i.glConst=0,i}return d(e,t),e.prototype.getStackLength=function(){return this.maskStack.length},e.prototype.setMaskStack=function(t){var e=this.renderer.gl,i=this.getStackLength();this.maskStack=t;var n=this.getStackLength();n!==i&&(0===n?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))},e.prototype._useCurrent=function(){},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.maskStack=null},e}(E),Gt=function(t){function e(e){var i=t.call(this,e)||this;return i.glConst=WebGLRenderingContext.SCISSOR_TEST,i}return d(e,t),e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0},e.prototype.push=function(t){var e=t.maskObject;e.renderable=!0;var i=t._scissorRect,n=e.getBounds(!0),r=this.renderer.gl;e.renderable=!1,i?n.fit(i):r.enable(r.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=n,this._useCurrent()},e.prototype.pop=function(){var t=this.renderer.gl;this.getStackLength()>0?this._useCurrent():t.disable(t.SCISSOR_TEST)},e.prototype._useCurrent=function(){var t=this.maskStack[this.maskStack.length-1]._scissorRect,e=this.renderer.renderTexture.current,i=this.renderer.projection,n=i.transform,r=i.sourceFrame,o=i.destinationFrame,a=e?e.resolution:this.renderer.resolution,s=(t.x-r.x)*a+o.x,h=(t.y-r.y)*a+o.y,u=t.width*a,l=t.height*a;n&&(s+=n.tx*a,h+=n.ty*a),e||(h=this.renderer.height-l-h),this.renderer.gl.scissor(s,h,u,l)},e}(jt),Ut=function(t){function e(e){var i=t.call(this,e)||this;return i.glConst=WebGLRenderingContext.STENCIL_TEST,i}return d(e,t),e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0},e.prototype.push=function(t){var e=t.maskObject,i=this.renderer.gl,n=t._stencilCounter;0===n&&(this.renderer.framebuffer.forceStencil(),i.enable(i.STENCIL_TEST)),t._stencilCounter++,i.colorMask(!1,!1,!1,!1),i.stencilFunc(i.EQUAL,n,this._getBitwiseMask()),i.stencilOp(i.KEEP,i.KEEP,i.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent()},e.prototype.pop=function(t){var e=this.renderer.gl;0===this.getStackLength()?(e.disable(e.STENCIL_TEST),e.clear(e.STENCIL_BUFFER_BIT),e.clearStencil(0)):(e.colorMask(!1,!1,!1,!1),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,this._useCurrent())},e.prototype._useCurrent=function(){var t=this.renderer.gl;t.colorMask(!0,!0,!0,!0),t.stencilFunc(t.EQUAL,this.getStackLength(),this._getBitwiseMask()),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},e.prototype._getBitwiseMask=function(){return(1<<this.getStackLength())-1},e}(jt),Ht=function(t){function e(e){var i=t.call(this,e)||this;return i.destinationFrame=null,i.sourceFrame=null,i.defaultFrame=null,i.projectionMatrix=new h.d,i.transform=null,i}return d(e,t),e.prototype.update=function(t,e,i,n){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,n),this.transform&&this.projectionMatrix.append(this.transform);var r=this.renderer;r.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,r.globalUniforms.update(),r.shader.shader&&r.shader.syncUniformGroup(r.shader.shader.uniforms.globals)},e.prototype.calculateProjection=function(t,e,i,n){var r=this.projectionMatrix,o=n?-1:1;r.identity(),r.a=1/e.width*2,r.d=o*(1/e.height*2),r.tx=-1-e.x*r.a,r.ty=-o-e.y*r.d},e.prototype.setTransform=function(t){},e}(E),Vt=new h.j,Wt=new h.j,Xt=new h.j,Yt=function(t){function e(e){var i=t.call(this,e)||this;return i.clearColor=e._backgroundColorRgba,i.defaultMaskStack=[],i.current=null,i.sourceFrame=new h.j,i.destinationFrame=new h.j,i}return d(e,t),e.prototype.bind=function(t,e,i){void 0===t&&(t=null);var n,r,o,a=this.renderer;this.current=t,t?(o=(n=t.baseTexture).resolution,e||(Vt.width=t.frame.width,Vt.height=t.frame.height,e=Vt),i||(Wt.x=t.frame.x,Wt.y=t.frame.y,Wt.width=e.width,Wt.height=e.height,i=Wt),r=n.framebuffer):(o=a.resolution,e||(Vt.width=a.screen.width,Vt.height=a.screen.height,e=Vt),i||((i=Vt).width=e.width,i.height=e.height)),Xt.x=i.x*o,Xt.y=i.y*o,Xt.width=i.width*o,Xt.height=i.height*o,this.renderer.framebuffer.bind(r,Xt),this.renderer.projection.update(i,e,o,!r),t?this.renderer.mask.setMaskStack(n.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(i)},e.prototype.clear=function(t,e){t=this.current?t||this.current.baseTexture.clearColor:t||this.clearColor,this.renderer.framebuffer.clear(t[0],t[1],t[2],t[3],e)},e.prototype.resize=function(){this.bind(null)},e.prototype.reset=function(){this.bind(null)},e}(E),qt=function(){},Kt=function(){function t(t,e){this.program=t,this.uniformData=e,this.uniformGroups={}}return t.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.program=null},t}(),Jt=0,Zt={textureCount:0},Qt=function(t){function e(e){var i=t.call(this,e)||this;return i.destroyed=!1,i.systemCheck(),i.gl=null,i.shader=null,i.program=null,i.cache={},i.id=Jt++,i}return d(e,t),e.prototype.systemCheck=function(){if(!function(){if("boolean"==typeof At)return At;try{var t=new Function("param1","param2","param3","return param1[param2] === param3;");At=!0===t({a:"b"},"a","b")}catch(t){At=!1}return At}())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},e.prototype.contextChange=function(t){this.gl=t,this.reset()},e.prototype.bind=function(t,e){t.uniforms.globals=this.renderer.globalUniforms;var i=t.program,n=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateShader(t);return this.shader=t,this.program!==i&&(this.program=i,this.gl.useProgram(n.program)),e||(Zt.textureCount=0,this.syncUniformGroup(t.uniformGroup,Zt)),n},e.prototype.setUniforms=function(t){var e=this.shader.program,i=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(i.uniformData,t,this.renderer)},e.prototype.syncUniformGroup=function(t,e){var i=this.getglProgram();t.static&&t.dirtyId===i.uniformGroups[t.id]||(i.uniformGroups[t.id]=t.dirtyId,this.syncUniforms(t,i,e))},e.prototype.syncUniforms=function(t,e,i){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,i)},e.prototype.createSyncGroups=function(t){var e=this.getSignature(t,this.shader.program.uniformData);return this.cache[e]||(this.cache[e]=function(t,e){var i=["\n var v = null;\n var cv = null\n var t = 0;\n var gl = renderer.gl\n "];for(var n in t.uniforms){var r=e[n];if(r){for(var o=t.uniforms[n],a=!1,s=0;s<Ct.length;s++)if(Ct[s].test(r,o)){i.push(Ct[s].code(n,o)),a=!0;break}if(!a){var h=(1===r.size?St:Tt)[r.type].replace("location",'ud["'+n+'"].location');i.push('\n cv = ud["'+n+'"].value;\n v = uv["'+n+'"];\n '+h+";")}}else t.uniforms[n].group&&i.push('\n renderer.shader.syncUniformGroup(uv["'+n+'"], syncData);\n ')}return new Function("ud","uv","renderer","syncData",i.join("\n"))}(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]},e.prototype.getSignature=function(t,e){var i=t.uniforms,n=[];for(var r in i)n.push(r),e[r]&&n.push(e[r].type);return n.join("-")},e.prototype.getglProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},e.prototype.generateShader=function(t){var e=this.gl,i=t.program,n={};for(var r in i.attributeData)n[r]=i.attributeData[r].location;var o=lt(e,i.vertexSrc,i.fragmentSrc,n),a={};for(var r in i.uniformData){var s=i.uniformData[r];a[r]={location:e.getUniformLocation(o,r),value:dt(s.type,s.size)}}var h=new Kt(o,a);return i.glPrograms[this.renderer.CONTEXT_UID]=h,h},e.prototype.reset=function(){this.program=null,this.shader=null},e.prototype.destroy=function(){this.destroyed=!0},e}(E);var $t=function(t){function e(e){var i=t.call(this,e)||this;return i.gl=null,i.stateId=0,i.polygonOffset=0,i.blendMode=r.b.NONE,i._blendEq=!1,i.map=[],i.map[0]=i.setBlend,i.map[1]=i.setOffset,i.map[2]=i.setCullFace,i.map[3]=i.setDepthTest,i.map[4]=i.setFrontFace,i.checks=[],i.defaultState=new Dt,i.defaultState.blend=!0,i}return d(e,t),e.prototype.contextChange=function(t){this.gl=t,this.blendModes=function(t,e){return void 0===e&&(e=[]),e[r.b.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.b.ADD]=[t.ONE,t.ONE],e[r.b.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.b.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.b.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.b.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.b.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.b.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.b.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.b.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.b.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.b.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.b.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.b.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.b.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.b.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.b.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.b.NONE]=[0,0],e[r.b.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.b.ADD_NPM]=[t.SRC_ALPHA,t.ONE,t.ONE,t.ONE],e[r.b.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[r.b.SRC_IN]=[t.DST_ALPHA,t.ZERO],e[r.b.SRC_OUT]=[t.ONE_MINUS_DST_ALPHA,t.ZERO],e[r.b.SRC_ATOP]=[t.DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[r.b.DST_OVER]=[t.ONE_MINUS_DST_ALPHA,t.ONE],e[r.b.DST_IN]=[t.ZERO,t.SRC_ALPHA],e[r.b.DST_OUT]=[t.ZERO,t.ONE_MINUS_SRC_ALPHA],e[r.b.DST_ATOP]=[t.ONE_MINUS_DST_ALPHA,t.SRC_ALPHA],e[r.b.XOR]=[t.ONE_MINUS_DST_ALPHA,t.ONE_MINUS_SRC_ALPHA],e[r.b.SUBTRACT]=[t.ONE,t.ONE,t.ONE,t.ONE,t.FUNC_REVERSE_SUBTRACT,t.FUNC_ADD],e}(t),this.set(this.defaultState),this.reset()},e.prototype.set=function(t){if(t=t||this.defaultState,this.stateId!==t.data){for(var e=this.stateId^t.data,i=0;e;)1&e&&this.map[i].call(this,!!(t.data&1<<i)),e>>=1,i++;this.stateId=t.data}for(i=0;i<this.checks.length;i++)this.checks[i](this,t)},e.prototype.forceState=function(t){t=t||this.defaultState;for(var e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data},e.prototype.setBlend=function(t){this.updateCheck(e.checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)},e.prototype.setOffset=function(t){this.updateCheck(e.checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)},e.prototype.setDepthTest=function(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)},e.prototype.setCullFace=function(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)},e.prototype.setFrontFace=function(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])},e.prototype.setBlendMode=function(t){if(t!==this.blendMode){this.blendMode=t;var e=this.blendModes[t],i=this.gl;2===e.length?i.blendFunc(e[0],e[1]):i.blendFuncSeparate(e[0],e[1],e[2],e[3]),6===e.length?(this._blendEq=!0,i.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD))}},e.prototype.setPolygonOffset=function(t,e){this.gl.polygonOffset(t,e)},e.prototype.reset=function(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)},e.prototype.updateCheck=function(t,e){var i=this.checks.indexOf(t);e&&-1===i?this.checks.push(t):e||-1===i||this.checks.splice(i,1)},e.checkBlendMode=function(t,e){t.setBlendMode(e.blendMode)},e.checkPolygonOffset=function(t,e){t.setPolygonOffset(1,e.polygonOffset)},e}(E),te=function(t){function e(e){var i=t.call(this,e)||this;return i.count=0,i.checkCount=0,i.maxIdle=n.b.GC_MAX_IDLE,i.checkCountMax=n.b.GC_MAX_CHECK_COUNT,i.mode=n.b.GC_MODE,i}return d(e,t),e.prototype.postrender=function(){this.renderer.renderingToScreen&&(this.count++,this.mode!==r.h.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,i=!1,n=0;n<e.length;n++){var r=e[n];!r.framebuffer&&this.count-r.touched>this.maxIdle&&(t.destroyTexture(r,!0),e[n]=null,i=!0)}if(i){var o=0;for(n=0;n<e.length;n++)null!==e[n]&&(e[o++]=e[n]);e.length=o}},e.prototype.unload=function(t){var e=this.renderer.texture,i=t._texture;i&&!i.framebuffer&&e.destroyTexture(i);for(var n=t.children.length-1;n>=0;n--)this.unload(t.children[n])},e}(E),ee=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=6408,this.internalFormat=5121},ie=function(t){function e(e){var i=t.call(this,e)||this;return i.boundTextures=[],i.currentLocation=-1,i.managedTextures=[],i._unknownBoundTextures=!1,i.unknownTexture=new g,i}return d(e,t),e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var i=0;i<e;i++)this.boundTextures[i]=null;this.emptyTextures={};var n=new ee(t.createTexture());t.bindTexture(t.TEXTURE_2D,n.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[t.TEXTURE_2D]=n,this.emptyTextures[t.TEXTURE_CUBE_MAP]=new ee(t.createTexture()),t.bindTexture(t.TEXTURE_CUBE_MAP,this.emptyTextures[t.TEXTURE_CUBE_MAP].texture);for(i=0;i<6;i++)t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,null);t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.LINEAR);for(i=0;i<this.boundTextures.length;i++)this.bind(null,i)},e.prototype.bind=function(t,e){void 0===e&&(e=0);var i=this.gl;if(t){if((t=t.castToBaseTexture()).parentTextureArray)return;if(t.valid){t.touched=this.renderer.textureGC.count;var n=t._glTextures[this.CONTEXT_UID]||this.initTexture(t);this.boundTextures[e]!==t&&(this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),i.bindTexture(t.target,n.texture)),n.dirtyId!==t.dirtyId&&(this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),this.updateTexture(t)),this.boundTextures[e]=t}}else this.currentLocation!==e&&(this.currentLocation=e,i.activeTexture(i.TEXTURE0+e)),i.bindTexture(i.TEXTURE_2D,this.emptyTextures[i.TEXTURE_2D].texture),this.boundTextures[e]=null},e.prototype.reset=function(){this._unknownBoundTextures=!0,this.currentLocation=-1;for(var t=0;t<this.boundTextures.length;t++)this.boundTextures[t]=this.unknownTexture},e.prototype.unbind=function(t){var e=this.gl,i=this.boundTextures;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var n=0;n<i.length;n++)i[n]===this.unknownTexture&&this.bind(null,n)}for(n=0;n<i.length;n++)i[n]===t&&(this.currentLocation!==n&&(e.activeTexture(e.TEXTURE0+n),this.currentLocation=n),e.bindTexture(t.target,this.emptyTextures[t.target].texture),i[n]=null)},e.prototype.initTexture=function(t){var e=new ee(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e},e.prototype.initTextureType=function(t,e){if(e.internalFormat=t.format,e.type=t.type,2===this.webGLVersion){var i=this.renderer.gl;t.type===i.FLOAT&&t.format===i.RGBA&&(e.internalFormat=i.RGBA32F),t.type===r.p.HALF_FLOAT&&(e.type=i.HALF_FLOAT),e.type===i.HALF_FLOAT&&t.format===i.RGBA&&(e.internalFormat=i.RGBA16F)}},e.prototype.updateTexture=function(t){var e=t._glTextures[this.CONTEXT_UID];if(e){var i=this.renderer;if(this.initTextureType(t,e),t.resource&&t.resource.upload(i,t,e));else{var n=t.realWidth,r=t.realHeight,o=i.gl;(e.width!==n||e.height!==r||e.dirtyId<0)&&(e.width=n,e.height=r,o.texImage2D(t.target,0,e.internalFormat,n,r,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}},e.prototype.destroyTexture=function(t,e){var i=this.gl;if((t=t.castToBaseTexture())._glTextures[this.CONTEXT_UID]&&(this.unbind(t),i.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){var n=this.managedTextures.indexOf(t);-1!==n&&Object(o.removeItems)(this.managedTextures,n,1)}},e.prototype.updateTextureStyle=function(t){var e=t._glTextures[this.CONTEXT_UID];e&&(t.mipmap!==r.j.POW2&&2===this.webGLVersion||t.isPowerOfTwo?e.mipmap=t.mipmap>=1:e.mipmap=!1,2===this.webGLVersion||t.isPowerOfTwo?e.wrapMode=t.wrapMode:e.wrapMode=r.q.CLAMP,t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},e.prototype.setStyle=function(t,e){var i=this.gl;if(e.mipmap&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===r.n.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&t.anisotropicLevel>0&&t.scaleMode===r.n.LINEAR){var o=Math.min(t.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(t.target,n.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===r.n.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode===r.n.LINEAR?i.LINEAR:i.NEAREST)},e}(E),ne={FilterSystem:Z,BatchSystem:$,ContextSystem:et,FramebufferSystem:rt,GeometrySystem:st,MaskSystem:zt,ScissorSystem:Gt,StencilSystem:Ut,ProjectionSystem:Ht,RenderTextureSystem:Yt,ShaderSystem:Qt,StateSystem:$t,TextureGCSystem:te,TextureSystem:ie},re=new h.d,oe=function(t){function e(e,i){void 0===e&&(e=r.m.UNKNOWN);var a=t.call(this)||this;return(i=Object.assign({},n.b.RENDER_OPTIONS,i)).roundPixels&&(n.b.ROUND_PIXELS=i.roundPixels,Object(o.deprecation)("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),a.options=i,a.type=e,a.screen=new h.j(0,0,i.width,i.height),a.view=i.view||document.createElement("canvas"),a.resolution=i.resolution||n.b.RESOLUTION,a.transparent=i.transparent,a.autoDensity=i.autoDensity||i.autoResize||!1,a.preserveDrawingBuffer=i.preserveDrawingBuffer,a.clearBeforeRender=i.clearBeforeRender,a._backgroundColor=0,a._backgroundColorRgba=[0,0,0,0],a._backgroundColorString="#000000",a.backgroundColor=i.backgroundColor||a._backgroundColor,a._lastObjectRendered=null,a.plugins={},a}return d(e,t),e.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},Object.defineProperty(e.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px"),this.emit("resize",t,e)},e.prototype.generateTexture=function(t,e,i,n){0===(n=n||t.getLocalBounds(null,!0)).width&&(n.width=1),0===n.height&&(n.height=1);var r=L.create({width:0|n.width,height:0|n.height,scaleMode:e,resolution:i});return re.tx=-n.x,re.ty=-n.y,this.render(t,r,!1,re,!!t.parent),r},e.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);this.plugins=null,this.type=r.m.UNKNOWN,this.view=null,this.screen=null,this._tempDisplayObjectParent=null,this.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=Object(o.hex2string)(t),Object(o.hex2rgb)(t,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),e}(o.EventEmitter),ae=function(t){function e(i){var n=t.call(this,r.m.WEBGL,i)||this;return i=n.options,n.gl=null,n.CONTEXT_UID=0,n.runners={destroy:new a.a("destroy"),contextChange:new a.a("contextChange"),reset:new a.a("reset"),update:new a.a("update"),postrender:new a.a("postrender"),prerender:new a.a("prerender"),resize:new a.a("resize")},n.globalUniforms=new K({projectionMatrix:new h.d},!0),n.addSystem(zt,"mask").addSystem(et,"context").addSystem($t,"state").addSystem(Qt,"shader").addSystem(ie,"texture").addSystem(st,"geometry").addSystem(rt,"framebuffer").addSystem(Gt,"scissor").addSystem(Ut,"stencil").addSystem(Ht,"projection").addSystem(te,"textureGC").addSystem(Z,"filter").addSystem(Yt,"renderTexture").addSystem($,"batch"),n.initPlugins(e.__plugins),i.context?n.context.initFromContext(i.context):n.context.initFromOptions({alpha:!!n.transparent,antialias:i.antialias,premultipliedAlpha:n.transparent&&"notMultiplied"!==n.transparent,stencil:!0,preserveDrawingBuffer:i.preserveDrawingBuffer,powerPreference:n.options.powerPreference}),n.renderingToScreen=!0,Object(o.sayHello)(2===n.context.webGLVersion?"WebGL 2":"WebGL 1"),n.resize(n.options.width,n.options.height),n}return d(e,t),e.create=function(t){if(Object(o.isWebGLSupported)())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.addSystem=function(t,e){e||(e=t.name);var i=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var n in this[e]=i,this.runners)this.runners[n].add(i);return this},e.prototype.render=function(t,e,i,n,r){if(this.renderingToScreen=!e,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=n,!this.context.isLost){if(e||(this._lastObjectRendered=t),!r){var o=t.enableTempParent();t.updateTransform(),t.disableTempParent(o)}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==i?i:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},e.prototype.resize=function(e,i){t.prototype.resize.call(this,e,i),this.runners.resize.emit(e,i)},e.prototype.reset=function(){return this.runners.reset.emit(),this},e.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},e.prototype.destroy=function(e){for(var i in this.runners.destroy.emit(),this.runners)this.runners[i].destroy();t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,i){e.__plugins=e.__plugins||{},e.__plugins[t]=i},e}(oe);function se(t){return ae.create(t)}var he="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\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}",ue="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n",le=function(){this.texArray=null,this.blend=0,this.type=r.e.TRIANGLES,this.start=0,this.size=0,this.data=null},ce=function(){function t(){this.elements=[],this.ids=[],this.count=0}return t.prototype.clear=function(){for(var t=0;t<this.count;t++)this.elements[t]=null;this.count=0},t}(),de=function(){function t(t){this.rawBinaryData=new ArrayBuffer(t),this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}return Object.defineProperty(t.prototype,"int8View",{get:function(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uint8View",{get:function(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"int16View",{get:function(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uint16View",{get:function(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"int32View",{get:function(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View},enumerable:!1,configurable:!0}),t.prototype.view=function(t){return this[t+"View"]},t.prototype.destroy=function(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null},t.sizeOf=function(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(t+" isn't a valid view type")}},t}(),pe=function(t){function e(e){var i=t.call(this,e)||this;return i.shaderGenerator=null,i.geometryClass=null,i.vertexSize=null,i.state=Dt.for2d(),i.size=4*n.b.SPRITE_BATCH_SIZE,i._vertexCount=0,i._indexCount=0,i._bufferedElements=[],i._bufferedTextures=[],i._bufferSize=0,i._shader=null,i._packedGeometries=[],i._packedGeometryPoolSize=2,i._flushId=0,i._aBuffers={},i._iBuffers={},i.MAX_TEXTURES=1,i.renderer.on("prerender",i.onPrerender,i),e.runners.contextChange.add(i),i._dcIndex=0,i._aIndex=0,i._iIndex=0,i._attributeBuffer=null,i._indexBuffer=null,i._tempBoundTextures=[],i}return d(e,t),e.prototype.contextChange=function(){var t=this.renderer.gl;n.b.PREFER_ENV===r.f.WEBGL_LEGACY?this.MAX_TEXTURES=1:(this.MAX_TEXTURES=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),n.b.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=Mt(this.MAX_TEXTURES,t)),this._shader=this.shaderGenerator.generateShader(this.MAX_TEXTURES);for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]=new this.geometryClass;this.initFlushBuffers()},e.prototype.initFlushBuffers=function(){for(var t=e._drawCallPool,i=e._textureArrayPool,n=this.size/4,r=Math.floor(n/this.MAX_TEXTURES)+1;t.length<n;)t.push(new le);for(;i.length<r;)i.push(new ce);for(var o=0;o<this.MAX_TEXTURES;o++)this._tempBoundTextures[o]=null},e.prototype.onPrerender=function(){this._flushId=0},e.prototype.render=function(t){t._texture.valid&&(this._vertexCount+t.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)},e.prototype.buildTexturesAndDrawCalls=function(){var t=this._bufferedTextures,i=this.MAX_TEXTURES,n=e._textureArrayPool,r=this.renderer.batch,o=this._tempBoundTextures,a=this.renderer.textureGC.count,s=++g._globalBatch,h=0,u=n[0],l=0;r.copyBoundTextures(o,i);for(var c=0;c<this._bufferSize;++c){var d=t[c];t[c]=null,d._batchEnabled!==s&&(u.count>=i&&(r.boundArray(u,o,s,i),this.buildDrawCalls(u,l,c),l=c,u=n[++h],++s),d._batchEnabled=s,d.touched=a,u.elements[u.count++]=d)}u.count>0&&(r.boundArray(u,o,s,i),this.buildDrawCalls(u,l,this._bufferSize),++h,++s);for(c=0;c<o.length;c++)o[c]=null;g._globalBatch=s},e.prototype.buildDrawCalls=function(t,i,n){var r=this._bufferedElements,a=this._attributeBuffer,s=this._indexBuffer,h=this.vertexSize,u=e._drawCallPool,l=this._dcIndex,c=this._aIndex,d=this._iIndex,p=u[l];p.start=this._iIndex,p.texArray=t;for(var f=i;f<n;++f){var m=r[f],g=m._texture.baseTexture,y=o.premultiplyBlendMode[g.alphaMode?1:0][m.blendMode];r[f]=null,i<f&&p.blend!==y&&(p.size=d-p.start,i=f,(p=u[++l]).texArray=t,p.start=d),this.packInterleavedGeometry(m,a,s,c,d),c+=m.vertexData.length/2*h,d+=m.indices.length,p.blend=y}i<n&&(p.size=d-p.start,++l),this._dcIndex=l,this._aIndex=c,this._iIndex=d},e.prototype.bindAndClearTexArray=function(t){for(var e=this.renderer.texture,i=0;i<t.count;i++)e.bind(t.elements[i],t.ids[i]),t.elements[i]=null;t.count=0},e.prototype.updateGeometry=function(){var t=this._packedGeometries,e=this._attributeBuffer,i=this._indexBuffer;n.b.CAN_UPLOAD_SAME_BUFFER?(t[this._flushId]._buffer.update(e.rawBinaryData),t[this._flushId]._indexBuffer.update(i),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,t[this._flushId]=new this.geometryClass),t[this._flushId]._buffer.update(e.rawBinaryData),t[this._flushId]._indexBuffer.update(i),this.renderer.geometry.bind(t[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)},e.prototype.drawBatches=function(){for(var t=this._dcIndex,i=this.renderer,n=i.gl,r=i.state,o=e._drawCallPool,a=null,s=0;s<t;s++){var h=o[s],u=h.texArray,l=h.type,c=h.size,d=h.start,p=h.blend;a!==u&&(a=u,this.bindAndClearTexArray(u)),this.state.blendMode=p,r.set(this.state),n.drawElements(l,c,n.UNSIGNED_SHORT,2*d)}},e.prototype.flush=function(){0!==this._vertexCount&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)},e.prototype.start=function(){this.renderer.state.set(this.state),this.renderer.shader.bind(this._shader),n.b.CAN_UPLOAD_SAME_BUFFER&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])},e.prototype.stop=function(){this.flush()},e.prototype.destroy=function(){for(var e=0;e<this._packedGeometryPoolSize;e++)this._packedGeometries[e]&&this._packedGeometries[e].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),t.prototype.destroy.call(this)},e.prototype.getAttributeBuffer=function(t){var e=Object(o.nextPow2)(Math.ceil(t/8)),i=Object(o.log2)(e),n=8*e;this._aBuffers.length<=i&&(this._iBuffers.length=i+1);var r=this._aBuffers[n];return r||(this._aBuffers[n]=r=new de(n*this.vertexSize*4)),r},e.prototype.getIndexBuffer=function(t){var e=Object(o.nextPow2)(Math.ceil(t/12)),i=Object(o.log2)(e),n=12*e;this._iBuffers.length<=i&&(this._iBuffers.length=i+1);var r=this._iBuffers[i];return r||(this._iBuffers[i]=r=new Uint16Array(n)),r},e.prototype.packInterleavedGeometry=function(t,e,i,n,r){for(var a=e.uint32View,s=e.float32View,h=n/this.vertexSize,u=t.uvs,l=t.indices,c=t.vertexData,d=t._texture.baseTexture._batchLocation,p=Math.min(t.worldAlpha,1),f=p<1&&t._texture.baseTexture.alphaMode?Object(o.premultiplyTint)(t._tintRGB,p):t._tintRGB+(255*p<<24),m=0;m<c.length;m+=2)s[n++]=c[m],s[n++]=c[m+1],s[n++]=u[m],s[n++]=u[m+1],a[n++]=f,s[n++]=d;for(m=0;m<l.length;m++)i[r++]=h+l[m]},e._drawCallPool=[],e._textureArrayPool=[],e}(Q),fe=function(){function t(t,e){if(this.vertexSrc=t,this.fragTemplate=e,this.programCache={},this.defaultGroupCache={},e.indexOf("%count%")<0)throw new Error('Fragment template must contain "%count%".');if(e.indexOf("%forloop%")<0)throw new Error('Fragment template must contain "%forloop%".')}return t.prototype.generateShader=function(t){if(!this.programCache[t]){for(var e=new Int32Array(t),i=0;i<t;i++)e[i]=i;this.defaultGroupCache[t]=K.from({uSamplers:e},!0);var n=this.fragTemplate;n=(n=n.replace(/%count%/gi,""+t)).replace(/%forloop%/gi,this.generateSampleSrc(t)),this.programCache[t]=new Ot(this.vertexSrc,n)}var r={tint:new Float32Array([1,1,1,1]),translationMatrix:new h.d,default:this.defaultGroupCache[t]};return new Rt(this.programCache[t],r)},t.prototype.generateSampleSrc=function(t){var e="";e+="\n",e+="\n";for(var i=0;i<t;i++)i>0&&(e+="\nelse "),i<t-1&&(e+="if(vTextureId < "+i+".5)"),e+="\n{",e+="\n\tcolor = texture2D(uSamplers["+i+"], vTextureCoord);",e+="\n}";return e+="\n",e+="\n"},t}(),me=function(t){function e(e){void 0===e&&(e=!1);var i=t.call(this)||this;return i._buffer=new z(null,e,!1),i._indexBuffer=new z(null,e,!0),i.addAttribute("aVertexPosition",i._buffer,2,!1,r.p.FLOAT).addAttribute("aTextureCoord",i._buffer,2,!1,r.p.FLOAT).addAttribute("aColor",i._buffer,4,!0,r.p.UNSIGNED_BYTE).addAttribute("aTextureId",i._buffer,1,!0,r.p.FLOAT).addIndex(i._indexBuffer),i}return d(e,t),e}(W),ge="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n",ye="varying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\nuniform sampler2D uSamplers[%count%];\n\nvoid main(void){\n vec4 color;\n %forloop%\n gl_FragColor = color * vColor;\n}\n",ve=function(){function t(){}return t.create=function(t){var e=Object.assign({vertex:ge,fragment:ye,geometryClass:me,vertexSize:6},t),i=e.vertex,n=e.fragment,r=e.vertexSize,o=e.geometryClass;return function(t){function e(e){var a=t.call(this,e)||this;return a.shaderGenerator=new fe(i,n),a.geometryClass=o,a.vertexSize=r,a}return d(e,t),e}(pe)},Object.defineProperty(t,"defaultVertexSrc",{get:function(){return ge},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultFragmentTemplate",{get:function(){return ye},enumerable:!1,configurable:!0}),t}(),be=ve.create()},function(t,e,i){"use strict";i.d(e,"a",(function(){return h})),i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return u})),i.d(e,"d",(function(){return f})),i.d(e,"e",(function(){return p})),i.d(e,"f",(function(){return r})),i.d(e,"g",(function(){return d})),i.d(e,"h",(function(){return l})),i.d(e,"i",(function(){return o})),i.d(e,"j",(function(){return s})),i.d(e,"k",(function(){return c})),i.d(e,"l",(function(){return n})),i.d(e,"m",(function(){return C})),i.d(e,"n",(function(){return x}));var n,r=2*Math.PI,o=180/Math.PI,a=Math.PI/180;!function(t){t[t.POLY=0]="POLY",t[t.RECT=1]="RECT",t[t.CIRC=2]="CIRC",t[t.ELIP=3]="ELIP",t[t.RREC=4]="RREC"}(n||(n={}));var s=function(){function t(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=n.RECT}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t,"EMPTY",{get:function(){return new t(0,0,0,0)},enumerable:!1,configurable:!0}),t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},t.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},t.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)},t.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},t.prototype.fit=function(t){var e=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),n=Math.max(this.y,t.y),r=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(i-e,0),this.y=n,this.height=Math.max(r-n,0),this},t.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,n=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=n-this.y,this},t.prototype.enlarge=function(t){var e=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),n=Math.min(this.y,t.y),r=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=i-e,this.y=n,this.height=r-n,this},t}(),h=function(){function t(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=n.CIRC}return t.prototype.clone=function(){return new t(this.x,this.y,this.radius)},t.prototype.contains=function(t,e){if(this.radius<=0)return!1;var i=this.radius*this.radius,n=this.x-t,r=this.y-e;return(n*=n)+(r*=r)<=i},t.prototype.getBounds=function(){return new s(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},t}(),u=function(){function t(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=n.ELIP}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var i=(t-this.x)/this.width,n=(e-this.y)/this.height;return(i*=i)+(n*=n)<=1},t.prototype.getBounds=function(){return new s(this.x-this.width,this.y-this.height,this.width,this.height)},t}(),l=function(){function t(){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 o=[],a=0,s=r.length;a<s;a++)o.push(r[a].x,r[a].y);r=o}this.points=r,this.type=n.POLY,this.closeStroke=!0}return t.prototype.clone=function(){var e=new t(this.points.slice());return e.closeStroke=this.closeStroke,e},t.prototype.contains=function(t,e){for(var i=!1,n=this.points.length/2,r=0,o=n-1;r<n;o=r++){var a=this.points[2*r],s=this.points[2*r+1],h=this.points[2*o],u=this.points[2*o+1];s>e!=u>e&&t<(e-s)/(u-s)*(h-a)+a&&(i=!i)}return i},t}(),c=function(){function t(t,e,i,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===o&&(o=20),this.x=t,this.y=e,this.width=i,this.height=r,this.radius=o,this.type=n.RREC}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height,this.radius)},t.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),n=e-(this.y+this.radius),r=this.radius*this.radius;if(i*i+n*n<=r)return!0;if((i=t-(this.x+this.width-this.radius))*i+n*n<=r)return!0;if(i*i+(n=e-(this.y+this.height-this.radius))*n<=r)return!0;if((i=t-(this.x+this.radius))*i+n*n<=r)return!0}return!1},t}(),d=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){return this.set(t.x,t.y),this},t.prototype.copyTo=function(t){return t.set(this.x,this.y),t},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.set=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this},t}(),p=function(){function t(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this._x=i,this._y=n,this.cb=t,this.scope=e}return t.prototype.clone=function(e,i){return void 0===e&&(e=this.cb),void 0===i&&(i=this.scope),new t(e,i,this._x,this._y)},t.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},t.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},t.prototype.copyTo=function(t){return t.set(this._x,this._y),t},t.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},Object.defineProperty(t.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(t.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}),t}(),f=function(){function t(t,e,i,n,r,o){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=0),void 0===o&&(o=0),this.array=null,this.a=t,this.b=e,this.c=i,this.d=n,this.tx=r,this.ty=o}return 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,n,r,o){return this.a=t,this.b=e,this.c=i,this.d=n,this.tx=r,this.ty=o,this},t.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var i=e||this.array;return t?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i},t.prototype.apply=function(t,e){e=e||new d;var i=t.x,n=t.y;return e.x=this.a*i+this.c*n+this.tx,e.y=this.b*i+this.d*n+this.ty,e},t.prototype.applyInverse=function(t,e){e=e||new d;var i=1/(this.a*this.d+this.c*-this.b),n=t.x,r=t.y;return e.x=this.d*i*n+-this.c*i*r+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*r+-this.b*i*n+(-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),n=this.a,r=this.c,o=this.tx;return this.a=n*e-this.b*i,this.b=n*i+this.b*e,this.c=r*e-this.d*i,this.d=r*i+this.d*e,this.tx=o*e-this.ty*i,this.ty=o*i+this.ty*e,this},t.prototype.append=function(t){var e=this.a,i=this.b,n=this.c,r=this.d;return this.a=t.a*e+t.b*n,this.b=t.a*i+t.b*r,this.c=t.c*e+t.d*n,this.d=t.c*i+t.d*r,this.tx=t.tx*e+t.ty*n+this.tx,this.ty=t.tx*i+t.ty*r+this.ty,this},t.prototype.setTransform=function(t,e,i,n,r,o,a,s,h){return this.a=Math.cos(a+h)*r,this.b=Math.sin(a+h)*r,this.c=-Math.sin(a-s)*o,this.d=Math.cos(a-s)*o,this.tx=t-(i*this.a+n*this.c),this.ty=e-(i*this.b+n*this.d),this},t.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var i=this.a,n=this.c;this.a=i*t.a+this.b*t.c,this.b=i*t.b+this.b*t.d,this.c=n*t.a+this.d*t.c,this.d=n*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},t.prototype.decompose=function(t){var e=this.a,i=this.b,n=this.c,o=this.d,a=-Math.atan2(-n,o),s=Math.atan2(i,e),h=Math.abs(a+s);return h<1e-5||Math.abs(r-h)<1e-5?(t.rotation=s,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=s),t.scale.x=Math.sqrt(e*e+i*i),t.scale.y=Math.sqrt(n*n+o*o),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,n=this.d,r=this.tx,o=t*n-e*i;return this.a=n/o,this.b=-e/o,this.c=-i/o,this.d=t/o,this.tx=(i*this.ty-n*r)/o,this.ty=-(t*this.ty-e*r)/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 e=new t;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},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}(),m=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],g=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],y=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],v=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],b=[],_=[],w=Math.sign;!function(){for(var t=0;t<16;t++){var e=[];b.push(e);for(var i=0;i<16;i++)for(var n=w(m[t]*m[i]+y[t]*g[i]),r=w(g[t]*m[i]+v[t]*g[i]),o=w(m[t]*y[i]+y[t]*v[i]),a=w(g[t]*y[i]+v[t]*v[i]),s=0;s<16;s++)if(m[s]===n&&g[s]===r&&y[s]===o&&v[s]===a){e.push(s);break}}for(t=0;t<16;t++){var h=new f;h.set(m[t],g[t],y[t],v[t],0,0),_.push(h)}}();var x={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 m[t]},uY:function(t){return g[t]},vX:function(t){return y[t]},vY:function(t){return v[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return b[t][e]},sub:function(t,e){return b[t][x.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)?e>=0?x.S:x.N:2*Math.abs(e)<=Math.abs(t)?t>0?x.E:x.W:e>0?t>0?x.SE:x.SW:t>0?x.NE:x.NW},matrixAppendRotationInv:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0);var r=_[x.inv(e)];r.tx=i,r.ty=n,t.append(r)}},C=function(){function t(){this.worldTransform=new f,this.localTransform=new f,this.position=new p(this.onChange,this,0,0),this.scale=new p(this.onChange,this,1,1),this.pivot=new p(this.onChange,this,0,0),this.skew=new p(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}return t.prototype.onChange=function(){this._localID++},t.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++},t.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)},t.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var i=t.worldTransform,n=this.worldTransform;n.a=e.a*i.a+e.b*i.c,n.b=e.a*i.b+e.b*i.d,n.c=e.c*i.a+e.d*i.c,n.d=e.c*i.b+e.d*i.d,n.tx=e.tx*i.a+e.ty*i.c+i.tx,n.ty=e.tx*i.b+e.ty*i.d+i.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!1,configurable:!0}),t.IDENTITY=new t,t}()},function(t,e,i){var n=i(45),r=i(314),o=i(315),a=i(73),s=i(49),h=s("iterator"),u=s("toStringTag"),l=o.values;for(var c in r){var d=n[c],p=d&&d.prototype;if(p){if(p[h]!==l)try{a(p,h,l)}catch(t){p[h]=l}if(p[u]||a(p,u,c),r[c])for(var f in o)if(p[f]!==o[f])try{a(p,f,o[f])}catch(t){p[f]=o[f]}}}},,,function(t,e,i){"use strict";i.d(e,"c",(function(){return r})),i.d(e,"a",(function(){return o})),i.d(e,"b",(function(){return a})),i.d(e,"d",(function(){return s})),i.d(e,"g",(function(){return h})),i.d(e,"e",(function(){return u})),i.d(e,"f",(function(){return l}));var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)};function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var o=function(){return(o=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function a(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))}function s(t,e){var i,n,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}Object.create;function h(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],n=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,r,o=i.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return a}function l(t,e,i){if(i||2===arguments.length)for(var n,r=0,o=e.length;r<o;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return t.concat(n||Array.prototype.slice.call(e))}Object.create},,,function(t,e,i){"use strict";i.d(e,"a",(function(){return b})),i.d(e,"b",(function(){return _}));var n=/iPhone/i,r=/iPod/i,o=/iPad/i,a=/\biOS-universal(?:.+)Mac\b/i,s=/\bAndroid(?:.+)Mobile\b/i,h=/Android/i,u=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,l=/Silk/i,c=/Windows Phone/i,d=/\bWindows(?:.+)ARM\b/i,p=/BlackBerry/i,f=/BB10/i,m=/Opera Mini/i,g=/\b(CriOS|Chrome)(?:.+)Mobile/i,y=/Mobile(?:.+)Firefox\b/i,v=function(t){return void 0!==t&&"MacIntel"===t.platform&&"number"==typeof t.maxTouchPoints&&t.maxTouchPoints>1&&"undefined"==typeof MSStream};var b=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=e.userAgent,b=i.split("[FBAN");void 0!==b[1]&&(i=b[0]),void 0!==(b=i.split("Twitter"))[1]&&(i=b[0]);var _=function(t){return function(e){return e.test(t)}}(i),w={apple:{phone:_(n)&&!_(c),ipod:_(r),tablet:!_(n)&&(_(o)||v(e))&&!_(c),universal:_(a),device:(_(n)||_(r)||_(o)||_(a)||v(e))&&!_(c)},amazon:{phone:_(u),tablet:!_(u)&&_(l),device:_(u)||_(l)},android:{phone:!_(c)&&_(u)||!_(c)&&_(s),tablet:!_(c)&&!_(u)&&!_(s)&&(_(l)||_(h)),device:!_(c)&&(_(u)||_(l)||_(s)||_(h))||_(/\bokhttp\b/i)},windows:{phone:_(c),tablet:_(d),device:_(c)||_(d)},other:{blackberry:_(p),blackberry10:_(f),opera:_(m),firefox:_(y),chrome:_(g),device:_(p)||_(f)||_(m)||_(y)||_(g)},any:!1,phone:!1,tablet:!1};return w.any=w.apple.device||w.android.device||w.windows.device||w.other.device,w.phone=w.apple.phone||w.android.phone||w.windows.phone,w.tablet=w.apple.tablet||w.android.tablet||w.windows.tablet,w}(window.navigator);var _={MIPMAP_TEXTURES:1,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(t){var e=!0;if(b.tablet||b.phone){var i;if(b.apple.device)if(i=navigator.userAgent.match(/OS (\d+)_(\d+)?/))parseInt(i[1],10)<11&&(e=!1);if(b.android.device)if(i=navigator.userAgent.match(/Android\s([0-9.]*)/))parseInt(i[1],10)<7&&(e=!1)}return e?t:4}(32),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:b.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!b.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Vector3}));var n=i(67),r=i(74);class Vector3{constructor(t,e,i){this.x=t||0,this.y=e||0,this.z=i||0}set(t,e,i){return this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}clone(){return new Vector3(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return o||(o=new r.a),this.applyQuaternion(o.setFromEuler(t))}applyAxisAngle(t,e){return o||(o=new r.a),this.applyQuaternion(o.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this}applyMatrix4(t){const e=this.x,i=this.y,n=this.z,r=t.elements,o=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*o,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*o,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*o,this}applyQuaternion(t){const e=this.x,i=this.y,n=this.z,r=t.x,o=t.y,a=t.z,s=t.w,h=s*e+o*n-a*i,u=s*i+a*e-r*n,l=s*n+r*i-o*e,c=-r*e-o*i-a*n;return this.x=h*s+c*-r+u*-a-l*-o,this.y=u*s+c*-o+l*-r-h*-a,this.z=l*s+c*-a+h*-o-u*-r,this}project(t,e){const i=t.x,n=t.y,r=t.z,o=e.elements,a=o[0],s=o[1],h=o[2],u=o[3],l=o[4],c=o[5],d=o[6],p=o[7],f=o[8],m=o[9],g=o[10],y=o[11],v=o[12],b=o[13],_=o[14],w=1/(i*u+n*p+r*y+o[15]);return this.x=(i*a+n*l+r*f+v)*w,this.y=(i*s+n*c+r*m+b)*w,this.z=(i*h+n*d+r*g+_)*w,this}unproject(t,e,i){const n=e.x,r=e.y,o=e.width,a=e.height;let s=t.x,h=t.y;const u=t.z;return s-=n,h=a-h-1,h-=r,this.x=2*s/o-1,this.y=2*h/a-1,this.z=2*u-1,this.project(this,i)}transformDirection(t){const e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*n,this.y=r[1]*e+r[5]*i+r[9]*n,this.z=r[2]*e+r[6]*i+r[10]*n,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return a.set(t,t,t),s.set(e,e,e),this.clamp(a,s)}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,n=t.y,r=t.z,o=e.x,a=e.y,s=e.z;return this.x=n*s-r*a,this.y=r*o-i*s,this.z=i*a-n*o,this}projectOnVector(t){const e=t.dot(this)/t.lengthSq();return this.copy(t).multiplyScalar(e)}projectOnPlane(t){return h.copy(this).projectOnVector(t),this.sub(h)}reflect(t){return this.sub(h.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq());return Math.acos(Object(n.a)(e,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const n=Math.sin(e)*t;return this.x=n*Math.sin(i),this.y=Math.cos(e)*t,this.z=n*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=n,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}toFixed(t){const e=Math.pow(10,t);return this.x=(this.x*e|0)/e,this.y=(this.y*e|0)/e,this.z=(this.z*e|0)/e,this}}let o;const a=new Vector3,s=new Vector3,h=new Vector3},,,function(t,e,i){"use strict";i.d(e,"a",(function(){return Body}));var n=i(39),r=i(2),o=i(108),a=i(40),s=i(17),h=i(65),u=i(18);function l(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Body extends u.a{constructor(t,e={}){super(t,e),l(this,"trigger",!1),l(this,"ghost",!1),l(this,"deco",!1),l(this,"movable",!1),l(this,"soft",!1),l(this,"box",void 0),l(this,"origin",void 0),l(this,"velocity",void 0),l(this,"sensor",void 0),l(this,"ground",0),l(this,"groundBefore",0),l(this,"groundChangeTolerance",0),l(this,"colliding",void 0),l(this,"triggering",void 0),l(this,"onCollisionEnter",void 0),l(this,"onCollisionExit",void 0),l(this,"onTriggerEnter",void 0),l(this,"onTriggerExit",void 0),l(this,"view",void 0),l(this,"sensorView",void 0),l(this,"lane",0),this.trigger=e.trigger||!1,this.ghost=e.ghost||!1,this.deco=e.deco||!1,this.movable=e.movable||!1,this.box=new o.a(1,1,1),this.origin=new o.a(1,1,1),this.velocity=new h.a,this.sensor=e.sensor?new o.a(1,100,1):null,this.ground=0,this.groundBefore=0,this.groundChangeTolerance=0,this.colliding=[],this.triggering=[],r.a.blocks&&!e.noView&&this.drawView(),this.onCollisionEnter=new n.a("onCollisionEnter",1),this.onCollisionExit=new n.a("onCollisionExit",1),this.onTriggerEnter=new n.a("onTriggerEnter",1),this.onTriggerExit=new n.a("onTriggerExit",1),t.z=9999}reset(){this.ground=0,this.colliding=[],this.triggering=[],this.origin.copy(this.box),this.velocity.reset(),this.resetGroundChangeTolerance()}drawView(){this.view||(this.entity.ramp?this.view=s.a.ramp(this.box,this.data.boxColor,.6):this.view=s.a.box(this.box,this.data.boxColor,.6),this.entity.addChild(this.view),this.sensor&&(this.sensorView=s.a.box(this.sensor,this.data.boxColor,.5),this.sensorView.y=-50,this.entity.addChild(this.sensorView)))}render(){this.entity.transform.position.x=this.box.center.x,this.entity.transform.position.y=this.box.center.y,this.entity.transform.position.z=this.box.center.z,this.view&&(this.view.scale.x=this.box.size.x,this.view.scale.y=this.box.size.y,this.view.scale.z=this.box.size.z),!r.a.models&&this.entity.model&&(this.entity.model.active=!1)}matchEntityPosition(){this.entity.x=this.box.center.x,this.entity.y=this.box.center.y,this.entity.z=this.box.center.z}move(t){this.origin.center.x=this.box.center.x,this.origin.center.y=this.box.center.y,this.origin.center.z=this.box.center.z,this.origin.size.x=this.box.size.x,this.origin.size.y=this.box.size.y,this.origin.size.z=this.box.size.z,this.box.center.z+=this.velocity.z*t,this.box.center.x+=this.velocity.x*t,this.box.center.y+=this.velocity.y*t,this.box.bottom<=this.ground&&!this.ghost&&(this.box.bottom=this.ground,this.velocity.y=0),this.sensor&&(this.sensor.x=this.box.x,this.sensor.y=this.box.y-50,this.sensor.z=this.box.z),this.groundChangeTolerance&&(this.groundChangeTolerance-=t,this.groundChangeTolerance<0&&(this.groundChangeTolerance=0))}matchPosition(t){this.origin.center.x=t.center.x,this.origin.center.y=t.center.y,this.origin.center.z=t.center.z,this.box.center.x=t.center.x,this.box.center.y=t.center.y,this.box.center.z=t.center.z,this.sensor&&(this.sensor.x=t.x,this.sensor.y=t.y-50,this.sensor.z=t.z)}triggerEnter(t,e){this.onTriggerEnter.dispatch(t)}triggerExit(t,e){this.onTriggerExit.dispatch(t)}collisionEnter(t,e){(e.flags&a.a.LEFT||e.flags&a.a.RIGHT)&&(this.velocity.x=0),(e.flags&a.a.TOP||e.flags&a.a.BOTTOM)&&(this.velocity.y=0),(e.flags&a.a.FRONT||e.flags&a.a.BACK)&&e.hit.width>3.5&&(this.velocity.z=0),this.onCollisionEnter.dispatch(e)}collisionExit(t,e){this.onCollisionExit.dispatch(e)}isColliding(t){return this.colliding.indexOf(t)>=0}isTrigering(t){return this.colliding.indexOf(t)>=0}resetGroundChangeTolerance(){this.groundChangeTolerance=0}get ascending(){return this.origin.y<this.box.y}get descending(){return this.origin.y>this.box.y}get hangtime(){const t=this.velocity.y>-.2&&this.velocity.y<.2;return!this.landed&&t}get airborne(){return!this.landed}get stable(){return this.origin.y===this.box.y}get landed(){return this.bottom<=this.ground+1&&!this.ghost}get moving(){return 0!==this.velocity.x||0!==this.velocity.y||0!==this.velocity.z}get dodging(){const t=this.velocity.x;return t<-.25?-1:t>.25?1:0}get canJump(){return!!this.groundChangeTolerance||this.landed}get x(){return this.box.center.x}set x(t){this.box.center.x=t}get y(){return this.box.center.y}set y(t){this.box.center.y=t}get z(){return this.box.center.z}set z(t){this.box.center.z=t}get left(){return this.box.left}set left(t){this.box.left=t}get right(){return this.box.right}set right(t){this.box.right=t}get top(){return this.box.top}set top(t){this.box.top=t}get bottom(){return this.box.bottom}set bottom(t){this.box.bottom=t}get front(){return this.box.front}set front(t){this.box.front=t}get back(){return this.box.back}set back(t){this.box.back=t}get width(){return this.box.size.x}set width(t){this.box.size.x=t}get height(){return this.box.size.y}set height(t){this.box.size.y=t}get depth(){return this.box.size.z}set depth(t){this.box.size.z=t}get center(){return this.box.center}get size(){return this.box.size}get phx(){return this.box.center.x}set phx(t){const e=t-this.box.center.x;this.velocity.x=e}get phy(){return this.center.y}set phy(t){const e=t-this.box.center.y;this.velocity.y=e}get phz(){return this.center.z}set phz(t){const e=t-this.box.center.z;this.velocity.z=e}}},,function(t,e,i){"use strict";i.d(e,"b",(function(){return mt})),i.d(e,"a",(function(){return gt}));var n,r,o,a,s,h,u,l=i(6),c={},d=180/Math.PI,p=Math.PI/180,f=Math.atan2,m=/([A-Z])/g,g=/(?:left|right|width|margin|padding|x)/i,y=/[\s,\(]\S/,v={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},b=function(t,e){return e.set(e.t,e.p,Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)},_=function(t,e){return e.set(e.t,e.p,1===t?e.e:Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)},w=function(t,e){return e.set(e.t,e.p,t?Math.round(1e4*(e.s+e.c*t))/1e4+e.u:e.b,e)},x=function(t,e){var i=e.s+e.c*t;e.set(e.t,e.p,~~(i+(i<0?-.5:.5))+e.u,e)},C=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},S=function(t,e){return e.set(e.t,e.p,1!==t?e.b:e.e,e)},T=function(t,e,i){return t.style[e]=i},A=function(t,e,i){return t.style.setProperty(e,i)},E=function(t,e,i){return t._gsap[e]=i},P=function(t,e,i){return t._gsap.scaleX=t._gsap.scaleY=i},M=function(t,e,i,n,r){var o=t._gsap;o.scaleX=o.scaleY=i,o.renderTransform(r,o)},I=function(t,e,i,n,r){var o=t._gsap;o[e]=i,o.renderTransform(r,o)},k="transform",O=k+"Origin",R=function(t,e){var i=r.createElementNS?r.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):r.createElement(t);return i.style?i:r.createElement(t)},D=function t(e,i,n){var r=getComputedStyle(e);return r[i]||r.getPropertyValue(i.replace(m,"-$1").toLowerCase())||r.getPropertyValue(i)||!n&&t(e,N(i)||i,1)||""},L="O,Moz,ms,Ms,Webkit".split(","),N=function(t,e,i){var n=(e||s).style,r=5;if(t in n&&!i)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);r--&&!(L[r]+t in n););return r<0?null:(3===r?"ms":r>=0?L[r]:"")+t},B=function(){"undefined"!=typeof window&&window.document&&(n=window,r=n.document,o=r.documentElement,s=R("div")||{style:{}},R("div"),k=N(k),O=k+"Origin",s.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",u=!!N("perspective"),a=1)},F=function t(e){var i,n=R("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),r=this.parentNode,a=this.nextSibling,s=this.style.cssText;if(o.appendChild(n),n.appendChild(this),this.style.display="block",e)try{i=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=t}catch(t){}else this._gsapBBox&&(i=this._gsapBBox());return r&&(a?r.insertBefore(this,a):r.appendChild(this)),o.removeChild(n),this.style.cssText=s,i},z=function(t,e){for(var i=e.length;i--;)if(t.hasAttribute(e[i]))return t.getAttribute(e[i])},j=function(t){var e;try{e=t.getBBox()}catch(i){e=F.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===F||(e=F.call(t,!0)),!e||e.width||e.x||e.y?e:{x:+z(t,["x","cx","x1"])||0,y:+z(t,["y","cy","y1"])||0,width:0,height:0}},G=function(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!j(t))},U=function(t,e){if(e){var i=t.style;e in c&&e!==O&&(e=k),i.removeProperty?("ms"!==e.substr(0,2)&&"webkit"!==e.substr(0,6)||(e="-"+e),i.removeProperty(e.replace(m,"-$1").toLowerCase())):i.removeAttribute(e)}},H=function(t,e,i,n,r,o){var a=new l.d(t._pt,e,i,0,1,o?S:C);return t._pt=a,a.b=n,a.e=r,t._props.push(i),a},V={deg:1,rad:1,turn:1},W=function t(e,i,n,o){var a,h,u,d,p=parseFloat(n)||0,f=(n+"").trim().substr((p+"").length)||"px",m=s.style,y=g.test(i),v="svg"===e.tagName.toLowerCase(),b=(v?"client":"offset")+(y?"Width":"Height"),_="px"===o,w="%"===o;return o===f||!p||V[o]||V[f]?p:("px"!==f&&!_&&(p=t(e,i,n,"px")),d=e.getCTM&&G(e),!w&&"%"!==f||!c[i]&&!~i.indexOf("adius")?(m[y?"width":"height"]=100+(_?f:o),h=~i.indexOf("adius")||"em"===o&&e.appendChild&&!v?e:e.parentNode,d&&(h=(e.ownerSVGElement||{}).parentNode),h&&h!==r&&h.appendChild||(h=r.body),(u=h._gsap)&&w&&u.width&&y&&u.time===l.A.time?Object(l.y)(p/u.width*100):((w||"%"===f)&&(m.position=D(e,"position")),h===e&&(m.position="static"),h.appendChild(s),a=s[b],h.removeChild(s),m.position="absolute",y&&w&&((u=Object(l.m)(h)).time=l.A.time,u.width=h[b]),Object(l.y)(_?a*p/100:a&&p?100/a*p:0))):(a=d?e.getBBox()[y?"width":"height"]:e[b],Object(l.y)(w?p/a*100:p/100*a)))},X=function(t,e,i,n){var r;return a||B(),e in v&&"transform"!==e&&~(e=v[e]).indexOf(",")&&(e=e.split(",")[0]),c[e]&&"transform"!==e?(r=nt(t,n),r="transformOrigin"!==e?r[e]:r.svg?r.origin:rt(D(t,O))+" "+r.zOrigin+"px"):(!(r=t.style[e])||"auto"===r||n||~(r+"").indexOf("calc("))&&(r=J[e]&&J[e](t,e,i)||D(t,e)||Object(l.n)(t,e)||("opacity"===e?1:0)),i&&!~(r+"").trim().indexOf(" ")?W(t,e,r,i)+i:r},Y=function(t,e,i,n){if(!i||"none"===i){var r=N(e,t,1),o=r&&D(t,r,1);o&&o!==i?(e=r,i=o):"borderColor"===e&&(i=D(t,"borderTopColor"))}var a,s,h,u,c,d,p,f,m,g,y,v,b=new l.d(this._pt,t.style,e,0,1,l.w),_=0,w=0;if(b.b=i,b.e=n,i+="","auto"===(n+="")&&(t.style[e]=n,n=D(t,e)||n,t.style[e]=i),a=[i,n],Object(l.j)(a),n=a[1],h=(i=a[0]).match(l.t)||[],(n.match(l.t)||[]).length){for(;s=l.t.exec(n);)p=s[0],m=n.substring(_,s.index),c?c=(c+1)%5:"rgba("!==m.substr(-5)&&"hsla("!==m.substr(-5)||(c=1),p!==(d=h[w++]||"")&&(u=parseFloat(d)||0,y=d.substr((u+"").length),(v="="===p.charAt(1)?+(p.charAt(0)+"1"):0)&&(p=p.substr(2)),f=parseFloat(p),g=p.substr((f+"").length),_=l.t.lastIndex-g.length,g||(g=g||l.k.units[e]||y,_===n.length&&(n+=g,b.e+=g)),y!==g&&(u=W(t,e,d,g)||0),b._pt={_next:b._pt,p:m||1===w?m:",",s:u,c:v?v*f:f-u,m:c&&c<4||"zIndex"===e?Math.round:0});b.c=_<n.length?n.substring(_,n.length):""}else b.r="display"===e&&"none"===n?S:C;return l.v.test(n)&&(b.e=0),this._pt=b,b},q={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},K=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var i,n,r,o=e.t,a=o.style,s=e.u,h=o._gsap;if("all"===s||!0===s)a.cssText="",n=1;else for(r=(s=s.split(",")).length;--r>-1;)i=s[r],c[i]&&(n=1,i="transformOrigin"===i?O:k),U(o,i);n&&(U(o,k),h&&(h.svg&&o.removeAttribute("transform"),nt(o,1),h.uncache=1))}},J={clearProps:function(t,e,i,n,r){if("isFromStart"!==r.data){var o=t._pt=new l.d(t._pt,e,i,0,0,K);return o.u=n,o.pr=-10,o.tween=r,t._props.push(i),1}}},Z=[1,0,0,1,0,0],Q={},$=function(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t},tt=function(t){var e=D(t,k);return $(e)?Z:e.substr(7).match(l.s).map(l.y)},et=function(t,e){var i,n,r,a,s=t._gsap||Object(l.m)(t),h=t.style,u=tt(t);return s.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(u=[(r=t.transform.baseVal.consolidate().matrix).a,r.b,r.c,r.d,r.e,r.f]).join(",")?Z:u:(u!==Z||t.offsetParent||t===o||s.svg||(r=h.display,h.display="block",(i=t.parentNode)&&t.offsetParent||(a=1,n=t.nextSibling,o.appendChild(t)),u=tt(t),r?h.display=r:U(t,"display"),a&&(n?i.insertBefore(t,n):i?i.appendChild(t):o.removeChild(t))),e&&u.length>6?[u[0],u[1],u[4],u[5],u[12],u[13]]:u)},it=function(t,e,i,n,r,o){var a,s,h,u=t._gsap,l=r||et(t,!0),c=u.xOrigin||0,d=u.yOrigin||0,p=u.xOffset||0,f=u.yOffset||0,m=l[0],g=l[1],y=l[2],v=l[3],b=l[4],_=l[5],w=e.split(" "),x=parseFloat(w[0])||0,C=parseFloat(w[1])||0;i?l!==Z&&(s=m*v-g*y)&&(h=x*(-g/s)+C*(m/s)-(m*_-g*b)/s,x=x*(v/s)+C*(-y/s)+(y*_-v*b)/s,C=h):(x=(a=j(t)).x+(~w[0].indexOf("%")?x/100*a.width:x),C=a.y+(~(w[1]||w[0]).indexOf("%")?C/100*a.height:C)),n||!1!==n&&u.smooth?(b=x-c,_=C-d,u.xOffset=p+(b*m+_*y)-b,u.yOffset=f+(b*g+_*v)-_):u.xOffset=u.yOffset=0,u.xOrigin=x,u.yOrigin=C,u.smooth=!!n,u.origin=e,u.originIsAbsolute=!!i,t.style[O]="0px 0px",o&&(H(o,u,"xOrigin",c,x),H(o,u,"yOrigin",d,C),H(o,u,"xOffset",p,u.xOffset),H(o,u,"yOffset",f,u.yOffset)),t.setAttribute("data-svg-origin",x+" "+C)},nt=function(t,e){var i=t._gsap||new l.b(t);if("x"in i&&!e&&!i.uncache)return i;var n,r,o,a,s,h,c,m,g,y,v,b,_,w,x,C,S,T,A,E,P,M,I,R,L,N,B,F,z,j,U,H,V=t.style,W=i.scaleX<0,X=D(t,O)||"0";return n=r=o=h=c=m=g=y=v=0,a=s=1,i.svg=!(!t.getCTM||!G(t)),w=et(t,i.svg),i.svg&&(R=(!i.uncache||"0px 0px"===X)&&!e&&t.getAttribute("data-svg-origin"),it(t,R||X,!!R||i.originIsAbsolute,!1!==i.smooth,w)),b=i.xOrigin||0,_=i.yOrigin||0,w!==Z&&(T=w[0],A=w[1],E=w[2],P=w[3],n=M=w[4],r=I=w[5],6===w.length?(a=Math.sqrt(T*T+A*A),s=Math.sqrt(P*P+E*E),h=T||A?f(A,T)*d:0,(g=E||P?f(E,P)*d+h:0)&&(s*=Math.abs(Math.cos(g*p))),i.svg&&(n-=b-(b*T+_*E),r-=_-(b*A+_*P))):(H=w[6],j=w[7],B=w[8],F=w[9],z=w[10],U=w[11],n=w[12],r=w[13],o=w[14],c=(x=f(H,z))*d,x&&(R=M*(C=Math.cos(-x))+B*(S=Math.sin(-x)),L=I*C+F*S,N=H*C+z*S,B=M*-S+B*C,F=I*-S+F*C,z=H*-S+z*C,U=j*-S+U*C,M=R,I=L,H=N),m=(x=f(-E,z))*d,x&&(C=Math.cos(-x),U=P*(S=Math.sin(-x))+U*C,T=R=T*C-B*S,A=L=A*C-F*S,E=N=E*C-z*S),h=(x=f(A,T))*d,x&&(R=T*(C=Math.cos(x))+A*(S=Math.sin(x)),L=M*C+I*S,A=A*C-T*S,I=I*C-M*S,T=R,M=L),c&&Math.abs(c)+Math.abs(h)>359.9&&(c=h=0,m=180-m),a=Object(l.y)(Math.sqrt(T*T+A*A+E*E)),s=Object(l.y)(Math.sqrt(I*I+H*H)),x=f(M,I),g=Math.abs(x)>2e-4?x*d:0,v=U?1/(U<0?-U:U):0),i.svg&&(R=t.getAttribute("transform"),i.forceCSS=t.setAttribute("transform","")||!$(D(t,k)),R&&t.setAttribute("transform",R))),Math.abs(g)>90&&Math.abs(g)<270&&(W?(a*=-1,g+=h<=0?180:-180,h+=h<=0?180:-180):(s*=-1,g+=g<=0?180:-180)),i.x=n-((i.xPercent=n&&(i.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-n)?-50:0)))?t.offsetWidth*i.xPercent/100:0)+"px",i.y=r-((i.yPercent=r&&(i.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-r)?-50:0)))?t.offsetHeight*i.yPercent/100:0)+"px",i.z=o+"px",i.scaleX=Object(l.y)(a),i.scaleY=Object(l.y)(s),i.rotation=Object(l.y)(h)+"deg",i.rotationX=Object(l.y)(c)+"deg",i.rotationY=Object(l.y)(m)+"deg",i.skewX=g+"deg",i.skewY=y+"deg",i.transformPerspective=v+"px",(i.zOrigin=parseFloat(X.split(" ")[2])||0)&&(V[O]=rt(X)),i.xOffset=i.yOffset=0,i.force3D=l.k.force3D,i.renderTransform=i.svg?ht:u?st:at,i.uncache=0,i},rt=function(t){return(t=t.split(" "))[0]+" "+t[1]},ot=function(t,e,i){var n=Object(l.C)(e);return Object(l.y)(parseFloat(e)+parseFloat(W(t,"x",i+"px",n)))+n},at=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,st(t,e)},st=function(t,e){var i=e||this,n=i.xPercent,r=i.yPercent,o=i.x,a=i.y,s=i.z,h=i.rotation,u=i.rotationY,l=i.rotationX,c=i.skewX,d=i.skewY,f=i.scaleX,m=i.scaleY,g=i.transformPerspective,y=i.force3D,v=i.target,b=i.zOrigin,_="",w="auto"===y&&t&&1!==t||!0===y;if(b&&("0deg"!==l||"0deg"!==u)){var x,C=parseFloat(u)*p,S=Math.sin(C),T=Math.cos(C);C=parseFloat(l)*p,x=Math.cos(C),o=ot(v,o,S*x*-b),a=ot(v,a,-Math.sin(C)*-b),s=ot(v,s,T*x*-b+b)}"0px"!==g&&(_+="perspective("+g+") "),(n||r)&&(_+="translate("+n+"%, "+r+"%) "),(w||"0px"!==o||"0px"!==a||"0px"!==s)&&(_+="0px"!==s||w?"translate3d("+o+", "+a+", "+s+") ":"translate("+o+", "+a+") "),"0deg"!==h&&(_+="rotate("+h+") "),"0deg"!==u&&(_+="rotateY("+u+") "),"0deg"!==l&&(_+="rotateX("+l+") "),"0deg"===c&&"0deg"===d||(_+="skew("+c+", "+d+") "),1===f&&1===m||(_+="scale("+f+", "+m+") "),v.style[k]=_||"translate(0, 0)"},ht=function(t,e){var i,n,r,o,a,s=e||this,h=s.xPercent,u=s.yPercent,c=s.x,d=s.y,f=s.rotation,m=s.skewX,g=s.skewY,y=s.scaleX,v=s.scaleY,b=s.target,_=s.xOrigin,w=s.yOrigin,x=s.xOffset,C=s.yOffset,S=s.forceCSS,T=parseFloat(c),A=parseFloat(d);f=parseFloat(f),m=parseFloat(m),(g=parseFloat(g))&&(m+=g=parseFloat(g),f+=g),f||m?(f*=p,m*=p,i=Math.cos(f)*y,n=Math.sin(f)*y,r=Math.sin(f-m)*-v,o=Math.cos(f-m)*v,m&&(g*=p,a=Math.tan(m-g),r*=a=Math.sqrt(1+a*a),o*=a,g&&(a=Math.tan(g),i*=a=Math.sqrt(1+a*a),n*=a)),i=Object(l.y)(i),n=Object(l.y)(n),r=Object(l.y)(r),o=Object(l.y)(o)):(i=y,o=v,n=r=0),(T&&!~(c+"").indexOf("px")||A&&!~(d+"").indexOf("px"))&&(T=W(b,"x",c,"px"),A=W(b,"y",d,"px")),(_||w||x||C)&&(T=Object(l.y)(T+_-(_*i+w*r)+x),A=Object(l.y)(A+w-(_*n+w*o)+C)),(h||u)&&(a=b.getBBox(),T=Object(l.y)(T+h/100*a.width),A=Object(l.y)(A+u/100*a.height)),a="matrix("+i+","+n+","+r+","+o+","+T+","+A+")",b.setAttribute("transform",a),S&&(b.style[k]=a)},ut=function(t,e,i,n,r,o){var a,s,h=Object(l.p)(r),u=parseFloat(r)*(h&&~r.indexOf("rad")?d:1),c=o?u*o:u-n,p=n+c+"deg";return h&&("short"===(a=r.split("_")[1])&&(c%=360)!==c%180&&(c+=c<0?360:-360),"cw"===a&&c<0?c=(c+36e9)%360-360*~~(c/360):"ccw"===a&&c>0&&(c=(c-36e9)%360-360*~~(c/360))),t._pt=s=new l.d(t._pt,e,i,n,c,_),s.e=p,s.u="deg",t._props.push(i),s},lt=function(t,e){for(var i in e)t[i]=e[i];return t},ct=function(t,e,i){var n,r,o,a,s,h,u,d=lt({},i._gsap),p=i.style;for(r in d.svg?(o=i.getAttribute("transform"),i.setAttribute("transform",""),p[k]=e,n=nt(i,1),U(i,k),i.setAttribute("transform",o)):(o=getComputedStyle(i)[k],p[k]=e,n=nt(i,1),p[k]=o),c)(o=d[r])!==(a=n[r])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(r)<0&&(s=Object(l.C)(o)!==(u=Object(l.C)(a))?W(i,r,o,u):parseFloat(o),h=parseFloat(a),t._pt=new l.d(t._pt,n,r,s,h-s,b),t._pt.u=u||0,t._props.push(r));lt(n,d)};Object(l.l)("padding,margin,Width,Radius",(function(t,e){var i="Top",n="Right",r="Bottom",o="Left",a=(e<3?[i,n,r,o]:[i+o,i+n,r+n,r+o]).map((function(i){return e<2?t+i:"border"+i+t}));J[e>1?"border"+t:t]=function(t,e,i,n,r){var o,s;if(arguments.length<4)return o=a.map((function(e){return X(t,e,i)})),5===(s=o.join(" ")).split(o[0]).length?o[0]:s;o=(n+"").split(" "),s={},a.forEach((function(t,e){return s[t]=o[e]=o[e]||o[(e-1)/2|0]})),t.init(e,s,r)}}));var dt,pt,ft={name:"css",register:B,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,i,n,r){var o,s,h,u,d,p,f,m,g,_,C,S,T,A,E,P,M,I,O,R=this._props,D=t.style,L=i.vars.startAt;for(f in a||B(),e)if("autoRound"!==f&&(s=e[f],!l.u[f]||!Object(l.h)(f,e,i,n,t,r)))if(d=typeof s,p=J[f],"function"===d&&(d=typeof(s=s.call(i,n,t,r))),"string"===d&&~s.indexOf("random(")&&(s=Object(l.x)(s)),p)p(this,t,f,s,i)&&(E=1);else if("--"===f.substr(0,2))o=(getComputedStyle(t).getPropertyValue(f)+"").trim(),s+="",l.i.lastIndex=0,l.i.test(o)||(m=Object(l.C)(o),g=Object(l.C)(s)),g?m!==g&&(o=W(t,f,o,g)+g):m&&(s+=m),this.add(D,"setProperty",o,s,n,r,0,0,f),R.push(f);else if("undefined"!==d){if(L&&f in L?(o="function"==typeof L[f]?L[f].call(i,n,t,r):L[f],f in l.k.units&&!Object(l.C)(o)&&(o+=l.k.units[f]),"="===(o+"").charAt(1)&&(o=X(t,f))):o=X(t,f),u=parseFloat(o),(_="string"===d&&"="===s.charAt(1)?+(s.charAt(0)+"1"):0)&&(s=s.substr(2)),h=parseFloat(s),f in v&&("autoAlpha"===f&&(1===u&&"hidden"===X(t,"visibility")&&h&&(u=0),H(this,D,"visibility",u?"inherit":"hidden",h?"inherit":"hidden",!h)),"scale"!==f&&"transform"!==f&&~(f=v[f]).indexOf(",")&&(f=f.split(",")[0])),C=f in c)if(S||((T=t._gsap).renderTransform&&!e.parseTransform||nt(t,e.parseTransform),A=!1!==e.smoothOrigin&&T.smooth,(S=this._pt=new l.d(this._pt,D,k,0,1,T.renderTransform,T,0,-1)).dep=1),"scale"===f)this._pt=new l.d(this._pt,T,"scaleY",T.scaleY,(_?_*h:h-T.scaleY)||0),R.push("scaleY",f),f+="X";else{if("transformOrigin"===f){M=void 0,I=void 0,O=void 0,M=(P=s).split(" "),I=M[0],O=M[1]||"50%","top"!==I&&"bottom"!==I&&"left"!==O&&"right"!==O||(P=I,I=O,O=P),M[0]=q[I]||I,M[1]=q[O]||O,s=M.join(" "),T.svg?it(t,s,0,A,0,this):((g=parseFloat(s.split(" ")[2])||0)!==T.zOrigin&&H(this,T,"zOrigin",T.zOrigin,g),H(this,D,f,rt(o),rt(s)));continue}if("svgOrigin"===f){it(t,s,1,A,0,this);continue}if(f in Q){ut(this,T,f,u,s,_);continue}if("smoothOrigin"===f){H(this,T,"smooth",T.smooth,s);continue}if("force3D"===f){T[f]=s;continue}if("transform"===f){ct(this,s,t);continue}}else f in D||(f=N(f)||f);if(C||(h||0===h)&&(u||0===u)&&!y.test(s)&&f in D)h||(h=0),(m=(o+"").substr((u+"").length))!==(g=Object(l.C)(s)||(f in l.k.units?l.k.units[f]:m))&&(u=W(t,f,o,g)),this._pt=new l.d(this._pt,C?T:D,f,u,_?_*h:h-u,C||"px"!==g&&"zIndex"!==f||!1===e.autoRound?b:x),this._pt.u=g||0,m!==g&&(this._pt.b=o,this._pt.r=w);else if(f in D)Y.call(this,t,f,o,s);else{if(!(f in t)){Object(l.r)(f,s);continue}this.add(t,f,o||t[f],s,n,r)}R.push(f)}E&&Object(l.z)(this)},get:X,aliases:v,getSetter:function(t,e,i){var n=v[e];return n&&n.indexOf(",")<0&&(e=n),e in c&&e!==O&&(t._gsap.x||X(t,"x"))?i&&h===i?"scale"===e?P:E:(h=i||{})&&("scale"===e?M:I):t.style&&!Object(l.q)(t.style[e])?T:~e.indexOf("-")?A:Object(l.o)(t,e)},core:{_removeProperty:U,_getMatrix:et}};l.D.utils.checkPrefix=N,dt="rotation,rotationX,rotationY,skewX,skewY",pt=Object(l.l)("x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+dt+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(t){c[t]=1})),Object(l.l)(dt,(function(t){l.k.units[t]="deg",Q[t]=1})),v[pt[13]]="x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+dt,Object(l.l)("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",(function(t){var e=t.split(":");v[e[1]]=pt[e[0]]})),Object(l.l)("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(t){l.k.units[t]="px"})),l.D.registerPlugin(ft);var mt=l.D.registerPlugin(ft)||l.D,gt=mt.core.Tween},,,function(t,e,i){var n;!function(r){function o(t,e,i,n,r){this._listener=e,this._isOnce=i,this.context=n,this._signal=t,this._priority=r||0}function a(t,e){if("function"!=typeof t)throw new Error("listener is a required param of {fn}() and should be a Function.".replace("{fn}",e))}function s(){this._bindings=[],this._prevParams=null;var t=this;this.dispatch=function(){s.prototype.dispatch.apply(t,arguments)}}o.prototype={active:!0,params:null,execute:function(t){var e,i;return this.active&&this._listener&&(i=this.params?this.params.concat(t):t,e=this._listener.apply(this.context,i),this._isOnce&&this.detach()),e},detach:function(){return this.isBound()?this._signal.remove(this._listener,this.context):null},isBound:function(){return!!this._signal&&!!this._listener},isOnce:function(){return this._isOnce},getListener:function(){return this._listener},getSignal:function(){return this._signal},_destroy:function(){delete this._signal,delete this._listener,delete this.context},toString:function(){return"[SignalBinding isOnce:"+this._isOnce+", isBound:"+this.isBound()+", active:"+this.active+"]"}},s.prototype={VERSION:"1.0.0",memorize:!1,_shouldPropagate:!0,active:!0,_registerListener:function(t,e,i,n){var r,a=this._indexOfListener(t,i);if(-1!==a){if((r=this._bindings[a]).isOnce()!==e)throw new Error("You cannot add"+(e?"":"Once")+"() then add"+(e?"Once":"")+"() the same listener without removing the relationship first.")}else r=new o(this,t,e,i,n),this._addBinding(r);return this.memorize&&this._prevParams&&r.execute(this._prevParams),r},_addBinding:function(t){var e=this._bindings.length;do{--e}while(this._bindings[e]&&t._priority<=this._bindings[e]._priority);this._bindings.splice(e+1,0,t)},_indexOfListener:function(t,e){for(var i,n=this._bindings.length;n--;)if((i=this._bindings[n])._listener===t&&i.context===e)return n;return-1},has:function(t,e){return-1!==this._indexOfListener(t,e)},add:function(t,e,i){return a(t,"add"),this._registerListener(t,!1,e,i)},addOnce:function(t,e,i){return a(t,"addOnce"),this._registerListener(t,!0,e,i)},remove:function(t,e){a(t,"remove");var i=this._indexOfListener(t,e);return-1!==i&&(this._bindings[i]._destroy(),this._bindings.splice(i,1)),t},removeAll:function(){for(var t=this._bindings.length;t--;)this._bindings[t]._destroy();this._bindings.length=0},getNumListeners:function(){return this._bindings.length},halt:function(){this._shouldPropagate=!1},dispatch:function(t){if(this.active){var e,i=Array.prototype.slice.call(arguments),n=this._bindings.length;if(this.memorize&&(this._prevParams=i),n){e=this._bindings.slice(),this._shouldPropagate=!0;do{n--}while(e[n]&&this._shouldPropagate&&!1!==e[n].execute(i))}}},forget:function(){this._prevParams=null},dispose:function(){this.removeAll(),delete this._bindings,delete this._prevParams},toString:function(){return"[Signal active:"+this.active+" numListeners:"+this.getNumListeners()+"]"}};var h=s;h.Signal=s,void 0===(n=function(){return h}.call(e,i,e,t))||(t.exports=n)}()},function(t,e,i){"use strict";i.d(e,"k",(function(){return Floor})),i.d(e,"j",(function(){return FloorTrackShadowStart})),i.d(e,"g",(function(){return FloorTrackShadowMid})),i.d(e,"f",(function(){return FloorTrackShadowEnd})),i.d(e,"i",(function(){return FloorTrackShadowShortStart})),i.d(e,"h",(function(){return FloorTrackShadowShortEnd})),i.d(e,"e",(function(){return FloorGroundShadowStart})),i.d(e,"b",(function(){return FloorGroundShadowMid})),i.d(e,"a",(function(){return FloorGroundShadowEnd})),i.d(e,"d",(function(){return FloorGroundShadowShortStart})),i.d(e,"c",(function(){return FloorGroundShadowShortEnd}));var n=i(2),r=i(1),o=i(14);function a(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Floor extends o.a{constructor(t,e={}){super(),a(this,"mounted",!1),a(this,"opts",{}),this.name=t,this.opts=e,this.levelEntity=!0,this.build()}build(){!this.mounted&&r.a.library.hasGeometry(this.name)&&n.a.environment&&(this.mounted=!0,r.a.library.mountEntity(this,this.name,this.opts))}static prepopulate(){r.a.game.pool.prepopulate(FloorTrack,8),r.a.game.pool.prepopulate(FloorTrackShadowStart,8),r.a.game.pool.prepopulate(FloorTrackShadowMid,8),r.a.game.pool.prepopulate(FloorTrackShadowEnd,8),r.a.game.pool.prepopulate(FloorTrackShadowShortStart,8),r.a.game.pool.prepopulate(FloorTrackShadowShortEnd,8),r.a.game.pool.prepopulate(FloorGround,8),r.a.game.pool.prepopulate(FloorGroundShadowStart,8),r.a.game.pool.prepopulate(FloorGroundShadowMid,8),r.a.game.pool.prepopulate(FloorGroundShadowEnd,8),r.a.game.pool.prepopulate(FloorGroundShadowShortStart,8),r.a.game.pool.prepopulate(FloorGroundShadowShortEnd,8),r.a.game.pool.prepopulate(FloorGates,8),r.a.game.pool.prepopulate(FloorGatesShadow,8)}static hasResourcesForAllFillers(){return r.a.library.hasGroup("ground")}static spawn(t,e={}){e.z||(e.z=t.z),e.l||(e.l=FloorTrack),e.m||(e.m=e.l),e.r||(e.r=e.m),Floor.hasResourcesForAllFillers()||(e.l=FloorTrack,e.m=FloorTrack,e.r=FloorTrack);const i=t.game.pool.get(e.l,{});if(i.build(),t.game.addChild(i),i.x=-n.a.laneWidth,i.y=0,i.z=e.z,i.ry=Math.PI,"skip"!==e.m){const i=t.game.pool.get(e.m,{});i.build(),t.game.addChild(i),i.x=0,i.y=0,i.z=e.z,i.ry=Math.PI}const r=t.game.pool.get(e.r,{});r.build(),t.game.addChild(r),r.x=n.a.laneWidth,r.y=0,r.z=e.z,r.ry=Math.PI}static spawnGates(t,e={}){if(t.name.match("tutorial"))return;e.z||(e.z=t.z);const i=t.game.pool.get(FloorGates);i.build(),t.game.addChild(i),i.x=0,i.y=0,i.z=e.z,i.ry=Math.PI}static mount(t){if("intro"===t.name){const e=1;for(let i=0;i<e;i++){if(t.floorSlots[i])continue;const e=2*n.a.blockSize-90,r=FloorTrack,o=FloorTrack,a=FloorTrack;Floor.spawn(t,{z:e,l:r,m:o,r:a})}}else if(t.name.match("default_short_1_track")){const e=t.blocks/2;"198-atlanta"===n.a.theme&&(t.floorSlots[3]=!1);for(let i=0;i<e;i++){if(t.floorSlots[i])continue;const e=i>0,r=t.z-i*n.a.blockSize*2,o=e?FloorGround:FloorTrack,a="198-atlanta"===n.a.theme&&3===i?"skip":FloorTrack,s=e?FloorGround:FloorTrack;Floor.spawn(t,{z:r,l:o,m:a,r:s}),t.floorSlots[i]=!0}}else if(t.name.match("default_1_track")){const e=t.blocks/2;for(let i=0;i<e;i++){if(t.floorSlots[i])continue;const e=t.name.match("_mid"),r=t.z-i*n.a.blockSize*2,o=e?FloorGround:FloorTrack,a=FloorTrack,s=e?FloorGround:FloorTrack;Floor.spawn(t,{z:r,l:o,m:a,r:s}),t.floorSlots[i]=!0}}else if(t.name.match("default_short_2_tracks")){const e=t.blocks/2;for(let i=0;i<e;i++){if(t.floorSlots[i])continue;const e=t.name.match("_mid_")||t.name.match("_end"),r=t.z-i*n.a.blockSize*2,o=FloorTrack,a=e?FloorGround:FloorTrack,s=FloorTrack;Floor.spawn(t,{z:r,l:o,m:a,r:s}),t.floorSlots[i]=!0}}else if(t.name.match("default_2_tracks")){const e=t.blocks/2;for(let i=0;i<e;i++){if(t.floorSlots[i])continue;const e=!t.name.match("_end"),r=t.z-i*n.a.blockSize*2,o=FloorTrack,a=e?FloorGround:FloorTrack,s=FloorTrack;Floor.spawn(t,{z:r,l:o,m:a,r:s}),t.floorSlots[i]=!0}}else if(!t.hasGround){const e=t.blocks/2;for(let i=0;i<e;i++){if(t.floorSlots[i])continue;const e=t.z-i*n.a.blockSize*2,r=FloorTrack,o=FloorTrack,a=FloorTrack;Floor.spawn(t,{z:e,l:r,m:o,r:a}),t.floorSlots[i]=!0}}}}class FloorTrack extends Floor{constructor(){super("track",{rails:!0})}}class FloorTrackShadowStart extends Floor{constructor(){super("track_shadow_start",{rails:!0})}}class FloorTrackShadowMid extends Floor{constructor(){super("track_shadow_mid",{rails:!0})}}class FloorTrackShadowEnd extends Floor{constructor(){super("track_shadow_end",{rails:!0})}}class FloorTrackShadowShortStart extends Floor{constructor(){super("track_shadow_short_start",{rails:!0})}}class FloorTrackShadowShortEnd extends Floor{constructor(){super("track_shadow_short_end",{rails:!0})}}class FloorGround extends Floor{constructor(){super("ground")}}class FloorGroundShadowStart extends Floor{constructor(){super("ground_shadow_start")}}class FloorGroundShadowMid extends Floor{constructor(){super("ground_shadow_mid")}}class FloorGroundShadowEnd extends Floor{constructor(){super("ground_shadow_mid")}}class FloorGroundShadowShortStart extends Floor{constructor(){super("ground_shadow_short_start")}}class FloorGroundShadowShortEnd extends Floor{constructor(){super("ground_shadow_short_end")}}class FloorGates extends Floor{constructor(){super("track_gates")}}class FloorGatesShadow extends Floor{constructor(){super("track_gates_shadows")}}},,,,function(t,e,i){"use strict";var n=i(101),r=i(48),o=i(205),a=i(79),s=i(164),h=i(72),u=i(356),l=o.ArrayBuffer,c=o.DataView,d=l.prototype.slice;n({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:r((function(){return!new l(2).slice(1,void 0).byteLength}))},{slice:function(t,e){if(void 0!==d&&void 0===e)return d.call(a(this),t);for(var i=a(this).byteLength,n=s(t,i),r=s(void 0===e?i:e,i),o=new(u(this,l))(h(r-n)),p=new c(this),f=new c(o),m=0;n<r;)f.setUint8(m++,p.getUint8(n++));return o}})},function(t,e,i){"use strict";var n=i(133),r=i(45),o=i(48),a=i(173),s=i(72),h=i(372),u=i(373),l=i(374),c=i(195),d=i(375),p=n.aTypedArray,f=n.exportTypedArrayMethod,m=r.Uint16Array,g=m&&m.prototype.sort,y=!!g&&!o((function(){var t=new m(2);t.sort(null),t.sort({})})),v=!!g&&!o((function(){if(c)return c<74;if(u)return u<67;if(l)return!0;if(d)return d<602;var t,e,i=new m(516),n=Array(516);for(t=0;t<516;t++)e=t%4,i[t]=515-t,n[t]=t-2*e+3;for(i.sort((function(t,e){return(t/4|0)-(e/4|0)})),t=0;t<516;t++)if(i[t]!==n[t])return!0}));f("sort",(function(t){if(void 0!==t&&a(t),v)return g.call(this,t);p(this);var e,i=s(this.length),n=Array(i);for(e=0;e<i;e++)n[e]=this[e];for(n=h(this,function(t){return function(e,i){return void 0!==t?+t(e,i)||0:i!=i?-1:e!=e?1:0===e&&0===i?1/e>0&&1/i<0?1:-1:e>i}}(t)),e=0;e<i;e++)this[e]=n[e];return this}),!v||y)},,function(t,e,i){"use strict";i.d(e,"a",(function(){return Entity3D_Entity3D}));var n=i(0),r=i(138),o=i(120),a=i(36);class ObservablePoint3D{constructor(t,e,i=0,n=0,r=0){this._x=i,this._y=n,this._z=r,this._cb=t,this._scope=e}set(t,e,i){const n=t||0,r=e||(0!==e?n:0),o=i||(0!==i?n:0);return this._x===n&&this._y===r&&this._z===o||(this._x=n,this._y=r,this._z=o,this._cb.call(this._scope)),this}copyFrom(t){return this._x===t.x&&this._y===t.y&&this._z===t.z||(this._x=t.x,this._y=t.y,this._z=t.z,this._cb.call(this._scope)),this}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this._cb.call(this._scope))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._cb.call(this._scope))}get z(){return this._z}set z(t){this._z!==t&&(this._z=t,this._cb.call(this._scope))}}var s=i(140),h=i(74),u=i(16);let l,c,d,p,f,m;class TransformComponent_TransformComponent{constructor(t){l||(l=new u.a,c=new u.a,d=new s.a,p=new h.a,f=new a.a,m=new u.a(0,1,0)),this.entity=t,this.custom=!1,this.static=!1,this.parent=null,this.position=new ObservablePoint3D(this._onChange,this,0,0,0),this.scale=new ObservablePoint3D(this._onChange,this,1,1,1),this.rotation=new ObservablePoint3D(this._onRotationChange,this,0,0,0),this.localTransform=new a.a,this.worldTransform=new a.a,this.localID=0,this.currentLocalID=-2,this.worldID=0,this.parentID=-1,this.quat=new h.a,this.rotationDirty=!0,this._oTick=-1,this.rTick=-1}extractScale(t){return this.worldTransform.extractScale(t)}extractRotation(t){return t.extractRotation(this.worldTransform)}extractPosition(t){return this.worldTransform.extractPosition(t)}extractForward(t){return this.worldTransform.extractForward(t)}addedToScene(){this._onRotationChange()}init(t){t&&(t.rotation&&this.rotation.copyFrom(t.rotation),t.scale&&this.scale.copyFrom(t.scale),t.position&&this.position.copyFrom(t.position))}reset(){this.localTransform.identity(),this.worldTransform.identity(),this.localID=0,this.currentLocalID=-2,this.worldID=0,this.parentID=-1}applyMatrix(t){const e=l,i=this.quat,n=c;t.decompose(e,i,n),this.position.x=e.x,this.position.y=e.y,this.position.z=e.z,this.scale.x=n.x,this.scale.y=n.y,this.scale.z=n.z,d.setFromQuaternion(i),this.rotation.x=d.x,this.rotation.y=d.y,this.rotation.z=d.z}lookAt(t,e){const i=p,n=f,r=l,o=c,a=this.entity.parent;this.entity.scene&&this.entity.scene.transform._updateWorld(this.entity,!0),o.x=t.x,o.y=t.y,o.z=t.z,r.setFromMatrixPosition(this.worldTransform),n.lookAt(r,o,m),e?(i.setFromRotationMatrix(n),this.quat.rotateTowards(i,e)):this.quat.setFromRotationMatrix(n),a&&(n.extractRotation(a.transform.worldTransform),i.setFromRotationMatrix(n),this.quat.premultiply(i.inverse())),this._onChange()}extractData(){return{rotation:{x:this.rotation.x,y:this.rotation.y,z:this.rotation.z},position:{x:this.position.x,y:this.position.y,z:this.position.z},scale:{x:this.scale.x,y:this.scale.y,z:this.scale.z}}}_onChange(){const t=this.entity,e=t.scene;if(e){const i=e.transform;this.localID++,t._gc||this._oTick===i._tick||(this._oTick=i._tick,i._toUpdate[i._updateCount++]=t)}}_onRotationChange(){this.rotationDirty=!0,this._onChange()}}TransformComponent_TransformComponent.DEFAULT_NAME="transform";var g=i(75);class Entity3D_Entity3D extends r.a{constructor(t){if(super(),this._worldActive=!0,this._active=!0,this.container=this.addComponent(o.a),this.transform=this.addComponent(TransformComponent_TransformComponent),t){if(!t.state){const e=new n.State;e.depthTest=!0,e.blend=!1,e.culling=!0,t.state=e}this.view3d=this.addComponent(g.a,t)}}addChild(...t){for(let e=0;e<t.length;e++)this.container.add(t[e])}removeChild(...t){for(let e=0;e<t.length;e++)this.container.remove(t[e])}removeChildren(){this.container.removeAll()}set x(t){this.transform.position.x=t}get x(){return this.transform.position.x}set y(t){this.transform.position.y=t}get y(){return this.transform.position.y}set z(t){this.transform.position.z=t}get z(){return this.transform.position.z}set sx(t){this.transform.scale.x=t}get sx(){return this.transform.scale.x}set sy(t){this.transform.scale.y=t}get sy(){return this.transform.scale.y}set sz(t){this.transform.scale.z=t}get sz(){return this.transform.scale.z}set rx(t){this.transform.rotation.x=t}get rx(){return this.transform.rotation.x}set ry(t){this.transform.rotation.y=t}get ry(){return this.transform.rotation.y}set rz(t){this.transform.rotation.z=t}get rz(){return this.transform.rotation.z}get position(){return this.transform.position}get scale(){return this.transform.scale}get rotation(){return this.transform.rotation}set active(t){this._active=t;const e=this.parent?this.parent._worldActive&&t:t;e!==this._worldActive&&(this._worldActive=e,e?this.runners.activate.run():this.runners.deactivate.run());const i=this.container.children;for(let t=0;t<i.length;t++)i[t].active=e}get active(){return this._active}get parent(){return this.container.parent}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return a})),i.d(e,"b",(function(){return s})),i.d(e,"c",(function(){return n}));var n,r=i(15);r.b.TARGET_FPMS=.06,function(t){t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY"}(n||(n={}));var o=function(){function t(t,e,i,n){void 0===e&&(e=null),void 0===i&&(i=0),void 0===n&&(n=!1),this.fn=t,this.context=e,this.priority=i,this.once=n,this.next=null,this.previous=null,this._destroyed=!1}return t.prototype.match=function(t,e){return void 0===e&&(e=null),this.fn===t&&this.context===e},t.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},t.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},t.prototype.destroy=function(t){void 0===t&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},t}(),a=function(){function t(){var t=this;this._head=new o(null,null,1/0),this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this.autoStart=!1,this.deltaTime=1,this.deltaMS=1/r.b.TARGET_FPMS,this.elapsedMS=1/r.b.TARGET_FPMS,this.lastTime=-1,this.speed=1,this.started=!1,this._protected=!1,this._lastFrame=-1,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}}return t.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},t.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},t.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},t.prototype.add=function(t,e,i){return void 0===i&&(i=n.NORMAL),this._addListener(new o(t,e,i))},t.prototype.addOnce=function(t,e,i){return void 0===i&&(i=n.NORMAL),this._addListener(new o(t,e,i,!0))},t.prototype._addListener=function(t){var e=this._head.next,i=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this},t.prototype.remove=function(t,e){for(var i=this._head.next;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(t.prototype,"count",{get:function(){if(!this._head)return 0;for(var t=0,e=this._head;e=e.next;)t++;return t},enumerable:!1,configurable:!0}),t.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},t.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},t.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},t.prototype.update=function(t){var e;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var i=t-this._lastFrame|0;if(i<this._minElapsedMS)return;this._lastFrame=t-i%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*r.b.TARGET_FPMS;for(var n=this._head,o=n.next;o;)o=o.emit(this.deltaTime);n.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t},Object.defineProperty(t.prototype,"FPS",{get:function(){return 1e3/this.elapsedMS},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minFPS",{get:function(){return 1e3/this._maxElapsedMS},set:function(t){var e=Math.min(this.maxFPS,t),i=Math.min(Math.max(0,e)/1e3,r.b.TARGET_FPMS);this._maxElapsedMS=1/i},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxFPS",{get:function(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0},set:function(t){if(0===t)this._minElapsedMS=0;else{var e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"shared",{get:function(){if(!t._shared){var e=t._shared=new t;e.autoStart=!0,e._protected=!0}return t._shared},enumerable:!1,configurable:!0}),Object.defineProperty(t,"system",{get:function(){if(!t._system){var e=t._system=new t;e.autoStart=!0,e._protected=!0}return t._system},enumerable:!1,configurable:!0}),t}(),s=function(){function t(){}return t.init=function(t){var e=this;t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{set:function(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,n.LOW)},get:function(){return this._ticker}}),this.stop=function(){e._ticker.stop()},this.start=function(){e._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?a.shared:new a,t.autoStart&&this.start()},t.destroy=function(){if(this._ticker){var t=this._ticker;this.ticker=null,t.destroy()}},t}()},function(t,e,i){i(93)("Float32",(function(t){return function(e,i,n){return t(this,e,i,n)}}))},,function(t,e,i){"use strict";i.d(e,"a",(function(){return Matrix4}));i(29),i(34),i(30);var n=i(16);class Matrix4{constructor(t){this.elements=t||new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}set(t,e,i,n,r,o,a,s,h,u,l,c,d,p,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=n,g[1]=r,g[5]=o,g[9]=a,g[13]=s,g[2]=h,g[6]=u,g[10]=l,g[14]=c,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Matrix4).fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}extractBasis(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,i=t.elements,n=1/h.setFromMatrixColumn(t,0).length(),r=1/h.setFromMatrixColumn(t,1).length(),o=1/h.setFromMatrixColumn(t,2).length();return e[0]=i[0]*n,e[1]=i[1]*n,e[2]=i[2]*n,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*o,e[9]=i[9]*o,e[10]=i[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,i=t.x,n=t.y,r=t.z,o=Math.cos(i),a=Math.sin(i),s=Math.cos(n),h=Math.sin(n),u=Math.cos(r),l=Math.sin(r);if("XYZ"===t.order){const t=o*u,i=o*l,n=a*u,r=a*l;e[0]=s*u,e[4]=-s*l,e[8]=h,e[1]=i+n*h,e[5]=t-r*h,e[9]=-a*s,e[2]=r-t*h,e[6]=n+i*h,e[10]=o*s}else if("YXZ"===t.order){const t=s*u,i=s*l,n=h*u,r=h*l;e[0]=t+r*a,e[4]=n*a-i,e[8]=o*h,e[1]=o*l,e[5]=o*u,e[9]=-a,e[2]=i*a-n,e[6]=r+t*a,e[10]=o*s}else if("ZXY"===t.order){const t=s*u,i=s*l,n=h*u,r=h*l;e[0]=t-r*a,e[4]=-o*l,e[8]=n+i*a,e[1]=i+n*a,e[5]=o*u,e[9]=r-t*a,e[2]=-o*h,e[6]=a,e[10]=o*s}else if("ZYX"===t.order){const t=o*u,i=o*l,n=a*u,r=a*l;e[0]=s*u,e[4]=n*h-i,e[8]=t*h+r,e[1]=s*l,e[5]=r*h+t,e[9]=i*h-n,e[2]=-h,e[6]=a*s,e[10]=o*s}else if("YZX"===t.order){const t=o*s,i=o*h,n=a*s,r=a*h;e[0]=s*u,e[4]=r-t*l,e[8]=n*l+i,e[1]=l,e[5]=o*u,e[9]=-a*u,e[2]=-h*u,e[6]=i*l+n,e[10]=t-r*l}else if("XZY"===t.order){const t=o*s,i=o*h,n=a*s,r=a*h;e[0]=s*u,e[4]=-l,e[8]=h*u,e[1]=t*l+r,e[5]=o*u,e[9]=i*l-n,e[2]=n*l-i,e[6]=a*u,e[10]=r*l+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(u,t,l)}lookAt(t,e,i){const n=r,s=o,h=a,u=this.elements;return h.subVectors(t,e),0===h.lengthSq()&&(h.z=1),h.normalize(),n.crossVectors(i,h),0===n.lengthSq()&&(1===Math.abs(i.z)?h.x+=1e-4:h.z+=1e-4,h.normalize(),n.crossVectors(i,h)),n.normalize(),s.crossVectors(h,n),u[0]=n.x,u[4]=s.x,u[8]=h.x,u[1]=n.y,u[5]=s.y,u[9]=h.y,u[2]=n.z,u[6]=s.z,u[10]=h.z,this}lookAtMove(t,e,i){const n=this.elements;let r,o,a,s,h,u,l,c,d,p;const f=t.x,m=t.y,g=t.z,y=i.x,v=i.y,b=i.z,_=e.x,w=e.y,x=e.z;return Math.abs(f-_)<Number.EPSILON&&Math.abs(m-w)<Number.EPSILON&&Math.abs(g-x)<Number.EPSILON?this.identity():(l=f-_,c=m-w,d=g-x,p=1/Math.hypot(l,c,d),l*=p,c*=p,d*=p,r=v*d-b*c,o=b*l-y*d,a=y*c-v*l,p=Math.hypot(r,o,a),p?(p=1/p,r*=p,o*=p,a*=p):(r=0,o=0,a=0),s=c*a-d*o,h=d*r-l*a,u=l*o-c*r,p=Math.hypot(s,h,u),p?(p=1/p,s*=p,h*=p,u*=p):(s=0,h=0,u=0),n[0]=r,n[1]=s,n[2]=l,n[3]=0,n[4]=o,n[5]=h,n[6]=c,n[7]=0,n[8]=a,n[9]=u,n[10]=d,n[11]=0,n[12]=-(r*f+o*m+a*g),n[13]=-(s*f+h*m+u*g),n[14]=-(l*f+c*m+d*g),n[15]=1,this)}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,r=this.elements,o=i[0],a=i[4],s=i[8],h=i[12],u=i[1],l=i[5],c=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],y=i[3],v=i[7],b=i[11],_=i[15],w=n[0],x=n[4],C=n[8],S=n[12],T=n[1],A=n[5],E=n[9],P=n[13],M=n[2],I=n[6],k=n[10],O=n[14],R=n[3],D=n[7],L=n[11],N=n[15];return r[0]=o*w+a*T+s*M+h*R,r[4]=o*x+a*A+s*I+h*D,r[8]=o*C+a*E+s*k+h*L,r[12]=o*S+a*P+s*O+h*N,r[1]=u*w+l*T+c*M+d*R,r[5]=u*x+l*A+c*I+d*D,r[9]=u*C+l*E+c*k+d*L,r[13]=u*S+l*P+c*O+d*N,r[2]=p*w+f*T+m*M+g*R,r[6]=p*x+f*A+m*I+g*D,r[10]=p*C+f*E+m*k+g*L,r[14]=p*S+f*P+m*O+g*N,r[3]=y*w+v*T+b*M+_*R,r[7]=y*x+v*A+b*I+_*D,r[11]=y*C+v*E+b*k+_*L,r[15]=y*S+v*P+b*O+_*N,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[4],n=t[8],r=t[12],o=t[1],a=t[5],s=t[9],h=t[13],u=t[2],l=t[6],c=t[10],d=t[14];return t[3]*(r*s*l-n*h*l-r*a*c+i*h*c+n*a*d-i*s*d)+t[7]*(e*s*d-e*h*c+r*o*c-n*o*d+n*h*u-r*s*u)+t[11]*(e*h*l-e*a*d-r*o*l+i*o*d+r*a*u-i*h*u)+t[15]*(-n*a*u-e*s*l+e*a*c+n*o*l-i*o*c+i*s*u)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t){const e=this.elements;return e[12]=t.x,e[13]=t.y,e[14]=t.z,this}extractPosition(t){const e=this.elements;return t.x=e[12],t.y=e[13],t.z=e[14],t}getInverse(t,e){const i=this.elements,n=t.elements,r=n[0],o=n[1],a=n[2],s=n[3],h=n[4],u=n[5],l=n[6],c=n[7],d=n[8],p=n[9],f=n[10],m=n[11],g=n[12],y=n[13],v=n[14],b=n[15],_=p*v*c-y*f*c+y*l*m-u*v*m-p*l*b+u*f*b,w=g*f*c-d*v*c-g*l*m+h*v*m+d*l*b-h*f*b,x=d*y*c-g*p*c+g*u*m-h*y*m-d*u*b+h*p*b,C=g*p*l-d*y*l-g*u*f+h*y*f+d*u*v-h*p*v,S=r*_+o*w+a*x+s*C;if(0===S){const t="ODIE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(t);return this.identity()}const T=1/S;return i[0]=_*T,i[1]=(y*f*s-p*v*s-y*a*m+o*v*m+p*a*b-o*f*b)*T,i[2]=(u*v*s-y*l*s+y*a*c-o*v*c-u*a*b+o*l*b)*T,i[3]=(p*l*s-u*f*s-p*a*c+o*f*c+u*a*m-o*l*m)*T,i[4]=w*T,i[5]=(d*v*s-g*f*s+g*a*m-r*v*m-d*a*b+r*f*b)*T,i[6]=(g*l*s-h*v*s-g*a*c+r*v*c+h*a*b-r*l*b)*T,i[7]=(h*f*s-d*l*s+d*a*c-r*f*c-h*a*m+r*l*m)*T,i[8]=x*T,i[9]=(g*p*s-d*y*s-g*o*m+r*y*m+d*o*b-r*p*b)*T,i[10]=(h*y*s-g*u*s+g*o*c-r*y*c-h*o*b+r*u*b)*T,i[11]=(d*u*s-h*p*s-d*o*c+r*p*c+h*o*m-r*u*m)*T,i[12]=C*T,i[13]=(d*y*a-g*p*a+g*o*f-r*y*f-d*o*v+r*p*v)*T,i[14]=(g*u*a-h*y*a-g*o*l+r*y*l+h*o*v-r*u*v)*T,i[15]=(h*p*a-d*u*a+d*o*l-r*p*l-h*o*f+r*u*f)*T,this}scale(t){const e=this.elements,i=t.x,n=t.y,r=t.z;return e[0]*=i,e[4]*=n,e[8]*=r,e[1]*=i,e[5]*=n,e[9]*=r,e[2]*=i,e[6]*=n,e[10]*=r,e[3]*=i,e[7]*=n,e[11]*=r,this}extractScale(t){const e=this.elements;return t.x=r.set(e[0],e[1],e[2]).length(),t.y=r.set(e[4],e[5],e[6]).length(),t.y=r.set(e[8],e[9],e[10]).length(),t}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))}makeTranslation(t,e,i){return this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),n=Math.sin(e),r=1-i,o=t.x,a=t.y,s=t.z,h=r*o,u=r*a;return this.set(h*o+i,h*a-n*s,h*s+n*a,0,h*a+n*s,u*a+i,u*s-n*o,0,h*s-n*a,u*s+n*o,r*s*s+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i){return this.set(1,e,i,0,t,1,i,0,t,e,1,0,0,0,0,1),this}compose(t,e,i){const n=this.elements,r=e.x,o=e.y,a=e.z,s=e.w,h=r+r,u=o+o,l=a+a,c=r*h,d=r*u,p=r*l,f=o*u,m=o*l,g=a*l,y=s*h,v=s*u,b=s*l,_=i.x,w=i.y,x=i.z;return n[0]=(1-(f+g))*_,n[1]=(d+b)*_,n[2]=(p-v)*_,n[3]=0,n[4]=(d-b)*w,n[5]=(1-(c+g))*w,n[6]=(m+y)*w,n[7]=0,n[8]=(p+v)*x,n[9]=(m-y)*x,n[10]=(1-(c+f))*x,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}decompose(t,e,i){const n=this.elements;let o=r.set(n[0],n[1],n[2]).length();const a=r.set(n[4],n[5],n[6]).length(),h=r.set(n[8],n[9],n[10]).length();this.determinant()<0&&(o=-o),t.x=n[12],t.y=n[13],t.z=n[14],s.copy(this);const u=1/o,l=1/a,c=1/h;return s.elements[0]*=u,s.elements[1]*=u,s.elements[2]*=u,s.elements[4]*=l,s.elements[5]*=l,s.elements[6]*=l,s.elements[8]*=c,s.elements[9]*=c,s.elements[10]*=c,e.setFromRotationMatrix(s),i.x=o,i.y=a,i.z=h,this}makePerspective(t,e,i,n){const r=this.elements,o=1/Math.tan(t/2);let a;return r[0]=o/e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=o,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,void 0!==n&&n!==1/0?(a=1/(i-n),r[10]=(n+i)*a,r[14]=2*n*i*a):(r[10]=-1,r[14]=-2*i),this}makeOrthographic(t,e,i,n,r,o){const a=this.elements,s=1/(t-e),h=1/(n-i),u=1/(r-o);return a[0]=-2*s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=-2*h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=2*u,a[11]=0,a[12]=(t+e)*s,a[13]=(i+n)*h,a[14]=(o+r)*u,a[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<16;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e){void 0===e&&(e=0);for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t,e){void 0===t&&(t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),void 0===e&&(e=0);const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}log(){this.elements;console.table}reflectOnPlane(t){const e=t.normal.x,i=t.normal.y,n=t.normal.z,r=t.constant,o=s.elements;return o[0]=1-2*e*e,o[4]=-2*e*i,o[8]=-2*e*n,o[12]=-2*e*r,o[1]=-2*e*i,o[5]=1-2*i*i,o[9]=-2*i*n,o[13]=-2*i*r,o[2]=-2*e*n,o[6]=-2*i*n,o[10]=1-2*n*n,o[14]=-2*n*r,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this.multiply(s)}extractForward(t){return t.x=this.elements[8],t.y=this.elements[9],t.z=this.elements[10],t.setLength(-1),t}extractRight(t){return t.x=this.elements[0],t.y=this.elements[1],t.z=this.elements[2],t.setLength(1),t}extractUp(t){return t.x=this.elements[4],t.y=this.elements[5],t.z=this.elements[6],t.setLength(1),t}extractBack(t){return this.extractForward(t),t.multiplyScalar(-1),t}extractLeft(t){return this.extractRight(t),t.multiplyScalar(-1),t}extractDown(t){return this.extractUp(t),t.multiplyScalar(-1),t}}const r=new n.a,o=new n.a,a=new n.a,s=new Matrix4,h=new n.a,u=new n.a(0,0,0),l=new n.a(1,1,1)},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SignalConnections=e.Signal=e.CollectorWhile0=e.CollectorUntil0=e.CollectorLast=e.CollectorArray=e.Collector=void 0;var n=i(118);Object.defineProperty(e,"Collector",{enumerable:!0,get:function(){return n.Collector}});var r=i(426);Object.defineProperty(e,"CollectorArray",{enumerable:!0,get:function(){return r.CollectorArray}});var o=i(427);Object.defineProperty(e,"CollectorLast",{enumerable:!0,get:function(){return o.CollectorLast}});var a=i(428);Object.defineProperty(e,"CollectorUntil0",{enumerable:!0,get:function(){return a.CollectorUntil0}});var s=i(429);Object.defineProperty(e,"CollectorWhile0",{enumerable:!0,get:function(){return s.CollectorWhile0}});var h=i(430);Object.defineProperty(e,"Signal",{enumerable:!0,get:function(){return h.Signal}});var u=i(433);Object.defineProperty(e,"SignalConnections",{enumerable:!0,get:function(){return u.SignalConnections}})},,function(t,e,i){"use strict";i.d(e,"a",(function(){return Runner}));class Runner{constructor(t,e=0){this.items=[],this._name=t,this.running=!1,this.dispatch=Runner._generateRun(t,e),this.run=this.dispatch,this.emit=this.dispatch,this._dummy={},this._dummy[t]=()=>{}}static _generateRun(t,e){const i=t+"|"+e;let n=Runner._hash[i];if(!n){if(e>0){let i="arg0";for(let t=1;t<e;t++)i+=",arg"+t;n=new Function(i,"this.running = true;\n var items = this.items;\n for(var i=0;i<items.length;i++)\n { items[i]."+t+"("+i+");}\n this.running = false;\n if( this.needsTidy) this.tidy()")}else n=new Function("this.running = true;\n var items = this.items;\n for(var i=0;i<items.length;i++)\n { items[i]."+t+"(); }\n this.running = false;\n if( this.needsTidy) this.tidy() ");Runner._hash[i]=n}return n}add(t){return t[this._name]&&(this.remove(t),this.items.push(t),this._toRemove=[],this.needsTidy=!1),this}remove(t){const e=this.items.indexOf(t);return this.running?(this.needsTidy=!0,this._toRemove.push(e),this.items[e]=this._dummy):-1!==e&&this.items.splice(e,1),this}contains(t){return-1!==this.items.indexOf(t)}removeAll(){this.items.length=0}destroy(){this.removeAll(),this.items=null}tidy(){for(let t=this._toRemove.length-1;t>=0;t--){const e=this._toRemove[t];-1!==e&&this.items.splice(e,1)}}get empty(){return 0===this.items.length}}Runner._hash={}},,,,function(t,e,i){(function(t){function i(t,e){for(var i=0,n=t.length-1;n>=0;n--){var r=t[n];"."===r?t.splice(n,1):".."===r?(t.splice(n,1),i++):i&&(t.splice(n,1),i--)}if(e)for(;i--;i)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var i=[],n=0;n<t.length;n++)e(t[n],n,t)&&i.push(t[n]);return i}e.resolve=function(){for(var e="",r=!1,o=arguments.length-1;o>=-1&&!r;o--){var a=o>=0?arguments[o]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(e=a+"/"+e,r="/"===a.charAt(0))}return(r?"/":"")+(e=i(n(e.split("/"),(function(t){return!!t})),!r).join("/"))||"."},e.normalize=function(t){var o=e.isAbsolute(t),a="/"===r(t,-1);return(t=i(n(t.split("/"),(function(t){return!!t})),!o).join("/"))||o||(t="."),t&&a&&(t+="/"),(o?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(n(t,(function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t})).join("/"))},e.relative=function(t,i){function n(t){for(var e=0;e<t.length&&""===t[e];e++);for(var i=t.length-1;i>=0&&""===t[i];i--);return e>i?[]:t.slice(e,i-e+1)}t=e.resolve(t).substr(1),i=e.resolve(i).substr(1);for(var r=n(t.split("/")),o=n(i.split("/")),a=Math.min(r.length,o.length),s=a,h=0;h<a;h++)if(r[h]!==o[h]){s=h;break}var u=[];for(h=s;h<r.length;h++)u.push("..");return(u=u.concat(o.slice(s))).join("/")},e.sep="/",e.delimiter=":",e.dirname=function(t){if("string"!=typeof t&&(t+=""),0===t.length)return".";for(var e=t.charCodeAt(0),i=47===e,n=-1,r=!0,o=t.length-1;o>=1;--o)if(47===(e=t.charCodeAt(o))){if(!r){n=o;break}}else r=!1;return-1===n?i?"/":".":i&&1===n?"/":t.slice(0,n)},e.basename=function(t,e){var i=function(t){"string"!=typeof t&&(t+="");var e,i=0,n=-1,r=!0;for(e=t.length-1;e>=0;--e)if(47===t.charCodeAt(e)){if(!r){i=e+1;break}}else-1===n&&(r=!1,n=e+1);return-1===n?"":t.slice(i,n)}(t);return e&&i.substr(-1*e.length)===e&&(i=i.substr(0,i.length-e.length)),i},e.extname=function(t){"string"!=typeof t&&(t+="");for(var e=-1,i=0,n=-1,r=!0,o=0,a=t.length-1;a>=0;--a){var s=t.charCodeAt(a);if(47!==s)-1===n&&(r=!1,n=a+1),46===s?-1===e?e=a:1!==o&&(o=1):-1!==e&&(o=-1);else if(!r){i=a+1;break}}return-1===e||-1===n||0===o||1===o&&e===n-1&&e===i+1?"":t.slice(e,n)};var r="b"==="ab".substr(-1)?function(t,e,i){return t.substr(e,i)}:function(t,e,i){return e<0&&(e=t.length+e),t.substr(e,i)}}).call(this,i(171))},,function(t,e,i){(function(e){var i=function(t){return t&&t.Math==Math&&t};t.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this,i(82))},,,function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,i){var n=i(45),r=i(158),o=i(58),a=i(162),s=i(194),h=i(196),u=r("wks"),l=n.Symbol,c=h?l:l&&l.withoutSetter||a;t.exports=function(t){return o(u,t)&&(s||"string"==typeof u[t])||(s&&o(l,t)?u[t]=l[t]:u[t]=c("Symbol."+t)),u[t]}},function(t,e,i){"use strict";i.d(e,"b",(function(){return h})),i.d(e,"a",(function(){return l})),i.d(e,"c",(function(){return c}));i(9);var n=i(43),r=i.n(n),o=i(190),a=function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))};const s=[],h={},u={};function l(t){t instanceof Array?s.push(...t):s.push(t)}function c(t,e){return a(this,void 0,void 0,(function*(){let i=0;const n=t.length,l={};let c=!1;t instanceof Array||(c=!0,t=[t]);const d=t.map(t=>a(this,void 0,void 0,(function*(){Object(o.a)(t)||(t=r.a.normalize(t));try{u[t]||(u[t]=function(t){return a(this,void 0,void 0,(function*(){let e=null;for(let i=0;i<s.length;i++){const n=s[i];n.load&&n.test&&n.test(t)&&(e=yield n.load(t))}for(let i=0;i<s.length;i++){const n=s[i];n.parse&&(n.testParse&&!n.testParse(e,t)||(e=(yield n.parse(e,t))||e))}return h[t]=e,e}))}(t)),l[t]=yield u[t]}catch(t){}e&&e(++i/n)})));return yield Promise.all(d),c?l[t[0]]:l}))}},function(t,e,i){"use strict";i.d(e,"a",(function(){return I18n})),i.d(e,"b",(function(){return r}));i(56);var n=i(37);class I18n{constructor(){this.onUpdate=new n.Signal,this.dictionaries={en:{}},this._language="en"}appendDictionary(t,e){if(!e)throw new Error("[I18n] Invalid data");for(const i in e)this.setEntry(i,e[i],t);this.onUpdate.emit(this)}changeLanguage(t){if(!this.dictionaries[t])throw new Error("[I18n] Language not available: "+t);this._language=t,this.onUpdate.emit(this)}get language(){return this._language}set language(t){this.changeLanguage(t)}getLanguages(){return Object.keys(this.dictionaries)}getEntry(t,e){e||(e=this._language);const i=this.dictionaries[e];if(!i)throw new Error("[I18n] No content for language: "+e);const n=i[t];if(!n)throw new Error("[I18n] Entry "+t+" not available on "+e);return n}setEntry(t,e,i){i||(i=this._language),this.dictionaries[i]||(this.dictionaries[i]={});const n=this.dictionaries[i];n[t]||(n[t]=Object.assign({},I18n.defaultEntry));const r=n[t];return"string"==typeof e&&(e={text:e}),Object.assign(r,e),r.text=String(r.text),r.type=String(r.type),r.fontName=String(r.fontName),r.scale=Number(r.scale),r.offsetX=Number(r.offsetX),r.offsetY=Number(r.offsetY),r}translate(t,e={}){const i=this.getEntry(t);return this.format(i.text,e)}format(t,e={}){const i=t.match(/{{(.*?)}}/gm)||{};for(const n in i){const r=i[n],o=r.replace("{{","").replace("}}","");if(void 0===e[o])throw new Error("[I18n] Missing param "+o+" for text: "+t);t=t.replace(new RegExp(r,"gm"),String(e[o]))}return t}}I18n.defaultEntry={type:"text",text:"",fontName:"",scale:1,offsetX:0,offsetY:0};const r=new I18n},,function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var n=function(){function t(t){this.items=[],this._name=t,this._aliasCount=0}return t.prototype.emit=function(t,e,i,n,r,o,a,s){if(arguments.length>8)throw new Error("max arguments reached");var h=this,u=h.name,l=h.items;this._aliasCount++;for(var c=0,d=l.length;c<d;c++)l[c][u](t,e,i,n,r,o,a,s);return l===this.items&&this._aliasCount--,this},t.prototype.ensureNonAliasedItems=function(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},t.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},t.prototype.remove=function(t){var e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},t.prototype.contains=function(t){return-1!==this.items.indexOf(t)},t.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},t.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this.items.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),t}();Object.defineProperties(n.prototype,{dispatch:{value:n.prototype.emit},run:{value:n.prototype.emit}})},function(t,e,i){"use strict";var n,r;i(9);!function(t){t.RANDOM="random",t.LINEAR="linear"}(n||(n={})),function(t){t.SINGLE="single",t.GROUP="group"}(r||(r={}));var o,a={selectionMode:n.RANDOM,sequenceMode:r.SINGLE},s=1,h=function(){function t(e){this.selectionMode=n.RANDOM,this.sequenceMode=r.SINGLE,this.children=[],this.matchingChildren=[],this.usedChildren=[],this.id=e.id,(e=Object.assign({},a,e)).id||(e.id="uid_"+s++),this.selectionMode=e.selectionMode,this.sequenceMode=e.sequenceMode,this.filter=e.filter,e.children&&(this.children=e.children.map((function(e){return new t(e)})))}return t.prototype.addItem=function(t){this.children.push(t)},t.prototype.removeAll=function(){this.children=[]},t.prototype.getSequence=function(t){return this.buildSequence(t,this)},t.prototype.getItem=function(t){if(void 0===t&&(t=null),0===this.children.length)return this.applyFilter(this,t)?this:null;if(this.setMatchingChildren(t),0===this.matchingChildren.length){if(0===this.usedChildren.length)return null;this.resetUsedChildren(),this.setMatchingChildren(t)}if(0===this.matchingChildren.length)return null;var e;switch(this.selectionMode){case n.LINEAR:e=0;break;default:e=Math.floor(Math.random()*this.matchingChildren.length)}var i=this.matchingChildren.splice(e,1)[0];return this.usedChildren.push(i),i},Object.defineProperty(t.prototype,"playedAll",{get:function(){return 0===this.matchingChildren.length&&this.resetUsedChildren(),0===this.matchingChildren.length||0===this.children.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasChildren",{get:function(){return this.numChildren>0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numChildren",{get:function(){return this.children.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"singleMode",{get:function(){return this.sequenceMode===r.SINGLE},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this.parent},enumerable:!0,configurable:!0}),t.prototype.resetUsedChildren=function(){this.usedChildren=[]},t.prototype.applyFilter=function(t,e){return null===t.filter||null===e||e.test(t.filter)},t.prototype.setMatchingChildren=function(t){var e=this;this.matchingChildren=this.children.filter((function(i){return e.applyFilter(i,t)&&-1===e.usedChildren.indexOf(i)}))},t.prototype.buildSequence=function(t,e,i){i||(i=[]);var n=e.getItem(t);return null===n||n.hasChildren?null!==n&&this.buildSequence(t,n,i):i.push(n.id),null===n||n===e||e.playedAll||e.singleMode||this.buildSequence(t,e,i),i},t}(),u=i(89),l=i(21),c={volume:1,muted:!1,paused:!1,rate:1},d=function(){function t(){this.muteChanged=new u.Signal,this._children=new Set,this.internal=Object.assign({},c),this.inherited=Object.assign({},c)}return Object.defineProperty(t.prototype,"volume",{get:function(){return this.internal.volume},set:function(t){t!==this.internal.volume&&(this.internal.volume=t,this.propogateVolume())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rate",{get:function(){return this.internal.rate},set:function(t){t!==this.internal.rate&&(this.internal.rate=t,this.propogateRate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"muted",{get:function(){return this.internal.muted},set:function(t){t!==this.internal.muted&&(this.internal.muted=t,this.propogateMuted(),this.muteChanged.emit(t))},enumerable:!0,configurable:!0}),t.prototype.mute=function(t){void 0===t&&(t=!0),this.muted=t},Object.defineProperty(t.prototype,"paused",{get:function(){return this.internal.paused},set:function(t){t!==this.internal.paused&&(this.internal.paused=t,this.propogatePaused())},enumerable:!0,configurable:!0}),t.prototype.pause=function(){this.paused=!0},t.prototype.resume=function(){this.paused=!1},t.prototype.addChild=function(t){return!this._children.has(t)&&(this._children.add(t),t.inheritState(this.accumulatedState),!0)},t.prototype.removeChild=function(t){this._children.delete(t)},t.prototype.propogateState=function(){var t=this;this.propogateValue((function(e){return e.inheritState(t.accumulatedState)}))},t.prototype.propogateVolume=function(){var t=this;this.propogateValue((function(e){return e.inheritVolume(t.accumulatedVolume)}))},t.prototype.propogatePaused=function(){var t=this;this.propogateValue((function(e){return e.inheritPaused(t.accumulatedPaused)}))},t.prototype.propogateMuted=function(){var t=this;this.propogateValue((function(e){return e.inheritMuted(t.accumulatedMuted)}))},t.prototype.propogateRate=function(){var t=this;this.propogateValue((function(e){return e.inheritRate(t.accumulatedRate)}))},t.prototype.propogateValue=function(t){this._children.forEach((function(e){t(e)}))},t.prototype.inheritVolume=function(t){this.inherited.volume=t,this.propogateVolume()},t.prototype.inheritRate=function(t){this.inherited.rate=t,this.propogateRate()},t.prototype.inheritMuted=function(t){this.inherited.muted=t,this.propogateMuted()},t.prototype.inheritPaused=function(t){this.inherited.paused=t,this.propogatePaused()},t.prototype.inheritState=function(t){this.inherited=Object.assign({},t),this.propogateState()},Object.defineProperty(t.prototype,"accumulatedVolume",{get:function(){return this.inherited.volume*this.internal.volume},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"accumulatedPaused",{get:function(){return this.inherited.paused||this.internal.paused},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"accumulatedMuted",{get:function(){return this.inherited.muted||this.internal.muted},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"accumulatedRate",{get:function(){return this.inherited.rate*this.internal.rate},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"accumulatedState",{get:function(){return{volume:this.accumulatedVolume,paused:this.accumulatedPaused,muted:this.accumulatedMuted,rate:this.accumulatedRate}},enumerable:!0,configurable:!0}),t.prototype.fadeTo=function(t,e,i){l.b.to(this,e,{volume:t,ease:"none",onComplete:i})},t.prototype.fadeIn=function(t,e){this.volume=0,this.fadeTo(1,t,e)},t.prototype.fadeOut=function(t,e){this.fadeTo(0,t,e)},t}(),p=(o=function(t,e){return(o=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(t,e){function i(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),f=function(t){function e(e,i){void 0===i&&(i=1);var n=t.call(this)||this;return n.completed=new u.Signal,n.looped=new u.Signal,n.disposed=new u.Signal,n.loopsRemaining=1,n._loop=!1,n._keepAlive=!1,n.callbackOnInterrupt=!1,n.canPropogate=!1,n.boundOnCompleteHandler=function(){return n._onCompleteHandler()},n._id=e,n._baseVolume=i||1,n}return p(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),e.prototype.postConstructor=function(t){void 0===t&&(t={}),t.loops?(this.loopsRemaining=!0===t.loops?1/0:t.loops,this._loop=this.loopsRemaining>1):this.loopsRemaining=1,this.volume=void 0!==t.volume?t.volume:1,t.panning&&(this.panning=t.panning),this.rate=void 0!==t.rate?t.rate:1,this.callback=t.callback,this.callbackScope=t.callbackScope,this.callbackOnInterrupt=!!t.callbackOnInterrupt,this._addListeners()},e.prototype.seek=function(t){this._seek(t),this._keepAlive=!0},e.prototype.cue=function(t){this._seek(t),this.paused=!0,this._keepAlive=!0},e.prototype.restart=function(){this._seek(0),this.accumulatedPaused||this._resume(),this._keepAlive=!0},e.prototype.interrupt=function(){this.callbackOnInterrupt&&this.executeCallback()},e.prototype.stop=function(t){void 0===t&&(t=!1),this._stop(),this._keepAlive=!1,this.callback&&t&&this.executeCallback(),this._keepAlive||this.dispose()},e.prototype.propogateVolume=function(){var t=this.accumulatedMuted?0:this.accumulatedVolume;this._setCalculatedVolume(t*this._baseVolume)},e.prototype.propogateMuted=function(){var t=this.accumulatedMuted?0:this.accumulatedVolume;this._setCalculatedVolume(t*this._baseVolume)},e.prototype.propogatePaused=function(){this.accumulatedPaused?this._pause():this._resume()},e.prototype.propogateRate=function(){this._setCalculatedRate(this.accumulatedRate)},e.prototype.propogateState=function(){this.propogateVolume(),this.propogatePaused(),this.propogateMuted(),this.propogateRate()},e.prototype._onCompleteHandler=function(){if(this._loop&&(this.loopsRemaining-=1,0!==this.loopsRemaining))return this.restart(),void this.looped.emit(this);this._keepAlive=!1,this.executeCallback(),this.completed.emit(this),this._keepAlive||this.stop()},e.prototype.executeCallback=function(){this.callback&&(this.callbackScope?this.callback.call(this.callbackScope,this):this.callback(this),this.callback=null)},e.prototype.dispose=function(){this._removeListeners(),this.disposed.emit(this),this.disposed.disconnectAll(),this.looped.disconnectAll(),this.completed.disconnectAll()},Object.defineProperty(e.prototype,"hasLoopsRemaining",{get:function(){return this._loop&&this.loopsRemaining>1},enumerable:!0,configurable:!0}),e}(d),m=i(286),g=function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),y=function(t){function e(e,i,n,r){var o=t.call(this,e,i)||this;return o.howl=n,o.uid=n.play(),o.pause(),o.postConstructor(r),o}return g(e,t),Object.defineProperty(e.prototype,"panning",{set:function(t){this.howl.stereo(t,this.uid)},enumerable:!0,configurable:!0}),e.prototype._seek=function(t){this.howl.seek(1e3*t,this.uid)},e.prototype._setCalculatedVolume=function(t){this.howl.volume(t,this.uid)},e.prototype._setCalculatedRate=function(t){this.howl.rate(t,this.uid)},e.prototype._pause=function(){this.howl.pause(this.uid)},e.prototype._resume=function(){this.howl.play(this.uid)},e.prototype._stop=function(){this.howl.stop(this.uid)},e.prototype._addListeners=function(){this.howl.on("end",this.boundOnCompleteHandler,this.uid)},e.prototype._removeListeners=function(){this.howl.off("end",this.boundOnCompleteHandler,this.uid)},Object.defineProperty(e.prototype,"rawObject",{get:function(){return{id:this.uid,howl:this.howl}},enumerable:!0,configurable:!0}),e}(f),v=function(){function t(){this.soundsById=new Map}return t.prototype.registerSound=function(t){var e=new m.Howl({src:t.src,preload:t.preload,html5:t.stream,autoplay:!1,volume:0});this.soundsById.set(t.id,e)},t.prototype.factorySoundInstance=function(t,e,i){void 0===i&&(i={});var n=this.soundsById.get(t);return n?("unloaded"===n.state()&&n.load(),new y(t,e,n,i)):null},t}(),b=function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),_=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.sounds=new Set,e._singlefile=!1,e._crossFadeDuration=0,e}return b(e,t),e.prototype.addSound=function(t){var e=this;if(this._singlefile&&this.sounds.size){var i=this._crossFadeDuration>0;this.sounds.forEach((function(t){t.interrupt(),i?t.fadeOut(e._crossFadeDuration,(function(){return t.stop()})):t.stop()})),i&&t.fadeIn(this._crossFadeDuration)}this.sounds.add(t),t.disposed.connect((function(t){return e.removeSound(t)})),t.resume(),this.addChild(t)},Object.defineProperty(e.prototype,"singleFile",{set:function(t){this._singlefile=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"crossFadeDuration",{set:function(t){this._crossFadeDuration=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wouldBeInterrupted",{get:function(){return this.sounds.size&&this._singlefile},enumerable:!0,configurable:!0}),e.prototype.restart=function(){this.forEach((function(t){return t.restart()}))},e.prototype.forEach=function(t){this.sounds.forEach(t)},e.prototype.stop=function(t){this.forEach((function(e){return e.stop(t)}))},e.prototype.removeSound=function(t){this.sounds.delete(t),this.removeChild(t)},e}(d),w=function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),x=function(t){function e(e,i,n,r){var o=t.call(this,e)||this;return o.currentIndex=-1,o.collection=i,o.channel=n,o.currentOptions=Object.assign({},r),o.currentOptions.loops=1,o.postConstructor(r),o._initFromCollection(),o._playNext(),o}return w(e,t),e.prototype._initFromCollection=function(){this.currentIndex=-1,this.ids=this.collection.getSequence()},e.prototype._playNext=function(){var t=this;this.currentIndex++,this.currentOptions.callback=this.currentIndex<this.ids.length-1?function(){return t._playNext()}:function(){t.hasLoopsRemaining&&t._initFromCollection(),t._onCompleteHandler()},this.currentOptions.volume=this.volume,this.currentSoundInstance=T.playOnChannel(this.ids[this.currentIndex],this.channel,this.currentOptions)},Object.defineProperty(e.prototype,"volume",{get:function(){return this.currentOptions.volume},set:function(t){t!==this.currentOptions.volume&&(this.currentOptions.volume=t,this.currentSoundInstance&&(this.currentSoundInstance.volume=t))},enumerable:!0,configurable:!0}),e.prototype._setCalculatedVolume=function(){},e.prototype._setCalculatedRate=function(){},e.prototype._pause=function(){this.currentSoundInstance.pause()},e.prototype._resume=function(){this.currentSoundInstance.resume()},e.prototype._stop=function(){this.currentSoundInstance.stop()},e.prototype._seek=function(t){if(0!==t)throw new Error("SoundBoy : SoundCollectionInstance : cannot seek in a SoundCollectionInstance");this.currentSoundInstance.stop(),this.currentIndex=-1,this._playNext()},e.prototype._addListeners=function(){},e.prototype._removeListeners=function(){},Object.defineProperty(e.prototype,"panning",{get:function(){return this.currentOptions.panning},set:function(t){this.currentOptions.panning=t,this.currentSoundInstance&&(this.currentSoundInstance.panning=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rate",{get:function(){return this.currentOptions.rate},set:function(t){this.currentOptions.rate=t,this.currentSoundInstance&&(this.currentSoundInstance.rate=t)},enumerable:!0,configurable:!0}),e}(f),C=function(){var t=function(e,i){return(t=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])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),S={id:"",src:"",preload:!1,loop:!1,volume:1},T=new(function(t){function e(){var i=t.call(this)||this;return i.systemPauseChanged=new u.Signal,i.channelsById=new Map,i.soundsById=new Map,i.collectionsById=new Map,i.preload=!0,i.soundFactory=new v,i.extensions=["ogg","mp3"],i.addChannel(e.CHANNEL_SFX),i.addChannel(e.CHANNEL_MUSIC),i.addChannel(e.CHANNEL_VO),i.voChannel.singleFile=!0,i.musicChannel.singleFile=!0,i.musicChannel.crossFadeDuration=2,i.system=new d,i.system.addChild(i),i}return C(e,t),Object.defineProperty(e.prototype,"systemMuteChanged",{get:function(){return this.system.muteChanged},enumerable:!0,configurable:!0}),e.prototype.registerSound=function(t){if(this.soundsById.get(t.id),t!==S&&(t=Object.assign({},S,t)),"string"==typeof t.src){var e=void 0,i=t.src.split(".").pop();e="ogg"===i||"mp3"===i||"wav"===i?[t.src]:this.extensions.map((function(e){return t.src+"."+e})),t.src=e}this.soundsById.set(t.id,t),this.soundFactory.registerSound(t)},e.prototype.play=function(t,e){return this.playSfx(t,e)},e.prototype.playSfx=function(t,i){return this.playOnChannel(t,e.CHANNEL_SFX,i)},e.prototype.playMusic=function(t,i){return this.playOnChannel(t,e.CHANNEL_MUSIC,i)},e.prototype.playVo=function(t,i){return this.playOnChannel(t,e.CHANNEL_VO,i)},e.prototype.playOnChannel=function(t,e,i){void 0===i&&(i={});var n=this.getChannelById(e);if(i.wontInterrupt&&n.wouldBeInterrupted)return null;var r=this.soundsById.get(t);if(!r){var o=this.collectionsById.get(t);return new x(t,o,e,i)}!i.loops&&r.loop&&(i.loops=1/0);var a=this.soundFactory.factorySoundInstance(t,r.volume,i);if(!a)throw new Error("problem creating sound instance with id: "+t);return n.addSound(a),a},Object.defineProperty(e.prototype,"systemMuted",{get:function(){return this.system.muted},set:function(t){t!==this.system.muted&&(this.system.muted=t,this.systemMuteChanged.emit(t))},enumerable:!0,configurable:!0}),e.prototype.systemMute=function(t){void 0===t&&(t=!0),this.systemMuted=t},Object.defineProperty(e.prototype,"systemPaused",{get:function(){return this.system.paused},set:function(t){t!==this.system.paused&&(this.system.paused=t,this.systemPauseChanged.emit(t))},enumerable:!0,configurable:!0}),e.prototype.systemPause=function(t){void 0===t&&(t=!0),this.systemPaused=t},e.prototype.stop=function(){this.channelsById.forEach((function(t){return t.stop()}))},e.prototype.registerCollection=function(t){this.collectionsById.set(t.id,new h(t))},e.prototype.addChannel=function(t){if(this.channelsById.get(t))return this.channelsById.get(t);var e=new _;return this.channelsById.set(t,e),this.addChild(e),e},e.prototype.getChannelById=function(t){return this.channelsById.get(t)},Object.defineProperty(e.prototype,"musicChannel",{get:function(){return this.channelsById.get(e.CHANNEL_MUSIC)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sfxChannel",{get:function(){return this.channelsById.get(e.CHANNEL_SFX)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"voChannel",{get:function(){return this.channelsById.get(e.CHANNEL_VO)},enumerable:!0,configurable:!0}),e.CHANNEL_SFX="sfx",e.CHANNEL_VO="vo",e.CHANNEL_MUSIC="music",e}(d));e.a=T},,function(t,e,i){"use strict";var n=i(343),r=i(48),o=i(79),a=i(92),s=i(72),h=i(132),u=i(112),l=i(349),c=i(351),d=i(352),p=i(49)("replace"),f=Math.max,m=Math.min,g="$0"==="a".replace(/./,"$0"),y=!!/./[p]&&""===/./[p]("a","$0");n("replace",(function(t,e,i){var n=y?"$":"$0";return[function(t,i){var n=u(this),r=null==t?void 0:t[p];return void 0!==r?r.call(t,n,i):e.call(h(n),t,i)},function(t,r){var u=o(this),p=h(t);if("string"==typeof r&&-1===r.indexOf(n)&&-1===r.indexOf("$<")){var g=i(e,u,p,r);if(g.done)return g.value}var y="function"==typeof r;y||(r=h(r));var v=u.global;if(v){var b=u.unicode;u.lastIndex=0}for(var _=[];;){var w=d(u,p);if(null===w)break;if(_.push(w),!v)break;""===h(w[0])&&(u.lastIndex=l(p,s(u.lastIndex),b))}for(var x,C="",S=0,T=0;T<_.length;T++){w=_[T];for(var A=h(w[0]),E=f(m(a(w.index),p.length),0),P=[],M=1;M<w.length;M++)P.push(void 0===(x=w[M])?x:String(x));var I=w.groups;if(y){var k=[A].concat(P,E,p);void 0!==I&&k.push(I);var O=h(r.apply(void 0,k))}else O=c(A,p,E,P,I,r);E>=S&&(C+=p.slice(S,E)+O,S=E+A.length)}return C+p.slice(S)}]}),!!r((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!g||y)},,function(t,e,i){var n=i(100),r={}.hasOwnProperty;t.exports=Object.hasOwn||function(t,e){return r.call(n(t),e)}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},,,,function(t,e,i){i(93)("Uint16",(function(t){return function(e,i,n){return t(this,e,i,n)}}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return Coin_Coin}));var n=i(1),r=i(142),o=i(19),a=i(143),s=i(77),h=i(144),u=i(75),l=i(17),c=i(18);function d(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Shine_Shine extends c.a{constructor(t,e={}){super(t,e),d(this,"view",void 0),d(this,"minDist",400),this.view=l.a.plane(13,13,.2,"halo",1);const i=this.view.getComponent(u.a);i.state.blend=!0,i.orderBias=999,this.view.z=-1.2,t.addChild(this.view),this.view.scale.set(2)}update(){const t=1-(this.entity.game.hero.body.z-this.entity.body.z)/this.minDist;t<0?this.view.active=!1:(this.view.scale.set(t),this.view.active=t>.5)}}var p=i(14);function f(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Coin_Coin extends p.a{constructor(){super(),f(this,"trigger",0),f(this,"speed",0),f(this,"attractable",void 0),f(this,"movable",void 0),f(this,"collectible",void 0),f(this,"floating",void 0),f(this,"arc",0),this.add(o.a,{ghost:!0,boxColor:16776960}),this.add(r.a),this.add(h.a),this.add(a.a),this.add(s.a,{rotationSpeed:.06}),this.add(Shine_Shine),this.body.width=10,this.body.height=10,this.body.depth=10,this.trigger=0,this.speed=0,this.build()}build(){!this.model&&Coin_Coin.hasNecessaryResources()&&(this.model=n.a.library.getEntity("currency_coin"),this.addChild(this.model))}reset(){this.model&&(this.movable.reset(),this.body.velocity.reset(),this.attractable.reset(),this.body.movable=!1,this.active=!0)}awake(){this.build(),this.model&&(this.movable.reset(),this.attractable.reset(),this.body.velocity.reset(),this.body.movable=!1,this.active=!0)}onCollect(){this.model&&(this.game.stats.coins+=1,this.game.missions.addStat(1,"mission-pickup-coins"),this.game.sfx.play("pickup-coin",{volume:.5,rate:1+.05*this.arc}),this.game.hero.pop.play())}static hasNecessaryResources(){return n.a.library.hasGeometry("currency_coin")&&n.a.library.hasMap("halo")}static match(t){return!!t.name.match(/Coin \(/)||!!t.name.match(/Coins \(/)}static factory(t,e,i){if(Coin_Coin.hasNecessaryResources())if(e.name.match(/Line/)){const n=5,r=e.components.Transform.position.y;if(r>50)return;const o=e.components.CoinCurve._curveOffset,a=e.components.CoinCurve._curveParent._cachedCurve.MaxCoords.z,s=a*o,h=a/n;for(let o=0;o<n;o++){const n=Coin_Coin.spawn(t,e,i),a=o*h-s;n.body.z-=a,n.arc=0,n.removableOnCrash=r>1}}else e.name.match(/Jump Curve/)?Coin_Coin.spawnJumpCurve(t,e,i):Coin_Coin.spawn(t,e,i)}static spawn(t,e,i){if(!Coin_Coin.hasNecessaryResources())return null;const n=t.game.pool.get(Coin_Coin),r=e.components.Transform.position.x,o=e.components.Transform.position.y,a=e.components.Transform.position.z;return n.body.x=r,n.body.bottom=o,n.body.z=t.z-a,n.removableOnCrash=o>1,i.px&&(n.body.x=i.px),i.offsetX&&(n.body.x=i.offsetX),i.flip&&(n.body.x*=-1),n.body.bottom>150&&(n.body.bottom=29),n.awake(),i.py&&(n.body.bottom=i.py),i.bottom&&(n.body.bottom=i.bottom),n.arc=0,t.game.addChild(n),n}static spawnLine(t,e,i,n,r=5){if(!Coin_Coin.hasNecessaryResources())return;const o=29*r*.5-15;for(let a=0;a<r;a++){const r=t.game.pool.get(Coin_Coin);r.body.z=n-30*a+o,r.body.bottom=i,r.body.x=e,r.awake(),r.arc=0,r.removableOnCrash=i>1,t.game.addChild(r)}}static spawnCurve(t,e,i,n){if(!Coin_Coin.hasNecessaryResources())return;const r=50*t.game.stats.speed,o=Math.floor(r/13),a=r/o,s=(a-1)*o*.5-.5*a,h=Math.PI/(o-1);for(let r=0;r<o;r++){const o=t.game.pool.get(Coin_Coin);o.body.z=n-r*a+s,o.body.bottom=i+22*Math.sin(h*r),o.body.x=e,o.awake(),o.arc=r+1,o.removableOnCrash=!0,t.game.addChild(o)}}static spawnJumpCurve(t,e,i){if(!Coin_Coin.hasNecessaryResources())return;const n=50*t.game.stats.speed,r=Math.floor(n/14),o=e.components.CoinCurve?e.components.CoinCurve._curveOffset:.5,a=n/r,s=Math.PI/r,h=n*o;for(let n=0;n<r;n++){const r=Coin_Coin.spawn(t,e,i);if(r){const t=n*a-h,e=22*Math.sin(s*n);r.body.bottom+=e,r.body.z-=t,r.arc=n+1,r.removableOnCrash=!0}}}static prepopulate(){n.a.game.pool.prepopulate(Coin_Coin,128)}}},,function(t,e,i){"use strict";i.d(e,"c",(function(){return Pickup_Pickup})),i.d(e,"a",(function(){return Pickup_PickupLetter})),i.d(e,"b",(function(){return Pickup_PickupMysteryBox}));i(9);var n=i(32),r=i(104),o=i(2),a=i(1),s=i(13),h=i(38),u=i(142),l=i(19),c=i(18);class Bouncing_Bouncing extends c.a{constructor(t){var e,i,n;super(t),n=0,(i="bounce")in(e=this)?Object.defineProperty(e,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[i]=n,this.bounce=0}reset(){this.bounce=0}update(t){if(!this.entity.model)return;const e=t.frameTime;this.bounce+=.1*e,this.entity.model.y=Math.abs(3*Math.sin(this.bounce)),this.entity.model.rz=.2*Math.sin(this.bounce)}}var d=i(143),p=i(77),f=i(47),m=i(10);function g(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Halo_Halo extends c.a{constructor(t,e={}){super(t,e),g(this,"view",void 0),g(this,"halo",void 0),g(this,"scaleStart",void 0),g(this,"scaleEnd",void 0),g(this,"maxDistance",void 0),g(this,"rotationSpeed",void 0),g(this,"hidden",!1),this.view=new n.a,this.halo=a.a.library.getEntity("powBoost",{map:"effects-tex",opacity:.9,blendMode:1}),this.view.addChild(this.halo),this.view.z=-3,this.view.ry=Math.PI,t.addChild(this.view),this.reset()}reset(){this.respawn()}respawn(){this.scaleStart=0,this.scaleEnd=1,this.maxDistance=500,this.rotationSpeed=-.03,this.hidden=!1,this.view.scale.set(1),this.halo.scale.set(1)}update(t){const e=t.frameTime;this.hidden||(this.updateHaloScale(),this.updateViewScale(),this.rotationSpeed&&(this.halo.rotation.z+=e*this.rotationSpeed))}updateHaloScale(){const t=this.entity.game.stats.z+20-this.entity.body.z,e=1.5+.5*Math.sin(.03*t);this.halo.scale.set(e)}updateViewScale(){const t=this.entity.game.stats.z-10-this.entity.body.z,e=1-m.a.clamp(t/this.maxDistance),i=f.a.backOut(e),n=this.scaleStart+(this.scaleEnd-this.scaleStart)*i;this.view.scale.set(n)}hide(){this.hidden=!0,this.view.scale.set(1e-5),this.halo.scale.set(1e-5)}}var y=i(14);function v(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Pickup_Pickup extends y.a{constructor(){super(),v(this,"type",""),this.add(l.a,{ghost:!0}),this.add(d.a),this.add(Halo_Halo,{type:"rays"}),this.add(u.a,{sneakersOnly:!0}),this.body.width=12,this.body.height=12,this.body.depth=12}awake(){this.model&&this.addChild(this.model)}onCollect(){this.halo&&this.halo.hide();!!this.game.hero[this.type]&&(this.game.hero[this.type].turnOn(),this.game.missions.addStat(1,"mission-pickup-powerups"),this.game.onPickupPowerup.dispatch(this.type)),"letter"===this.type&&Object(h.m)(),"key"===this.type&&(this.game.stats.keys+=1,this.game.missions.addStat(1,"mission-pickup-keys")),"jetpack"!==this.type&&this.game.sfx.play("pickup-powerup"),this.game.hero.popPickup&&this.game.hero.popPickup.play()}static hasNecessaryResources(){return a.a.library.hasGeometry("powerups_superSneakers")}static match(t){return!!t.name.match(/PickupSpawn/)}static factory(t,e,i){var n,r,a,u;if(t.envTube)return;let l=null;const c=t.z-e.components.Transform.position.z,d=(null===(n=e.components)||void 0===n||null===(r=n.PickupSpawnPoint)||void 0===r?void 0:r.__spawnPointMode)||"",p=(null===(a=e.components)||void 0===a||null===(u=a.PickupSpawnPoint)||void 0===u?void 0:u.__forceSpawnPickupType)||"",f=t.game.pickup.getNextPickup();if(!Object(h.h)()&&f!==Pickup_PickupLetter)return;if(f)l=f;else if("WillForcePickupType"===d)l=_[p];else{if(!t.game.route.canSpawn("pickup",c))return;const e=s.a.item(x);l=b[e]}if(o.a.forcePickup&&b[o.a.forcePickup]&&(l=b[o.a.forcePickup]),!l)return;if(l===Pickup_PickupJetpack&&!t.game.route.canSpawn("jetpack",c))return;if(l===Pickup_PickupMysteryBox&&!t.game.route.canSpawn("mysteryBox",c))return;const m=t.game.pool.get(l),g=e.components.Transform.position.x,y=e.components.Transform.position.y;m.body.z=c,m.body.x=null!==i.offsetX?i.offsetX:g,m.body.y=y,m.removableOnCrash=y>2,i.flip&&(m.body.x*=-1),m.awake(),t.game.addChild(m),t.game.route.setSpawn("pickup",c-1800),l===Pickup_PickupJetpack&&t.game.route.setSpawn("jetpack",c-2700),l===Pickup_PickupMysteryBox&&t.game.route.setSpawn("mysteryBox",c-9999)}static spawnRandomType(t,e){const i=e||Object.keys(b),n=s.a.pick(...i),r=b[n],o=t.pool.get(r,{});return o.awake(),t.addChild(o),o}static spawn(t,e){const i=b[e],n=t.pool.get(i,{});return n.awake(),t.addChild(n),n}static prepopulate(){a.a.game.pool.prepopulate(Pickup_PickupJetpack,2),a.a.game.pool.prepopulate(Pickup_PickupPogo,2),a.a.game.pool.prepopulate(Pickup_PickupMagnet,2),a.a.game.pool.prepopulate(Pickup_PickupSneakers,2)}}class Pickup_PickupJetpack extends Pickup_Pickup{constructor(){super(),this.add(p.a,{rotationSpeed:-.03}),this.type="jetpack",this.model=a.a.library.getEntity("powerups_jetpack",{map:"props-tex"}),this.model.scale.set(1.5)}}class Pickup_PickupPogo extends Pickup_Pickup{constructor(){super(),this.add(p.a,{rotationSpeed:-.03}),this.type="pogo",this.model=a.a.library.getEntity("powerups_rocketPogo",{map:"props-tex"}),this.model.scale.set(1.75)}}class Pickup_PickupMagnet extends Pickup_Pickup{constructor(){super(),this.add(p.a,{rotationSpeed:-.03}),this.type="magnet",this.model=a.a.library.getEntity("powerups_coinMagnet",{map:"props-tex"}),this.model.scale.set(1.5)}}class Pickup_PickupSneakers extends Pickup_Pickup{constructor(){super(),this.add(p.a,{rotationSpeed:-.03}),this.type="sneakers",this.model=a.a.library.getEntity("powerups_superSneakers",{map:"props-tex"}),this.model.scale.set(1.5)}}class Pickup_PickupMultiplier extends Pickup_Pickup{constructor(){super(),this.add(p.a,{rotationSpeed:-.03}),this.type="multiplier",this.model=a.a.library.getEntity("powerups_2xMultiplier",{map:"props-tex"}),this.model.scale.set(1.5)}}class Pickup_PickupLetter extends Pickup_Pickup{constructor(){super(),v(this,"letter",""),v(this,"letterModel",void 0),this.add(Bouncing_Bouncing),this.type="letter",this.model=new n.a,h.i.add(()=>{this.game.removeChild(this)})}awake(){var t;if(!this.model)return;const e=null===(t=Object(h.b)())||void 0===t?void 0:t.toUpperCase();this.letter!==e&&a.a.library.hasGroup(e)&&(this.letterModel&&this.model.removeChild(this.letterModel),this.letterModel=a.a.library.getEntity(e,{map:"props-tex"}),this.letterModel.rotation.y=Math.PI,this.letterModel.scale.set(1.5),this.letter=e,this.model.addChild(this.letterModel),super.awake())}}class Pickup_PickupMysteryBox extends Pickup_Pickup{constructor(){super(),v(this,"base",void 0),v(this,"lid",void 0),this.add(p.a,{rotationSpeed:-.03}),this.type="mysteryBox",this.model=new n.a,this.base=a.a.library.getEntity("mysteryBox_default",{map:"props-tex"}),this.model.addChild(this.base)}async onCollect(){this.game.stats.setPrizes(Object(r.a)()),this.game.missions.addStat(1,"mission-pickup-mystery"),super.onCollect()}}const b={jetpack:Pickup_PickupJetpack,pogo:Pickup_PickupPogo,magnet:Pickup_PickupMagnet,sneakers:Pickup_PickupSneakers,multiplier:Pickup_PickupMultiplier,key:class Pickup_PickupKey extends Pickup_Pickup{constructor(){super(),this.add(p.a,{rotationSpeed:-.03}),this.type="key",this.model=a.a.library.getEntity("currency_key",{map:"props-tex"}),this.model.scale.set(1.5)}},mysteryBox:Pickup_PickupMysteryBox},_={Jetpack:Pickup_PickupJetpack,PogoStick:Pickup_PickupPogo,CoinMagnet:Pickup_PickupMagnet,SuperSneakers:Pickup_PickupSneakers,CoinMultiplier:Pickup_PickupMultiplier},w={magnet:29,multiplier:29,sneakers:26,mysteryBox:18,jetpack:14,key:2},x=[];for(const t in w){let e=w[t];for(;e--;)x.push(t)}},function(t,e,i){"use strict";function n(t,e,i){return Math.max(e,Math.min(i,t))}i.d(e,"a",(function(){return n}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return Plane}));var n=i(137),r=i(16);class Plane{constructor(t,e){this.normal=void 0!==t?t:new r.a(1,0,0),this.constant=void 0!==e?e:0}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,i){const n=o.subVectors(i,e).cross(a.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this}clone(){return(new Plane).copy(this)}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)}intersectLine(t,e){const i=t.delta(o),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(t.start)?e.copy(t.start):void 0;const r=-(t.start.dot(this.normal)+this.constant)/n;return r<0||r>1?void 0:e.copy(i).multiplyScalar(r).add(t.start)}intersectsLine(t){const e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const i=e||s.getNormalMatrix(t),n=this.coplanarPoint(o).applyMatrix4(t),r=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}}const o=new r.a,a=new r.a,s=new n.a},,function(t,e,i){var n=i(48);t.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t,e,i){var n=i(70),r=i(197),o=i(79),a=i(163),s=Object.defineProperty;e.f=n?s:function(t,e,i){if(o(t),e=a(e),o(i),r)try{return s(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(t[e]=i.value),t}},function(t,e,i){var n=i(92),r=Math.min;t.exports=function(t){return t>0?r(n(t),9007199254740991):0}},function(t,e,i){var n=i(70),r=i(71),o=i(130);t.exports=n?function(t,e,i){return r.f(t,e,o(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Quaternion}));var n=i(67),r=i(16);class Quaternion{constructor(t,e,i,n){this.x=t||0,this.y=e||0,this.z=i||0,this.w=void 0!==n?n:1}static slerp(t,e,i,n){return i.copy(t).slerp(e,n)}static slerpFlat(t,e,i,n,r,o,a){let s=i[n+0],h=i[n+1],u=i[n+2],l=i[n+3];const c=r[o+0],d=r[o+1],p=r[o+2],f=r[o+3];if(l!==f||s!==c||h!==d||u!==p){let t=1-a;const e=s*c+h*d+u*p+l*f,i=e>=0?1:-1,n=1-e*e;if(n>Number.EPSILON){const r=Math.sqrt(n),o=Math.atan2(r,e*i);t=Math.sin(t*o)/r,a=Math.sin(a*o)/r}const r=a*i;if(s=s*t+c*r,h=h*t+d*r,u=u*t+p*r,l=l*t+f*r,t===1-a){const t=1/Math.sqrt(s*s+h*h+u*u+l*l);s*=t,h*=t,u*=t,l*=t}}t[e]=s,t[e+1]=h,t[e+2]=u,t[e+3]=l}set(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this}clone(){return new Quaternion(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}setFromEuler(t){const e=t.x,i=t.y,n=t.z,r=t.order,o=Math.cos,a=Math.sin,s=o(e/2),h=o(i/2),u=o(n/2),l=a(e/2),c=a(i/2),d=a(n/2);return"XYZ"===r?(this.x=l*h*u+s*c*d,this.y=s*c*u-l*h*d,this.z=s*h*d+l*c*u,this.w=s*h*u-l*c*d):"YXZ"===r?(this.x=l*h*u+s*c*d,this.y=s*c*u-l*h*d,this.z=s*h*d-l*c*u,this.w=s*h*u+l*c*d):"ZXY"===r?(this.x=l*h*u-s*c*d,this.y=s*c*u+l*h*d,this.z=s*h*d+l*c*u,this.w=s*h*u-l*c*d):"ZYX"===r?(this.x=l*h*u-s*c*d,this.y=s*c*u+l*h*d,this.z=s*h*d-l*c*u,this.w=s*h*u+l*c*d):"YZX"===r?(this.x=l*h*u+s*c*d,this.y=s*c*u+l*h*d,this.z=s*h*d-l*c*u,this.w=s*h*u-l*c*d):"XZY"===r&&(this.x=l*h*u-s*c*d,this.y=s*c*u-l*h*d,this.z=s*h*d+l*c*u,this.w=s*h*u+l*c*d),this}setFromAxisAngle(t,e){const i=e/2,n=Math.sin(i);return this.x=t.x*n,this.y=t.y*n,this.z=t.z*n,this.w=Math.cos(i),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],n=e[4],r=e[8],o=e[1],a=e[5],s=e[9],h=e[2],u=e[6],l=e[10],c=i+a+l;let d;return c>0?(d=.5/Math.sqrt(c+1),this.w=.25/d,this.x=(u-s)*d,this.y=(r-h)*d,this.z=(o-n)*d):i>a&&i>l?(d=2*Math.sqrt(1+i-a-l),this.w=(u-s)/d,this.x=.25*d,this.y=(n+o)/d,this.z=(r+h)/d):a>l?(d=2*Math.sqrt(1+a-i-l),this.w=(r-h)/d,this.x=(n+o)/d,this.y=.25*d,this.z=(s+u)/d):(d=2*Math.sqrt(1+l-i-a),this.w=(o-n)/d,this.x=(r+h)/d,this.y=(s+u)/d,this.z=.25*d),this}setFromUnitVectors(t,e){let i;o||(o=new r.a);return i=t.dot(e)+1,i<1e-6?(i=0,Math.abs(t.x)>Math.abs(t.z)?o.set(-t.y,t.x,0):o.set(0,-t.z,t.y)):o.crossVectors(t,e),this.x=o.x,this.y=o.y,this.z=o.z,this.w=i,this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Object(n.a)(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(0===i)return this;const n=Math.min(1,e/i);return this.slerp(t,n),this}inverse(){return this.conjugate()}conjugate(){return this.x*=-1,this.y*=-1,this.z*=-1,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}normalize(){let t=this.length();return 0===t?(this.x=0,this.y=0,this.z=0,this.w=1):(t=1/t,this.x=this.x*t,this.y=this.y*t,this.z=this.z*t,this.w=this.w*t),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const i=t.x,n=t.y,r=t.z,o=t.w,a=e.x,s=e.y,h=e.z,u=e.w;return this.x=i*u+o*a+n*h-r*s,this.y=n*u+o*s+r*a-i*h,this.z=r*u+o*h+i*s-n*a,this.w=o*u-i*a-n*s-r*h,this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const i=this.x,n=this.y,r=this.z,o=this.w;let a=o*t.w+i*t.x+n*t.y+r*t.z;if(a<0?(this.w=-t.w,this.x=-t.x,this.y=-t.y,this.z=-t.z,a=-a):this.copy(t),a>=1)return this.w=o,this.x=i,this.y=n,this.z=r,this;const s=1-a*a;if(s<=Number.EPSILON){const t=1-e;return this.w=t*o+e*this.w,this.x=t*i+e*this.x,this.y=t*n+e*this.y,this.z=t*r+e*this.z,this.normalize()}const h=Math.sqrt(s),u=Math.atan2(h,a),l=Math.sin((1-e)*u)/h,c=Math.sin(e*u)/h;return this.w=o*l+this.w*c,this.x=i*l+this.x*c,this.y=n*l+this.y*c,this.z=r*l+this.z*c,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}}let o=null},function(t,e,i){"use strict";i.d(e,"a",(function(){return View3DComponent_View3DComponent}));var n=i(0),r=i(137),o=i(85),a=i(183),s=i(39),h=i(109),u=i(16),l=i(141);n.State.prototype.onBlendChange=new s.a("onBlendChange",1),Object.defineProperty(n.State.prototype,"blend",{set(t){!!(1&this.data)!==t&&(this.data^=1,this.onBlendChange.run())}});class View3DComponent_View3DComponent{constructor(t,e){if(this.entity=t,this.data=e,this.zdist=0,this.draw=void 0===e.draw?n.DRAW_MODES.TRIANGLES:e.draw,this._geometry=e.geometry,this._material=e.material,this._state=e.state,this.renderCustom=e.renderCustom,this._cachedNormal=new r.a,this.transformDirty=-1,this.orderBias=e.orderBias||0,!this._state){const t=new n.State;t.depthTest=!0,t.culling=!0,t.blend=!1,t.clockwiseFrontFace=!0,this._state=t}this._state.onBlendChange.add(this),this.renderable=!0,this.group=[],this.instanced=!1,this._layer=null,this.id=null,this.onChange=h.a,this.tick=-1,this._dirtyBoundsId=-1,this.boundingSphere=new a.a,this.boundingBox=new o.a,this.frustumCull=void 0===e.frustumCull||e.frustumCull,this.layerId=e.layerId||"default",this.shadowMaterial=e.shadowMaterial}getBoundingSphere(){const t=this.entity.transform,e=this.boundingSphere;if(this._dirtyBoundsId!==t.worldID){const i=this._geometry;i.boundingBox||this._addGeometryBounds(i),e.copy(i.boundingSphere||this._generateBounds(i)),e.applyMatrix4(t.worldTransform),this._dirtyBoundsId=t.worldID}return e}getFaces(){let t=this.geometry.faces;return t||(t=function(t){const e=t.castToBaseGeometry(),i=e.getBuffer("aPosition").data,r=e.getIndex().data;let o,a;t instanceof n.Geometry?(o=0,a=r.length):(o=t.start,a=t.size);const s={};for(let t=0;t<a;t++){const e=r[t+o],n=3*e;s[e]=new u.a(i[n],i[n+1],i[n+2])}const h=[];let l,c,d,p,f,m;for(let t=0;t<a;t+=3){l=r[t+o],c=r[t+1+o],d=r[t+2+o],p=s[l],f=s[c],m=s[d];const e={indices:[l,c,d],vertices:[p,f,m]};h.push(e)}return t.faces=h,h}(this.geometry)),t}onBlendChange(){this._layer&&this._layer._onChange(this.entity)}_addGeometryBounds(t){const e=function(t){const e=t.castToBaseGeometry(),i=e.getBuffer("aPosition").data,n=e.getAttribute("aUv")&&e.getBuffer("aUv")===e.getBuffer("aPosition"),r=n?8:3;let a=n?2:0,s=i.length/r;t instanceof l.a&&(a+=t.attribStart*r,s=t.attribSize);let h=1/0,c=-1/0,d=1/0,p=-1/0,f=1/0,m=-1/0;for(let t=0;t<s*r;t+=r){const e=i[t+a],n=i[t+a+1],r=i[t+a+2];e<h?h=e:e>c&&(c=e),n<d?d=n:n>p&&(p=n),r<f?f=r:r>m&&(m=r)}return new o.a(new u.a(h,d,f),new u.a(c,p,m))}(t);t.boundingBox=e,t.boundingSphere=e.getBoundingSphere(new a.a)}_generateBounds(t){}set state(t){this._state!==t&&(this._state.onBlendChange.remove(this),this._state=t,this._state.onBlendChange.add(this))}get state(){return this._state}set material(t){this._material!==t&&(this._material=t,this._layer&&this._layer._onChange(this.entity))}get material(){return this._material}set geometry(t){this._geometry!==t&&(this._geometry=t,this._dirtyBoundsId=-1,this._layer&&this._layer._onChange(this.entity))}get geometry(){return this._geometry}set layer(t){this._layer=t}get layer(){let t=this._layer;return t||(t=this.entity.scene.view3d.layers.getLayer(this.layerId)),t}}View3DComponent_View3DComponent.DEFAULT_NAME="view3d"},function(t,e,i){"use strict";i.d(e,"a",(function(){return o})),i.d(e,"b",(function(){return s})),i.d(e,"c",(function(){return a}));var n=i(12),r=i(3),o=function(){function t(t,e,i){this.name=t,this.instanceFactory=e,this.type=i,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}return t.prototype.setInstantiationMode=function(t){return this.instantiationMode=t,this},t.prototype.setMultipleInstances=function(t){return this.multipleInstances=t,this},t.prototype.setServiceProps=function(t){return this.serviceProps=t,this},t.prototype.setInstanceCreatedCallback=function(t){return this.onInstanceCreated=t,this},t}(),a=function(){function t(t,e){this.name=t,this.container=e,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.onInitCallbacks=new Map}return t.prototype.get=function(t){var e=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(e)){var i=new r.a;if(this.instancesDeferred.set(e,i),this.isInitialized(e)||this.shouldAutoInitialize())try{var n=this.getOrInitializeService({instanceIdentifier:e});n&&i.resolve(n)}catch(t){}}return this.instancesDeferred.get(e).promise},t.prototype.getImmediate=function(t){var e,i=this.normalizeInstanceIdentifier(null==t?void 0:t.identifier),n=null!==(e=null==t?void 0:t.optional)&&void 0!==e&&e;if(!this.isInitialized(i)&&!this.shouldAutoInitialize()){if(n)return null;throw Error("Service "+this.name+" is not available")}try{return this.getOrInitializeService({instanceIdentifier:i})}catch(t){if(n)return null;throw t}},t.prototype.getComponent=function(){return this.component},t.prototype.setComponent=function(t){var e,i;if(t.name!==this.name)throw Error("Mismatching Component "+t.name+" for Provider "+this.name+".");if(this.component)throw Error("Component for "+this.name+" has already been provided");if(this.component=t,this.shouldAutoInitialize()){if(function(t){return"EAGER"===t.instantiationMode}(t))try{this.getOrInitializeService({instanceIdentifier:"[DEFAULT]"})}catch(t){}try{for(var r=Object(n.g)(this.instancesDeferred.entries()),o=r.next();!o.done;o=r.next()){var a=Object(n.e)(o.value,2),s=a[0],h=a[1],u=this.normalizeInstanceIdentifier(s);try{var l=this.getOrInitializeService({instanceIdentifier:u});h.resolve(l)}catch(t){}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}}},t.prototype.clearInstance=function(t){void 0===t&&(t="[DEFAULT]"),this.instancesDeferred.delete(t),this.instances.delete(t)},t.prototype.delete=function(){return Object(n.b)(this,void 0,void 0,(function(){var t;return Object(n.d)(this,(function(e){switch(e.label){case 0:return t=Array.from(this.instances.values()),[4,Promise.all(Object(n.f)(Object(n.f)([],Object(n.e)(t.filter((function(t){return"INTERNAL"in t})).map((function(t){return t.INTERNAL.delete()})))),Object(n.e)(t.filter((function(t){return"_delete"in t})).map((function(t){return t._delete()})))))];case 1:return e.sent(),[2]}}))}))},t.prototype.isComponentSet=function(){return null!=this.component},t.prototype.isInitialized=function(t){return void 0===t&&(t="[DEFAULT]"),this.instances.has(t)},t.prototype.initialize=function(t){var e,i;void 0===t&&(t={});var r=t.options,o=void 0===r?{}:r,a=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(a))throw Error(this.name+"("+a+") has already been initialized");if(!this.isComponentSet())throw Error("Component "+this.name+" has not been registered yet");var s=this.getOrInitializeService({instanceIdentifier:a,options:o});try{for(var h=Object(n.g)(this.instancesDeferred.entries()),u=h.next();!u.done;u=h.next()){var l=Object(n.e)(u.value,2),c=l[0],d=l[1];a===this.normalizeInstanceIdentifier(c)&&d.resolve(s)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(i=h.return)&&i.call(h)}finally{if(e)throw e.error}}return s},t.prototype.onInit=function(t,e){var i,n=this.normalizeInstanceIdentifier(e),r=null!==(i=this.onInitCallbacks.get(n))&&void 0!==i?i:new Set;r.add(t),this.onInitCallbacks.set(n,r);var o=this.instances.get(n);return o&&t(o,n),function(){r.delete(t)}},t.prototype.invokeOnInitCallbacks=function(t,e){var i,r,o=this.onInitCallbacks.get(e);if(o)try{for(var a=Object(n.g)(o),s=a.next();!s.done;s=a.next()){var h=s.value;try{h(t,e)}catch(t){}}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}},t.prototype.getOrInitializeService=function(t){var e,i=t.instanceIdentifier,n=t.options,r=void 0===n?{}:n,o=this.instances.get(i);if(!o&&this.component&&(o=this.component.instanceFactory(this.container,{instanceIdentifier:(e=i,"[DEFAULT]"===e?void 0:e),options:r}),this.instances.set(i,o),this.invokeOnInitCallbacks(o,i),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,i,o)}catch(t){}return o||null},t.prototype.normalizeInstanceIdentifier=function(t){return void 0===t&&(t="[DEFAULT]"),this.component?this.component.multipleInstances?t:"[DEFAULT]":t},t.prototype.shouldAutoInitialize=function(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode},t}();var s=function(){function t(t){this.name=t,this.providers=new Map}return t.prototype.addComponent=function(t){var e=this.getProvider(t.name);if(e.isComponentSet())throw new Error("Component "+t.name+" has already been registered with "+this.name);e.setComponent(t)},t.prototype.addOrOverwriteComponent=function(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)},t.prototype.getProvider=function(t){if(this.providers.has(t))return this.providers.get(t);var e=new a(t,this);return this.providers.set(t,e),e},t.prototype.getProviders=function(){return Array.from(this.providers.values())},t}()},function(t,e,i){"use strict";i.d(e,"a",(function(){return Floating}));var n=i(18);function r(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function o(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?r(Object(i),!0).forEach((function(e){a(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function a(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const s={rotationSpeed:.1};let h=1;class Floating extends n.a{constructor(t,e={}){super(t,o(o({},s),e)),a(this,"startingRot",null),a(this,"rotation",0),a(this,"index",null),this.startingRot=null,this.index=null}reset(){this.startingRot=null,this.rotation=0,this.index=h++}update(t){const e=t.frameTime,i=this.entity.game.hero.body.z-this.entity.body.z;this.entity.model&&(null===this.startingRot&&(this.startingRot=.4*h++,this.rotation=this.startingRot),this.rotation-=e*this.data.rotationSpeed,i<600&&(this.entity.model.ry=this.rotation))}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}();function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(e,i,n){void 0===i&&(i=!1),r(this,t),this._fn=e,this._once=i,this._thisArg=n,this._next=this._prev=this._owner=null}return n(t,[{key:"detach",value:function(){return null!==this._owner&&(this._owner.detach(this),!0)}}]),t}();function a(t,e){return t._head?(t._tail._next=e,e._prev=t._tail,t._tail=e):(t._head=e,t._tail=e),e._owner=t,e}var s=function(){function t(){r(this,t),this._head=this._tail=void 0}return n(t,[{key:"handlers",value:function(){var t=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],e=this._head;if(t)return!!e;for(var i=[];e;)i.push(e),e=e._next;return i}},{key:"has",value:function(t){if(!(t instanceof o))throw new Error("MiniSignal#has(): First arg must be a MiniSignalBinding object.");return t._owner===this}},{key:"dispatch",value:function(){var t=this._head;if(!t)return!1;for(;t;)t._once&&this.detach(t),t._fn.apply(t._thisArg,arguments),t=t._next;return!0}},{key:"add",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if("function"!=typeof t)throw new Error("MiniSignal#add(): First arg must be a Function.");return a(this,new o(t,!1,e))}},{key:"once",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if("function"!=typeof t)throw new Error("MiniSignal#once(): First arg must be a Function.");return a(this,new o(t,!0,e))}},{key:"detach",value:function(t){if(!(t instanceof o))throw new Error("MiniSignal#detach(): First arg must be a MiniSignalBinding object.");return t._owner!==this||(t._prev&&(t._prev._next=t._next),t._next&&(t._next._prev=t._prev),t===this._head?(this._head=t._next,null===t._next&&(this._tail=null)):t===this._tail&&(this._tail=t._prev,this._tail._next=null),t._owner=null),this}},{key:"detachAll",value:function(){var t=this._head;if(!t)return this;for(this._head=this._tail=null;t;)t._owner=null,t=t._next;return this}}]),t}();s.MiniSignalBinding=o,e.default=s,t.exports=e.default},function(t,e,i){var n=i(59);t.exports=function(t){if(!n(t))throw TypeError(String(t)+" is not an object");return t}},,function(t,e,i){"use strict";i.d(e,"a",(function(){return Fillers})),i.d(e,"b",(function(){return FillersHigh01Left})),i.d(e,"c",(function(){return FillersHigh01Right}));var n=i(2),r=i(1),o=i(13),a=i(14);function s(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Fillers extends a.a{constructor(t,e={}){super(),s(this,"mounted",!1),s(this,"opts",{}),this.name=t,this.opts=e,this.levelEntity=!0,this.build()}build(){!this.mounted&&n.a.environment&&r.a.library.hasGeometry(this.name)&&(this.mounted=!0,r.a.library.mountEntity(this,this.name,this.opts))}static hasResourcesForAllFillers(){return r.a.library.hasGroup("low_01_left")}static spawn(t,e={}){e.z||(e.z=t.z),e.l||(e.l=FillersLow01Left),e.r||(e.r=FillersLow01Right),Fillers.hasResourcesForAllFillers()||(e.l=FillersMed02Left,e.r=FillersMed02Right);const i=t.game.pool.get(e.l);t.fillerList.push(i),t.game.addChild(i),i.x=0,i.y=0,i.z=e.z,i.ry=Math.PI,i.build();const n=t.game.pool.get(e.r);t.fillerList.push(n),t.game.addChild(n),n.x=0,n.y=0,n.z=e.z,n.ry=Math.PI,n.build()}static mount(t){if(t.name.match("default_short_1_track")){const e=t.blocks/2;for(let i=0;i<e;i++){if(t.fillerSlots[i])continue;const e=t.z-i*n.a.blockSize*2,r=FillersMed02Left,o=FillersMed02Right;Fillers.spawn(t,{z:e,l:r,r:o})}}else if(t.name.match("default_short_2_tracks")){const e=t.blocks/2;for(let i=0;i<e;i++){if(t.fillerSlots[i])continue;const e=t.z-i*n.a.blockSize*2,r=FillersLow02Left,o=FillersHigh02Right;Fillers.spawn(t,{z:e,l:r,r:o})}}else if(t.name.match("default_2_tracks")){const e=t.blocks/2;for(let i=0;i<e;i++){if(t.fillerSlots[i])continue;const e=t.z-i*n.a.blockSize*2,r=FillersLow01Left,o=FillersHigh01Right;Fillers.spawn(t,{z:e,l:r,r:o})}}else if(t.name.match("intro")){const e=t.blocks/2;for(let i=0;i<e;i++){if(t.fillerSlots[i])continue;const e=t.z-i*n.a.blockSize*2+90,r=FillersMed02Left,o=FillersMed02Right;Fillers.spawn(t,{z:e,l:r,r:o})}}else{const e=t.blocks/2,i=["Low","Med","High"],r=o.a.item(i),a="Low"===r?["01","02"]:["01","02","03"];for(let i=0;i<e;i++){if(t.fillerSlots[i])continue;const e=o.a.item(a),s=h["Fillers"+r+e+"Left"],u=h["Fillers"+r+e+"Right"],l=t.z-i*n.a.blockSize*2;Fillers.spawn(t,{z:l,l:s,r:u}),"Low"===r&&"1103-seoul"===n.a.theme&&Fillers.hasResourcesForAllFillers()&&(t.floorSlots[i]=!0)}}}static prepopulate(){r.a.game.pool.prepopulate(FillersLow01Left,8),r.a.game.pool.prepopulate(FillersLow02Left,8),r.a.game.pool.prepopulate(FillersMed01Left,8),r.a.game.pool.prepopulate(FillersMed02Left,8),r.a.game.pool.prepopulate(FillersMed03Left,8),r.a.game.pool.prepopulate(FillersHigh01Left,8),r.a.game.pool.prepopulate(FillersHigh02Left,8),r.a.game.pool.prepopulate(FillersHigh03Left,8),r.a.game.pool.prepopulate(FillersLow01Right,8),r.a.game.pool.prepopulate(FillersLow02Right,8),r.a.game.pool.prepopulate(FillersMed01Right,8),r.a.game.pool.prepopulate(FillersMed02Right,8),r.a.game.pool.prepopulate(FillersMed03Right,8),r.a.game.pool.prepopulate(FillersHigh01Right,8),r.a.game.pool.prepopulate(FillersHigh02Right,8),r.a.game.pool.prepopulate(FillersHigh03Right,8)}}class FillersLow01Left extends Fillers{constructor(){super("low_01_left")}}class FillersLow02Left extends Fillers{constructor(){super("low_02_left")}}class FillersMed01Left extends Fillers{constructor(){super("med_01_left")}}class FillersMed02Left extends Fillers{constructor(){super("med_02_left")}}class FillersMed03Left extends Fillers{constructor(){super("med_03_left")}}class FillersHigh01Left extends Fillers{constructor(){super("high_01_left")}}class FillersHigh02Left extends Fillers{constructor(){super("high_02_left")}}class FillersHigh03Left extends Fillers{constructor(){super("high_03_left")}}class FillersLow01Right extends Fillers{constructor(){super("low_01_right",{rails:!0})}}class FillersLow02Right extends Fillers{constructor(){super("low_02_right",{rails:!0})}}class FillersMed01Right extends Fillers{constructor(){super("med_01_right")}}class FillersMed02Right extends Fillers{constructor(){super("med_02_right")}}class FillersMed03Right extends Fillers{constructor(){super("med_03_right")}}class FillersHigh01Right extends Fillers{constructor(){super("high_01_right")}}class FillersHigh02Right extends Fillers{constructor(){super("high_02_right")}}class FillersHigh03Right extends Fillers{constructor(){super("high_03_right")}}const h={FillersLow01Left:FillersLow01Left,FillersLow02Left:FillersLow02Left,FillersMed01Left:FillersMed01Left,FillersMed02Left:FillersMed02Left,FillersMed03Left:FillersMed03Left,FillersHigh01Left:FillersHigh01Left,FillersHigh02Left:FillersHigh02Left,FillersHigh03Left:FillersHigh03Left,FillersLow01Right:FillersLow01Right,FillersLow02Right:FillersLow02Right,FillersMed01Right:FillersMed01Right,FillersMed02Right:FillersMed02Right,FillersMed03Right:FillersMed03Right,FillersHigh01Right:FillersHigh01Right,FillersHigh02Right:FillersHigh02Right,FillersHigh03Right:FillersHigh03Right}},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var n in i)r(i,n)&&(t[n]=i[n])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var o={arraySet:function(t,e,i,n,r){if(e.subarray&&t.subarray)t.set(e.subarray(i,i+n),r);else for(var o=0;o<n;o++)t[r+o]=e[i+o]},flattenChunks:function(t){var e,i,n,r,o,a;for(n=0,e=0,i=t.length;e<i;e++)n+=t[e].length;for(a=new Uint8Array(n),r=0,e=0,i=t.length;e<i;e++)o=t[e],a.set(o,r),r+=o.length;return a}},a={arraySet:function(t,e,i,n,r){for(var o=0;o<n;o++)t[r+o]=e[i+o]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,o)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,a))},e.setTyped(n)},function(t,e,i){"use strict";i.d(e,"a",(function(){return Geometry3D}));var n=i(0);class Geometry3D extends n.Geometry{castToBaseGeometry(){return this}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Box3}));var n=i(16);class Box3{constructor(t,e){this.isBox3=!0,this.min=void 0!==t?t:new n.a(1/0,1/0,1/0),this.max=void 0!==e?e:new n.a(-1/0,-1/0,-1/0)}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=Number(1/0),i=Number(1/0),n=Number(1/0),r=-1/0,o=-1/0,a=-1/0;for(let s=0,h=t.length;s<h;s+=3){const h=t[s],u=t[s+1],l=t[s+2];h<e&&(e=h),u<i&&(i=u),l<n&&(n=l),h>r&&(r=h),u>o&&(o=u),l>a&&(a=l)}return this.min.set(e,i,n),this.max.set(r,o,a),this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=r.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}clone(){return(new Box3).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=Number(1/0),this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandBySphere(t){const{center:e,radius:i}=t;return r.x=e.x-i,r.y=e.y-i,r.z=e.z-i,this.min.min(r),r.x=e.x+i,r.y=e.y+i,r.z=e.z+i,this.max.max(r),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(){return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){const e=new n.a;return this.clampPoint(t.center,e),e.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return r.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=.5*this.getSize(r).length(),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(o[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),o[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),o[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),o[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),o[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),o[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),o[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),o[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(o)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const r=new n.a,o=[new n.a,new n.a,new n.a,new n.a,new n.a,new n.a,new n.a,new n.a]},,,function(t,e,i){"use strict";i.d(e,"a",(function(){return Group}));var n=i(37);class Group{constructor(t=[]){this.onAdded=new n.Signal,this.onRemoved=new n.Signal,this.children=t}add(t){-1===this.children.indexOf(t)&&(this.children.push(t),this.onAdded.emit(t))}remove(t){const e=this.children.indexOf(t);return-1!==e&&(this.children.splice(e,1),this.onRemoved.emit(t),!0)}contains(t){return-1!==this.children.indexOf(t)}getIndex(t){return this.children.indexOf(t)}getItem(t){return this.children[t]}run(t,e){let i;if(e)for(i=0;i<this.children.length;i++)t.call(e,this.children[i]);else for(i=0;i<this.children.length;i++)t(this.children[i])}empty(){this.children.length=0,this.onAdded.disconnectAll(),this.onRemoved.disconnectAll()}get length(){return this.children.length}}},function(t,e,i){"use strict";var n,r=this&&this.__extends||(n=function(t,e){return(n=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(t,e){function i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e,i){void 0===t&&(t=null),void 0===e&&(e=null),void 0===i&&(i=0),this.enabled=!0,this.newLink=!1,this.callback=null,this.prev=t||this,this.next=e||this,this.order=i}return t.prototype.isEnabled=function(){return this.enabled&&!this.newLink},t.prototype.setEnabled=function(t){this.enabled=t},t.prototype.unlink=function(){this.callback=null,this.next.prev=this.prev,this.prev.next=this.next},t.prototype.insert=function(e,i){for(var n=this.prev;n!==this&&!(n.order<=i);)n=n.prev;var r=new t(n,n.next,i);return r.callback=e,n.next=r,r.next.prev=r,r},t}(),a=function(){function t(t,e){this.link=e}return t.prototype.disconnect=function(){return null!==this.link&&(this.link.unlink(),this.link=null,!0)},Object.defineProperty(t.prototype,"enabled",{get:function(){return null!==this.link&&this.link.isEnabled()},set:function(t){this.link&&this.link.setEnabled(t)},enumerable:!0,configurable:!0}),t}(),s=function(){function t(){this.list=[]}return t.prototype.add=function(t){this.list.push(t)},t.prototype.disconnectAll=function(){for(var t=0,e=this.list;t<e.length;t++){e[t].disconnect()}this.list=[]},t}();e.SignalConnections=s;var h=function(){function t(){this.head=new o,this.hasNewLinks=!1,this.emitDepth=0,this.emit=this.emitInternal.bind(this)}return t.prototype.connect=function(t,e){void 0===e&&(e=0);var i=this.head.insert(t,e);return this.emitDepth>0&&(this.hasNewLinks=!0,i.newLink=!0),new a(this.head,i)},t.prototype.disconnect=function(t){for(var e=this.head.next;e!==this.head;e=e.next)if(e.callback===t)return e.unlink(),!0;return!1},t.prototype.disconnectAll=function(){for(;this.head.next!==this.head;)this.head.next.unlink()},t.prototype.emitInternal=function(){this.emitDepth++;for(var t=this.head.next;t!==this.head;t=t.next)t.isEnabled()&&t.callback&&t.callback.apply(null,arguments);this.emitDepth--,this.unsetNewLink()},t.prototype.emitCollecting=function(t,e){this.emitDepth++;for(var i=this.head.next;i!==this.head;i=i.next)if(i.isEnabled()&&i.callback){var n=i.callback.apply(null,e);if(!t.handleResult(n))break}this.emitDepth--,this.unsetNewLink()},t.prototype.unsetNewLink=function(){if(this.hasNewLinks&&0==this.emitDepth){for(var t=this.head.next;t!==this.head;t=t.next)t.newLink=!1;this.hasNewLinks=!1}},t}();e.Signal=h;var u=function(t){var e=this;this.emit=function(){t.emitCollecting(e,arguments)}};e.Collector=u;var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.handleResult=function(t){return this.result=t,!0},e.prototype.getResult=function(){return this.result},e.prototype.reset=function(){delete this.result},e}(u);e.CollectorLast=l;var c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.result=!1,e}return r(e,t),e.prototype.handleResult=function(t){return this.result=t,!!this.result},e.prototype.getResult=function(){return this.result},e.prototype.reset=function(){this.result=!1},e}(u);e.CollectorUntil0=c;var d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.result=!1,e}return r(e,t),e.prototype.handleResult=function(t){return this.result=t,!this.result},e.prototype.getResult=function(){return this.result},e.prototype.reset=function(){this.result=!1},e}(u);e.CollectorWhile0=d;var p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.result=[],e}return r(e,t),e.prototype.handleResult=function(t){return this.result.push(t),!0},e.prototype.getResult=function(){return this.result},e.prototype.reset=function(){this.result.length=0},e}(u);e.CollectorArray=p},,,function(t,e){var i=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:i)(t)}},function(t,e,i){"use strict";var n=i(101),r=i(45),o=i(70),a=i(357),s=i(133),h=i(205),u=i(207),l=i(130),c=i(73),d=i(360),p=i(72),f=i(208),m=i(361),g=i(163),y=i(58),v=i(174),b=i(59),_=i(129),w=i(128),x=i(117),C=i(169).f,S=i(363),T=i(366).forEach,A=i(370),E=i(71),P=i(168),M=i(115),I=i(371),k=M.get,O=M.set,R=E.f,D=P.f,L=Math.round,N=r.RangeError,B=h.ArrayBuffer,F=h.DataView,z=s.NATIVE_ARRAY_BUFFER_VIEWS,j=s.TYPED_ARRAY_CONSTRUCTOR,G=s.TYPED_ARRAY_TAG,U=s.TypedArray,H=s.TypedArrayPrototype,V=s.aTypedArrayConstructor,W=s.isTypedArray,X=function(t,e){for(var i=0,n=e.length,r=new(V(t))(n);n>i;)r[i]=e[i++];return r},Y=function(t,e){R(t,e,{get:function(){return k(this)[e]}})},q=function(t){var e;return t instanceof B||"ArrayBuffer"==(e=v(t))||"SharedArrayBuffer"==e},K=function(t,e){return W(t)&&!_(e)&&e in t&&d(+e)&&e>=0},J=function(t,e){return e=g(e),K(t,e)?l(2,t[e]):D(t,e)},Z=function(t,e,i){return e=g(e),!(K(t,e)&&b(i)&&y(i,"value"))||y(i,"get")||y(i,"set")||i.configurable||y(i,"writable")&&!i.writable||y(i,"enumerable")&&!i.enumerable?R(t,e,i):(t[e]=i.value,t)};o?(z||(P.f=J,E.f=Z,Y(H,"buffer"),Y(H,"byteOffset"),Y(H,"byteLength"),Y(H,"length")),n({target:"Object",stat:!0,forced:!z},{getOwnPropertyDescriptor:J,defineProperty:Z}),t.exports=function(t,e,i){var o=t.match(/\d+$/)[0]/8,s=t+(i?"Clamped":"")+"Array",h="get"+t,l="set"+t,d=r[s],g=d,y=g&&g.prototype,v={},_=function(t,e){R(t,e,{get:function(){return function(t,e){var i=k(t);return i.view[h](e*o+i.byteOffset,!0)}(this,e)},set:function(t){return function(t,e,n){var r=k(t);i&&(n=(n=L(n))<0?0:n>255?255:255&n),r.view[l](e*o+r.byteOffset,n,!0)}(this,e,t)},enumerable:!0})};z?a&&(g=e((function(t,e,i,n){return u(t,g,s),I(b(e)?q(e)?void 0!==n?new d(e,m(i,o),n):void 0!==i?new d(e,m(i,o)):new d(e):W(e)?X(g,e):S.call(g,e):new d(f(e)),t,g)})),x&&x(g,U),T(C(d),(function(t){t in g||c(g,t,d[t])})),g.prototype=y):(g=e((function(t,e,i,n){u(t,g,s);var r,a,h,l=0,c=0;if(b(e)){if(!q(e))return W(e)?X(g,e):S.call(g,e);r=e,c=m(i,o);var d=e.byteLength;if(void 0===n){if(d%o)throw N("Wrong length");if((a=d-c)<0)throw N("Wrong length")}else if((a=p(n)*o)+c>d)throw N("Wrong length");h=a/o}else h=f(e),r=new B(a=h*o);for(O(t,{buffer:r,byteOffset:c,byteLength:a,length:h,view:new F(r)});l<h;)_(t,l++)})),x&&x(g,U),y=g.prototype=w(H)),y.constructor!==g&&c(y,"constructor",g),c(y,j,g),G&&c(y,G,s),v[s]=g,n({global:!0,forced:g!=d,sham:!z},v),"BYTES_PER_ELEMENT"in g||c(g,"BYTES_PER_ELEMENT",o),"BYTES_PER_ELEMENT"in y||c(y,"BYTES_PER_ELEMENT",o),A(s)}):t.exports=function(){}},function(t,e,i){"use strict";var n,r,o=i(12),a=i(3),s=i(76),h=i(96),u=((n={})["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",n["bad-app-name"]="Illegal App name: '{$appName}",n["duplicate-app"]="Firebase App named '{$appName}' already exists",n["app-deleted"]="Firebase App named '{$appName}' already deleted",n["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",n["invalid-log-argument"]="First argument to `onLog` must be null or a function.",n),l=new a.b("app","Firebase",u),c=((r={})["@firebase/app"]="fire-core",r["@firebase/analytics"]="fire-analytics",r["@firebase/app-check"]="fire-app-check",r["@firebase/auth"]="fire-auth",r["@firebase/database"]="fire-rtdb",r["@firebase/functions"]="fire-fn",r["@firebase/installations"]="fire-iid",r["@firebase/messaging"]="fire-fcm",r["@firebase/performance"]="fire-perf",r["@firebase/remote-config"]="fire-rc",r["@firebase/storage"]="fire-gcs",r["@firebase/firestore"]="fire-fst",r["fire-js"]="fire-js",r["firebase-wrapper"]="fire-js-all",r),d=new h.b("@firebase/app"),p=function(){function t(t,e,i){var n=this;this.firebase_=i,this.isDeleted_=!1,this.name_=e.name,this.automaticDataCollectionEnabled_=e.automaticDataCollectionEnabled||!1,this.options_=Object(a.k)(t),this.container=new s.b(e.name),this._addComponent(new s.a("app",(function(){return n}),"PUBLIC")),this.firebase_.INTERNAL.components.forEach((function(t){return n._addComponent(t)}))}return Object.defineProperty(t.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this.automaticDataCollectionEnabled_},set:function(t){this.checkDestroyed_(),this.automaticDataCollectionEnabled_=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!1,configurable:!0}),t.prototype.delete=function(){var t=this;return new Promise((function(e){t.checkDestroyed_(),e()})).then((function(){return t.firebase_.INTERNAL.removeApp(t.name_),Promise.all(t.container.getProviders().map((function(t){return t.delete()})))})).then((function(){t.isDeleted_=!0}))},t.prototype._getService=function(t,e){var i;void 0===e&&(e="[DEFAULT]"),this.checkDestroyed_();var n=this.container.getProvider(t);return n.isInitialized()||"EXPLICIT"!==(null===(i=n.getComponent())||void 0===i?void 0:i.instantiationMode)||n.initialize(),n.getImmediate({identifier:e})},t.prototype._removeServiceInstance=function(t,e){void 0===e&&(e="[DEFAULT]"),this.container.getProvider(t).clearInstance(e)},t.prototype._addComponent=function(t){try{this.container.addComponent(t)}catch(e){d.debug("Component "+t.name+" failed to register with FirebaseApp "+this.name,e)}},t.prototype._addOrOverwriteComponent=function(t){this.container.addOrOverwriteComponent(t)},t.prototype.toJSON=function(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}},t.prototype.checkDestroyed_=function(){if(this.isDeleted_)throw l.create("app-deleted",{appName:this.name_})},t}();p.prototype.name&&p.prototype.options||p.prototype.delete;var f=function t(){var e=function(t){var e={},i=new Map,n={__esModule:!0,initializeApp:function(i,r){void 0===r&&(r={});if("object"!=typeof r||null===r){r={name:r}}var o=r;void 0===o.name&&(o.name="[DEFAULT]");var s=o.name;if("string"!=typeof s||!s)throw l.create("bad-app-name",{appName:String(s)});if(Object(a.h)(e,s))throw l.create("duplicate-app",{appName:s});var h=new t(i,o,n);return e[s]=h,h},app:r,registerVersion:function(t,e,i){var n,r=null!==(n=c[t])&&void 0!==n?n:t;i&&(r+="-"+i);var a=r.match(/\s|\//),h=e.match(/\s|\//);if(a||h){var u=['Unable to register library "'+r+'" with version "'+e+'":'];return a&&u.push('library name "'+r+'" contains illegal characters (whitespace or "/")'),a&&h&&u.push("and"),h&&u.push('version name "'+e+'" contains illegal characters (whitespace or "/")'),void d.warn(u.join(" "))}o(new s.a(r+"-version",(function(){return{library:r,version:e}}),"VERSION"))},setLogLevel:h.c,onLog:function(t,e){if(null!==t&&"function"!=typeof t)throw l.create("invalid-log-argument");Object(h.d)(t,e)},apps:null,SDK_VERSION:"8.8.1",INTERNAL:{registerComponent:o,removeApp:function(t){delete e[t]},components:i,useAsService:function(t,e){if("serverAuth"===e)return null;return e}}};function r(t){if(t=t||"[DEFAULT]",!Object(a.h)(e,t))throw l.create("no-app",{appName:t});return e[t]}function o(o){var s=o.name;if(i.has(s))return d.debug("There were multiple attempts to register component "+s+"."),"PUBLIC"===o.type?n[s]:null;if(i.set(s,o),"PUBLIC"===o.type){var h=function(t){if(void 0===t&&(t=r()),"function"!=typeof t[s])throw l.create("invalid-app-argument",{appName:s});return t[s]()};void 0!==o.serviceProps&&Object(a.l)(h,o.serviceProps),n[s]=h,t.prototype[s]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=this._getService.bind(this,s);return i.apply(this,o.multipleInstances?t:[])}}for(var u=0,c=Object.keys(e);u<c.length;u++){var p=c[u];e[p]._addComponent(o)}return"PUBLIC"===o.type?n[s]:null}return n.default=n,Object.defineProperty(n,"apps",{get:function(){return Object.keys(e).map((function(t){return e[t]}))}}),r.App=t,n}(p);return e.INTERNAL=Object(o.a)(Object(o.a)({},e.INTERNAL),{createFirebaseNamespace:t,extendNamespace:function(t){Object(a.l)(e,t)},createSubscribe:a.j,ErrorFactory:a.b,deepExtend:a.l}),e}(),m=function(){function t(t){this.container=t}return t.prototype.getPlatformInfoString=function(){return this.container.getProviders().map((function(t){if(function(t){var e=t.getComponent();return"VERSION"===(null==e?void 0:e.type)}(t)){var e=t.getImmediate();return e.library+"/"+e.version}return null})).filter((function(t){return t})).join(" ")},t}();if(Object(a.p)()&&void 0!==self.firebase){d.warn("\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n ");var g=self.firebase.SDK_VERSION;g&&g.indexOf("LITE")>=0&&d.warn("\n Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n ")}var y=f.initializeApp;f.initializeApp=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object(a.s)()&&d.warn('\n Warning: This is a browser-targeted Firebase bundle but it appears it is being\n run in a Node environment. If running in a Node environment, make sure you\n are using the bundle specified by the "main" field in package.json.\n \n If you are using Webpack, you can specify "main" as the first item in\n "resolve.mainFields":\n https://webpack.js.org/configuration/resolve/#resolvemainfields\n \n If using Rollup, use the @rollup/plugin-node-resolve plugin and specify "main"\n as the first item in "mainFields", e.g. [\'main\', \'module\'].\n https://github.com/rollup/@rollup/plugin-node-resolve\n '),y.apply(void 0,t)};var v=f;!function(t,e){t.INTERNAL.registerComponent(new s.a("platform-logger",(function(t){return new m(t)}),"PRIVATE")),t.registerVersion("@firebase/app","0.6.29",e),t.registerVersion("fire-js","")}(v),e.a=v},,function(t,e,i){"use strict";function n(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),r=0;for(e=0;e<i;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,r++)n[r]=o[a];return n}var r;i.d(e,"a",(function(){return o})),i.d(e,"b",(function(){return c})),i.d(e,"c",(function(){return d})),i.d(e,"d",(function(){return p}));var o,a=[];!function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"}(o||(o={}));var s={debug:o.DEBUG,verbose:o.VERBOSE,info:o.INFO,warn:o.WARN,error:o.ERROR,silent:o.SILENT},h=o.INFO,u=((r={})[o.DEBUG]="log",r[o.VERBOSE]="log",r[o.INFO]="info",r[o.WARN]="warn",r[o.ERROR]="error",r),l=function(t,e){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];if(!(e<t.logLevel)){(new Date).toISOString();var r=u[e];if(!r)throw new Error("Attempted to log a message with an invalid logType (value: "+e+")")}},c=function(){function t(t){this.name=t,this._logLevel=h,this._logHandler=l,this._userLogHandler=null,a.push(this)}return Object.defineProperty(t.prototype,"logLevel",{get:function(){return this._logLevel},set:function(t){if(!(t in o))throw new TypeError('Invalid value "'+t+'" assigned to `logLevel`');this._logLevel=t},enumerable:!1,configurable:!0}),t.prototype.setLogLevel=function(t){this._logLevel="string"==typeof t?s[t]:t},Object.defineProperty(t.prototype,"logHandler",{get:function(){return this._logHandler},set:function(t){if("function"!=typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(t){this._userLogHandler=t},enumerable:!1,configurable:!0}),t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,n([this,o.DEBUG],t)),this._logHandler.apply(this,n([this,o.DEBUG],t))},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,n([this,o.VERBOSE],t)),this._logHandler.apply(this,n([this,o.VERBOSE],t))},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,n([this,o.INFO],t)),this._logHandler.apply(this,n([this,o.INFO],t))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,n([this,o.WARN],t)),this._logHandler.apply(this,n([this,o.WARN],t))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,n([this,o.ERROR],t)),this._logHandler.apply(this,n([this,o.ERROR],t))},t}();function d(t){a.forEach((function(e){e.setLogLevel(t)}))}function p(t,e){for(var i=function(i){var n=null;e&&e.level&&(n=s[e.level]),i.userLogHandler=null===t?null:function(e,i){for(var r=[],a=2;a<arguments.length;a++)r[a-2]=arguments[a];var s=r.map((function(t){if(null==t)return null;if("string"==typeof t)return t;if("number"==typeof t||"boolean"==typeof t)return t.toString();if(t instanceof Error)return t.message;try{return JSON.stringify(t)}catch(t){return null}})).filter((function(t){return t})).join(" ");i>=(null!=n?n:e.logLevel)&&t({level:o[i].toLowerCase(),message:s,args:r,type:e.name})}},n=0,r=a;n<r.length;n++){i(r[n])}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Epic}));var n=i(477),r=i(32),o=i(0),a=i(2),s=i(44),h=i(90),u=i(1),l=i(41),c=i(14);class Epic extends c.a{static hasNecessaryResources(){return u.a.library.hasGeometry("epic_start")}static createWater(t){const e=new n.a(1500,360,20,20),i=new h.a({map:u.a.library.getMap("ocean")}),o=new r.a({geometry:e,material:i});o.rx=.5*-Math.PI,o.y=-70,o.z=180,t.addChild(o)}static spawn(t,e,i={}){i.z||(i.z=t.z),i.alt||(i.alt=!1),i.part||(i.part="Start"),["189-mumbai","198-atlanta","1103-seoul","1103-seoul","177-singapore"].includes(a.a.theme)&&(i.alt=!1);const n="Epic"+i.part+(i.alt?"Alt":""),r=t.game.pool.get(p[n]);return r.x=0,r.y=0,r.z=i.z,r.ry=Math.PI,t.game.addChild(r),r}static mount(t){const e=t.blocks,i=t.blocks>12,n=.25*e;let r=0;for(let e=0;e<n;e++)0===e?(Epic.spawn(t,{},{z:t.z-r,part:"Start",alt:i}),r+=4*a.a.blockSize):e<n-1?(Epic.spawn(t,{},{z:t.z-r,part:"Mid",alt:i}),r+=4*a.a.blockSize):(Epic.spawn(t,{},{z:t.z-r,part:"End",alt:i}),r+=4*a.a.blockSize)}static prepopulate(){u.a.game.pool.prepopulate(EpicStart,2),u.a.game.pool.prepopulate(EpicMid,8),u.a.game.pool.prepopulate(EpicEnd,2)}}class EpicStart extends Epic{constructor(){if(super(),a.a.environment){if("1103-seoul"===a.a.theme){const t=u.a.library.getEntity("epic_start");this.addChild(t),l.a.applyMaterial(t.parts[0],new h.a({map:u.a.library.getMap("ocean")})),l.a.applyMaterial(t.parts[1],new s.a({customFog:!0,rails:!0,diffuseMap:u.a.library.getMap("environment-tex")})),l.a.applyMaterial(t.parts[2],new s.a({customFog:!0,rails:!0,diffuseMap:u.a.library.getMap("environment-tex")}))}if(["189-mumbai","191-newyork","177-singapore"].includes(a.a.theme)){const t=u.a.library.getEntity("epic_start");this.addChild(t),Epic.createWater(t)}if("198-atlanta"===a.a.theme){const t=u.a.library.getEntity("epic_start");d(t.parts[2]),this.addChild(t),Epic.createWater(t)}}}}class EpicMid extends Epic{constructor(){if(super(),a.a.environment){if("1103-seoul"===a.a.theme){const t=u.a.library.getEntity("epic_mid");this.addChild(t),l.a.applyMaterial(t.parts[0],new s.a({customFog:!0,rails:!0,diffuseMap:u.a.library.getMap("environment-tex")})),l.a.applyMaterial(t.parts[1],new h.a({map:u.a.library.getMap("ocean")})),l.a.applyMaterial(t.parts[2],new s.a({customFog:!0,rails:!0,diffuseMap:u.a.library.getMap("environment-tex")}))}if(["189-mumbai","191-newyork","177-singapore"].includes(a.a.theme)){const t=u.a.library.getEntity("epic_mid");this.addChild(t),Epic.createWater(t)}if("198-atlanta"===a.a.theme){const t=u.a.library.getEntity("epic_mid");d(t.parts[2]),this.addChild(t),Epic.createWater(t)}}}}class EpicEnd extends Epic{constructor(){if(super(),a.a.environment){if("1103-seoul"===a.a.theme){const t=u.a.library.getEntity("epic_end");this.addChild(t),l.a.applyMaterial(t.parts[0],new s.a({customFog:!0,rails:!0,diffuseMap:u.a.library.getMap("environment-tex")})),l.a.applyMaterial(t.parts[1],new h.a({map:u.a.library.getMap("ocean")})),l.a.applyMaterial(t.parts[2],new s.a({customFog:!0,rails:!0,diffuseMap:u.a.library.getMap("environment-tex")}))}if(["189-mumbai","191-newyork","177-singapore"].includes(a.a.theme)){const t=u.a.library.getEntity("epic_end");this.addChild(t),Epic.createWater(t)}if("198-atlanta"===a.a.theme){const t=u.a.library.getEntity("epic_end");this.addChild(t);const e=u.a.library.getEntity("epic_start"),i=-720;e.position.z=i,Object.values(e.parts).forEach((t,e)=>{t.active=2===e}),d(e.parts[2]),this.addChild(e),Epic.createWater(t)}}}}const d=t=>{const e=u.a.library.getMap("atlanta-scroll");e.baseTexture.wrapMode=o.WRAP_MODES.REPEAT,l.a.applyMaterial(t,new s.a({customFog:!0,rails:!1,diffuseMap:e})),t.materialUpdateInterval=setInterval(()=>{e.frame.y+=.6,e.update()},1e3/60)},p={EpicStart:EpicStart,EpicMid:EpicMid,EpicEnd:EpicEnd,EpicStartAlt:class EpicStartAlt extends Epic{constructor(){if(super(),a.a.environment){if("1103-seoul"===a.a.theme){const t=u.a.library.getEntity("epic_start");this.addChild(t),l.a.applyMaterial(t.parts[0],new h.a({map:u.a.library.getMap("ocean")})),l.a.applyMaterial(t.parts[1],new s.a({customFog:!0,rails:!0,diffuseMap:u.a.library.getMap("environment-tex")})),l.a.applyMaterial(t.parts[2],new s.a({customFog:!0,rails:!0,diffuseMap:u.a.library.getMap("environment-tex")}))}if("191-newyork"===a.a.theme){const t=u.a.library.getEntity("epic_1_start");this.addChild(t)}}}},EpicMidAlt:class EpicMidAlt extends Epic{constructor(){if(super(),a.a.environment){if("1103-seoul"===a.a.theme){const t=u.a.library.getEntity("epic_mid");this.addChild(t),l.a.applyMaterial(t.parts[0],new s.a({customFog:!0,rails:!0,diffuseMap:u.a.library.getMap("environment-tex")})),l.a.applyMaterial(t.parts[1],new h.a({map:u.a.library.getMap("ocean")})),l.a.applyMaterial(t.parts[2],new s.a({customFog:!0,rails:!0,diffuseMap:u.a.library.getMap("environment-tex")}))}if("191-newyork"===a.a.theme){const t=u.a.library.getEntity("epic_1_mid");this.addChild(t)}}}},EpicEndAlt:class EpicEndAlt extends Epic{constructor(){if(super(),a.a.environment){if("1103-seoul"===a.a.theme){const t=u.a.library.getEntity("epic_end");this.addChild(t),l.a.applyMaterial(t.parts[0],new s.a({customFog:!0,rails:!0,diffuseMap:u.a.library.getMap("environment-tex")})),l.a.applyMaterial(t.parts[1],new h.a({map:u.a.library.getMap("ocean")})),l.a.applyMaterial(t.parts[2],new s.a({customFog:!0,rails:!0,diffuseMap:u.a.library.getMap("environment-tex")}))}if("191-newyork"===a.a.theme){const t=u.a.library.getEntity("epic_1_end");this.addChild(t)}}}}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return TubeEnvironment}));var n=i(2),r=i(1),o=i(19),a=i(25),s=i(14);class TubeEnvironmentBlock extends s.a{constructor(){var t,e,i;super(),i=void 0,(e="view")in(t=this)?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,this.add(o.a,{deco:!0,noView:!0}),this.body.width=80,this.body.height=0,this.body.depth=2*n.a.blockSize,this.body.bottom=0,n.a.environment&&(this.view=r.a.library.getEntity("tube"),this.view.ry=Math.PI,this.view.z=.5*this.body.depth,this.view.y=.5*-this.body.height,this.addChild(this.view),this.view.parts&&"1103-seoul"===n.a.theme&&(this.view.parts[0].view3d.state.blend=!0,this.view.parts[0].view3d.material.opacity=.5))}}class TubeEnvironment extends s.a{constructor(){super(),this.add(o.a,{deco:!1}),this.body.width=80,this.body.height=16,this.body.depth=n.a.blockSize,this.body.top=88}awake(t,e){const i=e.components.Transform.position.z;t.game.route.hasTube=!0;let r=t.blocks;e.components.Environment&&(r=e.components.Environment._blockCount),this.body.x=0,this.body.depth=n.a.blockSize*r,this.body.back=t.z-i;const o=.5*r;for(let e=0;e<o;e++){const i=t.game.pool.get(TubeEnvironmentBlock);i.body.back=this.body.back-2*n.a.blockSize*e,t.game.addChild(i);const r=i.body.back;0===e?a.k.spawn(t,{z:r,l:a.j}):e<o-1?a.k.spawn(t,{z:r,l:a.g}):a.k.spawn(t,{z:r,l:a.f})}}static hasNecessaryResources(){return r.a.library.hasGeometry("epic_start")}static match(t){if(!t.components.Environment)return!1;return t.components.Environment._environmentKind._type.split(",").indexOf("Tube")>=0}static factory(t,e){t.game.route.setSpawnDistance("tube",1e3);const i=t.game.pool.get(TubeEnvironment);return i.awake(t,e),t.game.addChild(i),i}static prepopulate(){r.a.game.pool.prepopulate(TubeEnvironmentBlock,16),r.a.game.pool.prepopulate(TubeEnvironment,4)}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return StationEnvironment_StationEnvironment}));var n=i(2),r=i(1),o=i(19),a=i(25),s=i(14);function h(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class StationPlatform_StationPart extends s.a{constructor(){super(),this.add(o.a),this.removableOnCrash=!0}reset(){this.body.box.size.reset(),this.body.box.center.reset()}}class StationPlatform_StationPlatform extends s.a{constructor(){super(),h(this,"view",void 0),h(this,"factory",t=>{const e=t.game.pool.get(StationPlatform_StationPlatform);e.init(),t.game.addChild(e);const i=t.game.pool.get(StationPlatform_StationPlatform);i.init(),t.game.addChild(i)}),this.add(o.a,{deco:!0,noView:!0}),this.body.width=80,this.body.height=2,this.body.depth=2*n.a.blockSize,this.removableOnCrash=!0,n.a.environment&&(this.view=r.a.library.getEntity("station_platforms"),this.view.ry=Math.PI,this.view.z=n.a.blockSize,this.addChild(this.view))}awake(t,e,i){this.body.back=i,this.body.x=0;const r=t.game.pool.get(StationPlatform_StationPart);r.reset(),r.body.width=20,r.body.height=9,r.body.depth=this.body.depth,r.body.x=-n.a.laneWidth,r.body.bottom=0,r.body.z=this.body.z,t.game.addChild(r);const o=t.game.pool.get(StationPlatform_StationPart);o.reset(),o.body.width=20,o.body.height=9,o.body.depth=this.body.depth,o.body.x=n.a.laneWidth,o.body.bottom=0,o.body.z=this.body.z,t.game.addChild(o)}}function u(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class StationEnvironment_StationStart extends s.a{constructor(){super(),u(this,"view",void 0),this.add(o.a,{deco:!0,noView:!0}),this.body.width=80,this.body.height=0,this.body.depth=n.a.blockSize,this.body.bottom=0,n.a.environment&&(this.view=r.a.library.getEntity("station_start"),this.view.ry=Math.PI,this.view.y=.5*-this.body.height,this.addChild(this.view))}}class StationEnvironment_StationMid extends s.a{constructor(){super(),u(this,"view",void 0),this.add(o.a,{deco:!0,noView:!0}),this.body.width=80,this.body.height=0,this.body.depth=2*n.a.blockSize,this.body.bottom=0,n.a.environment&&(this.view=r.a.library.getEntity("station_mid"),this.view.ry=Math.PI,this.view.y=.5*-this.body.height,this.addChild(this.view))}}class StationEnvironment_StationEnd extends s.a{constructor(){super(),u(this,"view",void 0),this.add(o.a,{deco:!0,noView:!0}),this.body.width=80,this.body.height=0,this.body.depth=n.a.blockSize,this.body.bottom=0,n.a.environment&&(this.view=r.a.library.getEntity("station_end"),this.view.ry=Math.PI,this.view.y=.5*-this.body.height,this.addChild(this.view))}}class StationEnvironment_StationEnvironment extends s.a{constructor(){super(),this.add(o.a,{deco:!1}),this.body.width=80,this.body.height=4,this.body.depth=4*n.a.blockSize}awake(t,e,i=!0){const r=e.components.Environment,o=r?r._blockCount:4,s=e.components.Transform.position.z;let h=t.z-s;t.name.match("short")||(h+=4*n.a.blockSize),this.body.depth=n.a.blockSize*o,this.body.x=0,this.body.top=86,this.body.back=h;const u=t.game.pool.get(StationEnvironment_StationStart);u.body.z=h,t.game.addChild(u);const l=.5*(o-2);for(let e=0;e<l;e++){const i=t.game.pool.get(StationEnvironment_StationMid);i.body.z=h-n.a.blockSize-i.body.depth*e,t.game.addChild(i)}const c=t.game.pool.get(StationEnvironment_StationEnd);if(c.body.z=h-(o-1)*n.a.blockSize,t.game.addChild(c),t.setFillersByPosition(this.body.back,this.body.front),i){const i=.5*o;for(let n=0;n<i;n++){const i=t.game.pool.get(StationPlatform_StationPlatform);i.awake(t,e,h-i.body.depth*n),t.game.addChild(i)}}const d=.5*o;for(let e=0;e<d;e++){const i=h-e*(2*n.a.blockSize);0===e?a.k.spawn(t,{z:i,l:a.e,m:a.j,r:a.e}):e<d-1?a.k.spawn(t,{z:i,l:a.b,m:a.g,r:a.b}):a.k.spawn(t,{z:i,l:a.a,m:a.f,r:a.a})}t.setFillersByPosition(this.body.back,this.body.front),t.setFloorsByPosition(this.body.back,this.body.front)}static hasNecessaryResources(){return r.a.library.hasGeometry("station_start")}static match(t){if(!t.components.Environment)return!1;return t.components.Environment._environmentKind._type.split(",").indexOf("Station")>=0}static prepopulate(){r.a.game.pool.prepopulate(StationEnvironment_StationStart,1),r.a.game.pool.prepopulate(StationEnvironment_StationMid,4),r.a.game.pool.prepopulate(StationEnvironment_StationEnd,1),r.a.game.pool.prepopulate(StationEnvironment_StationEnvironment,1)}}},function(t,e,i){var n=i(112);t.exports=function(t){return Object(n(t))}},function(t,e,i){var n=i(45),r=i(168).f,o=i(73),a=i(116),s=i(161),h=i(201),u=i(328);t.exports=function(t,e){var i,l,c,d,p,f=t.target,m=t.global,g=t.stat;if(i=m?n:g?n[f]||s(f,{}):(n[f]||{}).prototype)for(l in e){if(d=e[l],c=t.noTargetGet?(p=r(i,l))&&p.value:i[l],!u(m?l:f+(g?".":"#")+l,t.forced)&&void 0!==c){if(typeof d==typeof c)continue;h(d,c)}(t.sham||c&&c.sham)&&o(d,"sham",!0),a(i,l,d,t)}}},,function(t,e,i){"use strict";i.d(e,"a",(function(){return Component}));class Component{constructor(t,e){if(!t)throw new Error("component requires an entity");this.entity=t,this.data=e,this.name="",this.scene=null,this.active=!1}static create(t,e){if(Component._mapHash[t])return Component._mapHash[t];function i(i,n){this.entity=i,this.data=n,this.id=t,e.constructor&&e.constructor.call(this)}i.prototype=Object.create(Component.prototype),i.id=t;for(const t in e)i.prototype[t]=e[t];return Component._mapHash[t]=i,i}}Component._mapHash={}},,function(t,e,i){"use strict";i.d(e,"a",(function(){return Anim}));var n=i(32),r=i(297),o=i(154),a=i(2),s=i(1),h=i(17),u=i(18);function l(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function c(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?l(Object(i),!0).forEach((function(e){d(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):l(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function d(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const p={loop:!1,sudden:!1,mixRatio:.3,speed:1,restart:!0},f={file:"",texture:"",fps:24,offset:0,speed:.015,clips:{}};class Anim extends u.a{constructor(t){super(t),d(this,"container",void 0),d(this,"scene",null),d(this,"fpsGame",60),d(this,"currentAction",null),d(this,"currentAnimationName",""),d(this,"currentAnimationClipName",""),d(this,"currentAnimation",null),d(this,"currentAnimationLoop",!1),d(this,"scenes",{}),d(this,"animations",{}),d(this,"clips",{}),d(this,"actions",{}),d(this,"debug",!1),d(this,"speed",1),d(this,"active",!0),d(this,"character",""),d(this,"_enforce",0),d(this,"_queued",null),d(this,"extra",null),d(this,"currentScene",null),d(this,"nextScene",null),d(this,"currentController",null),d(this,"timeout",void 0),this.container=new n.a;(this.entity.model||this.entity).addChild(this.container),this.container.scale.set(100)}getAnimationName(t){return this.character?this.character+"-"+t:t}reset(){this.currentAction=null,this.stop()}addScene(t){const e=c(c({},f),t);if(this.character=e.file.split("-").shift()||"",this.scenes[e.file])return;const i=s.a.library.getScene(e.file,{map:e.texture}),n=i.getComponent(r.a);if(!n)throw new Error("[Anim] Scene does not have an animationController: "+e.file);const a=h.a.findEntity(i,"Mess",10);a&&a.parent&&a.parent.removeChild(a),n.autoUpdate=!1,this.scenes[e.file]=i;const u=e.offset,l=e.speed,d=n._animations,p=d[0];for(const t in e.clips){const n=this.getAnimationName(t);this.animations[n]=i;const r=e.clips[t].frames,a={name:n,start:Math.max((r[0]+u)/e.fps,0),end:Math.min((r[1]+u)/e.fps,p.duration),animation:p,speed:l,loop:!1};d[n]=o.a.fromAnimation(a)}}getSceneEntity(t){return this.scenes[t]}updateCurrentAnimation(){this.currentAnimationName&&(this.currentAnimationName="",this.play(this.currentAnimationClipName,{sudden:!0,loop:this.currentAnimationLoop}))}play(t,e={}){Array.isArray(t)&&(t=t[Math.floor(Math.random()*t.length)]);const i=this.getAnimationName(t),n=this.animations[i];if(!n)throw new Error("[Anim] Animation not available: '"+i+"'");if(this.currentAnimationName===i)return;this.currentAnimationName=i;const o=c(c({},p),e);n!==this.currentScene&&(this.nextScene=n);const a=n.getComponent(r.a),s=a._animations[i];s.loop=o.loop,a.play(i,o.restart),this.speed=o.speed,this.currentAnimation=s,this.currentController=a,o.sudden?(a._mixRatio=1,a.lastAnimation=null,a._mixing=!1,this.swapScene(n),a.updateAnimation(.1),a.render()):(a.allowMixing=!0,a.mixAmount=o.mixRatio),this.currentAnimationClipName=t,this.currentAnimationLoop=o.loop}swapScene(t,e=null){this.currentScene!==t&&(e||(e=this.currentScene),this.currentScene=t,this.nextScene=null,t.scale.set(1),t.active=!0,this.container.addChild(t),e&&(e.scale.set(1e-6),e.active=!1))}stop(){}update(t){if(!this.active)return;const e=t.frameTime,i=a.a.baseAnimSpeed*this.speed;this.nextScene&&this.nextScene!==this.currentScene&&this.swapScene(this.nextScene),this.currentController&&e&&this.currentController.updateAnimation(e),this.currentAnimation&&e&&(this.currentAnimation.speed=i)}getCurrentAnimationName(){return this.currentAnimationName}}},,,,function(t,e,i){"use strict";function n(){}i.d(e,"a",(function(){return n}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return Pool}));i(9);class Pool{constructor(t){this._pool=[],this._debug=!1,this._classType=t,this._pool=[],this._debug=!1}static getPool(t){return this._poolsByClass.has(t)||this._poolsByClass.set(t,new Pool(t)),this._poolsByClass.get(t)}static get(t){return this.getPool(t).get()}static return(t){this.getPool(t.constructor).return(t)}prepopulate(t){for(let e=0;e<t;e++)this._pool.push(new this._classType)}get(){let t=this._pool.pop();return t||(t=new this._classType),t}return(t){-1===this._pool.indexOf(t)?this._pool.push(t):this._debug}get total(){return this._pool.length}}Pool._poolsByClass=new Map},function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var n={};i.r(n),i.d(n,"create",(function(){return a})),i.d(n,"clone",(function(){return s})),i.d(n,"length",(function(){return h})),i.d(n,"fromValues",(function(){return u})),i.d(n,"copy",(function(){return l})),i.d(n,"set",(function(){return c})),i.d(n,"add",(function(){return d})),i.d(n,"subtract",(function(){return p})),i.d(n,"multiply",(function(){return f})),i.d(n,"divide",(function(){return m})),i.d(n,"ceil",(function(){return g})),i.d(n,"floor",(function(){return y})),i.d(n,"min",(function(){return v})),i.d(n,"max",(function(){return b})),i.d(n,"round",(function(){return _})),i.d(n,"scale",(function(){return w})),i.d(n,"scaleAndAdd",(function(){return x})),i.d(n,"distance",(function(){return C})),i.d(n,"squaredDistance",(function(){return S})),i.d(n,"squaredLength",(function(){return T})),i.d(n,"negate",(function(){return A})),i.d(n,"inverse",(function(){return E})),i.d(n,"normalize",(function(){return P})),i.d(n,"dot",(function(){return M})),i.d(n,"cross",(function(){return I})),i.d(n,"lerp",(function(){return k})),i.d(n,"hermite",(function(){return O})),i.d(n,"bezier",(function(){return R})),i.d(n,"random",(function(){return D})),i.d(n,"transformMat4",(function(){return L})),i.d(n,"transformMat3",(function(){return N})),i.d(n,"transformQuat",(function(){return B})),i.d(n,"rotateX",(function(){return F})),i.d(n,"rotateY",(function(){return z})),i.d(n,"rotateZ",(function(){return j})),i.d(n,"angle",(function(){return G})),i.d(n,"zero",(function(){return U})),i.d(n,"str",(function(){return H})),i.d(n,"exactEquals",(function(){return V})),i.d(n,"equals",(function(){return W})),i.d(n,"sub",(function(){return Y})),i.d(n,"mul",(function(){return q})),i.d(n,"div",(function(){return K})),i.d(n,"dist",(function(){return J})),i.d(n,"sqrDist",(function(){return Z})),i.d(n,"len",(function(){return Q})),i.d(n,"sqrLen",(function(){return $})),i.d(n,"forEach",(function(){return tt}));var r="undefined"!=typeof Float32Array?Float32Array:Array,o=Math.random;Math.PI;function a(){var t=new r(3);return r!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function s(t){var e=new r(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function h(t){var e=t[0],i=t[1],n=t[2];return Math.hypot(e,i,n)}function u(t,e,i){var n=new r(3);return n[0]=t,n[1]=e,n[2]=i,n}function l(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function c(t,e,i,n){return t[0]=e,t[1]=i,t[2]=n,t}function d(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}function p(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t}function f(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t}function m(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t}function g(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function y(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function v(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t[2]=Math.min(e[2],i[2]),t}function b(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t[2]=Math.max(e[2],i[2]),t}function _(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function w(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function x(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t[2]=e[2]+i[2]*n,t}function C(t,e){var i=e[0]-t[0],n=e[1]-t[1],r=e[2]-t[2];return Math.hypot(i,n,r)}function S(t,e){var i=e[0]-t[0],n=e[1]-t[1],r=e[2]-t[2];return i*i+n*n+r*r}function T(t){var e=t[0],i=t[1],n=t[2];return e*e+i*i+n*n}function A(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function E(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function P(t,e){var i=e[0],n=e[1],r=e[2],o=i*i+n*n+r*r;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function M(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function I(t,e,i){var n=e[0],r=e[1],o=e[2],a=i[0],s=i[1],h=i[2];return t[0]=r*h-o*s,t[1]=o*a-n*h,t[2]=n*s-r*a,t}function k(t,e,i,n){var r=e[0],o=e[1],a=e[2];return t[0]=r+n*(i[0]-r),t[1]=o+n*(i[1]-o),t[2]=a+n*(i[2]-a),t}function O(t,e,i,n,r,o){var a=o*o,s=a*(2*o-3)+1,h=a*(o-2)+o,u=a*(o-1),l=a*(3-2*o);return t[0]=e[0]*s+i[0]*h+n[0]*u+r[0]*l,t[1]=e[1]*s+i[1]*h+n[1]*u+r[1]*l,t[2]=e[2]*s+i[2]*h+n[2]*u+r[2]*l,t}function R(t,e,i,n,r,o){var a=1-o,s=a*a,h=o*o,u=s*a,l=3*o*s,c=3*h*a,d=h*o;return t[0]=e[0]*u+i[0]*l+n[0]*c+r[0]*d,t[1]=e[1]*u+i[1]*l+n[1]*c+r[1]*d,t[2]=e[2]*u+i[2]*l+n[2]*c+r[2]*d,t}function D(t,e){e=e||1;var i=2*o()*Math.PI,n=2*o()-1,r=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(i)*r,t[1]=Math.sin(i)*r,t[2]=n*e,t}function L(t,e,i){var n=e[0],r=e[1],o=e[2],a=i[3]*n+i[7]*r+i[11]*o+i[15];return a=a||1,t[0]=(i[0]*n+i[4]*r+i[8]*o+i[12])/a,t[1]=(i[1]*n+i[5]*r+i[9]*o+i[13])/a,t[2]=(i[2]*n+i[6]*r+i[10]*o+i[14])/a,t}function N(t,e,i){var n=e[0],r=e[1],o=e[2];return t[0]=n*i[0]+r*i[3]+o*i[6],t[1]=n*i[1]+r*i[4]+o*i[7],t[2]=n*i[2]+r*i[5]+o*i[8],t}function B(t,e,i){var n=i[0],r=i[1],o=i[2],a=i[3],s=e[0],h=e[1],u=e[2],l=r*u-o*h,c=o*s-n*u,d=n*h-r*s,p=r*d-o*c,f=o*l-n*d,m=n*c-r*l,g=2*a;return l*=g,c*=g,d*=g,p*=2,f*=2,m*=2,t[0]=s+l+p,t[1]=h+c+f,t[2]=u+d+m,t}function F(t,e,i,n){var r=[],o=[];return r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],o[0]=r[0],o[1]=r[1]*Math.cos(n)-r[2]*Math.sin(n),o[2]=r[1]*Math.sin(n)+r[2]*Math.cos(n),t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2],t}function z(t,e,i,n){var r=[],o=[];return r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],o[0]=r[2]*Math.sin(n)+r[0]*Math.cos(n),o[1]=r[1],o[2]=r[2]*Math.cos(n)-r[0]*Math.sin(n),t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2],t}function j(t,e,i,n){var r=[],o=[];return r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],o[0]=r[0]*Math.cos(n)-r[1]*Math.sin(n),o[1]=r[0]*Math.sin(n)+r[1]*Math.cos(n),o[2]=r[2],t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2],t}function G(t,e){var i=t[0],n=t[1],r=t[2],o=e[0],a=e[1],s=e[2],h=Math.sqrt(i*i+n*n+r*r)*Math.sqrt(o*o+a*a+s*s),u=h&&M(t,e)/h;return Math.acos(Math.min(Math.max(u,-1),1))}function U(t){return t[0]=0,t[1]=0,t[2]=0,t}function H(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function V(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function W(t,e){var i=t[0],n=t[1],r=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(i-o)<=1e-6*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(n-a)<=1e-6*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-s)<=1e-6*Math.max(1,Math.abs(r),Math.abs(s))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var X,Y=p,q=f,K=m,J=C,Z=S,Q=h,$=T,tt=(X=a(),function(t,e,i,n,r,o){var a,s;for(e||(e=3),i||(i=0),s=n?Math.min(n*e+i,t.length):t.length,a=i;a<s;a+=e)X[0]=t[a],X[1]=t[a+1],X[2]=t[a+2],r(X,X,o),t[a]=X[0],t[a+1]=X[1],t[a+2]=X[2];return t})},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,i){var n=i(45),r=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?r(n[t]):n[t]&&n[t][e]}},function(t,e){t.exports={}},function(t,e,i){var n,r,o,a=i(323),s=i(45),h=i(59),u=i(73),l=i(58),c=i(160),d=i(167),p=i(165),f=s.WeakMap;if(a||c.state){var m=c.state||(c.state=new f),g=m.get,y=m.has,v=m.set;n=function(t,e){if(y.call(m,t))throw new TypeError("Object already initialized");return e.facade=t,v.call(m,t,e),e},r=function(t){return g.call(m,t)||{}},o=function(t){return y.call(m,t)}}else{var b=d("state");p[b]=!0,n=function(t,e){if(l(t,b))throw new TypeError("Object already initialized");return e.facade=t,u(t,b,e),e},r=function(t){return l(t,b)?t[b]:{}},o=function(t){return l(t,b)}}t.exports={set:n,get:r,has:o,enforce:function(t){return o(t)?r(t):n(t,{})},getterFor:function(t){return function(e){var i;if(!h(e)||(i=r(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return i}}}},function(t,e,i){var n=i(45),r=i(73),o=i(58),a=i(161),s=i(200),h=i(115),u=h.get,l=h.enforce,c=String(String).split("String");(t.exports=function(t,e,i,s){var h,u=!!s&&!!s.unsafe,d=!!s&&!!s.enumerable,p=!!s&&!!s.noTargetGet;"function"==typeof i&&("string"!=typeof e||o(i,"name")||r(i,"name",e),(h=l(i)).source||(h.source=c.join("string"==typeof e?e:""))),t!==n?(u?!p&&t[e]&&(d=!0):delete t[e],d?t[e]=i:r(t,e,i)):d?t[e]=i:a(e,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&u(this).source||s(this)}))},function(t,e,i){var n=i(79),r=i(331);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(i,[]),e=i instanceof Array}catch(t){}return function(i,o){return n(i),r(o),e?t.call(i,o):i.__proto__=o,i}}():void 0)},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Collector=void 0;e.Collector=class Collector{constructor(t){this.emit=(...e)=>{t.emitCollecting(this,e)}}}},,function(t,e,i){"use strict";i.d(e,"a",(function(){return ContainerComponent}));class ContainerComponent{constructor(t){this.entity=t,this.children=[],this.parent=null}empty(){for(let t=0;t<this.children.length;t++)this.children[t].container.parent=null;this.children.length=0}traverse(t){t(this.entity);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].container.traverse(t)}add(t){if(t.parent){const e=t.parent.container.children.indexOf(t);-1!==e&&t.parent.container.children.splice(e,1)}t.container.parent=this.entity,this.children.push(t),this.entity.scene&&!t.scene&&this.entity.scene.addToScene(t)}removeAll(){for(let t=0;t<this.children.length;t++){const e=this.children[t];this.entity.scene&&this.entity.scene.removeFromScene(e),e.container.parent=null}this.children.length=0}remove(t){const e=this.children.indexOf(t);-1!==e&&(this.children.splice(e,1),this.entity.scene&&this.entity.scene.removeFromScene(t),t.container.parent=null)}}ContainerComponent.DEFAULT_NAME="container"},function(t,e,i){"use strict";i.d(e,"a",(function(){return Gates}));var n=i(2),r=i(1),o=i(19),a=i(81),s=i(25),h=i(14);function u(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Gates extends h.a{constructor(){super(),u(this,"lowCamera",!0),u(this,"colL",void 0),u(this,"colR",void 0),u(this,"colM",void 0),u(this,"ceiling",void 0),this.removableOnCrash=!0,this.add(o.a,{noView:!0,trigger:!0}),this.body.width=80,this.body.height=50,this.body.depth=120,this.lowCamera=!0}awake(t,e){this.body.x=0,this.body.bottom=0,this.body.z=t.z-e.components.Transform.position.z-2*n.a.blockSize,this.model&&(this.model.ry=Math.PI,this.model.y=.5*-this.body.height,this.model.z=1.45*this.body.depth,this.addChild(this.model));const i=t.game.pool.get(GatePart);i.body.width=this.body.width,i.body.height=16,i.body.depth=.9*this.body.depth,i.body.x=0,i.body.bottom=37,i.body.z=this.body.z,t.game.addChild(i);const r=t.game.pool.get(GatePart);r.body.width=20,r.body.height=i.body.bottom,r.body.depth=.9*this.body.depth,r.body.bottom=0,r.body.right=1.5*-n.a.laneWidth,r.body.z=this.body.z,t.game.addChild(r);const o=t.game.pool.get(GatePart);o.body.width=20,o.body.height=i.body.bottom,o.body.depth=.9*this.body.depth,o.body.bottom=0,o.body.x=0,o.body.z=this.body.z,t.game.addChild(o);const h=t.game.pool.get(GatePart);h.body.width=20,h.body.height=i.body.bottom,h.body.depth=.9*this.body.depth,h.body.bottom=0,h.body.left=1.5*n.a.laneWidth,h.body.z=this.body.z,t.game.addChild(h),this.colL=r,this.colR=h,this.colM=o,this.ceiling=i;const u=new GatesBase;u.ry=Math.PI,u.z=t.z,t.game.addChild(u),t.setFillersByPosition(t.z,t.z-4*n.a.blockSize),s.k.spawnGates(t),t.blocks>4&&(s.k.spawn(t,{z:t.z-4*n.a.blockSize}),a.a.spawn(t,{z:t.z-4*n.a.blockSize,l:a.b,r:a.c}))}static hasNecessaryResources(){return r.a.library.hasGeometry("gates_base")}static match(t){return!!t.name.match(/gates_(.*?)_group_place/)}static factory(t,e){const i=l[e.name],n=t.game.pool.get(i);n.awake(t,e),t.game.addChild(n);const r=t.game.pool.get(GatesCameraTrigger);r.body.x=n.body.x,r.body.y=n.body.y,r.body.z=n.body.z+30,t.game.addChild(r)}}class GatesCameraTrigger extends h.a{constructor(){super(),this.removableOnCrash=!0,this.add(o.a,{trigger:!0}),this.body.width=80,this.body.height=50,this.body.depth=160,this.lowCamera=!0}}class GatesBase extends h.a{constructor(){super(),n.a.environment&&(this.model=r.a.library.getEntity("gates_base"),this.addChild(this.model))}}class GatePart extends h.a{constructor(){super(),this.add(o.a),this.removableOnCrash=!0}reset(){}}const l={gates_mid_group_place:class GatesMid extends Gates{constructor(){super(),n.a.environment&&(this.model=r.a.library.getEntity("gates_mid"),this.model.ry=Math.PI,this.model.y=.5*-this.body.height,this.addChild(this.model))}awake(t,e){super.awake(t,e),this.colM.body.width=0,this.colM.body.x=999,this.colL.body.width=60,this.colL.body.right=.5*-n.a.laneWidth,this.colR.body.width=60,this.colR.body.left=.5*n.a.laneWidth,this.scale.set(.9),this.scale.set(1)}},gates_left_group_place:class GatesLeft extends Gates{constructor(){super(),n.a.environment&&(this.model=r.a.library.getEntity("gates_left"),this.model.ry=Math.PI,this.model.y=.5*-this.body.height,this.addChild(this.model))}awake(t,e){super.awake(t,e),this.colM.body.width=0,this.colM.body.x=999,this.colL.body.width=60,this.colL.body.right=1.5*-n.a.laneWidth,this.colR.body.width=60,this.colR.body.left=.5*-n.a.laneWidth,this.scale.set(.9),this.scale.set(1)}},gates_right_group_place:class GatesRight extends Gates{constructor(){super(),n.a.environment&&(this.model=r.a.library.getEntity("gates_right"),this.model.ry=Math.PI,this.model.y=.5*-this.body.height,this.addChild(this.model))}awake(t,e){super.awake(t,e),this.colM.body.width=0,this.colM.body.x=999,this.colL.body.width=60,this.colL.body.right=.5*n.a.laneWidth,this.colR.body.width=60,this.colR.body.left=1.5*n.a.laneWidth,this.scale.set(.9),this.scale.set(1)}},gates_sides_group_place:class GatesSides extends Gates{constructor(){super(),n.a.environment&&(this.model=r.a.library.getEntity("gates_sides"),this.model.ry=Math.PI,this.model.y=.5*-this.body.height,this.model.sx=.9,this.model.x=-1)}awake(t,e){super.awake(t,e),this.colM.body.width=20,this.colM.body.x=0,this.colL.body.width=20,this.colL.body.right=1.5*-n.a.laneWidth,this.colR.body.width=20,this.colR.body.left=1.5*n.a.laneWidth,this.scale.set(.9),this.scale.set(1)}}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return PillarsEnvironment}));var n=i(2),r=i(1),o=i(19),a=i(25),s=i(14);function h(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class PillarsEnvironmentStart extends s.a{constructor(){super(),h(this,"view",void 0),this.add(o.a,{deco:!0,noView:!0}),this.body.width=80,this.body.height=1,this.body.depth=n.a.blockSize,this.body.bottom=0,n.a.environment&&(this.view=r.a.library.getEntity("pillars_start"),this.view.ry=Math.PI,this.view.z=.5*this.body.depth,this.view.y=.5*-this.body.height,this.addChild(this.view))}}class PillarsEnvironmentMid extends s.a{constructor(){super(),h(this,"view",void 0),this.add(o.a,{deco:!0,noView:!0}),this.body.width=80,this.body.height=1,this.body.depth=n.a.blockSize,this.body.bottom=0,n.a.environment&&(this.view=r.a.library.getEntity("pillars_mid"),this.view.ry=Math.PI,this.view.z=.5*this.body.depth,this.view.y=.5*-this.body.height,this.addChild(this.view))}}class PillarsEnvironmentEnd extends s.a{constructor(){super(),h(this,"view",void 0),this.add(o.a,{deco:!0,noView:!0}),this.body.width=80,this.body.height=1,this.body.depth=n.a.blockSize,this.body.bottom=0,n.a.environment&&(this.view=r.a.library.getEntity("pillars_end"),this.view.ry=Math.PI,this.view.z=.5*this.body.depth,this.view.y=.5*-this.body.height,this.addChild(this.view))}}class PillarsEnvironment extends s.a{constructor(){super(),this.add(o.a),this.body.width=80,this.body.height=20,this.body.depth=n.a.blockSize,this.body.top=90}awake(t,e){const i=e.components.Transform.position.z,r=e.components.Environment._blockCount;this.body.x=0,this.body.depth=n.a.blockSize*r,this.body.back=t.z-i;const o=t.game.pool.get(PillarsEnvironmentStart);o.body.back=this.body.back,t.game.addChild(o),a.k.spawn(t,{z:o.body.back,l:a.i,m:a.d,r:a.i});for(let e=0;e<r-2;e++){if(e%2!=0)continue;const i=t.game.pool.get(PillarsEnvironmentMid);i.body.back=o.body.back-2*n.a.blockSize*(e/2+1)+n.a.blockSize,t.game.addChild(i),a.k.spawn(t,{z:i.body.back,l:a.g,m:a.b,r:a.g})}const s=t.game.pool.get(PillarsEnvironmentEnd);s.body.back=o.body.back-n.a.blockSize*(r-1),t.game.addChild(s),a.k.spawn(t,{z:s.body.back,l:a.h,m:a.c,r:a.h})}static hasNecessaryResources(){return r.a.library.hasGeometry("pillars_start")}static match(t){if(!t.components.Environment)return!1;return t.components.Environment._environmentKind._type.split(",").indexOf("Pillars")>=0}static prepopulate(){r.a.game.pool.prepopulate(PillarsEnvironmentStart,2),r.a.game.pool.prepopulate(PillarsEnvironmentMid,8),r.a.game.pool.prepopulate(PillarsEnvironmentEnd,2),r.a.game.pool.prepopulate(PillarsEnvironment,2)}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return wt}));i(9);var n=i(37),r=i(289);i(56);var o=i(43),a=i.n(o),s=function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))};const h={test:t=>Object(o.extname)(t).split("?").shift().endsWith("woff2"),load(t){return s(this,void 0,void 0,(function*(){const e=function(t){const e=Object(o.extname)(t);return Object(o.basename)(t,e).replace(/(-|_)/g," ").toLowerCase().split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}(t),i=t.replace(".woff2",".woff"),n="\n @font-face {\n font-family: "+(a={fontFamily:e,woff:i,woff2:t}).fontFamily+';\n src: url("'+a.woff2+"\") format('woff2'),\n url(\""+a.woff+"\") format('woff');\n font-weight: normal;\n font-style: normal;\n }";var a;const s=document.createElement("style"),h=document.createTextNode(n);s.appendChild(h),document.head.appendChild(s);const u=document.createElement("div");return u.className="fontcache",u.style.fontFamily=e,u.style.position="fixed",u.style.marginLeft="-100px",u.style.marginTop="-100px",u.textContent=".",u.style.backgroundColor="blue",u.style.zIndex="9999",document.body.appendChild(u),new Promise(t=>{let i=null,n=!1;function o(){return!!document.fonts&&(document.fonts.check("1em "+e)||document.fonts.check("1px "+e))}function a(){o()&&!n&&(i&&window.clearInterval(i),n=!0,t())}r.a.ie?setTimeout(()=>t(),50):s.onload=()=>{if(document.fonts){"loaded"===document.fonts.status&&o()?t():(document.fonts.ready.then(a),i=window.setInterval(a,100))}else setTimeout(()=>t(),50)}})}))}};var u=i(0);class PromiseQueue{constructor(t=PromiseQueue.MAX_CONCURRENCY){this._queue=[],this._isActive=!1,this._activePromises=0,this._maxConcurrency=t}promise(t,e,...i){let n,r;const o=new Promise((t,e)=>{n=t,r=e});return this._queue.push({creator:t,scope:e,args:i,resolve:n,reject:r,promise:o}),this._isActive||this.next(),o}next(){for(;this._queue.length>0&&this._activePromises<this._maxConcurrency;){this._activePromises++,this._isActive=!0;const t=this._queue.shift();t.creator.call(t.scope,...t.args).then(e=>{t.resolve(e),this._activePromises--,this.next()}).catch(e=>{t.reject(e),this._activePromises--,this.next()})}0===this._queue.length&&(this._isActive=!1)}}PromiseQueue.MAX_CONCURRENCY=6;var l=i(478),c=function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))};const d=new PromiseQueue(1);var p=i(50),f=function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))};const m={test:t=>Object(o.extname)(t).includes(".xml"),load(t){return f(this,void 0,void 0,(function*(){const e=yield fetch(t),i=yield e.text(),n=(new window.DOMParser).parseFromString(i,"text/xml"),r=n.getElementsByTagName("page");for(let e=0;e<r.length;++e){const i=r[e].getAttribute("file"),a=Object(o.join)(Object(o.dirname)(t),i),s=(yield Object(p.c)([a]))[a];u.BitmapText.registerFont(n,s)}}))}};i(29),i(34),i(30);var g=i(36),y=i(32);class SkeletonEntity_SkeletonEntity extends y.a{constructor(t){super(),this.bones=t.slice(0),this.boneInverses=[]}calculateInverses(){this.boneInverses=[];for(let t=0,e=this.bones.length;t<e;t++){const e=new g.a;if(this.bones[t]){if(!this.bones[t].bindMatrix)throw new Error("no bones!");e.getInverse(this.bones[t].bindMatrix)}this.boneInverses.push(e)}}}var v=i(7);const b=new g.a,_=new g.a;class SkinnedComponent_SkinnedComponent{constructor(t,e){this._dataTextureDirty=!0,this.entity=t,this._skeleton=e.skeleton;const i=Math.ceil(Math.sqrt(16*e.skeleton.bones.length/4));this._bonesTextureData=new Float32Array(i*i*4),this.bones=new Float32Array(this._bonesTextureData.buffer,0,16*e.skeleton.bones.length),this.bindMatrix=new g.a(e.bindMatrix),this.bindMatrixInverse=(new g.a).getInverse(this.bindMatrix)}render(){const t=this._skeleton.bones,e=_.getInverse(this.entity.transform.worldTransform);for(let i=0;i<t.length;i++){const n=t[i],r=n.inverseBindMatrix,o=n.transform.worldTransform;b.multiplyMatrices(o,r).premultiply(e);for(let t=0;t<16;t++)this.bones[16*i+t]=b.elements[t]}this._dataTextureDirty=!0}get boneTexture(){if(this._dataTextureDirty){if(!this._boneTexture){const t=Math.ceil(Math.sqrt(16*this._skeleton.bones.length/4));this._boneTexture=v.G.fromBuffer(this._bonesTextureData,t,t)}this._boneTexture.baseTexture.dirtyId++}return this._boneTexture}}SkinnedComponent_SkinnedComponent.DEFAULT_NAME="skinned";var w=i(154),x=i(297);class BoneEntity_BoneEntity extends y.a{constructor(t){super(),this.userData={},this.inverseBindMatrix=t,this.type="Bone",this.isBone=!0}}var C=i(151),S=i(84),T=i(141),A=i(146),E=i(85),P=i(16),M=i(103),I=i(88);class RenderGroupComponent_RenderGroupComponent extends M.a{constructor(t,e={}){super(t),this.toRender=new I.a(e.render),this.toIgnore=new I.a(e.ignore),this._toRenderList=[],this._ignoreNeedsUpdate=!0,this._toIgnoreList=[],this._renderNeedsUpdate=!0}addedToScene(t){t.onEntityAddedToScene.add(this),t.onEntityRemovedFromScene.add(this)}removedFromScene(t){t.onEntityAddedToScene.add(this),t.onEntityRemovedFromScene.add(this)}entityAddedToScene(t){t.view3d&&(this._renderNeedsUpdate=!0,this._ignoreNeedsUpdate=!0)}entityRemovedFromScene(t){t.view3d&&(this._renderNeedsUpdate=!0,this._ignoreNeedsUpdate=!0)}add(t){this.toRender.add(t),this._renderNeedsUpdate=!0}ignore(t){this.toIgnore.add(t),this._ignoreNeedsUpdate=!0}_getFlatList(t){const e={},i=[];return t.run(t=>{e[t.UID]||(e[t.UID]=t,t.view3d&&i.push(t),t.container.traverse(t=>{e[t.UID]||(e[t.UID]=t,t.view3d&&i.push(t))}))}),i}get toRenderList(){return this.entity.scene&&!this._renderNeedsUpdate||(this._toRenderList=this._getFlatList(this.toRender),this._renderNeedsUpdate=!1),this._toRenderList}get toIgnoreList(){return this.entity.scene&&!this._ignoreNeedsUpdate||(this._toIgnoreList=this._getFlatList(this.toIgnore),this._ignoreNeedsUpdate=!1),this._toIgnoreList}}RenderGroupComponent_RenderGroupComponent.DEFAULT_NAME="renderGroup";var k=i(492),O=i(496),R=i(493),D=i(494),L=i(499),N=i(136),B=i(292);const F={name:"shadow",vertex:"\n\n\nattribute vec3 aPosition;\n\nuniform mat4 uShadowProjectionView;\nvarying float vDepth;\n\nvoid main() {\n\n vec4 worldPosition = vec4(aPosition, 1.0);\n mat4 modelMatrix;\n\n {{TRANSFORM}}\n\n {{MAIN}}\n\n gl_Position = uShadowProjectionView * uModelMatrix * worldPosition;\n \n vDepth = ((gl_Position.z/gl_Position.w) * 0.5 + 0.5);\n\n {{END}}\n}\n",fragment:"\nvarying float vDepth;\n\nvoid main()\n{\n vec2 uv;\n float alphaColor = 1.;\n\n {{MATERIAL}}\n\n {{MAIN}}\n\n {{END}}\n \n gl_FragColor = vec4(vDepth, 1., 1., 1.);\n}\n"};class ShadowMaterial_ShadowMaterial extends u.Shader{constructor(t={}){var e;const i=[k.a];t.skinned&&i.push(Object(O.a)(B.a.MAX_BONES)),t.alphaMap&&i.push(R.a,D.a,L.a);const{vertex:n,fragment:r}=Object(N.a)(!1,F,i),o=u.UniformGroup.from({uModelMatrix:new g.a,uAlphaTest:.5,uAlphaMap:null!==(e=t.alphaMap)&&void 0!==e?e:u.Texture.WHITE});super(u.Program.from(n,r),o)}}let z,j,G,U,H;const V=(t,e)=>{const i=t.view3d,n=e.view3d,r=i._geometry,o=n._geometry;r.castToBaseGeometry(),o.castToBaseGeometry();return i.orderBias-n.orderBias||i.shadowMaterial&&n.shadowMaterial?0:i.shadowMaterial?-1:0};class ShadowComponent_ShadowComponent{constructor(t,e){this._bounds=new E.a,z||(z=new P.a(0,1,0),j=new P.a(0,0,0),G=new P.a,U=new P.a,H=new g.a),this.entity=t,this._shadowRenderGroup=t.addComponent(RenderGroupComponent_RenderGroupComponent),this.frequency=1,this._light=e.light;const i=e.size||1024,n=new u.BaseTexture(null,{width:i,height:i,type:u.TYPES.HALF_FLOAT,wrapMode:u.WRAP_MODES.CLAMP,mipmap:u.MIPMAP_MODES.OFF});this._shadowMap=new u.Texture(n),this._shadowFramebuffer=new u.Framebuffer(i,i).addColorTexture(0,n).enableDepth(),this._debugSprite=new u.Sprite(this._shadowMap),this._debugSprite.scale.set(.25),this._shadowMaterial=new ShadowMaterial_ShadowMaterial,this._shadowMaterialSkinned=new ShadowMaterial_ShadowMaterial({skinned:!0}),this._shadowState=new u.State,this._shadowState.depthTest=!0,this._shadowState.culling=!1,this._shadowState.blend=!1,this.bias=void 0===e.bias?.001:e.bias,this.poissonSpread=void 0===e.poissonSpread?2e3:e.poissonSpread;const r=this._light.light.lightId,o={};o["uShadowProjectionView"+r]=new g.a,o["uShadowMap"+r]=this._shadowMap,o["uShadowParams"+r]=new Float32Array(2),this._shadowUniforms=new u.UniformGroup(o,!1),this.refreshRate=1,this._shadowProjectionMatrix=new g.a}addedToScene(t){const e=this._light.light.lightId,i=t.view3d;i.lights.lightUniforms.uniforms["shadow"+e]=this._shadowUniforms,i.onPreDrawScene.add(this)}removedFromScene(t){t.view3d.onPreDrawScene.remove(this)}preDrawScene(){if(this.frequency++%this.refreshRate)return;let t=this._shadowRenderGroup.toRenderList;if(this._shadowRenderGroup.toIgnoreList.length>0&&(t=t.filter(t=>-1===this._shadowRenderGroup.toIgnoreList.indexOf(t))),!this._light.scene||!t.length)return;const e=this.entity.scene.view3d,i=this._light.light.lightId,n=e.renderer,r=G.copy(this._light.light.direction),o=H;if(2===this._light.light.type){const t=this._light.transform.extractPosition(U);r.add(t),o.lookAtMove(t,r,z)}else o.lookAtMove(j,r,z);if(0===this._light.light.type){const e=this._bounds;e.makeEmpty(),t.forEach(t=>{e.expandBySphere(t.view3d.getBoundingSphere())}),e.applyMatrix4(o),this._shadowProjectionMatrix.makeOrthographic(e.min.x,e.max.x,e.min.y,e.max.y,-e.max.z,-e.min.z)}else this._shadowProjectionMatrix.makePerspective(2*this._light.light.radius,1,.1,this._light.light.distance);const a=this._shadowUniforms.uniforms,s=a["uShadowProjectionView"+i];if(a["uShadowParams"+i][0]=this.bias,a["uShadowParams"+i][1]=this.poissonSpread,s.multiplyMatrices(this._shadowProjectionMatrix,o),2===this._light.light.type){const e=new A.a;e.setFromMatrix(s),t=t.filter(t=>{const i=t.view3d;return e.intersectsSphere(i.getBoundingSphere())})}this._shadowUniforms.update();const h=n.framebuffer.current;n.framebuffer.bind(this._shadowFramebuffer),n.framebuffer.clear(1e4,0,0,1),n.state.set(this._shadowState),t.sort(V),t.forEach(t=>{if(!t.scene)return;const e=t.view3d,i=e.geometry;let r=null,o=null;e.shadowMaterial?(r=t.view3d.shadowMaterial,t.skinned&&(r.uniforms.bones=t.skinned.bones)):t.skinned?(r=this._shadowMaterialSkinned,r.uniforms.uBoneMatrices=t.skinned.bones):r=this._shadowMaterial,o=r.uniforms,o.uModelMatrix=t.transform.worldTransform,o.uShadowProjectionView=s,n.shader.bind(r,!1);const a=i.castToBaseGeometry();n.geometry.bind(a),n.geometry.draw(e.draw,i.size,i.start,i.instanceCount)}),n.framebuffer.bind(h)}add(t){this._shadowRenderGroup.add(t)}ignore(t){this._shadowRenderGroup.ignore(t)}}var W=i(278);class LightEntity_LightEntity extends y.a{constructor(t={}){super(),this.light=this.addComponent(W.a,t),this.name=t.name,t.castShadow&&this._addShadowCaster(t.shadowOptions)}_addShadowCaster(t={}){this.shadow||(this.shadow=this.addComponent(ShadowComponent_ShadowComponent,Object.assign(Object.assign({},t),{light:this})))}set intensity(t){this.light.intensity=t}get intensity(){return this.light.intensity}set distance(t){this.light.distance=t}get distance(){return this.light.distance}set color(t){this.light.color=t}get color(){return this.light.color}set softness(t){this.light.softness=t}get softness(){return this.light.softness}}var X=i(152),Y=i(183),q=i(184);const K=new g.a;class gbToOdieParser_SceneLibrary{constructor(t){this.gbObject=t,t.materials||(t.materials=[]),this.geometryHash={},t.geometryBatch&&(this.geometryBatch=t.geometryBatch.map(t=>this._processPrimitive(t))),this.materials={},this.geometries=t.geometry.map(t=>{const e=t.name,i=t.weights;return t.primitives.map((t,n)=>{let r;return r=t.attributes?this._processPrimitive(t):this._processFragPrimitive(t),this.geometryHash[e+" + "+(n||"")]=r,r.castToBaseGeometry().weights=i,r})})}getGeometry(t){const e=this.geometryHash[t];if(!e)throw new Error("Error gb object Geometry "+t+" not found!");return e}getScene(t={}){const e=this.gbObject,i=this.geometries,n=t.materials||{},r=t.mask||[];n.default||(n.default=new X.a);const o=e.nodes.map(o=>{var a;let s;switch(-1!==r.indexOf(o.type)?"masked":o.type){case"bone":s=new BoneEntity_BoneEntity(new g.a(o.inverseBindMatrix));break;case"light":const r=e.lights[o.light];s=new LightEntity_LightEntity(r);break;case"camera":const h=e.cameras[o.camera];s=new C.a(h);break;case"model":if(void 0!==o.skin){const r=i[o.geometry][0],h=this._findMaterial(n,o.name,o.geometry,0,!0);if(s=new y.a({geometry:r,material:h,layerId:t.layerId||"default"}),i[o.geometry].length>1)for(let r=1;r<i[o.geometry].length;r++){const h=this._findMaterial(n,o.name,o.geometry,r,!0),u=new y.a({geometry:i[o.geometry][r],material:h,layerId:t.layerId||"default"});(null===(a=e.materials[r])||void 0===a?void 0:a.name)&&(u.name=e.materials[r].name),s.addChild(u)}}else{const e=this._findMaterial(n,o.name,o.geometry,0,!1);if(s=new y.a({geometry:i[o.geometry][0],material:e,layerId:t.layerId||"default"}),i[o.geometry].length>1)for(let e=1;e<i[o.geometry].length;e++){const r=this._findMaterial(n,o.name,o.geometry,e,!1),a=new y.a({geometry:i[o.geometry][e],material:r,layerId:t.layerId||"default"});s.addChild(a)}}break;default:s=new y.a}return o.transform&&(K.elements=o.transform,s.transform.applyMatrix(K)),s.name=o.name,s});let a=null;e.skins&&(a=e.skins.map(t=>{const e=t.joints.map(t=>o[t]);return new SkeletonEntity_SkeletonEntity(e)})),e.nodes.forEach((t,e)=>{if(void 0!==t.skin){const i=o[e];i.skinned=i.addComponent(SkinnedComponent_SkinnedComponent,{skeleton:a[t.skin]})}}),e.nodes.forEach((t,e)=>{const i=o[e];t.children.forEach(t=>{const e=o[t];i===e||i.addChild(e)})});const s=new y.a;e.scenes.length;if(e.scenes[0].children.forEach(t=>{s.addChild(o[t])}),e.animations.length){const i=e.animations.map((t,e)=>(t.name=String(e),w.a.fromData(t)));s.addComponent(x.a,{animations:i,clips:t.clips,mixes:t.mixes,fps:t.fps}),!1!==(null==t?void 0:t.autoPlay)&&s.getComponent(x.a).play("0")}return s.addComponent(q.a,{map:o},"utils"),s}_processFragPrimitive(t){const e=new T.a({geometry:this.geometryBatch[t.geometry],start:t.start,size:t.size}),i=t.bounds;return e.boundingBox=new E.a(new P.a(i[0],i[1],i[2]),new P.a(i[3],i[4],i[5])),e.boundingSphere=e.boundingBox.getBoundingSphere(new Y.a),e}_processPrimitive(t){var e,i;const n=new S.a,r=t.attributes,o=t.bounds;if(o&&(n.boundingBox=new E.a(new P.a(o[0],o[1],o[2]),new P.a(o[3],o[4],o[5])),n.boundingSphere=n.boundingBox.getBoundingSphere(new Y.a)),n.addAttribute("aPosition",new u.Buffer(r.positions),3),n.addAttribute("aNormal",new u.Buffer(r.normals),3),r.uvs?n.addAttribute("aUv",new u.Buffer(r.uvs),2):n.addAttribute("aUv",new u.Buffer(new Float32Array(r.positions.length/3*2)),2),(null===(e=r.weights)||void 0===e?void 0:e.length)&&(n.addAttribute("aBoneWeights",new u.Buffer(r.weights),4),n.addAttribute("aBoneIndices",new u.Buffer(new Float32Array(r.boneIndices)),4)),r.tangents&&n.addAttribute("aTangents",new u.Buffer(r.tangents)),t.targets){let e;for(let o=0;o<4;o++){const a=t.targets[o];a?(n.addAttribute("aMorphTargetPosition"+(o+1),new u.Buffer(a.positions),3),a.normals||e||(e=new Float32Array(r.positions.length)),n.addAttribute("aMorphTargetNormal"+(o+1),new u.Buffer(null!==(i=a.normals)&&void 0!==i?i:e),3)):(e||(e=new Float32Array(r.positions.length)),n.addAttribute("aMorphTargetPosition"+(o+1),new u.Buffer(e),3),n.addAttribute("aMorphTargetNormal"+(o+1),new u.Buffer(e),3))}}return t.indices&&n.addIndex(new u.Buffer(t.indices)),n}_findMaterial(t,e,i,n,r=!1){var o;const a=this.gbObject.geometry[i].primitives[n];let s=t[e];if(!s){const e=a.material,i=null===(o=this.gbObject)||void 0===o?void 0:o.materials[e];if(t[null==i?void 0:i.name])return t[i.name];if(t[i.name])return t[i.name];s=r&&t.defaultSkinned?t.defaultSkinned:t.default}return s}}const J=new class Cache_CacheSingleton{constructor(){this._map={},this.basePath=""}get(t){if(t=this.basePath+t,this._map[t])return this._map[t];if(t=a.a.normalize(t),this._map[t])return this._map[t];throw new Error('Odie : "'+t+'" does not exist in the cache')}add(t,e){this._map[t]=e}};var Z=i(287),Q=i.n(Z),$=i(190);const tt=new RegExp(/^.*\//).exec(window.location.href)[0];function et(t){return Object($.a)(t)?t:Q()(tt,t)}var it=i(153),nt=function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))};const rt={test:t=>Object(o.extname)(t).includes(".gb"),load(t){return nt(this,void 0,void 0,(function*(){const e=et(t),i=function(t){return new gbToOdieParser_SceneLibrary(t)}(yield it.a.loadGB(e)),n=t.split("?")[0];return J.add(n,i),i}))}};var ot=function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))};const at={test:t=>Object(o.extname)(t).includes(".json"),load(t){return ot(this,void 0,void 0,(function*(){const e=yield fetch(t);return yield e.json()}))}};var st=function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))};const ht={testParse:(t,e)=>Object(o.extname)(e).includes(".json")&&!!t.frames,parse(t,e){return st(this,void 0,void 0,(function*(){let i=Object(o.dirname)(e);i&&i.lastIndexOf("/")!==i.length-1&&(i+="/");const n=i+t.meta.image,r=(yield Object(p.c)([n]))[n],a=e.split(".")[0];u.BaseTexture.addToCache(r.baseTexture,a),u.Texture.addToCache(r,a);const s=new u.Spritesheet(r.baseTexture,t,e);return yield new Promise(t=>{s.parse(t)}),s}))}};var ut=function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))};const lt=[".jpg",".png",".jpeg",".avif",".webp"],ct={test(t){const e=t.split("?")[0];return lt.includes(Object(o.extname)(e))},load(t){return ut(this,void 0,void 0,(function*(){let e=null;if(window.createImageBitmap){const i=et(t);e=yield it.a.loadImageBitmap(i)}else e=yield new Promise(i=>{e=new Image,e.crossOrigin="anonymous",e.src=t,e.complete?i(e):e.onload=()=>{i(e)}});const i=new u.BaseTexture(e,{resolution:u.utils.getResolutionOfUrl(t)}),n=new u.Texture(i);return u.BaseTexture.addToCache(i,t),u.Texture.addToCache(n,t),n}))}};var dt=function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))};class BackgroundLoader_BackgroundLoader{constructor(t=!1){this._assetList=[],this._isLoading=!1,this._maxConcurrent=4,this.verbose=t}add(t){t.forEach(t=>{this._assetList.push(t)}),this.verbose,this._isActive&&!this._isLoading&&this._next()}_next(){return dt(this,void 0,void 0,(function*(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const t=[],e=Math.min(this._assetList.length,this._maxConcurrent);for(let i=0;i<e;i++)t.push(this._assetList.pop());yield Object(p.c)(t),this._isLoading=!1,this._next()}}))}get active(){return this._isActive}set active(t){this._isActive!==t&&(this._isActive=t,t&&!this._isLoading&&this._next())}}function pt(t){Object.values(t.json).forEach(t=>{p.b[t.shortcut]=p.b[t.default]})}function ft(t){for(const e in t.model){const i=t.model[e],n=i.default;if(!n)continue;if("gb"===n.substr(n.lastIndexOf(".")+1)&&i.shortcut){const t=J.get(n),e="."+n.split(".")[1];J.add(i.shortcut.split(".")[0]+e,t)}}}function mt(t,e,i,n){if(t[e].standard)for(let r=0;r<n.length;r++){const o=n[r];if(t[e][o]&&t[e][o][i])return t[e][o][i]}return t[e][i]||t[e].default}function gt(t,e="default",i="",n){for(const r in t.image){const o=t.image[r],a=mt(t.image,r,e,n)||o.standard.default;if(!a)continue;if(!("json"!==a.substr(a.lastIndexOf(".")+1)))continue;const s=u.Texture.from(i+a);s.constructor===u.Texture&&(u.Texture.addToCache(s,o.standard.default),o.shortcut&&u.Texture.addToCache(s,o.shortcut))}}function yt(t,e=!1){for(const i in t){const n=t[i];let r=i;n.tags&&n.tags.tps&&(r+="_image");const o=u.utils.BaseTextureCache[r];o&&(n.tags&&(n.tags.REPEAT&&(o.wrapMode=u.WRAP_MODES.REPEAT),n.tags.NEAREST&&(o.scaleMode=u.SCALE_MODES.NEAREST)),e&&(!n.tags||n.tags&&!n.tags.high)&&(o.type=u.TYPES.UNSIGNED_SHORT_4_4_4_4))}}function vt(t,e,i,n,r,o=20){return new Promise(a=>{const s=[];for(const n in t){const o=t[n];let a=mt(t,n,e,r);o.tags&&o.tags.tps&&(a+="_image");const h=u.utils.BaseTextureCache[i+a];h&&s.push(h)}let h=0;const l=()=>{for(let t=0;t<o;t++){if(h===s.length){u.Ticker.system.remove(l,this),a();break}n.texture.destroyTexture(s[h],!0),h++}};u.Ticker.system.add(l,this)})}function bt(t,e,i,n,r,o=20){return new Promise(a=>{const s=[];for(const n in t){const o=t[n];let a=mt(t,n,e,r);o.tags&&o.tags.tps&&(a=a.split(".").slice(0,-1).join("."));const h=u.utils.BaseTextureCache[i+a];h&&(o.tags&&(o.tags[4444]&&(h.type=u.TYPES.UNSIGNED_SHORT_4_4_4_4),o.tags.nearest&&(h.scaleMode=u.SCALE_MODES.NEAREST)),h.isPowerOfTwo&&(h.wrapMode=u.WRAP_MODES.REPEAT),s.push(h))}let h=0;const l=()=>{for(let t=0;t<o;t++){if(h===s.length){u.Ticker.system.remove(l,this),a();break}n.texture.bind(s[h]),h++}};u.Ticker.system.add(l,this)})}var _t=function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))};Object(p.a)([ct,at,ht,rt,m,h]);const wt=new class ResourceManager_ResourceManagerClass{constructor(){this.onLoadProgress=new n.Signal,this.onLoadStart=new n.Signal,this.onLoadComplete=new n.Signal,this.backgroundLoader=new BackgroundLoader_BackgroundLoader,this._uploadTexturesOnLoad=!0,this._filesToSkip=["ttf","html","css","mp4","js"]}init(t){var e,i,n,o;const a=t.manifest;if(!a)throw new Error("Resource manager expects a manifest");this._imageFormatPreference=function(t){const e=r.a.supportedFileFormats.webp,i=r.a.supportedFileFormats.avif,n=t||["avif","webp","standard"];return e?(i||n.includes("avif")&&n.splice(n.findIndex(t=>"avif"===t),1),n):["standard"]}(t.imageFormatPreference),this._basePath=t.basePath,this._renderer=t.renderer,t.disableGarbageCollection&&(this._renderer.textureGC.mode=1),this._manifest=a,function(t,e){Object.keys(t).forEach(i=>{const n=i.substring(i.lastIndexOf("/")+1);if(t[n]||(t[n]=t[i]),i.startsWith(e)){const n=i.split(e)[1];n&&!t[n]&&(t[n]=t[i])}})}(a,t.manifestBasePath||"assets/"),this._version=t.version||"default",this._uploadTexturesOnLoad=null!==(e=t.uploadTexturesOnLoad)&&void 0!==e&&e,this._canOptimise=null!==(i=t.canOptimise)&&void 0!==i&&i,this._verbose=!!t.verbose||!1,this._canCacheBust=null!==(n=t.canCacheBust)&&void 0!==n&&n,this._uploadTexturesOnLoad&&Object(p.a)(function(t,e=!1){return{testParse:t=>t instanceof u.Texture,parse(i){return new Promise(n=>{i.baseTexture.isPowerOfTwo&&(i.baseTexture.wrapMode=u.WRAP_MODES.REPEAT),d.promise(()=>c(this,void 0,void 0,(function*(){var r,o;yield Object(l.a)(1),t.texture.bind(i),!e&&(null===(o=null===(r=i.baseTexture.resource)||void 0===r?void 0:r.source)||void 0===o?void 0:o.close)&&i.baseTexture.resource.source.close(),n(i)})),this)})}}}(this._renderer,null===(o=t.preserveImageBitmap)||void 0===o||o))}load(t,e={}){var i;return _t(this,void 0,void 0,(function*(){this.backgroundLoader.active=!1;const n=this.getManifestFromIds(t),r=this._version;this._verbose;const o=this._collectAssetsFromManifests(n);this.onLoadStart.emit(),this.onLoadProgress.emit(0),yield Object(p.c)(o,t=>{this.onLoadProgress.emit(100*t)}),this._verbose;for(let t=0;t<n.length;t++){const o=n[t];o.loaded||(gt(o,r,this._basePath,this._imageFormatPreference),ft(o),pt(o)),o.loaded=!0,o.formated||(yt(o.image,this._canOptimise),o.formated=!0),(null!==(i=e.uploadTexturesOnLoad)&&void 0!==i?i:this._uploadTexturesOnLoad)&&(o.uploaded||(yield bt(o.image,this._version,this._basePath,this._renderer,this._imageFormatPreference),o.uploaded=!0))}this.backgroundLoader.active=!0,this.onLoadComplete.emit()}))}backgroundLoad(t){const e=this.getManifestFromIds(t),i=this._collectAssetsFromManifests(e);this.backgroundLoader.add(i)}_collectAssetsFromManifests(t){const e=(new Date).getTime(),i=[];for(let n=0;n<t.length;n++){const r=t[n];if(!r.loaded)for(const t in r){const n=r[t];if("audio"!==t)for(const r in n){const o=n;let a=!1;if("misc"===t){const t=o[r].default.split(".").pop();-1!==this._filesToSkip.indexOf(t)&&(a=!0)}if("fonts"===t){let t=this._basePath+o[r].woff2;this._canCacheBust&&(t+="?cache="+e),i.push(t),a=!0}if(!a){let t=this._basePath+mt(o,r,this._version||"default",this._imageFormatPreference);this._canCacheBust&&(t+="?cache="+e),i.push(t)}}}}return i}unload(t){return _t(this,void 0,void 0,(function*(){const e=this.getManifestFromIds(t);for(let t=0;t<e.length;t++){const i=e[t];i.uploaded&&(yield vt(i.image,this._version,this._basePath,this._renderer,this._imageFormatPreference),i.uploaded=!1)}}))}areManifestsLoaded(t){return this.getManifestFromIds(t).every(t=>t.loaded)}hasManifestFor(t){return!!this._manifest[t]}getManifestFromIds(t){t instanceof Array||(t=[t]);return(t=Array.from(new Set(t))).map(t=>{if("string"==typeof t){if(!this._manifest[t])throw new Error(t+" does not exist in manifest");return this._manifest[t]}return t})}loadTexture(t){return _t(this,void 0,void 0,(function*(){return(yield Object(p.c)([t]))[t]}))}loadAsset(t){return _t(this,void 0,void 0,(function*(){const e=this._basePath+t;return(yield Object(p.c)([e]))[t]}))}getJson(t){return p.b[this._basePath+t]}getAsset(t){return p.b[this._basePath+t]}}},,function(t,e,i){var n=i(193),r=i(112);t.exports=function(t){return n(r(t))}},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,e,i){var n=i(113);t.exports=n("navigator","userAgent")||""},function(t,e,i){var n,r=i(79),o=i(317),a=i(166),s=i(165),h=i(322),u=i(198),l=i(167),c=l("IE_PROTO"),d=function(){},p=function(t){return"<script>"+t+"<\/script>"},f=function(t){t.write(p("")),t.close();var e=t.parentWindow.Object;return t=null,e},m=function(){try{n=new ActiveXObject("htmlfile")}catch(t){}var t,e;m="undefined"!=typeof document?document.domain&&n?f(n):((e=u("iframe")).style.display="none",h.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(p("document.F=Object")),t.close(),t.F):f(n);for(var i=a.length;i--;)delete m.prototype[a[i]];return m()};s[c]=!0,t.exports=Object.create||function(t,e){var i;return null!==t?(d.prototype=r(t),i=new d,d.prototype=null,i[c]=t):i=m(),void 0===e?i:o(i,e)}},function(t,e,i){var n=i(113),r=i(196);t.exports=r?function(t){return"symbol"==typeof t}:function(t){var e=n("Symbol");return"function"==typeof e&&Object(t)instanceof e}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,i){var n=i(58),r=i(100),o=i(167),a=i(330),s=o("IE_PROTO"),h=Object.prototype;t.exports=a?Object.getPrototypeOf:function(t){return t=r(t),n(t,s)?t[s]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?h:null}},function(t,e,i){var n=i(129);t.exports=function(t){if(n(t))throw TypeError("Cannot convert a Symbol value to a string");return String(t)}},function(t,e,i){"use strict";var n,r,o,a=i(206),s=i(70),h=i(45),u=i(59),l=i(58),c=i(174),d=i(73),p=i(116),f=i(71).f,m=i(131),g=i(117),y=i(49),v=i(162),b=h.Int8Array,_=b&&b.prototype,w=h.Uint8ClampedArray,x=w&&w.prototype,C=b&&m(b),S=_&&m(_),T=Object.prototype,A=T.isPrototypeOf,E=y("toStringTag"),P=v("TYPED_ARRAY_TAG"),M=v("TYPED_ARRAY_CONSTRUCTOR"),I=a&&!!g&&"Opera"!==c(h.opera),k=!1,O={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},R={BigInt64Array:8,BigUint64Array:8},D=function(t){if(!u(t))return!1;var e=c(t);return l(O,e)||l(R,e)};for(n in O)(o=(r=h[n])&&r.prototype)?d(o,M,r):I=!1;for(n in R)(o=(r=h[n])&&r.prototype)&&d(o,M,r);if((!I||"function"!=typeof C||C===Function.prototype)&&(C=function(){throw TypeError("Incorrect invocation")},I))for(n in O)h[n]&&g(h[n],C);if((!I||!S||S===T)&&(S=C.prototype,I))for(n in O)h[n]&&g(h[n].prototype,S);if(I&&m(x)!==S&&g(x,S),s&&!l(S,E))for(n in k=!0,f(S,E,{get:function(){return u(this)?this[P]:void 0}}),O)h[n]&&d(h[n],P,n);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:I,TYPED_ARRAY_CONSTRUCTOR:M,TYPED_ARRAY_TAG:k&&P,aTypedArray:function(t){if(D(t))return t;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(t){if(g&&!A.call(C,t))throw TypeError("Target is not a typed array constructor");return t},exportTypedArrayMethod:function(t,e,i){if(s){if(i)for(var n in O){var r=h[n];if(r&&l(r.prototype,t))try{delete r.prototype[t]}catch(t){}}S[t]&&!i||p(S,t,i?e:I&&_[t]||e)}},exportTypedArrayStaticMethod:function(t,e,i){var n,r;if(s){if(g){if(i)for(n in O)if((r=h[n])&&l(r,t))try{delete r[t]}catch(t){}if(C[t]&&!i)return;try{return p(C,t,i?e:I&&C[t]||e)}catch(t){}}for(n in O)!(r=h[n])||r[t]&&!i||p(r,t,e)}},isView:function(t){if(!u(t))return!1;var e=c(t);return"DataView"===e||l(O,e)||l(R,e)},isTypedArray:D,TypedArray:C,TypedArrayPrototype:S}},function(t,e,i){"use strict";var n=i(334),r=i(336);function o(){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}e.parse=b,e.resolve=function(t,e){return b(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?b(t,!1,!0).resolveObject(e):e},e.format=function(t){r.isString(t)&&(t=b(t));return t instanceof o?t.format():o.prototype.format.call(t)},e.Url=o;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,h=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(u),c=["%","/","?",";","#"].concat(l),d=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=i(337);function b(t,e,i){if(t&&r.isObject(t)&&t instanceof o)return t;var n=new o;return n.parse(t,e,i),n}o.prototype.parse=function(t,e,i){if(!r.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),s=-1!==o&&o<t.indexOf("#")?"?":"#",u=t.split(s);u[0]=u[0].replace(/\\/g,"/");var b=t=u.join(s);if(b=b.trim(),!i&&1===t.split("#").length){var _=h.exec(b);if(_)return this.path=b,this.href=b,this.pathname=_[1],_[2]?(this.search=_[2],this.query=e?v.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var w=a.exec(b);if(w){var x=(w=w[0]).toLowerCase();this.protocol=x,b=b.substr(w.length)}if(i||w||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var C="//"===b.substr(0,2);!C||w&&g[w]||(b=b.substr(2),this.slashes=!0)}if(!g[w]&&(C||w&&!y[w])){for(var S,T,A=-1,E=0;E<d.length;E++){-1!==(P=b.indexOf(d[E]))&&(-1===A||P<A)&&(A=P)}-1!==(T=-1===A?b.lastIndexOf("@"):b.lastIndexOf("@",A))&&(S=b.slice(0,T),b=b.slice(T+1),this.auth=decodeURIComponent(S)),A=-1;for(E=0;E<c.length;E++){var P;-1!==(P=b.indexOf(c[E]))&&(-1===A||P<A)&&(A=P)}-1===A&&(A=b.length),this.host=b.slice(0,A),b=b.slice(A),this.parseHost(),this.hostname=this.hostname||"";var M="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!M)for(var I=this.hostname.split(/\./),k=(E=0,I.length);E<k;E++){var O=I[E];if(O&&!O.match(p)){for(var R="",D=0,L=O.length;D<L;D++)O.charCodeAt(D)>127?R+="x":R+=O[D];if(!R.match(p)){var N=I.slice(0,E),B=I.slice(E+1),F=O.match(f);F&&(N.push(F[1]),B.unshift(F[2])),B.length&&(b="/"+B.join(".")+b),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),M||(this.hostname=n.toASCII(this.hostname));var z=this.port?":"+this.port:"",j=this.hostname||"";this.host=j+z,this.href+=this.host,M&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[x])for(E=0,k=l.length;E<k;E++){var G=l[E];if(-1!==b.indexOf(G)){var U=encodeURIComponent(G);U===G&&(U=escape(G)),b=b.split(G).join(U)}}var H=b.indexOf("#");-1!==H&&(this.hash=b.substr(H),b=b.slice(0,H));var V=b.indexOf("?");if(-1!==V?(this.search=b.substr(V),this.query=b.substr(V+1),e&&(this.query=v.parse(this.query)),b=b.slice(0,V)):e&&(this.search="",this.query={}),b&&(this.pathname=b),y[x]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){z=this.pathname||"";var W=this.search||"";this.path=z+W}return this.href=this.format(),this},o.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",i=this.pathname||"",n=this.hash||"",o=!1,a="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&r.isObject(this.query)&&Object.keys(this.query).length&&(a=v.stringify(this.query));var s=this.search||a&&"?"+a||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||y[e])&&!1!==o?(o="//"+(o||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),e+o+(i=i.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(s=s.replace("#","%23"))+n},o.prototype.resolve=function(t){return this.resolveObject(b(t,!1,!0)).format()},o.prototype.resolveObject=function(t){if(r.isString(t)){var e=new o;e.parse(t,!1,!0),t=e}for(var i=new o,n=Object.keys(this),a=0;a<n.length;a++){var s=n[a];i[s]=this[s]}if(i.hash=t.hash,""===t.href)return i.href=i.format(),i;if(t.slashes&&!t.protocol){for(var h=Object.keys(t),u=0;u<h.length;u++){var l=h[u];"protocol"!==l&&(i[l]=t[l])}return y[i.protocol]&&i.hostname&&!i.pathname&&(i.path=i.pathname="/"),i.href=i.format(),i}if(t.protocol&&t.protocol!==i.protocol){if(!y[t.protocol]){for(var c=Object.keys(t),d=0;d<c.length;d++){var p=c[d];i[p]=t[p]}return i.href=i.format(),i}if(i.protocol=t.protocol,t.host||g[t.protocol])i.pathname=t.pathname;else{for(var f=(t.pathname||"").split("/");f.length&&!(t.host=f.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==f[0]&&f.unshift(""),f.length<2&&f.unshift(""),i.pathname=f.join("/")}if(i.search=t.search,i.query=t.query,i.host=t.host||"",i.auth=t.auth,i.hostname=t.hostname||t.host,i.port=t.port,i.pathname||i.search){var m=i.pathname||"",v=i.search||"";i.path=m+v}return i.slashes=i.slashes||t.slashes,i.href=i.format(),i}var b=i.pathname&&"/"===i.pathname.charAt(0),_=t.host||t.pathname&&"/"===t.pathname.charAt(0),w=_||b||i.host&&t.pathname,x=w,C=i.pathname&&i.pathname.split("/")||[],S=(f=t.pathname&&t.pathname.split("/")||[],i.protocol&&!y[i.protocol]);if(S&&(i.hostname="",i.port=null,i.host&&(""===C[0]?C[0]=i.host:C.unshift(i.host)),i.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===f[0]?f[0]=t.host:f.unshift(t.host)),t.host=null),w=w&&(""===f[0]||""===C[0])),_)i.host=t.host||""===t.host?t.host:i.host,i.hostname=t.hostname||""===t.hostname?t.hostname:i.hostname,i.search=t.search,i.query=t.query,C=f;else if(f.length)C||(C=[]),C.pop(),C=C.concat(f),i.search=t.search,i.query=t.query;else if(!r.isNullOrUndefined(t.search)){if(S)i.hostname=i.host=C.shift(),(M=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=M.shift(),i.host=i.hostname=M.shift());return i.search=t.search,i.query=t.query,r.isNull(i.pathname)&&r.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!C.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var T=C.slice(-1)[0],A=(i.host||t.host||C.length>1)&&("."===T||".."===T)||""===T,E=0,P=C.length;P>=0;P--)"."===(T=C[P])?C.splice(P,1):".."===T?(C.splice(P,1),E++):E&&(C.splice(P,1),E--);if(!w&&!x)for(;E--;E)C.unshift("..");!w||""===C[0]||C[0]&&"/"===C[0].charAt(0)||C.unshift(""),A&&"/"!==C.join("/").substr(-1)&&C.push("");var M,I=""===C[0]||C[0]&&"/"===C[0].charAt(0);S&&(i.hostname=i.host=I?"":C.length?C.shift():"",(M=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=M.shift(),i.host=i.hostname=M.shift()));return(w=w||i.host&&C.length)&&!I&&C.unshift(""),C.length?i.pathname=C.join("/"):(i.pathname=null,i.path=null),r.isNull(i.pathname)&&r.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},o.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,i){"use strict";var n=i(94);i.d(e,"a",(function(){return n.a}));n.a.registerVersion("firebase","8.9.1","app"),n.a.SDK_VERSION="8.9.1"},function(t,e,i){"use strict";i.d(e,"a",(function(){return p}));i(56);var n=i(224),r=i(225);const o={vertex:"\n #version 300 es\n #define WEBGL2\n {{PRECISION}}\n {{EXTENSIONS}}\n #define texture2D texture\n #define textureCube texture\n #define varying out\n #define attribute in\n ",fragment:"\n #version 300 es\n #define WEBGL2\n {{PRECISION}}\n {{EXTENSIONS}}\n #define varying in\n #define texture2D texture\n #define textureCube texture\n #define gl_FragColor color\n out vec4 color;\n "},a={vertex:"\n #version 100\n {{PRECISION}}\n {{EXTENSIONS}}\n ",fragment:"\n #version 100\n {{PRECISION}}\n {{EXTENSIONS}}\n "},s=/\{\{(.*?)\}\}/g;function h(t){var e,i;const n={};return(null!==(i=null===(e=t.match(s))||void 0===e?void 0:e.map(t=>t.replace(/[{()}]/g,"")))&&void 0!==i?i:[]).forEach(t=>{n[t]=[]}),n}const u={};let l=1;function c(t,e,i){if(t)for(const n in t)if("header"!==n){const r=e[n.toUpperCase()];r&&(i&&r.push("//----"+i+"----//"),r.push(t[n]))}}function d(t,e){let i=t;for(const t in e){const n=e[t];i=n.join("\n").length?i.replace("{{"+t+"}}","//-----"+t+" START-----//\n"+n.join("\n")+"\n//----"+t+" FINISH----//"):i.replace("{{"+t+"}}","")}return i}function p(t,e,i,s){var p,f;const m=i.map(t=>(t.cache||(t.cache=l++),t.cache)).sort((t,e)=>t-e).join("-");if(u[m])return u[m];const g=s?Object(n.a)(s):"",y=Object(r.a)(i,t),v=t?o:a,b=v.vertex.replace("{{EXTENSIONS}}",y.vertex.extensions).replace("{{PRECISION}}","precision highp float;"),_=v.fragment.replace("{{EXTENSIONS}}",y.fragment.extensions).replace("{{PRECISION}}","precision highp float;"),w=h(e.vertex),x=h(e.fragment);i.forEach(e=>{c(t&&e.vertex2?e.vertex2:e.vertex,w,e.name),c(t&&e.fragment2?e.fragment2:e.fragment,x,e.name)});let C=d(e.vertex,w),S=d(e.fragment,x);const T="#define SHADER_NAME "+(null!==(p=e.name)&&void 0!==p?p:"high")+"-vert",A="#define SHADER_NAME "+(null!==(f=e.name)&&void 0!==f?f:"high")+"-frag";return C=b+"\n"+T+"\n\n"+g+"\n\n"+y.vertex.variables+"\n"+C,S=_+"\n"+A+"\n\n"+g+"\n\n"+y.fragment.variables+"\n"+S,u[m]={vertex:C,fragment:S},u[m]}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Matrix3}));i(29),i(34),i(30);class Matrix3{constructor(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1])}set(t,e,i,n,r,o,a,s,h){const u=this.elements;return u[0]=t,u[1]=n,u[2]=a,u[3]=e,u[4]=r,u[5]=s,u[6]=i,u[7]=o,u[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}clone(){return(new Matrix3).fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,r=this.elements,o=i[0],a=i[3],s=i[6],h=i[1],u=i[4],l=i[7],c=i[2],d=i[5],p=i[8],f=n[0],m=n[3],g=n[6],y=n[1],v=n[4],b=n[7],_=n[2],w=n[5],x=n[8];return r[0]=o*f+a*y+s*_,r[3]=o*m+a*v+s*w,r[6]=o*g+a*b+s*x,r[1]=h*f+u*y+l*_,r[4]=h*m+u*v+l*w,r[7]=h*g+u*b+l*x,r[2]=c*f+d*y+p*_,r[5]=c*m+d*v+p*w,r[8]=c*g+d*b+p*x,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],o=t[4],a=t[5],s=t[6],h=t[7],u=t[8];return e*o*u-e*a*h-i*r*u+i*a*s+n*r*h-n*o*s}getInverse(t,e){const i=t.elements,n=this.elements,r=i[0],o=i[1],a=i[2],s=i[3],h=i[4],u=i[5],l=i[6],c=i[7],d=i[8],p=d*h-u*c,f=u*l-d*s,m=c*s-h*l,g=r*p+o*f+a*m;if(0===g){const t="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(t);return this.identity()}const y=1/g;return n[0]=p*y,n[1]=(a*c-d*o)*y,n[2]=(u*o-a*h)*y,n[3]=f*y,n[4]=(d*r-a*l)*y,n[5]=(a*s-u*r)*y,n[6]=m*y,n[7]=(o*l-c*r)*y,n[8]=(h*r-o*s)*y,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).getInverse(this).transpose()}transposeIntoArray(t){const e=this.elements;return 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],this}setUvTransform(t,e,i,n,r,o,a){const s=Math.cos(r),h=Math.sin(r);return this.set(i*s,i*h,-i*(s*o+h*a)+o+t,-n*h,n*s,-n*(-h*o+s*a)+a+e,0,0,1),this}scale(t,e){const i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=e,i[4]*=e,i[7]*=e,this}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.elements,r=n[0],o=n[3],a=n[6],s=n[1],h=n[4],u=n[7];return n[0]=e*r+i*s,n[3]=e*o+i*h,n[6]=e*a+i*u,n[1]=-i*r+e*s,n[4]=-i*o+e*h,n[7]=-i*a+e*u,this}translate(t,e){const i=this.elements;return i[0]+=t*i[2],i[3]+=t*i[5],i[6]+=t*i[8],i[1]+=e*i[2],i[4]+=e*i[5],i[7]+=e*i[8],this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<9;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e){void 0===e&&(e=0);for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t,e){void 0===t&&(t=[0,0,0,0,0,0,0,0,0]),void 0===e&&(e=0);const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Entity}));i(9);var n=i(37),r=i(139),o=i(39),a=i(103);let s=0;class Entity{constructor(){this.UID=s++,this.name="item"+this.UID,this.groups=[],this.runners={init:new o.a("init",1),addedToScene:new o.a("addedToScene",1),start:new o.a("start"),update:new o.a("update",1),render:new o.a("render",2),removedFromScene:new o.a("removedFromScene",1),reset:new o.a("reset"),activate:new o.a("activate"),deactivate:new o.a("deactivate"),destroy:new o.a("destroy")},this.signals={onDestroyed:new n.Signal},this._gc=!1,this._adding=!1,this._components=new Map}init(t){var e;this.data=t;const i=this.runners.init.items;for(let n=0;n<i.length;n++){const r=i[n];r.init(null===(e=t)||void 0===e?void 0:e[r.name])}}reset(){this._destroyed=!1,this._gc=!1,this._adding=!1,this.runners.reset.run(),this._components.forEach(t=>{if(t.signals){const e=t.signals;for(const t in e)e[t].disconnectAll()}});for(const t in this.signals)this.signals[t].disconnectAll()}destroy(){this._destroyed||(this._destroyed=!0,this.scene&&this.scene.removeFromScene(this),this.runners.destroy.run(this),this.signals.onDestroyed.emit(this))}addComponent(t,e,i){var n,o;if(i=i||Object(r.a)(t),this._components.has(t))throw new Error("[Entity] "+i+" component already exists");const a=new t(this,e);a.name=i,this._components.set(t,a);for(const t in this.runners)this.runners[t].add(a);return this._checkRenderAndUpdate(),null===(n=a.addedToEntity)||void 0===n||n.call(a,this),this.scene&&(null===(o=a.addedToScene)||void 0===o||o.call(a,this.scene)),a}getComponent(t){return this._components.get(t)}removeComponent(t){var e,i;const n=this._components.get(t);if(!n)return this;for(const t in this.runners)this.runners[t].remove(n);return null===(e=n.removedFromEntity)||void 0===e||e.call(n,this),this._checkRenderAndUpdate(),null===(i=n.reset)||void 0===i||i.call(n),this._components.delete(t),this}addSelf(){this.runners.start.add(this),this.runners.update.add(this),this.runners.render.add(this),this.runners.addedToScene.add(this),this.runners.removedFromScene.add(this),this.runners.activate.add(this),this.runners.deactivate.add(this)}addScript(t){const e=a.a.create(this.name+"_"+this.constructor.name,t);return this.addComponent(e)}_checkRenderAndUpdate(){this.scene&&(this._checkRunner(this.runners.render,this.scene._onRenderEntities),this._checkRunner(this.runners.update,this.scene._onUpdateEntities))}_checkRunner(t,e){const i=t;e.contains(i)===i.empty&&(i.empty?e.remove(i):e.add(i))}}},function(t,e,i){"use strict";function n(t){let e=t.DEFAULT_NAME;if(!e){e=t.name;const i=e.split("_");i[0]===i[1]&&(e=i[0]),e=e[0].toLowerCase()+e.slice(1)}return e}i.d(e,"a",(function(){return n}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return Euler}));var n=i(67),r=i(36),o=i(74);class Euler{constructor(t,e,i,n){this.x=t||0,this.y=e||0,this.z=i||0,this.order=n||Euler.DefaultOrder}set(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.order=n||this.order,this}clone(){return new Euler(this.x,this.y,this.z,this.order)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.order=t.order,this}setFromRotationMatrix(t,e){const i=t.elements,r=i[0],o=i[4],a=i[8],s=i[1],h=i[5],u=i[9],l=i[2],c=i[6],d=i[10];return"XYZ"===(e=e||this.order)?(this.y=Math.asin(Object(n.a)(a,-1,1)),Math.abs(a)<.99999?(this.x=Math.atan2(-u,d),this.z=Math.atan2(-o,r)):(this.x=Math.atan2(c,h),this.z=0)):"YXZ"===e?(this.x=Math.asin(-Object(n.a)(u,-1,1)),Math.abs(u)<.99999?(this.y=Math.atan2(a,d),this.z=Math.atan2(s,h)):(this.y=Math.atan2(-l,r),this.z=0)):"ZXY"===e?(this.x=Math.asin(Object(n.a)(c,-1,1)),Math.abs(c)<.99999?(this.y=Math.atan2(-l,d),this.z=Math.atan2(-o,h)):(this.y=0,this.z=Math.atan2(s,r))):"ZYX"===e?(this.y=Math.asin(-Object(n.a)(l,-1,1)),Math.abs(l)<.99999?(this.x=Math.atan2(c,d),this.z=Math.atan2(s,r)):(this.x=0,this.z=Math.atan2(-o,h))):"YZX"===e?(this.z=Math.asin(Object(n.a)(s,-1,1)),Math.abs(s)<.99999?(this.x=Math.atan2(-u,h),this.y=Math.atan2(-l,r)):(this.x=0,this.y=Math.atan2(a,d))):"XZY"===e&&(this.z=Math.asin(-Object(n.a)(o,-1,1)),Math.abs(o)<.99999?(this.x=Math.atan2(c,h),this.y=Math.atan2(a,r)):(this.x=Math.atan2(-u,d),this.y=0)),this.order=e,this}setFromQuaternion(t,e){return a.makeRotationFromQuaternion(t),this.setFromRotationMatrix(a,e)}setFromVector3(t,e){return this.set(t.x,t.y,t.z,e||this.order)}reorder(t){return s.setFromEuler(this),this.setFromQuaternion(s,t)}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.order===this.order}toVector3(t){return t.set(this.x,this.y,this.z)}}Euler.DefaultOrder="XYZ";const a=new r.a,s=new o.a},function(t,e,i){"use strict";i.d(e,"a",(function(){return GeometryFragment}));class GeometryFragment{constructor(t){this.id=t.id,this.baseGeometry=t.geometry,this.start=t.start,this.size=t.size}castToBaseGeometry(){return this.baseGeometry}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Attractable}));var n=i(28),r=i(10),o=i(13),a=i(65),s=i(18);function h(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Attractable extends s.a{constructor(t,e={sneakersOnly:!1}){super(t,e),h(this,"startPosition",void 0),h(this,"endPosition",void 0),h(this,"speedX",void 0),h(this,"speedY",void 0),h(this,"speedZ",void 0),h(this,"attracted",!1),h(this,"duration",0),h(this,"time",0),h(this,"sneakersOnly",!1),this.startPosition=new a.a,this.endPosition=new a.a,this.sneakersOnly=e.sneakersOnly}respawn(){this.speedX=o.a.range(.001,.005),this.speedY=o.a.range(.001,.005),this.speedZ=o.a.range(.001,.005),this.attracted=!1,this.entity.body.movable=!1}update(t){const e=t.frameTime;if(!this.entity.game||!this.entity.active)return;const i=this.entity.game.hero;if(this.attracted&&this.entity.game.state!==n.a.RUNNING&&(this.attracted=!1,this.entity.active=!1),this.attracted&&this.attractionUpdate(e),!this.attracted&&this.entity.game.state===n.a.RUNNING)if(i.magnet.isOn()&&!this.sneakersOnly){this.entity.body.center.distance(i.body.center)<110&&this.attractionStart()}else if(i.sneakers.isOn()){const t=Math.abs(this.entity.body.x-i.body.x),e=i.body.y-this.entity.body.y,n=Math.abs(i.body.z-this.entity.body.z);i.body.airborne&&t<10&&e>0&&e<50&&n<50&&this.attractionStart()}}attractionStart(){this.attracted=!0,this.entity.movable&&this.entity.movable.reset();const t=this.entity.game.hero;this.entity.body.movable=!0,this.entity.body.ghost=!0,this.startPosition.x=this.entity.body.x,this.startPosition.y=this.entity.body.y,this.startPosition.z=this.entity.body.z,this.endPosition.x=t.body.x,this.endPosition.y=t.body.y,this.endPosition.z=t.body.z+t.body.velocity.z;const e=this.startPosition.distance(this.endPosition);this.duration=.2*e,this.duration<4&&(this.duration=4),this.time=0}attractionUpdate(t){const e=this.entity.game.hero,i=this.time/this.duration;this.endPosition.x=e.body.x,this.endPosition.y=e.body.y,this.endPosition.z=e.body.z+2*e.body.velocity.z,r.a.lerpVec3(this.entity.body,this.startPosition,this.endPosition,i*i),this.time+=t}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Collectible}));var n=i(18);class Collectible extends n.a{constructor(t,e={}){var i,n,r;super(t,e),r=!1,(n="collected")in(i=this)?Object.defineProperty(i,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):i[n]=r,this.collected=!1}respawn(){this.collected=!1,this.entity.scale.set(1)}collect(t){this.collected||(this.collected=!0,this.entity.scale.set(1e-4),this.entity.active=!1,this.entity.body&&(this.entity.body.movable=!1,this.entity.body.velocity.reset()),this.entity.attractable&&(this.entity.attractable.attracted=!1),this.entity.onCollect&&this.entity.onCollect(t))}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Movable}));var n=i(28),r=i(18);function o(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function a(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?o(Object(i),!0).forEach((function(e){s(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):o(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function s(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const h={speed:0};class Movable extends r.a{constructor(t,e={}){super(t,a(a({},h),e)),s(this,"speed",0),s(this,"target",0),s(this,"origin",0),s(this,"lastDest",null),this.speed=this.data.speed,this.lastDest=null}reset(){this.speed=0,this.entity.body.movable=!1,this.entity.body.velocity.reset()}update(){if(this.entity.game.state!==n.a.RUNNING)return void(this.entity.body.velocity.z=0);if(!this.speed||!this.entity.active)return;null!==this.lastDest&&(this.entity.body.back=this.lastDest,this.entity.body.origin.back=this.lastDest);const t=this.target-this.entity.game.stats.z,e=this.origin+t*this.speed,i=e-this.entity.body.back;this.entity.body.velocity.z=i,this.lastDest=e}run(t,e){this.speed=t,this.origin=this.entity.body.back,this.target=e,this.lastDest=this.origin,this.entity.body.movable=this.speed>0}}},function(t,e,i){"use strict";i.d(e,"b",(function(){return h})),i.d(e,"a",(function(){return Lane}));var n=i(39),r=i(2),o=i(10),a=i(18);function s(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}let h;!function(t){t[t.LEFT=-1]="LEFT",t[t.CENTRAL=0]="CENTRAL",t[t.RIGHT=1]="RIGHT"}(h||(h={}));class Lane extends a.a{constructor(t){super(t),s(this,"onBumpSideways",void 0),s(this,"onLaneChanged",void 0),s(this,"lane",0),s(this,"last",0),s(this,"absStep",0),s(this,"changing",!1),s(this,"changeStartX",0),s(this,"changeEndX",0),s(this,"changeDuration",0),s(this,"changeTime",0),s(this,"queuedStep",0),s(this,"queuedDuration",0),s(this,"zapping",!1),s(this,"_isOn",!1),s(this,"_secs",0),this.entity=t,this.onBumpSideways=new n.a("onBumpSideways",1),this.onLaneChanged=new n.a("onLaneChanged",1),this.reset()}reset(){this.lane=0,this.last=0,this.absStep=0,this.changing=!1,this.changeStartX=0,this.changeEndX=0,this.changeDuration=0,this.changeTime=0,this.queuedStep=0,this.queuedDuration=0}turnOn(){this._isOn||(this._isOn=!0,this.entity.game.controller.onSwipeHorizontal.add(this))}turnOff(){this._isOn&&(this._isOn=!1,this.entity.game.controller.onSwipeHorizontal.remove(this))}onSwipeHorizontal(t){this.change(t)}change(t){var e,i,n,a;if(!(null!==(e=this.entity.jetpack)&&void 0!==e&&e.isOn()||null!==(i=this.entity.pogo)&&void 0!==i&&i.isOn())){if(1===this.lane&&t>0)return void(this.entity.body.x>r.a.laneWidth-1&&this.onBumpSideways.dispatch("wall"));if(-1===this.lane&&t<0)return void(this.entity.body.x<1-r.a.laneWidth&&this.onBumpSideways.dispatch("wall"))}const s=.2+.1*(1-this.entity.game.stats.speedRatio),h=Math.round(this.lane+t),u=o.a.clamp(h,-1,1),l=u*r.a.laneWidth,c=Math.abs(l-this.entity.body.x);if(c>r.a.laneWidth)return this.queuedStep=t,void(this.queuedDuration=s);null===(n=this.entity.state)||void 0===n||n.set("empty"),this.absStep=t<0?-1:1,this.last=this.lane,this.lane=u,this.queuedStep=0,this.queuedDuration=0,this.changing=!0,this.changeStartX=this.entity.body.x,this.changeEndX=l,this.changeDuration=Math.max(s*c/r.a.laneWidth,.1),null!==(a=this.entity.jetpack)&&void 0!==a&&a.isOn()&&(this.changeDuration*=.7),this.changeTime=0,this._secs=this.secs(),this.entity.game.sfx.play("hero-dodge"),this.onLaneChanged.dispatch()}secs(){return(new Date).getTime()/1e3}update(t){var e,i,n;const r=t.frameTime;if(!this.changing)return;this.changeTime+=this.entity.game.deltaSecs*(this.zapping?2:1),this.changeTime>this.changeDuration&&(this.changeTime=this.changeDuration);const a=o.a.clamp(this.changeTime/this.changeDuration),s=o.a.lerp(this.changeStartX,this.changeEndX,a);this.entity.body.velocity.x=r?(s-this.entity.body.x)/r:0;const h=.05*-(this.changeEndX-this.entity.body.x),u=(null===(e=this.entity.jetpack)||void 0===e?void 0:e.isOn())||(null===(i=this.entity.pogo)||void 0===i?void 0:i.isOn())||(null===(n=this.entity.hoverboard)||void 0===n?void 0:n.isOn());this.entity.ry=u?0:h,this.changeTime>=this.changeDuration&&this.changeEnd()}changeEnd(){this.entity.body.x=this.lane*r.a.laneWidth,this.changing=!1,this.entity.ry=0,this.entity.body.velocity.x=0,this.queuedDuration&&(this.change(this.queuedStep),this.queuedStep=0,this.queuedDuration=0)}changeCancel(){this.changing=!1,this.queuedStep=0,this.queuedDuration=0,this.entity.ry=0,this.entity.body.velocity.x=0}get lanePos(){return this.entity.body.x/r.a.laneWidth}set lanePos(t){t=o.a.clamp(t,-1,1),this.entity.body.x=r.a.laneWidth*t}bump(t,e){this.changeCancel(),this.change(e),this.onBumpSideways.dispatch(t),this.entity.body.velocity.x=0}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Frustum}));var n=i(68),r=i(16);class Frustum{constructor(t,e,i,r,o,a){this._planes=[void 0!==t?t:new n.a,void 0!==e?e:new n.a,void 0!==i?i:new n.a,void 0!==r?r:new n.a,void 0!==o?o:new n.a,void 0!==a?a:new n.a]}set(t,e,i,n,r,o){const a=this._planes;return a[0].copy(t),a[1].copy(e),a[2].copy(i),a[3].copy(n),a[4].copy(r),a[5].copy(o),this}clone(){return(new Frustum).copy(this)}copy(t){const e=this._planes;for(let i=0;i<6;i++)e[i].copy(t._planes[i]);return this}setFromMatrix(t){const e=this._planes,i=t.elements,n=i[0],r=i[1],o=i[2],a=i[3],s=i[4],h=i[5],u=i[6],l=i[7],c=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],y=i[14],v=i[15];return e[0].setComponents(a-n,l-s,f-c,v-m).normalize(),e[1].setComponents(a+n,l+s,f+c,v+m).normalize(),e[2].setComponents(a+r,l+h,f+d,v+g).normalize(),e[3].setComponents(a-r,l-h,f-d,v-g).normalize(),e[4].setComponents(a-o,l-u,f-p,v-y).normalize(),e[5].setComponents(a+o,l+u,f+p,v+y).normalize(),this}intersectsSphere(t){const e=this._planes,i=t.center,n=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(i)<n)return!1}return!0}intersectsBox(t){const e=this._planes;for(let i=0;i<6;i++){const n=e[i];if(o.x=n.normal.x>0?t.max.x:t.min.x,o.y=n.normal.y>0?t.max.y:t.min.y,o.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(o)<0)return!1}return!0}containsPoint(t){const e=this._planes;for(let i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}}const o=new r.a},,,,,function(t,e,i){"use strict";i.d(e,"a",(function(){return CameraEntity}));var n=i(32),r=i(290);class CameraEntity extends n.a{constructor(t={}){super(),this.camera=this.addComponent(r.a,t),this.position.z=10}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return PhongMaterial_PhongMaterial}));i(29),i(34),i(30);var n=i(0),r=i(137),o=i(292),a=i(491),s=i(492),h=i(493),u=i(494),l=i(495);const c={fragment:{header:"\n uniform vec2 uSpecularGloss; // power // intensity\n \n uniform sampler2D uSpecularMap;\n ",material:"\n specular = uSpecularGloss.x;\n gloss = uSpecularGloss.y;\n \n specular *= texture2DSRGB(uSpecularMap, uv).r;\n\n //IOS hack.. \n specular += 0.0000001;\n "}},d={fragment:{header:"\n uniform vec3 uEmissiveColor;\n uniform sampler2D uEmissiveMap;\n ",material:"\n emissiveColor = uEmissiveColor;\n emissiveColor *= texture2DSRGB(uEmissiveMap, uv).rgb;\n "}},p={vertex:{main:"\n worldNormal = normalize(uNormalMatrix * worldNormal); \n "},fragment:{material:"\n worldNormal = normalize(vWorldNormal);\n "}},f={vertex:{header:"\n attribute vec4 aTangent;\n varying vec3 vTangentW;\n varying vec3 vBitangentW;\n ",main:"\n worldNormal = normalize(uNormalMatrix * worldNormal);\n \n vTangentW = normalize(vec3(modelMatrix * vec4(aTangent.xyz, 0.0)));\n vBitangentW = cross(worldNormal, vTangentW) * aTangent.w; \n "},fragment:{header:"\n uniform sampler2D uNormalMap;\n uniform float uNormalScale;\n varying vec3 vTangentW;\n varying vec3 vBitangentW;\n ",material:"\n mat3 tbn = mat3(vTangentW, vTangentW, vWorldNormal);\n vec3 n = texture2D(uNormalMap, uv).rgb;\n \n worldNormal = normalize(tbn * ((2.0 * n - 1.0) * vec3(uNormalScale, uNormalScale, 1.0)));\n "}},m={vertex:{main:"\n worldNormal = normalize(uNormalMatrix * worldNormal);\n "},fragment:{header:"\n #extension GL_OES_standard_derivatives : enable\n \n uniform sampler2D uNormalMap;\n uniform float uNormalScale;\n \n \n #ifdef GL_OES_standard_derivatives\n\n vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, vec2 uvs ) {\n vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n vec2 st0 = dFdx( uvs.st );\n vec2 st1 = dFdy( uvs.st );\n float scale = sign( st1.t * st0.s - st0.t * st1.s );\n vec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n vec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n vec3 N = normalize( surf_norm );\n mat3 tsn = mat3( S, T, N );\n mapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n return normalize( tsn * mapN );\n }\n \n #endif\n ",material:" \n vec3 n = texture2D(uNormalMap, vUv).rgb;\n vec3 mapN = (2.0 * n - 1.0) * vec3(uNormalScale, uNormalScale, 1.);\n \n mapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n #ifdef GL_OES_standard_derivatives\n worldNormal = perturbNormal2Arb( vWorldPosition.rgb, vWorldNormal, mapN, vUv );\n #endif\n "},fragment2:{header:" \n uniform sampler2D uNormalMap;\n uniform float uNormalScale;\n \n vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, vec2 uvs ) { \n vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n vec2 st0 = dFdx( uvs.st );\n vec2 st1 = dFdy( uvs.st );\n float scale = sign( st1.t * st0.s - st0.t * st1.s );\n vec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n vec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n vec3 N = normalize( surf_norm );\n mat3 tsn = mat3( S, T, N );\n mapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n return normalize( tsn * mapN );\n }\n\n ",material:" \n vec3 n = texture2D(uNormalMap, vUv).rgb;\n vec3 mapN = (2.0 * n - 1.0) * vec3(uNormalScale, uNormalScale, 1.);\n \n mapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n worldNormal = perturbNormal2Arb( vWorldPosition.rgb, vWorldNormal, mapN, vUv );\n "}},g={fragment:{header:"\n uniform vec2 uMetalRoughnessPower;\n\n uniform samplerCube uEnvironmentMap;\n ",material:"\n \n if(uMetalRoughnessPower[0] > 0.)\n {\n vec3 direction = reflect(eyeToSurfaceDir, worldNormal);\n float mipCount = 9.;\n\n float lod = clamp(uMetalRoughnessPower[1] * mipCount, 0.0, mipCount);\n\n vec3 realReflection = textureCubeSRGB(uEnvironmentMap, normalize(direction), lod).rgb;\n reflectionColor = mix(reflectionColor, realReflection, uMetalRoughnessPower[0]);\n }\n "}},y={vertex:{header:"\n uniform vec4 uClippingPlane;\n varying float aClipCheck;\n ",main:"\n aClipCheck = dot(worldPosition, uClippingPlane);\n "},fragment:{header:"\n varying float aClipCheck;\n ",material:"\n if (aClipCheck < 0.0)\n {\n discard;\n }\n "}};var v=i(496),b=i(499);const _={name:"morph targets normal transform",vertex:{header:"\n attribute vec3 aMorphTargetPosition1;\n attribute vec3 aMorphTargetPosition2;\n attribute vec3 aMorphTargetPosition3;\n attribute vec3 aMorphTargetPosition4;\n\n attribute vec3 aMorphTargetNormal1;\n attribute vec3 aMorphTargetNormal2;\n attribute vec3 aMorphTargetNormal3;\n attribute vec3 aMorphTargetNormal4;\n\n uniform float uMorphTargetInfluence[4];\n ",transform:"\n worldPosition.xyz += aMorphTargetPosition1 * uMorphTargetInfluence[ 0 ];\n worldPosition.xyz += aMorphTargetPosition2 * uMorphTargetInfluence[ 1 ];\n worldPosition.xyz += aMorphTargetPosition3 * uMorphTargetInfluence[ 2 ];\n worldPosition.xyz += aMorphTargetPosition4 * uMorphTargetInfluence[ 3 ];\n\n worldNormal.xyz += aMorphTargetNormal1 * uMorphTargetInfluence[ 0 ];\n worldNormal.xyz += aMorphTargetNormal2 * uMorphTargetInfluence[ 1 ];\n worldNormal.xyz += aMorphTargetNormal3 * uMorphTargetInfluence[ 2 ];\n worldNormal.xyz += aMorphTargetNormal4 * uMorphTargetInfluence[ 3 ];\n "}},w={};function x(t){return C(t,!0)}function C(t,e=!1){const i=t.map(t=>t.UID).join("-")+e;if(w[i])return w[i];const n=[],r=[],o=[],a=[];a.push("\n float attenuation;\n float amountInLight = 1.;\n float shininessPower = specular;\n float shininessIntensity = gloss;\n float distanceFromLight;\n float inLight;\n\n float dotFromDirection;\n\n vec3 lightDirection;\n vec3 lightDirectionNormal;\n ");e&&!!t.find(t=>t.shadow)&&(a.push("\n vec4 fragmentDepth;\n float shadowAcneRemover;\n\n vec2 poissonDisk[4];\n poissonDisk[0] = vec2(-0.94201624, -0.39906216);\n poissonDisk[1] = vec2(0.94558609, -0.76890725);\n poissonDisk[2] = vec2(-0.094184101, -0.92938870);\n poissonDisk[3] = vec2(0.34495938, 0.29387760);\n "),o.push("\n const mat4 texUnitConverter = mat4(0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0);\n ")),t.forEach(t=>{switch(t.light.type){case 0:!function(t,e,i,n,r,o){const a=r.light.lightId;i.push("\n amountInLight = 1.0;\n "),o&&r.shadow&&(t.push("\n varying vec4 vShadowPosition"+a+";\n uniform mat4 uShadowProjectionView"+a+";\n "),e.push("\n uniform sampler2D uShadowMap"+a+";\n varying vec4 vShadowPosition"+a+";\n uniform vec2 uShadowParams"+a+";\n uniform mat4 uShadowProjectionView"+a+";\n "),i.push("\n fragmentDepth = vShadowPosition"+a+";\n shadowAcneRemover = uShadowParams"+a+"[0];\n fragmentDepth.z -= shadowAcneRemover;\n\n for (int i=0;i<4;i++){\n if ( texture2D( uShadowMap"+a+", fragmentDepth.xy + poissonDisk[i]/ uShadowParams"+a+"[1] ).x < fragmentDepth.z ){\n amountInLight-=0.25;\n }\n }\n "),n.push("\n vShadowPosition"+a+" = texUnitConverter * uShadowProjectionView"+a+" * worldPosition;\n "));e.push("\n uniform vec3 uLightColor"+a+";\n uniform vec3 uLightDirection"+a+";\n "),i.push("\n attenuation = 1.;\n attenuation *= diffuseLighting(worldNormal,uLightDirection"+a+") * amountInLight;\n if(attenuation > 0.0001)\n {\n lightingColor += (attenuation * uLightColor"+a+");\n attenuation *= specularLighting(worldNormal, eyeToSurfaceDir,uLightDirection"+a+", shininessPower, shininessIntensity);\n specularColor += (attenuation * uLightColor"+a+");\n }\n ")}(n,r,a,o,t,e);break;case 1:!function(t,e,i,n,r,o){const a=r.light.lightId;o&&r.shadow;e.push("\n uniform vec3 uLightColor"+a+";\n uniform vec3 uLightDirection"+a+";\n uniform vec3 uLightPosition"+a+";\n uniform float uLightDistance"+a+";\n "),i.push("\n lightDirection = worldPosition - uLightPosition"+a+";\n lightDirectionNormal = normalize(lightDirection);\n distanceFromLight = length(lightDirection);\n attenuation = pow( saturate(-distanceFromLight / uLightDistance"+a+" + 1.0) , 1. ) * amountInLight;\n\n if(attenuation > 0.0001)\n {\n attenuation *= diffuseLighting(worldNormal,lightDirectionNormal);\n lightingColor += attenuation * uLightColor"+a+";\n attenuation *= specularLighting(worldNormal,eyeToSurfaceDir,lightDirectionNormal, shininessPower, shininessIntensity);\n specularColor += attenuation * uLightColor"+a+";\n }\n ")}(0,r,a,0,t,e);break;case 2:!function(t,e,i,n,r,o){const a=r.light.lightId;i.push("\n amountInLight = 1.0;\n "),o&&r.shadow&&(t.push("\n varying vec4 vShadowPosition"+a+";\n uniform mat4 uShadowProjectionView"+a+";\n "),e.push("\n uniform sampler2D uShadowMap"+a+";\n uniform vec2 uShadowParams"+a+";\n varying vec4 vShadowPosition"+a+";\n "),i.push("\n fragmentDepth = vShadowPosition"+a+";\n fragmentDepth.xyz /= fragmentDepth.w;\n shadowAcneRemover = uShadowParams"+a+"[0];\n fragmentDepth.z -= shadowAcneRemover;\n\n for (int i=0;i<4;i++){\n if ( texture2D( uShadowMap"+a+", fragmentDepth.xy + poissonDisk[i]/uShadowParams"+a+"[1] ).x < fragmentDepth.z ){\n amountInLight-=0.25;\n }\n }\n "),n.push("\n vShadowPosition"+a+" = texUnitConverter * uShadowProjectionView"+a+" * worldPosition;\n "));e.push("\n uniform vec3 uLightColor"+a+";\n uniform vec3 uLightDirection"+a+";\n uniform vec3 uLightPosition"+a+";\n uniform float uLightDistance"+a+";\n uniform vec2 uLimit"+a+";\n "),i.push("\n lightDirection = worldPosition - uLightPosition"+a+";\n lightDirectionNormal = normalize(lightDirection);\n distanceFromLight = length(lightDirection);\n dotFromDirection = dot(-normalize(lightDirection), -uLightDirection"+a+");\n inLight = smoothstep(uLimit"+a+".y, uLimit"+a+".x, dotFromDirection);\n\n attenuation = pow( saturate(-distanceFromLight / uLightDistance"+a+" + 1.0) , 1. ) * amountInLight;\n\n if(attenuation > 0.0001)\n {\n attenuation *= diffuseLighting(worldNormal,lightDirectionNormal) * inLight;\n lightingColor += attenuation * uLightColor"+a+";\n attenuation *= specularLighting(worldNormal,eyeToSurfaceDir,lightDirectionNormal, shininessPower, shininessIntensity) * inLight;\n specularColor += attenuation * uLightColor"+a+";\n }\n ")}(n,r,a,o,t,e)}}),r.push("\n #define saturate(a) clamp( a, 0.0, 1.0 )\n\n float diffuseLighting(vec3 normal, vec3 lightDirection)\n {\n return max(dot(normal, -lightDirection), 0.0);\n }\n\n float specularLighting(vec3 normal, vec3 eyeToSurfaceDir, vec3 lightDirection, float shininessPower, float shininessIntensity)\n {\n vec3 reflection = normalize(reflect(eyeToSurfaceDir, normal));\n float specularFactor = dot(reflection, -lightDirection);\n specularFactor = max(specularFactor, 0.0);\n specularFactor = pow(specularFactor, shininessPower);\n\n return specularFactor * shininessIntensity + 0.0001;\n }\n "),r.push("\n uniform vec3 uGlobalAmbient;\n "),a.push("\n // fix for android\n specularColor = clamp(specularColor, 0.,1.);\n\n lightingColor += uGlobalAmbient;\n ");const s={vertex:{header:n.join("\n"),lighting:o.join("\n")},fragment:{header:r.join("\n"),main:a.join("\n")}};return w[i]=s,s}var S=i(227);class PhongMaterial_PhongMaterial extends o.a{constructor(t={}){var e,i,w,T,A,E,P,M,I,k,O,R,D,L,N,B,F;const z=null===(e=t.useLights)||void 0===e||e,j=null!==(i=t.uniforms)&&void 0!==i?i:{};let G;(null!==(w=t.fastNormals)&&void 0!==w?w:o.a.FAST_NORMALS)?G=a.a:(G=a.b,j.uNormalMatrix=new r.a);let U=S.a;z&&(U=t.receiveShadows?x:C);const H={modelMatrix:s.a,normalMatrix:G,uv:h.b,alpha:u.b,lights:U,extensions:[]};if(j.uDiffuseColor=new Float32Array([1,1,1,1]),j.uMapFrame=new n.Rectangle(0,0,1,1),t.diffuseMap&&(H.diffuse=l.a,j.uDiffuseMap=null!==(T=t.diffuseMap)&&void 0!==T?T:n.Texture.WHITE),(void 0!==t.specular||void 0!==t.gloss||t.specularMap)&&(H.specular=c,j.uSpecularMap=null!==(A=t.specularMap)&&void 0!==A?A:n.Texture.WHITE,j.uSpecularGloss=[null!==(E=t.specular)&&void 0!==E?E:100,null!==(P=t.gloss)&&void 0!==P?P:2]),j.uEmissiveColor=new Float32Array([1,1,1]),(t.emissiveMap||void 0!==t.emissiveColor||void 0!==t.emissive)&&(H.emissive=d,j.uEmissiveMap=null!==(M=t.emissiveMap)&&void 0!==M?M:n.Texture.WHITE),t.normalMap?(t.tangents=null!==(I=t.tangents)&&void 0!==I?I:PhongMaterial_PhongMaterial.PREFER_TANGENTS,t.tangents?H.normal=f:H.normal=m,j.uNormalMap=t.normalMap,j.uNormalScale=null!==(k=t.normalScale)&&void 0!==k?k:1):H.normal=p,t.environmentMap&&(H.reflection=g,j.uMetalRoughnessPower=new Float32Array([null!==(O=t.metalPower)&&void 0!==O?O:1,0]),j.uEnvironmentMap=t.environmentMap),t.clippingPlane&&(H.extensions.push(y),j.uClippingPlane=t.clippingPlane),t.morphTargets&&(H.extensions.push(_),j.uMorphTargetInfluence=new Float32Array([0,0,0,0])),t.skinning){let e;e=(null!==(R=t.boneTexture)&&void 0!==R?R:o.a.PREFER_TEXTURE)?v.b:Object(v.a)(null!==(D=t.maxBones)&&void 0!==D?D:o.a.MAX_BONES),H.extensions.push(e)}if(t.alphaTest&&(j.uAlphaTest=t.alphaTest,H.extensions.push(b.a)),t.config){let e=H.extensions;t.config.extensions&&(e=H.extensions.concat(t.config.extensions)),Object.assign(H,t.config),H.extensions=e}super(H,j),this.tangents=null!==(L=t.tangents)&&void 0!==L&&L,this.color=null!==(N=t.color)&&void 0!==N?N:16777215,this._emissiveIntensity=null!==(B=t.emissive)&&void 0!==B?B:1,this.emissiveColor=null!==(F=t.emissiveColor)&&void 0!==F?F:16777215}get uniforms(){return this.uniformGroup.uniforms}set diffuseMap(t){this.uniforms.uDiffuseMap=t}get diffuseMap(){return this.uniforms.uDiffuseMap}set color(t){this._hexColor=t,n.utils.hex2rgb(t,this.uniforms.uDiffuseColor)}get color(){return this._hexColor}set specular(t){this.uniforms.uSpecularGloss[0]=t}get specular(){return this.uniforms.uSpecularGloss[0]}set gloss(t){this.uniforms.uSpecularGloss[1]=t}get gloss(){return this.uniforms.uSpecularGloss[1]}set specularMap(t){this.uniforms.uSpecularMap=t}get specularMap(){return this.uniforms.uSpecularMap}set emissiveColor(t){this._hexEmissiveColor=t;const e=this.uniforms.uEmissiveColor;n.utils.hex2rgb(t,e),e[0]*=this._emissiveIntensity,e[1]*=this._emissiveIntensity,e[2]*=this._emissiveIntensity}get emissiveColor(){return this._hexEmissiveColor}set emissive(t){this._emissiveIntensity=t,this.emissiveColor=this._hexColor}get emissive(){return this._emissiveIntensity}set environmentMap(t){this.uniforms.uEnvironmentMap=t}get environmentMap(){return this.uniforms.uEnvironmentMap}set metalPower(t){this.uniforms.uMetalRoughnessPower[0]=t}get metalPower(){return this.uniforms.uMetalRoughnessPower[0]}set clippingPlane(t){this.uniforms.uClippingPlane=t}get clippingPlane(){return this.uniforms.uClippingPlane}get morphTargets(){return this.uniforms.uMorphTargetInfluence}}PhongMaterial_PhongMaterial.PREFER_TANGENTS=!1},function(t,e,i){"use strict";i.d(e,"a",(function(){return d}));i(9);var n=i(289),r=i(285),o=function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))};var a=function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))};var s={loadGB:function(t){return o(this,void 0,void 0,(function*(){const e=yield fetch(t),i=yield e.arrayBuffer();return Object(r.unpackGBObject)(i)}))},loadImageBitmap:function(t){return a(this,void 0,void 0,(function*(){const e=yield fetch(t),i=yield e.blob();return yield createImageBitmap(i)}))}},h=i(284),u=i.n(h);let l=0;const c=navigator.hardwareConcurrency||4;const d=new class CentralDispatch_CentralDispatchClass{constructor(){this.workerPool=[],this.queue=[];for(let t=0;t<c;t++)this.workerPool.push(new u.a);for(const t in s)this[t]=(...e)=>this._run(t,e);if(this.resolveHash={},this.useWorkers=!n.a.ie,this.useWorkers)for(let t=0;t<c;t++){this.workerPool[t].addEventListener("message",t=>{this.complete(t.data),this.workerPool.push(t.target),this.next()})}}complete(t){const e=t.data;this.resolveHash[t.uuid](e),this.resolveHash[t.uuid]=null}_run(t,e){if(this.useWorkers){const i=new Promise(i=>{this.queue.push({id:t,arguments:e,resolve:i})});return this.next(),i}return s[t](...e)}next(){if(!this.queue.length)return;const t=this.workerPool.pop();if(!t)return;const e=this.queue.pop(),i=e.id;this.resolveHash[l]=e.resolve,t.postMessage({data:e.arguments,uuid:l++,id:i})}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Animation3D}));i(9);class Animation3D{constructor(t){this.name=t.name,this.data=t.data,this.duration=t.duration,this.loop=t.loop||!1,this.speed=t.speed||.012,this.currentTime=0}static fromAnimation(t){const e=t.animation,i=t.start,r=t.end;if(r>e.duration)throw new Error("cannot split animation, end time is longer than the duration ("+e.duration+") of the animation");if(i<0)throw new Error("cannot split animation, start time is smaller than the zero");const o={};return o.data=e.data.map(t=>{const e={id:t.id};return t.t&&(e.t=n(t.t,i,r,3)),t.s&&(e.s=n(t.s,i,r,3)),t.r&&(e.r=n(t.r,i,r,4)),t.w&&(e.w=n(t.w,i,r,2)),e}),o.duration=r-i,o.name=t.name,o.speed=t.speed,o.loop=t.loop,Animation3D.fromData(o)}static fromData(t){return new Animation3D(t)}}function n(t,e,i,n){const r=t.times;let o=0,a=0;for(let t=0;t<r.length&&!(r[t]>e);t++)o=t;for(let t=o;t<r.length;t++)if(r[t]>=i){a=t;break}const s=r[o];return{times:r.slice(o,a).map(t=>t-s),values:t.values.slice(o*n,a*n)}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Vector2}));class Vector2{constructor(t,e){this.x=t||0,this.y=e||0}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}clone(){return new Vector2(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return n.set(t,t),r.set(e,e),this.clamp(n,r)}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){let t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this}toArray(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t}rotateAround(t,e){const i=Math.cos(e),n=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*i-o*n+t.x,this.y=r*n+o*i+t.y,this}}const n=new Vector2,r=new Vector2},,,function(t,e,i){var n=i(159),r=i(160);(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.16.2",mode:n?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports=!1},function(t,e,i){var n=i(45),r=i(161),o=n["__core-js_shared__"]||r("__core-js_shared__",{});t.exports=o},function(t,e,i){var n=i(45);t.exports=function(t,e){try{Object.defineProperty(n,t,{value:e,configurable:!0,writable:!0})}catch(i){n[t]=e}return e}},function(t,e){var i=0,n=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++i+n).toString(36)}},function(t,e,i){var n=i(318),r=i(129);t.exports=function(t){var e=n(t,"string");return r(e)?e:String(e)}},function(t,e,i){var n=i(92),r=Math.max,o=Math.min;t.exports=function(t,e){var i=n(t);return i<0?r(i+e,0):o(i,e)}},function(t,e){t.exports={}},function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e,i){var n=i(158),r=i(162),o=n("keys");t.exports=function(t){return o[t]||(o[t]=r(t))}},function(t,e,i){var n=i(70),r=i(325),o=i(130),a=i(125),s=i(163),h=i(58),u=i(197),l=Object.getOwnPropertyDescriptor;e.f=n?l:function(t,e){if(t=a(t),e=s(e),u)try{return l(t,e)}catch(t){}if(h(t,e))return o(!r.f.call(t,e),t[e])}},function(t,e,i){var n=i(199),r=i(166).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,r)}},function(t,e,i){var n=i(71).f,r=i(58),o=i(49)("toStringTag");t.exports=function(t,e,i){t&&!r(t=i?t:t.prototype,o)&&n(t,o,{configurable:!0,value:e})}},function(t,e){var i,n,r=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(i===setTimeout)return setTimeout(t,0);if((i===o||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:o}catch(t){i=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var h,u=[],l=!1,c=-1;function d(){l&&h&&(l=!1,h.length?u=h.concat(u):c=-1,u.length&&p())}function p(){if(!l){var t=s(d);l=!0;for(var e=u.length;e;){for(h=u,u=[];++c<e;)h&&h[c].run();c=-1,e=u.length}h=null,l=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function m(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];u.push(new f(t,e)),1!==u.length||l||s(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=m,r.addListener=m,r.once=m,r.off=m,r.removeListener=m,r.removeAllListeners=m,r.emit=m,r.prependListener=m,r.prependOnceListener=m,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(t,e,i){"use strict";var n,r,o=i(132),a=i(345),s=i(346),h=i(158),u=i(128),l=i(115).get,c=i(347),d=i(348),p=RegExp.prototype.exec,f=h("native-string-replace",String.prototype.replace),m=p,g=(n=/a/,r=/b*/g,p.call(n,"a"),p.call(r,"a"),0!==n.lastIndex||0!==r.lastIndex),y=s.UNSUPPORTED_Y||s.BROKEN_CARET,v=void 0!==/()??/.exec("")[1];(g||v||y||c||d)&&(m=function(t){var e,i,n,r,s,h,c,d=this,b=l(d),_=o(t),w=b.raw;if(w)return w.lastIndex=d.lastIndex,e=m.call(w,_),d.lastIndex=w.lastIndex,e;var x=b.groups,C=y&&d.sticky,S=a.call(d),T=d.source,A=0,E=_;if(C&&(-1===(S=S.replace("y","")).indexOf("g")&&(S+="g"),E=_.slice(d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==_.charAt(d.lastIndex-1))&&(T="(?: "+T+")",E=" "+E,A++),i=new RegExp("^(?:"+T+")",S)),v&&(i=new RegExp("^"+T+"$(?!\\s)",S)),g&&(n=d.lastIndex),r=p.call(C?i:d,E),C?r?(r.input=r.input.slice(A),r[0]=r[0].slice(A),r.index=d.lastIndex,d.lastIndex+=r[0].length):d.lastIndex=0:g&&r&&(d.lastIndex=d.global?r.index+r[0].length:n),v&&r&&r.length>1&&f.call(r[0],i,(function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(r[s]=void 0)})),r&&x)for(r.groups=h=u(null),s=0;s<x.length;s++)h[(c=x[s])[0]]=r[c[1]];return r}),t.exports=m},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,e,i){var n=i(359),r=i(126),o=i(49)("toStringTag"),a="Arguments"==r(function(){return arguments}());t.exports=n?r:function(t){var e,i,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),o))?i:a?r(e):"Object"==(n=r(e))&&"function"==typeof e.callee?"Arguments":n}},function(t,e,i){i(93)("Uint8",(function(t){return function(e,i,n){return t(this,e,i,n)}}))},function(t,e,i){"use strict";var n=i(101),r=i(70),o=i(45),a=i(58),s=i(59),h=i(71).f,u=i(201),l=o.Symbol;if(r&&"function"==typeof l&&(!("description"in l.prototype)||void 0!==l().description)){var c={},d=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof d?new l(t):void 0===t?l():l(t);return""===t&&(c[e]=!0),e};u(d,l);var p=d.prototype=l.prototype;p.constructor=d;var f=p.toString,m="Symbol(test)"==String(l("test")),g=/^Symbol\((.*)\)[^)]+$/;h(p,"description",{configurable:!0,get:function(){var t=s(this)?this.valueOf():this,e=f.call(t);if(a(c,t))return"";var i=m?e.slice(7,-1):e.replace(g,"$1");return""===i?void 0:i}}),n({global:!0,forced:!0},{Symbol:d})}},function(t,e,i){"use strict";i(29),i(63),i(30),i(34),Object.defineProperty(e,"__esModule",{value:!0}),e.mergeBounds=e.mergePrimitives=void 0;const n={positions:3,normals:3,weights:4,boneIndices:4,uvs:2,tangents:4};function r(t,e){for(let i=0;i<3;i++)t[i]=Math.min(t[i],e[i]);for(let i=2;i<6;i++)t[i]=Math.max(t[i],e[i]);return t}e.mergePrimitives=function(t){let e=0,i=0;const o=[1/0,1/0,1/0,-1/0,-1/0,-1/0];if(t.forEach(t=>{e+=t.indices.length,i+=t.attributes.positions.length/n.positions,r(o,t.bounds)}),i>65535)throw new Error("[merge Primitives] cannot merge geometries, they exceed maximum index size of 65535");const a=new Uint16Array(e),s={};for(const e in t[0].attributes)s[e]=new Float32Array(i*n[e]);let h=0,u=0,l=0;return t.forEach(t=>{for(const e in t.attributes){const i=t.attributes[e],r=s[e],o=n[e];for(let t=0;t<i.length;t++)r[t+l*o]=i[t]}l+=t.attributes.positions.length/n.positions;for(let e=0;e<t.indices.length;e++)a[h++]=t.indices[e]+u;u+=t.attributes.positions.length/3}),{indices:a,attributes:s,bounds:o}},e.mergeBounds=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBounds=void 0,e.getBounds=function(t,e){const i=[];for(let t=0;t<e;t++)i[t]={min:1/0,max:-1/0};for(let n=0;n<t.length;n+=e)for(let r=0;r<e;r++){const e=t[n+r];e<i[r].min&&(i[r].min=e),e>i[r].max&&(i[r].max=e)}const n=i.map(t=>t.max-t.min);return n.forEach((t,e)=>{t>1e8&&(i[e].max=1,i[e].min=0,n[e]=1)}),{ranges:i,sizes:n}}},function(t,e,i){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(t,e,i){"use strict";i(29),i(458),i(30),i(63),i(459),i(460),i(34),Object.defineProperty(e,"__esModule",{value:!0}),e.getBuffer=void 0;const n={5122:Int16Array,5123:Uint16Array,5124:Int32Array,5125:Uint32Array,5126:Float32Array},r={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};e.getBuffer=function(t,e,i=!1){const o=t.accessors[e],a=t.bufferViews[o.bufferView],s=t.realBuffers[a.buffer],h=(a.byteOffset||0)+(o.byteOffset||0);if(o.byteStride)throw new Error("byteStride in buffer... not yet supported");const u=n[o.componentType];if(5125===o.componentType){const t=new Uint32Array(s,h,o.count*r[o.type]);for(let e=0;e<t.length;e++)if(t[e]>65535)throw new Error("[gb-model-tools] Uint32 Array required for this model, its too big!");return new Uint16Array(t)}return new u(s,h,o.count*r[o.type])}},,function(t,e,i){"use strict";t.exports=function(t,e){if(t){e=e||{};for(var i={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*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},n=i.parser[e.strictMode?"strict":"loose"].exec(t),r={},o=14;o--;)r[i.key[o]]=n[o]||"";return r[i.q.name]={},r[i.key[12]].replace(i.q.parser,(function(t,e,n){e&&(r[i.q.name][e]=n)})),r}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Sphere}));var n=i(16),r=i(85);class Sphere{constructor(t,e){this.center=void 0!==t?t:new n.a,this.radius=void 0!==e?e:0}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const i=this.center;void 0!==e?i.copy(e):o.setFromPoints(t).getCenter(i);let n=0;for(let e=0,r=t.length;e<r;e++)n=Math.max(n,i.distanceToSquared(t[e]));return this.radius=Math.sqrt(n),this}clone(){return(new Sphere).copy(this)}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}empty(){return this.radius<=0}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const i=this.center.distanceToSquared(t);return e.copy(t),i>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return t.set(this.center,this.center),t.expandByScalar(this.radius),t}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}}const o=new r.a},function(t,e,i){"use strict";i.d(e,"a",(function(){return SceneUtilsComponent}));var n=i(103);class SceneUtilsComponent extends n.a{constructor(t,e){super(t),this.map=e.map}find(t){let e=null;return this.entity.container.traverse(i=>{i.name===t&&(e=i)}),e}logNames(t){this.entity.container.traverse(t=>{t.view3d})}attachTo(t,e){const i=this.find(t);i&&i.addChild(e)}hide(t){const e=this.find(t);e&&(e.view3d.renderable=!1)}show(t){const e=this.find(t);e&&(e.view3d.renderable=!0)}search(t,e){const i=e?{}:[];return this.entity.container.traverse(e=>{t(e)&&(i instanceof Array?i.push(e):i[e.name]=e)}),i}first(t){return this.search(t)[0]}getAllEntities(t){if(!t)return this.map;const e={};return this.entity.container.traverse(t=>{e[t.name]=t}),e}findWithComponents(t,e){const i=e?{}:[];return this.entity.container.traverse(e=>{e[t]&&(i instanceof Array?i.push(e):i[e.name]=e)}),i}findLights(t){return this.findWithComponents("light",t)}}},,function(t,e,i){"use strict";i.d(e,"a",(function(){return SphereGeometry}));i(29),i(63),i(30);var n=i(84);class SphereGeometry extends n.a{constructor(t,e=8,i=6,n=0,r=2*Math.PI,o=0,a=Math.PI){super(),this.type="SphereBufferGeometry",t=t||1,e=Math.max(3,Math.floor(e)),i=Math.max(2,Math.floor(i));const s=o+a;let h,u,l=0;const c=[],d=[],p=[],f=[],m=[];for(u=0;u<=i;u++){const s=[],d=u/i;for(h=0;h<=e;h++){const i=h/e,u=-t*Math.cos(n+i*r)*Math.sin(o+d*a),c=t*Math.cos(o+d*a),g=t*Math.sin(n+i*r)*Math.sin(o+d*a);p.push(u,c,g);let y=u*u+c*c+g*g;y>0&&(y=1/Math.sqrt(y)),f.push(u*y,c*y,g*y),m.push(i,1-d),s.push(l++)}c.push(s)}for(u=0;u<i;u++)for(h=0;h<e;h++){const t=c[u][h+1],e=c[u][h],n=c[u+1][h],r=c[u+1][h+1];(0!==u||o>0)&&d.push(t,e,r),(u!==i-1||s<Math.PI)&&d.push(e,n,r)}this.addAttribute("aUv",m,2).addAttribute("aPosition",p,3).addAttribute("aNormal",f,3).interleave().addIndex(new Uint16Array(d))}}},,function(t,e,i){"use strict";i.d(e,"a",(function(){return U}));var n,r,o,a,s,h,u,l,c=function(){return"undefined"!=typeof window},d=function(){return n||c()&&(n=window.gsap)&&n.registerPlugin&&n},p=function(t){return"function"==typeof t},f=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],m=.212671,g=.71516,y=.072169,v=function(t,e){var i,n,r=[],o=0,a=0;for(i=0;i<4;i++){for(n=0;n<5;n++)a=4===n?t[o+4]:0,r[o+n]=t[o]*e[n]+t[o+1]*e[n+5]+t[o+2]*e[n+10]+t[o+3]*e[n+15]+a;o+=5}return r},b=function(t,e){var i=1-e,n=i*m,r=i*g,o=i*y;return v([n+e,r,o,0,0,n,r+e,o,0,0,n,r,o+e,0,0,0,0,0,1,0],t)},_=function(t,e,i){var n=o(e),r=n[0]/255,a=n[1]/255,s=n[2]/255,h=1-i;return v([h+i*r*m,i*r*g,i*r*y,0,0,i*a*m,h+i*a*g,i*a*y,0,0,i*s*m,i*s*g,h+i*s*y,0,0,0,0,0,1,0],t)},w=function(t,e){e*=Math.PI/180;var i=Math.cos(e),n=Math.sin(e);return v([m+i*(1-m)+n*-m,g+i*-g+n*-g,y+i*-y+n*(1-y),0,0,m+i*-m+.143*n,g+i*(1-g)+.14*n,y+i*-y+-.283*n,0,0,m+i*-m+n*-(1-m),g+i*-g+n*g,y+i*(1-y)+n*y,0,0,0,0,0,1,0,0,0,0,0,1],t)},x=function(t,e){return v([e,0,0,0,.5*(1-e),0,e,0,0,.5*(1-e),0,0,e,0,.5*(1-e),0,0,0,1,0],t)},C=function(t,e){for(var i,n=a.filters[e],r=t.filters||[],o=r.length;--o>-1;)if(r[o]instanceof n)return r[o];return i=new n,"BlurFilter"===e&&(i.blur=0),r.push(i),t.filters=r,i},S=function(t,e,i,n){e.add(i,t,i[t],n[t]),e._props.push(t)},T=function(t,e){var i=new a.filters.ColorMatrixFilter;return i.matrix=e,i.brightness(t,!0),i.matrix},A={contrast:1,saturation:1,colorizeAmount:0,colorize:"rgb(255,255,255)",hue:0,brightness:1},E=function(t,e,i){var n,r,o,a=C(t,"ColorMatrixFilter"),s=t._gsColorMatrixFilter=t._gsColorMatrixFilter||function(t){var e,i={};for(e in t)i[e]=t[e];return i}(A),h=e.combineCMF&&!("colorMatrixFilter"in e&&!e.colorMatrixFilter);o=a.matrix,e.resolution&&(a.resolution=e.resolution),e.matrix&&e.matrix.length===o.length?(r=e.matrix,1!==s.contrast&&S("contrast",i,s,A),s.hue&&S("hue",i,s,A),1!==s.brightness&&S("brightness",i,s,A),s.colorizeAmount&&(S("colorize",i,s,A),S("colorizeAmount",i,s,A)),1!==s.saturation&&S("saturation",i,s,A)):(r=f.slice(),null!=e.contrast?(r=x(r,+e.contrast),S("contrast",i,s,e)):1!==s.contrast&&(h?r=x(r,s.contrast):S("contrast",i,s,A)),null!=e.hue?(r=w(r,+e.hue),S("hue",i,s,e)):s.hue&&(h?r=w(r,s.hue):S("hue",i,s,A)),null!=e.brightness?(r=T(+e.brightness,r),S("brightness",i,s,e)):1!==s.brightness&&(h?r=T(s.brightness,r):S("brightness",i,s,A)),null!=e.colorize?(e.colorizeAmount="colorizeAmount"in e?+e.colorizeAmount:1,r=_(r,e.colorize,e.colorizeAmount),S("colorize",i,s,e),S("colorizeAmount",i,s,e)):s.colorizeAmount&&(h?r=_(r,s.colorize,s.colorizeAmount):(S("colorize",i,s,A),S("colorizeAmount",i,s,A))),null!=e.saturation?(r=b(r,+e.saturation),S("saturation",i,s,e)):1!==s.saturation&&(h?r=b(r,s.saturation):S("saturation",i,s,A))),n=r.length;for(;--n>-1;)r[n]!==o[n]&&i.add(o,n,o[n],r[n],"colorMatrixFilter");i._props.push("colorMatrixFilter")},P=function(t,e){var i=e.t,n=e.p,r=e.color;(0,e.set)(i,n,r[0]<<16|r[1]<<8|r[2])},M=function(t,e){var i=e.g;i&&(i.dirty++,i.clearDirty++)},I=function(t,e){e.t.visible=!!e.t.alpha},k=function(t,e,i,n){var r=t[e],a=o(p(r)?t[e.indexOf("set")||!p(t["get"+e.substr(3)])?e:"get"+e.substr(3)]():r),u=o(i);n._pt=new s(n._pt,t,e,0,0,P,{t:t,p:e,color:a,set:h(t,e)}),n.add(a,0,a[0],u[0]),n.add(a,1,a[1],u[1]),n.add(a,2,a[2],u[2])},O={tint:1,lineColor:1,fillColor:1},R="position,scale,skew,pivot,anchor,tilePosition,tileScale".split(","),D={x:"position",y:"position",tileX:"tilePosition",tileY:"tilePosition"},L={colorMatrixFilter:1,saturation:1,contrast:1,hue:1,colorize:1,colorizeAmount:1,brightness:1,combineCMF:1},N=Math.PI/180,B=function(t){return"string"==typeof t},F=function(t){return B(t)&&"="===t.charAt(1)?t.substr(0,2)+parseFloat(t.substr(2))*N:t*N},z=function(t,e){return e.set(e.t,e.p,1===t?e.e:Math.round(1e5*(e.s+e.c*t))/1e5,e)},j=function(t,e,i,n,r,o){var a,h,u=360*(o?N:1),l=B(r),c=l&&"="===r.charAt(1)?+(r.charAt(0)+"1"):0,d=parseFloat(c?r.substr(2):r)*(o?N:1),p=c?d*c:d-n,f=n+p;return l&&("short"===(a=r.split("_")[1])&&(p%=u)!==p%(u/2)&&(p+=p<0?u:-u),"cw"===a&&p<0?p=(p+1e10*u)%u-~~(p/u)*u:"ccw"===a&&p>0&&(p=(p-1e10*u)%u-~~(p/u)*u)),t._pt=h=new s(t._pt,e,i,n,p,z),h.e=f,h},G=function(){c()&&(r=window,n=d(),a=a||r.PIXI,o=function(t){return n.utils.splitColor("0x"===(t+"").substr(0,2)?"#"+t.substr(2):t)})};for(u=0;u<R.length;u++)l=R[u],D[l+"X"]=l,D[l+"Y"]=l;var U={version:"3.7.1",name:"pixi",register:function(t,e,i){n=t,s=i,h=e.getSetter,G()},registerPIXI:function(t){a=t},init:function(t,e,i,n,r){if(a||G(),!t instanceof a.DisplayObject)return!1;var o,h,u,l,c,d,p,f,m,g="4"===a.VERSION.charAt(0);for(d in e){if(o=D[d],u=e[d],o)h=~d.charAt(d.length-1).toLowerCase().indexOf("x")?"x":"y",this.add(t[o],h,t[o][h],"skew"===o?F(u):u);else if("scale"===d||"anchor"===d||"pivot"===d||"tileScale"===d)this.add(t[d],"x",t[d].x,u),this.add(t[d],"y",t[d].y,u);else if("rotation"===d||"angle"===d)j(this,t,d,t[d],u,"rotation"===d);else if(L[d])l||(E(t,e.colorMatrixFilter||e,this),l=!0);else if("blur"===d||"blurX"===d||"blurY"===d||"blurPadding"===d){if(c=C(t,"BlurFilter"),this.add(c,d,c[d],u),0!==e.blurPadding)for(p=e.blurPadding||2*Math.max(c[d],u),f=t.filters.length;--f>-1;)t.filters[f].padding=Math.max(t.filters[f].padding,p)}else if(O[d])if(("lineColor"===d||"fillColor"===d)&&t instanceof a.Graphics)for(m=(t.geometry||t).graphicsData,this._pt=new s(this._pt,t,d,0,0,M,{g:t.geometry||t}),f=m.length;--f>-1;)k(g?m[f]:m[f][d.substr(0,4)+"Style"],g?d:"color",u,this);else k(t,d,u,this);else"autoAlpha"===d?(this._pt=new s(this._pt,t,"visible",0,0,I),this.add(t,"alpha",t.alpha,u),this._props.push("alpha","visible")):"resolution"!==d&&this.add(t,d,"get",u);this._props.push(d)}}};d()&&n.registerPlugin(U)},,function(t,e,i){"use strict";function n(t){return!/^[a-zA-Z]:\\/.test(t)&&/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(t)}i.d(e,"a",(function(){return n}))},function(t,e,i){"use strict";function n(t,e,i=!1){const n=t+(e-t)*Math.random();return i?Math.floor(n):n}i.d(e,"a",(function(){return n}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return I18nLabel}));var n=i(0),r=i(51);class I18nLabel extends n.Container{constructor(t,e){super(),this.onLanguageUpdate=()=>this.refresh(),this.id=t,this.options=e,r.b.onUpdate.connect(this.onLanguageUpdate),this.refresh()}destroy(){var t;r.b.onUpdate.disconnect(this.onLanguageUpdate),null===(t=this.display)||void 0===t||t.destroy(),super.destroy()}refresh(){var t,e;const i=r.b.getEntry(this.id);switch(i.type){case"image":this.updateImage(i);break;default:this.updateText(i)}this.display.x=i.offsetX,this.display.y=i.offsetY,this.display.anchor.x=null!==(t=this.options.anchorX)&&void 0!==t?t:this.display.anchor.x,this.display.anchor.y=null!==(e=this.options.anchorY)&&void 0!==e?e:this.display.anchor.y,this.display.scale.set(i.scale)}updateText(t){if("text"!==t.type)return;const e=this.ensureDisplay(n.Text);e.text=r.b.format(t.text,this.options.params),Object.assign(e.style,this.options),t.fontName&&(e.style.fontFamily=t.fontName)}updateImage(t){if("image"!==t.type)return;const e=this.ensureDisplay(n.Sprite),i=r.b.format(t.text,this.options.params),o=n.Texture.from(i);if(!o)throw new Error("[I18nLabel] Missing texture: "+i);e.texture=o}ensureDisplay(t){var e,i,n;return(null===(e=this.display)||void 0===e?void 0:e.constructor)!==t&&(null===(i=this.display)||void 0===i||i.parent.removeChild(this.display),null===(n=this.display)||void 0===n||n.destroy(),this.display=new t,this.addChild(this.display)),this.display}}},function(t,e,i){var n=i(48),r=i(126),o="".split;t.exports=n((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==r(t)?o.call(t,""):Object(t)}:Object},function(t,e,i){var n=i(195),r=i(48);t.exports=!!Object.getOwnPropertySymbols&&!r((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},function(t,e,i){var n,r,o=i(45),a=i(127),s=o.process,h=o.Deno,u=s&&s.versions||h&&h.version,l=u&&u.v8;l?r=(n=l.split("."))[0]<4?1:n[0]+n[1]:a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(r=n[1]),t.exports=r&&+r},function(t,e,i){var n=i(194);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,e,i){var n=i(70),r=i(48),o=i(198);t.exports=!n&&!r((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},function(t,e,i){var n=i(45),r=i(59),o=n.document,a=r(o)&&r(o.createElement);t.exports=function(t){return a?o.createElement(t):{}}},function(t,e,i){var n=i(58),r=i(125),o=i(321).indexOf,a=i(165);t.exports=function(t,e){var i,s=r(t),h=0,u=[];for(i in s)!n(a,i)&&n(s,i)&&u.push(i);for(;e.length>h;)n(s,i=e[h++])&&(~o(u,i)||u.push(i));return u}},function(t,e,i){var n=i(160),r=Function.toString;"function"!=typeof n.inspectSource&&(n.inspectSource=function(t){return r.call(t)}),t.exports=n.inspectSource},function(t,e,i){var n=i(58),r=i(326),o=i(168),a=i(71);t.exports=function(t,e){for(var i=r(e),s=a.f,h=o.f,u=0;u<i.length;u++){var l=i[u];n(t,l)||s(t,l,h(e,l))}}},function(t,e,i){"use strict";var n,r,o,a=i(48),s=i(131),h=i(73),u=i(58),l=i(49),c=i(159),d=l("iterator"),p=!1;[].keys&&("next"in(o=[].keys())?(r=s(s(o)))!==Object.prototype&&(n=r):p=!0);var f=null==n||a((function(){var t={};return n[d].call(t)!==t}));f&&(n={}),c&&!f||u(n,d)||h(n,d,(function(){return this})),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:p}},function(t,e,i){"use strict";var n=Object.prototype.hasOwnProperty,r="~";function o(){}function a(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function s(t,e,i,n,o){if("function"!=typeof i)throw new TypeError("The listener must be a function");var s=new a(i,n||t,o),h=r?r+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],s]:t._events[h].push(s):(t._events[h]=s,t._eventsCount++),t}function h(t,e){0==--t._eventsCount?t._events=new o:delete t._events[e]}function u(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(r=!1)),u.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)n.call(t,e)&&i.push(r?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},u.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];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},u.prototype.listenerCount=function(t){var e=r?r+t:t,i=this._events[e];return i?i.fn?1:i.length:0},u.prototype.emit=function(t,e,i,n,o,a){var s=r?r+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,i),!0;case 4:return l.fn.call(l.context,e,i,n),!0;case 5:return l.fn.call(l.context,e,i,n,o),!0;case 6:return l.fn.call(l.context,e,i,n,o,a),!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,i);break;case 4:l[u].fn.call(l[u].context,e,i,n);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},u.prototype.on=function(t,e,i){return s(this,t,e,i,!1)},u.prototype.once=function(t,e,i){return s(this,t,e,i,!0)},u.prototype.removeListener=function(t,e,i,n){var o=r?r+t:t;if(!this._events[o])return this;if(!e)return h(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||n&&!a.once||i&&a.context!==i||h(this,o);else{for(var s=0,u=[],l=a.length;s<l;s++)(a[s].fn!==e||n&&!a[s].once||i&&a[s].context!==i)&&u.push(a[s]);u.length?this._events[o]=1===u.length?u[0]:u:h(this,o)}return this},u.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&h(this,e)):(this._events=new o,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=r,u.EventEmitter=u,t.exports=u},function(t,e,i){"use strict";function n(t,e,i){i=i||2;var n,s,h,u,l,p,f,g=e&&e.length,y=g?e[0]*i:t.length,v=r(t,0,y,i,!0),b=[];if(!v||v.next===v.prev)return b;if(g&&(v=function(t,e,i,n){var a,s,h,u,l,p=[];for(a=0,s=e.length;a<s;a++)h=e[a]*n,u=a<s-1?e[a+1]*n:t.length,(l=r(t,h,u,n,!1))===l.next&&(l.steiner=!0),p.push(m(l));for(p.sort(c),a=0;a<p.length;a++)i=o(i=d(p[a],i),i.next);return i}(t,e,v,i)),t.length>80*i){n=h=t[0],s=u=t[1];for(var _=i;_<y;_+=i)(l=t[_])<n&&(n=l),(p=t[_+1])<s&&(s=p),l>h&&(h=l),p>u&&(u=p);f=0!==(f=Math.max(h-n,u-s))?1/f:0}return a(v,b,i,n,s,f),b}function r(t,e,i,n,r){var o,a;if(r===P(t,e,i,n)>0)for(o=e;o<i;o+=n)a=T(o,t[o],t[o+1],a);else for(o=i-n;o>=e;o-=n)a=T(o,t[o],t[o+1],a);return a&&b(a,a.next)&&(A(a),a=a.next),a}function o(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!b(n,n.next)&&0!==v(n.prev,n,n.next))n=n.next;else{if(A(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function a(t,e,i,n,r,c,d){if(t){!d&&c&&function(t,e,i,n){var r=t;do{null===r.z&&(r.z=f(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,n,r,o,a,s,h,u=1;do{for(i=t,t=null,o=null,a=0;i;){for(a++,n=i,s=0,e=0;e<u&&(s++,n=n.nextZ);e++);for(h=u;s>0||h>0&&n;)0!==s&&(0===h||!n||i.z<=n.z)?(r=i,i=i.nextZ,s--):(r=n,n=n.nextZ,h--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;i=n}o.nextZ=null,u*=2}while(a>1)}(r)}(t,n,r,c);for(var p,m,g=t;t.prev!==t.next;)if(p=t.prev,m=t.next,c?h(t,n,r,c):s(t))e.push(p.i/i),e.push(t.i/i),e.push(m.i/i),A(t),t=m.next,g=m.next;else if((t=m)===g){d?1===d?a(t=u(o(t),e,i),e,i,n,r,c,2):2===d&&l(t,e,i,n,r,c):a(o(t),e,i,n,r,c,1);break}}}function s(t){var e=t.prev,i=t,n=t.next;if(v(e,i,n)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(g(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&v(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function h(t,e,i,n){var r=t.prev,o=t,a=t.next;if(v(r,o,a)>=0)return!1;for(var s=r.x<o.x?r.x<a.x?r.x:a.x:o.x<a.x?o.x:a.x,h=r.y<o.y?r.y<a.y?r.y:a.y:o.y<a.y?o.y:a.y,u=r.x>o.x?r.x>a.x?r.x:a.x:o.x>a.x?o.x:a.x,l=r.y>o.y?r.y>a.y?r.y:a.y:o.y>a.y?o.y:a.y,c=f(s,h,e,i,n),d=f(u,l,e,i,n),p=t.prevZ,m=t.nextZ;p&&p.z>=c&&m&&m.z<=d;){if(p!==t.prev&&p!==t.next&&g(r.x,r.y,o.x,o.y,a.x,a.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,m!==t.prev&&m!==t.next&&g(r.x,r.y,o.x,o.y,a.x,a.y,m.x,m.y)&&v(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&g(r.x,r.y,o.x,o.y,a.x,a.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;m&&m.z<=d;){if(m!==t.prev&&m!==t.next&&g(r.x,r.y,o.x,o.y,a.x,a.y,m.x,m.y)&&v(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function u(t,e,i){var n=t;do{var r=n.prev,a=n.next.next;!b(r,a)&&_(r,n,n.next,a)&&C(r,a)&&C(a,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(a.i/i),A(n),A(n.next),n=t=a),n=n.next}while(n!==t);return o(n)}function l(t,e,i,n,r,s){var h=t;do{for(var u=h.next.next;u!==h.prev;){if(h.i!==u.i&&y(h,u)){var l=S(h,u);return h=o(h,h.next),l=o(l,l.next),a(h,e,i,n,r,s),void a(l,e,i,n,r,s)}u=u.next}h=h.next}while(h!==t)}function c(t,e){return t.x-e.x}function d(t,e){var i=function(t,e){var i,n=e,r=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>a){if(a=s,s===r){if(o===n.y)return n;if(o===n.next.y)return n.next}i=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!i)return null;if(r===a)return i;var h,u=i,l=i.x,c=i.y,d=1/0;n=i;do{r>=n.x&&n.x>=l&&r!==n.x&&g(o<c?r:a,o,l,c,o<c?a:r,o,n.x,n.y)&&(h=Math.abs(o-n.y)/(r-n.x),C(n,t)&&(h<d||h===d&&(n.x>i.x||n.x===i.x&&p(i,n)))&&(i=n,d=h)),n=n.next}while(n!==u);return i}(t,e);if(!i)return e;var n=S(i,t),r=o(i,i.next);return o(n,n.next),e===i?r:e}function p(t,e){return v(t.prev,t,e.prev)<0&&v(e.next,t,t.next)<0}function f(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function m(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function g(t,e,i,n,r,o,a,s){return(r-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(n-s)-(i-a)*(e-s)>=0&&(i-a)*(o-s)-(r-a)*(n-s)>=0}function y(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&&_(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(C(t,e)&&C(e,t)&&function(t,e){var i=t,n=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&r<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(v(t.prev,t,e.prev)||v(t,e.prev,e))||b(t,e)&&v(t.prev,t,t.next)>0&&v(e.prev,e,e.next)>0)}function v(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function b(t,e){return t.x===e.x&&t.y===e.y}function _(t,e,i,n){var r=x(v(t,e,i)),o=x(v(t,e,n)),a=x(v(i,n,t)),s=x(v(i,n,e));return r!==o&&a!==s||(!(0!==r||!w(t,i,e))||(!(0!==o||!w(t,n,e))||(!(0!==a||!w(i,t,n))||!(0!==s||!w(i,e,n)))))}function w(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 x(t){return t>0?1:t<0?-1:0}function C(t,e){return v(t.prev,t,t.next)<0?v(t,e,t.next)>=0&&v(t,t.prev,e)>=0:v(t,e,t.prev)<0||v(t,t.next,e)<0}function S(t,e){var i=new E(t.i,t.x,t.y),n=new E(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,o.next=n,n.prev=o,n}function T(t,e,i,n){var r=new E(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function A(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 E(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 P(t,e,i,n){for(var r=0,o=e,a=i-n;o<i;o+=n)r+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return r}t.exports=n,t.exports.default=n,n.deviation=function(t,e,i,n){var r=e&&e.length,o=r?e[0]*i:t.length,a=Math.abs(P(t,0,o,i));if(r)for(var s=0,h=e.length;s<h;s++){var u=e[s]*i,l=s<h-1?e[s+1]*i:t.length;a-=Math.abs(P(t,u,l,i))}var c=0;for(s=0;s<n.length;s+=3){var d=n[s]*i,p=n[s+1]*i,f=n[s+2]*i;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===a&&0===c?0:Math.abs((c-a)/a)},n.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},n=0,r=0;r<t.length;r++){for(var o=0;o<t[r].length;o++)for(var a=0;a<e;a++)i.vertices.push(t[r][o][a]);r>0&&(n+=t[r-1].length,i.holes.push(n))}return i}},function(t,e,i){"use strict";var n=i(45),r=i(70),o=i(206),a=i(73),s=i(353),h=i(48),u=i(207),l=i(92),c=i(72),d=i(208),p=i(354),f=i(131),m=i(117),g=i(169).f,y=i(71).f,v=i(355),b=i(170),_=i(115),w=_.get,x=_.set,C=n.ArrayBuffer,S=C,T=n.DataView,A=T&&T.prototype,E=Object.prototype,P=n.RangeError,M=p.pack,I=p.unpack,k=function(t){return[255&t]},O=function(t){return[255&t,t>>8&255]},R=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},D=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},L=function(t){return M(t,23,4)},N=function(t){return M(t,52,8)},B=function(t,e){y(t.prototype,e,{get:function(){return w(this)[e]}})},F=function(t,e,i,n){var r=d(i),o=w(t);if(r+e>o.byteLength)throw P("Wrong index");var a=w(o.buffer).bytes,s=r+o.byteOffset,h=a.slice(s,s+e);return n?h:h.reverse()},z=function(t,e,i,n,r,o){var a=d(i),s=w(t);if(a+e>s.byteLength)throw P("Wrong index");for(var h=w(s.buffer).bytes,u=a+s.byteOffset,l=n(+r),c=0;c<e;c++)h[u+c]=l[o?c:e-c-1]};if(o){if(!h((function(){C(1)}))||!h((function(){new C(-1)}))||h((function(){return new C,new C(1.5),new C(NaN),"ArrayBuffer"!=C.name}))){for(var j,G=(S=function(t){return u(this,S),new C(d(t))}).prototype=C.prototype,U=g(C),H=0;U.length>H;)(j=U[H++])in S||a(S,j,C[j]);G.constructor=S}m&&f(A)!==E&&m(A,E);var V=new T(new S(2)),W=A.setInt8;V.setInt8(0,2147483648),V.setInt8(1,2147483649),!V.getInt8(0)&&V.getInt8(1)||s(A,{setInt8:function(t,e){W.call(this,t,e<<24>>24)},setUint8:function(t,e){W.call(this,t,e<<24>>24)}},{unsafe:!0})}else S=function(t){u(this,S,"ArrayBuffer");var e=d(t);x(this,{bytes:v.call(new Array(e),0),byteLength:e}),r||(this.byteLength=e)},T=function(t,e,i){u(this,T,"DataView"),u(t,S,"DataView");var n=w(t).byteLength,o=l(e);if(o<0||o>n)throw P("Wrong offset");if(o+(i=void 0===i?n-o:c(i))>n)throw P("Wrong length");x(this,{buffer:t,byteLength:i,byteOffset:o}),r||(this.buffer=t,this.byteLength=i,this.byteOffset=o)},r&&(B(S,"byteLength"),B(T,"buffer"),B(T,"byteLength"),B(T,"byteOffset")),s(T.prototype,{getInt8:function(t){return F(this,1,t)[0]<<24>>24},getUint8:function(t){return F(this,1,t)[0]},getInt16:function(t){var e=F(this,2,t,arguments.length>1?arguments[1]:void 0);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=F(this,2,t,arguments.length>1?arguments[1]:void 0);return e[1]<<8|e[0]},getInt32:function(t){return D(F(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return D(F(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return I(F(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return I(F(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,e){z(this,1,t,k,e)},setUint8:function(t,e){z(this,1,t,k,e)},setInt16:function(t,e){z(this,2,t,O,e,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,e){z(this,2,t,O,e,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,e){z(this,4,t,R,e,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,e){z(this,4,t,R,e,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,e){z(this,4,t,L,e,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,e){z(this,8,t,N,e,arguments.length>2?arguments[2]:void 0)}});b(S,"ArrayBuffer"),b(T,"DataView"),t.exports={ArrayBuffer:S,DataView:T}},function(t,e){t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},function(t,e){t.exports=function(t,e,i){if(!(t instanceof e))throw TypeError("Incorrect "+(i?i+" ":"")+"invocation");return t}},function(t,e,i){var n=i(92),r=i(72);t.exports=function(t){if(void 0===t)return 0;var e=n(t),i=r(e);if(e!==i)throw RangeError("Wrong length or index");return i}},function(t,e,i){var n=i(173);t.exports=function(t,e,i){if(n(t),void 0===e)return t;switch(i){case 0:return function(){return t.call(e)};case 1:return function(i){return t.call(e,i)};case 2:return function(i,n){return t.call(e,i,n)};case 3:return function(i,n,r){return t.call(e,i,n,r)}}return function(){return t.apply(e,arguments)}}},function(t,e,i){"use strict";var n=i(101),r=i(376).trim;n({target:"String",proto:!0,forced:i(377)("trim")},{trim:function(){return r(this)}})},function(t,e){t.exports="\t\n\v\f\r    \u2028\u2029\ufeff"},function(t,e,i){"use strict";i(29),i(34),i(30),i(63),Object.defineProperty(e,"__esModule",{value:!0}),e.unpackArray=e.compressArray=void 0;const n=i(178);function r(t,e,i){const n=e.ranges[i],r=e.sizes[i];return(t-n.min)/r*65535}e.compressArray=function(t,e=3){const i=n.getBounds(t,e),o=2*e+1+1;let a=t.length/2+o;a+=a%1;const s=new Float32Array(a),h=new Uint16Array(s.buffer);let u=0;for(let n=0;n<t.length;n+=e)for(let n=0;n<e;n++)h[2*o+u]=r(t[u],i,n),u++;u=0,s[u++]=t.length,s[u++]=o-1-1;for(let t=0;t<e;t++)s[u++]=i.ranges[t].min,s[u++]=i.sizes[t];return h},e.unpackArray=function(t){let e=new Float32Array(t.buffer,0,2),i=0;const n=e[i++],r=e[i++],o=[];e=new Float32Array(t.buffer,0,2+r);for(let t=0;t<r/2;t++)o[t]={min:e[i++],size:e[i++]};const a=o.length;i*=2;let s=0;const h=new Float32Array(n);for(let e=0;e<n;e+=a)for(let e=0;e<a;e++)h[s++]=t[i++]/65535*o[e].size+o[e].min;return h}},function(t,e,i){"use strict";i(29),i(63),i(30),Object.defineProperty(e,"__esModule",{value:!0}),e.unzipArray=e.zipArray=void 0;const n=i(445);e.zipArray=function(t){return n.deflate(t.buffer)},e.unzipArray=function(t){return new Uint16Array(n.inflate(t).buffer)}},function(t,e,i){"use strict";t.exports=function(t,e,i,n){for(var r=65535&t|0,o=t>>>16&65535|0,a=0;0!==i;){i-=a=i>2e3?2e3:i;do{o=o+(r=r+e[n++]|0)|0}while(--a);r%=65521,o%=65521}return r|o<<16|0}},function(t,e,i){"use strict";var n=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();t.exports=function(t,e,i,r){var o=n,a=r+i;t^=-1;for(var s=r;s<a;s++)t=t>>>8^o[255&(t^e[s])];return-1^t}},function(t,e,i){"use strict";var n=i(83),r=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var a=new n.Buf8(256),s=0;s<256;s++)a[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function h(t,e){if(e<65534&&(t.subarray&&o||!t.subarray&&r))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var i="",a=0;a<e;a++)i+=String.fromCharCode(t[a]);return i}a[254]=a[254]=1,e.string2buf=function(t){var e,i,r,o,a,s=t.length,h=0;for(o=0;o<s;o++)55296==(64512&(i=t.charCodeAt(o)))&&o+1<s&&56320==(64512&(r=t.charCodeAt(o+1)))&&(i=65536+(i-55296<<10)+(r-56320),o++),h+=i<128?1:i<2048?2:i<65536?3:4;for(e=new n.Buf8(h),a=0,o=0;a<h;o++)55296==(64512&(i=t.charCodeAt(o)))&&o+1<s&&56320==(64512&(r=t.charCodeAt(o+1)))&&(i=65536+(i-55296<<10)+(r-56320),o++),i<128?e[a++]=i:i<2048?(e[a++]=192|i>>>6,e[a++]=128|63&i):i<65536?(e[a++]=224|i>>>12,e[a++]=128|i>>>6&63,e[a++]=128|63&i):(e[a++]=240|i>>>18,e[a++]=128|i>>>12&63,e[a++]=128|i>>>6&63,e[a++]=128|63&i);return e},e.buf2binstring=function(t){return h(t,t.length)},e.binstring2buf=function(t){for(var e=new n.Buf8(t.length),i=0,r=e.length;i<r;i++)e[i]=t.charCodeAt(i);return e},e.buf2string=function(t,e){var i,n,r,o,s=e||t.length,u=new Array(2*s);for(n=0,i=0;i<s;)if((r=t[i++])<128)u[n++]=r;else if((o=a[r])>4)u[n++]=65533,i+=o-1;else{for(r&=2===o?31:3===o?15:7;o>1&&i<s;)r=r<<6|63&t[i++],o--;o>1?u[n++]=65533:r<65536?u[n++]=r:(r-=65536,u[n++]=55296|r>>10&1023,u[n++]=56320|1023&r)}return h(u,n)},e.utf8border=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;i>=0&&128==(192&t[i]);)i--;return i<0||0===i?e:i+a[t[i]]>e?i:e}},function(t,e,i){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(t,e,i){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(t,e,i){"use strict";i(29),i(34),i(30),Object.defineProperty(e,"__esModule",{value:!0}),e.transformMat4=e.multiplyMat4=e.createMat4=void 0,e.createMat4=function(){return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},e.multiplyMat4=function(t,e,i){const n=e[0],r=e[1],o=e[2],a=e[3],s=e[4],h=e[5],u=e[6],l=e[7],c=e[8],d=e[9],p=e[10],f=e[11],m=e[12],g=e[13],y=e[14],v=e[15];let b=i[0],_=i[1],w=i[2],x=i[3];return t[0]=b*n+_*s+w*c+x*m,t[1]=b*r+_*h+w*d+x*g,t[2]=b*o+_*u+w*p+x*y,t[3]=b*a+_*l+w*f+x*v,b=i[4],_=i[5],w=i[6],x=i[7],t[4]=b*n+_*s+w*c+x*m,t[5]=b*r+_*h+w*d+x*g,t[6]=b*o+_*u+w*p+x*y,t[7]=b*a+_*l+w*f+x*v,b=i[8],_=i[9],w=i[10],x=i[11],t[8]=b*n+_*s+w*c+x*m,t[9]=b*r+_*h+w*d+x*g,t[10]=b*o+_*u+w*p+x*y,t[11]=b*a+_*l+w*f+x*v,b=i[12],_=i[13],w=i[14],x=i[15],t[12]=b*n+_*s+w*c+x*m,t[13]=b*r+_*h+w*d+x*g,t[14]=b*o+_*u+w*p+x*y,t[15]=b*a+_*l+w*f+x*v,t},e.transformMat4=function(t,e,i){const n=e[0],r=e[1],o=e[2];let a=i[3]*n+i[7]*r+i[11]*o+i[15];return a=a||1,t[0]=(i[0]*n+i[4]*r+i[8]*o+i[12])/a,t[1]=(i[1]*n+i[5]*r+i[9]*o+i[13])/a,t[2]=(i[2]*n+i[6]*r+i[10]*o+i[14])/a,t}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.transformPositions=void 0,e.transformPositions=function(t,e){const i=e[0],n=e[1],r=e[2],o=e[3],a=e[4],s=e[5],h=e[6],u=e[7],l=e[8],c=e[9],d=e[10],p=e[11],f=e[12],m=e[13],g=e[14],y=e[15];for(let e=0;e<t.length;e+=3){const v=t[e],b=t[e+1],_=t[e+2];let w=o*v+u*b+p*_+y;w=w||1,t[e]=(i*v+a*b+l*_+f)/w,t[e+1]=(n*v+s*b+c*_+m)/w,t[e+2]=(r*v+h*b+d*_+g)/w}}},function(t,e,i){(function(n,r){var o;!function(n){var a=n.Promise,s=a&&"resolve"in a&&"reject"in a&&"all"in a&&"race"in a&&function(){var t;return new a((function(e){t=e})),"function"==typeof t}();e?(e.Promise=s?a:C,e.Polyfill=C):void 0===(o=function(){return s?a:C}.call(e,i,e,t))||(t.exports=o);var h=function(){};function u(t){return"[object Array]"===Object.prototype.toString.call(t)}var l,c=void 0!==r?r:setTimeout,d=[];function p(){for(var t=0;t<d.length;t++)d[t][0](d[t][1]);d=[],l=!1}function f(t,e){d.push([t,e]),l||(l=!0,c(p,0))}function m(t){var e=t.owner,i=e.state_,n=e.data_,r=t[i],o=t.then;if("function"==typeof r){i="fulfilled";try{n=r(n)}catch(t){b(o,t)}}g(o,n)||("fulfilled"===i&&y(o,n),"rejected"===i&&b(o,n))}function g(t,e){var i;try{if(t===e)throw new TypeError("A promises callback cannot return that same promise.");if(e&&("function"==typeof e||"object"==typeof e)){var n=e.then;if("function"==typeof n)return n.call(e,(function(n){i||(i=!0,e!==n?y(t,n):v(t,n))}),(function(e){i||(i=!0,b(t,e))})),!0}}catch(e){return i||b(t,e),!0}return!1}function y(t,e){t!==e&&g(t,e)||v(t,e)}function v(t,e){"pending"===t.state_&&(t.state_="sealed",t.data_=e,f(w,t))}function b(t,e){"pending"===t.state_&&(t.state_="sealed",t.data_=e,f(x,t))}function _(t){var e=t.then_;t.then_=void 0;for(var i=0;i<e.length;i++)m(e[i])}function w(t){t.state_="fulfilled",_(t)}function x(t){t.state_="rejected",_(t)}function C(t){if("function"!=typeof t)throw new TypeError("Promise constructor takes a function argument");if(this instanceof C==!1)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this.then_=[],function(t,e){function i(t){b(e,t)}try{t((function(t){y(e,t)}),i)}catch(t){i(t)}}(t,this)}C.prototype={constructor:C,state_:"pending",then_:null,data_:void 0,then:function(t,e){var i={owner:this,then:new this.constructor(h),fulfilled:t,rejected:e};return"fulfilled"===this.state_||"rejected"===this.state_?f(m,i):this.then_.push(i),i.then},catch:function(t){return this.then(null,t)}},C.all=function(t){if(!u(t))throw new TypeError("You must pass an array to Promise.all().");return new this((function(e,i){var n=[],r=0;function o(t){return r++,function(i){n[t]=i,--r||e(n)}}for(var a,s=0;s<t.length;s++)(a=t[s])&&"function"==typeof a.then?a.then(o(s),i):n[s]=a;r||e(n)}))},C.race=function(t){if(!u(t))throw new TypeError("You must pass an array to Promise.race().");return new this((function(e,i){for(var n,r=0;r<t.length;r++)(n=t[r])&&"function"==typeof n.then?n.then(e,i):e(n)}))},C.resolve=function(t){return t&&"object"==typeof t&&t.constructor===this?t:new this((function(e){e(t)}))},C.reject=function(t){return new this((function(e,i){i(t)}))}}("undefined"!=typeof window?window:void 0!==n?n:"undefined"!=typeof self?self:this)}).call(this,i(82),i(332).setImmediate)},function(t,e,i){"use strict";var n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){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={},i=0;i<10;i++)e["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var i,s,h=a(t),u=1;u<arguments.length;u++){for(var l in i=Object(arguments[u]))r.call(i,l)&&(h[l]=i[l]);if(n){s=n(i);for(var c=0;c<s.length;c++)o.call(i,s[c])&&(h[s[c]]=i[s[c]])}}return h}},function(t,e,i){var n;i(56),i(210),function(r,o){"use strict";var a="model",s="name",h="type",u="vendor",l="version",c="mobile",d="tablet",p="smarttv",f={extend:function(t,e){var i={};for(var n in t)e[n]&&e[n].length%2==0?i[n]=e[n].concat(t[n]):i[n]=t[n];return i},has:function(t,e){return"string"==typeof t&&-1!==e.toLowerCase().indexOf(t.toLowerCase())},lowerize:function(t){return t.toLowerCase()},major:function(t){return"string"==typeof t?t.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(t,e){return t=t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),void 0===e?t:t.substring(0,255)}},m={rgx:function(t,e){for(var i,n,r,o,a,s,h=0;h<e.length&&!a;){var u=e[h],l=e[h+1];for(i=n=0;i<u.length&&!a;)if(a=u[i++].exec(t))for(r=0;r<l.length;r++)s=a[++n],"object"==typeof(o=l[r])&&o.length>0?2==o.length?"function"==typeof o[1]?this[o[0]]=o[1].call(this,s):this[o[0]]=o[1]:3==o.length?"function"!=typeof o[1]||o[1].exec&&o[1].test?this[o[0]]=s?s.replace(o[1],o[2]):void 0:this[o[0]]=s?o[1].call(this,s,o[2]):void 0:4==o.length&&(this[o[0]]=s?o[3].call(this,s.replace(o[1],o[2])):void 0):this[o]=s||void 0;h+=2}},str:function(t,e){for(var i in e)if("object"==typeof e[i]&&e[i].length>0){for(var n=0;n<e[i].length;n++)if(f.has(e[i][n],t))return"?"===i?void 0:i}else if(f.has(e[i],t))return"?"===i?void 0:i;return t}},g={browser:{oldSafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}},oldEdge:{version:{.1:"12.",21:"13.",31:"14.",39:"15.",41:"16.",42:"17.",44:"18."}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},y={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[l,[s,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[l,[s,"Edge"]],[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]{3,6})\b.+version\/([\w\.-]+)/i,/(opera)(?:.+version\/|[\/\s]+)([\w\.]+)/i],[s,l],[/opios[\/\s]+([\w\.]+)/i],[l,[s,"Opera Mini"]],[/\sopr\/([\w\.]+)/i],[l,[s,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(ba?idubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i,/(rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([\w\.]+)/i,/(weibo)__([\d\.]+)/i],[s,l],[/(?:[\s\/]uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[l,[s,"UCBrowser"]],[/(?:windowswechat)?\sqbcore\/([\w\.]+)\b.*(?:windowswechat)?/i],[l,[s,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[l,[s,"WeChat"]],[/konqueror\/([\w\.]+)/i],[l,[s,"Konqueror"]],[/trident.+rv[:\s]([\w\.]{1,9})\b.+like\sgecko/i],[l,[s,"IE"]],[/yabrowser\/([\w\.]+)/i],[l,[s,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[s,/(.+)/,"$1 Secure Browser"],l],[/focus\/([\w\.]+)/i],[l,[s,"Firefox Focus"]],[/opt\/([\w\.]+)/i],[l,[s,"Opera Touch"]],[/coc_coc_browser\/([\w\.]+)/i],[l,[s,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[l,[s,"Dolphin"]],[/coast\/([\w\.]+)/i],[l,[s,"Opera Coast"]],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[l,[s,"MIUI Browser"]],[/fxios\/([\w\.-]+)/i],[l,[s,"Firefox"]],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[s,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[s,/(.+)/,"$1 Browser"],l],[/(comodo_dragon)\/([\w\.]+)/i],[[s,/_/g," "],l],[/\s(electron)\/([\w\.]+)\ssafari/i,/(tesla)(?:\sqtcarbrowser|\/(20[12]\d\.[\w\.-]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/\s]?([\w\.]+)/i],[s,l],[/(MetaSr)[\/\s]?([\w\.]+)/i,/(LBBROWSER)/i],[s],[/;fbav\/([\w\.]+);/i],[l,[s,"Facebook"]],[/FBAN\/FBIOS|FB_IAB\/FB4A/i],[[s,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/\s]([\w\.-]+)/i],[s,l],[/\bgsa\/([\w\.]+)\s.*safari\//i],[l,[s,"GSA"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[l,[s,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[s,"Chrome WebView"],l],[/droid.+\sversion\/([\w\.]+)\b.+(?:mobile\ssafari|safari)/i],[l,[s,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[s,l],[/version\/([\w\.]+)\s.*mobile\/\w+\s(safari)/i],[l,[s,"Mobile Safari"]],[/version\/([\w\.]+)\s.*(mobile\s?safari|safari)/i],[l,s],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[s,[l,m.str,g.browser.oldSafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[s,l],[/(navigator|netscape)\/([\w\.-]+)/i],[[s,"Netscape"],l],[/ile\svr;\srv:([\w\.]+)\).+firefox/i],[l,[s,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(firefox)\/([\w\.]+)\s[\w\s\-]+\/[\w\.]+$/i,/(mozilla)\/([\w\.]+)\s.+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[s,l]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",f.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/\b(aarch64|armv?8e?l?)\b/i],[["architecture","arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[["architecture","armhf"]],[/windows\s(ce|mobile);\sppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[["architecture",/ower/,"",f.lowerize]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?:64|(?=v(?:[1-7]|[5-7]1)l?|;|eabi))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[["architecture",f.lowerize]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus\s10)/i],[a,[u,"Samsung"],[h,d]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy\snexus)/i,/\ssamsung[\s-]([\w-]+)/i,/sec-(sgh\w+)/i],[a,[u,"Samsung"],[h,c]],[/\((ip(?:hone|od)[\s\w]*);/i],[a,[u,"Apple"],[h,c]],[/\((ipad);[\w\s\),;-]+apple/i,/applecoremedia\/[\w\.]+\s\((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[a,[u,"Apple"],[h,d]],[/\b((?:agr|ags[23]|bah2?|sht?)-a?[lw]\d{2})/i],[a,[u,"Huawei"],[h,d]],[/d\/huawei([\w\s-]+)[;\)]/i,/\b(nexus\s6p|vog-[at]?l\d\d|ane-[at]?l[x\d]\d|eml-a?l\d\da?|lya-[at]?l\d[\dc]|clt-a?l\d\di?|ele-l\d\d)/i,/\b(\w{2,4}-[atu][ln][01259][019])[;\)\s]/i],[a,[u,"Huawei"],[h,c]],[/\b(poco[\s\w]+)(?:\sbuild|\))/i,/\b;\s(\w+)\sbuild\/hm\1/i,/\b(hm[\s\-_]?note?[\s_]?(?:\d\w)?)\sbuild/i,/\b(redmi[\s\-_]?(?:note|k)?[\w\s_]+)(?:\sbuild|\))/i,/\b(mi[\s\-_]?(?:a\d|one|one[\s_]plus|note lte)?[\s_]?(?:\d?\w?)[\s_]?(?:plus)?)\sbuild/i],[[a,/_/g," "],[u,"Xiaomi"],[h,c]],[/\b(mi[\s\-_]?(?:pad)(?:[\w\s_]+))(?:\sbuild|\))/i],[[a,/_/g," "],[u,"Xiaomi"],[h,d]],[/;\s(\w+)\sbuild.+\soppo/i,/\s(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i],[a,[u,"OPPO"],[h,c]],[/\svivo\s(\w+)(?:\sbuild|\))/i,/\s(v[12]\d{3}\w?[at])(?:\sbuild|;)/i],[a,[u,"Vivo"],[h,c]],[/\s(rmx[12]\d{3})(?:\sbuild|;)/i],[a,[u,"Realme"],[h,c]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)\b[\w\s]+build\//i,/\smot(?:orola)?[\s-](\w*)/i,/((?:moto[\s\w\(\)]+|xt\d{3,4}|nexus\s6)(?=\sbuild|\)))/i],[a,[u,"Motorola"],[h,c]],[/\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[a,[u,"Motorola"],[h,d]],[/((?=lg)?[vl]k\-?\d{3})\sbuild|\s3\.[\s\w;-]{10}lg?-([06cv9]{3,4})/i],[a,[u,"LG"],[h,d]],[/(lm-?f100[nv]?|nexus\s[45])/i,/lg[e;\s\/-]+((?!browser|netcast)\w+)/i,/\blg(\-?[\d\w]+)\sbuild/i],[a,[u,"LG"],[h,c]],[/(ideatab[\w\-\s]+)/i,/lenovo\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+)|yt[\d\w-]{6}|tb[\d\w-]{6})/i],[a,[u,"Lenovo"],[h,d]],[/(?:maemo|nokia).*(n900|lumia\s\d+)/i,/nokia[\s_-]?([\w\.-]*)/i],[[a,/_/g," "],[u,"Nokia"],[h,c]],[/droid.+;\s(pixel\sc)[\s)]/i],[a,[u,"Google"],[h,d]],[/droid.+;\s(pixel[\s\daxl]{0,6})(?:\sbuild|\))/i],[a,[u,"Google"],[h,c]],[/droid.+\s([c-g]\d{4}|so[-l]\w+|xq-a\w[4-7][12])(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[a,[u,"Sony"],[h,c]],[/sony\stablet\s[ps]\sbuild\//i,/(?:sony)?sgp\w+(?:\sbuild\/|\))/i],[[a,"Xperia Tablet"],[u,"Sony"],[h,d]],[/\s(kb2005|in20[12]5|be20[12][59])\b/i,/\ba000(1)\sbuild/i,/\boneplus\s(a\d{4})[\s)]/i],[a,[u,"OnePlus"],[h,c]],[/(alexa)webm/i,/(kf[a-z]{2}wi)(\sbuild\/|\))/i,/(kf[a-z]+)(\sbuild\/|\)).+silk\//i],[a,[u,"Amazon"],[h,d]],[/(sd|kf)[0349hijorstuw]+(\sbuild\/|\)).+silk\//i],[[a,"Fire Phone"],[u,"Amazon"],[h,c]],[/\((playbook);[\w\s\),;-]+(rim)/i],[a,u,[h,d]],[/((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10;\s(\w+)/i],[a,[u,"BlackBerry"],[h,c]],[/(?:\b|asus_)(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus\s7|padfone|p00[cj])/i],[a,[u,"ASUS"],[h,d]],[/\s(z[es]6[027][01][km][ls]|zenfone\s\d\w?)\b/i],[a,[u,"ASUS"],[h,c]],[/(nexus\s9)/i],[a,[u,"HTC"],[h,d]],[/(htc)[;_\s-]{1,2}([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[u,[a,/_/g," "],[h,c]],[/droid[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[a,[u,"Acer"],[h,d]],[/droid.+;\s(m[1-5]\snote)\sbuild/i,/\bmz-([\w-]{2,})/i],[a,[u,"Meizu"],[h,c]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i,/(microsoft);\s(lumia[\s\w]+)/i,/(lenovo)[_\s-]?([\w-]+)/i,/linux;.+(jolla);/i,/droid.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[u,a,[h,c]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i,/[;\/]\s?(le[\s\-]+pan)[\s\-]+(\w{1,9})\sbuild/i,/[;\/]\s?(trinity)[\-\s]*(t\d{3})\sbuild/i,/\b(gigaset)[\s\-]+(q\w{1,9})\sbuild/i,/\b(vodafone)\s([\w\s]+)(?:\)|\sbuild)/i],[u,a,[h,d]],[/\s(surface\sduo)\s/i],[a,[u,"Microsoft"],[h,d]],[/droid\s[\d\.]+;\s(fp\du?)\sbuild/i],[a,[u,"Fairphone"],[h,c]],[/\s(u304aa)\sbuild/i],[a,[u,"AT&T"],[h,c]],[/sie-(\w*)/i],[a,[u,"Siemens"],[h,c]],[/[;\/]\s?(rct\w+)\sbuild/i],[a,[u,"RCA"],[h,d]],[/[;\/\s](venue[\d\s]{2,7})\sbuild/i],[a,[u,"Dell"],[h,d]],[/[;\/]\s?(q(?:mv|ta)\w+)\sbuild/i],[a,[u,"Verizon"],[h,d]],[/[;\/]\s(?:barnes[&\s]+noble\s|bn[rt])([\w\s\+]*)\sbuild/i],[a,[u,"Barnes & Noble"],[h,d]],[/[;\/]\s(tm\d{3}\w+)\sbuild/i],[a,[u,"NuVision"],[h,d]],[/;\s(k88)\sbuild/i],[a,[u,"ZTE"],[h,d]],[/;\s(nx\d{3}j)\sbuild/i],[a,[u,"ZTE"],[h,c]],[/[;\/]\s?(gen\d{3})\sbuild.*49h/i],[a,[u,"Swiss"],[h,c]],[/[;\/]\s?(zur\d{3})\sbuild/i],[a,[u,"Swiss"],[h,d]],[/[;\/]\s?((zeki)?tb.*\b)\sbuild/i],[a,[u,"Zeki"],[h,d]],[/[;\/]\s([yr]\d{2})\sbuild/i,/[;\/]\s(dragon[\-\s]+touch\s|dt)(\w{5})\sbuild/i],[[u,"Dragon Touch"],a,[h,d]],[/[;\/]\s?(ns-?\w{0,9})\sbuild/i],[a,[u,"Insignia"],[h,d]],[/[;\/]\s?((nxa|Next)-?\w{0,9})\sbuild/i],[a,[u,"NextBook"],[h,d]],[/[;\/]\s?(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05]))\sbuild/i],[[u,"Voice"],a,[h,c]],[/[;\/]\s?(lvtel\-)?(v1[12])\sbuild/i],[[u,"LvTel"],a,[h,c]],[/;\s(ph-1)\s/i],[a,[u,"Essential"],[h,c]],[/[;\/]\s?(v(100md|700na|7011|917g).*\b)\sbuild/i],[a,[u,"Envizen"],[h,d]],[/[;\/]\s?(trio[\s\w\-\.]+)\sbuild/i],[a,[u,"MachSpeed"],[h,d]],[/[;\/]\s?tu_(1491)\sbuild/i],[a,[u,"Rotor"],[h,d]],[/(shield[\w\s]+)\sbuild/i],[a,[u,"Nvidia"],[h,d]],[/(sprint)\s(\w+)/i],[u,a,[h,c]],[/(kin\.[onetw]{3})/i],[[a,/\./g," "],[u,"Microsoft"],[h,c]],[/droid\s[\d\.]+;\s(cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[a,[u,"Zebra"],[h,d]],[/droid\s[\d\.]+;\s(ec30|ps20|tc[2-8]\d[kx])\)/i],[a,[u,"Zebra"],[h,c]],[/\s(ouya)\s/i,/(nintendo)\s([wids3utch]+)/i],[u,a,[h,"console"]],[/droid.+;\s(shield)\sbuild/i],[a,[u,"Nvidia"],[h,"console"]],[/(playstation\s[345portablevi]+)/i],[a,[u,"Sony"],[h,"console"]],[/[\s\(;](xbox(?:\sone)?(?!;\sxbox))[\s\);]/i],[a,[u,"Microsoft"],[h,"console"]],[/smart-tv.+(samsung)/i],[u,[h,p]],[/hbbtv.+maple;(\d+)/i],[[a,/^/,"SmartTV"],[u,"Samsung"],[h,p]],[/(?:linux;\snetcast.+smarttv|lg\snetcast\.tv-201\d)/i],[[u,"LG"],[h,p]],[/(apple)\s?tv/i],[u,[a,"Apple TV"],[h,p]],[/crkey/i],[[a,"Chromecast"],[u,"Google"],[h,p]],[/droid.+aft([\w])(\sbuild\/|\))/i],[a,[u,"Amazon"],[h,p]],[/\(dtv[\);].+(aquos)/i],[a,[u,"Sharp"],[h,p]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[u,f.trim],[a,f.trim],[h,p]],[/[\s\/\(](android\s|smart[-\s]?|opera\s)tv[;\)\s]/i],[[h,p]],[/((pebble))app\/[\d\.]+\s/i],[u,a,[h,"wearable"]],[/droid.+;\s(glass)\s\d/i],[a,[u,"Google"],[h,"wearable"]],[/droid\s[\d\.]+;\s(wt63?0{2,3})\)/i],[a,[u,"Zebra"],[h,"wearable"]],[/(tesla)(?:\sqtcarbrowser|\/20[12]\d\.[\w\.-]+)/i],[u,[h,"embedded"]],[/droid .+?; ([^;]+?)(?: build|\) applewebkit).+? mobile safari/i],[a,[h,c]],[/droid .+?;\s([^;]+?)(?: build|\) applewebkit).+?(?! mobile) safari/i],[a,[h,d]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[h,f.lowerize]],[/(android[\w\.\s\-]{0,9});.+build/i],[a,[u,"Generic"]],[/(phone)/i],[[h,c]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[l,[s,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[l,[s,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[s,l],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[l,s]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[s,l],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)(?!.+xbox)/i],[s,[l,m.str,g.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[s,"Windows"],[l,m.str,g.os.windows.version]],[/ip[honead]{2,4}\b(?:.*os\s([\w]+)\slike\smac|;\sopera)/i,/cfnetwork\/.+darwin/i],[[l,/_/g,"."],[s,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)(?!.+haiku)/i],[[s,"Mac OS"],[l,/_/g,"."]],[/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/\((series40);/i],[s,l],[/\(bb(10);/i],[l,[s,"BlackBerry"]],[/(?:symbian\s?os|symbos|s60(?=;)|series60)[\/\s-]?([\w\.]*)/i],[l,[s,"Symbian"]],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[s,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[l,[s,"webOS"]],[/crkey\/([\d\.]+)/i],[l,[s,"Chromecast"]],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[s,"Chromium OS"],l],[/(nintendo|playstation)\s([wids345portablevuch]+)/i,/(xbox);\s+xbox\s([^\);]+)/i,/(mint)[\/\s\(\)]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?=\slinux)|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus|raspbian)(?:\sgnu\/linux)?(?:\slinux)?[\/\s-]?(?!chrom|package)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i,/\s([frentopc-]{0,4}bsd|dragonfly)\s?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku)\s(\w+)/i],[s,l],[/(sunos)\s?([\w\.\d]*)/i],[[s,"Solaris"],l],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[s,l]]},v=function(t,e){if("object"==typeof t&&(e=t,t=void 0),!(this instanceof v))return new v(t,e).getResult();var i=t||(void 0!==r&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),n=e?f.extend(y,e):y;return this.getBrowser=function(){var t={name:void 0,version:void 0};return m.rgx.call(t,i,n.browser),t.major=f.major(t.version),t},this.getCPU=function(){var t={architecture:void 0};return m.rgx.call(t,i,n.cpu),t},this.getDevice=function(){var t={vendor:void 0,model:void 0,type:void 0};return m.rgx.call(t,i,n.device),t},this.getEngine=function(){var t={name:void 0,version:void 0};return m.rgx.call(t,i,n.engine),t},this.getOS=function(){var t={name:void 0,version:void 0};return m.rgx.call(t,i,n.os),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(t){return i="string"==typeof t&&t.length>255?f.trim(t,255):t,this},this.setUA(i),this};v.VERSION="0.7.28",v.BROWSER={NAME:s,MAJOR:"major",VERSION:l},v.CPU={ARCHITECTURE:"architecture"},v.DEVICE={MODEL:a,VENDOR:u,TYPE:h,CONSOLE:"console",MOBILE:c,SMARTTV:p,TABLET:d,WEARABLE:"wearable",EMBEDDED:"embedded"},v.ENGINE={NAME:s,VERSION:l},v.OS={NAME:s,VERSION:l},void 0!==e?(void 0!==t&&t.exports&&(e=t.exports=v),e.UAParser=v):void 0===(n=function(){return v}.call(e,i,e,t))||(t.exports=n);var b=void 0!==r&&(r.jQuery||r.Zepto);if(b&&!b.ua){var _=new v;b.ua=_.getResult(),b.ua.get=function(){return _.getUA()},b.ua.set=function(t){_.setUA(t);var e=_.getResult();for(var i in e)b.ua[i]=e[i]}}}("object"==typeof window?window:this)},function(t,e,i){"use strict";function n(t){const e=[],i={};return t.forEach(t=>{i[t]||(i[t]=!0,e.push("#define "+t))}),e.join("\n")}i.d(e,"a",(function(){return n}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));i(56);const n=/\s*?\#extension(.|)*?\n/g;function r(t,e){var i,r,o,a;let s=t.filter(t=>{var e;return null===(e=t.vertex)||void 0===e?void 0:e.header}).map(t=>e&&t.vertex2?t.vertex2.header:t.vertex.header).join("\n");const h=null!==(r=null===(i=s.match(n))||void 0===i?void 0:i.join("\n"))&&void 0!==r?r:"";s=s.replace(n,"");let u=t.filter(t=>{var e;return null===(e=t.fragment)||void 0===e?void 0:e.header}).map(t=>e&&t.fragment2?t.fragment2.header:t.fragment.header).join("\n");const l=null!==(a=null===(o=u.match(n))||void 0===o?void 0:o.join("\n"))&&void 0!==a?a:"";return u=u.replace(n,""),{vertex:{variables:s,extensions:h},fragment:{variables:u,extensions:l}}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));const n={fragment:{header:"\n // gamma conversion functions..\n vec3 gammaCorrectInput(vec3 color) {\n return pow(color, vec3(2.2));\n }\n \n float gammaCorrectInput(float color) {\n return pow(color, 2.2);\n }\n \n vec4 gammaCorrectInput(vec4 color) {\n return vec4(pow(color.rgb, vec3(2.2)), color.a);\n }\n \n vec3 gammaCorrectOutput(vec3 color) {\n color += vec3(0.0000001);\n return pow(color, vec3(0.45));\n }\n \n vec4 texture2DSRGB(sampler2D tex, vec2 uv) {\n vec4 rgba = texture2D(tex, uv);\n rgba.rgb = gammaCorrectInput(rgba.rgb);\n return rgba;\n }\n \n vec4 textureCubeSRGB(samplerCube tex, vec3 uvw) {\n vec4 rgba = textureCube(tex, uvw);\n rgba.rgb = gammaCorrectInput(rgba.rgb);\n return rgba;\n }\n\n vec4 textureCubeSRGB(samplerCube tex, vec3 uvw, float lod) {\n vec4 rgba = textureCube(tex, uvw, lod);\n rgba.rgb = gammaCorrectInput(rgba.rgb);\n return rgba;\n }\n "}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));const n={fragment:{main:"\n lightingColor = vec3(1.);\n "}};function r(){return n}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Checkpoint}));var n=i(19),r=i(14);class Checkpoint extends r.a{constructor(){var t,e,i;super(),i=!0,(e="checkpoint")in(t=this)?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,this.checkpoint=!0,this.add(n.a),this.body.width=2,this.body.height=20,this.body.depth=2,this.body.deco=!0}static match(t){return!!t.name.match(/checkpoint_/)}static factory(t,e,i){const n=t.game.pool.get(Checkpoint),r=e.components.Transform.position.x,o=e.components.Transform.position.z;return n.body.z=t.z-o,n.body.x=r,n.body.bottom=0,i.offsetX&&(n.body.x=i.offsetX),i.flip&&(n.body.x*=-1),n.init(),t.game.addChild(n),n}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return LightSignal}));var n=i(1),r=i(19),o=i(14);class LightSignal extends o.a{constructor(){var t,e,i;super(),i=void 0,(e="model")in(t=this)?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,this.add(r.a,{ghost:!0,soft:!0}),this.body.width=4,this.body.height=42,this.body.depth=4,this.removableOnCrash=!0}awake(t,e,i){this.createModel(),this.body.x=e.components.Transform.position.x,i.flip&&(this.body.x*=-1),this.body.bottom=0,this.body.z=t.z-e.components.Transform.position.z}createModel(){this.model||n.a.library.hasGeometry("lightSignal")&&(this.model=n.a.library.getEntity("lightSignal"),this.model.ry=Math.PI,this.model.y=.5*-this.body.height,this.addChild(this.model))}static match(t){return!!t.name.match(/lightSignal/)}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Obstacle}));i(9);var n=i(1),r=i(13),o=i(19),a=i(14);function s(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const h=[];class Obstacle extends a.a{constructor(){super(),s(this,"model",void 0),this.add(o.a,{ghost:!0}),this.body.width=18,this.body.height=14,this.body.depth=1,this.removableOnCrash=!0}awake(t,e){this.model&&(this.model.ry=Math.PI,this.model.z=-4,this.addChild(this.model))}}s(Obstacle,"match",t=>!!t.name.match(/obstacle_group/)),s(Obstacle,"factory",(t,e,i)=>{const n=r.a.pick(...h),o=t.game.pool.get(n,{}),a=e.components.Transform.position.x,s=e.components.Transform.position.z;o.body.z=t.z-s,o.body.x=a,o.body.bottom=0,i.offsetX&&(o.body.x=i.offsetX),i.flip&&(o.body.x*=-1),o.awake(t,e),t.game.addChild(o)});h.push(class ObstacleDumpster extends Obstacle{constructor(){super(),this.body.soft=!1,this.model=n.a.library.getEntity("dumpster")}init(){super.init(),this.model&&(this.body.height=14,this.model.y=.5*-this.body.height)}});h.push(class ObstacleBush extends Obstacle{constructor(){super(),this.body.soft=!0,this.model=n.a.library.getEntity("bush_1")}init(){super.init(),this.model&&(this.body.height=12,this.model.y=.5*-this.body.height)}})},function(t,e,i){(function(i){var n;!function(){var r=9007199254740992,o="abcdefghijklmnopqrstuvwxyz",a=o.toUpperCase(),s="0123456789abcdef";function h(t){this.name="UnsupportedError",this.message=t||"This feature is not supported on this platform"}h.prototype=new Error,h.prototype.constructor=h;var u=Array.prototype.slice;function l(t){if(!(this instanceof l))return t||(t=null),null===t?new l:new l(t);if("function"==typeof t)return this.random=t,this;arguments.length&&(this.seed=0);for(var e=0;e<arguments.length;e++){var i=0;if("[object String]"===Object.prototype.toString.call(arguments[e]))for(var n=0;n<arguments[e].length;n++){for(var r=0,o=0;o<arguments[e].length;o++)r=arguments[e].charCodeAt(o)+(r<<6)+(r<<16)-r;i+=r}else i=arguments[e];this.seed+=(arguments.length-e)*i}return this.mt=this.mersenne_twister(this.seed),this.bimd5=this.blueimp_md5(),this.random=function(){return this.mt.random(this.seed)},this}function c(t,e){if(t=t||{},e)for(var i in e)void 0===t[i]&&(t[i]=e[i]);return t}function d(t,e){if(t)throw new RangeError(e)}l.prototype.VERSION="1.1.7";var p=function(){throw new Error("No Base64 encoder available.")};function f(t){this.c=t}function m(t){this.c=t}function g(t){this.c=t}function y(t){return function(){return this.natural(t)}}"function"==typeof btoa?p=btoa:"function"==typeof i&&(p=function(t){return new i(t).toString("base64")}),l.prototype.bool=function(t){return d((t=c(t,{likelihood:50})).likelihood<0||t.likelihood>100,"Chance: Likelihood accepts values from 0 to 100."),100*this.random()<t.likelihood},l.prototype.falsy=function(t){var e=(t=c(t,{pool:[!1,null,0,NaN,""]})).pool;return e[this.integer({min:0,max:e.length})]},l.prototype.animal=function(t){if(void 0!==(t=c(t)).type)return d(!this.get("animals")[t.type.toLowerCase()],"Please pick from desert, ocean, grassland, forest, zoo, pets, farm."),this.pick(this.get("animals")[t.type.toLowerCase()]);return this.pick(this.get("animals")[this.pick(["desert","forest","ocean","zoo","farm","pet","grassland"])])},l.prototype.character=function(t){var e,i;return e="lower"===(t=c(t)).casing?o:"upper"===t.casing?a:o+a,t.pool?i=t.pool:(i="",t.alpha&&(i+=e),t.numeric&&(i+="0123456789"),t.symbols&&(i+="!@#$%^&*()[]"),i||(i=e+"0123456789!@#$%^&*()[]")),i.charAt(this.natural({max:i.length-1}))},l.prototype.floating=function(t){d((t=c(t,{fixed:4})).fixed&&t.precision,"Chance: Cannot specify both fixed and precision.");var e=Math.pow(10,t.fixed),i=r/e,n=-i;d(t.min&&t.fixed&&t.min<n,"Chance: Min specified is out of range with fixed. Min should be, at least, "+n),d(t.max&&t.fixed&&t.max>i,"Chance: Max specified is out of range with fixed. Max should be, at most, "+i),t=c(t,{min:n,max:i});var o=(this.integer({min:t.min*e,max:t.max*e})/e).toFixed(t.fixed);return parseFloat(o)},l.prototype.integer=function(t){return d((t=c(t,{min:-9007199254740992,max:r})).min>t.max,"Chance: Min cannot be greater than Max."),Math.floor(this.random()*(t.max-t.min+1)+t.min)},l.prototype.natural=function(t){if("number"==typeof(t=c(t,{min:0,max:r})).numerals&&(d(t.numerals<1,"Chance: Numerals cannot be less than one."),t.min=Math.pow(10,t.numerals-1),t.max=Math.pow(10,t.numerals)-1),d(t.min<0,"Chance: Min cannot be less than zero."),t.exclude){for(var e in d(!Array.isArray(t.exclude),"Chance: exclude must be an array."),t.exclude)d(!Number.isInteger(t.exclude[e]),"Chance: exclude must be numbers.");var i=t.min+this.natural({max:t.max-t.min-t.exclude.length}),n=t.exclude.sort();for(var e in n){if(i<n[e])break;i++}return i}return this.integer(t)},l.prototype.prime=function(t){d((t=c(t,{min:0,max:1e4})).min<0,"Chance: Min cannot be less than zero."),d(t.min>t.max,"Chance: Min cannot be greater than Max.");var e=v.primes[v.primes.length-1];if(t.max>e)for(var i=e+2;i<=t.max;++i)this.is_prime(i)&&v.primes.push(i);var n=v.primes.filter((function(e){return e>=t.min&&e<=t.max}));return this.pick(n)},l.prototype.is_prime=function(t){if(t%1||t<2)return!1;if(t%2==0)return 2===t;if(t%3==0)return 3===t;for(var e=Math.sqrt(t),i=5;i<=e;i+=6)if(t%i==0||t%(i+2)==0)return!1;return!0},l.prototype.hex=function(t){d((t=c(t,{min:0,max:r,casing:"lower"})).min<0,"Chance: Min cannot be less than zero.");var e=this.natural({min:t.min,max:t.max});return"upper"===t.casing?e.toString(16).toUpperCase():e.toString(16)},l.prototype.letter=function(t){t=c(t,{casing:"lower"});var e=this.character({pool:"abcdefghijklmnopqrstuvwxyz"});return"upper"===t.casing&&(e=e.toUpperCase()),e},l.prototype.string=function(t){(t=c(t,{min:5,max:20})).length||(t.length=this.natural({min:t.min,max:t.max})),d(t.length<0,"Chance: Length cannot be less than zero.");var e=t.length;return this.n(this.character,e,t).join("")},f.prototype={substitute:function(){return this.c}},m.prototype={substitute:function(){if(!/[{}\\]/.test(this.c))throw new Error('Invalid escape sequence: "\\'+this.c+'".');return this.c}},g.prototype={replacers:{"#":function(t){return t.character({pool:"0123456789"})},A:function(t){return t.character({pool:a})},a:function(t){return t.character({pool:o})}},substitute:function(t){var e=this.replacers[this.c];if(!e)throw new Error('Invalid replacement character: "'+this.c+'".');return e(t)}},l.prototype.template=function(t){if(!t)throw new Error("Template string is required");var e=this;return function(t){for(var e=[],i="identity",n=0;n<t.length;n++){var r=t[n];switch(i){case"escape":e.push(new m(r)),i="identity";break;case"identity":"{"===r?i="replace":"\\"===r?i="escape":e.push(new f(r));break;case"replace":"}"===r?i="identity":e.push(new g(r))}}return e}(t).map((function(t){return t.substitute(e)})).join("")},l.prototype.buffer=function(t){if(void 0===i)throw new h("Sorry, the buffer() function is not supported on your platform");d((t=c(t,{length:this.natural({min:5,max:20})})).length<0,"Chance: Length cannot be less than zero.");var e=t.length,n=this.n(this.character,e,t);return i.from(n)},l.prototype.capitalize=function(t){return t.charAt(0).toUpperCase()+t.substr(1)},l.prototype.mixin=function(t){for(var e in t)l.prototype[e]=t[e];return this},l.prototype.unique=function(t,e,i){d("function"!=typeof t,"Chance: The first argument must be a function.");var n=function(t,e){return-1!==t.indexOf(e)};i&&(n=i.comparator||n);for(var r,o=[],a=0,s=50*e,h=u.call(arguments,2);o.length<e;){var l=JSON.parse(JSON.stringify(h));if(n(o,r=t.apply(this,l))||(o.push(r),a=0),++a>s)throw new RangeError("Chance: num is likely too large for sample set")}return o},l.prototype.n=function(t,e){d("function"!=typeof t,"Chance: The first argument must be a function."),void 0===e&&(e=1);var i=e,n=[],r=u.call(arguments,2);for(i=Math.max(0,i);i--;null)n.push(t.apply(this,r));return n},l.prototype.pad=function(t,e,i){return i=i||"0",(t+="").length>=e?t:new Array(e-t.length+1).join(i)+t},l.prototype.pick=function(t,e){if(0===t.length)throw new RangeError("Chance: Cannot pick() from an empty array");return e&&1!==e?this.shuffle(t).slice(0,e):t[this.natural({max:t.length-1})]},l.prototype.pickone=function(t){if(0===t.length)throw new RangeError("Chance: Cannot pickone() from an empty array");return t[this.natural({max:t.length-1})]},l.prototype.pickset=function(t,e){if(0===e)return[];if(0===t.length)throw new RangeError("Chance: Cannot pickset() from an empty array");if(e<0)throw new RangeError("Chance: Count must be a positive number");if(e&&1!==e){var i=t.slice(0),n=i.length;return this.n((function(){var t=this.natural({max:--n}),e=i[t];return i[t]=i[n],e}),Math.min(n,e))}return[this.pickone(t)]},l.prototype.shuffle=function(t){for(var e,i,n=[],r=0,o=Number(t.length),a=(i=o,Array.apply(null,Array(i)).map((function(t,e){return e}))),s=o-1,h=0;h<o;h++)r=a[e=this.natural({max:s})],n[h]=t[r],a[e]=a[s],s-=1;return n},l.prototype.weighted=function(t,e,i){if(t.length!==e.length)throw new RangeError("Chance: Length of array and weights must match");for(var n,r=0,o=0;o<e.length;++o){if(n=e[o],isNaN(n))throw new RangeError("Chance: All weights must be numbers");n>0&&(r+=n)}if(0===r)throw new RangeError("Chance: No valid entries in array weights");var a,s=this.random()*r,h=0,u=-1;for(o=0;o<e.length;++o){if(h+=n=e[o],n>0){if(s<=h){a=o;break}u=o}o===e.length-1&&(a=u)}var l=t[a];return(i=void 0!==i&&i)&&(t.splice(a,1),e.splice(a,1)),l},l.prototype.paragraph=function(t){var e=(t=c(t)).sentences||this.natural({min:3,max:7}),i=this.n(this.sentence,e),n=!0===t.linebreak?"\n":" ";return i.join(n)},l.prototype.sentence=function(t){var e,i=(t=c(t)).words||this.natural({min:12,max:18}),n=t.punctuation;return e=this.n(this.word,i).join(" "),e=this.capitalize(e),!1===n||/^[.?;!:]$/.test(n)||(n="."),n&&(e+=n),e},l.prototype.syllable=function(t){for(var e,i=(t=c(t)).length||this.natural({min:2,max:3}),n="",r=0;r<i;r++)n+=e=0===r?this.character({pool:"bcdfghjklmnprstvwzaeiou"}):-1==="bcdfghjklmnprstvwz".indexOf(e)?this.character({pool:"bcdfghjklmnprstvwz"}):this.character({pool:"aeiou"});return t.capitalize&&(n=this.capitalize(n)),n},l.prototype.word=function(t){d((t=c(t)).syllables&&t.length,"Chance: Cannot specify both syllables AND length.");var e=t.syllables||this.natural({min:1,max:3}),i="";if(t.length){do{i+=this.syllable()}while(i.length<t.length);i=i.substring(0,t.length)}else for(var n=0;n<e;n++)i+=this.syllable();return t.capitalize&&(i=this.capitalize(i)),i},l.prototype.age=function(t){var e;switch((t=c(t)).type){case"child":e={min:0,max:12};break;case"teen":e={min:13,max:19};break;case"adult":e={min:18,max:65};break;case"senior":e={min:65,max:100};break;case"all":e={min:0,max:100};break;default:e={min:18,max:65}}return this.natural(e)},l.prototype.birthday=function(t){var e=this.age(t),i=(new Date).getFullYear();if(t&&t.type){var n=new Date,r=new Date;n.setFullYear(i-e-1),r.setFullYear(i-e),t=c(t,{min:n,max:r})}else t=c(t,{year:i-e});return this.date(t)},l.prototype.cpf=function(t){t=c(t,{formatted:!0});var e=this.n(this.natural,9,{max:9}),i=2*e[8]+3*e[7]+4*e[6]+5*e[5]+6*e[4]+7*e[3]+8*e[2]+9*e[1]+10*e[0];(i=11-i%11)>=10&&(i=0);var n=2*i+3*e[8]+4*e[7]+5*e[6]+6*e[5]+7*e[4]+8*e[3]+9*e[2]+10*e[1]+11*e[0];(n=11-n%11)>=10&&(n=0);var r=""+e[0]+e[1]+e[2]+"."+e[3]+e[4]+e[5]+"."+e[6]+e[7]+e[8]+"-"+i+n;return t.formatted?r:r.replace(/\D/g,"")},l.prototype.cnpj=function(t){t=c(t,{formatted:!0});var e=this.n(this.natural,12,{max:12}),i=2*e[11]+3*e[10]+4*e[9]+5*e[8]+6*e[7]+7*e[6]+8*e[5]+9*e[4]+2*e[3]+3*e[2]+4*e[1]+5*e[0];(i=11-i%11)<2&&(i=0);var n=2*i+3*e[11]+4*e[10]+5*e[9]+6*e[8]+7*e[7]+8*e[6]+9*e[5]+2*e[4]+3*e[3]+4*e[2]+5*e[1]+6*e[0];(n=11-n%11)<2&&(n=0);var r=""+e[0]+e[1]+"."+e[2]+e[3]+e[4]+"."+e[5]+e[6]+e[7]+"/"+e[8]+e[9]+e[10]+e[11]+"-"+i+n;return t.formatted?r:r.replace(/\D/g,"")},l.prototype.first=function(t){return t=c(t,{gender:this.gender(),nationality:"en"}),this.pick(this.get("firstNames")[t.gender.toLowerCase()][t.nationality.toLowerCase()])},l.prototype.profession=function(t){return(t=c(t)).rank?this.pick(["Apprentice ","Junior ","Senior ","Lead "])+this.pick(this.get("profession")):this.pick(this.get("profession"))},l.prototype.company=function(){return this.pick(this.get("company"))},l.prototype.gender=function(t){return t=c(t,{extraGenders:[]}),this.pick(["Male","Female"].concat(t.extraGenders))},l.prototype.last=function(t){if("*"===(t=c(t,{nationality:"*"})).nationality){var e=[],i=this.get("lastNames");return Object.keys(i).forEach((function(t){e=e.concat(i[t])})),this.pick(e)}return this.pick(this.get("lastNames")[t.nationality.toLowerCase()])},l.prototype.israelId=function(){for(var t=this.string({pool:"0123456789",length:8}),e=0,i=0;i<t.length;i++){var n=t[i]*(i/2===parseInt(i/2)?1:2);n=this.pad(n,2).toString(),e+=n=parseInt(n[0])+parseInt(n[1])}return t+=(10-parseInt(e.toString().slice(-1))).toString().slice(-1)},l.prototype.mrz=function(t){var e,i,n,r,o=function(t){var e="<ABCDEFGHIJKLMNOPQRSTUVWXYXZ".split(""),i=[7,3,1],n=0;return"string"!=typeof t&&(t=t.toString()),t.split("").forEach((function(t,r){var o=e.indexOf(t);t=-1!==o?0===o?0:o+9:parseInt(t,10),n+=t*=i[r%i.length]})),n%10},a=this;return t=c(t,{first:this.first(),last:this.last(),passportNumber:this.integer({min:1e8,max:999999999}),dob:(e=a.birthday({type:"adult"}),[e.getFullYear().toString().substr(2),a.pad(e.getMonth()+1,2),a.pad(e.getDate(),2)].join("")),expiry:function(){var t=new Date;return[(t.getFullYear()+5).toString().substr(2),a.pad(t.getMonth()+1,2),a.pad(t.getDate(),2)].join("")}(),gender:"Female"===this.gender()?"F":"M",issuer:"GBR",nationality:"GBR"}),n=function(t){return new Array(t+1).join("<")},(r=["P<",(i=t).issuer,i.last.toUpperCase(),"<<",i.first.toUpperCase(),n(39-(i.last.length+i.first.length+2)),i.passportNumber,o(i.passportNumber),i.nationality,i.dob,o(i.dob),i.gender,i.expiry,o(i.expiry),n(14),o(n(14))].join(""))+o(r.substr(44,10)+r.substr(57,7)+r.substr(65,7))},l.prototype.name=function(t){t=c(t);var e,i=this.first(t),n=this.last(t);return e=t.middle?i+" "+this.first(t)+" "+n:t.middle_initial?i+" "+this.character({alpha:!0,casing:"upper"})+". "+n:i+" "+n,t.prefix&&(e=this.prefix(t)+" "+e),t.suffix&&(e=e+" "+this.suffix(t)),e},l.prototype.name_prefixes=function(t){var e=[{name:"Doctor",abbreviation:"Dr."}];return"male"!==(t=(t=t||"all").toLowerCase())&&"all"!==t||e.push({name:"Mister",abbreviation:"Mr."}),"female"!==t&&"all"!==t||(e.push({name:"Miss",abbreviation:"Miss"}),e.push({name:"Misses",abbreviation:"Mrs."})),e},l.prototype.prefix=function(t){return this.name_prefix(t)},l.prototype.name_prefix=function(t){return(t=c(t,{gender:"all"})).full?this.pick(this.name_prefixes(t.gender)).name:this.pick(this.name_prefixes(t.gender)).abbreviation},l.prototype.HIDN=function(){var t="";return t+=this.string({pool:"0123456789",length:6}),t+=this.string({pool:"ABCDEFGHIJKLMNOPQRSTUVWXYXZ",length:2})},l.prototype.ssn=function(t){var e=(t=c(t,{ssnFour:!1,dashes:!0})).dashes?"-":"";return t.ssnFour?this.string({pool:"1234567890",length:4}):this.string({pool:"1234567890",length:3})+e+this.string({pool:"1234567890",length:2})+e+this.string({pool:"1234567890",length:4})},l.prototype.aadhar=function(t){var e=(t=c(t,{onlyLastFour:!1,separatedByWhiteSpace:!0})).separatedByWhiteSpace?" ":"";return t.onlyLastFour?this.string({pool:"1234567890",length:4}):this.string({pool:"1234567890",length:4})+e+this.string({pool:"1234567890",length:4})+e+this.string({pool:"1234567890",length:4})},l.prototype.name_suffixes=function(){return[{name:"Doctor of Osteopathic Medicine",abbreviation:"D.O."},{name:"Doctor of Philosophy",abbreviation:"Ph.D."},{name:"Esquire",abbreviation:"Esq."},{name:"Junior",abbreviation:"Jr."},{name:"Juris Doctor",abbreviation:"J.D."},{name:"Master of Arts",abbreviation:"M.A."},{name:"Master of Business Administration",abbreviation:"M.B.A."},{name:"Master of Science",abbreviation:"M.S."},{name:"Medical Doctor",abbreviation:"M.D."},{name:"Senior",abbreviation:"Sr."},{name:"The Third",abbreviation:"III"},{name:"The Fourth",abbreviation:"IV"},{name:"Bachelor of Engineering",abbreviation:"B.E"},{name:"Bachelor of Technology",abbreviation:"B.TECH"}]},l.prototype.suffix=function(t){return this.name_suffix(t)},l.prototype.name_suffix=function(t){return(t=c(t)).full?this.pick(this.name_suffixes()).name:this.pick(this.name_suffixes()).abbreviation},l.prototype.nationalities=function(){return this.get("nationalities")},l.prototype.nationality=function(){return this.pick(this.nationalities()).name},l.prototype.android_id=function(){return"APA91"+this.string({pool:"0123456789abcefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_",length:178})},l.prototype.apple_token=function(){return this.string({pool:"abcdef1234567890",length:64})},l.prototype.wp8_anid2=function(){return p(this.hash({length:32}))},l.prototype.wp7_anid=function(){return"A="+this.guid().replace(/-/g,"").toUpperCase()+"&E="+this.hash({length:3})+"&W="+this.integer({min:0,max:9})},l.prototype.bb_pin=function(){return this.hash({length:8})},l.prototype.avatar=function(t){var e={protocol:null,email:null,fileExtension:null,size:null,fallback:null,rating:null};if(t)if("string"==typeof t)e.email=t,t={};else{if("object"!=typeof t)return null;if("Array"===t.constructor)return null}else e.email=this.email(),t={};return(e=c(t,e)).email||(e.email=this.email()),e.protocol={http:"http",https:"https"}[e.protocol]?e.protocol+":":"",e.size=parseInt(e.size,0)?e.size:"",e.rating={g:"g",pg:"pg",r:"r",x:"x"}[e.rating]?e.rating:"",e.fallback={404:"404",mm:"mm",identicon:"identicon",monsterid:"monsterid",wavatar:"wavatar",retro:"retro",blank:"blank"}[e.fallback]?e.fallback:"",e.fileExtension={bmp:"bmp",gif:"gif",jpg:"jpg",png:"png"}[e.fileExtension]?e.fileExtension:"",e.protocol+"//www.gravatar.com/avatar/"+this.bimd5.md5(e.email)+(e.fileExtension?"."+e.fileExtension:"")+(e.size||e.rating||e.fallback?"?":"")+(e.size?"&s="+e.size.toString():"")+(e.rating?"&r="+e.rating:"")+(e.fallback?"&d="+e.fallback:"")},l.prototype.color=function(t){function e(t,e){return[t,t,t].join(e||"")}function i(t){var i=t?"rgba":"rgb",n=t?","+this.floating({min:m,max:g}):"";return i+"("+(o?e(this.natural({min:a,max:s}),","):this.natural({min:l,max:d})+","+this.natural({min:p,max:f})+","+this.natural({max:255}))+n+")"}function n(i,n,r){var c=r?"#":"",m="";return o?(m=e(this.pad(this.hex({min:a,max:s}),2)),"shorthex"===t.format&&(m=e(this.hex({min:0,max:15})))):m="shorthex"===t.format?this.pad(this.hex({min:Math.floor(h/16),max:Math.floor(u/16)}),1)+this.pad(this.hex({min:Math.floor(l/16),max:Math.floor(d/16)}),1)+this.pad(this.hex({min:Math.floor(p/16),max:Math.floor(f/16)}),1):void 0!==h||void 0!==u||void 0!==l||void 0!==d||void 0!==p||void 0!==f?this.pad(this.hex({min:h,max:u}),2)+this.pad(this.hex({min:l,max:d}),2)+this.pad(this.hex({min:p,max:f}),2):this.pad(this.hex({min:a,max:s}),2)+this.pad(this.hex({min:a,max:s}),2)+this.pad(this.hex({min:a,max:s}),2),c+m}var r,o=(t=c(t,{format:this.pick(["hex","shorthex","rgb","rgba","0x","name"]),grayscale:!1,casing:"lower",min:0,max:255,min_red:void 0,max_red:void 0,min_green:void 0,max_green:void 0,min_blue:void 0,max_blue:void 0,min_alpha:0,max_alpha:1})).grayscale,a=t.min,s=t.max,h=t.min_red,u=t.max_red,l=t.min_green,d=t.max_green,p=t.min_blue,f=t.max_blue,m=t.min_alpha,g=t.max_alpha;if(void 0===t.min_red&&(h=a),void 0===t.max_red&&(u=s),void 0===t.min_green&&(l=a),void 0===t.max_green&&(d=s),void 0===t.min_blue&&(p=a),void 0===t.max_blue&&(f=s),void 0===t.min_alpha&&(m=0),void 0===t.max_alpha&&(g=1),o&&0===a&&255===s&&void 0!==h&&void 0!==u&&(a=(h+l+p)/3,s=(u+d+f)/3),"hex"===t.format)r=n.call(this,2,6,!0);else if("shorthex"===t.format)r=n.call(this,1,3,!0);else if("rgb"===t.format)r=i.call(this,!1);else if("rgba"===t.format)r=i.call(this,!0);else{if("0x"!==t.format){if("name"===t.format)return this.pick(this.get("colorNames"));throw new RangeError('Invalid format provided. Please provide one of "hex", "shorthex", "rgb", "rgba", "0x" or "name".')}r="0x"+n.call(this,2,6)}return"upper"===t.casing&&(r=r.toUpperCase()),r},l.prototype.domain=function(t){return t=c(t),this.word()+"."+(t.tld||this.tld())},l.prototype.email=function(t){return t=c(t),this.word({length:t.length})+"@"+(t.domain||this.domain())},l.prototype.fbid=function(){return"10000"+this.string({pool:"1234567890",length:11})},l.prototype.google_analytics=function(){return"UA-"+this.pad(this.natural({max:999999}),6)+"-"+this.pad(this.natural({max:99}),2)},l.prototype.hashtag=function(){return"#"+this.word()},l.prototype.ip=function(){return this.natural({min:1,max:254})+"."+this.natural({max:255})+"."+this.natural({max:255})+"."+this.natural({min:1,max:254})},l.prototype.ipv6=function(){return this.n(this.hash,8,{length:4}).join(":")},l.prototype.klout=function(){return this.natural({min:1,max:99})},l.prototype.semver=function(t){t=c(t,{include_prerelease:!0});var e=this.pickone(["^","~","<",">","<=",">=","="]);t.range&&(e=t.range);var i="";return t.include_prerelease&&(i=this.weighted(["","-dev","-beta","-alpha"],[50,10,5,1])),e+this.rpg("3d10").join(".")+i},l.prototype.tlds=function(){return["com","org","edu","gov","co.uk","net","io","ac","ad","ae","af","ag","ai","al","am","ao","aq","ar","as","at","au","aw","ax","az","ba","bb","bd","be","bf","bg","bh","bi","bj","bm","bn","bo","br","bs","bt","bv","bw","by","bz","ca","cc","cd","cf","cg","ch","ci","ck","cl","cm","cn","co","cr","cu","cv","cw","cx","cy","cz","de","dj","dk","dm","do","dz","ec","ee","eg","eh","er","es","et","eu","fi","fj","fk","fm","fo","fr","ga","gb","gd","ge","gf","gg","gh","gi","gl","gm","gn","gp","gq","gr","gs","gt","gu","gw","gy","hk","hm","hn","hr","ht","hu","id","ie","il","im","in","io","iq","ir","is","it","je","jm","jo","jp","ke","kg","kh","ki","km","kn","kp","kr","kw","ky","kz","la","lb","lc","li","lk","lr","ls","lt","lu","lv","ly","ma","mc","md","me","mg","mh","mk","ml","mm","mn","mo","mp","mq","mr","ms","mt","mu","mv","mw","mx","my","mz","na","nc","ne","nf","ng","ni","nl","no","np","nr","nu","nz","om","pa","pe","pf","pg","ph","pk","pl","pm","pn","pr","ps","pt","pw","py","qa","re","ro","rs","ru","rw","sa","sb","sc","sd","se","sg","sh","si","sj","sk","sl","sm","sn","so","sr","ss","st","su","sv","sx","sy","sz","tc","td","tf","tg","th","tj","tk","tl","tm","tn","to","tp","tr","tt","tv","tw","tz","ua","ug","uk","us","uy","uz","va","vc","ve","vg","vi","vn","vu","wf","ws","ye","yt","za","zm","zw"]},l.prototype.tld=function(){return this.pick(this.tlds())},l.prototype.twitter=function(){return"@"+this.word()},l.prototype.url=function(t){var e=(t=c(t,{protocol:"http",domain:this.domain(t),domain_prefix:"",path:this.word(),extensions:[]})).extensions.length>0?"."+this.pick(t.extensions):"",i=t.domain_prefix?t.domain_prefix+"."+t.domain:t.domain;return t.protocol+"://"+i+"/"+t.path+e},l.prototype.port=function(){return this.integer({min:0,max:65535})},l.prototype.locale=function(t){return(t=c(t)).region?this.pick(this.get("locale_regions")):this.pick(this.get("locale_languages"))},l.prototype.locales=function(t){return(t=c(t)).region?this.get("locale_regions"):this.get("locale_languages")},l.prototype.loremPicsum=function(t){var e=(t=c(t,{width:500,height:500,greyscale:!1,blurred:!1})).greyscale?"g/":"",i=t.blurred?"/?blur":"/?random";return"https://picsum.photos/"+e+t.width+"/"+t.height+i},l.prototype.address=function(t){return t=c(t),this.natural({min:5,max:2e3})+" "+this.street(t)},l.prototype.altitude=function(t){return t=c(t,{fixed:5,min:0,max:8848}),this.floating({min:t.min,max:t.max,fixed:t.fixed})},l.prototype.areacode=function(t){t=c(t,{parens:!0});var e=this.natural({min:2,max:9}).toString()+this.natural({min:0,max:8}).toString()+this.natural({min:0,max:9}).toString();return t.parens?"("+e+")":e},l.prototype.city=function(){return this.capitalize(this.word({syllables:3}))},l.prototype.coordinates=function(t){return this.latitude(t)+", "+this.longitude(t)},l.prototype.countries=function(){return this.get("countries")},l.prototype.country=function(t){t=c(t);var e=this.pick(this.countries());return t.raw?e:t.full?e.name:e.abbreviation},l.prototype.depth=function(t){return t=c(t,{fixed:5,min:-10994,max:0}),this.floating({min:t.min,max:t.max,fixed:t.fixed})},l.prototype.geohash=function(t){return t=c(t,{length:7}),this.string({length:t.length,pool:"0123456789bcdefghjkmnpqrstuvwxyz"})},l.prototype.geojson=function(t){return this.latitude(t)+", "+this.longitude(t)+", "+this.altitude(t)},l.prototype.latitude=function(t){const[e,i,n]=["ddm","dms","dd"],r=(t=c(t,t&&t.format&&[e,i].includes(t.format.toLowerCase())?{min:0,max:89,fixed:4}:{fixed:5,min:-90,max:90,format:n})).format.toLowerCase();switch(r!==e&&r!==i||(d(t.min<0||t.min>89,"Chance: Min specified is out of range. Should be between 0 - 89"),d(t.max<0||t.max>89,"Chance: Max specified is out of range. Should be between 0 - 89"),d(t.fixed>4,"Chance: Fixed specified should be below or equal to 4")),r){case e:return this.integer({min:t.min,max:t.max})+"°"+this.floating({min:0,max:59,fixed:t.fixed});case i:return this.integer({min:t.min,max:t.max})+"°"+this.integer({min:0,max:59})+""+this.floating({min:0,max:59,fixed:t.fixed})+"”";case n:default:return this.floating({min:t.min,max:t.max,fixed:t.fixed})}},l.prototype.longitude=function(t){const[e,i,n]=["ddm","dms","dd"],r=(t=c(t,t&&t.format&&[e,i].includes(t.format.toLowerCase())?{min:0,max:179,fixed:4}:{fixed:5,min:-180,max:180,format:n})).format.toLowerCase();switch(r!==e&&r!==i||(d(t.min<0||t.min>179,"Chance: Min specified is out of range. Should be between 0 - 179"),d(t.max<0||t.max>179,"Chance: Max specified is out of range. Should be between 0 - 179"),d(t.fixed>4,"Chance: Fixed specified should be below or equal to 4")),r){case e:return this.integer({min:t.min,max:t.max})+"°"+this.floating({min:0,max:59.9999,fixed:t.fixed});case i:return this.integer({min:t.min,max:t.max})+"°"+this.integer({min:0,max:59})+""+this.floating({min:0,max:59.9999,fixed:t.fixed})+"”";case n:default:return this.floating({min:t.min,max:t.max,fixed:t.fixed})}},l.prototype.phone=function(t){var e,i,n=this,r=function(t){var e=[];return t.sections.forEach((function(t){e.push(n.string({pool:"0123456789",length:t}))})),t.area+e.join(" ")};switch((t=c(t,{formatted:!0,country:"us",mobile:!1})).formatted||(t.parens=!1),t.country){case"fr":t.mobile?(e=this.pick(["06","07"])+n.string({pool:"0123456789",length:8}),i=t.formatted?e.match(/../g).join(" "):e):(e=this.pick(["01"+this.pick(["30","34","39","40","41","42","43","44","45","46","47","48","49","53","55","56","58","60","64","69","70","72","73","74","75","76","77","78","79","80","81","82","83"])+n.string({pool:"0123456789",length:6}),"02"+this.pick(["14","18","22","23","28","29","30","31","32","33","34","35","36","37","38","40","41","43","44","45","46","47","48","49","50","51","52","53","54","56","57","61","62","69","72","76","77","78","85","90","96","97","98","99"])+n.string({pool:"0123456789",length:6}),"03"+this.pick(["10","20","21","22","23","24","25","26","27","28","29","39","44","45","51","52","54","55","57","58","59","60","61","62","63","64","65","66","67","68","69","70","71","72","73","80","81","82","83","84","85","86","87","88","89","90"])+n.string({pool:"0123456789",length:6}),"04"+this.pick(["11","13","15","20","22","26","27","30","32","34","37","42","43","44","50","56","57","63","66","67","68","69","70","71","72","73","74","75","76","77","78","79","80","81","82","83","84","85","86","88","89","90","91","92","93","94","95","97","98"])+n.string({pool:"0123456789",length:6}),"05"+this.pick(["08","16","17","19","24","31","32","33","34","35","40","45","46","47","49","53","55","56","57","58","59","61","62","63","64","65","67","79","81","82","86","87","90","94"])+n.string({pool:"0123456789",length:6}),"09"+n.string({pool:"0123456789",length:8})]),i=t.formatted?e.match(/../g).join(" "):e);break;case"uk":t.mobile?(e=this.pick([{area:"07"+this.pick(["4","5","7","8","9"]),sections:[2,6]},{area:"07624 ",sections:[6]}]),i=t.formatted?r(e):r(e).replace(" ","")):(e=this.pick([{area:"01"+this.character({pool:"234569"})+"1 ",sections:[3,4]},{area:"020 "+this.character({pool:"378"}),sections:[3,4]},{area:"023 "+this.character({pool:"89"}),sections:[3,4]},{area:"024 7",sections:[3,4]},{area:"028 "+this.pick(["25","28","37","71","82","90","92","95"]),sections:[2,4]},{area:"012"+this.pick(["04","08","54","76","97","98"])+" ",sections:[6]},{area:"013"+this.pick(["63","64","84","86"])+" ",sections:[6]},{area:"014"+this.pick(["04","20","60","61","80","88"])+" ",sections:[6]},{area:"015"+this.pick(["24","27","62","66"])+" ",sections:[6]},{area:"016"+this.pick(["06","29","35","47","59","95"])+" ",sections:[6]},{area:"017"+this.pick(["26","44","50","68"])+" ",sections:[6]},{area:"018"+this.pick(["27","37","84","97"])+" ",sections:[6]},{area:"019"+this.pick(["00","05","35","46","49","63","95"])+" ",sections:[6]}]),i=t.formatted?r(e):r(e).replace(" ","","g"));break;case"za":t.mobile?(e=this.pick(["060"+this.pick(["3","4","5","6","7","8","9"])+n.string({pool:"0123456789",length:6}),"061"+this.pick(["0","1","2","3","4","5","8"])+n.string({pool:"0123456789",length:6}),"06"+n.string({pool:"0123456789",length:7}),"071"+this.pick(["0","1","2","3","4","5","6","7","8","9"])+n.string({pool:"0123456789",length:6}),"07"+this.pick(["2","3","4","6","7","8","9"])+n.string({pool:"0123456789",length:7}),"08"+this.pick(["0","1","2","3","4","5"])+n.string({pool:"0123456789",length:7})]),i=t.formatted||e):(e=this.pick(["01"+this.pick(["0","1","2","3","4","5","6","7","8"])+n.string({pool:"0123456789",length:7}),"02"+this.pick(["1","2","3","4","7","8"])+n.string({pool:"0123456789",length:7}),"03"+this.pick(["1","2","3","5","6","9"])+n.string({pool:"0123456789",length:7}),"04"+this.pick(["1","2","3","4","5","6","7","8","9"])+n.string({pool:"0123456789",length:7}),"05"+this.pick(["1","3","4","6","7","8"])+n.string({pool:"0123456789",length:7})]),i=t.formatted||e);break;case"us":var o=this.areacode(t).toString(),a=this.natural({min:2,max:9}).toString()+this.natural({min:0,max:9}).toString()+this.natural({min:0,max:9}).toString(),s=this.natural({min:1e3,max:9999}).toString();i=t.formatted?o+" "+a+"-"+s:o+a+s;break;case"br":var h,u=this.pick(["11","12","13","14","15","16","17","18","19","21","22","24","27","28","31","32","33","34","35","37","38","41","42","43","44","45","46","47","48","49","51","53","54","55","61","62","63","64","65","66","67","68","69","71","73","74","75","77","79","81","82","83","84","85","86","87","88","89","91","92","93","94","95","96","97","98","99"]);h=t.mobile?"9"+n.string({pool:"0123456789",length:4}):this.natural({min:2e3,max:5999}).toString();var l=n.string({pool:"0123456789",length:4});i=t.formatted?"("+u+") "+h+"-"+l:u+h+l}return i},l.prototype.postal=function(){return this.character({pool:"XVTSRPNKLMHJGECBA"})+this.natural({max:9})+this.character({alpha:!0,casing:"upper"})+" "+(this.natural({max:9})+this.character({alpha:!0,casing:"upper"})+this.natural({max:9}))},l.prototype.postcode=function(){return this.pick(this.get("postcodeAreas")).code+this.natural({max:9})+(this.bool()?this.character({alpha:!0,casing:"upper"}):"")+" "+(this.natural({max:9})+(this.character({alpha:!0,casing:"upper"})+this.character({alpha:!0,casing:"upper"})))},l.prototype.counties=function(t){return t=c(t,{country:"uk"}),this.get("counties")[t.country.toLowerCase()]},l.prototype.county=function(t){return this.pick(this.counties(t)).name},l.prototype.provinces=function(t){return t=c(t,{country:"ca"}),this.get("provinces")[t.country.toLowerCase()]},l.prototype.province=function(t){return t&&t.full?this.pick(this.provinces(t)).name:this.pick(this.provinces(t)).abbreviation},l.prototype.state=function(t){return t&&t.full?this.pick(this.states(t)).name:this.pick(this.states(t)).abbreviation},l.prototype.states=function(t){var e;switch((t=c(t,{country:"us",us_states_and_dc:!0})).country.toLowerCase()){case"us":var i=this.get("us_states_and_dc"),n=this.get("territories"),r=this.get("armed_forces");e=[],t.us_states_and_dc&&(e=e.concat(i)),t.territories&&(e=e.concat(n)),t.armed_forces&&(e=e.concat(r));break;case"it":case"mx":e=this.get("country_regions")[t.country.toLowerCase()];break;case"uk":e=this.get("counties")[t.country.toLowerCase()]}return e},l.prototype.street=function(t){var e;switch((t=c(t,{country:"us",syllables:2})).country.toLowerCase()){case"us":e=this.word({syllables:t.syllables}),e=this.capitalize(e),e+=" ",e+=t.short_suffix?this.street_suffix(t).abbreviation:this.street_suffix(t).name;break;case"it":e=this.word({syllables:t.syllables}),e=this.capitalize(e),e=(t.short_suffix?this.street_suffix(t).abbreviation:this.street_suffix(t).name)+" "+e}return e},l.prototype.street_suffix=function(t){return t=c(t,{country:"us"}),this.pick(this.street_suffixes(t))},l.prototype.street_suffixes=function(t){return t=c(t,{country:"us"}),this.get("street_suffixes")[t.country.toLowerCase()]},l.prototype.zip=function(t){var e=this.n(this.natural,5,{max:9});return t&&!0===t.plusfour&&(e.push("-"),e=e.concat(this.n(this.natural,4,{max:9}))),e.join("")},l.prototype.ampm=function(){return this.bool()?"am":"pm"},l.prototype.date=function(t){var e,i;if(t&&(t.min||t.max)){var n=void 0!==(t=c(t,{american:!0,string:!1})).min?t.min.getTime():1,r=void 0!==t.max?t.max.getTime():864e13;i=new Date(this.integer({min:n,max:r}))}else{var o=this.month({raw:!0}),a=o.days;t&&t.month&&(a=this.get("months")[(t.month%12+12)%12].days),t=c(t,{year:parseInt(this.year(),10),month:o.numeric-1,day:this.natural({min:1,max:a}),hour:this.hour({twentyfour:!0}),minute:this.minute(),second:this.second(),millisecond:this.millisecond(),american:!0,string:!1}),i=new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond)}return e=t.american?i.getMonth()+1+"/"+i.getDate()+"/"+i.getFullYear():i.getDate()+"/"+(i.getMonth()+1)+"/"+i.getFullYear(),t.string?e:i},l.prototype.hammertime=function(t){return this.date(t).getTime()},l.prototype.hour=function(t){return d((t=c(t,{min:t&&t.twentyfour?0:1,max:t&&t.twentyfour?23:12})).min<0,"Chance: Min cannot be less than 0."),d(t.twentyfour&&t.max>23,"Chance: Max cannot be greater than 23 for twentyfour option."),d(!t.twentyfour&&t.max>12,"Chance: Max cannot be greater than 12."),d(t.min>t.max,"Chance: Min cannot be greater than Max."),this.natural({min:t.min,max:t.max})},l.prototype.millisecond=function(){return this.natural({max:999})},l.prototype.minute=l.prototype.second=function(t){return d((t=c(t,{min:0,max:59})).min<0,"Chance: Min cannot be less than 0."),d(t.max>59,"Chance: Max cannot be greater than 59."),d(t.min>t.max,"Chance: Min cannot be greater than Max."),this.natural({min:t.min,max:t.max})},l.prototype.month=function(t){d((t=c(t,{min:1,max:12})).min<1,"Chance: Min cannot be less than 1."),d(t.max>12,"Chance: Max cannot be greater than 12."),d(t.min>t.max,"Chance: Min cannot be greater than Max.");var e=this.pick(this.months().slice(t.min-1,t.max));return t.raw?e:e.name},l.prototype.months=function(){return this.get("months")},l.prototype.second=function(){return this.natural({max:59})},l.prototype.timestamp=function(){return this.natural({min:1,max:parseInt((new Date).getTime()/1e3,10)})},l.prototype.weekday=function(t){var e=["Monday","Tuesday","Wednesday","Thursday","Friday"];return(t=c(t,{weekday_only:!1})).weekday_only||(e.push("Saturday"),e.push("Sunday")),this.pickone(e)},l.prototype.year=function(t){return(t=c(t,{min:(new Date).getFullYear()})).max=void 0!==t.max?t.max:t.min+100,this.natural(t).toString()},l.prototype.cc=function(t){var e,i,n;return i=(e=(t=c(t)).type?this.cc_type({name:t.type,raw:!0}):this.cc_type({raw:!0})).prefix.split(""),n=e.length-e.prefix.length-1,(i=i.concat(this.n(this.integer,n,{min:0,max:9}))).push(this.luhn_calculate(i.join(""))),i.join("")},l.prototype.cc_types=function(){return this.get("cc_types")},l.prototype.cc_type=function(t){t=c(t);var e=this.cc_types(),i=null;if(t.name){for(var n=0;n<e.length;n++)if(e[n].name===t.name||e[n].short_name===t.name){i=e[n];break}if(null===i)throw new RangeError("Chance: Credit card type '"+t.name+"' is not supported")}else i=this.pick(e);return t.raw?i:i.name},l.prototype.currency_types=function(){return this.get("currency_types")},l.prototype.currency=function(){return this.pick(this.currency_types())},l.prototype.timezones=function(){return this.get("timezones")},l.prototype.timezone=function(){return this.pick(this.timezones())},l.prototype.currency_pair=function(t){var e=this.unique(this.currency,2,{comparator:function(t,e){return t.reduce((function(t,i){return t||i.code===e.code}),!1)}});return t?e[0].code+"/"+e[1].code:e},l.prototype.dollar=function(t){t=c(t,{max:1e4,min:0});var e=this.floating({min:t.min,max:t.max,fixed:2}).toString(),i=e.split(".")[1];return void 0===i?e+=".00":i.length<2&&(e+="0"),e<0?"-$"+e.replace("-",""):"$"+e},l.prototype.euro=function(t){return Number(this.dollar(t).replace("$","")).toLocaleString()+"€"},l.prototype.exp=function(t){t=c(t);var e={};return e.year=this.exp_year(),e.year===(new Date).getFullYear().toString()?e.month=this.exp_month({future:!0}):e.month=this.exp_month(),t.raw?e:e.month+"/"+e.year},l.prototype.exp_month=function(t){t=c(t);var e,i,n=(new Date).getMonth()+1;if(t.future&&12!==n)do{e=this.month({raw:!0}).numeric,i=parseInt(e,10)}while(i<=n);else e=this.month({raw:!0}).numeric;return e},l.prototype.exp_year=function(){var t=(new Date).getMonth()+1,e=(new Date).getFullYear();return this.year({min:12===t?e+1:e,max:e+10})},l.prototype.vat=function(t){switch((t=c(t,{country:"it"})).country.toLowerCase()){case"it":return this.it_vat()}},l.prototype.iban=function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ";return this.string({length:2,pool:t})+this.pad(this.integer({min:0,max:99}),2)+this.string({length:4,pool:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"})+this.pad(this.natural(),this.natural({min:6,max:26}))},l.prototype.it_vat=function(){var t=this.natural({min:1,max:18e5});return(t=this.pad(t,7)+this.pad(this.pick(this.provinces({country:"it"})).code,3))+this.luhn_calculate(t)},l.prototype.cf=function(t){var e=(t=t||{}).gender?t.gender:this.gender(),i=t.first?t.first:this.first({gender:e,nationality:"it"}),n=t.last?t.last:this.last({nationality:"it"}),r=t.birthday?t.birthday:this.birthday(),o=t.city?t.city:this.pickone(["A","B","C","D","E","F","G","H","I","L","M","Z"])+this.pad(this.natural({max:999}),3),a=[],s=function(t,e){var i,n=[];return t.length<3?n=t.split("").concat("XXX".split("")).splice(0,3):((i=t.toUpperCase().split("").map((function(t){return-1!=="BCDFGHJKLMNPRSTVWZ".indexOf(t)?t:void 0})).join("")).length>3&&(i=e?i.substr(0,3):i[0]+i.substr(2,2)),i.length<3&&(n=i,i=t.toUpperCase().split("").map((function(t){return-1!=="AEIOU".indexOf(t)?t:void 0})).join("").substr(0,3-n.length)),n+=i),n};return a=a.concat(s(n,!0),s(i),function(t,e,i){return t.getFullYear().toString().substr(2)+["A","B","C","D","E","H","L","M","P","R","S","T"][t.getMonth()]+i.pad(t.getDate()+("female"===e.toLowerCase()?40:0),2)}(r,e,this),o.toUpperCase().split("")).join(""),(a+=function(t){for(var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",i="ABCDEFGHIJABCDEFGHIJKLMNOPQRSTUVWXYZ",n="ABCDEFGHIJKLMNOPQRSTUVWXYZ",r=0,o=0;o<15;o++)r+=o%2!=0?n.indexOf(i[e.indexOf(t[o])]):"BAKPLCQDREVOSFTGUHMINJWZYX".indexOf(i[e.indexOf(t[o])]);return n[r%26]}(a.toUpperCase())).toUpperCase()},l.prototype.pl_pesel=function(){for(var t=this.natural({min:1,max:9999999999}),e=this.pad(t,10).split(""),i=0;i<e.length;i++)e[i]=parseInt(e[i]);var n=(1*e[0]+3*e[1]+7*e[2]+9*e[3]+1*e[4]+3*e[5]+7*e[6]+9*e[7]+1*e[8]+3*e[9])%10;return 0!==n&&(n=10-n),e.join("")+n},l.prototype.pl_nip=function(){for(var t=this.natural({min:1,max:999999999}),e=this.pad(t,9).split(""),i=0;i<e.length;i++)e[i]=parseInt(e[i]);var n=(6*e[0]+5*e[1]+7*e[2]+2*e[3]+3*e[4]+4*e[5]+5*e[6]+6*e[7]+7*e[8])%11;return 10===n?this.pl_nip():e.join("")+n},l.prototype.pl_regon=function(){for(var t=this.natural({min:1,max:99999999}),e=this.pad(t,8).split(""),i=0;i<e.length;i++)e[i]=parseInt(e[i]);var n=(8*e[0]+9*e[1]+2*e[2]+3*e[3]+4*e[4]+5*e[5]+6*e[6]+7*e[7])%11;return 10===n&&(n=0),e.join("")+n},l.prototype.note=function(t){t=c(t,{notes:"flatKey"});var e={naturals:["C","D","E","F","G","A","B"],flats:["D♭","E♭","G♭","A♭","B♭"],sharps:["C♯","D♯","F♯","G♯","A♯"]};return e.all=e.naturals.concat(e.flats.concat(e.sharps)),e.flatKey=e.naturals.concat(e.flats),e.sharpKey=e.naturals.concat(e.sharps),this.pickone(e[t.notes])},l.prototype.midi_note=function(t){return t=c(t,{min:0,max:127}),this.integer({min:t.min,max:t.max})},l.prototype.chord_quality=function(t){var e=["maj","min","aug","dim"];return(t=c(t,{jazz:!0})).jazz&&(e=["maj7","min7","7","sus","dim","ø"]),this.pickone(e)},l.prototype.chord=function(t){return t=c(t),this.note(t)+this.chord_quality(t)},l.prototype.tempo=function(t){return t=c(t,{min:40,max:320}),this.integer({min:t.min,max:t.max})},l.prototype.coin=function(){return this.bool()?"heads":"tails"},l.prototype.d4=y({min:1,max:4}),l.prototype.d6=y({min:1,max:6}),l.prototype.d8=y({min:1,max:8}),l.prototype.d10=y({min:1,max:10}),l.prototype.d12=y({min:1,max:12}),l.prototype.d20=y({min:1,max:20}),l.prototype.d30=y({min:1,max:30}),l.prototype.d100=y({min:1,max:100}),l.prototype.rpg=function(t,e){if(e=c(e),t){var i=t.toLowerCase().split("d"),n=[];if(2!==i.length||!parseInt(i[0],10)||!parseInt(i[1],10))throw new Error("Chance: Invalid format provided. Please provide #d# where the first # is the number of dice to roll, the second # is the max of each die");for(var r=i[0];r>0;r--)n[r-1]=this.natural({min:1,max:i[1]});return void 0!==e.sum&&e.sum?n.reduce((function(t,e){return t+e})):n}throw new RangeError("Chance: A type of die roll must be included")},l.prototype.guid=function(t){t=c(t,{version:5});var e="abcdef1234567890";return this.string({pool:e,length:8})+"-"+this.string({pool:e,length:4})+"-"+t.version+this.string({pool:e,length:3})+"-"+this.string({pool:"ab89",length:1})+this.string({pool:e,length:3})+"-"+this.string({pool:e,length:12})},l.prototype.hash=function(t){var e="upper"===(t=c(t,{length:40,casing:"lower"})).casing?s.toUpperCase():s;return this.string({pool:e,length:t.length})},l.prototype.luhn_check=function(t){var e=t.toString();return+e.substring(e.length-1)===this.luhn_calculate(+e.substring(0,e.length-1))},l.prototype.luhn_calculate=function(t){for(var e,i=t.toString().split("").reverse(),n=0,r=0,o=i.length;o>r;++r)e=+i[r],r%2==0&&(e*=2)>9&&(e-=9),n+=e;return 9*n%10},l.prototype.md5=function(t){var e={str:"",key:null,raw:!1};if(t)if("string"==typeof t)e.str=t,t={};else{if("object"!=typeof t)return null;if("Array"===t.constructor)return null}else e.str=this.string(),t={};if(!(e=c(t,e)).str)throw new Error("A parameter is required to return an md5 hash.");return this.bimd5.md5(e.str,e.key,e.raw)},l.prototype.file=function(t){var e,i=t||{},n=Object.keys(this.get("fileExtension"));if(e=this.word({length:i.length}),i.extension)return e+"."+i.extension;if(i.extensions){if(Array.isArray(i.extensions))return e+"."+this.pickone(i.extensions);if(i.extensions.constructor===Object){var r=i.extensions,o=Object.keys(r);return e+"."+this.pickone(r[this.pickone(o)])}throw new Error("Chance: Extensions must be an Array or Object")}if(i.fileType){var a=i.fileType;if(-1!==n.indexOf(a))return e+"."+this.pickone(this.get("fileExtension")[a]);throw new RangeError("Chance: Expect file type value to be 'raster', 'vector', '3d' or 'document'")}return e+"."+this.pickone(this.get("fileExtension")[this.pickone(n)])};var v={firstNames:{male:{en:["James","John","Robert","Michael","William","David","Richard","Joseph","Charles","Thomas","Christopher","Daniel","Matthew","George","Donald","Anthony","Paul","Mark","Edward","Steven","Kenneth","Andrew","Brian","Joshua","Kevin","Ronald","Timothy","Jason","Jeffrey","Frank","Gary","Ryan","Nicholas","Eric","Stephen","Jacob","Larry","Jonathan","Scott","Raymond","Justin","Brandon","Gregory","Samuel","Benjamin","Patrick","Jack","Henry","Walter","Dennis","Jerry","Alexander","Peter","Tyler","Douglas","Harold","Aaron","Jose","Adam","Arthur","Zachary","Carl","Nathan","Albert","Kyle","Lawrence","Joe","Willie","Gerald","Roger","Keith","Jeremy","Terry","Harry","Ralph","Sean","Jesse","Roy","Louis","Billy","Austin","Bruce","Eugene","Christian","Bryan","Wayne","Russell","Howard","Fred","Ethan","Jordan","Philip","Alan","Juan","Randy","Vincent","Bobby","Dylan","Johnny","Phillip","Victor","Clarence","Ernest","Martin","Craig","Stanley","Shawn","Travis","Bradley","Leonard","Earl","Gabriel","Jimmy","Francis","Todd","Noah","Danny","Dale","Cody","Carlos","Allen","Frederick","Logan","Curtis","Alex","Joel","Luis","Norman","Marvin","Glenn","Tony","Nathaniel","Rodney","Melvin","Alfred","Steve","Cameron","Chad","Edwin","Caleb","Evan","Antonio","Lee","Herbert","Jeffery","Isaac","Derek","Ricky","Marcus","Theodore","Elijah","Luke","Jesus","Eddie","Troy","Mike","Dustin","Ray","Adrian","Bernard","Leroy","Angel","Randall","Wesley","Ian","Jared","Mason","Hunter","Calvin","Oscar","Clifford","Jay","Shane","Ronnie","Barry","Lucas","Corey","Manuel","Leo","Tommy","Warren","Jackson","Isaiah","Connor","Don","Dean","Jon","Julian","Miguel","Bill","Lloyd","Charlie","Mitchell","Leon","Jerome","Darrell","Jeremiah","Alvin","Brett","Seth","Floyd","Jim","Blake","Micheal","Gordon","Trevor","Lewis","Erik","Edgar","Vernon","Devin","Gavin","Jayden","Chris","Clyde","Tom","Derrick","Mario","Brent","Marc","Herman","Chase","Dominic","Ricardo","Franklin","Maurice","Max","Aiden","Owen","Lester","Gilbert","Elmer","Gene","Francisco","Glen","Cory","Garrett","Clayton","Sam","Jorge","Chester","Alejandro","Jeff","Harvey","Milton","Cole","Ivan","Andre","Duane","Landon"],it:["Adolfo","Alberto","Aldo","Alessandro","Alessio","Alfredo","Alvaro","Andrea","Angelo","Angiolo","Antonino","Antonio","Attilio","Benito","Bernardo","Bruno","Carlo","Cesare","Christian","Claudio","Corrado","Cosimo","Cristian","Cristiano","Daniele","Dario","David","Davide","Diego","Dino","Domenico","Duccio","Edoardo","Elia","Elio","Emanuele","Emiliano","Emilio","Enrico","Enzo","Ettore","Fabio","Fabrizio","Federico","Ferdinando","Fernando","Filippo","Francesco","Franco","Gabriele","Giacomo","Giampaolo","Giampiero","Giancarlo","Gianfranco","Gianluca","Gianmarco","Gianni","Gino","Giorgio","Giovanni","Giuliano","Giulio","Giuseppe","Graziano","Gregorio","Guido","Iacopo","Jacopo","Lapo","Leonardo","Lorenzo","Luca","Luciano","Luigi","Manuel","Marcello","Marco","Marino","Mario","Massimiliano","Massimo","Matteo","Mattia","Maurizio","Mauro","Michele","Mirko","Mohamed","Nello","Neri","Niccolò","Nicola","Osvaldo","Otello","Paolo","Pier Luigi","Piero","Pietro","Raffaele","Remo","Renato","Renzo","Riccardo","Roberto","Rolando","Romano","Salvatore","Samuele","Sandro","Sergio","Silvano","Simone","Stefano","Thomas","Tommaso","Ubaldo","Ugo","Umberto","Valerio","Valter","Vasco","Vincenzo","Vittorio"],nl:["Aaron","Abel","Adam","Adriaan","Albert","Alexander","Ali","Arjen","Arno","Bart","Bas","Bastiaan","Benjamin","Bob","Boris","Bram","Brent","Cas","Casper","Chris","Christiaan","Cornelis","Daan","Daley","Damian","Dani","Daniel","Daniël","David","Dean","Dirk","Dylan","Egbert","Elijah","Erik","Erwin","Evert","Ezra","Fabian","Fedde","Finn","Florian","Floris","Frank","Frans","Frederik","Freek","Geert","Gerard","Gerben","Gerrit","Gijs","Guus","Hans","Hendrik","Henk","Herman","Hidde","Hugo","Jaap","Jan Jaap","Jan-Willem","Jack","Jacob","Jan","Jason","Jasper","Jayden","Jelle","Jelte","Jens","Jeroen","Jesse","Jim","Job","Joep","Johannes","John","Jonathan","Joris","Joshua","Joël","Julian","Kees","Kevin","Koen","Lars","Laurens","Leendert","Lennard","Lodewijk","Luc","Luca","Lucas","Lukas","Luuk","Maarten","Marcus","Martijn","Martin","Matthijs","Maurits","Max","Mees","Melle","Mick","Mika","Milan","Mohamed","Mohammed","Morris","Muhammed","Nathan","Nick","Nico","Niek","Niels","Noah","Noud","Olivier","Oscar","Owen","Paul","Pepijn","Peter","Pieter","Pim","Quinten","Reinier","Rens","Robin","Ruben","Sam","Samuel","Sander","Sebastiaan","Sem","Sep","Sepp","Siem","Simon","Stan","Stef","Steven","Stijn","Sven","Teun","Thijmen","Thijs","Thomas","Tijn","Tim","Timo","Tobias","Tom","Victor","Vince","Willem","Wim","Wouter","Yusuf"],fr:["Aaron","Abdon","Abel","Abélard","Abelin","Abondance","Abraham","Absalon","Acace","Achaire","Achille","Adalard","Adalbald","Adalbéron","Adalbert","Adalric","Adam","Adegrin","Adel","Adelin","Andelin","Adelphe","Adam","Adéodat","Adhémar","Adjutor","Adolphe","Adonis","Adon","Adrien","Agapet","Agathange","Agathon","Agilbert","Agénor","Agnan","Aignan","Agrippin","Aimable","Aimé","Alain","Alban","Albin","Aubin","Albéric","Albert","Albertet","Alcibiade","Alcide","Alcée","Alcime","Aldonce","Aldric","Aldéric","Aleaume","Alexandre","Alexis","Alix","Alliaume","Aleaume","Almine","Almire","Aloïs","Alphée","Alphonse","Alpinien","Alverède","Amalric","Amaury","Amandin","Amant","Ambroise","Amédée","Amélien","Amiel","Amour","Anaël","Anastase","Anatole","Ancelin","Andéol","Andoche","André","Andoche","Ange","Angelin","Angilbe","Anglebert","Angoustan","Anicet","Anne","Annibal","Ansbert","Anselme","Anthelme","Antheaume","Anthime","Antide","Antoine","Antonius","Antonin","Apollinaire","Apollon","Aquilin","Arcade","Archambaud","Archambeau","Archange","Archibald","Arian","Ariel","Ariste","Aristide","Armand","Armel","Armin","Arnould","Arnaud","Arolde","Arsène","Arsinoé","Arthaud","Arthème","Arthur","Ascelin","Athanase","Aubry","Audebert","Audouin","Audran","Audric","Auguste","Augustin","Aurèle","Aurélien","Aurian","Auxence","Axel","Aymard","Aymeric","Aymon","Aymond","Balthazar","Baptiste","Barnabé","Barthélemy","Bartimée","Basile","Bastien","Baudouin","Bénigne","Benjamin","Benoît","Bérenger","Bérard","Bernard","Bertrand","Blaise","Bon","Boniface","Bouchard","Brice","Brieuc","Bruno","Brunon","Calixte","Calliste","Camélien","Camille","Camillien","Candide","Caribert","Carloman","Cassandre","Cassien","Cédric","Céleste","Célestin","Célien","Césaire","César","Charles","Charlemagne","Childebert","Chilpéric","Chrétien","Christian","Christodule","Christophe","Chrysostome","Clarence","Claude","Claudien","Cléandre","Clément","Clotaire","Côme","Constance","Constant","Constantin","Corentin","Cyprien","Cyriaque","Cyrille","Cyril","Damien","Daniel","David","Delphin","Denis","Désiré","Didier","Dieudonné","Dimitri","Dominique","Dorian","Dorothée","Edgard","Edmond","Édouard","Éleuthère","Élie","Élisée","Émeric","Émile","Émilien","Emmanuel","Enguerrand","Épiphane","Éric","Esprit","Ernest","Étienne","Eubert","Eudes","Eudoxe","Eugène","Eusèbe","Eustache","Évariste","Évrard","Fabien","Fabrice","Falba","Félicité","Félix","Ferdinand","Fiacre","Fidèle","Firmin","Flavien","Flodoard","Florent","Florentin","Florestan","Florian","Fortuné","Foulques","Francisque","François","Français","Franciscus","Francs","Frédéric","Fulbert","Fulcran","Fulgence","Gabin","Gabriel","Gaël","Garnier","Gaston","Gaspard","Gatien","Gaud","Gautier","Gédéon","Geoffroy","Georges","Géraud","Gérard","Gerbert","Germain","Gervais","Ghislain","Gilbert","Gilles","Girart","Gislebert","Gondebaud","Gonthier","Gontran","Gonzague","Grégoire","Guérin","Gui","Guillaume","Gustave","Guy","Guyot","Hardouin","Hector","Hédelin","Hélier","Henri","Herbert","Herluin","Hervé","Hilaire","Hildebert","Hincmar","Hippolyte","Honoré","Hubert","Hugues","Innocent","Isabeau","Isidore","Jacques","Japhet","Jason","Jean","Jeannel","Jeannot","Jérémie","Jérôme","Joachim","Joanny","Job","Jocelyn","Joël","Johan","Jonas","Jonathan","Joseph","Josse","Josselin","Jourdain","Jude","Judicaël","Jules","Julien","Juste","Justin","Lambert","Landry","Laurent","Lazare","Léandre","Léon","Léonard","Léopold","Leu","Loup","Leufroy","Libère","Liétald","Lionel","Loïc","Longin","Lorrain","Lorraine","Lothaire","Louis","Loup","Luc","Lucas","Lucien","Ludolphe","Ludovic","Macaire","Malo","Mamert","Manassé","Marc","Marceau","Marcel","Marcelin","Marius","Marseille","Martial","Martin","Mathurin","Matthias","Mathias","Matthieu","Maugis","Maurice","Mauricet","Maxence","Maxime","Maximilien","Mayeul","Médéric","Melchior","Mence","Merlin","Mérovée","Michaël","Michel","Moïse","Morgan","Nathan","Nathanaël","Narcisse","Néhémie","Nestor","Nestor","Nicéphore","Nicolas","Noé","Noël","Norbert","Normand","Normands","Octave","Odilon","Odon","Oger","Olivier","Oury","Pacôme","Palémon","Parfait","Pascal","Paterne","Patrice","Paul","Pépin","Perceval","Philémon","Philibert","Philippe","Philothée","Pie","Pierre","Pierrick","Prosper","Quentin","Raoul","Raphaël","Raymond","Régis","Réjean","Rémi","Renaud","René","Reybaud","Richard","Robert","Roch","Rodolphe","Rodrigue","Roger","Roland","Romain","Romuald","Roméo","Rome","Ronan","Roselin","Salomon","Samuel","Savin","Savinien","Scholastique","Sébastien","Séraphin","Serge","Séverin","Sidoine","Sigebert","Sigismond","Silvère","Simon","Siméon","Sixte","Stanislas","Stéphane","Stephan","Sylvain","Sylvestre","Tancrède","Tanguy","Taurin","Théodore","Théodose","Théophile","Théophraste","Thibault","Thibert","Thierry","Thomas","Timoléon","Timothée","Titien","Tonnin","Toussaint","Trajan","Tristan","Turold","Tim","Ulysse","Urbain","Valentin","Valère","Valéry","Venance","Venant","Venceslas","Vianney","Victor","Victorien","Victorin","Vigile","Vincent","Vital","Vitalien","Vivien","Waleran","Wandrille","Xavier","Xénophon","Yves","Zacharie","Zaché","Zéphirin"]},female:{en:["Mary","Emma","Elizabeth","Minnie","Margaret","Ida","Alice","Bertha","Sarah","Annie","Clara","Ella","Florence","Cora","Martha","Laura","Nellie","Grace","Carrie","Maude","Mabel","Bessie","Jennie","Gertrude","Julia","Hattie","Edith","Mattie","Rose","Catherine","Lillian","Ada","Lillie","Helen","Jessie","Louise","Ethel","Lula","Myrtle","Eva","Frances","Lena","Lucy","Edna","Maggie","Pearl","Daisy","Fannie","Josephine","Dora","Rosa","Katherine","Agnes","Marie","Nora","May","Mamie","Blanche","Stella","Ellen","Nancy","Effie","Sallie","Nettie","Della","Lizzie","Flora","Susie","Maud","Mae","Etta","Harriet","Sadie","Caroline","Katie","Lydia","Elsie","Kate","Susan","Mollie","Alma","Addie","Georgia","Eliza","Lulu","Nannie","Lottie","Amanda","Belle","Charlotte","Rebecca","Ruth","Viola","Olive","Amelia","Hannah","Jane","Virginia","Emily","Matilda","Irene","Kathryn","Esther","Willie","Henrietta","Ollie","Amy","Rachel","Sara","Estella","Theresa","Augusta","Ora","Pauline","Josie","Lola","Sophia","Leona","Anne","Mildred","Ann","Beulah","Callie","Lou","Delia","Eleanor","Barbara","Iva","Louisa","Maria","Mayme","Evelyn","Estelle","Nina","Betty","Marion","Bettie","Dorothy","Luella","Inez","Lela","Rosie","Allie","Millie","Janie","Cornelia","Victoria","Ruby","Winifred","Alta","Celia","Christine","Beatrice","Birdie","Harriett","Mable","Myra","Sophie","Tillie","Isabel","Sylvia","Carolyn","Isabelle","Leila","Sally","Ina","Essie","Bertie","Nell","Alberta","Katharine","Lora","Rena","Mina","Rhoda","Mathilda","Abbie","Eula","Dollie","Hettie","Eunice","Fanny","Ola","Lenora","Adelaide","Christina","Lelia","Nelle","Sue","Johanna","Lilly","Lucinda","Minerva","Lettie","Roxie","Cynthia","Helena","Hilda","Hulda","Bernice","Genevieve","Jean","Cordelia","Marian","Francis","Jeanette","Adeline","Gussie","Leah","Lois","Lura","Mittie","Hallie","Isabella","Olga","Phoebe","Teresa","Hester","Lida","Lina","Winnie","Claudia","Marguerite","Vera","Cecelia","Bess","Emilie","Rosetta","Verna","Myrtie","Cecilia","Elva","Olivia","Ophelia","Georgie","Elnora","Violet","Adele","Lily","Linnie","Loretta","Madge","Polly","Virgie","Eugenia","Lucile","Lucille","Mabelle","Rosalie"],it:["Ada","Adriana","Alessandra","Alessia","Alice","Angela","Anna","Anna Maria","Annalisa","Annita","Annunziata","Antonella","Arianna","Asia","Assunta","Aurora","Barbara","Beatrice","Benedetta","Bianca","Bruna","Camilla","Carla","Carlotta","Carmela","Carolina","Caterina","Catia","Cecilia","Chiara","Cinzia","Clara","Claudia","Costanza","Cristina","Daniela","Debora","Diletta","Dina","Donatella","Elena","Eleonora","Elisa","Elisabetta","Emanuela","Emma","Eva","Federica","Fernanda","Fiorella","Fiorenza","Flora","Franca","Francesca","Gabriella","Gaia","Gemma","Giada","Gianna","Gina","Ginevra","Giorgia","Giovanna","Giulia","Giuliana","Giuseppa","Giuseppina","Grazia","Graziella","Greta","Ida","Ilaria","Ines","Iolanda","Irene","Irma","Isabella","Jessica","Laura","Lea","Letizia","Licia","Lidia","Liliana","Lina","Linda","Lisa","Livia","Loretta","Luana","Lucia","Luciana","Lucrezia","Luisa","Manuela","Mara","Marcella","Margherita","Maria","Maria Cristina","Maria Grazia","Maria Luisa","Maria Pia","Maria Teresa","Marina","Marisa","Marta","Martina","Marzia","Matilde","Melissa","Michela","Milena","Mirella","Monica","Natalina","Nella","Nicoletta","Noemi","Olga","Paola","Patrizia","Piera","Pierina","Raffaella","Rebecca","Renata","Rina","Rita","Roberta","Rosa","Rosanna","Rossana","Rossella","Sabrina","Sandra","Sara","Serena","Silvana","Silvia","Simona","Simonetta","Sofia","Sonia","Stefania","Susanna","Teresa","Tina","Tiziana","Tosca","Valentina","Valeria","Vanda","Vanessa","Vanna","Vera","Veronica","Vilma","Viola","Virginia","Vittoria"],nl:["Ada","Arianne","Afke","Amanda","Amber","Amy","Aniek","Anita","Anja","Anna","Anne","Annelies","Annemarie","Annette","Anouk","Astrid","Aukje","Barbara","Bianca","Carla","Carlijn","Carolien","Chantal","Charlotte","Claudia","Daniëlle","Debora","Diane","Dora","Eline","Elise","Ella","Ellen","Emma","Esmee","Evelien","Esther","Erica","Eva","Femke","Fleur","Floor","Froukje","Gea","Gerda","Hanna","Hanneke","Heleen","Hilde","Ilona","Ina","Inge","Ingrid","Iris","Isabel","Isabelle","Janneke","Jasmijn","Jeanine","Jennifer","Jessica","Johanna","Joke","Julia","Julie","Karen","Karin","Katja","Kim","Lara","Laura","Lena","Lianne","Lieke","Lilian","Linda","Lisa","Lisanne","Lotte","Louise","Maaike","Manon","Marga","Maria","Marissa","Marit","Marjolein","Martine","Marleen","Melissa","Merel","Miranda","Michelle","Mirjam","Mirthe","Naomi","Natalie","Nienke","Nina","Noortje","Olivia","Patricia","Paula","Paulien","Ramona","Ria","Rianne","Roos","Rosanne","Ruth","Sabrina","Sandra","Sanne","Sara","Saskia","Silvia","Sofia","Sophie","Sonja","Suzanne","Tamara","Tess","Tessa","Tineke","Valerie","Vanessa","Veerle","Vera","Victoria","Wendy","Willeke","Yvonne","Zoë"],fr:["Abdon","Abel","Abigaëlle","Abigaïl","Acacius","Acanthe","Adalbert","Adalsinde","Adegrine","Adélaïde","Adèle","Adélie","Adeline","Adeltrude","Adolphe","Adonis","Adrastée","Adrehilde","Adrienne","Agathe","Agilbert","Aglaé","Aignan","Agneflète","Agnès","Agrippine","Aimé","Alaine","Alaïs","Albane","Albérade","Alberte","Alcide","Alcine","Alcyone","Aldegonde","Aleth","Alexandrine","Alexine","Alice","Aliénor","Aliette","Aline","Alix","Alizé","Aloïse","Aloyse","Alphonsine","Althée","Amaliane","Amalthée","Amande","Amandine","Amant","Amarande","Amaranthe","Amaryllis","Ambre","Ambroisie","Amélie","Améthyste","Aminte","Anaël","Anaïs","Anastasie","Anatole","Ancelin","Andrée","Anémone","Angadrême","Angèle","Angeline","Angélique","Angilbert","Anicet","Annabelle","Anne","Annette","Annick","Annie","Annonciade","Ansbert","Anstrudie","Anthelme","Antigone","Antoinette","Antonine","Aphélie","Apolline","Apollonie","Aquiline","Arabelle","Arcadie","Archange","Argine","Ariane","Aricie","Ariel","Arielle","Arlette","Armance","Armande","Armandine","Armelle","Armide","Armelle","Armin","Arnaud","Arsène","Arsinoé","Artémis","Arthur","Ascelin","Ascension","Assomption","Astarté","Astérie","Astrée","Astrid","Athalie","Athanasie","Athina","Aube","Albert","Aude","Audrey","Augustine","Aure","Aurélie","Aurélien","Aurèle","Aurore","Auxence","Aveline","Abigaëlle","Avoye","Axelle","Aymard","Azalée","Adèle","Adeline","Barbe","Basilisse","Bathilde","Béatrice","Béatrix","Bénédicte","Bérengère","Bernadette","Berthe","Bertille","Beuve","Blanche","Blanc","Blandine","Brigitte","Brune","Brunehilde","Callista","Camille","Capucine","Carine","Caroline","Cassandre","Catherine","Cécile","Céleste","Célestine","Céline","Chantal","Charlène","Charline","Charlotte","Chloé","Christelle","Christiane","Christine","Claire","Clara","Claude","Claudine","Clarisse","Clémence","Clémentine","Cléo","Clio","Clotilde","Coline","Conception","Constance","Coralie","Coraline","Corentine","Corinne","Cyrielle","Daniel","Daniel","Daphné","Débora","Delphine","Denise","Diane","Dieudonné","Dominique","Doriane","Dorothée","Douce","Édith","Edmée","Éléonore","Éliane","Élia","Éliette","Élisabeth","Élise","Ella","Élodie","Éloïse","Elsa","Émeline","Émérance","Émérentienne","Émérencie","Émilie","Emma","Emmanuelle","Emmelie","Ernestine","Esther","Estelle","Eudoxie","Eugénie","Eulalie","Euphrasie","Eusébie","Évangéline","Eva","Ève","Évelyne","Fanny","Fantine","Faustine","Félicie","Fernande","Flavie","Fleur","Flore","Florence","Florie","Fortuné","France","Francia","Françoise","Francine","Gabrielle","Gaëlle","Garance","Geneviève","Georgette","Gerberge","Germaine","Gertrude","Gisèle","Guenièvre","Guilhemine","Guillemette","Gustave","Gwenael","Hélène","Héloïse","Henriette","Hermine","Hermione","Hippolyte","Honorine","Hortense","Huguette","Ines","Irène","Irina","Iris","Isabeau","Isabelle","Iseult","Isolde","Ismérie","Jacinthe","Jacqueline","Jade","Janine","Jeanne","Jocelyne","Joëlle","Joséphine","Judith","Julia","Julie","Jules","Juliette","Justine","Katy","Kathy","Katie","Laura","Laure","Laureline","Laurence","Laurene","Lauriane","Laurianne","Laurine","Léa","Léna","Léonie","Léon","Léontine","Lorraine","Lucie","Lucienne","Lucille","Ludivine","Lydie","Lydie","Megane","Madeleine","Magali","Maguelone","Mallaury","Manon","Marceline","Margot","Marguerite","Marianne","Marie","Myriam","Marie","Marine","Marion","Marlène","Marthe","Martine","Mathilde","Maud","Maureen","Mauricette","Maxime","Mélanie","Melissa","Mélissandre","Mélisande","Mélodie","Michel","Micheline","Mireille","Miriam","Moïse","Monique","Morgane","Muriel","Mylène","Nadège","Nadine","Nathalie","Nicole","Nicolette","Nine","Noël","Noémie","Océane","Odette","Odile","Olive","Olivia","Olympe","Ombline","Ombeline","Ophélie","Oriande","Oriane","Ozanne","Pascale","Pascaline","Paule","Paulette","Pauline","Priscille","Prisca","Prisque","Pécine","Pélagie","Pénélope","Perrine","Pétronille","Philippine","Philomène","Philothée","Primerose","Prudence","Pulchérie","Quentine","Quiéta","Quintia","Quintilla","Rachel","Raphaëlle","Raymonde","Rebecca","Régine","Réjeanne","René","Rita","Rita","Rolande","Romane","Rosalie","Rose","Roseline","Sabine","Salomé","Sandra","Sandrine","Sarah","Ségolène","Séverine","Sibylle","Simone","Sixt","Solange","Soline","Solène","Sophie","Stéphanie","Suzanne","Sylvain","Sylvie","Tatiana","Thaïs","Théodora","Thérèse","Tiphaine","Ursule","Valentine","Valérie","Véronique","Victoire","Victorine","Vinciane","Violette","Virginie","Viviane","Xavière","Yolande","Ysaline","Yvette","Yvonne","Zélie","Zita","Zoé"]}},lastNames:{en:["Smith","Johnson","Williams","Jones","Brown","Davis","Miller","Wilson","Moore","Taylor","Anderson","Thomas","Jackson","White","Harris","Martin","Thompson","Garcia","Martinez","Robinson","Clark","Rodriguez","Lewis","Lee","Walker","Hall","Allen","Young","Hernandez","King","Wright","Lopez","Hill","Scott","Green","Adams","Baker","Gonzalez","Nelson","Carter","Mitchell","Perez","Roberts","Turner","Phillips","Campbell","Parker","Evans","Edwards","Collins","Stewart","Sanchez","Morris","Rogers","Reed","Cook","Morgan","Bell","Murphy","Bailey","Rivera","Cooper","Richardson","Cox","Howard","Ward","Torres","Peterson","Gray","Ramirez","James","Watson","Brooks","Kelly","Sanders","Price","Bennett","Wood","Barnes","Ross","Henderson","Coleman","Jenkins","Perry","Powell","Long","Patterson","Hughes","Flores","Washington","Butler","Simmons","Foster","Gonzales","Bryant","Alexander","Russell","Griffin","Diaz","Hayes","Myers","Ford","Hamilton","Graham","Sullivan","Wallace","Woods","Cole","West","Jordan","Owens","Reynolds","Fisher","Ellis","Harrison","Gibson","McDonald","Cruz","Marshall","Ortiz","Gomez","Murray","Freeman","Wells","Webb","Simpson","Stevens","Tucker","Porter","Hunter","Hicks","Crawford","Henry","Boyd","Mason","Morales","Kennedy","Warren","Dixon","Ramos","Reyes","Burns","Gordon","Shaw","Holmes","Rice","Robertson","Hunt","Black","Daniels","Palmer","Mills","Nichols","Grant","Knight","Ferguson","Rose","Stone","Hawkins","Dunn","Perkins","Hudson","Spencer","Gardner","Stephens","Payne","Pierce","Berry","Matthews","Arnold","Wagner","Willis","Ray","Watkins","Olson","Carroll","Duncan","Snyder","Hart","Cunningham","Bradley","Lane","Andrews","Ruiz","Harper","Fox","Riley","Armstrong","Carpenter","Weaver","Greene","Lawrence","Elliott","Chavez","Sims","Austin","Peters","Kelley","Franklin","Lawson","Fields","Gutierrez","Ryan","Schmidt","Carr","Vasquez","Castillo","Wheeler","Chapman","Oliver","Montgomery","Richards","Williamson","Johnston","Banks","Meyer","Bishop","McCoy","Howell","Alvarez","Morrison","Hansen","Fernandez","Garza","Harvey","Little","Burton","Stanley","Nguyen","George","Jacobs","Reid","Kim","Fuller","Lynch","Dean","Gilbert","Garrett","Romero","Welch","Larson","Frazier","Burke","Hanson","Day","Mendoza","Moreno","Bowman","Medina","Fowler","Brewer","Hoffman","Carlson","Silva","Pearson","Holland","Douglas","Fleming","Jensen","Vargas","Byrd","Davidson","Hopkins","May","Terry","Herrera","Wade","Soto","Walters","Curtis","Neal","Caldwell","Lowe","Jennings","Barnett","Graves","Jimenez","Horton","Shelton","Barrett","Obrien","Castro","Sutton","Gregory","McKinney","Lucas","Miles","Craig","Rodriquez","Chambers","Holt","Lambert","Fletcher","Watts","Bates","Hale","Rhodes","Pena","Beck","Newman","Haynes","McDaniel","Mendez","Bush","Vaughn","Parks","Dawson","Santiago","Norris","Hardy","Love","Steele","Curry","Powers","Schultz","Barker","Guzman","Page","Munoz","Ball","Keller","Chandler","Weber","Leonard","Walsh","Lyons","Ramsey","Wolfe","Schneider","Mullins","Benson","Sharp","Bowen","Daniel","Barber","Cummings","Hines","Baldwin","Griffith","Valdez","Hubbard","Salazar","Reeves","Warner","Stevenson","Burgess","Santos","Tate","Cross","Garner","Mann","Mack","Moss","Thornton","Dennis","McGee","Farmer","Delgado","Aguilar","Vega","Glover","Manning","Cohen","Harmon","Rodgers","Robbins","Newton","Todd","Blair","Higgins","Ingram","Reese","Cannon","Strickland","Townsend","Potter","Goodwin","Walton","Rowe","Hampton","Ortega","Patton","Swanson","Joseph","Francis","Goodman","Maldonado","Yates","Becker","Erickson","Hodges","Rios","Conner","Adkins","Webster","Norman","Malone","Hammond","Flowers","Cobb","Moody","Quinn","Blake","Maxwell","Pope","Floyd","Osborne","Paul","McCarthy","Guerrero","Lindsey","Estrada","Sandoval","Gibbs","Tyler","Gross","Fitzgerald","Stokes","Doyle","Sherman","Saunders","Wise","Colon","Gill","Alvarado","Greer","Padilla","Simon","Waters","Nunez","Ballard","Schwartz","McBride","Houston","Christensen","Klein","Pratt","Briggs","Parsons","McLaughlin","Zimmerman","French","Buchanan","Moran","Copeland","Roy","Pittman","Brady","McCormick","Holloway","Brock","Poole","Frank","Logan","Owen","Bass","Marsh","Drake","Wong","Jefferson","Park","Morton","Abbott","Sparks","Patrick","Norton","Huff","Clayton","Massey","Lloyd","Figueroa","Carson","Bowers","Roberson","Barton","Tran","Lamb","Harrington","Casey","Boone","Cortez","Clarke","Mathis","Singleton","Wilkins","Cain","Bryan","Underwood","Hogan","McKenzie","Collier","Luna","Phelps","McGuire","Allison","Bridges","Wilkerson","Nash","Summers","Atkins"],it:["Acciai","Aglietti","Agostini","Agresti","Ahmed","Aiazzi","Albanese","Alberti","Alessi","Alfani","Alinari","Alterini","Amato","Ammannati","Ancillotti","Andrei","Andreini","Andreoni","Angeli","Anichini","Antonelli","Antonini","Arena","Ariani","Arnetoli","Arrighi","Baccani","Baccetti","Bacci","Bacherini","Badii","Baggiani","Baglioni","Bagni","Bagnoli","Baldassini","Baldi","Baldini","Ballerini","Balli","Ballini","Balloni","Bambi","Banchi","Bandinelli","Bandini","Bani","Barbetti","Barbieri","Barchielli","Bardazzi","Bardelli","Bardi","Barducci","Bargellini","Bargiacchi","Barni","Baroncelli","Baroncini","Barone","Baroni","Baronti","Bartalesi","Bartoletti","Bartoli","Bartolini","Bartoloni","Bartolozzi","Basagni","Basile","Bassi","Batacchi","Battaglia","Battaglini","Bausi","Becagli","Becattini","Becchi","Becucci","Bellandi","Bellesi","Belli","Bellini","Bellucci","Bencini","Benedetti","Benelli","Beni","Benini","Bensi","Benucci","Benvenuti","Berlincioni","Bernacchioni","Bernardi","Bernardini","Berni","Bernini","Bertelli","Berti","Bertini","Bessi","Betti","Bettini","Biagi","Biagini","Biagioni","Biagiotti","Biancalani","Bianchi","Bianchini","Bianco","Biffoli","Bigazzi","Bigi","Biliotti","Billi","Binazzi","Bindi","Bini","Biondi","Bizzarri","Bocci","Bogani","Bolognesi","Bonaiuti","Bonanni","Bonciani","Boncinelli","Bondi","Bonechi","Bongini","Boni","Bonini","Borchi","Boretti","Borghi","Borghini","Borgioli","Borri","Borselli","Boschi","Bottai","Bracci","Braccini","Brandi","Braschi","Bravi","Brazzini","Breschi","Brilli","Brizzi","Brogelli","Brogi","Brogioni","Brunelli","Brunetti","Bruni","Bruno","Brunori","Bruschi","Bucci","Bucciarelli","Buccioni","Bucelli","Bulli","Burberi","Burchi","Burgassi","Burroni","Bussotti","Buti","Caciolli","Caiani","Calabrese","Calamai","Calamandrei","Caldini","Calo'","Calonaci","Calosi","Calvelli","Cambi","Camiciottoli","Cammelli","Cammilli","Campolmi","Cantini","Capanni","Capecchi","Caponi","Cappelletti","Cappelli","Cappellini","Cappugi","Capretti","Caputo","Carbone","Carboni","Cardini","Carlesi","Carletti","Carli","Caroti","Carotti","Carrai","Carraresi","Carta","Caruso","Casalini","Casati","Caselli","Casini","Castagnoli","Castellani","Castelli","Castellucci","Catalano","Catarzi","Catelani","Cavaciocchi","Cavallaro","Cavallini","Cavicchi","Cavini","Ceccarelli","Ceccatelli","Ceccherelli","Ceccherini","Cecchi","Cecchini","Cecconi","Cei","Cellai","Celli","Cellini","Cencetti","Ceni","Cenni","Cerbai","Cesari","Ceseri","Checcacci","Checchi","Checcucci","Cheli","Chellini","Chen","Cheng","Cherici","Cherubini","Chiaramonti","Chiarantini","Chiarelli","Chiari","Chiarini","Chiarugi","Chiavacci","Chiesi","Chimenti","Chini","Chirici","Chiti","Ciabatti","Ciampi","Cianchi","Cianfanelli","Cianferoni","Ciani","Ciapetti","Ciappi","Ciardi","Ciatti","Cicali","Ciccone","Cinelli","Cini","Ciobanu","Ciolli","Cioni","Cipriani","Cirillo","Cirri","Ciucchi","Ciuffi","Ciulli","Ciullini","Clemente","Cocchi","Cognome","Coli","Collini","Colombo","Colzi","Comparini","Conforti","Consigli","Conte","Conti","Contini","Coppini","Coppola","Corsi","Corsini","Corti","Cortini","Cosi","Costa","Costantini","Costantino","Cozzi","Cresci","Crescioli","Cresti","Crini","Curradi","D'Agostino","D'Alessandro","D'Amico","D'Angelo","Daddi","Dainelli","Dallai","Danti","Davitti","De Angelis","De Luca","De Marco","De Rosa","De Santis","De Simone","De Vita","Degl'Innocenti","Degli Innocenti","Dei","Del Lungo","Del Re","Di Marco","Di Stefano","Dini","Diop","Dobre","Dolfi","Donati","Dondoli","Dong","Donnini","Ducci","Dumitru","Ermini","Esposito","Evangelisti","Fabbri","Fabbrini","Fabbrizzi","Fabbroni","Fabbrucci","Fabiani","Facchini","Faggi","Fagioli","Failli","Faini","Falciani","Falcini","Falcone","Fallani","Falorni","Falsini","Falugiani","Fancelli","Fanelli","Fanetti","Fanfani","Fani","Fantappie'","Fantechi","Fanti","Fantini","Fantoni","Farina","Fattori","Favilli","Fedi","Fei","Ferrante","Ferrara","Ferrari","Ferraro","Ferretti","Ferri","Ferrini","Ferroni","Fiaschi","Fibbi","Fiesoli","Filippi","Filippini","Fini","Fioravanti","Fiore","Fiorentini","Fiorini","Fissi","Focardi","Foggi","Fontana","Fontanelli","Fontani","Forconi","Formigli","Forte","Forti","Fortini","Fossati","Fossi","Francalanci","Franceschi","Franceschini","Franchi","Franchini","Franci","Francini","Francioni","Franco","Frassineti","Frati","Fratini","Frilli","Frizzi","Frosali","Frosini","Frullini","Fusco","Fusi","Gabbrielli","Gabellini","Gagliardi","Galanti","Galardi","Galeotti","Galletti","Galli","Gallo","Gallori","Gambacciani","Gargani","Garofalo","Garuglieri","Gashi","Gasperini","Gatti","Gelli","Gensini","Gentile","Gentili","Geri","Gerini","Gheri","Ghini","Giachetti","Giachi","Giacomelli","Gianassi","Giani","Giannelli","Giannetti","Gianni","Giannini","Giannoni","Giannotti","Giannozzi","Gigli","Giordano","Giorgetti","Giorgi","Giovacchini","Giovannelli","Giovannetti","Giovannini","Giovannoni","Giuliani","Giunti","Giuntini","Giusti","Gonnelli","Goretti","Gori","Gradi","Gramigni","Grassi","Grasso","Graziani","Grazzini","Greco","Grifoni","Grillo","Grimaldi","Grossi","Gualtieri","Guarducci","Guarino","Guarnieri","Guasti","Guerra","Guerri","Guerrini","Guidi","Guidotti","He","Hoxha","Hu","Huang","Iandelli","Ignesti","Innocenti","Jin","La Rosa","Lai","Landi","Landini","Lanini","Lapi","Lapini","Lari","Lascialfari","Lastrucci","Latini","Lazzeri","Lazzerini","Lelli","Lenzi","Leonardi","Leoncini","Leone","Leoni","Lepri","Li","Liao","Lin","Linari","Lippi","Lisi","Livi","Lombardi","Lombardini","Lombardo","Longo","Lopez","Lorenzi","Lorenzini","Lorini","Lotti","Lu","Lucchesi","Lucherini","Lunghi","Lupi","Madiai","Maestrini","Maffei","Maggi","Maggini","Magherini","Magini","Magnani","Magnelli","Magni","Magnolfi","Magrini","Malavolti","Malevolti","Manca","Mancini","Manetti","Manfredi","Mangani","Mannelli","Manni","Mannini","Mannucci","Manuelli","Manzini","Marcelli","Marchese","Marchetti","Marchi","Marchiani","Marchionni","Marconi","Marcucci","Margheri","Mari","Mariani","Marilli","Marinai","Marinari","Marinelli","Marini","Marino","Mariotti","Marsili","Martelli","Martinelli","Martini","Martino","Marzi","Masi","Masini","Masoni","Massai","Materassi","Mattei","Matteini","Matteucci","Matteuzzi","Mattioli","Mattolini","Matucci","Mauro","Mazzanti","Mazzei","Mazzetti","Mazzi","Mazzini","Mazzocchi","Mazzoli","Mazzoni","Mazzuoli","Meacci","Mecocci","Meini","Melani","Mele","Meli","Mengoni","Menichetti","Meoni","Merlini","Messeri","Messina","Meucci","Miccinesi","Miceli","Micheli","Michelini","Michelozzi","Migliori","Migliorini","Milani","Miniati","Misuri","Monaco","Montagnani","Montagni","Montanari","Montelatici","Monti","Montigiani","Montini","Morandi","Morandini","Morelli","Moretti","Morganti","Mori","Morini","Moroni","Morozzi","Mugnai","Mugnaini","Mustafa","Naldi","Naldini","Nannelli","Nanni","Nannini","Nannucci","Nardi","Nardini","Nardoni","Natali","Ndiaye","Nencetti","Nencini","Nencioni","Neri","Nesi","Nesti","Niccolai","Niccoli","Niccolini","Nigi","Nistri","Nocentini","Noferini","Novelli","Nucci","Nuti","Nutini","Oliva","Olivieri","Olmi","Orlandi","Orlandini","Orlando","Orsini","Ortolani","Ottanelli","Pacciani","Pace","Paci","Pacini","Pagani","Pagano","Paggetti","Pagliai","Pagni","Pagnini","Paladini","Palagi","Palchetti","Palloni","Palmieri","Palumbo","Pampaloni","Pancani","Pandolfi","Pandolfini","Panerai","Panichi","Paoletti","Paoli","Paolini","Papi","Papini","Papucci","Parenti","Parigi","Parisi","Parri","Parrini","Pasquini","Passeri","Pecchioli","Pecorini","Pellegrini","Pepi","Perini","Perrone","Peruzzi","Pesci","Pestelli","Petri","Petrini","Petrucci","Pettini","Pezzati","Pezzatini","Piani","Piazza","Piazzesi","Piazzini","Piccardi","Picchi","Piccini","Piccioli","Pieraccini","Pieraccioni","Pieralli","Pierattini","Pieri","Pierini","Pieroni","Pietrini","Pini","Pinna","Pinto","Pinzani","Pinzauti","Piras","Pisani","Pistolesi","Poggesi","Poggi","Poggiali","Poggiolini","Poli","Pollastri","Porciani","Pozzi","Pratellesi","Pratesi","Prosperi","Pruneti","Pucci","Puccini","Puccioni","Pugi","Pugliese","Puliti","Querci","Quercioli","Raddi","Radu","Raffaelli","Ragazzini","Ranfagni","Ranieri","Rastrelli","Raugei","Raveggi","Renai","Renzi","Rettori","Ricci","Ricciardi","Ridi","Ridolfi","Rigacci","Righi","Righini","Rinaldi","Risaliti","Ristori","Rizzo","Rocchi","Rocchini","Rogai","Romagnoli","Romanelli","Romani","Romano","Romei","Romeo","Romiti","Romoli","Romolini","Rontini","Rosati","Roselli","Rosi","Rossetti","Rossi","Rossini","Rovai","Ruggeri","Ruggiero","Russo","Sabatini","Saccardi","Sacchetti","Sacchi","Sacco","Salerno","Salimbeni","Salucci","Salvadori","Salvestrini","Salvi","Salvini","Sanesi","Sani","Sanna","Santi","Santini","Santoni","Santoro","Santucci","Sardi","Sarri","Sarti","Sassi","Sbolci","Scali","Scarpelli","Scarselli","Scopetani","Secci","Selvi","Senatori","Senesi","Serafini","Sereni","Serra","Sestini","Sguanci","Sieni","Signorini","Silvestri","Simoncini","Simonetti","Simoni","Singh","Sodi","Soldi","Somigli","Sorbi","Sorelli","Sorrentino","Sottili","Spina","Spinelli","Staccioli","Staderini","Stefanelli","Stefani","Stefanini","Stella","Susini","Tacchi","Tacconi","Taddei","Tagliaferri","Tamburini","Tanganelli","Tani","Tanini","Tapinassi","Tarchi","Tarchiani","Targioni","Tassi","Tassini","Tempesti","Terzani","Tesi","Testa","Testi","Tilli","Tinti","Tirinnanzi","Toccafondi","Tofanari","Tofani","Tognaccini","Tonelli","Tonini","Torelli","Torrini","Tosi","Toti","Tozzi","Trambusti","Trapani","Tucci","Turchi","Ugolini","Ulivi","Valente","Valenti","Valentini","Vangelisti","Vanni","Vannini","Vannoni","Vannozzi","Vannucchi","Vannucci","Ventura","Venturi","Venturini","Vestri","Vettori","Vichi","Viciani","Vieri","Vigiani","Vignoli","Vignolini","Vignozzi","Villani","Vinci","Visani","Vitale","Vitali","Viti","Viviani","Vivoli","Volpe","Volpi","Wang","Wu","Xu","Yang","Ye","Zagli","Zani","Zanieri","Zanobini","Zecchi","Zetti","Zhang","Zheng","Zhou","Zhu","Zingoni","Zini","Zoppi"],nl:["Albers","Alblas","Appelman","Baars","Baas","Bakker","Blank","Bleeker","Blok","Blom","Boer","Boers","Boldewijn","Boon","Boot","Bos","Bosch","Bosma","Bosman","Bouma","Bouman","Bouwman","Brands","Brouwer","Burger","Buijs","Buitenhuis","Ceder","Cohen","Dekker","Dekkers","Dijkman","Dijkstra","Driessen","Drost","Engel","Evers","Faber","Franke","Gerritsen","Goedhart","Goossens","Groen","Groenenberg","Groot","Haan","Hart","Heemskerk","Hendriks","Hermans","Hoekstra","Hofman","Hopman","Huisman","Jacobs","Jansen","Janssen","Jonker","Jaspers","Keijzer","Klaassen","Klein","Koek","Koenders","Kok","Kool","Koopman","Koopmans","Koning","Koster","Kramer","Kroon","Kuijpers","Kuiper","Kuipers","Kurt","Koster","Kwakman","Los","Lubbers","Maas","Markus","Martens","Meijer","Mol","Molenaar","Mulder","Nieuwenhuis","Peeters","Peters","Pengel","Pieters","Pool","Post","Postma","Prins","Pronk","Reijnders","Rietveld","Roest","Roos","Sanders","Schaap","Scheffer","Schenk","Schilder","Schipper","Schmidt","Scholten","Schouten","Schut","Schutte","Schuurman","Simons","Smeets","Smit","Smits","Snel","Swinkels","Tas","Terpstra","Timmermans","Tol","Tromp","Troost","Valk","Veenstra","Veldkamp","Verbeek","Verheul","Verhoeven","Vermeer","Vermeulen","Verweij","Vink","Visser","Voorn","Vos","Wagenaar","Wiersema","Willems","Willemsen","Witteveen","Wolff","Wolters","Zijlstra","Zwart","de Beer","de Boer","de Bruijn","de Bruin","de Graaf","de Groot","de Haan","de Haas","de Jager","de Jong","de Jonge","de Koning","de Lange","de Leeuw","de Ridder","de Rooij","de Ruiter","de Vos","de Vries","de Waal","de Wit","de Zwart","van Beek","van Boven","van Dam","van Dijk","van Dongen","van Doorn","van Egmond","van Eijk","van Es","van Gelder","van Gelderen","van Houten","van Hulst","van Kempen","van Kesteren","van Leeuwen","van Loon","van Mill","van Noord","van Ommen","van Ommeren","van Oosten","van Oostveen","van Rijn","van Schaik","van Veen","van Vliet","van Wijk","van Wijngaarden","van den Poel","van de Pol","van den Ploeg","van de Ven","van den Berg","van den Bosch","van den Brink","van den Broek","van den Heuvel","van der Heijden","van der Horst","van der Hulst","van der Kroon","van der Laan","van der Linden","van der Meer","van der Meij","van der Meulen","van der Molen","van der Sluis","van der Spek","van der Veen","van der Velde","van der Velden","van der Vliet","van der Wal"],uk:["Smith","Jones","Williams","Taylor","Brown","Davies","Evans","Wilson","Thomas","Johnson","Roberts","Robinson","Thompson","Wright","Walker","White","Edwards","Hughes","Green","Hall","Lewis","Harris","Clarke","Patel","Jackson","Wood","Turner","Martin","Cooper","Hill","Ward","Morris","Moore","Clark","Lee","King","Baker","Harrison","Morgan","Allen","James","Scott","Phillips","Watson","Davis","Parker","Price","Bennett","Young","Griffiths","Mitchell","Kelly","Cook","Carter","Richardson","Bailey","Collins","Bell","Shaw","Murphy","Miller","Cox","Richards","Khan","Marshall","Anderson","Simpson","Ellis","Adams","Singh","Begum","Wilkinson","Foster","Chapman","Powell","Webb","Rogers","Gray","Mason","Ali","Hunt","Hussain","Campbell","Matthews","Owen","Palmer","Holmes","Mills","Barnes","Knight","Lloyd","Butler","Russell","Barker","Fisher","Stevens","Jenkins","Murray","Dixon","Harvey","Graham","Pearson","Ahmed","Fletcher","Walsh","Kaur","Gibson","Howard","Andrews","Stewart","Elliott","Reynolds","Saunders","Payne","Fox","Ford","Pearce","Day","Brooks","West","Lawrence","Cole","Atkinson","Bradley","Spencer","Gill","Dawson","Ball","Burton","O'brien","Watts","Rose","Booth","Perry","Ryan","Grant","Wells","Armstrong","Francis","Rees","Hayes","Hart","Hudson","Newman","Barrett","Webster","Hunter","Gregory","Carr","Lowe","Page","Marsh","Riley","Dunn","Woods","Parsons","Berry","Stone","Reid","Holland","Hawkins","Harding","Porter","Robertson","Newton","Oliver","Reed","Kennedy","Williamson","Bird","Gardner","Shah","Dean","Lane","Cooke","Bates","Henderson","Parry","Burgess","Bishop","Walton","Burns","Nicholson","Shepherd","Ross","Cross","Long","Freeman","Warren","Nicholls","Hamilton","Byrne","Sutton","Mcdonald","Yates","Hodgson","Robson","Curtis","Hopkins","O'connor","Harper","Coleman","Watkins","Moss","Mccarthy","Chambers","O'neill","Griffin","Sharp","Hardy","Wheeler","Potter","Osborne","Johnston","Gordon","Doyle","Wallace","George","Jordan","Hutchinson","Rowe","Burke","May","Pritchard","Gilbert","Willis","Higgins","Read","Miles","Stevenson","Stephenson","Hammond","Arnold","Buckley","Walters","Hewitt","Barber","Nelson","Slater","Austin","Sullivan","Whitehead","Mann","Frost","Lambert","Stephens","Blake","Akhtar","Lynch","Goodwin","Barton","Woodward","Thomson","Cunningham","Quinn","Barnett","Baxter","Bibi","Clayton","Nash","Greenwood","Jennings","Holt","Kemp","Poole","Gallagher","Bond","Stokes","Tucker","Davidson","Fowler","Heath","Norman","Middleton","Lawson","Banks","French","Stanley","Jarvis","Gibbs","Ferguson","Hayward","Carroll","Douglas","Dickinson","Todd","Barlow","Peters","Lucas","Knowles","Hartley","Miah","Simmons","Morton","Alexander","Field","Morrison","Norris","Townsend","Preston","Hancock","Thornton","Baldwin","Burrows","Briggs","Parkinson","Reeves","Macdonald","Lamb","Black","Abbott","Sanders","Thorpe","Holden","Tomlinson","Perkins","Ashton","Rhodes","Fuller","Howe","Bryant","Vaughan","Dale","Davey","Weston","Bartlett","Whittaker","Davison","Kent","Skinner","Birch","Morley","Daniels","Glover","Howell","Cartwright","Pugh","Humphreys","Goddard","Brennan","Wall","Kirby","Bowen","Savage","Bull","Wong","Dobson","Smart","Wilkins","Kirk","Fraser","Duffy","Hicks","Patterson","Bradshaw","Little","Archer","Warner","Waters","O'sullivan","Farrell","Brookes","Atkins","Kay","Dodd","Bentley","Flynn","John","Schofield","Short","Haynes","Wade","Butcher","Henry","Sanderson","Crawford","Sheppard","Bolton","Coates","Giles","Gould","Houghton","Gibbons","Pratt","Manning","Law","Hooper","Noble","Dyer","Rahman","Clements","Moran","Sykes","Chan","Doherty","Connolly","Joyce","Franklin","Hobbs","Coles","Herbert","Steele","Kerr","Leach","Winter","Owens","Duncan","Naylor","Fleming","Horton","Finch","Fitzgerald","Randall","Carpenter","Marsden","Browne","Garner","Pickering","Hale","Dennis","Vincent","Chadwick","Chandler","Sharpe","Nolan","Lyons","Hurst","Collier","Peacock","Howarth","Faulkner","Rice","Pollard","Welch","Norton","Gough","Sinclair","Blackburn","Bryan","Conway","Power","Cameron","Daly","Allan","Hanson","Gardiner","Boyle","Myers","Turnbull","Wallis","Mahmood","Sims","Swift","Iqbal","Pope","Brady","Chamberlain","Rowley","Tyler","Farmer","Metcalfe","Hilton","Godfrey","Holloway","Parkin","Bray","Talbot","Donnelly","Nixon","Charlton","Benson","Whitehouse","Barry","Hope","Lord","North","Storey","Connor","Potts","Bevan","Hargreaves","Mclean","Mistry","Bruce","Howells","Hyde","Parkes","Wyatt","Fry","Lees","O'donnell","Craig","Forster","Mckenzie","Humphries","Mellor","Carey","Ingram","Summers","Leonard"],de:["Müller","Schmidt","Schneider","Fischer","Weber","Meyer","Wagner","Becker","Schulz","Hoffmann","Schäfer","Koch","Bauer","Richter","Klein","Wolf","Schröder","Neumann","Schwarz","Zimmermann","Braun","Krüger","Hofmann","Hartmann","Lange","Schmitt","Werner","Schmitz","Krause","Meier","Lehmann","Schmid","Schulze","Maier","Köhler","Herrmann","König","Walter","Mayer","Huber","Kaiser","Fuchs","Peters","Lang","Scholz","Möller","Weiß","Jung","Hahn","Schubert","Vogel","Friedrich","Keller","Günther","Frank","Berger","Winkler","Roth","Beck","Lorenz","Baumann","Franke","Albrecht","Schuster","Simon","Ludwig","Böhm","Winter","Kraus","Martin","Schumacher","Krämer","Vogt","Stein","Jäger","Otto","Sommer","Groß","Seidel","Heinrich","Brandt","Haas","Schreiber","Graf","Schulte","Dietrich","Ziegler","Kuhn","Kühn","Pohl","Engel","Horn","Busch","Bergmann","Thomas","Voigt","Sauer","Arnold","Wolff","Pfeiffer"],jp:["Sato","Suzuki","Takahashi","Tanaka","Watanabe","Ito","Yamamoto","Nakamura","Kobayashi","Kato","Yoshida","Yamada","Sasaki","Yamaguchi","Saito","Matsumoto","Inoue","Kimura","Hayashi","Shimizu","Yamazaki","Mori","Abe","Ikeda","Hashimoto","Yamashita","Ishikawa","Nakajima","Maeda","Fujita","Ogawa","Goto","Okada","Hasegawa","Murakami","Kondo","Ishii","Saito","Sakamoto","Endo","Aoki","Fujii","Nishimura","Fukuda","Ota","Miura","Fujiwara","Okamoto","Matsuda","Nakagawa","Nakano","Harada","Ono","Tamura","Takeuchi","Kaneko","Wada","Nakayama","Ishida","Ueda","Morita","Hara","Shibata","Sakai","Kudo","Yokoyama","Miyazaki","Miyamoto","Uchida","Takagi","Ando","Taniguchi","Ohno","Maruyama","Imai","Takada","Fujimoto","Takeda","Murata","Ueno","Sugiyama","Masuda","Sugawara","Hirano","Kojima","Otsuka","Chiba","Kubo","Matsui","Iwasaki","Sakurai","Kinoshita","Noguchi","Matsuo","Nomura","Kikuchi","Sano","Onishi","Sugimoto","Arai"],es:["Garcia","Fernandez","Lopez","Martinez","Gonzalez","Rodriguez","Sanchez","Perez","Martin","Gomez","Ruiz","Diaz","Hernandez","Alvarez","Jimenez","Moreno","Munoz","Alonso","Romero","Navarro","Gutierrez","Torres","Dominguez","Gil","Vazquez","Blanco","Serrano","Ramos","Castro","Suarez","Sanz","Rubio","Ortega","Molina","Delgado","Ortiz","Morales","Ramirez","Marin","Iglesias","Santos","Castillo","Garrido","Calvo","Pena","Cruz","Cano","Nunez","Prieto","Diez","Lozano","Vidal","Pascual","Ferrer","Medina","Vega","Leon","Herrero","Vicente","Mendez","Guerrero","Fuentes","Campos","Nieto","Cortes","Caballero","Ibanez","Lorenzo","Pastor","Gimenez","Saez","Soler","Marquez","Carrasco","Herrera","Montero","Arias","Crespo","Flores","Andres","Aguilar","Hidalgo","Cabrera","Mora","Duran","Velasco","Rey","Pardo","Roman","Vila","Bravo","Merino","Moya","Soto","Izquierdo","Reyes","Redondo","Marcos","Carmona","Menendez"],fr:["Martin","Bernard","Thomas","Petit","Robert","Richard","Durand","Dubois","Moreau","Laurent","Simon","Michel","Lefèvre","Leroy","Roux","David","Bertrand","Morel","Fournier","Girard","Bonnet","Dupont","Lambert","Fontaine","Rousseau","Vincent","Müller","Lefèvre","Faure","André","Mercier","Blanc","Guérin","Boyer","Garnier","Chevalier","François","Legrand","Gauthier","Garcia","Perrin","Robin","Clément","Morin","Nicolas","Henry","Roussel","Matthieu","Gautier","Masson","Marchand","Duval","Denis","Dumont","Marie","Lemaire","Noël","Meyer","Dufour","Meunier","Brun","Blanchard","Giraud","Joly","Rivière","Lucas","Brunet","Gaillard","Barbier","Arnaud","Martínez","Gérard","Roche","Renard","Schmitt","Roy","Leroux","Colin","Vidal","Caron","Picard","Roger","Fabre","Aubert","Lemoine","Renaud","Dumas","Lacroix","Olivier","Philippe","Bourgeois","Pierre","Benoît","Rey","Leclerc","Payet","Rolland","Leclercq","Guillaume","Lecomte","López","Jean","Dupuy","Guillot","Hubert","Berger","Carpentier","Sánchez","Dupuis","Moulin","Louis","Deschamps","Huet","Vasseur","Perez","Boucher","Fleury","Royer","Klein","Jacquet","Adam","Paris","Poirier","Marty","Aubry","Guyot","Carré","Charles","Renault","Charpentier","Ménard","Maillard","Baron","Bertin","Bailly","Hervé","Schneider","Fernández","Le GallGall","Collet","Léger","Bouvier","Julien","Prévost","Millet","Perrot","Daniel","Le RouxRoux","Cousin","Germain","Breton","Besson","Langlois","Rémi","Le GoffGoff","Pelletier","Lévêque","Perrier","Leblanc","Barré","Lebrun","Marchal","Weber","Mallet","Hamon","Boulanger","Jacob","Monnier","Michaud","Rodríguez","Guichard","Gillet","Étienne","Grondin","Poulain","Tessier","Chevallier","Collin","Chauvin","Da SilvaSilva","Bouchet","Gay","Lemaître","Bénard","Maréchal","Humbert","Reynaud","Antoine","Hoarau","Perret","Barthélemy","Cordier","Pichon","Lejeune","Gilbert","Lamy","Delaunay","Pasquier","Carlier","LaporteLaporte"]},postcodeAreas:[{code:"AB"},{code:"AL"},{code:"B"},{code:"BA"},{code:"BB"},{code:"BD"},{code:"BH"},{code:"BL"},{code:"BN"},{code:"BR"},{code:"BS"},{code:"BT"},{code:"CA"},{code:"CB"},{code:"CF"},{code:"CH"},{code:"CM"},{code:"CO"},{code:"CR"},{code:"CT"},{code:"CV"},{code:"CW"},{code:"DA"},{code:"DD"},{code:"DE"},{code:"DG"},{code:"DH"},{code:"DL"},{code:"DN"},{code:"DT"},{code:"DY"},{code:"E"},{code:"EC"},{code:"EH"},{code:"EN"},{code:"EX"},{code:"FK"},{code:"FY"},{code:"G"},{code:"GL"},{code:"GU"},{code:"GY"},{code:"HA"},{code:"HD"},{code:"HG"},{code:"HP"},{code:"HR"},{code:"HS"},{code:"HU"},{code:"HX"},{code:"IG"},{code:"IM"},{code:"IP"},{code:"IV"},{code:"JE"},{code:"KA"},{code:"KT"},{code:"KW"},{code:"KY"},{code:"L"},{code:"LA"},{code:"LD"},{code:"LE"},{code:"LL"},{code:"LN"},{code:"LS"},{code:"LU"},{code:"M"},{code:"ME"},{code:"MK"},{code:"ML"},{code:"N"},{code:"NE"},{code:"NG"},{code:"NN"},{code:"NP"},{code:"NR"},{code:"NW"},{code:"OL"},{code:"OX"},{code:"PA"},{code:"PE"},{code:"PH"},{code:"PL"},{code:"PO"},{code:"PR"},{code:"RG"},{code:"RH"},{code:"RM"},{code:"S"},{code:"SA"},{code:"SE"},{code:"SG"},{code:"SK"},{code:"SL"},{code:"SM"},{code:"SN"},{code:"SO"},{code:"SP"},{code:"SR"},{code:"SS"},{code:"ST"},{code:"SW"},{code:"SY"},{code:"TA"},{code:"TD"},{code:"TF"},{code:"TN"},{code:"TQ"},{code:"TR"},{code:"TS"},{code:"TW"},{code:"UB"},{code:"W"},{code:"WA"},{code:"WC"},{code:"WD"},{code:"WF"},{code:"WN"},{code:"WR"},{code:"WS"},{code:"WV"},{code:"YO"},{code:"ZE"}],countries:[{name:"Afghanistan",abbreviation:"AF"},{name:"Åland Islands",abbreviation:"AX"},{name:"Albania",abbreviation:"AL"},{name:"Algeria",abbreviation:"DZ"},{name:"American Samoa",abbreviation:"AS"},{name:"Andorra",abbreviation:"AD"},{name:"Angola",abbreviation:"AO"},{name:"Anguilla",abbreviation:"AI"},{name:"Antarctica",abbreviation:"AQ"},{name:"Antigua & Barbuda",abbreviation:"AG"},{name:"Argentina",abbreviation:"AR"},{name:"Armenia",abbreviation:"AM"},{name:"Aruba",abbreviation:"AW"},{name:"Ascension Island",abbreviation:"AC"},{name:"Australia",abbreviation:"AU"},{name:"Austria",abbreviation:"AT"},{name:"Azerbaijan",abbreviation:"AZ"},{name:"Bahamas",abbreviation:"BS"},{name:"Bahrain",abbreviation:"BH"},{name:"Bangladesh",abbreviation:"BD"},{name:"Barbados",abbreviation:"BB"},{name:"Belarus",abbreviation:"BY"},{name:"Belgium",abbreviation:"BE"},{name:"Belize",abbreviation:"BZ"},{name:"Benin",abbreviation:"BJ"},{name:"Bermuda",abbreviation:"BM"},{name:"Bhutan",abbreviation:"BT"},{name:"Bolivia",abbreviation:"BO"},{name:"Bosnia & Herzegovina",abbreviation:"BA"},{name:"Botswana",abbreviation:"BW"},{name:"Brazil",abbreviation:"BR"},{name:"British Indian Ocean Territory",abbreviation:"IO"},{name:"British Virgin Islands",abbreviation:"VG"},{name:"Brunei",abbreviation:"BN"},{name:"Bulgaria",abbreviation:"BG"},{name:"Burkina Faso",abbreviation:"BF"},{name:"Burundi",abbreviation:"BI"},{name:"Cambodia",abbreviation:"KH"},{name:"Cameroon",abbreviation:"CM"},{name:"Canada",abbreviation:"CA"},{name:"Canary Islands",abbreviation:"IC"},{name:"Cape Verde",abbreviation:"CV"},{name:"Caribbean Netherlands",abbreviation:"BQ"},{name:"Cayman Islands",abbreviation:"KY"},{name:"Central African Republic",abbreviation:"CF"},{name:"Ceuta & Melilla",abbreviation:"EA"},{name:"Chad",abbreviation:"TD"},{name:"Chile",abbreviation:"CL"},{name:"China",abbreviation:"CN"},{name:"Christmas Island",abbreviation:"CX"},{name:"Cocos (Keeling) Islands",abbreviation:"CC"},{name:"Colombia",abbreviation:"CO"},{name:"Comoros",abbreviation:"KM"},{name:"Congo - Brazzaville",abbreviation:"CG"},{name:"Congo - Kinshasa",abbreviation:"CD"},{name:"Cook Islands",abbreviation:"CK"},{name:"Costa Rica",abbreviation:"CR"},{name:"Côte d'Ivoire",abbreviation:"CI"},{name:"Croatia",abbreviation:"HR"},{name:"Cuba",abbreviation:"CU"},{name:"Curaçao",abbreviation:"CW"},{name:"Cyprus",abbreviation:"CY"},{name:"Czech Republic",abbreviation:"CZ"},{name:"Denmark",abbreviation:"DK"},{name:"Diego Garcia",abbreviation:"DG"},{name:"Djibouti",abbreviation:"DJ"},{name:"Dominica",abbreviation:"DM"},{name:"Dominican Republic",abbreviation:"DO"},{name:"Ecuador",abbreviation:"EC"},{name:"Egypt",abbreviation:"EG"},{name:"El Salvador",abbreviation:"SV"},{name:"Equatorial Guinea",abbreviation:"GQ"},{name:"Eritrea",abbreviation:"ER"},{name:"Estonia",abbreviation:"EE"},{name:"Ethiopia",abbreviation:"ET"},{name:"Falkland Islands",abbreviation:"FK"},{name:"Faroe Islands",abbreviation:"FO"},{name:"Fiji",abbreviation:"FJ"},{name:"Finland",abbreviation:"FI"},{name:"France",abbreviation:"FR"},{name:"French Guiana",abbreviation:"GF"},{name:"French Polynesia",abbreviation:"PF"},{name:"French Southern Territories",abbreviation:"TF"},{name:"Gabon",abbreviation:"GA"},{name:"Gambia",abbreviation:"GM"},{name:"Georgia",abbreviation:"GE"},{name:"Germany",abbreviation:"DE"},{name:"Ghana",abbreviation:"GH"},{name:"Gibraltar",abbreviation:"GI"},{name:"Greece",abbreviation:"GR"},{name:"Greenland",abbreviation:"GL"},{name:"Grenada",abbreviation:"GD"},{name:"Guadeloupe",abbreviation:"GP"},{name:"Guam",abbreviation:"GU"},{name:"Guatemala",abbreviation:"GT"},{name:"Guernsey",abbreviation:"GG"},{name:"Guinea",abbreviation:"GN"},{name:"Guinea-Bissau",abbreviation:"GW"},{name:"Guyana",abbreviation:"GY"},{name:"Haiti",abbreviation:"HT"},{name:"Honduras",abbreviation:"HN"},{name:"Hong Kong SAR China",abbreviation:"HK"},{name:"Hungary",abbreviation:"HU"},{name:"Iceland",abbreviation:"IS"},{name:"India",abbreviation:"IN"},{name:"Indonesia",abbreviation:"ID"},{name:"Iran",abbreviation:"IR"},{name:"Iraq",abbreviation:"IQ"},{name:"Ireland",abbreviation:"IE"},{name:"Isle of Man",abbreviation:"IM"},{name:"Israel",abbreviation:"IL"},{name:"Italy",abbreviation:"IT"},{name:"Jamaica",abbreviation:"JM"},{name:"Japan",abbreviation:"JP"},{name:"Jersey",abbreviation:"JE"},{name:"Jordan",abbreviation:"JO"},{name:"Kazakhstan",abbreviation:"KZ"},{name:"Kenya",abbreviation:"KE"},{name:"Kiribati",abbreviation:"KI"},{name:"Kosovo",abbreviation:"XK"},{name:"Kuwait",abbreviation:"KW"},{name:"Kyrgyzstan",abbreviation:"KG"},{name:"Laos",abbreviation:"LA"},{name:"Latvia",abbreviation:"LV"},{name:"Lebanon",abbreviation:"LB"},{name:"Lesotho",abbreviation:"LS"},{name:"Liberia",abbreviation:"LR"},{name:"Libya",abbreviation:"LY"},{name:"Liechtenstein",abbreviation:"LI"},{name:"Lithuania",abbreviation:"LT"},{name:"Luxembourg",abbreviation:"LU"},{name:"Macau SAR China",abbreviation:"MO"},{name:"Macedonia",abbreviation:"MK"},{name:"Madagascar",abbreviation:"MG"},{name:"Malawi",abbreviation:"MW"},{name:"Malaysia",abbreviation:"MY"},{name:"Maldives",abbreviation:"MV"},{name:"Mali",abbreviation:"ML"},{name:"Malta",abbreviation:"MT"},{name:"Marshall Islands",abbreviation:"MH"},{name:"Martinique",abbreviation:"MQ"},{name:"Mauritania",abbreviation:"MR"},{name:"Mauritius",abbreviation:"MU"},{name:"Mayotte",abbreviation:"YT"},{name:"Mexico",abbreviation:"MX"},{name:"Micronesia",abbreviation:"FM"},{name:"Moldova",abbreviation:"MD"},{name:"Monaco",abbreviation:"MC"},{name:"Mongolia",abbreviation:"MN"},{name:"Montenegro",abbreviation:"ME"},{name:"Montserrat",abbreviation:"MS"},{name:"Morocco",abbreviation:"MA"},{name:"Mozambique",abbreviation:"MZ"},{name:"Myanmar (Burma)",abbreviation:"MM"},{name:"Namibia",abbreviation:"NA"},{name:"Nauru",abbreviation:"NR"},{name:"Nepal",abbreviation:"NP"},{name:"Netherlands",abbreviation:"NL"},{name:"New Caledonia",abbreviation:"NC"},{name:"New Zealand",abbreviation:"NZ"},{name:"Nicaragua",abbreviation:"NI"},{name:"Niger",abbreviation:"NE"},{name:"Nigeria",abbreviation:"NG"},{name:"Niue",abbreviation:"NU"},{name:"Norfolk Island",abbreviation:"NF"},{name:"North Korea",abbreviation:"KP"},{name:"Northern Mariana Islands",abbreviation:"MP"},{name:"Norway",abbreviation:"NO"},{name:"Oman",abbreviation:"OM"},{name:"Pakistan",abbreviation:"PK"},{name:"Palau",abbreviation:"PW"},{name:"Palestinian Territories",abbreviation:"PS"},{name:"Panama",abbreviation:"PA"},{name:"Papua New Guinea",abbreviation:"PG"},{name:"Paraguay",abbreviation:"PY"},{name:"Peru",abbreviation:"PE"},{name:"Philippines",abbreviation:"PH"},{name:"Pitcairn Islands",abbreviation:"PN"},{name:"Poland",abbreviation:"PL"},{name:"Portugal",abbreviation:"PT"},{name:"Puerto Rico",abbreviation:"PR"},{name:"Qatar",abbreviation:"QA"},{name:"Réunion",abbreviation:"RE"},{name:"Romania",abbreviation:"RO"},{name:"Russia",abbreviation:"RU"},{name:"Rwanda",abbreviation:"RW"},{name:"Samoa",abbreviation:"WS"},{name:"San Marino",abbreviation:"SM"},{name:"São Tomé and Príncipe",abbreviation:"ST"},{name:"Saudi Arabia",abbreviation:"SA"},{name:"Senegal",abbreviation:"SN"},{name:"Serbia",abbreviation:"RS"},{name:"Seychelles",abbreviation:"SC"},{name:"Sierra Leone",abbreviation:"SL"},{name:"Singapore",abbreviation:"SG"},{name:"Sint Maarten",abbreviation:"SX"},{name:"Slovakia",abbreviation:"SK"},{name:"Slovenia",abbreviation:"SI"},{name:"Solomon Islands",abbreviation:"SB"},{name:"Somalia",abbreviation:"SO"},{name:"South Africa",abbreviation:"ZA"},{name:"South Georgia & South Sandwich Islands",abbreviation:"GS"},{name:"South Korea",abbreviation:"KR"},{name:"South Sudan",abbreviation:"SS"},{name:"Spain",abbreviation:"ES"},{name:"Sri Lanka",abbreviation:"LK"},{name:"St. Barthélemy",abbreviation:"BL"},{name:"St. Helena",abbreviation:"SH"},{name:"St. Kitts & Nevis",abbreviation:"KN"},{name:"St. Lucia",abbreviation:"LC"},{name:"St. Martin",abbreviation:"MF"},{name:"St. Pierre & Miquelon",abbreviation:"PM"},{name:"St. Vincent & Grenadines",abbreviation:"VC"},{name:"Sudan",abbreviation:"SD"},{name:"Suriname",abbreviation:"SR"},{name:"Svalbard & Jan Mayen",abbreviation:"SJ"},{name:"Swaziland",abbreviation:"SZ"},{name:"Sweden",abbreviation:"SE"},{name:"Switzerland",abbreviation:"CH"},{name:"Syria",abbreviation:"SY"},{name:"Taiwan",abbreviation:"TW"},{name:"Tajikistan",abbreviation:"TJ"},{name:"Tanzania",abbreviation:"TZ"},{name:"Thailand",abbreviation:"TH"},{name:"Timor-Leste",abbreviation:"TL"},{name:"Togo",abbreviation:"TG"},{name:"Tokelau",abbreviation:"TK"},{name:"Tonga",abbreviation:"TO"},{name:"Trinidad & Tobago",abbreviation:"TT"},{name:"Tristan da Cunha",abbreviation:"TA"},{name:"Tunisia",abbreviation:"TN"},{name:"Turkey",abbreviation:"TR"},{name:"Turkmenistan",abbreviation:"TM"},{name:"Turks & Caicos Islands",abbreviation:"TC"},{name:"Tuvalu",abbreviation:"TV"},{name:"U.S. Outlying Islands",abbreviation:"UM"},{name:"U.S. Virgin Islands",abbreviation:"VI"},{name:"Uganda",abbreviation:"UG"},{name:"Ukraine",abbreviation:"UA"},{name:"United Arab Emirates",abbreviation:"AE"},{name:"United Kingdom",abbreviation:"GB"},{name:"United States",abbreviation:"US"},{name:"Uruguay",abbreviation:"UY"},{name:"Uzbekistan",abbreviation:"UZ"},{name:"Vanuatu",abbreviation:"VU"},{name:"Vatican City",abbreviation:"VA"},{name:"Venezuela",abbreviation:"VE"},{name:"Vietnam",abbreviation:"VN"},{name:"Wallis & Futuna",abbreviation:"WF"},{name:"Western Sahara",abbreviation:"EH"},{name:"Yemen",abbreviation:"YE"},{name:"Zambia",abbreviation:"ZM"},{name:"Zimbabwe",abbreviation:"ZW"}],counties:{uk:[{name:"Bath and North East Somerset"},{name:"Aberdeenshire"},{name:"Anglesey"},{name:"Angus"},{name:"Bedford"},{name:"Blackburn with Darwen"},{name:"Blackpool"},{name:"Bournemouth"},{name:"Bracknell Forest"},{name:"Brighton & Hove"},{name:"Bristol"},{name:"Buckinghamshire"},{name:"Cambridgeshire"},{name:"Carmarthenshire"},{name:"Central Bedfordshire"},{name:"Ceredigion"},{name:"Cheshire East"},{name:"Cheshire West and Chester"},{name:"Clackmannanshire"},{name:"Conwy"},{name:"Cornwall"},{name:"County Antrim"},{name:"County Armagh"},{name:"County Down"},{name:"County Durham"},{name:"County Fermanagh"},{name:"County Londonderry"},{name:"County Tyrone"},{name:"Cumbria"},{name:"Darlington"},{name:"Denbighshire"},{name:"Derby"},{name:"Derbyshire"},{name:"Devon"},{name:"Dorset"},{name:"Dumfries and Galloway"},{name:"Dundee"},{name:"East Lothian"},{name:"East Riding of Yorkshire"},{name:"East Sussex"},{name:"Edinburgh?"},{name:"Essex"},{name:"Falkirk"},{name:"Fife"},{name:"Flintshire"},{name:"Gloucestershire"},{name:"Greater London"},{name:"Greater Manchester"},{name:"Gwent"},{name:"Gwynedd"},{name:"Halton"},{name:"Hampshire"},{name:"Hartlepool"},{name:"Herefordshire"},{name:"Hertfordshire"},{name:"Highlands"},{name:"Hull"},{name:"Isle of Wight"},{name:"Isles of Scilly"},{name:"Kent"},{name:"Lancashire"},{name:"Leicester"},{name:"Leicestershire"},{name:"Lincolnshire"},{name:"Lothian"},{name:"Luton"},{name:"Medway"},{name:"Merseyside"},{name:"Mid Glamorgan"},{name:"Middlesbrough"},{name:"Milton Keynes"},{name:"Monmouthshire"},{name:"Moray"},{name:"Norfolk"},{name:"North East Lincolnshire"},{name:"North Lincolnshire"},{name:"North Somerset"},{name:"North Yorkshire"},{name:"Northamptonshire"},{name:"Northumberland"},{name:"Nottingham"},{name:"Nottinghamshire"},{name:"Oxfordshire"},{name:"Pembrokeshire"},{name:"Perth and Kinross"},{name:"Peterborough"},{name:"Plymouth"},{name:"Poole"},{name:"Portsmouth"},{name:"Powys"},{name:"Reading"},{name:"Redcar and Cleveland"},{name:"Rutland"},{name:"Scottish Borders"},{name:"Shropshire"},{name:"Slough"},{name:"Somerset"},{name:"South Glamorgan"},{name:"South Gloucestershire"},{name:"South Yorkshire"},{name:"Southampton"},{name:"Southend-on-Sea"},{name:"Staffordshire"},{name:"Stirlingshire"},{name:"Stockton-on-Tees"},{name:"Stoke-on-Trent"},{name:"Strathclyde"},{name:"Suffolk"},{name:"Surrey"},{name:"Swindon"},{name:"Telford and Wrekin"},{name:"Thurrock"},{name:"Torbay"},{name:"Tyne and Wear"},{name:"Warrington"},{name:"Warwickshire"},{name:"West Berkshire"},{name:"West Glamorgan"},{name:"West Lothian"},{name:"West Midlands"},{name:"West Sussex"},{name:"West Yorkshire"},{name:"Western Isles"},{name:"Wiltshire"},{name:"Windsor and Maidenhead"},{name:"Wokingham"},{name:"Worcestershire"},{name:"Wrexham"},{name:"York"}]},provinces:{ca:[{name:"Alberta",abbreviation:"AB"},{name:"British Columbia",abbreviation:"BC"},{name:"Manitoba",abbreviation:"MB"},{name:"New Brunswick",abbreviation:"NB"},{name:"Newfoundland and Labrador",abbreviation:"NL"},{name:"Nova Scotia",abbreviation:"NS"},{name:"Ontario",abbreviation:"ON"},{name:"Prince Edward Island",abbreviation:"PE"},{name:"Quebec",abbreviation:"QC"},{name:"Saskatchewan",abbreviation:"SK"},{name:"Northwest Territories",abbreviation:"NT"},{name:"Nunavut",abbreviation:"NU"},{name:"Yukon",abbreviation:"YT"}],it:[{name:"Agrigento",abbreviation:"AG",code:84},{name:"Alessandria",abbreviation:"AL",code:6},{name:"Ancona",abbreviation:"AN",code:42},{name:"Aosta",abbreviation:"AO",code:7},{name:"L'Aquila",abbreviation:"AQ",code:66},{name:"Arezzo",abbreviation:"AR",code:51},{name:"Ascoli-Piceno",abbreviation:"AP",code:44},{name:"Asti",abbreviation:"AT",code:5},{name:"Avellino",abbreviation:"AV",code:64},{name:"Bari",abbreviation:"BA",code:72},{name:"Barletta-Andria-Trani",abbreviation:"BT",code:72},{name:"Belluno",abbreviation:"BL",code:25},{name:"Benevento",abbreviation:"BN",code:62},{name:"Bergamo",abbreviation:"BG",code:16},{name:"Biella",abbreviation:"BI",code:96},{name:"Bologna",abbreviation:"BO",code:37},{name:"Bolzano",abbreviation:"BZ",code:21},{name:"Brescia",abbreviation:"BS",code:17},{name:"Brindisi",abbreviation:"BR",code:74},{name:"Cagliari",abbreviation:"CA",code:92},{name:"Caltanissetta",abbreviation:"CL",code:85},{name:"Campobasso",abbreviation:"CB",code:70},{name:"Carbonia Iglesias",abbreviation:"CI",code:70},{name:"Caserta",abbreviation:"CE",code:61},{name:"Catania",abbreviation:"CT",code:87},{name:"Catanzaro",abbreviation:"CZ",code:79},{name:"Chieti",abbreviation:"CH",code:69},{name:"Como",abbreviation:"CO",code:13},{name:"Cosenza",abbreviation:"CS",code:78},{name:"Cremona",abbreviation:"CR",code:19},{name:"Crotone",abbreviation:"KR",code:101},{name:"Cuneo",abbreviation:"CN",code:4},{name:"Enna",abbreviation:"EN",code:86},{name:"Fermo",abbreviation:"FM",code:86},{name:"Ferrara",abbreviation:"FE",code:38},{name:"Firenze",abbreviation:"FI",code:48},{name:"Foggia",abbreviation:"FG",code:71},{name:"Forli-Cesena",abbreviation:"FC",code:71},{name:"Frosinone",abbreviation:"FR",code:60},{name:"Genova",abbreviation:"GE",code:10},{name:"Gorizia",abbreviation:"GO",code:31},{name:"Grosseto",abbreviation:"GR",code:53},{name:"Imperia",abbreviation:"IM",code:8},{name:"Isernia",abbreviation:"IS",code:94},{name:"La-Spezia",abbreviation:"SP",code:66},{name:"Latina",abbreviation:"LT",code:59},{name:"Lecce",abbreviation:"LE",code:75},{name:"Lecco",abbreviation:"LC",code:97},{name:"Livorno",abbreviation:"LI",code:49},{name:"Lodi",abbreviation:"LO",code:98},{name:"Lucca",abbreviation:"LU",code:46},{name:"Macerata",abbreviation:"MC",code:43},{name:"Mantova",abbreviation:"MN",code:20},{name:"Massa-Carrara",abbreviation:"MS",code:45},{name:"Matera",abbreviation:"MT",code:77},{name:"Medio Campidano",abbreviation:"VS",code:77},{name:"Messina",abbreviation:"ME",code:83},{name:"Milano",abbreviation:"MI",code:15},{name:"Modena",abbreviation:"MO",code:36},{name:"Monza-Brianza",abbreviation:"MB",code:36},{name:"Napoli",abbreviation:"NA",code:63},{name:"Novara",abbreviation:"NO",code:3},{name:"Nuoro",abbreviation:"NU",code:91},{name:"Ogliastra",abbreviation:"OG",code:91},{name:"Olbia Tempio",abbreviation:"OT",code:91},{name:"Oristano",abbreviation:"OR",code:95},{name:"Padova",abbreviation:"PD",code:28},{name:"Palermo",abbreviation:"PA",code:82},{name:"Parma",abbreviation:"PR",code:34},{name:"Pavia",abbreviation:"PV",code:18},{name:"Perugia",abbreviation:"PG",code:54},{name:"Pesaro-Urbino",abbreviation:"PU",code:41},{name:"Pescara",abbreviation:"PE",code:68},{name:"Piacenza",abbreviation:"PC",code:33},{name:"Pisa",abbreviation:"PI",code:50},{name:"Pistoia",abbreviation:"PT",code:47},{name:"Pordenone",abbreviation:"PN",code:93},{name:"Potenza",abbreviation:"PZ",code:76},{name:"Prato",abbreviation:"PO",code:100},{name:"Ragusa",abbreviation:"RG",code:88},{name:"Ravenna",abbreviation:"RA",code:39},{name:"Reggio-Calabria",abbreviation:"RC",code:35},{name:"Reggio-Emilia",abbreviation:"RE",code:35},{name:"Rieti",abbreviation:"RI",code:57},{name:"Rimini",abbreviation:"RN",code:99},{name:"Roma",abbreviation:"Roma",code:58},{name:"Rovigo",abbreviation:"RO",code:29},{name:"Salerno",abbreviation:"SA",code:65},{name:"Sassari",abbreviation:"SS",code:90},{name:"Savona",abbreviation:"SV",code:9},{name:"Siena",abbreviation:"SI",code:52},{name:"Siracusa",abbreviation:"SR",code:89},{name:"Sondrio",abbreviation:"SO",code:14},{name:"Taranto",abbreviation:"TA",code:73},{name:"Teramo",abbreviation:"TE",code:67},{name:"Terni",abbreviation:"TR",code:55},{name:"Torino",abbreviation:"TO",code:1},{name:"Trapani",abbreviation:"TP",code:81},{name:"Trento",abbreviation:"TN",code:22},{name:"Treviso",abbreviation:"TV",code:26},{name:"Trieste",abbreviation:"TS",code:32},{name:"Udine",abbreviation:"UD",code:30},{name:"Varese",abbreviation:"VA",code:12},{name:"Venezia",abbreviation:"VE",code:27},{name:"Verbania",abbreviation:"VB",code:27},{name:"Vercelli",abbreviation:"VC",code:2},{name:"Verona",abbreviation:"VR",code:23},{name:"Vibo-Valentia",abbreviation:"VV",code:102},{name:"Vicenza",abbreviation:"VI",code:24},{name:"Viterbo",abbreviation:"VT",code:56}]},nationalities:[{name:"Afghan"},{name:"Albanian"},{name:"Algerian"},{name:"American"},{name:"Andorran"},{name:"Angolan"},{name:"Antiguans"},{name:"Argentinean"},{name:"Armenian"},{name:"Australian"},{name:"Austrian"},{name:"Azerbaijani"},{name:"Bahami"},{name:"Bahraini"},{name:"Bangladeshi"},{name:"Barbadian"},{name:"Barbudans"},{name:"Batswana"},{name:"Belarusian"},{name:"Belgian"},{name:"Belizean"},{name:"Beninese"},{name:"Bhutanese"},{name:"Bolivian"},{name:"Bosnian"},{name:"Brazilian"},{name:"British"},{name:"Bruneian"},{name:"Bulgarian"},{name:"Burkinabe"},{name:"Burmese"},{name:"Burundian"},{name:"Cambodian"},{name:"Cameroonian"},{name:"Canadian"},{name:"Cape Verdean"},{name:"Central African"},{name:"Chadian"},{name:"Chilean"},{name:"Chinese"},{name:"Colombian"},{name:"Comoran"},{name:"Congolese"},{name:"Costa Rican"},{name:"Croatian"},{name:"Cuban"},{name:"Cypriot"},{name:"Czech"},{name:"Danish"},{name:"Djibouti"},{name:"Dominican"},{name:"Dutch"},{name:"East Timorese"},{name:"Ecuadorean"},{name:"Egyptian"},{name:"Emirian"},{name:"Equatorial Guinean"},{name:"Eritrean"},{name:"Estonian"},{name:"Ethiopian"},{name:"Fijian"},{name:"Filipino"},{name:"Finnish"},{name:"French"},{name:"Gabonese"},{name:"Gambian"},{name:"Georgian"},{name:"German"},{name:"Ghanaian"},{name:"Greek"},{name:"Grenadian"},{name:"Guatemalan"},{name:"Guinea-Bissauan"},{name:"Guinean"},{name:"Guyanese"},{name:"Haitian"},{name:"Herzegovinian"},{name:"Honduran"},{name:"Hungarian"},{name:"I-Kiribati"},{name:"Icelander"},{name:"Indian"},{name:"Indonesian"},{name:"Iranian"},{name:"Iraqi"},{name:"Irish"},{name:"Israeli"},{name:"Italian"},{name:"Ivorian"},{name:"Jamaican"},{name:"Japanese"},{name:"Jordanian"},{name:"Kazakhstani"},{name:"Kenyan"},{name:"Kittian and Nevisian"},{name:"Kuwaiti"},{name:"Kyrgyz"},{name:"Laotian"},{name:"Latvian"},{name:"Lebanese"},{name:"Liberian"},{name:"Libyan"},{name:"Liechtensteiner"},{name:"Lithuanian"},{name:"Luxembourger"},{name:"Macedonian"},{name:"Malagasy"},{name:"Malawian"},{name:"Malaysian"},{name:"Maldivan"},{name:"Malian"},{name:"Maltese"},{name:"Marshallese"},{name:"Mauritanian"},{name:"Mauritian"},{name:"Mexican"},{name:"Micronesian"},{name:"Moldovan"},{name:"Monacan"},{name:"Mongolian"},{name:"Moroccan"},{name:"Mosotho"},{name:"Motswana"},{name:"Mozambican"},{name:"Namibian"},{name:"Nauruan"},{name:"Nepalese"},{name:"New Zealander"},{name:"Nicaraguan"},{name:"Nigerian"},{name:"Nigerien"},{name:"North Korean"},{name:"Northern Irish"},{name:"Norwegian"},{name:"Omani"},{name:"Pakistani"},{name:"Palauan"},{name:"Panamanian"},{name:"Papua New Guinean"},{name:"Paraguayan"},{name:"Peruvian"},{name:"Polish"},{name:"Portuguese"},{name:"Qatari"},{name:"Romani"},{name:"Russian"},{name:"Rwandan"},{name:"Saint Lucian"},{name:"Salvadoran"},{name:"Samoan"},{name:"San Marinese"},{name:"Sao Tomean"},{name:"Saudi"},{name:"Scottish"},{name:"Senegalese"},{name:"Serbian"},{name:"Seychellois"},{name:"Sierra Leonean"},{name:"Singaporean"},{name:"Slovakian"},{name:"Slovenian"},{name:"Solomon Islander"},{name:"Somali"},{name:"South African"},{name:"South Korean"},{name:"Spanish"},{name:"Sri Lankan"},{name:"Sudanese"},{name:"Surinamer"},{name:"Swazi"},{name:"Swedish"},{name:"Swiss"},{name:"Syrian"},{name:"Taiwanese"},{name:"Tajik"},{name:"Tanzanian"},{name:"Thai"},{name:"Togolese"},{name:"Tongan"},{name:"Trinidadian or Tobagonian"},{name:"Tunisian"},{name:"Turkish"},{name:"Tuvaluan"},{name:"Ugandan"},{name:"Ukrainian"},{name:"Uruguaya"},{name:"Uzbekistani"},{name:"Venezuela"},{name:"Vietnamese"},{name:"Wels"},{name:"Yemenit"},{name:"Zambia"},{name:"Zimbabwe"}],locale_languages:["aa","ab","ae","af","ak","am","an","ar","as","av","ay","az","ba","be","bg","bh","bi","bm","bn","bo","br","bs","ca","ce","ch","co","cr","cs","cu","cv","cy","da","de","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fj","fo","fr","fy","ga","gd","gl","gn","gu","gv","ha","he","hi","ho","hr","ht","hu","hy","hz","ia","id","ie","ig","ii","ik","io","is","it","iu","ja","jv","ka","kg","ki","kj","kk","kl","km","kn","ko","kr","ks","ku","kv","kw","ky","la","lb","lg","li","ln","lo","lt","lu","lv","mg","mh","mi","mk","ml","mn","mr","ms","mt","my","na","nb","nd","ne","ng","nl","nn","no","nr","nv","ny","oc","oj","om","or","os","pa","pi","pl","ps","pt","qu","rm","rn","ro","ru","rw","sa","sc","sd","se","sg","si","sk","sl","sm","sn","so","sq","sr","ss","st","su","sv","sw","ta","te","tg","th","ti","tk","tl","tn","to","tr","ts","tt","tw","ty","ug","uk","ur","uz","ve","vi","vo","wa","wo","xh","yi","yo","za","zh","zu"],locale_regions:["agq-CM","asa-TZ","ast-ES","bas-CM","bem-ZM","bez-TZ","brx-IN","cgg-UG","chr-US","dav-KE","dje-NE","dsb-DE","dua-CM","dyo-SN","ebu-KE","ewo-CM","fil-PH","fur-IT","gsw-CH","gsw-FR","gsw-LI","guz-KE","haw-US","hsb-DE","jgo-CM","jmc-TZ","kab-DZ","kam-KE","kde-TZ","kea-CV","khq-ML","kkj-CM","kln-KE","kok-IN","ksb-TZ","ksf-CM","ksh-DE","lag-TZ","lkt-US","luo-KE","luy-KE","mas-KE","mas-TZ","mer-KE","mfe-MU","mgh-MZ","mgo-CM","mua-CM","naq-NA","nmg-CM","nnh-CM","nus-SD","nyn-UG","rof-TZ","rwk-TZ","sah-RU","saq-KE","sbp-TZ","seh-MZ","ses-ML","shi-Latn","shi-Latn-MA","shi-Tfng","shi-Tfng-MA","smn-FI","teo-KE","teo-UG","twq-NE","tzm-Latn","tzm-Latn-MA","vai-Latn","vai-Latn-LR","vai-Vaii","vai-Vaii-LR","vun-TZ","wae-CH","xog-UG","yav-CM","zgh-MA","af-NA","af-ZA","ak-GH","am-ET","ar-001","ar-AE","ar-BH","ar-DJ","ar-DZ","ar-EG","ar-EH","ar-ER","ar-IL","ar-IQ","ar-JO","ar-KM","ar-KW","ar-LB","ar-LY","ar-MA","ar-MR","ar-OM","ar-PS","ar-QA","ar-SA","ar-SD","ar-SO","ar-SS","ar-SY","ar-TD","ar-TN","ar-YE","as-IN","az-Cyrl","az-Cyrl-AZ","az-Latn","az-Latn-AZ","be-BY","bg-BG","bm-Latn","bm-Latn-ML","bn-BD","bn-IN","bo-CN","bo-IN","br-FR","bs-Cyrl","bs-Cyrl-BA","bs-Latn","bs-Latn-BA","ca-AD","ca-ES","ca-ES-VALENCIA","ca-FR","ca-IT","cs-CZ","cy-GB","da-DK","da-GL","de-AT","de-BE","de-CH","de-DE","de-LI","de-LU","dz-BT","ee-GH","ee-TG","el-CY","el-GR","en-001","en-150","en-AG","en-AI","en-AS","en-AU","en-BB","en-BE","en-BM","en-BS","en-BW","en-BZ","en-CA","en-CC","en-CK","en-CM","en-CX","en-DG","en-DM","en-ER","en-FJ","en-FK","en-FM","en-GB","en-GD","en-GG","en-GH","en-GI","en-GM","en-GU","en-GY","en-HK","en-IE","en-IM","en-IN","en-IO","en-JE","en-JM","en-KE","en-KI","en-KN","en-KY","en-LC","en-LR","en-LS","en-MG","en-MH","en-MO","en-MP","en-MS","en-MT","en-MU","en-MW","en-MY","en-NA","en-NF","en-NG","en-NR","en-NU","en-NZ","en-PG","en-PH","en-PK","en-PN","en-PR","en-PW","en-RW","en-SB","en-SC","en-SD","en-SG","en-SH","en-SL","en-SS","en-SX","en-SZ","en-TC","en-TK","en-TO","en-TT","en-TV","en-TZ","en-UG","en-UM","en-US","en-US-POSIX","en-VC","en-VG","en-VI","en-VU","en-WS","en-ZA","en-ZM","en-ZW","eo-001","es-419","es-AR","es-BO","es-CL","es-CO","es-CR","es-CU","es-DO","es-EA","es-EC","es-ES","es-GQ","es-GT","es-HN","es-IC","es-MX","es-NI","es-PA","es-PE","es-PH","es-PR","es-PY","es-SV","es-US","es-UY","es-VE","et-EE","eu-ES","fa-AF","fa-IR","ff-CM","ff-GN","ff-MR","ff-SN","fi-FI","fo-FO","fr-BE","fr-BF","fr-BI","fr-BJ","fr-BL","fr-CA","fr-CD","fr-CF","fr-CG","fr-CH","fr-CI","fr-CM","fr-DJ","fr-DZ","fr-FR","fr-GA","fr-GF","fr-GN","fr-GP","fr-GQ","fr-HT","fr-KM","fr-LU","fr-MA","fr-MC","fr-MF","fr-MG","fr-ML","fr-MQ","fr-MR","fr-MU","fr-NC","fr-NE","fr-PF","fr-PM","fr-RE","fr-RW","fr-SC","fr-SN","fr-SY","fr-TD","fr-TG","fr-TN","fr-VU","fr-WF","fr-YT","fy-NL","ga-IE","gd-GB","gl-ES","gu-IN","gv-IM","ha-Latn","ha-Latn-GH","ha-Latn-NE","ha-Latn-NG","he-IL","hi-IN","hr-BA","hr-HR","hu-HU","hy-AM","id-ID","ig-NG","ii-CN","is-IS","it-CH","it-IT","it-SM","ja-JP","ka-GE","ki-KE","kk-Cyrl","kk-Cyrl-KZ","kl-GL","km-KH","kn-IN","ko-KP","ko-KR","ks-Arab","ks-Arab-IN","kw-GB","ky-Cyrl","ky-Cyrl-KG","lb-LU","lg-UG","ln-AO","ln-CD","ln-CF","ln-CG","lo-LA","lt-LT","lu-CD","lv-LV","mg-MG","mk-MK","ml-IN","mn-Cyrl","mn-Cyrl-MN","mr-IN","ms-Latn","ms-Latn-BN","ms-Latn-MY","ms-Latn-SG","mt-MT","my-MM","nb-NO","nb-SJ","nd-ZW","ne-IN","ne-NP","nl-AW","nl-BE","nl-BQ","nl-CW","nl-NL","nl-SR","nl-SX","nn-NO","om-ET","om-KE","or-IN","os-GE","os-RU","pa-Arab","pa-Arab-PK","pa-Guru","pa-Guru-IN","pl-PL","ps-AF","pt-AO","pt-BR","pt-CV","pt-GW","pt-MO","pt-MZ","pt-PT","pt-ST","pt-TL","qu-BO","qu-EC","qu-PE","rm-CH","rn-BI","ro-MD","ro-RO","ru-BY","ru-KG","ru-KZ","ru-MD","ru-RU","ru-UA","rw-RW","se-FI","se-NO","se-SE","sg-CF","si-LK","sk-SK","sl-SI","sn-ZW","so-DJ","so-ET","so-KE","so-SO","sq-AL","sq-MK","sq-XK","sr-Cyrl","sr-Cyrl-BA","sr-Cyrl-ME","sr-Cyrl-RS","sr-Cyrl-XK","sr-Latn","sr-Latn-BA","sr-Latn-ME","sr-Latn-RS","sr-Latn-XK","sv-AX","sv-FI","sv-SE","sw-CD","sw-KE","sw-TZ","sw-UG","ta-IN","ta-LK","ta-MY","ta-SG","te-IN","th-TH","ti-ER","ti-ET","to-TO","tr-CY","tr-TR","ug-Arab","ug-Arab-CN","uk-UA","ur-IN","ur-PK","uz-Arab","uz-Arab-AF","uz-Cyrl","uz-Cyrl-UZ","uz-Latn","uz-Latn-UZ","vi-VN","yi-001","yo-BJ","yo-NG","zh-Hans","zh-Hans-CN","zh-Hans-HK","zh-Hans-MO","zh-Hans-SG","zh-Hant","zh-Hant-HK","zh-Hant-MO","zh-Hant-TW","zu-ZA"],us_states_and_dc:[{name:"Alabama",abbreviation:"AL"},{name:"Alaska",abbreviation:"AK"},{name:"Arizona",abbreviation:"AZ"},{name:"Arkansas",abbreviation:"AR"},{name:"California",abbreviation:"CA"},{name:"Colorado",abbreviation:"CO"},{name:"Connecticut",abbreviation:"CT"},{name:"Delaware",abbreviation:"DE"},{name:"District of Columbia",abbreviation:"DC"},{name:"Florida",abbreviation:"FL"},{name:"Georgia",abbreviation:"GA"},{name:"Hawaii",abbreviation:"HI"},{name:"Idaho",abbreviation:"ID"},{name:"Illinois",abbreviation:"IL"},{name:"Indiana",abbreviation:"IN"},{name:"Iowa",abbreviation:"IA"},{name:"Kansas",abbreviation:"KS"},{name:"Kentucky",abbreviation:"KY"},{name:"Louisiana",abbreviation:"LA"},{name:"Maine",abbreviation:"ME"},{name:"Maryland",abbreviation:"MD"},{name:"Massachusetts",abbreviation:"MA"},{name:"Michigan",abbreviation:"MI"},{name:"Minnesota",abbreviation:"MN"},{name:"Mississippi",abbreviation:"MS"},{name:"Missouri",abbreviation:"MO"},{name:"Montana",abbreviation:"MT"},{name:"Nebraska",abbreviation:"NE"},{name:"Nevada",abbreviation:"NV"},{name:"New Hampshire",abbreviation:"NH"},{name:"New Jersey",abbreviation:"NJ"},{name:"New Mexico",abbreviation:"NM"},{name:"New York",abbreviation:"NY"},{name:"North Carolina",abbreviation:"NC"},{name:"North Dakota",abbreviation:"ND"},{name:"Ohio",abbreviation:"OH"},{name:"Oklahoma",abbreviation:"OK"},{name:"Oregon",abbreviation:"OR"},{name:"Pennsylvania",abbreviation:"PA"},{name:"Rhode Island",abbreviation:"RI"},{name:"South Carolina",abbreviation:"SC"},{name:"South Dakota",abbreviation:"SD"},{name:"Tennessee",abbreviation:"TN"},{name:"Texas",abbreviation:"TX"},{name:"Utah",abbreviation:"UT"},{name:"Vermont",abbreviation:"VT"},{name:"Virginia",abbreviation:"VA"},{name:"Washington",abbreviation:"WA"},{name:"West Virginia",abbreviation:"WV"},{name:"Wisconsin",abbreviation:"WI"},{name:"Wyoming",abbreviation:"WY"}],territories:[{name:"American Samoa",abbreviation:"AS"},{name:"Federated States of Micronesia",abbreviation:"FM"},{name:"Guam",abbreviation:"GU"},{name:"Marshall Islands",abbreviation:"MH"},{name:"Northern Mariana Islands",abbreviation:"MP"},{name:"Puerto Rico",abbreviation:"PR"},{name:"Virgin Islands, U.S.",abbreviation:"VI"}],armed_forces:[{name:"Armed Forces Europe",abbreviation:"AE"},{name:"Armed Forces Pacific",abbreviation:"AP"},{name:"Armed Forces the Americas",abbreviation:"AA"}],country_regions:{it:[{name:"Valle d'Aosta",abbreviation:"VDA"},{name:"Piemonte",abbreviation:"PIE"},{name:"Lombardia",abbreviation:"LOM"},{name:"Veneto",abbreviation:"VEN"},{name:"Trentino Alto Adige",abbreviation:"TAA"},{name:"Friuli Venezia Giulia",abbreviation:"FVG"},{name:"Liguria",abbreviation:"LIG"},{name:"Emilia Romagna",abbreviation:"EMR"},{name:"Toscana",abbreviation:"TOS"},{name:"Umbria",abbreviation:"UMB"},{name:"Marche",abbreviation:"MAR"},{name:"Abruzzo",abbreviation:"ABR"},{name:"Lazio",abbreviation:"LAZ"},{name:"Campania",abbreviation:"CAM"},{name:"Puglia",abbreviation:"PUG"},{name:"Basilicata",abbreviation:"BAS"},{name:"Molise",abbreviation:"MOL"},{name:"Calabria",abbreviation:"CAL"},{name:"Sicilia",abbreviation:"SIC"},{name:"Sardegna",abbreviation:"SAR"}],mx:[{name:"Aguascalientes",abbreviation:"AGU"},{name:"Baja California",abbreviation:"BCN"},{name:"Baja California Sur",abbreviation:"BCS"},{name:"Campeche",abbreviation:"CAM"},{name:"Chiapas",abbreviation:"CHP"},{name:"Chihuahua",abbreviation:"CHH"},{name:"Ciudad de México",abbreviation:"DIF"},{name:"Coahuila",abbreviation:"COA"},{name:"Colima",abbreviation:"COL"},{name:"Durango",abbreviation:"DUR"},{name:"Guanajuato",abbreviation:"GUA"},{name:"Guerrero",abbreviation:"GRO"},{name:"Hidalgo",abbreviation:"HID"},{name:"Jalisco",abbreviation:"JAL"},{name:"México",abbreviation:"MEX"},{name:"Michoacán",abbreviation:"MIC"},{name:"Morelos",abbreviation:"MOR"},{name:"Nayarit",abbreviation:"NAY"},{name:"Nuevo León",abbreviation:"NLE"},{name:"Oaxaca",abbreviation:"OAX"},{name:"Puebla",abbreviation:"PUE"},{name:"Querétaro",abbreviation:"QUE"},{name:"Quintana Roo",abbreviation:"ROO"},{name:"San Luis Potosí",abbreviation:"SLP"},{name:"Sinaloa",abbreviation:"SIN"},{name:"Sonora",abbreviation:"SON"},{name:"Tabasco",abbreviation:"TAB"},{name:"Tamaulipas",abbreviation:"TAM"},{name:"Tlaxcala",abbreviation:"TLA"},{name:"Veracruz",abbreviation:"VER"},{name:"Yucatán",abbreviation:"YUC"},{name:"Zacatecas",abbreviation:"ZAC"}]},street_suffixes:{us:[{name:"Avenue",abbreviation:"Ave"},{name:"Boulevard",abbreviation:"Blvd"},{name:"Center",abbreviation:"Ctr"},{name:"Circle",abbreviation:"Cir"},{name:"Court",abbreviation:"Ct"},{name:"Drive",abbreviation:"Dr"},{name:"Extension",abbreviation:"Ext"},{name:"Glen",abbreviation:"Gln"},{name:"Grove",abbreviation:"Grv"},{name:"Heights",abbreviation:"Hts"},{name:"Highway",abbreviation:"Hwy"},{name:"Junction",abbreviation:"Jct"},{name:"Key",abbreviation:"Key"},{name:"Lane",abbreviation:"Ln"},{name:"Loop",abbreviation:"Loop"},{name:"Manor",abbreviation:"Mnr"},{name:"Mill",abbreviation:"Mill"},{name:"Park",abbreviation:"Park"},{name:"Parkway",abbreviation:"Pkwy"},{name:"Pass",abbreviation:"Pass"},{name:"Path",abbreviation:"Path"},{name:"Pike",abbreviation:"Pike"},{name:"Place",abbreviation:"Pl"},{name:"Plaza",abbreviation:"Plz"},{name:"Point",abbreviation:"Pt"},{name:"Ridge",abbreviation:"Rdg"},{name:"River",abbreviation:"Riv"},{name:"Road",abbreviation:"Rd"},{name:"Square",abbreviation:"Sq"},{name:"Street",abbreviation:"St"},{name:"Terrace",abbreviation:"Ter"},{name:"Trail",abbreviation:"Trl"},{name:"Turnpike",abbreviation:"Tpke"},{name:"View",abbreviation:"Vw"},{name:"Way",abbreviation:"Way"}],it:[{name:"Accesso",abbreviation:"Acc."},{name:"Alzaia",abbreviation:"Alz."},{name:"Arco",abbreviation:"Arco"},{name:"Archivolto",abbreviation:"Acv."},{name:"Arena",abbreviation:"Arena"},{name:"Argine",abbreviation:"Argine"},{name:"Bacino",abbreviation:"Bacino"},{name:"Banchi",abbreviation:"Banchi"},{name:"Banchina",abbreviation:"Ban."},{name:"Bastioni",abbreviation:"Bas."},{name:"Belvedere",abbreviation:"Belv."},{name:"Borgata",abbreviation:"B.ta"},{name:"Borgo",abbreviation:"B.go"},{name:"Calata",abbreviation:"Cal."},{name:"Calle",abbreviation:"Calle"},{name:"Campiello",abbreviation:"Cam."},{name:"Campo",abbreviation:"Cam."},{name:"Canale",abbreviation:"Can."},{name:"Carraia",abbreviation:"Carr."},{name:"Cascina",abbreviation:"Cascina"},{name:"Case sparse",abbreviation:"c.s."},{name:"Cavalcavia",abbreviation:"Cv."},{name:"Circonvallazione",abbreviation:"Cv."},{name:"Complanare",abbreviation:"C.re"},{name:"Contrada",abbreviation:"C.da"},{name:"Corso",abbreviation:"C.so"},{name:"Corte",abbreviation:"C.te"},{name:"Cortile",abbreviation:"C.le"},{name:"Diramazione",abbreviation:"Dir."},{name:"Fondaco",abbreviation:"F.co"},{name:"Fondamenta",abbreviation:"F.ta"},{name:"Fondo",abbreviation:"F.do"},{name:"Frazione",abbreviation:"Fr."},{name:"Isola",abbreviation:"Is."},{name:"Largo",abbreviation:"L.go"},{name:"Litoranea",abbreviation:"Lit."},{name:"Lungolago",abbreviation:"L.go lago"},{name:"Lungo Po",abbreviation:"l.go Po"},{name:"Molo",abbreviation:"Molo"},{name:"Mura",abbreviation:"Mura"},{name:"Passaggio privato",abbreviation:"pass. priv."},{name:"Passeggiata",abbreviation:"Pass."},{name:"Piazza",abbreviation:"P.zza"},{name:"Piazzale",abbreviation:"P.le"},{name:"Ponte",abbreviation:"P.te"},{name:"Portico",abbreviation:"P.co"},{name:"Rampa",abbreviation:"Rampa"},{name:"Regione",abbreviation:"Reg."},{name:"Rione",abbreviation:"R.ne"},{name:"Rio",abbreviation:"Rio"},{name:"Ripa",abbreviation:"Ripa"},{name:"Riva",abbreviation:"Riva"},{name:"Rondò",abbreviation:"Rondò"},{name:"Rotonda",abbreviation:"Rot."},{name:"Sagrato",abbreviation:"Sagr."},{name:"Salita",abbreviation:"Sal."},{name:"Scalinata",abbreviation:"Scal."},{name:"Scalone",abbreviation:"Scal."},{name:"Slargo",abbreviation:"Sl."},{name:"Sottoportico",abbreviation:"Sott."},{name:"Strada",abbreviation:"Str."},{name:"Stradale",abbreviation:"Str.le"},{name:"Strettoia",abbreviation:"Strett."},{name:"Traversa",abbreviation:"Trav."},{name:"Via",abbreviation:"V."},{name:"Viale",abbreviation:"V.le"},{name:"Vicinale",abbreviation:"Vic.le"},{name:"Vicolo",abbreviation:"Vic."}],uk:[{name:"Avenue",abbreviation:"Ave"},{name:"Close",abbreviation:"Cl"},{name:"Court",abbreviation:"Ct"},{name:"Crescent",abbreviation:"Cr"},{name:"Drive",abbreviation:"Dr"},{name:"Garden",abbreviation:"Gdn"},{name:"Gardens",abbreviation:"Gdns"},{name:"Green",abbreviation:"Gn"},{name:"Grove",abbreviation:"Gr"},{name:"Lane",abbreviation:"Ln"},{name:"Mount",abbreviation:"Mt"},{name:"Place",abbreviation:"Pl"},{name:"Park",abbreviation:"Pk"},{name:"Ridge",abbreviation:"Rdg"},{name:"Road",abbreviation:"Rd"},{name:"Square",abbreviation:"Sq"},{name:"Street",abbreviation:"St"},{name:"Terrace",abbreviation:"Ter"},{name:"Valley",abbreviation:"Val"}]},months:[{name:"January",short_name:"Jan",numeric:"01",days:31},{name:"February",short_name:"Feb",numeric:"02",days:28},{name:"March",short_name:"Mar",numeric:"03",days:31},{name:"April",short_name:"Apr",numeric:"04",days:30},{name:"May",short_name:"May",numeric:"05",days:31},{name:"June",short_name:"Jun",numeric:"06",days:30},{name:"July",short_name:"Jul",numeric:"07",days:31},{name:"August",short_name:"Aug",numeric:"08",days:31},{name:"September",short_name:"Sep",numeric:"09",days:30},{name:"October",short_name:"Oct",numeric:"10",days:31},{name:"November",short_name:"Nov",numeric:"11",days:30},{name:"December",short_name:"Dec",numeric:"12",days:31}],cc_types:[{name:"American Express",short_name:"amex",prefix:"34",length:15},{name:"Bankcard",short_name:"bankcard",prefix:"5610",length:16},{name:"China UnionPay",short_name:"chinaunion",prefix:"62",length:16},{name:"Diners Club Carte Blanche",short_name:"dccarte",prefix:"300",length:14},{name:"Diners Club enRoute",short_name:"dcenroute",prefix:"2014",length:15},{name:"Diners Club International",short_name:"dcintl",prefix:"36",length:14},{name:"Diners Club United States & Canada",short_name:"dcusc",prefix:"54",length:16},{name:"Discover Card",short_name:"discover",prefix:"6011",length:16},{name:"InstaPayment",short_name:"instapay",prefix:"637",length:16},{name:"JCB",short_name:"jcb",prefix:"3528",length:16},{name:"Laser",short_name:"laser",prefix:"6304",length:16},{name:"Maestro",short_name:"maestro",prefix:"5018",length:16},{name:"Mastercard",short_name:"mc",prefix:"51",length:16},{name:"Solo",short_name:"solo",prefix:"6334",length:16},{name:"Switch",short_name:"switch",prefix:"4903",length:16},{name:"Visa",short_name:"visa",prefix:"4",length:16},{name:"Visa Electron",short_name:"electron",prefix:"4026",length:16}],currency_types:[{code:"AED",name:"United Arab Emirates Dirham"},{code:"AFN",name:"Afghanistan Afghani"},{code:"ALL",name:"Albania Lek"},{code:"AMD",name:"Armenia Dram"},{code:"ANG",name:"Netherlands Antilles Guilder"},{code:"AOA",name:"Angola Kwanza"},{code:"ARS",name:"Argentina Peso"},{code:"AUD",name:"Australia Dollar"},{code:"AWG",name:"Aruba Guilder"},{code:"AZN",name:"Azerbaijan New Manat"},{code:"BAM",name:"Bosnia and Herzegovina Convertible Marka"},{code:"BBD",name:"Barbados Dollar"},{code:"BDT",name:"Bangladesh Taka"},{code:"BGN",name:"Bulgaria Lev"},{code:"BHD",name:"Bahrain Dinar"},{code:"BIF",name:"Burundi Franc"},{code:"BMD",name:"Bermuda Dollar"},{code:"BND",name:"Brunei Darussalam Dollar"},{code:"BOB",name:"Bolivia Boliviano"},{code:"BRL",name:"Brazil Real"},{code:"BSD",name:"Bahamas Dollar"},{code:"BTN",name:"Bhutan Ngultrum"},{code:"BWP",name:"Botswana Pula"},{code:"BYR",name:"Belarus Ruble"},{code:"BZD",name:"Belize Dollar"},{code:"CAD",name:"Canada Dollar"},{code:"CDF",name:"Congo/Kinshasa Franc"},{code:"CHF",name:"Switzerland Franc"},{code:"CLP",name:"Chile Peso"},{code:"CNY",name:"China Yuan Renminbi"},{code:"COP",name:"Colombia Peso"},{code:"CRC",name:"Costa Rica Colon"},{code:"CUC",name:"Cuba Convertible Peso"},{code:"CUP",name:"Cuba Peso"},{code:"CVE",name:"Cape Verde Escudo"},{code:"CZK",name:"Czech Republic Koruna"},{code:"DJF",name:"Djibouti Franc"},{code:"DKK",name:"Denmark Krone"},{code:"DOP",name:"Dominican Republic Peso"},{code:"DZD",name:"Algeria Dinar"},{code:"EGP",name:"Egypt Pound"},{code:"ERN",name:"Eritrea Nakfa"},{code:"ETB",name:"Ethiopia Birr"},{code:"EUR",name:"Euro Member Countries"},{code:"FJD",name:"Fiji Dollar"},{code:"FKP",name:"Falkland Islands (Malvinas) Pound"},{code:"GBP",name:"United Kingdom Pound"},{code:"GEL",name:"Georgia Lari"},{code:"GGP",name:"Guernsey Pound"},{code:"GHS",name:"Ghana Cedi"},{code:"GIP",name:"Gibraltar Pound"},{code:"GMD",name:"Gambia Dalasi"},{code:"GNF",name:"Guinea Franc"},{code:"GTQ",name:"Guatemala Quetzal"},{code:"GYD",name:"Guyana Dollar"},{code:"HKD",name:"Hong Kong Dollar"},{code:"HNL",name:"Honduras Lempira"},{code:"HRK",name:"Croatia Kuna"},{code:"HTG",name:"Haiti Gourde"},{code:"HUF",name:"Hungary Forint"},{code:"IDR",name:"Indonesia Rupiah"},{code:"ILS",name:"Israel Shekel"},{code:"IMP",name:"Isle of Man Pound"},{code:"INR",name:"India Rupee"},{code:"IQD",name:"Iraq Dinar"},{code:"IRR",name:"Iran Rial"},{code:"ISK",name:"Iceland Krona"},{code:"JEP",name:"Jersey Pound"},{code:"JMD",name:"Jamaica Dollar"},{code:"JOD",name:"Jordan Dinar"},{code:"JPY",name:"Japan Yen"},{code:"KES",name:"Kenya Shilling"},{code:"KGS",name:"Kyrgyzstan Som"},{code:"KHR",name:"Cambodia Riel"},{code:"KMF",name:"Comoros Franc"},{code:"KPW",name:"Korea (North) Won"},{code:"KRW",name:"Korea (South) Won"},{code:"KWD",name:"Kuwait Dinar"},{code:"KYD",name:"Cayman Islands Dollar"},{code:"KZT",name:"Kazakhstan Tenge"},{code:"LAK",name:"Laos Kip"},{code:"LBP",name:"Lebanon Pound"},{code:"LKR",name:"Sri Lanka Rupee"},{code:"LRD",name:"Liberia Dollar"},{code:"LSL",name:"Lesotho Loti"},{code:"LTL",name:"Lithuania Litas"},{code:"LYD",name:"Libya Dinar"},{code:"MAD",name:"Morocco Dirham"},{code:"MDL",name:"Moldova Leu"},{code:"MGA",name:"Madagascar Ariary"},{code:"MKD",name:"Macedonia Denar"},{code:"MMK",name:"Myanmar (Burma) Kyat"},{code:"MNT",name:"Mongolia Tughrik"},{code:"MOP",name:"Macau Pataca"},{code:"MRO",name:"Mauritania Ouguiya"},{code:"MUR",name:"Mauritius Rupee"},{code:"MVR",name:"Maldives (Maldive Islands) Rufiyaa"},{code:"MWK",name:"Malawi Kwacha"},{code:"MXN",name:"Mexico Peso"},{code:"MYR",name:"Malaysia Ringgit"},{code:"MZN",name:"Mozambique Metical"},{code:"NAD",name:"Namibia Dollar"},{code:"NGN",name:"Nigeria Naira"},{code:"NIO",name:"Nicaragua Cordoba"},{code:"NOK",name:"Norway Krone"},{code:"NPR",name:"Nepal Rupee"},{code:"NZD",name:"New Zealand Dollar"},{code:"OMR",name:"Oman Rial"},{code:"PAB",name:"Panama Balboa"},{code:"PEN",name:"Peru Nuevo Sol"},{code:"PGK",name:"Papua New Guinea Kina"},{code:"PHP",name:"Philippines Peso"},{code:"PKR",name:"Pakistan Rupee"},{code:"PLN",name:"Poland Zloty"},{code:"PYG",name:"Paraguay Guarani"},{code:"QAR",name:"Qatar Riyal"},{code:"RON",name:"Romania New Leu"},{code:"RSD",name:"Serbia Dinar"},{code:"RUB",name:"Russia Ruble"},{code:"RWF",name:"Rwanda Franc"},{code:"SAR",name:"Saudi Arabia Riyal"},{code:"SBD",name:"Solomon Islands Dollar"},{code:"SCR",name:"Seychelles Rupee"},{code:"SDG",name:"Sudan Pound"},{code:"SEK",name:"Sweden Krona"},{code:"SGD",name:"Singapore Dollar"},{code:"SHP",name:"Saint Helena Pound"},{code:"SLL",name:"Sierra Leone Leone"},{code:"SOS",name:"Somalia Shilling"},{code:"SPL",name:"Seborga Luigino"},{code:"SRD",name:"Suriname Dollar"},{code:"STD",name:"São Tomé and Príncipe Dobra"},{code:"SVC",name:"El Salvador Colon"},{code:"SYP",name:"Syria Pound"},{code:"SZL",name:"Swaziland Lilangeni"},{code:"THB",name:"Thailand Baht"},{code:"TJS",name:"Tajikistan Somoni"},{code:"TMT",name:"Turkmenistan Manat"},{code:"TND",name:"Tunisia Dinar"},{code:"TOP",name:"Tonga Pa'anga"},{code:"TRY",name:"Turkey Lira"},{code:"TTD",name:"Trinidad and Tobago Dollar"},{code:"TVD",name:"Tuvalu Dollar"},{code:"TWD",name:"Taiwan New Dollar"},{code:"TZS",name:"Tanzania Shilling"},{code:"UAH",name:"Ukraine Hryvnia"},{code:"UGX",name:"Uganda Shilling"},{code:"USD",name:"United States Dollar"},{code:"UYU",name:"Uruguay Peso"},{code:"UZS",name:"Uzbekistan Som"},{code:"VEF",name:"Venezuela Bolivar"},{code:"VND",name:"Viet Nam Dong"},{code:"VUV",name:"Vanuatu Vatu"},{code:"WST",name:"Samoa Tala"},{code:"XAF",name:"Communauté Financière Africaine (BEAC) CFA Franc BEAC"},{code:"XCD",name:"East Caribbean Dollar"},{code:"XDR",name:"International Monetary Fund (IMF) Special Drawing Rights"},{code:"XOF",name:"Communauté Financière Africaine (BCEAO) Franc"},{code:"XPF",name:"Comptoirs Français du Pacifique (CFP) Franc"},{code:"YER",name:"Yemen Rial"},{code:"ZAR",name:"South Africa Rand"},{code:"ZMW",name:"Zambia Kwacha"},{code:"ZWD",name:"Zimbabwe Dollar"}],colorNames:["AliceBlue","Black","Navy","DarkBlue","MediumBlue","Blue","DarkGreen","Green","Teal","DarkCyan","DeepSkyBlue","DarkTurquoise","MediumSpringGreen","Lime","SpringGreen","Aqua","Cyan","MidnightBlue","DodgerBlue","LightSeaGreen","ForestGreen","SeaGreen","DarkSlateGray","LimeGreen","MediumSeaGreen","Turquoise","RoyalBlue","SteelBlue","DarkSlateBlue","MediumTurquoise","Indigo","DarkOliveGreen","CadetBlue","CornflowerBlue","RebeccaPurple","MediumAquaMarine","DimGray","SlateBlue","OliveDrab","SlateGray","LightSlateGray","MediumSlateBlue","LawnGreen","Chartreuse","Aquamarine","Maroon","Purple","Olive","Gray","SkyBlue","LightSkyBlue","BlueViolet","DarkRed","DarkMagenta","SaddleBrown","Ivory","White","DarkSeaGreen","LightGreen","MediumPurple","DarkViolet","PaleGreen","DarkOrchid","YellowGreen","Sienna","Brown","DarkGray","LightBlue","GreenYellow","PaleTurquoise","LightSteelBlue","PowderBlue","FireBrick","DarkGoldenRod","MediumOrchid","RosyBrown","DarkKhaki","Silver","MediumVioletRed","IndianRed","Peru","Chocolate","Tan","LightGray","Thistle","Orchid","GoldenRod","PaleVioletRed","Crimson","Gainsboro","Plum","BurlyWood","LightCyan","Lavender","DarkSalmon","Violet","PaleGoldenRod","LightCoral","Khaki","AliceBlue","HoneyDew","Azure","SandyBrown","Wheat","Beige","WhiteSmoke","MintCream","GhostWhite","Salmon","AntiqueWhite","Linen","LightGoldenRodYellow","OldLace","Red","Fuchsia","Magenta","DeepPink","OrangeRed","Tomato","HotPink","Coral","DarkOrange","LightSalmon","Orange","LightPink","Pink","Gold","PeachPuff","NavajoWhite","Moccasin","Bisque","MistyRose","BlanchedAlmond","PapayaWhip","LavenderBlush","SeaShell","Cornsilk","LemonChiffon","FloralWhite","Snow","Yellow","LightYellow"],company:["3Com Corp","3M Company","A.G. Edwards Inc.","Abbott Laboratories","Abercrombie & Fitch Co.","ABM Industries Incorporated","Ace Hardware Corporation","ACT Manufacturing Inc.","Acterna Corp.","Adams Resources & Energy, Inc.","ADC Telecommunications, Inc.","Adelphia Communications Corporation","Administaff, Inc.","Adobe Systems Incorporated","Adolph Coors Company","Advance Auto Parts, Inc.","Advanced Micro Devices, Inc.","AdvancePCS, Inc.","Advantica Restaurant Group, Inc.","The AES Corporation","Aetna Inc.","Affiliated Computer Services, Inc.","AFLAC Incorporated","AGCO Corporation","Agilent Technologies, Inc.","Agway Inc.","Apartment Investment and Management Company","Air Products and Chemicals, Inc.","Airborne, Inc.","Airgas, Inc.","AK Steel Holding Corporation","Alaska Air Group, Inc.","Alberto-Culver Company","Albertson's, Inc.","Alcoa Inc.","Alleghany Corporation","Allegheny Energy, Inc.","Allegheny Technologies Incorporated","Allergan, Inc.","ALLETE, Inc.","Alliant Energy Corporation","Allied Waste Industries, Inc.","Allmerica Financial Corporation","The Allstate Corporation","ALLTEL Corporation","The Alpine Group, Inc.","Amazon.com, Inc.","AMC Entertainment Inc.","American Power Conversion Corporation","Amerada Hess Corporation","AMERCO","Ameren Corporation","America West Holdings Corporation","American Axle & Manufacturing Holdings, Inc.","American Eagle Outfitters, Inc.","American Electric Power Company, Inc.","American Express Company","American Financial Group, Inc.","American Greetings Corporation","American International Group, Inc.","American Standard Companies Inc.","American Water Works Company, Inc.","AmerisourceBergen Corporation","Ames Department Stores, Inc.","Amgen Inc.","Amkor Technology, Inc.","AMR Corporation","AmSouth Bancorp.","Amtran, Inc.","Anadarko Petroleum Corporation","Analog Devices, Inc.","Anheuser-Busch Companies, Inc.","Anixter International Inc.","AnnTaylor Inc.","Anthem, Inc.","AOL Time Warner Inc.","Aon Corporation","Apache Corporation","Apple Computer, Inc.","Applera Corporation","Applied Industrial Technologies, Inc.","Applied Materials, Inc.","Aquila, Inc.","ARAMARK Corporation","Arch Coal, Inc.","Archer Daniels Midland Company","Arkansas Best Corporation","Armstrong Holdings, Inc.","Arrow Electronics, Inc.","ArvinMeritor, Inc.","Ashland Inc.","Astoria Financial Corporation","AT&T Corp.","Atmel Corporation","Atmos Energy Corporation","Audiovox Corporation","Autoliv, Inc.","Automatic Data Processing, Inc.","AutoNation, Inc.","AutoZone, Inc.","Avaya Inc.","Avery Dennison Corporation","Avista Corporation","Avnet, Inc.","Avon Products, Inc.","Baker Hughes Incorporated","Ball Corporation","Bank of America Corporation","The Bank of New York Company, Inc.","Bank One Corporation","Banknorth Group, Inc.","Banta Corporation","Barnes & Noble, Inc.","Bausch & Lomb Incorporated","Baxter International Inc.","BB&T Corporation","The Bear Stearns Companies Inc.","Beazer Homes USA, Inc.","Beckman Coulter, Inc.","Becton, Dickinson and Company","Bed Bath & Beyond Inc.","Belk, Inc.","Bell Microproducts Inc.","BellSouth Corporation","Belo Corp.","Bemis Company, Inc.","Benchmark Electronics, Inc.","Berkshire Hathaway Inc.","Best Buy Co., Inc.","Bethlehem Steel Corporation","Beverly Enterprises, Inc.","Big Lots, Inc.","BJ Services Company","BJ's Wholesale Club, Inc.","The Black & Decker Corporation","Black Hills Corporation","BMC Software, Inc.","The Boeing Company","Boise Cascade Corporation","Borders Group, Inc.","BorgWarner Inc.","Boston Scientific Corporation","Bowater Incorporated","Briggs & Stratton Corporation","Brightpoint, Inc.","Brinker International, Inc.","Bristol-Myers Squibb Company","Broadwing, Inc.","Brown Shoe Company, Inc.","Brown-Forman Corporation","Brunswick Corporation","Budget Group, Inc.","Burlington Coat Factory Warehouse Corporation","Burlington Industries, Inc.","Burlington Northern Santa Fe Corporation","Burlington Resources Inc.","C. H. Robinson Worldwide Inc.","Cablevision Systems Corp","Cabot Corp","Cadence Design Systems, Inc.","Calpine Corp.","Campbell Soup Co.","Capital One Financial Corp.","Cardinal Health Inc.","Caremark Rx Inc.","Carlisle Cos. Inc.","Carpenter Technology Corp.","Casey's General Stores Inc.","Caterpillar Inc.","CBRL Group Inc.","CDI Corp.","CDW Computer Centers Inc.","CellStar Corp.","Cendant Corp","Cenex Harvest States Cooperatives","Centex Corp.","CenturyTel Inc.","Ceridian Corp.","CH2M Hill Cos. Ltd.","Champion Enterprises Inc.","Charles Schwab Corp.","Charming Shoppes Inc.","Charter Communications Inc.","Charter One Financial Inc.","ChevronTexaco Corp.","Chiquita Brands International Inc.","Chubb Corp","Ciena Corp.","Cigna Corp","Cincinnati Financial Corp.","Cinergy Corp.","Cintas Corp.","Circuit City Stores Inc.","Cisco Systems Inc.","Citigroup, Inc","Citizens Communications Co.","CKE Restaurants Inc.","Clear Channel Communications Inc.","The Clorox Co.","CMGI Inc.","CMS Energy Corp.","CNF Inc.","Coca-Cola Co.","Coca-Cola Enterprises Inc.","Colgate-Palmolive Co.","Collins & Aikman Corp.","Comcast Corp.","Comdisco Inc.","Comerica Inc.","Comfort Systems USA Inc.","Commercial Metals Co.","Community Health Systems Inc.","Compass Bancshares Inc","Computer Associates International Inc.","Computer Sciences Corp.","Compuware Corp.","Comverse Technology Inc.","ConAgra Foods Inc.","Concord EFS Inc.","Conectiv, Inc","Conoco Inc","Conseco Inc.","Consolidated Freightways Corp.","Consolidated Edison Inc.","Constellation Brands Inc.","Constellation Emergy Group Inc.","Continental Airlines Inc.","Convergys Corp.","Cooper Cameron Corp.","Cooper Industries Ltd.","Cooper Tire & Rubber Co.","Corn Products International Inc.","Corning Inc.","Costco Wholesale Corp.","Countrywide Credit Industries Inc.","Coventry Health Care Inc.","Cox Communications Inc.","Crane Co.","Crompton Corp.","Crown Cork & Seal Co. Inc.","CSK Auto Corp.","CSX Corp.","Cummins Inc.","CVS Corp.","Cytec Industries Inc.","D&K Healthcare Resources, Inc.","D.R. Horton Inc.","Dana Corporation","Danaher Corporation","Darden Restaurants Inc.","DaVita Inc.","Dean Foods Company","Deere & Company","Del Monte Foods Co","Dell Computer Corporation","Delphi Corp.","Delta Air Lines Inc.","Deluxe Corporation","Devon Energy Corporation","Di Giorgio Corporation","Dial Corporation","Diebold Incorporated","Dillard's Inc.","DIMON Incorporated","Dole Food Company, Inc.","Dollar General Corporation","Dollar Tree Stores, Inc.","Dominion Resources, Inc.","Domino's Pizza LLC","Dover Corporation, Inc.","Dow Chemical Company","Dow Jones & Company, Inc.","DPL Inc.","DQE Inc.","Dreyer's Grand Ice Cream, Inc.","DST Systems, Inc.","DTE Energy Co.","E.I. Du Pont de Nemours and Company","Duke Energy Corp","Dun & Bradstreet Inc.","DURA Automotive Systems Inc.","DynCorp","Dynegy Inc.","E*Trade Group, Inc.","E.W. Scripps Company","Earthlink, Inc.","Eastman Chemical Company","Eastman Kodak Company","Eaton Corporation","Echostar Communications Corporation","Ecolab Inc.","Edison International","EGL Inc.","El Paso Corporation","Electronic Arts Inc.","Electronic Data Systems Corp.","Eli Lilly and Company","EMC Corporation","Emcor Group Inc.","Emerson Electric Co.","Encompass Services Corporation","Energizer Holdings Inc.","Energy East Corporation","Engelhard Corporation","Enron Corp.","Entergy Corporation","Enterprise Products Partners L.P.","EOG Resources, Inc.","Equifax Inc.","Equitable Resources Inc.","Equity Office Properties Trust","Equity Residential Properties Trust","Estee Lauder Companies Inc.","Exelon Corporation","Exide Technologies","Expeditors International of Washington Inc.","Express Scripts Inc.","ExxonMobil Corporation","Fairchild Semiconductor International Inc.","Family Dollar Stores Inc.","Farmland Industries Inc.","Federal Mogul Corp.","Federated Department Stores Inc.","Federal Express Corp.","Felcor Lodging Trust Inc.","Ferro Corp.","Fidelity National Financial Inc.","Fifth Third Bancorp","First American Financial Corp.","First Data Corp.","First National of Nebraska Inc.","First Tennessee National Corp.","FirstEnergy Corp.","Fiserv Inc.","Fisher Scientific International Inc.","FleetBoston Financial Co.","Fleetwood Enterprises Inc.","Fleming Companies Inc.","Flowers Foods Inc.","Flowserv Corp","Fluor Corp","FMC Corp","Foamex International Inc","Foot Locker Inc","Footstar Inc.","Ford Motor Co","Forest Laboratories Inc.","Fortune Brands Inc.","Foster Wheeler Ltd.","FPL Group Inc.","Franklin Resources Inc.","Freeport McMoran Copper & Gold Inc.","Frontier Oil Corp","Furniture Brands International Inc.","Gannett Co., Inc.","Gap Inc.","Gateway Inc.","GATX Corporation","Gemstar-TV Guide International Inc.","GenCorp Inc.","General Cable Corporation","General Dynamics Corporation","General Electric Company","General Mills Inc","General Motors Corporation","Genesis Health Ventures Inc.","Gentek Inc.","Gentiva Health Services Inc.","Genuine Parts Company","Genuity Inc.","Genzyme Corporation","Georgia Gulf Corporation","Georgia-Pacific Corporation","Gillette Company","Gold Kist Inc.","Golden State Bancorp Inc.","Golden West Financial Corporation","Goldman Sachs Group Inc.","Goodrich Corporation","The Goodyear Tire & Rubber Company","Granite Construction Incorporated","Graybar Electric Company Inc.","Great Lakes Chemical Corporation","Great Plains Energy Inc.","GreenPoint Financial Corp.","Greif Bros. Corporation","Grey Global Group Inc.","Group 1 Automotive Inc.","Guidant Corporation","H&R Block Inc.","H.B. Fuller Company","H.J. Heinz Company","Halliburton Co.","Harley-Davidson Inc.","Harman International Industries Inc.","Harrah's Entertainment Inc.","Harris Corp.","Harsco Corp.","Hartford Financial Services Group Inc.","Hasbro Inc.","Hawaiian Electric Industries Inc.","HCA Inc.","Health Management Associates Inc.","Health Net Inc.","Healthsouth Corp","Henry Schein Inc.","Hercules Inc.","Herman Miller Inc.","Hershey Foods Corp.","Hewlett-Packard Company","Hibernia Corp.","Hillenbrand Industries Inc.","Hilton Hotels Corp.","Hollywood Entertainment Corp.","Home Depot Inc.","Hon Industries Inc.","Honeywell International Inc.","Hormel Foods Corp.","Host Marriott Corp.","Household International Corp.","Hovnanian Enterprises Inc.","Hub Group Inc.","Hubbell Inc.","Hughes Supply Inc.","Humana Inc.","Huntington Bancshares Inc.","Idacorp Inc.","IDT Corporation","IKON Office Solutions Inc.","Illinois Tool Works Inc.","IMC Global Inc.","Imperial Sugar Company","IMS Health Inc.","Ingles Market Inc","Ingram Micro Inc.","Insight Enterprises Inc.","Integrated Electrical Services Inc.","Intel Corporation","International Paper Co.","Interpublic Group of Companies Inc.","Interstate Bakeries Corporation","International Business Machines Corp.","International Flavors & Fragrances Inc.","International Multifoods Corporation","Intuit Inc.","IT Group Inc.","ITT Industries Inc.","Ivax Corp.","J.B. Hunt Transport Services Inc.","J.C. Penny Co.","J.P. Morgan Chase & Co.","Jabil Circuit Inc.","Jack In The Box Inc.","Jacobs Engineering Group Inc.","JDS Uniphase Corp.","Jefferson-Pilot Co.","John Hancock Financial Services Inc.","Johnson & Johnson","Johnson Controls Inc.","Jones Apparel Group Inc.","KB Home","Kellogg Company","Kellwood Company","Kelly Services Inc.","Kemet Corp.","Kennametal Inc.","Kerr-McGee Corporation","KeyCorp","KeySpan Corp.","Kimball International Inc.","Kimberly-Clark Corporation","Kindred Healthcare Inc.","KLA-Tencor Corporation","K-Mart Corp.","Knight-Ridder Inc.","Kohl's Corp.","KPMG Consulting Inc.","Kroger Co.","L-3 Communications Holdings Inc.","Laboratory Corporation of America Holdings","Lam Research Corporation","LandAmerica Financial Group Inc.","Lands' End Inc.","Landstar System Inc.","La-Z-Boy Inc.","Lear Corporation","Legg Mason Inc.","Leggett & Platt Inc.","Lehman Brothers Holdings Inc.","Lennar Corporation","Lennox International Inc.","Level 3 Communications Inc.","Levi Strauss & Co.","Lexmark International Inc.","Limited Inc.","Lincoln National Corporation","Linens 'n Things Inc.","Lithia Motors Inc.","Liz Claiborne Inc.","Lockheed Martin Corporation","Loews Corporation","Longs Drug Stores Corporation","Louisiana-Pacific Corporation","Lowe's Companies Inc.","LSI Logic Corporation","The LTV Corporation","The Lubrizol Corporation","Lucent Technologies Inc.","Lyondell Chemical Company","M & T Bank Corporation","Magellan Health Services Inc.","Mail-Well Inc.","Mandalay Resort Group","Manor Care Inc.","Manpower Inc.","Marathon Oil Corporation","Mariner Health Care Inc.","Markel Corporation","Marriott International Inc.","Marsh & McLennan Companies Inc.","Marsh Supermarkets Inc.","Marshall & Ilsley Corporation","Martin Marietta Materials Inc.","Masco Corporation","Massey Energy Company","MasTec Inc.","Mattel Inc.","Maxim Integrated Products Inc.","Maxtor Corporation","Maxxam Inc.","The May Department Stores Company","Maytag Corporation","MBNA Corporation","McCormick & Company Incorporated","McDonald's Corporation","The McGraw-Hill Companies Inc.","McKesson Corporation","McLeodUSA Incorporated","M.D.C. Holdings Inc.","MDU Resources Group Inc.","MeadWestvaco Corporation","Medtronic Inc.","Mellon Financial Corporation","The Men's Wearhouse Inc.","Merck & Co., Inc.","Mercury General Corporation","Merrill Lynch & Co. Inc.","Metaldyne Corporation","Metals USA Inc.","MetLife Inc.","Metris Companies Inc","MGIC Investment Corporation","MGM Mirage","Michaels Stores Inc.","Micron Technology Inc.","Microsoft Corporation","Milacron Inc.","Millennium Chemicals Inc.","Mirant Corporation","Mohawk Industries Inc.","Molex Incorporated","The MONY Group Inc.","Morgan Stanley Dean Witter & Co.","Motorola Inc.","MPS Group Inc.","Murphy Oil Corporation","Nabors Industries Inc","Nacco Industries Inc","Nash Finch Company","National City Corp.","National Commerce Financial Corporation","National Fuel Gas Company","National Oilwell Inc","National Rural Utilities Cooperative Finance Corporation","National Semiconductor Corporation","National Service Industries Inc","Navistar International Corporation","NCR Corporation","The Neiman Marcus Group Inc.","New Jersey Resources Corporation","New York Times Company","Newell Rubbermaid Inc","Newmont Mining Corporation","Nextel Communications Inc","Nicor Inc","Nike Inc","NiSource Inc","Noble Energy Inc","Nordstrom Inc","Norfolk Southern Corporation","Nortek Inc","North Fork Bancorporation Inc","Northeast Utilities System","Northern Trust Corporation","Northrop Grumman Corporation","NorthWestern Corporation","Novellus Systems Inc","NSTAR","NTL Incorporated","Nucor Corp","Nvidia Corp","NVR Inc","Northwest Airlines Corp","Occidental Petroleum Corp","Ocean Energy Inc","Office Depot Inc.","OfficeMax Inc","OGE Energy Corp","Oglethorpe Power Corp.","Ohio Casualty Corp.","Old Republic International Corp.","Olin Corp.","OM Group Inc","Omnicare Inc","Omnicom Group","On Semiconductor Corp","ONEOK Inc","Oracle Corp","Oshkosh Truck Corp","Outback Steakhouse Inc.","Owens & Minor Inc.","Owens Corning","Owens-Illinois Inc","Oxford Health Plans Inc","Paccar Inc","PacifiCare Health Systems Inc","Packaging Corp. of America","Pactiv Corp","Pall Corp","Pantry Inc","Park Place Entertainment Corp","Parker Hannifin Corp.","Pathmark Stores Inc.","Paychex Inc","Payless Shoesource Inc","Penn Traffic Co.","Pennzoil-Quaker State Company","Pentair Inc","Peoples Energy Corp.","PeopleSoft Inc","Pep Boys Manny, Moe & Jack","Potomac Electric Power Co.","Pepsi Bottling Group Inc.","PepsiAmericas Inc.","PepsiCo Inc.","Performance Food Group Co.","Perini Corp","PerkinElmer Inc","Perot Systems Corp","Petco Animal Supplies Inc.","Peter Kiewit Sons', Inc.","PETsMART Inc","Pfizer Inc","Pacific Gas & Electric Corp.","Pharmacia Corp","Phar Mor Inc.","Phelps Dodge Corp.","Philip Morris Companies Inc.","Phillips Petroleum Co","Phillips Van Heusen Corp.","Phoenix Companies Inc","Pier 1 Imports Inc.","Pilgrim's Pride Corporation","Pinnacle West Capital Corp","Pioneer-Standard Electronics Inc.","Pitney Bowes Inc.","Pittston Brinks Group","Plains All American Pipeline LP","PNC Financial Services Group Inc.","PNM Resources Inc","Polaris Industries Inc.","Polo Ralph Lauren Corp","PolyOne Corp","Popular Inc","Potlatch Corp","PPG Industries Inc","PPL Corp","Praxair Inc","Precision Castparts Corp","Premcor Inc.","Pride International Inc","Primedia Inc","Principal Financial Group Inc.","Procter & Gamble Co.","Pro-Fac Cooperative Inc.","Progress Energy Inc","Progressive Corporation","Protective Life Corp","Provident Financial Group","Providian Financial Corp.","Prudential Financial Inc.","PSS World Medical Inc","Public Service Enterprise Group Inc.","Publix Super Markets Inc.","Puget Energy Inc.","Pulte Homes Inc","Qualcomm Inc","Quanta Services Inc.","Quantum Corp","Quest Diagnostics Inc.","Questar Corp","Quintiles Transnational","Qwest Communications Intl Inc","R.J. Reynolds Tobacco Company","R.R. Donnelley & Sons Company","Radio Shack Corporation","Raymond James Financial Inc.","Raytheon Company","Reader's Digest Association Inc.","Reebok International Ltd.","Regions Financial Corp.","Regis Corporation","Reliance Steel & Aluminum Co.","Reliant Energy Inc.","Rent A Center Inc","Republic Services Inc","Revlon Inc","RGS Energy Group Inc","Rite Aid Corp","Riverwood Holding Inc.","RoadwayCorp","Robert Half International Inc.","Rock-Tenn Co","Rockwell Automation Inc","Rockwell Collins Inc","Rohm & Haas Co.","Ross Stores Inc","RPM Inc.","Ruddick Corp","Ryder System Inc","Ryerson Tull Inc","Ryland Group Inc.","Sabre Holdings Corp","Safeco Corp","Safeguard Scientifics Inc.","Safeway Inc","Saks Inc","Sanmina-SCI Inc","Sara Lee Corp","SBC Communications Inc","Scana Corp.","Schering-Plough Corp","Scholastic Corp","SCI Systems Onc.","Science Applications Intl. Inc.","Scientific-Atlanta Inc","Scotts Company","Seaboard Corp","Sealed Air Corp","Sears Roebuck & Co","Sempra Energy","Sequa Corp","Service Corp. International","ServiceMaster Co","Shaw Group Inc","Sherwin-Williams Company","Shopko Stores Inc","Siebel Systems Inc","Sierra Health Services Inc","Sierra Pacific Resources","Silgan Holdings Inc.","Silicon Graphics Inc","Simon Property Group Inc","SLM Corporation","Smith International Inc","Smithfield Foods Inc","Smurfit-Stone Container Corp","Snap-On Inc","Solectron Corp","Solutia Inc","Sonic Automotive Inc.","Sonoco Products Co.","Southern Company","Southern Union Company","SouthTrust Corp.","Southwest Airlines Co","Southwest Gas Corp","Sovereign Bancorp Inc.","Spartan Stores Inc","Spherion Corp","Sports Authority Inc","Sprint Corp.","SPX Corp","St. Jude Medical Inc","St. Paul Cos.","Staff Leasing Inc.","StanCorp Financial Group Inc","Standard Pacific Corp.","Stanley Works","Staples Inc","Starbucks Corp","Starwood Hotels & Resorts Worldwide Inc","State Street Corp.","Stater Bros. Holdings Inc.","Steelcase Inc","Stein Mart Inc","Stewart & Stevenson Services Inc","Stewart Information Services Corp","Stilwell Financial Inc","Storage Technology Corporation","Stryker Corp","Sun Healthcare Group Inc.","Sun Microsystems Inc.","SunGard Data Systems Inc.","Sunoco Inc.","SunTrust Banks Inc","Supervalu Inc","Swift Transportation, Co., Inc","Symbol Technologies Inc","Synovus Financial Corp.","Sysco Corp","Systemax Inc.","Target Corp.","Tech Data Corporation","TECO Energy Inc","Tecumseh Products Company","Tektronix Inc","Teleflex Incorporated","Telephone & Data Systems Inc","Tellabs Inc.","Temple-Inland Inc","Tenet Healthcare Corporation","Tenneco Automotive Inc.","Teradyne Inc","Terex Corp","Tesoro Petroleum Corp.","Texas Industries Inc.","Texas Instruments Incorporated","Textron Inc","Thermo Electron Corporation","Thomas & Betts Corporation","Tiffany & Co","Timken Company","TJX Companies Inc","TMP Worldwide Inc","Toll Brothers Inc","Torchmark Corporation","Toro Company","Tower Automotive Inc.","Toys 'R' Us Inc","Trans World Entertainment Corp.","TransMontaigne Inc","Transocean Inc","TravelCenters of America Inc.","Triad Hospitals Inc","Tribune Company","Trigon Healthcare Inc.","Trinity Industries Inc","Trump Hotels & Casino Resorts Inc.","TruServ Corporation","TRW Inc","TXU Corp","Tyson Foods Inc","U.S. Bancorp","U.S. Industries Inc.","UAL Corporation","UGI Corporation","Unified Western Grocers Inc","Union Pacific Corporation","Union Planters Corp","Unisource Energy Corp","Unisys Corporation","United Auto Group Inc","United Defense Industries Inc.","United Parcel Service Inc","United Rentals Inc","United Stationers Inc","United Technologies Corporation","UnitedHealth Group Incorporated","Unitrin Inc","Universal Corporation","Universal Forest Products Inc","Universal Health Services Inc","Unocal Corporation","Unova Inc","UnumProvident Corporation","URS Corporation","US Airways Group Inc","US Oncology Inc","USA Interactive","USFreighways Corporation","USG Corporation","UST Inc","Valero Energy Corporation","Valspar Corporation","Value City Department Stores Inc","Varco International Inc","Vectren Corporation","Veritas Software Corporation","Verizon Communications Inc","VF Corporation","Viacom Inc","Viad Corp","Viasystems Group Inc","Vishay Intertechnology Inc","Visteon Corporation","Volt Information Sciences Inc","Vulcan Materials Company","W.R. Berkley Corporation","W.R. Grace & Co","W.W. Grainger Inc","Wachovia Corporation","Wakenhut Corporation","Walgreen Co","Wallace Computer Services Inc","Wal-Mart Stores Inc","Walt Disney Co","Walter Industries Inc","Washington Mutual Inc","Washington Post Co.","Waste Management Inc","Watsco Inc","Weatherford International Inc","Weis Markets Inc.","Wellpoint Health Networks Inc","Wells Fargo & Company","Wendy's International Inc","Werner Enterprises Inc","WESCO International Inc","Western Digital Inc","Western Gas Resources Inc","WestPoint Stevens Inc","Weyerhauser Company","WGL Holdings Inc","Whirlpool Corporation","Whole Foods Market Inc","Willamette Industries Inc.","Williams Companies Inc","Williams Sonoma Inc","Winn Dixie Stores Inc","Wisconsin Energy Corporation","Wm Wrigley Jr Company","World Fuel Services Corporation","WorldCom Inc","Worthington Industries Inc","WPS Resources Corporation","Wyeth","Wyndham International Inc","Xcel Energy Inc","Xerox Corp","Xilinx Inc","XO Communications Inc","Yellow Corporation","York International Corp","Yum Brands Inc.","Zale Corporation","Zions Bancorporation"],fileExtension:{raster:["bmp","gif","gpl","ico","jpeg","psd","png","psp","raw","tiff"],vector:["3dv","amf","awg","ai","cgm","cdr","cmx","dxf","e2d","egt","eps","fs","odg","svg","xar"],"3d":["3dmf","3dm","3mf","3ds","an8","aoi","blend","cal3d","cob","ctm","iob","jas","max","mb","mdx","obj","x","x3d"],document:["doc","docx","dot","html","xml","odt","odm","ott","csv","rtf","tex","xhtml","xps"]},timezones:[{name:"Dateline Standard Time",abbr:"DST",offset:-12,isdst:!1,text:"(UTC-12:00) International Date Line West",utc:["Etc/GMT+12"]},{name:"UTC-11",abbr:"U",offset:-11,isdst:!1,text:"(UTC-11:00) Coordinated Universal Time-11",utc:["Etc/GMT+11","Pacific/Midway","Pacific/Niue","Pacific/Pago_Pago"]},{name:"Hawaiian Standard Time",abbr:"HST",offset:-10,isdst:!1,text:"(UTC-10:00) Hawaii",utc:["Etc/GMT+10","Pacific/Honolulu","Pacific/Johnston","Pacific/Rarotonga","Pacific/Tahiti"]},{name:"Alaskan Standard Time",abbr:"AKDT",offset:-8,isdst:!0,text:"(UTC-09:00) Alaska",utc:["America/Anchorage","America/Juneau","America/Nome","America/Sitka","America/Yakutat"]},{name:"Pacific Standard Time (Mexico)",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-08:00) Baja California",utc:["America/Santa_Isabel"]},{name:"Pacific Standard Time",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-08:00) Pacific Time (US & Canada)",utc:["America/Dawson","America/Los_Angeles","America/Tijuana","America/Vancouver","America/Whitehorse","PST8PDT"]},{name:"US Mountain Standard Time",abbr:"UMST",offset:-7,isdst:!1,text:"(UTC-07:00) Arizona",utc:["America/Creston","America/Dawson_Creek","America/Hermosillo","America/Phoenix","Etc/GMT+7"]},{name:"Mountain Standard Time (Mexico)",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Chihuahua, La Paz, Mazatlan",utc:["America/Chihuahua","America/Mazatlan"]},{name:"Mountain Standard Time",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Mountain Time (US & Canada)",utc:["America/Boise","America/Cambridge_Bay","America/Denver","America/Edmonton","America/Inuvik","America/Ojinaga","America/Yellowknife","MST7MDT"]},{name:"Central America Standard Time",abbr:"CAST",offset:-6,isdst:!1,text:"(UTC-06:00) Central America",utc:["America/Belize","America/Costa_Rica","America/El_Salvador","America/Guatemala","America/Managua","America/Tegucigalpa","Etc/GMT+6","Pacific/Galapagos"]},{name:"Central Standard Time",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Central Time (US & Canada)",utc:["America/Chicago","America/Indiana/Knox","America/Indiana/Tell_City","America/Matamoros","America/Menominee","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Rainy_River","America/Rankin_Inlet","America/Resolute","America/Winnipeg","CST6CDT"]},{name:"Central Standard Time (Mexico)",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Guadalajara, Mexico City, Monterrey",utc:["America/Bahia_Banderas","America/Cancun","America/Merida","America/Mexico_City","America/Monterrey"]},{name:"Canada Central Standard Time",abbr:"CCST",offset:-6,isdst:!1,text:"(UTC-06:00) Saskatchewan",utc:["America/Regina","America/Swift_Current"]},{name:"SA Pacific Standard Time",abbr:"SPST",offset:-5,isdst:!1,text:"(UTC-05:00) Bogota, Lima, Quito",utc:["America/Bogota","America/Cayman","America/Coral_Harbour","America/Eirunepe","America/Guayaquil","America/Jamaica","America/Lima","America/Panama","America/Rio_Branco","Etc/GMT+5"]},{name:"Eastern Standard Time",abbr:"EDT",offset:-4,isdst:!0,text:"(UTC-05:00) Eastern Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto","EST5EDT"]},{name:"US Eastern Standard Time",abbr:"UEDT",offset:-4,isdst:!0,text:"(UTC-05:00) Indiana (East)",utc:["America/Indiana/Marengo","America/Indiana/Vevay","America/Indianapolis"]},{name:"Venezuela Standard Time",abbr:"VST",offset:-4.5,isdst:!1,text:"(UTC-04:30) Caracas",utc:["America/Caracas"]},{name:"Paraguay Standard Time",abbr:"PST",offset:-4,isdst:!1,text:"(UTC-04:00) Asuncion",utc:["America/Asuncion"]},{name:"Atlantic Standard Time",abbr:"ADT",offset:-3,isdst:!0,text:"(UTC-04:00) Atlantic Time (Canada)",utc:["America/Glace_Bay","America/Goose_Bay","America/Halifax","America/Moncton","America/Thule","Atlantic/Bermuda"]},{name:"Central Brazilian Standard Time",abbr:"CBST",offset:-4,isdst:!1,text:"(UTC-04:00) Cuiaba",utc:["America/Campo_Grande","America/Cuiaba"]},{name:"SA Western Standard Time",abbr:"SWST",offset:-4,isdst:!1,text:"(UTC-04:00) Georgetown, La Paz, Manaus, San Juan",utc:["America/Anguilla","America/Antigua","America/Aruba","America/Barbados","America/Blanc-Sablon","America/Boa_Vista","America/Curacao","America/Dominica","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guyana","America/Kralendijk","America/La_Paz","America/Lower_Princes","America/Manaus","America/Marigot","America/Martinique","America/Montserrat","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Santo_Domingo","America/St_Barthelemy","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Tortola","Etc/GMT+4"]},{name:"Pacific SA Standard Time",abbr:"PSST",offset:-4,isdst:!1,text:"(UTC-04:00) Santiago",utc:["America/Santiago","Antarctica/Palmer"]},{name:"Newfoundland Standard Time",abbr:"NDT",offset:-2.5,isdst:!0,text:"(UTC-03:30) Newfoundland",utc:["America/St_Johns"]},{name:"E. South America Standard Time",abbr:"ESAST",offset:-3,isdst:!1,text:"(UTC-03:00) Brasilia",utc:["America/Sao_Paulo"]},{name:"Argentina Standard Time",abbr:"AST",offset:-3,isdst:!1,text:"(UTC-03:00) Buenos Aires",utc:["America/Argentina/La_Rioja","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Buenos_Aires","America/Catamarca","America/Cordoba","America/Jujuy","America/Mendoza"]},{name:"SA Eastern Standard Time",abbr:"SEST",offset:-3,isdst:!1,text:"(UTC-03:00) Cayenne, Fortaleza",utc:["America/Araguaina","America/Belem","America/Cayenne","America/Fortaleza","America/Maceio","America/Paramaribo","America/Recife","America/Santarem","Antarctica/Rothera","Atlantic/Stanley","Etc/GMT+3"]},{name:"Greenland Standard Time",abbr:"GDT",offset:-2,isdst:!0,text:"(UTC-03:00) Greenland",utc:["America/Godthab"]},{name:"Montevideo Standard Time",abbr:"MST",offset:-3,isdst:!1,text:"(UTC-03:00) Montevideo",utc:["America/Montevideo"]},{name:"Bahia Standard Time",abbr:"BST",offset:-3,isdst:!1,text:"(UTC-03:00) Salvador",utc:["America/Bahia"]},{name:"UTC-02",abbr:"U",offset:-2,isdst:!1,text:"(UTC-02:00) Coordinated Universal Time-02",utc:["America/Noronha","Atlantic/South_Georgia","Etc/GMT+2"]},{name:"Mid-Atlantic Standard Time",abbr:"MDT",offset:-1,isdst:!0,text:"(UTC-02:00) Mid-Atlantic - Old"},{name:"Azores Standard Time",abbr:"ADT",offset:0,isdst:!0,text:"(UTC-01:00) Azores",utc:["America/Scoresbysund","Atlantic/Azores"]},{name:"Cape Verde Standard Time",abbr:"CVST",offset:-1,isdst:!1,text:"(UTC-01:00) Cape Verde Is.",utc:["Atlantic/Cape_Verde","Etc/GMT+1"]},{name:"Morocco Standard Time",abbr:"MDT",offset:1,isdst:!0,text:"(UTC) Casablanca",utc:["Africa/Casablanca","Africa/El_Aaiun"]},{name:"UTC",abbr:"CUT",offset:0,isdst:!1,text:"(UTC) Coordinated Universal Time",utc:["America/Danmarkshavn","Etc/GMT"]},{name:"GMT Standard Time",abbr:"GDT",offset:1,isdst:!0,text:"(UTC) Dublin, Edinburgh, Lisbon, London",utc:["Atlantic/Canary","Atlantic/Faeroe","Atlantic/Madeira","Europe/Dublin","Europe/Guernsey","Europe/Isle_of_Man","Europe/Jersey","Europe/Lisbon","Europe/London"]},{name:"Greenwich Standard Time",abbr:"GST",offset:0,isdst:!1,text:"(UTC) Monrovia, Reykjavik",utc:["Africa/Abidjan","Africa/Accra","Africa/Bamako","Africa/Banjul","Africa/Bissau","Africa/Conakry","Africa/Dakar","Africa/Freetown","Africa/Lome","Africa/Monrovia","Africa/Nouakchott","Africa/Ouagadougou","Africa/Sao_Tome","Atlantic/Reykjavik","Atlantic/St_Helena"]},{name:"W. Europe Standard Time",abbr:"WEDT",offset:2,isdst:!0,text:"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",utc:["Arctic/Longyearbyen","Europe/Amsterdam","Europe/Andorra","Europe/Berlin","Europe/Busingen","Europe/Gibraltar","Europe/Luxembourg","Europe/Malta","Europe/Monaco","Europe/Oslo","Europe/Rome","Europe/San_Marino","Europe/Stockholm","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Zurich"]},{name:"Central Europe Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",utc:["Europe/Belgrade","Europe/Bratislava","Europe/Budapest","Europe/Ljubljana","Europe/Podgorica","Europe/Prague","Europe/Tirane"]},{name:"Romance Standard Time",abbr:"RDT",offset:2,isdst:!0,text:"(UTC+01:00) Brussels, Copenhagen, Madrid, Paris",utc:["Africa/Ceuta","Europe/Brussels","Europe/Copenhagen","Europe/Madrid","Europe/Paris"]},{name:"Central European Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb",utc:["Europe/Sarajevo","Europe/Skopje","Europe/Warsaw","Europe/Zagreb"]},{name:"W. Central Africa Standard Time",abbr:"WCAST",offset:1,isdst:!1,text:"(UTC+01:00) West Central Africa",utc:["Africa/Algiers","Africa/Bangui","Africa/Brazzaville","Africa/Douala","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Luanda","Africa/Malabo","Africa/Ndjamena","Africa/Niamey","Africa/Porto-Novo","Africa/Tunis","Etc/GMT-1"]},{name:"Namibia Standard Time",abbr:"NST",offset:1,isdst:!1,text:"(UTC+01:00) Windhoek",utc:["Africa/Windhoek"]},{name:"GTB Standard Time",abbr:"GDT",offset:3,isdst:!0,text:"(UTC+02:00) Athens, Bucharest",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau"]},{name:"Middle East Standard Time",abbr:"MEDT",offset:3,isdst:!0,text:"(UTC+02:00) Beirut",utc:["Asia/Beirut"]},{name:"Egypt Standard Time",abbr:"EST",offset:2,isdst:!1,text:"(UTC+02:00) Cairo",utc:["Africa/Cairo"]},{name:"Syria Standard Time",abbr:"SDT",offset:3,isdst:!0,text:"(UTC+02:00) Damascus",utc:["Asia/Damascus"]},{name:"E. Europe Standard Time",abbr:"EEDT",offset:3,isdst:!0,text:"(UTC+02:00) E. Europe"},{name:"South Africa Standard Time",abbr:"SAST",offset:2,isdst:!1,text:"(UTC+02:00) Harare, Pretoria",utc:["Africa/Blantyre","Africa/Bujumbura","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Kigali","Africa/Lubumbashi","Africa/Lusaka","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Etc/GMT-2"]},{name:"FLE Standard Time",abbr:"FDT",offset:3,isdst:!0,text:"(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",utc:["Europe/Helsinki","Europe/Kiev","Europe/Mariehamn","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhgorod","Europe/Vilnius","Europe/Zaporozhye"]},{name:"Turkey Standard Time",abbr:"TDT",offset:3,isdst:!0,text:"(UTC+02:00) Istanbul",utc:["Europe/Istanbul"]},{name:"Israel Standard Time",abbr:"JDT",offset:3,isdst:!0,text:"(UTC+02:00) Jerusalem",utc:["Asia/Jerusalem"]},{name:"Libya Standard Time",abbr:"LST",offset:2,isdst:!1,text:"(UTC+02:00) Tripoli",utc:["Africa/Tripoli"]},{name:"Jordan Standard Time",abbr:"JST",offset:3,isdst:!1,text:"(UTC+03:00) Amman",utc:["Asia/Amman"]},{name:"Arabic Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Baghdad",utc:["Asia/Baghdad"]},{name:"Kaliningrad Standard Time",abbr:"KST",offset:3,isdst:!1,text:"(UTC+03:00) Kaliningrad, Minsk",utc:["Europe/Kaliningrad","Europe/Minsk"]},{name:"Arab Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Kuwait, Riyadh",utc:["Asia/Aden","Asia/Bahrain","Asia/Kuwait","Asia/Qatar","Asia/Riyadh"]},{name:"E. Africa Standard Time",abbr:"EAST",offset:3,isdst:!1,text:"(UTC+03:00) Nairobi",utc:["Africa/Addis_Ababa","Africa/Asmera","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Mogadishu","Africa/Nairobi","Antarctica/Syowa","Etc/GMT-3","Indian/Antananarivo","Indian/Comoro","Indian/Mayotte"]},{name:"Iran Standard Time",abbr:"IDT",offset:4.5,isdst:!0,text:"(UTC+03:30) Tehran",utc:["Asia/Tehran"]},{name:"Arabian Standard Time",abbr:"AST",offset:4,isdst:!1,text:"(UTC+04:00) Abu Dhabi, Muscat",utc:["Asia/Dubai","Asia/Muscat","Etc/GMT-4"]},{name:"Azerbaijan Standard Time",abbr:"ADT",offset:5,isdst:!0,text:"(UTC+04:00) Baku",utc:["Asia/Baku"]},{name:"Russian Standard Time",abbr:"RST",offset:4,isdst:!1,text:"(UTC+04:00) Moscow, St. Petersburg, Volgograd",utc:["Europe/Moscow","Europe/Samara","Europe/Simferopol","Europe/Volgograd"]},{name:"Mauritius Standard Time",abbr:"MST",offset:4,isdst:!1,text:"(UTC+04:00) Port Louis",utc:["Indian/Mahe","Indian/Mauritius","Indian/Reunion"]},{name:"Georgian Standard Time",abbr:"GST",offset:4,isdst:!1,text:"(UTC+04:00) Tbilisi",utc:["Asia/Tbilisi"]},{name:"Caucasus Standard Time",abbr:"CST",offset:4,isdst:!1,text:"(UTC+04:00) Yerevan",utc:["Asia/Yerevan"]},{name:"Afghanistan Standard Time",abbr:"AST",offset:4.5,isdst:!1,text:"(UTC+04:30) Kabul",utc:["Asia/Kabul"]},{name:"West Asia Standard Time",abbr:"WAST",offset:5,isdst:!1,text:"(UTC+05:00) Ashgabat, Tashkent",utc:["Antarctica/Mawson","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Dushanbe","Asia/Oral","Asia/Samarkand","Asia/Tashkent","Etc/GMT-5","Indian/Kerguelen","Indian/Maldives"]},{name:"Pakistan Standard Time",abbr:"PST",offset:5,isdst:!1,text:"(UTC+05:00) Islamabad, Karachi",utc:["Asia/Karachi"]},{name:"India Standard Time",abbr:"IST",offset:5.5,isdst:!1,text:"(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi",utc:["Asia/Calcutta"]},{name:"Sri Lanka Standard Time",abbr:"SLST",offset:5.5,isdst:!1,text:"(UTC+05:30) Sri Jayawardenepura",utc:["Asia/Colombo"]},{name:"Nepal Standard Time",abbr:"NST",offset:5.75,isdst:!1,text:"(UTC+05:45) Kathmandu",utc:["Asia/Katmandu"]},{name:"Central Asia Standard Time",abbr:"CAST",offset:6,isdst:!1,text:"(UTC+06:00) Astana",utc:["Antarctica/Vostok","Asia/Almaty","Asia/Bishkek","Asia/Qyzylorda","Asia/Urumqi","Etc/GMT-6","Indian/Chagos"]},{name:"Bangladesh Standard Time",abbr:"BST",offset:6,isdst:!1,text:"(UTC+06:00) Dhaka",utc:["Asia/Dhaka","Asia/Thimphu"]},{name:"Ekaterinburg Standard Time",abbr:"EST",offset:6,isdst:!1,text:"(UTC+06:00) Ekaterinburg",utc:["Asia/Yekaterinburg"]},{name:"Myanmar Standard Time",abbr:"MST",offset:6.5,isdst:!1,text:"(UTC+06:30) Yangon (Rangoon)",utc:["Asia/Rangoon","Indian/Cocos"]},{name:"SE Asia Standard Time",abbr:"SAST",offset:7,isdst:!1,text:"(UTC+07:00) Bangkok, Hanoi, Jakarta",utc:["Antarctica/Davis","Asia/Bangkok","Asia/Hovd","Asia/Jakarta","Asia/Phnom_Penh","Asia/Pontianak","Asia/Saigon","Asia/Vientiane","Etc/GMT-7","Indian/Christmas"]},{name:"N. Central Asia Standard Time",abbr:"NCAST",offset:7,isdst:!1,text:"(UTC+07:00) Novosibirsk",utc:["Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk"]},{name:"China Standard Time",abbr:"CST",offset:8,isdst:!1,text:"(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",utc:["Asia/Hong_Kong","Asia/Macau","Asia/Shanghai"]},{name:"North Asia Standard Time",abbr:"NAST",offset:8,isdst:!1,text:"(UTC+08:00) Krasnoyarsk",utc:["Asia/Krasnoyarsk"]},{name:"Singapore Standard Time",abbr:"MPST",offset:8,isdst:!1,text:"(UTC+08:00) Kuala Lumpur, Singapore",utc:["Asia/Brunei","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Makassar","Asia/Manila","Asia/Singapore","Etc/GMT-8"]},{name:"W. Australia Standard Time",abbr:"WAST",offset:8,isdst:!1,text:"(UTC+08:00) Perth",utc:["Antarctica/Casey","Australia/Perth"]},{name:"Taipei Standard Time",abbr:"TST",offset:8,isdst:!1,text:"(UTC+08:00) Taipei",utc:["Asia/Taipei"]},{name:"Ulaanbaatar Standard Time",abbr:"UST",offset:8,isdst:!1,text:"(UTC+08:00) Ulaanbaatar",utc:["Asia/Choibalsan","Asia/Ulaanbaatar"]},{name:"North Asia East Standard Time",abbr:"NAEST",offset:9,isdst:!1,text:"(UTC+09:00) Irkutsk",utc:["Asia/Irkutsk"]},{name:"Tokyo Standard Time",abbr:"TST",offset:9,isdst:!1,text:"(UTC+09:00) Osaka, Sapporo, Tokyo",utc:["Asia/Dili","Asia/Jayapura","Asia/Tokyo","Etc/GMT-9","Pacific/Palau"]},{name:"Korea Standard Time",abbr:"KST",offset:9,isdst:!1,text:"(UTC+09:00) Seoul",utc:["Asia/Pyongyang","Asia/Seoul"]},{name:"Cen. Australia Standard Time",abbr:"CAST",offset:9.5,isdst:!1,text:"(UTC+09:30) Adelaide",utc:["Australia/Adelaide","Australia/Broken_Hill"]},{name:"AUS Central Standard Time",abbr:"ACST",offset:9.5,isdst:!1,text:"(UTC+09:30) Darwin",utc:["Australia/Darwin"]},{name:"E. Australia Standard Time",abbr:"EAST",offset:10,isdst:!1,text:"(UTC+10:00) Brisbane",utc:["Australia/Brisbane","Australia/Lindeman"]},{name:"AUS Eastern Standard Time",abbr:"AEST",offset:10,isdst:!1,text:"(UTC+10:00) Canberra, Melbourne, Sydney",utc:["Australia/Melbourne","Australia/Sydney"]},{name:"West Pacific Standard Time",abbr:"WPST",offset:10,isdst:!1,text:"(UTC+10:00) Guam, Port Moresby",utc:["Antarctica/DumontDUrville","Etc/GMT-10","Pacific/Guam","Pacific/Port_Moresby","Pacific/Saipan","Pacific/Truk"]},{name:"Tasmania Standard Time",abbr:"TST",offset:10,isdst:!1,text:"(UTC+10:00) Hobart",utc:["Australia/Currie","Australia/Hobart"]},{name:"Yakutsk Standard Time",abbr:"YST",offset:10,isdst:!1,text:"(UTC+10:00) Yakutsk",utc:["Asia/Chita","Asia/Khandyga","Asia/Yakutsk"]},{name:"Central Pacific Standard Time",abbr:"CPST",offset:11,isdst:!1,text:"(UTC+11:00) Solomon Is., New Caledonia",utc:["Antarctica/Macquarie","Etc/GMT-11","Pacific/Efate","Pacific/Guadalcanal","Pacific/Kosrae","Pacific/Noumea","Pacific/Ponape"]},{name:"Vladivostok Standard Time",abbr:"VST",offset:11,isdst:!1,text:"(UTC+11:00) Vladivostok",utc:["Asia/Sakhalin","Asia/Ust-Nera","Asia/Vladivostok"]},{name:"New Zealand Standard Time",abbr:"NZST",offset:12,isdst:!1,text:"(UTC+12:00) Auckland, Wellington",utc:["Antarctica/McMurdo","Pacific/Auckland"]},{name:"UTC+12",abbr:"U",offset:12,isdst:!1,text:"(UTC+12:00) Coordinated Universal Time+12",utc:["Etc/GMT-12","Pacific/Funafuti","Pacific/Kwajalein","Pacific/Majuro","Pacific/Nauru","Pacific/Tarawa","Pacific/Wake","Pacific/Wallis"]},{name:"Fiji Standard Time",abbr:"FST",offset:12,isdst:!1,text:"(UTC+12:00) Fiji",utc:["Pacific/Fiji"]},{name:"Magadan Standard Time",abbr:"MST",offset:12,isdst:!1,text:"(UTC+12:00) Magadan",utc:["Asia/Anadyr","Asia/Kamchatka","Asia/Magadan","Asia/Srednekolymsk"]},{name:"Kamchatka Standard Time",abbr:"KDT",offset:13,isdst:!0,text:"(UTC+12:00) Petropavlovsk-Kamchatsky - Old"},{name:"Tonga Standard Time",abbr:"TST",offset:13,isdst:!1,text:"(UTC+13:00) Nuku'alofa",utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]},{name:"Samoa Standard Time",abbr:"SST",offset:13,isdst:!1,text:"(UTC+13:00) Samoa",utc:["Pacific/Apia"]}],profession:["Airline Pilot","Academic Team","Accountant","Account Executive","Actor","Actuary","Acquisition Analyst","Administrative Asst.","Administrative Analyst","Administrator","Advertising Director","Aerospace Engineer","Agent","Agricultural Inspector","Agricultural Scientist","Air Traffic Controller","Animal Trainer","Anthropologist","Appraiser","Architect","Art Director","Artist","Astronomer","Athletic Coach","Auditor","Author","Baker","Banker","Bankruptcy Attorney","Benefits Manager","Biologist","Bio-feedback Specialist","Biomedical Engineer","Biotechnical Researcher","Broadcaster","Broker","Building Manager","Building Contractor","Building Inspector","Business Analyst","Business Planner","Business Manager","Buyer","Call Center Manager","Career Counselor","Cash Manager","Ceramic Engineer","Chief Executive Officer","Chief Operation Officer","Chef","Chemical Engineer","Chemist","Child Care Manager","Chief Medical Officer","Chiropractor","Cinematographer","City Housing Manager","City Manager","Civil Engineer","Claims Manager","Clinical Research Assistant","Collections Manager","Compliance Manager","Comptroller","Computer Manager","Commercial Artist","Communications Affairs Director","Communications Director","Communications Engineer","Compensation Analyst","Computer Programmer","Computer Ops. Manager","Computer Engineer","Computer Operator","Computer Graphics Specialist","Construction Engineer","Construction Manager","Consultant","Consumer Relations Manager","Contract Administrator","Copyright Attorney","Copywriter","Corporate Planner","Corrections Officer","Cosmetologist","Credit Analyst","Cruise Director","Chief Information Officer","Chief Technology Officer","Customer Service Manager","Cryptologist","Dancer","Data Security Manager","Database Manager","Day Care Instructor","Dentist","Designer","Design Engineer","Desktop Publisher","Developer","Development Officer","Diamond Merchant","Dietitian","Direct Marketer","Director","Distribution Manager","Diversity Manager","Economist","EEO Compliance Manager","Editor","Education Adminator","Electrical Engineer","Electro Optical Engineer","Electronics Engineer","Embassy Management","Employment Agent","Engineer Technician","Entrepreneur","Environmental Analyst","Environmental Attorney","Environmental Engineer","Environmental Specialist","Escrow Officer","Estimator","Executive Assistant","Executive Director","Executive Recruiter","Facilities Manager","Family Counselor","Fashion Events Manager","Fashion Merchandiser","Fast Food Manager","Film Producer","Film Production Assistant","Financial Analyst","Financial Planner","Financier","Fine Artist","Wildlife Specialist","Fitness Consultant","Flight Attendant","Flight Engineer","Floral Designer","Food & Beverage Director","Food Service Manager","Forestry Technician","Franchise Management","Franchise Sales","Fraud Investigator","Freelance Writer","Fund Raiser","General Manager","Geologist","General Counsel","Geriatric Specialist","Gerontologist","Glamour Photographer","Golf Club Manager","Gourmet Chef","Graphic Designer","Grounds Keeper","Hazardous Waste Manager","Health Care Manager","Health Therapist","Health Service Administrator","Hearing Officer","Home Economist","Horticulturist","Hospital Administrator","Hotel Manager","Human Resources Manager","Importer","Industrial Designer","Industrial Engineer","Information Director","Inside Sales","Insurance Adjuster","Interior Decorator","Internal Controls Director","International Acct.","International Courier","International Lawyer","Interpreter","Investigator","Investment Banker","Investment Manager","IT Architect","IT Project Manager","IT Systems Analyst","Jeweler","Joint Venture Manager","Journalist","Labor Negotiator","Labor Organizer","Labor Relations Manager","Lab Services Director","Lab Technician","Land Developer","Landscape Architect","Law Enforcement Officer","Lawyer","Lead Software Engineer","Lead Software Test Engineer","Leasing Manager","Legal Secretary","Library Manager","Litigation Attorney","Loan Officer","Lobbyist","Logistics Manager","Maintenance Manager","Management Consultant","Managed Care Director","Managing Partner","Manufacturing Director","Manpower Planner","Marine Biologist","Market Res. Analyst","Marketing Director","Materials Manager","Mathematician","Membership Chairman","Mechanic","Mechanical Engineer","Media Buyer","Medical Investor","Medical Secretary","Medical Technician","Mental Health Counselor","Merchandiser","Metallurgical Engineering","Meteorologist","Microbiologist","MIS Manager","Motion Picture Director","Multimedia Director","Musician","Network Administrator","Network Specialist","Network Operator","New Product Manager","Novelist","Nuclear Engineer","Nuclear Specialist","Nutritionist","Nursing Administrator","Occupational Therapist","Oceanographer","Office Manager","Operations Manager","Operations Research Director","Optical Technician","Optometrist","Organizational Development Manager","Outplacement Specialist","Paralegal","Park Ranger","Patent Attorney","Payroll Specialist","Personnel Specialist","Petroleum Engineer","Pharmacist","Photographer","Physical Therapist","Physician","Physician Assistant","Physicist","Planning Director","Podiatrist","Political Analyst","Political Scientist","Politician","Portfolio Manager","Preschool Management","Preschool Teacher","Principal","Private Banker","Private Investigator","Probation Officer","Process Engineer","Producer","Product Manager","Product Engineer","Production Engineer","Production Planner","Professional Athlete","Professional Coach","Professor","Project Engineer","Project Manager","Program Manager","Property Manager","Public Administrator","Public Safety Director","PR Specialist","Publisher","Purchasing Agent","Publishing Director","Quality Assurance Specialist","Quality Control Engineer","Quality Control Inspector","Radiology Manager","Railroad Engineer","Real Estate Broker","Recreational Director","Recruiter","Redevelopment Specialist","Regulatory Affairs Manager","Registered Nurse","Rehabilitation Counselor","Relocation Manager","Reporter","Research Specialist","Restaurant Manager","Retail Store Manager","Risk Analyst","Safety Engineer","Sales Engineer","Sales Trainer","Sales Promotion Manager","Sales Representative","Sales Manager","Service Manager","Sanitation Engineer","Scientific Programmer","Scientific Writer","Securities Analyst","Security Consultant","Security Director","Seminar Presenter","Ship's Officer","Singer","Social Director","Social Program Planner","Social Research","Social Scientist","Social Worker","Sociologist","Software Developer","Software Engineer","Software Test Engineer","Soil Scientist","Special Events Manager","Special Education Teacher","Special Projects Director","Speech Pathologist","Speech Writer","Sports Event Manager","Statistician","Store Manager","Strategic Alliance Director","Strategic Planning Director","Stress Reduction Specialist","Stockbroker","Surveyor","Structural Engineer","Superintendent","Supply Chain Director","System Engineer","Systems Analyst","Systems Programmer","System Administrator","Tax Specialist","Teacher","Technical Support Specialist","Technical Illustrator","Technical Writer","Technology Director","Telecom Analyst","Telemarketer","Theatrical Director","Title Examiner","Tour Escort","Tour Guide Director","Traffic Manager","Trainer Translator","Transportation Manager","Travel Agent","Treasurer","TV Programmer","Underwriter","Union Representative","University Administrator","University Dean","Urban Planner","Veterinarian","Vendor Relations Director","Viticulturist","Warehouse Manager"],animals:{ocean:["Acantharea","Anemone","Angelfish King","Ahi Tuna","Albacore","American Oyster","Anchovy","Armored Snail","Arctic Char","Atlantic Bluefin Tuna","Atlantic Cod","Atlantic Goliath Grouper","Atlantic Trumpetfish","Atlantic Wolffish","Baleen Whale","Banded Butterflyfish","Banded Coral Shrimp","Banded Sea Krait","Barnacle","Barndoor Skate","Barracuda","Basking Shark","Bass","Beluga Whale","Bluebanded Goby","Bluehead Wrasse","Bluefish","Bluestreak Cleaner-Wrasse","Blue Marlin","Blue Shark","Blue Spiny Lobster","Blue Tang","Blue Whale","Broadclub Cuttlefish","Bull Shark","Chambered Nautilus","Chilean Basket Star","Chilean Jack Mackerel","Chinook Salmon","Christmas Tree Worm","Clam","Clown Anemonefish","Clown Triggerfish","Cod","Coelacanth","Cockscomb Cup Coral","Common Fangtooth","Conch","Cookiecutter Shark","Copepod","Coral","Corydoras","Cownose Ray","Crab","Crown-of-Thorns Starfish","Cushion Star","Cuttlefish","California Sea Otters","Dolphin","Dolphinfish","Dory","Devil Fish","Dugong","Dumbo Octopus","Dungeness Crab","Eccentric Sand Dollar","Edible Sea Cucumber","Eel","Elephant Seal","Elkhorn Coral","Emperor Shrimp","Estuarine Crocodile","Fathead Sculpin","Fiddler Crab","Fin Whale","Flameback","Flamingo Tongue Snail","Flashlight Fish","Flatback Turtle","Flatfish","Flying Fish","Flounder","Fluke","French Angelfish","Frilled Shark","Fugu (also called Pufferfish)","Gar","Geoduck","Giant Barrel Sponge","Giant Caribbean Sea Anemone","Giant Clam","Giant Isopod","Giant Kingfish","Giant Oarfish","Giant Pacific Octopus","Giant Pyrosome","Giant Sea Star","Giant Squid","Glowing Sucker Octopus","Giant Tube Worm","Goblin Shark","Goosefish","Great White Shark","Greenland Shark","Grey Atlantic Seal","Grouper","Grunion","Guineafowl Puffer","Haddock","Hake","Halibut","Hammerhead Shark","Hapuka","Harbor Porpoise","Harbor Seal","Hatchetfish","Hawaiian Monk Seal","Hawksbill Turtle","Hector's Dolphin","Hermit Crab","Herring","Hoki","Horn Shark","Horseshoe Crab","Humpback Anglerfish","Humpback Whale","Icefish","Imperator Angelfish","Irukandji Jellyfish","Isopod","Ivory Bush Coral","Japanese Spider Crab","Jellyfish","John Dory","Juan Fernandez Fur Seal","Killer Whale","Kiwa Hirsuta","Krill","Lagoon Triggerfish","Lamprey","Leafy Seadragon","Leopard Seal","Limpet","Ling","Lionfish","Lions Mane Jellyfish","Lobe Coral","Lobster","Loggerhead Turtle","Longnose Sawshark","Longsnout Seahorse","Lophelia Coral","Marrus Orthocanna","Manatee","Manta Ray","Marlin","Megamouth Shark","Mexican Lookdown","Mimic Octopus","Moon Jelly","Mollusk","Monkfish","Moray Eel","Mullet","Mussel","Megaladon","Napoleon Wrasse","Nassau Grouper","Narwhal","Nautilus","Needlefish","Northern Seahorse","North Atlantic Right Whale","Northern Red Snapper","Norway Lobster","Nudibranch","Nurse Shark","Oarfish","Ocean Sunfish","Oceanic Whitetip Shark","Octopus","Olive Sea Snake","Orange Roughy","Ostracod","Otter","Oyster","Pacific Angelshark","Pacific Blackdragon","Pacific Halibut","Pacific Sardine","Pacific Sea Nettle Jellyfish","Pacific White Sided Dolphin","Pantropical Spotted Dolphin","Patagonian Toothfish","Peacock Mantis Shrimp","Pelagic Thresher Shark","Penguin","Peruvian Anchoveta","Pilchard","Pink Salmon","Pinniped","Plankton","Porpoise","Polar Bear","Portuguese Man o' War","Pycnogonid Sea Spider","Quahog","Queen Angelfish","Queen Conch","Queen Parrotfish","Queensland Grouper","Ragfish","Ratfish","Rattail Fish","Ray","Red Drum","Red King Crab","Ringed Seal","Risso's Dolphin","Ross Seals","Sablefish","Salmon","Sand Dollar","Sandbar Shark","Sawfish","Sarcastic Fringehead","Scalloped Hammerhead Shark","Seahorse","Sea Cucumber","Sea Lion","Sea Urchin","Seal","Shark","Shortfin Mako Shark","Shovelnose Guitarfish","Shrimp","Silverside Fish","Skipjack Tuna","Slender Snipe Eel","Smalltooth Sawfish","Smelts","Sockeye Salmon","Southern Stingray","Sponge","Spotted Porcupinefish","Spotted Dolphin","Spotted Eagle Ray","Spotted Moray","Squid","Squidworm","Starfish","Stickleback","Stonefish","Stoplight Loosejaw","Sturgeon","Swordfish","Tan Bristlemouth","Tasseled Wobbegong","Terrible Claw Lobster","Threespot Damselfish","Tiger Prawn","Tiger Shark","Tilefish","Toadfish","Tropical Two-Wing Flyfish","Tuna","Umbrella Squid","Velvet Crab","Venus Flytrap Sea Anemone","Vigtorniella Worm","Viperfish","Vampire Squid","Vaquita","Wahoo","Walrus","West Indian Manatee","Whale","Whale Shark","Whiptail Gulper","White-Beaked Dolphin","White-Ring Garden Eel","White Shrimp","Wobbegong","Wrasse","Wreckfish","Xiphosura","Yellowtail Damselfish","Yelloweye Rockfish","Yellow Cup Black Coral","Yellow Tube Sponge","Yellowfin Tuna","Zebrashark","Zooplankton"],desert:["Aardwolf","Addax","African Wild Ass","Ant","Antelope","Armadillo","Baboon","Badger","Bat","Bearded Dragon","Beetle","Bird","Black-footed Cat","Boa","Brown Bear","Bustard","Butterfly","Camel","Caracal","Caracara","Caterpillar","Centipede","Cheetah","Chipmunk","Chuckwalla","Climbing Mouse","Coati","Cobra","Cotton Rat","Cougar","Courser","Crane Fly","Crow","Dassie Rat","Dove","Dunnart","Eagle","Echidna","Elephant","Emu","Falcon","Fly","Fox","Frogmouth","Gecko","Geoffroy's Cat","Gerbil","Grasshopper","Guanaco","Gundi","Hamster","Hawk","Hedgehog","Hyena","Hyrax","Jackal","Kangaroo","Kangaroo Rat","Kestrel","Kowari","Kultarr","Leopard","Lion","Macaw","Meerkat","Mouse","Oryx","Ostrich","Owl","Pronghorn","Python","Rabbit","Raccoon","Rattlesnake","Rhinoceros","Sand Cat","Spectacled Bear","Spiny Mouse","Starling","Stick Bug","Tarantula","Tit","Toad","Tortoise","Tyrant Flycatcher","Viper","Vulture","Waxwing","Xerus","Zebra"],grassland:["Aardvark","Aardwolf","Accentor","African Buffalo","African Wild Dog","Alpaca","Anaconda","Ant","Anteater","Antelope","Armadillo","Baboon","Badger","Bandicoot","Barbet","Bat","Bee","Bee-eater","Beetle","Bird","Bison","Black-footed Cat","Black-footed Ferret","Bluebird","Boa","Bowerbird","Brown Bear","Bush Dog","Bushshrike","Bustard","Butterfly","Buzzard","Caracal","Caracara","Cardinal","Caterpillar","Cheetah","Chipmunk","Civet","Climbing Mouse","Clouded Leopard","Coati","Cobra","Cockatoo","Cockroach","Common Genet","Cotton Rat","Cougar","Courser","Coyote","Crane","Crane Fly","Cricket","Crow","Culpeo","Death Adder","Deer","Deer Mouse","Dingo","Dinosaur","Dove","Drongo","Duck","Duiker","Dunnart","Eagle","Echidna","Elephant","Elk","Emu","Falcon","Finch","Flea","Fly","Flying Frog","Fox","Frog","Frogmouth","Garter Snake","Gazelle","Gecko","Geoffroy's Cat","Gerbil","Giant Tortoise","Giraffe","Grasshopper","Grison","Groundhog","Grouse","Guanaco","Guinea Pig","Hamster","Harrier","Hartebeest","Hawk","Hedgehog","Helmetshrike","Hippopotamus","Hornbill","Hyena","Hyrax","Impala","Jackal","Jaguar","Jaguarundi","Kangaroo","Kangaroo Rat","Kestrel","Kultarr","Ladybug","Leopard","Lion","Macaw","Meerkat","Mouse","Newt","Oryx","Ostrich","Owl","Pangolin","Pheasant","Prairie Dog","Pronghorn","Przewalski's Horse","Python","Quoll","Rabbit","Raven","Rhinoceros","Shelduck","Sloth Bear","Spectacled Bear","Squirrel","Starling","Stick Bug","Tamandua","Tasmanian Devil","Thornbill","Thrush","Toad","Tortoise"],forest:["Agouti","Anaconda","Anoa","Ant","Anteater","Antelope","Armadillo","Asian Black Bear","Aye-aye","Babirusa","Baboon","Badger","Bandicoot","Banteng","Barbet","Basilisk","Bat","Bearded Dragon","Bee","Bee-eater","Beetle","Bettong","Binturong","Bird-of-paradise","Bongo","Bowerbird","Bulbul","Bush Dog","Bushbaby","Bushshrike","Butterfly","Buzzard","Caecilian","Cardinal","Cassowary","Caterpillar","Centipede","Chameleon","Chimpanzee","Cicada","Civet","Clouded Leopard","Coati","Cobra","Cockatoo","Cockroach","Colugo","Cotinga","Cotton Rat","Cougar","Crane Fly","Cricket","Crocodile","Crow","Cuckoo","Cuscus","Death Adder","Deer","Dhole","Dingo","Dinosaur","Drongo","Duck","Duiker","Eagle","Echidna","Elephant","Finch","Flat-headed Cat","Flea","Flowerpecker","Fly","Flying Frog","Fossa","Frog","Frogmouth","Gaur","Gecko","Gorilla","Grison","Hawaiian Honeycreeper","Hawk","Hedgehog","Helmetshrike","Hornbill","Hyrax","Iguana","Jackal","Jaguar","Jaguarundi","Kestrel","Ladybug","Lemur","Leopard","Lion","Macaw","Mandrill","Margay","Monkey","Mouse","Mouse Deer","Newt","Okapi","Old World Flycatcher","Orangutan","Owl","Pangolin","Peafowl","Pheasant","Possum","Python","Quokka","Rabbit","Raccoon","Red Panda","Red River Hog","Rhinoceros","Sloth Bear","Spectacled Bear","Squirrel","Starling","Stick Bug","Sun Bear","Tamandua","Tamarin","Tapir","Tarantula","Thrush","Tiger","Tit","Toad","Tortoise","Toucan","Trogon","Trumpeter","Turaco","Turtle","Tyrant Flycatcher","Viper","Vulture","Wallaby","Warbler","Wasp","Waxwing","Weaver","Weaver-finch","Whistler","White-eye","Whydah","Woodswallow","Worm","Wren","Xenops","Yellowjacket","Accentor","African Buffalo","American Black Bear","Anole","Bird","Bison","Boa","Brown Bear","Chipmunk","Common Genet","Copperhead","Coyote","Deer Mouse","Dormouse","Elk","Emu","Fisher","Fox","Garter Snake","Giant Panda","Giant Tortoise","Groundhog","Grouse","Guanaco","Himalayan Tahr","Kangaroo","Koala","Numbat","Quoll","Raccoon dog","Tasmanian Devil","Thornbill","Turkey","Vole","Weasel","Wildcat","Wolf","Wombat","Woodchuck","Woodpecker"],farm:["Alpaca","Buffalo","Banteng","Cow","Cat","Chicken","Carp","Camel","Donkey","Dog","Duck","Emu","Goat","Gayal","Guinea","Goose","Horse","Honey","Llama","Pig","Pigeon","Rhea","Rabbit","Sheep","Silkworm","Turkey","Yak","Zebu"],pet:["Bearded Dragon","Birds","Burro","Cats","Chameleons","Chickens","Chinchillas","Chinese Water Dragon","Cows","Dogs","Donkey","Ducks","Ferrets","Fish","Geckos","Geese","Gerbils","Goats","Guinea Fowl","Guinea Pigs","Hamsters","Hedgehogs","Horses","Iguanas","Llamas","Lizards","Mice","Mule","Peafowl","Pigs and Hogs","Pigeons","Ponies","Pot Bellied Pig","Rabbits","Rats","Sheep","Skinks","Snakes","Stick Insects","Sugar Gliders","Tarantula","Turkeys","Turtles"],zoo:["Aardvark","African Wild Dog","Aldabra Tortoise","American Alligator","American Bison","Amur Tiger","Anaconda","Andean Condor","Asian Elephant","Baby Doll Sheep","Bald Eagle","Barred Owl","Blue Iguana","Boer Goat","California Sea Lion","Caribbean Flamingo","Chinchilla","Collared Lemur","Coquerel's Sifaka","Cuban Amazon Parrot","Ebony Langur","Fennec Fox","Fossa","Gelada","Giant Anteater","Giraffe","Gorilla","Grizzly Bear","Henkel's Leaf-tailed Gecko","Indian Gharial","Indian Rhinoceros","King Cobra","King Vulture","Komodo Dragon","Linne's Two-toed Sloth","Lion","Little Penguin","Madagascar Tree Boa","Magellanic Penguin","Malayan Tapir","Malayan Tiger","Matschies Tree Kangaroo","Mini Donkey","Monarch Butterfly","Nile crocodile","North American Porcupine","Nubian Ibex","Okapi","Poison Dart Frog","Polar Bear","Pygmy Marmoset","Radiated Tortoise","Red Panda","Red Ruffed Lemur","Ring-tailed Lemur","Ring-tailed Mongoose","Rock Hyrax","Small Clawed Asian Otter","Snow Leopard","Snowy Owl","Southern White-faced Owl","Southern White Rhinocerous","Squirrel Monkey","Tufted Puffin","White Cheeked Gibbon","White-throated Bee Eater","Zebra"]},primes:[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999,3001,3011,3019,3023,3037,3041,3049,3061,3067,3079,3083,3089,3109,3119,3121,3137,3163,3167,3169,3181,3187,3191,3203,3209,3217,3221,3229,3251,3253,3257,3259,3271,3299,3301,3307,3313,3319,3323,3329,3331,3343,3347,3359,3361,3371,3373,3389,3391,3407,3413,3433,3449,3457,3461,3463,3467,3469,3491,3499,3511,3517,3527,3529,3533,3539,3541,3547,3557,3559,3571,3581,3583,3593,3607,3613,3617,3623,3631,3637,3643,3659,3671,3673,3677,3691,3697,3701,3709,3719,3727,3733,3739,3761,3767,3769,3779,3793,3797,3803,3821,3823,3833,3847,3851,3853,3863,3877,3881,3889,3907,3911,3917,3919,3923,3929,3931,3943,3947,3967,3989,4001,4003,4007,4013,4019,4021,4027,4049,4051,4057,4073,4079,4091,4093,4099,4111,4127,4129,4133,4139,4153,4157,4159,4177,4201,4211,4217,4219,4229,4231,4241,4243,4253,4259,4261,4271,4273,4283,4289,4297,4327,4337,4339,4349,4357,4363,4373,4391,4397,4409,4421,4423,4441,4447,4451,4457,4463,4481,4483,4493,4507,4513,4517,4519,4523,4547,4549,4561,4567,4583,4591,4597,4603,4621,4637,4639,4643,4649,4651,4657,4663,4673,4679,4691,4703,4721,4723,4729,4733,4751,4759,4783,4787,4789,4793,4799,4801,4813,4817,4831,4861,4871,4877,4889,4903,4909,4919,4931,4933,4937,4943,4951,4957,4967,4969,4973,4987,4993,4999,5003,5009,5011,5021,5023,5039,5051,5059,5077,5081,5087,5099,5101,5107,5113,5119,5147,5153,5167,5171,5179,5189,5197,5209,5227,5231,5233,5237,5261,5273,5279,5281,5297,5303,5309,5323,5333,5347,5351,5381,5387,5393,5399,5407,5413,5417,5419,5431,5437,5441,5443,5449,5471,5477,5479,5483,5501,5503,5507,5519,5521,5527,5531,5557,5563,5569,5573,5581,5591,5623,5639,5641,5647,5651,5653,5657,5659,5669,5683,5689,5693,5701,5711,5717,5737,5741,5743,5749,5779,5783,5791,5801,5807,5813,5821,5827,5839,5843,5849,5851,5857,5861,5867,5869,5879,5881,5897,5903,5923,5927,5939,5953,5981,5987,6007,6011,6029,6037,6043,6047,6053,6067,6073,6079,6089,6091,6101,6113,6121,6131,6133,6143,6151,6163,6173,6197,6199,6203,6211,6217,6221,6229,6247,6257,6263,6269,6271,6277,6287,6299,6301,6311,6317,6323,6329,6337,6343,6353,6359,6361,6367,6373,6379,6389,6397,6421,6427,6449,6451,6469,6473,6481,6491,6521,6529,6547,6551,6553,6563,6569,6571,6577,6581,6599,6607,6619,6637,6653,6659,6661,6673,6679,6689,6691,6701,6703,6709,6719,6733,6737,6761,6763,6779,6781,6791,6793,6803,6823,6827,6829,6833,6841,6857,6863,6869,6871,6883,6899,6907,6911,6917,6947,6949,6959,6961,6967,6971,6977,6983,6991,6997,7001,7013,7019,7027,7039,7043,7057,7069,7079,7103,7109,7121,7127,7129,7151,7159,7177,7187,7193,7207,7211,7213,7219,7229,7237,7243,7247,7253,7283,7297,7307,7309,7321,7331,7333,7349,7351,7369,7393,7411,7417,7433,7451,7457,7459,7477,7481,7487,7489,7499,7507,7517,7523,7529,7537,7541,7547,7549,7559,7561,7573,7577,7583,7589,7591,7603,7607,7621,7639,7643,7649,7669,7673,7681,7687,7691,7699,7703,7717,7723,7727,7741,7753,7757,7759,7789,7793,7817,7823,7829,7841,7853,7867,7873,7877,7879,7883,7901,7907,7919,7927,7933,7937,7949,7951,7963,7993,8009,8011,8017,8039,8053,8059,8069,8081,8087,8089,8093,8101,8111,8117,8123,8147,8161,8167,8171,8179,8191,8209,8219,8221,8231,8233,8237,8243,8263,8269,8273,8287,8291,8293,8297,8311,8317,8329,8353,8363,8369,8377,8387,8389,8419,8423,8429,8431,8443,8447,8461,8467,8501,8513,8521,8527,8537,8539,8543,8563,8573,8581,8597,8599,8609,8623,8627,8629,8641,8647,8663,8669,8677,8681,8689,8693,8699,8707,8713,8719,8731,8737,8741,8747,8753,8761,8779,8783,8803,8807,8819,8821,8831,8837,8839,8849,8861,8863,8867,8887,8893,8923,8929,8933,8941,8951,8963,8969,8971,8999,9001,9007,9011,9013,9029,9041,9043,9049,9059,9067,9091,9103,9109,9127,9133,9137,9151,9157,9161,9173,9181,9187,9199,9203,9209,9221,9227,9239,9241,9257,9277,9281,9283,9293,9311,9319,9323,9337,9341,9343,9349,9371,9377,9391,9397,9403,9413,9419,9421,9431,9433,9437,9439,9461,9463,9467,9473,9479,9491,9497,9511,9521,9533,9539,9547,9551,9587,9601,9613,9619,9623,9629,9631,9643,9649,9661,9677,9679,9689,9697,9719,9721,9733,9739,9743,9749,9767,9769,9781,9787,9791,9803,9811,9817,9829,9833,9839,9851,9857,9859,9871,9883,9887,9901,9907,9923,9929,9931,9941,9949,9967,9973,10007],emotions:["love","joy","surprise","anger","sadness","fear"]},b=Object.prototype.hasOwnProperty,_=Object.keys||function(t){var e=[];for(var i in t)b.call(t,i)&&e.push(i);return e};function w(t,e){var i=Array.isArray(t),n=e||(i?new Array(t.length):{});return i?function(t,e){for(var i=0,n=t.length;i<n;i++)e[i]=t[i]}(t,n):function(t,e){for(var i,n=_(t),r=0,o=n.length;r<o;r++)e[i=n[r]]=t[i]||e[i]}(t,n),n}l.prototype.get=function(t){return w(v[t])},l.prototype.mac_address=function(t){(t=c(t)).separator||(t.separator=t.networkVersion?".":":");return t.networkVersion?this.n(this.string,3,{pool:"ABCDEF1234567890",length:4}).join(t.separator):this.n(this.string,6,{pool:"ABCDEF1234567890",length:2}).join(t.separator)},l.prototype.normal=function(t){if(d((t=c(t,{mean:0,dev:1,pool:[]})).pool.constructor!==Array,"Chance: The pool option must be a valid array."),d("number"!=typeof t.mean,"Chance: Mean (mean) must be a number"),d("number"!=typeof t.dev,"Chance: Standard deviation (dev) must be a number"),t.pool.length>0)return this.normal_pool(t);var e,i,n,r=t.mean,o=t.dev;do{e=(i=2*this.random()-1)*i+(n=2*this.random()-1)*n}while(e>=1);return o*(i*Math.sqrt(-2*Math.log(e)/e))+r},l.prototype.normal_pool=function(t){var e=0;do{var i=Math.round(this.normal({mean:t.mean,dev:t.dev}));if(i<t.pool.length&&i>=0)return t.pool[i];e++}while(e<100);throw new RangeError("Chance: Your pool is too small for the given mean and standard deviation. Please adjust.")},l.prototype.radio=function(t){var e="";switch((t=c(t,{side:"?"})).side.toLowerCase()){case"east":case"e":e="W";break;case"west":case"w":e="K";break;default:e=this.character({pool:"KW"})}return e+this.character({alpha:!0,casing:"upper"})+this.character({alpha:!0,casing:"upper"})+this.character({alpha:!0,casing:"upper"})},l.prototype.set=function(t,e){"string"==typeof t?v[t]=e:v=w(t,v)},l.prototype.tv=function(t){return this.radio(t)},l.prototype.cnpj=function(){var t=this.n(this.natural,8,{max:9}),e=2+6*t[7]+7*t[6]+8*t[5]+9*t[4]+2*t[3]+3*t[2]+4*t[1]+5*t[0];(e=11-e%11)>=10&&(e=0);var i=2*e+3+7*t[7]+8*t[6]+9*t[5]+2*t[4]+3*t[3]+4*t[2]+5*t[1]+6*t[0];return(i=11-i%11)>=10&&(i=0),""+t[0]+t[1]+"."+t[2]+t[3]+t[4]+"."+t[5]+t[6]+t[7]+"/0001-"+e+i},l.prototype.emotion=function(){return this.pick(this.get("emotions"))},l.prototype.mersenne_twister=function(t){return new x(t)},l.prototype.blueimp_md5=function(){return new C};var x=function(t){void 0===t&&(t=Math.floor(Math.random()*Math.pow(10,13))),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(t)};x.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++)t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30,this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0},x.prototype.init_by_array=function(t,e){var i,n,r=1,o=0;for(this.init_genrand(19650218),i=this.N>e?this.N:e;i;i--)n=this.mt[r-1]^this.mt[r-1]>>>30,this.mt[r]=(this.mt[r]^(1664525*((4294901760&n)>>>16)<<16)+1664525*(65535&n))+t[o]+o,this.mt[r]>>>=0,o++,++r>=this.N&&(this.mt[0]=this.mt[this.N-1],r=1),o>=e&&(o=0);for(i=this.N-1;i;i--)n=this.mt[r-1]^this.mt[r-1]>>>30,this.mt[r]=(this.mt[r]^(1566083941*((4294901760&n)>>>16)<<16)+1566083941*(65535&n))-r,this.mt[r]>>>=0,++r>=this.N&&(this.mt[0]=this.mt[this.N-1],r=1);this.mt[0]=2147483648},x.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var i;for(this.mti===this.N+1&&this.init_genrand(5489),i=0;i<this.N-this.M;i++)t=this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK,this.mt[i]=this.mt[i+this.M]^t>>>1^e[1&t];for(;i<this.N-1;i++)t=this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK,this.mt[i]=this.mt[i+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,(t^=t>>>18)>>>0},x.prototype.genrand_int31=function(){return this.genrand_int32()>>>1},x.prototype.genrand_real1=function(){return this.genrand_int32()*(1/4294967295)},x.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},x.prototype.genrand_real3=function(){return(this.genrand_int32()+.5)*(1/4294967296)},x.prototype.genrand_res53=function(){return(67108864*(this.genrand_int32()>>>5)+(this.genrand_int32()>>>6))*(1/9007199254740992)};var C=function(){};C.prototype.VERSION="1.0.1",C.prototype.safe_add=function(t,e){var i=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(i>>16)<<16|65535&i},C.prototype.bit_roll=function(t,e){return t<<e|t>>>32-e},C.prototype.md5_cmn=function(t,e,i,n,r,o){return this.safe_add(this.bit_roll(this.safe_add(this.safe_add(e,t),this.safe_add(n,o)),r),i)},C.prototype.md5_ff=function(t,e,i,n,r,o,a){return this.md5_cmn(e&i|~e&n,t,e,r,o,a)},C.prototype.md5_gg=function(t,e,i,n,r,o,a){return this.md5_cmn(e&n|i&~n,t,e,r,o,a)},C.prototype.md5_hh=function(t,e,i,n,r,o,a){return this.md5_cmn(e^i^n,t,e,r,o,a)},C.prototype.md5_ii=function(t,e,i,n,r,o,a){return this.md5_cmn(i^(e|~n),t,e,r,o,a)},C.prototype.binl_md5=function(t,e){t[e>>5]|=128<<e%32,t[14+(e+64>>>9<<4)]=e;var i,n,r,o,a,s=1732584193,h=-271733879,u=-1732584194,l=271733878;for(i=0;i<t.length;i+=16)n=s,r=h,o=u,a=l,s=this.md5_ff(s,h,u,l,t[i],7,-680876936),l=this.md5_ff(l,s,h,u,t[i+1],12,-389564586),u=this.md5_ff(u,l,s,h,t[i+2],17,606105819),h=this.md5_ff(h,u,l,s,t[i+3],22,-1044525330),s=this.md5_ff(s,h,u,l,t[i+4],7,-176418897),l=this.md5_ff(l,s,h,u,t[i+5],12,1200080426),u=this.md5_ff(u,l,s,h,t[i+6],17,-1473231341),h=this.md5_ff(h,u,l,s,t[i+7],22,-45705983),s=this.md5_ff(s,h,u,l,t[i+8],7,1770035416),l=this.md5_ff(l,s,h,u,t[i+9],12,-1958414417),u=this.md5_ff(u,l,s,h,t[i+10],17,-42063),h=this.md5_ff(h,u,l,s,t[i+11],22,-1990404162),s=this.md5_ff(s,h,u,l,t[i+12],7,1804603682),l=this.md5_ff(l,s,h,u,t[i+13],12,-40341101),u=this.md5_ff(u,l,s,h,t[i+14],17,-1502002290),h=this.md5_ff(h,u,l,s,t[i+15],22,1236535329),s=this.md5_gg(s,h,u,l,t[i+1],5,-165796510),l=this.md5_gg(l,s,h,u,t[i+6],9,-1069501632),u=this.md5_gg(u,l,s,h,t[i+11],14,643717713),h=this.md5_gg(h,u,l,s,t[i],20,-373897302),s=this.md5_gg(s,h,u,l,t[i+5],5,-701558691),l=this.md5_gg(l,s,h,u,t[i+10],9,38016083),u=this.md5_gg(u,l,s,h,t[i+15],14,-660478335),h=this.md5_gg(h,u,l,s,t[i+4],20,-405537848),s=this.md5_gg(s,h,u,l,t[i+9],5,568446438),l=this.md5_gg(l,s,h,u,t[i+14],9,-1019803690),u=this.md5_gg(u,l,s,h,t[i+3],14,-187363961),h=this.md5_gg(h,u,l,s,t[i+8],20,1163531501),s=this.md5_gg(s,h,u,l,t[i+13],5,-1444681467),l=this.md5_gg(l,s,h,u,t[i+2],9,-51403784),u=this.md5_gg(u,l,s,h,t[i+7],14,1735328473),h=this.md5_gg(h,u,l,s,t[i+12],20,-1926607734),s=this.md5_hh(s,h,u,l,t[i+5],4,-378558),l=this.md5_hh(l,s,h,u,t[i+8],11,-2022574463),u=this.md5_hh(u,l,s,h,t[i+11],16,1839030562),h=this.md5_hh(h,u,l,s,t[i+14],23,-35309556),s=this.md5_hh(s,h,u,l,t[i+1],4,-1530992060),l=this.md5_hh(l,s,h,u,t[i+4],11,1272893353),u=this.md5_hh(u,l,s,h,t[i+7],16,-155497632),h=this.md5_hh(h,u,l,s,t[i+10],23,-1094730640),s=this.md5_hh(s,h,u,l,t[i+13],4,681279174),l=this.md5_hh(l,s,h,u,t[i],11,-358537222),u=this.md5_hh(u,l,s,h,t[i+3],16,-722521979),h=this.md5_hh(h,u,l,s,t[i+6],23,76029189),s=this.md5_hh(s,h,u,l,t[i+9],4,-640364487),l=this.md5_hh(l,s,h,u,t[i+12],11,-421815835),u=this.md5_hh(u,l,s,h,t[i+15],16,530742520),h=this.md5_hh(h,u,l,s,t[i+2],23,-995338651),s=this.md5_ii(s,h,u,l,t[i],6,-198630844),l=this.md5_ii(l,s,h,u,t[i+7],10,1126891415),u=this.md5_ii(u,l,s,h,t[i+14],15,-1416354905),h=this.md5_ii(h,u,l,s,t[i+5],21,-57434055),s=this.md5_ii(s,h,u,l,t[i+12],6,1700485571),l=this.md5_ii(l,s,h,u,t[i+3],10,-1894986606),u=this.md5_ii(u,l,s,h,t[i+10],15,-1051523),h=this.md5_ii(h,u,l,s,t[i+1],21,-2054922799),s=this.md5_ii(s,h,u,l,t[i+8],6,1873313359),l=this.md5_ii(l,s,h,u,t[i+15],10,-30611744),u=this.md5_ii(u,l,s,h,t[i+6],15,-1560198380),h=this.md5_ii(h,u,l,s,t[i+13],21,1309151649),s=this.md5_ii(s,h,u,l,t[i+4],6,-145523070),l=this.md5_ii(l,s,h,u,t[i+11],10,-1120210379),u=this.md5_ii(u,l,s,h,t[i+2],15,718787259),h=this.md5_ii(h,u,l,s,t[i+9],21,-343485551),s=this.safe_add(s,n),h=this.safe_add(h,r),u=this.safe_add(u,o),l=this.safe_add(l,a);return[s,h,u,l]},C.prototype.binl2rstr=function(t){var e,i="";for(e=0;e<32*t.length;e+=8)i+=String.fromCharCode(t[e>>5]>>>e%32&255);return i},C.prototype.rstr2binl=function(t){var e,i=[];for(i[(t.length>>2)-1]=void 0,e=0;e<i.length;e+=1)i[e]=0;for(e=0;e<8*t.length;e+=8)i[e>>5]|=(255&t.charCodeAt(e/8))<<e%32;return i},C.prototype.rstr_md5=function(t){return this.binl2rstr(this.binl_md5(this.rstr2binl(t),8*t.length))},C.prototype.rstr_hmac_md5=function(t,e){var i,n,r=this.rstr2binl(t),o=[],a=[];for(o[15]=a[15]=void 0,r.length>16&&(r=this.binl_md5(r,8*t.length)),i=0;i<16;i+=1)o[i]=909522486^r[i],a[i]=1549556828^r[i];return n=this.binl_md5(o.concat(this.rstr2binl(e)),512+8*e.length),this.binl2rstr(this.binl_md5(a.concat(n),640))},C.prototype.rstr2hex=function(t){var e,i,n="";for(i=0;i<t.length;i+=1)e=t.charCodeAt(i),n+="0123456789abcdef".charAt(e>>>4&15)+"0123456789abcdef".charAt(15&e);return n},C.prototype.str2rstr_utf8=function(t){return unescape(encodeURIComponent(t))},C.prototype.raw_md5=function(t){return this.rstr_md5(this.str2rstr_utf8(t))},C.prototype.hex_md5=function(t){return this.rstr2hex(this.raw_md5(t))},C.prototype.raw_hmac_md5=function(t,e){return this.rstr_hmac_md5(this.str2rstr_utf8(t),this.str2rstr_utf8(e))},C.prototype.hex_hmac_md5=function(t,e){return this.rstr2hex(this.raw_hmac_md5(t,e))},C.prototype.md5=function(t,e,i){return e?i?this.raw_hmac_md5(e,t):this.hex_hmac_md5(e,t):i?this.raw_md5(t):this.hex_md5(t)},t.exports&&(e=t.exports=l),e.Chance=l,void 0===(n=function(){return l}.apply(e,[]))||(t.exports=n),"undefined"!=typeof importScripts&&(chance=new l,self.Chance=l),"object"==typeof window&&"object"==typeof window.document&&(window.Chance=l,window.chance=new l)}()}).call(this,i(436).Buffer)},,,,function(t,e,i){"use strict";i.d(e,"a",(function(){return Pillar}));var n=i(1),r=i(19),o=i(14);class Pillar extends o.a{constructor(){super(),this.add(r.a),this.body.width=9,this.body.height=80,this.body.depth=9,this.model=n.a.library.getEntity("pillar"),this.model.ry=Math.PI,this.model.y=.5*-this.body.height,this.addChild(this.model),this.removableOnCrash=!0}awake(){this.model&&this.addChild(this.model)}static factory(t,e,i){const n=t.game.pool.get(Pillar),r=e.components.Transform.position.x,o=e.components.Transform.position.z;n.body.z=t.z-o,n.body.x=r,n.body.bottom=0,i.offsetX&&(n.body.x=i.offsetX),i.flip&&(n.body.x*=-1),n.init(),t.game.addChild(n)}static match(t){return!!t.name.match(/pillar_group_place/)}static prepopulate(){n.a.game.pool.prepopulate(Pillar,8)}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Ramp}));var n=i(1),r=i(19),o=i(14);class Side extends o.a{constructor(){super(),this.add(r.a,{boxColor:7798784}),this.removableOnCrash=!0}reset(){this.body.deco=!1,this.body.box.size.reset(),this.body.box.center.reset()}}class Ramp extends o.a{constructor(){var t,e,i;super(),i=!0,(e="ramp")in(t=this)?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,this.add(r.a,{boxColor:5570560}),this.body.width=18,this.body.height=29,this.body.depth=70,this.removableOnCrash=!0,this.model=n.a.library.getEntity("train_ramp"),this.model.position.y=.5*-this.body.height,this.model.rotation.y=Math.PI,this.model.z=-8,this.addChild(this.model)}awake(t,e,i){const n=e.components.Transform.position.x,r=e.components.Transform.position.z;this.body.x=n,this.body.bottom=0,this.body.z=t.z-r+6,i.offsetX&&(this.body.x=i.offsetX),i.flip&&(this.body.x*=-1);const o=t.game.pool.get(Side);o.reset(),o.body.width=.2,o.body.height=this.body.height,o.body.depth=.7*this.body.depth,o.body.x=this.body.left,o.body.y=this.body.y,o.body.z=this.body.z,t.game.addChild(o);const a=t.game.pool.get(Side);a.reset(),a.body.width=.2,a.body.height=this.body.height,a.body.depth=.7*this.body.depth,a.body.x=this.body.right,a.body.y=this.body.y,a.body.z=this.body.z,t.game.addChild(a)}static match(t){return!!t.name.match(/train_ramp/)}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return StartBag}));var n=i(1),r=i(19),o=i(14);class StartBag extends o.a{constructor(){var t,e,i;super(),i=void 0,(e="model")in(t=this)?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,this.add(r.a,{deco:!0}),this.body.width=4,this.body.height=4,this.body.depth=4,this.model=n.a.library.getEntity("startScreen_bag_base",{map:"props-tex"}),this.model.ry=Math.PI,this.model.y=-1.3,this.addChild(this.model)}awake(t,e){this.body.x=e.components.Transform.position.x,this.body.bottom=0,this.body.z=t.z-e.components.Transform.position.z}static match(t){return!!t.name.match(/bag_place/)}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Train}));i(9);var n=i(1),r=i(13),o=i(19),a=i(144),s=i(14),h=i(64);function u(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Train extends s.a{constructor(){super(),u(this,"wagons",[]),u(this,"chunk",void 0),u(this,"modelName",""),this.add(o.a,{boxColor:16711680}),this.add(a.a,{speed:0}),this.body.width=18,this.body.height=29,this.body.depth=58,this.body.deco=!0,this.removableOnCrash=!0}build(){!this.model&&n.a.library.hasGeometry(this.modelName)&&(this.model=n.a.library.getEntity(this.modelName),this.model.y=.5*-this.body.height,this.model.ry=Math.PI,this.body.deco=!1,this.addChild(this.model))}awake(){this.build()}reset(){this.model||this.body.velocity.reset()}clean(t){let e=this.wagons.length;for(;e--;){const i=this.wagons[e];t.game.pool.return(i),this.removeChild(i)}}static match(t){return!!t.name.match(/trains_(\d)_/)||!!t.name.match(/train_sub_(\d)_/)}static factory(t,e,i){let o=TrainSub;e.name.match("sub")?o=TrainSub:e.name.match("cargo")?o=n.a.library.hasGeometry("train_sub")?TrainCargo:TrainSub:e.name.match("standard")?o=n.a.library.hasGeometry("train_standard")?TrainStandard:TrainSub:n.a.library.hasGeometry("train_standard")&&(o=r.a.pick(...l));const a=t.name.match("intro")?"z":"back",s=e.name.match(/_(\d)_/),u=s?parseInt(s[1],10):0,c=e.name.match(/coins/),d=60*u;let p=u,f=0,m=Number.NEGATIVE_INFINITY,g=0,y=null;for(;p--;){var v,b,_;y=t.game.pool.get(o),y.chunk=t,g=(null===(v=e.components)||void 0===v||null===(b=v.MovingTrainPlaceholder)||void 0===b?void 0:b._speed)||0;const n=e.components.Transform.position.x,r=e.components.Transform.position.z,s=60*p;y.body.x=null!==i.offsetX?i.offsetX:n,y.body.bottom=0;const h=t.z-r-s;y.body[a]=h,f||(f=y.body[a]+.6*d+30),i.flip&&(y.body.x*=-1),null===(_=y.movable)||void 0===_||_.run(g,f),t.game.addChild(y),y.body.back>m&&(m=y.body.back)}if(c&&y){const n=Math.ceil(1.1*u),r=30,o=m-50;for(let a=0;a<n;a++){const n=h.a.spawn(t,e,i);n.body.x=y.body.x,n.body.bottom=29,n.body.z=o-a*r,n.movable.run(g,f)}}}static prepopulate(){n.a.game.pool.prepopulate(TrainStandard,10),n.a.game.pool.prepopulate(TrainCargo,10),n.a.game.pool.prepopulate(TrainSub,10)}}class TrainStandard extends Train{constructor(){super(),this.modelName="train_standard",this.build()}}class TrainCargo extends Train{constructor(){super(),this.modelName="train_cargo",this.build()}}class TrainSub extends Train{constructor(){super(),this.modelName="train_sub",this.build()}}const l=[TrainStandard,TrainCargo,TrainSub]},function(t,e,i){"use strict";i.d(e,"a",(function(){return Trigger}));var n=i(17),r=i(19),o=i(14);function a(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Trigger extends o.a{constructor(){super(),a(this,"tutorialTrigger",!0),a(this,"type",""),this.tutorialTrigger=!0,this.add(r.a),this.body.width=60,this.body.height=30,this.body.depth=1,this.body.trigger=!0,this.view=n.a.box(this.body.box)}awake(t,e){this.type=e.name.split("_").pop()||""}static match(t){return!!t.name.match(/Trigger_/)}}a(Trigger,"factory",(t,e,i)=>{const n=t.game.pool.get(Trigger),r=e.components.Transform.position.x,o=e.components.Transform.position.z;n.body.z=t.z-o,n.body.x=r,n.body.bottom=0,i.offsetX&&(n.body.x=i.offsetX),i.flip&&(n.body.x*=-1),n.awake(t,e),t.game.addChild(n)})},,,,,,,,,,,,,,function(t,e,i){"use strict";i.d(e,"a",(function(){return CameraSystem}));var n=i(32),r=i(2),o=i(10),a=i(13),s=i(31);function h(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class CameraRig extends n.a{constructor(t){super(),h(this,"camera",void 0),h(this,"levels",["_idle","_idleRotY","_idleRotX","_main","_mainRotY","_mainRotX","_tunnel"]),h(this,"_idle",void 0),h(this,"_idleRotY",void 0),h(this,"_idleRotX",void 0),h(this,"_main",void 0),h(this,"_mainRotY",void 0),h(this,"_mainRotX",void 0),h(this,"_tunnel",void 0),h(this,"_fov",1),this.camera=t,this.levels=["_idle","_idleRotY","_idleRotX","_main","_mainRotY","_mainRotX","_tunnel"];let e=this;for(const i in this.levels){const r=new n.a;this[this.levels[i]]=r,e.addChild(r),e=r,t&&r.addChild(t)}}reset(){for(const t in this.levels)this.resetLevel(this.levels[t])}resetLevel(t){const e=this[t];e.x=0,e.y=0,e.z=0,e.rx=0,e.ry=0}resetIdle(){this.resetLevel("_idle")}get fov(){return this._fov}set fov(t){this._fov=t,this.camera.camera.fov=t*(Math.PI/180)}get idleX(){return this._idle.x}set idleX(t){this._idle.x=t}get idleY(){return this._idle.y}set idleY(t){this._idle.y=t}get idleZ(){return this._idle.z}set idleZ(t){this._idle.z=t}get idleRotX(){return this._idleRotX.rx}set idleRotX(t){this._idleRotX.rx=t}get idleRotY(){return this._idleRotY.ry}set idleRotY(t){this._idleRotY.ry=t}get mainX(){return this._main.x}set mainX(t){this._main.x=t}get mainY(){return this._main.y}set mainY(t){this._main.y=t}get mainZ(){return this._main.z}set mainZ(t){this._main.z=t}get mainRotX(){return this._mainRotX.rx}set mainRotX(t){this._mainRotX.rx=t}get mainRotY(){return this._mainRotY.ry}set mainRotY(t){this._mainRotY.ry=t}}class CameraSystem extends s.a{constructor(t){super(t),h(this,"running",!0),h(this,"tunnel",!1),h(this,"rig",void 0),h(this,"suspend",!1),h(this,"_shakePower",0),h(this,"_controlled",!1),h(this,"_animating",!1),h(this,"_profile",void 0),h(this,"_animStart",{}),h(this,"_animEnd",{}),h(this,"_animCurve",void 0),h(this,"_animTime",0),this.game.onIdle.add(this),this.game.onRun.add(this),this.game.onEnterTunnel.add(this),this.game.onExitTunnel.add(this)}get mainCamera(){return this.game.view3d.camera}idle(){this.rig&&this.rig.reset(),this.running=!1,this._shakePower=0,this.tunnel=!1}run(){this.rig&&this.rig.resetLevel("_tunnel"),this.running=!0,this.tunnel=!1}enterTunnel(){this.tunnel=!0}exitTunnel(){this.tunnel=!1}setup(){this.rig||(this.rig=new CameraRig(this.game.view3d.camera),this.game.addChild(this.rig),this.game.view3d.camera.x=0,this.game.view3d.camera.y=0,this.game.view3d.camera.z=0,this.game.view3d.camera.rx=0,this.game.view3d.camera.ry=0,this.game.view3d.camera.rz=0,this.game.view3d.camera.camera.near=3,this.game.view3d.camera.camera.far=1e3)}update(t){const e=t.frameTime;this.suspend||(this.rig||this.setup(),this.running?this.updateRunning(e):this.updateIdle(e))}updateIdle(t){this._controlled||(this.rig.idleX=-21.94232,this.rig.idleY=-13.06444,this.rig.idleZ=11.95625,this.rig.idleRotX=16.37991*o.a.DEG_TO_RAD,this.rig.idleRotY=59.09998*o.a.DEG_TO_RAD,this.rig.idleRotY+=.001,this.rig.idleX=-25,this.rig.idleY=-13.06444,this.rig.idleZ=15,this.rig.idleRotX=16.37991*o.a.DEG_TO_RAD,this.rig.idleRotY=77*o.a.DEG_TO_RAD,this.rig.idleRotY+=.001,this.rig.mainX=0,this.rig.mainY=r.a.cameraPosY,this.rig.mainZ=r.a.cameraPosZ,this.rig.mainRotX=r.a.cameraRotX,this.rig.mainRotY=0,this.rig.fov=71.99513)}updateRunning(t){if(this.rig){if(this._animating&&this.updateAnimation(t),!this._controlled){this.rig.idleX=0,this.rig.idleY=0,this.rig.idleZ=0,this.rig.idleRotX=0,this.rig.idleRotY=0;const e=this.game.stats.x*r.a.cameraModX;this.rig.mainX=o.a.lerp(this.rig.mainX,e,.3*t);const i=this.game.hero.player.cameraY+r.a.cameraPosY;this.rig.mainY=o.a.lerp(this.rig.mainY,i,.3*t),this.rig.mainZ=this.game.stats.z+r.a.cameraPosZ,this.rig.mainRotX=o.a.lerp(this.rig.mainRotX,r.a.cameraRotX,.1*t),this.rig.mainRotY=0,this.rig.fov=r.a.cameraFov}this.updateTunnel(t),this.updateShake(t)}}updateTunnel(t){const e=this.tunnel,i=this.rig._tunnel;if(!e&&0===i.rx&&0===this.rig.y)return;const n=-4.621953*o.a.DEG_TO_RAD,a=e?r.a.cameraPosY-18.30177:0,s=e?r.a.cameraRotX-n:0,h=.25*this.game.stats.speed+.75;i.y=o.a.smoothDamp(i.y,-a,0,.2,1.2*h,t),i.rx=o.a.smoothDamp(i.rx,-s,0,.05,.1*h,t)}updateShake(t){const e=this.rig;(this._shakePower||0!==e.x||0!==this.rig.y)&&(e.y=a.a.range(-this._shakePower,this._shakePower),e.x=a.a.range(-this._shakePower,this._shakePower),this._shakePower-=.5*t,this._shakePower<0&&(this._shakePower=0))}get profile(){return this._profile||(this._profile={}),this.rig?(this._profile.idleX=this.rig.idleX,this._profile.idleY=this.rig.idleY,this._profile.idleZ=this.rig.idleZ,this._profile.idleRotX=this.rig.idleRotX,this._profile.idleRotY=this.rig.idleRotY,this._profile.mainX=this.rig.mainX,this._profile.mainY=this.rig.mainY,this._profile.mainZ=this.rig.mainZ,this._profile.mainRotX=this.rig.mainRotX,this._profile.mainRotY=this.rig.mainRotY,this._profile.fov=this.game.view3d.camera.camera.fov,this._profile.near=this.game.view3d.camera.camera.near,this._profile.far=this.game.view3d.camera.camera.far,this._profile):this._profile}takeControl(){return this._controlled=!0,this.rig}releaseControl(){this._controlled=!1}shake(t){this._shakePower=t}animate(t,e,i){this._controlled=!0,this._animating=!0,this._animStart||(this._animStart={}),this._animEnd||(this._animEnd={}),this._animCurve=i,this._animTime=e;for(const e in t)this._animStart[e]=this.rig[e],this._animEnd[e]=t[e]}updateAnimation(t){}animateEnd(){this._controlled=!1,this._animating=!1}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return ControllerSystem}));var n=i(39),r=i(0),o=i(28),a=i(255),s=i(10),h=i(31);function u(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class ControllerSystem extends h.a{constructor(t){super(t),u(this,"keyboard",void 0),u(this,"view",void 0),u(this,"vertical",0),u(this,"horizontal",0),u(this,"action",0),u(this,"pressing",!1),u(this,"pressStartX",0),u(this,"pressStartY",0),u(this,"tapCount",0),u(this,"tapTimeout",void 0),u(this,"onSwipeHorizontal",void 0),u(this,"onSwipeVertical",void 0),u(this,"onDoubleTap",void 0),this.keyboard=new a.a,this.keyboard.bindKeyDown("left",this.pressLeft.bind(this)),this.keyboard.bindKeyDown("up",this.pressUp.bind(this)),this.keyboard.bindKeyDown("right",this.pressRight.bind(this)),this.keyboard.bindKeyDown("down",this.pressDown.bind(this)),this.keyboard.bindKeyDown("a",this.pressLeft.bind(this)),this.keyboard.bindKeyDown("w",this.pressUp.bind(this)),this.keyboard.bindKeyDown("d",this.pressRight.bind(this)),this.keyboard.bindKeyDown("s",this.pressDown.bind(this)),this.keyboard.bindKeyDown("space",this.pressAction.bind(this)),this.keyboard.enabled=!1,this.view=r.Sprite.from(r.Texture.WHITE),this.view.alpha=0,this.view.width=this.view.height=9999,this.view.on("pointerdown",this.onPointerDown,this),this.view.on("pointermove",this.onPointerMove,this),this.view.on("pointerup",this.onPointerUp,this);this.game.onReset.add(this),this.game.onRun.add(this),this.game.onPause.add(this),this.game.onResume.add(this),this.game.onGameover.add(this),this.game.onRevive.add(this),this.vertical=0,this.horizontal=0,this.action=0,this.pressing=!1,this.pressStartX=0,this.pressStartY=0,this.tapCount=0,this.onSwipeHorizontal=new n.a("onSwipeHorizontal",1),this.onSwipeVertical=new n.a("onSwipeVertical",1),this.onDoubleTap=new n.a("onDoubleTap")}onPointerDown(t){const e=t.data.global;this.doubleTapUpdate(),this.pressStartX=e.x,this.pressStartY=e.y,this.pressing=!0}onPointerMove(t){if(!this.pressing)return;const e=t.data.global,i=e.x-this.pressStartX,n=e.y-this.pressStartY;return Math.abs(i)>60?(this.pressing=!1,this.doubleTapReset(),void(this.horizontal=s.a.sign(i))):Math.abs(n)>60?(this.pressing=!1,this.doubleTapReset(),void(this.vertical=-s.a.sign(n))):void 0}onPointerUp(){this.pressing=!1}onPointerCancel(){this.pressing=!1}pressUp(t){t.preventDefault(),this.vertical=1}pressDown(t){t.preventDefault(),this.vertical=-1}pressLeft(t){t.preventDefault(),this.horizontal=-1}pressRight(t){t.preventDefault(),this.horizontal=1}pressAction(t){this.game.state===o.a.RUNNING&&(t.preventDefault(),this.action=1)}update(){this.game.state===o.a.RUNNING&&(1===this.vertical||-1===this.vertical?this.onSwipeVertical.dispatch(this.vertical):this.horizontal?this.onSwipeHorizontal.dispatch(this.horizontal):this.action&&this.onDoubleTap.dispatch()),this.vertical=0,this.horizontal=0,this.action=0}reset(){this.hide()}show(){this.doubleTapReset(),this.tapCount=0,this.vertical=0,this.horizontal=0,this.action=0,this.view.visible=!0,this.view.interactive=!0,this.game.stage.addChild(this.view),this.keyboard.enabled=!0}hide(){this.doubleTapReset(),this.tapCount=0,this.vertical=0,this.horizontal=0,this.action=0,this.view.visible=!1,this.view.interactive=!1,this.keyboard.enabled=!1,this.view.parent&&this.view.parent.addChild(this.view)}run(){this.show()}revive(){this.hide()}pause(){this.hide()}resume(){this.show()}gameover(){this.hide()}resize(t,e){this.view.x=0,this.view.y=0,this.view.width=t,this.view.height=e}doubleTapUpdate(){this.tapCount>0&&this.game.state===o.a.RUNNING&&(this.action=1),this.tapCount+=1,this.tapTimeout&&clearTimeout(this.tapTimeout),this.tapTimeout=setTimeout(()=>{this.tapCount=0},300)}doubleTapReset(){this.tapTimeout&&clearTimeout(this.tapTimeout),this.tapTimeout=void 0,this.tapCount=0,this.action=0}}},,function(t,e,i){"use strict";i.d(e,"a",(function(){return CullingSystem}));var n=i(2);function r(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class CullingSystem{constructor(t){r(this,"scene",void 0),r(this,"game",void 0),this.game=t.scene}cull(t){return n.a.blocks?t:t.filter(t=>{const e=t.view3d.getBoundingSphere(),i=this.game.stats.z-e.center.z,n=200*e.radius;return i>=-60-n&&i<750+n})}}r(CullingSystem,"DEFAULT_NAME","culling")},function(t,e,i){"use strict";i.d(e,"a",(function(){return HudSystem}));i(9);var n=i(6),r=i(0),o=i(28),a=i(2),s=i(1),h=i(258),u=i(106),l=i(259),c=i(187),d=i(260),p=i(156),f=i(261),m=i(262),g=i(291),y=i(263),v=i(264),b=i(52),_=i(31);function w(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class HudSystem extends _.a{constructor(t){super(t),w(this,"view",void 0),w(this,"_built",!1),w(this,"paused",void 0),w(this,"btnPause",void 0),w(this,"distance",void 0),w(this,"coins",void 0),w(this,"multiplier",void 0),w(this,"countdown",void 0),w(this,"timers",void 0),w(this,"boosts",void 0),w(this,"ranking",void 0),w(this,"message",void 0),w(this,"stats",void 0),w(this,"timersList",{}),w(this,"boostsList",{}),w(this,"w",0),w(this,"h",0),w(this,"updateCount",0),w(this,"boostGauge",void 0),w(this,"wordDropDownPanel",void 0),w(this,"missionDropDownPanel",void 0),this.view=new r.Container,this.view.visible=!1,this.game.onReset.add(this),this.game.onIdle.add(this),this.game.onRun.add(this),this.game.onPause.add(this),this.game.onResume.add(this),this.game.onGameover.add(this),this.game.onRevive.add(this),this.updateCount=1}build(){this._built||(this._built=!0,this.paused=new g.a(()=>this.onBtnPausePress()),this.distance=new c.a({base:"base-long.png"}),this.view.addChild(this.distance),this.coins=new c.a({base:"base-long.png",icon:"icon-coin-large.png"}),this.view.addChild(this.coins),this.multiplier=new d.a(this.game),this.view.addChild(this.multiplier),this.countdown=new l.a("start_countdown"),this.view.addChild(this.countdown),this.timers=new r.Container,this.view.addChild(this.timers),this.boosts=new r.Container,this.view.addChild(this.boosts),this.boostGauge=new h.a,this.view.addChild(this.boostGauge),this.wordDropDownPanel=this.view.addChild(new v.a),this.missionDropDownPanel=this.view.addChild(new m.a),this.btnPause=new u.a({icon:"icon-pause.png",key:"Escape"}),this.btnPause.onTap=this.onBtnPausePress.bind(this),this.view.addChild(this.btnPause),"realtime"===a.a.leaderboard&&(this.ranking=new y.a,this.view.addChild(this.ranking)),this.view.visible=!1,this.resize(),s.a.resize.onResize.connect(()=>{this.game.pause(),this.resize()}))}update(){if(this.game.state!==o.a.RUNNING||!this._built)return;if(this.multiplier.update(),this.updateCount+=1,480===this.updateCount&&this.removeAllItemBoost(!0),this.updateCount%4>0)return;const t=this.game.stats;this.distance.getText()<=t.score&&this.distance.setText(t.score,6),this.coins.setText(t.coins),this.multiplier.text="x"+(t.multiplier+t.missionMultiplier),this.ranking&&this.ranking.update()}reset(){this.paused&&this.paused.close(),this.close(),this.message&&(this.message.text=""),this.updateCount=1,this.removeAllItemBoost()}idle(){this.paused&&this.paused.close(),this.close(),this.message&&(this.message.text=""),this.updateCount=1,this.removeAllItemBoost()}async run(){await Object(b.a)(.2),this.build(),this.boostGauge&&this.boostGauge.lowlightAll(),this.ranking&&this.ranking.clear(),this.updateCount=1,this.distance.setText(this.game.stats.score,6),this.open(),s.a.ui.mainLayer.addChild(this.view),s.a.ui.mainLayer.addChild(this.paused),this.message&&(this.message.text=""),this.paused.close(),s.a.user.boosts.consumables.headstart>0&&this.addItemBoost(p.b.HEADSTART,!0),s.a.user.boosts.consumables.scoreBooster>0&&this.addItemBoost(p.b.MULTIPLIER,!0),this.organizeBoosts(!1)}pause(){this.clearCountdown(),this.close(),this.paused.open()}resume(){this.open(),this.clearCountdown(),this.paused.close()}gameover(){this.close(),this.paused.close()}revive(){this.open(),this.paused.close()}open(){this.build(),this.view.visible=!0}close(){this.view.visible=!1}resize(){this.w=s.a.ui.viewportWidth,this.h=s.a.ui.viewportHeight,this._built&&(this.distance.x=this.w-110,this.distance.y=60,this.coins.x=this.w-170,this.coins.y=160,this.countdown.x=this.w/2,this.countdown.y=this.h/2,this.multiplier.x=this.distance.x-170,this.multiplier.y=this.distance.y,this.ranking&&(this.ranking.x=this.w,this.ranking.y=250),this.message&&(this.message.x=this.w/2,this.message.y=120),this.stats&&(this.stats.x=10,this.stats.y=200),this.timers&&(this.timers.x=0,this.timers.y=this.h),this.boosts&&(this.boosts.x=0,this.boosts.y=this.h),this.boostGauge&&(this.boostGauge.x=this.w/2,this.boostGauge.y=300),this.wordDropDownPanel&&(this.wordDropDownPanel.x=this.w/2),this.missionDropDownPanel&&(this.missionDropDownPanel.x=this.w/2),this.btnPause.x=60,this.btnPause.y=60)}runCountdown(t,e){this.paused.close(),this.clearCountdown(),this.open(),this.view.addChild(this.countdown),this.countdown.run(t,()=>{e(),this.btnPause.onTap=this.onBtnPausePress.bind(this)})}clearCountdown(){this.paused.close(),this.countdown.stop()}addItemTimer(t){this.timersList[t]||(this.timersList[t]=new f.a(this.game,t));const e=this.timersList[t];return this.timers.addChild(e),e.show(),this.organiseItems(),e}removeItemTimer(t){const e=this.timersList[t];e&&(e.hide(),this.organiseItems())}addItemBoost(t,e=!1){this.boostsList[t]||(this.boostsList[t]=new p.a(t));const i=this.boostsList[t];return this.boosts.addChild(i),i.show(e,this.boosts.children.length),this.organiseItems(e),i}async removeItemBoost(t,e=!1){const i=this.boostsList[t];i&&(await i.hide(e),this.organiseItems(e))}async removeAllItemBoost(t=!1){const e=[];for(const i in this.boostsList){const n=this.boostsList[i];e.push(n.hide(t))}await Promise.all(e),this.organiseItems(t)}updateItemTimer(t,e){const i=this.timersList[t];i&&(i.ratio=e)}organiseItems(t=!1){this.organizeTimers(),this.organizeBoosts(t)}organizeTimers(){if(!this.timers)return;let t=this.timers.children.length;for(;t--;){const e=this.timers.children[t];e.x=e.w/2+20,e.y=-t*(e.h+20)-e.h/2-20}this.timers.x=0,this.timers.y=this.h}organizeBoosts(t=!1){var e,i;if(!this.boosts)return;const r=t?.2:0,o=null!==(e=this.timers)&&void 0!==e&&e.height?(null===(i=this.timers)||void 0===i?void 0:i.height)+20:0;let a=this.boosts.children.length;for(;a--;){const t=this.boosts.children[a];t.x=t.w/2+20;const e=-a*(t.h+20)-t.h/2-20-o;n.g.killTweensOf(t),n.g.to(t,r,{y:e})}this.boosts.x=0,this.boosts.y=this.h}onBtnPausePress(){this.game.state===o.a.PAUSED?(this.btnPause.onTap=null,this.game.resume(3)):this.game.pause()}}},,,,,,,,function(t,e,i){"use strict";i.d(e,"a",(function(){return IntroSystem}));var n=i(39),r=i(2),o=i(47),a=i(10),s=i(31);function h(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class CameraPos{constructor(t){h(this,"idleX",0),h(this,"idleY",0),h(this,"idleZ",0),h(this,"idleRotX",0),h(this,"idleRotY",0),h(this,"mainX",0),h(this,"mainY",0),h(this,"mainZ",0),h(this,"mainRotX",0),h(this,"mainRotY",0),h(this,"fov",60),t&&this.copy(t)}copy(t){this.idleX=t.idleX,this.idleY=t.idleY,this.idleZ=t.idleZ,this.idleRotX=t.idleRotX,this.idleRotY=t.idleRotY,this.mainX=t.mainX,this.mainY=t.mainY,this.mainZ=t.mainZ,this.mainRotX=t.mainRotX,this.mainRotY=t.mainRotY,this.fov=t.fov}}class CameraAnim{constructor(t,e,i=1){h(this,"name",""),h(this,"rig",void 0),h(this,"from",void 0),h(this,"to",void 0),h(this,"curve",void 0),h(this,"time",0),h(this,"duration",0),h(this,"next",null),h(this,"playing",!1),this.name=t,this.rig=e,this.from=new CameraPos(this.rig),this.to=new CameraPos(this.rig),this.curve=o.a.linear,this.time=0,this.duration=i,this.next=null}play(){this.playing=!0,this.time=0,this.from=new CameraPos(this.rig)}update(t){if(!this.playing)return;this.time+=t,this.time>=this.duration&&(this.time=this.duration);const e=this.curve?this.curve(this.ratio):this.ratio;this.rig.idleX=a.a.lerp(this.from.idleX,this.to.idleX,e),this.rig.idleY=a.a.lerp(this.from.idleY,this.to.idleY,e),this.rig.idleZ=a.a.lerp(this.from.idleZ,this.to.idleZ,e),this.rig.idleRotX=a.a.lerp(this.from.idleRotX,this.to.idleRotX,e),this.rig.idleRotY=a.a.lerp(this.from.idleRotY,this.to.idleRotY,e),this.rig.mainX=a.a.lerp(this.from.mainX,this.to.mainX,e),this.rig.mainY=a.a.lerp(this.from.mainY,this.to.mainY,e),this.rig.mainZ=a.a.lerp(this.from.mainZ,this.to.mainZ,e),this.rig.mainRotX=a.a.lerp(this.from.mainRotX,this.to.mainRotX,e),this.rig.mainRotY=a.a.lerp(this.from.mainRotY,this.to.mainRotY,e),this.rig.fov=a.a.lerp(this.from.fov,this.to.fov,e),this.time>=this.duration&&this.complete()}complete(){this.playing=!1,this.time=this.duration,this.next&&this.next.play()}get ratio(){return this.time/this.duration}set ratio(t){this.time=this.duration*a.a.clamp(t)}}class IntroSystem extends s.a{constructor(t){super(t),h(this,"time",0),h(this,"duration",60),h(this,"playing",!1),h(this,"onIntroComplete",void 0),h(this,"step1",void 0),h(this,"step2",void 0),h(this,"step3",void 0),this.onIntroComplete=new n.a("onIntroComplete"),this.time=0,this.duration=60,this.playing=!1}update(t){const e=t.frameTime;this.playing&&(this.step1&&this.step1.update(e),this.step2&&this.step2.update(e),this.step3&&this.step3.update(e))}preupdate(){if(!this.playing)return;const t=this.game.delta;this.time+=t,this.time>=this.duration&&(this.time=this.duration),this.time>=this.duration&&this.complete()}play(){this.playing=!0,this.game.camera.takeControl(),this.game.camera.updateIdle(0),this.time=0,this.step1=new CameraAnim("step1",this.game.camera.rig,.4*this.duration),this.step1.to.idleX=-16.49361,this.step1.to.idleY=-8.666094,this.step1.to.idleZ=12.52404,this.step1.to.idleRotX=23.52661*a.a.DEG_TO_RAD,this.step1.to.idleRotY=55.26425*a.a.DEG_TO_RAD,this.step1.to.mainX=0,this.step1.to.mainY=r.a.cameraPosY,this.step1.to.mainZ=r.a.cameraPosZ,this.step1.to.mainRotX=r.a.cameraRotX,this.step1.to.mainRotY=0,this.step1.curve=o.a.sineInOut,this.step2=new CameraAnim("step2",this.game.camera.rig,.2*this.duration),this.step2.to.idleX=-16.49361,this.step2.to.idleY=-8.666094,this.step2.to.idleZ=12.52404,this.step2.to.idleRotX=23.30551*a.a.DEG_TO_RAD,this.step2.to.idleRotY=55.47934*a.a.DEG_TO_RAD,this.step2.to.mainX=0,this.step2.to.mainY=r.a.cameraPosY,this.step2.to.mainZ=r.a.cameraPosZ,this.step2.to.mainRotX=r.a.cameraRotX,this.step2.to.mainRotY=0,this.step3=new CameraAnim("step3",this.game.camera.rig,.4*this.duration),this.step3.to.idleX=0,this.step3.to.idleY=0,this.step3.to.idleZ=0,this.step3.to.idleRotX=0,this.step3.to.idleRotY=0,this.step3.to.mainX=0,this.step3.to.mainY=r.a.cameraPosY,this.step3.to.mainZ=r.a.cameraPosZ,this.step3.to.mainRotX=r.a.cameraRotX,this.step3.to.mainRotY=0,this.step3.to.fov=r.a.cameraFov,this.step3.curve=o.a.sineIn,this.step1.next=this.step2,this.step2.next=this.step3,this.step1.play()}complete(){this.playing=!1,this.game.camera.releaseControl(),this.onIntroComplete.dispatch(),this.game.runFromIntro()}get ratio(){return this.time/this.duration}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return LeaderboardSystem}));var n=i(31);class LeaderboardSystem extends n.a{constructor(t){super(t),this.game.onGameover.add(this)}gameover(){}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return LevelSystem}));i(9);var n=i(110),r=i(39),o=i(28),a=i(2),s=i(13),h=i(268),u=i(55),l=i(31);function c(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class LevelSystem extends l.a{constructor(t){super(t),c(this,"entities",void 0),c(this,"chunks",void 0),c(this,"currentChunk",null),c(this,"sequence",void 0),c(this,"queued",void 0),c(this,"nextPosition",0),c(this,"onEnterChunk",void 0),c(this,"onExitChunk",void 0),c(this,"onEnterTutorial",void 0),c(this,"onExitTutorial",void 0),c(this,"preUpdateCount",10),c(this,"postUpdateCount",0),c(this,"chunkPool",void 0),this.chunkPool=new n.a(h.a),this.entities=[],this.chunks=[],this.currentChunk=null,this.game.onReset.add({reset:this.reset.bind(this)}),this.sequence=[],this.queued=[],this.onEnterChunk=new r.a("onEnterChunk",1),this.onExitChunk=new r.a("onExitChunk",1),this.onEnterTutorial=new r.a("onEnterTutorial"),this.onExitTutorial=new r.a("onExitTutorial")}reset(){if(!(this.currentChunk&&this.currentChunk.name.indexOf("intro")>=0)){this.game.physics.cleanup();for(const t of this.chunks)t.reset(),this.chunkPool.return(t);this.chunks=[],this.sequence=[],this.queued=[],this.nextPosition=0,this.preUpdateCount=10,this.postUpdateCount=0,this.removeAllEntities(),this.queueChunk("intro")}}isLevelEntity(t){return!!t.levelEntity}entityAddedToScene(t){if(!this.isLevelEntity(t))return;this.entities.indexOf(t)>=0||this._addEntity(t)}entityRemovedFromScene(t){if(!this.isLevelEntity(t))return;this.entities.indexOf(t)<0||this._removeEntity(t)}_addEntity(t){this.isLevelEntity(t)&&(this.entities.push(t),t.sendMessage("respawn"))}_removeEntity(t,e){const i=t;this.isLevelEntity(i)&&(void 0===e&&(e=this.entities.indexOf(i)),e<0||(i.z=99999,i.body&&(i.body.z=i.z),this.entities.splice(e,1),this.game.removeChild(i),this.game.pool.return(t)))}preupdate(){this.preUpdateCount--||(this.preUpdateCount=20,this.removeObsoleteEntities())}postupdate(){if(this.postUpdateCount--)return;this.postUpdateCount=20;const t=this.chunks[this.game.stats.chunkIndex];t!==this.currentChunk&&(this.currentChunk&&(this.isTutorial()&&this.onExitTutorial.dispatch(),this.onExitChunk.dispatch(this.currentChunk.name)),this.currentChunk=t,this.currentChunk&&(this.onEnterChunk.dispatch(this.currentChunk.name),this.isTutorial()&&this.onEnterTutorial.dispatch())),t&&(this.game.stats.setCurrentChunk(t),this.game.stats.distance>t.end&&(this.game.stats.chunkIndex+=1)),this.placeChunks()}placeChunks(){if(this.queued&&this.queued.length){let t=this.queued.length;for(;t--;)this.placeNextChunk(this.queued[t]);this.queued.length=0}let t=16;const e=this.game.stats.distance+a.a.visibleMaxDistance;for(;this.nextPosition<e&&this.game.state===o.a.RUNNING;){if(!t--)throw new Error("Too many chunks placed at same time");this.placeNextChunk()}}nextInSequence(){this.sequence.length||(this.sequence=this.game.route.getSequence());const t=this.sequence.shift(),e="string"==typeof t?t:s.a.item(t);return u.a.chunk(e)}queueChunk(t){const e=t?u.a.chunk(t):this.nextInSequence();this.queued.push(e.__name),this.postUpdateCount=0}queueTutorial(){this.sequence=this.game.route.getSequence();const t=this.nextInSequence();this.queued.push(t.__name)}placeNextChunk(t){const e=t?u.a.chunk(t):this.nextInSequence();if(!this.game.environment.canSpawn(e))return null;const i=this.chunkPool.get();if(!e)throw new Error("Chunk not found");return i.init(this.game,this.nextPosition,e,this.chunks.length),this.chunks.push(i),this.nextPosition+=i.length,i}removeObsoleteEntities(){if(this.isTutorial())return;let t=this.entities.length;for(;t--;){const e=this.entities[t],i=e.body?e.body.front:e.z,n=this.game.stats.z-a.a.visibleMinDistance;(!e.active||i>n)&&this._removeEntity(e,t)}}removeAllEntities(t){t||(t=this.entities.slice(0));let e=t.length;for(;e--;)this._removeEntity(t[e],e)}reshuffle(){this.game.route.resetSpawns(),this.currentChunk=null,this.game.physics.cleanup(),this.removeAllEntities(),this.nextPosition=this.game.stats.distance-10,this.queueChunk("default_fallback"),this.queueChunk("default_fallback")}isTutorial(){if(!this.currentChunk)return!1;return!(!this.currentChunk||"routeChunk_default_tutorial"!==this.currentChunk.name)&&this.game.stats.distance<this.currentChunk.end-300}setSafeLanding(t){for(;this.nextPosition<=t;)this.placeNextChunk();const e=this.nextPosition;return this.placeNextChunk("jetpack_landing"),e}removeObstacles(t=600){const e=this.entities.slice(0);let i=e.length;for(;i--;){const n=e[i];n.removableOnCrash&&n.body.back>this.game.stats.z-t&&this._removeEntity(n,i)}}}},,function(t,e,i){"use strict";i.d(e,"a",(function(){return Cube}));var n=i(19),r=i(14);class Cube extends r.a{constructor(){super(),this.add(n.a)}reset(){this.body.deco=!1,this.body.box.size.reset(),this.body.box.center.reset()}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Logo}));var n=i(51),r=i(32),o=i(0),a=i(1),s=i(17),h=i(14);function u(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Logo extends h.a{constructor(){super(),u(this,"model",void 0),u(this,"score",void 0),u(this,"scoreContainer",void 0),u(this,"scoreText",void 0),this.levelEntity=!1,this.model=a.a.library.getEntity("train_start",{map:"train-start",opacity:.999}),this.model.ry=Math.PI,this.addChild(this.model),this.scoreText=new o.Text("SCORE",{fontFamily:"Stencilia",fontSize:60,fill:16777215,lineHeight:50}),this.scoreContainer=new r.a,this.scoreContainer.ry=.5*Math.PI,this.scoreContainer.x=9.5,this.scoreContainer.y=6.3,this.scoreContainer.z=-4,this.addChild(this.scoreContainer),this.score=s.a.plane(2,2,.99,this.scoreText.texture),this.score.rx=.25,this.scoreContainer.addChild(this.score)}updateScore(){const t=a.a.user.gameSettings.highscore;this.scoreText.text=t?n.b.translate("score")+"\n"+t:" ",this.scoreText.updateText(!0),this.score.scale.x=.01*this.scoreText.width,this.score.scale.y=.01*-this.scoreText.height}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return MissionSystem}));var n=i(51),r=i(24),o=i(1),a=i(38),s=i(145),h=i(31);function u(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function l(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?u(Object(i),!0).forEach((function(e){c(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):u(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function c(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const d={"mission-bump-barriers":0,"mission-bump-lights":0,"mission-bump-trains-onerun":0,"mission-buy-mystery":0,"mission-character-tokens":0,"mission-daily-challenges":0,"mission-dodge":0,"mission-get-caught":0,"mission-headstart":0,"mission-high-score":0,"mission-hoverboard":0,"mission-hoverboard-nocrash":0,"mission-jump":0,"mission-jump-onerun":0,"mission-jump-trains":0,"mission-pickup-coins":0,"mission-pickup-coins-air":0,"mission-pickup-coins-jetpack":0,"mission-pickup-coins-pogo":0,"mission-pickup-coins-magnet":0,"mission-pickup-coins-onerun":0,"mission-pickup-jetpacks":0,"mission-pickup-jetpacks-onerun":0,"mission-pickup-pogos":0,"mission-pickup-pogos-onerun":0,"mission-pickup-keys":0,"mission-pickup-magnets":0,"mission-pickup-magnets-onerun":0,"mission-pickup-mystery":0,"mission-pickup-powerups":0,"mission-pickup-sneakers":0,"mission-pickup-sneakers-onerun":0,"mission-roll":0,"mission-roll-lane":0,"mission-roll-onerun":0,"mission-score":0,"mission-score-nocoins":0,"mission-score-onerun":0,"mission-scoreBooster":0,"mission-spend-coins":0,"mission-coins-mystery":0},p={};class MissionSystem extends h.a{constructor(t){super(t),c(this,"_profile",void 0),c(this,"data",l({},d)),c(this,"onCompleteMission",new r.Signal),c(this,"missionsToTrack",[]),c(this,"completedMissions",0),this.game.onReset.add({reset:this.reset.bind(this)});for(const t in d){const e=t;e.includes("onerun")&&(p[e]=d[e])}this.reset(),o.a.user.onCoinsSpent.add(t=>this.addStat(t,"mission-spend-coins")),a.i.add(()=>this.addStat(1,"mission-daily-challenges"))}initMissionTracking(){const t=o.a.data.getCurrentMissions();this.completedMissions=0,this.missionsToTrack=t,this.missionsToTrack.forEach(t=>{this.data[t.id]=t.progress,this.completedMissions+=Number(t.completed)})}reset(){this.data=l(l({},this.data),p),this.initMissionTracking()}addStat(t,e){"mission-pickup-coins"===e&&this.processCoinsPickup(),"mission-pickup-powerups"===e&&this.processPowerups(),"mission-roll"===e&&this.processRoll(),"mission-jump"===e&&this.processJump(),"mission-get-caught"===e&&this.game.stats.time>10&&(t=0),this.data[e]+=t,this.missionsToTrack.forEach(t=>{t.completed||this.progressMission(t)})}setStat(t,e){"mission-score"===e&&this.processScore(t),this.data[e]=t,this.missionsToTrack.forEach(t=>{t.completed||this.progressMission(t)})}progressMission(t){const e=t.params.amount,i=t.id,n=Math.min(this.data[i],e);t.progress!==n&&(t.progress=n,t.completed=t.progress===e,t.completed&&(this.completedMissions++,this.showNotification(t.id,t.params.amount),this.onCompleteMission.dispatch(t.id),this.completedMissions===this.missionsToTrack.length&&this.initMissionTracking()),o.a.user.progressMission(i,n,t.set))}showNotification(t,e){o.a.notification.append({text:n.b.translate("mission-complete")+"\n"+n.b.translate(t,{amount:e}),icon:"mission-completed-checkmark.png",height:130})}processCoinsPickup(){const t=this.game.hero;t.jetpack.isOn()&&(this.data["mission-pickup-coins-jetpack"]+=1),t.body.landed||(this.data["mission-pickup-coins-air"]+=1),t.magnet.isOn()&&(this.data["mission-pickup-coins-magnet"]+=1),t.pogo.isOn()&&(this.data["mission-pickup-coins-pogo"]+=1),this.data["mission-pickup-coins-onerun"]+=1}processPowerups(){const t=this.game.hero;t.jetpack.isOn()&&(this.data["mission-pickup-jetpacks"]+=1,this.data["mission-pickup-jetpacks-onerun"]+=1),t.magnet.isOn()&&(this.data["mission-pickup-magnets"]+=1,this.data["mission-pickup-magnets-onerun"]+=1),t.pogo.isOn()&&(this.data["mission-pickup-pogos"]+=1,this.data["mission-pickup-pogos-onerun"]+=1),t.sneakers.isOn()&&(this.data["mission-pickup-sneakers"]+=1,this.data["mission-pickup-sneakers-onerun"]+=1)}processScore(t){0===this.game.stats.coins&&(this.data["mission-score-nocoins"]=t),this.data["mission-score-onerun"]=t}processRoll(){this.game.hero.lane.lane===s.b.CENTRAL&&(this.data["mission-roll-lane"]+=1),this.data["mission-roll-onerun"]+=1}processJump(){this.game.hero.body.ground>7&&(this.data["mission-jump-trains"]+=1),this.data["mission-jump-onerun"]+=1}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return PhysicsSystem}));var n=i(28),r=i(2),o=i(40),a=i(10),s=i(31);function h(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class PhysicsSystem extends s.a{constructor(t){super(t),h(this,"collision",void 0),h(this,"stats",{}),h(this,"entities",[]),h(this,"_hasReset",!1),this.collision=new o.a,this.game.onReset.add(this),this.cleanup()}cleanup(){this.stats={},this.entities=[],this._hasReset=!0}entityAddedToScene(t){if(!t.body||t.body.deco||t.player)return;this.entities.indexOf(t)>=0||this.entities.push(t)}entityRemovedFromScene(t){if(!t.body||t.body.deco||t.player)return;const e=this.entities.indexOf(t);e<0||this.entities.splice(e,1)}postupdate(){const t=this.game.delta,e=this.game.hero;if(this.game.state!==n.a.RUNNING&&!e.player.dead)return;e.player.dead||(e.body.groundBefore=e.body.ground,e.body.ground=0);const i=Math.ceil(t)+r.a.physicsExtraSteps,o=Math.ceil(Math.abs(e.body.velocity.z*r.a.physicsStepsPerSpeed)),s=a.a.clamp(i+o,1,r.a.physicsMaxSteps),h=t/s;r.a.debug&&(this.stats.delta=t,this.stats.steps=s,this.stats.stepsDelta=h,this.stats.bodies=this.entities.length,this.stats.collidables=0);let u=s;for(;u--&&!this._hasReset;){e.body.move(h);let t=this.entities.length;for(;t--;){const i=this.entities[t];if(!i||!i.active||i===e)continue;if(i.body.movable&&i.body.move(h),this._hasReset)break;if(i.body.back<e.body.z-6)continue;if(i.body.front>e.body.z+3)continue;if(i.body.top<e.body.y-10)continue;if(i.body.right<e.body.x-5)continue;if(i.body.left>e.body.x+5)continue;if(this.game.state!==n.a.RUNNING)break;if(e.player.dead)break;r.a.debug&&(this.stats.collidables+=1);const o=e.body.box.hitTest(i.body.box);if(o&&!i.body.trigger&&this.resolveHit(e,i,o),e.body.sensor&&!i.body.ghost&&!i.body.trigger){const t=e.body.sensor.hitTest(i.body.box);t&&this.resolveGroundSensorHit(e,i,t)}if(i.body.trigger){const t=e.body.colliding.indexOf(i.body);!o&&t>=0&&(e.body.colliding.splice(t,1),e.body.triggerExit(i.body)),o&&t<0&&(e.body.colliding.push(i.body),e.body.triggerEnter(i.body))}}}e.body.ground<e.body.groundBefore&&(e.body.groundChangeTolerance=8),this._hasReset=!1}resolve(t){if(this.isHeroDead())return;let e=this.entities.length;for(;e--;){const i=this.entities[e];if(!i)continue;if(!i.active)continue;if(i.body.back<t.body.z-10)continue;if(i.body.front>t.body.z+5)continue;r.a.debug&&(this.stats.collidables+=1);const n=t.body.box.hitTest(i.body.box);if(n&&!i.body.trigger&&this.resolveHit(t,i,n),i.body.trigger){const e=t.body.colliding.indexOf(i.body);!n&&e>=0&&(t.body.colliding.splice(e,1),t.body.triggerExit(i.body)),n&&e<0&&(t.body.colliding.push(i.body),t.body.triggerEnter(i.body))}}}resolveHit(t,e,i){if(this.isHeroDead())return;if(e.collectible)return void e.collectible.collect(t);if(t.body.ghost)return;const n=t.body,r=e.body;if(this.collision.reset(),this.collision.act=n,this.collision.pas=r,this.collision.hit.copy(i),e.ramp){if(n.right>=r.left&&n.left<=r.right)return}const a=r.movable?r.origin:r.box;n.y>r.top&&i.height<=6&&n.velocity.y>-1?(n.bottom=r.top+.2,this.collision.flags=this.collision.flags|o.a.BOTTOM,i.height>2&&(this.collision.flags=this.collision.flags|o.a.SLOPE),n.matchPosition(n.box)):n.origin.bottom>a.top?(n.bottom=r.top+.2,this.collision.flags=this.collision.flags|o.a.BOTTOM,n.matchPosition(n.box)):n.origin.left>=a.right?(n.box.left=r.box.right+.2,this.collision.flags=this.collision.flags|o.a.LEFT,n.matchPosition(n.box)):n.origin.right<=a.left?(n.box.right=r.box.left-.2,this.collision.flags=this.collision.flags|o.a.RIGHT,n.matchPosition(n.box)):n.origin.top<a.bottom?(n.box.top=r.box.bottom-.2,this.collision.flags=this.collision.flags|o.a.TOP,n.matchPosition(n.box)):n.origin.front<=a.back&&(n.box.front=r.box.back+.2,this.collision.flags=this.collision.flags|o.a.FRONT,n.matchPosition(n.box)),this.collision.flags&&n.collisionEnter(r,this.collision)}resolveGroundSensorHit(t,e,i){if(this.isHeroDead())return;if(t.body.ghost)return void(t.body.ground=0);const n=t.body,r=e.body;let o=n.ground;if(e.ramp){const t=r.box.size.y,e=r.box.size.z;o=t*((r.back-n.front)/e)+.11}else o=r.top+.11;o>=n.ground&&(n.ground=o)}canUpdate(){return this.game.state===n.a.RUNNING}isHeroDead(){return this.game.hero.player.dead}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return PickupSystem}));var n=i(28),r=i(38),o=i(66),a=i(31);function s(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class PickupSystem extends a.a{constructor(t){if(super(t),s(this,"letters",0),s(this,"timedPickups",[{type:"mysteryBox",Class:o.b,timer:0,targetTime:180}]),!Object(r.h)()){const t={type:"letter",Class:o.a,timer:20,targetTime:20};this.timedPickups.unshift(t),r.i.addOnce(()=>{this.timedPickups.splice(this.timedPickups.indexOf(t),1)})}}update(){if(this.game.state===n.a.RUNNING)for(const t in this.timedPickups)this.timedPickups[t].timer+=this.game.deltaSecs}entityAddedToScene(t){"letter"===t.type&&this.letters++}entityRemovedFromScene(t){"letter"===t.type&&this.letters--}getNextPickup(){this.timedPickups.sort((t,e)=>e.timer-t.timer);for(const t in this.timedPickups){const e=this.timedPickups[t];if(e.timer>=e.targetTime&&0===this.letters)return e.timer=0,e.Class}return null}}s(PickupSystem,"DEFAULT_NAME","pickup")},function(t,e,i){"use strict";i.d(e,"a",(function(){return RouteSystem}));i(56);var n=i(2),r=i(1),o=i(10),a=i(13),s=i(55),h=i(181),u=i(31);function l(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class RouteBuilder{constructor(t){l(this,"game",void 0),l(this,"minDistanceBetweenRepeats",void 0),l(this,"sectionsStart",void 0),l(this,"sectionsMid",void 0),l(this,"levels",void 0),l(this,"picked",void 0),l(this,"level",0),l(this,"availableSections",void 0),this.game=t,this.minDistanceBetweenRepeats=2700,this.sectionsStart={default_start:10},this.sectionsMid={"default_b-s-b":10,default_choice:10,"default_s-b-s-b":10,"default_s-s":10,"default_s-s-s-s":10,default_train_tops_1:10,default_train_tops_2:10,default_tunnel_notrain:10,default_ramp_1:10,default_epic:20,default_1_track:30,default_2_tracks:10,default_train_tops_moving:10,default_train_tops_moving_combined:10,default_train_tops_moving_multiple:10,default_tunnel:30,default_epic_various:20,"default_4_units_3_tracks_b-s-b":10,default_4_units_3_tracks_choice:10,"default_4_units_3_tracks_s-b-s-b":10,"default_4_units_3_tracks_s-s":10,"default_4_units_3_tracks_s-s-s-s":10,default_short_1_track:10,default_ramp_2:10,default_short_2_tracks:10,default_short_train_tops_moving_combined:10,default_short_train_tops_moving_multiple:10,default_short_train_tops_moving:10,default_pogostick_start:5,default_bonus_short:10,default_bonus_long:10},this.levels=["easy","normal","hard","expert"],this.reset()}reset(){this.picked={default_tunnel:1,default_tunnel_notrain:1},this.level=0,this.availableSections={},this.addAvailableSections("easy")}getSectionByLevel(t){if(this.picked||(this.picked={}),t>this.level){this.level=t;const e=this.levels[this.level];this.addAvailableSections(e),2===t&&(this.addAvailableSection("default_bonus_short"),this.addAvailableSection("default_bonus_long"),this.addAvailableSection("default_pogostick_start"))}for(const t in this.picked)this.game.stats.distance>this.picked[t]&&delete this.picked[t];let e=Object.assign({},this.availableSections);for(const t in this.picked)delete e[t];Object.keys(e).length||this.addAvailableSections(this.levels[this.level]),e=Object.assign({},this.availableSections);const i=a.a.item(e);if(!i)throw new Error("No section available");return i.__shortname.match("default_tunnel")?(this.picked.default_tunnel=this.game.stats.distance+.75*this.minDistanceBetweenRepeats,this.picked.default_tunnel_notrain=this.game.stats.distance+.75*this.minDistanceBetweenRepeats):this.picked[i.__shortname]=this.game.stats.distance+this.minDistanceBetweenRepeats,i}addAvailableSections(t){const e=h.default[t].default;for(const t in e)this.addAvailableSection(e[t])}addAvailableSection(t){"string"==typeof t&&(t=s.a.section(t));const e=t.name.replace("routeSection_","").replace("route_section_","");this.sectionsMid[e]&&(this.availableSections[e]=t,t.__shortname=e)}}class RouteSystem extends u.a{constructor(t){super(t),l(this,"_spawns",void 0),l(this,"builder",void 0),l(this,"firstPassed",!1),l(this,"hasTube",!1),l(this,"_profile",void 0),this.game.onReset.add(this),this._spawns={},this.builder=new RouteBuilder(this.game),this.firstPassed=!1}reset(){this.builder.reset(),this.firstPassed=!1,this.game.stats.route="",this._spawns={pickup:-900,tube:-90}}getSequence(){const t=o.a.clamp(this.game.stats.level,0,3),e=[],i=[],h=[];if(n.a.route)h.push(s.a.section("default_fallback")),h.push(s.a.section(n.a.route));else if(this.firstPassed)r.a.library.hasResourcesForFullGameplay()?h.push(this.builder.getSectionByLevel(t)):h.push(s.a.section("basic_game"));else{const t=r.a.library.hasResourcesForFullGameplay()?"default_start":"basic_game",e=s.a.section(this.game.tutorial.enabled?"tutorial":t);h.push(e),this.firstPassed=!0}for(let t=0;t<h.length;t++){const n=h[t];if(!(i.indexOf(n.name)>=0)){if(i.push(n.name),n.start)for(const t in n.start)e.push(n.start[t]);if(n.mid&&e.push(a.a.item(n.mid)),n.end)for(const t in n.end)e.push(n.end[t])}}return n.a.chunk?n.a.chunk.split(","):e}canSpawn(t,e){if(void 0===this._spawns[t])return!0;return e<=this._spawns[t]}setSpawn(t,e){this._spawns[t]=e}get profile(){return this._profile||(this._profile={}),this._profile}resetSpawns(){this.builder.picked={},this._spawns={pickup:-900,tube:-90}}setSpawnDistance(t,e){}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return StatsSystem}));i(9);var n=i(28),r=i(2),o=i(1),a=i(10),s=i(31);function h(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function u(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?h(Object(i),!0).forEach((function(e){l(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):h(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function l(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const c={x:0,y:0,z:0,distance:0,distanceDelta:0,score:0,coins:0,keys:0,chunkIndex:0,chunkName:"",chunkStart:0,chunkEnd:0,chunkLength:0,block:0,multiplier:1,missionMultiplier:0,route:"",time:0,delta:0,prizes:[],baseSpeed:{min:110,max:220},speedIncrease:{min:0,max:0},lerpTime:0};class StatsSystem extends s.a{constructor(t,e={}){super(t),l(this,"_profile",void 0),l(this,"data",void 0),l(this,"mysteryBoxTimer",0),l(this,"mysteryBoxTarget",120),this.game.onReset.add({reset:this.reset.bind(this)}),this.data=u(u({},c),e),this.reset()}reset(){Object.assign(this.data,c),this.missionMultiplier=o.a.data.getMissionMultiplier(),this.data.prizes=[]}preupdate(){this.x=this.game.hero.transform.position.x,this.y=this.game.hero.transform.position.y-5.5,this.z=this.game.hero.transform.position.z}update(){this.game.state===n.a.RUNNING?(this.time+=this.game.deltaSecs,this.delta=this.game.deltaSecs):this.delta=0}get missionMultiplier(){return this.data.missionMultiplier}set missionMultiplier(t){this.data.missionMultiplier=t}get multiplier(){return this.data.multiplier}set multiplier(t){this.data.multiplier=t}get x(){return this.data.x}set x(t){this.data.x=t}get y(){return this.data.y}set y(t){this.data.y=t}get z(){return this.data.z}set z(t){this.data.z=t,this.data.distanceDelta=-t-this.data.distance,this.data.distance=-t,this.data.block=this.data.distance/r.a.blockSize|0,this.data.score+=this.data.distanceDelta*(this.multiplier+this.missionMultiplier),this.game.missions.setStat(this.score,"mission-score")}get distance(){return this.data.distance}get distanceDelta(){return this.data.distanceDelta}get score(){return Math.floor(.1*this.data.score)}get coins(){return this.data.coins}set coins(t){this.data.coins=t}get keys(){return this.data.keys}set keys(t){this.data.keys=t}get chunkIndex(){return this.data.chunkIndex}set chunkIndex(t){this.data.chunkIndex=t}get speed(){if(r.a.speed)return r.a.speed;const t=this.data.time;let e=this.data.baseSpeed.min,i=this.data.baseSpeed.max;this.data.speedIncrease.min>0?(this.data.lerpTime+=this.delta,e=a.a.lerp(e,e+this.data.speedIncrease.min,this.data.lerpTime),i=a.a.lerp(i,i+this.data.speedIncrease.max,this.data.lerpTime)):this.data.lerpTime=0;let n=i;if(t<180){n=e+(i-e)*(t/180)}return n/60}get minSpeed(){return(this.data.baseSpeed.min+this.data.speedIncrease.min)/60}get maxSpeed(){return(this.data.baseSpeed.max+this.data.speedIncrease.max)/60}get speedRatio(){const t=this.maxSpeed-this.minSpeed;return(this.speed-this.minSpeed)/t}get animationSpeed(){return.75+.25*this.speedRatio}get level(){return Math.floor(this.data.time/20)}get levelName(){switch(this.level){case 0:return"easy";case 1:return"normal";case 2:return"hard";default:return"expert"}}get time(){return this.data.time}set time(t){this.data.time=t}get delta(){return this.data.delta}set delta(t){this.data.delta=t}set route(t){this.data.route=t}get route(){return this.data.route}get chunk(){return this.data.chunkName}setPrizes(...t){this.data.prizes.push(...t)}getPrizes(){return this.data.prizes}setCurrentChunk(t){this.data.chunkName=t.name,this.data.chunkStart=t.start,this.data.chunkEnd=t.end,this.data.chunkLength=t.length}toString(){const t=["level","route","chunk"];let e="";for(const i in t){const n=t[i];"z"!==n&&"distance"!==n&&"distanceDelta"!==n&&(e+=n+": "+this[n]+"\n")}return e}get profile(){return this._profile||(this._profile={}),Object.assign(this._profile,this.data),this._profile.speed=this.speed,this._profile.speedRatio=this.speedRatio,this._profile.level=this.level,this._profile.levelName=this.levelName,this._profile}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return TutorialSystem}));var n=i(478),r=i(51),o=i(6),a=i(0),s=i(2),h=i(1),u=i(46),l=i(10),c=i(31);function d(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Arrow extends a.Container{constructor(){super(),d(this,"img",void 0),d(this,"time",0),d(this,"duration",0),d(this,"animRange",300),this.img=a.Sprite.from("tutorial-arrow.png"),this.img.anchor.set(.5),this.img.scale.set(2),this.img.alpha=.5,this.addChild(this.img),this.visible=!1}async show(t,e=40){const i={up:0,right:1,down:2,left:3};void 0!==i[t]&&(this.rotation=l.a.PI_HALF*i[t],await Object(n.a)(),this.visible=!0,this.time=0,this.duration=e,this.img.y=this.animRange)}hide(){this.visible=!1}update(t){if(!this.visible)return;this.time+=t;const e=this.time/this.duration;this.img.y=this.animRange-2*this.animRange*e,e>1&&this.hide()}}class Msg extends u.a{constructor(t){super("MSG",{align:"center",fill:16777215,fontSize:50,fontFamily:"Lilita One",stroke:"black",strokeThickness:5,anchor:.5}),d(this,"app",void 0),d(this,"time",0),d(this,"duration",60),d(this,"showing",!1),this.app=t,this.visible=!1,this.time=0,this.duration=60}show(t,e){const i=s.a.mobile?"":"_desktop";let n=r.b.translate("tutorial_"+t+i);n||(n=r.b.translate("tutorial_"+t)),n&&(this.text=n,this.visible=!0,this.time=0,this.duration=20+2*n.length,this.scale.y=0,o.g.to(this.scale,.01,{y:1}),this.y=e?300:0,this.showing=!0)}hide(){this.showing=!1,o.g.to(this.scale,.1,{y:0,onComplete:()=>{this.visible=!1}})}update(t){this.visible&&this.showing&&(this.time+=t,this.time>this.duration&&this.hide())}}class TutorialSystem extends c.a{constructor(t){super(t),d(this,"view",void 0),d(this,"_enabled",!1),d(this,"_built",!1),d(this,"arrow",void 0),d(this,"msg",void 0),d(this,"onResize",()=>{this.view.x=h.a.ui.viewportWidth/2,this.view.y=h.a.ui.viewportHeight/2}),this.view=new a.Container,this.game.onRun.add(this),this.game.onPause.add(this),this.game.onResume.add(this)}get enabled(){return this._enabled}set enabled(t){this._enabled=t}run(){this._enabled&&this.show()}pause(){this._enabled&&(this.view.visible=!1)}resume(){this._enabled&&(this.view.visible=!0)}build(){this._built||(this._built=!0,this.arrow=new Arrow,this.view.addChild(this.arrow),this.msg=new Msg(this.game.app),this.view.addChild(this.msg))}show(){this._enabled&&(this.build(),this.game.hero.hoverboard.lock(),h.a.ui.mainLayer.addChild(this.view),h.a.resize.onResize.connect(this.onResize),this.onResize())}hide(){var t;null===(t=this.view.parent)||void 0===t||t.removeChild(this.view),h.a.resize.onResize.disconnect(this.onResize)}enterTrigger(t){this._enabled&&(this.game.stats.distanceDelta<0||(this.arrow.show(t),this.msg.show(t,this.arrow.visible),"hoverboard"===t&&this.game.hero.hoverboard.unlock()))}exitTrigger(t){"finished"===t&&(h.a.user.tutorial=!0,h.a.user.save())}update(t){const e=t.frameTime;this._enabled&&(this.arrow&&this.arrow.update(e),this.msg&&this.msg.update(e))}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Time}));class Time{constructor(t={}){var e,i;this.timeScale=1,this.fps=60,this.maxDeltaTime=50,this._deltaTime=0,this._frameTime=0,this.timeScale=null!==(e=t.timeScale)&&void 0!==e?e:1,this.fps=null!==(i=t.fps)&&void 0!==i?i:60,this._lastTime=performance.now(),this._frameDuration=1e3/this.fps}nextUpdate(){const t=performance.now();this._deltaTime=Math.min(t-this._lastTime,this.maxDeltaTime),this._frameTime=this._deltaTime/this._frameDuration,this._lastTime=t}get deltaTime(){return this._deltaTime*this.timeScale}get unscaledDeltaTime(){return this._deltaTime}get frameTime(){return this._frameTime*this.timeScale}get unscaledFrameTime(){return this._frameTime}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return LightComponent}));i(29),i(34),i(30);var n=i(0),r=i(36),o=i(16),a=i(32),s=i(186),h=i(152);const u=new o.a(0,0,-1),l={0:0,1:0,2:0};var c;!function(t){t[t.DIRECTIONAL=0]="DIRECTIONAL",t[t.POINT=1]="POINT",t[t.SPOTLIGHT=2]="SPOTLIGHT"}(c||(c={}));class LightComponent{constructor(t,e){var i,n;if(this._rotationMatrix=new r.a,this.entity=t,this.type=null!==(i=e.type)&&void 0!==i?i:c.DIRECTIONAL,this.lightId=this.type+"_"+l[this.type]++,this._color=new Float32Array(3),this._hexColor=0,this.dirty=!1,this.color=null!==(n=e.color)&&void 0!==n?n:16777215,this.intensity=void 0===e.intensity?1:e.intensity,this.output=new Float32Array(3),-1===t.groups.indexOf("_lights")&&t.groups.push("_lights"),this.direction=new o.a,this._dirtyTransformId=-1,this.distance=e.distance||500,this.position=new o.a(1,-400,1),this.limit=new Float32Array([0,0]),e.debug){const i=new s.a(1),n=new h.a({color:this.color,useLights:!1});e.debug=new a.a({geometry:i,material:n});const r=new a.a({geometry:i,material:n});e.debug.addChild(r),r.z=-1,r.scale.set(.5),t.addChild(e.debug)}this.radius=e.radius||Math.PI/4,void 0===e.softness?this.softness=.5:this.softness=e.softness}render(){if(this.entity.transform.worldID!==this._dirtyTransformId){this._dirtyTransformId=this.entity.transform.worldID;const t=this.direction,e=this.entity.transform.extractRotation(this._rotationMatrix);t.copy(u).applyMatrix4(e),this.entity.transform.extractPosition(this.position)}if(!this.dirty)return;this.dirty=!1;const t=this.output,e=this._color,i=this.limit,n=this._intensity;t[0]=Math.pow(e[0]*n,2.2),t[1]=Math.pow(e[1]*n,2.2),t[2]=Math.pow(e[2]*n,2.2),i[0]=Math.cos((1-this.softness)*this.radius),i[1]=Math.cos(this.radius)}extractData(){return{distance:this.distance,color:this.color,type:this.type,intensity:this.intensity,softness:this.softness,radius:this.radius}}init(t){for(const e in t)this[e]=t[e]}set radius(t){this._radius=t,this.dirty=!0}get radius(){return this._radius}set softness(t){this._softness=t,this.dirty=!0}get softness(){return this._softness}set color(t){this._hexColor!==t&&(this._hexColor=t,n.utils.hex2rgb(t,this._color),this.dirty=!0)}get color(){return this._hexColor}set intensity(t){this._intensity!==t&&(this._intensity=t,this.dirty=!0)}get intensity(){return this._intensity}}LightComponent.DEFAULT_NAME="light"},,,,,function(t,e,i){"use strict";i.d(e,"a",(function(){return OrbitalComponent}));var n=i(140),r=i(16);function o(t){return t.touches?{x:(t=t).touches[0].pageX,y:t.touches[0].pageY}:{x:(t=t).clientX,y:t.clientY}}class OrbitalComponent{constructor(t,e={}){this.entity=t,this._radius=e.radius||5,this._targetRadius=e.radius||5,this._listenerTarget=e.listenerTarget||window,this._isDown=!1,this.center=new r.a,this.easing=.1,this.sensitivity=1,this.sensitivityRotation=1,this._isLocked=!1,this._isZoomLocked=!1,this._rx=0,this._trx=0,this._prevx=0,this._ry=0,this._try=0,this._prevy=0,this._vec=new r.a,this.euler=new n.a(0,0,0,"YXZ"),this._mouseDown={x:0,y:0},this._mouse={x:0,y:0},this._init()}lock(t){this._isLocked=t}lockZoom(t){this._isZoomLocked=t}update(){const t=this._mouse.x-this._mouseDown.x,e=this._mouse.y-this._mouseDown.y,i=.02*this.sensitivityRotation;this._try=this._prevy-t*i,this._trx=this._prevx-e*i,this._trx<-Math.PI/2+.01?this._trx=-Math.PI/2+.01:this._trx>Math.PI/2-.01&&(this._trx=Math.PI/2-.01),this._rx+=(this._trx-this._rx)*this.easing,this._ry+=(this._try-this._ry)*this.easing,this._radius+=(this._targetRadius-this._radius)*this.easing;const{_vec:n,euler:r}=this;r.x=this._rx,r.y=this._ry,n.set(0,0,this._radius),n.applyEuler(r),this.entity.transform.position.x=this._vec.x,this.entity.transform.position.y=this._vec.y,this.entity.transform.position.z=this._vec.z,this.entity.transform.lookAt(this.center)}_init(){this._listenerTarget.addEventListener("mousedown",t=>this._onDown(t)),this._listenerTarget.addEventListener("mouseup",()=>this._onUp()),this._listenerTarget.addEventListener("mousemove",t=>this._onMove(t)),this._listenerTarget.addEventListener("touchstart",t=>this._onDown(t)),this._listenerTarget.addEventListener("touchend",()=>this._onUp()),this._listenerTarget.addEventListener("touchmove",t=>this._onMove(t)),this._listenerTarget.addEventListener("wheel",t=>this._onWheel(t),{passive:!1})}_onWheel(t){if(this._isZoomLocked)return;const e=t.wheelDelta,i=t.detail;let n=0;n=i?e?e/i/40*i>0?1:-1:-i/3:e/120,this._targetRadius+=2*-n*this.sensitivity,this._targetRadius<.01&&(this._targetRadius=.01),t.preventDefault()}_onDown(t){this._isLocked||(this._isDown=!0,this._mouseDown=o(t),this._mouse=o(t),this._prevx=this._trx=this._rx,this._prevy=this._try=this._ry)}_onMove(t){this._isLocked||this._isDown&&(this._mouse=o(t))}_onUp(){this._isLocked||(this._isDown=!1)}}OrbitalComponent.DEFAULT_NAME="orbital",OrbitalComponent.DEFAULT_NAME="orbital"},function(t,e,i){t.exports=function(){return new Worker(i.p+"js/workers/worker.0a8b30d0071f04d38b17.js")}},function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),r=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||e.hasOwnProperty(i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),e.dedupeGeometry=e.batchGeometry=e.flattenScene=e.transformUvs=e.transformPositions=e.mergeGBObjects=e.mergePrimitives=e.unpackGBObject=e.compressGBObject=e.objToGbParser=e.gltfToGbParser=void 0;const o=i(443);Object.defineProperty(e,"batchGeometry",{enumerable:!0,get:function(){return o.batchGeometry}});const a=i(444);Object.defineProperty(e,"compressGBObject",{enumerable:!0,get:function(){return a.compressGBObject}});const s=i(454);Object.defineProperty(e,"dedupeGeometry",{enumerable:!0,get:function(){return s.dedupeGeometry}});const h=i(455);Object.defineProperty(e,"flattenScene",{enumerable:!0,get:function(){return h.flattenScene}});const u=i(456);Object.defineProperty(e,"gltfToGbParser",{enumerable:!0,get:function(){return u.gltfToGbParser}});const l=i(469);Object.defineProperty(e,"objToGbParser",{enumerable:!0,get:function(){return l.objToGbParser}});const c=i(471);Object.defineProperty(e,"mergeGBObjects",{enumerable:!0,get:function(){return c.mergeGBObjects}});const d=i(177);Object.defineProperty(e,"mergePrimitives",{enumerable:!0,get:function(){return d.mergePrimitives}});const p=i(220);Object.defineProperty(e,"transformPositions",{enumerable:!0,get:function(){return p.transformPositions}});const f=i(472);Object.defineProperty(e,"transformUvs",{enumerable:!0,get:function(){return f.transformUvs}});const m=i(473);Object.defineProperty(e,"unpackGBObject",{enumerable:!0,get:function(){return m.unpackGBObject}}),r(i(476),e)},function(t,e,i){(function(i){var n;!function(){"use strict";var r=function(){this.init()};r.prototype={init:function(){var t=this||o;return t._counter=1e3,t._html5AudioPool=[],t.html5PoolSize=10,t._codecs={},t._howls=[],t._muted=!1,t._volume=1,t._canPlayEvent="canplaythrough",t._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,t.masterGain=null,t.noAudio=!1,t.usingWebAudio=!0,t.autoSuspend=!0,t.ctx=null,t.autoUnlock=!0,t._setup(),t},volume:function(t){var e=this||o;if(t=parseFloat(t),e.ctx||p(),void 0!==t&&t>=0&&t<=1){if(e._volume=t,e._muted)return e;e.usingWebAudio&&e.masterGain.gain.setValueAtTime(t,o.ctx.currentTime);for(var i=0;i<e._howls.length;i++)if(!e._howls[i]._webAudio)for(var n=e._howls[i]._getSoundIds(),r=0;r<n.length;r++){var a=e._howls[i]._soundById(n[r]);a&&a._node&&(a._node.volume=a._volume*t)}return e}return e._volume},mute:function(t){var e=this||o;e.ctx||p(),e._muted=t,e.usingWebAudio&&e.masterGain.gain.setValueAtTime(t?0:e._volume,o.ctx.currentTime);for(var i=0;i<e._howls.length;i++)if(!e._howls[i]._webAudio)for(var n=e._howls[i]._getSoundIds(),r=0;r<n.length;r++){var a=e._howls[i]._soundById(n[r]);a&&a._node&&(a._node.muted=!!t||a._muted)}return e},stop:function(){for(var t=this||o,e=0;e<t._howls.length;e++)t._howls[e].stop();return t},unload:function(){for(var t=this||o,e=t._howls.length-1;e>=0;e--)t._howls[e].unload();return t.usingWebAudio&&t.ctx&&void 0!==t.ctx.close&&(t.ctx.close(),t.ctx=null,p()),t},codecs:function(t){return(this||o)._codecs[t.replace(/^x-/,"")]},_setup:function(){var t=this||o;if(t.state=t.ctx&&t.ctx.state||"suspended",t._autoSuspend(),!t.usingWebAudio)if("undefined"!=typeof Audio)try{void 0===(new Audio).oncanplaythrough&&(t._canPlayEvent="canplay")}catch(e){t.noAudio=!0}else t.noAudio=!0;try{(new Audio).muted&&(t.noAudio=!0)}catch(t){}return t.noAudio||t._setupCodecs(),t},_setupCodecs:function(){var t=this||o,e=null;try{e="undefined"!=typeof Audio?new Audio:null}catch(e){return t}if(!e||"function"!=typeof e.canPlayType)return t;var i=e.canPlayType("audio/mpeg;").replace(/^no$/,""),n=t._navigator?t._navigator.userAgent:"",r=n.match(/OPR\/([0-6].)/g),a=r&&parseInt(r[0].split("/")[1],10)<33,s=-1!==n.indexOf("Safari")&&-1===n.indexOf("Chrome"),h=n.match(/Version\/(.*?) /),u=s&&h&&parseInt(h[1],10)<15;return t._codecs={mp3:!(a||!i&&!e.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!i,opus:!!e.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(e.canPlayType('audio/wav; codecs="1"')||e.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!e.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!e.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(e.canPlayType("audio/x-m4a;")||e.canPlayType("audio/m4a;")||e.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(e.canPlayType("audio/x-m4b;")||e.canPlayType("audio/m4b;")||e.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(e.canPlayType("audio/x-mp4;")||e.canPlayType("audio/mp4;")||e.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(u||!e.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(u||!e.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!e.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(e.canPlayType("audio/x-flac;")||e.canPlayType("audio/flac;")).replace(/^no$/,"")},t},_unlockAudio:function(){var t=this||o;if(!t._audioUnlocked&&t.ctx){t._audioUnlocked=!1,t.autoUnlock=!1,t._mobileUnloaded||44100===t.ctx.sampleRate||(t._mobileUnloaded=!0,t.unload()),t._scratchBuffer=t.ctx.createBuffer(1,1,22050);var e=function(i){for(;t._html5AudioPool.length<t.html5PoolSize;)try{var n=new Audio;n._unlocked=!0,t._releaseHtml5Audio(n)}catch(i){t.noAudio=!0;break}for(var r=0;r<t._howls.length;r++)if(!t._howls[r]._webAudio)for(var o=t._howls[r]._getSoundIds(),a=0;a<o.length;a++){var s=t._howls[r]._soundById(o[a]);s&&s._node&&!s._node._unlocked&&(s._node._unlocked=!0,s._node.load())}t._autoResume();var h=t.ctx.createBufferSource();h.buffer=t._scratchBuffer,h.connect(t.ctx.destination),void 0===h.start?h.noteOn(0):h.start(0),"function"==typeof t.ctx.resume&&t.ctx.resume(),h.onended=function(){h.disconnect(0),t._audioUnlocked=!0,document.removeEventListener("touchstart",e,!0),document.removeEventListener("touchend",e,!0),document.removeEventListener("click",e,!0),document.removeEventListener("keydown",e,!0);for(var i=0;i<t._howls.length;i++)t._howls[i]._emit("unlock")}};return document.addEventListener("touchstart",e,!0),document.addEventListener("touchend",e,!0),document.addEventListener("click",e,!0),document.addEventListener("keydown",e,!0),t}},_obtainHtml5Audio:function(){var t=this||o;if(t._html5AudioPool.length)return t._html5AudioPool.pop();var e=(new Audio).play();return e&&"undefined"!=typeof Promise&&(e instanceof Promise||"function"==typeof e.then)&&e.catch((function(){})),new Audio},_releaseHtml5Audio:function(t){var e=this||o;return t._unlocked&&e._html5AudioPool.push(t),e},_autoSuspend:function(){var t=this;if(t.autoSuspend&&t.ctx&&void 0!==t.ctx.suspend&&o.usingWebAudio){for(var e=0;e<t._howls.length;e++)if(t._howls[e]._webAudio)for(var i=0;i<t._howls[e]._sounds.length;i++)if(!t._howls[e]._sounds[i]._paused)return t;return t._suspendTimer&&clearTimeout(t._suspendTimer),t._suspendTimer=setTimeout((function(){if(t.autoSuspend){t._suspendTimer=null,t.state="suspending";var e=function(){t.state="suspended",t._resumeAfterSuspend&&(delete t._resumeAfterSuspend,t._autoResume())};t.ctx.suspend().then(e,e)}}),3e4),t}},_autoResume:function(){var t=this;if(t.ctx&&void 0!==t.ctx.resume&&o.usingWebAudio)return"running"===t.state&&"interrupted"!==t.ctx.state&&t._suspendTimer?(clearTimeout(t._suspendTimer),t._suspendTimer=null):"suspended"===t.state||"running"===t.state&&"interrupted"===t.ctx.state?(t.ctx.resume().then((function(){t.state="running";for(var e=0;e<t._howls.length;e++)t._howls[e]._emit("resume")})),t._suspendTimer&&(clearTimeout(t._suspendTimer),t._suspendTimer=null)):"suspending"===t.state&&(t._resumeAfterSuspend=!0),t}};var o=new r,a=function(t){t.src&&0!==t.src.length&&this.init(t)};a.prototype={init:function(t){var e=this;return o.ctx||p(),e._autoplay=t.autoplay||!1,e._format="string"!=typeof t.format?t.format:[t.format],e._html5=t.html5||!1,e._muted=t.mute||!1,e._loop=t.loop||!1,e._pool=t.pool||5,e._preload="boolean"!=typeof t.preload&&"metadata"!==t.preload||t.preload,e._rate=t.rate||1,e._sprite=t.sprite||{},e._src="string"!=typeof t.src?t.src:[t.src],e._volume=void 0!==t.volume?t.volume:1,e._xhr={method:t.xhr&&t.xhr.method?t.xhr.method:"GET",headers:t.xhr&&t.xhr.headers?t.xhr.headers:null,withCredentials:!(!t.xhr||!t.xhr.withCredentials)&&t.xhr.withCredentials},e._duration=0,e._state="unloaded",e._sounds=[],e._endTimers={},e._queue=[],e._playLock=!1,e._onend=t.onend?[{fn:t.onend}]:[],e._onfade=t.onfade?[{fn:t.onfade}]:[],e._onload=t.onload?[{fn:t.onload}]:[],e._onloaderror=t.onloaderror?[{fn:t.onloaderror}]:[],e._onplayerror=t.onplayerror?[{fn:t.onplayerror}]:[],e._onpause=t.onpause?[{fn:t.onpause}]:[],e._onplay=t.onplay?[{fn:t.onplay}]:[],e._onstop=t.onstop?[{fn:t.onstop}]:[],e._onmute=t.onmute?[{fn:t.onmute}]:[],e._onvolume=t.onvolume?[{fn:t.onvolume}]:[],e._onrate=t.onrate?[{fn:t.onrate}]:[],e._onseek=t.onseek?[{fn:t.onseek}]:[],e._onunlock=t.onunlock?[{fn:t.onunlock}]:[],e._onresume=[],e._webAudio=o.usingWebAudio&&!e._html5,void 0!==o.ctx&&o.ctx&&o.autoUnlock&&o._unlockAudio(),o._howls.push(e),e._autoplay&&e._queue.push({event:"play",action:function(){e.play()}}),e._preload&&"none"!==e._preload&&e.load(),e},load:function(){var t=null;if(o.noAudio)this._emit("loaderror",null,"No audio support.");else{"string"==typeof this._src&&(this._src=[this._src]);for(var e=0;e<this._src.length;e++){var i,n;if(this._format&&this._format[e])i=this._format[e];else{if("string"!=typeof(n=this._src[e])){this._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}(i=/^data:audio\/([^;,]+);/i.exec(n))||(i=/\.([^.]+)$/.exec(n.split("?",1)[0])),i&&(i=i[1].toLowerCase())}if(i&&o.codecs(i)){t=this._src[e];break}}if(t)return this._src=t,this._state="loading","https:"===window.location.protocol&&"http:"===t.slice(0,5)&&(this._html5=!0,this._webAudio=!1),new s(this),this._webAudio&&u(this),this;this._emit("loaderror",null,"No codec support for selected audio sources.")}},play:function(t,e){var i=this,n=null;if("number"==typeof t)n=t,t=null;else{if("string"==typeof t&&"loaded"===i._state&&!i._sprite[t])return null;if(void 0===t&&(t="__default",!i._playLock)){for(var r=0,a=0;a<i._sounds.length;a++)i._sounds[a]._paused&&!i._sounds[a]._ended&&(r++,n=i._sounds[a]._id);1===r?t=null:n=null}}var s=n?i._soundById(n):i._inactiveSound();if(!s)return null;if(n&&!t&&(t=s._sprite||"__default"),"loaded"!==i._state){s._sprite=t,s._ended=!1;var h=s._id;return i._queue.push({event:"play",action:function(){i.play(h)}}),h}if(n&&!s._paused)return e||i._loadQueue("play"),s._id;i._webAudio&&o._autoResume();var u=Math.max(0,s._seek>0?s._seek:i._sprite[t][0]/1e3),l=Math.max(0,(i._sprite[t][0]+i._sprite[t][1])/1e3-u),c=1e3*l/Math.abs(s._rate),d=i._sprite[t][0]/1e3,p=(i._sprite[t][0]+i._sprite[t][1])/1e3;s._sprite=t,s._ended=!1;var f=function(){s._paused=!1,s._seek=u,s._start=d,s._stop=p,s._loop=!(!s._loop&&!i._sprite[t][2])};if(!(u>=p)){var m=s._node;if(i._webAudio){var g=function(){i._playLock=!1,f(),i._refreshBuffer(s);var t=s._muted||i._muted?0:s._volume;m.gain.setValueAtTime(t,o.ctx.currentTime),s._playStart=o.ctx.currentTime,void 0===m.bufferSource.start?s._loop?m.bufferSource.noteGrainOn(0,u,86400):m.bufferSource.noteGrainOn(0,u,l):s._loop?m.bufferSource.start(0,u,86400):m.bufferSource.start(0,u,l),c!==1/0&&(i._endTimers[s._id]=setTimeout(i._ended.bind(i,s),c)),e||setTimeout((function(){i._emit("play",s._id),i._loadQueue()}),0)};"running"===o.state&&"interrupted"!==o.ctx.state?g():(i._playLock=!0,i.once("resume",g),i._clearTimer(s._id))}else{var y=function(){m.currentTime=u,m.muted=s._muted||i._muted||o._muted||m.muted,m.volume=s._volume*o.volume(),m.playbackRate=s._rate;try{var n=m.play();if(n&&"undefined"!=typeof Promise&&(n instanceof Promise||"function"==typeof n.then)?(i._playLock=!0,f(),n.then((function(){i._playLock=!1,m._unlocked=!0,e?i._loadQueue():i._emit("play",s._id)})).catch((function(){i._playLock=!1,i._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),s._ended=!0,s._paused=!0}))):e||(i._playLock=!1,f(),i._emit("play",s._id)),m.playbackRate=s._rate,m.paused)return void i._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==t||s._loop?i._endTimers[s._id]=setTimeout(i._ended.bind(i,s),c):(i._endTimers[s._id]=function(){i._ended(s),m.removeEventListener("ended",i._endTimers[s._id],!1)},m.addEventListener("ended",i._endTimers[s._id],!1))}catch(t){i._emit("playerror",s._id,t)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===m.src&&(m.src=i._src,m.load());var v=window&&window.ejecta||!m.readyState&&o._navigator.isCocoonJS;if(m.readyState>=3||v)y();else{i._playLock=!0,i._state="loading";var b=function(){i._state="loaded",y(),m.removeEventListener(o._canPlayEvent,b,!1)};m.addEventListener(o._canPlayEvent,b,!1),i._clearTimer(s._id)}}return s._id}i._ended(s)},pause:function(t){var e=this;if("loaded"!==e._state||e._playLock)return e._queue.push({event:"pause",action:function(){e.pause(t)}}),e;for(var i=e._getSoundIds(t),n=0;n<i.length;n++){e._clearTimer(i[n]);var r=e._soundById(i[n]);if(r&&!r._paused&&(r._seek=e.seek(i[n]),r._rateSeek=0,r._paused=!0,e._stopFade(i[n]),r._node))if(e._webAudio){if(!r._node.bufferSource)continue;void 0===r._node.bufferSource.stop?r._node.bufferSource.noteOff(0):r._node.bufferSource.stop(0),e._cleanBuffer(r._node)}else isNaN(r._node.duration)&&r._node.duration!==1/0||r._node.pause();arguments[1]||e._emit("pause",r?r._id:null)}return e},stop:function(t,e){var i=this;if("loaded"!==i._state||i._playLock)return i._queue.push({event:"stop",action:function(){i.stop(t)}}),i;for(var n=i._getSoundIds(t),r=0;r<n.length;r++){i._clearTimer(n[r]);var o=i._soundById(n[r]);o&&(o._seek=o._start||0,o._rateSeek=0,o._paused=!0,o._ended=!0,i._stopFade(n[r]),o._node&&(i._webAudio?o._node.bufferSource&&(void 0===o._node.bufferSource.stop?o._node.bufferSource.noteOff(0):o._node.bufferSource.stop(0),i._cleanBuffer(o._node)):isNaN(o._node.duration)&&o._node.duration!==1/0||(o._node.currentTime=o._start||0,o._node.pause(),o._node.duration===1/0&&i._clearSound(o._node))),e||i._emit("stop",o._id))}return i},mute:function(t,e){var i=this;if("loaded"!==i._state||i._playLock)return i._queue.push({event:"mute",action:function(){i.mute(t,e)}}),i;if(void 0===e){if("boolean"!=typeof t)return i._muted;i._muted=t}for(var n=i._getSoundIds(e),r=0;r<n.length;r++){var a=i._soundById(n[r]);a&&(a._muted=t,a._interval&&i._stopFade(a._id),i._webAudio&&a._node?a._node.gain.setValueAtTime(t?0:a._volume,o.ctx.currentTime):a._node&&(a._node.muted=!!o._muted||t),i._emit("mute",a._id))}return i},volume:function(){var t,e,i,n=this,r=arguments;if(0===r.length)return n._volume;if(1===r.length||2===r.length&&void 0===r[1]){var a=n._getSoundIds(),s=a.indexOf(r[0]);s>=0?e=parseInt(r[0],10):t=parseFloat(r[0])}else r.length>=2&&(t=parseFloat(r[0]),e=parseInt(r[1],10));if(!(void 0!==t&&t>=0&&t<=1))return(i=e?n._soundById(e):n._sounds[0])?i._volume:0;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"volume",action:function(){n.volume.apply(n,r)}}),n;void 0===e&&(n._volume=t),e=n._getSoundIds(e);for(var h=0;h<e.length;h++)(i=n._soundById(e[h]))&&(i._volume=t,r[2]||n._stopFade(e[h]),n._webAudio&&i._node&&!i._muted?i._node.gain.setValueAtTime(t,o.ctx.currentTime):i._node&&!i._muted&&(i._node.volume=t*o.volume()),n._emit("volume",i._id));return n},fade:function(t,e,i,n){var r=this;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"fade",action:function(){r.fade(t,e,i,n)}}),r;t=Math.min(Math.max(0,parseFloat(t)),1),e=Math.min(Math.max(0,parseFloat(e)),1),i=parseFloat(i),r.volume(t,n);for(var a=r._getSoundIds(n),s=0;s<a.length;s++){var h=r._soundById(a[s]);if(h){if(n||r._stopFade(a[s]),r._webAudio&&!h._muted){var u=o.ctx.currentTime,l=u+i/1e3;h._volume=t,h._node.gain.setValueAtTime(t,u),h._node.gain.linearRampToValueAtTime(e,l)}r._startFadeInterval(h,t,e,i,a[s],void 0===n)}}return r},_startFadeInterval:function(t,e,i,n,r,o){var a=this,s=e,h=i-e,u=Math.abs(h/.01),l=Math.max(4,u>0?n/u:n),c=Date.now();t._fadeTo=i,t._interval=setInterval((function(){var r=(Date.now()-c)/n;c=Date.now(),s+=h*r,s=Math.round(100*s)/100,s=h<0?Math.max(i,s):Math.min(i,s),a._webAudio?t._volume=s:a.volume(s,t._id,!0),o&&(a._volume=s),(i<e&&s<=i||i>e&&s>=i)&&(clearInterval(t._interval),t._interval=null,t._fadeTo=null,a.volume(i,t._id),a._emit("fade",t._id))}),l)},_stopFade:function(t){var e=this._soundById(t);return e&&e._interval&&(this._webAudio&&e._node.gain.cancelScheduledValues(o.ctx.currentTime),clearInterval(e._interval),e._interval=null,this.volume(e._fadeTo,t),e._fadeTo=null,this._emit("fade",t)),this},loop:function(){var t,e,i,n=this,r=arguments;if(0===r.length)return n._loop;if(1===r.length){if("boolean"!=typeof r[0])return!!(i=n._soundById(parseInt(r[0],10)))&&i._loop;t=r[0],n._loop=t}else 2===r.length&&(t=r[0],e=parseInt(r[1],10));for(var o=n._getSoundIds(e),a=0;a<o.length;a++)(i=n._soundById(o[a]))&&(i._loop=t,n._webAudio&&i._node&&i._node.bufferSource&&(i._node.bufferSource.loop=t,t&&(i._node.bufferSource.loopStart=i._start||0,i._node.bufferSource.loopEnd=i._stop,n.playing(o[a])&&(n.pause(o[a],!0),n.play(o[a],!0)))));return n},rate:function(){var t,e,i,n=this,r=arguments;if(0===r.length)e=n._sounds[0]._id;else if(1===r.length){var a=n._getSoundIds(),s=a.indexOf(r[0]);s>=0?e=parseInt(r[0],10):t=parseFloat(r[0])}else 2===r.length&&(t=parseFloat(r[0]),e=parseInt(r[1],10));if("number"!=typeof t)return(i=n._soundById(e))?i._rate:n._rate;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"rate",action:function(){n.rate.apply(n,r)}}),n;void 0===e&&(n._rate=t),e=n._getSoundIds(e);for(var h=0;h<e.length;h++)if(i=n._soundById(e[h])){n.playing(e[h])&&(i._rateSeek=n.seek(e[h]),i._playStart=n._webAudio?o.ctx.currentTime:i._playStart),i._rate=t,n._webAudio&&i._node&&i._node.bufferSource?i._node.bufferSource.playbackRate.setValueAtTime(t,o.ctx.currentTime):i._node&&(i._node.playbackRate=t);var u=n.seek(e[h]),l=(n._sprite[i._sprite][0]+n._sprite[i._sprite][1])/1e3-u,c=1e3*l/Math.abs(i._rate);!n._endTimers[e[h]]&&i._paused||(n._clearTimer(e[h]),n._endTimers[e[h]]=setTimeout(n._ended.bind(n,i),c)),n._emit("rate",i._id)}return n},seek:function(){var t,e,i=this,n=arguments;if(0===n.length)i._sounds.length&&(e=i._sounds[0]._id);else if(1===n.length){var r=i._getSoundIds(),a=r.indexOf(n[0]);a>=0?e=parseInt(n[0],10):i._sounds.length&&(e=i._sounds[0]._id,t=parseFloat(n[0]))}else 2===n.length&&(t=parseFloat(n[0]),e=parseInt(n[1],10));if(void 0===e)return 0;if("number"==typeof t&&("loaded"!==i._state||i._playLock))return i._queue.push({event:"seek",action:function(){i.seek.apply(i,n)}}),i;var s=i._soundById(e);if(s){if(!("number"==typeof t&&t>=0)){if(i._webAudio){var h=i.playing(e)?o.ctx.currentTime-s._playStart:0,u=s._rateSeek?s._rateSeek-s._seek:0;return s._seek+(u+h*Math.abs(s._rate))}return s._node.currentTime}var l=i.playing(e);l&&i.pause(e,!0),s._seek=t,s._ended=!1,i._clearTimer(e),i._webAudio||!s._node||isNaN(s._node.duration)||(s._node.currentTime=t);var c=function(){l&&i.play(e,!0),i._emit("seek",e)};if(l&&!i._webAudio){var d=function(){i._playLock?setTimeout(d,0):c()};setTimeout(d,0)}else c()}return i},playing:function(t){if("number"==typeof t){var e=this._soundById(t);return!!e&&!e._paused}for(var i=0;i<this._sounds.length;i++)if(!this._sounds[i]._paused)return!0;return!1},duration:function(t){var e=this._duration,i=this._soundById(t);return i&&(e=this._sprite[i._sprite][1]/1e3),e},state:function(){return this._state},unload:function(){for(var t=this,e=t._sounds,i=0;i<e.length;i++)e[i]._paused||t.stop(e[i]._id),t._webAudio||(t._clearSound(e[i]._node),e[i]._node.removeEventListener("error",e[i]._errorFn,!1),e[i]._node.removeEventListener(o._canPlayEvent,e[i]._loadFn,!1),e[i]._node.removeEventListener("ended",e[i]._endFn,!1),o._releaseHtml5Audio(e[i]._node)),delete e[i]._node,t._clearTimer(e[i]._id);var n=o._howls.indexOf(t);n>=0&&o._howls.splice(n,1);var r=!0;for(i=0;i<o._howls.length;i++)if(o._howls[i]._src===t._src||t._src.indexOf(o._howls[i]._src)>=0){r=!1;break}return h&&r&&delete h[t._src],o.noAudio=!1,t._state="unloaded",t._sounds=[],t=null,null},on:function(t,e,i,n){var r=this["_on"+t];return"function"==typeof e&&r.push(n?{id:i,fn:e,once:n}:{id:i,fn:e}),this},off:function(t,e,i){var n=this["_on"+t],r=0;if("number"==typeof e&&(i=e,e=null),e||i)for(r=0;r<n.length;r++){var o=i===n[r].id;if(e===n[r].fn&&o||!e&&o){n.splice(r,1);break}}else if(t)this["_on"+t]=[];else{var a=Object.keys(this);for(r=0;r<a.length;r++)0===a[r].indexOf("_on")&&Array.isArray(this[a[r]])&&(this[a[r]]=[])}return this},once:function(t,e,i){return this.on(t,e,i,1),this},_emit:function(t,e,i){for(var n=this["_on"+t],r=n.length-1;r>=0;r--)n[r].id&&n[r].id!==e&&"load"!==t||(setTimeout(function(t){t.call(this,e,i)}.bind(this,n[r].fn),0),n[r].once&&this.off(t,n[r].fn,n[r].id));return this._loadQueue(t),this},_loadQueue:function(t){if(this._queue.length>0){var e=this._queue[0];e.event===t&&(this._queue.shift(),this._loadQueue()),t||e.action()}return this},_ended:function(t){var e=t._sprite;if(!this._webAudio&&t._node&&!t._node.paused&&!t._node.ended&&t._node.currentTime<t._stop)return setTimeout(this._ended.bind(this,t),100),this;var i=!(!t._loop&&!this._sprite[e][2]);if(this._emit("end",t._id),!this._webAudio&&i&&this.stop(t._id,!0).play(t._id),this._webAudio&&i){this._emit("play",t._id),t._seek=t._start||0,t._rateSeek=0,t._playStart=o.ctx.currentTime;var n=1e3*(t._stop-t._start)/Math.abs(t._rate);this._endTimers[t._id]=setTimeout(this._ended.bind(this,t),n)}return this._webAudio&&!i&&(t._paused=!0,t._ended=!0,t._seek=t._start||0,t._rateSeek=0,this._clearTimer(t._id),this._cleanBuffer(t._node),o._autoSuspend()),this._webAudio||i||this.stop(t._id,!0),this},_clearTimer:function(t){if(this._endTimers[t]){if("function"!=typeof this._endTimers[t])clearTimeout(this._endTimers[t]);else{var e=this._soundById(t);e&&e._node&&e._node.removeEventListener("ended",this._endTimers[t],!1)}delete this._endTimers[t]}return this},_soundById:function(t){for(var e=0;e<this._sounds.length;e++)if(t===this._sounds[e]._id)return this._sounds[e];return null},_inactiveSound:function(){this._drain();for(var t=0;t<this._sounds.length;t++)if(this._sounds[t]._ended)return this._sounds[t].reset();return new s(this)},_drain:function(){var t=this._pool,e=0,i=0;if(!(this._sounds.length<t)){for(i=0;i<this._sounds.length;i++)this._sounds[i]._ended&&e++;for(i=this._sounds.length-1;i>=0;i--){if(e<=t)return;this._sounds[i]._ended&&(this._webAudio&&this._sounds[i]._node&&this._sounds[i]._node.disconnect(0),this._sounds.splice(i,1),e--)}}},_getSoundIds:function(t){if(void 0===t){for(var e=[],i=0;i<this._sounds.length;i++)e.push(this._sounds[i]._id);return e}return[t]},_refreshBuffer:function(t){return t._node.bufferSource=o.ctx.createBufferSource(),t._node.bufferSource.buffer=h[this._src],t._panner?t._node.bufferSource.connect(t._panner):t._node.bufferSource.connect(t._node),t._node.bufferSource.loop=t._loop,t._loop&&(t._node.bufferSource.loopStart=t._start||0,t._node.bufferSource.loopEnd=t._stop||0),t._node.bufferSource.playbackRate.setValueAtTime(t._rate,o.ctx.currentTime),this},_cleanBuffer:function(t){var e=o._navigator&&o._navigator.vendor.indexOf("Apple")>=0;if(o._scratchBuffer&&t.bufferSource&&(t.bufferSource.onended=null,t.bufferSource.disconnect(0),e))try{t.bufferSource.buffer=o._scratchBuffer}catch(t){}return t.bufferSource=null,this},_clearSound:function(t){/MSIE |Trident\//.test(o._navigator&&o._navigator.userAgent)||(t.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var s=function(t){this._parent=t,this.init()};s.prototype={init:function(){var t=this._parent;return this._muted=t._muted,this._loop=t._loop,this._volume=t._volume,this._rate=t._rate,this._seek=0,this._paused=!0,this._ended=!0,this._sprite="__default",this._id=++o._counter,t._sounds.push(this),this.create(),this},create:function(){var t=this._parent,e=o._muted||this._muted||this._parent._muted?0:this._volume;return t._webAudio?(this._node=void 0===o.ctx.createGain?o.ctx.createGainNode():o.ctx.createGain(),this._node.gain.setValueAtTime(e,o.ctx.currentTime),this._node.paused=!0,this._node.connect(o.masterGain)):o.noAudio||(this._node=o._obtainHtml5Audio(),this._errorFn=this._errorListener.bind(this),this._node.addEventListener("error",this._errorFn,!1),this._loadFn=this._loadListener.bind(this),this._node.addEventListener(o._canPlayEvent,this._loadFn,!1),this._endFn=this._endListener.bind(this),this._node.addEventListener("ended",this._endFn,!1),this._node.src=t._src,this._node.preload=!0===t._preload?"auto":t._preload,this._node.volume=e*o.volume(),this._node.load()),this},reset:function(){var t=this._parent;return this._muted=t._muted,this._loop=t._loop,this._volume=t._volume,this._rate=t._rate,this._seek=0,this._rateSeek=0,this._paused=!0,this._ended=!0,this._sprite="__default",this._id=++o._counter,this},_errorListener:function(){this._parent._emit("loaderror",this._id,this._node.error?this._node.error.code:0),this._node.removeEventListener("error",this._errorFn,!1)},_loadListener:function(){var t=this._parent;t._duration=Math.ceil(10*this._node.duration)/10,0===Object.keys(t._sprite).length&&(t._sprite={__default:[0,1e3*t._duration]}),"loaded"!==t._state&&(t._state="loaded",t._emit("load"),t._loadQueue()),this._node.removeEventListener(o._canPlayEvent,this._loadFn,!1)},_endListener:function(){var t=this._parent;t._duration===1/0&&(t._duration=Math.ceil(10*this._node.duration)/10,t._sprite.__default[1]===1/0&&(t._sprite.__default[1]=1e3*t._duration),t._ended(this)),this._node.removeEventListener("ended",this._endFn,!1)}};var h={},u=function(t){var e=t._src;if(h[e])return t._duration=h[e].duration,void d(t);if(/^data:[^;]+;base64,/.test(e)){for(var i=atob(e.split(",")[1]),n=new Uint8Array(i.length),r=0;r<i.length;++r)n[r]=i.charCodeAt(r);c(n.buffer,t)}else{var o=new XMLHttpRequest;o.open(t._xhr.method,e,!0),o.withCredentials=t._xhr.withCredentials,o.responseType="arraybuffer",t._xhr.headers&&Object.keys(t._xhr.headers).forEach((function(e){o.setRequestHeader(e,t._xhr.headers[e])})),o.onload=function(){var e=(o.status+"")[0];"0"===e||"2"===e||"3"===e?c(o.response,t):t._emit("loaderror",null,"Failed loading audio file with status: "+o.status+".")},o.onerror=function(){t._webAudio&&(t._html5=!0,t._webAudio=!1,t._sounds=[],delete h[e],t.load())},l(o)}},l=function(t){try{t.send()}catch(e){t.onerror()}},c=function(t,e){var i=function(){e._emit("loaderror",null,"Decoding audio data failed.")},n=function(t){t&&e._sounds.length>0?(h[e._src]=t,d(e,t)):i()};"undefined"!=typeof Promise&&1===o.ctx.decodeAudioData.length?o.ctx.decodeAudioData(t).then(n).catch(i):o.ctx.decodeAudioData(t,n,i)},d=function(t,e){e&&!t._duration&&(t._duration=e.duration),0===Object.keys(t._sprite).length&&(t._sprite={__default:[0,1e3*t._duration]}),"loaded"!==t._state&&(t._state="loaded",t._emit("load"),t._loadQueue())},p=function(){if(o.usingWebAudio){try{"undefined"!=typeof AudioContext?o.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?o.ctx=new webkitAudioContext:o.usingWebAudio=!1}catch(t){o.usingWebAudio=!1}o.ctx||(o.usingWebAudio=!1);var t=/iP(hone|od|ad)/.test(o._navigator&&o._navigator.platform),e=o._navigator&&o._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),i=e?parseInt(e[1],10):null;if(t&&i&&i<9){var n=/safari/.test(o._navigator&&o._navigator.userAgent.toLowerCase());o._navigator&&!n&&(o.usingWebAudio=!1)}o.usingWebAudio&&(o.masterGain=void 0===o.ctx.createGain?o.ctx.createGainNode():o.ctx.createGain(),o.masterGain.gain.setValueAtTime(o._muted?0:o._volume,o.ctx.currentTime),o.masterGain.connect(o.ctx.destination)),o._setup()}};void 0===(n=function(){return{Howler:o,Howl:a}}.apply(e,[]))||(t.exports=n),e.Howler=o,e.Howl=a,void 0!==i?(i.HowlerGlobal=r,i.Howler=o,i.Howl=a,i.Sound=s):"undefined"!=typeof window&&(window.HowlerGlobal=r,window.Howler=o,window.Howl=a,window.Sound=s)}(),function(){"use strict";var t;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(t){if(!this.ctx||!this.ctx.listener)return this;for(var e=this._howls.length-1;e>=0;e--)this._howls[e].stereo(t);return this},HowlerGlobal.prototype.pos=function(t,e,i){return this.ctx&&this.ctx.listener?(e="number"!=typeof e?this._pos[1]:e,i="number"!=typeof i?this._pos[2]:i,"number"!=typeof t?this._pos:(this._pos=[t,e,i],void 0!==this.ctx.listener.positionX?(this.ctx.listener.positionX.setTargetAtTime(this._pos[0],Howler.ctx.currentTime,.1),this.ctx.listener.positionY.setTargetAtTime(this._pos[1],Howler.ctx.currentTime,.1),this.ctx.listener.positionZ.setTargetAtTime(this._pos[2],Howler.ctx.currentTime,.1)):this.ctx.listener.setPosition(this._pos[0],this._pos[1],this._pos[2]),this)):this},HowlerGlobal.prototype.orientation=function(t,e,i,n,r,o){if(!this.ctx||!this.ctx.listener)return this;var a=this._orientation;return e="number"!=typeof e?a[1]:e,i="number"!=typeof i?a[2]:i,n="number"!=typeof n?a[3]:n,r="number"!=typeof r?a[4]:r,o="number"!=typeof o?a[5]:o,"number"!=typeof t?a:(this._orientation=[t,e,i,n,r,o],void 0!==this.ctx.listener.forwardX?(this.ctx.listener.forwardX.setTargetAtTime(t,Howler.ctx.currentTime,.1),this.ctx.listener.forwardY.setTargetAtTime(e,Howler.ctx.currentTime,.1),this.ctx.listener.forwardZ.setTargetAtTime(i,Howler.ctx.currentTime,.1),this.ctx.listener.upX.setTargetAtTime(n,Howler.ctx.currentTime,.1),this.ctx.listener.upY.setTargetAtTime(r,Howler.ctx.currentTime,.1),this.ctx.listener.upZ.setTargetAtTime(o,Howler.ctx.currentTime,.1)):this.ctx.listener.setOrientation(t,e,i,n,r,o),this)},Howl.prototype.init=(t=Howl.prototype.init,function(e){return this._orientation=e.orientation||[1,0,0],this._stereo=e.stereo||null,this._pos=e.pos||null,this._pannerAttr={coneInnerAngle:void 0!==e.coneInnerAngle?e.coneInnerAngle:360,coneOuterAngle:void 0!==e.coneOuterAngle?e.coneOuterAngle:360,coneOuterGain:void 0!==e.coneOuterGain?e.coneOuterGain:0,distanceModel:void 0!==e.distanceModel?e.distanceModel:"inverse",maxDistance:void 0!==e.maxDistance?e.maxDistance:1e4,panningModel:void 0!==e.panningModel?e.panningModel:"HRTF",refDistance:void 0!==e.refDistance?e.refDistance:1,rolloffFactor:void 0!==e.rolloffFactor?e.rolloffFactor:1},this._onstereo=e.onstereo?[{fn:e.onstereo}]:[],this._onpos=e.onpos?[{fn:e.onpos}]:[],this._onorientation=e.onorientation?[{fn:e.onorientation}]:[],t.call(this,e)}),Howl.prototype.stereo=function(t,i){var n=this;if(!n._webAudio)return n;if("loaded"!==n._state)return n._queue.push({event:"stereo",action:function(){n.stereo(t,i)}}),n;var r=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===i){if("number"!=typeof t)return n._stereo;n._stereo=t,n._pos=[t,0,0]}for(var o=n._getSoundIds(i),a=0;a<o.length;a++){var s=n._soundById(o[a]);if(s){if("number"!=typeof t)return s._stereo;s._stereo=t,s._pos=[t,0,0],s._node&&(s._pannerAttr.panningModel="equalpower",s._panner&&s._panner.pan||e(s,r),"spatial"===r?void 0!==s._panner.positionX?(s._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),s._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),s._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):s._panner.setPosition(t,0,0):s._panner.pan.setValueAtTime(t,Howler.ctx.currentTime)),n._emit("stereo",s._id)}}return n},Howl.prototype.pos=function(t,i,n,r){var o=this;if(!o._webAudio)return o;if("loaded"!==o._state)return o._queue.push({event:"pos",action:function(){o.pos(t,i,n,r)}}),o;if(i="number"!=typeof i?0:i,n="number"!=typeof n?-.5:n,void 0===r){if("number"!=typeof t)return o._pos;o._pos=[t,i,n]}for(var a=o._getSoundIds(r),s=0;s<a.length;s++){var h=o._soundById(a[s]);if(h){if("number"!=typeof t)return h._pos;h._pos=[t,i,n],h._node&&(h._panner&&!h._panner.pan||e(h,"spatial"),void 0!==h._panner.positionX?(h._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),h._panner.positionY.setValueAtTime(i,Howler.ctx.currentTime),h._panner.positionZ.setValueAtTime(n,Howler.ctx.currentTime)):h._panner.setPosition(t,i,n)),o._emit("pos",h._id)}}return o},Howl.prototype.orientation=function(t,i,n,r){var o=this;if(!o._webAudio)return o;if("loaded"!==o._state)return o._queue.push({event:"orientation",action:function(){o.orientation(t,i,n,r)}}),o;if(i="number"!=typeof i?o._orientation[1]:i,n="number"!=typeof n?o._orientation[2]:n,void 0===r){if("number"!=typeof t)return o._orientation;o._orientation=[t,i,n]}for(var a=o._getSoundIds(r),s=0;s<a.length;s++){var h=o._soundById(a[s]);if(h){if("number"!=typeof t)return h._orientation;h._orientation=[t,i,n],h._node&&(h._panner||(h._pos||(h._pos=o._pos||[0,0,-.5]),e(h,"spatial")),void 0!==h._panner.orientationX?(h._panner.orientationX.setValueAtTime(t,Howler.ctx.currentTime),h._panner.orientationY.setValueAtTime(i,Howler.ctx.currentTime),h._panner.orientationZ.setValueAtTime(n,Howler.ctx.currentTime)):h._panner.setOrientation(t,i,n)),o._emit("orientation",h._id)}}return o},Howl.prototype.pannerAttr=function(){var t,i,n,r=this,o=arguments;if(!r._webAudio)return r;if(0===o.length)return r._pannerAttr;if(1===o.length){if("object"!=typeof o[0])return(n=r._soundById(parseInt(o[0],10)))?n._pannerAttr:r._pannerAttr;t=o[0],void 0===i&&(t.pannerAttr||(t.pannerAttr={coneInnerAngle:t.coneInnerAngle,coneOuterAngle:t.coneOuterAngle,coneOuterGain:t.coneOuterGain,distanceModel:t.distanceModel,maxDistance:t.maxDistance,refDistance:t.refDistance,rolloffFactor:t.rolloffFactor,panningModel:t.panningModel}),r._pannerAttr={coneInnerAngle:void 0!==t.pannerAttr.coneInnerAngle?t.pannerAttr.coneInnerAngle:r._coneInnerAngle,coneOuterAngle:void 0!==t.pannerAttr.coneOuterAngle?t.pannerAttr.coneOuterAngle:r._coneOuterAngle,coneOuterGain:void 0!==t.pannerAttr.coneOuterGain?t.pannerAttr.coneOuterGain:r._coneOuterGain,distanceModel:void 0!==t.pannerAttr.distanceModel?t.pannerAttr.distanceModel:r._distanceModel,maxDistance:void 0!==t.pannerAttr.maxDistance?t.pannerAttr.maxDistance:r._maxDistance,refDistance:void 0!==t.pannerAttr.refDistance?t.pannerAttr.refDistance:r._refDistance,rolloffFactor:void 0!==t.pannerAttr.rolloffFactor?t.pannerAttr.rolloffFactor:r._rolloffFactor,panningModel:void 0!==t.pannerAttr.panningModel?t.pannerAttr.panningModel:r._panningModel})}else 2===o.length&&(t=o[0],i=parseInt(o[1],10));for(var a=r._getSoundIds(i),s=0;s<a.length;s++)if(n=r._soundById(a[s])){var h=n._pannerAttr;h={coneInnerAngle:void 0!==t.coneInnerAngle?t.coneInnerAngle:h.coneInnerAngle,coneOuterAngle:void 0!==t.coneOuterAngle?t.coneOuterAngle:h.coneOuterAngle,coneOuterGain:void 0!==t.coneOuterGain?t.coneOuterGain:h.coneOuterGain,distanceModel:void 0!==t.distanceModel?t.distanceModel:h.distanceModel,maxDistance:void 0!==t.maxDistance?t.maxDistance:h.maxDistance,refDistance:void 0!==t.refDistance?t.refDistance:h.refDistance,rolloffFactor:void 0!==t.rolloffFactor?t.rolloffFactor:h.rolloffFactor,panningModel:void 0!==t.panningModel?t.panningModel:h.panningModel};var u=n._panner;u?(u.coneInnerAngle=h.coneInnerAngle,u.coneOuterAngle=h.coneOuterAngle,u.coneOuterGain=h.coneOuterGain,u.distanceModel=h.distanceModel,u.maxDistance=h.maxDistance,u.refDistance=h.refDistance,u.rolloffFactor=h.rolloffFactor,u.panningModel=h.panningModel):(n._pos||(n._pos=r._pos||[0,0,-.5]),e(n,"spatial"))}return r},Sound.prototype.init=function(t){return function(){var e=this._parent;this._orientation=e._orientation,this._stereo=e._stereo,this._pos=e._pos,this._pannerAttr=e._pannerAttr,t.call(this),this._stereo?e.stereo(this._stereo):this._pos&&e.pos(this._pos[0],this._pos[1],this._pos[2],this._id)}}(Sound.prototype.init),Sound.prototype.reset=function(t){return function(){var e=this._parent;return this._orientation=e._orientation,this._stereo=e._stereo,this._pos=e._pos,this._pannerAttr=e._pannerAttr,this._stereo?e.stereo(this._stereo):this._pos?e.pos(this._pos[0],this._pos[1],this._pos[2],this._id):this._panner&&(this._panner.disconnect(0),this._panner=void 0,e._refreshBuffer(this)),t.call(this)}}(Sound.prototype.reset);var e=function(t,e){"spatial"===(e=e||"spatial")?(t._panner=Howler.ctx.createPanner(),t._panner.coneInnerAngle=t._pannerAttr.coneInnerAngle,t._panner.coneOuterAngle=t._pannerAttr.coneOuterAngle,t._panner.coneOuterGain=t._pannerAttr.coneOuterGain,t._panner.distanceModel=t._pannerAttr.distanceModel,t._panner.maxDistance=t._pannerAttr.maxDistance,t._panner.refDistance=t._pannerAttr.refDistance,t._panner.rolloffFactor=t._pannerAttr.rolloffFactor,t._panner.panningModel=t._pannerAttr.panningModel,void 0!==t._panner.positionX?(t._panner.positionX.setValueAtTime(t._pos[0],Howler.ctx.currentTime),t._panner.positionY.setValueAtTime(t._pos[1],Howler.ctx.currentTime),t._panner.positionZ.setValueAtTime(t._pos[2],Howler.ctx.currentTime)):t._panner.setPosition(t._pos[0],t._pos[1],t._pos[2]),void 0!==t._panner.orientationX?(t._panner.orientationX.setValueAtTime(t._orientation[0],Howler.ctx.currentTime),t._panner.orientationY.setValueAtTime(t._orientation[1],Howler.ctx.currentTime),t._panner.orientationZ.setValueAtTime(t._orientation[2],Howler.ctx.currentTime)):t._panner.setOrientation(t._orientation[0],t._orientation[1],t._orientation[2])):(t._panner=Howler.ctx.createStereoPanner(),t._panner.pan.setValueAtTime(t._stereo,Howler.ctx.currentTime)),t._panner.connect(t._node),t._paused||t._parent.pause(t._id,!0).play(t._id,!0)}}()}).call(this,i(82))},function(t,e,i){var n,r,o;o=function(){function t(t){var e=[];if(0===t.length)return"";if("string"!=typeof t[0])throw new TypeError("Url must be a string. Received "+t[0]);if(t[0].match(/^[^/:]+:\/*$/)&&t.length>1){var i=t.shift();t[0]=i+t[0]}t[0].match(/^file:\/\/\//)?t[0]=t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0]=t[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n<t.length;n++){var r=t[n];if("string"!=typeof r)throw new TypeError("Url must be a string. Received "+r);""!==r&&(n>0&&(r=r.replace(/^[\/]+/,"")),r=n<t.length-1?r.replace(/[\/]+$/,""):r.replace(/[\/]+$/,"/"),e.push(r))}var o=e.join("/"),a=(o=o.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return o=a.shift()+(a.length>0?"?":"")+a.join("&")}return function(){return t("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},t.exports?t.exports=o():void 0===(r="function"==typeof(n=o)?n.call(e,i,e,t):n)||(t.exports=r)},function(t,e,i){"use strict";i.d(e,"a",(function(){return Character_Character}));var n=i(32),r=i(1),o=i(17),a=i(13),s=i(105),h=i(19),u=(i(9),i(18));function l(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Dizzy_Dizzy extends u.a{constructor(...t){super(...t),l(this,"view",void 0),l(this,"trail1",void 0),l(this,"trail2",void 0),l(this,"star1",void 0),l(this,"star2",void 0)}createView(){!this.view&&r.a.library.hasGeometry("Dizzytrail")&&(this.view=new n.a,this.view.y=4,this.view.x=.5,this.trail1=r.a.library.getEntity("Dizzytrail",{map:"effects-tex",opacity:.5,blendMode:1}),this.view.addChild(this.trail1),this.trail2=r.a.library.getEntity("Dizzytrail",{map:"effects-tex",opacity:.5,blendMode:1}),this.trail2.ry=Math.PI,this.view.addChild(this.trail2),this.star1=r.a.library.getEntity("Dizzystar",{map:"effects-tex",opacity:.5,blendMode:1}),this.star1.z=-1.5,this.view.addChild(this.star1),this.star2=r.a.library.getEntity("Dizzystar",{map:"effects-tex",opacity:.5,blendMode:1}),this.star2.z=1.5,this.view.addChild(this.star2),this.view.active=!1,this.view.rx=-.5,this.view.scale.set(1.25))}reset(){this.view&&(this.view.active=!1)}update(t){const e=t.frameTime;this.view&&this.view.active&&(this.view.ry+=.05*e)}turnOn(){if(this.createView(),this.view){if(!this.view.parent){const t=this.entity.gameScene;if(t){const e=o.a.findEntity(t,"Head_jnt",10);null==e||e.addChild(this.view)}}this.view.active=!0,this.view.scale.set(.0125),this.view.y=.04,this.view.x=0}}turnOff(){this.view&&(this.view.parent&&this.view.parent.removeChild(this.view),this.view.active=!1)}}var c=i(6),d=i(0),p=i(28),f=i(2),m=i(185),g=i(14);class ParticleHoverCollision_ParticleHoverCollision extends g.a{constructor(){super(),this.levelEntity=!1,this.view=o.a.particle(16,16,1,"spray-splash"),this.addChild(this.view);const t=a.a.pick(16256769,10287617,12040194);o.a.tint(this.view,t)}}class ParticleSpark_ParticleSpark extends g.a{constructor(){super(),this.levelEntity=!1,this.view=r.a.library.getEntity("grindSpark",{map:"effects-tex",opacity:.8,blendMode:1}),this.view.ry=.5*Math.PI,this.view.view3d&&(this.view.view3d.state.blend=!0,this.view.view3d.state.depthTest=!0,this.view.view3d.orderBias=999),this.addChild(this.view),this.view.scale.set(.3)}}var y=i(498);function v(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const b={EntityClass:null,container:null,rate:5,spawns:1,life:30,color:null,x:0,y:0,z:0,xMod:[0,0],yMod:[0,0],zMod:[0,0],velocityX:0,velocityY:0,velocityZ:0,velocityXMod:[0,0],velocityYMod:[0,0],velocityZMod:[0,0],forceX:0,forceY:0,forceZ:0,forceXMod:[0,0],forceYMod:[0,0],forceZMod:[0,0],scaleX:1,scaleY:1,scaleZ:1,scaleXMod:[0,0],scaleYMod:[0,0],scaleZMod:[0,0],growX:0,growY:0,growZ:0,growXMod:[0,0],growYMod:[0,0],growZMod:[0,0]};function _(t={}){const e={};for(const i in b){const n=b[i],r=t[i];Array.isArray(n)?e[i]=void 0!==r?r.slice(0):n.slice(0):e[i]=void 0!==r?r:n}return e}class Particles_Particle extends u.a{constructor(t,e={}){super(t),this.data=_(e)}spawn(t={}){this.data=_(t),this.entity.x=this.data.x+a.a.range(this.data.xMod[0],this.data.xMod[1]),this.entity.y=this.data.y+a.a.range(this.data.yMod[0],this.data.yMod[1]),this.entity.z=this.data.z+a.a.range(this.data.zMod[0],this.data.zMod[1]),this.entity.scale.x=this.data.scaleX+a.a.range(this.data.scaleXMod[0],this.data.scaleXMod[1]),this.entity.scale.y=this.data.scaleY+a.a.range(this.data.scaleYMod[0],this.data.scaleYMod[1]),this.entity.scale.z=this.data.scaleZ+a.a.range(this.data.scaleZMod[0],this.data.scaleZMod[1]),this.data.growX=this.data.growX+a.a.range(this.data.growXMod[0],this.data.growXMod[1]),this.data.growY=this.data.growY+a.a.range(this.data.growYMod[0],this.data.growYMod[1]),this.data.growZ=this.data.growZ+a.a.range(this.data.growZMod[0],this.data.growZMod[1]),this.data.velocityX+=a.a.range(this.data.velocityXMod[0],this.data.velocityXMod[1]),this.data.velocityY+=a.a.range(this.data.velocityYMod[0],this.data.velocityYMod[1]),this.data.velocityZ+=a.a.range(this.data.velocityZMod[0],this.data.velocityZMod[1]),this.data.forceX+=a.a.range(this.data.forceXMod[0],this.data.forceXMod[1]),this.data.forceY+=a.a.range(this.data.forceYMod[0],this.data.forceYMod[1]),this.data.forceZ+=a.a.range(this.data.forceZMod[0],this.data.forceZMod[1])}updateParticle(t){this.data.life-=t,this.data.life<0&&(this.data.life=0),this.entity.x+=this.data.velocityX*t,this.entity.y+=this.data.velocityY*t,this.entity.z+=this.data.velocityZ*t,this.data.velocityX+=this.data.forceX*t,this.data.velocityY+=this.data.forceY*t,this.data.velocityZ+=this.data.forceZ*t,this.entity.scale.x+=this.data.growX*t,this.entity.scale.y+=this.data.growY*t,this.entity.scale.z+=this.data.growZ*t}}class Particles_Particles extends u.a{constructor(t,e={}){super(t),v(this,"_time",0),v(this,"rateCount",0),v(this,"list",[]),v(this,"idle",!0),v(this,"delta",0),v(this,"_pool",void 0),this.setup(e),this._time=0,this.rateCount=0,this.list=[],this.idle=!0,this.delta=0}get time(){return this._time}set time(t){this.idle=t<=0,this._time=t}setup(t){this.data=_(t),this.reset()}reset(){this.list=[]}update(t){const e=t.frameTime;if(this.idle)return;this.delta=e;let i=this.list.length;for(;i--;){const t=this.list[i].particle;t.updateParticle(e),t.data.life<=0&&this.removeParticle(i)}this.idle=!this.list.length&&!this._time,this._time<=0||(this._time-=e,this._time<0&&(this._time=0),this.rateCount-=e,this.rateCount<=0&&(this.spawn(this.data.spawns),this.rateCount=this.data.rate))}run(t=9999999){this._time=t,this.rateCount=0,this.idle=!1}stop(){this._time=0}clear(){this.stop();let t=this.list.length;for(;t--;)this.removeParticle(t)}removeParticle(t){const e=this.list[t];e&&(this.list.splice(t,1),e.parent&&(e.parent.removeChild(e),this.pool.return(e)))}spawn(t=1,e){e||(e=this.data),this.idle=!1;const i=e.EntityClass,n=this.pool.get(i,{});n.particle||(n.particle=n.addComponent(Particles_Particle)),n.particle.spawn(e);(e.container||this.entity.scene).addChild(n),this.list.push(n),n.particle.active=!0,t>1&&this.spawn(t-1,e)}get pool(){return this._pool||(this._pool=this.entity.scene.getSystem(y.a)),this._pool}}function w(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Hoverboard_Hoverboard extends u.a{constructor(t){super(t),w(this,"count",0),w(this,"duration",30),w(this,"view",void 0),w(this,"paused",!1),w(this,"locked",!1),w(this,"grindingSparks",void 0),w(this,"collisionSmoke",void 0),w(this,"_particlesSparks",void 0),w(this,"_particlesSmoke",void 0),w(this,"boardId",void 0),w(this,"powers",void 0),w(this,"animations",void 0),w(this,"entity",void 0),w(this,"diffuseMaps",{}),w(this,"visualEntities",void 0),this.entity=t}show(){var t;this.view||(this.entity.lane.onLaneChanged.add(this),this.createGrindingSparks(),this.createCollisionSmoke()),this.setBoard(r.a.user.board);this.entity.game.hud.addItemTimer("hoverboard").amount=r.a.user.boosts.consumables.hoverboard,this.view.view3d&&(this.view.view3d.renderable=!0),null===(t=this.entity.state)||void 0===t||t.set("empty")}hide(){this.view&&o.a.toggleRenderable(this.view,!1)}setBoard(t){if(t!==this.boardId&&(this.view=r.a.library.getScene("board-"+t,{map:"board-"+t+"-tex"})),this.entity.anim){const e=o.a.findEntity(this.entity.gameScene,"attachPoint1",5);e&&(e.scale.set(.01),e.addChild(this.view));const i=r.a.data.getBoardData(t),n=(null==i?void 0:i.features)||[],a=[],s=[];r.a.user.boardPowers.forEach(t=>{const e=null==i?void 0:i.powerups[t-1];0!==t&&e&&(a.push(e),e.features&&s.push(...e.features))});const h=[...n,...s],u=o.a.childrenFlatMap(this.view,{},"",4);this.powers=null!=i&&i.powerup?[null==i?void 0:i.powerup]:null==a?void 0:a.map(t=>null==t?void 0:t.id);const l=this.powers.find(t=>"stay-low"===t)||this.powers.find(t=>"zap-sideways"===t)||"hoverboard";this.animations=m.a[t]||m.a[l];for(const t in u){const e=u[t],i=h.includes(e.name);o.a.toggleRenderable(e,i)}}this.visualEntities=o.a.findWithComponent(this.entity,"view3d").filter(t=>"shadow"!==t.name),this.boardId=t}get ratio(){return this.count/this.duration}update(){this.count&&!this.paused&&(this.view.y=.2,this.count-=this.entity.game.stats.delta,this.entity.game.hud.updateItemTimer("hoverboard",this.ratio),this.count<=0&&(this.turnOff(!0),this.entity.game.missions.addStat(1,"mission-hoverboard-nocrash")))}updateGrinding(){f.a.grindParticles&&r.a.library.hasResourcesForFullGameplay()&&(this.grindingSparks.time=10,this.grindingSparks.data.x=this.entity.x-1,this.grindingSparks.data.y=this.entity.y-4.5,this.grindingSparks.data.z=this.entity.z-.5)}enable(){this.entity.game.controller.onDoubleTap.add(this)}disable(){this.entity.game.controller.onDoubleTap.remove(this)}pause(){this.count&&(this.paused=!0,this.hide())}resume(){var t,e;this.count&&this.paused&&(this.paused=!1,null===(t=this.entity.state)||void 0===t||t.set("empty"),this.show(),null===(e=this.entity.anim)||void 0===e||e.play(this.animations.resume,{loop:!1}))}isOn(){return!!this.count&&!this.paused}onDoubleTap(){this.turnOn()}turnOn(){var t,e,i,n,o,a,s,h,u,l,c,d,f,m;if(!this.isOn()&&this.entity.game.state===p.a.RUNNING&&!(null!==(t=this.entity.pogo)&&void 0!==t&&t.isOn()||null!==(e=this.entity.jetpack)&&void 0!==e&&e.isOn()||this.locked)){if(!this.hasHoverboards())return r.a.game.pause(),r.a.game.hud.paused.close(),r.a.buyBoards.open(),void(r.a.buyBoards.onExit=()=>r.a.game.resume(3));this.spendHoverboard(),this.entity.game.missions.addStat(1,"mission-hoverboard"),this.show(),null===(i=this.entity.anim)||void 0===i||i.play(this.animations.start,{loop:!1,sudden:!0}),this.count=this.duration,this.paused=!1,null===(n=this.entity.player)||void 0===n||n.dizzyEnd(),null===(o=this.entity.state)||void 0===o||o.set("empty"),null!==(a=this.powers)&&void 0!==a&&a.includes("super-jump")&&(null===(s=this.entity.jump)||void 0===s||s.enableSuperJump()),null!==(h=this.powers)&&void 0!==h&&h.includes("double-jump")&&(null===(u=this.entity.jump)||void 0===u||u.enableDoubleJump()),null!==(l=this.powers)&&void 0!==l&&l.includes("smooth-drift")&&(null===(c=this.entity.jump)||void 0===c||c.enableSmoothDrift()),null!==(d=this.powers)&&void 0!==d&&d.includes("zap-sideways")&&(this.entity.lane.zapping=!0),null!==(f=this.powers)&&void 0!==f&&f.includes("stay-low")&&(this.entity.regularHeight=5),null!==(m=this.powers)&&void 0!==m&&m.includes("speed-up")&&(this.entity.game.stats.data.speedIncrease.min=50,this.entity.game.stats.data.speedIncrease.max=20),this.entity.popPickup&&this.entity.popPickup.play(),r.a.sound.play("pickup-powerup")}}turnOff(t=!1){var e,i,n,o,a,s,h,u,l,c;this.hide(),this.count&&(this.entity.game.hud.removeItemTimer("hoverboard"),this.count=0,null===(e=this.entity.state)||void 0===e||e.set("empty"),null!==(i=this.powers)&&void 0!==i&&i.includes("super-jump")&&(null===(n=this.entity.jump)||void 0===n||n.disableSuperJump()),null!==(o=this.powers)&&void 0!==o&&o.includes("double-jump")&&(null===(a=this.entity.jump)||void 0===a||a.disableDoubleJump()),null!==(s=this.powers)&&void 0!==s&&s.includes("smooth-drift")&&(null===(h=this.entity.jump)||void 0===h||h.disableSmoothDrift()),null!==(u=this.powers)&&void 0!==u&&u.includes("zap-sideways")&&(this.entity.lane.zapping=!1),null!==(l=this.powers)&&void 0!==l&&l.includes("stay-low")&&(this.entity.regularHeight=11),null!==(c=this.powers)&&void 0!==c&&c.includes("speed-up")&&(this.entity.game.stats.data.speedIncrease.min=0,this.entity.game.stats.data.speedIncrease.max=0),t&&r.a.sound.play("pickup-powerdown"))}cancel(){this.count&&(this.turnOff(),this.returnHoverboard(),this.entity.game.missions.addStat(-1,"mission-hoverboard"))}explode(){var t;this.collisionSmoke.data.x=this.entity.x,this.collisionSmoke.data.y=this.entity.y,this.collisionSmoke.data.z=this.entity.z,this.collisionSmoke.spawn(10),null===(t=this.entity.jump)||void 0===t||t.perform(15,!0)}lock(){this.locked=!0}unlock(){this.locked=!1}get grinding(){return!!this.count&&!this.paused&&this.entity.body.landed&&this.entity.body.ground>29&&this.entity.body.ground<29.2}createGrindingSparks(){this._particlesSparks=new n.a,this.entity.addChild(this._particlesSparks),this.grindingSparks=this._particlesSparks.addComponent(Particles_Particles,{EntityClass:ParticleSpark_ParticleSpark,container:this.entity.scene,rate:.5,spawns:1,life:20,xMod:[-.4,.4],velocityXMod:[-.2,.2],velocityYMod:[.03,.08],velocityZMod:[-.1,-.2],growXMod:[.1,.3],growZMod:[.3,.6]},"grindingSparks")}createCollisionSmoke(){this._particlesSmoke=new n.a,this.entity.addChild(this._particlesSmoke),this.collisionSmoke=this._particlesSmoke.addComponent(Particles_Particles,{EntityClass:ParticleHoverCollision_ParticleHoverCollision,container:this.entity.scene,rate:1,life:60,velocityXMod:[-1.5,1.5],velocityYMod:[1,3],velocityZMod:[-1,-2],scaleXMod:[.8,1.5],scaleYMod:[.8,1.5],scaleZMod:[.8,1.5],growXMod:[.01,.03],growYMod:[.01,.03],growZMod:[.01,.03]},"collisionSmoke")}hasHoverboards(){return r.a.user.boosts.consumables.hoverboard>=1}spendHoverboard(){return!(r.a.user.boosts.consumables.hoverboard<1)&&(r.a.user.boosts.consumables.hoverboard-=1,r.a.user.shopSettings.save(),!0)}returnHoverboard(){r.a.user.boosts.consumables.hoverboard+=1,r.a.user.gameSettings.save()}onLaneChanged(){var t;this.isOn()&&null!==(t=this.powers)&&void 0!==t&&t.includes("zap-sideways")&&(this.visualEntities.forEach(t=>{const e=t.view3d.material;this.diffuseMaps[t.UID]||(this.diffuseMaps[t.UID]=e.diffuseMap,e.diffuseMap=d.Texture.WHITE)}),c.g.to(this.entity.scale,.2,{x:0,z:0,overwrite:!0,onComplete:()=>{c.g.to(this.entity.scale,.1,{overwrite:!0,onComplete:()=>{this.entity.scale.set(1),this.visualEntities.forEach(t=>{t.view3d.material.diffuseMap=this.diffuseMaps[t.UID],this.diffuseMaps[t.UID]=null})}})}}))}}var x=i(47),C=i(10),S=i(64),T=i(66),A=i(240);function E(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Smoke_Smoke extends n.a{constructor(t=5,e=!0){super(),E(this,"speed",void 0),E(this,"view",void 0),E(this,"view2",void 0),E(this,"accumulatedDelta",0),this.speed=t,this.view=this.getView(e),this.view2=this.getView(e),this.view2.y=-73,this.view2.scale.x=1,this.view2.scale.y=2,this.view2.scale.z=2}getView(t=!1){const e=r.a.library.getEntity("jetpackCloud",{map:"jetpack-smoke",material:A.a});if(!e.view3d)throw new Error("View3DComponent not found in Smoke entity");return e.view3d.state.blend=!0,e.view3d.state.culling=!1,e.view3d.material.map.baseTexture.wrapMode=d.WRAP_MODES.REPEAT,this.addChild(e),e.ry=.5*-Math.PI,e.rx=.5*Math.PI,e.scale.set(.25),e.y=-12,e.active=!1,e.view3d.state.depthTest=t,e}animationStep(t=1){var e,i;if(!this.view.active)return;if(this.accumulatedDelta+=t,this.accumulatedDelta<2)return;const n=this.accumulatedDelta*this.speed*.015;(null===(e=this.view.view3d)||void 0===e?void 0:e.material).offset-=n,(null===(i=this.view2.view3d)||void 0===i?void 0:i.material).offset-=n,this.accumulatedDelta=0}turnOn(){this.view.active=!0,this.view2.active=!0}turnOff(){this.view.active=!1,this.view2.active=!1,this.parent&&this.parent.removeChild(this),setTimeout(()=>{this.view.active=!1,this.view2.active=!1,this.parent&&this.parent.removeChild(this)},100)}}function P(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Jetpack_Jetpack extends u.a{constructor(...t){super(...t),P(this,"distance",0),P(this,"distanceTotal",1),P(this,"speed",0),P(this,"ceiling",100),P(this,"coinDistance",30),P(this,"timer",void 0),P(this,"takeOffTime",0),P(this,"takeOffDuration",0),P(this,"takeOffStartY",0),P(this,"takeOffEndY",0),P(this,"rig",void 0),P(this,"rigStartY",0),P(this,"rigStartZ",0),P(this,"smokeLeft",void 0),P(this,"smokeRight",void 0),P(this,"view",void 0),P(this,"headstartLevel",0),P(this,"pickups",[])}calculateDistance(){if(this.headstartLevel)return 2e3+1e3*this.headstartLevel;return 1e3+200*Math.abs(this.speed)+600*Math.abs(r.a.user.boosts.permanents.jetpack)}show(){if(this.view||(this.view=r.a.library.getEntity("powerups_jetpack",{map:"props-tex"})),this.view.ry=Math.PI,this.view.y=.01,this.view.z=.005,this.view.scale.set(.006),this.entity.anim){const t=this.entity.gameScene,e=o.a.findEntity(t,"LowerSpine_jnt",10);e&&e.addChild(this.view)}this.entity.game.sfx.play("special-jetpack-start"),this.entity.game.sfx.play("special-jetpack",{loops:!0}),this.jetpackSmokeOn()}hide(){this.entity.game.hud.removeItemTimer("jetpack"),this.jetpackSmokeOff(),this.entity.game.sfx.stop("special-jetpack"),this.view.parent&&this.view.parent.removeChild(this.view)}get ratio(){return this.distance/this.distanceTotal}update(t){const e=t.frameTime;if(!this.distance)return;this.timer&&(this.timer.ratio=this.ratio);const i=C.a.lerp(this.entity.body.velocity.z,this.speed,.1*e);this.entity.body.velocity.z=i,this.distance-=this.entity.game.stats.distanceDelta,this.entity.game.hud.updateItemTimer("jetpack",this.ratio);const n=this.entity.game.stats.y+f.a.cameraPosY,r=this.entity.game.stats.z+f.a.cameraPosZ;if(this.entity.game.hero.player.cameraY=n,this.takeOffTime<this.takeOffDuration){this.takeOffTime+=this.entity.game.deltaSecs,this.takeOffTime>this.takeOffDuration&&(this.takeOffTime=this.takeOffDuration);const t=this.takeOffTime/this.takeOffDuration;this.entity.body.y=C.a.lerp(this.takeOffStartY,this.takeOffEndY,t),this.rig.mainY=C.a.lerp(this.rigStartY,n,x.a.sineOut(t)),this.rig.mainZ=C.a.lerp(this.rigStartZ,r,x.a.expoOut(t))}else this.rig.mainY=n,this.rig.mainZ=r;this.rig.mainX=this.entity.game.stats.x*f.a.cameraModX,this.rig.mainRotX=f.a.cameraRotX+this.entity.game.hero.player.cameraRotX,this.entity.player&&(this.entity.player.cameraTargetY=this.entity.body.bottom),this.smokeLeft&&this.smokeLeft.animationStep(e),this.smokeRight&&this.smokeRight.animationStep(e),this.distance<=0&&this.turnOff(!0)}turnOn(t=0){var e,i,n,r,o,a,s;this.headstartLevel=t,null===(e=this.entity.player)||void 0===e||e.dizzyEnd(),null===(i=this.entity.sneakers)||void 0===i||i.turnOff(),null===(n=this.entity.pogo)||void 0===n||n.turnOff(),null===(r=this.entity.hoverboard)||void 0===r||r.pause(),null===(o=this.entity.jump)||void 0===o||o.lock(),null===(a=this.entity.roll)||void 0===a||a.lock(),null===(s=this.entity.state)||void 0===s||s.set("empty"),this.entity.body.velocity.y=0,this.entity.body.ghost=!0,this.speed=2*-this.entity.game.stats.speed-1-t;const h=-this.entity.body.z,u=h+this.calculateDistance(),l=this.entity.game.level.setSafeLanding(u);this.distanceTotal=l-h,this.distance=this.distanceTotal,this.takeOffStartY=this.entity.body.y,this.takeOffEndY=100,this.takeOffTime=0,this.takeOffDuration=2,this.rig=this.entity.game.camera.takeControl(),this.rigStartY=this.rig.mainY,this.rigStartZ=this.rig.mainZ,this.show(),t?this.spawnPickups(this.entity.game,this.takeOffEndY,-l):(this.entity.game.hud.addItemTimer("jetpack"),this.spawnCoins(this.entity.game,this.takeOffEndY,this.distance))}turnOff(t=!1){var e,i,n,o;this.distance&&(this.hide(),this.pickups=[],this.headstartLevel=0,this.entity.body.ghost=!1,this.entity.body.velocity.y=0,null===(e=this.entity.jump)||void 0===e||e.unlock(),null===(i=this.entity.roll)||void 0===i||i.unlock(),null!==(n=this.entity.hoverboard)&&void 0!==n&&n.isOn()&&this.entity.hoverboard.show(),this.entity.game.camera.releaseControl(),this.distance=0,this.entity.restoreSize(),null===(o=this.entity.hoverboard)||void 0===o||o.resume(),r.a.game.hud.boostGauge.lowlightHeadstart(),t&&r.a.sound.play("pickup-powerdown"))}isOn(){return!!this.distance}spawnCoins(t,e,i){const n=350*t.stats.speed,r=i-n,o=r/this.coinDistance,s=r/o;let h=0,u=0,l=5;for(let i=0;i<o;i++){const r=t.pool.get(S.a,{});l?l-=1:(h=h?a.a.pick(0,h):a.a.pick(-1,0,1),l=5),u<h?u+=.5:u>h&&(u-=.5),r.body.x=f.a.laneWidth*u,r.body.y=e,r.body.z=t.stats.z-s*i-n,r.arc=0,r.awake(),t.addChild(r)}}spawnPickups(t,e,i){const n=this.pickups[0]||T.c.spawn(t,"magnet"),r=this.pickups[1]||T.c.spawn(t,"multiplier"),o=this.pickups[2]||T.c.spawn(t,"sneakers"),s=a.a.shuffle([-20,0,20]);n.body.x=s[0],n.body.y=e,n.body.z=i,r.body.x=s[1],r.body.y=e,r.body.z=i,o.body.x=s[2],o.body.y=e,o.body.z=i,this.pickups[0]=n,this.pickups[1]=r,this.pickups[2]=o}jetpackSmokeOn(){this.entity.model&&(this.smokeLeft||(this.smokeLeft=new Smoke_Smoke(3,!0),this.smokeLeft.x=.9+this.entity.model.x,this.smokeLeft.y=1.7,this.smokeLeft.z=.5,this.smokeLeft.scale.x=.5,this.smokeLeft.scale.y=2,this.smokeLeft.rotation.x=-C.a.PI_HALF),this.smokeRight||(this.smokeRight=new Smoke_Smoke(3,!0),this.smokeRight.x=-.9+this.entity.model.x,this.smokeRight.y=this.smokeLeft.y,this.smokeRight.z=this.smokeLeft.z,this.smokeRight.scale.x=-this.smokeLeft.scale.x,this.smokeRight.scale.y=this.smokeLeft.scale.y,this.smokeRight.rotation.x=this.smokeLeft.rotation.x),this.entity.addChild(this.smokeLeft),this.entity.addChild(this.smokeRight),this.smokeLeft.turnOn(),this.smokeRight.turnOn())}jetpackSmokeOff(){this.smokeLeft&&this.smokeLeft.turnOff(),this.smokeRight&&this.smokeRight.turnOff()}}function M(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Jump_Jump extends u.a{constructor(t){super(t),M(this,"locked",void 0),M(this,"isJumping",void 0),M(this,"isDoubleJumping",void 0),M(this,"goingUpwards",void 0),M(this,"gravity",void 0),M(this,"boardGravity",void 0),M(this,"time",0),M(this,"duration",0),M(this,"startY",0),M(this,"endY",0),M(this,"jumpHeight",20),M(this,"onJump",void 0),M(this,"_isOn",!1),M(this,"shouldJumpAgain",!1),M(this,"doubleJumpEnabled",!1),M(this,"smoothDriftTick",0),this.onJump=new d.Runner("onJump"),this.reset()}reset(){this.locked=!1,this.isJumping=!1,this.isDoubleJumping=!1,this.goingUpwards=!1,this.gravity=f.a.gravity,this.boardGravity=f.a.gravity}turnOn(){this._isOn||(this._isOn=!0,this.entity.game.controller.onSwipeVertical.add(this))}turnOff(){this._isOn&&(this._isOn=!1,this.entity.game.controller.onSwipeVertical.remove(this))}onSwipeVertical(t){1===t&&(this.isJumping||this.locked||this.onJump.run(),this.perform())}update(t){const e=t.frameTime;if(!this.locked){if(this.shouldJumpAgain&&!this.isJumping&&(this.shouldJumpAgain=!1,this.perform()),this.isJumping&&this.goingUpwards){this.time+=this.entity.game.deltaSecs,this.time>this.duration&&(this.time=this.duration);const t=this.time/this.duration,i=x.a.sineOut(t),n=C.a.lerp(this.startY,this.endY,i);this.entity.body.velocity.y=e?(n-this.entity.body.y)/e:0,t>=1&&(this.entity.body.velocity.y=0,this.goingUpwards=!1)}else this.entity.body.velocity.y-=this.gravity*e;this.isJumping&&!this.goingUpwards&&(this.smoothDriftTick+=.001*this.entity.game.deltaSecs,this.gravity=C.a.lerp(this.gravity,f.a.gravity,this.smoothDriftTick)),this.entity.body.bottom<=this.entity.body.ground+.01&&this.entity.body.velocity.y<=0&&(this.entity.body.velocity.y=0,this.entity.body.bottom=this.entity.body.ground,this.isJumping&&this.end())}}perform(t,e=!1){f.a.freejump&&(e=!0);const i=this.doubleJumpEnabled&&!this.isDoubleJumping;if(!e){if(this.locked)return;if(this.isJumping){if(!i)return void(this.entity.body.velocity.y<0&&(this.shouldJumpAgain=!0));this.isDoubleJumping=!0}else if(!this.entity.body.canJump)return}this.entity.roll&&this.entity.roll.cancel(),this.entity.body.resetGroundChangeTolerance(),this.isJumping=!0,this.entity.body.velocity.y=0,this.entity.body.y+=1,this.startY=this.entity.body.y,this.endY=Math.min(this.startY+(t||this.jumpHeight)-1,70),this.time=0,this.duration=.41,this.goingUpwards=!0,this.smoothDriftTick=0,this.entity.game.sfx.play("hero-jump"),this.entity.game.missions.addStat(1,"mission-jump"),this.gravity=this.boardGravity}enableSuperJump(){this.jumpHeight=30}disableSuperJump(){this.jumpHeight=20}enableDoubleJump(){this.doubleJumpEnabled=!0}disableDoubleJump(){this.doubleJumpEnabled=!1}enableSmoothDrift(){this.boardGravity=.001}disableSmoothDrift(){this.boardGravity=f.a.gravity}end(){this.isJumping=!1,this.isDoubleJumping=!1,this.goingUpwards=!1}cancel(){this.end()}lock(){this.end(),this.locked=!0}unlock(){this.locked=!1,this.gravity=f.a.gravity}}var I=i(145);function k(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Magnet_Magnet extends u.a{constructor(...t){super(...t),k(this,"count",0),k(this,"duration",10),k(this,"view",void 0),k(this,"timer",void 0),k(this,"frozen",!1)}calculateDuration(){return 10+5*Math.abs(r.a.user.boosts.permanents.magnet)}update(){this.count&&!this.frozen&&(this.count-=r.a.game.deltaSecs,this.entity.game.hud.updateItemTimer("magnet",this.ratio),this.count<=0&&this.turnOff(!0))}turnOn(){this.frozen=!1,this.addMagnetModel(),this.duration=this.calculateDuration(),this.entity.game.hud.addItemTimer("magnet"),this.count=this.duration,this.timer=this.entity.game.sfx.play("special-magnet",{loops:!0})}turnOff(t=!1){this.count&&(this.frozen=!1,this.removeMagnetModel(),this.entity.game.hud.removeItemTimer("magnet"),this.count=0,this.view&&this.view.parent&&this.view.parent.removeChild(this.view),this.entity.game.sfx.stop("special-magnet"),t&&r.a.sound.play("pickup-powerdown"))}isOn(){return!!this.count}get ratio(){return this.count/this.duration}freeze(){this.isOn()&&(this.frozen=!0,this.removeMagnetModel())}unfreeze(){this.isOn()&&(this.frozen=!1,this.addMagnetModel())}addMagnetModel(){this.view||(this.view=r.a.library.getEntity("powerups_coinMagnet",{map:"props-tex"}),this.view.rz=.5*Math.PI,this.view.scale.set(.004),this.view.x=-.02,this.view.removeChild(this.view.container.children[1]));const t=this.entity.gameScene;if(t){const e=o.a.findEntity(t,"R_Hand_jnt",10);e&&e.addChild(this.view)}}removeMagnetModel(){this.view&&this.view.parent&&this.view.parent.removeChild(this.view)}}function O(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Multiplier_Multiplier extends u.a{constructor(t,e={}){super(t,e),O(this,"count",0),O(this,"duration",10),O(this,"frozen",!1),this.count=0,this.duration=10}calculateDuration(){return 10+5*Math.abs(r.a.user.boosts.permanents.multiplier)}update(){this.count&&!this.frozen&&(this.count-=this.entity.game.stats.delta,this.entity.game.hud.updateItemTimer("multiplier",this.ratio),this.count<=0&&this.turnOff(!0))}turnOn(){this.frozen=!1,this.duration=this.calculateDuration(),this.count?this.count=this.duration:(this.count=this.duration,this.entity.game.hud.addItemTimer("multiplier"),this.entity.game.stats.multiplier*=2,this.entity.game.stats.missionMultiplier*=2)}turnOff(t=!1){this.count&&(this.frozen=!1,this.entity.game.hud.removeItemTimer("multiplier"),Math.ceil(this.entity.game.stats.multiplier/=2),Math.ceil(this.entity.game.stats.missionMultiplier/=2),this.count=0,t&&r.a.sound.play("pickup-powerdown"))}isOn(){return!!this.count}get ratio(){return this.count/this.duration}freeze(){this.isOn()&&(this.frozen=!0)}unfreeze(){this.isOn()&&(this.frozen=!1)}}var R=i(103);function D(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Notifier_Notifier extends u.a{constructor(t,e={}){super(t,e),D(this,"ignore",["transform","container","notifier"]),D(this,"comps",void 0),this.entity=t}cacheComponents(){this.comps={};for(const t in this.entity){if(this.ignore.indexOf(t)>=0)continue;const e=this.entity[t];e instanceof R.a&&(this.comps[t]=e)}}notify(t,...e){this.comps||this.cacheComponents();for(const i in this.comps){const n=this.comps[i];if(!n)continue;const r=n[t];r&&r.apply(n,e)}}}var L=i(40),N=i(65);function B(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Player_Player extends u.a{constructor(t,e={}){super(t,e),B(this,"dizzy",0),B(this,"jumpLocked",!1),B(this,"rollLocked",!1),B(this,"hoverboardLocked",!1),B(this,"running",!1),B(this,"cameraY",0),B(this,"cameraTargetY",0),B(this,"cameraRotX",0),B(this,"cameraLow",0),B(this,"tunnel",!1),B(this,"dead",!1),B(this,"deathCause",""),B(this,"catchMode",""),B(this,"rewindStartPoint",new N.a),B(this,"rewindEndPoint",null),B(this,"rewinding",!1),B(this,"bumpCount",0),B(this,"rewindDuration",600),B(this,"entity",void 0),this.entity=t,this.entity.lane.onBumpSideways.add(this),this.entity.body.onCollisionEnter.add(this),this.entity.body.onCollisionExit.add(this),this.entity.body.onTriggerEnter.add(this),this.entity.body.onTriggerExit.add(this),this.reset()}reset(t=0,e=0,i=null){this.entity.body.reset(),this.entity.body.lane=0,this.entity.body.x=e,this.entity.body.z=t,this.entity.body.lane=i||0,this.entity.body.bottom=0,this.entity.body.movable=!0,this.entity.body.ghost=!1,this.entity.x=this.entity.body.x,this.entity.y=this.entity.body.y,this.entity.z=this.entity.body.z,this.entity.resetModel(),this.dizzy=0,this.jumpLocked=!1,this.rollLocked=!1,this.hoverboardLocked=!1,this.running=!1,this.cameraY=0,this.cameraTargetY=0,this.cameraRotX=0,this.cameraLow=0,this.tunnel=!1,this.dead=!1,this.deathCause="",this.catchMode="",this.rewindStartPoint=new N.a,this.rewindEndPoint=null}run(t){t||(t=60*f.a.dizzyDuration),this.entity.game.level.onEnterTutorial.contains(this)||(this.entity.game.level.onEnterTutorial.add(this),this.entity.game.level.onExitTutorial.add(this)),this.entity.body.velocity.z=-f.a.speed,this.entity.body.height=this.entity.regularHeight,this.entity.body.bottom=0,this.entity.body.movable=!0,this.running=!0,this.dizzy=t,this.entity.shadow.turnOn(),this.entity.lane.turnOn(),this.entity.jump.turnOn(),this.entity.roll.turnOn(),this.entity.hoverboard.enable(),this.entity.hoverboard.isOn()?this.entity.anim.play(this.entity.hoverboard.animations.run,{loop:!0,sudden:!0}):this.entity.anim.play("run2",{loop:!0,sudden:!0}),this.entity.game.sfx.stop("special-jetpack")}stop(){this.running=!1,this.entity.body.velocity.z=0}render(t){const e=t.frameTime;if(this.rewindEndPoint&&(this.rewinding=!0,this.entity.body.velocity.reset(),this.entity.body.ghost=!0,this.entity.body.x=C.a.lerp(this.entity.body.x,0,.1*e),this.entity.body.bottom=C.a.lerp(this.entity.body.bottom,0,.3*e),this.entity.body.z+=4*e,this.entity.body.z>=this.rewindEndPoint.z-.1&&(this.entity.lane.reset(),this.entity.body.z=this.rewindEndPoint.z,this.entity.body.velocity.z=0,this.entity.body.ghost=!1,this.rewinding=!1,this.reset(this.rewindEndPoint.z),this.run())),this.running&&!this.dead){if(!this.entity.jetpack.isOn()){const t=this.entity.game.stats.speed,i=C.a.lerp(this.entity.body.velocity.z,-t,.1*e);this.entity.body.velocity.z=i}const t=this.entity.body.ground,i=this.entity.body.bottom;t>=this.cameraTargetY&&this.entity.body.landed?this.cameraTargetY=t:i<this.cameraTargetY&&(this.cameraTargetY=i)}else this.entity.body.velocity.z=0;this.cameraY=C.a.lerp(this.cameraY,this.cameraTargetY,.2*e),this.cameraY>this.entity.body.bottom+3&&(this.cameraY=this.entity.body.bottom+3),this.dizzy&&(this.dizzy-=e,this.dizzy<=0&&this.dizzyEnd()),this.bumpCount&&(this.bumpCount-=e,this.bumpCount<=0&&(this.bumpCount=0))}getMode(){return this.entity.hoverboard.isOn()?"hoverboard":this.entity.sneakers.isOn()?"sneakers":"normal"}dizzyStart(){this.dizzy=60*f.a.dizzyDuration,this.entity.dizzy.turnOn(),this.entity.game.sfx.play("hero-stumble")}dizzyEnd(){this.dizzy=0,this.entity.dizzy.turnOff()}lockHoverboard(t){this.hoverboardLocked=t}goBackToLastCheckPoint(){this.entity.anim.play("run3",{loop:!0}),this.rewindDuration=600,this.rewindStartPoint.copy(this.entity.body.center);const t=this.entity.game.level.currentChunk,e=null==t?void 0:t.getLastCheckpointByPosition(this.entity.body.z);e&&(this.rewindEndPoint=e.body.center)}stumble(t,e="lower",i=!1){this.bumpCount&&i||(this.entity.game.camera.shake(3),this.processBumpMission(t),this.dizzy?this.die(e):(this.dizzyStart(),this.bumpCount=20))}crash(t,e="train"){this.cameraLow=0,this.tunnel=!1,this.entity.game.camera.shake(5),this.processBumpMission(t),this.die(e)}processBumpMission(t){const e=this.entity.game;t.includes("light")?e.missions.addStat(1,"mission-bump-lights"):t.includes("train")?e.missions.addStat(1,"mission-bump-trains-onerun"):t.includes("blocker")&&e.missions.addStat(1,"mission-bump-barriers")}die(t){if(!f.a.god){if(this.entity.hoverboard.isOn())return this.dizzyEnd(),this.entity.hoverboard.explode(),this.entity.game.level.removeObstacles(),void setTimeout(()=>{this.entity.hoverboard.explode(),this.entity.hoverboard.turnOff(),this.entity.game.exitTunnel(),this.entity.game.sfx.play("hero-hoverboard-crash")},1);this.entity.body.z+=5,this.dead=!0,this.deathCause=t,this.dizzyEnd(),this.entity.jetpack.turnOff(),this.entity.pogo.turnOff(),this.entity.shadow.turnOff(),this.entity.lane.turnOff(),this.entity.jump.turnOff(),this.entity.roll.turnOff(),this.entity.hoverboard.disable(),this.entity.game.sfx.stop("special-jetpack"),this.entity.game.sfx.play("hero-death"),this.entity.freezePowerUps(),"train"===t&&setTimeout(()=>{this.entity.game.sfx.play("hero-death-hitcam")},600),this.entity.game.level.isTutorial()?setTimeout(()=>{this.goBackToLastCheckPoint()},1e3):this.entity.game.gameover()}}onBumpSideways(t){this.stumble(t,"lower")}onCollisionEnter(t){const e=t.pas.entity.constructor.name.toLowerCase();t.flags&L.a.FRONT?(this.entity.body.velocity.z=0,this.entity.lane.changing||t.hit.height<1?this.stumble(e,"bounce",!0):t.pas.movable?this.crash(e,"train"):t.hit.height>6?this.crash(e,"bounce"):t.hit.y>this.entity.body.y?this.crash(e,"upper"):this.crash(e,"lower")):t.flags&L.a.LEFT||t.flags&L.a.RIGHT?this.entity.lane.bump(e,-this.entity.lane.absStep):t.flags&L.a.SLOPE&&(this.stumble(e,"bounce",!0),this.entity.body.velocity.z*=.5)}onCollisionExit(t){}onTriggerEnter(t){t.entity.lowCamera&&!this.entity.jetpack.isOn()?(this.cameraLow=-15,this.tunnel=!0,this.entity.game.enterTunnel()):t.entity.tutorialTrigger?this.entity.game.tutorial.enterTrigger(t.entity.type):"BlockerDodgeDetector"===t.entity.name&&this.entity.game.missions.addStat(1,"mission-dodge")}onTriggerExit(t){t.entity.lowCamera&&(this.cameraLow=0,this.tunnel=!1,this.entity.game.exitTunnel()),t.entity.tutorialTrigger&&this.entity.game.tutorial.exitTrigger(t.entity.type)}onEnterTutorial(){}onExitTutorial(){}atoreActivePowerUps(){return[this.entity.magnet]}}var F=i(39);function z(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Pogo_Pogo extends u.a{constructor(t,e={}){super(t,e),z(this,"count",0),z(this,"onTurnOn",void 0),z(this,"onTurnOff",void 0),z(this,"onHangtime",void 0),z(this,"view",void 0),z(this,"hangtime",!1),z(this,"position",void 0),z(this,"positionEnd",0),z(this,"camera",void 0),z(this,"cameraStartY",0),z(this,"smoke",void 0),z(this,"settings",{jumpHeight:150,jumpDistance:300,characterChangeTrackLength:60,finalJumpSpeed:0,rows:14,startRowPosition:1,endRowPosition:1,fadeInPosition:.1,hangtimePosition:.6,smoothCameraXDuration:.05}),this.count=0,this.onTurnOn=new F.a("onPogoTurnOn"),this.onTurnOff=new F.a("onPogoTurnOff"),this.onHangtime=new F.a("onPogoHangtime")}show(){this.view||(this.view=r.a.library.getEntity("powerups_rocketPogo",{map:"props-tex"}));const t=this.entity.gameScene;if(t){const e=o.a.findEntity(t,"attachPoint1",10);e&&(e.scale.set(.01),e.addChild(this.view))}this.view.active=!0,this.view.view3d&&(this.view.view3d.renderable=!0),this.pogoSmokeOn()}hide(){this.pogoSmokeOff(),this.view&&(this.view.active=!1,this.view.view3d&&(this.view.view3d.renderable=!1),this.view.parent&&this.view.parent.removeChild(this.view))}turnOn(){var t,e,i,n,r,o,a,s;this.hangtime=!1,null===(t=this.entity.sneakers)||void 0===t||t.pause(),null===(e=this.entity.jetpack)||void 0===e||e.turnOff(),null===(i=this.entity.player)||void 0===i||i.dizzyEnd(),null===(n=this.entity.hoverboard)||void 0===n||n.pause(),null===(r=this.entity.roll)||void 0===r||r.cancel(),this.onTurnOn.dispatch(),null===(o=this.entity.jump)||void 0===o||o.lock(),this.camera=this.entity.game.camera.takeControl(),this.entity.body.ghost=!0,null===(a=this.entity.anim)||void 0===a||a.play(["pogostick_kicking"],{loop:!1}),this.show(),this.position=this.entity.body.center.clone(),this.positionEnd=this.position.z-this.settings.jumpDistance,this.count=1,this.spawnCoins(),this.cameraStartY=this.camera.mainY,null===(s=this.entity.roll)||void 0===s||s.onStart.add(this)}update(t){const e=t.frameTime;if(!this.count)return;const i=this.entity.body.z,n=this.entity.game.stats.speed;if(i>this.positionEnd){const t=-(i-n*e-this.position.z)/this.settings.jumpDistance;let o=this.position.y+Number(this.jumpCurveEvaluate(t))*this.settings.jumpHeight;var r;if(o=C.a.lerp(this.position.y,o,t/this.settings.fadeInPosition),this.entity.body.bottom=o,t>this.settings.hangtimePosition&&!this.hangtime)this.hangtime=!0,this.onHangtime.dispatch(),this.pogoSmokeOff(),null===(r=this.entity.anim)||void 0===r||r.play(["pogostick_Hangtime_flying","pogostick_Hangtime_kick","pogostick_Hangtime_front_flip1"],{loop:!1});const a=.8*x.a.sineIn(t),s=this.entity.game.stats.x*f.a.cameraModX,h=this.entity.game.stats.y+f.a.cameraPosY*a,u=this.entity.game.stats.z+f.a.cameraPosZ,l=x.a.expoOut(t);this.entity.player&&(this.entity.player.cameraY=h),this.camera.mainX=s,this.camera.mainY=C.a.lerp(this.cameraStartY,h,l),this.camera.mainZ=u;const c=this.camera.mainY-this.entity.game.stats.y,d=this.camera.mainZ-this.entity.game.stats.z+50;this.camera.mainRotX=Math.atan2(d,c)-.5*Math.PI,this.entity.player&&(this.entity.player.cameraTargetY=o),this.entity.player&&(this.entity.player.cameraY=o),this.entity.body.velocity.y=0}else this.turnOff();this.smoke&&this.smoke.animationStep(e)}turnOff(){var t,e,i,n;this.hide(),this.count&&(null===(t=this.entity.roll)||void 0===t||t.onStart.remove(this),this.onTurnOff.dispatch(),this.entity.body.ghost=!1,null===(e=this.entity.jump)||void 0===e||e.unlock(),this.entity.game.camera.releaseControl(),null===(i=this.entity.hoverboard)||void 0===i||i.resume(),null===(n=this.entity.sneakers)||void 0===n||n.resume(),this.count=0)}onRollStart(){this.entity.game.sfx.stop("special-jetpack"),this.turnOff()}jumpCurveEvaluate(t){return x.a.quartOut(t)}isOn(){return!!this.count}spawnCoins(){const t=this.entity.body.y,e=t+this.settings.jumpHeight,i=this.entity.body.z,n=i-this.settings.jumpDistance;let r=t,o=i;const a=this.settings.rows+1;for(let s=0;s<=a;s++){if(s<1)continue;const h=s/a,u=this.jumpCurveEvaluate(h);r=C.a.lerp(t,e,u),o=C.a.lerp(i,n,h),s<a?this.spawnCoinsRow(r,o):this.spawnPowerup(r,o)}}spawnCoinsRow(t,e){let i=3;for(;i--;){const n=this.entity.game.pool.get(S.a,{});n.body.x=(i-1)*f.a.laneWidth,n.body.bottom=t,n.body.z=e,n.arc=0,n.awake(),this.entity.game.addChild(n)}}spawnPowerup(t,e){const i=T.c.spawnRandomType(this.entity.game,["sneakers","jetpack","magnet","multiplier"]);i.body.x=a.a.pick(-1,0,1)*f.a.laneWidth,i.body.bottom=t,i.body.z=e}pogoSmokeOn(){this.smoke||(this.smoke=new Smoke_Smoke(5),this.smoke.scale.x=.5,this.smoke.scale.y=1.1,this.smoke.y=-3),this.view&&this.view.addChild(this.smoke),this.smoke.turnOn(),this.entity.game.sfx.play("special-jetpack",{loops:!0})}pogoSmokeOff(){this.smoke&&(this.smoke.turnOff(),this.entity.game.sfx.stop("special-jetpack"))}}var j=i(16);function G(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function U(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?G(Object(i),!0).forEach((function(e){H(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):G(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function H(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const V={type:"coin"};class Pop_Pop extends u.a{constructor(t,e={}){super(t,U(U({},V),e)),H(this,"view",void 0),H(this,"duration",8),H(this,"count",0),H(this,"viewPos",new j.a),this.reset()}reset(){this.view&&(this.view.parent&&this.entity.removeChild(this.view),this.view.active=!1,this.view.scale.set(0),this.count=0)}update(t){const e=t.frameTime;if(!this.count||!this.view)return;this.count-=e;const i=.5+.75*(1-this.count/this.duration);this.view.scale.set(i),this.count<=0&&this.reset()}play(){if(!this.view){if(!r.a.library.hasGeometry("star7"))return;this.view=r.a.library.getEntity("star7",{map:"effects-tex",opacity:.9,blendMode:3}),this.view.rotation.y=Math.PI}this.view.x=this.viewPos.x,this.view.y=this.viewPos.y,this.view.z=this.viewPos.z,this.view.rotation.z=C.a.PI_DOUBLE*Math.random(),this.count=this.duration,this.view.active=!0,this.view.scale.set(.5),this.entity.addChild(this.view)}}function W(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class PopPickup_PopPickup extends u.a{constructor(t,e={}){super(t,e),W(this,"view",void 0),W(this,"duration",13),W(this,"count",0),this.reset()}reset(){this.view&&(this.view.parent&&this.entity.removeChild(this.view),this.view.active=!1,this.view.scale.set(0),this.count=0)}update(t){const e=t.frameTime;if(!this.count||!this.view)return;this.count-=e;const i=1+20*(1-this.count/this.duration);this.view.scale.set(i),this.count<=0&&this.reset()}play(){if(!this.view){if(!r.a.library.hasGeometry("pow"))return;this.view=r.a.library.getEntity("pow",{map:"effects-tex",opacity:.95,blendMode:1}),this.view.rotation.y=Math.PI}this.duration=13,this.view.rotation.z=C.a.PI_DOUBLE*Math.random(),this.count=this.duration,this.view.active=!0,this.view.scale.set(.5),this.entity.addChild(this.view)}}var X=i(75);function Y(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class ReviveHalo_ReviveHalo extends u.a{constructor(t,e={}){super(t,e),Y(this,"view",void 0),Y(this,"duration",13),Y(this,"time",0),Y(this,"scale",2),Y(this,"view3d",void 0),this.entity=t}build(){this.view||r.a.library.hasGeometry("powRevive")&&(this.view=r.a.library.getEntity("powRevive",{map:"effects-tex",opacity:.7,blendMode:3}),this.view3d=this.view.getComponent(X.a),this.view3d.state.depthTest=!1,this.view.rotation.y=Math.PI,this.view.rotation.x=-.3,this.entity.addChild(this.view),this.scale=2,this.view.scale.set(this.scale),this.view.y=2,this.view.active=!1,this.time=0,this.duration=120)}update(t){if(!this.view)return;const e=t.frameTime;if(!this.time)return;this.time-=e,this.scale=.2*Math.sin(.1*this.time)+2,this.view.scale.set(this.scale);const i=.1*this.duration,n=1-(this.time-i)/(this.duration-i),r=this.time/i,o=this.time>i?n:r;this.view3d.material.opacity=.6*o,this.view.rotation.z+=.01*e,this.time<0&&this.stop()}play(){this.build(),this.view&&(this.view.active=!0,this.time=this.duration)}stop(){this.view&&(this.time=0,this.view.active=!1)}}function q(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Roll_Roll extends u.a{constructor(t){super(t),q(this,"onStart",void 0),q(this,"onEnd",void 0),q(this,"locked",!1),q(this,"isRolling",!1),q(this,"gravity",0),q(this,"duration",30),q(this,"time",0),q(this,"rollingHeight",5),q(this,"entity",void 0),q(this,"_isOn",!1),this.entity=t,this.onStart=new F.a("onRollStart"),this.onEnd=new F.a("onRollEnd"),this.reset()}reset(){this.locked=!1,this.isRolling=!1,this.gravity=f.a.gravity,this.duration=30,this.time=0,this.rollingHeight=5,this.entity.body.height=this.entity.regularHeight}turnOn(){this._isOn||(this._isOn=!0,this.entity.game.controller.onSwipeVertical.add(this))}turnOff(){this._isOn&&(this._isOn=!1,this.entity.game.controller.onSwipeVertical.remove(this))}onSwipeVertical(t){-1===t&&this.perform()}update(t){const e=t.frameTime;this.isRolling&&(this.time+=e,this.time>this.duration&&(this.time=this.duration),this.time===this.duration&&this.end())}perform(){var t;if(this.locked||this.isRolling)return;this.onStart.dispatch(),this.entity.jump&&this.entity.jump.cancel(),null!==(t=this.entity.sneakers)&&void 0!==t&&t.isOn()&&this.entity.sneakers.jumpCancel(),this.isRolling=!0,this.time=0,this.entity.body.landed||(this.entity.body.velocity.y=-2);const e=this.entity.body.bottom;this.entity.body.height=this.rollingHeight,this.entity.body.bottom=e,this.entity.game.sfx.play("hero-roll"),this.entity.game.missions.addStat(1,"mission-roll")}end(){this.isRolling=!1,this.entity.body.height=this.entity.regularHeight,this.entity.body.bottom<this.entity.body.ground&&(this.entity.body.bottom=this.entity.body.ground),this.time=0,this.onEnd.dispatch()}cancel(){this.end()}lock(){this.end(),this.locked=!0}unlock(){this.locked=!1}isOn(){return this._isOn}}class Shadow_Shadow extends u.a{constructor(...t){var e,i,n;super(...t),n=void 0,(i="view")in(e=this)?Object.defineProperty(e,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[i]=n}createView(){this.view||(this.view=o.a.plane(8,8,.5,"shadow"),this.view.name="shadow",this.view.rx=C.a.PI_HALF,this.view.z=1,this.entity.addChild(this.view))}update(){if(!this.view||!this.view.active)return;const t=this.entity.body?this.entity.body.ground:0;this.view.y=-this.entity.y+t+1}turnOn(){this.createView(),this.view&&(this.view.active=!0)}turnOff(){this.view&&(this.view.active=!1)}isOn(){return!(!this.view||!this.view.active)}}function K(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Sneakers_Sneakers extends u.a{constructor(t,e={}){super(t,e),K(this,"mod",0),K(this,"left",void 0),K(this,"right",void 0),K(this,"rig",void 0),K(this,"time",0),K(this,"duration",0),K(this,"hitTop",0),K(this,"ascending",!1),K(this,"gravity",0),K(this,"locked",!1),K(this,"isJumping",!1),K(this,"jumpHeight",0),K(this,"jumpLength",0),K(this,"startPosY",0),K(this,"startPosZ",0),K(this,"entity",void 0),K(this,"frozen",!1),K(this,"paused",!1),K(this,"_activated",!1),t.body.onCollisionEnter.add(this),this.mod=0,this.entity=t}calculateDuration(){return 10+5*Math.abs(r.a.user.boosts.permanents.sneakers)}get ratio(){return this.time/this.duration}update(t){const e=t.frameTime;if(!this.time)return;if(!this._activated&&this.entity.body.landed&&this._activate(),!this._activated)return;if(this.frozen||this.paused||(this.time-=this.entity.game.deltaSecs),this.jumpUpdate(e),this.entity.game.hud.updateItemTimer("sneakers",this.ratio),this.entity.player){let t=.5*(this.entity.body.bottom-this.entity.player.cameraY);this.hitTop&&(t*=.5),this.mod=t}if(this.paused)return;this.rig.mainX=this.entity.game.stats.x*f.a.cameraModX,this.rig.mainY=this.entity.game.hero.player.cameraY+f.a.cameraPosY+this.mod,this.rig.mainZ=this.entity.game.stats.z+f.a.cameraPosZ,this.rig.mainRotX=f.a.cameraRotX,this.rig.mainRotY=0;const i=this.entity.game.level.currentChunk,n=this.entity.body.y>80;if(!n&&i&&i.envTube){const t=70;this.rig.mainY>t&&(this.rig.mainY=t)}if(!n&&i&&i.envPillars){const t=60;this.rig.mainY>t&&(this.rig.mainY=t)}this.time<=0&&(this.entity.body.landed&&!this.ascending?this.turnOff(!0):this.time=.01)}turnOn(){var t,e,i;this.frozen=!1,this.mod=0,this.paused=!1,null===(t=this.entity.pogo)||void 0===t||t.turnOff(),null===(e=this.entity.jetpack)||void 0===e||e.turnOff(),null===(i=this.entity.hoverboard)||void 0===i||i.cancel(),this.hitTop=0,this.duration=this.calculateDuration(),this.time=this.duration,this.gravity=f.a.gravity,this.entity.game.hud.addItemTimer("sneakers"),this.entity.game.controller.onSwipeVertical.add(this),this.show()}turnOff(t=!1){var e,i;this.time&&(this.resume(),this.hide(),null===(e=this.entity.jump)||void 0===e||e.unlock(),this.frozen=!1,this.time=0,this.mod=0,this.entity.game.controller.onSwipeVertical.remove(this),this.entity.game.camera.releaseControl(),null===(i=this.entity.state)||void 0===i||i.set("empty"),this.entity.game.hud.removeItemTimer("sneakers"),this._activated=!1,t&&r.a.sound.play("pickup-powerdown"))}_activate(){var t,e;null===(t=this.entity.jump)||void 0===t||t.lock(),this._activated=!0,null===(e=this.entity.state)||void 0===e||e.set("empty"),this.rig=this.entity.game.camera.takeControl()}isOn(){return!!this.time}onSwipeVertical(t){1===t&&this.jump()}jump(t=!1){this.time&&(!t&&this.locked||!t&&this.isJumping||(t||this.entity.body.canJump)&&(this.entity.roll&&this.entity.roll.cancel(),this.entity.body.resetGroundChangeTolerance(),this.isJumping=!0,this.entity.body.y+=1,this.entity.body.velocity.y=0,this.jumpHeight=40,this.jumpLength=160,this.startPosY=this.entity.body.y,this.startPosZ=this.entity.body.z,this.ascending=!0,this.entity.game.sfx.play("hero-sneakers-jump")))}jumpUpdate(t){if(this.isJumping&&this.ascending){const e=-(this.entity.body.z-this.startPosZ)/this.jumpLength*2,i=e<=1?e:1;i>=1&&(this.ascending=!1);const n=this.startPosY+this.jumpHeight*this.sneakersExpoOut(i)-this.entity.body.y;this.entity.body.velocity.y=t?n/t:0,this.ascending&&!this.hitTop||(this.entity.body.velocity.y=0)}else this.entity.body.velocity.y-=this.gravity*t;this.entity.body.bottom<=this.entity.body.ground+.01&&this.entity.body.velocity.y<=0&&(this.entity.body.bottom=this.entity.body.ground,this.isJumping&&this.jumpEnd())}sneakersExpoOut(t){return 1===t?t:1-Math.pow(2,-13*t)}jumpEnd(){this.hitTop=0,this.isJumping=!1,this.ascending=!1,this.entity.body.velocity.y=0}jumpCancel(){this.jumpEnd()}onCollisionEnter(t){t.flags&L.a.TOP&&(this.entity.body.velocity.y=0,this.hitTop=t.hit.bottom-10)}freeze(){this.isOn()&&(this.frozen=!0,this.jumpCancel(),this.hide())}unfreeze(){this.isOn()&&(this.frozen=!1,this.show(),setTimeout(()=>this.entity.anim.play("superRun",{loop:!0,sudden:!0,mixRatio:0}),100))}show(){this.hide(),this.left=r.a.library.getEntity("powerups_superSneakers",{map:"props-tex"}),this.right=r.a.library.getEntity("powerups_superSneakers",{map:"props-tex"}),this.left.rx=.5*Math.PI,this.left.ry=.5*Math.PI,this.left.scale.set(.005),this.right.rx=.5*-Math.PI,this.right.ry=.5*Math.PI,this.right.scale.set(.005);const t=this.entity.gameScene;if(t){const e=o.a.findEntity(t,"L_Toes_jnt",15),i=o.a.findEntity(t,"R_Toes_jnt",15);e&&e.addChild(this.left),i&&i.addChild(this.right)}o.a.toggleRenderable(this.left,!0),o.a.toggleRenderable(this.right,!0)}hide(){this.left&&(this.left.parent&&this.left.parent.removeChild(this.left),this.right.parent&&this.right.parent.removeChild(this.right),o.a.toggleRenderable(this.left,!1),o.a.toggleRenderable(this.right,!1))}pause(){this.isOn()&&(this.paused=!0,this._activated=!1,this.entity.game.camera.releaseControl(),this.jumpCancel(),this.hide())}resume(){this.isOn()&&this.paused&&(this.paused=!1,this.show())}}function J(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const Z=()=>{};class State_State extends u.a{constructor(t,e={}){super(t,e),J(this,"states",void 0),J(this,"currentStateId",""),J(this,"transitionMap",void 0),J(this,"params",void 0),this.states={},this.currentStateId="empty",this.transitionMap={},this.add("empty",{end:Z,begin:Z,update:Z,render:Z}),this.params={}}get id(){return this.currentStateId}addTransition(t,e,i=!1){return this.transitionMap[t]||(this.transitionMap[t]={}),this.transitionMap[t][e]=!0,i&&(this.transitionMap[e][t]=!0),this}add(t,e){return this.states[t]=e,e.id=t,e.entity=this.entity,e.empty||(e.empty=Z),e.begin||(e.begin=Z),e.update||(e.update=Z),e.render||(e.render=Z),e.end||(e.end=Z),this.transitionMap[t]||(this.transitionMap[t]={}),this.addTransition("empty",t,!0),this}set(t){if(this.can(t)){const e=this.currentStateId;this.states[this.currentStateId].end(),this.currentStateId=t,this.states[this.currentStateId].begin(e)}}can(t){if(this.currentStateId===t)return!1;const e=this.transitionMap.all[t],i=this.transitionMap[this.currentStateId].all,n=this.transitionMap[this.currentStateId][t];return e||i||n}update(t){const e=this.entity;if(e.onStateUpdate){e.onStateUpdate();const t=this.params,i=this.states;for(const e in i){if("empty"===e)continue;const n=i[e];let r=!0;for(const e in t)if(void 0!==n[e]&&n[e]!==t[e]){r=!1;break}if(r&&this.currentStateId!==e){const t=this.transitionMap.all[e],i=this.transitionMap[this.currentStateId].all,n=this.transitionMap[this.currentStateId][e];if(t||i||n){this.set(e);break}}}}this.states[this.currentStateId].update(t)}render(t){this.states[this.currentStateId].render(t)}}var Q=i(57);class ParticleRevive_ParticleRevive extends g.a{constructor(){super(),this.levelEntity=!1,this.view=o.a.particle(16,16,1,"spray-splash"),this.addChild(this.view),this.view.view3d&&(this.view.view3d.state.blend=!0,this.view.view3d.state.depthTest=!0,this.view.view3d.orderBias=999);const t=a.a.pick(1407438,4308976,2726108);o.a.tint(this.view,t)}}function $(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class StateIdle{constructor(){$(this,"playing",!1),$(this,"dead",!1),$(this,"entity",void 0)}begin(){this.entity.anim.play("paintIdle",{loop:!0})}}class StateRunning{constructor(){$(this,"playing",!0),$(this,"landed",!0),$(this,"rolling",!1),$(this,"dodging",!1),$(this,"grinding",!1),$(this,"anim",{normal:()=>"run3",hoverboard:()=>this.entity.hoverboard.animations.run,sneakers:()=>"superRun"}),$(this,"count",0),$(this,"alt",!1),$(this,"soundSteps",!1),$(this,"entity",void 0)}begin(){this.count=0;const t=this.entity.player.getMode(),e=this.anim[t](),i={loop:!0,mixRatio:.3};this.soundSteps="sneakers"===t,"hoverboard"===t&&(i.mixRatio=.1),this.entity.anim.play(e,i)}update(t){const e=this.entity.player.getMode();if(this.entity.anim.speed="hoverboard"===e?1:this.entity.game.stats.animationSpeed,this.soundSteps&&(this.count-=t,this.count<=0)){this.count=25,this.alt=!this.alt;const t=this.alt?"hero-sneakers-foot-l":"hero-sneakers-foot-r";this.entity.game.sfx.play(t)}}}class Character_StateGrinding{constructor(){$(this,"playing",!0),$(this,"landed",!0),$(this,"rolling",!1),$(this,"dodging",!1),$(this,"grinding",!0),$(this,"ascending",!1),$(this,"descending",!1),$(this,"animName",""),$(this,"entity",void 0)}begin(){const t=this.entity.hoverboard.animations,e=a.a.range(0,t.grind.length,!0);this.animName=t.grind[e],this.entity.anim.play(t.grindLand[e],{loop:!0}),this.entity.anim.play(this.animName,{loop:!0})}update(){this.entity.anim.currentAnimationClipName===this.animName&&this.entity.hoverboard.updateGrinding()}}class StateDodging{constructor(){$(this,"playing",!0),$(this,"landed",!0),$(this,"rolling",!1),$(this,"dodging",!0),$(this,"anim",{normal:{"-1":()=>"dodgeLeft",1:()=>"dodgeRight"},hoverboard:{"-1":()=>this.entity.hoverboard.animations.dodgeLeft,1:()=>this.entity.hoverboard.animations.dodgeRight},sneakers:{"-1":()=>"dodgeLeft",1:()=>"dodgeRight"}}),$(this,"entity",void 0)}begin(){const t=this.entity.player.getMode(),e=this.anim[t][this.entity.lane.absStep]();e.length&&this.entity.anim.play(e,{speed:this.entity.game.stats.animationSpeed,sudden:!1})}}class StateAscending{constructor(){$(this,"playing",!0),$(this,"landed",!1),$(this,"special",!1),$(this,"rolling",!1),$(this,"ascending",!0),$(this,"descending",!1),$(this,"anim",{normal:()=>["jump","jump2","jump3","jump_salto"],sneakers:()=>["jump","jump2","jump3","jump_salto"],hoverboard:()=>this.entity.hoverboard.animations.jump}),$(this,"entity",void 0)}begin(){const t=this.entity.player.getMode(),e=this.anim[t]();e&&this.entity.anim.play(e)}}class StateHangtime{constructor(){$(this,"playing",!0),$(this,"landed",!1),$(this,"special",!1),$(this,"rolling",!1),$(this,"ascending",!1),$(this,"descending",!1),$(this,"anim",{normal:["hangtime","hangtime2","hangtime3"],sneakers:["hangtime","hangtime2","hangtime3"]}),$(this,"entity",void 0)}begin(){const t=this.entity.player.getMode();if("sneakers"!==t)return;const e=this.anim[t];e&&this.entity.anim.play(e,{loop:!0})}}class StateDescending{constructor(){$(this,"playing",!0),$(this,"landed",!1),$(this,"special",!1),$(this,"rolling",!1),$(this,"ascending",!1),$(this,"descending",!0),$(this,"anim",{normal:["hangtime","hangtime2","hangtime3"],sneakers:["hangtime","hangtime2","hangtime3"]}),$(this,"entity",void 0)}begin(){const t=this.entity.player.getMode(),e=this.anim[t];e&&this.entity.anim.play(e,{loop:!0})}}class StateRolling{constructor(){$(this,"playing",!0),$(this,"rolling",!0),$(this,"anim",{normal:()=>"roll",hoverboard:()=>this.entity.hoverboard.animations.roll,sneakers:()=>"roll"}),$(this,"entity",void 0)}begin(){const t=this.entity.player.getMode(),e=this.anim[t](),i="hoverboard"===t?.5:1;this.entity.anim.play(e,{loop:!1,sudden:!0,speed:i})}}class StateJetpack{constructor(){$(this,"jetpack",!0),$(this,"dodging",!1),$(this,"entity",void 0)}begin(){this.entity.anim.play("Jetpack_forward",{loop:!0})}}class StateJetpackDodging{constructor(){$(this,"jetpack",!0),$(this,"dodging",!0),$(this,"anim",{"-1":"Jetpack_changeLane_left",1:"Jetpack_changeLane_right"}),$(this,"entity",void 0)}begin(){const t=this.anim[this.entity.lane.absStep];this.entity.anim.play(t)}}class StateDead{constructor(){$(this,"dead",!0),$(this,"catch",!1),$(this,"anim",{upper:"death_upper",lower:"death_lower",train:"death_movingTrain",bounce:"death_bounce",out:"death_bounce"}),$(this,"entity",void 0)}begin(){const t=this.entity.player.deathCause,e=this.anim[t]||"death_bounce";this.entity.anim.play(e,{sudden:!0})}}class Character_Character extends g.a{constructor(){super(),$(this,"state",void 0),$(this,"jetpack",void 0),$(this,"anim",void 0),$(this,"pogo",void 0),$(this,"sneakers",void 0),$(this,"magnet",void 0),$(this,"hoverboard",void 0),$(this,"multiplier",void 0),$(this,"shadow",void 0),$(this,"dizzy",void 0),$(this,"lane",void 0),$(this,"jump",void 0),$(this,"roll",void 0),$(this,"player",void 0),$(this,"notifier",void 0),$(this,"sprayCan",void 0),$(this,"model",void 0),$(this,"pop",void 0),$(this,"popPickup",void 0),$(this,"reviveHalo",void 0),$(this,"reviveSmoke",void 0),$(this,"height",11),$(this,"gameScene",void 0),$(this,"idleScene",void 0),$(this,"_initialized",!1),$(this,"statesReady",!1),$(this,"outfit",void 0),this.levelEntity=!1,this.add(h.a,{boxColor:255,sensor:!0}),this.model=new n.a,this.addChild(this.model),this.add(s.a),this.add(State_State),this.add(Jetpack_Jetpack),this.add(Pogo_Pogo),this.add(Sneakers_Sneakers),this.add(Magnet_Magnet),this.add(Hoverboard_Hoverboard),this.add(Multiplier_Multiplier),this.add(Shadow_Shadow),this.add(Dizzy_Dizzy),this.add(I.a),this.add(Jump_Jump),this.add(Roll_Roll),this.add(Player_Player),this.add(Notifier_Notifier),this.body.width=4,this.body.height=this.regularHeight,this.body.depth=4,this.updateModel(),this.sprayCan=r.a.library.getEntity("sprayCan"),this.sprayCan.x=.002,this.sprayCan.z=-.005,this.sprayCan.y=-.005,this.sprayCan.rz=.5*Math.PI,this.sprayCan.ry=.15*Math.PI,this.sprayCan.scale.set(.01),this.sprayCan.view3d.material.map=r.a.library.getMap("props-tex");const t=()=>{const{character:t,outfit:e}=r.a.user;if(this.anim.character!==t||this.outfit!==e){for(const e in Q.a.avatar){const i=Q.a.avatar[e];i.file=t+"-"+e,i.texture=t+"-tex"}this.outfit=e,this.anim.character=t,this.refreshScenes()}};t(),r.a.user.onCharacterSettingsChange.add(t),this.refreshScenes()}get regularHeight(){return this.height}set regularHeight(t){this.height=t,this.body.height=t}refreshScenes(){const t=Q.a.avatar.idle.file;!this.anim.scenes[t]&&r.a.library.hasScene(t)&&this.anim.addScene(Q.a.avatar.idle);const e=Q.a.avatar.game.file;!this.anim.scenes[e]&&r.a.library.hasScene(e)&&this.anim.addScene(Q.a.avatar.game);const{character:i,outfit:n}=r.a.user;if(this.idleScene=this.anim.getSceneEntity(i+"-idle"),this.gameScene=this.anim.getSceneEntity(i+"-game"),this.idleScene){const t=o.a.findEntity(this.idleScene,"R_Hand_jnt",10);t&&t.addChild(this.sprayCan)}this.idleScene&&this.updateScene(this.idleScene,i,n),this.gameScene&&this.updateScene(this.gameScene,i,n),this.anim.updateCurrentAnimation()}updateScene(t,e,i=0){const n=r.a.data.getCharData(e);if(!n)throw new Error("[Character] Character data not found: "+e);const a=i?n.outfits[i-1]:n,s=o.a.findEntity(t,"SkeletalMeshComponent0",4,a.features);s&&o.a.setMap(s,"diffuseMap",r.a.library.getMap(a.texture))}resetModel(){this.model.ry=Math.PI,this.model.rx=0,this.model.rz=0,this.model.x=0,this.model.y=.5*-this.body.height+1,this.model.z=0}init(){this._initialized||(this._initialized=!0,this.add(Pop_Pop),this.add(PopPickup_PopPickup),this.pop.viewPos.y=0,this.pop.viewPos.z=-3,this.refreshScenes())}playIntro(){this.init(),this.lane.reset(),this.resetModel(),this.z=0,this.x=-1,this.body.z=0,this.body.x=0,this.body.bottom=0,this.y=this.body.bottom+.5*this.body.height,this.anim.play("introRun",{sudden:!0}),this.hoverboard.hide(),this.pogo.hide()}run(){this.refreshScenes(),this.body.velocity.z=-this.game.stats.speed,this.player.run(),this.hoverboard.hide(),this.pogo.hide()}reset(){this.model.x=0,this.z=0,this.x=1,this.body.z=0,this.body.x=1,this.body.bottom=0,this.pogo.turnOff(),this.magnet.turnOff(),this.jetpack.turnOff(),this.sneakers.turnOff(),this.dizzy.turnOff(),this.multiplier.turnOff(),this.hoverboard.turnOff(),this.notifier.notify("reset"),this.reviveHalo&&this.reviveHalo.stop()}restoreSize(){this.body.width=4,this.body.height=this.regularHeight,this.body.depth=4,this.model.position.y=.5*-this.body.height+1}updateModel(){this.model.position.y=.5*-this.body.height+1,this.model.rotation.y=Math.PI}onStateUpdate(){var t;this.statesReady||((t=this).state.params={playing:!1,landed:!1,ascending:!1,descending:!1,dodging:!1,rolling:!1,hoverboard:!1,dizzy:!1,special:!1,dead:!1},t.state.add("idle",new StateIdle),t.state.add("dead",new StateDead),t.state.add("running",new StateRunning),t.state.add("grinding",new Character_StateGrinding),t.state.add("dodging",new StateDodging),t.state.add("ascending",new StateAscending),t.state.add("hangtime",new StateHangtime),t.state.add("descending",new StateDescending),t.state.add("rolling",new StateRolling),t.state.add("jetpack",new StateJetpack),t.state.add("jetpackDodging",new StateJetpackDodging),t.state.addTransition("all","idle"),t.state.addTransition("idle","running"),t.state.addTransition("running","dodging"),t.state.addTransition("running","rolling"),t.state.addTransition("running","airborne"),t.state.addTransition("running","jetpack"),t.state.addTransition("running","grinding",!0),t.state.addTransition("dodging","rolling"),t.state.addTransition("dodging","running"),t.state.addTransition("dodging","hangtime"),t.state.addTransition("dodging","jetpack"),t.state.addTransition("airborne","rolling"),t.state.addTransition("airborne","running"),t.state.addTransition("airborne","dodging"),t.state.addTransition("airborne","jetpack"),t.state.addTransition("ascending","rolling",!0),t.state.addTransition("ascending","running",!0),t.state.addTransition("ascending","dodging",!0),t.state.addTransition("ascending","jetpack",!0),t.state.addTransition("hangtime","ascending",!0),t.state.addTransition("hangtime","rolling",!0),t.state.addTransition("hangtime","running",!0),t.state.addTransition("hangtime","dodging",!0),t.state.addTransition("hangtime","jetpack",!0),t.state.addTransition("descending","ascending",!0),t.state.addTransition("descending","hangtime",!0),t.state.addTransition("descending","rolling",!0),t.state.addTransition("descending","running",!0),t.state.addTransition("descending","dodging",!0),t.state.addTransition("descending","jetpack",!0),t.state.addTransition("rolling","running"),t.state.addTransition("rolling","airborne"),t.state.addTransition("rolling","dodging"),t.state.addTransition("rolling","jetpack"),t.state.addTransition("jetpack","ascending"),t.state.addTransition("jetpack","hangtime"),t.state.addTransition("jetpack","descending"),t.state.addTransition("jetpack","airborne"),t.state.addTransition("jetpack","jetpackDodging"),t.state.addTransition("jetpackDodging","jetpack"),t.state.addTransition("jetpackDodging","airborne"),t.state.addTransition("jetpackDodging","ascending"),t.state.addTransition("jetpackDodging","hangtime"),t.state.addTransition("jetpackDodging","descending"),t.state.addTransition("all","dead"),t.state.addTransition("dead","idle"),t.state.addTransition("dead","running"),t.state.addTransition("grinding","dodging",!0),t.state.addTransition("grinding","rolling",!0),t.state.addTransition("grinding","airborne",!0),t.state.addTransition("grinding","jetpack",!0),t.state.addTransition("grinding","ascending",!0),t.state.addTransition("grinding","descending",!0)),this.statesReady=!0;const e=this.state.params;e.landed=this.body.landed,e.ascending=!this.body.hangtime&&this.body.ascending,e.descending=!this.body.hangtime&&this.body.descending,e.rolling=this.roll.isRolling,e.dead=!!this.player.deathCause,e.hoverboard=this.hoverboard.isOn(),e.dodging=this.lane.changing,e.playing=!!this.game.state&&!this.player.deathCause,e.jetpack=this.jetpack.isOn(),e.special=e.jetpack||this.pogo.isOn(),e.grinding=this.hoverboard.grinding}revive(){this.reviveSmoke||(this.reviveSmoke=this.addComponent(Particles_Particles,{EntityClass:ParticleRevive_ParticleRevive,container:this.game,rate:1,life:90,xMod:[-10,10],yMod:[-2,20],velocityXMod:[-1,1],velocityYMod:[1,3],velocityZMod:[-1,-.5],scaleXMod:[.8,1.3],scaleYMod:[.8,1.3],scaleZMod:[.8,1.3],growXMod:[.01,.03],growYMod:[.01,.03],growZMod:[.01,.03]},"reviveSmoke")),this.reviveHalo||this.add(ReviveHalo_ReviveHalo),this.reviveHalo&&this.reviveHalo.play(),this.reviveSmoke&&(this.reviveSmoke.data.x=this.x,this.reviveSmoke.data.y=0,this.reviveSmoke.data.z=this.z,this.reviveSmoke.spawn(20)),this.game.sfx.play("hero-revive"),this.unfreezePowerUps()}freezePowerUps(){this.magnet.freeze(),this.multiplier.freeze(),this.sneakers.freeze()}unfreezePowerUps(){this.magnet.unfreeze(),this.multiplier.unfreeze(),this.sneakers.unfreeze()}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return b}));i(9),i(56),i(29),i(34),i(30),i(175);function n(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))}const r=["geforce 320m","geforce 8600","geforce 8600m gt","geforce 8800 gs","geforce 8800 gt","geforce 9400","geforce 9400m g","geforce 9400m","geforce 9600m gt","geforce 9600m","geforce fx go5200","geforce gt 120","geforce gt 130","geforce gt 330m","geforce gtx 285","google swiftshader","intel g41","intel g45","intel gma 4500mhd","intel gma x3100","intel hd 3000","intel q45","legacy","mali-2","mali-3","mali-4","quadro fx 1500","quadro fx 4","quadro fx 5","radeon hd 2400","radeon hd 2600","radeon hd 4670","radeon hd 4850","radeon hd 4870","radeon hd 5670","radeon hd 5750","radeon hd 6290","radeon hd 6300","radeon hd 6310","radeon hd 6320","radeon hd 6490m","radeon hd 6630m","radeon hd 6750m","radeon hd 6770m","radeon hd 6970m","radeon r9 200","sgx 543","sgx543"],o=t=>t.toLowerCase().replace(/^angle ?\((.+)\)*$/,"$1").replace(/\s(\d{1,2}gb|direct3d.+$)|\(r\)| \([^)]+\)$/g,""),a="undefined"==typeof window,s=(()=>{if(a)return;const{userAgent:t,platform:e,maxTouchPoints:i}=window.navigator,n=/(iphone|ipod|ipad)/i.test(t),r="iPad"===e||"MacIntel"===e&&i>0&&!window.MSStream;return{isIpad:r,isMobile:/android/i.test(t)||n||r,isSafari12:/Version\/12.+Safari/.test(t)}})(),h=[],u=[],l=(t,e)=>{if(t===e)return 0;const i=t;t.length>e.length&&(t=e,e=i);let n=t.length,r=e.length;for(;n>0&&t.charCodeAt(~-n)===e.charCodeAt(~-r);)n--,r--;let o,a=0;for(;a<n&&t.charCodeAt(a)===e.charCodeAt(a);)a++;if(n-=a,r-=a,0===n)return r;let s,l,c=0,d=0,p=0;for(;d<n;)u[d]=t.charCodeAt(a+d),h[d]=++d;for(;p<r;)for(o=e.charCodeAt(a+p),s=p++,c=p,d=0;d<n;d++)l=o===u[d]?s:s+1,s=h[d],c=h[d]=s>c?l>c?c+1:l:l>s?s+1:l;return c},c=({mobileTiers:t=[0,15,30,60],desktopTiers:e=[0,15,30,60],override:i={},glContext:h,failIfMajorPerformanceCaveat:u=!1,benchmarksURL:c="https://unpkg.com/detect-gpu@3.1.13/dist/benchmarks"}={})=>n(void 0,void 0,void 0,(function*(){const d={};if(a)return{tier:0,type:"SSR"};const{isIpad:p=!!(null==s?void 0:s.isIpad),isMobile:f=!!(null==s?void 0:s.isMobile),screenSize:m=window.screen,loadBenchmarks:g=(t=>n(void 0,void 0,void 0,(function*(){const e=yield fetch(c+"/"+t).then(t=>t.json());return e.shift(),e})))}=i;let{renderer:y}=i;const v=(t,e,i,n,r)=>({device:r,fps:n,gpu:i,isMobile:f,tier:t,type:e});let b,_="";if(y)y=o(y),b=[y];else{const t=h||((t,e=!1)=>{const i={alpha:!1,antialias:!1,depth:!1,failIfMajorPerformanceCaveat:e,powerPreference:"high-performance",stencil:!1};t&&delete i.powerPreference;const n=window.document.createElement("canvas"),r=n.getContext("webgl",i)||n.getContext("experimental-webgl",i);return null!=r?r:void 0})(null==s?void 0:s.isSafari12,u);if(!t)return v(0,"WEBGL_UNSUPPORTED");const e=t.getExtension("WEBGL_debug_renderer_info");if(e&&(y=t.getParameter(e.UNMASKED_RENDERER_WEBGL)),!y)return v(1,"FALLBACK");_=y,y=o(y),b=((t,e,i)=>"apple gpu"===e?((t,e,i)=>{let n=[e];if(i){const e="\n precision highp float;\n attribute vec3 aPosition;\n varying float vvv;\n void main() {\n vvv = 0.31622776601683794;\n gl_Position = vec4(aPosition, 1.0);\n }\n ",i="\n precision highp float;\n varying float vvv;\n void main() {\n vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * vvv;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n gl_FragColor = enc;\n }\n ",r=t.createShader(35633),o=t.createShader(35632),a=t.createProgram();if(o&&r&&a){t.shaderSource(r,e),t.shaderSource(o,i),t.compileShader(r),t.compileShader(o),t.attachShader(a,r),t.attachShader(a,o),t.linkProgram(a),t.detachShader(a,r),t.detachShader(a,o),t.deleteShader(r),t.deleteShader(o),t.useProgram(a);const h=t.createBuffer();t.bindBuffer(34962,h),t.bufferData(34962,new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),35044);const u=t.getAttribLocation(a,"aPosition");t.vertexAttribPointer(u,3,5126,!1,0,0),t.enableVertexAttribArray(u),t.clearColor(1,1,1,1),t.clear(16384),t.viewport(0,0,1,1),t.drawArrays(4,0,3);const l=new Uint8Array(4);t.readPixels(0,0,1,1,6408,5121,l),t.deleteProgram(a),t.deleteBuffer(h),n={801621810:(null==s?void 0:s.isIpad)?["apple a12x gpu"]:["apple a11 gpu","apple a12 gpu","apple a13 gpu","apple a14 gpu"],8016218135:(null==s?void 0:s.isIpad)?["apple a9x gpu","apple a10 gpu","apple a10x gpu"]:["apple a9 gpu","apple a10 gpu"]}[l.join("")]||n}}return n})(t,e,i):[e])(t,y,f)}const w=(yield Promise.all(b.map(t=>n(void 0,void 0,void 0,(function*(){const e=(t=>{const e=f?["adreno","apple","mali-t","mali","nvidia","powervr"]:["intel","amd","radeon","nvidia","geforce"];for(const i of e)if(t.includes(i))return i})(t);if(!e)return;const i=(f?"m":"d")+"-"+e+".json",n=d[i]=d[i]||g(i);let r;try{r=yield n}catch(e){return}const o=(t=>{var e;const i=(t=t.replace(/\([^)]+\)/,"")).match(/\d+/)||t.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);return null!==(e=null==i?void 0:i.join("").replace(/\W|amd/g,""))&&void 0!==e?e:""})(t),a="apple"===e;let s=r.filter(([,t])=>t===o);s.length||(s=r.filter(([e])=>e.includes(t)));const h=s.length;if(0===h)return;let u,[c,,,y]=h>1?s.map(e=>[e,l(t,e[0])]).sort(([,t],[,e])=>t-e)[0][0]:s[0],v=Number.MAX_VALUE;const{devicePixelRatio:b}=window,_=m.width*b*(m.height*b);a&&f&&(y=y.filter(([,,,t])=>{var e;return(null!==(e=null==t?void 0:t.indexOf(p?"ipad":"iphone"))&&void 0!==e?e:-1)>-1}));for(const t of y){const[e,i]=t,n=e*i,r=Math.abs(_-n);r<v&&(v=r,u=t)}if(!u)return;const[,,w,x]=u;return[v,w,c,x]}))))).filter(t=>!!t);if(!w.length){const t=r.find(t=>y.includes(t));return t?v(0,"BLOCKLISTED",t):v(1,"FALLBACK",y+" ("+_+")")}const[,x,C,S]=w.sort(([t=Number.MAX_VALUE],[e=Number.MAX_VALUE])=>t-e)[0];if(-1===x)return v(0,"BLOCKLISTED",C,x,S);const T=f?t:e;let A=0;for(let t=0;t<T.length;t++)x>=T[t]&&(A=t);return v(A,"BENCHMARK",C,x,S)}));var d,p=i(223);function f(t){let e;try{e=t===d.LOCAL?window.localStorage:window.sessionStorage;const i="__storage_test__";return e.setItem(i,i),e.removeItem(i),!0}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&e&&0!==e.length}}!function(t){t.LOCAL="local",t.SESSION="session"}(d||(d={}));var m=function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))};var g=function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))};var y,v=function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))};!function(t){t[t.NONE=0]="NONE",t[t.LOW=1]="LOW",t[t.MEDIUM=2]="MEDIUM",t[t.HIGH=3]="HIGH"}(y||(y={}));const b=new class Device_DeviceClass{constructor(){this.supportedFileFormats={webp:!1,avif:!1},this.customQueries=[],this.caches={query:{},browser:{},os:{},device:{},custom:{}},this.uaData=(new p.UAParser).getResult(),this.isLocalStorageAllowed=f(d.LOCAL),this.isSessionStorageAllowed=f(d.SESSION),this._checkIPadPro()}get desktop(){return!("tablet"===this.uaData.device.type||"mobile"===this.uaData.device.type)}get mobile(){return this.isDevice("mobile")}get phone(){return this.isDevice("phone")}get tablet(){return this.isDevice("tablet")}get android(){return"Android"===this.uaData.os.name}get ios(){return"iOS"===this.uaData.os.name}get kindle(){return this.isDevice("kindle")}get ie(){return"IE"===this.uaData.browser.name}get gpu(){var t;return(null===(t=this.gpuData)||void 0===t?void 0:t.tier)?this.gpuData.tier:2}init(){return v(this,void 0,void 0,(function*(){this.gpuData||(this.supportedFileFormats.webp=yield function(){return g(this,void 0,void 0,(function*(){if(!self.createImageBitmap)return!1;const t=yield fetch("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=").then(t=>t.blob());return createImageBitmap(t).then(()=>!0,()=>!1)}))}(),this.supportedFileFormats.avif=yield function(){return m(this,void 0,void 0,(function*(){if(!self.createImageBitmap)return!1;const t=yield fetch("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=").then(t=>t.blob());return createImageBitmap(t).then(()=>!0,()=>!1)}))}(),this.gpuData=yield c())}))}addQuery(...t){this.customQueries.push(...t)}query(t){const e=this.checkCache(t,"query");if(null!==e)return e;const i=this.parseQuery(t);let n=!0;for(let t=0;t<i.length;t++){const e=i[t];switch(e.type){case"browser":n=this.isBrowser(e.value);break;case"os":n=this.isOS(e.value);break;case"device":n=this.isDevice(e.value);break;case"gpu":n=this.isGPU(e.value);break;default:n=this.checkCustom(e)}if(!n)break}return this.addToCache(t,n,"query"),n}isBrowser(t){const e=this.checkCache(t,"browser");if(null!==e)return e;const i=[()=>this.checkCustom({type:"browser",value:t}),()=>{const e=t.split(":");return e.length>1&&this.uaData.browser.version.split(".")[0]===e[1]},()=>{var e;return null!==(e=this.supportedFileFormats[t])&&void 0!==e&&e},()=>this.uaData.browser.name.toLowerCase().replace(" ","-")===t];return this.checkTests(i,t,"browser")}isOS(t){const e=this.checkCache(t,"os");if(null!==e)return e;const i=[()=>this.checkCustom({type:"os",value:t}),()=>{const e=t.split(":");return e.length>1&&this.uaData.os.version.split(".")[0]===e[1]},()=>("mobile"===t||"desktop"===t)&&("mobile"===t?!this.desktop:this.desktop),()=>this.uaData.os.name.toLowerCase().replace(" ","-")===t];return this.checkTests(i,t,"os")}isDevice(t){const e=this.checkCache(t,"device");if(null!==e)return e;const i=[()=>this.checkCustom({type:"device",value:t}),()=>"tablet"===t&&"tablet"===this.uaData.device.type,()=>"mobile"===t&&("tablet"===this.uaData.device.type||"mobile"===this.uaData.device.type),()=>"phone"===t&&"mobile"===this.uaData.device.type,()=>this.uaData.device.model===t];return this.checkTests(i,t,"device")}isGPU(t){return this.gpu===Number(t)}parseQuery(t){return t.split("--").map(t=>{const e=t.split(":").filter(t=>":"!==t);return{type:e.shift(),value:e.join(":")}})}checkCustom(t){const e=this.checkCache(JSON.stringify(t),"custom");if(null!==e)return e;for(let e=0;e<this.customQueries.length;e++){if((0,this.customQueries[e])(t))return this.addToCache(JSON.stringify(t),!0,"custom"),!0}return this.addToCache(JSON.stringify(t),!1,"custom"),!1}checkCache(t,e){return this.caches[e][t]?this.caches[e][t]:null}checkTests(t,e,i){let n=!1;for(let e=0;e<t.length&&(n=t[e](),!n);e++);return this.addToCache(e,n,i),n}addToCache(t,e,i){this.caches[i][t]=e}_checkIPadPro(){const t=this.uaData.ua,e=/Mac OS/.test(t)&&!/like Mac OS/.test(t),i="ontouchstart"in window;e&&i&&(this.uaData.device.type="tablet",this.uaData.device.vendor="apple",this.uaData.device.model="ipad-pro")}};b.addQuery((function(t){return"device"===t.type&&"iPhone6"===t.value&&!(!b.ios||667!==window.outerHeight||375!==window.outerWidth||3!==window.devicePixelRatio)}),(function(t){return"device"===t.type&&"s5"===t.value&&!(!b.android||560!==window.outerHeight||360!==window.outerWidth||3!==window.devicePixelRatio)}),(function(t){if("device"!==t.type||"kindle"!==t.value)return!1;const e=navigator.userAgent;return/Kindle|Silk|KFAPW|KFARWI|KFASWI|KFFOWI|KFJW|KFMEWI|KFOT|KFSAW|KFSOWI|KFTBW|KFTHW|KFTT|WFFOWI/i.test(e)}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return CameraComponent_CameraComponent}));var n=i(36),r=i(146),o=i(68),a=i(16);class Vector4{constructor(t,e,i,n){this.isVector4=!0,this.x=t||0,this.y=e||0,this.z=i||0,this.w=void 0!==n?n:1}set(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}clone(){return new Vector4(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,i=this.y,n=this.z,r=this.w,o=t.elements;return this.x=o[0]*e+o[4]*i+o[8]*n+o[12]*r,this.y=o[1]*e+o[5]*i+o[9]*n+o[13]*r,this.z=o[2]*e+o[6]*i+o[10]*n+o[14]*r,this.w=o[3]*e+o[7]*i+o[11]*n+o[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,i,n,r;const o=t.elements,a=o[0],s=o[4],h=o[8],u=o[1],l=o[5],c=o[9],d=o[2],p=o[6],f=o[10];if(Math.abs(s-u)<.01&&Math.abs(h-d)<.01&&Math.abs(c-p)<.01){if(Math.abs(s+u)<.1&&Math.abs(h+d)<.1&&Math.abs(c+p)<.1&&Math.abs(a+l+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const t=(a+1)/2,o=(l+1)/2,m=(f+1)/2,g=(s+u)/4,y=(h+d)/4,v=(c+p)/4;return t>o&&t>m?t<.01?(i=0,n=.707106781,r=.707106781):(i=Math.sqrt(t),n=g/i,r=y/i):o>m?o<.01?(i=.707106781,n=0,r=.707106781):(n=Math.sqrt(o),i=g/n,r=v/n):m<.01?(i=.707106781,n=.707106781,r=0):(r=Math.sqrt(m),i=y/r,n=v/r),this.set(i,n,r,e),this}let m=Math.sqrt((p-c)*(p-c)+(h-d)*(h-d)+(u-s)*(u-s));return Math.abs(m)<.001&&(m=1),this.x=(p-c)/m,this.y=(h-d)/m,this.z=(u-s)/m,this.w=Math.acos((a+l+f-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return s.set(t,t,t,t),h.set(e,e,e,e),this.clamp(s,h)}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}}const s=new Vector4,h=new Vector4;var u=i(32),l=i(186),c=(i(29),i(34),i(30),i(0));class ColorMaterial_ColorMaterial extends c.Shader{constructor(t=16711680){const e=c.UniformGroup.from({uColor:c.utils.hex2rgb(t,new Float32Array(3))});super(c.Program.from("\nattribute vec3 aPosition;\nattribute vec3 aNormal;\n\nvarying vec3 vNormal;\n\nuniform mat4 uModelMatrix;\nuniform mat4 uViewMatrix;\nuniform mat4 uProjectionMatrix;\n\nvoid main() {\n\n gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(aPosition, 1.);\n\n vNormal = aNormal;\n}\n","\nuniform vec3 uColor;\nvarying vec3 vNormal;\n\nvoid main()\n{\n gl_FragColor = vec4(uColor, 1.);\n}\n","color"),e),this._color=t}set color(t){this._color=null!=t?t:16711680,this.uniforms.color=c.utils.hex2rgb(t,this.uniforms.color)}get color(){return this._color}}const d=new n.a,p=new o.a;var f;!function(t){t[t.PERSPECTIVE=0]="PERSPECTIVE",t[t.ORTHOGRAPHIC=1]="ORTHOGRAPHIC",t[t.CUSTOM=2]="CUSTOM"}(f||(f={}));class CameraComponent_CameraComponent{constructor(t,e={}){var i;this.zoom=1,this.entity=t,this.width=0,this.height=0,this.fov=e.fov||Math.PI/180*60,this.near=e.near||.1,this.far=e.far||1e3,this.zoom=null!==(i=e.zoom)&&void 0!==i?i:1,this.projection=new n.a,this.view=new n.a,this.viewProjection=new n.a,this.forward=new a.a,this.position=new a.a,this.mode=e.mode||0,this.lookAtTarget=e.lookAtTarget,this.custom=e.custom||!1,this.orthographicSize=e.orthographicSize||170,this.dirty=0,e.debug&&(e.debug=new u.a({geometry:new l.a(2),material:new ColorMaterial_ColorMaterial(16711680)}),t.addChild(e.debug)),this.clippingPlane=null,this.clipBias=0,this.frustum=new r.a}update(){this.lookAtTarget&&this.entity.transform.lookAt(this.lookAtTarget)}updateProjection(t,e){if(this.width=t,this.height=e,this._updateView(),this.mode===f.PERSPECTIVE)this.projection.makePerspective(this.fov/this.zoom,t/e,this.near,this.far);else if(this.mode===f.ORTHOGRAPHIC){const i=e/t,n=this.zoom*this.orthographicSize;this.projection.makeOrthographic(-n,n,-n*i,n*i,this.near,this.far)}this.clippingPlane&&this.addClippingPlane(this.clippingPlane),this.viewProjection.multiplyMatrices(this.projection,this.view),this.frustum.setFromMatrix(this.viewProjection),this.dirty++}addClippingPlane(t){const e=p.copy(t),i=this.projection;e.applyMatrix4(this.view);const n=new Vector4,r=new Vector4;n.set(e.normal.x,e.normal.y,e.normal.z,e.constant);const o=i.elements;r.x=(Math.sign(n.x)+o[8])/o[0],r.y=(Math.sign(n.y)+o[9])/o[5],r.z=-1,r.w=(1+o[10])/o[14],n.multiplyScalar(2/n.dot(r)),o[2]=n.x,o[6]=n.y,o[10]=n.z+1-this.clipBias,o[14]=n.w}copy(t){this.width=t.width,this.height=t.height,this.fov=t.fov,this.near=t.near,this.far=t.far,this.mode=t.mode,this.orthographicSize=t.orthographicSize,this.projection.copy(t.projection),this.view.copy(t.view),this.forward.copy(t.forward),this.position.copy(t.position)}_updateView(){const t=this.forward;if(this.custom){d.getInverse(this.view);const e=d.elements;t.x=e[8],t.y=e[9],t.z=e[10],t.setLength(-1),this.position.x=e[12],this.position.y=e[13],this.position.z=e[14]}else{const e=this.entity.transform.worldTransform,i=e.elements;t.x=i[8],t.y=i[9],t.z=i[10],t.setLength(-1),this.view.getInverse(e),this.position.x=i[12],this.position.y=i[13],this.position.z=i[14]}}}CameraComponent_CameraComponent.DEFAULT_NAME="camera"},,function(t,e,i){"use strict";i.d(e,"b",(function(){return h})),i.d(e,"a",(function(){return StandardMaterial_StandardMaterial}));i(9);var n=i(0),r=i(136);const o={uniformData:{id:-1}};var a=i(490),s=i(226);const h={name:"standard",vertex:"\nattribute vec3 aPosition;\nattribute vec3 aNormal;\n \nuniform mat4 uProjectionMatrix;\nuniform mat4 uViewMatrix;\n\nvarying vec3 vWorldNormal;\nvarying vec4 vWorldPosition;\n\nvoid main() {\n\n mat4 projectionMatrix = uProjectionMatrix;\n vec4 worldPosition = vec4(aPosition, 1.0);\n vec3 worldNormal = aNormal;\n mat4 modelMatrix;\n \n // sets the properties above and then \n // transform them above locally\n {{TRANSFORM}}\n \n worldPosition = modelMatrix * worldPosition;\n \n vec4 worldCameraPosition = uViewMatrix * worldPosition;\n \n // add any plugins to do shader fun\n {{MAIN}}\n\n // add the lighting inputs\n {{LIGHTING}}\n \n vWorldPosition = worldPosition;\n vWorldNormal = normalize(worldNormal);\n gl_Position = projectionMatrix * worldCameraPosition; \n \n /// add and final tweaks you want\n {{END}}\n}\n",fragment:"\nuniform vec4 uDiffuseColor;\nuniform vec3 uEyePosition;\n\nvarying vec4 vWorldPosition;\nvarying vec3 vWorldNormal;\nuniform vec3 uSpecularColor;\n\nvoid main() {\n\n vec2 uv;\n \n vec3 worldPosition = vWorldPosition.xyz;\n vec3 eyePosition = uEyePosition;\n vec3 eyeToSurfaceDir = normalize(worldPosition - eyePosition);\n \n // key variables, idea is to override what makes these..\n vec3 worldNormal;\n\n float specular = 0.;\n float gloss = 0.;\n\n vec3 emissiveColor = vec3(0.);\n vec3 reflectionColor = vec3(1.);\n vec4 diffuseColor = uDiffuseColor;\n float alphaColor = 1.;\n\n // calculated by the lighting model..\n vec3 specularColor = vec3(0.);\n vec3 lightingColor = vec3(0.);\n \n \n vec4 finalColor;\n \n {{MATERIAL}}\n\n {{MAIN}}\n \n finalColor.rgb = (diffuseColor.rgb * lightingColor * reflectionColor) + specularColor + emissiveColor; \n \n finalColor.a = 1.;\n finalColor *= alphaColor;\n\n {{END}}\n\n finalColor.rgb = gammaCorrectOutput(finalColor.rgb);\n\n gl_FragColor = finalColor;\n}"};let u=0;class StandardMaterial_StandardMaterial extends n.Shader{constructor(t,e={}){super(o,e),this.id=u++,this._config=t}build(t,e,i){var o;const u=this._config;this._built||e&&u.extensions.push(a.a),this._built=!0;const l=[u.modelMatrix,u.normalMatrix,u.uv,u.normal,u.diffuse,u.alpha,u.specular,u.emissive,u.reflection,u.lights(t.lights),s.a,...null!==(o=u.extensions)&&void 0!==o?o:[]].filter(t=>!!t),{vertex:c,fragment:d}=Object(r.a)(i,h,l);this.program=n.Program.from(c,d)}}StandardMaterial_StandardMaterial.MAX_BONES=20,StandardMaterial_StandardMaterial.FAST_NORMALS=!1,StandardMaterial_StandardMaterial.PREFER_TEXTURE=!0},function(t,e,i){"use strict";i.d(e,"a",(function(){return Guard_Guard}));var n=i(105),r=i(19),o=(i(9),i(28)),a=i(47),s=i(10),h=i(13),u=i(252),l=i(18);function c(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class ChaserState{constructor(t){c(this,"name",""),c(this,"distance",0),c(this,"duration",0),c(this,"curve",null),c(this,"follower",void 0),this.follower=t}get game(){return this.follower.entity.game}get player(){return this.follower.entity.game.hero.player}enter(t){this.follower.distanceStart=this.follower.distance,this.follower.distanceEnd=this.distance,this.follower.duration=this.duration,this.follower.curve=this.curve,this.follower.time=0}}class ChaserStateDisabled extends ChaserState{constructor(...t){super(...t),c(this,"name","disabled"),c(this,"distance",9999),c(this,"duration",.1),c(this,"curve",null)}condition(t){return!this.game||!this.player.dead&&!this.player.running&&t.neither("intro")}}class ChaserStateIntro extends ChaserState{constructor(...t){super(...t),c(this,"name","intro"),c(this,"distance",10),c(this,"duration",.01),c(this,"curve",null)}condition(t){return!this.follower.entity.game.hero.player.running&&t.either("disabled")}enter(t){var e,i;super.enter(t),this.game.sfx.play("guard-start"),null===(e=this.follower.entity.anim)||void 0===e||e.play("Guard_playIntro",{sudden:!0}),null===(i=this.follower.entity.dog.anim)||void 0===i||i.play("Dog_playIntro",{sudden:!0})}}class Chaser_ChaserStateNear extends ChaserState{constructor(...t){super(...t),c(this,"name","near"),c(this,"distance",10),c(this,"duration",.6),c(this,"curve",a.a.sineOut)}enter(t){super.enter(t),this.follower.entity.game.sfx.play("guard-proximity")}condition(t){return!this.game.level.isTutorial()&&(this.follower.entity.game.state===o.a.RUNNING&&(!!this.follower.entity.game.hero.player.dizzy&&t.neither("disabled","catch")))}update(){var t,e,i,n;this.game.hero.body.landed?(null===(t=this.follower.entity.anim)||void 0===t||t.play("Guard_run",{loop:!0}),null===(e=this.follower.entity.dog.anim)||void 0===e||e.play("Dog_run",{loop:!0})):(null===(i=this.follower.entity.anim)||void 0===i||i.play("Guard_jump",{loop:!1}),null===(n=this.follower.entity.dog.anim)||void 0===n||n.play("Dog_jump",{loop:!0}))}}class Chaser_ChaserStateFar extends ChaserState{constructor(...t){super(...t),c(this,"name","far"),c(this,"distance",70),c(this,"duration",3),c(this,"curve",a.a.sineIn)}condition(t){return!!this.game.level.isTutorial()||this.follower.entity.game.state===o.a.RUNNING&&(!this.follower.entity.game.hero.player.dizzy&&t.either("near"))}update(){var t,e,i,n;this.game.hero.body.landed?(null===(t=this.follower.entity.anim)||void 0===t||t.play("Guard_run",{loop:!0}),null===(e=this.follower.entity.dog.anim)||void 0===e||e.play("Dog_run",{loop:!0})):(null===(i=this.follower.entity.anim)||void 0===i||i.play("Guard_jump",{loop:!1}),null===(n=this.follower.entity.dog.anim)||void 0===n||n.play("Dog_jump",{loop:!1}))}}class Chaser_ChaserStateGoAway extends ChaserState{constructor(...t){super(...t),c(this,"name","goAway"),c(this,"distance",100),c(this,"duration",.5),c(this,"curve",a.a.sineIn)}condition(){return"train"===this.player.deathCause||this.follower.entity.game.state===o.a.RUNNING&&this.follower.distance>60}}class Chaser_ChaserStateCatch extends ChaserState{constructor(...t){super(...t),c(this,"name","catch"),c(this,"distance",0),c(this,"duration",.3),c(this,"curve",a.a.sineOut),c(this,"anim",["_Caught_Shoulder"])}enter(t){var e,i;super.enter(t),this.follower.entity.game.sfx.play("guard-catch");const n=h.a.pick(...this.anim);null===(e=this.follower.entity.anim)||void 0===e||e.play("Guard"+n,{sudden:!0}),null===(i=this.follower.entity.dog.anim)||void 0===i||i.play("Dog"+n,{sudden:!0}),this.game.hero.anim.play("Avatar"+n,{sudden:!0}),this.game.missions.addStat(1,"mission-get-caught")}condition(){return"train"!==this.player.deathCause&&this.follower.entity.game.hero.player.dead}}class Chaser_Chaser extends l.a{constructor(t,e={}){super(t,e),c(this,"offsetX",void 0),c(this,"near",!1),c(this,"enabled",!1),c(this,"lastGround",0),c(this,"lastPos",0),c(this,"time",0),c(this,"distanceStart",0),c(this,"distanceEnd",0),c(this,"duration",0),c(this,"curve",void 0),c(this,"sound",void 0),c(this,"entity",void 0),c(this,"sm",void 0),c(this,"_distance",0),this.entity=t,this.offsetX=e.offsetX||0,this.sm=new u.a,this.sm.add(new ChaserStateDisabled(this)),this.sm.add(new ChaserStateIntro(this)),this.sm.add(new Chaser_ChaserStateNear(this)),this.sm.add(new Chaser_ChaserStateFar(this)),this.sm.add(new Chaser_ChaserStateGoAway(this)),this.sm.add(new Chaser_ChaserStateCatch(this)),this.sm.set("disabled"),this.reset()}reset(){this.entity.body&&(this.entity.body.lane=0,this.entity.body.x=0,this.entity.body.z=999,this.entity.body.bottom=0,this.entity.active=!1,this.near=!1,this.enabled=!1,this.lastGround=0,this.lastPos=0,this.entity.game&&this.sm.set("disabled"))}update(){const t=this.entity.game.delta;if(!this.enabled||!this.entity.game)return;this.sm.update(t),this.time<=this.duration&&(this.time+=this.entity.game.deltaSecs,this.time>this.duration&&(this.time=this.duration));const e=this.entity.game.stats.x+this.offsetX;this.entity.body.x=s.a.lerp(this.entity.body.x,e,.5*t);const i=this.entity.game.hero;i.body.landed&&(this.lastGround=i.body.ground);const n=this.lastGround+.5*(i.body.bottom-this.lastGround);this.entity.body.bottom=n,this.entity.body.bottom>i.body.bottom&&(this.entity.body.bottom=i.body.bottom);const r=this.curve?this.curve(this.time/this.duration):this.time/this.duration,o=s.a.lerp(this.distanceStart,this.distanceEnd,r);this.distance=o,this.sound&&this.sound.volume(1-s.a.clamp(this.distance/70,0,1))}set distance(t){const e=this.entity.game.stats.z+t;this._distance=t,this.entity.body.z=e,this.entity.model.active=this._distance<30,this.entity.anim.active=this.entity.model.active}get distance(){return this._distance}enable(){this.enabled=!0}disable(){this.entity.active=!0,this.entity.body.z=9999,this.enabled=!1}playIntro(){this.distance=50,this.time=this.duration=.01,this.enable(),this.sm.set("intro")}dismiss(){this.sm.set("disabled")}}var d=i(57),p=i(14);function f(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Dog_Dog extends p.a{constructor(){super(),f(this,"anim",void 0),f(this,"state",void 0),f(this,"model",void 0),f(this,"_initialized",!1),f(this,"statesReady",!1),this.levelEntity=!1,this.add(r.a,{deco:!0,ghost:!0}),this.add(n.a),this.body.height=14,this.body.width=6,this.body.depth=6,this.model=this.anim.container,this.model.y=.4*-this.body.height,this.model.ry=Math.PI,this.addChild(this.model),this.scale.set(.01)}init(){this._initialized||(this._initialized=!0,this.anim.addScene(d.a.dog.movement),this.anim.addScene(d.a.dog.catch))}playIntro(){this.init(),this.scale.set(.01),this.active=!0,setTimeout(()=>this.scale.set(1),100)}run(){this.init(),this.active=!0,this.anim.play("Dog_run",{loop:!0,mixRatio:.1})}reset(){this._initialized&&(this.active=!1)}}function m(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Guard_Guard extends p.a{constructor(){super(),m(this,"anim",void 0),m(this,"chaser",void 0),m(this,"state",void 0),m(this,"dog",void 0),m(this,"model",void 0),m(this,"catch",void 0),m(this,"catchCount",void 0),m(this,"_initialized",!1),m(this,"statesReady",!1),this.levelEntity=!1,this.add(r.a,{deco:!0,ghost:!0}),this.add(Chaser_Chaser),this.add(n.a),this.body.height=14,this.body.width=6,this.body.depth=6,this.model=this.anim.container,this.model.y=.4*-this.body.height,this.model.ry=Math.PI,this.addChild(this.model),this.catch=null,this.catchCount=0,this.dog=new Dog_Dog,this.dog.body.x=5,this.dog.body.z=-6,this.addChild(this.dog)}init(){this._initialized||(this._initialized=!0,this.anim.addScene(d.a.guard.movement),this.anim.addScene(d.a.guard.catch),this.dog.init())}playIntro(){this.init(),this.scale.set(.01),this.active=!0,this.z=999,this.body.z=this.z,this.chaser.playIntro(),this.dog.playIntro(),setTimeout(()=>this.scale.set(1),100)}run(){this.init(),this.active=!0,this.anim.play("Guard_run",{loop:!0,mixRatio:.1}),this.chaser.enable(),this.dog.run()}reset(){this._initialized&&(this.chaser.reset(),this.z=999,this.body.z=this.z,this.catchCount=0,this.catch=null,this.active=!1,this.dog.reset())}catchHero(){this.catchCount=10}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return DebugSystem_DebugSystem}));var n=i(2),r=i(103),o=i(16),a=i(155),s=i(290),h=i(74),u=i(140);function l(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function c(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?l(Object(i),!0).forEach((function(e){d(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):l(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function d(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const p={speed:1,rotationSensitivity:.02,acceleration:1};class FreeCamera_FreeCameraComponent extends r.a{constructor(t,e={}){super(t,c(c({},p),e)),d(this,"_enabled",void 0),d(this,"axis",void 0),d(this,"mouse",void 0),d(this,"mouseDelta",void 0),d(this,"mousePos",void 0),d(this,"originalRotation",void 0),d(this,"originalUpdateProjection",void 0),d(this,"entity",void 0),d(this,"onMouseMove",t=>{this.mouse.x=t.clientX-window.innerWidth/2,this.mouse.y=t.clientY-window.innerHeight/2,this.mousePos.x||(this.mousePos.x=this.mouse.x),this.mousePos.y||(this.mousePos.y=this.mouse.y)}),d(this,"onKeyDown",t=>{if(!t.repeat)switch(t.key){case"w":this.axis.z=-1;break;case"s":this.axis.z=1;break;case"a":this.axis.x=-1;break;case"d":this.axis.x=1;break;case"q":this.axis.y=-1;break;case"e":this.axis.y=1}}),d(this,"onKeyUp",t=>{switch(t.key){case"w":-1===this.axis.z&&(this.axis.z=0);break;case"s":1===this.axis.z&&(this.axis.z=0);break;case"a":-1===this.axis.x&&(this.axis.x=0);break;case"d":1===this.axis.x&&(this.axis.x=0);break;case"q":-1===this.axis.y&&(this.axis.y=0);break;case"e":1===this.axis.y&&(this.axis.y=0)}}),this.entity=t,this._enabled=!1,this.axis=new o.a,this.mouse=new a.a,this.mousePos=new a.a,this.mouseDelta=new a.a,this.originalRotation=new o.a,this.enable()}enable(){if(this._enabled)return;this._enabled=!0,this.originalRotation.set(this.entity.rx,this.entity.ry,this.entity.rz);const t=this.entity.getComponent(s.a);this.originalUpdateProjection=t.updateProjection,t.updateProjection=v,document.addEventListener("keydown",this.onKeyDown),document.addEventListener("keyup",this.onKeyUp),window.addEventListener("mousemove",this.onMouseMove)}disable(){if(!this._enabled)return;this._enabled=!1,document.removeEventListener("keydown",this.onKeyDown),document.removeEventListener("keyup",this.onKeyUp),window.removeEventListener("mousemove",this.onMouseMove),this.entity.rotation.copyFrom(this.originalRotation);const t=this.entity.getComponent(s.a);t.updateProjection=this.originalUpdateProjection,t.dirty++,this.entity.transform._onChange()}update(){if(!this._enabled)return;this.mouseDelta.x=this.mouse.x-this.mousePos.x,this.mouseDelta.y=this.mouse.y-this.mousePos.y;const t=this.entity;t.ry-=this.mouseDelta.x*this.data.rotationSensitivity,t.rx-=this.mouseDelta.y*this.data.rotationSensitivity,this.mousePos.x=this.mouse.x,this.mousePos.y=this.mouse.y;const e=t.transform.worldTransform,i=e.extractForward(new o.a);i.multiplyScalar(-this.axis.z),t.x+=i.x,t.y+=i.y,t.z+=i.z;const n=e.extractRight(new o.a);n.multiplyScalar(this.axis.x),t.x+=n.x,t.y+=n.y,t.z+=n.z;const r=e.extractUp(new o.a);r.multiplyScalar(this.axis.y),t.x+=r.x,t.y+=r.y,t.z+=r.z}}const f=new h.a,m=new u.a(0,0,0,"YXZ"),g=new o.a(1,1,1),y=new o.a;function v(t,e){m.x=this.entity.rx,m.y=this.entity.ry,m.z=this.entity.rz,f.setFromEuler(m),this.entity.transform.worldTransform.extractPosition(y),this.entity.transform.worldTransform.compose(y,f,g),this.view.getInverse(this.entity.transform.worldTransform),this.projection.makePerspective(this.fov,t/e,this.near,this.far),this.dirty++}var b=i(31);function _(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class DebugText{constructor(){_(this,"element",void 0),_(this,"showing",!1),this.element=document.createElement("tag"),this.element.style.position="absolute",this.element.style.fontFamily="Arial",this.element.style.color="#FFFFFF",this.element.style.display="block",this.element.style.overflow="hidden",this.element.style.fontSize="0.7em",this.element.style.padding="5px",this.element.style.backgroundColor="rgba(0, 0, 0, 0.5)"}toggle(){this.showing?this.hide():this.show()}show(){this.showing=!0,document.body.appendChild(this.element)}hide(){this.showing=!1,this.element.remove()}update(t){this.element.innerText=t}}class DebugSystem_DebugSystem extends b.a{constructor(t){super(t),_(this,"freeCameraOn",!1),_(this,"debugStats",void 0),this.freeCameraOn=!1,window.addEventListener("keydown",this.onKeyDown.bind(this)),this.debugStats=new DebugText,setInterval(()=>this._update(),100)}_update(){if(!this.game||this.game.app.crashed)return;const t=[w("ENGINE",this.game.profile),w("STATS",this.game.stats.profile),w("CAMERA",this.game.camera.profile),w("PHYSICS",this.game.physics.stats)];this.debugStats.update(t.join("\n"))}onKeyDown(t){"z"===t.key&&this.toggleFreeCamera(),"x"===t.key&&this.debugStats.toggle(),this.freeCameraOn||("t"===t.key&&this.game.level.reshuffle(),"m"===t.key&&this.game.hero.magnet.turnOn(),"j"===t.key&&this.game.hero.jetpack.turnOn(),"q"===t.key&&this.game.hero.pogo.turnOn(),"s"===t.key&&this.game.hero.sneakers.turnOn(),"e"===t.key&&this.game.hero.multiplier.turnOn())}toggleFreeCamera(){this.freeCameraOn?this.endFreeCamera():this.beginFreeCamera()}beginFreeCamera(){this.freeCameraOn||(this.freeCameraOn=!0,this.game.timeScale=0,this.game.camera.suspend=!0,this.game.camera.mainCamera.addComponent(FreeCamera_FreeCameraComponent,{}))}endFreeCamera(){this.freeCameraOn&&(this.freeCameraOn=!1,this.game.camera.suspend=!1,this.game.camera.mainCamera.removeComponent(FreeCamera_FreeCameraComponent),this.game.timeScale=n.a.timeScale)}}function w(t,e,i){i||(i=Object.keys(e));let n="";for(const t in i){const r=i[t];let o=e[r];"number"==typeof o&&o%1!=0&&(o=o.toFixed(3)),n+=r+": "+o+"\n"}return t.toUpperCase()+"\n"+n}},function(t,e,i){"use strict";i.d(e,"a",(function(){return EnvironmentSystem_EnvironmentSystem}));var n=i(2),r=i(13),o=i(69),a=i(97),s=i(81),h=i(25),u=i(121),l=i(122),c=i(1),d=i(14);class Skyline_Skyline extends d.a{constructor(){if(super(),this.levelEntity=!1,this.rotation.y=Math.PI,this.y=100,this.x=100,!n.a.environment)return;const t=c.a.library.whichEntity("sl_monument_4","sl_monument_04"),e=c.a.library.getEntity(t,{color:9490943,fog:!0});this.addChild(e),e.x=100,e.y=-50,e.z=0;const i=c.a.library.whichEntity("sl_monument_2","sl_monument_02"),r=c.a.library.getEntity(i,{color:6533631,fog:!0});this.addChild(r),r.x=0,r.z=-30;const o=c.a.library.whichEntity("sl_monument_3","sl_monument_03"),a=c.a.library.getEntity(o,{color:9490943,fog:!0});this.addChild(a),r.x=0,r.y=-200,a.z=-60;const s=c.a.library.whichEntity("sl_monument_1","sl_monument_01"),h=c.a.library.getEntity(s,{color:6533631,fog:!0});this.addChild(h),r.x=100,h.z=-90}}var p=i(99),f=i(98),m=i(31);function g(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class EnvironmentSystem_EnvironmentSystem extends m.a{constructor(t){super(t),g(this,"models",void 0),g(this,"skyline",void 0),this.models=[],this.game.onRun.add({run:this.run.bind(this)})}run(){this.skyline||(this.skyline=new Skyline_Skyline,this.game.addChild(this.skyline))}update(){this.skyline&&(this.skyline.z=this.game.stats.z-.95*n.a.visibleMaxDistance)}canSpawn(t){const e=o.a.environment(t);let i=e?o.a.environmentType(e):null;if(!i)if(t.name.match(/tunnel/))i=["Gates","All"];else if(t.name.match(/epic/))i=["Epic","All"];else if(t.components.RouteChunk){const e=t.components.RouteChunk._limitedAllowedEnvironmentKinds;i=(null!=e&&e.length?r.a.item(e)._type.split(","):["Fillers","All"])||[]}else i=[];if(!i)throw Error("Environment should not be undefined at this point");return!(i.indexOf("Tube")>=0&&!f.a.hasNecessaryResources())&&(!(i.indexOf("Station")>=0&&!p.a.hasNecessaryResources())&&(!(i.indexOf("Epic")>=0&&!a.a.hasNecessaryResources())&&(!(i.indexOf("Gates")>=0&&!u.a.hasNecessaryResources())&&!(i.indexOf("Pillars")>=0&&!l.a.hasNecessaryResources()))))}setup(t){const e=o.a.environment(t.node);let i=e?o.a.environmentType(e):null;if(!i)if(t.node.name.match(/tunnel/))i=["Gates","All"];else if(t.node.name.match(/epic/))i=["Epic","All"];else if(t.node.components.RouteChunk){const e=t.node.components.RouteChunk._limitedAllowedEnvironmentKinds;i=(e.length?r.a.item(e)._type.split(","):["Fillers","All"])||[]}else i=[];if(!i)throw Error("Environment should not be undefined at this point");t.envTube=!1,t.envStation=!1,t.envEpic=!1,t.envGates=!1,t.envEmpty=!1,t.envPillars=!1,(n.a.forceTube||i.indexOf("Tube")>=0)&&f.a.hasNecessaryResources()?t.envTube=this.game.route.canSpawn("tube",t.z):i.indexOf("Station")>=0&&p.a.hasNecessaryResources()?t.envStation=!0:i.indexOf("Epic")>=0&&a.a.hasNecessaryResources()?t.envEpic=this.game.route.canSpawn("epic",t.z):i.indexOf("Gates")>=0&&u.a.hasNecessaryResources()?t.envGates=!0:i.indexOf("Pillars")>=0&&l.a.hasNecessaryResources()?t.envPillars=!0:i.indexOf("Empty")>=0&&(t.envEmpty=!0)}mount(t){t.envTube&&f.a.hasNecessaryResources()?this.spawnTube(t):t.envStation&&p.a.hasNecessaryResources()?this.spawnStation(t):t.envEpic&&a.a.hasNecessaryResources()?this.spawnEpic(t):t.envEmpty?this.spawnRegular(t):t.envGates?this.spawnGates(t):this.spawnRegular(t)}spawnEpic(t){a.a.mount(t),this.game.route.setSpawn("epic",t.z-t.length-1800)}spawnTube(t){const e=t.node,i=t.game.pool.get(f.a);t.game.addChild(i),i.awake(t,e),this.game.route.setSpawn("tube",t.z-t.length-360)}spawnStation(t){const e=o.a.environment(t.node),i=t.game.pool.get(p.a);i.awake(t,e),t.game.addChild(i),h.k.mount(t),s.a.mount(t)}spawnGates(t){}spawnRegular(t){s.a.mount(t),h.k.mount(t)}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Blocker_Blocker}));i(9);var n=i(1),r=i(13),o=i(19),a=i(14);class BlockerDodgeDetector_BlockerDodgeDetector extends a.a{constructor(){super(),this.add(o.a,{trigger:!0}),this.body.width=16,this.body.height=100,this.body.depth=1,this.name="BlockerDodgeDetector",this.removableOnCrash=!0}}var s=i(64);function h(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Blocker_Blocker extends a.a{constructor(){super(),h(this,"modelName",""),h(this,"dodgeDetector",void 0),this.add(o.a,{ghost:!0}),this.body.width=16,this.body.height=26,this.body.depth=1,this.removableOnCrash=!0}build(){!this.model&&n.a.library.hasGeometry(this.modelName)&&(this.model=n.a.library.getEntity(this.modelName),this.addChild(this.model))}awake(t,e){this.build(),this.model&&(this.model.ry=Math.PI,this.model.z=-5)}hasNecessaryResources(){return n.a.library.hasGeometry("blocker_jump")}static match(t){return!!t.name.match(/blocker/)}static factory(t,e,i){let n=r.a.pick(...Object.keys(u));e.name.match("jump")&&(n="jump"),e.name.match("roll")&&(n="roll");const o=u[n],a=t.game.pool.get(o),h=t.game.pool.get(BlockerDodgeDetector_BlockerDodgeDetector),l=e.components.Transform.position.x,c=e.components.Transform.position.z;a.body.front=t.z-c,a.body.x=l,i.offsetX&&(a.body.x=i.offsetX),i.flip&&(a.body.x*=-1),a.awake(t,e),t.game.addChild(a),t.game.addChild(h),h.body.x=a.body.x||0,h.body.y=a.body.y||0,h.body.z=a.body.z||0,a.dodgeDetector=h,e.name.match("w_coins")&&(o===u.jump?s.a.spawnCurve(t,a.body.x,0,a.body.z):s.a.spawnLine(t,a.body.x,0,a.body.z))}static prepopulate(){n.a.game.pool.prepopulate(BlockerJump,8),n.a.game.pool.prepopulate(BlockerRoll,8),n.a.game.pool.prepopulate(BlockerStandard,8)}}class BlockerJump extends Blocker_Blocker{constructor(){super(),this.modelName="blocker_jump"}awake(t,e){super.awake(t,e),this.body.height=26}}class BlockerRoll extends Blocker_Blocker{constructor(){super(),this.modelName="blocker_roll"}awake(t,e){super.awake(t,e),this.body.height=19,this.body.bottom=10,this.model&&(this.model.y=-this.body.height/2-this.body.bottom)}}class BlockerStandard extends Blocker_Blocker{constructor(){super(),this.modelName="blocker_standard"}awake(t,e){super.awake(t,e),this.body.height=4,this.body.bottom=10,this.model&&(this.model.y=-this.body.height/2-this.body.bottom)}}const u={jump:BlockerJump,roll:BlockerRoll,standar:BlockerStandard,standard:BlockerStandard}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Animator3DComponent}));i(9);var n=i(37),r=i(184),o=i(74),a=i(16),s=i(154);let h,u,l,c;class Animator3DComponent{constructor(t,e){var i;if(this.signals={animationComplete:new n.Signal},h||(h=new o.a,u=new o.a,l=new a.a,c=new a.a),this.entity=t,this.autoUpdate=null===(i=e.autoUpdate)||void 0===i||i,this._mixedMap={},e.clips){const t={},i=e.animations[0],n=e.fps||24;for(const r in e.clips){const o=e.clips[r],a=o.frames,h=a[0]/n,u=a[1]/n;i.duration;const l={name:r,start:h,end:u,animation:i,speed:o.speed,loop:o.loop},c=s.a.fromAnimation(l);t[r]=c}if(e.mixes)for(const t of e.mixes)this.setMix(t[0],t[1],t[2]);this._animations=t}else this._animations={},e.animations.forEach((t,e)=>{this._animations[e]=new s.a({loop:!0,duration:t.duration,name:"animation"+e,data:t.data})});this._animationTick=0,this._defaultMix=.045,this.mixAmount=this._defaultMix,this.lastAnimation=null,this._lastAnimationTick=0,this._mixRatio=0,this._mixing=!1,this.allowMixing=!0,this._nextAnimation=null}play(t,e=!1){if(e||this._animations[t]!==this.animation)if(this._mixing)this._nextAnimation=t;else{if(this.allowMixing&&(this.lastAnimation=this.animation,this._lastAnimationTick=this._animationTick,this.animation)){const e=this.lastAnimation.name+t;this.mixAmount=this._mixedMap[e]||this._defaultMix,this._mixRatio=0,this._mixing=!0}this._animationTick=0,this.animation=this._animations[t]}}setMix(t,e,i){const n=t+e;this._mixedMap[n]=i}update(t){this.autoUpdate&&this.updateAnimation(t.frameTime)}render(){this.animation&&(this._mixing&&this.lastAnimation?this._mixRatio>1?this._applySingleAnimation(this.animation,this._animationTick):this._applyTwoAnimations(this.animation,this._animationTick,this.lastAnimation,this._lastAnimationTick,this._mixRatio):this._applySingleAnimation(this.animation,this._animationTick))}updateAnimation(t=1){this.animation&&(this._animationTick+=this.animation.speed*t,this._mixing&&this.lastAnimation?(this._lastAnimationTick+=this.lastAnimation.speed*t,this._mixRatio+=this.mixAmount*t,this._mixRatio>1&&(this._mixRatio=1,this._mixing=!1,this._playNextAnimation())):this._playNextAnimation())}_playNextAnimation(){this._nextAnimation&&(this.play(this._nextAnimation),this._nextAnimation=null)}_applySingleAnimation(t,e){const i=t.loop,n=this.entity.getComponent(r.a);e=this._updateAnimationTime(t,e);for(let r=0;r<t.data.length;r++){const o=t.data[r],a=n.map[o.id];a&&(o.t&&this._interpolateVec3(o.t.times,o.t.values,e,i,a.transform.position),o.s&&this._interpolateVec3(o.s.times,o.s.values,e,i,a.transform.scale),o.r&&this._interpolateQuat(o.r.times,o.r.values,e,i,a.transform.quat),a.transform._onChange(),o.w&&a.view3d.material.uniforms.uMorphTargetInfluence&&this._interpolateArray(o.w.times,o.w.values,e,i,a.view3d.material.uniforms.uMorphTargetInfluence,a.view3d.geometry.castToBaseGeometry().weights.length))}}_applyTwoAnimations(t,e,i,n,o){const a=l,s=c,h=u,d=t.loop,p=i.loop,f=this.entity.getComponent(r.a);e=this._updateAnimationTime(t,e),n=this._updateAnimationTime(i,n);for(let r=0;r<t.data.length;r++){const u=t.data[r],l=i.data[r],c=f.map[u.id];if(c){if(u.t&&(this._interpolateVec3(u.t.times,u.t.values,e,d,s),this._interpolateVec3(l.t.times,l.t.values,n,p,a),c.transform.position.set(a.x+(s.x-a.x)*o,a.y+(s.y-a.y)*o,a.z+(s.z-a.z)*o)),u.s&&(this._interpolateVec3(u.s.times,u.s.values,e,d,a),this._interpolateVec3(l.s.times,l.s.values,n,p,s),c.transform.scale.set(a.x+(s.x-a.x)*o,a.y+(s.y-a.y)*o,a.z+(s.z-a.z)*o)),u.w&&(this._interpolateVec3(u.w.times,u.w.values,e,d,a),this._interpolateVec3(l.w.times,l.w.values,n,p,s)),u.r){const t=c.transform.quat;this._interpolateQuat(l.r.times,l.r.values,n,p,t),this._interpolateQuat(u.r.times,u.r.values,e,d,h),t.slerp(h,o)}c.transform._onChange()}}}_interpolateVec3(t,e,i,n,r){let o=0;for(let e=0;e<t.length&&!(t[e]>i);e++)o=e;let a,s=o+1;if(n&&s>t.length-1&&(s=0),o===t.length-1)a=1;else{const e=t[o],n=t[o+1];a=1-(n-i)/(n-e)}const h=e[3*o+0],u=e[3*o+1],l=e[3*o+2],c=e[3*s+0],d=e[3*s+1],p=e[3*s+2];return r.x=h+(c-h)*a,r.y=u+(d-u)*a,r.z=l+(p-l)*a,r}_interpolateArray(t,e,i,n,r,o){let a=0;for(let e=0;e<t.length&&!(t[e]>i);e++)a=e;let s,h=a+1;if(n&&h>t.length-1&&(h=0),a===t.length-1)s=1;else{const e=t[a],n=t[a+1];s=1-(n-i)/(n-e)}for(let t=0;t<o;t++){const i=e[a*o+t],n=e[h*o+t];r[t]=i+(n-i)*s}return r}_interpolateQuat(t,e,i,n,r){let o=0;for(let e=0;e<t.length&&!(t[e]>i);e++)o=e;let a,s=o+1;if(n&&s>t.length-1&&(s=0),r.x=e[4*o+0],r.y=e[4*o+1],r.z=e[4*o+2],r.w=e[4*o+3],h.x=e[4*s+0],h.y=e[4*s+1],h.z=e[4*s+2],h.w=e[4*s+3],o===t.length-1)a=1;else{const e=t[o],n=t[o+1];a=1-(n-i)/(n-e)}return r.slerp(h,a),r}_updateAnimationTime(t,e){const i=t.currentTime;let n=!1;if(t.loop)(e%=t.duration)<0&&(e+=t.duration),e<i&&(n=!0);else{const r=t.duration-.01;e>r&&(e=r,i<r&&(n=!0))}return t.currentTime=e,n&&this.signals.animationComplete.emit(t.name),e}}Animator3DComponent.DEFAULT_NAME="animationController"},function(t,e,i){"use strict";i.d(e,"a",(function(){return Plugin}));class Plugin{constructor(t,e){var i,n;this.app=t,this.options=e||{},this.verbose=null!==(n=null!==(i=e.verbose)&&void 0!==i?i:t.verbose)&&void 0!==n&&n}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return ResourcePlugin}));i(9);var n=i(298),r=i(479),o=i(50),a=i(123),s=function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))};class ResourcePlugin extends n.a{constructor(){super(...arguments),this.loadingIds=[]}init(){var t;return s(this,void 0,void 0,(function*(){const e={renderer:this.app.get(r.a).renderer,basePath:null!==(t=this.options.basePath)&&void 0!==t?t:"",manifest:this.options.manifest,version:this.options.version||"high",canOptimise:this.options.canOptimise,verbose:this.options.verbose,canCacheBust:this.options.canCacheBust,uploadTexturesOnLoad:this.options.uploadTexturesOnLoad,disableGarbageCollection:this.options.disableGarbageCollection,preserveImageBitmap:this.options.preserveImageBitmap,manifestBasePath:this.options.manifestBasePath,imageFormatPreference:this.options.imageFormatPreference};a.a.init(e)}))}load(...t){return s(this,void 0,void 0,(function*(){this.loadingIds=t.slice(0),yield a.a.load(t),this.loadingIds=[]}))}backgroundLoad(...t){return s(this,void 0,void 0,(function*(){a.a.backgroundLoad(t)}))}get cache(){return o.b||{}}get loading(){return this.loadingIds.length>0}get manager(){return a.a}}},,,,,,,,,,,,,,,function(t,e){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(t,e,i){"use strict";var n=i(125),r=i(316),o=i(114),a=i(115),s=i(324),h=a.set,u=a.getterFor("Array Iterator");t.exports=s(Array,"Array",(function(t,e){h(this,{type:"Array Iterator",target:n(t),index:0,kind:e})}),(function(){var t=u(this),e=t.target,i=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:n,done:!1}:"values"==i?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e,i){var n=i(49),r=i(128),o=i(71),a=n("unscopables"),s=Array.prototype;null==s[a]&&o.f(s,a,{configurable:!0,value:r(null)}),t.exports=function(t){s[a][t]=!0}},function(t,e,i){var n=i(70),r=i(71),o=i(79),a=i(320);t.exports=n?Object.defineProperties:function(t,e){o(t);for(var i,n=a(e),s=n.length,h=0;s>h;)r.f(t,i=n[h++],e[i]);return t}},function(t,e,i){var n=i(59),r=i(129),o=i(319),a=i(49)("toPrimitive");t.exports=function(t,e){if(!n(t)||r(t))return t;var i,s=t[a];if(void 0!==s){if(void 0===e&&(e="default"),i=s.call(t,e),!n(i)||r(i))return i;throw TypeError("Can't convert object to primitive value")}return void 0===e&&(e="number"),o(t,e)}},function(t,e,i){var n=i(59);t.exports=function(t,e){var i,r;if("string"===e&&"function"==typeof(i=t.toString)&&!n(r=i.call(t)))return r;if("function"==typeof(i=t.valueOf)&&!n(r=i.call(t)))return r;if("string"!==e&&"function"==typeof(i=t.toString)&&!n(r=i.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t,e,i){var n=i(199),r=i(166);t.exports=Object.keys||function(t){return n(t,r)}},function(t,e,i){var n=i(125),r=i(72),o=i(164),a=function(t){return function(e,i,a){var s,h=n(e),u=r(h.length),l=o(a,u);if(t&&i!=i){for(;u>l;)if((s=h[l++])!=s)return!0}else for(;u>l;l++)if((t||l in h)&&h[l]===i)return t||l||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},function(t,e,i){var n=i(113);t.exports=n("document","documentElement")},function(t,e,i){var n=i(45),r=i(200),o=n.WeakMap;t.exports="function"==typeof o&&/native code/.test(r(o))},function(t,e,i){"use strict";var n=i(101),r=i(329),o=i(131),a=i(117),s=i(170),h=i(73),u=i(116),l=i(49),c=i(159),d=i(114),p=i(202),f=p.IteratorPrototype,m=p.BUGGY_SAFARI_ITERATORS,g=l("iterator"),y=function(){return this};t.exports=function(t,e,i,l,p,v,b){r(i,e,l);var _,w,x,C=function(t){if(t===p&&P)return P;if(!m&&t in A)return A[t];switch(t){case"keys":case"values":case"entries":return function(){return new i(this,t)}}return function(){return new i(this)}},S=e+" Iterator",T=!1,A=t.prototype,E=A[g]||A["@@iterator"]||p&&A[p],P=!m&&E||C(p),M="Array"==e&&A.entries||E;if(M&&(_=o(M.call(new t)),f!==Object.prototype&&_.next&&(c||o(_)===f||(a?a(_,f):"function"!=typeof _[g]&&h(_,g,y)),s(_,S,!0,!0),c&&(d[S]=y))),"values"==p&&E&&"values"!==E.name&&(T=!0,P=function(){return E.call(this)}),c&&!b||A[g]===P||h(A,g,P),d[e]=P,p)if(w={values:C("values"),keys:v?P:C("keys"),entries:C("entries")},b)for(x in w)(m||T||!(x in A))&&u(A,x,w[x]);else n({target:e,proto:!0,forced:m||T},w);return w}},function(t,e,i){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);e.f=o?function(t){var e=r(this,t);return!!e&&e.enumerable}:n},function(t,e,i){var n=i(113),r=i(169),o=i(327),a=i(79);t.exports=n("Reflect","ownKeys")||function(t){var e=r.f(a(t)),i=o.f;return i?e.concat(i(t)):e}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,i){var n=i(48),r=/#|\.prototype\./,o=function(t,e){var i=s[a(t)];return i==u||i!=h&&("function"==typeof e?n(e):!!e)},a=o.normalize=function(t){return String(t).replace(r,".").toLowerCase()},s=o.data={},h=o.NATIVE="N",u=o.POLYFILL="P";t.exports=o},function(t,e,i){"use strict";var n=i(202).IteratorPrototype,r=i(128),o=i(130),a=i(170),s=i(114),h=function(){return this};t.exports=function(t,e,i){var u=e+" Iterator";return t.prototype=r(n,{next:o(1,i)}),a(t,u,!1,!0),s[u]=h,t}},function(t,e,i){var n=i(48);t.exports=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},function(t,e,i){var n=i(59);t.exports=function(t){if(!n(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},function(t,e,i){(function(t){var n=void 0!==t&&t||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(r.call(setTimeout,n,arguments),clearTimeout)},e.setInterval=function(){return new o(r.call(setInterval,n,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},i(333),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,i(82))},function(t,e,i){(function(t,e){!function(t,i){"use strict";if(!t.setImmediate){var n,r,o,a,s,h=1,u={},l=!1,c=t.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(t);d=d&&d.setTimeout?d:t,"[object process]"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){f(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,i=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=i,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){f(t.data)},n=function(t){o.port2.postMessage(t)}):c&&"onreadystatechange"in c.createElement("script")?(r=c.documentElement,n=function(t){var e=c.createElement("script");e.onreadystatechange=function(){f(t),e.onreadystatechange=null,r.removeChild(e),e=null},r.appendChild(e)}):n=function(t){setTimeout(f,0,t)}:(a="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&f(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),n=function(e){t.postMessage(a+e,"*")}),d.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),i=0;i<e.length;i++)e[i]=arguments[i+1];var r={callback:t,args:e};return u[h]=r,n(h),h++},d.clearImmediate=p}function p(t){delete u[t]}function f(t){if(l)setTimeout(f,0,t);else{var e=u[t];if(e){l=!0;try{!function(t){var e=t.callback,i=t.args;switch(i.length){case 0:e();break;case 1:e(i[0]);break;case 2:e(i[0],i[1]);break;case 3:e(i[0],i[1],i[2]);break;default:e.apply(void 0,i)}}(e)}finally{p(t),l=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,i(82),i(171))},function(t,e,i){(function(t,n){var r;!function(o){e&&e.nodeType,t&&t.nodeType;var a="object"==typeof n&&n;a.global!==a&&a.window!==a&&a.self;var s,h=2147483647,u=/^xn--/,l=/[^\x20-\x7E]/,c=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,f=String.fromCharCode;function m(t){throw new RangeError(d[t])}function g(t,e){for(var i=t.length,n=[];i--;)n[i]=e(t[i]);return n}function y(t,e){var i=t.split("@"),n="";return i.length>1&&(n=i[0]+"@",t=i[1]),n+g((t=t.replace(c,".")).split("."),e).join(".")}function v(t){for(var e,i,n=[],r=0,o=t.length;r<o;)(e=t.charCodeAt(r++))>=55296&&e<=56319&&r<o?56320==(64512&(i=t.charCodeAt(r++)))?n.push(((1023&e)<<10)+(1023&i)+65536):(n.push(e),r--):n.push(e);return n}function b(t){return g(t,(function(t){var e="";return t>65535&&(e+=f((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=f(t)})).join("")}function _(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function w(t,e,i){var n=0;for(t=i?p(t/700):t>>1,t+=p(t/e);t>455;n+=36)t=p(t/35);return p(n+36*t/(t+38))}function x(t){var e,i,n,r,o,a,s,u,l,c,d,f=[],g=t.length,y=0,v=128,_=72;for((i=t.lastIndexOf("-"))<0&&(i=0),n=0;n<i;++n)t.charCodeAt(n)>=128&&m("not-basic"),f.push(t.charCodeAt(n));for(r=i>0?i+1:0;r<g;){for(o=y,a=1,s=36;r>=g&&m("invalid-input"),((u=(d=t.charCodeAt(r++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||u>p((h-y)/a))&&m("overflow"),y+=u*a,!(u<(l=s<=_?1:s>=_+26?26:s-_));s+=36)a>p(h/(c=36-l))&&m("overflow"),a*=c;_=w(y-o,e=f.length+1,0==o),p(y/e)>h-v&&m("overflow"),v+=p(y/e),y%=e,f.splice(y++,0,v)}return b(f)}function C(t){var e,i,n,r,o,a,s,u,l,c,d,g,y,b,x,C=[];for(g=(t=v(t)).length,e=128,i=0,o=72,a=0;a<g;++a)(d=t[a])<128&&C.push(f(d));for(n=r=C.length,r&&C.push("-");n<g;){for(s=h,a=0;a<g;++a)(d=t[a])>=e&&d<s&&(s=d);for(s-e>p((h-i)/(y=n+1))&&m("overflow"),i+=(s-e)*y,e=s,a=0;a<g;++a)if((d=t[a])<e&&++i>h&&m("overflow"),d==e){for(u=i,l=36;!(u<(c=l<=o?1:l>=o+26?26:l-o));l+=36)x=u-c,b=36-c,C.push(f(_(c+x%b,0))),u=p(x/b);C.push(f(_(u,0))),o=w(i,y,n==r),i=0,++n}++i,++e}return C.join("")}s={version:"1.4.1",ucs2:{decode:v,encode:b},decode:x,encode:C,toASCII:function(t){return y(t,(function(t){return l.test(t)?"xn--"+C(t):t}))},toUnicode:function(t){return y(t,(function(t){return u.test(t)?x(t.slice(4).toLowerCase()):t}))}},void 0===(r=function(){return s}.call(e,i,e,t))||(t.exports=r)}()}).call(this,i(335)(t),i(82))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,i){"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,i){"use strict";e.decode=e.parse=i(338),e.encode=e.stringify=i(339)},function(t,e,i){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,i,o){e=e||"&",i=i||"=";var a={};if("string"!=typeof t||0===t.length)return a;var s=/\+/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,m=t[l].replace(s,"%20"),g=m.indexOf(i);g>=0?(c=m.substr(0,g),d=m.substr(g+1)):(c=m,d=""),p=decodeURIComponent(c),f=decodeURIComponent(d),n(a,p)?r(a[p])?a[p].push(f):a[p]=[a[p],f]:a[p]=f}return a};var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,i){"use strict";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""}};t.exports=function(t,e,i,s){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?o(a(t),(function(a){var s=encodeURIComponent(n(a))+i;return r(t[a])?o(t[a],(function(t){return s+encodeURIComponent(n(t))})).join(e):s+encodeURIComponent(n(t[a]))})).join(e):s?encodeURIComponent(n(s))+i+encodeURIComponent(n(t)):""};var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var i=[],n=0;n<t.length;n++)i.push(e(t[n],n));return i}var a=Object.keys||function(t){var e=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.push(i);return e}},function(t,e,i){"use strict";i(341)},function(t,e,i){"use strict";(function(t,e){var n=i(94),r=i(76),o=i(3),a=i(12),s=i(96),h="";function u(t){h=t}var l,c=function(){function t(t){this.domStorage_=t,this.prefix_="firebase:"}return t.prototype.set=function(t,e){null==e?this.domStorage_.removeItem(this.prefixedName_(t)):this.domStorage_.setItem(this.prefixedName_(t),Object(o.C)(e))},t.prototype.get=function(t){var e=this.domStorage_.getItem(this.prefixedName_(t));return null==e?null:Object(o.w)(e)},t.prototype.remove=function(t){this.domStorage_.removeItem(this.prefixedName_(t))},t.prototype.prefixedName_=function(t){return this.prefix_+t},t.prototype.toString=function(){return this.domStorage_.toString()},t}(),d=function(){function t(){this.cache_={},this.isInMemoryStorage=!0}return t.prototype.set=function(t,e){null==e?delete this.cache_[t]:this.cache_[t]=e},t.prototype.get=function(t){return Object(o.h)(this.cache_,t)?this.cache_[t]:null},t.prototype.remove=function(t){delete this.cache_[t]},t}(),p=function(t){try{if("undefined"!=typeof window&&void 0!==window[t]){var e=window[t];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new c(e)}}catch(t){}return new d},f=p("localStorage"),m=p("sessionStorage"),g=new s.b("@firebase/database"),y=(l=1,function(){return l++}),v=function(t){var e=Object(o.B)(t),i=new o.c;i.update(e);var n=i.digest();return o.f.encodeByteArray(n)},b=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i="",n=0;n<t.length;n++){var r=t[n];Array.isArray(r)||r&&"object"==typeof r&&"number"==typeof r.length?i+=b.apply(null,r):i+="object"==typeof r?Object(o.C)(r):r,i+=" "}return i},_=null,w=!0,x=function(t,e){Object(o.d)(!e||!0===t||!1===t,"Can't turn on custom loggers persistently."),!0===t?(g.logLevel=s.a.VERBOSE,_=g.log.bind(g),e&&m.set("logging_enabled",!0)):"function"==typeof t?_=t:(_=null,m.remove("logging_enabled"))},C=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!0===w&&(w=!1,null===_&&!0===m.get("logging_enabled")&&x(!0)),_){var i=b.apply(null,t);_(i)}},S=function(t){return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];C.apply(void 0,Object(a.f)([t],Object(a.e)(e)))}},T=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i="FIREBASE INTERNAL ERROR: "+b.apply(void 0,Object(a.f)([],Object(a.e)(t)));g.error(i)},A=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i="FIREBASE FATAL ERROR: "+b.apply(void 0,Object(a.f)([],Object(a.e)(t)));throw g.error(i),new Error(i)},E=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i="FIREBASE WARNING: "+b.apply(void 0,Object(a.f)([],Object(a.e)(t)));g.warn(i)},P=function(t){return"number"==typeof t&&(t!=t||t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY)},M="[MIN_NAME]",I="[MAX_NAME]",k=function(t,e){if(t===e)return 0;if(t===M||e===I)return-1;if(e===M||t===I)return 1;var i=z(t),n=z(e);return null!==i?null!==n?i-n==0?t.length-e.length:i-n:-1:null!==n?1:t<e?-1:1},O=function(t,e){return t===e?0:t<e?-1:1},R=function(t,e){if(e&&t in e)return e[t];throw new Error("Missing required key ("+t+") in object: "+Object(o.C)(e))},D=function(t){if("object"!=typeof t||null===t)return Object(o.C)(t);var e=[];for(var i in t)e.push(i);e.sort();for(var n="{",r=0;r<e.length;r++)0!==r&&(n+=","),n+=Object(o.C)(e[r]),n+=":",n+=D(t[e[r]]);return n+="}"},L=function(t,e){var i=t.length;if(i<=e)return[t];for(var n=[],r=0;r<i;r+=e)r+e>i?n.push(t.substring(r,i)):n.push(t.substring(r,r+e));return n};function N(t,e){for(var i in t)t.hasOwnProperty(i)&&e(i,t[i])}var B=function(t){Object(o.d)(!P(t),"Invalid JSON number");var e,i,n,r,a;0===t?(i=0,n=0,e=1/t==-1/0?1:0):(e=t<0,(t=Math.abs(t))>=Math.pow(2,-1022)?(i=(r=Math.min(Math.floor(Math.log(t)/Math.LN2),1023))+1023,n=Math.round(t*Math.pow(2,52-r)-Math.pow(2,52))):(i=0,n=Math.round(t/Math.pow(2,-1074))));var s=[];for(a=52;a;a-=1)s.push(n%2?1:0),n=Math.floor(n/2);for(a=11;a;a-=1)s.push(i%2?1:0),i=Math.floor(i/2);s.push(e?1:0),s.reverse();var h=s.join(""),u="";for(a=0;a<64;a+=8){var l=parseInt(h.substr(a,8),2).toString(16);1===l.length&&(l="0"+l),u+=l}return u.toLowerCase()};var F=new RegExp("^-?(0*)\\d{1,10}$"),z=function(t){if(F.test(t)){var e=Number(t);if(e>=-2147483648&&e<=2147483647)return e}return null},j=function(t){try{t()}catch(t){setTimeout((function(){var e=t.stack||"";throw E("Exception was thrown by user callback.",e),t}),Math.floor(0))}},G=function(t,e){var i=setTimeout(t,e);return"object"==typeof i&&i.unref&&i.unref(),i},U=function(){function t(t,e){var i=this;this.appName_=t,this.appCheckProvider=e,this.appCheck=null==e?void 0:e.getImmediate({optional:!0}),this.appCheck||null==e||e.get().then((function(t){return i.appCheck=t}))}return t.prototype.getToken=function(t){var e=this;return this.appCheck?this.appCheck.getToken(t):new Promise((function(i,n){setTimeout((function(){e.appCheck?e.getToken(t).then(i,n):i(null)}),0)}))},t.prototype.addTokenChangeListener=function(t){var e;null===(e=this.appCheckProvider)||void 0===e||e.get().then((function(e){return e.addTokenListener(t)}))},t.prototype.notifyForInvalidToken=function(){E('Provided AppCheck credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly.')},t}(),H=function(){function t(t,e,i){var n=this;this.appName_=t,this.firebaseOptions_=e,this.authProvider_=i,this.auth_=null,this.auth_=i.getImmediate({optional:!0}),this.auth_||i.onInit((function(t){return n.auth_=t}))}return t.prototype.getToken=function(t){var e=this;return this.auth_?this.auth_.getToken(t).catch((function(t){return t&&"auth/token-not-initialized"===t.code?(C("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(t)})):new Promise((function(i,n){setTimeout((function(){e.auth_?e.getToken(t).then(i,n):i(null)}),0)}))},t.prototype.addTokenChangeListener=function(t){this.auth_?this.auth_.addAuthTokenListener(t):this.authProvider_.get().then((function(e){return e.addAuthTokenListener(t)}))},t.prototype.removeTokenChangeListener=function(t){this.authProvider_.get().then((function(e){return e.removeAuthTokenListener(t)}))},t.prototype.notifyForInvalidToken=function(){var t='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?t+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?t+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':t+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',E(t)},t}(),V=function(){function t(t){this.accessToken=t}return t.prototype.getToken=function(t){return Promise.resolve({accessToken:this.accessToken})},t.prototype.addTokenChangeListener=function(t){t(this.accessToken)},t.prototype.removeTokenChangeListener=function(t){},t.prototype.notifyForInvalidToken=function(){},t.OWNER="owner",t}(),W=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,X=function(){function t(t,e,i,n,r,o,a){void 0===r&&(r=!1),void 0===o&&(o=""),void 0===a&&(a=!1),this.secure=e,this.namespace=i,this.webSocketOnly=n,this.nodeAdmin=r,this.persistenceKey=o,this.includeNamespaceInQueryParams=a,this._host=t.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=f.get("host:"+t)||this._host}return t.prototype.isCacheableHost=function(){return"s-"===this.internalHost.substr(0,2)},t.prototype.isCustomHost=function(){return"firebaseio.com"!==this._domain&&"firebaseio-demo.com"!==this._domain},Object.defineProperty(t.prototype,"host",{get:function(){return this._host},set:function(t){t!==this.internalHost&&(this.internalHost=t,this.isCacheableHost()&&f.set("host:"+this._host,this.internalHost))},enumerable:!1,configurable:!0}),t.prototype.toString=function(){var t=this.toURLString();return this.persistenceKey&&(t+="<"+this.persistenceKey+">"),t},t.prototype.toURLString=function(){var t=this.secure?"https://":"http://",e=this.includeNamespaceInQueryParams?"?ns="+this.namespace:"";return""+t+this.host+"/"+e},t}();function Y(t,e,i){var n;if(Object(o.d)("string"==typeof e,"typeof type must == string"),Object(o.d)("object"==typeof i,"typeof params must == object"),"websocket"===e)n=(t.secure?"wss://":"ws://")+t.internalHost+"/.ws?";else{if("long_polling"!==e)throw new Error("Unknown connection type: "+e);n=(t.secure?"https://":"http://")+t.internalHost+"/.lp?"}(function(t){return t.host!==t.internalHost||t.isCustomHost()||t.includeNamespaceInQueryParams})(t)&&(i.ns=t.namespace);var r=[];return N(i,(function(t,e){r.push(t+"="+e)})),n+r.join("&")}var q=function(){function t(){this.counters_={}}return t.prototype.incrementCounter=function(t,e){void 0===e&&(e=1),Object(o.h)(this.counters_,t)||(this.counters_[t]=0),this.counters_[t]+=e},t.prototype.get=function(){return Object(o.k)(this.counters_)},t}(),K={},J={};function Z(t){var e=t.toString();return K[e]||(K[e]=new q),K[e]}var Q=function(){function t(t){this.onMessage_=t,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}return t.prototype.closeAfter=function(t,e){this.closeAfterResponse=t,this.onClose=e,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)},t.prototype.handleResponse=function(t,e){var i=this;this.pendingResponses[t]=e;for(var n=function(){var t=r.pendingResponses[r.currentResponseNum];delete r.pendingResponses[r.currentResponseNum];for(var e=function(e){t[e]&&j((function(){i.onMessage_(t[e])}))},n=0;n<t.length;++n)e(n);if(r.currentResponseNum===r.closeAfterResponse)return r.onClose&&(r.onClose(),r.onClose=null),"break";r.currentResponseNum++},r=this;this.pendingResponses[this.currentResponseNum];){if("break"===n())break}},t}(),$=function(){function t(t,e,i,n,r,o,a){var s=this;this.connId=t,this.repoInfo=e,this.applicationId=i,this.appCheckToken=n,this.authToken=r,this.transportSessionId=o,this.lastSessionId=a,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=S(t),this.stats_=Z(e),this.urlFn=function(t){return s.appCheckToken&&(t.ac=s.appCheckToken),Y(e,"long_polling",t)}}return t.prototype.open=function(t,e){var i=this;this.curSegmentNum=0,this.onDisconnect_=e,this.myPacketOrderer=new Q(t),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout((function(){i.log_("Timed out trying to connect."),i.onClosed_(),i.connectTimeoutTimer_=null}),Math.floor(3e4)),function(t){if(Object(o.t)()||"complete"===document.readyState)t();else{var e=!1,i=function(){document.body?e||(e=!0,t()):setTimeout(i,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",i,!1),window.addEventListener("load",i,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",(function(){"complete"===document.readyState&&i()})),window.attachEvent("onload",i))}}((function(){if(!i.isClosed_){i.scriptTagHolder=new tt((function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Object(a.e)(t,5),r=n[0],o=n[1],s=n[2];if(n[3],n[4],i.incrementIncomingBytes_(t),i.scriptTagHolder)if(i.connectTimeoutTimer_&&(clearTimeout(i.connectTimeoutTimer_),i.connectTimeoutTimer_=null),i.everConnected_=!0,"start"===r)i.id=o,i.password=s;else{if("close"!==r)throw new Error("Unrecognized command received: "+r);o?(i.scriptTagHolder.sendNewPolls=!1,i.myPacketOrderer.closeAfter(o,(function(){i.onClosed_()}))):i.onClosed_()}}),(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Object(a.e)(t,2),r=n[0],o=n[1];i.incrementIncomingBytes_(t),i.myPacketOrderer.handleResponse(r,o)}),(function(){i.onClosed_()}),i.urlFn);var t={start:"t"};t.ser=Math.floor(1e8*Math.random()),i.scriptTagHolder.uniqueCallbackIdentifier&&(t.cb=i.scriptTagHolder.uniqueCallbackIdentifier),t.v="5",i.transportSessionId&&(t.s=i.transportSessionId),i.lastSessionId&&(t.ls=i.lastSessionId),i.applicationId&&(t.p=i.applicationId),i.appCheckToken&&(t.ac=i.appCheckToken),"undefined"!=typeof location&&location.hostname&&W.test(location.hostname)&&(t.r="f");var e=i.urlFn(t);i.log_("Connecting via long-poll to "+e),i.scriptTagHolder.addTag(e,(function(){}))}}))},t.prototype.start=function(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)},t.forceAllow=function(){t.forceAllow_=!0},t.forceDisallow=function(){t.forceDisallow_=!0},t.isAvailable=function(){return!Object(o.t)()&&(!!t.forceAllow_||!(t.forceDisallow_||"undefined"==typeof document||null==document.createElement||"object"==typeof window&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href)||"object"==typeof Windows&&"object"==typeof Windows.UI))},t.prototype.markConnectionHealthy=function(){},t.prototype.shutdown_=function(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)},t.prototype.onClosed_=function(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))},t.prototype.close=function(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())},t.prototype.send=function(t){var e=Object(o.C)(t);this.bytesSent+=e.length,this.stats_.incrementCounter("bytes_sent",e.length);for(var i=Object(o.g)(e),n=L(i,1840),r=0;r<n.length;r++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,n.length,n[r]),this.curSegmentNum++},t.prototype.addDisconnectPingFrame=function(t,e){if(!Object(o.t)()){this.myDisconnFrame=document.createElement("iframe");var i={dframe:"t"};i.id=t,i.pw=e,this.myDisconnFrame.src=this.urlFn(i),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}},t.prototype.incrementIncomingBytes_=function(t){var e=Object(o.C)(t).length;this.bytesReceived+=e,this.stats_.incrementCounter("bytes_received",e)},t}(),tt=function(){function t(e,i,n,r){if(this.onDisconnect=n,this.urlFn=r,this.outstandingRequests=new Set,this.pendingSegs=[],this.currentSerial=Math.floor(1e8*Math.random()),this.sendNewPolls=!0,Object(o.t)())this.commandCB=e,this.onMessageCB=i;else{this.uniqueCallbackIdentifier=y(),window["pLPCommand"+this.uniqueCallbackIdentifier]=e,window["pRTLPCB"+this.uniqueCallbackIdentifier]=i,this.myIFrame=t.createIFrame_();var a="";if(this.myIFrame.src&&"javascript:"===this.myIFrame.src.substr(0,"javascript:".length))a='<script>document.domain="'+document.domain+'";<\/script>';var s="<html><body>"+a+"</body></html>";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(s),this.myIFrame.doc.close()}catch(t){C("frame writing exception"),t.stack&&C(t.stack),C(t)}}}return t.createIFrame_=function(){var t=document.createElement("iframe");if(t.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(t);try{t.contentWindow.document||C("No IE domain setting required")}catch(i){var e=document.domain;t.src="javascript:void((function(){document.open();document.domain='"+e+"';document.close();})())"}return t.contentDocument?t.doc=t.contentDocument:t.contentWindow?t.doc=t.contentWindow.document:t.document&&(t.doc=t.document),t},t.prototype.close=function(){var t=this;this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.innerHTML="",setTimeout((function(){null!==t.myIFrame&&(document.body.removeChild(t.myIFrame),t.myIFrame=null)}),Math.floor(0)));var e=this.onDisconnect;e&&(this.onDisconnect=null,e())},t.prototype.startLongPoll=function(t,e){for(this.myID=t,this.myPW=e,this.alive=!0;this.newRequest_(););},t.prototype.newRequest_=function(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;var t={};t.id=this.myID,t.pw=this.myPW,t.ser=this.currentSerial;for(var e=this.urlFn(t),i="",n=0;this.pendingSegs.length>0;){if(!(this.pendingSegs[0].d.length+30+i.length<=1870))break;var r=this.pendingSegs.shift();i=i+"&seg"+n+"="+r.seg+"&ts"+n+"="+r.ts+"&d"+n+"="+r.d,n++}return e+=i,this.addLongPollTag_(e,this.currentSerial),!0}return!1},t.prototype.enqueueSegment=function(t,e,i){this.pendingSegs.push({seg:t,ts:e,d:i}),this.alive&&this.newRequest_()},t.prototype.addLongPollTag_=function(t,e){var i=this;this.outstandingRequests.add(e);var n=function(){i.outstandingRequests.delete(e),i.newRequest_()},r=setTimeout(n,Math.floor(25e3));this.addTag(t,(function(){clearTimeout(r),n()}))},t.prototype.addTag=function(t,e){var i=this;Object(o.t)()?this.doNodeLongPoll(t,e):setTimeout((function(){try{if(!i.sendNewPolls)return;var n=i.myIFrame.doc.createElement("script");n.type="text/javascript",n.async=!0,n.src=t,n.onload=n.onreadystatechange=function(){var t=n.readyState;t&&"loaded"!==t&&"complete"!==t||(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),e())},n.onerror=function(){C("Long-poll script failed to load: "+t),i.sendNewPolls=!1,i.close()},i.myIFrame.doc.body.appendChild(n)}catch(t){}}),Math.floor(1))},t}(),et=null;"undefined"!=typeof MozWebSocket?et=MozWebSocket:"undefined"!=typeof WebSocket&&(et=WebSocket);var it=function(){function e(t,i,n,r,o,a,s){this.connId=t,this.applicationId=n,this.appCheckToken=r,this.authToken=o,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=S(this.connId),this.stats_=Z(i),this.connURL=e.connectionURL_(i,a,s,r),this.nodeAdmin=i.nodeAdmin}return e.connectionURL_=function(t,e,i,n){var r={v:"5"};return!Object(o.t)()&&"undefined"!=typeof location&&location.hostname&&W.test(location.hostname)&&(r.r="f"),e&&(r.s=e),i&&(r.ls=i),n&&(r.ac=n),Y(t,"websocket",r)},e.prototype.open=function(e,i){var n=this;this.onDisconnect=i,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,f.set("previous_websocket_failure",!0);try{if(Object(o.t)()){var r=this.nodeAdmin?"AdminNode":"Node",a={headers:{"User-Agent":"Firebase/5/"+h+"/"+t.platform+"/"+r,"X-Firebase-GMPID":this.applicationId||""}};this.authToken&&(a.headers.Authorization="Bearer "+this.authToken),this.appCheckToken&&(a.headers["X-Firebase-AppCheck"]=this.appCheckToken);var s=t.env,u=0===this.connURL.indexOf("wss://")?s.HTTPS_PROXY||s.https_proxy:s.HTTP_PROXY||s.http_proxy;u&&(a.proxy={origin:u}),this.mySock=new et(this.connURL,[],a)}else{a={headers:{"X-Firebase-GMPID":this.applicationId||"","X-Firebase-AppCheck":this.appCheckToken||""}};this.mySock=new et(this.connURL,[],a)}}catch(t){this.log_("Error instantiating WebSocket.");var l=t.message||t.data;return l&&this.log_(l),void this.onClosed_()}this.mySock.onopen=function(){n.log_("Websocket connected."),n.everConnected_=!0},this.mySock.onclose=function(){n.log_("Websocket connection was disconnected."),n.mySock=null,n.onClosed_()},this.mySock.onmessage=function(t){n.handleIncomingFrame(t)},this.mySock.onerror=function(t){n.log_("WebSocket error. Closing connection.");var e=t.message||t.data;e&&n.log_(e),n.onClosed_()}},e.prototype.start=function(){},e.forceDisallow=function(){e.forceDisallow_=!0},e.isAvailable=function(){var t=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var i=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);i&&i.length>1&&parseFloat(i[1])<4.4&&(t=!0)}return!t&&null!==et&&!e.forceDisallow_},e.previouslyFailed=function(){return f.isInMemoryStorage||!0===f.get("previous_websocket_failure")},e.prototype.markConnectionHealthy=function(){f.remove("previous_websocket_failure")},e.prototype.appendFrame_=function(t){if(this.frames.push(t),this.frames.length===this.totalFrames){var e=this.frames.join("");this.frames=null;var i=Object(o.w)(e);this.onMessage(i)}},e.prototype.handleNewFrameCount_=function(t){this.totalFrames=t,this.frames=[]},e.prototype.extractFrameCount_=function(t){if(Object(o.d)(null===this.frames,"We already have a frame buffer"),t.length<=6){var e=Number(t);if(!isNaN(e))return this.handleNewFrameCount_(e),null}return this.handleNewFrameCount_(1),t},e.prototype.handleIncomingFrame=function(t){if(null!==this.mySock){var e=t.data;if(this.bytesReceived+=e.length,this.stats_.incrementCounter("bytes_received",e.length),this.resetKeepAlive(),null!==this.frames)this.appendFrame_(e);else{var i=this.extractFrameCount_(e);null!==i&&this.appendFrame_(i)}}},e.prototype.send=function(t){this.resetKeepAlive();var e=Object(o.C)(t);this.bytesSent+=e.length,this.stats_.incrementCounter("bytes_sent",e.length);var i=L(e,16384);i.length>1&&this.sendString_(String(i.length));for(var n=0;n<i.length;n++)this.sendString_(i[n])},e.prototype.shutdown_=function(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)},e.prototype.onClosed_=function(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))},e.prototype.close=function(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())},e.prototype.resetKeepAlive=function(){var t=this;clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval((function(){t.mySock&&t.sendString_("0"),t.resetKeepAlive()}),Math.floor(45e3))},e.prototype.sendString_=function(t){try{this.mySock.send(t)}catch(t){this.log_("Exception thrown from WebSocket.send():",t.message||t.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}},e.responsesRequiredToBeHealthy=2,e.healthyTimeout=3e4,e}(),nt=function(){function t(t){this.initTransports_(t)}return Object.defineProperty(t,"ALL_TRANSPORTS",{get:function(){return[$,it]},enumerable:!1,configurable:!0}),t.prototype.initTransports_=function(e){var i,n,r=it&&it.isAvailable(),o=r&&!it.previouslyFailed();if(e.webSocketOnly&&(r||E("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),o=!0),o)this.transports_=[it];else{var s=this.transports_=[];try{for(var h=Object(a.g)(t.ALL_TRANSPORTS),u=h.next();!u.done;u=h.next()){var l=u.value;l&&l.isAvailable()&&s.push(l)}}catch(t){i={error:t}}finally{try{u&&!u.done&&(n=h.return)&&n.call(h)}finally{if(i)throw i.error}}}},t.prototype.initialTransport=function(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")},t.prototype.upgradeTransport=function(){return this.transports_.length>1?this.transports_[1]:null},t}(),rt=function(){function t(t,e,i,n,r,o,a,s,h,u){this.id=t,this.repoInfo_=e,this.applicationId_=i,this.appCheckToken_=n,this.authToken_=r,this.onMessage_=o,this.onReady_=a,this.onDisconnect_=s,this.onKill_=h,this.lastSessionId=u,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=S("c:"+this.id+":"),this.transportManager_=new nt(e),this.log_("Connection created"),this.start_()}return t.prototype.start_=function(){var t=this,e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;var i=this.connReceiver_(this.conn_),n=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout((function(){t.conn_&&t.conn_.open(i,n)}),Math.floor(0));var r=e.healthyTimeout||0;r>0&&(this.healthyTimeout_=G((function(){t.healthyTimeout_=null,t.isHealthy_||(t.conn_&&t.conn_.bytesReceived>102400?(t.log_("Connection exceeded healthy timeout but has received "+t.conn_.bytesReceived+" bytes. Marking connection healthy."),t.isHealthy_=!0,t.conn_.markConnectionHealthy()):t.conn_&&t.conn_.bytesSent>10240?t.log_("Connection exceeded healthy timeout but has sent "+t.conn_.bytesSent+" bytes. Leaving connection alive."):(t.log_("Closing unhealthy connection after timeout."),t.close()))}),Math.floor(r)))},t.prototype.nextTransportId_=function(){return"c:"+this.id+":"+this.connectionCount++},t.prototype.disconnReceiver_=function(t){var e=this;return function(i){t===e.conn_?e.onConnectionLost_(i):t===e.secondaryConn_?(e.log_("Secondary connection lost."),e.onSecondaryConnectionLost_()):e.log_("closing an old connection")}},t.prototype.connReceiver_=function(t){var e=this;return function(i){2!==e.state_&&(t===e.rx_?e.onPrimaryMessageReceived_(i):t===e.secondaryConn_?e.onSecondaryMessageReceived_(i):e.log_("message on old connection"))}},t.prototype.sendRequest=function(t){var e={t:"d",d:t};this.sendData_(e)},t.prototype.tryCleanupConnection=function(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)},t.prototype.onSecondaryControl_=function(t){if("t"in t){var e=t.t;"a"===e?this.upgradeIfSecondaryHealthy_():"r"===e?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):"o"===e&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}},t.prototype.onSecondaryMessageReceived_=function(t){var e=R("t",t),i=R("d",t);if("c"===e)this.onSecondaryControl_(i);else{if("d"!==e)throw new Error("Unknown protocol layer: "+e);this.pendingDataMessages.push(i)}},t.prototype.upgradeIfSecondaryHealthy_=function(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:"p",d:{}}}))},t.prototype.proceedWithUpgrade_=function(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:"a",d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:"n",d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()},t.prototype.onPrimaryMessageReceived_=function(t){var e=R("t",t),i=R("d",t);"c"===e?this.onControl_(i):"d"===e&&this.onDataMessage_(i)},t.prototype.onDataMessage_=function(t){this.onPrimaryResponse_(),this.onMessage_(t)},t.prototype.onPrimaryResponse_=function(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))},t.prototype.onControl_=function(t){var e=R("t",t);if("d"in t){var i=t.d;if("h"===e)this.onHandshake_(i);else if("n"===e){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(var n=0;n<this.pendingDataMessages.length;++n)this.onDataMessage_(this.pendingDataMessages[n]);this.pendingDataMessages=[],this.tryCleanupConnection()}else"s"===e?this.onConnectionShutdown_(i):"r"===e?this.onReset_(i):"e"===e?T("Server Error: "+i):"o"===e?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):T("Unknown control packet command: "+e)}},t.prototype.onHandshake_=function(t){var e=t.ts,i=t.v,n=t.h;this.sessionId=t.s,this.repoInfo_.host=n,0===this.state_&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,e),"5"!==i&&E("Protocol version mismatch detected"),this.tryStartUpgrade_())},t.prototype.tryStartUpgrade_=function(){var t=this.transportManager_.upgradeTransport();t&&this.startUpgrade_(t)},t.prototype.startUpgrade_=function(t){var e=this;this.secondaryConn_=new t(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,this.sessionId),this.secondaryResponsesRequired_=t.responsesRequiredToBeHealthy||0;var i=this.connReceiver_(this.secondaryConn_),n=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(i,n),G((function(){e.secondaryConn_&&(e.log_("Timed out trying to upgrade."),e.secondaryConn_.close())}),Math.floor(6e4))},t.prototype.onReset_=function(t){this.log_("Reset packet received. New host: "+t),this.repoInfo_.host=t,1===this.state_?this.close():(this.closeConnections_(),this.start_())},t.prototype.onConnectionEstablished_=function(t,e){var i=this;this.log_("Realtime connection established."),this.conn_=t,this.state_=1,this.onReady_&&(this.onReady_(e,this.sessionId),this.onReady_=null),0===this.primaryResponsesRequired_?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):G((function(){i.sendPingOnPrimaryIfNecessary_()}),Math.floor(5e3))},t.prototype.sendPingOnPrimaryIfNecessary_=function(){this.isHealthy_||1!==this.state_||(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:"p",d:{}}}))},t.prototype.onSecondaryConnectionLost_=function(){var t=this.secondaryConn_;this.secondaryConn_=null,this.tx_!==t&&this.rx_!==t||this.close()},t.prototype.onConnectionLost_=function(t){this.conn_=null,t||0!==this.state_?1===this.state_&&this.log_("Realtime connection lost."):(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(f.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)),this.close()},t.prototype.onConnectionShutdown_=function(t){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(t),this.onKill_=null),this.onDisconnect_=null,this.close()},t.prototype.sendData_=function(t){if(1!==this.state_)throw"Connection is not connected";this.tx_.send(t)},t.prototype.close=function(){2!==this.state_&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))},t.prototype.closeConnections_=function(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)},t}(),ot=function(){function t(){}return t.prototype.put=function(t,e,i,n){},t.prototype.merge=function(t,e,i,n){},t.prototype.refreshAuthToken=function(t){},t.prototype.refreshAppCheckToken=function(t){},t.prototype.onDisconnectPut=function(t,e,i){},t.prototype.onDisconnectMerge=function(t,e,i){},t.prototype.onDisconnectCancel=function(t,e){},t.prototype.reportStats=function(t){},t}(),at=function(){function t(t){this.allowedEvents_=t,this.listeners_={},Object(o.d)(Array.isArray(t)&&t.length>0,"Requires a non-empty array")}return t.prototype.trigger=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(Array.isArray(this.listeners_[t]))for(var n=Object(a.f)([],Object(a.e)(this.listeners_[t])),r=0;r<n.length;r++)n[r].callback.apply(n[r].context,e)},t.prototype.on=function(t,e,i){this.validateEventType_(t),this.listeners_[t]=this.listeners_[t]||[],this.listeners_[t].push({callback:e,context:i});var n=this.getInitialEvent(t);n&&e.apply(i,n)},t.prototype.off=function(t,e,i){this.validateEventType_(t);for(var n=this.listeners_[t]||[],r=0;r<n.length;r++)if(n[r].callback===e&&(!i||i===n[r].context))return void n.splice(r,1)},t.prototype.validateEventType_=function(t){Object(o.d)(this.allowedEvents_.find((function(e){return e===t})),"Unknown event: "+t)},t}(),st=function(t){function e(){var e=t.call(this,["online"])||this;return e.online_=!0,"undefined"==typeof window||void 0===window.addEventListener||Object(o.r)()||(window.addEventListener("online",(function(){e.online_||(e.online_=!0,e.trigger("online",!0))}),!1),window.addEventListener("offline",(function(){e.online_&&(e.online_=!1,e.trigger("online",!1))}),!1)),e}return Object(a.c)(e,t),e.getInstance=function(){return new e},e.prototype.getInitialEvent=function(t){return Object(o.d)("online"===t,"Unknown event type: "+t),[this.online_]},e.prototype.currentlyOnline=function(){return this.online_},e}(at),ht=function(){function t(t,e){if(void 0===e){this.pieces_=t.split("/");for(var i=0,n=0;n<this.pieces_.length;n++)this.pieces_[n].length>0&&(this.pieces_[i]=this.pieces_[n],i++);this.pieces_.length=i,this.pieceNum_=0}else this.pieces_=t,this.pieceNum_=e}return t.prototype.toString=function(){for(var t="",e=this.pieceNum_;e<this.pieces_.length;e++)""!==this.pieces_[e]&&(t+="/"+this.pieces_[e]);return t||"/"},t}();function ut(){return new ht("")}function lt(t){return t.pieceNum_>=t.pieces_.length?null:t.pieces_[t.pieceNum_]}function ct(t){return t.pieces_.length-t.pieceNum_}function dt(t){var e=t.pieceNum_;return e<t.pieces_.length&&e++,new ht(t.pieces_,e)}function pt(t){return t.pieceNum_<t.pieces_.length?t.pieces_[t.pieces_.length-1]:null}function ft(t,e){return void 0===e&&(e=0),t.pieces_.slice(t.pieceNum_+e)}function mt(t){if(t.pieceNum_>=t.pieces_.length)return null;for(var e=[],i=t.pieceNum_;i<t.pieces_.length-1;i++)e.push(t.pieces_[i]);return new ht(e,0)}function gt(t,e){for(var i=[],n=t.pieceNum_;n<t.pieces_.length;n++)i.push(t.pieces_[n]);if(e instanceof ht)for(n=e.pieceNum_;n<e.pieces_.length;n++)i.push(e.pieces_[n]);else{var r=e.split("/");for(n=0;n<r.length;n++)r[n].length>0&&i.push(r[n])}return new ht(i,0)}function yt(t){return t.pieceNum_>=t.pieces_.length}function vt(t,e){var i=lt(t),n=lt(e);if(null===i)return e;if(i===n)return vt(dt(t),dt(e));throw new Error("INTERNAL ERROR: innerPath ("+e+") is not within outerPath ("+t+")")}function bt(t,e){for(var i=ft(t,0),n=ft(e,0),r=0;r<i.length&&r<n.length;r++){var o=k(i[r],n[r]);if(0!==o)return o}return i.length===n.length?0:i.length<n.length?-1:1}function _t(t,e){if(ct(t)!==ct(e))return!1;for(var i=t.pieceNum_,n=e.pieceNum_;i<=t.pieces_.length;i++,n++)if(t.pieces_[i]!==e.pieces_[n])return!1;return!0}function wt(t,e){var i=t.pieceNum_,n=e.pieceNum_;if(ct(t)>ct(e))return!1;for(;i<t.pieces_.length;){if(t.pieces_[i]!==e.pieces_[n])return!1;++i,++n}return!0}var xt=function(t,e){this.errorPrefix_=e,this.parts_=ft(t,0),this.byteLength_=Math.max(1,this.parts_.length);for(var i=0;i<this.parts_.length;i++)this.byteLength_+=Object(o.A)(this.parts_[i]);Ct(this)};function Ct(t){if(t.byteLength_>768)throw new Error(t.errorPrefix_+"has a key path longer than 768 bytes ("+t.byteLength_+").");if(t.parts_.length>32)throw new Error(t.errorPrefix_+"path specified exceeds the maximum depth that can be written (32) or object contains a cycle "+St(t))}function St(t){return 0===t.parts_.length?"":"in property '"+t.parts_.join(".")+"'"}var Tt,At,Et=function(t){function e(){var e,i,n=t.call(this,["visible"])||this;return"undefined"!=typeof document&&void 0!==document.addEventListener&&(void 0!==document.hidden?(i="visibilitychange",e="hidden"):void 0!==document.mozHidden?(i="mozvisibilitychange",e="mozHidden"):void 0!==document.msHidden?(i="msvisibilitychange",e="msHidden"):void 0!==document.webkitHidden&&(i="webkitvisibilitychange",e="webkitHidden")),n.visible_=!0,i&&document.addEventListener(i,(function(){var t=!document[e];t!==n.visible_&&(n.visible_=t,n.trigger("visible",t))}),!1),n}return Object(a.c)(e,t),e.getInstance=function(){return new e},e.prototype.getInitialEvent=function(t){return Object(o.d)("visible"===t,"Unknown event type: "+t),[this.visible_]},e}(at),Pt=function(t){function e(i,n,r,a,s,h,u,l){var c=t.call(this)||this;if(c.repoInfo_=i,c.applicationId_=n,c.onDataUpdate_=r,c.onConnectStatus_=a,c.onServerInfoUpdate_=s,c.authTokenProvider_=h,c.appCheckTokenProvider_=u,c.authOverride_=l,c.id=e.nextPersistentConnectionId_++,c.log_=S("p:"+c.id+":"),c.interruptReasons_={},c.listens=new Map,c.outstandingPuts_=[],c.outstandingGets_=[],c.outstandingPutCount_=0,c.outstandingGetCount_=0,c.onDisconnectRequestQueue_=[],c.connected_=!1,c.reconnectDelay_=1e3,c.maxReconnectDelay_=3e5,c.securityDebugCallback_=null,c.lastSessionId=null,c.establishConnectionTimer_=null,c.visible_=!1,c.requestCBHash_={},c.requestNumber_=0,c.realtime_=null,c.authToken_=null,c.appCheckToken_=null,c.forceTokenRefresh_=!1,c.invalidAuthTokenCount_=0,c.invalidAppCheckTokenCount_=0,c.firstConnection_=!0,c.lastConnectionAttemptTime_=null,c.lastConnectionEstablishedTime_=null,l&&!Object(o.t)())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");return Et.getInstance().on("visible",c.onVisible_,c),-1===i.host.indexOf("fblocal")&&st.getInstance().on("online",c.onOnline_,c),c}return Object(a.c)(e,t),e.prototype.sendRequest=function(t,e,i){var n=++this.requestNumber_,r={r:n,a:t,b:e};this.log_(Object(o.C)(r)),Object(o.d)(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(r),i&&(this.requestCBHash_[n]=i)},e.prototype.get=function(t){var e=this;this.initConnection_();var i=new o.a,n={p:t._path.toString(),q:t._queryObject},r={action:"g",request:n,onComplete:function(t){var r=t.d;"ok"===t.s?(e.onDataUpdate_(n.p,r,!1,null),i.resolve(r)):i.reject(r)}};this.outstandingGets_.push(r),this.outstandingGetCount_++;var a=this.outstandingGets_.length-1;return this.connected_||setTimeout((function(){var t=e.outstandingGets_[a];void 0!==t&&r===t&&(delete e.outstandingGets_[a],e.outstandingGetCount_--,0===e.outstandingGetCount_&&(e.outstandingGets_=[]),e.log_("get "+a+" timed out on connection"),i.reject(new Error("Client is offline.")))}),3e3),this.connected_&&this.sendGet_(a),i.promise},e.prototype.listen=function(t,e,i,n){this.initConnection_();var r=t._queryIdentifier,a=t._path.toString();this.log_("Listen called for "+a+" "+r),this.listens.has(a)||this.listens.set(a,new Map),Object(o.d)(t._queryParams.isDefault()||!t._queryParams.loadsAllData(),"listen() called for non-default but complete query"),Object(o.d)(!this.listens.get(a).has(r),"listen() called twice for same path/queryId.");var s={onComplete:n,hashFn:e,query:t,tag:i};this.listens.get(a).set(r,s),this.connected_&&this.sendListen_(s)},e.prototype.sendGet_=function(t){var e=this,i=this.outstandingGets_[t];this.sendRequest("g",i.request,(function(n){delete e.outstandingGets_[t],e.outstandingGetCount_--,0===e.outstandingGetCount_&&(e.outstandingGets_=[]),i.onComplete&&i.onComplete(n)}))},e.prototype.sendListen_=function(t){var i=this,n=t.query,r=n._path.toString(),o=n._queryIdentifier;this.log_("Listen on "+r+" for "+o);var a={p:r};t.tag&&(a.q=n._queryObject,a.t=t.tag),a.h=t.hashFn(),this.sendRequest("q",a,(function(a){var s=a.d,h=a.s;e.warnOnListenWarnings_(s,n),(i.listens.get(r)&&i.listens.get(r).get(o))===t&&(i.log_("listen response",a),"ok"!==h&&i.removeListen_(r,o),t.onComplete&&t.onComplete(h,s))}))},e.warnOnListenWarnings_=function(t,e){if(t&&"object"==typeof t&&Object(o.h)(t,"w")){var i=Object(o.z)(t,"w");if(Array.isArray(i)&&~i.indexOf("no_index")){var n='".indexOn": "'+e._queryParams.getIndex().toString()+'"',r=e._path.toString();E("Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding "+n+" at "+r+" to your security rules for better performance.")}}},e.prototype.refreshAuthToken=function(t){this.authToken_=t,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},(function(){})),this.reduceReconnectDelayIfAdminCredential_(t)},e.prototype.reduceReconnectDelayIfAdminCredential_=function(t){(t&&40===t.length||Object(o.o)(t))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=3e4)},e.prototype.refreshAppCheckToken=function(t){this.appCheckToken_=t,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},(function(){}))},e.prototype.tryAuth=function(){var t=this;if(this.connected_&&this.authToken_){var e=this.authToken_,i=Object(o.v)(e)?"auth":"gauth",n={cred:e};null===this.authOverride_?n.noauth=!0:"object"==typeof this.authOverride_&&(n.authvar=this.authOverride_),this.sendRequest(i,n,(function(i){var n=i.s,r=i.d||"error";t.authToken_===e&&("ok"===n?t.invalidAuthTokenCount_=0:t.onAuthRevoked_(n,r))}))}},e.prototype.tryAppCheck=function(){var t=this;this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},(function(e){var i=e.s,n=e.d||"error";"ok"===i?t.invalidAppCheckTokenCount_=0:t.onAppCheckRevoked_(i,n)}))},e.prototype.unlisten=function(t,e){var i=t._path.toString(),n=t._queryIdentifier;this.log_("Unlisten called for "+i+" "+n),Object(o.d)(t._queryParams.isDefault()||!t._queryParams.loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(i,n)&&this.connected_&&this.sendUnlisten_(i,n,t._queryObject,e)},e.prototype.sendUnlisten_=function(t,e,i,n){this.log_("Unlisten on "+t+" for "+e);var r={p:t};n&&(r.q=i,r.t=n),this.sendRequest("n",r)},e.prototype.onDisconnectPut=function(t,e,i){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",t,e,i):this.onDisconnectRequestQueue_.push({pathString:t,action:"o",data:e,onComplete:i})},e.prototype.onDisconnectMerge=function(t,e,i){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",t,e,i):this.onDisconnectRequestQueue_.push({pathString:t,action:"om",data:e,onComplete:i})},e.prototype.onDisconnectCancel=function(t,e){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",t,null,e):this.onDisconnectRequestQueue_.push({pathString:t,action:"oc",data:null,onComplete:e})},e.prototype.sendOnDisconnect_=function(t,e,i,n){var r={p:e,d:i};this.log_("onDisconnect "+t,r),this.sendRequest(t,r,(function(t){n&&setTimeout((function(){n(t.s,t.d)}),Math.floor(0))}))},e.prototype.put=function(t,e,i,n){this.putInternal("p",t,e,i,n)},e.prototype.merge=function(t,e,i,n){this.putInternal("m",t,e,i,n)},e.prototype.putInternal=function(t,e,i,n,r){this.initConnection_();var o={p:e,d:i};void 0!==r&&(o.h=r),this.outstandingPuts_.push({action:t,request:o,onComplete:n}),this.outstandingPutCount_++;var a=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(a):this.log_("Buffering put: "+e)},e.prototype.sendPut_=function(t){var e=this,i=this.outstandingPuts_[t].action,n=this.outstandingPuts_[t].request,r=this.outstandingPuts_[t].onComplete;this.outstandingPuts_[t].queued=this.connected_,this.sendRequest(i,n,(function(n){e.log_(i+" response",n),delete e.outstandingPuts_[t],e.outstandingPutCount_--,0===e.outstandingPutCount_&&(e.outstandingPuts_=[]),r&&r(n.s,n.d)}))},e.prototype.reportStats=function(t){var e=this;if(this.connected_){var i={c:t};this.log_("reportStats",i),this.sendRequest("s",i,(function(t){if("ok"!==t.s){var i=t.d;e.log_("reportStats","Error sending stats: "+i)}}))}},e.prototype.onDataMessage_=function(t){if("r"in t){this.log_("from server: "+Object(o.C)(t));var e=t.r,i=this.requestCBHash_[e];i&&(delete this.requestCBHash_[e],i(t.b))}else{if("error"in t)throw"A server-side error has occurred: "+t.error;"a"in t&&this.onDataPush_(t.a,t.b)}},e.prototype.onDataPush_=function(t,e){this.log_("handleServerMessage",t,e),"d"===t?this.onDataUpdate_(e.p,e.d,!1,e.t):"m"===t?this.onDataUpdate_(e.p,e.d,!0,e.t):"c"===t?this.onListenRevoked_(e.p,e.q):"ac"===t?this.onAuthRevoked_(e.s,e.d):"apc"===t?this.onAppCheckRevoked_(e.s,e.d):"sd"===t?this.onSecurityDebugPacket_(e):T("Unrecognized action received from server: "+Object(o.C)(t)+"\nAre you using the latest client?")},e.prototype.onReady_=function(t,e){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=(new Date).getTime(),this.handleTimestamp_(t),this.lastSessionId=e,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)},e.prototype.scheduleConnect_=function(t){var e=this;Object(o.d)(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout((function(){e.establishConnectionTimer_=null,e.establishConnection_()}),Math.floor(t))},e.prototype.initConnection_=function(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)},e.prototype.onVisible_=function(t){t&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=1e3,this.realtime_||this.scheduleConnect_(0)),this.visible_=t},e.prototype.onOnline_=function(t){t?(this.log_("Browser went online."),this.reconnectDelay_=1e3,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())},e.prototype.onRealtimeDisconnect_=function(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){if(this.visible_){if(this.lastConnectionEstablishedTime_){(new Date).getTime()-this.lastConnectionEstablishedTime_>3e4&&(this.reconnectDelay_=1e3),this.lastConnectionEstablishedTime_=null}}else this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime();var t=(new Date).getTime()-this.lastConnectionAttemptTime_,e=Math.max(0,this.reconnectDelay_-t);e=Math.random()*e,this.log_("Trying to reconnect in "+e+"ms"),this.scheduleConnect_(e),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,1.3*this.reconnectDelay_)}this.onConnectStatus_(!1)},e.prototype.establishConnection_=function(){return Object(a.b)(this,void 0,void 0,(function(){var t,i,n,r,s,h,u,l,c,d,p,f,m,g,y=this;return Object(a.d)(this,(function(v){switch(v.label){case 0:if(!this.shouldReconnect_())return[3,4];this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null,t=this.onDataMessage_.bind(this),i=this.onReady_.bind(this),n=this.onRealtimeDisconnect_.bind(this),r=this.id+":"+e.nextConnectionId_++,s=this.lastSessionId,h=!1,u=null,l=function(){u?u.close():(h=!0,n())},c=function(t){Object(o.d)(u,"sendRequest call when we're not connected not allowed."),u.sendRequest(t)},this.realtime_={close:l,sendRequest:c},d=this.forceTokenRefresh_,this.forceTokenRefresh_=!1,v.label=1;case 1:return v.trys.push([1,3,,4]),[4,Promise.all([this.authTokenProvider_.getToken(d),this.appCheckTokenProvider_.getToken(d)])];case 2:return p=a.e.apply(void 0,[v.sent(),2]),f=p[0],m=p[1],h?C("getToken() completed but was canceled"):(C("getToken() completed. Creating connection."),this.authToken_=f&&f.accessToken,this.appCheckToken_=m&&m.token,u=new rt(r,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,t,i,n,(function(t){E(t+" ("+y.repoInfo_.toString()+")"),y.interrupt("server_kill")}),s)),[3,4];case 3:return g=v.sent(),this.log_("Failed to get token: "+g),h||(this.repoInfo_.nodeAdmin&&E(g),l()),[3,4];case 4:return[2]}}))}))},e.prototype.interrupt=function(t){C("Interrupting connection for reason: "+t),this.interruptReasons_[t]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())},e.prototype.resume=function(t){C("Resuming connection for reason: "+t),delete this.interruptReasons_[t],Object(o.q)(this.interruptReasons_)&&(this.reconnectDelay_=1e3,this.realtime_||this.scheduleConnect_(0))},e.prototype.handleTimestamp_=function(t){var e=t-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:e})},e.prototype.cancelSentTransactions_=function(){for(var t=0;t<this.outstandingPuts_.length;t++){var e=this.outstandingPuts_[t];e&&"h"in e.request&&e.queued&&(e.onComplete&&e.onComplete("disconnect"),delete this.outstandingPuts_[t],this.outstandingPutCount_--)}0===this.outstandingPutCount_&&(this.outstandingPuts_=[])},e.prototype.onListenRevoked_=function(t,e){var i;i=e?e.map((function(t){return D(t)})).join("$"):"default";var n=this.removeListen_(t,i);n&&n.onComplete&&n.onComplete("permission_denied")},e.prototype.removeListen_=function(t,e){var i,n=new ht(t).toString();if(this.listens.has(n)){var r=this.listens.get(n);i=r.get(e),r.delete(e),0===r.size&&this.listens.delete(n)}else i=void 0;return i},e.prototype.onAuthRevoked_=function(t,e){C("Auth token revoked: "+t+"/"+e),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),"invalid_token"!==t&&"permission_denied"!==t||(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=3&&(this.reconnectDelay_=3e4,this.authTokenProvider_.notifyForInvalidToken()))},e.prototype.onAppCheckRevoked_=function(t,e){C("App check token revoked: "+t+"/"+e),this.appCheckToken_=null,this.forceTokenRefresh_=!0,"invalid_token"!==t&&"permission_denied"!==t||(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=3&&this.appCheckTokenProvider_.notifyForInvalidToken())},e.prototype.onSecurityDebugPacket_=function(t){this.securityDebugCallback_&&this.securityDebugCallback_(t)},e.prototype.restoreState_=function(){var t,e,i,n;this.tryAuth(),this.tryAppCheck();try{for(var r=Object(a.g)(this.listens.values()),o=r.next();!o.done;o=r.next()){var s=o.value;try{for(var h=(i=void 0,Object(a.g)(s.values())),u=h.next();!u.done;u=h.next()){var l=u.value;this.sendListen_(l)}}catch(t){i={error:t}}finally{try{u&&!u.done&&(n=h.return)&&n.call(h)}finally{if(i)throw i.error}}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}for(var c=0;c<this.outstandingPuts_.length;c++)this.outstandingPuts_[c]&&this.sendPut_(c);for(;this.onDisconnectRequestQueue_.length;){var d=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(d.action,d.pathString,d.data,d.onComplete)}for(c=0;c<this.outstandingGets_.length;c++)this.outstandingGets_[c]&&this.sendGet_(c)},e.prototype.sendConnectStats_=function(){var t={},e="js";Object(o.t)()&&(e=this.repoInfo_.nodeAdmin?"admin_node":"node"),t["sdk."+e+"."+h.replace(/\./g,"-")]=1,Object(o.r)()?t["framework.cordova"]=1:Object(o.u)()&&(t["framework.reactnative"]=1),this.reportStats(t)},e.prototype.shouldReconnect_=function(){var t=st.getInstance().currentlyOnline();return Object(o.q)(this.interruptReasons_)&&t},e.nextPersistentConnectionId_=0,e.nextConnectionId_=0,e}(ot),Mt=function(){function t(t,e){this.name=t,this.node=e}return t.Wrap=function(e,i){return new t(e,i)},t}(),It=function(){function t(){}return t.prototype.getCompare=function(){return this.compare.bind(this)},t.prototype.indexedValueChanged=function(t,e){var i=new Mt(M,t),n=new Mt(M,e);return 0!==this.compare(i,n)},t.prototype.minPost=function(){return Mt.MIN},t}(),kt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),Object.defineProperty(e,"__EMPTY_NODE",{get:function(){return Tt},set:function(t){Tt=t},enumerable:!1,configurable:!0}),e.prototype.compare=function(t,e){return k(t.name,e.name)},e.prototype.isDefinedOn=function(t){throw Object(o.e)("KeyIndex.isDefinedOn not expected to be called.")},e.prototype.indexedValueChanged=function(t,e){return!1},e.prototype.minPost=function(){return Mt.MIN},e.prototype.maxPost=function(){return new Mt(I,Tt)},e.prototype.makePost=function(t,e){return Object(o.d)("string"==typeof t,"KeyIndex indexValue must always be a string."),new Mt(t,Tt)},e.prototype.toString=function(){return".key"},e}(It),Ot=new kt,Rt=function(){function t(t,e,i,n,r){void 0===r&&(r=null),this.isReverse_=n,this.resultGenerator_=r,this.nodeStack_=[];for(var o=1;!t.isEmpty();)if(t=t,o=e?i(t.key,e):1,n&&(o*=-1),o<0)t=this.isReverse_?t.left:t.right;else{if(0===o){this.nodeStack_.push(t);break}this.nodeStack_.push(t),t=this.isReverse_?t.right:t.left}}return t.prototype.getNext=function(){if(0===this.nodeStack_.length)return null;var t,e=this.nodeStack_.pop();if(t=this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value},this.isReverse_)for(e=e.left;!e.isEmpty();)this.nodeStack_.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack_.push(e),e=e.left;return t},t.prototype.hasNext=function(){return this.nodeStack_.length>0},t.prototype.peek=function(){if(0===this.nodeStack_.length)return null;var t=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(t.key,t.value):{key:t.key,value:t.value}},t}(),Dt=function(){function t(e,i,n,r,o){this.key=e,this.value=i,this.color=null!=n?n:t.RED,this.left=null!=r?r:Nt.EMPTY_NODE,this.right=null!=o?o:Nt.EMPTY_NODE}return t.prototype.copy=function(e,i,n,r,o){return new t(null!=e?e:this.key,null!=i?i:this.value,null!=n?n:this.color,null!=r?r:this.left,null!=o?o:this.right)},t.prototype.count=function(){return this.left.count()+1+this.right.count()},t.prototype.isEmpty=function(){return!1},t.prototype.inorderTraversal=function(t){return this.left.inorderTraversal(t)||!!t(this.key,this.value)||this.right.inorderTraversal(t)},t.prototype.reverseTraversal=function(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)},t.prototype.min_=function(){return this.left.isEmpty()?this:this.left.min_()},t.prototype.minKey=function(){return this.min_().key},t.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},t.prototype.insert=function(t,e,i){var n=this,r=i(t,n.key);return(n=r<0?n.copy(null,null,null,n.left.insert(t,e,i),null):0===r?n.copy(null,e,null,null,null):n.copy(null,null,null,null,n.right.insert(t,e,i))).fixUp_()},t.prototype.removeMin_=function(){if(this.left.isEmpty())return Nt.EMPTY_NODE;var t=this;return t.left.isRed_()||t.left.left.isRed_()||(t=t.moveRedLeft_()),(t=t.copy(null,null,null,t.left.removeMin_(),null)).fixUp_()},t.prototype.remove=function(t,e){var i,n;if(e(t,(i=this).key)<0)i.left.isEmpty()||i.left.isRed_()||i.left.left.isRed_()||(i=i.moveRedLeft_()),i=i.copy(null,null,null,i.left.remove(t,e),null);else{if(i.left.isRed_()&&(i=i.rotateRight_()),i.right.isEmpty()||i.right.isRed_()||i.right.left.isRed_()||(i=i.moveRedRight_()),0===e(t,i.key)){if(i.right.isEmpty())return Nt.EMPTY_NODE;n=i.right.min_(),i=i.copy(n.key,n.value,null,null,i.right.removeMin_())}i=i.copy(null,null,null,null,i.right.remove(t,e))}return i.fixUp_()},t.prototype.isRed_=function(){return this.color},t.prototype.fixUp_=function(){var t=this;return t.right.isRed_()&&!t.left.isRed_()&&(t=t.rotateLeft_()),t.left.isRed_()&&t.left.left.isRed_()&&(t=t.rotateRight_()),t.left.isRed_()&&t.right.isRed_()&&(t=t.colorFlip_()),t},t.prototype.moveRedLeft_=function(){var t=this.colorFlip_();return t.right.left.isRed_()&&(t=(t=(t=t.copy(null,null,null,null,t.right.rotateRight_())).rotateLeft_()).colorFlip_()),t},t.prototype.moveRedRight_=function(){var t=this.colorFlip_();return t.left.left.isRed_()&&(t=(t=t.rotateRight_()).colorFlip_()),t},t.prototype.rotateLeft_=function(){var e=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)},t.prototype.rotateRight_=function(){var e=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)},t.prototype.colorFlip_=function(){var t=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,e)},t.prototype.checkMaxDepth_=function(){var t=this.check_();return Math.pow(2,t)<=this.count()+1},t.prototype.check_=function(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");var t=this.left.check_();if(t!==this.right.check_())throw new Error("Black depths differ");return t+(this.isRed_()?0:1)},t.RED=!0,t.BLACK=!1,t}(),Lt=function(){function t(){}return t.prototype.copy=function(t,e,i,n,r){return this},t.prototype.insert=function(t,e,i){return new Dt(t,e,null)},t.prototype.remove=function(t,e){return this},t.prototype.count=function(){return 0},t.prototype.isEmpty=function(){return!0},t.prototype.inorderTraversal=function(t){return!1},t.prototype.reverseTraversal=function(t){return!1},t.prototype.minKey=function(){return null},t.prototype.maxKey=function(){return null},t.prototype.check_=function(){return 0},t.prototype.isRed_=function(){return!1},t}(),Nt=function(){function t(e,i){void 0===i&&(i=t.EMPTY_NODE),this.comparator_=e,this.root_=i}return t.prototype.insert=function(e,i){return new t(this.comparator_,this.root_.insert(e,i,this.comparator_).copy(null,null,Dt.BLACK,null,null))},t.prototype.remove=function(e){return new t(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,Dt.BLACK,null,null))},t.prototype.get=function(t){for(var e,i=this.root_;!i.isEmpty();){if(0===(e=this.comparator_(t,i.key)))return i.value;e<0?i=i.left:e>0&&(i=i.right)}return null},t.prototype.getPredecessorKey=function(t){for(var e,i=this.root_,n=null;!i.isEmpty();){if(0===(e=this.comparator_(t,i.key))){if(i.left.isEmpty())return n?n.key:null;for(i=i.left;!i.right.isEmpty();)i=i.right;return i.key}e<0?i=i.left:e>0&&(n=i,i=i.right)}throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")},t.prototype.isEmpty=function(){return this.root_.isEmpty()},t.prototype.count=function(){return this.root_.count()},t.prototype.minKey=function(){return this.root_.minKey()},t.prototype.maxKey=function(){return this.root_.maxKey()},t.prototype.inorderTraversal=function(t){return this.root_.inorderTraversal(t)},t.prototype.reverseTraversal=function(t){return this.root_.reverseTraversal(t)},t.prototype.getIterator=function(t){return new Rt(this.root_,null,this.comparator_,!1,t)},t.prototype.getIteratorFrom=function(t,e){return new Rt(this.root_,t,this.comparator_,!1,e)},t.prototype.getReverseIteratorFrom=function(t,e){return new Rt(this.root_,t,this.comparator_,!0,e)},t.prototype.getReverseIterator=function(t){return new Rt(this.root_,null,this.comparator_,!0,t)},t.EMPTY_NODE=new Lt,t}();function Bt(t,e){return k(t.name,e.name)}function Ft(t,e){return k(t,e)}var zt,jt,Gt,Ut=function(t){return"number"==typeof t?"number:"+B(t):"string:"+t},Ht=function(t){if(t.isLeafNode()){var e=t.val();Object(o.d)("string"==typeof e||"number"==typeof e||"object"==typeof e&&Object(o.h)(e,".sv"),"Priority must be a string or number.")}else Object(o.d)(t===At||t.isEmpty(),"priority of unexpected type.");Object(o.d)(t===At||t.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")},Vt=function(){function t(e,i){void 0===i&&(i=t.__childrenNodeConstructor.EMPTY_NODE),this.value_=e,this.priorityNode_=i,this.lazyHash_=null,Object(o.d)(void 0!==this.value_&&null!==this.value_,"LeafNode shouldn't be created with null/undefined value."),Ht(this.priorityNode_)}return Object.defineProperty(t,"__childrenNodeConstructor",{get:function(){return zt},set:function(t){zt=t},enumerable:!1,configurable:!0}),t.prototype.isLeafNode=function(){return!0},t.prototype.getPriority=function(){return this.priorityNode_},t.prototype.updatePriority=function(e){return new t(this.value_,e)},t.prototype.getImmediateChild=function(e){return".priority"===e?this.priorityNode_:t.__childrenNodeConstructor.EMPTY_NODE},t.prototype.getChild=function(e){return yt(e)?this:".priority"===lt(e)?this.priorityNode_:t.__childrenNodeConstructor.EMPTY_NODE},t.prototype.hasChild=function(){return!1},t.prototype.getPredecessorChildName=function(t,e){return null},t.prototype.updateImmediateChild=function(e,i){return".priority"===e?this.updatePriority(i):i.isEmpty()&&".priority"!==e?this:t.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(e,i).updatePriority(this.priorityNode_)},t.prototype.updateChild=function(e,i){var n=lt(e);return null===n?i:i.isEmpty()&&".priority"!==n?this:(Object(o.d)(".priority"!==n||1===ct(e),".priority must be the last token in a path"),this.updateImmediateChild(n,t.__childrenNodeConstructor.EMPTY_NODE.updateChild(dt(e),i)))},t.prototype.isEmpty=function(){return!1},t.prototype.numChildren=function(){return 0},t.prototype.forEachChild=function(t,e){return!1},t.prototype.val=function(t){return t&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()},t.prototype.hash=function(){if(null===this.lazyHash_){var t="";this.priorityNode_.isEmpty()||(t+="priority:"+Ut(this.priorityNode_.val())+":");var e=typeof this.value_;t+=e+":",t+="number"===e?B(this.value_):this.value_,this.lazyHash_=v(t)}return this.lazyHash_},t.prototype.getValue=function(){return this.value_},t.prototype.compareTo=function(e){return e===t.__childrenNodeConstructor.EMPTY_NODE?1:e instanceof t.__childrenNodeConstructor?-1:(Object(o.d)(e.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(e))},t.prototype.compareToLeafNode_=function(e){var i=typeof e.value_,n=typeof this.value_,r=t.VALUE_TYPE_ORDER.indexOf(i),a=t.VALUE_TYPE_ORDER.indexOf(n);return Object(o.d)(r>=0,"Unknown leaf type: "+i),Object(o.d)(a>=0,"Unknown leaf type: "+n),r===a?"object"===n?0:this.value_<e.value_?-1:this.value_===e.value_?0:1:a-r},t.prototype.withIndex=function(){return this},t.prototype.isIndexed=function(){return!0},t.prototype.equals=function(t){if(t===this)return!0;if(t.isLeafNode()){var e=t;return this.value_===e.value_&&this.priorityNode_.equals(e.priorityNode_)}return!1},t.VALUE_TYPE_ORDER=["object","boolean","number","string"],t}();var Wt,Xt,Yt=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.compare=function(t,e){var i=t.node.getPriority(),n=e.node.getPriority(),r=i.compareTo(n);return 0===r?k(t.name,e.name):r},e.prototype.isDefinedOn=function(t){return!t.getPriority().isEmpty()},e.prototype.indexedValueChanged=function(t,e){return!t.getPriority().equals(e.getPriority())},e.prototype.minPost=function(){return Mt.MIN},e.prototype.maxPost=function(){return new Mt(I,new Vt("[PRIORITY-POST]",Gt))},e.prototype.makePost=function(t,e){var i=jt(t);return new Mt(e,new Vt("[PRIORITY-POST]",i))},e.prototype.toString=function(){return".priority"},e}(It)),qt=Math.log(2),Kt=function(){function t(t){var e;this.count=(e=t+1,parseInt(Math.log(e)/qt,10)),this.current_=this.count-1;var i,n=(i=this.count,parseInt(Array(i+1).join("1"),2));this.bits_=t+1&n}return t.prototype.nextBitIsOne=function(){var t=!(this.bits_&1<<this.current_);return this.current_--,t},t}(),Jt=function(t,e,i,n){t.sort(e);var r=function(e,n){var o,a,s=n-e;if(0===s)return null;if(1===s)return o=t[e],a=i?i(o):o,new Dt(a,o.node,Dt.BLACK,null,null);var h=parseInt(s/2,10)+e,u=r(e,h),l=r(h+1,n);return o=t[h],a=i?i(o):o,new Dt(a,o.node,Dt.BLACK,u,l)},o=function(e){for(var n=null,o=null,a=t.length,s=function(e,n){var o=a-e,s=a;a-=e;var u=r(o+1,s),l=t[o],c=i?i(l):l;h(new Dt(c,l.node,n,null,u))},h=function(t){n?(n.left=t,n=t):(o=t,n=t)},u=0;u<e.count;++u){var l=e.nextBitIsOne(),c=Math.pow(2,e.count-(u+1));l?s(c,Dt.BLACK):(s(c,Dt.BLACK),s(c,Dt.RED))}return o}(new Kt(t.length));return new Nt(n||e,o)},Zt={},Qt=function(){function t(t,e){this.indexes_=t,this.indexSet_=e}return Object.defineProperty(t,"Default",{get:function(){return Object(o.d)(Zt&&Yt,"ChildrenNode.ts has not been loaded"),Wt=Wt||new t({".priority":Zt},{".priority":Yt})},enumerable:!1,configurable:!0}),t.prototype.get=function(t){var e=Object(o.z)(this.indexes_,t);if(!e)throw new Error("No index defined for "+t);return e instanceof Nt?e:null},t.prototype.hasIndex=function(t){return Object(o.h)(this.indexSet_,t.toString())},t.prototype.addIndex=function(e,i){Object(o.d)(e!==Ot,"KeyIndex always exists and isn't meant to be added to the IndexMap.");for(var n,r=[],s=!1,h=i.getIterator(Mt.Wrap),u=h.getNext();u;)s=s||e.isDefinedOn(u.node),r.push(u),u=h.getNext();n=s?Jt(r,e.getCompare()):Zt;var l=e.toString(),c=Object(a.a)({},this.indexSet_);c[l]=e;var d=Object(a.a)({},this.indexes_);return d[l]=n,new t(d,c)},t.prototype.addToIndexes=function(e,i){var n=this;return new t(Object(o.x)(this.indexes_,(function(t,r){var a=Object(o.z)(n.indexSet_,r);if(Object(o.d)(a,"Missing index implementation for "+r),t===Zt){if(a.isDefinedOn(e.node)){for(var s=[],h=i.getIterator(Mt.Wrap),u=h.getNext();u;)u.name!==e.name&&s.push(u),u=h.getNext();return s.push(e),Jt(s,a.getCompare())}return Zt}var l=i.get(e.name),c=t;return l&&(c=c.remove(new Mt(e.name,l))),c.insert(e,e.node)})),this.indexSet_)},t.prototype.removeFromIndexes=function(e,i){return new t(Object(o.x)(this.indexes_,(function(t){if(t===Zt)return t;var n=i.get(e.name);return n?t.remove(new Mt(e.name,n)):t})),this.indexSet_)},t}(),$t=function(){function t(t,e,i){this.children_=t,this.priorityNode_=e,this.indexMap_=i,this.lazyHash_=null,this.priorityNode_&&Ht(this.priorityNode_),this.children_.isEmpty()&&Object(o.d)(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}return Object.defineProperty(t,"EMPTY_NODE",{get:function(){return Xt||(Xt=new t(new Nt(Ft),null,Qt.Default))},enumerable:!1,configurable:!0}),t.prototype.isLeafNode=function(){return!1},t.prototype.getPriority=function(){return this.priorityNode_||Xt},t.prototype.updatePriority=function(e){return this.children_.isEmpty()?this:new t(this.children_,e,this.indexMap_)},t.prototype.getImmediateChild=function(t){if(".priority"===t)return this.getPriority();var e=this.children_.get(t);return null===e?Xt:e},t.prototype.getChild=function(t){var e=lt(t);return null===e?this:this.getImmediateChild(e).getChild(dt(t))},t.prototype.hasChild=function(t){return null!==this.children_.get(t)},t.prototype.updateImmediateChild=function(e,i){if(Object(o.d)(i,"We should always be passing snapshot nodes"),".priority"===e)return this.updatePriority(i);var n=new Mt(e,i),r=void 0,a=void 0;i.isEmpty()?(r=this.children_.remove(e),a=this.indexMap_.removeFromIndexes(n,this.children_)):(r=this.children_.insert(e,i),a=this.indexMap_.addToIndexes(n,this.children_));var s=r.isEmpty()?Xt:this.priorityNode_;return new t(r,s,a)},t.prototype.updateChild=function(t,e){var i=lt(t);if(null===i)return e;Object(o.d)(".priority"!==lt(t)||1===ct(t),".priority must be the last token in a path");var n=this.getImmediateChild(i).updateChild(dt(t),e);return this.updateImmediateChild(i,n)},t.prototype.isEmpty=function(){return this.children_.isEmpty()},t.prototype.numChildren=function(){return this.children_.count()},t.prototype.val=function(e){if(this.isEmpty())return null;var i={},n=0,r=0,o=!0;if(this.forEachChild(Yt,(function(a,s){i[a]=s.val(e),n++,o&&t.INTEGER_REGEXP_.test(a)?r=Math.max(r,Number(a)):o=!1})),!e&&o&&r<2*n){var a=[];for(var s in i)a[s]=i[s];return a}return e&&!this.getPriority().isEmpty()&&(i[".priority"]=this.getPriority().val()),i},t.prototype.hash=function(){if(null===this.lazyHash_){var t="";this.getPriority().isEmpty()||(t+="priority:"+Ut(this.getPriority().val())+":"),this.forEachChild(Yt,(function(e,i){var n=i.hash();""!==n&&(t+=":"+e+":"+n)})),this.lazyHash_=""===t?"":v(t)}return this.lazyHash_},t.prototype.getPredecessorChildName=function(t,e,i){var n=this.resolveIndex_(i);if(n){var r=n.getPredecessorKey(new Mt(t,e));return r?r.name:null}return this.children_.getPredecessorKey(t)},t.prototype.getFirstChildName=function(t){var e=this.resolveIndex_(t);if(e){var i=e.minKey();return i&&i.name}return this.children_.minKey()},t.prototype.getFirstChild=function(t){var e=this.getFirstChildName(t);return e?new Mt(e,this.children_.get(e)):null},t.prototype.getLastChildName=function(t){var e=this.resolveIndex_(t);if(e){var i=e.maxKey();return i&&i.name}return this.children_.maxKey()},t.prototype.getLastChild=function(t){var e=this.getLastChildName(t);return e?new Mt(e,this.children_.get(e)):null},t.prototype.forEachChild=function(t,e){var i=this.resolveIndex_(t);return i?i.inorderTraversal((function(t){return e(t.name,t.node)})):this.children_.inorderTraversal(e)},t.prototype.getIterator=function(t){return this.getIteratorFrom(t.minPost(),t)},t.prototype.getIteratorFrom=function(t,e){var i=this.resolveIndex_(e);if(i)return i.getIteratorFrom(t,(function(t){return t}));for(var n=this.children_.getIteratorFrom(t.name,Mt.Wrap),r=n.peek();null!=r&&e.compare(r,t)<0;)n.getNext(),r=n.peek();return n},t.prototype.getReverseIterator=function(t){return this.getReverseIteratorFrom(t.maxPost(),t)},t.prototype.getReverseIteratorFrom=function(t,e){var i=this.resolveIndex_(e);if(i)return i.getReverseIteratorFrom(t,(function(t){return t}));for(var n=this.children_.getReverseIteratorFrom(t.name,Mt.Wrap),r=n.peek();null!=r&&e.compare(r,t)>0;)n.getNext(),r=n.peek();return n},t.prototype.compareTo=function(t){return this.isEmpty()?t.isEmpty()?0:-1:t.isLeafNode()||t.isEmpty()?1:t===te?-1:0},t.prototype.withIndex=function(e){if(e===Ot||this.indexMap_.hasIndex(e))return this;var i=this.indexMap_.addIndex(e,this.children_);return new t(this.children_,this.priorityNode_,i)},t.prototype.isIndexed=function(t){return t===Ot||this.indexMap_.hasIndex(t)},t.prototype.equals=function(t){if(t===this)return!0;if(t.isLeafNode())return!1;var e=t;if(this.getPriority().equals(e.getPriority())){if(this.children_.count()===e.children_.count()){for(var i=this.getIterator(Yt),n=e.getIterator(Yt),r=i.getNext(),o=n.getNext();r&&o;){if(r.name!==o.name||!r.node.equals(o.node))return!1;r=i.getNext(),o=n.getNext()}return null===r&&null===o}return!1}return!1},t.prototype.resolveIndex_=function(t){return t===Ot?null:this.indexMap_.get(t.toString())},t.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,t}(),te=new(function(t){function e(){return t.call(this,new Nt(Ft),$t.EMPTY_NODE,Qt.Default)||this}return Object(a.c)(e,t),e.prototype.compareTo=function(t){return t===this?0:1},e.prototype.equals=function(t){return t===this},e.prototype.getPriority=function(){return this},e.prototype.getImmediateChild=function(t){return $t.EMPTY_NODE},e.prototype.isEmpty=function(){return!1},e}($t));Object.defineProperties(Mt,{MIN:{value:new Mt(M,$t.EMPTY_NODE)},MAX:{value:new Mt(I,te)}}),kt.__EMPTY_NODE=$t.EMPTY_NODE,Vt.__childrenNodeConstructor=$t,At=te,function(t){Gt=t}(te);function ee(t,e){if(void 0===e&&(e=null),null===t)return $t.EMPTY_NODE;if("object"==typeof t&&".priority"in t&&(e=t[".priority"]),Object(o.d)(null===e||"string"==typeof e||"number"==typeof e||"object"==typeof e&&".sv"in e,"Invalid priority type found: "+typeof e),"object"==typeof t&&".value"in t&&null!==t[".value"]&&(t=t[".value"]),"object"!=typeof t||".sv"in t)return new Vt(t,ee(e));if(t instanceof Array){var i=$t.EMPTY_NODE;return N(t,(function(e,n){if(Object(o.h)(t,e)&&"."!==e.substring(0,1)){var r=ee(n);!r.isLeafNode()&&r.isEmpty()||(i=i.updateImmediateChild(e,r))}})),i.updatePriority(ee(e))}var n=[],r=!1;if(N(t,(function(t,e){if("."!==t.substring(0,1)){var i=ee(e);i.isEmpty()||(r=r||!i.getPriority().isEmpty(),n.push(new Mt(t,i)))}})),0===n.length)return $t.EMPTY_NODE;var a=Jt(n,Bt,(function(t){return t.name}),Ft);if(r){var s=Jt(n,Yt.getCompare());return new $t(a,ee(e),new Qt({".priority":s},{".priority":Yt}))}return new $t(a,ee(e),Qt.Default)}!function(t){jt=t}(ee);var ie,ne,re=function(t){function e(e){var i=t.call(this)||this;return i.indexPath_=e,Object(o.d)(!yt(e)&&".priority"!==lt(e),"Can't create PathIndex with empty path or .priority key"),i}return Object(a.c)(e,t),e.prototype.extractChild=function(t){return t.getChild(this.indexPath_)},e.prototype.isDefinedOn=function(t){return!t.getChild(this.indexPath_).isEmpty()},e.prototype.compare=function(t,e){var i=this.extractChild(t.node),n=this.extractChild(e.node),r=i.compareTo(n);return 0===r?k(t.name,e.name):r},e.prototype.makePost=function(t,e){var i=ee(t),n=$t.EMPTY_NODE.updateChild(this.indexPath_,i);return new Mt(e,n)},e.prototype.maxPost=function(){var t=$t.EMPTY_NODE.updateChild(this.indexPath_,te);return new Mt(I,t)},e.prototype.toString=function(){return ft(this.indexPath_,0).join("/")},e}(It),oe=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype.compare=function(t,e){var i=t.node.compareTo(e.node);return 0===i?k(t.name,e.name):i},e.prototype.isDefinedOn=function(t){return!0},e.prototype.indexedValueChanged=function(t,e){return!t.equals(e)},e.prototype.minPost=function(){return Mt.MIN},e.prototype.maxPost=function(){return Mt.MAX},e.prototype.makePost=function(t,e){var i=ee(t);return new Mt(e,i)},e.prototype.toString=function(){return".value"},e}(It)),ae="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",se=(ie=0,ne=[],function(t){var e,i=t===ie;ie=t;var n=new Array(8);for(e=7;e>=0;e--)n[e]=ae.charAt(t%64),t=Math.floor(t/64);Object(o.d)(0===t,"Cannot push at time == 0");var r=n.join("");if(i){for(e=11;e>=0&&63===ne[e];e--)ne[e]=0;ne[e]++}else for(e=0;e<12;e++)ne[e]=Math.floor(64*Math.random());for(e=0;e<12;e++)r+=ae.charAt(ne[e]);return Object(o.d)(20===r.length,"nextPushId: Length should be 20."),r}),he=function(t){if("2147483647"===t)return"-";var e=z(t);if(null!=e)return""+(e+1);for(var i=new Array(t.length),n=0;n<i.length;n++)i[n]=t.charAt(n);if(i.length<786)return i.push("-"),i.join("");for(var r=i.length-1;r>=0&&"z"===i[r];)r--;if(-1===r)return I;var o=i[r],a=ae.charAt(ae.indexOf(o)+1);return i[r]=a,i.slice(0,r+1).join("")},ue=function(t){if("-2147483648"===t)return M;var e=z(t);if(null!=e)return""+(e-1);for(var i=new Array(t.length),n=0;n<i.length;n++)i[n]=t.charAt(n);return"-"===i[i.length-1]?1===i.length?"2147483647":(delete i[i.length-1],i.join("")):(i[i.length-1]=ae.charAt(ae.indexOf(i[i.length-1])-1),i.join("")+"z".repeat(786-i.length))};function le(t){return{type:"value",snapshotNode:t}}function ce(t,e){return{type:"child_added",snapshotNode:e,childName:t}}function de(t,e){return{type:"child_removed",snapshotNode:e,childName:t}}function pe(t,e,i){return{type:"child_changed",snapshotNode:e,childName:t,oldSnap:i}}var fe=function(){function t(t){this.index_=t}return t.prototype.updateChild=function(t,e,i,n,r,a){Object(o.d)(t.isIndexed(this.index_),"A node must be indexed if only a child is updated");var s=t.getImmediateChild(e);return s.getChild(n).equals(i.getChild(n))&&s.isEmpty()===i.isEmpty()?t:(null!=a&&(i.isEmpty()?t.hasChild(e)?a.trackChildChange(de(e,s)):Object(o.d)(t.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):s.isEmpty()?a.trackChildChange(ce(e,i)):a.trackChildChange(pe(e,i,s))),t.isLeafNode()&&i.isEmpty()?t:t.updateImmediateChild(e,i).withIndex(this.index_))},t.prototype.updateFullNode=function(t,e,i){return null!=i&&(t.isLeafNode()||t.forEachChild(Yt,(function(t,n){e.hasChild(t)||i.trackChildChange(de(t,n))})),e.isLeafNode()||e.forEachChild(Yt,(function(e,n){if(t.hasChild(e)){var r=t.getImmediateChild(e);r.equals(n)||i.trackChildChange(pe(e,n,r))}else i.trackChildChange(ce(e,n))}))),e.withIndex(this.index_)},t.prototype.updatePriority=function(t,e){return t.isEmpty()?$t.EMPTY_NODE:t.updatePriority(e)},t.prototype.filtersNodes=function(){return!1},t.prototype.getIndexedFilter=function(){return this},t.prototype.getIndex=function(){return this.index_},t}(),me=function(){function t(e){this.indexedFilter_=new fe(e.getIndex()),this.index_=e.getIndex(),this.startPost_=t.getStartPost_(e),this.endPost_=t.getEndPost_(e)}return t.prototype.getStartPost=function(){return this.startPost_},t.prototype.getEndPost=function(){return this.endPost_},t.prototype.matches=function(t){return this.index_.compare(this.getStartPost(),t)<=0&&this.index_.compare(t,this.getEndPost())<=0},t.prototype.updateChild=function(t,e,i,n,r,o){return this.matches(new Mt(e,i))||(i=$t.EMPTY_NODE),this.indexedFilter_.updateChild(t,e,i,n,r,o)},t.prototype.updateFullNode=function(t,e,i){e.isLeafNode()&&(e=$t.EMPTY_NODE);var n=e.withIndex(this.index_);n=n.updatePriority($t.EMPTY_NODE);var r=this;return e.forEachChild(Yt,(function(t,e){r.matches(new Mt(t,e))||(n=n.updateImmediateChild(t,$t.EMPTY_NODE))})),this.indexedFilter_.updateFullNode(t,n,i)},t.prototype.updatePriority=function(t,e){return t},t.prototype.filtersNodes=function(){return!0},t.prototype.getIndexedFilter=function(){return this.indexedFilter_},t.prototype.getIndex=function(){return this.index_},t.getStartPost_=function(t){if(t.hasStart()){var e=t.getIndexStartName();return t.getIndex().makePost(t.getIndexStartValue(),e)}return t.getIndex().minPost()},t.getEndPost_=function(t){if(t.hasEnd()){var e=t.getIndexEndName();return t.getIndex().makePost(t.getIndexEndValue(),e)}return t.getIndex().maxPost()},t}(),ge=function(){function t(t){this.rangedFilter_=new me(t),this.index_=t.getIndex(),this.limit_=t.getLimit(),this.reverse_=!t.isViewFromLeft()}return t.prototype.updateChild=function(t,e,i,n,r,o){return this.rangedFilter_.matches(new Mt(e,i))||(i=$t.EMPTY_NODE),t.getImmediateChild(e).equals(i)?t:t.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(t,e,i,n,r,o):this.fullLimitUpdateChild_(t,e,i,r,o)},t.prototype.updateFullNode=function(t,e,i){var n;if(e.isLeafNode()||e.isEmpty())n=$t.EMPTY_NODE.withIndex(this.index_);else if(2*this.limit_<e.numChildren()&&e.isIndexed(this.index_)){n=$t.EMPTY_NODE.withIndex(this.index_);var r=void 0;r=this.reverse_?e.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):e.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);for(var o=0;r.hasNext()&&o<this.limit_;){var a=r.getNext();if(!(this.reverse_?this.index_.compare(this.rangedFilter_.getStartPost(),a)<=0:this.index_.compare(a,this.rangedFilter_.getEndPost())<=0))break;n=n.updateImmediateChild(a.name,a.node),o++}}else{n=(n=e.withIndex(this.index_)).updatePriority($t.EMPTY_NODE);var s=void 0,h=void 0,u=void 0;r=void 0;if(this.reverse_){r=n.getReverseIterator(this.index_),s=this.rangedFilter_.getEndPost(),h=this.rangedFilter_.getStartPost();var l=this.index_.getCompare();u=function(t,e){return l(e,t)}}else r=n.getIterator(this.index_),s=this.rangedFilter_.getStartPost(),h=this.rangedFilter_.getEndPost(),u=this.index_.getCompare();o=0;for(var c=!1;r.hasNext();){a=r.getNext();!c&&u(s,a)<=0&&(c=!0),c&&o<this.limit_&&u(a,h)<=0?o++:n=n.updateImmediateChild(a.name,$t.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(t,n,i)},t.prototype.updatePriority=function(t,e){return t},t.prototype.filtersNodes=function(){return!0},t.prototype.getIndexedFilter=function(){return this.rangedFilter_.getIndexedFilter()},t.prototype.getIndex=function(){return this.index_},t.prototype.fullLimitUpdateChild_=function(t,e,i,n,r){var a;if(this.reverse_){var s=this.index_.getCompare();a=function(t,e){return s(e,t)}}else a=this.index_.getCompare();var h=t;Object(o.d)(h.numChildren()===this.limit_,"");var u=new Mt(e,i),l=this.reverse_?h.getFirstChild(this.index_):h.getLastChild(this.index_),c=this.rangedFilter_.matches(u);if(h.hasChild(e)){for(var d=h.getImmediateChild(e),p=n.getChildAfterChild(this.index_,l,this.reverse_);null!=p&&(p.name===e||h.hasChild(p.name));)p=n.getChildAfterChild(this.index_,p,this.reverse_);var f=null==p?1:a(p,u);if(c&&!i.isEmpty()&&f>=0)return null!=r&&r.trackChildChange(pe(e,i,d)),h.updateImmediateChild(e,i);null!=r&&r.trackChildChange(de(e,d));var m=h.updateImmediateChild(e,$t.EMPTY_NODE);return null!=p&&this.rangedFilter_.matches(p)?(null!=r&&r.trackChildChange(ce(p.name,p.node)),m.updateImmediateChild(p.name,p.node)):m}return i.isEmpty()?t:c&&a(l,u)>=0?(null!=r&&(r.trackChildChange(de(l.name,l.node)),r.trackChildChange(ce(e,i))),h.updateImmediateChild(e,i).updateImmediateChild(l.name,$t.EMPTY_NODE)):t},t}(),ye=function(){function t(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=Yt}return t.prototype.hasStart=function(){return this.startSet_},t.prototype.hasStartAfter=function(){return this.startAfterSet_},t.prototype.hasEndBefore=function(){return this.endBeforeSet_},t.prototype.isViewFromLeft=function(){return""===this.viewFrom_?this.startSet_:"l"===this.viewFrom_},t.prototype.getIndexStartValue=function(){return Object(o.d)(this.startSet_,"Only valid if start has been set"),this.indexStartValue_},t.prototype.getIndexStartName=function(){return Object(o.d)(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:M},t.prototype.hasEnd=function(){return this.endSet_},t.prototype.getIndexEndValue=function(){return Object(o.d)(this.endSet_,"Only valid if end has been set"),this.indexEndValue_},t.prototype.getIndexEndName=function(){return Object(o.d)(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:I},t.prototype.hasLimit=function(){return this.limitSet_},t.prototype.hasAnchoredLimit=function(){return this.limitSet_&&""!==this.viewFrom_},t.prototype.getLimit=function(){return Object(o.d)(this.limitSet_,"Only valid if limit has been set"),this.limit_},t.prototype.getIndex=function(){return this.index_},t.prototype.loadsAllData=function(){return!(this.startSet_||this.endSet_||this.limitSet_)},t.prototype.isDefault=function(){return this.loadsAllData()&&this.index_===Yt},t.prototype.copy=function(){var e=new t;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e},t}();function ve(t,e,i){var n=t.copy();return n.startSet_=!0,void 0===e&&(e=null),n.indexStartValue_=e,null!=i?(n.startNameSet_=!0,n.indexStartName_=i):(n.startNameSet_=!1,n.indexStartName_=""),n}function be(t,e,i){var n=t.copy();return n.endSet_=!0,void 0===e&&(e=null),n.indexEndValue_=e,void 0!==i?(n.endNameSet_=!0,n.indexEndName_=i):(n.endNameSet_=!1,n.indexEndName_=""),n}function _e(t,e){var i=t.copy();return i.index_=e,i}function we(t){var e,i={};return t.isDefault()||(t.index_===Yt?e="$priority":t.index_===oe?e="$value":t.index_===Ot?e="$key":(Object(o.d)(t.index_ instanceof re,"Unrecognized index type!"),e=t.index_.toString()),i.orderBy=Object(o.C)(e),t.startSet_&&(i.startAt=Object(o.C)(t.indexStartValue_),t.startNameSet_&&(i.startAt+=","+Object(o.C)(t.indexStartName_))),t.endSet_&&(i.endAt=Object(o.C)(t.indexEndValue_),t.endNameSet_&&(i.endAt+=","+Object(o.C)(t.indexEndName_))),t.limitSet_&&(t.isViewFromLeft()?i.limitToFirst=t.limit_:i.limitToLast=t.limit_)),i}function xe(t){var e={};if(t.startSet_&&(e.sp=t.indexStartValue_,t.startNameSet_&&(e.sn=t.indexStartName_)),t.endSet_&&(e.ep=t.indexEndValue_,t.endNameSet_&&(e.en=t.indexEndName_)),t.limitSet_){e.l=t.limit_;var i=t.viewFrom_;""===i&&(i=t.isViewFromLeft()?"l":"r"),e.vf=i}return t.index_!==Yt&&(e.i=t.index_.toString()),e}var Ce=function(t){function e(e,i,n,r){var o=t.call(this)||this;return o.repoInfo_=e,o.onDataUpdate_=i,o.authTokenProvider_=n,o.appCheckTokenProvider_=r,o.log_=S("p:rest:"),o.listens_={},o}return Object(a.c)(e,t),e.prototype.reportStats=function(t){throw new Error("Method not implemented.")},e.getListenId_=function(t,e){return void 0!==e?"tag$"+e:(Object(o.d)(t._queryParams.isDefault(),"should have a tag if it's not a default query."),t._path.toString())},e.prototype.listen=function(t,i,n,r){var a=this,s=t._path.toString();this.log_("Listen called for "+s+" "+t._queryIdentifier);var h=e.getListenId_(t,n),u={};this.listens_[h]=u;var l=we(t._queryParams);this.restRequest_(s+".json",l,(function(t,e){var i=e;(404===t&&(i=null,t=null),null===t&&a.onDataUpdate_(s,i,!1,n),Object(o.z)(a.listens_,h)===u)&&r(t?401===t?"permission_denied":"rest_error:"+t:"ok",null)}))},e.prototype.unlisten=function(t,i){var n=e.getListenId_(t,i);delete this.listens_[n]},e.prototype.get=function(t){var e=this,i=we(t._queryParams),n=t._path.toString(),r=new o.a;return this.restRequest_(n+".json",i,(function(t,i){var o=i;404===t&&(o=null,t=null),null===t?(e.onDataUpdate_(n,o,!1,null),r.resolve(o)):r.reject(new Error(o))})),r.promise},e.prototype.refreshAuthToken=function(t){},e.prototype.restRequest_=function(t,e,i){var n=this;return void 0===e&&(e={}),e.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then((function(r){var s=Object(a.e)(r,2),h=s[0],u=s[1];h&&h.accessToken&&(e.auth=h.accessToken),u&&u.token&&(e.ac=u.token);var l=(n.repoInfo_.secure?"https://":"http://")+n.repoInfo_.host+t+"?ns="+n.repoInfo_.namespace+Object(o.y)(e);n.log_("Sending REST request for "+l);var c=new XMLHttpRequest;c.onreadystatechange=function(){if(i&&4===c.readyState){n.log_("REST Response for "+l+" received. status:",c.status,"response:",c.responseText);var t=null;if(c.status>=200&&c.status<300){try{t=Object(o.w)(c.responseText)}catch(t){E("Failed to parse JSON response for "+l+": "+c.responseText)}i(null,t)}else 401!==c.status&&404!==c.status&&E("Got unsuccessful REST response for "+l+" Status: "+c.status),i(c.status);i=null}},c.open("GET",l,!0),c.send()}))},e}(ot),Se=function(){function t(){this.rootNode_=$t.EMPTY_NODE}return t.prototype.getNode=function(t){return this.rootNode_.getChild(t)},t.prototype.updateSnapshot=function(t,e){this.rootNode_=this.rootNode_.updateChild(t,e)},t}();function Te(){return{value:null,children:new Map}}function Ae(t,e,i){if(yt(e))t.value=i,t.children.clear();else if(null!==t.value)t.value=t.value.updateChild(e,i);else{var n=lt(e);t.children.has(n)||t.children.set(n,Te()),Ae(t.children.get(n),e=dt(e),i)}}function Ee(t,e,i){null!==t.value?i(e,t.value):function(t,e){t.children.forEach((function(t,i){e(i,t)}))}(t,(function(t,n){Ee(n,new ht(e.toString()+"/"+t),i)}))}var Pe,Me=function(){function t(t){this.collection_=t,this.last_=null}return t.prototype.get=function(){var t=this.collection_.get(),e=Object(a.a)({},t);return this.last_&&N(this.last_,(function(t,i){e[t]=e[t]-i})),this.last_=t,e},t}(),Ie=function(){function t(t,e){this.server_=e,this.statsToReport_={},this.statsListener_=new Me(t);var i=1e4+2e4*Math.random();G(this.reportStats_.bind(this),Math.floor(i))}return t.prototype.reportStats_=function(){var t=this,e=this.statsListener_.get(),i={},n=!1;N(e,(function(e,r){r>0&&Object(o.h)(t.statsToReport_,e)&&(i[e]=r,n=!0)})),n&&this.server_.reportStats(i),G(this.reportStats_.bind(this),Math.floor(2*Math.random()*3e5))},t}();function ke(t){return{fromUser:!1,fromServer:!0,queryId:t,tagged:!0}}!function(t){t[t.OVERWRITE=0]="OVERWRITE",t[t.MERGE=1]="MERGE",t[t.ACK_USER_WRITE=2]="ACK_USER_WRITE",t[t.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"}(Pe||(Pe={}));var Oe,Re=function(){function t(t,e,i){this.path=t,this.affectedTree=e,this.revert=i,this.type=Pe.ACK_USER_WRITE,this.source={fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}return t.prototype.operationForChild=function(e){if(yt(this.path)){if(null!=this.affectedTree.value)return Object(o.d)(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;var i=this.affectedTree.subtree(new ht(e));return new t(ut(),i,this.revert)}return Object(o.d)(lt(this.path)===e,"operationForChild called for unrelated child."),new t(dt(this.path),this.affectedTree,this.revert)},t}(),De=function(){function t(t,e){this.source=t,this.path=e,this.type=Pe.LISTEN_COMPLETE}return t.prototype.operationForChild=function(e){return yt(this.path)?new t(this.source,ut()):new t(this.source,dt(this.path))},t}(),Le=function(){function t(t,e,i){this.source=t,this.path=e,this.snap=i,this.type=Pe.OVERWRITE}return t.prototype.operationForChild=function(e){return yt(this.path)?new t(this.source,ut(),this.snap.getImmediateChild(e)):new t(this.source,dt(this.path),this.snap)},t}(),Ne=function(){function t(t,e,i){this.source=t,this.path=e,this.children=i,this.type=Pe.MERGE}return t.prototype.operationForChild=function(e){if(yt(this.path)){var i=this.children.subtree(new ht(e));return i.isEmpty()?null:i.value?new Le(this.source,ut(),i.value):new t(this.source,ut(),i)}return Object(o.d)(lt(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new t(this.source,dt(this.path),this.children)},t.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"},t}(),Be=function(){function t(t,e,i){this.node_=t,this.fullyInitialized_=e,this.filtered_=i}return t.prototype.isFullyInitialized=function(){return this.fullyInitialized_},t.prototype.isFiltered=function(){return this.filtered_},t.prototype.isCompleteForPath=function(t){if(yt(t))return this.isFullyInitialized()&&!this.filtered_;var e=lt(t);return this.isCompleteForChild(e)},t.prototype.isCompleteForChild=function(t){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(t)},t.prototype.getNode=function(){return this.node_},t}(),Fe=function(t){this.query_=t,this.index_=this.query_._queryParams.getIndex()};function ze(t,e,i,n,r,a){var s=n.filter((function(t){return t.type===i}));s.sort((function(e,i){return function(t,e,i){if(null==e.childName||null==i.childName)throw Object(o.e)("Should only compare child_ events.");var n=new Mt(e.childName,e.snapshotNode),r=new Mt(i.childName,i.snapshotNode);return t.index_.compare(n,r)}(t,e,i)})),s.forEach((function(i){var n=function(t,e,i){return"value"===e.type||"child_removed"===e.type||(e.prevName=i.getPredecessorChildName(e.childName,e.snapshotNode,t.index_)),e}(t,i,a);r.forEach((function(r){r.respondsTo(i.type)&&e.push(r.createEvent(n,t.query_))}))}))}function je(t,e){return{eventCache:t,serverCache:e}}function Ge(t,e,i,n){return je(new Be(e,i,n),t.serverCache)}function Ue(t,e,i,n){return je(t.eventCache,new Be(e,i,n))}function He(t){return t.eventCache.isFullyInitialized()?t.eventCache.getNode():null}function Ve(t){return t.serverCache.isFullyInitialized()?t.serverCache.getNode():null}var We=function(){function t(t,e){void 0===e&&(Oe||(Oe=new Nt(O)),e=Oe),this.value=t,this.children=e}return t.fromObject=function(e){var i=new t(null);return N(e,(function(t,e){i=i.set(new ht(t),e)})),i},t.prototype.isEmpty=function(){return null===this.value&&this.children.isEmpty()},t.prototype.findRootMostMatchingPathAndValue=function(t,e){if(null!=this.value&&e(this.value))return{path:ut(),value:this.value};if(yt(t))return null;var i=lt(t),n=this.children.get(i);if(null!==n){var r=n.findRootMostMatchingPathAndValue(dt(t),e);return null!=r?{path:gt(new ht(i),r.path),value:r.value}:null}return null},t.prototype.findRootMostValueAndPath=function(t){return this.findRootMostMatchingPathAndValue(t,(function(){return!0}))},t.prototype.subtree=function(e){if(yt(e))return this;var i=lt(e),n=this.children.get(i);return null!==n?n.subtree(dt(e)):new t(null)},t.prototype.set=function(e,i){if(yt(e))return new t(i,this.children);var n=lt(e),r=(this.children.get(n)||new t(null)).set(dt(e),i),o=this.children.insert(n,r);return new t(this.value,o)},t.prototype.remove=function(e){if(yt(e))return this.children.isEmpty()?new t(null):new t(null,this.children);var i=lt(e),n=this.children.get(i);if(n){var r=n.remove(dt(e)),o=void 0;return o=r.isEmpty()?this.children.remove(i):this.children.insert(i,r),null===this.value&&o.isEmpty()?new t(null):new t(this.value,o)}return this},t.prototype.get=function(t){if(yt(t))return this.value;var e=lt(t),i=this.children.get(e);return i?i.get(dt(t)):null},t.prototype.setTree=function(e,i){if(yt(e))return i;var n=lt(e),r=(this.children.get(n)||new t(null)).setTree(dt(e),i),o=void 0;return o=r.isEmpty()?this.children.remove(n):this.children.insert(n,r),new t(this.value,o)},t.prototype.fold=function(t){return this.fold_(ut(),t)},t.prototype.fold_=function(t,e){var i={};return this.children.inorderTraversal((function(n,r){i[n]=r.fold_(gt(t,n),e)})),e(t,this.value,i)},t.prototype.findOnPath=function(t,e){return this.findOnPath_(t,ut(),e)},t.prototype.findOnPath_=function(t,e,i){var n=!!this.value&&i(e,this.value);if(n)return n;if(yt(t))return null;var r=lt(t),o=this.children.get(r);return o?o.findOnPath_(dt(t),gt(e,r),i):null},t.prototype.foreachOnPath=function(t,e){return this.foreachOnPath_(t,ut(),e)},t.prototype.foreachOnPath_=function(e,i,n){if(yt(e))return this;this.value&&n(i,this.value);var r=lt(e),o=this.children.get(r);return o?o.foreachOnPath_(dt(e),gt(i,r),n):new t(null)},t.prototype.foreach=function(t){this.foreach_(ut(),t)},t.prototype.foreach_=function(t,e){this.children.inorderTraversal((function(i,n){n.foreach_(gt(t,i),e)})),this.value&&e(t,this.value)},t.prototype.foreachChild=function(t){this.children.inorderTraversal((function(e,i){i.value&&t(e,i.value)}))},t}(),Xe=function(){function t(t){this.writeTree_=t}return t.empty=function(){return new t(new We(null))},t}();function Ye(t,e,i){if(yt(e))return new Xe(new We(i));var n=t.writeTree_.findRootMostValueAndPath(e);if(null!=n){var r=n.path,o=n.value,a=vt(r,e);return o=o.updateChild(a,i),new Xe(t.writeTree_.set(r,o))}var s=new We(i),h=t.writeTree_.setTree(e,s);return new Xe(h)}function qe(t,e,i){var n=t;return N(i,(function(t,i){n=Ye(n,gt(e,t),i)})),n}function Ke(t,e){if(yt(e))return Xe.empty();var i=t.writeTree_.setTree(e,new We(null));return new Xe(i)}function Je(t,e){return null!=Ze(t,e)}function Ze(t,e){var i=t.writeTree_.findRootMostValueAndPath(e);return null!=i?t.writeTree_.get(i.path).getChild(vt(i.path,e)):null}function Qe(t){var e=[],i=t.writeTree_.value;return null!=i?i.isLeafNode()||i.forEachChild(Yt,(function(t,i){e.push(new Mt(t,i))})):t.writeTree_.children.inorderTraversal((function(t,i){null!=i.value&&e.push(new Mt(t,i.value))})),e}function $e(t,e){if(yt(e))return t;var i=Ze(t,e);return new Xe(null!=i?new We(i):t.writeTree_.subtree(e))}function ti(t){return t.writeTree_.isEmpty()}function ei(t,e){return function t(e,i,n){if(null!=i.value)return n.updateChild(e,i.value);var r=null;return i.children.inorderTraversal((function(i,a){".priority"===i?(Object(o.d)(null!==a.value,"Priority writes must always be leaf nodes"),r=a.value):n=t(gt(e,i),a,n)})),n.getChild(e).isEmpty()||null===r||(n=n.updateChild(gt(e,".priority"),r)),n}(ut(),t.writeTree_,e)}function ii(t,e){return mi(e,t)}function ni(t,e){var i=t.allWrites.findIndex((function(t){return t.writeId===e}));Object(o.d)(i>=0,"removeWrite called with nonexistent writeId.");var n=t.allWrites[i];t.allWrites.splice(i,1);for(var r=n.visible,a=!1,s=t.allWrites.length-1;r&&s>=0;){var h=t.allWrites[s];h.visible&&(s>=i&&ri(h,n.path)?r=!1:wt(n.path,h.path)&&(a=!0)),s--}if(r){if(a)return function(t){t.visibleWrites=ai(t.allWrites,oi,ut()),t.allWrites.length>0?t.lastWriteId=t.allWrites[t.allWrites.length-1].writeId:t.lastWriteId=-1}(t),!0;n.snap?t.visibleWrites=Ke(t.visibleWrites,n.path):N(n.children,(function(e){t.visibleWrites=Ke(t.visibleWrites,gt(n.path,e))}));return!0}return!1}function ri(t,e){if(t.snap)return wt(t.path,e);for(var i in t.children)if(t.children.hasOwnProperty(i)&&wt(gt(t.path,i),e))return!0;return!1}function oi(t){return t.visible}function ai(t,e,i){for(var n=Xe.empty(),r=0;r<t.length;++r){var a=t[r];if(e(a)){var s=a.path,h=void 0;if(a.snap)wt(i,s)?n=Ye(n,h=vt(i,s),a.snap):wt(s,i)&&(h=vt(s,i),n=Ye(n,ut(),a.snap.getChild(h)));else{if(!a.children)throw Object(o.e)("WriteRecord should have .snap or .children");if(wt(i,s))n=qe(n,h=vt(i,s),a.children);else if(wt(s,i))if(yt(h=vt(s,i)))n=qe(n,ut(),a.children);else{var u=Object(o.z)(a.children,lt(h));if(u){var l=u.getChild(dt(h));n=Ye(n,ut(),l)}}}}}return n}function si(t,e,i,n,r){if(n||r){var o=$e(t.visibleWrites,e);if(!r&&ti(o))return i;if(r||null!=i||Je(o,ut())){return ei(ai(t.allWrites,(function(t){return(t.visible||r)&&(!n||!~n.indexOf(t.writeId))&&(wt(t.path,e)||wt(e,t.path))}),e),i||$t.EMPTY_NODE)}return null}var a=Ze(t.visibleWrites,e);if(null!=a)return a;var s=$e(t.visibleWrites,e);return ti(s)?i:null!=i||Je(s,ut())?ei(s,i||$t.EMPTY_NODE):null}function hi(t,e,i,n){return si(t.writeTree,t.treePath,e,i,n)}function ui(t,e){return function(t,e,i){var n=$t.EMPTY_NODE,r=Ze(t.visibleWrites,e);if(r)return r.isLeafNode()||r.forEachChild(Yt,(function(t,e){n=n.updateImmediateChild(t,e)})),n;if(i){var o=$e(t.visibleWrites,e);return i.forEachChild(Yt,(function(t,e){var i=ei($e(o,new ht(t)),e);n=n.updateImmediateChild(t,i)})),Qe(o).forEach((function(t){n=n.updateImmediateChild(t.name,t.node)})),n}return Qe($e(t.visibleWrites,e)).forEach((function(t){n=n.updateImmediateChild(t.name,t.node)})),n}(t.writeTree,t.treePath,e)}function li(t,e,i,n){return function(t,e,i,n,r){Object(o.d)(n||r,"Either existingEventSnap or existingServerSnap must exist");var a=gt(e,i);if(Je(t.visibleWrites,a))return null;var s=$e(t.visibleWrites,a);return ti(s)?r.getChild(i):ei(s,r.getChild(i))}(t.writeTree,t.treePath,e,i,n)}function ci(t,e){return function(t,e){return Ze(t.visibleWrites,e)}(t.writeTree,gt(t.treePath,e))}function di(t,e,i,n,r,o){return function(t,e,i,n,r,o,a){var s,h=$e(t.visibleWrites,e),u=Ze(h,ut());if(null!=u)s=u;else{if(null==i)return[];s=ei(h,i)}if((s=s.withIndex(a)).isEmpty()||s.isLeafNode())return[];for(var l=[],c=a.getCompare(),d=o?s.getReverseIteratorFrom(n,a):s.getIteratorFrom(n,a),p=d.getNext();p&&l.length<r;)0!==c(p,n)&&l.push(p),p=d.getNext();return l}(t.writeTree,t.treePath,e,i,n,r,o)}function pi(t,e,i){return function(t,e,i,n){var r=gt(e,i),o=Ze(t.visibleWrites,r);return null!=o?o:n.isCompleteForChild(i)?ei($e(t.visibleWrites,r),n.getNode().getImmediateChild(i)):null}(t.writeTree,t.treePath,e,i)}function fi(t,e){return mi(gt(t.treePath,e),t.writeTree)}function mi(t,e){return{treePath:t,writeTree:e}}var gi=function(){function t(){this.changeMap=new Map}return t.prototype.trackChildChange=function(t){var e=t.type,i=t.childName;Object(o.d)("child_added"===e||"child_changed"===e||"child_removed"===e,"Only child changes supported for tracking"),Object(o.d)(".priority"!==i,"Only non-priority child changes can be tracked.");var n=this.changeMap.get(i);if(n){var r=n.type;if("child_added"===e&&"child_removed"===r)this.changeMap.set(i,pe(i,t.snapshotNode,n.snapshotNode));else if("child_removed"===e&&"child_added"===r)this.changeMap.delete(i);else if("child_removed"===e&&"child_changed"===r)this.changeMap.set(i,de(i,n.oldSnap));else if("child_changed"===e&&"child_added"===r)this.changeMap.set(i,ce(i,t.snapshotNode));else{if("child_changed"!==e||"child_changed"!==r)throw Object(o.e)("Illegal combination of changes: "+t+" occurred after "+n);this.changeMap.set(i,pe(i,t.snapshotNode,n.oldSnap))}}else this.changeMap.set(i,t)},t.prototype.getChanges=function(){return Array.from(this.changeMap.values())},t}(),yi=new(function(){function t(){}return t.prototype.getCompleteChild=function(t){return null},t.prototype.getChildAfterChild=function(t,e,i){return null},t}()),vi=function(){function t(t,e,i){void 0===i&&(i=null),this.writes_=t,this.viewCache_=e,this.optCompleteServerCache_=i}return t.prototype.getCompleteChild=function(t){var e=this.viewCache_.eventCache;if(e.isCompleteForChild(t))return e.getNode().getImmediateChild(t);var i=null!=this.optCompleteServerCache_?new Be(this.optCompleteServerCache_,!0,!1):this.viewCache_.serverCache;return pi(this.writes_,t,i)},t.prototype.getChildAfterChild=function(t,e,i){var n=null!=this.optCompleteServerCache_?this.optCompleteServerCache_:Ve(this.viewCache_),r=di(this.writes_,n,e,1,i,t);return 0===r.length?null:r[0]},t}();function bi(t,e,i,n,r){var a,s,h=new gi;if(i.type===Pe.OVERWRITE){var u=i;u.source.fromUser?a=xi(t,e,u.path,u.snap,n,r,h):(Object(o.d)(u.source.fromServer,"Unknown source."),s=u.source.tagged||e.serverCache.isFiltered()&&!yt(u.path),a=wi(t,e,u.path,u.snap,n,r,s,h))}else if(i.type===Pe.MERGE){var l=i;l.source.fromUser?a=function(t,e,i,n,r,o,a){var s=e;return n.foreach((function(n,h){var u=gt(i,n);Ci(e,lt(u))&&(s=xi(t,s,u,h,r,o,a))})),n.foreach((function(n,h){var u=gt(i,n);Ci(e,lt(u))||(s=xi(t,s,u,h,r,o,a))})),s}(t,e,l.path,l.children,n,r,h):(Object(o.d)(l.source.fromServer,"Unknown source."),s=l.source.tagged||e.serverCache.isFiltered(),a=Ti(t,e,l.path,l.children,n,r,s,h))}else if(i.type===Pe.ACK_USER_WRITE){var c=i;a=c.revert?function(t,e,i,n,r,a){var s;if(null!=ci(n,i))return e;var h=new vi(n,e,r),u=e.eventCache.getNode(),l=void 0;if(yt(i)||".priority"===lt(i)){var c=void 0;if(e.serverCache.isFullyInitialized())c=hi(n,Ve(e));else{var d=e.serverCache.getNode();Object(o.d)(d instanceof $t,"serverChildren would be complete if leaf node"),c=ui(n,d)}c=c,l=t.filter.updateFullNode(u,c,a)}else{var p=lt(i),f=pi(n,p,e.serverCache);null==f&&e.serverCache.isCompleteForChild(p)&&(f=u.getImmediateChild(p)),(l=null!=f?t.filter.updateChild(u,p,f,dt(i),h,a):e.eventCache.getNode().hasChild(p)?t.filter.updateChild(u,p,$t.EMPTY_NODE,dt(i),h,a):u).isEmpty()&&e.serverCache.isFullyInitialized()&&(s=hi(n,Ve(e))).isLeafNode()&&(l=t.filter.updateFullNode(l,s,a))}return s=e.serverCache.isFullyInitialized()||null!=ci(n,ut()),Ge(e,l,s,t.filter.filtersNodes())}(t,e,c.path,n,r,h):function(t,e,i,n,r,o,a){if(null!=ci(r,i))return e;var s=e.serverCache.isFiltered(),h=e.serverCache;if(null!=n.value){if(yt(i)&&h.isFullyInitialized()||h.isCompleteForPath(i))return wi(t,e,i,h.getNode().getChild(i),r,o,s,a);if(yt(i)){var u=new We(null);return h.getNode().forEachChild(Ot,(function(t,e){u=u.set(new ht(t),e)})),Ti(t,e,i,u,r,o,s,a)}return e}var l=new We(null);return n.foreach((function(t,e){var n=gt(i,t);h.isCompleteForPath(n)&&(l=l.set(t,h.getNode().getChild(n)))})),Ti(t,e,i,l,r,o,s,a)}(t,e,c.path,c.affectedTree,n,r,h)}else{if(i.type!==Pe.LISTEN_COMPLETE)throw Object(o.e)("Unknown operation type: "+i.type);a=function(t,e,i,n,r){var o=e.serverCache,a=Ue(e,o.getNode(),o.isFullyInitialized()||yt(i),o.isFiltered());return _i(t,a,i,n,yi,r)}(t,e,i.path,n,h)}var d=h.getChanges();return function(t,e,i){var n=e.eventCache;if(n.isFullyInitialized()){var r=n.getNode().isLeafNode()||n.getNode().isEmpty(),o=He(t);(i.length>0||!t.eventCache.isFullyInitialized()||r&&!n.getNode().equals(o)||!n.getNode().getPriority().equals(o.getPriority()))&&i.push(le(He(e)))}}(e,a,d),{viewCache:a,changes:d}}function _i(t,e,i,n,r,a){var s=e.eventCache;if(null!=ci(n,i))return e;var h=void 0,u=void 0;if(yt(i))if(Object(o.d)(e.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),e.serverCache.isFiltered()){var l=Ve(e),c=ui(n,l instanceof $t?l:$t.EMPTY_NODE);h=t.filter.updateFullNode(e.eventCache.getNode(),c,a)}else{var d=hi(n,Ve(e));h=t.filter.updateFullNode(e.eventCache.getNode(),d,a)}else{var p=lt(i);if(".priority"===p){Object(o.d)(1===ct(i),"Can't have a priority with additional path components");var f=s.getNode(),m=li(n,i,f,u=e.serverCache.getNode());h=null!=m?t.filter.updatePriority(f,m):s.getNode()}else{var g=dt(i),y=void 0;if(s.isCompleteForChild(p)){u=e.serverCache.getNode();var v=li(n,i,s.getNode(),u);y=null!=v?s.getNode().getImmediateChild(p).updateChild(g,v):s.getNode().getImmediateChild(p)}else y=pi(n,p,e.serverCache);h=null!=y?t.filter.updateChild(s.getNode(),p,y,g,r,a):s.getNode()}}return Ge(e,h,s.isFullyInitialized()||yt(i),t.filter.filtersNodes())}function wi(t,e,i,n,r,o,a,s){var h,u=e.serverCache,l=a?t.filter:t.filter.getIndexedFilter();if(yt(i))h=l.updateFullNode(u.getNode(),n,null);else if(l.filtersNodes()&&!u.isFiltered()){var c=u.getNode().updateChild(i,n);h=l.updateFullNode(u.getNode(),c,null)}else{var d=lt(i);if(!u.isCompleteForPath(i)&&ct(i)>1)return e;var p=dt(i),f=u.getNode().getImmediateChild(d).updateChild(p,n);h=".priority"===d?l.updatePriority(u.getNode(),f):l.updateChild(u.getNode(),d,f,p,yi,null)}var m=Ue(e,h,u.isFullyInitialized()||yt(i),l.filtersNodes());return _i(t,m,i,r,new vi(r,m,o),s)}function xi(t,e,i,n,r,o,a){var s,h,u=e.eventCache,l=new vi(r,e,o);if(yt(i))h=t.filter.updateFullNode(e.eventCache.getNode(),n,a),s=Ge(e,h,!0,t.filter.filtersNodes());else{var c=lt(i);if(".priority"===c)h=t.filter.updatePriority(e.eventCache.getNode(),n),s=Ge(e,h,u.isFullyInitialized(),u.isFiltered());else{var d=dt(i),p=u.getNode().getImmediateChild(c),f=void 0;if(yt(d))f=n;else{var m=l.getCompleteChild(c);f=null!=m?".priority"===pt(d)&&m.getChild(mt(d)).isEmpty()?m:m.updateChild(d,n):$t.EMPTY_NODE}if(p.equals(f))s=e;else s=Ge(e,t.filter.updateChild(u.getNode(),c,f,d,l,a),u.isFullyInitialized(),t.filter.filtersNodes())}}return s}function Ci(t,e){return t.eventCache.isCompleteForChild(e)}function Si(t,e,i){return i.foreach((function(t,i){e=e.updateChild(t,i)})),e}function Ti(t,e,i,n,r,o,a,s){if(e.serverCache.getNode().isEmpty()&&!e.serverCache.isFullyInitialized())return e;var h,u=e;h=yt(i)?n:new We(null).setTree(i,n);var l=e.serverCache.getNode();return h.children.inorderTraversal((function(i,n){if(l.hasChild(i)){var h=Si(0,e.serverCache.getNode().getImmediateChild(i),n);u=wi(t,u,new ht(i),h,r,o,a,s)}})),h.children.inorderTraversal((function(i,n){var h=!e.serverCache.isCompleteForChild(i)&&void 0===n.value;if(!l.hasChild(i)&&!h){var c=Si(0,e.serverCache.getNode().getImmediateChild(i),n);u=wi(t,u,new ht(i),c,r,o,a,s)}})),u}var Ai,Ei=function(){function t(t,e){this.query_=t,this.eventRegistrations_=[];var i,n=this.query_._queryParams,r=new fe(n.getIndex()),o=(i=n).loadsAllData()?new fe(i.getIndex()):i.hasLimit()?new ge(i):new me(i);this.processor_=function(t){return{filter:t}}(o);var a=e.serverCache,s=e.eventCache,h=r.updateFullNode($t.EMPTY_NODE,a.getNode(),null),u=o.updateFullNode($t.EMPTY_NODE,s.getNode(),null),l=new Be(h,a.isFullyInitialized(),r.filtersNodes()),c=new Be(u,s.isFullyInitialized(),o.filtersNodes());this.viewCache_=je(c,l),this.eventGenerator_=new Fe(this.query_)}return Object.defineProperty(t.prototype,"query",{get:function(){return this.query_},enumerable:!1,configurable:!0}),t}();function Pi(t,e){var i=Ve(t.viewCache_);return i&&(t.query._queryParams.loadsAllData()||!yt(e)&&!i.getImmediateChild(lt(e)).isEmpty())?i.getChild(e):null}function Mi(t){return 0===t.eventRegistrations_.length}function Ii(t,e,i){var n=[];if(i){Object(o.d)(null==e,"A cancel should cancel all event registrations.");var r=t.query._path;t.eventRegistrations_.forEach((function(t){var e=t.createCancelEvent(i,r);e&&n.push(e)}))}if(e){for(var a=[],s=0;s<t.eventRegistrations_.length;++s){var h=t.eventRegistrations_[s];if(h.matches(e)){if(e.hasAnyCallback()){a=a.concat(t.eventRegistrations_.slice(s+1));break}}else a.push(h)}t.eventRegistrations_=a}else t.eventRegistrations_=[];return n}function ki(t,e,i,n){e.type===Pe.MERGE&&null!==e.source.queryId&&(Object(o.d)(Ve(t.viewCache_),"We should always have a full cache before handling merges"),Object(o.d)(He(t.viewCache_),"Missing event cache, even though we have a server cache"));var r,a,s=t.viewCache_,h=bi(t.processor_,s,e,i,n);return r=t.processor_,a=h.viewCache,Object(o.d)(a.eventCache.getNode().isIndexed(r.filter.getIndex()),"Event snap not indexed"),Object(o.d)(a.serverCache.getNode().isIndexed(r.filter.getIndex()),"Server snap not indexed"),Object(o.d)(h.viewCache.serverCache.isFullyInitialized()||!s.serverCache.isFullyInitialized(),"Once a server snap is complete, it should never go back"),t.viewCache_=h.viewCache,Oi(t,h.changes,h.viewCache.eventCache.getNode(),null)}function Oi(t,e,i,n){var r=n?[n]:t.eventRegistrations_;return function(t,e,i,n){var r=[],o=[];return e.forEach((function(e){var i;"child_changed"===e.type&&t.index_.indexedValueChanged(e.oldSnap,e.snapshotNode)&&o.push((i=e.childName,{type:"child_moved",snapshotNode:e.snapshotNode,childName:i}))})),ze(t,r,"child_removed",e,n,i),ze(t,r,"child_added",e,n,i),ze(t,r,"child_moved",o,n,i),ze(t,r,"child_changed",e,n,i),ze(t,r,"value",e,n,i),r}(t.eventGenerator_,e,i,r)}var Ri,Di=function(){this.views=new Map};function Li(t,e,i,n){var r,s,h=e.source.queryId;if(null!==h){var u=t.views.get(h);return Object(o.d)(null!=u,"SyncTree gave us an op for an invalid query."),ki(u,e,i,n)}var l=[];try{for(var c=Object(a.g)(t.views.values()),d=c.next();!d.done;d=c.next()){u=d.value;l=l.concat(ki(u,e,i,n))}}catch(t){r={error:t}}finally{try{d&&!d.done&&(s=c.return)&&s.call(c)}finally{if(r)throw r.error}}return l}function Ni(t,e,i,n,r){var o=e._queryIdentifier,a=t.views.get(o);if(!a){var s=hi(i,r?n:null),h=!1;s?h=!0:n instanceof $t?(s=ui(i,n),h=!1):(s=$t.EMPTY_NODE,h=!1);var u=je(new Be(s,h,!1),new Be(n,r,!1));return new Ei(e,u)}return a}function Bi(t,e,i,n,r,o){var a=Ni(t,e,n,r,o);return t.views.has(e._queryIdentifier)||t.views.set(e._queryIdentifier,a),function(t,e){t.eventRegistrations_.push(e)}(a,i),function(t,e){var i=t.viewCache_.eventCache,n=[];return i.getNode().isLeafNode()||i.getNode().forEachChild(Yt,(function(t,e){n.push(ce(t,e))})),i.isFullyInitialized()&&n.push(le(i.getNode())),Oi(t,n,i.getNode(),e)}(a,i)}function Fi(t,e,i,n){var r,s,h=e._queryIdentifier,u=[],l=[],c=Hi(t);if("default"===h)try{for(var d=Object(a.g)(t.views.entries()),p=d.next();!p.done;p=d.next()){var f=Object(a.e)(p.value,2),m=f[0],g=f[1];l=l.concat(Ii(g,i,n)),Mi(g)&&(t.views.delete(m),g.query._queryParams.loadsAllData()||u.push(g.query))}}catch(t){r={error:t}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(r)throw r.error}}else(g=t.views.get(h))&&(l=l.concat(Ii(g,i,n)),Mi(g)&&(t.views.delete(h),g.query._queryParams.loadsAllData()||u.push(g.query)));return c&&!Hi(t)&&u.push(new(Object(o.d)(Ai,"Reference.ts has not been loaded"),Ai)(e._repo,e._path)),{removed:u,events:l}}function zi(t){var e,i,n=[];try{for(var r=Object(a.g)(t.views.values()),o=r.next();!o.done;o=r.next()){var s=o.value;s.query._queryParams.loadsAllData()||n.push(s)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}return n}function ji(t,e){var i,n,r=null;try{for(var o=Object(a.g)(t.views.values()),s=o.next();!s.done;s=o.next()){var h=s.value;r=r||Pi(h,e)}}catch(t){i={error:t}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return r}function Gi(t,e){if(e._queryParams.loadsAllData())return Vi(t);var i=e._queryIdentifier;return t.views.get(i)}function Ui(t,e){return null!=Gi(t,e)}function Hi(t){return null!=Vi(t)}function Vi(t){var e,i;try{for(var n=Object(a.g)(t.views.values()),r=n.next();!r.done;r=n.next()){var o=r.value;if(o.query._queryParams.loadsAllData())return o}}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}return null}var Wi=1,Xi=function(t){this.listenProvider_=t,this.syncPointTree_=new We(null),this.pendingWriteTree_={visibleWrites:Xe.empty(),allWrites:[],lastWriteId:-1},this.tagToQueryMap=new Map,this.queryToTagMap=new Map};function Yi(t,e,i,n,r){return function(t,e,i,n,r){Object(o.d)(n>t.lastWriteId,"Stacking an older write on top of newer ones"),void 0===r&&(r=!0),t.allWrites.push({path:e,snap:i,writeId:n,visible:r}),r&&(t.visibleWrites=Ye(t.visibleWrites,e,i)),t.lastWriteId=n}(t.pendingWriteTree_,e,i,n,r),r?en(t,new Le({fromUser:!0,fromServer:!1,queryId:null,tagged:!1},e,i)):[]}function qi(t,e,i,n){!function(t,e,i,n){Object(o.d)(n>t.lastWriteId,"Stacking an older merge on top of newer ones"),t.allWrites.push({path:e,children:i,writeId:n,visible:!0}),t.visibleWrites=qe(t.visibleWrites,e,i),t.lastWriteId=n}(t.pendingWriteTree_,e,i,n);var r=We.fromObject(i);return en(t,new Ne({fromUser:!0,fromServer:!1,queryId:null,tagged:!1},e,r))}function Ki(t,e,i){void 0===i&&(i=!1);var n=function(t,e){for(var i=0;i<t.allWrites.length;i++){var n=t.allWrites[i];if(n.writeId===e)return n}return null}(t.pendingWriteTree_,e);if(ni(t.pendingWriteTree_,e)){var r=new We(null);return null!=n.snap?r=r.set(ut(),!0):N(n.children,(function(t){r=r.set(new ht(t),!0)})),en(t,new Re(n.path,r,i))}return[]}function Ji(t,e,i){return en(t,new Le({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},e,i))}function Zi(t,e,i,n){var r=e._path,o=t.syncPointTree_.get(r),a=[];if(o&&("default"===e._queryIdentifier||Ui(o,e))){var s=Fi(o,e,i,n);0===o.views.size&&(t.syncPointTree_=t.syncPointTree_.remove(r));var h=s.removed;a=s.events;var u=-1!==h.findIndex((function(t){return t._queryParams.loadsAllData()})),l=t.syncPointTree_.findOnPath(r,(function(t,e){return Hi(e)}));if(u&&!l){var c=t.syncPointTree_.subtree(r);if(!c.isEmpty())for(var d=function(t){return t.fold((function(t,e,i){if(e&&Hi(e))return[Vi(e)];var n=[];return e&&(n=zi(e)),N(i,(function(t,e){n=n.concat(e)})),n}))}(c),p=0;p<d.length;++p){var f=d[p],m=f.query,g=nn(t,f);t.listenProvider_.startListening(un(m),rn(t,m),g.hashFn,g.onComplete)}}if(!l&&h.length>0&&!n)if(u){t.listenProvider_.stopListening(un(e),null)}else h.forEach((function(e){var i=t.queryToTagMap.get(on(e));t.listenProvider_.stopListening(un(e),i)}));!function(t,e){for(var i=0;i<e.length;++i){var n=e[i];if(!n._queryParams.loadsAllData()){var r=on(n),o=t.queryToTagMap.get(r);t.queryToTagMap.delete(r),t.tagToQueryMap.delete(o)}}}(t,h)}return a}function Qi(t,e,i){var n=e._path,r=null,a=!1;t.syncPointTree_.foreachOnPath(n,(function(t,e){var i=vt(t,n);r=r||ji(e,i),a=a||Hi(e)}));var s,h=t.syncPointTree_.get(n);(h?(a=a||Hi(h),r=r||ji(h,ut())):(h=new Di,t.syncPointTree_=t.syncPointTree_.set(n,h)),null!=r)?s=!0:(s=!1,r=$t.EMPTY_NODE,t.syncPointTree_.subtree(n).foreachChild((function(t,e){var i=ji(e,ut());i&&(r=r.updateImmediateChild(t,i))})));var u=Ui(h,e);if(!u&&!e._queryParams.loadsAllData()){var l=on(e);Object(o.d)(!t.queryToTagMap.has(l),"View does not exist, but we have a tag");var c=Wi++;t.queryToTagMap.set(l,c),t.tagToQueryMap.set(c,l)}var d=Bi(h,e,i,ii(t.pendingWriteTree_,n),r,s);if(!u&&!a){var p=Gi(h,e);d=d.concat(function(t,e,i){var n=e._path,r=rn(t,e),a=nn(t,i),s=t.listenProvider_.startListening(un(e),r,a.hashFn,a.onComplete),h=t.syncPointTree_.subtree(n);if(r)Object(o.d)(!Hi(h.value),"If we're adding a query, it shouldn't be shadowed");else for(var u=h.fold((function(t,e,i){if(!yt(t)&&e&&Hi(e))return[Vi(e).query];var n=[];return e&&(n=n.concat(zi(e).map((function(t){return t.query})))),N(i,(function(t,e){n=n.concat(e)})),n})),l=0;l<u.length;++l){var c=u[l];t.listenProvider_.stopListening(un(c),rn(t,c))}return s}(t,e,p))}return d}function $i(t,e,i){var n=t.pendingWriteTree_,r=t.syncPointTree_.findOnPath(e,(function(t,i){var n=ji(i,vt(t,e));if(n)return n}));return si(n,e,r,i,!0)}function tn(t,e){var i=e._path,n=null;t.syncPointTree_.foreachOnPath(i,(function(t,e){var r=vt(t,i);n=n||ji(e,r)}));var r=t.syncPointTree_.get(i);r?n=n||ji(r,ut()):(r=new Di,t.syncPointTree_=t.syncPointTree_.set(i,r));var o=null!=n,a=o?new Be(n,!0,!1):null;return function(t){return He(t.viewCache_)}(Ni(r,e,ii(t.pendingWriteTree_,e._path),o?a.getNode():$t.EMPTY_NODE,o))}function en(t,e){return function t(e,i,n,r){if(yt(e.path))return function t(e,i,n,r){var o=i.get(ut());null==n&&null!=o&&(n=ji(o,ut()));var a=[];i.children.inorderTraversal((function(i,o){var s=n?n.getImmediateChild(i):null,h=fi(r,i),u=e.operationForChild(i);u&&(a=a.concat(t(u,o,s,h)))})),o&&(a=a.concat(Li(o,e,r,n)));return a}(e,i,n,r);var o=i.get(ut());null==n&&null!=o&&(n=ji(o,ut()));var a=[],s=lt(e.path),h=e.operationForChild(s),u=i.children.get(s);if(u&&h){var l=n?n.getImmediateChild(s):null,c=fi(r,s);a=a.concat(t(h,u,l,c))}return o&&(a=a.concat(Li(o,e,r,n))),a}(e,t.syncPointTree_,null,ii(t.pendingWriteTree_,ut()))}function nn(t,e){var i=e.query,n=rn(t,i);return{hashFn:function(){return(function(t){return t.viewCache_.serverCache.getNode()}(e)||$t.EMPTY_NODE).hash()},onComplete:function(e){if("ok"===e)return n?function(t,e,i){var n=an(t,i);if(n){var r=sn(n),o=r.path,a=r.queryId,s=vt(o,e);return hn(t,o,new De(ke(a),s))}return[]}(t,i._path,n):function(t,e){return en(t,new De({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},e))}(t,i._path);var r=function(t,e){var i="Unknown Error";"too_big"===t?i="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"===t?i="Client doesn't have permission to access the desired data.":"unavailable"===t&&(i="The service is unavailable");var n=new Error(t+" at "+e._path.toString()+": "+i);return n.code=t.toUpperCase(),n}(e,i);return Zi(t,i,null,r)}}}function rn(t,e){var i=on(e);return t.queryToTagMap.get(i)}function on(t){return t._path.toString()+"$"+t._queryIdentifier}function an(t,e){return t.tagToQueryMap.get(e)}function sn(t){var e=t.indexOf("$");return Object(o.d)(-1!==e&&e<t.length-1,"Bad queryKey."),{queryId:t.substr(e+1),path:new ht(t.substr(0,e))}}function hn(t,e,i){var n=t.syncPointTree_.get(e);return Object(o.d)(n,"Missing sync point for query tag that we're tracking"),Li(n,i,ii(t.pendingWriteTree_,e),null)}function un(t){return t._queryParams.loadsAllData()&&!t._queryParams.isDefault()?new(Object(o.d)(Ri,"Reference.ts has not been loaded"),Ri)(t._repo,t._path):t}var ln=function(){function t(t){this.node_=t}return t.prototype.getImmediateChild=function(e){return new t(this.node_.getImmediateChild(e))},t.prototype.node=function(){return this.node_},t}(),cn=function(){function t(t,e){this.syncTree_=t,this.path_=e}return t.prototype.getImmediateChild=function(e){var i=gt(this.path_,e);return new t(this.syncTree_,i)},t.prototype.node=function(){return $i(this.syncTree_,this.path_)},t}(),dn=function(t,e,i){return t&&"object"==typeof t?(Object(o.d)(".sv"in t,"Unexpected leaf node or priority contents"),"string"==typeof t[".sv"]?pn(t[".sv"],e,i):"object"==typeof t[".sv"]?fn(t[".sv"],e):void Object(o.d)(!1,"Unexpected server value: "+JSON.stringify(t,null,2))):t},pn=function(t,e,i){switch(t){case"timestamp":return i.timestamp;default:Object(o.d)(!1,"Unexpected server value: "+t)}},fn=function(t,e,i){t.hasOwnProperty("increment")||Object(o.d)(!1,"Unexpected server value: "+JSON.stringify(t,null,2));var n=t.increment;"number"!=typeof n&&Object(o.d)(!1,"Unexpected increment value: "+n);var r=e.node();if(Object(o.d)(null!=r,"Expected ChildrenNode.EMPTY_NODE for nulls"),!r.isLeafNode())return n;var a=r.getValue();return"number"!=typeof a?n:a+n},mn=function(t,e,i,n){return yn(e,new cn(i,t),n)},gn=function(t,e,i){return yn(t,new ln(e),i)};function yn(t,e,i){var n,r=t.getPriority().val(),o=dn(r,e.getImmediateChild(".priority"),i);if(t.isLeafNode()){var a=t,s=dn(a.getValue(),e,i);return s!==a.getValue()||o!==a.getPriority().val()?new Vt(s,ee(o)):t}var h=t;return n=h,o!==h.getPriority().val()&&(n=n.updatePriority(new Vt(o))),h.forEachChild(Yt,(function(t,r){var o=yn(r,e.getImmediateChild(t),i);o!==r&&(n=n.updateImmediateChild(t,o))})),n}var vn=function(t,e,i){void 0===t&&(t=""),void 0===e&&(e=null),void 0===i&&(i={children:{},childCount:0}),this.name=t,this.parent=e,this.node=i};function bn(t,e){for(var i=e instanceof ht?e:new ht(e),n=t,r=lt(i);null!==r;){var a=Object(o.z)(n.node.children,r)||{children:{},childCount:0};n=new vn(r,n,a),r=lt(i=dt(i))}return n}function _n(t){return t.node.value}function wn(t,e){t.node.value=e,Tn(t)}function xn(t){return t.node.childCount>0}function Cn(t,e){N(t.node.children,(function(i,n){e(new vn(i,t,n))}))}function Sn(t){return new ht(null===t.parent?t.name:Sn(t.parent)+"/"+t.name)}function Tn(t){null!==t.parent&&function(t,e,i){var n=function(t){return void 0===_n(t)&&!xn(t)}(i),r=Object(o.h)(t.node.children,e);n&&r?(delete t.node.children[e],t.node.childCount--,Tn(t)):n||r||(t.node.children[e]=i.node,t.node.childCount++,Tn(t))}(t.parent,t.name,t)}var An=/[\[\].#$\/\u0000-\u001F\u007F]/,En=/[\[\].#$\u0000-\u001F\u007F]/,Pn=function(t){return"string"==typeof t&&0!==t.length&&!An.test(t)},Mn=function(t){return"string"==typeof t&&0!==t.length&&!En.test(t)},In=function(t){return null===t||"string"==typeof t||"number"==typeof t&&!P(t)||t&&"object"==typeof t&&Object(o.h)(t,".sv")},kn=function(t,e,i,n){n&&void 0===e||On(Object(o.m)(t,"value"),e,i)},On=function(t,e,i){var n=i instanceof ht?new xt(i,t):i;if(void 0===e)throw new Error(t+"contains undefined "+St(n));if("function"==typeof e)throw new Error(t+"contains a function "+St(n)+" with contents = "+e.toString());if(P(e))throw new Error(t+"contains "+e.toString()+" "+St(n));if("string"==typeof e&&e.length>10485760/3&&Object(o.A)(e)>10485760)throw new Error(t+"contains a string greater than 10485760 utf8 bytes "+St(n)+" ('"+e.substring(0,50)+"...')");if(e&&"object"==typeof e){var r=!1,a=!1;if(N(e,(function(e,i){if(".value"===e)r=!0;else if(".priority"!==e&&".sv"!==e&&(a=!0,!Pn(e)))throw new Error(t+" contains an invalid key ("+e+") "+St(n)+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');var s,h;!function(t,e){t.parts_.length>0&&(t.byteLength_+=1),t.parts_.push(e),t.byteLength_+=Object(o.A)(e),Ct(t)}(n,e),On(t,i,n),h=(s=n).parts_.pop(),s.byteLength_-=Object(o.A)(h),s.parts_.length>0&&(s.byteLength_-=1)})),r&&a)throw new Error(t+' contains ".value" child '+St(n)+" in addition to actual children.")}},Rn=function(t,e,i,n){if(!n||void 0!==e){var r=Object(o.m)(t,"values");if(!e||"object"!=typeof e||Array.isArray(e))throw new Error(r+" must be an object containing the children to replace.");var a=[];N(e,(function(t,e){var n=new ht(t);if(On(r,e,gt(i,n)),".priority"===pt(n)&&!In(e))throw new Error(r+"contains an invalid value for '"+n.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");a.push(n)})),function(t,e){var i,n;for(i=0;i<e.length;i++)for(var r=ft(n=e[i]),o=0;o<r.length;o++)if(".priority"===r[o]&&o===r.length-1);else if(!Pn(r[o]))throw new Error(t+"contains an invalid key ("+r[o]+") in path "+n.toString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');e.sort(bt);var a=null;for(i=0;i<e.length;i++){if(n=e[i],null!==a&&wt(a,n))throw new Error(t+"contains a path "+a.toString()+" that is ancestor of another path "+n.toString());a=n}}(r,a)}},Dn=function(t,e,i){if(!i||void 0!==e){if(P(e))throw new Error(Object(o.m)(t,"priority")+"is "+e.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!In(e))throw new Error(Object(o.m)(t,"priority")+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},Ln=function(t,e,i){if(!i||void 0!==e)switch(e){case"value":case"child_added":case"child_removed":case"child_changed":case"child_moved":break;default:throw new Error(Object(o.m)(t,"eventType")+'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".')}},Nn=function(t,e,i,n){if(!(n&&void 0===i||Pn(i)))throw new Error(Object(o.m)(t,e)+'was an invalid key = "'+i+'". Firebase keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]").')},Bn=function(t,e,i,n){if(!(n&&void 0===i||Mn(i)))throw new Error(Object(o.m)(t,e)+'was an invalid path = "'+i+'". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"')},Fn=function(t,e){if(".info"===lt(e))throw new Error(t+" failed = Can't modify data under /.info/")},zn=function(t,e){var i=e.path.toString();if("string"!=typeof e.repoInfo.host||0===e.repoInfo.host.length||!Pn(e.repoInfo.namespace)&&"localhost"!==e.repoInfo.host.split(":")[0]||0!==i.length&&!function(t){return t&&(t=t.replace(/^\/*\.info(\/|$)/,"/")),Mn(t)}(i))throw new Error(Object(o.m)(t,"url")+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".')},jn=function(t,e,i,n){if((!n||void 0!==i)&&"boolean"!=typeof i)throw new Error(Object(o.m)(t,e)+"must be a boolean.")},Gn=function(){this.eventLists_=[],this.recursionDepth_=0};function Un(t,e){for(var i=null,n=0;n<e.length;n++){var r=e[n],o=r.getPath();null===i||_t(o,i.path)||(t.eventLists_.push(i),i=null),null===i&&(i={events:[],path:o}),i.events.push(r)}i&&t.eventLists_.push(i)}function Hn(t,e,i){Un(t,i),Wn(t,(function(t){return _t(t,e)}))}function Vn(t,e,i){Un(t,i),Wn(t,(function(t){return wt(t,e)||wt(e,t)}))}function Wn(t,e){t.recursionDepth_++;for(var i=!0,n=0;n<t.eventLists_.length;n++){var r=t.eventLists_[n];if(r)e(r.path)?(Xn(t.eventLists_[n]),t.eventLists_[n]=null):i=!1}i&&(t.eventLists_=[]),t.recursionDepth_--}function Xn(t){for(var e=0;e<t.events.length;e++){var i=t.events[e];if(null!==i){t.events[e]=null;var n=i.getEventRunner();_&&C("event: "+i.toString()),j(n)}}}var Yn=function(){function t(t,e,i,n){this.repoInfo_=t,this.forceRestClient_=e,this.authTokenProvider_=i,this.appCheckProvider_=n,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new Gn,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=Te(),this.transactionQueueTree_=new vn,this.persistentConnection_=null,this.key=this.repoInfo_.toURLString()}return t.prototype.toString=function(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host},t}();function qn(t,e,i){if(t.stats_=Z(t.repoInfo_),t.forceRestClient_||("object"==typeof window&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0)t.server_=new Ce(t.repoInfo_,(function(e,i,n,r){Zn(t,e,i,n,r)}),t.authTokenProvider_,t.appCheckProvider_),setTimeout((function(){return Qn(t,!0)}),0);else{if(null!=i){if("object"!=typeof i)throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{Object(o.C)(i)}catch(t){throw new Error("Invalid authOverride provided: "+t)}}t.persistentConnection_=new Pt(t.repoInfo_,e,(function(e,i,n,r){Zn(t,e,i,n,r)}),(function(e){Qn(t,e)}),(function(e){!function(t,e){N(e,(function(e,i){$n(t,e,i)}))}(t,e)}),t.authTokenProvider_,t.appCheckProvider_,i),t.server_=t.persistentConnection_}var n,r,a;t.authTokenProvider_.addTokenChangeListener((function(e){t.server_.refreshAuthToken(e)})),t.appCheckProvider_.addTokenChangeListener((function(e){t.server_.refreshAppCheckToken(e.token)})),t.statsReporter_=(n=t.repoInfo_,r=function(){return new Ie(t.stats_,t.server_)},a=n.toString(),J[a]||(J[a]=r()),J[a]),t.infoData_=new Se,t.infoSyncTree_=new Xi({startListening:function(e,i,n,r){var o=[],a=t.infoData_.getNode(e._path);return a.isEmpty()||(o=Ji(t.infoSyncTree_,e._path,a),setTimeout((function(){r("ok")}),0)),o},stopListening:function(){}}),$n(t,"connected",!1),t.serverSyncTree_=new Xi({startListening:function(e,i,n,r){return t.server_.listen(e,n,i,(function(i,n){var o=r(i,n);Vn(t.eventQueue_,e._path,o)})),[]},stopListening:function(e,i){t.server_.unlisten(e,i)}})}function Kn(t){var e=t.infoData_.getNode(new ht(".info/serverTimeOffset")).val()||0;return(new Date).getTime()+e}function Jn(t){return(e=(e={timestamp:Kn(t)})||{}).timestamp=e.timestamp||(new Date).getTime(),e;var e}function Zn(t,e,i,n,r){t.dataUpdateCount++;var a=new ht(e);i=t.interceptServerDataCallback_?t.interceptServerDataCallback_(e,i):i;var s=[];if(r)if(n){var h=Object(o.x)(i,(function(t){return ee(t)}));s=function(t,e,i,n){var r=an(t,n);if(r){var o=sn(r),a=o.path,s=o.queryId,h=vt(a,e),u=We.fromObject(i);return hn(t,a,new Ne(ke(s),h,u))}return[]}(t.serverSyncTree_,a,h,r)}else{var u=ee(i);s=function(t,e,i,n){var r=an(t,n);if(null!=r){var o=sn(r),a=o.path,s=o.queryId,h=vt(a,e);return hn(t,a,new Le(ke(s),h,i))}return[]}(t.serverSyncTree_,a,u,r)}else if(n){var l=Object(o.x)(i,(function(t){return ee(t)}));s=function(t,e,i){var n=We.fromObject(i);return en(t,new Ne({fromUser:!1,fromServer:!0,queryId:null,tagged:!1},e,n))}(t.serverSyncTree_,a,l)}else{var c=ee(i);s=Ji(t.serverSyncTree_,a,c)}var d=a;s.length>0&&(d=lr(t,a)),Vn(t.eventQueue_,d,s)}function Qn(t,e){$n(t,"connected",e),!1===e&&function(t){ar(t,"onDisconnectEvents");var e=Jn(t),i=Te();Ee(t.onDisconnect_,ut(),(function(n,r){var o=mn(n,r,t.serverSyncTree_,e);Ae(i,n,o)}));var n=[];Ee(i,ut(),(function(e,i){n=n.concat(Ji(t.serverSyncTree_,e,i));var r=fr(t,e);lr(t,r)})),t.onDisconnect_=Te(),Vn(t.eventQueue_,ut(),n)}(t)}function $n(t,e,i){var n=new ht("/.info/"+e),r=ee(i);t.infoData_.updateSnapshot(n,r);var o=Ji(t.infoSyncTree_,n,r);Vn(t.eventQueue_,n,o)}function tr(t){return t.nextWriteId_++}function er(t,e,i,n,r){ar(t,"set",{path:e.toString(),value:i,priority:n});var o=Jn(t),a=ee(i,n),s=$i(t.serverSyncTree_,e),h=gn(a,s,o),u=tr(t),l=Yi(t.serverSyncTree_,e,h,u,!0);Un(t.eventQueue_,l),t.server_.put(e.toString(),a.val(!0),(function(i,n){var o="ok"===i;o||E("set at "+e+" failed: "+i);var a=Ki(t.serverSyncTree_,u,!o);Vn(t.eventQueue_,e,a),sr(t,r,i,n)}));var c=fr(t,e);lr(t,c),Vn(t.eventQueue_,c,[])}function ir(t,e,i){t.server_.onDisconnectCancel(e.toString(),(function(n,r){"ok"===n&&function t(e,i){if(yt(i))return e.value=null,e.children.clear(),!0;if(null!==e.value){if(e.value.isLeafNode())return!1;var n=e.value;return e.value=null,n.forEachChild(Yt,(function(t,i){Ae(e,new ht(t),i)})),t(e,i)}if(e.children.size>0){var r=lt(i);if(i=dt(i),e.children.has(r))t(e.children.get(r),i)&&e.children.delete(r);return 0===e.children.size}return!0}(t.onDisconnect_,e),sr(t,i,n,r)}))}function nr(t,e,i,n){var r=ee(i);t.server_.onDisconnectPut(e.toString(),r.val(!0),(function(i,o){"ok"===i&&Ae(t.onDisconnect_,e,r),sr(t,n,i,o)}))}function rr(t,e,i){var n;n=".info"===lt(e._path)?Zi(t.infoSyncTree_,e,i):Zi(t.serverSyncTree_,e,i),Hn(t.eventQueue_,e._path,n)}function or(t){t.persistentConnection_&&t.persistentConnection_.interrupt("repo_interrupt")}function ar(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var n="";t.persistentConnection_&&(n=t.persistentConnection_.id+":"),C.apply(void 0,Object(a.f)([n],Object(a.e)(e)))}function sr(t,e,i,n){e&&j((function(){if("ok"===i)e(null);else{var t=(i||"error").toUpperCase(),r=t;n&&(r+=": "+n);var o=new Error(r);o.code=t,e(o)}}))}function hr(t,e,i){return $i(t.serverSyncTree_,e,i)||$t.EMPTY_NODE}function ur(t,e){if(void 0===e&&(e=t.transactionQueueTree_),e||pr(t,e),_n(e)){var i=dr(t,e);Object(o.d)(i.length>0,"Sending zero length transaction queue"),i.every((function(t){return 0===t.status}))&&function(t,e,i){for(var n=i.map((function(t){return t.currentWriteId})),r=hr(t,e,n),a=r,s=r.hash(),h=0;h<i.length;h++){var u=i[h];Object(o.d)(0===u.status,"tryToSendTransactionQueue_: items in queue should all be run."),u.status=1,u.retryCount++;var l=vt(e,u.path);a=a.updateChild(l,u.currentOutputSnapshotRaw)}var c=a.val(!0),d=e;t.server_.put(d.toString(),c,(function(n){ar(t,"transaction put response",{path:d.toString(),status:n});var r=[];if("ok"===n){for(var o=[],a=function(e){i[e].status=2,r=r.concat(Ki(t.serverSyncTree_,i[e].currentWriteId)),i[e].onComplete&&o.push((function(){return i[e].onComplete(null,!0,i[e].currentOutputSnapshotResolved)})),i[e].unwatcher()},s=0;s<i.length;s++)a(s);pr(t,bn(t.transactionQueueTree_,e)),ur(t,t.transactionQueueTree_),Vn(t.eventQueue_,e,r);for(s=0;s<o.length;s++)j(o[s])}else{if("datastale"===n)for(s=0;s<i.length;s++)3===i[s].status?i[s].status=4:i[s].status=0;else{E("transaction at "+d.toString()+" failed: "+n);for(s=0;s<i.length;s++)i[s].status=4,i[s].abortReason=n}lr(t,e)}}),s)}(t,Sn(e),i)}else xn(e)&&Cn(e,(function(e){ur(t,e)}))}function lr(t,e){var i=cr(t,e),n=Sn(i);return function(t,e,i){if(0===e.length)return;for(var n=[],r=[],a=e.filter((function(t){return 0===t.status})).map((function(t){return t.currentWriteId})),s=function(s){var h,u,l=e[s],c=vt(i,l.path),d=!1;if(Object(o.d)(null!==c,"rerunTransactionsUnderNode_: relativePath should not be null."),4===l.status)d=!0,h=l.abortReason,r=r.concat(Ki(t.serverSyncTree_,l.currentWriteId,!0));else if(0===l.status)if(l.retryCount>=25)d=!0,h="maxretry",r=r.concat(Ki(t.serverSyncTree_,l.currentWriteId,!0));else{var p=hr(t,l.path,a);l.currentInputSnapshot=p;var f=e[s].update(p.val());if(void 0!==f){On("transaction failed: Data returned ",f,l.path);var m=ee(f);"object"==typeof f&&null!=f&&Object(o.h)(f,".priority")||(m=m.updatePriority(p.getPriority()));var g=l.currentWriteId,y=Jn(t),v=gn(m,p,y);l.currentOutputSnapshotRaw=m,l.currentOutputSnapshotResolved=v,l.currentWriteId=tr(t),a.splice(a.indexOf(g),1),r=(r=r.concat(Yi(t.serverSyncTree_,l.path,v,l.currentWriteId,l.applyLocally))).concat(Ki(t.serverSyncTree_,g,!0))}else d=!0,h="nodata",r=r.concat(Ki(t.serverSyncTree_,l.currentWriteId,!0))}Vn(t.eventQueue_,i,r),r=[],d&&(e[s].status=2,u=e[s].unwatcher,setTimeout(u,Math.floor(0)),e[s].onComplete&&("nodata"===h?n.push((function(){return e[s].onComplete(null,!1,e[s].currentInputSnapshot)})):n.push((function(){return e[s].onComplete(new Error(h),!1,null)}))))},h=0;h<e.length;h++)s(h);pr(t,t.transactionQueueTree_);for(h=0;h<n.length;h++)j(n[h]);ur(t,t.transactionQueueTree_)}(t,dr(t,i),n),n}function cr(t,e){var i,n=t.transactionQueueTree_;for(i=lt(e);null!==i&&void 0===_n(n);)n=bn(n,i),i=lt(e=dt(e));return n}function dr(t,e){var i=[];return function t(e,i,n){var r=_n(i);if(r)for(var o=0;o<r.length;o++)n.push(r[o]);Cn(i,(function(i){t(e,i,n)}))}(t,e,i),i.sort((function(t,e){return t.order-e.order})),i}function pr(t,e){var i=_n(e);if(i){for(var n=0,r=0;r<i.length;r++)2!==i[r].status&&(i[n]=i[r],n++);i.length=n,wn(e,i.length>0?i:void 0)}Cn(e,(function(e){pr(t,e)}))}function fr(t,e){var i=Sn(cr(t,e)),n=bn(t.transactionQueueTree_,e);return function(t,e,i){for(var n=i?t:t.parent;null!==n;){if(e(n))return!0;n=n.parent}}(n,(function(e){mr(t,e)})),mr(t,n),function t(e,i,n,r){n&&!r&&i(e),Cn(e,(function(e){t(e,i,!0,r)})),n&&r&&i(e)}(n,(function(e){mr(t,e)})),i}function mr(t,e){var i=_n(e);if(i){for(var n=[],r=[],a=-1,s=0;s<i.length;s++)3===i[s].status||(1===i[s].status?(Object(o.d)(a===s-1,"All SENT items should be at beginning of queue."),a=s,i[s].status=3,i[s].abortReason="set"):(Object(o.d)(0===i[s].status,"Unexpected transaction status in abort"),i[s].unwatcher(),r=r.concat(Ki(t.serverSyncTree_,i[s].currentWriteId,!0)),i[s].onComplete&&n.push(i[s].onComplete.bind(null,new Error("set"),!1,null))));-1===a?wn(e,void 0):i.length=a+1,Vn(t.eventQueue_,Sn(e),r);for(s=0;s<n.length;s++)j(n[s])}}var gr=function(t,e){var i=yr(t),n=i.namespace;"firebase.com"===i.domain&&A(i.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),n&&"undefined"!==n||"localhost"===i.domain||A("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),i.secure||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&E("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().");var r="ws"===i.scheme||"wss"===i.scheme;return{repoInfo:new X(i.host,i.secure,n,e,r,"",n!==i.subdomain),path:new ht(i.pathString)}},yr=function(t){var e="",i="",n="",r="",o="",s=!0,h="https",u=443;if("string"==typeof t){var l=t.indexOf("//");l>=0&&(h=t.substring(0,l-1),t=t.substring(l+2));var c=t.indexOf("/");-1===c&&(c=t.length);var d=t.indexOf("?");-1===d&&(d=t.length),e=t.substring(0,Math.min(c,d)),c<d&&(r=function(t){for(var e="",i=t.split("/"),n=0;n<i.length;n++)if(i[n].length>0){var r=i[n];try{r=decodeURIComponent(r.replace(/\+/g," "))}catch(t){}e+="/"+r}return e}(t.substring(c,d)));var p=function(t){var e,i,n={};"?"===t.charAt(0)&&(t=t.substring(1));try{for(var r=Object(a.g)(t.split("&")),o=r.next();!o.done;o=r.next()){var s=o.value;if(0!==s.length){var h=s.split("=");2===h.length?n[decodeURIComponent(h[0])]=decodeURIComponent(h[1]):E("Invalid query segment '"+s+"' in query '"+t+"'")}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}return n}(t.substring(Math.min(t.length,d)));(l=e.indexOf(":"))>=0?(s="https"===h||"wss"===h,u=parseInt(e.substring(l+1),10)):l=e.length;var f=e.slice(0,l);if("localhost"===f.toLowerCase())i="localhost";else if(f.split(".").length<=2)i=f;else{var m=e.indexOf(".");n=e.substring(0,m).toLowerCase(),i=e.substring(m+1),o=n}"ns"in p&&(o=p.ns)}return{host:e,port:u,domain:i,subdomain:n,secure:s,scheme:h,pathString:r,namespace:o}},vr=function(){function t(t,e,i,n){this.eventType=t,this.eventRegistration=e,this.snapshot=i,this.prevName=n}return t.prototype.getPath=function(){var t=this.snapshot.ref;return"value"===this.eventType?t._path:t.parent._path},t.prototype.getEventType=function(){return this.eventType},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.getPath().toString()+":"+this.eventType+":"+Object(o.C)(this.snapshot.exportVal())},t}(),br=function(){function t(t,e,i){this.eventRegistration=t,this.error=e,this.path=i}return t.prototype.getPath=function(){return this.path},t.prototype.getEventType=function(){return"cancel"},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.path.toString()+":cancel"},t}(),_r=function(){function t(t,e){this.snapshotCallback=t,this.cancelCallback=e}return t.prototype.onValue=function(t,e){this.snapshotCallback.call(null,t,e)},t.prototype.onCancel=function(t){return Object(o.d)(this.hasCancelCallback,"Raising a cancel event on a listener with no cancel callback"),this.cancelCallback.call(null,t)},Object.defineProperty(t.prototype,"hasCancelCallback",{get:function(){return!!this.cancelCallback},enumerable:!1,configurable:!0}),t.prototype.matches=function(t){return this.snapshotCallback===t.snapshotCallback||this.snapshotCallback.userCallback===t.snapshotCallback.userCallback&&this.snapshotCallback.context===t.snapshotCallback.context},t}(),wr=function(){function t(t,e){this._repo=t,this._path=e}return t.prototype.cancel=function(){var t=new o.a;return ir(this._repo,this._path,t.wrapCallback((function(){}))),t.promise},t.prototype.remove=function(){Fn("OnDisconnect.remove",this._path);var t=new o.a;return nr(this._repo,this._path,null,t.wrapCallback((function(){}))),t.promise},t.prototype.set=function(t){Fn("OnDisconnect.set",this._path),kn("OnDisconnect.set",t,this._path,!1);var e=new o.a;return nr(this._repo,this._path,t,e.wrapCallback((function(){}))),e.promise},t.prototype.setWithPriority=function(t,e){Fn("OnDisconnect.setWithPriority",this._path),kn("OnDisconnect.setWithPriority",t,this._path,!1),Dn("OnDisconnect.setWithPriority",e,!1);var i=new o.a;return function(t,e,i,n,r){var o=ee(i,n);t.server_.onDisconnectPut(e.toString(),o.val(!0),(function(i,n){"ok"===i&&Ae(t.onDisconnect_,e,o),sr(t,r,i,n)}))}(this._repo,this._path,t,e,i.wrapCallback((function(){}))),i.promise},t.prototype.update=function(t){Fn("OnDisconnect.update",this._path),Rn("OnDisconnect.update",t,this._path,!1);var e=new o.a;return function(t,e,i,n){if(Object(o.q)(i))return C("onDisconnect().update() called with empty data. Don't do anything."),void sr(t,n,"ok",void 0);t.server_.onDisconnectMerge(e.toString(),i,(function(r,o){"ok"===r&&N(i,(function(i,n){var r=ee(n);Ae(t.onDisconnect_,gt(e,i),r)})),sr(t,n,r,o)}))}(this._repo,this._path,t,e.wrapCallback((function(){}))),e.promise},t}(),xr=function(){function t(t,e,i,n){this._repo=t,this._path=e,this._queryParams=i,this._orderByCalled=n}return Object.defineProperty(t.prototype,"key",{get:function(){return yt(this._path)?null:pt(this._path)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ref",{get:function(){return new Ar(this._repo,this._path)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_queryIdentifier",{get:function(){var t=xe(this._queryParams),e=D(t);return"{}"===e?"default":e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_queryObject",{get:function(){return xe(this._queryParams)},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){if(!((e=Object(o.n)(e))instanceof t))return!1;var i=this._repo===e._repo,n=_t(this._path,e._path),r=this._queryIdentifier===e._queryIdentifier;return i&&n&&r},t.prototype.toJSON=function(){return this.toString()},t.prototype.toString=function(){return this._repo.toString()+function(t){for(var e="",i=t.pieceNum_;i<t.pieces_.length;i++)""!==t.pieces_[i]&&(e+="/"+encodeURIComponent(String(t.pieces_[i])));return e||"/"}(this._path)},t}();function Cr(t,e){if(!0===t._orderByCalled)throw new Error(e+": You can't combine multiple orderBy calls.")}function Sr(t){var e=null,i=null;if(t.hasStart()&&(e=t.getIndexStartValue()),t.hasEnd()&&(i=t.getIndexEndValue()),t.getIndex()===Ot){var n="Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().",r="Query: When ordering by key, the argument passed to startAt(), startAfter(), endAt(), endBefore(), or equalTo() must be a string.";if(t.hasStart()){if(t.getIndexStartName()!==M)throw new Error(n);if("string"!=typeof e)throw new Error(r)}if(t.hasEnd()){if(t.getIndexEndName()!==I)throw new Error(n);if("string"!=typeof i)throw new Error(r)}}else if(t.getIndex()===Yt){if(null!=e&&!In(e)||null!=i&&!In(i))throw new Error("Query: When ordering by priority, the first argument passed to startAt(), startAfter() endAt(), endBefore(), or equalTo() must be a valid priority value (null, a number, or a string).")}else if(Object(o.d)(t.getIndex()instanceof re||t.getIndex()===oe,"unknown index type."),null!=e&&"object"==typeof e||null!=i&&"object"==typeof i)throw new Error("Query: First argument passed to startAt(), startAfter(), endAt(), endBefore(), or equalTo() cannot be an object.")}function Tr(t){if(t.hasStart()&&t.hasEnd()&&t.hasLimit()&&!t.hasAnchoredLimit())throw new Error("Query: Can't combine startAt(), startAfter(), endAt(), endBefore(), and limit(). Use limitToFirst() or limitToLast() instead.")}var Ar=function(t){function e(e,i){return t.call(this,e,i,new ye,!1)||this}return Object(a.c)(e,t),Object.defineProperty(e.prototype,"parent",{get:function(){var t=mt(this._path);return null===t?null:new e(this._repo,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){for(var t=this;null!==t.parent;)t=t.parent;return t},enumerable:!1,configurable:!0}),e}(xr),Er=function(){function t(t,e,i){this._node=t,this.ref=e,this._index=i}return Object.defineProperty(t.prototype,"priority",{get:function(){return this._node.getPriority().val()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"key",{get:function(){return this.ref.key},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._node.numChildren()},enumerable:!1,configurable:!0}),t.prototype.child=function(e){var i=new ht(e),n=Ir(this.ref,e);return new t(this._node.getChild(i),n,Yt)},t.prototype.exists=function(){return!this._node.isEmpty()},t.prototype.exportVal=function(){return this._node.val(!0)},t.prototype.forEach=function(e){var i=this;return!this._node.isLeafNode()&&!!this._node.forEachChild(this._index,(function(n,r){return e(new t(r,Ir(i.ref,n),Yt))}))},t.prototype.hasChild=function(t){var e=new ht(t);return!this._node.getChild(e).isEmpty()},t.prototype.hasChildren=function(){return!this._node.isLeafNode()&&!this._node.isEmpty()},t.prototype.toJSON=function(){return this.exportVal()},t.prototype.val=function(){return this._node.val()},t}();function Pr(t,e){return(t=Object(o.n)(t))._checkNotDeleted("ref"),void 0!==e?Ir(t._root,e):t._root}function Mr(t,e){(t=Object(o.n)(t))._checkNotDeleted("refFromURL");var i=gr(e,t._repo.repoInfo_.nodeAdmin);zn("refFromURL",i);var n=i.repoInfo;return t._repo.repoInfo_.isCustomHost()||n.host===t._repo.repoInfo_.host||A("refFromURL: Host name does not match the current database: (found "+n.host+" but expected "+t._repo.repoInfo_.host+")"),Pr(t,i.path.toString())}function Ir(t,e){var i,n,r,a;return null===lt((t=Object(o.n)(t))._path)?(i="child",n="path",a=!1,(r=e)&&(r=r.replace(/^\/*\.info(\/|$)/,"/")),Bn(i,n,r,a)):Bn("child","path",e,!1),new Ar(t._repo,gt(t._path,e))}function kr(t,e){t=Object(o.n)(t),Fn("push",t._path),kn("push",e,t._path,!0);var i,n=Kn(t._repo),r=se(n),a=Ir(t,r),s=Ir(t,r);return i=null!=e?Rr(s,e).then((function(){return s})):Promise.resolve(s),a.then=i.then.bind(i),a.catch=i.then.bind(i,void 0),a}function Or(t){return Fn("remove",t._path),Rr(t,null)}function Rr(t,e){t=Object(o.n)(t),Fn("set",t._path),kn("set",e,t._path,!1);var i=new o.a;return er(t._repo,t._path,e,null,i.wrapCallback((function(){}))),i.promise}function Dr(t,e){t=Object(o.n)(t),Fn("setPriority",t._path),Dn("setPriority",e,!1);var i=new o.a;return er(t._repo,gt(t._path,".priority"),e,null,i.wrapCallback((function(){}))),i.promise}function Lr(t,e,i){if(Fn("setWithPriority",t._path),kn("setWithPriority",e,t._path,!1),Dn("setWithPriority",i,!1),".length"===t.key||".keys"===t.key)throw"setWithPriority failed: "+t.key+" is a read-only object.";var n=new o.a;return er(t._repo,t._path,e,i,n.wrapCallback((function(){}))),n.promise}function Nr(t,e){Rn("update",e,t._path,!1);var i=new o.a;return function(t,e,i,n){ar(t,"update",{path:e.toString(),value:i});var r=!0,o=Jn(t),a={};if(N(i,(function(i,n){r=!1,a[i]=mn(gt(e,i),ee(n),t.serverSyncTree_,o)})),r)C("update() called with empty data. Don't do anything."),sr(t,n,"ok",void 0);else{var s=tr(t),h=qi(t.serverSyncTree_,e,a,s);Un(t.eventQueue_,h),t.server_.merge(e.toString(),i,(function(i,r){var o="ok"===i;o||E("update at "+e+" failed: "+i);var a=Ki(t.serverSyncTree_,s,!o),h=a.length>0?lr(t,e):e;Vn(t.eventQueue_,h,a),sr(t,n,i,r)})),N(i,(function(i){var n=fr(t,gt(e,i));lr(t,n)})),Vn(t.eventQueue_,e,[])}}(t._repo,t._path,e,i.wrapCallback((function(){}))),i.promise}function Br(t){return function(t,e){var i=tn(t.serverSyncTree_,e);return null!=i?Promise.resolve(i):t.server_.get(e).then((function(i){var n=ee(i).withIndex(e._queryParams.getIndex()),r=Ji(t.serverSyncTree_,e._path,n);return Hn(t.eventQueue_,e._path,r),Promise.resolve(n)}),(function(i){return ar(t,"get for query "+Object(o.C)(e)+" failed: "+i),Promise.reject(new Error(i))}))}((t=Object(o.n)(t))._repo,t).then((function(e){return new Er(e,new Ar(t._repo,t._path),t._queryParams.getIndex())}))}var Fr=function(){function t(t){this.callbackContext=t}return t.prototype.respondsTo=function(t){return"value"===t},t.prototype.createEvent=function(t,e){var i=e._queryParams.getIndex();return new vr("value",this,new Er(t.snapshotNode,new Ar(e._repo,e._path),i))},t.prototype.getEventRunner=function(t){var e=this;return"cancel"===t.getEventType()?function(){return e.callbackContext.onCancel(t.error)}:function(){return e.callbackContext.onValue(t.snapshot,null)}},t.prototype.createCancelEvent=function(t,e){return this.callbackContext.hasCancelCallback?new br(this,t,e):null},t.prototype.matches=function(e){return e instanceof t&&(!e.callbackContext||!this.callbackContext||e.callbackContext.matches(this.callbackContext))},t.prototype.hasAnyCallback=function(){return null!==this.callbackContext},t}(),zr=function(){function t(t,e){this.eventType=t,this.callbackContext=e}return t.prototype.respondsTo=function(t){var e="children_added"===t?"child_added":t;return e="children_removed"===e?"child_removed":e,this.eventType===e},t.prototype.createCancelEvent=function(t,e){return this.callbackContext.hasCancelCallback?new br(this,t,e):null},t.prototype.createEvent=function(t,e){Object(o.d)(null!=t.childName,"Child events should have a childName.");var i=Ir(new Ar(e._repo,e._path),t.childName),n=e._queryParams.getIndex();return new vr(t.type,this,new Er(t.snapshotNode,i,n),t.prevName)},t.prototype.getEventRunner=function(t){var e=this;return"cancel"===t.getEventType()?function(){return e.callbackContext.onCancel(t.error)}:function(){return e.callbackContext.onValue(t.snapshot,t.prevName)}},t.prototype.matches=function(e){return e instanceof t&&(this.eventType===e.eventType&&(!this.callbackContext||!e.callbackContext||this.callbackContext.matches(e.callbackContext)))},t.prototype.hasAnyCallback=function(){return!!this.callbackContext},t}();function jr(t,e,i,n,r){var o;if("object"==typeof n&&(o=void 0,r=n),"function"==typeof n&&(o=n),r&&r.onlyOnce){var a=i,s=function(e,i){rr(t._repo,t,u),a(e,i)};s.userCallback=i.userCallback,s.context=i.context,i=s}var h=new _r(i,o||void 0),u="value"===e?new Fr(h):new zr(e,h);return function(t,e,i){var n;n=".info"===lt(e._path)?Qi(t.infoSyncTree_,e,i):Qi(t.serverSyncTree_,e,i),Hn(t.eventQueue_,e._path,n)}(t._repo,t,u),function(){return rr(t._repo,t,u)}}function Gr(t,e,i,n){return jr(t,"value",e,i,n)}function Ur(t,e,i,n){return jr(t,"child_added",e,i,n)}function Hr(t,e,i,n){return jr(t,"child_changed",e,i,n)}function Vr(t,e,i,n){return jr(t,"child_moved",e,i,n)}function Wr(t,e,i,n){return jr(t,"child_removed",e,i,n)}function Xr(t,e,i){var n=null,r=i?new _r(i):null;"value"===e?n=new Fr(r):e&&(n=new zr(e,r)),rr(t._repo,t,n)}var Yr=function(){},qr=function(t){function e(e,i){var n=t.call(this)||this;return n._value=e,n._key=i,n}return Object(a.c)(e,t),e.prototype._apply=function(t){kn("endAt",this._value,t._path,!0);var e=be(t._queryParams,this._value,this._key);if(Tr(e),Sr(e),t._queryParams.hasEnd())throw new Error("endAt: Starting point was already set (by another call to endAt, endBefore or equalTo).");return new xr(t._repo,t._path,e,t._orderByCalled)},e}(Yr);function Kr(t,e){return Nn("endAt","key",e,!0),new qr(t,e)}var Jr=function(t){function e(e,i){var n=t.call(this)||this;return n._value=e,n._key=i,n}return Object(a.c)(e,t),e.prototype._apply=function(t){kn("endBefore",this._value,t._path,!1);var e,i,n,r,o=(e=t._queryParams,i=this._value,n=this._key,e.index_===Ot?("string"==typeof i&&(i=ue(i)),r=be(e,i,n)):r=be(e,i,null==n?M:ue(n)),r.endBeforeSet_=!0,r);if(Tr(o),Sr(o),t._queryParams.hasEnd())throw new Error("endBefore: Starting point was already set (by another call to endAt, endBefore or equalTo).");return new xr(t._repo,t._path,o,t._orderByCalled)},e}(Yr);function Zr(t,e){return Nn("endBefore","key",e,!0),new Jr(t,e)}var Qr=function(t){function e(e,i){var n=t.call(this)||this;return n._value=e,n._key=i,n}return Object(a.c)(e,t),e.prototype._apply=function(t){kn("startAt",this._value,t._path,!0);var e=ve(t._queryParams,this._value,this._key);if(Tr(e),Sr(e),t._queryParams.hasStart())throw new Error("startAt: Starting point was already set (by another call to startAt, startBefore or equalTo).");return new xr(t._repo,t._path,e,t._orderByCalled)},e}(Yr);function $r(t,e){return void 0===t&&(t=null),Nn("startAt","key",e,!0),new Qr(t,e)}var to=function(t){function e(e,i){var n=t.call(this)||this;return n._value=e,n._key=i,n}return Object(a.c)(e,t),e.prototype._apply=function(t){kn("startAfter",this._value,t._path,!1);var e=function(t,e,i){var n;if(t.index_===Ot)"string"==typeof e&&(e=he(e)),n=ve(t,e,i);else{n=ve(t,e,null==i?I:he(i))}return n.startAfterSet_=!0,n}(t._queryParams,this._value,this._key);if(Tr(e),Sr(e),t._queryParams.hasStart())throw new Error("startAfter: Starting point was already set (by another call to startAt, startAfter, or equalTo).");return new xr(t._repo,t._path,e,t._orderByCalled)},e}(Yr);function eo(t,e){return Nn("startAfter","key",e,!0),new to(t,e)}var io=function(t){function e(e){var i=t.call(this)||this;return i._limit=e,i}return Object(a.c)(e,t),e.prototype._apply=function(t){if(t._queryParams.hasLimit())throw new Error("limitToFirst: Limit was already set (by another call to limitToFirst or limitToLast).");return new xr(t._repo,t._path,(e=t._queryParams,i=this._limit,(n=e.copy()).limitSet_=!0,n.limit_=i,n.viewFrom_="l",n),t._orderByCalled);var e,i,n},e}(Yr);function no(t){if("number"!=typeof t||Math.floor(t)!==t||t<=0)throw new Error("limitToFirst: First argument must be a positive integer.");return new io(t)}var ro=function(t){function e(e){var i=t.call(this)||this;return i._limit=e,i}return Object(a.c)(e,t),e.prototype._apply=function(t){if(t._queryParams.hasLimit())throw new Error("limitToLast: Limit was already set (by another call to limitToFirst or limitToLast).");return new xr(t._repo,t._path,(e=t._queryParams,i=this._limit,(n=e.copy()).limitSet_=!0,n.limit_=i,n.viewFrom_="r",n),t._orderByCalled);var e,i,n},e}(Yr);function oo(t){if("number"!=typeof t||Math.floor(t)!==t||t<=0)throw new Error("limitToLast: First argument must be a positive integer.");return new ro(t)}var ao=function(t){function e(e){var i=t.call(this)||this;return i._path=e,i}return Object(a.c)(e,t),e.prototype._apply=function(t){Cr(t,"orderByChild");var e=new ht(this._path);if(yt(e))throw new Error("orderByChild: cannot pass in empty path. Use orderByValue() instead.");var i=new re(e),n=_e(t._queryParams,i);return Sr(n),new xr(t._repo,t._path,n,!0)},e}(Yr);function so(t){if("$key"===t)throw new Error('orderByChild: "$key" is invalid. Use orderByKey() instead.');if("$priority"===t)throw new Error('orderByChild: "$priority" is invalid. Use orderByPriority() instead.');if("$value"===t)throw new Error('orderByChild: "$value" is invalid. Use orderByValue() instead.');return Bn("orderByChild","path",t,!1),new ao(t)}var ho=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype._apply=function(t){Cr(t,"orderByKey");var e=_e(t._queryParams,Ot);return Sr(e),new xr(t._repo,t._path,e,!0)},e}(Yr);function uo(){return new ho}var lo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype._apply=function(t){Cr(t,"orderByPriority");var e=_e(t._queryParams,Yt);return Sr(e),new xr(t._repo,t._path,e,!0)},e}(Yr);function co(){return new lo}var po=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(a.c)(e,t),e.prototype._apply=function(t){Cr(t,"orderByValue");var e=_e(t._queryParams,oe);return Sr(e),new xr(t._repo,t._path,e,!0)},e}(Yr);function fo(){return new po}var mo=function(t){function e(e,i){var n=t.call(this)||this;return n._value=e,n._key=i,n}return Object(a.c)(e,t),e.prototype._apply=function(t){if(kn("equalTo",this._value,t._path,!1),t._queryParams.hasStart())throw new Error("equalTo: Starting point was already set (by another call to startAt/startAfter or equalTo).");if(t._queryParams.hasEnd())throw new Error("equalTo: Ending point was already set (by another call to endAt/endBefore or equalTo).");return new qr(this._value,this._key)._apply(new Qr(this._value,this._key)._apply(t))},e}(Yr);function go(t,e){return Nn("equalTo","key",e,!0),new mo(t,e)}function yo(t){for(var e,i,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var s=Object(o.n)(t);try{for(var h=Object(a.g)(n),u=h.next();!u.done;u=h.next()){var l=u.value;s=l._apply(s)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(i=h.return)&&i.call(h)}finally{if(e)throw e.error}}return s}!function(t){Object(o.d)(!Ai,"__referenceConstructor has already been defined"),Ai=t}(Ar),function(t){Object(o.d)(!Ri,"__referenceConstructor has already been defined"),Ri=t}(Ar);var vo={},bo=!1;function _o(e,i,n,r,o){var a=r||e.options.databaseURL;void 0===a&&(e.options.projectId||A("Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp()."),C("Using default host for project ",e.options.projectId),a=e.options.projectId+"-default-rtdb.firebaseio.com");var s,h=gr(a,o),u=h.repoInfo,l=void 0;void 0!==t&&(l=t.env.FIREBASE_DATABASE_EMULATOR_HOST),l?(s=!0,a="http://"+l+"?ns="+u.namespace,u=(h=gr(a,o)).repoInfo):s=!h.repoInfo.secure;var c=o&&s?new V(V.OWNER):new H(e.name,e.options,i);zn("Invalid Firebase Database URL",h),yt(h.path)||A("Database URL must point to the root of a Firebase Database (not including a child path).");var d=function(t,e,i,n){var r=vo[e.name];r||(r={},vo[e.name]=r);var o=r[t.toURLString()];o&&A("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call.");return o=new Yn(t,bo,i,n),r[t.toURLString()]=o,o}(u,e,c,new U(e.name,n));return new wo(d,e)}var wo=function(){function t(t,e){this._repoInternal=t,this.app=e,this.type="database",this._instanceStarted=!1}return Object.defineProperty(t.prototype,"_repo",{get:function(){return this._instanceStarted||(qn(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_root",{get:function(){return this._rootInternal||(this._rootInternal=new Ar(this._repo,ut())),this._rootInternal},enumerable:!1,configurable:!0}),t.prototype._delete=function(){var t,e,i;return null!==this._rootInternal&&(t=this._repo,e=this.app.name,(i=vo[e])&&i[t.key]===t||A("Database "+e+"("+t.repoInfo_+") has already been deleted."),or(t),delete i[t.key],this._repoInternal=null,this._rootInternal=null),Promise.resolve()},t.prototype._checkNotDeleted=function(t){null===this._rootInternal&&A("Cannot call "+t+" on a deleted database.")},t}();function xo(t,e,i,n){void 0===n&&(n={}),(t=Object(o.n)(t))._checkNotDeleted("useEmulator"),t._instanceStarted&&A("Cannot call useEmulator() after instance has already been initialized.");var r=t._repoInternal,a=void 0;if(r.repoInfo_.nodeAdmin)n.mockUserToken&&A('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'),a=new V(V.OWNER);else if(n.mockUserToken){var s=Object(o.i)(n.mockUserToken,t.app.options.projectId);a=new V(s)}!function(t,e,i,n){t.repoInfo_=new X(e+":"+i,!1,t.repoInfo_.namespace,t.repoInfo_.webSocketOnly,t.repoInfo_.nodeAdmin,t.repoInfo_.persistenceKey,t.repoInfo_.includeNamespaceInQueryParams),n&&(t.authTokenProvider_=n)}(r,e,i,a)}function Co(t){(t=Object(o.n)(t))._checkNotDeleted("goOffline"),or(t._repo)}function So(t){var e;(t=Object(o.n)(t))._checkNotDeleted("goOnline"),(e=t._repo).persistentConnection_&&e.persistentConnection_.resume("repo_interrupt")}var To={".sv":"timestamp"};var Ao=function(){function t(t,e){this.committed=t,this.snapshot=e}return t.prototype.toJSON=function(){return{committed:this.committed,snapshot:this.snapshot.toJSON()}},t}();function Eo(t,e,i){var n;if(t=Object(o.n)(t),Fn("Reference.transaction",t._path),".length"===t.key||".keys"===t.key)throw"Reference.transaction failed: "+t.key+" is a read-only object.";var r=null===(n=null==i?void 0:i.applyLocally)||void 0===n||n,a=new o.a,s=Gr(t,(function(){}));return function(t,e,i,n,r,a){ar(t,"transaction on "+e);var s={path:e,update:i,onComplete:n,status:null,order:y(),applyLocally:a,retryCount:0,unwatcher:r,abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},h=hr(t,e,void 0);s.currentInputSnapshot=h;var u=s.update(h.val());if(void 0===u)s.unwatcher(),s.currentOutputSnapshotRaw=null,s.currentOutputSnapshotResolved=null,s.onComplete&&s.onComplete(null,!1,s.currentInputSnapshot);else{On("transaction failed: Data returned ",u,s.path),s.status=0;var l=bn(t.transactionQueueTree_,e),c=_n(l)||[];c.push(s),wn(l,c);var d=void 0;if("object"==typeof u&&null!==u&&Object(o.h)(u,".priority"))d=Object(o.z)(u,".priority"),Object(o.d)(In(d),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.");else d=($i(t.serverSyncTree_,e)||$t.EMPTY_NODE).getPriority().val();var p=Jn(t),f=ee(u,d),m=gn(f,h,p);s.currentOutputSnapshotRaw=f,s.currentOutputSnapshotResolved=m,s.currentWriteId=tr(t);var g=Yi(t.serverSyncTree_,e,m,s.currentWriteId,s.applyLocally);Vn(t.eventQueue_,e,g),ur(t,t.transactionQueueTree_)}}(t._repo,t._path,e,(function(e,i,n){var r=null;e?a.reject(e):(r=new Er(n,new Ar(t._repo,t._path),Yt),a.resolve(new Ao(i,r)))}),s,r),a.promise}var Po=function(){function t(t){this._delegate=t}return t.prototype.cancel=function(t){Object(o.D)("OnDisconnect.cancel",0,1,arguments.length),Object(o.E)("OnDisconnect.cancel","onComplete",t,!0);var e=this._delegate.cancel();return t&&e.then((function(){return t(null)}),(function(e){return t(e)})),e},t.prototype.remove=function(t){Object(o.D)("OnDisconnect.remove",0,1,arguments.length),Object(o.E)("OnDisconnect.remove","onComplete",t,!0);var e=this._delegate.remove();return t&&e.then((function(){return t(null)}),(function(e){return t(e)})),e},t.prototype.set=function(t,e){Object(o.D)("OnDisconnect.set",1,2,arguments.length),Object(o.E)("OnDisconnect.set","onComplete",e,!0);var i=this._delegate.set(t);return e&&i.then((function(){return e(null)}),(function(t){return e(t)})),i},t.prototype.setWithPriority=function(t,e,i){Object(o.D)("OnDisconnect.setWithPriority",2,3,arguments.length),Object(o.E)("OnDisconnect.setWithPriority","onComplete",i,!0);var n=this._delegate.setWithPriority(t,e);return i&&n.then((function(){return i(null)}),(function(t){return i(t)})),n},t.prototype.update=function(t,e){if(Object(o.D)("OnDisconnect.update",1,2,arguments.length),Array.isArray(t)){for(var i={},n=0;n<t.length;++n)i[""+n]=t[n];t=i,E("Passing an Array to firebase.database.onDisconnect().update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}Object(o.E)("OnDisconnect.update","onComplete",e,!0);var r=this._delegate.update(t);return e&&r.then((function(){return e(null)}),(function(t){return e(t)})),r},t}(),Mo=function(){function t(t,e){this.committed=t,this.snapshot=e}return t.prototype.toJSON=function(){return Object(o.D)("TransactionResult.toJSON",0,1,arguments.length),{committed:this.committed,snapshot:this.snapshot.toJSON()}},t}(),Io=function(){function t(t,e){this._database=t,this._delegate=e}return t.prototype.val=function(){return Object(o.D)("DataSnapshot.val",0,0,arguments.length),this._delegate.val()},t.prototype.exportVal=function(){return Object(o.D)("DataSnapshot.exportVal",0,0,arguments.length),this._delegate.exportVal()},t.prototype.toJSON=function(){return Object(o.D)("DataSnapshot.toJSON",0,1,arguments.length),this._delegate.toJSON()},t.prototype.exists=function(){return Object(o.D)("DataSnapshot.exists",0,0,arguments.length),this._delegate.exists()},t.prototype.child=function(e){return Object(o.D)("DataSnapshot.child",0,1,arguments.length),e=String(e),Bn("DataSnapshot.child","path",e,!1),new t(this._database,this._delegate.child(e))},t.prototype.hasChild=function(t){return Object(o.D)("DataSnapshot.hasChild",1,1,arguments.length),Bn("DataSnapshot.hasChild","path",t,!1),this._delegate.hasChild(t)},t.prototype.getPriority=function(){return Object(o.D)("DataSnapshot.getPriority",0,0,arguments.length),this._delegate.priority},t.prototype.forEach=function(e){var i=this;return Object(o.D)("DataSnapshot.forEach",1,1,arguments.length),Object(o.E)("DataSnapshot.forEach","action",e,!1),this._delegate.forEach((function(n){return e(new t(i._database,n))}))},t.prototype.hasChildren=function(){return Object(o.D)("DataSnapshot.hasChildren",0,0,arguments.length),this._delegate.hasChildren()},Object.defineProperty(t.prototype,"key",{get:function(){return this._delegate.key},enumerable:!1,configurable:!0}),t.prototype.numChildren=function(){return Object(o.D)("DataSnapshot.numChildren",0,0,arguments.length),this._delegate.size},t.prototype.getRef=function(){return Object(o.D)("DataSnapshot.ref",0,0,arguments.length),new Oo(this._database,this._delegate.ref)},Object.defineProperty(t.prototype,"ref",{get:function(){return this.getRef()},enumerable:!1,configurable:!0}),t}(),ko=function(){function t(t,e){this.database=t,this._delegate=e}return t.prototype.on=function(e,i,n,r){var a,s=this;Object(o.D)("Query.on",2,4,arguments.length),Object(o.E)("Query.on","callback",i,!1);var h=t.getCancelAndContextArgs_("Query.on",n,r),u=function(t,e){i.call(h.context,new Io(s.database,t),e)};u.userCallback=i,u.context=h.context;var l=null===(a=h.cancel)||void 0===a?void 0:a.bind(h.context);switch(e){case"value":return Gr(this._delegate,u,l),i;case"child_added":return Ur(this._delegate,u,l),i;case"child_removed":return Wr(this._delegate,u,l),i;case"child_changed":return Hr(this._delegate,u,l),i;case"child_moved":return Vr(this._delegate,u,l),i;default:throw new Error(Object(o.m)("Query.on","eventType")+'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".')}},t.prototype.off=function(t,e,i){if(Object(o.D)("Query.off",0,3,arguments.length),Ln("Query.off",t,!0),Object(o.E)("Query.off","callback",e,!0),Object(o.F)("Query.off","context",i,!0),e){var n=function(){};n.userCallback=e,n.context=i,Xr(this._delegate,t,n)}else Xr(this._delegate,t)},t.prototype.get=function(){var t=this;return Br(this._delegate).then((function(e){return new Io(t.database,e)}))},t.prototype.once=function(e,i,n,r){var a=this;Object(o.D)("Query.once",1,4,arguments.length),Object(o.E)("Query.once","callback",i,!0);var s=t.getCancelAndContextArgs_("Query.once",n,r),h=new o.a,u=function(t,e){var n=new Io(a.database,t);i&&i.call(s.context,n,e),h.resolve(n)};u.userCallback=i,u.context=s.context;var l=function(t){s.cancel&&s.cancel.call(s.context,t),h.reject(t)};switch(e){case"value":Gr(this._delegate,u,l,{onlyOnce:!0});break;case"child_added":Ur(this._delegate,u,l,{onlyOnce:!0});break;case"child_removed":Wr(this._delegate,u,l,{onlyOnce:!0});break;case"child_changed":Hr(this._delegate,u,l,{onlyOnce:!0});break;case"child_moved":Vr(this._delegate,u,l,{onlyOnce:!0});break;default:throw new Error(Object(o.m)("Query.once","eventType")+'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".')}return h.promise},t.prototype.limitToFirst=function(e){return Object(o.D)("Query.limitToFirst",1,1,arguments.length),new t(this.database,yo(this._delegate,no(e)))},t.prototype.limitToLast=function(e){return Object(o.D)("Query.limitToLast",1,1,arguments.length),new t(this.database,yo(this._delegate,oo(e)))},t.prototype.orderByChild=function(e){return Object(o.D)("Query.orderByChild",1,1,arguments.length),new t(this.database,yo(this._delegate,so(e)))},t.prototype.orderByKey=function(){return Object(o.D)("Query.orderByKey",0,0,arguments.length),new t(this.database,yo(this._delegate,uo()))},t.prototype.orderByPriority=function(){return Object(o.D)("Query.orderByPriority",0,0,arguments.length),new t(this.database,yo(this._delegate,co()))},t.prototype.orderByValue=function(){return Object(o.D)("Query.orderByValue",0,0,arguments.length),new t(this.database,yo(this._delegate,fo()))},t.prototype.startAt=function(e,i){return void 0===e&&(e=null),Object(o.D)("Query.startAt",0,2,arguments.length),new t(this.database,yo(this._delegate,$r(e,i)))},t.prototype.startAfter=function(e,i){return void 0===e&&(e=null),Object(o.D)("Query.startAfter",0,2,arguments.length),new t(this.database,yo(this._delegate,eo(e,i)))},t.prototype.endAt=function(e,i){return void 0===e&&(e=null),Object(o.D)("Query.endAt",0,2,arguments.length),new t(this.database,yo(this._delegate,Kr(e,i)))},t.prototype.endBefore=function(e,i){return void 0===e&&(e=null),Object(o.D)("Query.endBefore",0,2,arguments.length),new t(this.database,yo(this._delegate,Zr(e,i)))},t.prototype.equalTo=function(e,i){return Object(o.D)("Query.equalTo",1,2,arguments.length),new t(this.database,yo(this._delegate,go(e,i)))},t.prototype.toString=function(){return Object(o.D)("Query.toString",0,0,arguments.length),this._delegate.toString()},t.prototype.toJSON=function(){return Object(o.D)("Query.toJSON",0,1,arguments.length),this._delegate.toJSON()},t.prototype.isEqual=function(e){if(Object(o.D)("Query.isEqual",1,1,arguments.length),!(e instanceof t)){var i="Query.isEqual failed: First argument must be an instance of firebase.database.Query.";throw new Error(i)}return this._delegate.isEqual(e._delegate)},t.getCancelAndContextArgs_=function(t,e,i){var n={cancel:void 0,context:void 0};if(e&&i)n.cancel=e,Object(o.E)(t,"cancel",n.cancel,!0),n.context=i,Object(o.F)(t,"context",n.context,!0);else if(e)if("object"==typeof e&&null!==e)n.context=e;else{if("function"!=typeof e)throw new Error(Object(o.m)(t,"cancelOrContext")+" must either be a cancel callback or a context object.");n.cancel=e}return n},Object.defineProperty(t.prototype,"ref",{get:function(){return new Oo(this.database,new Ar(this._delegate._repo,this._delegate._path))},enumerable:!1,configurable:!0}),t}(),Oo=function(t){function e(e,i){var n=t.call(this,e,new xr(i._repo,i._path,new ye,!1))||this;return n.database=e,n._delegate=i,n}return Object(a.c)(e,t),e.prototype.getKey=function(){return Object(o.D)("Reference.key",0,0,arguments.length),this._delegate.key},e.prototype.child=function(t){return Object(o.D)("Reference.child",1,1,arguments.length),"number"==typeof t&&(t=String(t)),new e(this.database,Ir(this._delegate,t))},e.prototype.getParent=function(){Object(o.D)("Reference.parent",0,0,arguments.length);var t=this._delegate.parent;return t?new e(this.database,t):null},e.prototype.getRoot=function(){return Object(o.D)("Reference.root",0,0,arguments.length),new e(this.database,this._delegate.root)},e.prototype.set=function(t,e){Object(o.D)("Reference.set",1,2,arguments.length),Object(o.E)("Reference.set","onComplete",e,!0);var i=Rr(this._delegate,t);return e&&i.then((function(){return e(null)}),(function(t){return e(t)})),i},e.prototype.update=function(t,e){if(Object(o.D)("Reference.update",1,2,arguments.length),Array.isArray(t)){for(var i={},n=0;n<t.length;++n)i[""+n]=t[n];t=i,E("Passing an Array to Firebase.update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}Fn("Reference.update",this._delegate._path),Object(o.E)("Reference.update","onComplete",e,!0);var r=Nr(this._delegate,t);return e&&r.then((function(){return e(null)}),(function(t){return e(t)})),r},e.prototype.setWithPriority=function(t,e,i){Object(o.D)("Reference.setWithPriority",2,3,arguments.length),Object(o.E)("Reference.setWithPriority","onComplete",i,!0);var n=Lr(this._delegate,t,e);return i&&n.then((function(){return i(null)}),(function(t){return i(t)})),n},e.prototype.remove=function(t){Object(o.D)("Reference.remove",0,1,arguments.length),Object(o.E)("Reference.remove","onComplete",t,!0);var e=Or(this._delegate);return t&&e.then((function(){return t(null)}),(function(e){return t(e)})),e},e.prototype.transaction=function(t,e,i){var n=this;Object(o.D)("Reference.transaction",1,3,arguments.length),Object(o.E)("Reference.transaction","transactionUpdate",t,!1),Object(o.E)("Reference.transaction","onComplete",e,!0),jn("Reference.transaction","applyLocally",i,!0);var r=Eo(this._delegate,t,{applyLocally:i}).then((function(t){return new Mo(t.committed,new Io(n.database,t.snapshot))}));return e&&r.then((function(t){return e(null,t.committed,t.snapshot)}),(function(t){return e(t,!1,null)})),r},e.prototype.setPriority=function(t,e){Object(o.D)("Reference.setPriority",1,2,arguments.length),Object(o.E)("Reference.setPriority","onComplete",e,!0);var i=Dr(this._delegate,t);return e&&i.then((function(){return e(null)}),(function(t){return e(t)})),i},e.prototype.push=function(t,i){var n=this;Object(o.D)("Reference.push",0,2,arguments.length),Object(o.E)("Reference.push","onComplete",i,!0);var r=kr(this._delegate,t),a=r.then((function(t){return new e(n.database,t)}));i&&a.then((function(){return i(null)}),(function(t){return i(t)}));var s=new e(this.database,r);return s.then=a.then.bind(a),s.catch=a.catch.bind(a,void 0),s},e.prototype.onDisconnect=function(){return Fn("Reference.onDisconnect",this._delegate._path),new Po(new wr(this._delegate._repo,this._delegate._path))},Object.defineProperty(e.prototype,"key",{get:function(){return this.getKey()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.getParent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){return this.getRoot()},enumerable:!1,configurable:!0}),e}(ko),Ro=function(){function t(t,e){var i=this;this._delegate=t,this.app=e,this.INTERNAL={delete:function(){return i._delegate._delete()}}}return t.prototype.useEmulator=function(t,e,i){void 0===i&&(i={}),xo(this._delegate,t,e,i)},t.prototype.ref=function(t){if(Object(o.D)("database.ref",0,1,arguments.length),t instanceof Oo){var e=Mr(this._delegate,t.toString());return new Oo(this,e)}e=Pr(this._delegate,t);return new Oo(this,e)},t.prototype.refFromURL=function(t){var e="database.refFromURL";Object(o.D)(e,1,1,arguments.length);var i=Mr(this._delegate,t);return new Oo(this,i)},t.prototype.goOffline=function(){return Object(o.D)("database.goOffline",0,0,arguments.length),Co(this._delegate)},t.prototype.goOnline=function(){return Object(o.D)("database.goOnline",0,0,arguments.length),So(this._delegate)},t.ServerValue={TIMESTAMP:To,increment:function(t){return function(t){return{".sv":{increment:t}}}(t)}},t}();var Do=Object.freeze({__proto__:null,forceLongPolling:function(){it.forceDisallow(),$.forceAllow()},forceWebSockets:function(){$.forceDisallow()},isWebSocketsAvailable:function(){return it.isAvailable()},setSecurityDebugCallback:function(t,e){t._delegate._repo.persistentConnection_.securityDebugCallback_=e},stats:function(t,e){!function(t,e){if(void 0===e&&(e=!1),"undefined"!=typeof console){var i;e?(t.statsListener_||(t.statsListener_=new Me(t.stats_)),i=t.statsListener_.get()):i=t.stats_.get();var n=Object.keys(i).reduce((function(t,e){return Math.max(e.length,t)}),0);N(i,(function(t,e){for(var i=t.length;i<n+2;i++)" "}))}}(t._delegate._repo,e)},statsIncrementCounter:function(t,e){!function(t,e){var i,n;t.stats_.incrementCounter(e),i=t.statsReporter_,n=e,i.statsToReport_[n]=!0}(t._delegate._repo,e)},dataUpdateCount:function(t){return t._delegate._repo.dataUpdateCount},interceptServerData:function(t,e){return function(t,e){t.interceptServerDataCallback_=e}(t._delegate._repo,e)},initStandalone:function(t){var e=t.app,i=t.url,n=t.version,o=t.customAuthImpl,a=t.namespace,s=t.nodeAdmin,h=void 0!==s&&s;u(n);var l=new r.c("auth-internal",new r.b("database-standalone"));return l.setComponent(new r.a("auth-internal",(function(){return o}),"PRIVATE")),{instance:new Ro(_o(e,l,void 0,i,h),e),namespace:a}}}),Lo=Pt;Pt.prototype.simpleListen=function(t,e){this.sendRequest("q",{p:t},e)},Pt.prototype.echo=function(t,e){this.sendRequest("echo",{d:t},e)};var No=rt,Bo=X,Fo=Object.freeze({__proto__:null,DataConnection:Lo,RealTimeConnection:No,hijackHash:function(t){var e=Pt.prototype.put;return Pt.prototype.put=function(i,n,r,o){void 0!==o&&(o=t()),e.call(this,i,n,r,o)},function(){Pt.prototype.put=e}},ConnectionTarget:Bo,queryIdentifier:function(t){return t._delegate._queryIdentifier},forceRestClient:function(t){!function(t){bo=t}(t)}}),zo=Ro.ServerValue;!function(t){u(t.SDK_VERSION);var i=t.INTERNAL.registerComponent(new r.a("database",(function(t,e){var i=e.instanceIdentifier,n=t.getProvider("app").getImmediate(),r=t.getProvider("auth-internal"),o=t.getProvider("app-check-internal");return new Ro(_o(n,r,o,i),n)}),"PUBLIC").setServiceProps({Reference:Oo,Query:ko,Database:Ro,DataSnapshot:Io,enableLogging:x,INTERNAL:Do,ServerValue:zo,TEST_ACCESS:Fo}).setMultipleInstances(!0));t.registerVersion("@firebase/database","0.10.9"),Object(o.t)()&&(e.exports=i)}(n.a)}).call(this,i(171),i(342)(t))},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e,i){"use strict";i(344);var n=i(116),r=i(172),o=i(48),a=i(49),s=i(73),h=a("species"),u=RegExp.prototype;t.exports=function(t,e,i,l){var c=a(t),d=!o((function(){var e={};return e[c]=function(){return 7},7!=""[t](e)})),p=d&&!o((function(){var e=!1,i=/a/;return"split"===t&&((i={}).constructor={},i.constructor[h]=function(){return i},i.flags="",i[c]=/./[c]),i.exec=function(){return e=!0,null},i[c](""),!e}));if(!d||!p||i){var f=/./[c],m=e(c,""[t],(function(t,e,i,n,o){var a=e.exec;return a===r||a===u.exec?d&&!o?{done:!0,value:f.call(e,i,n)}:{done:!0,value:t.call(i,e,n)}:{done:!1}}));n(String.prototype,t,m[0]),n(u,c,m[1])}l&&s(u[c],"sham",!0)}},function(t,e,i){"use strict";var n=i(101),r=i(172);n({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},function(t,e,i){"use strict";var n=i(79);t.exports=function(){var t=n(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e,i){var n=i(48),r=i(45).RegExp;e.UNSUPPORTED_Y=n((function(){var t=r("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),e.BROKEN_CARET=n((function(){var t=r("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},function(t,e,i){var n=i(48),r=i(45).RegExp;t.exports=n((function(){var t=r(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)}))},function(t,e,i){var n=i(48),r=i(45).RegExp;t.exports=n((function(){var t=r("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},function(t,e,i){"use strict";var n=i(350).charAt;t.exports=function(t,e,i){return e+(i?n(t,e).length:1)}},function(t,e,i){var n=i(92),r=i(132),o=i(112),a=function(t){return function(e,i){var a,s,h=r(o(e)),u=n(i),l=h.length;return u<0||u>=l?t?"":void 0:(a=h.charCodeAt(u))<55296||a>56319||u+1===l||(s=h.charCodeAt(u+1))<56320||s>57343?t?h.charAt(u):a:t?h.slice(u,u+2):s-56320+(a-55296<<10)+65536}};t.exports={codeAt:a(!1),charAt:a(!0)}},function(t,e,i){var n=i(100),r=Math.floor,o="".replace,a=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,s=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,i,h,u,l){var c=i+t.length,d=h.length,p=s;return void 0!==u&&(u=n(u),p=a),o.call(l,p,(function(n,o){var a;switch(o.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,i);case"'":return e.slice(c);case"<":a=u[o.slice(1,-1)];break;default:var s=+o;if(0===s)return n;if(s>d){var l=r(s/10);return 0===l?n:l<=d?void 0===h[l-1]?o.charAt(1):h[l-1]+o.charAt(1):n}a=h[s-1]}return void 0===a?"":a}))}},function(t,e,i){var n=i(126),r=i(172);t.exports=function(t,e){var i=t.exec;if("function"==typeof i){var o=i.call(t,e);if("object"!=typeof o)throw TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==n(t))throw TypeError("RegExp#exec called on incompatible receiver");return r.call(t,e)}},function(t,e,i){var n=i(116);t.exports=function(t,e,i){for(var r in e)n(t,r,e[r],i);return t}},function(t,e){var i=Math.abs,n=Math.pow,r=Math.floor,o=Math.log,a=Math.LN2;t.exports={pack:function(t,e,s){var h,u,l,c=new Array(s),d=8*s-e-1,p=(1<<d)-1,f=p>>1,m=23===e?n(2,-24)-n(2,-77):0,g=t<0||0===t&&1/t<0?1:0,y=0;for((t=i(t))!=t||t===1/0?(u=t!=t?1:0,h=p):(h=r(o(t)/a),t*(l=n(2,-h))<1&&(h--,l*=2),(t+=h+f>=1?m/l:m*n(2,1-f))*l>=2&&(h++,l/=2),h+f>=p?(u=0,h=p):h+f>=1?(u=(t*l-1)*n(2,e),h+=f):(u=t*n(2,f-1)*n(2,e),h=0));e>=8;c[y++]=255&u,u/=256,e-=8);for(h=h<<e|u,d+=e;d>0;c[y++]=255&h,h/=256,d-=8);return c[--y]|=128*g,c},unpack:function(t,e){var i,r=t.length,o=8*r-e-1,a=(1<<o)-1,s=a>>1,h=o-7,u=r-1,l=t[u--],c=127&l;for(l>>=7;h>0;c=256*c+t[u],u--,h-=8);for(i=c&(1<<-h)-1,c>>=-h,h+=e;h>0;i=256*i+t[u],u--,h-=8);if(0===c)c=1-s;else{if(c===a)return i?NaN:l?-1/0:1/0;i+=n(2,e),c-=s}return(l?-1:1)*i*n(2,c-e)}}},function(t,e,i){"use strict";var n=i(100),r=i(164),o=i(72);t.exports=function(t){for(var e=n(this),i=o(e.length),a=arguments.length,s=r(a>1?arguments[1]:void 0,i),h=a>2?arguments[2]:void 0,u=void 0===h?i:r(h,i);u>s;)e[s++]=t;return e}},function(t,e,i){var n=i(79),r=i(173),o=i(49)("species");t.exports=function(t,e){var i,a=n(t).constructor;return void 0===a||null==(i=n(a)[o])?e:r(i)}},function(t,e,i){var n=i(45),r=i(48),o=i(358),a=i(133).NATIVE_ARRAY_BUFFER_VIEWS,s=n.ArrayBuffer,h=n.Int8Array;t.exports=!a||!r((function(){h(1)}))||!r((function(){new h(-1)}))||!o((function(t){new h,new h(null),new h(1.5),new h(t)}),!0)||r((function(){return 1!==new h(new s(2),1,void 0).length}))},function(t,e,i){var n=i(49)("iterator"),r=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){r=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!r)return!1;var i=!1;try{var o={};o[n]=function(){return{next:function(){return{done:i=!0}}}},t(o)}catch(t){}return i}},function(t,e,i){var n={};n[i(49)("toStringTag")]="z",t.exports="[object z]"===String(n)},function(t,e,i){var n=i(59),r=Math.floor;t.exports=function(t){return!n(t)&&isFinite(t)&&r(t)===t}},function(t,e,i){var n=i(362);t.exports=function(t,e){var i=n(t);if(i%e)throw RangeError("Wrong offset");return i}},function(t,e,i){var n=i(92);t.exports=function(t){var e=n(t);if(e<0)throw RangeError("The argument can't be less than 0");return e}},function(t,e,i){var n=i(100),r=i(72),o=i(364),a=i(365),s=i(209),h=i(133).aTypedArrayConstructor;t.exports=function(t){var e,i,u,l,c,d,p=n(t),f=arguments.length,m=f>1?arguments[1]:void 0,g=void 0!==m,y=o(p);if(null!=y&&!a(y))for(d=(c=y.call(p)).next,p=[];!(l=d.call(c)).done;)p.push(l.value);for(g&&f>2&&(m=s(m,arguments[2],2)),i=r(p.length),u=new(h(this))(i),e=0;i>e;e++)u[e]=g?m(p[e],e):p[e];return u}},function(t,e,i){var n=i(174),r=i(114),o=i(49)("iterator");t.exports=function(t){if(null!=t)return t[o]||t["@@iterator"]||r[n(t)]}},function(t,e,i){var n=i(49),r=i(114),o=n("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||a[o]===t)}},function(t,e,i){var n=i(209),r=i(193),o=i(100),a=i(72),s=i(367),h=[].push,u=function(t){var e=1==t,i=2==t,u=3==t,l=4==t,c=6==t,d=7==t,p=5==t||c;return function(f,m,g,y){for(var v,b,_=o(f),w=r(_),x=n(m,g,3),C=a(w.length),S=0,T=y||s,A=e?T(f,C):i||d?T(f,0):void 0;C>S;S++)if((p||S in w)&&(b=x(v=w[S],S,_),t))if(e)A[S]=b;else if(b)switch(t){case 3:return!0;case 5:return v;case 6:return S;case 2:h.call(A,v)}else switch(t){case 4:return!1;case 7:h.call(A,v)}return c?-1:u||l?l:A}};t.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},function(t,e,i){var n=i(368);t.exports=function(t,e){return new(n(t))(0===e?0:e)}},function(t,e,i){var n=i(59),r=i(369),o=i(49)("species");t.exports=function(t){var e;return r(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!r(e.prototype)?n(e)&&null===(e=e[o])&&(e=void 0):e=void 0),void 0===e?Array:e}},function(t,e,i){var n=i(126);t.exports=Array.isArray||function(t){return"Array"==n(t)}},function(t,e,i){"use strict";var n=i(113),r=i(71),o=i(49),a=i(70),s=o("species");t.exports=function(t){var e=n(t),i=r.f;a&&e&&!e[s]&&i(e,s,{configurable:!0,get:function(){return this}})}},function(t,e,i){var n=i(59),r=i(117);t.exports=function(t,e,i){var o,a;return r&&"function"==typeof(o=e.constructor)&&o!==i&&n(a=o.prototype)&&a!==i.prototype&&r(t,a),t}},function(t,e){var i=Math.floor,n=function(t,e){var a=t.length,s=i(a/2);return a<8?r(t,e):o(n(t.slice(0,s),e),n(t.slice(s),e),e)},r=function(t,e){for(var i,n,r=t.length,o=1;o<r;){for(n=o,i=t[o];n&&e(t[n-1],i)>0;)t[n]=t[--n];n!==o++&&(t[n]=i)}return t},o=function(t,e,i){for(var n=t.length,r=e.length,o=0,a=0,s=[];o<n||a<r;)o<n&&a<r?s.push(i(t[o],e[a])<=0?t[o++]:e[a++]):s.push(o<n?t[o++]:e[a++]);return s};t.exports=n},function(t,e,i){var n=i(127).match(/firefox\/(\d+)/i);t.exports=!!n&&+n[1]},function(t,e,i){var n=i(127);t.exports=/MSIE|Trident/.test(n)},function(t,e,i){var n=i(127).match(/AppleWebKit\/(\d+)\./);t.exports=!!n&&+n[1]},function(t,e,i){var n=i(112),r=i(132),o="["+i(211)+"]",a=RegExp("^"+o+o+"*"),s=RegExp(o+o+"*$"),h=function(t){return function(e){var i=r(n(e));return 1&t&&(i=i.replace(a,"")),2&t&&(i=i.replace(s,"")),i}};t.exports={start:h(1),end:h(2),trim:h(3)}},function(t,e,i){var n=i(48),r=i(211);t.exports=function(t){return n((function(){return!!r[t]()||"…"!="…"[t]()||r[t].name!==t}))}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,i){"use strict";i(9),Object.defineProperty(e,"__esModule",{value:!0}),e.CollectorArray=void 0;const n=i(118);class CollectorArray extends n.Collector{constructor(){super(...arguments),this.result=[]}handleResult(t){return this.result.push(t),!0}getResult(){return this.result}reset(){this.result.length=0}}e.CollectorArray=CollectorArray},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CollectorLast=void 0;const n=i(118);class CollectorLast extends n.Collector{handleResult(t){return this.result=t,!0}getResult(){return this.result}reset(){delete this.result}}e.CollectorLast=CollectorLast},function(t,e,i){"use strict";i(9),Object.defineProperty(e,"__esModule",{value:!0}),e.CollectorUntil0=void 0;const n=i(118);class CollectorUntil0 extends n.Collector{constructor(){super(...arguments),this.result=!1}handleResult(t){return this.result=t,this.result}getResult(){return this.result}reset(){this.result=!1}}e.CollectorUntil0=CollectorUntil0},function(t,e,i){"use strict";i(9),Object.defineProperty(e,"__esModule",{value:!0}),e.CollectorWhile0=void 0;const n=i(118);class CollectorWhile0 extends n.Collector{constructor(){super(...arguments),this.result=!1}handleResult(t){return this.result=t,!this.result}getResult(){return this.result}reset(){this.result=!1}}e.CollectorWhile0=CollectorWhile0},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Signal=void 0;const n=i(431),r=i(432);e.Signal=class Signal{constructor(){this.head=new r.SignalLink,this.hasNewLinks=!1,this.emitDepth=0}connect(t,e=0){const i=this.head.insert(t,e);return this.emitDepth>0&&(this.hasNewLinks=!0,i.newLink=!0),new n.SignalConnectionImpl(i)}disconnect(t){for(let e=this.head.next;e!==this.head;e=e.next)if(e.callback===t)return e.unlink(),!0;return!1}disconnectAll(){for(;this.head.next!==this.head;)this.head.next.unlink()}emit(...t){this.emitDepth++;for(let e=this.head.next;e!==this.head;e=e.next)e.isEnabled()&&e.callback&&e.callback.apply(null,t);this.emitDepth--,this.unsetNewLink()}emitCollecting(t,e){this.emitDepth++;for(let i=this.head.next;i!==this.head;i=i.next)if(i.isEnabled()&&i.callback){const n=i.callback.apply(null,e);if(!t.handleResult(n))break}this.emitDepth--,this.unsetNewLink()}unsetNewLink(){if(this.hasNewLinks&&0===this.emitDepth){for(let t=this.head.next;t!==this.head;t=t.next)t.newLink=!1;this.hasNewLinks=!1}}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SignalConnectionImpl=void 0;e.SignalConnectionImpl=class SignalConnectionImpl{constructor(t){this.link=t}disconnect(){return null!==this.link&&(this.link.unlink(),this.link=null,!0)}set enabled(t){this.link&&this.link.setEnabled(t)}get enabled(){return null!==this.link&&this.link.isEnabled()}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SignalLink=void 0;class SignalLink{constructor(t=null,e=null,i=0){this.enabled=!0,this.newLink=!1,this.callback=null,this.prev=null!=t?t:this,this.next=null!=e?e:this,this.order=i}isEnabled(){return this.enabled&&!this.newLink}setEnabled(t){this.enabled=t}unlink(){this.callback=null,this.next.prev=this.prev,this.prev.next=this.next}insert(t,e){let i=this.prev;for(;i!==this&&!(i.order<=e);)i=i.prev;const n=new SignalLink(i,i.next,e);return n.callback=t,i.next=n,n.next.prev=n,n}}e.SignalLink=SignalLink},function(t,e,i){"use strict";i(9),Object.defineProperty(e,"__esModule",{value:!0}),e.SignalConnections=void 0;e.SignalConnections=class SignalConnections{constructor(){this.list=[]}add(t){this.list.push(t)}disconnectAll(){for(const t of this.list)t.disconnect();this.list=[]}}},,,function(t,e,i){"use strict";(function(t){var n=i(437),r=i(438),o=i(439);function a(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return h.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=h.prototype:(null===t&&(t=new h(e)),t.length=e),t}function h(t,e,i){if(!(h.TYPED_ARRAY_SUPPORT||this instanceof h))return new h(t,e,i);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return u(this,t,e,i)}function u(t,e,i,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,i,n){if(e.byteLength,i<0||e.byteLength<i)throw new RangeError("'offset' is out of bounds");if(e.byteLength<i+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===i&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,i):new Uint8Array(e,i,n);h.TYPED_ARRAY_SUPPORT?(t=e).__proto__=h.prototype:t=d(t,e);return t}(t,e,i,n):"string"==typeof e?function(t,e,i){"string"==typeof i&&""!==i||(i="utf8");if(!h.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var n=0|f(e,i),r=(t=s(t,n)).write(e,i);r!==n&&(t=t.slice(0,r));return t}(t,e,i):function(t,e){if(h.isBuffer(e)){var i=0|p(e.length);return 0===(t=s(t,i)).length||e.copy(t,0,0,i),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?s(t,0):d(t,e);if("Buffer"===e.type&&o(e.data))return d(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function c(t,e){if(l(e),t=s(t,e<0?0:0|p(e)),!h.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)t[i]=0;return t}function d(t,e){var i=e.length<0?0:0|p(e.length);t=s(t,i);for(var n=0;n<i;n+=1)t[n]=255&e[n];return t}function p(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function f(t,e){if(h.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var i=t.length;if(0===i)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return j(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return G(t).length;default:if(n)return j(t).length;e=(""+e).toLowerCase(),n=!0}}function m(t,e,i){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return M(this,e,i);case"utf8":case"utf-8":return A(this,e,i);case"ascii":return E(this,e,i);case"latin1":case"binary":return P(this,e,i);case"base64":return T(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,i);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function y(t,e,i,n,r){if(0===t.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=r?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(r)return-1;i=t.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof e&&(e=h.from(e,n)),h.isBuffer(e))return 0===e.length?-1:v(t,e,i,n,r);if("number"==typeof e)return e&=255,h.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):v(t,[e],i,n,r);throw new TypeError("val must be string, number or Buffer")}function v(t,e,i,n,r){var o,a=1,s=t.length,h=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,h/=2,i/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(r){var l=-1;for(o=i;o<s;o++)if(u(t,o)===u(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===h)return l*a}else-1!==l&&(o-=o-l),l=-1}else for(i+h>s&&(i=s-h),o=i;o>=0;o--){for(var c=!0,d=0;d<h;d++)if(u(t,o+d)!==u(e,d)){c=!1;break}if(c)return o}return-1}function b(t,e,i,n){i=Number(i)||0;var r=t.length-i;n?(n=Number(n))>r&&(n=r):n=r;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[i+a]=s}return a}function _(t,e,i,n){return U(j(e,t.length-i),t,i,n)}function w(t,e,i,n){return U(function(t){for(var e=[],i=0;i<t.length;++i)e.push(255&t.charCodeAt(i));return e}(e),t,i,n)}function x(t,e,i,n){return w(t,e,i,n)}function C(t,e,i,n){return U(G(e),t,i,n)}function S(t,e,i,n){return U(function(t,e){for(var i,n,r,o=[],a=0;a<t.length&&!((e-=2)<0);++a)i=t.charCodeAt(a),n=i>>8,r=i%256,o.push(r),o.push(n);return o}(e,t.length-i),t,i,n)}function T(t,e,i){return 0===e&&i===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,i))}function A(t,e,i){i=Math.min(t.length,i);for(var n=[],r=e;r<i;){var o,a,s,h,u=t[r],l=null,c=u>239?4:u>223?3:u>191?2:1;if(r+c<=i)switch(c){case 1:u<128&&(l=u);break;case 2:128==(192&(o=t[r+1]))&&(h=(31&u)<<6|63&o)>127&&(l=h);break;case 3:o=t[r+1],a=t[r+2],128==(192&o)&&128==(192&a)&&(h=(15&u)<<12|(63&o)<<6|63&a)>2047&&(h<55296||h>57343)&&(l=h);break;case 4:o=t[r+1],a=t[r+2],s=t[r+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(h=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&h<1114112&&(l=h)}null===l?(l=65533,c=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),r+=c}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var i="",n=0;for(;n<e;)i+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return i}(n)}e.Buffer=h,e.SlowBuffer=function(t){+t!=t&&(t=0);return h.alloc(+t)},e.INSPECT_MAX_BYTES=50,h.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),h.poolSize=8192,h._augment=function(t){return t.__proto__=h.prototype,t},h.from=function(t,e,i){return u(null,t,e,i)},h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0})),h.alloc=function(t,e,i){return function(t,e,i,n){return l(e),e<=0?s(t,e):void 0!==i?"string"==typeof n?s(t,e).fill(i,n):s(t,e).fill(i):s(t,e)}(null,t,e,i)},h.allocUnsafe=function(t){return c(null,t)},h.allocUnsafeSlow=function(t){return c(null,t)},h.isBuffer=function(t){return!(null==t||!t._isBuffer)},h.compare=function(t,e){if(!h.isBuffer(t)||!h.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var i=t.length,n=e.length,r=0,o=Math.min(i,n);r<o;++r)if(t[r]!==e[r]){i=t[r],n=e[r];break}return i<n?-1:n<i?1:0},h.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return h.alloc(0);var i;if(void 0===e)for(e=0,i=0;i<t.length;++i)e+=t[i].length;var n=h.allocUnsafe(e),r=0;for(i=0;i<t.length;++i){var a=t[i];if(!h.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,r),r+=a.length}return n},h.byteLength=f,h.prototype._isBuffer=!0,h.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},h.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},h.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},h.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?A(this,0,t):m.apply(this,arguments)},h.prototype.equals=function(t){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===h.compare(this,t)},h.prototype.inspect=function(){var t="",i=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(t+=" ... ")),"<Buffer "+t+">"},h.prototype.compare=function(t,e,i,n,r){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===i&&(i=t?t.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),e<0||i>t.length||n<0||r>this.length)throw new RangeError("out of range index");if(n>=r&&e>=i)return 0;if(n>=r)return-1;if(e>=i)return 1;if(this===t)return 0;for(var o=(r>>>=0)-(n>>>=0),a=(i>>>=0)-(e>>>=0),s=Math.min(o,a),u=this.slice(n,r),l=t.slice(e,i),c=0;c<s;++c)if(u[c]!==l[c]){o=u[c],a=l[c];break}return o<a?-1:a<o?1:0},h.prototype.includes=function(t,e,i){return-1!==this.indexOf(t,e,i)},h.prototype.indexOf=function(t,e,i){return y(this,t,e,i,!0)},h.prototype.lastIndexOf=function(t,e,i){return y(this,t,e,i,!1)},h.prototype.write=function(t,e,i,n){if(void 0===e)n="utf8",i=this.length,e=0;else if(void 0===i&&"string"==typeof e)n=e,i=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(i)?(i|=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var r=this.length-e;if((void 0===i||i>r)&&(i=r),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return b(this,t,e,i);case"utf8":case"utf-8":return _(this,t,e,i);case"ascii":return w(this,t,e,i);case"latin1":case"binary":return x(this,t,e,i);case"base64":return C(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,i);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function E(t,e,i){var n="";i=Math.min(t.length,i);for(var r=e;r<i;++r)n+=String.fromCharCode(127&t[r]);return n}function P(t,e,i){var n="";i=Math.min(t.length,i);for(var r=e;r<i;++r)n+=String.fromCharCode(t[r]);return n}function M(t,e,i){var n=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>n)&&(i=n);for(var r="",o=e;o<i;++o)r+=z(t[o]);return r}function I(t,e,i){for(var n=t.slice(e,i),r="",o=0;o<n.length;o+=2)r+=String.fromCharCode(n[o]+256*n[o+1]);return r}function k(t,e,i){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,i,n,r,o){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||e<o)throw new RangeError('"value" argument is out of bounds');if(i+n>t.length)throw new RangeError("Index out of range")}function R(t,e,i,n){e<0&&(e=65535+e+1);for(var r=0,o=Math.min(t.length-i,2);r<o;++r)t[i+r]=(e&255<<8*(n?r:1-r))>>>8*(n?r:1-r)}function D(t,e,i,n){e<0&&(e=4294967295+e+1);for(var r=0,o=Math.min(t.length-i,4);r<o;++r)t[i+r]=e>>>8*(n?r:3-r)&255}function L(t,e,i,n,r,o){if(i+n>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function N(t,e,i,n,o){return o||L(t,0,i,4),r.write(t,e,i,n,23,4),i+4}function B(t,e,i,n,o){return o||L(t,0,i,8),r.write(t,e,i,n,52,8),i+8}h.prototype.slice=function(t,e){var i,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),h.TYPED_ARRAY_SUPPORT)(i=this.subarray(t,e)).__proto__=h.prototype;else{var r=e-t;i=new h(r,void 0);for(var o=0;o<r;++o)i[o]=this[o+t]}return i},h.prototype.readUIntLE=function(t,e,i){t|=0,e|=0,i||k(t,e,this.length);for(var n=this[t],r=1,o=0;++o<e&&(r*=256);)n+=this[t+o]*r;return n},h.prototype.readUIntBE=function(t,e,i){t|=0,e|=0,i||k(t,e,this.length);for(var n=this[t+--e],r=1;e>0&&(r*=256);)n+=this[t+--e]*r;return n},h.prototype.readUInt8=function(t,e){return e||k(t,1,this.length),this[t]},h.prototype.readUInt16LE=function(t,e){return e||k(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUInt16BE=function(t,e){return e||k(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUInt32LE=function(t,e){return e||k(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUInt32BE=function(t,e){return e||k(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readIntLE=function(t,e,i){t|=0,e|=0,i||k(t,e,this.length);for(var n=this[t],r=1,o=0;++o<e&&(r*=256);)n+=this[t+o]*r;return n>=(r*=128)&&(n-=Math.pow(2,8*e)),n},h.prototype.readIntBE=function(t,e,i){t|=0,e|=0,i||k(t,e,this.length);for(var n=e,r=1,o=this[t+--n];n>0&&(r*=256);)o+=this[t+--n]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*e)),o},h.prototype.readInt8=function(t,e){return e||k(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){e||k(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},h.prototype.readInt16BE=function(t,e){e||k(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},h.prototype.readInt32LE=function(t,e){return e||k(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return e||k(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readFloatLE=function(t,e){return e||k(t,4,this.length),r.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return e||k(t,4,this.length),r.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return e||k(t,8,this.length),r.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return e||k(t,8,this.length),r.read(this,t,!1,52,8)},h.prototype.writeUIntLE=function(t,e,i,n){(t=+t,e|=0,i|=0,n)||O(this,t,e,i,Math.pow(2,8*i)-1,0);var r=1,o=0;for(this[e]=255&t;++o<i&&(r*=256);)this[e+o]=t/r&255;return e+i},h.prototype.writeUIntBE=function(t,e,i,n){(t=+t,e|=0,i|=0,n)||O(this,t,e,i,Math.pow(2,8*i)-1,0);var r=i-1,o=1;for(this[e+r]=255&t;--r>=0&&(o*=256);)this[e+r]=t/o&255;return e+i},h.prototype.writeUInt8=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,1,255,0),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},h.prototype.writeUInt16LE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},h.prototype.writeUInt16BE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},h.prototype.writeUInt32LE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):D(this,t,e,!0),e+4},h.prototype.writeUInt32BE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},h.prototype.writeIntLE=function(t,e,i,n){if(t=+t,e|=0,!n){var r=Math.pow(2,8*i-1);O(this,t,e,i,r-1,-r)}var o=0,a=1,s=0;for(this[e]=255&t;++o<i&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+i},h.prototype.writeIntBE=function(t,e,i,n){if(t=+t,e|=0,!n){var r=Math.pow(2,8*i-1);O(this,t,e,i,r-1,-r)}var o=i-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+i},h.prototype.writeInt8=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,1,127,-128),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},h.prototype.writeInt16LE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},h.prototype.writeInt16BE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},h.prototype.writeInt32LE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):D(this,t,e,!0),e+4},h.prototype.writeInt32BE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},h.prototype.writeFloatLE=function(t,e,i){return N(this,t,e,!0,i)},h.prototype.writeFloatBE=function(t,e,i){return N(this,t,e,!1,i)},h.prototype.writeDoubleLE=function(t,e,i){return B(this,t,e,!0,i)},h.prototype.writeDoubleBE=function(t,e,i){return B(this,t,e,!1,i)},h.prototype.copy=function(t,e,i,n){if(i||(i=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-i&&(n=t.length-e+i);var r,o=n-i;if(this===t&&i<e&&e<n)for(r=o-1;r>=0;--r)t[r+e]=this[r+i];else if(o<1e3||!h.TYPED_ARRAY_SUPPORT)for(r=0;r<o;++r)t[r+e]=this[r+i];else Uint8Array.prototype.set.call(t,this.subarray(i,i+o),e);return o},h.prototype.fill=function(t,e,i,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),1===t.length){var r=t.charCodeAt(0);r<256&&(t=r)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!h.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;var o;if(e>>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(o=e;o<i;++o)this[o]=t;else{var a=h.isBuffer(t)?t:j(new h(t,n).toString()),s=a.length;for(o=0;o<i-e;++o)this[o+e]=a[o%s]}return this};var F=/[^+\/0-9A-Za-z-_]/g;function z(t){return t<16?"0"+t.toString(16):t.toString(16)}function j(t,e){var i;e=e||1/0;for(var n=t.length,r=null,o=[],a=0;a<n;++a){if((i=t.charCodeAt(a))>55295&&i<57344){if(!r){if(i>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(e-=3)>-1&&o.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(e-=3)>-1&&o.push(239,191,189);if(r=null,i<128){if((e-=1)<0)break;o.push(i)}else if(i<2048){if((e-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return o}function G(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function U(t,e,i,n){for(var r=0;r<n&&!(r+i>=e.length||r>=t.length);++r)e[r+i]=t[r];return r}}).call(this,i(82))},function(t,e,i){"use strict";e.byteLength=function(t){var e=u(t),i=e[0],n=e[1];return 3*(i+n)/4-n},e.toByteArray=function(t){var e,i,n=u(t),a=n[0],s=n[1],h=new o(function(t,e,i){return 3*(e+i)/4-i}(0,a,s)),l=0,c=s>0?a-4:a;for(i=0;i<c;i+=4)e=r[t.charCodeAt(i)]<<18|r[t.charCodeAt(i+1)]<<12|r[t.charCodeAt(i+2)]<<6|r[t.charCodeAt(i+3)],h[l++]=e>>16&255,h[l++]=e>>8&255,h[l++]=255&e;2===s&&(e=r[t.charCodeAt(i)]<<2|r[t.charCodeAt(i+1)]>>4,h[l++]=255&e);1===s&&(e=r[t.charCodeAt(i)]<<10|r[t.charCodeAt(i+1)]<<4|r[t.charCodeAt(i+2)]>>2,h[l++]=e>>8&255,h[l++]=255&e);return h},e.fromByteArray=function(t){for(var e,i=t.length,r=i%3,o=[],a=0,s=i-r;a<s;a+=16383)o.push(l(t,a,a+16383>s?s:a+16383));1===r?(e=t[i-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===r&&(e=(t[i-2]<<8)+t[i-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,h=a.length;s<h;++s)n[s]=a[s],r[a.charCodeAt(s)]=s;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return-1===i&&(i=e),[i,i===e?0:4-i%4]}function l(t,e,i){for(var r,o,a=[],s=e;s<i;s+=3)r=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(n[(o=r)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,i,n,r){var o,a,s=8*r-n-1,h=(1<<s)-1,u=h>>1,l=-7,c=i?r-1:0,d=i?-1:1,p=t[e+c];for(c+=d,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+t[e+c],c+=d,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[e+c],c+=d,l-=8);if(0===o)o=1-u;else{if(o===h)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=u}return(p?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,i,n,r,o){var a,s,h,u=8*o-r-1,l=(1<<u)-1,c=l>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,f=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-a))<1&&(a--,h*=2),(e+=a+c>=1?d/h:d*Math.pow(2,1-c))*h>=2&&(a++,h/=2),a+c>=l?(s=0,a=l):a+c>=1?(s=(e*h-1)*Math.pow(2,r),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,r),a=0));r>=8;t[i+p]=255&s,p+=f,s/=256,r-=8);for(a=a<<r|s,u+=r;u>0;t[i+p]=255&a,p+=f,a/=256,u-=8);t[i+p-f]|=128*m}},function(t,e){var i={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==i.call(t)}},,,,function(t,e,i){"use strict";i(9),Object.defineProperty(e,"__esModule",{value:!0}),e.batchGeometry=void 0;const n=i(177),r={positions:3,normals:3,weights:4,boneIndices:4,uvs:2,tangents:4};e.batchGeometry=function(t){const e=t.geometry,i=new Map;e.forEach(t=>{t.primitives.forEach(t=>{const e=function(t){const e=[];for(const i in r)t.attributes[i]&&e.push(i);return e.join("|")}(t),n=i.get(e)||[];n.push(t),i.set(e,n)})});let o=[];i.forEach((t,e)=>{const i=function(t,e){const i=[];let n={indexSize:0,size:0,primitives:[],sigMap:e};return i.push(n),t.forEach(t=>{if(!t.indices)throw new Error("can only merge geometry with indices for now..");const r=t.attributes.positions.length/3;n.indexSize+r>65535&&(n={indexSize:0,size:0,primitives:[],sigMap:e},i.push(n)),n.indexSize+=r,n.size+=t.indices.length,n.primitives.push(t)}),i}(t,e).filter(t=>t.primitives.length>1);o=o.concat(i)});const a=[];o.forEach(t=>{const i=function(t){let e=0;const i=t.primitives.map(t=>{const i={bounds:t.bounds,start:e,size:t.indices.length,material:t.material,geometry:-1};return e+=t.indices.length,i});return{primitive:n.mergePrimitives(t.primitives),primitives:t.primitives,frags:i}}(t);a.push(i.primitive),e.forEach(t=>{t.primitives.forEach((e,n)=>{const r=i.primitives.indexOf(e);-1!==r&&(i.frags[r].geometry=a.length-1,t.primitives[n]=i.frags[r])})})}),t.geometryBatch=a}},function(t,e,i){"use strict";i(9),i(29),i(34),i(30),i(63),i(175),Object.defineProperty(e,"__esModule",{value:!0}),e.compressGBObject=void 0;const n=i(212),r=i(213);e.compressGBObject=function(t){var e,i,o,a,s;const h=[],u={s:3,t:3,r:4,w:1};null===(e=t.animations)||void 0===e||e.forEach(t=>{t.data.forEach(t=>{for(const e in u)t[e]&&(h.push({compress:!0,size:1,buffer:t[e].times}),t[e].times=h.length-1,h.push({compress:!0,size:u[e],buffer:t[e].values}),t[e].values=h.length-1)})});const l={positions:3,normals:3,weights:4,boneIndices:4,uvs:2,indices:1,tangents:4},c={positions:!0,normals:!0,weights:!0,boneIndices:!0,uvs:!0,tangents:!0};function d(t){for(const e in l)t.attributes[e]&&(h.push({compress:c[e],size:l[e],buffer:t.attributes[e]}),t.attributes[e]=h.length-1);t.indices&&(h.push({compress:!0,size:1,buffer:t.indices}),t.indices=h.length-1),t.targets&&t.targets.forEach(t=>{for(const e in l)t[e]&&(h.push({compress:c[e],size:l[e],buffer:t[e]}),t[e]=h.length-1)})}return null===(i=t.geometryBatch)||void 0===i||i.forEach(t=>{d(t)}),null===(o=t.geometry)||void 0===o||o.forEach(t=>{t.primitives.forEach(t=>{t.attributes&&d(t)})}),null===(a=t.nodes)||void 0===a||a.forEach(t=>{t.inverseBindMatrix&&(t.inverseBindMatrix?(h.push({compress:!1,size:1,buffer:t.inverseBindMatrix}),t.inverseBindMatrix=h.length-1):t.inverseBindMatrix=-1),t.transform&&(t.transform?(h.push({compress:!1,size:1,buffer:t.transform}),t.transform=h.length-1):t.transform=-1)}),null===(s=t.skins)||void 0===s||s.forEach(t=>{t.bindMatrix?(h.push({compress:!1,size:1,buffer:t.bindMatrix}),t.bindMatrix=h.length-1):t.bindMatrix=-1}),function(t,e){const i={UINT16:0,FLOAT32:1,STRING:2,FLOAT32_COMPRESSED:3,UINT16_COMPRESSED:4},o=JSON.stringify(t);let a=2*o.length+4+4;a%4&&(a+=a%4);e.forEach(t=>{const e=t.buffer.slice(0);t.compress&&(e instanceof Float32Array?t.compressed=n.compressArray(e,t.size||1):t.compressed=e,t.compressed=r.zipArray(t.compressed))});let s=e.reduce((t,e)=>{if(t+=8,e.compressed){const i=e.compressed.buffer.byteLength;t+=i+(4-i%4)}else t+=e.buffer.buffer.byteLength;return t},a);s+=4-s%4;const h=new ArrayBuffer(s),u=new Float32Array(h),l=new Uint16Array(h),c=new Uint8Array(h);let d=0;u[d++]=o.length,u[d++]=i.STRING;const p=o.length;for(let t=0;t<p;t++)l[2*d]=o.charCodeAt(t),d+=.5;d%1!=0&&(d+=.5);return e.forEach(t=>{const e=t.buffer;if(e instanceof Uint16Array)if(t.compressed){u[d++]=t.compressed.length,u[d++]=i.UINT16_COMPRESSED;const e=t.compressed;for(let t=0;t<e.length;t++)c[4*d]=e[t],d+=.25;d+=1-d%1}else{u[d++]=e.length,u[d++]=i.UINT16;for(let t=0;t<e.length;t++)l[2*d]=e[t],d+=.5;d+=d%1}else if(e instanceof Float32Array)if(t.compressed){u[d++]=t.compressed.length,u[d++]=i.FLOAT32_COMPRESSED;const e=t.compressed;for(let t=0;t<e.length;t++)c[4*d]=e[t],d+=.25;d+=1-d%1}else{u[d++]=e.length,u[d++]=i.FLOAT32;for(let t=0;t<e.length;t++)u[d++]=e[t]}}),h}(t,h)}},function(t,e,i){"use strict";var n={};(0,i(83).assign)(n,i(446),i(449),i(218)),t.exports=n},function(t,e,i){"use strict";var n=i(447),r=i(83),o=i(216),a=i(179),s=i(217),h=Object.prototype.toString;function u(t){if(!(this instanceof u))return new u(t);this.options=r.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var i=n.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==i)throw new Error(a[i]);if(e.header&&n.deflateSetHeader(this.strm,e.header),e.dictionary){var l;if(l="string"==typeof e.dictionary?o.string2buf(e.dictionary):"[object ArrayBuffer]"===h.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(i=n.deflateSetDictionary(this.strm,l)))throw new Error(a[i]);this._dict_set=!0}}function l(t,e){var i=new u(e);if(i.push(t,!0),i.err)throw i.msg||a[i.err];return i.result}u.prototype.push=function(t,e){var i,a,s=this.strm,u=this.options.chunkSize;if(this.ended)return!1;a=e===~~e?e:!0===e?4:0,"string"==typeof t?s.input=o.string2buf(t):"[object ArrayBuffer]"===h.call(t)?s.input=new Uint8Array(t):s.input=t,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new r.Buf8(u),s.next_out=0,s.avail_out=u),1!==(i=n.deflate(s,a))&&0!==i)return this.onEnd(i),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(o.buf2binstring(r.shrinkBuf(s.output,s.next_out))):this.onData(r.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==i);return 4===a?(i=n.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,0===i):2!==a||(this.onEnd(0),s.avail_out=0,!0)},u.prototype.onData=function(t){this.chunks.push(t)},u.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Deflate=u,e.deflate=l,e.deflateRaw=function(t,e){return(e=e||{}).raw=!0,l(t,e)},e.gzip=function(t,e){return(e=e||{}).gzip=!0,l(t,e)}},function(t,e,i){"use strict";var n,r=i(83),o=i(448),a=i(214),s=i(215),h=i(179);function u(t,e){return t.msg=h[e],e}function l(t){return(t<<1)-(t>4?9:0)}function c(t){for(var e=t.length;--e>=0;)t[e]=0}function d(t){var e=t.state,i=e.pending;i>t.avail_out&&(i=t.avail_out),0!==i&&(r.arraySet(t.output,e.pending_buf,e.pending_out,i,t.next_out),t.next_out+=i,e.pending_out+=i,t.total_out+=i,t.avail_out-=i,e.pending-=i,0===e.pending&&(e.pending_out=0))}function p(t,e){o._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,d(t.strm)}function f(t,e){t.pending_buf[t.pending++]=e}function m(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function g(t,e){var i,n,r=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,h=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,u=t.window,l=t.w_mask,c=t.prev,d=t.strstart+258,p=u[o+a-1],f=u[o+a];t.prev_length>=t.good_match&&(r>>=2),s>t.lookahead&&(s=t.lookahead);do{if(u[(i=e)+a]===f&&u[i+a-1]===p&&u[i]===u[o]&&u[++i]===u[o+1]){o+=2,i++;do{}while(u[++o]===u[++i]&&u[++o]===u[++i]&&u[++o]===u[++i]&&u[++o]===u[++i]&&u[++o]===u[++i]&&u[++o]===u[++i]&&u[++o]===u[++i]&&u[++o]===u[++i]&&o<d);if(n=258-(d-o),o=d-258,n>a){if(t.match_start=e,a=n,n>=s)break;p=u[o+a-1],f=u[o+a]}}}while((e=c[e&l])>h&&0!=--r);return a<=t.lookahead?a:t.lookahead}function y(t){var e,i,n,o,h,u,l,c,d,p,f=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-262)){r.arraySet(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=i=t.hash_size;do{n=t.head[--e],t.head[e]=n>=f?n-f:0}while(--i);e=i=f;do{n=t.prev[--e],t.prev[e]=n>=f?n-f:0}while(--i);o+=f}if(0===t.strm.avail_in)break;if(u=t.strm,l=t.window,c=t.strstart+t.lookahead,d=o,p=void 0,(p=u.avail_in)>d&&(p=d),i=0===p?0:(u.avail_in-=p,r.arraySet(l,u.input,u.next_in,p,c),1===u.state.wrap?u.adler=a(u.adler,l,p,c):2===u.state.wrap&&(u.adler=s(u.adler,l,p,c)),u.next_in+=p,u.total_in+=p,p),t.lookahead+=i,t.lookahead+t.insert>=3)for(h=t.strstart-t.insert,t.ins_h=t.window[h],t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+3-1])&t.hash_mask,t.prev[h&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=h,h++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)}function v(t,e){for(var i,n;;){if(t.lookahead<262){if(y(t),t.lookahead<262&&0===e)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==i&&t.strstart-i<=t.w_size-262&&(t.match_length=g(t,i)),t.match_length>=3)if(n=o._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else n=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(p(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(p(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}function b(t,e){for(var i,n,r;;){if(t.lookahead<262){if(y(t),t.lookahead<262&&0===e)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==i&&t.prev_length<t.max_lazy_match&&t.strstart-i<=t.w_size-262&&(t.match_length=g(t,i),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(p(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=o._tr_tally(t,0,t.window[t.strstart-1]))&&p(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=o._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(p(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}function _(t,e,i,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=i,this.max_chain=n,this.func=r}function w(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(1146),this.dyn_dtree=new r.Buf16(122),this.bl_tree=new r.Buf16(78),c(this.dyn_ltree),c(this.dyn_dtree),c(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(16),this.heap=new r.Buf16(573),c(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(573),c(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function x(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=0,o._tr_init(e),0):u(t,-2)}function C(t){var e,i=x(t);return 0===i&&((e=t.state).window_size=2*e.w_size,c(e.head),e.max_lazy_match=n[e.level].max_lazy,e.good_match=n[e.level].good_length,e.nice_match=n[e.level].nice_length,e.max_chain_length=n[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i}function S(t,e,i,n,o,a){if(!t)return-2;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),o<1||o>9||8!==i||n<8||n>15||e<0||e>9||a<0||a>4)return u(t,-2);8===n&&(n=9);var h=new w;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=o+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new r.Buf8(2*h.w_size),h.head=new r.Buf16(h.hash_size),h.prev=new r.Buf16(h.w_size),h.lit_bufsize=1<<o+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new r.Buf8(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=a,h.method=i,C(t)}n=[new _(0,0,0,0,(function(t,e){var i=65535;for(i>t.pending_buf_size-5&&(i=t.pending_buf_size-5);;){if(t.lookahead<=1){if(y(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+i;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,p(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-262&&(p(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(p(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(p(t,!1),t.strm.avail_out),1)})),new _(4,4,8,4,v),new _(4,5,16,8,v),new _(4,6,32,32,v),new _(4,4,16,16,b),new _(8,16,32,32,b),new _(8,16,128,128,b),new _(8,32,128,256,b),new _(32,128,258,1024,b),new _(32,258,258,4096,b)],e.deflateInit=function(t,e){return S(t,e,8,15,8,0)},e.deflateInit2=S,e.deflateReset=C,e.deflateResetKeep=x,e.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?-2:(t.state.gzhead=e,0):-2},e.deflate=function(t,e){var i,r,a,h;if(!t||!t.state||e>5||e<0)return t?u(t,-2):-2;if(r=t.state,!t.output||!t.input&&0!==t.avail_in||666===r.status&&4!==e)return u(t,0===t.avail_out?-5:-2);if(r.strm=t,i=r.last_flush,r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,f(r,31),f(r,139),f(r,8),r.gzhead?(f(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),f(r,255&r.gzhead.time),f(r,r.gzhead.time>>8&255),f(r,r.gzhead.time>>16&255),f(r,r.gzhead.time>>24&255),f(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),f(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(f(r,255&r.gzhead.extra.length),f(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=s(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(f(r,0),f(r,0),f(r,0),f(r,0),f(r,0),f(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),f(r,3),r.status=113);else{var g=8+(r.w_bits-8<<4)<<8;g|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(g|=32),g+=31-g%31,r.status=113,m(r,g),0!==r.strstart&&(m(r,t.adler>>>16),m(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=s(t.adler,r.pending_buf,r.pending-a,a)),d(t),a=r.pending,r.pending!==r.pending_buf_size));)f(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=s(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=s(t.adler,r.pending_buf,r.pending-a,a)),d(t),a=r.pending,r.pending===r.pending_buf_size)){h=1;break}h=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,f(r,h)}while(0!==h);r.gzhead.hcrc&&r.pending>a&&(t.adler=s(t.adler,r.pending_buf,r.pending-a,a)),0===h&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=s(t.adler,r.pending_buf,r.pending-a,a)),d(t),a=r.pending,r.pending===r.pending_buf_size)){h=1;break}h=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,f(r,h)}while(0!==h);r.gzhead.hcrc&&r.pending>a&&(t.adler=s(t.adler,r.pending_buf,r.pending-a,a)),0===h&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&d(t),r.pending+2<=r.pending_buf_size&&(f(r,255&t.adler),f(r,t.adler>>8&255),t.adler=0,r.status=113)):r.status=113),0!==r.pending){if(d(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&l(e)<=l(i)&&4!==e)return u(t,-5);if(666===r.status&&0!==t.avail_in)return u(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&666!==r.status){var v=2===r.strategy?function(t,e){for(var i;;){if(0===t.lookahead&&(y(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,i=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,i&&(p(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(p(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var i,n,r,a,s=t.window;;){if(t.lookahead<=258){if(y(t),t.lookahead<=258&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){a=t.strstart+258;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<a);t.match_length=258-(a-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(i=o._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(i=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),i&&(p(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(p(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}(r,e):n[r.level].func(r,e);if(3!==v&&4!==v||(r.status=666),1===v||3===v)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===v&&(1===e?o._tr_align(r):5!==e&&(o._tr_stored_block(r,0,0,!1),3===e&&(c(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),d(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(f(r,255&t.adler),f(r,t.adler>>8&255),f(r,t.adler>>16&255),f(r,t.adler>>24&255),f(r,255&t.total_in),f(r,t.total_in>>8&255),f(r,t.total_in>>16&255),f(r,t.total_in>>24&255)):(m(r,t.adler>>>16),m(r,65535&t.adler)),d(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},e.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&103!==e&&113!==e&&666!==e?u(t,-2):(t.state=null,113===e?u(t,-3):0):-2},e.deflateSetDictionary=function(t,e){var i,n,o,s,h,u,l,d,p=e.length;if(!t||!t.state)return-2;if(2===(s=(i=t.state).wrap)||1===s&&42!==i.status||i.lookahead)return-2;for(1===s&&(t.adler=a(t.adler,e,p,0)),i.wrap=0,p>=i.w_size&&(0===s&&(c(i.head),i.strstart=0,i.block_start=0,i.insert=0),d=new r.Buf8(i.w_size),r.arraySet(d,e,p-i.w_size,i.w_size,0),e=d,p=i.w_size),h=t.avail_in,u=t.next_in,l=t.input,t.avail_in=p,t.next_in=0,t.input=e,y(i);i.lookahead>=3;){n=i.strstart,o=i.lookahead-2;do{i.ins_h=(i.ins_h<<i.hash_shift^i.window[n+3-1])&i.hash_mask,i.prev[n&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=n,n++}while(--o);i.strstart=n,i.lookahead=2,y(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=u,t.input=l,t.avail_in=h,i.wrap=s,0},e.deflateInfo="pako deflate (from Nodeca project)"},function(t,e,i){"use strict";var n=i(83);function r(t){for(var e=t.length;--e>=0;)t[e]=0}var o=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],a=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],u=new Array(576);r(u);var l=new Array(60);r(l);var c=new Array(512);r(c);var d=new Array(256);r(d);var p=new Array(29);r(p);var f,m,g,y=new Array(30);function v(t,e,i,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=i,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function b(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function _(t){return t<256?c[t]:c[256+(t>>>7)]}function w(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function x(t,e,i){t.bi_valid>16-i?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=i-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=i)}function C(t,e,i){x(t,i[2*e],i[2*e+1])}function S(t,e){var i=0;do{i|=1&t,t>>>=1,i<<=1}while(--e>0);return i>>>1}function T(t,e,i){var n,r,o=new Array(16),a=0;for(n=1;n<=15;n++)o[n]=a=a+i[n-1]<<1;for(r=0;r<=e;r++){var s=t[2*r+1];0!==s&&(t[2*r]=S(o[s]++,s))}}function A(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function E(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function P(t,e,i,n){var r=2*e,o=2*i;return t[r]<t[o]||t[r]===t[o]&&n[e]<=n[i]}function M(t,e,i){for(var n=t.heap[i],r=i<<1;r<=t.heap_len&&(r<t.heap_len&&P(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!P(e,n,t.heap[r],t.depth));)t.heap[i]=t.heap[r],i=r,r<<=1;t.heap[i]=n}function I(t,e,i){var n,r,s,h,u=0;if(0!==t.last_lit)do{n=t.pending_buf[t.d_buf+2*u]<<8|t.pending_buf[t.d_buf+2*u+1],r=t.pending_buf[t.l_buf+u],u++,0===n?C(t,r,e):(C(t,(s=d[r])+256+1,e),0!==(h=o[s])&&x(t,r-=p[s],h),C(t,s=_(--n),i),0!==(h=a[s])&&x(t,n-=y[s],h))}while(u<t.last_lit);C(t,256,e)}function k(t,e){var i,n,r,o=e.dyn_tree,a=e.stat_desc.static_tree,s=e.stat_desc.has_stree,h=e.stat_desc.elems,u=-1;for(t.heap_len=0,t.heap_max=573,i=0;i<h;i++)0!==o[2*i]?(t.heap[++t.heap_len]=u=i,t.depth[i]=0):o[2*i+1]=0;for(;t.heap_len<2;)o[2*(r=t.heap[++t.heap_len]=u<2?++u:0)]=1,t.depth[r]=0,t.opt_len--,s&&(t.static_len-=a[2*r+1]);for(e.max_code=u,i=t.heap_len>>1;i>=1;i--)M(t,o,i);r=h;do{i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],M(t,o,1),n=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=n,o[2*r]=o[2*i]+o[2*n],t.depth[r]=(t.depth[i]>=t.depth[n]?t.depth[i]:t.depth[n])+1,o[2*i+1]=o[2*n+1]=r,t.heap[1]=r++,M(t,o,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var i,n,r,o,a,s,h=e.dyn_tree,u=e.max_code,l=e.stat_desc.static_tree,c=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,f=e.stat_desc.max_length,m=0;for(o=0;o<=15;o++)t.bl_count[o]=0;for(h[2*t.heap[t.heap_max]+1]=0,i=t.heap_max+1;i<573;i++)(o=h[2*h[2*(n=t.heap[i])+1]+1]+1)>f&&(o=f,m++),h[2*n+1]=o,n>u||(t.bl_count[o]++,a=0,n>=p&&(a=d[n-p]),s=h[2*n],t.opt_len+=s*(o+a),c&&(t.static_len+=s*(l[2*n+1]+a)));if(0!==m){do{for(o=f-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[f]--,m-=2}while(m>0);for(o=f;0!==o;o--)for(n=t.bl_count[o];0!==n;)(r=t.heap[--i])>u||(h[2*r+1]!==o&&(t.opt_len+=(o-h[2*r+1])*h[2*r],h[2*r+1]=o),n--)}}(t,e),T(o,u,t.bl_count)}function O(t,e,i){var n,r,o=-1,a=e[1],s=0,h=7,u=4;for(0===a&&(h=138,u=3),e[2*(i+1)+1]=65535,n=0;n<=i;n++)r=a,a=e[2*(n+1)+1],++s<h&&r===a||(s<u?t.bl_tree[2*r]+=s:0!==r?(r!==o&&t.bl_tree[2*r]++,t.bl_tree[32]++):s<=10?t.bl_tree[34]++:t.bl_tree[36]++,s=0,o=r,0===a?(h=138,u=3):r===a?(h=6,u=3):(h=7,u=4))}function R(t,e,i){var n,r,o=-1,a=e[1],s=0,h=7,u=4;for(0===a&&(h=138,u=3),n=0;n<=i;n++)if(r=a,a=e[2*(n+1)+1],!(++s<h&&r===a)){if(s<u)do{C(t,r,t.bl_tree)}while(0!=--s);else 0!==r?(r!==o&&(C(t,r,t.bl_tree),s--),C(t,16,t.bl_tree),x(t,s-3,2)):s<=10?(C(t,17,t.bl_tree),x(t,s-3,3)):(C(t,18,t.bl_tree),x(t,s-11,7));s=0,o=r,0===a?(h=138,u=3):r===a?(h=6,u=3):(h=7,u=4)}}r(y);var D=!1;function L(t,e,i,r){x(t,0+(r?1:0),3),function(t,e,i,r){E(t),r&&(w(t,i),w(t,~i)),n.arraySet(t.pending_buf,t.window,e,i,t.pending),t.pending+=i}(t,e,i,!0)}e._tr_init=function(t){D||(!function(){var t,e,i,n,r,h=new Array(16);for(i=0,n=0;n<28;n++)for(p[n]=i,t=0;t<1<<o[n];t++)d[i++]=n;for(d[i-1]=n,r=0,n=0;n<16;n++)for(y[n]=r,t=0;t<1<<a[n];t++)c[r++]=n;for(r>>=7;n<30;n++)for(y[n]=r<<7,t=0;t<1<<a[n]-7;t++)c[256+r++]=n;for(e=0;e<=15;e++)h[e]=0;for(t=0;t<=143;)u[2*t+1]=8,t++,h[8]++;for(;t<=255;)u[2*t+1]=9,t++,h[9]++;for(;t<=279;)u[2*t+1]=7,t++,h[7]++;for(;t<=287;)u[2*t+1]=8,t++,h[8]++;for(T(u,287,h),t=0;t<30;t++)l[2*t+1]=5,l[2*t]=S(t,5);f=new v(u,o,257,286,15),m=new v(l,a,0,30,15),g=new v(new Array(0),s,0,19,7)}(),D=!0),t.l_desc=new b(t.dyn_ltree,f),t.d_desc=new b(t.dyn_dtree,m),t.bl_desc=new b(t.bl_tree,g),t.bi_buf=0,t.bi_valid=0,A(t)},e._tr_stored_block=L,e._tr_flush_block=function(t,e,i,n){var r,o,a=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),k(t,t.l_desc),k(t,t.d_desc),a=function(t){var e;for(O(t,t.dyn_ltree,t.l_desc.max_code),O(t,t.dyn_dtree,t.d_desc.max_code),k(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=r&&(r=o)):r=o=i+5,i+4<=r&&-1!==e?L(t,e,i,n):4===t.strategy||o===r?(x(t,2+(n?1:0),3),I(t,u,l)):(x(t,4+(n?1:0),3),function(t,e,i,n){var r;for(x(t,e-257,5),x(t,i-1,5),x(t,n-4,4),r=0;r<n;r++)x(t,t.bl_tree[2*h[r]+1],3);R(t,t.dyn_ltree,e-1),R(t,t.dyn_dtree,i-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),I(t,t.dyn_ltree,t.dyn_dtree)),A(t),n&&E(t)},e._tr_tally=function(t,e,i){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(d[i]+256+1)]++,t.dyn_dtree[2*_(e)]++),t.last_lit===t.lit_bufsize-1},e._tr_align=function(t){x(t,2,3),C(t,256,u),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},function(t,e,i){"use strict";var n=i(450),r=i(83),o=i(216),a=i(218),s=i(179),h=i(217),u=i(453),l=Object.prototype.toString;function c(t){if(!(this instanceof c))return new c(t);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var i=n.inflateInit2(this.strm,e.windowBits);if(i!==a.Z_OK)throw new Error(s[i]);if(this.header=new u,n.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=o.string2buf(e.dictionary):"[object ArrayBuffer]"===l.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(i=n.inflateSetDictionary(this.strm,e.dictionary))!==a.Z_OK))throw new Error(s[i])}function d(t,e){var i=new c(e);if(i.push(t,!0),i.err)throw i.msg||s[i.err];return i.result}c.prototype.push=function(t,e){var i,s,h,u,c,d=this.strm,p=this.options.chunkSize,f=this.options.dictionary,m=!1;if(this.ended)return!1;s=e===~~e?e:!0===e?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof t?d.input=o.binstring2buf(t):"[object ArrayBuffer]"===l.call(t)?d.input=new Uint8Array(t):d.input=t,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new r.Buf8(p),d.next_out=0,d.avail_out=p),(i=n.inflate(d,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&f&&(i=n.inflateSetDictionary(this.strm,f)),i===a.Z_BUF_ERROR&&!0===m&&(i=a.Z_OK,m=!1),i!==a.Z_STREAM_END&&i!==a.Z_OK)return this.onEnd(i),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&i!==a.Z_STREAM_END&&(0!==d.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(h=o.utf8border(d.output,d.next_out),u=d.next_out-h,c=o.buf2string(d.output,h),d.next_out=u,d.avail_out=p-u,u&&r.arraySet(d.output,d.output,h,u,0),this.onData(c)):this.onData(r.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(m=!0)}while((d.avail_in>0||0===d.avail_out)&&i!==a.Z_STREAM_END);return i===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(i=n.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),d.avail_out=0,!0)},c.prototype.onData=function(t){this.chunks.push(t)},c.prototype.onEnd=function(t){t===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=c,e.inflate=d,e.inflateRaw=function(t,e){return(e=e||{}).raw=!0,d(t,e)},e.ungzip=d},function(t,e,i){"use strict";var n=i(83),r=i(214),o=i(215),a=i(451),s=i(452);function h(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function u(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function l(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(852),e.distcode=e.distdyn=new n.Buf32(592),e.sane=1,e.back=-1,0):-2}function c(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,l(t)):-2}function d(t,e){var i,n;return t&&t.state?(n=t.state,e<0?(i=0,e=-e):(i=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?-2:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=i,n.wbits=e,c(t))):-2}function p(t,e){var i,n;return t?(n=new u,t.state=n,n.window=null,0!==(i=d(t,e))&&(t.state=null),i):-2}var f,m,g=!0;function y(t){if(g){var e;for(f=new n.Buf32(512),m=new n.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(s(1,t.lens,0,288,f,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;s(2,t.lens,0,32,m,0,t.work,{bits:5}),g=!1}t.lencode=f,t.lenbits=9,t.distcode=m,t.distbits=5}function v(t,e,i,r){var o,a=t.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new n.Buf8(a.wsize)),r>=a.wsize?(n.arraySet(a.window,e,i-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>r&&(o=r),n.arraySet(a.window,e,i-r,o,a.wnext),(r-=o)?(n.arraySet(a.window,e,i-r,r,0),a.wnext=r,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}e.inflateReset=c,e.inflateReset2=d,e.inflateResetKeep=l,e.inflateInit=function(t){return p(t,15)},e.inflateInit2=p,e.inflate=function(t,e){var i,u,l,c,d,p,f,m,g,b,_,w,x,C,S,T,A,E,P,M,I,k,O,R,D=0,L=new n.Buf8(4),N=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return-2;12===(i=t.state).mode&&(i.mode=13),d=t.next_out,l=t.output,f=t.avail_out,c=t.next_in,u=t.input,p=t.avail_in,m=i.hold,g=i.bits,b=p,_=f,k=0;t:for(;;)switch(i.mode){case 1:if(0===i.wrap){i.mode=13;break}for(;g<16;){if(0===p)break t;p--,m+=u[c++]<<g,g+=8}if(2&i.wrap&&35615===m){i.check=0,L[0]=255&m,L[1]=m>>>8&255,i.check=o(i.check,L,2,0),m=0,g=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&m)<<8)+(m>>8))%31){t.msg="incorrect header check",i.mode=30;break}if(8!=(15&m)){t.msg="unknown compression method",i.mode=30;break}if(g-=4,I=8+(15&(m>>>=4)),0===i.wbits)i.wbits=I;else if(I>i.wbits){t.msg="invalid window size",i.mode=30;break}i.dmax=1<<I,t.adler=i.check=1,i.mode=512&m?10:12,m=0,g=0;break;case 2:for(;g<16;){if(0===p)break t;p--,m+=u[c++]<<g,g+=8}if(i.flags=m,8!=(255&i.flags)){t.msg="unknown compression method",i.mode=30;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=30;break}i.head&&(i.head.text=m>>8&1),512&i.flags&&(L[0]=255&m,L[1]=m>>>8&255,i.check=o(i.check,L,2,0)),m=0,g=0,i.mode=3;case 3:for(;g<32;){if(0===p)break t;p--,m+=u[c++]<<g,g+=8}i.head&&(i.head.time=m),512&i.flags&&(L[0]=255&m,L[1]=m>>>8&255,L[2]=m>>>16&255,L[3]=m>>>24&255,i.check=o(i.check,L,4,0)),m=0,g=0,i.mode=4;case 4:for(;g<16;){if(0===p)break t;p--,m+=u[c++]<<g,g+=8}i.head&&(i.head.xflags=255&m,i.head.os=m>>8),512&i.flags&&(L[0]=255&m,L[1]=m>>>8&255,i.check=o(i.check,L,2,0)),m=0,g=0,i.mode=5;case 5:if(1024&i.flags){for(;g<16;){if(0===p)break t;p--,m+=u[c++]<<g,g+=8}i.length=m,i.head&&(i.head.extra_len=m),512&i.flags&&(L[0]=255&m,L[1]=m>>>8&255,i.check=o(i.check,L,2,0)),m=0,g=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&((w=i.length)>p&&(w=p),w&&(i.head&&(I=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),n.arraySet(i.head.extra,u,c,w,I)),512&i.flags&&(i.check=o(i.check,u,w,c)),p-=w,c+=w,i.length-=w),i.length))break t;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===p)break t;w=0;do{I=u[c+w++],i.head&&I&&i.length<65536&&(i.head.name+=String.fromCharCode(I))}while(I&&w<p);if(512&i.flags&&(i.check=o(i.check,u,w,c)),p-=w,c+=w,I)break t}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===p)break t;w=0;do{I=u[c+w++],i.head&&I&&i.length<65536&&(i.head.comment+=String.fromCharCode(I))}while(I&&w<p);if(512&i.flags&&(i.check=o(i.check,u,w,c)),p-=w,c+=w,I)break t}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;g<16;){if(0===p)break t;p--,m+=u[c++]<<g,g+=8}if(m!==(65535&i.check)){t.msg="header crc mismatch",i.mode=30;break}m=0,g=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=12;break;case 10:for(;g<32;){if(0===p)break t;p--,m+=u[c++]<<g,g+=8}t.adler=i.check=h(m),m=0,g=0,i.mode=11;case 11:if(0===i.havedict)return t.next_out=d,t.avail_out=f,t.next_in=c,t.avail_in=p,i.hold=m,i.bits=g,2;t.adler=i.check=1,i.mode=12;case 12:if(5===e||6===e)break t;case 13:if(i.last){m>>>=7&g,g-=7&g,i.mode=27;break}for(;g<3;){if(0===p)break t;p--,m+=u[c++]<<g,g+=8}switch(i.last=1&m,g-=1,3&(m>>>=1)){case 0:i.mode=14;break;case 1:if(y(i),i.mode=20,6===e){m>>>=2,g-=2;break t}break;case 2:i.mode=17;break;case 3:t.msg="invalid block type",i.mode=30}m>>>=2,g-=2;break;case 14:for(m>>>=7&g,g-=7&g;g<32;){if(0===p)break t;p--,m+=u[c++]<<g,g+=8}if((65535&m)!=(m>>>16^65535)){t.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&m,m=0,g=0,i.mode=15,6===e)break t;case 15:i.mode=16;case 16:if(w=i.length){if(w>p&&(w=p),w>f&&(w=f),0===w)break t;n.arraySet(l,u,c,w,d),p-=w,c+=w,f-=w,d+=w,i.length-=w;break}i.mode=12;break;case 17:for(;g<14;){if(0===p)break t;p--,m+=u[c++]<<g,g+=8}if(i.nlen=257+(31&m),m>>>=5,g-=5,i.ndist=1+(31&m),m>>>=5,g-=5,i.ncode=4+(15&m),m>>>=4,g-=4,i.nlen>286||i.ndist>30){t.msg="too many length or distance symbols",i.mode=30;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;g<3;){if(0===p)break t;p--,m+=u[c++]<<g,g+=8}i.lens[N[i.have++]]=7&m,m>>>=3,g-=3}for(;i.have<19;)i.lens[N[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,O={bits:i.lenbits},k=s(0,i.lens,0,19,i.lencode,0,i.work,O),i.lenbits=O.bits,k){t.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;T=(D=i.lencode[m&(1<<i.lenbits)-1])>>>16&255,A=65535&D,!((S=D>>>24)<=g);){if(0===p)break t;p--,m+=u[c++]<<g,g+=8}if(A<16)m>>>=S,g-=S,i.lens[i.have++]=A;else{if(16===A){for(R=S+2;g<R;){if(0===p)break t;p--,m+=u[c++]<<g,g+=8}if(m>>>=S,g-=S,0===i.have){t.msg="invalid bit length repeat",i.mode=30;break}I=i.lens[i.have-1],w=3+(3&m),m>>>=2,g-=2}else if(17===A){for(R=S+3;g<R;){if(0===p)break t;p--,m+=u[c++]<<g,g+=8}g-=S,I=0,w=3+(7&(m>>>=S)),m>>>=3,g-=3}else{for(R=S+7;g<R;){if(0===p)break t;p--,m+=u[c++]<<g,g+=8}g-=S,I=0,w=11+(127&(m>>>=S)),m>>>=7,g-=7}if(i.have+w>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=30;break}for(;w--;)i.lens[i.have++]=I}}if(30===i.mode)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,O={bits:i.lenbits},k=s(1,i.lens,0,i.nlen,i.lencode,0,i.work,O),i.lenbits=O.bits,k){t.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,O={bits:i.distbits},k=s(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,O),i.distbits=O.bits,k){t.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===e)break t;case 20:i.mode=21;case 21:if(p>=6&&f>=258){t.next_out=d,t.avail_out=f,t.next_in=c,t.avail_in=p,i.hold=m,i.bits=g,a(t,_),d=t.next_out,l=t.output,f=t.avail_out,c=t.next_in,u=t.input,p=t.avail_in,m=i.hold,g=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;T=(D=i.lencode[m&(1<<i.lenbits)-1])>>>16&255,A=65535&D,!((S=D>>>24)<=g);){if(0===p)break t;p--,m+=u[c++]<<g,g+=8}if(T&&0==(240&T)){for(E=S,P=T,M=A;T=(D=i.lencode[M+((m&(1<<E+P)-1)>>E)])>>>16&255,A=65535&D,!(E+(S=D>>>24)<=g);){if(0===p)break t;p--,m+=u[c++]<<g,g+=8}m>>>=E,g-=E,i.back+=E}if(m>>>=S,g-=S,i.back+=S,i.length=A,0===T){i.mode=26;break}if(32&T){i.back=-1,i.mode=12;break}if(64&T){t.msg="invalid literal/length code",i.mode=30;break}i.extra=15&T,i.mode=22;case 22:if(i.extra){for(R=i.extra;g<R;){if(0===p)break t;p--,m+=u[c++]<<g,g+=8}i.length+=m&(1<<i.extra)-1,m>>>=i.extra,g-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;T=(D=i.distcode[m&(1<<i.distbits)-1])>>>16&255,A=65535&D,!((S=D>>>24)<=g);){if(0===p)break t;p--,m+=u[c++]<<g,g+=8}if(0==(240&T)){for(E=S,P=T,M=A;T=(D=i.distcode[M+((m&(1<<E+P)-1)>>E)])>>>16&255,A=65535&D,!(E+(S=D>>>24)<=g);){if(0===p)break t;p--,m+=u[c++]<<g,g+=8}m>>>=E,g-=E,i.back+=E}if(m>>>=S,g-=S,i.back+=S,64&T){t.msg="invalid distance code",i.mode=30;break}i.offset=A,i.extra=15&T,i.mode=24;case 24:if(i.extra){for(R=i.extra;g<R;){if(0===p)break t;p--,m+=u[c++]<<g,g+=8}i.offset+=m&(1<<i.extra)-1,m>>>=i.extra,g-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===f)break t;if(w=_-f,i.offset>w){if((w=i.offset-w)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=30;break}w>i.wnext?(w-=i.wnext,x=i.wsize-w):x=i.wnext-w,w>i.length&&(w=i.length),C=i.window}else C=l,x=d-i.offset,w=i.length;w>f&&(w=f),f-=w,i.length-=w;do{l[d++]=C[x++]}while(--w);0===i.length&&(i.mode=21);break;case 26:if(0===f)break t;l[d++]=i.length,f--,i.mode=21;break;case 27:if(i.wrap){for(;g<32;){if(0===p)break t;p--,m|=u[c++]<<g,g+=8}if(_-=f,t.total_out+=_,i.total+=_,_&&(t.adler=i.check=i.flags?o(i.check,l,_,d-_):r(i.check,l,_,d-_)),_=f,(i.flags?m:h(m))!==i.check){t.msg="incorrect data check",i.mode=30;break}m=0,g=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;g<32;){if(0===p)break t;p--,m+=u[c++]<<g,g+=8}if(m!==(4294967295&i.total)){t.msg="incorrect length check",i.mode=30;break}m=0,g=0}i.mode=29;case 29:k=1;break t;case 30:k=-3;break t;case 31:return-4;case 32:default:return-2}return t.next_out=d,t.avail_out=f,t.next_in=c,t.avail_in=p,i.hold=m,i.bits=g,(i.wsize||_!==t.avail_out&&i.mode<30&&(i.mode<27||4!==e))&&v(t,t.output,t.next_out,_-t.avail_out)?(i.mode=31,-4):(b-=t.avail_in,_-=t.avail_out,t.total_in+=b,t.total_out+=_,i.total+=_,i.wrap&&_&&(t.adler=i.check=i.flags?o(i.check,l,_,t.next_out-_):r(i.check,l,_,t.next_out-_)),t.data_type=i.bits+(i.last?64:0)+(12===i.mode?128:0)+(20===i.mode||15===i.mode?256:0),(0===b&&0===_||4===e)&&0===k&&(k=-5),k)},e.inflateEnd=function(t){if(!t||!t.state)return-2;var e=t.state;return e.window&&(e.window=null),t.state=null,0},e.inflateGetHeader=function(t,e){var i;return t&&t.state?0==(2&(i=t.state).wrap)?-2:(i.head=e,e.done=!1,0):-2},e.inflateSetDictionary=function(t,e){var i,n=e.length;return t&&t.state?0!==(i=t.state).wrap&&11!==i.mode?-2:11===i.mode&&r(1,e,n,0)!==i.check?-3:v(t,e,n,n)?(i.mode=31,-4):(i.havedict=1,0):-2},e.inflateInfo="pako inflate (from Nodeca project)"},function(t,e,i){"use strict";t.exports=function(t,e){var i,n,r,o,a,s,h,u,l,c,d,p,f,m,g,y,v,b,_,w,x,C,S,T,A;i=t.state,n=t.next_in,T=t.input,r=n+(t.avail_in-5),o=t.next_out,A=t.output,a=o-(e-t.avail_out),s=o+(t.avail_out-257),h=i.dmax,u=i.wsize,l=i.whave,c=i.wnext,d=i.window,p=i.hold,f=i.bits,m=i.lencode,g=i.distcode,y=(1<<i.lenbits)-1,v=(1<<i.distbits)-1;t:do{f<15&&(p+=T[n++]<<f,f+=8,p+=T[n++]<<f,f+=8),b=m[p&y];e:for(;;){if(p>>>=_=b>>>24,f-=_,0===(_=b>>>16&255))A[o++]=65535&b;else{if(!(16&_)){if(0==(64&_)){b=m[(65535&b)+(p&(1<<_)-1)];continue e}if(32&_){i.mode=12;break t}t.msg="invalid literal/length code",i.mode=30;break t}w=65535&b,(_&=15)&&(f<_&&(p+=T[n++]<<f,f+=8),w+=p&(1<<_)-1,p>>>=_,f-=_),f<15&&(p+=T[n++]<<f,f+=8,p+=T[n++]<<f,f+=8),b=g[p&v];i:for(;;){if(p>>>=_=b>>>24,f-=_,!(16&(_=b>>>16&255))){if(0==(64&_)){b=g[(65535&b)+(p&(1<<_)-1)];continue i}t.msg="invalid distance code",i.mode=30;break t}if(x=65535&b,f<(_&=15)&&(p+=T[n++]<<f,(f+=8)<_&&(p+=T[n++]<<f,f+=8)),(x+=p&(1<<_)-1)>h){t.msg="invalid distance too far back",i.mode=30;break t}if(p>>>=_,f-=_,x>(_=o-a)){if((_=x-_)>l&&i.sane){t.msg="invalid distance too far back",i.mode=30;break t}if(C=0,S=d,0===c){if(C+=u-_,_<w){w-=_;do{A[o++]=d[C++]}while(--_);C=o-x,S=A}}else if(c<_){if(C+=u+c-_,(_-=c)<w){w-=_;do{A[o++]=d[C++]}while(--_);if(C=0,c<w){w-=_=c;do{A[o++]=d[C++]}while(--_);C=o-x,S=A}}}else if(C+=c-_,_<w){w-=_;do{A[o++]=d[C++]}while(--_);C=o-x,S=A}for(;w>2;)A[o++]=S[C++],A[o++]=S[C++],A[o++]=S[C++],w-=3;w&&(A[o++]=S[C++],w>1&&(A[o++]=S[C++]))}else{C=o-x;do{A[o++]=A[C++],A[o++]=A[C++],A[o++]=A[C++],w-=3}while(w>2);w&&(A[o++]=A[C++],w>1&&(A[o++]=A[C++]))}break}}break}}while(n<r&&o<s);n-=w=f>>3,p&=(1<<(f-=w<<3))-1,t.next_in=n,t.next_out=o,t.avail_in=n<r?r-n+5:5-(n-r),t.avail_out=o<s?s-o+257:257-(o-s),i.hold=p,i.bits=f}},function(t,e,i){"use strict";var n=i(83),r=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(t,e,i,h,u,l,c,d){var p,f,m,g,y,v,b,_,w,x=d.bits,C=0,S=0,T=0,A=0,E=0,P=0,M=0,I=0,k=0,O=0,R=null,D=0,L=new n.Buf16(16),N=new n.Buf16(16),B=null,F=0;for(C=0;C<=15;C++)L[C]=0;for(S=0;S<h;S++)L[e[i+S]]++;for(E=x,A=15;A>=1&&0===L[A];A--);if(E>A&&(E=A),0===A)return u[l++]=20971520,u[l++]=20971520,d.bits=1,0;for(T=1;T<A&&0===L[T];T++);for(E<T&&(E=T),I=1,C=1;C<=15;C++)if(I<<=1,(I-=L[C])<0)return-1;if(I>0&&(0===t||1!==A))return-1;for(N[1]=0,C=1;C<15;C++)N[C+1]=N[C]+L[C];for(S=0;S<h;S++)0!==e[i+S]&&(c[N[e[i+S]]++]=S);if(0===t?(R=B=c,v=19):1===t?(R=r,D-=257,B=o,F-=257,v=256):(R=a,B=s,v=-1),O=0,S=0,C=T,y=l,P=E,M=0,m=-1,g=(k=1<<E)-1,1===t&&k>852||2===t&&k>592)return 1;for(;;){b=C-M,c[S]<v?(_=0,w=c[S]):c[S]>v?(_=B[F+c[S]],w=R[D+c[S]]):(_=96,w=0),p=1<<C-M,T=f=1<<P;do{u[y+(O>>M)+(f-=p)]=b<<24|_<<16|w|0}while(0!==f);for(p=1<<C-1;O&p;)p>>=1;if(0!==p?(O&=p-1,O+=p):O=0,S++,0==--L[C]){if(C===A)break;C=e[i+c[S]]}if(C>E&&(O&g)!==m){for(0===M&&(M=E),y+=T,I=1<<(P=C-M);P+M<A&&!((I-=L[P+M])<=0);)P++,I<<=1;if(k+=1<<P,1===t&&k>852||2===t&&k>592)return 1;u[m=O&g]=E<<24|P<<16|y-l|0}}return 0!==O&&(u[y+O]=C-M<<24|64<<16|0),d.bits=E,0}},function(t,e,i){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},function(t,e,i){"use strict";function n(t,e){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0}function r(t,e){if(t.primitives.length!==e.primitives.length)return!1;let i=!0;for(let r=0;r<t.primitives.length;r++){const r=t.primitives[0],o=e.primitives[0];for(const t in r){if(!n(r[t],o[t])){i=!1;break}}if(!i)break}return i}i(9),Object.defineProperty(e,"__esModule",{value:!0}),e.dedupeGeometry=void 0,e.dedupeGeometry=function(t){const e=new Map,{geometry:i,nodes:n}=t,o=[];for(let t=0;t<i.length;t++){const n=i[t];if(void 0===e[t]){e[t]=t;for(let a=t+1;a<i.length;a++){r(n,i[a])&&(e[a]=e[t],o.push(a))}}}let a=-1;const s={},h=i.map((t,e)=>e).map(t=>e[t]).map(t=>(s[t]||(s[t]=!0,a++),a));t.geometry=i.filter((t,e)=>-1===o.indexOf(e)),n.forEach(t=>{t.geometry&&(t.geometry=h[t.geometry])}),o.length}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.flattenScene=void 0;const n=i(219),r=i(177),o=i(220);e.flattenScene=function(t){const e=n.createMat4(),i=[];!function t(e,i,r,o,a){var s,h;const u=null!==(s=e.transform)&&void 0!==s?s:n.createMat4(),l=n.multiplyMat4(n.createMat4(),u,i);void 0!==e.geometry&&r.geometry[e.geometry].primitives.forEach(t=>{a.push({primitive:t,transform:l})});for(let i=0;i<e.children.length;i++)t(r.nodes[e.children[i]],l,r,o+":"+(null!==(h=e.name)&&void 0!==h?h:"scene"),a)}(t.scenes[0],e,t,"scene",i);const a=i.map(t=>{const e=t.primitive,i=Object.assign({},e),n=e.attributes.positions.slice();return o.transformPositions(n,t.transform),i.attributes.positions=n,i}),s=r.mergePrimitives(a);t.geometry=[{name:"merged",primitives:[s]}],t.nodes=[{name:"root",children:[],transform:n.createMat4(),type:"model",geometry:0}]}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.gltfToGbParser=void 0;const n=i(457),r=i(461),o=i(462),a=i(464),s=i(465),h=i(466),u=i(467),l=i(468);e.gltfToGbParser=function(t,e){const i={};return t.realBuffers=e,s.processMeshes(t,i),h.processNodes(t,i),u.processScenes(t,i),n.processAnimations(t,i),l.processSkins(t,i),o.processLights(t,i),r.processCameras(t,i),a.processMaterials(t,i),i}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.processAnimations=void 0;const n=i(180),r={rotation:"r",translation:"t",scale:"s",weights:"w"};e.processAnimations=function(t,e){t.animations?e.animations=t.animations.map(e=>{const i={data:[],duration:0},o={};return e.channels.forEach(a=>{const s=e.samplers[a.sampler],h=n.getBuffer(t,s.input),u=n.getBuffer(t,s.output);let l=o[a.target.node];l||(l=o[a.target.node]={id:a.target.node,duration:h[h.length-1]},i.data.push(l)),i.duration=Math.max(i.duration,l.duration),l[r[a.target.path]]={times:h,values:u}}),i}):e.animations=[]}},function(t,e,i){i(93)("Int16",(function(t){return function(e,i,n){return t(this,e,i,n)}}))},function(t,e,i){i(93)("Int32",(function(t){return function(e,i,n){return t(this,e,i,n)}}))},function(t,e,i){i(93)("Uint32",(function(t){return function(e,i,n){return t(this,e,i,n)}}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.processCameras=void 0,e.processCameras=function(t,e){t.cameras?e.cameras=t.cameras.map(t=>{if("perspective"===t.type){const e=t.perspective;return{fov:e.yfov,near:e.znear,far:e.zfar,aspectRatio:e.aspectRatio,mode:0}}throw new Error("only perspective camera supported right now!")}):e.cameras=[]}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.processLights=void 0;const n=i(463),r={directional:0,point:1,spot:2};e.processLights=function(t,e){t.extensions&&t.extensions.KHR_lights_punctual&&t.extensions.KHR_lights_punctual.lights&&(e.lights=t.extensions.KHR_lights_punctual.lights.map(t=>({name:t.name,color:n.rgb2hex(t.color),intensity:t.intensity,type:r[t.type]})))}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rgb2hex=void 0,e.rgb2hex=function(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.processMaterials=e.processMaterial=e.rgb2hex=void 0;const n={BLEND:0};function r(t){if(t)return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}e.rgb2hex=r;const o={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};function a(t){var e,i,a,s,h,u,l;const c=Object.assign(Object.assign({},o),t.pbrMetallicRoughness);return{name:t.name,state:{culling:null===(e=!t.doubleSided)||void 0===e||e,blendMode:null!==(i=n[t.alphaMode])&&void 0!==i?i:20},standard:{alpha:c.baseColorFactor[3],color:r(c.baseColorFactor),diffuseMap:null===(a=c.baseColorTexture)||void 0===a?void 0:a.index,normalMap:null===(s=t.normalTexture)||void 0===s?void 0:s.index,emissiveColor:r(t.emissiveFactor),emissiveMap:null===(h=t.emissiveTexture)||void 0===h?void 0:h.index,occlusionMap:null===(u=t.occlusionTexture)||void 0===u?void 0:u.index},pbr:{metallic:c.metallicFactor,roughness:c.roughnessFactor,metallicRoughnessMap:null===(l=c.metallicRoughnessTexture)||void 0===l?void 0:l.index}}}e.processMaterial=a,e.processMaterials=function(t,e){var i,n;e.textures=null===(i=t.textures)||void 0===i?void 0:i.map((e,i)=>({uri:t.images[e.source].uri})),e.materials=null===(n=t.materials)||void 0===n?void 0:n.map(t=>a(t))}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.processMeshes=void 0;const n=i(178),r=i(180),o={POSITION:"positions",NORMAL:"normals",TEXCOORD_0:"uvs",TEXCOORD:"uvs",JOINTS_0:"boneIndices",JOINTS:"boneIndices",WEIGHTS_0:"weights",WEIGHTS:"weights",TANGENT:"tangents"};e.processMeshes=function(t,e){e.geometry=t.meshes.map(e=>{const i={name:e.name,primitives:e.primitives.map(e=>function(t,e){const i={bounds:[0,0,0,0,0,0],attributes:{}};i.material=e.material||0,void 0!==e.indices&&(i.indices=r.getBuffer(t,e.indices,!0));for(const n in e.attributes)o[n]&&(i.attributes[o[n]]=r.getBuffer(t,e.attributes[n]));if(i.attributes.positions){const t=n.getBounds(i.attributes.positions,3).ranges;i.bounds[0]=t[0].min,i.bounds[1]=t[1].min,i.bounds[2]=t[2].min,i.bounds[3]=t[0].max,i.bounds[4]=t[1].max,i.bounds[5]=t[2].max}return e.targets&&(i.targets=e.targets.map(e=>{const i={};for(const n in e)i[o[n]]=r.getBuffer(t,e[n]);return i})),i}(t,e))};return e.weights&&(i.weights=e.weights),i})}},function(t,e,i){"use strict";i(29),i(34),i(30),Object.defineProperty(e,"__esModule",{value:!0}),e.processNodes=void 0,e.processNodes=function(t,e){e.nodes=t.nodes.map(t=>{const e=t.children||[],i=function(t){if(t.matrix&&16===t.matrix.length)return new Float32Array(t.matrix);const e=t.scale||[1,1,1],i=t.translation||[0,0,0],n=t.rotation||[0,0,0,1],r=n[0],o=n[1],a=n[2],s=n[3],h=r+r,u=o+o,l=a+a,c=r*h,d=r*u,p=r*l,f=o*u,m=o*l,g=a*l,y=s*h,v=s*u,b=s*l,_=new Float32Array(16),w=e[0],x=e[1],C=e[2];return _[0]=(1-(f+g))*w,_[1]=(d+b)*w,_[2]=(p-v)*w,_[4]=(d-b)*x,_[5]=(1-(c+g))*x,_[6]=(m+y)*x,_[8]=(p+v)*C,_[9]=(m-y)*C,_[10]=(1-(c+f))*C,_[12]=i[0],_[13]=i[1],_[14]=i[2],_}(t),n={name:t.name||"node",children:e,transform:i};return void 0!==t.camera&&(n.type="camera",n.camera=t.camera),void 0!==t.mesh&&(n.type="model",n.geometry=t.mesh),t.extensions&&t.extensions.KHR_lights_punctual&&(n.type="light",n.light=t.extensions.KHR_lights_punctual.light),void 0!==t.skin&&(n.skin=t.skin),n})}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.processScenes=void 0,e.processScenes=function(t,e){e.scenes=t.scenes.map(t=>({children:t.nodes,name:t.name}))}},function(t,e,i){"use strict";i(29),i(34),i(30),Object.defineProperty(e,"__esModule",{value:!0}),e.processSkins=void 0;const n=i(180);e.processSkins=function(t,e){t.skins?e.skins=t.skins.map(i=>{const r=n.getBuffer(t,i.inverseBindMatrices);return{joints:i.joints.map((t,i)=>{const n=e.nodes[t];n.type="bone",n.inverseBindMatrix=new Float32Array(16);for(let t=0;t<16;t++)n.inverseBindMatrix[t]=r[16*i+t];return t}),bindMatrix:i.bindMatrix||new Float32Array(16)}}):e.skins=[]}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.objToGbParser=void 0;const n=i(178),r=i(470);e.objToGbParser=function(t,e){const i={},o=r.parseObj(t),a=n.getBounds(o.position,3);return i.geometry=[{name:e,primitives:[{bounds:[a.ranges[0].min,a.ranges[1].min,a.ranges[2].min,a.ranges[0].max,a.ranges[1].max,a.ranges[2].max],indices:o.indices,attributes:{positions:o.position,normals:o.normals,uvs:o.uv}}]}],i}},function(t,e,i){"use strict";function n(t,e=3){const i=[];for(let n=0;n<t.length;n++)for(let r=0;r<e;r++)i[n*e+r]=t[n][r];return new Float32Array(i)}i(29),i(34),i(30),i(63),i(210),Object.defineProperty(e,"__esModule",{value:!0}),e.parseObj=void 0,e.parseObj=function(t){const e=t.split("\n"),i=[],r=[],o=[],a=[],s=[],h=[],u=[];let l,c=0;const d=/v( +[\d|\.|\+|\-|e|E]+)( +[\d|\.|\+|\-|e|E]+)( +[\d|\.|\+|\-|e|E]+)/,p=/vn( +[\d|\.|\+|\-|e|E]+)( +[\d|\.|\+|\-|e|E]+)( +[\d|\.|\+|\-|e|E]+)/,f=/vt( +[\d|\.|\+|\-|e|E]+)( +[\d|\.|\+|\-|e|E]+)/,m=/f( +-?\d+)( +-?\d+)( +-?\d+)( +-?\d+)?/,g=/f( +(-?\d+)\/(-?\d+))( +(-?\d+)\/(-?\d+))( +(-?\d+)\/(-?\d+))( +(-?\d+)\/(-?\d+))?/,y=/f( +(-?\d+)\/(-?\d+)\/(-?\d+))( +(-?\d+)\/(-?\d+)\/(-?\d+))( +(-?\d+)\/(-?\d+)\/(-?\d+))( +(-?\d+)\/(-?\d+)\/(-?\d+))?/,v=/f( +(-?\d+)\/\/(-?\d+))( +(-?\d+)\/\/(-?\d+))( +(-?\d+)\/\/(-?\d+))( +(-?\d+)\/\/(-?\d+))?/;function b(t){const e=parseInt(t);return 3*(e>=0?e-1:e+a.length/3)}function _(t){const e=parseInt(t);return 3*(e>=0?e-1:e+s.length/3)}function w(t){const e=parseInt(t);return 2*(e>=0?e-1:e+h.length/2)}function x(t,e,n){i.push([a[t],a[t+1],a[t+2]]),i.push([a[e],a[e+1],a[e+2]]),i.push([a[n],a[n+1],a[n+2]]),u.push(3*c+0),u.push(3*c+1),u.push(3*c+2),c++}function C(t,e,i){r.push([h[t],h[t+1]]),r.push([h[e],h[e+1]]),r.push([h[i],h[i+1]])}function S(t,e,i){o.push([s[t],s[t+1],s[t+2]]),o.push([s[e],s[e+1],s[e+2]]),o.push([s[i],s[i+1],s[i+2]])}function T(t,e,i,n,r,o,a,s,h,u,l,c){let d,p=b(t),f=b(e),m=b(i);void 0===n?x(p,f,m):(d=b(n),x(p,f,d),x(f,m,d)),void 0!==r&&(p=w(r),f=w(o),m=w(a),void 0===n?C(p,f,m):(d=w(s),C(p,f,d),C(f,m,d))),void 0!==h&&(p=_(h),f=_(u),m=_(l),void 0===n?S(p,f,m):(d=_(c),S(p,f,d),S(f,m,d)))}for(let t=0;t<e.length;t++){let i=e[t];i=i.trim(),0!==i.length&&"#"!==i.charAt(0)&&(null!==(l=d.exec(i))?a.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])):null!==(l=p.exec(i))?s.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3])):null!==(l=f.exec(i))?h.push(parseFloat(l[1]),1-parseFloat(l[2])):null!==(l=m.exec(i))?T(l[1],l[2],l[3],l[4]):null!==(l=g.exec(i))?T(l[2],l[5],l[8],l[11],l[3],l[6],l[9],l[12]):null!==(l=y.exec(i))?T(l[2],l[6],l[10],l[14],l[3],l[7],l[11],l[15],l[4],l[8],l[12],l[16]):null!==(l=v.exec(i))&&T(l[2],l[5],l[8],l[11],void 0,void 0,void 0,void 0,l[3],l[6],l[9],l[12]))}return function(t){const e=[];for(let i=0;i<t.indices.length;i++){const n=t.indices[i],r=t.positions[n],o=t.normals[n],a=t.coords[n];e.push(r.concat(o).concat(a).toString())}const i=[],n=[],r=[],o=[],a={},s={};let h=0;for(let u=0;u<e.length;u++){const l=e[u];a[l]?o.push(s[l]):(a[l]=l,i.push(t.positions[u]),n.push(t.normals[u]),r.push(t.coords[u]),o.push(h),s[l]=h,h++)}t.positions=i,t.normals=n,t.coords=r,t.indices=o}(A={positions:i,coords:r,normals:o,indices:u}),{uv:n(A.coords,2),position:n(A.positions,3),normals:n(A.normals,3),indices:new Uint16Array(A.indices)};var A}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mergeGBObjects=void 0,e.mergeGBObjects=function(t){const e={};let i=0,n=0;return t.forEach(t=>{var r,o;t.geometry&&(e.geometry?t.geometry.forEach(t=>{e.geometry.push(t)}):e.geometry=t.geometry.slice()),t.nodes&&(e.nodes||(e.nodes=[]),t.nodes.forEach(t=>{const r=Object.assign({name:t.name},t);void 0!==r.geometry&&(r.geometry+=i),r.children=t.children.map(t=>t+n),e.nodes.push(r)})),t.scenes&&(e.scenes||(e.scenes=[]),t.scenes.forEach(t=>{const i=Object.assign({},t);i.children=t.children.map(t=>t+n),e.scenes.push(i)})),i+=(null===(r=t.geometry)||void 0===r?void 0:r.length)||0,n+=(null===(o=t.nodes)||void 0===o?void 0:o.length)||0}),e}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.transformUvs=void 0,e.transformUvs=function(t,e){const{x:i,y:n,w:r,h:o}=e;for(let e=0;e<t.length;e+=2)t[e]=t[e]*r+i,t[e+1]=t[e+1]*o+n}},function(t,e,i){"use strict";i(9),i(29),i(34),i(30),i(175),i(63),Object.defineProperty(e,"__esModule",{value:!0}),e.unpackGBObject=void 0;const n=i(219),r=i(212),o=i(474),a=i(213);e.unpackGBObject=function(t){var e,i,s,h,u;const{gbObject:l,buffers:c}=function(t){const e={UINT16:0,FLOAT32:1,STRING:2,FLOAT32_COMPRESSED:3,UINT16_COMPRESSED:4};let i=0;const n=new Float32Array(t),s=n[i++];i++,i+=s/2,i%1&&(i+=.5);const h=o.unpackGBMeta(t),u=[];for(;i<n.length-1;){const o=n[i++],s=n[i++];if(s===e.FLOAT32)u.push(new Float32Array(t,4*i,o)),i+=o;else if(s===e.FLOAT32_COMPRESSED||s===e.UINT16_COMPRESSED){const n=new Uint8Array(t,4*i,o),h=a.unzipArray(n.slice(0)),l=new Uint16Array(h.buffer);if(s===e.FLOAT32_COMPRESSED){const t=r.unpackArray(l);u.push(t)}else u.push(l);i+=o/4,i+=1-i%1}else{if(s!==e.UINT16)throw new Error("not supported buffer,"+s);u.push(new Uint16Array(t,4*i,o)),i+=o/2,i%1&&(i+=.5)}}return{gbObject:h,buffers:u}}(t),d={s:3,t:3,w:1,r:4},p={positions:3,normals:3,weights:4,boneIndices:4,uvs:2,tangents:4};return null===(e=l.geometryBatch)||void 0===e||e.forEach(t=>{void 0!==t.indices&&(t.indices=c[Number(t.indices)]);for(const e in p)void 0!==t.attributes[e]&&(t.attributes[e]=c[t.attributes[e]])}),null===(i=l.geometry)||void 0===i||i.forEach(t=>{t.primitives.forEach(t=>{if(t.attributes){void 0!==t.indices&&(t.indices=c[Number(t.indices)]);for(const e in p)void 0!==t.attributes[e]&&(t.attributes[e]=c[t.attributes[e]])}t.targets&&t.targets.forEach(t=>{for(const e in p)void 0!==t[e]&&(t[e]=c[t[e]])})})}),null===(s=l.animations)||void 0===s||s.forEach(t=>{t.data.forEach(t=>{for(const e in d)t[e]&&(t[e].times=c[t[e].times],t[e].values=c[t[e].values])})}),null===(h=l.nodes)||void 0===h||h.forEach(t=>{let e=Number(t.bindMatrix);t.bindMatrix=-1===e?n.createMat4():c[e],e=Number(t.inverseBindMatrix),t.inverseBindMatrix=c[e],e=Number(t.transform),t.transform=-1===e?n.createMat4():c[e]}),null===(u=l.skins)||void 0===u||u.forEach(t=>{const e=Number(t.bindMatrix);t.bindMatrix=-1===e?n.createMat4():c[e]}),l}},function(t,e,i){"use strict";i(29),i(34),i(30),i(63),i(475),Object.defineProperty(e,"__esModule",{value:!0}),e.unpackGBMeta=void 0,e.unpackGBMeta=function(t){let e=0;const i=new Float32Array(t)[e++];e++;const n=new Uint16Array(t,4*e,i),r=new Int8Array(t,4*e,2*i);e+=i/2,e%1&&(e+=.5);let o=null;try{o=new TextDecoder("utf-16").decode(r,{})}catch(t){try{o=String.fromCharCode.apply(null,n)}catch(t){throw new Error("[Unpack GB model] meta data is too large, possible - we have large base64 textures or animation")}}return JSON.parse(o)}},function(t,e,i){i(93)("Int8",(function(t){return function(e,i,n){return t(this,e,i,n)}}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,i){"use strict";i.d(e,"a",(function(){return PlaneGeometry}));var n=i(84);class PlaneGeometry extends n.a{constructor(t=20,e=10,i=4,n=2){super();const r=[],o=[],a=[],s=[];for(let s=0;s<=n;++s){const h=s/n;for(let n=0;n<=i;++n){const s=n/i;r.push(s*t-t/2,h*e-e/2,0),o.push(s,h),a.push(0,0,1)}}const h=i+1;for(let t=0;t<n;++t){const e=(t+0)*h,n=(t+1)*h;for(let t=0;t<i;++t){const i=e+t,r=n+t;s.push(i,i+1,r),s.push(r,i+1,r+1)}}this.addAttribute("aPosition",r,3).addAttribute("aNormal",a,3).addAttribute("aUv",o,2).addIndex(s)}}},function(t,e,i){"use strict";function n(t=2){return new Promise(e=>{let i=0;const n=()=>{i++,i>=t?e():requestAnimationFrame(n)};requestAnimationFrame(n)})}i.d(e,"a",(function(){return n}))},function(t,e,i){"use strict";i.d(e,"a",(function(){return StagePlugin_StagePlugin}));var n=i(0),r=i(298),o=i(289);o.a.android?(n.settings.PRECISION_FRAGMENT=n.PRECISION.LOW,n.settings.PRECISION_VERTEX=n.PRECISION.HIGH):o.a.ios&&(n.settings.PRECISION_FRAGMENT=n.PRECISION.HIGH,n.settings.PRECISION_VERTEX=n.PRECISION.HIGH);class StagePlugin_StagePlugin extends r.a{constructor(t,e){var i,r,a,s,h,u,l,c;super(t,e),e.resolution=null!==(i=e.resolution)&&void 0!==i?i:Math.min(window.devicePixelRatio,2),e.antialias=null!==(r=e.antialias)&&void 0!==r?r:o.a.desktop,e.powerPreference=null!==(a=e.powerPreference)&&void 0!==a?a:"high-performance",e.transparent=null!==(s=e.transparent)&&void 0!==s?s:function(){const t=document.createElement("canvas");let e,i,n,r=!1;try{e=t.getContext("webgl"),i=e.getExtension("WEBGL_debug_renderer_info"),n=e.getParameter(i.UNMASKED_RENDERER_WEBGL);const o=n.substring(0,8);"Mali-400"!==o&&"Mali-450"!==o||(r=!0)}catch(t){}return r}(),this.canvas=e.view=e.view||this._setupCanvas(),(null===(h=e.autoAddToDocument)||void 0===h||h)&&document.body.appendChild(e.view),this.renderer=new n.Renderer(e),this.renderer.plugins.accessibility.debug=null!==(u=e.accessibilityDebug)&&void 0!==u&&u,this.stage=new n.Container,this.mainContainer=new n.Container,this.overlayContainer=new n.Container,this.stage.addChild(this.mainContainer),this.stage.addChild(this.overlayContainer),this.useHalfFPS=null!==(l=e.useHalfFPS)&&void 0!==l&&l,this._halfTick=0,null!==(c=e.alwaysOnAccessibility)&&void 0!==c&&c&&(this.renderer.plugins.accessibility._isMobileAccessibility=!0,this.renderer.plugins.accessibility.activate(),this.renderer.plugins.accessibility.destroyTouchHook())}_setupCanvas(){const t=document.createElement("canvas");return t.id="pixi-canvas",t.style.position="absolute",t.style.left="0px",t.style.right="0px",t.style.top="0px",t.style.bottom="0px",t.style.width="100%",t.style.height="100%",t.style.overflow="visible",t.style.display="block",t}start(){this.app.updateRunner.remove(this.update),this.app.updateRunner.add(this.update)}update(t){(!o.a.ios||t>.8)&&(this._halfTick++,(!this.useHalfFPS||this._halfTick%2)&&this.renderer.render(this.stage))}get view(){return this.renderer.view}set interactive(t){this.stage.interactive=t,this.stage.interactiveChildren=t}get interactive(){return this.stage.interactive}}},,,,,,,,,,,function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));const n={vertex:{header:"\n varying float vFogDepth;\n ",end:"\n vFogDepth = length(worldCameraPosition.xyz);\n "},fragment:{header:"\n varying float vFogDepth;\n uniform float uFogNear;\n uniform float uFogFar;\n uniform vec3 uFogColor;\n ",end:"\n float fogFactor = smoothstep( uFogNear, uFogFar, vFogDepth );\n finalColor.rgb = mix(finalColor.rgb, uFogColor * diffuseColor.a, fogFactor);\n "}}},function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"a",(function(){return r}));const n={name:"standardNormalMatrix",vertex:{header:"\n uniform mat3 uNormalMatrix;\n "}},r={vertex:{transform:"\n mat3 uNormalMatrix = mat3(modelMatrix);\n "}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));const n={name:"modelMatrix",vertex:{header:"\n uniform mat4 uModelMatrix;\n ",transform:"\n modelMatrix = uModelMatrix; \n "}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return n})),i.d(e,"b",(function(){return r}));const n={vertex:{header:"\n attribute vec2 aUv;\n varying vec2 vUv;\n ",transform:" \n vUv = aUv;\n "},fragment:{header:"\n varying vec2 vUv;\n ",material:"\n uv = vUv;\n "}},r={vertex:{header:"\n uniform vec4 uMapFrame;\n attribute vec2 aUv;\n varying vec2 vUv;\n ",transform:" \n vUv = (aUv * uMapFrame.zw ) + uMapFrame.xy;\n "},fragment:{header:"\n varying vec2 vUv;\n ",material:"\n uv = vUv;\n "}}},function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"a",(function(){return r}));const n={fragment:{material:"\n alphaColor = diffuseColor.a;\n "}},r={fragment:{header:"\n uniform sampler2D uAlphaMap;\n ",material:"\n alphaColor = texture2D(uAlphaMap, uv).a;\n "}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));const n={fragment:{header:"\n uniform sampler2D uDiffuseMap;\n ",material:"\n diffuseColor *= texture2DSRGB(uDiffuseMap, uv);\n "}}},function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"a",(function(){return o}));const n={name:"animation transform",vertex:{header:"\n attribute vec4 aBoneWeights;\n attribute vec4 aBoneIndices;\n\n uniform float uBoneTextureSize;\n uniform sampler2D uBoneTexture;\n\n vec4 getMatrixRow(float index, float row)\n {\n float finalIndex = (index*4.) + row;\n\n float x = mod(finalIndex, uBoneTextureSize);\n float y = floor(finalIndex/uBoneTextureSize);\n\n return texture2D(uBoneTexture, vec2(x/uBoneTextureSize, y/uBoneTextureSize));\n }\n\n mat4 getMatrix(float index)\n {\n return mat4(\n getMatrixRow(index, 0.),\n getMatrixRow(index, 1.),\n getMatrixRow(index, 2.),\n getMatrixRow(index, 3.)\n );\n }\n ",transform:"\n\n mat4 skinMatrix = mat4(0.0);\n \n skinMatrix += aBoneWeights.x * getMatrix(aBoneIndices.x);\n skinMatrix += aBoneWeights.y * getMatrix(aBoneIndices.y);\n skinMatrix += aBoneWeights.z * getMatrix(aBoneIndices.z);\n skinMatrix += aBoneWeights.w * getMatrix(aBoneIndices.w);\n\n worldPosition = skinMatrix * worldPosition;\n\n #ifdef worldNormal\n worldNormal = mat3(skinMatrix) * worldNormal;\n #endif\n "}},r={};function o(t){return r[t]||(r[t]={name:"animation transform",vertex:{header:"\n attribute vec4 aBoneWeights;\n attribute vec4 aBoneIndices;\n \n uniform mat4 uBoneMatrices["+t+"];\n ",transform:"\n mat4 boneMatrixX = uBoneMatrices[int(aBoneIndices.x)];\n mat4 boneMatrixY = uBoneMatrices[int(aBoneIndices.y)];\n mat4 boneMatrixZ = uBoneMatrices[int(aBoneIndices.z)];\n mat4 boneMatrixW = uBoneMatrices[int(aBoneIndices.w)];\n \n mat4 skinMatrix = mat4(0.0);\n \n skinMatrix += aBoneWeights.x * boneMatrixX;\n skinMatrix += aBoneWeights.y * boneMatrixY;\n skinMatrix += aBoneWeights.z * boneMatrixZ;\n skinMatrix += aBoneWeights.w * boneMatrixW;\n \n worldPosition = skinMatrix * worldPosition;\n \n #ifdef worldNormal\n worldNormal = mat3(skinMatrix) * worldNormal;\n #endif\n "}},r[t])}},function(t,e,i){"use strict";i.d(e,"a",(function(){return BoxGeometry}));i(29),i(63),i(30);var n=i(84);class BoxGeometry extends n.a{constructor(t=1,e=1,i=1,n=1,r=1,o=1){super(),n=Math.floor(n),r=Math.floor(r),o=Math.floor(o);const a=[],s=[],h=[],u=[];let l=0;function c(t,e,i,n,r,o,c,d,p,f){const m=o/p,g=c/f,y=o/2,v=c/2,b=d/2,_=p+1,w=f+1;let x,C,S=0;const T={x:0,y:0,z:0};for(C=0;C<w;C++){const o=C*g-v;for(x=0;x<_;x++){const a=x*m-y;T[t]=a*n,T[e]=o*r,T[i]=b,s.push(T.x,T.y,T.z),T[t]=0,T[e]=0,T[i]=d>0?1:-1,h.push(T.x,T.y,T.z),u.push(x/p),u.push(1-C/f),S+=1}}for(C=0;C<f;C++)for(x=0;x<p;x++){const t=l+x+_*C,e=l+x+_*(C+1),i=l+(x+1)+_*(C+1),n=l+(x+1)+_*C;a.push(t,e,n),a.push(e,i,n)}l+=S}c("z","y","x",-1,-1,i,e,t,o,r),c("z","y","x",1,-1,i,e,-t,o,r),c("x","z","y",1,1,t,i,e,n,o),c("x","z","y",1,-1,t,i,-e,n,o),c("x","y","z",1,-1,t,e,i,n,r),c("x","y","z",-1,-1,t,e,-i,n,r),this.addAttribute("aUv",u,2).addAttribute("aPosition",s,3).addAttribute("aNormal",h,3).addIndex(new Uint16Array(a))}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return PoolSystem}));i(9);var n=i(110);const r=new Map;class PoolSystem{constructor(){this._toRemove=[]}prepopulate(t,e){n.a.getPool(t).prepopulate(e)}get(t,e){const i=n.a.get(t),o=i.signals.onDestroyed.connect(t=>this.onEntityDestroyed(t));return r.set(i,o),i.init(e),i}onEntityDestroyed(t){r.get(t).disconnect(),setTimeout(()=>{this.return(t)},200)}return(t){t.reset(),this._toRemove.push(t)}postupdate(){for(let t=0;t<this._toRemove.length;t++){const e=this._toRemove[t];n.a.return(e)}this._toRemove.length=0}reset(){this.postupdate()}}PoolSystem.DEFAULT_NAME="pool"},function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));const n={fragment:{header:"\n uniform float uAlphaTest;\n ",main:"\n if(alphaColor < uAlphaTest)\n {\n discard;\n }\n "}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return DoubleSpring}));class DoubleSpring{constructor(){this.x=0,this.ax=0,this.dx=0,this.tx=0,this.y=0,this.ay=0,this.dy=0,this.ty=0,this.max=30,this.damp=.75,this.springiness=.09,this.max=160,this.damp=.85,this.springiness=.29}update(){this.ax=(this.tx-this.x)*this.springiness,this.dx+=this.ax,this.dx*=this.damp,this.dx<-this.max?this.dx=-this.max:this.dx>this.max&&(this.dx=this.max),this.x+=this.dx,this.ay=(this.ty-this.y)*this.springiness,this.dy+=this.ay,this.dy*=this.damp,this.dy<-this.max?this.dy=-this.max:this.dy>this.max&&(this.dy=this.max),this.y+=this.dy}reset(){this.x=0,this.ax=0,this.dx=0,this.tx=0,this.y=0,this.ay=0,this.dy=0,this.ty=0}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));i(9);const n=new Map;function r(t,e=100,i){if(!n.has(t)){let r;const o=(...o)=>{if(n.get(t).args=o,r)return;const a=()=>{r=null;const e=n.get(t).args;i?t.call(i,...e):t(...e)};0===e?a():r=setTimeout(a,e)};n.set(t,{throttledFunction:o,args:null})}return n.get(t).throttledFunction}},function(t,e,i){"use strict";i.d(e,"a",(function(){return OrbitalCameraEntity}));var n=i(151),r=i(283);class OrbitalCameraEntity extends n.a{constructor(t={}){super(t),this.addComponent(r.a,t)}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return I18nPlugin}));i(56);var n=i(299),r=i(51),o=function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))};const a={name:"i18n",language:"en",fileNameFormat:"lang-*.json"};class I18nPlugin{constructor(t,e={}){var i;this.app=t,this.options=Object.assign(Object.assign({},a),e),null!==(i=this.options.entryDefaults)&&void 0!==i||Object.assign(r.a.defaultEntry,this.options.entryDefaults)}init(){return o(this,void 0,void 0,(function*(){this.app.get(n.a).manager.onLoadComplete.connect(this.refresh.bind(this))}))}refresh(){const t=this.app.get(n.a);for(const e in t.cache){const i=this.options.fileNameFormat.replace("*","(.+)"),n=e.match(new RegExp(i));if(n){const i=t.cache[e],o=n[1];r.b.appendDictionary(o,i)}}}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return VisibilityPlugin}));i(9);var n=i(37),r=i(298);class VisibilityPlugin extends r.a{constructor(){super(...arguments),this.onVisibilityChange=new n.Signal}_handleVisibilityChange(){document.hidden?this.onVisibilityChange.emit(!1):this.onVisibilityChange.emit(!0)}prepare(){document.addEventListener("visibilitychange",()=>{this._handleVisibilityChange()})}start(){this._handleVisibilityChange()}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Scene3D_Scene3D}));var n=i(88);const r=[];class GroupSystem_GroupSystem{constructor(t,e){this.groups={},(null==e?void 0:e.groups)&&this.initGroups(e.groups)}entityAddedToScene(t){for(let e=0;e<t.groups.length;e++){const i=t.groups[e];let r=this.groups[i];r||(r=this.groups[i]=new n.a),r.add(t)}}entityRemovedFromScene(t){for(let e=0;e<t.groups.length;e++){const i=t.groups[e];this.groups[i].remove(t)}}initGroups(t){for(let e=0;e<t.length;e++){const i=t[e];let r=this.groups[i];r||(r=this.groups[i]=new n.a)}}find(t,e){const i=this.groups;if(e){if(i[e]){const n=i[e].children;for(let e=0;e<n.length;e++)if(n[e].name===t)return n[e]}}else{const e=this.scene.allEntities.children;for(let i=0;i<e.length;i++)if(e[i].name===t)return e[i]}return null}findAll(t,e){const i=this.groups;if(!i[e])return null;const n=i[e].children;r.length=0;for(let e=0;e<n.length;e++)n[e].name===t&&r.push(n[e]);return r}reset(){const t=this.groups;for(const e in t)t[e].empty()}empty(){this.reset()}}GroupSystem_GroupSystem.DEFAULT_NAME="group";var o=i(37);var a=i(39),s=i(139),h=i(277),u=i(138);var l=i(32),c=i(120);class ContainerSystem_ContainerSystem{constructor(t){this.entity=t,this.root=new l.a}addedToScene(){this.entity.scene.addToScene(this.root)}reset(){this.root.container.empty()}entityAddedToScene(t){const e=t.getComponent(c.a);if(!e)return;const i=e.children;for(let t=0;t<i.length;t++)this.entity.scene.addToScene(i[t])}entityRemovedFromScene(t){const e=t.getComponent(c.a);if(!e)return;const i=e.children;for(let t=0;t<i.length;t++)this.entity.scene.removeFromScene(i[t])}}ContainerSystem_ContainerSystem.DEFAULT_NAME="container";class TransformSystem{constructor(){this.dynamics=0,this.free=0,this._tick=0,this._toUpdate=[],this._updateCount=0}render(){this._tick++,this.dynamics=0;for(let t=0;t<this._updateCount;t++)this._updateTransform(this._toUpdate[t]);this._updateCount=0}_updateWorld(t,e){var i;e&&(this._tick++,(null===(i=t.parent)||void 0===i?void 0:i.transform)&&this._updateWorld(t.parent,!0));const n=t.transform;if(this._tick===n.rTick)return;n.rTick=this._tick;const r=t.parent;t._worldActive&&(n.custom||(this._updateLocal(n),this.dynamics++),(null==r?void 0:r.transform)?this._updateWithParent(n,r.transform):n.worldTransform.copy(n.localTransform))}_updateLocal(t){const e=t.quat;if(t.rotationDirty){t.rotationDirty=!1;const i=t.rotation.x,n=t.rotation.y,r=t.rotation.z,o=Math.cos(i/2),a=Math.cos(n/2),s=Math.cos(r/2),h=Math.sin(i/2),u=Math.sin(n/2),l=Math.sin(r/2);e.x=h*a*s+o*u*l,e.y=o*u*s-h*a*l,e.z=o*a*l+h*u*s,e.w=o*a*s-h*u*l}const i=e.x,n=e.y,r=e.z,o=e.w,a=i+i,s=n+n,h=r+r,u=i*a,l=i*s,c=i*h,d=n*s,p=n*h,f=r*h,m=o*a,g=o*s,y=o*h,v=t.localTransform.elements,b=t.scale._x,_=t.scale._y,w=t.scale._z;v[0]=(1-(d+f))*b,v[1]=(l+y)*b,v[2]=(c-g)*b,v[4]=(l-y)*_,v[5]=(1-(u+f))*_,v[6]=(p+m)*_,v[8]=(c+g)*w,v[9]=(p-m)*w,v[10]=(1-(u+d))*w,v[12]=t.position._x,v[13]=t.position._y,v[14]=t.position._z,t.currentLocalID=t.localID,t.parentID=-1,t.worldID++}_updateWithParent(t,e){const i=t.worldTransform.elements,n=e.worldTransform.elements,r=t.localTransform.elements;if(0===t.currentLocalID)i[0]=n[0],i[1]=n[1],i[2]=n[2],i[4]=n[4],i[5]=n[5],i[6]=n[6],i[8]=n[8],i[9]=n[9],i[10]=n[10],i[12]=n[12],i[13]=n[13],i[14]=n[14],this.free++;else{const t=n[0],e=n[1],o=n[2],a=n[4],s=n[5],h=n[6],u=n[8],l=n[9],c=n[10],d=n[12],p=n[13],f=n[14];let m=r[0],g=r[1],y=r[2];i[0]=m*t+g*a+y*u,i[1]=m*e+g*s+y*l,i[2]=m*o+g*h+y*c,m=r[4],g=r[5],y=r[6],i[4]=m*t+g*a+y*u,i[5]=m*e+g*s+y*l,i[6]=m*o+g*h+y*c,m=r[8],g=r[9],y=r[10],i[8]=m*t+g*a+y*u,i[9]=m*e+g*s+y*l,i[10]=m*o+g*h+y*c,m=r[12],g=r[13],y=r[14],i[12]=m*t+g*a+y*u+d,i[13]=m*e+g*s+y*l+p,i[14]=m*o+g*h+y*c+f}t.parentID=e.worldID,t.worldID++}_updateTransform(t){this._updateWorld(t);const e=t.container.children,i=e.length;for(let t=0;t<i;t++)this._updateTransform(e[t])}}TransformSystem.DEFAULT_NAME="transform";var d=i(0);const p=[0,0,0,0];var f=i(16),m=i(36),g=i(151);const y=new d.Transform,v=new m.a,b=new m.a;const _=new f.a,w=new f.a;class CameraSystem_CameraSystem{constructor(t,e){var i,n,r,o;this._view3dSystem=e.view3d;const a=e.view3d.renderer;this.fullscreen=null===(i=e.fullscreen)||void 0===i||i,this.width=null!==(n=e.width)&&void 0!==n?n:this.fullscreen?a.width:100,this.height=null!==(r=e.height)&&void 0!==r?r:this.fullscreen?a.height:100,this.cameraUniforms=new d.UniformGroup({uProjectionMatrix:new m.a,uViewMatrix:new m.a,uEyePosition:new f.a(0,1,0),uResolution:[1,1],uProjectionViewMatrix:new m.a},!0),this._view3dSystem.globalUniforms.uniforms.camera=this.cameraUniforms,this.camera=null!==(o=e.camera)&&void 0!==o?o:new g.a}updateCamera(t){const e=t.camera,i=this._view3dSystem.renderer,n=this.cameraUniforms.uniforms,r=n.uResolution,o=i.renderTexture.current;o?(e.updateProjection(o.width,o.height),r[0]=o.width*o.resolution,r[1]=o.height*o.resolution):(e.updateProjection(i.width,i.height),r[0]=i.width*i.resolution,r[1]=i.height*i.resolution),n.uProjectionMatrix.copy(e.projection),this.fullscreen||function(t,e,i,n,r){n.decompose(y),y.rotation*=-1,y._localID++,y.updateLocalTransform(),n=y.localTransform;const o=r.width/r.resolution,a=r.height/r.resolution,s=n.tx/o*2-1,h=1-n.ty/a*2,u=v.identity();u.elements[12]=s,u.elements[13]=h;const l=b.identity(),c=t/o,d=e/a;l.elements[0]=n.a*c,l.elements[1]=n.b*d,l.elements[4]=n.c*c,l.elements[5]=n.d*d,i.multiply(l);const p=i.elements;p[0]+=s*p[3],p[4]+=s*p[7],p[8]+=s*p[11],p[12]+=s*p[15],p[1]+=h*p[3],p[5]+=h*p[7],p[9]+=h*p[11],p[13]+=h*p[15]}(this.width,this.height,n.uProjectionMatrix,this._view3dSystem.container.worldTransform,i),n.uEyePosition.copy(e.position),n.uViewMatrix.copy(e.view),n.uProjectionViewMatrix.copy(e.viewProjection),this.cameraUniforms.update()}setCamera(t){this.camera=t,t.scene||this.scene.addChild(t)}map2dFrom3d(t,e){w.x=e.x,w.y=e.y,w.z=e.z,_.project(w,this.camera.camera.view),_.project(_,this.camera.camera.projection);const i=this._view3dSystem.renderer.renderTexture.current;let n=this.width,r=this.height;i&&(n=i.width,r=i.height);const o=.5*n,a=.5*r;return t.x=_.x*o+o,t.y=-_.y*a+a,t}resize(t,e){if(this.fullscreen){if(this.width===t&&this.height===e)return;this.width=t,this.height=e}}}CameraSystem_CameraSystem.DEFAULT_NAME="camera";const x=[];class CullingSystem{cull(t,e){const i=e.camera.frustum;let n=0;for(let e=0;e<t.length;e++){const r=t[e].view3d;r.frustumCull&&i.intersectsSphere(r.getBoundingSphere())&&(x[n++]=t[e])}return x.length=n,x}}CullingSystem.DEFAULT_NAME="culling";i(29),i(34),i(30);var C=i(155);function S(t,e,i){t.x=e[i+0],t.y=e[i+1],t.z=e[i+2]}function T(t,e,i){t.x=e[i+0],t.y=e[i+1]}function A(t,e,i,n){t.x=e,t.y=i,t.z=n}class FogSystem_FogSystem{constructor(t,e){this.fogUniforms=new d.UniformGroup({uFogColor:new Float32Array([1,0,0]),uFogDensity:.1,uFogNear:20,uFogFar:50},!0),e.view3d.globalUniforms.uniforms.fog=this.fogUniforms,this.setData(e.fog)}setData(t){var e,i,n,r;t&&(this.color=null!==(e=t.color)&&void 0!==e?e:0,this.density=null!==(i=t.density)&&void 0!==i?i:.01,this.near=null!==(n=t.near)&&void 0!==n?n:20,this.far=null!==(r=t.far)&&void 0!==r?r:50)}set color(t){this._hexFogColor=t;const e=this.fogUniforms.uniforms;d.utils.hex2rgb(t,e.uFogColor)}get color(){return this._hexFogColor}set density(t){const e=this.fogUniforms.uniforms;this.fogUniforms.update(),e.uFogDensity=t}get density(){return this.fogUniforms.uniforms.uFogDensity}set near(t){const e=this.fogUniforms.uniforms;this.fogUniforms.update(),e.uFogNear=t}get near(){return this.fogUniforms.uniforms.uFogNear}set far(t){const e=this.fogUniforms.uniforms;this.fogUniforms.update(),e.uFogFar=t}get far(){const t=this.fogUniforms.uniforms;return this.fogUniforms.update(),t.uFogFar}}FogSystem_FogSystem.DEFAULT_NAME="fog";class EntityRendererSystem_EntityRendererSystem{constructor(t,e){this._view3dSystem=e.view3d,this._lastMaterial=null,e.view3d.renderer.context.gl.getExtension("OES_standard_derivatives")}flush(){this._lastMaterial=null}renderEntity(t,e){const i=this._view3dSystem,n=t.view3d,r=n._geometry,o=n._material,a=i.renderer,s=r.castToBaseGeometry(),h=o.uniforms;if(this._lastMaterial!==o){o.tangents&&!s.getAttribute("aTangent")&&function(t){if(t.getAttribute("aTangent"))return;const e=t.getIndex().data,i=t.getBuffer("aPosition").data,n=t.getBuffer("aNormal").data,r=t.getBuffer("aUv").data;if(!(e&&n&&r&&i))throw new Error("gb-tools cannot compute tangents, missing one or more required attributs (uvs, positions, normals, indicies");const o=i.length/3,a=new Float32Array(4*o);t.addAttribute("aTangent",a);const s=[],h=[];for(let t=0;t<o;t++)s[t]=new f.a,h[t]=new f.a;const u=new f.a,l=new f.a,c=new f.a,d=new C.a,p=new C.a,m=new C.a,g=new f.a,y=new f.a;function v(t,e,n){S(u,i,3*t),S(l,i,3*e),S(c,i,3*n),T(d,r,2*t),T(p,r,2*e),T(m,r,2*n);const o=l.x-u.x,a=c.x-u.x,f=l.y-u.y,v=c.y-u.y,b=l.z-u.z,_=c.z-u.z,w=p.x-d.x,x=m.x-d.x,C=p.y-d.y,E=m.y-d.y,P=1/(w*E-x*C);A(g,(E*o-C*a)*P,(E*f-C*v)*P,(E*b-C*_)*P),A(y,(w*a-x*o)*P,(w*v-x*f)*P,(w*_-x*b)*P),s[t].add(g),s[e].add(g),s[n].add(g),h[t].add(y),h[e].add(y),h[n].add(y)}let b=t.groups||[];0===b.length&&(b=[{start:0,count:e.length}]);for(let t=0,i=b.length;t<i;++t){const i=b[t],n=i.start;for(let t=n,r=n+i.count;t<r;t+=3)v(e[t+0],e[t+1],e[t+2])}const _=new f.a,w=new f.a,x=new f.a,E=new f.a;let P,M,I;function k(t){S(x,n,3*t),E.copy(x),M=s[t],_.copy(M),_.sub(x.multiplyScalar(x.dot(M))),_.normalize(),w.crossVectors(E,M),I=w.dot(h[t]),P=I<0?-1:1,a[4*t]=_.x,a[4*t+1]=_.y,a[4*t+2]=_.z,a[4*t+3]=P}for(let t=0,i=b.length;t<i;++t){const i=b[t],n=i.start;for(let t=n,r=n+i.count;t<r;t+=3)k(e[t+0]),k(e[t+1]),k(e[t+2])}}(s),h.globals3d=i.globalUniforms;const t=i.lights.lightSig;if(o.needsUpdate||o.lightSig!==t){if(o.needsUpdate=!1,o.build){const i={sig:t,lights:e.lights};o.build(i,!!this.scene.getSystem(FogSystem_FogSystem),2===a.context.webGLVersion)}o.lightSig=t}const n=h.uDiffuseMap||h.uNormalMap;if(h.uMapFrame&&n){const t=n.baseTexture,e=n.frame,i=h.uMapFrame;i.x=e.x/t.width,i.y=e.y/t.height,i.width=e.width/t.width,i.height=e.height/t.height}a.shader.bind(o,null),this._lastMaterial=o}const u=a.CONTEXT_UID,l=o.program.glPrograms[u].uniformData;if(l.uModelMatrix){const e=l.uModelMatrix.location;a.gl.uniformMatrix4fv(e,!1,t.transform.worldTransform.elements)}if(l.uNormalMatrix){t.transform.worldID!==n.transformDirty&&(n.transformDirty=t.transform.worldID,function(t,e){const i=e.elements,n=i[0],r=i[1],o=i[2],a=i[4],s=i[5],h=i[6],u=i[8],l=i[9],c=i[10],d=n*s-r*a,p=n*h-o*a,f=r*h-o*s;let m=d*c-p*l+f*u;m=1/m;const g=t.elements;g[0]=(s*c-h*l)*m,g[1]=(h*u-a*c)*m,g[2]=(a*l-s*u)*m,g[3]=(o*l-r*c)*m,g[4]=(n*c-o*u)*m,g[5]=(r*u-n*l)*m,g[6]=f*m,g[7]=-p*m,g[8]=d*m}(n._cachedNormal,t.transform.worldTransform));const e=l.uNormalMatrix.location;a.gl.uniformMatrix3fv(e,!1,n._cachedNormal.elements),h.uNormalMatrix=n._cachedNormal}if(t.skinned)if(l.uBoneMatrices){const e=l.uBoneMatrices.location;a.gl.uniformMatrix4fv(e,!1,t.skinned.bones)}else if(l.uBoneTexture){const e=t.skinned.boneTexture,i=a.texture.boundTextures.length-1;a.gl.uniform1i(l.uBoneTexture.location,i),a.texture.bind(e,i);const n=l.uBoneTextureSize.location;a.gl.uniform1f(n,e.frame.width)}a.state.set(n.state),a.geometry.bind(s),a.geometry.draw(n.draw,r.size,r.start,r.instanceCount)}}EntityRendererSystem_EntityRendererSystem.DEFAULT_NAME="EntityRenderer";i(9);var E=i(109),P=i(75);const M=(t,e)=>{const i=t.view3d,n=e.view3d,r=i._geometry,o=n._geometry,a=r.castToBaseGeometry(),s=o.castToBaseGeometry();return i.orderBias-n.orderBias||i.state.data-n.state.data||i._material.program.id-n._material.program.id||i._material.id-n._material.id||a.id-s.id},I=(t,e)=>{const i=t.getComponent(P.a),n=e.getComponent(P.a);return i.orderBias-n.orderBias||i.zdist-n.zdist};class Layer_Layer{constructor(t,e,i=!0){this.opaqueRenderables=[],this.transparentRenderables=[],this._tick=0,this.changedEntities=[],this._changedEntityCount=0,this._allowInstancing=i,this.renderIndex=e,this.id=t,this.onPreRender=new o.Signal,this.onPostRender=new o.Signal,this.visible=!0}update(t){this._tick++;let e=!1;for(let t=0;t<this._changedEntityCount;t++){const i=this.changedEntities[t],n=i.view3d;if(i._gc||!i.scene)continue;const r=n._state.blend?this.transparentRenderables:this.opaqueRenderables;if(n.group!==r){if(n.group){const t=n.group.indexOf(i);-1!==t&&n.group.splice(t,1)}n.group=r,r.push(i),r!==this.transparentRenderables&&(e=!0)}}e&&this.opaqueRenderables.sort(M),this._updateZDist(this.transparentRenderables,t),this.transparentRenderables.sort(I),this._changedEntityCount=0}getAll(t){return t||(t=[]),t.push(...this.opaqueRenderables),t.push(...this.transparentRenderables),t}add(t){t.view3d.layer=this,this._onChange(t)}remove(t){const e=t.getComponent(P.a),i=e.group;if(i){const e=i.indexOf(t);-1!==e&&i.splice(e,1)}e.onChange=E.a,e.group=null,e.layer=null,e.id=null;const n=this.changedEntities.indexOf(t);n>=0&&(this.changedEntities.splice(n,1),this._changedEntityCount--)}empty(){this.opaqueRenderables.forEach(t=>{t.view3d.onChange=E.a,t.view3d.group=null,t.view3d.layer=null,t.view3d.id=null,t.view3d.instanced=!1}),this.transparentRenderables.forEach(t=>{t.view3d.onChange=E.a,t.view3d.group=null,t.view3d.layer=null,t.view3d.id=null,t.view3d.instanced=!1}),this.opaqueRenderables.length=0,this.transparentRenderables.length=0,this.changedEntities.length=0,this._changedEntityCount=0}_updateZDist(t,e){const i=e.camera.forward,n=e.camera.position,r=n.x,o=n.y,a=n.z,s=i.x,h=i.y,u=i.z;for(let e=0;e<t.length;e++){const i=t[e],n=i.transform.worldTransform.elements;i.view3d.zdist=-((n[12]-r)*s+(n[13]-o)*h+(n[14]-a)*u)}}_onChange(t){const e=t.view3d;this._allowInstancing||(t.getComponent(P.a).material.instancing=!1),e.tick!==this._tick&&(e.tick=this._tick,this.changedEntities[this._changedEntityCount++]=t)}}class LayerSystem_LayerSystem{constructor(){this.signals={preRender:new o.Signal,postRender:new o.Signal},this.layers={},this._renderList=[]}update(){const t=this.scene.view3d.camera;if(t)for(const e in this.layers)this.layers[e].update(t)}getAll(){return this.layers}getOrderedArray(){return this._renderList}getLayerFromEntity(t){const e=t.getComponent(P.a);return(null==e?void 0:e.layer)||this.layers[null==e?void 0:e.layerId]}addLayer(t){if(this.getLayer(t))return null;const e=this.scene.view3d.allowInstancing,i=Object.keys(this.layers).length;return this.layers[t]=this.layers[t]||new Layer_Layer(t,i,e),this.orderLayers(this.getAll()),this.layers[t]}removeLayer(t,e,i){const n=this.layers[t];if(!n||"default"===t)return null;const r=i||"default";this.entitiesToLayer(n.opaqueRenderables,r,e),this.entitiesToLayer(n.transparentRenderables,r,e);for(let t=0;t<this._renderList.length;t++){const e=this._renderList[t];e.renderIndex>n.renderIndex&&e.renderIndex--}return this.orderLayers(this.getAll()),n.empty(),delete this.layers[t],this.layers[r]}getLayer(t){return this.layers[t]}entitiesToLayer(t,e,i){const n=this.layers[e],r=t=>{const r=t.view3d;r&&(r.layer.remove(t),i||(r.layerId=e,n.add(t)))};if(Array.isArray(t))for(let e=0;e<t.length;e++){r(t[e])}else r(t)}renderLayers(t){const e=this._renderList;this.signals.preRender.emit(this._renderList,t);for(let i=0;i<e.length;i++){const n=e[i];n.onPreRender.emit(n,t);const r=this.scene.view3d;n.visible&&(r.renderGroup(n.opaqueRenderables,t),r.renderGroup(n.transparentRenderables,t)),n.onPostRender.emit(n,t)}this.signals.postRender.emit(this._renderList,t)}setLayerIndex(t,e){const i=Object.keys(this.layers).length;if(e<=0||e>=i)throw new Error("The index "+e+" supplied is out of bounds "+i);this._renderList.splice(this._renderList.indexOf(t),1),this._renderList.splice(e,0,t);for(let t=0;t<this._renderList.length;t++)this._renderList[t].renderIndex=t}orderLayers(t){return this._renderList=Object.values(t),this._renderList.sort((t,e)=>t.renderIndex-e.renderIndex),this._renderList}}LayerSystem_LayerSystem.DEFAULT_NAME="layer";class AmbientLight_AmbientLight{constructor(t=16777215,e=1){this._color=new Float32Array(3),this._hexColor=0,this.color=t,this._intensity=e,this.output=new Float32Array(3),this.dirty=!0}update(){if(!this.dirty)return;this.dirty=!1;const t=this.output,e=this._color,i=this._intensity;t[0]=Math.pow(e[0]*i,2.2),t[1]=Math.pow(e[1]*i,2.2),t[2]=Math.pow(e[2]*i,2.2)}set color(t){this._hexColor!==t&&(this._hexColor=t,d.utils.hex2rgb(t,this._color),this.dirty=!0)}get color(){return this._hexColor}set intensity(t){this._intensity!==t&&(this._intensity=t,this.dirty=!0)}get intensity(){return this._intensity}}var k=i(278);let O=0;class LightSystem_LightSystem{constructor(t,e){this._uid=O++,this.lightsDirtyTick=0,this._lightsDirtyTick=-1,this.lightEntities=[],this.freezeLights=!1,this.ambientLight=new AmbientLight_AmbientLight(16777215,.5),this.lightUniforms=new d.UniformGroup({uGlobalAmbient:this.ambientLight.output},!0),e.view3d.globalUniforms.uniforms.lights=this.lightUniforms}renderBegin(){this.ambientLight.update(),this.lightUniforms.update();const t=this.lightEntities;if(!this.freezeLights&&this._lightsDirtyTick!==this.lightsDirtyTick){t.sort((t,e)=>t.light.type-e.light.type||t.UID-e.UID),this.lightSig=t.map(t=>t.light.type).join("-")+this._uid,this._lightsDirtyTick=this.lightsDirtyTick;const e=this.lightUniforms.uniforms;t.forEach(t=>{const i=t.light,n=i.lightId;e["uLightColor"+n]=i.output,e["uLightDirection"+n]=i.direction,1===i.type&&(e["uLightPosition"+n]=i.position,e["uLightDistance"+n]||Object.defineProperty(e,"uLightDistance"+n,{enumerable:!0,get:()=>i.distance})),2===i.type&&(e["uLightPosition"+n]=i.position,e["uLightDistance"+n]=i.distance,e["uLimit"+n]=i.limit)})}}start(){this.scene.group.initGroups(["_lights"])}entityAddedToScene(t){t.getComponent(k.a)&&(this.lightEntities.push(t),this.lightsDirtyTick++)}entityRemovedFromScene(t){if(t.getComponent(k.a)){const e=this.lightEntities.indexOf(t);-1!==e&&(this.lightEntities.splice(e,1),this.lightsDirtyTick++)}}empty(){this.lightEntities.length=0}}LightSystem_LightSystem.DEFAULT_NAME="lights";var R=i(68);let D=!1;function L(){D||(D=!0,d.uniformParsers.unshift({test:(t,e)=>"vec4"===t.type&&e instanceof R.a,code:t=>"\n v = uv."+t+";\n\n gl.uniform4f(ud."+t+".location, v.normal.x, v.normal.y, v.normal.z, v.constant);\n "}),d.uniformParsers.push({test:(t,e)=>e.elements&&16===e.elements.length,code:t=>"\n gl.uniformMatrix4fv(ud."+t+".location, false, uv."+t+".elements);\n ",codeUbo:t=>"\n var "+t+"_matrix = uv."+t+".elements;\n\n for(var i = 0; i < 16; i++)\n {\n data[offset + i] = "+t+"_matrix[i];\n }\n "}),d.uniformParsers.push({test:(t,e)=>e.elements&&9===e.elements.length,code:t=>"\n gl.uniformMatrix3fv(ud."+t+".location, false, uv."+t+".elements);\n "}),d.uniformParsers.push({test:(t,e)=>"vec3"===t.type&&1===t.size&&void 0!==e.x,code:t=>"\n cv = ud."+t+".value;\n v = uv."+t+";\n\n if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.z)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n cv[2] = v.z;\n gl.uniform3f(ud."+t+".location, v.x, v.y, v.z);\n }\n "}),d.uniformParsers.push({test:(t,e)=>"vec3"===t.type&&void 0!==e.r&&void 0!==e.g&&void 0!==e.b,code:t=>"\n cv = ud."+t+".value;\n v = uv."+t+";\n\n if(cv[0] !== v.r || cv[1] !== v.g || cv[2] !== v.b)\n {\n cv[0] = v.r;\n cv[1] = v.g;\n cv[2] = v.b;\n gl.uniform3f(ud."+t+".location, v.r, v.g, v.b);\n }\n "}))}class WindingSystem{constructor(t,e){this._flip=!1,this._renderer=e.view3d.renderer;const i=this._renderer.gl;this._renderer.state.map[4]=this._renderer.state.setFrontFace=t=>{i.frontFace(i[this._flip!==t?"CW":"CCW"])}}set flip(t){if(this._flip===t)return;this._flip=t;const e=this._renderer,i=!!(16&e.state.stateId);e.state.setFrontFace(i)}get flip(){return this._flip}}WindingSystem.DEFAULT_NAME="winding",L();const N={culling:!1},B=[null];class View3DSystem_View3DSystem{constructor(t,e){var i,n,r;if(this.visible=!0,L(),e=Object.assign(Object.assign({},N),e),this.entity=t,this._clearColor=null!==(i=e.clearColor)&&void 0!==i?i:p,this._clear=null!==(n=e.clear)&&void 0!==n&&n,this.globalUniforms=new d.UniformGroup({},!1),this.onRenderBegin=new d.Runner("renderBegin"),this.onPreDrawScene=new d.Runner("preDrawScene"),this.onRenderFinish=new d.Runner("renderFinish"),this.stage=null!==(r=e.stage)&&void 0!==r?r:new d.Container,this.container=new d.Container,this.stage.addChild(this.container),this.container._render=this._renderChildren.bind(this),this.container.filterArea=new d.Rectangle(0,0,1e5,1e5),this.renderer=e.renderer,void 0===e.instancing){const t=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);e.instancing=!t}this.allowInstancing=this.renderer.geometry.hasInstance&&e.instancing,this.winding=this.addSubSystem(WindingSystem),this.layers=this.addSubSystem(LayerSystem_LayerSystem),this.cameraSystem=this.addSubSystem(CameraSystem_CameraSystem,e),this.lights=this.addSubSystem(LightSystem_LightSystem),this.entityRenderer=this.addSubSystem(EntityRendererSystem_EntityRendererSystem),this.culling=e.culling?this.addSubSystem(CullingSystem):null,this.fog=e.fogOptions?this.addSubSystem(FogSystem_FogSystem,{fog:e.fogOptions}):null}addSubSystem(t,e={}){const i=this.entity.scene.addSystem(t,Object.assign(Object.assign({},e),{view3d:this}));return this.onRenderBegin.add(i),this.onPreDrawScene.add(i),this.onRenderFinish.add(i),i}setCamera(t){this.cameraSystem.setCamera(t)}get camera(){return this.cameraSystem.camera}drawScene(t,e,i,n,r,o){const a=t.camera,s=this.renderer,h=s.renderTexture.current;e&&s.renderTexture.bind(e),(null!=r?r:this._clear)&&s.renderTexture.clear(null!=o?o:this._clearColor),this.winding.flip=a.view.determinant()<0,this.entityRenderer.flush(),this.cameraSystem.updateCamera(t),this._currentRenderSession={renderer:s,lights:this.lights.lightEntities,camera:t,ignoreList:n,renderList:i},this.layers.renderLayers(this._currentRenderSession),s.renderTexture.bind(h),this.winding.flip=!1}renderGroup(t,e){var i,n;Array.isArray(t)||(B[0]=t,t=B),(null===(i=e.renderList)||void 0===i?void 0:i.length)>0&&(t=t.filter(t=>-1!==e.renderList.indexOf(t))),(null===(n=e.ignoreList)||void 0===n?void 0:n.length)>0&&(t=t.filter(t=>-1===e.ignoreList.indexOf(t))),this.culling&&(t=this.culling.cull(t,e.camera));const r=this.entityRenderer;for(let i=0;i<t.length;i++){const n=t[i],o=n.view3d;n._worldActive&&o.renderable&&(o.renderCustom?o.renderCustom(e):r.renderEntity(n,e))}}addedToScene(t){this.camera.scene||t.addChild(this.camera)}entityAddedToScene(t){const e=t;if(e.view3d){const t=e.view3d.layerId;(this.layers.getLayer(t)||this.layers.addLayer(t)).add(e)}}entityRemovedFromScene(t){const e=t;if(e.view3d){const t=e.view3d.layerId;this.layers.getLayer(t).remove(e)}}empty(){const t=this.layers.getAll();for(const e in t)t[e].empty()}_renderChildren(t){this.visible&&(this.scene.renderStart(),t.batch.flush(),this.onRenderBegin.emit(this),this.layers.update(),this.onPreDrawScene.emit(this),this.drawScene(this.camera,this.renderTexture,null,null,this._clear,this._clearColor),t.gl.clear(t.gl.DEPTH_BUFFER_BIT),this.onRenderFinish.emit(this),this.scene.renderFinish())}}View3DSystem_View3DSystem.DEFAULT_NAME="view3d";class Scene3D_Scene3D extends class Scene_Scene extends class Signals_Signals{constructor(){this.signals={}}register(...t){for(let e=0;e<t.length;e++){const i=t[e];this.signals[i]||(this.signals[i]=new o.Signal)}}resetSignals(){for(const t in this.signals)this.signals[t].disconnectAll()}}{constructor(t={}){super(),this.time=new h.a,this._width=100,this._height=100,this._entitiesToRemove=[],this._entitiesToAdd=[],this.allEntities=new n.a,this._onUpdateEntities=new a.a("run",1),this._onRenderEntities=new a.a("run",2),this.onResize=new a.a("resize",2),this.onEntityAddedToScene=new a.a("entityAddedToScene",1),this.onEntityRemovedFromScene=new a.a("entityRemovedFromScene",1),this.onPreupdate=new a.a("preupdate",1),this.onPostupdate=new a.a("postupdate",1),this.onPrerender=new a.a("prerender",1),this.onPostrender=new a.a("postrender",1),this.onEmpty=new a.a("empty",1),this._system=new u.a,this._system.name="system",this.addToScene(this._system),this.paused=!1,this._updateAndRender=void 0===t.updateAndRender||t.updateAndRender,this.signals=this._system.signals,this._runners=[this.onResize,this.onEntityAddedToScene,this.onEntityRemovedFromScene,this.onPreupdate,this.onPostupdate,this.onPrerender,this.onPostrender,this.onEmpty]}get width(){return this._width}get height(){return this._height}addSystem(t,e,i){if(i=i||Object(s.a)(t),this._system.getComponent(t))throw new Error("[Scene] "+i+" system already exists");const n=this._system.addComponent(t,e,i);return this._runners.forEach(t=>t.add(n)),n.scene=this,n}getSystem(t){return this._system.getComponent(t)}addToScene(t){if(t._gc){const e=this._entitiesToRemove.indexOf(t);this._entitiesToRemove.splice(e,1),t._gc=!1}if(t.scene){if(t.scene===this)return;this._removeEntity(t)}t.scene=this,this.allEntities.add(t),t.runners.addedToScene.run(this),this.onEntityAddedToScene.run(t),this._entitiesToAdd.push(t)}removeFromScene(t){!t._gc&&t.scene&&(t._gc=!0,this._entitiesToRemove.push(t))}renderStart(){this._updateAndRender&&this.update(),this.onPrerender.run(this.time),this._onRenderEntities.run(this.time)}renderFinish(){this.onPostrender.run(this.time)}update(){this.paused||(this.time.nextUpdate(),this._addEntities(),this._removeEntities(),this.onPreupdate.run(this.time),this._removeEntities(),this._onUpdateEntities.run(this.time),this._removeEntities(),this.onPostupdate.run(this.time))}empty(){this._removeEntities(),this.onEmpty.run();for(let t=0;t<this.allEntities.children.length;t++){const e=this.allEntities.children[t];e.runners.removedFromScene.run(this),e.scene=null,e._gc=!1}this.allEntities.empty(),this._rootContainer&&this._rootContainer.empty(),this._onUpdateEntities.removeAll(),this._onRenderEntities.removeAll(),this.onResize.removeAll(),this.onEntityAddedToScene.removeAll(),this.onEntityRemovedFromScene.removeAll(),this.onPreupdate.removeAll(),this.onPostupdate.removeAll(),this.onPrerender.removeAll(),this.onPostrender.removeAll(),this.onEmpty.removeAll(),this._entitiesToAdd.length=0,this._entitiesToRemove.length=0,this.addToScene(this._system),this._system._components.forEach(t=>{this._runners.forEach(e=>e.add(t))})}resize(t,e){this._width=t,this._height=e,this.onResize.run(t,e)}_addEntities(){if(this._entitiesToAdd.length){for(let t=0;t<this._entitiesToAdd.length;t++){const e=this._entitiesToAdd[t].runners;e.update.empty||this._onUpdateEntities.add(e.update),e.render.empty||this._onRenderEntities.add(e.render),e.start.run()}this._entitiesToAdd.length=0}}_removeEntities(){const t=this._entitiesToRemove;if(t.length){for(let e=0;e<t.length;e++){const i=t[e];this._removeEntity(i)}t.length=0}}_removeEntity(t){const e=t.runners;this.onEntityRemovedFromScene.run(t),e.removedFromScene.run(this),this.allEntities.remove(t),e.update.empty||this._onUpdateEntities.remove(e.update),e.render.empty||this._onRenderEntities.remove(e.render),t.scene=null,t._gc=!1}}{constructor(t){super(),this.register("onGameover"),this.register("onGameComplete"),this.group=this.addSystem(GroupSystem_GroupSystem),this.transform=this.addSystem(TransformSystem),this.container=this.addSystem(ContainerSystem_ContainerSystem),this.view3d=this.addSystem(View3DSystem_View3DSystem,t),this.groups=this.group.groups}addChild(...t){for(let e=0;e<t.length;e++){const i=t[e];this.container.root.addChild(i)}}removeChild(...t){for(let e=0;e<t.length;e++){const i=t[e];this.container.root.removeChild(i)}}}},function(t,e,i){"use strict";i.d(e,"a",(function(){return StatsPlugin_StatsPlugin}));var n=i(298);class Panel{constructor(t,e,i){this.PR=Math.round(window.devicePixelRatio||1),this.WIDTH=80*this.PR,this.HEIGHT=48*this.PR,this.TEXT_X=3*this.PR,this.TEXT_Y=2*this.PR,this.GRAPH_X=3*this.PR,this.GRAPH_Y=15*this.PR,this.GRAPH_WIDTH=74*this.PR,this.GRAPH_HEIGHT=30*this.PR,this.name=t,this.fg=e,this.bg=i,this.min=1/0,this.max=0,this.canvas=document.createElement("canvas"),this.canvas.width=this.WIDTH,this.canvas.height=this.HEIGHT,this.canvas.style.cssText="width:80px;height:48px",this.context=this.canvas.getContext("2d"),this.context.font="bold "+9*this.PR+"px Helvetica,Arial,sans-serif",this.context.textBaseline="top",this.context.fillStyle=i,this.context.fillRect(0,0,this.WIDTH,this.HEIGHT),this.context.fillStyle=e,this.context.fillText(t,this.TEXT_X,this.TEXT_Y),this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT),this.context.fillStyle=i,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT)}update(t,e){this.min=Math.min(this.min,t),this.max=Math.max(this.max,t),this.context.fillStyle=this.bg,this.context.globalAlpha=1,this.context.fillRect(0,0,this.WIDTH,this.GRAPH_Y),this.context.fillStyle=this.fg,this.context.fillText(Math.round(t)+" "+this.name+" ("+Math.round(this.min)+"-"+Math.round(this.max)+")",this.TEXT_X,this.TEXT_Y),this.context.drawImage(this.canvas,this.GRAPH_X+this.PR,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT,this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT),this.context.fillRect(this.GRAPH_X+this.GRAPH_WIDTH-this.PR,this.GRAPH_Y,this.PR,this.GRAPH_HEIGHT),this.context.fillStyle=this.bg,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X+this.GRAPH_WIDTH-this.PR,this.GRAPH_Y,this.PR,Math.round((1-t/e)*this.GRAPH_HEIGHT))}}class MemoryPanel extends Panel{constructor(t,e,i){super(t,e,i),this.WIDTH=80*this.PR+20,this.HEIGHT=48*this.PR+20,this.GRAPH_Y=15*this.PR+20,this.GRAPH_WIDTH=74*this.PR+20,this.canvas=document.createElement("canvas"),this.canvas.width=this.WIDTH,this.canvas.height=this.HEIGHT,this.canvas.style.cssText="width:80px;height:48px",this.context=this.canvas.getContext("2d"),this.context.font="bold "+12*this.PR+"px Helvetica,Arial,sans-serif",this.context.textBaseline="top",this.context.fillStyle=i,this.context.fillRect(0,0,this.WIDTH,this.HEIGHT),this.context.fillStyle=e,this.context.fillText(t,this.TEXT_X,this.TEXT_Y),this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT),this.context.fillStyle=i,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT)}update(t,e){this.min=Math.min(this.min,t),this.max=Math.max(this.max,t),this.context.fillStyle=this.bg,this.context.globalAlpha=1,this.context.fillRect(0,0,this.WIDTH,this.GRAPH_Y),this.context.fillStyle=this.fg,this.context.fillText(Math.round(t)+" "+this.name+" ("+Math.round(this.min)+"-"+Math.round(this.max)+")",this.TEXT_X,this.TEXT_Y),this.context.fillText(e+" "+this.name,this.TEXT_X,this.TEXT_Y+15),this.context.drawImage(this.canvas,this.GRAPH_X+this.PR,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT,this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT),this.context.fillRect(this.GRAPH_X+this.GRAPH_WIDTH-this.PR,this.GRAPH_Y,this.PR,this.GRAPH_HEIGHT),this.context.fillStyle=this.bg,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X+this.GRAPH_WIDTH-this.PR,this.GRAPH_Y,this.PR,Math.round((1-t/e)*this.GRAPH_HEIGHT))}}class Stats{constructor(){this.mode=0,this.container=document.createElement("div"),this.container.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",this.container.addEventListener("click",t=>{t.preventDefault(),this.showPanel(++this.mode%this.container.children.length)},!1),this.beginTime=(performance||Date).now(),this.prevTime=this.beginTime,this.frames=0,this.fpsPanel=this.addPanel(new Panel("FPS","#0ff","#002")),this.msPanel=this.addPanel(new Panel("MS","#0f0","#020")),self.performance&&self.performance.memory&&(this.memPanel=this.addPanel(new MemoryPanel("MB","#f08","#201"))),this.showPanel(0)}addPanel(t){return this.container.appendChild(t.canvas),t}showPanel(t){for(let e=0;e<this.container.children.length;e++)this.container.children[e].style.display=e===t?"block":"none";this.mode=t}begin(){this.beginTime=(performance||Date).now()}end(){this.frames++;const t=(performance||Date).now();if(this.msPanel.update(t-this.beginTime,200),t>=this.prevTime+1e3&&(this.fpsPanel.update(1e3*this.frames/(t-this.prevTime),100),this.prevTime=t,this.frames=0,this.memPanel)){const t=performance.memory;this.memPanel.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return t}update(){this.beginTime=this.end()}}class StatsPlugin_StatsPlugin extends n.a{prepare(){this.stats=new Stats,this.stats.showPanel(0),document.body.appendChild(this.stats.container)}update(){var t;null===(t=this.stats)||void 0===t||t.update()}}},function(t,e,i){"use strict";function n(t,e){var i=t.__state.conversionName.toString(),n=Math.round(t.r),r=Math.round(t.g),o=Math.round(t.b),a=t.a,s=Math.round(t.h),h=t.s.toFixed(1),u=t.v.toFixed(1);if(e||"THREE_CHAR_HEX"===i||"SIX_CHAR_HEX"===i){for(var l=t.hex.toString(16);l.length<6;)l="0"+l;return"#"+l}return"CSS_RGB"===i?"rgb("+n+","+r+","+o+")":"CSS_RGBA"===i?"rgba("+n+","+r+","+o+","+a+")":"HEX"===i?"0x"+t.hex.toString(16):"RGB_ARRAY"===i?"["+n+","+r+","+o+"]":"RGBA_ARRAY"===i?"["+n+","+r+","+o+","+a+"]":"RGB_OBJ"===i?"{r:"+n+",g:"+r+",b:"+o+"}":"RGBA_OBJ"===i?"{r:"+n+",g:"+r+",b:"+o+",a:"+a+"}":"HSV_OBJ"===i?"{h:"+s+",s:"+h+",v:"+u+"}":"HSVA_OBJ"===i?"{h:"+s+",s:"+h+",v:"+u+",a:"+a+"}":"unknown format"}i.d(e,"a",(function(){return ct}));var r=Array.prototype.forEach,o=Array.prototype.slice,a={BREAK:{},extend:function(t){return this.each(o.call(arguments,1),(function(e){(this.isObject(e)?Object.keys(e):[]).forEach(function(i){this.isUndefined(e[i])||(t[i]=e[i])}.bind(this))}),this),t},defaults:function(t){return this.each(o.call(arguments,1),(function(e){(this.isObject(e)?Object.keys(e):[]).forEach(function(i){this.isUndefined(t[i])&&(t[i]=e[i])}.bind(this))}),this),t},compose:function(){var t=o.call(arguments);return function(){for(var e=o.call(arguments),i=t.length-1;i>=0;i--)e=[t[i].apply(this,e)];return e[0]}},each:function(t,e,i){if(t)if(r&&t.forEach&&t.forEach===r)t.forEach(e,i);else if(t.length===t.length+0){var n,o=void 0;for(o=0,n=t.length;o<n;o++)if(o in t&&e.call(i,t[o],o)===this.BREAK)return}else for(var a in t)if(e.call(i,t[a],a)===this.BREAK)return},defer:function(t){setTimeout(t,0)},debounce:function(t,e,i){var n=void 0;return function(){var r=this,o=arguments;function a(){n=null,i||t.apply(r,o)}var s=i||!n;clearTimeout(n),n=setTimeout(a,e),s&&t.apply(r,o)}},toArray:function(t){return t.toArray?t.toArray():o.call(t)},isUndefined:function(t){return void 0===t},isNull:function(t){return null===t},isNaN:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){return isNaN(t)})),isArray:Array.isArray||function(t){return t.constructor===Array},isObject:function(t){return t===Object(t)},isNumber:function(t){return t===t+0},isString:function(t){return t===t+""},isBoolean:function(t){return!1===t||!0===t},isFunction:function(t){return t instanceof Function}},s=[{litmus:a.isString,conversions:{THREE_CHAR_HEX:{read:function(t){var e=t.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null!==e&&{space:"HEX",hex:parseInt("0x"+e[1].toString()+e[1].toString()+e[2].toString()+e[2].toString()+e[3].toString()+e[3].toString(),0)}},write:n},SIX_CHAR_HEX:{read:function(t){var e=t.match(/^#([A-F0-9]{6})$/i);return null!==e&&{space:"HEX",hex:parseInt("0x"+e[1].toString(),0)}},write:n},CSS_RGB:{read:function(t){var e=t.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==e&&{space:"RGB",r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3])}},write:n},CSS_RGBA:{read:function(t){var e=t.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==e&&{space:"RGB",r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3]),a:parseFloat(e[4])}},write:n}}},{litmus:a.isNumber,conversions:{HEX:{read:function(t){return{space:"HEX",hex:t,conversionName:"HEX"}},write:function(t){return t.hex}}}},{litmus:a.isArray,conversions:{RGB_ARRAY:{read:function(t){return 3===t.length&&{space:"RGB",r:t[0],g:t[1],b:t[2]}},write:function(t){return[t.r,t.g,t.b]}},RGBA_ARRAY:{read:function(t){return 4===t.length&&{space:"RGB",r:t[0],g:t[1],b:t[2],a:t[3]}},write:function(t){return[t.r,t.g,t.b,t.a]}}}},{litmus:a.isObject,conversions:{RGBA_OBJ:{read:function(t){return!!(a.isNumber(t.r)&&a.isNumber(t.g)&&a.isNumber(t.b)&&a.isNumber(t.a))&&{space:"RGB",r:t.r,g:t.g,b:t.b,a:t.a}},write:function(t){return{r:t.r,g:t.g,b:t.b,a:t.a}}},RGB_OBJ:{read:function(t){return!!(a.isNumber(t.r)&&a.isNumber(t.g)&&a.isNumber(t.b))&&{space:"RGB",r:t.r,g:t.g,b:t.b}},write:function(t){return{r:t.r,g:t.g,b:t.b}}},HSVA_OBJ:{read:function(t){return!!(a.isNumber(t.h)&&a.isNumber(t.s)&&a.isNumber(t.v)&&a.isNumber(t.a))&&{space:"HSV",h:t.h,s:t.s,v:t.v,a:t.a}},write:function(t){return{h:t.h,s:t.s,v:t.v,a:t.a}}},HSV_OBJ:{read:function(t){return!!(a.isNumber(t.h)&&a.isNumber(t.s)&&a.isNumber(t.v))&&{space:"HSV",h:t.h,s:t.s,v:t.v}},write:function(t){return{h:t.h,s:t.s,v:t.v}}}}}],h=void 0,u=void 0,l=function(){u=!1;var t=arguments.length>1?a.toArray(arguments):arguments[0];return a.each(s,(function(e){if(e.litmus(t))return a.each(e.conversions,(function(e,i){if(h=e.read(t),!1===u&&!1!==h)return u=h,h.conversionName=i,h.conversion=e,a.BREAK})),a.BREAK})),u},c=void 0,d={hsv_to_rgb:function(t,e,i){var n=Math.floor(t/60)%6,r=t/60-Math.floor(t/60),o=i*(1-e),a=i*(1-r*e),s=i*(1-(1-r)*e),h=[[i,s,o],[a,i,o],[o,i,s],[o,a,i],[s,o,i],[i,o,a]][n];return{r:255*h[0],g:255*h[1],b:255*h[2]}},rgb_to_hsv:function(t,e,i){var n=Math.min(t,e,i),r=Math.max(t,e,i),o=r-n,a=void 0;return 0===r?{h:NaN,s:0,v:0}:(a=t===r?(e-i)/o:e===r?2+(i-t)/o:4+(t-e)/o,(a/=6)<0&&(a+=1),{h:360*a,s:o/r,v:r/255})},rgb_to_hex:function(t,e,i){var n=this.hex_with_component(0,2,t);return n=this.hex_with_component(n,1,e),n=this.hex_with_component(n,0,i)},component_from_hex:function(t,e){return t>>8*e&255},hex_with_component:function(t,e,i){return i<<(c=8*e)|t&~(255<<c)}},p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},m=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),g=function t(e,i,n){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,i);if(void 0===r){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,i,n)}if("value"in r)return r.value;var a=r.get;return void 0!==a?a.call(n):void 0},y=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},v=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},b=function(){function t(){if(f(this,t),this.__state=l.apply(this,arguments),!1===this.__state)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}return m(t,[{key:"toString",value:function(){return n(this)}},{key:"toHexString",value:function(){return n(this,!0)}},{key:"toOriginal",value:function(){return this.__state.conversion.write(this)}}]),t}();function _(t,e,i){Object.defineProperty(t,e,{get:function(){return"RGB"===this.__state.space||b.recalculateRGB(this,e,i),this.__state[e]},set:function(t){"RGB"!==this.__state.space&&(b.recalculateRGB(this,e,i),this.__state.space="RGB"),this.__state[e]=t}})}function w(t,e){Object.defineProperty(t,e,{get:function(){return"HSV"===this.__state.space||b.recalculateHSV(this),this.__state[e]},set:function(t){"HSV"!==this.__state.space&&(b.recalculateHSV(this),this.__state.space="HSV"),this.__state[e]=t}})}b.recalculateRGB=function(t,e,i){if("HEX"===t.__state.space)t.__state[e]=d.component_from_hex(t.__state.hex,i);else{if("HSV"!==t.__state.space)throw new Error("Corrupted color state");a.extend(t.__state,d.hsv_to_rgb(t.__state.h,t.__state.s,t.__state.v))}},b.recalculateHSV=function(t){var e=d.rgb_to_hsv(t.r,t.g,t.b);a.extend(t.__state,{s:e.s,v:e.v}),a.isNaN(e.h)?a.isUndefined(t.__state.h)&&(t.__state.h=0):t.__state.h=e.h},b.COMPONENTS=["r","g","b","h","s","v","hex","a"],_(b.prototype,"r",2),_(b.prototype,"g",1),_(b.prototype,"b",0),w(b.prototype,"h"),w(b.prototype,"s"),w(b.prototype,"v"),Object.defineProperty(b.prototype,"a",{get:function(){return this.__state.a},set:function(t){this.__state.a=t}}),Object.defineProperty(b.prototype,"hex",{get:function(){return"HEX"!==this.__state.space&&(this.__state.hex=d.rgb_to_hex(this.r,this.g,this.b),this.__state.space="HEX"),this.__state.hex},set:function(t){this.__state.space="HEX",this.__state.hex=t}});var x=function(){function t(e,i){f(this,t),this.initialValue=e[i],this.domElement=document.createElement("div"),this.object=e,this.property=i,this.__onChange=void 0,this.__onFinishChange=void 0}return m(t,[{key:"onChange",value:function(t){return this.__onChange=t,this}},{key:"onFinishChange",value:function(t){return this.__onFinishChange=t,this}},{key:"setValue",value:function(t){return this.object[this.property]=t,this.__onChange&&this.__onChange.call(this,t),this.updateDisplay(),this}},{key:"getValue",value:function(){return this.object[this.property]}},{key:"updateDisplay",value:function(){return this}},{key:"isModified",value:function(){return this.initialValue!==this.getValue()}}]),t}(),C={};a.each({HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},(function(t,e){a.each(t,(function(t){C[t]=e}))}));var S=/(\d+(\.\d+)?)px/;function T(t){if("0"===t||a.isUndefined(t))return 0;var e=t.match(S);return a.isNull(e)?0:parseFloat(e[1])}var A={makeSelectable:function(t,e){void 0!==t&&void 0!==t.style&&(t.onselectstart=e?function(){return!1}:function(){},t.style.MozUserSelect=e?"auto":"none",t.style.KhtmlUserSelect=e?"auto":"none",t.unselectable=e?"on":"off")},makeFullscreen:function(t,e,i){var n=i,r=e;a.isUndefined(r)&&(r=!0),a.isUndefined(n)&&(n=!0),t.style.position="absolute",r&&(t.style.left=0,t.style.right=0),n&&(t.style.top=0,t.style.bottom=0)},fakeEvent:function(t,e,i,n){var r=i||{},o=C[e];if(!o)throw new Error("Event type "+e+" not supported.");var s=document.createEvent(o);switch(o){case"MouseEvents":var h=r.x||r.clientX||0,u=r.y||r.clientY||0;s.initMouseEvent(e,r.bubbles||!1,r.cancelable||!0,window,r.clickCount||1,0,0,h,u,!1,!1,!1,!1,0,null);break;case"KeyboardEvents":var l=s.initKeyboardEvent||s.initKeyEvent;a.defaults(r,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),l(e,r.bubbles||!1,r.cancelable,window,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.keyCode,r.charCode);break;default:s.initEvent(e,r.bubbles||!1,r.cancelable||!0)}a.defaults(s,n),t.dispatchEvent(s)},bind:function(t,e,i,n){var r=n||!1;return t.addEventListener?t.addEventListener(e,i,r):t.attachEvent&&t.attachEvent("on"+e,i),A},unbind:function(t,e,i,n){var r=n||!1;return t.removeEventListener?t.removeEventListener(e,i,r):t.detachEvent&&t.detachEvent("on"+e,i),A},addClass:function(t,e){if(void 0===t.className)t.className=e;else if(t.className!==e){var i=t.className.split(/ +/);-1===i.indexOf(e)&&(i.push(e),t.className=i.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}return A},removeClass:function(t,e){if(e)if(t.className===e)t.removeAttribute("class");else{var i=t.className.split(/ +/),n=i.indexOf(e);-1!==n&&(i.splice(n,1),t.className=i.join(" "))}else t.className=void 0;return A},hasClass:function(t,e){return new RegExp("(?:^|\\s+)"+e+"(?:\\s+|$)").test(t.className)||!1},getWidth:function(t){var e=getComputedStyle(t);return T(e["border-left-width"])+T(e["border-right-width"])+T(e["padding-left"])+T(e["padding-right"])+T(e.width)},getHeight:function(t){var e=getComputedStyle(t);return T(e["border-top-width"])+T(e["border-bottom-width"])+T(e["padding-top"])+T(e["padding-bottom"])+T(e.height)},getOffset:function(t){var e=t,i={left:0,top:0};if(e.offsetParent)do{i.left+=e.offsetLeft,i.top+=e.offsetTop,e=e.offsetParent}while(e);return i},isActive:function(t){return t===document.activeElement&&(t.type||t.href)}},E=function(t){function e(t,i){f(this,e);var n=v(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i)),r=n;return n.__prev=n.getValue(),n.__checkbox=document.createElement("input"),n.__checkbox.setAttribute("type","checkbox"),A.bind(n.__checkbox,"change",(function(){r.setValue(!r.__prev)}),!1),n.domElement.appendChild(n.__checkbox),n.updateDisplay(),n}return y(e,t),m(e,[{key:"setValue",value:function(t){var i=g(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,t);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),i}},{key:"updateDisplay",value:function(){return!0===this.getValue()?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0,this.__prev=!0):(this.__checkbox.checked=!1,this.__prev=!1),g(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(x),P=function(t){function e(t,i,n){f(this,e);var r=v(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i)),o=n,s=r;if(r.__select=document.createElement("select"),a.isArray(o)){var h={};a.each(o,(function(t){h[t]=t})),o=h}return a.each(o,(function(t,e){var i=document.createElement("option");i.innerHTML=e,i.setAttribute("value",t),s.__select.appendChild(i)})),r.updateDisplay(),A.bind(r.__select,"change",(function(){var t=this.options[this.selectedIndex].value;s.setValue(t)})),r.domElement.appendChild(r.__select),r}return y(e,t),m(e,[{key:"setValue",value:function(t){var i=g(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,t);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),i}},{key:"updateDisplay",value:function(){return A.isActive(this.__select)?this:(this.__select.value=this.getValue(),g(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this))}}]),e}(x),M=function(t){function e(t,i){f(this,e);var n=v(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i)),r=n;function o(){r.setValue(r.__input.value)}return n.__input=document.createElement("input"),n.__input.setAttribute("type","text"),A.bind(n.__input,"keyup",o),A.bind(n.__input,"change",o),A.bind(n.__input,"blur",(function(){r.__onFinishChange&&r.__onFinishChange.call(r,r.getValue())})),A.bind(n.__input,"keydown",(function(t){13===t.keyCode&&this.blur()})),n.updateDisplay(),n.domElement.appendChild(n.__input),n}return y(e,t),m(e,[{key:"updateDisplay",value:function(){return A.isActive(this.__input)||(this.__input.value=this.getValue()),g(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(x);function I(t){var e=t.toString();return e.indexOf(".")>-1?e.length-e.indexOf(".")-1:0}var k=function(t){function e(t,i,n){f(this,e);var r=v(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i)),o=n||{};return r.__min=o.min,r.__max=o.max,r.__step=o.step,a.isUndefined(r.__step)?0===r.initialValue?r.__impliedStep=1:r.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(r.initialValue))/Math.LN10))/10:r.__impliedStep=r.__step,r.__precision=I(r.__impliedStep),r}return y(e,t),m(e,[{key:"setValue",value:function(t){var i=t;return void 0!==this.__min&&i<this.__min?i=this.__min:void 0!==this.__max&&i>this.__max&&(i=this.__max),void 0!==this.__step&&i%this.__step!=0&&(i=Math.round(i/this.__step)*this.__step),g(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setValue",this).call(this,i)}},{key:"min",value:function(t){return this.__min=t,this}},{key:"max",value:function(t){return this.__max=t,this}},{key:"step",value:function(t){return this.__step=t,this.__impliedStep=t,this.__precision=I(t),this}}]),e}(x);var O=function(t){function e(t,i,n){f(this,e);var r=v(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i,n));r.__truncationSuspended=!1;var o=r,s=void 0;function h(){o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}function u(t){var e=s-t.clientY;o.setValue(o.getValue()+e*o.__impliedStep),s=t.clientY}function l(){A.unbind(window,"mousemove",u),A.unbind(window,"mouseup",l),h()}return r.__input=document.createElement("input"),r.__input.setAttribute("type","text"),A.bind(r.__input,"change",(function(){var t=parseFloat(o.__input.value);a.isNaN(t)||o.setValue(t)})),A.bind(r.__input,"blur",(function(){h()})),A.bind(r.__input,"mousedown",(function(t){A.bind(window,"mousemove",u),A.bind(window,"mouseup",l),s=t.clientY})),A.bind(r.__input,"keydown",(function(t){13===t.keyCode&&(o.__truncationSuspended=!0,this.blur(),o.__truncationSuspended=!1,h())})),r.updateDisplay(),r.domElement.appendChild(r.__input),r}return y(e,t),m(e,[{key:"updateDisplay",value:function(){var t,i,n;return this.__input.value=this.__truncationSuspended?this.getValue():(t=this.getValue(),i=this.__precision,n=Math.pow(10,i),Math.round(t*n)/n),g(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(k);function R(t,e,i,n,r){return n+(t-e)/(i-e)*(r-n)}var D=function(t){function e(t,i,n,r,o){f(this,e);var a=v(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i,{min:n,max:r,step:o})),s=a;function h(t){t.preventDefault();var e=s.__background.getBoundingClientRect();return s.setValue(R(t.clientX,e.left,e.right,s.__min,s.__max)),!1}function u(){A.unbind(window,"mousemove",h),A.unbind(window,"mouseup",u),s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}function l(t){var e=t.touches[0].clientX,i=s.__background.getBoundingClientRect();s.setValue(R(e,i.left,i.right,s.__min,s.__max))}function c(){A.unbind(window,"touchmove",l),A.unbind(window,"touchend",c),s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())}return a.__background=document.createElement("div"),a.__foreground=document.createElement("div"),A.bind(a.__background,"mousedown",(function(t){document.activeElement.blur(),A.bind(window,"mousemove",h),A.bind(window,"mouseup",u),h(t)})),A.bind(a.__background,"touchstart",(function(t){if(1!==t.touches.length)return;A.bind(window,"touchmove",l),A.bind(window,"touchend",c),l(t)})),A.addClass(a.__background,"slider"),A.addClass(a.__foreground,"slider-fg"),a.updateDisplay(),a.__background.appendChild(a.__foreground),a.domElement.appendChild(a.__background),a}return y(e,t),m(e,[{key:"updateDisplay",value:function(){var t=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*t+"%",g(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"updateDisplay",this).call(this)}}]),e}(k),L=function(t){function e(t,i,n){f(this,e);var r=v(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i)),o=r;return r.__button=document.createElement("div"),r.__button.innerHTML=void 0===n?"Fire":n,A.bind(r.__button,"click",(function(t){return t.preventDefault(),o.fire(),!1})),A.addClass(r.__button,"button"),r.domElement.appendChild(r.__button),r}return y(e,t),m(e,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),e}(x),N=function(t){function e(t,i){f(this,e);var n=v(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i));n.__color=new b(n.getValue()),n.__temp=new b(0);var r=n;n.domElement=document.createElement("div"),A.makeSelectable(n.domElement,!1),n.__selector=document.createElement("div"),n.__selector.className="selector",n.__saturation_field=document.createElement("div"),n.__saturation_field.className="saturation-field",n.__field_knob=document.createElement("div"),n.__field_knob.className="field-knob",n.__field_knob_border="2px solid ",n.__hue_knob=document.createElement("div"),n.__hue_knob.className="hue-knob",n.__hue_field=document.createElement("div"),n.__hue_field.className="hue-field",n.__input=document.createElement("input"),n.__input.type="text",n.__input_textShadow="0 1px 1px ",A.bind(n.__input,"keydown",(function(t){13===t.keyCode&&p.call(this)})),A.bind(n.__input,"blur",p),A.bind(n.__selector,"mousedown",(function(){A.addClass(this,"drag").bind(window,"mouseup",(function(){A.removeClass(r.__selector,"drag")}))})),A.bind(n.__selector,"touchstart",(function(){A.addClass(this,"drag").bind(window,"touchend",(function(){A.removeClass(r.__selector,"drag")}))}));var o,s=document.createElement("div");function h(t){g(t),A.bind(window,"mousemove",g),A.bind(window,"touchmove",g),A.bind(window,"mouseup",c),A.bind(window,"touchend",c)}function u(t){y(t),A.bind(window,"mousemove",y),A.bind(window,"touchmove",y),A.bind(window,"mouseup",d),A.bind(window,"touchend",d)}function c(){A.unbind(window,"mousemove",g),A.unbind(window,"touchmove",g),A.unbind(window,"mouseup",c),A.unbind(window,"touchend",c),m()}function d(){A.unbind(window,"mousemove",y),A.unbind(window,"touchmove",y),A.unbind(window,"mouseup",d),A.unbind(window,"touchend",d),m()}function p(){var t=l(this.value);!1!==t?(r.__color.__state=t,r.setValue(r.__color.toOriginal())):this.value=r.__color.toString()}function m(){r.__onFinishChange&&r.__onFinishChange.call(r,r.__color.toOriginal())}function g(t){-1===t.type.indexOf("touch")&&t.preventDefault();var e=r.__saturation_field.getBoundingClientRect(),i=t.touches&&t.touches[0]||t,n=i.clientX,o=i.clientY,a=(n-e.left)/(e.right-e.left),s=1-(o-e.top)/(e.bottom-e.top);return s>1?s=1:s<0&&(s=0),a>1?a=1:a<0&&(a=0),r.__color.v=s,r.__color.s=a,r.setValue(r.__color.toOriginal()),!1}function y(t){-1===t.type.indexOf("touch")&&t.preventDefault();var e=r.__hue_field.getBoundingClientRect(),i=1-((t.touches&&t.touches[0]||t).clientY-e.top)/(e.bottom-e.top);return i>1?i=1:i<0&&(i=0),r.__color.h=360*i,r.setValue(r.__color.toOriginal()),!1}return a.extend(n.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),a.extend(n.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:n.__field_knob_border+(n.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),a.extend(n.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),a.extend(n.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),a.extend(s.style,{width:"100%",height:"100%",background:"none"}),F(s,"top","rgba(0,0,0,0)","#000"),a.extend(n.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),(o=n.__hue_field).style.background="",o.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",o.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",o.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",a.extend(n.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:n.__input_textShadow+"rgba(0,0,0,0.7)"}),A.bind(n.__saturation_field,"mousedown",h),A.bind(n.__saturation_field,"touchstart",h),A.bind(n.__field_knob,"mousedown",h),A.bind(n.__field_knob,"touchstart",h),A.bind(n.__hue_field,"mousedown",u),A.bind(n.__hue_field,"touchstart",u),n.__saturation_field.appendChild(s),n.__selector.appendChild(n.__field_knob),n.__selector.appendChild(n.__saturation_field),n.__selector.appendChild(n.__hue_field),n.__hue_field.appendChild(n.__hue_knob),n.domElement.appendChild(n.__input),n.domElement.appendChild(n.__selector),n.updateDisplay(),n}return y(e,t),m(e,[{key:"updateDisplay",value:function(){var t=l(this.getValue());if(!1!==t){var e=!1;a.each(b.COMPONENTS,(function(i){if(!a.isUndefined(t[i])&&!a.isUndefined(this.__color.__state[i])&&t[i]!==this.__color.__state[i])return e=!0,{}}),this),e&&a.extend(this.__color.__state,t)}a.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var i=this.__color.v<.5||this.__color.s>.5?255:0,n=255-i;a.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+i+","+i+","+i+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,F(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),a.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+i+","+i+","+i+")",textShadow:this.__input_textShadow+"rgba("+n+","+n+","+n+",.7)"})}}]),e}(x),B=["-moz-","-o-","-webkit-","-ms-",""];function F(t,e,i,n){t.style.background="",a.each(B,(function(r){t.style.cssText+="background: "+r+"linear-gradient("+e+", "+i+" 0%, "+n+" 100%); "}))}var z=function(t,e){var i=e||document,n=document.createElement("style");n.type="text/css",n.innerHTML=t;var r=i.getElementsByTagName("head")[0];try{r.appendChild(n)}catch(t){}},j='<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n\n </div>\n\n </div>\n\n</div>',G=function(t,e){var i=t[e];return a.isArray(arguments[2])||a.isObject(arguments[2])?new P(t,e,arguments[2]):a.isNumber(i)?a.isNumber(arguments[2])&&a.isNumber(arguments[3])?a.isNumber(arguments[4])?new D(t,e,arguments[2],arguments[3],arguments[4]):new D(t,e,arguments[2],arguments[3]):a.isNumber(arguments[4])?new O(t,e,{min:arguments[2],max:arguments[3],step:arguments[4]}):new O(t,e,{min:arguments[2],max:arguments[3]}):a.isString(i)?new M(t,e):a.isFunction(i)?new L(t,e,""):a.isBoolean(i)?new E(t,e):null};var U=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,1e3/60)},H=function(){function t(){f(this,t),this.backgroundElement=document.createElement("div"),a.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),A.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),a.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var e=this;A.bind(this.backgroundElement,"click",(function(){e.hide()}))}return m(t,[{key:"show",value:function(){var t=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),a.defer((function(){t.backgroundElement.style.opacity=1,t.domElement.style.opacity=1,t.domElement.style.webkitTransform="scale(1)"}))}},{key:"hide",value:function(){var t=this,e=function e(){t.domElement.style.display="none",t.backgroundElement.style.display="none",A.unbind(t.domElement,"webkitTransitionEnd",e),A.unbind(t.domElement,"transitionend",e),A.unbind(t.domElement,"oTransitionEnd",e)};A.bind(this.domElement,"webkitTransitionEnd",e),A.bind(this.domElement,"transitionend",e),A.bind(this.domElement,"oTransitionEnd",e),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function(){this.domElement.style.left=window.innerWidth/2-A.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-A.getHeight(this.domElement)/2+"px"}}]),t}();z(function(t){if(t&&"undefined"!=typeof window){var e=document.createElement("style");return e.setAttribute("type","text/css"),e.innerHTML=t,document.head.appendChild(e),t}}(".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n"));var V=function(){try{return!!window.localStorage}catch(t){return!1}}(),W=void 0,X=!0,Y=void 0,q=!1,K=[],J=function t(e){var i=this,n=e||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),A.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],n=a.defaults(n,{closeOnTop:!1,autoPlace:!0,width:t.DEFAULT_WIDTH}),n=a.defaults(n,{resizable:n.autoPlace,hideable:n.autoPlace}),a.isUndefined(n.load)?n.load={preset:"Default"}:n.preset&&(n.load.preset=n.preset),a.isUndefined(n.parent)&&n.hideable&&K.push(this),n.resizable=a.isUndefined(n.parent)&&n.resizable,n.autoPlace&&a.isUndefined(n.scrollable)&&(n.scrollable=!0);var r,o=V&&"true"===localStorage.getItem(it(this,"isLocal")),s=void 0,h=void 0;if(Object.defineProperties(this,{parent:{get:function(){return n.parent}},scrollable:{get:function(){return n.scrollable}},autoPlace:{get:function(){return n.autoPlace}},closeOnTop:{get:function(){return n.closeOnTop}},preset:{get:function(){return i.parent?i.getRoot().preset:n.load.preset},set:function(t){i.parent?i.getRoot().preset=t:n.load.preset=t,function(t){for(var e=0;e<t.__preset_select.length;e++)t.__preset_select[e].value===t.preset&&(t.__preset_select.selectedIndex=e)}(this),i.revert()}},width:{get:function(){return n.width},set:function(t){n.width=t,st(i,t)}},name:{get:function(){return n.name},set:function(t){n.name=t,h&&(h.innerHTML=n.name)}},closed:{get:function(){return n.closed},set:function(e){n.closed=e,n.closed?A.addClass(i.__ul,t.CLASS_CLOSED):A.removeClass(i.__ul,t.CLASS_CLOSED),this.onResize(),i.__closeButton&&(i.__closeButton.innerHTML=e?t.TEXT_OPEN:t.TEXT_CLOSED)}},load:{get:function(){return n.load}},useLocalStorage:{get:function(){return o},set:function(t){V&&(o=t,t?A.bind(window,"unload",s):A.unbind(window,"unload",s),localStorage.setItem(it(i,"isLocal"),t))}}}),a.isUndefined(n.parent)){if(this.closed=n.closed||!1,A.addClass(this.domElement,t.CLASS_MAIN),A.makeSelectable(this.domElement,!1),V&&o){i.useLocalStorage=!0;var u=localStorage.getItem(it(this,"gui"));u&&(n.load=JSON.parse(u))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=t.TEXT_CLOSED,A.addClass(this.__closeButton,t.CLASS_CLOSE_BUTTON),n.closeOnTop?(A.addClass(this.__closeButton,t.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(A.addClass(this.__closeButton,t.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),A.bind(this.__closeButton,"click",(function(){i.closed=!i.closed}))}else{void 0===n.closed&&(n.closed=!0);var l=document.createTextNode(n.name);A.addClass(l,"controller-name"),h=Z(i,l);A.addClass(this.__ul,t.CLASS_CLOSED),A.addClass(h,"title"),A.bind(h,"click",(function(t){return t.preventDefault(),i.closed=!i.closed,!1})),n.closed||(this.closed=!1)}n.autoPlace&&(a.isUndefined(n.parent)&&(X&&(Y=document.createElement("div"),A.addClass(Y,"dg"),A.addClass(Y,t.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(Y),X=!1),Y.appendChild(this.domElement),A.addClass(this.domElement,t.CLASS_AUTO_PLACE)),this.parent||st(i,n.width)),this.__resizeHandler=function(){i.onResizeDebounced()},A.bind(window,"resize",this.__resizeHandler),A.bind(this.__ul,"webkitTransitionEnd",this.__resizeHandler),A.bind(this.__ul,"transitionend",this.__resizeHandler),A.bind(this.__ul,"oTransitionEnd",this.__resizeHandler),this.onResize(),n.resizable&&at(this),s=function(){V&&"true"===localStorage.getItem(it(i,"isLocal"))&&localStorage.setItem(it(i,"gui"),JSON.stringify(i.getSaveObject()))},this.saveToLocalStorageIfPossible=s,n.parent||((r=i.getRoot()).width+=1,a.defer((function(){r.width-=1})))};function Z(t,e,i){var n=document.createElement("li");return e&&n.appendChild(e),i?t.__ul.insertBefore(n,i):t.__ul.appendChild(n),t.onResize(),n}function Q(t){A.unbind(window,"resize",t.__resizeHandler),t.saveToLocalStorageIfPossible&&A.unbind(window,"unload",t.saveToLocalStorageIfPossible)}function $(t,e){var i=t.__preset_select[t.__preset_select.selectedIndex];i.innerHTML=e?i.value+"*":i.value}function tt(t,e){var i=t.getRoot(),n=i.__rememberedObjects.indexOf(e.object);if(-1!==n){var r=i.__rememberedObjectIndecesToControllers[n];if(void 0===r&&(r={},i.__rememberedObjectIndecesToControllers[n]=r),r[e.property]=e,i.load&&i.load.remembered){var o=i.load.remembered,a=void 0;if(o[t.preset])a=o[t.preset];else{if(!o.Default)return;a=o.Default}if(a[n]&&void 0!==a[n][e.property]){var s=a[n][e.property];e.initialValue=s,e.setValue(s)}}}}function et(t,e,i,n){if(void 0===e[i])throw new Error('Object "'+e+'" has no property "'+i+'"');var r=void 0;if(n.color)r=new N(e,i);else{var o=[e,i].concat(n.factoryArgs);r=G.apply(t,o)}n.before instanceof x&&(n.before=n.before.__li),tt(t,r),A.addClass(r.domElement,"c");var s=document.createElement("span");A.addClass(s,"property-name"),s.innerHTML=r.property;var h=document.createElement("div");h.appendChild(s),h.appendChild(r.domElement);var u=Z(t,h,n.before);return A.addClass(u,J.CLASS_CONTROLLER_ROW),r instanceof N?A.addClass(u,"color"):A.addClass(u,p(r.getValue())),function(t,e,i){if(i.__li=e,i.__gui=t,a.extend(i,{options:function(e){if(arguments.length>1){var n=i.__li.nextElementSibling;return i.remove(),et(t,i.object,i.property,{before:n,factoryArgs:[a.toArray(arguments)]})}if(a.isArray(e)||a.isObject(e)){var r=i.__li.nextElementSibling;return i.remove(),et(t,i.object,i.property,{before:r,factoryArgs:[e]})}},name:function(t){return i.__li.firstElementChild.firstElementChild.innerHTML=t,i},listen:function(){return i.__gui.listen(i),i},remove:function(){return i.__gui.remove(i),i}}),i instanceof D){var n=new O(i.object,i.property,{min:i.__min,max:i.__max,step:i.__step});a.each(["updateDisplay","onChange","onFinishChange","step","min","max"],(function(t){var e=i[t],r=n[t];i[t]=n[t]=function(){var t=Array.prototype.slice.call(arguments);return r.apply(n,t),e.apply(i,t)}})),A.addClass(e,"has-slider"),i.domElement.insertBefore(n.domElement,i.domElement.firstElementChild)}else if(i instanceof O){var r=function(e){if(a.isNumber(i.__min)&&a.isNumber(i.__max)){var n=i.__li.firstElementChild.firstElementChild.innerHTML,r=i.__gui.__listening.indexOf(i)>-1;i.remove();var o=et(t,i.object,i.property,{before:i.__li.nextElementSibling,factoryArgs:[i.__min,i.__max,i.__step]});return o.name(n),r&&o.listen(),o}return e};i.min=a.compose(r,i.min),i.max=a.compose(r,i.max)}else i instanceof E?(A.bind(e,"click",(function(){A.fakeEvent(i.__checkbox,"click")})),A.bind(i.__checkbox,"click",(function(t){t.stopPropagation()}))):i instanceof L?(A.bind(e,"click",(function(){A.fakeEvent(i.__button,"click")})),A.bind(e,"mouseover",(function(){A.addClass(i.__button,"hover")})),A.bind(e,"mouseout",(function(){A.removeClass(i.__button,"hover")}))):i instanceof N&&(A.addClass(e,"color"),i.updateDisplay=a.compose((function(t){return e.style.borderLeftColor=i.__color.toString(),t}),i.updateDisplay),i.updateDisplay());i.setValue=a.compose((function(e){return t.getRoot().__preset_select&&i.isModified()&&$(t.getRoot(),!0),e}),i.setValue)}(t,u,r),t.__controllers.push(r),r}function it(t,e){return document.location.href+"."+e}function nt(t,e,i){var n=document.createElement("option");n.innerHTML=e,n.value=e,t.__preset_select.appendChild(n),i&&(t.__preset_select.selectedIndex=t.__preset_select.length-1)}function rt(t,e){e.style.display=t.useLocalStorage?"block":"none"}function ot(t){var e=t.__save_row=document.createElement("li");A.addClass(t.domElement,"has-save"),t.__ul.insertBefore(e,t.__ul.firstChild),A.addClass(e,"save-row");var i=document.createElement("span");i.innerHTML="&nbsp;",A.addClass(i,"button gears");var n=document.createElement("span");n.innerHTML="Save",A.addClass(n,"button"),A.addClass(n,"save");var r=document.createElement("span");r.innerHTML="New",A.addClass(r,"button"),A.addClass(r,"save-as");var o=document.createElement("span");o.innerHTML="Revert",A.addClass(o,"button"),A.addClass(o,"revert");var s=t.__preset_select=document.createElement("select");if(t.load&&t.load.remembered?a.each(t.load.remembered,(function(e,i){nt(t,i,i===t.preset)})):nt(t,"Default",!1),A.bind(s,"change",(function(){for(var e=0;e<t.__preset_select.length;e++)t.__preset_select[e].innerHTML=t.__preset_select[e].value;t.preset=this.value})),e.appendChild(s),e.appendChild(i),e.appendChild(n),e.appendChild(r),e.appendChild(o),V){var h=document.getElementById("dg-local-explain"),u=document.getElementById("dg-local-storage");document.getElementById("dg-save-locally").style.display="block","true"===localStorage.getItem(it(0,"isLocal"))&&u.setAttribute("checked","checked"),rt(t,h),A.bind(u,"change",(function(){t.useLocalStorage=!t.useLocalStorage,rt(t,h)}))}var l=document.getElementById("dg-new-constructor");A.bind(l,"keydown",(function(t){!t.metaKey||67!==t.which&&67!==t.keyCode||W.hide()})),A.bind(i,"click",(function(){l.innerHTML=JSON.stringify(t.getSaveObject(),void 0,2),W.show(),l.focus(),l.select()})),A.bind(n,"click",(function(){t.save()})),A.bind(r,"click",(function(){var e=prompt("Enter a new preset name.");e&&t.saveAs(e)})),A.bind(o,"click",(function(){t.revert()}))}function at(t){var e=void 0;function i(i){return i.preventDefault(),t.width+=e-i.clientX,t.onResize(),e=i.clientX,!1}function n(){A.removeClass(t.__closeButton,J.CLASS_DRAG),A.unbind(window,"mousemove",i),A.unbind(window,"mouseup",n)}function r(r){return r.preventDefault(),e=r.clientX,A.addClass(t.__closeButton,J.CLASS_DRAG),A.bind(window,"mousemove",i),A.bind(window,"mouseup",n),!1}t.__resize_handle=document.createElement("div"),a.extend(t.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"}),A.bind(t.__resize_handle,"mousedown",r),A.bind(t.__closeButton,"mousedown",r),t.domElement.insertBefore(t.__resize_handle,t.domElement.firstElementChild)}function st(t,e){t.domElement.style.width=e+"px",t.__save_row&&t.autoPlace&&(t.__save_row.style.width=e+"px"),t.__closeButton&&(t.__closeButton.style.width=e+"px")}function ht(t,e){var i={};return a.each(t.__rememberedObjects,(function(n,r){var o={},s=t.__rememberedObjectIndecesToControllers[r];a.each(s,(function(t,i){o[i]=e?t.initialValue:t.getValue()})),i[r]=o})),i}J.toggleHide=function(){q=!q,a.each(K,(function(t){t.domElement.style.display=q?"none":""}))},J.CLASS_AUTO_PLACE="a",J.CLASS_AUTO_PLACE_CONTAINER="ac",J.CLASS_MAIN="main",J.CLASS_CONTROLLER_ROW="cr",J.CLASS_TOO_TALL="taller-than-window",J.CLASS_CLOSED="closed",J.CLASS_CLOSE_BUTTON="close-button",J.CLASS_CLOSE_TOP="close-top",J.CLASS_CLOSE_BOTTOM="close-bottom",J.CLASS_DRAG="drag",J.DEFAULT_WIDTH=245,J.TEXT_CLOSED="Close Controls",J.TEXT_OPEN="Open Controls",J._keydownHandler=function(t){"text"===document.activeElement.type||72!==t.which&&72!==t.keyCode||J.toggleHide()},A.bind(window,"keydown",J._keydownHandler,!1),a.extend(J.prototype,{add:function(t,e){return et(this,t,e,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(t,e){return et(this,t,e,{color:!0})},remove:function(t){this.__ul.removeChild(t.__li),this.__controllers.splice(this.__controllers.indexOf(t),1);var e=this;a.defer((function(){e.onResize()}))},destroy:function(){if(this.parent)throw new Error("Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.");this.autoPlace&&Y.removeChild(this.domElement);var t=this;a.each(this.__folders,(function(e){t.removeFolder(e)})),A.unbind(window,"keydown",J._keydownHandler,!1),Q(this)},addFolder:function(t){if(void 0!==this.__folders[t])throw new Error('You already have a folder in this GUI by the name "'+t+'"');var e={name:t,parent:this};e.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[t]&&(e.closed=this.load.folders[t].closed,e.load=this.load.folders[t]);var i=new J(e);this.__folders[t]=i;var n=Z(this,i.domElement);return A.addClass(n,"folder"),i},removeFolder:function(t){this.__ul.removeChild(t.domElement.parentElement),delete this.__folders[t.name],this.load&&this.load.folders&&this.load.folders[t.name]&&delete this.load.folders[t.name],Q(t);var e=this;a.each(t.__folders,(function(e){t.removeFolder(e)})),a.defer((function(){e.onResize()}))},open:function(){this.closed=!1},close:function(){this.closed=!0},hide:function(){this.domElement.style.display="none"},show:function(){this.domElement.style.display=""},onResize:function(){var t=this.getRoot();if(t.scrollable){var e=A.getOffset(t.__ul).top,i=0;a.each(t.__ul.childNodes,(function(e){t.autoPlace&&e===t.__save_row||(i+=A.getHeight(e))})),window.innerHeight-e-20<i?(A.addClass(t.domElement,J.CLASS_TOO_TALL),t.__ul.style.height=window.innerHeight-e-20+"px"):(A.removeClass(t.domElement,J.CLASS_TOO_TALL),t.__ul.style.height="auto")}t.__resize_handle&&a.defer((function(){t.__resize_handle.style.height=t.__ul.offsetHeight+"px"})),t.__closeButton&&(t.__closeButton.style.width=t.width+"px")},onResizeDebounced:a.debounce((function(){this.onResize()}),50),remember:function(){if(a.isUndefined(W)&&((W=new H).domElement.innerHTML=j),this.parent)throw new Error("You can only call remember on a top level GUI.");var t=this;a.each(Array.prototype.slice.call(arguments),(function(e){0===t.__rememberedObjects.length&&ot(t),-1===t.__rememberedObjects.indexOf(e)&&t.__rememberedObjects.push(e)})),this.autoPlace&&st(this,this.width)},getRoot:function(){for(var t=this;t.parent;)t=t.parent;return t},getSaveObject:function(){var t=this.load;return t.closed=this.closed,this.__rememberedObjects.length>0&&(t.preset=this.preset,t.remembered||(t.remembered={}),t.remembered[this.preset]=ht(this)),t.folders={},a.each(this.__folders,(function(e,i){t.folders[i]=e.getSaveObject()})),t},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=ht(this),$(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(t){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=ht(this,!0)),this.load.remembered[t]=ht(this),this.preset=t,nt(this,t,!0),this.saveToLocalStorageIfPossible()},revert:function(t){a.each(this.__controllers,(function(e){this.getRoot().load.remembered?tt(t||this.getRoot(),e):e.setValue(e.initialValue),e.__onFinishChange&&e.__onFinishChange.call(e,e.getValue())}),this),a.each(this.__folders,(function(t){t.revert(t)})),t||$(this.getRoot(),!1)},listen:function(t){var e=0===this.__listening.length;this.__listening.push(t),e&&function t(e){0!==e.length&&U.call(window,(function(){t(e)}));a.each(e,(function(t){t.updateDisplay()}))}(this.__listening)},updateDisplay:function(){a.each(this.__controllers,(function(t){t.updateDisplay()})),a.each(this.__folders,(function(t){t.updateDisplay()}))}});var ut=J;let lt=null;function ct(t={}){return lt||(lt=new ut(t)),lt}ut.prototype.removeFolder=function(t){const e=this.__folders[t];e&&(e.close(),this.__ul.removeChild(e.domElement.parentNode),delete this.__folders[t],this.onResize())}},function(t,e,i){"use strict";i.d(e,"a",(function(){return Application_Application}));i(9);var n=i(0),r=i(289),o=function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))};function a(t){return o(this,void 0,void 0,(function*(){const{items:e,name:i}=t;for(let t=0;t<e.length;t++)yield e[t][i]()}))}var s=function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))};class Application_Application{constructor(t={}){var e;this._defaultPluginName="default",this.runners=[],this.initRunner=this.addRunner("init"),this.prepareRunner=this.addRunner("prepare"),this.startRunner=this.addRunner("start"),this.updateRunner=this.addRunner("update"),this.config=t,this.verbose=null!==(e=this.config.verbose)&&void 0!==e&&e,this.plugins=new Map,this.pluginDefaults=new Map}add(t,e){const i=(e=e||{}).name,n=null!=i?i:this._defaultPluginName,r=new t(this,e=Object.assign(e,this.config[i]||{})),o=this.plugins.get(t)||{};if(o[n])throw new Error("app plugin "+n+" already exists");return o[n]=r,this.pluginDefaults.get(t)||this.pluginDefaults.set(t,n),this.runners.forEach(t=>{t.add(r)}),this.plugins.set(t,o),r}get(t,e){const i=null!=e?e:this.pluginDefaults.get(t);return this.plugins.get(t)[i]}init(){return s(this,void 0,void 0,(function*(){yield r.a.init(),yield a(this.initRunner),n.Ticker.system.add(this.update,this),yield a(this.prepareRunner),yield a(this.startRunner)}))}update(t){this.updateRunner.emit(t)}addRunner(t){const e=new n.Runner(t);return this.runners.push(e),e}}}]]);