diff --git a/client/dist/css/Live2d.b57e19db.css b/client/dist/css/Live2d.b57e19db.css deleted file mode 100644 index 0985975..0000000 --- a/client/dist/css/Live2d.b57e19db.css +++ /dev/null @@ -1 +0,0 @@ -.l2d_message[data-v-6700412c]{box-sizing:border-box;width:350px;height:auto;margin:auto;padding:7px;bottom:600px;border:2px solid;border-color:rgb(150 134 122);border-radius:5px;background-color:rgb(81 88 101);font-size:24px;overflow:hidden}.l2d_message[data-v-6700412c],.main[data-v-6700412c]{color:#fff;transform:translate(-50%);left:50%;text-align:center;text-transform:uppercase;position:absolute}.main[data-v-6700412c]{bottom:0;font-size:22px;width:400px}.kaiwa[data-v-6700412c]:after,.kaiwa[data-v-6700412c]:before{clear:both;content:"";display:block}.fade-enter-active[data-v-6700412c],.fade-leave-active[data-v-6700412c]{transition:all .5s ease}.fade-enter-from[data-v-6700412c],.fade-leave-to[data-v-6700412c]{opacity:0} \ No newline at end of file diff --git a/client/dist/css/Live2d.f98e97e2.css b/client/dist/css/Live2d.f98e97e2.css new file mode 100644 index 0000000..38cd541 --- /dev/null +++ b/client/dist/css/Live2d.f98e97e2.css @@ -0,0 +1 @@ +.l2d_message[data-v-78eb8350]{box-sizing:border-box;width:350px;height:auto;margin:auto;padding:7px;bottom:600px;border:2px solid;border-color:rgb(150 134 122);border-radius:5px;background-color:rgb(81 88 101);font-size:24px;overflow:hidden}.l2d_message[data-v-78eb8350],.main[data-v-78eb8350]{color:#fff;transform:translate(-50%);left:50%;text-align:center;text-transform:uppercase;position:absolute}.main[data-v-78eb8350]{bottom:0;font-size:22px;width:400px}.kaiwa[data-v-78eb8350]:after,.kaiwa[data-v-78eb8350]:before{clear:both;content:"";display:block}.fade-enter-active[data-v-78eb8350],.fade-leave-active[data-v-78eb8350]{transition:all .5s ease}.fade-enter-from[data-v-78eb8350],.fade-leave-to[data-v-78eb8350]{opacity:0} \ No newline at end of file diff --git a/client/dist/index.html b/client/dist/index.html index 1efb8d0..a52e46b 100644 --- a/client/dist/index.html +++ b/client/dist/index.html @@ -1 +1 @@ -直播语音转换
\ No newline at end of file +直播语音转换
\ No newline at end of file diff --git a/client/dist/js/Live2d.04fa9e3d.js.map b/client/dist/js/Live2d.04fa9e3d.js.map deleted file mode 100644 index 8b0c10b..0000000 --- a/client/dist/js/Live2d.04fa9e3d.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_getSymbols.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_shortOut.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_coreJsData.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_hashClear.js","webpack:///./node_modules/pixi-live2d-display/lib/index.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_hashGet.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_arrayFilter.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_SetCache.js","webpack:///./node_modules/url/url.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_apply.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_stackSet.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_createBaseFor.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_mapCacheSet.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_basePullAll.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_hashSet.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_Uint8Array.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_basePropertyDeep.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_arraySome.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/pullAll.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_copyArray.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseMatchesProperty.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseIsArguments.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_Symbol.js","webpack:///./node_modules/node-libs-browser/node_modules/punycode/punycode.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_nativeKeys.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_memoizeCapped.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_hashHas.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseSetToString.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/pull.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_getMatchData.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_isStrictComparable.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_cacheHas.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseIsNaN.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseRest.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseIsEqualDeep.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/isArray.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_root.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_toKey.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_setCacheAdd.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_mapCacheClear.js","webpack:///./node_modules/object-assign/index.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseTimes.js","webpack:///./src/views/Live2d.vue?a06f","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseIsEqual.js","webpack:///./node_modules/url/util.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_equalByTag.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/identity.js","webpack:///./node_modules/es6-promise-polyfill/promise.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_arrayPush.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_stackClear.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/toString.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/stubFalse.js","webpack:///./node_modules/@pixi/constants/lib/constants.es.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_matchesStrictComparable.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseGetTag.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/eq.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseHasIn.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_isKey.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_isIndex.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_Promise.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseKeys.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseIndexOf.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_WeakMap.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_arrayLikeKeys.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/stubArray.js","webpack:///./node_modules/earcut/src/earcut.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/hasIn.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseIteratee.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_Map.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_getAllKeys.js","webpack:///./node_modules/@pixi/runner/lib/runner.es.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_equalObjects.js","webpack:///(webpack)/buildin/module.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_mapCacheHas.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_setCacheHas.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_DataView.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_equalArrays.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_MapCache.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseFor.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/mapKeys.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_listCacheHas.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_getValue.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/keys.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/isSymbol.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/isFunction.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_isMasked.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/isLength.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_Set.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/get.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/memoize.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseFindIndex.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_stackHas.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/isArguments.js","webpack:///./node_modules/querystring-es3/decode.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseProperty.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseToString.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_toSource.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/isTypedArray.js","webpack:///./node_modules/@pixi/display/lib/display.es.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_stringToPath.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_Stack.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_setToArray.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_stackDelete.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseIsTypedArray.js","webpack:///./node_modules/@pixi/utils/lib/utils.es.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseIsMatch.js","webpack:///./node_modules/ismobilejs/esm/isMobile.js","webpack:///./node_modules/@pixi/settings/lib/settings.es.js","webpack:///./node_modules/querystring-es3/index.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_assocIndexOf.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_mapCacheGet.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_freeGlobal.js","webpack:///./node_modules/parse-uri/index.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_stackGet.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/isObject.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_castPath.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_nodeUtil.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_listCacheClear.js","webpack:///./node_modules/@pixi/core/lib/core.es.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseGet.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_getTag.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseIsNative.js","webpack:///./src/views/Live2d.vue","webpack:///./node_modules/@pixi/polyfill/lib/polyfill.es.js","webpack:///./node_modules/@pixi/accessibility/lib/accessibility.es.js","webpack:///./node_modules/@pixi/interaction/lib/interaction.es.js","webpack:///./node_modules/@pixi/app/lib/app.es.js","webpack:///./node_modules/@pixi/extract/lib/extract.es.js","webpack:///./node_modules/resource-loader/dist/resource-loader.esm.js","webpack:///./node_modules/@pixi/loaders/lib/loaders.es.js","webpack:///./node_modules/@pixi/particles/lib/particles.es.js","webpack:///./node_modules/@pixi/graphics/lib/graphics.es.js","webpack:///./node_modules/@pixi/sprite/lib/sprite.es.js","webpack:///./node_modules/@pixi/text/lib/text.es.js","webpack:///./node_modules/@pixi/prepare/lib/prepare.es.js","webpack:///./node_modules/@pixi/spritesheet/lib/spritesheet.es.js","webpack:///./node_modules/@pixi/sprite-tiling/lib/sprite-tiling.es.js","webpack:///./node_modules/@pixi/mesh/lib/mesh.es.js","webpack:///./node_modules/@pixi/text-bitmap/lib/text-bitmap.es.js","webpack:///./node_modules/@pixi/filter-alpha/lib/filter-alpha.es.js","webpack:///./node_modules/@pixi/filter-blur/lib/filter-blur.es.js","webpack:///./node_modules/@pixi/filter-color-matrix/lib/filter-color-matrix.es.js","webpack:///./node_modules/@pixi/filter-displacement/lib/filter-displacement.es.js","webpack:///./node_modules/@pixi/filter-fxaa/lib/filter-fxaa.es.js","webpack:///./node_modules/@pixi/filter-noise/lib/filter-noise.es.js","webpack:///./node_modules/@pixi/mixin-cache-as-bitmap/lib/mixin-cache-as-bitmap.es.js","webpack:///./node_modules/@pixi/mixin-get-child-by-name/lib/mixin-get-child-by-name.es.js","webpack:///./node_modules/@pixi/mixin-get-global-position/lib/mixin-get-global-position.es.js","webpack:///./node_modules/@pixi/mesh-extras/lib/mesh-extras.es.js","webpack:///./node_modules/@pixi/sprite-animated/lib/sprite-animated.es.js","webpack:///./node_modules/pixi.js/lib/pixi.es.js","webpack:///./src/views/Live2d.vue?4aed","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/constant.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/isArrayLike.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_listCacheDelete.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_listCacheSet.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseForOwn.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_arrayMap.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_nativeCreate.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseUnary.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_isPrototype.js","webpack:///./node_modules/@pixi/math/lib/math.es.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseAssignValue.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_defineProperty.js","webpack:///./node_modules/mini-signals/lib/mini-signals.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_hashDelete.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_getNative.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/property.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseIndexOfWith.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_setToString.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseMatches.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_overRest.js","webpack:///./node_modules/querystring-es3/encode.js","webpack:///./node_modules/@pixi/ticker/lib/ticker.es.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_mapCacheDelete.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/isBuffer.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_baseGetAllKeys.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/isObjectLike.js","webpack:///./node_modules/@pixi/utils/node_modules/eventemitter3/index.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_isKeyable.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_overArg.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_getMapData.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_getRawTag.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_mapToArray.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_listCacheGet.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_Hash.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_ListCache.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_objectToString.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_hasPath.js","webpack:///./node_modules/pixi-live2d-display/node_modules/lodash/_strictIndexOf.js"],"names":["arrayFilter","stubArray","objectProto","Object","prototype","propertyIsEnumerable","nativeGetSymbols","getOwnPropertySymbols","getSymbols","object","symbol","call","module","exports","HOT_COUNT","HOT_SPAN","nativeNow","Date","now","shortOut","func","count","lastCalled","stamp","remaining","arguments","apply","undefined","root","coreJsData","nativeCreate","hashClear","this","__data__","size","factory","window","__WEBPACK_EXTERNAL_MODULE__2__","__WEBPACK_EXTERNAL_MODULE__5__","__WEBPACK_EXTERNAL_MODULE__17__","__WEBPACK_EXTERNAL_MODULE__19__","__WEBPACK_EXTERNAL_MODULE__20__","__WEBPACK_EXTERNAL_MODULE__24__","modules","installedModules","__webpack_require__","moduleId","i","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","property","hasOwnProperty","p","s","__webpack_exports__","log_logger","clamp","rand","copyProperty","copyArray","applyMixins","folderName","config","num","lower","upper","min","max","Math","random","type","from","to","fromKey","toKey","array","Array","isArray","filter","item","derivedCtor","baseCtors","forEach","baseCtor","getOwnPropertyNames","getOwnPropertyDescriptor","url","lastSlashIndex","lastIndexOf","slice","logger","log","tag","messages","logLevel","LOG_LEVEL_VERBOSE","console","warn","LOG_LEVEL_WARNING","error","LOG_LEVEL_ERROR","VERSION","LOG_LEVEL_NONE","sound","motionSync","motionFadingDuration","idleMotionFadingDuration","expressionFadingDuration","Live2DLoader","_factory_XHRLoader__WEBPACK_IMPORTED_MODULE_0__","_utils_middleware__WEBPACK_IMPORTED_MODULE_1__","context","middlewares","then","result","loader","Live2DFactory_Live2DFactory","cubism_common","utils","middleware","core_root_PIXI_","createTexture","options","_a","textureOptions","resourceOptions","crossorigin","crossOrigin","fromURL","catch","e","Error","err","event","autoLoad","texture","baseTexture","valid","Promise","resolve","resource","_live2d_load","reject","errorHandler","source","removeEventListener","addEventListener","load","__awaiter","thisArg","_arguments","P","generator","adopt","fulfilled","step","next","rejected","done","TAG","urlToJSON","data","target","live2dModel","emit","jsonToSettings","settings","runtime","findRuntime","createModelSettings","TypeError","waitUntilReady","ready","setupOptionals","internalModel","tasks","pose","push","createPose","coreModel","physics","createPhysics","length","all","setupEssentials","live2DModel","textureLoadings","textures","map","tex","resolveURL","createInternalModel","modelData","moc","isValidMoc","createCoreModel","Live2DFactory_awaiter","runtimes","sort","a","b","version","test","textureLoaded","once","modelLoaded","readyEventEmitted","live2DModelMiddlewares","motionManager","group","index","_b","handleError","definition","definitions","listeners","includes","releaseTasks","motionTasksMap","set","taskGroup","path","getMotionFile","motionDataType","motion","createMotion","expressionManager","expressionTasksMap","getExpressionFile","expression","createExpression","delete","WeakMap","_loadMotion","loadMotion","_loadExpression","loadExpression","_constants__WEBPACK_IMPORTED_MODULE_0__","_ExpressionManager__WEBPACK_IMPORTED_MODULE_1__","_FocusController__WEBPACK_IMPORTED_MODULE_2__","_ModelSettings__WEBPACK_IMPORTED_MODULE_3__","_MotionState__WEBPACK_IMPORTED_MODULE_4__","_MotionManager__WEBPACK_IMPORTED_MODULE_5__","_SoundManager__WEBPACK_IMPORTED_MODULE_6__","_InternalModel__WEBPACK_IMPORTED_MODULE_7__","SoundManager","_utils__WEBPACK_IMPORTED_MODULE_0__","lodash_pull__WEBPACK_IMPORTED_MODULE_1__","lodash_pull__WEBPACK_IMPORTED_MODULE_1___default","VOLUME","_volume","audios","audio","volume","file","onFinish","onError","Audio","preload","dispose","play","dispatchEvent","ErrorEvent","readyState","HAVE_ENOUGH_DATA","pause","removeAttribute","LOGICAL_WIDTH","LOGICAL_HEIGHT","MotionPriority","MotionState","debug","currentPriority","NONE","reservePriority","priority","currentGroup","currentIndex","dump","reservedGroup","reservedIndex","reservedIdleGroup","reservedIdleIndex","IDLE","setReservedIdle","FORCE","setReserved","setCurrent","requestedGroup","requestedIndex","keys","join","ExpressionManager","_pixi_utils__WEBPACK_IMPORTED_MODULE_1__","super","expressions","reserveExpressionIndex","destroyed","defaultExpression","currentExpression","stopAllExpressions","availableIndices","floor","setExpression","_setExpression","getExpressionIndex","indexOf","model","isFinished","updateParameters","self","ModelSettings","json","replacer","files","replaceFiles","assertFileExists","expectedFile","shouldThrow","actualPath","essentialFiles","definedFiles","getDefinedFiles","MotionPreloadStrategy","MotionManager","_config__WEBPACK_IMPORTED_MODULE_0__","_cubism_common_MotionState__WEBPACK_IMPORTED_MODULE_1__","_cubism_common_SoundManager__WEBPACK_IMPORTED_MODULE_2__","_utils__WEBPACK_IMPORTED_MODULE_3__","_pixi_utils__WEBPACK_IMPORTED_MODULE_4__","motionGroups","state","playing","idleMotionGroup","groups","idle","setupMotions","stopAllMotions","motionPreload","ALL","NORMAL","reserve","currentAudio","soundURL","getSoundFile","add","readyToPlay","src","start","getMotionName","shouldOverrideExpression","resetExpression","_startMotion","groupDefs","isActive","startMotion","_stopAllMotions","reset","restoreExpression","complete","shouldRequestIdleMotion","startRandomMotion","updated","update","destroy","InternalModel","_cubism_common_constants__WEBPACK_IMPORTED_MODULE_0__","_cubism_common_FocusController__WEBPACK_IMPORTED_MODULE_1__","_pixi_math__WEBPACK_IMPORTED_MODULE_2__","_pixi_utils__WEBPACK_IMPORTED_MODULE_3__","tempBounds","x","y","width","height","focusController","originalWidth","originalHeight","localTransform","drawingMatrix","hitAreas","textureFlipY","viewport","setupLayout","setupHitAreas","getSize","layout","assign","getLayout","scale","offsetX","centerX","left","right","offsetY","centerY","top","bottom","translate","getHitAreaDefs","hitArea","def","hitAreaName","isHit","drawIndex","bounds","getDrawableBounds","vertices","getDrawableVertices","vx","vy","transform","copyFrom","append","dt","FocusController","EPSILON","MAX_SPEED","ACCELERATION_TIME","targetX","targetY","instant","dx","dy","abs","sqrt","pow","maxSpeed","ax","ay","maxA","v","maxV","XHRLoader","NetworkError","message","status","aborted","onload","onerror","xhr","XMLHttpRequest","allXhrSet","xhrSet","xhrMap","Set","cancelXHRs","open","responseType","response","onabort","onloadend","abort","clear","createXHR","send","runMiddlewares","dispatch","fn","Live2DModel_Live2DModel","Live2DTransform_Live2DTransform","InteractionMixin","Live2DFactory","FileLoader_FileLoader","ZipLoader_ZipLoader","display_root_PIXI_","math_root_PIXI_","_autoInteract","autoInteract","on","onTap","off","manager","interactionManager","unregisterInteraction","onPointerMove","tap","global","focus","tempPoint","tempMatrix","TickerClass","PIXI","Ticker","anchor","onAnchorChange","glContextID","elapsedTime","performance","deltaTime","_autoUpdate","init","setupLive2DModel","onLoad","tickerClass","autoUpdate","_destroyed","shared","onTickerUpdate","remove","_options","interactive","pivot","id","setRandomExpression","toModelPosition","hitAreaNames","hitTest","position","clone","skipUpdate","_recursivePostUpdateTransform","parent","displayObjectUpdateTransform","_tempDisplayObjectParent","worldTransform","applyInverse","point","getBounds","contains","_bounds","addFrame","deltaMS","renderer","registerInteraction","plugins","interaction","batch","geometry","shader","shouldUpdateTexture","CONTEXT_UID","updateWebGLContext","gl","_glTextures","pixelStorei","WebGLRenderingContext","UNPACK_FLIP_Y_WEBGL","bindTexture","touched","textureGC","framebuffer","internalTransform","globalUniforms","uniforms","projectionMatrix","updateTransform","draw","utils_root_PIXI_utils_","settingsURL","filePath","resolved","filesMap","fileMap","definedFile","decodeURI","actualFile","find","webkitRelativePath","URL","createObjectURL","_objectURL","settingsFile","endsWith","settingsText","readText","settingsJSON","JSON","parse","reader","FileReader","readAsText","File","createSettings","validateFiles","encodeURI","upload","objectURL","revokeObjectURL","resourceObjectURL","values","unshift","ZipLoader_awaiter","filePaths","getFilePaths","requiredFilePaths","getFiles","settingsFilePath","paths","ZIP_PROTOCOL","uid","sourceURL","zipBlob","startsWith","zipReader","unzip","releaseReader","originalUpdateParam","Live2DMotion","updateParam","entry","onFinishHandler","Cubism4ExpressionManager_Cubism4ExpressionManager","Cubism4ModelSettings_Cubism4ModelSettings","Cubism4MotionManager_Cubism4MotionManager","Cubism4InternalModel_Cubism4InternalModel","cubism4Ready","startUpCubism4","CubismBlendMode","CubismVector2","vector2","ret","scalar","multiply","division","rhs","isEqual","cubismmath_CubismMath","sin","cos","PI","degrees","radian","q1","atan2","q2","directionToRadian","degree","radianToDegrees","totalAngle","CubismMatrix44","_tr","Float32Array","loadIdentity","dst","j","k","setMatrix","tr","tr1","getArray","cloneMatrix","cubismrenderer_CubismRenderer","_isCulling","_isPremultipliedAlpha","_anisortopy","_modelColor","CubismTextureColor","_mvpMatrix4x4","_model","getModel","doDrawModel","matrix44","red","green","blue","alpha","R","G","B","A","enable","culling","s_isStarted","s_isInitialized","s_option","Constant","LogLevel","vertexOffset","vertexStep","live2dcubismframework_CubismFramework","option","CubismLogInfo","Live2DCubismCore","_isStarted","Logging","csmSetLogFunction","logFunction","Version","csmGetVersion","major","minor","patch","versionNumber","CubismLogWarning","staticRelease","csmGetLogFunction","loggingLevel","LogLevel_Off","CSM_ASSERT","CubismLogDebug","fmt","args","cubismdebug_CubismDebug","print","LogLevel_Debug","LogLevel_Info","LogLevel_Warning","CubismLogError","LogLevel_Error","format","getLoggingLevel","logPrint","coreLogFunction","buffer","replace","acubismmotion_ACubismMotion","_fadeInSeconds","_fadeOutSeconds","_weight","_offsetSeconds","_firedEventValues","motionQueueEntry","userTimeSeconds","isAvailable","isStarted","setIsStarted","setStartTime","setFadeInStartTime","duration","getDuration","getEndTime","setEndTime","getStartTime","fadeWeight","fadeIn","getEasingSine","getFadeInStartTime","fadeOut","setState","doUpdateParameters","setIsFinished","fadeInSeconds","fadeOutSeconds","weight","offsetSeconds","beforeCheckTimeSeconds","motionTimeSeconds","onFinishedMotionHandler","_onFinishedMotion","DefaultFadeTime","cubismexpressionmotion_CubismExpressionMotion","_parameters","fadeInTime","FadeInTime","fadeOutTime","FadeOutTime","setFadeInTime","setFadeOutTime","parameters","Parameters","param","parameterId","Id","Value","blendType","Blend","ExpressionBlendType","ExpressionBlendType_Multiply","ExpressionBlendType_Overwrite","ExpressionBlendType_Add","parameter","addParameterValueById","multiplyParameterValueById","setParameterValueById","CubismMotionQueueEntry","_autoDelete","_available","_finished","_started","_startTimeSeconds","_fadeInStartTimeSeconds","_endTimeSeconds","_stateTimeSeconds","_stateWeight","_lastEventCheckSeconds","_motionQueueEntryHandle","_isTriggeredFadeOut","_motion","release","newEndTimeSeconds","startTime","endTime","f","timeSeconds","checkSeconds","cubismmotionqueuemanager_CubismMotionQueueManager","_userTimeSeconds","_eventCustomData","_motions","autoDelete","InvalidMotionQueueEntryHandleValue","setFadeOut","getFadeOutTime","splice","motionQueueEntryNumber","callback","customData","_eventCallBack","firedList","getFiredEvent","getLastCheckEventSeconds","setLastCheckEventSeconds","isTriggeredFadeOut","startFadeOut","getFadeOutSeconds","queueManager","findIndex","Name","doUpdateMotion","CubismModelSettingsJson","Groups","HitAreas","Layout","FileReferences","Moc","Expressions","motions","Motions","Textures","Physics","Pose","Ids","isValidJSON","every","entries","Sound","CubismMotionCurveTarget","CubismMotionSegmentType","CubismMotionPoint","time","CubismMotionSegment","basePointIndex","segmentType","CubismMotionCurve","CubismMotionCurveTarget_Model","segmentCount","baseSegmentIndex","CubismMotionEvent","fireTime","CubismMotionData","loop","curveCount","eventCount","fps","curves","segments","points","events","CubismMotionJson","_json","Meta","Duration","Loop","CurveCount","Fps","TotalSegmentCount","TotalPointCount","curveIndex","Curves","Target","Segments","segmentIndex","UserDataCount","TotalUserDataSize","userDataIndex","UserData","Time","EffectNameEyeBlink","EffectNameLipSync","TargetNameModel","TargetNameParameter","TargetNamePartOpacity","lerpPoints","linearEvaluate","bezierEvaluate","p01","p12","p23","p012","p123","steppedEvaluate","inverseSteppedEvaluate","evaluateCurve","motionData","curve","totalSegmentCount","pointPosition","CubismMotionSegmentType_Bezier","segment","evaluate","cubismmotion_CubismMotion","_eyeBlinkParameterIds","_lipSyncParameterIds","_sourceFrameRate","_loopDurationSeconds","_isLoop","_isLoopFadeIn","_lastWeight","_motionData","_modelCurveIdEyeBlink","_modelCurveIdLipSync","timeOffsetSeconds","lipSyncValue","Number","MAX_VALUE","eyeBlinkValue","MaxTargetSize","lipSyncFlags","eyeBlinkFlags","tmpFadeIn","tmpFadeOut","parameterIndex","CubismMotionCurveTarget_Parameter","getParameterIndex","sourceValue","getParameterValueByIndex","fin","fout","paramWeight","setParameterValueByIndex","getParameterValueById","CubismMotionCurveTarget_PartOpacity","loopFadeIn","eyeBlinkParameterIds","lipSyncParameterIds","motionJson","getMotionDuration","isMotionLoop","getMotionCurveCount","getMotionFps","getEventCount","getMotionFadeInTime","getMotionFadeOutTime","getMotionTotalSegmentCount","totalPointCount","getMotionCurveTarget","getMotionCurveId","getMotionCurveFadeInTime","getMotionCurveFadeOutTime","segmentPosition","getMotionCurveSegmentCount","getMotionCurveSegment","CubismMotionSegmentType_Linear","CubismMotionSegmentType_Stepped","CubismMotionSegmentType_InverseStepped","userdatacount","getEventTime","getEventValue","u","eyeBlinkIds","getEyeBlinkParameters","lipSyncIds","getLipSyncParameters","setEventCallback","caller","eventValue","setFinishedMotionHandler","defaultFadingDuration","setEffectIds","ParamAngleX","ParamAngleY","ParamAngleZ","ParamEyeBallX","ParamEyeBallY","ParamBodyAngleX","ParamBreath","CubismBreath","_breathParameters","_currentTime","breathParameters","deltaTimeSeconds","offset","peak","cycle","BreathParameterData","CubismEyeBlink","modelSetting","_blinkingState","EyeState","EyeState_First","_nextBlinkingTime","_stateStartTimeSeconds","_blinkingIntervalSeconds","_closingSeconds","_closedSeconds","_openingSeconds","_parameterIds","blinkingInterval","closing","closed","opening","parameterIds","parameterValue","EyeState_Closing","EyeState_Closed","EyeState_Opening","EyeState_Interval","determinNextBlinkingTiming","CloseIfZero","config_config","csmRect","w","h","supportMoreMaskDivisions","ColorChannelCount","shaderCount","s_instance","s_viewport","s_fbo","cubismrenderer_webgl_CubismClippingManager_WebGL","_maskRenderTexture","_colorBuffer","_currentFrameNo","_clippingMaskBufferSize","_clippingContextListForMask","_clippingContextListForDraw","_channelColors","_tmpBoundsOnModel","_tmpMatrix","_tmpMatrixForMask","_tmpMatrixForDraw","tmp","channelNo","_maskTexture","frameNo","TEXTURE_2D","texImage2D","RGBA","UNSIGNED_BYTE","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MIN_FILTER","LINEAR","TEXTURE_MAG_FILTER","createFramebuffer","bindFramebuffer","FRAMEBUFFER","framebufferTexture2D","COLOR_ATTACHMENT0","CubismRenderTextureResource","clippingContext","clippedDrawTotalMinX","clippedDrawTotalMinY","clippedDrawTotalMaxX","MIN_VALUE","clippedDrawTotalMaxY","clippedDrawCount","_clippedDrawableIndexList","clippedDrawableIndex","drawableIndex","drawableVertexCount","getDrawableVertexCount","drawableVertexes","minX","minY","maxX","maxY","pi","_allClippedDrawRect","_isUsing","_c","deleteFramebuffer","deleteTexture","drawableCount","drawableMasks","drawableMaskCounts","findSameClip","cubismrenderer_webgl_CubismClippingContext","addClippedDrawable","usingClipCount","clipIndex","cc","calcClippedDrawTotalBounds","getMaskRenderTexture","getMvpMatrix","preDraw","setupLayoutBounds","clearColor","COLOR_BUFFER_BIT","clipContext","allClipedDrawRect","layoutBoundsOnTex01","_layoutBounds","MARGIN","setRect","expand","scaleX","scaleY","translateRelative","scaleRelative","_matrixForMask","_matrixForDraw","clipDrawCount","_clippingIdCount","clipDrawIndex","_clippingIdList","getDrawableDynamicFlagVertexPositionsDidChange","setIsCulling","getDrawableCulling","setClippingContextBufferForMask","drawMesh","getDrawableTextureIndices","getDrawableVertexIndexCount","getDrawableVertexIndices","getDrawableVertexUvs","getDrawableOpacity","CubismBlendMode_Normal","sameCount","clipId","div","mod","curClipIndex","layoutCount","_layoutChannelNo","xpos","ypos","clippingDrawableIndices","clipCount","_owner","setGL","cubismrenderer_webgl_CubismShader_WebGL","_shaderSets","releaseShaderProgram","textureId","vertexCount","vertexArray","indexArray","uvArray","bufferData","opacity","colorBlendMode","baseColor","isPremultipliedAlpha","matrix4x4","invertedMask","SRC_COLOR","DST_COLOR","SRC_ALPHA","DST_ALPHA","generateShaders","clippingContextBufferForMask","getClippingContextBufferForMask","shaderSet","ShaderNames","ShaderNames_SetupMask","useProgram","shaderProgram","activeTexture","TEXTURE0","uniform1i","samplerTexture0Location","vertex","createBuffer","bindBuffer","ARRAY_BUFFER","DYNAMIC_DRAW","enableVertexAttribArray","attributePositionLocation","vertexAttribPointer","FLOAT","uv","attributeTexCoordLocation","colorChannel","getClippingManager","getChannelFlagAsColor","uniform4f","uniformChannelFlagLocation","uniformMatrix4fv","uniformClipMatrixLocation","rect","uniformBaseColorLocation","getRight","getBottom","ZERO","ONE_MINUS_SRC_COLOR","ONE_MINUS_SRC_ALPHA","clippingContextBufferForDraw","getClippingContextBufferForDraw","masked","ShaderNames_NormalPremultipliedAlpha","ONE","CubismBlendMode_Additive","ShaderNames_AddPremultipliedAlpha","CubismBlendMode_Multiplicative","ShaderNames_MultPremultipliedAlpha","TEXTURE1","getColorBuffer","samplerTexture1Location","uniformMatrixLocation","ELEMENT_ARRAY_BUFFER","blendFuncSeparate","deleteProgram","loadShaderProgram","vertexShaderSrcSetupMask","fragmentShaderSrcsetupMask","vertexShaderSrc","fragmentShaderSrcPremultipliedAlpha","vertexShaderSrcMasked","fragmentShaderSrcMaskPremultipliedAlpha","fragmentShaderSrcMaskInvertedPremultipliedAlpha","getAttribLocation","getUniformLocation","vertexShaderSource","fragmentShaderSource","createProgram","vertShader","compileShaderSource","VERTEX_SHADER","fragShader","FRAGMENT_SHADER","attachShader","linkProgram","linkStatus","getProgramParameter","LINK_STATUS","deleteShader","shaderType","shaderSource","createShader","compileShader","getShaderInfoLog","getShaderParameter","COMPILE_STATUS","cubismrenderer_webgl_CubismRenderer_WebGL","_clippingContextBufferForMask","_clippingContextBufferForDraw","_clippingManager","firstDraw","_textures","_sortedDrawableIndexList","_bufferData","isUsingMasking","initialize","getDrawableCount","getDrawableMasks","getDrawableMaskCounts","modelTextureNo","glTexture","setClippingMaskBufferSize","getClippingMaskBufferSize","deleteBuffer","setupClippingContext","renderOrder","getDrawableRenderOrders","order","getDrawableDynamicFlagIsVisible","setClippingContextBufferForDraw","getClippingContextListForDraw","getDrawableBlendMode","getDrawableInvertedMaskBit","textureNo","indexCount","isCulling","CULL_FACE","disable","frontFace","CCW","modelColorRGBA","getModelColor","drawtexture","getInstance","setupShaderProgram","drawElements","TRIANGLES","UNSIGNED_SHORT","deleteInstance","fbo","getExtension","SCISSOR_TEST","STENCIL_TEST","DEPTH_TEST","CW","BLEND","colorMask","clip","setGl","doStaticRelease","mapKeys_","mapKeys_default","lipSync","breath","idParamAngleX","idParamAngleY","idParamAngleZ","idParamEyeBallX","idParamEyeBallY","idParamBodyAngleX","idParamBreath","pixelsPerUnit","centeringTransform","eyeBlink","setParameters","setIsPremultipliedAlpha","canvasinfo","CanvasWidth","CanvasHeight","_","charAt","toLowerCase","PixelsPerUnit","startUp","getDrawableIndex","getDrawableIds","arr","prepend","motionUpdated","saveParameters","updateFocus","updateNaturalMovements","loadParameters","matrix","tx","ty","setMvpMatrix","setRenderState","getParameter","FRAMEBUFFER_BINDING","drawModel","startupPromise","startupRetries","startUpWithRetry","cause","setTimeout","LogLevel_Verbose","Epsilon","DefaultFadeInSeconds","CubismPose","_fadeTimeSeconds","_lastModel","_partGroups","_partGroupCounts","pose3json","poseListInfo","poseCount","poseIndex","idListInfo","idCount","groupCount","groupIndex","partInfo","partData","PartData","partId","linkListInfo","Link","linkCount","linkIndex","linkPart","link","beginIndex","partGroupCount","doFade","copyPartOpacities","partsIndex","partIndex","paramIndex","setPartOpacityByIndex","getPartOpacityByIndex","linkPartIndex","visiblePartIndex","newOpacity","phi","backOpacityThreshold","a1","backOpacity","assignment","getPartIndex","clonePartData","cubismmodel_CubismModel","_savedParameters","_drawableIds","_partIds","_notExistPartId","_notExistParameterId","_notExistParameterValues","_notExistPartOpacities","drawables","resetDynamicFlags","parameterCount","savedParameterCount","_parameterValues","partCount","parts","getPartCount","_partOpacities","maximumValues","minimumValues","defaultValues","getParameterCount","addParameterValueByIndex","multiplyParameterValueByIndex","drawableId","ids","renderOrders","textureIndices","dynamicFlags","Utils","hasVertexPositionsDidChangeBit","indexCounts","vertexCounts","getDrawableVertexPositions","indices","vertexPositions","vertexUvs","opacities","constantFlags","hasIsDoubleSidedBit","hasBlendAdditiveBit","hasBlendMultiplicativeBit","hasIsInvertedMaskBit","masks","maskCounts","hasIsVisibleBit","hasVisibilityDidChangeBit","hasOpacityDidChangeBit","hasRenderOrderDidChangeBit","_parameterMaximumValues","_parameterMinimumValues","partIds","drawableIds","cubismmoc_CubismMoc","_moc","_modelCount","mocBytes","fromArrayBuffer","cubismModel","Model","fromMoc","_release","CubismPhysicsTargetType","CubismPhysicsSource","cubismphysicsinternal_CubismPhysicsParticle","initialPosition","lastPosition","lastGravity","force","velocity","CubismPhysicsSubRig","normalizationPosition","normalizationAngle","CubismPhysicsInput","cubismphysicsinternal_CubismPhysicsOutput","destination","translationScale","cubismphysicsinternal_CubismPhysicsRig","inputs","outputs","particles","gravity","wind","cubismphysicsjson_CubismPhysicsJson","EffectiveForces","Gravity","X","Y","Wind","PhysicsSettingCount","TotalInputCount","TotalOutputCount","VertexCount","physicsSettingIndex","PhysicsSettings","Normalization","Position","Minimum","Maximum","Default","Angle","Input","inputIndex","Weight","Reflect","Type","Source","Output","outputIndex","VertexIndex","Scale","Destination","Vertices","vertexIndex","Mobility","Delay","Acceleration","Radius","PhysicsTypeTagX","PhysicsTypeTagY","PhysicsTypeTagAngle","AirResistance","MaximumWeight","MovementThreshold","cubismphysics_CubismPhysics","cubismphysics_Options","_physicsRig","radAngle","outputValue","totalTranslation","currentSetting","currentInput","currentOutput","currentParticles","parameterMaximumValue","parameterMinimumValue","parameterDefaultValue","settingIndex","subRigCount","angle","baseInputIndex","baseOutputIndex","baseParticleIndex","inputCount","sourceParameterIndex","getNormalizedParameterValue","reflect","degreesToRadian","updateParticles","particleCount","maximum","outputCount","particleIndex","destinationParameterIndex","translation","getValue","outParameterValue","stringify","subarray","updateOutputParameterValue","outParamIndex","physicsJson","getGravity","getWind","getSubRigCount","setting","minimum","getNormalizationPositionMinimumValue","getNormalizationPositionMaximumValue","defalut","getNormalizationPositionDefaultValue","getNormalizationAngleMinimumValue","getNormalizationAngleMaximumValue","getNormalizationAngleDefaultValue","getInputCount","input","getInputWeight","getInputReflect","getInputType","CubismPhysicsSource_X","getInputTranslationXFromNormalizedParameterValue","CubismPhysicsSource_Y","getInputTranslationYFromNormalizedParamterValue","CubismPhysicsSource_Angle","getInputAngleFromNormalizedParameterValue","targetType","CubismPhysicsTargetType_Parameter","getInputSourceId","getOutputCount","output","getOutputVertexIndex","angleScale","getOutputAngleScale","getOutputWeight","getOutputDestinationId","getOutputType","getOutputTranslationX","getScale","getOutputScaleTranslationX","getOutputTranslationY","getOutputScaleTranslationY","getOutputAngle","getOutputScaleAngle","getOutputReflect","getParticleCount","particle","mobility","getParticleMobility","delay","getParticleDelay","acceleration","getParticleAcceleration","radius","getParticleRadius","getParticlePosition","strand","targetTranslation","targetAngle","isInverted","normalizeParameterValue","normalizaitionPosition","parentGravity","substract","multiplyByScaler","getRangeValue","getDefaultValue","minValue","strandCount","windDirection","thresholdValue","airResistance","totalRadian","currentGravity","direction","newDirection","radianToDirection","normalize","divisionByScalar","parameterValueMinimum","parameterValueMaximum","outputScale","valueBelowMinimum","valueExceededMaximum","parameterMinimum","parameterMaximum","parameterDefault","normalizedMinimum","normalizedMaximum","normalizedDefault","maxValue","minNormValue","maxNormValue","middleNormValue","middleValue","paramValue","sign","nLength","pLength","releaseMoc","__moc","cubism4","registerRuntime","byteLength","view","Int8Array","String","fromCharCode","createModel","ignored","coreModelWithMoc","Cubism2ExpressionManager_Cubism2ExpressionManager","Cubism2InternalModel_Cubism2InternalModel","Cubism2ModelSettings_Cubism2ModelSettings","Cubism2MotionManager_Cubism2MotionManager","Live2DExpression_Live2DExpression","Live2DEyeBlink_Live2DEyeBlink","Live2DPhysics","Live2DPose_Live2DPose","AMotion","params","setFadeIn","fade_in","fade_out","calc","defaultValue","val","motionQueueEnt","setParamFloat","MotionQueueManager","blinkInterval","closingDuration","closedDuration","openingDuration","eyeState","Idle","eyeParamValue","closedTimer","nextBlinkTimeLeft","leftParam","getParamIndex","rightParam","Closing","setEyeParams","Closed","Opening","tempMatrixArray","drawDataCount","disableCulling","eyeballXParamIndex","eyeballYParamIndex","angleXParamIndex","angleYParamIndex","angleZParamIndex","bodyAngleXParamIndex","breathParamIndex","initParams","initOpacities","setPartsOpacity","saveParam","getModelContext","_$aS","drawParamWebGL","clipManager","originalSetupClip","setupClip","modelContext","drawParam","getCanvasWidth","getCanvasHeight","center_x","center_y","glno","prop","WebGLBuffer","curFrameNo","setTexture","getDrawDataIndex","drawData","getDrawData","getDrawDataID","getTransformedPoints","loadParam","addToParamFloat","copy","SRC_TYPE_MAP","PhysicsHair","Src","SRC_TO_X","SRC_TO_Y","SRC_TO_G_ANGLE","TARGET_TYPE_MAP","physicsHairs","physics_hair","physicsHair","setup","regist","mass","ptype","addSrcParam","targets","addTargetParam","elapsed","Live2DPartsParam","getPartsDataIndex","PartsDataID","getID","opacityAnimDuration","partsGroups","parts_visible","initIndex","visible","getParamFloat","partsGroup","maxBackOpacity","visibleOpacity","visibleIndex","originalOpacity","getPartsOpacity","backOp","partGroup","normalizePartsOpacityGroup","copyOpacity","Live2DModelWebGL","loadModel","Live2D","getError","_common__WEBPACK_IMPORTED_MODULE_0__","_cubism2__WEBPACK_IMPORTED_MODULE_1__","_cubism4__WEBPACK_IMPORTED_MODULE_2__","HASH_UNDEFINED","hashGet","predicate","resIndex","MapCache","setCacheAdd","setCacheHas","SetCache","has","punycode","util","Url","protocol","slashes","auth","host","port","hostname","hash","search","query","pathname","href","urlParse","urlResolve","resolveObject","urlResolveObject","urlFormat","protocolPattern","portPattern","simplePathPattern","delims","unwise","concat","autoEscape","nonHostChars","hostEndingChars","hostnameMaxLen","hostnamePartPattern","hostnamePartStart","unsafeProtocol","hostlessProtocol","slashedProtocol","querystring","parseQueryString","slashesDenoteHost","isObject","obj","isString","relative","queryIndex","splitter","uSplit","split","slashRegex","rest","trim","simplePath","exec","substr","proto","lowerProto","match","atSign","hostEnd","hec","decodeURIComponent","parseHost","ipv6Hostname","hostparts","part","newpart","charCodeAt","validParts","notHost","bit","toASCII","ae","esc","encodeURIComponent","escape","qm","rel","tkeys","tk","tkey","rkeys","rk","rkey","relPath","shift","isSourceAbs","isRelAbs","mustEndAbs","removeAllDots","srcPath","psychotic","pop","isNullOrUndefined","authInHost","isNull","last","hasTrailingSlash","up","isAbsolute","ListCache","Map","LARGE_ARRAY_SIZE","stackSet","pairs","createBaseFor","fromRight","iteratee","keysFunc","iterable","props","getMapData","mapCacheSet","arrayMap","baseIndexOf","baseIndexOfWith","baseUnary","arrayProto","basePullAll","comparator","seen","fromIndex","computed","hashSet","Uint8Array","baseGet","basePropertyDeep","arraySome","pullAll","baseIsEqual","hasIn","isKey","isStrictComparable","matchesStrictComparable","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","baseMatchesProperty","srcValue","objValue","baseGetTag","isObjectLike","argsTag","baseIsArguments","nodeType","freeGlobal","maxInt","base","tMin","tMax","skew","damp","initialBias","initialN","delimiter","regexPunycode","regexNonASCII","regexSeparators","errors","baseMinusTMin","stringFromCharCode","RangeError","mapDomain","string","labels","encoded","ucs2decode","extra","counter","ucs2encode","basicToDigit","codePoint","digitToBasic","digit","flag","adapt","delta","numPoints","firstTime","decode","out","basic","oldi","baseMinusT","inputLength","bias","encode","handledCPCount","basicLength","q","currentValue","handledCPCountPlusOne","qMinusT","toUnicode","overArg","nativeKeys","memoize","MAX_MEMOIZE_SIZE","memoizeCapped","cache","hashHas","constant","identity","baseSetToString","baseRest","pull","getMatchData","cacheHas","baseIsNaN","overRest","setToString","Stack","equalArrays","equalByTag","equalObjects","getTag","isBuffer","isTypedArray","arrayTag","objectTag","baseIsEqualDeep","other","bitmask","customizer","equalFunc","stack","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","freeSelf","Function","isSymbol","INFINITY","Hash","mapCacheClear","propIsEnumerable","toObject","shouldUseNative","test1","test2","order2","test3","letter","symbols","baseTimes","arg","eq","mapToArray","setToArray","boolTag","dateTag","errorTag","mapTag","numberTag","regexpTag","setTag","stringTag","symbolTag","arrayBufferTag","dataViewTag","symbolProto","symbolValueOf","valueOf","byteOffset","convert","isPartial","stacked","NativePromise","nativePromiseSupported","Polyfill","PENDING","SEALED","FULFILLED","REJECTED","NOOP","toString","asyncTimer","asyncSetTimer","setImmediate","asyncQueue","asyncFlush","asyncCall","invokeResolver","resolver","promise","resolvePromise","rejectPromise","reason","invokeCallback","subscriber","owner","settled","state_","data_","handleThenable","fulfill","publishFulfillment","publishRejection","publish","callbacks","then_","constructor","onFulfillment","onRejection","promises","Class","results","race","arrayPush","stackClear","baseToString","stubFalse","ENV","RENDERER_TYPE","BUFFER_BITS","BLEND_MODES","DRAW_MODES","FORMATS","TARGETS","TYPES","SCALE_MODES","WRAP_MODES","MIPMAP_MODES","ALPHA_MODES","CLEAR_MODES","GC_MODES","PRECISION","MASK_TYPES","MSAA_QUALITY","getRawTag","objectToString","nullTag","undefinedTag","symToStringTag","baseHasIn","reIsDeepProp","reIsPlainProp","MAX_SAFE_INTEGER","reIsUint","isIndex","getNative","isPrototype","baseKeys","baseFindIndex","strictIndexOf","isArguments","arrayLikeKeys","inherited","isArr","isArg","isBuff","isType","skipIndexes","earcut","holeIndices","dim","invSize","hasHoles","outerLen","outerNode","linkedList","triangles","prev","eliminateHoles","earcutLinked","end","clockwise","signedArea","insertNode","equals","removeNode","filterPoints","again","steiner","area","ear","pass","indexCurve","stop","isEarHashed","isEar","cureLocalIntersections","splitEarcut","pointInTriangle","minTX","minTY","maxTX","maxTY","minZ","zOrder","maxZ","prevZ","nextZ","z","intersects","locallyInside","isValidDiagonal","splitPolygon","len","list","queue","getLeftmost","compareX","eliminateHole","hole","bridge","findHoleBridge","bridgeReverse","filteredBridge","hx","hy","qx","Infinity","tan","mx","my","tanMin","sectorContainsSector","sortLinked","tail","numMerges","pSize","qSize","inSize","leftmost","bx","by","cx","cy","px","py","intersectsPolygon","middleInside","p1","p2","o1","o2","o3","o4","onSegment","inside","a2","Node","b2","an","bp","sum","default","deviation","polygonArea","trianglesArea","flatten","holes","dimensions","holeIndex","hasPath","baseMatches","baseIteratee","baseGetAllKeys","getAllKeys","Runner","items","_name","_aliasCount","a0","a3","a4","a5","a6","a7","ensureNonAliasedItems","removeAll","configurable","defineProperties","run","objProps","objLength","othProps","othLength","objStacked","othStacked","skipCtor","othValue","compared","objCtor","othCtor","webpackPolyfill","deprecate","children","mapCacheHas","DataView","arrLength","arrStacked","arrValue","othIndex","mapCacheDelete","mapCacheGet","baseFor","baseAssignValue","baseForOwn","mapKeys","assocIndexOf","listCacheHas","isArrayLike","asyncTag","funcTag","genTag","proxyTag","isFunction","maskSrcKey","IE_PROTO","isMasked","isLength","FUNC_ERROR_TEXT","memoized","Cache","stackHas","qs","sep","regexp","maxKeys","kstr","vstr","idx","xs","baseProperty","symbolToString","funcProto","funcToString","toSource","baseIsTypedArray","nodeUtil","nodeIsTypedArray","SORTABLE_CHILDREN","Bounds","updateID","isEmpty","getRectangle","EMPTY","addPoint","addQuad","x0","y0","x1","y1","addFrameMatrix","addVertexData","vertexData","beginOffset","endOffset","addVertices","addVerticesMatrix","padX","padY","rawX","rawY","addBounds","addBoundsMask","mask","_minX","_minY","_maxX","_maxY","addBoundsMatrix","addBoundsArea","pad","paddingX","paddingY","addFramePad","extendStatics","setPrototypeOf","__proto__","__extends","__","DisplayObject","_super","_this","tempDisplayObjectParent","renderable","worldAlpha","_lastSortedIndex","_zIndex","filterArea","filters","_enabledFilters","_localBounds","_boundsID","_boundsRect","_localBoundsRect","_mask","isSprite","isMask","mixin","propertyName","calculateBounds","getLocalBounds","transformRef","parentRef","worldBounds","worldBoundsID","toGlobal","toLocal","setParent","container","addChild","setTransform","rotation","skewX","skewY","pivotX","pivotY","removeChild","removeAllListeners","interactiveChildren","TemporaryDisplayObject","enableTempParent","myParent","disableTempParent","cacheParent","sortDirty","maskObject","sortChildren","zIndex","Container","sortableChildren","onChildrenChange","_length","arguments$1","_i","child","_parentID","addChildAt","swapChildren","child2","index1","getChildIndex","index2","setChildIndex","getChildAt","removeChildAt","removeChildren","endIndex","removed","begin","range","sortRequired","_calculateBounds","skipChildrenUpdate","render","renderAdvanced","_render","flush","enabled","_renderer","destroyChildren","oldChildren","_width","_height","containerUpdateTransform","rePropName","reEscapeChar","stringToPath","number","quote","subString","stackDelete","stackGet","weakMapTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","typedArrayTags","RETINA_PREFIX","FAIL_IF_MAJOR_PERFORMANCE_CAVEAT","supported","saidHello","skipHello","sayHello","navigator","userAgent","isWebGLSupported","contextOptions","stencil","failIfMajorPerformanceCaveat","canvas","document","createElement","getContext","success","getContextAttributes","loseContext","hex2rgb","hex","hex2string","hexString","string2hex","parseInt","rgb2hex","rgb","mapPremultipliedBlendModes","pm","npm","NORMAL_NPM","ADD_NPM","ADD","SCREEN_NPM","SCREEN","premultiplyBlendMode","correctBlendMode","blendMode","premultiplied","premultiplyRgba","premultiply","premultiplyTint","tint","premultiplyTintToRgba","createIndicesForQuads","outBuffer","totalIndices","Uint16Array","getBufferType","BYTES_PER_ELEMENT","Uint32Array","Int32Array","interleaveTypedArrays","arrays","sizes","outSize","stride","views","ArrayBuffer","littleOffset","indexStart","nextPow2","isPow2","log2","removeItems","startIdx","removeCount","nextUid","warnings","deprecation","ignoreDepth","groupCollapsed","groupEnd","ProgramCache","TextureCache","BaseTextureCache","destroyTextureCache","clearTextureCache","CanvasRenderTarget","resolution","RESOLUTION","resize","clearRect","trimCanvas","imageData","getImageData","pixels","bound","tempAnchor","DATA_URI","decomposeDataUri","dataUri","dataUriMatch","mediaType","subType","charset","encoding","determineCrossOrigin","loc","location","parsedUrl","samePort","getResolutionOfUrl","parseFloat","baseIsMatch","matchData","noCustomizer","appleIphone","appleIpod","appleTablet","appleUniversal","androidPhone","androidTablet","amazonPhone","amazonTablet","windowsPhone","windowsTablet","otherBlackBerry","otherBlackBerry10","otherOpera","otherChrome","otherFirefox","isAppleTabletOnIos13","platform","maxTouchPoints","MSStream","createMatch","regex","isMobile","nav","apple","phone","ipod","tablet","universal","device","amazon","android","windows","blackberry","blackberry10","opera","firefox","chrome","any","maxRecommendedTextures","allowMax","majorVersion","canUploadSameBuffer","MIPMAP_TEXTURES","ANISOTROPIC_LEVEL","FILTER_RESOLUTION","SPRITE_MAX_TEXTURES","SPRITE_BATCH_SIZE","RENDER_OPTIONS","antialias","autoDensity","transparent","backgroundColor","clearBeforeRender","preserveDrawingBuffer","legacy","GC_MODE","GC_MAX_IDLE","GC_MAX_CHECK_COUNT","WRAP_MODE","SCALE_MODE","PRECISION_VERTEX","PRECISION_FRAGMENT","CAN_UPLOAD_SAME_BUFFER","CREATE_IMAGE_BITMAP","ROUND_PIXELS","parseURI","str","opts","parser","strict","loose","strictMode","uri","$0","$1","$2","castPath","freeExports","freeModule","moduleExports","freeProcess","process","types","require","binding","listCacheClear","PREFER_ENV","WEBGL","WEBGL2","STRICT_TEXTURE_CACHE","INSTALLED","autoDetectResource","extension","ResourcePlugin","Resource","internal","onResize","onUpdate","unbind","style","_baseTexture","_glTexture","_source","_extension","BufferResource","UNPACK_PREMULTIPLY_ALPHA_WEBGL","alphaMode","UNPACK","texSubImage2D","internalFormat","defaultBufferOptions","scaleMode","NEAREST","NPM","BaseTexture","mipmap","anisotropicLevel","wrapMode","premultiplyAlpha","isPowerOfTwo","_refreshPOT","dirtyId","dirtyStyleId","cacheId","textureCacheIds","_batchEnabled","_batchLocation","parentTextureArray","setResource","ceil","setStyle","dirty","setSize","setRealSize","realWidth","realHeight","setResolution","oldResolution","removeFromCache","castToBaseTexture","isFrame","_pixiId","addToCache","fromBuffer","baseTextureFromCache","_globalBatch","AbstractMultiResource","itemDirtyIds","partTexture","_load","initFromArray","resources","addBaseTextureAt","addResourceAt","ArrayResource","urls","TEXTURE_2D_ARRAY","texImage3D","texSubImage3D","BaseImageResource","sourceAny","naturalWidth","videoWidth","naturalHeight","videoHeight","noSubImage","element","CanvasResource","OffscreenCanvas","HTMLCanvasElement","CubeResource","linkBaseTexture","SIDES","TEXTURE_CUBE_MAP_POSITIVE_X","TEXTURE_CUBE_MAP","side","ImageResource","HTMLImageElement","imageElement","Image","_process","preserveBitmap","createBitmap","createImageBitmap","bitmap","completed","glTextures","otherTex","close","SVGResource","sourceBase64","svg","_overrideWidth","_overrideHeight","_resolve","_crossorigin","btoa","unescape","_loadSvg","tempImage","svgWidth","svgHeight","round","drawImage","svgString","sizeMatch","SVG_SIZE","VideoResource","HTMLVideoElement","videoElement","setAttribute","firstSrc","sourceElement","mime","baseSrc","ext","MIME_TYPES","appendChild","_isConnectedToTicker","_updateFPS","updateFPS","_msToNextUpdate","autoPlay","_onCanPlay","_onError","_deltaTime","elapsedMS","playbackRate","HAVE_FUTURE_DATA","_onPlayStart","_onPlayStop","_isSourceReady","_isSourcePlaying","currentTime","paused","ended","ogv","mov","m4v","ImageBitmapResource","ImageBitmap","System","DepthResource","webGLVersion","DEPTH_COMPONENT","DEPTH_COMPONENT16","Framebuffer","depth","dirtyFormat","dirtySize","depthTexture","colorTextures","glFramebuffers","disposeRunner","multisample","addColorTexture","OFF","addDepthTexture","enableDepth","enableStencil","destroyDepthTexture","BaseRenderTexture","width_1","height_1","maskStack","filterStack","TextureUvs","x2","y2","x3","y3","uvsFloat32","frame","baseFrame","rotate","tw","th","w2","h2","cX","cY","NW","uX","uY","DEFAULT_UVS","Texture","orig","noFrame","_frame","_uvs","uvMatrix","_rotate","defaultAnchor","_updateID","onBaseTextureUpdated","updateUvs","destroyBase","fromLoader","imageUrl","textureFromCache","xNotFit","yNotFit","relationship","errorX","errorY","createWhiteTexture","fillStyle","fillRect","removeAllHandlers","WHITE","RenderTexture","baseRenderTexture","_legacyRenderer","legacyRenderer","filterFrame","filterPoolKey","resizeBaseTexture","RenderTexturePool","texturePool","enableFullScreen","_pixelsWidth","_pixelsHeight","getOptimalTexture","minWidth","minHeight","SCREEN_KEY","renderTexture","getFilterTexture","filterTexture","returnTexture","returnFilterTexture","destroyTextures","setScreenSize","screenKey","Attribute","normalized","instance","UID","Buffer","_static","_glBuffers","static","byteSizeMap","5126","5123","5121","UID$1","map$1","Geometry","buffers","attributes","indexBuffer","glVertexArrayObjects","instanced","instanceCount","refCount","addAttribute","bufferIndex","getAttribute","getBuffer","addIndex","getIndex","interleave","interleavedBuffer","attribute","attrib","merge","geometries","geometryOut","offsets","offset2","bufferIndexToCount","indexBufferData","Quad","QuadUv","uvs","vertexBuffer","uvBuffer","targetTextureFrame","destinationFrame","invalidate","UID$2","UniformGroup","syncUniforms","FilterState","sourceFrame","FilterSystem","defaultFilterStack","statePool","quad","quadUv","tempRect","activeState","outputFrame","inputSize","inputPixel","inputClamp","filterClamp","forceClear","useMaxPadding","padding","autoFit","current","fit","getOptimalFilterTexture","lastState","blit","flip","flop","CLEAR","bindAndClear","clearMode","BLIT","applyFilter","uSampler","filterGlobals","TRIANGLE_STRIP","calculateSpriteMatrix","outputMatrix","sprite","_texture","mappedMatrix","copyTo","TEMP_MATRIX","invert","swap","emptyPool","ObjectRenderer","_object","BatchSystem","emptyRenderer","currentRenderer","setObjectRenderer","objectRenderer","copyBoundTextures","maxTextures","boundTextures","boundArray","texArray","batchId","elements","CONTEXT_UID_COUNTER","ContextSystem","extensions","supports","uint32Indices","handleContextLost","handleContextRestored","isContextLost","contextChange","restoreContext","initFromContext","validateContext","runners","initFromOptions","createContext","getExtensions","drawBuffers","vertexArrayObject","anisotropicFiltering","uint32ElementIndex","floatTexture","floatTextureLinear","textureHalfFloat","textureHalfFloatLinear","colorBufferFloat","preventDefault","postrender","renderingToScreen","isWebGl2","WebGL2RenderingContext","hasuint32","GLFramebuffer","msaaBuffer","blitFramebuffer","tempRectangle","FramebufferSystem","managedFramebuffers","unknownFramebuffer","msaaSamples","hasMRT","writeDepthTexture","disposeAll","nativeDrawBuffersExtension_1","nativeDepthTextureExtension","WEBGL_LEGACY","activeTextures","drawBuffersWEBGL","getInternalformatParameter","RENDERBUFFER","RGBA8","SAMPLES","initFramebuffer","updateFramebuffer","resizeFramebuffer","setViewport","g","COLOR","DEPTH","detectSamples","bindRenderbuffer","renderbufferStorage","DEPTH_STENCIL","createRenderbuffer","renderbufferStorageMultisample","framebufferRenderbuffer","parentTexture","DEPTH_ATTACHMENT","DEPTH_STENCIL_ATTACHMENT","samples","res","sourcePixels","destPixels","sameSize","READ_FRAMEBUFFER","disposeFramebuffer","contextLost","deleteRenderbuffer","forceStencil","GLBuffer","byteSizeMap$1","GeometrySystem","_activeGeometry","_activeVao","hasVao","hasInstance","canUseUInt32ElementIndex","managedGeometries","managedBuffers","nativeVaoExtension_1","createVertexArray","createVertexArrayOES","bindVertexArray","vao","bindVertexArrayOES","deleteVertexArray","deleteVertexArrayOES","instanceExt_1","vertexAttribDivisor","vertexAttribDivisorANGLE","drawElementsInstanced","drawElementsInstancedANGLE","drawArraysInstanced","drawArraysInstancedANGLE","vaos","incRefCount","program","initGeometryVao","activateVao","updateBuffers","glBuffer","_boundBuffer","bufferSubData","drawType","STATIC_DRAW","checkCompatibility","geometryAttributes","shaderAttributes","attributeData","getSignature","attribs","strings","signature","vaoObjectHash","tempStride","tempStart","attribSize","disposeBuffer","disposeGeometry","buf","vaoId","lastBuffer","byteSize","glType","UNSIGNED_INT","drawArrays","MaskData","autoDetect","pooled","isMaskData","_stencilCounter","_scissorCounter","_scissorRect","_target","copyCountersOrReset","maskAbove","compileProgram","vertexSrc","fragmentSrc","attributeLocations","glVertShader","glFragShader","bindAttribLocation","VALIDATE_STATUS","getProgramInfoLog","booleanArray","maxFragmentPrecision","unknownContext","getTestContext","getMaxFragmentPrecision","MEDIUM","getShaderPrecisionFormat","shaderFragment","HIGH_FLOAT","precision","HIGH","setPrecision","requestedPrecision","maxSupportedPrecision","substring","GLSL_TO_SIZE","float","vec2","vec3","vec4","int","ivec2","ivec3","ivec4","bool","bvec2","bvec3","bvec4","mat2","mat3","mat4","sampler2D","mapSize","GL_TABLE","GL_TO_GLSL_TYPES","FLOAT_VEC2","FLOAT_VEC3","FLOAT_VEC4","INT","INT_VEC2","INT_VEC3","INT_VEC4","BOOL","BOOL_VEC2","BOOL_VEC3","BOOL_VEC4","FLOAT_MAT2","FLOAT_MAT3","FLOAT_MAT4","SAMPLER_2D","INT_SAMPLER_2D","UNSIGNED_INT_SAMPLER_2D","SAMPLER_CUBE","INT_SAMPLER_CUBE","UNSIGNED_INT_SAMPLER_CUBE","SAMPLER_2D_ARRAY","INT_SAMPLER_2D_ARRAY","UNSIGNED_INT_SAMPLER_2D_ARRAY","mapType","typeNames","tn","uniformParsers","code","uniform","GLSL_TO_SINGLE_SETTERS_CACHED","samplerCube","sampler2DArray","GLSL_TO_ARRAY_SETTERS","generateUniformsSync","uniformData","funcFragments","parsed","templateType","template","unsafeEval","fragTemplate","generateIfTestSrc","maxIfs","checkMaxIfStatementsInShader","unsafeEvalSupported","defaultFragment","defaultVertex","UID$3","nameCache","Program","defaultVertexSrc","defaultFragmentSrc","extractData","glPrograms","getAttributeData","getUniformData","attributesArray","totalAttributes","ACTIVE_ATTRIBUTES","attribData","getActiveAttrib","totalUniforms","ACTIVE_UNIFORMS","getActiveUniform","Shader","uniformGroup","checkUniformExists","OFFSET","CULLING","WINDING","State","polygonOffset","blend","_blendMode","_polygonOffset","for2d","depthTest","defaultVertex$1","defaultFragment$1","Filter","aTextureCoord","filterManager","_currentState","fragment","tempMat","TextureMatrix","clampMargin","mapCoord","uClampFrame","uClampOffset","_textureID","clampOffset","isSimple","multiplyUvs","mat","forceUpdate","texBase","margin","SpriteMaskFilter","maskMatrix","maskSprite","npmAlpha","otherMatrix","maskClamp","MaskSystem","enableScissor","alphaMaskPool","maskDataPool","alphaMaskIndex","setMaskStack","scissor","maskDataOrTarget","maskData","detect","SCISSOR","STENCIL","SPRITE","pushSpriteMask","popSpriteMask","isFastRect","rotX","rotXY","alphaMaskFilter","stashFilterArea","AbstractMaskSystem","glConst","getStackLength","curStackLen","newStackLen","_useCurrent","ScissorSystem","prevData","rt","projection","StencilSystem","prevMaskCount","stencilFunc","EQUAL","_getBitwiseMask","stencilOp","KEEP","INCR","STENCIL_BUFFER_BIT","clearStencil","DECR","ProjectionSystem","defaultFrame","calculateProjection","syncUniformGroup","globals","_destinationFrame","_resolution","_matrix","tempRect2","viewportFrame","RenderTextureSystem","_backgroundColorRgba","defaultMaskStack","screen","IGLUniformData","GLProgram","uniformGroups","UID$4","defaultSyncData","textureCount","ShaderSystem","systemCheck","dontSync","glProgram","generateShader","setUniforms","syncData","getglProgram","syncFunc","createSyncGroups","attribMap","mapWebGLBlendModesToPixi","MULTIPLY","OVERLAY","DARKEN","LIGHTEN","COLOR_DODGE","COLOR_BURN","HARD_LIGHT","SOFT_LIGHT","DIFFERENCE","EXCLUSION","HUE","SATURATION","LUMINOSITY","SRC_IN","SRC_OUT","ONE_MINUS_DST_ALPHA","SRC_ATOP","DST_OVER","DST_IN","DST_OUT","DST_ATOP","XOR","SUBTRACT","FUNC_REVERSE_SUBTRACT","FUNC_ADD","BLEND$1","OFFSET$1","CULLING$1","DEPTH_TEST$1","WINDING$1","StateSystem","stateId","_blendEq","setBlend","setOffset","setCullFace","setDepthTest","setFrontFace","checks","defaultState","blendModes","diff","forceState","updateCheck","checkBlendMode","checkPolygonOffset","POLYGON_OFFSET_FILL","setBlendMode","blendFunc","blendEquationSeparate","setPolygonOffset","system","TextureGCSystem","checkCount","maxIdle","checkCountMax","MANUAL","tm","managedTextures","wasRemoved","destroyTexture","unload","displayObject","GLTexture","TextureSystem","currentLocation","_unknownBoundTextures","unknownTexture","MAX_TEXTURE_IMAGE_UNITS","emptyTextures","emptyTexture2D","initTexture","updateTexture","initTextureType","RGBA32F","HALF_FLOAT","RGBA16F","updateTextureStyle","skipRemove","POW2","CLAMP","generateMipmap","LINEAR_MIPMAP_LINEAR","NEAREST_MIPMAP_NEAREST","anisotropicExt","level","MAX_TEXTURE_MAX_ANISOTROPY_EXT","texParameterf","TEXTURE_MAX_ANISOTROPY_EXT","systems","AbstractRenderer","UNKNOWN","roundPixels","autoResize","_backgroundColor","_backgroundColorString","_lastObjectRendered","initPlugins","staticMap","screenWidth","screenHeight","generateTexture","region","removeView","parentNode","thisAny","Renderer","prerender","addSystem","__plugins","premultipliedAlpha","powerPreference","ClassRef","skipUpdateTransform","isLost","registerPlugin","pluginName","ctor","autoDetectRenderer","_default","defaultFilter","BatchDrawCall","BatchTextureArray","ViewableBuffer","rawBinaryData","uint32View","float32View","_int8View","_uint8View","_int16View","Int16Array","_uint16View","_int32View","sizeOf","AbstractBatchRenderer","shaderGenerator","geometryClass","vertexSize","_vertexCount","_indexCount","_bufferedElements","_bufferedTextures","_bufferSize","_shader","_packedGeometries","_packedGeometryPoolSize","_flushId","_aBuffers","_iBuffers","MAX_TEXTURES","onPrerender","_dcIndex","_aIndex","_iIndex","_attributeBuffer","_indexBuffer","_tempBoundTextures","initFlushBuffers","_drawCallPool","_textureArrayPool","MAX_SPRITES","MAX_TA","buildTexturesAndDrawCalls","textureArrays","touch","TICK","countTexArrays","buildDrawCalls","finish","drawCalls","dcIndex","aIndex","iIndex","drawCall","spriteBlendMode","packInterleavedGeometry","bindAndClearTexArray","textureSystem","updateGeometry","packedGeometries","attributeBuffer","_buffer","drawBatches","dcCount","stateSystem","curTexArray","getAttributeBuffer","getIndexBuffer","roundedP2","roundedSizeIndex","roundedSize","packedVertices","indicies","argb","_tintRGB","BatchShaderGenerator","programCache","defaultGroupCache","sampleValues","uSamplers","generateSampleSrc","translationMatrix","BatchGeometry","defaultVertex$2","defaultFragment$2","BatchPluginFactory","BatchPlugin","BatchRenderer","promiseTag","dataViewCtorString","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","Ctor","ctorString","reRegExpChar","reIsHostCtor","reIsNative","RegExp","baseIsNative","pattern","class","chatShow","messageStyle","chat","ONE_FRAME_TIME","getTime","startTime_1","lastTime","vendors","requestAnimationFrame","cancelAnimationFrame","clearTimeout","isNaN","isInteger","isFinite","accessibleTarget","accessible","accessibleTitle","accessibleHint","tabIndex","_accessibleActive","_accessibleDiv","accessibleType","accessiblePointerEvents","accessibleChildren","renderId","KEY_CODE_TAB","DIV_TOUCH_SIZE","DIV_TOUCH_POS_X","DIV_TOUCH_POS_Y","DIV_TOUCH_ZINDEX","DIV_HOOK_SIZE","DIV_HOOK_POS_X","DIV_HOOK_POS_Y","DIV_HOOK_ZINDEX","AccessibilityManager","_hookDiv","createTouchHook","pool","_onKeyDown","_onMouseMove","_isActive","_isMobileAccessibility","androidUpdateCount","androidUpdateFrequency","hookDiv","title","activate","destroyTouchHook","body","deactivate","updateAccessibleObjects","getBoundingClientRect","sx","sy","wt","capHitArea","updateDebugHTML","innerHTML","borderStyle","_onClick","_onFocus","_onFocusOut","pointerEvents","eventData","keyCode","movementX","movementY","InteractionData","pressure","rotationAngle","twist","tangentialPressure","originalEvent","identifier","isPrimary","button","buttons","tiltX","tiltY","pointerType","getLocalPosition","globalPos","copyEvent","which","InteractionEvent","stopped","stopsPropagatingAt","stopPropagationHint","currentTarget","stopPropagation","InteractionTrackingData","pointerId","_pointerId","_flags","FLAGS","_doSet","yn","flags","OVER","RIGHT_DOWN","LEFT_DOWN","freeze","TreeSearch","_tempPoint","recursiveFindHit","interactionEvent","hit","interactiveParent","hitTestChildren","containsPoint","childHit","findHit","interactiveTarget","cursor","_trackedPointers","MOUSE_POINTER_ID","hitTestEvent","InteractionManager","autoPreventDefault","interactionFrequency","mouse","activeInteractionData","interactionDataPool","interactionDOMElement","moveWhenInside","eventsAdded","tickerAdded","mouseOverRenderer","supportsTouchEvents","supportsPointerEvents","PointerEvent","onPointerUp","processPointerUp","onPointerCancel","processPointerCancel","onPointerDown","processPointerDown","processPointerMove","onPointerOut","processPointerOverOut","onPointerOver","cursorStyles","pointer","currentCursorMode","delayedEvents","_tempDisplayObject","_useSystemTicker","useSystemTicker","setTargetElement","addTickerListener","removeTickerListener","globalPoint","lastObjectRendered","processInteractive","removeEvents","addEvents","tickerUpdate","INTERACTION","msPointerEnabled","msContentZooming","msTouchAction","touchAction","_didMove","interactionData","configureInteractionEventForDOMEvent","setCursorMode","eventString","delayDispatchEvent","mapPositionToPoint","parentElement","resolutionMultiplier","delayedLen","displayObject_1","normalizeToPointerData","isNormalized","cancelable","eventLen","getInteractionDataForPointerId","isRightButton","trackedPointers","rightDown","leftDown","onPointerComplete","cancelled","eventAppend","releaseInteractionDataForPointerId","trackingData","isTouch","isMouse","isMouseTap","isDown","over","none","pointerEvent","clientX","clientY","globalX","globalY","normalizedEvents","TouchEvent","li","changedTouches","touches","radiusX","radiusY","layerX","layerY","MouseEvent","tempEvent","Application","forceCanvas","stage","_plugins","plugin","stageOptions","reverse","ResizePlugin","dom","queueResize","_resizeTo","cancelResize","_resizeId","innerWidth","innerHeight","clientWidth","clientHeight","resizeTo","TEMP_RECT","BYTES_PER_PIXEL","Extract","extract","image","quality","base64","toDataURL","flipY","generated","canvasBuffer","webglPixels","readPixels","canvasData","arrayPostDivide","putImageData","target_1","_noop","eachSeries","iterator","deferNext","onlyOnce","callFn","worker","concurrency","workers","_tasks","saturated","unsaturated","empty","drain","started","_insert","kill","task","_next","running","resume","insertAtFront","caching","onComplete","_defineProperties","descriptor","writable","_createClass","Constructor","protoProps","staticProps","useXdr","XDomainRequest","STATUS_NONE","STATUS_OK","STATUS_EMPTY","STATUS_IE_BUG_EMPTY","STATUS_TYPE_OK","_noop$1","_setFlag","STATUS_FLAGS","DATA_URL","_getExtension","timeout","loadType","_determineLoadType","xhrType","metadata","TYPE","progressChunk","_dequeue","_onLoadBinding","_elementTimer","_boundComplete","_boundOnError","_boundOnProgress","_onProgress","_boundOnTimeout","_onTimeout","_boundXhrOnError","_xhrOnError","_boundXhrOnTimeout","_xhrOnTimeout","_boundXhrOnAbort","_xhrOnAbort","_boundXhrOnLoad","_xhrOnLoad","onStart","onProgress","onAfterMiddleware","setExtensionLoadType","extname","setExtMap","_loadTypeMap","setExtensionXhrType","_xhrTypeMap","_proto","_clearEvents","_finish","xdr","EMPTY_GIF","firstChild","cb","isLoading","isComplete","LOADING","_determineCrossOrigin","LOAD_TYPE","IMAGE","_loadElement","AUDIO","_loadSourceElement","VIDEO","XHR","_loadXdr","_loadXhr","_hasFlag","ontimeout","onprogress","COMPLETE","loadElement","skipSource","isCocoonJS","mimeTypes","mimeType","_createSource","_mimeTypes","_determineXhrType","XHR_RESPONSE_TYPE","DOCUMENT","TEXT","nodeName","lengthComputable","loaded","total","reqType","statusText","text","responseText","BUFFER","statusType","DOMParser","domparser","parseFromString","XML","responseURL","origin","isDataUrl","slashIndex","queryStart","hashStart","_getMimeFromXhrType","BLOB","DEFAULT","gif","png","bmp","jpg","jpeg","tif","tiff","webp","tga","mp3","ogg","wav","mp4","webm","xhtml","html","htm","xml","tmx","tsx","txt","ttf","otf","_keyStr","encodeBinary","inx","bytebuffer","encodedCharIndexes","jnx","paddingBytes","_jnx","webkitURL","parsing","Blob","blob","getResponseHeader","MAX_PROGRESS","rgxExtractUrlHash","Loader","baseUrl","progress","loading","defaultQueryString","_beforeMiddleware","_afterMiddleware","_resourcesParsing","_boundLoadResource","_loadResource","_queue","_defaultBeforeMiddleware","pre","_defaultAfterMiddleware","use","parentResource","_prepareUrl","incompleteChildren","_i2","fullChunk","eachChunk","_i3","detach","_onStart","_onComplete","numTasks","chunk","dequeue","_this2","_onLoad","_this3","LoaderResource","TextureLoader","_protected","_shared","AppLoaderPlugin","sharedLoader","LINE_JOIN","LINE_CAP","ParticleContainer","maxSize","properties","batchSize","maxBatchSize","_properties","_maxSize","_batchSize","_buffers","_bufferUpdateIDs","setProperties","_tint","tintRgb","smallestChildIndex","ParticleBuffer","dynamicPropertyFlags","dynamicProperties","staticProperties","attributeName","uploadFunction","staticStride","staticBuffer","staticData","staticDataUint32","dynamicStride","dynamicBuffer","dynamicData","dynamicDataUint32","initBuffers","dynamicOffset","dynBuffer","staticOffset","statBuffer","uploadDynamic","startIndex","amount","uploadStatic","ParticleRenderer","uploadVertices","uploadPosition","uploadRotation","uploadUvs","uploadTint","totalChildren","generateBuffers","toArray","uColor","updateStatic","_generateOneMoreBuffer","bid","w0","w1","h0","h1","spritePosition","spriteRotation","textureUvs","GRAPHICS_CURVES","adaptive","maxLength","minSegments","maxSegments","epsilon","_segmentsCount","defaultSegments","FillStyle","color","buildPoly","build","graphicsData","shape","triangulate","graphicsGeometry","verts","holeArray","vertPos","buildCircle","circleData","CIRC","ellipseData","totalSegs","seg","center","circle","buildRectangle","rectData","getPt","n1","n2","perc","quadraticBezierCurve","fromX","fromY","cpX","cpY","toX","toY","xa","ya","xb","yb","buildRoundedRectangle","rrectData","vecPos","square","nx","ny","innerWeight","outerWeight","exx","eyy","ix","iy","ox","oy","eix","eiy","eox","eoy","ex","ey","cx2p0x","cy2p0y","angle0","angle1","startAngle","angleDiff","absAngleDiff","segCount","angleInc","buildNonNativeLine","eps","closePointEps","lineStyle","firstPoint","lastPoint","closedShape","POLY","closeStroke","closedPath","midPointX","midPointY","widthSquared","miterLimitSquared","miterLimit","perpx","perpy","perp1x","perp1y","dist","ratio","alignment","cap","ROUND","SQUARE","dx0","dy0","dx1","dy1","cross","c1","c2","pdist","imx","imy","omx","omy","smallerInsideSegmentSq","insideWeight","smallerInsideDiagonalSq","insideMiterOk","BEVEL","eps2","buildNativeLine","buildLine","native","Star","innerRadius","polygon","ArcUtils","curveTo","b1","mm","dd","tt","k1","k2","j1","j2","qy","endAngle","anticlockwise","arc","_startX","_startY","_anticlockwise","sweep","theta","theta2","cTheta","sTheta","segMinus","remainder","real","BezierUtils","curveLength","cpX2","cpY2","t2","t3","nt","nt2","nt3","prevX","prevY","dt2","dt3","QuadraticUtils","a32","ba","BatchPart","attribStart","endAttrib","FILL_COMMANDS","ELIP","RECT","RREC","BATCH_POOL","DRAW_CALL_POOL","GraphicsData","tmpPoint","tmpBounds","GraphicsGeometry","indicesUint16","colors","textureIds","batchDirty","cacheDirty","clearDirty","batches","shapeIndex","boundsDirty","boundsPadding","batchable","batchPart","drawShape","drawHole","lastShape","hitHole","i_1","updateBatches","allow32Indices","validateBatching","currentStyle","command","transformPoints","nextTexture","index_1","attribIndex","REPEAT","processFill","processLine","_compareStyles","addUvs","need32","isBatchable","packBatches","styleA","styleB","fill","line","BATCHABLE_SIZE","currentTexture","drawMode","LINES","addColors","addTextureIds","packAttributes","glPoints","f32","u32","processHoles","sequenceBounds","curMatrix","IDENTITY","nextMatrix","lineWidth","ellipse","poly","rgba","uvsStart","adjustUvs","LineStyle","BUTT","MITER","temp","DEFAULT_SHADERS","Graphics","_geometry","_fillStyle","_lineStyle","_holeMode","currentPath","batchTint","_transformID","finishPoly","lineTextureStyle","startPoly","moveTo","lineTo","_initCurve","quadraticCurveTo","bezierCurveTo","arcTo","radius_1","startX","startY","xDiff","yDiff","beginFill","beginTextureFill","endFill","drawRect","drawRoundedRect","drawCircle","drawEllipse","drawPolygon","drawStar","_populateBatches","_renderBatched","_renderDirect","gI","_batchRGB","calculateVertices","calculateTints","_resolveDirectShader","_renderDrawCallDirect","groupTextureCount","_TEMP_POINT","tintRGB","wtID","_worldID","closePath","beginHole","endHole","TEXT_GRADIENT","Sprite","_anchor","_onAnchorUpdate","_cachedTint","vertexTrimmedData","_transformTrimmedID","_textureTrimmedID","_roundPixels","_onTextureUpdate","_x","_y","calculateTrimmedVertices","destroyBaseTexture","defaultStyle","align","breakWords","dropShadow","dropShadowAlpha","dropShadowAngle","dropShadowBlur","dropShadowColor","dropShadowDistance","fillGradientType","LINEAR_VERTICAL","fillGradientStops","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","letterSpacing","lineHeight","lineJoin","stroke","strokeThickness","textBaseline","whiteSpace","wordWrap","wordWrapWidth","leading","genericFontFamilies","TextStyle","styleID","deepCopyProperties","clonedProperties","_align","_breakWords","_dropShadow","_dropShadowAlpha","_dropShadowAngle","_dropShadowBlur","_dropShadowColor","outputColor","getColor","_dropShadowDistance","_fill","_fillGradientType","_fillGradientStops","areArraysEqual","_fontFamily","_fontSize","_fontStyle","_fontVariant","_fontWeight","_letterSpacing","_lineHeight","_leading","_lineJoin","_miterLimit","_padding","_stroke","_strokeThickness","_textBaseline","_trim","_whiteSpace","_wordWrap","_wordWrapWidth","toFontString","fontSizeString","fontFamilies","getSingleColor","array1","array2","propertyObj","TextMetrics","lines","lineWidths","maxLineWidth","fontProperties","measureText","_canvas","font","measureFont","ascent","outputText","collapseSpaces","collapseNewlines","canPrependSpaces","tokens","tokenize","token","isNewline","addLine","currIsBreakingSpace","isBreakingSpace","lastIsBreakingSpace","tokenWidth","getFromCache","canBreakWords","characters","wordWrapSplit","char","nextChar","lastChar","canBreakChars","characterWidth","isLastToken","newLine","trimRight","spacing","_newlines","_breakingSpaces","_token","_char","_nextChar","_index","_fonts","descent","_context","metricsString","METRICS_STRING","BASELINE_SYMBOL","baseline","BASELINE_MULTIPLIER","fillText","imagedata","clearMetrics","defaultDestroyOptions","Text","ownCanvas","_ownCanvas","_autoResolution","_text","_style","_styleListener","_font","localStyleID","updateText","respectDirty","linePositionX","linePositionY","measured","passesCount","isShadowPass","dsOffsetText","dsOffsetShadow","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","_generateFillStyle","drawLetterSpacing","isStroke","currentPosition","stringArray","previousWidth","currentWidth","currentChar","strokeText","trimmed","metrics","gradient","dropShadowCorrection","lengthPlus1","createLinearGradient","lastIterationStop","textHeight","gradStopLineHeight","thisLineTop","lineStop","globalStop","clampedStop","addColorStop","totalIterations","currentIteration","UPLOADS_PER_FRAME","CountLimiter","maxItemsPerFrame","itemsLeft","beginFrame","allowedToUpload","findMultipleBaseTextures","findBaseTexture","findTexture","drawText","_helper","calculateTextStyle","findText","findTextStyle","BasePrepare","limiter","uploadHookHelper","addHooks","uploadHooks","completes","ticking","delayedTick","prepareItems","registerFindHook","registerUploadHook","addOnce","tick","UTILITY","uploaded","addHook","uploadHook","uploadBaseTextures","uploadGraphics","findGraphics","Prepare","TimeLimiter","maxMilliseconds","frameStart","Spritesheet","resolutionFilename","animations","_updateResolution","_frames","frames","_frameKeys","_batchIndex","_callback","meta","BATCH_SIZE","_processFrames","_processAnimations","_parseComplete","_nextBatch","initialFrameIndex","frameIndex","maxFrames","sourceSize","rotated","spriteSourceSize","animName","frameName","SpritesheetLoader","imageResourceName","loadOptions","imageMetadata","resourcePath","getResourcePath","spritesheet","TilingSprite","tileTransform","uvRespectAnchor","updateLocalTransform","fragmentSimple","TilingSpriteRenderer","simpleShader","ts","baseTex","lt","W","H","uMapCoord","uTransform","MeshBatchUvs","_bufferUpdateId","_textureUpdateId","tempPolygon","Mesh","vertexDirty","batchUvs","_renderToBatch","_renderDefault","calculateUvs","material","vertexDirtyId","geomUvs","ind0","ind1","ind2","MeshMaterial","uTextureMatrix","_colorDirty","_alpha","MeshGeometry","verticesBuffer","uvsBuffer","_updateId","BitmapFontData","info","common","page","kerning","TextFormat","rawData","chars","kernings","attributeList","itemData","strValue","floatValue","face","xoffset","yoffset","xadvance","first","second","XMLFormat","XMLDocument","getElementsByTagName","XMLStringFormat","xmlTxt","formats","autoDetectFormat","generateFillStyle","drawGlyph","resolveCharacters","startCode","endCode","j_1","BitmapFont","pageTextures","page_1","xOffset","yOffset","xAdvance","_d","install","fontData","available","uninstall","textStyle","defaultOptions","textureWidth","textureHeight","charsList","positionX","positionY","maxCharHeight","textureGlyphWidth","ALPHA","NUMERIC","ALPHANUMERIC","ASCII","pageMeshDataPool","charRenderDataPool","BitmapText","_upgradeStyle","styleDefaults","maxWidth","fontName","_activePagesMeshData","_textWidth","_textHeight","_fontName","_maxWidth","_maxLineHeight","_textureCache","pos","textLength","prevCharCode","lastLineWidth","lastBreakPos","lastBreakWidth","spacesRemoved","maxLineHeight","charCode","charData","charRenderData","lineAlignOffsets","alignOffset","lenChars","pagesMeshData","newPagesMeshData","activePagesMeshData","baseTextureUid","pageMeshData","mesh","uvsCount","total_1","xPos","yPos","pageMesh","textureFrame","anchorOffsetX","anchorOffsetY","i_2","textureBuffer","validate","valueSplit","registerFont","BitmapFontLoader","getBaseUrl","pageFile","bitmapFont","exists","bitmapResource","resUrl","dirname","dir","AlphaFilter","uAlpha","vertTemplate","generateBlurVertSource","kernelSize","halfLength","vertSource","blurLoop","blur","GAUSSIAN_VALUES","5","7","9","11","13","15","generateBlurFragSource","kernel","fragSource","BlurFilterPass","horizontal","strength","vertSrc","fragSrc","_quality","passes","renderTarget","BlurFilter","blurXFilter","blurYFilter","repeatEdgePixels","xStrength","yStrength","updatePadding","_repeatEdgePixels","ColorMatrixFilter","_loadMatrix","newMatrix","_multiply","_colorMatrix","brightness","greyscale","blackAndWhite","hue","cosR","sinR","sqrW","a00","a01","a02","a10","a11","a12","a20","a21","a22","contrast","saturate","desaturate","negative","sepia","technicolor","polaroid","toBGR","kodachrome","browni","vintage","colorTone","desaturation","toned","lightColor","darkColor","lR","lG","lB","dR","dG","dB","night","intensity","predator","lsd","grayscale","DisplacementFilter","mapSampler","filterMatrix","lenX","lenY","FXAAFilter","NoiseFilter","noise","seed","uNoise","uSeed","_tempMatrix","_cacheAsBitmap","_cacheData","CacheData","textureCacheId","originalRender","originalRenderCanvas","originalCalculateBounds","originalGetLocalBounds","originalUpdateTransform","originalDestroy","originalMask","originalFilterArea","originalContainsPoint","cacheAsBitmap","renderCanvas","_renderCached","_renderCachedCanvas","_cacheAsBitmapDestroy","_destroyCachedDisplayObject","_initCachedDisplayObject","cacheAlpha","cachedRenderTexture","cachedSourceFrame","cachedProjectionTransform","_calculateCachedBounds","_getCachedLocalBounds","cachedSprite","_initCachedDisplayObjectCanvas","_renderCanvas","cachedRenderTarget","_projTransform","getChildByName","deep","getGlobalPosition","PlaneGeometry","segWidth","segHeight","segmentsX","segmentsY","sizeX","sizeY","totalSub","value2","value3","value4","RopeGeometry","textureScale","distance","updateVertices","nextPoint","perpX","perpY","perpLength","SimpleRope","ropeGeometry","meshMaterial","SimplePlane","verticesX","verticesY","planeGeometry","textureUpdated","SimpleMesh","DEFAULT_BORDER_SIZE","NineSlicePlane","leftWidth","topHeight","rightWidth","bottomHeight","_origWidth","_origHeight","_leftWidth","_rightWidth","_topHeight","_bottomHeight","_refresh","updateHorizontalVertices","_getMinScale","updateVerticalVertices","scaleW","scaleH","_uvw","_uvh","AnimatedSprite","_durations","animationSpeed","updateAnchor","onFrameChange","onLoop","_playing","_previousFrame","gotoAndStop","frameNumber","previousFrame","currentFrame","gotoAndPlay","lag","fromFrames","fromImages","images","v5","useDeprecated","TransformStatic","Transform","TransformBase","TRANSFORM_MODE","STATIC","DYNAMIC","WebGLRenderer","FilterManager","CanvasTinter","canvasUtils","GroupD8","groupD8","accessibility","prepare","CanvasPrepare","CanvasExtract","extras","fromFrame","frameId","fromImage","imageId","getSvgSize","Plane","Rope","RawMesh","CanvasMeshRenderer","MeshRenderer","ticker","loaders","bitmapFontParser","parseBitmapFontData","spritesheetParser","addPixiMiddleware","eventToSignal","toUpperCase","signal","_renderWebGL","renderWebGL","renderAdvancedWebGL","BaseTextureAny","loadSource","baseTextureIdDeprecation","hasLoaded","_id","fromCanvas","fromSVG","Point","ObservablePoint","Rectangle","Matrix","getRenderTarget","_clear","returnRenderTarget","calculateScreenSpaceMatrix","calculateNormalizedScreenSpaceMatrix","translateScaleX","translateScaleY","BlurXFilter","BlurYFilter","SpriteAny","TextureAny","GraphicsAny","spriteFrom","textureFrom","generateCanvasTexture","fromVideo","mixins","delayMixin","performMixins","Live2DModel","components","mouthOpen","sleepTimer","chatTimer","app","chatShowTimer","socket","isSpeech","cloudSel","appkey","AccessToken","voice","selModel","modelList","messageBottom","messageBackground","messageBorderColor","haveMotion","mounted","toSocket","selModelData","borderColor","methods","destroyModel","randomMotion","playVoice","voiceUrl","speech","$nextTick","onended","connect","live2dInit","getElementById","l2dmodel","__scopeId","listCacheDelete","lastIndex","listCacheSet","SHAPES","PI_2","RAD_TO_DEG","DEG_TO_RAD","rectangle","enlarge","Circle","r2","Ellipse","halfWidth","halfHeight","normx","normy","Polygon","flat","il","xi","yi","xj","yj","intersect","RoundedRectangle","radius2","scope","fromArray","transpose","newPos","tx1","d1","decompose","ux","uy","rotationCayley","rotationMatrices","signum","row","_ux","_uy","_vx","_vy","E","SE","S","SW","N","NE","MIRROR_VERTICAL","MAIN_DIAGONAL","MIRROR_HORIZONTAL","REVERSE_DIAGONAL","ind","vX","vY","inv","rotationSecond","rotationFirst","sub","rotate180","isVertical","byDirection","matrixAppendRotationInv","onChange","updateSkew","_rotation","_cx","_sx","_cy","_sy","_localID","_currentLocalID","parentTransform","pt","setFromMatrix","_classCallCheck","MiniSignalBinding","_fn","_once","_thisArg","_prev","_addMiniSignalBinding","node","_head","_tail","MiniSignal","ee","hashDelete","nativeMax","otherArgs","stringifyPrimitive","objectKeys","ks","UPDATE_PRIORITY","TARGET_FPMS","TickerListener","previous","redirect","hard","_requestId","_maxElapsedMS","_minElapsedMS","autoStart","speed","_lastFrame","_tick","_requestIfNeeded","_cancelIfNeeded","_startIfPossible","_addListener","listener","head","minFPS","maxFPS","minFPMS","_system","TickerPlugin","sharedTicker","_ticker","LOW","oldTicker","nativeIsBuffer","symbolsFunc","prefix","Events","EE","addListener","emitter","evt","_events","_eventsCount","clearEvent","EventEmitter","eventNames","names","handlers","listenerCount","removeListener","prefixed","isKeyable","nativeObjectToString","isOwn","unmasked","listCacheGet","hasFunc"],"mappings":"6FAAA,IAAIA,EAAc,EAAQ,QACtBC,EAAY,EAAQ,QAGpBC,EAAcC,OAAOC,UAGrBC,EAAuBH,EAAYG,qBAGnCC,EAAmBH,OAAOI,sBAS1BC,EAAcF,EAA+B,SAASG,GACxD,OAAc,MAAVA,EACK,IAETA,EAASN,OAAOM,GACTT,EAAYM,EAAiBG,IAAS,SAASC,GACpD,OAAOL,EAAqBM,KAAKF,EAAQC,QANRT,EAUrCW,EAAOC,QAAUL,G,qBC5BjB,IAAIM,EAAY,IACZC,EAAW,GAGXC,EAAYC,KAAKC,IAWrB,SAASC,EAASC,GAChB,IAAIC,EAAQ,EACRC,EAAa,EAEjB,OAAO,WACL,IAAIC,EAAQP,IACRQ,EAAYT,GAAYQ,EAAQD,GAGpC,GADAA,EAAaC,EACTC,EAAY,GACd,KAAMH,GAASP,EACb,OAAOW,UAAU,Q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B,OAAImE,KAAYgG,GAAS5B,EAChBpE,GAEToE,EAAmB,MAAVjM,EAAiB,EAAIA,EAAOiM,SAC5BA,GAAUqjE,EAASrjE,IAAWw4D,EAAQ/gE,EAAKuI,KACjDzG,EAAQxF,IAAW+kE,EAAY/kE,KAGpCG,EAAOC,QAAUyrE,G,mBC5BjB,SAAS/G,EAAcx/D,EAAOlC,EAAOozD,GACnC,IAAI3oD,EAAQ2oD,EAAY,EACpBvqD,EAAS3G,EAAM2G,OAEnB,QAAS4B,EAAQ5B,EACf,GAAI3G,EAAMuI,KAAWzK,EACnB,OAAOyK,EAGX,OAAQ,EAGV1N,EAAOC,QAAU0kE","file":"js/Live2d.04fa9e3d.js","sourcesContent":["var arrayFilter = require('./_arrayFilter'),\n stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nmodule.exports = getSymbols;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@pixi/utils\"), require(\"@pixi/math\"), require(\"@pixi/core\"), require(\"lodash/pull\"), require(\"@pixi/display\"), require(\"lodash/mapKeys\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"@pixi/utils\", \"@pixi/math\", \"@pixi/core\", \"lodash/pull\", \"@pixi/display\", \"lodash/mapKeys\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"pixi-live2d-display\"] = factory(require(\"@pixi/utils\"), require(\"@pixi/math\"), require(\"@pixi/core\"), require(\"lodash/pull\"), require(\"@pixi/display\"), require(\"lodash/mapKeys\"));\n\telse\n\t\troot[\"PIXI\"] = root[\"PIXI\"] || {}, root[\"PIXI\"][\"live2d\"] = factory(root[\"PIXI\"][\"utils\"], root[\"PIXI\"], root[\"PIXI\"], root[\"lodash/pull\"], root[\"PIXI\"], root[\"lodash/mapKeys\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__5__, __WEBPACK_EXTERNAL_MODULE__17__, __WEBPACK_EXTERNAL_MODULE__19__, __WEBPACK_EXTERNAL_MODULE__20__, __WEBPACK_EXTERNAL_MODULE__24__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 27);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, \"f\", function() { return /* reexport */ log_logger; });\n__webpack_require__.d(__webpack_exports__, \"b\", function() { return /* reexport */ clamp; });\n__webpack_require__.d(__webpack_exports__, \"g\", function() { return /* reexport */ rand; });\n__webpack_require__.d(__webpack_exports__, \"d\", function() { return /* reexport */ copyProperty; });\n__webpack_require__.d(__webpack_exports__, \"c\", function() { return /* reexport */ copyArray; });\n__webpack_require__.d(__webpack_exports__, \"a\", function() { return /* reexport */ applyMixins; });\n__webpack_require__.d(__webpack_exports__, \"e\", function() { return /* reexport */ folderName; });\n\n// EXTERNAL MODULE: ./src/config.ts\nvar config = __webpack_require__(1);\n\n// CONCATENATED MODULE: ./src/utils/log.ts\n\r\n/**\r\n * A simple tagged logger.\r\n *\r\n * You can replace the methods with your own ones.\r\n *\r\n * ```js\r\n * import { logger } from 'pixi-live2d-display';\r\n *\r\n * logger.log = (tag, ...messages) => {\r\n * console.log(tag, 'says:', ...messages);\r\n * };\r\n * ```\r\n */\r\nvar log_logger;\r\n(function (logger) {\r\n function log(tag, ...messages) {\r\n if (config[\"b\" /* config */].logLevel <= config[\"b\" /* config */].LOG_LEVEL_VERBOSE) {\r\n console.log(`[${tag}]`, ...messages);\r\n }\r\n }\r\n logger.log = log;\r\n function warn(tag, ...messages) {\r\n if (config[\"b\" /* config */].logLevel <= config[\"b\" /* config */].LOG_LEVEL_WARNING) {\r\n console.warn(`[${tag}]`, ...messages);\r\n }\r\n }\r\n logger.warn = warn;\r\n function error(tag, ...messages) {\r\n if (config[\"b\" /* config */].logLevel <= config[\"b\" /* config */].LOG_LEVEL_ERROR) {\r\n console.error(`[${tag}]`, ...messages);\r\n }\r\n }\r\n logger.error = error;\r\n})(log_logger || (log_logger = {}));\r\n\n// CONCATENATED MODULE: ./src/utils/math.ts\n/**\r\n * These functions can be slightly faster than the ones in Lodash.\r\n * @packageDocumentation\r\n */\r\nfunction clamp(num, lower, upper) {\r\n return num < lower ? lower : num > upper ? upper : num;\r\n}\r\nfunction rand(min, max) {\r\n return Math.random() * (max - min) + min;\r\n}\r\n\n// CONCATENATED MODULE: ./src/utils/obj.ts\n/**\r\n * Copies a property at only if it matches the `type`.\r\n * @param type - Type expected to match `typeof` on the property.\r\n * @param from - Source object.\r\n * @param to - Destination object.\r\n * @param fromKey - Key of the property in source object.\r\n * @param toKey - Key of the property in destination object.\r\n */\r\n// TODO: lint and fix the formatting!\r\nfunction copyProperty(type, from, to, fromKey, toKey) {\r\n const value = from[fromKey];\r\n if (value !== null && typeof value === type) {\r\n // a type error will occur here, have no idea\r\n to[toKey] = value;\r\n }\r\n}\r\n/**\r\n * Copies an array at `key`, filtering the items that match the `type`.\r\n * @param type - Type expected to match `typeof` on the items.\r\n * @param from - Source object.\r\n * @param to - Destination object.\r\n * @param fromKey - Key of the array property in source object.\r\n * @param toKey - Key of the array property in destination object.\r\n */\r\nfunction copyArray(type, from, to, fromKey, toKey) {\r\n const array = from[fromKey];\r\n if (Array.isArray(array)) {\r\n to[toKey] = array.filter(item => item !== null && typeof item === type);\r\n }\r\n}\r\n/**\r\n * @see {@link https://www.typescriptlang.org/docs/handbook/mixins.html}\r\n */\r\nfunction applyMixins(derivedCtor, baseCtors) {\r\n baseCtors.forEach(baseCtor => {\r\n Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {\r\n if (name !== 'constructor') {\r\n Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name));\r\n }\r\n });\r\n });\r\n}\r\n\n// CONCATENATED MODULE: ./src/utils/string.ts\n/**\r\n * Gets the name of parent folder in a url.\r\n * @param url - URL of a file.\r\n * @return Name of the parent folder, or the file itself if it has no parent folder.\r\n */\r\nfunction folderName(url) {\r\n let lastSlashIndex = url.lastIndexOf('/');\r\n if (lastSlashIndex != -1) {\r\n url = url.slice(0, lastSlashIndex);\r\n }\r\n lastSlashIndex = url.lastIndexOf('/');\r\n if (lastSlashIndex !== -1) {\r\n url = url.slice(lastSlashIndex + 1);\r\n }\r\n return url;\r\n}\r\n\n// CONCATENATED MODULE: ./src/utils/index.ts\n\r\n\r\n\r\n\r\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return config; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return VERSION; });\n/**\r\n * Global configs.\r\n */\r\nvar config;\r\n(function (config) {\r\n config.LOG_LEVEL_VERBOSE = 0;\r\n config.LOG_LEVEL_WARNING = 1;\r\n config.LOG_LEVEL_ERROR = 2;\r\n config.LOG_LEVEL_NONE = 999;\r\n /**\r\n * Global log level.\r\n * @default {@link LOG_LEVEL_WARNING}\r\n */\r\n config.logLevel = true ? config.LOG_LEVEL_WARNING : undefined;\r\n /**\r\n * Enabling sound for motions.\r\n */\r\n config.sound = true;\r\n /**\r\n * Deferring motion and corresponding sound until both are loaded.\r\n */\r\n config.motionSync = true;\r\n /**\r\n * Default fading duration for motions without such value specified.\r\n */\r\n config.motionFadingDuration = 500;\r\n /**\r\n * Default fading duration for idle motions without such value specified.\r\n */\r\n config.idleMotionFadingDuration = 2000;\r\n /**\r\n * Default fading duration for expressions without such value specified.\r\n */\r\n config.expressionFadingDuration = 500;\r\n})(config || (config = {}));\r\n/**\r\n * Consistent with the `version` in package.json.\r\n */\r\nconst VERSION = \"0.3.1\";\r\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE__2__;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return Live2DLoader; });\n/* harmony import */ var _factory_XHRLoader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);\n/* harmony import */ var _utils_middleware__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16);\n\r\n\r\nclass Live2DLoader {\r\n /**\r\n * Loads a resource.\r\n * @return Promise that resolves with the loaded data in a format that's consistent with the specified `type`.\r\n */\r\n static load(context) {\r\n return Object(_utils_middleware__WEBPACK_IMPORTED_MODULE_1__[/* runMiddlewares */ \"a\"])(this.middlewares, context).then(() => context.result);\r\n }\r\n}\r\nLive2DLoader.middlewares = [_factory_XHRLoader__WEBPACK_IMPORTED_MODULE_0__[/* XHRLoader */ \"a\"].loader];\r\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, \"a\", function() { return /* binding */ Live2DFactory_Live2DFactory; });\n\n// EXTERNAL MODULE: ./src/cubism-common/index.ts\nvar cubism_common = __webpack_require__(6);\n\n// EXTERNAL MODULE: ./src/factory/Live2DLoader.ts\nvar Live2DLoader = __webpack_require__(3);\n\n// EXTERNAL MODULE: ./src/utils/index.ts + 4 modules\nvar utils = __webpack_require__(0);\n\n// EXTERNAL MODULE: ./src/utils/middleware.ts\nvar middleware = __webpack_require__(16);\n\n// EXTERNAL MODULE: external {\"commonjs\":\"@pixi/core\",\"commonjs2\":\"@pixi/core\",\"amd\":\"@pixi/core\",\"root\":\"PIXI\"}\nvar core_root_PIXI_ = __webpack_require__(17);\n\n// CONCATENATED MODULE: ./src/factory/texture.ts\n\r\nfunction createTexture(url, options = {}) {\r\n var _a;\r\n const textureOptions = { resourceOptions: { crossorigin: options.crossOrigin } };\r\n // there's already such a method since Pixi v5.3.0\r\n if (core_root_PIXI_[\"Texture\"].fromURL) {\r\n return core_root_PIXI_[\"Texture\"].fromURL(url, textureOptions).catch(e => {\r\n if (e instanceof Error) {\r\n throw e;\r\n }\r\n // assume e is an ErrorEvent, let's convert it to an Error\r\n const err = new Error('Texture loading error');\r\n err.event = e;\r\n throw err;\r\n });\r\n }\r\n // and in order to provide backward compatibility for older Pixi versions,\r\n // we have to manually implement this method\r\n // see https://github.com/pixijs/pixi.js/pull/6687/files\r\n textureOptions.resourceOptions.autoLoad = false;\r\n const texture = core_root_PIXI_[\"Texture\"].from(url, textureOptions);\r\n if (texture.baseTexture.valid) {\r\n return Promise.resolve(texture);\r\n }\r\n const resource = texture.baseTexture.resource;\r\n // before Pixi v5.2.2, the Promise will not be rejected when loading has failed,\r\n // we have to manually handle the \"error\" event\r\n // see https://github.com/pixijs/pixi.js/pull/6374\r\n (_a = resource._live2d_load) !== null && _a !== void 0 ? _a : (resource._live2d_load = new Promise((resolve, reject) => {\r\n const errorHandler = (event) => {\r\n resource.source.removeEventListener('error', errorHandler);\r\n // convert the ErrorEvent to an Error\r\n const err = new Error('Texture loading error');\r\n err.event = event;\r\n reject(err);\r\n };\r\n resource.source.addEventListener('error', errorHandler);\r\n resource.load().then(() => resolve(texture)).catch(errorHandler);\r\n }));\r\n return resource._live2d_load;\r\n}\r\n\n// CONCATENATED MODULE: ./src/factory/model-middlewares.ts\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\n\r\n\r\n\r\n\r\n\r\nconst TAG = 'Live2DFactory';\r\n/**\r\n * A middleware that converts the source from a URL to a settings JSON object.\r\n */\r\nconst urlToJSON = (context, next) => __awaiter(void 0, void 0, void 0, function* () {\r\n if (typeof context.source === 'string') {\r\n const data = yield Live2DLoader[\"a\" /* Live2DLoader */].load({\r\n url: context.source,\r\n type: 'json',\r\n target: context.live2dModel,\r\n });\r\n data.url = context.source;\r\n context.source = data;\r\n context.live2dModel.emit('settingsJSONLoaded', data);\r\n }\r\n return next();\r\n});\r\n/**\r\n * A middleware that converts the source from a settings JSON object to a ModelSettings instance.\r\n */\r\nconst jsonToSettings = (context, next) => __awaiter(void 0, void 0, void 0, function* () {\r\n if (context.source instanceof cubism_common[\"f\" /* ModelSettings */]) {\r\n context.settings = context.source;\r\n return next();\r\n }\r\n else if (typeof context.source === 'object') {\r\n const runtime = Live2DFactory_Live2DFactory.findRuntime(context.source);\r\n if (runtime) {\r\n const settings = runtime.createModelSettings(context.source);\r\n context.settings = settings;\r\n context.live2dModel.emit('settingsLoaded', settings);\r\n return next();\r\n }\r\n }\r\n throw new TypeError('Unknown settings format.');\r\n});\r\nconst waitUntilReady = (context, next) => {\r\n if (context.settings) {\r\n const runtime = Live2DFactory_Live2DFactory.findRuntime(context.settings);\r\n if (runtime) {\r\n return runtime.ready().then(next);\r\n }\r\n }\r\n return next();\r\n};\r\n/**\r\n * A middleware that populates the Live2DModel with optional resources.\r\n * Requires InternalModel in context when all the subsequent middlewares have finished.\r\n */\r\nconst setupOptionals = (context, next) => __awaiter(void 0, void 0, void 0, function* () {\r\n // wait until all has finished\r\n yield next();\r\n const internalModel = context.internalModel;\r\n if (internalModel) {\r\n const settings = context.settings;\r\n const runtime = Live2DFactory_Live2DFactory.findRuntime(settings);\r\n if (runtime) {\r\n const tasks = [];\r\n if (settings.pose) {\r\n tasks.push(Live2DLoader[\"a\" /* Live2DLoader */].load({\r\n settings,\r\n url: settings.pose,\r\n type: 'json',\r\n target: internalModel,\r\n })\r\n .then((data) => {\r\n internalModel.pose = runtime.createPose(internalModel.coreModel, data);\r\n context.live2dModel.emit('poseLoaded', internalModel.pose);\r\n })\r\n .catch((e) => utils[\"f\" /* logger */].warn(TAG, 'Failed to load pose.\\n', e)));\r\n }\r\n if (settings.physics) {\r\n tasks.push(Live2DLoader[\"a\" /* Live2DLoader */].load({\r\n settings,\r\n url: settings.physics,\r\n type: 'json',\r\n target: internalModel,\r\n })\r\n .then((data) => {\r\n internalModel.physics = runtime.createPhysics(internalModel.coreModel, data);\r\n context.live2dModel.emit('physicsLoaded', internalModel.physics);\r\n })\r\n .catch((e) => utils[\"f\" /* logger */].warn(TAG, 'Failed to load physics.\\n', e)));\r\n }\r\n if (tasks.length) {\r\n yield Promise.all(tasks);\r\n }\r\n }\r\n }\r\n});\r\n/**\r\n * A middleware that populates the Live2DModel with essential resources.\r\n * Requires ModelSettings in context immediately, and InternalModel in context\r\n * when all the subsequent middlewares have finished.\r\n */\r\nconst setupEssentials = (context, next) => __awaiter(void 0, void 0, void 0, function* () {\r\n if (context.settings) {\r\n const live2DModel = context.live2dModel;\r\n const textureLoadings = context.settings.textures.map(tex => {\r\n const url = context.settings.resolveURL(tex);\r\n return createTexture(url, { crossOrigin: context.options.crossOrigin });\r\n });\r\n // wait for the internal model to be created\r\n yield next();\r\n if (context.internalModel) {\r\n live2DModel.internalModel = context.internalModel;\r\n live2DModel.emit('modelLoaded', context.internalModel);\r\n }\r\n else {\r\n throw new TypeError('Missing internal model.');\r\n }\r\n live2DModel.textures = yield Promise.all(textureLoadings);\r\n live2DModel.emit('textureLoaded', live2DModel.textures);\r\n }\r\n else {\r\n throw new TypeError('Missing settings.');\r\n }\r\n});\r\n/**\r\n * A middleware that creates the InternalModel. Requires ModelSettings in context.\r\n */\r\nconst createInternalModel = (context, next) => __awaiter(void 0, void 0, void 0, function* () {\r\n const settings = context.settings;\r\n if (settings instanceof cubism_common[\"f\" /* ModelSettings */]) {\r\n const runtime = Live2DFactory_Live2DFactory.findRuntime(settings);\r\n if (!runtime) {\r\n throw new TypeError('Unknown model settings.');\r\n }\r\n const modelData = yield Live2DLoader[\"a\" /* Live2DLoader */].load({\r\n settings,\r\n url: settings.moc,\r\n type: 'arraybuffer',\r\n target: context.live2dModel,\r\n });\r\n if (!runtime.isValidMoc(modelData)) {\r\n throw new Error('Invalid moc data');\r\n }\r\n const coreModel = runtime.createCoreModel(modelData);\r\n context.internalModel = runtime.createInternalModel(coreModel, settings, context.options);\r\n return next();\r\n }\r\n throw new TypeError('Missing settings.');\r\n});\r\n\n// CONCATENATED MODULE: ./src/factory/Live2DFactory.ts\nvar Live2DFactory_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\n\r\n\r\n\r\n\r\n\r\n/**\r\n * Handles all the network load tasks.\r\n *\r\n * - Model creation: requested by {@link Live2DModel.from}.\r\n * - Motion loading: implements the load method of MotionManager.\r\n * - Expression loading: implements the load method of ExpressionManager.\r\n */\r\nclass Live2DFactory_Live2DFactory {\r\n /**\r\n * Registers a Live2DRuntime.\r\n */\r\n static registerRuntime(runtime) {\r\n Live2DFactory_Live2DFactory.runtimes.push(runtime);\r\n // higher version as higher priority\r\n Live2DFactory_Live2DFactory.runtimes.sort((a, b) => b.version - a.version);\r\n }\r\n /**\r\n * Finds a runtime that matches given source.\r\n * @param source - Either a settings JSON object or a ModelSettings instance.\r\n * @return The Live2DRuntime, or undefined if not found.\r\n */\r\n static findRuntime(source) {\r\n for (const runtime of Live2DFactory_Live2DFactory.runtimes) {\r\n if (runtime.test(source)) {\r\n return runtime;\r\n }\r\n }\r\n }\r\n /**\r\n * Sets up a Live2DModel, populating it with all defined resources.\r\n * @param live2dModel - The Live2DModel instance.\r\n * @param source - Can be one of: settings file URL, settings JSON object, ModelSettings instance.\r\n * @param options - Options for the process.\r\n * @return Promise that resolves when all resources have been loaded, rejects when error occurs.\r\n */\r\n static setupLive2DModel(live2dModel, source, options) {\r\n return Live2DFactory_awaiter(this, void 0, void 0, function* () {\r\n const textureLoaded = new Promise(resolve => live2dModel.once('textureLoaded', resolve));\r\n const modelLoaded = new Promise(resolve => live2dModel.once('modelLoaded', resolve));\r\n // because the \"ready\" event is supposed to be emitted after\r\n // both the internal model and textures have been loaded,\r\n // we should here wrap the emit() in a then() so it'll\r\n // be executed after all the handlers of \"modelLoaded\" and \"textureLoaded\"\r\n const readyEventEmitted = Promise.all([textureLoaded, modelLoaded]).then(() => live2dModel.emit('ready'));\r\n yield Object(middleware[\"a\" /* runMiddlewares */])(Live2DFactory_Live2DFactory.live2DModelMiddlewares, {\r\n live2dModel,\r\n source,\r\n options: options || {},\r\n });\r\n // the \"load\" event should never be emitted before \"ready\"\r\n yield readyEventEmitted;\r\n live2dModel.emit('load');\r\n });\r\n }\r\n /**\r\n * Loads a Motion and registers the task to {@link motionTasksMap}. The task will be automatically\r\n * canceled when its owner - the MotionManager instance - has been destroyed.\r\n * @param motionManager - MotionManager that owns this Motion.\r\n * @param group - The motion group.\r\n * @param index - Index in the motion group.\r\n * @return Promise that resolves with the Motion, or with undefined if it can't be loaded.\r\n */\r\n static loadMotion(motionManager, group, index) {\r\n var _a, _b;\r\n // errors in this method are always handled\r\n const handleError = (e) => motionManager.emit('motionLoadError', group, index, e);\r\n try {\r\n const definition = (_a = motionManager.definitions[group]) === null || _a === void 0 ? void 0 : _a[index];\r\n if (!definition) {\r\n return Promise.resolve(undefined);\r\n }\r\n if (!motionManager.listeners('destroy').includes(Live2DFactory_Live2DFactory.releaseTasks)) {\r\n motionManager.once('destroy', Live2DFactory_Live2DFactory.releaseTasks);\r\n }\r\n let tasks = Live2DFactory_Live2DFactory.motionTasksMap.get(motionManager);\r\n if (!tasks) {\r\n tasks = {};\r\n Live2DFactory_Live2DFactory.motionTasksMap.set(motionManager, tasks);\r\n }\r\n let taskGroup = tasks[group];\r\n if (!taskGroup) {\r\n taskGroup = [];\r\n tasks[group] = taskGroup;\r\n }\r\n const path = motionManager.getMotionFile(definition);\r\n (_b = taskGroup[index]) !== null && _b !== void 0 ? _b : (taskGroup[index] = Live2DLoader[\"a\" /* Live2DLoader */].load({\r\n url: path,\r\n settings: motionManager.settings,\r\n type: motionManager.motionDataType,\r\n target: motionManager,\r\n })\r\n .then(data => {\r\n var _a;\r\n const taskGroup = (_a = Live2DFactory_Live2DFactory.motionTasksMap.get(motionManager)) === null || _a === void 0 ? void 0 : _a[group];\r\n if (taskGroup) {\r\n delete taskGroup[index];\r\n }\r\n const motion = motionManager.createMotion(data, group, definition);\r\n motionManager.emit('motionLoaded', group, index, motion);\r\n return motion;\r\n })\r\n .catch(e => {\r\n utils[\"f\" /* logger */].warn(motionManager.tag, `Failed to load motion: ${path}\\n`, e);\r\n handleError(e);\r\n }));\r\n return taskGroup[index];\r\n }\r\n catch (e) {\r\n utils[\"f\" /* logger */].warn(motionManager.tag, `Failed to load motion at \"${group}\"[${index}]\\n`, e);\r\n handleError(e);\r\n }\r\n return Promise.resolve(undefined);\r\n }\r\n /**\r\n * Loads an Expression and registers the task to {@link expressionTasksMap}. The task will be automatically\r\n * canceled when its owner - the ExpressionManager instance - has been destroyed.\r\n * @param expressionManager - ExpressionManager that owns this Expression.\r\n * @param index - Index of the Expression.\r\n * @return Promise that resolves with the Expression, or with undefined if it can't be loaded.\r\n */\r\n static loadExpression(expressionManager, index) {\r\n var _a;\r\n // errors in this method are always handled\r\n const handleError = (e) => expressionManager.emit('expressionLoadError', index, e);\r\n try {\r\n const definition = expressionManager.definitions[index];\r\n if (!definition) {\r\n return Promise.resolve(undefined);\r\n }\r\n if (!expressionManager.listeners('destroy').includes(Live2DFactory_Live2DFactory.releaseTasks)) {\r\n expressionManager.once('destroy', Live2DFactory_Live2DFactory.releaseTasks);\r\n }\r\n let tasks = Live2DFactory_Live2DFactory.expressionTasksMap.get(expressionManager);\r\n if (!tasks) {\r\n tasks = [];\r\n Live2DFactory_Live2DFactory.expressionTasksMap.set(expressionManager, tasks);\r\n }\r\n const path = expressionManager.getExpressionFile(definition);\r\n (_a = tasks[index]) !== null && _a !== void 0 ? _a : (tasks[index] = Live2DLoader[\"a\" /* Live2DLoader */].load({\r\n url: path,\r\n settings: expressionManager.settings,\r\n type: 'json',\r\n target: expressionManager,\r\n })\r\n .then(data => {\r\n const tasks = Live2DFactory_Live2DFactory.expressionTasksMap.get(expressionManager);\r\n if (tasks) {\r\n delete tasks[index];\r\n }\r\n const expression = expressionManager.createExpression(data, definition);\r\n expressionManager.emit('expressionLoaded', index, expression);\r\n return expression;\r\n })\r\n .catch(e => {\r\n utils[\"f\" /* logger */].warn(expressionManager.tag, `Failed to load expression: ${path}\\n`, e);\r\n handleError(e);\r\n }));\r\n return tasks[index];\r\n }\r\n catch (e) {\r\n utils[\"f\" /* logger */].warn(expressionManager.tag, `Failed to load expression at [${index}]\\n`, e);\r\n handleError(e);\r\n }\r\n return Promise.resolve(undefined);\r\n }\r\n static releaseTasks() {\r\n if (this instanceof cubism_common[\"g\" /* MotionManager */]) {\r\n Live2DFactory_Live2DFactory.motionTasksMap.delete(this);\r\n }\r\n else {\r\n Live2DFactory_Live2DFactory.expressionTasksMap.delete(this);\r\n }\r\n }\r\n}\r\n/**\r\n * All registered runtimes, sorted by versions in descending order.\r\n */\r\nLive2DFactory_Live2DFactory.runtimes = [];\r\nLive2DFactory_Live2DFactory.urlToJSON = urlToJSON;\r\nLive2DFactory_Live2DFactory.jsonToSettings = jsonToSettings;\r\nLive2DFactory_Live2DFactory.waitUntilReady = waitUntilReady;\r\nLive2DFactory_Live2DFactory.setupOptionals = setupOptionals;\r\nLive2DFactory_Live2DFactory.setupEssentials = setupEssentials;\r\nLive2DFactory_Live2DFactory.createInternalModel = createInternalModel;\r\n/**\r\n * Middlewares to run through when setting up a Live2DModel.\r\n */\r\nLive2DFactory_Live2DFactory.live2DModelMiddlewares = [\r\n urlToJSON, jsonToSettings, waitUntilReady, setupOptionals, setupEssentials, createInternalModel,\r\n];\r\n/**\r\n * load tasks of each motion. The structure of each value in this map\r\n * is the same as respective {@link MotionManager.definitions}.\r\n */\r\nLive2DFactory_Live2DFactory.motionTasksMap = new WeakMap();\r\n/**\r\n * Load tasks of each expression.\r\n */\r\nLive2DFactory_Live2DFactory.expressionTasksMap = new WeakMap();\r\ncubism_common[\"g\" /* MotionManager */].prototype._loadMotion = function (group, index) {\r\n return Live2DFactory_Live2DFactory.loadMotion(this, group, index);\r\n};\r\ncubism_common[\"a\" /* ExpressionManager */].prototype._loadExpression = function (index) {\r\n return Live2DFactory_Live2DFactory.loadExpression(this, index);\r\n};\r\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE__5__;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"d\", function() { return _constants__WEBPACK_IMPORTED_MODULE_0__[\"a\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"e\", function() { return _constants__WEBPACK_IMPORTED_MODULE_0__[\"b\"]; });\n\n/* harmony import */ var _ExpressionManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10);\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return _ExpressionManager__WEBPACK_IMPORTED_MODULE_1__[\"a\"]; });\n\n/* harmony import */ var _FocusController__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(14);\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return _FocusController__WEBPACK_IMPORTED_MODULE_2__[\"a\"]; });\n\n/* harmony import */ var _ModelSettings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(11);\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"f\", function() { return _ModelSettings__WEBPACK_IMPORTED_MODULE_3__[\"a\"]; });\n\n/* harmony import */ var _MotionState__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9);\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"i\", function() { return _MotionState__WEBPACK_IMPORTED_MODULE_4__[\"a\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"j\", function() { return _MotionState__WEBPACK_IMPORTED_MODULE_4__[\"b\"]; });\n\n/* harmony import */ var _MotionManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(12);\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"g\", function() { return _MotionManager__WEBPACK_IMPORTED_MODULE_5__[\"a\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"h\", function() { return _MotionManager__WEBPACK_IMPORTED_MODULE_5__[\"b\"]; });\n\n/* harmony import */ var _SoundManager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7);\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"k\", function() { return _SoundManager__WEBPACK_IMPORTED_MODULE_6__[\"a\"]; });\n\n/* harmony import */ var _InternalModel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(13);\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return _InternalModel__WEBPACK_IMPORTED_MODULE_7__[\"a\"]; });\n\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return SoundManager; });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);\n/* harmony import */ var lodash_pull__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19);\n/* harmony import */ var lodash_pull__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_pull__WEBPACK_IMPORTED_MODULE_1__);\n\r\n\r\nconst TAG = 'SoundManager';\r\nconst VOLUME = 0.5;\r\n/**\r\n * Manages all the sounds.\r\n */\r\nclass SoundManager {\r\n /**\r\n * Global volume that applies to all the sounds.\r\n */\r\n static get volume() {\r\n return this._volume;\r\n }\r\n static set volume(value) {\r\n this._volume = (value > 1 ? 1 : value < 0 ? 0 : value) || 0;\r\n this.audios.forEach(audio => (audio.volume = this._volume));\r\n }\r\n // TODO: return an ID?\r\n /**\r\n * Creates an audio element and adds it to the {@link audios}.\r\n * @param file - URL of the sound file.\r\n * @param onFinish - Callback invoked when the playback has finished.\r\n * @param onError - Callback invoked when error occurs.\r\n * @return Created audio element.\r\n */\r\n static add(file, onFinish, onError) {\r\n const audio = new Audio(file);\r\n audio.volume = this._volume;\r\n audio.preload = 'auto';\r\n audio.addEventListener('ended', () => {\r\n this.dispose(audio);\r\n onFinish === null || onFinish === void 0 ? void 0 : onFinish();\r\n });\r\n audio.addEventListener('error', (e) => {\r\n this.dispose(audio);\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].warn(TAG, `Error occurred on \"${file}\"`, e.error);\r\n onError === null || onError === void 0 ? void 0 : onError(e.error);\r\n });\r\n this.audios.push(audio);\r\n return audio;\r\n }\r\n /**\r\n * Plays the sound.\r\n * @param audio - An audio element.\r\n * @return Promise that resolves when the audio is ready to play, rejects when error occurs.\r\n */\r\n static play(audio) {\r\n return new Promise((resolve, reject) => {\r\n var _a;\r\n // see https://developers.google.com/web/updates/2017/09/autoplay-policy-changes\r\n (_a = audio.play()) === null || _a === void 0 ? void 0 : _a.catch(e => {\r\n audio.dispatchEvent(new ErrorEvent('error', { error: e }));\r\n reject(e);\r\n });\r\n if (audio.readyState === audio.HAVE_ENOUGH_DATA) {\r\n resolve();\r\n }\r\n else {\r\n audio.addEventListener('canplaythrough', resolve);\r\n }\r\n });\r\n }\r\n /**\r\n * Disposes an audio element and removes it from {@link audios}.\r\n * @param audio - An audio element.\r\n */\r\n static dispose(audio) {\r\n audio.pause();\r\n audio.removeAttribute('src');\r\n lodash_pull__WEBPACK_IMPORTED_MODULE_1___default()(this.audios, audio);\r\n }\r\n /**\r\n * Destroys all managed audios.\r\n */\r\n static destroy() {\r\n // dispose() removes given audio from the array, so the loop must be backward\r\n for (let i = this.audios.length - 1; i >= 0; i--) {\r\n this.dispose(this.audios[i]);\r\n }\r\n }\r\n}\r\n/**\r\n * Audio elements playing or pending to play. Finished audios will be removed automatically.\r\n */\r\nSoundManager.audios = [];\r\nSoundManager._volume = VOLUME;\r\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return LOGICAL_WIDTH; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return LOGICAL_HEIGHT; });\nconst LOGICAL_WIDTH = 2;\r\nconst LOGICAL_HEIGHT = 2;\r\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return MotionPriority; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return MotionState; });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);\n\r\n/**\r\n * Indicates the motion priority.\r\n */\r\nvar MotionPriority;\r\n(function (MotionPriority) {\r\n /** States that the model is currently not playing any motion. This priority cannot be applied to a motion. */\r\n MotionPriority[MotionPriority[\"NONE\"] = 0] = \"NONE\";\r\n /** Low priority, used when starting idle motions automatically. */\r\n MotionPriority[MotionPriority[\"IDLE\"] = 1] = \"IDLE\";\r\n /** Medium priority. */\r\n MotionPriority[MotionPriority[\"NORMAL\"] = 2] = \"NORMAL\";\r\n /** High priority. Motions as this priority will always be played regardless of the current priority. */\r\n MotionPriority[MotionPriority[\"FORCE\"] = 3] = \"FORCE\";\r\n})(MotionPriority || (MotionPriority = {}));\r\n/**\r\n * Handles the state of a MotionManager.\r\n */\r\nclass MotionState {\r\n constructor() {\r\n /**\r\n * When enabled, the states will be dumped to the logger when an exception occurs.\r\n */\r\n this.debug = false;\r\n /**\r\n * Priority of the current motion. Will be `MotionPriority.NONE` if there's no playing motion.\r\n */\r\n this.currentPriority = MotionPriority.NONE;\r\n /**\r\n * Priority of the reserved motion, which is still in loading and will be played once loaded.\r\n * Will be `MotionPriority.NONE` if there's no reserved motion.\r\n */\r\n this.reservePriority = MotionPriority.NONE;\r\n }\r\n /**\r\n * Reserves the playback for a motion.\r\n * @param group - The motion group.\r\n * @param index - Index in the motion group.\r\n * @param priority - The priority to be applied.\r\n * @return True if the reserving has succeeded.\r\n */\r\n reserve(group, index, priority) {\r\n if (priority <= MotionPriority.NONE) {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].log(this.tag, `Cannot start a motion with MotionPriority.NONE.`);\r\n return false;\r\n }\r\n if (group === this.currentGroup && index === this.currentIndex) {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].log(this.tag, `Motion is already playing.`, this.dump(group, index));\r\n return false;\r\n }\r\n if ((group === this.reservedGroup && index === this.reservedIndex) || (group === this.reservedIdleGroup && index === this.reservedIdleIndex)) {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].log(this.tag, `Motion is already reserved.`, this.dump(group, index));\r\n return false;\r\n }\r\n if (priority === MotionPriority.IDLE) {\r\n if (this.currentPriority !== MotionPriority.NONE) {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].log(this.tag, `Cannot start idle motion because another motion is playing.`, this.dump(group, index));\r\n return false;\r\n }\r\n if (this.reservedIdleGroup !== undefined) {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].log(this.tag, `Cannot start idle motion because another idle motion has reserved.`, this.dump(group, index));\r\n return false;\r\n }\r\n this.setReservedIdle(group, index);\r\n }\r\n else {\r\n if (priority < MotionPriority.FORCE) {\r\n if (priority <= this.currentPriority) {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].log(this.tag, 'Cannot start motion because another motion is playing as an equivalent or higher priority.', this.dump(group, index));\r\n return false;\r\n }\r\n if (priority <= this.reservePriority) {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].log(this.tag, 'Cannot start motion because another motion has reserved as an equivalent or higher priority.', this.dump(group, index));\r\n return false;\r\n }\r\n }\r\n this.setReserved(group, index, priority);\r\n }\r\n return true;\r\n }\r\n /**\r\n * Requests the playback for a motion.\r\n * @param motion - The Motion, can be undefined.\r\n * @param group - The motion group.\r\n * @param index - Index in the motion group.\r\n * @param priority - The priority to be applied.\r\n * @return True if the request has been approved, i.e. the motion is allowed to play.\r\n */\r\n start(motion, group, index, priority) {\r\n if (priority === MotionPriority.IDLE) {\r\n this.setReservedIdle(undefined, undefined);\r\n if (this.currentPriority !== MotionPriority.NONE) {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].log(this.tag, 'Cannot start idle motion because another motion is playing.', this.dump(group, index));\r\n return false;\r\n }\r\n }\r\n else {\r\n if (group !== this.reservedGroup || index !== this.reservedIndex) {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].log(this.tag, 'Cannot start motion because another motion has taken the place.', this.dump(group, index));\r\n return false;\r\n }\r\n this.setReserved(undefined, undefined, MotionPriority.NONE);\r\n }\r\n if (!motion) {\r\n return false;\r\n }\r\n this.setCurrent(group, index, priority);\r\n return true;\r\n }\r\n /**\r\n * Notifies the motion playback has finished.\r\n */\r\n complete() {\r\n this.setCurrent(undefined, undefined, MotionPriority.NONE);\r\n }\r\n /**\r\n * Sets the current motion.\r\n */\r\n setCurrent(group, index, priority) {\r\n this.currentPriority = priority;\r\n this.currentGroup = group;\r\n this.currentIndex = index;\r\n }\r\n /**\r\n * Sets the reserved motion.\r\n */\r\n setReserved(group, index, priority) {\r\n this.reservePriority = priority;\r\n this.reservedGroup = group;\r\n this.reservedIndex = index;\r\n }\r\n /**\r\n * Sets the reserved idle motion.\r\n */\r\n setReservedIdle(group, index) {\r\n this.reservedIdleGroup = group;\r\n this.reservedIdleIndex = index;\r\n }\r\n /**\r\n * Checks if a Motion is currently playing or has reserved.\r\n * @return True if active.\r\n */\r\n isActive(group, index) {\r\n return (group === this.currentGroup && index === this.currentIndex)\r\n || (group === this.reservedGroup && index === this.reservedIndex)\r\n || (group === this.reservedIdleGroup && index === this.reservedIdleIndex);\r\n }\r\n /**\r\n * Resets the state.\r\n */\r\n reset() {\r\n this.setCurrent(undefined, undefined, MotionPriority.NONE);\r\n // make sure the reserved motions (if existing) won't start when they are loaded\r\n this.setReserved(undefined, undefined, MotionPriority.NONE);\r\n this.setReservedIdle(undefined, undefined);\r\n }\r\n /**\r\n * Checks if an idle motion should be requests to play.\r\n */\r\n shouldRequestIdleMotion() {\r\n return this.currentGroup === undefined && this.reservedIdleGroup === undefined;\r\n }\r\n /**\r\n * Checks if the model's expression should be overridden by the motion.\r\n */\r\n shouldOverrideExpression() {\r\n return this.currentPriority > MotionPriority.IDLE;\r\n }\r\n /**\r\n * Dumps the state for debugging.\r\n */\r\n dump(requestedGroup, requestedIndex) {\r\n if (this.debug) {\r\n const keys = [\r\n 'currentPriority',\r\n 'reservePriority',\r\n 'currentGroup',\r\n 'currentIndex',\r\n 'reservedGroup',\r\n 'reservedIndex',\r\n 'reservedIdleGroup',\r\n 'reservedIdleIndex',\r\n ];\r\n return `\\n group = \"${requestedGroup}\", index = ${requestedIndex}\\n` + keys.map(key => '[' + key + '] ' + this[key]).join('\\n');\r\n }\r\n return '';\r\n }\r\n}\r\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return ExpressionManager; });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);\n/* harmony import */ var _pixi_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);\n/* harmony import */ var _pixi_utils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_pixi_utils__WEBPACK_IMPORTED_MODULE_1__);\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\n\r\n\r\n/**\r\n * Abstract expression manager.\r\n * @emits {@link ExpressionManagerEvents}\r\n */\r\nclass ExpressionManager extends _pixi_utils__WEBPACK_IMPORTED_MODULE_1__[\"EventEmitter\"] {\r\n constructor(settings, options) {\r\n super();\r\n /**\r\n * The Expressions. The structure is the same as {@link definitions}, initially there's only\r\n * an empty array, which means all expressions will be `undefined`. When an Expression has\r\n * been loaded, it'll fill the place in which it should be; when it fails to load,\r\n * the place will be filled with `null`.\r\n */\r\n this.expressions = [];\r\n /**\r\n * The pending Expression.\r\n */\r\n this.reserveExpressionIndex = -1;\r\n /**\r\n * Flags the instance has been destroyed.\r\n */\r\n this.destroyed = false;\r\n this.settings = settings;\r\n this.tag = `ExpressionManager(${settings.name})`;\r\n }\r\n /**\r\n * Should be called in the constructor of derived class.\r\n */\r\n init() {\r\n this.defaultExpression = this.createExpression({}, undefined);\r\n this.currentExpression = this.defaultExpression;\r\n this.stopAllExpressions();\r\n }\r\n /**\r\n * Loads an Expression. Errors in this method will not be thrown,\r\n * but be emitted with an \"expressionLoadError\" event.\r\n * @param index - Index of the expression in definitions.\r\n * @return Promise that resolves with the Expression, or with undefined if it can't be loaded.\r\n * @emits {@link ExpressionManagerEvents.expressionLoaded}\r\n * @emits {@link ExpressionManagerEvents.expressionLoadError}\r\n */\r\n loadExpression(index) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n if (!this.definitions[index]) {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].warn(this.tag, `Undefined expression at [${index}]`);\r\n return undefined;\r\n }\r\n if (this.expressions[index] === null) {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].warn(this.tag, `Cannot set expression at [${index}] because it's already failed in loading.`);\r\n return undefined;\r\n }\r\n if (this.expressions[index]) {\r\n return this.expressions[index];\r\n }\r\n const expression = yield this._loadExpression(index);\r\n this.expressions[index] = expression;\r\n return expression;\r\n });\r\n }\r\n /**\r\n * Loads the Expression. Will be implemented by Live2DFactory.\r\n * @ignore\r\n */\r\n _loadExpression(index) {\r\n throw new Error('Not implemented.');\r\n }\r\n /**\r\n * Sets a random Expression that differs from current one.\r\n * @return Promise that resolves with true if succeeded, with false otherwise.\r\n */\r\n setRandomExpression() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n if (this.definitions.length) {\r\n const availableIndices = [];\r\n for (let i = 0; i < this.definitions.length; i++) {\r\n if (this.expressions[i] !== null\r\n && this.expressions[i] !== this.currentExpression\r\n && i !== this.reserveExpressionIndex) {\r\n availableIndices.push(i);\r\n }\r\n }\r\n if (availableIndices.length) {\r\n const index = Math.floor(Math.random() * availableIndices.length);\r\n return this.setExpression(index);\r\n }\r\n }\r\n return false;\r\n });\r\n }\r\n /**\r\n * Resets model's expression using {@link defaultExpression}.\r\n */\r\n resetExpression() {\r\n this._setExpression(this.defaultExpression);\r\n }\r\n /**\r\n * Restores model's expression to {@link currentExpression}.\r\n */\r\n restoreExpression() {\r\n this._setExpression(this.currentExpression);\r\n }\r\n /**\r\n * Sets an Expression.\r\n * @param index - Either the index, or the name of the expression.\r\n * @return Promise that resolves with true if succeeded, with false otherwise.\r\n */\r\n setExpression(index) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n if (typeof index !== 'number') {\r\n index = this.getExpressionIndex(index);\r\n }\r\n if (!(index > -1 && index < this.definitions.length)) {\r\n return false;\r\n }\r\n if (index === this.expressions.indexOf(this.currentExpression)) {\r\n return false;\r\n }\r\n this.reserveExpressionIndex = index;\r\n const expression = yield this.loadExpression(index);\r\n if (!expression || this.reserveExpressionIndex !== index) {\r\n return false;\r\n }\r\n this.reserveExpressionIndex = -1;\r\n this.currentExpression = expression;\r\n this._setExpression(expression);\r\n return true;\r\n });\r\n }\r\n /**\r\n * Updates parameters of the core model.\r\n * @return True if the parameters are actually updated.\r\n */\r\n update(model, now) {\r\n if (!this.isFinished()) {\r\n return this.updateParameters(model, now);\r\n }\r\n return false;\r\n }\r\n /**\r\n * Destroys the instance.\r\n * @emits {@link ExpressionManagerEvents.destroy}\r\n */\r\n destroy() {\r\n this.destroyed = true;\r\n this.emit('destroy');\r\n const self = this;\r\n self.definitions = undefined;\r\n self.expressions = undefined;\r\n }\r\n}\r\n\n\n/***/ }),\n/* 11 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return ModelSettings; });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);\n/* harmony import */ var _pixi_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);\n/* harmony import */ var _pixi_utils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_pixi_utils__WEBPACK_IMPORTED_MODULE_1__);\n\r\n\r\n/**\r\n * Parses, and provides access to the settings JSON.\r\n */\r\nclass ModelSettings {\r\n /**\r\n * @param json - The settings JSON object.\r\n * @param json.url - The `url` field must be defined to specify the settings file's URL.\r\n */\r\n constructor(json) {\r\n this.json = json;\r\n let url = json.url;\r\n if (typeof url !== 'string') {\r\n // this is not allowed because it'll typically result in errors, including a\r\n // fatal error - an OOM that crashes the browser while initializing this cubism2 model,\r\n // I'm not kidding!\r\n throw new TypeError('The `url` field in settings JSON must be defined as a string.');\r\n }\r\n this.url = url;\r\n // set default name to folder's name\r\n this.name = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* folderName */ \"e\"])(this.url);\r\n }\r\n /**\r\n * Resolves a relative path using the {@link url}. This is used to resolve the resource files\r\n * defined in the settings.\r\n * @param path - Relative path.\r\n * @return Resolved path.\r\n */\r\n resolveURL(path) {\r\n return _pixi_utils__WEBPACK_IMPORTED_MODULE_1__[\"url\"].resolve(this.url, path);\r\n }\r\n /**\r\n * Replaces the resource files by running each file through the `replacer`.\r\n * @param replacer - Invoked with two arguments: `(file, path)`, where `file` is the file definition,\r\n * and `path` is its property path in the ModelSettings instance. A string must be returned to be the replacement.\r\n *\r\n * ```js\r\n * modelSettings.replaceFiles((file, path) => {\r\n * // file = \"foo.moc\", path = \"moc\"\r\n * // file = \"foo.png\", path = \"textures[0]\"\r\n * // file = \"foo.mtn\", path = \"motions.idle[0].file\"\r\n * // file = \"foo.motion3.json\", path = \"motions.idle[0].File\"\r\n *\r\n * return \"bar/\" + file;\r\n * });\r\n * ```\r\n */\r\n replaceFiles(replacer) {\r\n this.moc = replacer(this.moc, 'moc');\r\n if (this.pose !== undefined) {\r\n (this.pose = replacer(this.pose, 'pose'));\r\n }\r\n if (this.physics !== undefined) {\r\n (this.physics = replacer(this.physics, 'physics'));\r\n }\r\n for (let i = 0; i < this.textures.length; i++) {\r\n this.textures[i] = replacer(this.textures[i], `textures[${i}]`);\r\n }\r\n }\r\n ;\r\n /**\r\n * Retrieves all resource files defined in the settings.\r\n * @return A flat array of the paths of all resource files.\r\n *\r\n * ```js\r\n * modelSettings.getDefinedFiles();\r\n * // returns: [\"foo.moc\", \"foo.png\", ...]\r\n * ```\r\n */\r\n getDefinedFiles() {\r\n const files = [];\r\n this.replaceFiles((file) => {\r\n files.push(file);\r\n return file;\r\n });\r\n return files;\r\n }\r\n /**\r\n * Validates that the files defined in the settings exist in given files. Each file will be\r\n * resolved by {@link resolveURL} before comparison.\r\n * @param files - A flat array of file paths.\r\n * @return All the files which are defined in the settings and also exist in given files,\r\n * *including the optional files*.\r\n * @throws Error if any *essential* file is defined in settings but not included in given files.\r\n */\r\n validateFiles(files) {\r\n const assertFileExists = (expectedFile, shouldThrow) => {\r\n const actualPath = this.resolveURL(expectedFile);\r\n if (!files.includes(actualPath)) {\r\n if (shouldThrow) {\r\n throw new Error(`File \"${expectedFile}\" is defined in settings, but doesn't exist in given files`);\r\n }\r\n return false;\r\n }\r\n return true;\r\n };\r\n const essentialFiles = [this.moc, ...this.textures];\r\n essentialFiles.forEach(texture => assertFileExists(texture, true));\r\n const definedFiles = this.getDefinedFiles();\r\n return definedFiles.filter(file => assertFileExists(file, false));\r\n }\r\n}\r\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return MotionPreloadStrategy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return MotionManager; });\n/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);\n/* harmony import */ var _cubism_common_MotionState__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);\n/* harmony import */ var _cubism_common_SoundManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(0);\n/* harmony import */ var _pixi_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2);\n/* harmony import */ var _pixi_utils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_pixi_utils__WEBPACK_IMPORTED_MODULE_4__);\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\n\r\n\r\n\r\n\r\n\r\n/**\r\n * Indicates how the motions will be preloaded.\r\n */\r\nvar MotionPreloadStrategy;\r\n(function (MotionPreloadStrategy) {\r\n /** Preload all the motions. */\r\n MotionPreloadStrategy[\"ALL\"] = \"ALL\";\r\n /** Preload only the idle motions. */\r\n MotionPreloadStrategy[\"IDLE\"] = \"IDLE\";\r\n /** No preload. */\r\n MotionPreloadStrategy[\"NONE\"] = \"NONE\";\r\n})(MotionPreloadStrategy || (MotionPreloadStrategy = {}));\r\n/**\r\n * Handles the motion playback.\r\n * @emits {@link MotionManagerEvents}\r\n */\r\nclass MotionManager extends _pixi_utils__WEBPACK_IMPORTED_MODULE_4__[\"EventEmitter\"] {\r\n constructor(settings, options) {\r\n super();\r\n /**\r\n * The Motions. The structure is the same as {@link definitions}, initially each group contains\r\n * an empty array, which means all motions will be `undefined`. When a Motion has been loaded,\r\n * it'll fill the place in which it should be; when it fails to load, the place will be filled\r\n * with `null`.\r\n */\r\n this.motionGroups = {};\r\n /**\r\n * Maintains the state of this MotionManager.\r\n */\r\n this.state = new _cubism_common_MotionState__WEBPACK_IMPORTED_MODULE_1__[/* MotionState */ \"b\"]();\r\n /**\r\n * Flags there's a motion playing.\r\n */\r\n this.playing = false;\r\n /**\r\n * Flags the instances has been destroyed.\r\n */\r\n this.destroyed = false;\r\n this.settings = settings;\r\n this.tag = `MotionManager(${settings.name})`;\r\n this.state.tag = this.tag;\r\n }\r\n /**\r\n * Should be called in the constructor of derived class.\r\n */\r\n init(options) {\r\n if (options === null || options === void 0 ? void 0 : options.idleMotionGroup) {\r\n this.groups.idle = options.idleMotionGroup;\r\n }\r\n this.setupMotions(options);\r\n this.stopAllMotions();\r\n }\r\n /**\r\n * Sets up motions from the definitions, and preloads them according to the preload strategy.\r\n */\r\n setupMotions(options) {\r\n for (const group of Object.keys(this.definitions)) {\r\n // init with the same structure of definitions\r\n this.motionGroups[group] = [];\r\n }\r\n // preload motions\r\n let groups;\r\n switch (options === null || options === void 0 ? void 0 : options.motionPreload) {\r\n case MotionPreloadStrategy.NONE:\r\n return;\r\n case MotionPreloadStrategy.ALL:\r\n groups = Object.keys(this.definitions);\r\n break;\r\n case MotionPreloadStrategy.IDLE:\r\n default:\r\n groups = [this.groups.idle];\r\n break;\r\n }\r\n for (const group of groups) {\r\n if (this.definitions[group]) {\r\n for (let i = 0; i < this.definitions[group].length; i++) {\r\n this.loadMotion(group, i).then();\r\n }\r\n }\r\n }\r\n }\r\n /**\r\n * Loads a Motion in a motion group. Errors in this method will not be thrown,\r\n * but be emitted with a \"motionLoadError\" event.\r\n * @param group - The motion group.\r\n * @param index - Index in the motion group.\r\n * @return Promise that resolves with the Motion, or with undefined if it can't be loaded.\r\n * @emits {@link MotionManagerEvents.motionLoaded}\r\n * @emits {@link MotionManagerEvents.motionLoadError}\r\n */\r\n loadMotion(group, index) {\r\n var _a;\r\n return __awaiter(this, void 0, void 0, function* () {\r\n if (!((_a = this.definitions[group]) === null || _a === void 0 ? void 0 : _a[index])) {\r\n _utils__WEBPACK_IMPORTED_MODULE_3__[/* logger */ \"f\"].warn(this.tag, `Undefined motion at \"${group}\"[${index}]`);\r\n return undefined;\r\n }\r\n if (this.motionGroups[group][index] === null) {\r\n _utils__WEBPACK_IMPORTED_MODULE_3__[/* logger */ \"f\"].warn(this.tag, `Cannot start motion at \"${group}\"[${index}] because it's already failed in loading.`);\r\n return undefined;\r\n }\r\n if (this.motionGroups[group][index]) {\r\n return this.motionGroups[group][index];\r\n }\r\n const motion = yield this._loadMotion(group, index);\r\n if (this.destroyed) {\r\n return;\r\n }\r\n this.motionGroups[group][index] = motion !== null && motion !== void 0 ? motion : null;\r\n return motion;\r\n });\r\n }\r\n // TODO: remove\r\n /**\r\n * Loads the Motion. Will be implemented by Live2DFactory.\r\n * @ignore\r\n */\r\n _loadMotion(group, index) {\r\n throw new Error('Not implemented.');\r\n }\r\n /**\r\n * Starts a motion as given priority.\r\n * @param group - The motion group.\r\n * @param index - Index in the motion group.\r\n * @param priority - The priority to be applied.\r\n * @return Promise that resolves with true if the motion is successfully started, with false otherwise.\r\n */\r\n startMotion(group, index, priority = _cubism_common_MotionState__WEBPACK_IMPORTED_MODULE_1__[/* MotionPriority */ \"a\"].NORMAL) {\r\n var _a;\r\n return __awaiter(this, void 0, void 0, function* () {\r\n if (!this.state.reserve(group, index, priority)) {\r\n return false;\r\n }\r\n const definition = (_a = this.definitions[group]) === null || _a === void 0 ? void 0 : _a[index];\r\n if (!definition) {\r\n return false;\r\n }\r\n if (this.currentAudio) {\r\n // TODO: reuse the audio?\r\n _cubism_common_SoundManager__WEBPACK_IMPORTED_MODULE_2__[/* SoundManager */ \"a\"].dispose(this.currentAudio);\r\n }\r\n let audio;\r\n if (_config__WEBPACK_IMPORTED_MODULE_0__[/* config */ \"b\"].sound) {\r\n const soundURL = this.getSoundFile(definition);\r\n if (soundURL) {\r\n try {\r\n // start to load the audio\r\n audio = _cubism_common_SoundManager__WEBPACK_IMPORTED_MODULE_2__[/* SoundManager */ \"a\"].add(this.settings.resolveURL(soundURL), () => this.currentAudio = undefined, () => this.currentAudio = undefined);\r\n this.currentAudio = audio;\r\n }\r\n catch (e) {\r\n _utils__WEBPACK_IMPORTED_MODULE_3__[/* logger */ \"f\"].warn(this.tag, 'Failed to create audio', soundURL, e);\r\n }\r\n }\r\n }\r\n const motion = yield this.loadMotion(group, index);\r\n if (audio) {\r\n const readyToPlay = _cubism_common_SoundManager__WEBPACK_IMPORTED_MODULE_2__[/* SoundManager */ \"a\"].play(audio)\r\n .catch(e => _utils__WEBPACK_IMPORTED_MODULE_3__[/* logger */ \"f\"].warn(this.tag, 'Failed to play audio', audio.src, e));\r\n if (_config__WEBPACK_IMPORTED_MODULE_0__[/* config */ \"b\"].motionSync) {\r\n // wait until the audio is ready\r\n yield readyToPlay;\r\n }\r\n }\r\n if (!this.state.start(motion, group, index, priority)) {\r\n if (audio) {\r\n _cubism_common_SoundManager__WEBPACK_IMPORTED_MODULE_2__[/* SoundManager */ \"a\"].dispose(audio);\r\n this.currentAudio = undefined;\r\n }\r\n return false;\r\n }\r\n _utils__WEBPACK_IMPORTED_MODULE_3__[/* logger */ \"f\"].log(this.tag, 'Start motion:', this.getMotionName(definition));\r\n this.emit('motionStart', group, index, audio);\r\n if (this.state.shouldOverrideExpression()) {\r\n this.expressionManager && this.expressionManager.resetExpression();\r\n }\r\n this.playing = true;\r\n this._startMotion(motion);\r\n return true;\r\n });\r\n }\r\n /**\r\n * Starts a random Motion as given priority.\r\n * @param group - The motion group.\r\n * @param priority - The priority to be applied.\r\n * @return Promise that resolves with true if the motion is successfully started, with false otherwise.\r\n */\r\n startRandomMotion(group, priority) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n const groupDefs = this.definitions[group];\r\n if (groupDefs === null || groupDefs === void 0 ? void 0 : groupDefs.length) {\r\n const availableIndices = [];\r\n for (let i = 0; i < groupDefs.length; i++) {\r\n if (this.motionGroups[group][i] !== null && !this.state.isActive(group, i)) {\r\n availableIndices.push(i);\r\n }\r\n }\r\n if (availableIndices.length) {\r\n const index = Math.floor(Math.random() * availableIndices.length);\r\n return this.startMotion(group, availableIndices[index], priority);\r\n }\r\n }\r\n return false;\r\n });\r\n }\r\n /**\r\n * Stops all playing motions as well as the sound.\r\n */\r\n stopAllMotions() {\r\n this._stopAllMotions();\r\n this.state.reset();\r\n if (this.currentAudio) {\r\n _cubism_common_SoundManager__WEBPACK_IMPORTED_MODULE_2__[/* SoundManager */ \"a\"].dispose(this.currentAudio);\r\n this.currentAudio = undefined;\r\n }\r\n }\r\n /**\r\n * Updates parameters of the core model.\r\n * @param model - The core model.\r\n * @param now - Current time in milliseconds.\r\n * @return True if the parameters have been actually updated.\r\n */\r\n update(model, now) {\r\n var _a, _b;\r\n if (this.isFinished()) {\r\n if (this.playing) {\r\n this.playing = false;\r\n this.emit('motionFinish');\r\n }\r\n if (this.state.shouldOverrideExpression()) {\r\n (_a = this.expressionManager) === null || _a === void 0 ? void 0 : _a.restoreExpression();\r\n }\r\n this.state.complete();\r\n if (this.state.shouldRequestIdleMotion()) {\r\n // noinspection JSIgnoredPromiseFromCall\r\n this.startRandomMotion(this.groups.idle, _cubism_common_MotionState__WEBPACK_IMPORTED_MODULE_1__[/* MotionPriority */ \"a\"].IDLE);\r\n }\r\n }\r\n let updated = this.updateParameters(model, now);\r\n updated = ((_b = this.expressionManager) === null || _b === void 0 ? void 0 : _b.update(model, now)) || updated;\r\n return updated;\r\n }\r\n /**\r\n * Destroys the instance.\r\n * @emits {@link MotionManagerEvents.destroy}\r\n */\r\n destroy() {\r\n var _a;\r\n this.destroyed = true;\r\n this.emit('destroy');\r\n this.stopAllMotions();\r\n (_a = this.expressionManager) === null || _a === void 0 ? void 0 : _a.destroy();\r\n const self = this;\r\n self.definitions = undefined;\r\n self.motionGroups = undefined;\r\n }\r\n}\r\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return InternalModel; });\n/* harmony import */ var _cubism_common_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);\n/* harmony import */ var _cubism_common_FocusController__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14);\n/* harmony import */ var _pixi_math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5);\n/* harmony import */ var _pixi_math__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_pixi_math__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _pixi_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2);\n/* harmony import */ var _pixi_utils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_pixi_utils__WEBPACK_IMPORTED_MODULE_3__);\n\r\n\r\n\r\n\r\nconst tempBounds = { x: 0, y: 0, width: 0, height: 0 };\r\n/**\r\n * A wrapper that manages the states of a Live2D core model, and delegates all operations to it.\r\n * @emits {@link InternalModelEvents}\r\n */\r\nclass InternalModel extends _pixi_utils__WEBPACK_IMPORTED_MODULE_3__[\"EventEmitter\"] {\r\n constructor() {\r\n super(...arguments);\r\n this.focusController = new _cubism_common_FocusController__WEBPACK_IMPORTED_MODULE_1__[/* FocusController */ \"a\"]();\r\n /**\r\n * Original canvas width of the model. Note this doesn't represent the model's real size,\r\n * as the model can overflow from its canvas.\r\n */\r\n this.originalWidth = 0;\r\n /**\r\n * Original canvas height of the model. Note this doesn't represent the model's real size,\r\n * as the model can overflow from its canvas.\r\n */\r\n this.originalHeight = 0;\r\n /**\r\n * Canvas width of the model, scaled by the `width` of the model's layout.\r\n */\r\n this.width = 0;\r\n /**\r\n * Canvas height of the model, scaled by the `height` of the model's layout.\r\n */\r\n this.height = 0;\r\n /**\r\n * Local transformation, calculated from the model's layout.\r\n */\r\n this.localTransform = new _pixi_math__WEBPACK_IMPORTED_MODULE_2__[\"Matrix\"]();\r\n /**\r\n * The final matrix to draw the model.\r\n */\r\n this.drawingMatrix = new _pixi_math__WEBPACK_IMPORTED_MODULE_2__[\"Matrix\"]();\r\n // TODO: change structure\r\n /**\r\n * The hit area definitions, keyed by their names.\r\n */\r\n this.hitAreas = {};\r\n /**\r\n * Flags whether `gl.UNPACK_FLIP_Y_WEBGL` should be enabled when binding the textures.\r\n */\r\n this.textureFlipY = false;\r\n /**\r\n * WebGL viewport when drawing the model. The format is `[x, y, width, height]`.\r\n */\r\n this.viewport = [0, 0, 0, 0];\r\n /**\r\n * Flags this instance has been destroyed.\r\n */\r\n this.destroyed = false;\r\n }\r\n /**\r\n * Should be called in the constructor of derived class.\r\n */\r\n init() {\r\n this.setupLayout();\r\n this.setupHitAreas();\r\n }\r\n /**\r\n * Sets up the model's size and local transform by the model's layout.\r\n */\r\n setupLayout() {\r\n // cast `this` to be mutable\r\n const self = this;\r\n const size = this.getSize();\r\n self.originalWidth = size[0];\r\n self.originalHeight = size[1];\r\n const layout = Object.assign({\r\n width: _cubism_common_constants__WEBPACK_IMPORTED_MODULE_0__[/* LOGICAL_WIDTH */ \"b\"],\r\n height: _cubism_common_constants__WEBPACK_IMPORTED_MODULE_0__[/* LOGICAL_HEIGHT */ \"a\"],\r\n }, this.getLayout());\r\n this.localTransform.scale(layout.width / _cubism_common_constants__WEBPACK_IMPORTED_MODULE_0__[/* LOGICAL_WIDTH */ \"b\"], layout.height / _cubism_common_constants__WEBPACK_IMPORTED_MODULE_0__[/* LOGICAL_HEIGHT */ \"a\"]);\r\n self.width = this.originalWidth * this.localTransform.a;\r\n self.height = this.originalHeight * this.localTransform.d;\r\n // this calculation differs from Live2D SDK...\r\n const offsetX = (layout.x !== undefined && layout.x - layout.width / 2)\r\n || (layout.centerX !== undefined && layout.centerX)\r\n || (layout.left !== undefined && layout.left - layout.width / 2)\r\n || (layout.right !== undefined && layout.right + layout.width / 2)\r\n || 0;\r\n const offsetY = (layout.y !== undefined && layout.y - layout.height / 2)\r\n || (layout.centerY !== undefined && layout.centerY)\r\n || (layout.top !== undefined && layout.top - layout.height / 2)\r\n || (layout.bottom !== undefined && layout.bottom + layout.height / 2)\r\n || 0;\r\n this.localTransform.translate(this.width * offsetX, -this.height * offsetY);\r\n }\r\n /**\r\n * Sets up the hit areas by their definitions in settings.\r\n */\r\n setupHitAreas() {\r\n const definitions = this.getHitAreaDefs().filter(hitArea => hitArea.index >= 0);\r\n for (const def of definitions) {\r\n this.hitAreas[def.name] = def;\r\n }\r\n }\r\n /**\r\n * Hit-test on the model.\r\n * @param x - Position in model canvas.\r\n * @param y - Position in model canvas.\r\n * @return The names of the *hit* hit areas. Can be empty if none is hit.\r\n */\r\n hitTest(x, y) {\r\n return Object.keys(this.hitAreas).filter(hitAreaName => this.isHit(hitAreaName, x, y));\r\n }\r\n /**\r\n * Hit-test for a single hit area.\r\n * @param hitAreaName - The hit area's name.\r\n * @param x - Position in model canvas.\r\n * @param y - Position in model canvas.\r\n * @return True if hit.\r\n */\r\n isHit(hitAreaName, x, y) {\r\n if (!this.hitAreas[hitAreaName]) {\r\n return false;\r\n }\r\n const drawIndex = this.hitAreas[hitAreaName].index;\r\n const bounds = this.getDrawableBounds(drawIndex, tempBounds);\r\n return bounds.x <= x && x <= bounds.x + bounds.width && bounds.y <= y && y <= bounds.y + bounds.height;\r\n }\r\n /**\r\n * Gets a drawable's bounds.\r\n * @param index - Index of the drawable.\r\n * @param bounds - Object to store the output values.\r\n * @return The bounds in model canvas space.\r\n */\r\n getDrawableBounds(index, bounds) {\r\n const vertices = this.getDrawableVertices(index);\r\n let left = vertices[0];\r\n let right = vertices[0];\r\n let top = vertices[1];\r\n let bottom = vertices[1];\r\n for (let i = 0; i < vertices.length; i += 2) {\r\n const vx = vertices[i];\r\n const vy = vertices[i + 1];\r\n left = Math.min(vx, left);\r\n right = Math.max(vx, right);\r\n top = Math.min(vy, top);\r\n bottom = Math.max(vy, bottom);\r\n }\r\n bounds !== null && bounds !== void 0 ? bounds : (bounds = {});\r\n bounds.x = left;\r\n bounds.y = top;\r\n bounds.width = right - left;\r\n bounds.height = bottom - top;\r\n return bounds;\r\n }\r\n /**\r\n * Updates the model's transform.\r\n * @param transform - The world transform.\r\n */\r\n updateTransform(transform) {\r\n this.drawingMatrix.copyFrom(transform).append(this.localTransform);\r\n }\r\n /**\r\n * Updates the model's parameters.\r\n * @param dt - Elapsed time in milliseconds from last frame.\r\n * @param now - Current time in milliseconds.\r\n */\r\n update(dt, now) {\r\n this.focusController.update(dt);\r\n }\r\n ;\r\n /**\r\n * Destroys the model and all related resources.\r\n * @emits {@link InternalModelEvents.destroy | destroy}\r\n */\r\n destroy() {\r\n this.destroyed = true;\r\n this.emit('destroy');\r\n this.motionManager.destroy();\r\n this.motionManager = undefined;\r\n }\r\n}\r\n\n\n/***/ }),\n/* 14 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return FocusController; });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);\n\r\n// Minimum distance to respond\r\nconst EPSILON = 0.01;\r\nconst MAX_SPEED = 40 / 7.5;\r\n// the time to accelerate to max speed\r\nconst ACCELERATION_TIME = 1 / (0.15 * 1000);\r\n/**\r\n * Interpolates the transition of focus position.\r\n */\r\nclass FocusController {\r\n constructor() {\r\n /** The focus position. */\r\n this.targetX = 0;\r\n /** The focus position. */\r\n this.targetY = 0;\r\n /** Current position. */\r\n this.x = 0;\r\n /** Current position. */\r\n this.y = 0;\r\n /** Current velocity. */\r\n this.vx = 0;\r\n /** Current velocity. */\r\n this.vy = 0;\r\n }\r\n /**\r\n * Sets the focus position.\r\n * @param x - X position in range `[-1, 1]`.\r\n * @param y - Y position in range `[-1, 1]`.\r\n * @param instant - Should the focus position be instantly applied.\r\n */\r\n focus(x, y, instant = false) {\r\n this.targetX = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* clamp */ \"b\"])(x, -1, 1);\r\n this.targetY = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* clamp */ \"b\"])(y, -1, 1);\r\n if (instant) {\r\n this.x = this.targetX;\r\n this.y = this.targetY;\r\n }\r\n }\r\n /**\r\n * Updates the interpolation.\r\n * @param dt - Delta time in milliseconds.\r\n */\r\n update(dt) {\r\n const dx = this.targetX - this.x;\r\n const dy = this.targetY - this.y;\r\n if (Math.abs(dx) < EPSILON && Math.abs(dy) < EPSILON)\r\n return;\r\n const d = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));\r\n const maxSpeed = MAX_SPEED / (1000 / dt);\r\n let ax = maxSpeed * (dx / d) - this.vx;\r\n let ay = maxSpeed * (dy / d) - this.vy;\r\n const a = Math.sqrt(Math.pow(ax, 2) + Math.pow(ay, 2));\r\n const maxA = maxSpeed * ACCELERATION_TIME * dt;\r\n if (a > maxA) {\r\n ax *= maxA / a;\r\n ay *= maxA / a;\r\n }\r\n this.vx += ax;\r\n this.vy += ay;\r\n const v = Math.sqrt(Math.pow(this.vx, 2) + Math.pow(this.vy, 2));\r\n const maxV = 0.5 * (Math.sqrt(Math.pow(maxA, 2) + 8 * maxA * d) - maxA);\r\n if (v > maxV) {\r\n this.vx *= maxV / v;\r\n this.vy *= maxV / v;\r\n }\r\n this.x += this.vx;\r\n this.y += this.vy;\r\n }\r\n}\r\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return XHRLoader; });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);\n\r\nconst TAG = 'XHRLoader';\r\nclass NetworkError extends Error {\r\n constructor(message, url, status, aborted = false) {\r\n super(message);\r\n this.url = url;\r\n this.status = status;\r\n this.aborted = aborted;\r\n }\r\n}\r\n/**\r\n * The basic XHR loader.\r\n *\r\n * A network error will be thrown with the following properties:\r\n * - `url` - The request URL.\r\n * - `status` - The HTTP status.\r\n * - `aborted` - True if the error is caused by aborting the XHR.\r\n */\r\nclass XHRLoader {\r\n /**\r\n * Creates a managed XHR.\r\n * @param target - If provided, the XHR will be canceled when receiving an \"destroy\" event from the target.\r\n * @param url - The URL.\r\n * @param type - The XHR response type.\r\n * @param onload - Load listener.\r\n * @param onerror - Error handler.\r\n */\r\n static createXHR(target, url, type, onload, onerror) {\r\n const xhr = new XMLHttpRequest();\r\n XHRLoader.allXhrSet.add(xhr);\r\n if (target) {\r\n let xhrSet = XHRLoader.xhrMap.get(target);\r\n if (!xhrSet) {\r\n xhrSet = new Set([xhr]);\r\n XHRLoader.xhrMap.set(target, xhrSet);\r\n }\r\n else {\r\n xhrSet.add(xhr);\r\n }\r\n if (!target.listeners('destroy').includes(XHRLoader.cancelXHRs)) {\r\n target.once('destroy', XHRLoader.cancelXHRs);\r\n }\r\n }\r\n xhr.open('GET', url);\r\n xhr.responseType = type;\r\n xhr.onload = () => {\r\n if ((xhr.status === 200 || xhr.status === 0) && xhr.response) {\r\n onload(xhr.response);\r\n }\r\n else {\r\n xhr.onerror();\r\n }\r\n };\r\n xhr.onerror = () => {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].warn(TAG, `Failed to load resource as ${xhr.responseType} (Status ${xhr.status}): ${url}`);\r\n onerror(new NetworkError('Network error.', url, xhr.status));\r\n };\r\n xhr.onabort = () => onerror(new NetworkError('Aborted.', url, xhr.status, true));\r\n xhr.onloadend = () => {\r\n var _a;\r\n XHRLoader.allXhrSet.delete(xhr);\r\n if (target) {\r\n (_a = XHRLoader.xhrMap.get(target)) === null || _a === void 0 ? void 0 : _a.delete(xhr);\r\n }\r\n };\r\n return xhr;\r\n }\r\n /**\r\n * Cancels all XHRs related to this target.\r\n */\r\n static cancelXHRs() {\r\n var _a;\r\n (_a = XHRLoader.xhrMap.get(this)) === null || _a === void 0 ? void 0 : _a.forEach(xhr => {\r\n xhr.abort();\r\n XHRLoader.allXhrSet.delete(xhr);\r\n });\r\n XHRLoader.xhrMap.delete(this);\r\n }\r\n /**\r\n * Release all XHRs.\r\n */\r\n static release() {\r\n XHRLoader.allXhrSet.forEach(xhr => xhr.abort());\r\n XHRLoader.allXhrSet.clear();\r\n XHRLoader.xhrMap = new WeakMap();\r\n }\r\n}\r\n/**\r\n * All the created XHRs, keyed by their owners respectively.\r\n */\r\nXHRLoader.xhrMap = new WeakMap();\r\n/**\r\n * All the created XHRs as a flat array.\r\n */\r\nXHRLoader.allXhrSet = new Set();\r\n/**\r\n * Middleware for Live2DLoader.\r\n */\r\nXHRLoader.loader = (context, next) => {\r\n return new Promise((resolve, reject) => {\r\n const xhr = XHRLoader.createXHR(context.target, context.settings ? context.settings.resolveURL(context.url) : context.url, context.type, data => {\r\n context.result = data;\r\n resolve();\r\n }, reject);\r\n xhr.send();\r\n });\r\n};\r\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return runMiddlewares; });\n/**\r\n * Run middlewares with given context.\r\n * @see https://github.com/koajs/compose/blob/master/index.js\r\n *\r\n * @param middleware\r\n * @param context\r\n */\r\nfunction runMiddlewares(middleware, context) {\r\n // last called middleware #\r\n let index = -1;\r\n return dispatch(0);\r\n function dispatch(i, err) {\r\n if (err)\r\n return Promise.reject(err);\r\n if (i <= index)\r\n return Promise.reject(new Error('next() called multiple times'));\r\n index = i;\r\n const fn = middleware[i];\r\n if (!fn)\r\n return Promise.resolve();\r\n try {\r\n return Promise.resolve(fn(context, dispatch.bind(null, i + 1)));\r\n }\r\n catch (err) {\r\n return Promise.reject(err);\r\n }\r\n }\r\n}\r\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE__17__;\n\n/***/ }),\n/* 18 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, \"g\", function() { return /* reexport */ cubism_common[\"e\" /* LOGICAL_WIDTH */]; });\n__webpack_require__.d(__webpack_exports__, \"f\", function() { return /* reexport */ cubism_common[\"d\" /* LOGICAL_HEIGHT */]; });\n__webpack_require__.d(__webpack_exports__, \"a\", function() { return /* reexport */ cubism_common[\"a\" /* ExpressionManager */]; });\n__webpack_require__.d(__webpack_exports__, \"c\", function() { return /* reexport */ cubism_common[\"b\" /* FocusController */]; });\n__webpack_require__.d(__webpack_exports__, \"l\", function() { return /* reexport */ cubism_common[\"f\" /* ModelSettings */]; });\n__webpack_require__.d(__webpack_exports__, \"o\", function() { return /* reexport */ cubism_common[\"i\" /* MotionPriority */]; });\n__webpack_require__.d(__webpack_exports__, \"p\", function() { return /* reexport */ cubism_common[\"j\" /* MotionState */]; });\n__webpack_require__.d(__webpack_exports__, \"n\", function() { return /* reexport */ cubism_common[\"h\" /* MotionPreloadStrategy */]; });\n__webpack_require__.d(__webpack_exports__, \"m\", function() { return /* reexport */ cubism_common[\"g\" /* MotionManager */]; });\n__webpack_require__.d(__webpack_exports__, \"q\", function() { return /* reexport */ cubism_common[\"k\" /* SoundManager */]; });\n__webpack_require__.d(__webpack_exports__, \"e\", function() { return /* reexport */ cubism_common[\"c\" /* InternalModel */]; });\n__webpack_require__.d(__webpack_exports__, \"j\", function() { return /* reexport */ Live2DModel_Live2DModel; });\n__webpack_require__.d(__webpack_exports__, \"k\", function() { return /* reexport */ Live2DTransform_Live2DTransform; });\n__webpack_require__.d(__webpack_exports__, \"d\", function() { return /* reexport */ InteractionMixin; });\n__webpack_require__.d(__webpack_exports__, \"w\", function() { return /* reexport */ config[\"b\" /* config */]; });\n__webpack_require__.d(__webpack_exports__, \"r\", function() { return /* reexport */ config[\"a\" /* VERSION */]; });\n__webpack_require__.d(__webpack_exports__, \"h\", function() { return /* reexport */ Live2DFactory[\"a\" /* Live2DFactory */]; });\n__webpack_require__.d(__webpack_exports__, \"i\", function() { return /* reexport */ Live2DLoader[\"a\" /* Live2DLoader */]; });\n__webpack_require__.d(__webpack_exports__, \"s\", function() { return /* reexport */ XHRLoader[\"a\" /* XHRLoader */]; });\n__webpack_require__.d(__webpack_exports__, \"b\", function() { return /* reexport */ FileLoader_FileLoader; });\n__webpack_require__.d(__webpack_exports__, \"t\", function() { return /* reexport */ ZipLoader_ZipLoader; });\n__webpack_require__.d(__webpack_exports__, \"A\", function() { return /* reexport */ utils[\"f\" /* logger */]; });\n__webpack_require__.d(__webpack_exports__, \"v\", function() { return /* reexport */ utils[\"b\" /* clamp */]; });\n__webpack_require__.d(__webpack_exports__, \"B\", function() { return /* reexport */ utils[\"g\" /* rand */]; });\n__webpack_require__.d(__webpack_exports__, \"y\", function() { return /* reexport */ utils[\"d\" /* copyProperty */]; });\n__webpack_require__.d(__webpack_exports__, \"x\", function() { return /* reexport */ utils[\"c\" /* copyArray */]; });\n__webpack_require__.d(__webpack_exports__, \"u\", function() { return /* reexport */ utils[\"a\" /* applyMixins */]; });\n__webpack_require__.d(__webpack_exports__, \"z\", function() { return /* reexport */ utils[\"e\" /* folderName */]; });\n\n// EXTERNAL MODULE: ./src/cubism-common/index.ts\nvar cubism_common = __webpack_require__(6);\n\n// EXTERNAL MODULE: ./src/factory/Live2DFactory.ts + 2 modules\nvar Live2DFactory = __webpack_require__(4);\n\n// EXTERNAL MODULE: external {\"commonjs\":\"@pixi/display\",\"commonjs2\":\"@pixi/display\",\"amd\":\"@pixi/display\",\"root\":\"PIXI\"}\nvar display_root_PIXI_ = __webpack_require__(20);\n\n// EXTERNAL MODULE: external {\"commonjs\":\"@pixi/math\",\"commonjs2\":\"@pixi/math\",\"amd\":\"@pixi/math\",\"root\":\"PIXI\"}\nvar math_root_PIXI_ = __webpack_require__(5);\n\n// CONCATENATED MODULE: ./src/InteractionMixin.ts\n/**\r\n * The interaction control split from Live2DModel class for code clarity. This mixin should *only*\r\n * be used on the Live2DModel.\r\n */\r\nclass InteractionMixin {\r\n constructor() {\r\n this._autoInteract = false;\r\n }\r\n /**\r\n * Enables automatic interaction. Only takes effect if Pixi's interaction\r\n * feature has been enabled (by registering the `PIXI.InteractionManager` into `PIXI.Renderer`).\r\n */\r\n get autoInteract() {\r\n return this._autoInteract;\r\n }\r\n set autoInteract(autoInteract) {\r\n if (autoInteract !== this._autoInteract) {\r\n if (autoInteract) {\r\n this.on('pointertap', onTap, this);\r\n }\r\n else {\r\n this.off('pointertap', onTap, this);\r\n }\r\n this._autoInteract = autoInteract;\r\n }\r\n }\r\n /**\r\n * Registers interaction by subscribing to the `PIXI.InteractionManager`.\r\n */\r\n registerInteraction(manager) {\r\n if (manager !== this.interactionManager) {\r\n this.unregisterInteraction();\r\n if (this._autoInteract && manager) {\r\n this.interactionManager = manager;\r\n manager.on('pointermove', onPointerMove, this);\r\n }\r\n }\r\n }\r\n /**\r\n * Unregisters interaction.\r\n */\r\n unregisterInteraction() {\r\n var _a;\r\n if (this.interactionManager) {\r\n (_a = this.interactionManager) === null || _a === void 0 ? void 0 : _a.off('pointermove', onPointerMove, this);\r\n this.interactionManager = undefined;\r\n }\r\n }\r\n}\r\nfunction onTap(event) {\r\n this.tap(event.data.global.x, event.data.global.y);\r\n}\r\nfunction onPointerMove(event) {\r\n this.focus(event.data.global.x, event.data.global.y);\r\n}\r\n\n// CONCATENATED MODULE: ./src/Live2DTransform.ts\n\r\n/**\r\n * Useless class. May be useful in the future.\r\n */\r\nclass Live2DTransform_Live2DTransform extends math_root_PIXI_[\"Transform\"] {\r\n}\r\n\n// EXTERNAL MODULE: ./src/utils/index.ts + 4 modules\nvar utils = __webpack_require__(0);\n\n// CONCATENATED MODULE: ./src/Live2DModel.ts\nvar _a;\r\n\r\n\r\n\r\n\r\n\r\n\r\nconst tempPoint = new math_root_PIXI_[\"Point\"]();\r\nconst tempMatrix = new math_root_PIXI_[\"Matrix\"]();\r\n// a reference to Ticker class, defaults to window.PIXI.Ticker (when loaded by a \r\n\r\n\r\n","/*!\n * @pixi/polyfill - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/polyfill is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Polyfill } from 'es6-promise-polyfill';\nimport objectAssign from 'object-assign';\n\n// Support for IE 9 - 11 which does not include Promises\nif (!window.Promise) {\n window.Promise = Polyfill;\n}\n\n// References:\nif (!Object.assign) {\n Object.assign = objectAssign;\n}\n\n// References:\n// http://paulirish.com/2011/requestanimationframe-for-smart-animating/\n// https://gist.github.com/1579671\n// http://updates.html5rocks.com/2012/05/requestAnimationFrame-API-now-with-sub-millisecond-precision\n// https://gist.github.com/timhall/4078614\n// https://github.com/Financial-Times/polyfill-service/tree/master/polyfills/requestAnimationFrame\n// Expected to be used with Browserfiy\n// Browserify automatically detects the use of `global` and passes the\n// correct reference of `global`, `self`, and finally `window`\nvar ONE_FRAME_TIME = 16;\n// Date.now\nif (!(Date.now && Date.prototype.getTime)) {\n Date.now = function now() {\n return new Date().getTime();\n };\n}\n// performance.now\nif (!(window.performance && window.performance.now)) {\n var startTime_1 = Date.now();\n if (!window.performance) {\n window.performance = {};\n }\n window.performance.now = function () { return Date.now() - startTime_1; };\n}\n// requestAnimationFrame\nvar lastTime = Date.now();\nvar vendors = ['ms', 'moz', 'webkit', 'o'];\nfor (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {\n var p = vendors[x];\n window.requestAnimationFrame = window[p + \"RequestAnimationFrame\"];\n window.cancelAnimationFrame = window[p + \"CancelAnimationFrame\"]\n || window[p + \"CancelRequestAnimationFrame\"];\n}\nif (!window.requestAnimationFrame) {\n window.requestAnimationFrame = function (callback) {\n if (typeof callback !== 'function') {\n throw new TypeError(callback + \"is not a function\");\n }\n var currentTime = Date.now();\n var delay = ONE_FRAME_TIME + lastTime - currentTime;\n if (delay < 0) {\n delay = 0;\n }\n lastTime = currentTime;\n return window.setTimeout(function () {\n lastTime = Date.now();\n callback(performance.now());\n }, delay);\n };\n}\nif (!window.cancelAnimationFrame) {\n window.cancelAnimationFrame = function (id) { return clearTimeout(id); };\n}\n\n// References:\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign\nif (!Math.sign) {\n Math.sign = function mathSign(x) {\n x = Number(x);\n if (x === 0 || isNaN(x)) {\n return x;\n }\n return x > 0 ? 1 : -1;\n };\n}\n\n// References:\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger\nif (!Number.isInteger) {\n Number.isInteger = function numberIsInteger(value) {\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\n };\n}\n\nif (!window.ArrayBuffer) {\n window.ArrayBuffer = Array;\n}\nif (!window.Float32Array) {\n window.Float32Array = Array;\n}\nif (!window.Uint32Array) {\n window.Uint32Array = Array;\n}\nif (!window.Uint16Array) {\n window.Uint16Array = Array;\n}\nif (!window.Uint8Array) {\n window.Uint8Array = Array;\n}\nif (!window.Int32Array) {\n window.Int32Array = Array;\n}\n//# sourceMappingURL=polyfill.es.js.map\n","/*!\n * @pixi/accessibility - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/accessibility is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { DisplayObject } from '@pixi/display';\nimport { isMobile, removeItems } from '@pixi/utils';\n\n/**\n * Default property values of accessible objects\n * used by {@link PIXI.AccessibilityManager}.\n *\n * @private\n * @function accessibleTarget\n * @memberof PIXI\n * @type {Object}\n * @example\n * function MyObject() {}\n *\n * Object.assign(\n * MyObject.prototype,\n * PIXI.accessibleTarget\n * );\n */\nvar accessibleTarget = {\n /**\n * Flag for if the object is accessible. If true AccessibilityManager will overlay a\n * shadow div with attributes set\n *\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n accessible: false,\n /**\n * Sets the title attribute of the shadow div\n * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'\n *\n * @member {?string}\n * @memberof PIXI.DisplayObject#\n */\n accessibleTitle: null,\n /**\n * Sets the aria-label attribute of the shadow div\n *\n * @member {string}\n * @memberof PIXI.DisplayObject#\n */\n accessibleHint: null,\n /**\n * @member {number}\n * @memberof PIXI.DisplayObject#\n * @private\n * @todo Needs docs.\n */\n tabIndex: 0,\n /**\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n * @todo Needs docs.\n */\n _accessibleActive: false,\n /**\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n * @todo Needs docs.\n */\n _accessibleDiv: null,\n /**\n * Specify the type of div the accessible layer is. Screen readers treat the element differently\n * depending on this type. Defaults to button.\n *\n * @member {string}\n * @memberof PIXI.DisplayObject#\n * @default 'button'\n */\n accessibleType: 'button',\n /**\n * Specify the pointer-events the accessible div will use\n * Defaults to auto.\n *\n * @member {string}\n * @memberof PIXI.DisplayObject#\n * @default 'auto'\n */\n accessiblePointerEvents: 'auto',\n /**\n * Setting to false will prevent any children inside this container to\n * be accessible. Defaults to true.\n *\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n * @default true\n */\n accessibleChildren: true,\n renderId: -1,\n};\n\n// add some extra variables to the container..\nDisplayObject.mixin(accessibleTarget);\nvar KEY_CODE_TAB = 9;\nvar DIV_TOUCH_SIZE = 100;\nvar DIV_TOUCH_POS_X = 0;\nvar DIV_TOUCH_POS_Y = 0;\nvar DIV_TOUCH_ZINDEX = 2;\nvar DIV_HOOK_SIZE = 1;\nvar DIV_HOOK_POS_X = -1000;\nvar DIV_HOOK_POS_Y = -1000;\nvar DIV_HOOK_ZINDEX = 2;\n/**\n * The Accessibility manager recreates the ability to tab and have content read by screen readers.\n * This is very important as it can possibly help people with disabilities access PixiJS content.\n *\n * A DisplayObject can be made accessible just like it can be made interactive. This manager will map the\n * events as if the mouse was being used, minimizing the effort required to implement.\n *\n * An instance of this class is automatically created by default, and can be found at `renderer.plugins.accessibility`\n *\n * @class\n * @memberof PIXI\n */\nvar AccessibilityManager = /** @class */ (function () {\n /**\n * @param {PIXI.CanvasRenderer|PIXI.Renderer} renderer - A reference to the current renderer\n */\n function AccessibilityManager(renderer) {\n /**\n * @type {?HTMLElement}\n * @private\n */\n this._hookDiv = null;\n if (isMobile.tablet || isMobile.phone) {\n this.createTouchHook();\n }\n // first we create a div that will sit over the PixiJS element. This is where the div overlays will go.\n var div = document.createElement('div');\n div.style.width = DIV_TOUCH_SIZE + \"px\";\n div.style.height = DIV_TOUCH_SIZE + \"px\";\n div.style.position = 'absolute';\n div.style.top = DIV_TOUCH_POS_X + \"px\";\n div.style.left = DIV_TOUCH_POS_Y + \"px\";\n div.style.zIndex = DIV_TOUCH_ZINDEX.toString();\n /**\n * This is the dom element that will sit over the PixiJS element. This is where the div overlays will go.\n *\n * @type {HTMLElement}\n * @private\n */\n this.div = div;\n /**\n * A simple pool for storing divs.\n *\n * @type {*}\n * @private\n */\n this.pool = [];\n /**\n * This is a tick used to check if an object is no longer being rendered.\n *\n * @type {Number}\n * @private\n */\n this.renderId = 0;\n /**\n * Setting this to true will visually show the divs.\n *\n * @type {boolean}\n */\n this.debug = false;\n /**\n * The renderer this accessibility manager works for.\n *\n * @member {PIXI.AbstractRenderer}\n */\n this.renderer = renderer;\n /**\n * The array of currently active accessible items.\n *\n * @member {Array<*>}\n * @private\n */\n this.children = [];\n /**\n * pre-bind the functions\n *\n * @type {Function}\n * @private\n */\n this._onKeyDown = this._onKeyDown.bind(this);\n /**\n * pre-bind the functions\n *\n * @type {Function}\n * @private\n */\n this._onMouseMove = this._onMouseMove.bind(this);\n this._isActive = false;\n this._isMobileAccessibility = false;\n /**\n * count to throttle div updates on android devices\n * @type number\n * @private\n */\n this.androidUpdateCount = 0;\n /**\n * the frequency to update the div elements ()\n * @private\n */\n this.androidUpdateFrequency = 500; // 2fps\n // let listen for tab.. once pressed we can fire up and show the accessibility layer\n window.addEventListener('keydown', this._onKeyDown, false);\n }\n Object.defineProperty(AccessibilityManager.prototype, \"isActive\", {\n /**\n * A flag\n * @member {boolean}\n * @readonly\n */\n get: function () {\n return this._isActive;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AccessibilityManager.prototype, \"isMobileAccessibility\", {\n /**\n * A flag\n * @member {boolean}\n * @readonly\n */\n get: function () {\n return this._isMobileAccessibility;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Creates the touch hooks.\n *\n * @private\n */\n AccessibilityManager.prototype.createTouchHook = function () {\n var _this = this;\n var hookDiv = document.createElement('button');\n hookDiv.style.width = DIV_HOOK_SIZE + \"px\";\n hookDiv.style.height = DIV_HOOK_SIZE + \"px\";\n hookDiv.style.position = 'absolute';\n hookDiv.style.top = DIV_HOOK_POS_X + \"px\";\n hookDiv.style.left = DIV_HOOK_POS_Y + \"px\";\n hookDiv.style.zIndex = DIV_HOOK_ZINDEX.toString();\n hookDiv.style.backgroundColor = '#FF0000';\n hookDiv.title = 'select to enable accessability for this content';\n hookDiv.addEventListener('focus', function () {\n _this._isMobileAccessibility = true;\n _this.activate();\n _this.destroyTouchHook();\n });\n document.body.appendChild(hookDiv);\n this._hookDiv = hookDiv;\n };\n /**\n * Destroys the touch hooks.\n *\n * @private\n */\n AccessibilityManager.prototype.destroyTouchHook = function () {\n if (!this._hookDiv) {\n return;\n }\n document.body.removeChild(this._hookDiv);\n this._hookDiv = null;\n };\n /**\n * Activating will cause the Accessibility layer to be shown.\n * This is called when a user presses the tab key.\n *\n * @private\n */\n AccessibilityManager.prototype.activate = function () {\n if (this._isActive) {\n return;\n }\n this._isActive = true;\n window.document.addEventListener('mousemove', this._onMouseMove, true);\n window.removeEventListener('keydown', this._onKeyDown, false);\n // TODO: Remove casting when CanvasRenderer is converted\n this.renderer.on('postrender', this.update, this);\n if (this.renderer.view.parentNode) {\n this.renderer.view.parentNode.appendChild(this.div);\n }\n };\n /**\n * Deactivating will cause the Accessibility layer to be hidden.\n * This is called when a user moves the mouse.\n *\n * @private\n */\n AccessibilityManager.prototype.deactivate = function () {\n if (!this._isActive || this._isMobileAccessibility) {\n return;\n }\n this._isActive = false;\n window.document.removeEventListener('mousemove', this._onMouseMove, true);\n window.addEventListener('keydown', this._onKeyDown, false);\n // TODO: Remove casting when CanvasRenderer is converted\n this.renderer.off('postrender', this.update);\n if (this.div.parentNode) {\n this.div.parentNode.removeChild(this.div);\n }\n };\n /**\n * This recursive function will run through the scene graph and add any new accessible objects to the DOM layer.\n *\n * @private\n * @param {PIXI.Container} displayObject - The DisplayObject to check.\n */\n AccessibilityManager.prototype.updateAccessibleObjects = function (displayObject) {\n if (!displayObject.visible || !displayObject.accessibleChildren) {\n return;\n }\n if (displayObject.accessible && displayObject.interactive) {\n if (!displayObject._accessibleActive) {\n this.addChild(displayObject);\n }\n displayObject.renderId = this.renderId;\n }\n var children = displayObject.children;\n for (var i = 0; i < children.length; i++) {\n this.updateAccessibleObjects(children[i]);\n }\n };\n /**\n * Before each render this function will ensure that all divs are mapped correctly to their DisplayObjects.\n *\n * @private\n */\n AccessibilityManager.prototype.update = function () {\n /* On Android default web browser, tab order seems to be calculated by position rather than tabIndex,\n * moving buttons can cause focus to flicker between two buttons making it hard/impossible to navigate,\n * so I am just running update every half a second, seems to fix it.\n */\n var now = performance.now();\n if (isMobile.android.device && now < this.androidUpdateCount) {\n return;\n }\n this.androidUpdateCount = now + this.androidUpdateFrequency;\n if (!this.renderer.renderingToScreen) {\n return;\n }\n // update children...\n if (this.renderer._lastObjectRendered) {\n this.updateAccessibleObjects(this.renderer._lastObjectRendered);\n }\n // TODO: Remove casting when CanvasRenderer is converted\n var rect = this.renderer.view.getBoundingClientRect();\n var resolution = this.renderer.resolution;\n var sx = (rect.width / this.renderer.width) * resolution;\n var sy = (rect.height / this.renderer.height) * resolution;\n var div = this.div;\n div.style.left = rect.left + \"px\";\n div.style.top = rect.top + \"px\";\n div.style.width = this.renderer.width + \"px\";\n div.style.height = this.renderer.height + \"px\";\n for (var i = 0; i < this.children.length; i++) {\n var child = this.children[i];\n if (child.renderId !== this.renderId) {\n child._accessibleActive = false;\n removeItems(this.children, i, 1);\n this.div.removeChild(child._accessibleDiv);\n this.pool.push(child._accessibleDiv);\n child._accessibleDiv = null;\n i--;\n }\n else {\n // map div to display..\n div = child._accessibleDiv;\n var hitArea = child.hitArea;\n var wt = child.worldTransform;\n if (child.hitArea) {\n div.style.left = (wt.tx + (hitArea.x * wt.a)) * sx + \"px\";\n div.style.top = (wt.ty + (hitArea.y * wt.d)) * sy + \"px\";\n div.style.width = hitArea.width * wt.a * sx + \"px\";\n div.style.height = hitArea.height * wt.d * sy + \"px\";\n }\n else {\n hitArea = child.getBounds();\n this.capHitArea(hitArea);\n div.style.left = hitArea.x * sx + \"px\";\n div.style.top = hitArea.y * sy + \"px\";\n div.style.width = hitArea.width * sx + \"px\";\n div.style.height = hitArea.height * sy + \"px\";\n // update button titles and hints if they exist and they've changed\n if (div.title !== child.accessibleTitle && child.accessibleTitle !== null) {\n div.title = child.accessibleTitle;\n }\n if (div.getAttribute('aria-label') !== child.accessibleHint\n && child.accessibleHint !== null) {\n div.setAttribute('aria-label', child.accessibleHint);\n }\n }\n // the title or index may have changed, if so lets update it!\n if (child.accessibleTitle !== div.title || child.tabIndex !== div.tabIndex) {\n div.title = child.accessibleTitle;\n div.tabIndex = child.tabIndex;\n if (this.debug)\n { this.updateDebugHTML(div); }\n }\n }\n }\n // increment the render id..\n this.renderId++;\n };\n /**\n * private function that will visually add the information to the\n * accessability div\n *\n * @param {HTMLElement} div\n */\n AccessibilityManager.prototype.updateDebugHTML = function (div) {\n div.innerHTML = \"type: \" + div.type + \"
title : \" + div.title + \"
tabIndex: \" + div.tabIndex;\n };\n /**\n * Adjust the hit area based on the bounds of a display object\n *\n * @param {PIXI.Rectangle} hitArea - Bounds of the child\n */\n AccessibilityManager.prototype.capHitArea = function (hitArea) {\n if (hitArea.x < 0) {\n hitArea.width += hitArea.x;\n hitArea.x = 0;\n }\n if (hitArea.y < 0) {\n hitArea.height += hitArea.y;\n hitArea.y = 0;\n }\n // TODO: Remove casting when CanvasRenderer is converted\n if (hitArea.x + hitArea.width > this.renderer.width) {\n hitArea.width = this.renderer.width - hitArea.x;\n }\n if (hitArea.y + hitArea.height > this.renderer.height) {\n hitArea.height = this.renderer.height - hitArea.y;\n }\n };\n /**\n * Adds a DisplayObject to the accessibility manager\n *\n * @private\n * @param {PIXI.DisplayObject} displayObject - The child to make accessible.\n */\n AccessibilityManager.prototype.addChild = function (displayObject) {\n // this.activate();\n var div = this.pool.pop();\n if (!div) {\n div = document.createElement('button');\n div.style.width = DIV_TOUCH_SIZE + \"px\";\n div.style.height = DIV_TOUCH_SIZE + \"px\";\n div.style.backgroundColor = this.debug ? 'rgba(255,255,255,0.5)' : 'transparent';\n div.style.position = 'absolute';\n div.style.zIndex = DIV_TOUCH_ZINDEX.toString();\n div.style.borderStyle = 'none';\n // ARIA attributes ensure that button title and hint updates are announced properly\n if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {\n // Chrome doesn't need aria-live to work as intended; in fact it just gets more confused.\n div.setAttribute('aria-live', 'off');\n }\n else {\n div.setAttribute('aria-live', 'polite');\n }\n if (navigator.userAgent.match(/rv:.*Gecko\\//)) {\n // FireFox needs this to announce only the new button name\n div.setAttribute('aria-relevant', 'additions');\n }\n else {\n // required by IE, other browsers don't much care\n div.setAttribute('aria-relevant', 'text');\n }\n div.addEventListener('click', this._onClick.bind(this));\n div.addEventListener('focus', this._onFocus.bind(this));\n div.addEventListener('focusout', this._onFocusOut.bind(this));\n }\n // set pointer events\n div.style.pointerEvents = displayObject.accessiblePointerEvents;\n // set the type, this defaults to button!\n div.type = displayObject.accessibleType;\n if (displayObject.accessibleTitle && displayObject.accessibleTitle !== null) {\n div.title = displayObject.accessibleTitle;\n }\n else if (!displayObject.accessibleHint\n || displayObject.accessibleHint === null) {\n div.title = \"displayObject \" + displayObject.tabIndex;\n }\n if (displayObject.accessibleHint\n && displayObject.accessibleHint !== null) {\n div.setAttribute('aria-label', displayObject.accessibleHint);\n }\n if (this.debug)\n { this.updateDebugHTML(div); }\n displayObject._accessibleActive = true;\n displayObject._accessibleDiv = div;\n div.displayObject = displayObject;\n this.children.push(displayObject);\n this.div.appendChild(displayObject._accessibleDiv);\n displayObject._accessibleDiv.tabIndex = displayObject.tabIndex;\n };\n /**\n * Maps the div button press to pixi's InteractionManager (click)\n *\n * @private\n * @param {MouseEvent} e - The click event.\n */\n AccessibilityManager.prototype._onClick = function (e) {\n // TODO: Remove casting when CanvasRenderer is converted\n var interactionManager = this.renderer.plugins.interaction;\n interactionManager.dispatchEvent(e.target.displayObject, 'click', interactionManager.eventData);\n interactionManager.dispatchEvent(e.target.displayObject, 'pointertap', interactionManager.eventData);\n interactionManager.dispatchEvent(e.target.displayObject, 'tap', interactionManager.eventData);\n };\n /**\n * Maps the div focus events to pixi's InteractionManager (mouseover)\n *\n * @private\n * @param {FocusEvent} e - The focus event.\n */\n AccessibilityManager.prototype._onFocus = function (e) {\n if (!e.target.getAttribute('aria-live')) {\n e.target.setAttribute('aria-live', 'assertive');\n }\n // TODO: Remove casting when CanvasRenderer is converted\n var interactionManager = this.renderer.plugins.interaction;\n interactionManager.dispatchEvent(e.target.displayObject, 'mouseover', interactionManager.eventData);\n };\n /**\n * Maps the div focus events to pixi's InteractionManager (mouseout)\n *\n * @private\n * @param {FocusEvent} e - The focusout event.\n */\n AccessibilityManager.prototype._onFocusOut = function (e) {\n if (!e.target.getAttribute('aria-live')) {\n e.target.setAttribute('aria-live', 'polite');\n }\n // TODO: Remove casting when CanvasRenderer is converted\n var interactionManager = this.renderer.plugins.interaction;\n interactionManager.dispatchEvent(e.target.displayObject, 'mouseout', interactionManager.eventData);\n };\n /**\n * Is called when a key is pressed\n *\n * @private\n * @param {KeyboardEvent} e - The keydown event.\n */\n AccessibilityManager.prototype._onKeyDown = function (e) {\n if (e.keyCode !== KEY_CODE_TAB) {\n return;\n }\n this.activate();\n };\n /**\n * Is called when the mouse moves across the renderer element\n *\n * @private\n * @param {MouseEvent} e - The mouse event.\n */\n AccessibilityManager.prototype._onMouseMove = function (e) {\n if (e.movementX === 0 && e.movementY === 0) {\n return;\n }\n this.deactivate();\n };\n /**\n * Destroys the accessibility manager\n *\n */\n AccessibilityManager.prototype.destroy = function () {\n this.destroyTouchHook();\n this.div = null;\n window.document.removeEventListener('mousemove', this._onMouseMove, true);\n window.removeEventListener('keydown', this._onKeyDown);\n this.pool = null;\n this.children = null;\n this.renderer = null;\n };\n return AccessibilityManager;\n}());\n\nexport { AccessibilityManager, accessibleTarget };\n//# sourceMappingURL=accessibility.es.js.map\n","/*!\n * @pixi/interaction - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/interaction is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Point } from '@pixi/math';\nimport { Ticker, UPDATE_PRIORITY } from '@pixi/ticker';\nimport { DisplayObject, TemporaryDisplayObject } from '@pixi/display';\nimport { EventEmitter } from '@pixi/utils';\n\n/**\n * Holds all information related to an Interaction event\n *\n * @class\n * @memberof PIXI\n */\nvar InteractionData = /** @class */ (function () {\n function InteractionData() {\n this.pressure = 0;\n this.rotationAngle = 0;\n this.twist = 0;\n this.tangentialPressure = 0;\n /**\n * This point stores the global coords of where the touch/mouse event happened\n *\n * @member {PIXI.Point}\n */\n this.global = new Point();\n /**\n * The target Sprite that was interacted with\n *\n * @member {PIXI.Sprite}\n */\n this.target = null;\n /**\n * When passed to an event handler, this will be the original DOM Event that was captured\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent\n * @member {MouseEvent|TouchEvent|PointerEvent}\n */\n this.originalEvent = null;\n /**\n * Unique identifier for this interaction\n *\n * @member {number}\n */\n this.identifier = null;\n /**\n * Indicates whether or not the pointer device that created the event is the primary pointer.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/isPrimary\n * @type {Boolean}\n */\n this.isPrimary = false;\n /**\n * Indicates which button was pressed on the mouse or pointer device to trigger the event.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\n * @type {number}\n */\n this.button = 0;\n /**\n * Indicates which buttons are pressed on the mouse or pointer device when the event is triggered.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons\n * @type {number}\n */\n this.buttons = 0;\n /**\n * The width of the pointer's contact along the x-axis, measured in CSS pixels.\n * radiusX of TouchEvents will be represented by this value.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/width\n * @type {number}\n */\n this.width = 0;\n /**\n * The height of the pointer's contact along the y-axis, measured in CSS pixels.\n * radiusY of TouchEvents will be represented by this value.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/height\n * @type {number}\n */\n this.height = 0;\n /**\n * The angle, in degrees, between the pointer device and the screen.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltX\n * @type {number}\n */\n this.tiltX = 0;\n /**\n * The angle, in degrees, between the pointer device and the screen.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltY\n * @type {number}\n */\n this.tiltY = 0;\n /**\n * The type of pointer that triggered the event.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType\n * @type {string}\n */\n this.pointerType = null;\n /**\n * Pressure applied by the pointing device during the event. A Touch's force property\n * will be represented by this value.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure\n * @type {number}\n */\n this.pressure = 0;\n /**\n * From TouchEvents (not PointerEvents triggered by touches), the rotationAngle of the Touch.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Touch/rotationAngle\n * @type {number}\n */\n this.rotationAngle = 0;\n /**\n * Twist of a stylus pointer.\n * @see https://w3c.github.io/pointerevents/#pointerevent-interface\n * @type {number}\n */\n this.twist = 0;\n /**\n * Barrel pressure on a stylus pointer.\n * @see https://w3c.github.io/pointerevents/#pointerevent-interface\n * @type {number}\n */\n this.tangentialPressure = 0;\n }\n Object.defineProperty(InteractionData.prototype, \"pointerId\", {\n /**\n * The unique identifier of the pointer. It will be the same as `identifier`.\n * @readonly\n * @member {number}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerId\n */\n get: function () {\n return this.identifier;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * This will return the local coordinates of the specified displayObject for this InteractionData\n *\n * @param {PIXI.DisplayObject} displayObject - The DisplayObject that you would like the local\n * coords off\n * @param {PIXI.Point} [point] - A Point object in which to store the value, optional (otherwise\n * will create a new point)\n * @param {PIXI.Point} [globalPos] - A Point object containing your custom global coords, optional\n * (otherwise will use the current global coords)\n * @return {PIXI.Point} A point containing the coordinates of the InteractionData position relative\n * to the DisplayObject\n */\n InteractionData.prototype.getLocalPosition = function (displayObject, point, globalPos) {\n return displayObject.worldTransform.applyInverse(globalPos || this.global, point);\n };\n /**\n * Copies properties from normalized event data.\n *\n * @param {Touch|MouseEvent|PointerEvent} event - The normalized event data\n */\n InteractionData.prototype.copyEvent = function (event) {\n // isPrimary should only change on touchstart/pointerdown, so we don't want to overwrite\n // it with \"false\" on later events when our shim for it on touch events might not be\n // accurate\n if ('isPrimary' in event && event.isPrimary) {\n this.isPrimary = true;\n }\n this.button = 'button' in event && event.button;\n // event.buttons is not available in all browsers (ie. Safari), but it does have a non-standard\n // event.which property instead, which conveys the same information.\n var buttons = 'buttons' in event && event.buttons;\n this.buttons = Number.isInteger(buttons) ? buttons : 'which' in event && event.which;\n this.width = 'width' in event && event.width;\n this.height = 'height' in event && event.height;\n this.tiltX = 'tiltX' in event && event.tiltX;\n this.tiltY = 'tiltY' in event && event.tiltY;\n this.pointerType = 'pointerType' in event && event.pointerType;\n this.pressure = 'pressure' in event && event.pressure;\n this.rotationAngle = 'rotationAngle' in event && event.rotationAngle;\n this.twist = ('twist' in event && event.twist) || 0;\n this.tangentialPressure = ('tangentialPressure' in event && event.tangentialPressure) || 0;\n };\n /**\n * Resets the data for pooling.\n */\n InteractionData.prototype.reset = function () {\n // isPrimary is the only property that we really need to reset - everything else is\n // guaranteed to be overwritten\n this.isPrimary = false;\n };\n return InteractionData;\n}());\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * Event class that mimics native DOM events.\n *\n * @class\n * @memberof PIXI\n */\nvar InteractionEvent = /** @class */ (function () {\n function InteractionEvent() {\n /**\n * Whether this event will continue propagating in the tree.\n *\n * Remaining events for the {@link stopsPropagatingAt} object\n * will still be dispatched.\n *\n * @member {boolean}\n */\n this.stopped = false;\n /**\n * At which object this event stops propagating.\n *\n * @private\n * @member {PIXI.DisplayObject}\n */\n this.stopsPropagatingAt = null;\n /**\n * Whether we already reached the element we want to\n * stop propagating at. This is important for delayed events,\n * where we start over deeper in the tree again.\n *\n * @private\n * @member {boolean}\n */\n this.stopPropagationHint = false;\n /**\n * The object which caused this event to be dispatched.\n * For listener callback see {@link PIXI.InteractionEvent.currentTarget}.\n *\n * @member {PIXI.DisplayObject}\n */\n this.target = null;\n /**\n * The object whose event listener’s callback is currently being invoked.\n *\n * @member {PIXI.DisplayObject}\n */\n this.currentTarget = null;\n /**\n * Type of the event\n *\n * @member {string}\n */\n this.type = null;\n /**\n * InteractionData related to this event\n *\n * @member {PIXI.InteractionData}\n */\n this.data = null;\n }\n /**\n * Prevents event from reaching any objects other than the current object.\n *\n */\n InteractionEvent.prototype.stopPropagation = function () {\n this.stopped = true;\n this.stopPropagationHint = true;\n this.stopsPropagatingAt = this.currentTarget;\n };\n /**\n * Resets the event.\n */\n InteractionEvent.prototype.reset = function () {\n this.stopped = false;\n this.stopsPropagatingAt = null;\n this.stopPropagationHint = false;\n this.currentTarget = null;\n this.target = null;\n };\n return InteractionEvent;\n}());\n\n/**\n * DisplayObjects with the {@link PIXI.interactiveTarget} mixin use this class to track interactions\n *\n * @class\n * @private\n * @memberof PIXI\n */\nvar InteractionTrackingData = /** @class */ (function () {\n /**\n * @param {number} pointerId - Unique pointer id of the event\n * @private\n */\n function InteractionTrackingData(pointerId) {\n this._pointerId = pointerId;\n this._flags = InteractionTrackingData.FLAGS.NONE;\n }\n /**\n *\n * @private\n * @param {number} flag - The interaction flag to set\n * @param {boolean} yn - Should the flag be set or unset\n */\n InteractionTrackingData.prototype._doSet = function (flag, yn) {\n if (yn) {\n this._flags = this._flags | flag;\n }\n else {\n this._flags = this._flags & (~flag);\n }\n };\n Object.defineProperty(InteractionTrackingData.prototype, \"pointerId\", {\n /**\n * Unique pointer id of the event\n *\n * @readonly\n * @private\n * @member {number}\n */\n get: function () {\n return this._pointerId;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionTrackingData.prototype, \"flags\", {\n /**\n * State of the tracking data, expressed as bit flags\n *\n * @private\n * @member {number}\n */\n get: function () {\n return this._flags;\n },\n set: function (flags) {\n this._flags = flags;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionTrackingData.prototype, \"none\", {\n /**\n * Is the tracked event inactive (not over or down)?\n *\n * @private\n * @member {number}\n */\n get: function () {\n return this._flags === InteractionTrackingData.FLAGS.NONE;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionTrackingData.prototype, \"over\", {\n /**\n * Is the tracked event over the DisplayObject?\n *\n * @private\n * @member {boolean}\n */\n get: function () {\n return (this._flags & InteractionTrackingData.FLAGS.OVER) !== 0;\n },\n set: function (yn) {\n this._doSet(InteractionTrackingData.FLAGS.OVER, yn);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionTrackingData.prototype, \"rightDown\", {\n /**\n * Did the right mouse button come down in the DisplayObject?\n *\n * @private\n * @member {boolean}\n */\n get: function () {\n return (this._flags & InteractionTrackingData.FLAGS.RIGHT_DOWN) !== 0;\n },\n set: function (yn) {\n this._doSet(InteractionTrackingData.FLAGS.RIGHT_DOWN, yn);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionTrackingData.prototype, \"leftDown\", {\n /**\n * Did the left mouse button come down in the DisplayObject?\n *\n * @private\n * @member {boolean}\n */\n get: function () {\n return (this._flags & InteractionTrackingData.FLAGS.LEFT_DOWN) !== 0;\n },\n set: function (yn) {\n this._doSet(InteractionTrackingData.FLAGS.LEFT_DOWN, yn);\n },\n enumerable: false,\n configurable: true\n });\n InteractionTrackingData.FLAGS = Object.freeze({\n NONE: 0,\n OVER: 1 << 0,\n LEFT_DOWN: 1 << 1,\n RIGHT_DOWN: 1 << 2,\n });\n return InteractionTrackingData;\n}());\n\n/**\n * Strategy how to search through stage tree for interactive objects\n *\n * @private\n * @class\n * @memberof PIXI\n */\nvar TreeSearch = /** @class */ (function () {\n function TreeSearch() {\n this._tempPoint = new Point();\n }\n /**\n * Recursive implementation for findHit\n *\n * @private\n * @param {PIXI.InteractionEvent} interactionEvent - event containing the point that\n * is tested for collision\n * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - the displayObject\n * that will be hit test (recursively crawls its children)\n * @param {Function} [func] - the function that will be called on each interactive object. The\n * interactionEvent, displayObject and hit will be passed to the function\n * @param {boolean} [hitTest] - this indicates if the objects inside should be hit test against the point\n * @param {boolean} [interactive] - Whether the displayObject is interactive\n * @return {boolean} returns true if the displayObject hit the point\n */\n TreeSearch.prototype.recursiveFindHit = function (interactionEvent, displayObject, func, hitTest, interactive) {\n if (!displayObject || !displayObject.visible) {\n return false;\n }\n var point = interactionEvent.data.global;\n // Took a little while to rework this function correctly! But now it is done and nice and optimized! ^_^\n //\n // This function will now loop through all objects and then only hit test the objects it HAS\n // to, not all of them. MUCH faster..\n // An object will be hit test if the following is true:\n //\n // 1: It is interactive.\n // 2: It belongs to a parent that is interactive AND one of the parents children have not already been hit.\n //\n // As another little optimization once an interactive object has been hit we can carry on\n // through the scenegraph, but we know that there will be no more hits! So we can avoid extra hit tests\n // A final optimization is that an object is not hit test directly if a child has already been hit.\n interactive = displayObject.interactive || interactive;\n var hit = false;\n var interactiveParent = interactive;\n // Flag here can set to false if the event is outside the parents hitArea or mask\n var hitTestChildren = true;\n // If there is a hitArea, no need to test against anything else if the pointer is not within the hitArea\n // There is also no longer a need to hitTest children.\n if (displayObject.hitArea) {\n if (hitTest) {\n displayObject.worldTransform.applyInverse(point, this._tempPoint);\n if (!displayObject.hitArea.contains(this._tempPoint.x, this._tempPoint.y)) {\n hitTest = false;\n hitTestChildren = false;\n }\n else {\n hit = true;\n }\n }\n interactiveParent = false;\n }\n // If there is a mask, no need to hitTest against anything else if the pointer is not within the mask.\n // We still want to hitTestChildren, however, to ensure a mouseout can still be generated.\n // https://github.com/pixijs/pixi.js/issues/5135\n else if (displayObject._mask) {\n if (hitTest) {\n if (!(displayObject._mask.containsPoint && displayObject._mask.containsPoint(point))) {\n hitTest = false;\n }\n }\n }\n // ** FREE TIP **! If an object is not interactive or has no buttons in it\n // (such as a game scene!) set interactiveChildren to false for that displayObject.\n // This will allow PixiJS to completely ignore and bypass checking the displayObjects children.\n if (hitTestChildren && displayObject.interactiveChildren && displayObject.children) {\n var children = displayObject.children;\n for (var i = children.length - 1; i >= 0; i--) {\n var child = children[i];\n // time to get recursive.. if this function will return if something is hit..\n var childHit = this.recursiveFindHit(interactionEvent, child, func, hitTest, interactiveParent);\n if (childHit) {\n // its a good idea to check if a child has lost its parent.\n // this means it has been removed whilst looping so its best\n if (!child.parent) {\n continue;\n }\n // we no longer need to hit test any more objects in this container as we we\n // now know the parent has been hit\n interactiveParent = false;\n // If the child is interactive , that means that the object hit was actually\n // interactive and not just the child of an interactive object.\n // This means we no longer need to hit test anything else. We still need to run\n // through all objects, but we don't need to perform any hit tests.\n if (childHit) {\n if (interactionEvent.target) {\n hitTest = false;\n }\n hit = true;\n }\n }\n }\n }\n // no point running this if the item is not interactive or does not have an interactive parent.\n if (interactive) {\n // if we are hit testing (as in we have no hit any objects yet)\n // We also don't need to worry about hit testing if once of the displayObjects children\n // has already been hit - but only if it was interactive, otherwise we need to keep\n // looking for an interactive child, just in case we hit one\n if (hitTest && !interactionEvent.target) {\n // already tested against hitArea if it is defined\n if (!displayObject.hitArea && displayObject.containsPoint) {\n if (displayObject.containsPoint(point)) {\n hit = true;\n }\n }\n }\n if (displayObject.interactive) {\n if (hit && !interactionEvent.target) {\n interactionEvent.target = displayObject;\n }\n if (func) {\n func(interactionEvent, displayObject, !!hit);\n }\n }\n }\n return hit;\n };\n /**\n * This function is provides a neat way of crawling through the scene graph and running a\n * specified function on all interactive objects it finds. It will also take care of hit\n * testing the interactive objects and passes the hit across in the function.\n *\n * @private\n * @param {PIXI.InteractionEvent} interactionEvent - event containing the point that\n * is tested for collision\n * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - the displayObject\n * that will be hit test (recursively crawls its children)\n * @param {Function} [func] - the function that will be called on each interactive object. The\n * interactionEvent, displayObject and hit will be passed to the function\n * @param {boolean} [hitTest] - this indicates if the objects inside should be hit test against the point\n * @return {boolean} returns true if the displayObject hit the point\n */\n TreeSearch.prototype.findHit = function (interactionEvent, displayObject, func, hitTest) {\n this.recursiveFindHit(interactionEvent, displayObject, func, hitTest, false);\n };\n return TreeSearch;\n}());\n\n/**\n * Interface for classes that represent a hit area.\n *\n * It is implemented by the following classes:\n * - {@link PIXI.Circle}\n * - {@link PIXI.Ellipse}\n * - {@link PIXI.Polygon}\n * - {@link PIXI.RoundedRectangle}\n *\n * @interface IHitArea\n * @memberof PIXI\n */\n/**\n * Checks whether the x and y coordinates given are contained within this area\n *\n * @method\n * @name contains\n * @memberof PIXI.IHitArea#\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this area\n */\n/**\n * Default property values of interactive objects\n * Used by {@link PIXI.InteractionManager} to automatically give all DisplayObjects these properties\n *\n * @private\n * @name interactiveTarget\n * @type {Object}\n * @memberof PIXI\n * @example\n * function MyObject() {}\n *\n * Object.assign(\n * DisplayObject.prototype,\n * PIXI.interactiveTarget\n * );\n */\nvar interactiveTarget = {\n /**\n * Enable interaction events for the DisplayObject. Touch, pointer and mouse\n * events will not be emitted unless `interactive` is set to `true`.\n *\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.interactive = true;\n * sprite.on('tap', (event) => {\n * //handle event\n * });\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n interactive: false,\n /**\n * Determines if the children to the displayObject can be clicked/touched\n * Setting this to false allows PixiJS to bypass a recursive `hitTest` function\n *\n * @member {boolean}\n * @memberof PIXI.Container#\n */\n interactiveChildren: true,\n /**\n * Interaction shape. Children will be hit first, then this shape will be checked.\n * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.\n *\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.interactive = true;\n * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);\n * @member {PIXI.IHitArea}\n * @memberof PIXI.DisplayObject#\n */\n hitArea: null,\n /**\n * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive\n * Setting this changes the 'cursor' property to `'pointer'`.\n *\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.interactive = true;\n * sprite.buttonMode = true;\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n get buttonMode() {\n return this.cursor === 'pointer';\n },\n set buttonMode(value) {\n if (value) {\n this.cursor = 'pointer';\n }\n else if (this.cursor === 'pointer') {\n this.cursor = null;\n }\n },\n /**\n * This defines what cursor mode is used when the mouse cursor\n * is hovered over the displayObject.\n *\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.interactive = true;\n * sprite.cursor = 'wait';\n * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor\n *\n * @member {string}\n * @memberof PIXI.DisplayObject#\n */\n cursor: null,\n /**\n * Internal set of all active pointers, by identifier\n *\n * @member {Map}\n * @memberof PIXI.DisplayObject#\n * @private\n */\n get trackedPointers() {\n if (this._trackedPointers === undefined)\n { this._trackedPointers = {}; }\n return this._trackedPointers;\n },\n /**\n * Map of all tracked pointers, by identifier. Use trackedPointers to access.\n *\n * @private\n * @type {Map}\n */\n _trackedPointers: undefined,\n};\n\n// Mix interactiveTarget into DisplayObject.prototype,\n// after deprecation has been handled\nDisplayObject.mixin(interactiveTarget);\nvar MOUSE_POINTER_ID = 1;\n// helpers for hitTest() - only used inside hitTest()\nvar hitTestEvent = {\n target: null,\n data: {\n global: null,\n },\n};\n/**\n * The interaction manager deals with mouse, touch and pointer events.\n *\n * Any DisplayObject can be interactive if its `interactive` property is set to true.\n *\n * This manager also supports multitouch.\n *\n * An instance of this class is automatically created by default, and can be found at `renderer.plugins.interaction`\n *\n * @class\n * @extends PIXI.utils.EventEmitter\n * @memberof PIXI\n */\nvar InteractionManager = /** @class */ (function (_super) {\n __extends(InteractionManager, _super);\n /**\n * @param {PIXI.CanvasRenderer|PIXI.Renderer} renderer - A reference to the current renderer\n * @param {object} [options] - The options for the manager.\n * @param {boolean} [options.autoPreventDefault=true] - Should the manager automatically prevent default browser actions.\n * @param {number} [options.interactionFrequency=10] - Maximum requency (ms) at pointer over/out states will be checked.\n * @param {number} [options.useSystemTicker=true] - Whether to add {@link tickerUpdate} to {@link PIXI.Ticker.system}.\n */\n function InteractionManager(renderer, options) {\n var _this = _super.call(this) || this;\n options = options || {};\n /**\n * The renderer this interaction manager works for.\n *\n * @member {PIXI.AbstractRenderer}\n */\n _this.renderer = renderer;\n /**\n * Should default browser actions automatically be prevented.\n * Does not apply to pointer events for backwards compatibility\n * preventDefault on pointer events stops mouse events from firing\n * Thus, for every pointer event, there will always be either a mouse of touch event alongside it.\n *\n * @member {boolean}\n * @default true\n */\n _this.autoPreventDefault = options.autoPreventDefault !== undefined ? options.autoPreventDefault : true;\n /**\n * Maximum requency in milliseconds at which pointer over/out states will be checked by {@link tickerUpdate}.\n *\n * @member {number}\n * @default 10\n */\n _this.interactionFrequency = options.interactionFrequency || 10;\n /**\n * The mouse data\n *\n * @member {PIXI.InteractionData}\n */\n _this.mouse = new InteractionData();\n _this.mouse.identifier = MOUSE_POINTER_ID;\n // setting the mouse to start off far off screen will mean that mouse over does\n // not get called before we even move the mouse.\n _this.mouse.global.set(-999999);\n /**\n * Actively tracked InteractionData\n *\n * @private\n * @member {Object.}\n */\n _this.activeInteractionData = {};\n _this.activeInteractionData[MOUSE_POINTER_ID] = _this.mouse;\n /**\n * Pool of unused InteractionData\n *\n * @private\n * @member {PIXI.InteractionData[]}\n */\n _this.interactionDataPool = [];\n /**\n * An event data object to handle all the event tracking/dispatching\n *\n * @member {object}\n */\n _this.eventData = new InteractionEvent();\n /**\n * The DOM element to bind to.\n *\n * @protected\n * @member {HTMLElement}\n */\n _this.interactionDOMElement = null;\n /**\n * This property determines if mousemove and touchmove events are fired only when the cursor\n * is over the object.\n * Setting to true will make things work more in line with how the DOM version works.\n * Setting to false can make things easier for things like dragging\n * It is currently set to false as this is how PixiJS used to work. This will be set to true in\n * future versions of pixi.\n *\n * @member {boolean}\n * @default false\n */\n _this.moveWhenInside = false;\n /**\n * Have events been attached to the dom element?\n *\n * @protected\n * @member {boolean}\n */\n _this.eventsAdded = false;\n /**\n * Has the system ticker been added?\n *\n * @protected\n * @member {boolean}\n */\n _this.tickerAdded = false;\n /**\n * Is the mouse hovering over the renderer?\n *\n * @protected\n * @member {boolean}\n */\n _this.mouseOverRenderer = false;\n /**\n * Does the device support touch events\n * https://www.w3.org/TR/touch-events/\n *\n * @readonly\n * @member {boolean}\n */\n _this.supportsTouchEvents = 'ontouchstart' in window;\n /**\n * Does the device support pointer events\n * https://www.w3.org/Submission/pointer-events/\n *\n * @readonly\n * @member {boolean}\n */\n _this.supportsPointerEvents = !!window.PointerEvent;\n // this will make it so that you don't have to call bind all the time\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerUp = _this.onPointerUp.bind(_this);\n _this.processPointerUp = _this.processPointerUp.bind(_this);\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerCancel = _this.onPointerCancel.bind(_this);\n _this.processPointerCancel = _this.processPointerCancel.bind(_this);\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerDown = _this.onPointerDown.bind(_this);\n _this.processPointerDown = _this.processPointerDown.bind(_this);\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerMove = _this.onPointerMove.bind(_this);\n _this.processPointerMove = _this.processPointerMove.bind(_this);\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerOut = _this.onPointerOut.bind(_this);\n _this.processPointerOverOut = _this.processPointerOverOut.bind(_this);\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerOver = _this.onPointerOver.bind(_this);\n /**\n * Dictionary of how different cursor modes are handled. Strings are handled as CSS cursor\n * values, objects are handled as dictionaries of CSS values for interactionDOMElement,\n * and functions are called instead of changing the CSS.\n * Default CSS cursor values are provided for 'default' and 'pointer' modes.\n * @member {Object.}\n */\n _this.cursorStyles = {\n default: 'inherit',\n pointer: 'pointer',\n };\n /**\n * The mode of the cursor that is being used.\n * The value of this is a key from the cursorStyles dictionary.\n *\n * @member {string}\n */\n _this.currentCursorMode = null;\n /**\n * Internal cached let.\n *\n * @private\n * @member {string}\n */\n _this.cursor = null;\n /**\n * The current resolution / device pixel ratio.\n *\n * @member {number}\n * @default 1\n */\n _this.resolution = 1;\n /**\n * Delayed pointer events. Used to guarantee correct ordering of over/out events.\n *\n * @private\n * @member {Array}\n */\n _this.delayedEvents = [];\n /**\n * TreeSearch component that is used to hitTest stage tree\n *\n * @private\n * @member {PIXI.TreeSearch}\n */\n _this.search = new TreeSearch();\n /**\n * Used as a last rendered object in case renderer doesnt have _lastObjectRendered\n * @member {DisplayObject}\n * @private\n */\n _this._tempDisplayObject = new TemporaryDisplayObject();\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed on the display\n * object.\n *\n * @event PIXI.InteractionManager#mousedown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * on the display object.\n *\n * @event PIXI.InteractionManager#rightdown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released over the display\n * object.\n *\n * @event PIXI.InteractionManager#mouseup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * over the display object.\n *\n * @event PIXI.InteractionManager#rightup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed and released on\n * the display object.\n *\n * @event PIXI.InteractionManager#click\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * and released on the display object.\n *\n * @event PIXI.InteractionManager#rightclick\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released outside the\n * display object that initially registered a\n * [mousedown]{@link PIXI.InteractionManager#event:mousedown}.\n *\n * @event PIXI.InteractionManager#mouseupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * outside the display object that initially registered a\n * [rightdown]{@link PIXI.InteractionManager#event:rightdown}.\n *\n * @event PIXI.InteractionManager#rightupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved while over the display object\n *\n * @event PIXI.InteractionManager#mousemove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved onto the display object\n *\n * @event PIXI.InteractionManager#mouseover\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved off the display object\n *\n * @event PIXI.InteractionManager#mouseout\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is pressed on the display object.\n *\n * @event PIXI.InteractionManager#pointerdown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is released over the display object.\n * Not always fired when some buttons are held down while others are released. In those cases,\n * use [mousedown]{@link PIXI.InteractionManager#event:mousedown} and\n * [mouseup]{@link PIXI.InteractionManager#event:mouseup} instead.\n *\n * @event PIXI.InteractionManager#pointerup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when the operating system cancels a pointer event\n *\n * @event PIXI.InteractionManager#pointercancel\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is pressed and released on the display object.\n *\n * @event PIXI.InteractionManager#pointertap\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is released outside the display object that initially\n * registered a [pointerdown]{@link PIXI.InteractionManager#event:pointerdown}.\n *\n * @event PIXI.InteractionManager#pointerupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved while over the display object\n *\n * @event PIXI.InteractionManager#pointermove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved onto the display object\n *\n * @event PIXI.InteractionManager#pointerover\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved off the display object\n *\n * @event PIXI.InteractionManager#pointerout\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is placed on the display object.\n *\n * @event PIXI.InteractionManager#touchstart\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is removed from the display object.\n *\n * @event PIXI.InteractionManager#touchend\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when the operating system cancels a touch\n *\n * @event PIXI.InteractionManager#touchcancel\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is placed and removed from the display object.\n *\n * @event PIXI.InteractionManager#tap\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is removed outside of the display object that initially\n * registered a [touchstart]{@link PIXI.InteractionManager#event:touchstart}.\n *\n * @event PIXI.InteractionManager#touchendoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is moved along the display object.\n *\n * @event PIXI.InteractionManager#touchmove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed on the display.\n * object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mousedown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * on the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#rightdown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released over the display\n * object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mouseup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * over the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#rightup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed and released on\n * the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#click\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * and released on the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#rightclick\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released outside the\n * display object that initially registered a\n * [mousedown]{@link PIXI.DisplayObject#event:mousedown}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mouseupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * outside the display object that initially registered a\n * [rightdown]{@link PIXI.DisplayObject#event:rightdown}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#rightupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved while over the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mousemove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved onto the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mouseover\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved off the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mouseout\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is pressed on the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointerdown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is released over the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointerup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when the operating system cancels a pointer event.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointercancel\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is pressed and released on the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointertap\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is released outside the display object that initially\n * registered a [pointerdown]{@link PIXI.DisplayObject#event:pointerdown}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointerupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved while over the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointermove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved onto the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointerover\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved off the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointerout\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is placed on the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#touchstart\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is removed from the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#touchend\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when the operating system cancels a touch.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#touchcancel\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is placed and removed from the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#tap\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is removed outside of the display object that initially\n * registered a [touchstart]{@link PIXI.DisplayObject#event:touchstart}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#touchendoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is moved along the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#touchmove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n _this._useSystemTicker = options.useSystemTicker !== undefined ? options.useSystemTicker : true;\n _this.setTargetElement(_this.renderer.view, _this.renderer.resolution);\n return _this;\n }\n Object.defineProperty(InteractionManager.prototype, \"useSystemTicker\", {\n /**\n * Should the InteractionManager automatically add {@link tickerUpdate} to {@link PIXI.Ticker.system}.\n *\n * @member {boolean}\n * @default true\n */\n get: function () {\n return this._useSystemTicker;\n },\n set: function (useSystemTicker) {\n this._useSystemTicker = useSystemTicker;\n if (useSystemTicker) {\n this.addTickerListener();\n }\n else {\n this.removeTickerListener();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionManager.prototype, \"lastObjectRendered\", {\n /**\n * Last rendered object or temp object\n * @readonly\n * @protected\n * @member {PIXI.DisplayObject}\n */\n get: function () {\n return this.renderer._lastObjectRendered || this._tempDisplayObject;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Hit tests a point against the display tree, returning the first interactive object that is hit.\n *\n * @param {PIXI.Point} globalPoint - A point to hit test with, in global space.\n * @param {PIXI.Container} [root] - The root display object to start from. If omitted, defaults\n * to the last rendered root of the associated renderer.\n * @return {PIXI.DisplayObject} The hit display object, if any.\n */\n InteractionManager.prototype.hitTest = function (globalPoint, root) {\n // clear the target for our hit test\n hitTestEvent.target = null;\n // assign the global point\n hitTestEvent.data.global = globalPoint;\n // ensure safety of the root\n if (!root) {\n root = this.lastObjectRendered;\n }\n // run the hit test\n this.processInteractive(hitTestEvent, root, null, true);\n // return our found object - it'll be null if we didn't hit anything\n return hitTestEvent.target;\n };\n /**\n * Sets the DOM element which will receive mouse/touch events. This is useful for when you have\n * other DOM elements on top of the renderers Canvas element. With this you'll be bale to delegate\n * another DOM element to receive those events.\n *\n * @param {HTMLElement} element - the DOM element which will receive mouse and touch events.\n * @param {number} [resolution=1] - The resolution / device pixel ratio of the new element (relative to the canvas).\n */\n InteractionManager.prototype.setTargetElement = function (element, resolution) {\n if (resolution === void 0) { resolution = 1; }\n this.removeTickerListener();\n this.removeEvents();\n this.interactionDOMElement = element;\n this.resolution = resolution;\n this.addEvents();\n this.addTickerListener();\n };\n /**\n * Add the ticker listener\n *\n * @private\n */\n InteractionManager.prototype.addTickerListener = function () {\n if (this.tickerAdded || !this.interactionDOMElement || !this._useSystemTicker) {\n return;\n }\n Ticker.system.add(this.tickerUpdate, this, UPDATE_PRIORITY.INTERACTION);\n this.tickerAdded = true;\n };\n /**\n * Remove the ticker listener\n *\n * @private\n */\n InteractionManager.prototype.removeTickerListener = function () {\n if (!this.tickerAdded) {\n return;\n }\n Ticker.system.remove(this.tickerUpdate, this);\n this.tickerAdded = false;\n };\n /**\n * Registers all the DOM events\n *\n * @private\n */\n InteractionManager.prototype.addEvents = function () {\n if (this.eventsAdded || !this.interactionDOMElement) {\n return;\n }\n var style = this.interactionDOMElement.style;\n if (window.navigator.msPointerEnabled) {\n style.msContentZooming = 'none';\n style.msTouchAction = 'none';\n }\n else if (this.supportsPointerEvents) {\n style.touchAction = 'none';\n }\n /**\n * These events are added first, so that if pointer events are normalized, they are fired\n * in the same order as non-normalized events. ie. pointer event 1st, mouse / touch 2nd\n */\n if (this.supportsPointerEvents) {\n window.document.addEventListener('pointermove', this.onPointerMove, true);\n this.interactionDOMElement.addEventListener('pointerdown', this.onPointerDown, true);\n // pointerout is fired in addition to pointerup (for touch events) and pointercancel\n // we already handle those, so for the purposes of what we do in onPointerOut, we only\n // care about the pointerleave event\n this.interactionDOMElement.addEventListener('pointerleave', this.onPointerOut, true);\n this.interactionDOMElement.addEventListener('pointerover', this.onPointerOver, true);\n window.addEventListener('pointercancel', this.onPointerCancel, true);\n window.addEventListener('pointerup', this.onPointerUp, true);\n }\n else {\n window.document.addEventListener('mousemove', this.onPointerMove, true);\n this.interactionDOMElement.addEventListener('mousedown', this.onPointerDown, true);\n this.interactionDOMElement.addEventListener('mouseout', this.onPointerOut, true);\n this.interactionDOMElement.addEventListener('mouseover', this.onPointerOver, true);\n window.addEventListener('mouseup', this.onPointerUp, true);\n }\n // always look directly for touch events so that we can provide original data\n // In a future version we should change this to being just a fallback and rely solely on\n // PointerEvents whenever available\n if (this.supportsTouchEvents) {\n this.interactionDOMElement.addEventListener('touchstart', this.onPointerDown, true);\n this.interactionDOMElement.addEventListener('touchcancel', this.onPointerCancel, true);\n this.interactionDOMElement.addEventListener('touchend', this.onPointerUp, true);\n this.interactionDOMElement.addEventListener('touchmove', this.onPointerMove, true);\n }\n this.eventsAdded = true;\n };\n /**\n * Removes all the DOM events that were previously registered\n *\n * @private\n */\n InteractionManager.prototype.removeEvents = function () {\n if (!this.eventsAdded || !this.interactionDOMElement) {\n return;\n }\n var style = this.interactionDOMElement.style;\n if (window.navigator.msPointerEnabled) {\n style.msContentZooming = '';\n style.msTouchAction = '';\n }\n else if (this.supportsPointerEvents) {\n style.touchAction = '';\n }\n if (this.supportsPointerEvents) {\n window.document.removeEventListener('pointermove', this.onPointerMove, true);\n this.interactionDOMElement.removeEventListener('pointerdown', this.onPointerDown, true);\n this.interactionDOMElement.removeEventListener('pointerleave', this.onPointerOut, true);\n this.interactionDOMElement.removeEventListener('pointerover', this.onPointerOver, true);\n window.removeEventListener('pointercancel', this.onPointerCancel, true);\n window.removeEventListener('pointerup', this.onPointerUp, true);\n }\n else {\n window.document.removeEventListener('mousemove', this.onPointerMove, true);\n this.interactionDOMElement.removeEventListener('mousedown', this.onPointerDown, true);\n this.interactionDOMElement.removeEventListener('mouseout', this.onPointerOut, true);\n this.interactionDOMElement.removeEventListener('mouseover', this.onPointerOver, true);\n window.removeEventListener('mouseup', this.onPointerUp, true);\n }\n if (this.supportsTouchEvents) {\n this.interactionDOMElement.removeEventListener('touchstart', this.onPointerDown, true);\n this.interactionDOMElement.removeEventListener('touchcancel', this.onPointerCancel, true);\n this.interactionDOMElement.removeEventListener('touchend', this.onPointerUp, true);\n this.interactionDOMElement.removeEventListener('touchmove', this.onPointerMove, true);\n }\n this.interactionDOMElement = null;\n this.eventsAdded = false;\n };\n /**\n * Updates the state of interactive objects if at least {@link interactionFrequency}\n * milliseconds have passed since the last invocation.\n *\n * Invoked by a throttled ticker update from {@link PIXI.Ticker.system}.\n *\n * @param {number} deltaTime - time delta since the last call\n */\n InteractionManager.prototype.tickerUpdate = function (deltaTime) {\n this._deltaTime += deltaTime;\n if (this._deltaTime < this.interactionFrequency) {\n return;\n }\n this._deltaTime = 0;\n this.update();\n };\n /**\n * Updates the state of interactive objects.\n */\n InteractionManager.prototype.update = function () {\n if (!this.interactionDOMElement) {\n return;\n }\n // if the user move the mouse this check has already been done using the mouse move!\n if (this._didMove) {\n this._didMove = false;\n return;\n }\n this.cursor = null;\n // Resets the flag as set by a stopPropagation call. This flag is usually reset by a user interaction of any kind,\n // but there was a scenario of a display object moving under a static mouse cursor.\n // In this case, mouseover and mouseevents would not pass the flag test in dispatchEvent function\n for (var k in this.activeInteractionData) {\n // eslint-disable-next-line no-prototype-builtins\n if (this.activeInteractionData.hasOwnProperty(k)) {\n var interactionData = this.activeInteractionData[k];\n if (interactionData.originalEvent && interactionData.pointerType !== 'touch') {\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, interactionData.originalEvent, interactionData);\n this.processInteractive(interactionEvent, this.lastObjectRendered, this.processPointerOverOut, true);\n }\n }\n }\n this.setCursorMode(this.cursor);\n };\n /**\n * Sets the current cursor mode, handling any callbacks or CSS style changes.\n *\n * @param {string} mode - cursor mode, a key from the cursorStyles dictionary\n */\n InteractionManager.prototype.setCursorMode = function (mode) {\n mode = mode || 'default';\n // if the mode didn't actually change, bail early\n if (this.currentCursorMode === mode) {\n return;\n }\n this.currentCursorMode = mode;\n var style = this.cursorStyles[mode];\n // only do things if there is a cursor style for it\n if (style) {\n switch (typeof style) {\n case 'string':\n // string styles are handled as cursor CSS\n this.interactionDOMElement.style.cursor = style;\n break;\n case 'function':\n // functions are just called, and passed the cursor mode\n style(mode);\n break;\n case 'object':\n // if it is an object, assume that it is a dictionary of CSS styles,\n // apply it to the interactionDOMElement\n Object.assign(this.interactionDOMElement.style, style);\n break;\n }\n }\n else if (typeof mode === 'string' && !Object.prototype.hasOwnProperty.call(this.cursorStyles, mode)) {\n // if it mode is a string (not a Symbol) and cursorStyles doesn't have any entry\n // for the mode, then assume that the dev wants it to be CSS for the cursor.\n this.interactionDOMElement.style.cursor = mode;\n }\n };\n /**\n * Dispatches an event on the display object that was interacted with\n *\n * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - the display object in question\n * @param {string} eventString - the name of the event (e.g, mousedown)\n * @param {PIXI.InteractionEvent} eventData - the event data object\n * @private\n */\n InteractionManager.prototype.dispatchEvent = function (displayObject, eventString, eventData) {\n // Even if the event was stopped, at least dispatch any remaining events\n // for the same display object.\n if (!eventData.stopPropagationHint || displayObject === eventData.stopsPropagatingAt) {\n eventData.currentTarget = displayObject;\n eventData.type = eventString;\n displayObject.emit(eventString, eventData);\n if (displayObject[eventString]) {\n displayObject[eventString](eventData);\n }\n }\n };\n /**\n * Puts a event on a queue to be dispatched later. This is used to guarantee correct\n * ordering of over/out events.\n *\n * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - the display object in question\n * @param {string} eventString - the name of the event (e.g, mousedown)\n * @param {object} eventData - the event data object\n * @private\n */\n InteractionManager.prototype.delayDispatchEvent = function (displayObject, eventString, eventData) {\n this.delayedEvents.push({ displayObject: displayObject, eventString: eventString, eventData: eventData });\n };\n /**\n * Maps x and y coords from a DOM object and maps them correctly to the PixiJS view. The\n * resulting value is stored in the point. This takes into account the fact that the DOM\n * element could be scaled and positioned anywhere on the screen.\n *\n * @param {PIXI.IPointData} point - the point that the result will be stored in\n * @param {number} x - the x coord of the position to map\n * @param {number} y - the y coord of the position to map\n */\n InteractionManager.prototype.mapPositionToPoint = function (point, x, y) {\n var rect;\n // IE 11 fix\n if (!this.interactionDOMElement.parentElement) {\n rect = { x: 0, y: 0, width: 0, height: 0 };\n }\n else {\n rect = this.interactionDOMElement.getBoundingClientRect();\n }\n var resolutionMultiplier = 1.0 / this.resolution;\n point.x = ((x - rect.left) * (this.interactionDOMElement.width / rect.width)) * resolutionMultiplier;\n point.y = ((y - rect.top) * (this.interactionDOMElement.height / rect.height)) * resolutionMultiplier;\n };\n /**\n * This function is provides a neat way of crawling through the scene graph and running a\n * specified function on all interactive objects it finds. It will also take care of hit\n * testing the interactive objects and passes the hit across in the function.\n *\n * @protected\n * @param {PIXI.InteractionEvent} interactionEvent - event containing the point that\n * is tested for collision\n * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - the displayObject\n * that will be hit test (recursively crawls its children)\n * @param {Function} [func] - the function that will be called on each interactive object. The\n * interactionEvent, displayObject and hit will be passed to the function\n * @param {boolean} [hitTest] - indicates whether we want to calculate hits\n * or just iterate through all interactive objects\n */\n InteractionManager.prototype.processInteractive = function (interactionEvent, displayObject, func, hitTest) {\n var hit = this.search.findHit(interactionEvent, displayObject, func, hitTest);\n var delayedEvents = this.delayedEvents;\n if (!delayedEvents.length) {\n return hit;\n }\n // Reset the propagation hint, because we start deeper in the tree again.\n interactionEvent.stopPropagationHint = false;\n var delayedLen = delayedEvents.length;\n this.delayedEvents = [];\n for (var i = 0; i < delayedLen; i++) {\n var _a = delayedEvents[i], displayObject_1 = _a.displayObject, eventString = _a.eventString, eventData = _a.eventData;\n // When we reach the object we wanted to stop propagating at,\n // set the propagation hint.\n if (eventData.stopsPropagatingAt === displayObject_1) {\n eventData.stopPropagationHint = true;\n }\n this.dispatchEvent(displayObject_1, eventString, eventData);\n }\n return hit;\n };\n /**\n * Is called when the pointer button is pressed down on the renderer element\n *\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer button being pressed down\n */\n InteractionManager.prototype.onPointerDown = function (originalEvent) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && originalEvent.pointerType === 'touch')\n { return; }\n var events = this.normalizeToPointerData(originalEvent);\n /**\n * No need to prevent default on natural pointer events, as there are no side effects\n * Normalized events, however, may have the double mousedown/touchstart issue on the native android browser,\n * so still need to be prevented.\n */\n // Guaranteed that there will be at least one event in events, and all events must have the same pointer type\n if (this.autoPreventDefault && events[0].isNormalized) {\n var cancelable = originalEvent.cancelable || !('cancelable' in originalEvent);\n if (cancelable) {\n originalEvent.preventDefault();\n }\n }\n var eventLen = events.length;\n for (var i = 0; i < eventLen; i++) {\n var event = events[i];\n var interactionData = this.getInteractionDataForPointerId(event);\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n interactionEvent.data.originalEvent = originalEvent;\n this.processInteractive(interactionEvent, this.lastObjectRendered, this.processPointerDown, true);\n this.emit('pointerdown', interactionEvent);\n if (event.pointerType === 'touch') {\n this.emit('touchstart', interactionEvent);\n }\n // emit a mouse event for \"pen\" pointers, the way a browser would emit a fallback event\n else if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n var isRightButton = event.button === 2;\n this.emit(isRightButton ? 'rightdown' : 'mousedown', this.eventData);\n }\n }\n };\n /**\n * Processes the result of the pointer down check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event\n * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n InteractionManager.prototype.processPointerDown = function (interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n var id = interactionEvent.data.identifier;\n if (hit) {\n if (!displayObject.trackedPointers[id]) {\n displayObject.trackedPointers[id] = new InteractionTrackingData(id);\n }\n this.dispatchEvent(displayObject, 'pointerdown', interactionEvent);\n if (data.pointerType === 'touch') {\n this.dispatchEvent(displayObject, 'touchstart', interactionEvent);\n }\n else if (data.pointerType === 'mouse' || data.pointerType === 'pen') {\n var isRightButton = data.button === 2;\n if (isRightButton) {\n displayObject.trackedPointers[id].rightDown = true;\n }\n else {\n displayObject.trackedPointers[id].leftDown = true;\n }\n this.dispatchEvent(displayObject, isRightButton ? 'rightdown' : 'mousedown', interactionEvent);\n }\n }\n };\n /**\n * Is called when the pointer button is released on the renderer element\n *\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer button being released\n * @param {boolean} cancelled - true if the pointer is cancelled\n * @param {Function} func - Function passed to {@link processInteractive}\n */\n InteractionManager.prototype.onPointerComplete = function (originalEvent, cancelled, func) {\n var events = this.normalizeToPointerData(originalEvent);\n var eventLen = events.length;\n // if the event wasn't targeting our canvas, then consider it to be pointerupoutside\n // in all cases (unless it was a pointercancel)\n var eventAppend = originalEvent.target !== this.interactionDOMElement ? 'outside' : '';\n for (var i = 0; i < eventLen; i++) {\n var event = events[i];\n var interactionData = this.getInteractionDataForPointerId(event);\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n interactionEvent.data.originalEvent = originalEvent;\n // perform hit testing for events targeting our canvas or cancel events\n this.processInteractive(interactionEvent, this.lastObjectRendered, func, cancelled || !eventAppend);\n this.emit(cancelled ? 'pointercancel' : \"pointerup\" + eventAppend, interactionEvent);\n if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n var isRightButton = event.button === 2;\n this.emit(isRightButton ? \"rightup\" + eventAppend : \"mouseup\" + eventAppend, interactionEvent);\n }\n else if (event.pointerType === 'touch') {\n this.emit(cancelled ? 'touchcancel' : \"touchend\" + eventAppend, interactionEvent);\n this.releaseInteractionDataForPointerId(event.pointerId);\n }\n }\n };\n /**\n * Is called when the pointer button is cancelled\n *\n * @private\n * @param {PointerEvent} event - The DOM event of a pointer button being released\n */\n InteractionManager.prototype.onPointerCancel = function (event) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && event.pointerType === 'touch')\n { return; }\n this.onPointerComplete(event, true, this.processPointerCancel);\n };\n /**\n * Processes the result of the pointer cancel check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event\n * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - The display object that was tested\n */\n InteractionManager.prototype.processPointerCancel = function (interactionEvent, displayObject) {\n var data = interactionEvent.data;\n var id = interactionEvent.data.identifier;\n if (displayObject.trackedPointers[id] !== undefined) {\n delete displayObject.trackedPointers[id];\n this.dispatchEvent(displayObject, 'pointercancel', interactionEvent);\n if (data.pointerType === 'touch') {\n this.dispatchEvent(displayObject, 'touchcancel', interactionEvent);\n }\n }\n };\n /**\n * Is called when the pointer button is released on the renderer element\n *\n * @private\n * @param {PointerEvent} event - The DOM event of a pointer button being released\n */\n InteractionManager.prototype.onPointerUp = function (event) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && event.pointerType === 'touch')\n { return; }\n this.onPointerComplete(event, false, this.processPointerUp);\n };\n /**\n * Processes the result of the pointer up check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event\n * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n InteractionManager.prototype.processPointerUp = function (interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n var id = interactionEvent.data.identifier;\n var trackingData = displayObject.trackedPointers[id];\n var isTouch = data.pointerType === 'touch';\n var isMouse = (data.pointerType === 'mouse' || data.pointerType === 'pen');\n // need to track mouse down status in the mouse block so that we can emit\n // event in a later block\n var isMouseTap = false;\n // Mouse only\n if (isMouse) {\n var isRightButton = data.button === 2;\n var flags = InteractionTrackingData.FLAGS;\n var test = isRightButton ? flags.RIGHT_DOWN : flags.LEFT_DOWN;\n var isDown = trackingData !== undefined && (trackingData.flags & test);\n if (hit) {\n this.dispatchEvent(displayObject, isRightButton ? 'rightup' : 'mouseup', interactionEvent);\n if (isDown) {\n this.dispatchEvent(displayObject, isRightButton ? 'rightclick' : 'click', interactionEvent);\n // because we can confirm that the mousedown happened on this object, flag for later emit of pointertap\n isMouseTap = true;\n }\n }\n else if (isDown) {\n this.dispatchEvent(displayObject, isRightButton ? 'rightupoutside' : 'mouseupoutside', interactionEvent);\n }\n // update the down state of the tracking data\n if (trackingData) {\n if (isRightButton) {\n trackingData.rightDown = false;\n }\n else {\n trackingData.leftDown = false;\n }\n }\n }\n // Pointers and Touches, and Mouse\n if (hit) {\n this.dispatchEvent(displayObject, 'pointerup', interactionEvent);\n if (isTouch)\n { this.dispatchEvent(displayObject, 'touchend', interactionEvent); }\n if (trackingData) {\n // emit pointertap if not a mouse, or if the mouse block decided it was a tap\n if (!isMouse || isMouseTap) {\n this.dispatchEvent(displayObject, 'pointertap', interactionEvent);\n }\n if (isTouch) {\n this.dispatchEvent(displayObject, 'tap', interactionEvent);\n // touches are no longer over (if they ever were) when we get the touchend\n // so we should ensure that we don't keep pretending that they are\n trackingData.over = false;\n }\n }\n }\n else if (trackingData) {\n this.dispatchEvent(displayObject, 'pointerupoutside', interactionEvent);\n if (isTouch)\n { this.dispatchEvent(displayObject, 'touchendoutside', interactionEvent); }\n }\n // Only remove the tracking data if there is no over/down state still associated with it\n if (trackingData && trackingData.none) {\n delete displayObject.trackedPointers[id];\n }\n };\n /**\n * Is called when the pointer moves across the renderer element\n *\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer moving\n */\n InteractionManager.prototype.onPointerMove = function (originalEvent) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && originalEvent.pointerType === 'touch')\n { return; }\n var events = this.normalizeToPointerData(originalEvent);\n if (events[0].pointerType === 'mouse' || events[0].pointerType === 'pen') {\n this._didMove = true;\n this.cursor = null;\n }\n var eventLen = events.length;\n for (var i = 0; i < eventLen; i++) {\n var event = events[i];\n var interactionData = this.getInteractionDataForPointerId(event);\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n interactionEvent.data.originalEvent = originalEvent;\n this.processInteractive(interactionEvent, this.lastObjectRendered, this.processPointerMove, true);\n this.emit('pointermove', interactionEvent);\n if (event.pointerType === 'touch')\n { this.emit('touchmove', interactionEvent); }\n if (event.pointerType === 'mouse' || event.pointerType === 'pen')\n { this.emit('mousemove', interactionEvent); }\n }\n if (events[0].pointerType === 'mouse') {\n this.setCursorMode(this.cursor);\n // TODO BUG for parents interactive object (border order issue)\n }\n };\n /**\n * Processes the result of the pointer move check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event\n * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n InteractionManager.prototype.processPointerMove = function (interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n var isTouch = data.pointerType === 'touch';\n var isMouse = (data.pointerType === 'mouse' || data.pointerType === 'pen');\n if (isMouse) {\n this.processPointerOverOut(interactionEvent, displayObject, hit);\n }\n if (!this.moveWhenInside || hit) {\n this.dispatchEvent(displayObject, 'pointermove', interactionEvent);\n if (isTouch)\n { this.dispatchEvent(displayObject, 'touchmove', interactionEvent); }\n if (isMouse)\n { this.dispatchEvent(displayObject, 'mousemove', interactionEvent); }\n }\n };\n /**\n * Is called when the pointer is moved out of the renderer element\n *\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer being moved out\n */\n InteractionManager.prototype.onPointerOut = function (originalEvent) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && originalEvent.pointerType === 'touch')\n { return; }\n var events = this.normalizeToPointerData(originalEvent);\n // Only mouse and pointer can call onPointerOut, so events will always be length 1\n var event = events[0];\n if (event.pointerType === 'mouse') {\n this.mouseOverRenderer = false;\n this.setCursorMode(null);\n }\n var interactionData = this.getInteractionDataForPointerId(event);\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n interactionEvent.data.originalEvent = event;\n this.processInteractive(interactionEvent, this.lastObjectRendered, this.processPointerOverOut, false);\n this.emit('pointerout', interactionEvent);\n if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n this.emit('mouseout', interactionEvent);\n }\n else {\n // we can get touchleave events after touchend, so we want to make sure we don't\n // introduce memory leaks\n this.releaseInteractionDataForPointerId(interactionData.identifier);\n }\n };\n /**\n * Processes the result of the pointer over/out check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event\n * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n InteractionManager.prototype.processPointerOverOut = function (interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n var id = interactionEvent.data.identifier;\n var isMouse = (data.pointerType === 'mouse' || data.pointerType === 'pen');\n var trackingData = displayObject.trackedPointers[id];\n // if we just moused over the display object, then we need to track that state\n if (hit && !trackingData) {\n trackingData = displayObject.trackedPointers[id] = new InteractionTrackingData(id);\n }\n if (trackingData === undefined)\n { return; }\n if (hit && this.mouseOverRenderer) {\n if (!trackingData.over) {\n trackingData.over = true;\n this.delayDispatchEvent(displayObject, 'pointerover', interactionEvent);\n if (isMouse) {\n this.delayDispatchEvent(displayObject, 'mouseover', interactionEvent);\n }\n }\n // only change the cursor if it has not already been changed (by something deeper in the\n // display tree)\n if (isMouse && this.cursor === null) {\n this.cursor = displayObject.cursor;\n }\n }\n else if (trackingData.over) {\n trackingData.over = false;\n this.dispatchEvent(displayObject, 'pointerout', this.eventData);\n if (isMouse) {\n this.dispatchEvent(displayObject, 'mouseout', interactionEvent);\n }\n // if there is no mouse down information for the pointer, then it is safe to delete\n if (trackingData.none) {\n delete displayObject.trackedPointers[id];\n }\n }\n };\n /**\n * Is called when the pointer is moved into the renderer element\n *\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer button being moved into the renderer view\n */\n InteractionManager.prototype.onPointerOver = function (originalEvent) {\n var events = this.normalizeToPointerData(originalEvent);\n // Only mouse and pointer can call onPointerOver, so events will always be length 1\n var event = events[0];\n var interactionData = this.getInteractionDataForPointerId(event);\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n interactionEvent.data.originalEvent = event;\n if (event.pointerType === 'mouse') {\n this.mouseOverRenderer = true;\n }\n this.emit('pointerover', interactionEvent);\n if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n this.emit('mouseover', interactionEvent);\n }\n };\n /**\n * Get InteractionData for a given pointerId. Store that data as well\n *\n * @private\n * @param {PointerEvent} event - Normalized pointer event, output from normalizeToPointerData\n * @return {PIXI.InteractionData} - Interaction data for the given pointer identifier\n */\n InteractionManager.prototype.getInteractionDataForPointerId = function (event) {\n var pointerId = event.pointerId;\n var interactionData;\n if (pointerId === MOUSE_POINTER_ID || event.pointerType === 'mouse') {\n interactionData = this.mouse;\n }\n else if (this.activeInteractionData[pointerId]) {\n interactionData = this.activeInteractionData[pointerId];\n }\n else {\n interactionData = this.interactionDataPool.pop() || new InteractionData();\n interactionData.identifier = pointerId;\n this.activeInteractionData[pointerId] = interactionData;\n }\n // copy properties from the event, so that we can make sure that touch/pointer specific\n // data is available\n interactionData.copyEvent(event);\n return interactionData;\n };\n /**\n * Return unused InteractionData to the pool, for a given pointerId\n *\n * @private\n * @param {number} pointerId - Identifier from a pointer event\n */\n InteractionManager.prototype.releaseInteractionDataForPointerId = function (pointerId) {\n var interactionData = this.activeInteractionData[pointerId];\n if (interactionData) {\n delete this.activeInteractionData[pointerId];\n interactionData.reset();\n this.interactionDataPool.push(interactionData);\n }\n };\n /**\n * Configure an InteractionEvent to wrap a DOM PointerEvent and InteractionData\n *\n * @private\n * @param {PIXI.InteractionEvent} interactionEvent - The event to be configured\n * @param {PointerEvent} pointerEvent - The DOM event that will be paired with the InteractionEvent\n * @param {PIXI.InteractionData} interactionData - The InteractionData that will be paired\n * with the InteractionEvent\n * @return {PIXI.InteractionEvent} the interaction event that was passed in\n */\n InteractionManager.prototype.configureInteractionEventForDOMEvent = function (interactionEvent, pointerEvent, interactionData) {\n interactionEvent.data = interactionData;\n this.mapPositionToPoint(interactionData.global, pointerEvent.clientX, pointerEvent.clientY);\n // Not really sure why this is happening, but it's how a previous version handled things\n if (pointerEvent.pointerType === 'touch') {\n pointerEvent.globalX = interactionData.global.x;\n pointerEvent.globalY = interactionData.global.y;\n }\n interactionData.originalEvent = pointerEvent;\n interactionEvent.reset();\n return interactionEvent;\n };\n /**\n * Ensures that the original event object contains all data that a regular pointer event would have\n *\n * @private\n * @param {TouchEvent|MouseEvent|PointerEvent} event - The original event data from a touch or mouse event\n * @return {PointerEvent[]} An array containing a single normalized pointer event, in the case of a pointer\n * or mouse event, or a multiple normalized pointer events if there are multiple changed touches\n */\n InteractionManager.prototype.normalizeToPointerData = function (event) {\n var normalizedEvents = [];\n if (this.supportsTouchEvents && event instanceof TouchEvent) {\n for (var i = 0, li = event.changedTouches.length; i < li; i++) {\n var touch = event.changedTouches[i];\n if (typeof touch.button === 'undefined')\n { touch.button = event.touches.length ? 1 : 0; }\n if (typeof touch.buttons === 'undefined')\n { touch.buttons = event.touches.length ? 1 : 0; }\n if (typeof touch.isPrimary === 'undefined') {\n touch.isPrimary = event.touches.length === 1 && event.type === 'touchstart';\n }\n if (typeof touch.width === 'undefined')\n { touch.width = touch.radiusX || 1; }\n if (typeof touch.height === 'undefined')\n { touch.height = touch.radiusY || 1; }\n if (typeof touch.tiltX === 'undefined')\n { touch.tiltX = 0; }\n if (typeof touch.tiltY === 'undefined')\n { touch.tiltY = 0; }\n if (typeof touch.pointerType === 'undefined')\n { touch.pointerType = 'touch'; }\n if (typeof touch.pointerId === 'undefined')\n { touch.pointerId = touch.identifier || 0; }\n if (typeof touch.pressure === 'undefined')\n { touch.pressure = touch.force || 0.5; }\n if (typeof touch.twist === 'undefined')\n { touch.twist = 0; }\n if (typeof touch.tangentialPressure === 'undefined')\n { touch.tangentialPressure = 0; }\n // TODO: Remove these, as layerX/Y is not a standard, is deprecated, has uneven\n // support, and the fill ins are not quite the same\n // offsetX/Y might be okay, but is not the same as clientX/Y when the canvas's top\n // left is not 0,0 on the page\n if (typeof touch.layerX === 'undefined')\n { touch.layerX = touch.offsetX = touch.clientX; }\n if (typeof touch.layerY === 'undefined')\n { touch.layerY = touch.offsetY = touch.clientY; }\n // mark the touch as normalized, just so that we know we did it\n touch.isNormalized = true;\n normalizedEvents.push(touch);\n }\n }\n // apparently PointerEvent subclasses MouseEvent, so yay\n else if (event instanceof MouseEvent && (!this.supportsPointerEvents || !(event instanceof window.PointerEvent))) {\n var tempEvent = event;\n if (typeof tempEvent.isPrimary === 'undefined')\n { tempEvent.isPrimary = true; }\n if (typeof tempEvent.width === 'undefined')\n { tempEvent.width = 1; }\n if (typeof tempEvent.height === 'undefined')\n { tempEvent.height = 1; }\n if (typeof tempEvent.tiltX === 'undefined')\n { tempEvent.tiltX = 0; }\n if (typeof tempEvent.tiltY === 'undefined')\n { tempEvent.tiltY = 0; }\n if (typeof tempEvent.pointerType === 'undefined')\n { tempEvent.pointerType = 'mouse'; }\n if (typeof tempEvent.pointerId === 'undefined')\n { tempEvent.pointerId = MOUSE_POINTER_ID; }\n if (typeof tempEvent.pressure === 'undefined')\n { tempEvent.pressure = 0.5; }\n if (typeof tempEvent.twist === 'undefined')\n { tempEvent.twist = 0; }\n if (typeof tempEvent.tangentialPressure === 'undefined')\n { tempEvent.tangentialPressure = 0; }\n // mark the mouse event as normalized, just so that we know we did it\n tempEvent.isNormalized = true;\n normalizedEvents.push(tempEvent);\n }\n else {\n normalizedEvents.push(event);\n }\n return normalizedEvents;\n };\n /**\n * Destroys the interaction manager\n *\n */\n InteractionManager.prototype.destroy = function () {\n this.removeEvents();\n this.removeTickerListener();\n this.removeAllListeners();\n this.renderer = null;\n this.mouse = null;\n this.eventData = null;\n this.interactionDOMElement = null;\n this.onPointerDown = null;\n this.processPointerDown = null;\n this.onPointerUp = null;\n this.processPointerUp = null;\n this.onPointerCancel = null;\n this.processPointerCancel = null;\n this.onPointerMove = null;\n this.processPointerMove = null;\n this.onPointerOut = null;\n this.processPointerOverOut = null;\n this.onPointerOver = null;\n this.search = null;\n };\n return InteractionManager;\n}(EventEmitter));\n\nexport { InteractionData, InteractionEvent, InteractionManager, InteractionTrackingData, interactiveTarget };\n//# sourceMappingURL=interaction.es.js.map\n","/*!\n * @pixi/app - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/app is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Container } from '@pixi/display';\nimport { autoDetectRenderer } from '@pixi/core';\n\n/**\n * Convenience class to create a new PIXI application.\n *\n * This class automatically creates the renderer, ticker and root container.\n *\n * @example\n * // Create the application\n * const app = new PIXI.Application();\n *\n * // Add the view to the DOM\n * document.body.appendChild(app.view);\n *\n * // ex, add display objects\n * app.stage.addChild(PIXI.Sprite.from('something.png'));\n *\n * @class\n * @memberof PIXI\n */\nvar Application = /** @class */ (function () {\n /**\n * @param {object} [options] - The optional renderer parameters.\n * @param {boolean} [options.autoStart=true] - Automatically starts the rendering after the construction.\n * **Note**: Setting this parameter to false does NOT stop the shared ticker even if you set\n * options.sharedTicker to true in case that it is already started. Stop it by your own.\n * @param {number} [options.width=800] - The width of the renderers view.\n * @param {number} [options.height=600] - The height of the renderers view.\n * @param {HTMLCanvasElement} [options.view] - The canvas to use as a view, optional.\n * @param {boolean} [options.transparent=false] - If the render view is transparent.\n * @param {boolean} [options.autoDensity=false] - Resizes renderer view in CSS pixels to allow for\n * resolutions other than 1.\n * @param {boolean} [options.antialias=false] - Sets antialias\n * @param {boolean} [options.preserveDrawingBuffer=false] - Enables drawing buffer preservation, enable this if you\n * need to call toDataUrl on the WebGL context.\n * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer, retina would be 2.\n * @param {boolean} [options.forceCanvas=false] - prevents selection of WebGL renderer, even if such is present, this\n * option only is available when using **pixi.js-legacy** or **@pixi/canvas-renderer** modules, otherwise\n * it is ignored.\n * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area\n * (shown if not transparent).\n * @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or\n * not before the new render pass.\n * @param {string} [options.powerPreference] - Parameter passed to webgl context, set to \"high-performance\"\n * for devices with dual graphics card. **(WebGL only)**.\n * @param {boolean} [options.sharedTicker=false] - `true` to use PIXI.Ticker.shared, `false` to create new ticker.\n * If set to false, you cannot register a handler to occur before anything that runs on the shared ticker.\n * The system ticker will always run before both the shared ticker and the app ticker.\n * @param {boolean} [options.sharedLoader=false] - `true` to use PIXI.Loader.shared, `false` to create new Loader.\n * @param {Window|HTMLElement} [options.resizeTo] - Element to automatically resize stage to.\n */\n function Application(options) {\n var _this = this;\n // The default options\n options = Object.assign({\n forceCanvas: false,\n }, options);\n /**\n * WebGL renderer if available, otherwise CanvasRenderer.\n * @member {PIXI.Renderer|PIXI.CanvasRenderer}\n */\n this.renderer = autoDetectRenderer(options);\n /**\n * The root display container that's rendered.\n * @member {PIXI.Container}\n */\n this.stage = new Container();\n // install plugins here\n Application._plugins.forEach(function (plugin) {\n plugin.init.call(_this, options);\n });\n }\n /**\n * Register a middleware plugin for the application\n * @static\n * @param {PIXI.Application.Plugin} plugin - Plugin being installed\n */\n Application.registerPlugin = function (plugin) {\n Application._plugins.push(plugin);\n };\n /**\n * Render the current stage.\n */\n Application.prototype.render = function () {\n // TODO: Since CanvasRenderer has not been converted this function thinks it takes DisplayObject & PIXI.DisplayObject\n // This can be fixed when CanvasRenderer is converted.\n this.renderer.render(this.stage);\n };\n Object.defineProperty(Application.prototype, \"view\", {\n /**\n * Reference to the renderer's canvas element.\n * @member {HTMLCanvasElement}\n * @readonly\n */\n get: function () {\n return this.renderer.view;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Application.prototype, \"screen\", {\n /**\n * Reference to the renderer's screen rectangle. Its safe to use as `filterArea` or `hitArea` for the whole screen.\n * @member {PIXI.Rectangle}\n * @readonly\n */\n get: function () {\n return this.renderer.screen;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Destroy and don't use after this.\n * @param {Boolean} [removeView=false] - Automatically remove canvas from DOM.\n * @param {object|boolean} [stageOptions] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [stageOptions.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'stageOptions' will be passed on to those calls.\n * @param {boolean} [stageOptions.texture=false] - Only used for child Sprites if stageOptions.children is set\n * to true. Should it destroy the texture of the child sprite\n * @param {boolean} [stageOptions.baseTexture=false] - Only used for child Sprites if stageOptions.children is set\n * to true. Should it destroy the base texture of the child sprite\n */\n Application.prototype.destroy = function (removeView, stageOptions) {\n var _this = this;\n // Destroy plugins in the opposite order\n // which they were constructed\n var plugins = Application._plugins.slice(0);\n plugins.reverse();\n plugins.forEach(function (plugin) {\n plugin.destroy.call(_this);\n });\n this.stage.destroy(stageOptions);\n this.stage = null;\n this.renderer.destroy(removeView);\n this.renderer = null;\n };\n return Application;\n}());\n/**\n * @memberof PIXI.Application\n * @typedef {object} Plugin\n * @property {function} init - Called when Application is constructed, scoped to Application instance.\n * Passes in `options` as the only argument, which are Application constructor options.\n * @property {function} destroy - Called when destroying Application, scoped to Application instance\n */\n/**\n * Collection of installed plugins.\n * @static\n * @private\n * @type {PIXI.Application.Plugin[]}\n */\nApplication._plugins = [];\n\n/**\n * Middleware for for Application's resize functionality\n * @private\n * @class\n */\nvar ResizePlugin = /** @class */ (function () {\n function ResizePlugin() {\n }\n /**\n * Initialize the plugin with scope of application instance\n * @static\n * @private\n * @param {object} [options] - See application options\n */\n ResizePlugin.init = function (options) {\n var _this = this;\n /**\n * The HTML element or window to automatically resize the\n * renderer's view element to match width and height.\n * @type {Window|HTMLElement}\n * @name resizeTo\n * @memberof PIXI.Application#\n */\n Object.defineProperty(this, 'resizeTo', {\n set: function (dom) {\n window.removeEventListener('resize', this.queueResize);\n this._resizeTo = dom;\n if (dom) {\n window.addEventListener('resize', this.queueResize);\n this.resize();\n }\n },\n get: function () {\n return this._resizeTo;\n },\n });\n /**\n * Resize is throttled, so it's\n * safe to call this multiple times per frame and it'll\n * only be called once.\n * @method PIXI.Application#queueResize\n */\n this.queueResize = function () {\n if (!_this._resizeTo) {\n return;\n }\n _this.cancelResize();\n // // Throttle resize events per raf\n _this._resizeId = requestAnimationFrame(function () { return _this.resize(); });\n };\n /**\n * Cancel the resize queue.\n * @method PIXI.Application#cancelResize\n * @private\n */\n this.cancelResize = function () {\n if (_this._resizeId) {\n cancelAnimationFrame(_this._resizeId);\n _this._resizeId = null;\n }\n };\n /**\n * Execute an immediate resize on the renderer, this is not\n * throttled and can be expensive to call many times in a row.\n * Will resize only if `resizeTo` property is set.\n * @method PIXI.Application#resize\n */\n this.resize = function () {\n if (!_this._resizeTo) {\n return;\n }\n // clear queue resize\n _this.cancelResize();\n var width;\n var height;\n // Resize to the window\n if (_this._resizeTo === window) {\n width = window.innerWidth;\n height = window.innerHeight;\n }\n // Resize to other HTML entities\n else {\n var _a = _this._resizeTo, clientWidth = _a.clientWidth, clientHeight = _a.clientHeight;\n width = clientWidth;\n height = clientHeight;\n }\n _this.renderer.resize(width, height);\n };\n // On resize\n this._resizeId = null;\n this._resizeTo = null;\n this.resizeTo = options.resizeTo || null;\n };\n /**\n * Clean up the ticker, scoped to application\n * @static\n * @private\n */\n ResizePlugin.destroy = function () {\n this.cancelResize();\n this.cancelResize = null;\n this.queueResize = null;\n this.resizeTo = null;\n this.resize = null;\n };\n return ResizePlugin;\n}());\n\nApplication.registerPlugin(ResizePlugin);\n\nexport { Application };\n//# sourceMappingURL=app.es.js.map\n","/*!\n * @pixi/extract - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/extract is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { CanvasRenderTarget } from '@pixi/utils';\nimport { Rectangle } from '@pixi/math';\nimport { RenderTexture } from '@pixi/core';\n\nvar TEMP_RECT = new Rectangle();\nvar BYTES_PER_PIXEL = 4;\n/**\n * This class provides renderer-specific plugins for exporting content from a renderer.\n * For instance, these plugins can be used for saving an Image, Canvas element or for exporting the raw image data (pixels).\n *\n * Do not instantiate these plugins directly. It is available from the `renderer.plugins` property.\n * See {@link PIXI.CanvasRenderer#plugins} or {@link PIXI.Renderer#plugins}.\n * @example\n * // Create a new app (will auto-add extract plugin to renderer)\n * const app = new PIXI.Application();\n *\n * // Draw a red circle\n * const graphics = new PIXI.Graphics()\n * .beginFill(0xFF0000)\n * .drawCircle(0, 0, 50);\n *\n * // Render the graphics as an HTMLImageElement\n * const image = app.renderer.plugins.extract.image(graphics);\n * document.body.appendChild(image);\n * @class\n * @memberof PIXI\n */\nvar Extract = /** @class */ (function () {\n /**\n * @param {PIXI.Renderer} renderer - A reference to the current renderer\n */\n function Extract(renderer) {\n this.renderer = renderer;\n /**\n * Collection of methods for extracting data (image, pixels, etc.) from a display object or render texture\n *\n * @member {PIXI.Extract} extract\n * @memberof PIXI.Renderer#\n * @see PIXI.Extract\n */\n renderer.extract = this;\n }\n /**\n * Will return a HTML Image of the target\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use the main renderer\n * @param {string} [format] - Image format, e.g. \"image/jpeg\" or \"image/webp\".\n * @param {number} [quality] - JPEG or Webp compression from 0 to 1. Default is 0.92.\n * @return {HTMLImageElement} HTML Image of the target\n */\n Extract.prototype.image = function (target, format, quality) {\n var image = new Image();\n image.src = this.base64(target, format, quality);\n return image;\n };\n /**\n * Will return a a base64 encoded string of this target. It works by calling\n * `Extract.getCanvas` and then running toDataURL on that.\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use the main renderer\n * @param {string} [format] - Image format, e.g. \"image/jpeg\" or \"image/webp\".\n * @param {number} [quality] - JPEG or Webp compression from 0 to 1. Default is 0.92.\n * @return {string} A base64 encoded string of the texture.\n */\n Extract.prototype.base64 = function (target, format, quality) {\n return this.canvas(target).toDataURL(format, quality);\n };\n /**\n * Creates a Canvas element, renders this target to it and then returns it.\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use the main renderer\n * @return {HTMLCanvasElement} A Canvas element with the texture rendered on.\n */\n Extract.prototype.canvas = function (target) {\n var renderer = this.renderer;\n var resolution;\n var frame;\n var flipY = false;\n var renderTexture;\n var generated = false;\n if (target) {\n if (target instanceof RenderTexture) {\n renderTexture = target;\n }\n else {\n renderTexture = this.renderer.generateTexture(target);\n generated = true;\n }\n }\n if (renderTexture) {\n resolution = renderTexture.baseTexture.resolution;\n frame = renderTexture.frame;\n flipY = false;\n renderer.renderTexture.bind(renderTexture);\n }\n else {\n resolution = this.renderer.resolution;\n flipY = true;\n frame = TEMP_RECT;\n frame.width = this.renderer.width;\n frame.height = this.renderer.height;\n renderer.renderTexture.bind(null);\n }\n var width = Math.floor((frame.width * resolution) + 1e-4);\n var height = Math.floor((frame.height * resolution) + 1e-4);\n var canvasBuffer = new CanvasRenderTarget(width, height, 1);\n var webglPixels = new Uint8Array(BYTES_PER_PIXEL * width * height);\n // read pixels to the array\n var gl = renderer.gl;\n gl.readPixels(frame.x * resolution, frame.y * resolution, width, height, gl.RGBA, gl.UNSIGNED_BYTE, webglPixels);\n // add the pixels to the canvas\n var canvasData = canvasBuffer.context.getImageData(0, 0, width, height);\n Extract.arrayPostDivide(webglPixels, canvasData.data);\n canvasBuffer.context.putImageData(canvasData, 0, 0);\n // pulling pixels\n if (flipY) {\n var target_1 = new CanvasRenderTarget(canvasBuffer.width, canvasBuffer.height, 1);\n target_1.context.scale(1, -1);\n // we can't render to itself because we should be empty before render.\n target_1.context.drawImage(canvasBuffer.canvas, 0, -height);\n canvasBuffer.destroy();\n canvasBuffer = target_1;\n }\n if (generated) {\n renderTexture.destroy(true);\n }\n // send the canvas back..\n return canvasBuffer.canvas;\n };\n /**\n * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA\n * order, with integer values between 0 and 255 (included).\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use the main renderer\n * @return {Uint8Array} One-dimensional array containing the pixel data of the entire texture\n */\n Extract.prototype.pixels = function (target) {\n var renderer = this.renderer;\n var resolution;\n var frame;\n var renderTexture;\n var generated = false;\n if (target) {\n if (target instanceof RenderTexture) {\n renderTexture = target;\n }\n else {\n renderTexture = this.renderer.generateTexture(target);\n generated = true;\n }\n }\n if (renderTexture) {\n resolution = renderTexture.baseTexture.resolution;\n frame = renderTexture.frame;\n // bind the buffer\n renderer.renderTexture.bind(renderTexture);\n }\n else {\n resolution = renderer.resolution;\n frame = TEMP_RECT;\n frame.width = renderer.width;\n frame.height = renderer.height;\n renderer.renderTexture.bind(null);\n }\n var width = frame.width * resolution;\n var height = frame.height * resolution;\n var webglPixels = new Uint8Array(BYTES_PER_PIXEL * width * height);\n // read pixels to the array\n var gl = renderer.gl;\n gl.readPixels(frame.x * resolution, frame.y * resolution, width, height, gl.RGBA, gl.UNSIGNED_BYTE, webglPixels);\n if (generated) {\n renderTexture.destroy(true);\n }\n Extract.arrayPostDivide(webglPixels, webglPixels);\n return webglPixels;\n };\n /**\n * Destroys the extract\n *\n */\n Extract.prototype.destroy = function () {\n this.renderer.extract = null;\n this.renderer = null;\n };\n /**\n * Takes premultiplied pixel data and produces regular pixel data\n *\n * @private\n * @param pixels {number[] | Uint8Array | Uint8ClampedArray} array of pixel data\n * @param out {number[] | Uint8Array | Uint8ClampedArray} output array\n */\n Extract.arrayPostDivide = function (pixels, out) {\n for (var i = 0; i < pixels.length; i += 4) {\n var alpha = out[i + 3] = pixels[i + 3];\n if (alpha !== 0) {\n out[i] = Math.round(Math.min(pixels[i] * 255.0 / alpha, 255.0));\n out[i + 1] = Math.round(Math.min(pixels[i + 1] * 255.0 / alpha, 255.0));\n out[i + 2] = Math.round(Math.min(pixels[i + 2] * 255.0 / alpha, 255.0));\n }\n else {\n out[i] = pixels[i];\n out[i + 1] = pixels[i + 1];\n out[i + 2] = pixels[i + 2];\n }\n }\n };\n return Extract;\n}());\n\nexport { Extract };\n//# sourceMappingURL=extract.es.js.map\n","/*!\n * resource-loader - v3.0.1\n * https://github.com/pixijs/pixi-sound\n * Compiled Tue, 02 Jul 2019 14:06:18 UTC\n *\n * resource-loader is licensed under the MIT license.\n * http://www.opensource.org/licenses/mit-license\n */\nimport parseUri from 'parse-uri';\nimport Signal from 'mini-signals';\n\n/**\n * Smaller version of the async library constructs.\n *\n * @namespace async\n */\n\n/**\n * Noop function\n *\n * @ignore\n * @function\n * @memberof async\n */\nfunction _noop() {}\n/* empty */\n\n/**\n * Iterates an array in series.\n *\n * @memberof async\n * @function eachSeries\n * @param {Array.<*>} array - Array to iterate.\n * @param {function} iterator - Function to call for each element.\n * @param {function} callback - Function to call when done, or on error.\n * @param {boolean} [deferNext=false] - Break synchronous each loop by calling next with a setTimeout of 1.\n */\n\n\nfunction eachSeries(array, iterator, callback, deferNext) {\n var i = 0;\n var len = array.length;\n\n (function next(err) {\n if (err || i === len) {\n if (callback) {\n callback(err);\n }\n\n return;\n }\n\n if (deferNext) {\n setTimeout(function () {\n iterator(array[i++], next);\n }, 1);\n } else {\n iterator(array[i++], next);\n }\n })();\n}\n/**\n * Ensures a function is only called once.\n *\n * @ignore\n * @memberof async\n * @param {function} fn - The function to wrap.\n * @return {function} The wrapping function.\n */\n\nfunction onlyOnce(fn) {\n return function onceWrapper() {\n if (fn === null) {\n throw new Error('Callback was already called.');\n }\n\n var callFn = fn;\n fn = null;\n callFn.apply(this, arguments);\n };\n}\n/**\n * Async queue implementation,\n *\n * @memberof async\n * @function queue\n * @param {function} worker - The worker function to call for each task.\n * @param {number} concurrency - How many workers to run in parrallel.\n * @return {*} The async queue object.\n */\n\n\nfunction queue(worker, concurrency) {\n if (concurrency == null) {\n // eslint-disable-line no-eq-null,eqeqeq\n concurrency = 1;\n } else if (concurrency === 0) {\n throw new Error('Concurrency must not be zero');\n }\n\n var workers = 0;\n var q = {\n _tasks: [],\n concurrency: concurrency,\n saturated: _noop,\n unsaturated: _noop,\n buffer: concurrency / 4,\n empty: _noop,\n drain: _noop,\n error: _noop,\n started: false,\n paused: false,\n push: function push(data, callback) {\n _insert(data, false, callback);\n },\n kill: function kill() {\n workers = 0;\n q.drain = _noop;\n q.started = false;\n q._tasks = [];\n },\n unshift: function unshift(data, callback) {\n _insert(data, true, callback);\n },\n process: function process() {\n while (!q.paused && workers < q.concurrency && q._tasks.length) {\n var task = q._tasks.shift();\n\n if (q._tasks.length === 0) {\n q.empty();\n }\n\n workers += 1;\n\n if (workers === q.concurrency) {\n q.saturated();\n }\n\n worker(task.data, onlyOnce(_next(task)));\n }\n },\n length: function length() {\n return q._tasks.length;\n },\n running: function running() {\n return workers;\n },\n idle: function idle() {\n return q._tasks.length + workers === 0;\n },\n pause: function pause() {\n if (q.paused === true) {\n return;\n }\n\n q.paused = true;\n },\n resume: function resume() {\n if (q.paused === false) {\n return;\n }\n\n q.paused = false; // Need to call q.process once per concurrent\n // worker to preserve full concurrency after pause\n\n for (var w = 1; w <= q.concurrency; w++) {\n q.process();\n }\n }\n };\n\n function _insert(data, insertAtFront, callback) {\n if (callback != null && typeof callback !== 'function') {\n // eslint-disable-line no-eq-null,eqeqeq\n throw new Error('task callback must be a function');\n }\n\n q.started = true;\n\n if (data == null && q.idle()) {\n // eslint-disable-line no-eq-null,eqeqeq\n // call drain immediately if there are no tasks\n setTimeout(function () {\n return q.drain();\n }, 1);\n return;\n }\n\n var item = {\n data: data,\n callback: typeof callback === 'function' ? callback : _noop\n };\n\n if (insertAtFront) {\n q._tasks.unshift(item);\n } else {\n q._tasks.push(item);\n }\n\n setTimeout(function () {\n return q.process();\n }, 1);\n }\n\n function _next(task) {\n return function next() {\n workers -= 1;\n task.callback.apply(task, arguments);\n\n if (arguments[0] != null) {\n // eslint-disable-line no-eq-null,eqeqeq\n q.error(arguments[0], task.data);\n }\n\n if (workers <= q.concurrency - q.buffer) {\n q.unsaturated();\n }\n\n if (q.idle()) {\n q.drain();\n }\n\n q.process();\n };\n }\n\n return q;\n}\n\nvar async = ({\n eachSeries: eachSeries,\n queue: queue\n});\n\n// a simple in-memory cache for resources\nvar cache = {};\n/**\n * A simple in-memory cache for resource.\n *\n * @memberof middleware\n * @function caching\n * @example\n * import { Loader, middleware } from 'resource-loader';\n * const loader = new Loader();\n * loader.use(middleware.caching);\n * @param {Resource} resource - Current Resource\n * @param {function} next - Callback when complete\n */\n\nfunction caching(resource, next) {\n var _this = this;\n\n // if cached, then set data and complete the resource\n if (cache[resource.url]) {\n resource.data = cache[resource.url];\n resource.complete(); // marks resource load complete and stops processing before middlewares\n } // if not cached, wait for complete and store it in the cache.\n else {\n resource.onComplete.once(function () {\n return cache[_this.url] = _this.data;\n });\n }\n\n next();\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nvar useXdr = !!(window.XDomainRequest && !('withCredentials' in new XMLHttpRequest()));\nvar tempAnchor = null; // some status constants\n\nvar STATUS_NONE = 0;\nvar STATUS_OK = 200;\nvar STATUS_EMPTY = 204;\nvar STATUS_IE_BUG_EMPTY = 1223;\nvar STATUS_TYPE_OK = 2; // noop\n\nfunction _noop$1() {}\n/* empty */\n\n/**\n * Manages the state and loading of a resource and all child resources.\n *\n * @class\n */\n\n\nvar Resource =\n/*#__PURE__*/\nfunction () {\n /**\n * Sets the load type to be used for a specific extension.\n *\n * @static\n * @param {string} extname - The extension to set the type for, e.g. \"png\" or \"fnt\"\n * @param {Resource.LOAD_TYPE} loadType - The load type to set it to.\n */\n Resource.setExtensionLoadType = function setExtensionLoadType(extname, loadType) {\n setExtMap(Resource._loadTypeMap, extname, loadType);\n }\n /**\n * Sets the load type to be used for a specific extension.\n *\n * @static\n * @param {string} extname - The extension to set the type for, e.g. \"png\" or \"fnt\"\n * @param {Resource.XHR_RESPONSE_TYPE} xhrType - The xhr type to set it to.\n */\n ;\n\n Resource.setExtensionXhrType = function setExtensionXhrType(extname, xhrType) {\n setExtMap(Resource._xhrTypeMap, extname, xhrType);\n }\n /**\n * @param {string} name - The name of the resource to load.\n * @param {string|string[]} url - The url for this resource, for audio/video loads you can pass\n * an array of sources.\n * @param {object} [options] - The options for the load.\n * @param {string|boolean} [options.crossOrigin] - Is this request cross-origin? Default is to\n * determine automatically.\n * @param {number} [options.timeout=0] - A timeout in milliseconds for the load. If the load takes\n * longer than this time it is cancelled and the load is considered a failure. If this value is\n * set to `0` then there is no explicit timeout.\n * @param {Resource.LOAD_TYPE} [options.loadType=Resource.LOAD_TYPE.XHR] - How should this resource\n * be loaded?\n * @param {Resource.XHR_RESPONSE_TYPE} [options.xhrType=Resource.XHR_RESPONSE_TYPE.DEFAULT] - How\n * should the data being loaded be interpreted when using XHR?\n * @param {Resource.IMetadata} [options.metadata] - Extra configuration for middleware and the Resource object.\n */\n ;\n\n function Resource(name, url, options) {\n if (typeof name !== 'string' || typeof url !== 'string') {\n throw new Error('Both name and url are required for constructing a resource.');\n }\n\n options = options || {};\n /**\n * The state flags of this resource.\n *\n * @private\n * @member {number}\n */\n\n this._flags = 0; // set data url flag, needs to be set early for some _determineX checks to work.\n\n this._setFlag(Resource.STATUS_FLAGS.DATA_URL, url.indexOf('data:') === 0);\n /**\n * The name of this resource.\n *\n * @readonly\n * @member {string}\n */\n\n\n this.name = name;\n /**\n * The url used to load this resource.\n *\n * @readonly\n * @member {string}\n */\n\n this.url = url;\n /**\n * The extension used to load this resource.\n *\n * @readonly\n * @member {string}\n */\n\n this.extension = this._getExtension();\n /**\n * The data that was loaded by the resource.\n *\n * @member {any}\n */\n\n this.data = null;\n /**\n * Is this request cross-origin? If unset, determined automatically.\n *\n * @member {string}\n */\n\n this.crossOrigin = options.crossOrigin === true ? 'anonymous' : options.crossOrigin;\n /**\n * A timeout in milliseconds for the load. If the load takes longer than this time\n * it is cancelled and the load is considered a failure. If this value is set to `0`\n * then there is no explicit timeout.\n *\n * @member {number}\n */\n\n this.timeout = options.timeout || 0;\n /**\n * The method of loading to use for this resource.\n *\n * @member {Resource.LOAD_TYPE}\n */\n\n this.loadType = options.loadType || this._determineLoadType();\n /**\n * The type used to load the resource via XHR. If unset, determined automatically.\n *\n * @member {string}\n */\n\n this.xhrType = options.xhrType;\n /**\n * Extra info for middleware, and controlling specifics about how the resource loads.\n *\n * Note that if you pass in a `loadElement`, the Resource class takes ownership of it.\n * Meaning it will modify it as it sees fit.\n *\n * @member {Resource.IMetadata}\n */\n\n this.metadata = options.metadata || {};\n /**\n * The error that occurred while loading (if any).\n *\n * @readonly\n * @member {Error}\n */\n\n this.error = null;\n /**\n * The XHR object that was used to load this resource. This is only set\n * when `loadType` is `Resource.LOAD_TYPE.XHR`.\n *\n * @readonly\n * @member {XMLHttpRequest}\n */\n\n this.xhr = null;\n /**\n * The child resources this resource owns.\n *\n * @readonly\n * @member {Resource[]}\n */\n\n this.children = [];\n /**\n * The resource type.\n *\n * @readonly\n * @member {Resource.TYPE}\n */\n\n this.type = Resource.TYPE.UNKNOWN;\n /**\n * The progress chunk owned by this resource.\n *\n * @readonly\n * @member {number}\n */\n\n this.progressChunk = 0;\n /**\n * The `dequeue` method that will be used a storage place for the async queue dequeue method\n * used privately by the loader.\n *\n * @private\n * @member {function}\n */\n\n this._dequeue = _noop$1;\n /**\n * Used a storage place for the on load binding used privately by the loader.\n *\n * @private\n * @member {function}\n */\n\n this._onLoadBinding = null;\n /**\n * The timer for element loads to check if they timeout.\n *\n * @private\n * @member {number}\n */\n\n this._elementTimer = 0;\n /**\n * The `complete` function bound to this resource's context.\n *\n * @private\n * @member {function}\n */\n\n this._boundComplete = this.complete.bind(this);\n /**\n * The `_onError` function bound to this resource's context.\n *\n * @private\n * @member {function}\n */\n\n this._boundOnError = this._onError.bind(this);\n /**\n * The `_onProgress` function bound to this resource's context.\n *\n * @private\n * @member {function}\n */\n\n this._boundOnProgress = this._onProgress.bind(this);\n /**\n * The `_onTimeout` function bound to this resource's context.\n *\n * @private\n * @member {function}\n */\n\n this._boundOnTimeout = this._onTimeout.bind(this); // xhr callbacks\n\n this._boundXhrOnError = this._xhrOnError.bind(this);\n this._boundXhrOnTimeout = this._xhrOnTimeout.bind(this);\n this._boundXhrOnAbort = this._xhrOnAbort.bind(this);\n this._boundXhrOnLoad = this._xhrOnLoad.bind(this);\n /**\n * Dispatched when the resource beings to load.\n *\n * The callback looks like {@link Resource.OnStartSignal}.\n *\n * @member {Signal}\n */\n\n this.onStart = new Signal();\n /**\n * Dispatched each time progress of this resource load updates.\n * Not all resources types and loader systems can support this event\n * so sometimes it may not be available. If the resource\n * is being loaded on a modern browser, using XHR, and the remote server\n * properly sets Content-Length headers, then this will be available.\n *\n * The callback looks like {@link Resource.OnProgressSignal}.\n *\n * @member {Signal}\n */\n\n this.onProgress = new Signal();\n /**\n * Dispatched once this resource has loaded, if there was an error it will\n * be in the `error` property.\n *\n * The callback looks like {@link Resource.OnCompleteSignal}.\n *\n * @member {Signal}\n */\n\n this.onComplete = new Signal();\n /**\n * Dispatched after this resource has had all the *after* middleware run on it.\n *\n * The callback looks like {@link Resource.OnCompleteSignal}.\n *\n * @member {Signal}\n */\n\n this.onAfterMiddleware = new Signal();\n }\n /**\n * When the resource starts to load.\n *\n * @memberof Resource\n * @callback OnStartSignal\n * @param {Resource} resource - The resource that the event happened on.\n */\n\n /**\n * When the resource reports loading progress.\n *\n * @memberof Resource\n * @callback OnProgressSignal\n * @param {Resource} resource - The resource that the event happened on.\n * @param {number} percentage - The progress of the load in the range [0, 1].\n */\n\n /**\n * When the resource finishes loading.\n *\n * @memberof Resource\n * @callback OnCompleteSignal\n * @param {Resource} resource - The resource that the event happened on.\n */\n\n /**\n * @memberof Resource\n * @typedef {object} IMetadata\n * @property {HTMLImageElement|HTMLAudioElement|HTMLVideoElement} [loadElement=null] - The\n * element to use for loading, instead of creating one.\n * @property {boolean} [skipSource=false] - Skips adding source(s) to the load element. This\n * is useful if you want to pass in a `loadElement` that you already added load sources to.\n * @property {string|string[]} [mimeType] - The mime type to use for the source element\n * of a video/audio elment. If the urls are an array, you can pass this as an array as well\n * where each index is the mime type to use for the corresponding url index.\n */\n\n /**\n * Stores whether or not this url is a data url.\n *\n * @readonly\n * @member {boolean}\n */\n\n\n var _proto = Resource.prototype;\n\n /**\n * Marks the resource as complete.\n *\n */\n _proto.complete = function complete() {\n this._clearEvents();\n\n this._finish();\n }\n /**\n * Aborts the loading of this resource, with an optional message.\n *\n * @param {string} message - The message to use for the error\n */\n ;\n\n _proto.abort = function abort(message) {\n // abort can be called multiple times, ignore subsequent calls.\n if (this.error) {\n return;\n } // store error\n\n\n this.error = new Error(message); // clear events before calling aborts\n\n this._clearEvents(); // abort the actual loading\n\n\n if (this.xhr) {\n this.xhr.abort();\n } else if (this.xdr) {\n this.xdr.abort();\n } else if (this.data) {\n // single source\n if (this.data.src) {\n this.data.src = Resource.EMPTY_GIF;\n } // multi-source\n else {\n while (this.data.firstChild) {\n this.data.removeChild(this.data.firstChild);\n }\n }\n } // done now.\n\n\n this._finish();\n }\n /**\n * Kicks off loading of this resource. This method is asynchronous.\n *\n * @param {Resource.OnCompleteSignal} [cb] - Optional callback to call once the resource is loaded.\n */\n ;\n\n _proto.load = function load(cb) {\n var _this = this;\n\n if (this.isLoading) {\n return;\n }\n\n if (this.isComplete) {\n if (cb) {\n setTimeout(function () {\n return cb(_this);\n }, 1);\n }\n\n return;\n } else if (cb) {\n this.onComplete.once(cb);\n }\n\n this._setFlag(Resource.STATUS_FLAGS.LOADING, true);\n\n this.onStart.dispatch(this); // if unset, determine the value\n\n if (this.crossOrigin === false || typeof this.crossOrigin !== 'string') {\n this.crossOrigin = this._determineCrossOrigin(this.url);\n }\n\n switch (this.loadType) {\n case Resource.LOAD_TYPE.IMAGE:\n this.type = Resource.TYPE.IMAGE;\n\n this._loadElement('image');\n\n break;\n\n case Resource.LOAD_TYPE.AUDIO:\n this.type = Resource.TYPE.AUDIO;\n\n this._loadSourceElement('audio');\n\n break;\n\n case Resource.LOAD_TYPE.VIDEO:\n this.type = Resource.TYPE.VIDEO;\n\n this._loadSourceElement('video');\n\n break;\n\n case Resource.LOAD_TYPE.XHR:\n /* falls through */\n\n default:\n if (useXdr && this.crossOrigin) {\n this._loadXdr();\n } else {\n this._loadXhr();\n }\n\n break;\n }\n }\n /**\n * Checks if the flag is set.\n *\n * @private\n * @param {number} flag - The flag to check.\n * @return {boolean} True if the flag is set.\n */\n ;\n\n _proto._hasFlag = function _hasFlag(flag) {\n return (this._flags & flag) !== 0;\n }\n /**\n * (Un)Sets the flag.\n *\n * @private\n * @param {number} flag - The flag to (un)set.\n * @param {boolean} value - Whether to set or (un)set the flag.\n */\n ;\n\n _proto._setFlag = function _setFlag(flag, value) {\n this._flags = value ? this._flags | flag : this._flags & ~flag;\n }\n /**\n * Clears all the events from the underlying loading source.\n *\n * @private\n */\n ;\n\n _proto._clearEvents = function _clearEvents() {\n clearTimeout(this._elementTimer);\n\n if (this.data && this.data.removeEventListener) {\n this.data.removeEventListener('error', this._boundOnError, false);\n this.data.removeEventListener('load', this._boundComplete, false);\n this.data.removeEventListener('progress', this._boundOnProgress, false);\n this.data.removeEventListener('canplaythrough', this._boundComplete, false);\n }\n\n if (this.xhr) {\n if (this.xhr.removeEventListener) {\n this.xhr.removeEventListener('error', this._boundXhrOnError, false);\n this.xhr.removeEventListener('timeout', this._boundXhrOnTimeout, false);\n this.xhr.removeEventListener('abort', this._boundXhrOnAbort, false);\n this.xhr.removeEventListener('progress', this._boundOnProgress, false);\n this.xhr.removeEventListener('load', this._boundXhrOnLoad, false);\n } else {\n this.xhr.onerror = null;\n this.xhr.ontimeout = null;\n this.xhr.onprogress = null;\n this.xhr.onload = null;\n }\n }\n }\n /**\n * Finalizes the load.\n *\n * @private\n */\n ;\n\n _proto._finish = function _finish() {\n if (this.isComplete) {\n throw new Error('Complete called again for an already completed resource.');\n }\n\n this._setFlag(Resource.STATUS_FLAGS.COMPLETE, true);\n\n this._setFlag(Resource.STATUS_FLAGS.LOADING, false);\n\n this.onComplete.dispatch(this);\n }\n /**\n * Loads this resources using an element that has a single source,\n * like an HTMLImageElement.\n *\n * @private\n * @param {string} type - The type of element to use.\n */\n ;\n\n _proto._loadElement = function _loadElement(type) {\n if (this.metadata.loadElement) {\n this.data = this.metadata.loadElement;\n } else if (type === 'image' && typeof window.Image !== 'undefined') {\n this.data = new Image();\n } else {\n this.data = document.createElement(type);\n }\n\n if (this.crossOrigin) {\n this.data.crossOrigin = this.crossOrigin;\n }\n\n if (!this.metadata.skipSource) {\n this.data.src = this.url;\n }\n\n this.data.addEventListener('error', this._boundOnError, false);\n this.data.addEventListener('load', this._boundComplete, false);\n this.data.addEventListener('progress', this._boundOnProgress, false);\n\n if (this.timeout) {\n this._elementTimer = setTimeout(this._boundOnTimeout, this.timeout);\n }\n }\n /**\n * Loads this resources using an element that has multiple sources,\n * like an HTMLAudioElement or HTMLVideoElement.\n *\n * @private\n * @param {string} type - The type of element to use.\n */\n ;\n\n _proto._loadSourceElement = function _loadSourceElement(type) {\n if (this.metadata.loadElement) {\n this.data = this.metadata.loadElement;\n } else if (type === 'audio' && typeof window.Audio !== 'undefined') {\n this.data = new Audio();\n } else {\n this.data = document.createElement(type);\n }\n\n if (this.data === null) {\n this.abort(\"Unsupported element: \" + type);\n return;\n }\n\n if (this.crossOrigin) {\n this.data.crossOrigin = this.crossOrigin;\n }\n\n if (!this.metadata.skipSource) {\n // support for CocoonJS Canvas+ runtime, lacks document.createElement('source')\n if (navigator.isCocoonJS) {\n this.data.src = Array.isArray(this.url) ? this.url[0] : this.url;\n } else if (Array.isArray(this.url)) {\n var mimeTypes = this.metadata.mimeType;\n\n for (var i = 0; i < this.url.length; ++i) {\n this.data.appendChild(this._createSource(type, this.url[i], Array.isArray(mimeTypes) ? mimeTypes[i] : mimeTypes));\n }\n } else {\n var _mimeTypes = this.metadata.mimeType;\n this.data.appendChild(this._createSource(type, this.url, Array.isArray(_mimeTypes) ? _mimeTypes[0] : _mimeTypes));\n }\n }\n\n this.data.addEventListener('error', this._boundOnError, false);\n this.data.addEventListener('load', this._boundComplete, false);\n this.data.addEventListener('progress', this._boundOnProgress, false);\n this.data.addEventListener('canplaythrough', this._boundComplete, false);\n this.data.load();\n\n if (this.timeout) {\n this._elementTimer = setTimeout(this._boundOnTimeout, this.timeout);\n }\n }\n /**\n * Loads this resources using an XMLHttpRequest.\n *\n * @private\n */\n ;\n\n _proto._loadXhr = function _loadXhr() {\n // if unset, determine the value\n if (typeof this.xhrType !== 'string') {\n this.xhrType = this._determineXhrType();\n }\n\n var xhr = this.xhr = new XMLHttpRequest(); // set the request type and url\n\n xhr.open('GET', this.url, true);\n xhr.timeout = this.timeout; // load json as text and parse it ourselves. We do this because some browsers\n // *cough* safari *cough* can't deal with it.\n\n if (this.xhrType === Resource.XHR_RESPONSE_TYPE.JSON || this.xhrType === Resource.XHR_RESPONSE_TYPE.DOCUMENT) {\n xhr.responseType = Resource.XHR_RESPONSE_TYPE.TEXT;\n } else {\n xhr.responseType = this.xhrType;\n }\n\n xhr.addEventListener('error', this._boundXhrOnError, false);\n xhr.addEventListener('timeout', this._boundXhrOnTimeout, false);\n xhr.addEventListener('abort', this._boundXhrOnAbort, false);\n xhr.addEventListener('progress', this._boundOnProgress, false);\n xhr.addEventListener('load', this._boundXhrOnLoad, false);\n xhr.send();\n }\n /**\n * Loads this resources using an XDomainRequest. This is here because we need to support IE9 (gross).\n *\n * @private\n */\n ;\n\n _proto._loadXdr = function _loadXdr() {\n // if unset, determine the value\n if (typeof this.xhrType !== 'string') {\n this.xhrType = this._determineXhrType();\n }\n\n var xdr = this.xhr = new XDomainRequest(); // eslint-disable-line no-undef\n // XDomainRequest has a few quirks. Occasionally it will abort requests\n // A way to avoid this is to make sure ALL callbacks are set even if not used\n // More info here: http://stackoverflow.com/questions/15786966/xdomainrequest-aborts-post-on-ie-9\n\n xdr.timeout = this.timeout || 5000; // XDR needs a timeout value or it breaks in IE9\n\n xdr.onerror = this._boundXhrOnError;\n xdr.ontimeout = this._boundXhrOnTimeout;\n xdr.onprogress = this._boundOnProgress;\n xdr.onload = this._boundXhrOnLoad;\n xdr.open('GET', this.url, true); // Note: The xdr.send() call is wrapped in a timeout to prevent an\n // issue with the interface where some requests are lost if multiple\n // XDomainRequests are being sent at the same time.\n // Some info here: https://github.com/photonstorm/phaser/issues/1248\n\n setTimeout(function () {\n return xdr.send();\n }, 1);\n }\n /**\n * Creates a source used in loading via an element.\n *\n * @private\n * @param {string} type - The element type (video or audio).\n * @param {string} url - The source URL to load from.\n * @param {string} [mime] - The mime type of the video\n * @return {HTMLSourceElement} The source element.\n */\n ;\n\n _proto._createSource = function _createSource(type, url, mime) {\n if (!mime) {\n mime = type + \"/\" + this._getExtension(url);\n }\n\n var source = document.createElement('source');\n source.src = url;\n source.type = mime;\n return source;\n }\n /**\n * Called if a load errors out.\n *\n * @param {Event} event - The error event from the element that emits it.\n * @private\n */\n ;\n\n _proto._onError = function _onError(event) {\n this.abort(\"Failed to load element using: \" + event.target.nodeName);\n }\n /**\n * Called if a load progress event fires for an element or xhr/xdr.\n *\n * @private\n * @param {XMLHttpRequestProgressEvent|Event} event - Progress event.\n */\n ;\n\n _proto._onProgress = function _onProgress(event) {\n if (event && event.lengthComputable) {\n this.onProgress.dispatch(this, event.loaded / event.total);\n }\n }\n /**\n * Called if a timeout event fires for an element.\n *\n * @private\n */\n ;\n\n _proto._onTimeout = function _onTimeout() {\n this.abort(\"Load timed out.\");\n }\n /**\n * Called if an error event fires for xhr/xdr.\n *\n * @private\n */\n ;\n\n _proto._xhrOnError = function _xhrOnError() {\n var xhr = this.xhr;\n this.abort(reqType(xhr) + \" Request failed. Status: \" + xhr.status + \", text: \\\"\" + xhr.statusText + \"\\\"\");\n }\n /**\n * Called if an error event fires for xhr/xdr.\n *\n * @private\n */\n ;\n\n _proto._xhrOnTimeout = function _xhrOnTimeout() {\n var xhr = this.xhr;\n this.abort(reqType(xhr) + \" Request timed out.\");\n }\n /**\n * Called if an abort event fires for xhr/xdr.\n *\n * @private\n */\n ;\n\n _proto._xhrOnAbort = function _xhrOnAbort() {\n var xhr = this.xhr;\n this.abort(reqType(xhr) + \" Request was aborted by the user.\");\n }\n /**\n * Called when data successfully loads from an xhr/xdr request.\n *\n * @private\n * @param {XMLHttpRequestLoadEvent|Event} event - Load event\n */\n ;\n\n _proto._xhrOnLoad = function _xhrOnLoad() {\n var xhr = this.xhr;\n var text = '';\n var status = typeof xhr.status === 'undefined' ? STATUS_OK : xhr.status; // XDR has no `.status`, assume 200.\n // responseText is accessible only if responseType is '' or 'text' and on older browsers\n\n if (xhr.responseType === '' || xhr.responseType === 'text' || typeof xhr.responseType === 'undefined') {\n text = xhr.responseText;\n } // status can be 0 when using the `file://` protocol so we also check if a response is set.\n // If it has a response, we assume 200; otherwise a 0 status code with no contents is an aborted request.\n\n\n if (status === STATUS_NONE && (text.length > 0 || xhr.responseType === Resource.XHR_RESPONSE_TYPE.BUFFER)) {\n status = STATUS_OK;\n } // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request\n else if (status === STATUS_IE_BUG_EMPTY) {\n status = STATUS_EMPTY;\n }\n\n var statusType = status / 100 | 0;\n\n if (statusType === STATUS_TYPE_OK) {\n // if text, just return it\n if (this.xhrType === Resource.XHR_RESPONSE_TYPE.TEXT) {\n this.data = text;\n this.type = Resource.TYPE.TEXT;\n } // if json, parse into json object\n else if (this.xhrType === Resource.XHR_RESPONSE_TYPE.JSON) {\n try {\n this.data = JSON.parse(text);\n this.type = Resource.TYPE.JSON;\n } catch (e) {\n this.abort(\"Error trying to parse loaded json: \" + e);\n return;\n }\n } // if xml, parse into an xml document or div element\n else if (this.xhrType === Resource.XHR_RESPONSE_TYPE.DOCUMENT) {\n try {\n if (window.DOMParser) {\n var domparser = new DOMParser();\n this.data = domparser.parseFromString(text, 'text/xml');\n } else {\n var div = document.createElement('div');\n div.innerHTML = text;\n this.data = div;\n }\n\n this.type = Resource.TYPE.XML;\n } catch (e) {\n this.abort(\"Error trying to parse loaded xml: \" + e);\n return;\n }\n } // other types just return the response\n else {\n this.data = xhr.response || text;\n }\n } else {\n this.abort(\"[\" + xhr.status + \"] \" + xhr.statusText + \": \" + xhr.responseURL);\n return;\n }\n\n this.complete();\n }\n /**\n * Sets the `crossOrigin` property for this resource based on if the url\n * for this resource is cross-origin. If crossOrigin was manually set, this\n * function does nothing.\n *\n * @private\n * @param {string} url - The url to test.\n * @param {object} [loc=window.location] - The location object to test against.\n * @return {string} The crossOrigin value to use (or empty string for none).\n */\n ;\n\n _proto._determineCrossOrigin = function _determineCrossOrigin(url, loc) {\n // data: and javascript: urls are considered same-origin\n if (url.indexOf('data:') === 0) {\n return '';\n } // A sandboxed iframe without the 'allow-same-origin' attribute will have a special\n // origin designed not to match window.location.origin, and will always require\n // crossOrigin requests regardless of whether the location matches.\n\n\n if (window.origin !== window.location.origin) {\n return 'anonymous';\n } // default is window.location\n\n\n loc = loc || window.location;\n\n if (!tempAnchor) {\n tempAnchor = document.createElement('a');\n } // let the browser determine the full href for the url of this resource and then\n // parse with the node url lib, we can't use the properties of the anchor element\n // because they don't work in IE9 :(\n\n\n tempAnchor.href = url;\n url = parseUri(tempAnchor.href, {\n strictMode: true\n });\n var samePort = !url.port && loc.port === '' || url.port === loc.port;\n var protocol = url.protocol ? url.protocol + \":\" : ''; // if cross origin\n\n if (url.host !== loc.hostname || !samePort || protocol !== loc.protocol) {\n return 'anonymous';\n }\n\n return '';\n }\n /**\n * Determines the responseType of an XHR request based on the extension of the\n * resource being loaded.\n *\n * @private\n * @return {Resource.XHR_RESPONSE_TYPE} The responseType to use.\n */\n ;\n\n _proto._determineXhrType = function _determineXhrType() {\n return Resource._xhrTypeMap[this.extension] || Resource.XHR_RESPONSE_TYPE.TEXT;\n }\n /**\n * Determines the loadType of a resource based on the extension of the\n * resource being loaded.\n *\n * @private\n * @return {Resource.LOAD_TYPE} The loadType to use.\n */\n ;\n\n _proto._determineLoadType = function _determineLoadType() {\n return Resource._loadTypeMap[this.extension] || Resource.LOAD_TYPE.XHR;\n }\n /**\n * Extracts the extension (sans '.') of the file being loaded by the resource.\n *\n * @private\n * @return {string} The extension.\n */\n ;\n\n _proto._getExtension = function _getExtension() {\n var url = this.url;\n var ext = '';\n\n if (this.isDataUrl) {\n var slashIndex = url.indexOf('/');\n ext = url.substring(slashIndex + 1, url.indexOf(';', slashIndex));\n } else {\n var queryStart = url.indexOf('?');\n var hashStart = url.indexOf('#');\n var index = Math.min(queryStart > -1 ? queryStart : url.length, hashStart > -1 ? hashStart : url.length);\n url = url.substring(0, index);\n ext = url.substring(url.lastIndexOf('.') + 1);\n }\n\n return ext.toLowerCase();\n }\n /**\n * Determines the mime type of an XHR request based on the responseType of\n * resource being loaded.\n *\n * @private\n * @param {Resource.XHR_RESPONSE_TYPE} type - The type to get a mime type for.\n * @return {string} The mime type to use.\n */\n ;\n\n _proto._getMimeFromXhrType = function _getMimeFromXhrType(type) {\n switch (type) {\n case Resource.XHR_RESPONSE_TYPE.BUFFER:\n return 'application/octet-binary';\n\n case Resource.XHR_RESPONSE_TYPE.BLOB:\n return 'application/blob';\n\n case Resource.XHR_RESPONSE_TYPE.DOCUMENT:\n return 'application/xml';\n\n case Resource.XHR_RESPONSE_TYPE.JSON:\n return 'application/json';\n\n case Resource.XHR_RESPONSE_TYPE.DEFAULT:\n case Resource.XHR_RESPONSE_TYPE.TEXT:\n /* falls through */\n\n default:\n return 'text/plain';\n }\n };\n\n _createClass(Resource, [{\n key: \"isDataUrl\",\n get: function get() {\n return this._hasFlag(Resource.STATUS_FLAGS.DATA_URL);\n }\n /**\n * Describes if this resource has finished loading. Is true when the resource has completely\n * loaded.\n *\n * @readonly\n * @member {boolean}\n */\n\n }, {\n key: \"isComplete\",\n get: function get() {\n return this._hasFlag(Resource.STATUS_FLAGS.COMPLETE);\n }\n /**\n * Describes if this resource is currently loading. Is true when the resource starts loading,\n * and is false again when complete.\n *\n * @readonly\n * @member {boolean}\n */\n\n }, {\n key: \"isLoading\",\n get: function get() {\n return this._hasFlag(Resource.STATUS_FLAGS.LOADING);\n }\n }]);\n\n return Resource;\n}();\n/**\n * The types of resources a resource could represent.\n *\n * @static\n * @readonly\n * @enum {number}\n */\n\n\nResource.STATUS_FLAGS = {\n NONE: 0,\n DATA_URL: 1 << 0,\n COMPLETE: 1 << 1,\n LOADING: 1 << 2\n};\n/**\n * The types of resources a resource could represent.\n *\n * @static\n * @readonly\n * @enum {number}\n */\n\nResource.TYPE = {\n UNKNOWN: 0,\n JSON: 1,\n XML: 2,\n IMAGE: 3,\n AUDIO: 4,\n VIDEO: 5,\n TEXT: 6\n};\n/**\n * The types of loading a resource can use.\n *\n * @static\n * @readonly\n * @enum {number}\n */\n\nResource.LOAD_TYPE = {\n /** Uses XMLHttpRequest to load the resource. */\n XHR: 1,\n\n /** Uses an `Image` object to load the resource. */\n IMAGE: 2,\n\n /** Uses an `Audio` object to load the resource. */\n AUDIO: 3,\n\n /** Uses a `Video` object to load the resource. */\n VIDEO: 4\n};\n/**\n * The XHR ready states, used internally.\n *\n * @static\n * @readonly\n * @enum {string}\n */\n\nResource.XHR_RESPONSE_TYPE = {\n /** string */\n DEFAULT: 'text',\n\n /** ArrayBuffer */\n BUFFER: 'arraybuffer',\n\n /** Blob */\n BLOB: 'blob',\n\n /** Document */\n DOCUMENT: 'document',\n\n /** Object */\n JSON: 'json',\n\n /** String */\n TEXT: 'text'\n};\nResource._loadTypeMap = {\n // images\n gif: Resource.LOAD_TYPE.IMAGE,\n png: Resource.LOAD_TYPE.IMAGE,\n bmp: Resource.LOAD_TYPE.IMAGE,\n jpg: Resource.LOAD_TYPE.IMAGE,\n jpeg: Resource.LOAD_TYPE.IMAGE,\n tif: Resource.LOAD_TYPE.IMAGE,\n tiff: Resource.LOAD_TYPE.IMAGE,\n webp: Resource.LOAD_TYPE.IMAGE,\n tga: Resource.LOAD_TYPE.IMAGE,\n svg: Resource.LOAD_TYPE.IMAGE,\n 'svg+xml': Resource.LOAD_TYPE.IMAGE,\n // for SVG data urls\n // audio\n mp3: Resource.LOAD_TYPE.AUDIO,\n ogg: Resource.LOAD_TYPE.AUDIO,\n wav: Resource.LOAD_TYPE.AUDIO,\n // videos\n mp4: Resource.LOAD_TYPE.VIDEO,\n webm: Resource.LOAD_TYPE.VIDEO\n};\nResource._xhrTypeMap = {\n // xml\n xhtml: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n html: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n htm: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n xml: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n tmx: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n svg: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n // This was added to handle Tiled Tileset XML, but .tsx is also a TypeScript React Component.\n // Since it is way less likely for people to be loading TypeScript files instead of Tiled files,\n // this should probably be fine.\n tsx: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n // images\n gif: Resource.XHR_RESPONSE_TYPE.BLOB,\n png: Resource.XHR_RESPONSE_TYPE.BLOB,\n bmp: Resource.XHR_RESPONSE_TYPE.BLOB,\n jpg: Resource.XHR_RESPONSE_TYPE.BLOB,\n jpeg: Resource.XHR_RESPONSE_TYPE.BLOB,\n tif: Resource.XHR_RESPONSE_TYPE.BLOB,\n tiff: Resource.XHR_RESPONSE_TYPE.BLOB,\n webp: Resource.XHR_RESPONSE_TYPE.BLOB,\n tga: Resource.XHR_RESPONSE_TYPE.BLOB,\n // json\n json: Resource.XHR_RESPONSE_TYPE.JSON,\n // text\n text: Resource.XHR_RESPONSE_TYPE.TEXT,\n txt: Resource.XHR_RESPONSE_TYPE.TEXT,\n // fonts\n ttf: Resource.XHR_RESPONSE_TYPE.BUFFER,\n otf: Resource.XHR_RESPONSE_TYPE.BUFFER\n}; // We can't set the `src` attribute to empty string, so on abort we set it to this 1px transparent gif\n\nResource.EMPTY_GIF = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';\n/**\n * Quick helper to set a value on one of the extension maps. Ensures there is no\n * dot at the start of the extension.\n *\n * @ignore\n * @param {object} map - The map to set on.\n * @param {string} extname - The extension (or key) to set.\n * @param {number} val - The value to set.\n */\n\nfunction setExtMap(map, extname, val) {\n if (extname && extname.indexOf('.') === 0) {\n extname = extname.substring(1);\n }\n\n if (!extname) {\n return;\n }\n\n map[extname] = val;\n}\n/**\n * Quick helper to get string xhr type.\n *\n * @ignore\n * @param {XMLHttpRequest|XDomainRequest} xhr - The request to check.\n * @return {string} The type.\n */\n\n\nfunction reqType(xhr) {\n return xhr.toString().replace('object ', '');\n}\n\nvar _keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n/**\n * Encodes binary into base64.\n *\n * @function encodeBinary\n * @param {string} input The input data to encode.\n * @returns {string} The encoded base64 string\n */\n\nfunction encodeBinary(input) {\n var output = '';\n var inx = 0;\n\n while (inx < input.length) {\n // Fill byte buffer array\n var bytebuffer = [0, 0, 0];\n var encodedCharIndexes = [0, 0, 0, 0];\n\n for (var jnx = 0; jnx < bytebuffer.length; ++jnx) {\n if (inx < input.length) {\n // throw away high-order byte, as documented at:\n // https://developer.mozilla.org/En/Using_XMLHttpRequest#Handling_binary_data\n bytebuffer[jnx] = input.charCodeAt(inx++) & 0xff;\n } else {\n bytebuffer[jnx] = 0;\n }\n } // Get each encoded character, 6 bits at a time\n // index 1: first 6 bits\n\n\n encodedCharIndexes[0] = bytebuffer[0] >> 2; // index 2: second 6 bits (2 least significant bits from input byte 1 + 4 most significant bits from byte 2)\n\n encodedCharIndexes[1] = (bytebuffer[0] & 0x3) << 4 | bytebuffer[1] >> 4; // index 3: third 6 bits (4 least significant bits from input byte 2 + 2 most significant bits from byte 3)\n\n encodedCharIndexes[2] = (bytebuffer[1] & 0x0f) << 2 | bytebuffer[2] >> 6; // index 3: forth 6 bits (6 least significant bits from input byte 3)\n\n encodedCharIndexes[3] = bytebuffer[2] & 0x3f; // Determine whether padding happened, and adjust accordingly\n\n var paddingBytes = inx - (input.length - 1);\n\n switch (paddingBytes) {\n case 2:\n // Set last 2 characters to padding char\n encodedCharIndexes[3] = 64;\n encodedCharIndexes[2] = 64;\n break;\n\n case 1:\n // Set last character to padding char\n encodedCharIndexes[3] = 64;\n break;\n\n default:\n break;\n // No padding - proceed\n } // Now we will grab each appropriate character out of our keystring\n // based on our index array and append it to the output string\n\n\n for (var _jnx = 0; _jnx < encodedCharIndexes.length; ++_jnx) {\n output += _keyStr.charAt(encodedCharIndexes[_jnx]);\n }\n }\n\n return output;\n}\n\nvar Url = window.URL || window.webkitURL;\n/**\n * A middleware for transforming XHR loaded Blobs into more useful objects\n *\n * @memberof middleware\n * @function parsing\n * @example\n * import { Loader, middleware } from 'resource-loader';\n * const loader = new Loader();\n * loader.use(middleware.parsing);\n * @param {Resource} resource - Current Resource\n * @param {function} next - Callback when complete\n */\n\nfunction parsing(resource, next) {\n if (!resource.data) {\n next();\n return;\n } // if this was an XHR load of a blob\n\n\n if (resource.xhr && resource.xhrType === Resource.XHR_RESPONSE_TYPE.BLOB) {\n // if there is no blob support we probably got a binary string back\n if (!window.Blob || typeof resource.data === 'string') {\n var type = resource.xhr.getResponseHeader('content-type'); // this is an image, convert the binary string into a data url\n\n if (type && type.indexOf('image') === 0) {\n resource.data = new Image();\n resource.data.src = \"data:\" + type + \";base64,\" + encodeBinary(resource.xhr.responseText);\n resource.type = Resource.TYPE.IMAGE; // wait until the image loads and then callback\n\n resource.data.onload = function () {\n resource.data.onload = null;\n next();\n }; // next will be called on load\n\n\n return;\n }\n } // if content type says this is an image, then we should transform the blob into an Image object\n else if (resource.data.type.indexOf('image') === 0) {\n var src = Url.createObjectURL(resource.data);\n resource.blob = resource.data;\n resource.data = new Image();\n resource.data.src = src;\n resource.type = Resource.TYPE.IMAGE; // cleanup the no longer used blob after the image loads\n // TODO: Is this correct? Will the image be invalid after revoking?\n\n resource.data.onload = function () {\n Url.revokeObjectURL(src);\n resource.data.onload = null;\n next();\n }; // next will be called on load.\n\n\n return;\n }\n }\n\n next();\n}\n\n/**\n * @namespace middleware\n */\n\nvar index = ({\n caching: caching,\n parsing: parsing\n});\n\nvar MAX_PROGRESS = 100;\nvar rgxExtractUrlHash = /(#[\\w-]+)?$/;\n/**\n * Manages the state and loading of multiple resources to load.\n *\n * @class\n */\n\nvar Loader =\n/*#__PURE__*/\nfunction () {\n /**\n * @param {string} [baseUrl=''] - The base url for all resources loaded by this loader.\n * @param {number} [concurrency=10] - The number of resources to load concurrently.\n */\n function Loader(baseUrl, concurrency) {\n var _this = this;\n\n if (baseUrl === void 0) {\n baseUrl = '';\n }\n\n if (concurrency === void 0) {\n concurrency = 10;\n }\n\n /**\n * The base url for all resources loaded by this loader.\n *\n * @member {string}\n */\n this.baseUrl = baseUrl;\n /**\n * The progress percent of the loader going through the queue.\n *\n * @member {number}\n * @default 0\n */\n\n this.progress = 0;\n /**\n * Loading state of the loader, true if it is currently loading resources.\n *\n * @member {boolean}\n * @default false\n */\n\n this.loading = false;\n /**\n * A querystring to append to every URL added to the loader.\n *\n * This should be a valid query string *without* the question-mark (`?`). The loader will\n * also *not* escape values for you. Make sure to escape your parameters with\n * [`encodeURIComponent`](https://mdn.io/encodeURIComponent) before assigning this property.\n *\n * @example\n * const loader = new Loader();\n *\n * loader.defaultQueryString = 'user=me&password=secret';\n *\n * // This will request 'image.png?user=me&password=secret'\n * loader.add('image.png').load();\n *\n * loader.reset();\n *\n * // This will request 'image.png?v=1&user=me&password=secret'\n * loader.add('iamge.png?v=1').load();\n *\n * @member {string}\n * @default ''\n */\n\n this.defaultQueryString = '';\n /**\n * The middleware to run before loading each resource.\n *\n * @private\n * @member {function[]}\n */\n\n this._beforeMiddleware = [];\n /**\n * The middleware to run after loading each resource.\n *\n * @private\n * @member {function[]}\n */\n\n this._afterMiddleware = [];\n /**\n * The tracks the resources we are currently completing parsing for.\n *\n * @private\n * @member {Resource[]}\n */\n\n this._resourcesParsing = [];\n /**\n * The `_loadResource` function bound with this object context.\n *\n * @private\n * @member {function}\n * @param {Resource} r - The resource to load\n * @param {Function} d - The dequeue function\n * @return {undefined}\n */\n\n this._boundLoadResource = function (r, d) {\n return _this._loadResource(r, d);\n };\n /**\n * The resources waiting to be loaded.\n *\n * @private\n * @member {Resource[]}\n */\n\n\n this._queue = queue(this._boundLoadResource, concurrency);\n\n this._queue.pause();\n /**\n * All the resources for this loader keyed by name.\n *\n * @member {object}\n */\n\n\n this.resources = {};\n /**\n * Dispatched once per loaded or errored resource.\n *\n * The callback looks like {@link Loader.OnProgressSignal}.\n *\n * @member {Signal}\n */\n\n this.onProgress = new Signal();\n /**\n * Dispatched once per errored resource.\n *\n * The callback looks like {@link Loader.OnErrorSignal}.\n *\n * @member {Signal}\n */\n\n this.onError = new Signal();\n /**\n * Dispatched once per loaded resource.\n *\n * The callback looks like {@link Loader.OnLoadSignal}.\n *\n * @member {Signal}\n */\n\n this.onLoad = new Signal();\n /**\n * Dispatched when the loader begins to process the queue.\n *\n * The callback looks like {@link Loader.OnStartSignal}.\n *\n * @member {Signal}\n */\n\n this.onStart = new Signal();\n /**\n * Dispatched when the queued resources all load.\n *\n * The callback looks like {@link Loader.OnCompleteSignal}.\n *\n * @member {Signal}\n */\n\n this.onComplete = new Signal(); // Add default before middleware\n\n for (var i = 0; i < Loader._defaultBeforeMiddleware.length; ++i) {\n this.pre(Loader._defaultBeforeMiddleware[i]);\n } // Add default after middleware\n\n\n for (var _i = 0; _i < Loader._defaultAfterMiddleware.length; ++_i) {\n this.use(Loader._defaultAfterMiddleware[_i]);\n }\n }\n /**\n * When the progress changes the loader and resource are disaptched.\n *\n * @memberof Loader\n * @callback OnProgressSignal\n * @param {Loader} loader - The loader the progress is advancing on.\n * @param {Resource} resource - The resource that has completed or failed to cause the progress to advance.\n */\n\n /**\n * When an error occurrs the loader and resource are disaptched.\n *\n * @memberof Loader\n * @callback OnErrorSignal\n * @param {Loader} loader - The loader the error happened in.\n * @param {Resource} resource - The resource that caused the error.\n */\n\n /**\n * When a load completes the loader and resource are disaptched.\n *\n * @memberof Loader\n * @callback OnLoadSignal\n * @param {Loader} loader - The loader that laoded the resource.\n * @param {Resource} resource - The resource that has completed loading.\n */\n\n /**\n * When the loader starts loading resources it dispatches this callback.\n *\n * @memberof Loader\n * @callback OnStartSignal\n * @param {Loader} loader - The loader that has started loading resources.\n */\n\n /**\n * When the loader completes loading resources it dispatches this callback.\n *\n * @memberof Loader\n * @callback OnCompleteSignal\n * @param {Loader} loader - The loader that has finished loading resources.\n */\n\n /**\n * Options for a call to `.add()`.\n *\n * @see Loader#add\n *\n * @typedef {object} IAddOptions\n * @property {string} [name] - The name of the resource to load, if not passed the url is used.\n * @property {string} [key] - Alias for `name`.\n * @property {string} [url] - The url for this resource, relative to the baseUrl of this loader.\n * @property {string|boolean} [crossOrigin] - Is this request cross-origin? Default is to\n * determine automatically.\n * @property {number} [timeout=0] - A timeout in milliseconds for the load. If the load takes\n * longer than this time it is cancelled and the load is considered a failure. If this value is\n * set to `0` then there is no explicit timeout.\n * @property {Resource.LOAD_TYPE} [loadType=Resource.LOAD_TYPE.XHR] - How should this resource\n * be loaded?\n * @property {Resource.XHR_RESPONSE_TYPE} [xhrType=Resource.XHR_RESPONSE_TYPE.DEFAULT] - How\n * should the data being loaded be interpreted when using XHR?\n * @property {Resource.OnCompleteSignal} [onComplete] - Callback to add an an onComplete signal istener.\n * @property {Resource.OnCompleteSignal} [callback] - Alias for `onComplete`.\n * @property {Resource.IMetadata} [metadata] - Extra configuration for middleware and the Resource object.\n */\n\n /* eslint-disable require-jsdoc,valid-jsdoc */\n\n /**\n * Adds a resource (or multiple resources) to the loader queue.\n *\n * This function can take a wide variety of different parameters. The only thing that is always\n * required the url to load. All the following will work:\n *\n * ```js\n * loader\n * // normal param syntax\n * .add('key', 'http://...', function () {})\n * .add('http://...', function () {})\n * .add('http://...')\n *\n * // object syntax\n * .add({\n * name: 'key2',\n * url: 'http://...'\n * }, function () {})\n * .add({\n * url: 'http://...'\n * }, function () {})\n * .add({\n * name: 'key3',\n * url: 'http://...'\n * onComplete: function () {}\n * })\n * .add({\n * url: 'https://...',\n * onComplete: function () {},\n * crossOrigin: true\n * })\n *\n * // you can also pass an array of objects or urls or both\n * .add([\n * { name: 'key4', url: 'http://...', onComplete: function () {} },\n * { url: 'http://...', onComplete: function () {} },\n * 'http://...'\n * ])\n *\n * // and you can use both params and options\n * .add('key', 'http://...', { crossOrigin: true }, function () {})\n * .add('http://...', { crossOrigin: true }, function () {});\n * ```\n *\n * @function\n * @variation 1\n * @param {string} name - The name of the resource to load.\n * @param {string} url - The url for this resource, relative to the baseUrl of this loader.\n * @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading.\n * @return {this} Returns itself.\n */\n\n /**\n * @function\n * @variation 2\n * @param {string} name - The name of the resource to load.\n * @param {string} url - The url for this resource, relative to the baseUrl of this loader.\n * @param {IAddOptions} [options] - The options for the load.\n * @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading.\n * @return {this} Returns itself.\n */\n\n /**\n * @function\n * @variation 3\n * @param {string} url - The url for this resource, relative to the baseUrl of this loader.\n * @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading.\n * @return {this} Returns itself.\n */\n\n /**\n * @function\n * @variation 4\n * @param {string} url - The url for this resource, relative to the baseUrl of this loader.\n * @param {IAddOptions} [options] - The options for the load.\n * @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading.\n * @return {this} Returns itself.\n */\n\n /**\n * @function\n * @variation 5\n * @param {IAddOptions} options - The options for the load. This object must contain a `url` property.\n * @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading.\n * @return {this} Returns itself.\n */\n\n /**\n * @function\n * @variation 6\n * @param {Array} resources - An array of resources to load, where each is\n * either an object with the options or a string url. If you pass an object, it must contain a `url` property.\n * @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading.\n * @return {this} Returns itself.\n */\n\n\n var _proto = Loader.prototype;\n\n _proto.add = function add(name, url, options, cb) {\n // special case of an array of objects or urls\n if (Array.isArray(name)) {\n for (var i = 0; i < name.length; ++i) {\n this.add(name[i]);\n }\n\n return this;\n } // if an object is passed instead of params\n\n\n if (typeof name === 'object') {\n cb = url || name.callback || name.onComplete;\n options = name;\n url = name.url;\n name = name.name || name.key || name.url;\n } // case where no name is passed shift all args over by one.\n\n\n if (typeof url !== 'string') {\n cb = options;\n options = url;\n url = name;\n } // now that we shifted make sure we have a proper url.\n\n\n if (typeof url !== 'string') {\n throw new Error('No url passed to add resource to loader.');\n } // options are optional so people might pass a function and no options\n\n\n if (typeof options === 'function') {\n cb = options;\n options = null;\n } // if loading already you can only add resources that have a parent.\n\n\n if (this.loading && (!options || !options.parentResource)) {\n throw new Error('Cannot add resources while the loader is running.');\n } // check if resource already exists.\n\n\n if (this.resources[name]) {\n throw new Error(\"Resource named \\\"\" + name + \"\\\" already exists.\");\n } // add base url if this isn't an absolute url\n\n\n url = this._prepareUrl(url); // create the store the resource\n\n this.resources[name] = new Resource(name, url, options);\n\n if (typeof cb === 'function') {\n this.resources[name].onAfterMiddleware.once(cb);\n } // if actively loading, make sure to adjust progress chunks for that parent and its children\n\n\n if (this.loading) {\n var parent = options.parentResource;\n var incompleteChildren = [];\n\n for (var _i2 = 0; _i2 < parent.children.length; ++_i2) {\n if (!parent.children[_i2].isComplete) {\n incompleteChildren.push(parent.children[_i2]);\n }\n }\n\n var fullChunk = parent.progressChunk * (incompleteChildren.length + 1); // +1 for parent\n\n var eachChunk = fullChunk / (incompleteChildren.length + 2); // +2 for parent & new child\n\n parent.children.push(this.resources[name]);\n parent.progressChunk = eachChunk;\n\n for (var _i3 = 0; _i3 < incompleteChildren.length; ++_i3) {\n incompleteChildren[_i3].progressChunk = eachChunk;\n }\n\n this.resources[name].progressChunk = eachChunk;\n } // add the resource to the queue\n\n\n this._queue.push(this.resources[name]);\n\n return this;\n }\n /* eslint-enable require-jsdoc,valid-jsdoc */\n\n /**\n * Sets up a middleware function that will run *before* the\n * resource is loaded.\n *\n * @param {function} fn - The middleware function to register.\n * @return {this} Returns itself.\n */\n ;\n\n _proto.pre = function pre(fn) {\n this._beforeMiddleware.push(fn);\n\n return this;\n }\n /**\n * Sets up a middleware function that will run *after* the\n * resource is loaded.\n *\n * @param {function} fn - The middleware function to register.\n * @return {this} Returns itself.\n */\n ;\n\n _proto.use = function use(fn) {\n this._afterMiddleware.push(fn);\n\n return this;\n }\n /**\n * Resets the queue of the loader to prepare for a new load.\n *\n * @return {this} Returns itself.\n */\n ;\n\n _proto.reset = function reset() {\n this.progress = 0;\n this.loading = false;\n\n this._queue.kill();\n\n this._queue.pause(); // abort all resource loads\n\n\n for (var k in this.resources) {\n var res = this.resources[k];\n\n if (res._onLoadBinding) {\n res._onLoadBinding.detach();\n }\n\n if (res.isLoading) {\n res.abort();\n }\n }\n\n this.resources = {};\n return this;\n }\n /**\n * Starts loading the queued resources.\n *\n * @param {function} [cb] - Optional callback that will be bound to the `complete` event.\n * @return {this} Returns itself.\n */\n ;\n\n _proto.load = function load(cb) {\n // register complete callback if they pass one\n if (typeof cb === 'function') {\n this.onComplete.once(cb);\n } // if the queue has already started we are done here\n\n\n if (this.loading) {\n return this;\n }\n\n if (this._queue.idle()) {\n this._onStart();\n\n this._onComplete();\n } else {\n // distribute progress chunks\n var numTasks = this._queue._tasks.length;\n var chunk = MAX_PROGRESS / numTasks;\n\n for (var i = 0; i < this._queue._tasks.length; ++i) {\n this._queue._tasks[i].data.progressChunk = chunk;\n } // notify we are starting\n\n\n this._onStart(); // start loading\n\n\n this._queue.resume();\n }\n\n return this;\n }\n /**\n * The number of resources to load concurrently.\n *\n * @member {number}\n * @default 10\n */\n ;\n\n /**\n * Prepares a url for usage based on the configuration of this object\n *\n * @private\n * @param {string} url - The url to prepare.\n * @return {string} The prepared url.\n */\n _proto._prepareUrl = function _prepareUrl(url) {\n var parsedUrl = parseUri(url, {\n strictMode: true\n });\n var result; // absolute url, just use it as is.\n\n if (parsedUrl.protocol || !parsedUrl.path || url.indexOf('//') === 0) {\n result = url;\n } // if baseUrl doesn't end in slash and url doesn't start with slash, then add a slash inbetween\n else if (this.baseUrl.length && this.baseUrl.lastIndexOf('/') !== this.baseUrl.length - 1 && url.charAt(0) !== '/') {\n result = this.baseUrl + \"/\" + url;\n } else {\n result = this.baseUrl + url;\n } // if we need to add a default querystring, there is a bit more work\n\n\n if (this.defaultQueryString) {\n var hash = rgxExtractUrlHash.exec(result)[0];\n result = result.substr(0, result.length - hash.length);\n\n if (result.indexOf('?') !== -1) {\n result += \"&\" + this.defaultQueryString;\n } else {\n result += \"?\" + this.defaultQueryString;\n }\n\n result += hash;\n }\n\n return result;\n }\n /**\n * Loads a single resource.\n *\n * @private\n * @param {Resource} resource - The resource to load.\n * @param {function} dequeue - The function to call when we need to dequeue this item.\n */\n ;\n\n _proto._loadResource = function _loadResource(resource, dequeue) {\n var _this2 = this;\n\n resource._dequeue = dequeue; // run before middleware\n\n eachSeries(this._beforeMiddleware, function (fn, next) {\n fn.call(_this2, resource, function () {\n // if the before middleware marks the resource as complete,\n // break and don't process any more before middleware\n next(resource.isComplete ? {} : null);\n });\n }, function () {\n if (resource.isComplete) {\n _this2._onLoad(resource);\n } else {\n resource._onLoadBinding = resource.onComplete.once(_this2._onLoad, _this2);\n resource.load();\n }\n }, true);\n }\n /**\n * Called once loading has started.\n *\n * @private\n */\n ;\n\n _proto._onStart = function _onStart() {\n this.progress = 0;\n this.loading = true;\n this.onStart.dispatch(this);\n }\n /**\n * Called once each resource has loaded.\n *\n * @private\n */\n ;\n\n _proto._onComplete = function _onComplete() {\n this.progress = MAX_PROGRESS;\n this.loading = false;\n this.onComplete.dispatch(this, this.resources);\n }\n /**\n * Called each time a resources is loaded.\n *\n * @private\n * @param {Resource} resource - The resource that was loaded\n */\n ;\n\n _proto._onLoad = function _onLoad(resource) {\n var _this3 = this;\n\n resource._onLoadBinding = null; // remove this resource from the async queue, and add it to our list of resources that are being parsed\n\n this._resourcesParsing.push(resource);\n\n resource._dequeue(); // run all the after middleware for this resource\n\n\n eachSeries(this._afterMiddleware, function (fn, next) {\n fn.call(_this3, resource, next);\n }, function () {\n resource.onAfterMiddleware.dispatch(resource);\n _this3.progress = Math.min(MAX_PROGRESS, _this3.progress + resource.progressChunk);\n\n _this3.onProgress.dispatch(_this3, resource);\n\n if (resource.error) {\n _this3.onError.dispatch(resource.error, _this3, resource);\n } else {\n _this3.onLoad.dispatch(_this3, resource);\n }\n\n _this3._resourcesParsing.splice(_this3._resourcesParsing.indexOf(resource), 1); // do completion check\n\n\n if (_this3._queue.idle() && _this3._resourcesParsing.length === 0) {\n _this3._onComplete();\n }\n }, true);\n };\n\n _createClass(Loader, [{\n key: \"concurrency\",\n get: function get() {\n return this._queue.concurrency;\n } // eslint-disable-next-line require-jsdoc\n ,\n set: function set(concurrency) {\n this._queue.concurrency = concurrency;\n }\n }]);\n\n return Loader;\n}();\n/**\n * A default array of middleware to run before loading each resource.\n * Each of these middlewares are added to any new Loader instances when they are created.\n *\n * @private\n * @member {function[]}\n */\n\n\nLoader._defaultBeforeMiddleware = [];\n/**\n * A default array of middleware to run after loading each resource.\n * Each of these middlewares are added to any new Loader instances when they are created.\n *\n * @private\n * @member {function[]}\n */\n\nLoader._defaultAfterMiddleware = [];\n/**\n * Sets up a middleware function that will run *before* the\n * resource is loaded.\n *\n * @static\n * @param {function} fn - The middleware function to register.\n * @return {Loader} Returns itself.\n */\n\nLoader.pre = function LoaderPreStatic(fn) {\n Loader._defaultBeforeMiddleware.push(fn);\n\n return Loader;\n};\n/**\n * Sets up a middleware function that will run *after* the\n * resource is loaded.\n *\n * @static\n * @param {function} fn - The middleware function to register.\n * @return {Loader} Returns itself.\n */\n\n\nLoader.use = function LoaderUseStatic(fn) {\n Loader._defaultAfterMiddleware.push(fn);\n\n return Loader;\n};\n\nexport { Loader, Resource, async, encodeBinary, index as middleware };\n//# sourceMappingURL=resource-loader.esm.js.map\n","/*!\n * @pixi/loaders - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/loaders is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Resource, Loader as Loader$1, middleware } from 'resource-loader';\nimport { Texture } from '@pixi/core';\n\n/**\n* Reference to **{@link https://github.com/englercj/resource-loader\n* resource-loader}**'s Resource class.\n* @see http://englercj.github.io/resource-loader/Resource.html\n* @class LoaderResource\n* @memberof PIXI\n*/\nvar LoaderResource = Resource;\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * Loader plugin for handling Texture resources.\n * @class\n * @memberof PIXI\n * @implements PIXI.ILoaderPlugin\n */\nvar TextureLoader = /** @class */ (function () {\n function TextureLoader() {\n }\n /**\n * Called after a resource is loaded.\n * @see PIXI.Loader.loaderMiddleware\n * @param {PIXI.LoaderResource} resource\n * @param {function} next\n */\n TextureLoader.use = function (resource, next) {\n // create a new texture if the data is an Image object\n if (resource.data && resource.type === Resource.TYPE.IMAGE) {\n resource.texture = Texture.fromLoader(resource.data, resource.url, resource.name);\n }\n next();\n };\n return TextureLoader;\n}());\n\n/**\n * The new loader, extends Resource Loader by Chad Engler: https://github.com/englercj/resource-loader\n *\n * ```js\n * const loader = PIXI.Loader.shared; // PixiJS exposes a premade instance for you to use.\n * //or\n * const loader = new PIXI.Loader(); // you can also create your own if you want\n *\n * const sprites = {};\n *\n * // Chainable `add` to enqueue a resource\n * loader.add('bunny', 'data/bunny.png')\n * .add('spaceship', 'assets/spritesheet.json');\n * loader.add('scoreFont', 'assets/score.fnt');\n *\n * // Chainable `pre` to add a middleware that runs for each resource, *before* loading that resource.\n * // This is useful to implement custom caching modules (using filesystem, indexeddb, memory, etc).\n * loader.pre(cachingMiddleware);\n *\n * // Chainable `use` to add a middleware that runs for each resource, *after* loading that resource.\n * // This is useful to implement custom parsing modules (like spritesheet parsers, spine parser, etc).\n * loader.use(parsingMiddleware);\n *\n * // The `load` method loads the queue of resources, and calls the passed in callback called once all\n * // resources have loaded.\n * loader.load((loader, resources) => {\n * // resources is an object where the key is the name of the resource loaded and the value is the resource object.\n * // They have a couple default properties:\n * // - `url`: The URL that the resource was loaded from\n * // - `error`: The error that happened when trying to load (if any)\n * // - `data`: The raw data that was loaded\n * // also may contain other properties based on the middleware that runs.\n * sprites.bunny = new PIXI.TilingSprite(resources.bunny.texture);\n * sprites.spaceship = new PIXI.TilingSprite(resources.spaceship.texture);\n * sprites.scoreFont = new PIXI.TilingSprite(resources.scoreFont.texture);\n * });\n *\n * // throughout the process multiple signals can be dispatched.\n * loader.onProgress.add(() => {}); // called once per loaded/errored file\n * loader.onError.add(() => {}); // called once per errored file\n * loader.onLoad.add(() => {}); // called once per loaded file\n * loader.onComplete.add(() => {}); // called once when the queued resources all load.\n * ```\n *\n * @see https://github.com/englercj/resource-loader\n *\n * @class Loader\n * @memberof PIXI\n * @param {string} [baseUrl=''] - The base url for all resources loaded by this loader.\n * @param {number} [concurrency=10] - The number of resources to load concurrently.\n */\nvar Loader = /** @class */ (function (_super) {\n __extends(Loader, _super);\n function Loader(baseUrl, concurrency) {\n var _this = _super.call(this, baseUrl, concurrency) || this;\n for (var i = 0; i < Loader._plugins.length; ++i) {\n var plugin = Loader._plugins[i];\n var pre = plugin.pre, use = plugin.use;\n if (pre) {\n _this.pre(pre);\n }\n if (use) {\n _this.use(use);\n }\n }\n /**\n * If this loader cannot be destroyed.\n * @member {boolean}\n * @default false\n * @private\n */\n _this._protected = false;\n return _this;\n }\n /**\n * Destroy the loader, removes references.\n * @memberof PIXI.Loader#\n * @method destroy\n * @public\n */\n Loader.prototype.destroy = function () {\n if (!this._protected) {\n this.reset();\n }\n };\n Object.defineProperty(Loader, \"shared\", {\n /**\n * A premade instance of the loader that can be used to load resources.\n * @name shared\n * @type {PIXI.Loader}\n * @static\n * @memberof PIXI.Loader\n */\n get: function () {\n var shared = Loader._shared;\n if (!shared) {\n shared = new Loader();\n shared._protected = true;\n Loader._shared = shared;\n }\n return shared;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Adds a Loader plugin for the global shared loader and all\n * new Loader instances created.\n *\n * @static\n * @method registerPlugin\n * @memberof PIXI.Loader\n * @param {PIXI.ILoaderPlugin} plugin - The plugin to add\n * @return {PIXI.Loader} Reference to PIXI.Loader for chaining\n */\n Loader.registerPlugin = function (plugin) {\n Loader._plugins.push(plugin);\n if (plugin.add) {\n plugin.add();\n }\n return Loader;\n };\n /**\n * Collection of all installed `use` middleware for Loader.\n *\n * @static\n * @member {Array} _plugins\n * @memberof PIXI.Loader\n * @private\n */\n Loader._plugins = [];\n return Loader;\n}(Loader$1));\n// parse any blob into more usable objects (e.g. Image)\nLoader.registerPlugin({ use: middleware.parsing });\n// parse any Image objects into textures\nLoader.registerPlugin(TextureLoader);\n/**\n * Plugin to be installed for handling specific Loader resources.\n *\n * @memberof PIXI\n * @typedef {object} ILoaderPlugin\n * @property {function} [add] - Function to call immediate after registering plugin.\n * @property {PIXI.Loader.loaderMiddleware} [pre] - Middleware function to run before load, the\n * arguments for this are `(resource, next)`\n * @property {PIXI.Loader.loaderMiddleware} [use] - Middleware function to run after load, the\n * arguments for this are `(resource, next)`\n */\n/**\n * @memberof PIXI.Loader\n * @typedef {object} ICallbackID\n */\n/**\n * @memberof PIXI.Loader\n * @typedef {function} ISignalCallback\n * @param {function} callback - Callback function\n * @param {object} [context] - Context\n * @returns {ICallbackID} - CallbackID\n */\n/**\n * @memberof PIXI.Loader\n * @typedef {function} ISignalDetach\n * @param {ICallbackID} id - CallbackID returned by `add`/`once` methods\n */\n/**\n * @memberof PIXI.Loader\n * @typedef ILoaderSignal\n * @property {ISignalCallback} add - Register callback\n * @property {ISignalCallback} once - Register oneshot callback\n * @property {ISignalDetach} detach - Detach specific callback by ID\n */\n/**\n * @memberof PIXI.Loader\n * @callback loaderMiddleware\n * @param {PIXI.LoaderResource} resource\n * @param {function} next\n */\n/**\n * @memberof PIXI.Loader#\n * @description Dispatched when the loader begins to loading process.\n * @member {PIXI.Loader.ILoaderSignal} onStart\n */\n/**\n * @memberof PIXI.Loader#\n * @description Dispatched once per loaded or errored resource.\n * @member {PIXI.Loader.ILoaderSignal} onProgress\n */\n/**\n * @memberof PIXI.Loader#\n * @description Dispatched once per errored resource.\n * @member {PIXI.Loader.ILoaderSignal} onError\n */\n/**\n * @memberof PIXI.Loader#\n * @description Dispatched once per loaded resource.\n * @member {PIXI.Loader.ILoaderSignal} onLoad\n */\n/**\n * @memberof PIXI.Loader#\n * @description Dispatched when completely loaded all resources.\n * @member {PIXI.Loader.ILoaderSignal} onComplete\n */\n\n/**\n * Application plugin for supporting loader option. Installing the LoaderPlugin\n * is not necessary if using **pixi.js** or **pixi.js-legacy**.\n * @example\n * import {AppLoaderPlugin} from '@pixi/loaders';\n * import {Application} from '@pixi/app';\n * Application.registerPlugin(AppLoaderPlugin);\n * @class\n * @memberof PIXI\n */\nvar AppLoaderPlugin = /** @class */ (function () {\n function AppLoaderPlugin() {\n }\n /**\n * Called on application constructor\n * @param {object} options\n * @private\n */\n AppLoaderPlugin.init = function (options) {\n options = Object.assign({\n sharedLoader: false,\n }, options);\n /**\n * Loader instance to help with asset loading.\n * @name PIXI.Application#loader\n * @type {PIXI.Loader}\n * @readonly\n */\n this.loader = options.sharedLoader ? Loader.shared : new Loader();\n };\n /**\n * Called when application destroyed\n * @private\n */\n AppLoaderPlugin.destroy = function () {\n if (this.loader) {\n this.loader.destroy();\n this.loader = null;\n }\n };\n return AppLoaderPlugin;\n}());\n\nexport { AppLoaderPlugin, Loader, LoaderResource, TextureLoader };\n//# sourceMappingURL=loaders.es.js.map\n","/*!\n * @pixi/particles - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/particles is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { BLEND_MODES, TYPES } from '@pixi/constants';\nimport { Container } from '@pixi/display';\nimport { hex2rgb, createIndicesForQuads, correctBlendMode, premultiplyRgba, premultiplyTint } from '@pixi/utils';\nimport { Geometry, Buffer, Shader, State, ObjectRenderer } from '@pixi/core';\nimport { Matrix } from '@pixi/math';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * The ParticleContainer class is a really fast version of the Container built solely for speed,\n * so use when you need a lot of sprites or particles.\n *\n * The tradeoff of the ParticleContainer is that most advanced functionality will not work.\n * ParticleContainer implements the basic object transform (position, scale, rotation)\n * and some advanced functionality like tint (as of v4.5.6).\n *\n * Other more advanced functionality like masking, children, filters, etc will not work on sprites in this batch.\n *\n * It's extremely easy to use:\n * ```js\n * let container = new ParticleContainer();\n *\n * for (let i = 0; i < 100; ++i)\n * {\n * let sprite = PIXI.Sprite.from(\"myImage.png\");\n * container.addChild(sprite);\n * }\n * ```\n *\n * And here you have a hundred sprites that will be rendered at the speed of light.\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI\n */\nvar ParticleContainer = /** @class */ (function (_super) {\n __extends(ParticleContainer, _super);\n /**\n * @param {number} [maxSize=1500] - The maximum number of particles that can be rendered by the container.\n * Affects size of allocated buffers.\n * @param {object} [properties] - The properties of children that should be uploaded to the gpu and applied.\n * @param {boolean} [properties.vertices=false] - When true, vertices be uploaded and applied.\n * if sprite's ` scale/anchor/trim/frame/orig` is dynamic, please set `true`.\n * @param {boolean} [properties.position=true] - When true, position be uploaded and applied.\n * @param {boolean} [properties.rotation=false] - When true, rotation be uploaded and applied.\n * @param {boolean} [properties.uvs=false] - When true, uvs be uploaded and applied.\n * @param {boolean} [properties.tint=false] - When true, alpha and tint be uploaded and applied.\n * @param {number} [batchSize=16384] - Number of particles per batch. If less than maxSize, it uses maxSize instead.\n * @param {boolean} [autoResize=false] - If true, container allocates more batches in case\n * there are more than `maxSize` particles.\n */\n function ParticleContainer(maxSize, properties, batchSize, autoResize) {\n if (maxSize === void 0) { maxSize = 1500; }\n if (batchSize === void 0) { batchSize = 16384; }\n if (autoResize === void 0) { autoResize = false; }\n var _this = _super.call(this) || this;\n // Making sure the batch size is valid\n // 65535 is max vertex index in the index buffer (see ParticleRenderer)\n // so max number of particles is 65536 / 4 = 16384\n var maxBatchSize = 16384;\n if (batchSize > maxBatchSize) {\n batchSize = maxBatchSize;\n }\n /**\n * Set properties to be dynamic (true) / static (false)\n *\n * @member {boolean[]}\n * @private\n */\n _this._properties = [false, true, false, false, false];\n /**\n * @member {number}\n * @private\n */\n _this._maxSize = maxSize;\n /**\n * @member {number}\n * @private\n */\n _this._batchSize = batchSize;\n /**\n * @member {Array}\n * @private\n */\n _this._buffers = null;\n /**\n * for every batch stores _updateID corresponding to the last change in that batch\n * @member {number[]}\n * @private\n */\n _this._bufferUpdateIDs = [];\n /**\n * when child inserted, removed or changes position this number goes up\n * @member {number[]}\n * @private\n */\n _this._updateID = 0;\n /**\n * @member {boolean}\n *\n */\n _this.interactiveChildren = false;\n /**\n * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL`\n * to reset the blend mode.\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL\n * @see PIXI.BLEND_MODES\n */\n _this.blendMode = BLEND_MODES.NORMAL;\n /**\n * If true, container allocates more batches in case there are more than `maxSize` particles.\n * @member {boolean}\n * @default false\n */\n _this.autoResize = autoResize;\n /**\n * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.\n * Advantages can include sharper image quality (like text) and faster rendering on canvas.\n * The main disadvantage is movement of objects may appear less smooth.\n * Default to true here as performance is usually the priority for particles.\n *\n * @member {boolean}\n * @default true\n */\n _this.roundPixels = true;\n /**\n * The texture used to render the children.\n *\n * @readonly\n * @member {PIXI.BaseTexture}\n */\n _this.baseTexture = null;\n _this.setProperties(properties);\n /**\n * The tint applied to the container.\n * This is a hex value. A value of 0xFFFFFF will remove any tint effect.\n *\n * @private\n * @member {number}\n * @default 0xFFFFFF\n */\n _this._tint = 0;\n _this.tintRgb = new Float32Array(4);\n _this.tint = 0xFFFFFF;\n return _this;\n }\n /**\n * Sets the private properties array to dynamic / static based on the passed properties object\n *\n * @param {object} properties - The properties to be uploaded\n */\n ParticleContainer.prototype.setProperties = function (properties) {\n if (properties) {\n this._properties[0] = 'vertices' in properties || 'scale' in properties\n ? !!properties.vertices || !!properties.scale : this._properties[0];\n this._properties[1] = 'position' in properties ? !!properties.position : this._properties[1];\n this._properties[2] = 'rotation' in properties ? !!properties.rotation : this._properties[2];\n this._properties[3] = 'uvs' in properties ? !!properties.uvs : this._properties[3];\n this._properties[4] = 'tint' in properties || 'alpha' in properties\n ? !!properties.tint || !!properties.alpha : this._properties[4];\n }\n };\n /**\n * Updates the object transform for rendering\n *\n * @private\n */\n ParticleContainer.prototype.updateTransform = function () {\n // TODO don't need to!\n this.displayObjectUpdateTransform();\n };\n Object.defineProperty(ParticleContainer.prototype, \"tint\", {\n /**\n * The tint applied to the container. This is a hex value.\n * A value of 0xFFFFFF will remove any tint effect.\n ** IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.\n * @member {number}\n * @default 0xFFFFFF\n */\n get: function () {\n return this._tint;\n },\n set: function (value) {\n this._tint = value;\n hex2rgb(value, this.tintRgb);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Renders the container using the WebGL renderer\n *\n * @private\n * @param {PIXI.Renderer} renderer - The webgl renderer\n */\n ParticleContainer.prototype.render = function (renderer) {\n var _this = this;\n if (!this.visible || this.worldAlpha <= 0 || !this.children.length || !this.renderable) {\n return;\n }\n if (!this.baseTexture) {\n this.baseTexture = this.children[0]._texture.baseTexture;\n if (!this.baseTexture.valid) {\n this.baseTexture.once('update', function () { return _this.onChildrenChange(0); });\n }\n }\n renderer.batch.setObjectRenderer(renderer.plugins.particle);\n renderer.plugins.particle.render(this);\n };\n /**\n * Set the flag that static data should be updated to true\n *\n * @private\n * @param {number} smallestChildIndex - The smallest child index\n */\n ParticleContainer.prototype.onChildrenChange = function (smallestChildIndex) {\n var bufferIndex = Math.floor(smallestChildIndex / this._batchSize);\n while (this._bufferUpdateIDs.length < bufferIndex) {\n this._bufferUpdateIDs.push(0);\n }\n this._bufferUpdateIDs[bufferIndex] = ++this._updateID;\n };\n ParticleContainer.prototype.dispose = function () {\n if (this._buffers) {\n for (var i = 0; i < this._buffers.length; ++i) {\n this._buffers[i].destroy();\n }\n this._buffers = null;\n }\n };\n /**\n * Destroys the container\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their\n * destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the texture of the child sprite\n * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the base texture of the child sprite\n */\n ParticleContainer.prototype.destroy = function (options) {\n _super.prototype.destroy.call(this, options);\n this.dispose();\n this._properties = null;\n this._buffers = null;\n this._bufferUpdateIDs = null;\n };\n return ParticleContainer;\n}(Container));\n\n/**\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\n * for creating the original PixiJS version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that\n * they now share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's ParticleBuffer:\n * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/ParticleBuffer.java\n */\n/**\n * The particle buffer manages the static and dynamic buffers for a particle container.\n *\n * @class\n * @private\n * @memberof PIXI\n */\nvar ParticleBuffer = /** @class */ (function () {\n /**\n * @private\n * @param {object} properties - The properties to upload.\n * @param {boolean[]} dynamicPropertyFlags - Flags for which properties are dynamic.\n * @param {number} size - The size of the batch.\n */\n function ParticleBuffer(properties, dynamicPropertyFlags, size) {\n this.geometry = new Geometry();\n this.indexBuffer = null;\n /**\n * The number of particles the buffer can hold\n *\n * @private\n * @member {number}\n */\n this.size = size;\n /**\n * A list of the properties that are dynamic.\n *\n * @private\n * @member {object[]}\n */\n this.dynamicProperties = [];\n /**\n * A list of the properties that are static.\n *\n * @private\n * @member {object[]}\n */\n this.staticProperties = [];\n for (var i = 0; i < properties.length; ++i) {\n var property = properties[i];\n // Make copy of properties object so that when we edit the offset it doesn't\n // change all other instances of the object literal\n property = {\n attributeName: property.attributeName,\n size: property.size,\n uploadFunction: property.uploadFunction,\n type: property.type || TYPES.FLOAT,\n offset: property.offset,\n };\n if (dynamicPropertyFlags[i]) {\n this.dynamicProperties.push(property);\n }\n else {\n this.staticProperties.push(property);\n }\n }\n this.staticStride = 0;\n this.staticBuffer = null;\n this.staticData = null;\n this.staticDataUint32 = null;\n this.dynamicStride = 0;\n this.dynamicBuffer = null;\n this.dynamicData = null;\n this.dynamicDataUint32 = null;\n this._updateID = 0;\n this.initBuffers();\n }\n /**\n * Sets up the renderer context and necessary buffers.\n *\n * @private\n */\n ParticleBuffer.prototype.initBuffers = function () {\n var geometry = this.geometry;\n var dynamicOffset = 0;\n /**\n * Holds the indices of the geometry (quads) to draw\n *\n * @member {Uint16Array}\n * @private\n */\n this.indexBuffer = new Buffer(createIndicesForQuads(this.size), true, true);\n geometry.addIndex(this.indexBuffer);\n this.dynamicStride = 0;\n for (var i = 0; i < this.dynamicProperties.length; ++i) {\n var property = this.dynamicProperties[i];\n property.offset = dynamicOffset;\n dynamicOffset += property.size;\n this.dynamicStride += property.size;\n }\n var dynBuffer = new ArrayBuffer(this.size * this.dynamicStride * 4 * 4);\n this.dynamicData = new Float32Array(dynBuffer);\n this.dynamicDataUint32 = new Uint32Array(dynBuffer);\n this.dynamicBuffer = new Buffer(this.dynamicData, false, false);\n // static //\n var staticOffset = 0;\n this.staticStride = 0;\n for (var i = 0; i < this.staticProperties.length; ++i) {\n var property = this.staticProperties[i];\n property.offset = staticOffset;\n staticOffset += property.size;\n this.staticStride += property.size;\n }\n var statBuffer = new ArrayBuffer(this.size * this.staticStride * 4 * 4);\n this.staticData = new Float32Array(statBuffer);\n this.staticDataUint32 = new Uint32Array(statBuffer);\n this.staticBuffer = new Buffer(this.staticData, true, false);\n for (var i = 0; i < this.dynamicProperties.length; ++i) {\n var property = this.dynamicProperties[i];\n geometry.addAttribute(property.attributeName, this.dynamicBuffer, 0, property.type === TYPES.UNSIGNED_BYTE, property.type, this.dynamicStride * 4, property.offset * 4);\n }\n for (var i = 0; i < this.staticProperties.length; ++i) {\n var property = this.staticProperties[i];\n geometry.addAttribute(property.attributeName, this.staticBuffer, 0, property.type === TYPES.UNSIGNED_BYTE, property.type, this.staticStride * 4, property.offset * 4);\n }\n };\n /**\n * Uploads the dynamic properties.\n *\n * @private\n * @param {PIXI.DisplayObject[]} children - The children to upload.\n * @param {number} startIndex - The index to start at.\n * @param {number} amount - The number to upload.\n */\n ParticleBuffer.prototype.uploadDynamic = function (children, startIndex, amount) {\n for (var i = 0; i < this.dynamicProperties.length; i++) {\n var property = this.dynamicProperties[i];\n property.uploadFunction(children, startIndex, amount, property.type === TYPES.UNSIGNED_BYTE ? this.dynamicDataUint32 : this.dynamicData, this.dynamicStride, property.offset);\n }\n this.dynamicBuffer._updateID++;\n };\n /**\n * Uploads the static properties.\n *\n * @private\n * @param {PIXI.DisplayObject[]} children - The children to upload.\n * @param {number} startIndex - The index to start at.\n * @param {number} amount - The number to upload.\n */\n ParticleBuffer.prototype.uploadStatic = function (children, startIndex, amount) {\n for (var i = 0; i < this.staticProperties.length; i++) {\n var property = this.staticProperties[i];\n property.uploadFunction(children, startIndex, amount, property.type === TYPES.UNSIGNED_BYTE ? this.staticDataUint32 : this.staticData, this.staticStride, property.offset);\n }\n this.staticBuffer._updateID++;\n };\n /**\n * Destroys the ParticleBuffer.\n *\n * @private\n */\n ParticleBuffer.prototype.destroy = function () {\n this.indexBuffer = null;\n this.dynamicProperties = null;\n this.dynamicBuffer = null;\n this.dynamicData = null;\n this.dynamicDataUint32 = null;\n this.staticProperties = null;\n this.staticBuffer = null;\n this.staticData = null;\n this.staticDataUint32 = null;\n // all buffers are destroyed inside geometry\n this.geometry.destroy();\n };\n return ParticleBuffer;\n}());\n\nvar fragment = \"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}\";\n\nvar vertex = \"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\";\n\n/**\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\n * for creating the original PixiJS version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now\n * share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's ParticleRenderer:\n * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/ParticleRenderer.java\n */\n/**\n * Renderer for Particles that is designer for speed over feature set.\n *\n * @class\n * @memberof PIXI\n */\nvar ParticleRenderer = /** @class */ (function (_super) {\n __extends(ParticleRenderer, _super);\n /**\n * @param {PIXI.Renderer} renderer - The renderer this sprite batch works for.\n */\n function ParticleRenderer(renderer) {\n var _this = _super.call(this, renderer) || this;\n // 65535 is max vertex index in the index buffer (see ParticleRenderer)\n // so max number of particles is 65536 / 4 = 16384\n // and max number of element in the index buffer is 16384 * 6 = 98304\n // Creating a full index buffer, overhead is 98304 * 2 = 196Ko\n // let numIndices = 98304;\n /**\n * The default shader that is used if a sprite doesn't have a more specific one.\n *\n * @member {PIXI.Shader}\n */\n _this.shader = null;\n _this.properties = null;\n _this.tempMatrix = new Matrix();\n _this.properties = [\n // verticesData\n {\n attributeName: 'aVertexPosition',\n size: 2,\n uploadFunction: _this.uploadVertices,\n offset: 0,\n },\n // positionData\n {\n attributeName: 'aPositionCoord',\n size: 2,\n uploadFunction: _this.uploadPosition,\n offset: 0,\n },\n // rotationData\n {\n attributeName: 'aRotation',\n size: 1,\n uploadFunction: _this.uploadRotation,\n offset: 0,\n },\n // uvsData\n {\n attributeName: 'aTextureCoord',\n size: 2,\n uploadFunction: _this.uploadUvs,\n offset: 0,\n },\n // tintData\n {\n attributeName: 'aColor',\n size: 1,\n type: TYPES.UNSIGNED_BYTE,\n uploadFunction: _this.uploadTint,\n offset: 0,\n } ];\n _this.shader = Shader.from(vertex, fragment, {});\n /**\n * The WebGL state in which this renderer will work.\n *\n * @member {PIXI.State}\n * @readonly\n */\n _this.state = State.for2d();\n return _this;\n }\n /**\n * Renders the particle container object.\n *\n * @param {PIXI.ParticleContainer} container - The container to render using this ParticleRenderer\n */\n ParticleRenderer.prototype.render = function (container) {\n var children = container.children;\n var maxSize = container._maxSize;\n var batchSize = container._batchSize;\n var renderer = this.renderer;\n var totalChildren = children.length;\n if (totalChildren === 0) {\n return;\n }\n else if (totalChildren > maxSize && !container.autoResize) {\n totalChildren = maxSize;\n }\n var buffers = container._buffers;\n if (!buffers) {\n buffers = container._buffers = this.generateBuffers(container);\n }\n var baseTexture = children[0]._texture.baseTexture;\n // if the uvs have not updated then no point rendering just yet!\n this.state.blendMode = correctBlendMode(container.blendMode, baseTexture.alphaMode);\n renderer.state.set(this.state);\n var gl = renderer.gl;\n var m = container.worldTransform.copyTo(this.tempMatrix);\n m.prepend(renderer.globalUniforms.uniforms.projectionMatrix);\n this.shader.uniforms.translationMatrix = m.toArray(true);\n this.shader.uniforms.uColor = premultiplyRgba(container.tintRgb, container.worldAlpha, this.shader.uniforms.uColor, baseTexture.alphaMode);\n this.shader.uniforms.uSampler = baseTexture;\n this.renderer.shader.bind(this.shader);\n var updateStatic = false;\n // now lets upload and render the buffers..\n for (var i = 0, j = 0; i < totalChildren; i += batchSize, j += 1) {\n var amount = (totalChildren - i);\n if (amount > batchSize) {\n amount = batchSize;\n }\n if (j >= buffers.length) {\n buffers.push(this._generateOneMoreBuffer(container));\n }\n var buffer = buffers[j];\n // we always upload the dynamic\n buffer.uploadDynamic(children, i, amount);\n var bid = container._bufferUpdateIDs[j] || 0;\n updateStatic = updateStatic || (buffer._updateID < bid);\n // we only upload the static content when we have to!\n if (updateStatic) {\n buffer._updateID = container._updateID;\n buffer.uploadStatic(children, i, amount);\n }\n // bind the buffer\n renderer.geometry.bind(buffer.geometry);\n gl.drawElements(gl.TRIANGLES, amount * 6, gl.UNSIGNED_SHORT, 0);\n }\n };\n /**\n * Creates one particle buffer for each child in the container we want to render and updates internal properties\n *\n * @param {PIXI.ParticleContainer} container - The container to render using this ParticleRenderer\n * @return {PIXI.ParticleBuffer[]} The buffers\n * @private\n */\n ParticleRenderer.prototype.generateBuffers = function (container) {\n var buffers = [];\n var size = container._maxSize;\n var batchSize = container._batchSize;\n var dynamicPropertyFlags = container._properties;\n for (var i = 0; i < size; i += batchSize) {\n buffers.push(new ParticleBuffer(this.properties, dynamicPropertyFlags, batchSize));\n }\n return buffers;\n };\n /**\n * Creates one more particle buffer, because container has autoResize feature\n *\n * @param {PIXI.ParticleContainer} container - The container to render using this ParticleRenderer\n * @return {PIXI.ParticleBuffer} generated buffer\n * @private\n */\n ParticleRenderer.prototype._generateOneMoreBuffer = function (container) {\n var batchSize = container._batchSize;\n var dynamicPropertyFlags = container._properties;\n return new ParticleBuffer(this.properties, dynamicPropertyFlags, batchSize);\n };\n /**\n * Uploads the vertices.\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their vertices uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n ParticleRenderer.prototype.uploadVertices = function (children, startIndex, amount, array, stride, offset) {\n var w0 = 0;\n var w1 = 0;\n var h0 = 0;\n var h1 = 0;\n for (var i = 0; i < amount; ++i) {\n var sprite = children[startIndex + i];\n var texture = sprite._texture;\n var sx = sprite.scale.x;\n var sy = sprite.scale.y;\n var trim = texture.trim;\n var orig = texture.orig;\n if (trim) {\n // if the sprite is trimmed and is not a tilingsprite then we need to add the\n // extra space before transforming the sprite coords..\n w1 = trim.x - (sprite.anchor.x * orig.width);\n w0 = w1 + trim.width;\n h1 = trim.y - (sprite.anchor.y * orig.height);\n h0 = h1 + trim.height;\n }\n else {\n w0 = (orig.width) * (1 - sprite.anchor.x);\n w1 = (orig.width) * -sprite.anchor.x;\n h0 = orig.height * (1 - sprite.anchor.y);\n h1 = orig.height * -sprite.anchor.y;\n }\n array[offset] = w1 * sx;\n array[offset + 1] = h1 * sy;\n array[offset + stride] = w0 * sx;\n array[offset + stride + 1] = h1 * sy;\n array[offset + (stride * 2)] = w0 * sx;\n array[offset + (stride * 2) + 1] = h0 * sy;\n array[offset + (stride * 3)] = w1 * sx;\n array[offset + (stride * 3) + 1] = h0 * sy;\n offset += stride * 4;\n }\n };\n /**\n * Uploads the position.\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their positions uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n ParticleRenderer.prototype.uploadPosition = function (children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; i++) {\n var spritePosition = children[startIndex + i].position;\n array[offset] = spritePosition.x;\n array[offset + 1] = spritePosition.y;\n array[offset + stride] = spritePosition.x;\n array[offset + stride + 1] = spritePosition.y;\n array[offset + (stride * 2)] = spritePosition.x;\n array[offset + (stride * 2) + 1] = spritePosition.y;\n array[offset + (stride * 3)] = spritePosition.x;\n array[offset + (stride * 3) + 1] = spritePosition.y;\n offset += stride * 4;\n }\n };\n /**\n * Uploads the rotation.\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their rotation uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n ParticleRenderer.prototype.uploadRotation = function (children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; i++) {\n var spriteRotation = children[startIndex + i].rotation;\n array[offset] = spriteRotation;\n array[offset + stride] = spriteRotation;\n array[offset + (stride * 2)] = spriteRotation;\n array[offset + (stride * 3)] = spriteRotation;\n offset += stride * 4;\n }\n };\n /**\n * Uploads the Uvs\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their rotation uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n ParticleRenderer.prototype.uploadUvs = function (children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; ++i) {\n var textureUvs = children[startIndex + i]._texture._uvs;\n if (textureUvs) {\n array[offset] = textureUvs.x0;\n array[offset + 1] = textureUvs.y0;\n array[offset + stride] = textureUvs.x1;\n array[offset + stride + 1] = textureUvs.y1;\n array[offset + (stride * 2)] = textureUvs.x2;\n array[offset + (stride * 2) + 1] = textureUvs.y2;\n array[offset + (stride * 3)] = textureUvs.x3;\n array[offset + (stride * 3) + 1] = textureUvs.y3;\n offset += stride * 4;\n }\n else {\n // TODO you know this can be easier!\n array[offset] = 0;\n array[offset + 1] = 0;\n array[offset + stride] = 0;\n array[offset + stride + 1] = 0;\n array[offset + (stride * 2)] = 0;\n array[offset + (stride * 2) + 1] = 0;\n array[offset + (stride * 3)] = 0;\n array[offset + (stride * 3) + 1] = 0;\n offset += stride * 4;\n }\n }\n };\n /**\n * Uploads the tint.\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their rotation uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n ParticleRenderer.prototype.uploadTint = function (children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; ++i) {\n var sprite = children[startIndex + i];\n var premultiplied = sprite._texture.baseTexture.alphaMode > 0;\n var alpha = sprite.alpha;\n // we dont call extra function if alpha is 1.0, that's faster\n var argb = alpha < 1.0 && premultiplied\n ? premultiplyTint(sprite._tintRGB, alpha) : sprite._tintRGB + (alpha * 255 << 24);\n array[offset] = argb;\n array[offset + stride] = argb;\n array[offset + (stride * 2)] = argb;\n array[offset + (stride * 3)] = argb;\n offset += stride * 4;\n }\n };\n /**\n * Destroys the ParticleRenderer.\n */\n ParticleRenderer.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n if (this.shader) {\n this.shader.destroy();\n this.shader = null;\n }\n this.tempMatrix = null;\n };\n return ParticleRenderer;\n}(ObjectRenderer));\n\nexport { ParticleContainer, ParticleRenderer };\n//# sourceMappingURL=particles.es.js.map\n","/*!\n * @pixi/graphics - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/graphics is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Texture, BaseTexture, BatchDrawCall, BatchTextureArray, BatchGeometry, State, UniformGroup, Shader } from '@pixi/core';\nimport { SHAPES, Point, Polygon, PI_2, Matrix, Rectangle, RoundedRectangle, Circle, Ellipse } from '@pixi/math';\nimport { earcut, premultiplyTint, deprecation, hex2rgb } from '@pixi/utils';\nimport { WRAP_MODES, DRAW_MODES, BLEND_MODES } from '@pixi/constants';\nimport { Bounds, Container } from '@pixi/display';\n\n/**\n * Supported line joints in `PIXI.LineStyle` for graphics.\n *\n * @see PIXI.Graphics#lineStyle\n * @see https://graphicdesign.stackexchange.com/questions/59018/what-is-a-bevel-join-of-two-lines-exactly-illustrator\n *\n * @name LINE_JOIN\n * @memberof PIXI\n * @static\n * @enum {string}\n * @property {string} MITER - 'miter': make a sharp corner where outer part of lines meet\n * @property {string} BEVEL - 'bevel': add a square butt at each end of line segment and fill the triangle at turn\n * @property {string} ROUND - 'round': add an arc at the joint\n */\nvar LINE_JOIN;\n(function (LINE_JOIN) {\n LINE_JOIN[\"MITER\"] = \"miter\";\n LINE_JOIN[\"BEVEL\"] = \"bevel\";\n LINE_JOIN[\"ROUND\"] = \"round\";\n})(LINE_JOIN || (LINE_JOIN = {}));\n/**\n * Support line caps in `PIXI.LineStyle` for graphics.\n *\n * @see PIXI.Graphics#lineStyle\n *\n * @name LINE_CAP\n * @memberof PIXI\n * @static\n * @enum {string}\n * @property {string} BUTT - 'butt': don't add any cap at line ends (leaves orthogonal edges)\n * @property {string} ROUND - 'round': add semicircle at ends\n * @property {string} SQUARE - 'square': add square at end (like `BUTT` except more length at end)\n */\nvar LINE_CAP;\n(function (LINE_CAP) {\n LINE_CAP[\"BUTT\"] = \"butt\";\n LINE_CAP[\"ROUND\"] = \"round\";\n LINE_CAP[\"SQUARE\"] = \"square\";\n})(LINE_CAP || (LINE_CAP = {}));\n/**\n * Graphics curves resolution settings. If `adaptive` flag is set to `true`,\n * the resolution is calculated based on the curve's length to ensure better visual quality.\n * Adaptive draw works with `bezierCurveTo` and `quadraticCurveTo`.\n *\n * @static\n * @constant\n * @memberof PIXI\n * @name GRAPHICS_CURVES\n * @type {object}\n * @property {boolean} adaptive=false - flag indicating if the resolution should be adaptive\n * @property {number} maxLength=10 - maximal length of a single segment of the curve (if adaptive = false, ignored)\n * @property {number} minSegments=8 - minimal number of segments in the curve (if adaptive = false, ignored)\n * @property {number} maxSegments=2048 - maximal number of segments in the curve (if adaptive = false, ignored)\n */\nvar GRAPHICS_CURVES = {\n adaptive: true,\n maxLength: 10,\n minSegments: 8,\n maxSegments: 2048,\n epsilon: 0.0001,\n _segmentsCount: function (length, defaultSegments) {\n if (defaultSegments === void 0) { defaultSegments = 20; }\n if (!this.adaptive || !length || isNaN(length)) {\n return defaultSegments;\n }\n var result = Math.ceil(length / this.maxLength);\n if (result < this.minSegments) {\n result = this.minSegments;\n }\n else if (result > this.maxSegments) {\n result = this.maxSegments;\n }\n return result;\n },\n};\n\n/**\n * Fill style object for Graphics.\n *\n * @class\n * @memberof PIXI\n */\nvar FillStyle = /** @class */ (function () {\n function FillStyle() {\n /**\n * The hex color value used when coloring the Graphics object.\n *\n * @member {number}\n * @default 0xFFFFFF\n */\n this.color = 0xFFFFFF;\n /**\n * The alpha value used when filling the Graphics object.\n *\n * @member {number}\n * @default 1\n */\n this.alpha = 1.0;\n /**\n * The texture to be used for the fill.\n *\n * @member {PIXI.Texture}\n * @default 0\n */\n this.texture = Texture.WHITE;\n /**\n * The transform aplpied to the texture.\n *\n * @member {PIXI.Matrix}\n * @default null\n */\n this.matrix = null;\n /**\n * If the current fill is visible.\n *\n * @member {boolean}\n * @default false\n */\n this.visible = false;\n this.reset();\n }\n /**\n * Clones the object\n *\n * @return {PIXI.FillStyle}\n */\n FillStyle.prototype.clone = function () {\n var obj = new FillStyle();\n obj.color = this.color;\n obj.alpha = this.alpha;\n obj.texture = this.texture;\n obj.matrix = this.matrix;\n obj.visible = this.visible;\n return obj;\n };\n /**\n * Reset\n */\n FillStyle.prototype.reset = function () {\n this.color = 0xFFFFFF;\n this.alpha = 1;\n this.texture = Texture.WHITE;\n this.matrix = null;\n this.visible = false;\n };\n /**\n * Destroy and don't use after this\n */\n FillStyle.prototype.destroy = function () {\n this.texture = null;\n this.matrix = null;\n };\n return FillStyle;\n}());\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * Builds a polygon to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nvar buildPoly = {\n build: function (graphicsData) {\n graphicsData.points = graphicsData.shape.points.slice();\n },\n triangulate: function (graphicsData, graphicsGeometry) {\n var points = graphicsData.points;\n var holes = graphicsData.holes;\n var verts = graphicsGeometry.points;\n var indices = graphicsGeometry.indices;\n if (points.length >= 6) {\n var holeArray = [];\n // Process holes..\n for (var i = 0; i < holes.length; i++) {\n var hole = holes[i];\n holeArray.push(points.length / 2);\n points = points.concat(hole.points);\n }\n // sort color\n var triangles = earcut(points, holeArray, 2);\n if (!triangles) {\n return;\n }\n var vertPos = verts.length / 2;\n for (var i = 0; i < triangles.length; i += 3) {\n indices.push(triangles[i] + vertPos);\n indices.push(triangles[i + 1] + vertPos);\n indices.push(triangles[i + 2] + vertPos);\n }\n for (var i = 0; i < points.length; i++) {\n verts.push(points[i]);\n }\n }\n },\n};\n\n// for type only\n/**\n * Builds a circle to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object to draw\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nvar buildCircle = {\n build: function (graphicsData) {\n // need to convert points to a nice regular data\n var circleData = graphicsData.shape;\n var points = graphicsData.points;\n var x = circleData.x;\n var y = circleData.y;\n var width;\n var height;\n points.length = 0;\n // TODO - bit hacky??\n if (graphicsData.type === SHAPES.CIRC) {\n width = circleData.radius;\n height = circleData.radius;\n }\n else {\n var ellipseData = graphicsData.shape;\n width = ellipseData.width;\n height = ellipseData.height;\n }\n if (width === 0 || height === 0) {\n return;\n }\n var totalSegs = Math.floor(30 * Math.sqrt(circleData.radius))\n || Math.floor(15 * Math.sqrt(width + height));\n totalSegs /= 2.3;\n var seg = (Math.PI * 2) / totalSegs;\n for (var i = 0; i < totalSegs - 0.5; i++) {\n points.push(x + (Math.sin(-seg * i) * width), y + (Math.cos(-seg * i) * height));\n }\n points.push(points[0], points[1]);\n },\n triangulate: function (graphicsData, graphicsGeometry) {\n var points = graphicsData.points;\n var verts = graphicsGeometry.points;\n var indices = graphicsGeometry.indices;\n var vertPos = verts.length / 2;\n var center = vertPos;\n var circle = (graphicsData.shape);\n var matrix = graphicsData.matrix;\n var x = circle.x;\n var y = circle.y;\n // Push center (special point)\n verts.push(graphicsData.matrix ? (matrix.a * x) + (matrix.c * y) + matrix.tx : x, graphicsData.matrix ? (matrix.b * x) + (matrix.d * y) + matrix.ty : y);\n for (var i = 0; i < points.length; i += 2) {\n verts.push(points[i], points[i + 1]);\n // add some uvs\n indices.push(vertPos++, center, vertPos);\n }\n },\n};\n\n/**\n * Builds a rectangle to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nvar buildRectangle = {\n build: function (graphicsData) {\n // --- //\n // need to convert points to a nice regular data\n //\n var rectData = graphicsData.shape;\n var x = rectData.x;\n var y = rectData.y;\n var width = rectData.width;\n var height = rectData.height;\n var points = graphicsData.points;\n points.length = 0;\n points.push(x, y, x + width, y, x + width, y + height, x, y + height);\n },\n triangulate: function (graphicsData, graphicsGeometry) {\n var points = graphicsData.points;\n var verts = graphicsGeometry.points;\n var vertPos = verts.length / 2;\n verts.push(points[0], points[1], points[2], points[3], points[6], points[7], points[4], points[5]);\n graphicsGeometry.indices.push(vertPos, vertPos + 1, vertPos + 2, vertPos + 1, vertPos + 2, vertPos + 3);\n },\n};\n\n/**\n * Calculate a single point for a quadratic bezier curve.\n * Utility function used by quadraticBezierCurve.\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {number} n1 - first number\n * @param {number} n2 - second number\n * @param {number} perc - percentage\n * @return {number} the result\n *\n */\nfunction getPt(n1, n2, perc) {\n var diff = n2 - n1;\n return n1 + (diff * perc);\n}\n/**\n * Calculate the points for a quadratic bezier curve. (helper function..)\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {number} fromX - Origin point x\n * @param {number} fromY - Origin point x\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @param {number[]} [out=[]] - The output array to add points into. If not passed, a new array is created.\n * @return {number[]} an array of points\n */\nfunction quadraticBezierCurve(fromX, fromY, cpX, cpY, toX, toY, out) {\n if (out === void 0) { out = []; }\n var n = 20;\n var points = out;\n var xa = 0;\n var ya = 0;\n var xb = 0;\n var yb = 0;\n var x = 0;\n var y = 0;\n for (var i = 0, j = 0; i <= n; ++i) {\n j = i / n;\n // The Green Line\n xa = getPt(fromX, cpX, j);\n ya = getPt(fromY, cpY, j);\n xb = getPt(cpX, toX, j);\n yb = getPt(cpY, toY, j);\n // The Black Dot\n x = getPt(xa, xb, j);\n y = getPt(ya, yb, j);\n points.push(x, y);\n }\n return points;\n}\n/**\n * Builds a rounded rectangle to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nvar buildRoundedRectangle = {\n build: function (graphicsData) {\n var rrectData = graphicsData.shape;\n var points = graphicsData.points;\n var x = rrectData.x;\n var y = rrectData.y;\n var width = rrectData.width;\n var height = rrectData.height;\n // Don't allow negative radius or greater than half the smallest width\n var radius = Math.max(0, Math.min(rrectData.radius, Math.min(width, height) / 2));\n points.length = 0;\n // No radius, do a simple rectangle\n if (!radius) {\n points.push(x, y, x + width, y, x + width, y + height, x, y + height);\n }\n else {\n quadraticBezierCurve(x, y + radius, x, y, x + radius, y, points);\n quadraticBezierCurve(x + width - radius, y, x + width, y, x + width, y + radius, points);\n quadraticBezierCurve(x + width, y + height - radius, x + width, y + height, x + width - radius, y + height, points);\n quadraticBezierCurve(x + radius, y + height, x, y + height, x, y + height - radius, points);\n }\n // this tiny number deals with the issue that occurs when points overlap and earcut fails to triangulate the item.\n // TODO - fix this properly, this is not very elegant.. but it works for now.\n },\n triangulate: function (graphicsData, graphicsGeometry) {\n var points = graphicsData.points;\n var verts = graphicsGeometry.points;\n var indices = graphicsGeometry.indices;\n var vecPos = verts.length / 2;\n var triangles = earcut(points, null, 2);\n for (var i = 0, j = triangles.length; i < j; i += 3) {\n indices.push(triangles[i] + vecPos);\n // indices.push(triangles[i] + vecPos);\n indices.push(triangles[i + 1] + vecPos);\n // indices.push(triangles[i + 2] + vecPos);\n indices.push(triangles[i + 2] + vecPos);\n }\n for (var i = 0, j = points.length; i < j; i++) {\n verts.push(points[i], points[++i]);\n }\n },\n};\n\n/**\n * Buffers vertices to draw a square cap.\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {number} x - X-coord of end point\n * @param {number} y - Y-coord of end point\n * @param {number} nx - X-coord of line normal pointing inside\n * @param {number} ny - Y-coord of line normal pointing inside\n * @param {Array} verts - vertex buffer\n * @returns {}\n */\nfunction square(x, y, nx, ny, innerWeight, outerWeight, clockwise, /* rotation for square (true at left end, false at right end) */ verts) {\n var ix = x - (nx * innerWeight);\n var iy = y - (ny * innerWeight);\n var ox = x + (nx * outerWeight);\n var oy = y + (ny * outerWeight);\n /* Rotate nx,ny for extension vector */\n var exx;\n var eyy;\n if (clockwise) {\n exx = ny;\n eyy = -nx;\n }\n else {\n exx = -ny;\n eyy = nx;\n }\n /* [i|0]x,y extended at cap */\n var eix = ix + exx;\n var eiy = iy + eyy;\n var eox = ox + exx;\n var eoy = oy + eyy;\n /* Square itself must be inserted clockwise*/\n verts.push(eix, eiy);\n verts.push(eox, eoy);\n return 2;\n}\n/**\n * Buffers vertices to draw an arc at the line joint or cap.\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {number} cx - X-coord of center\n * @param {number} cy - Y-coord of center\n * @param {number} sx - X-coord of arc start\n * @param {number} sy - Y-coord of arc start\n * @param {number} ex - X-coord of arc end\n * @param {number} ey - Y-coord of arc end\n * @param {Array} verts - buffer of vertices\n * @param {boolean} clockwise - orientation of vertices\n * @returns {number} - no. of vertices pushed\n */\nfunction round(cx, cy, sx, sy, ex, ey, verts, clockwise) {\n var cx2p0x = sx - cx;\n var cy2p0y = sy - cy;\n var angle0 = Math.atan2(cx2p0x, cy2p0y);\n var angle1 = Math.atan2(ex - cx, ey - cy);\n if (clockwise && angle0 < angle1) {\n angle0 += Math.PI * 2;\n }\n else if (!clockwise && angle0 > angle1) {\n angle1 += Math.PI * 2;\n }\n var startAngle = angle0;\n var angleDiff = angle1 - angle0;\n var absAngleDiff = Math.abs(angleDiff);\n /* if (absAngleDiff >= PI_LBOUND && absAngleDiff <= PI_UBOUND)\n {\n const r1x = cx - nxtPx;\n const r1y = cy - nxtPy;\n\n if (r1x === 0)\n {\n if (r1y > 0)\n {\n angleDiff = -angleDiff;\n }\n }\n else if (r1x >= -GRAPHICS_CURVES.epsilon)\n {\n angleDiff = -angleDiff;\n }\n }*/\n var radius = Math.sqrt((cx2p0x * cx2p0x) + (cy2p0y * cy2p0y));\n var segCount = ((15 * absAngleDiff * Math.sqrt(radius) / Math.PI) >> 0) + 1;\n var angleInc = angleDiff / segCount;\n startAngle += angleInc;\n if (clockwise) {\n verts.push(cx, cy);\n verts.push(sx, sy);\n for (var i = 1, angle = startAngle; i < segCount; i++, angle += angleInc) {\n verts.push(cx, cy);\n verts.push(cx + ((Math.sin(angle) * radius)), cy + ((Math.cos(angle) * radius)));\n }\n verts.push(cx, cy);\n verts.push(ex, ey);\n }\n else {\n verts.push(sx, sy);\n verts.push(cx, cy);\n for (var i = 1, angle = startAngle; i < segCount; i++, angle += angleInc) {\n verts.push(cx + ((Math.sin(angle) * radius)), cy + ((Math.cos(angle) * radius)));\n verts.push(cx, cy);\n }\n verts.push(ex, ey);\n verts.push(cx, cy);\n }\n return segCount * 2;\n}\n/**\n * Builds a line to draw using the polygon method.\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.GraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {PIXI.GraphicsGeometry} graphicsGeometry - Geometry where to append output\n */\nfunction buildNonNativeLine(graphicsData, graphicsGeometry) {\n var shape = graphicsData.shape;\n var points = graphicsData.points || shape.points.slice();\n var eps = graphicsGeometry.closePointEps;\n if (points.length === 0) {\n return;\n }\n // if the line width is an odd number add 0.5 to align to a whole pixel\n // commenting this out fixes #711 and #1620\n // if (graphicsData.lineWidth%2)\n // {\n // for (i = 0; i < points.length; i++)\n // {\n // points[i] += 0.5;\n // }\n // }\n var style = graphicsData.lineStyle;\n // get first and last point.. figure out the middle!\n var firstPoint = new Point(points[0], points[1]);\n var lastPoint = new Point(points[points.length - 2], points[points.length - 1]);\n var closedShape = shape.type !== SHAPES.POLY || shape.closeStroke;\n var closedPath = Math.abs(firstPoint.x - lastPoint.x) < eps\n && Math.abs(firstPoint.y - lastPoint.y) < eps;\n // if the first point is the last point - gonna have issues :)\n if (closedShape) {\n // need to clone as we are going to slightly modify the shape..\n points = points.slice();\n if (closedPath) {\n points.pop();\n points.pop();\n lastPoint.set(points[points.length - 2], points[points.length - 1]);\n }\n var midPointX = (firstPoint.x + lastPoint.x) * 0.5;\n var midPointY = (lastPoint.y + firstPoint.y) * 0.5;\n points.unshift(midPointX, midPointY);\n points.push(midPointX, midPointY);\n }\n var verts = graphicsGeometry.points;\n var length = points.length / 2;\n var indexCount = points.length;\n var indexStart = verts.length / 2;\n // Max. inner and outer width\n var width = style.width / 2;\n var widthSquared = width * width;\n var miterLimitSquared = style.miterLimit * style.miterLimit;\n /* Line segments of interest where (x1,y1) forms the corner. */\n var x0 = points[0];\n var y0 = points[1];\n var x1 = points[2];\n var y1 = points[3];\n var x2 = 0;\n var y2 = 0;\n /* perp[?](x|y) = the line normal with magnitude lineWidth. */\n var perpx = -(y0 - y1);\n var perpy = x0 - x1;\n var perp1x = 0;\n var perp1y = 0;\n var dist = Math.sqrt((perpx * perpx) + (perpy * perpy));\n perpx /= dist;\n perpy /= dist;\n perpx *= width;\n perpy *= width;\n var ratio = style.alignment; // 0.5;\n var innerWeight = (1 - ratio) * 2;\n var outerWeight = ratio * 2;\n if (!closedShape) {\n if (style.cap === LINE_CAP.ROUND) {\n indexCount += round(x0 - (perpx * (innerWeight - outerWeight) * 0.5), y0 - (perpy * (innerWeight - outerWeight) * 0.5), x0 - (perpx * innerWeight), y0 - (perpy * innerWeight), x0 + (perpx * outerWeight), y0 + (perpy * outerWeight), verts, true) + 2;\n }\n else if (style.cap === LINE_CAP.SQUARE) {\n indexCount += square(x0, y0, perpx, perpy, innerWeight, outerWeight, true, verts);\n }\n }\n // Push first point (below & above vertices)\n verts.push(x0 - (perpx * innerWeight), y0 - (perpy * innerWeight));\n verts.push(x0 + (perpx * outerWeight), y0 + (perpy * outerWeight));\n for (var i = 1; i < length - 1; ++i) {\n x0 = points[(i - 1) * 2];\n y0 = points[((i - 1) * 2) + 1];\n x1 = points[i * 2];\n y1 = points[(i * 2) + 1];\n x2 = points[(i + 1) * 2];\n y2 = points[((i + 1) * 2) + 1];\n perpx = -(y0 - y1);\n perpy = x0 - x1;\n dist = Math.sqrt((perpx * perpx) + (perpy * perpy));\n perpx /= dist;\n perpy /= dist;\n perpx *= width;\n perpy *= width;\n perp1x = -(y1 - y2);\n perp1y = x1 - x2;\n dist = Math.sqrt((perp1x * perp1x) + (perp1y * perp1y));\n perp1x /= dist;\n perp1y /= dist;\n perp1x *= width;\n perp1y *= width;\n /* d[x|y](0|1) = the component displacment between points p(0,1|1,2) */\n var dx0 = x1 - x0;\n var dy0 = y0 - y1;\n var dx1 = x1 - x2;\n var dy1 = y2 - y1;\n /* +ve if internal angle counterclockwise, -ve if internal angle clockwise. */\n var cross = (dy0 * dx1) - (dy1 * dx0);\n var clockwise = (cross < 0);\n /* Going nearly straight? */\n if (Math.abs(cross) < 0.1) {\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight));\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight));\n continue;\n }\n /* p[x|y] is the miter point. pdist is the distance between miter point and p1. */\n var c1 = ((-perpx + x0) * (-perpy + y1)) - ((-perpx + x1) * (-perpy + y0));\n var c2 = ((-perp1x + x2) * (-perp1y + y1)) - ((-perp1x + x1) * (-perp1y + y2));\n var px = ((dx0 * c2) - (dx1 * c1)) / cross;\n var py = ((dy1 * c1) - (dy0 * c2)) / cross;\n var pdist = ((px - x1) * (px - x1)) + ((py - y1) * (py - y1));\n /* Inner miter point */\n var imx = x1 + ((px - x1) * innerWeight);\n var imy = y1 + ((py - y1) * innerWeight);\n /* Outer miter point */\n var omx = x1 - ((px - x1) * outerWeight);\n var omy = y1 - ((py - y1) * outerWeight);\n /* Is the inside miter point too far away, creating a spike? */\n var smallerInsideSegmentSq = Math.min((dx0 * dx0) + (dy0 * dy0), (dx1 * dx1) + (dy1 * dy1));\n var insideWeight = clockwise ? innerWeight : outerWeight;\n var smallerInsideDiagonalSq = smallerInsideSegmentSq + (insideWeight * insideWeight * widthSquared);\n var insideMiterOk = pdist <= smallerInsideDiagonalSq;\n if (insideMiterOk) {\n if (style.join === LINE_JOIN.BEVEL || pdist / widthSquared > miterLimitSquared) {\n if (clockwise) /* rotating at inner angle */ {\n verts.push(imx, imy); // inner miter point\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight)); // first segment's outer vertex\n verts.push(imx, imy); // inner miter point\n verts.push(x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight)); // second segment's outer vertex\n }\n else /* rotating at outer angle */ {\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight)); // first segment's inner vertex\n verts.push(omx, omy); // outer miter point\n verts.push(x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight)); // second segment's outer vertex\n verts.push(omx, omy); // outer miter point\n }\n indexCount += 2;\n }\n else if (style.join === LINE_JOIN.ROUND) {\n if (clockwise) /* arc is outside */ {\n verts.push(imx, imy);\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight));\n indexCount += round(x1, y1, x1 + (perpx * outerWeight), y1 + (perpy * outerWeight), x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight), verts, true) + 4;\n verts.push(imx, imy);\n verts.push(x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight));\n }\n else /* arc is inside */ {\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight));\n verts.push(omx, omy);\n indexCount += round(x1, y1, x1 - (perpx * innerWeight), y1 - (perpy * innerWeight), x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight), verts, false) + 4;\n verts.push(x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight));\n verts.push(omx, omy);\n }\n }\n else {\n verts.push(imx, imy);\n verts.push(omx, omy);\n }\n }\n else // inside miter is NOT ok\n {\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight)); // first segment's inner vertex\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight)); // first segment's outer vertex\n if (style.join === LINE_JOIN.BEVEL || pdist / widthSquared > miterLimitSquared) ;\n else if (style.join === LINE_JOIN.ROUND) {\n if (clockwise) /* arc is outside */ {\n indexCount += round(x1, y1, x1 + (perpx * outerWeight), y1 + (perpy * outerWeight), x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight), verts, true) + 2;\n }\n else /* arc is inside */ {\n indexCount += round(x1, y1, x1 - (perpx * innerWeight), y1 - (perpy * innerWeight), x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight), verts, false) + 2;\n }\n }\n else {\n if (clockwise) {\n verts.push(omx, omy); // inner miter point\n verts.push(omx, omy); // inner miter point\n }\n else {\n verts.push(imx, imy); // outer miter point\n verts.push(imx, imy); // outer miter point\n }\n indexCount += 2;\n }\n verts.push(x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight)); // second segment's inner vertex\n verts.push(x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight)); // second segment's outer vertex\n indexCount += 2;\n }\n }\n x0 = points[(length - 2) * 2];\n y0 = points[((length - 2) * 2) + 1];\n x1 = points[(length - 1) * 2];\n y1 = points[((length - 1) * 2) + 1];\n perpx = -(y0 - y1);\n perpy = x0 - x1;\n dist = Math.sqrt((perpx * perpx) + (perpy * perpy));\n perpx /= dist;\n perpy /= dist;\n perpx *= width;\n perpy *= width;\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight));\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight));\n if (!closedShape) {\n if (style.cap === LINE_CAP.ROUND) {\n indexCount += round(x1 - (perpx * (innerWeight - outerWeight) * 0.5), y1 - (perpy * (innerWeight - outerWeight) * 0.5), x1 - (perpx * innerWeight), y1 - (perpy * innerWeight), x1 + (perpx * outerWeight), y1 + (perpy * outerWeight), verts, false) + 2;\n }\n else if (style.cap === LINE_CAP.SQUARE) {\n indexCount += square(x1, y1, perpx, perpy, innerWeight, outerWeight, false, verts);\n }\n }\n var indices = graphicsGeometry.indices;\n var eps2 = GRAPHICS_CURVES.epsilon * GRAPHICS_CURVES.epsilon;\n // indices.push(indexStart);\n for (var i = indexStart; i < indexCount + indexStart - 2; ++i) {\n x0 = verts[(i * 2)];\n y0 = verts[(i * 2) + 1];\n x1 = verts[(i + 1) * 2];\n y1 = verts[((i + 1) * 2) + 1];\n x2 = verts[(i + 2) * 2];\n y2 = verts[((i + 2) * 2) + 1];\n /* Skip zero area triangles */\n if (Math.abs((x0 * (y1 - y2)) + (x1 * (y2 - y0)) + (x2 * (y0 - y1))) < eps2) {\n continue;\n }\n indices.push(i, i + 1, i + 2);\n }\n}\n/**\n * Builds a line to draw using the gl.drawArrays(gl.LINES) method\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.GraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {PIXI.GraphicsGeometry} graphicsGeometry - Geometry where to append output\n */\nfunction buildNativeLine(graphicsData, graphicsGeometry) {\n var i = 0;\n var shape = graphicsData.shape;\n var points = graphicsData.points || shape.points;\n var closedShape = shape.type !== SHAPES.POLY || shape.closeStroke;\n if (points.length === 0)\n { return; }\n var verts = graphicsGeometry.points;\n var indices = graphicsGeometry.indices;\n var length = points.length / 2;\n var startIndex = verts.length / 2;\n var currentIndex = startIndex;\n verts.push(points[0], points[1]);\n for (i = 1; i < length; i++) {\n verts.push(points[i * 2], points[(i * 2) + 1]);\n indices.push(currentIndex, currentIndex + 1);\n currentIndex++;\n }\n if (closedShape) {\n indices.push(currentIndex, startIndex);\n }\n}\n/**\n * Builds a line to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.GraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {PIXI.GraphicsGeometry} graphicsGeometry - Geometry where to append output\n */\nfunction buildLine(graphicsData, graphicsGeometry) {\n if (graphicsData.lineStyle.native) {\n buildNativeLine(graphicsData, graphicsGeometry);\n }\n else {\n buildNonNativeLine(graphicsData, graphicsGeometry);\n }\n}\n\n/**\n * Draw a star shape with an arbitrary number of points.\n *\n * @class\n * @extends PIXI.Polygon\n * @memberof PIXI.graphicsUtils\n * @param {number} x - Center X position of the star\n * @param {number} y - Center Y position of the star\n * @param {number} points - The number of points of the star, must be > 1\n * @param {number} radius - The outer radius of the star\n * @param {number} [innerRadius] - The inner radius between points, default half `radius`\n * @param {number} [rotation=0] - The rotation of the star in radians, where 0 is vertical\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\nvar Star = /** @class */ (function (_super) {\n __extends(Star, _super);\n function Star(x, y, points, radius, innerRadius, rotation) {\n if (rotation === void 0) { rotation = 0; }\n var _this = this;\n innerRadius = innerRadius || radius / 2;\n var startAngle = (-1 * Math.PI / 2) + rotation;\n var len = points * 2;\n var delta = PI_2 / len;\n var polygon = [];\n for (var i = 0; i < len; i++) {\n var r = i % 2 ? innerRadius : radius;\n var angle = (i * delta) + startAngle;\n polygon.push(x + (r * Math.cos(angle)), y + (r * Math.sin(angle)));\n }\n _this = _super.call(this, polygon) || this;\n return _this;\n }\n return Star;\n}(Polygon));\n\n/**\n * Utilities for arc curves\n * @class\n * @private\n */\nvar ArcUtils = /** @class */ (function () {\n function ArcUtils() {\n }\n /**\n * The arcTo() method creates an arc/curve between two tangents on the canvas.\n *\n * \"borrowed\" from https://code.google.com/p/fxcanvas/ - thanks google!\n *\n * @private\n * @param {number} x1 - The x-coordinate of the beginning of the arc\n * @param {number} y1 - The y-coordinate of the beginning of the arc\n * @param {number} x2 - The x-coordinate of the end of the arc\n * @param {number} y2 - The y-coordinate of the end of the arc\n * @param {number} radius - The radius of the arc\n * @return {object} If the arc length is valid, return center of circle, radius and other info otherwise `null`.\n */\n ArcUtils.curveTo = function (x1, y1, x2, y2, radius, points) {\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n var a1 = fromY - y1;\n var b1 = fromX - x1;\n var a2 = y2 - y1;\n var b2 = x2 - x1;\n var mm = Math.abs((a1 * b2) - (b1 * a2));\n if (mm < 1.0e-8 || radius === 0) {\n if (points[points.length - 2] !== x1 || points[points.length - 1] !== y1) {\n points.push(x1, y1);\n }\n return null;\n }\n var dd = (a1 * a1) + (b1 * b1);\n var cc = (a2 * a2) + (b2 * b2);\n var tt = (a1 * a2) + (b1 * b2);\n var k1 = radius * Math.sqrt(dd) / mm;\n var k2 = radius * Math.sqrt(cc) / mm;\n var j1 = k1 * tt / dd;\n var j2 = k2 * tt / cc;\n var cx = (k1 * b2) + (k2 * b1);\n var cy = (k1 * a2) + (k2 * a1);\n var px = b1 * (k2 + j1);\n var py = a1 * (k2 + j1);\n var qx = b2 * (k1 + j2);\n var qy = a2 * (k1 + j2);\n var startAngle = Math.atan2(py - cy, px - cx);\n var endAngle = Math.atan2(qy - cy, qx - cx);\n return {\n cx: (cx + x1),\n cy: (cy + y1),\n radius: radius,\n startAngle: startAngle,\n endAngle: endAngle,\n anticlockwise: (b1 * a2 > b2 * a1),\n };\n };\n /* eslint-disable max-len */\n /**\n * The arc method creates an arc/curve (used to create circles, or parts of circles).\n *\n * @private\n * @param {number} startX - Start x location of arc\n * @param {number} startY - Start y location of arc\n * @param {number} cx - The x-coordinate of the center of the circle\n * @param {number} cy - The y-coordinate of the center of the circle\n * @param {number} radius - The radius of the circle\n * @param {number} startAngle - The starting angle, in radians (0 is at the 3 o'clock position\n * of the arc's circle)\n * @param {number} endAngle - The ending angle, in radians\n * @param {boolean} anticlockwise - Specifies whether the drawing should be\n * counter-clockwise or clockwise. False is default, and indicates clockwise, while true\n * indicates counter-clockwise.\n * @param {number[]} points - Collection of points to add to\n */\n ArcUtils.arc = function (_startX, _startY, cx, cy, radius, startAngle, endAngle, _anticlockwise, points) {\n var sweep = endAngle - startAngle;\n var n = GRAPHICS_CURVES._segmentsCount(Math.abs(sweep) * radius, Math.ceil(Math.abs(sweep) / PI_2) * 40);\n var theta = (sweep) / (n * 2);\n var theta2 = theta * 2;\n var cTheta = Math.cos(theta);\n var sTheta = Math.sin(theta);\n var segMinus = n - 1;\n var remainder = (segMinus % 1) / segMinus;\n for (var i = 0; i <= segMinus; ++i) {\n var real = i + (remainder * i);\n var angle = ((theta) + startAngle + (theta2 * real));\n var c = Math.cos(angle);\n var s = -Math.sin(angle);\n points.push((((cTheta * c) + (sTheta * s)) * radius) + cx, (((cTheta * -s) + (sTheta * c)) * radius) + cy);\n }\n };\n return ArcUtils;\n}());\n\n/**\n * Utilities for bezier curves\n * @class\n * @private\n */\nvar BezierUtils = /** @class */ (function () {\n function BezierUtils() {\n }\n /**\n * Calculate length of bezier curve.\n * Analytical solution is impossible, since it involves an integral that does not integrate in general.\n * Therefore numerical solution is used.\n *\n * @private\n * @param {number} fromX - Starting point x\n * @param {number} fromY - Starting point y\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} cpX2 - Second Control point x\n * @param {number} cpY2 - Second Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @return {number} Length of bezier curve\n */\n BezierUtils.curveLength = function (fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY) {\n var n = 10;\n var result = 0.0;\n var t = 0.0;\n var t2 = 0.0;\n var t3 = 0.0;\n var nt = 0.0;\n var nt2 = 0.0;\n var nt3 = 0.0;\n var x = 0.0;\n var y = 0.0;\n var dx = 0.0;\n var dy = 0.0;\n var prevX = fromX;\n var prevY = fromY;\n for (var i = 1; i <= n; ++i) {\n t = i / n;\n t2 = t * t;\n t3 = t2 * t;\n nt = (1.0 - t);\n nt2 = nt * nt;\n nt3 = nt2 * nt;\n x = (nt3 * fromX) + (3.0 * nt2 * t * cpX) + (3.0 * nt * t2 * cpX2) + (t3 * toX);\n y = (nt3 * fromY) + (3.0 * nt2 * t * cpY) + (3 * nt * t2 * cpY2) + (t3 * toY);\n dx = prevX - x;\n dy = prevY - y;\n prevX = x;\n prevY = y;\n result += Math.sqrt((dx * dx) + (dy * dy));\n }\n return result;\n };\n /**\n * Calculate the points for a bezier curve and then draws it.\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} cpX2 - Second Control point x\n * @param {number} cpY2 - Second Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @param {number[]} points - Path array to push points into\n */\n BezierUtils.curveTo = function (cpX, cpY, cpX2, cpY2, toX, toY, points) {\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n points.length -= 2;\n var n = GRAPHICS_CURVES._segmentsCount(BezierUtils.curveLength(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY));\n var dt = 0;\n var dt2 = 0;\n var dt3 = 0;\n var t2 = 0;\n var t3 = 0;\n points.push(fromX, fromY);\n for (var i = 1, j = 0; i <= n; ++i) {\n j = i / n;\n dt = (1 - j);\n dt2 = dt * dt;\n dt3 = dt2 * dt;\n t2 = j * j;\n t3 = t2 * j;\n points.push((dt3 * fromX) + (3 * dt2 * j * cpX) + (3 * dt * t2 * cpX2) + (t3 * toX), (dt3 * fromY) + (3 * dt2 * j * cpY) + (3 * dt * t2 * cpY2) + (t3 * toY));\n }\n };\n return BezierUtils;\n}());\n\n/**\n * Utilities for quadratic curves\n * @class\n * @private\n */\nvar QuadraticUtils = /** @class */ (function () {\n function QuadraticUtils() {\n }\n /**\n * Calculate length of quadratic curve\n * @see {@link http://www.malczak.linuxpl.com/blog/quadratic-bezier-curve-length/}\n * for the detailed explanation of math behind this.\n *\n * @private\n * @param {number} fromX - x-coordinate of curve start point\n * @param {number} fromY - y-coordinate of curve start point\n * @param {number} cpX - x-coordinate of curve control point\n * @param {number} cpY - y-coordinate of curve control point\n * @param {number} toX - x-coordinate of curve end point\n * @param {number} toY - y-coordinate of curve end point\n * @return {number} Length of quadratic curve\n */\n QuadraticUtils.curveLength = function (fromX, fromY, cpX, cpY, toX, toY) {\n var ax = fromX - (2.0 * cpX) + toX;\n var ay = fromY - (2.0 * cpY) + toY;\n var bx = (2.0 * cpX) - (2.0 * fromX);\n var by = (2.0 * cpY) - (2.0 * fromY);\n var a = 4.0 * ((ax * ax) + (ay * ay));\n var b = 4.0 * ((ax * bx) + (ay * by));\n var c = (bx * bx) + (by * by);\n var s = 2.0 * Math.sqrt(a + b + c);\n var a2 = Math.sqrt(a);\n var a32 = 2.0 * a * a2;\n var c2 = 2.0 * Math.sqrt(c);\n var ba = b / a2;\n return ((a32 * s)\n + (a2 * b * (s - c2))\n + (((4.0 * c * a) - (b * b))\n * Math.log(((2.0 * a2) + ba + s) / (ba + c2)))) / (4.0 * a32);\n };\n /**\n * Calculate the points for a quadratic bezier curve and then draws it.\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n *\n * @private\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @param {number[]} points - Points to add segments to.\n */\n QuadraticUtils.curveTo = function (cpX, cpY, toX, toY, points) {\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n var n = GRAPHICS_CURVES._segmentsCount(QuadraticUtils.curveLength(fromX, fromY, cpX, cpY, toX, toY));\n var xa = 0;\n var ya = 0;\n for (var i = 1; i <= n; ++i) {\n var j = i / n;\n xa = fromX + ((cpX - fromX) * j);\n ya = fromY + ((cpY - fromY) * j);\n points.push(xa + (((cpX + ((toX - cpX) * j)) - xa) * j), ya + (((cpY + ((toY - cpY) * j)) - ya) * j));\n }\n };\n return QuadraticUtils;\n}());\n\n/**\n * A structure to hold interim batch objects for Graphics.\n * @class\n * @memberof PIXI.graphicsUtils\n */\nvar BatchPart = /** @class */ (function () {\n function BatchPart() {\n this.reset();\n }\n /**\n * Begin batch part\n *\n * @param {PIXI.FillStyle | PIXI.LineStyle} style\n * @param {number} startIndex\n * @param {number} attribStart\n */\n BatchPart.prototype.begin = function (style, startIndex, attribStart) {\n this.reset();\n this.style = style;\n this.start = startIndex;\n this.attribStart = attribStart;\n };\n /**\n * End batch part\n *\n * @param {number} endIndex\n * @param {number} endAttrib\n */\n BatchPart.prototype.end = function (endIndex, endAttrib) {\n this.attribSize = endAttrib - this.attribStart;\n this.size = endIndex - this.start;\n };\n BatchPart.prototype.reset = function () {\n this.style = null;\n this.size = 0;\n this.start = 0;\n this.attribStart = 0;\n this.attribSize = 0;\n };\n return BatchPart;\n}());\n\n/**\n * Generalized convenience utilities for Graphics.\n *\n * @namespace graphicsUtils\n * @memberof PIXI\n */\nvar _a;\n/**\n * Map of fill commands for each shape type.\n *\n * @memberof PIXI.graphicsUtils\n * @member {Object} FILL_COMMANDS\n */\nvar FILL_COMMANDS = (_a = {},\n _a[SHAPES.POLY] = buildPoly,\n _a[SHAPES.CIRC] = buildCircle,\n _a[SHAPES.ELIP] = buildCircle,\n _a[SHAPES.RECT] = buildRectangle,\n _a[SHAPES.RREC] = buildRoundedRectangle,\n _a);\n/**\n * Batch pool, stores unused batches for preventing allocations.\n *\n * @memberof PIXI.graphicsUtils\n * @member {Array} BATCH_POOL\n */\nvar BATCH_POOL = [];\n/**\n * Draw call pool, stores unused draw calls for preventing allocations.\n *\n * @memberof PIXI.graphicsUtils\n * @member {Array} DRAW_CALL_POOL\n */\nvar DRAW_CALL_POOL = [];\n\nvar index = ({\n buildPoly: buildPoly,\n buildCircle: buildCircle,\n buildRectangle: buildRectangle,\n buildRoundedRectangle: buildRoundedRectangle,\n FILL_COMMANDS: FILL_COMMANDS,\n BATCH_POOL: BATCH_POOL,\n DRAW_CALL_POOL: DRAW_CALL_POOL,\n buildLine: buildLine,\n Star: Star,\n ArcUtils: ArcUtils,\n BezierUtils: BezierUtils,\n QuadraticUtils: QuadraticUtils,\n BatchPart: BatchPart\n});\n\n/**\n * A class to contain data useful for Graphics objects\n *\n * @class\n * @memberof PIXI\n */\nvar GraphicsData = /** @class */ (function () {\n /**\n *\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.\n * @param {PIXI.FillStyle} [fillStyle] - the width of the line to draw\n * @param {PIXI.LineStyle} [lineStyle] - the color of the line to draw\n * @param {PIXI.Matrix} [matrix] - Transform matrix\n */\n function GraphicsData(shape, fillStyle, lineStyle, matrix) {\n if (fillStyle === void 0) { fillStyle = null; }\n if (lineStyle === void 0) { lineStyle = null; }\n if (matrix === void 0) { matrix = null; }\n /**\n * The shape object to draw.\n * @member {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle}\n */\n this.shape = shape;\n /**\n * The style of the line.\n * @member {PIXI.LineStyle}\n */\n this.lineStyle = lineStyle;\n /**\n * The style of the fill.\n * @member {PIXI.FillStyle}\n */\n this.fillStyle = fillStyle;\n /**\n * The transform matrix.\n * @member {PIXI.Matrix}\n */\n this.matrix = matrix;\n /**\n * The type of the shape, see the Const.Shapes file for all the existing types,\n * @member {number}\n */\n this.type = shape.type;\n /**\n * The collection of points.\n * @member {number[]}\n */\n this.points = [];\n /**\n * The collection of holes.\n * @member {PIXI.GraphicsData[]}\n */\n this.holes = [];\n }\n /**\n * Creates a new GraphicsData object with the same values as this one.\n *\n * @return {PIXI.GraphicsData} Cloned GraphicsData object\n */\n GraphicsData.prototype.clone = function () {\n return new GraphicsData(this.shape, this.fillStyle, this.lineStyle, this.matrix);\n };\n /**\n * Destroys the Graphics data.\n *\n */\n GraphicsData.prototype.destroy = function () {\n this.shape = null;\n this.holes.length = 0;\n this.holes = null;\n this.points.length = 0;\n this.points = null;\n this.lineStyle = null;\n this.fillStyle = null;\n };\n return GraphicsData;\n}());\n\nvar tmpPoint = new Point();\nvar tmpBounds = new Bounds();\n/**\n * The Graphics class contains methods used to draw primitive shapes such as lines, circles and\n * rectangles to the display, and to color and fill them.\n *\n * GraphicsGeometry is designed to not be continually updating the geometry since it's expensive\n * to re-tesselate using **earcut**. Consider using {@link PIXI.Mesh} for this use-case, it's much faster.\n *\n * @class\n * @extends PIXI.BatchGeometry\n * @memberof PIXI\n */\nvar GraphicsGeometry = /** @class */ (function (_super) {\n __extends(GraphicsGeometry, _super);\n function GraphicsGeometry() {\n var _this = _super.call(this) || this;\n _this.uvsFloat32 = null;\n _this.indicesUint16 = null;\n /**\n * An array of points to draw, 2 numbers per point\n *\n * @member {number[]}\n * @protected\n */\n _this.points = [];\n /**\n * The collection of colors\n *\n * @member {number[]}\n * @protected\n */\n _this.colors = [];\n /**\n * The UVs collection\n *\n * @member {number[]}\n * @protected\n */\n _this.uvs = [];\n /**\n * The indices of the vertices\n *\n * @member {number[]}\n * @protected\n */\n _this.indices = [];\n /**\n * Reference to the texture IDs.\n *\n * @member {number[]}\n * @protected\n */\n _this.textureIds = [];\n /**\n * The collection of drawn shapes.\n *\n * @member {PIXI.GraphicsData[]}\n * @protected\n */\n _this.graphicsData = [];\n /**\n * Used to detect if the graphics object has changed.\n *\n * @member {number}\n * @protected\n */\n _this.dirty = 0;\n /**\n * Batches need to regenerated if the geometry is updated.\n *\n * @member {number}\n * @protected\n */\n _this.batchDirty = -1;\n /**\n * Used to check if the cache is dirty.\n *\n * @member {number}\n * @protected\n */\n _this.cacheDirty = -1;\n /**\n * Used to detect if we cleared the graphicsData.\n *\n * @member {number}\n * @default 0\n * @protected\n */\n _this.clearDirty = 0;\n /**\n * List of current draw calls drived from the batches.\n *\n * @member {object[]}\n * @protected\n */\n _this.drawCalls = [];\n /**\n * Intermediate abstract format sent to batch system.\n * Can be converted to drawCalls or to batchable objects.\n *\n * @member {PIXI.graphicsUtils.BatchPart[]}\n * @protected\n */\n _this.batches = [];\n /**\n * Index of the last batched shape in the stack of calls.\n *\n * @member {number}\n * @protected\n */\n _this.shapeIndex = 0;\n /**\n * Cached bounds.\n *\n * @member {PIXI.Bounds}\n * @protected\n */\n _this._bounds = new Bounds();\n /**\n * The bounds dirty flag.\n *\n * @member {number}\n * @protected\n */\n _this.boundsDirty = -1;\n /**\n * Padding to add to the bounds.\n *\n * @member {number}\n * @default 0\n */\n _this.boundsPadding = 0;\n _this.batchable = false;\n _this.indicesUint16 = null;\n _this.uvsFloat32 = null;\n /**\n * Minimal distance between points that are considered different.\n * Affects line tesselation.\n *\n * @member {number}\n */\n _this.closePointEps = 1e-4;\n return _this;\n }\n Object.defineProperty(GraphicsGeometry.prototype, \"bounds\", {\n /**\n * Get the current bounds of the graphic geometry.\n *\n * @member {PIXI.Bounds}\n * @readonly\n */\n get: function () {\n if (this.boundsDirty !== this.dirty) {\n this.boundsDirty = this.dirty;\n this.calculateBounds();\n }\n return this._bounds;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Call if you changed graphicsData manually.\n * Empties all batch buffers.\n */\n GraphicsGeometry.prototype.invalidate = function () {\n this.boundsDirty = -1;\n this.dirty++;\n this.batchDirty++;\n this.shapeIndex = 0;\n this.points.length = 0;\n this.colors.length = 0;\n this.uvs.length = 0;\n this.indices.length = 0;\n this.textureIds.length = 0;\n for (var i = 0; i < this.drawCalls.length; i++) {\n this.drawCalls[i].texArray.clear();\n DRAW_CALL_POOL.push(this.drawCalls[i]);\n }\n this.drawCalls.length = 0;\n for (var i = 0; i < this.batches.length; i++) {\n var batchPart = this.batches[i];\n batchPart.reset();\n BATCH_POOL.push(batchPart);\n }\n this.batches.length = 0;\n };\n /**\n * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.\n *\n * @return {PIXI.GraphicsGeometry} This GraphicsGeometry object. Good for chaining method calls\n */\n GraphicsGeometry.prototype.clear = function () {\n if (this.graphicsData.length > 0) {\n this.invalidate();\n this.clearDirty++;\n this.graphicsData.length = 0;\n }\n return this;\n };\n /**\n * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.\n *\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.\n * @param {PIXI.FillStyle} fillStyle - Defines style of the fill.\n * @param {PIXI.LineStyle} lineStyle - Defines style of the lines.\n * @param {PIXI.Matrix} matrix - Transform applied to the points of the shape.\n * @return {PIXI.GraphicsGeometry} Returns geometry for chaining.\n */\n GraphicsGeometry.prototype.drawShape = function (shape, fillStyle, lineStyle, matrix) {\n if (fillStyle === void 0) { fillStyle = null; }\n if (lineStyle === void 0) { lineStyle = null; }\n if (matrix === void 0) { matrix = null; }\n var data = new GraphicsData(shape, fillStyle, lineStyle, matrix);\n this.graphicsData.push(data);\n this.dirty++;\n return this;\n };\n /**\n * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.\n *\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.\n * @param {PIXI.Matrix} matrix - Transform applied to the points of the shape.\n * @return {PIXI.GraphicsGeometry} Returns geometry for chaining.\n */\n GraphicsGeometry.prototype.drawHole = function (shape, matrix) {\n if (matrix === void 0) { matrix = null; }\n if (!this.graphicsData.length) {\n return null;\n }\n var data = new GraphicsData(shape, null, null, matrix);\n var lastShape = this.graphicsData[this.graphicsData.length - 1];\n data.lineStyle = lastShape.lineStyle;\n lastShape.holes.push(data);\n this.dirty++;\n return this;\n };\n /**\n * Destroys the GraphicsGeometry object.\n *\n */\n GraphicsGeometry.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n // destroy each of the GraphicsData objects\n for (var i = 0; i < this.graphicsData.length; ++i) {\n this.graphicsData[i].destroy();\n }\n this.points.length = 0;\n this.points = null;\n this.colors.length = 0;\n this.colors = null;\n this.uvs.length = 0;\n this.uvs = null;\n this.indices.length = 0;\n this.indices = null;\n this.indexBuffer.destroy();\n this.indexBuffer = null;\n this.graphicsData.length = 0;\n this.graphicsData = null;\n this.drawCalls.length = 0;\n this.drawCalls = null;\n this.batches.length = 0;\n this.batches = null;\n this._bounds = null;\n };\n /**\n * Check to see if a point is contained within this geometry.\n *\n * @param {PIXI.IPointData} point - Point to check if it's contained.\n * @return {Boolean} `true` if the point is contained within geometry.\n */\n GraphicsGeometry.prototype.containsPoint = function (point) {\n var graphicsData = this.graphicsData;\n for (var i = 0; i < graphicsData.length; ++i) {\n var data = graphicsData[i];\n if (!data.fillStyle.visible) {\n continue;\n }\n // only deal with fills..\n if (data.shape) {\n if (data.matrix) {\n data.matrix.applyInverse(point, tmpPoint);\n }\n else {\n tmpPoint.copyFrom(point);\n }\n if (data.shape.contains(tmpPoint.x, tmpPoint.y)) {\n var hitHole = false;\n if (data.holes) {\n for (var i_1 = 0; i_1 < data.holes.length; i_1++) {\n var hole = data.holes[i_1];\n if (hole.shape.contains(tmpPoint.x, tmpPoint.y)) {\n hitHole = true;\n break;\n }\n }\n }\n if (!hitHole) {\n return true;\n }\n }\n }\n }\n return false;\n };\n /**\n * Generates intermediate batch data. Either gets converted to drawCalls\n * or used to convert to batch objects directly by the Graphics object.\n *\n * @param {boolean} [aloow32Indices] - Allow using 32-bit indices for preventings artefacts when more that 65535 vertices\n */\n GraphicsGeometry.prototype.updateBatches = function (allow32Indices) {\n if (!this.graphicsData.length) {\n this.batchable = true;\n return;\n }\n if (!this.validateBatching()) {\n return;\n }\n this.cacheDirty = this.dirty;\n var uvs = this.uvs;\n var graphicsData = this.graphicsData;\n var batchPart = null;\n var currentStyle = null;\n if (this.batches.length > 0) {\n batchPart = this.batches[this.batches.length - 1];\n currentStyle = batchPart.style;\n }\n for (var i = this.shapeIndex; i < graphicsData.length; i++) {\n this.shapeIndex++;\n var data = graphicsData[i];\n var fillStyle = data.fillStyle;\n var lineStyle = data.lineStyle;\n var command = FILL_COMMANDS[data.type];\n // build out the shapes points..\n command.build(data);\n if (data.matrix) {\n this.transformPoints(data.points, data.matrix);\n }\n for (var j = 0; j < 2; j++) {\n var style = (j === 0) ? fillStyle : lineStyle;\n if (!style.visible)\n { continue; }\n var nextTexture = style.texture.baseTexture;\n var index_1 = this.indices.length;\n var attribIndex = this.points.length / 2;\n nextTexture.wrapMode = WRAP_MODES.REPEAT;\n if (j === 0) {\n this.processFill(data);\n }\n else {\n this.processLine(data);\n }\n var size = (this.points.length / 2) - attribIndex;\n if (size === 0)\n { continue; }\n // close batch if style is different\n if (batchPart && !this._compareStyles(currentStyle, style)) {\n batchPart.end(index_1, attribIndex);\n batchPart = null;\n }\n // spawn new batch if its first batch or previous was closed\n if (!batchPart) {\n batchPart = BATCH_POOL.pop() || new BatchPart();\n batchPart.begin(style, index_1, attribIndex);\n this.batches.push(batchPart);\n currentStyle = style;\n }\n this.addUvs(this.points, uvs, style.texture, attribIndex, size, style.matrix);\n }\n }\n var index = this.indices.length;\n var attrib = this.points.length / 2;\n if (batchPart) {\n batchPart.end(index, attrib);\n }\n if (this.batches.length === 0) {\n // there are no visible styles in GraphicsData\n // its possible that someone wants Graphics just for the bounds\n this.batchable = true;\n return;\n }\n // prevent allocation when length is same as buffer\n if (this.indicesUint16 && this.indices.length === this.indicesUint16.length) {\n this.indicesUint16.set(this.indices);\n }\n else {\n var need32 = attrib > 0xffff && allow32Indices;\n this.indicesUint16 = need32 ? new Uint32Array(this.indices) : new Uint16Array(this.indices);\n }\n // TODO make this a const..\n this.batchable = this.isBatchable();\n if (this.batchable) {\n this.packBatches();\n }\n else {\n this.buildDrawCalls();\n }\n };\n /**\n * Affinity check\n *\n * @param {PIXI.FillStyle | PIXI.LineStyle} styleA\n * @param {PIXI.FillStyle | PIXI.LineStyle} styleB\n */\n GraphicsGeometry.prototype._compareStyles = function (styleA, styleB) {\n if (!styleA || !styleB) {\n return false;\n }\n if (styleA.texture.baseTexture !== styleB.texture.baseTexture) {\n return false;\n }\n if (styleA.color + styleA.alpha !== styleB.color + styleB.alpha) {\n return false;\n }\n if (!!styleA.native !== !!styleB.native) {\n return false;\n }\n return true;\n };\n /**\n * Test geometry for batching process.\n *\n * @protected\n */\n GraphicsGeometry.prototype.validateBatching = function () {\n if (this.dirty === this.cacheDirty || !this.graphicsData.length) {\n return false;\n }\n for (var i = 0, l = this.graphicsData.length; i < l; i++) {\n var data = this.graphicsData[i];\n var fill = data.fillStyle;\n var line = data.lineStyle;\n if (fill && !fill.texture.baseTexture.valid)\n { return false; }\n if (line && !line.texture.baseTexture.valid)\n { return false; }\n }\n return true;\n };\n /**\n * Offset the indices so that it works with the batcher.\n *\n * @protected\n */\n GraphicsGeometry.prototype.packBatches = function () {\n this.batchDirty++;\n this.uvsFloat32 = new Float32Array(this.uvs);\n var batches = this.batches;\n for (var i = 0, l = batches.length; i < l; i++) {\n var batch = batches[i];\n for (var j = 0; j < batch.size; j++) {\n var index = batch.start + j;\n this.indicesUint16[index] = this.indicesUint16[index] - batch.attribStart;\n }\n }\n };\n /**\n * Checks to see if this graphics geometry can be batched.\n * Currently it needs to be small enough and not contain any native lines.\n *\n * @protected\n */\n GraphicsGeometry.prototype.isBatchable = function () {\n // prevent heavy mesh batching\n if (this.points.length > 0xffff * 2) {\n return false;\n }\n var batches = this.batches;\n for (var i = 0; i < batches.length; i++) {\n if (batches[i].style.native) {\n return false;\n }\n }\n return (this.points.length < GraphicsGeometry.BATCHABLE_SIZE * 2);\n };\n /**\n * Converts intermediate batches data to drawCalls.\n *\n * @protected\n */\n GraphicsGeometry.prototype.buildDrawCalls = function () {\n var TICK = ++BaseTexture._globalBatch;\n for (var i = 0; i < this.drawCalls.length; i++) {\n this.drawCalls[i].texArray.clear();\n DRAW_CALL_POOL.push(this.drawCalls[i]);\n }\n this.drawCalls.length = 0;\n var colors = this.colors;\n var textureIds = this.textureIds;\n var currentGroup = DRAW_CALL_POOL.pop();\n if (!currentGroup) {\n currentGroup = new BatchDrawCall();\n currentGroup.texArray = new BatchTextureArray();\n }\n currentGroup.texArray.count = 0;\n currentGroup.start = 0;\n currentGroup.size = 0;\n currentGroup.type = DRAW_MODES.TRIANGLES;\n var textureCount = 0;\n var currentTexture = null;\n var textureId = 0;\n var native = false;\n var drawMode = DRAW_MODES.TRIANGLES;\n var index = 0;\n this.drawCalls.push(currentGroup);\n // TODO - this can be simplified\n for (var i = 0; i < this.batches.length; i++) {\n var data = this.batches[i];\n // TODO add some full on MAX_TEXTURE CODE..\n var MAX_TEXTURES = 8;\n // Forced cast for checking `native` without errors\n var style = data.style;\n var nextTexture = style.texture.baseTexture;\n if (native !== !!style.native) {\n native = !!style.native;\n drawMode = native ? DRAW_MODES.LINES : DRAW_MODES.TRIANGLES;\n // force the batch to break!\n currentTexture = null;\n textureCount = MAX_TEXTURES;\n TICK++;\n }\n if (currentTexture !== nextTexture) {\n currentTexture = nextTexture;\n if (nextTexture._batchEnabled !== TICK) {\n if (textureCount === MAX_TEXTURES) {\n TICK++;\n textureCount = 0;\n if (currentGroup.size > 0) {\n currentGroup = DRAW_CALL_POOL.pop();\n if (!currentGroup) {\n currentGroup = new BatchDrawCall();\n currentGroup.texArray = new BatchTextureArray();\n }\n this.drawCalls.push(currentGroup);\n }\n currentGroup.start = index;\n currentGroup.size = 0;\n currentGroup.texArray.count = 0;\n currentGroup.type = drawMode;\n }\n // TODO add this to the render part..\n // Hack! Because texture has protected `touched`\n nextTexture.touched = 1; // touch;\n nextTexture._batchEnabled = TICK;\n nextTexture._batchLocation = textureCount;\n nextTexture.wrapMode = 10497;\n currentGroup.texArray.elements[currentGroup.texArray.count++] = nextTexture;\n textureCount++;\n }\n }\n currentGroup.size += data.size;\n index += data.size;\n textureId = nextTexture._batchLocation;\n this.addColors(colors, style.color, style.alpha, data.attribSize);\n this.addTextureIds(textureIds, textureId, data.attribSize);\n }\n BaseTexture._globalBatch = TICK;\n // upload..\n // merge for now!\n this.packAttributes();\n };\n /**\n * Packs attributes to single buffer.\n *\n * @protected\n */\n GraphicsGeometry.prototype.packAttributes = function () {\n var verts = this.points;\n var uvs = this.uvs;\n var colors = this.colors;\n var textureIds = this.textureIds;\n // verts are 2 positions.. so we * by 3 as there are 6 properties.. then 4 cos its bytes\n var glPoints = new ArrayBuffer(verts.length * 3 * 4);\n var f32 = new Float32Array(glPoints);\n var u32 = new Uint32Array(glPoints);\n var p = 0;\n for (var i = 0; i < verts.length / 2; i++) {\n f32[p++] = verts[i * 2];\n f32[p++] = verts[(i * 2) + 1];\n f32[p++] = uvs[i * 2];\n f32[p++] = uvs[(i * 2) + 1];\n u32[p++] = colors[i];\n f32[p++] = textureIds[i];\n }\n this._buffer.update(glPoints);\n this._indexBuffer.update(this.indicesUint16);\n };\n /**\n * Process fill part of Graphics.\n *\n * @param {PIXI.GraphicsData} data\n * @protected\n */\n GraphicsGeometry.prototype.processFill = function (data) {\n if (data.holes.length) {\n this.processHoles(data.holes);\n buildPoly.triangulate(data, this);\n }\n else {\n var command = FILL_COMMANDS[data.type];\n command.triangulate(data, this);\n }\n };\n /**\n * Process line part of Graphics.\n *\n * @param {PIXI.GraphicsData} data\n * @protected\n */\n GraphicsGeometry.prototype.processLine = function (data) {\n buildLine(data, this);\n for (var i = 0; i < data.holes.length; i++) {\n buildLine(data.holes[i], this);\n }\n };\n /**\n * Process the holes data.\n *\n * @param {PIXI.GraphicsData[]} holes - Holes to render\n * @protected\n */\n GraphicsGeometry.prototype.processHoles = function (holes) {\n for (var i = 0; i < holes.length; i++) {\n var hole = holes[i];\n var command = FILL_COMMANDS[hole.type];\n command.build(hole);\n if (hole.matrix) {\n this.transformPoints(hole.points, hole.matrix);\n }\n }\n };\n /**\n * Update the local bounds of the object. Expensive to use performance-wise.\n *\n * @protected\n */\n GraphicsGeometry.prototype.calculateBounds = function () {\n var bounds = this._bounds;\n var sequenceBounds = tmpBounds;\n var curMatrix = Matrix.IDENTITY;\n this._bounds.clear();\n sequenceBounds.clear();\n for (var i = 0; i < this.graphicsData.length; i++) {\n var data = this.graphicsData[i];\n var shape = data.shape;\n var type = data.type;\n var lineStyle = data.lineStyle;\n var nextMatrix = data.matrix || Matrix.IDENTITY;\n var lineWidth = 0.0;\n if (lineStyle && lineStyle.visible) {\n var alignment = lineStyle.alignment;\n lineWidth = lineStyle.width;\n if (type === SHAPES.POLY) {\n lineWidth = lineWidth * (0.5 + Math.abs(0.5 - alignment));\n }\n else {\n lineWidth = lineWidth * Math.max(0, alignment);\n }\n }\n if (curMatrix !== nextMatrix) {\n if (!sequenceBounds.isEmpty()) {\n bounds.addBoundsMatrix(sequenceBounds, curMatrix);\n sequenceBounds.clear();\n }\n curMatrix = nextMatrix;\n }\n if (type === SHAPES.RECT || type === SHAPES.RREC) {\n var rect = shape;\n sequenceBounds.addFramePad(rect.x, rect.y, rect.x + rect.width, rect.y + rect.height, lineWidth, lineWidth);\n }\n else if (type === SHAPES.CIRC) {\n var circle = shape;\n sequenceBounds.addFramePad(circle.x, circle.y, circle.x, circle.y, circle.radius + lineWidth, circle.radius + lineWidth);\n }\n else if (type === SHAPES.ELIP) {\n var ellipse = shape;\n sequenceBounds.addFramePad(ellipse.x, ellipse.y, ellipse.x, ellipse.y, ellipse.width + lineWidth, ellipse.height + lineWidth);\n }\n else {\n var poly = shape;\n // adding directly to the bounds\n bounds.addVerticesMatrix(curMatrix, poly.points, 0, poly.points.length, lineWidth, lineWidth);\n }\n }\n if (!sequenceBounds.isEmpty()) {\n bounds.addBoundsMatrix(sequenceBounds, curMatrix);\n }\n bounds.pad(this.boundsPadding, this.boundsPadding);\n };\n /**\n * Transform points using matrix.\n *\n * @protected\n * @param {number[]} points - Points to transform\n * @param {PIXI.Matrix} matrix - Transform matrix\n */\n GraphicsGeometry.prototype.transformPoints = function (points, matrix) {\n for (var i = 0; i < points.length / 2; i++) {\n var x = points[(i * 2)];\n var y = points[(i * 2) + 1];\n points[(i * 2)] = (matrix.a * x) + (matrix.c * y) + matrix.tx;\n points[(i * 2) + 1] = (matrix.b * x) + (matrix.d * y) + matrix.ty;\n }\n };\n /**\n * Add colors.\n *\n * @protected\n * @param {number[]} colors - List of colors to add to\n * @param {number} color - Color to add\n * @param {number} alpha - Alpha to use\n * @param {number} size - Number of colors to add\n */\n GraphicsGeometry.prototype.addColors = function (colors, color, alpha, size) {\n // TODO use the premultiply bits Ivan added\n var rgb = (color >> 16) + (color & 0xff00) + ((color & 0xff) << 16);\n var rgba = premultiplyTint(rgb, alpha);\n while (size-- > 0) {\n colors.push(rgba);\n }\n };\n /**\n * Add texture id that the shader/fragment wants to use.\n *\n * @protected\n * @param {number[]} textureIds\n * @param {number} id\n * @param {number} size\n */\n GraphicsGeometry.prototype.addTextureIds = function (textureIds, id, size) {\n while (size-- > 0) {\n textureIds.push(id);\n }\n };\n /**\n * Generates the UVs for a shape.\n *\n * @protected\n * @param {number[]} verts - Vertices\n * @param {number[]} uvs - UVs\n * @param {PIXI.Texture} texture - Reference to Texture\n * @param {number} start - Index buffer start index.\n * @param {number} size - The size/length for index buffer.\n * @param {PIXI.Matrix} [matrix] - Optional transform for all points.\n */\n GraphicsGeometry.prototype.addUvs = function (verts, uvs, texture, start, size, matrix) {\n if (matrix === void 0) { matrix = null; }\n var index = 0;\n var uvsStart = uvs.length;\n var frame = texture.frame;\n while (index < size) {\n var x = verts[(start + index) * 2];\n var y = verts[((start + index) * 2) + 1];\n if (matrix) {\n var nx = (matrix.a * x) + (matrix.c * y) + matrix.tx;\n y = (matrix.b * x) + (matrix.d * y) + matrix.ty;\n x = nx;\n }\n index++;\n uvs.push(x / frame.width, y / frame.height);\n }\n var baseTexture = texture.baseTexture;\n if (frame.width < baseTexture.width\n || frame.height < baseTexture.height) {\n this.adjustUvs(uvs, texture, uvsStart, size);\n }\n };\n /**\n * Modify uvs array according to position of texture region\n * Does not work with rotated or trimmed textures\n *\n * @param {number[]} uvs - array\n * @param {PIXI.Texture} texture - region\n * @param {number} start - starting index for uvs\n * @param {number} size - how many points to adjust\n */\n GraphicsGeometry.prototype.adjustUvs = function (uvs, texture, start, size) {\n var baseTexture = texture.baseTexture;\n var eps = 1e-6;\n var finish = start + (size * 2);\n var frame = texture.frame;\n var scaleX = frame.width / baseTexture.width;\n var scaleY = frame.height / baseTexture.height;\n var offsetX = frame.x / frame.width;\n var offsetY = frame.y / frame.height;\n var minX = Math.floor(uvs[start] + eps);\n var minY = Math.floor(uvs[start + 1] + eps);\n for (var i = start + 2; i < finish; i += 2) {\n minX = Math.min(minX, Math.floor(uvs[i] + eps));\n minY = Math.min(minY, Math.floor(uvs[i + 1] + eps));\n }\n offsetX -= minX;\n offsetY -= minY;\n for (var i = start; i < finish; i += 2) {\n uvs[i] = (uvs[i] + offsetX) * scaleX;\n uvs[i + 1] = (uvs[i + 1] + offsetY) * scaleY;\n }\n };\n /**\n * The maximum number of points to consider an object \"batchable\",\n * able to be batched by the renderer's batch system.\n *\n * @memberof PIXI.GraphicsGeometry\n * @static\n * @member {number} BATCHABLE_SIZE\n * @default 100\n */\n GraphicsGeometry.BATCHABLE_SIZE = 100;\n return GraphicsGeometry;\n}(BatchGeometry));\n\n/**\n * Represents the line style for Graphics.\n * @memberof PIXI\n * @class\n * @extends PIXI.FillStyle\n */\nvar LineStyle = /** @class */ (function (_super) {\n __extends(LineStyle, _super);\n function LineStyle() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n /**\n * The width (thickness) of any lines drawn.\n *\n * @member {number}\n * @default 0\n */\n _this.width = 0;\n /**\n * The alignment of any lines drawn (0.5 = middle, 1 = outer, 0 = inner).\n *\n * @member {number}\n * @default 0.5\n */\n _this.alignment = 0.5;\n /**\n * If true the lines will be draw using LINES instead of TRIANGLE_STRIP\n *\n * @member {boolean}\n * @default false\n */\n _this.native = false;\n /**\n * Line cap style.\n *\n * @member {PIXI.LINE_CAP}\n * @default PIXI.LINE_CAP.BUTT\n */\n _this.cap = LINE_CAP.BUTT;\n /**\n * Line join style.\n *\n * @member {PIXI.LINE_JOIN}\n * @default PIXI.LINE_JOIN.MITER\n */\n _this.join = LINE_JOIN.MITER;\n /**\n * Miter limit.\n *\n * @member {number}\n * @default 10\n */\n _this.miterLimit = 10;\n return _this;\n }\n /**\n * Clones the object\n *\n * @return {PIXI.LineStyle}\n */\n LineStyle.prototype.clone = function () {\n var obj = new LineStyle();\n obj.color = this.color;\n obj.alpha = this.alpha;\n obj.texture = this.texture;\n obj.matrix = this.matrix;\n obj.visible = this.visible;\n obj.width = this.width;\n obj.alignment = this.alignment;\n obj.native = this.native;\n obj.cap = this.cap;\n obj.join = this.join;\n obj.miterLimit = this.miterLimit;\n return obj;\n };\n /**\n * Reset the line style to default.\n */\n LineStyle.prototype.reset = function () {\n _super.prototype.reset.call(this);\n // Override default line style color\n this.color = 0x0;\n this.alignment = 0.5;\n this.width = 0;\n this.native = false;\n };\n return LineStyle;\n}(FillStyle));\n\nvar temp = new Float32Array(3);\n// a default shaders map used by graphics..\nvar DEFAULT_SHADERS = {};\n/**\n * The Graphics class contains methods used to draw primitive shapes such as lines, circles and\n * rectangles to the display, and to color and fill them.\n *\n * Note that because Graphics can share a GraphicsGeometry with other instances,\n * it is necessary to call `destroy()` to properly dereference the underlying\n * GraphicsGeometry and avoid a memory leak. Alternatively, keep using the same\n * Graphics instance and call `clear()` between redraws.\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI\n */\nvar Graphics = /** @class */ (function (_super) {\n __extends(Graphics, _super);\n /**\n * @param {PIXI.GraphicsGeometry} [geometry=null] - Geometry to use, if omitted\n * will create a new GraphicsGeometry instance.\n */\n function Graphics(geometry) {\n if (geometry === void 0) { geometry = null; }\n var _this = _super.call(this) || this;\n _this._geometry = geometry || new GraphicsGeometry();\n _this._geometry.refCount++;\n /**\n * Represents the vertex and fragment shaders that processes the geometry and runs on the GPU.\n * Can be shared between multiple Graphics objects.\n *\n * @member {PIXI.Shader}\n */\n _this.shader = null;\n /**\n * Represents the WebGL state the Graphics required to render, excludes shader and geometry. E.g.,\n * blend mode, culling, depth testing, direction of rendering triangles, backface, etc.\n *\n * @member {PIXI.State}\n */\n _this.state = State.for2d();\n /**\n * Current fill style\n *\n * @member {PIXI.FillStyle}\n * @protected\n */\n _this._fillStyle = new FillStyle();\n /**\n * Current line style\n *\n * @member {PIXI.LineStyle}\n * @protected\n */\n _this._lineStyle = new LineStyle();\n /**\n * Current shape transform matrix.\n *\n * @member {PIXI.Matrix}\n * @protected\n */\n _this._matrix = null;\n /**\n * Current hole mode is enabled.\n *\n * @member {boolean}\n * @default false\n * @protected\n */\n _this._holeMode = false;\n /**\n * Current path\n *\n * @member {PIXI.Polygon}\n * @protected\n */\n _this.currentPath = null;\n /**\n * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite.\n * This is useful if your graphics element does not change often, as it will speed up the rendering\n * of the object in exchange for taking up texture memory. It is also useful if you need the graphics\n * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if\n * you are constantly redrawing the graphics element.\n *\n * @name cacheAsBitmap\n * @member {boolean}\n * @memberof PIXI.Graphics#\n * @default false\n */\n /**\n * A collections of batches! These can be drawn by the renderer batch system.\n *\n * @protected\n * @member {object[]}\n */\n _this.batches = [];\n /**\n * Update dirty for limiting calculating tints for batches.\n *\n * @protected\n * @member {number}\n * @default -1\n */\n _this.batchTint = -1;\n /**\n * Update dirty for limiting calculating batches.\n *\n * @protected\n * @member {number}\n * @default -1\n */\n _this.batchDirty = -1;\n /**\n * Copy of the object vertex data.\n *\n * @protected\n * @member {Float32Array}\n */\n _this.vertexData = null;\n /**\n * Renderer plugin for batching\n *\n * @member {string}\n * @default 'batch'\n */\n _this.pluginName = 'batch';\n _this._transformID = -1;\n // Set default\n _this.tint = 0xFFFFFF;\n _this.blendMode = BLEND_MODES.NORMAL;\n return _this;\n }\n Object.defineProperty(Graphics.prototype, \"geometry\", {\n /**\n * Includes vertex positions, face indices, normals, colors, UVs, and\n * custom attributes within buffers, reducing the cost of passing all\n * this data to the GPU. Can be shared between multiple Mesh or Graphics objects.\n *\n * @member {PIXI.GraphicsGeometry}\n * @readonly\n */\n get: function () {\n return this._geometry;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Creates a new Graphics object with the same values as this one.\n * Note that only the geometry of the object is cloned, not its transform (position,scale,etc)\n *\n * @return {PIXI.Graphics} A clone of the graphics object\n */\n Graphics.prototype.clone = function () {\n this.finishPoly();\n return new Graphics(this._geometry);\n };\n Object.defineProperty(Graphics.prototype, \"blendMode\", {\n get: function () {\n return this.state.blendMode;\n },\n /**\n * The blend mode to be applied to the graphic shape. Apply a value of\n * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL;\n * @see PIXI.BLEND_MODES\n */\n set: function (value) {\n this.state.blendMode = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Graphics.prototype, \"tint\", {\n /**\n * The tint applied to the graphic shape. This is a hex value. A value of\n * 0xFFFFFF will remove any tint effect.\n *\n * @member {number}\n * @default 0xFFFFFF\n */\n get: function () {\n return this._tint;\n },\n set: function (value) {\n this._tint = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Graphics.prototype, \"fill\", {\n /**\n * The current fill style.\n *\n * @member {PIXI.FillStyle}\n * @readonly\n */\n get: function () {\n return this._fillStyle;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Graphics.prototype, \"line\", {\n /**\n * The current line style.\n *\n * @member {PIXI.LineStyle}\n * @readonly\n */\n get: function () {\n return this._lineStyle;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo()\n * method or the drawCircle() method.\n *\n * @method PIXI.Graphics#lineStyle\n * @param {number} [width=0] - width of the line to draw, will update the objects stored style\n * @param {number} [color=0x0] - color of the line to draw, will update the objects stored style\n * @param {number} [alpha=1] - alpha of the line to draw, will update the objects stored style\n * @param {number} [alignment=0.5] - alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outter)\n * @param {boolean} [native=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n /**\n * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo()\n * method or the drawCircle() method.\n *\n * @param {object} [options] - Line style options\n * @param {number} [options.width=0] - width of the line to draw, will update the objects stored style\n * @param {number} [options.color=0x0] - color of the line to draw, will update the objects stored style\n * @param {number} [options.alpha=1] - alpha of the line to draw, will update the objects stored style\n * @param {number} [options.alignment=0.5] - alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outter)\n * @param {boolean} [options.native=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP\n * @param {PIXI.LINE_CAP}[options.cap=PIXI.LINE_CAP.BUTT] - line cap style\n * @param {PIXI.LINE_JOIN}[options.join=PIXI.LINE_JOIN.MITER] - line join style\n * @param {number}[options.miterLimit=10] - miter limit ratio\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.lineStyle = function (options) {\n if (options === void 0) { options = null; }\n // Support non-object params: (width, color, alpha, alignment, native)\n if (typeof options === 'number') {\n // eslint-disable-next-line\n var args = arguments;\n options = {\n width: args[0] || 0,\n color: args[1] || 0x0,\n alpha: args[2] !== undefined ? args[2] : 1,\n alignment: args[3] !== undefined ? args[3] : 0.5,\n native: !!args[4],\n };\n }\n return this.lineTextureStyle(options);\n };\n /**\n * Like line style but support texture for line fill.\n *\n * @param {object} [options] - Collection of options for setting line style.\n * @param {number} [options.width=0] - width of the line to draw, will update the objects stored style\n * @param {PIXI.Texture} [options.texture=PIXI.Texture.WHITE] - Texture to use\n * @param {number} [options.color=0x0] - color of the line to draw, will update the objects stored style.\n * Default 0xFFFFFF if texture present.\n * @param {number} [options.alpha=1] - alpha of the line to draw, will update the objects stored style\n * @param {PIXI.Matrix} [options.matrix=null] - Texture matrix to transform texture\n * @param {number} [options.alignment=0.5] - alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outter)\n * @param {boolean} [options.native=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP\n * @param {PIXI.LINE_CAP}[options.cap=PIXI.LINE_CAP.BUTT] - line cap style\n * @param {PIXI.LINE_JOIN}[options.join=PIXI.LINE_JOIN.MITER] - line join style\n * @param {number}[options.miterLimit=10] - miter limit ratio\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.lineTextureStyle = function (options) {\n // backward compatibility with params: (width, texture,\n // color, alpha, matrix, alignment, native)\n if (typeof options === 'number') {\n deprecation('v5.2.0', 'Please use object-based options for Graphics#lineTextureStyle');\n // eslint-disable-next-line\n var _a = arguments, width = _a[0], texture = _a[1], color = _a[2], alpha = _a[3], matrix = _a[4], alignment = _a[5], native = _a[6];\n options = { width: width, texture: texture, color: color, alpha: alpha, matrix: matrix, alignment: alignment, native: native };\n // Remove undefined keys\n Object.keys(options).forEach(function (key) { return options[key] === undefined && delete options[key]; });\n }\n // Apply defaults\n options = Object.assign({\n width: 0,\n texture: Texture.WHITE,\n color: (options && options.texture) ? 0xFFFFFF : 0x0,\n alpha: 1,\n matrix: null,\n alignment: 0.5,\n native: false,\n cap: LINE_CAP.BUTT,\n join: LINE_JOIN.MITER,\n miterLimit: 10,\n }, options);\n if (this.currentPath) {\n this.startPoly();\n }\n var visible = options.width > 0 && options.alpha > 0;\n if (!visible) {\n this._lineStyle.reset();\n }\n else {\n if (options.matrix) {\n options.matrix = options.matrix.clone();\n options.matrix.invert();\n }\n Object.assign(this._lineStyle, { visible: visible }, options);\n }\n return this;\n };\n /**\n * Start a polygon object internally\n * @protected\n */\n Graphics.prototype.startPoly = function () {\n if (this.currentPath) {\n var points = this.currentPath.points;\n var len = this.currentPath.points.length;\n if (len > 2) {\n this.drawShape(this.currentPath);\n this.currentPath = new Polygon();\n this.currentPath.closeStroke = false;\n this.currentPath.points.push(points[len - 2], points[len - 1]);\n }\n }\n else {\n this.currentPath = new Polygon();\n this.currentPath.closeStroke = false;\n }\n };\n /**\n * Finish the polygon object.\n * @protected\n */\n Graphics.prototype.finishPoly = function () {\n if (this.currentPath) {\n if (this.currentPath.points.length > 2) {\n this.drawShape(this.currentPath);\n this.currentPath = null;\n }\n else {\n this.currentPath.points.length = 0;\n }\n }\n };\n /**\n * Moves the current drawing position to x, y.\n *\n * @param {number} x - the X coordinate to move to\n * @param {number} y - the Y coordinate to move to\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.moveTo = function (x, y) {\n this.startPoly();\n this.currentPath.points[0] = x;\n this.currentPath.points[1] = y;\n return this;\n };\n /**\n * Draws a line using the current line style from the current drawing position to (x, y);\n * The current drawing position is then set to (x, y).\n *\n * @param {number} x - the X coordinate to draw to\n * @param {number} y - the Y coordinate to draw to\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.lineTo = function (x, y) {\n if (!this.currentPath) {\n this.moveTo(0, 0);\n }\n // remove duplicates..\n var points = this.currentPath.points;\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n if (fromX !== x || fromY !== y) {\n points.push(x, y);\n }\n return this;\n };\n /**\n * Initialize the curve\n *\n * @protected\n * @param {number} [x=0]\n * @param {number} [y=0]\n */\n Graphics.prototype._initCurve = function (x, y) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (this.currentPath) {\n if (this.currentPath.points.length === 0) {\n this.currentPath.points = [x, y];\n }\n }\n else {\n this.moveTo(x, y);\n }\n };\n /**\n * Calculate the points for a quadratic bezier curve and then draws it.\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n *\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) {\n this._initCurve();\n var points = this.currentPath.points;\n if (points.length === 0) {\n this.moveTo(0, 0);\n }\n QuadraticUtils.curveTo(cpX, cpY, toX, toY, points);\n return this;\n };\n /**\n * Calculate the points for a bezier curve and then draws it.\n *\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} cpX2 - Second Control point x\n * @param {number} cpY2 - Second Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) {\n this._initCurve();\n BezierUtils.curveTo(cpX, cpY, cpX2, cpY2, toX, toY, this.currentPath.points);\n return this;\n };\n /**\n * The arcTo() method creates an arc/curve between two tangents on the canvas.\n *\n * \"borrowed\" from https://code.google.com/p/fxcanvas/ - thanks google!\n *\n * @param {number} x1 - The x-coordinate of the first tangent point of the arc\n * @param {number} y1 - The y-coordinate of the first tangent point of the arc\n * @param {number} x2 - The x-coordinate of the end of the arc\n * @param {number} y2 - The y-coordinate of the end of the arc\n * @param {number} radius - The radius of the arc\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) {\n this._initCurve(x1, y1);\n var points = this.currentPath.points;\n var result = ArcUtils.curveTo(x1, y1, x2, y2, radius, points);\n if (result) {\n var cx = result.cx, cy = result.cy, radius_1 = result.radius, startAngle = result.startAngle, endAngle = result.endAngle, anticlockwise = result.anticlockwise;\n this.arc(cx, cy, radius_1, startAngle, endAngle, anticlockwise);\n }\n return this;\n };\n /**\n * The arc method creates an arc/curve (used to create circles, or parts of circles).\n *\n * @param {number} cx - The x-coordinate of the center of the circle\n * @param {number} cy - The y-coordinate of the center of the circle\n * @param {number} radius - The radius of the circle\n * @param {number} startAngle - The starting angle, in radians (0 is at the 3 o'clock position\n * of the arc's circle)\n * @param {number} endAngle - The ending angle, in radians\n * @param {boolean} [anticlockwise=false] - Specifies whether the drawing should be\n * counter-clockwise or clockwise. False is default, and indicates clockwise, while true\n * indicates counter-clockwise.\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.arc = function (cx, cy, radius, startAngle, endAngle, anticlockwise) {\n if (anticlockwise === void 0) { anticlockwise = false; }\n if (startAngle === endAngle) {\n return this;\n }\n if (!anticlockwise && endAngle <= startAngle) {\n endAngle += PI_2;\n }\n else if (anticlockwise && startAngle <= endAngle) {\n startAngle += PI_2;\n }\n var sweep = endAngle - startAngle;\n if (sweep === 0) {\n return this;\n }\n var startX = cx + (Math.cos(startAngle) * radius);\n var startY = cy + (Math.sin(startAngle) * radius);\n var eps = this._geometry.closePointEps;\n // If the currentPath exists, take its points. Otherwise call `moveTo` to start a path.\n var points = this.currentPath ? this.currentPath.points : null;\n if (points) {\n // TODO: make a better fix.\n // We check how far our start is from the last existing point\n var xDiff = Math.abs(points[points.length - 2] - startX);\n var yDiff = Math.abs(points[points.length - 1] - startY);\n if (xDiff < eps && yDiff < eps) ;\n else {\n points.push(startX, startY);\n }\n }\n else {\n this.moveTo(startX, startY);\n points = this.currentPath.points;\n }\n ArcUtils.arc(startX, startY, cx, cy, radius, startAngle, endAngle, anticlockwise, points);\n return this;\n };\n /**\n * Specifies a simple one-color fill that subsequent calls to other Graphics methods\n * (such as lineTo() or drawCircle()) use when drawing.\n *\n * @param {number} [color=0] - the color of the fill\n * @param {number} [alpha=1] - the alpha of the fill\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.beginFill = function (color, alpha) {\n if (color === void 0) { color = 0; }\n if (alpha === void 0) { alpha = 1; }\n return this.beginTextureFill({ texture: Texture.WHITE, color: color, alpha: alpha });\n };\n /**\n * Begin the texture fill\n *\n * @param {object} [options] - Object object.\n * @param {PIXI.Texture} [options.texture=PIXI.Texture.WHITE] - Texture to fill\n * @param {number} [options.color=0xffffff] - Background to fill behind texture\n * @param {number} [options.alpha=1] - Alpha of fill\n * @param {PIXI.Matrix} [options.matrix=null] - Transform matrix\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.beginTextureFill = function (options) {\n // backward compatibility with params: (texture, color, alpha, matrix)\n if (options instanceof Texture) {\n deprecation('v5.2.0', 'Please use object-based options for Graphics#beginTextureFill');\n // eslint-disable-next-line\n var _a = arguments, texture = _a[0], color = _a[1], alpha = _a[2], matrix = _a[3];\n options = { texture: texture, color: color, alpha: alpha, matrix: matrix };\n // Remove undefined keys\n Object.keys(options).forEach(function (key) { return options[key] === undefined && delete options[key]; });\n }\n // Apply defaults\n options = Object.assign({\n texture: Texture.WHITE,\n color: 0xFFFFFF,\n alpha: 1,\n matrix: null,\n }, options);\n if (this.currentPath) {\n this.startPoly();\n }\n var visible = options.alpha > 0;\n if (!visible) {\n this._fillStyle.reset();\n }\n else {\n if (options.matrix) {\n options.matrix = options.matrix.clone();\n options.matrix.invert();\n }\n Object.assign(this._fillStyle, { visible: visible }, options);\n }\n return this;\n };\n /**\n * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.\n *\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.endFill = function () {\n this.finishPoly();\n this._fillStyle.reset();\n return this;\n };\n /**\n * Draws a rectangle shape.\n *\n * @param {number} x - The X coord of the top-left of the rectangle\n * @param {number} y - The Y coord of the top-left of the rectangle\n * @param {number} width - The width of the rectangle\n * @param {number} height - The height of the rectangle\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawRect = function (x, y, width, height) {\n return this.drawShape(new Rectangle(x, y, width, height));\n };\n /**\n * Draw a rectangle shape with rounded/beveled corners.\n *\n * @param {number} x - The X coord of the top-left of the rectangle\n * @param {number} y - The Y coord of the top-left of the rectangle\n * @param {number} width - The width of the rectangle\n * @param {number} height - The height of the rectangle\n * @param {number} radius - Radius of the rectangle corners\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawRoundedRect = function (x, y, width, height, radius) {\n return this.drawShape(new RoundedRectangle(x, y, width, height, radius));\n };\n /**\n * Draws a circle.\n *\n * @param {number} x - The X coordinate of the center of the circle\n * @param {number} y - The Y coordinate of the center of the circle\n * @param {number} radius - The radius of the circle\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawCircle = function (x, y, radius) {\n return this.drawShape(new Circle(x, y, radius));\n };\n /**\n * Draws an ellipse.\n *\n * @param {number} x - The X coordinate of the center of the ellipse\n * @param {number} y - The Y coordinate of the center of the ellipse\n * @param {number} width - The half width of the ellipse\n * @param {number} height - The half height of the ellipse\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawEllipse = function (x, y, width, height) {\n return this.drawShape(new Ellipse(x, y, width, height));\n };\n /**\n * Draws a polygon using the given path.\n *\n * @param {number[]|PIXI.Point[]|PIXI.Polygon} path - The path data used to construct the polygon.\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawPolygon = function () {\n var arguments$1 = arguments;\n\n var path = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n path[_i] = arguments$1[_i];\n }\n var points;\n var closeStroke = true; // !!this._fillStyle;\n var poly = path[0];\n // check if data has points..\n if (poly.points) {\n closeStroke = poly.closeStroke;\n points = poly.points;\n }\n else if (Array.isArray(path[0])) {\n points = path[0];\n }\n else {\n points = path;\n }\n var shape = new Polygon(points);\n shape.closeStroke = closeStroke;\n this.drawShape(shape);\n return this;\n };\n /**\n * Draw any shape.\n *\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - Shape to draw\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawShape = function (shape) {\n if (!this._holeMode) {\n this._geometry.drawShape(shape, this._fillStyle.clone(), this._lineStyle.clone(), this._matrix);\n }\n else {\n this._geometry.drawHole(shape, this._matrix);\n }\n return this;\n };\n /**\n * Draw a star shape with an arbitrary number of points.\n *\n * @param {number} x - Center X position of the star\n * @param {number} y - Center Y position of the star\n * @param {number} points - The number of points of the star, must be > 1\n * @param {number} radius - The outer radius of the star\n * @param {number} [innerRadius] - The inner radius between points, default half `radius`\n * @param {number} [rotation=0] - The rotation of the star in radians, where 0 is vertical\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawStar = function (x, y, points, radius, innerRadius, rotation) {\n if (rotation === void 0) { rotation = 0; }\n return this.drawPolygon(new Star(x, y, points, radius, innerRadius, rotation));\n };\n /**\n * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.\n *\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.clear = function () {\n this._geometry.clear();\n this._lineStyle.reset();\n this._fillStyle.reset();\n this._boundsID++;\n this._matrix = null;\n this._holeMode = false;\n this.currentPath = null;\n return this;\n };\n /**\n * True if graphics consists of one rectangle, and thus, can be drawn like a Sprite and\n * masked with gl.scissor.\n *\n * @returns {boolean} True if only 1 rect.\n */\n Graphics.prototype.isFastRect = function () {\n var data = this._geometry.graphicsData;\n return data.length === 1\n && data[0].shape.type === SHAPES.RECT\n && !(data[0].lineStyle.visible && data[0].lineStyle.width);\n };\n /**\n * Renders the object using the WebGL renderer\n *\n * @protected\n * @param {PIXI.Renderer} renderer - The renderer\n */\n Graphics.prototype._render = function (renderer) {\n this.finishPoly();\n var geometry = this._geometry;\n var hasuint32 = renderer.context.supports.uint32Indices;\n // batch part..\n // batch it!\n geometry.updateBatches(hasuint32);\n if (geometry.batchable) {\n if (this.batchDirty !== geometry.batchDirty) {\n this._populateBatches();\n }\n this._renderBatched(renderer);\n }\n else {\n // no batching...\n renderer.batch.flush();\n this._renderDirect(renderer);\n }\n };\n /**\n * Populating batches for rendering\n *\n * @protected\n */\n Graphics.prototype._populateBatches = function () {\n var geometry = this._geometry;\n var blendMode = this.blendMode;\n var len = geometry.batches.length;\n this.batchTint = -1;\n this._transformID = -1;\n this.batchDirty = geometry.batchDirty;\n this.batches.length = len;\n this.vertexData = new Float32Array(geometry.points);\n for (var i = 0; i < len; i++) {\n var gI = geometry.batches[i];\n var color = gI.style.color;\n var vertexData = new Float32Array(this.vertexData.buffer, gI.attribStart * 4 * 2, gI.attribSize * 2);\n var uvs = new Float32Array(geometry.uvsFloat32.buffer, gI.attribStart * 4 * 2, gI.attribSize * 2);\n var indices = new Uint16Array(geometry.indicesUint16.buffer, gI.start * 2, gI.size);\n var batch = {\n vertexData: vertexData,\n blendMode: blendMode,\n indices: indices,\n uvs: uvs,\n _batchRGB: hex2rgb(color),\n _tintRGB: color,\n _texture: gI.style.texture,\n alpha: gI.style.alpha,\n worldAlpha: 1\n };\n this.batches[i] = batch;\n }\n };\n /**\n * Renders the batches using the BathedRenderer plugin\n *\n * @protected\n * @param {PIXI.Renderer} renderer - The renderer\n */\n Graphics.prototype._renderBatched = function (renderer) {\n if (!this.batches.length) {\n return;\n }\n renderer.batch.setObjectRenderer(renderer.plugins[this.pluginName]);\n this.calculateVertices();\n this.calculateTints();\n for (var i = 0, l = this.batches.length; i < l; i++) {\n var batch = this.batches[i];\n batch.worldAlpha = this.worldAlpha * batch.alpha;\n renderer.plugins[this.pluginName].render(batch);\n }\n };\n /**\n * Renders the graphics direct\n *\n * @protected\n * @param {PIXI.Renderer} renderer - The renderer\n */\n Graphics.prototype._renderDirect = function (renderer) {\n var shader = this._resolveDirectShader(renderer);\n var geometry = this._geometry;\n var tint = this.tint;\n var worldAlpha = this.worldAlpha;\n var uniforms = shader.uniforms;\n var drawCalls = geometry.drawCalls;\n // lets set the transfomr\n uniforms.translationMatrix = this.transform.worldTransform;\n // and then lets set the tint..\n uniforms.tint[0] = (((tint >> 16) & 0xFF) / 255) * worldAlpha;\n uniforms.tint[1] = (((tint >> 8) & 0xFF) / 255) * worldAlpha;\n uniforms.tint[2] = ((tint & 0xFF) / 255) * worldAlpha;\n uniforms.tint[3] = worldAlpha;\n // the first draw call, we can set the uniforms of the shader directly here.\n // this means that we can tack advantage of the sync function of pixi!\n // bind and sync uniforms..\n // there is a way to optimise this..\n renderer.shader.bind(shader);\n renderer.geometry.bind(geometry, shader);\n // set state..\n renderer.state.set(this.state);\n // then render the rest of them...\n for (var i = 0, l = drawCalls.length; i < l; i++) {\n this._renderDrawCallDirect(renderer, geometry.drawCalls[i]);\n }\n };\n /**\n * Renders specific DrawCall\n *\n * @param {PIXI.Renderer} renderer\n * @param {PIXI.BatchDrawCall} drawCall\n */\n Graphics.prototype._renderDrawCallDirect = function (renderer, drawCall) {\n var texArray = drawCall.texArray, type = drawCall.type, size = drawCall.size, start = drawCall.start;\n var groupTextureCount = texArray.count;\n for (var j = 0; j < groupTextureCount; j++) {\n renderer.texture.bind(texArray.elements[j], j);\n }\n renderer.geometry.draw(type, size, start);\n };\n /**\n * Resolves shader for direct rendering\n *\n * @protected\n * @param {PIXI.Renderer} renderer - The renderer\n */\n Graphics.prototype._resolveDirectShader = function (renderer) {\n var shader = this.shader;\n var pluginName = this.pluginName;\n if (!shader) {\n // if there is no shader here, we can use the default shader.\n // and that only gets created if we actually need it..\n // but may be more than one plugins for graphics\n if (!DEFAULT_SHADERS[pluginName]) {\n var MAX_TEXTURES = renderer.plugins.batch.MAX_TEXTURES;\n var sampleValues = new Int32Array(MAX_TEXTURES);\n for (var i = 0; i < MAX_TEXTURES; i++) {\n sampleValues[i] = i;\n }\n var uniforms = {\n tint: new Float32Array([1, 1, 1, 1]),\n translationMatrix: new Matrix(),\n default: UniformGroup.from({ uSamplers: sampleValues }, true),\n };\n var program = renderer.plugins[pluginName]._shader.program;\n DEFAULT_SHADERS[pluginName] = new Shader(program, uniforms);\n }\n shader = DEFAULT_SHADERS[pluginName];\n }\n return shader;\n };\n /**\n * Retrieves the bounds of the graphic shape as a rectangle object\n *\n * @protected\n */\n Graphics.prototype._calculateBounds = function () {\n this.finishPoly();\n var geometry = this._geometry;\n // skipping when graphics is empty, like a container\n if (!geometry.graphicsData.length) {\n return;\n }\n var _a = geometry.bounds, minX = _a.minX, minY = _a.minY, maxX = _a.maxX, maxY = _a.maxY;\n this._bounds.addFrame(this.transform, minX, minY, maxX, maxY);\n };\n /**\n * Tests if a point is inside this graphics object\n *\n * @param {PIXI.IPointData} point - the point to test\n * @return {boolean} the result of the test\n */\n Graphics.prototype.containsPoint = function (point) {\n this.worldTransform.applyInverse(point, Graphics._TEMP_POINT);\n return this._geometry.containsPoint(Graphics._TEMP_POINT);\n };\n /**\n * Recalcuate the tint by applying tin to batches using Graphics tint.\n * @protected\n */\n Graphics.prototype.calculateTints = function () {\n if (this.batchTint !== this.tint) {\n this.batchTint = this.tint;\n var tintRGB = hex2rgb(this.tint, temp);\n for (var i = 0; i < this.batches.length; i++) {\n var batch = this.batches[i];\n var batchTint = batch._batchRGB;\n var r = (tintRGB[0] * batchTint[0]) * 255;\n var g = (tintRGB[1] * batchTint[1]) * 255;\n var b = (tintRGB[2] * batchTint[2]) * 255;\n // TODO Ivan, can this be done in one go?\n var color = (r << 16) + (g << 8) + (b | 0);\n batch._tintRGB = (color >> 16)\n + (color & 0xff00)\n + ((color & 0xff) << 16);\n }\n }\n };\n /**\n * If there's a transform update or a change to the shape of the\n * geometry, recaculate the vertices.\n * @protected\n */\n Graphics.prototype.calculateVertices = function () {\n var wtID = this.transform._worldID;\n if (this._transformID === wtID) {\n return;\n }\n this._transformID = wtID;\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var data = this._geometry.points; // batch.vertexDataOriginal;\n var vertexData = this.vertexData;\n var count = 0;\n for (var i = 0; i < data.length; i += 2) {\n var x = data[i];\n var y = data[i + 1];\n vertexData[count++] = (a * x) + (c * y) + tx;\n vertexData[count++] = (d * y) + (b * x) + ty;\n }\n };\n /**\n * Closes the current path.\n *\n * @return {PIXI.Graphics} Returns itself.\n */\n Graphics.prototype.closePath = function () {\n var currentPath = this.currentPath;\n if (currentPath) {\n // we don't need to add extra point in the end because buildLine will take care of that\n currentPath.closeStroke = true;\n }\n return this;\n };\n /**\n * Apply a matrix to the positional data.\n *\n * @param {PIXI.Matrix} matrix - Matrix to use for transform current shape.\n * @return {PIXI.Graphics} Returns itself.\n */\n Graphics.prototype.setMatrix = function (matrix) {\n this._matrix = matrix;\n return this;\n };\n /**\n * Begin adding holes to the last draw shape\n * IMPORTANT: holes must be fully inside a shape to work\n * Also weirdness ensues if holes overlap!\n * Ellipses, Circles, Rectangles and Rounded Rectangles cannot be holes or host for holes in CanvasRenderer,\n * please use `moveTo` `lineTo`, `quadraticCurveTo` if you rely on pixi-legacy bundle.\n * @return {PIXI.Graphics} Returns itself.\n */\n Graphics.prototype.beginHole = function () {\n this.finishPoly();\n this._holeMode = true;\n return this;\n };\n /**\n * End adding holes to the last draw shape\n * @return {PIXI.Graphics} Returns itself.\n */\n Graphics.prototype.endHole = function () {\n this.finishPoly();\n this._holeMode = false;\n return this;\n };\n /**\n * Destroys the Graphics object.\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all\n * options have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have\n * their destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the texture of the child sprite\n * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the base texture of the child sprite\n */\n Graphics.prototype.destroy = function (options) {\n this._geometry.refCount--;\n if (this._geometry.refCount === 0) {\n this._geometry.dispose();\n }\n this._matrix = null;\n this.currentPath = null;\n this._lineStyle.destroy();\n this._lineStyle = null;\n this._fillStyle.destroy();\n this._fillStyle = null;\n this._geometry = null;\n this.shader = null;\n this.vertexData = null;\n this.batches.length = 0;\n this.batches = null;\n _super.prototype.destroy.call(this, options);\n };\n /**\n * Temporary point to use for containsPoint\n *\n * @static\n * @private\n * @member {PIXI.Point}\n */\n Graphics._TEMP_POINT = new Point();\n return Graphics;\n}(Container));\n\nexport { FillStyle, GRAPHICS_CURVES, Graphics, GraphicsData, GraphicsGeometry, LINE_CAP, LINE_JOIN, LineStyle, index as graphicsUtils };\n//# sourceMappingURL=graphics.es.js.map\n","/*!\n * @pixi/sprite - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/sprite is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { BLEND_MODES } from '@pixi/constants';\nimport { Texture } from '@pixi/core';\nimport { Container } from '@pixi/display';\nimport { Point, ObservablePoint, Rectangle } from '@pixi/math';\nimport { settings } from '@pixi/settings';\nimport { sign } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar tempPoint = new Point();\nvar indices = new Uint16Array([0, 1, 2, 0, 2, 3]);\n/**\n * The Sprite object is the base for all textured objects that are rendered to the screen\n*\n * A sprite can be created directly from an image like this:\n *\n * ```js\n * let sprite = PIXI.Sprite.from('assets/image.png');\n * ```\n *\n * The more efficient way to create sprites is using a {@link PIXI.Spritesheet},\n * as swapping base textures when rendering to the screen is inefficient.\n *\n * ```js\n * PIXI.Loader.shared.add(\"assets/spritesheet.json\").load(setup);\n *\n * function setup() {\n * let sheet = PIXI.Loader.shared.resources[\"assets/spritesheet.json\"].spritesheet;\n * let sprite = new PIXI.Sprite(sheet.textures[\"image.png\"]);\n * ...\n * }\n * ```\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI\n */\nvar Sprite = /** @class */ (function (_super) {\n __extends(Sprite, _super);\n /**\n * @param {PIXI.Texture} [texture] - The texture for this sprite.\n */\n function Sprite(texture) {\n var _this = _super.call(this) || this;\n /**\n * The anchor point defines the normalized coordinates\n * in the texture that map to the position of this\n * sprite.\n *\n * By default, this is `(0,0)` (or `texture.defaultAnchor`\n * if you have modified that), which means the position\n * `(x,y)` of this `Sprite` will be the top-left corner.\n *\n * Note: Updating `texture.defaultAnchor` after\n * constructing a `Sprite` does _not_ update its anchor.\n *\n * {@link https://docs.cocos2d-x.org/cocos2d-x/en/sprites/manipulation.html}\n *\n * @default `texture.defaultAnchor`\n * @member {PIXI.ObservablePoint}\n * @private\n */\n _this._anchor = new ObservablePoint(_this._onAnchorUpdate, _this, (texture ? texture.defaultAnchor.x : 0), (texture ? texture.defaultAnchor.y : 0));\n /**\n * The texture that the sprite is using\n *\n * @private\n * @member {PIXI.Texture}\n */\n _this._texture = null;\n /**\n * The width of the sprite (this is initially set by the texture)\n *\n * @protected\n * @member {number}\n */\n _this._width = 0;\n /**\n * The height of the sprite (this is initially set by the texture)\n *\n * @protected\n * @member {number}\n */\n _this._height = 0;\n /**\n * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.\n *\n * @private\n * @member {number}\n * @default 0xFFFFFF\n */\n _this._tint = null;\n /**\n * The tint applied to the sprite. This is a RGB value. A value of 0xFFFFFF will remove any tint effect.\n *\n * @private\n * @member {number}\n * @default 16777215\n */\n _this._tintRGB = null;\n _this.tint = 0xFFFFFF;\n /**\n * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL\n * @see PIXI.BLEND_MODES\n */\n _this.blendMode = BLEND_MODES.NORMAL;\n /**\n * Cached tint value so we can tell when the tint is changed.\n * Value is used for 2d CanvasRenderer.\n *\n * @protected\n * @member {number}\n * @default 0xFFFFFF\n */\n _this._cachedTint = 0xFFFFFF;\n /**\n * this is used to store the uvs data of the sprite, assigned at the same time\n * as the vertexData in calculateVertices()\n *\n * @private\n * @member {Float32Array}\n */\n _this.uvs = null;\n // call texture setter\n _this.texture = texture || Texture.EMPTY;\n /**\n * this is used to store the vertex data of the sprite (basically a quad)\n *\n * @private\n * @member {Float32Array}\n */\n _this.vertexData = new Float32Array(8);\n /**\n * This is used to calculate the bounds of the object IF it is a trimmed sprite\n *\n * @private\n * @member {Float32Array}\n */\n _this.vertexTrimmedData = null;\n _this._transformID = -1;\n _this._textureID = -1;\n _this._transformTrimmedID = -1;\n _this._textureTrimmedID = -1;\n // Batchable stuff..\n // TODO could make this a mixin?\n _this.indices = indices;\n /**\n * Plugin that is responsible for rendering this element.\n * Allows to customize the rendering process without overriding '_render' & '_renderCanvas' methods.\n *\n * @member {string}\n * @default 'batch'\n */\n _this.pluginName = 'batch';\n /**\n * used to fast check if a sprite is.. a sprite!\n * @member {boolean}\n */\n _this.isSprite = true;\n /**\n * Internal roundPixels field\n *\n * @member {boolean}\n * @private\n */\n _this._roundPixels = settings.ROUND_PIXELS;\n return _this;\n }\n /**\n * When the texture is updated, this event will fire to update the scale and frame\n *\n * @protected\n */\n Sprite.prototype._onTextureUpdate = function () {\n this._textureID = -1;\n this._textureTrimmedID = -1;\n this._cachedTint = 0xFFFFFF;\n // so if _width is 0 then width was not set..\n if (this._width) {\n this.scale.x = sign(this.scale.x) * this._width / this._texture.orig.width;\n }\n if (this._height) {\n this.scale.y = sign(this.scale.y) * this._height / this._texture.orig.height;\n }\n };\n /**\n * Called when the anchor position updates.\n *\n * @private\n */\n Sprite.prototype._onAnchorUpdate = function () {\n this._transformID = -1;\n this._transformTrimmedID = -1;\n };\n /**\n * calculates worldTransform * vertices, store it in vertexData\n */\n Sprite.prototype.calculateVertices = function () {\n var texture = this._texture;\n if (this._transformID === this.transform._worldID && this._textureID === texture._updateID) {\n return;\n }\n // update texture UV here, because base texture can be changed without calling `_onTextureUpdate`\n if (this._textureID !== texture._updateID) {\n this.uvs = this._texture._uvs.uvsFloat32;\n }\n this._transformID = this.transform._worldID;\n this._textureID = texture._updateID;\n // set the vertex data\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var vertexData = this.vertexData;\n var trim = texture.trim;\n var orig = texture.orig;\n var anchor = this._anchor;\n var w0 = 0;\n var w1 = 0;\n var h0 = 0;\n var h1 = 0;\n if (trim) {\n // if the sprite is trimmed and is not a tilingsprite then we need to add the extra\n // space before transforming the sprite coords.\n w1 = trim.x - (anchor._x * orig.width);\n w0 = w1 + trim.width;\n h1 = trim.y - (anchor._y * orig.height);\n h0 = h1 + trim.height;\n }\n else {\n w1 = -anchor._x * orig.width;\n w0 = w1 + orig.width;\n h1 = -anchor._y * orig.height;\n h0 = h1 + orig.height;\n }\n // xy\n vertexData[0] = (a * w1) + (c * h1) + tx;\n vertexData[1] = (d * h1) + (b * w1) + ty;\n // xy\n vertexData[2] = (a * w0) + (c * h1) + tx;\n vertexData[3] = (d * h1) + (b * w0) + ty;\n // xy\n vertexData[4] = (a * w0) + (c * h0) + tx;\n vertexData[5] = (d * h0) + (b * w0) + ty;\n // xy\n vertexData[6] = (a * w1) + (c * h0) + tx;\n vertexData[7] = (d * h0) + (b * w1) + ty;\n if (this._roundPixels) {\n var resolution = settings.RESOLUTION;\n for (var i = 0; i < vertexData.length; ++i) {\n vertexData[i] = Math.round((vertexData[i] * resolution | 0) / resolution);\n }\n }\n };\n /**\n * calculates worldTransform * vertices for a non texture with a trim. store it in vertexTrimmedData\n * This is used to ensure that the true width and height of a trimmed texture is respected\n */\n Sprite.prototype.calculateTrimmedVertices = function () {\n if (!this.vertexTrimmedData) {\n this.vertexTrimmedData = new Float32Array(8);\n }\n else if (this._transformTrimmedID === this.transform._worldID && this._textureTrimmedID === this._texture._updateID) {\n return;\n }\n this._transformTrimmedID = this.transform._worldID;\n this._textureTrimmedID = this._texture._updateID;\n // lets do some special trim code!\n var texture = this._texture;\n var vertexData = this.vertexTrimmedData;\n var orig = texture.orig;\n var anchor = this._anchor;\n // lets calculate the new untrimmed bounds..\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var w1 = -anchor._x * orig.width;\n var w0 = w1 + orig.width;\n var h1 = -anchor._y * orig.height;\n var h0 = h1 + orig.height;\n // xy\n vertexData[0] = (a * w1) + (c * h1) + tx;\n vertexData[1] = (d * h1) + (b * w1) + ty;\n // xy\n vertexData[2] = (a * w0) + (c * h1) + tx;\n vertexData[3] = (d * h1) + (b * w0) + ty;\n // xy\n vertexData[4] = (a * w0) + (c * h0) + tx;\n vertexData[5] = (d * h0) + (b * w0) + ty;\n // xy\n vertexData[6] = (a * w1) + (c * h0) + tx;\n vertexData[7] = (d * h0) + (b * w1) + ty;\n };\n /**\n *\n * Renders the object using the WebGL renderer\n *\n * @protected\n * @param {PIXI.Renderer} renderer - The webgl renderer to use.\n */\n Sprite.prototype._render = function (renderer) {\n this.calculateVertices();\n renderer.batch.setObjectRenderer(renderer.plugins[this.pluginName]);\n renderer.plugins[this.pluginName].render(this);\n };\n /**\n * Updates the bounds of the sprite.\n *\n * @protected\n */\n Sprite.prototype._calculateBounds = function () {\n var trim = this._texture.trim;\n var orig = this._texture.orig;\n // First lets check to see if the current texture has a trim..\n if (!trim || (trim.width === orig.width && trim.height === orig.height)) {\n // no trim! lets use the usual calculations..\n this.calculateVertices();\n this._bounds.addQuad(this.vertexData);\n }\n else {\n // lets calculate a special trimmed bounds...\n this.calculateTrimmedVertices();\n this._bounds.addQuad(this.vertexTrimmedData);\n }\n };\n /**\n * Gets the local bounds of the sprite object.\n *\n * @param {PIXI.Rectangle} [rect] - The output rectangle.\n * @return {PIXI.Rectangle} The bounds.\n */\n Sprite.prototype.getLocalBounds = function (rect) {\n // we can do a fast local bounds if the sprite has no children!\n if (this.children.length === 0) {\n this._bounds.minX = this._texture.orig.width * -this._anchor._x;\n this._bounds.minY = this._texture.orig.height * -this._anchor._y;\n this._bounds.maxX = this._texture.orig.width * (1 - this._anchor._x);\n this._bounds.maxY = this._texture.orig.height * (1 - this._anchor._y);\n if (!rect) {\n if (!this._localBoundsRect) {\n this._localBoundsRect = new Rectangle();\n }\n rect = this._localBoundsRect;\n }\n return this._bounds.getRectangle(rect);\n }\n return _super.prototype.getLocalBounds.call(this, rect);\n };\n /**\n * Tests if a point is inside this sprite\n *\n * @param {PIXI.IPointData} point - the point to test\n * @return {boolean} the result of the test\n */\n Sprite.prototype.containsPoint = function (point) {\n this.worldTransform.applyInverse(point, tempPoint);\n var width = this._texture.orig.width;\n var height = this._texture.orig.height;\n var x1 = -width * this.anchor.x;\n var y1 = 0;\n if (tempPoint.x >= x1 && tempPoint.x < x1 + width) {\n y1 = -height * this.anchor.y;\n if (tempPoint.y >= y1 && tempPoint.y < y1 + height) {\n return true;\n }\n }\n return false;\n };\n /**\n * Destroys this sprite and optionally its texture and children\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well\n * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well\n */\n Sprite.prototype.destroy = function (options) {\n _super.prototype.destroy.call(this, options);\n this._texture.off('update', this._onTextureUpdate, this);\n this._anchor = null;\n var destroyTexture = typeof options === 'boolean' ? options : options && options.texture;\n if (destroyTexture) {\n var destroyBaseTexture = typeof options === 'boolean' ? options : options && options.baseTexture;\n this._texture.destroy(!!destroyBaseTexture);\n }\n this._texture = null;\n };\n // some helper functions..\n /**\n * Helper function that creates a new sprite based on the source you provide.\n * The source can be - frame id, image url, video url, canvas element, video element, base texture\n *\n * @static\n * @param {string|PIXI.Texture|HTMLCanvasElement|HTMLVideoElement} source - Source to create texture from\n * @param {object} [options] - See {@link PIXI.BaseTexture}'s constructor for options.\n * @return {PIXI.Sprite} The newly created sprite\n */\n Sprite.from = function (source, options) {\n var texture = (source instanceof Texture)\n ? source\n : Texture.from(source, options);\n return new Sprite(texture);\n };\n Object.defineProperty(Sprite.prototype, \"roundPixels\", {\n get: function () {\n return this._roundPixels;\n },\n /**\n * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.\n * Advantages can include sharper image quality (like text) and faster rendering on canvas.\n * The main disadvantage is movement of objects may appear less smooth.\n * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}\n *\n * @member {boolean}\n * @default false\n */\n set: function (value) {\n if (this._roundPixels !== value) {\n this._transformID = -1;\n }\n this._roundPixels = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sprite.prototype, \"width\", {\n /**\n * The width of the sprite, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n get: function () {\n return Math.abs(this.scale.x) * this._texture.orig.width;\n },\n set: function (value) {\n var s = sign(this.scale.x) || 1;\n this.scale.x = s * value / this._texture.orig.width;\n this._width = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sprite.prototype, \"height\", {\n /**\n * The height of the sprite, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n get: function () {\n return Math.abs(this.scale.y) * this._texture.orig.height;\n },\n set: function (value) {\n var s = sign(this.scale.y) || 1;\n this.scale.y = s * value / this._texture.orig.height;\n this._height = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sprite.prototype, \"anchor\", {\n /**\n * The anchor sets the origin point of the sprite. The default value is taken from the {@link PIXI.Texture|Texture}\n * and passed to the constructor.\n *\n * The default is `(0,0)`, this means the sprite's origin is the top left.\n *\n * Setting the anchor to `(0.5,0.5)` means the sprite's origin is centered.\n *\n * Setting the anchor to `(1,1)` would mean the sprite's origin point will be the bottom right corner.\n *\n * If you pass only single parameter, it will set both x and y to the same value as shown in the example below.\n *\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.anchor.set(0.5); // This will set the origin to center. (0.5) is same as (0.5, 0.5).\n *\n * @member {PIXI.ObservablePoint}\n */\n get: function () {\n return this._anchor;\n },\n set: function (value) {\n this._anchor.copyFrom(value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sprite.prototype, \"tint\", {\n /**\n * The tint applied to the sprite. This is a hex value.\n * A value of 0xFFFFFF will remove any tint effect.\n *\n * @member {number}\n * @default 0xFFFFFF\n */\n get: function () {\n return this._tint;\n },\n set: function (value) {\n this._tint = value;\n this._tintRGB = (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sprite.prototype, \"texture\", {\n /**\n * The texture that the sprite is using\n *\n * @member {PIXI.Texture}\n */\n get: function () {\n return this._texture;\n },\n set: function (value) {\n if (this._texture === value) {\n return;\n }\n if (this._texture) {\n this._texture.off('update', this._onTextureUpdate, this);\n }\n this._texture = value || Texture.EMPTY;\n this._cachedTint = 0xFFFFFF;\n this._textureID = -1;\n this._textureTrimmedID = -1;\n if (value) {\n // wait for the texture to load\n if (value.baseTexture.valid) {\n this._onTextureUpdate();\n }\n else {\n value.once('update', this._onTextureUpdate, this);\n }\n }\n },\n enumerable: false,\n configurable: true\n });\n return Sprite;\n}(Container));\n\nexport { Sprite };\n//# sourceMappingURL=sprite.es.js.map\n","/*!\n * @pixi/text - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/text is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Sprite } from '@pixi/sprite';\nimport { Texture } from '@pixi/core';\nimport { settings } from '@pixi/settings';\nimport { Rectangle } from '@pixi/math';\nimport { hex2string, hex2rgb, string2hex, trimCanvas, sign } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * Constants that define the type of gradient on text.\n *\n * @static\n * @constant\n * @name TEXT_GRADIENT\n * @memberof PIXI\n * @type {object}\n * @property {number} LINEAR_VERTICAL Vertical gradient\n * @property {number} LINEAR_HORIZONTAL Linear gradient\n */\nvar TEXT_GRADIENT;\n(function (TEXT_GRADIENT) {\n TEXT_GRADIENT[TEXT_GRADIENT[\"LINEAR_VERTICAL\"] = 0] = \"LINEAR_VERTICAL\";\n TEXT_GRADIENT[TEXT_GRADIENT[\"LINEAR_HORIZONTAL\"] = 1] = \"LINEAR_HORIZONTAL\";\n})(TEXT_GRADIENT || (TEXT_GRADIENT = {}));\n\n// disabling eslint for now, going to rewrite this in v5\nvar defaultStyle = {\n align: 'left',\n breakWords: false,\n dropShadow: false,\n dropShadowAlpha: 1,\n dropShadowAngle: Math.PI / 6,\n dropShadowBlur: 0,\n dropShadowColor: 'black',\n dropShadowDistance: 5,\n fill: 'black',\n fillGradientType: TEXT_GRADIENT.LINEAR_VERTICAL,\n fillGradientStops: [],\n fontFamily: 'Arial',\n fontSize: 26,\n fontStyle: 'normal',\n fontVariant: 'normal',\n fontWeight: 'normal',\n letterSpacing: 0,\n lineHeight: 0,\n lineJoin: 'miter',\n miterLimit: 10,\n padding: 0,\n stroke: 'black',\n strokeThickness: 0,\n textBaseline: 'alphabetic',\n trim: false,\n whiteSpace: 'pre',\n wordWrap: false,\n wordWrapWidth: 100,\n leading: 0,\n};\nvar genericFontFamilies = [\n 'serif',\n 'sans-serif',\n 'monospace',\n 'cursive',\n 'fantasy',\n 'system-ui' ];\n/**\n * A TextStyle Object contains information to decorate a Text objects.\n *\n * An instance can be shared between multiple Text objects; then changing the style will update all text objects using it.\n *\n * A tool can be used to generate a text style [here](https://pixijs.io/pixi-text-style).\n *\n * @class\n * @memberof PIXI\n */\nvar TextStyle = /** @class */ (function () {\n /**\n * @param {object} [style] - The style parameters\n * @param {string} [style.align='left'] - Alignment for multiline text ('left', 'center' or 'right'),\n * does not affect single line text\n * @param {boolean} [style.breakWords=false] - Indicates if lines can be wrapped within words, it\n * needs wordWrap to be set to true\n * @param {boolean} [style.dropShadow=false] - Set a drop shadow for the text\n * @param {number} [style.dropShadowAlpha=1] - Set alpha for the drop shadow\n * @param {number} [style.dropShadowAngle=Math.PI/6] - Set a angle of the drop shadow\n * @param {number} [style.dropShadowBlur=0] - Set a shadow blur radius\n * @param {string|number} [style.dropShadowColor='black'] - A fill style to be used on the dropshadow e.g 'red', '#00FF00'\n * @param {number} [style.dropShadowDistance=5] - Set a distance of the drop shadow\n * @param {string|string[]|number|number[]|CanvasGradient|CanvasPattern} [style.fill='black'] - A canvas\n * fillstyle that will be used on the text e.g 'red', '#00FF00'. Can be an array to create a gradient\n * eg ['#000000','#FFFFFF']\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN}\n * @param {number} [style.fillGradientType=PIXI.TEXT_GRADIENT.LINEAR_VERTICAL] - If fill is an array of colours\n * to create a gradient, this can change the type/direction of the gradient. See {@link PIXI.TEXT_GRADIENT}\n * @param {number[]} [style.fillGradientStops] - If fill is an array of colours to create a gradient, this array can set\n * the stop points (numbers between 0 and 1) for the color, overriding the default behaviour of evenly spacing them.\n * @param {string|string[]} [style.fontFamily='Arial'] - The font family\n * @param {number|string} [style.fontSize=26] - The font size (as a number it converts to px, but as a string,\n * equivalents are '26px','20pt','160%' or '1.6em')\n * @param {string} [style.fontStyle='normal'] - The font style ('normal', 'italic' or 'oblique')\n * @param {string} [style.fontVariant='normal'] - The font variant ('normal' or 'small-caps')\n * @param {string} [style.fontWeight='normal'] - The font weight ('normal', 'bold', 'bolder', 'lighter' and '100',\n * '200', '300', '400', '500', '600', '700', '800' or '900')\n * @param {number} [style.leading=0] - The space between lines\n * @param {number} [style.letterSpacing=0] - The amount of spacing between letters, default is 0\n * @param {number} [style.lineHeight] - The line height, a number that represents the vertical space that a letter uses\n * @param {string} [style.lineJoin='miter'] - The lineJoin property sets the type of corner created, it can resolve\n * spiked text issues. Possible values \"miter\" (creates a sharp corner), \"round\" (creates a round corner) or \"bevel\"\n * (creates a squared corner).\n * @param {number} [style.miterLimit=10] - The miter limit to use when using the 'miter' lineJoin mode. This can reduce\n * or increase the spikiness of rendered text.\n * @param {number} [style.padding=0] - Occasionally some fonts are cropped. Adding some padding will prevent this from\n * happening by adding padding to all sides of the text.\n * @param {string|number} [style.stroke='black'] - A canvas fillstyle that will be used on the text stroke\n * e.g 'blue', '#FCFF00'\n * @param {number} [style.strokeThickness=0] - A number that represents the thickness of the stroke.\n * Default is 0 (no stroke)\n * @param {boolean} [style.trim=false] - Trim transparent borders\n * @param {string} [style.textBaseline='alphabetic'] - The baseline of the text that is rendered.\n * @param {string} [style.whiteSpace='pre'] - Determines whether newlines & spaces are collapsed or preserved \"normal\"\n * (collapse, collapse), \"pre\" (preserve, preserve) | \"pre-line\" (preserve, collapse). It needs wordWrap to be set to true\n * @param {boolean} [style.wordWrap=false] - Indicates if word wrap should be used\n * @param {number} [style.wordWrapWidth=100] - The width at which text will wrap, it needs wordWrap to be set to true\n */\n function TextStyle(style) {\n this.styleID = 0;\n this.reset();\n deepCopyProperties(this, style, style);\n }\n /**\n * Creates a new TextStyle object with the same values as this one.\n * Note that the only the properties of the object are cloned.\n *\n * @return {PIXI.TextStyle} New cloned TextStyle object\n */\n TextStyle.prototype.clone = function () {\n var clonedProperties = {};\n deepCopyProperties(clonedProperties, this, defaultStyle);\n return new TextStyle(clonedProperties);\n };\n /**\n * Resets all properties to the defaults specified in TextStyle.prototype._default\n */\n TextStyle.prototype.reset = function () {\n deepCopyProperties(this, defaultStyle, defaultStyle);\n };\n Object.defineProperty(TextStyle.prototype, \"align\", {\n /**\n * Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text\n *\n * @member {string}\n */\n get: function () {\n return this._align;\n },\n set: function (align) {\n if (this._align !== align) {\n this._align = align;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"breakWords\", {\n /**\n * Indicates if lines can be wrapped within words, it needs wordWrap to be set to true\n *\n * @member {boolean}\n */\n get: function () {\n return this._breakWords;\n },\n set: function (breakWords) {\n if (this._breakWords !== breakWords) {\n this._breakWords = breakWords;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadow\", {\n /**\n * Set a drop shadow for the text\n *\n * @member {boolean}\n */\n get: function () {\n return this._dropShadow;\n },\n set: function (dropShadow) {\n if (this._dropShadow !== dropShadow) {\n this._dropShadow = dropShadow;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadowAlpha\", {\n /**\n * Set alpha for the drop shadow\n *\n * @member {number}\n */\n get: function () {\n return this._dropShadowAlpha;\n },\n set: function (dropShadowAlpha) {\n if (this._dropShadowAlpha !== dropShadowAlpha) {\n this._dropShadowAlpha = dropShadowAlpha;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadowAngle\", {\n /**\n * Set a angle of the drop shadow\n *\n * @member {number}\n */\n get: function () {\n return this._dropShadowAngle;\n },\n set: function (dropShadowAngle) {\n if (this._dropShadowAngle !== dropShadowAngle) {\n this._dropShadowAngle = dropShadowAngle;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadowBlur\", {\n /**\n * Set a shadow blur radius\n *\n * @member {number}\n */\n get: function () {\n return this._dropShadowBlur;\n },\n set: function (dropShadowBlur) {\n if (this._dropShadowBlur !== dropShadowBlur) {\n this._dropShadowBlur = dropShadowBlur;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadowColor\", {\n /**\n * A fill style to be used on the dropshadow e.g 'red', '#00FF00'\n *\n * @member {string|number}\n */\n get: function () {\n return this._dropShadowColor;\n },\n set: function (dropShadowColor) {\n var outputColor = getColor(dropShadowColor);\n if (this._dropShadowColor !== outputColor) {\n this._dropShadowColor = outputColor;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadowDistance\", {\n /**\n * Set a distance of the drop shadow\n *\n * @member {number}\n */\n get: function () {\n return this._dropShadowDistance;\n },\n set: function (dropShadowDistance) {\n if (this._dropShadowDistance !== dropShadowDistance) {\n this._dropShadowDistance = dropShadowDistance;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fill\", {\n /**\n * A canvas fillstyle that will be used on the text e.g 'red', '#00FF00'.\n * Can be an array to create a gradient eg ['#000000','#FFFFFF']\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN}\n *\n * @member {string|string[]|number|number[]|CanvasGradient|CanvasPattern}\n */\n get: function () {\n return this._fill;\n },\n set: function (fill) {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n // TODO: Not sure if getColor works properly with CanvasGradient and/or CanvasPattern, can't pass in\n // without casting here.\n var outputColor = getColor(fill);\n if (this._fill !== outputColor) {\n this._fill = outputColor;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fillGradientType\", {\n /**\n * If fill is an array of colours to create a gradient, this can change the type/direction of the gradient.\n * See {@link PIXI.TEXT_GRADIENT}\n *\n * @member {number}\n */\n get: function () {\n return this._fillGradientType;\n },\n set: function (fillGradientType) {\n if (this._fillGradientType !== fillGradientType) {\n this._fillGradientType = fillGradientType;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fillGradientStops\", {\n /**\n * If fill is an array of colours to create a gradient, this array can set the stop points\n * (numbers between 0 and 1) for the color, overriding the default behaviour of evenly spacing them.\n *\n * @member {number[]}\n */\n get: function () {\n return this._fillGradientStops;\n },\n set: function (fillGradientStops) {\n if (!areArraysEqual(this._fillGradientStops, fillGradientStops)) {\n this._fillGradientStops = fillGradientStops;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fontFamily\", {\n /**\n * The font family\n *\n * @member {string|string[]}\n */\n get: function () {\n return this._fontFamily;\n },\n set: function (fontFamily) {\n if (this.fontFamily !== fontFamily) {\n this._fontFamily = fontFamily;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fontSize\", {\n /**\n * The font size\n * (as a number it converts to px, but as a string, equivalents are '26px','20pt','160%' or '1.6em')\n *\n * @member {number|string}\n */\n get: function () {\n return this._fontSize;\n },\n set: function (fontSize) {\n if (this._fontSize !== fontSize) {\n this._fontSize = fontSize;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fontStyle\", {\n /**\n * The font style\n * ('normal', 'italic' or 'oblique')\n *\n * @member {string}\n */\n get: function () {\n return this._fontStyle;\n },\n set: function (fontStyle) {\n if (this._fontStyle !== fontStyle) {\n this._fontStyle = fontStyle;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fontVariant\", {\n /**\n * The font variant\n * ('normal' or 'small-caps')\n *\n * @member {string}\n */\n get: function () {\n return this._fontVariant;\n },\n set: function (fontVariant) {\n if (this._fontVariant !== fontVariant) {\n this._fontVariant = fontVariant;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fontWeight\", {\n /**\n * The font weight\n * ('normal', 'bold', 'bolder', 'lighter' and '100', '200', '300', '400', '500', '600', '700', 800' or '900')\n *\n * @member {string}\n */\n get: function () {\n return this._fontWeight;\n },\n set: function (fontWeight) {\n if (this._fontWeight !== fontWeight) {\n this._fontWeight = fontWeight;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"letterSpacing\", {\n /**\n * The amount of spacing between letters, default is 0\n *\n * @member {number}\n */\n get: function () {\n return this._letterSpacing;\n },\n set: function (letterSpacing) {\n if (this._letterSpacing !== letterSpacing) {\n this._letterSpacing = letterSpacing;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"lineHeight\", {\n /**\n * The line height, a number that represents the vertical space that a letter uses\n *\n * @member {number}\n */\n get: function () {\n return this._lineHeight;\n },\n set: function (lineHeight) {\n if (this._lineHeight !== lineHeight) {\n this._lineHeight = lineHeight;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"leading\", {\n /**\n * The space between lines\n *\n * @member {number}\n */\n get: function () {\n return this._leading;\n },\n set: function (leading) {\n if (this._leading !== leading) {\n this._leading = leading;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"lineJoin\", {\n /**\n * The lineJoin property sets the type of corner created, it can resolve spiked text issues.\n * Default is 'miter' (creates a sharp corner).\n *\n * @member {string}\n */\n get: function () {\n return this._lineJoin;\n },\n set: function (lineJoin) {\n if (this._lineJoin !== lineJoin) {\n this._lineJoin = lineJoin;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"miterLimit\", {\n /**\n * The miter limit to use when using the 'miter' lineJoin mode\n * This can reduce or increase the spikiness of rendered text.\n *\n * @member {number}\n */\n get: function () {\n return this._miterLimit;\n },\n set: function (miterLimit) {\n if (this._miterLimit !== miterLimit) {\n this._miterLimit = miterLimit;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"padding\", {\n /**\n * Occasionally some fonts are cropped. Adding some padding will prevent this from happening\n * by adding padding to all sides of the text.\n *\n * @member {number}\n */\n get: function () {\n return this._padding;\n },\n set: function (padding) {\n if (this._padding !== padding) {\n this._padding = padding;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"stroke\", {\n /**\n * A canvas fillstyle that will be used on the text stroke\n * e.g 'blue', '#FCFF00'\n *\n * @member {string|number}\n */\n get: function () {\n return this._stroke;\n },\n set: function (stroke) {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n var outputColor = getColor(stroke);\n if (this._stroke !== outputColor) {\n this._stroke = outputColor;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"strokeThickness\", {\n /**\n * A number that represents the thickness of the stroke.\n * Default is 0 (no stroke)\n *\n * @member {number}\n */\n get: function () {\n return this._strokeThickness;\n },\n set: function (strokeThickness) {\n if (this._strokeThickness !== strokeThickness) {\n this._strokeThickness = strokeThickness;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"textBaseline\", {\n /**\n * The baseline of the text that is rendered.\n *\n * @member {string}\n */\n get: function () {\n return this._textBaseline;\n },\n set: function (textBaseline) {\n if (this._textBaseline !== textBaseline) {\n this._textBaseline = textBaseline;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"trim\", {\n /**\n * Trim transparent borders\n *\n * @member {boolean}\n */\n get: function () {\n return this._trim;\n },\n set: function (trim) {\n if (this._trim !== trim) {\n this._trim = trim;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"whiteSpace\", {\n /**\n * How newlines and spaces should be handled.\n * Default is 'pre' (preserve, preserve).\n *\n * value | New lines | Spaces\n * --- | --- | ---\n * 'normal' | Collapse | Collapse\n * 'pre' | Preserve | Preserve\n * 'pre-line' | Preserve | Collapse\n *\n * @member {string}\n */\n get: function () {\n return this._whiteSpace;\n },\n set: function (whiteSpace) {\n if (this._whiteSpace !== whiteSpace) {\n this._whiteSpace = whiteSpace;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"wordWrap\", {\n /**\n * Indicates if word wrap should be used\n *\n * @member {boolean}\n */\n get: function () {\n return this._wordWrap;\n },\n set: function (wordWrap) {\n if (this._wordWrap !== wordWrap) {\n this._wordWrap = wordWrap;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"wordWrapWidth\", {\n /**\n * The width at which text will wrap, it needs wordWrap to be set to true\n *\n * @member {number}\n */\n get: function () {\n return this._wordWrapWidth;\n },\n set: function (wordWrapWidth) {\n if (this._wordWrapWidth !== wordWrapWidth) {\n this._wordWrapWidth = wordWrapWidth;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Generates a font style string to use for `TextMetrics.measureFont()`.\n *\n * @return {string} Font style string, for passing to `TextMetrics.measureFont()`\n */\n TextStyle.prototype.toFontString = function () {\n // build canvas api font setting from individual components. Convert a numeric this.fontSize to px\n var fontSizeString = (typeof this.fontSize === 'number') ? this.fontSize + \"px\" : this.fontSize;\n // Clean-up fontFamily property by quoting each font name\n // this will support font names with spaces\n var fontFamilies = this.fontFamily;\n if (!Array.isArray(this.fontFamily)) {\n fontFamilies = this.fontFamily.split(',');\n }\n for (var i = fontFamilies.length - 1; i >= 0; i--) {\n // Trim any extra white-space\n var fontFamily = fontFamilies[i].trim();\n // Check if font already contains strings\n if (!(/([\\\"\\'])[^\\'\\\"]+\\1/).test(fontFamily) && genericFontFamilies.indexOf(fontFamily) < 0) {\n fontFamily = \"\\\"\" + fontFamily + \"\\\"\";\n }\n fontFamilies[i] = fontFamily;\n }\n return this.fontStyle + \" \" + this.fontVariant + \" \" + this.fontWeight + \" \" + fontSizeString + \" \" + fontFamilies.join(',');\n };\n return TextStyle;\n}());\n/**\n * Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.\n * @private\n * @param {string|number} color\n * @return {string} The color as a string.\n */\nfunction getSingleColor(color) {\n if (typeof color === 'number') {\n return hex2string(color);\n }\n else if (typeof color === 'string') {\n if (color.indexOf('0x') === 0) {\n color = color.replace('0x', '#');\n }\n }\n return color;\n}\nfunction getColor(color) {\n if (!Array.isArray(color)) {\n return getSingleColor(color);\n }\n else {\n for (var i = 0; i < color.length; ++i) {\n color[i] = getSingleColor(color[i]);\n }\n return color;\n }\n}\n/**\n * Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.\n * This version can also convert array of colors\n * @private\n * @param {Array} array1 - First array to compare\n * @param {Array} array2 - Second array to compare\n * @return {boolean} Do the arrays contain the same values in the same order\n */\nfunction areArraysEqual(array1, array2) {\n if (!Array.isArray(array1) || !Array.isArray(array2)) {\n return false;\n }\n if (array1.length !== array2.length) {\n return false;\n }\n for (var i = 0; i < array1.length; ++i) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n return true;\n}\n/**\n * Utility function to ensure that object properties are copied by value, and not by reference\n * @private\n * @param {Object} target - Target object to copy properties into\n * @param {Object} source - Source object for the properties to copy\n * @param {string} propertyObj - Object containing properties names we want to loop over\n */\nfunction deepCopyProperties(target, source, propertyObj) {\n for (var prop in propertyObj) {\n if (Array.isArray(source[prop])) {\n target[prop] = source[prop].slice();\n }\n else {\n target[prop] = source[prop];\n }\n }\n}\n\n/**\n * The TextMetrics object represents the measurement of a block of text with a specified style.\n *\n * ```js\n * let style = new PIXI.TextStyle({fontFamily : 'Arial', fontSize: 24, fill : 0xff1010, align : 'center'})\n * let textMetrics = PIXI.TextMetrics.measureText('Your text', style)\n * ```\n *\n * @class\n * @memberof PIXI\n */\nvar TextMetrics = /** @class */ (function () {\n /**\n * @param {string} text - the text that was measured\n * @param {PIXI.TextStyle} style - the style that was measured\n * @param {number} width - the measured width of the text\n * @param {number} height - the measured height of the text\n * @param {string[]} lines - an array of the lines of text broken by new lines and wrapping if specified in style\n * @param {number[]} lineWidths - an array of the line widths for each line matched to `lines`\n * @param {number} lineHeight - the measured line height for this style\n * @param {number} maxLineWidth - the maximum line width for all measured lines\n * @param {Object} fontProperties - the font properties object from TextMetrics.measureFont\n */\n function TextMetrics(text, style, width, height, lines, lineWidths, lineHeight, maxLineWidth, fontProperties) {\n /**\n * The text that was measured\n *\n * @member {string}\n */\n this.text = text;\n /**\n * The style that was measured\n *\n * @member {PIXI.TextStyle}\n */\n this.style = style;\n /**\n * The measured width of the text\n *\n * @member {number}\n */\n this.width = width;\n /**\n * The measured height of the text\n *\n * @member {number}\n */\n this.height = height;\n /**\n * An array of lines of the text broken by new lines and wrapping is specified in style\n *\n * @member {string[]}\n */\n this.lines = lines;\n /**\n * An array of the line widths for each line matched to `lines`\n *\n * @member {number[]}\n */\n this.lineWidths = lineWidths;\n /**\n * The measured line height for this style\n *\n * @member {number}\n */\n this.lineHeight = lineHeight;\n /**\n * The maximum line width for all measured lines\n *\n * @member {number}\n */\n this.maxLineWidth = maxLineWidth;\n /**\n * The font properties object from TextMetrics.measureFont\n *\n * @member {PIXI.IFontMetrics}\n */\n this.fontProperties = fontProperties;\n }\n /**\n * Measures the supplied string of text and returns a Rectangle.\n *\n * @param {string} text - the text to measure.\n * @param {PIXI.TextStyle} style - the text style to use for measuring\n * @param {boolean} [wordWrap] - optional override for if word-wrap should be applied to the text.\n * @param {HTMLCanvasElement} [canvas] - optional specification of the canvas to use for measuring.\n * @return {PIXI.TextMetrics} measured width and height of the text.\n */\n TextMetrics.measureText = function (text, style, wordWrap, canvas) {\n if (canvas === void 0) { canvas = TextMetrics._canvas; }\n wordWrap = (wordWrap === undefined || wordWrap === null) ? style.wordWrap : wordWrap;\n var font = style.toFontString();\n var fontProperties = TextMetrics.measureFont(font);\n // fallback in case UA disallow canvas data extraction\n // (toDataURI, getImageData functions)\n if (fontProperties.fontSize === 0) {\n fontProperties.fontSize = style.fontSize;\n fontProperties.ascent = style.fontSize;\n }\n var context = canvas.getContext('2d');\n context.font = font;\n var outputText = wordWrap ? TextMetrics.wordWrap(text, style, canvas) : text;\n var lines = outputText.split(/(?:\\r\\n|\\r|\\n)/);\n var lineWidths = new Array(lines.length);\n var maxLineWidth = 0;\n for (var i = 0; i < lines.length; i++) {\n var lineWidth = context.measureText(lines[i]).width + ((lines[i].length - 1) * style.letterSpacing);\n lineWidths[i] = lineWidth;\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n var width = maxLineWidth + style.strokeThickness;\n if (style.dropShadow) {\n width += style.dropShadowDistance;\n }\n var lineHeight = style.lineHeight || fontProperties.fontSize + style.strokeThickness;\n var height = Math.max(lineHeight, fontProperties.fontSize + style.strokeThickness)\n + ((lines.length - 1) * (lineHeight + style.leading));\n if (style.dropShadow) {\n height += style.dropShadowDistance;\n }\n return new TextMetrics(text, style, width, height, lines, lineWidths, lineHeight + style.leading, maxLineWidth, fontProperties);\n };\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n *\n * @private\n * @param {string} text - String to apply word wrapping to\n * @param {PIXI.TextStyle} style - the style to use when wrapping\n * @param {HTMLCanvasElement} [canvas] - optional specification of the canvas to use for measuring.\n * @return {string} New string with new lines applied where required\n */\n TextMetrics.wordWrap = function (text, style, canvas) {\n if (canvas === void 0) { canvas = TextMetrics._canvas; }\n var context = canvas.getContext('2d');\n var width = 0;\n var line = '';\n var lines = '';\n var cache = Object.create(null);\n var letterSpacing = style.letterSpacing, whiteSpace = style.whiteSpace;\n // How to handle whitespaces\n var collapseSpaces = TextMetrics.collapseSpaces(whiteSpace);\n var collapseNewlines = TextMetrics.collapseNewlines(whiteSpace);\n // whether or not spaces may be added to the beginning of lines\n var canPrependSpaces = !collapseSpaces;\n // There is letterSpacing after every char except the last one\n // t_h_i_s_' '_i_s_' '_a_n_' '_e_x_a_m_p_l_e_' '_!\n // so for convenience the above needs to be compared to width + 1 extra letterSpace\n // t_h_i_s_' '_i_s_' '_a_n_' '_e_x_a_m_p_l_e_' '_!_\n // ________________________________________________\n // And then the final space is simply no appended to each line\n var wordWrapWidth = style.wordWrapWidth + letterSpacing;\n // break text into words, spaces and newline chars\n var tokens = TextMetrics.tokenize(text);\n for (var i = 0; i < tokens.length; i++) {\n // get the word, space or newlineChar\n var token = tokens[i];\n // if word is a new line\n if (TextMetrics.isNewline(token)) {\n // keep the new line\n if (!collapseNewlines) {\n lines += TextMetrics.addLine(line);\n canPrependSpaces = !collapseSpaces;\n line = '';\n width = 0;\n continue;\n }\n // if we should collapse new lines\n // we simply convert it into a space\n token = ' ';\n }\n // if we should collapse repeated whitespaces\n if (collapseSpaces) {\n // check both this and the last tokens for spaces\n var currIsBreakingSpace = TextMetrics.isBreakingSpace(token);\n var lastIsBreakingSpace = TextMetrics.isBreakingSpace(line[line.length - 1]);\n if (currIsBreakingSpace && lastIsBreakingSpace) {\n continue;\n }\n }\n // get word width from cache if possible\n var tokenWidth = TextMetrics.getFromCache(token, letterSpacing, cache, context);\n // word is longer than desired bounds\n if (tokenWidth > wordWrapWidth) {\n // if we are not already at the beginning of a line\n if (line !== '') {\n // start newlines for overflow words\n lines += TextMetrics.addLine(line);\n line = '';\n width = 0;\n }\n // break large word over multiple lines\n if (TextMetrics.canBreakWords(token, style.breakWords)) {\n // break word into characters\n var characters = TextMetrics.wordWrapSplit(token);\n // loop the characters\n for (var j = 0; j < characters.length; j++) {\n var char = characters[j];\n var k = 1;\n // we are not at the end of the token\n while (characters[j + k]) {\n var nextChar = characters[j + k];\n var lastChar = char[char.length - 1];\n // should not split chars\n if (!TextMetrics.canBreakChars(lastChar, nextChar, token, j, style.breakWords)) {\n // combine chars & move forward one\n char += nextChar;\n }\n else {\n break;\n }\n k++;\n }\n j += char.length - 1;\n var characterWidth = TextMetrics.getFromCache(char, letterSpacing, cache, context);\n if (characterWidth + width > wordWrapWidth) {\n lines += TextMetrics.addLine(line);\n canPrependSpaces = false;\n line = '';\n width = 0;\n }\n line += char;\n width += characterWidth;\n }\n }\n // run word out of the bounds\n else {\n // if there are words in this line already\n // finish that line and start a new one\n if (line.length > 0) {\n lines += TextMetrics.addLine(line);\n line = '';\n width = 0;\n }\n var isLastToken = i === tokens.length - 1;\n // give it its own line if it's not the end\n lines += TextMetrics.addLine(token, !isLastToken);\n canPrependSpaces = false;\n line = '';\n width = 0;\n }\n }\n // word could fit\n else {\n // word won't fit because of existing words\n // start a new line\n if (tokenWidth + width > wordWrapWidth) {\n // if its a space we don't want it\n canPrependSpaces = false;\n // add a new line\n lines += TextMetrics.addLine(line);\n // start a new line\n line = '';\n width = 0;\n }\n // don't add spaces to the beginning of lines\n if (line.length > 0 || !TextMetrics.isBreakingSpace(token) || canPrependSpaces) {\n // add the word to the current line\n line += token;\n // update width counter\n width += tokenWidth;\n }\n }\n }\n lines += TextMetrics.addLine(line, false);\n return lines;\n };\n /**\n * Convienience function for logging each line added during the wordWrap\n * method\n *\n * @private\n * @param {string} line - The line of text to add\n * @param {boolean} newLine - Add new line character to end\n * @return {string} A formatted line\n */\n TextMetrics.addLine = function (line, newLine) {\n if (newLine === void 0) { newLine = true; }\n line = TextMetrics.trimRight(line);\n line = (newLine) ? line + \"\\n\" : line;\n return line;\n };\n /**\n * Gets & sets the widths of calculated characters in a cache object\n *\n * @private\n * @param {string} key - The key\n * @param {number} letterSpacing - The letter spacing\n * @param {object} cache - The cache\n * @param {CanvasRenderingContext2D} context - The canvas context\n * @return {number} The from cache.\n */\n TextMetrics.getFromCache = function (key, letterSpacing, cache, context) {\n var width = cache[key];\n if (typeof width !== 'number') {\n var spacing = ((key.length) * letterSpacing);\n width = context.measureText(key).width + spacing;\n cache[key] = width;\n }\n return width;\n };\n /**\n * Determines whether we should collapse breaking spaces\n *\n * @private\n * @param {string} whiteSpace - The TextStyle property whiteSpace\n * @return {boolean} should collapse\n */\n TextMetrics.collapseSpaces = function (whiteSpace) {\n return (whiteSpace === 'normal' || whiteSpace === 'pre-line');\n };\n /**\n * Determines whether we should collapse newLine chars\n *\n * @private\n * @param {string} whiteSpace - The white space\n * @return {boolean} should collapse\n */\n TextMetrics.collapseNewlines = function (whiteSpace) {\n return (whiteSpace === 'normal');\n };\n /**\n * trims breaking whitespaces from string\n *\n * @private\n * @param {string} text - The text\n * @return {string} trimmed string\n */\n TextMetrics.trimRight = function (text) {\n if (typeof text !== 'string') {\n return '';\n }\n for (var i = text.length - 1; i >= 0; i--) {\n var char = text[i];\n if (!TextMetrics.isBreakingSpace(char)) {\n break;\n }\n text = text.slice(0, -1);\n }\n return text;\n };\n /**\n * Determines if char is a newline.\n *\n * @private\n * @param {string} char - The character\n * @return {boolean} True if newline, False otherwise.\n */\n TextMetrics.isNewline = function (char) {\n if (typeof char !== 'string') {\n return false;\n }\n return (TextMetrics._newlines.indexOf(char.charCodeAt(0)) >= 0);\n };\n /**\n * Determines if char is a breaking whitespace.\n *\n * @private\n * @param {string} char - The character\n * @return {boolean} True if whitespace, False otherwise.\n */\n TextMetrics.isBreakingSpace = function (char) {\n if (typeof char !== 'string') {\n return false;\n }\n return (TextMetrics._breakingSpaces.indexOf(char.charCodeAt(0)) >= 0);\n };\n /**\n * Splits a string into words, breaking-spaces and newLine characters\n *\n * @private\n * @param {string} text - The text\n * @return {string[]} A tokenized array\n */\n TextMetrics.tokenize = function (text) {\n var tokens = [];\n var token = '';\n if (typeof text !== 'string') {\n return tokens;\n }\n for (var i = 0; i < text.length; i++) {\n var char = text[i];\n if (TextMetrics.isBreakingSpace(char) || TextMetrics.isNewline(char)) {\n if (token !== '') {\n tokens.push(token);\n token = '';\n }\n tokens.push(char);\n continue;\n }\n token += char;\n }\n if (token !== '') {\n tokens.push(token);\n }\n return tokens;\n };\n /**\n * Overridable helper method used internally by TextMetrics, exposed to allow customizing the class's behavior.\n *\n * It allows one to customise which words should break\n * Examples are if the token is CJK or numbers.\n * It must return a boolean.\n *\n * @param {string} token - The token\n * @param {boolean} breakWords - The style attr break words\n * @return {boolean} whether to break word or not\n */\n TextMetrics.canBreakWords = function (_token, breakWords) {\n return breakWords;\n };\n /**\n * Overridable helper method used internally by TextMetrics, exposed to allow customizing the class's behavior.\n *\n * It allows one to determine whether a pair of characters\n * should be broken by newlines\n * For example certain characters in CJK langs or numbers.\n * It must return a boolean.\n *\n * @param {string} char - The character\n * @param {string} nextChar - The next character\n * @param {string} token - The token/word the characters are from\n * @param {number} index - The index in the token of the char\n * @param {boolean} breakWords - The style attr break words\n * @return {boolean} whether to break word or not\n */\n TextMetrics.canBreakChars = function (_char, _nextChar, _token, _index, _breakWords) {\n return true;\n };\n /**\n * Overridable helper method used internally by TextMetrics, exposed to allow customizing the class's behavior.\n *\n * It is called when a token (usually a word) has to be split into separate pieces\n * in order to determine the point to break a word.\n * It must return an array of characters.\n *\n * @example\n * // Correctly splits emojis, eg \"🤪🤪\" will result in two element array, each with one emoji.\n * TextMetrics.wordWrapSplit = (token) => [...token];\n *\n * @param {string} token - The token to split\n * @return {string[]} The characters of the token\n */\n TextMetrics.wordWrapSplit = function (token) {\n return token.split('');\n };\n /**\n * Calculates the ascent, descent and fontSize of a given font-style\n *\n * @static\n * @param {string} font - String representing the style of the font\n * @return {PIXI.IFontMetrics} Font properties object\n */\n TextMetrics.measureFont = function (font) {\n // as this method is used for preparing assets, don't recalculate things if we don't need to\n if (TextMetrics._fonts[font]) {\n return TextMetrics._fonts[font];\n }\n var properties = {\n ascent: 0,\n descent: 0,\n fontSize: 0,\n };\n var canvas = TextMetrics._canvas;\n var context = TextMetrics._context;\n context.font = font;\n var metricsString = TextMetrics.METRICS_STRING + TextMetrics.BASELINE_SYMBOL;\n var width = Math.ceil(context.measureText(metricsString).width);\n var baseline = Math.ceil(context.measureText(TextMetrics.BASELINE_SYMBOL).width);\n var height = 2 * baseline;\n baseline = baseline * TextMetrics.BASELINE_MULTIPLIER | 0;\n canvas.width = width;\n canvas.height = height;\n context.fillStyle = '#f00';\n context.fillRect(0, 0, width, height);\n context.font = font;\n context.textBaseline = 'alphabetic';\n context.fillStyle = '#000';\n context.fillText(metricsString, 0, baseline);\n var imagedata = context.getImageData(0, 0, width, height).data;\n var pixels = imagedata.length;\n var line = width * 4;\n var i = 0;\n var idx = 0;\n var stop = false;\n // ascent. scan from top to bottom until we find a non red pixel\n for (i = 0; i < baseline; ++i) {\n for (var j = 0; j < line; j += 4) {\n if (imagedata[idx + j] !== 255) {\n stop = true;\n break;\n }\n }\n if (!stop) {\n idx += line;\n }\n else {\n break;\n }\n }\n properties.ascent = baseline - i;\n idx = pixels - line;\n stop = false;\n // descent. scan from bottom to top until we find a non red pixel\n for (i = height; i > baseline; --i) {\n for (var j = 0; j < line; j += 4) {\n if (imagedata[idx + j] !== 255) {\n stop = true;\n break;\n }\n }\n if (!stop) {\n idx -= line;\n }\n else {\n break;\n }\n }\n properties.descent = i - baseline;\n properties.fontSize = properties.ascent + properties.descent;\n TextMetrics._fonts[font] = properties;\n return properties;\n };\n /**\n * Clear font metrics in metrics cache.\n *\n * @static\n * @param {string} [font] - font name. If font name not set then clear cache for all fonts.\n */\n TextMetrics.clearMetrics = function (font) {\n if (font === void 0) { font = ''; }\n if (font) {\n delete TextMetrics._fonts[font];\n }\n else {\n TextMetrics._fonts = {};\n }\n };\n return TextMetrics;\n}());\n/**\n * Internal return object for {@link PIXI.TextMetrics.measureFont `TextMetrics.measureFont`}.\n *\n * @typedef {object} FontMetrics\n * @property {number} ascent - The ascent distance\n * @property {number} descent - The descent distance\n * @property {number} fontSize - Font size from ascent to descent\n * @memberof PIXI.TextMetrics\n * @private\n */\nvar canvas = (function () {\n try {\n // OffscreenCanvas2D measureText can be up to 40% faster.\n var c = new OffscreenCanvas(0, 0);\n var context = c.getContext('2d');\n if (context && context.measureText) {\n return c;\n }\n return document.createElement('canvas');\n }\n catch (ex) {\n return document.createElement('canvas');\n }\n})();\ncanvas.width = canvas.height = 10;\n/**\n * Cached canvas element for measuring text\n *\n * @memberof PIXI.TextMetrics\n * @type {HTMLCanvasElement}\n * @private\n */\nTextMetrics._canvas = canvas;\n/**\n * Cache for context to use.\n *\n * @memberof PIXI.TextMetrics\n * @type {CanvasRenderingContext2D}\n * @private\n */\nTextMetrics._context = canvas.getContext('2d');\n/**\n * Cache of {@see PIXI.TextMetrics.FontMetrics} objects.\n *\n * @memberof PIXI.TextMetrics\n * @type {Object}\n * @private\n */\nTextMetrics._fonts = {};\n/**\n * String used for calculate font metrics.\n * These characters are all tall to help calculate the height required for text.\n *\n * @static\n * @memberof PIXI.TextMetrics\n * @name METRICS_STRING\n * @type {string}\n * @default |ÉqÅ\n */\nTextMetrics.METRICS_STRING = '|ÉqÅ';\n/**\n * Baseline symbol for calculate font metrics.\n *\n * @static\n * @memberof PIXI.TextMetrics\n * @name BASELINE_SYMBOL\n * @type {string}\n * @default M\n */\nTextMetrics.BASELINE_SYMBOL = 'M';\n/**\n * Baseline multiplier for calculate font metrics.\n *\n * @static\n * @memberof PIXI.TextMetrics\n * @name BASELINE_MULTIPLIER\n * @type {number}\n * @default 1.4\n */\nTextMetrics.BASELINE_MULTIPLIER = 1.4;\n/**\n * Cache of new line chars.\n *\n * @memberof PIXI.TextMetrics\n * @type {number[]}\n * @private\n */\nTextMetrics._newlines = [\n 0x000A,\n 0x000D ];\n/**\n * Cache of breaking spaces.\n *\n * @memberof PIXI.TextMetrics\n * @type {number[]}\n * @private\n */\nTextMetrics._breakingSpaces = [\n 0x0009,\n 0x0020,\n 0x2000,\n 0x2001,\n 0x2002,\n 0x2003,\n 0x2004,\n 0x2005,\n 0x2006,\n 0x2008,\n 0x2009,\n 0x200A,\n 0x205F,\n 0x3000 ];\n/**\n * A number, or a string containing a number.\n *\n * @memberof PIXI\n * @typedef IFontMetrics\n * @property {number} ascent - Font ascent\n * @property {number} descent - Font descent\n * @property {number} fontSize - Font size\n */\n\nvar defaultDestroyOptions = {\n texture: true,\n children: false,\n baseTexture: true,\n};\n/**\n * A Text Object will create a line or multiple lines of text.\n *\n * The text is created using the [Canvas API](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API).\n *\n * The primary advantage of this class over BitmapText is that you have great control over the style of the next,\n * which you can change at runtime.\n *\n * The primary disadvantages is that each piece of text has it's own texture, which can use more memory.\n * When text changes, this texture has to be re-generated and re-uploaded to the GPU, taking up time.\n *\n * To split a line you can use '\\n' in your text string, or, on the `style` object,\n * change its `wordWrap` property to true and and give the `wordWrapWidth` property a value.\n *\n * A Text can be created directly from a string and a style object,\n * which can be generated [here](https://pixijs.io/pixi-text-style).\n *\n * ```js\n * let text = new PIXI.Text('This is a PixiJS text',{fontFamily : 'Arial', fontSize: 24, fill : 0xff1010, align : 'center'});\n * ```\n *\n * @class\n * @extends PIXI.Sprite\n * @memberof PIXI\n */\nvar Text = /** @class */ (function (_super) {\n __extends(Text, _super);\n /**\n * @param {string} text - The string that you would like the text to display\n * @param {object|PIXI.TextStyle} [style] - The style parameters\n * @param {HTMLCanvasElement} [canvas] - The canvas element for drawing text\n */\n function Text(text, style, canvas) {\n var _this = this;\n var ownCanvas = false;\n if (!canvas) {\n canvas = document.createElement('canvas');\n ownCanvas = true;\n }\n canvas.width = 3;\n canvas.height = 3;\n var texture = Texture.from(canvas);\n texture.orig = new Rectangle();\n texture.trim = new Rectangle();\n _this = _super.call(this, texture) || this;\n /**\n * Keep track if this Text object created it's own canvas\n * element (`true`) or uses the constructor argument (`false`).\n * Used to workaround a GC issues with Safari < 13 when\n * destroying Text. See `destroy` for more info.\n *\n * @member {boolean}\n * @private\n */\n _this._ownCanvas = ownCanvas;\n /**\n * The canvas element that everything is drawn to\n *\n * @member {HTMLCanvasElement}\n */\n _this.canvas = canvas;\n /**\n * The canvas 2d context that everything is drawn with\n * @member {CanvasRenderingContext2D}\n */\n _this.context = _this.canvas.getContext('2d');\n /**\n * The resolution / device pixel ratio of the canvas.\n * This is set to automatically match the renderer resolution by default, but can be overridden by setting manually.\n * @member {number}\n * @default 1\n */\n _this._resolution = settings.RESOLUTION;\n _this._autoResolution = true;\n /**\n * Private tracker for the current text.\n *\n * @member {string}\n * @private\n */\n _this._text = null;\n /**\n * Private tracker for the current style.\n *\n * @member {object}\n * @private\n */\n _this._style = null;\n /**\n * Private listener to track style changes.\n *\n * @member {Function}\n * @private\n */\n _this._styleListener = null;\n /**\n * Private tracker for the current font.\n *\n * @member {string}\n * @private\n */\n _this._font = '';\n _this.text = text;\n _this.style = style;\n _this.localStyleID = -1;\n return _this;\n }\n /**\n * Renders text to its canvas, and updates its texture.\n * By default this is used internally to ensure the texture is correct before rendering,\n * but it can be used called externally, for example from this class to 'pre-generate' the texture from a piece of text,\n * and then shared across multiple Sprites.\n *\n * @param {boolean} respectDirty - Whether to abort updating the text if the Text isn't dirty and the function is called.\n */\n Text.prototype.updateText = function (respectDirty) {\n var style = this._style;\n // check if style has changed..\n if (this.localStyleID !== style.styleID) {\n this.dirty = true;\n this.localStyleID = style.styleID;\n }\n if (!this.dirty && respectDirty) {\n return;\n }\n this._font = this._style.toFontString();\n var context = this.context;\n var measured = TextMetrics.measureText(this._text || ' ', this._style, this._style.wordWrap, this.canvas);\n var width = measured.width;\n var height = measured.height;\n var lines = measured.lines;\n var lineHeight = measured.lineHeight;\n var lineWidths = measured.lineWidths;\n var maxLineWidth = measured.maxLineWidth;\n var fontProperties = measured.fontProperties;\n this.canvas.width = Math.ceil((Math.max(1, width) + (style.padding * 2)) * this._resolution);\n this.canvas.height = Math.ceil((Math.max(1, height) + (style.padding * 2)) * this._resolution);\n context.scale(this._resolution, this._resolution);\n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n context.font = this._font;\n context.lineWidth = style.strokeThickness;\n context.textBaseline = style.textBaseline;\n context.lineJoin = style.lineJoin;\n context.miterLimit = style.miterLimit;\n var linePositionX;\n var linePositionY;\n // require 2 passes if a shadow; the first to draw the drop shadow, the second to draw the text\n var passesCount = style.dropShadow ? 2 : 1;\n // For v4, we drew text at the colours of the drop shadow underneath the normal text. This gave the correct zIndex,\n // but features such as alpha and shadowblur did not look right at all, since we were using actual text as a shadow.\n //\n // For v5.0.0, we moved over to just use the canvas API for drop shadows, which made them look much nicer and more\n // visually please, but now because the stroke is drawn and then the fill, drop shadows would appear on both the fill\n // and the stroke; and fill drop shadows would appear over the top of the stroke.\n //\n // For v5.1.1, the new route is to revert to v4 style of drawing text first to get the drop shadows underneath normal\n // text, but instead drawing text in the correct location, we'll draw it off screen (-paddingY), and then adjust the\n // drop shadow so only that appears on screen (+paddingY). Now we'll have the correct draw order of the shadow\n // beneath the text, whilst also having the proper text shadow styling.\n for (var i = 0; i < passesCount; ++i) {\n var isShadowPass = style.dropShadow && i === 0;\n // we only want the drop shadow, so put text way off-screen\n var dsOffsetText = isShadowPass ? Math.ceil(Math.max(1, height) + (style.padding * 2)) : 0;\n var dsOffsetShadow = dsOffsetText * this._resolution;\n if (isShadowPass) {\n // On Safari, text with gradient and drop shadows together do not position correctly\n // if the scale of the canvas is not 1: https://bugs.webkit.org/show_bug.cgi?id=197689\n // Therefore we'll set the styles to be a plain black whilst generating this drop shadow\n context.fillStyle = 'black';\n context.strokeStyle = 'black';\n var dropShadowColor = style.dropShadowColor;\n var rgb = hex2rgb(typeof dropShadowColor === 'number' ? dropShadowColor : string2hex(dropShadowColor));\n context.shadowColor = \"rgba(\" + rgb[0] * 255 + \",\" + rgb[1] * 255 + \",\" + rgb[2] * 255 + \",\" + style.dropShadowAlpha + \")\";\n context.shadowBlur = style.dropShadowBlur;\n context.shadowOffsetX = Math.cos(style.dropShadowAngle) * style.dropShadowDistance;\n context.shadowOffsetY = (Math.sin(style.dropShadowAngle) * style.dropShadowDistance) + dsOffsetShadow;\n }\n else {\n // set canvas text styles\n context.fillStyle = this._generateFillStyle(style, lines, measured);\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n context.strokeStyle = style.stroke;\n context.shadowColor = 'black';\n context.shadowBlur = 0;\n context.shadowOffsetX = 0;\n context.shadowOffsetY = 0;\n }\n // draw lines line by line\n for (var i_1 = 0; i_1 < lines.length; i_1++) {\n linePositionX = style.strokeThickness / 2;\n linePositionY = ((style.strokeThickness / 2) + (i_1 * lineHeight)) + fontProperties.ascent;\n if (style.align === 'right') {\n linePositionX += maxLineWidth - lineWidths[i_1];\n }\n else if (style.align === 'center') {\n linePositionX += (maxLineWidth - lineWidths[i_1]) / 2;\n }\n if (style.stroke && style.strokeThickness) {\n this.drawLetterSpacing(lines[i_1], linePositionX + style.padding, linePositionY + style.padding - dsOffsetText, true);\n }\n if (style.fill) {\n this.drawLetterSpacing(lines[i_1], linePositionX + style.padding, linePositionY + style.padding - dsOffsetText);\n }\n }\n }\n this.updateTexture();\n };\n /**\n * Render the text with letter-spacing.\n * @param {string} text - The text to draw\n * @param {number} x - Horizontal position to draw the text\n * @param {number} y - Vertical position to draw the text\n * @param {boolean} [isStroke=false] - Is this drawing for the outside stroke of the\n * text? If not, it's for the inside fill\n * @private\n */\n Text.prototype.drawLetterSpacing = function (text, x, y, isStroke) {\n if (isStroke === void 0) { isStroke = false; }\n var style = this._style;\n // letterSpacing of 0 means normal\n var letterSpacing = style.letterSpacing;\n if (letterSpacing === 0) {\n if (isStroke) {\n this.context.strokeText(text, x, y);\n }\n else {\n this.context.fillText(text, x, y);\n }\n return;\n }\n var currentPosition = x;\n // Using Array.from correctly splits characters whilst keeping emoji together.\n // This is not supported on IE as it requires ES6, so regular text splitting occurs.\n // This also doesn't account for emoji that are multiple emoji put together to make something else.\n // Handling all of this would require a big library itself.\n // https://medium.com/@giltayar/iterating-over-emoji-characters-the-es6-way-f06e4589516\n // https://github.com/orling/grapheme-splitter\n var stringArray = Array.from ? Array.from(text) : text.split('');\n var previousWidth = this.context.measureText(text).width;\n var currentWidth = 0;\n for (var i = 0; i < stringArray.length; ++i) {\n var currentChar = stringArray[i];\n if (isStroke) {\n this.context.strokeText(currentChar, currentPosition, y);\n }\n else {\n this.context.fillText(currentChar, currentPosition, y);\n }\n currentWidth = this.context.measureText(text.substring(i + 1)).width;\n currentPosition += previousWidth - currentWidth + letterSpacing;\n previousWidth = currentWidth;\n }\n };\n /**\n * Updates texture size based on canvas size\n *\n * @private\n */\n Text.prototype.updateTexture = function () {\n var canvas = this.canvas;\n if (this._style.trim) {\n var trimmed = trimCanvas(canvas);\n if (trimmed.data) {\n canvas.width = trimmed.width;\n canvas.height = trimmed.height;\n this.context.putImageData(trimmed.data, 0, 0);\n }\n }\n var texture = this._texture;\n var style = this._style;\n var padding = style.trim ? 0 : style.padding;\n var baseTexture = texture.baseTexture;\n texture.trim.width = texture._frame.width = Math.ceil(canvas.width / this._resolution);\n texture.trim.height = texture._frame.height = Math.ceil(canvas.height / this._resolution);\n texture.trim.x = -padding;\n texture.trim.y = -padding;\n texture.orig.width = texture._frame.width - (padding * 2);\n texture.orig.height = texture._frame.height - (padding * 2);\n // call sprite onTextureUpdate to update scale if _width or _height were set\n this._onTextureUpdate();\n baseTexture.setRealSize(canvas.width, canvas.height, this._resolution);\n // Recursively updates transform of all objects from the root to this one\n this._recursivePostUpdateTransform();\n this.dirty = false;\n };\n /**\n * Renders the object using the WebGL renderer\n *\n * @protected\n * @param {PIXI.Renderer} renderer - The renderer\n */\n Text.prototype._render = function (renderer) {\n if (this._autoResolution && this._resolution !== renderer.resolution) {\n this._resolution = renderer.resolution;\n this.dirty = true;\n }\n this.updateText(true);\n _super.prototype._render.call(this, renderer);\n };\n /**\n * Gets the local bounds of the text object.\n *\n * @param {PIXI.Rectangle} rect - The output rectangle.\n * @return {PIXI.Rectangle} The bounds.\n */\n Text.prototype.getLocalBounds = function (rect) {\n this.updateText(true);\n return _super.prototype.getLocalBounds.call(this, rect);\n };\n /**\n * calculates the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account.\n * @protected\n */\n Text.prototype._calculateBounds = function () {\n this.updateText(true);\n this.calculateVertices();\n // if we have already done this on THIS frame.\n this._bounds.addQuad(this.vertexData);\n };\n /**\n * Generates the fill style. Can automatically generate a gradient based on the fill style being an array\n *\n * @private\n * @param {object} style - The style.\n * @param {string[]} lines - The lines of text.\n * @return {string|number|CanvasGradient} The fill style\n */\n Text.prototype._generateFillStyle = function (style, lines, metrics) {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n var fillStyle = style.fill;\n if (!Array.isArray(fillStyle)) {\n return fillStyle;\n }\n else if (fillStyle.length === 1) {\n return fillStyle[0];\n }\n // the gradient will be evenly spaced out according to how large the array is.\n // ['#FF0000', '#00FF00', '#0000FF'] would created stops at 0.25, 0.5 and 0.75\n var gradient;\n // a dropshadow will enlarge the canvas and result in the gradient being\n // generated with the incorrect dimensions\n var dropShadowCorrection = (style.dropShadow) ? style.dropShadowDistance : 0;\n // should also take padding into account, padding can offset the gradient\n var padding = style.padding || 0;\n var width = Math.ceil(this.canvas.width / this._resolution) - dropShadowCorrection - (padding * 2);\n var height = Math.ceil(this.canvas.height / this._resolution) - dropShadowCorrection - (padding * 2);\n // make a copy of the style settings, so we can manipulate them later\n var fill = fillStyle.slice();\n var fillGradientStops = style.fillGradientStops.slice();\n // wanting to evenly distribute the fills. So an array of 4 colours should give fills of 0.25, 0.5 and 0.75\n if (!fillGradientStops.length) {\n var lengthPlus1 = fill.length + 1;\n for (var i = 1; i < lengthPlus1; ++i) {\n fillGradientStops.push(i / lengthPlus1);\n }\n }\n // stop the bleeding of the last gradient on the line above to the top gradient of the this line\n // by hard defining the first gradient colour at point 0, and last gradient colour at point 1\n fill.unshift(fillStyle[0]);\n fillGradientStops.unshift(0);\n fill.push(fillStyle[fillStyle.length - 1]);\n fillGradientStops.push(1);\n if (style.fillGradientType === TEXT_GRADIENT.LINEAR_VERTICAL) {\n // start the gradient at the top center of the canvas, and end at the bottom middle of the canvas\n gradient = this.context.createLinearGradient(width / 2, padding, width / 2, height + padding);\n // we need to repeat the gradient so that each individual line of text has the same vertical gradient effect\n // ['#FF0000', '#00FF00', '#0000FF'] over 2 lines would create stops at 0.125, 0.25, 0.375, 0.625, 0.75, 0.875\n // There's potential for floating point precision issues at the seams between gradient repeats.\n // The loop below generates the stops in order, so track the last generated one to prevent\n // floating point precision from making us go the teeniest bit backwards, resulting in\n // the first and last colors getting swapped.\n var lastIterationStop = 0;\n // Actual height of the text itself, not counting spacing for lineHeight/leading/dropShadow etc\n var textHeight = metrics.fontProperties.fontSize + style.strokeThickness;\n // textHeight, but as a 0-1 size in global gradient stop space\n var gradStopLineHeight = textHeight / height;\n for (var i = 0; i < lines.length; i++) {\n var thisLineTop = metrics.lineHeight * i;\n for (var j = 0; j < fill.length; j++) {\n // 0-1 stop point for the current line, multiplied to global space afterwards\n var lineStop = 0;\n if (typeof fillGradientStops[j] === 'number') {\n lineStop = fillGradientStops[j];\n }\n else {\n lineStop = j / fill.length;\n }\n var globalStop = (thisLineTop / height) + (lineStop * gradStopLineHeight);\n // Prevent color stop generation going backwards from floating point imprecision\n var clampedStop = Math.max(lastIterationStop, globalStop);\n clampedStop = Math.min(clampedStop, 1); // Cap at 1 as well for safety's sake to avoid a possible throw.\n gradient.addColorStop(clampedStop, fill[j]);\n lastIterationStop = clampedStop;\n }\n }\n }\n else {\n // start the gradient at the center left of the canvas, and end at the center right of the canvas\n gradient = this.context.createLinearGradient(padding, height / 2, width + padding, height / 2);\n // can just evenly space out the gradients in this case, as multiple lines makes no difference\n // to an even left to right gradient\n var totalIterations = fill.length + 1;\n var currentIteration = 1;\n for (var i = 0; i < fill.length; i++) {\n var stop = void 0;\n if (typeof fillGradientStops[i] === 'number') {\n stop = fillGradientStops[i];\n }\n else {\n stop = currentIteration / totalIterations;\n }\n gradient.addColorStop(stop, fill[i]);\n currentIteration++;\n }\n }\n return gradient;\n };\n /**\n * Destroys this text object.\n * Note* Unlike a Sprite, a Text object will automatically destroy its baseTexture and texture as\n * the majority of the time the texture will not be shared with any other Sprites.\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their\n * destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=true] - Should it destroy the current texture of the sprite as well\n * @param {boolean} [options.baseTexture=true] - Should it destroy the base texture of the sprite as well\n */\n Text.prototype.destroy = function (options) {\n if (typeof options === 'boolean') {\n options = { children: options };\n }\n options = Object.assign({}, defaultDestroyOptions, options);\n _super.prototype.destroy.call(this, options);\n // set canvas width and height to 0 to workaround memory leak in Safari < 13\n // https://stackoverflow.com/questions/52532614/total-canvas-memory-use-exceeds-the-maximum-limit-safari-12\n if (this._ownCanvas) {\n this.canvas.height = this.canvas.width = 0;\n }\n // make sure to reset the the context and canvas.. dont want this hanging around in memory!\n this.context = null;\n this.canvas = null;\n this._style = null;\n };\n Object.defineProperty(Text.prototype, \"width\", {\n /**\n * The width of the Text, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n get: function () {\n this.updateText(true);\n return Math.abs(this.scale.x) * this._texture.orig.width;\n },\n set: function (value) {\n this.updateText(true);\n var s = sign(this.scale.x) || 1;\n this.scale.x = s * value / this._texture.orig.width;\n this._width = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"height\", {\n /**\n * The height of the Text, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n get: function () {\n this.updateText(true);\n return Math.abs(this.scale.y) * this._texture.orig.height;\n },\n set: function (value) {\n this.updateText(true);\n var s = sign(this.scale.y) || 1;\n this.scale.y = s * value / this._texture.orig.height;\n this._height = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"style\", {\n /**\n * Set the style of the text. Set up an event listener to listen for changes on the style\n * object and mark the text as dirty.\n *\n * @member {object|PIXI.TextStyle}\n */\n get: function () {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the ITextStyle\n // since the setter creates the TextStyle. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n return this._style;\n },\n set: function (style) {\n style = style || {};\n if (style instanceof TextStyle) {\n this._style = style;\n }\n else {\n this._style = new TextStyle(style);\n }\n this.localStyleID = -1;\n this.dirty = true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"text\", {\n /**\n * Set the copy for the text object. To split a line you can use '\\n'.\n *\n * @member {string}\n */\n get: function () {\n return this._text;\n },\n set: function (text) {\n text = String(text === null || text === undefined ? '' : text);\n if (this._text === text) {\n return;\n }\n this._text = text;\n this.dirty = true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"resolution\", {\n /**\n * The resolution / device pixel ratio of the canvas.\n * This is set to automatically match the renderer resolution by default, but can be overridden by setting manually.\n * @member {number}\n * @default 1\n */\n get: function () {\n return this._resolution;\n },\n set: function (value) {\n this._autoResolution = false;\n if (this._resolution === value) {\n return;\n }\n this._resolution = value;\n this.dirty = true;\n },\n enumerable: false,\n configurable: true\n });\n return Text;\n}(Sprite));\n\nexport { TEXT_GRADIENT, Text, TextMetrics, TextStyle };\n//# sourceMappingURL=text.es.js.map\n","/*!\n * @pixi/prepare - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/prepare is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { settings } from '@pixi/settings';\nimport { Texture, BaseTexture } from '@pixi/core';\nimport { Graphics } from '@pixi/graphics';\nimport { Ticker, UPDATE_PRIORITY } from '@pixi/ticker';\nimport { Container } from '@pixi/display';\nimport { Text, TextStyle, TextMetrics } from '@pixi/text';\n\n/**\n * Default number of uploads per frame using prepare plugin.\n *\n * @static\n * @memberof PIXI.settings\n * @name UPLOADS_PER_FRAME\n * @type {number}\n * @default 4\n */\nsettings.UPLOADS_PER_FRAME = 4;\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * CountLimiter limits the number of items handled by a {@link PIXI.BasePrepare} to a specified\n * number of items per frame.\n *\n * @class\n * @memberof PIXI\n */\nvar CountLimiter = /** @class */ (function () {\n /**\n * @param {number} maxItemsPerFrame - The maximum number of items that can be prepared each frame.\n */\n function CountLimiter(maxItemsPerFrame) {\n /**\n * The maximum number of items that can be prepared each frame.\n * @type {number}\n * @private\n */\n this.maxItemsPerFrame = maxItemsPerFrame;\n /**\n * The number of items that can be prepared in the current frame.\n * @type {number}\n * @private\n */\n this.itemsLeft = 0;\n }\n /**\n * Resets any counting properties to start fresh on a new frame.\n */\n CountLimiter.prototype.beginFrame = function () {\n this.itemsLeft = this.maxItemsPerFrame;\n };\n /**\n * Checks to see if another item can be uploaded. This should only be called once per item.\n * @return {boolean} If the item is allowed to be uploaded.\n */\n CountLimiter.prototype.allowedToUpload = function () {\n return this.itemsLeft-- > 0;\n };\n return CountLimiter;\n}());\n\n/**\n * Built-in hook to find multiple textures from objects like AnimatedSprites.\n *\n * @private\n * @param {PIXI.DisplayObject} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Texture object was found.\n */\nfunction findMultipleBaseTextures(item, queue) {\n var result = false;\n // Objects with multiple textures\n if (item && item._textures && item._textures.length) {\n for (var i = 0; i < item._textures.length; i++) {\n if (item._textures[i] instanceof Texture) {\n var baseTexture = item._textures[i].baseTexture;\n if (queue.indexOf(baseTexture) === -1) {\n queue.push(baseTexture);\n result = true;\n }\n }\n }\n }\n return result;\n}\n/**\n * Built-in hook to find BaseTextures from Texture.\n *\n * @private\n * @param {PIXI.Texture} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Texture object was found.\n */\nfunction findBaseTexture(item, queue) {\n if (item.baseTexture instanceof BaseTexture) {\n var texture = item.baseTexture;\n if (queue.indexOf(texture) === -1) {\n queue.push(texture);\n }\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to find textures from objects.\n *\n * @private\n * @param {PIXI.DisplayObject} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Texture object was found.\n */\nfunction findTexture(item, queue) {\n if (item._texture && item._texture instanceof Texture) {\n var texture = item._texture.baseTexture;\n if (queue.indexOf(texture) === -1) {\n queue.push(texture);\n }\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to draw PIXI.Text to its texture.\n *\n * @private\n * @param {PIXI.AbstractRenderer|PIXI.BasePrepare} helper - Not used by this upload handler\n * @param {PIXI.DisplayObject} item - Item to check\n * @return {boolean} If item was uploaded.\n */\nfunction drawText(_helper, item) {\n if (item instanceof Text) {\n // updating text will return early if it is not dirty\n item.updateText(true);\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to calculate a text style for a PIXI.Text object.\n *\n * @private\n * @param {PIXI.AbstractRenderer|PIXI.BasePrepare} helper - Not used by this upload handler\n * @param {PIXI.DisplayObject} item - Item to check\n * @return {boolean} If item was uploaded.\n */\nfunction calculateTextStyle(_helper, item) {\n if (item instanceof TextStyle) {\n var font = item.toFontString();\n TextMetrics.measureFont(font);\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to find Text objects.\n *\n * @private\n * @param {PIXI.DisplayObject} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Text object was found.\n */\nfunction findText(item, queue) {\n if (item instanceof Text) {\n // push the text style to prepare it - this can be really expensive\n if (queue.indexOf(item.style) === -1) {\n queue.push(item.style);\n }\n // also push the text object so that we can render it (to canvas/texture) if needed\n if (queue.indexOf(item) === -1) {\n queue.push(item);\n }\n // also push the Text's texture for upload to GPU\n var texture = item._texture.baseTexture;\n if (queue.indexOf(texture) === -1) {\n queue.push(texture);\n }\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to find TextStyle objects.\n *\n * @private\n * @param {PIXI.TextStyle} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.TextStyle object was found.\n */\nfunction findTextStyle(item, queue) {\n if (item instanceof TextStyle) {\n if (queue.indexOf(item) === -1) {\n queue.push(item);\n }\n return true;\n }\n return false;\n}\n/**\n * The prepare manager provides functionality to upload content to the GPU.\n *\n * BasePrepare handles basic queuing functionality and is extended by\n * {@link PIXI.Prepare} and {@link PIXI.CanvasPrepare}\n * to provide preparation capabilities specific to their respective renderers.\n *\n * @example\n * // Create a sprite\n * const sprite = PIXI.Sprite.from('something.png');\n *\n * // Load object into GPU\n * app.renderer.plugins.prepare.upload(sprite, () => {\n *\n * //Texture(s) has been uploaded to GPU\n * app.stage.addChild(sprite);\n *\n * })\n *\n * @abstract\n * @class\n * @memberof PIXI\n */\nvar BasePrepare = /** @class */ (function () {\n /**\n * @param {PIXI.AbstractRenderer} renderer - A reference to the current renderer\n */\n function BasePrepare(renderer) {\n var _this = this;\n /**\n * The limiter to be used to control how quickly items are prepared.\n * @type {PIXI.CountLimiter|PIXI.TimeLimiter}\n */\n this.limiter = new CountLimiter(settings.UPLOADS_PER_FRAME);\n /**\n * Reference to the renderer.\n * @type {PIXI.AbstractRenderer}\n * @protected\n */\n this.renderer = renderer;\n /**\n * The only real difference between CanvasPrepare and Prepare is what they pass\n * to upload hooks. That different parameter is stored here.\n * @type {object}\n * @protected\n */\n this.uploadHookHelper = null;\n /**\n * Collection of items to uploads at once.\n * @type {Array<*>}\n * @private\n */\n this.queue = [];\n /**\n * Collection of additional hooks for finding assets.\n * @type {Array}\n * @private\n */\n this.addHooks = [];\n /**\n * Collection of additional hooks for processing assets.\n * @type {Array}\n * @private\n */\n this.uploadHooks = [];\n /**\n * Callback to call after completed.\n * @type {Array}\n * @private\n */\n this.completes = [];\n /**\n * If prepare is ticking (running).\n * @type {boolean}\n * @private\n */\n this.ticking = false;\n /**\n * 'bound' call for prepareItems().\n * @type {Function}\n * @private\n */\n this.delayedTick = function () {\n // unlikely, but in case we were destroyed between tick() and delayedTick()\n if (!_this.queue) {\n return;\n }\n _this.prepareItems();\n };\n // hooks to find the correct texture\n this.registerFindHook(findText);\n this.registerFindHook(findTextStyle);\n this.registerFindHook(findMultipleBaseTextures);\n this.registerFindHook(findBaseTexture);\n this.registerFindHook(findTexture);\n // upload hooks\n this.registerUploadHook(drawText);\n this.registerUploadHook(calculateTextStyle);\n }\n /**\n * Upload all the textures and graphics to the GPU.\n *\n * @param {Function|PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text} item -\n * Either the container or display object to search for items to upload, the items to upload themselves,\n * or the callback function, if items have been added using `prepare.add`.\n * @param {Function} [done] - Optional callback when all queued uploads have completed\n */\n BasePrepare.prototype.upload = function (item, done) {\n if (typeof item === 'function') {\n done = item;\n item = null;\n }\n // If a display object, search for items\n // that we could upload\n if (item) {\n this.add(item);\n }\n // Get the items for upload from the display\n if (this.queue.length) {\n if (done) {\n this.completes.push(done);\n }\n if (!this.ticking) {\n this.ticking = true;\n Ticker.system.addOnce(this.tick, this, UPDATE_PRIORITY.UTILITY);\n }\n }\n else if (done) {\n done();\n }\n };\n /**\n * Handle tick update\n *\n * @private\n */\n BasePrepare.prototype.tick = function () {\n setTimeout(this.delayedTick, 0);\n };\n /**\n * Actually prepare items. This is handled outside of the tick because it will take a while\n * and we do NOT want to block the current animation frame from rendering.\n *\n * @private\n */\n BasePrepare.prototype.prepareItems = function () {\n this.limiter.beginFrame();\n // Upload the graphics\n while (this.queue.length && this.limiter.allowedToUpload()) {\n var item = this.queue[0];\n var uploaded = false;\n if (item && !item._destroyed) {\n for (var i = 0, len = this.uploadHooks.length; i < len; i++) {\n if (this.uploadHooks[i](this.uploadHookHelper, item)) {\n this.queue.shift();\n uploaded = true;\n break;\n }\n }\n }\n if (!uploaded) {\n this.queue.shift();\n }\n }\n // We're finished\n if (!this.queue.length) {\n this.ticking = false;\n var completes = this.completes.slice(0);\n this.completes.length = 0;\n for (var i = 0, len = completes.length; i < len; i++) {\n completes[i]();\n }\n }\n else {\n // if we are not finished, on the next rAF do this again\n Ticker.system.addOnce(this.tick, this, UPDATE_PRIORITY.UTILITY);\n }\n };\n /**\n * Adds hooks for finding items.\n *\n * @param {Function} addHook - Function call that takes two parameters: `item:*, queue:Array`\n * function must return `true` if it was able to add item to the queue.\n * @return {this} Instance of plugin for chaining.\n */\n BasePrepare.prototype.registerFindHook = function (addHook) {\n if (addHook) {\n this.addHooks.push(addHook);\n }\n return this;\n };\n /**\n * Adds hooks for uploading items.\n *\n * @param {Function} uploadHook - Function call that takes two parameters: `prepare:CanvasPrepare, item:*` and\n * function must return `true` if it was able to handle upload of item.\n * @return {this} Instance of plugin for chaining.\n */\n BasePrepare.prototype.registerUploadHook = function (uploadHook) {\n if (uploadHook) {\n this.uploadHooks.push(uploadHook);\n }\n return this;\n };\n /**\n * Manually add an item to the uploading queue.\n *\n * @param {PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text|*} item - Object to\n * add to the queue\n * @return {this} Instance of plugin for chaining.\n */\n BasePrepare.prototype.add = function (item) {\n // Add additional hooks for finding elements on special\n // types of objects that\n for (var i = 0, len = this.addHooks.length; i < len; i++) {\n if (this.addHooks[i](item, this.queue)) {\n break;\n }\n }\n // Get children recursively\n if (item instanceof Container) {\n for (var i = item.children.length - 1; i >= 0; i--) {\n this.add(item.children[i]);\n }\n }\n return this;\n };\n /**\n * Destroys the plugin, don't use after this.\n *\n */\n BasePrepare.prototype.destroy = function () {\n if (this.ticking) {\n Ticker.system.remove(this.tick, this);\n }\n this.ticking = false;\n this.addHooks = null;\n this.uploadHooks = null;\n this.renderer = null;\n this.completes = null;\n this.queue = null;\n this.limiter = null;\n this.uploadHookHelper = null;\n };\n return BasePrepare;\n}());\n\n/**\n * Built-in hook to upload PIXI.Texture objects to the GPU.\n *\n * @private\n * @param {PIXI.Renderer} renderer - instance of the webgl renderer\n * @param {PIXI.BaseTexture} item - Item to check\n * @return {boolean} If item was uploaded.\n */\nfunction uploadBaseTextures(renderer, item) {\n if (item instanceof BaseTexture) {\n // if the texture already has a GL texture, then the texture has been prepared or rendered\n // before now. If the texture changed, then the changer should be calling texture.update() which\n // reuploads the texture without need for preparing it again\n if (!item._glTextures[renderer.CONTEXT_UID]) {\n renderer.texture.bind(item);\n }\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to upload PIXI.Graphics to the GPU.\n *\n * @private\n * @param {PIXI.Renderer} renderer - instance of the webgl renderer\n * @param {PIXI.DisplayObject} item - Item to check\n * @return {boolean} If item was uploaded.\n */\nfunction uploadGraphics(renderer, item) {\n if (!(item instanceof Graphics)) {\n return false;\n }\n var geometry = item.geometry;\n // update dirty graphics to get batches\n item.finishPoly();\n geometry.updateBatches();\n var batches = geometry.batches;\n // upload all textures found in styles\n for (var i = 0; i < batches.length; i++) {\n var texture = batches[i].style.texture;\n if (texture) {\n uploadBaseTextures(renderer, texture.baseTexture);\n }\n }\n // if its not batchable - update vao for particular shader\n if (!geometry.batchable) {\n renderer.geometry.bind(geometry, item._resolveDirectShader(renderer));\n }\n return true;\n}\n/**\n * Built-in hook to find graphics.\n *\n * @private\n * @param {PIXI.DisplayObject} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Graphics object was found.\n */\nfunction findGraphics(item, queue) {\n if (item instanceof Graphics) {\n queue.push(item);\n return true;\n }\n return false;\n}\n/**\n * The prepare plugin provides renderer-specific plugins for pre-rendering DisplayObjects. These plugins are useful for\n * asynchronously preparing and uploading to the GPU assets, textures, graphics waiting to be displayed.\n *\n * Do not instantiate this plugin directly. It is available from the `renderer.plugins` property.\n * See {@link PIXI.CanvasRenderer#plugins} or {@link PIXI.Renderer#plugins}.\n * @example\n * // Create a new application\n * const app = new PIXI.Application();\n * document.body.appendChild(app.view);\n *\n * // Don't start rendering right away\n * app.stop();\n *\n * // create a display object\n * const rect = new PIXI.Graphics()\n * .beginFill(0x00ff00)\n * .drawRect(40, 40, 200, 200);\n *\n * // Add to the stage\n * app.stage.addChild(rect);\n *\n * // Don't start rendering until the graphic is uploaded to the GPU\n * app.renderer.plugins.prepare.upload(app.stage, () => {\n * app.start();\n * });\n *\n * @class\n * @extends PIXI.BasePrepare\n * @memberof PIXI\n */\nvar Prepare = /** @class */ (function (_super) {\n __extends(Prepare, _super);\n /**\n * @param {PIXI.Renderer} renderer - A reference to the current renderer\n */\n function Prepare(renderer) {\n var _this = _super.call(this, renderer) || this;\n _this.uploadHookHelper = _this.renderer;\n // Add textures and graphics to upload\n _this.registerFindHook(findGraphics);\n _this.registerUploadHook(uploadBaseTextures);\n _this.registerUploadHook(uploadGraphics);\n return _this;\n }\n return Prepare;\n}(BasePrepare));\n\n/**\n * TimeLimiter limits the number of items handled by a {@link PIXI.BasePrepare} to a specified\n * number of milliseconds per frame.\n *\n * @class\n * @memberof PIXI\n */\nvar TimeLimiter = /** @class */ (function () {\n /**\n * @param {number} maxMilliseconds - The maximum milliseconds that can be spent preparing items each frame.\n */\n function TimeLimiter(maxMilliseconds) {\n /**\n * The maximum milliseconds that can be spent preparing items each frame.\n * @type {number}\n * @private\n */\n this.maxMilliseconds = maxMilliseconds;\n /**\n * The start time of the current frame.\n * @type {number}\n * @private\n */\n this.frameStart = 0;\n }\n /**\n * Resets any counting properties to start fresh on a new frame.\n */\n TimeLimiter.prototype.beginFrame = function () {\n this.frameStart = Date.now();\n };\n /**\n * Checks to see if another item can be uploaded. This should only be called once per item.\n * @return {boolean} If the item is allowed to be uploaded.\n */\n TimeLimiter.prototype.allowedToUpload = function () {\n return Date.now() - this.frameStart < this.maxMilliseconds;\n };\n return TimeLimiter;\n}());\n\nexport { BasePrepare, CountLimiter, Prepare, TimeLimiter };\n//# sourceMappingURL=prepare.es.js.map\n","/*!\n * @pixi/spritesheet - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/spritesheet is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Rectangle } from '@pixi/math';\nimport { Texture, BaseTexture } from '@pixi/core';\nimport { getResolutionOfUrl, url } from '@pixi/utils';\nimport { LoaderResource } from '@pixi/loaders';\n\n/**\n * Utility class for maintaining reference to a collection\n * of Textures on a single Spritesheet.\n *\n * To access a sprite sheet from your code pass its JSON data file to Pixi's loader:\n *\n * ```js\n * PIXI.Loader.shared.add(\"images/spritesheet.json\").load(setup);\n *\n * function setup() {\n * let sheet = PIXI.Loader.shared.resources[\"images/spritesheet.json\"].spritesheet;\n * ...\n * }\n * ```\n * With the `sheet.textures` you can create Sprite objects,`sheet.animations` can be used to create an AnimatedSprite.\n *\n * Sprite sheets can be packed using tools like {@link https://codeandweb.com/texturepacker|TexturePacker},\n * {@link https://renderhjs.net/shoebox/|Shoebox} or {@link https://github.com/krzysztof-o/spritesheet.js|Spritesheet.js}.\n * Default anchor points (see {@link PIXI.Texture#defaultAnchor}) and grouping of animation sprites are currently only\n * supported by TexturePacker.\n *\n * @class\n * @memberof PIXI\n */\nvar Spritesheet = /** @class */ (function () {\n /**\n * @param {PIXI.BaseTexture|PIXI.Texture} baseTexture - Reference to the source BaseTexture object.\n * @param {Object} data - Spritesheet image data.\n * @param {string} [resolutionFilename] - The filename to consider when determining\n * the resolution of the spritesheet. If not provided, the imageUrl will\n * be used on the BaseTexture.\n */\n function Spritesheet(texture, data, resolutionFilename) {\n if (resolutionFilename === void 0) { resolutionFilename = null; }\n /**\n * Reference to original source image from the Loader. This reference is retained so we\n * can destroy the Texture later on. It is never used internally.\n * @type {PIXI.Texture}\n * @private\n */\n this._texture = texture instanceof Texture ? texture : null;\n /**\n * Reference to ths source texture.\n * @type {PIXI.BaseTexture}\n */\n this.baseTexture = texture instanceof BaseTexture ? texture : this._texture.baseTexture;\n /**\n * A map containing all textures of the sprite sheet.\n * Can be used to create a {@link PIXI.Sprite|Sprite}:\n * ```js\n * new PIXI.Sprite(sheet.textures[\"image.png\"]);\n * ```\n * @member {Object}\n */\n this.textures = {};\n /**\n * A map containing the textures for each animation.\n * Can be used to create an {@link PIXI.AnimatedSprite|AnimatedSprite}:\n * ```js\n * new PIXI.AnimatedSprite(sheet.animations[\"anim_name\"])\n * ```\n * @member {Object}\n */\n this.animations = {};\n /**\n * Reference to the original JSON data.\n * @type {Object}\n */\n this.data = data;\n var resource = this.baseTexture.resource;\n /**\n * The resolution of the spritesheet.\n * @type {number}\n */\n this.resolution = this._updateResolution(resolutionFilename || (resource ? resource.url : null));\n /**\n * Map of spritesheet frames.\n * @type {Object}\n * @private\n */\n this._frames = this.data.frames;\n /**\n * Collection of frame names.\n * @type {string[]}\n * @private\n */\n this._frameKeys = Object.keys(this._frames);\n /**\n * Current batch index being processed.\n * @type {number}\n * @private\n */\n this._batchIndex = 0;\n /**\n * Callback when parse is completed.\n * @type {Function}\n * @private\n */\n this._callback = null;\n }\n /**\n * Generate the resolution from the filename or fallback\n * to the meta.scale field of the JSON data.\n *\n * @private\n * @param {string} resolutionFilename - The filename to use for resolving\n * the default resolution.\n * @return {number} Resolution to use for spritesheet.\n */\n Spritesheet.prototype._updateResolution = function (resolutionFilename) {\n if (resolutionFilename === void 0) { resolutionFilename = null; }\n var scale = this.data.meta.scale;\n // Use a defaultValue of `null` to check if a url-based resolution is set\n var resolution = getResolutionOfUrl(resolutionFilename, null);\n // No resolution found via URL\n if (resolution === null) {\n // Use the scale value or default to 1\n resolution = scale !== undefined ? parseFloat(scale) : 1;\n }\n // For non-1 resolutions, update baseTexture\n if (resolution !== 1) {\n this.baseTexture.setResolution(resolution);\n }\n return resolution;\n };\n /**\n * Parser spritesheet from loaded data. This is done asynchronously\n * to prevent creating too many Texture within a single process.\n *\n * @param {Function} callback - Callback when complete returns\n * a map of the Textures for this spritesheet.\n */\n Spritesheet.prototype.parse = function (callback) {\n this._batchIndex = 0;\n this._callback = callback;\n if (this._frameKeys.length <= Spritesheet.BATCH_SIZE) {\n this._processFrames(0);\n this._processAnimations();\n this._parseComplete();\n }\n else {\n this._nextBatch();\n }\n };\n /**\n * Process a batch of frames\n *\n * @private\n * @param {number} initialFrameIndex - The index of frame to start.\n */\n Spritesheet.prototype._processFrames = function (initialFrameIndex) {\n var frameIndex = initialFrameIndex;\n var maxFrames = Spritesheet.BATCH_SIZE;\n while (frameIndex - initialFrameIndex < maxFrames && frameIndex < this._frameKeys.length) {\n var i = this._frameKeys[frameIndex];\n var data = this._frames[i];\n var rect = data.frame;\n if (rect) {\n var frame = null;\n var trim = null;\n var sourceSize = data.trimmed !== false && data.sourceSize\n ? data.sourceSize : data.frame;\n var orig = new Rectangle(0, 0, Math.floor(sourceSize.w) / this.resolution, Math.floor(sourceSize.h) / this.resolution);\n if (data.rotated) {\n frame = new Rectangle(Math.floor(rect.x) / this.resolution, Math.floor(rect.y) / this.resolution, Math.floor(rect.h) / this.resolution, Math.floor(rect.w) / this.resolution);\n }\n else {\n frame = new Rectangle(Math.floor(rect.x) / this.resolution, Math.floor(rect.y) / this.resolution, Math.floor(rect.w) / this.resolution, Math.floor(rect.h) / this.resolution);\n }\n // Check to see if the sprite is trimmed\n if (data.trimmed !== false && data.spriteSourceSize) {\n trim = new Rectangle(Math.floor(data.spriteSourceSize.x) / this.resolution, Math.floor(data.spriteSourceSize.y) / this.resolution, Math.floor(rect.w) / this.resolution, Math.floor(rect.h) / this.resolution);\n }\n this.textures[i] = new Texture(this.baseTexture, frame, orig, trim, data.rotated ? 2 : 0, data.anchor);\n // lets also add the frame to pixi's global cache for 'from' and 'fromLoader' functions\n Texture.addToCache(this.textures[i], i);\n }\n frameIndex++;\n }\n };\n /**\n * Parse animations config\n *\n * @private\n */\n Spritesheet.prototype._processAnimations = function () {\n var animations = this.data.animations || {};\n for (var animName in animations) {\n this.animations[animName] = [];\n for (var i = 0; i < animations[animName].length; i++) {\n var frameName = animations[animName][i];\n this.animations[animName].push(this.textures[frameName]);\n }\n }\n };\n /**\n * The parse has completed.\n *\n * @private\n */\n Spritesheet.prototype._parseComplete = function () {\n var callback = this._callback;\n this._callback = null;\n this._batchIndex = 0;\n callback.call(this, this.textures);\n };\n /**\n * Begin the next batch of textures.\n *\n * @private\n */\n Spritesheet.prototype._nextBatch = function () {\n var _this = this;\n this._processFrames(this._batchIndex * Spritesheet.BATCH_SIZE);\n this._batchIndex++;\n setTimeout(function () {\n if (_this._batchIndex * Spritesheet.BATCH_SIZE < _this._frameKeys.length) {\n _this._nextBatch();\n }\n else {\n _this._processAnimations();\n _this._parseComplete();\n }\n }, 0);\n };\n /**\n * Destroy Spritesheet and don't use after this.\n *\n * @param {boolean} [destroyBase=false] - Whether to destroy the base texture as well\n */\n Spritesheet.prototype.destroy = function (destroyBase) {\n var _a;\n if (destroyBase === void 0) { destroyBase = false; }\n for (var i in this.textures) {\n this.textures[i].destroy();\n }\n this._frames = null;\n this._frameKeys = null;\n this.data = null;\n this.textures = null;\n if (destroyBase) {\n (_a = this._texture) === null || _a === void 0 ? void 0 : _a.destroy();\n this.baseTexture.destroy();\n }\n this._texture = null;\n this.baseTexture = null;\n };\n /**\n * The maximum number of Textures to build per process.\n *\n * @type {number}\n * @default 1000\n */\n Spritesheet.BATCH_SIZE = 1000;\n return Spritesheet;\n}());\n\n/**\n * {@link PIXI.Loader Loader} middleware for loading texture atlases that have been created with\n * TexturePacker or similar JSON-based spritesheet.\n *\n * This middleware automatically generates Texture resources.\n *\n * @class\n * @memberof PIXI\n * @implements PIXI.ILoaderPlugin\n */\nvar SpritesheetLoader = /** @class */ (function () {\n function SpritesheetLoader() {\n }\n /**\n * Called after a resource is loaded.\n * @see PIXI.Loader.loaderMiddleware\n * @param {PIXI.LoaderResource} resource\n * @param {function} next\n */\n SpritesheetLoader.use = function (resource, next) {\n // because this is middleware, it execute in loader context. `this` = loader\n var loader = this;\n var imageResourceName = resource.name + \"_image\";\n // skip if no data, its not json, it isn't spritesheet data, or the image resource already exists\n if (!resource.data\n || resource.type !== LoaderResource.TYPE.JSON\n || !resource.data.frames\n || loader.resources[imageResourceName]) {\n next();\n return;\n }\n var loadOptions = {\n crossOrigin: resource.crossOrigin,\n metadata: resource.metadata.imageMetadata,\n parentResource: resource,\n };\n var resourcePath = SpritesheetLoader.getResourcePath(resource, loader.baseUrl);\n // load the image for this sheet\n loader.add(imageResourceName, resourcePath, loadOptions, function onImageLoad(res) {\n if (res.error) {\n next(res.error);\n return;\n }\n var spritesheet = new Spritesheet(res.texture, resource.data, resource.url);\n spritesheet.parse(function () {\n resource.spritesheet = spritesheet;\n resource.textures = spritesheet.textures;\n next();\n });\n });\n };\n /**\n * Get the spritesheets root path\n * @param {PIXI.LoaderResource} resource - Resource to check path\n * @param {string} baseUrl - Base root url\n */\n SpritesheetLoader.getResourcePath = function (resource, baseUrl) {\n // Prepend url path unless the resource image is a data url\n if (resource.isDataUrl) {\n return resource.data.meta.image;\n }\n return url.resolve(resource.url.replace(baseUrl, ''), resource.data.meta.image);\n };\n return SpritesheetLoader;\n}());\n\nexport { Spritesheet, SpritesheetLoader };\n//# sourceMappingURL=spritesheet.es.js.map\n","/*!\n * @pixi/sprite-tiling - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/sprite-tiling is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { TextureMatrix, Texture, Shader, QuadUv, State, ObjectRenderer } from '@pixi/core';\nimport { Point, Transform, Rectangle, Matrix } from '@pixi/math';\nimport { Sprite } from '@pixi/sprite';\nimport { deprecation, premultiplyTintToRgba, correctBlendMode } from '@pixi/utils';\nimport { WRAP_MODES } from '@pixi/constants';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar tempPoint = new Point();\n/**\n * A tiling sprite is a fast way of rendering a tiling image\n *\n * @class\n * @extends PIXI.Sprite\n * @memberof PIXI\n */\nvar TilingSprite = /** @class */ (function (_super) {\n __extends(TilingSprite, _super);\n /**\n * @param {PIXI.Texture} texture - the texture of the tiling sprite\n * @param {number} [width=100] - the width of the tiling sprite\n * @param {number} [height=100] - the height of the tiling sprite\n */\n function TilingSprite(texture, width, height) {\n if (width === void 0) { width = 100; }\n if (height === void 0) { height = 100; }\n var _this = _super.call(this, texture) || this;\n /**\n * Tile transform\n *\n * @member {PIXI.Transform}\n */\n _this.tileTransform = new Transform();\n /**\n * The with of the tiling sprite\n *\n * @member {number}\n * @private\n */\n _this._width = width;\n /**\n * The height of the tiling sprite\n *\n * @member {number}\n * @private\n */\n _this._height = height;\n /**\n * matrix that is applied to UV to get the coords in Texture normalized space to coords in BaseTexture space\n *\n * @member {PIXI.TextureMatrix}\n */\n _this.uvMatrix = _this.texture.uvMatrix || new TextureMatrix(texture);\n /**\n * Plugin that is responsible for rendering this element.\n * Allows to customize the rendering process without overriding '_render' method.\n *\n * @member {string}\n * @default 'tilingSprite'\n */\n _this.pluginName = 'tilingSprite';\n /**\n * Whether or not anchor affects uvs\n *\n * @member {boolean}\n * @default false\n */\n _this.uvRespectAnchor = false;\n return _this;\n }\n Object.defineProperty(TilingSprite.prototype, \"clampMargin\", {\n /**\n * Changes frame clamping in corresponding textureTransform, shortcut\n * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas\n *\n * @default 0.5\n * @member {number}\n */\n get: function () {\n return this.uvMatrix.clampMargin;\n },\n set: function (value) {\n this.uvMatrix.clampMargin = value;\n this.uvMatrix.update(true);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TilingSprite.prototype, \"tileScale\", {\n /**\n * The scaling of the image that is being tiled\n *\n * @member {PIXI.ObservablePoint}\n */\n get: function () {\n return this.tileTransform.scale;\n },\n set: function (value) {\n this.tileTransform.scale.copyFrom(value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TilingSprite.prototype, \"tilePosition\", {\n /**\n * The offset of the image that is being tiled\n *\n * @member {PIXI.ObservablePoint}\n */\n get: function () {\n return this.tileTransform.position;\n },\n set: function (value) {\n this.tileTransform.position.copyFrom(value);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @protected\n */\n TilingSprite.prototype._onTextureUpdate = function () {\n if (this.uvMatrix) {\n this.uvMatrix.texture = this._texture;\n }\n this._cachedTint = 0xFFFFFF;\n };\n /**\n * Renders the object using the WebGL renderer\n *\n * @protected\n * @param {PIXI.Renderer} renderer - The renderer\n */\n TilingSprite.prototype._render = function (renderer) {\n // tweak our texture temporarily..\n var texture = this._texture;\n if (!texture || !texture.valid) {\n return;\n }\n this.tileTransform.updateLocalTransform();\n this.uvMatrix.update();\n renderer.batch.setObjectRenderer(renderer.plugins[this.pluginName]);\n renderer.plugins[this.pluginName].render(this);\n };\n /**\n * Updates the bounds of the tiling sprite.\n *\n * @protected\n */\n TilingSprite.prototype._calculateBounds = function () {\n var minX = this._width * -this._anchor._x;\n var minY = this._height * -this._anchor._y;\n var maxX = this._width * (1 - this._anchor._x);\n var maxY = this._height * (1 - this._anchor._y);\n this._bounds.addFrame(this.transform, minX, minY, maxX, maxY);\n };\n /**\n * Gets the local bounds of the sprite object.\n *\n * @param {PIXI.Rectangle} rect - The output rectangle.\n * @return {PIXI.Rectangle} The bounds.\n */\n TilingSprite.prototype.getLocalBounds = function (rect) {\n // we can do a fast local bounds if the sprite has no children!\n if (this.children.length === 0) {\n this._bounds.minX = this._width * -this._anchor._x;\n this._bounds.minY = this._height * -this._anchor._y;\n this._bounds.maxX = this._width * (1 - this._anchor._x);\n this._bounds.maxY = this._height * (1 - this._anchor._y);\n if (!rect) {\n if (!this._localBoundsRect) {\n this._localBoundsRect = new Rectangle();\n }\n rect = this._localBoundsRect;\n }\n return this._bounds.getRectangle(rect);\n }\n return _super.prototype.getLocalBounds.call(this, rect);\n };\n /**\n * Checks if a point is inside this tiling sprite.\n *\n * @param {PIXI.IPointData} point - the point to check\n * @return {boolean} Whether or not the sprite contains the point.\n */\n TilingSprite.prototype.containsPoint = function (point) {\n this.worldTransform.applyInverse(point, tempPoint);\n var width = this._width;\n var height = this._height;\n var x1 = -width * this.anchor._x;\n if (tempPoint.x >= x1 && tempPoint.x < x1 + width) {\n var y1 = -height * this.anchor._y;\n if (tempPoint.y >= y1 && tempPoint.y < y1 + height) {\n return true;\n }\n }\n return false;\n };\n /**\n * Destroys this sprite and optionally its texture and children\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well\n * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well\n */\n TilingSprite.prototype.destroy = function (options) {\n _super.prototype.destroy.call(this, options);\n this.tileTransform = null;\n this.uvMatrix = null;\n };\n /**\n * Helper function that creates a new tiling sprite based on the source you provide.\n * The source can be - frame id, image url, video url, canvas element, video element, base texture\n *\n * @static\n * @param {string|PIXI.Texture|HTMLCanvasElement|HTMLVideoElement} source - Source to create texture from\n * @param {Object} options - See {@link PIXI.BaseTexture}'s constructor for options.\n * @param {number} options.width - required width of the tiling sprite\n * @param {number} options.height - required height of the tiling sprite\n * @return {PIXI.TilingSprite} The newly created texture\n */\n TilingSprite.from = function (source, options) {\n // Deprecated\n if (typeof options === 'number') {\n deprecation('5.3.0', 'TilingSprite.from use options instead of width and height args');\n // eslint-disable-next-line prefer-rest-params\n options = { width: options, height: arguments[2] };\n }\n return new TilingSprite(Texture.from(source, options), options.width, options.height);\n };\n Object.defineProperty(TilingSprite.prototype, \"width\", {\n /**\n * The width of the sprite, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n get: function () {\n return this._width;\n },\n set: function (value) {\n this._width = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TilingSprite.prototype, \"height\", {\n /**\n * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n get: function () {\n return this._height;\n },\n set: function (value) {\n this._height = value;\n },\n enumerable: false,\n configurable: true\n });\n return TilingSprite;\n}(Sprite));\n\nvar vertex = \"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\";\n\nvar fragment = \"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\nvar fragmentSimple = \"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\nvar tempMat = new Matrix();\n/**\n * WebGL renderer plugin for tiling sprites\n *\n * @class\n * @memberof PIXI\n * @extends PIXI.ObjectRenderer\n */\nvar TilingSpriteRenderer = /** @class */ (function (_super) {\n __extends(TilingSpriteRenderer, _super);\n /**\n * constructor for renderer\n *\n * @param {PIXI.Renderer} renderer - The renderer this tiling awesomeness works for.\n */\n function TilingSpriteRenderer(renderer) {\n var _this = _super.call(this, renderer) || this;\n var uniforms = { globals: _this.renderer.globalUniforms };\n _this.shader = Shader.from(vertex, fragment, uniforms);\n _this.simpleShader = Shader.from(vertex, fragmentSimple, uniforms);\n _this.quad = new QuadUv();\n /**\n * The WebGL state in which this renderer will work.\n *\n * @member {PIXI.State}\n * @readonly\n */\n _this.state = State.for2d();\n return _this;\n }\n /**\n *\n * @param {PIXI.TilingSprite} ts - tilingSprite to be rendered\n */\n TilingSpriteRenderer.prototype.render = function (ts) {\n var renderer = this.renderer;\n var quad = this.quad;\n var vertices = quad.vertices;\n vertices[0] = vertices[6] = (ts._width) * -ts.anchor.x;\n vertices[1] = vertices[3] = ts._height * -ts.anchor.y;\n vertices[2] = vertices[4] = (ts._width) * (1.0 - ts.anchor.x);\n vertices[5] = vertices[7] = ts._height * (1.0 - ts.anchor.y);\n if (ts.uvRespectAnchor) {\n vertices = quad.uvs;\n vertices[0] = vertices[6] = -ts.anchor.x;\n vertices[1] = vertices[3] = -ts.anchor.y;\n vertices[2] = vertices[4] = 1.0 - ts.anchor.x;\n vertices[5] = vertices[7] = 1.0 - ts.anchor.y;\n }\n quad.invalidate();\n var tex = ts._texture;\n var baseTex = tex.baseTexture;\n var lt = ts.tileTransform.localTransform;\n var uv = ts.uvMatrix;\n var isSimple = baseTex.isPowerOfTwo\n && tex.frame.width === baseTex.width && tex.frame.height === baseTex.height;\n // auto, force repeat wrapMode for big tiling textures\n if (isSimple) {\n if (!baseTex._glTextures[renderer.CONTEXT_UID]) {\n if (baseTex.wrapMode === WRAP_MODES.CLAMP) {\n baseTex.wrapMode = WRAP_MODES.REPEAT;\n }\n }\n else {\n isSimple = baseTex.wrapMode !== WRAP_MODES.CLAMP;\n }\n }\n var shader = isSimple ? this.simpleShader : this.shader;\n var w = tex.width;\n var h = tex.height;\n var W = ts._width;\n var H = ts._height;\n tempMat.set(lt.a * w / W, lt.b * w / H, lt.c * h / W, lt.d * h / H, lt.tx / W, lt.ty / H);\n // that part is the same as above:\n // tempMat.identity();\n // tempMat.scale(tex.width, tex.height);\n // tempMat.prepend(lt);\n // tempMat.scale(1.0 / ts._width, 1.0 / ts._height);\n tempMat.invert();\n if (isSimple) {\n tempMat.prepend(uv.mapCoord);\n }\n else {\n shader.uniforms.uMapCoord = uv.mapCoord.toArray(true);\n shader.uniforms.uClampFrame = uv.uClampFrame;\n shader.uniforms.uClampOffset = uv.uClampOffset;\n }\n shader.uniforms.uTransform = tempMat.toArray(true);\n shader.uniforms.uColor = premultiplyTintToRgba(ts.tint, ts.worldAlpha, shader.uniforms.uColor, baseTex.alphaMode);\n shader.uniforms.translationMatrix = ts.transform.worldTransform.toArray(true);\n shader.uniforms.uSampler = tex;\n renderer.shader.bind(shader);\n renderer.geometry.bind(quad);\n this.state.blendMode = correctBlendMode(ts.blendMode, baseTex.alphaMode);\n renderer.state.set(this.state);\n renderer.geometry.draw(this.renderer.gl.TRIANGLES, 6, 0);\n };\n return TilingSpriteRenderer;\n}(ObjectRenderer));\n\nexport { TilingSprite, TilingSpriteRenderer };\n//# sourceMappingURL=sprite-tiling.es.js.map\n","/*!\n * @pixi/mesh - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/mesh is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { State, Program, TextureMatrix, Shader, Buffer, Geometry } from '@pixi/core';\nimport { Point, Polygon, Matrix } from '@pixi/math';\nimport { DRAW_MODES, TYPES } from '@pixi/constants';\nimport { Container } from '@pixi/display';\nimport { settings } from '@pixi/settings';\nimport { premultiplyTintToRgba } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * Class controls cache for UV mapping from Texture normal space to BaseTexture normal space.\n *\n * @class\n * @memberof PIXI\n */\nvar MeshBatchUvs = /** @class */ (function () {\n /**\n * @param {PIXI.Buffer} uvBuffer - Buffer with normalized uv's\n * @param {PIXI.TextureMatrix} uvMatrix - Material UV matrix\n */\n function MeshBatchUvs(uvBuffer, uvMatrix) {\n /**\n * Buffer with normalized UV's\n * @member {PIXI.Buffer}\n */\n this.uvBuffer = uvBuffer;\n /**\n * Material UV matrix\n * @member {PIXI.TextureMatrix}\n */\n this.uvMatrix = uvMatrix;\n /**\n * UV Buffer data\n * @member {Float32Array}\n * @readonly\n */\n this.data = null;\n this._bufferUpdateId = -1;\n this._textureUpdateId = -1;\n this._updateID = 0;\n }\n /**\n * updates\n *\n * @param {boolean} [forceUpdate] - force the update\n */\n MeshBatchUvs.prototype.update = function (forceUpdate) {\n if (!forceUpdate\n && this._bufferUpdateId === this.uvBuffer._updateID\n && this._textureUpdateId === this.uvMatrix._updateID) {\n return;\n }\n this._bufferUpdateId = this.uvBuffer._updateID;\n this._textureUpdateId = this.uvMatrix._updateID;\n var data = this.uvBuffer.data;\n if (!this.data || this.data.length !== data.length) {\n this.data = new Float32Array(data.length);\n }\n this.uvMatrix.multiplyUvs(data, this.data);\n this._updateID++;\n };\n return MeshBatchUvs;\n}());\n\nvar tempPoint = new Point();\nvar tempPolygon = new Polygon();\n/**\n * Base mesh class.\n *\n * This class empowers you to have maximum flexibility to render any kind of WebGL visuals you can think of.\n * This class assumes a certain level of WebGL knowledge.\n * If you know a bit this should abstract enough away to make you life easier!\n *\n * Pretty much ALL WebGL can be broken down into the following:\n * - Geometry - The structure and data for the mesh. This can include anything from positions, uvs, normals, colors etc..\n * - Shader - This is the shader that PixiJS will render the geometry with (attributes in the shader must match the geometry)\n * - State - This is the state of WebGL required to render the mesh.\n *\n * Through a combination of the above elements you can render anything you want, 2D or 3D!\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI\n */\nvar Mesh = /** @class */ (function (_super) {\n __extends(Mesh, _super);\n /**\n * @param {PIXI.Geometry} geometry - the geometry the mesh will use\n * @param {PIXI.MeshMaterial} shader - the shader the mesh will use\n * @param {PIXI.State} [state] - the state that the WebGL context is required to be in to render the mesh\n * if no state is provided, uses {@link PIXI.State.for2d} to create a 2D state for PixiJS.\n * @param {number} [drawMode=PIXI.DRAW_MODES.TRIANGLES] - the drawMode, can be any of the PIXI.DRAW_MODES consts\n */\n function Mesh(geometry, shader, state, drawMode) {\n if (drawMode === void 0) { drawMode = DRAW_MODES.TRIANGLES; }\n var _this = _super.call(this) || this;\n /**\n * Includes vertex positions, face indices, normals, colors, UVs, and\n * custom attributes within buffers, reducing the cost of passing all\n * this data to the GPU. Can be shared between multiple Mesh objects.\n * @member {PIXI.Geometry}\n * @readonly\n */\n _this.geometry = geometry;\n geometry.refCount++;\n /**\n * Represents the vertex and fragment shaders that processes the geometry and runs on the GPU.\n * Can be shared between multiple Mesh objects.\n * @member {PIXI.Shader|PIXI.MeshMaterial}\n */\n _this.shader = shader;\n /**\n * Represents the WebGL state the Mesh required to render, excludes shader and geometry. E.g.,\n * blend mode, culling, depth testing, direction of rendering triangles, backface, etc.\n * @member {PIXI.State}\n */\n _this.state = state || State.for2d();\n /**\n * The way the Mesh should be drawn, can be any of the {@link PIXI.DRAW_MODES} constants.\n *\n * @member {number}\n * @see PIXI.DRAW_MODES\n */\n _this.drawMode = drawMode;\n /**\n * Typically the index of the IndexBuffer where to start drawing.\n * @member {number}\n * @default 0\n */\n _this.start = 0;\n /**\n * How much of the geometry to draw, by default `0` renders everything.\n * @member {number}\n * @default 0\n */\n _this.size = 0;\n /**\n * thease are used as easy access for batching\n * @member {Float32Array}\n * @private\n */\n _this.uvs = null;\n /**\n * thease are used as easy access for batching\n * @member {Uint16Array}\n * @private\n */\n _this.indices = null;\n /**\n * this is the caching layer used by the batcher\n * @member {Float32Array}\n * @private\n */\n _this.vertexData = new Float32Array(1);\n /**\n * If geometry is changed used to decide to re-transform\n * the vertexData.\n * @member {number}\n * @private\n */\n _this.vertexDirty = 0;\n _this._transformID = -1;\n /**\n * Internal roundPixels field\n *\n * @member {boolean}\n * @private\n */\n _this._roundPixels = settings.ROUND_PIXELS;\n /**\n * Batched UV's are cached for atlas textures\n * @member {PIXI.MeshBatchUvs}\n * @private\n */\n _this.batchUvs = null;\n return _this;\n }\n Object.defineProperty(Mesh.prototype, \"uvBuffer\", {\n /**\n * To change mesh uv's, change its uvBuffer data and increment its _updateID.\n * @member {PIXI.Buffer}\n * @readonly\n */\n get: function () {\n return this.geometry.buffers[1];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"verticesBuffer\", {\n /**\n * To change mesh vertices, change its uvBuffer data and increment its _updateID.\n * Incrementing _updateID is optional because most of Mesh objects do it anyway.\n * @member {PIXI.Buffer}\n * @readonly\n */\n get: function () {\n return this.geometry.buffers[0];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"material\", {\n get: function () {\n return this.shader;\n },\n /**\n * Alias for {@link PIXI.Mesh#shader}.\n * @member {PIXI.MeshMaterial}\n */\n set: function (value) {\n this.shader = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"blendMode\", {\n get: function () {\n return this.state.blendMode;\n },\n /**\n * The blend mode to be applied to the Mesh. Apply a value of\n * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL;\n * @see PIXI.BLEND_MODES\n */\n set: function (value) {\n this.state.blendMode = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"roundPixels\", {\n get: function () {\n return this._roundPixels;\n },\n /**\n * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.\n * Advantages can include sharper image quality (like text) and faster rendering on canvas.\n * The main disadvantage is movement of objects may appear less smooth.\n * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}\n *\n * @member {boolean}\n * @default false\n */\n set: function (value) {\n if (this._roundPixels !== value) {\n this._transformID = -1;\n }\n this._roundPixels = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"tint\", {\n /**\n * The multiply tint applied to the Mesh. This is a hex value. A value of\n * `0xFFFFFF` will remove any tint effect.\n *\n * @member {number}\n * @default 0xFFFFFF\n */\n get: function () {\n return this.shader.tint;\n },\n set: function (value) {\n this.shader.tint = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"texture\", {\n /**\n * The texture that the Mesh uses.\n *\n * @member {PIXI.Texture}\n */\n get: function () {\n return this.shader.texture;\n },\n set: function (value) {\n this.shader.texture = value;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Standard renderer draw.\n * @protected\n * @param {PIXI.Renderer} renderer - Instance to renderer.\n */\n Mesh.prototype._render = function (renderer) {\n // set properties for batching..\n // TODO could use a different way to grab verts?\n var vertices = this.geometry.buffers[0].data;\n // TODO benchmark check for attribute size..\n if (this.shader.batchable\n && this.drawMode === DRAW_MODES.TRIANGLES\n && vertices.length < Mesh.BATCHABLE_SIZE * 2) {\n this._renderToBatch(renderer);\n }\n else {\n this._renderDefault(renderer);\n }\n };\n /**\n * Standard non-batching way of rendering.\n * @protected\n * @param {PIXI.Renderer} renderer - Instance to renderer.\n */\n Mesh.prototype._renderDefault = function (renderer) {\n var shader = this.shader;\n shader.alpha = this.worldAlpha;\n if (shader.update) {\n shader.update();\n }\n renderer.batch.flush();\n if (shader.program.uniformData.translationMatrix) {\n shader.uniforms.translationMatrix = this.transform.worldTransform.toArray(true);\n }\n // bind and sync uniforms..\n renderer.shader.bind(shader);\n // set state..\n renderer.state.set(this.state);\n // bind the geometry...\n renderer.geometry.bind(this.geometry, shader);\n // then render it\n renderer.geometry.draw(this.drawMode, this.size, this.start, this.geometry.instanceCount);\n };\n /**\n * Rendering by using the Batch system.\n * @protected\n * @param {PIXI.Renderer} renderer - Instance to renderer.\n */\n Mesh.prototype._renderToBatch = function (renderer) {\n var geometry = this.geometry;\n if (this.shader.uvMatrix) {\n this.shader.uvMatrix.update();\n this.calculateUvs();\n }\n // set properties for batching..\n this.calculateVertices();\n this.indices = geometry.indexBuffer.data;\n this._tintRGB = this.shader._tintRGB;\n this._texture = this.shader.texture;\n var pluginName = this.material.pluginName;\n renderer.batch.setObjectRenderer(renderer.plugins[pluginName]);\n renderer.plugins[pluginName].render(this);\n };\n /**\n * Updates vertexData field based on transform and vertices\n */\n Mesh.prototype.calculateVertices = function () {\n var geometry = this.geometry;\n var vertices = geometry.buffers[0].data;\n if (geometry.vertexDirtyId === this.vertexDirty && this._transformID === this.transform._worldID) {\n return;\n }\n this._transformID = this.transform._worldID;\n if (this.vertexData.length !== vertices.length) {\n this.vertexData = new Float32Array(vertices.length);\n }\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var vertexData = this.vertexData;\n for (var i = 0; i < vertexData.length / 2; i++) {\n var x = vertices[(i * 2)];\n var y = vertices[(i * 2) + 1];\n vertexData[(i * 2)] = (a * x) + (c * y) + tx;\n vertexData[(i * 2) + 1] = (b * x) + (d * y) + ty;\n }\n if (this._roundPixels) {\n var resolution = settings.RESOLUTION;\n for (var i = 0; i < vertexData.length; ++i) {\n vertexData[i] = Math.round((vertexData[i] * resolution | 0) / resolution);\n }\n }\n this.vertexDirty = geometry.vertexDirtyId;\n };\n /**\n * Updates uv field based on from geometry uv's or batchUvs\n */\n Mesh.prototype.calculateUvs = function () {\n var geomUvs = this.geometry.buffers[1];\n if (!this.shader.uvMatrix.isSimple) {\n if (!this.batchUvs) {\n this.batchUvs = new MeshBatchUvs(geomUvs, this.shader.uvMatrix);\n }\n this.batchUvs.update();\n this.uvs = this.batchUvs.data;\n }\n else {\n this.uvs = geomUvs.data;\n }\n };\n /**\n * Updates the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account.\n * there must be a aVertexPosition attribute present in the geometry for bounds to be calculated correctly.\n *\n * @protected\n */\n Mesh.prototype._calculateBounds = function () {\n this.calculateVertices();\n this._bounds.addVertexData(this.vertexData, 0, this.vertexData.length);\n };\n /**\n * Tests if a point is inside this mesh. Works only for PIXI.DRAW_MODES.TRIANGLES.\n *\n * @param {PIXI.IPointData} point - the point to test\n * @return {boolean} the result of the test\n */\n Mesh.prototype.containsPoint = function (point) {\n if (!this.getBounds().contains(point.x, point.y)) {\n return false;\n }\n this.worldTransform.applyInverse(point, tempPoint);\n var vertices = this.geometry.getBuffer('aVertexPosition').data;\n var points = tempPolygon.points;\n var indices = this.geometry.getIndex().data;\n var len = indices.length;\n var step = this.drawMode === 4 ? 3 : 1;\n for (var i = 0; i + 2 < len; i += step) {\n var ind0 = indices[i] * 2;\n var ind1 = indices[i + 1] * 2;\n var ind2 = indices[i + 2] * 2;\n points[0] = vertices[ind0];\n points[1] = vertices[ind0 + 1];\n points[2] = vertices[ind1];\n points[3] = vertices[ind1 + 1];\n points[4] = vertices[ind2];\n points[5] = vertices[ind2 + 1];\n if (tempPolygon.contains(tempPoint.x, tempPoint.y)) {\n return true;\n }\n }\n return false;\n };\n /**\n * Destroys the Mesh object.\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all\n * options have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have\n * their destroy method called as well. 'options' will be passed on to those calls.\n */\n Mesh.prototype.destroy = function (options) {\n _super.prototype.destroy.call(this, options);\n this.geometry.refCount--;\n if (this.geometry.refCount === 0) {\n this.geometry.dispose();\n }\n this.geometry = null;\n this.shader = null;\n this.state = null;\n this.uvs = null;\n this.indices = null;\n this.vertexData = null;\n };\n /**\n * The maximum number of vertices to consider batchable. Generally, the complexity\n * of the geometry.\n * @memberof PIXI.Mesh\n * @static\n * @member {number} BATCHABLE_SIZE\n */\n Mesh.BATCHABLE_SIZE = 100;\n return Mesh;\n}(Container));\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform vec4 uColor;\\n\\nuniform sampler2D uSampler;\\n\\nvoid main(void)\\n{\\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\\n}\\n\";\n\nvar vertex = \"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\";\n\n/**\n * Slightly opinionated default shader for PixiJS 2D objects.\n * @class\n * @memberof PIXI\n * @extends PIXI.Shader\n */\nvar MeshMaterial = /** @class */ (function (_super) {\n __extends(MeshMaterial, _super);\n /**\n * @param {PIXI.Texture} uSampler - Texture that material uses to render.\n * @param {object} [options] - Additional options\n * @param {number} [options.alpha=1] - Default alpha.\n * @param {number} [options.tint=0xFFFFFF] - Default tint.\n * @param {string} [options.pluginName='batch'] - Renderer plugin for batching.\n * @param {PIXI.Program} [options.program=0xFFFFFF] - Custom program.\n * @param {object} [options.uniforms] - Custom uniforms.\n */\n function MeshMaterial(uSampler, options) {\n var _this = this;\n var uniforms = {\n uSampler: uSampler,\n alpha: 1,\n uTextureMatrix: Matrix.IDENTITY,\n uColor: new Float32Array([1, 1, 1, 1]),\n };\n // Set defaults\n options = Object.assign({\n tint: 0xFFFFFF,\n alpha: 1,\n pluginName: 'batch',\n }, options);\n if (options.uniforms) {\n Object.assign(uniforms, options.uniforms);\n }\n _this = _super.call(this, options.program || Program.from(vertex, fragment), uniforms) || this;\n /**\n * Only do update if tint or alpha changes.\n * @member {boolean}\n * @private\n * @default false\n */\n _this._colorDirty = false;\n /**\n * TextureMatrix instance for this Mesh, used to track Texture changes\n *\n * @member {PIXI.TextureMatrix}\n * @readonly\n */\n _this.uvMatrix = new TextureMatrix(uSampler);\n /**\n * `true` if shader can be batch with the renderer's batch system.\n * @member {boolean}\n * @default true\n */\n _this.batchable = options.program === undefined;\n /**\n * Renderer plugin for batching\n *\n * @member {string}\n * @default 'batch'\n */\n _this.pluginName = options.pluginName;\n _this.tint = options.tint;\n _this.alpha = options.alpha;\n return _this;\n }\n Object.defineProperty(MeshMaterial.prototype, \"texture\", {\n /**\n * Reference to the texture being rendered.\n * @member {PIXI.Texture}\n */\n get: function () {\n return this.uniforms.uSampler;\n },\n set: function (value) {\n if (this.uniforms.uSampler !== value) {\n this.uniforms.uSampler = value;\n this.uvMatrix.texture = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MeshMaterial.prototype, \"alpha\", {\n get: function () {\n return this._alpha;\n },\n /**\n * This gets automatically set by the object using this.\n *\n * @default 1\n * @member {number}\n */\n set: function (value) {\n if (value === this._alpha)\n { return; }\n this._alpha = value;\n this._colorDirty = true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MeshMaterial.prototype, \"tint\", {\n get: function () {\n return this._tint;\n },\n /**\n * Multiply tint for the material.\n * @member {number}\n * @default 0xFFFFFF\n */\n set: function (value) {\n if (value === this._tint)\n { return; }\n this._tint = value;\n this._tintRGB = (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16);\n this._colorDirty = true;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Gets called automatically by the Mesh. Intended to be overridden for custom\n * MeshMaterial objects.\n */\n MeshMaterial.prototype.update = function () {\n if (this._colorDirty) {\n this._colorDirty = false;\n var baseTexture = this.texture.baseTexture;\n premultiplyTintToRgba(this._tint, this._alpha, this.uniforms.uColor, baseTexture.alphaMode);\n }\n if (this.uvMatrix.update()) {\n this.uniforms.uTextureMatrix = this.uvMatrix.mapCoord;\n }\n };\n return MeshMaterial;\n}(Shader));\n\n/**\n * Standard 2D geometry used in PixiJS.\n *\n * Geometry can be defined without passing in a style or data if required.\n *\n * ```js\n * const geometry = new PIXI.Geometry();\n *\n * geometry.addAttribute('positions', [0, 0, 100, 0, 100, 100, 0, 100], 2);\n * geometry.addAttribute('uvs', [0,0,1,0,1,1,0,1], 2);\n * geometry.addIndex([0,1,2,1,3,2]);\n *\n * ```\n * @class\n * @memberof PIXI\n * @extends PIXI.Geometry\n */\nvar MeshGeometry = /** @class */ (function (_super) {\n __extends(MeshGeometry, _super);\n /**\n * @param {Float32Array|number[]} [vertices] - Positional data on geometry.\n * @param {Float32Array|number[]} [uvs] - Texture UVs.\n * @param {Uint16Array|number[]} [index] - IndexBuffer\n */\n function MeshGeometry(vertices, uvs, index) {\n var _this = _super.call(this) || this;\n var verticesBuffer = new Buffer(vertices);\n var uvsBuffer = new Buffer(uvs, true);\n var indexBuffer = new Buffer(index, true, true);\n _this.addAttribute('aVertexPosition', verticesBuffer, 2, false, TYPES.FLOAT)\n .addAttribute('aTextureCoord', uvsBuffer, 2, false, TYPES.FLOAT)\n .addIndex(indexBuffer);\n /**\n * Dirty flag to limit update calls on Mesh. For example,\n * limiting updates on a single Mesh instance with a shared Geometry\n * within the render loop.\n * @private\n * @member {number}\n * @default -1\n */\n _this._updateId = -1;\n return _this;\n }\n Object.defineProperty(MeshGeometry.prototype, \"vertexDirtyId\", {\n /**\n * If the vertex position is updated.\n * @member {number}\n * @readonly\n * @private\n */\n get: function () {\n return this.buffers[0]._updateID;\n },\n enumerable: false,\n configurable: true\n });\n return MeshGeometry;\n}(Geometry));\n\nexport { Mesh, MeshBatchUvs, MeshGeometry, MeshMaterial };\n//# sourceMappingURL=mesh.es.js.map\n","/*!\n * @pixi/text-bitmap - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/text-bitmap is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Rectangle, ObservablePoint, Point } from '@pixi/math';\nimport { settings } from '@pixi/settings';\nimport { MeshGeometry, MeshMaterial, Mesh } from '@pixi/mesh';\nimport { hex2rgb, string2hex, getResolutionOfUrl, deprecation, removeItems } from '@pixi/utils';\nimport { Texture, BaseTexture } from '@pixi/core';\nimport { TEXT_GRADIENT, TextStyle, TextMetrics } from '@pixi/text';\nimport { Container } from '@pixi/display';\nimport { LoaderResource } from '@pixi/loaders';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/* eslint-disable max-len */\n/**\n * Normalized parsed data from .fnt files.\n *\n * @class\n * @memberof PIXI\n */\nvar BitmapFontData = /** @class */ (function () {\n function BitmapFontData() {\n /**\n * @member {PIXI.IBitmapFontDataInfo[]}\n * @readOnly\n */\n this.info = [];\n /**\n * @member {PIXI.IBitmapFontDataCommon[]}\n * @readOnly\n */\n this.common = [];\n /**\n * @member {PIXI.IBitmapFontDataPage[]}\n * @readOnly\n */\n this.page = [];\n /**\n * @member {PIXI.IBitmapFontDataChar[]}\n * @readOnly\n */\n this.char = [];\n /**\n * @member {PIXI.IBitmapFontDataKerning[]}\n * @readOnly\n */\n this.kerning = [];\n }\n return BitmapFontData;\n}());\n/**\n * @memberof PIXI\n * @typedef {object} IBitmapFontDataInfo\n * @property {string} face\n * @property {number} size\n */\n/**\n * @memberof PIXI\n * @typedef {object} IBitmapFontDataCommon\n * @property {number} lineHeight\n */\n/**\n * @memberof PIXI\n * @typedef {object} IBitmapFontDataPage\n * @property {number} id\n * @property {string} file\n */\n/**\n * @memberof PIXI\n * @typedef {object} IBitmapFontDataChar\n * @property {string} id\n * @property {number} page\n * @property {number} x\n * @property {number} y\n * @property {number} width\n * @property {number} height\n * @property {number} xoffset\n * @property {number} yoffset\n * @property {number} xadvance\n */\n/**\n * @memberof PIXI\n * @typedef {object} IBitmapFontDataKerning\n * @property {number} first\n * @property {number} second\n * @property {number} amount\n */\n\n/**\n * BitmapFont format that's Text-based.\n *\n * @class\n * @private\n */\nvar TextFormat = /** @class */ (function () {\n function TextFormat() {\n }\n /**\n * Check if resource refers to txt font data.\n *\n * @static\n * @private\n * @param {any} data\n * @return {boolean} True if resource could be treated as font data, false otherwise.\n */\n TextFormat.test = function (data) {\n return typeof data === 'string' && data.indexOf('info face=') === 0;\n };\n /**\n * Convert text font data to a javascript object.\n *\n * @static\n * @private\n * @param {string} txt - Raw string data to be converted\n * @return {PIXI.BitmapFontData} Parsed font data\n */\n TextFormat.parse = function (txt) {\n // Retrieve data item\n var items = txt.match(/^[a-z]+\\s+.+$/gm);\n var rawData = {\n info: [],\n common: [],\n page: [],\n char: [],\n chars: [],\n kerning: [],\n kernings: [],\n };\n for (var i in items) {\n // Extract item name\n var name = items[i].match(/^[a-z]+/gm)[0];\n // Extract item attribute list as string ex.: \"width=10\"\n var attributeList = items[i].match(/[a-zA-Z]+=([^\\s\"']+|\"([^\"]*)\")/gm);\n // Convert attribute list into an object\n var itemData = {};\n for (var i_1 in attributeList) {\n // Split key-value pairs\n var split = attributeList[i_1].split('=');\n var key = split[0];\n // Remove eventual quotes from value\n var strValue = split[1].replace(/\"/gm, '');\n // Try to convert value into float\n var floatValue = parseFloat(strValue);\n // Use string value case float value is NaN\n var value = isNaN(floatValue) ? strValue : floatValue;\n itemData[key] = value;\n }\n // Push current item to the resulting data\n rawData[name].push(itemData);\n }\n var font = new BitmapFontData();\n rawData.info.forEach(function (info) { return font.info.push({\n face: info.face,\n size: parseInt(info.size, 10),\n }); });\n rawData.common.forEach(function (common) { return font.common.push({\n lineHeight: parseInt(common.lineHeight, 10),\n }); });\n rawData.page.forEach(function (page) { return font.page.push({\n id: parseInt(page.id, 10),\n file: page.file,\n }); });\n rawData.char.forEach(function (char) { return font.char.push({\n id: parseInt(char.id, 10),\n page: parseInt(char.page, 10),\n x: parseInt(char.x, 10),\n y: parseInt(char.y, 10),\n width: parseInt(char.width, 10),\n height: parseInt(char.height, 10),\n xoffset: parseInt(char.xoffset, 10),\n yoffset: parseInt(char.yoffset, 10),\n xadvance: parseInt(char.xadvance, 10),\n }); });\n rawData.kerning.forEach(function (kerning) { return font.kerning.push({\n first: parseInt(kerning.first, 10),\n second: parseInt(kerning.second, 10),\n amount: parseInt(kerning.amount, 10),\n }); });\n return font;\n };\n return TextFormat;\n}());\n\n/**\n * BitmapFont format that's XML-based.\n *\n * @class\n * @private\n */\nvar XMLFormat = /** @class */ (function () {\n function XMLFormat() {\n }\n /**\n * Check if resource refers to xml font data.\n *\n * @static\n * @private\n * @param {any} data\n * @return {boolean} True if resource could be treated as font data, false otherwise.\n */\n XMLFormat.test = function (data) {\n return data instanceof XMLDocument\n && data.getElementsByTagName('page').length\n && data.getElementsByTagName('info')[0].getAttribute('face') !== null;\n };\n /**\n * Convert the XML into BitmapFontData that we can use.\n *\n * @static\n * @private\n * @param {XMLDocument} xml\n * @return {BitmapFontData} Data to use for BitmapFont\n */\n XMLFormat.parse = function (xml) {\n var data = new BitmapFontData();\n var info = xml.getElementsByTagName('info');\n var common = xml.getElementsByTagName('common');\n var page = xml.getElementsByTagName('page');\n var char = xml.getElementsByTagName('char');\n var kerning = xml.getElementsByTagName('kerning');\n for (var i = 0; i < info.length; i++) {\n data.info.push({\n face: info[i].getAttribute('face'),\n size: parseInt(info[i].getAttribute('size'), 10),\n });\n }\n for (var i = 0; i < common.length; i++) {\n data.common.push({\n lineHeight: parseInt(common[i].getAttribute('lineHeight'), 10),\n });\n }\n for (var i = 0; i < page.length; i++) {\n data.page.push({\n id: parseInt(page[i].getAttribute('id'), 10) || 0,\n file: page[i].getAttribute('file'),\n });\n }\n for (var i = 0; i < char.length; i++) {\n var letter = char[i];\n data.char.push({\n id: parseInt(letter.getAttribute('id'), 10),\n page: parseInt(letter.getAttribute('page'), 10) || 0,\n x: parseInt(letter.getAttribute('x'), 10),\n y: parseInt(letter.getAttribute('y'), 10),\n width: parseInt(letter.getAttribute('width'), 10),\n height: parseInt(letter.getAttribute('height'), 10),\n xoffset: parseInt(letter.getAttribute('xoffset'), 10),\n yoffset: parseInt(letter.getAttribute('yoffset'), 10),\n xadvance: parseInt(letter.getAttribute('xadvance'), 10),\n });\n }\n for (var i = 0; i < kerning.length; i++) {\n data.kerning.push({\n first: parseInt(kerning[i].getAttribute('first'), 10),\n second: parseInt(kerning[i].getAttribute('second'), 10),\n amount: parseInt(kerning[i].getAttribute('amount'), 10),\n });\n }\n return data;\n };\n return XMLFormat;\n}());\n\n/**\n * BitmapFont format that's XML-based.\n *\n * @class\n * @private\n */\nvar XMLStringFormat = /** @class */ (function () {\n function XMLStringFormat() {\n }\n /**\n * Check if resource refers to text xml font data.\n *\n * @static\n * @private\n * @param {any} data\n * @return {boolean} True if resource could be treated as font data, false otherwise.\n */\n XMLStringFormat.test = function (data) {\n if (typeof data === 'string' && data.indexOf('') > -1) {\n var xml = new self.DOMParser().parseFromString(data, 'text/xml');\n return XMLFormat.test(xml);\n }\n return false;\n };\n /**\n * Convert the text XML into BitmapFontData that we can use.\n *\n * @static\n * @private\n * @param {string} xmlTxt\n * @return {BitmapFontData} Data to use for BitmapFont\n */\n XMLStringFormat.parse = function (xmlTxt) {\n var xml = new window.DOMParser().parseFromString(xmlTxt, 'text/xml');\n return XMLFormat.parse(xml);\n };\n return XMLStringFormat;\n}());\n\n// Registered formats, maybe make this extensible in the future?\nvar formats = [\n TextFormat,\n XMLFormat,\n XMLStringFormat ];\n/**\n * Auto-detect BitmapFont parsing format based on data.\n * @private\n * @param {any} data - Data to detect format\n * @return {any} Format or null\n */\nfunction autoDetectFormat(data) {\n for (var i = 0; i < formats.length; i++) {\n if (formats[i].test(data)) {\n return formats[i];\n }\n }\n return null;\n}\n\n// TODO: Prevent code duplication b/w generateFillStyle & Text#generateFillStyle\n/**\n * Generates the fill style. Can automatically generate a gradient based on the fill style being an array\n *\n * @private\n * @param {object} style - The style.\n * @param {string[]} lines - The lines of text.\n * @return {string|number|CanvasGradient} The fill style\n */\nfunction generateFillStyle(canvas, context, style, resolution, lines, metrics) {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n var fillStyle = style.fill;\n if (!Array.isArray(fillStyle)) {\n return fillStyle;\n }\n else if (fillStyle.length === 1) {\n return fillStyle[0];\n }\n // the gradient will be evenly spaced out according to how large the array is.\n // ['#FF0000', '#00FF00', '#0000FF'] would created stops at 0.25, 0.5 and 0.75\n var gradient;\n // a dropshadow will enlarge the canvas and result in the gradient being\n // generated with the incorrect dimensions\n var dropShadowCorrection = (style.dropShadow) ? style.dropShadowDistance : 0;\n // should also take padding into account, padding can offset the gradient\n var padding = style.padding || 0;\n var width = Math.ceil(canvas.width / resolution) - dropShadowCorrection - (padding * 2);\n var height = Math.ceil(canvas.height / resolution) - dropShadowCorrection - (padding * 2);\n // make a copy of the style settings, so we can manipulate them later\n var fill = fillStyle.slice();\n var fillGradientStops = style.fillGradientStops.slice();\n // wanting to evenly distribute the fills. So an array of 4 colours should give fills of 0.25, 0.5 and 0.75\n if (!fillGradientStops.length) {\n var lengthPlus1 = fill.length + 1;\n for (var i = 1; i < lengthPlus1; ++i) {\n fillGradientStops.push(i / lengthPlus1);\n }\n }\n // stop the bleeding of the last gradient on the line above to the top gradient of the this line\n // by hard defining the first gradient colour at point 0, and last gradient colour at point 1\n fill.unshift(fillStyle[0]);\n fillGradientStops.unshift(0);\n fill.push(fillStyle[fillStyle.length - 1]);\n fillGradientStops.push(1);\n if (style.fillGradientType === TEXT_GRADIENT.LINEAR_VERTICAL) {\n // start the gradient at the top center of the canvas, and end at the bottom middle of the canvas\n gradient = context.createLinearGradient(width / 2, padding, width / 2, height + padding);\n // we need to repeat the gradient so that each individual line of text has the same vertical gradient effect\n // ['#FF0000', '#00FF00', '#0000FF'] over 2 lines would create stops at 0.125, 0.25, 0.375, 0.625, 0.75, 0.875\n // There's potential for floating point precision issues at the seams between gradient repeats.\n // The loop below generates the stops in order, so track the last generated one to prevent\n // floating point precision from making us go the teeniest bit backwards, resulting in\n // the first and last colors getting swapped.\n var lastIterationStop = 0;\n // Actual height of the text itself, not counting spacing for lineHeight/leading/dropShadow etc\n var textHeight = metrics.fontProperties.fontSize + style.strokeThickness;\n // textHeight, but as a 0-1 size in global gradient stop space\n var gradStopLineHeight = textHeight / height;\n for (var i = 0; i < lines.length; i++) {\n var thisLineTop = metrics.lineHeight * i;\n for (var j = 0; j < fill.length; j++) {\n // 0-1 stop point for the current line, multiplied to global space afterwards\n var lineStop = 0;\n if (typeof fillGradientStops[j] === 'number') {\n lineStop = fillGradientStops[j];\n }\n else {\n lineStop = j / fill.length;\n }\n var globalStop = (thisLineTop / height) + (lineStop * gradStopLineHeight);\n // Prevent color stop generation going backwards from floating point imprecision\n var clampedStop = Math.max(lastIterationStop, globalStop);\n clampedStop = Math.min(clampedStop, 1); // Cap at 1 as well for safety's sake to avoid a possible throw.\n gradient.addColorStop(clampedStop, fill[j]);\n lastIterationStop = clampedStop;\n }\n }\n }\n else {\n // start the gradient at the center left of the canvas, and end at the center right of the canvas\n gradient = context.createLinearGradient(padding, height / 2, width + padding, height / 2);\n // can just evenly space out the gradients in this case, as multiple lines makes no difference\n // to an even left to right gradient\n var totalIterations = fill.length + 1;\n var currentIteration = 1;\n for (var i = 0; i < fill.length; i++) {\n var stop = void 0;\n if (typeof fillGradientStops[i] === 'number') {\n stop = fillGradientStops[i];\n }\n else {\n stop = currentIteration / totalIterations;\n }\n gradient.addColorStop(stop, fill[i]);\n currentIteration++;\n }\n }\n return gradient;\n}\n\n// TODO: Prevent code duplication b/w drawGlyph & Text#updateText\n/**\n * Draws the glyph `metrics.text` on the given canvas.\n *\n * Ignored because not directly exposed.\n *\n * @ignore\n * @param {HTMLCanvasElement} canvas\n * @param {CanvasRenderingContext2D} context\n * @param {TextMetrics} metrics\n * @param {number} x\n * @param {number} y\n * @param {number} resolution\n * @param {TextStyle} style\n */\nfunction drawGlyph(canvas, context, metrics, x, y, resolution, style) {\n var char = metrics.text;\n var fontProperties = metrics.fontProperties;\n context.translate(x, y);\n context.scale(resolution, resolution);\n var tx = style.strokeThickness / 2;\n var ty = -(style.strokeThickness / 2);\n context.font = style.toFontString();\n context.lineWidth = style.strokeThickness;\n context.textBaseline = style.textBaseline;\n context.lineJoin = style.lineJoin;\n context.miterLimit = style.miterLimit;\n // set canvas text styles\n context.fillStyle = generateFillStyle(canvas, context, style, resolution, [char], metrics);\n context.strokeStyle = style.stroke;\n context.font = style.toFontString();\n context.lineWidth = style.strokeThickness;\n context.textBaseline = style.textBaseline;\n context.lineJoin = style.lineJoin;\n context.miterLimit = style.miterLimit;\n // set canvas text styles\n context.fillStyle = generateFillStyle(canvas, context, style, resolution, [char], metrics);\n context.strokeStyle = style.stroke;\n var dropShadowColor = style.dropShadowColor;\n var rgb = hex2rgb(typeof dropShadowColor === 'number' ? dropShadowColor : string2hex(dropShadowColor));\n if (style.dropShadow) {\n context.shadowColor = \"rgba(\" + rgb[0] * 255 + \",\" + rgb[1] * 255 + \",\" + rgb[2] * 255 + \",\" + style.dropShadowAlpha + \")\";\n context.shadowBlur = style.dropShadowBlur;\n context.shadowOffsetX = Math.cos(style.dropShadowAngle) * style.dropShadowDistance;\n context.shadowOffsetY = Math.sin(style.dropShadowAngle) * style.dropShadowDistance;\n }\n else {\n context.shadowColor = 'black';\n context.shadowBlur = 0;\n context.shadowOffsetX = 0;\n context.shadowOffsetY = 0;\n }\n if (style.stroke && style.strokeThickness) {\n context.strokeText(char, tx, ty + metrics.lineHeight - fontProperties.descent);\n }\n if (style.fill) {\n context.fillText(char, tx, ty + metrics.lineHeight - fontProperties.descent);\n }\n context.setTransform(1, 0, 0, 1, 0, 0); // defaults needed for older browsers (e.g. Opera 29)\n context.fillStyle = 'rgba(0, 0, 0, 0)';\n}\n\n/**\n * Processes the passed character set data and returns a flattened array of all the characters.\n *\n * Ignored because not directly exposed.\n *\n * @ignore\n * @param {string | string[] | string[][] } chars\n * @returns {string[]}\n */\nfunction resolveCharacters(chars) {\n // Split the chars string into individual characters\n if (typeof chars === 'string') {\n chars = [chars];\n }\n // Handle an array of characters+ranges\n var result = [];\n for (var i = 0, j = chars.length; i < j; i++) {\n var item = chars[i];\n // Handle range delimited by start/end chars\n if (Array.isArray(item)) {\n if (item.length !== 2) {\n throw new Error(\"[BitmapFont]: Invalid character range length, expecting 2 got \" + item.length + \".\");\n }\n var startCode = item[0].charCodeAt(0);\n var endCode = item[1].charCodeAt(0);\n if (endCode < startCode) {\n throw new Error('[BitmapFont]: Invalid character range.');\n }\n for (var i_1 = startCode, j_1 = endCode; i_1 <= j_1; i_1++) {\n result.push(String.fromCharCode(i_1));\n }\n }\n // Handle a character set string\n else {\n result.push.apply(result, item.split(''));\n }\n }\n if (result.length === 0) {\n throw new Error('[BitmapFont]: Empty set when resolving characters.');\n }\n return result;\n}\n\n/**\n * BitmapFont represents a typeface available for use with the BitmapText class. Use the `install`\n * method for adding a font to be used.\n *\n * @class\n * @memberof PIXI\n */\nvar BitmapFont = /** @class */ (function () {\n /**\n * @param {PIXI.BitmapFontData} data\n * @param {PIXI.Texture[]|Object.} textures\n */\n function BitmapFont(data, textures) {\n var info = data.info[0];\n var common = data.common[0];\n var page = data.page[0];\n var res = getResolutionOfUrl(page.file);\n var pageTextures = {};\n /**\n * The name of the font face.\n *\n * @member {string}\n * @readonly\n */\n this.font = info.face;\n /**\n * The size of the font face in pixels.\n *\n * @member {number}\n * @readonly\n */\n this.size = info.size;\n /**\n * The line-height of the font face in pixels.\n *\n * @member {number}\n * @readonly\n */\n this.lineHeight = common.lineHeight / res;\n /**\n * The map of characters by character code.\n *\n * @member {object}\n * @readonly\n */\n this.chars = {};\n /**\n * The map of base page textures (i.e., sheets of glyphs).\n *\n * @member {object}\n * @readonly\n * @private\n */\n this.pageTextures = pageTextures;\n // Convert the input Texture, Textures or object\n // into a page Texture lookup by \"id\"\n for (var i = 0; i < data.page.length; i++) {\n var _a = data.page[i], id = _a.id, file = _a.file;\n pageTextures[id] = textures instanceof Array\n ? textures[i] : textures[file];\n }\n // parse letters\n for (var i = 0; i < data.char.length; i++) {\n var _b = data.char[i], id = _b.id, page_1 = _b.page;\n var _c = data.char[i], x = _c.x, y = _c.y, width = _c.width, height = _c.height, xoffset = _c.xoffset, yoffset = _c.yoffset, xadvance = _c.xadvance;\n x /= res;\n y /= res;\n width /= res;\n height /= res;\n xoffset /= res;\n yoffset /= res;\n xadvance /= res;\n var rect = new Rectangle(x + (pageTextures[page_1].frame.x / res), y + (pageTextures[page_1].frame.y / res), width, height);\n this.chars[id] = {\n xOffset: xoffset,\n yOffset: yoffset,\n xAdvance: xadvance,\n kerning: {},\n texture: new Texture(pageTextures[page_1].baseTexture, rect),\n page: page_1,\n };\n }\n // parse kernings\n for (var i = 0; i < data.kerning.length; i++) {\n var _d = data.kerning[i], first = _d.first, second = _d.second, amount = _d.amount;\n first /= res;\n second /= res;\n amount /= res;\n if (this.chars[second]) {\n this.chars[second].kerning[first] = amount;\n }\n }\n }\n /**\n * Remove references to created glyph textures.\n */\n BitmapFont.prototype.destroy = function () {\n for (var id in this.chars) {\n this.chars[id].texture.destroy();\n this.chars[id].texture = null;\n }\n for (var id in this.pageTextures) {\n this.pageTextures[id].destroy(true);\n this.pageTextures[id] = null;\n }\n // Set readonly null.\n this.chars = null;\n this.pageTextures = null;\n };\n /**\n * Register a new bitmap font.\n *\n * @static\n * @param {XMLDocument|string|PIXI.BitmapFontData} data - The\n * characters map that could be provided as xml or raw string.\n * @param {Object.|PIXI.Texture|PIXI.Texture[]}\n * textures - List of textures for each page.\n * @return {PIXI.BitmapFont} Result font object with font, size, lineHeight\n * and char fields.\n */\n BitmapFont.install = function (data, textures) {\n var fontData;\n if (data instanceof BitmapFontData) {\n fontData = data;\n }\n else {\n var format = autoDetectFormat(data);\n if (!format) {\n throw new Error('Unrecognized data format for font.');\n }\n fontData = format.parse(data);\n }\n // Single texture, convert to list\n if (textures instanceof Texture) {\n textures = [textures];\n }\n var font = new BitmapFont(fontData, textures);\n BitmapFont.available[font.font] = font;\n return font;\n };\n /**\n * Remove bitmap font by name.\n *\n * @static\n * @param {string} name\n */\n BitmapFont.uninstall = function (name) {\n var font = BitmapFont.available[name];\n if (!font) {\n throw new Error(\"No font found named '\" + name + \"'\");\n }\n font.destroy();\n delete BitmapFont.available[name];\n };\n /**\n * Generates a bitmap-font for the given style and character set. This does not support\n * kernings yet. With `style` properties, only the following non-layout properties are used:\n *\n * - {@link PIXI.TextStyle#dropShadow|dropShadow}\n * - {@link PIXI.TextStyle#dropShadowDistance|dropShadowDistance}\n * - {@link PIXI.TextStyle#dropShadowColor|dropShadowColor}\n * - {@link PIXI.TextStyle#dropShadowBlur|dropShadowBlur}\n * - {@link PIXI.TextStyle#dropShadowAngle|dropShadowAngle}\n * - {@link PIXI.TextStyle#fill|fill}\n * - {@link PIXI.TextStyle#fillGradientStops|fillGradientStops}\n * - {@link PIXI.TextStyle#fillGradientType|fillGradientType}\n * - {@link PIXI.TextStyle#fontFamily|fontFamily}\n * - {@link PIXI.TextStyle#fontSize|fontSize}\n * - {@link PIXI.TextStyle#fontVariant|fontVariant}\n * - {@link PIXI.TextStyle#fontWeight|fontWeight}\n * - {@link PIXI.TextStyle#lineJoin|lineJoin}\n * - {@link PIXI.TextStyle#miterLimit|miterLimit}\n * - {@link PIXI.TextStyle#stroke|stroke}\n * - {@link PIXI.TextStyle#strokeThickness|strokeThickness}\n * - {@link PIXI.TextStyle#textBaseline|textBaseline}\n *\n * @param {string} name - The name of the custom font to use with BitmapText.\n * @param {object|PIXI.TextStyle} [style] - Style options to render with BitmapFont.\n * @param {PIXI.IBitmapFontOptions} [options] - Setup options for font or name of the font.\n * @param {string|string[]|string[][]} [options.chars=PIXI.BitmapFont.ALPHANUMERIC] - characters included\n * in the font set. You can also use ranges. For example, `[['a', 'z'], ['A', 'Z'], \"!@#$%^&*()~{}[] \"]`.\n * Don't forget to include spaces ' ' in your character set!\n * @param {number} [options.resolution=1] - Render resolution for glyphs.\n * @param {number} [options.textureWidth=512] - Optional width of atlas, smaller values to reduce memory.\n * @param {number} [options.textureHeight=512] - Optional height of atlas, smaller values to reduce memory.\n * @param {number} [options.padding=4] - Padding between glyphs on texture atlas.\n * @return {PIXI.BitmapFont} Font generated by style options.\n * @static\n * @example\n * PIXI.BitmapFont.from(\"TitleFont\", {\n * fontFamily: \"Arial\",\n * fontSize: 12,\n * strokeThickness: 2,\n * fill: \"purple\"\n * });\n *\n * const title = new PIXI.BitmapText(\"This is the title\", { fontName: \"TitleFont\" });\n */\n BitmapFont.from = function (name, textStyle, options) {\n if (!name) {\n throw new Error('[BitmapFont] Property `name` is required.');\n }\n var _a = Object.assign({}, BitmapFont.defaultOptions, options), chars = _a.chars, padding = _a.padding, resolution = _a.resolution, textureWidth = _a.textureWidth, textureHeight = _a.textureHeight;\n var charsList = resolveCharacters(chars);\n var style = textStyle instanceof TextStyle ? textStyle : new TextStyle(textStyle);\n var lineWidth = textureWidth;\n var fontData = new BitmapFontData();\n fontData.info[0] = {\n face: style.fontFamily,\n size: style.fontSize,\n };\n fontData.common[0] = {\n lineHeight: style.fontSize,\n };\n var positionX = 0;\n var positionY = 0;\n var canvas;\n var context;\n var baseTexture;\n var maxCharHeight = 0;\n var textures = [];\n for (var i = 0; i < charsList.length; i++) {\n if (!canvas) {\n canvas = document.createElement('canvas');\n canvas.width = textureWidth;\n canvas.height = textureHeight;\n context = canvas.getContext('2d');\n baseTexture = new BaseTexture(canvas, { resolution: resolution });\n textures.push(new Texture(baseTexture));\n fontData.page.push({\n id: textures.length - 1,\n file: '',\n });\n }\n // Measure glyph dimensions\n var metrics = TextMetrics.measureText(charsList[i], style, false, canvas);\n var width = metrics.width;\n var height = Math.ceil(metrics.height);\n // This is ugly - but italics are given more space so they don't overlap\n var textureGlyphWidth = Math.ceil((style.fontStyle === 'italic' ? 2 : 1) * width);\n // Can't fit char anymore: next canvas please!\n if (positionY >= textureHeight - (height * resolution)) {\n if (positionY === 0) {\n // We don't want user debugging an infinite loop (or do we? :)\n throw new Error(\"[BitmapFont] textureHeight \" + textureHeight + \"px is \"\n + (\"too small for \" + style.fontSize + \"px fonts\"));\n }\n --i;\n // Create new atlas once current has filled up\n canvas = null;\n context = null;\n baseTexture = null;\n positionY = 0;\n positionX = 0;\n maxCharHeight = 0;\n continue;\n }\n maxCharHeight = Math.max(height + metrics.fontProperties.descent, maxCharHeight);\n // Wrap line once full row has been rendered\n if ((textureGlyphWidth * resolution) + positionX >= lineWidth) {\n --i;\n positionY += maxCharHeight * resolution;\n positionY = Math.ceil(positionY);\n positionX = 0;\n maxCharHeight = 0;\n continue;\n }\n drawGlyph(canvas, context, metrics, positionX, positionY, resolution, style);\n // Unique (numeric) ID mapping to this glyph\n var id = metrics.text.charCodeAt(0);\n // Create a texture holding just the glyph\n fontData.char.push({\n id: id,\n page: textures.length - 1,\n x: positionX / resolution,\n y: positionY / resolution,\n width: textureGlyphWidth,\n height: height,\n xoffset: 0,\n yoffset: 0,\n xadvance: Math.ceil(width\n - (style.dropShadow ? style.dropShadowDistance : 0)\n - (style.stroke ? style.strokeThickness : 0)),\n });\n positionX += (textureGlyphWidth + (2 * padding)) * resolution;\n positionX = Math.ceil(positionX);\n }\n var font = new BitmapFont(fontData, textures);\n // Make it easier to replace a font\n if (BitmapFont.available[name] !== undefined) {\n BitmapFont.uninstall(name);\n }\n BitmapFont.available[name] = font;\n return font;\n };\n /**\n * This character set includes all the letters in the alphabet (both lower- and upper- case).\n * @readonly\n * @static\n * @member {string[][]}\n * @example\n * BitmapFont.from(\"ExampleFont\", style, { chars: BitmapFont.ALPHA })\n */\n BitmapFont.ALPHA = [['a', 'z'], ['A', 'Z'], ' '];\n /**\n * This character set includes all decimal digits (from 0 to 9).\n * @readonly\n * @static\n * @member {string[][]}\n * @example\n * BitmapFont.from(\"ExampleFont\", style, { chars: BitmapFont.NUMERIC })\n */\n BitmapFont.NUMERIC = [['0', '9']];\n /**\n * This character set is the union of `BitmapFont.ALPHA` and `BitmapFont.NUMERIC`.\n * @readonly\n * @static\n * @member {string[][]}\n */\n BitmapFont.ALPHANUMERIC = [['a', 'z'], ['A', 'Z'], ['0', '9'], ' '];\n /**\n * This character set consists of all the ASCII table.\n * @readonly\n * @static\n * @member {string[][]}\n * @see http://www.asciitable.com/\n */\n BitmapFont.ASCII = [[' ', '~']];\n /**\n * Collection of default options when using `BitmapFont.from`.\n *\n * @readonly\n * @static\n * @member {PIXI.IBitmapFontOptions}\n * @property {number} resolution=1\n * @property {number} textureWidth=512\n * @property {number} textureHeight=512\n * @property {number} padding=4\n * @property {string|string[]|string[][]} chars=PIXI.BitmapFont.ALPHANUMERIC\n */\n BitmapFont.defaultOptions = {\n resolution: 1,\n textureWidth: 512,\n textureHeight: 512,\n padding: 4,\n chars: BitmapFont.ALPHANUMERIC,\n };\n /**\n * Collection of available/installed fonts.\n *\n * @readonly\n * @static\n * @member {Object.}\n */\n BitmapFont.available = {};\n return BitmapFont;\n}());\n/**\n * @memberof PIXI\n * @interface IBitmapFontOptions\n * @property {string | string[] | string[][]} [chars=PIXI.BitmapFont.ALPHANUMERIC] - the character set to generate\n * @property {number} [resolution=1] - the resolution for rendering\n * @property {number} [padding=4] - the padding between glyphs in the atlas\n * @property {number} [textureWidth=512] - the width of the texture atlas\n * @property {number} [textureHeight=512] - the height of the texture atlas\n */\n\nvar pageMeshDataPool = [];\nvar charRenderDataPool = [];\n/**\n * A BitmapText object will create a line or multiple lines of text using bitmap font.\n *\n * The primary advantage of this class over Text is that all of your textures are pre-generated and loading,\n * meaning that rendering is fast, and changing text has no performance implications.\n *\n * Supporting character sets other than latin, such as CJK languages, may be impractical due to the number of characters.\n *\n * To split a line you can use '\\n', '\\r' or '\\r\\n' in your string.\n *\n * PixiJS can auto-generate fonts on-the-fly using BitmapFont or use fnt files provided by:\n * http://www.angelcode.com/products/bmfont/ for Windows or\n * http://www.bmglyph.com/ for Mac.\n *\n * A BitmapText can only be created when the font is loaded.\n *\n * ```js\n * // in this case the font is in a file called 'desyrel.fnt'\n * let bitmapText = new PIXI.BitmapText(\"text using a fancy font!\", {font: \"35px Desyrel\", align: \"right\"});\n * ```\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI\n */\nvar BitmapText = /** @class */ (function (_super) {\n __extends(BitmapText, _super);\n /**\n * @param {string} text - A string that you would like the text to display.\n * @param {object} style - The style parameters.\n * @param {string} style.fontName - The installed BitmapFont name.\n * @param {number} [style.fontSize] - The size of the font in pixels, e.g. 24. If undefined,\n *. this will default to the BitmapFont size.\n * @param {string} [style.align='left'] - Alignment for multiline text ('left', 'center' or 'right'),\n * does not affect single line text.\n * @param {number} [style.tint=0xFFFFFF] - The tint color.\n * @param {number} [style.letterSpacing=0] - The amount of spacing between letters.\n * @param {number} [style.maxWidth=0] - The max width of the text before line wrapping.\n */\n function BitmapText(text, style) {\n if (style === void 0) { style = {}; }\n var _this = _super.call(this) || this;\n _this._tint = 0xFFFFFF;\n if (style.font) {\n deprecation('5.3.0', 'PIXI.BitmapText constructor style.font property is deprecated.');\n _this._upgradeStyle(style);\n }\n // Apply the defaults\n var _a = Object.assign({}, BitmapText.styleDefaults, style), align = _a.align, tint = _a.tint, maxWidth = _a.maxWidth, letterSpacing = _a.letterSpacing, fontName = _a.fontName, fontSize = _a.fontSize;\n if (!BitmapFont.available[fontName]) {\n throw new Error(\"Missing BitmapFont \\\"\" + fontName + \"\\\"\");\n }\n /**\n * Collection of page mesh data.\n *\n * @member {object}\n * @private\n */\n _this._activePagesMeshData = [];\n /**\n * Private tracker for the width of the overall text\n *\n * @member {number}\n * @private\n */\n _this._textWidth = 0;\n /**\n * Private tracker for the height of the overall text\n *\n * @member {number}\n * @private\n */\n _this._textHeight = 0;\n /**\n * Private tracker for the current text align.\n *\n * @member {string}\n * @private\n */\n _this._align = align;\n /**\n * Private tracker for the current tint.\n *\n * @member {number}\n * @private\n */\n _this._tint = tint;\n /**\n * Private tracker for the current font name.\n *\n * @member {string}\n * @private\n */\n _this._fontName = fontName;\n /**\n * Private tracker for the current font size.\n *\n * @member {number}\n * @private\n */\n _this._fontSize = fontSize || BitmapFont.available[fontName].size;\n /**\n * Private tracker for the current text.\n *\n * @member {string}\n * @private\n */\n _this._text = text;\n /**\n * The max width of this bitmap text in pixels. If the text provided is longer than the\n * value provided, line breaks will be automatically inserted in the last whitespace.\n * Disable by setting value to 0\n *\n * @member {number}\n * @private\n */\n _this._maxWidth = maxWidth;\n /**\n * The max line height. This is useful when trying to use the total height of the Text,\n * ie: when trying to vertically align. (Internally used)\n *\n * @member {number}\n * @private\n */\n _this._maxLineHeight = 0;\n /**\n * Letter spacing. This is useful for setting the space between characters.\n * @member {number}\n * @private\n */\n _this._letterSpacing = letterSpacing;\n /**\n * Text anchor. read-only\n *\n * @member {PIXI.ObservablePoint}\n * @private\n */\n _this._anchor = new ObservablePoint(function () { _this.dirty = true; }, _this, 0, 0);\n /**\n * If true PixiJS will Math.floor() x/y values when rendering\n *\n * @member {boolean}\n * @default PIXI.settings.ROUND_PIXELS\n */\n _this._roundPixels = settings.ROUND_PIXELS;\n /**\n * Set to `true` if the BitmapText needs to be redrawn.\n *\n * @member {boolean}\n */\n _this.dirty = true;\n /**\n * Cached char texture is destroyed when BitmapText is destroyed\n * @member {Record}\n * @private\n */\n _this._textureCache = {};\n return _this;\n }\n /**\n * Renders text and updates it when needed. This should only be called\n * if the BitmapFont is regenerated.\n */\n BitmapText.prototype.updateText = function () {\n var _a;\n var data = BitmapFont.available[this._fontName];\n var scale = this._fontSize / data.size;\n var pos = new Point();\n var chars = [];\n var lineWidths = [];\n var text = this._text.replace(/(?:\\r\\n|\\r)/g, '\\n') || ' ';\n var textLength = text.length;\n var maxWidth = this._maxWidth * data.size / this._fontSize;\n var prevCharCode = null;\n var lastLineWidth = 0;\n var maxLineWidth = 0;\n var line = 0;\n var lastBreakPos = -1;\n var lastBreakWidth = 0;\n var spacesRemoved = 0;\n var maxLineHeight = 0;\n for (var i = 0; i < textLength; i++) {\n var charCode = text.charCodeAt(i);\n var char = text.charAt(i);\n if ((/(?:\\s)/).test(char)) {\n lastBreakPos = i;\n lastBreakWidth = lastLineWidth;\n }\n if (char === '\\r' || char === '\\n') {\n lineWidths.push(lastLineWidth);\n maxLineWidth = Math.max(maxLineWidth, lastLineWidth);\n ++line;\n ++spacesRemoved;\n pos.x = 0;\n pos.y += data.lineHeight;\n prevCharCode = null;\n continue;\n }\n var charData = data.chars[charCode];\n if (!charData) {\n continue;\n }\n if (prevCharCode && charData.kerning[prevCharCode]) {\n pos.x += charData.kerning[prevCharCode];\n }\n var charRenderData = charRenderDataPool.pop() || {\n texture: Texture.EMPTY,\n line: 0,\n charCode: 0,\n position: new Point(),\n };\n charRenderData.texture = charData.texture;\n charRenderData.line = line;\n charRenderData.charCode = charCode;\n charRenderData.position.x = pos.x + charData.xOffset + (this._letterSpacing / 2);\n charRenderData.position.y = pos.y + charData.yOffset;\n chars.push(charRenderData);\n pos.x += charData.xAdvance + this._letterSpacing;\n lastLineWidth = pos.x;\n maxLineHeight = Math.max(maxLineHeight, (charData.yOffset + charData.texture.height));\n prevCharCode = charCode;\n if (lastBreakPos !== -1 && maxWidth > 0 && pos.x > maxWidth) {\n ++spacesRemoved;\n removeItems(chars, 1 + lastBreakPos - spacesRemoved, 1 + i - lastBreakPos);\n i = lastBreakPos;\n lastBreakPos = -1;\n lineWidths.push(lastBreakWidth);\n maxLineWidth = Math.max(maxLineWidth, lastBreakWidth);\n line++;\n pos.x = 0;\n pos.y += data.lineHeight;\n prevCharCode = null;\n }\n }\n var lastChar = text.charAt(text.length - 1);\n if (lastChar !== '\\r' && lastChar !== '\\n') {\n if ((/(?:\\s)/).test(lastChar)) {\n lastLineWidth = lastBreakWidth;\n }\n lineWidths.push(lastLineWidth);\n maxLineWidth = Math.max(maxLineWidth, lastLineWidth);\n }\n var lineAlignOffsets = [];\n for (var i = 0; i <= line; i++) {\n var alignOffset = 0;\n if (this._align === 'right') {\n alignOffset = maxLineWidth - lineWidths[i];\n }\n else if (this._align === 'center') {\n alignOffset = (maxLineWidth - lineWidths[i]) / 2;\n }\n lineAlignOffsets.push(alignOffset);\n }\n var lenChars = chars.length;\n var pagesMeshData = {};\n var newPagesMeshData = [];\n var activePagesMeshData = this._activePagesMeshData;\n for (var i = 0; i < activePagesMeshData.length; i++) {\n pageMeshDataPool.push(activePagesMeshData[i]);\n }\n for (var i = 0; i < lenChars; i++) {\n var texture = chars[i].texture;\n var baseTextureUid = texture.baseTexture.uid;\n if (!pagesMeshData[baseTextureUid]) {\n var pageMeshData = pageMeshDataPool.pop();\n if (!pageMeshData) {\n var geometry = new MeshGeometry();\n var material = new MeshMaterial(Texture.EMPTY);\n var mesh = new Mesh(geometry, material);\n pageMeshData = {\n index: 0,\n indexCount: 0,\n vertexCount: 0,\n uvsCount: 0,\n total: 0,\n mesh: mesh,\n vertices: null,\n uvs: null,\n indices: null,\n };\n }\n // reset data..\n pageMeshData.index = 0;\n pageMeshData.indexCount = 0;\n pageMeshData.vertexCount = 0;\n pageMeshData.uvsCount = 0;\n pageMeshData.total = 0;\n // TODO need to get page texture here somehow..\n var _textureCache = this._textureCache;\n _textureCache[baseTextureUid] = _textureCache[baseTextureUid] || new Texture(texture.baseTexture);\n pageMeshData.mesh.texture = _textureCache[baseTextureUid];\n pageMeshData.mesh.tint = this._tint;\n newPagesMeshData.push(pageMeshData);\n pagesMeshData[baseTextureUid] = pageMeshData;\n }\n pagesMeshData[baseTextureUid].total++;\n }\n // lets find any previously active pageMeshDatas that are no longer required for\n // the updated text (if any), removed and return them to the pool.\n for (var i = 0; i < activePagesMeshData.length; i++) {\n if (newPagesMeshData.indexOf(activePagesMeshData[i]) === -1) {\n this.removeChild(activePagesMeshData[i].mesh);\n }\n }\n // next lets add any new meshes, that have not yet been added to this BitmapText\n // we only add if its not already a child of this BitmapObject\n for (var i = 0; i < newPagesMeshData.length; i++) {\n if (newPagesMeshData[i].mesh.parent !== this) {\n this.addChild(newPagesMeshData[i].mesh);\n }\n }\n // active page mesh datas are set to be the new pages added.\n this._activePagesMeshData = newPagesMeshData;\n for (var i in pagesMeshData) {\n var pageMeshData = pagesMeshData[i];\n var total = pageMeshData.total;\n // lets only allocate new buffers if we can fit the new text in the current ones..\n // unless that is, we will be batching. Currently batching dose not respect the size property of mesh\n if (!(((_a = pageMeshData.indices) === null || _a === void 0 ? void 0 : _a.length) > 6 * total) || pageMeshData.vertices.length < Mesh.BATCHABLE_SIZE * 2) {\n pageMeshData.vertices = new Float32Array(4 * 2 * total);\n pageMeshData.uvs = new Float32Array(4 * 2 * total);\n pageMeshData.indices = new Uint16Array(6 * total);\n }\n else {\n var total_1 = pageMeshData.total;\n var vertices = pageMeshData.vertices;\n // Clear the garbage at the end of the vertices buffer. This will prevent the bounds miscalculation.\n for (var i_1 = total_1 * 4 * 2; i_1 < vertices.length; i_1++) {\n vertices[i_1] = 0;\n }\n }\n // as a buffer maybe bigger than the current word, we set the size of the meshMaterial\n // to match the number of letters needed\n pageMeshData.mesh.size = 6 * total;\n }\n for (var i = 0; i < lenChars; i++) {\n var char = chars[i];\n var offset = char.position.x + lineAlignOffsets[char.line];\n if (this._roundPixels) {\n offset = Math.round(offset);\n }\n var xPos = offset * scale;\n var yPos = char.position.y * scale;\n var texture = char.texture;\n var pageMesh = pagesMeshData[texture.baseTexture.uid];\n var textureFrame = texture.frame;\n var textureUvs = texture._uvs;\n var index = pageMesh.index++;\n pageMesh.indices[(index * 6) + 0] = 0 + (index * 4);\n pageMesh.indices[(index * 6) + 1] = 1 + (index * 4);\n pageMesh.indices[(index * 6) + 2] = 2 + (index * 4);\n pageMesh.indices[(index * 6) + 3] = 0 + (index * 4);\n pageMesh.indices[(index * 6) + 4] = 2 + (index * 4);\n pageMesh.indices[(index * 6) + 5] = 3 + (index * 4);\n pageMesh.vertices[(index * 8) + 0] = xPos;\n pageMesh.vertices[(index * 8) + 1] = yPos;\n pageMesh.vertices[(index * 8) + 2] = xPos + (textureFrame.width * scale);\n pageMesh.vertices[(index * 8) + 3] = yPos;\n pageMesh.vertices[(index * 8) + 4] = xPos + (textureFrame.width * scale);\n pageMesh.vertices[(index * 8) + 5] = yPos + (textureFrame.height * scale);\n pageMesh.vertices[(index * 8) + 6] = xPos;\n pageMesh.vertices[(index * 8) + 7] = yPos + (textureFrame.height * scale);\n pageMesh.uvs[(index * 8) + 0] = textureUvs.x0;\n pageMesh.uvs[(index * 8) + 1] = textureUvs.y0;\n pageMesh.uvs[(index * 8) + 2] = textureUvs.x1;\n pageMesh.uvs[(index * 8) + 3] = textureUvs.y1;\n pageMesh.uvs[(index * 8) + 4] = textureUvs.x2;\n pageMesh.uvs[(index * 8) + 5] = textureUvs.y2;\n pageMesh.uvs[(index * 8) + 6] = textureUvs.x3;\n pageMesh.uvs[(index * 8) + 7] = textureUvs.y3;\n }\n this._textWidth = maxLineWidth * scale;\n this._textHeight = (pos.y + data.lineHeight) * scale;\n for (var i in pagesMeshData) {\n var pageMeshData = pagesMeshData[i];\n // apply anchor\n if (this.anchor.x !== 0 || this.anchor.y !== 0) {\n var vertexCount = 0;\n var anchorOffsetX = this._textWidth * this.anchor.x;\n var anchorOffsetY = this._textHeight * this.anchor.y;\n for (var i_2 = 0; i_2 < pageMeshData.total; i_2++) {\n pageMeshData.vertices[vertexCount++] -= anchorOffsetX;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetY;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetX;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetY;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetX;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetY;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetX;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetY;\n }\n }\n this._maxLineHeight = maxLineHeight * scale;\n var vertexBuffer = pageMeshData.mesh.geometry.getBuffer('aVertexPosition');\n var textureBuffer = pageMeshData.mesh.geometry.getBuffer('aTextureCoord');\n var indexBuffer = pageMeshData.mesh.geometry.getIndex();\n vertexBuffer.data = pageMeshData.vertices;\n textureBuffer.data = pageMeshData.uvs;\n indexBuffer.data = pageMeshData.indices;\n vertexBuffer.update();\n textureBuffer.update();\n indexBuffer.update();\n }\n for (var i = 0; i < chars.length; i++) {\n charRenderDataPool.push(chars[i]);\n }\n };\n /**\n * Updates the transform of this object\n *\n * @private\n */\n BitmapText.prototype.updateTransform = function () {\n this.validate();\n this.containerUpdateTransform();\n };\n /**\n * Validates text before calling parent's getLocalBounds\n *\n * @return {PIXI.Rectangle} The rectangular bounding area\n */\n BitmapText.prototype.getLocalBounds = function () {\n this.validate();\n return _super.prototype.getLocalBounds.call(this);\n };\n /**\n * Updates text when needed\n *\n * @private\n */\n BitmapText.prototype.validate = function () {\n if (this.dirty) {\n this.updateText();\n this.dirty = false;\n }\n };\n Object.defineProperty(BitmapText.prototype, \"tint\", {\n /**\n * The tint of the BitmapText object.\n *\n * @member {number}\n * @default 0xffffff\n */\n get: function () {\n return this._tint;\n },\n set: function (value) {\n if (this._tint === value)\n { return; }\n this._tint = value;\n for (var i = 0; i < this._activePagesMeshData.length; i++) {\n this._activePagesMeshData[i].mesh.tint = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"align\", {\n /**\n * The alignment of the BitmapText object.\n *\n * @member {string}\n * @default 'left'\n */\n get: function () {\n return this._align;\n },\n set: function (value) {\n if (this._align !== value) {\n this._align = value;\n this.dirty = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"fontName\", {\n /**\n * The name of the BitmapFont.\n *\n * @member {string}\n */\n get: function () {\n return this._fontName;\n },\n set: function (value) {\n if (!BitmapFont.available[value]) {\n throw new Error(\"Missing BitmapFont \\\"\" + value + \"\\\"\");\n }\n if (this._fontName !== value) {\n this._fontName = value;\n this.dirty = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"fontSize\", {\n /**\n * The size of the font to display.\n *\n * @member {number}\n */\n get: function () {\n return this._fontSize;\n },\n set: function (value) {\n if (this._fontSize !== value) {\n this._fontSize = value;\n this.dirty = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"anchor\", {\n /**\n * The anchor sets the origin point of the text.\n *\n * The default is `(0,0)`, this means the text's origin is the top left.\n *\n * Setting the anchor to `(0.5,0.5)` means the text's origin is centered.\n *\n * Setting the anchor to `(1,1)` would mean the text's origin point will be the bottom right corner.\n *\n * @member {PIXI.Point | number}\n */\n get: function () {\n return this._anchor;\n },\n set: function (value) {\n if (typeof value === 'number') {\n this._anchor.set(value);\n }\n else {\n this._anchor.copyFrom(value);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"text\", {\n /**\n * The text of the BitmapText object.\n *\n * @member {string}\n */\n get: function () {\n return this._text;\n },\n set: function (text) {\n text = String(text === null || text === undefined ? '' : text);\n if (this._text === text) {\n return;\n }\n this._text = text;\n this.dirty = true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"maxWidth\", {\n /**\n * The max width of this bitmap text in pixels. If the text provided is longer than the\n * value provided, line breaks will be automatically inserted in the last whitespace.\n * Disable by setting the value to 0.\n *\n * @member {number}\n */\n get: function () {\n return this._maxWidth;\n },\n set: function (value) {\n if (this._maxWidth === value) {\n return;\n }\n this._maxWidth = value;\n this.dirty = true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"maxLineHeight\", {\n /**\n * The max line height. This is useful when trying to use the total height of the Text,\n * i.e. when trying to vertically align.\n *\n * @member {number}\n * @readonly\n */\n get: function () {\n this.validate();\n return this._maxLineHeight;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"textWidth\", {\n /**\n * The width of the overall text, different from fontSize,\n * which is defined in the style object.\n *\n * @member {number}\n * @readonly\n */\n get: function () {\n this.validate();\n return this._textWidth;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"letterSpacing\", {\n /**\n * Additional space between characters.\n *\n * @member {number}\n */\n get: function () {\n return this._letterSpacing;\n },\n set: function (value) {\n if (this._letterSpacing !== value) {\n this._letterSpacing = value;\n this.dirty = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"roundPixels\", {\n /**\n * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.\n * Advantages can include sharper image quality (like text) and faster rendering on canvas.\n * The main disadvantage is movement of objects may appear less smooth.\n * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}\n *\n * @member {boolean}\n * @default PIXI.settings.ROUND_PIXELS\n */\n get: function () {\n return this._roundPixels;\n },\n set: function (value) {\n if (value !== this._roundPixels) {\n this._roundPixels = value;\n this.dirty = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"textHeight\", {\n /**\n * The height of the overall text, different from fontSize,\n * which is defined in the style object.\n *\n * @member {number}\n * @readonly\n */\n get: function () {\n this.validate();\n return this._textHeight;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * For backward compatibility, convert old style.font constructor param to fontName & fontSize properties.\n *\n * @private\n * @deprecated since 5.3.0\n */\n BitmapText.prototype._upgradeStyle = function (style) {\n if (typeof style.font === 'string') {\n var valueSplit = style.font.split(' ');\n style.fontName = valueSplit.length === 1\n ? valueSplit[0]\n : valueSplit.slice(1).join(' ');\n if (valueSplit.length >= 2) {\n style.fontSize = parseInt(valueSplit[0], 10);\n }\n }\n else {\n style.fontName = style.font.name;\n style.fontSize = typeof style.font.size === 'number'\n ? style.font.size\n : parseInt(style.font.size, 10);\n }\n };\n BitmapText.prototype.destroy = function (options) {\n var _textureCache = this._textureCache;\n for (var id in _textureCache) {\n var texture = _textureCache[id];\n texture.destroy();\n delete _textureCache[id];\n }\n this._textureCache = null;\n _super.prototype.destroy.call(this, options);\n };\n /**\n * Register a bitmap font with data and a texture.\n *\n * @deprecated since 5.3.0\n * @see PIXI.BitmapFont.install\n * @static\n */\n BitmapText.registerFont = function (data, textures) {\n deprecation('5.3.0', 'PIXI.BitmapText.registerFont is deprecated, use PIXI.BitmapFont.install');\n return BitmapFont.install(data, textures);\n };\n Object.defineProperty(BitmapText, \"fonts\", {\n /**\n * Get the list of installed fonts.\n *\n * @see PIXI.BitmapFont.available\n * @deprecated since 5.3.0\n * @static\n * @readonly\n * @member {Object.}\n */\n get: function () {\n deprecation('5.3.0', 'PIXI.BitmapText.fonts is deprecated, use PIXI.BitmapFont.available');\n return BitmapFont.available;\n },\n enumerable: false,\n configurable: true\n });\n BitmapText.styleDefaults = {\n align: 'left',\n tint: 0xFFFFFF,\n maxWidth: 0,\n letterSpacing: 0,\n };\n return BitmapText;\n}(Container));\n\n/**\n * {@link PIXI.Loader Loader} middleware for loading\n * bitmap-based fonts suitable for using with {@link PIXI.BitmapText}.\n * @class\n * @memberof PIXI\n * @implements PIXI.ILoaderPlugin\n */\nvar BitmapFontLoader = /** @class */ (function () {\n function BitmapFontLoader() {\n }\n /**\n * Called when the plugin is installed.\n *\n * @see PIXI.Loader.registerPlugin\n */\n BitmapFontLoader.add = function () {\n LoaderResource.setExtensionXhrType('fnt', LoaderResource.XHR_RESPONSE_TYPE.TEXT);\n };\n /**\n * Called after a resource is loaded.\n * @see PIXI.Loader.loaderMiddleware\n * @param {PIXI.LoaderResource} resource\n * @param {function} next\n */\n BitmapFontLoader.use = function (resource, next) {\n var format = autoDetectFormat(resource.data);\n // Resource was not recognised as any of the expected font data format\n if (!format) {\n next();\n return;\n }\n var baseUrl = BitmapFontLoader.getBaseUrl(this, resource);\n var data = format.parse(resource.data);\n var textures = {};\n // Handle completed, when the number of textures\n // load is the same number as references in the fnt file\n var completed = function (page) {\n textures[page.metadata.pageFile] = page.texture;\n if (Object.keys(textures).length === data.page.length) {\n resource.bitmapFont = BitmapFont.install(data, textures);\n next();\n }\n };\n for (var i = 0; i < data.page.length; ++i) {\n var pageFile = data.page[i].file;\n var url = baseUrl + pageFile;\n var exists = false;\n // incase the image is loaded outside\n // using the same loader, resource will be available\n for (var name in this.resources) {\n var bitmapResource = this.resources[name];\n if (bitmapResource.url === url) {\n bitmapResource.metadata.pageFile = pageFile;\n if (bitmapResource.texture) {\n completed(bitmapResource);\n }\n else {\n bitmapResource.onAfterMiddleware.add(completed);\n }\n exists = true;\n break;\n }\n }\n // texture is not loaded, we'll attempt to add\n // it to the load and add the texture to the list\n if (!exists) {\n // Standard loading options for images\n var options = {\n crossOrigin: resource.crossOrigin,\n loadType: LoaderResource.LOAD_TYPE.IMAGE,\n metadata: Object.assign({ pageFile: pageFile }, resource.metadata.imageMetadata),\n parentResource: resource,\n };\n this.add(url, options, completed);\n }\n }\n };\n /**\n * Get folder path from a resource\n * @private\n * @param {PIXI.Loader} loader\n * @param {PIXI.LoaderResource} resource\n * @return {string}\n */\n BitmapFontLoader.getBaseUrl = function (loader, resource) {\n var resUrl = !resource.isDataUrl ? BitmapFontLoader.dirname(resource.url) : '';\n if (resource.isDataUrl) {\n if (resUrl === '.') {\n resUrl = '';\n }\n if (loader.baseUrl && resUrl) {\n // if baseurl has a trailing slash then add one to resUrl so the replace works below\n if (loader.baseUrl.charAt(loader.baseUrl.length - 1) === '/') {\n resUrl += '/';\n }\n }\n }\n // remove baseUrl from resUrl\n resUrl = resUrl.replace(loader.baseUrl, '');\n // if there is an resUrl now, it needs a trailing slash. Ensure that it does if the string isn't empty.\n if (resUrl && resUrl.charAt(resUrl.length - 1) !== '/') {\n resUrl += '/';\n }\n return resUrl;\n };\n /**\n * Replacement for NodeJS's path.dirname\n * @private\n * @param {string} url - Path to get directory for\n */\n BitmapFontLoader.dirname = function (url) {\n var dir = url\n .replace(/\\\\/g, '/') // convert windows notation to UNIX notation, URL-safe because it's a forbidden character\n .replace(/\\/$/, '') // replace trailing slash\n .replace(/\\/[^\\/]*$/, ''); // remove everything after the last\n // File request is relative, use current directory\n if (dir === url) {\n return '.';\n }\n // Started with a slash\n else if (dir === '') {\n return '/';\n }\n return dir;\n };\n return BitmapFontLoader;\n}());\n\nexport { BitmapFont, BitmapFontData, BitmapFontLoader, BitmapText };\n//# sourceMappingURL=text-bitmap.es.js.map\n","/*!\n * @pixi/filter-alpha - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/filter-alpha is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { defaultVertex, Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar fragment = \"varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform float uAlpha;\\n\\nvoid main(void)\\n{\\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\\n}\\n\";\n\n/**\n * Simplest filter - applies alpha.\n *\n * Use this instead of Container's alpha property to avoid visual layering of individual elements.\n * AlphaFilter applies alpha evenly across the entire display object and any opaque elements it contains.\n * If elements are not opaque, they will blend with each other anyway.\n *\n * Very handy if you want to use common features of all filters:\n *\n * 1. Assign a blendMode to this filter, blend all elements inside display object with background.\n *\n * 2. To use clipping in display coordinates, assign a filterArea to the same container that has this filter.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar AlphaFilter = /** @class */ (function (_super) {\n __extends(AlphaFilter, _super);\n /**\n * @param {number} [alpha=1] - Amount of alpha from 0 to 1, where 0 is transparent\n */\n function AlphaFilter(alpha) {\n if (alpha === void 0) { alpha = 1.0; }\n var _this = _super.call(this, defaultVertex, fragment, { uAlpha: 1 }) || this;\n _this.alpha = alpha;\n return _this;\n }\n Object.defineProperty(AlphaFilter.prototype, \"alpha\", {\n /**\n * Coefficient for alpha multiplication\n *\n * @member {number}\n * @default 1\n */\n get: function () {\n return this.uniforms.uAlpha;\n },\n set: function (value) {\n this.uniforms.uAlpha = value;\n },\n enumerable: false,\n configurable: true\n });\n return AlphaFilter;\n}(Filter));\n\nexport { AlphaFilter };\n//# sourceMappingURL=filter-alpha.es.js.map\n","/*!\n * @pixi/filter-blur - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/filter-blur is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { settings } from '@pixi/settings';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertTemplate = \"\\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 }\";\nfunction generateBlurVertSource(kernelSize, x) {\n var halfLength = Math.ceil(kernelSize / 2);\n var vertSource = vertTemplate;\n var blurLoop = '';\n var template;\n if (x) {\n template = 'vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);';\n }\n else {\n template = 'vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);';\n }\n for (var i = 0; i < kernelSize; i++) {\n var blur = template.replace('%index%', i.toString());\n blur = blur.replace('%sampleIndex%', i - (halfLength - 1) + \".0\");\n blurLoop += blur;\n blurLoop += '\\n';\n }\n vertSource = vertSource.replace('%blur%', blurLoop);\n vertSource = vertSource.replace('%size%', kernelSize.toString());\n return vertSource;\n}\n\nvar GAUSSIAN_VALUES = {\n 5: [0.153388, 0.221461, 0.250301],\n 7: [0.071303, 0.131514, 0.189879, 0.214607],\n 9: [0.028532, 0.067234, 0.124009, 0.179044, 0.20236],\n 11: [0.0093, 0.028002, 0.065984, 0.121703, 0.175713, 0.198596],\n 13: [0.002406, 0.009255, 0.027867, 0.065666, 0.121117, 0.174868, 0.197641],\n 15: [0.000489, 0.002403, 0.009246, 0.02784, 0.065602, 0.120999, 0.174697, 0.197448],\n};\nvar fragTemplate = [\n 'varying vec2 vBlurTexCoords[%size%];',\n 'uniform sampler2D uSampler;',\n 'void main(void)',\n '{',\n ' gl_FragColor = vec4(0.0);',\n ' %blur%',\n '}' ].join('\\n');\nfunction generateBlurFragSource(kernelSize) {\n var kernel = GAUSSIAN_VALUES[kernelSize];\n var halfLength = kernel.length;\n var fragSource = fragTemplate;\n var blurLoop = '';\n var template = 'gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;';\n var value;\n for (var i = 0; i < kernelSize; i++) {\n var blur = template.replace('%index%', i.toString());\n value = i;\n if (i >= halfLength) {\n value = kernelSize - i - 1;\n }\n blur = blur.replace('%value%', kernel[value].toString());\n blurLoop += blur;\n blurLoop += '\\n';\n }\n fragSource = fragSource.replace('%blur%', blurLoop);\n fragSource = fragSource.replace('%size%', kernelSize.toString());\n return fragSource;\n}\n\n/**\n * Different types of environments for WebGL.\n *\n * @static\n * @memberof PIXI\n * @name ENV\n * @enum {number}\n * @property {number} WEBGL_LEGACY - Used for older v1 WebGL devices. PixiJS will aim to ensure compatibility\n * with older / less advanced devices. If you experience unexplained flickering prefer this environment.\n * @property {number} WEBGL - Version 1 of WebGL\n * @property {number} WEBGL2 - Version 2 of WebGL\n */\nvar ENV;\n(function (ENV) {\n ENV[ENV[\"WEBGL_LEGACY\"] = 0] = \"WEBGL_LEGACY\";\n ENV[ENV[\"WEBGL\"] = 1] = \"WEBGL\";\n ENV[ENV[\"WEBGL2\"] = 2] = \"WEBGL2\";\n})(ENV || (ENV = {}));\n/**\n * Constant to identify the Renderer Type.\n *\n * @static\n * @memberof PIXI\n * @name RENDERER_TYPE\n * @enum {number}\n * @property {number} UNKNOWN - Unknown render type.\n * @property {number} WEBGL - WebGL render type.\n * @property {number} CANVAS - Canvas render type.\n */\nvar RENDERER_TYPE;\n(function (RENDERER_TYPE) {\n RENDERER_TYPE[RENDERER_TYPE[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\n RENDERER_TYPE[RENDERER_TYPE[\"WEBGL\"] = 1] = \"WEBGL\";\n RENDERER_TYPE[RENDERER_TYPE[\"CANVAS\"] = 2] = \"CANVAS\";\n})(RENDERER_TYPE || (RENDERER_TYPE = {}));\n/**\n * Bitwise OR of masks that indicate the buffers to be cleared.\n *\n * @static\n * @memberof PIXI\n * @name BUFFER_BITS\n * @enum {number}\n * @property {number} COLOR - Indicates the buffers currently enabled for color writing.\n * @property {number} DEPTH - Indicates the depth buffer.\n * @property {number} STENCIL - Indicates the stencil buffer.\n */\nvar BUFFER_BITS;\n(function (BUFFER_BITS) {\n BUFFER_BITS[BUFFER_BITS[\"COLOR\"] = 16384] = \"COLOR\";\n BUFFER_BITS[BUFFER_BITS[\"DEPTH\"] = 256] = \"DEPTH\";\n BUFFER_BITS[BUFFER_BITS[\"STENCIL\"] = 1024] = \"STENCIL\";\n})(BUFFER_BITS || (BUFFER_BITS = {}));\n/**\n * Various blend modes supported by PIXI.\n *\n * IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes.\n * Anything else will silently act like NORMAL.\n *\n * @memberof PIXI\n * @name BLEND_MODES\n * @enum {number}\n * @property {number} NORMAL\n * @property {number} ADD\n * @property {number} MULTIPLY\n * @property {number} SCREEN\n * @property {number} OVERLAY\n * @property {number} DARKEN\n * @property {number} LIGHTEN\n * @property {number} COLOR_DODGE\n * @property {number} COLOR_BURN\n * @property {number} HARD_LIGHT\n * @property {number} SOFT_LIGHT\n * @property {number} DIFFERENCE\n * @property {number} EXCLUSION\n * @property {number} HUE\n * @property {number} SATURATION\n * @property {number} COLOR\n * @property {number} LUMINOSITY\n * @property {number} NORMAL_NPM\n * @property {number} ADD_NPM\n * @property {number} SCREEN_NPM\n * @property {number} NONE\n * @property {number} SRC_IN\n * @property {number} SRC_OUT\n * @property {number} SRC_ATOP\n * @property {number} DST_OVER\n * @property {number} DST_IN\n * @property {number} DST_OUT\n * @property {number} DST_ATOP\n * @property {number} SUBTRACT\n * @property {number} SRC_OVER\n * @property {number} ERASE\n * @property {number} XOR\n */\nvar BLEND_MODES;\n(function (BLEND_MODES) {\n BLEND_MODES[BLEND_MODES[\"NORMAL\"] = 0] = \"NORMAL\";\n BLEND_MODES[BLEND_MODES[\"ADD\"] = 1] = \"ADD\";\n BLEND_MODES[BLEND_MODES[\"MULTIPLY\"] = 2] = \"MULTIPLY\";\n BLEND_MODES[BLEND_MODES[\"SCREEN\"] = 3] = \"SCREEN\";\n BLEND_MODES[BLEND_MODES[\"OVERLAY\"] = 4] = \"OVERLAY\";\n BLEND_MODES[BLEND_MODES[\"DARKEN\"] = 5] = \"DARKEN\";\n BLEND_MODES[BLEND_MODES[\"LIGHTEN\"] = 6] = \"LIGHTEN\";\n BLEND_MODES[BLEND_MODES[\"COLOR_DODGE\"] = 7] = \"COLOR_DODGE\";\n BLEND_MODES[BLEND_MODES[\"COLOR_BURN\"] = 8] = \"COLOR_BURN\";\n BLEND_MODES[BLEND_MODES[\"HARD_LIGHT\"] = 9] = \"HARD_LIGHT\";\n BLEND_MODES[BLEND_MODES[\"SOFT_LIGHT\"] = 10] = \"SOFT_LIGHT\";\n BLEND_MODES[BLEND_MODES[\"DIFFERENCE\"] = 11] = \"DIFFERENCE\";\n BLEND_MODES[BLEND_MODES[\"EXCLUSION\"] = 12] = \"EXCLUSION\";\n BLEND_MODES[BLEND_MODES[\"HUE\"] = 13] = \"HUE\";\n BLEND_MODES[BLEND_MODES[\"SATURATION\"] = 14] = \"SATURATION\";\n BLEND_MODES[BLEND_MODES[\"COLOR\"] = 15] = \"COLOR\";\n BLEND_MODES[BLEND_MODES[\"LUMINOSITY\"] = 16] = \"LUMINOSITY\";\n BLEND_MODES[BLEND_MODES[\"NORMAL_NPM\"] = 17] = \"NORMAL_NPM\";\n BLEND_MODES[BLEND_MODES[\"ADD_NPM\"] = 18] = \"ADD_NPM\";\n BLEND_MODES[BLEND_MODES[\"SCREEN_NPM\"] = 19] = \"SCREEN_NPM\";\n BLEND_MODES[BLEND_MODES[\"NONE\"] = 20] = \"NONE\";\n BLEND_MODES[BLEND_MODES[\"SRC_OVER\"] = 0] = \"SRC_OVER\";\n BLEND_MODES[BLEND_MODES[\"SRC_IN\"] = 21] = \"SRC_IN\";\n BLEND_MODES[BLEND_MODES[\"SRC_OUT\"] = 22] = \"SRC_OUT\";\n BLEND_MODES[BLEND_MODES[\"SRC_ATOP\"] = 23] = \"SRC_ATOP\";\n BLEND_MODES[BLEND_MODES[\"DST_OVER\"] = 24] = \"DST_OVER\";\n BLEND_MODES[BLEND_MODES[\"DST_IN\"] = 25] = \"DST_IN\";\n BLEND_MODES[BLEND_MODES[\"DST_OUT\"] = 26] = \"DST_OUT\";\n BLEND_MODES[BLEND_MODES[\"DST_ATOP\"] = 27] = \"DST_ATOP\";\n BLEND_MODES[BLEND_MODES[\"ERASE\"] = 26] = \"ERASE\";\n BLEND_MODES[BLEND_MODES[\"SUBTRACT\"] = 28] = \"SUBTRACT\";\n BLEND_MODES[BLEND_MODES[\"XOR\"] = 29] = \"XOR\";\n})(BLEND_MODES || (BLEND_MODES = {}));\n/**\n * Various webgl draw modes. These can be used to specify which GL drawMode to use\n * under certain situations and renderers.\n *\n * @memberof PIXI\n * @static\n * @name DRAW_MODES\n * @enum {number}\n * @property {number} POINTS\n * @property {number} LINES\n * @property {number} LINE_LOOP\n * @property {number} LINE_STRIP\n * @property {number} TRIANGLES\n * @property {number} TRIANGLE_STRIP\n * @property {number} TRIANGLE_FAN\n */\nvar DRAW_MODES;\n(function (DRAW_MODES) {\n DRAW_MODES[DRAW_MODES[\"POINTS\"] = 0] = \"POINTS\";\n DRAW_MODES[DRAW_MODES[\"LINES\"] = 1] = \"LINES\";\n DRAW_MODES[DRAW_MODES[\"LINE_LOOP\"] = 2] = \"LINE_LOOP\";\n DRAW_MODES[DRAW_MODES[\"LINE_STRIP\"] = 3] = \"LINE_STRIP\";\n DRAW_MODES[DRAW_MODES[\"TRIANGLES\"] = 4] = \"TRIANGLES\";\n DRAW_MODES[DRAW_MODES[\"TRIANGLE_STRIP\"] = 5] = \"TRIANGLE_STRIP\";\n DRAW_MODES[DRAW_MODES[\"TRIANGLE_FAN\"] = 6] = \"TRIANGLE_FAN\";\n})(DRAW_MODES || (DRAW_MODES = {}));\n/**\n * Various GL texture/resources formats.\n *\n * @memberof PIXI\n * @static\n * @name FORMATS\n * @enum {number}\n * @property {number} RGBA=6408\n * @property {number} RGB=6407\n * @property {number} ALPHA=6406\n * @property {number} LUMINANCE=6409\n * @property {number} LUMINANCE_ALPHA=6410\n * @property {number} DEPTH_COMPONENT=6402\n * @property {number} DEPTH_STENCIL=34041\n */\nvar FORMATS;\n(function (FORMATS) {\n FORMATS[FORMATS[\"RGBA\"] = 6408] = \"RGBA\";\n FORMATS[FORMATS[\"RGB\"] = 6407] = \"RGB\";\n FORMATS[FORMATS[\"ALPHA\"] = 6406] = \"ALPHA\";\n FORMATS[FORMATS[\"LUMINANCE\"] = 6409] = \"LUMINANCE\";\n FORMATS[FORMATS[\"LUMINANCE_ALPHA\"] = 6410] = \"LUMINANCE_ALPHA\";\n FORMATS[FORMATS[\"DEPTH_COMPONENT\"] = 6402] = \"DEPTH_COMPONENT\";\n FORMATS[FORMATS[\"DEPTH_STENCIL\"] = 34041] = \"DEPTH_STENCIL\";\n})(FORMATS || (FORMATS = {}));\n/**\n * Various GL target types.\n *\n * @memberof PIXI\n * @static\n * @name TARGETS\n * @enum {number}\n * @property {number} TEXTURE_2D=3553\n * @property {number} TEXTURE_CUBE_MAP=34067\n * @property {number} TEXTURE_2D_ARRAY=35866\n * @property {number} TEXTURE_CUBE_MAP_POSITIVE_X=34069\n * @property {number} TEXTURE_CUBE_MAP_NEGATIVE_X=34070\n * @property {number} TEXTURE_CUBE_MAP_POSITIVE_Y=34071\n * @property {number} TEXTURE_CUBE_MAP_NEGATIVE_Y=34072\n * @property {number} TEXTURE_CUBE_MAP_POSITIVE_Z=34073\n * @property {number} TEXTURE_CUBE_MAP_NEGATIVE_Z=34074\n */\nvar TARGETS;\n(function (TARGETS) {\n TARGETS[TARGETS[\"TEXTURE_2D\"] = 3553] = \"TEXTURE_2D\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP\"] = 34067] = \"TEXTURE_CUBE_MAP\";\n TARGETS[TARGETS[\"TEXTURE_2D_ARRAY\"] = 35866] = \"TEXTURE_2D_ARRAY\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_POSITIVE_X\"] = 34069] = \"TEXTURE_CUBE_MAP_POSITIVE_X\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_NEGATIVE_X\"] = 34070] = \"TEXTURE_CUBE_MAP_NEGATIVE_X\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_POSITIVE_Y\"] = 34071] = \"TEXTURE_CUBE_MAP_POSITIVE_Y\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_NEGATIVE_Y\"] = 34072] = \"TEXTURE_CUBE_MAP_NEGATIVE_Y\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_POSITIVE_Z\"] = 34073] = \"TEXTURE_CUBE_MAP_POSITIVE_Z\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_NEGATIVE_Z\"] = 34074] = \"TEXTURE_CUBE_MAP_NEGATIVE_Z\";\n})(TARGETS || (TARGETS = {}));\n/**\n * Various GL data format types.\n *\n * @memberof PIXI\n * @static\n * @name TYPES\n * @enum {number}\n * @property {number} UNSIGNED_BYTE=5121\n * @property {number} UNSIGNED_SHORT=5123\n * @property {number} UNSIGNED_SHORT_5_6_5=33635\n * @property {number} UNSIGNED_SHORT_4_4_4_4=32819\n * @property {number} UNSIGNED_SHORT_5_5_5_1=32820\n * @property {number} FLOAT=5126\n * @property {number} HALF_FLOAT=36193\n */\nvar TYPES;\n(function (TYPES) {\n TYPES[TYPES[\"UNSIGNED_BYTE\"] = 5121] = \"UNSIGNED_BYTE\";\n TYPES[TYPES[\"UNSIGNED_SHORT\"] = 5123] = \"UNSIGNED_SHORT\";\n TYPES[TYPES[\"UNSIGNED_SHORT_5_6_5\"] = 33635] = \"UNSIGNED_SHORT_5_6_5\";\n TYPES[TYPES[\"UNSIGNED_SHORT_4_4_4_4\"] = 32819] = \"UNSIGNED_SHORT_4_4_4_4\";\n TYPES[TYPES[\"UNSIGNED_SHORT_5_5_5_1\"] = 32820] = \"UNSIGNED_SHORT_5_5_5_1\";\n TYPES[TYPES[\"FLOAT\"] = 5126] = \"FLOAT\";\n TYPES[TYPES[\"HALF_FLOAT\"] = 36193] = \"HALF_FLOAT\";\n})(TYPES || (TYPES = {}));\n/**\n * The scale modes that are supported by pixi.\n *\n * The {@link PIXI.settings.SCALE_MODE} scale mode affects the default scaling mode of future operations.\n * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability.\n *\n * @memberof PIXI\n * @static\n * @name SCALE_MODES\n * @enum {number}\n * @property {number} LINEAR Smooth scaling\n * @property {number} NEAREST Pixelating scaling\n */\nvar SCALE_MODES;\n(function (SCALE_MODES) {\n SCALE_MODES[SCALE_MODES[\"NEAREST\"] = 0] = \"NEAREST\";\n SCALE_MODES[SCALE_MODES[\"LINEAR\"] = 1] = \"LINEAR\";\n})(SCALE_MODES || (SCALE_MODES = {}));\n/**\n * The wrap modes that are supported by pixi.\n *\n * The {@link PIXI.settings.WRAP_MODE} wrap mode affects the default wrapping mode of future operations.\n * It can be re-assigned to either CLAMP or REPEAT, depending upon suitability.\n * If the texture is non power of two then clamp will be used regardless as WebGL can\n * only use REPEAT if the texture is po2.\n *\n * This property only affects WebGL.\n *\n * @name WRAP_MODES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} CLAMP - The textures uvs are clamped\n * @property {number} REPEAT - The texture uvs tile and repeat\n * @property {number} MIRRORED_REPEAT - The texture uvs tile and repeat with mirroring\n */\nvar WRAP_MODES;\n(function (WRAP_MODES) {\n WRAP_MODES[WRAP_MODES[\"CLAMP\"] = 33071] = \"CLAMP\";\n WRAP_MODES[WRAP_MODES[\"REPEAT\"] = 10497] = \"REPEAT\";\n WRAP_MODES[WRAP_MODES[\"MIRRORED_REPEAT\"] = 33648] = \"MIRRORED_REPEAT\";\n})(WRAP_MODES || (WRAP_MODES = {}));\n/**\n * Mipmap filtering modes that are supported by pixi.\n *\n * The {@link PIXI.settings.MIPMAP_TEXTURES} affects default texture filtering.\n * Mipmaps are generated for a baseTexture if its `mipmap` field is `ON`,\n * or its `POW2` and texture dimensions are powers of 2.\n * Due to platform restriction, `ON` option will work like `POW2` for webgl-1.\n *\n * This property only affects WebGL.\n *\n * @name MIPMAP_MODES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} OFF - No mipmaps\n * @property {number} POW2 - Generate mipmaps if texture dimensions are pow2\n * @property {number} ON - Always generate mipmaps\n */\nvar MIPMAP_MODES;\n(function (MIPMAP_MODES) {\n MIPMAP_MODES[MIPMAP_MODES[\"OFF\"] = 0] = \"OFF\";\n MIPMAP_MODES[MIPMAP_MODES[\"POW2\"] = 1] = \"POW2\";\n MIPMAP_MODES[MIPMAP_MODES[\"ON\"] = 2] = \"ON\";\n})(MIPMAP_MODES || (MIPMAP_MODES = {}));\n/**\n * How to treat textures with premultiplied alpha\n *\n * @name ALPHA_MODES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} NO_PREMULTIPLIED_ALPHA - Source is not premultiplied, leave it like that.\n * Option for compressed and data textures that are created from typed arrays.\n * @property {number} PREMULTIPLY_ON_UPLOAD - Source is not premultiplied, premultiply on upload.\n * Default option, used for all loaded images.\n * @property {number} PREMULTIPLIED_ALPHA - Source is already premultiplied\n * Example: spine atlases with `_pma` suffix.\n * @property {number} NPM - Alias for NO_PREMULTIPLIED_ALPHA.\n * @property {number} UNPACK - Default option, alias for PREMULTIPLY_ON_UPLOAD.\n * @property {number} PMA - Alias for PREMULTIPLIED_ALPHA.\n */\nvar ALPHA_MODES;\n(function (ALPHA_MODES) {\n ALPHA_MODES[ALPHA_MODES[\"NPM\"] = 0] = \"NPM\";\n ALPHA_MODES[ALPHA_MODES[\"UNPACK\"] = 1] = \"UNPACK\";\n ALPHA_MODES[ALPHA_MODES[\"PMA\"] = 2] = \"PMA\";\n ALPHA_MODES[ALPHA_MODES[\"NO_PREMULTIPLIED_ALPHA\"] = 0] = \"NO_PREMULTIPLIED_ALPHA\";\n ALPHA_MODES[ALPHA_MODES[\"PREMULTIPLY_ON_UPLOAD\"] = 1] = \"PREMULTIPLY_ON_UPLOAD\";\n ALPHA_MODES[ALPHA_MODES[\"PREMULTIPLY_ALPHA\"] = 2] = \"PREMULTIPLY_ALPHA\";\n})(ALPHA_MODES || (ALPHA_MODES = {}));\n/**\n * How to clear renderTextures in filter\n *\n * @name CLEAR_MODES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} BLEND - Preserve the information in the texture, blend above\n * @property {number} CLEAR - Must use `gl.clear` operation\n * @property {number} BLIT - Clear or blit it, depends on device and level of paranoia\n * @property {number} NO - Alias for BLEND, same as `false` in earlier versions\n * @property {number} YES - Alias for CLEAR, same as `true` in earlier versions\n * @property {number} AUTO - Alias for BLIT\n */\nvar CLEAR_MODES;\n(function (CLEAR_MODES) {\n CLEAR_MODES[CLEAR_MODES[\"NO\"] = 0] = \"NO\";\n CLEAR_MODES[CLEAR_MODES[\"YES\"] = 1] = \"YES\";\n CLEAR_MODES[CLEAR_MODES[\"AUTO\"] = 2] = \"AUTO\";\n CLEAR_MODES[CLEAR_MODES[\"BLEND\"] = 0] = \"BLEND\";\n CLEAR_MODES[CLEAR_MODES[\"CLEAR\"] = 1] = \"CLEAR\";\n CLEAR_MODES[CLEAR_MODES[\"BLIT\"] = 2] = \"BLIT\";\n})(CLEAR_MODES || (CLEAR_MODES = {}));\n/**\n * The gc modes that are supported by pixi.\n *\n * The {@link PIXI.settings.GC_MODE} Garbage Collection mode for PixiJS textures is AUTO\n * If set to GC_MODE, the renderer will occasionally check textures usage. If they are not\n * used for a specified period of time they will be removed from the GPU. They will of course\n * be uploaded again when they are required. This is a silent behind the scenes process that\n * should ensure that the GPU does not get filled up.\n *\n * Handy for mobile devices!\n * This property only affects WebGL.\n *\n * @name GC_MODES\n * @enum {number}\n * @static\n * @memberof PIXI\n * @property {number} AUTO - Garbage collection will happen periodically automatically\n * @property {number} MANUAL - Garbage collection will need to be called manually\n */\nvar GC_MODES;\n(function (GC_MODES) {\n GC_MODES[GC_MODES[\"AUTO\"] = 0] = \"AUTO\";\n GC_MODES[GC_MODES[\"MANUAL\"] = 1] = \"MANUAL\";\n})(GC_MODES || (GC_MODES = {}));\n/**\n * Constants that specify float precision in shaders.\n *\n * @name PRECISION\n * @memberof PIXI\n * @constant\n * @static\n * @enum {string}\n * @property {string} LOW='lowp'\n * @property {string} MEDIUM='mediump'\n * @property {string} HIGH='highp'\n */\nvar PRECISION;\n(function (PRECISION) {\n PRECISION[\"LOW\"] = \"lowp\";\n PRECISION[\"MEDIUM\"] = \"mediump\";\n PRECISION[\"HIGH\"] = \"highp\";\n})(PRECISION || (PRECISION = {}));\n/**\n * Constants for mask implementations.\n * We use `type` suffix because it leads to very different behaviours\n *\n * @name MASK_TYPES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} NONE - Mask is ignored\n * @property {number} SCISSOR - Scissor mask, rectangle on screen, cheap\n * @property {number} STENCIL - Stencil mask, 1-bit, medium, works only if renderer supports stencil\n * @property {number} SPRITE - Mask that uses SpriteMaskFilter, uses temporary RenderTexture\n */\nvar MASK_TYPES;\n(function (MASK_TYPES) {\n MASK_TYPES[MASK_TYPES[\"NONE\"] = 0] = \"NONE\";\n MASK_TYPES[MASK_TYPES[\"SCISSOR\"] = 1] = \"SCISSOR\";\n MASK_TYPES[MASK_TYPES[\"STENCIL\"] = 2] = \"STENCIL\";\n MASK_TYPES[MASK_TYPES[\"SPRITE\"] = 3] = \"SPRITE\";\n})(MASK_TYPES || (MASK_TYPES = {}));\n/**\n * Constants for multi-sampling antialiasing.\n *\n * @see PIXI.Framebuffer#multisample\n *\n * @name MSAA_QUALITY\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} NONE - No multisampling for this renderTexture\n * @property {number} LOW - Try 2 samples\n * @property {number} MEDIUM - Try 4 samples\n * @property {number} HIGH - Try 8 samples\n */\nvar MSAA_QUALITY;\n(function (MSAA_QUALITY) {\n MSAA_QUALITY[MSAA_QUALITY[\"NONE\"] = 0] = \"NONE\";\n MSAA_QUALITY[MSAA_QUALITY[\"LOW\"] = 2] = \"LOW\";\n MSAA_QUALITY[MSAA_QUALITY[\"MEDIUM\"] = 4] = \"MEDIUM\";\n MSAA_QUALITY[MSAA_QUALITY[\"HIGH\"] = 8] = \"HIGH\";\n})(MSAA_QUALITY || (MSAA_QUALITY = {}));\n\n/**\n * The BlurFilterPass applies a horizontal or vertical Gaussian blur to an object.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar BlurFilterPass = /** @class */ (function (_super) {\n __extends(BlurFilterPass, _super);\n /**\n * @param {boolean} horizontal - Do pass along the x-axis (`true`) or y-axis (`false`).\n * @param {number} [strength=8] - The strength of the blur filter.\n * @param {number} [quality=4] - The quality of the blur filter.\n * @param {number} [resolution=PIXI.settings.FILTER_RESOLUTION] - The resolution of the blur filter.\n * @param {number} [kernelSize=5] - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.\n */\n function BlurFilterPass(horizontal, strength, quality, resolution, kernelSize) {\n if (strength === void 0) { strength = 8; }\n if (quality === void 0) { quality = 4; }\n if (resolution === void 0) { resolution = settings.FILTER_RESOLUTION; }\n if (kernelSize === void 0) { kernelSize = 5; }\n var _this = this;\n var vertSrc = generateBlurVertSource(kernelSize, horizontal);\n var fragSrc = generateBlurFragSource(kernelSize);\n _this = _super.call(this, \n // vertex shader\n vertSrc, \n // fragment shader\n fragSrc) || this;\n _this.horizontal = horizontal;\n _this.resolution = resolution;\n _this._quality = 0;\n _this.quality = quality;\n _this.blur = strength;\n return _this;\n }\n /**\n * Applies the filter.\n *\n * @param {PIXI.systems.FilterSystem} filterManager - The manager.\n * @param {PIXI.RenderTexture} input - The input target.\n * @param {PIXI.RenderTexture} output - The output target.\n * @param {PIXI.CLEAR_MODES} clearMode - How to clear\n */\n BlurFilterPass.prototype.apply = function (filterManager, input, output, clearMode) {\n if (output) {\n if (this.horizontal) {\n this.uniforms.strength = (1 / output.width) * (output.width / input.width);\n }\n else {\n this.uniforms.strength = (1 / output.height) * (output.height / input.height);\n }\n }\n else {\n if (this.horizontal) // eslint-disable-line\n {\n this.uniforms.strength = (1 / filterManager.renderer.width) * (filterManager.renderer.width / input.width);\n }\n else {\n this.uniforms.strength = (1 / filterManager.renderer.height) * (filterManager.renderer.height / input.height); // eslint-disable-line\n }\n }\n // screen space!\n this.uniforms.strength *= this.strength;\n this.uniforms.strength /= this.passes;\n if (this.passes === 1) {\n filterManager.applyFilter(this, input, output, clearMode);\n }\n else {\n var renderTarget = filterManager.getFilterTexture();\n var renderer = filterManager.renderer;\n var flip = input;\n var flop = renderTarget;\n this.state.blend = false;\n filterManager.applyFilter(this, flip, flop, CLEAR_MODES.CLEAR);\n for (var i = 1; i < this.passes - 1; i++) {\n filterManager.bindAndClear(flip, CLEAR_MODES.BLIT);\n this.uniforms.uSampler = flop;\n var temp = flop;\n flop = flip;\n flip = temp;\n renderer.shader.bind(this);\n renderer.geometry.draw(5);\n }\n this.state.blend = true;\n filterManager.applyFilter(this, flop, output, clearMode);\n filterManager.returnFilterTexture(renderTarget);\n }\n };\n Object.defineProperty(BlurFilterPass.prototype, \"blur\", {\n /**\n * Sets the strength of both the blur.\n *\n * @member {number}\n * @default 16\n */\n get: function () {\n return this.strength;\n },\n set: function (value) {\n this.padding = 1 + (Math.abs(value) * 2);\n this.strength = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilterPass.prototype, \"quality\", {\n /**\n * Sets the quality of the blur by modifying the number of passes. More passes means higher\n * quaility bluring but the lower the performance.\n *\n * @member {number}\n * @default 4\n */\n get: function () {\n return this._quality;\n },\n set: function (value) {\n this._quality = value;\n this.passes = value;\n },\n enumerable: false,\n configurable: true\n });\n return BlurFilterPass;\n}(Filter));\n\n/**\n * The BlurFilter applies a Gaussian blur to an object.\n *\n * The strength of the blur can be set for the x-axis and y-axis separately.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar BlurFilter = /** @class */ (function (_super) {\n __extends(BlurFilter, _super);\n /**\n * @param {number} [strength=8] - The strength of the blur filter.\n * @param {number} [quality=4] - The quality of the blur filter.\n * @param {number} [resolution=PIXI.settings.FILTER_RESOLUTION] - The resolution of the blur filter.\n * @param {number} [kernelSize=5] - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.\n */\n function BlurFilter(strength, quality, resolution, kernelSize) {\n if (strength === void 0) { strength = 8; }\n if (quality === void 0) { quality = 4; }\n if (resolution === void 0) { resolution = settings.FILTER_RESOLUTION; }\n if (kernelSize === void 0) { kernelSize = 5; }\n var _this = _super.call(this) || this;\n _this.blurXFilter = new BlurFilterPass(true, strength, quality, resolution, kernelSize);\n _this.blurYFilter = new BlurFilterPass(false, strength, quality, resolution, kernelSize);\n _this.resolution = resolution;\n _this.quality = quality;\n _this.blur = strength;\n _this.repeatEdgePixels = false;\n return _this;\n }\n /**\n * Applies the filter.\n *\n * @param {PIXI.systems.FilterSystem} filterManager - The manager.\n * @param {PIXI.RenderTexture} input - The input target.\n * @param {PIXI.RenderTexture} output - The output target.\n * @param {PIXI.CLEAR_MODES} clearMode - How to clear\n */\n BlurFilter.prototype.apply = function (filterManager, input, output, clearMode) {\n var xStrength = Math.abs(this.blurXFilter.strength);\n var yStrength = Math.abs(this.blurYFilter.strength);\n if (xStrength && yStrength) {\n var renderTarget = filterManager.getFilterTexture();\n this.blurXFilter.apply(filterManager, input, renderTarget, CLEAR_MODES.CLEAR);\n this.blurYFilter.apply(filterManager, renderTarget, output, clearMode);\n filterManager.returnFilterTexture(renderTarget);\n }\n else if (yStrength) {\n this.blurYFilter.apply(filterManager, input, output, clearMode);\n }\n else {\n this.blurXFilter.apply(filterManager, input, output, clearMode);\n }\n };\n BlurFilter.prototype.updatePadding = function () {\n if (this._repeatEdgePixels) {\n this.padding = 0;\n }\n else {\n this.padding = Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength)) * 2;\n }\n };\n Object.defineProperty(BlurFilter.prototype, \"blur\", {\n /**\n * Sets the strength of both the blurX and blurY properties simultaneously\n *\n * @member {number}\n * @default 2\n */\n get: function () {\n return this.blurXFilter.blur;\n },\n set: function (value) {\n this.blurXFilter.blur = this.blurYFilter.blur = value;\n this.updatePadding();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilter.prototype, \"quality\", {\n /**\n * Sets the number of passes for blur. More passes means higher quaility bluring.\n *\n * @member {number}\n * @default 1\n */\n get: function () {\n return this.blurXFilter.quality;\n },\n set: function (value) {\n this.blurXFilter.quality = this.blurYFilter.quality = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilter.prototype, \"blurX\", {\n /**\n * Sets the strength of the blurX property\n *\n * @member {number}\n * @default 2\n */\n get: function () {\n return this.blurXFilter.blur;\n },\n set: function (value) {\n this.blurXFilter.blur = value;\n this.updatePadding();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilter.prototype, \"blurY\", {\n /**\n * Sets the strength of the blurY property\n *\n * @member {number}\n * @default 2\n */\n get: function () {\n return this.blurYFilter.blur;\n },\n set: function (value) {\n this.blurYFilter.blur = value;\n this.updatePadding();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilter.prototype, \"blendMode\", {\n /**\n * Sets the blendmode of the filter\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL\n */\n get: function () {\n return this.blurYFilter.blendMode;\n },\n set: function (value) {\n this.blurYFilter.blendMode = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilter.prototype, \"repeatEdgePixels\", {\n /**\n * If set to true the edge of the target will be clamped\n *\n * @member {boolean}\n * @default false\n */\n get: function () {\n return this._repeatEdgePixels;\n },\n set: function (value) {\n this._repeatEdgePixels = value;\n this.updatePadding();\n },\n enumerable: false,\n configurable: true\n });\n return BlurFilter;\n}(Filter));\n\nexport { BlurFilter, BlurFilterPass };\n//# sourceMappingURL=filter-blur.es.js.map\n","/*!\n * @pixi/filter-color-matrix - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/filter-color-matrix is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { defaultFilterVertex, Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar fragment = \"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\";\n\n/**\n * The ColorMatrixFilter class lets you apply a 5x4 matrix transformation on the RGBA\n * color and alpha values of every pixel on your displayObject to produce a result\n * with a new set of RGBA color and alpha values. It's pretty powerful!\n *\n * ```js\n * let colorMatrix = new PIXI.filters.ColorMatrixFilter();\n * container.filters = [colorMatrix];\n * colorMatrix.contrast(2);\n * ```\n * @author Clément Chenebault \n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar ColorMatrixFilter = /** @class */ (function (_super) {\n __extends(ColorMatrixFilter, _super);\n function ColorMatrixFilter() {\n var _this = this;\n var uniforms = {\n m: new Float32Array([1, 0, 0, 0, 0,\n 0, 1, 0, 0, 0,\n 0, 0, 1, 0, 0,\n 0, 0, 0, 1, 0]),\n uAlpha: 1,\n };\n _this = _super.call(this, defaultFilterVertex, fragment, uniforms) || this;\n _this.alpha = 1;\n return _this;\n }\n /**\n * Transforms current matrix and set the new one\n *\n * @param {number[]} matrix - 5x4 matrix\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype._loadMatrix = function (matrix, multiply) {\n if (multiply === void 0) { multiply = false; }\n var newMatrix = matrix;\n if (multiply) {\n this._multiply(newMatrix, this.uniforms.m, matrix);\n newMatrix = this._colorMatrix(newMatrix);\n }\n // set the new matrix\n this.uniforms.m = newMatrix;\n };\n /**\n * Multiplies two mat5's\n *\n * @private\n * @param {number[]} out - 5x4 matrix the receiving matrix\n * @param {number[]} a - 5x4 matrix the first operand\n * @param {number[]} b - 5x4 matrix the second operand\n * @returns {number[]} 5x4 matrix\n */\n ColorMatrixFilter.prototype._multiply = function (out, a, b) {\n // Red Channel\n out[0] = (a[0] * b[0]) + (a[1] * b[5]) + (a[2] * b[10]) + (a[3] * b[15]);\n out[1] = (a[0] * b[1]) + (a[1] * b[6]) + (a[2] * b[11]) + (a[3] * b[16]);\n out[2] = (a[0] * b[2]) + (a[1] * b[7]) + (a[2] * b[12]) + (a[3] * b[17]);\n out[3] = (a[0] * b[3]) + (a[1] * b[8]) + (a[2] * b[13]) + (a[3] * b[18]);\n out[4] = (a[0] * b[4]) + (a[1] * b[9]) + (a[2] * b[14]) + (a[3] * b[19]) + a[4];\n // Green Channel\n out[5] = (a[5] * b[0]) + (a[6] * b[5]) + (a[7] * b[10]) + (a[8] * b[15]);\n out[6] = (a[5] * b[1]) + (a[6] * b[6]) + (a[7] * b[11]) + (a[8] * b[16]);\n out[7] = (a[5] * b[2]) + (a[6] * b[7]) + (a[7] * b[12]) + (a[8] * b[17]);\n out[8] = (a[5] * b[3]) + (a[6] * b[8]) + (a[7] * b[13]) + (a[8] * b[18]);\n out[9] = (a[5] * b[4]) + (a[6] * b[9]) + (a[7] * b[14]) + (a[8] * b[19]) + a[9];\n // Blue Channel\n out[10] = (a[10] * b[0]) + (a[11] * b[5]) + (a[12] * b[10]) + (a[13] * b[15]);\n out[11] = (a[10] * b[1]) + (a[11] * b[6]) + (a[12] * b[11]) + (a[13] * b[16]);\n out[12] = (a[10] * b[2]) + (a[11] * b[7]) + (a[12] * b[12]) + (a[13] * b[17]);\n out[13] = (a[10] * b[3]) + (a[11] * b[8]) + (a[12] * b[13]) + (a[13] * b[18]);\n out[14] = (a[10] * b[4]) + (a[11] * b[9]) + (a[12] * b[14]) + (a[13] * b[19]) + a[14];\n // Alpha Channel\n out[15] = (a[15] * b[0]) + (a[16] * b[5]) + (a[17] * b[10]) + (a[18] * b[15]);\n out[16] = (a[15] * b[1]) + (a[16] * b[6]) + (a[17] * b[11]) + (a[18] * b[16]);\n out[17] = (a[15] * b[2]) + (a[16] * b[7]) + (a[17] * b[12]) + (a[18] * b[17]);\n out[18] = (a[15] * b[3]) + (a[16] * b[8]) + (a[17] * b[13]) + (a[18] * b[18]);\n out[19] = (a[15] * b[4]) + (a[16] * b[9]) + (a[17] * b[14]) + (a[18] * b[19]) + a[19];\n return out;\n };\n /**\n * Create a Float32 Array and normalize the offset component to 0-1\n *\n * @private\n * @param {number[]} matrix - 5x4 matrix\n * @return {number[]} 5x4 matrix with all values between 0-1\n */\n ColorMatrixFilter.prototype._colorMatrix = function (matrix) {\n // Create a Float32 Array and normalize the offset component to 0-1\n var m = new Float32Array(matrix);\n m[4] /= 255;\n m[9] /= 255;\n m[14] /= 255;\n m[19] /= 255;\n return m;\n };\n /**\n * Adjusts brightness\n *\n * @param {number} b - value of the brigthness (0-1, where 0 is black)\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.brightness = function (b, multiply) {\n var matrix = [\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Set the matrices in grey scales\n *\n * @param {number} scale - value of the grey (0-1, where 0 is black)\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.greyscale = function (scale, multiply) {\n var matrix = [\n scale, scale, scale, 0, 0,\n scale, scale, scale, 0, 0,\n scale, scale, scale, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Set the black and white matrice.\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.blackAndWhite = function (multiply) {\n var matrix = [\n 0.3, 0.6, 0.1, 0, 0,\n 0.3, 0.6, 0.1, 0, 0,\n 0.3, 0.6, 0.1, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Set the hue property of the color\n *\n * @param {number} rotation - in degrees\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.hue = function (rotation, multiply) {\n rotation = (rotation || 0) / 180 * Math.PI;\n var cosR = Math.cos(rotation);\n var sinR = Math.sin(rotation);\n var sqrt = Math.sqrt;\n /* a good approximation for hue rotation\n This matrix is far better than the versions with magic luminance constants\n formerly used here, but also used in the starling framework (flash) and known from this\n old part of the internet: quasimondo.com/archives/000565.php\n\n This new matrix is based on rgb cube rotation in space. Look here for a more descriptive\n implementation as a shader not a general matrix:\n https://github.com/evanw/glfx.js/blob/58841c23919bd59787effc0333a4897b43835412/src/filters/adjust/huesaturation.js\n\n This is the source for the code:\n see http://stackoverflow.com/questions/8507885/shift-hue-of-an-rgb-color/8510751#8510751\n */\n var w = 1 / 3;\n var sqrW = sqrt(w); // weight is\n var a00 = cosR + ((1.0 - cosR) * w);\n var a01 = (w * (1.0 - cosR)) - (sqrW * sinR);\n var a02 = (w * (1.0 - cosR)) + (sqrW * sinR);\n var a10 = (w * (1.0 - cosR)) + (sqrW * sinR);\n var a11 = cosR + (w * (1.0 - cosR));\n var a12 = (w * (1.0 - cosR)) - (sqrW * sinR);\n var a20 = (w * (1.0 - cosR)) - (sqrW * sinR);\n var a21 = (w * (1.0 - cosR)) + (sqrW * sinR);\n var a22 = cosR + (w * (1.0 - cosR));\n var matrix = [\n a00, a01, a02, 0, 0,\n a10, a11, a12, 0, 0,\n a20, a21, a22, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Set the contrast matrix, increase the separation between dark and bright\n * Increase contrast : shadows darker and highlights brighter\n * Decrease contrast : bring the shadows up and the highlights down\n *\n * @param {number} amount - value of the contrast (0-1)\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.contrast = function (amount, multiply) {\n var v = (amount || 0) + 1;\n var o = -0.5 * (v - 1);\n var matrix = [\n v, 0, 0, 0, o,\n 0, v, 0, 0, o,\n 0, 0, v, 0, o,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Set the saturation matrix, increase the separation between colors\n * Increase saturation : increase contrast, brightness, and sharpness\n *\n * @param {number} amount - The saturation amount (0-1)\n * @param {boolean} [multiply] - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.saturate = function (amount, multiply) {\n if (amount === void 0) { amount = 0; }\n var x = (amount * 2 / 3) + 1;\n var y = ((x - 1) * -0.5);\n var matrix = [\n x, y, y, 0, 0,\n y, x, y, 0, 0,\n y, y, x, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Desaturate image (remove color)\n *\n * Call the saturate function\n *\n */\n ColorMatrixFilter.prototype.desaturate = function () {\n this.saturate(-1);\n };\n /**\n * Negative image (inverse of classic rgb matrix)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.negative = function (multiply) {\n var matrix = [\n -1, 0, 0, 1, 0,\n 0, -1, 0, 1, 0,\n 0, 0, -1, 1, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Sepia image\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.sepia = function (multiply) {\n var matrix = [\n 0.393, 0.7689999, 0.18899999, 0, 0,\n 0.349, 0.6859999, 0.16799999, 0, 0,\n 0.272, 0.5339999, 0.13099999, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Color motion picture process invented in 1916 (thanks Dominic Szablewski)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.technicolor = function (multiply) {\n var matrix = [\n 1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337,\n -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398,\n -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Polaroid filter\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.polaroid = function (multiply) {\n var matrix = [\n 1.438, -0.062, -0.062, 0, 0,\n -0.122, 1.378, -0.122, 0, 0,\n -0.016, -0.016, 1.483, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Filter who transforms : Red -> Blue and Blue -> Red\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.toBGR = function (multiply) {\n var matrix = [\n 0, 0, 1, 0, 0,\n 0, 1, 0, 0, 0,\n 1, 0, 0, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Color reversal film introduced by Eastman Kodak in 1935. (thanks Dominic Szablewski)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.kodachrome = function (multiply) {\n var matrix = [\n 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502,\n -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203,\n -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Brown delicious browni filter (thanks Dominic Szablewski)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.browni = function (multiply) {\n var matrix = [\n 0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873,\n -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127,\n 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Vintage filter (thanks Dominic Szablewski)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.vintage = function (multiply) {\n var matrix = [\n 0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123,\n 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591,\n 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * We don't know exactly what it does, kind of gradient map, but funny to play with!\n *\n * @param {number} desaturation - Tone values.\n * @param {number} toned - Tone values.\n * @param {number} lightColor - Tone values, example: `0xFFE580`\n * @param {number} darkColor - Tone values, example: `0xFFE580`\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.colorTone = function (desaturation, toned, lightColor, darkColor, multiply) {\n desaturation = desaturation || 0.2;\n toned = toned || 0.15;\n lightColor = lightColor || 0xFFE580;\n darkColor = darkColor || 0x338000;\n var lR = ((lightColor >> 16) & 0xFF) / 255;\n var lG = ((lightColor >> 8) & 0xFF) / 255;\n var lB = (lightColor & 0xFF) / 255;\n var dR = ((darkColor >> 16) & 0xFF) / 255;\n var dG = ((darkColor >> 8) & 0xFF) / 255;\n var dB = (darkColor & 0xFF) / 255;\n var matrix = [\n 0.3, 0.59, 0.11, 0, 0,\n lR, lG, lB, desaturation, 0,\n dR, dG, dB, toned, 0,\n lR - dR, lG - dG, lB - dB, 0, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Night effect\n *\n * @param {number} intensity - The intensity of the night effect.\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.night = function (intensity, multiply) {\n intensity = intensity || 0.1;\n var matrix = [\n intensity * (-2.0), -intensity, 0, 0, 0,\n -intensity, 0, intensity, 0, 0,\n 0, intensity, intensity * 2.0, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Predator effect\n *\n * Erase the current matrix by setting a new indepent one\n *\n * @param {number} amount - how much the predator feels his future victim\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.predator = function (amount, multiply) {\n var matrix = [\n // row 1\n 11.224130630493164 * amount,\n -4.794486999511719 * amount,\n -2.8746118545532227 * amount,\n 0 * amount,\n 0.40342438220977783 * amount,\n // row 2\n -3.6330697536468506 * amount,\n 9.193157196044922 * amount,\n -2.951810836791992 * amount,\n 0 * amount,\n -1.316135048866272 * amount,\n // row 3\n -3.2184197902679443 * amount,\n -4.2375030517578125 * amount,\n 7.476448059082031 * amount,\n 0 * amount,\n 0.8044459223747253 * amount,\n // row 4\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * LSD effect\n *\n * Multiply the current matrix\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.lsd = function (multiply) {\n var matrix = [\n 2, -0.4, 0.5, 0, 0,\n -0.5, 2, -0.4, 0, 0,\n -0.4, -0.5, 3, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Erase the current matrix by setting the default one\n *\n */\n ColorMatrixFilter.prototype.reset = function () {\n var matrix = [\n 1, 0, 0, 0, 0,\n 0, 1, 0, 0, 0,\n 0, 0, 1, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, false);\n };\n Object.defineProperty(ColorMatrixFilter.prototype, \"matrix\", {\n /**\n * The matrix of the color matrix filter\n *\n * @member {number[]}\n * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]\n */\n get: function () {\n return this.uniforms.m;\n },\n set: function (value) {\n this.uniforms.m = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ColorMatrixFilter.prototype, \"alpha\", {\n /**\n * The opacity value to use when mixing the original and resultant colors.\n *\n * When the value is 0, the original color is used without modification.\n * When the value is 1, the result color is used.\n * When in the range (0, 1) the color is interpolated between the original and result by this amount.\n *\n * @member {number}\n * @default 1\n */\n get: function () {\n return this.uniforms.uAlpha;\n },\n set: function (value) {\n this.uniforms.uAlpha = value;\n },\n enumerable: false,\n configurable: true\n });\n return ColorMatrixFilter;\n}(Filter));\n// Americanized alias\nColorMatrixFilter.prototype.grayscale = ColorMatrixFilter.prototype.greyscale;\n\nexport { ColorMatrixFilter };\n//# sourceMappingURL=filter-color-matrix.es.js.map\n","/*!\n * @pixi/filter-displacement - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/filter-displacement is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { Matrix, Point } from '@pixi/math';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar fragment = \"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\";\n\nvar vertex = \"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\";\n\n/**\n * The DisplacementFilter class uses the pixel values from the specified texture\n * (called the displacement map) to perform a displacement of an object.\n *\n * You can use this filter to apply all manor of crazy warping effects.\n * Currently the `r` property of the texture is used to offset the `x`\n * and the `g` property of the texture is used to offset the `y`.\n *\n * The way it works is it uses the values of the displacement map to look up the\n * correct pixels to output. This means it's not technically moving the original.\n * Instead, it's starting at the output and asking \"which pixel from the original goes here\".\n * For example, if a displacement map pixel has `red = 1` and the filter scale is `20`,\n * this filter will output the pixel approximately 20 pixels to the right of the original.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar DisplacementFilter = /** @class */ (function (_super) {\n __extends(DisplacementFilter, _super);\n /**\n * @param {PIXI.Sprite} sprite - The sprite used for the displacement map. (make sure its added to the scene!)\n * @param {number} [scale] - The scale of the displacement\n */\n function DisplacementFilter(sprite, scale) {\n var _this = this;\n var maskMatrix = new Matrix();\n sprite.renderable = false;\n _this = _super.call(this, vertex, fragment, {\n mapSampler: sprite._texture,\n filterMatrix: maskMatrix,\n scale: { x: 1, y: 1 },\n rotation: new Float32Array([1, 0, 0, 1]),\n }) || this;\n _this.maskSprite = sprite;\n _this.maskMatrix = maskMatrix;\n if (scale === null || scale === undefined) {\n scale = 20;\n }\n /**\n * scaleX, scaleY for displacements\n * @member {PIXI.Point}\n */\n _this.scale = new Point(scale, scale);\n return _this;\n }\n /**\n * Applies the filter.\n *\n * @param {PIXI.systems.FilterSystem} filterManager - The manager.\n * @param {PIXI.RenderTexture} input - The input target.\n * @param {PIXI.RenderTexture} output - The output target.\n * @param {PIXI.CLEAR_MODES} clearMode - clearMode.\n */\n DisplacementFilter.prototype.apply = function (filterManager, input, output, clearMode) {\n // fill maskMatrix with _normalized sprite texture coords_\n this.uniforms.filterMatrix = filterManager.calculateSpriteMatrix(this.maskMatrix, this.maskSprite);\n this.uniforms.scale.x = this.scale.x;\n this.uniforms.scale.y = this.scale.y;\n // Extract rotation from world transform\n var wt = this.maskSprite.worldTransform;\n var lenX = Math.sqrt((wt.a * wt.a) + (wt.b * wt.b));\n var lenY = Math.sqrt((wt.c * wt.c) + (wt.d * wt.d));\n if (lenX !== 0 && lenY !== 0) {\n this.uniforms.rotation[0] = wt.a / lenX;\n this.uniforms.rotation[1] = wt.b / lenX;\n this.uniforms.rotation[2] = wt.c / lenY;\n this.uniforms.rotation[3] = wt.d / lenY;\n }\n // draw the filter...\n filterManager.applyFilter(this, input, output, clearMode);\n };\n Object.defineProperty(DisplacementFilter.prototype, \"map\", {\n /**\n * The texture used for the displacement map. Must be power of 2 sized texture.\n *\n * @member {PIXI.Texture}\n */\n get: function () {\n return this.uniforms.mapSampler;\n },\n set: function (value) {\n this.uniforms.mapSampler = value;\n },\n enumerable: false,\n configurable: true\n });\n return DisplacementFilter;\n}(Filter));\n\nexport { DisplacementFilter };\n//# sourceMappingURL=filter-displacement.es.js.map\n","/*!\n * @pixi/filter-fxaa - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/filter-fxaa is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"\\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\";\n\nvar fragment = \"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\";\n\n/**\n * Basic FXAA (Fast Approximate Anti-Aliasing) implementation based on the code on geeks3d.com\n * with the modification that the texture2DLod stuff was removed since it is unsupported by WebGL.\n *\n * @see https://github.com/mitsuhiko/webgl-meincraft\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n *\n */\nvar FXAAFilter = /** @class */ (function (_super) {\n __extends(FXAAFilter, _super);\n function FXAAFilter() {\n // TODO - needs work\n return _super.call(this, vertex, fragment) || this;\n }\n return FXAAFilter;\n}(Filter));\n\nexport { FXAAFilter };\n//# sourceMappingURL=filter-fxaa.es.js.map\n","/*!\n * @pixi/filter-noise - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/filter-noise is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { defaultFilterVertex, Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar fragment = \"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\";\n\n/**\n * @author Vico @vicocotea\n * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js\n */\n/**\n * A Noise effect filter.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar NoiseFilter = /** @class */ (function (_super) {\n __extends(NoiseFilter, _super);\n /**\n * @param {number} [noise=0.5] - The noise intensity, should be a normalized value in the range [0, 1].\n * @param {number} [seed] - A random seed for the noise generation. Default is `Math.random()`.\n */\n function NoiseFilter(noise, seed) {\n if (noise === void 0) { noise = 0.5; }\n if (seed === void 0) { seed = Math.random(); }\n var _this = _super.call(this, defaultFilterVertex, fragment, {\n uNoise: 0,\n uSeed: 0,\n }) || this;\n _this.noise = noise;\n _this.seed = seed;\n return _this;\n }\n Object.defineProperty(NoiseFilter.prototype, \"noise\", {\n /**\n * The amount of noise to apply, this value should be in the range (0, 1].\n *\n * @member {number}\n * @default 0.5\n */\n get: function () {\n return this.uniforms.uNoise;\n },\n set: function (value) {\n this.uniforms.uNoise = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NoiseFilter.prototype, \"seed\", {\n /**\n * A seed value to apply to the random noise generation. `Math.random()` is a good value to use.\n *\n * @member {number}\n */\n get: function () {\n return this.uniforms.uSeed;\n },\n set: function (value) {\n this.uniforms.uSeed = value;\n },\n enumerable: false,\n configurable: true\n });\n return NoiseFilter;\n}(Filter));\n\nexport { NoiseFilter };\n//# sourceMappingURL=filter-noise.es.js.map\n","/*!\n * @pixi/mixin-cache-as-bitmap - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/mixin-cache-as-bitmap is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { RenderTexture, BaseTexture, Texture } from '@pixi/core';\nimport { Sprite } from '@pixi/sprite';\nimport { DisplayObject } from '@pixi/display';\nimport { Matrix } from '@pixi/math';\nimport { uid } from '@pixi/utils';\nimport { settings } from '@pixi/settings';\n\nvar _tempMatrix = new Matrix();\nDisplayObject.prototype._cacheAsBitmap = false;\nDisplayObject.prototype._cacheData = null;\n// figured there's no point adding ALL the extra variables to prototype.\n// this model can hold the information needed. This can also be generated on demand as\n// most objects are not cached as bitmaps.\n/**\n * @class\n * @ignore\n */\nvar CacheData = /** @class */ (function () {\n function CacheData() {\n this.textureCacheId = null;\n this.originalRender = null;\n this.originalRenderCanvas = null;\n this.originalCalculateBounds = null;\n this.originalGetLocalBounds = null;\n this.originalUpdateTransform = null;\n this.originalDestroy = null;\n this.originalMask = null;\n this.originalFilterArea = null;\n this.originalContainsPoint = null;\n this.sprite = null;\n }\n return CacheData;\n}());\nObject.defineProperties(DisplayObject.prototype, {\n /**\n * Set this to true if you want this display object to be cached as a bitmap.\n * This basically takes a snap shot of the display object as it is at that moment. It can\n * provide a performance benefit for complex static displayObjects.\n * To remove simply set this property to `false`\n *\n * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true\n * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.\n *\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n cacheAsBitmap: {\n get: function () {\n return this._cacheAsBitmap;\n },\n set: function (value) {\n if (this._cacheAsBitmap === value) {\n return;\n }\n this._cacheAsBitmap = value;\n var data;\n if (value) {\n if (!this._cacheData) {\n this._cacheData = new CacheData();\n }\n data = this._cacheData;\n data.originalRender = this.render;\n data.originalRenderCanvas = this.renderCanvas;\n data.originalUpdateTransform = this.updateTransform;\n data.originalCalculateBounds = this.calculateBounds;\n data.originalGetLocalBounds = this.getLocalBounds;\n data.originalDestroy = this.destroy;\n data.originalContainsPoint = this.containsPoint;\n data.originalMask = this._mask;\n data.originalFilterArea = this.filterArea;\n this.render = this._renderCached;\n this.renderCanvas = this._renderCachedCanvas;\n this.destroy = this._cacheAsBitmapDestroy;\n }\n else {\n data = this._cacheData;\n if (data.sprite) {\n this._destroyCachedDisplayObject();\n }\n this.render = data.originalRender;\n this.renderCanvas = data.originalRenderCanvas;\n this.calculateBounds = data.originalCalculateBounds;\n this.getLocalBounds = data.originalGetLocalBounds;\n this.destroy = data.originalDestroy;\n this.updateTransform = data.originalUpdateTransform;\n this.containsPoint = data.originalContainsPoint;\n this._mask = data.originalMask;\n this.filterArea = data.originalFilterArea;\n }\n },\n },\n});\n/**\n * Renders a cached version of the sprite with WebGL\n *\n * @private\n * @function _renderCached\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.Renderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._renderCached = function _renderCached(renderer) {\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n this._initCachedDisplayObject(renderer);\n this._cacheData.sprite.transform._worldID = this.transform._worldID;\n this._cacheData.sprite.worldAlpha = this.worldAlpha;\n this._cacheData.sprite._render(renderer);\n};\n/**\n * Prepares the WebGL renderer to cache the sprite\n *\n * @private\n * @function _initCachedDisplayObject\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.Renderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._initCachedDisplayObject = function _initCachedDisplayObject(renderer) {\n if (this._cacheData && this._cacheData.sprite) {\n return;\n }\n // make sure alpha is set to 1 otherwise it will get rendered as invisible!\n var cacheAlpha = this.alpha;\n this.alpha = 1;\n // first we flush anything left in the renderer (otherwise it would get rendered to the cached texture)\n renderer.batch.flush();\n // this.filters= [];\n // next we find the dimensions of the untransformed object\n // this function also calls updatetransform on all its children as part of the measuring.\n // This means we don't need to update the transform again in this function\n // TODO pass an object to clone too? saves having to create a new one each time!\n var bounds = this.getLocalBounds(null, true).clone();\n // add some padding!\n if (this.filters) {\n var padding = this.filters[0].padding;\n bounds.pad(padding);\n }\n bounds.ceil(settings.RESOLUTION);\n // for now we cache the current renderTarget that the WebGL renderer is currently using.\n // this could be more elegant..\n var cachedRenderTexture = renderer.renderTexture.current;\n var cachedSourceFrame = renderer.renderTexture.sourceFrame.clone();\n var cachedProjectionTransform = renderer.projection.transform;\n // We also store the filter stack - I will definitely look to change how this works a little later down the line.\n // const stack = renderer.filterManager.filterStack;\n // this renderTexture will be used to store the cached DisplayObject\n var renderTexture = RenderTexture.create({ width: bounds.width, height: bounds.height });\n var textureCacheId = \"cacheAsBitmap_\" + uid();\n this._cacheData.textureCacheId = textureCacheId;\n BaseTexture.addToCache(renderTexture.baseTexture, textureCacheId);\n Texture.addToCache(renderTexture, textureCacheId);\n // need to set //\n var m = this.transform.localTransform.copyTo(_tempMatrix).invert().translate(-bounds.x, -bounds.y);\n // set all properties to there original so we can render to a texture\n this.render = this._cacheData.originalRender;\n renderer.render(this, renderTexture, true, m, false);\n // now restore the state be setting the new properties\n renderer.projection.transform = cachedProjectionTransform;\n renderer.renderTexture.bind(cachedRenderTexture, cachedSourceFrame);\n // renderer.filterManager.filterStack = stack;\n this.render = this._renderCached;\n // the rest is the same as for Canvas\n this.updateTransform = this.displayObjectUpdateTransform;\n this.calculateBounds = this._calculateCachedBounds;\n this.getLocalBounds = this._getCachedLocalBounds;\n this._mask = null;\n this.filterArea = null;\n // create our cached sprite\n var cachedSprite = new Sprite(renderTexture);\n cachedSprite.transform.worldTransform = this.transform.worldTransform;\n cachedSprite.anchor.x = -(bounds.x / bounds.width);\n cachedSprite.anchor.y = -(bounds.y / bounds.height);\n cachedSprite.alpha = cacheAlpha;\n cachedSprite._bounds = this._bounds;\n this._cacheData.sprite = cachedSprite;\n this.transform._parentID = -1;\n // restore the transform of the cached sprite to avoid the nasty flicker..\n if (!this.parent) {\n this.enableTempParent();\n this.updateTransform();\n this.disableTempParent(null);\n }\n else {\n this.updateTransform();\n }\n // map the hit test..\n this.containsPoint = cachedSprite.containsPoint.bind(cachedSprite);\n};\n/**\n * Renders a cached version of the sprite with canvas\n *\n * @private\n * @function _renderCachedCanvas\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.CanvasRenderer} renderer - The canvas renderer\n */\nDisplayObject.prototype._renderCachedCanvas = function _renderCachedCanvas(renderer) {\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n this._initCachedDisplayObjectCanvas(renderer);\n this._cacheData.sprite.worldAlpha = this.worldAlpha;\n this._cacheData.sprite._renderCanvas(renderer);\n};\n// TODO this can be the same as the WebGL version.. will need to do a little tweaking first though..\n/**\n * Prepares the Canvas renderer to cache the sprite\n *\n * @private\n * @function _initCachedDisplayObjectCanvas\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.CanvasRenderer} renderer - The canvas renderer\n */\nDisplayObject.prototype._initCachedDisplayObjectCanvas = function _initCachedDisplayObjectCanvas(renderer) {\n if (this._cacheData && this._cacheData.sprite) {\n return;\n }\n // get bounds actually transforms the object for us already!\n var bounds = this.getLocalBounds(null, true);\n var cacheAlpha = this.alpha;\n this.alpha = 1;\n var cachedRenderTarget = renderer.context;\n var cachedProjectionTransform = renderer._projTransform;\n bounds.ceil(settings.RESOLUTION);\n var renderTexture = RenderTexture.create({ width: bounds.width, height: bounds.height });\n var textureCacheId = \"cacheAsBitmap_\" + uid();\n this._cacheData.textureCacheId = textureCacheId;\n BaseTexture.addToCache(renderTexture.baseTexture, textureCacheId);\n Texture.addToCache(renderTexture, textureCacheId);\n // need to set //\n var m = _tempMatrix;\n this.transform.localTransform.copyTo(m);\n m.invert();\n m.tx -= bounds.x;\n m.ty -= bounds.y;\n // m.append(this.transform.worldTransform.)\n // set all properties to there original so we can render to a texture\n this.renderCanvas = this._cacheData.originalRenderCanvas;\n renderer.render(this, renderTexture, true, m, false);\n // now restore the state be setting the new properties\n renderer.context = cachedRenderTarget;\n renderer._projTransform = cachedProjectionTransform;\n this.renderCanvas = this._renderCachedCanvas;\n // the rest is the same as for WebGL\n this.updateTransform = this.displayObjectUpdateTransform;\n this.calculateBounds = this._calculateCachedBounds;\n this.getLocalBounds = this._getCachedLocalBounds;\n this._mask = null;\n this.filterArea = null;\n // create our cached sprite\n var cachedSprite = new Sprite(renderTexture);\n cachedSprite.transform.worldTransform = this.transform.worldTransform;\n cachedSprite.anchor.x = -(bounds.x / bounds.width);\n cachedSprite.anchor.y = -(bounds.y / bounds.height);\n cachedSprite.alpha = cacheAlpha;\n cachedSprite._bounds = this._bounds;\n this._cacheData.sprite = cachedSprite;\n this.transform._parentID = -1;\n // restore the transform of the cached sprite to avoid the nasty flicker..\n if (!this.parent) {\n this.parent = renderer._tempDisplayObjectParent;\n this.updateTransform();\n this.parent = null;\n }\n else {\n this.updateTransform();\n }\n // map the hit test..\n this.containsPoint = cachedSprite.containsPoint.bind(cachedSprite);\n};\n/**\n * Calculates the bounds of the cached sprite\n *\n * @private\n */\nDisplayObject.prototype._calculateCachedBounds = function _calculateCachedBounds() {\n this._bounds.clear();\n this._cacheData.sprite.transform._worldID = this.transform._worldID;\n this._cacheData.sprite._calculateBounds();\n this._bounds.updateID = this._boundsID;\n};\n/**\n * Gets the bounds of the cached sprite.\n *\n * @private\n * @return {Rectangle} The local bounds.\n */\nDisplayObject.prototype._getCachedLocalBounds = function _getCachedLocalBounds() {\n return this._cacheData.sprite.getLocalBounds(null);\n};\n/**\n * Destroys the cached sprite.\n *\n * @private\n */\nDisplayObject.prototype._destroyCachedDisplayObject = function _destroyCachedDisplayObject() {\n this._cacheData.sprite._texture.destroy(true);\n this._cacheData.sprite = null;\n BaseTexture.removeFromCache(this._cacheData.textureCacheId);\n Texture.removeFromCache(this._cacheData.textureCacheId);\n this._cacheData.textureCacheId = null;\n};\n/**\n * Destroys the cached object.\n *\n * @private\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value.\n * Used when destroying containers, see the Container.destroy method.\n */\nDisplayObject.prototype._cacheAsBitmapDestroy = function _cacheAsBitmapDestroy(options) {\n this.cacheAsBitmap = false;\n this.destroy(options);\n};\n\nexport { CacheData };\n//# sourceMappingURL=mixin-cache-as-bitmap.es.js.map\n","/*!\n * @pixi/mixin-get-child-by-name - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/mixin-get-child-by-name is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { DisplayObject, Container } from '@pixi/display';\n\n/**\n * The instance name of the object.\n *\n * @memberof PIXI.DisplayObject#\n * @member {string} name\n */\nDisplayObject.prototype.name = null;\n/**\n * Returns the display object in the container.\n *\n * Recursive searches are done in a preorder traversal.\n *\n * @method getChildByName\n * @memberof PIXI.Container#\n * @param {string} name - Instance name.\n * @param {boolean}[deep=false] - Whether to search recursively\n * @return {PIXI.DisplayObject} The child with the specified name.\n */\nContainer.prototype.getChildByName = function getChildByName(name, deep) {\n for (var i = 0, j = this.children.length; i < j; i++) {\n if (this.children[i].name === name) {\n return this.children[i];\n }\n }\n if (deep) {\n for (var i = 0, j = this.children.length; i < j; i++) {\n var child = this.children[i];\n if (!child.getChildByName) {\n continue;\n }\n var target = this.children[i].getChildByName(name, true);\n if (target) {\n return target;\n }\n }\n }\n return null;\n};\n//# sourceMappingURL=mixin-get-child-by-name.es.js.map\n","/*!\n * @pixi/mixin-get-global-position - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/mixin-get-global-position is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { DisplayObject } from '@pixi/display';\nimport { Point } from '@pixi/math';\n\n/**\n * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.\n *\n * @method getGlobalPosition\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.Point} [point=new PIXI.Point()] - The point to write the global value to.\n * @param {boolean} [skipUpdate=false] - Setting to true will stop the transforms of the scene graph from\n * being updated. This means the calculation returned MAY be out of date BUT will give you a\n * nice performance boost.\n * @return {PIXI.Point} The updated point.\n */\nDisplayObject.prototype.getGlobalPosition = function getGlobalPosition(point, skipUpdate) {\n if (point === void 0) { point = new Point(); }\n if (skipUpdate === void 0) { skipUpdate = false; }\n if (this.parent) {\n this.parent.toGlobal(this.position, point, skipUpdate);\n }\n else {\n point.x = this.position.x;\n point.y = this.position.y;\n }\n return point;\n};\n//# sourceMappingURL=mixin-get-global-position.es.js.map\n","/*!\n * @pixi/mesh-extras - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/mesh-extras is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { MeshGeometry, MeshMaterial, Mesh } from '@pixi/mesh';\nimport { WRAP_MODES } from '@pixi/constants';\nimport { Texture } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar PlaneGeometry = /** @class */ (function (_super) {\n __extends(PlaneGeometry, _super);\n function PlaneGeometry(width, height, segWidth, segHeight) {\n if (width === void 0) { width = 100; }\n if (height === void 0) { height = 100; }\n if (segWidth === void 0) { segWidth = 10; }\n if (segHeight === void 0) { segHeight = 10; }\n var _this = _super.call(this) || this;\n _this.segWidth = segWidth;\n _this.segHeight = segHeight;\n _this.width = width;\n _this.height = height;\n _this.build();\n return _this;\n }\n /**\n * Refreshes plane coordinates\n * @private\n */\n PlaneGeometry.prototype.build = function () {\n var total = this.segWidth * this.segHeight;\n var verts = [];\n var uvs = [];\n var indices = [];\n var segmentsX = this.segWidth - 1;\n var segmentsY = this.segHeight - 1;\n var sizeX = (this.width) / segmentsX;\n var sizeY = (this.height) / segmentsY;\n for (var i = 0; i < total; i++) {\n var x = (i % this.segWidth);\n var y = ((i / this.segWidth) | 0);\n verts.push(x * sizeX, y * sizeY);\n uvs.push(x / segmentsX, y / segmentsY);\n }\n var totalSub = segmentsX * segmentsY;\n for (var i = 0; i < totalSub; i++) {\n var xpos = i % segmentsX;\n var ypos = (i / segmentsX) | 0;\n var value = (ypos * this.segWidth) + xpos;\n var value2 = (ypos * this.segWidth) + xpos + 1;\n var value3 = ((ypos + 1) * this.segWidth) + xpos;\n var value4 = ((ypos + 1) * this.segWidth) + xpos + 1;\n indices.push(value, value2, value3, value2, value4, value3);\n }\n this.buffers[0].data = new Float32Array(verts);\n this.buffers[1].data = new Float32Array(uvs);\n this.indexBuffer.data = new Uint16Array(indices);\n // ensure that the changes are uploaded\n this.buffers[0].update();\n this.buffers[1].update();\n this.indexBuffer.update();\n };\n return PlaneGeometry;\n}(MeshGeometry));\n\n/**\n * RopeGeometry allows you to draw a geometry across several points and then manipulate these points.\n *\n * ```js\n * for (let i = 0; i < 20; i++) {\n * points.push(new PIXI.Point(i * 50, 0));\n * };\n * const rope = new PIXI.RopeGeometry(100, points);\n * ```\n *\n * @class\n * @extends PIXI.MeshGeometry\n * @memberof PIXI\n *\n */\nvar RopeGeometry = /** @class */ (function (_super) {\n __extends(RopeGeometry, _super);\n /**\n * @param {number} [width=200] - The width (i.e., thickness) of the rope.\n * @param {PIXI.Point[]} [points] - An array of {@link PIXI.Point} objects to construct this rope.\n * @param {number} [textureScale=0] - By default the rope texture will be stretched to match\n * rope length. If textureScale is positive this value will be treated as a scaling\n * factor and the texture will preserve its aspect ratio instead. To create a tiling rope\n * set baseTexture.wrapMode to {@link PIXI.WRAP_MODES.REPEAT} and use a power of two texture,\n * then set textureScale=1 to keep the original texture pixel size.\n * In order to reduce alpha channel artifacts provide a larger texture and downsample -\n * i.e. set textureScale=0.5 to scale it down twice.\n */\n function RopeGeometry(width, points, textureScale) {\n if (width === void 0) { width = 200; }\n if (textureScale === void 0) { textureScale = 0; }\n var _this = _super.call(this, new Float32Array(points.length * 4), new Float32Array(points.length * 4), new Uint16Array((points.length - 1) * 6)) || this;\n /**\n * An array of points that determine the rope\n * @member {PIXI.Point[]}\n */\n _this.points = points;\n /**\n * The width (i.e., thickness) of the rope.\n * @member {number}\n * @readOnly\n */\n _this._width = width;\n /**\n * Rope texture scale, if zero then the rope texture is stretched.\n * @member {number}\n * @readOnly\n */\n _this.textureScale = textureScale;\n _this.build();\n return _this;\n }\n Object.defineProperty(RopeGeometry.prototype, \"width\", {\n /**\n * The width (i.e., thickness) of the rope.\n * @member {number}\n * @readOnly\n */\n get: function () {\n return this._width;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Refreshes Rope indices and uvs\n * @private\n */\n RopeGeometry.prototype.build = function () {\n var points = this.points;\n if (!points)\n { return; }\n var vertexBuffer = this.getBuffer('aVertexPosition');\n var uvBuffer = this.getBuffer('aTextureCoord');\n var indexBuffer = this.getIndex();\n // if too little points, or texture hasn't got UVs set yet just move on.\n if (points.length < 1) {\n return;\n }\n // if the number of points has changed we will need to recreate the arraybuffers\n if (vertexBuffer.data.length / 4 !== points.length) {\n vertexBuffer.data = new Float32Array(points.length * 4);\n uvBuffer.data = new Float32Array(points.length * 4);\n indexBuffer.data = new Uint16Array((points.length - 1) * 6);\n }\n var uvs = uvBuffer.data;\n var indices = indexBuffer.data;\n uvs[0] = 0;\n uvs[1] = 0;\n uvs[2] = 0;\n uvs[3] = 1;\n var amount = 0;\n var prev = points[0];\n var textureWidth = this._width * this.textureScale;\n var total = points.length; // - 1;\n for (var i = 0; i < total; i++) {\n // time to do some smart drawing!\n var index = i * 4;\n if (this.textureScale > 0) {\n // calculate pixel distance from previous point\n var dx = prev.x - points[i].x;\n var dy = prev.y - points[i].y;\n var distance = Math.sqrt((dx * dx) + (dy * dy));\n prev = points[i];\n amount += distance / textureWidth;\n }\n else {\n // stretch texture\n amount = i / (total - 1);\n }\n uvs[index] = amount;\n uvs[index + 1] = 0;\n uvs[index + 2] = amount;\n uvs[index + 3] = 1;\n }\n var indexCount = 0;\n for (var i = 0; i < total - 1; i++) {\n var index = i * 2;\n indices[indexCount++] = index;\n indices[indexCount++] = index + 1;\n indices[indexCount++] = index + 2;\n indices[indexCount++] = index + 2;\n indices[indexCount++] = index + 1;\n indices[indexCount++] = index + 3;\n }\n // ensure that the changes are uploaded\n uvBuffer.update();\n indexBuffer.update();\n this.updateVertices();\n };\n /**\n * refreshes vertices of Rope mesh\n */\n RopeGeometry.prototype.updateVertices = function () {\n var points = this.points;\n if (points.length < 1) {\n return;\n }\n var lastPoint = points[0];\n var nextPoint;\n var perpX = 0;\n var perpY = 0;\n var vertices = this.buffers[0].data;\n var total = points.length;\n for (var i = 0; i < total; i++) {\n var point = points[i];\n var index = i * 4;\n if (i < points.length - 1) {\n nextPoint = points[i + 1];\n }\n else {\n nextPoint = point;\n }\n perpY = -(nextPoint.x - lastPoint.x);\n perpX = nextPoint.y - lastPoint.y;\n var perpLength = Math.sqrt((perpX * perpX) + (perpY * perpY));\n var num = this.textureScale > 0 ? this.textureScale * this._width / 2 : this._width / 2;\n perpX /= perpLength;\n perpY /= perpLength;\n perpX *= num;\n perpY *= num;\n vertices[index] = point.x + perpX;\n vertices[index + 1] = point.y + perpY;\n vertices[index + 2] = point.x - perpX;\n vertices[index + 3] = point.y - perpY;\n lastPoint = point;\n }\n this.buffers[0].update();\n };\n RopeGeometry.prototype.update = function () {\n if (this.textureScale > 0) {\n this.build(); // we need to update UVs\n }\n else {\n this.updateVertices();\n }\n };\n return RopeGeometry;\n}(MeshGeometry));\n\n/**\n * The rope allows you to draw a texture across several points and then manipulate these points\n *\n *```js\n * for (let i = 0; i < 20; i++) {\n * points.push(new PIXI.Point(i * 50, 0));\n * };\n * let rope = new PIXI.SimpleRope(PIXI.Texture.from(\"snake.png\"), points);\n * ```\n *\n * @class\n * @extends PIXI.Mesh\n * @memberof PIXI\n *\n */\nvar SimpleRope = /** @class */ (function (_super) {\n __extends(SimpleRope, _super);\n /**\n * @param {PIXI.Texture} texture - The texture to use on the rope.\n * @param {PIXI.Point[]} points - An array of {@link PIXI.Point} objects to construct this rope.\n * @param {number} [textureScale=0] - Optional. Positive values scale rope texture\n * keeping its aspect ratio. You can reduce alpha channel artifacts by providing a larger texture\n * and downsampling here. If set to zero, texture will be streched instead.\n */\n function SimpleRope(texture, points, textureScale) {\n if (textureScale === void 0) { textureScale = 0; }\n var _this = this;\n var ropeGeometry = new RopeGeometry(texture.height, points, textureScale);\n var meshMaterial = new MeshMaterial(texture);\n if (textureScale > 0) {\n // attempt to set UV wrapping, will fail on non-power of two textures\n texture.baseTexture.wrapMode = WRAP_MODES.REPEAT;\n }\n _this = _super.call(this, ropeGeometry, meshMaterial) || this;\n /**\n * re-calculate vertices by rope points each frame\n *\n * @member {boolean}\n */\n _this.autoUpdate = true;\n return _this;\n }\n SimpleRope.prototype._render = function (renderer) {\n var geometry = this.geometry;\n if (this.autoUpdate || geometry._width !== this.shader.texture.height) {\n geometry._width = this.shader.texture.height;\n geometry.update();\n }\n _super.prototype._render.call(this, renderer);\n };\n return SimpleRope;\n}(Mesh));\n\n/**\n * The SimplePlane allows you to draw a texture across several points and then manipulate these points\n *\n *```js\n * for (let i = 0; i < 20; i++) {\n * points.push(new PIXI.Point(i * 50, 0));\n * };\n * let SimplePlane = new PIXI.SimplePlane(PIXI.Texture.from(\"snake.png\"), points);\n * ```\n *\n * @class\n * @extends PIXI.Mesh\n * @memberof PIXI\n *\n */\nvar SimplePlane = /** @class */ (function (_super) {\n __extends(SimplePlane, _super);\n /**\n * @param {PIXI.Texture} texture - The texture to use on the SimplePlane.\n * @param {number} verticesX - The number of vertices in the x-axis\n * @param {number} verticesY - The number of vertices in the y-axis\n */\n function SimplePlane(texture, verticesX, verticesY) {\n var _this = this;\n var planeGeometry = new PlaneGeometry(texture.width, texture.height, verticesX, verticesY);\n var meshMaterial = new MeshMaterial(Texture.WHITE);\n _this = _super.call(this, planeGeometry, meshMaterial) || this;\n // lets call the setter to ensure all necessary updates are performed\n _this.texture = texture;\n return _this;\n }\n /**\n * Method used for overrides, to do something in case texture frame was changed.\n * Meshes based on plane can override it and change more details based on texture.\n */\n SimplePlane.prototype.textureUpdated = function () {\n this._textureID = this.shader.texture._updateID;\n var geometry = this.geometry;\n geometry.width = this.shader.texture.width;\n geometry.height = this.shader.texture.height;\n geometry.build();\n };\n Object.defineProperty(SimplePlane.prototype, \"texture\", {\n get: function () {\n return this.shader.texture;\n },\n set: function (value) {\n // Track texture same way sprite does.\n // For generated meshes like NineSlicePlane it can change the geometry.\n // Unfortunately, this method might not work if you directly change texture in material.\n if (this.shader.texture === value) {\n return;\n }\n this.shader.texture = value;\n this._textureID = -1;\n if (value.baseTexture.valid) {\n this.textureUpdated();\n }\n else {\n value.once('update', this.textureUpdated, this);\n }\n },\n enumerable: false,\n configurable: true\n });\n SimplePlane.prototype._render = function (renderer) {\n if (this._textureID !== this.shader.texture._updateID) {\n this.textureUpdated();\n }\n _super.prototype._render.call(this, renderer);\n };\n SimplePlane.prototype.destroy = function (options) {\n this.shader.texture.off('update', this.textureUpdated, this);\n _super.prototype.destroy.call(this, options);\n };\n return SimplePlane;\n}(Mesh));\n\n/**\n * The Simple Mesh class mimics Mesh in PixiJS v4, providing easy-to-use constructor arguments.\n * For more robust customization, use {@link PIXI.Mesh}.\n *\n * @class\n * @extends PIXI.Mesh\n * @memberof PIXI\n */\nvar SimpleMesh = /** @class */ (function (_super) {\n __extends(SimpleMesh, _super);\n /**\n * @param {PIXI.Texture} [texture=Texture.EMPTY] - The texture to use\n * @param {Float32Array} [vertices] - if you want to specify the vertices\n * @param {Float32Array} [uvs] - if you want to specify the uvs\n * @param {Uint16Array} [indices] - if you want to specify the indices\n * @param {number} [drawMode] - the drawMode, can be any of the Mesh.DRAW_MODES consts\n */\n function SimpleMesh(texture, vertices, uvs, indices, drawMode) {\n if (texture === void 0) { texture = Texture.EMPTY; }\n var _this = this;\n var geometry = new MeshGeometry(vertices, uvs, indices);\n geometry.getBuffer('aVertexPosition').static = false;\n var meshMaterial = new MeshMaterial(texture);\n _this = _super.call(this, geometry, meshMaterial, null, drawMode) || this;\n /**\n * upload vertices buffer each frame\n * @member {boolean}\n */\n _this.autoUpdate = true;\n return _this;\n }\n Object.defineProperty(SimpleMesh.prototype, \"vertices\", {\n /**\n * Collection of vertices data.\n * @member {Float32Array}\n */\n get: function () {\n return this.geometry.getBuffer('aVertexPosition').data;\n },\n set: function (value) {\n this.geometry.getBuffer('aVertexPosition').data = value;\n },\n enumerable: false,\n configurable: true\n });\n SimpleMesh.prototype._render = function (renderer) {\n if (this.autoUpdate) {\n this.geometry.getBuffer('aVertexPosition').update();\n }\n _super.prototype._render.call(this, renderer);\n };\n return SimpleMesh;\n}(Mesh));\n\nvar DEFAULT_BORDER_SIZE = 10;\n/**\n * The NineSlicePlane allows you to stretch a texture using 9-slice scaling. The corners will remain unscaled (useful\n * for buttons with rounded corners for example) and the other areas will be scaled horizontally and or vertically\n *\n *```js\n * let Plane9 = new PIXI.NineSlicePlane(PIXI.Texture.from('BoxWithRoundedCorners.png'), 15, 15, 15, 15);\n * ```\n *
\n *      A                          B\n *    +---+----------------------+---+\n *  C | 1 |          2           | 3 |\n *    +---+----------------------+---+\n *    |   |                      |   |\n *    | 4 |          5           | 6 |\n *    |   |                      |   |\n *    +---+----------------------+---+\n *  D | 7 |          8           | 9 |\n *    +---+----------------------+---+\n\n *  When changing this objects width and/or height:\n *     areas 1 3 7 and 9 will remain unscaled.\n *     areas 2 and 8 will be stretched horizontally\n *     areas 4 and 6 will be stretched vertically\n *     area 5 will be stretched both horizontally and vertically\n * 
\n *\n * @class\n * @extends PIXI.SimplePlane\n * @memberof PIXI\n *\n */\nvar NineSlicePlane = /** @class */ (function (_super) {\n __extends(NineSlicePlane, _super);\n /**\n * @param {PIXI.Texture} texture - The texture to use on the NineSlicePlane.\n * @param {number} [leftWidth=10] - size of the left vertical bar (A)\n * @param {number} [topHeight=10] - size of the top horizontal bar (C)\n * @param {number} [rightWidth=10] - size of the right vertical bar (B)\n * @param {number} [bottomHeight=10] - size of the bottom horizontal bar (D)\n */\n function NineSlicePlane(texture, leftWidth, topHeight, rightWidth, bottomHeight) {\n if (leftWidth === void 0) { leftWidth = DEFAULT_BORDER_SIZE; }\n if (topHeight === void 0) { topHeight = DEFAULT_BORDER_SIZE; }\n if (rightWidth === void 0) { rightWidth = DEFAULT_BORDER_SIZE; }\n if (bottomHeight === void 0) { bottomHeight = DEFAULT_BORDER_SIZE; }\n var _this = _super.call(this, Texture.WHITE, 4, 4) || this;\n _this._origWidth = texture.orig.width;\n _this._origHeight = texture.orig.height;\n /**\n * The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n * @override\n */\n _this._width = _this._origWidth;\n /**\n * The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n * @override\n */\n _this._height = _this._origHeight;\n /**\n * The width of the left column (a)\n *\n * @member {number}\n * @private\n */\n _this._leftWidth = leftWidth;\n /**\n * The width of the right column (b)\n *\n * @member {number}\n * @private\n */\n _this._rightWidth = rightWidth;\n /**\n * The height of the top row (c)\n *\n * @member {number}\n * @private\n */\n _this._topHeight = topHeight;\n /**\n * The height of the bottom row (d)\n *\n * @member {number}\n * @private\n */\n _this._bottomHeight = bottomHeight;\n // lets call the setter to ensure all necessary updates are performed\n _this.texture = texture;\n return _this;\n }\n NineSlicePlane.prototype.textureUpdated = function () {\n this._textureID = this.shader.texture._updateID;\n this._refresh();\n };\n Object.defineProperty(NineSlicePlane.prototype, \"vertices\", {\n get: function () {\n return this.geometry.getBuffer('aVertexPosition').data;\n },\n set: function (value) {\n this.geometry.getBuffer('aVertexPosition').data = value;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Updates the horizontal vertices.\n *\n */\n NineSlicePlane.prototype.updateHorizontalVertices = function () {\n var vertices = this.vertices;\n var scale = this._getMinScale();\n vertices[9] = vertices[11] = vertices[13] = vertices[15] = this._topHeight * scale;\n vertices[17] = vertices[19] = vertices[21] = vertices[23] = this._height - (this._bottomHeight * scale);\n vertices[25] = vertices[27] = vertices[29] = vertices[31] = this._height;\n };\n /**\n * Updates the vertical vertices.\n *\n */\n NineSlicePlane.prototype.updateVerticalVertices = function () {\n var vertices = this.vertices;\n var scale = this._getMinScale();\n vertices[2] = vertices[10] = vertices[18] = vertices[26] = this._leftWidth * scale;\n vertices[4] = vertices[12] = vertices[20] = vertices[28] = this._width - (this._rightWidth * scale);\n vertices[6] = vertices[14] = vertices[22] = vertices[30] = this._width;\n };\n /**\n * Returns the smaller of a set of vertical and horizontal scale of nine slice corners.\n *\n * @return {number} Smaller number of vertical and horizontal scale.\n * @private\n */\n NineSlicePlane.prototype._getMinScale = function () {\n var w = this._leftWidth + this._rightWidth;\n var scaleW = this._width > w ? 1.0 : this._width / w;\n var h = this._topHeight + this._bottomHeight;\n var scaleH = this._height > h ? 1.0 : this._height / h;\n var scale = Math.min(scaleW, scaleH);\n return scale;\n };\n Object.defineProperty(NineSlicePlane.prototype, \"width\", {\n /**\n * The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n */\n get: function () {\n return this._width;\n },\n set: function (value) {\n this._width = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NineSlicePlane.prototype, \"height\", {\n /**\n * The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n */\n get: function () {\n return this._height;\n },\n set: function (value) {\n this._height = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NineSlicePlane.prototype, \"leftWidth\", {\n /**\n * The width of the left column\n *\n * @member {number}\n */\n get: function () {\n return this._leftWidth;\n },\n set: function (value) {\n this._leftWidth = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NineSlicePlane.prototype, \"rightWidth\", {\n /**\n * The width of the right column\n *\n * @member {number}\n */\n get: function () {\n return this._rightWidth;\n },\n set: function (value) {\n this._rightWidth = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NineSlicePlane.prototype, \"topHeight\", {\n /**\n * The height of the top row\n *\n * @member {number}\n */\n get: function () {\n return this._topHeight;\n },\n set: function (value) {\n this._topHeight = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NineSlicePlane.prototype, \"bottomHeight\", {\n /**\n * The height of the bottom row\n *\n * @member {number}\n */\n get: function () {\n return this._bottomHeight;\n },\n set: function (value) {\n this._bottomHeight = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Refreshes NineSlicePlane coords. All of them.\n */\n NineSlicePlane.prototype._refresh = function () {\n var texture = this.texture;\n var uvs = this.geometry.buffers[1].data;\n this._origWidth = texture.orig.width;\n this._origHeight = texture.orig.height;\n var _uvw = 1.0 / this._origWidth;\n var _uvh = 1.0 / this._origHeight;\n uvs[0] = uvs[8] = uvs[16] = uvs[24] = 0;\n uvs[1] = uvs[3] = uvs[5] = uvs[7] = 0;\n uvs[6] = uvs[14] = uvs[22] = uvs[30] = 1;\n uvs[25] = uvs[27] = uvs[29] = uvs[31] = 1;\n uvs[2] = uvs[10] = uvs[18] = uvs[26] = _uvw * this._leftWidth;\n uvs[4] = uvs[12] = uvs[20] = uvs[28] = 1 - (_uvw * this._rightWidth);\n uvs[9] = uvs[11] = uvs[13] = uvs[15] = _uvh * this._topHeight;\n uvs[17] = uvs[19] = uvs[21] = uvs[23] = 1 - (_uvh * this._bottomHeight);\n this.updateHorizontalVertices();\n this.updateVerticalVertices();\n this.geometry.buffers[0].update();\n this.geometry.buffers[1].update();\n };\n return NineSlicePlane;\n}(SimplePlane));\n\nexport { NineSlicePlane, PlaneGeometry, RopeGeometry, SimpleMesh, SimplePlane, SimpleRope };\n//# sourceMappingURL=mesh-extras.es.js.map\n","/*!\n * @pixi/sprite-animated - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/sprite-animated is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Texture } from '@pixi/core';\nimport { Sprite } from '@pixi/sprite';\nimport { Ticker, UPDATE_PRIORITY } from '@pixi/ticker';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * An AnimatedSprite is a simple way to display an animation depicted by a list of textures.\n *\n * ```js\n * let alienImages = [\"image_sequence_01.png\",\"image_sequence_02.png\",\"image_sequence_03.png\",\"image_sequence_04.png\"];\n * let textureArray = [];\n *\n * for (let i=0; i < 4; i++)\n * {\n * let texture = PIXI.Texture.from(alienImages[i]);\n * textureArray.push(texture);\n * };\n *\n * let animatedSprite = new PIXI.AnimatedSprite(textureArray);\n * ```\n *\n * The more efficient and simpler way to create an animated sprite is using a {@link PIXI.Spritesheet}\n * containing the animation definitions:\n *\n * ```js\n * PIXI.Loader.shared.add(\"assets/spritesheet.json\").load(setup);\n *\n * function setup() {\n * let sheet = PIXI.Loader.shared.resources[\"assets/spritesheet.json\"].spritesheet;\n * animatedSprite = new PIXI.AnimatedSprite(sheet.animations[\"image_sequence\"]);\n * ...\n * }\n * ```\n *\n * @class\n * @extends PIXI.Sprite\n * @memberof PIXI\n */\nvar AnimatedSprite = /** @class */ (function (_super) {\n __extends(AnimatedSprite, _super);\n /**\n * @param {PIXI.Texture[]|PIXI.AnimatedSprite.FrameObject[]} textures - An array of {@link PIXI.Texture} or frame\n * objects that make up the animation.\n * @param {boolean} [autoUpdate=true] - Whether to use PIXI.Ticker.shared to auto update animation time.\n */\n function AnimatedSprite(textures, autoUpdate) {\n if (autoUpdate === void 0) { autoUpdate = true; }\n var _this = _super.call(this, textures[0] instanceof Texture ? textures[0] : textures[0].texture) || this;\n /**\n * @type {PIXI.Texture[]}\n * @private\n */\n _this._textures = null;\n /**\n * @type {number[]}\n * @private\n */\n _this._durations = null;\n /**\n * `true` uses PIXI.Ticker.shared to auto update animation time.\n *\n * @type {boolean}\n * @default true\n * @private\n */\n _this._autoUpdate = autoUpdate;\n /**\n * `true` if the instance is currently connected to PIXI.Ticker.shared to auto update animation time.\n *\n * @type {boolean}\n * @default false\n * @private\n */\n _this._isConnectedToTicker = false;\n /**\n * The speed that the AnimatedSprite will play at. Higher is faster, lower is slower.\n *\n * @member {number}\n * @default 1\n */\n _this.animationSpeed = 1;\n /**\n * Whether or not the animate sprite repeats after playing.\n *\n * @member {boolean}\n * @default true\n */\n _this.loop = true;\n /**\n * Update anchor to [Texture's defaultAnchor]{@link PIXI.Texture#defaultAnchor} when frame changes.\n *\n * Useful with [sprite sheet animations]{@link PIXI.Spritesheet#animations} created with tools.\n * Changing anchor for each frame allows to pin sprite origin to certain moving feature\n * of the frame (e.g. left foot).\n *\n * Note: Enabling this will override any previously set `anchor` on each frame change.\n *\n * @member {boolean}\n * @default false\n */\n _this.updateAnchor = false;\n /**\n * User-assigned function to call when an AnimatedSprite finishes playing.\n *\n * @example\n * animation.onComplete = function () {\n * // finished!\n * };\n * @member {Function}\n */\n _this.onComplete = null;\n /**\n * User-assigned function to call when an AnimatedSprite changes which texture is being rendered.\n *\n * @example\n * animation.onFrameChange = function () {\n * // updated!\n * };\n * @member {Function}\n */\n _this.onFrameChange = null;\n /**\n * User-assigned function to call when `loop` is true, and an AnimatedSprite is played and\n * loops around to start again.\n *\n * @example\n * animation.onLoop = function () {\n * // looped!\n * };\n * @member {Function}\n */\n _this.onLoop = null;\n /**\n * Elapsed time since animation has been started, used internally to display current texture.\n *\n * @member {number}\n * @private\n */\n _this._currentTime = 0;\n _this._playing = false;\n /**\n * The texture index that was displayed last time\n *\n * @member {number}\n * @private\n */\n _this._previousFrame = null;\n _this.textures = textures;\n return _this;\n }\n /**\n * Stops the AnimatedSprite.\n *\n */\n AnimatedSprite.prototype.stop = function () {\n if (!this._playing) {\n return;\n }\n this._playing = false;\n if (this._autoUpdate && this._isConnectedToTicker) {\n Ticker.shared.remove(this.update, this);\n this._isConnectedToTicker = false;\n }\n };\n /**\n * Plays the AnimatedSprite.\n *\n */\n AnimatedSprite.prototype.play = function () {\n if (this._playing) {\n return;\n }\n this._playing = true;\n if (this._autoUpdate && !this._isConnectedToTicker) {\n Ticker.shared.add(this.update, this, UPDATE_PRIORITY.HIGH);\n this._isConnectedToTicker = true;\n }\n };\n /**\n * Stops the AnimatedSprite and goes to a specific frame.\n *\n * @param {number} frameNumber - Frame index to stop at.\n */\n AnimatedSprite.prototype.gotoAndStop = function (frameNumber) {\n this.stop();\n var previousFrame = this.currentFrame;\n this._currentTime = frameNumber;\n if (previousFrame !== this.currentFrame) {\n this.updateTexture();\n }\n };\n /**\n * Goes to a specific frame and begins playing the AnimatedSprite.\n *\n * @param {number} frameNumber - Frame index to start at.\n */\n AnimatedSprite.prototype.gotoAndPlay = function (frameNumber) {\n var previousFrame = this.currentFrame;\n this._currentTime = frameNumber;\n if (previousFrame !== this.currentFrame) {\n this.updateTexture();\n }\n this.play();\n };\n /**\n * Updates the object transform for rendering.\n *\n * @param {number} deltaTime - Time since last tick.\n */\n AnimatedSprite.prototype.update = function (deltaTime) {\n var elapsed = this.animationSpeed * deltaTime;\n var previousFrame = this.currentFrame;\n if (this._durations !== null) {\n var lag = this._currentTime % 1 * this._durations[this.currentFrame];\n lag += elapsed / 60 * 1000;\n while (lag < 0) {\n this._currentTime--;\n lag += this._durations[this.currentFrame];\n }\n var sign = Math.sign(this.animationSpeed * deltaTime);\n this._currentTime = Math.floor(this._currentTime);\n while (lag >= this._durations[this.currentFrame]) {\n lag -= this._durations[this.currentFrame] * sign;\n this._currentTime += sign;\n }\n this._currentTime += lag / this._durations[this.currentFrame];\n }\n else {\n this._currentTime += elapsed;\n }\n if (this._currentTime < 0 && !this.loop) {\n this.gotoAndStop(0);\n if (this.onComplete) {\n this.onComplete();\n }\n }\n else if (this._currentTime >= this._textures.length && !this.loop) {\n this.gotoAndStop(this._textures.length - 1);\n if (this.onComplete) {\n this.onComplete();\n }\n }\n else if (previousFrame !== this.currentFrame) {\n if (this.loop && this.onLoop) {\n if (this.animationSpeed > 0 && this.currentFrame < previousFrame) {\n this.onLoop();\n }\n else if (this.animationSpeed < 0 && this.currentFrame > previousFrame) {\n this.onLoop();\n }\n }\n this.updateTexture();\n }\n };\n /**\n * Updates the displayed texture to match the current frame index.\n *\n * @private\n */\n AnimatedSprite.prototype.updateTexture = function () {\n var currentFrame = this.currentFrame;\n if (this._previousFrame === currentFrame) {\n return;\n }\n this._previousFrame = currentFrame;\n this._texture = this._textures[currentFrame];\n this._textureID = -1;\n this._textureTrimmedID = -1;\n this._cachedTint = 0xFFFFFF;\n this.uvs = this._texture._uvs.uvsFloat32;\n if (this.updateAnchor) {\n this._anchor.copyFrom(this._texture.defaultAnchor);\n }\n if (this.onFrameChange) {\n this.onFrameChange(this.currentFrame);\n }\n };\n /**\n * Stops the AnimatedSprite and destroys it.\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value.\n * @param {boolean} [options.children=false] - If set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well.\n * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well.\n */\n AnimatedSprite.prototype.destroy = function (options) {\n this.stop();\n _super.prototype.destroy.call(this, options);\n this.onComplete = null;\n this.onFrameChange = null;\n this.onLoop = null;\n };\n /**\n * A short hand way of creating an AnimatedSprite from an array of frame ids.\n *\n * @static\n * @param {string[]} frames - The array of frames ids the AnimatedSprite will use as its texture frames.\n * @return {PIXI.AnimatedSprite} The new animated sprite with the specified frames.\n */\n AnimatedSprite.fromFrames = function (frames) {\n var textures = [];\n for (var i = 0; i < frames.length; ++i) {\n textures.push(Texture.from(frames[i]));\n }\n return new AnimatedSprite(textures);\n };\n /**\n * A short hand way of creating an AnimatedSprite from an array of image ids.\n *\n * @static\n * @param {string[]} images - The array of image urls the AnimatedSprite will use as its texture frames.\n * @return {PIXI.AnimatedSprite} The new animate sprite with the specified images as frames.\n */\n AnimatedSprite.fromImages = function (images) {\n var textures = [];\n for (var i = 0; i < images.length; ++i) {\n textures.push(Texture.from(images[i]));\n }\n return new AnimatedSprite(textures);\n };\n Object.defineProperty(AnimatedSprite.prototype, \"totalFrames\", {\n /**\n * The total number of frames in the AnimatedSprite. This is the same as number of textures\n * assigned to the AnimatedSprite.\n *\n * @readonly\n * @member {number}\n * @default 0\n */\n get: function () {\n return this._textures.length;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AnimatedSprite.prototype, \"textures\", {\n /**\n * The array of textures used for this AnimatedSprite.\n *\n * @member {PIXI.Texture[]}\n */\n get: function () {\n return this._textures;\n },\n set: function (value) {\n if (value[0] instanceof Texture) {\n this._textures = value;\n this._durations = null;\n }\n else {\n this._textures = [];\n this._durations = [];\n for (var i = 0; i < value.length; i++) {\n this._textures.push(value[i].texture);\n this._durations.push(value[i].time);\n }\n }\n this._previousFrame = null;\n this.gotoAndStop(0);\n this.updateTexture();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AnimatedSprite.prototype, \"currentFrame\", {\n /**\n * The AnimatedSprites current frame index.\n *\n * @member {number}\n * @readonly\n */\n get: function () {\n var currentFrame = Math.floor(this._currentTime) % this._textures.length;\n if (currentFrame < 0) {\n currentFrame += this._textures.length;\n }\n return currentFrame;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AnimatedSprite.prototype, \"playing\", {\n /**\n * Indicates if the AnimatedSprite is currently playing.\n *\n * @member {boolean}\n * @readonly\n */\n get: function () {\n return this._playing;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AnimatedSprite.prototype, \"autoUpdate\", {\n /**\n * Whether to use PIXI.Ticker.shared to auto update animation time\n *\n * @member {boolean}\n */\n get: function () {\n return this._autoUpdate;\n },\n set: function (value) {\n if (value !== this._autoUpdate) {\n this._autoUpdate = value;\n if (!this._autoUpdate && this._isConnectedToTicker) {\n Ticker.shared.remove(this.update, this);\n this._isConnectedToTicker = false;\n }\n else if (this._autoUpdate && !this._isConnectedToTicker && this._playing) {\n Ticker.shared.add(this.update, this);\n this._isConnectedToTicker = true;\n }\n }\n },\n enumerable: false,\n configurable: true\n });\n return AnimatedSprite;\n}(Sprite));\n/**\n * @memberof PIXI.AnimatedSprite\n * @typedef {object} FrameObject\n * @type {object}\n * @property {PIXI.Texture} texture - The {@link PIXI.Texture} of the frame\n * @property {number} time - the duration of the frame in ms\n */\n\nexport { AnimatedSprite };\n//# sourceMappingURL=sprite-animated.es.js.map\n","/*!\n * pixi.js - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * pixi.js is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport '@pixi/polyfill';\nimport { deprecation } from '@pixi/utils';\nimport * as utils from '@pixi/utils';\nexport { utils };\nimport { AccessibilityManager } from '@pixi/accessibility';\nexport * from '@pixi/accessibility';\nimport { InteractionManager } from '@pixi/interaction';\nexport * from '@pixi/interaction';\nimport { Application } from '@pixi/app';\nexport * from '@pixi/app';\nimport { Renderer, BatchRenderer } from '@pixi/core';\nexport * from '@pixi/core';\nimport { Extract } from '@pixi/extract';\nexport * from '@pixi/extract';\nimport { Loader, AppLoaderPlugin } from '@pixi/loaders';\nexport * from '@pixi/loaders';\nimport { ParticleRenderer } from '@pixi/particles';\nexport * from '@pixi/particles';\nimport { Prepare } from '@pixi/prepare';\nexport * from '@pixi/prepare';\nimport { SpritesheetLoader } from '@pixi/spritesheet';\nexport * from '@pixi/spritesheet';\nimport { TilingSpriteRenderer } from '@pixi/sprite-tiling';\nexport * from '@pixi/sprite-tiling';\nimport { BitmapFontLoader } from '@pixi/text-bitmap';\nexport * from '@pixi/text-bitmap';\nimport { TickerPlugin } from '@pixi/ticker';\nexport * from '@pixi/ticker';\nimport { AlphaFilter } from '@pixi/filter-alpha';\nimport { BlurFilter, BlurFilterPass } from '@pixi/filter-blur';\nimport { ColorMatrixFilter } from '@pixi/filter-color-matrix';\nimport { DisplacementFilter } from '@pixi/filter-displacement';\nimport { FXAAFilter } from '@pixi/filter-fxaa';\nimport { NoiseFilter } from '@pixi/filter-noise';\nimport '@pixi/mixin-cache-as-bitmap';\nimport '@pixi/mixin-get-child-by-name';\nimport '@pixi/mixin-get-global-position';\nexport * from '@pixi/constants';\nexport * from '@pixi/display';\nexport * from '@pixi/graphics';\nexport * from '@pixi/math';\nexport * from '@pixi/mesh';\nexport * from '@pixi/mesh-extras';\nexport * from '@pixi/runner';\nexport * from '@pixi/sprite';\nexport * from '@pixi/sprite-animated';\nexport * from '@pixi/text';\nexport * from '@pixi/settings';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar v5 = '5.0.0';\n/**\n * Deprecations (backward compatibilities) are automatically applied for browser bundles\n * in the UMD module format. If using Webpack or Rollup, you'll need to apply these\n * deprecations manually by doing something like this:\n * @example\n * import * as PIXI from 'pixi.js';\n * PIXI.useDeprecated(); // MUST be bound to namespace\n * @memberof PIXI\n * @function useDeprecated\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nfunction useDeprecated() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var PIXI = this;\n Object.defineProperties(PIXI, {\n /**\n * @constant {RegExp|string} SVG_SIZE\n * @memberof PIXI\n * @see PIXI.resources.SVGResource.SVG_SIZE\n * @deprecated since 5.0.0\n */\n SVG_SIZE: {\n get: function () {\n deprecation(v5, 'PIXI.utils.SVG_SIZE property has moved to PIXI.resources.SVGResource.SVG_SIZE');\n return PIXI.SVGResource.SVG_SIZE;\n },\n },\n /**\n * @class PIXI.TransformStatic\n * @deprecated since 5.0.0\n * @see PIXI.Transform\n */\n TransformStatic: {\n get: function () {\n deprecation(v5, 'PIXI.TransformStatic class has been removed, use PIXI.Transform');\n return PIXI.Transform;\n },\n },\n /**\n * @class PIXI.TransformBase\n * @deprecated since 5.0.0\n * @see PIXI.Transform\n */\n TransformBase: {\n get: function () {\n deprecation(v5, 'PIXI.TransformBase class has been removed, use PIXI.Transform');\n return PIXI.Transform;\n },\n },\n /**\n * Constants that specify the transform type.\n *\n * @static\n * @constant\n * @name TRANSFORM_MODE\n * @memberof PIXI\n * @enum {number}\n * @deprecated since 5.0.0\n * @property {number} STATIC\n * @property {number} DYNAMIC\n */\n TRANSFORM_MODE: {\n get: function () {\n deprecation(v5, 'PIXI.TRANSFORM_MODE property has been removed');\n return { STATIC: 0, DYNAMIC: 1 };\n },\n },\n /**\n * @class PIXI.WebGLRenderer\n * @see PIXI.Renderer\n * @deprecated since 5.0.0\n */\n WebGLRenderer: {\n get: function () {\n deprecation(v5, 'PIXI.WebGLRenderer class has moved to PIXI.Renderer');\n return PIXI.Renderer;\n },\n },\n /**\n * @class PIXI.CanvasRenderTarget\n * @see PIXI.utils.CanvasRenderTarget\n * @deprecated since 5.0.0\n */\n CanvasRenderTarget: {\n get: function () {\n deprecation(v5, 'PIXI.CanvasRenderTarget class has moved to PIXI.utils.CanvasRenderTarget');\n return PIXI.utils.CanvasRenderTarget;\n },\n },\n /**\n * @memberof PIXI\n * @name loader\n * @type {PIXI.Loader}\n * @see PIXI.Loader.shared\n * @deprecated since 5.0.0\n */\n loader: {\n get: function () {\n deprecation(v5, 'PIXI.loader instance has moved to PIXI.Loader.shared');\n return PIXI.Loader.shared;\n },\n },\n /**\n * @class PIXI.FilterManager\n * @see PIXI.systems.FilterSystem\n * @deprecated since 5.0.0\n */\n FilterManager: {\n get: function () {\n deprecation(v5, 'PIXI.FilterManager class has moved to PIXI.systems.FilterSystem');\n return PIXI.systems.FilterSystem;\n },\n },\n /**\n * @namespace PIXI.CanvasTinter\n * @see PIXI.canvasUtils\n * @deprecated since 5.2.0\n */\n CanvasTinter: {\n get: function () {\n deprecation('5.2.0', 'PIXI.CanvasTinter namespace has moved to PIXI.canvasUtils');\n return PIXI.canvasUtils;\n },\n },\n /**\n * @namespace PIXI.GroupD8\n * @see PIXI.groupD8\n * @deprecated since 5.2.0\n */\n GroupD8: {\n get: function () {\n deprecation('5.2.0', 'PIXI.GroupD8 namespace has moved to PIXI.groupD8');\n return PIXI.groupD8;\n },\n },\n });\n /**\n * @namespace PIXI.accessibility\n * @see PIXI\n * @deprecated since 5.3.0\n */\n PIXI.accessibility = {};\n Object.defineProperties(PIXI.accessibility, {\n /**\n * @class PIXI.accessibility.AccessibilityManager\n * @deprecated since 5.3.0\n * @see PIXI.AccessibilityManager\n */\n AccessibilityManager: {\n get: function () {\n deprecation('5.3.0', 'PIXI.accessibility.AccessibilityManager moved to PIXI.AccessibilityManager');\n return PIXI.AccessibilityManager;\n },\n },\n });\n /**\n * @namespace PIXI.interaction\n * @see PIXI\n * @deprecated since 5.3.0\n */\n PIXI.interaction = {};\n Object.defineProperties(PIXI.interaction, {\n /**\n * @class PIXI.interaction.InteractionManager\n * @deprecated since 5.3.0\n * @see PIXI.InteractionManager\n */\n InteractionManager: {\n get: function () {\n deprecation('5.3.0', 'PIXI.interaction.InteractionManager moved to PIXI.InteractionManager');\n return PIXI.InteractionManager;\n },\n },\n /**\n * @class PIXI.interaction.InteractionData\n * @deprecated since 5.3.0\n * @see PIXI.InteractionData\n */\n InteractionData: {\n get: function () {\n deprecation('5.3.0', 'PIXI.interaction.InteractionData moved to PIXI.InteractionData');\n return PIXI.InteractionData;\n },\n },\n /**\n * @class PIXI.interaction.InteractionEvent\n * @deprecated since 5.3.0\n * @see PIXI.InteractionEvent\n */\n InteractionEvent: {\n get: function () {\n deprecation('5.3.0', 'PIXI.interaction.InteractionEvent moved to PIXI.InteractionEvent');\n return PIXI.InteractionEvent;\n },\n },\n });\n /**\n * @namespace PIXI.prepare\n * @see PIXI\n * @deprecated since 5.2.1\n */\n PIXI.prepare = {};\n Object.defineProperties(PIXI.prepare, {\n /**\n * @class PIXI.prepare.BasePrepare\n * @deprecated since 5.2.1\n * @see PIXI.BasePrepare\n */\n BasePrepare: {\n get: function () {\n deprecation('5.2.1', 'PIXI.prepare.BasePrepare moved to PIXI.BasePrepare');\n return PIXI.BasePrepare;\n },\n },\n /**\n * @class PIXI.prepare.Prepare\n * @deprecated since 5.2.1\n * @see PIXI.Prepare\n */\n Prepare: {\n get: function () {\n deprecation('5.2.1', 'PIXI.prepare.Prepare moved to PIXI.Prepare');\n return PIXI.Prepare;\n },\n },\n /**\n * @class PIXI.prepare.CanvasPrepare\n * @deprecated since 5.2.1\n * @see PIXI.CanvasPrepare\n */\n CanvasPrepare: {\n get: function () {\n deprecation('5.2.1', 'PIXI.prepare.CanvasPrepare moved to PIXI.CanvasPrepare');\n return PIXI.CanvasPrepare;\n },\n },\n });\n /**\n * @namespace PIXI.extract\n * @see PIXI\n * @deprecated since 5.2.1\n */\n PIXI.extract = {};\n Object.defineProperties(PIXI.extract, {\n /**\n * @class PIXI.extract.Extract\n * @deprecated since 5.2.1\n * @see PIXI.Extract\n */\n Extract: {\n get: function () {\n deprecation('5.2.1', 'PIXI.extract.Extract moved to PIXI.Extract');\n return PIXI.Extract;\n },\n },\n /**\n * @class PIXI.extract.CanvasExtract\n * @deprecated since 5.2.1\n * @see PIXI.CanvasExtract\n */\n CanvasExtract: {\n get: function () {\n deprecation('5.2.1', 'PIXI.extract.CanvasExtract moved to PIXI.CanvasExtract');\n return PIXI.CanvasExtract;\n },\n },\n });\n /**\n * This namespace has been removed. All classes previous nested\n * under this namespace have been moved to the top-level `PIXI` object.\n * @namespace PIXI.extras\n * @deprecated since 5.0.0\n */\n PIXI.extras = {};\n Object.defineProperties(PIXI.extras, {\n /**\n * @class PIXI.extras.TilingSprite\n * @see PIXI.TilingSprite\n * @deprecated since 5.0.0\n */\n TilingSprite: {\n get: function () {\n deprecation(v5, 'PIXI.extras.TilingSprite class has moved to PIXI.TilingSprite');\n return PIXI.TilingSprite;\n },\n },\n /**\n * @class PIXI.extras.TilingSpriteRenderer\n * @see PIXI.TilingSpriteRenderer\n * @deprecated since 5.0.0\n */\n TilingSpriteRenderer: {\n get: function () {\n deprecation(v5, 'PIXI.extras.TilingSpriteRenderer class has moved to PIXI.TilingSpriteRenderer');\n return PIXI.TilingSpriteRenderer;\n },\n },\n /**\n * @class PIXI.extras.AnimatedSprite\n * @see PIXI.AnimatedSprite\n * @deprecated since 5.0.0\n */\n AnimatedSprite: {\n get: function () {\n deprecation(v5, 'PIXI.extras.AnimatedSprite class has moved to PIXI.AnimatedSprite');\n return PIXI.AnimatedSprite;\n },\n },\n /**\n * @class PIXI.extras.BitmapText\n * @see PIXI.BitmapText\n * @deprecated since 5.0.0\n */\n BitmapText: {\n get: function () {\n deprecation(v5, 'PIXI.extras.BitmapText class has moved to PIXI.BitmapText');\n return PIXI.BitmapText;\n },\n },\n });\n /**\n * @static\n * @method PIXI.TilingSprite.fromFrame\n * @deprecated since 5.3.0\n * @see PIXI.TilingSprite.from\n */\n PIXI.TilingSprite.fromFrame = function fromFrame(frameId, width, height) {\n deprecation('5.3.0', 'TilingSprite.fromFrame is deprecated, use TilingSprite.from');\n return PIXI.TilingSprite.from(frameId, { width: width, height: height });\n };\n /**\n * @static\n * @method PIXI.TilingSprite.fromImage\n * @deprecated since 5.3.0\n * @see PIXI.TilingSprite.from\n */\n PIXI.TilingSprite.fromImage = function fromImage(imageId, width, height, options) {\n if (options === void 0) { options = {}; }\n deprecation('5.3.0', 'TilingSprite.fromImage is deprecated, use TilingSprite.from');\n // Fallback support for crossorigin, scaleMode parameters\n if (options && typeof options !== 'object') {\n options = {\n // eslint-disable-next-line prefer-rest-params\n scaleMode: arguments[4],\n resourceOptions: {\n // eslint-disable-next-line prefer-rest-params\n crossorigin: arguments[3],\n },\n };\n }\n options.width = width;\n options.height = height;\n return PIXI.TilingSprite.from(imageId, options);\n };\n Object.defineProperties(PIXI.utils, {\n /**\n * @function PIXI.utils.getSvgSize\n * @see PIXI.resources.SVGResource.getSize\n * @deprecated since 5.0.0\n */\n getSvgSize: {\n get: function () {\n deprecation(v5, 'PIXI.utils.getSvgSize function has moved to PIXI.resources.SVGResource.getSize');\n return PIXI.resources.SVGResource.getSize;\n },\n },\n });\n /**\n * All classes on this namespace have moved to the high-level `PIXI` object.\n * @namespace PIXI.mesh\n * @deprecated since 5.0.0\n */\n PIXI.mesh = {};\n Object.defineProperties(PIXI.mesh, {\n /**\n * @class PIXI.mesh.Mesh\n * @see PIXI.SimpleMesh\n * @deprecated since 5.0.0\n */\n Mesh: {\n get: function () {\n deprecation(v5, 'PIXI.mesh.Mesh class has moved to PIXI.SimpleMesh');\n return PIXI.SimpleMesh;\n },\n },\n /**\n * @class PIXI.mesh.NineSlicePlane\n * @see PIXI.NineSlicePlane\n * @deprecated since 5.0.0\n */\n NineSlicePlane: {\n get: function () {\n deprecation(v5, 'PIXI.mesh.NineSlicePlane class has moved to PIXI.NineSlicePlane');\n return PIXI.NineSlicePlane;\n },\n },\n /**\n * @class PIXI.mesh.Plane\n * @see PIXI.SimplePlane\n * @deprecated since 5.0.0\n */\n Plane: {\n get: function () {\n deprecation(v5, 'PIXI.mesh.Plane class has moved to PIXI.SimplePlane');\n return PIXI.SimplePlane;\n },\n },\n /**\n * @class PIXI.mesh.Rope\n * @see PIXI.SimpleRope\n * @deprecated since 5.0.0\n */\n Rope: {\n get: function () {\n deprecation(v5, 'PIXI.mesh.Rope class has moved to PIXI.SimpleRope');\n return PIXI.SimpleRope;\n },\n },\n /**\n * @class PIXI.mesh.RawMesh\n * @see PIXI.Mesh\n * @deprecated since 5.0.0\n */\n RawMesh: {\n get: function () {\n deprecation(v5, 'PIXI.mesh.RawMesh class has moved to PIXI.Mesh');\n return PIXI.Mesh;\n },\n },\n /**\n * @class PIXI.mesh.CanvasMeshRenderer\n * @see PIXI.CanvasMeshRenderer\n * @deprecated since 5.0.0\n */\n CanvasMeshRenderer: {\n get: function () {\n deprecation(v5, 'PIXI.mesh.CanvasMeshRenderer class has moved to PIXI.CanvasMeshRenderer');\n return PIXI.CanvasMeshRenderer;\n },\n },\n /**\n * @class PIXI.mesh.MeshRenderer\n * @see PIXI.MeshRenderer\n * @deprecated since 5.0.0\n */\n MeshRenderer: {\n get: function () {\n deprecation(v5, 'PIXI.mesh.MeshRenderer class has moved to PIXI.MeshRenderer');\n return PIXI.MeshRenderer;\n },\n },\n });\n /**\n * This namespace has been removed and items have been moved to\n * the top-level `PIXI` object.\n * @namespace PIXI.particles\n * @deprecated since 5.0.0\n */\n PIXI.particles = {};\n Object.defineProperties(PIXI.particles, {\n /**\n * @class PIXI.particles.ParticleContainer\n * @deprecated since 5.0.0\n * @see PIXI.ParticleContainer\n */\n ParticleContainer: {\n get: function () {\n deprecation(v5, 'PIXI.particles.ParticleContainer class has moved to PIXI.ParticleContainer');\n return PIXI.ParticleContainer;\n },\n },\n /**\n * @class PIXI.particles.ParticleRenderer\n * @deprecated since 5.0.0\n * @see PIXI.ParticleRenderer\n */\n ParticleRenderer: {\n get: function () {\n deprecation(v5, 'PIXI.particles.ParticleRenderer class has moved to PIXI.ParticleRenderer');\n return PIXI.ParticleRenderer;\n },\n },\n });\n /**\n * This namespace has been removed and items have been moved to\n * the top-level `PIXI` object.\n * @namespace PIXI.ticker\n * @deprecated since 5.0.0\n */\n PIXI.ticker = {};\n Object.defineProperties(PIXI.ticker, {\n /**\n * @class PIXI.ticker.Ticker\n * @deprecated since 5.0.0\n * @see PIXI.Ticker\n */\n Ticker: {\n get: function () {\n deprecation(v5, 'PIXI.ticker.Ticker class has moved to PIXI.Ticker');\n return PIXI.Ticker;\n },\n },\n /**\n * @name PIXI.ticker.shared\n * @type {PIXI.Ticker}\n * @deprecated since 5.0.0\n * @see PIXI.Ticker.shared\n */\n shared: {\n get: function () {\n deprecation(v5, 'PIXI.ticker.shared instance has moved to PIXI.Ticker.shared');\n return PIXI.Ticker.shared;\n },\n },\n });\n /**\n * All classes on this namespace have moved to the high-level `PIXI` object.\n * @namespace PIXI.loaders\n * @deprecated since 5.0.0\n */\n PIXI.loaders = {};\n Object.defineProperties(PIXI.loaders, {\n /**\n * @class PIXI.loaders.Loader\n * @see PIXI.Loader\n * @deprecated since 5.0.0\n */\n Loader: {\n get: function () {\n deprecation(v5, 'PIXI.loaders.Loader class has moved to PIXI.Loader');\n return PIXI.Loader;\n },\n },\n /**\n * @class PIXI.loaders.Resource\n * @see PIXI.LoaderResource\n * @deprecated since 5.0.0\n */\n Resource: {\n get: function () {\n deprecation(v5, 'PIXI.loaders.Resource class has moved to PIXI.LoaderResource');\n return PIXI.LoaderResource;\n },\n },\n /**\n * @function PIXI.loaders.bitmapFontParser\n * @see PIXI.BitmapFontLoader.use\n * @deprecated since 5.0.0\n */\n bitmapFontParser: {\n get: function () {\n deprecation(v5, 'PIXI.loaders.bitmapFontParser function has moved to PIXI.BitmapFontLoader.use');\n return PIXI.BitmapFontLoader.use;\n },\n },\n /**\n * @function PIXI.loaders.parseBitmapFontData\n * @deprecated since 5.0.0\n */\n parseBitmapFontData: {\n get: function () {\n deprecation(v5, 'PIXI.loaders.parseBitmapFontData function has removed');\n },\n },\n /**\n * @function PIXI.loaders.spritesheetParser\n * @see PIXI.SpritesheetLoader.use\n * @deprecated since 5.0.0\n */\n spritesheetParser: {\n get: function () {\n deprecation(v5, 'PIXI.loaders.spritesheetParser function has moved to PIXI.SpritesheetLoader.use');\n return PIXI.SpritesheetLoader.use;\n },\n },\n /**\n * @function PIXI.loaders.getResourcePath\n * @see PIXI.SpritesheetLoader.getResourcePath\n * @deprecated since 5.0.0\n */\n getResourcePath: {\n get: function () {\n deprecation(v5, 'PIXI.loaders.getResourcePath property has moved to PIXI.SpritesheetLoader.getResourcePath');\n return PIXI.SpritesheetLoader.getResourcePath;\n },\n },\n });\n /**\n * @function PIXI.loaders.Loader.addPixiMiddleware\n * @see PIXI.Loader.registerPlugin\n * @deprecated since 5.0.0\n * @param {function} middleware\n */\n PIXI.Loader.addPixiMiddleware = function addPixiMiddleware(middleware) {\n deprecation(v5, 'PIXI.loaders.Loader.addPixiMiddleware function is deprecated, use PIXI.loaders.Loader.registerPlugin');\n return PIXI.loaders.Loader.registerPlugin({ use: middleware() });\n };\n // convenience for converting event name to signal name\n var eventToSignal = function (event) {\n return \"on\" + event.charAt(0).toUpperCase() + event.slice(1);\n };\n Object.assign(PIXI.Loader.prototype, {\n /**\n * Use the corresponding signal, e.g., event `start`` is signal `onStart`.\n * @method PIXI.Loader#on\n * @deprecated since 5.0.0\n */\n on: function (event) {\n var signal = eventToSignal(event);\n deprecation(v5, \"PIXI.Loader#on is completely deprecated, use PIXI.Loader#\" + signal + \".add\");\n },\n /**\n * Use the corresponding signal, e.g., event `start`` is signal `onStart`.\n * @method PIXI.Loader#once\n * @deprecated since 5.0.0\n */\n once: function (event) {\n var signal = eventToSignal(event);\n deprecation(v5, \"PIXI.Loader#once is completely deprecated, use PIXI.Loader#\" + signal + \".once\");\n },\n /**\n * Use the corresponding signal, e.g., event `start`` is signal `onStart`.\n * @method PIXI.Loader#off\n * @deprecated since 5.0.0\n */\n off: function (event) {\n var signal = eventToSignal(event);\n deprecation(v5, \"PIXI.Loader#off is completely deprecated, use PIXI.Loader#\" + signal + \".detach\");\n },\n });\n /**\n * @class PIXI.extract.WebGLExtract\n * @deprecated since 5.0.0\n * @see PIXI.Extract\n */\n Object.defineProperty(PIXI.extract, 'WebGLExtract', {\n get: function () {\n deprecation(v5, 'PIXI.extract.WebGLExtract method has moved to PIXI.Extract');\n return PIXI.Extract;\n },\n });\n /**\n * @class PIXI.prepare.WebGLPrepare\n * @deprecated since 5.0.0\n * @see PIXI.Prepare\n */\n Object.defineProperty(PIXI.prepare, 'WebGLPrepare', {\n get: function () {\n deprecation(v5, 'PIXI.prepare.WebGLPrepare class has moved to PIXI.Prepare');\n return PIXI.Prepare;\n },\n });\n /**\n * @method PIXI.Container#_renderWebGL\n * @private\n * @deprecated since 5.0.0\n * @see PIXI.Container#render\n * @param {PIXI.Renderer} renderer Instance of renderer\n */\n PIXI.Container.prototype._renderWebGL = function _renderWebGL(renderer) {\n deprecation(v5, 'PIXI.Container._renderWebGL method has moved to PIXI.Container._render');\n this._render(renderer);\n };\n /**\n * @method PIXI.Container#renderWebGL\n * @deprecated since 5.0.0\n * @see PIXI.Container#render\n * @param {PIXI.Renderer} renderer Instance of renderer\n */\n PIXI.Container.prototype.renderWebGL = function renderWebGL(renderer) {\n deprecation(v5, 'PIXI.Container.renderWebGL method has moved to PIXI.Container.render');\n this.render(renderer);\n };\n /**\n * @method PIXI.DisplayObject#renderWebGL\n * @deprecated since 5.0.0\n * @see PIXI.DisplayObject#render\n * @param {PIXI.Renderer} renderer Instance of renderer\n */\n PIXI.DisplayObject.prototype.renderWebGL = function renderWebGL(renderer) {\n deprecation(v5, 'PIXI.DisplayObject.renderWebGL method has moved to PIXI.DisplayObject.render');\n this.render(renderer);\n };\n /**\n * @method PIXI.Container#renderAdvancedWebGL\n * @deprecated since 5.0.0\n * @see PIXI.Container#renderAdvanced\n * @param {PIXI.Renderer} renderer Instance of renderer\n */\n PIXI.Container.prototype.renderAdvancedWebGL = function renderAdvancedWebGL(renderer) {\n deprecation(v5, 'PIXI.Container.renderAdvancedWebGL method has moved to PIXI.Container.renderAdvanced');\n this.renderAdvanced(renderer);\n };\n Object.defineProperties(PIXI.settings, {\n /**\n * Default transform type.\n *\n * @static\n * @deprecated since 5.0.0\n * @memberof PIXI.settings\n * @type {PIXI.TRANSFORM_MODE}\n * @default PIXI.TRANSFORM_MODE.STATIC\n */\n TRANSFORM_MODE: {\n get: function () {\n deprecation(v5, 'PIXI.settings.TRANSFORM_MODE property has been removed');\n return 0;\n },\n set: function () {\n deprecation(v5, 'PIXI.settings.TRANSFORM_MODE property has been removed');\n },\n },\n });\n var BaseTextureAny = PIXI.BaseTexture;\n /**\n * @method loadSource\n * @memberof PIXI.BaseTexture#\n * @deprecated since 5.0.0\n */\n BaseTextureAny.prototype.loadSource = function loadSource(image) {\n deprecation(v5, 'PIXI.BaseTexture.loadSource method has been deprecated');\n var resource = PIXI.resources.autoDetectResource(image);\n resource.internal = true;\n this.setResource(resource);\n this.update();\n };\n var baseTextureIdDeprecation = false;\n Object.defineProperties(BaseTextureAny.prototype, {\n /**\n * @name PIXI.BaseTexture#hasLoaded\n * @type {boolean}\n * @deprecated since 5.0.0\n * @readonly\n * @see PIXI.BaseTexture#valid\n */\n hasLoaded: {\n get: function () {\n deprecation(v5, 'PIXI.BaseTexture.hasLoaded property has been removed, use PIXI.BaseTexture.valid');\n return this.valid;\n },\n },\n /**\n * @name PIXI.BaseTexture#imageUrl\n * @type {string}\n * @deprecated since 5.0.0\n * @see PIXI.resources.ImageResource#url\n */\n imageUrl: {\n get: function () {\n var _a;\n deprecation(v5, 'PIXI.BaseTexture.imageUrl property has been removed, use PIXI.BaseTexture.resource.url');\n return (_a = this.resource) === null || _a === void 0 ? void 0 : _a.url;\n },\n set: function (imageUrl) {\n deprecation(v5, 'PIXI.BaseTexture.imageUrl property has been removed, use PIXI.BaseTexture.resource.url');\n if (this.resource) {\n this.resource.url = imageUrl;\n }\n },\n },\n /**\n * @name PIXI.BaseTexture#source\n * @type {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement}\n * @deprecated since 5.0.0\n * @readonly\n * @see PIXI.resources.BaseImageResource#source\n */\n source: {\n get: function () {\n deprecation(v5, 'PIXI.BaseTexture.source property has been moved, use `PIXI.BaseTexture.resource.source`');\n return this.resource.source;\n },\n set: function (source) {\n deprecation(v5, 'PIXI.BaseTexture.source property has been moved, use `PIXI.BaseTexture.resource.source` '\n + 'if you want to set HTMLCanvasElement. Otherwise, create new BaseTexture.');\n if (this.resource) {\n this.resource.source = source;\n }\n },\n },\n /**\n * @name PIXI.BaseTexture#premultiplyAlpha\n * @type {boolean}\n * @deprecated since 5.2.0\n * @readonly\n * @see PIXI.BaseTexture#alphaMode\n */\n premultiplyAlpha: {\n get: function () {\n deprecation('5.2.0', 'PIXI.BaseTexture.premultiplyAlpha property has been changed to `alphaMode`'\n + ', see `PIXI.ALPHA_MODES`');\n return this.alphaMode !== 0;\n },\n set: function (value) {\n deprecation('5.2.0', 'PIXI.BaseTexture.premultiplyAlpha property has been changed to `alphaMode`'\n + ', see `PIXI.ALPHA_MODES`');\n this.alphaMode = Number(value);\n },\n },\n /**\n * Batch local field, stores current texture location\n *\n * @name PIXI.BaseTexture#_id\n * @deprecated since 5.2.0\n * @type {number}\n * @see PIXI.BaseTexture#_batchLocation\n */\n _id: {\n get: function () {\n if (!baseTextureIdDeprecation) {\n // #popelyshev: That property was a hot place, I don't want to call deprecation method on it if possible\n deprecation('5.2.0', 'PIXI.BaseTexture._id batch local field has been changed to `_batchLocation`');\n baseTextureIdDeprecation = true;\n }\n return this._batchLocation;\n },\n set: function (value) {\n this._batchLocation = value;\n },\n },\n });\n /**\n * @method fromImage\n * @static\n * @memberof PIXI.BaseTexture\n * @deprecated since 5.0.0\n * @see PIXI.BaseTexture.from\n */\n BaseTextureAny.fromImage = function fromImage(canvas, crossorigin, scaleMode, scale) {\n deprecation(v5, 'PIXI.BaseTexture.fromImage method has been replaced with PIXI.BaseTexture.from');\n var resourceOptions = { scale: scale, crossorigin: crossorigin };\n return BaseTextureAny.from(canvas, { scaleMode: scaleMode, resourceOptions: resourceOptions });\n };\n /**\n * @method fromCanvas\n * @static\n * @memberof PIXI.BaseTexture\n * @deprecated since 5.0.0\n * @see PIXI.BaseTexture.from\n */\n BaseTextureAny.fromCanvas = function fromCanvas(canvas, scaleMode) {\n deprecation(v5, 'PIXI.BaseTexture.fromCanvas method has been replaced with PIXI.BaseTexture.from');\n return BaseTextureAny.from(canvas, { scaleMode: scaleMode });\n };\n /**\n * @method fromSVG\n * @static\n * @memberof PIXI.BaseTexture\n * @deprecated since 5.0.0\n * @see PIXI.BaseTexture.from\n */\n BaseTextureAny.fromSVG = function fromSVG(canvas, crossorigin, scaleMode, scale) {\n deprecation(v5, 'PIXI.BaseTexture.fromSVG method has been replaced with PIXI.BaseTexture.from');\n var resourceOptions = { scale: scale, crossorigin: crossorigin };\n return BaseTextureAny.from(canvas, { scaleMode: scaleMode, resourceOptions: resourceOptions });\n };\n Object.defineProperties(PIXI.resources.ImageResource.prototype, {\n /**\n * @name PIXI.resources.ImageResource#premultiplyAlpha\n * @type {boolean}\n * @deprecated since 5.2.0\n * @readonly\n * @see PIXI.resources.ImageResource#alphaMode\n */\n premultiplyAlpha: {\n get: function () {\n deprecation('5.2.0', 'PIXI.resources.ImageResource.premultiplyAlpha property '\n + 'has been changed to `alphaMode`, see `PIXI.ALPHA_MODES`');\n return this.alphaMode !== 0;\n },\n set: function (value) {\n deprecation('5.2.0', 'PIXI.resources.ImageResource.premultiplyAlpha property '\n + 'has been changed to `alphaMode`, see `PIXI.ALPHA_MODES`');\n this.alphaMode = Number(value);\n },\n },\n });\n /**\n * @method PIXI.Point#copy\n * @deprecated since 5.0.0\n * @see PIXI.Point#copyFrom\n */\n PIXI.Point.prototype.copy = function copy(p) {\n deprecation(v5, 'PIXI.Point.copy method has been replaced with PIXI.Point.copyFrom');\n return this.copyFrom(p);\n };\n /**\n * @method PIXI.ObservablePoint#copy\n * @deprecated since 5.0.0\n * @see PIXI.ObservablePoint#copyFrom\n */\n PIXI.ObservablePoint.prototype.copy = function copy(p) {\n deprecation(v5, 'PIXI.ObservablePoint.copy method has been replaced with PIXI.ObservablePoint.copyFrom');\n return this.copyFrom(p);\n };\n /**\n * @method PIXI.Rectangle#copy\n * @deprecated since 5.0.0\n * @see PIXI.Rectangle#copyFrom\n */\n PIXI.Rectangle.prototype.copy = function copy(p) {\n deprecation(v5, 'PIXI.Rectangle.copy method has been replaced with PIXI.Rectangle.copyFrom');\n return this.copyFrom(p);\n };\n /**\n * @method PIXI.Matrix#copy\n * @deprecated since 5.0.0\n * @see PIXI.Matrix#copyTo\n */\n PIXI.Matrix.prototype.copy = function copy(p) {\n deprecation(v5, 'PIXI.Matrix.copy method has been replaced with PIXI.Matrix.copyTo');\n return this.copyTo(p);\n };\n /**\n * @method PIXI.systems.StateSystem#setState\n * @deprecated since 5.1.0\n * @see PIXI.systems.StateSystem#set\n */\n PIXI.systems.StateSystem.prototype.setState = function setState(s) {\n deprecation('v5.1.0', 'StateSystem.setState has been renamed to StateSystem.set');\n return this.set(s);\n };\n Object.assign(PIXI.systems.FilterSystem.prototype, {\n /**\n * @method PIXI.FilterManager#getRenderTarget\n * @deprecated since 5.0.0\n * @see PIXI.systems.FilterSystem#getFilterTexture\n */\n getRenderTarget: function (_clear, resolution) {\n deprecation(v5, 'PIXI.FilterManager.getRenderTarget method has been replaced with PIXI.systems.FilterSystem#getFilterTexture');\n return this.getFilterTexture(null, resolution);\n },\n /**\n * @method PIXI.FilterManager#returnRenderTarget\n * @deprecated since 5.0.0\n * @see PIXI.systems.FilterSystem#returnFilterTexture\n */\n returnRenderTarget: function (renderTexture) {\n deprecation(v5, 'PIXI.FilterManager.returnRenderTarget method has been replaced with '\n + 'PIXI.systems.FilterSystem.returnFilterTexture');\n this.returnFilterTexture(renderTexture);\n },\n /**\n * @method PIXI.systems.FilterSystem#calculateScreenSpaceMatrix\n * @deprecated since 5.0.0\n * @param {PIXI.Matrix} outputMatrix - the matrix to output to.\n * @return {PIXI.Matrix} The mapped matrix.\n */\n calculateScreenSpaceMatrix: function (outputMatrix) {\n deprecation(v5, 'PIXI.systems.FilterSystem.calculateScreenSpaceMatrix method is removed, '\n + 'use `(vTextureCoord * inputSize.xy) + outputFrame.xy` instead');\n var mappedMatrix = outputMatrix.identity();\n var _a = this.activeState, sourceFrame = _a.sourceFrame, destinationFrame = _a.destinationFrame;\n mappedMatrix.translate(sourceFrame.x / destinationFrame.width, sourceFrame.y / destinationFrame.height);\n mappedMatrix.scale(destinationFrame.width, destinationFrame.height);\n return mappedMatrix;\n },\n /**\n * @method PIXI.systems.FilterSystem#calculateNormalizedScreenSpaceMatrix\n * @deprecated since 5.0.0\n * @param {PIXI.Matrix} outputMatrix - The matrix to output to.\n * @return {PIXI.Matrix} The mapped matrix.\n */\n calculateNormalizedScreenSpaceMatrix: function (outputMatrix) {\n deprecation(v5, 'PIXI.systems.FilterManager.calculateNormalizedScreenSpaceMatrix method is removed, '\n + 'use `((vTextureCoord * inputSize.xy) + outputFrame.xy) / outputFrame.zw` instead.');\n var _a = this.activeState, sourceFrame = _a.sourceFrame, destinationFrame = _a.destinationFrame;\n var mappedMatrix = outputMatrix.identity();\n mappedMatrix.translate(sourceFrame.x / destinationFrame.width, sourceFrame.y / destinationFrame.height);\n var translateScaleX = (destinationFrame.width / sourceFrame.width);\n var translateScaleY = (destinationFrame.height / sourceFrame.height);\n mappedMatrix.scale(translateScaleX, translateScaleY);\n return mappedMatrix;\n },\n });\n Object.defineProperties(PIXI.RenderTexture.prototype, {\n /**\n * @name PIXI.RenderTexture#sourceFrame\n * @type {PIXI.Rectangle}\n * @deprecated since 5.0.0\n * @readonly\n */\n sourceFrame: {\n get: function () {\n deprecation(v5, 'PIXI.RenderTexture.sourceFrame property has been removed');\n return this.filterFrame;\n },\n },\n /**\n * @name PIXI.RenderTexture#size\n * @type {PIXI.Rectangle}\n * @deprecated since 5.0.0\n * @readonly\n */\n size: {\n get: function () {\n deprecation(v5, 'PIXI.RenderTexture.size property has been removed');\n return this._frame;\n },\n },\n });\n /**\n * @class BlurXFilter\n * @memberof PIXI.filters\n * @deprecated since 5.0.0\n * @see PIXI.filters.BlurFilterPass\n */\n var BlurXFilter = /** @class */ (function (_super) {\n __extends(BlurXFilter, _super);\n function BlurXFilter(strength, quality, resolution, kernelSize) {\n var _this = this;\n deprecation(v5, 'PIXI.filters.BlurXFilter class is deprecated, use PIXI.filters.BlurFilterPass');\n _this = _super.call(this, true, strength, quality, resolution, kernelSize) || this;\n return _this;\n }\n return BlurXFilter;\n }(PIXI.filters.BlurFilterPass));\n /**\n * @class BlurYFilter\n * @memberof PIXI.filters\n * @deprecated since 5.0.0\n * @see PIXI.filters.BlurFilterPass\n */\n var BlurYFilter = /** @class */ (function (_super) {\n __extends(BlurYFilter, _super);\n function BlurYFilter(strength, quality, resolution, kernelSize) {\n var _this = this;\n deprecation(v5, 'PIXI.filters.BlurYFilter class is deprecated, use PIXI.filters.BlurFilterPass');\n _this = _super.call(this, false, strength, quality, resolution, kernelSize) || this;\n return _this;\n }\n return BlurYFilter;\n }(PIXI.filters.BlurFilterPass));\n Object.assign(PIXI.filters, {\n BlurXFilter: BlurXFilter,\n BlurYFilter: BlurYFilter,\n });\n var SpriteAny = PIXI.Sprite, TextureAny = PIXI.Texture, GraphicsAny = PIXI.Graphics;\n // Support for pixi.js-legacy bifurcation\n // give users a friendly assist to use legacy\n if (!GraphicsAny.prototype.generateCanvasTexture) {\n GraphicsAny.prototype.generateCanvasTexture = function generateCanvasTexture() {\n deprecation(v5, 'PIXI.Graphics.generateCanvasTexture method is only available in \"pixi.js-legacy\"');\n };\n }\n /**\n * @deprecated since 5.0.0\n * @member {PIXI.Graphics} PIXI.Graphics#graphicsData\n * @see PIXI.Graphics#geometry\n * @readonly\n */\n Object.defineProperty(GraphicsAny.prototype, 'graphicsData', {\n get: function () {\n deprecation(v5, 'PIXI.Graphics.graphicsData property is deprecated, use PIXI.Graphics.geometry.graphicsData');\n return this.geometry.graphicsData;\n },\n });\n // Use these to deprecate all the Sprite from* methods\n function spriteFrom(name, source, crossorigin, scaleMode) {\n deprecation(v5, \"PIXI.Sprite.\" + name + \" method is deprecated, use PIXI.Sprite.from\");\n return SpriteAny.from(source, {\n resourceOptions: {\n scale: scaleMode,\n crossorigin: crossorigin,\n },\n });\n }\n /**\n * @deprecated since 5.0.0\n * @see PIXI.Sprite.from\n * @method PIXI.Sprite.fromImage\n * @return {PIXI.Sprite}\n */\n SpriteAny.fromImage = spriteFrom.bind(null, 'fromImage');\n /**\n * @deprecated since 5.0.0\n * @method PIXI.Sprite.fromSVG\n * @see PIXI.Sprite.from\n * @return {PIXI.Sprite}\n */\n SpriteAny.fromSVG = spriteFrom.bind(null, 'fromSVG');\n /**\n * @deprecated since 5.0.0\n * @method PIXI.Sprite.fromCanvas\n * @see PIXI.Sprite.from\n * @return {PIXI.Sprite}\n */\n SpriteAny.fromCanvas = spriteFrom.bind(null, 'fromCanvas');\n /**\n * @deprecated since 5.0.0\n * @method PIXI.Sprite.fromVideo\n * @see PIXI.Sprite.from\n * @return {PIXI.Sprite}\n */\n SpriteAny.fromVideo = spriteFrom.bind(null, 'fromVideo');\n /**\n * @deprecated since 5.0.0\n * @method PIXI.Sprite.fromFrame\n * @see PIXI.Sprite.from\n * @return {PIXI.Sprite}\n */\n SpriteAny.fromFrame = spriteFrom.bind(null, 'fromFrame');\n // Use these to deprecate all the Texture from* methods\n function textureFrom(name, source, crossorigin, scaleMode) {\n deprecation(v5, \"PIXI.Texture.\" + name + \" method is deprecated, use PIXI.Texture.from\");\n return TextureAny.from(source, {\n resourceOptions: {\n scale: scaleMode,\n crossorigin: crossorigin,\n },\n });\n }\n /**\n * @deprecated since 5.0.0\n * @method PIXI.Texture.fromImage\n * @see PIXI.Texture.from\n * @return {PIXI.Texture}\n */\n TextureAny.fromImage = textureFrom.bind(null, 'fromImage');\n /**\n * @deprecated since 5.0.0\n * @method PIXI.Texture.fromSVG\n * @see PIXI.Texture.from\n * @return {PIXI.Texture}\n */\n TextureAny.fromSVG = textureFrom.bind(null, 'fromSVG');\n /**\n * @deprecated since 5.0.0\n * @method PIXI.Texture.fromCanvas\n * @see PIXI.Texture.from\n * @return {PIXI.Texture}\n */\n TextureAny.fromCanvas = textureFrom.bind(null, 'fromCanvas');\n /**\n * @deprecated since 5.0.0\n * @method PIXI.Texture.fromVideo\n * @see PIXI.Texture.from\n * @return {PIXI.Texture}\n */\n TextureAny.fromVideo = textureFrom.bind(null, 'fromVideo');\n /**\n * @deprecated since 5.0.0\n * @method PIXI.Texture.fromFrame\n * @see PIXI.Texture.from\n * @return {PIXI.Texture}\n */\n TextureAny.fromFrame = textureFrom.bind(null, 'fromFrame');\n /**\n * @deprecated since 5.0.0\n * @member {boolean} PIXI.AbstractRenderer#autoResize\n * @see PIXI.AbstractRenderer#autoDensity\n */\n Object.defineProperty(PIXI.AbstractRenderer.prototype, 'autoResize', {\n get: function () {\n deprecation(v5, 'PIXI.AbstractRenderer.autoResize property is deprecated, '\n + 'use PIXI.AbstractRenderer.autoDensity');\n return this.autoDensity;\n },\n set: function (value) {\n deprecation(v5, 'PIXI.AbstractRenderer.autoResize property is deprecated, '\n + 'use PIXI.AbstractRenderer.autoDensity');\n this.autoDensity = value;\n },\n });\n /**\n * @deprecated since 5.0.0\n * @member {PIXI.systems.TextureSystem} PIXI.Renderer#textureManager\n * @see PIXI.Renderer#texture\n */\n Object.defineProperty(PIXI.Renderer.prototype, 'textureManager', {\n get: function () {\n deprecation(v5, 'PIXI.Renderer.textureManager property is deprecated, use PIXI.Renderer.texture');\n return this.texture;\n },\n });\n /**\n * @namespace PIXI.utils.mixins\n * @deprecated since 5.0.0\n */\n PIXI.utils.mixins = {\n /**\n * @memberof PIXI.utils.mixins\n * @function mixin\n * @deprecated since 5.0.0\n */\n mixin: function () {\n deprecation(v5, 'PIXI.utils.mixins.mixin function is no longer available');\n },\n /**\n * @memberof PIXI.utils.mixins\n * @function delayMixin\n * @deprecated since 5.0.0\n */\n delayMixin: function () {\n deprecation(v5, 'PIXI.utils.mixins.delayMixin function is no longer available');\n },\n /**\n * @memberof PIXI.utils.mixins\n * @function performMixins\n * @deprecated since 5.0.0\n */\n performMixins: function () {\n deprecation(v5, 'PIXI.utils.mixins.performMixins function is no longer available');\n },\n };\n /**\n * @memberof PIXI.BitmapText\n * @member {object} font\n * @deprecated since 5.3.0\n */\n Object.defineProperty(PIXI.BitmapText.prototype, 'font', {\n get: function () {\n deprecation('5.3.0', 'PIXI.BitmapText.font property is deprecated, '\n + 'use fontName, fontSize, tint or align properties');\n return {\n name: this._fontName,\n size: this._fontSize,\n tint: this._tint,\n align: this._align,\n };\n },\n set: function (value) {\n deprecation('5.3.0', 'PIXI.BitmapText.font property is deprecated, '\n + 'use fontName, fontSize, tint or align properties');\n if (!value) {\n return;\n }\n var style = { font: value };\n this._upgradeStyle(style);\n style.fontSize = style.fontSize || PIXI.BitmapFont.available[style.fontName].size;\n this._fontName = style.fontName;\n this._fontSize = style.fontSize;\n this.dirty = true;\n },\n });\n}\n\n// Install renderer plugins\nRenderer.registerPlugin('accessibility', AccessibilityManager);\nRenderer.registerPlugin('extract', Extract);\nRenderer.registerPlugin('interaction', InteractionManager);\nRenderer.registerPlugin('particle', ParticleRenderer);\nRenderer.registerPlugin('prepare', Prepare);\nRenderer.registerPlugin('batch', BatchRenderer);\nRenderer.registerPlugin('tilingSprite', TilingSpriteRenderer);\nLoader.registerPlugin(BitmapFontLoader);\nLoader.registerPlugin(SpritesheetLoader);\nApplication.registerPlugin(TickerPlugin);\nApplication.registerPlugin(AppLoaderPlugin);\n/**\n * String of the current PIXI version.\n *\n * @static\n * @constant\n * @memberof PIXI\n * @name VERSION\n * @type {string}\n */\nvar VERSION = '5.3.7';\n/**\n * @namespace PIXI\n */\n/**\n * This namespace contains WebGL-only display filters that can be applied\n * to DisplayObjects using the {@link PIXI.DisplayObject#filters filters} property.\n *\n * Since PixiJS only had a handful of built-in filters, additional filters\n * can be downloaded {@link https://github.com/pixijs/pixi-filters here} from the\n * PixiJS Filters repository.\n *\n * All filters must extend {@link PIXI.Filter}.\n *\n * @example\n * // Create a new application\n * const app = new PIXI.Application();\n *\n * // Draw a green rectangle\n * const rect = new PIXI.Graphics()\n * .beginFill(0x00ff00)\n * .drawRect(40, 40, 200, 200);\n *\n * // Add a blur filter\n * rect.filters = [new PIXI.filters.BlurFilter()];\n *\n * // Display rectangle\n * app.stage.addChild(rect);\n * document.body.appendChild(app.view);\n * @namespace PIXI.filters\n */\nvar filters = {\n AlphaFilter: AlphaFilter,\n BlurFilter: BlurFilter,\n BlurFilterPass: BlurFilterPass,\n ColorMatrixFilter: ColorMatrixFilter,\n DisplacementFilter: DisplacementFilter,\n FXAAFilter: FXAAFilter,\n NoiseFilter: NoiseFilter,\n};\n\nexport { VERSION, filters, useDeprecated };\n//# sourceMappingURL=pixi.es.js.map\n","import { render } from \"./Live2d.vue?vue&type=template&id=6700412c&scoped=true\"\nimport script from \"./Live2d.vue?vue&type=script&lang=js\"\nexport * from \"./Live2d.vue?vue&type=script&lang=js\"\n\nimport \"./Live2d.vue?vue&type=style&index=0&id=6700412c&scoped=true&lang=css\"\nscript.render = render\nscript.__scopeId = \"data-v-6700412c\"\n\nexport default script","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","var baseFor = require('./_baseFor'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nmodule.exports = baseForOwn;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","/*!\n * @pixi/math - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/math is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\n/**\n * Two Pi.\n *\n * @static\n * @constant {number} PI_2\n * @memberof PIXI\n */\nvar PI_2 = Math.PI * 2;\n/**\n * Conversion factor for converting radians to degrees.\n *\n * @static\n * @constant {number} RAD_TO_DEG\n * @memberof PIXI\n */\nvar RAD_TO_DEG = 180 / Math.PI;\n/**\n * Conversion factor for converting degrees to radians.\n *\n * @static\n * @constant {number} DEG_TO_RAD\n * @memberof PIXI\n */\nvar DEG_TO_RAD = Math.PI / 180;\nvar SHAPES;\n(function (SHAPES) {\n SHAPES[SHAPES[\"POLY\"] = 0] = \"POLY\";\n SHAPES[SHAPES[\"RECT\"] = 1] = \"RECT\";\n SHAPES[SHAPES[\"CIRC\"] = 2] = \"CIRC\";\n SHAPES[SHAPES[\"ELIP\"] = 3] = \"ELIP\";\n SHAPES[SHAPES[\"RREC\"] = 4] = \"RREC\";\n})(SHAPES || (SHAPES = {}));\n/**\n * Constants that identify shapes, mainly to prevent `instanceof` calls.\n *\n * @static\n * @constant\n * @name SHAPES\n * @memberof PIXI\n * @type {enum}\n * @property {number} POLY Polygon\n * @property {number} RECT Rectangle\n * @property {number} CIRC Circle\n * @property {number} ELIP Ellipse\n * @property {number} RREC Rounded Rectangle\n * @enum {number}\n */\n\n/**\n * Size object, contains width and height\n *\n * @memberof PIXI\n * @typedef {object} ISize\n * @property {number} width - Width component\n * @property {number} height - Height component\n */\n/**\n * Rectangle object is an area defined by its position, as indicated by its top-left corner\n * point (x, y) and by its width and its height.\n *\n * @class\n * @memberof PIXI\n */\nvar Rectangle = /** @class */ (function () {\n /**\n * @param {number} [x=0] - The X coordinate of the upper-left corner of the rectangle\n * @param {number} [y=0] - The Y coordinate of the upper-left corner of the rectangle\n * @param {number} [width=0] - The overall width of this rectangle\n * @param {number} [height=0] - The overall height of this rectangle\n */\n function Rectangle(x, y, width, height) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (width === void 0) { width = 0; }\n if (height === void 0) { height = 0; }\n /**\n * @member {number}\n * @default 0\n */\n this.x = Number(x);\n /**\n * @member {number}\n * @default 0\n */\n this.y = Number(y);\n /**\n * @member {number}\n * @default 0\n */\n this.width = Number(width);\n /**\n * @member {number}\n * @default 0\n */\n this.height = Number(height);\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readOnly\n * @default PIXI.SHAPES.RECT\n * @see PIXI.SHAPES\n */\n this.type = SHAPES.RECT;\n }\n Object.defineProperty(Rectangle.prototype, \"left\", {\n /**\n * returns the left edge of the rectangle\n *\n * @member {number}\n */\n get: function () {\n return this.x;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Rectangle.prototype, \"right\", {\n /**\n * returns the right edge of the rectangle\n *\n * @member {number}\n */\n get: function () {\n return this.x + this.width;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Rectangle.prototype, \"top\", {\n /**\n * returns the top edge of the rectangle\n *\n * @member {number}\n */\n get: function () {\n return this.y;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Rectangle.prototype, \"bottom\", {\n /**\n * returns the bottom edge of the rectangle\n *\n * @member {number}\n */\n get: function () {\n return this.y + this.height;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Rectangle, \"EMPTY\", {\n /**\n * A constant empty rectangle.\n *\n * @static\n * @constant\n * @member {PIXI.Rectangle}\n * @return {PIXI.Rectangle} An empty rectangle\n */\n get: function () {\n return new Rectangle(0, 0, 0, 0);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Creates a clone of this Rectangle\n *\n * @return {PIXI.Rectangle} a copy of the rectangle\n */\n Rectangle.prototype.clone = function () {\n return new Rectangle(this.x, this.y, this.width, this.height);\n };\n /**\n * Copies another rectangle to this one.\n *\n * @param {PIXI.Rectangle} rectangle - The rectangle to copy from.\n * @return {PIXI.Rectangle} Returns itself.\n */\n Rectangle.prototype.copyFrom = function (rectangle) {\n this.x = rectangle.x;\n this.y = rectangle.y;\n this.width = rectangle.width;\n this.height = rectangle.height;\n return this;\n };\n /**\n * Copies this rectangle to another one.\n *\n * @param {PIXI.Rectangle} rectangle - The rectangle to copy to.\n * @return {PIXI.Rectangle} Returns given parameter.\n */\n Rectangle.prototype.copyTo = function (rectangle) {\n rectangle.x = this.x;\n rectangle.y = this.y;\n rectangle.width = this.width;\n rectangle.height = this.height;\n return rectangle;\n };\n /**\n * Checks whether the x and y coordinates given are contained within this Rectangle\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this Rectangle\n */\n Rectangle.prototype.contains = function (x, y) {\n if (this.width <= 0 || this.height <= 0) {\n return false;\n }\n if (x >= this.x && x < this.x + this.width) {\n if (y >= this.y && y < this.y + this.height) {\n return true;\n }\n }\n return false;\n };\n /**\n * Pads the rectangle making it grow in all directions.\n * If paddingY is omitted, both paddingX and paddingY will be set to paddingX.\n *\n * @param {number} [paddingX=0] - The horizontal padding amount.\n * @param {number} [paddingY=0] - The vertical padding amount.\n * @return {PIXI.Rectangle} Returns itself.\n */\n Rectangle.prototype.pad = function (paddingX, paddingY) {\n if (paddingX === void 0) { paddingX = 0; }\n if (paddingY === void 0) { paddingY = paddingX; }\n this.x -= paddingX;\n this.y -= paddingY;\n this.width += paddingX * 2;\n this.height += paddingY * 2;\n return this;\n };\n /**\n * Fits this rectangle around the passed one.\n *\n * @param {PIXI.Rectangle} rectangle - The rectangle to fit.\n * @return {PIXI.Rectangle} Returns itself.\n */\n Rectangle.prototype.fit = function (rectangle) {\n var x1 = Math.max(this.x, rectangle.x);\n var x2 = Math.min(this.x + this.width, rectangle.x + rectangle.width);\n var y1 = Math.max(this.y, rectangle.y);\n var y2 = Math.min(this.y + this.height, rectangle.y + rectangle.height);\n this.x = x1;\n this.width = Math.max(x2 - x1, 0);\n this.y = y1;\n this.height = Math.max(y2 - y1, 0);\n return this;\n };\n /**\n * Enlarges rectangle that way its corners lie on grid\n *\n * @param {number} [resolution=1] resolution\n * @param {number} [eps=0.001] precision\n * @return {PIXI.Rectangle} Returns itself.\n */\n Rectangle.prototype.ceil = function (resolution, eps) {\n if (resolution === void 0) { resolution = 1; }\n if (eps === void 0) { eps = 0.001; }\n var x2 = Math.ceil((this.x + this.width - eps) * resolution) / resolution;\n var y2 = Math.ceil((this.y + this.height - eps) * resolution) / resolution;\n this.x = Math.floor((this.x + eps) * resolution) / resolution;\n this.y = Math.floor((this.y + eps) * resolution) / resolution;\n this.width = x2 - this.x;\n this.height = y2 - this.y;\n return this;\n };\n /**\n * Enlarges this rectangle to include the passed rectangle.\n *\n * @param {PIXI.Rectangle} rectangle - The rectangle to include.\n * @return {PIXI.Rectangle} Returns itself.\n */\n Rectangle.prototype.enlarge = function (rectangle) {\n var x1 = Math.min(this.x, rectangle.x);\n var x2 = Math.max(this.x + this.width, rectangle.x + rectangle.width);\n var y1 = Math.min(this.y, rectangle.y);\n var y2 = Math.max(this.y + this.height, rectangle.y + rectangle.height);\n this.x = x1;\n this.width = x2 - x1;\n this.y = y1;\n this.height = y2 - y1;\n return this;\n };\n return Rectangle;\n}());\n\n/**\n * The Circle object is used to help draw graphics and can also be used to specify a hit area for displayObjects.\n *\n * @class\n * @memberof PIXI\n */\nvar Circle = /** @class */ (function () {\n /**\n * @param {number} [x=0] - The X coordinate of the center of this circle\n * @param {number} [y=0] - The Y coordinate of the center of this circle\n * @param {number} [radius=0] - The radius of the circle\n */\n function Circle(x, y, radius) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (radius === void 0) { radius = 0; }\n /**\n * @member {number}\n * @default 0\n */\n this.x = x;\n /**\n * @member {number}\n * @default 0\n */\n this.y = y;\n /**\n * @member {number}\n * @default 0\n */\n this.radius = radius;\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readOnly\n * @default PIXI.SHAPES.CIRC\n * @see PIXI.SHAPES\n */\n this.type = SHAPES.CIRC;\n }\n /**\n * Creates a clone of this Circle instance\n *\n * @return {PIXI.Circle} a copy of the Circle\n */\n Circle.prototype.clone = function () {\n return new Circle(this.x, this.y, this.radius);\n };\n /**\n * Checks whether the x and y coordinates given are contained within this circle\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this Circle\n */\n Circle.prototype.contains = function (x, y) {\n if (this.radius <= 0) {\n return false;\n }\n var r2 = this.radius * this.radius;\n var dx = (this.x - x);\n var dy = (this.y - y);\n dx *= dx;\n dy *= dy;\n return (dx + dy <= r2);\n };\n /**\n * Returns the framing rectangle of the circle as a Rectangle object\n *\n * @return {PIXI.Rectangle} the framing rectangle\n */\n Circle.prototype.getBounds = function () {\n return new Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2);\n };\n return Circle;\n}());\n\n/**\n * The Ellipse object is used to help draw graphics and can also be used to specify a hit area for displayObjects.\n *\n * @class\n * @memberof PIXI\n */\nvar Ellipse = /** @class */ (function () {\n /**\n * @param {number} [x=0] - The X coordinate of the center of this ellipse\n * @param {number} [y=0] - The Y coordinate of the center of this ellipse\n * @param {number} [halfWidth=0] - The half width of this ellipse\n * @param {number} [halfHeight=0] - The half height of this ellipse\n */\n function Ellipse(x, y, halfWidth, halfHeight) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (halfWidth === void 0) { halfWidth = 0; }\n if (halfHeight === void 0) { halfHeight = 0; }\n /**\n * @member {number}\n * @default 0\n */\n this.x = x;\n /**\n * @member {number}\n * @default 0\n */\n this.y = y;\n /**\n * @member {number}\n * @default 0\n */\n this.width = halfWidth;\n /**\n * @member {number}\n * @default 0\n */\n this.height = halfHeight;\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readOnly\n * @default PIXI.SHAPES.ELIP\n * @see PIXI.SHAPES\n */\n this.type = SHAPES.ELIP;\n }\n /**\n * Creates a clone of this Ellipse instance\n *\n * @return {PIXI.Ellipse} a copy of the ellipse\n */\n Ellipse.prototype.clone = function () {\n return new Ellipse(this.x, this.y, this.width, this.height);\n };\n /**\n * Checks whether the x and y coordinates given are contained within this ellipse\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coords are within this ellipse\n */\n Ellipse.prototype.contains = function (x, y) {\n if (this.width <= 0 || this.height <= 0) {\n return false;\n }\n // normalize the coords to an ellipse with center 0,0\n var normx = ((x - this.x) / this.width);\n var normy = ((y - this.y) / this.height);\n normx *= normx;\n normy *= normy;\n return (normx + normy <= 1);\n };\n /**\n * Returns the framing rectangle of the ellipse as a Rectangle object\n *\n * @return {PIXI.Rectangle} the framing rectangle\n */\n Ellipse.prototype.getBounds = function () {\n return new Rectangle(this.x - this.width, this.y - this.height, this.width, this.height);\n };\n return Ellipse;\n}());\n\n/**\n * A class to define a shape via user defined co-orinates.\n *\n * @class\n * @memberof PIXI\n */\nvar Polygon = /** @class */ (function () {\n /**\n * @param {PIXI.IPoint[]|number[]} points - This can be an array of Points\n * that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], or\n * the arguments passed can be all the points of the polygon e.g.\n * `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the arguments passed can be flat\n * x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are Numbers.\n */\n function Polygon() {\n var arguments$1 = arguments;\n\n var points = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n points[_i] = arguments$1[_i];\n }\n var flat = Array.isArray(points[0]) ? points[0] : points;\n // if this is an array of points, convert it to a flat array of numbers\n if (typeof flat[0] !== 'number') {\n var p = [];\n for (var i = 0, il = flat.length; i < il; i++) {\n p.push(flat[i].x, flat[i].y);\n }\n flat = p;\n }\n /**\n * An array of the points of this polygon\n *\n * @member {number[]}\n */\n this.points = flat;\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readOnly\n * @default PIXI.SHAPES.POLY\n * @see PIXI.SHAPES\n */\n this.type = SHAPES.POLY;\n /**\n * `false` after moveTo, `true` after `closePath`. In all other cases it is `true`.\n * @member {boolean}\n * @default true\n */\n this.closeStroke = true;\n }\n /**\n * Creates a clone of this polygon\n *\n * @return {PIXI.Polygon} a copy of the polygon\n */\n Polygon.prototype.clone = function () {\n var points = this.points.slice();\n var polygon = new Polygon(points);\n polygon.closeStroke = this.closeStroke;\n return polygon;\n };\n /**\n * Checks whether the x and y coordinates passed to this function are contained within this polygon\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this polygon\n */\n Polygon.prototype.contains = function (x, y) {\n var inside = false;\n // use some raycasting to test hits\n // https://github.com/substack/point-in-polygon/blob/master/index.js\n var length = this.points.length / 2;\n for (var i = 0, j = length - 1; i < length; j = i++) {\n var xi = this.points[i * 2];\n var yi = this.points[(i * 2) + 1];\n var xj = this.points[j * 2];\n var yj = this.points[(j * 2) + 1];\n var intersect = ((yi > y) !== (yj > y)) && (x < ((xj - xi) * ((y - yi) / (yj - yi))) + xi);\n if (intersect) {\n inside = !inside;\n }\n }\n return inside;\n };\n return Polygon;\n}());\n\n/**\n * The Rounded Rectangle object is an area that has nice rounded corners, as indicated by its\n * top-left corner point (x, y) and by its width and its height and its radius.\n *\n * @class\n * @memberof PIXI\n */\nvar RoundedRectangle = /** @class */ (function () {\n /**\n * @param {number} [x=0] - The X coordinate of the upper-left corner of the rounded rectangle\n * @param {number} [y=0] - The Y coordinate of the upper-left corner of the rounded rectangle\n * @param {number} [width=0] - The overall width of this rounded rectangle\n * @param {number} [height=0] - The overall height of this rounded rectangle\n * @param {number} [radius=20] - Controls the radius of the rounded corners\n */\n function RoundedRectangle(x, y, width, height, radius) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (width === void 0) { width = 0; }\n if (height === void 0) { height = 0; }\n if (radius === void 0) { radius = 20; }\n /**\n * @member {number}\n * @default 0\n */\n this.x = x;\n /**\n * @member {number}\n * @default 0\n */\n this.y = y;\n /**\n * @member {number}\n * @default 0\n */\n this.width = width;\n /**\n * @member {number}\n * @default 0\n */\n this.height = height;\n /**\n * @member {number}\n * @default 20\n */\n this.radius = radius;\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readonly\n * @default PIXI.SHAPES.RREC\n * @see PIXI.SHAPES\n */\n this.type = SHAPES.RREC;\n }\n /**\n * Creates a clone of this Rounded Rectangle\n *\n * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle\n */\n RoundedRectangle.prototype.clone = function () {\n return new RoundedRectangle(this.x, this.y, this.width, this.height, this.radius);\n };\n /**\n * Checks whether the x and y coordinates given are contained within this Rounded Rectangle\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this Rounded Rectangle\n */\n RoundedRectangle.prototype.contains = function (x, y) {\n if (this.width <= 0 || this.height <= 0) {\n return false;\n }\n if (x >= this.x && x <= this.x + this.width) {\n if (y >= this.y && y <= this.y + this.height) {\n if ((y >= this.y + this.radius && y <= this.y + this.height - this.radius)\n || (x >= this.x + this.radius && x <= this.x + this.width - this.radius)) {\n return true;\n }\n var dx = x - (this.x + this.radius);\n var dy = y - (this.y + this.radius);\n var radius2 = this.radius * this.radius;\n if ((dx * dx) + (dy * dy) <= radius2) {\n return true;\n }\n dx = x - (this.x + this.width - this.radius);\n if ((dx * dx) + (dy * dy) <= radius2) {\n return true;\n }\n dy = y - (this.y + this.height - this.radius);\n if ((dx * dx) + (dy * dy) <= radius2) {\n return true;\n }\n dx = x - (this.x + this.radius);\n if ((dx * dx) + (dy * dy) <= radius2) {\n return true;\n }\n }\n }\n return false;\n };\n return RoundedRectangle;\n}());\n\n/**\n * Common interface for points. Both Point and ObservablePoint implement it\n * @memberof PIXI\n * @interface IPointData\n */\n/**\n * X coord\n * @memberof PIXI.IPointData#\n * @member {number} x\n */\n/**\n * Y coord\n * @memberof PIXI.IPointData#\n * @member {number} y\n */\n\n/**\n * Common interface for points. Both Point and ObservablePoint implement it\n * @memberof PIXI\n * @interface IPoint\n * @extends PIXI.IPointData\n */\n/**\n * Sets the point to a new x and y position.\n * If y is omitted, both x and y will be set to x.\n *\n * @method set\n * @memberof PIXI.IPoint#\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=x] - position of the point on the y axis\n */\n/**\n * Copies x and y from the given point\n * @method copyFrom\n * @memberof PIXI.IPoint#\n * @param {PIXI.IPointData} p - The point to copy from\n * @returns {this} Returns itself.\n */\n/**\n * Copies x and y into the given point\n * @method copyTo\n * @memberof PIXI.IPoint#\n * @param {PIXI.IPoint} p - The point to copy.\n * @returns {PIXI.IPoint} Given point with values updated\n */\n/**\n * Returns true if the given point is equal to this point\n *\n * @method equals\n * @memberof PIXI.IPoint#\n * @param {PIXI.IPointData} p - The point to check\n * @returns {boolean} Whether the given point equal to this point\n */\n\n/**\n * The Point object represents a location in a two-dimensional coordinate system, where x represents\n * the horizontal axis and y represents the vertical axis.\n *\n * @class\n * @memberof PIXI\n * @implements IPoint\n */\nvar Point = /** @class */ (function () {\n /**\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n function Point(x, y) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n /**\n * @member {number}\n * @default 0\n */\n this.x = x;\n /**\n * @member {number}\n * @default 0\n */\n this.y = y;\n }\n /**\n * Creates a clone of this point\n *\n * @return {PIXI.Point} a copy of the point\n */\n Point.prototype.clone = function () {\n return new Point(this.x, this.y);\n };\n /**\n * Copies x and y from the given point\n *\n * @param {PIXI.IPointData} p - The point to copy from\n * @returns {this} Returns itself.\n */\n Point.prototype.copyFrom = function (p) {\n this.set(p.x, p.y);\n return this;\n };\n /**\n * Copies x and y into the given point\n *\n * @param {PIXI.IPoint} p - The point to copy.\n * @returns {PIXI.IPoint} Given point with values updated\n */\n Point.prototype.copyTo = function (p) {\n p.set(this.x, this.y);\n return p;\n };\n /**\n * Returns true if the given point is equal to this point\n *\n * @param {PIXI.IPointData} p - The point to check\n * @returns {boolean} Whether the given point equal to this point\n */\n Point.prototype.equals = function (p) {\n return (p.x === this.x) && (p.y === this.y);\n };\n /**\n * Sets the point to a new x and y position.\n * If y is omitted, both x and y will be set to x.\n *\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=x] - position of the point on the y axis\n * @returns {this} Returns itself.\n */\n Point.prototype.set = function (x, y) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = x; }\n this.x = x;\n this.y = y;\n return this;\n };\n return Point;\n}());\n\n/**\n * The Point object represents a location in a two-dimensional coordinate system, where x represents\n * the horizontal axis and y represents the vertical axis.\n *\n * An ObservablePoint is a point that triggers a callback when the point's position is changed.\n *\n * @class\n * @memberof PIXI\n * @implements IPoint\n */\nvar ObservablePoint = /** @class */ (function () {\n /**\n * @param {Function} cb - callback when changed\n * @param {object} scope - owner of callback\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n function ObservablePoint(cb, scope, x, y) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n this._x = x;\n this._y = y;\n this.cb = cb;\n this.scope = scope;\n }\n /**\n * Creates a clone of this point.\n * The callback and scope params can be overidden otherwise they will default\n * to the clone object's values.\n *\n * @override\n * @param {Function} [cb=null] - callback when changed\n * @param {object} [scope=null] - owner of callback\n * @return {PIXI.ObservablePoint} a copy of the point\n */\n ObservablePoint.prototype.clone = function (cb, scope) {\n if (cb === void 0) { cb = this.cb; }\n if (scope === void 0) { scope = this.scope; }\n return new ObservablePoint(cb, scope, this._x, this._y);\n };\n /**\n * Sets the point to a new x and y position.\n * If y is omitted, both x and y will be set to x.\n *\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=x] - position of the point on the y axis\n * @returns {this} Returns itself.\n */\n ObservablePoint.prototype.set = function (x, y) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = x; }\n if (this._x !== x || this._y !== y) {\n this._x = x;\n this._y = y;\n this.cb.call(this.scope);\n }\n return this;\n };\n /**\n * Copies x and y from the given point\n *\n * @param {PIXI.IPointData} p - The point to copy from.\n * @returns {this} Returns itself.\n */\n ObservablePoint.prototype.copyFrom = function (p) {\n if (this._x !== p.x || this._y !== p.y) {\n this._x = p.x;\n this._y = p.y;\n this.cb.call(this.scope);\n }\n return this;\n };\n /**\n * Copies x and y into the given point\n *\n * @param {PIXI.IPoint} p - The point to copy.\n * @returns {PIXI.IPoint} Given point with values updated\n */\n ObservablePoint.prototype.copyTo = function (p) {\n p.set(this._x, this._y);\n return p;\n };\n /**\n * Returns true if the given point is equal to this point\n *\n * @param {PIXI.IPointData} p - The point to check\n * @returns {boolean} Whether the given point equal to this point\n */\n ObservablePoint.prototype.equals = function (p) {\n return (p.x === this._x) && (p.y === this._y);\n };\n Object.defineProperty(ObservablePoint.prototype, \"x\", {\n /**\n * The position of the displayObject on the x axis relative to the local coordinates of the parent.\n *\n * @member {number}\n */\n get: function () {\n return this._x;\n },\n set: function (value) {\n if (this._x !== value) {\n this._x = value;\n this.cb.call(this.scope);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ObservablePoint.prototype, \"y\", {\n /**\n * The position of the displayObject on the x axis relative to the local coordinates of the parent.\n *\n * @member {number}\n */\n get: function () {\n return this._y;\n },\n set: function (value) {\n if (this._y !== value) {\n this._y = value;\n this.cb.call(this.scope);\n }\n },\n enumerable: false,\n configurable: true\n });\n return ObservablePoint;\n}());\n\n/**\n * The PixiJS Matrix as a class makes it a lot faster.\n *\n * Here is a representation of it:\n * ```js\n * | a | c | tx|\n * | b | d | ty|\n * | 0 | 0 | 1 |\n * ```\n * @class\n * @memberof PIXI\n */\nvar Matrix = /** @class */ (function () {\n /**\n * @param {number} [a=1] - x scale\n * @param {number} [b=0] - x skew\n * @param {number} [c=0] - y skew\n * @param {number} [d=1] - y scale\n * @param {number} [tx=0] - x translation\n * @param {number} [ty=0] - y translation\n */\n function Matrix(a, b, c, d, tx, ty) {\n if (a === void 0) { a = 1; }\n if (b === void 0) { b = 0; }\n if (c === void 0) { c = 0; }\n if (d === void 0) { d = 1; }\n if (tx === void 0) { tx = 0; }\n if (ty === void 0) { ty = 0; }\n this.array = null;\n /**\n * @member {number}\n * @default 1\n */\n this.a = a;\n /**\n * @member {number}\n * @default 0\n */\n this.b = b;\n /**\n * @member {number}\n * @default 0\n */\n this.c = c;\n /**\n * @member {number}\n * @default 1\n */\n this.d = d;\n /**\n * @member {number}\n * @default 0\n */\n this.tx = tx;\n /**\n * @member {number}\n * @default 0\n */\n this.ty = ty;\n }\n /**\n * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:\n *\n * a = array[0]\n * b = array[1]\n * c = array[3]\n * d = array[4]\n * tx = array[2]\n * ty = array[5]\n *\n * @param {number[]} array - The array that the matrix will be populated from.\n */\n Matrix.prototype.fromArray = function (array) {\n this.a = array[0];\n this.b = array[1];\n this.c = array[3];\n this.d = array[4];\n this.tx = array[2];\n this.ty = array[5];\n };\n /**\n * sets the matrix properties\n *\n * @param {number} a - Matrix component\n * @param {number} b - Matrix component\n * @param {number} c - Matrix component\n * @param {number} d - Matrix component\n * @param {number} tx - Matrix component\n * @param {number} ty - Matrix component\n *\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n Matrix.prototype.set = function (a, b, c, d, tx, ty) {\n this.a = a;\n this.b = b;\n this.c = c;\n this.d = d;\n this.tx = tx;\n this.ty = ty;\n return this;\n };\n /**\n * Creates an array from the current Matrix object.\n *\n * @param {boolean} transpose - Whether we need to transpose the matrix or not\n * @param {Float32Array} [out=new Float32Array(9)] - If provided the array will be assigned to out\n * @return {number[]} the newly created array which contains the matrix\n */\n Matrix.prototype.toArray = function (transpose, out) {\n if (!this.array) {\n this.array = new Float32Array(9);\n }\n var array = out || this.array;\n if (transpose) {\n array[0] = this.a;\n array[1] = this.b;\n array[2] = 0;\n array[3] = this.c;\n array[4] = this.d;\n array[5] = 0;\n array[6] = this.tx;\n array[7] = this.ty;\n array[8] = 1;\n }\n else {\n array[0] = this.a;\n array[1] = this.c;\n array[2] = this.tx;\n array[3] = this.b;\n array[4] = this.d;\n array[5] = this.ty;\n array[6] = 0;\n array[7] = 0;\n array[8] = 1;\n }\n return array;\n };\n /**\n * Get a new position with the current transformation applied.\n * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)\n *\n * @param {PIXI.IPointData} pos - The origin\n * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)\n * @return {PIXI.Point} The new point, transformed through this matrix\n */\n Matrix.prototype.apply = function (pos, newPos) {\n newPos = (newPos || new Point());\n var x = pos.x;\n var y = pos.y;\n newPos.x = (this.a * x) + (this.c * y) + this.tx;\n newPos.y = (this.b * x) + (this.d * y) + this.ty;\n return newPos;\n };\n /**\n * Get a new position with the inverse of the current transformation applied.\n * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input)\n *\n * @param {PIXI.IPointData} pos - The origin\n * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)\n * @return {PIXI.Point} The new point, inverse-transformed through this matrix\n */\n Matrix.prototype.applyInverse = function (pos, newPos) {\n newPos = (newPos || new Point());\n var id = 1 / ((this.a * this.d) + (this.c * -this.b));\n var x = pos.x;\n var y = pos.y;\n newPos.x = (this.d * id * x) + (-this.c * id * y) + (((this.ty * this.c) - (this.tx * this.d)) * id);\n newPos.y = (this.a * id * y) + (-this.b * id * x) + (((-this.ty * this.a) + (this.tx * this.b)) * id);\n return newPos;\n };\n /**\n * Translates the matrix on the x and y.\n *\n * @param {number} x - How much to translate x by\n * @param {number} y - How much to translate y by\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n Matrix.prototype.translate = function (x, y) {\n this.tx += x;\n this.ty += y;\n return this;\n };\n /**\n * Applies a scale transformation to the matrix.\n *\n * @param {number} x - The amount to scale horizontally\n * @param {number} y - The amount to scale vertically\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n Matrix.prototype.scale = function (x, y) {\n this.a *= x;\n this.d *= y;\n this.c *= x;\n this.b *= y;\n this.tx *= x;\n this.ty *= y;\n return this;\n };\n /**\n * Applies a rotation transformation to the matrix.\n *\n * @param {number} angle - The angle in radians.\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n Matrix.prototype.rotate = function (angle) {\n var cos = Math.cos(angle);\n var sin = Math.sin(angle);\n var a1 = this.a;\n var c1 = this.c;\n var tx1 = this.tx;\n this.a = (a1 * cos) - (this.b * sin);\n this.b = (a1 * sin) + (this.b * cos);\n this.c = (c1 * cos) - (this.d * sin);\n this.d = (c1 * sin) + (this.d * cos);\n this.tx = (tx1 * cos) - (this.ty * sin);\n this.ty = (tx1 * sin) + (this.ty * cos);\n return this;\n };\n /**\n * Appends the given Matrix to this Matrix.\n *\n * @param {PIXI.Matrix} matrix - The matrix to append.\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n Matrix.prototype.append = function (matrix) {\n var a1 = this.a;\n var b1 = this.b;\n var c1 = this.c;\n var d1 = this.d;\n this.a = (matrix.a * a1) + (matrix.b * c1);\n this.b = (matrix.a * b1) + (matrix.b * d1);\n this.c = (matrix.c * a1) + (matrix.d * c1);\n this.d = (matrix.c * b1) + (matrix.d * d1);\n this.tx = (matrix.tx * a1) + (matrix.ty * c1) + this.tx;\n this.ty = (matrix.tx * b1) + (matrix.ty * d1) + this.ty;\n return this;\n };\n /**\n * Sets the matrix based on all the available properties\n *\n * @param {number} x - Position on the x axis\n * @param {number} y - Position on the y axis\n * @param {number} pivotX - Pivot on the x axis\n * @param {number} pivotY - Pivot on the y axis\n * @param {number} scaleX - Scale on the x axis\n * @param {number} scaleY - Scale on the y axis\n * @param {number} rotation - Rotation in radians\n * @param {number} skewX - Skew on the x axis\n * @param {number} skewY - Skew on the y axis\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n Matrix.prototype.setTransform = function (x, y, pivotX, pivotY, scaleX, scaleY, rotation, skewX, skewY) {\n this.a = Math.cos(rotation + skewY) * scaleX;\n this.b = Math.sin(rotation + skewY) * scaleX;\n this.c = -Math.sin(rotation - skewX) * scaleY;\n this.d = Math.cos(rotation - skewX) * scaleY;\n this.tx = x - ((pivotX * this.a) + (pivotY * this.c));\n this.ty = y - ((pivotX * this.b) + (pivotY * this.d));\n return this;\n };\n /**\n * Prepends the given Matrix to this Matrix.\n *\n * @param {PIXI.Matrix} matrix - The matrix to prepend\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n Matrix.prototype.prepend = function (matrix) {\n var tx1 = this.tx;\n if (matrix.a !== 1 || matrix.b !== 0 || matrix.c !== 0 || matrix.d !== 1) {\n var a1 = this.a;\n var c1 = this.c;\n this.a = (a1 * matrix.a) + (this.b * matrix.c);\n this.b = (a1 * matrix.b) + (this.b * matrix.d);\n this.c = (c1 * matrix.a) + (this.d * matrix.c);\n this.d = (c1 * matrix.b) + (this.d * matrix.d);\n }\n this.tx = (tx1 * matrix.a) + (this.ty * matrix.c) + matrix.tx;\n this.ty = (tx1 * matrix.b) + (this.ty * matrix.d) + matrix.ty;\n return this;\n };\n /**\n * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform.\n *\n * @param {PIXI.Transform} transform - The transform to apply the properties to.\n * @return {PIXI.Transform} The transform with the newly applied properties\n */\n Matrix.prototype.decompose = function (transform) {\n // sort out rotation / skew..\n var a = this.a;\n var b = this.b;\n var c = this.c;\n var d = this.d;\n var skewX = -Math.atan2(-c, d);\n var skewY = Math.atan2(b, a);\n var delta = Math.abs(skewX + skewY);\n if (delta < 0.00001 || Math.abs(PI_2 - delta) < 0.00001) {\n transform.rotation = skewY;\n transform.skew.x = transform.skew.y = 0;\n }\n else {\n transform.rotation = 0;\n transform.skew.x = skewX;\n transform.skew.y = skewY;\n }\n // next set scale\n transform.scale.x = Math.sqrt((a * a) + (b * b));\n transform.scale.y = Math.sqrt((c * c) + (d * d));\n // next set position\n transform.position.x = this.tx;\n transform.position.y = this.ty;\n return transform;\n };\n /**\n * Inverts this matrix\n *\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n Matrix.prototype.invert = function () {\n var a1 = this.a;\n var b1 = this.b;\n var c1 = this.c;\n var d1 = this.d;\n var tx1 = this.tx;\n var n = (a1 * d1) - (b1 * c1);\n this.a = d1 / n;\n this.b = -b1 / n;\n this.c = -c1 / n;\n this.d = a1 / n;\n this.tx = ((c1 * this.ty) - (d1 * tx1)) / n;\n this.ty = -((a1 * this.ty) - (b1 * tx1)) / n;\n return this;\n };\n /**\n * Resets this Matrix to an identity (default) matrix.\n *\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n Matrix.prototype.identity = function () {\n this.a = 1;\n this.b = 0;\n this.c = 0;\n this.d = 1;\n this.tx = 0;\n this.ty = 0;\n return this;\n };\n /**\n * Creates a new Matrix object with the same values as this one.\n *\n * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls.\n */\n Matrix.prototype.clone = function () {\n var matrix = new Matrix();\n matrix.a = this.a;\n matrix.b = this.b;\n matrix.c = this.c;\n matrix.d = this.d;\n matrix.tx = this.tx;\n matrix.ty = this.ty;\n return matrix;\n };\n /**\n * Changes the values of the given matrix to be the same as the ones in this matrix\n *\n * @param {PIXI.Matrix} matrix - The matrix to copy to.\n * @return {PIXI.Matrix} The matrix given in parameter with its values updated.\n */\n Matrix.prototype.copyTo = function (matrix) {\n matrix.a = this.a;\n matrix.b = this.b;\n matrix.c = this.c;\n matrix.d = this.d;\n matrix.tx = this.tx;\n matrix.ty = this.ty;\n return matrix;\n };\n /**\n * Changes the values of the matrix to be the same as the ones in given matrix\n *\n * @param {PIXI.Matrix} matrix - The matrix to copy from.\n * @return {PIXI.Matrix} this\n */\n Matrix.prototype.copyFrom = function (matrix) {\n this.a = matrix.a;\n this.b = matrix.b;\n this.c = matrix.c;\n this.d = matrix.d;\n this.tx = matrix.tx;\n this.ty = matrix.ty;\n return this;\n };\n Object.defineProperty(Matrix, \"IDENTITY\", {\n /**\n * A default (identity) matrix\n *\n * @static\n * @const\n * @member {PIXI.Matrix}\n */\n get: function () {\n return new Matrix();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Matrix, \"TEMP_MATRIX\", {\n /**\n * A temp matrix\n *\n * @static\n * @const\n * @member {PIXI.Matrix}\n */\n get: function () {\n return new Matrix();\n },\n enumerable: false,\n configurable: true\n });\n return Matrix;\n}());\n\n// Your friendly neighbour https://en.wikipedia.org/wiki/Dihedral_group\n/*\n * Transform matrix for operation n is:\n * | ux | vx |\n * | uy | vy |\n */\nvar ux = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1];\nvar uy = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1];\nvar vx = [0, -1, -1, -1, 0, 1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1];\nvar vy = [1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, 1, 1, 1, 0, -1];\n/**\n * [Cayley Table]{@link https://en.wikipedia.org/wiki/Cayley_table}\n * for the composition of each rotation in the dihederal group D8.\n *\n * @type number[][]\n * @private\n */\nvar rotationCayley = [];\n/**\n * Matrices for each `GD8Symmetry` rotation.\n *\n * @type Matrix[]\n * @private\n */\nvar rotationMatrices = [];\n/*\n * Alias for {@code Math.sign}.\n */\nvar signum = Math.sign;\n/*\n * Initializes `rotationCayley` and `rotationMatrices`. It is called\n * only once below.\n */\nfunction init() {\n for (var i = 0; i < 16; i++) {\n var row = [];\n rotationCayley.push(row);\n for (var j = 0; j < 16; j++) {\n /* Multiplies rotation matrices i and j. */\n var _ux = signum((ux[i] * ux[j]) + (vx[i] * uy[j]));\n var _uy = signum((uy[i] * ux[j]) + (vy[i] * uy[j]));\n var _vx = signum((ux[i] * vx[j]) + (vx[i] * vy[j]));\n var _vy = signum((uy[i] * vx[j]) + (vy[i] * vy[j]));\n /* Finds rotation matrix matching the product and pushes it. */\n for (var k = 0; k < 16; k++) {\n if (ux[k] === _ux && uy[k] === _uy\n && vx[k] === _vx && vy[k] === _vy) {\n row.push(k);\n break;\n }\n }\n }\n }\n for (var i = 0; i < 16; i++) {\n var mat = new Matrix();\n mat.set(ux[i], uy[i], vx[i], vy[i], 0, 0);\n rotationMatrices.push(mat);\n }\n}\ninit();\n/**\n * @memberof PIXI\n * @typedef {number} GD8Symmetry\n * @see PIXI.groupD8\n */\n/**\n * Implements the dihedral group D8, which is similar to\n * [group D4]{@link http://mathworld.wolfram.com/DihedralGroupD4.html};\n * D8 is the same but with diagonals, and it is used for texture\n * rotations.\n *\n * The directions the U- and V- axes after rotation\n * of an angle of `a: GD8Constant` are the vectors `(uX(a), uY(a))`\n * and `(vX(a), vY(a))`. These aren't necessarily unit vectors.\n *\n * **Origin:**
\n * This is the small part of gameofbombs.com portal system. It works.\n *\n * @see PIXI.groupD8.E\n * @see PIXI.groupD8.SE\n * @see PIXI.groupD8.S\n * @see PIXI.groupD8.SW\n * @see PIXI.groupD8.W\n * @see PIXI.groupD8.NW\n * @see PIXI.groupD8.N\n * @see PIXI.groupD8.NE\n * @author Ivan @ivanpopelyshev\n * @namespace PIXI.groupD8\n * @memberof PIXI\n */\nvar groupD8 = {\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 0° | East |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n E: 0,\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 45°↻ | Southeast |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n SE: 1,\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 90°↻ | South |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n S: 2,\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 135°↻ | Southwest |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n SW: 3,\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 180° | West |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n W: 4,\n /**\n * | Rotation | Direction |\n * |-------------|--------------|\n * | -135°/225°↻ | Northwest |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n NW: 5,\n /**\n * | Rotation | Direction |\n * |-------------|--------------|\n * | -90°/270°↻ | North |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n N: 6,\n /**\n * | Rotation | Direction |\n * |-------------|--------------|\n * | -45°/315°↻ | Northeast |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n NE: 7,\n /**\n * Reflection about Y-axis.\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n MIRROR_VERTICAL: 8,\n /**\n * Reflection about the main diagonal.\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n MAIN_DIAGONAL: 10,\n /**\n * Reflection about X-axis.\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n MIRROR_HORIZONTAL: 12,\n /**\n * Reflection about reverse diagonal.\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n REVERSE_DIAGONAL: 14,\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.\n * @return {PIXI.GD8Symmetry} The X-component of the U-axis\n * after rotating the axes.\n */\n uX: function (ind) { return ux[ind]; },\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.\n * @return {PIXI.GD8Symmetry} The Y-component of the U-axis\n * after rotating the axes.\n */\n uY: function (ind) { return uy[ind]; },\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.\n * @return {PIXI.GD8Symmetry} The X-component of the V-axis\n * after rotating the axes.\n */\n vX: function (ind) { return vx[ind]; },\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.\n * @return {PIXI.GD8Symmetry} The Y-component of the V-axis\n * after rotating the axes.\n */\n vY: function (ind) { return vy[ind]; },\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} rotation - symmetry whose opposite\n * is needed. Only rotations have opposite symmetries while\n * reflections don't.\n * @return {PIXI.GD8Symmetry} The opposite symmetry of `rotation`\n */\n inv: function (rotation) {\n if (rotation & 8) // true only if between 8 & 15 (reflections)\n {\n return rotation & 15; // or rotation % 16\n }\n return (-rotation) & 7; // or (8 - rotation) % 8\n },\n /**\n * Composes the two D8 operations.\n *\n * Taking `^` as reflection:\n *\n * | | E=0 | S=2 | W=4 | N=6 | E^=8 | S^=10 | W^=12 | N^=14 |\n * |-------|-----|-----|-----|-----|------|-------|-------|-------|\n * | E=0 | E | S | W | N | E^ | S^ | W^ | N^ |\n * | S=2 | S | W | N | E | S^ | W^ | N^ | E^ |\n * | W=4 | W | N | E | S | W^ | N^ | E^ | S^ |\n * | N=6 | N | E | S | W | N^ | E^ | S^ | W^ |\n * | E^=8 | E^ | N^ | W^ | S^ | E | N | W | S |\n * | S^=10 | S^ | E^ | N^ | W^ | S | E | N | W |\n * | W^=12 | W^ | S^ | E^ | N^ | W | S | E | N |\n * | N^=14 | N^ | W^ | S^ | E^ | N | W | S | E |\n *\n * [This is a Cayley table]{@link https://en.wikipedia.org/wiki/Cayley_table}\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} rotationSecond - Second operation, which\n * is the row in the above cayley table.\n * @param {PIXI.GD8Symmetry} rotationFirst - First operation, which\n * is the column in the above cayley table.\n * @return {PIXI.GD8Symmetry} Composed operation\n */\n add: function (rotationSecond, rotationFirst) { return (rotationCayley[rotationSecond][rotationFirst]); },\n /**\n * Reverse of `add`.\n *\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} rotationSecond - Second operation\n * @param {PIXI.GD8Symmetry} rotationFirst - First operation\n * @return {PIXI.GD8Symmetry} Result\n */\n sub: function (rotationSecond, rotationFirst) { return (rotationCayley[rotationSecond][groupD8.inv(rotationFirst)]); },\n /**\n * Adds 180 degrees to rotation, which is a commutative\n * operation.\n *\n * @memberof PIXI.groupD8\n * @param {number} rotation - The number to rotate.\n * @returns {number} Rotated number\n */\n rotate180: function (rotation) { return rotation ^ 4; },\n /**\n * Checks if the rotation angle is vertical, i.e. south\n * or north. It doesn't work for reflections.\n *\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} rotation - The number to check.\n * @returns {boolean} Whether or not the direction is vertical\n */\n isVertical: function (rotation) { return (rotation & 3) === 2; },\n /**\n * Approximates the vector `V(dx,dy)` into one of the\n * eight directions provided by `groupD8`.\n *\n * @memberof PIXI.groupD8\n * @param {number} dx - X-component of the vector\n * @param {number} dy - Y-component of the vector\n * @return {PIXI.GD8Symmetry} Approximation of the vector into\n * one of the eight symmetries.\n */\n byDirection: function (dx, dy) {\n if (Math.abs(dx) * 2 <= Math.abs(dy)) {\n if (dy >= 0) {\n return groupD8.S;\n }\n return groupD8.N;\n }\n else if (Math.abs(dy) * 2 <= Math.abs(dx)) {\n if (dx > 0) {\n return groupD8.E;\n }\n return groupD8.W;\n }\n else if (dy > 0) {\n if (dx > 0) {\n return groupD8.SE;\n }\n return groupD8.SW;\n }\n else if (dx > 0) {\n return groupD8.NE;\n }\n return groupD8.NW;\n },\n /**\n * Helps sprite to compensate texture packer rotation.\n *\n * @memberof PIXI.groupD8\n * @param {PIXI.Matrix} matrix - sprite world matrix\n * @param {PIXI.GD8Symmetry} rotation - The rotation factor to use.\n * @param {number} tx - sprite anchoring\n * @param {number} ty - sprite anchoring\n */\n matrixAppendRotationInv: function (matrix, rotation, tx, ty) {\n if (tx === void 0) { tx = 0; }\n if (ty === void 0) { ty = 0; }\n // Packer used \"rotation\", we use \"inv(rotation)\"\n var mat = rotationMatrices[groupD8.inv(rotation)];\n mat.tx = tx;\n mat.ty = ty;\n matrix.append(mat);\n },\n};\n\n/**\n * Transform that takes care about its versions\n *\n * @class\n * @memberof PIXI\n */\nvar Transform = /** @class */ (function () {\n function Transform() {\n /**\n * The world transformation matrix.\n *\n * @member {PIXI.Matrix}\n */\n this.worldTransform = new Matrix();\n /**\n * The local transformation matrix.\n *\n * @member {PIXI.Matrix}\n */\n this.localTransform = new Matrix();\n /**\n * The coordinate of the object relative to the local coordinates of the parent.\n *\n * @member {PIXI.ObservablePoint}\n */\n this.position = new ObservablePoint(this.onChange, this, 0, 0);\n /**\n * The scale factor of the object.\n *\n * @member {PIXI.ObservablePoint}\n */\n this.scale = new ObservablePoint(this.onChange, this, 1, 1);\n /**\n * The pivot point of the displayObject that it rotates around.\n *\n * @member {PIXI.ObservablePoint}\n */\n this.pivot = new ObservablePoint(this.onChange, this, 0, 0);\n /**\n * The skew amount, on the x and y axis.\n *\n * @member {PIXI.ObservablePoint}\n */\n this.skew = new ObservablePoint(this.updateSkew, this, 0, 0);\n /**\n * The rotation amount.\n *\n * @protected\n * @member {number}\n */\n this._rotation = 0;\n /**\n * The X-coordinate value of the normalized local X axis,\n * the first column of the local transformation matrix without a scale.\n *\n * @protected\n * @member {number}\n */\n this._cx = 1;\n /**\n * The Y-coordinate value of the normalized local X axis,\n * the first column of the local transformation matrix without a scale.\n *\n * @protected\n * @member {number}\n */\n this._sx = 0;\n /**\n * The X-coordinate value of the normalized local Y axis,\n * the second column of the local transformation matrix without a scale.\n *\n * @protected\n * @member {number}\n */\n this._cy = 0;\n /**\n * The Y-coordinate value of the normalized local Y axis,\n * the second column of the local transformation matrix without a scale.\n *\n * @protected\n * @member {number}\n */\n this._sy = 1;\n /**\n * The locally unique ID of the local transform.\n *\n * @protected\n * @member {number}\n */\n this._localID = 0;\n /**\n * The locally unique ID of the local transform\n * used to calculate the current local transformation matrix.\n *\n * @protected\n * @member {number}\n */\n this._currentLocalID = 0;\n /**\n * The locally unique ID of the world transform.\n *\n * @protected\n * @member {number}\n */\n this._worldID = 0;\n /**\n * The locally unique ID of the parent's world transform\n * used to calculate the current world transformation matrix.\n *\n * @protected\n * @member {number}\n */\n this._parentID = 0;\n }\n /**\n * Called when a value changes.\n *\n * @protected\n */\n Transform.prototype.onChange = function () {\n this._localID++;\n };\n /**\n * Called when the skew or the rotation changes.\n *\n * @protected\n */\n Transform.prototype.updateSkew = function () {\n this._cx = Math.cos(this._rotation + this.skew.y);\n this._sx = Math.sin(this._rotation + this.skew.y);\n this._cy = -Math.sin(this._rotation - this.skew.x); // cos, added PI/2\n this._sy = Math.cos(this._rotation - this.skew.x); // sin, added PI/2\n this._localID++;\n };\n /**\n * Updates the local transformation matrix.\n */\n Transform.prototype.updateLocalTransform = function () {\n var lt = this.localTransform;\n if (this._localID !== this._currentLocalID) {\n // get the matrix values of the displayobject based on its transform properties..\n lt.a = this._cx * this.scale.x;\n lt.b = this._sx * this.scale.x;\n lt.c = this._cy * this.scale.y;\n lt.d = this._sy * this.scale.y;\n lt.tx = this.position.x - ((this.pivot.x * lt.a) + (this.pivot.y * lt.c));\n lt.ty = this.position.y - ((this.pivot.x * lt.b) + (this.pivot.y * lt.d));\n this._currentLocalID = this._localID;\n // force an update..\n this._parentID = -1;\n }\n };\n /**\n * Updates the local and the world transformation matrices.\n *\n * @param {PIXI.Transform} parentTransform - The parent transform\n */\n Transform.prototype.updateTransform = function (parentTransform) {\n var lt = this.localTransform;\n if (this._localID !== this._currentLocalID) {\n // get the matrix values of the displayobject based on its transform properties..\n lt.a = this._cx * this.scale.x;\n lt.b = this._sx * this.scale.x;\n lt.c = this._cy * this.scale.y;\n lt.d = this._sy * this.scale.y;\n lt.tx = this.position.x - ((this.pivot.x * lt.a) + (this.pivot.y * lt.c));\n lt.ty = this.position.y - ((this.pivot.x * lt.b) + (this.pivot.y * lt.d));\n this._currentLocalID = this._localID;\n // force an update..\n this._parentID = -1;\n }\n if (this._parentID !== parentTransform._worldID) {\n // concat the parent matrix with the objects transform.\n var pt = parentTransform.worldTransform;\n var wt = this.worldTransform;\n wt.a = (lt.a * pt.a) + (lt.b * pt.c);\n wt.b = (lt.a * pt.b) + (lt.b * pt.d);\n wt.c = (lt.c * pt.a) + (lt.d * pt.c);\n wt.d = (lt.c * pt.b) + (lt.d * pt.d);\n wt.tx = (lt.tx * pt.a) + (lt.ty * pt.c) + pt.tx;\n wt.ty = (lt.tx * pt.b) + (lt.ty * pt.d) + pt.ty;\n this._parentID = parentTransform._worldID;\n // update the id of the transform..\n this._worldID++;\n }\n };\n /**\n * Decomposes a matrix and sets the transforms properties based on it.\n *\n * @param {PIXI.Matrix} matrix - The matrix to decompose\n */\n Transform.prototype.setFromMatrix = function (matrix) {\n matrix.decompose(this);\n this._localID++;\n };\n Object.defineProperty(Transform.prototype, \"rotation\", {\n /**\n * The rotation of the object in radians.\n *\n * @member {number}\n */\n get: function () {\n return this._rotation;\n },\n set: function (value) {\n if (this._rotation !== value) {\n this._rotation = value;\n this.updateSkew();\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * A default (identity) transform\n *\n * @static\n * @constant\n * @member {PIXI.Transform}\n */\n Transform.IDENTITY = new Transform();\n return Transform;\n}());\n\n/**\n * Math classes and utilities mixed into PIXI namespace.\n *\n * @lends PIXI\n */\n\nexport { Circle, DEG_TO_RAD, Ellipse, Matrix, ObservablePoint, PI_2, Point, Polygon, RAD_TO_DEG, Rectangle, RoundedRectangle, SHAPES, Transform, groupD8 };\n//# sourceMappingURL=math.es.js.map\n","var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nvar MiniSignalBinding = (function () {\n function MiniSignalBinding(fn, once, thisArg) {\n if (once === undefined) once = false;\n\n _classCallCheck(this, MiniSignalBinding);\n\n this._fn = fn;\n this._once = once;\n this._thisArg = thisArg;\n this._next = this._prev = this._owner = null;\n }\n\n _createClass(MiniSignalBinding, [{\n key: 'detach',\n value: function detach() {\n if (this._owner === null) return false;\n this._owner.detach(this);\n return true;\n }\n }]);\n\n return MiniSignalBinding;\n})();\n\nfunction _addMiniSignalBinding(self, node) {\n if (!self._head) {\n self._head = node;\n self._tail = node;\n } else {\n self._tail._next = node;\n node._prev = self._tail;\n self._tail = node;\n }\n\n node._owner = self;\n\n return node;\n}\n\nvar MiniSignal = (function () {\n function MiniSignal() {\n _classCallCheck(this, MiniSignal);\n\n this._head = this._tail = undefined;\n }\n\n _createClass(MiniSignal, [{\n key: 'handlers',\n value: function handlers() {\n var exists = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0];\n\n var node = this._head;\n\n if (exists) return !!node;\n\n var ee = [];\n\n while (node) {\n ee.push(node);\n node = node._next;\n }\n\n return ee;\n }\n }, {\n key: 'has',\n value: function has(node) {\n if (!(node instanceof MiniSignalBinding)) {\n throw new Error('MiniSignal#has(): First arg must be a MiniSignalBinding object.');\n }\n\n return node._owner === this;\n }\n }, {\n key: 'dispatch',\n value: function dispatch() {\n var node = this._head;\n\n if (!node) return false;\n\n while (node) {\n if (node._once) this.detach(node);\n node._fn.apply(node._thisArg, arguments);\n node = node._next;\n }\n\n return true;\n }\n }, {\n key: 'add',\n value: function add(fn) {\n var thisArg = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];\n\n if (typeof fn !== 'function') {\n throw new Error('MiniSignal#add(): First arg must be a Function.');\n }\n return _addMiniSignalBinding(this, new MiniSignalBinding(fn, false, thisArg));\n }\n }, {\n key: 'once',\n value: function once(fn) {\n var thisArg = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];\n\n if (typeof fn !== 'function') {\n throw new Error('MiniSignal#once(): First arg must be a Function.');\n }\n return _addMiniSignalBinding(this, new MiniSignalBinding(fn, true, thisArg));\n }\n }, {\n key: 'detach',\n value: function detach(node) {\n if (!(node instanceof MiniSignalBinding)) {\n throw new Error('MiniSignal#detach(): First arg must be a MiniSignalBinding object.');\n }\n if (node._owner !== this) return this;\n\n if (node._prev) node._prev._next = node._next;\n if (node._next) node._next._prev = node._prev;\n\n if (node === this._head) {\n this._head = node._next;\n if (node._next === null) {\n this._tail = null;\n }\n } else if (node === this._tail) {\n this._tail = node._prev;\n this._tail._next = null;\n }\n\n node._owner = null;\n return this;\n }\n }, {\n key: 'detachAll',\n value: function detachAll() {\n var node = this._head;\n if (!node) return this;\n\n this._head = this._tail = null;\n\n while (node) {\n node._owner = null;\n node = node._next;\n }\n return this;\n }\n }]);\n\n return MiniSignal;\n})();\n\nMiniSignal.MiniSignalBinding = MiniSignalBinding;\n\nexports['default'] = MiniSignal;\nmodule.exports = exports['default'];\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var baseProperty = require('./_baseProperty'),\n basePropertyDeep = require('./_basePropertyDeep'),\n isKey = require('./_isKey'),\n toKey = require('./_toKey');\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = property;\n","/**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseIndexOfWith;\n","var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n","var baseIsMatch = require('./_baseIsMatch'),\n getMatchData = require('./_getMatchData'),\n matchesStrictComparable = require('./_matchesStrictComparable');\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nmodule.exports = baseMatches;\n","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar stringifyPrimitive = function(v) {\n switch (typeof v) {\n case 'string':\n return v;\n\n case 'boolean':\n return v ? 'true' : 'false';\n\n case 'number':\n return isFinite(v) ? v : '';\n\n default:\n return '';\n }\n};\n\nmodule.exports = function(obj, sep, eq, name) {\n sep = sep || '&';\n eq = eq || '=';\n if (obj === null) {\n obj = undefined;\n }\n\n if (typeof obj === 'object') {\n return map(objectKeys(obj), function(k) {\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n if (isArray(obj[k])) {\n return map(obj[k], function(v) {\n return ks + encodeURIComponent(stringifyPrimitive(v));\n }).join(sep);\n } else {\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n }\n }).join(sep);\n\n }\n\n if (!name) return '';\n return encodeURIComponent(stringifyPrimitive(name)) + eq +\n encodeURIComponent(stringifyPrimitive(obj));\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\nfunction map (xs, f) {\n if (xs.map) return xs.map(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n res.push(f(xs[i], i));\n }\n return res;\n}\n\nvar objectKeys = Object.keys || function (obj) {\n var res = [];\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);\n }\n return res;\n};\n","/*!\n * @pixi/ticker - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/ticker is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { settings } from '@pixi/settings';\n\n/**\n * Target frames per millisecond.\n *\n * @static\n * @name TARGET_FPMS\n * @memberof PIXI.settings\n * @type {number}\n * @default 0.06\n */\nsettings.TARGET_FPMS = 0.06;\n\n/**\n * Represents the update priorities used by internal PIXI classes when registered with\n * the {@link PIXI.Ticker} object. Higher priority items are updated first and lower\n * priority items, such as render, should go later.\n *\n * @static\n * @constant\n * @name UPDATE_PRIORITY\n * @memberof PIXI\n * @enum {number}\n * @property {number} INTERACTION=50 Highest priority, used for {@link PIXI.InteractionManager}\n * @property {number} HIGH=25 High priority updating, {@link PIXI.VideoBaseTexture} and {@link PIXI.AnimatedSprite}\n * @property {number} NORMAL=0 Default priority for ticker events, see {@link PIXI.Ticker#add}.\n * @property {number} LOW=-25 Low priority used for {@link PIXI.Application} rendering.\n * @property {number} UTILITY=-50 Lowest priority used for {@link PIXI.BasePrepare} utility.\n */\nvar UPDATE_PRIORITY;\n(function (UPDATE_PRIORITY) {\n UPDATE_PRIORITY[UPDATE_PRIORITY[\"INTERACTION\"] = 50] = \"INTERACTION\";\n UPDATE_PRIORITY[UPDATE_PRIORITY[\"HIGH\"] = 25] = \"HIGH\";\n UPDATE_PRIORITY[UPDATE_PRIORITY[\"NORMAL\"] = 0] = \"NORMAL\";\n UPDATE_PRIORITY[UPDATE_PRIORITY[\"LOW\"] = -25] = \"LOW\";\n UPDATE_PRIORITY[UPDATE_PRIORITY[\"UTILITY\"] = -50] = \"UTILITY\";\n})(UPDATE_PRIORITY || (UPDATE_PRIORITY = {}));\n\n/**\n * Internal class for handling the priority sorting of ticker handlers.\n *\n * @private\n * @class\n * @memberof PIXI\n */\nvar TickerListener = /** @class */ (function () {\n /**\n * Constructor\n * @private\n * @param {Function} fn - The listener function to be added for one update\n * @param {*} [context=null] - The listener context\n * @param {number} [priority=0] - The priority for emitting\n * @param {boolean} [once=false] - If the handler should fire once\n */\n function TickerListener(fn, context, priority, once) {\n if (context === void 0) { context = null; }\n if (priority === void 0) { priority = 0; }\n if (once === void 0) { once = false; }\n /**\n * The handler function to execute.\n * @private\n * @member {Function}\n */\n this.fn = fn;\n /**\n * The calling to execute.\n * @private\n * @member {*}\n */\n this.context = context;\n /**\n * The current priority.\n * @private\n * @member {number}\n */\n this.priority = priority;\n /**\n * If this should only execute once.\n * @private\n * @member {boolean}\n */\n this.once = once;\n /**\n * The next item in chain.\n * @private\n * @member {TickerListener}\n */\n this.next = null;\n /**\n * The previous item in chain.\n * @private\n * @member {TickerListener}\n */\n this.previous = null;\n /**\n * `true` if this listener has been destroyed already.\n * @member {boolean}\n * @private\n */\n this._destroyed = false;\n }\n /**\n * Simple compare function to figure out if a function and context match.\n * @private\n * @param {Function} fn - The listener function to be added for one update\n * @param {any} [context] - The listener context\n * @return {boolean} `true` if the listener match the arguments\n */\n TickerListener.prototype.match = function (fn, context) {\n if (context === void 0) { context = null; }\n return this.fn === fn && this.context === context;\n };\n /**\n * Emit by calling the current function.\n * @private\n * @param {number} deltaTime - time since the last emit.\n * @return {TickerListener} Next ticker\n */\n TickerListener.prototype.emit = function (deltaTime) {\n if (this.fn) {\n if (this.context) {\n this.fn.call(this.context, deltaTime);\n }\n else {\n this.fn(deltaTime);\n }\n }\n var redirect = this.next;\n if (this.once) {\n this.destroy(true);\n }\n // Soft-destroying should remove\n // the next reference\n if (this._destroyed) {\n this.next = null;\n }\n return redirect;\n };\n /**\n * Connect to the list.\n * @private\n * @param {TickerListener} previous - Input node, previous listener\n */\n TickerListener.prototype.connect = function (previous) {\n this.previous = previous;\n if (previous.next) {\n previous.next.previous = this;\n }\n this.next = previous.next;\n previous.next = this;\n };\n /**\n * Destroy and don't use after this.\n * @private\n * @param {boolean} [hard = false] `true` to remove the `next` reference, this\n * is considered a hard destroy. Soft destroy maintains the next reference.\n * @return {TickerListener} The listener to redirect while emitting or removing.\n */\n TickerListener.prototype.destroy = function (hard) {\n if (hard === void 0) { hard = false; }\n this._destroyed = true;\n this.fn = null;\n this.context = null;\n // Disconnect, hook up next and previous\n if (this.previous) {\n this.previous.next = this.next;\n }\n if (this.next) {\n this.next.previous = this.previous;\n }\n // Redirect to the next item\n var redirect = this.next;\n // Remove references\n this.next = hard ? null : redirect;\n this.previous = null;\n return redirect;\n };\n return TickerListener;\n}());\n\n/**\n * A Ticker class that runs an update loop that other objects listen to.\n *\n * This class is composed around listeners meant for execution on the next requested animation frame.\n * Animation frames are requested only when necessary, e.g. When the ticker is started and the emitter has listeners.\n *\n * @class\n * @memberof PIXI\n */\nvar Ticker = /** @class */ (function () {\n function Ticker() {\n var _this = this;\n /**\n * The first listener. All new listeners added are chained on this.\n * @private\n * @type {TickerListener}\n */\n this._head = new TickerListener(null, null, Infinity);\n /**\n * Internal current frame request ID\n * @type {?number}\n * @private\n */\n this._requestId = null;\n /**\n * Internal value managed by minFPS property setter and getter.\n * This is the maximum allowed milliseconds between updates.\n * @type {number}\n * @private\n */\n this._maxElapsedMS = 100;\n /**\n * Internal value managed by maxFPS property setter and getter.\n * This is the minimum allowed milliseconds between updates.\n * @type {number}\n * @private\n */\n this._minElapsedMS = 0;\n /**\n * Whether or not this ticker should invoke the method\n * {@link PIXI.Ticker#start} automatically\n * when a listener is added.\n *\n * @member {boolean}\n * @default false\n */\n this.autoStart = false;\n /**\n * Scalar time value from last frame to this frame.\n * This value is capped by setting {@link PIXI.Ticker#minFPS}\n * and is scaled with {@link PIXI.Ticker#speed}.\n * **Note:** The cap may be exceeded by scaling.\n *\n * @member {number}\n * @default 1\n */\n this.deltaTime = 1;\n /**\n * Scaler time elapsed in milliseconds from last frame to this frame.\n * This value is capped by setting {@link PIXI.Ticker#minFPS}\n * and is scaled with {@link PIXI.Ticker#speed}.\n * **Note:** The cap may be exceeded by scaling.\n * If the platform supports DOMHighResTimeStamp,\n * this value will have a precision of 1 µs.\n * Defaults to target frame time\n *\n * @member {number}\n * @default 16.66\n */\n this.deltaMS = 1 / settings.TARGET_FPMS;\n /**\n * Time elapsed in milliseconds from last frame to this frame.\n * Opposed to what the scalar {@link PIXI.Ticker#deltaTime}\n * is based, this value is neither capped nor scaled.\n * If the platform supports DOMHighResTimeStamp,\n * this value will have a precision of 1 µs.\n * Defaults to target frame time\n *\n * @member {number}\n * @default 16.66\n */\n this.elapsedMS = 1 / settings.TARGET_FPMS;\n /**\n * The last time {@link PIXI.Ticker#update} was invoked.\n * This value is also reset internally outside of invoking\n * update, but only when a new animation frame is requested.\n * If the platform supports DOMHighResTimeStamp,\n * this value will have a precision of 1 µs.\n *\n * @member {number}\n * @default -1\n */\n this.lastTime = -1;\n /**\n * Factor of current {@link PIXI.Ticker#deltaTime}.\n * @example\n * // Scales ticker.deltaTime to what would be\n * // the equivalent of approximately 120 FPS\n * ticker.speed = 2;\n *\n * @member {number}\n * @default 1\n */\n this.speed = 1;\n /**\n * Whether or not this ticker has been started.\n * `true` if {@link PIXI.Ticker#start} has been called.\n * `false` if {@link PIXI.Ticker#stop} has been called.\n * While `false`, this value may change to `true` in the\n * event of {@link PIXI.Ticker#autoStart} being `true`\n * and a listener is added.\n *\n * @member {boolean}\n * @default false\n */\n this.started = false;\n /**\n * If enabled, deleting is disabled.\n * @member {boolean}\n * @default false\n * @private\n */\n this._protected = false;\n /**\n * The last time keyframe was executed.\n * Maintains a relatively fixed interval with the previous value.\n * @member {number}\n * @default -1\n * @private\n */\n this._lastFrame = -1;\n /**\n * Internal tick method bound to ticker instance.\n * This is because in early 2015, Function.bind\n * is still 60% slower in high performance scenarios.\n * Also separating frame requests from update method\n * so listeners may be called at any time and with\n * any animation API, just invoke ticker.update(time).\n *\n * @private\n * @param {number} time - Time since last tick.\n */\n this._tick = function (time) {\n _this._requestId = null;\n if (_this.started) {\n // Invoke listeners now\n _this.update(time);\n // Listener side effects may have modified ticker state.\n if (_this.started && _this._requestId === null && _this._head.next) {\n _this._requestId = requestAnimationFrame(_this._tick);\n }\n }\n };\n }\n /**\n * Conditionally requests a new animation frame.\n * If a frame has not already been requested, and if the internal\n * emitter has listeners, a new frame is requested.\n *\n * @private\n */\n Ticker.prototype._requestIfNeeded = function () {\n if (this._requestId === null && this._head.next) {\n // ensure callbacks get correct delta\n this.lastTime = performance.now();\n this._lastFrame = this.lastTime;\n this._requestId = requestAnimationFrame(this._tick);\n }\n };\n /**\n * Conditionally cancels a pending animation frame.\n *\n * @private\n */\n Ticker.prototype._cancelIfNeeded = function () {\n if (this._requestId !== null) {\n cancelAnimationFrame(this._requestId);\n this._requestId = null;\n }\n };\n /**\n * Conditionally requests a new animation frame.\n * If the ticker has been started it checks if a frame has not already\n * been requested, and if the internal emitter has listeners. If these\n * conditions are met, a new frame is requested. If the ticker has not\n * been started, but autoStart is `true`, then the ticker starts now,\n * and continues with the previous conditions to request a new frame.\n *\n * @private\n */\n Ticker.prototype._startIfPossible = function () {\n if (this.started) {\n this._requestIfNeeded();\n }\n else if (this.autoStart) {\n this.start();\n }\n };\n /**\n * Register a handler for tick events. Calls continuously unless\n * it is removed or the ticker is stopped.\n *\n * @param {Function} fn - The listener function to be added for updates\n * @param {*} [context] - The listener context\n * @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting\n * @returns {PIXI.Ticker} This instance of a ticker\n */\n Ticker.prototype.add = function (fn, context, priority) {\n if (priority === void 0) { priority = UPDATE_PRIORITY.NORMAL; }\n return this._addListener(new TickerListener(fn, context, priority));\n };\n /**\n * Add a handler for the tick event which is only execute once.\n *\n * @param {Function} fn - The listener function to be added for one update\n * @param {*} [context] - The listener context\n * @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting\n * @returns {PIXI.Ticker} This instance of a ticker\n */\n Ticker.prototype.addOnce = function (fn, context, priority) {\n if (priority === void 0) { priority = UPDATE_PRIORITY.NORMAL; }\n return this._addListener(new TickerListener(fn, context, priority, true));\n };\n /**\n * Internally adds the event handler so that it can be sorted by priority.\n * Priority allows certain handler (user, AnimatedSprite, Interaction) to be run\n * before the rendering.\n *\n * @private\n * @param {TickerListener} listener - Current listener being added.\n * @returns {PIXI.Ticker} This instance of a ticker\n */\n Ticker.prototype._addListener = function (listener) {\n // For attaching to head\n var current = this._head.next;\n var previous = this._head;\n // Add the first item\n if (!current) {\n listener.connect(previous);\n }\n else {\n // Go from highest to lowest priority\n while (current) {\n if (listener.priority > current.priority) {\n listener.connect(previous);\n break;\n }\n previous = current;\n current = current.next;\n }\n // Not yet connected\n if (!listener.previous) {\n listener.connect(previous);\n }\n }\n this._startIfPossible();\n return this;\n };\n /**\n * Removes any handlers matching the function and context parameters.\n * If no handlers are left after removing, then it cancels the animation frame.\n *\n * @param {Function} fn - The listener function to be removed\n * @param {*} [context] - The listener context to be removed\n * @returns {PIXI.Ticker} This instance of a ticker\n */\n Ticker.prototype.remove = function (fn, context) {\n var listener = this._head.next;\n while (listener) {\n // We found a match, lets remove it\n // no break to delete all possible matches\n // incase a listener was added 2+ times\n if (listener.match(fn, context)) {\n listener = listener.destroy();\n }\n else {\n listener = listener.next;\n }\n }\n if (!this._head.next) {\n this._cancelIfNeeded();\n }\n return this;\n };\n Object.defineProperty(Ticker.prototype, \"count\", {\n /**\n * The number of listeners on this ticker, calculated by walking through linked list\n *\n * @readonly\n * @member {number}\n */\n get: function () {\n if (!this._head) {\n return 0;\n }\n var count = 0;\n var current = this._head;\n while ((current = current.next)) {\n count++;\n }\n return count;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Starts the ticker. If the ticker has listeners\n * a new animation frame is requested at this point.\n */\n Ticker.prototype.start = function () {\n if (!this.started) {\n this.started = true;\n this._requestIfNeeded();\n }\n };\n /**\n * Stops the ticker. If the ticker has requested\n * an animation frame it is canceled at this point.\n */\n Ticker.prototype.stop = function () {\n if (this.started) {\n this.started = false;\n this._cancelIfNeeded();\n }\n };\n /**\n * Destroy the ticker and don't use after this. Calling\n * this method removes all references to internal events.\n */\n Ticker.prototype.destroy = function () {\n if (!this._protected) {\n this.stop();\n var listener = this._head.next;\n while (listener) {\n listener = listener.destroy(true);\n }\n this._head.destroy();\n this._head = null;\n }\n };\n /**\n * Triggers an update. An update entails setting the\n * current {@link PIXI.Ticker#elapsedMS},\n * the current {@link PIXI.Ticker#deltaTime},\n * invoking all listeners with current deltaTime,\n * and then finally setting {@link PIXI.Ticker#lastTime}\n * with the value of currentTime that was provided.\n * This method will be called automatically by animation\n * frame callbacks if the ticker instance has been started\n * and listeners are added.\n *\n * @param {number} [currentTime=performance.now()] - the current time of execution\n */\n Ticker.prototype.update = function (currentTime) {\n if (currentTime === void 0) { currentTime = performance.now(); }\n var elapsedMS;\n // If the difference in time is zero or negative, we ignore most of the work done here.\n // If there is no valid difference, then should be no reason to let anyone know about it.\n // A zero delta, is exactly that, nothing should update.\n //\n // The difference in time can be negative, and no this does not mean time traveling.\n // This can be the result of a race condition between when an animation frame is requested\n // on the current JavaScript engine event loop, and when the ticker's start method is invoked\n // (which invokes the internal _requestIfNeeded method). If a frame is requested before\n // _requestIfNeeded is invoked, then the callback for the animation frame the ticker requests,\n // can receive a time argument that can be less than the lastTime value that was set within\n // _requestIfNeeded. This difference is in microseconds, but this is enough to cause problems.\n //\n // This check covers this browser engine timing issue, as well as if consumers pass an invalid\n // currentTime value. This may happen if consumers opt-out of the autoStart, and update themselves.\n if (currentTime > this.lastTime) {\n // Save uncapped elapsedMS for measurement\n elapsedMS = this.elapsedMS = currentTime - this.lastTime;\n // cap the milliseconds elapsed used for deltaTime\n if (elapsedMS > this._maxElapsedMS) {\n elapsedMS = this._maxElapsedMS;\n }\n elapsedMS *= this.speed;\n // If not enough time has passed, exit the function.\n // Get ready for next frame by setting _lastFrame, but based on _minElapsedMS\n // adjustment to ensure a relatively stable interval.\n if (this._minElapsedMS) {\n var delta = currentTime - this._lastFrame | 0;\n if (delta < this._minElapsedMS) {\n return;\n }\n this._lastFrame = currentTime - (delta % this._minElapsedMS);\n }\n this.deltaMS = elapsedMS;\n this.deltaTime = this.deltaMS * settings.TARGET_FPMS;\n // Cache a local reference, in-case ticker is destroyed\n // during the emit, we can still check for head.next\n var head = this._head;\n // Invoke listeners added to internal emitter\n var listener = head.next;\n while (listener) {\n listener = listener.emit(this.deltaTime);\n }\n if (!head.next) {\n this._cancelIfNeeded();\n }\n }\n else {\n this.deltaTime = this.deltaMS = this.elapsedMS = 0;\n }\n this.lastTime = currentTime;\n };\n Object.defineProperty(Ticker.prototype, \"FPS\", {\n /**\n * The frames per second at which this ticker is running.\n * The default is approximately 60 in most modern browsers.\n * **Note:** This does not factor in the value of\n * {@link PIXI.Ticker#speed}, which is specific\n * to scaling {@link PIXI.Ticker#deltaTime}.\n *\n * @member {number}\n * @readonly\n */\n get: function () {\n return 1000 / this.elapsedMS;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Ticker.prototype, \"minFPS\", {\n /**\n * Manages the maximum amount of milliseconds allowed to\n * elapse between invoking {@link PIXI.Ticker#update}.\n * This value is used to cap {@link PIXI.Ticker#deltaTime},\n * but does not effect the measured value of {@link PIXI.Ticker#FPS}.\n * When setting this property it is clamped to a value between\n * `0` and `PIXI.settings.TARGET_FPMS * 1000`.\n *\n * @member {number}\n * @default 10\n */\n get: function () {\n return 1000 / this._maxElapsedMS;\n },\n set: function (fps) {\n // Minimum must be below the maxFPS\n var minFPS = Math.min(this.maxFPS, fps);\n // Must be at least 0, but below 1 / settings.TARGET_FPMS\n var minFPMS = Math.min(Math.max(0, minFPS) / 1000, settings.TARGET_FPMS);\n this._maxElapsedMS = 1 / minFPMS;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Ticker.prototype, \"maxFPS\", {\n /**\n * Manages the minimum amount of milliseconds required to\n * elapse between invoking {@link PIXI.Ticker#update}.\n * This will effect the measured value of {@link PIXI.Ticker#FPS}.\n * If it is set to `0`, then there is no limit; PixiJS will render as many frames as it can.\n * Otherwise it will be at least `minFPS`\n *\n * @member {number}\n * @default 0\n */\n get: function () {\n if (this._minElapsedMS) {\n return Math.round(1000 / this._minElapsedMS);\n }\n return 0;\n },\n set: function (fps) {\n if (fps === 0) {\n this._minElapsedMS = 0;\n }\n else {\n // Max must be at least the minFPS\n var maxFPS = Math.max(this.minFPS, fps);\n this._minElapsedMS = 1 / (maxFPS / 1000);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Ticker, \"shared\", {\n /**\n * The shared ticker instance used by {@link PIXI.AnimatedSprite} and by\n * {@link PIXI.VideoResource} to update animation frames / video textures.\n *\n * It may also be used by {@link PIXI.Application} if created with the `sharedTicker` option property set to true.\n *\n * The property {@link PIXI.Ticker#autoStart} is set to `true` for this instance.\n * Please follow the examples for usage, including how to opt-out of auto-starting the shared ticker.\n *\n * @example\n * let ticker = PIXI.Ticker.shared;\n * // Set this to prevent starting this ticker when listeners are added.\n * // By default this is true only for the PIXI.Ticker.shared instance.\n * ticker.autoStart = false;\n * // FYI, call this to ensure the ticker is stopped. It should be stopped\n * // if you have not attempted to render anything yet.\n * ticker.stop();\n * // Call this when you are ready for a running shared ticker.\n * ticker.start();\n *\n * @example\n * // You may use the shared ticker to render...\n * let renderer = PIXI.autoDetectRenderer();\n * let stage = new PIXI.Container();\n * document.body.appendChild(renderer.view);\n * ticker.add(function (time) {\n * renderer.render(stage);\n * });\n *\n * @example\n * // Or you can just update it manually.\n * ticker.autoStart = false;\n * ticker.stop();\n * function animate(time) {\n * ticker.update(time);\n * renderer.render(stage);\n * requestAnimationFrame(animate);\n * }\n * animate(performance.now());\n *\n * @member {PIXI.Ticker}\n * @static\n */\n get: function () {\n if (!Ticker._shared) {\n var shared = Ticker._shared = new Ticker();\n shared.autoStart = true;\n shared._protected = true;\n }\n return Ticker._shared;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Ticker, \"system\", {\n /**\n * The system ticker instance used by {@link PIXI.InteractionManager} and by\n * {@link PIXI.BasePrepare} for core timing functionality that shouldn't usually need to be paused,\n * unlike the `shared` ticker which drives visual animations and rendering which may want to be paused.\n *\n * The property {@link PIXI.Ticker#autoStart} is set to `true` for this instance.\n *\n * @member {PIXI.Ticker}\n * @static\n */\n get: function () {\n if (!Ticker._system) {\n var system = Ticker._system = new Ticker();\n system.autoStart = true;\n system._protected = true;\n }\n return Ticker._system;\n },\n enumerable: false,\n configurable: true\n });\n return Ticker;\n}());\n\n/**\n * Middleware for for Application Ticker.\n *\n * @example\n * import {TickerPlugin} from '@pixi/ticker';\n * import {Application} from '@pixi/app';\n * Application.registerPlugin(TickerPlugin);\n *\n * @class\n * @memberof PIXI\n */\nvar TickerPlugin = /** @class */ (function () {\n function TickerPlugin() {\n }\n /**\n * Initialize the plugin with scope of application instance\n *\n * @static\n * @private\n * @param {object} [options] - See application options\n */\n TickerPlugin.init = function (options) {\n var _this = this;\n // Set default\n options = Object.assign({\n autoStart: true,\n sharedTicker: false,\n }, options);\n // Create ticker setter\n Object.defineProperty(this, 'ticker', {\n set: function (ticker) {\n if (this._ticker) {\n this._ticker.remove(this.render, this);\n }\n this._ticker = ticker;\n if (ticker) {\n ticker.add(this.render, this, UPDATE_PRIORITY.LOW);\n }\n },\n get: function () {\n return this._ticker;\n },\n });\n /**\n * Convenience method for stopping the render.\n *\n * @method PIXI.Application#stop\n */\n this.stop = function () {\n _this._ticker.stop();\n };\n /**\n * Convenience method for starting the render.\n *\n * @method PIXI.Application#start\n */\n this.start = function () {\n _this._ticker.start();\n };\n /**\n * Internal reference to the ticker.\n *\n * @type {PIXI.Ticker}\n * @name _ticker\n * @memberof PIXI.Application#\n * @private\n */\n this._ticker = null;\n /**\n * Ticker for doing render updates.\n *\n * @type {PIXI.Ticker}\n * @name ticker\n * @memberof PIXI.Application#\n * @default PIXI.Ticker.shared\n */\n this.ticker = options.sharedTicker ? Ticker.shared : new Ticker();\n // Start the rendering\n if (options.autoStart) {\n this.start();\n }\n };\n /**\n * Clean up the ticker, scoped to application.\n *\n * @static\n * @private\n */\n TickerPlugin.destroy = function () {\n if (this._ticker) {\n var oldTicker = this._ticker;\n this.ticker = null;\n oldTicker.destroy();\n }\n };\n return TickerPlugin;\n}());\n\nexport { Ticker, TickerPlugin, UPDATE_PRIORITY };\n//# sourceMappingURL=ticker.es.js.map\n","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nmodule.exports = mapToArray;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var castPath = require('./_castPath'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isIndex = require('./_isIndex'),\n isLength = require('./isLength'),\n toKey = require('./_toKey');\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nmodule.exports = hasPath;\n","/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = strictIndexOf;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/client/dist/js/Live2d.04fa9e3d.js b/client/dist/js/Live2d.7fa92c30.js similarity index 97% rename from client/dist/js/Live2d.04fa9e3d.js rename to client/dist/js/Live2d.7fa92c30.js index aff04b6..5ad270e 100644 --- a/client/dist/js/Live2d.04fa9e3d.js +++ b/client/dist/js/Live2d.7fa92c30.js @@ -1,9 +1,9 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["Live2d"],{"00b7":function(t,e,r){var i=r("0a2d"),n=r("5543"),o=Object.prototype,s=o.propertyIsEnumerable,a=Object.getOwnPropertySymbols,u=a?function(t){return null==t?[]:(t=Object(t),i(a(t),(function(e){return s.call(t,e)})))}:n;t.exports=u},"0510":function(t,e){var r=800,i=16,n=Date.now;function o(t){var e=0,o=0;return function(){var s=n(),a=i-(s-o);if(o=s,a>0){if(++e>=r)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}t.exports=o},"0758":function(t,e,r){var i=r("28f4"),n=i["__core-js_shared__"];t.exports=n},"08bb":function(t,e,r){var i=r("d032");function n(){this.__data__=i?i(null):{},this.size=0}t.exports=n},"09492":function(t,e,r){(function(e,i){t.exports=i(r("aa81"),r("d3fc"),r("c29d"),r("21bf"),r("9ac0"),r("733a"))})(window,(function(t,e,r,i,n,o){return function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=27)}([function(t,e,r){"use strict";r.d(e,"f",(function(){return i})),r.d(e,"b",(function(){return o})),r.d(e,"g",(function(){return s})),r.d(e,"d",(function(){return a})),r.d(e,"c",(function(){return u})),r.d(e,"a",(function(){return h})),r.d(e,"e",(function(){return l}));var i,n=r(1);function o(t,e,r){return tr?r:t}function s(t,e){return Math.random()*(e-t)+t}function a(t,e,r,i,n){const o=e[i];null!==o&&typeof o===t&&(r[n]=o)}function u(t,e,r,i,n){const o=e[i];Array.isArray(o)&&(r[n]=o.filter(e=>null!==e&&typeof e===t))}function h(t,e){e.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(r=>{"constructor"!==r&&Object.defineProperty(t.prototype,r,Object.getOwnPropertyDescriptor(e.prototype,r))})})}function l(t){let e=t.lastIndexOf("/");return-1!=e&&(t=t.slice(0,e)),e=t.lastIndexOf("/"),-1!==e&&(t=t.slice(e+1)),t}(function(t){function e(t,...e){n["b"].logLevel<=n["b"].LOG_LEVEL_VERBOSE&&console.log(`[${t}]`,...e)}function r(t,...e){n["b"].logLevel<=n["b"].LOG_LEVEL_WARNING&&console.warn(`[${t}]`,...e)}function i(t,...e){n["b"].logLevel<=n["b"].LOG_LEVEL_ERROR&&console.error(`[${t}]`,...e)}t.log=e,t.warn=r,t.error=i})(i||(i={}))},function(t,e,r){"use strict";var i;r.d(e,"b",(function(){return i})),r.d(e,"a",(function(){return n})),function(t){t.LOG_LEVEL_VERBOSE=0,t.LOG_LEVEL_WARNING=1,t.LOG_LEVEL_ERROR=2,t.LOG_LEVEL_NONE=999,t.logLevel=t.LOG_LEVEL_WARNING,t.sound=!0,t.motionSync=!0,t.motionFadingDuration=500,t.idleMotionFadingDuration=2e3,t.expressionFadingDuration=500}(i||(i={}));const n="0.3.1"},function(e,r){e.exports=t},function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var i=r(15),n=r(16);class o{static load(t){return Object(n["a"])(this.middlewares,t).then(()=>t.result)}}o.middlewares=[i["a"].loader]},function(t,e,r){"use strict";r.d(e,"a",(function(){return _}));var i=r(6),n=r(3),o=r(0),s=r(16),a=r(17);function u(t,e={}){var r;const i={resourceOptions:{crossorigin:e.crossOrigin}};if(a["Texture"].fromURL)return a["Texture"].fromURL(t,i).catch(t=>{if(t instanceof Error)throw t;const e=new Error("Texture loading error");throw e.event=t,e});i.resourceOptions.autoLoad=!1;const n=a["Texture"].from(t,i);if(n.baseTexture.valid)return Promise.resolve(n);const o=n.baseTexture.resource;return null!==(r=o._live2d_load)&&void 0!==r||(o._live2d_load=new Promise((t,e)=>{const r=t=>{o.source.removeEventListener("error",r);const i=new Error("Texture loading error");i.event=t,e(i)};o.source.addEventListener("error",r),o.load().then(()=>t(n)).catch(r)})),o._live2d_load}var h=function(t,e,r,i){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,o){function s(t){try{u(i.next(t))}catch(e){o(e)}}function a(t){try{u(i["throw"](t))}catch(e){o(e)}}function u(t){t.done?r(t.value):n(t.value).then(s,a)}u((i=i.apply(t,e||[])).next())}))};const l="Live2DFactory",c=(t,e)=>h(void 0,void 0,void 0,(function*(){if("string"===typeof t.source){const e=yield n["a"].load({url:t.source,type:"json",target:t.live2dModel});e.url=t.source,t.source=e,t.live2dModel.emit("settingsJSONLoaded",e)}return e()})),d=(t,e)=>h(void 0,void 0,void 0,(function*(){if(t.source instanceof i["f"])return t.settings=t.source,e();if("object"===typeof t.source){const r=_.findRuntime(t.source);if(r){const i=r.createModelSettings(t.source);return t.settings=i,t.live2dModel.emit("settingsLoaded",i),e()}}throw new TypeError("Unknown settings format.")})),p=(t,e)=>{if(t.settings){const r=_.findRuntime(t.settings);if(r)return r.ready().then(e)}return e()},f=(t,e)=>h(void 0,void 0,void 0,(function*(){yield e();const r=t.internalModel;if(r){const e=t.settings,i=_.findRuntime(e);if(i){const s=[];e.pose&&s.push(n["a"].load({settings:e,url:e.pose,type:"json",target:r}).then(e=>{r.pose=i.createPose(r.coreModel,e),t.live2dModel.emit("poseLoaded",r.pose)}).catch(t=>o["f"].warn(l,"Failed to load pose.\n",t))),e.physics&&s.push(n["a"].load({settings:e,url:e.physics,type:"json",target:r}).then(e=>{r.physics=i.createPhysics(r.coreModel,e),t.live2dModel.emit("physicsLoaded",r.physics)}).catch(t=>o["f"].warn(l,"Failed to load physics.\n",t))),s.length&&(yield Promise.all(s))}}})),m=(t,e)=>h(void 0,void 0,void 0,(function*(){if(!t.settings)throw new TypeError("Missing settings.");{const r=t.live2dModel,i=t.settings.textures.map(e=>{const r=t.settings.resolveURL(e);return u(r,{crossOrigin:t.options.crossOrigin})});if(yield e(),!t.internalModel)throw new TypeError("Missing internal model.");r.internalModel=t.internalModel,r.emit("modelLoaded",t.internalModel),r.textures=yield Promise.all(i),r.emit("textureLoaded",r.textures)}})),g=(t,e)=>h(void 0,void 0,void 0,(function*(){const r=t.settings;if(r instanceof i["f"]){const i=_.findRuntime(r);if(!i)throw new TypeError("Unknown model settings.");const o=yield n["a"].load({settings:r,url:r.moc,type:"arraybuffer",target:t.live2dModel});if(!i.isValidMoc(o))throw new Error("Invalid moc data");const s=i.createCoreModel(o);return t.internalModel=i.createInternalModel(s,r,t.options),e()}throw new TypeError("Missing settings.")}));var v=function(t,e,r,i){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,o){function s(t){try{u(i.next(t))}catch(e){o(e)}}function a(t){try{u(i["throw"](t))}catch(e){o(e)}}function u(t){t.done?r(t.value):n(t.value).then(s,a)}u((i=i.apply(t,e||[])).next())}))};class _{static registerRuntime(t){_.runtimes.push(t),_.runtimes.sort((t,e)=>e.version-t.version)}static findRuntime(t){for(const e of _.runtimes)if(e.test(t))return e}static setupLive2DModel(t,e,r){return v(this,void 0,void 0,(function*(){const i=new Promise(e=>t.once("textureLoaded",e)),n=new Promise(e=>t.once("modelLoaded",e)),o=Promise.all([i,n]).then(()=>t.emit("ready"));yield Object(s["a"])(_.live2DModelMiddlewares,{live2dModel:t,source:e,options:r||{}}),yield o,t.emit("load")}))}static loadMotion(t,e,r){var i,s;const a=i=>t.emit("motionLoadError",e,r,i);try{const u=null===(i=t.definitions[e])||void 0===i?void 0:i[r];if(!u)return Promise.resolve(void 0);t.listeners("destroy").includes(_.releaseTasks)||t.once("destroy",_.releaseTasks);let h=_.motionTasksMap.get(t);h||(h={},_.motionTasksMap.set(t,h));let l=h[e];l||(l=[],h[e]=l);const c=t.getMotionFile(u);return null!==(s=l[r])&&void 0!==s||(l[r]=n["a"].load({url:c,settings:t.settings,type:t.motionDataType,target:t}).then(i=>{var n;const o=null===(n=_.motionTasksMap.get(t))||void 0===n?void 0:n[e];o&&delete o[r];const s=t.createMotion(i,e,u);return t.emit("motionLoaded",e,r,s),s}).catch(e=>{o["f"].warn(t.tag,`Failed to load motion: ${c}\n`,e),a(e)})),l[r]}catch(u){o["f"].warn(t.tag,`Failed to load motion at "${e}"[${r}]\n`,u),a(u)}return Promise.resolve(void 0)}static loadExpression(t,e){var r;const i=r=>t.emit("expressionLoadError",e,r);try{const s=t.definitions[e];if(!s)return Promise.resolve(void 0);t.listeners("destroy").includes(_.releaseTasks)||t.once("destroy",_.releaseTasks);let a=_.expressionTasksMap.get(t);a||(a=[],_.expressionTasksMap.set(t,a));const u=t.getExpressionFile(s);return null!==(r=a[e])&&void 0!==r||(a[e]=n["a"].load({url:u,settings:t.settings,type:"json",target:t}).then(r=>{const i=_.expressionTasksMap.get(t);i&&delete i[e];const n=t.createExpression(r,s);return t.emit("expressionLoaded",e,n),n}).catch(e=>{o["f"].warn(t.tag,`Failed to load expression: ${u}\n`,e),i(e)})),a[e]}catch(s){o["f"].warn(t.tag,`Failed to load expression at [${e}]\n`,s),i(s)}return Promise.resolve(void 0)}static releaseTasks(){this instanceof i["g"]?_.motionTasksMap.delete(this):_.expressionTasksMap.delete(this)}}_.runtimes=[],_.urlToJSON=c,_.jsonToSettings=d,_.waitUntilReady=p,_.setupOptionals=f,_.setupEssentials=m,_.createInternalModel=g,_.live2DModelMiddlewares=[c,d,p,f,m,g],_.motionTasksMap=new WeakMap,_.expressionTasksMap=new WeakMap,i["g"].prototype._loadMotion=function(t,e){return _.loadMotion(this,t,e)},i["a"].prototype._loadExpression=function(t){return _.loadExpression(this,t)}},function(t,r){t.exports=e},function(t,e,r){"use strict";var i=r(8);r.d(e,"d",(function(){return i["a"]})),r.d(e,"e",(function(){return i["b"]}));var n=r(10);r.d(e,"a",(function(){return n["a"]}));var o=r(14);r.d(e,"b",(function(){return o["a"]}));var s=r(11);r.d(e,"f",(function(){return s["a"]}));var a=r(9);r.d(e,"i",(function(){return a["a"]})),r.d(e,"j",(function(){return a["b"]}));var u=r(12);r.d(e,"g",(function(){return u["a"]})),r.d(e,"h",(function(){return u["b"]}));var h=r(7);r.d(e,"k",(function(){return h["a"]}));var l=r(13);r.d(e,"c",(function(){return l["a"]}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return u}));var i=r(0),n=r(19),o=r.n(n);const s="SoundManager",a=.5;class u{static get volume(){return this._volume}static set volume(t){this._volume=(t>1?1:t<0?0:t)||0,this.audios.forEach(t=>t.volume=this._volume)}static add(t,e,r){const n=new Audio(t);return n.volume=this._volume,n.preload="auto",n.addEventListener("ended",()=>{this.dispose(n),null===e||void 0===e||e()}),n.addEventListener("error",e=>{this.dispose(n),i["f"].warn(s,`Error occurred on "${t}"`,e.error),null===r||void 0===r||r(e.error)}),this.audios.push(n),n}static play(t){return new Promise((e,r)=>{var i;null===(i=t.play())||void 0===i||i.catch(e=>{t.dispatchEvent(new ErrorEvent("error",{error:e})),r(e)}),t.readyState===t.HAVE_ENOUGH_DATA?e():t.addEventListener("canplaythrough",e)})}static dispose(t){t.pause(),t.removeAttribute("src"),o()(this.audios,t)}static destroy(){for(let t=this.audios.length-1;t>=0;t--)this.dispose(this.audios[t])}}u.audios=[],u._volume=a},function(t,e,r){"use strict";r.d(e,"b",(function(){return i})),r.d(e,"a",(function(){return n}));const i=2,n=2},function(t,e,r){"use strict";r.d(e,"a",(function(){return i})),r.d(e,"b",(function(){return o}));var i,n=r(0);(function(t){t[t["NONE"]=0]="NONE",t[t["IDLE"]=1]="IDLE",t[t["NORMAL"]=2]="NORMAL",t[t["FORCE"]=3]="FORCE"})(i||(i={}));class o{constructor(){this.debug=!1,this.currentPriority=i.NONE,this.reservePriority=i.NONE}reserve(t,e,r){if(r<=i.NONE)return n["f"].log(this.tag,"Cannot start a motion with MotionPriority.NONE."),!1;if(t===this.currentGroup&&e===this.currentIndex)return n["f"].log(this.tag,"Motion is already playing.",this.dump(t,e)),!1;if(t===this.reservedGroup&&e===this.reservedIndex||t===this.reservedIdleGroup&&e===this.reservedIdleIndex)return n["f"].log(this.tag,"Motion is already reserved.",this.dump(t,e)),!1;if(r===i.IDLE){if(this.currentPriority!==i.NONE)return n["f"].log(this.tag,"Cannot start idle motion because another motion is playing.",this.dump(t,e)),!1;if(void 0!==this.reservedIdleGroup)return n["f"].log(this.tag,"Cannot start idle motion because another idle motion has reserved.",this.dump(t,e)),!1;this.setReservedIdle(t,e)}else{if(ri.IDLE}dump(t,e){if(this.debug){const r=["currentPriority","reservePriority","currentGroup","currentIndex","reservedGroup","reservedIndex","reservedIdleGroup","reservedIdleIndex"];return`\n group = "${t}", index = ${e}\n`+r.map(t=>"["+t+"] "+this[t]).join("\n")}return""}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return s}));var i=r(0),n=r(2),o=function(t,e,r,i){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,o){function s(t){try{u(i.next(t))}catch(e){o(e)}}function a(t){try{u(i["throw"](t))}catch(e){o(e)}}function u(t){t.done?r(t.value):n(t.value).then(s,a)}u((i=i.apply(t,e||[])).next())}))};class s extends n["EventEmitter"]{constructor(t,e){super(),this.expressions=[],this.reserveExpressionIndex=-1,this.destroyed=!1,this.settings=t,this.tag=`ExpressionManager(${t.name})`}init(){this.defaultExpression=this.createExpression({},void 0),this.currentExpression=this.defaultExpression,this.stopAllExpressions()}loadExpression(t){return o(this,void 0,void 0,(function*(){if(!this.definitions[t])return void i["f"].warn(this.tag,`Undefined expression at [${t}]`);if(null===this.expressions[t])return void i["f"].warn(this.tag,`Cannot set expression at [${t}] because it's already failed in loading.`);if(this.expressions[t])return this.expressions[t];const e=yield this._loadExpression(t);return this.expressions[t]=e,e}))}_loadExpression(t){throw new Error("Not implemented.")}setRandomExpression(){return o(this,void 0,void 0,(function*(){if(this.definitions.length){const t=[];for(let e=0;e-1&&t(t.push(e),e)),t}validateFiles(t){const e=(e,r)=>{const i=this.resolveURL(e);if(!t.includes(i)){if(r)throw new Error(`File "${e}" is defined in settings, but doesn't exist in given files`);return!1}return!0},r=[this.moc,...this.textures];r.forEach(t=>e(t,!0));const i=this.getDefinedFiles();return i.filter(t=>e(t,!1))}}},function(t,e,r){"use strict";r.d(e,"b",(function(){return i})),r.d(e,"a",(function(){return l}));var i,n=r(1),o=r(9),s=r(7),a=r(0),u=r(2),h=function(t,e,r,i){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,o){function s(t){try{u(i.next(t))}catch(e){o(e)}}function a(t){try{u(i["throw"](t))}catch(e){o(e)}}function u(t){t.done?r(t.value):n(t.value).then(s,a)}u((i=i.apply(t,e||[])).next())}))};(function(t){t["ALL"]="ALL",t["IDLE"]="IDLE",t["NONE"]="NONE"})(i||(i={}));class l extends u["EventEmitter"]{constructor(t,e){super(),this.motionGroups={},this.state=new o["b"],this.playing=!1,this.destroyed=!1,this.settings=t,this.tag=`MotionManager(${t.name})`,this.state.tag=this.tag}init(t){(null===t||void 0===t?void 0:t.idleMotionGroup)&&(this.groups.idle=t.idleMotionGroup),this.setupMotions(t),this.stopAllMotions()}setupMotions(t){for(const r of Object.keys(this.definitions))this.motionGroups[r]=[];let e;switch(null===t||void 0===t?void 0:t.motionPreload){case i.NONE:return;case i.ALL:e=Object.keys(this.definitions);break;case i.IDLE:default:e=[this.groups.idle];break}for(const r of e)if(this.definitions[r])for(let t=0;tthis.currentAudio=void 0,()=>this.currentAudio=void 0),this.currentAudio=u}catch(l){a["f"].warn(this.tag,"Failed to create audio",t,l)}}const h=yield this.loadMotion(t,e);if(u){const t=s["a"].play(u).catch(t=>a["f"].warn(this.tag,"Failed to play audio",u.src,t));n["b"].motionSync&&(yield t)}return this.state.start(h,t,e,r)?(a["f"].log(this.tag,"Start motion:",this.getMotionName(o)),this.emit("motionStart",t,e,u),this.state.shouldOverrideExpression()&&this.expressionManager&&this.expressionManager.resetExpression(),this.playing=!0,this._startMotion(h),!0):(u&&(s["a"].dispose(u),this.currentAudio=void 0),!1)}))}startRandomMotion(t,e){return h(this,void 0,void 0,(function*(){const r=this.definitions[t];if(null===r||void 0===r?void 0:r.length){const i=[];for(let e=0;et.index>=0);for(const e of t)this.hitAreas[e.name]=e}hitTest(t,e){return Object.keys(this.hitAreas).filter(r=>this.isHit(r,t,e))}isHit(t,e,r){if(!this.hitAreas[t])return!1;const i=this.hitAreas[t].index,n=this.getDrawableBounds(i,a);return n.x<=e&&e<=n.x+n.width&&n.y<=r&&r<=n.y+n.height}getDrawableBounds(t,e){const r=this.getDrawableVertices(t);let i=r[0],n=r[0],o=r[1],s=r[1];for(let a=0;ac&&(u*=c/l,h*=c/l),this.vx+=u,this.vy+=h;const d=Math.sqrt(Math.pow(this.vx,2)+Math.pow(this.vy,2)),p=.5*(Math.sqrt(Math.pow(c,2)+8*c*i)-c);d>p&&(this.vx*=p/d,this.vy*=p/d),this.x+=this.vx,this.y+=this.vy}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return s}));var i=r(0);const n="XHRLoader";class o extends Error{constructor(t,e,r,i=!1){super(t),this.url=e,this.status=r,this.aborted=i}}class s{static createXHR(t,e,r,a,u){const h=new XMLHttpRequest;if(s.allXhrSet.add(h),t){let e=s.xhrMap.get(t);e?e.add(h):(e=new Set([h]),s.xhrMap.set(t,e)),t.listeners("destroy").includes(s.cancelXHRs)||t.once("destroy",s.cancelXHRs)}return h.open("GET",e),h.responseType=r,h.onload=()=>{200!==h.status&&0!==h.status||!h.response?h.onerror():a(h.response)},h.onerror=()=>{i["f"].warn(n,`Failed to load resource as ${h.responseType} (Status ${h.status}): ${e}`),u(new o("Network error.",e,h.status))},h.onabort=()=>u(new o("Aborted.",e,h.status,!0)),h.onloadend=()=>{var e;s.allXhrSet.delete(h),t&&(null===(e=s.xhrMap.get(t))||void 0===e||e.delete(h))},h}static cancelXHRs(){var t;null===(t=s.xhrMap.get(this))||void 0===t||t.forEach(t=>{t.abort(),s.allXhrSet.delete(t)}),s.xhrMap.delete(this)}static release(){s.allXhrSet.forEach(t=>t.abort()),s.allXhrSet.clear(),s.xhrMap=new WeakMap}}s.xhrMap=new WeakMap,s.allXhrSet=new Set,s.loader=(t,e)=>new Promise((e,r)=>{const i=s.createXHR(t.target,t.settings?t.settings.resolveURL(t.url):t.url,t.type,r=>{t.result=r,e()},r);i.send()})},function(t,e,r){"use strict";function i(t,e){let r=-1;return i(0);function i(n,o){if(o)return Promise.reject(o);if(n<=r)return Promise.reject(new Error("next() called multiple times"));r=n;const s=t[n];if(!s)return Promise.resolve();try{return Promise.resolve(s(e,i.bind(null,n+1)))}catch(o){return Promise.reject(o)}}}r.d(e,"a",(function(){return i}))},function(t,e){t.exports=r},function(t,e,r){"use strict";r.d(e,"g",(function(){return i["e"]})),r.d(e,"f",(function(){return i["d"]})),r.d(e,"a",(function(){return i["a"]})),r.d(e,"c",(function(){return i["b"]})),r.d(e,"l",(function(){return i["f"]})),r.d(e,"o",(function(){return i["i"]})),r.d(e,"p",(function(){return i["j"]})),r.d(e,"n",(function(){return i["h"]})),r.d(e,"m",(function(){return i["g"]})),r.d(e,"q",(function(){return i["k"]})),r.d(e,"e",(function(){return i["c"]})),r.d(e,"j",(function(){return g})),r.d(e,"k",(function(){return l})),r.d(e,"d",(function(){return a})),r.d(e,"w",(function(){return v["b"]})),r.d(e,"r",(function(){return v["a"]})),r.d(e,"h",(function(){return n["a"]})),r.d(e,"i",(function(){return _["a"]})),r.d(e,"s",(function(){return y["a"]})),r.d(e,"b",(function(){return T})),r.d(e,"t",(function(){return w})),r.d(e,"A",(function(){return d["f"]})),r.d(e,"v",(function(){return d["b"]})),r.d(e,"B",(function(){return d["g"]})),r.d(e,"y",(function(){return d["d"]})),r.d(e,"x",(function(){return d["c"]})),r.d(e,"u",(function(){return d["a"]})),r.d(e,"z",(function(){return d["e"]}));var i=r(6),n=r(4),o=r(20),s=r(5);class a{constructor(){this._autoInteract=!1}get autoInteract(){return this._autoInteract}set autoInteract(t){t!==this._autoInteract&&(t?this.on("pointertap",u,this):this.off("pointertap",u,this),this._autoInteract=t)}registerInteraction(t){t!==this.interactionManager&&(this.unregisterInteraction(),this._autoInteract&&t&&(this.interactionManager=t,t.on("pointermove",h,this)))}unregisterInteraction(){var t;this.interactionManager&&(null===(t=this.interactionManager)||void 0===t||t.off("pointermove",h,this),this.interactionManager=void 0)}}function u(t){this.tap(t.data.global.x,t.data.global.y)}function h(t){this.focus(t.data.global.x,t.data.global.y)}class l extends s["Transform"]{}var c,d=r(0);const p=new s["Point"],f=new s["Matrix"];let m=null===(c=window.PIXI)||void 0===c?void 0:c.Ticker;class g extends o["Container"]{constructor(t){super(),this.tag="Live2DModel(uninitialized)",this.textures=[],this.transform=new l,this.anchor=new s["ObservablePoint"](this.onAnchorChange,this,0,0),this.glContextID=-1,this.elapsedTime=performance.now(),this.deltaTime=0,this._autoUpdate=!1,this.once("modelLoaded",()=>this.init(t))}static from(t,e){const r=new this(e);return n["a"].setupLive2DModel(r,t,e).then(()=>r)}static fromSync(t,e){const r=new this(e);return n["a"].setupLive2DModel(r,t,e).then(null===e||void 0===e?void 0:e.onLoad).catch(null===e||void 0===e?void 0:e.onError),r}static registerTicker(t){m=t}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t?this._destroyed||(m?(m.shared.add(this.onTickerUpdate,this),this._autoUpdate=!0):d["f"].warn(this.tag,"No Ticker registered, please call Live2DModel.registerTicker(Ticker).")):(null===m||void 0===m||m.shared.remove(this.onTickerUpdate,this),this._autoUpdate=!1)}init(t){this.tag=`Live2DModel(${this.internalModel.settings.name})`;const e=Object.assign({autoUpdate:!0,autoInteract:!0},t);e.autoInteract&&(this.interactive=!0),this.autoInteract=e.autoInteract,this.autoUpdate=e.autoUpdate}onAnchorChange(){this.pivot.set(this.anchor.x*this.internalModel.width,this.anchor.y*this.internalModel.height)}motion(t,e,r){return void 0===e?this.internalModel.motionManager.startRandomMotion(t,r):this.internalModel.motionManager.startMotion(t,e,r)}expression(t){return this.internalModel.motionManager.expressionManager?void 0===t?this.internalModel.motionManager.expressionManager.setRandomExpression():this.internalModel.motionManager.expressionManager.setExpression(t):Promise.resolve(!1)}focus(t,e,r=!1){p.x=t,p.y=e,this.toModelPosition(p,p,!0),this.internalModel.focusController.focus(p.x/this.internalModel.originalWidth*2-1,-(p.y/this.internalModel.originalHeight*2-1),r)}tap(t,e){const r=this.hitTest(t,e);r.length&&(d["f"].log(this.tag,"Hit",r),this.emit("hit",r))}hitTest(t,e){return p.x=t,p.y=e,this.toModelPosition(p,p),this.internalModel.hitTest(p.x,p.y)}toModelPosition(t,e=t.clone(),r){return r||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.transform.worldTransform.applyInverse(t,e),this.internalModel.localTransform.applyInverse(e,e),e}containsPoint(t){return this.getBounds(!0).contains(t.x,t.y)}_calculateBounds(){this._bounds.addFrame(this.transform,0,0,this.internalModel.width,this.internalModel.height)}onTickerUpdate(){this.update(m.shared.deltaMS)}update(t){this.deltaTime+=t,this.elapsedTime+=t}_render(t){this.registerInteraction(t.plugins.interaction),t.batch.reset(),t.geometry.reset(),t.shader.reset(),t.state.reset();let e=!1;this.glContextID!==t.CONTEXT_UID&&(this.glContextID=t.CONTEXT_UID,this.internalModel.updateWebGLContext(t.gl,this.glContextID),e=!0);for(let n=0;ne.destroy(t.baseTexture)),this.internalModel.destroy(),super.destroy(t)}}Object(d["a"])(g,[a]);var v=r(1),_=r(3),y=r(15),x=r(2),b=function(t,e,r,i){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,o){function s(t){try{u(i.next(t))}catch(e){o(e)}}function a(t){try{u(i["throw"](t))}catch(e){o(e)}}function u(t){t.done?r(t.value):n(t.value).then(s,a)}u((i=i.apply(t,e||[])).next())}))};class T{static resolveURL(t,e){var r;const i=null===(r=T.filesMap[t])||void 0===r?void 0:r[e];if(void 0===i)throw new Error("Cannot find this file from uploaded files: "+e);return i}static upload(t,e){return b(this,void 0,void 0,(function*(){const r={};for(const i of e.getDefinedFiles()){const n=decodeURI(x["url"].resolve(e.url,i)),o=t.find(t=>t.webkitRelativePath===n);o&&(r[i]=URL.createObjectURL(o))}T.filesMap[e._objectURL]=r}))}static createSettings(t){return b(this,void 0,void 0,(function*(){const e=t.find(t=>t.name.endsWith("model.json")||t.name.endsWith("model3.json"));if(!e)throw new TypeError("Settings file not found");const r=yield T.readText(e),i=JSON.parse(r);i.url=e.webkitRelativePath;const o=n["a"].findRuntime(i);if(!o)throw new Error("Unknown settings JSON");const s=o.createModelSettings(i);return s._objectURL=URL.createObjectURL(e),s}))}static readText(t){return b(this,void 0,void 0,(function*(){return new Promise((e,r)=>{const i=new FileReader;i.onload=()=>e(i.result),i.onerror=r,i.readAsText(t,"utf8")})}))}}T.filesMap={},T.factory=(t,e)=>b(void 0,void 0,void 0,(function*(){if(Array.isArray(t.source)&&t.source[0]instanceof File){const e=t.source;let r=e.settings;if(r){if(!r._objectURL)throw new Error('"_objectURL" must be specified in ModelSettings')}else r=yield T.createSettings(e);r.validateFiles(e.map(t=>encodeURI(t.webkitRelativePath))),yield T.upload(e,r),r.resolveURL=function(t){return T.resolveURL(this._objectURL,t)},t.source=r,t.live2dModel.once("modelLoaded",t=>{t.once("destroy",(function(){const t=this.settings._objectURL;if(URL.revokeObjectURL(t),T.filesMap[t])for(const e of Object.values(T.filesMap[t]))URL.revokeObjectURL(e);delete T.filesMap[t]}))})}return e()})),n["a"].live2DModelMiddlewares.unshift(T.factory);var E=function(t,e,r,i){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,o){function s(t){try{u(i.next(t))}catch(e){o(e)}}function a(t){try{u(i["throw"](t))}catch(e){o(e)}}function u(t){t.done?r(t.value):n(t.value).then(s,a)}u((i=i.apply(t,e||[])).next())}))};class w{static unzip(t,e){return E(this,void 0,void 0,(function*(){const r=yield w.getFilePaths(t),i=[];for(const t of e.getDefinedFiles()){const n=decodeURI(x["url"].resolve(e.url,t));r.includes(n)&&i.push(n)}const n=yield w.getFiles(t,i);for(let t=0;tt.endsWith("model.json")||t.endsWith("model3.json"));if(!r)throw new Error("Settings file not found");const i=yield w.readText(t,r);if(!i)throw new Error("Empty settings file: "+r);const o=JSON.parse(i);o.url=r;const s=n["a"].findRuntime(o);if(!s)throw new Error("Unknown settings JSON");return s.createModelSettings(o)}))}static zipReader(t,e){return E(this,void 0,void 0,(function*(){throw new Error("Not implemented")}))}static getFilePaths(t){return E(this,void 0,void 0,(function*(){throw new Error("Not implemented")}))}static getFiles(t,e){return E(this,void 0,void 0,(function*(){throw new Error("Not implemented")}))}static readText(t,e){return E(this,void 0,void 0,(function*(){throw new Error("Not implemented")}))}static releaseReader(t){}}w.ZIP_PROTOCOL="zip://",w.uid=0,w.factory=(t,e)=>E(void 0,void 0,void 0,(function*(){const r=t.source;let i,n,o;if("string"===typeof r&&(r.endsWith(".zip")||r.startsWith(w.ZIP_PROTOCOL))?(i=r.startsWith(w.ZIP_PROTOCOL)?r.slice(w.ZIP_PROTOCOL.length):r,n=yield _["a"].load({url:i,type:"blob",target:t.live2dModel})):Array.isArray(r)&&1===r.length&&r[0]instanceof File&&r[0].name.endsWith(".zip")&&(n=r[0],i=URL.createObjectURL(n),o=r.settings),n){if(!n.size)throw new Error("Empty zip file");const e=yield w.zipReader(n,i);o||(o=yield w.createSettings(e)),o._objectURL=w.ZIP_PROTOCOL+w.uid+"/"+o.url;const r=yield w.unzip(e,o);r.settings=o,t.source=r,i.startsWith("blob:")&&t.live2dModel.once("modelLoaded",t=>{t.once("destroy",(function(){URL.revokeObjectURL(i)}))}),w.releaseReader(e)}return e()})),n["a"].live2DModelMiddlewares.unshift(w.factory)},function(t,e){t.exports=i},function(t,e){t.exports=n},function(t,e,r){"use strict";const i=Live2DMotion.prototype.updateParam;Live2DMotion.prototype.updateParam=function(t,e){i.call(this,t,e),e.isFinished()&&this.onFinishHandler&&(this.onFinishHandler(this),delete this.onFinishHandler)}},function(t,e,r){"use strict";r.d(e,"a",(function(){return O})),r.d(e,"c",(function(){return R})),r.d(e,"d",(function(){return rt})),r.d(e,"b",(function(){return kt})),r.d(e,"e",(function(){return Gt})),r.d(e,"f",(function(){return Vt}));r(26);var i,n=r(10);class o{constructor(t,e){this.x=t||0,this.y=e||0}add(t){const e=new o(0,0);return e.x=this.x+t.x,e.y=this.y+t.y,e}substract(t){const e=new o(0,0);return e.x=this.x-t.x,e.y=this.y-t.y,e}multiply(t){const e=new o(0,0);return e.x=this.x*t.x,e.y=this.y*t.y,e}multiplyByScaler(t){return this.multiply(new o(t,t))}division(t){const e=new o(0,0);return e.x=this.x/t.x,e.y=this.y/t.y,e}divisionByScalar(t){return this.division(new o(t,t))}getLength(){return Math.sqrt(this.x*this.x+this.y*this.y)}getDistanceWith(t){return Math.sqrt((this.x-t.x)*(this.x-t.x)+(this.y-t.y)*(this.y-t.y))}dot(t){return this.x*t.x+this.y*t.y}normalize(){const t=Math.pow(this.x*this.x+this.y*this.y,.5);this.x=this.x/t,this.y=this.y/t}isEqual(t){return this.x==t.x&&this.y==t.y}isNotEqual(t){return!this.isEqual(t)}}class s{static range(t,e,r){return tr&&(t=r),t}static sin(t){return Math.sin(t)}static cos(t){return Math.cos(t)}static abs(t){return Math.abs(t)}static sqrt(t){return Math.sqrt(t)}static getEasingSine(t){return t<0?0:t>1?1:.5-.5*this.cos(t*Math.PI)}static max(t,e){return t>e?t:e}static min(t,e){return t>e?e:t}static degreesToRadian(t){return t/180*Math.PI}static radianToDegrees(t){return 180*t/Math.PI}static directionToRadian(t,e){const r=Math.atan2(e.y,e.x),i=Math.atan2(t.y,t.x);let n=r-i;while(n<-Math.PI)n+=2*Math.PI;while(n>Math.PI)n-=2*Math.PI;return n}static directionToDegrees(t,e){const r=this.directionToRadian(t,e);let i=this.radianToDegrees(r);return e.x-t.x>0&&(i=-i),i}static radianToDirection(t){const e=new o;return e.x=this.sin(t),e.y=this.cos(t),e}constructor(){}}class a{constructor(){this._tr=new Float32Array(16),this.loadIdentity()}static multiply(t,e,r){const i=new Float32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),n=4;for(let o=0;o1&&(t=1),e<0?e=0:e>1&&(e=1),r<0?r=0:r>1&&(r=1),i<0?i=0:i>1&&(i=1),this._modelColor.R=t,this._modelColor.G=e,this._modelColor.B=r,this._modelColor.A=i}getModelColor(){return Object.assign({},this._modelColor)}setIsPremultipliedAlpha(t){this._isPremultipliedAlpha=t}isPremultipliedAlpha(){return this._isPremultipliedAlpha}setIsCulling(t){this._isCulling=t}isCulling(){return this._isCulling}setAnisotropy(t){this._anisortopy=t}getAnisotropy(){return this._anisortopy}getModel(){return this._model}}(function(t){t[t["CubismBlendMode_Normal"]=0]="CubismBlendMode_Normal",t[t["CubismBlendMode_Additive"]=1]="CubismBlendMode_Additive",t[t["CubismBlendMode_Multiplicative"]=2]="CubismBlendMode_Multiplicative"})(i||(i={}));class h{constructor(){this.R=1,this.G=1,this.B=1,this.A=1}}let l=!1,c=!1,d=void 0;var p,f;(function(t){t.vertexOffset=0,t.vertexStep=2})(p||(p={}));class m{static startUp(t){if(l)return _("CubismFramework.startUp() is already done."),l;if(Live2DCubismCore._isStarted)return l=!0,!0;if(Live2DCubismCore._isStarted=!0,d=t,d&&Live2DCubismCore.Logging.csmSetLogFunction(d.logFunction),l=!0,l){const t=Live2DCubismCore.Version.csmGetVersion(),e=(4278190080&t)>>24,r=(16711680&t)>>16,i=65535&t,n=t;_("Live2D Cubism Core version: {0}.{1}.{2} ({3})",("00"+e).slice(-2),("00"+r).slice(-2),("0000"+i).slice(-4),n)}return _("CubismFramework.startUp() is complete."),l}static cleanUp(){l=!1,c=!1,d=void 0}static initialize(){l?c?y("CubismFramework.initialize() skipped, already initialized."):(c=!0,_("CubismFramework.initialize() is complete.")):y("CubismFramework is not started.")}static dispose(){l?c?(u.staticRelease(),c=!1,_("CubismFramework.dispose() is complete.")):y("CubismFramework.dispose() skipped, not initialized."):y("CubismFramework is not started.")}static isStarted(){return l}static isInitialized(){return c}static coreLogFunction(t){Live2DCubismCore.Logging.csmGetLogFunction()&&Live2DCubismCore.Logging.csmGetLogFunction()(t)}static getLoggingLevel(){return null!=d?d.loggingLevel:f.LogLevel_Off}constructor(){}}(function(t){t[t["LogLevel_Verbose"]=0]="LogLevel_Verbose",t[t["LogLevel_Debug"]=1]="LogLevel_Debug",t[t["LogLevel_Info"]=2]="LogLevel_Info",t[t["LogLevel_Warning"]=3]="LogLevel_Warning",t[t["LogLevel_Error"]=4]="LogLevel_Error",t[t["LogLevel_Off"]=5]="LogLevel_Off"})(f||(f={}));const g=()=>{};function v(t,...e){b.print(f.LogLevel_Debug,"[CSM][D]"+t+"\n",e)}function _(t,...e){b.print(f.LogLevel_Info,"[CSM][I]"+t+"\n",e)}function y(t,...e){b.print(f.LogLevel_Warning,"[CSM][W]"+t+"\n",e)}function x(t,...e){b.print(f.LogLevel_Error,"[CSM][E]"+t+"\n",e)}class b{static print(t,e,r){if(tr[e]);i(n)}static dumpBytes(t,e,r){for(let i=0;i0?this.print(t,"\n"):i%8==0&&i>0&&this.print(t," "),this.print(t,"{0} ",[255&e[i]]);this.print(t,"\n")}constructor(){}}class T{constructor(){this._fadeInSeconds=-1,this._fadeOutSeconds=-1,this._weight=1,this._offsetSeconds=0,this._firedEventValues=[]}release(){this._weight=0}updateParameters(t,e,r){if(!e.isAvailable()||e.isFinished())return;if(!e.isStarted()){e.setIsStarted(!0),e.setStartTime(r-this._offsetSeconds),e.setFadeInStartTime(r);const t=this.getDuration();e.getEndTime()<0&&e.setEndTime(t<=0?-1:e.getStartTime()+t)}let i=this._weight;const n=0==this._fadeInSeconds?1:s.getEasingSine((r-e.getFadeInStartTime())/this._fadeInSeconds),o=0==this._fadeOutSeconds||e.getEndTime()<0?1:s.getEasingSine((e.getEndTime()-r)/this._fadeOutSeconds);i=i*n*o,e.setState(r,i),g(0<=i&&i<=1),this.doUpdateParameters(t,r,i,e),e.getEndTime()>0&&e.getEndTime()null!=e&&e._motionQueueEntryHandle==t)}setEventCallback(t,e=null){this._eventCallBack=t,this._eventCustomData=e}doUpdateMotion(t,e){let r=!1,i=0;while(ie.Name===t)}getExpressionFile(t){return t.File}createExpression(t,e){return w.create(t)}_setExpression(t){return this.queueManager.startMotion(t,!1,performance.now())}stopAllExpressions(){this.queueManager.stopAllMotions()}updateParameters(t,e){return this.queueManager.doUpdateMotion(t,e)}}var C=r(11),A=r(0);class D{constructor(t){this.groups=t.Groups,this.hitAreas=t.HitAreas,this.layout=t.Layout,this.moc=t.FileReferences.Moc,this.expressions=t.FileReferences.Expressions,this.motions=t.FileReferences.Motions,this.textures=t.FileReferences.Textures,this.physics=t.FileReferences.Physics,this.pose=t.FileReferences.Pose}getEyeBlinkParameters(){var t,e;return null===(e=null===(t=this.groups)||void 0===t?void 0:t.find(t=>"EyeBlink"===t.Name))||void 0===e?void 0:e.Ids}getLipSyncParameters(){var t,e;return null===(e=null===(t=this.groups)||void 0===t?void 0:t.find(t=>"LipSync"===t.Name))||void 0===e?void 0:e.Ids}}class R extends C["a"]{constructor(t){if(super(t),!R.isValidJSON(t))throw new TypeError("Invalid JSON.");Object.assign(this,new D(t))}static isValidJSON(t){var e;return!!(null===t||void 0===t?void 0:t.FileReferences)&&"string"===typeof t.FileReferences.Moc&&(null===(e=t.FileReferences.Textures)||void 0===e?void 0:e.length)>0&&t.FileReferences.Textures.every(t=>"string"===typeof t)}replaceFiles(t){if(super.replaceFiles(t),this.motions)for(const[e,r]of Object.entries(this.motions))for(let i=0;ir){n=u;break}if(-1==n)return t.points[s].value;const a=t.segments[n];return a.evaluate(t.points.slice(a.basePointIndex),r)}class tt extends T{constructor(){super(),this._eyeBlinkParameterIds=[],this._lipSyncParameterIds=[],this._sourceFrameRate=30,this._loopDurationSeconds=-1,this._isLoop=!1,this._isLoopFadeIn=!0,this._lastWeight=0}static create(t,e){const r=new tt;return r.parse(t),r._sourceFrameRate=r._motionData.fps,r._loopDurationSeconds=r._motionData.duration,r._onFinishedMotion=e,r}doUpdateParameters(t,e,r,i){null==this._modelCurveIdEyeBlink&&(this._modelCurveIdEyeBlink=V),null==this._modelCurveIdLipSync&&(this._modelCurveIdLipSync=H);let n=e-i.getStartTime();n<0&&(n=0);let o=Number.MAX_VALUE,a=Number.MAX_VALUE;const u=64;let h=0,l=0;this._eyeBlinkParameterIds.length>u&&v("too many eye blink targets : {0}",this._eyeBlinkParameterIds.length),this._lipSyncParameterIds.length>u&&v("too many lip sync targets : {0}",this._lipSyncParameterIds.length);const c=this._fadeInSeconds<=0?1:s.getEasingSine((e-i.getFadeInStartTime())/this._fadeInSeconds),d=this._fadeOutSeconds<=0||i.getEndTime()<0?1:s.getEasingSine((i.getEndTime()-e)/this._fadeOutSeconds);let p,f,m,g=n;if(this._isLoop)while(g>this._motionData.duration)g-=this._motionData.duration;const _=this._motionData.curves;for(f=0;f>s&1)continue;const i=e+(a-e)*r;t.setParameterValueById(this._eyeBlinkParameterIds[s],i)}if(o!=Number.MAX_VALUE)for(let s=0;s>s&1)continue;const i=e+(o-e)*r;t.setParameterValueById(this._lipSyncParameterIds[s],i)}for(;f=this._motionData.duration&&(this._isLoop?(i.setStartTime(e),this._isLoopFadeIn&&i.setFadeInStartTime(e)):(this._onFinishedMotion&&this._onFinishedMotion(this),i.setIsFinished(!0))),this._lastWeight=r}setIsLoop(t){this._isLoop=t}isLoop(){return this._isLoop}setIsLoopFadeIn(t){this._isLoopFadeIn=t}isLoopFadeIn(){return this._isLoopFadeIn}getDuration(){return this._isLoop?-1:this._loopDurationSeconds}getLoopDuration(){return this._loopDurationSeconds}setParameterFadeInTime(t,e){const r=this._motionData.curves;for(let i=0;inew k),this._motionData.segments=Array.from({length:e.getMotionTotalSegmentCount()}).map(()=>new U),this._motionData.events=Array.from({length:this._motionData.eventCount}).map(()=>new j),this._motionData.points=[];let n=0,o=0;for(let s=0;st&&this._motionData.events[r].fireTime<=e&&this._firedEventValues.push(this._motionData.events[r].value);return this._firedEventValues}}var et=r(1);class rt extends N["a"]{constructor(t,e){var r;super(t,e),this.groups={idle:"Idle"},this.motionDataType="json",this.queueManager=new I,this.definitions=null!==(r=t.motions)&&void 0!==r?r:{},this.eyeBlinkIds=t.getEyeBlinkParameters()||[],this.lipSyncIds=t.getLipSyncParameters()||[],this.init(e)}init(t){super.init(t),this.settings.expressions&&(this.expressionManager=new O(this.settings,t)),this.queueManager.setEventCallback((t,e,r)=>{this.emit("motion:"+e)})}isFinished(){return this.queueManager.isFinished()}_startMotion(t,e){return t.setFinishedMotionHandler(e),this.queueManager.stopAllMotions(),this.queueManager.startMotion(t,!1,performance.now())}_stopAllMotions(){this.queueManager.stopAllMotions()}createMotion(t,e,r){const i=tt.create(t),n=(e===this.groups.idle?et["b"].idleMotionFadingDuration:et["b"].motionFadingDuration)/1e3;return i.setFadeInTime(r.FadeInTime>0?r.FadeInTime:n),i.setFadeOutTime(r.FadeOutTime>0?r.FadeOutTime:n),i.setEffectIds(this.eyeBlinkIds,this.lipSyncIds),i}getMotionFile(t){return t.File}getMotionName(t){return t.File}getSoundFile(t){return t.Sound}updateParameters(t,e){return this.queueManager.doUpdateMotion(t,e)}destroy(){super.destroy(),this.queueManager.release(),this.queueManager=void 0}}var it=r(13);const nt="ParamAngleX",ot="ParamAngleY",st="ParamAngleZ",at="ParamEyeBallX",ut="ParamEyeBallY",ht="ParamBodyAngleX",lt="ParamBreath";class ct{constructor(){this._breathParameters=[],this._currentTime=0}static create(){return new ct}setParameters(t){this._breathParameters=t}getParameters(){return this._breathParameters}updateParameters(t,e){this._currentTime+=e;const r=2*this._currentTime*3.14159;for(let i=0;i=1&&(i=1,this._blinkingState=ft.EyeState_Closed,this._stateStartTimeSeconds=this._userTimeSeconds),r=1-i;break;case ft.EyeState_Closed:i=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._closedSeconds,i>=1&&(this._blinkingState=ft.EyeState_Opening,this._stateStartTimeSeconds=this._userTimeSeconds),r=0;break;case ft.EyeState_Opening:i=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._openingSeconds,i>=1&&(i=1,this._blinkingState=ft.EyeState_Interval,this._nextBlinkingTime=this.determinNextBlinkingTiming()),r=i;break;case ft.EyeState_Interval:this._nextBlinkingTimed&&(d=e),rf&&(f=r)}if(l!=Number.MAX_VALUE)if(ln&&(n=d),f>o&&(o=f),r==Number.MAX_VALUE)e._allClippedDrawRect.x=0,e._allClippedDrawRect.y=0,e._allClippedDrawRect.width=0,e._allClippedDrawRect.height=0,e._isUsing=!1;else{e._isUsing=!0;const t=n-r,s=o-i;e._allClippedDrawRect.x=r,e._allClippedDrawRect.y=i,e._allClippedDrawRect.width=t,e._allClippedDrawRect.height=s}}}release(){var t,e,r;const i=this;for(let n=0;n0){this.gl.viewport(0,0,this._clippingMaskBufferSize,this._clippingMaskBufferSize),this._maskRenderTexture=this.getMaskRenderTexture();e.getMvpMatrix();e.preDraw(),this.setupLayoutBounds(r),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this._maskRenderTexture),this.gl.clearColor(1,1,1,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT);for(let r=0;r=0;e--)this._sortedDrawableIndexList[e]=0;super.initialize(t)}bindTexture(t,e){this._textures[t]=e}getBindedTextures(){return this._textures}setClippingMaskBufferSize(t){this._clippingManager.release(),this._clippingManager=new Tt,this._clippingManager.setClippingMaskBufferSize(t),this._clippingManager.initialize(this.getModel(),this.getModel().getDrawableCount(),this.getModel().getDrawableMasks(),this.getModel().getDrawableMaskCounts())}getClippingMaskBufferSize(){return this._clippingManager.getClippingMaskBufferSize()}release(){var t,e,r;const i=this;this._clippingManager.release(),i._clippingManager=void 0,null===(t=this.gl)||void 0===t||t.deleteBuffer(this._bufferData.vertex),this._bufferData.vertex=null,null===(e=this.gl)||void 0===e||e.deleteBuffer(this._bufferData.uv),this._bufferData.uv=null,null===(r=this.gl)||void 0===r||r.deleteBuffer(this._bufferData.index),this._bufferData.index=null,i._bufferData=void 0,i._textures=void 0}doDrawModel(){this.preDraw(),null!=this._clippingManager&&this._clippingManager.setupClippingContext(this.getModel(),this);const t=this.getModel().getDrawableCount(),e=this.getModel().getDrawableRenderOrders();for(let r=0;r{Lt.doStaticRelease()};var Ft=r(5),Nt=r(24),Bt=r.n(Nt);const Ut=new a;class kt extends it["a"]{constructor(t,e,r){super(),this.lipSync=!0,this.breath=ct.create(),this.renderer=new Lt,this.idParamAngleX=nt,this.idParamAngleY=ot,this.idParamAngleZ=st,this.idParamEyeBallX=at,this.idParamEyeBallY=ut,this.idParamBodyAngleX=ht,this.idParamBreath=lt,this.pixelsPerUnit=1,this.centeringTransform=new Ft["Matrix"],this.coreModel=t,this.settings=e,this.motionManager=new rt(e,r),this.init()}init(){var t;super.init(),(null===(t=this.settings.getEyeBlinkParameters())||void 0===t?void 0:t.length)>0&&(this.eyeBlink=pt.create(this.settings)),this.breath.setParameters([new dt(this.idParamAngleX,0,15,6.5345,.5),new dt(this.idParamAngleY,0,8,3.5345,.5),new dt(this.idParamAngleZ,0,10,5.5345,.5),new dt(this.idParamBodyAngleX,0,4,15.5345,.5),new dt(this.idParamBreath,0,.5,3.2345,.5)]),this.renderer.initialize(this.coreModel),this.renderer.setIsPremultipliedAlpha(!0)}getSize(){return[this.coreModel.getModel().canvasinfo.CanvasWidth,this.coreModel.getModel().canvasinfo.CanvasHeight]}getLayout(){return Bt()(Object.assign({},this.settings.layout),(t,e)=>e.charAt(0).toLowerCase()+e.slice(1))}setupLayout(){super.setupLayout(),this.pixelsPerUnit=this.coreModel.getModel().canvasinfo.PixelsPerUnit,this.centeringTransform.scale(this.pixelsPerUnit,this.pixelsPerUnit).translate(this.originalWidth/2,this.originalHeight/2)}updateWebGLContext(t,e){this.renderer.firstDraw=!0,this.renderer._bufferData={vertex:null,uv:null,index:null},this.renderer.startUp(t),this.renderer._clippingManager._currentFrameNo=e,this.renderer._clippingManager._maskTexture=void 0,Pt.getInstance()._shaderSets=[]}bindTexture(t,e){this.renderer.bindTexture(t,e)}getHitAreaDefs(){var t,e;return null!==(e=null===(t=this.settings.hitAreas)||void 0===t?void 0:t.map(t=>({id:t.Id,name:t.Name,index:this.coreModel.getDrawableIndex(t.Id)})))&&void 0!==e?e:[]}getDrawableIDs(){return this.coreModel.getDrawableIds()}getDrawableIndex(t){return this.coreModel.getDrawableIndex(t)}getDrawableVertices(t){if("string"===typeof t&&(t=this.coreModel.getDrawableIndex(t),-1===t))throw new TypeError("Unable to find drawable ID: "+t);const e=this.coreModel.getDrawableVertices(t).slice();for(let r=0;r{function r(){try{Vt(),t()}catch(i){if(Xt--,Xt<0){const t=new Error("Failed to start up Cubism 4 framework.");return t.cause=i,void e(t)}A["f"].log("Cubism4","Startup failed, retrying 10ms later..."),setTimeout(r,10)}}r()})),jt)}function Vt(t){t=Object.assign({logFunction:console.log,loggingLevel:f.LogLevel_Verbose},t),m.startUp(t),m.initialize()}var Ht=r(4);const zt=.001,Yt=.5;class Wt{constructor(){this._fadeTimeSeconds=Yt,this._lastModel=void 0,this._partGroups=[],this._partGroupCounts=[]}static create(t){const e=new Wt;"number"===typeof t.FadeInTime&&(e._fadeTimeSeconds=t.FadeInTime,e._fadeTimeSeconds<=0&&(e._fadeTimeSeconds=Yt));const r=t.Groups,i=r.length;for(let n=0;nzt){if(n>=0)break;n=u,o=t.getPartOpacityByIndex(r),o+=e/this._fadeTimeSeconds,o>1&&(o=1)}}n<0&&(n=0,o=1);for(let u=r;ua&&(r=1-a/(1-o)),i>r&&(i=r),t.setPartOpacityByIndex(e,i)}}}}class qt{constructor(t){this.parameterIndex=0,this.partIndex=0,this.partId="",this.link=[],void 0!=t&&this.assignment(t)}assignment(t){return this.partId=t.partId,this.link=t.link.map(t=>t.clone()),this}initialize(t){this.parameterIndex=t.getParameterIndex(this.partId),this.partIndex=t.getPartIndex(this.partId),t.setParameterValueByIndex(this.parameterIndex,1)}clone(){const t=new qt;return t.partId=this.partId,t.parameterIndex=this.parameterIndex,t.partIndex=this.partIndex,t.link=this.link.map(t=>t.clone()),t}}class Zt{constructor(t){this._model=t,this._savedParameters=[],this._parameterIds=[],this._drawableIds=[],this._partIds=[],this._notExistPartId={},this._notExistParameterId={},this._notExistParameterValues={},this._notExistPartOpacities={},this.initialize()}update(){this._model.update(),this._model.drawables.resetDynamicFlags()}getCanvasWidth(){return null==this._model?0:this._model.canvasinfo.CanvasWidth/this._model.canvasinfo.PixelsPerUnit}getCanvasHeight(){return null==this._model?0:this._model.canvasinfo.CanvasHeight/this._model.canvasinfo.PixelsPerUnit}saveParameters(){const t=this._model.parameters.count,e=this._savedParameters.length;for(let r=0;re&&(e=this._model.parameters.minimumValues[t]),this._parameterValues[t]=1==r?e:this._parameterValues[t]=this._parameterValues[t]*(1-r)+e*r)}setParameterValueById(t,e,r=1){const i=this.getParameterIndex(t);this.setParameterValueByIndex(i,e,r)}addParameterValueByIndex(t,e,r=1){this.setParameterValueByIndex(t,this.getParameterValueByIndex(t)+e*r)}addParameterValueById(t,e,r=1){const i=this.getParameterIndex(t);this.addParameterValueByIndex(i,e,r)}multiplyParameterValueById(t,e,r=1){const i=this.getParameterIndex(t);this.multiplyParameterValueByIndex(i,e,r)}multiplyParameterValueByIndex(t,e,r=1){this.setParameterValueByIndex(t,this.getParameterValueByIndex(t)*(1+(e-1)*r))}getDrawableIds(){return this._drawableIds.slice()}getDrawableIndex(t){const e=this._model.drawables.count;for(let r=0;re&&(t=e);for(let r=0;r=h.particleCount)break;-1==c[e].destinationParameterIndex&&(c[e].destinationParameterIndex=t.getParameterIndex(c[e].destination.id));const i=new o;i.x=d[r].position.x-d[r-1].position.x,i.y=d[r].position.y-d[r-1].position.y,a=c[e].getValue(i,d,r,c[e].reflect,this._options.gravity);const n=c[e].destinationParameterIndex,s=!Float32Array.prototype.slice&&"subarray"in Float32Array.prototype?JSON.parse(JSON.stringify(p.subarray(n))):p.slice(n);Pe(s,m[n],f[n],a,c[e]);for(let t=n,e=0;t=2?e[r-1].position.substract(e[r-2].position):n.multiplyByScaler(-1),o=s.directionToRadian(n,t),i&&(o*=-1),o}function ye(t,e){return Math.abs(Math.max(t,e)-Math.min(t,e))}function xe(t,e){const r=Math.min(t,e);return r+ye(t,e)/2}function be(t,e){return t.x}function Te(t,e){return t.y}function Ee(t,e){return e}function we(t,e,r,i,n,a,u,h){let l,c,d,p,f=new o(0,0),m=new o(0,0),g=new o(0,0),v=new o(0,0);t[0].position=new o(r.x,r.y),l=s.degreesToRadian(i),p=s.radianToDirection(l),p.normalize();for(let _=1;_r&&(s>n.valueExceededMaximum&&(n.valueExceededMaximum=s),s=r),a=n.weight/he,a>=1||(s=t[0]*(1-a)+s*a),t[0]=s}function Se(t,e,r,i,n,o,a,u){let h=0;const l=s.max(r,e);lt&&(t=c);const d=s.min(n,o),p=s.max(n,o),f=a,m=xe(c,l),g=t-m;switch(Math.sign(g)){case 1:{const t=p-f,e=l-m;0!=e&&(h=g*(t/e),h+=f);break}case-1:{const t=d-f,e=c-m;0!=e&&(h=g*(t/e),h+=f);break}case 0:h=f;break;default:break}return u?h:-1*h}function Ie(){var t;null===(t=this.__moc)||void 0===t||t.release()}et["b"].cubism4=mt,Ht["a"].registerRuntime({version:4,ready:Gt,test(t){return t instanceof R||R.isValidJSON(t)},isValidMoc(t){if(t.byteLength<4)return!1;const e=new Int8Array(t,0,4);return"MOC3"===String.fromCharCode(...e)},createModelSettings(t){return new R(t)},createCoreModel(t){const e=Kt.create(t);try{const t=e.createModel();return t.__moc=e,t}catch(r){try{e.release()}catch(i){}throw r}},createInternalModel(t,e,r){const i=new kt(t,e,r),n=t;return n.__moc&&(i.__moc=n.__moc,delete n.__moc,i.once("destroy",Ie)),i},createPhysics(t,e){return ce.create(e)},createPose(t,e){return Wt.create(e)}})},function(t,e,r){"use strict";r.d(e,"a",(function(){return s})),r.d(e,"b",(function(){return f})),r.d(e,"c",(function(){return g})),r.d(e,"d",(function(){return h})),r.d(e,"e",(function(){return o})),r.d(e,"f",(function(){return d})),r.d(e,"g",(function(){return y})),r.d(e,"h",(function(){return b}));r(25),r(21);var i=r(10),n=r(1);class o extends AMotion{constructor(t){super(),this.params=[],this.setFadeIn(t.fade_in>0?t.fade_in:n["b"].expressionFadingDuration),this.setFadeOut(t.fade_out>0?t.fade_out:n["b"].expressionFadingDuration),Array.isArray(t.params)&&t.params.forEach(t=>{const e=t.calc||"add";if("add"===e){const e=t.def||0;t.val-=e}else if("mult"===e){const e=t.def||1;t.val/=e}this.params.push({calc:e,val:t.val,id:t.id})})}updateParamExe(t,e,r,i){this.params.forEach(e=>{t.setParamFloat(e.id,e.val*r)})}}class s extends i["a"]{constructor(t,e){var r;super(t,e),this.queueManager=new MotionQueueManager,this.definitions=null!==(r=this.settings.expressions)&&void 0!==r?r:[],this.init()}isFinished(){return this.queueManager.isFinished()}getExpressionIndex(t){return this.definitions.findIndex(e=>e.name===t)}getExpressionFile(t){return t.file}createExpression(t,e){return new o(t)}_setExpression(t){return this.queueManager.startMotion(t)}stopAllExpressions(){this.queueManager.stopAllMotions()}updateParameters(t,e){return this.queueManager.updateParam(t)}}var a=r(13),u=r(12);class h extends u["a"]{constructor(t,e){super(t,e),this.groups={idle:"idle"},this.motionDataType="arraybuffer",this.queueManager=new MotionQueueManager,this.definitions=this.settings.motions,this.init(e)}init(t){super.init(t),this.settings.expressions&&(this.expressionManager=new s(this.settings,t))}isFinished(){return this.queueManager.isFinished()}createMotion(t,e,r){const i=Live2DMotion.loadMotion(t),o=e===this.groups.idle?n["b"].idleMotionFadingDuration:n["b"].motionFadingDuration;return i.setFadeIn(r.fade_in>0?r.fade_in:o),i.setFadeOut(r.fade_out>0?r.fade_out:o),i}getMotionFile(t){return t.file}getMotionName(t){return t.file}getSoundFile(t){return t.sound}_startMotion(t,e){return t.onFinishHandler=e,this.queueManager.stopAllMotions(),this.queueManager.startMotion(t)}_stopAllMotions(){this.queueManager.stopAllMotions()}updateParameters(t,e){return this.queueManager.updateParam(t)}destroy(){super.destroy(),this.queueManager=void 0}}var l,c=r(0);(function(t){t[t["Idle"]=0]="Idle",t[t["Closing"]=1]="Closing",t[t["Closed"]=2]="Closed",t[t["Opening"]=3]="Opening"})(l||(l={}));class d{constructor(t){this.coreModel=t,this.blinkInterval=4e3,this.closingDuration=100,this.closedDuration=50,this.openingDuration=150,this.eyeState=l.Idle,this.eyeParamValue=1,this.closedTimer=0,this.nextBlinkTimeLeft=this.blinkInterval,this.leftParam=t.getParamIndex("PARAM_EYE_L_OPEN"),this.rightParam=t.getParamIndex("PARAM_EYE_R_OPEN")}setEyeParams(t){this.eyeParamValue=Object(c["b"])(t,0,1),this.coreModel.setParamFloat(this.leftParam,this.eyeParamValue),this.coreModel.setParamFloat(this.rightParam,this.eyeParamValue)}update(t){switch(this.eyeState){case l.Idle:this.nextBlinkTimeLeft-=t,this.nextBlinkTimeLeft<0&&(this.eyeState=l.Closing,this.nextBlinkTimeLeft=this.blinkInterval+this.closingDuration+this.closedDuration+this.openingDuration+Object(c["g"])(0,2e3));break;case l.Closing:this.setEyeParams(this.eyeParamValue+t/this.closingDuration),this.eyeParamValue<=0&&(this.eyeState=l.Closed,this.closedTimer=0);break;case l.Closed:this.closedTimer+=t,this.closedTimer>=this.closedDuration&&(this.eyeState=l.Opening);break;case l.Opening:this.setEyeParams(this.eyeParamValue+t/this.openingDuration),this.eyeParamValue>=1&&(this.eyeState=l.Idle)}}}const p=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);class f extends a["a"]{constructor(t,e,r){super(),this.textureFlipY=!0,this.drawDataCount=0,this.disableCulling=!1,this.coreModel=t,this.settings=e,this.motionManager=new h(e,r),this.eyeBlink=new d(t),this.eyeballXParamIndex=t.getParamIndex("PARAM_EYE_BALL_X"),this.eyeballYParamIndex=t.getParamIndex("PARAM_EYE_BALL_Y"),this.angleXParamIndex=t.getParamIndex("PARAM_ANGLE_X"),this.angleYParamIndex=t.getParamIndex("PARAM_ANGLE_Y"),this.angleZParamIndex=t.getParamIndex("PARAM_ANGLE_Z"),this.bodyAngleXParamIndex=t.getParamIndex("PARAM_BODY_ANGLE_X"),this.breathParamIndex=t.getParamIndex("PARAM_BREATH"),this.init()}init(){super.init(),this.settings.initParams&&this.settings.initParams.forEach(({id:t,value:e})=>this.coreModel.setParamFloat(t,e)),this.settings.initOpacities&&this.settings.initOpacities.forEach(({id:t,value:e})=>this.coreModel.setPartsOpacity(t,e)),this.coreModel.saveParam();const t=this.coreModel.getModelContext()._$aS;(null===t||void 0===t?void 0:t.length)&&(this.drawDataCount=t.length);let e=this.coreModel.drawParamWebGL.culling;Object.defineProperty(this.coreModel.drawParamWebGL,"culling",{set:t=>e=t,get:()=>!this.disableCulling&&e});const r=this.coreModel.getModelContext().clipManager,i=r.setupClip;r.setupClip=(t,e)=>{i.call(r,t,e),e.gl.viewport(...this.viewport)}}getSize(){return[this.coreModel.getCanvasWidth(),this.coreModel.getCanvasHeight()]}getLayout(){const t=this.settings.layout||{};return Object.assign(Object.assign({},t),{centerX:t.center_x,centerY:t.center_y})}updateWebGLContext(t,e){const r=this.coreModel.drawParamWebGL;r.firstDraw=!0,r.setGL(t),r.glno=e;for(const o in r)r.hasOwnProperty(o)&&r[o]instanceof WebGLBuffer&&(r[o]=null);const i=this.coreModel.getModelContext().clipManager;i.curFrameNo=e;const n=t.getParameter(t.FRAMEBUFFER_BINDING);i.getMaskRenderTexture(),t.bindFramebuffer(t.FRAMEBUFFER,n)}bindTexture(t,e){this.coreModel.setTexture(t,e)}getHitAreaDefs(){var t;return(null===(t=this.settings.hitAreas)||void 0===t?void 0:t.map(t=>({id:t.id,name:t.name,index:this.coreModel.getDrawDataIndex(t.id)})))||[]}getDrawableIDs(){const t=this.coreModel.getModelContext(),e=[];for(let r=0;r0&&t.textures.every(t=>"string"===typeof t)}copy(t){Object(c["d"])("string",t,this,"name","name"),Object(c["d"])("string",t,this,"pose","pose"),Object(c["d"])("string",t,this,"physics","physics"),Object(c["d"])("object",t,this,"layout","layout"),Object(c["d"])("object",t,this,"motions","motions"),Object(c["c"])("object",t,this,"hit_areas","hitAreas"),Object(c["c"])("object",t,this,"expressions","expressions"),Object(c["c"])("object",t,this,"init_params","initParams"),Object(c["c"])("object",t,this,"init_opacities","initOpacities")}replaceFiles(t){super.replaceFiles(t);for(const[e,r]of Object.entries(this.motions))for(let i=0;i{const e=new PhysicsHair;return e.setup(t.setup.length,t.setup.regist,t.setup.mass),t.src.forEach(({id:t,ptype:r,scale:i,weight:n})=>{const o=v[r];o&&e.addSrcParam(o,t,i,n)}),t.targets.forEach(({id:t,ptype:r,scale:i,weight:n})=>{const o=_[r];o&&e.addTargetParam(o,t,i,n)}),e}))}update(t){this.physicsHairs.forEach(e=>e.update(this.coreModel,t))}}class x{constructor(t){this.id=t,this.paramIndex=-1,this.partsIndex=-1,this.link=[]}initIndex(t){this.paramIndex=t.getParamIndex("VISIBLE:"+this.id),this.partsIndex=t.getPartsDataIndex(PartsDataID.getID(this.id)),t.setParamFloat(this.paramIndex,1)}}class b{constructor(t,e){this.coreModel=t,this.opacityAnimDuration=500,this.partsGroups=[],e.parts_visible&&(this.partsGroups=e.parts_visible.map(({group:t})=>t.map(({id:t,link:e})=>{const r=new x(t);return e&&(r.link=e.map(t=>new x(t))),r})),this.init())}init(){this.partsGroups.forEach(t=>{t.forEach(t=>{if(t.initIndex(this.coreModel),t.paramIndex>=0){const e=0!==this.coreModel.getParamFloat(t.paramIndex);this.coreModel.setPartsOpacity(t.partsIndex,e?1:0),this.coreModel.setParamFloat(t.paramIndex,e?1:0),t.link.length>0&&t.link.forEach(t=>t.initIndex(this.coreModel))}})})}normalizePartsOpacityGroup(t,e){const r=this.coreModel,i=.5,n=.15;let o=1,s=t.findIndex(({paramIndex:t,partsIndex:e})=>e>=0&&0!==r.getParamFloat(t));if(s>=0){const i=r.getPartsOpacity(t[s].partsIndex);o=Object(c["b"])(i+e/this.opacityAnimDuration,0,1)}else s=0,o=1;t.forEach(({partsIndex:t},e)=>{if(t>=0)if(s==e)r.setPartsOpacity(t,o);else{let e,s=r.getPartsOpacity(t);e=on&&(e=1-n/(1-o)),s>e&&(s=e),r.setPartsOpacity(t,s)}})}copyOpacity(t){const e=this.coreModel;t.forEach(({partsIndex:t,link:r})=>{if(t>=0&&r){const i=e.getPartsOpacity(t);r.forEach(({partsIndex:t})=>{t>=0&&e.setPartsOpacity(t,i)})}})}update(t){this.partsGroups.forEach(e=>{this.normalizePartsOpacityGroup(e,t),this.copyOpacity(e)})}}var T=r(4);T["a"].registerRuntime({version:2,test(t){return t instanceof g||g.isValidJSON(t)},ready(){return Promise.resolve()},isValidMoc(t){if(t.byteLength<3)return!1;const e=new Int8Array(t,0,3);return"moc"===String.fromCharCode(...e)},createModelSettings(t){return new g(t)},createCoreModel(t){const e=Live2DModelWebGL.loadModel(t),r=Live2D.getError();if(r)throw r;return e},createInternalModel(t,e,r){return new f(t,e,r)},createPose(t,e){return new b(t,e)},createPhysics(t,e){return new y(t,e)}})},function(t,e){t.exports=o},function(t,e,r){"use strict";if(!window.Live2D)throw new Error("Cannot find Cubism 2 runtime. Did you forget to include the live2d.min.js?")},function(t,e,r){"use strict";if(!window.Live2DCubismCore)throw new Error("Cannot find Cubism 4 runtime. Did you forget to include the live2dcubismcore.min.js?")},function(t,e,r){"use strict";r.r(e);var i=r(18);r.d(e,"LOGICAL_WIDTH",(function(){return i["g"]})),r.d(e,"LOGICAL_HEIGHT",(function(){return i["f"]})),r.d(e,"ExpressionManager",(function(){return i["a"]})),r.d(e,"FocusController",(function(){return i["c"]})),r.d(e,"ModelSettings",(function(){return i["l"]})),r.d(e,"MotionPriority",(function(){return i["o"]})),r.d(e,"MotionState",(function(){return i["p"]})),r.d(e,"MotionPreloadStrategy",(function(){return i["n"]})),r.d(e,"MotionManager",(function(){return i["m"]})),r.d(e,"SoundManager",(function(){return i["q"]})),r.d(e,"InternalModel",(function(){return i["e"]})),r.d(e,"Live2DModel",(function(){return i["j"]})),r.d(e,"Live2DTransform",(function(){return i["k"]})),r.d(e,"InteractionMixin",(function(){return i["d"]})),r.d(e,"config",(function(){return i["w"]})),r.d(e,"VERSION",(function(){return i["r"]})),r.d(e,"Live2DFactory",(function(){return i["h"]})),r.d(e,"Live2DLoader",(function(){return i["i"]})),r.d(e,"XHRLoader",(function(){return i["s"]})),r.d(e,"FileLoader",(function(){return i["b"]})),r.d(e,"ZipLoader",(function(){return i["t"]})),r.d(e,"logger",(function(){return i["A"]})),r.d(e,"clamp",(function(){return i["v"]})),r.d(e,"rand",(function(){return i["B"]})),r.d(e,"copyProperty",(function(){return i["y"]})),r.d(e,"copyArray",(function(){return i["x"]})),r.d(e,"applyMixins",(function(){return i["u"]})),r.d(e,"folderName",(function(){return i["z"]}));var n=r(23);r.d(e,"Cubism2ExpressionManager",(function(){return n["a"]})),r.d(e,"Cubism2InternalModel",(function(){return n["b"]})),r.d(e,"Cubism2ModelSettings",(function(){return n["c"]})),r.d(e,"Cubism2MotionManager",(function(){return n["d"]})),r.d(e,"Live2DExpression",(function(){return n["e"]})),r.d(e,"Live2DEyeBlink",(function(){return n["f"]})),r.d(e,"Live2DPhysics",(function(){return n["g"]})),r.d(e,"Live2DPose",(function(){return n["h"]}));var o=r(22);r.d(e,"Cubism4ExpressionManager",(function(){return o["a"]})),r.d(e,"Cubism4ModelSettings",(function(){return o["c"]})),r.d(e,"Cubism4MotionManager",(function(){return o["d"]})),r.d(e,"Cubism4InternalModel",(function(){return o["b"]})),r.d(e,"cubism4Ready",(function(){return o["e"]})),r.d(e,"startUpCubism4",(function(){return o["f"]}))}])}))},"097b":function(t,e,r){var i=r("d032"),n="__lodash_hash_undefined__",o=Object.prototype,s=o.hasOwnProperty;function a(t){var e=this.__data__;if(i){var r=e[t];return r===n?void 0:r}return s.call(e,t)?e[t]:void 0}t.exports=a},"0a2d":function(t,e){function r(t,e){var r=-1,i=null==t?0:t.length,n=0,o=[];while(++r",'"',"`"," ","\r","\n","\t"],l=["{","}","|","\\","^","`"].concat(h),c=["'"].concat(l),d=["%","/","?",";","#"].concat(c),p=["/","?","#"],f=255,m=/^[+a-z0-9A-Z_-]{0,63}$/,g=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},_={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},x=r("b383");function b(t,e,r){if(t&&n.isObject(t)&&t instanceof o)return t;var i=new o;return i.parse(t,e,r),i}function T(t){return n.isString(t)&&(t=b(t)),t instanceof o?t.format():o.prototype.format.call(t)}function E(t,e){return b(t,!1,!0).resolve(e)}function w(t,e){return t?b(t,!1,!0).resolveObject(e):e}o.prototype.parse=function(t,e,r){if(!n.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),a=-1!==o&&o127?F+="x":F+=L[N];if(!F.match(m)){var U=D.slice(0,O),k=D.slice(O+1),j=L.match(g);j&&(U.push(j[1]),k.unshift(j[2])),k.length&&(b="/"+k.join(".")+b),this.hostname=U.join(".");break}}}this.hostname.length>f?this.hostname="":this.hostname=this.hostname.toLowerCase(),A||(this.hostname=i.toASCII(this.hostname));var X=this.port?":"+this.port:"",G=this.hostname||"";this.host=G+X,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!v[w])for(O=0,R=c.length;O0)&&r.host.split("@");P&&(r.auth=P.shift(),r.host=r.hostname=P.shift())}return r.search=t.search,r.query=t.query,n.isNull(r.pathname)&&n.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!E.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var S=E.slice(-1)[0],I=(r.host||t.host||E.length>1)&&("."===S||".."===S)||""===S,M=0,O=E.length;O>=0;O--)S=E[O],"."===S?E.splice(O,1):".."===S?(E.splice(O,1),M++):M&&(E.splice(O,1),M--);if(!b&&!T)for(;M--;M)E.unshift("..");!b||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),I&&"/"!==E.join("/").substr(-1)&&E.push("");var C=""===E[0]||E[0]&&"/"===E[0].charAt(0);if(w){r.hostname=r.host=C?"":E.length?E.shift():"";P=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");P&&(r.auth=P.shift(),r.host=r.hostname=P.shift())}return b=b||r.host&&E.length,b&&!C&&E.unshift(""),E.length?r.pathname=E.join("/"):(r.pathname=null,r.path=null),n.isNull(r.pathname)&&n.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},"0c17":function(t,e){function r(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}t.exports=r},"0ce9":function(t,e,r){var i=r("fc7e"),n=r("5ca3"),o=r("7103"),s=200;function a(t,e){var r=this.__data__;if(r instanceof i){var a=r.__data__;if(!n||a.length-1)p!==t&&h.call(p,f,1),h.call(t,f,1)}return t}t.exports=l},"13ab":function(t,e,r){var i=r("d032"),n="__lodash_hash_undefined__";function o(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=i&&void 0===e?n:e,this}t.exports=o},"142c":function(t,e,r){var i=r("28f4"),n=i.Uint8Array;t.exports=n},"15e0":function(t,e,r){var i=r("c3ce");function n(t){return function(e){return i(e,t)}}t.exports=n},1642:function(t,e){function r(t,e){var r=-1,i=null==t?0:t.length;while(++r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=h-l,T=Math.floor,E=String.fromCharCode;function w(t){throw new RangeError(x[t])}function P(t,e){var r=t.length,i=[];while(r--)i[r]=e(t[r]);return i}function S(t,e){var r=t.split("@"),i="";r.length>1&&(i=r[0]+"@",t=r[1]),t=t.replace(y,".");var n=t.split("."),o=P(n,e).join(".");return i+o}function I(t){var e,r,i=[],n=0,o=t.length;while(n=55296&&e<=56319&&n65535&&(t-=65536,e+=E(t>>>10&1023|55296),t=56320|1023&t),e+=E(t),e})).join("")}function O(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:h}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function A(t,e,r){var i=0;for(t=r?T(t/p):t>>1,t+=T(t/e);t>b*c>>1;i+=h)t=T(t/b);return T(i+(b+1)*t/(t+d))}function D(t){var e,r,i,n,o,s,a,d,p,v,_=[],y=t.length,x=0,b=m,E=f;for(r=t.lastIndexOf(g),r<0&&(r=0),i=0;i=128&&w("not-basic"),_.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=y&&w("invalid-input"),d=O(t.charCodeAt(n++)),(d>=h||d>T((u-x)/s))&&w("overflow"),x+=d*s,p=a<=E?l:a>=E+c?c:a-E,dT(u/v)&&w("overflow"),s*=v}e=_.length+1,E=A(x-o,e,0==o),T(x/e)>u-b&&w("overflow"),b+=T(x/e),x%=e,_.splice(x++,0,b)}return M(_)}function R(t){var e,r,i,n,o,s,a,d,p,v,_,y,x,b,P,S=[];for(t=I(t),y=t.length,e=m,r=0,o=f,s=0;s=e&&_T((u-r)/x)&&w("overflow"),r+=(a-e)*x,e=a,s=0;su&&w("overflow"),_==e){for(d=r,p=h;;p+=h){if(v=p<=o?l:p>=o+c?c:p-o,d0){if(++e>=r)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}t.exports=o},"0758":function(t,e,r){var i=r("28f4"),n=i["__core-js_shared__"];t.exports=n},"08bb":function(t,e,r){var i=r("d032");function n(){this.__data__=i?i(null):{},this.size=0}t.exports=n},"09492":function(t,e,r){(function(e,i){t.exports=i(r("aa81"),r("d3fc"),r("c29d"),r("21bf"),r("9ac0"),r("733a"))})(window,(function(t,e,r,i,n,o){return function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=27)}([function(t,e,r){"use strict";r.d(e,"f",(function(){return i})),r.d(e,"b",(function(){return o})),r.d(e,"g",(function(){return s})),r.d(e,"d",(function(){return a})),r.d(e,"c",(function(){return u})),r.d(e,"a",(function(){return h})),r.d(e,"e",(function(){return l}));var i,n=r(1);function o(t,e,r){return tr?r:t}function s(t,e){return Math.random()*(e-t)+t}function a(t,e,r,i,n){const o=e[i];null!==o&&typeof o===t&&(r[n]=o)}function u(t,e,r,i,n){const o=e[i];Array.isArray(o)&&(r[n]=o.filter(e=>null!==e&&typeof e===t))}function h(t,e){e.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(r=>{"constructor"!==r&&Object.defineProperty(t.prototype,r,Object.getOwnPropertyDescriptor(e.prototype,r))})})}function l(t){let e=t.lastIndexOf("/");return-1!=e&&(t=t.slice(0,e)),e=t.lastIndexOf("/"),-1!==e&&(t=t.slice(e+1)),t}(function(t){function e(t,...e){n["b"].logLevel<=n["b"].LOG_LEVEL_VERBOSE&&console.log(`[${t}]`,...e)}function r(t,...e){n["b"].logLevel<=n["b"].LOG_LEVEL_WARNING&&console.warn(`[${t}]`,...e)}function i(t,...e){n["b"].logLevel<=n["b"].LOG_LEVEL_ERROR&&console.error(`[${t}]`,...e)}t.log=e,t.warn=r,t.error=i})(i||(i={}))},function(t,e,r){"use strict";var i;r.d(e,"b",(function(){return i})),r.d(e,"a",(function(){return n})),function(t){t.LOG_LEVEL_VERBOSE=0,t.LOG_LEVEL_WARNING=1,t.LOG_LEVEL_ERROR=2,t.LOG_LEVEL_NONE=999,t.logLevel=t.LOG_LEVEL_WARNING,t.sound=!0,t.motionSync=!0,t.motionFadingDuration=500,t.idleMotionFadingDuration=2e3,t.expressionFadingDuration=500}(i||(i={}));const n="0.3.1"},function(e,r){e.exports=t},function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var i=r(15),n=r(16);class o{static load(t){return Object(n["a"])(this.middlewares,t).then(()=>t.result)}}o.middlewares=[i["a"].loader]},function(t,e,r){"use strict";r.d(e,"a",(function(){return _}));var i=r(6),n=r(3),o=r(0),s=r(16),a=r(17);function u(t,e={}){var r;const i={resourceOptions:{crossorigin:e.crossOrigin}};if(a["Texture"].fromURL)return a["Texture"].fromURL(t,i).catch(t=>{if(t instanceof Error)throw t;const e=new Error("Texture loading error");throw e.event=t,e});i.resourceOptions.autoLoad=!1;const n=a["Texture"].from(t,i);if(n.baseTexture.valid)return Promise.resolve(n);const o=n.baseTexture.resource;return null!==(r=o._live2d_load)&&void 0!==r||(o._live2d_load=new Promise((t,e)=>{const r=t=>{o.source.removeEventListener("error",r);const i=new Error("Texture loading error");i.event=t,e(i)};o.source.addEventListener("error",r),o.load().then(()=>t(n)).catch(r)})),o._live2d_load}var h=function(t,e,r,i){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,o){function s(t){try{u(i.next(t))}catch(e){o(e)}}function a(t){try{u(i["throw"](t))}catch(e){o(e)}}function u(t){t.done?r(t.value):n(t.value).then(s,a)}u((i=i.apply(t,e||[])).next())}))};const l="Live2DFactory",c=(t,e)=>h(void 0,void 0,void 0,(function*(){if("string"===typeof t.source){const e=yield n["a"].load({url:t.source,type:"json",target:t.live2dModel});e.url=t.source,t.source=e,t.live2dModel.emit("settingsJSONLoaded",e)}return e()})),d=(t,e)=>h(void 0,void 0,void 0,(function*(){if(t.source instanceof i["f"])return t.settings=t.source,e();if("object"===typeof t.source){const r=_.findRuntime(t.source);if(r){const i=r.createModelSettings(t.source);return t.settings=i,t.live2dModel.emit("settingsLoaded",i),e()}}throw new TypeError("Unknown settings format.")})),p=(t,e)=>{if(t.settings){const r=_.findRuntime(t.settings);if(r)return r.ready().then(e)}return e()},f=(t,e)=>h(void 0,void 0,void 0,(function*(){yield e();const r=t.internalModel;if(r){const e=t.settings,i=_.findRuntime(e);if(i){const s=[];e.pose&&s.push(n["a"].load({settings:e,url:e.pose,type:"json",target:r}).then(e=>{r.pose=i.createPose(r.coreModel,e),t.live2dModel.emit("poseLoaded",r.pose)}).catch(t=>o["f"].warn(l,"Failed to load pose.\n",t))),e.physics&&s.push(n["a"].load({settings:e,url:e.physics,type:"json",target:r}).then(e=>{r.physics=i.createPhysics(r.coreModel,e),t.live2dModel.emit("physicsLoaded",r.physics)}).catch(t=>o["f"].warn(l,"Failed to load physics.\n",t))),s.length&&(yield Promise.all(s))}}})),m=(t,e)=>h(void 0,void 0,void 0,(function*(){if(!t.settings)throw new TypeError("Missing settings.");{const r=t.live2dModel,i=t.settings.textures.map(e=>{const r=t.settings.resolveURL(e);return u(r,{crossOrigin:t.options.crossOrigin})});if(yield e(),!t.internalModel)throw new TypeError("Missing internal model.");r.internalModel=t.internalModel,r.emit("modelLoaded",t.internalModel),r.textures=yield Promise.all(i),r.emit("textureLoaded",r.textures)}})),g=(t,e)=>h(void 0,void 0,void 0,(function*(){const r=t.settings;if(r instanceof i["f"]){const i=_.findRuntime(r);if(!i)throw new TypeError("Unknown model settings.");const o=yield n["a"].load({settings:r,url:r.moc,type:"arraybuffer",target:t.live2dModel});if(!i.isValidMoc(o))throw new Error("Invalid moc data");const s=i.createCoreModel(o);return t.internalModel=i.createInternalModel(s,r,t.options),e()}throw new TypeError("Missing settings.")}));var v=function(t,e,r,i){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,o){function s(t){try{u(i.next(t))}catch(e){o(e)}}function a(t){try{u(i["throw"](t))}catch(e){o(e)}}function u(t){t.done?r(t.value):n(t.value).then(s,a)}u((i=i.apply(t,e||[])).next())}))};class _{static registerRuntime(t){_.runtimes.push(t),_.runtimes.sort((t,e)=>e.version-t.version)}static findRuntime(t){for(const e of _.runtimes)if(e.test(t))return e}static setupLive2DModel(t,e,r){return v(this,void 0,void 0,(function*(){const i=new Promise(e=>t.once("textureLoaded",e)),n=new Promise(e=>t.once("modelLoaded",e)),o=Promise.all([i,n]).then(()=>t.emit("ready"));yield Object(s["a"])(_.live2DModelMiddlewares,{live2dModel:t,source:e,options:r||{}}),yield o,t.emit("load")}))}static loadMotion(t,e,r){var i,s;const a=i=>t.emit("motionLoadError",e,r,i);try{const u=null===(i=t.definitions[e])||void 0===i?void 0:i[r];if(!u)return Promise.resolve(void 0);t.listeners("destroy").includes(_.releaseTasks)||t.once("destroy",_.releaseTasks);let h=_.motionTasksMap.get(t);h||(h={},_.motionTasksMap.set(t,h));let l=h[e];l||(l=[],h[e]=l);const c=t.getMotionFile(u);return null!==(s=l[r])&&void 0!==s||(l[r]=n["a"].load({url:c,settings:t.settings,type:t.motionDataType,target:t}).then(i=>{var n;const o=null===(n=_.motionTasksMap.get(t))||void 0===n?void 0:n[e];o&&delete o[r];const s=t.createMotion(i,e,u);return t.emit("motionLoaded",e,r,s),s}).catch(e=>{o["f"].warn(t.tag,`Failed to load motion: ${c}\n`,e),a(e)})),l[r]}catch(u){o["f"].warn(t.tag,`Failed to load motion at "${e}"[${r}]\n`,u),a(u)}return Promise.resolve(void 0)}static loadExpression(t,e){var r;const i=r=>t.emit("expressionLoadError",e,r);try{const s=t.definitions[e];if(!s)return Promise.resolve(void 0);t.listeners("destroy").includes(_.releaseTasks)||t.once("destroy",_.releaseTasks);let a=_.expressionTasksMap.get(t);a||(a=[],_.expressionTasksMap.set(t,a));const u=t.getExpressionFile(s);return null!==(r=a[e])&&void 0!==r||(a[e]=n["a"].load({url:u,settings:t.settings,type:"json",target:t}).then(r=>{const i=_.expressionTasksMap.get(t);i&&delete i[e];const n=t.createExpression(r,s);return t.emit("expressionLoaded",e,n),n}).catch(e=>{o["f"].warn(t.tag,`Failed to load expression: ${u}\n`,e),i(e)})),a[e]}catch(s){o["f"].warn(t.tag,`Failed to load expression at [${e}]\n`,s),i(s)}return Promise.resolve(void 0)}static releaseTasks(){this instanceof i["g"]?_.motionTasksMap.delete(this):_.expressionTasksMap.delete(this)}}_.runtimes=[],_.urlToJSON=c,_.jsonToSettings=d,_.waitUntilReady=p,_.setupOptionals=f,_.setupEssentials=m,_.createInternalModel=g,_.live2DModelMiddlewares=[c,d,p,f,m,g],_.motionTasksMap=new WeakMap,_.expressionTasksMap=new WeakMap,i["g"].prototype._loadMotion=function(t,e){return _.loadMotion(this,t,e)},i["a"].prototype._loadExpression=function(t){return _.loadExpression(this,t)}},function(t,r){t.exports=e},function(t,e,r){"use strict";var i=r(8);r.d(e,"d",(function(){return i["a"]})),r.d(e,"e",(function(){return i["b"]}));var n=r(10);r.d(e,"a",(function(){return n["a"]}));var o=r(14);r.d(e,"b",(function(){return o["a"]}));var s=r(11);r.d(e,"f",(function(){return s["a"]}));var a=r(9);r.d(e,"i",(function(){return a["a"]})),r.d(e,"j",(function(){return a["b"]}));var u=r(12);r.d(e,"g",(function(){return u["a"]})),r.d(e,"h",(function(){return u["b"]}));var h=r(7);r.d(e,"k",(function(){return h["a"]}));var l=r(13);r.d(e,"c",(function(){return l["a"]}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return u}));var i=r(0),n=r(19),o=r.n(n);const s="SoundManager",a=.5;class u{static get volume(){return this._volume}static set volume(t){this._volume=(t>1?1:t<0?0:t)||0,this.audios.forEach(t=>t.volume=this._volume)}static add(t,e,r){const n=new Audio(t);return n.volume=this._volume,n.preload="auto",n.addEventListener("ended",()=>{this.dispose(n),null===e||void 0===e||e()}),n.addEventListener("error",e=>{this.dispose(n),i["f"].warn(s,`Error occurred on "${t}"`,e.error),null===r||void 0===r||r(e.error)}),this.audios.push(n),n}static play(t){return new Promise((e,r)=>{var i;null===(i=t.play())||void 0===i||i.catch(e=>{t.dispatchEvent(new ErrorEvent("error",{error:e})),r(e)}),t.readyState===t.HAVE_ENOUGH_DATA?e():t.addEventListener("canplaythrough",e)})}static dispose(t){t.pause(),t.removeAttribute("src"),o()(this.audios,t)}static destroy(){for(let t=this.audios.length-1;t>=0;t--)this.dispose(this.audios[t])}}u.audios=[],u._volume=a},function(t,e,r){"use strict";r.d(e,"b",(function(){return i})),r.d(e,"a",(function(){return n}));const i=2,n=2},function(t,e,r){"use strict";r.d(e,"a",(function(){return i})),r.d(e,"b",(function(){return o}));var i,n=r(0);(function(t){t[t["NONE"]=0]="NONE",t[t["IDLE"]=1]="IDLE",t[t["NORMAL"]=2]="NORMAL",t[t["FORCE"]=3]="FORCE"})(i||(i={}));class o{constructor(){this.debug=!1,this.currentPriority=i.NONE,this.reservePriority=i.NONE}reserve(t,e,r){if(r<=i.NONE)return n["f"].log(this.tag,"Cannot start a motion with MotionPriority.NONE."),!1;if(t===this.currentGroup&&e===this.currentIndex)return n["f"].log(this.tag,"Motion is already playing.",this.dump(t,e)),!1;if(t===this.reservedGroup&&e===this.reservedIndex||t===this.reservedIdleGroup&&e===this.reservedIdleIndex)return n["f"].log(this.tag,"Motion is already reserved.",this.dump(t,e)),!1;if(r===i.IDLE){if(this.currentPriority!==i.NONE)return n["f"].log(this.tag,"Cannot start idle motion because another motion is playing.",this.dump(t,e)),!1;if(void 0!==this.reservedIdleGroup)return n["f"].log(this.tag,"Cannot start idle motion because another idle motion has reserved.",this.dump(t,e)),!1;this.setReservedIdle(t,e)}else{if(ri.IDLE}dump(t,e){if(this.debug){const r=["currentPriority","reservePriority","currentGroup","currentIndex","reservedGroup","reservedIndex","reservedIdleGroup","reservedIdleIndex"];return`\n group = "${t}", index = ${e}\n`+r.map(t=>"["+t+"] "+this[t]).join("\n")}return""}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return s}));var i=r(0),n=r(2),o=function(t,e,r,i){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,o){function s(t){try{u(i.next(t))}catch(e){o(e)}}function a(t){try{u(i["throw"](t))}catch(e){o(e)}}function u(t){t.done?r(t.value):n(t.value).then(s,a)}u((i=i.apply(t,e||[])).next())}))};class s extends n["EventEmitter"]{constructor(t,e){super(),this.expressions=[],this.reserveExpressionIndex=-1,this.destroyed=!1,this.settings=t,this.tag=`ExpressionManager(${t.name})`}init(){this.defaultExpression=this.createExpression({},void 0),this.currentExpression=this.defaultExpression,this.stopAllExpressions()}loadExpression(t){return o(this,void 0,void 0,(function*(){if(!this.definitions[t])return void i["f"].warn(this.tag,`Undefined expression at [${t}]`);if(null===this.expressions[t])return void i["f"].warn(this.tag,`Cannot set expression at [${t}] because it's already failed in loading.`);if(this.expressions[t])return this.expressions[t];const e=yield this._loadExpression(t);return this.expressions[t]=e,e}))}_loadExpression(t){throw new Error("Not implemented.")}setRandomExpression(){return o(this,void 0,void 0,(function*(){if(this.definitions.length){const t=[];for(let e=0;e-1&&t(t.push(e),e)),t}validateFiles(t){const e=(e,r)=>{const i=this.resolveURL(e);if(!t.includes(i)){if(r)throw new Error(`File "${e}" is defined in settings, but doesn't exist in given files`);return!1}return!0},r=[this.moc,...this.textures];r.forEach(t=>e(t,!0));const i=this.getDefinedFiles();return i.filter(t=>e(t,!1))}}},function(t,e,r){"use strict";r.d(e,"b",(function(){return i})),r.d(e,"a",(function(){return l}));var i,n=r(1),o=r(9),s=r(7),a=r(0),u=r(2),h=function(t,e,r,i){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,o){function s(t){try{u(i.next(t))}catch(e){o(e)}}function a(t){try{u(i["throw"](t))}catch(e){o(e)}}function u(t){t.done?r(t.value):n(t.value).then(s,a)}u((i=i.apply(t,e||[])).next())}))};(function(t){t["ALL"]="ALL",t["IDLE"]="IDLE",t["NONE"]="NONE"})(i||(i={}));class l extends u["EventEmitter"]{constructor(t,e){super(),this.motionGroups={},this.state=new o["b"],this.playing=!1,this.destroyed=!1,this.settings=t,this.tag=`MotionManager(${t.name})`,this.state.tag=this.tag}init(t){(null===t||void 0===t?void 0:t.idleMotionGroup)&&(this.groups.idle=t.idleMotionGroup),this.setupMotions(t),this.stopAllMotions()}setupMotions(t){for(const r of Object.keys(this.definitions))this.motionGroups[r]=[];let e;switch(null===t||void 0===t?void 0:t.motionPreload){case i.NONE:return;case i.ALL:e=Object.keys(this.definitions);break;case i.IDLE:default:e=[this.groups.idle];break}for(const r of e)if(this.definitions[r])for(let t=0;tthis.currentAudio=void 0,()=>this.currentAudio=void 0),this.currentAudio=u}catch(l){a["f"].warn(this.tag,"Failed to create audio",t,l)}}const h=yield this.loadMotion(t,e);if(u){const t=s["a"].play(u).catch(t=>a["f"].warn(this.tag,"Failed to play audio",u.src,t));n["b"].motionSync&&(yield t)}return this.state.start(h,t,e,r)?(a["f"].log(this.tag,"Start motion:",this.getMotionName(o)),this.emit("motionStart",t,e,u),this.state.shouldOverrideExpression()&&this.expressionManager&&this.expressionManager.resetExpression(),this.playing=!0,this._startMotion(h),!0):(u&&(s["a"].dispose(u),this.currentAudio=void 0),!1)}))}startRandomMotion(t,e){return h(this,void 0,void 0,(function*(){const r=this.definitions[t];if(null===r||void 0===r?void 0:r.length){const i=[];for(let e=0;et.index>=0);for(const e of t)this.hitAreas[e.name]=e}hitTest(t,e){return Object.keys(this.hitAreas).filter(r=>this.isHit(r,t,e))}isHit(t,e,r){if(!this.hitAreas[t])return!1;const i=this.hitAreas[t].index,n=this.getDrawableBounds(i,a);return n.x<=e&&e<=n.x+n.width&&n.y<=r&&r<=n.y+n.height}getDrawableBounds(t,e){const r=this.getDrawableVertices(t);let i=r[0],n=r[0],o=r[1],s=r[1];for(let a=0;ac&&(u*=c/l,h*=c/l),this.vx+=u,this.vy+=h;const d=Math.sqrt(Math.pow(this.vx,2)+Math.pow(this.vy,2)),p=.5*(Math.sqrt(Math.pow(c,2)+8*c*i)-c);d>p&&(this.vx*=p/d,this.vy*=p/d),this.x+=this.vx,this.y+=this.vy}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return s}));var i=r(0);const n="XHRLoader";class o extends Error{constructor(t,e,r,i=!1){super(t),this.url=e,this.status=r,this.aborted=i}}class s{static createXHR(t,e,r,a,u){const h=new XMLHttpRequest;if(s.allXhrSet.add(h),t){let e=s.xhrMap.get(t);e?e.add(h):(e=new Set([h]),s.xhrMap.set(t,e)),t.listeners("destroy").includes(s.cancelXHRs)||t.once("destroy",s.cancelXHRs)}return h.open("GET",e),h.responseType=r,h.onload=()=>{200!==h.status&&0!==h.status||!h.response?h.onerror():a(h.response)},h.onerror=()=>{i["f"].warn(n,`Failed to load resource as ${h.responseType} (Status ${h.status}): ${e}`),u(new o("Network error.",e,h.status))},h.onabort=()=>u(new o("Aborted.",e,h.status,!0)),h.onloadend=()=>{var e;s.allXhrSet.delete(h),t&&(null===(e=s.xhrMap.get(t))||void 0===e||e.delete(h))},h}static cancelXHRs(){var t;null===(t=s.xhrMap.get(this))||void 0===t||t.forEach(t=>{t.abort(),s.allXhrSet.delete(t)}),s.xhrMap.delete(this)}static release(){s.allXhrSet.forEach(t=>t.abort()),s.allXhrSet.clear(),s.xhrMap=new WeakMap}}s.xhrMap=new WeakMap,s.allXhrSet=new Set,s.loader=(t,e)=>new Promise((e,r)=>{const i=s.createXHR(t.target,t.settings?t.settings.resolveURL(t.url):t.url,t.type,r=>{t.result=r,e()},r);i.send()})},function(t,e,r){"use strict";function i(t,e){let r=-1;return i(0);function i(n,o){if(o)return Promise.reject(o);if(n<=r)return Promise.reject(new Error("next() called multiple times"));r=n;const s=t[n];if(!s)return Promise.resolve();try{return Promise.resolve(s(e,i.bind(null,n+1)))}catch(o){return Promise.reject(o)}}}r.d(e,"a",(function(){return i}))},function(t,e){t.exports=r},function(t,e,r){"use strict";r.d(e,"g",(function(){return i["e"]})),r.d(e,"f",(function(){return i["d"]})),r.d(e,"a",(function(){return i["a"]})),r.d(e,"c",(function(){return i["b"]})),r.d(e,"l",(function(){return i["f"]})),r.d(e,"o",(function(){return i["i"]})),r.d(e,"p",(function(){return i["j"]})),r.d(e,"n",(function(){return i["h"]})),r.d(e,"m",(function(){return i["g"]})),r.d(e,"q",(function(){return i["k"]})),r.d(e,"e",(function(){return i["c"]})),r.d(e,"j",(function(){return g})),r.d(e,"k",(function(){return l})),r.d(e,"d",(function(){return a})),r.d(e,"w",(function(){return v["b"]})),r.d(e,"r",(function(){return v["a"]})),r.d(e,"h",(function(){return n["a"]})),r.d(e,"i",(function(){return _["a"]})),r.d(e,"s",(function(){return y["a"]})),r.d(e,"b",(function(){return T})),r.d(e,"t",(function(){return w})),r.d(e,"A",(function(){return d["f"]})),r.d(e,"v",(function(){return d["b"]})),r.d(e,"B",(function(){return d["g"]})),r.d(e,"y",(function(){return d["d"]})),r.d(e,"x",(function(){return d["c"]})),r.d(e,"u",(function(){return d["a"]})),r.d(e,"z",(function(){return d["e"]}));var i=r(6),n=r(4),o=r(20),s=r(5);class a{constructor(){this._autoInteract=!1}get autoInteract(){return this._autoInteract}set autoInteract(t){t!==this._autoInteract&&(t?this.on("pointertap",u,this):this.off("pointertap",u,this),this._autoInteract=t)}registerInteraction(t){t!==this.interactionManager&&(this.unregisterInteraction(),this._autoInteract&&t&&(this.interactionManager=t,t.on("pointermove",h,this)))}unregisterInteraction(){var t;this.interactionManager&&(null===(t=this.interactionManager)||void 0===t||t.off("pointermove",h,this),this.interactionManager=void 0)}}function u(t){this.tap(t.data.global.x,t.data.global.y)}function h(t){this.focus(t.data.global.x,t.data.global.y)}class l extends s["Transform"]{}var c,d=r(0);const p=new s["Point"],f=new s["Matrix"];let m=null===(c=window.PIXI)||void 0===c?void 0:c.Ticker;class g extends o["Container"]{constructor(t){super(),this.tag="Live2DModel(uninitialized)",this.textures=[],this.transform=new l,this.anchor=new s["ObservablePoint"](this.onAnchorChange,this,0,0),this.glContextID=-1,this.elapsedTime=performance.now(),this.deltaTime=0,this._autoUpdate=!1,this.once("modelLoaded",()=>this.init(t))}static from(t,e){const r=new this(e);return n["a"].setupLive2DModel(r,t,e).then(()=>r)}static fromSync(t,e){const r=new this(e);return n["a"].setupLive2DModel(r,t,e).then(null===e||void 0===e?void 0:e.onLoad).catch(null===e||void 0===e?void 0:e.onError),r}static registerTicker(t){m=t}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t?this._destroyed||(m?(m.shared.add(this.onTickerUpdate,this),this._autoUpdate=!0):d["f"].warn(this.tag,"No Ticker registered, please call Live2DModel.registerTicker(Ticker).")):(null===m||void 0===m||m.shared.remove(this.onTickerUpdate,this),this._autoUpdate=!1)}init(t){this.tag=`Live2DModel(${this.internalModel.settings.name})`;const e=Object.assign({autoUpdate:!0,autoInteract:!0},t);e.autoInteract&&(this.interactive=!0),this.autoInteract=e.autoInteract,this.autoUpdate=e.autoUpdate}onAnchorChange(){this.pivot.set(this.anchor.x*this.internalModel.width,this.anchor.y*this.internalModel.height)}motion(t,e,r){return void 0===e?this.internalModel.motionManager.startRandomMotion(t,r):this.internalModel.motionManager.startMotion(t,e,r)}expression(t){return this.internalModel.motionManager.expressionManager?void 0===t?this.internalModel.motionManager.expressionManager.setRandomExpression():this.internalModel.motionManager.expressionManager.setExpression(t):Promise.resolve(!1)}focus(t,e,r=!1){p.x=t,p.y=e,this.toModelPosition(p,p,!0),this.internalModel.focusController.focus(p.x/this.internalModel.originalWidth*2-1,-(p.y/this.internalModel.originalHeight*2-1),r)}tap(t,e){const r=this.hitTest(t,e);r.length&&(d["f"].log(this.tag,"Hit",r),this.emit("hit",r))}hitTest(t,e){return p.x=t,p.y=e,this.toModelPosition(p,p),this.internalModel.hitTest(p.x,p.y)}toModelPosition(t,e=t.clone(),r){return r||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.transform.worldTransform.applyInverse(t,e),this.internalModel.localTransform.applyInverse(e,e),e}containsPoint(t){return this.getBounds(!0).contains(t.x,t.y)}_calculateBounds(){this._bounds.addFrame(this.transform,0,0,this.internalModel.width,this.internalModel.height)}onTickerUpdate(){this.update(m.shared.deltaMS)}update(t){this.deltaTime+=t,this.elapsedTime+=t}_render(t){this.registerInteraction(t.plugins.interaction),t.batch.reset(),t.geometry.reset(),t.shader.reset(),t.state.reset();let e=!1;this.glContextID!==t.CONTEXT_UID&&(this.glContextID=t.CONTEXT_UID,this.internalModel.updateWebGLContext(t.gl,this.glContextID),e=!0);for(let n=0;ne.destroy(t.baseTexture)),this.internalModel.destroy(),super.destroy(t)}}Object(d["a"])(g,[a]);var v=r(1),_=r(3),y=r(15),x=r(2),b=function(t,e,r,i){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,o){function s(t){try{u(i.next(t))}catch(e){o(e)}}function a(t){try{u(i["throw"](t))}catch(e){o(e)}}function u(t){t.done?r(t.value):n(t.value).then(s,a)}u((i=i.apply(t,e||[])).next())}))};class T{static resolveURL(t,e){var r;const i=null===(r=T.filesMap[t])||void 0===r?void 0:r[e];if(void 0===i)throw new Error("Cannot find this file from uploaded files: "+e);return i}static upload(t,e){return b(this,void 0,void 0,(function*(){const r={};for(const i of e.getDefinedFiles()){const n=decodeURI(x["url"].resolve(e.url,i)),o=t.find(t=>t.webkitRelativePath===n);o&&(r[i]=URL.createObjectURL(o))}T.filesMap[e._objectURL]=r}))}static createSettings(t){return b(this,void 0,void 0,(function*(){const e=t.find(t=>t.name.endsWith("model.json")||t.name.endsWith("model3.json"));if(!e)throw new TypeError("Settings file not found");const r=yield T.readText(e),i=JSON.parse(r);i.url=e.webkitRelativePath;const o=n["a"].findRuntime(i);if(!o)throw new Error("Unknown settings JSON");const s=o.createModelSettings(i);return s._objectURL=URL.createObjectURL(e),s}))}static readText(t){return b(this,void 0,void 0,(function*(){return new Promise((e,r)=>{const i=new FileReader;i.onload=()=>e(i.result),i.onerror=r,i.readAsText(t,"utf8")})}))}}T.filesMap={},T.factory=(t,e)=>b(void 0,void 0,void 0,(function*(){if(Array.isArray(t.source)&&t.source[0]instanceof File){const e=t.source;let r=e.settings;if(r){if(!r._objectURL)throw new Error('"_objectURL" must be specified in ModelSettings')}else r=yield T.createSettings(e);r.validateFiles(e.map(t=>encodeURI(t.webkitRelativePath))),yield T.upload(e,r),r.resolveURL=function(t){return T.resolveURL(this._objectURL,t)},t.source=r,t.live2dModel.once("modelLoaded",t=>{t.once("destroy",(function(){const t=this.settings._objectURL;if(URL.revokeObjectURL(t),T.filesMap[t])for(const e of Object.values(T.filesMap[t]))URL.revokeObjectURL(e);delete T.filesMap[t]}))})}return e()})),n["a"].live2DModelMiddlewares.unshift(T.factory);var E=function(t,e,r,i){function n(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,o){function s(t){try{u(i.next(t))}catch(e){o(e)}}function a(t){try{u(i["throw"](t))}catch(e){o(e)}}function u(t){t.done?r(t.value):n(t.value).then(s,a)}u((i=i.apply(t,e||[])).next())}))};class w{static unzip(t,e){return E(this,void 0,void 0,(function*(){const r=yield w.getFilePaths(t),i=[];for(const t of e.getDefinedFiles()){const n=decodeURI(x["url"].resolve(e.url,t));r.includes(n)&&i.push(n)}const n=yield w.getFiles(t,i);for(let t=0;tt.endsWith("model.json")||t.endsWith("model3.json"));if(!r)throw new Error("Settings file not found");const i=yield w.readText(t,r);if(!i)throw new Error("Empty settings file: "+r);const o=JSON.parse(i);o.url=r;const s=n["a"].findRuntime(o);if(!s)throw new Error("Unknown settings JSON");return s.createModelSettings(o)}))}static zipReader(t,e){return E(this,void 0,void 0,(function*(){throw new Error("Not implemented")}))}static getFilePaths(t){return E(this,void 0,void 0,(function*(){throw new Error("Not implemented")}))}static getFiles(t,e){return E(this,void 0,void 0,(function*(){throw new Error("Not implemented")}))}static readText(t,e){return E(this,void 0,void 0,(function*(){throw new Error("Not implemented")}))}static releaseReader(t){}}w.ZIP_PROTOCOL="zip://",w.uid=0,w.factory=(t,e)=>E(void 0,void 0,void 0,(function*(){const r=t.source;let i,n,o;if("string"===typeof r&&(r.endsWith(".zip")||r.startsWith(w.ZIP_PROTOCOL))?(i=r.startsWith(w.ZIP_PROTOCOL)?r.slice(w.ZIP_PROTOCOL.length):r,n=yield _["a"].load({url:i,type:"blob",target:t.live2dModel})):Array.isArray(r)&&1===r.length&&r[0]instanceof File&&r[0].name.endsWith(".zip")&&(n=r[0],i=URL.createObjectURL(n),o=r.settings),n){if(!n.size)throw new Error("Empty zip file");const e=yield w.zipReader(n,i);o||(o=yield w.createSettings(e)),o._objectURL=w.ZIP_PROTOCOL+w.uid+"/"+o.url;const r=yield w.unzip(e,o);r.settings=o,t.source=r,i.startsWith("blob:")&&t.live2dModel.once("modelLoaded",t=>{t.once("destroy",(function(){URL.revokeObjectURL(i)}))}),w.releaseReader(e)}return e()})),n["a"].live2DModelMiddlewares.unshift(w.factory)},function(t,e){t.exports=i},function(t,e){t.exports=n},function(t,e,r){"use strict";const i=Live2DMotion.prototype.updateParam;Live2DMotion.prototype.updateParam=function(t,e){i.call(this,t,e),e.isFinished()&&this.onFinishHandler&&(this.onFinishHandler(this),delete this.onFinishHandler)}},function(t,e,r){"use strict";r.d(e,"a",(function(){return O})),r.d(e,"c",(function(){return R})),r.d(e,"d",(function(){return rt})),r.d(e,"b",(function(){return kt})),r.d(e,"e",(function(){return Gt})),r.d(e,"f",(function(){return Vt}));r(26);var i,n=r(10);class o{constructor(t,e){this.x=t||0,this.y=e||0}add(t){const e=new o(0,0);return e.x=this.x+t.x,e.y=this.y+t.y,e}substract(t){const e=new o(0,0);return e.x=this.x-t.x,e.y=this.y-t.y,e}multiply(t){const e=new o(0,0);return e.x=this.x*t.x,e.y=this.y*t.y,e}multiplyByScaler(t){return this.multiply(new o(t,t))}division(t){const e=new o(0,0);return e.x=this.x/t.x,e.y=this.y/t.y,e}divisionByScalar(t){return this.division(new o(t,t))}getLength(){return Math.sqrt(this.x*this.x+this.y*this.y)}getDistanceWith(t){return Math.sqrt((this.x-t.x)*(this.x-t.x)+(this.y-t.y)*(this.y-t.y))}dot(t){return this.x*t.x+this.y*t.y}normalize(){const t=Math.pow(this.x*this.x+this.y*this.y,.5);this.x=this.x/t,this.y=this.y/t}isEqual(t){return this.x==t.x&&this.y==t.y}isNotEqual(t){return!this.isEqual(t)}}class s{static range(t,e,r){return tr&&(t=r),t}static sin(t){return Math.sin(t)}static cos(t){return Math.cos(t)}static abs(t){return Math.abs(t)}static sqrt(t){return Math.sqrt(t)}static getEasingSine(t){return t<0?0:t>1?1:.5-.5*this.cos(t*Math.PI)}static max(t,e){return t>e?t:e}static min(t,e){return t>e?e:t}static degreesToRadian(t){return t/180*Math.PI}static radianToDegrees(t){return 180*t/Math.PI}static directionToRadian(t,e){const r=Math.atan2(e.y,e.x),i=Math.atan2(t.y,t.x);let n=r-i;while(n<-Math.PI)n+=2*Math.PI;while(n>Math.PI)n-=2*Math.PI;return n}static directionToDegrees(t,e){const r=this.directionToRadian(t,e);let i=this.radianToDegrees(r);return e.x-t.x>0&&(i=-i),i}static radianToDirection(t){const e=new o;return e.x=this.sin(t),e.y=this.cos(t),e}constructor(){}}class a{constructor(){this._tr=new Float32Array(16),this.loadIdentity()}static multiply(t,e,r){const i=new Float32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),n=4;for(let o=0;o1&&(t=1),e<0?e=0:e>1&&(e=1),r<0?r=0:r>1&&(r=1),i<0?i=0:i>1&&(i=1),this._modelColor.R=t,this._modelColor.G=e,this._modelColor.B=r,this._modelColor.A=i}getModelColor(){return Object.assign({},this._modelColor)}setIsPremultipliedAlpha(t){this._isPremultipliedAlpha=t}isPremultipliedAlpha(){return this._isPremultipliedAlpha}setIsCulling(t){this._isCulling=t}isCulling(){return this._isCulling}setAnisotropy(t){this._anisortopy=t}getAnisotropy(){return this._anisortopy}getModel(){return this._model}}(function(t){t[t["CubismBlendMode_Normal"]=0]="CubismBlendMode_Normal",t[t["CubismBlendMode_Additive"]=1]="CubismBlendMode_Additive",t[t["CubismBlendMode_Multiplicative"]=2]="CubismBlendMode_Multiplicative"})(i||(i={}));class h{constructor(){this.R=1,this.G=1,this.B=1,this.A=1}}let l=!1,c=!1,d=void 0;var p,f;(function(t){t.vertexOffset=0,t.vertexStep=2})(p||(p={}));class m{static startUp(t){if(l)return _("CubismFramework.startUp() is already done."),l;if(Live2DCubismCore._isStarted)return l=!0,!0;if(Live2DCubismCore._isStarted=!0,d=t,d&&Live2DCubismCore.Logging.csmSetLogFunction(d.logFunction),l=!0,l){const t=Live2DCubismCore.Version.csmGetVersion(),e=(4278190080&t)>>24,r=(16711680&t)>>16,i=65535&t,n=t;_("Live2D Cubism Core version: {0}.{1}.{2} ({3})",("00"+e).slice(-2),("00"+r).slice(-2),("0000"+i).slice(-4),n)}return _("CubismFramework.startUp() is complete."),l}static cleanUp(){l=!1,c=!1,d=void 0}static initialize(){l?c?y("CubismFramework.initialize() skipped, already initialized."):(c=!0,_("CubismFramework.initialize() is complete.")):y("CubismFramework is not started.")}static dispose(){l?c?(u.staticRelease(),c=!1,_("CubismFramework.dispose() is complete.")):y("CubismFramework.dispose() skipped, not initialized."):y("CubismFramework is not started.")}static isStarted(){return l}static isInitialized(){return c}static coreLogFunction(t){Live2DCubismCore.Logging.csmGetLogFunction()&&Live2DCubismCore.Logging.csmGetLogFunction()(t)}static getLoggingLevel(){return null!=d?d.loggingLevel:f.LogLevel_Off}constructor(){}}(function(t){t[t["LogLevel_Verbose"]=0]="LogLevel_Verbose",t[t["LogLevel_Debug"]=1]="LogLevel_Debug",t[t["LogLevel_Info"]=2]="LogLevel_Info",t[t["LogLevel_Warning"]=3]="LogLevel_Warning",t[t["LogLevel_Error"]=4]="LogLevel_Error",t[t["LogLevel_Off"]=5]="LogLevel_Off"})(f||(f={}));const g=()=>{};function v(t,...e){b.print(f.LogLevel_Debug,"[CSM][D]"+t+"\n",e)}function _(t,...e){b.print(f.LogLevel_Info,"[CSM][I]"+t+"\n",e)}function y(t,...e){b.print(f.LogLevel_Warning,"[CSM][W]"+t+"\n",e)}function x(t,...e){b.print(f.LogLevel_Error,"[CSM][E]"+t+"\n",e)}class b{static print(t,e,r){if(tr[e]);i(n)}static dumpBytes(t,e,r){for(let i=0;i0?this.print(t,"\n"):i%8==0&&i>0&&this.print(t," "),this.print(t,"{0} ",[255&e[i]]);this.print(t,"\n")}constructor(){}}class T{constructor(){this._fadeInSeconds=-1,this._fadeOutSeconds=-1,this._weight=1,this._offsetSeconds=0,this._firedEventValues=[]}release(){this._weight=0}updateParameters(t,e,r){if(!e.isAvailable()||e.isFinished())return;if(!e.isStarted()){e.setIsStarted(!0),e.setStartTime(r-this._offsetSeconds),e.setFadeInStartTime(r);const t=this.getDuration();e.getEndTime()<0&&e.setEndTime(t<=0?-1:e.getStartTime()+t)}let i=this._weight;const n=0==this._fadeInSeconds?1:s.getEasingSine((r-e.getFadeInStartTime())/this._fadeInSeconds),o=0==this._fadeOutSeconds||e.getEndTime()<0?1:s.getEasingSine((e.getEndTime()-r)/this._fadeOutSeconds);i=i*n*o,e.setState(r,i),g(0<=i&&i<=1),this.doUpdateParameters(t,r,i,e),e.getEndTime()>0&&e.getEndTime()null!=e&&e._motionQueueEntryHandle==t)}setEventCallback(t,e=null){this._eventCallBack=t,this._eventCustomData=e}doUpdateMotion(t,e){let r=!1,i=0;while(ie.Name===t)}getExpressionFile(t){return t.File}createExpression(t,e){return w.create(t)}_setExpression(t){return this.queueManager.startMotion(t,!1,performance.now())}stopAllExpressions(){this.queueManager.stopAllMotions()}updateParameters(t,e){return this.queueManager.doUpdateMotion(t,e)}}var C=r(11),A=r(0);class D{constructor(t){this.groups=t.Groups,this.hitAreas=t.HitAreas,this.layout=t.Layout,this.moc=t.FileReferences.Moc,this.expressions=t.FileReferences.Expressions,this.motions=t.FileReferences.Motions,this.textures=t.FileReferences.Textures,this.physics=t.FileReferences.Physics,this.pose=t.FileReferences.Pose}getEyeBlinkParameters(){var t,e;return null===(e=null===(t=this.groups)||void 0===t?void 0:t.find(t=>"EyeBlink"===t.Name))||void 0===e?void 0:e.Ids}getLipSyncParameters(){var t,e;return null===(e=null===(t=this.groups)||void 0===t?void 0:t.find(t=>"LipSync"===t.Name))||void 0===e?void 0:e.Ids}}class R extends C["a"]{constructor(t){if(super(t),!R.isValidJSON(t))throw new TypeError("Invalid JSON.");Object.assign(this,new D(t))}static isValidJSON(t){var e;return!!(null===t||void 0===t?void 0:t.FileReferences)&&"string"===typeof t.FileReferences.Moc&&(null===(e=t.FileReferences.Textures)||void 0===e?void 0:e.length)>0&&t.FileReferences.Textures.every(t=>"string"===typeof t)}replaceFiles(t){if(super.replaceFiles(t),this.motions)for(const[e,r]of Object.entries(this.motions))for(let i=0;ir){n=u;break}if(-1==n)return t.points[s].value;const a=t.segments[n];return a.evaluate(t.points.slice(a.basePointIndex),r)}class tt extends T{constructor(){super(),this._eyeBlinkParameterIds=[],this._lipSyncParameterIds=[],this._sourceFrameRate=30,this._loopDurationSeconds=-1,this._isLoop=!1,this._isLoopFadeIn=!0,this._lastWeight=0}static create(t,e){const r=new tt;return r.parse(t),r._sourceFrameRate=r._motionData.fps,r._loopDurationSeconds=r._motionData.duration,r._onFinishedMotion=e,r}doUpdateParameters(t,e,r,i){null==this._modelCurveIdEyeBlink&&(this._modelCurveIdEyeBlink=V),null==this._modelCurveIdLipSync&&(this._modelCurveIdLipSync=H);let n=e-i.getStartTime();n<0&&(n=0);let o=Number.MAX_VALUE,a=Number.MAX_VALUE;const u=64;let h=0,l=0;this._eyeBlinkParameterIds.length>u&&v("too many eye blink targets : {0}",this._eyeBlinkParameterIds.length),this._lipSyncParameterIds.length>u&&v("too many lip sync targets : {0}",this._lipSyncParameterIds.length);const c=this._fadeInSeconds<=0?1:s.getEasingSine((e-i.getFadeInStartTime())/this._fadeInSeconds),d=this._fadeOutSeconds<=0||i.getEndTime()<0?1:s.getEasingSine((i.getEndTime()-e)/this._fadeOutSeconds);let p,f,m,g=n;if(this._isLoop)while(g>this._motionData.duration)g-=this._motionData.duration;const _=this._motionData.curves;for(f=0;f>s&1)continue;const i=e+(a-e)*r;t.setParameterValueById(this._eyeBlinkParameterIds[s],i)}if(o!=Number.MAX_VALUE)for(let s=0;s>s&1)continue;const i=e+(o-e)*r;t.setParameterValueById(this._lipSyncParameterIds[s],i)}for(;f=this._motionData.duration&&(this._isLoop?(i.setStartTime(e),this._isLoopFadeIn&&i.setFadeInStartTime(e)):(this._onFinishedMotion&&this._onFinishedMotion(this),i.setIsFinished(!0))),this._lastWeight=r}setIsLoop(t){this._isLoop=t}isLoop(){return this._isLoop}setIsLoopFadeIn(t){this._isLoopFadeIn=t}isLoopFadeIn(){return this._isLoopFadeIn}getDuration(){return this._isLoop?-1:this._loopDurationSeconds}getLoopDuration(){return this._loopDurationSeconds}setParameterFadeInTime(t,e){const r=this._motionData.curves;for(let i=0;inew k),this._motionData.segments=Array.from({length:e.getMotionTotalSegmentCount()}).map(()=>new U),this._motionData.events=Array.from({length:this._motionData.eventCount}).map(()=>new j),this._motionData.points=[];let n=0,o=0;for(let s=0;st&&this._motionData.events[r].fireTime<=e&&this._firedEventValues.push(this._motionData.events[r].value);return this._firedEventValues}}var et=r(1);class rt extends N["a"]{constructor(t,e){var r;super(t,e),this.groups={idle:"Idle"},this.motionDataType="json",this.queueManager=new I,this.definitions=null!==(r=t.motions)&&void 0!==r?r:{},this.eyeBlinkIds=t.getEyeBlinkParameters()||[],this.lipSyncIds=t.getLipSyncParameters()||[],this.init(e)}init(t){super.init(t),this.settings.expressions&&(this.expressionManager=new O(this.settings,t)),this.queueManager.setEventCallback((t,e,r)=>{this.emit("motion:"+e)})}isFinished(){return this.queueManager.isFinished()}_startMotion(t,e){return t.setFinishedMotionHandler(e),this.queueManager.stopAllMotions(),this.queueManager.startMotion(t,!1,performance.now())}_stopAllMotions(){this.queueManager.stopAllMotions()}createMotion(t,e,r){const i=tt.create(t),n=(e===this.groups.idle?et["b"].idleMotionFadingDuration:et["b"].motionFadingDuration)/1e3;return i.setFadeInTime(r.FadeInTime>0?r.FadeInTime:n),i.setFadeOutTime(r.FadeOutTime>0?r.FadeOutTime:n),i.setEffectIds(this.eyeBlinkIds,this.lipSyncIds),i}getMotionFile(t){return t.File}getMotionName(t){return t.File}getSoundFile(t){return t.Sound}updateParameters(t,e){return this.queueManager.doUpdateMotion(t,e)}destroy(){super.destroy(),this.queueManager.release(),this.queueManager=void 0}}var it=r(13);const nt="ParamAngleX",ot="ParamAngleY",st="ParamAngleZ",at="ParamEyeBallX",ut="ParamEyeBallY",ht="ParamBodyAngleX",lt="ParamBreath";class ct{constructor(){this._breathParameters=[],this._currentTime=0}static create(){return new ct}setParameters(t){this._breathParameters=t}getParameters(){return this._breathParameters}updateParameters(t,e){this._currentTime+=e;const r=2*this._currentTime*3.14159;for(let i=0;i=1&&(i=1,this._blinkingState=ft.EyeState_Closed,this._stateStartTimeSeconds=this._userTimeSeconds),r=1-i;break;case ft.EyeState_Closed:i=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._closedSeconds,i>=1&&(this._blinkingState=ft.EyeState_Opening,this._stateStartTimeSeconds=this._userTimeSeconds),r=0;break;case ft.EyeState_Opening:i=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._openingSeconds,i>=1&&(i=1,this._blinkingState=ft.EyeState_Interval,this._nextBlinkingTime=this.determinNextBlinkingTiming()),r=i;break;case ft.EyeState_Interval:this._nextBlinkingTimed&&(d=e),rf&&(f=r)}if(l!=Number.MAX_VALUE)if(ln&&(n=d),f>o&&(o=f),r==Number.MAX_VALUE)e._allClippedDrawRect.x=0,e._allClippedDrawRect.y=0,e._allClippedDrawRect.width=0,e._allClippedDrawRect.height=0,e._isUsing=!1;else{e._isUsing=!0;const t=n-r,s=o-i;e._allClippedDrawRect.x=r,e._allClippedDrawRect.y=i,e._allClippedDrawRect.width=t,e._allClippedDrawRect.height=s}}}release(){var t,e,r;const i=this;for(let n=0;n0){this.gl.viewport(0,0,this._clippingMaskBufferSize,this._clippingMaskBufferSize),this._maskRenderTexture=this.getMaskRenderTexture();e.getMvpMatrix();e.preDraw(),this.setupLayoutBounds(r),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this._maskRenderTexture),this.gl.clearColor(1,1,1,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT);for(let r=0;r=0;e--)this._sortedDrawableIndexList[e]=0;super.initialize(t)}bindTexture(t,e){this._textures[t]=e}getBindedTextures(){return this._textures}setClippingMaskBufferSize(t){this._clippingManager.release(),this._clippingManager=new Tt,this._clippingManager.setClippingMaskBufferSize(t),this._clippingManager.initialize(this.getModel(),this.getModel().getDrawableCount(),this.getModel().getDrawableMasks(),this.getModel().getDrawableMaskCounts())}getClippingMaskBufferSize(){return this._clippingManager.getClippingMaskBufferSize()}release(){var t,e,r;const i=this;this._clippingManager.release(),i._clippingManager=void 0,null===(t=this.gl)||void 0===t||t.deleteBuffer(this._bufferData.vertex),this._bufferData.vertex=null,null===(e=this.gl)||void 0===e||e.deleteBuffer(this._bufferData.uv),this._bufferData.uv=null,null===(r=this.gl)||void 0===r||r.deleteBuffer(this._bufferData.index),this._bufferData.index=null,i._bufferData=void 0,i._textures=void 0}doDrawModel(){this.preDraw(),null!=this._clippingManager&&this._clippingManager.setupClippingContext(this.getModel(),this);const t=this.getModel().getDrawableCount(),e=this.getModel().getDrawableRenderOrders();for(let r=0;r{Lt.doStaticRelease()};var Ft=r(5),Nt=r(24),Bt=r.n(Nt);const Ut=new a;class kt extends it["a"]{constructor(t,e,r){super(),this.lipSync=!0,this.breath=ct.create(),this.renderer=new Lt,this.idParamAngleX=nt,this.idParamAngleY=ot,this.idParamAngleZ=st,this.idParamEyeBallX=at,this.idParamEyeBallY=ut,this.idParamBodyAngleX=ht,this.idParamBreath=lt,this.pixelsPerUnit=1,this.centeringTransform=new Ft["Matrix"],this.coreModel=t,this.settings=e,this.motionManager=new rt(e,r),this.init()}init(){var t;super.init(),(null===(t=this.settings.getEyeBlinkParameters())||void 0===t?void 0:t.length)>0&&(this.eyeBlink=pt.create(this.settings)),this.breath.setParameters([new dt(this.idParamAngleX,0,15,6.5345,.5),new dt(this.idParamAngleY,0,8,3.5345,.5),new dt(this.idParamAngleZ,0,10,5.5345,.5),new dt(this.idParamBodyAngleX,0,4,15.5345,.5),new dt(this.idParamBreath,0,.5,3.2345,.5)]),this.renderer.initialize(this.coreModel),this.renderer.setIsPremultipliedAlpha(!0)}getSize(){return[this.coreModel.getModel().canvasinfo.CanvasWidth,this.coreModel.getModel().canvasinfo.CanvasHeight]}getLayout(){return Bt()(Object.assign({},this.settings.layout),(t,e)=>e.charAt(0).toLowerCase()+e.slice(1))}setupLayout(){super.setupLayout(),this.pixelsPerUnit=this.coreModel.getModel().canvasinfo.PixelsPerUnit,this.centeringTransform.scale(this.pixelsPerUnit,this.pixelsPerUnit).translate(this.originalWidth/2,this.originalHeight/2)}updateWebGLContext(t,e){this.renderer.firstDraw=!0,this.renderer._bufferData={vertex:null,uv:null,index:null},this.renderer.startUp(t),this.renderer._clippingManager._currentFrameNo=e,this.renderer._clippingManager._maskTexture=void 0,Pt.getInstance()._shaderSets=[]}bindTexture(t,e){this.renderer.bindTexture(t,e)}getHitAreaDefs(){var t,e;return null!==(e=null===(t=this.settings.hitAreas)||void 0===t?void 0:t.map(t=>({id:t.Id,name:t.Name,index:this.coreModel.getDrawableIndex(t.Id)})))&&void 0!==e?e:[]}getDrawableIDs(){return this.coreModel.getDrawableIds()}getDrawableIndex(t){return this.coreModel.getDrawableIndex(t)}getDrawableVertices(t){if("string"===typeof t&&(t=this.coreModel.getDrawableIndex(t),-1===t))throw new TypeError("Unable to find drawable ID: "+t);const e=this.coreModel.getDrawableVertices(t).slice();for(let r=0;r{function r(){try{Vt(),t()}catch(i){if(Xt--,Xt<0){const t=new Error("Failed to start up Cubism 4 framework.");return t.cause=i,void e(t)}A["f"].log("Cubism4","Startup failed, retrying 10ms later..."),setTimeout(r,10)}}r()})),jt)}function Vt(t){t=Object.assign({logFunction:console.log,loggingLevel:f.LogLevel_Verbose},t),m.startUp(t),m.initialize()}var Ht=r(4);const zt=.001,Yt=.5;class Wt{constructor(){this._fadeTimeSeconds=Yt,this._lastModel=void 0,this._partGroups=[],this._partGroupCounts=[]}static create(t){const e=new Wt;"number"===typeof t.FadeInTime&&(e._fadeTimeSeconds=t.FadeInTime,e._fadeTimeSeconds<=0&&(e._fadeTimeSeconds=Yt));const r=t.Groups,i=r.length;for(let n=0;nzt){if(n>=0)break;n=u,o=t.getPartOpacityByIndex(r),o+=e/this._fadeTimeSeconds,o>1&&(o=1)}}n<0&&(n=0,o=1);for(let u=r;ua&&(r=1-a/(1-o)),i>r&&(i=r),t.setPartOpacityByIndex(e,i)}}}}class qt{constructor(t){this.parameterIndex=0,this.partIndex=0,this.partId="",this.link=[],void 0!=t&&this.assignment(t)}assignment(t){return this.partId=t.partId,this.link=t.link.map(t=>t.clone()),this}initialize(t){this.parameterIndex=t.getParameterIndex(this.partId),this.partIndex=t.getPartIndex(this.partId),t.setParameterValueByIndex(this.parameterIndex,1)}clone(){const t=new qt;return t.partId=this.partId,t.parameterIndex=this.parameterIndex,t.partIndex=this.partIndex,t.link=this.link.map(t=>t.clone()),t}}class Zt{constructor(t){this._model=t,this._savedParameters=[],this._parameterIds=[],this._drawableIds=[],this._partIds=[],this._notExistPartId={},this._notExistParameterId={},this._notExistParameterValues={},this._notExistPartOpacities={},this.initialize()}update(){this._model.update(),this._model.drawables.resetDynamicFlags()}getCanvasWidth(){return null==this._model?0:this._model.canvasinfo.CanvasWidth/this._model.canvasinfo.PixelsPerUnit}getCanvasHeight(){return null==this._model?0:this._model.canvasinfo.CanvasHeight/this._model.canvasinfo.PixelsPerUnit}saveParameters(){const t=this._model.parameters.count,e=this._savedParameters.length;for(let r=0;re&&(e=this._model.parameters.minimumValues[t]),this._parameterValues[t]=1==r?e:this._parameterValues[t]=this._parameterValues[t]*(1-r)+e*r)}setParameterValueById(t,e,r=1){const i=this.getParameterIndex(t);this.setParameterValueByIndex(i,e,r)}addParameterValueByIndex(t,e,r=1){this.setParameterValueByIndex(t,this.getParameterValueByIndex(t)+e*r)}addParameterValueById(t,e,r=1){const i=this.getParameterIndex(t);this.addParameterValueByIndex(i,e,r)}multiplyParameterValueById(t,e,r=1){const i=this.getParameterIndex(t);this.multiplyParameterValueByIndex(i,e,r)}multiplyParameterValueByIndex(t,e,r=1){this.setParameterValueByIndex(t,this.getParameterValueByIndex(t)*(1+(e-1)*r))}getDrawableIds(){return this._drawableIds.slice()}getDrawableIndex(t){const e=this._model.drawables.count;for(let r=0;re&&(t=e);for(let r=0;r=h.particleCount)break;-1==c[e].destinationParameterIndex&&(c[e].destinationParameterIndex=t.getParameterIndex(c[e].destination.id));const i=new o;i.x=d[r].position.x-d[r-1].position.x,i.y=d[r].position.y-d[r-1].position.y,a=c[e].getValue(i,d,r,c[e].reflect,this._options.gravity);const n=c[e].destinationParameterIndex,s=!Float32Array.prototype.slice&&"subarray"in Float32Array.prototype?JSON.parse(JSON.stringify(p.subarray(n))):p.slice(n);Pe(s,m[n],f[n],a,c[e]);for(let t=n,e=0;t=2?e[r-1].position.substract(e[r-2].position):n.multiplyByScaler(-1),o=s.directionToRadian(n,t),i&&(o*=-1),o}function ye(t,e){return Math.abs(Math.max(t,e)-Math.min(t,e))}function xe(t,e){const r=Math.min(t,e);return r+ye(t,e)/2}function be(t,e){return t.x}function Te(t,e){return t.y}function Ee(t,e){return e}function we(t,e,r,i,n,a,u,h){let l,c,d,p,f=new o(0,0),m=new o(0,0),g=new o(0,0),v=new o(0,0);t[0].position=new o(r.x,r.y),l=s.degreesToRadian(i),p=s.radianToDirection(l),p.normalize();for(let _=1;_r&&(s>n.valueExceededMaximum&&(n.valueExceededMaximum=s),s=r),a=n.weight/he,a>=1||(s=t[0]*(1-a)+s*a),t[0]=s}function Se(t,e,r,i,n,o,a,u){let h=0;const l=s.max(r,e);lt&&(t=c);const d=s.min(n,o),p=s.max(n,o),f=a,m=xe(c,l),g=t-m;switch(Math.sign(g)){case 1:{const t=p-f,e=l-m;0!=e&&(h=g*(t/e),h+=f);break}case-1:{const t=d-f,e=c-m;0!=e&&(h=g*(t/e),h+=f);break}case 0:h=f;break;default:break}return u?h:-1*h}function Ie(){var t;null===(t=this.__moc)||void 0===t||t.release()}et["b"].cubism4=mt,Ht["a"].registerRuntime({version:4,ready:Gt,test(t){return t instanceof R||R.isValidJSON(t)},isValidMoc(t){if(t.byteLength<4)return!1;const e=new Int8Array(t,0,4);return"MOC3"===String.fromCharCode(...e)},createModelSettings(t){return new R(t)},createCoreModel(t){const e=Kt.create(t);try{const t=e.createModel();return t.__moc=e,t}catch(r){try{e.release()}catch(i){}throw r}},createInternalModel(t,e,r){const i=new kt(t,e,r),n=t;return n.__moc&&(i.__moc=n.__moc,delete n.__moc,i.once("destroy",Ie)),i},createPhysics(t,e){return ce.create(e)},createPose(t,e){return Wt.create(e)}})},function(t,e,r){"use strict";r.d(e,"a",(function(){return s})),r.d(e,"b",(function(){return f})),r.d(e,"c",(function(){return g})),r.d(e,"d",(function(){return h})),r.d(e,"e",(function(){return o})),r.d(e,"f",(function(){return d})),r.d(e,"g",(function(){return y})),r.d(e,"h",(function(){return b}));r(25),r(21);var i=r(10),n=r(1);class o extends AMotion{constructor(t){super(),this.params=[],this.setFadeIn(t.fade_in>0?t.fade_in:n["b"].expressionFadingDuration),this.setFadeOut(t.fade_out>0?t.fade_out:n["b"].expressionFadingDuration),Array.isArray(t.params)&&t.params.forEach(t=>{const e=t.calc||"add";if("add"===e){const e=t.def||0;t.val-=e}else if("mult"===e){const e=t.def||1;t.val/=e}this.params.push({calc:e,val:t.val,id:t.id})})}updateParamExe(t,e,r,i){this.params.forEach(e=>{t.setParamFloat(e.id,e.val*r)})}}class s extends i["a"]{constructor(t,e){var r;super(t,e),this.queueManager=new MotionQueueManager,this.definitions=null!==(r=this.settings.expressions)&&void 0!==r?r:[],this.init()}isFinished(){return this.queueManager.isFinished()}getExpressionIndex(t){return this.definitions.findIndex(e=>e.name===t)}getExpressionFile(t){return t.file}createExpression(t,e){return new o(t)}_setExpression(t){return this.queueManager.startMotion(t)}stopAllExpressions(){this.queueManager.stopAllMotions()}updateParameters(t,e){return this.queueManager.updateParam(t)}}var a=r(13),u=r(12);class h extends u["a"]{constructor(t,e){super(t,e),this.groups={idle:"idle"},this.motionDataType="arraybuffer",this.queueManager=new MotionQueueManager,this.definitions=this.settings.motions,this.init(e)}init(t){super.init(t),this.settings.expressions&&(this.expressionManager=new s(this.settings,t))}isFinished(){return this.queueManager.isFinished()}createMotion(t,e,r){const i=Live2DMotion.loadMotion(t),o=e===this.groups.idle?n["b"].idleMotionFadingDuration:n["b"].motionFadingDuration;return i.setFadeIn(r.fade_in>0?r.fade_in:o),i.setFadeOut(r.fade_out>0?r.fade_out:o),i}getMotionFile(t){return t.file}getMotionName(t){return t.file}getSoundFile(t){return t.sound}_startMotion(t,e){return t.onFinishHandler=e,this.queueManager.stopAllMotions(),this.queueManager.startMotion(t)}_stopAllMotions(){this.queueManager.stopAllMotions()}updateParameters(t,e){return this.queueManager.updateParam(t)}destroy(){super.destroy(),this.queueManager=void 0}}var l,c=r(0);(function(t){t[t["Idle"]=0]="Idle",t[t["Closing"]=1]="Closing",t[t["Closed"]=2]="Closed",t[t["Opening"]=3]="Opening"})(l||(l={}));class d{constructor(t){this.coreModel=t,this.blinkInterval=4e3,this.closingDuration=100,this.closedDuration=50,this.openingDuration=150,this.eyeState=l.Idle,this.eyeParamValue=1,this.closedTimer=0,this.nextBlinkTimeLeft=this.blinkInterval,this.leftParam=t.getParamIndex("PARAM_EYE_L_OPEN"),this.rightParam=t.getParamIndex("PARAM_EYE_R_OPEN")}setEyeParams(t){this.eyeParamValue=Object(c["b"])(t,0,1),this.coreModel.setParamFloat(this.leftParam,this.eyeParamValue),this.coreModel.setParamFloat(this.rightParam,this.eyeParamValue)}update(t){switch(this.eyeState){case l.Idle:this.nextBlinkTimeLeft-=t,this.nextBlinkTimeLeft<0&&(this.eyeState=l.Closing,this.nextBlinkTimeLeft=this.blinkInterval+this.closingDuration+this.closedDuration+this.openingDuration+Object(c["g"])(0,2e3));break;case l.Closing:this.setEyeParams(this.eyeParamValue+t/this.closingDuration),this.eyeParamValue<=0&&(this.eyeState=l.Closed,this.closedTimer=0);break;case l.Closed:this.closedTimer+=t,this.closedTimer>=this.closedDuration&&(this.eyeState=l.Opening);break;case l.Opening:this.setEyeParams(this.eyeParamValue+t/this.openingDuration),this.eyeParamValue>=1&&(this.eyeState=l.Idle)}}}const p=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);class f extends a["a"]{constructor(t,e,r){super(),this.textureFlipY=!0,this.drawDataCount=0,this.disableCulling=!1,this.coreModel=t,this.settings=e,this.motionManager=new h(e,r),this.eyeBlink=new d(t),this.eyeballXParamIndex=t.getParamIndex("PARAM_EYE_BALL_X"),this.eyeballYParamIndex=t.getParamIndex("PARAM_EYE_BALL_Y"),this.angleXParamIndex=t.getParamIndex("PARAM_ANGLE_X"),this.angleYParamIndex=t.getParamIndex("PARAM_ANGLE_Y"),this.angleZParamIndex=t.getParamIndex("PARAM_ANGLE_Z"),this.bodyAngleXParamIndex=t.getParamIndex("PARAM_BODY_ANGLE_X"),this.breathParamIndex=t.getParamIndex("PARAM_BREATH"),this.init()}init(){super.init(),this.settings.initParams&&this.settings.initParams.forEach(({id:t,value:e})=>this.coreModel.setParamFloat(t,e)),this.settings.initOpacities&&this.settings.initOpacities.forEach(({id:t,value:e})=>this.coreModel.setPartsOpacity(t,e)),this.coreModel.saveParam();const t=this.coreModel.getModelContext()._$aS;(null===t||void 0===t?void 0:t.length)&&(this.drawDataCount=t.length);let e=this.coreModel.drawParamWebGL.culling;Object.defineProperty(this.coreModel.drawParamWebGL,"culling",{set:t=>e=t,get:()=>!this.disableCulling&&e});const r=this.coreModel.getModelContext().clipManager,i=r.setupClip;r.setupClip=(t,e)=>{i.call(r,t,e),e.gl.viewport(...this.viewport)}}getSize(){return[this.coreModel.getCanvasWidth(),this.coreModel.getCanvasHeight()]}getLayout(){const t=this.settings.layout||{};return Object.assign(Object.assign({},t),{centerX:t.center_x,centerY:t.center_y})}updateWebGLContext(t,e){const r=this.coreModel.drawParamWebGL;r.firstDraw=!0,r.setGL(t),r.glno=e;for(const o in r)r.hasOwnProperty(o)&&r[o]instanceof WebGLBuffer&&(r[o]=null);const i=this.coreModel.getModelContext().clipManager;i.curFrameNo=e;const n=t.getParameter(t.FRAMEBUFFER_BINDING);i.getMaskRenderTexture(),t.bindFramebuffer(t.FRAMEBUFFER,n)}bindTexture(t,e){this.coreModel.setTexture(t,e)}getHitAreaDefs(){var t;return(null===(t=this.settings.hitAreas)||void 0===t?void 0:t.map(t=>({id:t.id,name:t.name,index:this.coreModel.getDrawDataIndex(t.id)})))||[]}getDrawableIDs(){const t=this.coreModel.getModelContext(),e=[];for(let r=0;r0&&t.textures.every(t=>"string"===typeof t)}copy(t){Object(c["d"])("string",t,this,"name","name"),Object(c["d"])("string",t,this,"pose","pose"),Object(c["d"])("string",t,this,"physics","physics"),Object(c["d"])("object",t,this,"layout","layout"),Object(c["d"])("object",t,this,"motions","motions"),Object(c["c"])("object",t,this,"hit_areas","hitAreas"),Object(c["c"])("object",t,this,"expressions","expressions"),Object(c["c"])("object",t,this,"init_params","initParams"),Object(c["c"])("object",t,this,"init_opacities","initOpacities")}replaceFiles(t){super.replaceFiles(t);for(const[e,r]of Object.entries(this.motions))for(let i=0;i{const e=new PhysicsHair;return e.setup(t.setup.length,t.setup.regist,t.setup.mass),t.src.forEach(({id:t,ptype:r,scale:i,weight:n})=>{const o=v[r];o&&e.addSrcParam(o,t,i,n)}),t.targets.forEach(({id:t,ptype:r,scale:i,weight:n})=>{const o=_[r];o&&e.addTargetParam(o,t,i,n)}),e}))}update(t){this.physicsHairs.forEach(e=>e.update(this.coreModel,t))}}class x{constructor(t){this.id=t,this.paramIndex=-1,this.partsIndex=-1,this.link=[]}initIndex(t){this.paramIndex=t.getParamIndex("VISIBLE:"+this.id),this.partsIndex=t.getPartsDataIndex(PartsDataID.getID(this.id)),t.setParamFloat(this.paramIndex,1)}}class b{constructor(t,e){this.coreModel=t,this.opacityAnimDuration=500,this.partsGroups=[],e.parts_visible&&(this.partsGroups=e.parts_visible.map(({group:t})=>t.map(({id:t,link:e})=>{const r=new x(t);return e&&(r.link=e.map(t=>new x(t))),r})),this.init())}init(){this.partsGroups.forEach(t=>{t.forEach(t=>{if(t.initIndex(this.coreModel),t.paramIndex>=0){const e=0!==this.coreModel.getParamFloat(t.paramIndex);this.coreModel.setPartsOpacity(t.partsIndex,e?1:0),this.coreModel.setParamFloat(t.paramIndex,e?1:0),t.link.length>0&&t.link.forEach(t=>t.initIndex(this.coreModel))}})})}normalizePartsOpacityGroup(t,e){const r=this.coreModel,i=.5,n=.15;let o=1,s=t.findIndex(({paramIndex:t,partsIndex:e})=>e>=0&&0!==r.getParamFloat(t));if(s>=0){const i=r.getPartsOpacity(t[s].partsIndex);o=Object(c["b"])(i+e/this.opacityAnimDuration,0,1)}else s=0,o=1;t.forEach(({partsIndex:t},e)=>{if(t>=0)if(s==e)r.setPartsOpacity(t,o);else{let e,s=r.getPartsOpacity(t);e=on&&(e=1-n/(1-o)),s>e&&(s=e),r.setPartsOpacity(t,s)}})}copyOpacity(t){const e=this.coreModel;t.forEach(({partsIndex:t,link:r})=>{if(t>=0&&r){const i=e.getPartsOpacity(t);r.forEach(({partsIndex:t})=>{t>=0&&e.setPartsOpacity(t,i)})}})}update(t){this.partsGroups.forEach(e=>{this.normalizePartsOpacityGroup(e,t),this.copyOpacity(e)})}}var T=r(4);T["a"].registerRuntime({version:2,test(t){return t instanceof g||g.isValidJSON(t)},ready(){return Promise.resolve()},isValidMoc(t){if(t.byteLength<3)return!1;const e=new Int8Array(t,0,3);return"moc"===String.fromCharCode(...e)},createModelSettings(t){return new g(t)},createCoreModel(t){const e=Live2DModelWebGL.loadModel(t),r=Live2D.getError();if(r)throw r;return e},createInternalModel(t,e,r){return new f(t,e,r)},createPose(t,e){return new b(t,e)},createPhysics(t,e){return new y(t,e)}})},function(t,e){t.exports=o},function(t,e,r){"use strict";if(!window.Live2D)throw new Error("Cannot find Cubism 2 runtime. Did you forget to include the live2d.min.js?")},function(t,e,r){"use strict";if(!window.Live2DCubismCore)throw new Error("Cannot find Cubism 4 runtime. Did you forget to include the live2dcubismcore.min.js?")},function(t,e,r){"use strict";r.r(e);var i=r(18);r.d(e,"LOGICAL_WIDTH",(function(){return i["g"]})),r.d(e,"LOGICAL_HEIGHT",(function(){return i["f"]})),r.d(e,"ExpressionManager",(function(){return i["a"]})),r.d(e,"FocusController",(function(){return i["c"]})),r.d(e,"ModelSettings",(function(){return i["l"]})),r.d(e,"MotionPriority",(function(){return i["o"]})),r.d(e,"MotionState",(function(){return i["p"]})),r.d(e,"MotionPreloadStrategy",(function(){return i["n"]})),r.d(e,"MotionManager",(function(){return i["m"]})),r.d(e,"SoundManager",(function(){return i["q"]})),r.d(e,"InternalModel",(function(){return i["e"]})),r.d(e,"Live2DModel",(function(){return i["j"]})),r.d(e,"Live2DTransform",(function(){return i["k"]})),r.d(e,"InteractionMixin",(function(){return i["d"]})),r.d(e,"config",(function(){return i["w"]})),r.d(e,"VERSION",(function(){return i["r"]})),r.d(e,"Live2DFactory",(function(){return i["h"]})),r.d(e,"Live2DLoader",(function(){return i["i"]})),r.d(e,"XHRLoader",(function(){return i["s"]})),r.d(e,"FileLoader",(function(){return i["b"]})),r.d(e,"ZipLoader",(function(){return i["t"]})),r.d(e,"logger",(function(){return i["A"]})),r.d(e,"clamp",(function(){return i["v"]})),r.d(e,"rand",(function(){return i["B"]})),r.d(e,"copyProperty",(function(){return i["y"]})),r.d(e,"copyArray",(function(){return i["x"]})),r.d(e,"applyMixins",(function(){return i["u"]})),r.d(e,"folderName",(function(){return i["z"]}));var n=r(23);r.d(e,"Cubism2ExpressionManager",(function(){return n["a"]})),r.d(e,"Cubism2InternalModel",(function(){return n["b"]})),r.d(e,"Cubism2ModelSettings",(function(){return n["c"]})),r.d(e,"Cubism2MotionManager",(function(){return n["d"]})),r.d(e,"Live2DExpression",(function(){return n["e"]})),r.d(e,"Live2DEyeBlink",(function(){return n["f"]})),r.d(e,"Live2DPhysics",(function(){return n["g"]})),r.d(e,"Live2DPose",(function(){return n["h"]}));var o=r(22);r.d(e,"Cubism4ExpressionManager",(function(){return o["a"]})),r.d(e,"Cubism4ModelSettings",(function(){return o["c"]})),r.d(e,"Cubism4MotionManager",(function(){return o["d"]})),r.d(e,"Cubism4InternalModel",(function(){return o["b"]})),r.d(e,"cubism4Ready",(function(){return o["e"]})),r.d(e,"startUpCubism4",(function(){return o["f"]}))}])}))},"097b":function(t,e,r){var i=r("d032"),n="__lodash_hash_undefined__",o=Object.prototype,s=o.hasOwnProperty;function a(t){var e=this.__data__;if(i){var r=e[t];return r===n?void 0:r}return s.call(e,t)?e[t]:void 0}t.exports=a},"0a2d":function(t,e){function r(t,e){var r=-1,i=null==t?0:t.length,n=0,o=[];while(++r",'"',"`"," ","\r","\n","\t"],l=["{","}","|","\\","^","`"].concat(h),c=["'"].concat(l),d=["%","/","?",";","#"].concat(c),p=["/","?","#"],f=255,m=/^[+a-z0-9A-Z_-]{0,63}$/,g=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},_={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},x=r("b383");function b(t,e,r){if(t&&n.isObject(t)&&t instanceof o)return t;var i=new o;return i.parse(t,e,r),i}function T(t){return n.isString(t)&&(t=b(t)),t instanceof o?t.format():o.prototype.format.call(t)}function E(t,e){return b(t,!1,!0).resolve(e)}function w(t,e){return t?b(t,!1,!0).resolveObject(e):e}o.prototype.parse=function(t,e,r){if(!n.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),a=-1!==o&&o127?F+="x":F+=L[N];if(!F.match(m)){var U=D.slice(0,O),k=D.slice(O+1),j=L.match(g);j&&(U.push(j[1]),k.unshift(j[2])),k.length&&(b="/"+k.join(".")+b),this.hostname=U.join(".");break}}}this.hostname.length>f?this.hostname="":this.hostname=this.hostname.toLowerCase(),A||(this.hostname=i.toASCII(this.hostname));var X=this.port?":"+this.port:"",G=this.hostname||"";this.host=G+X,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!v[w])for(O=0,R=c.length;O0)&&r.host.split("@");P&&(r.auth=P.shift(),r.host=r.hostname=P.shift())}return r.search=t.search,r.query=t.query,n.isNull(r.pathname)&&n.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!E.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var S=E.slice(-1)[0],I=(r.host||t.host||E.length>1)&&("."===S||".."===S)||""===S,M=0,O=E.length;O>=0;O--)S=E[O],"."===S?E.splice(O,1):".."===S?(E.splice(O,1),M++):M&&(E.splice(O,1),M--);if(!b&&!T)for(;M--;M)E.unshift("..");!b||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),I&&"/"!==E.join("/").substr(-1)&&E.push("");var C=""===E[0]||E[0]&&"/"===E[0].charAt(0);if(w){r.hostname=r.host=C?"":E.length?E.shift():"";P=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");P&&(r.auth=P.shift(),r.host=r.hostname=P.shift())}return b=b||r.host&&E.length,b&&!C&&E.unshift(""),E.length?r.pathname=E.join("/"):(r.pathname=null,r.path=null),n.isNull(r.pathname)&&n.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},"0c17":function(t,e){function r(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}t.exports=r},"0ce9":function(t,e,r){var i=r("fc7e"),n=r("5ca3"),o=r("7103"),s=200;function a(t,e){var r=this.__data__;if(r instanceof i){var a=r.__data__;if(!n||a.length-1)p!==t&&h.call(p,f,1),h.call(t,f,1)}return t}t.exports=l},"13ab":function(t,e,r){var i=r("d032"),n="__lodash_hash_undefined__";function o(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=i&&void 0===e?n:e,this}t.exports=o},"142c":function(t,e,r){var i=r("28f4"),n=i.Uint8Array;t.exports=n},"15e0":function(t,e,r){var i=r("c3ce");function n(t){return function(e){return i(e,t)}}t.exports=n},1642:function(t,e){function r(t,e){var r=-1,i=null==t?0:t.length;while(++r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=h-l,T=Math.floor,E=String.fromCharCode;function w(t){throw new RangeError(x[t])}function P(t,e){var r=t.length,i=[];while(r--)i[r]=e(t[r]);return i}function S(t,e){var r=t.split("@"),i="";r.length>1&&(i=r[0]+"@",t=r[1]),t=t.replace(y,".");var n=t.split("."),o=P(n,e).join(".");return i+o}function I(t){var e,r,i=[],n=0,o=t.length;while(n=55296&&e<=56319&&n65535&&(t-=65536,e+=E(t>>>10&1023|55296),t=56320|1023&t),e+=E(t),e})).join("")}function O(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:h}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function A(t,e,r){var i=0;for(t=r?T(t/p):t>>1,t+=T(t/e);t>b*c>>1;i+=h)t=T(t/b);return T(i+(b+1)*t/(t+d))}function D(t){var e,r,i,n,o,s,a,d,p,v,_=[],y=t.length,x=0,b=m,E=f;for(r=t.lastIndexOf(g),r<0&&(r=0),i=0;i=128&&w("not-basic"),_.push(t.charCodeAt(i));for(n=r>0?r+1:0;n=y&&w("invalid-input"),d=O(t.charCodeAt(n++)),(d>=h||d>T((u-x)/s))&&w("overflow"),x+=d*s,p=a<=E?l:a>=E+c?c:a-E,dT(u/v)&&w("overflow"),s*=v}e=_.length+1,E=A(x-o,e,0==o),T(x/e)>u-b&&w("overflow"),b+=T(x/e),x%=e,_.splice(x++,0,b)}return M(_)}function R(t){var e,r,i,n,o,s,a,d,p,v,_,y,x,b,P,S=[];for(t=I(t),y=t.length,e=m,r=0,o=f,s=0;s=e&&_T((u-r)/x)&&w("overflow"),r+=(a-e)*x,e=a,s=0;su&&w("overflow"),_==e){for(d=r,p=h;;p+=h){if(v=p<=o?l:p>=o+c?c:p-o,d-1&&t%1==0&&t80*r){i=a=t[0],o=u=t[1];for(var v=r;va&&(a=h),l>u&&(u=l);d=Math.max(a-i,u-o),d=0!==d?1/d:0}return s(m,g,r,i,o,d),g}function n(t,e,r,i,n){var o,s;if(n===L(t,e,r,i)>0)for(o=e;o=e;o-=i)s=A(o,t[o],t[o+1],s);return s&&E(s,s.next)&&(D(s),s=s.next),s}function o(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!E(i,i.next)&&0!==T(i.prev,i,i.next))i=i.next;else{if(D(i),i=e=i.prev,i===i.next)break;r=!0}}while(r||i!==e);return e}function s(t,e,r,i,n,c,d){if(t){!d&&c&&g(t,i,n,c);var p,f,m=t;while(t.prev!==t.next)if(p=t.prev,f=t.next,c?u(t,i,n,c):a(t))e.push(p.i/r),e.push(t.i/r),e.push(f.i/r),D(t),t=f.next,m=f.next;else if(t=f,t===m){d?1===d?(t=h(o(t),e,r),s(t,e,r,i,n,c,2)):2===d&&l(t,e,r,i,n,c):s(o(t),e,r,i,n,c,1);break}}}function a(t){var e=t.prev,r=t,i=t.next;if(T(e,r,i)>=0)return!1;var n=t.next.next;while(n!==t.prev){if(x(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&T(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function u(t,e,r,i){var n=t.prev,o=t,s=t.next;if(T(n,o,s)>=0)return!1;var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=_(a,u,e,r,i),d=_(h,l,e,r,i),p=t.prevZ,f=t.nextZ;while(p&&p.z>=c&&f&&f.z<=d){if(p!==t.prev&&p!==t.next&&x(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&T(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&x(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&T(f.prev,f,f.next)>=0)return!1;f=f.nextZ}while(p&&p.z>=c){if(p!==t.prev&&p!==t.next&&x(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&T(p.prev,p,p.next)>=0)return!1;p=p.prevZ}while(f&&f.z<=d){if(f!==t.prev&&f!==t.next&&x(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&T(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function h(t,e,r){var i=t;do{var n=i.prev,s=i.next.next;!E(n,s)&&w(n,i,i.next,s)&&M(n,s)&&M(s,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(s.i/r),D(i),D(i.next),i=t=s),i=i.next}while(i!==t);return o(i)}function l(t,e,r,i,n,a){var u=t;do{var h=u.next.next;while(h!==u.prev){if(u.i!==h.i&&b(u,h)){var l=C(u,h);return u=o(u,u.next),l=o(l,l.next),s(u,e,r,i,n,a),void s(l,e,r,i,n,a)}h=h.next}u=u.next}while(u!==t)}function c(t,e,r,i){var s,a,u,h,l,c=[];for(s=0,a=e.length;s=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s){if(s=a,a===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x=i.x&&i.x>=l&&n!==i.x&&x(or.x||i.x===r.x&&m(r,i)))&&(r=i,d=u)),i=i.next}while(i!==h);return r}function m(t,e){return T(t.prev,t,e.prev)<0&&T(e.next,t,t.next)<0}function g(t,e,r,i){var n=t;do{null===n.z&&(n.z=_(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,v(n)}function v(t){var e,r,i,n,o,s,a,u,h=1;do{r=t,t=null,o=null,s=0;while(r){for(s++,i=r,a=0,e=0;e0||u>0&&i)0!==a&&(0===u||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,u--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,h*=2}while(s>1);return t}function _(t,e,r,i,n){return t=32767*(t-r)*n,e=32767*(e-i)*n,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function y(t){var e=t,r=t;do{(e.x=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function b(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!I(t,e)&&(M(t,e)&&M(e,t)&&O(t,e)&&(T(t.prev,t,e.prev)||T(t,e.prev,e))||E(t,e)&&T(t.prev,t,t.next)>0&&T(e.prev,e,e.next)>0)}function T(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function E(t,e){return t.x===e.x&&t.y===e.y}function w(t,e,r,i){var n=S(T(t,e,r)),o=S(T(t,e,i)),s=S(T(r,i,t)),a=S(T(r,i,e));return n!==o&&s!==a||(!(0!==n||!P(t,r,e))||(!(0!==o||!P(t,i,e))||(!(0!==s||!P(r,t,i))||!(0!==a||!P(r,e,i)))))}function P(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function S(t){return t>0?1:t<0?-1:0}function I(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&w(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function M(t,e){return T(t.prev,t,t.next)<0?T(t,e,t.next)>=0&&T(t,t.prev,e)>=0:T(t,e,t.prev)<0||T(t,t.next,e)<0}function O(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!==r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}function C(t,e){var r=new R(t.i,t.x,t.y),i=new R(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function A(t,e,r,i){var n=new R(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function D(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 R(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function L(t,e,r,i){for(var n=0,o=e,s=r-i;o0&&(i+=t[n-1].length,r.holes.push(i))}return r}},"56dc":function(t,e,r){var i=r("4fb2"),n=r("ffce");function o(t,e){return null!=t&&n(t,e,i)}t.exports=o},"58d2":function(t,e,r){var i=r("dca5"),n=r("17cd"),o=r("389c"),s=r("27d4"),a=r("da60");function u(t){return"function"==typeof t?t:null==t?o:"object"==typeof t?s(t)?n(t[0],t[1]):i(t):a(t)}t.exports=u},"5ca3":function(t,e,r){var i=r("d9e0"),n=r("28f4"),o=i(n,"Map");t.exports=o},"5d95":function(t,e,r){var i=r("ea62"),n=r("00b7"),o=r("7b7e");function s(t){return i(t,o,n)}t.exports=s},"60d6":function(t,e,r){"use strict";r.d(e,"a",(function(){return i})); +var i,n,o,s,a,u,h,l,c,d,p,f,m,g,v,_,y;r.d(e,"a",(function(){return f})),r.d(e,"b",(function(){return s})),r.d(e,"c",(function(){return o})),r.d(e,"d",(function(){return m})),r.d(e,"e",(function(){return a})),r.d(e,"f",(function(){return i})),r.d(e,"g",(function(){return u})),r.d(e,"h",(function(){return g})),r.d(e,"i",(function(){return _})),r.d(e,"j",(function(){return p})),r.d(e,"k",(function(){return y})),r.d(e,"l",(function(){return v})),r.d(e,"m",(function(){return n})),r.d(e,"n",(function(){return c})),r.d(e,"o",(function(){return h})),r.d(e,"p",(function(){return l})),r.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"}(i||(i={})),function(t){t[t["UNKNOWN"]=0]="UNKNOWN",t[t["WEBGL"]=1]="WEBGL",t[t["CANVAS"]=2]="CANVAS"}(n||(n={})),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"}(s||(s={})),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"}(a||(a={})),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"}(u||(u={})),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"}(h||(h={})),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"}(v||(v={})),function(t){t[t["NONE"]=0]="NONE",t[t["SCISSOR"]=1]="SCISSOR",t[t["STENCIL"]=2]="STENCIL",t[t["SPRITE"]=3]="SPRITE"}(_||(_={})),function(t){t[t["NONE"]=0]="NONE",t[t["LOW"]=2]="LOW",t[t["MEDIUM"]=4]="MEDIUM",t[t["HIGH"]=8]="HIGH"}(y||(y={}))},"4c91":function(t,e){function r(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}t.exports=r},"4e3c":function(t,e,r){var i=r("1967"),n=r("f6cc"),o=r("ffc6"),s="[object Null]",a="[object Undefined]",u=i?i.toStringTag:void 0;function h(t){return null==t?void 0===t?a:s:u&&u in Object(t)?n(t):o(t)}t.exports=h},"4e4e":function(t,e){function r(t,e){return t===e||t!==t&&e!==e}t.exports=r},"4fb2":function(t,e){function r(t,e){return null!=t&&e in Object(t)}t.exports=r},5011:function(t,e,r){var i=r("27d4"),n=r("7bec"),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;function a(t,e){if(i(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!n(t))||(s.test(t)||!o.test(t)||null!=e&&t in Object(e))}t.exports=a},"50b2":function(t,e){var r=9007199254740991,i=/^(?:0|[1-9]\d*)$/;function n(t,e){var n=typeof t;return e=null==e?r:e,!!e&&("number"==n||"symbol"!=n&&i.test(t))&&t>-1&&t%1==0&&t80*r){i=a=t[0],o=u=t[1];for(var v=r;va&&(a=h),l>u&&(u=l);d=Math.max(a-i,u-o),d=0!==d?1/d:0}return s(m,g,r,i,o,d),g}function n(t,e,r,i,n){var o,s;if(n===L(t,e,r,i)>0)for(o=e;o=e;o-=i)s=A(o,t[o],t[o+1],s);return s&&E(s,s.next)&&(D(s),s=s.next),s}function o(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!E(i,i.next)&&0!==T(i.prev,i,i.next))i=i.next;else{if(D(i),i=e=i.prev,i===i.next)break;r=!0}}while(r||i!==e);return e}function s(t,e,r,i,n,c,d){if(t){!d&&c&&g(t,i,n,c);var p,f,m=t;while(t.prev!==t.next)if(p=t.prev,f=t.next,c?u(t,i,n,c):a(t))e.push(p.i/r),e.push(t.i/r),e.push(f.i/r),D(t),t=f.next,m=f.next;else if(t=f,t===m){d?1===d?(t=h(o(t),e,r),s(t,e,r,i,n,c,2)):2===d&&l(t,e,r,i,n,c):s(o(t),e,r,i,n,c,1);break}}}function a(t){var e=t.prev,r=t,i=t.next;if(T(e,r,i)>=0)return!1;var n=t.next.next;while(n!==t.prev){if(x(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&T(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function u(t,e,r,i){var n=t.prev,o=t,s=t.next;if(T(n,o,s)>=0)return!1;var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=_(a,u,e,r,i),d=_(h,l,e,r,i),p=t.prevZ,f=t.nextZ;while(p&&p.z>=c&&f&&f.z<=d){if(p!==t.prev&&p!==t.next&&x(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&T(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&x(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&T(f.prev,f,f.next)>=0)return!1;f=f.nextZ}while(p&&p.z>=c){if(p!==t.prev&&p!==t.next&&x(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&T(p.prev,p,p.next)>=0)return!1;p=p.prevZ}while(f&&f.z<=d){if(f!==t.prev&&f!==t.next&&x(n.x,n.y,o.x,o.y,s.x,s.y,f.x,f.y)&&T(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function h(t,e,r){var i=t;do{var n=i.prev,s=i.next.next;!E(n,s)&&w(n,i,i.next,s)&&M(n,s)&&M(s,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(s.i/r),D(i),D(i.next),i=t=s),i=i.next}while(i!==t);return o(i)}function l(t,e,r,i,n,a){var u=t;do{var h=u.next.next;while(h!==u.prev){if(u.i!==h.i&&b(u,h)){var l=C(u,h);return u=o(u,u.next),l=o(l,l.next),s(u,e,r,i,n,a),void s(l,e,r,i,n,a)}h=h.next}u=u.next}while(u!==t)}function c(t,e,r,i){var s,a,u,h,l,c=[];for(s=0,a=e.length;s=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&a>s){if(s=a,a===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x=i.x&&i.x>=l&&n!==i.x&&x(or.x||i.x===r.x&&m(r,i)))&&(r=i,d=u)),i=i.next}while(i!==h);return r}function m(t,e){return T(t.prev,t,e.prev)<0&&T(e.next,t,t.next)<0}function g(t,e,r,i){var n=t;do{null===n.z&&(n.z=_(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,v(n)}function v(t){var e,r,i,n,o,s,a,u,h=1;do{r=t,t=null,o=null,s=0;while(r){for(s++,i=r,a=0,e=0;e0||u>0&&i)0!==a&&(0===u||!i||r.z<=i.z)?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,u--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,h*=2}while(s>1);return t}function _(t,e,r,i,n){return t=32767*(t-r)*n,e=32767*(e-i)*n,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function y(t){var e=t,r=t;do{(e.x=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function b(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!I(t,e)&&(M(t,e)&&M(e,t)&&O(t,e)&&(T(t.prev,t,e.prev)||T(t,e.prev,e))||E(t,e)&&T(t.prev,t,t.next)>0&&T(e.prev,e,e.next)>0)}function T(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function E(t,e){return t.x===e.x&&t.y===e.y}function w(t,e,r,i){var n=S(T(t,e,r)),o=S(T(t,e,i)),s=S(T(r,i,t)),a=S(T(r,i,e));return n!==o&&s!==a||(!(0!==n||!P(t,r,e))||(!(0!==o||!P(t,i,e))||(!(0!==s||!P(r,t,i))||!(0!==a||!P(r,e,i)))))}function P(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function S(t){return t>0?1:t<0?-1:0}function I(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&w(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function M(t,e){return T(t.prev,t,t.next)<0?T(t,e,t.next)>=0&&T(t,t.prev,e)>=0:T(t,e,t.prev)<0||T(t,t.next,e)<0}function O(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!==r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==t);return i}function C(t,e){var r=new R(t.i,t.x,t.y),i=new R(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function A(t,e,r,i){var n=new R(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function D(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 R(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function L(t,e,r,i){for(var n=0,o=e,s=r-i;o0&&(i+=t[n-1].length,r.holes.push(i))}return r}},"56dc":function(t,e,r){var i=r("4fb2"),n=r("ffce");function o(t,e){return null!=t&&n(t,e,i)}t.exports=o},"58d2":function(t,e,r){var i=r("dca5"),n=r("17cd"),o=r("389c"),s=r("27d4"),a=r("da60");function u(t){return"function"==typeof t?t:null==t?o:"object"==typeof t?s(t)?n(t[0],t[1]):i(t):a(t)}t.exports=u},"5ca3":function(t,e,r){var i=r("d9e0"),n=r("28f4"),o=i(n,"Map");t.exports=o},"5d95":function(t,e,r){var i=r("ea62"),n=r("00b7"),o=r("7b7e");function s(t){return i(t,o,n)}t.exports=s},"5db5":function(t,e,r){},"60d6":function(t,e,r){"use strict";r.d(e,"a",(function(){return i})); /*! * @pixi/runner - v5.3.7 * Compiled Tue, 29 Dec 2020 19:30:11 UTC @@ -48,7 +48,7 @@ and limitations under the License. * * @pixi/utils is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license - */i["b"].RETINA_PREFIX=/@([0-9\.]+)x/,i["b"].FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!0;var c,d=!1,p="5.3.7";function f(){d=!0}function m(t){var e;if(!d){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var r=["\n %c %c %c PixiJS "+p+" - ✰ "+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,r)}else window.console&&window.console.log("PixiJS "+p+" - "+t+" - http://www.pixijs.com/");d=!0}}function g(){return"undefined"===typeof c&&(c=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:i["b"].FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),n=!(!r||!r.getContextAttributes().stencil);if(r){var o=r.getExtension("WEBGL_lose_context");o&&o.loseContext()}return r=null,n}catch(s){return!1}}()),c}function v(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 _(t){var e=t.toString(16);return e="000000".substr(0,6-e.length)+e,"#"+e}function y(t){return"string"===typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}function x(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}function b(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;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 i=[];return i.push(e),i.push(t),i}var T=b();function E(t,e){return T[e?1:0][t]}function w(t,e,r,i){return r=r||new Float32Array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r}function P(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return r=r*e+.5|0,i=i*e+.5|0,n=n*e+.5|0,(255*e<<24)+(r<<16)+(i<<8)+n}function S(t,e,r,i){return r=r||new Float32Array(4),r[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}function I(t,e){void 0===e&&(e=null);var r=6*t;if(e=e||new Uint16Array(r),e.length!==r)throw new Error("Out buffer length is incorrect, got "+e.length+" and expected "+r);for(var i=0,n=0;i>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1}function D(t){return!(t&t-1)&&!!t}function R(t){var e=(t>65535?1:0)<<4;t>>>=e;var r=(t>255?1:0)<<3;return t>>>=r,e|=r,r=(t>15?1:0)<<2,t>>>=r,e|=r,r=(t>3?1:0)<<1,t>>>=r,e|=r,e|t>>1}function L(t,e,r){var i,n=t.length;if(!(e>=n||0===r)){r=e+r>n?n-e:r;var o=n-r;for(i=e;i1&&"undefined"===typeof MSStream};function y(t){return function(e){return e.test(t)}}function x(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 r=e.userAgent,x=r.split("[FBAN");"undefined"!==typeof x[1]&&(r=x[0]),x=r.split("Twitter"),"undefined"!==typeof x[1]&&(r=x[0]);var b=y(r),T={apple:{phone:b(i)&&!b(c),ipod:b(n),tablet:!b(i)&&(b(o)||_(e))&&!b(c),universal:b(s),device:(b(i)||b(n)||b(o)||b(s)||_(e))&&!b(c)},amazon:{phone:b(h),tablet:!b(h)&&b(l),device:b(h)||b(l)},android:{phone:!b(c)&&b(h)||!b(c)&&b(a),tablet:!b(c)&&!b(h)&&!b(a)&&(b(l)||b(u)),device:!b(c)&&(b(h)||b(l)||b(a)||b(u))||b(/\bokhttp\b/i)},windows:{phone:b(c),tablet:b(d),device:b(c)||b(d)},other:{blackberry:b(p),blackberry10:b(f),opera:b(m),firefox:b(v),chrome:b(g),device:b(p)||b(f)||b(m)||b(v)||b(g)},any:!1,phone:!1,tablet:!1};return T.any=T.apple.device||T.android.device||T.windows.device||T.other.device,T.phone=T.apple.phone||T.android.phone||T.windows.phone,T.tablet=T.apple.tablet||T.android.tablet||T.windows.tablet,T} + */i["b"].RETINA_PREFIX=/@([0-9\.]+)x/,i["b"].FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!0;var c,d=!1,p="5.3.7";function f(){d=!0}function m(t){var e;if(!d){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var r=["\n %c %c %c PixiJS "+p+" - ✰ "+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,r)}else window.console&&window.console.log("PixiJS "+p+" - "+t+" - http://www.pixijs.com/");d=!0}}function g(){return"undefined"===typeof c&&(c=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:i["b"].FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),n=!(!r||!r.getContextAttributes().stencil);if(r){var o=r.getExtension("WEBGL_lose_context");o&&o.loseContext()}return r=null,n}catch(s){return!1}}()),c}function v(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 _(t){var e=t.toString(16);return e="000000".substr(0,6-e.length)+e,"#"+e}function y(t){return"string"===typeof t&&"#"===t[0]&&(t=t.substr(1)),parseInt(t,16)}function x(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)}function b(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;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 i=[];return i.push(e),i.push(t),i}var T=b();function E(t,e){return T[e?1:0][t]}function w(t,e,r,i){return r=r||new Float32Array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]),r[3]=e,r}function P(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return r=r*e+.5|0,i=i*e+.5|0,n=n*e+.5|0,(255*e<<24)+(r<<16)+(i<<8)+n}function S(t,e,r,i){return r=r||new Float32Array(4),r[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,(i||void 0===i)&&(r[0]*=e,r[1]*=e,r[2]*=e),r[3]=e,r}function I(t,e){void 0===e&&(e=null);var r=6*t;if(e=e||new Uint16Array(r),e.length!==r)throw new Error("Out buffer length is incorrect, got "+e.length+" and expected "+r);for(var i=0,n=0;i>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1}function D(t){return!(t&t-1)&&!!t}function R(t){var e=(t>65535?1:0)<<4;t>>>=e;var r=(t>255?1:0)<<3;return t>>>=r,e|=r,r=(t>15?1:0)<<2,t>>>=r,e|=r,r=(t>3?1:0)<<1,t>>>=r,e|=r,e|t>>1}function L(t,e,r){var i,n=t.length;if(!(e>=n||0===r)){r=e+r>n?n-e:r;var o=n-r;for(i=e;i1&&"undefined"===typeof MSStream};function y(t){return function(e){return e.test(t)}}function x(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 r=e.userAgent,x=r.split("[FBAN");"undefined"!==typeof x[1]&&(r=x[0]),x=r.split("Twitter"),"undefined"!==typeof x[1]&&(r=x[0]);var b=y(r),T={apple:{phone:b(i)&&!b(c),ipod:b(n),tablet:!b(i)&&(b(o)||_(e))&&!b(c),universal:b(s),device:(b(i)||b(n)||b(o)||b(s)||_(e))&&!b(c)},amazon:{phone:b(h),tablet:!b(h)&&b(l),device:b(h)||b(l)},android:{phone:!b(c)&&b(h)||!b(c)&&b(a),tablet:!b(c)&&!b(h)&&!b(a)&&(b(l)||b(u)),device:!b(c)&&(b(h)||b(l)||b(a)||b(u))||b(/\bokhttp\b/i)},windows:{phone:b(c),tablet:b(d),device:b(c)||b(d)},other:{blackberry:b(p),blackberry10:b(f),opera:b(m),firefox:b(v),chrome:b(g),device:b(p)||b(f)||b(m)||b(v)||b(g)},any:!1,phone:!1,tablet:!1};return T.any=T.apple.device||T.android.device||T.windows.device||T.other.device,T.phone=T.apple.phone||T.android.phone||T.windows.phone,T.tablet=T.apple.tablet||T.android.tablet||T.windows.tablet,T} /*! * @pixi/settings - v5.3.7 * Compiled Tue, 29 Dec 2020 19:30:11 UTC @@ -77,7 +77,7 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. -***************************************************************************** */var c=function(t,e){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},c(t,e)};function d(t,e){function r(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}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 s["a"]("setRealSize"),this.onUpdate=new s["a"]("update"),this.onError=new s["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,r){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,r){var i=this,n=r||{},o=n.width,s=n.height;if(!o||!s)throw new Error("BufferResource width or height invalid");return i=t.call(this,o,s)||this,i.data=e,i}return d(e,t),e.prototype.upload=function(t,e,r){var i=t.gl;return i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===n["a"].UNPACK),r.width===e.width&&r.height===e.height?i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(r.width=e.width,r.height=e.height,i.texImage2D(e.target,0,r.internalFormat,e.width,e.height,0,e.format,r.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:n["n"].NEAREST,format:n["g"].RGBA,alphaMode:n["a"].NPM},g=function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=null);var s=t.call(this)||this;r=r||{};var a=r.alphaMode,u=r.mipmap,h=r.anisotropicLevel,c=r.scaleMode,d=r.width,f=r.height,m=r.wrapMode,g=r.format,v=r.type,_=r.target,y=r.resolution,x=r.resourceOptions;return!e||e instanceof p||(e=l(e,x),e.internal=!0),s.width=d||0,s.height=f||0,s.resolution=y||i["b"].RESOLUTION,s.mipmap=void 0!==u?u:i["b"].MIPMAP_TEXTURES,s.anisotropicLevel=void 0!==h?h:i["b"].ANISOTROPIC_LEVEL,s.wrapMode=m||i["b"].WRAP_MODE,s.scaleMode=void 0!==c?c:i["b"].SCALE_MODE,s.format=g||n["g"].RGBA,s.type=v||n["p"].UNSIGNED_BYTE,s.target=_||n["o"].TEXTURE_2D,s.alphaMode=void 0!==a?a:n["a"].UNPACK,void 0!==r.premultiplyAlpha&&(s.premultiplyAlpha=r.premultiplyAlpha),s.uid=Object(o["uid"])(),s.touched=0,s.isPowerOfTwo=!1,s._refreshPOT(),s._glTextures={},s.dirtyId=0,s.dirtyStyleId=0,s.cacheId=null,s.valid=d>0&&f>0,s.textureCacheIds=[],s.destroyed=!1,s.resource=null,s._batchEnabled=0,s._batchLocation=0,s.parentTextureArray=null,s.setResource(e),s}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 r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,r){return this.resolution=r||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,r,n){void 0===n&&(n=i["b"].STRICT_TEXTURE_CACHE);var s="string"===typeof t,a=null;s?a=t:(t._pixiId||(t._pixiId="pixiid_"+Object(o["uid"])()),a=t._pixiId);var u=o["BaseTextureCache"][a];if(s&&n&&!u)throw new Error('The cacheId "'+a+'" does not exist in BaseTextureCache.');return u||(u=new e(t,r),u.cacheId=a,e.addToCache(u,a)),u},e.fromBuffer=function(t,r,i,o){t=t||new Float32Array(r*i*4);var s=new f(t,{width:r,height:i}),a=t instanceof Float32Array?n["p"].FLOAT:n["p"].UNSIGNED_BYTE;return new e(s,Object.assign(m,o||{width:r,height:i,type:a}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),o["BaseTextureCache"][e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),o["BaseTextureCache"][e]=t)},e.removeFromCache=function(t){if("string"===typeof t){var e=o["BaseTextureCache"][t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete o["BaseTextureCache"][t],e}}else if(t&&t.textureCacheIds){for(var i=0;i0){if(!t.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(t.resource,e)}else t.target=n["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,r,i){for(var n=this.itemDirtyIds,o=0;o]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e}(y),w=function(t){function e(r,i){var n=this;if(i=i||{},!(r instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),"string"===typeof r&&(r=[r]);var s=r[0].src||r[0];y.crossOrigin(o,s,i.crossorigin);for(var a=0;a0&&!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&&(a["a"].shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&(a["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&&a["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?(a["a"].shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(a["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,r){return t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},e.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],e.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},e}(y),P=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}(y);h.push(T,P,x,w,E,f,b,_);var S={Resource:p,BaseImageResource:y,INSTALLED:h,autoDetectResource:l,AbstractMultiResource:v,ArrayResource:_,BufferResource:f,CanvasResource:x,CubeResource:b,ImageResource:T,SVGResource:E,VideoResource:w,ImageBitmapResource:P},I=function(){function t(t){this.renderer=t}return t.prototype.destroy=function(){this.renderer=null},t}(),M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return d(e,t),e.prototype.upload=function(t,e,r){var i=t.gl;return i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===n["a"].UNPACK),r.width===e.width&&r.height===e.height?i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(r.width=e.width,r.height=e.height,i.texImage2D(e.target,0,1===t.context.webGLVersion?i.DEPTH_COMPONENT:i.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(f),O=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 s["a"]("disposeFramebuffer"),this.multisample=n["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:n["n"].NEAREST,resolution:1,mipmap:n["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 M(null,{width:this.width,height:this.height}),{scaleMode:n["n"].NEAREST,resolution:1,width:this.width,height:this.height,mipmap:n["j"].OFF,format:n["g"].DEPTH_COMPONENT,type:n["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 r=0;r-1&&e.textureCacheIds.splice(r,1),delete o["TextureCache"][t],e}}else if(t&&t.textureCacheIds){for(var i=0;ithis.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",u="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,h="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+a+" "+h)}this.valid=i&&n&&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 L(){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 x(t)))}function F(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}R.EMPTY=new R(new g),F(R.EMPTY),F(R.EMPTY.baseTexture),R.WHITE=L(),F(R.WHITE),F(R.WHITE.baseTexture);var N=function(t){function e(e,r){var i=this,n=null;if(!(e instanceof C)){var o=arguments[1],s=arguments[2],a=arguments[3],u=arguments[4];console.warn("Please use RenderTexture.create("+o+", "+s+") instead of the ctor directly."),n=arguments[0],r=null,e=new C({width:o,height:s,scaleMode:a,resolution:u})}return i=t.call(this,e,r)||this,i.legacyRenderer=n,i.valid=!0,i.filterFrame=null,i.filterPoolKey=null,i.updateUvs(),i}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,r){void 0===r&&(r=!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,r&&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 C(t))},e}(R),B=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 r=new C(Object.assign({width:t,height:e,resolution:1},this.textureOptions));return new N(r)},t.prototype.getOptimalTexture=function(e,r,i){void 0===i&&(i=1);var n=t.SCREEN_KEY;e*=i,r*=i,this.enableFullScreen&&e===this._pixelsWidth&&r===this._pixelsHeight||(e=Object(o["nextPow2"])(e),r=Object(o["nextPow2"])(r),n=(65535&e)<<16|65535&r),this.texturePool[n]||(this.texturePool[n]=[]);var s=this.texturePool[n].pop();return s||(s=this.createTexture(e,r)),s.filterPoolKey=n,s.setResolution(i),s},t.prototype.getFilterTexture=function(t,e){var r=this.getOptimalTexture(t.width,t.height,e||t.resolution);return r.filterFrame=t.filterFrame,r},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,t)for(var e in this.texturePool){var r=this.texturePool[e];if(r)for(var i=0;i0&&e.height>0,i)for(var n=0;n1){for(var h=0;h1&&this.renderer.framebuffer.blit(),1===r.length)r[0].apply(this,e.renderTexture,h.renderTexture,n["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=0;--i)t[i]=r[i]||null,t[i]&&(t[i]._batchLocation=i)},e.prototype.boundArray=function(t,e,r,i){for(var n=t.elements,o=t.ids,s=t.count,a=0,u=0;u=0&&l=n["f"].WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),!r)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,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(),r="WebGL2RenderingContext"in window&&t instanceof window.WebGL2RenderingContext;r&&(this.webGLVersion=2),e.stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var i=r||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=i,i||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},e}(I),nt=function(){function t(t){this.framebuffer=t,this.stencil=null,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.multisample=n["k"].NONE,this.msaaBuffer=null,this.blitFramebuffer=null}return t}(),ot=new u["Rectangle"],st=function(t){function e(e){var r=t.call(this,e)||this;return r.managedFramebuffers=[],r.unknownFramebuffer=new O(10,10),r.msaaSamples=null,r}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 u["Rectangle"],this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;i["b"].PREFER_ENV===n["f"].WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)},e.prototype.bind=function(t,e){var r=this.gl;if(t){var i=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.dirtyId!==t.dirtyId&&(i.dirtyId=t.dirtyId,i.dirtyFormat!==t.dirtyFormat?(i.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):i.dirtySize!==t.dirtySize&&(i.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&(r.msaaBuffer=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,e.RGBA8,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,r.msaaBuffer));for(var o=[],s=0;s1)){var a=t.colorTextures[s],u=a.parentTextureArray||a;this.renderer.texture.bind(u,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+s,a.target,u._glTextures[this.CONTEXT_UID].texture,0),o.push(e.COLOR_ATTACHMENT0+s)}if(o.length>1&&e.drawBuffers(o),t.depthTexture){var h=this.writeDepthTexture;if(h){var l=t.depthTexture;this.renderer.texture.bind(l,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,l._glTextures[this.CONTEXT_UID].texture,0)}}r.stencil||!t.stencil&&!t.depth||(r.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,r.stencil))},e.prototype.detectSamples=function(t){var e=this.msaaSamples,r=n["k"].NONE;if(t<=1||null===e)return r;for(var i=0;i=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.stencil&&i.deleteRenderbuffer(r.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r=i.data.byteLength)e.bufferSubData(o,0,i.data);else{var s=i.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=i.data.byteLength,e.bufferData(o,i.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var r=t.attributes,i=e.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var r=t.attributes,i=e.attributeData,n=["g",t.id];for(var o in r)i[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e,r){void 0===r&&(r=!0),this.checkCompatibility(t,e);var i=this.gl,n=this.CONTEXT_UID,o=this.getSignature(t,e),s=t.glVertexArrayObjects[this.CONTEXT_UID],a=s[o];if(a)return s[e.id]=a,a;var u=t.buffers,h=t.attributes,l={},c={};for(var d in u)l[d]=0,c[d]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),l[h[d].buffer]+=h[d].size*ut[h[d].type];for(var d in h){var p=h[d],f=p.size;void 0===p.stride&&(l[p.buffer]===f*ut[p.type]?p.stride=0:p.stride=l[p.buffer]),void 0===p.start&&(p.start=c[p.buffer],c[p.buffer]+=f*ut[p.type])}a=i.createVertexArray(),i.bindVertexArray(a);for(var m=0;m=n["f"].WEBGL2&&(e=t.getContext("webgl2",{})),e||(e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),vt=e}return vt}function yt(){if(!mt){mt=n["l"].MEDIUM;var t=_t();if(t&&t.getShaderPrecisionFormat){var e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);mt=e.precision?n["l"].HIGH:n["l"].MEDIUM}}return mt}function xt(t,e,r){if("precision"!==t.substring(0,9)){var i=e;return e===n["l"].HIGH&&r!==n["l"].HIGH&&(i=n["l"].MEDIUM),"precision "+i+" float;\n"+t}return r!==n["l"].HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var bt={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 Tt(t){return bt[t]}var Et=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 Pt(t,e){if(!Et){var r=Object.keys(wt);Et={};for(var i=0;i0&&(e+="\nelse "),re.name?1:-1}));for(o=0;o0?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,r=this.renderer.projection,i=r.transform,n=r.sourceFrame,o=r.destinationFrame,s=e?e.resolution:this.renderer.resolution,a=(t.x-n.x)*s+o.x,u=(t.y-n.y)*s+o.y,h=t.width*s,l=t.height*s;i&&(a+=i.tx*s,u+=i.ty*s),e||(u=this.renderer.height-l-u),this.renderer.gl.scissor(a,u,h,l)},e}(re),ne=function(t){function e(e){var r=t.call(this,e)||this;return r.glConst=WebGLRenderingContext.STENCIL_TEST,r}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,r=this.renderer.gl,i=t._stencilCounter;0===i&&(this.renderer.framebuffer.forceStencil(),r.enable(r.STENCIL_TEST)),t._stencilCounter++,r.colorMask(!1,!1,!1,!1),r.stencilFunc(r.EQUAL,i,this._getBitwiseMask()),r.stencilOp(r.KEEP,r.KEEP,r.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<>=1,r++;this.stateId=t.data}for(r=0;rthis.checkCountMax&&(this.checkCount=0,this.run())))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;ithis.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){var o=0;for(i=0;i=0;i--)this.unload(t.children[i])},e}(I),Ee=function(){function t(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}return t}(),we=function(t){function e(e){var r=t.call(this,e)||this;return r.boundTextures=[],r.currentLocation=-1,r.managedTextures=[],r._unknownBoundTextures=!1,r.unknownTexture=new g,r}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 r=0;r=1:e.mipmap=!1,2===this.webGLVersion||t.isPowerOfTwo?e.wrapMode=t.wrapMode:e.wrapMode=n["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 r=this.gl;if(e.mipmap&&r.generateMipmap(t.target),r.texParameteri(t.target,r.TEXTURE_WRAP_S,e.wrapMode),r.texParameteri(t.target,r.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode===n["n"].LINEAR?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST);var i=this.renderer.context.extensions.anisotropicFiltering;if(i&&t.anisotropicLevel>0&&t.scaleMode===n["n"].LINEAR){var o=Math.min(t.anisotropicLevel,r.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));r.texParameterf(t.target,i.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode===n["n"].LINEAR?r.LINEAR:r.NEAREST);r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode===n["n"].LINEAR?r.LINEAR:r.NEAREST)},e}(I),Pe={FilterSystem:Q,BatchSystem:et,ContextSystem:it,FramebufferSystem:st,GeometrySystem:ht,MaskSystem:ee,ScissorSystem:ie,StencilSystem:ne,ProjectionSystem:oe,RenderTextureSystem:he,ShaderSystem:fe,StateSystem:be,TextureGCSystem:Te,TextureSystem:we},Se=new u["Matrix"],Ie=function(t){function e(e,r){void 0===e&&(e=n["m"].UNKNOWN);var s=t.call(this)||this;return r=Object.assign({},i["b"].RENDER_OPTIONS,r),r.roundPixels&&(i["b"].ROUND_PIXELS=r.roundPixels,Object(o["deprecation"])("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),s.options=r,s.type=e,s.screen=new u["Rectangle"](0,0,r.width,r.height),s.view=r.view||document.createElement("canvas"),s.resolution=r.resolution||i["b"].RESOLUTION,s.transparent=r.transparent,s.autoDensity=r.autoDensity||r.autoResize||!1,s.preserveDrawingBuffer=r.preserveDrawingBuffer,s.clearBeforeRender=r.clearBeforeRender,s._backgroundColor=0,s._backgroundColorRgba=[0,0,0,0],s._backgroundColorString="#000000",s.backgroundColor=r.backgroundColor||s._backgroundColor,s._lastObjectRendered=null,s.plugins={},s}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,r,i){i=i||t.getLocalBounds(null,!0),0===i.width&&(i.width=1),0===i.height&&(i.height=1);var n=N.create({width:0|i.width,height:0|i.height,scaleMode:e,resolution:r});return Se.tx=-i.x,Se.ty=-i.y,this.render(t,n,!1,Se,!!t.parent),n},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);var r=this;r.plugins=null,r.type=n["m"].UNKNOWN,r.view=null,r.screen=null,r._tempDisplayObjectParent=null,r.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"]),Me=function(t){function e(r){var i=t.call(this,n["m"].WEBGL,r)||this;return r=i.options,i.gl=null,i.CONTEXT_UID=0,i.runners={destroy:new s["a"]("destroy"),contextChange:new s["a"]("contextChange"),reset:new s["a"]("reset"),update:new s["a"]("update"),postrender:new s["a"]("postrender"),prerender:new s["a"]("prerender"),resize:new s["a"]("resize")},i.globalUniforms=new $({projectionMatrix:new u["Matrix"]},!0),i.addSystem(ee,"mask").addSystem(it,"context").addSystem(be,"state").addSystem(fe,"shader").addSystem(we,"texture").addSystem(ht,"geometry").addSystem(st,"framebuffer").addSystem(ie,"scissor").addSystem(ne,"stencil").addSystem(oe,"projection").addSystem(Te,"textureGC").addSystem(Q,"filter").addSystem(he,"renderTexture").addSystem(et,"batch"),i.initPlugins(e.__plugins),r.context?i.context.initFromContext(r.context):i.context.initFromOptions({alpha:!!i.transparent,antialias:r.antialias,premultipliedAlpha:i.transparent&&"notMultiplied"!==i.transparent,stencil:!0,preserveDrawingBuffer:r.preserveDrawingBuffer,powerPreference:i.options.powerPreference}),i.renderingToScreen=!0,Object(o["sayHello"])(2===i.context.webGLVersion?"WebGL 2":"WebGL 1"),i.resize(i.options.width,i.options.height),i}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 r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},e.prototype.render=function(t,e,r,i,n){if(this.renderingToScreen=!e,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.enableTempParent();t.updateTransform(),t.disableTempParent(o)}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==r?r: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,r){t.prototype.resize.call(this,e,r),this.runners.resize.emit(e,r)},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 r in this.runners.destroy.emit(),this.runners)this.runners[r].destroy();t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Ie);function Oe(t){return Me.create(t)}var Ce="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}",Ae="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",De=function(){function t(){this.texArray=null,this.blend=0,this.type=n["e"].TRIANGLES,this.start=0,this.size=0,this.data=null}return t}(),Re=function(){function t(){this.elements=[],this.ids=[],this.count=0}return t.prototype.clear=function(){for(var t=0;tthis.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,r=t._bufferedTextures,i=t.MAX_TEXTURES,n=e._textureArrayPool,o=this.renderer.batch,s=this._tempBoundTextures,a=this.renderer.textureGC.count,u=++g._globalBatch,h=0,l=n[0],c=0;o.copyBoundTextures(s,i);for(var d=0;d=i&&(o.boundArray(l,s,u,i),this.buildDrawCalls(l,c,d),c=d,l=n[++h],++u),p._batchEnabled=u,p.touched=a,l.elements[l.count++]=p)}l.count>0&&(o.boundArray(l,s,u,i),this.buildDrawCalls(l,c,this._bufferSize),++h,++u);for(d=0;d0&&(e+="\nelse "),r0&&f>0,s.textureCacheIds=[],s.destroyed=!1,s.resource=null,s._batchEnabled=0,s._batchLocation=0,s.parentTextureArray=null,s.setResource(e),s}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 r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},e.prototype.setRealSize=function(t,e,r){return this.resolution=r||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,r,n){void 0===n&&(n=i["b"].STRICT_TEXTURE_CACHE);var s="string"===typeof t,a=null;s?a=t:(t._pixiId||(t._pixiId="pixiid_"+Object(o["uid"])()),a=t._pixiId);var u=o["BaseTextureCache"][a];if(s&&n&&!u)throw new Error('The cacheId "'+a+'" does not exist in BaseTextureCache.');return u||(u=new e(t,r),u.cacheId=a,e.addToCache(u,a)),u},e.fromBuffer=function(t,r,i,o){t=t||new Float32Array(r*i*4);var s=new f(t,{width:r,height:i}),a=t instanceof Float32Array?n["p"].FLOAT:n["p"].UNSIGNED_BYTE;return new e(s,Object.assign(m,o||{width:r,height:i,type:a}))},e.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),o["BaseTextureCache"][e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),o["BaseTextureCache"][e]=t)},e.removeFromCache=function(t){if("string"===typeof t){var e=o["BaseTextureCache"][t];if(e){var r=e.textureCacheIds.indexOf(t);return r>-1&&e.textureCacheIds.splice(r,1),delete o["BaseTextureCache"][t],e}}else if(t&&t.textureCacheIds){for(var i=0;i0){if(!t.resource)throw new Error("CubeResource does not support copying of renderTexture.");this.addResourceAt(t.resource,e)}else t.target=n["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,r,i){for(var n=this.itemDirtyIds,o=0;o]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e}(y),w=function(t){function e(r,i){var n=this;if(i=i||{},!(r instanceof HTMLVideoElement)){var o=document.createElement("video");o.setAttribute("preload","auto"),o.setAttribute("webkit-playsinline",""),o.setAttribute("playsinline",""),"string"===typeof r&&(r=[r]);var s=r[0].src||r[0];y.crossOrigin(o,s,i.crossorigin);for(var a=0;a0&&!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&&(a["a"].shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&(a["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&&a["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?(a["a"].shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(a["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,r){return t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},e.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],e.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},e}(y),P=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}(y);h.push(T,P,x,w,E,f,b,_);var S={Resource:p,BaseImageResource:y,INSTALLED:h,autoDetectResource:l,AbstractMultiResource:v,ArrayResource:_,BufferResource:f,CanvasResource:x,CubeResource:b,ImageResource:T,SVGResource:E,VideoResource:w,ImageBitmapResource:P},I=function(){function t(t){this.renderer=t}return t.prototype.destroy=function(){this.renderer=null},t}(),M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return d(e,t),e.prototype.upload=function(t,e,r){var i=t.gl;return i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===n["a"].UNPACK),r.width===e.width&&r.height===e.height?i.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(r.width=e.width,r.height=e.height,i.texImage2D(e.target,0,1===t.context.webGLVersion?i.DEPTH_COMPONENT:i.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(f),O=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 s["a"]("disposeFramebuffer"),this.multisample=n["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:n["n"].NEAREST,resolution:1,mipmap:n["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 M(null,{width:this.width,height:this.height}),{scaleMode:n["n"].NEAREST,resolution:1,width:this.width,height:this.height,mipmap:n["j"].OFF,format:n["g"].DEPTH_COMPONENT,type:n["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 r=0;r-1&&e.textureCacheIds.splice(r,1),delete o["TextureCache"][t],e}}else if(t&&t.textureCacheIds){for(var i=0;ithis.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",u="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,h="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+a+" "+h)}this.valid=i&&n&&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 L(){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 x(t)))}function F(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}R.EMPTY=new R(new g),F(R.EMPTY),F(R.EMPTY.baseTexture),R.WHITE=L(),F(R.WHITE),F(R.WHITE.baseTexture);var N=function(t){function e(e,r){var i=this,n=null;if(!(e instanceof C)){var o=arguments[1],s=arguments[2],a=arguments[3],u=arguments[4];console.warn("Please use RenderTexture.create("+o+", "+s+") instead of the ctor directly."),n=arguments[0],r=null,e=new C({width:o,height:s,scaleMode:a,resolution:u})}return i=t.call(this,e,r)||this,i.legacyRenderer=n,i.valid=!0,i.filterFrame=null,i.filterPoolKey=null,i.updateUvs(),i}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,r){void 0===r&&(r=!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,r&&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 C(t))},e}(R),B=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 r=new C(Object.assign({width:t,height:e,resolution:1},this.textureOptions));return new N(r)},t.prototype.getOptimalTexture=function(e,r,i){void 0===i&&(i=1);var n=t.SCREEN_KEY;e*=i,r*=i,this.enableFullScreen&&e===this._pixelsWidth&&r===this._pixelsHeight||(e=Object(o["nextPow2"])(e),r=Object(o["nextPow2"])(r),n=(65535&e)<<16|65535&r),this.texturePool[n]||(this.texturePool[n]=[]);var s=this.texturePool[n].pop();return s||(s=this.createTexture(e,r)),s.filterPoolKey=n,s.setResolution(i),s},t.prototype.getFilterTexture=function(t,e){var r=this.getOptimalTexture(t.width,t.height,e||t.resolution);return r.filterFrame=t.filterFrame,r},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,t)for(var e in this.texturePool){var r=this.texturePool[e];if(r)for(var i=0;i0&&e.height>0,i)for(var n=0;n1){for(var h=0;h1&&this.renderer.framebuffer.blit(),1===r.length)r[0].apply(this,e.renderTexture,h.renderTexture,n["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=0;--i)t[i]=r[i]||null,t[i]&&(t[i]._batchLocation=i)},e.prototype.boundArray=function(t,e,r,i){for(var n=t.elements,o=t.ids,s=t.count,a=0,u=0;u=0&&l=n["f"].WEBGL2&&(r=t.getContext("webgl2",e)),r)this.webGLVersion=2;else if(this.webGLVersion=1,r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),!r)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=r,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(),r="WebGL2RenderingContext"in window&&t instanceof window.WebGL2RenderingContext;r&&(this.webGLVersion=2),e.stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var i=r||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=i,i||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},e}(I),nt=function(){function t(t){this.framebuffer=t,this.stencil=null,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.multisample=n["k"].NONE,this.msaaBuffer=null,this.blitFramebuffer=null}return t}(),ot=new u["Rectangle"],st=function(t){function e(e){var r=t.call(this,e)||this;return r.managedFramebuffers=[],r.unknownFramebuffer=new O(10,10),r.msaaSamples=null,r}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 u["Rectangle"],this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,r=this.renderer.context.extensions.depthTexture;i["b"].PREFER_ENV===n["f"].WEBGL_LEGACY&&(e=null,r=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),r||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)},e.prototype.bind=function(t,e){var r=this.gl;if(t){var i=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.dirtyId!==t.dirtyId&&(i.dirtyId=t.dirtyId,i.dirtyFormat!==t.dirtyFormat?(i.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):i.dirtySize!==t.dirtySize&&(i.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&(r.msaaBuffer=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r.msaaBuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,r.multisample,e.RGBA8,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,r.msaaBuffer));for(var o=[],s=0;s1)){var a=t.colorTextures[s],u=a.parentTextureArray||a;this.renderer.texture.bind(u,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+s,a.target,u._glTextures[this.CONTEXT_UID].texture,0),o.push(e.COLOR_ATTACHMENT0+s)}if(o.length>1&&e.drawBuffers(o),t.depthTexture){var h=this.writeDepthTexture;if(h){var l=t.depthTexture;this.renderer.texture.bind(l,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,l._glTextures[this.CONTEXT_UID].texture,0)}}r.stencil||!t.stencil&&!t.depth||(r.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,r.stencil))},e.prototype.detectSamples=function(t){var e=this.msaaSamples,r=n["k"].NONE;if(t<=1||null===e)return r;for(var i=0;i=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.stencil&&i.deleteRenderbuffer(r.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r=i.data.byteLength)e.bufferSubData(o,0,i.data);else{var s=i.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=i.data.byteLength,e.bufferData(o,i.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var r=t.attributes,i=e.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var r=t.attributes,i=e.attributeData,n=["g",t.id];for(var o in r)i[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e,r){void 0===r&&(r=!0),this.checkCompatibility(t,e);var i=this.gl,n=this.CONTEXT_UID,o=this.getSignature(t,e),s=t.glVertexArrayObjects[this.CONTEXT_UID],a=s[o];if(a)return s[e.id]=a,a;var u=t.buffers,h=t.attributes,l={},c={};for(var d in u)l[d]=0,c[d]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),l[h[d].buffer]+=h[d].size*ut[h[d].type];for(var d in h){var p=h[d],f=p.size;void 0===p.stride&&(l[p.buffer]===f*ut[p.type]?p.stride=0:p.stride=l[p.buffer]),void 0===p.start&&(p.start=c[p.buffer],c[p.buffer]+=f*ut[p.type])}a=i.createVertexArray(),i.bindVertexArray(a);for(var m=0;m=n["f"].WEBGL2&&(e=t.getContext("webgl2",{})),e||(e=t.getContext("webgl",{})||t.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),vt=e}return vt}function yt(){if(!mt){mt=n["l"].MEDIUM;var t=_t();if(t&&t.getShaderPrecisionFormat){var e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);mt=e.precision?n["l"].HIGH:n["l"].MEDIUM}}return mt}function xt(t,e,r){if("precision"!==t.substring(0,9)){var i=e;return e===n["l"].HIGH&&r!==n["l"].HIGH&&(i=n["l"].MEDIUM),"precision "+i+" float;\n"+t}return r!==n["l"].HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var bt={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 Tt(t){return bt[t]}var Et=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 Pt(t,e){if(!Et){var r=Object.keys(wt);Et={};for(var i=0;i0&&(e+="\nelse "),re.name?1:-1}));for(o=0;o0?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,r=this.renderer.projection,i=r.transform,n=r.sourceFrame,o=r.destinationFrame,s=e?e.resolution:this.renderer.resolution,a=(t.x-n.x)*s+o.x,u=(t.y-n.y)*s+o.y,h=t.width*s,l=t.height*s;i&&(a+=i.tx*s,u+=i.ty*s),e||(u=this.renderer.height-l-u),this.renderer.gl.scissor(a,u,h,l)},e}(re),ne=function(t){function e(e){var r=t.call(this,e)||this;return r.glConst=WebGLRenderingContext.STENCIL_TEST,r}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,r=this.renderer.gl,i=t._stencilCounter;0===i&&(this.renderer.framebuffer.forceStencil(),r.enable(r.STENCIL_TEST)),t._stencilCounter++,r.colorMask(!1,!1,!1,!1),r.stencilFunc(r.EQUAL,i,this._getBitwiseMask()),r.stencilOp(r.KEEP,r.KEEP,r.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<>=1,r++;this.stateId=t.data}for(r=0;rthis.checkCountMax&&(this.checkCount=0,this.run())))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;ithis.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){var o=0;for(i=0;i=0;i--)this.unload(t.children[i])},e}(I),Ee=function(){function t(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}return t}(),we=function(t){function e(e){var r=t.call(this,e)||this;return r.boundTextures=[],r.currentLocation=-1,r.managedTextures=[],r._unknownBoundTextures=!1,r.unknownTexture=new g,r}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 r=0;r=1:e.mipmap=!1,2===this.webGLVersion||t.isPowerOfTwo?e.wrapMode=t.wrapMode:e.wrapMode=n["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 r=this.gl;if(e.mipmap&&r.generateMipmap(t.target),r.texParameteri(t.target,r.TEXTURE_WRAP_S,e.wrapMode),r.texParameteri(t.target,r.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode===n["n"].LINEAR?r.LINEAR_MIPMAP_LINEAR:r.NEAREST_MIPMAP_NEAREST);var i=this.renderer.context.extensions.anisotropicFiltering;if(i&&t.anisotropicLevel>0&&t.scaleMode===n["n"].LINEAR){var o=Math.min(t.anisotropicLevel,r.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));r.texParameterf(t.target,i.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else r.texParameteri(t.target,r.TEXTURE_MIN_FILTER,t.scaleMode===n["n"].LINEAR?r.LINEAR:r.NEAREST);r.texParameteri(t.target,r.TEXTURE_MAG_FILTER,t.scaleMode===n["n"].LINEAR?r.LINEAR:r.NEAREST)},e}(I),Pe={FilterSystem:Q,BatchSystem:et,ContextSystem:it,FramebufferSystem:st,GeometrySystem:ht,MaskSystem:ee,ScissorSystem:ie,StencilSystem:ne,ProjectionSystem:oe,RenderTextureSystem:he,ShaderSystem:fe,StateSystem:be,TextureGCSystem:Te,TextureSystem:we},Se=new u["Matrix"],Ie=function(t){function e(e,r){void 0===e&&(e=n["m"].UNKNOWN);var s=t.call(this)||this;return r=Object.assign({},i["b"].RENDER_OPTIONS,r),r.roundPixels&&(i["b"].ROUND_PIXELS=r.roundPixels,Object(o["deprecation"])("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),s.options=r,s.type=e,s.screen=new u["Rectangle"](0,0,r.width,r.height),s.view=r.view||document.createElement("canvas"),s.resolution=r.resolution||i["b"].RESOLUTION,s.transparent=r.transparent,s.autoDensity=r.autoDensity||r.autoResize||!1,s.preserveDrawingBuffer=r.preserveDrawingBuffer,s.clearBeforeRender=r.clearBeforeRender,s._backgroundColor=0,s._backgroundColorRgba=[0,0,0,0],s._backgroundColorString="#000000",s.backgroundColor=r.backgroundColor||s._backgroundColor,s._lastObjectRendered=null,s.plugins={},s}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,r,i){i=i||t.getLocalBounds(null,!0),0===i.width&&(i.width=1),0===i.height&&(i.height=1);var n=N.create({width:0|i.width,height:0|i.height,scaleMode:e,resolution:r});return Se.tx=-i.x,Se.ty=-i.y,this.render(t,n,!1,Se,!!t.parent),n},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);var r=this;r.plugins=null,r.type=n["m"].UNKNOWN,r.view=null,r.screen=null,r._tempDisplayObjectParent=null,r.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"]),Me=function(t){function e(r){var i=t.call(this,n["m"].WEBGL,r)||this;return r=i.options,i.gl=null,i.CONTEXT_UID=0,i.runners={destroy:new s["a"]("destroy"),contextChange:new s["a"]("contextChange"),reset:new s["a"]("reset"),update:new s["a"]("update"),postrender:new s["a"]("postrender"),prerender:new s["a"]("prerender"),resize:new s["a"]("resize")},i.globalUniforms=new $({projectionMatrix:new u["Matrix"]},!0),i.addSystem(ee,"mask").addSystem(it,"context").addSystem(be,"state").addSystem(fe,"shader").addSystem(we,"texture").addSystem(ht,"geometry").addSystem(st,"framebuffer").addSystem(ie,"scissor").addSystem(ne,"stencil").addSystem(oe,"projection").addSystem(Te,"textureGC").addSystem(Q,"filter").addSystem(he,"renderTexture").addSystem(et,"batch"),i.initPlugins(e.__plugins),r.context?i.context.initFromContext(r.context):i.context.initFromOptions({alpha:!!i.transparent,antialias:r.antialias,premultipliedAlpha:i.transparent&&"notMultiplied"!==i.transparent,stencil:!0,preserveDrawingBuffer:r.preserveDrawingBuffer,powerPreference:i.options.powerPreference}),i.renderingToScreen=!0,Object(o["sayHello"])(2===i.context.webGLVersion?"WebGL 2":"WebGL 1"),i.resize(i.options.width,i.options.height),i}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 r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},e.prototype.render=function(t,e,r,i,n){if(this.renderingToScreen=!e,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.enableTempParent();t.updateTransform(),t.disableTempParent(o)}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==r?r: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,r){t.prototype.resize.call(this,e,r),this.runners.resize.emit(e,r)},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 r in this.runners.destroy.emit(),this.runners)this.runners[r].destroy();t.prototype.destroy.call(this,e),this.gl=null},e.registerPlugin=function(t,r){e.__plugins=e.__plugins||{},e.__plugins[t]=r},e}(Ie);function Oe(t){return Me.create(t)}var Ce="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}",Ae="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",De=function(){function t(){this.texArray=null,this.blend=0,this.type=n["e"].TRIANGLES,this.start=0,this.size=0,this.data=null}return t}(),Re=function(){function t(){this.elements=[],this.ids=[],this.count=0}return t.prototype.clear=function(){for(var t=0;tthis.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,r=t._bufferedTextures,i=t.MAX_TEXTURES,n=e._textureArrayPool,o=this.renderer.batch,s=this._tempBoundTextures,a=this.renderer.textureGC.count,u=++g._globalBatch,h=0,l=n[0],c=0;o.copyBoundTextures(s,i);for(var d=0;d=i&&(o.boundArray(l,s,u,i),this.buildDrawCalls(l,c,d),c=d,l=n[++h],++u),p._batchEnabled=u,p.touched=a,l.elements[l.count++]=p)}l.count>0&&(o.boundArray(l,s,u,i),this.buildDrawCalls(l,c,this._bufferSize),++h,++u);for(d=0;d0&&(e+="\nelse "),r0&&this.chatList.shift()},playNextChat:function(t){t||this.removeChat();var e=this.chatList[0];e&&this.say(e.chat,e.voiceUrl)},toSocket:function(){var t=this;this.socket=nn.a.connect("/socketchat"),this.socket.on("msg",(function(e){var r={chat:e.message,voiceUrl:e.voiceUrl};t.addChat(r),console.log(e)})),this.socket.on("getSettingData",(function(e){console.log(e),t.isSpeech=!!e.isSpeech,t.cloudSel=e.cloudSel||"googleNiang",t.appkey=e.appkey||"",t.AccessToken=e.AccessToken||"",t.voice=e.voice||"xiaoyun",t.selModel!==e.selModel&&(t.destroyModel(),t.selModel=e.selModel||"LiveroiD_A-Y01",console.log(t.selModel),t.live2dInit())})),this.socket.on("connect",(function(){console.log("已连接")})),this.socket.on("disconnect",(function(){console.log("已断开")}))},live2dInit:function(){var t=this;return Object(h["a"])(regeneratorRuntime.mark((function e(){var r,i,n,o,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=window.PIXI,i=new r.Application({view:document.getElementById("canvas"),width:400,height:575,transparent:!0}),t.app=i,e.next=5,sn.from(t.selModelData.url);case 5:n=e.sent,t.model=n,n.x=t.selModelData.x,n.y=t.selModelData.y,i.stage.addChild(n),console.log(n.width),o=400/n.width,s=575/n.height,n.scale.set(Math.min(o,s)),console.log(n),window.l2dmodel=n,i.ticker.add((function(){var e,r;t.model&&(t.mouthOpen?null===(e=n.internalModel.coreModel)||void 0===e||e.setParameterValueById("ParamMouthOpenY",(Math.sin(performance.now()/100)/2+.5)/2):null===(r=n.internalModel.coreModel)||void 0===r||r.setParameterValueById("ParamMouthOpenY",0))})),t.randomMotion(),console.log(sn);case 19:case"end":return e.stop()}}),e)})))()}}};r("ae17");an.render=u,an.__scopeId="data-v-78eb8350";e["default"]=an},c7d1:function(t,e){function r(t){return function(){return t}}t.exports=r},c7fa:function(t,e,r){var i=r("7f57"),n=r("89d0");function o(t){return null!=t&&n(t.length)&&!i(t)}t.exports=o},c854:function(t,e,r){var i=r("b752"),n=Array.prototype,o=n.splice;function s(t){var e=this.__data__,r=i(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():o.call(e,r,1),--this.size,!0}t.exports=s},ca51:function(t,e,r){var i=r("b752");function n(t,e){var r=this.__data__,n=i(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}t.exports=n},cd25:function(t,e,r){var i=r("7154"),n=r("7b7e");function o(t,e){return t&&i(t,e,n)}t.exports=o},ceb6:function(t,e){function r(t,e){var r=-1,i=null==t?0:t.length,n=Array(i);while(++re.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},t.prototype.remove=function(t,e){var r=this._head.next;while(r)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(t.prototype,"count",{get:function(){if(!this._head)return 0;var t=0,e=this._head;while(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();var t=this._head.next;while(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,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){var r=t-this._lastFrame|0;if(r 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"@pixi/utils\"), require(\"@pixi/math\"), require(\"@pixi/core\"), require(\"lodash/pull\"), require(\"@pixi/display\"), require(\"lodash/mapKeys\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"@pixi/utils\", \"@pixi/math\", \"@pixi/core\", \"lodash/pull\", \"@pixi/display\", \"lodash/mapKeys\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"pixi-live2d-display\"] = factory(require(\"@pixi/utils\"), require(\"@pixi/math\"), require(\"@pixi/core\"), require(\"lodash/pull\"), require(\"@pixi/display\"), require(\"lodash/mapKeys\"));\n\telse\n\t\troot[\"PIXI\"] = root[\"PIXI\"] || {}, root[\"PIXI\"][\"live2d\"] = factory(root[\"PIXI\"][\"utils\"], root[\"PIXI\"], root[\"PIXI\"], root[\"lodash/pull\"], root[\"PIXI\"], root[\"lodash/mapKeys\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__5__, __WEBPACK_EXTERNAL_MODULE__17__, __WEBPACK_EXTERNAL_MODULE__19__, __WEBPACK_EXTERNAL_MODULE__20__, __WEBPACK_EXTERNAL_MODULE__24__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 27);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, \"f\", function() { return /* reexport */ log_logger; });\n__webpack_require__.d(__webpack_exports__, \"b\", function() { return /* reexport */ clamp; });\n__webpack_require__.d(__webpack_exports__, \"g\", function() { return /* reexport */ rand; });\n__webpack_require__.d(__webpack_exports__, \"d\", function() { return /* reexport */ copyProperty; });\n__webpack_require__.d(__webpack_exports__, \"c\", function() { return /* reexport */ copyArray; });\n__webpack_require__.d(__webpack_exports__, \"a\", function() { return /* reexport */ applyMixins; });\n__webpack_require__.d(__webpack_exports__, \"e\", function() { return /* reexport */ folderName; });\n\n// EXTERNAL MODULE: ./src/config.ts\nvar config = __webpack_require__(1);\n\n// CONCATENATED MODULE: ./src/utils/log.ts\n\r\n/**\r\n * A simple tagged logger.\r\n *\r\n * You can replace the methods with your own ones.\r\n *\r\n * ```js\r\n * import { logger } from 'pixi-live2d-display';\r\n *\r\n * logger.log = (tag, ...messages) => {\r\n * console.log(tag, 'says:', ...messages);\r\n * };\r\n * ```\r\n */\r\nvar log_logger;\r\n(function (logger) {\r\n function log(tag, ...messages) {\r\n if (config[\"b\" /* config */].logLevel <= config[\"b\" /* config */].LOG_LEVEL_VERBOSE) {\r\n console.log(`[${tag}]`, ...messages);\r\n }\r\n }\r\n logger.log = log;\r\n function warn(tag, ...messages) {\r\n if (config[\"b\" /* config */].logLevel <= config[\"b\" /* config */].LOG_LEVEL_WARNING) {\r\n console.warn(`[${tag}]`, ...messages);\r\n }\r\n }\r\n logger.warn = warn;\r\n function error(tag, ...messages) {\r\n if (config[\"b\" /* config */].logLevel <= config[\"b\" /* config */].LOG_LEVEL_ERROR) {\r\n console.error(`[${tag}]`, ...messages);\r\n }\r\n }\r\n logger.error = error;\r\n})(log_logger || (log_logger = {}));\r\n\n// CONCATENATED MODULE: ./src/utils/math.ts\n/**\r\n * These functions can be slightly faster than the ones in Lodash.\r\n * @packageDocumentation\r\n */\r\nfunction clamp(num, lower, upper) {\r\n return num < lower ? lower : num > upper ? upper : num;\r\n}\r\nfunction rand(min, max) {\r\n return Math.random() * (max - min) + min;\r\n}\r\n\n// CONCATENATED MODULE: ./src/utils/obj.ts\n/**\r\n * Copies a property at only if it matches the `type`.\r\n * @param type - Type expected to match `typeof` on the property.\r\n * @param from - Source object.\r\n * @param to - Destination object.\r\n * @param fromKey - Key of the property in source object.\r\n * @param toKey - Key of the property in destination object.\r\n */\r\n// TODO: lint and fix the formatting!\r\nfunction copyProperty(type, from, to, fromKey, toKey) {\r\n const value = from[fromKey];\r\n if (value !== null && typeof value === type) {\r\n // a type error will occur here, have no idea\r\n to[toKey] = value;\r\n }\r\n}\r\n/**\r\n * Copies an array at `key`, filtering the items that match the `type`.\r\n * @param type - Type expected to match `typeof` on the items.\r\n * @param from - Source object.\r\n * @param to - Destination object.\r\n * @param fromKey - Key of the array property in source object.\r\n * @param toKey - Key of the array property in destination object.\r\n */\r\nfunction copyArray(type, from, to, fromKey, toKey) {\r\n const array = from[fromKey];\r\n if (Array.isArray(array)) {\r\n to[toKey] = array.filter(item => item !== null && typeof item === type);\r\n }\r\n}\r\n/**\r\n * @see {@link https://www.typescriptlang.org/docs/handbook/mixins.html}\r\n */\r\nfunction applyMixins(derivedCtor, baseCtors) {\r\n baseCtors.forEach(baseCtor => {\r\n Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {\r\n if (name !== 'constructor') {\r\n Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name));\r\n }\r\n });\r\n });\r\n}\r\n\n// CONCATENATED MODULE: ./src/utils/string.ts\n/**\r\n * Gets the name of parent folder in a url.\r\n * @param url - URL of a file.\r\n * @return Name of the parent folder, or the file itself if it has no parent folder.\r\n */\r\nfunction folderName(url) {\r\n let lastSlashIndex = url.lastIndexOf('/');\r\n if (lastSlashIndex != -1) {\r\n url = url.slice(0, lastSlashIndex);\r\n }\r\n lastSlashIndex = url.lastIndexOf('/');\r\n if (lastSlashIndex !== -1) {\r\n url = url.slice(lastSlashIndex + 1);\r\n }\r\n return url;\r\n}\r\n\n// CONCATENATED MODULE: ./src/utils/index.ts\n\r\n\r\n\r\n\r\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return config; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return VERSION; });\n/**\r\n * Global configs.\r\n */\r\nvar config;\r\n(function (config) {\r\n config.LOG_LEVEL_VERBOSE = 0;\r\n config.LOG_LEVEL_WARNING = 1;\r\n config.LOG_LEVEL_ERROR = 2;\r\n config.LOG_LEVEL_NONE = 999;\r\n /**\r\n * Global log level.\r\n * @default {@link LOG_LEVEL_WARNING}\r\n */\r\n config.logLevel = true ? config.LOG_LEVEL_WARNING : undefined;\r\n /**\r\n * Enabling sound for motions.\r\n */\r\n config.sound = true;\r\n /**\r\n * Deferring motion and corresponding sound until both are loaded.\r\n */\r\n config.motionSync = true;\r\n /**\r\n * Default fading duration for motions without such value specified.\r\n */\r\n config.motionFadingDuration = 500;\r\n /**\r\n * Default fading duration for idle motions without such value specified.\r\n */\r\n config.idleMotionFadingDuration = 2000;\r\n /**\r\n * Default fading duration for expressions without such value specified.\r\n */\r\n config.expressionFadingDuration = 500;\r\n})(config || (config = {}));\r\n/**\r\n * Consistent with the `version` in package.json.\r\n */\r\nconst VERSION = \"0.3.1\";\r\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE__2__;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return Live2DLoader; });\n/* harmony import */ var _factory_XHRLoader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);\n/* harmony import */ var _utils_middleware__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16);\n\r\n\r\nclass Live2DLoader {\r\n /**\r\n * Loads a resource.\r\n * @return Promise that resolves with the loaded data in a format that's consistent with the specified `type`.\r\n */\r\n static load(context) {\r\n return Object(_utils_middleware__WEBPACK_IMPORTED_MODULE_1__[/* runMiddlewares */ \"a\"])(this.middlewares, context).then(() => context.result);\r\n }\r\n}\r\nLive2DLoader.middlewares = [_factory_XHRLoader__WEBPACK_IMPORTED_MODULE_0__[/* XHRLoader */ \"a\"].loader];\r\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, \"a\", function() { return /* binding */ Live2DFactory_Live2DFactory; });\n\n// EXTERNAL MODULE: ./src/cubism-common/index.ts\nvar cubism_common = __webpack_require__(6);\n\n// EXTERNAL MODULE: ./src/factory/Live2DLoader.ts\nvar Live2DLoader = __webpack_require__(3);\n\n// EXTERNAL MODULE: ./src/utils/index.ts + 4 modules\nvar utils = __webpack_require__(0);\n\n// EXTERNAL MODULE: ./src/utils/middleware.ts\nvar middleware = __webpack_require__(16);\n\n// EXTERNAL MODULE: external {\"commonjs\":\"@pixi/core\",\"commonjs2\":\"@pixi/core\",\"amd\":\"@pixi/core\",\"root\":\"PIXI\"}\nvar core_root_PIXI_ = __webpack_require__(17);\n\n// CONCATENATED MODULE: ./src/factory/texture.ts\n\r\nfunction createTexture(url, options = {}) {\r\n var _a;\r\n const textureOptions = { resourceOptions: { crossorigin: options.crossOrigin } };\r\n // there's already such a method since Pixi v5.3.0\r\n if (core_root_PIXI_[\"Texture\"].fromURL) {\r\n return core_root_PIXI_[\"Texture\"].fromURL(url, textureOptions).catch(e => {\r\n if (e instanceof Error) {\r\n throw e;\r\n }\r\n // assume e is an ErrorEvent, let's convert it to an Error\r\n const err = new Error('Texture loading error');\r\n err.event = e;\r\n throw err;\r\n });\r\n }\r\n // and in order to provide backward compatibility for older Pixi versions,\r\n // we have to manually implement this method\r\n // see https://github.com/pixijs/pixi.js/pull/6687/files\r\n textureOptions.resourceOptions.autoLoad = false;\r\n const texture = core_root_PIXI_[\"Texture\"].from(url, textureOptions);\r\n if (texture.baseTexture.valid) {\r\n return Promise.resolve(texture);\r\n }\r\n const resource = texture.baseTexture.resource;\r\n // before Pixi v5.2.2, the Promise will not be rejected when loading has failed,\r\n // we have to manually handle the \"error\" event\r\n // see https://github.com/pixijs/pixi.js/pull/6374\r\n (_a = resource._live2d_load) !== null && _a !== void 0 ? _a : (resource._live2d_load = new Promise((resolve, reject) => {\r\n const errorHandler = (event) => {\r\n resource.source.removeEventListener('error', errorHandler);\r\n // convert the ErrorEvent to an Error\r\n const err = new Error('Texture loading error');\r\n err.event = event;\r\n reject(err);\r\n };\r\n resource.source.addEventListener('error', errorHandler);\r\n resource.load().then(() => resolve(texture)).catch(errorHandler);\r\n }));\r\n return resource._live2d_load;\r\n}\r\n\n// CONCATENATED MODULE: ./src/factory/model-middlewares.ts\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\n\r\n\r\n\r\n\r\n\r\nconst TAG = 'Live2DFactory';\r\n/**\r\n * A middleware that converts the source from a URL to a settings JSON object.\r\n */\r\nconst urlToJSON = (context, next) => __awaiter(void 0, void 0, void 0, function* () {\r\n if (typeof context.source === 'string') {\r\n const data = yield Live2DLoader[\"a\" /* Live2DLoader */].load({\r\n url: context.source,\r\n type: 'json',\r\n target: context.live2dModel,\r\n });\r\n data.url = context.source;\r\n context.source = data;\r\n context.live2dModel.emit('settingsJSONLoaded', data);\r\n }\r\n return next();\r\n});\r\n/**\r\n * A middleware that converts the source from a settings JSON object to a ModelSettings instance.\r\n */\r\nconst jsonToSettings = (context, next) => __awaiter(void 0, void 0, void 0, function* () {\r\n if (context.source instanceof cubism_common[\"f\" /* ModelSettings */]) {\r\n context.settings = context.source;\r\n return next();\r\n }\r\n else if (typeof context.source === 'object') {\r\n const runtime = Live2DFactory_Live2DFactory.findRuntime(context.source);\r\n if (runtime) {\r\n const settings = runtime.createModelSettings(context.source);\r\n context.settings = settings;\r\n context.live2dModel.emit('settingsLoaded', settings);\r\n return next();\r\n }\r\n }\r\n throw new TypeError('Unknown settings format.');\r\n});\r\nconst waitUntilReady = (context, next) => {\r\n if (context.settings) {\r\n const runtime = Live2DFactory_Live2DFactory.findRuntime(context.settings);\r\n if (runtime) {\r\n return runtime.ready().then(next);\r\n }\r\n }\r\n return next();\r\n};\r\n/**\r\n * A middleware that populates the Live2DModel with optional resources.\r\n * Requires InternalModel in context when all the subsequent middlewares have finished.\r\n */\r\nconst setupOptionals = (context, next) => __awaiter(void 0, void 0, void 0, function* () {\r\n // wait until all has finished\r\n yield next();\r\n const internalModel = context.internalModel;\r\n if (internalModel) {\r\n const settings = context.settings;\r\n const runtime = Live2DFactory_Live2DFactory.findRuntime(settings);\r\n if (runtime) {\r\n const tasks = [];\r\n if (settings.pose) {\r\n tasks.push(Live2DLoader[\"a\" /* Live2DLoader */].load({\r\n settings,\r\n url: settings.pose,\r\n type: 'json',\r\n target: internalModel,\r\n })\r\n .then((data) => {\r\n internalModel.pose = runtime.createPose(internalModel.coreModel, data);\r\n context.live2dModel.emit('poseLoaded', internalModel.pose);\r\n })\r\n .catch((e) => utils[\"f\" /* logger */].warn(TAG, 'Failed to load pose.\\n', e)));\r\n }\r\n if (settings.physics) {\r\n tasks.push(Live2DLoader[\"a\" /* Live2DLoader */].load({\r\n settings,\r\n url: settings.physics,\r\n type: 'json',\r\n target: internalModel,\r\n })\r\n .then((data) => {\r\n internalModel.physics = runtime.createPhysics(internalModel.coreModel, data);\r\n context.live2dModel.emit('physicsLoaded', internalModel.physics);\r\n })\r\n .catch((e) => utils[\"f\" /* logger */].warn(TAG, 'Failed to load physics.\\n', e)));\r\n }\r\n if (tasks.length) {\r\n yield Promise.all(tasks);\r\n }\r\n }\r\n }\r\n});\r\n/**\r\n * A middleware that populates the Live2DModel with essential resources.\r\n * Requires ModelSettings in context immediately, and InternalModel in context\r\n * when all the subsequent middlewares have finished.\r\n */\r\nconst setupEssentials = (context, next) => __awaiter(void 0, void 0, void 0, function* () {\r\n if (context.settings) {\r\n const live2DModel = context.live2dModel;\r\n const textureLoadings = context.settings.textures.map(tex => {\r\n const url = context.settings.resolveURL(tex);\r\n return createTexture(url, { crossOrigin: context.options.crossOrigin });\r\n });\r\n // wait for the internal model to be created\r\n yield next();\r\n if (context.internalModel) {\r\n live2DModel.internalModel = context.internalModel;\r\n live2DModel.emit('modelLoaded', context.internalModel);\r\n }\r\n else {\r\n throw new TypeError('Missing internal model.');\r\n }\r\n live2DModel.textures = yield Promise.all(textureLoadings);\r\n live2DModel.emit('textureLoaded', live2DModel.textures);\r\n }\r\n else {\r\n throw new TypeError('Missing settings.');\r\n }\r\n});\r\n/**\r\n * A middleware that creates the InternalModel. Requires ModelSettings in context.\r\n */\r\nconst createInternalModel = (context, next) => __awaiter(void 0, void 0, void 0, function* () {\r\n const settings = context.settings;\r\n if (settings instanceof cubism_common[\"f\" /* ModelSettings */]) {\r\n const runtime = Live2DFactory_Live2DFactory.findRuntime(settings);\r\n if (!runtime) {\r\n throw new TypeError('Unknown model settings.');\r\n }\r\n const modelData = yield Live2DLoader[\"a\" /* Live2DLoader */].load({\r\n settings,\r\n url: settings.moc,\r\n type: 'arraybuffer',\r\n target: context.live2dModel,\r\n });\r\n if (!runtime.isValidMoc(modelData)) {\r\n throw new Error('Invalid moc data');\r\n }\r\n const coreModel = runtime.createCoreModel(modelData);\r\n context.internalModel = runtime.createInternalModel(coreModel, settings, context.options);\r\n return next();\r\n }\r\n throw new TypeError('Missing settings.');\r\n});\r\n\n// CONCATENATED MODULE: ./src/factory/Live2DFactory.ts\nvar Live2DFactory_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\n\r\n\r\n\r\n\r\n\r\n/**\r\n * Handles all the network load tasks.\r\n *\r\n * - Model creation: requested by {@link Live2DModel.from}.\r\n * - Motion loading: implements the load method of MotionManager.\r\n * - Expression loading: implements the load method of ExpressionManager.\r\n */\r\nclass Live2DFactory_Live2DFactory {\r\n /**\r\n * Registers a Live2DRuntime.\r\n */\r\n static registerRuntime(runtime) {\r\n Live2DFactory_Live2DFactory.runtimes.push(runtime);\r\n // higher version as higher priority\r\n Live2DFactory_Live2DFactory.runtimes.sort((a, b) => b.version - a.version);\r\n }\r\n /**\r\n * Finds a runtime that matches given source.\r\n * @param source - Either a settings JSON object or a ModelSettings instance.\r\n * @return The Live2DRuntime, or undefined if not found.\r\n */\r\n static findRuntime(source) {\r\n for (const runtime of Live2DFactory_Live2DFactory.runtimes) {\r\n if (runtime.test(source)) {\r\n return runtime;\r\n }\r\n }\r\n }\r\n /**\r\n * Sets up a Live2DModel, populating it with all defined resources.\r\n * @param live2dModel - The Live2DModel instance.\r\n * @param source - Can be one of: settings file URL, settings JSON object, ModelSettings instance.\r\n * @param options - Options for the process.\r\n * @return Promise that resolves when all resources have been loaded, rejects when error occurs.\r\n */\r\n static setupLive2DModel(live2dModel, source, options) {\r\n return Live2DFactory_awaiter(this, void 0, void 0, function* () {\r\n const textureLoaded = new Promise(resolve => live2dModel.once('textureLoaded', resolve));\r\n const modelLoaded = new Promise(resolve => live2dModel.once('modelLoaded', resolve));\r\n // because the \"ready\" event is supposed to be emitted after\r\n // both the internal model and textures have been loaded,\r\n // we should here wrap the emit() in a then() so it'll\r\n // be executed after all the handlers of \"modelLoaded\" and \"textureLoaded\"\r\n const readyEventEmitted = Promise.all([textureLoaded, modelLoaded]).then(() => live2dModel.emit('ready'));\r\n yield Object(middleware[\"a\" /* runMiddlewares */])(Live2DFactory_Live2DFactory.live2DModelMiddlewares, {\r\n live2dModel,\r\n source,\r\n options: options || {},\r\n });\r\n // the \"load\" event should never be emitted before \"ready\"\r\n yield readyEventEmitted;\r\n live2dModel.emit('load');\r\n });\r\n }\r\n /**\r\n * Loads a Motion and registers the task to {@link motionTasksMap}. The task will be automatically\r\n * canceled when its owner - the MotionManager instance - has been destroyed.\r\n * @param motionManager - MotionManager that owns this Motion.\r\n * @param group - The motion group.\r\n * @param index - Index in the motion group.\r\n * @return Promise that resolves with the Motion, or with undefined if it can't be loaded.\r\n */\r\n static loadMotion(motionManager, group, index) {\r\n var _a, _b;\r\n // errors in this method are always handled\r\n const handleError = (e) => motionManager.emit('motionLoadError', group, index, e);\r\n try {\r\n const definition = (_a = motionManager.definitions[group]) === null || _a === void 0 ? void 0 : _a[index];\r\n if (!definition) {\r\n return Promise.resolve(undefined);\r\n }\r\n if (!motionManager.listeners('destroy').includes(Live2DFactory_Live2DFactory.releaseTasks)) {\r\n motionManager.once('destroy', Live2DFactory_Live2DFactory.releaseTasks);\r\n }\r\n let tasks = Live2DFactory_Live2DFactory.motionTasksMap.get(motionManager);\r\n if (!tasks) {\r\n tasks = {};\r\n Live2DFactory_Live2DFactory.motionTasksMap.set(motionManager, tasks);\r\n }\r\n let taskGroup = tasks[group];\r\n if (!taskGroup) {\r\n taskGroup = [];\r\n tasks[group] = taskGroup;\r\n }\r\n const path = motionManager.getMotionFile(definition);\r\n (_b = taskGroup[index]) !== null && _b !== void 0 ? _b : (taskGroup[index] = Live2DLoader[\"a\" /* Live2DLoader */].load({\r\n url: path,\r\n settings: motionManager.settings,\r\n type: motionManager.motionDataType,\r\n target: motionManager,\r\n })\r\n .then(data => {\r\n var _a;\r\n const taskGroup = (_a = Live2DFactory_Live2DFactory.motionTasksMap.get(motionManager)) === null || _a === void 0 ? void 0 : _a[group];\r\n if (taskGroup) {\r\n delete taskGroup[index];\r\n }\r\n const motion = motionManager.createMotion(data, group, definition);\r\n motionManager.emit('motionLoaded', group, index, motion);\r\n return motion;\r\n })\r\n .catch(e => {\r\n utils[\"f\" /* logger */].warn(motionManager.tag, `Failed to load motion: ${path}\\n`, e);\r\n handleError(e);\r\n }));\r\n return taskGroup[index];\r\n }\r\n catch (e) {\r\n utils[\"f\" /* logger */].warn(motionManager.tag, `Failed to load motion at \"${group}\"[${index}]\\n`, e);\r\n handleError(e);\r\n }\r\n return Promise.resolve(undefined);\r\n }\r\n /**\r\n * Loads an Expression and registers the task to {@link expressionTasksMap}. The task will be automatically\r\n * canceled when its owner - the ExpressionManager instance - has been destroyed.\r\n * @param expressionManager - ExpressionManager that owns this Expression.\r\n * @param index - Index of the Expression.\r\n * @return Promise that resolves with the Expression, or with undefined if it can't be loaded.\r\n */\r\n static loadExpression(expressionManager, index) {\r\n var _a;\r\n // errors in this method are always handled\r\n const handleError = (e) => expressionManager.emit('expressionLoadError', index, e);\r\n try {\r\n const definition = expressionManager.definitions[index];\r\n if (!definition) {\r\n return Promise.resolve(undefined);\r\n }\r\n if (!expressionManager.listeners('destroy').includes(Live2DFactory_Live2DFactory.releaseTasks)) {\r\n expressionManager.once('destroy', Live2DFactory_Live2DFactory.releaseTasks);\r\n }\r\n let tasks = Live2DFactory_Live2DFactory.expressionTasksMap.get(expressionManager);\r\n if (!tasks) {\r\n tasks = [];\r\n Live2DFactory_Live2DFactory.expressionTasksMap.set(expressionManager, tasks);\r\n }\r\n const path = expressionManager.getExpressionFile(definition);\r\n (_a = tasks[index]) !== null && _a !== void 0 ? _a : (tasks[index] = Live2DLoader[\"a\" /* Live2DLoader */].load({\r\n url: path,\r\n settings: expressionManager.settings,\r\n type: 'json',\r\n target: expressionManager,\r\n })\r\n .then(data => {\r\n const tasks = Live2DFactory_Live2DFactory.expressionTasksMap.get(expressionManager);\r\n if (tasks) {\r\n delete tasks[index];\r\n }\r\n const expression = expressionManager.createExpression(data, definition);\r\n expressionManager.emit('expressionLoaded', index, expression);\r\n return expression;\r\n })\r\n .catch(e => {\r\n utils[\"f\" /* logger */].warn(expressionManager.tag, `Failed to load expression: ${path}\\n`, e);\r\n handleError(e);\r\n }));\r\n return tasks[index];\r\n }\r\n catch (e) {\r\n utils[\"f\" /* logger */].warn(expressionManager.tag, `Failed to load expression at [${index}]\\n`, e);\r\n handleError(e);\r\n }\r\n return Promise.resolve(undefined);\r\n }\r\n static releaseTasks() {\r\n if (this instanceof cubism_common[\"g\" /* MotionManager */]) {\r\n Live2DFactory_Live2DFactory.motionTasksMap.delete(this);\r\n }\r\n else {\r\n Live2DFactory_Live2DFactory.expressionTasksMap.delete(this);\r\n }\r\n }\r\n}\r\n/**\r\n * All registered runtimes, sorted by versions in descending order.\r\n */\r\nLive2DFactory_Live2DFactory.runtimes = [];\r\nLive2DFactory_Live2DFactory.urlToJSON = urlToJSON;\r\nLive2DFactory_Live2DFactory.jsonToSettings = jsonToSettings;\r\nLive2DFactory_Live2DFactory.waitUntilReady = waitUntilReady;\r\nLive2DFactory_Live2DFactory.setupOptionals = setupOptionals;\r\nLive2DFactory_Live2DFactory.setupEssentials = setupEssentials;\r\nLive2DFactory_Live2DFactory.createInternalModel = createInternalModel;\r\n/**\r\n * Middlewares to run through when setting up a Live2DModel.\r\n */\r\nLive2DFactory_Live2DFactory.live2DModelMiddlewares = [\r\n urlToJSON, jsonToSettings, waitUntilReady, setupOptionals, setupEssentials, createInternalModel,\r\n];\r\n/**\r\n * load tasks of each motion. The structure of each value in this map\r\n * is the same as respective {@link MotionManager.definitions}.\r\n */\r\nLive2DFactory_Live2DFactory.motionTasksMap = new WeakMap();\r\n/**\r\n * Load tasks of each expression.\r\n */\r\nLive2DFactory_Live2DFactory.expressionTasksMap = new WeakMap();\r\ncubism_common[\"g\" /* MotionManager */].prototype._loadMotion = function (group, index) {\r\n return Live2DFactory_Live2DFactory.loadMotion(this, group, index);\r\n};\r\ncubism_common[\"a\" /* ExpressionManager */].prototype._loadExpression = function (index) {\r\n return Live2DFactory_Live2DFactory.loadExpression(this, index);\r\n};\r\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE__5__;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"d\", function() { return _constants__WEBPACK_IMPORTED_MODULE_0__[\"a\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"e\", function() { return _constants__WEBPACK_IMPORTED_MODULE_0__[\"b\"]; });\n\n/* harmony import */ var _ExpressionManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10);\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return _ExpressionManager__WEBPACK_IMPORTED_MODULE_1__[\"a\"]; });\n\n/* harmony import */ var _FocusController__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(14);\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return _FocusController__WEBPACK_IMPORTED_MODULE_2__[\"a\"]; });\n\n/* harmony import */ var _ModelSettings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(11);\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"f\", function() { return _ModelSettings__WEBPACK_IMPORTED_MODULE_3__[\"a\"]; });\n\n/* harmony import */ var _MotionState__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9);\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"i\", function() { return _MotionState__WEBPACK_IMPORTED_MODULE_4__[\"a\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"j\", function() { return _MotionState__WEBPACK_IMPORTED_MODULE_4__[\"b\"]; });\n\n/* harmony import */ var _MotionManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(12);\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"g\", function() { return _MotionManager__WEBPACK_IMPORTED_MODULE_5__[\"a\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"h\", function() { return _MotionManager__WEBPACK_IMPORTED_MODULE_5__[\"b\"]; });\n\n/* harmony import */ var _SoundManager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7);\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"k\", function() { return _SoundManager__WEBPACK_IMPORTED_MODULE_6__[\"a\"]; });\n\n/* harmony import */ var _InternalModel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(13);\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return _InternalModel__WEBPACK_IMPORTED_MODULE_7__[\"a\"]; });\n\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return SoundManager; });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);\n/* harmony import */ var lodash_pull__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19);\n/* harmony import */ var lodash_pull__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_pull__WEBPACK_IMPORTED_MODULE_1__);\n\r\n\r\nconst TAG = 'SoundManager';\r\nconst VOLUME = 0.5;\r\n/**\r\n * Manages all the sounds.\r\n */\r\nclass SoundManager {\r\n /**\r\n * Global volume that applies to all the sounds.\r\n */\r\n static get volume() {\r\n return this._volume;\r\n }\r\n static set volume(value) {\r\n this._volume = (value > 1 ? 1 : value < 0 ? 0 : value) || 0;\r\n this.audios.forEach(audio => (audio.volume = this._volume));\r\n }\r\n // TODO: return an ID?\r\n /**\r\n * Creates an audio element and adds it to the {@link audios}.\r\n * @param file - URL of the sound file.\r\n * @param onFinish - Callback invoked when the playback has finished.\r\n * @param onError - Callback invoked when error occurs.\r\n * @return Created audio element.\r\n */\r\n static add(file, onFinish, onError) {\r\n const audio = new Audio(file);\r\n audio.volume = this._volume;\r\n audio.preload = 'auto';\r\n audio.addEventListener('ended', () => {\r\n this.dispose(audio);\r\n onFinish === null || onFinish === void 0 ? void 0 : onFinish();\r\n });\r\n audio.addEventListener('error', (e) => {\r\n this.dispose(audio);\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].warn(TAG, `Error occurred on \"${file}\"`, e.error);\r\n onError === null || onError === void 0 ? void 0 : onError(e.error);\r\n });\r\n this.audios.push(audio);\r\n return audio;\r\n }\r\n /**\r\n * Plays the sound.\r\n * @param audio - An audio element.\r\n * @return Promise that resolves when the audio is ready to play, rejects when error occurs.\r\n */\r\n static play(audio) {\r\n return new Promise((resolve, reject) => {\r\n var _a;\r\n // see https://developers.google.com/web/updates/2017/09/autoplay-policy-changes\r\n (_a = audio.play()) === null || _a === void 0 ? void 0 : _a.catch(e => {\r\n audio.dispatchEvent(new ErrorEvent('error', { error: e }));\r\n reject(e);\r\n });\r\n if (audio.readyState === audio.HAVE_ENOUGH_DATA) {\r\n resolve();\r\n }\r\n else {\r\n audio.addEventListener('canplaythrough', resolve);\r\n }\r\n });\r\n }\r\n /**\r\n * Disposes an audio element and removes it from {@link audios}.\r\n * @param audio - An audio element.\r\n */\r\n static dispose(audio) {\r\n audio.pause();\r\n audio.removeAttribute('src');\r\n lodash_pull__WEBPACK_IMPORTED_MODULE_1___default()(this.audios, audio);\r\n }\r\n /**\r\n * Destroys all managed audios.\r\n */\r\n static destroy() {\r\n // dispose() removes given audio from the array, so the loop must be backward\r\n for (let i = this.audios.length - 1; i >= 0; i--) {\r\n this.dispose(this.audios[i]);\r\n }\r\n }\r\n}\r\n/**\r\n * Audio elements playing or pending to play. Finished audios will be removed automatically.\r\n */\r\nSoundManager.audios = [];\r\nSoundManager._volume = VOLUME;\r\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return LOGICAL_WIDTH; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return LOGICAL_HEIGHT; });\nconst LOGICAL_WIDTH = 2;\r\nconst LOGICAL_HEIGHT = 2;\r\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return MotionPriority; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return MotionState; });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);\n\r\n/**\r\n * Indicates the motion priority.\r\n */\r\nvar MotionPriority;\r\n(function (MotionPriority) {\r\n /** States that the model is currently not playing any motion. This priority cannot be applied to a motion. */\r\n MotionPriority[MotionPriority[\"NONE\"] = 0] = \"NONE\";\r\n /** Low priority, used when starting idle motions automatically. */\r\n MotionPriority[MotionPriority[\"IDLE\"] = 1] = \"IDLE\";\r\n /** Medium priority. */\r\n MotionPriority[MotionPriority[\"NORMAL\"] = 2] = \"NORMAL\";\r\n /** High priority. Motions as this priority will always be played regardless of the current priority. */\r\n MotionPriority[MotionPriority[\"FORCE\"] = 3] = \"FORCE\";\r\n})(MotionPriority || (MotionPriority = {}));\r\n/**\r\n * Handles the state of a MotionManager.\r\n */\r\nclass MotionState {\r\n constructor() {\r\n /**\r\n * When enabled, the states will be dumped to the logger when an exception occurs.\r\n */\r\n this.debug = false;\r\n /**\r\n * Priority of the current motion. Will be `MotionPriority.NONE` if there's no playing motion.\r\n */\r\n this.currentPriority = MotionPriority.NONE;\r\n /**\r\n * Priority of the reserved motion, which is still in loading and will be played once loaded.\r\n * Will be `MotionPriority.NONE` if there's no reserved motion.\r\n */\r\n this.reservePriority = MotionPriority.NONE;\r\n }\r\n /**\r\n * Reserves the playback for a motion.\r\n * @param group - The motion group.\r\n * @param index - Index in the motion group.\r\n * @param priority - The priority to be applied.\r\n * @return True if the reserving has succeeded.\r\n */\r\n reserve(group, index, priority) {\r\n if (priority <= MotionPriority.NONE) {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].log(this.tag, `Cannot start a motion with MotionPriority.NONE.`);\r\n return false;\r\n }\r\n if (group === this.currentGroup && index === this.currentIndex) {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].log(this.tag, `Motion is already playing.`, this.dump(group, index));\r\n return false;\r\n }\r\n if ((group === this.reservedGroup && index === this.reservedIndex) || (group === this.reservedIdleGroup && index === this.reservedIdleIndex)) {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].log(this.tag, `Motion is already reserved.`, this.dump(group, index));\r\n return false;\r\n }\r\n if (priority === MotionPriority.IDLE) {\r\n if (this.currentPriority !== MotionPriority.NONE) {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].log(this.tag, `Cannot start idle motion because another motion is playing.`, this.dump(group, index));\r\n return false;\r\n }\r\n if (this.reservedIdleGroup !== undefined) {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].log(this.tag, `Cannot start idle motion because another idle motion has reserved.`, this.dump(group, index));\r\n return false;\r\n }\r\n this.setReservedIdle(group, index);\r\n }\r\n else {\r\n if (priority < MotionPriority.FORCE) {\r\n if (priority <= this.currentPriority) {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].log(this.tag, 'Cannot start motion because another motion is playing as an equivalent or higher priority.', this.dump(group, index));\r\n return false;\r\n }\r\n if (priority <= this.reservePriority) {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].log(this.tag, 'Cannot start motion because another motion has reserved as an equivalent or higher priority.', this.dump(group, index));\r\n return false;\r\n }\r\n }\r\n this.setReserved(group, index, priority);\r\n }\r\n return true;\r\n }\r\n /**\r\n * Requests the playback for a motion.\r\n * @param motion - The Motion, can be undefined.\r\n * @param group - The motion group.\r\n * @param index - Index in the motion group.\r\n * @param priority - The priority to be applied.\r\n * @return True if the request has been approved, i.e. the motion is allowed to play.\r\n */\r\n start(motion, group, index, priority) {\r\n if (priority === MotionPriority.IDLE) {\r\n this.setReservedIdle(undefined, undefined);\r\n if (this.currentPriority !== MotionPriority.NONE) {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].log(this.tag, 'Cannot start idle motion because another motion is playing.', this.dump(group, index));\r\n return false;\r\n }\r\n }\r\n else {\r\n if (group !== this.reservedGroup || index !== this.reservedIndex) {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].log(this.tag, 'Cannot start motion because another motion has taken the place.', this.dump(group, index));\r\n return false;\r\n }\r\n this.setReserved(undefined, undefined, MotionPriority.NONE);\r\n }\r\n if (!motion) {\r\n return false;\r\n }\r\n this.setCurrent(group, index, priority);\r\n return true;\r\n }\r\n /**\r\n * Notifies the motion playback has finished.\r\n */\r\n complete() {\r\n this.setCurrent(undefined, undefined, MotionPriority.NONE);\r\n }\r\n /**\r\n * Sets the current motion.\r\n */\r\n setCurrent(group, index, priority) {\r\n this.currentPriority = priority;\r\n this.currentGroup = group;\r\n this.currentIndex = index;\r\n }\r\n /**\r\n * Sets the reserved motion.\r\n */\r\n setReserved(group, index, priority) {\r\n this.reservePriority = priority;\r\n this.reservedGroup = group;\r\n this.reservedIndex = index;\r\n }\r\n /**\r\n * Sets the reserved idle motion.\r\n */\r\n setReservedIdle(group, index) {\r\n this.reservedIdleGroup = group;\r\n this.reservedIdleIndex = index;\r\n }\r\n /**\r\n * Checks if a Motion is currently playing or has reserved.\r\n * @return True if active.\r\n */\r\n isActive(group, index) {\r\n return (group === this.currentGroup && index === this.currentIndex)\r\n || (group === this.reservedGroup && index === this.reservedIndex)\r\n || (group === this.reservedIdleGroup && index === this.reservedIdleIndex);\r\n }\r\n /**\r\n * Resets the state.\r\n */\r\n reset() {\r\n this.setCurrent(undefined, undefined, MotionPriority.NONE);\r\n // make sure the reserved motions (if existing) won't start when they are loaded\r\n this.setReserved(undefined, undefined, MotionPriority.NONE);\r\n this.setReservedIdle(undefined, undefined);\r\n }\r\n /**\r\n * Checks if an idle motion should be requests to play.\r\n */\r\n shouldRequestIdleMotion() {\r\n return this.currentGroup === undefined && this.reservedIdleGroup === undefined;\r\n }\r\n /**\r\n * Checks if the model's expression should be overridden by the motion.\r\n */\r\n shouldOverrideExpression() {\r\n return this.currentPriority > MotionPriority.IDLE;\r\n }\r\n /**\r\n * Dumps the state for debugging.\r\n */\r\n dump(requestedGroup, requestedIndex) {\r\n if (this.debug) {\r\n const keys = [\r\n 'currentPriority',\r\n 'reservePriority',\r\n 'currentGroup',\r\n 'currentIndex',\r\n 'reservedGroup',\r\n 'reservedIndex',\r\n 'reservedIdleGroup',\r\n 'reservedIdleIndex',\r\n ];\r\n return `\\n group = \"${requestedGroup}\", index = ${requestedIndex}\\n` + keys.map(key => '[' + key + '] ' + this[key]).join('\\n');\r\n }\r\n return '';\r\n }\r\n}\r\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return ExpressionManager; });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);\n/* harmony import */ var _pixi_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);\n/* harmony import */ var _pixi_utils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_pixi_utils__WEBPACK_IMPORTED_MODULE_1__);\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\n\r\n\r\n/**\r\n * Abstract expression manager.\r\n * @emits {@link ExpressionManagerEvents}\r\n */\r\nclass ExpressionManager extends _pixi_utils__WEBPACK_IMPORTED_MODULE_1__[\"EventEmitter\"] {\r\n constructor(settings, options) {\r\n super();\r\n /**\r\n * The Expressions. The structure is the same as {@link definitions}, initially there's only\r\n * an empty array, which means all expressions will be `undefined`. When an Expression has\r\n * been loaded, it'll fill the place in which it should be; when it fails to load,\r\n * the place will be filled with `null`.\r\n */\r\n this.expressions = [];\r\n /**\r\n * The pending Expression.\r\n */\r\n this.reserveExpressionIndex = -1;\r\n /**\r\n * Flags the instance has been destroyed.\r\n */\r\n this.destroyed = false;\r\n this.settings = settings;\r\n this.tag = `ExpressionManager(${settings.name})`;\r\n }\r\n /**\r\n * Should be called in the constructor of derived class.\r\n */\r\n init() {\r\n this.defaultExpression = this.createExpression({}, undefined);\r\n this.currentExpression = this.defaultExpression;\r\n this.stopAllExpressions();\r\n }\r\n /**\r\n * Loads an Expression. Errors in this method will not be thrown,\r\n * but be emitted with an \"expressionLoadError\" event.\r\n * @param index - Index of the expression in definitions.\r\n * @return Promise that resolves with the Expression, or with undefined if it can't be loaded.\r\n * @emits {@link ExpressionManagerEvents.expressionLoaded}\r\n * @emits {@link ExpressionManagerEvents.expressionLoadError}\r\n */\r\n loadExpression(index) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n if (!this.definitions[index]) {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].warn(this.tag, `Undefined expression at [${index}]`);\r\n return undefined;\r\n }\r\n if (this.expressions[index] === null) {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].warn(this.tag, `Cannot set expression at [${index}] because it's already failed in loading.`);\r\n return undefined;\r\n }\r\n if (this.expressions[index]) {\r\n return this.expressions[index];\r\n }\r\n const expression = yield this._loadExpression(index);\r\n this.expressions[index] = expression;\r\n return expression;\r\n });\r\n }\r\n /**\r\n * Loads the Expression. Will be implemented by Live2DFactory.\r\n * @ignore\r\n */\r\n _loadExpression(index) {\r\n throw new Error('Not implemented.');\r\n }\r\n /**\r\n * Sets a random Expression that differs from current one.\r\n * @return Promise that resolves with true if succeeded, with false otherwise.\r\n */\r\n setRandomExpression() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n if (this.definitions.length) {\r\n const availableIndices = [];\r\n for (let i = 0; i < this.definitions.length; i++) {\r\n if (this.expressions[i] !== null\r\n && this.expressions[i] !== this.currentExpression\r\n && i !== this.reserveExpressionIndex) {\r\n availableIndices.push(i);\r\n }\r\n }\r\n if (availableIndices.length) {\r\n const index = Math.floor(Math.random() * availableIndices.length);\r\n return this.setExpression(index);\r\n }\r\n }\r\n return false;\r\n });\r\n }\r\n /**\r\n * Resets model's expression using {@link defaultExpression}.\r\n */\r\n resetExpression() {\r\n this._setExpression(this.defaultExpression);\r\n }\r\n /**\r\n * Restores model's expression to {@link currentExpression}.\r\n */\r\n restoreExpression() {\r\n this._setExpression(this.currentExpression);\r\n }\r\n /**\r\n * Sets an Expression.\r\n * @param index - Either the index, or the name of the expression.\r\n * @return Promise that resolves with true if succeeded, with false otherwise.\r\n */\r\n setExpression(index) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n if (typeof index !== 'number') {\r\n index = this.getExpressionIndex(index);\r\n }\r\n if (!(index > -1 && index < this.definitions.length)) {\r\n return false;\r\n }\r\n if (index === this.expressions.indexOf(this.currentExpression)) {\r\n return false;\r\n }\r\n this.reserveExpressionIndex = index;\r\n const expression = yield this.loadExpression(index);\r\n if (!expression || this.reserveExpressionIndex !== index) {\r\n return false;\r\n }\r\n this.reserveExpressionIndex = -1;\r\n this.currentExpression = expression;\r\n this._setExpression(expression);\r\n return true;\r\n });\r\n }\r\n /**\r\n * Updates parameters of the core model.\r\n * @return True if the parameters are actually updated.\r\n */\r\n update(model, now) {\r\n if (!this.isFinished()) {\r\n return this.updateParameters(model, now);\r\n }\r\n return false;\r\n }\r\n /**\r\n * Destroys the instance.\r\n * @emits {@link ExpressionManagerEvents.destroy}\r\n */\r\n destroy() {\r\n this.destroyed = true;\r\n this.emit('destroy');\r\n const self = this;\r\n self.definitions = undefined;\r\n self.expressions = undefined;\r\n }\r\n}\r\n\n\n/***/ }),\n/* 11 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return ModelSettings; });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);\n/* harmony import */ var _pixi_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);\n/* harmony import */ var _pixi_utils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_pixi_utils__WEBPACK_IMPORTED_MODULE_1__);\n\r\n\r\n/**\r\n * Parses, and provides access to the settings JSON.\r\n */\r\nclass ModelSettings {\r\n /**\r\n * @param json - The settings JSON object.\r\n * @param json.url - The `url` field must be defined to specify the settings file's URL.\r\n */\r\n constructor(json) {\r\n this.json = json;\r\n let url = json.url;\r\n if (typeof url !== 'string') {\r\n // this is not allowed because it'll typically result in errors, including a\r\n // fatal error - an OOM that crashes the browser while initializing this cubism2 model,\r\n // I'm not kidding!\r\n throw new TypeError('The `url` field in settings JSON must be defined as a string.');\r\n }\r\n this.url = url;\r\n // set default name to folder's name\r\n this.name = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* folderName */ \"e\"])(this.url);\r\n }\r\n /**\r\n * Resolves a relative path using the {@link url}. This is used to resolve the resource files\r\n * defined in the settings.\r\n * @param path - Relative path.\r\n * @return Resolved path.\r\n */\r\n resolveURL(path) {\r\n return _pixi_utils__WEBPACK_IMPORTED_MODULE_1__[\"url\"].resolve(this.url, path);\r\n }\r\n /**\r\n * Replaces the resource files by running each file through the `replacer`.\r\n * @param replacer - Invoked with two arguments: `(file, path)`, where `file` is the file definition,\r\n * and `path` is its property path in the ModelSettings instance. A string must be returned to be the replacement.\r\n *\r\n * ```js\r\n * modelSettings.replaceFiles((file, path) => {\r\n * // file = \"foo.moc\", path = \"moc\"\r\n * // file = \"foo.png\", path = \"textures[0]\"\r\n * // file = \"foo.mtn\", path = \"motions.idle[0].file\"\r\n * // file = \"foo.motion3.json\", path = \"motions.idle[0].File\"\r\n *\r\n * return \"bar/\" + file;\r\n * });\r\n * ```\r\n */\r\n replaceFiles(replacer) {\r\n this.moc = replacer(this.moc, 'moc');\r\n if (this.pose !== undefined) {\r\n (this.pose = replacer(this.pose, 'pose'));\r\n }\r\n if (this.physics !== undefined) {\r\n (this.physics = replacer(this.physics, 'physics'));\r\n }\r\n for (let i = 0; i < this.textures.length; i++) {\r\n this.textures[i] = replacer(this.textures[i], `textures[${i}]`);\r\n }\r\n }\r\n ;\r\n /**\r\n * Retrieves all resource files defined in the settings.\r\n * @return A flat array of the paths of all resource files.\r\n *\r\n * ```js\r\n * modelSettings.getDefinedFiles();\r\n * // returns: [\"foo.moc\", \"foo.png\", ...]\r\n * ```\r\n */\r\n getDefinedFiles() {\r\n const files = [];\r\n this.replaceFiles((file) => {\r\n files.push(file);\r\n return file;\r\n });\r\n return files;\r\n }\r\n /**\r\n * Validates that the files defined in the settings exist in given files. Each file will be\r\n * resolved by {@link resolveURL} before comparison.\r\n * @param files - A flat array of file paths.\r\n * @return All the files which are defined in the settings and also exist in given files,\r\n * *including the optional files*.\r\n * @throws Error if any *essential* file is defined in settings but not included in given files.\r\n */\r\n validateFiles(files) {\r\n const assertFileExists = (expectedFile, shouldThrow) => {\r\n const actualPath = this.resolveURL(expectedFile);\r\n if (!files.includes(actualPath)) {\r\n if (shouldThrow) {\r\n throw new Error(`File \"${expectedFile}\" is defined in settings, but doesn't exist in given files`);\r\n }\r\n return false;\r\n }\r\n return true;\r\n };\r\n const essentialFiles = [this.moc, ...this.textures];\r\n essentialFiles.forEach(texture => assertFileExists(texture, true));\r\n const definedFiles = this.getDefinedFiles();\r\n return definedFiles.filter(file => assertFileExists(file, false));\r\n }\r\n}\r\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return MotionPreloadStrategy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return MotionManager; });\n/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);\n/* harmony import */ var _cubism_common_MotionState__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);\n/* harmony import */ var _cubism_common_SoundManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(0);\n/* harmony import */ var _pixi_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2);\n/* harmony import */ var _pixi_utils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_pixi_utils__WEBPACK_IMPORTED_MODULE_4__);\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n};\r\n\r\n\r\n\r\n\r\n\r\n/**\r\n * Indicates how the motions will be preloaded.\r\n */\r\nvar MotionPreloadStrategy;\r\n(function (MotionPreloadStrategy) {\r\n /** Preload all the motions. */\r\n MotionPreloadStrategy[\"ALL\"] = \"ALL\";\r\n /** Preload only the idle motions. */\r\n MotionPreloadStrategy[\"IDLE\"] = \"IDLE\";\r\n /** No preload. */\r\n MotionPreloadStrategy[\"NONE\"] = \"NONE\";\r\n})(MotionPreloadStrategy || (MotionPreloadStrategy = {}));\r\n/**\r\n * Handles the motion playback.\r\n * @emits {@link MotionManagerEvents}\r\n */\r\nclass MotionManager extends _pixi_utils__WEBPACK_IMPORTED_MODULE_4__[\"EventEmitter\"] {\r\n constructor(settings, options) {\r\n super();\r\n /**\r\n * The Motions. The structure is the same as {@link definitions}, initially each group contains\r\n * an empty array, which means all motions will be `undefined`. When a Motion has been loaded,\r\n * it'll fill the place in which it should be; when it fails to load, the place will be filled\r\n * with `null`.\r\n */\r\n this.motionGroups = {};\r\n /**\r\n * Maintains the state of this MotionManager.\r\n */\r\n this.state = new _cubism_common_MotionState__WEBPACK_IMPORTED_MODULE_1__[/* MotionState */ \"b\"]();\r\n /**\r\n * Flags there's a motion playing.\r\n */\r\n this.playing = false;\r\n /**\r\n * Flags the instances has been destroyed.\r\n */\r\n this.destroyed = false;\r\n this.settings = settings;\r\n this.tag = `MotionManager(${settings.name})`;\r\n this.state.tag = this.tag;\r\n }\r\n /**\r\n * Should be called in the constructor of derived class.\r\n */\r\n init(options) {\r\n if (options === null || options === void 0 ? void 0 : options.idleMotionGroup) {\r\n this.groups.idle = options.idleMotionGroup;\r\n }\r\n this.setupMotions(options);\r\n this.stopAllMotions();\r\n }\r\n /**\r\n * Sets up motions from the definitions, and preloads them according to the preload strategy.\r\n */\r\n setupMotions(options) {\r\n for (const group of Object.keys(this.definitions)) {\r\n // init with the same structure of definitions\r\n this.motionGroups[group] = [];\r\n }\r\n // preload motions\r\n let groups;\r\n switch (options === null || options === void 0 ? void 0 : options.motionPreload) {\r\n case MotionPreloadStrategy.NONE:\r\n return;\r\n case MotionPreloadStrategy.ALL:\r\n groups = Object.keys(this.definitions);\r\n break;\r\n case MotionPreloadStrategy.IDLE:\r\n default:\r\n groups = [this.groups.idle];\r\n break;\r\n }\r\n for (const group of groups) {\r\n if (this.definitions[group]) {\r\n for (let i = 0; i < this.definitions[group].length; i++) {\r\n this.loadMotion(group, i).then();\r\n }\r\n }\r\n }\r\n }\r\n /**\r\n * Loads a Motion in a motion group. Errors in this method will not be thrown,\r\n * but be emitted with a \"motionLoadError\" event.\r\n * @param group - The motion group.\r\n * @param index - Index in the motion group.\r\n * @return Promise that resolves with the Motion, or with undefined if it can't be loaded.\r\n * @emits {@link MotionManagerEvents.motionLoaded}\r\n * @emits {@link MotionManagerEvents.motionLoadError}\r\n */\r\n loadMotion(group, index) {\r\n var _a;\r\n return __awaiter(this, void 0, void 0, function* () {\r\n if (!((_a = this.definitions[group]) === null || _a === void 0 ? void 0 : _a[index])) {\r\n _utils__WEBPACK_IMPORTED_MODULE_3__[/* logger */ \"f\"].warn(this.tag, `Undefined motion at \"${group}\"[${index}]`);\r\n return undefined;\r\n }\r\n if (this.motionGroups[group][index] === null) {\r\n _utils__WEBPACK_IMPORTED_MODULE_3__[/* logger */ \"f\"].warn(this.tag, `Cannot start motion at \"${group}\"[${index}] because it's already failed in loading.`);\r\n return undefined;\r\n }\r\n if (this.motionGroups[group][index]) {\r\n return this.motionGroups[group][index];\r\n }\r\n const motion = yield this._loadMotion(group, index);\r\n if (this.destroyed) {\r\n return;\r\n }\r\n this.motionGroups[group][index] = motion !== null && motion !== void 0 ? motion : null;\r\n return motion;\r\n });\r\n }\r\n // TODO: remove\r\n /**\r\n * Loads the Motion. Will be implemented by Live2DFactory.\r\n * @ignore\r\n */\r\n _loadMotion(group, index) {\r\n throw new Error('Not implemented.');\r\n }\r\n /**\r\n * Starts a motion as given priority.\r\n * @param group - The motion group.\r\n * @param index - Index in the motion group.\r\n * @param priority - The priority to be applied.\r\n * @return Promise that resolves with true if the motion is successfully started, with false otherwise.\r\n */\r\n startMotion(group, index, priority = _cubism_common_MotionState__WEBPACK_IMPORTED_MODULE_1__[/* MotionPriority */ \"a\"].NORMAL) {\r\n var _a;\r\n return __awaiter(this, void 0, void 0, function* () {\r\n if (!this.state.reserve(group, index, priority)) {\r\n return false;\r\n }\r\n const definition = (_a = this.definitions[group]) === null || _a === void 0 ? void 0 : _a[index];\r\n if (!definition) {\r\n return false;\r\n }\r\n if (this.currentAudio) {\r\n // TODO: reuse the audio?\r\n _cubism_common_SoundManager__WEBPACK_IMPORTED_MODULE_2__[/* SoundManager */ \"a\"].dispose(this.currentAudio);\r\n }\r\n let audio;\r\n if (_config__WEBPACK_IMPORTED_MODULE_0__[/* config */ \"b\"].sound) {\r\n const soundURL = this.getSoundFile(definition);\r\n if (soundURL) {\r\n try {\r\n // start to load the audio\r\n audio = _cubism_common_SoundManager__WEBPACK_IMPORTED_MODULE_2__[/* SoundManager */ \"a\"].add(this.settings.resolveURL(soundURL), () => this.currentAudio = undefined, () => this.currentAudio = undefined);\r\n this.currentAudio = audio;\r\n }\r\n catch (e) {\r\n _utils__WEBPACK_IMPORTED_MODULE_3__[/* logger */ \"f\"].warn(this.tag, 'Failed to create audio', soundURL, e);\r\n }\r\n }\r\n }\r\n const motion = yield this.loadMotion(group, index);\r\n if (audio) {\r\n const readyToPlay = _cubism_common_SoundManager__WEBPACK_IMPORTED_MODULE_2__[/* SoundManager */ \"a\"].play(audio)\r\n .catch(e => _utils__WEBPACK_IMPORTED_MODULE_3__[/* logger */ \"f\"].warn(this.tag, 'Failed to play audio', audio.src, e));\r\n if (_config__WEBPACK_IMPORTED_MODULE_0__[/* config */ \"b\"].motionSync) {\r\n // wait until the audio is ready\r\n yield readyToPlay;\r\n }\r\n }\r\n if (!this.state.start(motion, group, index, priority)) {\r\n if (audio) {\r\n _cubism_common_SoundManager__WEBPACK_IMPORTED_MODULE_2__[/* SoundManager */ \"a\"].dispose(audio);\r\n this.currentAudio = undefined;\r\n }\r\n return false;\r\n }\r\n _utils__WEBPACK_IMPORTED_MODULE_3__[/* logger */ \"f\"].log(this.tag, 'Start motion:', this.getMotionName(definition));\r\n this.emit('motionStart', group, index, audio);\r\n if (this.state.shouldOverrideExpression()) {\r\n this.expressionManager && this.expressionManager.resetExpression();\r\n }\r\n this.playing = true;\r\n this._startMotion(motion);\r\n return true;\r\n });\r\n }\r\n /**\r\n * Starts a random Motion as given priority.\r\n * @param group - The motion group.\r\n * @param priority - The priority to be applied.\r\n * @return Promise that resolves with true if the motion is successfully started, with false otherwise.\r\n */\r\n startRandomMotion(group, priority) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n const groupDefs = this.definitions[group];\r\n if (groupDefs === null || groupDefs === void 0 ? void 0 : groupDefs.length) {\r\n const availableIndices = [];\r\n for (let i = 0; i < groupDefs.length; i++) {\r\n if (this.motionGroups[group][i] !== null && !this.state.isActive(group, i)) {\r\n availableIndices.push(i);\r\n }\r\n }\r\n if (availableIndices.length) {\r\n const index = Math.floor(Math.random() * availableIndices.length);\r\n return this.startMotion(group, availableIndices[index], priority);\r\n }\r\n }\r\n return false;\r\n });\r\n }\r\n /**\r\n * Stops all playing motions as well as the sound.\r\n */\r\n stopAllMotions() {\r\n this._stopAllMotions();\r\n this.state.reset();\r\n if (this.currentAudio) {\r\n _cubism_common_SoundManager__WEBPACK_IMPORTED_MODULE_2__[/* SoundManager */ \"a\"].dispose(this.currentAudio);\r\n this.currentAudio = undefined;\r\n }\r\n }\r\n /**\r\n * Updates parameters of the core model.\r\n * @param model - The core model.\r\n * @param now - Current time in milliseconds.\r\n * @return True if the parameters have been actually updated.\r\n */\r\n update(model, now) {\r\n var _a, _b;\r\n if (this.isFinished()) {\r\n if (this.playing) {\r\n this.playing = false;\r\n this.emit('motionFinish');\r\n }\r\n if (this.state.shouldOverrideExpression()) {\r\n (_a = this.expressionManager) === null || _a === void 0 ? void 0 : _a.restoreExpression();\r\n }\r\n this.state.complete();\r\n if (this.state.shouldRequestIdleMotion()) {\r\n // noinspection JSIgnoredPromiseFromCall\r\n this.startRandomMotion(this.groups.idle, _cubism_common_MotionState__WEBPACK_IMPORTED_MODULE_1__[/* MotionPriority */ \"a\"].IDLE);\r\n }\r\n }\r\n let updated = this.updateParameters(model, now);\r\n updated = ((_b = this.expressionManager) === null || _b === void 0 ? void 0 : _b.update(model, now)) || updated;\r\n return updated;\r\n }\r\n /**\r\n * Destroys the instance.\r\n * @emits {@link MotionManagerEvents.destroy}\r\n */\r\n destroy() {\r\n var _a;\r\n this.destroyed = true;\r\n this.emit('destroy');\r\n this.stopAllMotions();\r\n (_a = this.expressionManager) === null || _a === void 0 ? void 0 : _a.destroy();\r\n const self = this;\r\n self.definitions = undefined;\r\n self.motionGroups = undefined;\r\n }\r\n}\r\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return InternalModel; });\n/* harmony import */ var _cubism_common_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);\n/* harmony import */ var _cubism_common_FocusController__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14);\n/* harmony import */ var _pixi_math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5);\n/* harmony import */ var _pixi_math__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_pixi_math__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _pixi_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2);\n/* harmony import */ var _pixi_utils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_pixi_utils__WEBPACK_IMPORTED_MODULE_3__);\n\r\n\r\n\r\n\r\nconst tempBounds = { x: 0, y: 0, width: 0, height: 0 };\r\n/**\r\n * A wrapper that manages the states of a Live2D core model, and delegates all operations to it.\r\n * @emits {@link InternalModelEvents}\r\n */\r\nclass InternalModel extends _pixi_utils__WEBPACK_IMPORTED_MODULE_3__[\"EventEmitter\"] {\r\n constructor() {\r\n super(...arguments);\r\n this.focusController = new _cubism_common_FocusController__WEBPACK_IMPORTED_MODULE_1__[/* FocusController */ \"a\"]();\r\n /**\r\n * Original canvas width of the model. Note this doesn't represent the model's real size,\r\n * as the model can overflow from its canvas.\r\n */\r\n this.originalWidth = 0;\r\n /**\r\n * Original canvas height of the model. Note this doesn't represent the model's real size,\r\n * as the model can overflow from its canvas.\r\n */\r\n this.originalHeight = 0;\r\n /**\r\n * Canvas width of the model, scaled by the `width` of the model's layout.\r\n */\r\n this.width = 0;\r\n /**\r\n * Canvas height of the model, scaled by the `height` of the model's layout.\r\n */\r\n this.height = 0;\r\n /**\r\n * Local transformation, calculated from the model's layout.\r\n */\r\n this.localTransform = new _pixi_math__WEBPACK_IMPORTED_MODULE_2__[\"Matrix\"]();\r\n /**\r\n * The final matrix to draw the model.\r\n */\r\n this.drawingMatrix = new _pixi_math__WEBPACK_IMPORTED_MODULE_2__[\"Matrix\"]();\r\n // TODO: change structure\r\n /**\r\n * The hit area definitions, keyed by their names.\r\n */\r\n this.hitAreas = {};\r\n /**\r\n * Flags whether `gl.UNPACK_FLIP_Y_WEBGL` should be enabled when binding the textures.\r\n */\r\n this.textureFlipY = false;\r\n /**\r\n * WebGL viewport when drawing the model. The format is `[x, y, width, height]`.\r\n */\r\n this.viewport = [0, 0, 0, 0];\r\n /**\r\n * Flags this instance has been destroyed.\r\n */\r\n this.destroyed = false;\r\n }\r\n /**\r\n * Should be called in the constructor of derived class.\r\n */\r\n init() {\r\n this.setupLayout();\r\n this.setupHitAreas();\r\n }\r\n /**\r\n * Sets up the model's size and local transform by the model's layout.\r\n */\r\n setupLayout() {\r\n // cast `this` to be mutable\r\n const self = this;\r\n const size = this.getSize();\r\n self.originalWidth = size[0];\r\n self.originalHeight = size[1];\r\n const layout = Object.assign({\r\n width: _cubism_common_constants__WEBPACK_IMPORTED_MODULE_0__[/* LOGICAL_WIDTH */ \"b\"],\r\n height: _cubism_common_constants__WEBPACK_IMPORTED_MODULE_0__[/* LOGICAL_HEIGHT */ \"a\"],\r\n }, this.getLayout());\r\n this.localTransform.scale(layout.width / _cubism_common_constants__WEBPACK_IMPORTED_MODULE_0__[/* LOGICAL_WIDTH */ \"b\"], layout.height / _cubism_common_constants__WEBPACK_IMPORTED_MODULE_0__[/* LOGICAL_HEIGHT */ \"a\"]);\r\n self.width = this.originalWidth * this.localTransform.a;\r\n self.height = this.originalHeight * this.localTransform.d;\r\n // this calculation differs from Live2D SDK...\r\n const offsetX = (layout.x !== undefined && layout.x - layout.width / 2)\r\n || (layout.centerX !== undefined && layout.centerX)\r\n || (layout.left !== undefined && layout.left - layout.width / 2)\r\n || (layout.right !== undefined && layout.right + layout.width / 2)\r\n || 0;\r\n const offsetY = (layout.y !== undefined && layout.y - layout.height / 2)\r\n || (layout.centerY !== undefined && layout.centerY)\r\n || (layout.top !== undefined && layout.top - layout.height / 2)\r\n || (layout.bottom !== undefined && layout.bottom + layout.height / 2)\r\n || 0;\r\n this.localTransform.translate(this.width * offsetX, -this.height * offsetY);\r\n }\r\n /**\r\n * Sets up the hit areas by their definitions in settings.\r\n */\r\n setupHitAreas() {\r\n const definitions = this.getHitAreaDefs().filter(hitArea => hitArea.index >= 0);\r\n for (const def of definitions) {\r\n this.hitAreas[def.name] = def;\r\n }\r\n }\r\n /**\r\n * Hit-test on the model.\r\n * @param x - Position in model canvas.\r\n * @param y - Position in model canvas.\r\n * @return The names of the *hit* hit areas. Can be empty if none is hit.\r\n */\r\n hitTest(x, y) {\r\n return Object.keys(this.hitAreas).filter(hitAreaName => this.isHit(hitAreaName, x, y));\r\n }\r\n /**\r\n * Hit-test for a single hit area.\r\n * @param hitAreaName - The hit area's name.\r\n * @param x - Position in model canvas.\r\n * @param y - Position in model canvas.\r\n * @return True if hit.\r\n */\r\n isHit(hitAreaName, x, y) {\r\n if (!this.hitAreas[hitAreaName]) {\r\n return false;\r\n }\r\n const drawIndex = this.hitAreas[hitAreaName].index;\r\n const bounds = this.getDrawableBounds(drawIndex, tempBounds);\r\n return bounds.x <= x && x <= bounds.x + bounds.width && bounds.y <= y && y <= bounds.y + bounds.height;\r\n }\r\n /**\r\n * Gets a drawable's bounds.\r\n * @param index - Index of the drawable.\r\n * @param bounds - Object to store the output values.\r\n * @return The bounds in model canvas space.\r\n */\r\n getDrawableBounds(index, bounds) {\r\n const vertices = this.getDrawableVertices(index);\r\n let left = vertices[0];\r\n let right = vertices[0];\r\n let top = vertices[1];\r\n let bottom = vertices[1];\r\n for (let i = 0; i < vertices.length; i += 2) {\r\n const vx = vertices[i];\r\n const vy = vertices[i + 1];\r\n left = Math.min(vx, left);\r\n right = Math.max(vx, right);\r\n top = Math.min(vy, top);\r\n bottom = Math.max(vy, bottom);\r\n }\r\n bounds !== null && bounds !== void 0 ? bounds : (bounds = {});\r\n bounds.x = left;\r\n bounds.y = top;\r\n bounds.width = right - left;\r\n bounds.height = bottom - top;\r\n return bounds;\r\n }\r\n /**\r\n * Updates the model's transform.\r\n * @param transform - The world transform.\r\n */\r\n updateTransform(transform) {\r\n this.drawingMatrix.copyFrom(transform).append(this.localTransform);\r\n }\r\n /**\r\n * Updates the model's parameters.\r\n * @param dt - Elapsed time in milliseconds from last frame.\r\n * @param now - Current time in milliseconds.\r\n */\r\n update(dt, now) {\r\n this.focusController.update(dt);\r\n }\r\n ;\r\n /**\r\n * Destroys the model and all related resources.\r\n * @emits {@link InternalModelEvents.destroy | destroy}\r\n */\r\n destroy() {\r\n this.destroyed = true;\r\n this.emit('destroy');\r\n this.motionManager.destroy();\r\n this.motionManager = undefined;\r\n }\r\n}\r\n\n\n/***/ }),\n/* 14 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return FocusController; });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);\n\r\n// Minimum distance to respond\r\nconst EPSILON = 0.01;\r\nconst MAX_SPEED = 40 / 7.5;\r\n// the time to accelerate to max speed\r\nconst ACCELERATION_TIME = 1 / (0.15 * 1000);\r\n/**\r\n * Interpolates the transition of focus position.\r\n */\r\nclass FocusController {\r\n constructor() {\r\n /** The focus position. */\r\n this.targetX = 0;\r\n /** The focus position. */\r\n this.targetY = 0;\r\n /** Current position. */\r\n this.x = 0;\r\n /** Current position. */\r\n this.y = 0;\r\n /** Current velocity. */\r\n this.vx = 0;\r\n /** Current velocity. */\r\n this.vy = 0;\r\n }\r\n /**\r\n * Sets the focus position.\r\n * @param x - X position in range `[-1, 1]`.\r\n * @param y - Y position in range `[-1, 1]`.\r\n * @param instant - Should the focus position be instantly applied.\r\n */\r\n focus(x, y, instant = false) {\r\n this.targetX = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* clamp */ \"b\"])(x, -1, 1);\r\n this.targetY = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[/* clamp */ \"b\"])(y, -1, 1);\r\n if (instant) {\r\n this.x = this.targetX;\r\n this.y = this.targetY;\r\n }\r\n }\r\n /**\r\n * Updates the interpolation.\r\n * @param dt - Delta time in milliseconds.\r\n */\r\n update(dt) {\r\n const dx = this.targetX - this.x;\r\n const dy = this.targetY - this.y;\r\n if (Math.abs(dx) < EPSILON && Math.abs(dy) < EPSILON)\r\n return;\r\n const d = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));\r\n const maxSpeed = MAX_SPEED / (1000 / dt);\r\n let ax = maxSpeed * (dx / d) - this.vx;\r\n let ay = maxSpeed * (dy / d) - this.vy;\r\n const a = Math.sqrt(Math.pow(ax, 2) + Math.pow(ay, 2));\r\n const maxA = maxSpeed * ACCELERATION_TIME * dt;\r\n if (a > maxA) {\r\n ax *= maxA / a;\r\n ay *= maxA / a;\r\n }\r\n this.vx += ax;\r\n this.vy += ay;\r\n const v = Math.sqrt(Math.pow(this.vx, 2) + Math.pow(this.vy, 2));\r\n const maxV = 0.5 * (Math.sqrt(Math.pow(maxA, 2) + 8 * maxA * d) - maxA);\r\n if (v > maxV) {\r\n this.vx *= maxV / v;\r\n this.vy *= maxV / v;\r\n }\r\n this.x += this.vx;\r\n this.y += this.vy;\r\n }\r\n}\r\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return XHRLoader; });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);\n\r\nconst TAG = 'XHRLoader';\r\nclass NetworkError extends Error {\r\n constructor(message, url, status, aborted = false) {\r\n super(message);\r\n this.url = url;\r\n this.status = status;\r\n this.aborted = aborted;\r\n }\r\n}\r\n/**\r\n * The basic XHR loader.\r\n *\r\n * A network error will be thrown with the following properties:\r\n * - `url` - The request URL.\r\n * - `status` - The HTTP status.\r\n * - `aborted` - True if the error is caused by aborting the XHR.\r\n */\r\nclass XHRLoader {\r\n /**\r\n * Creates a managed XHR.\r\n * @param target - If provided, the XHR will be canceled when receiving an \"destroy\" event from the target.\r\n * @param url - The URL.\r\n * @param type - The XHR response type.\r\n * @param onload - Load listener.\r\n * @param onerror - Error handler.\r\n */\r\n static createXHR(target, url, type, onload, onerror) {\r\n const xhr = new XMLHttpRequest();\r\n XHRLoader.allXhrSet.add(xhr);\r\n if (target) {\r\n let xhrSet = XHRLoader.xhrMap.get(target);\r\n if (!xhrSet) {\r\n xhrSet = new Set([xhr]);\r\n XHRLoader.xhrMap.set(target, xhrSet);\r\n }\r\n else {\r\n xhrSet.add(xhr);\r\n }\r\n if (!target.listeners('destroy').includes(XHRLoader.cancelXHRs)) {\r\n target.once('destroy', XHRLoader.cancelXHRs);\r\n }\r\n }\r\n xhr.open('GET', url);\r\n xhr.responseType = type;\r\n xhr.onload = () => {\r\n if ((xhr.status === 200 || xhr.status === 0) && xhr.response) {\r\n onload(xhr.response);\r\n }\r\n else {\r\n xhr.onerror();\r\n }\r\n };\r\n xhr.onerror = () => {\r\n _utils__WEBPACK_IMPORTED_MODULE_0__[/* logger */ \"f\"].warn(TAG, `Failed to load resource as ${xhr.responseType} (Status ${xhr.status}): ${url}`);\r\n onerror(new NetworkError('Network error.', url, xhr.status));\r\n };\r\n xhr.onabort = () => onerror(new NetworkError('Aborted.', url, xhr.status, true));\r\n xhr.onloadend = () => {\r\n var _a;\r\n XHRLoader.allXhrSet.delete(xhr);\r\n if (target) {\r\n (_a = XHRLoader.xhrMap.get(target)) === null || _a === void 0 ? void 0 : _a.delete(xhr);\r\n }\r\n };\r\n return xhr;\r\n }\r\n /**\r\n * Cancels all XHRs related to this target.\r\n */\r\n static cancelXHRs() {\r\n var _a;\r\n (_a = XHRLoader.xhrMap.get(this)) === null || _a === void 0 ? void 0 : _a.forEach(xhr => {\r\n xhr.abort();\r\n XHRLoader.allXhrSet.delete(xhr);\r\n });\r\n XHRLoader.xhrMap.delete(this);\r\n }\r\n /**\r\n * Release all XHRs.\r\n */\r\n static release() {\r\n XHRLoader.allXhrSet.forEach(xhr => xhr.abort());\r\n XHRLoader.allXhrSet.clear();\r\n XHRLoader.xhrMap = new WeakMap();\r\n }\r\n}\r\n/**\r\n * All the created XHRs, keyed by their owners respectively.\r\n */\r\nXHRLoader.xhrMap = new WeakMap();\r\n/**\r\n * All the created XHRs as a flat array.\r\n */\r\nXHRLoader.allXhrSet = new Set();\r\n/**\r\n * Middleware for Live2DLoader.\r\n */\r\nXHRLoader.loader = (context, next) => {\r\n return new Promise((resolve, reject) => {\r\n const xhr = XHRLoader.createXHR(context.target, context.settings ? context.settings.resolveURL(context.url) : context.url, context.type, data => {\r\n context.result = data;\r\n resolve();\r\n }, reject);\r\n xhr.send();\r\n });\r\n};\r\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return runMiddlewares; });\n/**\r\n * Run middlewares with given context.\r\n * @see https://github.com/koajs/compose/blob/master/index.js\r\n *\r\n * @param middleware\r\n * @param context\r\n */\r\nfunction runMiddlewares(middleware, context) {\r\n // last called middleware #\r\n let index = -1;\r\n return dispatch(0);\r\n function dispatch(i, err) {\r\n if (err)\r\n return Promise.reject(err);\r\n if (i <= index)\r\n return Promise.reject(new Error('next() called multiple times'));\r\n index = i;\r\n const fn = middleware[i];\r\n if (!fn)\r\n return Promise.resolve();\r\n try {\r\n return Promise.resolve(fn(context, dispatch.bind(null, i + 1)));\r\n }\r\n catch (err) {\r\n return Promise.reject(err);\r\n }\r\n }\r\n}\r\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE__17__;\n\n/***/ }),\n/* 18 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, \"g\", function() { return /* reexport */ cubism_common[\"e\" /* LOGICAL_WIDTH */]; });\n__webpack_require__.d(__webpack_exports__, \"f\", function() { return /* reexport */ cubism_common[\"d\" /* LOGICAL_HEIGHT */]; });\n__webpack_require__.d(__webpack_exports__, \"a\", function() { return /* reexport */ cubism_common[\"a\" /* ExpressionManager */]; });\n__webpack_require__.d(__webpack_exports__, \"c\", function() { return /* reexport */ cubism_common[\"b\" /* FocusController */]; });\n__webpack_require__.d(__webpack_exports__, \"l\", function() { return /* reexport */ cubism_common[\"f\" /* ModelSettings */]; });\n__webpack_require__.d(__webpack_exports__, \"o\", function() { return /* reexport */ cubism_common[\"i\" /* MotionPriority */]; });\n__webpack_require__.d(__webpack_exports__, \"p\", function() { return /* reexport */ cubism_common[\"j\" /* MotionState */]; });\n__webpack_require__.d(__webpack_exports__, \"n\", function() { return /* reexport */ cubism_common[\"h\" /* MotionPreloadStrategy */]; });\n__webpack_require__.d(__webpack_exports__, \"m\", function() { return /* reexport */ cubism_common[\"g\" /* MotionManager */]; });\n__webpack_require__.d(__webpack_exports__, \"q\", function() { return /* reexport */ cubism_common[\"k\" /* SoundManager */]; });\n__webpack_require__.d(__webpack_exports__, \"e\", function() { return /* reexport */ cubism_common[\"c\" /* InternalModel */]; });\n__webpack_require__.d(__webpack_exports__, \"j\", function() { return /* reexport */ Live2DModel_Live2DModel; });\n__webpack_require__.d(__webpack_exports__, \"k\", function() { return /* reexport */ Live2DTransform_Live2DTransform; });\n__webpack_require__.d(__webpack_exports__, \"d\", function() { return /* reexport */ InteractionMixin; });\n__webpack_require__.d(__webpack_exports__, \"w\", function() { return /* reexport */ config[\"b\" /* config */]; });\n__webpack_require__.d(__webpack_exports__, \"r\", function() { return /* reexport */ config[\"a\" /* VERSION */]; });\n__webpack_require__.d(__webpack_exports__, \"h\", function() { return /* reexport */ Live2DFactory[\"a\" /* Live2DFactory */]; });\n__webpack_require__.d(__webpack_exports__, \"i\", function() { return /* reexport */ Live2DLoader[\"a\" /* Live2DLoader */]; });\n__webpack_require__.d(__webpack_exports__, \"s\", function() { return /* reexport */ XHRLoader[\"a\" /* XHRLoader */]; });\n__webpack_require__.d(__webpack_exports__, \"b\", function() { return /* reexport */ FileLoader_FileLoader; });\n__webpack_require__.d(__webpack_exports__, \"t\", function() { return /* reexport */ ZipLoader_ZipLoader; });\n__webpack_require__.d(__webpack_exports__, \"A\", function() { return /* reexport */ utils[\"f\" /* logger */]; });\n__webpack_require__.d(__webpack_exports__, \"v\", function() { return /* reexport */ utils[\"b\" /* clamp */]; });\n__webpack_require__.d(__webpack_exports__, \"B\", function() { return /* reexport */ utils[\"g\" /* rand */]; });\n__webpack_require__.d(__webpack_exports__, \"y\", function() { return /* reexport */ utils[\"d\" /* copyProperty */]; });\n__webpack_require__.d(__webpack_exports__, \"x\", function() { return /* reexport */ utils[\"c\" /* copyArray */]; });\n__webpack_require__.d(__webpack_exports__, \"u\", function() { return /* reexport */ utils[\"a\" /* applyMixins */]; });\n__webpack_require__.d(__webpack_exports__, \"z\", function() { return /* reexport */ utils[\"e\" /* folderName */]; });\n\n// EXTERNAL MODULE: ./src/cubism-common/index.ts\nvar cubism_common = __webpack_require__(6);\n\n// EXTERNAL MODULE: ./src/factory/Live2DFactory.ts + 2 modules\nvar Live2DFactory = __webpack_require__(4);\n\n// EXTERNAL MODULE: external {\"commonjs\":\"@pixi/display\",\"commonjs2\":\"@pixi/display\",\"amd\":\"@pixi/display\",\"root\":\"PIXI\"}\nvar display_root_PIXI_ = __webpack_require__(20);\n\n// EXTERNAL MODULE: external {\"commonjs\":\"@pixi/math\",\"commonjs2\":\"@pixi/math\",\"amd\":\"@pixi/math\",\"root\":\"PIXI\"}\nvar math_root_PIXI_ = __webpack_require__(5);\n\n// CONCATENATED MODULE: ./src/InteractionMixin.ts\n/**\r\n * The interaction control split from Live2DModel class for code clarity. This mixin should *only*\r\n * be used on the Live2DModel.\r\n */\r\nclass InteractionMixin {\r\n constructor() {\r\n this._autoInteract = false;\r\n }\r\n /**\r\n * Enables automatic interaction. Only takes effect if Pixi's interaction\r\n * feature has been enabled (by registering the `PIXI.InteractionManager` into `PIXI.Renderer`).\r\n */\r\n get autoInteract() {\r\n return this._autoInteract;\r\n }\r\n set autoInteract(autoInteract) {\r\n if (autoInteract !== this._autoInteract) {\r\n if (autoInteract) {\r\n this.on('pointertap', onTap, this);\r\n }\r\n else {\r\n this.off('pointertap', onTap, this);\r\n }\r\n this._autoInteract = autoInteract;\r\n }\r\n }\r\n /**\r\n * Registers interaction by subscribing to the `PIXI.InteractionManager`.\r\n */\r\n registerInteraction(manager) {\r\n if (manager !== this.interactionManager) {\r\n this.unregisterInteraction();\r\n if (this._autoInteract && manager) {\r\n this.interactionManager = manager;\r\n manager.on('pointermove', onPointerMove, this);\r\n }\r\n }\r\n }\r\n /**\r\n * Unregisters interaction.\r\n */\r\n unregisterInteraction() {\r\n var _a;\r\n if (this.interactionManager) {\r\n (_a = this.interactionManager) === null || _a === void 0 ? void 0 : _a.off('pointermove', onPointerMove, this);\r\n this.interactionManager = undefined;\r\n }\r\n }\r\n}\r\nfunction onTap(event) {\r\n this.tap(event.data.global.x, event.data.global.y);\r\n}\r\nfunction onPointerMove(event) {\r\n this.focus(event.data.global.x, event.data.global.y);\r\n}\r\n\n// CONCATENATED MODULE: ./src/Live2DTransform.ts\n\r\n/**\r\n * Useless class. May be useful in the future.\r\n */\r\nclass Live2DTransform_Live2DTransform extends math_root_PIXI_[\"Transform\"] {\r\n}\r\n\n// EXTERNAL MODULE: ./src/utils/index.ts + 4 modules\nvar utils = __webpack_require__(0);\n\n// CONCATENATED MODULE: ./src/Live2DModel.ts\nvar _a;\r\n\r\n\r\n\r\n\r\n\r\n\r\nconst tempPoint = new math_root_PIXI_[\"Point\"]();\r\nconst tempMatrix = new math_root_PIXI_[\"Matrix\"]();\r\n// a reference to Ticker class, defaults to window.PIXI.Ticker (when loaded by a \r\n\r\n\r\n","/*!\n * @pixi/polyfill - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/polyfill is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Polyfill } from 'es6-promise-polyfill';\nimport objectAssign from 'object-assign';\n\n// Support for IE 9 - 11 which does not include Promises\nif (!window.Promise) {\n window.Promise = Polyfill;\n}\n\n// References:\nif (!Object.assign) {\n Object.assign = objectAssign;\n}\n\n// References:\n// http://paulirish.com/2011/requestanimationframe-for-smart-animating/\n// https://gist.github.com/1579671\n// http://updates.html5rocks.com/2012/05/requestAnimationFrame-API-now-with-sub-millisecond-precision\n// https://gist.github.com/timhall/4078614\n// https://github.com/Financial-Times/polyfill-service/tree/master/polyfills/requestAnimationFrame\n// Expected to be used with Browserfiy\n// Browserify automatically detects the use of `global` and passes the\n// correct reference of `global`, `self`, and finally `window`\nvar ONE_FRAME_TIME = 16;\n// Date.now\nif (!(Date.now && Date.prototype.getTime)) {\n Date.now = function now() {\n return new Date().getTime();\n };\n}\n// performance.now\nif (!(window.performance && window.performance.now)) {\n var startTime_1 = Date.now();\n if (!window.performance) {\n window.performance = {};\n }\n window.performance.now = function () { return Date.now() - startTime_1; };\n}\n// requestAnimationFrame\nvar lastTime = Date.now();\nvar vendors = ['ms', 'moz', 'webkit', 'o'];\nfor (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {\n var p = vendors[x];\n window.requestAnimationFrame = window[p + \"RequestAnimationFrame\"];\n window.cancelAnimationFrame = window[p + \"CancelAnimationFrame\"]\n || window[p + \"CancelRequestAnimationFrame\"];\n}\nif (!window.requestAnimationFrame) {\n window.requestAnimationFrame = function (callback) {\n if (typeof callback !== 'function') {\n throw new TypeError(callback + \"is not a function\");\n }\n var currentTime = Date.now();\n var delay = ONE_FRAME_TIME + lastTime - currentTime;\n if (delay < 0) {\n delay = 0;\n }\n lastTime = currentTime;\n return window.setTimeout(function () {\n lastTime = Date.now();\n callback(performance.now());\n }, delay);\n };\n}\nif (!window.cancelAnimationFrame) {\n window.cancelAnimationFrame = function (id) { return clearTimeout(id); };\n}\n\n// References:\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign\nif (!Math.sign) {\n Math.sign = function mathSign(x) {\n x = Number(x);\n if (x === 0 || isNaN(x)) {\n return x;\n }\n return x > 0 ? 1 : -1;\n };\n}\n\n// References:\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger\nif (!Number.isInteger) {\n Number.isInteger = function numberIsInteger(value) {\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\n };\n}\n\nif (!window.ArrayBuffer) {\n window.ArrayBuffer = Array;\n}\nif (!window.Float32Array) {\n window.Float32Array = Array;\n}\nif (!window.Uint32Array) {\n window.Uint32Array = Array;\n}\nif (!window.Uint16Array) {\n window.Uint16Array = Array;\n}\nif (!window.Uint8Array) {\n window.Uint8Array = Array;\n}\nif (!window.Int32Array) {\n window.Int32Array = Array;\n}\n//# sourceMappingURL=polyfill.es.js.map\n","/*!\n * @pixi/accessibility - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/accessibility is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { DisplayObject } from '@pixi/display';\nimport { isMobile, removeItems } from '@pixi/utils';\n\n/**\n * Default property values of accessible objects\n * used by {@link PIXI.AccessibilityManager}.\n *\n * @private\n * @function accessibleTarget\n * @memberof PIXI\n * @type {Object}\n * @example\n * function MyObject() {}\n *\n * Object.assign(\n * MyObject.prototype,\n * PIXI.accessibleTarget\n * );\n */\nvar accessibleTarget = {\n /**\n * Flag for if the object is accessible. If true AccessibilityManager will overlay a\n * shadow div with attributes set\n *\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n accessible: false,\n /**\n * Sets the title attribute of the shadow div\n * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'\n *\n * @member {?string}\n * @memberof PIXI.DisplayObject#\n */\n accessibleTitle: null,\n /**\n * Sets the aria-label attribute of the shadow div\n *\n * @member {string}\n * @memberof PIXI.DisplayObject#\n */\n accessibleHint: null,\n /**\n * @member {number}\n * @memberof PIXI.DisplayObject#\n * @private\n * @todo Needs docs.\n */\n tabIndex: 0,\n /**\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n * @todo Needs docs.\n */\n _accessibleActive: false,\n /**\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n * @todo Needs docs.\n */\n _accessibleDiv: null,\n /**\n * Specify the type of div the accessible layer is. Screen readers treat the element differently\n * depending on this type. Defaults to button.\n *\n * @member {string}\n * @memberof PIXI.DisplayObject#\n * @default 'button'\n */\n accessibleType: 'button',\n /**\n * Specify the pointer-events the accessible div will use\n * Defaults to auto.\n *\n * @member {string}\n * @memberof PIXI.DisplayObject#\n * @default 'auto'\n */\n accessiblePointerEvents: 'auto',\n /**\n * Setting to false will prevent any children inside this container to\n * be accessible. Defaults to true.\n *\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n * @default true\n */\n accessibleChildren: true,\n renderId: -1,\n};\n\n// add some extra variables to the container..\nDisplayObject.mixin(accessibleTarget);\nvar KEY_CODE_TAB = 9;\nvar DIV_TOUCH_SIZE = 100;\nvar DIV_TOUCH_POS_X = 0;\nvar DIV_TOUCH_POS_Y = 0;\nvar DIV_TOUCH_ZINDEX = 2;\nvar DIV_HOOK_SIZE = 1;\nvar DIV_HOOK_POS_X = -1000;\nvar DIV_HOOK_POS_Y = -1000;\nvar DIV_HOOK_ZINDEX = 2;\n/**\n * The Accessibility manager recreates the ability to tab and have content read by screen readers.\n * This is very important as it can possibly help people with disabilities access PixiJS content.\n *\n * A DisplayObject can be made accessible just like it can be made interactive. This manager will map the\n * events as if the mouse was being used, minimizing the effort required to implement.\n *\n * An instance of this class is automatically created by default, and can be found at `renderer.plugins.accessibility`\n *\n * @class\n * @memberof PIXI\n */\nvar AccessibilityManager = /** @class */ (function () {\n /**\n * @param {PIXI.CanvasRenderer|PIXI.Renderer} renderer - A reference to the current renderer\n */\n function AccessibilityManager(renderer) {\n /**\n * @type {?HTMLElement}\n * @private\n */\n this._hookDiv = null;\n if (isMobile.tablet || isMobile.phone) {\n this.createTouchHook();\n }\n // first we create a div that will sit over the PixiJS element. This is where the div overlays will go.\n var div = document.createElement('div');\n div.style.width = DIV_TOUCH_SIZE + \"px\";\n div.style.height = DIV_TOUCH_SIZE + \"px\";\n div.style.position = 'absolute';\n div.style.top = DIV_TOUCH_POS_X + \"px\";\n div.style.left = DIV_TOUCH_POS_Y + \"px\";\n div.style.zIndex = DIV_TOUCH_ZINDEX.toString();\n /**\n * This is the dom element that will sit over the PixiJS element. This is where the div overlays will go.\n *\n * @type {HTMLElement}\n * @private\n */\n this.div = div;\n /**\n * A simple pool for storing divs.\n *\n * @type {*}\n * @private\n */\n this.pool = [];\n /**\n * This is a tick used to check if an object is no longer being rendered.\n *\n * @type {Number}\n * @private\n */\n this.renderId = 0;\n /**\n * Setting this to true will visually show the divs.\n *\n * @type {boolean}\n */\n this.debug = false;\n /**\n * The renderer this accessibility manager works for.\n *\n * @member {PIXI.AbstractRenderer}\n */\n this.renderer = renderer;\n /**\n * The array of currently active accessible items.\n *\n * @member {Array<*>}\n * @private\n */\n this.children = [];\n /**\n * pre-bind the functions\n *\n * @type {Function}\n * @private\n */\n this._onKeyDown = this._onKeyDown.bind(this);\n /**\n * pre-bind the functions\n *\n * @type {Function}\n * @private\n */\n this._onMouseMove = this._onMouseMove.bind(this);\n this._isActive = false;\n this._isMobileAccessibility = false;\n /**\n * count to throttle div updates on android devices\n * @type number\n * @private\n */\n this.androidUpdateCount = 0;\n /**\n * the frequency to update the div elements ()\n * @private\n */\n this.androidUpdateFrequency = 500; // 2fps\n // let listen for tab.. once pressed we can fire up and show the accessibility layer\n window.addEventListener('keydown', this._onKeyDown, false);\n }\n Object.defineProperty(AccessibilityManager.prototype, \"isActive\", {\n /**\n * A flag\n * @member {boolean}\n * @readonly\n */\n get: function () {\n return this._isActive;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AccessibilityManager.prototype, \"isMobileAccessibility\", {\n /**\n * A flag\n * @member {boolean}\n * @readonly\n */\n get: function () {\n return this._isMobileAccessibility;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Creates the touch hooks.\n *\n * @private\n */\n AccessibilityManager.prototype.createTouchHook = function () {\n var _this = this;\n var hookDiv = document.createElement('button');\n hookDiv.style.width = DIV_HOOK_SIZE + \"px\";\n hookDiv.style.height = DIV_HOOK_SIZE + \"px\";\n hookDiv.style.position = 'absolute';\n hookDiv.style.top = DIV_HOOK_POS_X + \"px\";\n hookDiv.style.left = DIV_HOOK_POS_Y + \"px\";\n hookDiv.style.zIndex = DIV_HOOK_ZINDEX.toString();\n hookDiv.style.backgroundColor = '#FF0000';\n hookDiv.title = 'select to enable accessability for this content';\n hookDiv.addEventListener('focus', function () {\n _this._isMobileAccessibility = true;\n _this.activate();\n _this.destroyTouchHook();\n });\n document.body.appendChild(hookDiv);\n this._hookDiv = hookDiv;\n };\n /**\n * Destroys the touch hooks.\n *\n * @private\n */\n AccessibilityManager.prototype.destroyTouchHook = function () {\n if (!this._hookDiv) {\n return;\n }\n document.body.removeChild(this._hookDiv);\n this._hookDiv = null;\n };\n /**\n * Activating will cause the Accessibility layer to be shown.\n * This is called when a user presses the tab key.\n *\n * @private\n */\n AccessibilityManager.prototype.activate = function () {\n if (this._isActive) {\n return;\n }\n this._isActive = true;\n window.document.addEventListener('mousemove', this._onMouseMove, true);\n window.removeEventListener('keydown', this._onKeyDown, false);\n // TODO: Remove casting when CanvasRenderer is converted\n this.renderer.on('postrender', this.update, this);\n if (this.renderer.view.parentNode) {\n this.renderer.view.parentNode.appendChild(this.div);\n }\n };\n /**\n * Deactivating will cause the Accessibility layer to be hidden.\n * This is called when a user moves the mouse.\n *\n * @private\n */\n AccessibilityManager.prototype.deactivate = function () {\n if (!this._isActive || this._isMobileAccessibility) {\n return;\n }\n this._isActive = false;\n window.document.removeEventListener('mousemove', this._onMouseMove, true);\n window.addEventListener('keydown', this._onKeyDown, false);\n // TODO: Remove casting when CanvasRenderer is converted\n this.renderer.off('postrender', this.update);\n if (this.div.parentNode) {\n this.div.parentNode.removeChild(this.div);\n }\n };\n /**\n * This recursive function will run through the scene graph and add any new accessible objects to the DOM layer.\n *\n * @private\n * @param {PIXI.Container} displayObject - The DisplayObject to check.\n */\n AccessibilityManager.prototype.updateAccessibleObjects = function (displayObject) {\n if (!displayObject.visible || !displayObject.accessibleChildren) {\n return;\n }\n if (displayObject.accessible && displayObject.interactive) {\n if (!displayObject._accessibleActive) {\n this.addChild(displayObject);\n }\n displayObject.renderId = this.renderId;\n }\n var children = displayObject.children;\n for (var i = 0; i < children.length; i++) {\n this.updateAccessibleObjects(children[i]);\n }\n };\n /**\n * Before each render this function will ensure that all divs are mapped correctly to their DisplayObjects.\n *\n * @private\n */\n AccessibilityManager.prototype.update = function () {\n /* On Android default web browser, tab order seems to be calculated by position rather than tabIndex,\n * moving buttons can cause focus to flicker between two buttons making it hard/impossible to navigate,\n * so I am just running update every half a second, seems to fix it.\n */\n var now = performance.now();\n if (isMobile.android.device && now < this.androidUpdateCount) {\n return;\n }\n this.androidUpdateCount = now + this.androidUpdateFrequency;\n if (!this.renderer.renderingToScreen) {\n return;\n }\n // update children...\n if (this.renderer._lastObjectRendered) {\n this.updateAccessibleObjects(this.renderer._lastObjectRendered);\n }\n // TODO: Remove casting when CanvasRenderer is converted\n var rect = this.renderer.view.getBoundingClientRect();\n var resolution = this.renderer.resolution;\n var sx = (rect.width / this.renderer.width) * resolution;\n var sy = (rect.height / this.renderer.height) * resolution;\n var div = this.div;\n div.style.left = rect.left + \"px\";\n div.style.top = rect.top + \"px\";\n div.style.width = this.renderer.width + \"px\";\n div.style.height = this.renderer.height + \"px\";\n for (var i = 0; i < this.children.length; i++) {\n var child = this.children[i];\n if (child.renderId !== this.renderId) {\n child._accessibleActive = false;\n removeItems(this.children, i, 1);\n this.div.removeChild(child._accessibleDiv);\n this.pool.push(child._accessibleDiv);\n child._accessibleDiv = null;\n i--;\n }\n else {\n // map div to display..\n div = child._accessibleDiv;\n var hitArea = child.hitArea;\n var wt = child.worldTransform;\n if (child.hitArea) {\n div.style.left = (wt.tx + (hitArea.x * wt.a)) * sx + \"px\";\n div.style.top = (wt.ty + (hitArea.y * wt.d)) * sy + \"px\";\n div.style.width = hitArea.width * wt.a * sx + \"px\";\n div.style.height = hitArea.height * wt.d * sy + \"px\";\n }\n else {\n hitArea = child.getBounds();\n this.capHitArea(hitArea);\n div.style.left = hitArea.x * sx + \"px\";\n div.style.top = hitArea.y * sy + \"px\";\n div.style.width = hitArea.width * sx + \"px\";\n div.style.height = hitArea.height * sy + \"px\";\n // update button titles and hints if they exist and they've changed\n if (div.title !== child.accessibleTitle && child.accessibleTitle !== null) {\n div.title = child.accessibleTitle;\n }\n if (div.getAttribute('aria-label') !== child.accessibleHint\n && child.accessibleHint !== null) {\n div.setAttribute('aria-label', child.accessibleHint);\n }\n }\n // the title or index may have changed, if so lets update it!\n if (child.accessibleTitle !== div.title || child.tabIndex !== div.tabIndex) {\n div.title = child.accessibleTitle;\n div.tabIndex = child.tabIndex;\n if (this.debug)\n { this.updateDebugHTML(div); }\n }\n }\n }\n // increment the render id..\n this.renderId++;\n };\n /**\n * private function that will visually add the information to the\n * accessability div\n *\n * @param {HTMLElement} div\n */\n AccessibilityManager.prototype.updateDebugHTML = function (div) {\n div.innerHTML = \"type: \" + div.type + \"
title : \" + div.title + \"
tabIndex: \" + div.tabIndex;\n };\n /**\n * Adjust the hit area based on the bounds of a display object\n *\n * @param {PIXI.Rectangle} hitArea - Bounds of the child\n */\n AccessibilityManager.prototype.capHitArea = function (hitArea) {\n if (hitArea.x < 0) {\n hitArea.width += hitArea.x;\n hitArea.x = 0;\n }\n if (hitArea.y < 0) {\n hitArea.height += hitArea.y;\n hitArea.y = 0;\n }\n // TODO: Remove casting when CanvasRenderer is converted\n if (hitArea.x + hitArea.width > this.renderer.width) {\n hitArea.width = this.renderer.width - hitArea.x;\n }\n if (hitArea.y + hitArea.height > this.renderer.height) {\n hitArea.height = this.renderer.height - hitArea.y;\n }\n };\n /**\n * Adds a DisplayObject to the accessibility manager\n *\n * @private\n * @param {PIXI.DisplayObject} displayObject - The child to make accessible.\n */\n AccessibilityManager.prototype.addChild = function (displayObject) {\n // this.activate();\n var div = this.pool.pop();\n if (!div) {\n div = document.createElement('button');\n div.style.width = DIV_TOUCH_SIZE + \"px\";\n div.style.height = DIV_TOUCH_SIZE + \"px\";\n div.style.backgroundColor = this.debug ? 'rgba(255,255,255,0.5)' : 'transparent';\n div.style.position = 'absolute';\n div.style.zIndex = DIV_TOUCH_ZINDEX.toString();\n div.style.borderStyle = 'none';\n // ARIA attributes ensure that button title and hint updates are announced properly\n if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {\n // Chrome doesn't need aria-live to work as intended; in fact it just gets more confused.\n div.setAttribute('aria-live', 'off');\n }\n else {\n div.setAttribute('aria-live', 'polite');\n }\n if (navigator.userAgent.match(/rv:.*Gecko\\//)) {\n // FireFox needs this to announce only the new button name\n div.setAttribute('aria-relevant', 'additions');\n }\n else {\n // required by IE, other browsers don't much care\n div.setAttribute('aria-relevant', 'text');\n }\n div.addEventListener('click', this._onClick.bind(this));\n div.addEventListener('focus', this._onFocus.bind(this));\n div.addEventListener('focusout', this._onFocusOut.bind(this));\n }\n // set pointer events\n div.style.pointerEvents = displayObject.accessiblePointerEvents;\n // set the type, this defaults to button!\n div.type = displayObject.accessibleType;\n if (displayObject.accessibleTitle && displayObject.accessibleTitle !== null) {\n div.title = displayObject.accessibleTitle;\n }\n else if (!displayObject.accessibleHint\n || displayObject.accessibleHint === null) {\n div.title = \"displayObject \" + displayObject.tabIndex;\n }\n if (displayObject.accessibleHint\n && displayObject.accessibleHint !== null) {\n div.setAttribute('aria-label', displayObject.accessibleHint);\n }\n if (this.debug)\n { this.updateDebugHTML(div); }\n displayObject._accessibleActive = true;\n displayObject._accessibleDiv = div;\n div.displayObject = displayObject;\n this.children.push(displayObject);\n this.div.appendChild(displayObject._accessibleDiv);\n displayObject._accessibleDiv.tabIndex = displayObject.tabIndex;\n };\n /**\n * Maps the div button press to pixi's InteractionManager (click)\n *\n * @private\n * @param {MouseEvent} e - The click event.\n */\n AccessibilityManager.prototype._onClick = function (e) {\n // TODO: Remove casting when CanvasRenderer is converted\n var interactionManager = this.renderer.plugins.interaction;\n interactionManager.dispatchEvent(e.target.displayObject, 'click', interactionManager.eventData);\n interactionManager.dispatchEvent(e.target.displayObject, 'pointertap', interactionManager.eventData);\n interactionManager.dispatchEvent(e.target.displayObject, 'tap', interactionManager.eventData);\n };\n /**\n * Maps the div focus events to pixi's InteractionManager (mouseover)\n *\n * @private\n * @param {FocusEvent} e - The focus event.\n */\n AccessibilityManager.prototype._onFocus = function (e) {\n if (!e.target.getAttribute('aria-live')) {\n e.target.setAttribute('aria-live', 'assertive');\n }\n // TODO: Remove casting when CanvasRenderer is converted\n var interactionManager = this.renderer.plugins.interaction;\n interactionManager.dispatchEvent(e.target.displayObject, 'mouseover', interactionManager.eventData);\n };\n /**\n * Maps the div focus events to pixi's InteractionManager (mouseout)\n *\n * @private\n * @param {FocusEvent} e - The focusout event.\n */\n AccessibilityManager.prototype._onFocusOut = function (e) {\n if (!e.target.getAttribute('aria-live')) {\n e.target.setAttribute('aria-live', 'polite');\n }\n // TODO: Remove casting when CanvasRenderer is converted\n var interactionManager = this.renderer.plugins.interaction;\n interactionManager.dispatchEvent(e.target.displayObject, 'mouseout', interactionManager.eventData);\n };\n /**\n * Is called when a key is pressed\n *\n * @private\n * @param {KeyboardEvent} e - The keydown event.\n */\n AccessibilityManager.prototype._onKeyDown = function (e) {\n if (e.keyCode !== KEY_CODE_TAB) {\n return;\n }\n this.activate();\n };\n /**\n * Is called when the mouse moves across the renderer element\n *\n * @private\n * @param {MouseEvent} e - The mouse event.\n */\n AccessibilityManager.prototype._onMouseMove = function (e) {\n if (e.movementX === 0 && e.movementY === 0) {\n return;\n }\n this.deactivate();\n };\n /**\n * Destroys the accessibility manager\n *\n */\n AccessibilityManager.prototype.destroy = function () {\n this.destroyTouchHook();\n this.div = null;\n window.document.removeEventListener('mousemove', this._onMouseMove, true);\n window.removeEventListener('keydown', this._onKeyDown);\n this.pool = null;\n this.children = null;\n this.renderer = null;\n };\n return AccessibilityManager;\n}());\n\nexport { AccessibilityManager, accessibleTarget };\n//# sourceMappingURL=accessibility.es.js.map\n","/*!\n * @pixi/interaction - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/interaction is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Point } from '@pixi/math';\nimport { Ticker, UPDATE_PRIORITY } from '@pixi/ticker';\nimport { DisplayObject, TemporaryDisplayObject } from '@pixi/display';\nimport { EventEmitter } from '@pixi/utils';\n\n/**\n * Holds all information related to an Interaction event\n *\n * @class\n * @memberof PIXI\n */\nvar InteractionData = /** @class */ (function () {\n function InteractionData() {\n this.pressure = 0;\n this.rotationAngle = 0;\n this.twist = 0;\n this.tangentialPressure = 0;\n /**\n * This point stores the global coords of where the touch/mouse event happened\n *\n * @member {PIXI.Point}\n */\n this.global = new Point();\n /**\n * The target Sprite that was interacted with\n *\n * @member {PIXI.Sprite}\n */\n this.target = null;\n /**\n * When passed to an event handler, this will be the original DOM Event that was captured\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent\n * @member {MouseEvent|TouchEvent|PointerEvent}\n */\n this.originalEvent = null;\n /**\n * Unique identifier for this interaction\n *\n * @member {number}\n */\n this.identifier = null;\n /**\n * Indicates whether or not the pointer device that created the event is the primary pointer.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/isPrimary\n * @type {Boolean}\n */\n this.isPrimary = false;\n /**\n * Indicates which button was pressed on the mouse or pointer device to trigger the event.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\n * @type {number}\n */\n this.button = 0;\n /**\n * Indicates which buttons are pressed on the mouse or pointer device when the event is triggered.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons\n * @type {number}\n */\n this.buttons = 0;\n /**\n * The width of the pointer's contact along the x-axis, measured in CSS pixels.\n * radiusX of TouchEvents will be represented by this value.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/width\n * @type {number}\n */\n this.width = 0;\n /**\n * The height of the pointer's contact along the y-axis, measured in CSS pixels.\n * radiusY of TouchEvents will be represented by this value.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/height\n * @type {number}\n */\n this.height = 0;\n /**\n * The angle, in degrees, between the pointer device and the screen.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltX\n * @type {number}\n */\n this.tiltX = 0;\n /**\n * The angle, in degrees, between the pointer device and the screen.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/tiltY\n * @type {number}\n */\n this.tiltY = 0;\n /**\n * The type of pointer that triggered the event.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerType\n * @type {string}\n */\n this.pointerType = null;\n /**\n * Pressure applied by the pointing device during the event. A Touch's force property\n * will be represented by this value.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure\n * @type {number}\n */\n this.pressure = 0;\n /**\n * From TouchEvents (not PointerEvents triggered by touches), the rotationAngle of the Touch.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Touch/rotationAngle\n * @type {number}\n */\n this.rotationAngle = 0;\n /**\n * Twist of a stylus pointer.\n * @see https://w3c.github.io/pointerevents/#pointerevent-interface\n * @type {number}\n */\n this.twist = 0;\n /**\n * Barrel pressure on a stylus pointer.\n * @see https://w3c.github.io/pointerevents/#pointerevent-interface\n * @type {number}\n */\n this.tangentialPressure = 0;\n }\n Object.defineProperty(InteractionData.prototype, \"pointerId\", {\n /**\n * The unique identifier of the pointer. It will be the same as `identifier`.\n * @readonly\n * @member {number}\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerId\n */\n get: function () {\n return this.identifier;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * This will return the local coordinates of the specified displayObject for this InteractionData\n *\n * @param {PIXI.DisplayObject} displayObject - The DisplayObject that you would like the local\n * coords off\n * @param {PIXI.Point} [point] - A Point object in which to store the value, optional (otherwise\n * will create a new point)\n * @param {PIXI.Point} [globalPos] - A Point object containing your custom global coords, optional\n * (otherwise will use the current global coords)\n * @return {PIXI.Point} A point containing the coordinates of the InteractionData position relative\n * to the DisplayObject\n */\n InteractionData.prototype.getLocalPosition = function (displayObject, point, globalPos) {\n return displayObject.worldTransform.applyInverse(globalPos || this.global, point);\n };\n /**\n * Copies properties from normalized event data.\n *\n * @param {Touch|MouseEvent|PointerEvent} event - The normalized event data\n */\n InteractionData.prototype.copyEvent = function (event) {\n // isPrimary should only change on touchstart/pointerdown, so we don't want to overwrite\n // it with \"false\" on later events when our shim for it on touch events might not be\n // accurate\n if ('isPrimary' in event && event.isPrimary) {\n this.isPrimary = true;\n }\n this.button = 'button' in event && event.button;\n // event.buttons is not available in all browsers (ie. Safari), but it does have a non-standard\n // event.which property instead, which conveys the same information.\n var buttons = 'buttons' in event && event.buttons;\n this.buttons = Number.isInteger(buttons) ? buttons : 'which' in event && event.which;\n this.width = 'width' in event && event.width;\n this.height = 'height' in event && event.height;\n this.tiltX = 'tiltX' in event && event.tiltX;\n this.tiltY = 'tiltY' in event && event.tiltY;\n this.pointerType = 'pointerType' in event && event.pointerType;\n this.pressure = 'pressure' in event && event.pressure;\n this.rotationAngle = 'rotationAngle' in event && event.rotationAngle;\n this.twist = ('twist' in event && event.twist) || 0;\n this.tangentialPressure = ('tangentialPressure' in event && event.tangentialPressure) || 0;\n };\n /**\n * Resets the data for pooling.\n */\n InteractionData.prototype.reset = function () {\n // isPrimary is the only property that we really need to reset - everything else is\n // guaranteed to be overwritten\n this.isPrimary = false;\n };\n return InteractionData;\n}());\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * Event class that mimics native DOM events.\n *\n * @class\n * @memberof PIXI\n */\nvar InteractionEvent = /** @class */ (function () {\n function InteractionEvent() {\n /**\n * Whether this event will continue propagating in the tree.\n *\n * Remaining events for the {@link stopsPropagatingAt} object\n * will still be dispatched.\n *\n * @member {boolean}\n */\n this.stopped = false;\n /**\n * At which object this event stops propagating.\n *\n * @private\n * @member {PIXI.DisplayObject}\n */\n this.stopsPropagatingAt = null;\n /**\n * Whether we already reached the element we want to\n * stop propagating at. This is important for delayed events,\n * where we start over deeper in the tree again.\n *\n * @private\n * @member {boolean}\n */\n this.stopPropagationHint = false;\n /**\n * The object which caused this event to be dispatched.\n * For listener callback see {@link PIXI.InteractionEvent.currentTarget}.\n *\n * @member {PIXI.DisplayObject}\n */\n this.target = null;\n /**\n * The object whose event listener’s callback is currently being invoked.\n *\n * @member {PIXI.DisplayObject}\n */\n this.currentTarget = null;\n /**\n * Type of the event\n *\n * @member {string}\n */\n this.type = null;\n /**\n * InteractionData related to this event\n *\n * @member {PIXI.InteractionData}\n */\n this.data = null;\n }\n /**\n * Prevents event from reaching any objects other than the current object.\n *\n */\n InteractionEvent.prototype.stopPropagation = function () {\n this.stopped = true;\n this.stopPropagationHint = true;\n this.stopsPropagatingAt = this.currentTarget;\n };\n /**\n * Resets the event.\n */\n InteractionEvent.prototype.reset = function () {\n this.stopped = false;\n this.stopsPropagatingAt = null;\n this.stopPropagationHint = false;\n this.currentTarget = null;\n this.target = null;\n };\n return InteractionEvent;\n}());\n\n/**\n * DisplayObjects with the {@link PIXI.interactiveTarget} mixin use this class to track interactions\n *\n * @class\n * @private\n * @memberof PIXI\n */\nvar InteractionTrackingData = /** @class */ (function () {\n /**\n * @param {number} pointerId - Unique pointer id of the event\n * @private\n */\n function InteractionTrackingData(pointerId) {\n this._pointerId = pointerId;\n this._flags = InteractionTrackingData.FLAGS.NONE;\n }\n /**\n *\n * @private\n * @param {number} flag - The interaction flag to set\n * @param {boolean} yn - Should the flag be set or unset\n */\n InteractionTrackingData.prototype._doSet = function (flag, yn) {\n if (yn) {\n this._flags = this._flags | flag;\n }\n else {\n this._flags = this._flags & (~flag);\n }\n };\n Object.defineProperty(InteractionTrackingData.prototype, \"pointerId\", {\n /**\n * Unique pointer id of the event\n *\n * @readonly\n * @private\n * @member {number}\n */\n get: function () {\n return this._pointerId;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionTrackingData.prototype, \"flags\", {\n /**\n * State of the tracking data, expressed as bit flags\n *\n * @private\n * @member {number}\n */\n get: function () {\n return this._flags;\n },\n set: function (flags) {\n this._flags = flags;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionTrackingData.prototype, \"none\", {\n /**\n * Is the tracked event inactive (not over or down)?\n *\n * @private\n * @member {number}\n */\n get: function () {\n return this._flags === InteractionTrackingData.FLAGS.NONE;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionTrackingData.prototype, \"over\", {\n /**\n * Is the tracked event over the DisplayObject?\n *\n * @private\n * @member {boolean}\n */\n get: function () {\n return (this._flags & InteractionTrackingData.FLAGS.OVER) !== 0;\n },\n set: function (yn) {\n this._doSet(InteractionTrackingData.FLAGS.OVER, yn);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionTrackingData.prototype, \"rightDown\", {\n /**\n * Did the right mouse button come down in the DisplayObject?\n *\n * @private\n * @member {boolean}\n */\n get: function () {\n return (this._flags & InteractionTrackingData.FLAGS.RIGHT_DOWN) !== 0;\n },\n set: function (yn) {\n this._doSet(InteractionTrackingData.FLAGS.RIGHT_DOWN, yn);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionTrackingData.prototype, \"leftDown\", {\n /**\n * Did the left mouse button come down in the DisplayObject?\n *\n * @private\n * @member {boolean}\n */\n get: function () {\n return (this._flags & InteractionTrackingData.FLAGS.LEFT_DOWN) !== 0;\n },\n set: function (yn) {\n this._doSet(InteractionTrackingData.FLAGS.LEFT_DOWN, yn);\n },\n enumerable: false,\n configurable: true\n });\n InteractionTrackingData.FLAGS = Object.freeze({\n NONE: 0,\n OVER: 1 << 0,\n LEFT_DOWN: 1 << 1,\n RIGHT_DOWN: 1 << 2,\n });\n return InteractionTrackingData;\n}());\n\n/**\n * Strategy how to search through stage tree for interactive objects\n *\n * @private\n * @class\n * @memberof PIXI\n */\nvar TreeSearch = /** @class */ (function () {\n function TreeSearch() {\n this._tempPoint = new Point();\n }\n /**\n * Recursive implementation for findHit\n *\n * @private\n * @param {PIXI.InteractionEvent} interactionEvent - event containing the point that\n * is tested for collision\n * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - the displayObject\n * that will be hit test (recursively crawls its children)\n * @param {Function} [func] - the function that will be called on each interactive object. The\n * interactionEvent, displayObject and hit will be passed to the function\n * @param {boolean} [hitTest] - this indicates if the objects inside should be hit test against the point\n * @param {boolean} [interactive] - Whether the displayObject is interactive\n * @return {boolean} returns true if the displayObject hit the point\n */\n TreeSearch.prototype.recursiveFindHit = function (interactionEvent, displayObject, func, hitTest, interactive) {\n if (!displayObject || !displayObject.visible) {\n return false;\n }\n var point = interactionEvent.data.global;\n // Took a little while to rework this function correctly! But now it is done and nice and optimized! ^_^\n //\n // This function will now loop through all objects and then only hit test the objects it HAS\n // to, not all of them. MUCH faster..\n // An object will be hit test if the following is true:\n //\n // 1: It is interactive.\n // 2: It belongs to a parent that is interactive AND one of the parents children have not already been hit.\n //\n // As another little optimization once an interactive object has been hit we can carry on\n // through the scenegraph, but we know that there will be no more hits! So we can avoid extra hit tests\n // A final optimization is that an object is not hit test directly if a child has already been hit.\n interactive = displayObject.interactive || interactive;\n var hit = false;\n var interactiveParent = interactive;\n // Flag here can set to false if the event is outside the parents hitArea or mask\n var hitTestChildren = true;\n // If there is a hitArea, no need to test against anything else if the pointer is not within the hitArea\n // There is also no longer a need to hitTest children.\n if (displayObject.hitArea) {\n if (hitTest) {\n displayObject.worldTransform.applyInverse(point, this._tempPoint);\n if (!displayObject.hitArea.contains(this._tempPoint.x, this._tempPoint.y)) {\n hitTest = false;\n hitTestChildren = false;\n }\n else {\n hit = true;\n }\n }\n interactiveParent = false;\n }\n // If there is a mask, no need to hitTest against anything else if the pointer is not within the mask.\n // We still want to hitTestChildren, however, to ensure a mouseout can still be generated.\n // https://github.com/pixijs/pixi.js/issues/5135\n else if (displayObject._mask) {\n if (hitTest) {\n if (!(displayObject._mask.containsPoint && displayObject._mask.containsPoint(point))) {\n hitTest = false;\n }\n }\n }\n // ** FREE TIP **! If an object is not interactive or has no buttons in it\n // (such as a game scene!) set interactiveChildren to false for that displayObject.\n // This will allow PixiJS to completely ignore and bypass checking the displayObjects children.\n if (hitTestChildren && displayObject.interactiveChildren && displayObject.children) {\n var children = displayObject.children;\n for (var i = children.length - 1; i >= 0; i--) {\n var child = children[i];\n // time to get recursive.. if this function will return if something is hit..\n var childHit = this.recursiveFindHit(interactionEvent, child, func, hitTest, interactiveParent);\n if (childHit) {\n // its a good idea to check if a child has lost its parent.\n // this means it has been removed whilst looping so its best\n if (!child.parent) {\n continue;\n }\n // we no longer need to hit test any more objects in this container as we we\n // now know the parent has been hit\n interactiveParent = false;\n // If the child is interactive , that means that the object hit was actually\n // interactive and not just the child of an interactive object.\n // This means we no longer need to hit test anything else. We still need to run\n // through all objects, but we don't need to perform any hit tests.\n if (childHit) {\n if (interactionEvent.target) {\n hitTest = false;\n }\n hit = true;\n }\n }\n }\n }\n // no point running this if the item is not interactive or does not have an interactive parent.\n if (interactive) {\n // if we are hit testing (as in we have no hit any objects yet)\n // We also don't need to worry about hit testing if once of the displayObjects children\n // has already been hit - but only if it was interactive, otherwise we need to keep\n // looking for an interactive child, just in case we hit one\n if (hitTest && !interactionEvent.target) {\n // already tested against hitArea if it is defined\n if (!displayObject.hitArea && displayObject.containsPoint) {\n if (displayObject.containsPoint(point)) {\n hit = true;\n }\n }\n }\n if (displayObject.interactive) {\n if (hit && !interactionEvent.target) {\n interactionEvent.target = displayObject;\n }\n if (func) {\n func(interactionEvent, displayObject, !!hit);\n }\n }\n }\n return hit;\n };\n /**\n * This function is provides a neat way of crawling through the scene graph and running a\n * specified function on all interactive objects it finds. It will also take care of hit\n * testing the interactive objects and passes the hit across in the function.\n *\n * @private\n * @param {PIXI.InteractionEvent} interactionEvent - event containing the point that\n * is tested for collision\n * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - the displayObject\n * that will be hit test (recursively crawls its children)\n * @param {Function} [func] - the function that will be called on each interactive object. The\n * interactionEvent, displayObject and hit will be passed to the function\n * @param {boolean} [hitTest] - this indicates if the objects inside should be hit test against the point\n * @return {boolean} returns true if the displayObject hit the point\n */\n TreeSearch.prototype.findHit = function (interactionEvent, displayObject, func, hitTest) {\n this.recursiveFindHit(interactionEvent, displayObject, func, hitTest, false);\n };\n return TreeSearch;\n}());\n\n/**\n * Interface for classes that represent a hit area.\n *\n * It is implemented by the following classes:\n * - {@link PIXI.Circle}\n * - {@link PIXI.Ellipse}\n * - {@link PIXI.Polygon}\n * - {@link PIXI.RoundedRectangle}\n *\n * @interface IHitArea\n * @memberof PIXI\n */\n/**\n * Checks whether the x and y coordinates given are contained within this area\n *\n * @method\n * @name contains\n * @memberof PIXI.IHitArea#\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this area\n */\n/**\n * Default property values of interactive objects\n * Used by {@link PIXI.InteractionManager} to automatically give all DisplayObjects these properties\n *\n * @private\n * @name interactiveTarget\n * @type {Object}\n * @memberof PIXI\n * @example\n * function MyObject() {}\n *\n * Object.assign(\n * DisplayObject.prototype,\n * PIXI.interactiveTarget\n * );\n */\nvar interactiveTarget = {\n /**\n * Enable interaction events for the DisplayObject. Touch, pointer and mouse\n * events will not be emitted unless `interactive` is set to `true`.\n *\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.interactive = true;\n * sprite.on('tap', (event) => {\n * //handle event\n * });\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n interactive: false,\n /**\n * Determines if the children to the displayObject can be clicked/touched\n * Setting this to false allows PixiJS to bypass a recursive `hitTest` function\n *\n * @member {boolean}\n * @memberof PIXI.Container#\n */\n interactiveChildren: true,\n /**\n * Interaction shape. Children will be hit first, then this shape will be checked.\n * Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.\n *\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.interactive = true;\n * sprite.hitArea = new PIXI.Rectangle(0, 0, 100, 100);\n * @member {PIXI.IHitArea}\n * @memberof PIXI.DisplayObject#\n */\n hitArea: null,\n /**\n * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive\n * Setting this changes the 'cursor' property to `'pointer'`.\n *\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.interactive = true;\n * sprite.buttonMode = true;\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n get buttonMode() {\n return this.cursor === 'pointer';\n },\n set buttonMode(value) {\n if (value) {\n this.cursor = 'pointer';\n }\n else if (this.cursor === 'pointer') {\n this.cursor = null;\n }\n },\n /**\n * This defines what cursor mode is used when the mouse cursor\n * is hovered over the displayObject.\n *\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.interactive = true;\n * sprite.cursor = 'wait';\n * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor\n *\n * @member {string}\n * @memberof PIXI.DisplayObject#\n */\n cursor: null,\n /**\n * Internal set of all active pointers, by identifier\n *\n * @member {Map}\n * @memberof PIXI.DisplayObject#\n * @private\n */\n get trackedPointers() {\n if (this._trackedPointers === undefined)\n { this._trackedPointers = {}; }\n return this._trackedPointers;\n },\n /**\n * Map of all tracked pointers, by identifier. Use trackedPointers to access.\n *\n * @private\n * @type {Map}\n */\n _trackedPointers: undefined,\n};\n\n// Mix interactiveTarget into DisplayObject.prototype,\n// after deprecation has been handled\nDisplayObject.mixin(interactiveTarget);\nvar MOUSE_POINTER_ID = 1;\n// helpers for hitTest() - only used inside hitTest()\nvar hitTestEvent = {\n target: null,\n data: {\n global: null,\n },\n};\n/**\n * The interaction manager deals with mouse, touch and pointer events.\n *\n * Any DisplayObject can be interactive if its `interactive` property is set to true.\n *\n * This manager also supports multitouch.\n *\n * An instance of this class is automatically created by default, and can be found at `renderer.plugins.interaction`\n *\n * @class\n * @extends PIXI.utils.EventEmitter\n * @memberof PIXI\n */\nvar InteractionManager = /** @class */ (function (_super) {\n __extends(InteractionManager, _super);\n /**\n * @param {PIXI.CanvasRenderer|PIXI.Renderer} renderer - A reference to the current renderer\n * @param {object} [options] - The options for the manager.\n * @param {boolean} [options.autoPreventDefault=true] - Should the manager automatically prevent default browser actions.\n * @param {number} [options.interactionFrequency=10] - Maximum requency (ms) at pointer over/out states will be checked.\n * @param {number} [options.useSystemTicker=true] - Whether to add {@link tickerUpdate} to {@link PIXI.Ticker.system}.\n */\n function InteractionManager(renderer, options) {\n var _this = _super.call(this) || this;\n options = options || {};\n /**\n * The renderer this interaction manager works for.\n *\n * @member {PIXI.AbstractRenderer}\n */\n _this.renderer = renderer;\n /**\n * Should default browser actions automatically be prevented.\n * Does not apply to pointer events for backwards compatibility\n * preventDefault on pointer events stops mouse events from firing\n * Thus, for every pointer event, there will always be either a mouse of touch event alongside it.\n *\n * @member {boolean}\n * @default true\n */\n _this.autoPreventDefault = options.autoPreventDefault !== undefined ? options.autoPreventDefault : true;\n /**\n * Maximum requency in milliseconds at which pointer over/out states will be checked by {@link tickerUpdate}.\n *\n * @member {number}\n * @default 10\n */\n _this.interactionFrequency = options.interactionFrequency || 10;\n /**\n * The mouse data\n *\n * @member {PIXI.InteractionData}\n */\n _this.mouse = new InteractionData();\n _this.mouse.identifier = MOUSE_POINTER_ID;\n // setting the mouse to start off far off screen will mean that mouse over does\n // not get called before we even move the mouse.\n _this.mouse.global.set(-999999);\n /**\n * Actively tracked InteractionData\n *\n * @private\n * @member {Object.}\n */\n _this.activeInteractionData = {};\n _this.activeInteractionData[MOUSE_POINTER_ID] = _this.mouse;\n /**\n * Pool of unused InteractionData\n *\n * @private\n * @member {PIXI.InteractionData[]}\n */\n _this.interactionDataPool = [];\n /**\n * An event data object to handle all the event tracking/dispatching\n *\n * @member {object}\n */\n _this.eventData = new InteractionEvent();\n /**\n * The DOM element to bind to.\n *\n * @protected\n * @member {HTMLElement}\n */\n _this.interactionDOMElement = null;\n /**\n * This property determines if mousemove and touchmove events are fired only when the cursor\n * is over the object.\n * Setting to true will make things work more in line with how the DOM version works.\n * Setting to false can make things easier for things like dragging\n * It is currently set to false as this is how PixiJS used to work. This will be set to true in\n * future versions of pixi.\n *\n * @member {boolean}\n * @default false\n */\n _this.moveWhenInside = false;\n /**\n * Have events been attached to the dom element?\n *\n * @protected\n * @member {boolean}\n */\n _this.eventsAdded = false;\n /**\n * Has the system ticker been added?\n *\n * @protected\n * @member {boolean}\n */\n _this.tickerAdded = false;\n /**\n * Is the mouse hovering over the renderer?\n *\n * @protected\n * @member {boolean}\n */\n _this.mouseOverRenderer = false;\n /**\n * Does the device support touch events\n * https://www.w3.org/TR/touch-events/\n *\n * @readonly\n * @member {boolean}\n */\n _this.supportsTouchEvents = 'ontouchstart' in window;\n /**\n * Does the device support pointer events\n * https://www.w3.org/Submission/pointer-events/\n *\n * @readonly\n * @member {boolean}\n */\n _this.supportsPointerEvents = !!window.PointerEvent;\n // this will make it so that you don't have to call bind all the time\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerUp = _this.onPointerUp.bind(_this);\n _this.processPointerUp = _this.processPointerUp.bind(_this);\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerCancel = _this.onPointerCancel.bind(_this);\n _this.processPointerCancel = _this.processPointerCancel.bind(_this);\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerDown = _this.onPointerDown.bind(_this);\n _this.processPointerDown = _this.processPointerDown.bind(_this);\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerMove = _this.onPointerMove.bind(_this);\n _this.processPointerMove = _this.processPointerMove.bind(_this);\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerOut = _this.onPointerOut.bind(_this);\n _this.processPointerOverOut = _this.processPointerOverOut.bind(_this);\n /**\n * @private\n * @member {Function}\n */\n _this.onPointerOver = _this.onPointerOver.bind(_this);\n /**\n * Dictionary of how different cursor modes are handled. Strings are handled as CSS cursor\n * values, objects are handled as dictionaries of CSS values for interactionDOMElement,\n * and functions are called instead of changing the CSS.\n * Default CSS cursor values are provided for 'default' and 'pointer' modes.\n * @member {Object.}\n */\n _this.cursorStyles = {\n default: 'inherit',\n pointer: 'pointer',\n };\n /**\n * The mode of the cursor that is being used.\n * The value of this is a key from the cursorStyles dictionary.\n *\n * @member {string}\n */\n _this.currentCursorMode = null;\n /**\n * Internal cached let.\n *\n * @private\n * @member {string}\n */\n _this.cursor = null;\n /**\n * The current resolution / device pixel ratio.\n *\n * @member {number}\n * @default 1\n */\n _this.resolution = 1;\n /**\n * Delayed pointer events. Used to guarantee correct ordering of over/out events.\n *\n * @private\n * @member {Array}\n */\n _this.delayedEvents = [];\n /**\n * TreeSearch component that is used to hitTest stage tree\n *\n * @private\n * @member {PIXI.TreeSearch}\n */\n _this.search = new TreeSearch();\n /**\n * Used as a last rendered object in case renderer doesnt have _lastObjectRendered\n * @member {DisplayObject}\n * @private\n */\n _this._tempDisplayObject = new TemporaryDisplayObject();\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed on the display\n * object.\n *\n * @event PIXI.InteractionManager#mousedown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * on the display object.\n *\n * @event PIXI.InteractionManager#rightdown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released over the display\n * object.\n *\n * @event PIXI.InteractionManager#mouseup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * over the display object.\n *\n * @event PIXI.InteractionManager#rightup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed and released on\n * the display object.\n *\n * @event PIXI.InteractionManager#click\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * and released on the display object.\n *\n * @event PIXI.InteractionManager#rightclick\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released outside the\n * display object that initially registered a\n * [mousedown]{@link PIXI.InteractionManager#event:mousedown}.\n *\n * @event PIXI.InteractionManager#mouseupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * outside the display object that initially registered a\n * [rightdown]{@link PIXI.InteractionManager#event:rightdown}.\n *\n * @event PIXI.InteractionManager#rightupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved while over the display object\n *\n * @event PIXI.InteractionManager#mousemove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved onto the display object\n *\n * @event PIXI.InteractionManager#mouseover\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved off the display object\n *\n * @event PIXI.InteractionManager#mouseout\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is pressed on the display object.\n *\n * @event PIXI.InteractionManager#pointerdown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is released over the display object.\n * Not always fired when some buttons are held down while others are released. In those cases,\n * use [mousedown]{@link PIXI.InteractionManager#event:mousedown} and\n * [mouseup]{@link PIXI.InteractionManager#event:mouseup} instead.\n *\n * @event PIXI.InteractionManager#pointerup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when the operating system cancels a pointer event\n *\n * @event PIXI.InteractionManager#pointercancel\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is pressed and released on the display object.\n *\n * @event PIXI.InteractionManager#pointertap\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is released outside the display object that initially\n * registered a [pointerdown]{@link PIXI.InteractionManager#event:pointerdown}.\n *\n * @event PIXI.InteractionManager#pointerupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved while over the display object\n *\n * @event PIXI.InteractionManager#pointermove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved onto the display object\n *\n * @event PIXI.InteractionManager#pointerover\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved off the display object\n *\n * @event PIXI.InteractionManager#pointerout\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is placed on the display object.\n *\n * @event PIXI.InteractionManager#touchstart\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is removed from the display object.\n *\n * @event PIXI.InteractionManager#touchend\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when the operating system cancels a touch\n *\n * @event PIXI.InteractionManager#touchcancel\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is placed and removed from the display object.\n *\n * @event PIXI.InteractionManager#tap\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is removed outside of the display object that initially\n * registered a [touchstart]{@link PIXI.InteractionManager#event:touchstart}.\n *\n * @event PIXI.InteractionManager#touchendoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is moved along the display object.\n *\n * @event PIXI.InteractionManager#touchmove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed on the display.\n * object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mousedown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * on the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#rightdown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released over the display\n * object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mouseup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * over the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#rightup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed and released on\n * the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#click\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * and released on the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#rightclick\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released outside the\n * display object that initially registered a\n * [mousedown]{@link PIXI.DisplayObject#event:mousedown}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mouseupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * outside the display object that initially registered a\n * [rightdown]{@link PIXI.DisplayObject#event:rightdown}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#rightupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved while over the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mousemove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved onto the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mouseover\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved off the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#mouseout\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is pressed on the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointerdown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is released over the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointerup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when the operating system cancels a pointer event.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointercancel\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is pressed and released on the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointertap\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is released outside the display object that initially\n * registered a [pointerdown]{@link PIXI.DisplayObject#event:pointerdown}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointerupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved while over the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointermove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved onto the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointerover\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved off the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#pointerout\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is placed on the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#touchstart\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is removed from the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#touchend\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when the operating system cancels a touch.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#touchcancel\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is placed and removed from the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#tap\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is removed outside of the display object that initially\n * registered a [touchstart]{@link PIXI.DisplayObject#event:touchstart}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#touchendoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is moved along the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * @event PIXI.DisplayObject#touchmove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n _this._useSystemTicker = options.useSystemTicker !== undefined ? options.useSystemTicker : true;\n _this.setTargetElement(_this.renderer.view, _this.renderer.resolution);\n return _this;\n }\n Object.defineProperty(InteractionManager.prototype, \"useSystemTicker\", {\n /**\n * Should the InteractionManager automatically add {@link tickerUpdate} to {@link PIXI.Ticker.system}.\n *\n * @member {boolean}\n * @default true\n */\n get: function () {\n return this._useSystemTicker;\n },\n set: function (useSystemTicker) {\n this._useSystemTicker = useSystemTicker;\n if (useSystemTicker) {\n this.addTickerListener();\n }\n else {\n this.removeTickerListener();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionManager.prototype, \"lastObjectRendered\", {\n /**\n * Last rendered object or temp object\n * @readonly\n * @protected\n * @member {PIXI.DisplayObject}\n */\n get: function () {\n return this.renderer._lastObjectRendered || this._tempDisplayObject;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Hit tests a point against the display tree, returning the first interactive object that is hit.\n *\n * @param {PIXI.Point} globalPoint - A point to hit test with, in global space.\n * @param {PIXI.Container} [root] - The root display object to start from. If omitted, defaults\n * to the last rendered root of the associated renderer.\n * @return {PIXI.DisplayObject} The hit display object, if any.\n */\n InteractionManager.prototype.hitTest = function (globalPoint, root) {\n // clear the target for our hit test\n hitTestEvent.target = null;\n // assign the global point\n hitTestEvent.data.global = globalPoint;\n // ensure safety of the root\n if (!root) {\n root = this.lastObjectRendered;\n }\n // run the hit test\n this.processInteractive(hitTestEvent, root, null, true);\n // return our found object - it'll be null if we didn't hit anything\n return hitTestEvent.target;\n };\n /**\n * Sets the DOM element which will receive mouse/touch events. This is useful for when you have\n * other DOM elements on top of the renderers Canvas element. With this you'll be bale to delegate\n * another DOM element to receive those events.\n *\n * @param {HTMLElement} element - the DOM element which will receive mouse and touch events.\n * @param {number} [resolution=1] - The resolution / device pixel ratio of the new element (relative to the canvas).\n */\n InteractionManager.prototype.setTargetElement = function (element, resolution) {\n if (resolution === void 0) { resolution = 1; }\n this.removeTickerListener();\n this.removeEvents();\n this.interactionDOMElement = element;\n this.resolution = resolution;\n this.addEvents();\n this.addTickerListener();\n };\n /**\n * Add the ticker listener\n *\n * @private\n */\n InteractionManager.prototype.addTickerListener = function () {\n if (this.tickerAdded || !this.interactionDOMElement || !this._useSystemTicker) {\n return;\n }\n Ticker.system.add(this.tickerUpdate, this, UPDATE_PRIORITY.INTERACTION);\n this.tickerAdded = true;\n };\n /**\n * Remove the ticker listener\n *\n * @private\n */\n InteractionManager.prototype.removeTickerListener = function () {\n if (!this.tickerAdded) {\n return;\n }\n Ticker.system.remove(this.tickerUpdate, this);\n this.tickerAdded = false;\n };\n /**\n * Registers all the DOM events\n *\n * @private\n */\n InteractionManager.prototype.addEvents = function () {\n if (this.eventsAdded || !this.interactionDOMElement) {\n return;\n }\n var style = this.interactionDOMElement.style;\n if (window.navigator.msPointerEnabled) {\n style.msContentZooming = 'none';\n style.msTouchAction = 'none';\n }\n else if (this.supportsPointerEvents) {\n style.touchAction = 'none';\n }\n /**\n * These events are added first, so that if pointer events are normalized, they are fired\n * in the same order as non-normalized events. ie. pointer event 1st, mouse / touch 2nd\n */\n if (this.supportsPointerEvents) {\n window.document.addEventListener('pointermove', this.onPointerMove, true);\n this.interactionDOMElement.addEventListener('pointerdown', this.onPointerDown, true);\n // pointerout is fired in addition to pointerup (for touch events) and pointercancel\n // we already handle those, so for the purposes of what we do in onPointerOut, we only\n // care about the pointerleave event\n this.interactionDOMElement.addEventListener('pointerleave', this.onPointerOut, true);\n this.interactionDOMElement.addEventListener('pointerover', this.onPointerOver, true);\n window.addEventListener('pointercancel', this.onPointerCancel, true);\n window.addEventListener('pointerup', this.onPointerUp, true);\n }\n else {\n window.document.addEventListener('mousemove', this.onPointerMove, true);\n this.interactionDOMElement.addEventListener('mousedown', this.onPointerDown, true);\n this.interactionDOMElement.addEventListener('mouseout', this.onPointerOut, true);\n this.interactionDOMElement.addEventListener('mouseover', this.onPointerOver, true);\n window.addEventListener('mouseup', this.onPointerUp, true);\n }\n // always look directly for touch events so that we can provide original data\n // In a future version we should change this to being just a fallback and rely solely on\n // PointerEvents whenever available\n if (this.supportsTouchEvents) {\n this.interactionDOMElement.addEventListener('touchstart', this.onPointerDown, true);\n this.interactionDOMElement.addEventListener('touchcancel', this.onPointerCancel, true);\n this.interactionDOMElement.addEventListener('touchend', this.onPointerUp, true);\n this.interactionDOMElement.addEventListener('touchmove', this.onPointerMove, true);\n }\n this.eventsAdded = true;\n };\n /**\n * Removes all the DOM events that were previously registered\n *\n * @private\n */\n InteractionManager.prototype.removeEvents = function () {\n if (!this.eventsAdded || !this.interactionDOMElement) {\n return;\n }\n var style = this.interactionDOMElement.style;\n if (window.navigator.msPointerEnabled) {\n style.msContentZooming = '';\n style.msTouchAction = '';\n }\n else if (this.supportsPointerEvents) {\n style.touchAction = '';\n }\n if (this.supportsPointerEvents) {\n window.document.removeEventListener('pointermove', this.onPointerMove, true);\n this.interactionDOMElement.removeEventListener('pointerdown', this.onPointerDown, true);\n this.interactionDOMElement.removeEventListener('pointerleave', this.onPointerOut, true);\n this.interactionDOMElement.removeEventListener('pointerover', this.onPointerOver, true);\n window.removeEventListener('pointercancel', this.onPointerCancel, true);\n window.removeEventListener('pointerup', this.onPointerUp, true);\n }\n else {\n window.document.removeEventListener('mousemove', this.onPointerMove, true);\n this.interactionDOMElement.removeEventListener('mousedown', this.onPointerDown, true);\n this.interactionDOMElement.removeEventListener('mouseout', this.onPointerOut, true);\n this.interactionDOMElement.removeEventListener('mouseover', this.onPointerOver, true);\n window.removeEventListener('mouseup', this.onPointerUp, true);\n }\n if (this.supportsTouchEvents) {\n this.interactionDOMElement.removeEventListener('touchstart', this.onPointerDown, true);\n this.interactionDOMElement.removeEventListener('touchcancel', this.onPointerCancel, true);\n this.interactionDOMElement.removeEventListener('touchend', this.onPointerUp, true);\n this.interactionDOMElement.removeEventListener('touchmove', this.onPointerMove, true);\n }\n this.interactionDOMElement = null;\n this.eventsAdded = false;\n };\n /**\n * Updates the state of interactive objects if at least {@link interactionFrequency}\n * milliseconds have passed since the last invocation.\n *\n * Invoked by a throttled ticker update from {@link PIXI.Ticker.system}.\n *\n * @param {number} deltaTime - time delta since the last call\n */\n InteractionManager.prototype.tickerUpdate = function (deltaTime) {\n this._deltaTime += deltaTime;\n if (this._deltaTime < this.interactionFrequency) {\n return;\n }\n this._deltaTime = 0;\n this.update();\n };\n /**\n * Updates the state of interactive objects.\n */\n InteractionManager.prototype.update = function () {\n if (!this.interactionDOMElement) {\n return;\n }\n // if the user move the mouse this check has already been done using the mouse move!\n if (this._didMove) {\n this._didMove = false;\n return;\n }\n this.cursor = null;\n // Resets the flag as set by a stopPropagation call. This flag is usually reset by a user interaction of any kind,\n // but there was a scenario of a display object moving under a static mouse cursor.\n // In this case, mouseover and mouseevents would not pass the flag test in dispatchEvent function\n for (var k in this.activeInteractionData) {\n // eslint-disable-next-line no-prototype-builtins\n if (this.activeInteractionData.hasOwnProperty(k)) {\n var interactionData = this.activeInteractionData[k];\n if (interactionData.originalEvent && interactionData.pointerType !== 'touch') {\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, interactionData.originalEvent, interactionData);\n this.processInteractive(interactionEvent, this.lastObjectRendered, this.processPointerOverOut, true);\n }\n }\n }\n this.setCursorMode(this.cursor);\n };\n /**\n * Sets the current cursor mode, handling any callbacks or CSS style changes.\n *\n * @param {string} mode - cursor mode, a key from the cursorStyles dictionary\n */\n InteractionManager.prototype.setCursorMode = function (mode) {\n mode = mode || 'default';\n // if the mode didn't actually change, bail early\n if (this.currentCursorMode === mode) {\n return;\n }\n this.currentCursorMode = mode;\n var style = this.cursorStyles[mode];\n // only do things if there is a cursor style for it\n if (style) {\n switch (typeof style) {\n case 'string':\n // string styles are handled as cursor CSS\n this.interactionDOMElement.style.cursor = style;\n break;\n case 'function':\n // functions are just called, and passed the cursor mode\n style(mode);\n break;\n case 'object':\n // if it is an object, assume that it is a dictionary of CSS styles,\n // apply it to the interactionDOMElement\n Object.assign(this.interactionDOMElement.style, style);\n break;\n }\n }\n else if (typeof mode === 'string' && !Object.prototype.hasOwnProperty.call(this.cursorStyles, mode)) {\n // if it mode is a string (not a Symbol) and cursorStyles doesn't have any entry\n // for the mode, then assume that the dev wants it to be CSS for the cursor.\n this.interactionDOMElement.style.cursor = mode;\n }\n };\n /**\n * Dispatches an event on the display object that was interacted with\n *\n * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - the display object in question\n * @param {string} eventString - the name of the event (e.g, mousedown)\n * @param {PIXI.InteractionEvent} eventData - the event data object\n * @private\n */\n InteractionManager.prototype.dispatchEvent = function (displayObject, eventString, eventData) {\n // Even if the event was stopped, at least dispatch any remaining events\n // for the same display object.\n if (!eventData.stopPropagationHint || displayObject === eventData.stopsPropagatingAt) {\n eventData.currentTarget = displayObject;\n eventData.type = eventString;\n displayObject.emit(eventString, eventData);\n if (displayObject[eventString]) {\n displayObject[eventString](eventData);\n }\n }\n };\n /**\n * Puts a event on a queue to be dispatched later. This is used to guarantee correct\n * ordering of over/out events.\n *\n * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - the display object in question\n * @param {string} eventString - the name of the event (e.g, mousedown)\n * @param {object} eventData - the event data object\n * @private\n */\n InteractionManager.prototype.delayDispatchEvent = function (displayObject, eventString, eventData) {\n this.delayedEvents.push({ displayObject: displayObject, eventString: eventString, eventData: eventData });\n };\n /**\n * Maps x and y coords from a DOM object and maps them correctly to the PixiJS view. The\n * resulting value is stored in the point. This takes into account the fact that the DOM\n * element could be scaled and positioned anywhere on the screen.\n *\n * @param {PIXI.IPointData} point - the point that the result will be stored in\n * @param {number} x - the x coord of the position to map\n * @param {number} y - the y coord of the position to map\n */\n InteractionManager.prototype.mapPositionToPoint = function (point, x, y) {\n var rect;\n // IE 11 fix\n if (!this.interactionDOMElement.parentElement) {\n rect = { x: 0, y: 0, width: 0, height: 0 };\n }\n else {\n rect = this.interactionDOMElement.getBoundingClientRect();\n }\n var resolutionMultiplier = 1.0 / this.resolution;\n point.x = ((x - rect.left) * (this.interactionDOMElement.width / rect.width)) * resolutionMultiplier;\n point.y = ((y - rect.top) * (this.interactionDOMElement.height / rect.height)) * resolutionMultiplier;\n };\n /**\n * This function is provides a neat way of crawling through the scene graph and running a\n * specified function on all interactive objects it finds. It will also take care of hit\n * testing the interactive objects and passes the hit across in the function.\n *\n * @protected\n * @param {PIXI.InteractionEvent} interactionEvent - event containing the point that\n * is tested for collision\n * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - the displayObject\n * that will be hit test (recursively crawls its children)\n * @param {Function} [func] - the function that will be called on each interactive object. The\n * interactionEvent, displayObject and hit will be passed to the function\n * @param {boolean} [hitTest] - indicates whether we want to calculate hits\n * or just iterate through all interactive objects\n */\n InteractionManager.prototype.processInteractive = function (interactionEvent, displayObject, func, hitTest) {\n var hit = this.search.findHit(interactionEvent, displayObject, func, hitTest);\n var delayedEvents = this.delayedEvents;\n if (!delayedEvents.length) {\n return hit;\n }\n // Reset the propagation hint, because we start deeper in the tree again.\n interactionEvent.stopPropagationHint = false;\n var delayedLen = delayedEvents.length;\n this.delayedEvents = [];\n for (var i = 0; i < delayedLen; i++) {\n var _a = delayedEvents[i], displayObject_1 = _a.displayObject, eventString = _a.eventString, eventData = _a.eventData;\n // When we reach the object we wanted to stop propagating at,\n // set the propagation hint.\n if (eventData.stopsPropagatingAt === displayObject_1) {\n eventData.stopPropagationHint = true;\n }\n this.dispatchEvent(displayObject_1, eventString, eventData);\n }\n return hit;\n };\n /**\n * Is called when the pointer button is pressed down on the renderer element\n *\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer button being pressed down\n */\n InteractionManager.prototype.onPointerDown = function (originalEvent) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && originalEvent.pointerType === 'touch')\n { return; }\n var events = this.normalizeToPointerData(originalEvent);\n /**\n * No need to prevent default on natural pointer events, as there are no side effects\n * Normalized events, however, may have the double mousedown/touchstart issue on the native android browser,\n * so still need to be prevented.\n */\n // Guaranteed that there will be at least one event in events, and all events must have the same pointer type\n if (this.autoPreventDefault && events[0].isNormalized) {\n var cancelable = originalEvent.cancelable || !('cancelable' in originalEvent);\n if (cancelable) {\n originalEvent.preventDefault();\n }\n }\n var eventLen = events.length;\n for (var i = 0; i < eventLen; i++) {\n var event = events[i];\n var interactionData = this.getInteractionDataForPointerId(event);\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n interactionEvent.data.originalEvent = originalEvent;\n this.processInteractive(interactionEvent, this.lastObjectRendered, this.processPointerDown, true);\n this.emit('pointerdown', interactionEvent);\n if (event.pointerType === 'touch') {\n this.emit('touchstart', interactionEvent);\n }\n // emit a mouse event for \"pen\" pointers, the way a browser would emit a fallback event\n else if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n var isRightButton = event.button === 2;\n this.emit(isRightButton ? 'rightdown' : 'mousedown', this.eventData);\n }\n }\n };\n /**\n * Processes the result of the pointer down check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event\n * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n InteractionManager.prototype.processPointerDown = function (interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n var id = interactionEvent.data.identifier;\n if (hit) {\n if (!displayObject.trackedPointers[id]) {\n displayObject.trackedPointers[id] = new InteractionTrackingData(id);\n }\n this.dispatchEvent(displayObject, 'pointerdown', interactionEvent);\n if (data.pointerType === 'touch') {\n this.dispatchEvent(displayObject, 'touchstart', interactionEvent);\n }\n else if (data.pointerType === 'mouse' || data.pointerType === 'pen') {\n var isRightButton = data.button === 2;\n if (isRightButton) {\n displayObject.trackedPointers[id].rightDown = true;\n }\n else {\n displayObject.trackedPointers[id].leftDown = true;\n }\n this.dispatchEvent(displayObject, isRightButton ? 'rightdown' : 'mousedown', interactionEvent);\n }\n }\n };\n /**\n * Is called when the pointer button is released on the renderer element\n *\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer button being released\n * @param {boolean} cancelled - true if the pointer is cancelled\n * @param {Function} func - Function passed to {@link processInteractive}\n */\n InteractionManager.prototype.onPointerComplete = function (originalEvent, cancelled, func) {\n var events = this.normalizeToPointerData(originalEvent);\n var eventLen = events.length;\n // if the event wasn't targeting our canvas, then consider it to be pointerupoutside\n // in all cases (unless it was a pointercancel)\n var eventAppend = originalEvent.target !== this.interactionDOMElement ? 'outside' : '';\n for (var i = 0; i < eventLen; i++) {\n var event = events[i];\n var interactionData = this.getInteractionDataForPointerId(event);\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n interactionEvent.data.originalEvent = originalEvent;\n // perform hit testing for events targeting our canvas or cancel events\n this.processInteractive(interactionEvent, this.lastObjectRendered, func, cancelled || !eventAppend);\n this.emit(cancelled ? 'pointercancel' : \"pointerup\" + eventAppend, interactionEvent);\n if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n var isRightButton = event.button === 2;\n this.emit(isRightButton ? \"rightup\" + eventAppend : \"mouseup\" + eventAppend, interactionEvent);\n }\n else if (event.pointerType === 'touch') {\n this.emit(cancelled ? 'touchcancel' : \"touchend\" + eventAppend, interactionEvent);\n this.releaseInteractionDataForPointerId(event.pointerId);\n }\n }\n };\n /**\n * Is called when the pointer button is cancelled\n *\n * @private\n * @param {PointerEvent} event - The DOM event of a pointer button being released\n */\n InteractionManager.prototype.onPointerCancel = function (event) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && event.pointerType === 'touch')\n { return; }\n this.onPointerComplete(event, true, this.processPointerCancel);\n };\n /**\n * Processes the result of the pointer cancel check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event\n * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - The display object that was tested\n */\n InteractionManager.prototype.processPointerCancel = function (interactionEvent, displayObject) {\n var data = interactionEvent.data;\n var id = interactionEvent.data.identifier;\n if (displayObject.trackedPointers[id] !== undefined) {\n delete displayObject.trackedPointers[id];\n this.dispatchEvent(displayObject, 'pointercancel', interactionEvent);\n if (data.pointerType === 'touch') {\n this.dispatchEvent(displayObject, 'touchcancel', interactionEvent);\n }\n }\n };\n /**\n * Is called when the pointer button is released on the renderer element\n *\n * @private\n * @param {PointerEvent} event - The DOM event of a pointer button being released\n */\n InteractionManager.prototype.onPointerUp = function (event) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && event.pointerType === 'touch')\n { return; }\n this.onPointerComplete(event, false, this.processPointerUp);\n };\n /**\n * Processes the result of the pointer up check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event\n * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n InteractionManager.prototype.processPointerUp = function (interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n var id = interactionEvent.data.identifier;\n var trackingData = displayObject.trackedPointers[id];\n var isTouch = data.pointerType === 'touch';\n var isMouse = (data.pointerType === 'mouse' || data.pointerType === 'pen');\n // need to track mouse down status in the mouse block so that we can emit\n // event in a later block\n var isMouseTap = false;\n // Mouse only\n if (isMouse) {\n var isRightButton = data.button === 2;\n var flags = InteractionTrackingData.FLAGS;\n var test = isRightButton ? flags.RIGHT_DOWN : flags.LEFT_DOWN;\n var isDown = trackingData !== undefined && (trackingData.flags & test);\n if (hit) {\n this.dispatchEvent(displayObject, isRightButton ? 'rightup' : 'mouseup', interactionEvent);\n if (isDown) {\n this.dispatchEvent(displayObject, isRightButton ? 'rightclick' : 'click', interactionEvent);\n // because we can confirm that the mousedown happened on this object, flag for later emit of pointertap\n isMouseTap = true;\n }\n }\n else if (isDown) {\n this.dispatchEvent(displayObject, isRightButton ? 'rightupoutside' : 'mouseupoutside', interactionEvent);\n }\n // update the down state of the tracking data\n if (trackingData) {\n if (isRightButton) {\n trackingData.rightDown = false;\n }\n else {\n trackingData.leftDown = false;\n }\n }\n }\n // Pointers and Touches, and Mouse\n if (hit) {\n this.dispatchEvent(displayObject, 'pointerup', interactionEvent);\n if (isTouch)\n { this.dispatchEvent(displayObject, 'touchend', interactionEvent); }\n if (trackingData) {\n // emit pointertap if not a mouse, or if the mouse block decided it was a tap\n if (!isMouse || isMouseTap) {\n this.dispatchEvent(displayObject, 'pointertap', interactionEvent);\n }\n if (isTouch) {\n this.dispatchEvent(displayObject, 'tap', interactionEvent);\n // touches are no longer over (if they ever were) when we get the touchend\n // so we should ensure that we don't keep pretending that they are\n trackingData.over = false;\n }\n }\n }\n else if (trackingData) {\n this.dispatchEvent(displayObject, 'pointerupoutside', interactionEvent);\n if (isTouch)\n { this.dispatchEvent(displayObject, 'touchendoutside', interactionEvent); }\n }\n // Only remove the tracking data if there is no over/down state still associated with it\n if (trackingData && trackingData.none) {\n delete displayObject.trackedPointers[id];\n }\n };\n /**\n * Is called when the pointer moves across the renderer element\n *\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer moving\n */\n InteractionManager.prototype.onPointerMove = function (originalEvent) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && originalEvent.pointerType === 'touch')\n { return; }\n var events = this.normalizeToPointerData(originalEvent);\n if (events[0].pointerType === 'mouse' || events[0].pointerType === 'pen') {\n this._didMove = true;\n this.cursor = null;\n }\n var eventLen = events.length;\n for (var i = 0; i < eventLen; i++) {\n var event = events[i];\n var interactionData = this.getInteractionDataForPointerId(event);\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n interactionEvent.data.originalEvent = originalEvent;\n this.processInteractive(interactionEvent, this.lastObjectRendered, this.processPointerMove, true);\n this.emit('pointermove', interactionEvent);\n if (event.pointerType === 'touch')\n { this.emit('touchmove', interactionEvent); }\n if (event.pointerType === 'mouse' || event.pointerType === 'pen')\n { this.emit('mousemove', interactionEvent); }\n }\n if (events[0].pointerType === 'mouse') {\n this.setCursorMode(this.cursor);\n // TODO BUG for parents interactive object (border order issue)\n }\n };\n /**\n * Processes the result of the pointer move check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event\n * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n InteractionManager.prototype.processPointerMove = function (interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n var isTouch = data.pointerType === 'touch';\n var isMouse = (data.pointerType === 'mouse' || data.pointerType === 'pen');\n if (isMouse) {\n this.processPointerOverOut(interactionEvent, displayObject, hit);\n }\n if (!this.moveWhenInside || hit) {\n this.dispatchEvent(displayObject, 'pointermove', interactionEvent);\n if (isTouch)\n { this.dispatchEvent(displayObject, 'touchmove', interactionEvent); }\n if (isMouse)\n { this.dispatchEvent(displayObject, 'mousemove', interactionEvent); }\n }\n };\n /**\n * Is called when the pointer is moved out of the renderer element\n *\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer being moved out\n */\n InteractionManager.prototype.onPointerOut = function (originalEvent) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && originalEvent.pointerType === 'touch')\n { return; }\n var events = this.normalizeToPointerData(originalEvent);\n // Only mouse and pointer can call onPointerOut, so events will always be length 1\n var event = events[0];\n if (event.pointerType === 'mouse') {\n this.mouseOverRenderer = false;\n this.setCursorMode(null);\n }\n var interactionData = this.getInteractionDataForPointerId(event);\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n interactionEvent.data.originalEvent = event;\n this.processInteractive(interactionEvent, this.lastObjectRendered, this.processPointerOverOut, false);\n this.emit('pointerout', interactionEvent);\n if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n this.emit('mouseout', interactionEvent);\n }\n else {\n // we can get touchleave events after touchend, so we want to make sure we don't\n // introduce memory leaks\n this.releaseInteractionDataForPointerId(interactionData.identifier);\n }\n };\n /**\n * Processes the result of the pointer over/out check and dispatches the event if need be\n *\n * @private\n * @param {PIXI.InteractionEvent} interactionEvent - The interaction event wrapping the DOM event\n * @param {PIXI.Container|PIXI.Sprite|PIXI.TilingSprite} displayObject - The display object that was tested\n * @param {boolean} hit - the result of the hit test on the display object\n */\n InteractionManager.prototype.processPointerOverOut = function (interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n var id = interactionEvent.data.identifier;\n var isMouse = (data.pointerType === 'mouse' || data.pointerType === 'pen');\n var trackingData = displayObject.trackedPointers[id];\n // if we just moused over the display object, then we need to track that state\n if (hit && !trackingData) {\n trackingData = displayObject.trackedPointers[id] = new InteractionTrackingData(id);\n }\n if (trackingData === undefined)\n { return; }\n if (hit && this.mouseOverRenderer) {\n if (!trackingData.over) {\n trackingData.over = true;\n this.delayDispatchEvent(displayObject, 'pointerover', interactionEvent);\n if (isMouse) {\n this.delayDispatchEvent(displayObject, 'mouseover', interactionEvent);\n }\n }\n // only change the cursor if it has not already been changed (by something deeper in the\n // display tree)\n if (isMouse && this.cursor === null) {\n this.cursor = displayObject.cursor;\n }\n }\n else if (trackingData.over) {\n trackingData.over = false;\n this.dispatchEvent(displayObject, 'pointerout', this.eventData);\n if (isMouse) {\n this.dispatchEvent(displayObject, 'mouseout', interactionEvent);\n }\n // if there is no mouse down information for the pointer, then it is safe to delete\n if (trackingData.none) {\n delete displayObject.trackedPointers[id];\n }\n }\n };\n /**\n * Is called when the pointer is moved into the renderer element\n *\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer button being moved into the renderer view\n */\n InteractionManager.prototype.onPointerOver = function (originalEvent) {\n var events = this.normalizeToPointerData(originalEvent);\n // Only mouse and pointer can call onPointerOver, so events will always be length 1\n var event = events[0];\n var interactionData = this.getInteractionDataForPointerId(event);\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n interactionEvent.data.originalEvent = event;\n if (event.pointerType === 'mouse') {\n this.mouseOverRenderer = true;\n }\n this.emit('pointerover', interactionEvent);\n if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n this.emit('mouseover', interactionEvent);\n }\n };\n /**\n * Get InteractionData for a given pointerId. Store that data as well\n *\n * @private\n * @param {PointerEvent} event - Normalized pointer event, output from normalizeToPointerData\n * @return {PIXI.InteractionData} - Interaction data for the given pointer identifier\n */\n InteractionManager.prototype.getInteractionDataForPointerId = function (event) {\n var pointerId = event.pointerId;\n var interactionData;\n if (pointerId === MOUSE_POINTER_ID || event.pointerType === 'mouse') {\n interactionData = this.mouse;\n }\n else if (this.activeInteractionData[pointerId]) {\n interactionData = this.activeInteractionData[pointerId];\n }\n else {\n interactionData = this.interactionDataPool.pop() || new InteractionData();\n interactionData.identifier = pointerId;\n this.activeInteractionData[pointerId] = interactionData;\n }\n // copy properties from the event, so that we can make sure that touch/pointer specific\n // data is available\n interactionData.copyEvent(event);\n return interactionData;\n };\n /**\n * Return unused InteractionData to the pool, for a given pointerId\n *\n * @private\n * @param {number} pointerId - Identifier from a pointer event\n */\n InteractionManager.prototype.releaseInteractionDataForPointerId = function (pointerId) {\n var interactionData = this.activeInteractionData[pointerId];\n if (interactionData) {\n delete this.activeInteractionData[pointerId];\n interactionData.reset();\n this.interactionDataPool.push(interactionData);\n }\n };\n /**\n * Configure an InteractionEvent to wrap a DOM PointerEvent and InteractionData\n *\n * @private\n * @param {PIXI.InteractionEvent} interactionEvent - The event to be configured\n * @param {PointerEvent} pointerEvent - The DOM event that will be paired with the InteractionEvent\n * @param {PIXI.InteractionData} interactionData - The InteractionData that will be paired\n * with the InteractionEvent\n * @return {PIXI.InteractionEvent} the interaction event that was passed in\n */\n InteractionManager.prototype.configureInteractionEventForDOMEvent = function (interactionEvent, pointerEvent, interactionData) {\n interactionEvent.data = interactionData;\n this.mapPositionToPoint(interactionData.global, pointerEvent.clientX, pointerEvent.clientY);\n // Not really sure why this is happening, but it's how a previous version handled things\n if (pointerEvent.pointerType === 'touch') {\n pointerEvent.globalX = interactionData.global.x;\n pointerEvent.globalY = interactionData.global.y;\n }\n interactionData.originalEvent = pointerEvent;\n interactionEvent.reset();\n return interactionEvent;\n };\n /**\n * Ensures that the original event object contains all data that a regular pointer event would have\n *\n * @private\n * @param {TouchEvent|MouseEvent|PointerEvent} event - The original event data from a touch or mouse event\n * @return {PointerEvent[]} An array containing a single normalized pointer event, in the case of a pointer\n * or mouse event, or a multiple normalized pointer events if there are multiple changed touches\n */\n InteractionManager.prototype.normalizeToPointerData = function (event) {\n var normalizedEvents = [];\n if (this.supportsTouchEvents && event instanceof TouchEvent) {\n for (var i = 0, li = event.changedTouches.length; i < li; i++) {\n var touch = event.changedTouches[i];\n if (typeof touch.button === 'undefined')\n { touch.button = event.touches.length ? 1 : 0; }\n if (typeof touch.buttons === 'undefined')\n { touch.buttons = event.touches.length ? 1 : 0; }\n if (typeof touch.isPrimary === 'undefined') {\n touch.isPrimary = event.touches.length === 1 && event.type === 'touchstart';\n }\n if (typeof touch.width === 'undefined')\n { touch.width = touch.radiusX || 1; }\n if (typeof touch.height === 'undefined')\n { touch.height = touch.radiusY || 1; }\n if (typeof touch.tiltX === 'undefined')\n { touch.tiltX = 0; }\n if (typeof touch.tiltY === 'undefined')\n { touch.tiltY = 0; }\n if (typeof touch.pointerType === 'undefined')\n { touch.pointerType = 'touch'; }\n if (typeof touch.pointerId === 'undefined')\n { touch.pointerId = touch.identifier || 0; }\n if (typeof touch.pressure === 'undefined')\n { touch.pressure = touch.force || 0.5; }\n if (typeof touch.twist === 'undefined')\n { touch.twist = 0; }\n if (typeof touch.tangentialPressure === 'undefined')\n { touch.tangentialPressure = 0; }\n // TODO: Remove these, as layerX/Y is not a standard, is deprecated, has uneven\n // support, and the fill ins are not quite the same\n // offsetX/Y might be okay, but is not the same as clientX/Y when the canvas's top\n // left is not 0,0 on the page\n if (typeof touch.layerX === 'undefined')\n { touch.layerX = touch.offsetX = touch.clientX; }\n if (typeof touch.layerY === 'undefined')\n { touch.layerY = touch.offsetY = touch.clientY; }\n // mark the touch as normalized, just so that we know we did it\n touch.isNormalized = true;\n normalizedEvents.push(touch);\n }\n }\n // apparently PointerEvent subclasses MouseEvent, so yay\n else if (event instanceof MouseEvent && (!this.supportsPointerEvents || !(event instanceof window.PointerEvent))) {\n var tempEvent = event;\n if (typeof tempEvent.isPrimary === 'undefined')\n { tempEvent.isPrimary = true; }\n if (typeof tempEvent.width === 'undefined')\n { tempEvent.width = 1; }\n if (typeof tempEvent.height === 'undefined')\n { tempEvent.height = 1; }\n if (typeof tempEvent.tiltX === 'undefined')\n { tempEvent.tiltX = 0; }\n if (typeof tempEvent.tiltY === 'undefined')\n { tempEvent.tiltY = 0; }\n if (typeof tempEvent.pointerType === 'undefined')\n { tempEvent.pointerType = 'mouse'; }\n if (typeof tempEvent.pointerId === 'undefined')\n { tempEvent.pointerId = MOUSE_POINTER_ID; }\n if (typeof tempEvent.pressure === 'undefined')\n { tempEvent.pressure = 0.5; }\n if (typeof tempEvent.twist === 'undefined')\n { tempEvent.twist = 0; }\n if (typeof tempEvent.tangentialPressure === 'undefined')\n { tempEvent.tangentialPressure = 0; }\n // mark the mouse event as normalized, just so that we know we did it\n tempEvent.isNormalized = true;\n normalizedEvents.push(tempEvent);\n }\n else {\n normalizedEvents.push(event);\n }\n return normalizedEvents;\n };\n /**\n * Destroys the interaction manager\n *\n */\n InteractionManager.prototype.destroy = function () {\n this.removeEvents();\n this.removeTickerListener();\n this.removeAllListeners();\n this.renderer = null;\n this.mouse = null;\n this.eventData = null;\n this.interactionDOMElement = null;\n this.onPointerDown = null;\n this.processPointerDown = null;\n this.onPointerUp = null;\n this.processPointerUp = null;\n this.onPointerCancel = null;\n this.processPointerCancel = null;\n this.onPointerMove = null;\n this.processPointerMove = null;\n this.onPointerOut = null;\n this.processPointerOverOut = null;\n this.onPointerOver = null;\n this.search = null;\n };\n return InteractionManager;\n}(EventEmitter));\n\nexport { InteractionData, InteractionEvent, InteractionManager, InteractionTrackingData, interactiveTarget };\n//# sourceMappingURL=interaction.es.js.map\n","/*!\n * @pixi/app - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/app is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Container } from '@pixi/display';\nimport { autoDetectRenderer } from '@pixi/core';\n\n/**\n * Convenience class to create a new PIXI application.\n *\n * This class automatically creates the renderer, ticker and root container.\n *\n * @example\n * // Create the application\n * const app = new PIXI.Application();\n *\n * // Add the view to the DOM\n * document.body.appendChild(app.view);\n *\n * // ex, add display objects\n * app.stage.addChild(PIXI.Sprite.from('something.png'));\n *\n * @class\n * @memberof PIXI\n */\nvar Application = /** @class */ (function () {\n /**\n * @param {object} [options] - The optional renderer parameters.\n * @param {boolean} [options.autoStart=true] - Automatically starts the rendering after the construction.\n * **Note**: Setting this parameter to false does NOT stop the shared ticker even if you set\n * options.sharedTicker to true in case that it is already started. Stop it by your own.\n * @param {number} [options.width=800] - The width of the renderers view.\n * @param {number} [options.height=600] - The height of the renderers view.\n * @param {HTMLCanvasElement} [options.view] - The canvas to use as a view, optional.\n * @param {boolean} [options.transparent=false] - If the render view is transparent.\n * @param {boolean} [options.autoDensity=false] - Resizes renderer view in CSS pixels to allow for\n * resolutions other than 1.\n * @param {boolean} [options.antialias=false] - Sets antialias\n * @param {boolean} [options.preserveDrawingBuffer=false] - Enables drawing buffer preservation, enable this if you\n * need to call toDataUrl on the WebGL context.\n * @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer, retina would be 2.\n * @param {boolean} [options.forceCanvas=false] - prevents selection of WebGL renderer, even if such is present, this\n * option only is available when using **pixi.js-legacy** or **@pixi/canvas-renderer** modules, otherwise\n * it is ignored.\n * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area\n * (shown if not transparent).\n * @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or\n * not before the new render pass.\n * @param {string} [options.powerPreference] - Parameter passed to webgl context, set to \"high-performance\"\n * for devices with dual graphics card. **(WebGL only)**.\n * @param {boolean} [options.sharedTicker=false] - `true` to use PIXI.Ticker.shared, `false` to create new ticker.\n * If set to false, you cannot register a handler to occur before anything that runs on the shared ticker.\n * The system ticker will always run before both the shared ticker and the app ticker.\n * @param {boolean} [options.sharedLoader=false] - `true` to use PIXI.Loader.shared, `false` to create new Loader.\n * @param {Window|HTMLElement} [options.resizeTo] - Element to automatically resize stage to.\n */\n function Application(options) {\n var _this = this;\n // The default options\n options = Object.assign({\n forceCanvas: false,\n }, options);\n /**\n * WebGL renderer if available, otherwise CanvasRenderer.\n * @member {PIXI.Renderer|PIXI.CanvasRenderer}\n */\n this.renderer = autoDetectRenderer(options);\n /**\n * The root display container that's rendered.\n * @member {PIXI.Container}\n */\n this.stage = new Container();\n // install plugins here\n Application._plugins.forEach(function (plugin) {\n plugin.init.call(_this, options);\n });\n }\n /**\n * Register a middleware plugin for the application\n * @static\n * @param {PIXI.Application.Plugin} plugin - Plugin being installed\n */\n Application.registerPlugin = function (plugin) {\n Application._plugins.push(plugin);\n };\n /**\n * Render the current stage.\n */\n Application.prototype.render = function () {\n // TODO: Since CanvasRenderer has not been converted this function thinks it takes DisplayObject & PIXI.DisplayObject\n // This can be fixed when CanvasRenderer is converted.\n this.renderer.render(this.stage);\n };\n Object.defineProperty(Application.prototype, \"view\", {\n /**\n * Reference to the renderer's canvas element.\n * @member {HTMLCanvasElement}\n * @readonly\n */\n get: function () {\n return this.renderer.view;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Application.prototype, \"screen\", {\n /**\n * Reference to the renderer's screen rectangle. Its safe to use as `filterArea` or `hitArea` for the whole screen.\n * @member {PIXI.Rectangle}\n * @readonly\n */\n get: function () {\n return this.renderer.screen;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Destroy and don't use after this.\n * @param {Boolean} [removeView=false] - Automatically remove canvas from DOM.\n * @param {object|boolean} [stageOptions] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [stageOptions.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'stageOptions' will be passed on to those calls.\n * @param {boolean} [stageOptions.texture=false] - Only used for child Sprites if stageOptions.children is set\n * to true. Should it destroy the texture of the child sprite\n * @param {boolean} [stageOptions.baseTexture=false] - Only used for child Sprites if stageOptions.children is set\n * to true. Should it destroy the base texture of the child sprite\n */\n Application.prototype.destroy = function (removeView, stageOptions) {\n var _this = this;\n // Destroy plugins in the opposite order\n // which they were constructed\n var plugins = Application._plugins.slice(0);\n plugins.reverse();\n plugins.forEach(function (plugin) {\n plugin.destroy.call(_this);\n });\n this.stage.destroy(stageOptions);\n this.stage = null;\n this.renderer.destroy(removeView);\n this.renderer = null;\n };\n return Application;\n}());\n/**\n * @memberof PIXI.Application\n * @typedef {object} Plugin\n * @property {function} init - Called when Application is constructed, scoped to Application instance.\n * Passes in `options` as the only argument, which are Application constructor options.\n * @property {function} destroy - Called when destroying Application, scoped to Application instance\n */\n/**\n * Collection of installed plugins.\n * @static\n * @private\n * @type {PIXI.Application.Plugin[]}\n */\nApplication._plugins = [];\n\n/**\n * Middleware for for Application's resize functionality\n * @private\n * @class\n */\nvar ResizePlugin = /** @class */ (function () {\n function ResizePlugin() {\n }\n /**\n * Initialize the plugin with scope of application instance\n * @static\n * @private\n * @param {object} [options] - See application options\n */\n ResizePlugin.init = function (options) {\n var _this = this;\n /**\n * The HTML element or window to automatically resize the\n * renderer's view element to match width and height.\n * @type {Window|HTMLElement}\n * @name resizeTo\n * @memberof PIXI.Application#\n */\n Object.defineProperty(this, 'resizeTo', {\n set: function (dom) {\n window.removeEventListener('resize', this.queueResize);\n this._resizeTo = dom;\n if (dom) {\n window.addEventListener('resize', this.queueResize);\n this.resize();\n }\n },\n get: function () {\n return this._resizeTo;\n },\n });\n /**\n * Resize is throttled, so it's\n * safe to call this multiple times per frame and it'll\n * only be called once.\n * @method PIXI.Application#queueResize\n */\n this.queueResize = function () {\n if (!_this._resizeTo) {\n return;\n }\n _this.cancelResize();\n // // Throttle resize events per raf\n _this._resizeId = requestAnimationFrame(function () { return _this.resize(); });\n };\n /**\n * Cancel the resize queue.\n * @method PIXI.Application#cancelResize\n * @private\n */\n this.cancelResize = function () {\n if (_this._resizeId) {\n cancelAnimationFrame(_this._resizeId);\n _this._resizeId = null;\n }\n };\n /**\n * Execute an immediate resize on the renderer, this is not\n * throttled and can be expensive to call many times in a row.\n * Will resize only if `resizeTo` property is set.\n * @method PIXI.Application#resize\n */\n this.resize = function () {\n if (!_this._resizeTo) {\n return;\n }\n // clear queue resize\n _this.cancelResize();\n var width;\n var height;\n // Resize to the window\n if (_this._resizeTo === window) {\n width = window.innerWidth;\n height = window.innerHeight;\n }\n // Resize to other HTML entities\n else {\n var _a = _this._resizeTo, clientWidth = _a.clientWidth, clientHeight = _a.clientHeight;\n width = clientWidth;\n height = clientHeight;\n }\n _this.renderer.resize(width, height);\n };\n // On resize\n this._resizeId = null;\n this._resizeTo = null;\n this.resizeTo = options.resizeTo || null;\n };\n /**\n * Clean up the ticker, scoped to application\n * @static\n * @private\n */\n ResizePlugin.destroy = function () {\n this.cancelResize();\n this.cancelResize = null;\n this.queueResize = null;\n this.resizeTo = null;\n this.resize = null;\n };\n return ResizePlugin;\n}());\n\nApplication.registerPlugin(ResizePlugin);\n\nexport { Application };\n//# sourceMappingURL=app.es.js.map\n","/*!\n * @pixi/extract - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/extract is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { CanvasRenderTarget } from '@pixi/utils';\nimport { Rectangle } from '@pixi/math';\nimport { RenderTexture } from '@pixi/core';\n\nvar TEMP_RECT = new Rectangle();\nvar BYTES_PER_PIXEL = 4;\n/**\n * This class provides renderer-specific plugins for exporting content from a renderer.\n * For instance, these plugins can be used for saving an Image, Canvas element or for exporting the raw image data (pixels).\n *\n * Do not instantiate these plugins directly. It is available from the `renderer.plugins` property.\n * See {@link PIXI.CanvasRenderer#plugins} or {@link PIXI.Renderer#plugins}.\n * @example\n * // Create a new app (will auto-add extract plugin to renderer)\n * const app = new PIXI.Application();\n *\n * // Draw a red circle\n * const graphics = new PIXI.Graphics()\n * .beginFill(0xFF0000)\n * .drawCircle(0, 0, 50);\n *\n * // Render the graphics as an HTMLImageElement\n * const image = app.renderer.plugins.extract.image(graphics);\n * document.body.appendChild(image);\n * @class\n * @memberof PIXI\n */\nvar Extract = /** @class */ (function () {\n /**\n * @param {PIXI.Renderer} renderer - A reference to the current renderer\n */\n function Extract(renderer) {\n this.renderer = renderer;\n /**\n * Collection of methods for extracting data (image, pixels, etc.) from a display object or render texture\n *\n * @member {PIXI.Extract} extract\n * @memberof PIXI.Renderer#\n * @see PIXI.Extract\n */\n renderer.extract = this;\n }\n /**\n * Will return a HTML Image of the target\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use the main renderer\n * @param {string} [format] - Image format, e.g. \"image/jpeg\" or \"image/webp\".\n * @param {number} [quality] - JPEG or Webp compression from 0 to 1. Default is 0.92.\n * @return {HTMLImageElement} HTML Image of the target\n */\n Extract.prototype.image = function (target, format, quality) {\n var image = new Image();\n image.src = this.base64(target, format, quality);\n return image;\n };\n /**\n * Will return a a base64 encoded string of this target. It works by calling\n * `Extract.getCanvas` and then running toDataURL on that.\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use the main renderer\n * @param {string} [format] - Image format, e.g. \"image/jpeg\" or \"image/webp\".\n * @param {number} [quality] - JPEG or Webp compression from 0 to 1. Default is 0.92.\n * @return {string} A base64 encoded string of the texture.\n */\n Extract.prototype.base64 = function (target, format, quality) {\n return this.canvas(target).toDataURL(format, quality);\n };\n /**\n * Creates a Canvas element, renders this target to it and then returns it.\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use the main renderer\n * @return {HTMLCanvasElement} A Canvas element with the texture rendered on.\n */\n Extract.prototype.canvas = function (target) {\n var renderer = this.renderer;\n var resolution;\n var frame;\n var flipY = false;\n var renderTexture;\n var generated = false;\n if (target) {\n if (target instanceof RenderTexture) {\n renderTexture = target;\n }\n else {\n renderTexture = this.renderer.generateTexture(target);\n generated = true;\n }\n }\n if (renderTexture) {\n resolution = renderTexture.baseTexture.resolution;\n frame = renderTexture.frame;\n flipY = false;\n renderer.renderTexture.bind(renderTexture);\n }\n else {\n resolution = this.renderer.resolution;\n flipY = true;\n frame = TEMP_RECT;\n frame.width = this.renderer.width;\n frame.height = this.renderer.height;\n renderer.renderTexture.bind(null);\n }\n var width = Math.floor((frame.width * resolution) + 1e-4);\n var height = Math.floor((frame.height * resolution) + 1e-4);\n var canvasBuffer = new CanvasRenderTarget(width, height, 1);\n var webglPixels = new Uint8Array(BYTES_PER_PIXEL * width * height);\n // read pixels to the array\n var gl = renderer.gl;\n gl.readPixels(frame.x * resolution, frame.y * resolution, width, height, gl.RGBA, gl.UNSIGNED_BYTE, webglPixels);\n // add the pixels to the canvas\n var canvasData = canvasBuffer.context.getImageData(0, 0, width, height);\n Extract.arrayPostDivide(webglPixels, canvasData.data);\n canvasBuffer.context.putImageData(canvasData, 0, 0);\n // pulling pixels\n if (flipY) {\n var target_1 = new CanvasRenderTarget(canvasBuffer.width, canvasBuffer.height, 1);\n target_1.context.scale(1, -1);\n // we can't render to itself because we should be empty before render.\n target_1.context.drawImage(canvasBuffer.canvas, 0, -height);\n canvasBuffer.destroy();\n canvasBuffer = target_1;\n }\n if (generated) {\n renderTexture.destroy(true);\n }\n // send the canvas back..\n return canvasBuffer.canvas;\n };\n /**\n * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA\n * order, with integer values between 0 and 255 (included).\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use the main renderer\n * @return {Uint8Array} One-dimensional array containing the pixel data of the entire texture\n */\n Extract.prototype.pixels = function (target) {\n var renderer = this.renderer;\n var resolution;\n var frame;\n var renderTexture;\n var generated = false;\n if (target) {\n if (target instanceof RenderTexture) {\n renderTexture = target;\n }\n else {\n renderTexture = this.renderer.generateTexture(target);\n generated = true;\n }\n }\n if (renderTexture) {\n resolution = renderTexture.baseTexture.resolution;\n frame = renderTexture.frame;\n // bind the buffer\n renderer.renderTexture.bind(renderTexture);\n }\n else {\n resolution = renderer.resolution;\n frame = TEMP_RECT;\n frame.width = renderer.width;\n frame.height = renderer.height;\n renderer.renderTexture.bind(null);\n }\n var width = frame.width * resolution;\n var height = frame.height * resolution;\n var webglPixels = new Uint8Array(BYTES_PER_PIXEL * width * height);\n // read pixels to the array\n var gl = renderer.gl;\n gl.readPixels(frame.x * resolution, frame.y * resolution, width, height, gl.RGBA, gl.UNSIGNED_BYTE, webglPixels);\n if (generated) {\n renderTexture.destroy(true);\n }\n Extract.arrayPostDivide(webglPixels, webglPixels);\n return webglPixels;\n };\n /**\n * Destroys the extract\n *\n */\n Extract.prototype.destroy = function () {\n this.renderer.extract = null;\n this.renderer = null;\n };\n /**\n * Takes premultiplied pixel data and produces regular pixel data\n *\n * @private\n * @param pixels {number[] | Uint8Array | Uint8ClampedArray} array of pixel data\n * @param out {number[] | Uint8Array | Uint8ClampedArray} output array\n */\n Extract.arrayPostDivide = function (pixels, out) {\n for (var i = 0; i < pixels.length; i += 4) {\n var alpha = out[i + 3] = pixels[i + 3];\n if (alpha !== 0) {\n out[i] = Math.round(Math.min(pixels[i] * 255.0 / alpha, 255.0));\n out[i + 1] = Math.round(Math.min(pixels[i + 1] * 255.0 / alpha, 255.0));\n out[i + 2] = Math.round(Math.min(pixels[i + 2] * 255.0 / alpha, 255.0));\n }\n else {\n out[i] = pixels[i];\n out[i + 1] = pixels[i + 1];\n out[i + 2] = pixels[i + 2];\n }\n }\n };\n return Extract;\n}());\n\nexport { Extract };\n//# sourceMappingURL=extract.es.js.map\n","/*!\n * resource-loader - v3.0.1\n * https://github.com/pixijs/pixi-sound\n * Compiled Tue, 02 Jul 2019 14:06:18 UTC\n *\n * resource-loader is licensed under the MIT license.\n * http://www.opensource.org/licenses/mit-license\n */\nimport parseUri from 'parse-uri';\nimport Signal from 'mini-signals';\n\n/**\n * Smaller version of the async library constructs.\n *\n * @namespace async\n */\n\n/**\n * Noop function\n *\n * @ignore\n * @function\n * @memberof async\n */\nfunction _noop() {}\n/* empty */\n\n/**\n * Iterates an array in series.\n *\n * @memberof async\n * @function eachSeries\n * @param {Array.<*>} array - Array to iterate.\n * @param {function} iterator - Function to call for each element.\n * @param {function} callback - Function to call when done, or on error.\n * @param {boolean} [deferNext=false] - Break synchronous each loop by calling next with a setTimeout of 1.\n */\n\n\nfunction eachSeries(array, iterator, callback, deferNext) {\n var i = 0;\n var len = array.length;\n\n (function next(err) {\n if (err || i === len) {\n if (callback) {\n callback(err);\n }\n\n return;\n }\n\n if (deferNext) {\n setTimeout(function () {\n iterator(array[i++], next);\n }, 1);\n } else {\n iterator(array[i++], next);\n }\n })();\n}\n/**\n * Ensures a function is only called once.\n *\n * @ignore\n * @memberof async\n * @param {function} fn - The function to wrap.\n * @return {function} The wrapping function.\n */\n\nfunction onlyOnce(fn) {\n return function onceWrapper() {\n if (fn === null) {\n throw new Error('Callback was already called.');\n }\n\n var callFn = fn;\n fn = null;\n callFn.apply(this, arguments);\n };\n}\n/**\n * Async queue implementation,\n *\n * @memberof async\n * @function queue\n * @param {function} worker - The worker function to call for each task.\n * @param {number} concurrency - How many workers to run in parrallel.\n * @return {*} The async queue object.\n */\n\n\nfunction queue(worker, concurrency) {\n if (concurrency == null) {\n // eslint-disable-line no-eq-null,eqeqeq\n concurrency = 1;\n } else if (concurrency === 0) {\n throw new Error('Concurrency must not be zero');\n }\n\n var workers = 0;\n var q = {\n _tasks: [],\n concurrency: concurrency,\n saturated: _noop,\n unsaturated: _noop,\n buffer: concurrency / 4,\n empty: _noop,\n drain: _noop,\n error: _noop,\n started: false,\n paused: false,\n push: function push(data, callback) {\n _insert(data, false, callback);\n },\n kill: function kill() {\n workers = 0;\n q.drain = _noop;\n q.started = false;\n q._tasks = [];\n },\n unshift: function unshift(data, callback) {\n _insert(data, true, callback);\n },\n process: function process() {\n while (!q.paused && workers < q.concurrency && q._tasks.length) {\n var task = q._tasks.shift();\n\n if (q._tasks.length === 0) {\n q.empty();\n }\n\n workers += 1;\n\n if (workers === q.concurrency) {\n q.saturated();\n }\n\n worker(task.data, onlyOnce(_next(task)));\n }\n },\n length: function length() {\n return q._tasks.length;\n },\n running: function running() {\n return workers;\n },\n idle: function idle() {\n return q._tasks.length + workers === 0;\n },\n pause: function pause() {\n if (q.paused === true) {\n return;\n }\n\n q.paused = true;\n },\n resume: function resume() {\n if (q.paused === false) {\n return;\n }\n\n q.paused = false; // Need to call q.process once per concurrent\n // worker to preserve full concurrency after pause\n\n for (var w = 1; w <= q.concurrency; w++) {\n q.process();\n }\n }\n };\n\n function _insert(data, insertAtFront, callback) {\n if (callback != null && typeof callback !== 'function') {\n // eslint-disable-line no-eq-null,eqeqeq\n throw new Error('task callback must be a function');\n }\n\n q.started = true;\n\n if (data == null && q.idle()) {\n // eslint-disable-line no-eq-null,eqeqeq\n // call drain immediately if there are no tasks\n setTimeout(function () {\n return q.drain();\n }, 1);\n return;\n }\n\n var item = {\n data: data,\n callback: typeof callback === 'function' ? callback : _noop\n };\n\n if (insertAtFront) {\n q._tasks.unshift(item);\n } else {\n q._tasks.push(item);\n }\n\n setTimeout(function () {\n return q.process();\n }, 1);\n }\n\n function _next(task) {\n return function next() {\n workers -= 1;\n task.callback.apply(task, arguments);\n\n if (arguments[0] != null) {\n // eslint-disable-line no-eq-null,eqeqeq\n q.error(arguments[0], task.data);\n }\n\n if (workers <= q.concurrency - q.buffer) {\n q.unsaturated();\n }\n\n if (q.idle()) {\n q.drain();\n }\n\n q.process();\n };\n }\n\n return q;\n}\n\nvar async = ({\n eachSeries: eachSeries,\n queue: queue\n});\n\n// a simple in-memory cache for resources\nvar cache = {};\n/**\n * A simple in-memory cache for resource.\n *\n * @memberof middleware\n * @function caching\n * @example\n * import { Loader, middleware } from 'resource-loader';\n * const loader = new Loader();\n * loader.use(middleware.caching);\n * @param {Resource} resource - Current Resource\n * @param {function} next - Callback when complete\n */\n\nfunction caching(resource, next) {\n var _this = this;\n\n // if cached, then set data and complete the resource\n if (cache[resource.url]) {\n resource.data = cache[resource.url];\n resource.complete(); // marks resource load complete and stops processing before middlewares\n } // if not cached, wait for complete and store it in the cache.\n else {\n resource.onComplete.once(function () {\n return cache[_this.url] = _this.data;\n });\n }\n\n next();\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nvar useXdr = !!(window.XDomainRequest && !('withCredentials' in new XMLHttpRequest()));\nvar tempAnchor = null; // some status constants\n\nvar STATUS_NONE = 0;\nvar STATUS_OK = 200;\nvar STATUS_EMPTY = 204;\nvar STATUS_IE_BUG_EMPTY = 1223;\nvar STATUS_TYPE_OK = 2; // noop\n\nfunction _noop$1() {}\n/* empty */\n\n/**\n * Manages the state and loading of a resource and all child resources.\n *\n * @class\n */\n\n\nvar Resource =\n/*#__PURE__*/\nfunction () {\n /**\n * Sets the load type to be used for a specific extension.\n *\n * @static\n * @param {string} extname - The extension to set the type for, e.g. \"png\" or \"fnt\"\n * @param {Resource.LOAD_TYPE} loadType - The load type to set it to.\n */\n Resource.setExtensionLoadType = function setExtensionLoadType(extname, loadType) {\n setExtMap(Resource._loadTypeMap, extname, loadType);\n }\n /**\n * Sets the load type to be used for a specific extension.\n *\n * @static\n * @param {string} extname - The extension to set the type for, e.g. \"png\" or \"fnt\"\n * @param {Resource.XHR_RESPONSE_TYPE} xhrType - The xhr type to set it to.\n */\n ;\n\n Resource.setExtensionXhrType = function setExtensionXhrType(extname, xhrType) {\n setExtMap(Resource._xhrTypeMap, extname, xhrType);\n }\n /**\n * @param {string} name - The name of the resource to load.\n * @param {string|string[]} url - The url for this resource, for audio/video loads you can pass\n * an array of sources.\n * @param {object} [options] - The options for the load.\n * @param {string|boolean} [options.crossOrigin] - Is this request cross-origin? Default is to\n * determine automatically.\n * @param {number} [options.timeout=0] - A timeout in milliseconds for the load. If the load takes\n * longer than this time it is cancelled and the load is considered a failure. If this value is\n * set to `0` then there is no explicit timeout.\n * @param {Resource.LOAD_TYPE} [options.loadType=Resource.LOAD_TYPE.XHR] - How should this resource\n * be loaded?\n * @param {Resource.XHR_RESPONSE_TYPE} [options.xhrType=Resource.XHR_RESPONSE_TYPE.DEFAULT] - How\n * should the data being loaded be interpreted when using XHR?\n * @param {Resource.IMetadata} [options.metadata] - Extra configuration for middleware and the Resource object.\n */\n ;\n\n function Resource(name, url, options) {\n if (typeof name !== 'string' || typeof url !== 'string') {\n throw new Error('Both name and url are required for constructing a resource.');\n }\n\n options = options || {};\n /**\n * The state flags of this resource.\n *\n * @private\n * @member {number}\n */\n\n this._flags = 0; // set data url flag, needs to be set early for some _determineX checks to work.\n\n this._setFlag(Resource.STATUS_FLAGS.DATA_URL, url.indexOf('data:') === 0);\n /**\n * The name of this resource.\n *\n * @readonly\n * @member {string}\n */\n\n\n this.name = name;\n /**\n * The url used to load this resource.\n *\n * @readonly\n * @member {string}\n */\n\n this.url = url;\n /**\n * The extension used to load this resource.\n *\n * @readonly\n * @member {string}\n */\n\n this.extension = this._getExtension();\n /**\n * The data that was loaded by the resource.\n *\n * @member {any}\n */\n\n this.data = null;\n /**\n * Is this request cross-origin? If unset, determined automatically.\n *\n * @member {string}\n */\n\n this.crossOrigin = options.crossOrigin === true ? 'anonymous' : options.crossOrigin;\n /**\n * A timeout in milliseconds for the load. If the load takes longer than this time\n * it is cancelled and the load is considered a failure. If this value is set to `0`\n * then there is no explicit timeout.\n *\n * @member {number}\n */\n\n this.timeout = options.timeout || 0;\n /**\n * The method of loading to use for this resource.\n *\n * @member {Resource.LOAD_TYPE}\n */\n\n this.loadType = options.loadType || this._determineLoadType();\n /**\n * The type used to load the resource via XHR. If unset, determined automatically.\n *\n * @member {string}\n */\n\n this.xhrType = options.xhrType;\n /**\n * Extra info for middleware, and controlling specifics about how the resource loads.\n *\n * Note that if you pass in a `loadElement`, the Resource class takes ownership of it.\n * Meaning it will modify it as it sees fit.\n *\n * @member {Resource.IMetadata}\n */\n\n this.metadata = options.metadata || {};\n /**\n * The error that occurred while loading (if any).\n *\n * @readonly\n * @member {Error}\n */\n\n this.error = null;\n /**\n * The XHR object that was used to load this resource. This is only set\n * when `loadType` is `Resource.LOAD_TYPE.XHR`.\n *\n * @readonly\n * @member {XMLHttpRequest}\n */\n\n this.xhr = null;\n /**\n * The child resources this resource owns.\n *\n * @readonly\n * @member {Resource[]}\n */\n\n this.children = [];\n /**\n * The resource type.\n *\n * @readonly\n * @member {Resource.TYPE}\n */\n\n this.type = Resource.TYPE.UNKNOWN;\n /**\n * The progress chunk owned by this resource.\n *\n * @readonly\n * @member {number}\n */\n\n this.progressChunk = 0;\n /**\n * The `dequeue` method that will be used a storage place for the async queue dequeue method\n * used privately by the loader.\n *\n * @private\n * @member {function}\n */\n\n this._dequeue = _noop$1;\n /**\n * Used a storage place for the on load binding used privately by the loader.\n *\n * @private\n * @member {function}\n */\n\n this._onLoadBinding = null;\n /**\n * The timer for element loads to check if they timeout.\n *\n * @private\n * @member {number}\n */\n\n this._elementTimer = 0;\n /**\n * The `complete` function bound to this resource's context.\n *\n * @private\n * @member {function}\n */\n\n this._boundComplete = this.complete.bind(this);\n /**\n * The `_onError` function bound to this resource's context.\n *\n * @private\n * @member {function}\n */\n\n this._boundOnError = this._onError.bind(this);\n /**\n * The `_onProgress` function bound to this resource's context.\n *\n * @private\n * @member {function}\n */\n\n this._boundOnProgress = this._onProgress.bind(this);\n /**\n * The `_onTimeout` function bound to this resource's context.\n *\n * @private\n * @member {function}\n */\n\n this._boundOnTimeout = this._onTimeout.bind(this); // xhr callbacks\n\n this._boundXhrOnError = this._xhrOnError.bind(this);\n this._boundXhrOnTimeout = this._xhrOnTimeout.bind(this);\n this._boundXhrOnAbort = this._xhrOnAbort.bind(this);\n this._boundXhrOnLoad = this._xhrOnLoad.bind(this);\n /**\n * Dispatched when the resource beings to load.\n *\n * The callback looks like {@link Resource.OnStartSignal}.\n *\n * @member {Signal}\n */\n\n this.onStart = new Signal();\n /**\n * Dispatched each time progress of this resource load updates.\n * Not all resources types and loader systems can support this event\n * so sometimes it may not be available. If the resource\n * is being loaded on a modern browser, using XHR, and the remote server\n * properly sets Content-Length headers, then this will be available.\n *\n * The callback looks like {@link Resource.OnProgressSignal}.\n *\n * @member {Signal}\n */\n\n this.onProgress = new Signal();\n /**\n * Dispatched once this resource has loaded, if there was an error it will\n * be in the `error` property.\n *\n * The callback looks like {@link Resource.OnCompleteSignal}.\n *\n * @member {Signal}\n */\n\n this.onComplete = new Signal();\n /**\n * Dispatched after this resource has had all the *after* middleware run on it.\n *\n * The callback looks like {@link Resource.OnCompleteSignal}.\n *\n * @member {Signal}\n */\n\n this.onAfterMiddleware = new Signal();\n }\n /**\n * When the resource starts to load.\n *\n * @memberof Resource\n * @callback OnStartSignal\n * @param {Resource} resource - The resource that the event happened on.\n */\n\n /**\n * When the resource reports loading progress.\n *\n * @memberof Resource\n * @callback OnProgressSignal\n * @param {Resource} resource - The resource that the event happened on.\n * @param {number} percentage - The progress of the load in the range [0, 1].\n */\n\n /**\n * When the resource finishes loading.\n *\n * @memberof Resource\n * @callback OnCompleteSignal\n * @param {Resource} resource - The resource that the event happened on.\n */\n\n /**\n * @memberof Resource\n * @typedef {object} IMetadata\n * @property {HTMLImageElement|HTMLAudioElement|HTMLVideoElement} [loadElement=null] - The\n * element to use for loading, instead of creating one.\n * @property {boolean} [skipSource=false] - Skips adding source(s) to the load element. This\n * is useful if you want to pass in a `loadElement` that you already added load sources to.\n * @property {string|string[]} [mimeType] - The mime type to use for the source element\n * of a video/audio elment. If the urls are an array, you can pass this as an array as well\n * where each index is the mime type to use for the corresponding url index.\n */\n\n /**\n * Stores whether or not this url is a data url.\n *\n * @readonly\n * @member {boolean}\n */\n\n\n var _proto = Resource.prototype;\n\n /**\n * Marks the resource as complete.\n *\n */\n _proto.complete = function complete() {\n this._clearEvents();\n\n this._finish();\n }\n /**\n * Aborts the loading of this resource, with an optional message.\n *\n * @param {string} message - The message to use for the error\n */\n ;\n\n _proto.abort = function abort(message) {\n // abort can be called multiple times, ignore subsequent calls.\n if (this.error) {\n return;\n } // store error\n\n\n this.error = new Error(message); // clear events before calling aborts\n\n this._clearEvents(); // abort the actual loading\n\n\n if (this.xhr) {\n this.xhr.abort();\n } else if (this.xdr) {\n this.xdr.abort();\n } else if (this.data) {\n // single source\n if (this.data.src) {\n this.data.src = Resource.EMPTY_GIF;\n } // multi-source\n else {\n while (this.data.firstChild) {\n this.data.removeChild(this.data.firstChild);\n }\n }\n } // done now.\n\n\n this._finish();\n }\n /**\n * Kicks off loading of this resource. This method is asynchronous.\n *\n * @param {Resource.OnCompleteSignal} [cb] - Optional callback to call once the resource is loaded.\n */\n ;\n\n _proto.load = function load(cb) {\n var _this = this;\n\n if (this.isLoading) {\n return;\n }\n\n if (this.isComplete) {\n if (cb) {\n setTimeout(function () {\n return cb(_this);\n }, 1);\n }\n\n return;\n } else if (cb) {\n this.onComplete.once(cb);\n }\n\n this._setFlag(Resource.STATUS_FLAGS.LOADING, true);\n\n this.onStart.dispatch(this); // if unset, determine the value\n\n if (this.crossOrigin === false || typeof this.crossOrigin !== 'string') {\n this.crossOrigin = this._determineCrossOrigin(this.url);\n }\n\n switch (this.loadType) {\n case Resource.LOAD_TYPE.IMAGE:\n this.type = Resource.TYPE.IMAGE;\n\n this._loadElement('image');\n\n break;\n\n case Resource.LOAD_TYPE.AUDIO:\n this.type = Resource.TYPE.AUDIO;\n\n this._loadSourceElement('audio');\n\n break;\n\n case Resource.LOAD_TYPE.VIDEO:\n this.type = Resource.TYPE.VIDEO;\n\n this._loadSourceElement('video');\n\n break;\n\n case Resource.LOAD_TYPE.XHR:\n /* falls through */\n\n default:\n if (useXdr && this.crossOrigin) {\n this._loadXdr();\n } else {\n this._loadXhr();\n }\n\n break;\n }\n }\n /**\n * Checks if the flag is set.\n *\n * @private\n * @param {number} flag - The flag to check.\n * @return {boolean} True if the flag is set.\n */\n ;\n\n _proto._hasFlag = function _hasFlag(flag) {\n return (this._flags & flag) !== 0;\n }\n /**\n * (Un)Sets the flag.\n *\n * @private\n * @param {number} flag - The flag to (un)set.\n * @param {boolean} value - Whether to set or (un)set the flag.\n */\n ;\n\n _proto._setFlag = function _setFlag(flag, value) {\n this._flags = value ? this._flags | flag : this._flags & ~flag;\n }\n /**\n * Clears all the events from the underlying loading source.\n *\n * @private\n */\n ;\n\n _proto._clearEvents = function _clearEvents() {\n clearTimeout(this._elementTimer);\n\n if (this.data && this.data.removeEventListener) {\n this.data.removeEventListener('error', this._boundOnError, false);\n this.data.removeEventListener('load', this._boundComplete, false);\n this.data.removeEventListener('progress', this._boundOnProgress, false);\n this.data.removeEventListener('canplaythrough', this._boundComplete, false);\n }\n\n if (this.xhr) {\n if (this.xhr.removeEventListener) {\n this.xhr.removeEventListener('error', this._boundXhrOnError, false);\n this.xhr.removeEventListener('timeout', this._boundXhrOnTimeout, false);\n this.xhr.removeEventListener('abort', this._boundXhrOnAbort, false);\n this.xhr.removeEventListener('progress', this._boundOnProgress, false);\n this.xhr.removeEventListener('load', this._boundXhrOnLoad, false);\n } else {\n this.xhr.onerror = null;\n this.xhr.ontimeout = null;\n this.xhr.onprogress = null;\n this.xhr.onload = null;\n }\n }\n }\n /**\n * Finalizes the load.\n *\n * @private\n */\n ;\n\n _proto._finish = function _finish() {\n if (this.isComplete) {\n throw new Error('Complete called again for an already completed resource.');\n }\n\n this._setFlag(Resource.STATUS_FLAGS.COMPLETE, true);\n\n this._setFlag(Resource.STATUS_FLAGS.LOADING, false);\n\n this.onComplete.dispatch(this);\n }\n /**\n * Loads this resources using an element that has a single source,\n * like an HTMLImageElement.\n *\n * @private\n * @param {string} type - The type of element to use.\n */\n ;\n\n _proto._loadElement = function _loadElement(type) {\n if (this.metadata.loadElement) {\n this.data = this.metadata.loadElement;\n } else if (type === 'image' && typeof window.Image !== 'undefined') {\n this.data = new Image();\n } else {\n this.data = document.createElement(type);\n }\n\n if (this.crossOrigin) {\n this.data.crossOrigin = this.crossOrigin;\n }\n\n if (!this.metadata.skipSource) {\n this.data.src = this.url;\n }\n\n this.data.addEventListener('error', this._boundOnError, false);\n this.data.addEventListener('load', this._boundComplete, false);\n this.data.addEventListener('progress', this._boundOnProgress, false);\n\n if (this.timeout) {\n this._elementTimer = setTimeout(this._boundOnTimeout, this.timeout);\n }\n }\n /**\n * Loads this resources using an element that has multiple sources,\n * like an HTMLAudioElement or HTMLVideoElement.\n *\n * @private\n * @param {string} type - The type of element to use.\n */\n ;\n\n _proto._loadSourceElement = function _loadSourceElement(type) {\n if (this.metadata.loadElement) {\n this.data = this.metadata.loadElement;\n } else if (type === 'audio' && typeof window.Audio !== 'undefined') {\n this.data = new Audio();\n } else {\n this.data = document.createElement(type);\n }\n\n if (this.data === null) {\n this.abort(\"Unsupported element: \" + type);\n return;\n }\n\n if (this.crossOrigin) {\n this.data.crossOrigin = this.crossOrigin;\n }\n\n if (!this.metadata.skipSource) {\n // support for CocoonJS Canvas+ runtime, lacks document.createElement('source')\n if (navigator.isCocoonJS) {\n this.data.src = Array.isArray(this.url) ? this.url[0] : this.url;\n } else if (Array.isArray(this.url)) {\n var mimeTypes = this.metadata.mimeType;\n\n for (var i = 0; i < this.url.length; ++i) {\n this.data.appendChild(this._createSource(type, this.url[i], Array.isArray(mimeTypes) ? mimeTypes[i] : mimeTypes));\n }\n } else {\n var _mimeTypes = this.metadata.mimeType;\n this.data.appendChild(this._createSource(type, this.url, Array.isArray(_mimeTypes) ? _mimeTypes[0] : _mimeTypes));\n }\n }\n\n this.data.addEventListener('error', this._boundOnError, false);\n this.data.addEventListener('load', this._boundComplete, false);\n this.data.addEventListener('progress', this._boundOnProgress, false);\n this.data.addEventListener('canplaythrough', this._boundComplete, false);\n this.data.load();\n\n if (this.timeout) {\n this._elementTimer = setTimeout(this._boundOnTimeout, this.timeout);\n }\n }\n /**\n * Loads this resources using an XMLHttpRequest.\n *\n * @private\n */\n ;\n\n _proto._loadXhr = function _loadXhr() {\n // if unset, determine the value\n if (typeof this.xhrType !== 'string') {\n this.xhrType = this._determineXhrType();\n }\n\n var xhr = this.xhr = new XMLHttpRequest(); // set the request type and url\n\n xhr.open('GET', this.url, true);\n xhr.timeout = this.timeout; // load json as text and parse it ourselves. We do this because some browsers\n // *cough* safari *cough* can't deal with it.\n\n if (this.xhrType === Resource.XHR_RESPONSE_TYPE.JSON || this.xhrType === Resource.XHR_RESPONSE_TYPE.DOCUMENT) {\n xhr.responseType = Resource.XHR_RESPONSE_TYPE.TEXT;\n } else {\n xhr.responseType = this.xhrType;\n }\n\n xhr.addEventListener('error', this._boundXhrOnError, false);\n xhr.addEventListener('timeout', this._boundXhrOnTimeout, false);\n xhr.addEventListener('abort', this._boundXhrOnAbort, false);\n xhr.addEventListener('progress', this._boundOnProgress, false);\n xhr.addEventListener('load', this._boundXhrOnLoad, false);\n xhr.send();\n }\n /**\n * Loads this resources using an XDomainRequest. This is here because we need to support IE9 (gross).\n *\n * @private\n */\n ;\n\n _proto._loadXdr = function _loadXdr() {\n // if unset, determine the value\n if (typeof this.xhrType !== 'string') {\n this.xhrType = this._determineXhrType();\n }\n\n var xdr = this.xhr = new XDomainRequest(); // eslint-disable-line no-undef\n // XDomainRequest has a few quirks. Occasionally it will abort requests\n // A way to avoid this is to make sure ALL callbacks are set even if not used\n // More info here: http://stackoverflow.com/questions/15786966/xdomainrequest-aborts-post-on-ie-9\n\n xdr.timeout = this.timeout || 5000; // XDR needs a timeout value or it breaks in IE9\n\n xdr.onerror = this._boundXhrOnError;\n xdr.ontimeout = this._boundXhrOnTimeout;\n xdr.onprogress = this._boundOnProgress;\n xdr.onload = this._boundXhrOnLoad;\n xdr.open('GET', this.url, true); // Note: The xdr.send() call is wrapped in a timeout to prevent an\n // issue with the interface where some requests are lost if multiple\n // XDomainRequests are being sent at the same time.\n // Some info here: https://github.com/photonstorm/phaser/issues/1248\n\n setTimeout(function () {\n return xdr.send();\n }, 1);\n }\n /**\n * Creates a source used in loading via an element.\n *\n * @private\n * @param {string} type - The element type (video or audio).\n * @param {string} url - The source URL to load from.\n * @param {string} [mime] - The mime type of the video\n * @return {HTMLSourceElement} The source element.\n */\n ;\n\n _proto._createSource = function _createSource(type, url, mime) {\n if (!mime) {\n mime = type + \"/\" + this._getExtension(url);\n }\n\n var source = document.createElement('source');\n source.src = url;\n source.type = mime;\n return source;\n }\n /**\n * Called if a load errors out.\n *\n * @param {Event} event - The error event from the element that emits it.\n * @private\n */\n ;\n\n _proto._onError = function _onError(event) {\n this.abort(\"Failed to load element using: \" + event.target.nodeName);\n }\n /**\n * Called if a load progress event fires for an element or xhr/xdr.\n *\n * @private\n * @param {XMLHttpRequestProgressEvent|Event} event - Progress event.\n */\n ;\n\n _proto._onProgress = function _onProgress(event) {\n if (event && event.lengthComputable) {\n this.onProgress.dispatch(this, event.loaded / event.total);\n }\n }\n /**\n * Called if a timeout event fires for an element.\n *\n * @private\n */\n ;\n\n _proto._onTimeout = function _onTimeout() {\n this.abort(\"Load timed out.\");\n }\n /**\n * Called if an error event fires for xhr/xdr.\n *\n * @private\n */\n ;\n\n _proto._xhrOnError = function _xhrOnError() {\n var xhr = this.xhr;\n this.abort(reqType(xhr) + \" Request failed. Status: \" + xhr.status + \", text: \\\"\" + xhr.statusText + \"\\\"\");\n }\n /**\n * Called if an error event fires for xhr/xdr.\n *\n * @private\n */\n ;\n\n _proto._xhrOnTimeout = function _xhrOnTimeout() {\n var xhr = this.xhr;\n this.abort(reqType(xhr) + \" Request timed out.\");\n }\n /**\n * Called if an abort event fires for xhr/xdr.\n *\n * @private\n */\n ;\n\n _proto._xhrOnAbort = function _xhrOnAbort() {\n var xhr = this.xhr;\n this.abort(reqType(xhr) + \" Request was aborted by the user.\");\n }\n /**\n * Called when data successfully loads from an xhr/xdr request.\n *\n * @private\n * @param {XMLHttpRequestLoadEvent|Event} event - Load event\n */\n ;\n\n _proto._xhrOnLoad = function _xhrOnLoad() {\n var xhr = this.xhr;\n var text = '';\n var status = typeof xhr.status === 'undefined' ? STATUS_OK : xhr.status; // XDR has no `.status`, assume 200.\n // responseText is accessible only if responseType is '' or 'text' and on older browsers\n\n if (xhr.responseType === '' || xhr.responseType === 'text' || typeof xhr.responseType === 'undefined') {\n text = xhr.responseText;\n } // status can be 0 when using the `file://` protocol so we also check if a response is set.\n // If it has a response, we assume 200; otherwise a 0 status code with no contents is an aborted request.\n\n\n if (status === STATUS_NONE && (text.length > 0 || xhr.responseType === Resource.XHR_RESPONSE_TYPE.BUFFER)) {\n status = STATUS_OK;\n } // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request\n else if (status === STATUS_IE_BUG_EMPTY) {\n status = STATUS_EMPTY;\n }\n\n var statusType = status / 100 | 0;\n\n if (statusType === STATUS_TYPE_OK) {\n // if text, just return it\n if (this.xhrType === Resource.XHR_RESPONSE_TYPE.TEXT) {\n this.data = text;\n this.type = Resource.TYPE.TEXT;\n } // if json, parse into json object\n else if (this.xhrType === Resource.XHR_RESPONSE_TYPE.JSON) {\n try {\n this.data = JSON.parse(text);\n this.type = Resource.TYPE.JSON;\n } catch (e) {\n this.abort(\"Error trying to parse loaded json: \" + e);\n return;\n }\n } // if xml, parse into an xml document or div element\n else if (this.xhrType === Resource.XHR_RESPONSE_TYPE.DOCUMENT) {\n try {\n if (window.DOMParser) {\n var domparser = new DOMParser();\n this.data = domparser.parseFromString(text, 'text/xml');\n } else {\n var div = document.createElement('div');\n div.innerHTML = text;\n this.data = div;\n }\n\n this.type = Resource.TYPE.XML;\n } catch (e) {\n this.abort(\"Error trying to parse loaded xml: \" + e);\n return;\n }\n } // other types just return the response\n else {\n this.data = xhr.response || text;\n }\n } else {\n this.abort(\"[\" + xhr.status + \"] \" + xhr.statusText + \": \" + xhr.responseURL);\n return;\n }\n\n this.complete();\n }\n /**\n * Sets the `crossOrigin` property for this resource based on if the url\n * for this resource is cross-origin. If crossOrigin was manually set, this\n * function does nothing.\n *\n * @private\n * @param {string} url - The url to test.\n * @param {object} [loc=window.location] - The location object to test against.\n * @return {string} The crossOrigin value to use (or empty string for none).\n */\n ;\n\n _proto._determineCrossOrigin = function _determineCrossOrigin(url, loc) {\n // data: and javascript: urls are considered same-origin\n if (url.indexOf('data:') === 0) {\n return '';\n } // A sandboxed iframe without the 'allow-same-origin' attribute will have a special\n // origin designed not to match window.location.origin, and will always require\n // crossOrigin requests regardless of whether the location matches.\n\n\n if (window.origin !== window.location.origin) {\n return 'anonymous';\n } // default is window.location\n\n\n loc = loc || window.location;\n\n if (!tempAnchor) {\n tempAnchor = document.createElement('a');\n } // let the browser determine the full href for the url of this resource and then\n // parse with the node url lib, we can't use the properties of the anchor element\n // because they don't work in IE9 :(\n\n\n tempAnchor.href = url;\n url = parseUri(tempAnchor.href, {\n strictMode: true\n });\n var samePort = !url.port && loc.port === '' || url.port === loc.port;\n var protocol = url.protocol ? url.protocol + \":\" : ''; // if cross origin\n\n if (url.host !== loc.hostname || !samePort || protocol !== loc.protocol) {\n return 'anonymous';\n }\n\n return '';\n }\n /**\n * Determines the responseType of an XHR request based on the extension of the\n * resource being loaded.\n *\n * @private\n * @return {Resource.XHR_RESPONSE_TYPE} The responseType to use.\n */\n ;\n\n _proto._determineXhrType = function _determineXhrType() {\n return Resource._xhrTypeMap[this.extension] || Resource.XHR_RESPONSE_TYPE.TEXT;\n }\n /**\n * Determines the loadType of a resource based on the extension of the\n * resource being loaded.\n *\n * @private\n * @return {Resource.LOAD_TYPE} The loadType to use.\n */\n ;\n\n _proto._determineLoadType = function _determineLoadType() {\n return Resource._loadTypeMap[this.extension] || Resource.LOAD_TYPE.XHR;\n }\n /**\n * Extracts the extension (sans '.') of the file being loaded by the resource.\n *\n * @private\n * @return {string} The extension.\n */\n ;\n\n _proto._getExtension = function _getExtension() {\n var url = this.url;\n var ext = '';\n\n if (this.isDataUrl) {\n var slashIndex = url.indexOf('/');\n ext = url.substring(slashIndex + 1, url.indexOf(';', slashIndex));\n } else {\n var queryStart = url.indexOf('?');\n var hashStart = url.indexOf('#');\n var index = Math.min(queryStart > -1 ? queryStart : url.length, hashStart > -1 ? hashStart : url.length);\n url = url.substring(0, index);\n ext = url.substring(url.lastIndexOf('.') + 1);\n }\n\n return ext.toLowerCase();\n }\n /**\n * Determines the mime type of an XHR request based on the responseType of\n * resource being loaded.\n *\n * @private\n * @param {Resource.XHR_RESPONSE_TYPE} type - The type to get a mime type for.\n * @return {string} The mime type to use.\n */\n ;\n\n _proto._getMimeFromXhrType = function _getMimeFromXhrType(type) {\n switch (type) {\n case Resource.XHR_RESPONSE_TYPE.BUFFER:\n return 'application/octet-binary';\n\n case Resource.XHR_RESPONSE_TYPE.BLOB:\n return 'application/blob';\n\n case Resource.XHR_RESPONSE_TYPE.DOCUMENT:\n return 'application/xml';\n\n case Resource.XHR_RESPONSE_TYPE.JSON:\n return 'application/json';\n\n case Resource.XHR_RESPONSE_TYPE.DEFAULT:\n case Resource.XHR_RESPONSE_TYPE.TEXT:\n /* falls through */\n\n default:\n return 'text/plain';\n }\n };\n\n _createClass(Resource, [{\n key: \"isDataUrl\",\n get: function get() {\n return this._hasFlag(Resource.STATUS_FLAGS.DATA_URL);\n }\n /**\n * Describes if this resource has finished loading. Is true when the resource has completely\n * loaded.\n *\n * @readonly\n * @member {boolean}\n */\n\n }, {\n key: \"isComplete\",\n get: function get() {\n return this._hasFlag(Resource.STATUS_FLAGS.COMPLETE);\n }\n /**\n * Describes if this resource is currently loading. Is true when the resource starts loading,\n * and is false again when complete.\n *\n * @readonly\n * @member {boolean}\n */\n\n }, {\n key: \"isLoading\",\n get: function get() {\n return this._hasFlag(Resource.STATUS_FLAGS.LOADING);\n }\n }]);\n\n return Resource;\n}();\n/**\n * The types of resources a resource could represent.\n *\n * @static\n * @readonly\n * @enum {number}\n */\n\n\nResource.STATUS_FLAGS = {\n NONE: 0,\n DATA_URL: 1 << 0,\n COMPLETE: 1 << 1,\n LOADING: 1 << 2\n};\n/**\n * The types of resources a resource could represent.\n *\n * @static\n * @readonly\n * @enum {number}\n */\n\nResource.TYPE = {\n UNKNOWN: 0,\n JSON: 1,\n XML: 2,\n IMAGE: 3,\n AUDIO: 4,\n VIDEO: 5,\n TEXT: 6\n};\n/**\n * The types of loading a resource can use.\n *\n * @static\n * @readonly\n * @enum {number}\n */\n\nResource.LOAD_TYPE = {\n /** Uses XMLHttpRequest to load the resource. */\n XHR: 1,\n\n /** Uses an `Image` object to load the resource. */\n IMAGE: 2,\n\n /** Uses an `Audio` object to load the resource. */\n AUDIO: 3,\n\n /** Uses a `Video` object to load the resource. */\n VIDEO: 4\n};\n/**\n * The XHR ready states, used internally.\n *\n * @static\n * @readonly\n * @enum {string}\n */\n\nResource.XHR_RESPONSE_TYPE = {\n /** string */\n DEFAULT: 'text',\n\n /** ArrayBuffer */\n BUFFER: 'arraybuffer',\n\n /** Blob */\n BLOB: 'blob',\n\n /** Document */\n DOCUMENT: 'document',\n\n /** Object */\n JSON: 'json',\n\n /** String */\n TEXT: 'text'\n};\nResource._loadTypeMap = {\n // images\n gif: Resource.LOAD_TYPE.IMAGE,\n png: Resource.LOAD_TYPE.IMAGE,\n bmp: Resource.LOAD_TYPE.IMAGE,\n jpg: Resource.LOAD_TYPE.IMAGE,\n jpeg: Resource.LOAD_TYPE.IMAGE,\n tif: Resource.LOAD_TYPE.IMAGE,\n tiff: Resource.LOAD_TYPE.IMAGE,\n webp: Resource.LOAD_TYPE.IMAGE,\n tga: Resource.LOAD_TYPE.IMAGE,\n svg: Resource.LOAD_TYPE.IMAGE,\n 'svg+xml': Resource.LOAD_TYPE.IMAGE,\n // for SVG data urls\n // audio\n mp3: Resource.LOAD_TYPE.AUDIO,\n ogg: Resource.LOAD_TYPE.AUDIO,\n wav: Resource.LOAD_TYPE.AUDIO,\n // videos\n mp4: Resource.LOAD_TYPE.VIDEO,\n webm: Resource.LOAD_TYPE.VIDEO\n};\nResource._xhrTypeMap = {\n // xml\n xhtml: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n html: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n htm: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n xml: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n tmx: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n svg: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n // This was added to handle Tiled Tileset XML, but .tsx is also a TypeScript React Component.\n // Since it is way less likely for people to be loading TypeScript files instead of Tiled files,\n // this should probably be fine.\n tsx: Resource.XHR_RESPONSE_TYPE.DOCUMENT,\n // images\n gif: Resource.XHR_RESPONSE_TYPE.BLOB,\n png: Resource.XHR_RESPONSE_TYPE.BLOB,\n bmp: Resource.XHR_RESPONSE_TYPE.BLOB,\n jpg: Resource.XHR_RESPONSE_TYPE.BLOB,\n jpeg: Resource.XHR_RESPONSE_TYPE.BLOB,\n tif: Resource.XHR_RESPONSE_TYPE.BLOB,\n tiff: Resource.XHR_RESPONSE_TYPE.BLOB,\n webp: Resource.XHR_RESPONSE_TYPE.BLOB,\n tga: Resource.XHR_RESPONSE_TYPE.BLOB,\n // json\n json: Resource.XHR_RESPONSE_TYPE.JSON,\n // text\n text: Resource.XHR_RESPONSE_TYPE.TEXT,\n txt: Resource.XHR_RESPONSE_TYPE.TEXT,\n // fonts\n ttf: Resource.XHR_RESPONSE_TYPE.BUFFER,\n otf: Resource.XHR_RESPONSE_TYPE.BUFFER\n}; // We can't set the `src` attribute to empty string, so on abort we set it to this 1px transparent gif\n\nResource.EMPTY_GIF = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';\n/**\n * Quick helper to set a value on one of the extension maps. Ensures there is no\n * dot at the start of the extension.\n *\n * @ignore\n * @param {object} map - The map to set on.\n * @param {string} extname - The extension (or key) to set.\n * @param {number} val - The value to set.\n */\n\nfunction setExtMap(map, extname, val) {\n if (extname && extname.indexOf('.') === 0) {\n extname = extname.substring(1);\n }\n\n if (!extname) {\n return;\n }\n\n map[extname] = val;\n}\n/**\n * Quick helper to get string xhr type.\n *\n * @ignore\n * @param {XMLHttpRequest|XDomainRequest} xhr - The request to check.\n * @return {string} The type.\n */\n\n\nfunction reqType(xhr) {\n return xhr.toString().replace('object ', '');\n}\n\nvar _keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n/**\n * Encodes binary into base64.\n *\n * @function encodeBinary\n * @param {string} input The input data to encode.\n * @returns {string} The encoded base64 string\n */\n\nfunction encodeBinary(input) {\n var output = '';\n var inx = 0;\n\n while (inx < input.length) {\n // Fill byte buffer array\n var bytebuffer = [0, 0, 0];\n var encodedCharIndexes = [0, 0, 0, 0];\n\n for (var jnx = 0; jnx < bytebuffer.length; ++jnx) {\n if (inx < input.length) {\n // throw away high-order byte, as documented at:\n // https://developer.mozilla.org/En/Using_XMLHttpRequest#Handling_binary_data\n bytebuffer[jnx] = input.charCodeAt(inx++) & 0xff;\n } else {\n bytebuffer[jnx] = 0;\n }\n } // Get each encoded character, 6 bits at a time\n // index 1: first 6 bits\n\n\n encodedCharIndexes[0] = bytebuffer[0] >> 2; // index 2: second 6 bits (2 least significant bits from input byte 1 + 4 most significant bits from byte 2)\n\n encodedCharIndexes[1] = (bytebuffer[0] & 0x3) << 4 | bytebuffer[1] >> 4; // index 3: third 6 bits (4 least significant bits from input byte 2 + 2 most significant bits from byte 3)\n\n encodedCharIndexes[2] = (bytebuffer[1] & 0x0f) << 2 | bytebuffer[2] >> 6; // index 3: forth 6 bits (6 least significant bits from input byte 3)\n\n encodedCharIndexes[3] = bytebuffer[2] & 0x3f; // Determine whether padding happened, and adjust accordingly\n\n var paddingBytes = inx - (input.length - 1);\n\n switch (paddingBytes) {\n case 2:\n // Set last 2 characters to padding char\n encodedCharIndexes[3] = 64;\n encodedCharIndexes[2] = 64;\n break;\n\n case 1:\n // Set last character to padding char\n encodedCharIndexes[3] = 64;\n break;\n\n default:\n break;\n // No padding - proceed\n } // Now we will grab each appropriate character out of our keystring\n // based on our index array and append it to the output string\n\n\n for (var _jnx = 0; _jnx < encodedCharIndexes.length; ++_jnx) {\n output += _keyStr.charAt(encodedCharIndexes[_jnx]);\n }\n }\n\n return output;\n}\n\nvar Url = window.URL || window.webkitURL;\n/**\n * A middleware for transforming XHR loaded Blobs into more useful objects\n *\n * @memberof middleware\n * @function parsing\n * @example\n * import { Loader, middleware } from 'resource-loader';\n * const loader = new Loader();\n * loader.use(middleware.parsing);\n * @param {Resource} resource - Current Resource\n * @param {function} next - Callback when complete\n */\n\nfunction parsing(resource, next) {\n if (!resource.data) {\n next();\n return;\n } // if this was an XHR load of a blob\n\n\n if (resource.xhr && resource.xhrType === Resource.XHR_RESPONSE_TYPE.BLOB) {\n // if there is no blob support we probably got a binary string back\n if (!window.Blob || typeof resource.data === 'string') {\n var type = resource.xhr.getResponseHeader('content-type'); // this is an image, convert the binary string into a data url\n\n if (type && type.indexOf('image') === 0) {\n resource.data = new Image();\n resource.data.src = \"data:\" + type + \";base64,\" + encodeBinary(resource.xhr.responseText);\n resource.type = Resource.TYPE.IMAGE; // wait until the image loads and then callback\n\n resource.data.onload = function () {\n resource.data.onload = null;\n next();\n }; // next will be called on load\n\n\n return;\n }\n } // if content type says this is an image, then we should transform the blob into an Image object\n else if (resource.data.type.indexOf('image') === 0) {\n var src = Url.createObjectURL(resource.data);\n resource.blob = resource.data;\n resource.data = new Image();\n resource.data.src = src;\n resource.type = Resource.TYPE.IMAGE; // cleanup the no longer used blob after the image loads\n // TODO: Is this correct? Will the image be invalid after revoking?\n\n resource.data.onload = function () {\n Url.revokeObjectURL(src);\n resource.data.onload = null;\n next();\n }; // next will be called on load.\n\n\n return;\n }\n }\n\n next();\n}\n\n/**\n * @namespace middleware\n */\n\nvar index = ({\n caching: caching,\n parsing: parsing\n});\n\nvar MAX_PROGRESS = 100;\nvar rgxExtractUrlHash = /(#[\\w-]+)?$/;\n/**\n * Manages the state and loading of multiple resources to load.\n *\n * @class\n */\n\nvar Loader =\n/*#__PURE__*/\nfunction () {\n /**\n * @param {string} [baseUrl=''] - The base url for all resources loaded by this loader.\n * @param {number} [concurrency=10] - The number of resources to load concurrently.\n */\n function Loader(baseUrl, concurrency) {\n var _this = this;\n\n if (baseUrl === void 0) {\n baseUrl = '';\n }\n\n if (concurrency === void 0) {\n concurrency = 10;\n }\n\n /**\n * The base url for all resources loaded by this loader.\n *\n * @member {string}\n */\n this.baseUrl = baseUrl;\n /**\n * The progress percent of the loader going through the queue.\n *\n * @member {number}\n * @default 0\n */\n\n this.progress = 0;\n /**\n * Loading state of the loader, true if it is currently loading resources.\n *\n * @member {boolean}\n * @default false\n */\n\n this.loading = false;\n /**\n * A querystring to append to every URL added to the loader.\n *\n * This should be a valid query string *without* the question-mark (`?`). The loader will\n * also *not* escape values for you. Make sure to escape your parameters with\n * [`encodeURIComponent`](https://mdn.io/encodeURIComponent) before assigning this property.\n *\n * @example\n * const loader = new Loader();\n *\n * loader.defaultQueryString = 'user=me&password=secret';\n *\n * // This will request 'image.png?user=me&password=secret'\n * loader.add('image.png').load();\n *\n * loader.reset();\n *\n * // This will request 'image.png?v=1&user=me&password=secret'\n * loader.add('iamge.png?v=1').load();\n *\n * @member {string}\n * @default ''\n */\n\n this.defaultQueryString = '';\n /**\n * The middleware to run before loading each resource.\n *\n * @private\n * @member {function[]}\n */\n\n this._beforeMiddleware = [];\n /**\n * The middleware to run after loading each resource.\n *\n * @private\n * @member {function[]}\n */\n\n this._afterMiddleware = [];\n /**\n * The tracks the resources we are currently completing parsing for.\n *\n * @private\n * @member {Resource[]}\n */\n\n this._resourcesParsing = [];\n /**\n * The `_loadResource` function bound with this object context.\n *\n * @private\n * @member {function}\n * @param {Resource} r - The resource to load\n * @param {Function} d - The dequeue function\n * @return {undefined}\n */\n\n this._boundLoadResource = function (r, d) {\n return _this._loadResource(r, d);\n };\n /**\n * The resources waiting to be loaded.\n *\n * @private\n * @member {Resource[]}\n */\n\n\n this._queue = queue(this._boundLoadResource, concurrency);\n\n this._queue.pause();\n /**\n * All the resources for this loader keyed by name.\n *\n * @member {object}\n */\n\n\n this.resources = {};\n /**\n * Dispatched once per loaded or errored resource.\n *\n * The callback looks like {@link Loader.OnProgressSignal}.\n *\n * @member {Signal}\n */\n\n this.onProgress = new Signal();\n /**\n * Dispatched once per errored resource.\n *\n * The callback looks like {@link Loader.OnErrorSignal}.\n *\n * @member {Signal}\n */\n\n this.onError = new Signal();\n /**\n * Dispatched once per loaded resource.\n *\n * The callback looks like {@link Loader.OnLoadSignal}.\n *\n * @member {Signal}\n */\n\n this.onLoad = new Signal();\n /**\n * Dispatched when the loader begins to process the queue.\n *\n * The callback looks like {@link Loader.OnStartSignal}.\n *\n * @member {Signal}\n */\n\n this.onStart = new Signal();\n /**\n * Dispatched when the queued resources all load.\n *\n * The callback looks like {@link Loader.OnCompleteSignal}.\n *\n * @member {Signal}\n */\n\n this.onComplete = new Signal(); // Add default before middleware\n\n for (var i = 0; i < Loader._defaultBeforeMiddleware.length; ++i) {\n this.pre(Loader._defaultBeforeMiddleware[i]);\n } // Add default after middleware\n\n\n for (var _i = 0; _i < Loader._defaultAfterMiddleware.length; ++_i) {\n this.use(Loader._defaultAfterMiddleware[_i]);\n }\n }\n /**\n * When the progress changes the loader and resource are disaptched.\n *\n * @memberof Loader\n * @callback OnProgressSignal\n * @param {Loader} loader - The loader the progress is advancing on.\n * @param {Resource} resource - The resource that has completed or failed to cause the progress to advance.\n */\n\n /**\n * When an error occurrs the loader and resource are disaptched.\n *\n * @memberof Loader\n * @callback OnErrorSignal\n * @param {Loader} loader - The loader the error happened in.\n * @param {Resource} resource - The resource that caused the error.\n */\n\n /**\n * When a load completes the loader and resource are disaptched.\n *\n * @memberof Loader\n * @callback OnLoadSignal\n * @param {Loader} loader - The loader that laoded the resource.\n * @param {Resource} resource - The resource that has completed loading.\n */\n\n /**\n * When the loader starts loading resources it dispatches this callback.\n *\n * @memberof Loader\n * @callback OnStartSignal\n * @param {Loader} loader - The loader that has started loading resources.\n */\n\n /**\n * When the loader completes loading resources it dispatches this callback.\n *\n * @memberof Loader\n * @callback OnCompleteSignal\n * @param {Loader} loader - The loader that has finished loading resources.\n */\n\n /**\n * Options for a call to `.add()`.\n *\n * @see Loader#add\n *\n * @typedef {object} IAddOptions\n * @property {string} [name] - The name of the resource to load, if not passed the url is used.\n * @property {string} [key] - Alias for `name`.\n * @property {string} [url] - The url for this resource, relative to the baseUrl of this loader.\n * @property {string|boolean} [crossOrigin] - Is this request cross-origin? Default is to\n * determine automatically.\n * @property {number} [timeout=0] - A timeout in milliseconds for the load. If the load takes\n * longer than this time it is cancelled and the load is considered a failure. If this value is\n * set to `0` then there is no explicit timeout.\n * @property {Resource.LOAD_TYPE} [loadType=Resource.LOAD_TYPE.XHR] - How should this resource\n * be loaded?\n * @property {Resource.XHR_RESPONSE_TYPE} [xhrType=Resource.XHR_RESPONSE_TYPE.DEFAULT] - How\n * should the data being loaded be interpreted when using XHR?\n * @property {Resource.OnCompleteSignal} [onComplete] - Callback to add an an onComplete signal istener.\n * @property {Resource.OnCompleteSignal} [callback] - Alias for `onComplete`.\n * @property {Resource.IMetadata} [metadata] - Extra configuration for middleware and the Resource object.\n */\n\n /* eslint-disable require-jsdoc,valid-jsdoc */\n\n /**\n * Adds a resource (or multiple resources) to the loader queue.\n *\n * This function can take a wide variety of different parameters. The only thing that is always\n * required the url to load. All the following will work:\n *\n * ```js\n * loader\n * // normal param syntax\n * .add('key', 'http://...', function () {})\n * .add('http://...', function () {})\n * .add('http://...')\n *\n * // object syntax\n * .add({\n * name: 'key2',\n * url: 'http://...'\n * }, function () {})\n * .add({\n * url: 'http://...'\n * }, function () {})\n * .add({\n * name: 'key3',\n * url: 'http://...'\n * onComplete: function () {}\n * })\n * .add({\n * url: 'https://...',\n * onComplete: function () {},\n * crossOrigin: true\n * })\n *\n * // you can also pass an array of objects or urls or both\n * .add([\n * { name: 'key4', url: 'http://...', onComplete: function () {} },\n * { url: 'http://...', onComplete: function () {} },\n * 'http://...'\n * ])\n *\n * // and you can use both params and options\n * .add('key', 'http://...', { crossOrigin: true }, function () {})\n * .add('http://...', { crossOrigin: true }, function () {});\n * ```\n *\n * @function\n * @variation 1\n * @param {string} name - The name of the resource to load.\n * @param {string} url - The url for this resource, relative to the baseUrl of this loader.\n * @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading.\n * @return {this} Returns itself.\n */\n\n /**\n * @function\n * @variation 2\n * @param {string} name - The name of the resource to load.\n * @param {string} url - The url for this resource, relative to the baseUrl of this loader.\n * @param {IAddOptions} [options] - The options for the load.\n * @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading.\n * @return {this} Returns itself.\n */\n\n /**\n * @function\n * @variation 3\n * @param {string} url - The url for this resource, relative to the baseUrl of this loader.\n * @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading.\n * @return {this} Returns itself.\n */\n\n /**\n * @function\n * @variation 4\n * @param {string} url - The url for this resource, relative to the baseUrl of this loader.\n * @param {IAddOptions} [options] - The options for the load.\n * @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading.\n * @return {this} Returns itself.\n */\n\n /**\n * @function\n * @variation 5\n * @param {IAddOptions} options - The options for the load. This object must contain a `url` property.\n * @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading.\n * @return {this} Returns itself.\n */\n\n /**\n * @function\n * @variation 6\n * @param {Array} resources - An array of resources to load, where each is\n * either an object with the options or a string url. If you pass an object, it must contain a `url` property.\n * @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading.\n * @return {this} Returns itself.\n */\n\n\n var _proto = Loader.prototype;\n\n _proto.add = function add(name, url, options, cb) {\n // special case of an array of objects or urls\n if (Array.isArray(name)) {\n for (var i = 0; i < name.length; ++i) {\n this.add(name[i]);\n }\n\n return this;\n } // if an object is passed instead of params\n\n\n if (typeof name === 'object') {\n cb = url || name.callback || name.onComplete;\n options = name;\n url = name.url;\n name = name.name || name.key || name.url;\n } // case where no name is passed shift all args over by one.\n\n\n if (typeof url !== 'string') {\n cb = options;\n options = url;\n url = name;\n } // now that we shifted make sure we have a proper url.\n\n\n if (typeof url !== 'string') {\n throw new Error('No url passed to add resource to loader.');\n } // options are optional so people might pass a function and no options\n\n\n if (typeof options === 'function') {\n cb = options;\n options = null;\n } // if loading already you can only add resources that have a parent.\n\n\n if (this.loading && (!options || !options.parentResource)) {\n throw new Error('Cannot add resources while the loader is running.');\n } // check if resource already exists.\n\n\n if (this.resources[name]) {\n throw new Error(\"Resource named \\\"\" + name + \"\\\" already exists.\");\n } // add base url if this isn't an absolute url\n\n\n url = this._prepareUrl(url); // create the store the resource\n\n this.resources[name] = new Resource(name, url, options);\n\n if (typeof cb === 'function') {\n this.resources[name].onAfterMiddleware.once(cb);\n } // if actively loading, make sure to adjust progress chunks for that parent and its children\n\n\n if (this.loading) {\n var parent = options.parentResource;\n var incompleteChildren = [];\n\n for (var _i2 = 0; _i2 < parent.children.length; ++_i2) {\n if (!parent.children[_i2].isComplete) {\n incompleteChildren.push(parent.children[_i2]);\n }\n }\n\n var fullChunk = parent.progressChunk * (incompleteChildren.length + 1); // +1 for parent\n\n var eachChunk = fullChunk / (incompleteChildren.length + 2); // +2 for parent & new child\n\n parent.children.push(this.resources[name]);\n parent.progressChunk = eachChunk;\n\n for (var _i3 = 0; _i3 < incompleteChildren.length; ++_i3) {\n incompleteChildren[_i3].progressChunk = eachChunk;\n }\n\n this.resources[name].progressChunk = eachChunk;\n } // add the resource to the queue\n\n\n this._queue.push(this.resources[name]);\n\n return this;\n }\n /* eslint-enable require-jsdoc,valid-jsdoc */\n\n /**\n * Sets up a middleware function that will run *before* the\n * resource is loaded.\n *\n * @param {function} fn - The middleware function to register.\n * @return {this} Returns itself.\n */\n ;\n\n _proto.pre = function pre(fn) {\n this._beforeMiddleware.push(fn);\n\n return this;\n }\n /**\n * Sets up a middleware function that will run *after* the\n * resource is loaded.\n *\n * @param {function} fn - The middleware function to register.\n * @return {this} Returns itself.\n */\n ;\n\n _proto.use = function use(fn) {\n this._afterMiddleware.push(fn);\n\n return this;\n }\n /**\n * Resets the queue of the loader to prepare for a new load.\n *\n * @return {this} Returns itself.\n */\n ;\n\n _proto.reset = function reset() {\n this.progress = 0;\n this.loading = false;\n\n this._queue.kill();\n\n this._queue.pause(); // abort all resource loads\n\n\n for (var k in this.resources) {\n var res = this.resources[k];\n\n if (res._onLoadBinding) {\n res._onLoadBinding.detach();\n }\n\n if (res.isLoading) {\n res.abort();\n }\n }\n\n this.resources = {};\n return this;\n }\n /**\n * Starts loading the queued resources.\n *\n * @param {function} [cb] - Optional callback that will be bound to the `complete` event.\n * @return {this} Returns itself.\n */\n ;\n\n _proto.load = function load(cb) {\n // register complete callback if they pass one\n if (typeof cb === 'function') {\n this.onComplete.once(cb);\n } // if the queue has already started we are done here\n\n\n if (this.loading) {\n return this;\n }\n\n if (this._queue.idle()) {\n this._onStart();\n\n this._onComplete();\n } else {\n // distribute progress chunks\n var numTasks = this._queue._tasks.length;\n var chunk = MAX_PROGRESS / numTasks;\n\n for (var i = 0; i < this._queue._tasks.length; ++i) {\n this._queue._tasks[i].data.progressChunk = chunk;\n } // notify we are starting\n\n\n this._onStart(); // start loading\n\n\n this._queue.resume();\n }\n\n return this;\n }\n /**\n * The number of resources to load concurrently.\n *\n * @member {number}\n * @default 10\n */\n ;\n\n /**\n * Prepares a url for usage based on the configuration of this object\n *\n * @private\n * @param {string} url - The url to prepare.\n * @return {string} The prepared url.\n */\n _proto._prepareUrl = function _prepareUrl(url) {\n var parsedUrl = parseUri(url, {\n strictMode: true\n });\n var result; // absolute url, just use it as is.\n\n if (parsedUrl.protocol || !parsedUrl.path || url.indexOf('//') === 0) {\n result = url;\n } // if baseUrl doesn't end in slash and url doesn't start with slash, then add a slash inbetween\n else if (this.baseUrl.length && this.baseUrl.lastIndexOf('/') !== this.baseUrl.length - 1 && url.charAt(0) !== '/') {\n result = this.baseUrl + \"/\" + url;\n } else {\n result = this.baseUrl + url;\n } // if we need to add a default querystring, there is a bit more work\n\n\n if (this.defaultQueryString) {\n var hash = rgxExtractUrlHash.exec(result)[0];\n result = result.substr(0, result.length - hash.length);\n\n if (result.indexOf('?') !== -1) {\n result += \"&\" + this.defaultQueryString;\n } else {\n result += \"?\" + this.defaultQueryString;\n }\n\n result += hash;\n }\n\n return result;\n }\n /**\n * Loads a single resource.\n *\n * @private\n * @param {Resource} resource - The resource to load.\n * @param {function} dequeue - The function to call when we need to dequeue this item.\n */\n ;\n\n _proto._loadResource = function _loadResource(resource, dequeue) {\n var _this2 = this;\n\n resource._dequeue = dequeue; // run before middleware\n\n eachSeries(this._beforeMiddleware, function (fn, next) {\n fn.call(_this2, resource, function () {\n // if the before middleware marks the resource as complete,\n // break and don't process any more before middleware\n next(resource.isComplete ? {} : null);\n });\n }, function () {\n if (resource.isComplete) {\n _this2._onLoad(resource);\n } else {\n resource._onLoadBinding = resource.onComplete.once(_this2._onLoad, _this2);\n resource.load();\n }\n }, true);\n }\n /**\n * Called once loading has started.\n *\n * @private\n */\n ;\n\n _proto._onStart = function _onStart() {\n this.progress = 0;\n this.loading = true;\n this.onStart.dispatch(this);\n }\n /**\n * Called once each resource has loaded.\n *\n * @private\n */\n ;\n\n _proto._onComplete = function _onComplete() {\n this.progress = MAX_PROGRESS;\n this.loading = false;\n this.onComplete.dispatch(this, this.resources);\n }\n /**\n * Called each time a resources is loaded.\n *\n * @private\n * @param {Resource} resource - The resource that was loaded\n */\n ;\n\n _proto._onLoad = function _onLoad(resource) {\n var _this3 = this;\n\n resource._onLoadBinding = null; // remove this resource from the async queue, and add it to our list of resources that are being parsed\n\n this._resourcesParsing.push(resource);\n\n resource._dequeue(); // run all the after middleware for this resource\n\n\n eachSeries(this._afterMiddleware, function (fn, next) {\n fn.call(_this3, resource, next);\n }, function () {\n resource.onAfterMiddleware.dispatch(resource);\n _this3.progress = Math.min(MAX_PROGRESS, _this3.progress + resource.progressChunk);\n\n _this3.onProgress.dispatch(_this3, resource);\n\n if (resource.error) {\n _this3.onError.dispatch(resource.error, _this3, resource);\n } else {\n _this3.onLoad.dispatch(_this3, resource);\n }\n\n _this3._resourcesParsing.splice(_this3._resourcesParsing.indexOf(resource), 1); // do completion check\n\n\n if (_this3._queue.idle() && _this3._resourcesParsing.length === 0) {\n _this3._onComplete();\n }\n }, true);\n };\n\n _createClass(Loader, [{\n key: \"concurrency\",\n get: function get() {\n return this._queue.concurrency;\n } // eslint-disable-next-line require-jsdoc\n ,\n set: function set(concurrency) {\n this._queue.concurrency = concurrency;\n }\n }]);\n\n return Loader;\n}();\n/**\n * A default array of middleware to run before loading each resource.\n * Each of these middlewares are added to any new Loader instances when they are created.\n *\n * @private\n * @member {function[]}\n */\n\n\nLoader._defaultBeforeMiddleware = [];\n/**\n * A default array of middleware to run after loading each resource.\n * Each of these middlewares are added to any new Loader instances when they are created.\n *\n * @private\n * @member {function[]}\n */\n\nLoader._defaultAfterMiddleware = [];\n/**\n * Sets up a middleware function that will run *before* the\n * resource is loaded.\n *\n * @static\n * @param {function} fn - The middleware function to register.\n * @return {Loader} Returns itself.\n */\n\nLoader.pre = function LoaderPreStatic(fn) {\n Loader._defaultBeforeMiddleware.push(fn);\n\n return Loader;\n};\n/**\n * Sets up a middleware function that will run *after* the\n * resource is loaded.\n *\n * @static\n * @param {function} fn - The middleware function to register.\n * @return {Loader} Returns itself.\n */\n\n\nLoader.use = function LoaderUseStatic(fn) {\n Loader._defaultAfterMiddleware.push(fn);\n\n return Loader;\n};\n\nexport { Loader, Resource, async, encodeBinary, index as middleware };\n//# sourceMappingURL=resource-loader.esm.js.map\n","/*!\n * @pixi/loaders - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/loaders is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Resource, Loader as Loader$1, middleware } from 'resource-loader';\nimport { Texture } from '@pixi/core';\n\n/**\n* Reference to **{@link https://github.com/englercj/resource-loader\n* resource-loader}**'s Resource class.\n* @see http://englercj.github.io/resource-loader/Resource.html\n* @class LoaderResource\n* @memberof PIXI\n*/\nvar LoaderResource = Resource;\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * Loader plugin for handling Texture resources.\n * @class\n * @memberof PIXI\n * @implements PIXI.ILoaderPlugin\n */\nvar TextureLoader = /** @class */ (function () {\n function TextureLoader() {\n }\n /**\n * Called after a resource is loaded.\n * @see PIXI.Loader.loaderMiddleware\n * @param {PIXI.LoaderResource} resource\n * @param {function} next\n */\n TextureLoader.use = function (resource, next) {\n // create a new texture if the data is an Image object\n if (resource.data && resource.type === Resource.TYPE.IMAGE) {\n resource.texture = Texture.fromLoader(resource.data, resource.url, resource.name);\n }\n next();\n };\n return TextureLoader;\n}());\n\n/**\n * The new loader, extends Resource Loader by Chad Engler: https://github.com/englercj/resource-loader\n *\n * ```js\n * const loader = PIXI.Loader.shared; // PixiJS exposes a premade instance for you to use.\n * //or\n * const loader = new PIXI.Loader(); // you can also create your own if you want\n *\n * const sprites = {};\n *\n * // Chainable `add` to enqueue a resource\n * loader.add('bunny', 'data/bunny.png')\n * .add('spaceship', 'assets/spritesheet.json');\n * loader.add('scoreFont', 'assets/score.fnt');\n *\n * // Chainable `pre` to add a middleware that runs for each resource, *before* loading that resource.\n * // This is useful to implement custom caching modules (using filesystem, indexeddb, memory, etc).\n * loader.pre(cachingMiddleware);\n *\n * // Chainable `use` to add a middleware that runs for each resource, *after* loading that resource.\n * // This is useful to implement custom parsing modules (like spritesheet parsers, spine parser, etc).\n * loader.use(parsingMiddleware);\n *\n * // The `load` method loads the queue of resources, and calls the passed in callback called once all\n * // resources have loaded.\n * loader.load((loader, resources) => {\n * // resources is an object where the key is the name of the resource loaded and the value is the resource object.\n * // They have a couple default properties:\n * // - `url`: The URL that the resource was loaded from\n * // - `error`: The error that happened when trying to load (if any)\n * // - `data`: The raw data that was loaded\n * // also may contain other properties based on the middleware that runs.\n * sprites.bunny = new PIXI.TilingSprite(resources.bunny.texture);\n * sprites.spaceship = new PIXI.TilingSprite(resources.spaceship.texture);\n * sprites.scoreFont = new PIXI.TilingSprite(resources.scoreFont.texture);\n * });\n *\n * // throughout the process multiple signals can be dispatched.\n * loader.onProgress.add(() => {}); // called once per loaded/errored file\n * loader.onError.add(() => {}); // called once per errored file\n * loader.onLoad.add(() => {}); // called once per loaded file\n * loader.onComplete.add(() => {}); // called once when the queued resources all load.\n * ```\n *\n * @see https://github.com/englercj/resource-loader\n *\n * @class Loader\n * @memberof PIXI\n * @param {string} [baseUrl=''] - The base url for all resources loaded by this loader.\n * @param {number} [concurrency=10] - The number of resources to load concurrently.\n */\nvar Loader = /** @class */ (function (_super) {\n __extends(Loader, _super);\n function Loader(baseUrl, concurrency) {\n var _this = _super.call(this, baseUrl, concurrency) || this;\n for (var i = 0; i < Loader._plugins.length; ++i) {\n var plugin = Loader._plugins[i];\n var pre = plugin.pre, use = plugin.use;\n if (pre) {\n _this.pre(pre);\n }\n if (use) {\n _this.use(use);\n }\n }\n /**\n * If this loader cannot be destroyed.\n * @member {boolean}\n * @default false\n * @private\n */\n _this._protected = false;\n return _this;\n }\n /**\n * Destroy the loader, removes references.\n * @memberof PIXI.Loader#\n * @method destroy\n * @public\n */\n Loader.prototype.destroy = function () {\n if (!this._protected) {\n this.reset();\n }\n };\n Object.defineProperty(Loader, \"shared\", {\n /**\n * A premade instance of the loader that can be used to load resources.\n * @name shared\n * @type {PIXI.Loader}\n * @static\n * @memberof PIXI.Loader\n */\n get: function () {\n var shared = Loader._shared;\n if (!shared) {\n shared = new Loader();\n shared._protected = true;\n Loader._shared = shared;\n }\n return shared;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Adds a Loader plugin for the global shared loader and all\n * new Loader instances created.\n *\n * @static\n * @method registerPlugin\n * @memberof PIXI.Loader\n * @param {PIXI.ILoaderPlugin} plugin - The plugin to add\n * @return {PIXI.Loader} Reference to PIXI.Loader for chaining\n */\n Loader.registerPlugin = function (plugin) {\n Loader._plugins.push(plugin);\n if (plugin.add) {\n plugin.add();\n }\n return Loader;\n };\n /**\n * Collection of all installed `use` middleware for Loader.\n *\n * @static\n * @member {Array} _plugins\n * @memberof PIXI.Loader\n * @private\n */\n Loader._plugins = [];\n return Loader;\n}(Loader$1));\n// parse any blob into more usable objects (e.g. Image)\nLoader.registerPlugin({ use: middleware.parsing });\n// parse any Image objects into textures\nLoader.registerPlugin(TextureLoader);\n/**\n * Plugin to be installed for handling specific Loader resources.\n *\n * @memberof PIXI\n * @typedef {object} ILoaderPlugin\n * @property {function} [add] - Function to call immediate after registering plugin.\n * @property {PIXI.Loader.loaderMiddleware} [pre] - Middleware function to run before load, the\n * arguments for this are `(resource, next)`\n * @property {PIXI.Loader.loaderMiddleware} [use] - Middleware function to run after load, the\n * arguments for this are `(resource, next)`\n */\n/**\n * @memberof PIXI.Loader\n * @typedef {object} ICallbackID\n */\n/**\n * @memberof PIXI.Loader\n * @typedef {function} ISignalCallback\n * @param {function} callback - Callback function\n * @param {object} [context] - Context\n * @returns {ICallbackID} - CallbackID\n */\n/**\n * @memberof PIXI.Loader\n * @typedef {function} ISignalDetach\n * @param {ICallbackID} id - CallbackID returned by `add`/`once` methods\n */\n/**\n * @memberof PIXI.Loader\n * @typedef ILoaderSignal\n * @property {ISignalCallback} add - Register callback\n * @property {ISignalCallback} once - Register oneshot callback\n * @property {ISignalDetach} detach - Detach specific callback by ID\n */\n/**\n * @memberof PIXI.Loader\n * @callback loaderMiddleware\n * @param {PIXI.LoaderResource} resource\n * @param {function} next\n */\n/**\n * @memberof PIXI.Loader#\n * @description Dispatched when the loader begins to loading process.\n * @member {PIXI.Loader.ILoaderSignal} onStart\n */\n/**\n * @memberof PIXI.Loader#\n * @description Dispatched once per loaded or errored resource.\n * @member {PIXI.Loader.ILoaderSignal} onProgress\n */\n/**\n * @memberof PIXI.Loader#\n * @description Dispatched once per errored resource.\n * @member {PIXI.Loader.ILoaderSignal} onError\n */\n/**\n * @memberof PIXI.Loader#\n * @description Dispatched once per loaded resource.\n * @member {PIXI.Loader.ILoaderSignal} onLoad\n */\n/**\n * @memberof PIXI.Loader#\n * @description Dispatched when completely loaded all resources.\n * @member {PIXI.Loader.ILoaderSignal} onComplete\n */\n\n/**\n * Application plugin for supporting loader option. Installing the LoaderPlugin\n * is not necessary if using **pixi.js** or **pixi.js-legacy**.\n * @example\n * import {AppLoaderPlugin} from '@pixi/loaders';\n * import {Application} from '@pixi/app';\n * Application.registerPlugin(AppLoaderPlugin);\n * @class\n * @memberof PIXI\n */\nvar AppLoaderPlugin = /** @class */ (function () {\n function AppLoaderPlugin() {\n }\n /**\n * Called on application constructor\n * @param {object} options\n * @private\n */\n AppLoaderPlugin.init = function (options) {\n options = Object.assign({\n sharedLoader: false,\n }, options);\n /**\n * Loader instance to help with asset loading.\n * @name PIXI.Application#loader\n * @type {PIXI.Loader}\n * @readonly\n */\n this.loader = options.sharedLoader ? Loader.shared : new Loader();\n };\n /**\n * Called when application destroyed\n * @private\n */\n AppLoaderPlugin.destroy = function () {\n if (this.loader) {\n this.loader.destroy();\n this.loader = null;\n }\n };\n return AppLoaderPlugin;\n}());\n\nexport { AppLoaderPlugin, Loader, LoaderResource, TextureLoader };\n//# sourceMappingURL=loaders.es.js.map\n","/*!\n * @pixi/particles - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/particles is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { BLEND_MODES, TYPES } from '@pixi/constants';\nimport { Container } from '@pixi/display';\nimport { hex2rgb, createIndicesForQuads, correctBlendMode, premultiplyRgba, premultiplyTint } from '@pixi/utils';\nimport { Geometry, Buffer, Shader, State, ObjectRenderer } from '@pixi/core';\nimport { Matrix } from '@pixi/math';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * The ParticleContainer class is a really fast version of the Container built solely for speed,\n * so use when you need a lot of sprites or particles.\n *\n * The tradeoff of the ParticleContainer is that most advanced functionality will not work.\n * ParticleContainer implements the basic object transform (position, scale, rotation)\n * and some advanced functionality like tint (as of v4.5.6).\n *\n * Other more advanced functionality like masking, children, filters, etc will not work on sprites in this batch.\n *\n * It's extremely easy to use:\n * ```js\n * let container = new ParticleContainer();\n *\n * for (let i = 0; i < 100; ++i)\n * {\n * let sprite = PIXI.Sprite.from(\"myImage.png\");\n * container.addChild(sprite);\n * }\n * ```\n *\n * And here you have a hundred sprites that will be rendered at the speed of light.\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI\n */\nvar ParticleContainer = /** @class */ (function (_super) {\n __extends(ParticleContainer, _super);\n /**\n * @param {number} [maxSize=1500] - The maximum number of particles that can be rendered by the container.\n * Affects size of allocated buffers.\n * @param {object} [properties] - The properties of children that should be uploaded to the gpu and applied.\n * @param {boolean} [properties.vertices=false] - When true, vertices be uploaded and applied.\n * if sprite's ` scale/anchor/trim/frame/orig` is dynamic, please set `true`.\n * @param {boolean} [properties.position=true] - When true, position be uploaded and applied.\n * @param {boolean} [properties.rotation=false] - When true, rotation be uploaded and applied.\n * @param {boolean} [properties.uvs=false] - When true, uvs be uploaded and applied.\n * @param {boolean} [properties.tint=false] - When true, alpha and tint be uploaded and applied.\n * @param {number} [batchSize=16384] - Number of particles per batch. If less than maxSize, it uses maxSize instead.\n * @param {boolean} [autoResize=false] - If true, container allocates more batches in case\n * there are more than `maxSize` particles.\n */\n function ParticleContainer(maxSize, properties, batchSize, autoResize) {\n if (maxSize === void 0) { maxSize = 1500; }\n if (batchSize === void 0) { batchSize = 16384; }\n if (autoResize === void 0) { autoResize = false; }\n var _this = _super.call(this) || this;\n // Making sure the batch size is valid\n // 65535 is max vertex index in the index buffer (see ParticleRenderer)\n // so max number of particles is 65536 / 4 = 16384\n var maxBatchSize = 16384;\n if (batchSize > maxBatchSize) {\n batchSize = maxBatchSize;\n }\n /**\n * Set properties to be dynamic (true) / static (false)\n *\n * @member {boolean[]}\n * @private\n */\n _this._properties = [false, true, false, false, false];\n /**\n * @member {number}\n * @private\n */\n _this._maxSize = maxSize;\n /**\n * @member {number}\n * @private\n */\n _this._batchSize = batchSize;\n /**\n * @member {Array}\n * @private\n */\n _this._buffers = null;\n /**\n * for every batch stores _updateID corresponding to the last change in that batch\n * @member {number[]}\n * @private\n */\n _this._bufferUpdateIDs = [];\n /**\n * when child inserted, removed or changes position this number goes up\n * @member {number[]}\n * @private\n */\n _this._updateID = 0;\n /**\n * @member {boolean}\n *\n */\n _this.interactiveChildren = false;\n /**\n * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL`\n * to reset the blend mode.\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL\n * @see PIXI.BLEND_MODES\n */\n _this.blendMode = BLEND_MODES.NORMAL;\n /**\n * If true, container allocates more batches in case there are more than `maxSize` particles.\n * @member {boolean}\n * @default false\n */\n _this.autoResize = autoResize;\n /**\n * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.\n * Advantages can include sharper image quality (like text) and faster rendering on canvas.\n * The main disadvantage is movement of objects may appear less smooth.\n * Default to true here as performance is usually the priority for particles.\n *\n * @member {boolean}\n * @default true\n */\n _this.roundPixels = true;\n /**\n * The texture used to render the children.\n *\n * @readonly\n * @member {PIXI.BaseTexture}\n */\n _this.baseTexture = null;\n _this.setProperties(properties);\n /**\n * The tint applied to the container.\n * This is a hex value. A value of 0xFFFFFF will remove any tint effect.\n *\n * @private\n * @member {number}\n * @default 0xFFFFFF\n */\n _this._tint = 0;\n _this.tintRgb = new Float32Array(4);\n _this.tint = 0xFFFFFF;\n return _this;\n }\n /**\n * Sets the private properties array to dynamic / static based on the passed properties object\n *\n * @param {object} properties - The properties to be uploaded\n */\n ParticleContainer.prototype.setProperties = function (properties) {\n if (properties) {\n this._properties[0] = 'vertices' in properties || 'scale' in properties\n ? !!properties.vertices || !!properties.scale : this._properties[0];\n this._properties[1] = 'position' in properties ? !!properties.position : this._properties[1];\n this._properties[2] = 'rotation' in properties ? !!properties.rotation : this._properties[2];\n this._properties[3] = 'uvs' in properties ? !!properties.uvs : this._properties[3];\n this._properties[4] = 'tint' in properties || 'alpha' in properties\n ? !!properties.tint || !!properties.alpha : this._properties[4];\n }\n };\n /**\n * Updates the object transform for rendering\n *\n * @private\n */\n ParticleContainer.prototype.updateTransform = function () {\n // TODO don't need to!\n this.displayObjectUpdateTransform();\n };\n Object.defineProperty(ParticleContainer.prototype, \"tint\", {\n /**\n * The tint applied to the container. This is a hex value.\n * A value of 0xFFFFFF will remove any tint effect.\n ** IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.\n * @member {number}\n * @default 0xFFFFFF\n */\n get: function () {\n return this._tint;\n },\n set: function (value) {\n this._tint = value;\n hex2rgb(value, this.tintRgb);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Renders the container using the WebGL renderer\n *\n * @private\n * @param {PIXI.Renderer} renderer - The webgl renderer\n */\n ParticleContainer.prototype.render = function (renderer) {\n var _this = this;\n if (!this.visible || this.worldAlpha <= 0 || !this.children.length || !this.renderable) {\n return;\n }\n if (!this.baseTexture) {\n this.baseTexture = this.children[0]._texture.baseTexture;\n if (!this.baseTexture.valid) {\n this.baseTexture.once('update', function () { return _this.onChildrenChange(0); });\n }\n }\n renderer.batch.setObjectRenderer(renderer.plugins.particle);\n renderer.plugins.particle.render(this);\n };\n /**\n * Set the flag that static data should be updated to true\n *\n * @private\n * @param {number} smallestChildIndex - The smallest child index\n */\n ParticleContainer.prototype.onChildrenChange = function (smallestChildIndex) {\n var bufferIndex = Math.floor(smallestChildIndex / this._batchSize);\n while (this._bufferUpdateIDs.length < bufferIndex) {\n this._bufferUpdateIDs.push(0);\n }\n this._bufferUpdateIDs[bufferIndex] = ++this._updateID;\n };\n ParticleContainer.prototype.dispose = function () {\n if (this._buffers) {\n for (var i = 0; i < this._buffers.length; ++i) {\n this._buffers[i].destroy();\n }\n this._buffers = null;\n }\n };\n /**\n * Destroys the container\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their\n * destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the texture of the child sprite\n * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the base texture of the child sprite\n */\n ParticleContainer.prototype.destroy = function (options) {\n _super.prototype.destroy.call(this, options);\n this.dispose();\n this._properties = null;\n this._buffers = null;\n this._bufferUpdateIDs = null;\n };\n return ParticleContainer;\n}(Container));\n\n/**\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\n * for creating the original PixiJS version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that\n * they now share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's ParticleBuffer:\n * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/ParticleBuffer.java\n */\n/**\n * The particle buffer manages the static and dynamic buffers for a particle container.\n *\n * @class\n * @private\n * @memberof PIXI\n */\nvar ParticleBuffer = /** @class */ (function () {\n /**\n * @private\n * @param {object} properties - The properties to upload.\n * @param {boolean[]} dynamicPropertyFlags - Flags for which properties are dynamic.\n * @param {number} size - The size of the batch.\n */\n function ParticleBuffer(properties, dynamicPropertyFlags, size) {\n this.geometry = new Geometry();\n this.indexBuffer = null;\n /**\n * The number of particles the buffer can hold\n *\n * @private\n * @member {number}\n */\n this.size = size;\n /**\n * A list of the properties that are dynamic.\n *\n * @private\n * @member {object[]}\n */\n this.dynamicProperties = [];\n /**\n * A list of the properties that are static.\n *\n * @private\n * @member {object[]}\n */\n this.staticProperties = [];\n for (var i = 0; i < properties.length; ++i) {\n var property = properties[i];\n // Make copy of properties object so that when we edit the offset it doesn't\n // change all other instances of the object literal\n property = {\n attributeName: property.attributeName,\n size: property.size,\n uploadFunction: property.uploadFunction,\n type: property.type || TYPES.FLOAT,\n offset: property.offset,\n };\n if (dynamicPropertyFlags[i]) {\n this.dynamicProperties.push(property);\n }\n else {\n this.staticProperties.push(property);\n }\n }\n this.staticStride = 0;\n this.staticBuffer = null;\n this.staticData = null;\n this.staticDataUint32 = null;\n this.dynamicStride = 0;\n this.dynamicBuffer = null;\n this.dynamicData = null;\n this.dynamicDataUint32 = null;\n this._updateID = 0;\n this.initBuffers();\n }\n /**\n * Sets up the renderer context and necessary buffers.\n *\n * @private\n */\n ParticleBuffer.prototype.initBuffers = function () {\n var geometry = this.geometry;\n var dynamicOffset = 0;\n /**\n * Holds the indices of the geometry (quads) to draw\n *\n * @member {Uint16Array}\n * @private\n */\n this.indexBuffer = new Buffer(createIndicesForQuads(this.size), true, true);\n geometry.addIndex(this.indexBuffer);\n this.dynamicStride = 0;\n for (var i = 0; i < this.dynamicProperties.length; ++i) {\n var property = this.dynamicProperties[i];\n property.offset = dynamicOffset;\n dynamicOffset += property.size;\n this.dynamicStride += property.size;\n }\n var dynBuffer = new ArrayBuffer(this.size * this.dynamicStride * 4 * 4);\n this.dynamicData = new Float32Array(dynBuffer);\n this.dynamicDataUint32 = new Uint32Array(dynBuffer);\n this.dynamicBuffer = new Buffer(this.dynamicData, false, false);\n // static //\n var staticOffset = 0;\n this.staticStride = 0;\n for (var i = 0; i < this.staticProperties.length; ++i) {\n var property = this.staticProperties[i];\n property.offset = staticOffset;\n staticOffset += property.size;\n this.staticStride += property.size;\n }\n var statBuffer = new ArrayBuffer(this.size * this.staticStride * 4 * 4);\n this.staticData = new Float32Array(statBuffer);\n this.staticDataUint32 = new Uint32Array(statBuffer);\n this.staticBuffer = new Buffer(this.staticData, true, false);\n for (var i = 0; i < this.dynamicProperties.length; ++i) {\n var property = this.dynamicProperties[i];\n geometry.addAttribute(property.attributeName, this.dynamicBuffer, 0, property.type === TYPES.UNSIGNED_BYTE, property.type, this.dynamicStride * 4, property.offset * 4);\n }\n for (var i = 0; i < this.staticProperties.length; ++i) {\n var property = this.staticProperties[i];\n geometry.addAttribute(property.attributeName, this.staticBuffer, 0, property.type === TYPES.UNSIGNED_BYTE, property.type, this.staticStride * 4, property.offset * 4);\n }\n };\n /**\n * Uploads the dynamic properties.\n *\n * @private\n * @param {PIXI.DisplayObject[]} children - The children to upload.\n * @param {number} startIndex - The index to start at.\n * @param {number} amount - The number to upload.\n */\n ParticleBuffer.prototype.uploadDynamic = function (children, startIndex, amount) {\n for (var i = 0; i < this.dynamicProperties.length; i++) {\n var property = this.dynamicProperties[i];\n property.uploadFunction(children, startIndex, amount, property.type === TYPES.UNSIGNED_BYTE ? this.dynamicDataUint32 : this.dynamicData, this.dynamicStride, property.offset);\n }\n this.dynamicBuffer._updateID++;\n };\n /**\n * Uploads the static properties.\n *\n * @private\n * @param {PIXI.DisplayObject[]} children - The children to upload.\n * @param {number} startIndex - The index to start at.\n * @param {number} amount - The number to upload.\n */\n ParticleBuffer.prototype.uploadStatic = function (children, startIndex, amount) {\n for (var i = 0; i < this.staticProperties.length; i++) {\n var property = this.staticProperties[i];\n property.uploadFunction(children, startIndex, amount, property.type === TYPES.UNSIGNED_BYTE ? this.staticDataUint32 : this.staticData, this.staticStride, property.offset);\n }\n this.staticBuffer._updateID++;\n };\n /**\n * Destroys the ParticleBuffer.\n *\n * @private\n */\n ParticleBuffer.prototype.destroy = function () {\n this.indexBuffer = null;\n this.dynamicProperties = null;\n this.dynamicBuffer = null;\n this.dynamicData = null;\n this.dynamicDataUint32 = null;\n this.staticProperties = null;\n this.staticBuffer = null;\n this.staticData = null;\n this.staticDataUint32 = null;\n // all buffers are destroyed inside geometry\n this.geometry.destroy();\n };\n return ParticleBuffer;\n}());\n\nvar fragment = \"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}\";\n\nvar vertex = \"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\";\n\n/**\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\n * for creating the original PixiJS version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now\n * share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's ParticleRenderer:\n * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/ParticleRenderer.java\n */\n/**\n * Renderer for Particles that is designer for speed over feature set.\n *\n * @class\n * @memberof PIXI\n */\nvar ParticleRenderer = /** @class */ (function (_super) {\n __extends(ParticleRenderer, _super);\n /**\n * @param {PIXI.Renderer} renderer - The renderer this sprite batch works for.\n */\n function ParticleRenderer(renderer) {\n var _this = _super.call(this, renderer) || this;\n // 65535 is max vertex index in the index buffer (see ParticleRenderer)\n // so max number of particles is 65536 / 4 = 16384\n // and max number of element in the index buffer is 16384 * 6 = 98304\n // Creating a full index buffer, overhead is 98304 * 2 = 196Ko\n // let numIndices = 98304;\n /**\n * The default shader that is used if a sprite doesn't have a more specific one.\n *\n * @member {PIXI.Shader}\n */\n _this.shader = null;\n _this.properties = null;\n _this.tempMatrix = new Matrix();\n _this.properties = [\n // verticesData\n {\n attributeName: 'aVertexPosition',\n size: 2,\n uploadFunction: _this.uploadVertices,\n offset: 0,\n },\n // positionData\n {\n attributeName: 'aPositionCoord',\n size: 2,\n uploadFunction: _this.uploadPosition,\n offset: 0,\n },\n // rotationData\n {\n attributeName: 'aRotation',\n size: 1,\n uploadFunction: _this.uploadRotation,\n offset: 0,\n },\n // uvsData\n {\n attributeName: 'aTextureCoord',\n size: 2,\n uploadFunction: _this.uploadUvs,\n offset: 0,\n },\n // tintData\n {\n attributeName: 'aColor',\n size: 1,\n type: TYPES.UNSIGNED_BYTE,\n uploadFunction: _this.uploadTint,\n offset: 0,\n } ];\n _this.shader = Shader.from(vertex, fragment, {});\n /**\n * The WebGL state in which this renderer will work.\n *\n * @member {PIXI.State}\n * @readonly\n */\n _this.state = State.for2d();\n return _this;\n }\n /**\n * Renders the particle container object.\n *\n * @param {PIXI.ParticleContainer} container - The container to render using this ParticleRenderer\n */\n ParticleRenderer.prototype.render = function (container) {\n var children = container.children;\n var maxSize = container._maxSize;\n var batchSize = container._batchSize;\n var renderer = this.renderer;\n var totalChildren = children.length;\n if (totalChildren === 0) {\n return;\n }\n else if (totalChildren > maxSize && !container.autoResize) {\n totalChildren = maxSize;\n }\n var buffers = container._buffers;\n if (!buffers) {\n buffers = container._buffers = this.generateBuffers(container);\n }\n var baseTexture = children[0]._texture.baseTexture;\n // if the uvs have not updated then no point rendering just yet!\n this.state.blendMode = correctBlendMode(container.blendMode, baseTexture.alphaMode);\n renderer.state.set(this.state);\n var gl = renderer.gl;\n var m = container.worldTransform.copyTo(this.tempMatrix);\n m.prepend(renderer.globalUniforms.uniforms.projectionMatrix);\n this.shader.uniforms.translationMatrix = m.toArray(true);\n this.shader.uniforms.uColor = premultiplyRgba(container.tintRgb, container.worldAlpha, this.shader.uniforms.uColor, baseTexture.alphaMode);\n this.shader.uniforms.uSampler = baseTexture;\n this.renderer.shader.bind(this.shader);\n var updateStatic = false;\n // now lets upload and render the buffers..\n for (var i = 0, j = 0; i < totalChildren; i += batchSize, j += 1) {\n var amount = (totalChildren - i);\n if (amount > batchSize) {\n amount = batchSize;\n }\n if (j >= buffers.length) {\n buffers.push(this._generateOneMoreBuffer(container));\n }\n var buffer = buffers[j];\n // we always upload the dynamic\n buffer.uploadDynamic(children, i, amount);\n var bid = container._bufferUpdateIDs[j] || 0;\n updateStatic = updateStatic || (buffer._updateID < bid);\n // we only upload the static content when we have to!\n if (updateStatic) {\n buffer._updateID = container._updateID;\n buffer.uploadStatic(children, i, amount);\n }\n // bind the buffer\n renderer.geometry.bind(buffer.geometry);\n gl.drawElements(gl.TRIANGLES, amount * 6, gl.UNSIGNED_SHORT, 0);\n }\n };\n /**\n * Creates one particle buffer for each child in the container we want to render and updates internal properties\n *\n * @param {PIXI.ParticleContainer} container - The container to render using this ParticleRenderer\n * @return {PIXI.ParticleBuffer[]} The buffers\n * @private\n */\n ParticleRenderer.prototype.generateBuffers = function (container) {\n var buffers = [];\n var size = container._maxSize;\n var batchSize = container._batchSize;\n var dynamicPropertyFlags = container._properties;\n for (var i = 0; i < size; i += batchSize) {\n buffers.push(new ParticleBuffer(this.properties, dynamicPropertyFlags, batchSize));\n }\n return buffers;\n };\n /**\n * Creates one more particle buffer, because container has autoResize feature\n *\n * @param {PIXI.ParticleContainer} container - The container to render using this ParticleRenderer\n * @return {PIXI.ParticleBuffer} generated buffer\n * @private\n */\n ParticleRenderer.prototype._generateOneMoreBuffer = function (container) {\n var batchSize = container._batchSize;\n var dynamicPropertyFlags = container._properties;\n return new ParticleBuffer(this.properties, dynamicPropertyFlags, batchSize);\n };\n /**\n * Uploads the vertices.\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their vertices uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n ParticleRenderer.prototype.uploadVertices = function (children, startIndex, amount, array, stride, offset) {\n var w0 = 0;\n var w1 = 0;\n var h0 = 0;\n var h1 = 0;\n for (var i = 0; i < amount; ++i) {\n var sprite = children[startIndex + i];\n var texture = sprite._texture;\n var sx = sprite.scale.x;\n var sy = sprite.scale.y;\n var trim = texture.trim;\n var orig = texture.orig;\n if (trim) {\n // if the sprite is trimmed and is not a tilingsprite then we need to add the\n // extra space before transforming the sprite coords..\n w1 = trim.x - (sprite.anchor.x * orig.width);\n w0 = w1 + trim.width;\n h1 = trim.y - (sprite.anchor.y * orig.height);\n h0 = h1 + trim.height;\n }\n else {\n w0 = (orig.width) * (1 - sprite.anchor.x);\n w1 = (orig.width) * -sprite.anchor.x;\n h0 = orig.height * (1 - sprite.anchor.y);\n h1 = orig.height * -sprite.anchor.y;\n }\n array[offset] = w1 * sx;\n array[offset + 1] = h1 * sy;\n array[offset + stride] = w0 * sx;\n array[offset + stride + 1] = h1 * sy;\n array[offset + (stride * 2)] = w0 * sx;\n array[offset + (stride * 2) + 1] = h0 * sy;\n array[offset + (stride * 3)] = w1 * sx;\n array[offset + (stride * 3) + 1] = h0 * sy;\n offset += stride * 4;\n }\n };\n /**\n * Uploads the position.\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their positions uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n ParticleRenderer.prototype.uploadPosition = function (children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; i++) {\n var spritePosition = children[startIndex + i].position;\n array[offset] = spritePosition.x;\n array[offset + 1] = spritePosition.y;\n array[offset + stride] = spritePosition.x;\n array[offset + stride + 1] = spritePosition.y;\n array[offset + (stride * 2)] = spritePosition.x;\n array[offset + (stride * 2) + 1] = spritePosition.y;\n array[offset + (stride * 3)] = spritePosition.x;\n array[offset + (stride * 3) + 1] = spritePosition.y;\n offset += stride * 4;\n }\n };\n /**\n * Uploads the rotation.\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their rotation uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n ParticleRenderer.prototype.uploadRotation = function (children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; i++) {\n var spriteRotation = children[startIndex + i].rotation;\n array[offset] = spriteRotation;\n array[offset + stride] = spriteRotation;\n array[offset + (stride * 2)] = spriteRotation;\n array[offset + (stride * 3)] = spriteRotation;\n offset += stride * 4;\n }\n };\n /**\n * Uploads the Uvs\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their rotation uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n ParticleRenderer.prototype.uploadUvs = function (children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; ++i) {\n var textureUvs = children[startIndex + i]._texture._uvs;\n if (textureUvs) {\n array[offset] = textureUvs.x0;\n array[offset + 1] = textureUvs.y0;\n array[offset + stride] = textureUvs.x1;\n array[offset + stride + 1] = textureUvs.y1;\n array[offset + (stride * 2)] = textureUvs.x2;\n array[offset + (stride * 2) + 1] = textureUvs.y2;\n array[offset + (stride * 3)] = textureUvs.x3;\n array[offset + (stride * 3) + 1] = textureUvs.y3;\n offset += stride * 4;\n }\n else {\n // TODO you know this can be easier!\n array[offset] = 0;\n array[offset + 1] = 0;\n array[offset + stride] = 0;\n array[offset + stride + 1] = 0;\n array[offset + (stride * 2)] = 0;\n array[offset + (stride * 2) + 1] = 0;\n array[offset + (stride * 3)] = 0;\n array[offset + (stride * 3) + 1] = 0;\n offset += stride * 4;\n }\n }\n };\n /**\n * Uploads the tint.\n *\n * @param {PIXI.DisplayObject[]} children - the array of display objects to render\n * @param {number} startIndex - the index to start from in the children array\n * @param {number} amount - the amount of children that will have their rotation uploaded\n * @param {number[]} array - The vertices to upload.\n * @param {number} stride - Stride to use for iteration.\n * @param {number} offset - Offset to start at.\n */\n ParticleRenderer.prototype.uploadTint = function (children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; ++i) {\n var sprite = children[startIndex + i];\n var premultiplied = sprite._texture.baseTexture.alphaMode > 0;\n var alpha = sprite.alpha;\n // we dont call extra function if alpha is 1.0, that's faster\n var argb = alpha < 1.0 && premultiplied\n ? premultiplyTint(sprite._tintRGB, alpha) : sprite._tintRGB + (alpha * 255 << 24);\n array[offset] = argb;\n array[offset + stride] = argb;\n array[offset + (stride * 2)] = argb;\n array[offset + (stride * 3)] = argb;\n offset += stride * 4;\n }\n };\n /**\n * Destroys the ParticleRenderer.\n */\n ParticleRenderer.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n if (this.shader) {\n this.shader.destroy();\n this.shader = null;\n }\n this.tempMatrix = null;\n };\n return ParticleRenderer;\n}(ObjectRenderer));\n\nexport { ParticleContainer, ParticleRenderer };\n//# sourceMappingURL=particles.es.js.map\n","/*!\n * @pixi/graphics - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/graphics is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Texture, BaseTexture, BatchDrawCall, BatchTextureArray, BatchGeometry, State, UniformGroup, Shader } from '@pixi/core';\nimport { SHAPES, Point, Polygon, PI_2, Matrix, Rectangle, RoundedRectangle, Circle, Ellipse } from '@pixi/math';\nimport { earcut, premultiplyTint, deprecation, hex2rgb } from '@pixi/utils';\nimport { WRAP_MODES, DRAW_MODES, BLEND_MODES } from '@pixi/constants';\nimport { Bounds, Container } from '@pixi/display';\n\n/**\n * Supported line joints in `PIXI.LineStyle` for graphics.\n *\n * @see PIXI.Graphics#lineStyle\n * @see https://graphicdesign.stackexchange.com/questions/59018/what-is-a-bevel-join-of-two-lines-exactly-illustrator\n *\n * @name LINE_JOIN\n * @memberof PIXI\n * @static\n * @enum {string}\n * @property {string} MITER - 'miter': make a sharp corner where outer part of lines meet\n * @property {string} BEVEL - 'bevel': add a square butt at each end of line segment and fill the triangle at turn\n * @property {string} ROUND - 'round': add an arc at the joint\n */\nvar LINE_JOIN;\n(function (LINE_JOIN) {\n LINE_JOIN[\"MITER\"] = \"miter\";\n LINE_JOIN[\"BEVEL\"] = \"bevel\";\n LINE_JOIN[\"ROUND\"] = \"round\";\n})(LINE_JOIN || (LINE_JOIN = {}));\n/**\n * Support line caps in `PIXI.LineStyle` for graphics.\n *\n * @see PIXI.Graphics#lineStyle\n *\n * @name LINE_CAP\n * @memberof PIXI\n * @static\n * @enum {string}\n * @property {string} BUTT - 'butt': don't add any cap at line ends (leaves orthogonal edges)\n * @property {string} ROUND - 'round': add semicircle at ends\n * @property {string} SQUARE - 'square': add square at end (like `BUTT` except more length at end)\n */\nvar LINE_CAP;\n(function (LINE_CAP) {\n LINE_CAP[\"BUTT\"] = \"butt\";\n LINE_CAP[\"ROUND\"] = \"round\";\n LINE_CAP[\"SQUARE\"] = \"square\";\n})(LINE_CAP || (LINE_CAP = {}));\n/**\n * Graphics curves resolution settings. If `adaptive` flag is set to `true`,\n * the resolution is calculated based on the curve's length to ensure better visual quality.\n * Adaptive draw works with `bezierCurveTo` and `quadraticCurveTo`.\n *\n * @static\n * @constant\n * @memberof PIXI\n * @name GRAPHICS_CURVES\n * @type {object}\n * @property {boolean} adaptive=false - flag indicating if the resolution should be adaptive\n * @property {number} maxLength=10 - maximal length of a single segment of the curve (if adaptive = false, ignored)\n * @property {number} minSegments=8 - minimal number of segments in the curve (if adaptive = false, ignored)\n * @property {number} maxSegments=2048 - maximal number of segments in the curve (if adaptive = false, ignored)\n */\nvar GRAPHICS_CURVES = {\n adaptive: true,\n maxLength: 10,\n minSegments: 8,\n maxSegments: 2048,\n epsilon: 0.0001,\n _segmentsCount: function (length, defaultSegments) {\n if (defaultSegments === void 0) { defaultSegments = 20; }\n if (!this.adaptive || !length || isNaN(length)) {\n return defaultSegments;\n }\n var result = Math.ceil(length / this.maxLength);\n if (result < this.minSegments) {\n result = this.minSegments;\n }\n else if (result > this.maxSegments) {\n result = this.maxSegments;\n }\n return result;\n },\n};\n\n/**\n * Fill style object for Graphics.\n *\n * @class\n * @memberof PIXI\n */\nvar FillStyle = /** @class */ (function () {\n function FillStyle() {\n /**\n * The hex color value used when coloring the Graphics object.\n *\n * @member {number}\n * @default 0xFFFFFF\n */\n this.color = 0xFFFFFF;\n /**\n * The alpha value used when filling the Graphics object.\n *\n * @member {number}\n * @default 1\n */\n this.alpha = 1.0;\n /**\n * The texture to be used for the fill.\n *\n * @member {PIXI.Texture}\n * @default 0\n */\n this.texture = Texture.WHITE;\n /**\n * The transform aplpied to the texture.\n *\n * @member {PIXI.Matrix}\n * @default null\n */\n this.matrix = null;\n /**\n * If the current fill is visible.\n *\n * @member {boolean}\n * @default false\n */\n this.visible = false;\n this.reset();\n }\n /**\n * Clones the object\n *\n * @return {PIXI.FillStyle}\n */\n FillStyle.prototype.clone = function () {\n var obj = new FillStyle();\n obj.color = this.color;\n obj.alpha = this.alpha;\n obj.texture = this.texture;\n obj.matrix = this.matrix;\n obj.visible = this.visible;\n return obj;\n };\n /**\n * Reset\n */\n FillStyle.prototype.reset = function () {\n this.color = 0xFFFFFF;\n this.alpha = 1;\n this.texture = Texture.WHITE;\n this.matrix = null;\n this.visible = false;\n };\n /**\n * Destroy and don't use after this\n */\n FillStyle.prototype.destroy = function () {\n this.texture = null;\n this.matrix = null;\n };\n return FillStyle;\n}());\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * Builds a polygon to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nvar buildPoly = {\n build: function (graphicsData) {\n graphicsData.points = graphicsData.shape.points.slice();\n },\n triangulate: function (graphicsData, graphicsGeometry) {\n var points = graphicsData.points;\n var holes = graphicsData.holes;\n var verts = graphicsGeometry.points;\n var indices = graphicsGeometry.indices;\n if (points.length >= 6) {\n var holeArray = [];\n // Process holes..\n for (var i = 0; i < holes.length; i++) {\n var hole = holes[i];\n holeArray.push(points.length / 2);\n points = points.concat(hole.points);\n }\n // sort color\n var triangles = earcut(points, holeArray, 2);\n if (!triangles) {\n return;\n }\n var vertPos = verts.length / 2;\n for (var i = 0; i < triangles.length; i += 3) {\n indices.push(triangles[i] + vertPos);\n indices.push(triangles[i + 1] + vertPos);\n indices.push(triangles[i + 2] + vertPos);\n }\n for (var i = 0; i < points.length; i++) {\n verts.push(points[i]);\n }\n }\n },\n};\n\n// for type only\n/**\n * Builds a circle to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object to draw\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nvar buildCircle = {\n build: function (graphicsData) {\n // need to convert points to a nice regular data\n var circleData = graphicsData.shape;\n var points = graphicsData.points;\n var x = circleData.x;\n var y = circleData.y;\n var width;\n var height;\n points.length = 0;\n // TODO - bit hacky??\n if (graphicsData.type === SHAPES.CIRC) {\n width = circleData.radius;\n height = circleData.radius;\n }\n else {\n var ellipseData = graphicsData.shape;\n width = ellipseData.width;\n height = ellipseData.height;\n }\n if (width === 0 || height === 0) {\n return;\n }\n var totalSegs = Math.floor(30 * Math.sqrt(circleData.radius))\n || Math.floor(15 * Math.sqrt(width + height));\n totalSegs /= 2.3;\n var seg = (Math.PI * 2) / totalSegs;\n for (var i = 0; i < totalSegs - 0.5; i++) {\n points.push(x + (Math.sin(-seg * i) * width), y + (Math.cos(-seg * i) * height));\n }\n points.push(points[0], points[1]);\n },\n triangulate: function (graphicsData, graphicsGeometry) {\n var points = graphicsData.points;\n var verts = graphicsGeometry.points;\n var indices = graphicsGeometry.indices;\n var vertPos = verts.length / 2;\n var center = vertPos;\n var circle = (graphicsData.shape);\n var matrix = graphicsData.matrix;\n var x = circle.x;\n var y = circle.y;\n // Push center (special point)\n verts.push(graphicsData.matrix ? (matrix.a * x) + (matrix.c * y) + matrix.tx : x, graphicsData.matrix ? (matrix.b * x) + (matrix.d * y) + matrix.ty : y);\n for (var i = 0; i < points.length; i += 2) {\n verts.push(points[i], points[i + 1]);\n // add some uvs\n indices.push(vertPos++, center, vertPos);\n }\n },\n};\n\n/**\n * Builds a rectangle to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nvar buildRectangle = {\n build: function (graphicsData) {\n // --- //\n // need to convert points to a nice regular data\n //\n var rectData = graphicsData.shape;\n var x = rectData.x;\n var y = rectData.y;\n var width = rectData.width;\n var height = rectData.height;\n var points = graphicsData.points;\n points.length = 0;\n points.push(x, y, x + width, y, x + width, y + height, x, y + height);\n },\n triangulate: function (graphicsData, graphicsGeometry) {\n var points = graphicsData.points;\n var verts = graphicsGeometry.points;\n var vertPos = verts.length / 2;\n verts.push(points[0], points[1], points[2], points[3], points[6], points[7], points[4], points[5]);\n graphicsGeometry.indices.push(vertPos, vertPos + 1, vertPos + 2, vertPos + 1, vertPos + 2, vertPos + 3);\n },\n};\n\n/**\n * Calculate a single point for a quadratic bezier curve.\n * Utility function used by quadraticBezierCurve.\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {number} n1 - first number\n * @param {number} n2 - second number\n * @param {number} perc - percentage\n * @return {number} the result\n *\n */\nfunction getPt(n1, n2, perc) {\n var diff = n2 - n1;\n return n1 + (diff * perc);\n}\n/**\n * Calculate the points for a quadratic bezier curve. (helper function..)\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {number} fromX - Origin point x\n * @param {number} fromY - Origin point x\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @param {number[]} [out=[]] - The output array to add points into. If not passed, a new array is created.\n * @return {number[]} an array of points\n */\nfunction quadraticBezierCurve(fromX, fromY, cpX, cpY, toX, toY, out) {\n if (out === void 0) { out = []; }\n var n = 20;\n var points = out;\n var xa = 0;\n var ya = 0;\n var xb = 0;\n var yb = 0;\n var x = 0;\n var y = 0;\n for (var i = 0, j = 0; i <= n; ++i) {\n j = i / n;\n // The Green Line\n xa = getPt(fromX, cpX, j);\n ya = getPt(fromY, cpY, j);\n xb = getPt(cpX, toX, j);\n yb = getPt(cpY, toY, j);\n // The Black Dot\n x = getPt(xa, xb, j);\n y = getPt(ya, yb, j);\n points.push(x, y);\n }\n return points;\n}\n/**\n * Builds a rounded rectangle to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nvar buildRoundedRectangle = {\n build: function (graphicsData) {\n var rrectData = graphicsData.shape;\n var points = graphicsData.points;\n var x = rrectData.x;\n var y = rrectData.y;\n var width = rrectData.width;\n var height = rrectData.height;\n // Don't allow negative radius or greater than half the smallest width\n var radius = Math.max(0, Math.min(rrectData.radius, Math.min(width, height) / 2));\n points.length = 0;\n // No radius, do a simple rectangle\n if (!radius) {\n points.push(x, y, x + width, y, x + width, y + height, x, y + height);\n }\n else {\n quadraticBezierCurve(x, y + radius, x, y, x + radius, y, points);\n quadraticBezierCurve(x + width - radius, y, x + width, y, x + width, y + radius, points);\n quadraticBezierCurve(x + width, y + height - radius, x + width, y + height, x + width - radius, y + height, points);\n quadraticBezierCurve(x + radius, y + height, x, y + height, x, y + height - radius, points);\n }\n // this tiny number deals with the issue that occurs when points overlap and earcut fails to triangulate the item.\n // TODO - fix this properly, this is not very elegant.. but it works for now.\n },\n triangulate: function (graphicsData, graphicsGeometry) {\n var points = graphicsData.points;\n var verts = graphicsGeometry.points;\n var indices = graphicsGeometry.indices;\n var vecPos = verts.length / 2;\n var triangles = earcut(points, null, 2);\n for (var i = 0, j = triangles.length; i < j; i += 3) {\n indices.push(triangles[i] + vecPos);\n // indices.push(triangles[i] + vecPos);\n indices.push(triangles[i + 1] + vecPos);\n // indices.push(triangles[i + 2] + vecPos);\n indices.push(triangles[i + 2] + vecPos);\n }\n for (var i = 0, j = points.length; i < j; i++) {\n verts.push(points[i], points[++i]);\n }\n },\n};\n\n/**\n * Buffers vertices to draw a square cap.\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {number} x - X-coord of end point\n * @param {number} y - Y-coord of end point\n * @param {number} nx - X-coord of line normal pointing inside\n * @param {number} ny - Y-coord of line normal pointing inside\n * @param {Array} verts - vertex buffer\n * @returns {}\n */\nfunction square(x, y, nx, ny, innerWeight, outerWeight, clockwise, /* rotation for square (true at left end, false at right end) */ verts) {\n var ix = x - (nx * innerWeight);\n var iy = y - (ny * innerWeight);\n var ox = x + (nx * outerWeight);\n var oy = y + (ny * outerWeight);\n /* Rotate nx,ny for extension vector */\n var exx;\n var eyy;\n if (clockwise) {\n exx = ny;\n eyy = -nx;\n }\n else {\n exx = -ny;\n eyy = nx;\n }\n /* [i|0]x,y extended at cap */\n var eix = ix + exx;\n var eiy = iy + eyy;\n var eox = ox + exx;\n var eoy = oy + eyy;\n /* Square itself must be inserted clockwise*/\n verts.push(eix, eiy);\n verts.push(eox, eoy);\n return 2;\n}\n/**\n * Buffers vertices to draw an arc at the line joint or cap.\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {number} cx - X-coord of center\n * @param {number} cy - Y-coord of center\n * @param {number} sx - X-coord of arc start\n * @param {number} sy - Y-coord of arc start\n * @param {number} ex - X-coord of arc end\n * @param {number} ey - Y-coord of arc end\n * @param {Array} verts - buffer of vertices\n * @param {boolean} clockwise - orientation of vertices\n * @returns {number} - no. of vertices pushed\n */\nfunction round(cx, cy, sx, sy, ex, ey, verts, clockwise) {\n var cx2p0x = sx - cx;\n var cy2p0y = sy - cy;\n var angle0 = Math.atan2(cx2p0x, cy2p0y);\n var angle1 = Math.atan2(ex - cx, ey - cy);\n if (clockwise && angle0 < angle1) {\n angle0 += Math.PI * 2;\n }\n else if (!clockwise && angle0 > angle1) {\n angle1 += Math.PI * 2;\n }\n var startAngle = angle0;\n var angleDiff = angle1 - angle0;\n var absAngleDiff = Math.abs(angleDiff);\n /* if (absAngleDiff >= PI_LBOUND && absAngleDiff <= PI_UBOUND)\n {\n const r1x = cx - nxtPx;\n const r1y = cy - nxtPy;\n\n if (r1x === 0)\n {\n if (r1y > 0)\n {\n angleDiff = -angleDiff;\n }\n }\n else if (r1x >= -GRAPHICS_CURVES.epsilon)\n {\n angleDiff = -angleDiff;\n }\n }*/\n var radius = Math.sqrt((cx2p0x * cx2p0x) + (cy2p0y * cy2p0y));\n var segCount = ((15 * absAngleDiff * Math.sqrt(radius) / Math.PI) >> 0) + 1;\n var angleInc = angleDiff / segCount;\n startAngle += angleInc;\n if (clockwise) {\n verts.push(cx, cy);\n verts.push(sx, sy);\n for (var i = 1, angle = startAngle; i < segCount; i++, angle += angleInc) {\n verts.push(cx, cy);\n verts.push(cx + ((Math.sin(angle) * radius)), cy + ((Math.cos(angle) * radius)));\n }\n verts.push(cx, cy);\n verts.push(ex, ey);\n }\n else {\n verts.push(sx, sy);\n verts.push(cx, cy);\n for (var i = 1, angle = startAngle; i < segCount; i++, angle += angleInc) {\n verts.push(cx + ((Math.sin(angle) * radius)), cy + ((Math.cos(angle) * radius)));\n verts.push(cx, cy);\n }\n verts.push(ex, ey);\n verts.push(cx, cy);\n }\n return segCount * 2;\n}\n/**\n * Builds a line to draw using the polygon method.\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.GraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {PIXI.GraphicsGeometry} graphicsGeometry - Geometry where to append output\n */\nfunction buildNonNativeLine(graphicsData, graphicsGeometry) {\n var shape = graphicsData.shape;\n var points = graphicsData.points || shape.points.slice();\n var eps = graphicsGeometry.closePointEps;\n if (points.length === 0) {\n return;\n }\n // if the line width is an odd number add 0.5 to align to a whole pixel\n // commenting this out fixes #711 and #1620\n // if (graphicsData.lineWidth%2)\n // {\n // for (i = 0; i < points.length; i++)\n // {\n // points[i] += 0.5;\n // }\n // }\n var style = graphicsData.lineStyle;\n // get first and last point.. figure out the middle!\n var firstPoint = new Point(points[0], points[1]);\n var lastPoint = new Point(points[points.length - 2], points[points.length - 1]);\n var closedShape = shape.type !== SHAPES.POLY || shape.closeStroke;\n var closedPath = Math.abs(firstPoint.x - lastPoint.x) < eps\n && Math.abs(firstPoint.y - lastPoint.y) < eps;\n // if the first point is the last point - gonna have issues :)\n if (closedShape) {\n // need to clone as we are going to slightly modify the shape..\n points = points.slice();\n if (closedPath) {\n points.pop();\n points.pop();\n lastPoint.set(points[points.length - 2], points[points.length - 1]);\n }\n var midPointX = (firstPoint.x + lastPoint.x) * 0.5;\n var midPointY = (lastPoint.y + firstPoint.y) * 0.5;\n points.unshift(midPointX, midPointY);\n points.push(midPointX, midPointY);\n }\n var verts = graphicsGeometry.points;\n var length = points.length / 2;\n var indexCount = points.length;\n var indexStart = verts.length / 2;\n // Max. inner and outer width\n var width = style.width / 2;\n var widthSquared = width * width;\n var miterLimitSquared = style.miterLimit * style.miterLimit;\n /* Line segments of interest where (x1,y1) forms the corner. */\n var x0 = points[0];\n var y0 = points[1];\n var x1 = points[2];\n var y1 = points[3];\n var x2 = 0;\n var y2 = 0;\n /* perp[?](x|y) = the line normal with magnitude lineWidth. */\n var perpx = -(y0 - y1);\n var perpy = x0 - x1;\n var perp1x = 0;\n var perp1y = 0;\n var dist = Math.sqrt((perpx * perpx) + (perpy * perpy));\n perpx /= dist;\n perpy /= dist;\n perpx *= width;\n perpy *= width;\n var ratio = style.alignment; // 0.5;\n var innerWeight = (1 - ratio) * 2;\n var outerWeight = ratio * 2;\n if (!closedShape) {\n if (style.cap === LINE_CAP.ROUND) {\n indexCount += round(x0 - (perpx * (innerWeight - outerWeight) * 0.5), y0 - (perpy * (innerWeight - outerWeight) * 0.5), x0 - (perpx * innerWeight), y0 - (perpy * innerWeight), x0 + (perpx * outerWeight), y0 + (perpy * outerWeight), verts, true) + 2;\n }\n else if (style.cap === LINE_CAP.SQUARE) {\n indexCount += square(x0, y0, perpx, perpy, innerWeight, outerWeight, true, verts);\n }\n }\n // Push first point (below & above vertices)\n verts.push(x0 - (perpx * innerWeight), y0 - (perpy * innerWeight));\n verts.push(x0 + (perpx * outerWeight), y0 + (perpy * outerWeight));\n for (var i = 1; i < length - 1; ++i) {\n x0 = points[(i - 1) * 2];\n y0 = points[((i - 1) * 2) + 1];\n x1 = points[i * 2];\n y1 = points[(i * 2) + 1];\n x2 = points[(i + 1) * 2];\n y2 = points[((i + 1) * 2) + 1];\n perpx = -(y0 - y1);\n perpy = x0 - x1;\n dist = Math.sqrt((perpx * perpx) + (perpy * perpy));\n perpx /= dist;\n perpy /= dist;\n perpx *= width;\n perpy *= width;\n perp1x = -(y1 - y2);\n perp1y = x1 - x2;\n dist = Math.sqrt((perp1x * perp1x) + (perp1y * perp1y));\n perp1x /= dist;\n perp1y /= dist;\n perp1x *= width;\n perp1y *= width;\n /* d[x|y](0|1) = the component displacment between points p(0,1|1,2) */\n var dx0 = x1 - x0;\n var dy0 = y0 - y1;\n var dx1 = x1 - x2;\n var dy1 = y2 - y1;\n /* +ve if internal angle counterclockwise, -ve if internal angle clockwise. */\n var cross = (dy0 * dx1) - (dy1 * dx0);\n var clockwise = (cross < 0);\n /* Going nearly straight? */\n if (Math.abs(cross) < 0.1) {\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight));\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight));\n continue;\n }\n /* p[x|y] is the miter point. pdist is the distance between miter point and p1. */\n var c1 = ((-perpx + x0) * (-perpy + y1)) - ((-perpx + x1) * (-perpy + y0));\n var c2 = ((-perp1x + x2) * (-perp1y + y1)) - ((-perp1x + x1) * (-perp1y + y2));\n var px = ((dx0 * c2) - (dx1 * c1)) / cross;\n var py = ((dy1 * c1) - (dy0 * c2)) / cross;\n var pdist = ((px - x1) * (px - x1)) + ((py - y1) * (py - y1));\n /* Inner miter point */\n var imx = x1 + ((px - x1) * innerWeight);\n var imy = y1 + ((py - y1) * innerWeight);\n /* Outer miter point */\n var omx = x1 - ((px - x1) * outerWeight);\n var omy = y1 - ((py - y1) * outerWeight);\n /* Is the inside miter point too far away, creating a spike? */\n var smallerInsideSegmentSq = Math.min((dx0 * dx0) + (dy0 * dy0), (dx1 * dx1) + (dy1 * dy1));\n var insideWeight = clockwise ? innerWeight : outerWeight;\n var smallerInsideDiagonalSq = smallerInsideSegmentSq + (insideWeight * insideWeight * widthSquared);\n var insideMiterOk = pdist <= smallerInsideDiagonalSq;\n if (insideMiterOk) {\n if (style.join === LINE_JOIN.BEVEL || pdist / widthSquared > miterLimitSquared) {\n if (clockwise) /* rotating at inner angle */ {\n verts.push(imx, imy); // inner miter point\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight)); // first segment's outer vertex\n verts.push(imx, imy); // inner miter point\n verts.push(x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight)); // second segment's outer vertex\n }\n else /* rotating at outer angle */ {\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight)); // first segment's inner vertex\n verts.push(omx, omy); // outer miter point\n verts.push(x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight)); // second segment's outer vertex\n verts.push(omx, omy); // outer miter point\n }\n indexCount += 2;\n }\n else if (style.join === LINE_JOIN.ROUND) {\n if (clockwise) /* arc is outside */ {\n verts.push(imx, imy);\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight));\n indexCount += round(x1, y1, x1 + (perpx * outerWeight), y1 + (perpy * outerWeight), x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight), verts, true) + 4;\n verts.push(imx, imy);\n verts.push(x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight));\n }\n else /* arc is inside */ {\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight));\n verts.push(omx, omy);\n indexCount += round(x1, y1, x1 - (perpx * innerWeight), y1 - (perpy * innerWeight), x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight), verts, false) + 4;\n verts.push(x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight));\n verts.push(omx, omy);\n }\n }\n else {\n verts.push(imx, imy);\n verts.push(omx, omy);\n }\n }\n else // inside miter is NOT ok\n {\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight)); // first segment's inner vertex\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight)); // first segment's outer vertex\n if (style.join === LINE_JOIN.BEVEL || pdist / widthSquared > miterLimitSquared) ;\n else if (style.join === LINE_JOIN.ROUND) {\n if (clockwise) /* arc is outside */ {\n indexCount += round(x1, y1, x1 + (perpx * outerWeight), y1 + (perpy * outerWeight), x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight), verts, true) + 2;\n }\n else /* arc is inside */ {\n indexCount += round(x1, y1, x1 - (perpx * innerWeight), y1 - (perpy * innerWeight), x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight), verts, false) + 2;\n }\n }\n else {\n if (clockwise) {\n verts.push(omx, omy); // inner miter point\n verts.push(omx, omy); // inner miter point\n }\n else {\n verts.push(imx, imy); // outer miter point\n verts.push(imx, imy); // outer miter point\n }\n indexCount += 2;\n }\n verts.push(x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight)); // second segment's inner vertex\n verts.push(x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight)); // second segment's outer vertex\n indexCount += 2;\n }\n }\n x0 = points[(length - 2) * 2];\n y0 = points[((length - 2) * 2) + 1];\n x1 = points[(length - 1) * 2];\n y1 = points[((length - 1) * 2) + 1];\n perpx = -(y0 - y1);\n perpy = x0 - x1;\n dist = Math.sqrt((perpx * perpx) + (perpy * perpy));\n perpx /= dist;\n perpy /= dist;\n perpx *= width;\n perpy *= width;\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight));\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight));\n if (!closedShape) {\n if (style.cap === LINE_CAP.ROUND) {\n indexCount += round(x1 - (perpx * (innerWeight - outerWeight) * 0.5), y1 - (perpy * (innerWeight - outerWeight) * 0.5), x1 - (perpx * innerWeight), y1 - (perpy * innerWeight), x1 + (perpx * outerWeight), y1 + (perpy * outerWeight), verts, false) + 2;\n }\n else if (style.cap === LINE_CAP.SQUARE) {\n indexCount += square(x1, y1, perpx, perpy, innerWeight, outerWeight, false, verts);\n }\n }\n var indices = graphicsGeometry.indices;\n var eps2 = GRAPHICS_CURVES.epsilon * GRAPHICS_CURVES.epsilon;\n // indices.push(indexStart);\n for (var i = indexStart; i < indexCount + indexStart - 2; ++i) {\n x0 = verts[(i * 2)];\n y0 = verts[(i * 2) + 1];\n x1 = verts[(i + 1) * 2];\n y1 = verts[((i + 1) * 2) + 1];\n x2 = verts[(i + 2) * 2];\n y2 = verts[((i + 2) * 2) + 1];\n /* Skip zero area triangles */\n if (Math.abs((x0 * (y1 - y2)) + (x1 * (y2 - y0)) + (x2 * (y0 - y1))) < eps2) {\n continue;\n }\n indices.push(i, i + 1, i + 2);\n }\n}\n/**\n * Builds a line to draw using the gl.drawArrays(gl.LINES) method\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.GraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {PIXI.GraphicsGeometry} graphicsGeometry - Geometry where to append output\n */\nfunction buildNativeLine(graphicsData, graphicsGeometry) {\n var i = 0;\n var shape = graphicsData.shape;\n var points = graphicsData.points || shape.points;\n var closedShape = shape.type !== SHAPES.POLY || shape.closeStroke;\n if (points.length === 0)\n { return; }\n var verts = graphicsGeometry.points;\n var indices = graphicsGeometry.indices;\n var length = points.length / 2;\n var startIndex = verts.length / 2;\n var currentIndex = startIndex;\n verts.push(points[0], points[1]);\n for (i = 1; i < length; i++) {\n verts.push(points[i * 2], points[(i * 2) + 1]);\n indices.push(currentIndex, currentIndex + 1);\n currentIndex++;\n }\n if (closedShape) {\n indices.push(currentIndex, startIndex);\n }\n}\n/**\n * Builds a line to draw\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @private\n * @param {PIXI.GraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {PIXI.GraphicsGeometry} graphicsGeometry - Geometry where to append output\n */\nfunction buildLine(graphicsData, graphicsGeometry) {\n if (graphicsData.lineStyle.native) {\n buildNativeLine(graphicsData, graphicsGeometry);\n }\n else {\n buildNonNativeLine(graphicsData, graphicsGeometry);\n }\n}\n\n/**\n * Draw a star shape with an arbitrary number of points.\n *\n * @class\n * @extends PIXI.Polygon\n * @memberof PIXI.graphicsUtils\n * @param {number} x - Center X position of the star\n * @param {number} y - Center Y position of the star\n * @param {number} points - The number of points of the star, must be > 1\n * @param {number} radius - The outer radius of the star\n * @param {number} [innerRadius] - The inner radius between points, default half `radius`\n * @param {number} [rotation=0] - The rotation of the star in radians, where 0 is vertical\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\nvar Star = /** @class */ (function (_super) {\n __extends(Star, _super);\n function Star(x, y, points, radius, innerRadius, rotation) {\n if (rotation === void 0) { rotation = 0; }\n var _this = this;\n innerRadius = innerRadius || radius / 2;\n var startAngle = (-1 * Math.PI / 2) + rotation;\n var len = points * 2;\n var delta = PI_2 / len;\n var polygon = [];\n for (var i = 0; i < len; i++) {\n var r = i % 2 ? innerRadius : radius;\n var angle = (i * delta) + startAngle;\n polygon.push(x + (r * Math.cos(angle)), y + (r * Math.sin(angle)));\n }\n _this = _super.call(this, polygon) || this;\n return _this;\n }\n return Star;\n}(Polygon));\n\n/**\n * Utilities for arc curves\n * @class\n * @private\n */\nvar ArcUtils = /** @class */ (function () {\n function ArcUtils() {\n }\n /**\n * The arcTo() method creates an arc/curve between two tangents on the canvas.\n *\n * \"borrowed\" from https://code.google.com/p/fxcanvas/ - thanks google!\n *\n * @private\n * @param {number} x1 - The x-coordinate of the beginning of the arc\n * @param {number} y1 - The y-coordinate of the beginning of the arc\n * @param {number} x2 - The x-coordinate of the end of the arc\n * @param {number} y2 - The y-coordinate of the end of the arc\n * @param {number} radius - The radius of the arc\n * @return {object} If the arc length is valid, return center of circle, radius and other info otherwise `null`.\n */\n ArcUtils.curveTo = function (x1, y1, x2, y2, radius, points) {\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n var a1 = fromY - y1;\n var b1 = fromX - x1;\n var a2 = y2 - y1;\n var b2 = x2 - x1;\n var mm = Math.abs((a1 * b2) - (b1 * a2));\n if (mm < 1.0e-8 || radius === 0) {\n if (points[points.length - 2] !== x1 || points[points.length - 1] !== y1) {\n points.push(x1, y1);\n }\n return null;\n }\n var dd = (a1 * a1) + (b1 * b1);\n var cc = (a2 * a2) + (b2 * b2);\n var tt = (a1 * a2) + (b1 * b2);\n var k1 = radius * Math.sqrt(dd) / mm;\n var k2 = radius * Math.sqrt(cc) / mm;\n var j1 = k1 * tt / dd;\n var j2 = k2 * tt / cc;\n var cx = (k1 * b2) + (k2 * b1);\n var cy = (k1 * a2) + (k2 * a1);\n var px = b1 * (k2 + j1);\n var py = a1 * (k2 + j1);\n var qx = b2 * (k1 + j2);\n var qy = a2 * (k1 + j2);\n var startAngle = Math.atan2(py - cy, px - cx);\n var endAngle = Math.atan2(qy - cy, qx - cx);\n return {\n cx: (cx + x1),\n cy: (cy + y1),\n radius: radius,\n startAngle: startAngle,\n endAngle: endAngle,\n anticlockwise: (b1 * a2 > b2 * a1),\n };\n };\n /* eslint-disable max-len */\n /**\n * The arc method creates an arc/curve (used to create circles, or parts of circles).\n *\n * @private\n * @param {number} startX - Start x location of arc\n * @param {number} startY - Start y location of arc\n * @param {number} cx - The x-coordinate of the center of the circle\n * @param {number} cy - The y-coordinate of the center of the circle\n * @param {number} radius - The radius of the circle\n * @param {number} startAngle - The starting angle, in radians (0 is at the 3 o'clock position\n * of the arc's circle)\n * @param {number} endAngle - The ending angle, in radians\n * @param {boolean} anticlockwise - Specifies whether the drawing should be\n * counter-clockwise or clockwise. False is default, and indicates clockwise, while true\n * indicates counter-clockwise.\n * @param {number[]} points - Collection of points to add to\n */\n ArcUtils.arc = function (_startX, _startY, cx, cy, radius, startAngle, endAngle, _anticlockwise, points) {\n var sweep = endAngle - startAngle;\n var n = GRAPHICS_CURVES._segmentsCount(Math.abs(sweep) * radius, Math.ceil(Math.abs(sweep) / PI_2) * 40);\n var theta = (sweep) / (n * 2);\n var theta2 = theta * 2;\n var cTheta = Math.cos(theta);\n var sTheta = Math.sin(theta);\n var segMinus = n - 1;\n var remainder = (segMinus % 1) / segMinus;\n for (var i = 0; i <= segMinus; ++i) {\n var real = i + (remainder * i);\n var angle = ((theta) + startAngle + (theta2 * real));\n var c = Math.cos(angle);\n var s = -Math.sin(angle);\n points.push((((cTheta * c) + (sTheta * s)) * radius) + cx, (((cTheta * -s) + (sTheta * c)) * radius) + cy);\n }\n };\n return ArcUtils;\n}());\n\n/**\n * Utilities for bezier curves\n * @class\n * @private\n */\nvar BezierUtils = /** @class */ (function () {\n function BezierUtils() {\n }\n /**\n * Calculate length of bezier curve.\n * Analytical solution is impossible, since it involves an integral that does not integrate in general.\n * Therefore numerical solution is used.\n *\n * @private\n * @param {number} fromX - Starting point x\n * @param {number} fromY - Starting point y\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} cpX2 - Second Control point x\n * @param {number} cpY2 - Second Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @return {number} Length of bezier curve\n */\n BezierUtils.curveLength = function (fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY) {\n var n = 10;\n var result = 0.0;\n var t = 0.0;\n var t2 = 0.0;\n var t3 = 0.0;\n var nt = 0.0;\n var nt2 = 0.0;\n var nt3 = 0.0;\n var x = 0.0;\n var y = 0.0;\n var dx = 0.0;\n var dy = 0.0;\n var prevX = fromX;\n var prevY = fromY;\n for (var i = 1; i <= n; ++i) {\n t = i / n;\n t2 = t * t;\n t3 = t2 * t;\n nt = (1.0 - t);\n nt2 = nt * nt;\n nt3 = nt2 * nt;\n x = (nt3 * fromX) + (3.0 * nt2 * t * cpX) + (3.0 * nt * t2 * cpX2) + (t3 * toX);\n y = (nt3 * fromY) + (3.0 * nt2 * t * cpY) + (3 * nt * t2 * cpY2) + (t3 * toY);\n dx = prevX - x;\n dy = prevY - y;\n prevX = x;\n prevY = y;\n result += Math.sqrt((dx * dx) + (dy * dy));\n }\n return result;\n };\n /**\n * Calculate the points for a bezier curve and then draws it.\n *\n * Ignored from docs since it is not directly exposed.\n *\n * @ignore\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} cpX2 - Second Control point x\n * @param {number} cpY2 - Second Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @param {number[]} points - Path array to push points into\n */\n BezierUtils.curveTo = function (cpX, cpY, cpX2, cpY2, toX, toY, points) {\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n points.length -= 2;\n var n = GRAPHICS_CURVES._segmentsCount(BezierUtils.curveLength(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY));\n var dt = 0;\n var dt2 = 0;\n var dt3 = 0;\n var t2 = 0;\n var t3 = 0;\n points.push(fromX, fromY);\n for (var i = 1, j = 0; i <= n; ++i) {\n j = i / n;\n dt = (1 - j);\n dt2 = dt * dt;\n dt3 = dt2 * dt;\n t2 = j * j;\n t3 = t2 * j;\n points.push((dt3 * fromX) + (3 * dt2 * j * cpX) + (3 * dt * t2 * cpX2) + (t3 * toX), (dt3 * fromY) + (3 * dt2 * j * cpY) + (3 * dt * t2 * cpY2) + (t3 * toY));\n }\n };\n return BezierUtils;\n}());\n\n/**\n * Utilities for quadratic curves\n * @class\n * @private\n */\nvar QuadraticUtils = /** @class */ (function () {\n function QuadraticUtils() {\n }\n /**\n * Calculate length of quadratic curve\n * @see {@link http://www.malczak.linuxpl.com/blog/quadratic-bezier-curve-length/}\n * for the detailed explanation of math behind this.\n *\n * @private\n * @param {number} fromX - x-coordinate of curve start point\n * @param {number} fromY - y-coordinate of curve start point\n * @param {number} cpX - x-coordinate of curve control point\n * @param {number} cpY - y-coordinate of curve control point\n * @param {number} toX - x-coordinate of curve end point\n * @param {number} toY - y-coordinate of curve end point\n * @return {number} Length of quadratic curve\n */\n QuadraticUtils.curveLength = function (fromX, fromY, cpX, cpY, toX, toY) {\n var ax = fromX - (2.0 * cpX) + toX;\n var ay = fromY - (2.0 * cpY) + toY;\n var bx = (2.0 * cpX) - (2.0 * fromX);\n var by = (2.0 * cpY) - (2.0 * fromY);\n var a = 4.0 * ((ax * ax) + (ay * ay));\n var b = 4.0 * ((ax * bx) + (ay * by));\n var c = (bx * bx) + (by * by);\n var s = 2.0 * Math.sqrt(a + b + c);\n var a2 = Math.sqrt(a);\n var a32 = 2.0 * a * a2;\n var c2 = 2.0 * Math.sqrt(c);\n var ba = b / a2;\n return ((a32 * s)\n + (a2 * b * (s - c2))\n + (((4.0 * c * a) - (b * b))\n * Math.log(((2.0 * a2) + ba + s) / (ba + c2)))) / (4.0 * a32);\n };\n /**\n * Calculate the points for a quadratic bezier curve and then draws it.\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n *\n * @private\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @param {number[]} points - Points to add segments to.\n */\n QuadraticUtils.curveTo = function (cpX, cpY, toX, toY, points) {\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n var n = GRAPHICS_CURVES._segmentsCount(QuadraticUtils.curveLength(fromX, fromY, cpX, cpY, toX, toY));\n var xa = 0;\n var ya = 0;\n for (var i = 1; i <= n; ++i) {\n var j = i / n;\n xa = fromX + ((cpX - fromX) * j);\n ya = fromY + ((cpY - fromY) * j);\n points.push(xa + (((cpX + ((toX - cpX) * j)) - xa) * j), ya + (((cpY + ((toY - cpY) * j)) - ya) * j));\n }\n };\n return QuadraticUtils;\n}());\n\n/**\n * A structure to hold interim batch objects for Graphics.\n * @class\n * @memberof PIXI.graphicsUtils\n */\nvar BatchPart = /** @class */ (function () {\n function BatchPart() {\n this.reset();\n }\n /**\n * Begin batch part\n *\n * @param {PIXI.FillStyle | PIXI.LineStyle} style\n * @param {number} startIndex\n * @param {number} attribStart\n */\n BatchPart.prototype.begin = function (style, startIndex, attribStart) {\n this.reset();\n this.style = style;\n this.start = startIndex;\n this.attribStart = attribStart;\n };\n /**\n * End batch part\n *\n * @param {number} endIndex\n * @param {number} endAttrib\n */\n BatchPart.prototype.end = function (endIndex, endAttrib) {\n this.attribSize = endAttrib - this.attribStart;\n this.size = endIndex - this.start;\n };\n BatchPart.prototype.reset = function () {\n this.style = null;\n this.size = 0;\n this.start = 0;\n this.attribStart = 0;\n this.attribSize = 0;\n };\n return BatchPart;\n}());\n\n/**\n * Generalized convenience utilities for Graphics.\n *\n * @namespace graphicsUtils\n * @memberof PIXI\n */\nvar _a;\n/**\n * Map of fill commands for each shape type.\n *\n * @memberof PIXI.graphicsUtils\n * @member {Object} FILL_COMMANDS\n */\nvar FILL_COMMANDS = (_a = {},\n _a[SHAPES.POLY] = buildPoly,\n _a[SHAPES.CIRC] = buildCircle,\n _a[SHAPES.ELIP] = buildCircle,\n _a[SHAPES.RECT] = buildRectangle,\n _a[SHAPES.RREC] = buildRoundedRectangle,\n _a);\n/**\n * Batch pool, stores unused batches for preventing allocations.\n *\n * @memberof PIXI.graphicsUtils\n * @member {Array} BATCH_POOL\n */\nvar BATCH_POOL = [];\n/**\n * Draw call pool, stores unused draw calls for preventing allocations.\n *\n * @memberof PIXI.graphicsUtils\n * @member {Array} DRAW_CALL_POOL\n */\nvar DRAW_CALL_POOL = [];\n\nvar index = ({\n buildPoly: buildPoly,\n buildCircle: buildCircle,\n buildRectangle: buildRectangle,\n buildRoundedRectangle: buildRoundedRectangle,\n FILL_COMMANDS: FILL_COMMANDS,\n BATCH_POOL: BATCH_POOL,\n DRAW_CALL_POOL: DRAW_CALL_POOL,\n buildLine: buildLine,\n Star: Star,\n ArcUtils: ArcUtils,\n BezierUtils: BezierUtils,\n QuadraticUtils: QuadraticUtils,\n BatchPart: BatchPart\n});\n\n/**\n * A class to contain data useful for Graphics objects\n *\n * @class\n * @memberof PIXI\n */\nvar GraphicsData = /** @class */ (function () {\n /**\n *\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.\n * @param {PIXI.FillStyle} [fillStyle] - the width of the line to draw\n * @param {PIXI.LineStyle} [lineStyle] - the color of the line to draw\n * @param {PIXI.Matrix} [matrix] - Transform matrix\n */\n function GraphicsData(shape, fillStyle, lineStyle, matrix) {\n if (fillStyle === void 0) { fillStyle = null; }\n if (lineStyle === void 0) { lineStyle = null; }\n if (matrix === void 0) { matrix = null; }\n /**\n * The shape object to draw.\n * @member {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle}\n */\n this.shape = shape;\n /**\n * The style of the line.\n * @member {PIXI.LineStyle}\n */\n this.lineStyle = lineStyle;\n /**\n * The style of the fill.\n * @member {PIXI.FillStyle}\n */\n this.fillStyle = fillStyle;\n /**\n * The transform matrix.\n * @member {PIXI.Matrix}\n */\n this.matrix = matrix;\n /**\n * The type of the shape, see the Const.Shapes file for all the existing types,\n * @member {number}\n */\n this.type = shape.type;\n /**\n * The collection of points.\n * @member {number[]}\n */\n this.points = [];\n /**\n * The collection of holes.\n * @member {PIXI.GraphicsData[]}\n */\n this.holes = [];\n }\n /**\n * Creates a new GraphicsData object with the same values as this one.\n *\n * @return {PIXI.GraphicsData} Cloned GraphicsData object\n */\n GraphicsData.prototype.clone = function () {\n return new GraphicsData(this.shape, this.fillStyle, this.lineStyle, this.matrix);\n };\n /**\n * Destroys the Graphics data.\n *\n */\n GraphicsData.prototype.destroy = function () {\n this.shape = null;\n this.holes.length = 0;\n this.holes = null;\n this.points.length = 0;\n this.points = null;\n this.lineStyle = null;\n this.fillStyle = null;\n };\n return GraphicsData;\n}());\n\nvar tmpPoint = new Point();\nvar tmpBounds = new Bounds();\n/**\n * The Graphics class contains methods used to draw primitive shapes such as lines, circles and\n * rectangles to the display, and to color and fill them.\n *\n * GraphicsGeometry is designed to not be continually updating the geometry since it's expensive\n * to re-tesselate using **earcut**. Consider using {@link PIXI.Mesh} for this use-case, it's much faster.\n *\n * @class\n * @extends PIXI.BatchGeometry\n * @memberof PIXI\n */\nvar GraphicsGeometry = /** @class */ (function (_super) {\n __extends(GraphicsGeometry, _super);\n function GraphicsGeometry() {\n var _this = _super.call(this) || this;\n _this.uvsFloat32 = null;\n _this.indicesUint16 = null;\n /**\n * An array of points to draw, 2 numbers per point\n *\n * @member {number[]}\n * @protected\n */\n _this.points = [];\n /**\n * The collection of colors\n *\n * @member {number[]}\n * @protected\n */\n _this.colors = [];\n /**\n * The UVs collection\n *\n * @member {number[]}\n * @protected\n */\n _this.uvs = [];\n /**\n * The indices of the vertices\n *\n * @member {number[]}\n * @protected\n */\n _this.indices = [];\n /**\n * Reference to the texture IDs.\n *\n * @member {number[]}\n * @protected\n */\n _this.textureIds = [];\n /**\n * The collection of drawn shapes.\n *\n * @member {PIXI.GraphicsData[]}\n * @protected\n */\n _this.graphicsData = [];\n /**\n * Used to detect if the graphics object has changed.\n *\n * @member {number}\n * @protected\n */\n _this.dirty = 0;\n /**\n * Batches need to regenerated if the geometry is updated.\n *\n * @member {number}\n * @protected\n */\n _this.batchDirty = -1;\n /**\n * Used to check if the cache is dirty.\n *\n * @member {number}\n * @protected\n */\n _this.cacheDirty = -1;\n /**\n * Used to detect if we cleared the graphicsData.\n *\n * @member {number}\n * @default 0\n * @protected\n */\n _this.clearDirty = 0;\n /**\n * List of current draw calls drived from the batches.\n *\n * @member {object[]}\n * @protected\n */\n _this.drawCalls = [];\n /**\n * Intermediate abstract format sent to batch system.\n * Can be converted to drawCalls or to batchable objects.\n *\n * @member {PIXI.graphicsUtils.BatchPart[]}\n * @protected\n */\n _this.batches = [];\n /**\n * Index of the last batched shape in the stack of calls.\n *\n * @member {number}\n * @protected\n */\n _this.shapeIndex = 0;\n /**\n * Cached bounds.\n *\n * @member {PIXI.Bounds}\n * @protected\n */\n _this._bounds = new Bounds();\n /**\n * The bounds dirty flag.\n *\n * @member {number}\n * @protected\n */\n _this.boundsDirty = -1;\n /**\n * Padding to add to the bounds.\n *\n * @member {number}\n * @default 0\n */\n _this.boundsPadding = 0;\n _this.batchable = false;\n _this.indicesUint16 = null;\n _this.uvsFloat32 = null;\n /**\n * Minimal distance between points that are considered different.\n * Affects line tesselation.\n *\n * @member {number}\n */\n _this.closePointEps = 1e-4;\n return _this;\n }\n Object.defineProperty(GraphicsGeometry.prototype, \"bounds\", {\n /**\n * Get the current bounds of the graphic geometry.\n *\n * @member {PIXI.Bounds}\n * @readonly\n */\n get: function () {\n if (this.boundsDirty !== this.dirty) {\n this.boundsDirty = this.dirty;\n this.calculateBounds();\n }\n return this._bounds;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Call if you changed graphicsData manually.\n * Empties all batch buffers.\n */\n GraphicsGeometry.prototype.invalidate = function () {\n this.boundsDirty = -1;\n this.dirty++;\n this.batchDirty++;\n this.shapeIndex = 0;\n this.points.length = 0;\n this.colors.length = 0;\n this.uvs.length = 0;\n this.indices.length = 0;\n this.textureIds.length = 0;\n for (var i = 0; i < this.drawCalls.length; i++) {\n this.drawCalls[i].texArray.clear();\n DRAW_CALL_POOL.push(this.drawCalls[i]);\n }\n this.drawCalls.length = 0;\n for (var i = 0; i < this.batches.length; i++) {\n var batchPart = this.batches[i];\n batchPart.reset();\n BATCH_POOL.push(batchPart);\n }\n this.batches.length = 0;\n };\n /**\n * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.\n *\n * @return {PIXI.GraphicsGeometry} This GraphicsGeometry object. Good for chaining method calls\n */\n GraphicsGeometry.prototype.clear = function () {\n if (this.graphicsData.length > 0) {\n this.invalidate();\n this.clearDirty++;\n this.graphicsData.length = 0;\n }\n return this;\n };\n /**\n * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.\n *\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.\n * @param {PIXI.FillStyle} fillStyle - Defines style of the fill.\n * @param {PIXI.LineStyle} lineStyle - Defines style of the lines.\n * @param {PIXI.Matrix} matrix - Transform applied to the points of the shape.\n * @return {PIXI.GraphicsGeometry} Returns geometry for chaining.\n */\n GraphicsGeometry.prototype.drawShape = function (shape, fillStyle, lineStyle, matrix) {\n if (fillStyle === void 0) { fillStyle = null; }\n if (lineStyle === void 0) { lineStyle = null; }\n if (matrix === void 0) { matrix = null; }\n var data = new GraphicsData(shape, fillStyle, lineStyle, matrix);\n this.graphicsData.push(data);\n this.dirty++;\n return this;\n };\n /**\n * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.\n *\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.\n * @param {PIXI.Matrix} matrix - Transform applied to the points of the shape.\n * @return {PIXI.GraphicsGeometry} Returns geometry for chaining.\n */\n GraphicsGeometry.prototype.drawHole = function (shape, matrix) {\n if (matrix === void 0) { matrix = null; }\n if (!this.graphicsData.length) {\n return null;\n }\n var data = new GraphicsData(shape, null, null, matrix);\n var lastShape = this.graphicsData[this.graphicsData.length - 1];\n data.lineStyle = lastShape.lineStyle;\n lastShape.holes.push(data);\n this.dirty++;\n return this;\n };\n /**\n * Destroys the GraphicsGeometry object.\n *\n */\n GraphicsGeometry.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n // destroy each of the GraphicsData objects\n for (var i = 0; i < this.graphicsData.length; ++i) {\n this.graphicsData[i].destroy();\n }\n this.points.length = 0;\n this.points = null;\n this.colors.length = 0;\n this.colors = null;\n this.uvs.length = 0;\n this.uvs = null;\n this.indices.length = 0;\n this.indices = null;\n this.indexBuffer.destroy();\n this.indexBuffer = null;\n this.graphicsData.length = 0;\n this.graphicsData = null;\n this.drawCalls.length = 0;\n this.drawCalls = null;\n this.batches.length = 0;\n this.batches = null;\n this._bounds = null;\n };\n /**\n * Check to see if a point is contained within this geometry.\n *\n * @param {PIXI.IPointData} point - Point to check if it's contained.\n * @return {Boolean} `true` if the point is contained within geometry.\n */\n GraphicsGeometry.prototype.containsPoint = function (point) {\n var graphicsData = this.graphicsData;\n for (var i = 0; i < graphicsData.length; ++i) {\n var data = graphicsData[i];\n if (!data.fillStyle.visible) {\n continue;\n }\n // only deal with fills..\n if (data.shape) {\n if (data.matrix) {\n data.matrix.applyInverse(point, tmpPoint);\n }\n else {\n tmpPoint.copyFrom(point);\n }\n if (data.shape.contains(tmpPoint.x, tmpPoint.y)) {\n var hitHole = false;\n if (data.holes) {\n for (var i_1 = 0; i_1 < data.holes.length; i_1++) {\n var hole = data.holes[i_1];\n if (hole.shape.contains(tmpPoint.x, tmpPoint.y)) {\n hitHole = true;\n break;\n }\n }\n }\n if (!hitHole) {\n return true;\n }\n }\n }\n }\n return false;\n };\n /**\n * Generates intermediate batch data. Either gets converted to drawCalls\n * or used to convert to batch objects directly by the Graphics object.\n *\n * @param {boolean} [aloow32Indices] - Allow using 32-bit indices for preventings artefacts when more that 65535 vertices\n */\n GraphicsGeometry.prototype.updateBatches = function (allow32Indices) {\n if (!this.graphicsData.length) {\n this.batchable = true;\n return;\n }\n if (!this.validateBatching()) {\n return;\n }\n this.cacheDirty = this.dirty;\n var uvs = this.uvs;\n var graphicsData = this.graphicsData;\n var batchPart = null;\n var currentStyle = null;\n if (this.batches.length > 0) {\n batchPart = this.batches[this.batches.length - 1];\n currentStyle = batchPart.style;\n }\n for (var i = this.shapeIndex; i < graphicsData.length; i++) {\n this.shapeIndex++;\n var data = graphicsData[i];\n var fillStyle = data.fillStyle;\n var lineStyle = data.lineStyle;\n var command = FILL_COMMANDS[data.type];\n // build out the shapes points..\n command.build(data);\n if (data.matrix) {\n this.transformPoints(data.points, data.matrix);\n }\n for (var j = 0; j < 2; j++) {\n var style = (j === 0) ? fillStyle : lineStyle;\n if (!style.visible)\n { continue; }\n var nextTexture = style.texture.baseTexture;\n var index_1 = this.indices.length;\n var attribIndex = this.points.length / 2;\n nextTexture.wrapMode = WRAP_MODES.REPEAT;\n if (j === 0) {\n this.processFill(data);\n }\n else {\n this.processLine(data);\n }\n var size = (this.points.length / 2) - attribIndex;\n if (size === 0)\n { continue; }\n // close batch if style is different\n if (batchPart && !this._compareStyles(currentStyle, style)) {\n batchPart.end(index_1, attribIndex);\n batchPart = null;\n }\n // spawn new batch if its first batch or previous was closed\n if (!batchPart) {\n batchPart = BATCH_POOL.pop() || new BatchPart();\n batchPart.begin(style, index_1, attribIndex);\n this.batches.push(batchPart);\n currentStyle = style;\n }\n this.addUvs(this.points, uvs, style.texture, attribIndex, size, style.matrix);\n }\n }\n var index = this.indices.length;\n var attrib = this.points.length / 2;\n if (batchPart) {\n batchPart.end(index, attrib);\n }\n if (this.batches.length === 0) {\n // there are no visible styles in GraphicsData\n // its possible that someone wants Graphics just for the bounds\n this.batchable = true;\n return;\n }\n // prevent allocation when length is same as buffer\n if (this.indicesUint16 && this.indices.length === this.indicesUint16.length) {\n this.indicesUint16.set(this.indices);\n }\n else {\n var need32 = attrib > 0xffff && allow32Indices;\n this.indicesUint16 = need32 ? new Uint32Array(this.indices) : new Uint16Array(this.indices);\n }\n // TODO make this a const..\n this.batchable = this.isBatchable();\n if (this.batchable) {\n this.packBatches();\n }\n else {\n this.buildDrawCalls();\n }\n };\n /**\n * Affinity check\n *\n * @param {PIXI.FillStyle | PIXI.LineStyle} styleA\n * @param {PIXI.FillStyle | PIXI.LineStyle} styleB\n */\n GraphicsGeometry.prototype._compareStyles = function (styleA, styleB) {\n if (!styleA || !styleB) {\n return false;\n }\n if (styleA.texture.baseTexture !== styleB.texture.baseTexture) {\n return false;\n }\n if (styleA.color + styleA.alpha !== styleB.color + styleB.alpha) {\n return false;\n }\n if (!!styleA.native !== !!styleB.native) {\n return false;\n }\n return true;\n };\n /**\n * Test geometry for batching process.\n *\n * @protected\n */\n GraphicsGeometry.prototype.validateBatching = function () {\n if (this.dirty === this.cacheDirty || !this.graphicsData.length) {\n return false;\n }\n for (var i = 0, l = this.graphicsData.length; i < l; i++) {\n var data = this.graphicsData[i];\n var fill = data.fillStyle;\n var line = data.lineStyle;\n if (fill && !fill.texture.baseTexture.valid)\n { return false; }\n if (line && !line.texture.baseTexture.valid)\n { return false; }\n }\n return true;\n };\n /**\n * Offset the indices so that it works with the batcher.\n *\n * @protected\n */\n GraphicsGeometry.prototype.packBatches = function () {\n this.batchDirty++;\n this.uvsFloat32 = new Float32Array(this.uvs);\n var batches = this.batches;\n for (var i = 0, l = batches.length; i < l; i++) {\n var batch = batches[i];\n for (var j = 0; j < batch.size; j++) {\n var index = batch.start + j;\n this.indicesUint16[index] = this.indicesUint16[index] - batch.attribStart;\n }\n }\n };\n /**\n * Checks to see if this graphics geometry can be batched.\n * Currently it needs to be small enough and not contain any native lines.\n *\n * @protected\n */\n GraphicsGeometry.prototype.isBatchable = function () {\n // prevent heavy mesh batching\n if (this.points.length > 0xffff * 2) {\n return false;\n }\n var batches = this.batches;\n for (var i = 0; i < batches.length; i++) {\n if (batches[i].style.native) {\n return false;\n }\n }\n return (this.points.length < GraphicsGeometry.BATCHABLE_SIZE * 2);\n };\n /**\n * Converts intermediate batches data to drawCalls.\n *\n * @protected\n */\n GraphicsGeometry.prototype.buildDrawCalls = function () {\n var TICK = ++BaseTexture._globalBatch;\n for (var i = 0; i < this.drawCalls.length; i++) {\n this.drawCalls[i].texArray.clear();\n DRAW_CALL_POOL.push(this.drawCalls[i]);\n }\n this.drawCalls.length = 0;\n var colors = this.colors;\n var textureIds = this.textureIds;\n var currentGroup = DRAW_CALL_POOL.pop();\n if (!currentGroup) {\n currentGroup = new BatchDrawCall();\n currentGroup.texArray = new BatchTextureArray();\n }\n currentGroup.texArray.count = 0;\n currentGroup.start = 0;\n currentGroup.size = 0;\n currentGroup.type = DRAW_MODES.TRIANGLES;\n var textureCount = 0;\n var currentTexture = null;\n var textureId = 0;\n var native = false;\n var drawMode = DRAW_MODES.TRIANGLES;\n var index = 0;\n this.drawCalls.push(currentGroup);\n // TODO - this can be simplified\n for (var i = 0; i < this.batches.length; i++) {\n var data = this.batches[i];\n // TODO add some full on MAX_TEXTURE CODE..\n var MAX_TEXTURES = 8;\n // Forced cast for checking `native` without errors\n var style = data.style;\n var nextTexture = style.texture.baseTexture;\n if (native !== !!style.native) {\n native = !!style.native;\n drawMode = native ? DRAW_MODES.LINES : DRAW_MODES.TRIANGLES;\n // force the batch to break!\n currentTexture = null;\n textureCount = MAX_TEXTURES;\n TICK++;\n }\n if (currentTexture !== nextTexture) {\n currentTexture = nextTexture;\n if (nextTexture._batchEnabled !== TICK) {\n if (textureCount === MAX_TEXTURES) {\n TICK++;\n textureCount = 0;\n if (currentGroup.size > 0) {\n currentGroup = DRAW_CALL_POOL.pop();\n if (!currentGroup) {\n currentGroup = new BatchDrawCall();\n currentGroup.texArray = new BatchTextureArray();\n }\n this.drawCalls.push(currentGroup);\n }\n currentGroup.start = index;\n currentGroup.size = 0;\n currentGroup.texArray.count = 0;\n currentGroup.type = drawMode;\n }\n // TODO add this to the render part..\n // Hack! Because texture has protected `touched`\n nextTexture.touched = 1; // touch;\n nextTexture._batchEnabled = TICK;\n nextTexture._batchLocation = textureCount;\n nextTexture.wrapMode = 10497;\n currentGroup.texArray.elements[currentGroup.texArray.count++] = nextTexture;\n textureCount++;\n }\n }\n currentGroup.size += data.size;\n index += data.size;\n textureId = nextTexture._batchLocation;\n this.addColors(colors, style.color, style.alpha, data.attribSize);\n this.addTextureIds(textureIds, textureId, data.attribSize);\n }\n BaseTexture._globalBatch = TICK;\n // upload..\n // merge for now!\n this.packAttributes();\n };\n /**\n * Packs attributes to single buffer.\n *\n * @protected\n */\n GraphicsGeometry.prototype.packAttributes = function () {\n var verts = this.points;\n var uvs = this.uvs;\n var colors = this.colors;\n var textureIds = this.textureIds;\n // verts are 2 positions.. so we * by 3 as there are 6 properties.. then 4 cos its bytes\n var glPoints = new ArrayBuffer(verts.length * 3 * 4);\n var f32 = new Float32Array(glPoints);\n var u32 = new Uint32Array(glPoints);\n var p = 0;\n for (var i = 0; i < verts.length / 2; i++) {\n f32[p++] = verts[i * 2];\n f32[p++] = verts[(i * 2) + 1];\n f32[p++] = uvs[i * 2];\n f32[p++] = uvs[(i * 2) + 1];\n u32[p++] = colors[i];\n f32[p++] = textureIds[i];\n }\n this._buffer.update(glPoints);\n this._indexBuffer.update(this.indicesUint16);\n };\n /**\n * Process fill part of Graphics.\n *\n * @param {PIXI.GraphicsData} data\n * @protected\n */\n GraphicsGeometry.prototype.processFill = function (data) {\n if (data.holes.length) {\n this.processHoles(data.holes);\n buildPoly.triangulate(data, this);\n }\n else {\n var command = FILL_COMMANDS[data.type];\n command.triangulate(data, this);\n }\n };\n /**\n * Process line part of Graphics.\n *\n * @param {PIXI.GraphicsData} data\n * @protected\n */\n GraphicsGeometry.prototype.processLine = function (data) {\n buildLine(data, this);\n for (var i = 0; i < data.holes.length; i++) {\n buildLine(data.holes[i], this);\n }\n };\n /**\n * Process the holes data.\n *\n * @param {PIXI.GraphicsData[]} holes - Holes to render\n * @protected\n */\n GraphicsGeometry.prototype.processHoles = function (holes) {\n for (var i = 0; i < holes.length; i++) {\n var hole = holes[i];\n var command = FILL_COMMANDS[hole.type];\n command.build(hole);\n if (hole.matrix) {\n this.transformPoints(hole.points, hole.matrix);\n }\n }\n };\n /**\n * Update the local bounds of the object. Expensive to use performance-wise.\n *\n * @protected\n */\n GraphicsGeometry.prototype.calculateBounds = function () {\n var bounds = this._bounds;\n var sequenceBounds = tmpBounds;\n var curMatrix = Matrix.IDENTITY;\n this._bounds.clear();\n sequenceBounds.clear();\n for (var i = 0; i < this.graphicsData.length; i++) {\n var data = this.graphicsData[i];\n var shape = data.shape;\n var type = data.type;\n var lineStyle = data.lineStyle;\n var nextMatrix = data.matrix || Matrix.IDENTITY;\n var lineWidth = 0.0;\n if (lineStyle && lineStyle.visible) {\n var alignment = lineStyle.alignment;\n lineWidth = lineStyle.width;\n if (type === SHAPES.POLY) {\n lineWidth = lineWidth * (0.5 + Math.abs(0.5 - alignment));\n }\n else {\n lineWidth = lineWidth * Math.max(0, alignment);\n }\n }\n if (curMatrix !== nextMatrix) {\n if (!sequenceBounds.isEmpty()) {\n bounds.addBoundsMatrix(sequenceBounds, curMatrix);\n sequenceBounds.clear();\n }\n curMatrix = nextMatrix;\n }\n if (type === SHAPES.RECT || type === SHAPES.RREC) {\n var rect = shape;\n sequenceBounds.addFramePad(rect.x, rect.y, rect.x + rect.width, rect.y + rect.height, lineWidth, lineWidth);\n }\n else if (type === SHAPES.CIRC) {\n var circle = shape;\n sequenceBounds.addFramePad(circle.x, circle.y, circle.x, circle.y, circle.radius + lineWidth, circle.radius + lineWidth);\n }\n else if (type === SHAPES.ELIP) {\n var ellipse = shape;\n sequenceBounds.addFramePad(ellipse.x, ellipse.y, ellipse.x, ellipse.y, ellipse.width + lineWidth, ellipse.height + lineWidth);\n }\n else {\n var poly = shape;\n // adding directly to the bounds\n bounds.addVerticesMatrix(curMatrix, poly.points, 0, poly.points.length, lineWidth, lineWidth);\n }\n }\n if (!sequenceBounds.isEmpty()) {\n bounds.addBoundsMatrix(sequenceBounds, curMatrix);\n }\n bounds.pad(this.boundsPadding, this.boundsPadding);\n };\n /**\n * Transform points using matrix.\n *\n * @protected\n * @param {number[]} points - Points to transform\n * @param {PIXI.Matrix} matrix - Transform matrix\n */\n GraphicsGeometry.prototype.transformPoints = function (points, matrix) {\n for (var i = 0; i < points.length / 2; i++) {\n var x = points[(i * 2)];\n var y = points[(i * 2) + 1];\n points[(i * 2)] = (matrix.a * x) + (matrix.c * y) + matrix.tx;\n points[(i * 2) + 1] = (matrix.b * x) + (matrix.d * y) + matrix.ty;\n }\n };\n /**\n * Add colors.\n *\n * @protected\n * @param {number[]} colors - List of colors to add to\n * @param {number} color - Color to add\n * @param {number} alpha - Alpha to use\n * @param {number} size - Number of colors to add\n */\n GraphicsGeometry.prototype.addColors = function (colors, color, alpha, size) {\n // TODO use the premultiply bits Ivan added\n var rgb = (color >> 16) + (color & 0xff00) + ((color & 0xff) << 16);\n var rgba = premultiplyTint(rgb, alpha);\n while (size-- > 0) {\n colors.push(rgba);\n }\n };\n /**\n * Add texture id that the shader/fragment wants to use.\n *\n * @protected\n * @param {number[]} textureIds\n * @param {number} id\n * @param {number} size\n */\n GraphicsGeometry.prototype.addTextureIds = function (textureIds, id, size) {\n while (size-- > 0) {\n textureIds.push(id);\n }\n };\n /**\n * Generates the UVs for a shape.\n *\n * @protected\n * @param {number[]} verts - Vertices\n * @param {number[]} uvs - UVs\n * @param {PIXI.Texture} texture - Reference to Texture\n * @param {number} start - Index buffer start index.\n * @param {number} size - The size/length for index buffer.\n * @param {PIXI.Matrix} [matrix] - Optional transform for all points.\n */\n GraphicsGeometry.prototype.addUvs = function (verts, uvs, texture, start, size, matrix) {\n if (matrix === void 0) { matrix = null; }\n var index = 0;\n var uvsStart = uvs.length;\n var frame = texture.frame;\n while (index < size) {\n var x = verts[(start + index) * 2];\n var y = verts[((start + index) * 2) + 1];\n if (matrix) {\n var nx = (matrix.a * x) + (matrix.c * y) + matrix.tx;\n y = (matrix.b * x) + (matrix.d * y) + matrix.ty;\n x = nx;\n }\n index++;\n uvs.push(x / frame.width, y / frame.height);\n }\n var baseTexture = texture.baseTexture;\n if (frame.width < baseTexture.width\n || frame.height < baseTexture.height) {\n this.adjustUvs(uvs, texture, uvsStart, size);\n }\n };\n /**\n * Modify uvs array according to position of texture region\n * Does not work with rotated or trimmed textures\n *\n * @param {number[]} uvs - array\n * @param {PIXI.Texture} texture - region\n * @param {number} start - starting index for uvs\n * @param {number} size - how many points to adjust\n */\n GraphicsGeometry.prototype.adjustUvs = function (uvs, texture, start, size) {\n var baseTexture = texture.baseTexture;\n var eps = 1e-6;\n var finish = start + (size * 2);\n var frame = texture.frame;\n var scaleX = frame.width / baseTexture.width;\n var scaleY = frame.height / baseTexture.height;\n var offsetX = frame.x / frame.width;\n var offsetY = frame.y / frame.height;\n var minX = Math.floor(uvs[start] + eps);\n var minY = Math.floor(uvs[start + 1] + eps);\n for (var i = start + 2; i < finish; i += 2) {\n minX = Math.min(minX, Math.floor(uvs[i] + eps));\n minY = Math.min(minY, Math.floor(uvs[i + 1] + eps));\n }\n offsetX -= minX;\n offsetY -= minY;\n for (var i = start; i < finish; i += 2) {\n uvs[i] = (uvs[i] + offsetX) * scaleX;\n uvs[i + 1] = (uvs[i + 1] + offsetY) * scaleY;\n }\n };\n /**\n * The maximum number of points to consider an object \"batchable\",\n * able to be batched by the renderer's batch system.\n *\n * @memberof PIXI.GraphicsGeometry\n * @static\n * @member {number} BATCHABLE_SIZE\n * @default 100\n */\n GraphicsGeometry.BATCHABLE_SIZE = 100;\n return GraphicsGeometry;\n}(BatchGeometry));\n\n/**\n * Represents the line style for Graphics.\n * @memberof PIXI\n * @class\n * @extends PIXI.FillStyle\n */\nvar LineStyle = /** @class */ (function (_super) {\n __extends(LineStyle, _super);\n function LineStyle() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n /**\n * The width (thickness) of any lines drawn.\n *\n * @member {number}\n * @default 0\n */\n _this.width = 0;\n /**\n * The alignment of any lines drawn (0.5 = middle, 1 = outer, 0 = inner).\n *\n * @member {number}\n * @default 0.5\n */\n _this.alignment = 0.5;\n /**\n * If true the lines will be draw using LINES instead of TRIANGLE_STRIP\n *\n * @member {boolean}\n * @default false\n */\n _this.native = false;\n /**\n * Line cap style.\n *\n * @member {PIXI.LINE_CAP}\n * @default PIXI.LINE_CAP.BUTT\n */\n _this.cap = LINE_CAP.BUTT;\n /**\n * Line join style.\n *\n * @member {PIXI.LINE_JOIN}\n * @default PIXI.LINE_JOIN.MITER\n */\n _this.join = LINE_JOIN.MITER;\n /**\n * Miter limit.\n *\n * @member {number}\n * @default 10\n */\n _this.miterLimit = 10;\n return _this;\n }\n /**\n * Clones the object\n *\n * @return {PIXI.LineStyle}\n */\n LineStyle.prototype.clone = function () {\n var obj = new LineStyle();\n obj.color = this.color;\n obj.alpha = this.alpha;\n obj.texture = this.texture;\n obj.matrix = this.matrix;\n obj.visible = this.visible;\n obj.width = this.width;\n obj.alignment = this.alignment;\n obj.native = this.native;\n obj.cap = this.cap;\n obj.join = this.join;\n obj.miterLimit = this.miterLimit;\n return obj;\n };\n /**\n * Reset the line style to default.\n */\n LineStyle.prototype.reset = function () {\n _super.prototype.reset.call(this);\n // Override default line style color\n this.color = 0x0;\n this.alignment = 0.5;\n this.width = 0;\n this.native = false;\n };\n return LineStyle;\n}(FillStyle));\n\nvar temp = new Float32Array(3);\n// a default shaders map used by graphics..\nvar DEFAULT_SHADERS = {};\n/**\n * The Graphics class contains methods used to draw primitive shapes such as lines, circles and\n * rectangles to the display, and to color and fill them.\n *\n * Note that because Graphics can share a GraphicsGeometry with other instances,\n * it is necessary to call `destroy()` to properly dereference the underlying\n * GraphicsGeometry and avoid a memory leak. Alternatively, keep using the same\n * Graphics instance and call `clear()` between redraws.\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI\n */\nvar Graphics = /** @class */ (function (_super) {\n __extends(Graphics, _super);\n /**\n * @param {PIXI.GraphicsGeometry} [geometry=null] - Geometry to use, if omitted\n * will create a new GraphicsGeometry instance.\n */\n function Graphics(geometry) {\n if (geometry === void 0) { geometry = null; }\n var _this = _super.call(this) || this;\n _this._geometry = geometry || new GraphicsGeometry();\n _this._geometry.refCount++;\n /**\n * Represents the vertex and fragment shaders that processes the geometry and runs on the GPU.\n * Can be shared between multiple Graphics objects.\n *\n * @member {PIXI.Shader}\n */\n _this.shader = null;\n /**\n * Represents the WebGL state the Graphics required to render, excludes shader and geometry. E.g.,\n * blend mode, culling, depth testing, direction of rendering triangles, backface, etc.\n *\n * @member {PIXI.State}\n */\n _this.state = State.for2d();\n /**\n * Current fill style\n *\n * @member {PIXI.FillStyle}\n * @protected\n */\n _this._fillStyle = new FillStyle();\n /**\n * Current line style\n *\n * @member {PIXI.LineStyle}\n * @protected\n */\n _this._lineStyle = new LineStyle();\n /**\n * Current shape transform matrix.\n *\n * @member {PIXI.Matrix}\n * @protected\n */\n _this._matrix = null;\n /**\n * Current hole mode is enabled.\n *\n * @member {boolean}\n * @default false\n * @protected\n */\n _this._holeMode = false;\n /**\n * Current path\n *\n * @member {PIXI.Polygon}\n * @protected\n */\n _this.currentPath = null;\n /**\n * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite.\n * This is useful if your graphics element does not change often, as it will speed up the rendering\n * of the object in exchange for taking up texture memory. It is also useful if you need the graphics\n * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if\n * you are constantly redrawing the graphics element.\n *\n * @name cacheAsBitmap\n * @member {boolean}\n * @memberof PIXI.Graphics#\n * @default false\n */\n /**\n * A collections of batches! These can be drawn by the renderer batch system.\n *\n * @protected\n * @member {object[]}\n */\n _this.batches = [];\n /**\n * Update dirty for limiting calculating tints for batches.\n *\n * @protected\n * @member {number}\n * @default -1\n */\n _this.batchTint = -1;\n /**\n * Update dirty for limiting calculating batches.\n *\n * @protected\n * @member {number}\n * @default -1\n */\n _this.batchDirty = -1;\n /**\n * Copy of the object vertex data.\n *\n * @protected\n * @member {Float32Array}\n */\n _this.vertexData = null;\n /**\n * Renderer plugin for batching\n *\n * @member {string}\n * @default 'batch'\n */\n _this.pluginName = 'batch';\n _this._transformID = -1;\n // Set default\n _this.tint = 0xFFFFFF;\n _this.blendMode = BLEND_MODES.NORMAL;\n return _this;\n }\n Object.defineProperty(Graphics.prototype, \"geometry\", {\n /**\n * Includes vertex positions, face indices, normals, colors, UVs, and\n * custom attributes within buffers, reducing the cost of passing all\n * this data to the GPU. Can be shared between multiple Mesh or Graphics objects.\n *\n * @member {PIXI.GraphicsGeometry}\n * @readonly\n */\n get: function () {\n return this._geometry;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Creates a new Graphics object with the same values as this one.\n * Note that only the geometry of the object is cloned, not its transform (position,scale,etc)\n *\n * @return {PIXI.Graphics} A clone of the graphics object\n */\n Graphics.prototype.clone = function () {\n this.finishPoly();\n return new Graphics(this._geometry);\n };\n Object.defineProperty(Graphics.prototype, \"blendMode\", {\n get: function () {\n return this.state.blendMode;\n },\n /**\n * The blend mode to be applied to the graphic shape. Apply a value of\n * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL;\n * @see PIXI.BLEND_MODES\n */\n set: function (value) {\n this.state.blendMode = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Graphics.prototype, \"tint\", {\n /**\n * The tint applied to the graphic shape. This is a hex value. A value of\n * 0xFFFFFF will remove any tint effect.\n *\n * @member {number}\n * @default 0xFFFFFF\n */\n get: function () {\n return this._tint;\n },\n set: function (value) {\n this._tint = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Graphics.prototype, \"fill\", {\n /**\n * The current fill style.\n *\n * @member {PIXI.FillStyle}\n * @readonly\n */\n get: function () {\n return this._fillStyle;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Graphics.prototype, \"line\", {\n /**\n * The current line style.\n *\n * @member {PIXI.LineStyle}\n * @readonly\n */\n get: function () {\n return this._lineStyle;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo()\n * method or the drawCircle() method.\n *\n * @method PIXI.Graphics#lineStyle\n * @param {number} [width=0] - width of the line to draw, will update the objects stored style\n * @param {number} [color=0x0] - color of the line to draw, will update the objects stored style\n * @param {number} [alpha=1] - alpha of the line to draw, will update the objects stored style\n * @param {number} [alignment=0.5] - alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outter)\n * @param {boolean} [native=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n /**\n * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo()\n * method or the drawCircle() method.\n *\n * @param {object} [options] - Line style options\n * @param {number} [options.width=0] - width of the line to draw, will update the objects stored style\n * @param {number} [options.color=0x0] - color of the line to draw, will update the objects stored style\n * @param {number} [options.alpha=1] - alpha of the line to draw, will update the objects stored style\n * @param {number} [options.alignment=0.5] - alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outter)\n * @param {boolean} [options.native=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP\n * @param {PIXI.LINE_CAP}[options.cap=PIXI.LINE_CAP.BUTT] - line cap style\n * @param {PIXI.LINE_JOIN}[options.join=PIXI.LINE_JOIN.MITER] - line join style\n * @param {number}[options.miterLimit=10] - miter limit ratio\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.lineStyle = function (options) {\n if (options === void 0) { options = null; }\n // Support non-object params: (width, color, alpha, alignment, native)\n if (typeof options === 'number') {\n // eslint-disable-next-line\n var args = arguments;\n options = {\n width: args[0] || 0,\n color: args[1] || 0x0,\n alpha: args[2] !== undefined ? args[2] : 1,\n alignment: args[3] !== undefined ? args[3] : 0.5,\n native: !!args[4],\n };\n }\n return this.lineTextureStyle(options);\n };\n /**\n * Like line style but support texture for line fill.\n *\n * @param {object} [options] - Collection of options for setting line style.\n * @param {number} [options.width=0] - width of the line to draw, will update the objects stored style\n * @param {PIXI.Texture} [options.texture=PIXI.Texture.WHITE] - Texture to use\n * @param {number} [options.color=0x0] - color of the line to draw, will update the objects stored style.\n * Default 0xFFFFFF if texture present.\n * @param {number} [options.alpha=1] - alpha of the line to draw, will update the objects stored style\n * @param {PIXI.Matrix} [options.matrix=null] - Texture matrix to transform texture\n * @param {number} [options.alignment=0.5] - alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outter)\n * @param {boolean} [options.native=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP\n * @param {PIXI.LINE_CAP}[options.cap=PIXI.LINE_CAP.BUTT] - line cap style\n * @param {PIXI.LINE_JOIN}[options.join=PIXI.LINE_JOIN.MITER] - line join style\n * @param {number}[options.miterLimit=10] - miter limit ratio\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.lineTextureStyle = function (options) {\n // backward compatibility with params: (width, texture,\n // color, alpha, matrix, alignment, native)\n if (typeof options === 'number') {\n deprecation('v5.2.0', 'Please use object-based options for Graphics#lineTextureStyle');\n // eslint-disable-next-line\n var _a = arguments, width = _a[0], texture = _a[1], color = _a[2], alpha = _a[3], matrix = _a[4], alignment = _a[5], native = _a[6];\n options = { width: width, texture: texture, color: color, alpha: alpha, matrix: matrix, alignment: alignment, native: native };\n // Remove undefined keys\n Object.keys(options).forEach(function (key) { return options[key] === undefined && delete options[key]; });\n }\n // Apply defaults\n options = Object.assign({\n width: 0,\n texture: Texture.WHITE,\n color: (options && options.texture) ? 0xFFFFFF : 0x0,\n alpha: 1,\n matrix: null,\n alignment: 0.5,\n native: false,\n cap: LINE_CAP.BUTT,\n join: LINE_JOIN.MITER,\n miterLimit: 10,\n }, options);\n if (this.currentPath) {\n this.startPoly();\n }\n var visible = options.width > 0 && options.alpha > 0;\n if (!visible) {\n this._lineStyle.reset();\n }\n else {\n if (options.matrix) {\n options.matrix = options.matrix.clone();\n options.matrix.invert();\n }\n Object.assign(this._lineStyle, { visible: visible }, options);\n }\n return this;\n };\n /**\n * Start a polygon object internally\n * @protected\n */\n Graphics.prototype.startPoly = function () {\n if (this.currentPath) {\n var points = this.currentPath.points;\n var len = this.currentPath.points.length;\n if (len > 2) {\n this.drawShape(this.currentPath);\n this.currentPath = new Polygon();\n this.currentPath.closeStroke = false;\n this.currentPath.points.push(points[len - 2], points[len - 1]);\n }\n }\n else {\n this.currentPath = new Polygon();\n this.currentPath.closeStroke = false;\n }\n };\n /**\n * Finish the polygon object.\n * @protected\n */\n Graphics.prototype.finishPoly = function () {\n if (this.currentPath) {\n if (this.currentPath.points.length > 2) {\n this.drawShape(this.currentPath);\n this.currentPath = null;\n }\n else {\n this.currentPath.points.length = 0;\n }\n }\n };\n /**\n * Moves the current drawing position to x, y.\n *\n * @param {number} x - the X coordinate to move to\n * @param {number} y - the Y coordinate to move to\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.moveTo = function (x, y) {\n this.startPoly();\n this.currentPath.points[0] = x;\n this.currentPath.points[1] = y;\n return this;\n };\n /**\n * Draws a line using the current line style from the current drawing position to (x, y);\n * The current drawing position is then set to (x, y).\n *\n * @param {number} x - the X coordinate to draw to\n * @param {number} y - the Y coordinate to draw to\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.lineTo = function (x, y) {\n if (!this.currentPath) {\n this.moveTo(0, 0);\n }\n // remove duplicates..\n var points = this.currentPath.points;\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n if (fromX !== x || fromY !== y) {\n points.push(x, y);\n }\n return this;\n };\n /**\n * Initialize the curve\n *\n * @protected\n * @param {number} [x=0]\n * @param {number} [y=0]\n */\n Graphics.prototype._initCurve = function (x, y) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (this.currentPath) {\n if (this.currentPath.points.length === 0) {\n this.currentPath.points = [x, y];\n }\n }\n else {\n this.moveTo(x, y);\n }\n };\n /**\n * Calculate the points for a quadratic bezier curve and then draws it.\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n *\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) {\n this._initCurve();\n var points = this.currentPath.points;\n if (points.length === 0) {\n this.moveTo(0, 0);\n }\n QuadraticUtils.curveTo(cpX, cpY, toX, toY, points);\n return this;\n };\n /**\n * Calculate the points for a bezier curve and then draws it.\n *\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} cpX2 - Second Control point x\n * @param {number} cpY2 - Second Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) {\n this._initCurve();\n BezierUtils.curveTo(cpX, cpY, cpX2, cpY2, toX, toY, this.currentPath.points);\n return this;\n };\n /**\n * The arcTo() method creates an arc/curve between two tangents on the canvas.\n *\n * \"borrowed\" from https://code.google.com/p/fxcanvas/ - thanks google!\n *\n * @param {number} x1 - The x-coordinate of the first tangent point of the arc\n * @param {number} y1 - The y-coordinate of the first tangent point of the arc\n * @param {number} x2 - The x-coordinate of the end of the arc\n * @param {number} y2 - The y-coordinate of the end of the arc\n * @param {number} radius - The radius of the arc\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) {\n this._initCurve(x1, y1);\n var points = this.currentPath.points;\n var result = ArcUtils.curveTo(x1, y1, x2, y2, radius, points);\n if (result) {\n var cx = result.cx, cy = result.cy, radius_1 = result.radius, startAngle = result.startAngle, endAngle = result.endAngle, anticlockwise = result.anticlockwise;\n this.arc(cx, cy, radius_1, startAngle, endAngle, anticlockwise);\n }\n return this;\n };\n /**\n * The arc method creates an arc/curve (used to create circles, or parts of circles).\n *\n * @param {number} cx - The x-coordinate of the center of the circle\n * @param {number} cy - The y-coordinate of the center of the circle\n * @param {number} radius - The radius of the circle\n * @param {number} startAngle - The starting angle, in radians (0 is at the 3 o'clock position\n * of the arc's circle)\n * @param {number} endAngle - The ending angle, in radians\n * @param {boolean} [anticlockwise=false] - Specifies whether the drawing should be\n * counter-clockwise or clockwise. False is default, and indicates clockwise, while true\n * indicates counter-clockwise.\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.arc = function (cx, cy, radius, startAngle, endAngle, anticlockwise) {\n if (anticlockwise === void 0) { anticlockwise = false; }\n if (startAngle === endAngle) {\n return this;\n }\n if (!anticlockwise && endAngle <= startAngle) {\n endAngle += PI_2;\n }\n else if (anticlockwise && startAngle <= endAngle) {\n startAngle += PI_2;\n }\n var sweep = endAngle - startAngle;\n if (sweep === 0) {\n return this;\n }\n var startX = cx + (Math.cos(startAngle) * radius);\n var startY = cy + (Math.sin(startAngle) * radius);\n var eps = this._geometry.closePointEps;\n // If the currentPath exists, take its points. Otherwise call `moveTo` to start a path.\n var points = this.currentPath ? this.currentPath.points : null;\n if (points) {\n // TODO: make a better fix.\n // We check how far our start is from the last existing point\n var xDiff = Math.abs(points[points.length - 2] - startX);\n var yDiff = Math.abs(points[points.length - 1] - startY);\n if (xDiff < eps && yDiff < eps) ;\n else {\n points.push(startX, startY);\n }\n }\n else {\n this.moveTo(startX, startY);\n points = this.currentPath.points;\n }\n ArcUtils.arc(startX, startY, cx, cy, radius, startAngle, endAngle, anticlockwise, points);\n return this;\n };\n /**\n * Specifies a simple one-color fill that subsequent calls to other Graphics methods\n * (such as lineTo() or drawCircle()) use when drawing.\n *\n * @param {number} [color=0] - the color of the fill\n * @param {number} [alpha=1] - the alpha of the fill\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.beginFill = function (color, alpha) {\n if (color === void 0) { color = 0; }\n if (alpha === void 0) { alpha = 1; }\n return this.beginTextureFill({ texture: Texture.WHITE, color: color, alpha: alpha });\n };\n /**\n * Begin the texture fill\n *\n * @param {object} [options] - Object object.\n * @param {PIXI.Texture} [options.texture=PIXI.Texture.WHITE] - Texture to fill\n * @param {number} [options.color=0xffffff] - Background to fill behind texture\n * @param {number} [options.alpha=1] - Alpha of fill\n * @param {PIXI.Matrix} [options.matrix=null] - Transform matrix\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.beginTextureFill = function (options) {\n // backward compatibility with params: (texture, color, alpha, matrix)\n if (options instanceof Texture) {\n deprecation('v5.2.0', 'Please use object-based options for Graphics#beginTextureFill');\n // eslint-disable-next-line\n var _a = arguments, texture = _a[0], color = _a[1], alpha = _a[2], matrix = _a[3];\n options = { texture: texture, color: color, alpha: alpha, matrix: matrix };\n // Remove undefined keys\n Object.keys(options).forEach(function (key) { return options[key] === undefined && delete options[key]; });\n }\n // Apply defaults\n options = Object.assign({\n texture: Texture.WHITE,\n color: 0xFFFFFF,\n alpha: 1,\n matrix: null,\n }, options);\n if (this.currentPath) {\n this.startPoly();\n }\n var visible = options.alpha > 0;\n if (!visible) {\n this._fillStyle.reset();\n }\n else {\n if (options.matrix) {\n options.matrix = options.matrix.clone();\n options.matrix.invert();\n }\n Object.assign(this._fillStyle, { visible: visible }, options);\n }\n return this;\n };\n /**\n * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.\n *\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.endFill = function () {\n this.finishPoly();\n this._fillStyle.reset();\n return this;\n };\n /**\n * Draws a rectangle shape.\n *\n * @param {number} x - The X coord of the top-left of the rectangle\n * @param {number} y - The Y coord of the top-left of the rectangle\n * @param {number} width - The width of the rectangle\n * @param {number} height - The height of the rectangle\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawRect = function (x, y, width, height) {\n return this.drawShape(new Rectangle(x, y, width, height));\n };\n /**\n * Draw a rectangle shape with rounded/beveled corners.\n *\n * @param {number} x - The X coord of the top-left of the rectangle\n * @param {number} y - The Y coord of the top-left of the rectangle\n * @param {number} width - The width of the rectangle\n * @param {number} height - The height of the rectangle\n * @param {number} radius - Radius of the rectangle corners\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawRoundedRect = function (x, y, width, height, radius) {\n return this.drawShape(new RoundedRectangle(x, y, width, height, radius));\n };\n /**\n * Draws a circle.\n *\n * @param {number} x - The X coordinate of the center of the circle\n * @param {number} y - The Y coordinate of the center of the circle\n * @param {number} radius - The radius of the circle\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawCircle = function (x, y, radius) {\n return this.drawShape(new Circle(x, y, radius));\n };\n /**\n * Draws an ellipse.\n *\n * @param {number} x - The X coordinate of the center of the ellipse\n * @param {number} y - The Y coordinate of the center of the ellipse\n * @param {number} width - The half width of the ellipse\n * @param {number} height - The half height of the ellipse\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawEllipse = function (x, y, width, height) {\n return this.drawShape(new Ellipse(x, y, width, height));\n };\n /**\n * Draws a polygon using the given path.\n *\n * @param {number[]|PIXI.Point[]|PIXI.Polygon} path - The path data used to construct the polygon.\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawPolygon = function () {\n var arguments$1 = arguments;\n\n var path = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n path[_i] = arguments$1[_i];\n }\n var points;\n var closeStroke = true; // !!this._fillStyle;\n var poly = path[0];\n // check if data has points..\n if (poly.points) {\n closeStroke = poly.closeStroke;\n points = poly.points;\n }\n else if (Array.isArray(path[0])) {\n points = path[0];\n }\n else {\n points = path;\n }\n var shape = new Polygon(points);\n shape.closeStroke = closeStroke;\n this.drawShape(shape);\n return this;\n };\n /**\n * Draw any shape.\n *\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - Shape to draw\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawShape = function (shape) {\n if (!this._holeMode) {\n this._geometry.drawShape(shape, this._fillStyle.clone(), this._lineStyle.clone(), this._matrix);\n }\n else {\n this._geometry.drawHole(shape, this._matrix);\n }\n return this;\n };\n /**\n * Draw a star shape with an arbitrary number of points.\n *\n * @param {number} x - Center X position of the star\n * @param {number} y - Center Y position of the star\n * @param {number} points - The number of points of the star, must be > 1\n * @param {number} radius - The outer radius of the star\n * @param {number} [innerRadius] - The inner radius between points, default half `radius`\n * @param {number} [rotation=0] - The rotation of the star in radians, where 0 is vertical\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawStar = function (x, y, points, radius, innerRadius, rotation) {\n if (rotation === void 0) { rotation = 0; }\n return this.drawPolygon(new Star(x, y, points, radius, innerRadius, rotation));\n };\n /**\n * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.\n *\n * @return {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.clear = function () {\n this._geometry.clear();\n this._lineStyle.reset();\n this._fillStyle.reset();\n this._boundsID++;\n this._matrix = null;\n this._holeMode = false;\n this.currentPath = null;\n return this;\n };\n /**\n * True if graphics consists of one rectangle, and thus, can be drawn like a Sprite and\n * masked with gl.scissor.\n *\n * @returns {boolean} True if only 1 rect.\n */\n Graphics.prototype.isFastRect = function () {\n var data = this._geometry.graphicsData;\n return data.length === 1\n && data[0].shape.type === SHAPES.RECT\n && !(data[0].lineStyle.visible && data[0].lineStyle.width);\n };\n /**\n * Renders the object using the WebGL renderer\n *\n * @protected\n * @param {PIXI.Renderer} renderer - The renderer\n */\n Graphics.prototype._render = function (renderer) {\n this.finishPoly();\n var geometry = this._geometry;\n var hasuint32 = renderer.context.supports.uint32Indices;\n // batch part..\n // batch it!\n geometry.updateBatches(hasuint32);\n if (geometry.batchable) {\n if (this.batchDirty !== geometry.batchDirty) {\n this._populateBatches();\n }\n this._renderBatched(renderer);\n }\n else {\n // no batching...\n renderer.batch.flush();\n this._renderDirect(renderer);\n }\n };\n /**\n * Populating batches for rendering\n *\n * @protected\n */\n Graphics.prototype._populateBatches = function () {\n var geometry = this._geometry;\n var blendMode = this.blendMode;\n var len = geometry.batches.length;\n this.batchTint = -1;\n this._transformID = -1;\n this.batchDirty = geometry.batchDirty;\n this.batches.length = len;\n this.vertexData = new Float32Array(geometry.points);\n for (var i = 0; i < len; i++) {\n var gI = geometry.batches[i];\n var color = gI.style.color;\n var vertexData = new Float32Array(this.vertexData.buffer, gI.attribStart * 4 * 2, gI.attribSize * 2);\n var uvs = new Float32Array(geometry.uvsFloat32.buffer, gI.attribStart * 4 * 2, gI.attribSize * 2);\n var indices = new Uint16Array(geometry.indicesUint16.buffer, gI.start * 2, gI.size);\n var batch = {\n vertexData: vertexData,\n blendMode: blendMode,\n indices: indices,\n uvs: uvs,\n _batchRGB: hex2rgb(color),\n _tintRGB: color,\n _texture: gI.style.texture,\n alpha: gI.style.alpha,\n worldAlpha: 1\n };\n this.batches[i] = batch;\n }\n };\n /**\n * Renders the batches using the BathedRenderer plugin\n *\n * @protected\n * @param {PIXI.Renderer} renderer - The renderer\n */\n Graphics.prototype._renderBatched = function (renderer) {\n if (!this.batches.length) {\n return;\n }\n renderer.batch.setObjectRenderer(renderer.plugins[this.pluginName]);\n this.calculateVertices();\n this.calculateTints();\n for (var i = 0, l = this.batches.length; i < l; i++) {\n var batch = this.batches[i];\n batch.worldAlpha = this.worldAlpha * batch.alpha;\n renderer.plugins[this.pluginName].render(batch);\n }\n };\n /**\n * Renders the graphics direct\n *\n * @protected\n * @param {PIXI.Renderer} renderer - The renderer\n */\n Graphics.prototype._renderDirect = function (renderer) {\n var shader = this._resolveDirectShader(renderer);\n var geometry = this._geometry;\n var tint = this.tint;\n var worldAlpha = this.worldAlpha;\n var uniforms = shader.uniforms;\n var drawCalls = geometry.drawCalls;\n // lets set the transfomr\n uniforms.translationMatrix = this.transform.worldTransform;\n // and then lets set the tint..\n uniforms.tint[0] = (((tint >> 16) & 0xFF) / 255) * worldAlpha;\n uniforms.tint[1] = (((tint >> 8) & 0xFF) / 255) * worldAlpha;\n uniforms.tint[2] = ((tint & 0xFF) / 255) * worldAlpha;\n uniforms.tint[3] = worldAlpha;\n // the first draw call, we can set the uniforms of the shader directly here.\n // this means that we can tack advantage of the sync function of pixi!\n // bind and sync uniforms..\n // there is a way to optimise this..\n renderer.shader.bind(shader);\n renderer.geometry.bind(geometry, shader);\n // set state..\n renderer.state.set(this.state);\n // then render the rest of them...\n for (var i = 0, l = drawCalls.length; i < l; i++) {\n this._renderDrawCallDirect(renderer, geometry.drawCalls[i]);\n }\n };\n /**\n * Renders specific DrawCall\n *\n * @param {PIXI.Renderer} renderer\n * @param {PIXI.BatchDrawCall} drawCall\n */\n Graphics.prototype._renderDrawCallDirect = function (renderer, drawCall) {\n var texArray = drawCall.texArray, type = drawCall.type, size = drawCall.size, start = drawCall.start;\n var groupTextureCount = texArray.count;\n for (var j = 0; j < groupTextureCount; j++) {\n renderer.texture.bind(texArray.elements[j], j);\n }\n renderer.geometry.draw(type, size, start);\n };\n /**\n * Resolves shader for direct rendering\n *\n * @protected\n * @param {PIXI.Renderer} renderer - The renderer\n */\n Graphics.prototype._resolveDirectShader = function (renderer) {\n var shader = this.shader;\n var pluginName = this.pluginName;\n if (!shader) {\n // if there is no shader here, we can use the default shader.\n // and that only gets created if we actually need it..\n // but may be more than one plugins for graphics\n if (!DEFAULT_SHADERS[pluginName]) {\n var MAX_TEXTURES = renderer.plugins.batch.MAX_TEXTURES;\n var sampleValues = new Int32Array(MAX_TEXTURES);\n for (var i = 0; i < MAX_TEXTURES; i++) {\n sampleValues[i] = i;\n }\n var uniforms = {\n tint: new Float32Array([1, 1, 1, 1]),\n translationMatrix: new Matrix(),\n default: UniformGroup.from({ uSamplers: sampleValues }, true),\n };\n var program = renderer.plugins[pluginName]._shader.program;\n DEFAULT_SHADERS[pluginName] = new Shader(program, uniforms);\n }\n shader = DEFAULT_SHADERS[pluginName];\n }\n return shader;\n };\n /**\n * Retrieves the bounds of the graphic shape as a rectangle object\n *\n * @protected\n */\n Graphics.prototype._calculateBounds = function () {\n this.finishPoly();\n var geometry = this._geometry;\n // skipping when graphics is empty, like a container\n if (!geometry.graphicsData.length) {\n return;\n }\n var _a = geometry.bounds, minX = _a.minX, minY = _a.minY, maxX = _a.maxX, maxY = _a.maxY;\n this._bounds.addFrame(this.transform, minX, minY, maxX, maxY);\n };\n /**\n * Tests if a point is inside this graphics object\n *\n * @param {PIXI.IPointData} point - the point to test\n * @return {boolean} the result of the test\n */\n Graphics.prototype.containsPoint = function (point) {\n this.worldTransform.applyInverse(point, Graphics._TEMP_POINT);\n return this._geometry.containsPoint(Graphics._TEMP_POINT);\n };\n /**\n * Recalcuate the tint by applying tin to batches using Graphics tint.\n * @protected\n */\n Graphics.prototype.calculateTints = function () {\n if (this.batchTint !== this.tint) {\n this.batchTint = this.tint;\n var tintRGB = hex2rgb(this.tint, temp);\n for (var i = 0; i < this.batches.length; i++) {\n var batch = this.batches[i];\n var batchTint = batch._batchRGB;\n var r = (tintRGB[0] * batchTint[0]) * 255;\n var g = (tintRGB[1] * batchTint[1]) * 255;\n var b = (tintRGB[2] * batchTint[2]) * 255;\n // TODO Ivan, can this be done in one go?\n var color = (r << 16) + (g << 8) + (b | 0);\n batch._tintRGB = (color >> 16)\n + (color & 0xff00)\n + ((color & 0xff) << 16);\n }\n }\n };\n /**\n * If there's a transform update or a change to the shape of the\n * geometry, recaculate the vertices.\n * @protected\n */\n Graphics.prototype.calculateVertices = function () {\n var wtID = this.transform._worldID;\n if (this._transformID === wtID) {\n return;\n }\n this._transformID = wtID;\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var data = this._geometry.points; // batch.vertexDataOriginal;\n var vertexData = this.vertexData;\n var count = 0;\n for (var i = 0; i < data.length; i += 2) {\n var x = data[i];\n var y = data[i + 1];\n vertexData[count++] = (a * x) + (c * y) + tx;\n vertexData[count++] = (d * y) + (b * x) + ty;\n }\n };\n /**\n * Closes the current path.\n *\n * @return {PIXI.Graphics} Returns itself.\n */\n Graphics.prototype.closePath = function () {\n var currentPath = this.currentPath;\n if (currentPath) {\n // we don't need to add extra point in the end because buildLine will take care of that\n currentPath.closeStroke = true;\n }\n return this;\n };\n /**\n * Apply a matrix to the positional data.\n *\n * @param {PIXI.Matrix} matrix - Matrix to use for transform current shape.\n * @return {PIXI.Graphics} Returns itself.\n */\n Graphics.prototype.setMatrix = function (matrix) {\n this._matrix = matrix;\n return this;\n };\n /**\n * Begin adding holes to the last draw shape\n * IMPORTANT: holes must be fully inside a shape to work\n * Also weirdness ensues if holes overlap!\n * Ellipses, Circles, Rectangles and Rounded Rectangles cannot be holes or host for holes in CanvasRenderer,\n * please use `moveTo` `lineTo`, `quadraticCurveTo` if you rely on pixi-legacy bundle.\n * @return {PIXI.Graphics} Returns itself.\n */\n Graphics.prototype.beginHole = function () {\n this.finishPoly();\n this._holeMode = true;\n return this;\n };\n /**\n * End adding holes to the last draw shape\n * @return {PIXI.Graphics} Returns itself.\n */\n Graphics.prototype.endHole = function () {\n this.finishPoly();\n this._holeMode = false;\n return this;\n };\n /**\n * Destroys the Graphics object.\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all\n * options have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have\n * their destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the texture of the child sprite\n * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the base texture of the child sprite\n */\n Graphics.prototype.destroy = function (options) {\n this._geometry.refCount--;\n if (this._geometry.refCount === 0) {\n this._geometry.dispose();\n }\n this._matrix = null;\n this.currentPath = null;\n this._lineStyle.destroy();\n this._lineStyle = null;\n this._fillStyle.destroy();\n this._fillStyle = null;\n this._geometry = null;\n this.shader = null;\n this.vertexData = null;\n this.batches.length = 0;\n this.batches = null;\n _super.prototype.destroy.call(this, options);\n };\n /**\n * Temporary point to use for containsPoint\n *\n * @static\n * @private\n * @member {PIXI.Point}\n */\n Graphics._TEMP_POINT = new Point();\n return Graphics;\n}(Container));\n\nexport { FillStyle, GRAPHICS_CURVES, Graphics, GraphicsData, GraphicsGeometry, LINE_CAP, LINE_JOIN, LineStyle, index as graphicsUtils };\n//# sourceMappingURL=graphics.es.js.map\n","/*!\n * @pixi/sprite - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/sprite is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { BLEND_MODES } from '@pixi/constants';\nimport { Texture } from '@pixi/core';\nimport { Container } from '@pixi/display';\nimport { Point, ObservablePoint, Rectangle } from '@pixi/math';\nimport { settings } from '@pixi/settings';\nimport { sign } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar tempPoint = new Point();\nvar indices = new Uint16Array([0, 1, 2, 0, 2, 3]);\n/**\n * The Sprite object is the base for all textured objects that are rendered to the screen\n*\n * A sprite can be created directly from an image like this:\n *\n * ```js\n * let sprite = PIXI.Sprite.from('assets/image.png');\n * ```\n *\n * The more efficient way to create sprites is using a {@link PIXI.Spritesheet},\n * as swapping base textures when rendering to the screen is inefficient.\n *\n * ```js\n * PIXI.Loader.shared.add(\"assets/spritesheet.json\").load(setup);\n *\n * function setup() {\n * let sheet = PIXI.Loader.shared.resources[\"assets/spritesheet.json\"].spritesheet;\n * let sprite = new PIXI.Sprite(sheet.textures[\"image.png\"]);\n * ...\n * }\n * ```\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI\n */\nvar Sprite = /** @class */ (function (_super) {\n __extends(Sprite, _super);\n /**\n * @param {PIXI.Texture} [texture] - The texture for this sprite.\n */\n function Sprite(texture) {\n var _this = _super.call(this) || this;\n /**\n * The anchor point defines the normalized coordinates\n * in the texture that map to the position of this\n * sprite.\n *\n * By default, this is `(0,0)` (or `texture.defaultAnchor`\n * if you have modified that), which means the position\n * `(x,y)` of this `Sprite` will be the top-left corner.\n *\n * Note: Updating `texture.defaultAnchor` after\n * constructing a `Sprite` does _not_ update its anchor.\n *\n * {@link https://docs.cocos2d-x.org/cocos2d-x/en/sprites/manipulation.html}\n *\n * @default `texture.defaultAnchor`\n * @member {PIXI.ObservablePoint}\n * @private\n */\n _this._anchor = new ObservablePoint(_this._onAnchorUpdate, _this, (texture ? texture.defaultAnchor.x : 0), (texture ? texture.defaultAnchor.y : 0));\n /**\n * The texture that the sprite is using\n *\n * @private\n * @member {PIXI.Texture}\n */\n _this._texture = null;\n /**\n * The width of the sprite (this is initially set by the texture)\n *\n * @protected\n * @member {number}\n */\n _this._width = 0;\n /**\n * The height of the sprite (this is initially set by the texture)\n *\n * @protected\n * @member {number}\n */\n _this._height = 0;\n /**\n * The tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.\n *\n * @private\n * @member {number}\n * @default 0xFFFFFF\n */\n _this._tint = null;\n /**\n * The tint applied to the sprite. This is a RGB value. A value of 0xFFFFFF will remove any tint effect.\n *\n * @private\n * @member {number}\n * @default 16777215\n */\n _this._tintRGB = null;\n _this.tint = 0xFFFFFF;\n /**\n * The blend mode to be applied to the sprite. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL\n * @see PIXI.BLEND_MODES\n */\n _this.blendMode = BLEND_MODES.NORMAL;\n /**\n * Cached tint value so we can tell when the tint is changed.\n * Value is used for 2d CanvasRenderer.\n *\n * @protected\n * @member {number}\n * @default 0xFFFFFF\n */\n _this._cachedTint = 0xFFFFFF;\n /**\n * this is used to store the uvs data of the sprite, assigned at the same time\n * as the vertexData in calculateVertices()\n *\n * @private\n * @member {Float32Array}\n */\n _this.uvs = null;\n // call texture setter\n _this.texture = texture || Texture.EMPTY;\n /**\n * this is used to store the vertex data of the sprite (basically a quad)\n *\n * @private\n * @member {Float32Array}\n */\n _this.vertexData = new Float32Array(8);\n /**\n * This is used to calculate the bounds of the object IF it is a trimmed sprite\n *\n * @private\n * @member {Float32Array}\n */\n _this.vertexTrimmedData = null;\n _this._transformID = -1;\n _this._textureID = -1;\n _this._transformTrimmedID = -1;\n _this._textureTrimmedID = -1;\n // Batchable stuff..\n // TODO could make this a mixin?\n _this.indices = indices;\n /**\n * Plugin that is responsible for rendering this element.\n * Allows to customize the rendering process without overriding '_render' & '_renderCanvas' methods.\n *\n * @member {string}\n * @default 'batch'\n */\n _this.pluginName = 'batch';\n /**\n * used to fast check if a sprite is.. a sprite!\n * @member {boolean}\n */\n _this.isSprite = true;\n /**\n * Internal roundPixels field\n *\n * @member {boolean}\n * @private\n */\n _this._roundPixels = settings.ROUND_PIXELS;\n return _this;\n }\n /**\n * When the texture is updated, this event will fire to update the scale and frame\n *\n * @protected\n */\n Sprite.prototype._onTextureUpdate = function () {\n this._textureID = -1;\n this._textureTrimmedID = -1;\n this._cachedTint = 0xFFFFFF;\n // so if _width is 0 then width was not set..\n if (this._width) {\n this.scale.x = sign(this.scale.x) * this._width / this._texture.orig.width;\n }\n if (this._height) {\n this.scale.y = sign(this.scale.y) * this._height / this._texture.orig.height;\n }\n };\n /**\n * Called when the anchor position updates.\n *\n * @private\n */\n Sprite.prototype._onAnchorUpdate = function () {\n this._transformID = -1;\n this._transformTrimmedID = -1;\n };\n /**\n * calculates worldTransform * vertices, store it in vertexData\n */\n Sprite.prototype.calculateVertices = function () {\n var texture = this._texture;\n if (this._transformID === this.transform._worldID && this._textureID === texture._updateID) {\n return;\n }\n // update texture UV here, because base texture can be changed without calling `_onTextureUpdate`\n if (this._textureID !== texture._updateID) {\n this.uvs = this._texture._uvs.uvsFloat32;\n }\n this._transformID = this.transform._worldID;\n this._textureID = texture._updateID;\n // set the vertex data\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var vertexData = this.vertexData;\n var trim = texture.trim;\n var orig = texture.orig;\n var anchor = this._anchor;\n var w0 = 0;\n var w1 = 0;\n var h0 = 0;\n var h1 = 0;\n if (trim) {\n // if the sprite is trimmed and is not a tilingsprite then we need to add the extra\n // space before transforming the sprite coords.\n w1 = trim.x - (anchor._x * orig.width);\n w0 = w1 + trim.width;\n h1 = trim.y - (anchor._y * orig.height);\n h0 = h1 + trim.height;\n }\n else {\n w1 = -anchor._x * orig.width;\n w0 = w1 + orig.width;\n h1 = -anchor._y * orig.height;\n h0 = h1 + orig.height;\n }\n // xy\n vertexData[0] = (a * w1) + (c * h1) + tx;\n vertexData[1] = (d * h1) + (b * w1) + ty;\n // xy\n vertexData[2] = (a * w0) + (c * h1) + tx;\n vertexData[3] = (d * h1) + (b * w0) + ty;\n // xy\n vertexData[4] = (a * w0) + (c * h0) + tx;\n vertexData[5] = (d * h0) + (b * w0) + ty;\n // xy\n vertexData[6] = (a * w1) + (c * h0) + tx;\n vertexData[7] = (d * h0) + (b * w1) + ty;\n if (this._roundPixels) {\n var resolution = settings.RESOLUTION;\n for (var i = 0; i < vertexData.length; ++i) {\n vertexData[i] = Math.round((vertexData[i] * resolution | 0) / resolution);\n }\n }\n };\n /**\n * calculates worldTransform * vertices for a non texture with a trim. store it in vertexTrimmedData\n * This is used to ensure that the true width and height of a trimmed texture is respected\n */\n Sprite.prototype.calculateTrimmedVertices = function () {\n if (!this.vertexTrimmedData) {\n this.vertexTrimmedData = new Float32Array(8);\n }\n else if (this._transformTrimmedID === this.transform._worldID && this._textureTrimmedID === this._texture._updateID) {\n return;\n }\n this._transformTrimmedID = this.transform._worldID;\n this._textureTrimmedID = this._texture._updateID;\n // lets do some special trim code!\n var texture = this._texture;\n var vertexData = this.vertexTrimmedData;\n var orig = texture.orig;\n var anchor = this._anchor;\n // lets calculate the new untrimmed bounds..\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var w1 = -anchor._x * orig.width;\n var w0 = w1 + orig.width;\n var h1 = -anchor._y * orig.height;\n var h0 = h1 + orig.height;\n // xy\n vertexData[0] = (a * w1) + (c * h1) + tx;\n vertexData[1] = (d * h1) + (b * w1) + ty;\n // xy\n vertexData[2] = (a * w0) + (c * h1) + tx;\n vertexData[3] = (d * h1) + (b * w0) + ty;\n // xy\n vertexData[4] = (a * w0) + (c * h0) + tx;\n vertexData[5] = (d * h0) + (b * w0) + ty;\n // xy\n vertexData[6] = (a * w1) + (c * h0) + tx;\n vertexData[7] = (d * h0) + (b * w1) + ty;\n };\n /**\n *\n * Renders the object using the WebGL renderer\n *\n * @protected\n * @param {PIXI.Renderer} renderer - The webgl renderer to use.\n */\n Sprite.prototype._render = function (renderer) {\n this.calculateVertices();\n renderer.batch.setObjectRenderer(renderer.plugins[this.pluginName]);\n renderer.plugins[this.pluginName].render(this);\n };\n /**\n * Updates the bounds of the sprite.\n *\n * @protected\n */\n Sprite.prototype._calculateBounds = function () {\n var trim = this._texture.trim;\n var orig = this._texture.orig;\n // First lets check to see if the current texture has a trim..\n if (!trim || (trim.width === orig.width && trim.height === orig.height)) {\n // no trim! lets use the usual calculations..\n this.calculateVertices();\n this._bounds.addQuad(this.vertexData);\n }\n else {\n // lets calculate a special trimmed bounds...\n this.calculateTrimmedVertices();\n this._bounds.addQuad(this.vertexTrimmedData);\n }\n };\n /**\n * Gets the local bounds of the sprite object.\n *\n * @param {PIXI.Rectangle} [rect] - The output rectangle.\n * @return {PIXI.Rectangle} The bounds.\n */\n Sprite.prototype.getLocalBounds = function (rect) {\n // we can do a fast local bounds if the sprite has no children!\n if (this.children.length === 0) {\n this._bounds.minX = this._texture.orig.width * -this._anchor._x;\n this._bounds.minY = this._texture.orig.height * -this._anchor._y;\n this._bounds.maxX = this._texture.orig.width * (1 - this._anchor._x);\n this._bounds.maxY = this._texture.orig.height * (1 - this._anchor._y);\n if (!rect) {\n if (!this._localBoundsRect) {\n this._localBoundsRect = new Rectangle();\n }\n rect = this._localBoundsRect;\n }\n return this._bounds.getRectangle(rect);\n }\n return _super.prototype.getLocalBounds.call(this, rect);\n };\n /**\n * Tests if a point is inside this sprite\n *\n * @param {PIXI.IPointData} point - the point to test\n * @return {boolean} the result of the test\n */\n Sprite.prototype.containsPoint = function (point) {\n this.worldTransform.applyInverse(point, tempPoint);\n var width = this._texture.orig.width;\n var height = this._texture.orig.height;\n var x1 = -width * this.anchor.x;\n var y1 = 0;\n if (tempPoint.x >= x1 && tempPoint.x < x1 + width) {\n y1 = -height * this.anchor.y;\n if (tempPoint.y >= y1 && tempPoint.y < y1 + height) {\n return true;\n }\n }\n return false;\n };\n /**\n * Destroys this sprite and optionally its texture and children\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well\n * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well\n */\n Sprite.prototype.destroy = function (options) {\n _super.prototype.destroy.call(this, options);\n this._texture.off('update', this._onTextureUpdate, this);\n this._anchor = null;\n var destroyTexture = typeof options === 'boolean' ? options : options && options.texture;\n if (destroyTexture) {\n var destroyBaseTexture = typeof options === 'boolean' ? options : options && options.baseTexture;\n this._texture.destroy(!!destroyBaseTexture);\n }\n this._texture = null;\n };\n // some helper functions..\n /**\n * Helper function that creates a new sprite based on the source you provide.\n * The source can be - frame id, image url, video url, canvas element, video element, base texture\n *\n * @static\n * @param {string|PIXI.Texture|HTMLCanvasElement|HTMLVideoElement} source - Source to create texture from\n * @param {object} [options] - See {@link PIXI.BaseTexture}'s constructor for options.\n * @return {PIXI.Sprite} The newly created sprite\n */\n Sprite.from = function (source, options) {\n var texture = (source instanceof Texture)\n ? source\n : Texture.from(source, options);\n return new Sprite(texture);\n };\n Object.defineProperty(Sprite.prototype, \"roundPixels\", {\n get: function () {\n return this._roundPixels;\n },\n /**\n * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.\n * Advantages can include sharper image quality (like text) and faster rendering on canvas.\n * The main disadvantage is movement of objects may appear less smooth.\n * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}\n *\n * @member {boolean}\n * @default false\n */\n set: function (value) {\n if (this._roundPixels !== value) {\n this._transformID = -1;\n }\n this._roundPixels = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sprite.prototype, \"width\", {\n /**\n * The width of the sprite, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n get: function () {\n return Math.abs(this.scale.x) * this._texture.orig.width;\n },\n set: function (value) {\n var s = sign(this.scale.x) || 1;\n this.scale.x = s * value / this._texture.orig.width;\n this._width = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sprite.prototype, \"height\", {\n /**\n * The height of the sprite, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n get: function () {\n return Math.abs(this.scale.y) * this._texture.orig.height;\n },\n set: function (value) {\n var s = sign(this.scale.y) || 1;\n this.scale.y = s * value / this._texture.orig.height;\n this._height = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sprite.prototype, \"anchor\", {\n /**\n * The anchor sets the origin point of the sprite. The default value is taken from the {@link PIXI.Texture|Texture}\n * and passed to the constructor.\n *\n * The default is `(0,0)`, this means the sprite's origin is the top left.\n *\n * Setting the anchor to `(0.5,0.5)` means the sprite's origin is centered.\n *\n * Setting the anchor to `(1,1)` would mean the sprite's origin point will be the bottom right corner.\n *\n * If you pass only single parameter, it will set both x and y to the same value as shown in the example below.\n *\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.anchor.set(0.5); // This will set the origin to center. (0.5) is same as (0.5, 0.5).\n *\n * @member {PIXI.ObservablePoint}\n */\n get: function () {\n return this._anchor;\n },\n set: function (value) {\n this._anchor.copyFrom(value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sprite.prototype, \"tint\", {\n /**\n * The tint applied to the sprite. This is a hex value.\n * A value of 0xFFFFFF will remove any tint effect.\n *\n * @member {number}\n * @default 0xFFFFFF\n */\n get: function () {\n return this._tint;\n },\n set: function (value) {\n this._tint = value;\n this._tintRGB = (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sprite.prototype, \"texture\", {\n /**\n * The texture that the sprite is using\n *\n * @member {PIXI.Texture}\n */\n get: function () {\n return this._texture;\n },\n set: function (value) {\n if (this._texture === value) {\n return;\n }\n if (this._texture) {\n this._texture.off('update', this._onTextureUpdate, this);\n }\n this._texture = value || Texture.EMPTY;\n this._cachedTint = 0xFFFFFF;\n this._textureID = -1;\n this._textureTrimmedID = -1;\n if (value) {\n // wait for the texture to load\n if (value.baseTexture.valid) {\n this._onTextureUpdate();\n }\n else {\n value.once('update', this._onTextureUpdate, this);\n }\n }\n },\n enumerable: false,\n configurable: true\n });\n return Sprite;\n}(Container));\n\nexport { Sprite };\n//# sourceMappingURL=sprite.es.js.map\n","/*!\n * @pixi/text - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/text is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Sprite } from '@pixi/sprite';\nimport { Texture } from '@pixi/core';\nimport { settings } from '@pixi/settings';\nimport { Rectangle } from '@pixi/math';\nimport { hex2string, hex2rgb, string2hex, trimCanvas, sign } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * Constants that define the type of gradient on text.\n *\n * @static\n * @constant\n * @name TEXT_GRADIENT\n * @memberof PIXI\n * @type {object}\n * @property {number} LINEAR_VERTICAL Vertical gradient\n * @property {number} LINEAR_HORIZONTAL Linear gradient\n */\nvar TEXT_GRADIENT;\n(function (TEXT_GRADIENT) {\n TEXT_GRADIENT[TEXT_GRADIENT[\"LINEAR_VERTICAL\"] = 0] = \"LINEAR_VERTICAL\";\n TEXT_GRADIENT[TEXT_GRADIENT[\"LINEAR_HORIZONTAL\"] = 1] = \"LINEAR_HORIZONTAL\";\n})(TEXT_GRADIENT || (TEXT_GRADIENT = {}));\n\n// disabling eslint for now, going to rewrite this in v5\nvar defaultStyle = {\n align: 'left',\n breakWords: false,\n dropShadow: false,\n dropShadowAlpha: 1,\n dropShadowAngle: Math.PI / 6,\n dropShadowBlur: 0,\n dropShadowColor: 'black',\n dropShadowDistance: 5,\n fill: 'black',\n fillGradientType: TEXT_GRADIENT.LINEAR_VERTICAL,\n fillGradientStops: [],\n fontFamily: 'Arial',\n fontSize: 26,\n fontStyle: 'normal',\n fontVariant: 'normal',\n fontWeight: 'normal',\n letterSpacing: 0,\n lineHeight: 0,\n lineJoin: 'miter',\n miterLimit: 10,\n padding: 0,\n stroke: 'black',\n strokeThickness: 0,\n textBaseline: 'alphabetic',\n trim: false,\n whiteSpace: 'pre',\n wordWrap: false,\n wordWrapWidth: 100,\n leading: 0,\n};\nvar genericFontFamilies = [\n 'serif',\n 'sans-serif',\n 'monospace',\n 'cursive',\n 'fantasy',\n 'system-ui' ];\n/**\n * A TextStyle Object contains information to decorate a Text objects.\n *\n * An instance can be shared between multiple Text objects; then changing the style will update all text objects using it.\n *\n * A tool can be used to generate a text style [here](https://pixijs.io/pixi-text-style).\n *\n * @class\n * @memberof PIXI\n */\nvar TextStyle = /** @class */ (function () {\n /**\n * @param {object} [style] - The style parameters\n * @param {string} [style.align='left'] - Alignment for multiline text ('left', 'center' or 'right'),\n * does not affect single line text\n * @param {boolean} [style.breakWords=false] - Indicates if lines can be wrapped within words, it\n * needs wordWrap to be set to true\n * @param {boolean} [style.dropShadow=false] - Set a drop shadow for the text\n * @param {number} [style.dropShadowAlpha=1] - Set alpha for the drop shadow\n * @param {number} [style.dropShadowAngle=Math.PI/6] - Set a angle of the drop shadow\n * @param {number} [style.dropShadowBlur=0] - Set a shadow blur radius\n * @param {string|number} [style.dropShadowColor='black'] - A fill style to be used on the dropshadow e.g 'red', '#00FF00'\n * @param {number} [style.dropShadowDistance=5] - Set a distance of the drop shadow\n * @param {string|string[]|number|number[]|CanvasGradient|CanvasPattern} [style.fill='black'] - A canvas\n * fillstyle that will be used on the text e.g 'red', '#00FF00'. Can be an array to create a gradient\n * eg ['#000000','#FFFFFF']\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN}\n * @param {number} [style.fillGradientType=PIXI.TEXT_GRADIENT.LINEAR_VERTICAL] - If fill is an array of colours\n * to create a gradient, this can change the type/direction of the gradient. See {@link PIXI.TEXT_GRADIENT}\n * @param {number[]} [style.fillGradientStops] - If fill is an array of colours to create a gradient, this array can set\n * the stop points (numbers between 0 and 1) for the color, overriding the default behaviour of evenly spacing them.\n * @param {string|string[]} [style.fontFamily='Arial'] - The font family\n * @param {number|string} [style.fontSize=26] - The font size (as a number it converts to px, but as a string,\n * equivalents are '26px','20pt','160%' or '1.6em')\n * @param {string} [style.fontStyle='normal'] - The font style ('normal', 'italic' or 'oblique')\n * @param {string} [style.fontVariant='normal'] - The font variant ('normal' or 'small-caps')\n * @param {string} [style.fontWeight='normal'] - The font weight ('normal', 'bold', 'bolder', 'lighter' and '100',\n * '200', '300', '400', '500', '600', '700', '800' or '900')\n * @param {number} [style.leading=0] - The space between lines\n * @param {number} [style.letterSpacing=0] - The amount of spacing between letters, default is 0\n * @param {number} [style.lineHeight] - The line height, a number that represents the vertical space that a letter uses\n * @param {string} [style.lineJoin='miter'] - The lineJoin property sets the type of corner created, it can resolve\n * spiked text issues. Possible values \"miter\" (creates a sharp corner), \"round\" (creates a round corner) or \"bevel\"\n * (creates a squared corner).\n * @param {number} [style.miterLimit=10] - The miter limit to use when using the 'miter' lineJoin mode. This can reduce\n * or increase the spikiness of rendered text.\n * @param {number} [style.padding=0] - Occasionally some fonts are cropped. Adding some padding will prevent this from\n * happening by adding padding to all sides of the text.\n * @param {string|number} [style.stroke='black'] - A canvas fillstyle that will be used on the text stroke\n * e.g 'blue', '#FCFF00'\n * @param {number} [style.strokeThickness=0] - A number that represents the thickness of the stroke.\n * Default is 0 (no stroke)\n * @param {boolean} [style.trim=false] - Trim transparent borders\n * @param {string} [style.textBaseline='alphabetic'] - The baseline of the text that is rendered.\n * @param {string} [style.whiteSpace='pre'] - Determines whether newlines & spaces are collapsed or preserved \"normal\"\n * (collapse, collapse), \"pre\" (preserve, preserve) | \"pre-line\" (preserve, collapse). It needs wordWrap to be set to true\n * @param {boolean} [style.wordWrap=false] - Indicates if word wrap should be used\n * @param {number} [style.wordWrapWidth=100] - The width at which text will wrap, it needs wordWrap to be set to true\n */\n function TextStyle(style) {\n this.styleID = 0;\n this.reset();\n deepCopyProperties(this, style, style);\n }\n /**\n * Creates a new TextStyle object with the same values as this one.\n * Note that the only the properties of the object are cloned.\n *\n * @return {PIXI.TextStyle} New cloned TextStyle object\n */\n TextStyle.prototype.clone = function () {\n var clonedProperties = {};\n deepCopyProperties(clonedProperties, this, defaultStyle);\n return new TextStyle(clonedProperties);\n };\n /**\n * Resets all properties to the defaults specified in TextStyle.prototype._default\n */\n TextStyle.prototype.reset = function () {\n deepCopyProperties(this, defaultStyle, defaultStyle);\n };\n Object.defineProperty(TextStyle.prototype, \"align\", {\n /**\n * Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text\n *\n * @member {string}\n */\n get: function () {\n return this._align;\n },\n set: function (align) {\n if (this._align !== align) {\n this._align = align;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"breakWords\", {\n /**\n * Indicates if lines can be wrapped within words, it needs wordWrap to be set to true\n *\n * @member {boolean}\n */\n get: function () {\n return this._breakWords;\n },\n set: function (breakWords) {\n if (this._breakWords !== breakWords) {\n this._breakWords = breakWords;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadow\", {\n /**\n * Set a drop shadow for the text\n *\n * @member {boolean}\n */\n get: function () {\n return this._dropShadow;\n },\n set: function (dropShadow) {\n if (this._dropShadow !== dropShadow) {\n this._dropShadow = dropShadow;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadowAlpha\", {\n /**\n * Set alpha for the drop shadow\n *\n * @member {number}\n */\n get: function () {\n return this._dropShadowAlpha;\n },\n set: function (dropShadowAlpha) {\n if (this._dropShadowAlpha !== dropShadowAlpha) {\n this._dropShadowAlpha = dropShadowAlpha;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadowAngle\", {\n /**\n * Set a angle of the drop shadow\n *\n * @member {number}\n */\n get: function () {\n return this._dropShadowAngle;\n },\n set: function (dropShadowAngle) {\n if (this._dropShadowAngle !== dropShadowAngle) {\n this._dropShadowAngle = dropShadowAngle;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadowBlur\", {\n /**\n * Set a shadow blur radius\n *\n * @member {number}\n */\n get: function () {\n return this._dropShadowBlur;\n },\n set: function (dropShadowBlur) {\n if (this._dropShadowBlur !== dropShadowBlur) {\n this._dropShadowBlur = dropShadowBlur;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadowColor\", {\n /**\n * A fill style to be used on the dropshadow e.g 'red', '#00FF00'\n *\n * @member {string|number}\n */\n get: function () {\n return this._dropShadowColor;\n },\n set: function (dropShadowColor) {\n var outputColor = getColor(dropShadowColor);\n if (this._dropShadowColor !== outputColor) {\n this._dropShadowColor = outputColor;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadowDistance\", {\n /**\n * Set a distance of the drop shadow\n *\n * @member {number}\n */\n get: function () {\n return this._dropShadowDistance;\n },\n set: function (dropShadowDistance) {\n if (this._dropShadowDistance !== dropShadowDistance) {\n this._dropShadowDistance = dropShadowDistance;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fill\", {\n /**\n * A canvas fillstyle that will be used on the text e.g 'red', '#00FF00'.\n * Can be an array to create a gradient eg ['#000000','#FFFFFF']\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN}\n *\n * @member {string|string[]|number|number[]|CanvasGradient|CanvasPattern}\n */\n get: function () {\n return this._fill;\n },\n set: function (fill) {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n // TODO: Not sure if getColor works properly with CanvasGradient and/or CanvasPattern, can't pass in\n // without casting here.\n var outputColor = getColor(fill);\n if (this._fill !== outputColor) {\n this._fill = outputColor;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fillGradientType\", {\n /**\n * If fill is an array of colours to create a gradient, this can change the type/direction of the gradient.\n * See {@link PIXI.TEXT_GRADIENT}\n *\n * @member {number}\n */\n get: function () {\n return this._fillGradientType;\n },\n set: function (fillGradientType) {\n if (this._fillGradientType !== fillGradientType) {\n this._fillGradientType = fillGradientType;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fillGradientStops\", {\n /**\n * If fill is an array of colours to create a gradient, this array can set the stop points\n * (numbers between 0 and 1) for the color, overriding the default behaviour of evenly spacing them.\n *\n * @member {number[]}\n */\n get: function () {\n return this._fillGradientStops;\n },\n set: function (fillGradientStops) {\n if (!areArraysEqual(this._fillGradientStops, fillGradientStops)) {\n this._fillGradientStops = fillGradientStops;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fontFamily\", {\n /**\n * The font family\n *\n * @member {string|string[]}\n */\n get: function () {\n return this._fontFamily;\n },\n set: function (fontFamily) {\n if (this.fontFamily !== fontFamily) {\n this._fontFamily = fontFamily;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fontSize\", {\n /**\n * The font size\n * (as a number it converts to px, but as a string, equivalents are '26px','20pt','160%' or '1.6em')\n *\n * @member {number|string}\n */\n get: function () {\n return this._fontSize;\n },\n set: function (fontSize) {\n if (this._fontSize !== fontSize) {\n this._fontSize = fontSize;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fontStyle\", {\n /**\n * The font style\n * ('normal', 'italic' or 'oblique')\n *\n * @member {string}\n */\n get: function () {\n return this._fontStyle;\n },\n set: function (fontStyle) {\n if (this._fontStyle !== fontStyle) {\n this._fontStyle = fontStyle;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fontVariant\", {\n /**\n * The font variant\n * ('normal' or 'small-caps')\n *\n * @member {string}\n */\n get: function () {\n return this._fontVariant;\n },\n set: function (fontVariant) {\n if (this._fontVariant !== fontVariant) {\n this._fontVariant = fontVariant;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fontWeight\", {\n /**\n * The font weight\n * ('normal', 'bold', 'bolder', 'lighter' and '100', '200', '300', '400', '500', '600', '700', 800' or '900')\n *\n * @member {string}\n */\n get: function () {\n return this._fontWeight;\n },\n set: function (fontWeight) {\n if (this._fontWeight !== fontWeight) {\n this._fontWeight = fontWeight;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"letterSpacing\", {\n /**\n * The amount of spacing between letters, default is 0\n *\n * @member {number}\n */\n get: function () {\n return this._letterSpacing;\n },\n set: function (letterSpacing) {\n if (this._letterSpacing !== letterSpacing) {\n this._letterSpacing = letterSpacing;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"lineHeight\", {\n /**\n * The line height, a number that represents the vertical space that a letter uses\n *\n * @member {number}\n */\n get: function () {\n return this._lineHeight;\n },\n set: function (lineHeight) {\n if (this._lineHeight !== lineHeight) {\n this._lineHeight = lineHeight;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"leading\", {\n /**\n * The space between lines\n *\n * @member {number}\n */\n get: function () {\n return this._leading;\n },\n set: function (leading) {\n if (this._leading !== leading) {\n this._leading = leading;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"lineJoin\", {\n /**\n * The lineJoin property sets the type of corner created, it can resolve spiked text issues.\n * Default is 'miter' (creates a sharp corner).\n *\n * @member {string}\n */\n get: function () {\n return this._lineJoin;\n },\n set: function (lineJoin) {\n if (this._lineJoin !== lineJoin) {\n this._lineJoin = lineJoin;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"miterLimit\", {\n /**\n * The miter limit to use when using the 'miter' lineJoin mode\n * This can reduce or increase the spikiness of rendered text.\n *\n * @member {number}\n */\n get: function () {\n return this._miterLimit;\n },\n set: function (miterLimit) {\n if (this._miterLimit !== miterLimit) {\n this._miterLimit = miterLimit;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"padding\", {\n /**\n * Occasionally some fonts are cropped. Adding some padding will prevent this from happening\n * by adding padding to all sides of the text.\n *\n * @member {number}\n */\n get: function () {\n return this._padding;\n },\n set: function (padding) {\n if (this._padding !== padding) {\n this._padding = padding;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"stroke\", {\n /**\n * A canvas fillstyle that will be used on the text stroke\n * e.g 'blue', '#FCFF00'\n *\n * @member {string|number}\n */\n get: function () {\n return this._stroke;\n },\n set: function (stroke) {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n var outputColor = getColor(stroke);\n if (this._stroke !== outputColor) {\n this._stroke = outputColor;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"strokeThickness\", {\n /**\n * A number that represents the thickness of the stroke.\n * Default is 0 (no stroke)\n *\n * @member {number}\n */\n get: function () {\n return this._strokeThickness;\n },\n set: function (strokeThickness) {\n if (this._strokeThickness !== strokeThickness) {\n this._strokeThickness = strokeThickness;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"textBaseline\", {\n /**\n * The baseline of the text that is rendered.\n *\n * @member {string}\n */\n get: function () {\n return this._textBaseline;\n },\n set: function (textBaseline) {\n if (this._textBaseline !== textBaseline) {\n this._textBaseline = textBaseline;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"trim\", {\n /**\n * Trim transparent borders\n *\n * @member {boolean}\n */\n get: function () {\n return this._trim;\n },\n set: function (trim) {\n if (this._trim !== trim) {\n this._trim = trim;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"whiteSpace\", {\n /**\n * How newlines and spaces should be handled.\n * Default is 'pre' (preserve, preserve).\n *\n * value | New lines | Spaces\n * --- | --- | ---\n * 'normal' | Collapse | Collapse\n * 'pre' | Preserve | Preserve\n * 'pre-line' | Preserve | Collapse\n *\n * @member {string}\n */\n get: function () {\n return this._whiteSpace;\n },\n set: function (whiteSpace) {\n if (this._whiteSpace !== whiteSpace) {\n this._whiteSpace = whiteSpace;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"wordWrap\", {\n /**\n * Indicates if word wrap should be used\n *\n * @member {boolean}\n */\n get: function () {\n return this._wordWrap;\n },\n set: function (wordWrap) {\n if (this._wordWrap !== wordWrap) {\n this._wordWrap = wordWrap;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"wordWrapWidth\", {\n /**\n * The width at which text will wrap, it needs wordWrap to be set to true\n *\n * @member {number}\n */\n get: function () {\n return this._wordWrapWidth;\n },\n set: function (wordWrapWidth) {\n if (this._wordWrapWidth !== wordWrapWidth) {\n this._wordWrapWidth = wordWrapWidth;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Generates a font style string to use for `TextMetrics.measureFont()`.\n *\n * @return {string} Font style string, for passing to `TextMetrics.measureFont()`\n */\n TextStyle.prototype.toFontString = function () {\n // build canvas api font setting from individual components. Convert a numeric this.fontSize to px\n var fontSizeString = (typeof this.fontSize === 'number') ? this.fontSize + \"px\" : this.fontSize;\n // Clean-up fontFamily property by quoting each font name\n // this will support font names with spaces\n var fontFamilies = this.fontFamily;\n if (!Array.isArray(this.fontFamily)) {\n fontFamilies = this.fontFamily.split(',');\n }\n for (var i = fontFamilies.length - 1; i >= 0; i--) {\n // Trim any extra white-space\n var fontFamily = fontFamilies[i].trim();\n // Check if font already contains strings\n if (!(/([\\\"\\'])[^\\'\\\"]+\\1/).test(fontFamily) && genericFontFamilies.indexOf(fontFamily) < 0) {\n fontFamily = \"\\\"\" + fontFamily + \"\\\"\";\n }\n fontFamilies[i] = fontFamily;\n }\n return this.fontStyle + \" \" + this.fontVariant + \" \" + this.fontWeight + \" \" + fontSizeString + \" \" + fontFamilies.join(',');\n };\n return TextStyle;\n}());\n/**\n * Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.\n * @private\n * @param {string|number} color\n * @return {string} The color as a string.\n */\nfunction getSingleColor(color) {\n if (typeof color === 'number') {\n return hex2string(color);\n }\n else if (typeof color === 'string') {\n if (color.indexOf('0x') === 0) {\n color = color.replace('0x', '#');\n }\n }\n return color;\n}\nfunction getColor(color) {\n if (!Array.isArray(color)) {\n return getSingleColor(color);\n }\n else {\n for (var i = 0; i < color.length; ++i) {\n color[i] = getSingleColor(color[i]);\n }\n return color;\n }\n}\n/**\n * Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.\n * This version can also convert array of colors\n * @private\n * @param {Array} array1 - First array to compare\n * @param {Array} array2 - Second array to compare\n * @return {boolean} Do the arrays contain the same values in the same order\n */\nfunction areArraysEqual(array1, array2) {\n if (!Array.isArray(array1) || !Array.isArray(array2)) {\n return false;\n }\n if (array1.length !== array2.length) {\n return false;\n }\n for (var i = 0; i < array1.length; ++i) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n return true;\n}\n/**\n * Utility function to ensure that object properties are copied by value, and not by reference\n * @private\n * @param {Object} target - Target object to copy properties into\n * @param {Object} source - Source object for the properties to copy\n * @param {string} propertyObj - Object containing properties names we want to loop over\n */\nfunction deepCopyProperties(target, source, propertyObj) {\n for (var prop in propertyObj) {\n if (Array.isArray(source[prop])) {\n target[prop] = source[prop].slice();\n }\n else {\n target[prop] = source[prop];\n }\n }\n}\n\n/**\n * The TextMetrics object represents the measurement of a block of text with a specified style.\n *\n * ```js\n * let style = new PIXI.TextStyle({fontFamily : 'Arial', fontSize: 24, fill : 0xff1010, align : 'center'})\n * let textMetrics = PIXI.TextMetrics.measureText('Your text', style)\n * ```\n *\n * @class\n * @memberof PIXI\n */\nvar TextMetrics = /** @class */ (function () {\n /**\n * @param {string} text - the text that was measured\n * @param {PIXI.TextStyle} style - the style that was measured\n * @param {number} width - the measured width of the text\n * @param {number} height - the measured height of the text\n * @param {string[]} lines - an array of the lines of text broken by new lines and wrapping if specified in style\n * @param {number[]} lineWidths - an array of the line widths for each line matched to `lines`\n * @param {number} lineHeight - the measured line height for this style\n * @param {number} maxLineWidth - the maximum line width for all measured lines\n * @param {Object} fontProperties - the font properties object from TextMetrics.measureFont\n */\n function TextMetrics(text, style, width, height, lines, lineWidths, lineHeight, maxLineWidth, fontProperties) {\n /**\n * The text that was measured\n *\n * @member {string}\n */\n this.text = text;\n /**\n * The style that was measured\n *\n * @member {PIXI.TextStyle}\n */\n this.style = style;\n /**\n * The measured width of the text\n *\n * @member {number}\n */\n this.width = width;\n /**\n * The measured height of the text\n *\n * @member {number}\n */\n this.height = height;\n /**\n * An array of lines of the text broken by new lines and wrapping is specified in style\n *\n * @member {string[]}\n */\n this.lines = lines;\n /**\n * An array of the line widths for each line matched to `lines`\n *\n * @member {number[]}\n */\n this.lineWidths = lineWidths;\n /**\n * The measured line height for this style\n *\n * @member {number}\n */\n this.lineHeight = lineHeight;\n /**\n * The maximum line width for all measured lines\n *\n * @member {number}\n */\n this.maxLineWidth = maxLineWidth;\n /**\n * The font properties object from TextMetrics.measureFont\n *\n * @member {PIXI.IFontMetrics}\n */\n this.fontProperties = fontProperties;\n }\n /**\n * Measures the supplied string of text and returns a Rectangle.\n *\n * @param {string} text - the text to measure.\n * @param {PIXI.TextStyle} style - the text style to use for measuring\n * @param {boolean} [wordWrap] - optional override for if word-wrap should be applied to the text.\n * @param {HTMLCanvasElement} [canvas] - optional specification of the canvas to use for measuring.\n * @return {PIXI.TextMetrics} measured width and height of the text.\n */\n TextMetrics.measureText = function (text, style, wordWrap, canvas) {\n if (canvas === void 0) { canvas = TextMetrics._canvas; }\n wordWrap = (wordWrap === undefined || wordWrap === null) ? style.wordWrap : wordWrap;\n var font = style.toFontString();\n var fontProperties = TextMetrics.measureFont(font);\n // fallback in case UA disallow canvas data extraction\n // (toDataURI, getImageData functions)\n if (fontProperties.fontSize === 0) {\n fontProperties.fontSize = style.fontSize;\n fontProperties.ascent = style.fontSize;\n }\n var context = canvas.getContext('2d');\n context.font = font;\n var outputText = wordWrap ? TextMetrics.wordWrap(text, style, canvas) : text;\n var lines = outputText.split(/(?:\\r\\n|\\r|\\n)/);\n var lineWidths = new Array(lines.length);\n var maxLineWidth = 0;\n for (var i = 0; i < lines.length; i++) {\n var lineWidth = context.measureText(lines[i]).width + ((lines[i].length - 1) * style.letterSpacing);\n lineWidths[i] = lineWidth;\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n var width = maxLineWidth + style.strokeThickness;\n if (style.dropShadow) {\n width += style.dropShadowDistance;\n }\n var lineHeight = style.lineHeight || fontProperties.fontSize + style.strokeThickness;\n var height = Math.max(lineHeight, fontProperties.fontSize + style.strokeThickness)\n + ((lines.length - 1) * (lineHeight + style.leading));\n if (style.dropShadow) {\n height += style.dropShadowDistance;\n }\n return new TextMetrics(text, style, width, height, lines, lineWidths, lineHeight + style.leading, maxLineWidth, fontProperties);\n };\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n *\n * @private\n * @param {string} text - String to apply word wrapping to\n * @param {PIXI.TextStyle} style - the style to use when wrapping\n * @param {HTMLCanvasElement} [canvas] - optional specification of the canvas to use for measuring.\n * @return {string} New string with new lines applied where required\n */\n TextMetrics.wordWrap = function (text, style, canvas) {\n if (canvas === void 0) { canvas = TextMetrics._canvas; }\n var context = canvas.getContext('2d');\n var width = 0;\n var line = '';\n var lines = '';\n var cache = Object.create(null);\n var letterSpacing = style.letterSpacing, whiteSpace = style.whiteSpace;\n // How to handle whitespaces\n var collapseSpaces = TextMetrics.collapseSpaces(whiteSpace);\n var collapseNewlines = TextMetrics.collapseNewlines(whiteSpace);\n // whether or not spaces may be added to the beginning of lines\n var canPrependSpaces = !collapseSpaces;\n // There is letterSpacing after every char except the last one\n // t_h_i_s_' '_i_s_' '_a_n_' '_e_x_a_m_p_l_e_' '_!\n // so for convenience the above needs to be compared to width + 1 extra letterSpace\n // t_h_i_s_' '_i_s_' '_a_n_' '_e_x_a_m_p_l_e_' '_!_\n // ________________________________________________\n // And then the final space is simply no appended to each line\n var wordWrapWidth = style.wordWrapWidth + letterSpacing;\n // break text into words, spaces and newline chars\n var tokens = TextMetrics.tokenize(text);\n for (var i = 0; i < tokens.length; i++) {\n // get the word, space or newlineChar\n var token = tokens[i];\n // if word is a new line\n if (TextMetrics.isNewline(token)) {\n // keep the new line\n if (!collapseNewlines) {\n lines += TextMetrics.addLine(line);\n canPrependSpaces = !collapseSpaces;\n line = '';\n width = 0;\n continue;\n }\n // if we should collapse new lines\n // we simply convert it into a space\n token = ' ';\n }\n // if we should collapse repeated whitespaces\n if (collapseSpaces) {\n // check both this and the last tokens for spaces\n var currIsBreakingSpace = TextMetrics.isBreakingSpace(token);\n var lastIsBreakingSpace = TextMetrics.isBreakingSpace(line[line.length - 1]);\n if (currIsBreakingSpace && lastIsBreakingSpace) {\n continue;\n }\n }\n // get word width from cache if possible\n var tokenWidth = TextMetrics.getFromCache(token, letterSpacing, cache, context);\n // word is longer than desired bounds\n if (tokenWidth > wordWrapWidth) {\n // if we are not already at the beginning of a line\n if (line !== '') {\n // start newlines for overflow words\n lines += TextMetrics.addLine(line);\n line = '';\n width = 0;\n }\n // break large word over multiple lines\n if (TextMetrics.canBreakWords(token, style.breakWords)) {\n // break word into characters\n var characters = TextMetrics.wordWrapSplit(token);\n // loop the characters\n for (var j = 0; j < characters.length; j++) {\n var char = characters[j];\n var k = 1;\n // we are not at the end of the token\n while (characters[j + k]) {\n var nextChar = characters[j + k];\n var lastChar = char[char.length - 1];\n // should not split chars\n if (!TextMetrics.canBreakChars(lastChar, nextChar, token, j, style.breakWords)) {\n // combine chars & move forward one\n char += nextChar;\n }\n else {\n break;\n }\n k++;\n }\n j += char.length - 1;\n var characterWidth = TextMetrics.getFromCache(char, letterSpacing, cache, context);\n if (characterWidth + width > wordWrapWidth) {\n lines += TextMetrics.addLine(line);\n canPrependSpaces = false;\n line = '';\n width = 0;\n }\n line += char;\n width += characterWidth;\n }\n }\n // run word out of the bounds\n else {\n // if there are words in this line already\n // finish that line and start a new one\n if (line.length > 0) {\n lines += TextMetrics.addLine(line);\n line = '';\n width = 0;\n }\n var isLastToken = i === tokens.length - 1;\n // give it its own line if it's not the end\n lines += TextMetrics.addLine(token, !isLastToken);\n canPrependSpaces = false;\n line = '';\n width = 0;\n }\n }\n // word could fit\n else {\n // word won't fit because of existing words\n // start a new line\n if (tokenWidth + width > wordWrapWidth) {\n // if its a space we don't want it\n canPrependSpaces = false;\n // add a new line\n lines += TextMetrics.addLine(line);\n // start a new line\n line = '';\n width = 0;\n }\n // don't add spaces to the beginning of lines\n if (line.length > 0 || !TextMetrics.isBreakingSpace(token) || canPrependSpaces) {\n // add the word to the current line\n line += token;\n // update width counter\n width += tokenWidth;\n }\n }\n }\n lines += TextMetrics.addLine(line, false);\n return lines;\n };\n /**\n * Convienience function for logging each line added during the wordWrap\n * method\n *\n * @private\n * @param {string} line - The line of text to add\n * @param {boolean} newLine - Add new line character to end\n * @return {string} A formatted line\n */\n TextMetrics.addLine = function (line, newLine) {\n if (newLine === void 0) { newLine = true; }\n line = TextMetrics.trimRight(line);\n line = (newLine) ? line + \"\\n\" : line;\n return line;\n };\n /**\n * Gets & sets the widths of calculated characters in a cache object\n *\n * @private\n * @param {string} key - The key\n * @param {number} letterSpacing - The letter spacing\n * @param {object} cache - The cache\n * @param {CanvasRenderingContext2D} context - The canvas context\n * @return {number} The from cache.\n */\n TextMetrics.getFromCache = function (key, letterSpacing, cache, context) {\n var width = cache[key];\n if (typeof width !== 'number') {\n var spacing = ((key.length) * letterSpacing);\n width = context.measureText(key).width + spacing;\n cache[key] = width;\n }\n return width;\n };\n /**\n * Determines whether we should collapse breaking spaces\n *\n * @private\n * @param {string} whiteSpace - The TextStyle property whiteSpace\n * @return {boolean} should collapse\n */\n TextMetrics.collapseSpaces = function (whiteSpace) {\n return (whiteSpace === 'normal' || whiteSpace === 'pre-line');\n };\n /**\n * Determines whether we should collapse newLine chars\n *\n * @private\n * @param {string} whiteSpace - The white space\n * @return {boolean} should collapse\n */\n TextMetrics.collapseNewlines = function (whiteSpace) {\n return (whiteSpace === 'normal');\n };\n /**\n * trims breaking whitespaces from string\n *\n * @private\n * @param {string} text - The text\n * @return {string} trimmed string\n */\n TextMetrics.trimRight = function (text) {\n if (typeof text !== 'string') {\n return '';\n }\n for (var i = text.length - 1; i >= 0; i--) {\n var char = text[i];\n if (!TextMetrics.isBreakingSpace(char)) {\n break;\n }\n text = text.slice(0, -1);\n }\n return text;\n };\n /**\n * Determines if char is a newline.\n *\n * @private\n * @param {string} char - The character\n * @return {boolean} True if newline, False otherwise.\n */\n TextMetrics.isNewline = function (char) {\n if (typeof char !== 'string') {\n return false;\n }\n return (TextMetrics._newlines.indexOf(char.charCodeAt(0)) >= 0);\n };\n /**\n * Determines if char is a breaking whitespace.\n *\n * @private\n * @param {string} char - The character\n * @return {boolean} True if whitespace, False otherwise.\n */\n TextMetrics.isBreakingSpace = function (char) {\n if (typeof char !== 'string') {\n return false;\n }\n return (TextMetrics._breakingSpaces.indexOf(char.charCodeAt(0)) >= 0);\n };\n /**\n * Splits a string into words, breaking-spaces and newLine characters\n *\n * @private\n * @param {string} text - The text\n * @return {string[]} A tokenized array\n */\n TextMetrics.tokenize = function (text) {\n var tokens = [];\n var token = '';\n if (typeof text !== 'string') {\n return tokens;\n }\n for (var i = 0; i < text.length; i++) {\n var char = text[i];\n if (TextMetrics.isBreakingSpace(char) || TextMetrics.isNewline(char)) {\n if (token !== '') {\n tokens.push(token);\n token = '';\n }\n tokens.push(char);\n continue;\n }\n token += char;\n }\n if (token !== '') {\n tokens.push(token);\n }\n return tokens;\n };\n /**\n * Overridable helper method used internally by TextMetrics, exposed to allow customizing the class's behavior.\n *\n * It allows one to customise which words should break\n * Examples are if the token is CJK or numbers.\n * It must return a boolean.\n *\n * @param {string} token - The token\n * @param {boolean} breakWords - The style attr break words\n * @return {boolean} whether to break word or not\n */\n TextMetrics.canBreakWords = function (_token, breakWords) {\n return breakWords;\n };\n /**\n * Overridable helper method used internally by TextMetrics, exposed to allow customizing the class's behavior.\n *\n * It allows one to determine whether a pair of characters\n * should be broken by newlines\n * For example certain characters in CJK langs or numbers.\n * It must return a boolean.\n *\n * @param {string} char - The character\n * @param {string} nextChar - The next character\n * @param {string} token - The token/word the characters are from\n * @param {number} index - The index in the token of the char\n * @param {boolean} breakWords - The style attr break words\n * @return {boolean} whether to break word or not\n */\n TextMetrics.canBreakChars = function (_char, _nextChar, _token, _index, _breakWords) {\n return true;\n };\n /**\n * Overridable helper method used internally by TextMetrics, exposed to allow customizing the class's behavior.\n *\n * It is called when a token (usually a word) has to be split into separate pieces\n * in order to determine the point to break a word.\n * It must return an array of characters.\n *\n * @example\n * // Correctly splits emojis, eg \"🤪🤪\" will result in two element array, each with one emoji.\n * TextMetrics.wordWrapSplit = (token) => [...token];\n *\n * @param {string} token - The token to split\n * @return {string[]} The characters of the token\n */\n TextMetrics.wordWrapSplit = function (token) {\n return token.split('');\n };\n /**\n * Calculates the ascent, descent and fontSize of a given font-style\n *\n * @static\n * @param {string} font - String representing the style of the font\n * @return {PIXI.IFontMetrics} Font properties object\n */\n TextMetrics.measureFont = function (font) {\n // as this method is used for preparing assets, don't recalculate things if we don't need to\n if (TextMetrics._fonts[font]) {\n return TextMetrics._fonts[font];\n }\n var properties = {\n ascent: 0,\n descent: 0,\n fontSize: 0,\n };\n var canvas = TextMetrics._canvas;\n var context = TextMetrics._context;\n context.font = font;\n var metricsString = TextMetrics.METRICS_STRING + TextMetrics.BASELINE_SYMBOL;\n var width = Math.ceil(context.measureText(metricsString).width);\n var baseline = Math.ceil(context.measureText(TextMetrics.BASELINE_SYMBOL).width);\n var height = 2 * baseline;\n baseline = baseline * TextMetrics.BASELINE_MULTIPLIER | 0;\n canvas.width = width;\n canvas.height = height;\n context.fillStyle = '#f00';\n context.fillRect(0, 0, width, height);\n context.font = font;\n context.textBaseline = 'alphabetic';\n context.fillStyle = '#000';\n context.fillText(metricsString, 0, baseline);\n var imagedata = context.getImageData(0, 0, width, height).data;\n var pixels = imagedata.length;\n var line = width * 4;\n var i = 0;\n var idx = 0;\n var stop = false;\n // ascent. scan from top to bottom until we find a non red pixel\n for (i = 0; i < baseline; ++i) {\n for (var j = 0; j < line; j += 4) {\n if (imagedata[idx + j] !== 255) {\n stop = true;\n break;\n }\n }\n if (!stop) {\n idx += line;\n }\n else {\n break;\n }\n }\n properties.ascent = baseline - i;\n idx = pixels - line;\n stop = false;\n // descent. scan from bottom to top until we find a non red pixel\n for (i = height; i > baseline; --i) {\n for (var j = 0; j < line; j += 4) {\n if (imagedata[idx + j] !== 255) {\n stop = true;\n break;\n }\n }\n if (!stop) {\n idx -= line;\n }\n else {\n break;\n }\n }\n properties.descent = i - baseline;\n properties.fontSize = properties.ascent + properties.descent;\n TextMetrics._fonts[font] = properties;\n return properties;\n };\n /**\n * Clear font metrics in metrics cache.\n *\n * @static\n * @param {string} [font] - font name. If font name not set then clear cache for all fonts.\n */\n TextMetrics.clearMetrics = function (font) {\n if (font === void 0) { font = ''; }\n if (font) {\n delete TextMetrics._fonts[font];\n }\n else {\n TextMetrics._fonts = {};\n }\n };\n return TextMetrics;\n}());\n/**\n * Internal return object for {@link PIXI.TextMetrics.measureFont `TextMetrics.measureFont`}.\n *\n * @typedef {object} FontMetrics\n * @property {number} ascent - The ascent distance\n * @property {number} descent - The descent distance\n * @property {number} fontSize - Font size from ascent to descent\n * @memberof PIXI.TextMetrics\n * @private\n */\nvar canvas = (function () {\n try {\n // OffscreenCanvas2D measureText can be up to 40% faster.\n var c = new OffscreenCanvas(0, 0);\n var context = c.getContext('2d');\n if (context && context.measureText) {\n return c;\n }\n return document.createElement('canvas');\n }\n catch (ex) {\n return document.createElement('canvas');\n }\n})();\ncanvas.width = canvas.height = 10;\n/**\n * Cached canvas element for measuring text\n *\n * @memberof PIXI.TextMetrics\n * @type {HTMLCanvasElement}\n * @private\n */\nTextMetrics._canvas = canvas;\n/**\n * Cache for context to use.\n *\n * @memberof PIXI.TextMetrics\n * @type {CanvasRenderingContext2D}\n * @private\n */\nTextMetrics._context = canvas.getContext('2d');\n/**\n * Cache of {@see PIXI.TextMetrics.FontMetrics} objects.\n *\n * @memberof PIXI.TextMetrics\n * @type {Object}\n * @private\n */\nTextMetrics._fonts = {};\n/**\n * String used for calculate font metrics.\n * These characters are all tall to help calculate the height required for text.\n *\n * @static\n * @memberof PIXI.TextMetrics\n * @name METRICS_STRING\n * @type {string}\n * @default |ÉqÅ\n */\nTextMetrics.METRICS_STRING = '|ÉqÅ';\n/**\n * Baseline symbol for calculate font metrics.\n *\n * @static\n * @memberof PIXI.TextMetrics\n * @name BASELINE_SYMBOL\n * @type {string}\n * @default M\n */\nTextMetrics.BASELINE_SYMBOL = 'M';\n/**\n * Baseline multiplier for calculate font metrics.\n *\n * @static\n * @memberof PIXI.TextMetrics\n * @name BASELINE_MULTIPLIER\n * @type {number}\n * @default 1.4\n */\nTextMetrics.BASELINE_MULTIPLIER = 1.4;\n/**\n * Cache of new line chars.\n *\n * @memberof PIXI.TextMetrics\n * @type {number[]}\n * @private\n */\nTextMetrics._newlines = [\n 0x000A,\n 0x000D ];\n/**\n * Cache of breaking spaces.\n *\n * @memberof PIXI.TextMetrics\n * @type {number[]}\n * @private\n */\nTextMetrics._breakingSpaces = [\n 0x0009,\n 0x0020,\n 0x2000,\n 0x2001,\n 0x2002,\n 0x2003,\n 0x2004,\n 0x2005,\n 0x2006,\n 0x2008,\n 0x2009,\n 0x200A,\n 0x205F,\n 0x3000 ];\n/**\n * A number, or a string containing a number.\n *\n * @memberof PIXI\n * @typedef IFontMetrics\n * @property {number} ascent - Font ascent\n * @property {number} descent - Font descent\n * @property {number} fontSize - Font size\n */\n\nvar defaultDestroyOptions = {\n texture: true,\n children: false,\n baseTexture: true,\n};\n/**\n * A Text Object will create a line or multiple lines of text.\n *\n * The text is created using the [Canvas API](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API).\n *\n * The primary advantage of this class over BitmapText is that you have great control over the style of the next,\n * which you can change at runtime.\n *\n * The primary disadvantages is that each piece of text has it's own texture, which can use more memory.\n * When text changes, this texture has to be re-generated and re-uploaded to the GPU, taking up time.\n *\n * To split a line you can use '\\n' in your text string, or, on the `style` object,\n * change its `wordWrap` property to true and and give the `wordWrapWidth` property a value.\n *\n * A Text can be created directly from a string and a style object,\n * which can be generated [here](https://pixijs.io/pixi-text-style).\n *\n * ```js\n * let text = new PIXI.Text('This is a PixiJS text',{fontFamily : 'Arial', fontSize: 24, fill : 0xff1010, align : 'center'});\n * ```\n *\n * @class\n * @extends PIXI.Sprite\n * @memberof PIXI\n */\nvar Text = /** @class */ (function (_super) {\n __extends(Text, _super);\n /**\n * @param {string} text - The string that you would like the text to display\n * @param {object|PIXI.TextStyle} [style] - The style parameters\n * @param {HTMLCanvasElement} [canvas] - The canvas element for drawing text\n */\n function Text(text, style, canvas) {\n var _this = this;\n var ownCanvas = false;\n if (!canvas) {\n canvas = document.createElement('canvas');\n ownCanvas = true;\n }\n canvas.width = 3;\n canvas.height = 3;\n var texture = Texture.from(canvas);\n texture.orig = new Rectangle();\n texture.trim = new Rectangle();\n _this = _super.call(this, texture) || this;\n /**\n * Keep track if this Text object created it's own canvas\n * element (`true`) or uses the constructor argument (`false`).\n * Used to workaround a GC issues with Safari < 13 when\n * destroying Text. See `destroy` for more info.\n *\n * @member {boolean}\n * @private\n */\n _this._ownCanvas = ownCanvas;\n /**\n * The canvas element that everything is drawn to\n *\n * @member {HTMLCanvasElement}\n */\n _this.canvas = canvas;\n /**\n * The canvas 2d context that everything is drawn with\n * @member {CanvasRenderingContext2D}\n */\n _this.context = _this.canvas.getContext('2d');\n /**\n * The resolution / device pixel ratio of the canvas.\n * This is set to automatically match the renderer resolution by default, but can be overridden by setting manually.\n * @member {number}\n * @default 1\n */\n _this._resolution = settings.RESOLUTION;\n _this._autoResolution = true;\n /**\n * Private tracker for the current text.\n *\n * @member {string}\n * @private\n */\n _this._text = null;\n /**\n * Private tracker for the current style.\n *\n * @member {object}\n * @private\n */\n _this._style = null;\n /**\n * Private listener to track style changes.\n *\n * @member {Function}\n * @private\n */\n _this._styleListener = null;\n /**\n * Private tracker for the current font.\n *\n * @member {string}\n * @private\n */\n _this._font = '';\n _this.text = text;\n _this.style = style;\n _this.localStyleID = -1;\n return _this;\n }\n /**\n * Renders text to its canvas, and updates its texture.\n * By default this is used internally to ensure the texture is correct before rendering,\n * but it can be used called externally, for example from this class to 'pre-generate' the texture from a piece of text,\n * and then shared across multiple Sprites.\n *\n * @param {boolean} respectDirty - Whether to abort updating the text if the Text isn't dirty and the function is called.\n */\n Text.prototype.updateText = function (respectDirty) {\n var style = this._style;\n // check if style has changed..\n if (this.localStyleID !== style.styleID) {\n this.dirty = true;\n this.localStyleID = style.styleID;\n }\n if (!this.dirty && respectDirty) {\n return;\n }\n this._font = this._style.toFontString();\n var context = this.context;\n var measured = TextMetrics.measureText(this._text || ' ', this._style, this._style.wordWrap, this.canvas);\n var width = measured.width;\n var height = measured.height;\n var lines = measured.lines;\n var lineHeight = measured.lineHeight;\n var lineWidths = measured.lineWidths;\n var maxLineWidth = measured.maxLineWidth;\n var fontProperties = measured.fontProperties;\n this.canvas.width = Math.ceil((Math.max(1, width) + (style.padding * 2)) * this._resolution);\n this.canvas.height = Math.ceil((Math.max(1, height) + (style.padding * 2)) * this._resolution);\n context.scale(this._resolution, this._resolution);\n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n context.font = this._font;\n context.lineWidth = style.strokeThickness;\n context.textBaseline = style.textBaseline;\n context.lineJoin = style.lineJoin;\n context.miterLimit = style.miterLimit;\n var linePositionX;\n var linePositionY;\n // require 2 passes if a shadow; the first to draw the drop shadow, the second to draw the text\n var passesCount = style.dropShadow ? 2 : 1;\n // For v4, we drew text at the colours of the drop shadow underneath the normal text. This gave the correct zIndex,\n // but features such as alpha and shadowblur did not look right at all, since we were using actual text as a shadow.\n //\n // For v5.0.0, we moved over to just use the canvas API for drop shadows, which made them look much nicer and more\n // visually please, but now because the stroke is drawn and then the fill, drop shadows would appear on both the fill\n // and the stroke; and fill drop shadows would appear over the top of the stroke.\n //\n // For v5.1.1, the new route is to revert to v4 style of drawing text first to get the drop shadows underneath normal\n // text, but instead drawing text in the correct location, we'll draw it off screen (-paddingY), and then adjust the\n // drop shadow so only that appears on screen (+paddingY). Now we'll have the correct draw order of the shadow\n // beneath the text, whilst also having the proper text shadow styling.\n for (var i = 0; i < passesCount; ++i) {\n var isShadowPass = style.dropShadow && i === 0;\n // we only want the drop shadow, so put text way off-screen\n var dsOffsetText = isShadowPass ? Math.ceil(Math.max(1, height) + (style.padding * 2)) : 0;\n var dsOffsetShadow = dsOffsetText * this._resolution;\n if (isShadowPass) {\n // On Safari, text with gradient and drop shadows together do not position correctly\n // if the scale of the canvas is not 1: https://bugs.webkit.org/show_bug.cgi?id=197689\n // Therefore we'll set the styles to be a plain black whilst generating this drop shadow\n context.fillStyle = 'black';\n context.strokeStyle = 'black';\n var dropShadowColor = style.dropShadowColor;\n var rgb = hex2rgb(typeof dropShadowColor === 'number' ? dropShadowColor : string2hex(dropShadowColor));\n context.shadowColor = \"rgba(\" + rgb[0] * 255 + \",\" + rgb[1] * 255 + \",\" + rgb[2] * 255 + \",\" + style.dropShadowAlpha + \")\";\n context.shadowBlur = style.dropShadowBlur;\n context.shadowOffsetX = Math.cos(style.dropShadowAngle) * style.dropShadowDistance;\n context.shadowOffsetY = (Math.sin(style.dropShadowAngle) * style.dropShadowDistance) + dsOffsetShadow;\n }\n else {\n // set canvas text styles\n context.fillStyle = this._generateFillStyle(style, lines, measured);\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n context.strokeStyle = style.stroke;\n context.shadowColor = 'black';\n context.shadowBlur = 0;\n context.shadowOffsetX = 0;\n context.shadowOffsetY = 0;\n }\n // draw lines line by line\n for (var i_1 = 0; i_1 < lines.length; i_1++) {\n linePositionX = style.strokeThickness / 2;\n linePositionY = ((style.strokeThickness / 2) + (i_1 * lineHeight)) + fontProperties.ascent;\n if (style.align === 'right') {\n linePositionX += maxLineWidth - lineWidths[i_1];\n }\n else if (style.align === 'center') {\n linePositionX += (maxLineWidth - lineWidths[i_1]) / 2;\n }\n if (style.stroke && style.strokeThickness) {\n this.drawLetterSpacing(lines[i_1], linePositionX + style.padding, linePositionY + style.padding - dsOffsetText, true);\n }\n if (style.fill) {\n this.drawLetterSpacing(lines[i_1], linePositionX + style.padding, linePositionY + style.padding - dsOffsetText);\n }\n }\n }\n this.updateTexture();\n };\n /**\n * Render the text with letter-spacing.\n * @param {string} text - The text to draw\n * @param {number} x - Horizontal position to draw the text\n * @param {number} y - Vertical position to draw the text\n * @param {boolean} [isStroke=false] - Is this drawing for the outside stroke of the\n * text? If not, it's for the inside fill\n * @private\n */\n Text.prototype.drawLetterSpacing = function (text, x, y, isStroke) {\n if (isStroke === void 0) { isStroke = false; }\n var style = this._style;\n // letterSpacing of 0 means normal\n var letterSpacing = style.letterSpacing;\n if (letterSpacing === 0) {\n if (isStroke) {\n this.context.strokeText(text, x, y);\n }\n else {\n this.context.fillText(text, x, y);\n }\n return;\n }\n var currentPosition = x;\n // Using Array.from correctly splits characters whilst keeping emoji together.\n // This is not supported on IE as it requires ES6, so regular text splitting occurs.\n // This also doesn't account for emoji that are multiple emoji put together to make something else.\n // Handling all of this would require a big library itself.\n // https://medium.com/@giltayar/iterating-over-emoji-characters-the-es6-way-f06e4589516\n // https://github.com/orling/grapheme-splitter\n var stringArray = Array.from ? Array.from(text) : text.split('');\n var previousWidth = this.context.measureText(text).width;\n var currentWidth = 0;\n for (var i = 0; i < stringArray.length; ++i) {\n var currentChar = stringArray[i];\n if (isStroke) {\n this.context.strokeText(currentChar, currentPosition, y);\n }\n else {\n this.context.fillText(currentChar, currentPosition, y);\n }\n currentWidth = this.context.measureText(text.substring(i + 1)).width;\n currentPosition += previousWidth - currentWidth + letterSpacing;\n previousWidth = currentWidth;\n }\n };\n /**\n * Updates texture size based on canvas size\n *\n * @private\n */\n Text.prototype.updateTexture = function () {\n var canvas = this.canvas;\n if (this._style.trim) {\n var trimmed = trimCanvas(canvas);\n if (trimmed.data) {\n canvas.width = trimmed.width;\n canvas.height = trimmed.height;\n this.context.putImageData(trimmed.data, 0, 0);\n }\n }\n var texture = this._texture;\n var style = this._style;\n var padding = style.trim ? 0 : style.padding;\n var baseTexture = texture.baseTexture;\n texture.trim.width = texture._frame.width = Math.ceil(canvas.width / this._resolution);\n texture.trim.height = texture._frame.height = Math.ceil(canvas.height / this._resolution);\n texture.trim.x = -padding;\n texture.trim.y = -padding;\n texture.orig.width = texture._frame.width - (padding * 2);\n texture.orig.height = texture._frame.height - (padding * 2);\n // call sprite onTextureUpdate to update scale if _width or _height were set\n this._onTextureUpdate();\n baseTexture.setRealSize(canvas.width, canvas.height, this._resolution);\n // Recursively updates transform of all objects from the root to this one\n this._recursivePostUpdateTransform();\n this.dirty = false;\n };\n /**\n * Renders the object using the WebGL renderer\n *\n * @protected\n * @param {PIXI.Renderer} renderer - The renderer\n */\n Text.prototype._render = function (renderer) {\n if (this._autoResolution && this._resolution !== renderer.resolution) {\n this._resolution = renderer.resolution;\n this.dirty = true;\n }\n this.updateText(true);\n _super.prototype._render.call(this, renderer);\n };\n /**\n * Gets the local bounds of the text object.\n *\n * @param {PIXI.Rectangle} rect - The output rectangle.\n * @return {PIXI.Rectangle} The bounds.\n */\n Text.prototype.getLocalBounds = function (rect) {\n this.updateText(true);\n return _super.prototype.getLocalBounds.call(this, rect);\n };\n /**\n * calculates the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account.\n * @protected\n */\n Text.prototype._calculateBounds = function () {\n this.updateText(true);\n this.calculateVertices();\n // if we have already done this on THIS frame.\n this._bounds.addQuad(this.vertexData);\n };\n /**\n * Generates the fill style. Can automatically generate a gradient based on the fill style being an array\n *\n * @private\n * @param {object} style - The style.\n * @param {string[]} lines - The lines of text.\n * @return {string|number|CanvasGradient} The fill style\n */\n Text.prototype._generateFillStyle = function (style, lines, metrics) {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n var fillStyle = style.fill;\n if (!Array.isArray(fillStyle)) {\n return fillStyle;\n }\n else if (fillStyle.length === 1) {\n return fillStyle[0];\n }\n // the gradient will be evenly spaced out according to how large the array is.\n // ['#FF0000', '#00FF00', '#0000FF'] would created stops at 0.25, 0.5 and 0.75\n var gradient;\n // a dropshadow will enlarge the canvas and result in the gradient being\n // generated with the incorrect dimensions\n var dropShadowCorrection = (style.dropShadow) ? style.dropShadowDistance : 0;\n // should also take padding into account, padding can offset the gradient\n var padding = style.padding || 0;\n var width = Math.ceil(this.canvas.width / this._resolution) - dropShadowCorrection - (padding * 2);\n var height = Math.ceil(this.canvas.height / this._resolution) - dropShadowCorrection - (padding * 2);\n // make a copy of the style settings, so we can manipulate them later\n var fill = fillStyle.slice();\n var fillGradientStops = style.fillGradientStops.slice();\n // wanting to evenly distribute the fills. So an array of 4 colours should give fills of 0.25, 0.5 and 0.75\n if (!fillGradientStops.length) {\n var lengthPlus1 = fill.length + 1;\n for (var i = 1; i < lengthPlus1; ++i) {\n fillGradientStops.push(i / lengthPlus1);\n }\n }\n // stop the bleeding of the last gradient on the line above to the top gradient of the this line\n // by hard defining the first gradient colour at point 0, and last gradient colour at point 1\n fill.unshift(fillStyle[0]);\n fillGradientStops.unshift(0);\n fill.push(fillStyle[fillStyle.length - 1]);\n fillGradientStops.push(1);\n if (style.fillGradientType === TEXT_GRADIENT.LINEAR_VERTICAL) {\n // start the gradient at the top center of the canvas, and end at the bottom middle of the canvas\n gradient = this.context.createLinearGradient(width / 2, padding, width / 2, height + padding);\n // we need to repeat the gradient so that each individual line of text has the same vertical gradient effect\n // ['#FF0000', '#00FF00', '#0000FF'] over 2 lines would create stops at 0.125, 0.25, 0.375, 0.625, 0.75, 0.875\n // There's potential for floating point precision issues at the seams between gradient repeats.\n // The loop below generates the stops in order, so track the last generated one to prevent\n // floating point precision from making us go the teeniest bit backwards, resulting in\n // the first and last colors getting swapped.\n var lastIterationStop = 0;\n // Actual height of the text itself, not counting spacing for lineHeight/leading/dropShadow etc\n var textHeight = metrics.fontProperties.fontSize + style.strokeThickness;\n // textHeight, but as a 0-1 size in global gradient stop space\n var gradStopLineHeight = textHeight / height;\n for (var i = 0; i < lines.length; i++) {\n var thisLineTop = metrics.lineHeight * i;\n for (var j = 0; j < fill.length; j++) {\n // 0-1 stop point for the current line, multiplied to global space afterwards\n var lineStop = 0;\n if (typeof fillGradientStops[j] === 'number') {\n lineStop = fillGradientStops[j];\n }\n else {\n lineStop = j / fill.length;\n }\n var globalStop = (thisLineTop / height) + (lineStop * gradStopLineHeight);\n // Prevent color stop generation going backwards from floating point imprecision\n var clampedStop = Math.max(lastIterationStop, globalStop);\n clampedStop = Math.min(clampedStop, 1); // Cap at 1 as well for safety's sake to avoid a possible throw.\n gradient.addColorStop(clampedStop, fill[j]);\n lastIterationStop = clampedStop;\n }\n }\n }\n else {\n // start the gradient at the center left of the canvas, and end at the center right of the canvas\n gradient = this.context.createLinearGradient(padding, height / 2, width + padding, height / 2);\n // can just evenly space out the gradients in this case, as multiple lines makes no difference\n // to an even left to right gradient\n var totalIterations = fill.length + 1;\n var currentIteration = 1;\n for (var i = 0; i < fill.length; i++) {\n var stop = void 0;\n if (typeof fillGradientStops[i] === 'number') {\n stop = fillGradientStops[i];\n }\n else {\n stop = currentIteration / totalIterations;\n }\n gradient.addColorStop(stop, fill[i]);\n currentIteration++;\n }\n }\n return gradient;\n };\n /**\n * Destroys this text object.\n * Note* Unlike a Sprite, a Text object will automatically destroy its baseTexture and texture as\n * the majority of the time the texture will not be shared with any other Sprites.\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their\n * destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=true] - Should it destroy the current texture of the sprite as well\n * @param {boolean} [options.baseTexture=true] - Should it destroy the base texture of the sprite as well\n */\n Text.prototype.destroy = function (options) {\n if (typeof options === 'boolean') {\n options = { children: options };\n }\n options = Object.assign({}, defaultDestroyOptions, options);\n _super.prototype.destroy.call(this, options);\n // set canvas width and height to 0 to workaround memory leak in Safari < 13\n // https://stackoverflow.com/questions/52532614/total-canvas-memory-use-exceeds-the-maximum-limit-safari-12\n if (this._ownCanvas) {\n this.canvas.height = this.canvas.width = 0;\n }\n // make sure to reset the the context and canvas.. dont want this hanging around in memory!\n this.context = null;\n this.canvas = null;\n this._style = null;\n };\n Object.defineProperty(Text.prototype, \"width\", {\n /**\n * The width of the Text, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n get: function () {\n this.updateText(true);\n return Math.abs(this.scale.x) * this._texture.orig.width;\n },\n set: function (value) {\n this.updateText(true);\n var s = sign(this.scale.x) || 1;\n this.scale.x = s * value / this._texture.orig.width;\n this._width = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"height\", {\n /**\n * The height of the Text, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n get: function () {\n this.updateText(true);\n return Math.abs(this.scale.y) * this._texture.orig.height;\n },\n set: function (value) {\n this.updateText(true);\n var s = sign(this.scale.y) || 1;\n this.scale.y = s * value / this._texture.orig.height;\n this._height = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"style\", {\n /**\n * Set the style of the text. Set up an event listener to listen for changes on the style\n * object and mark the text as dirty.\n *\n * @member {object|PIXI.TextStyle}\n */\n get: function () {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the ITextStyle\n // since the setter creates the TextStyle. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n return this._style;\n },\n set: function (style) {\n style = style || {};\n if (style instanceof TextStyle) {\n this._style = style;\n }\n else {\n this._style = new TextStyle(style);\n }\n this.localStyleID = -1;\n this.dirty = true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"text\", {\n /**\n * Set the copy for the text object. To split a line you can use '\\n'.\n *\n * @member {string}\n */\n get: function () {\n return this._text;\n },\n set: function (text) {\n text = String(text === null || text === undefined ? '' : text);\n if (this._text === text) {\n return;\n }\n this._text = text;\n this.dirty = true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"resolution\", {\n /**\n * The resolution / device pixel ratio of the canvas.\n * This is set to automatically match the renderer resolution by default, but can be overridden by setting manually.\n * @member {number}\n * @default 1\n */\n get: function () {\n return this._resolution;\n },\n set: function (value) {\n this._autoResolution = false;\n if (this._resolution === value) {\n return;\n }\n this._resolution = value;\n this.dirty = true;\n },\n enumerable: false,\n configurable: true\n });\n return Text;\n}(Sprite));\n\nexport { TEXT_GRADIENT, Text, TextMetrics, TextStyle };\n//# sourceMappingURL=text.es.js.map\n","/*!\n * @pixi/prepare - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/prepare is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { settings } from '@pixi/settings';\nimport { Texture, BaseTexture } from '@pixi/core';\nimport { Graphics } from '@pixi/graphics';\nimport { Ticker, UPDATE_PRIORITY } from '@pixi/ticker';\nimport { Container } from '@pixi/display';\nimport { Text, TextStyle, TextMetrics } from '@pixi/text';\n\n/**\n * Default number of uploads per frame using prepare plugin.\n *\n * @static\n * @memberof PIXI.settings\n * @name UPLOADS_PER_FRAME\n * @type {number}\n * @default 4\n */\nsettings.UPLOADS_PER_FRAME = 4;\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * CountLimiter limits the number of items handled by a {@link PIXI.BasePrepare} to a specified\n * number of items per frame.\n *\n * @class\n * @memberof PIXI\n */\nvar CountLimiter = /** @class */ (function () {\n /**\n * @param {number} maxItemsPerFrame - The maximum number of items that can be prepared each frame.\n */\n function CountLimiter(maxItemsPerFrame) {\n /**\n * The maximum number of items that can be prepared each frame.\n * @type {number}\n * @private\n */\n this.maxItemsPerFrame = maxItemsPerFrame;\n /**\n * The number of items that can be prepared in the current frame.\n * @type {number}\n * @private\n */\n this.itemsLeft = 0;\n }\n /**\n * Resets any counting properties to start fresh on a new frame.\n */\n CountLimiter.prototype.beginFrame = function () {\n this.itemsLeft = this.maxItemsPerFrame;\n };\n /**\n * Checks to see if another item can be uploaded. This should only be called once per item.\n * @return {boolean} If the item is allowed to be uploaded.\n */\n CountLimiter.prototype.allowedToUpload = function () {\n return this.itemsLeft-- > 0;\n };\n return CountLimiter;\n}());\n\n/**\n * Built-in hook to find multiple textures from objects like AnimatedSprites.\n *\n * @private\n * @param {PIXI.DisplayObject} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Texture object was found.\n */\nfunction findMultipleBaseTextures(item, queue) {\n var result = false;\n // Objects with multiple textures\n if (item && item._textures && item._textures.length) {\n for (var i = 0; i < item._textures.length; i++) {\n if (item._textures[i] instanceof Texture) {\n var baseTexture = item._textures[i].baseTexture;\n if (queue.indexOf(baseTexture) === -1) {\n queue.push(baseTexture);\n result = true;\n }\n }\n }\n }\n return result;\n}\n/**\n * Built-in hook to find BaseTextures from Texture.\n *\n * @private\n * @param {PIXI.Texture} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Texture object was found.\n */\nfunction findBaseTexture(item, queue) {\n if (item.baseTexture instanceof BaseTexture) {\n var texture = item.baseTexture;\n if (queue.indexOf(texture) === -1) {\n queue.push(texture);\n }\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to find textures from objects.\n *\n * @private\n * @param {PIXI.DisplayObject} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Texture object was found.\n */\nfunction findTexture(item, queue) {\n if (item._texture && item._texture instanceof Texture) {\n var texture = item._texture.baseTexture;\n if (queue.indexOf(texture) === -1) {\n queue.push(texture);\n }\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to draw PIXI.Text to its texture.\n *\n * @private\n * @param {PIXI.AbstractRenderer|PIXI.BasePrepare} helper - Not used by this upload handler\n * @param {PIXI.DisplayObject} item - Item to check\n * @return {boolean} If item was uploaded.\n */\nfunction drawText(_helper, item) {\n if (item instanceof Text) {\n // updating text will return early if it is not dirty\n item.updateText(true);\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to calculate a text style for a PIXI.Text object.\n *\n * @private\n * @param {PIXI.AbstractRenderer|PIXI.BasePrepare} helper - Not used by this upload handler\n * @param {PIXI.DisplayObject} item - Item to check\n * @return {boolean} If item was uploaded.\n */\nfunction calculateTextStyle(_helper, item) {\n if (item instanceof TextStyle) {\n var font = item.toFontString();\n TextMetrics.measureFont(font);\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to find Text objects.\n *\n * @private\n * @param {PIXI.DisplayObject} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Text object was found.\n */\nfunction findText(item, queue) {\n if (item instanceof Text) {\n // push the text style to prepare it - this can be really expensive\n if (queue.indexOf(item.style) === -1) {\n queue.push(item.style);\n }\n // also push the text object so that we can render it (to canvas/texture) if needed\n if (queue.indexOf(item) === -1) {\n queue.push(item);\n }\n // also push the Text's texture for upload to GPU\n var texture = item._texture.baseTexture;\n if (queue.indexOf(texture) === -1) {\n queue.push(texture);\n }\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to find TextStyle objects.\n *\n * @private\n * @param {PIXI.TextStyle} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.TextStyle object was found.\n */\nfunction findTextStyle(item, queue) {\n if (item instanceof TextStyle) {\n if (queue.indexOf(item) === -1) {\n queue.push(item);\n }\n return true;\n }\n return false;\n}\n/**\n * The prepare manager provides functionality to upload content to the GPU.\n *\n * BasePrepare handles basic queuing functionality and is extended by\n * {@link PIXI.Prepare} and {@link PIXI.CanvasPrepare}\n * to provide preparation capabilities specific to their respective renderers.\n *\n * @example\n * // Create a sprite\n * const sprite = PIXI.Sprite.from('something.png');\n *\n * // Load object into GPU\n * app.renderer.plugins.prepare.upload(sprite, () => {\n *\n * //Texture(s) has been uploaded to GPU\n * app.stage.addChild(sprite);\n *\n * })\n *\n * @abstract\n * @class\n * @memberof PIXI\n */\nvar BasePrepare = /** @class */ (function () {\n /**\n * @param {PIXI.AbstractRenderer} renderer - A reference to the current renderer\n */\n function BasePrepare(renderer) {\n var _this = this;\n /**\n * The limiter to be used to control how quickly items are prepared.\n * @type {PIXI.CountLimiter|PIXI.TimeLimiter}\n */\n this.limiter = new CountLimiter(settings.UPLOADS_PER_FRAME);\n /**\n * Reference to the renderer.\n * @type {PIXI.AbstractRenderer}\n * @protected\n */\n this.renderer = renderer;\n /**\n * The only real difference between CanvasPrepare and Prepare is what they pass\n * to upload hooks. That different parameter is stored here.\n * @type {object}\n * @protected\n */\n this.uploadHookHelper = null;\n /**\n * Collection of items to uploads at once.\n * @type {Array<*>}\n * @private\n */\n this.queue = [];\n /**\n * Collection of additional hooks for finding assets.\n * @type {Array}\n * @private\n */\n this.addHooks = [];\n /**\n * Collection of additional hooks for processing assets.\n * @type {Array}\n * @private\n */\n this.uploadHooks = [];\n /**\n * Callback to call after completed.\n * @type {Array}\n * @private\n */\n this.completes = [];\n /**\n * If prepare is ticking (running).\n * @type {boolean}\n * @private\n */\n this.ticking = false;\n /**\n * 'bound' call for prepareItems().\n * @type {Function}\n * @private\n */\n this.delayedTick = function () {\n // unlikely, but in case we were destroyed between tick() and delayedTick()\n if (!_this.queue) {\n return;\n }\n _this.prepareItems();\n };\n // hooks to find the correct texture\n this.registerFindHook(findText);\n this.registerFindHook(findTextStyle);\n this.registerFindHook(findMultipleBaseTextures);\n this.registerFindHook(findBaseTexture);\n this.registerFindHook(findTexture);\n // upload hooks\n this.registerUploadHook(drawText);\n this.registerUploadHook(calculateTextStyle);\n }\n /**\n * Upload all the textures and graphics to the GPU.\n *\n * @param {Function|PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text} item -\n * Either the container or display object to search for items to upload, the items to upload themselves,\n * or the callback function, if items have been added using `prepare.add`.\n * @param {Function} [done] - Optional callback when all queued uploads have completed\n */\n BasePrepare.prototype.upload = function (item, done) {\n if (typeof item === 'function') {\n done = item;\n item = null;\n }\n // If a display object, search for items\n // that we could upload\n if (item) {\n this.add(item);\n }\n // Get the items for upload from the display\n if (this.queue.length) {\n if (done) {\n this.completes.push(done);\n }\n if (!this.ticking) {\n this.ticking = true;\n Ticker.system.addOnce(this.tick, this, UPDATE_PRIORITY.UTILITY);\n }\n }\n else if (done) {\n done();\n }\n };\n /**\n * Handle tick update\n *\n * @private\n */\n BasePrepare.prototype.tick = function () {\n setTimeout(this.delayedTick, 0);\n };\n /**\n * Actually prepare items. This is handled outside of the tick because it will take a while\n * and we do NOT want to block the current animation frame from rendering.\n *\n * @private\n */\n BasePrepare.prototype.prepareItems = function () {\n this.limiter.beginFrame();\n // Upload the graphics\n while (this.queue.length && this.limiter.allowedToUpload()) {\n var item = this.queue[0];\n var uploaded = false;\n if (item && !item._destroyed) {\n for (var i = 0, len = this.uploadHooks.length; i < len; i++) {\n if (this.uploadHooks[i](this.uploadHookHelper, item)) {\n this.queue.shift();\n uploaded = true;\n break;\n }\n }\n }\n if (!uploaded) {\n this.queue.shift();\n }\n }\n // We're finished\n if (!this.queue.length) {\n this.ticking = false;\n var completes = this.completes.slice(0);\n this.completes.length = 0;\n for (var i = 0, len = completes.length; i < len; i++) {\n completes[i]();\n }\n }\n else {\n // if we are not finished, on the next rAF do this again\n Ticker.system.addOnce(this.tick, this, UPDATE_PRIORITY.UTILITY);\n }\n };\n /**\n * Adds hooks for finding items.\n *\n * @param {Function} addHook - Function call that takes two parameters: `item:*, queue:Array`\n * function must return `true` if it was able to add item to the queue.\n * @return {this} Instance of plugin for chaining.\n */\n BasePrepare.prototype.registerFindHook = function (addHook) {\n if (addHook) {\n this.addHooks.push(addHook);\n }\n return this;\n };\n /**\n * Adds hooks for uploading items.\n *\n * @param {Function} uploadHook - Function call that takes two parameters: `prepare:CanvasPrepare, item:*` and\n * function must return `true` if it was able to handle upload of item.\n * @return {this} Instance of plugin for chaining.\n */\n BasePrepare.prototype.registerUploadHook = function (uploadHook) {\n if (uploadHook) {\n this.uploadHooks.push(uploadHook);\n }\n return this;\n };\n /**\n * Manually add an item to the uploading queue.\n *\n * @param {PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text|*} item - Object to\n * add to the queue\n * @return {this} Instance of plugin for chaining.\n */\n BasePrepare.prototype.add = function (item) {\n // Add additional hooks for finding elements on special\n // types of objects that\n for (var i = 0, len = this.addHooks.length; i < len; i++) {\n if (this.addHooks[i](item, this.queue)) {\n break;\n }\n }\n // Get children recursively\n if (item instanceof Container) {\n for (var i = item.children.length - 1; i >= 0; i--) {\n this.add(item.children[i]);\n }\n }\n return this;\n };\n /**\n * Destroys the plugin, don't use after this.\n *\n */\n BasePrepare.prototype.destroy = function () {\n if (this.ticking) {\n Ticker.system.remove(this.tick, this);\n }\n this.ticking = false;\n this.addHooks = null;\n this.uploadHooks = null;\n this.renderer = null;\n this.completes = null;\n this.queue = null;\n this.limiter = null;\n this.uploadHookHelper = null;\n };\n return BasePrepare;\n}());\n\n/**\n * Built-in hook to upload PIXI.Texture objects to the GPU.\n *\n * @private\n * @param {PIXI.Renderer} renderer - instance of the webgl renderer\n * @param {PIXI.BaseTexture} item - Item to check\n * @return {boolean} If item was uploaded.\n */\nfunction uploadBaseTextures(renderer, item) {\n if (item instanceof BaseTexture) {\n // if the texture already has a GL texture, then the texture has been prepared or rendered\n // before now. If the texture changed, then the changer should be calling texture.update() which\n // reuploads the texture without need for preparing it again\n if (!item._glTextures[renderer.CONTEXT_UID]) {\n renderer.texture.bind(item);\n }\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to upload PIXI.Graphics to the GPU.\n *\n * @private\n * @param {PIXI.Renderer} renderer - instance of the webgl renderer\n * @param {PIXI.DisplayObject} item - Item to check\n * @return {boolean} If item was uploaded.\n */\nfunction uploadGraphics(renderer, item) {\n if (!(item instanceof Graphics)) {\n return false;\n }\n var geometry = item.geometry;\n // update dirty graphics to get batches\n item.finishPoly();\n geometry.updateBatches();\n var batches = geometry.batches;\n // upload all textures found in styles\n for (var i = 0; i < batches.length; i++) {\n var texture = batches[i].style.texture;\n if (texture) {\n uploadBaseTextures(renderer, texture.baseTexture);\n }\n }\n // if its not batchable - update vao for particular shader\n if (!geometry.batchable) {\n renderer.geometry.bind(geometry, item._resolveDirectShader(renderer));\n }\n return true;\n}\n/**\n * Built-in hook to find graphics.\n *\n * @private\n * @param {PIXI.DisplayObject} item - Display object to check\n * @param {Array<*>} queue - Collection of items to upload\n * @return {boolean} if a PIXI.Graphics object was found.\n */\nfunction findGraphics(item, queue) {\n if (item instanceof Graphics) {\n queue.push(item);\n return true;\n }\n return false;\n}\n/**\n * The prepare plugin provides renderer-specific plugins for pre-rendering DisplayObjects. These plugins are useful for\n * asynchronously preparing and uploading to the GPU assets, textures, graphics waiting to be displayed.\n *\n * Do not instantiate this plugin directly. It is available from the `renderer.plugins` property.\n * See {@link PIXI.CanvasRenderer#plugins} or {@link PIXI.Renderer#plugins}.\n * @example\n * // Create a new application\n * const app = new PIXI.Application();\n * document.body.appendChild(app.view);\n *\n * // Don't start rendering right away\n * app.stop();\n *\n * // create a display object\n * const rect = new PIXI.Graphics()\n * .beginFill(0x00ff00)\n * .drawRect(40, 40, 200, 200);\n *\n * // Add to the stage\n * app.stage.addChild(rect);\n *\n * // Don't start rendering until the graphic is uploaded to the GPU\n * app.renderer.plugins.prepare.upload(app.stage, () => {\n * app.start();\n * });\n *\n * @class\n * @extends PIXI.BasePrepare\n * @memberof PIXI\n */\nvar Prepare = /** @class */ (function (_super) {\n __extends(Prepare, _super);\n /**\n * @param {PIXI.Renderer} renderer - A reference to the current renderer\n */\n function Prepare(renderer) {\n var _this = _super.call(this, renderer) || this;\n _this.uploadHookHelper = _this.renderer;\n // Add textures and graphics to upload\n _this.registerFindHook(findGraphics);\n _this.registerUploadHook(uploadBaseTextures);\n _this.registerUploadHook(uploadGraphics);\n return _this;\n }\n return Prepare;\n}(BasePrepare));\n\n/**\n * TimeLimiter limits the number of items handled by a {@link PIXI.BasePrepare} to a specified\n * number of milliseconds per frame.\n *\n * @class\n * @memberof PIXI\n */\nvar TimeLimiter = /** @class */ (function () {\n /**\n * @param {number} maxMilliseconds - The maximum milliseconds that can be spent preparing items each frame.\n */\n function TimeLimiter(maxMilliseconds) {\n /**\n * The maximum milliseconds that can be spent preparing items each frame.\n * @type {number}\n * @private\n */\n this.maxMilliseconds = maxMilliseconds;\n /**\n * The start time of the current frame.\n * @type {number}\n * @private\n */\n this.frameStart = 0;\n }\n /**\n * Resets any counting properties to start fresh on a new frame.\n */\n TimeLimiter.prototype.beginFrame = function () {\n this.frameStart = Date.now();\n };\n /**\n * Checks to see if another item can be uploaded. This should only be called once per item.\n * @return {boolean} If the item is allowed to be uploaded.\n */\n TimeLimiter.prototype.allowedToUpload = function () {\n return Date.now() - this.frameStart < this.maxMilliseconds;\n };\n return TimeLimiter;\n}());\n\nexport { BasePrepare, CountLimiter, Prepare, TimeLimiter };\n//# sourceMappingURL=prepare.es.js.map\n","/*!\n * @pixi/spritesheet - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/spritesheet is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Rectangle } from '@pixi/math';\nimport { Texture, BaseTexture } from '@pixi/core';\nimport { getResolutionOfUrl, url } from '@pixi/utils';\nimport { LoaderResource } from '@pixi/loaders';\n\n/**\n * Utility class for maintaining reference to a collection\n * of Textures on a single Spritesheet.\n *\n * To access a sprite sheet from your code pass its JSON data file to Pixi's loader:\n *\n * ```js\n * PIXI.Loader.shared.add(\"images/spritesheet.json\").load(setup);\n *\n * function setup() {\n * let sheet = PIXI.Loader.shared.resources[\"images/spritesheet.json\"].spritesheet;\n * ...\n * }\n * ```\n * With the `sheet.textures` you can create Sprite objects,`sheet.animations` can be used to create an AnimatedSprite.\n *\n * Sprite sheets can be packed using tools like {@link https://codeandweb.com/texturepacker|TexturePacker},\n * {@link https://renderhjs.net/shoebox/|Shoebox} or {@link https://github.com/krzysztof-o/spritesheet.js|Spritesheet.js}.\n * Default anchor points (see {@link PIXI.Texture#defaultAnchor}) and grouping of animation sprites are currently only\n * supported by TexturePacker.\n *\n * @class\n * @memberof PIXI\n */\nvar Spritesheet = /** @class */ (function () {\n /**\n * @param {PIXI.BaseTexture|PIXI.Texture} baseTexture - Reference to the source BaseTexture object.\n * @param {Object} data - Spritesheet image data.\n * @param {string} [resolutionFilename] - The filename to consider when determining\n * the resolution of the spritesheet. If not provided, the imageUrl will\n * be used on the BaseTexture.\n */\n function Spritesheet(texture, data, resolutionFilename) {\n if (resolutionFilename === void 0) { resolutionFilename = null; }\n /**\n * Reference to original source image from the Loader. This reference is retained so we\n * can destroy the Texture later on. It is never used internally.\n * @type {PIXI.Texture}\n * @private\n */\n this._texture = texture instanceof Texture ? texture : null;\n /**\n * Reference to ths source texture.\n * @type {PIXI.BaseTexture}\n */\n this.baseTexture = texture instanceof BaseTexture ? texture : this._texture.baseTexture;\n /**\n * A map containing all textures of the sprite sheet.\n * Can be used to create a {@link PIXI.Sprite|Sprite}:\n * ```js\n * new PIXI.Sprite(sheet.textures[\"image.png\"]);\n * ```\n * @member {Object}\n */\n this.textures = {};\n /**\n * A map containing the textures for each animation.\n * Can be used to create an {@link PIXI.AnimatedSprite|AnimatedSprite}:\n * ```js\n * new PIXI.AnimatedSprite(sheet.animations[\"anim_name\"])\n * ```\n * @member {Object}\n */\n this.animations = {};\n /**\n * Reference to the original JSON data.\n * @type {Object}\n */\n this.data = data;\n var resource = this.baseTexture.resource;\n /**\n * The resolution of the spritesheet.\n * @type {number}\n */\n this.resolution = this._updateResolution(resolutionFilename || (resource ? resource.url : null));\n /**\n * Map of spritesheet frames.\n * @type {Object}\n * @private\n */\n this._frames = this.data.frames;\n /**\n * Collection of frame names.\n * @type {string[]}\n * @private\n */\n this._frameKeys = Object.keys(this._frames);\n /**\n * Current batch index being processed.\n * @type {number}\n * @private\n */\n this._batchIndex = 0;\n /**\n * Callback when parse is completed.\n * @type {Function}\n * @private\n */\n this._callback = null;\n }\n /**\n * Generate the resolution from the filename or fallback\n * to the meta.scale field of the JSON data.\n *\n * @private\n * @param {string} resolutionFilename - The filename to use for resolving\n * the default resolution.\n * @return {number} Resolution to use for spritesheet.\n */\n Spritesheet.prototype._updateResolution = function (resolutionFilename) {\n if (resolutionFilename === void 0) { resolutionFilename = null; }\n var scale = this.data.meta.scale;\n // Use a defaultValue of `null` to check if a url-based resolution is set\n var resolution = getResolutionOfUrl(resolutionFilename, null);\n // No resolution found via URL\n if (resolution === null) {\n // Use the scale value or default to 1\n resolution = scale !== undefined ? parseFloat(scale) : 1;\n }\n // For non-1 resolutions, update baseTexture\n if (resolution !== 1) {\n this.baseTexture.setResolution(resolution);\n }\n return resolution;\n };\n /**\n * Parser spritesheet from loaded data. This is done asynchronously\n * to prevent creating too many Texture within a single process.\n *\n * @param {Function} callback - Callback when complete returns\n * a map of the Textures for this spritesheet.\n */\n Spritesheet.prototype.parse = function (callback) {\n this._batchIndex = 0;\n this._callback = callback;\n if (this._frameKeys.length <= Spritesheet.BATCH_SIZE) {\n this._processFrames(0);\n this._processAnimations();\n this._parseComplete();\n }\n else {\n this._nextBatch();\n }\n };\n /**\n * Process a batch of frames\n *\n * @private\n * @param {number} initialFrameIndex - The index of frame to start.\n */\n Spritesheet.prototype._processFrames = function (initialFrameIndex) {\n var frameIndex = initialFrameIndex;\n var maxFrames = Spritesheet.BATCH_SIZE;\n while (frameIndex - initialFrameIndex < maxFrames && frameIndex < this._frameKeys.length) {\n var i = this._frameKeys[frameIndex];\n var data = this._frames[i];\n var rect = data.frame;\n if (rect) {\n var frame = null;\n var trim = null;\n var sourceSize = data.trimmed !== false && data.sourceSize\n ? data.sourceSize : data.frame;\n var orig = new Rectangle(0, 0, Math.floor(sourceSize.w) / this.resolution, Math.floor(sourceSize.h) / this.resolution);\n if (data.rotated) {\n frame = new Rectangle(Math.floor(rect.x) / this.resolution, Math.floor(rect.y) / this.resolution, Math.floor(rect.h) / this.resolution, Math.floor(rect.w) / this.resolution);\n }\n else {\n frame = new Rectangle(Math.floor(rect.x) / this.resolution, Math.floor(rect.y) / this.resolution, Math.floor(rect.w) / this.resolution, Math.floor(rect.h) / this.resolution);\n }\n // Check to see if the sprite is trimmed\n if (data.trimmed !== false && data.spriteSourceSize) {\n trim = new Rectangle(Math.floor(data.spriteSourceSize.x) / this.resolution, Math.floor(data.spriteSourceSize.y) / this.resolution, Math.floor(rect.w) / this.resolution, Math.floor(rect.h) / this.resolution);\n }\n this.textures[i] = new Texture(this.baseTexture, frame, orig, trim, data.rotated ? 2 : 0, data.anchor);\n // lets also add the frame to pixi's global cache for 'from' and 'fromLoader' functions\n Texture.addToCache(this.textures[i], i);\n }\n frameIndex++;\n }\n };\n /**\n * Parse animations config\n *\n * @private\n */\n Spritesheet.prototype._processAnimations = function () {\n var animations = this.data.animations || {};\n for (var animName in animations) {\n this.animations[animName] = [];\n for (var i = 0; i < animations[animName].length; i++) {\n var frameName = animations[animName][i];\n this.animations[animName].push(this.textures[frameName]);\n }\n }\n };\n /**\n * The parse has completed.\n *\n * @private\n */\n Spritesheet.prototype._parseComplete = function () {\n var callback = this._callback;\n this._callback = null;\n this._batchIndex = 0;\n callback.call(this, this.textures);\n };\n /**\n * Begin the next batch of textures.\n *\n * @private\n */\n Spritesheet.prototype._nextBatch = function () {\n var _this = this;\n this._processFrames(this._batchIndex * Spritesheet.BATCH_SIZE);\n this._batchIndex++;\n setTimeout(function () {\n if (_this._batchIndex * Spritesheet.BATCH_SIZE < _this._frameKeys.length) {\n _this._nextBatch();\n }\n else {\n _this._processAnimations();\n _this._parseComplete();\n }\n }, 0);\n };\n /**\n * Destroy Spritesheet and don't use after this.\n *\n * @param {boolean} [destroyBase=false] - Whether to destroy the base texture as well\n */\n Spritesheet.prototype.destroy = function (destroyBase) {\n var _a;\n if (destroyBase === void 0) { destroyBase = false; }\n for (var i in this.textures) {\n this.textures[i].destroy();\n }\n this._frames = null;\n this._frameKeys = null;\n this.data = null;\n this.textures = null;\n if (destroyBase) {\n (_a = this._texture) === null || _a === void 0 ? void 0 : _a.destroy();\n this.baseTexture.destroy();\n }\n this._texture = null;\n this.baseTexture = null;\n };\n /**\n * The maximum number of Textures to build per process.\n *\n * @type {number}\n * @default 1000\n */\n Spritesheet.BATCH_SIZE = 1000;\n return Spritesheet;\n}());\n\n/**\n * {@link PIXI.Loader Loader} middleware for loading texture atlases that have been created with\n * TexturePacker or similar JSON-based spritesheet.\n *\n * This middleware automatically generates Texture resources.\n *\n * @class\n * @memberof PIXI\n * @implements PIXI.ILoaderPlugin\n */\nvar SpritesheetLoader = /** @class */ (function () {\n function SpritesheetLoader() {\n }\n /**\n * Called after a resource is loaded.\n * @see PIXI.Loader.loaderMiddleware\n * @param {PIXI.LoaderResource} resource\n * @param {function} next\n */\n SpritesheetLoader.use = function (resource, next) {\n // because this is middleware, it execute in loader context. `this` = loader\n var loader = this;\n var imageResourceName = resource.name + \"_image\";\n // skip if no data, its not json, it isn't spritesheet data, or the image resource already exists\n if (!resource.data\n || resource.type !== LoaderResource.TYPE.JSON\n || !resource.data.frames\n || loader.resources[imageResourceName]) {\n next();\n return;\n }\n var loadOptions = {\n crossOrigin: resource.crossOrigin,\n metadata: resource.metadata.imageMetadata,\n parentResource: resource,\n };\n var resourcePath = SpritesheetLoader.getResourcePath(resource, loader.baseUrl);\n // load the image for this sheet\n loader.add(imageResourceName, resourcePath, loadOptions, function onImageLoad(res) {\n if (res.error) {\n next(res.error);\n return;\n }\n var spritesheet = new Spritesheet(res.texture, resource.data, resource.url);\n spritesheet.parse(function () {\n resource.spritesheet = spritesheet;\n resource.textures = spritesheet.textures;\n next();\n });\n });\n };\n /**\n * Get the spritesheets root path\n * @param {PIXI.LoaderResource} resource - Resource to check path\n * @param {string} baseUrl - Base root url\n */\n SpritesheetLoader.getResourcePath = function (resource, baseUrl) {\n // Prepend url path unless the resource image is a data url\n if (resource.isDataUrl) {\n return resource.data.meta.image;\n }\n return url.resolve(resource.url.replace(baseUrl, ''), resource.data.meta.image);\n };\n return SpritesheetLoader;\n}());\n\nexport { Spritesheet, SpritesheetLoader };\n//# sourceMappingURL=spritesheet.es.js.map\n","/*!\n * @pixi/sprite-tiling - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/sprite-tiling is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { TextureMatrix, Texture, Shader, QuadUv, State, ObjectRenderer } from '@pixi/core';\nimport { Point, Transform, Rectangle, Matrix } from '@pixi/math';\nimport { Sprite } from '@pixi/sprite';\nimport { deprecation, premultiplyTintToRgba, correctBlendMode } from '@pixi/utils';\nimport { WRAP_MODES } from '@pixi/constants';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar tempPoint = new Point();\n/**\n * A tiling sprite is a fast way of rendering a tiling image\n *\n * @class\n * @extends PIXI.Sprite\n * @memberof PIXI\n */\nvar TilingSprite = /** @class */ (function (_super) {\n __extends(TilingSprite, _super);\n /**\n * @param {PIXI.Texture} texture - the texture of the tiling sprite\n * @param {number} [width=100] - the width of the tiling sprite\n * @param {number} [height=100] - the height of the tiling sprite\n */\n function TilingSprite(texture, width, height) {\n if (width === void 0) { width = 100; }\n if (height === void 0) { height = 100; }\n var _this = _super.call(this, texture) || this;\n /**\n * Tile transform\n *\n * @member {PIXI.Transform}\n */\n _this.tileTransform = new Transform();\n /**\n * The with of the tiling sprite\n *\n * @member {number}\n * @private\n */\n _this._width = width;\n /**\n * The height of the tiling sprite\n *\n * @member {number}\n * @private\n */\n _this._height = height;\n /**\n * matrix that is applied to UV to get the coords in Texture normalized space to coords in BaseTexture space\n *\n * @member {PIXI.TextureMatrix}\n */\n _this.uvMatrix = _this.texture.uvMatrix || new TextureMatrix(texture);\n /**\n * Plugin that is responsible for rendering this element.\n * Allows to customize the rendering process without overriding '_render' method.\n *\n * @member {string}\n * @default 'tilingSprite'\n */\n _this.pluginName = 'tilingSprite';\n /**\n * Whether or not anchor affects uvs\n *\n * @member {boolean}\n * @default false\n */\n _this.uvRespectAnchor = false;\n return _this;\n }\n Object.defineProperty(TilingSprite.prototype, \"clampMargin\", {\n /**\n * Changes frame clamping in corresponding textureTransform, shortcut\n * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas\n *\n * @default 0.5\n * @member {number}\n */\n get: function () {\n return this.uvMatrix.clampMargin;\n },\n set: function (value) {\n this.uvMatrix.clampMargin = value;\n this.uvMatrix.update(true);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TilingSprite.prototype, \"tileScale\", {\n /**\n * The scaling of the image that is being tiled\n *\n * @member {PIXI.ObservablePoint}\n */\n get: function () {\n return this.tileTransform.scale;\n },\n set: function (value) {\n this.tileTransform.scale.copyFrom(value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TilingSprite.prototype, \"tilePosition\", {\n /**\n * The offset of the image that is being tiled\n *\n * @member {PIXI.ObservablePoint}\n */\n get: function () {\n return this.tileTransform.position;\n },\n set: function (value) {\n this.tileTransform.position.copyFrom(value);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @protected\n */\n TilingSprite.prototype._onTextureUpdate = function () {\n if (this.uvMatrix) {\n this.uvMatrix.texture = this._texture;\n }\n this._cachedTint = 0xFFFFFF;\n };\n /**\n * Renders the object using the WebGL renderer\n *\n * @protected\n * @param {PIXI.Renderer} renderer - The renderer\n */\n TilingSprite.prototype._render = function (renderer) {\n // tweak our texture temporarily..\n var texture = this._texture;\n if (!texture || !texture.valid) {\n return;\n }\n this.tileTransform.updateLocalTransform();\n this.uvMatrix.update();\n renderer.batch.setObjectRenderer(renderer.plugins[this.pluginName]);\n renderer.plugins[this.pluginName].render(this);\n };\n /**\n * Updates the bounds of the tiling sprite.\n *\n * @protected\n */\n TilingSprite.prototype._calculateBounds = function () {\n var minX = this._width * -this._anchor._x;\n var minY = this._height * -this._anchor._y;\n var maxX = this._width * (1 - this._anchor._x);\n var maxY = this._height * (1 - this._anchor._y);\n this._bounds.addFrame(this.transform, minX, minY, maxX, maxY);\n };\n /**\n * Gets the local bounds of the sprite object.\n *\n * @param {PIXI.Rectangle} rect - The output rectangle.\n * @return {PIXI.Rectangle} The bounds.\n */\n TilingSprite.prototype.getLocalBounds = function (rect) {\n // we can do a fast local bounds if the sprite has no children!\n if (this.children.length === 0) {\n this._bounds.minX = this._width * -this._anchor._x;\n this._bounds.minY = this._height * -this._anchor._y;\n this._bounds.maxX = this._width * (1 - this._anchor._x);\n this._bounds.maxY = this._height * (1 - this._anchor._y);\n if (!rect) {\n if (!this._localBoundsRect) {\n this._localBoundsRect = new Rectangle();\n }\n rect = this._localBoundsRect;\n }\n return this._bounds.getRectangle(rect);\n }\n return _super.prototype.getLocalBounds.call(this, rect);\n };\n /**\n * Checks if a point is inside this tiling sprite.\n *\n * @param {PIXI.IPointData} point - the point to check\n * @return {boolean} Whether or not the sprite contains the point.\n */\n TilingSprite.prototype.containsPoint = function (point) {\n this.worldTransform.applyInverse(point, tempPoint);\n var width = this._width;\n var height = this._height;\n var x1 = -width * this.anchor._x;\n if (tempPoint.x >= x1 && tempPoint.x < x1 + width) {\n var y1 = -height * this.anchor._y;\n if (tempPoint.y >= y1 && tempPoint.y < y1 + height) {\n return true;\n }\n }\n return false;\n };\n /**\n * Destroys this sprite and optionally its texture and children\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well\n * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well\n */\n TilingSprite.prototype.destroy = function (options) {\n _super.prototype.destroy.call(this, options);\n this.tileTransform = null;\n this.uvMatrix = null;\n };\n /**\n * Helper function that creates a new tiling sprite based on the source you provide.\n * The source can be - frame id, image url, video url, canvas element, video element, base texture\n *\n * @static\n * @param {string|PIXI.Texture|HTMLCanvasElement|HTMLVideoElement} source - Source to create texture from\n * @param {Object} options - See {@link PIXI.BaseTexture}'s constructor for options.\n * @param {number} options.width - required width of the tiling sprite\n * @param {number} options.height - required height of the tiling sprite\n * @return {PIXI.TilingSprite} The newly created texture\n */\n TilingSprite.from = function (source, options) {\n // Deprecated\n if (typeof options === 'number') {\n deprecation('5.3.0', 'TilingSprite.from use options instead of width and height args');\n // eslint-disable-next-line prefer-rest-params\n options = { width: options, height: arguments[2] };\n }\n return new TilingSprite(Texture.from(source, options), options.width, options.height);\n };\n Object.defineProperty(TilingSprite.prototype, \"width\", {\n /**\n * The width of the sprite, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n get: function () {\n return this._width;\n },\n set: function (value) {\n this._width = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TilingSprite.prototype, \"height\", {\n /**\n * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set\n *\n * @member {number}\n */\n get: function () {\n return this._height;\n },\n set: function (value) {\n this._height = value;\n },\n enumerable: false,\n configurable: true\n });\n return TilingSprite;\n}(Sprite));\n\nvar vertex = \"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\";\n\nvar fragment = \"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\nvar fragmentSimple = \"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\nvar tempMat = new Matrix();\n/**\n * WebGL renderer plugin for tiling sprites\n *\n * @class\n * @memberof PIXI\n * @extends PIXI.ObjectRenderer\n */\nvar TilingSpriteRenderer = /** @class */ (function (_super) {\n __extends(TilingSpriteRenderer, _super);\n /**\n * constructor for renderer\n *\n * @param {PIXI.Renderer} renderer - The renderer this tiling awesomeness works for.\n */\n function TilingSpriteRenderer(renderer) {\n var _this = _super.call(this, renderer) || this;\n var uniforms = { globals: _this.renderer.globalUniforms };\n _this.shader = Shader.from(vertex, fragment, uniforms);\n _this.simpleShader = Shader.from(vertex, fragmentSimple, uniforms);\n _this.quad = new QuadUv();\n /**\n * The WebGL state in which this renderer will work.\n *\n * @member {PIXI.State}\n * @readonly\n */\n _this.state = State.for2d();\n return _this;\n }\n /**\n *\n * @param {PIXI.TilingSprite} ts - tilingSprite to be rendered\n */\n TilingSpriteRenderer.prototype.render = function (ts) {\n var renderer = this.renderer;\n var quad = this.quad;\n var vertices = quad.vertices;\n vertices[0] = vertices[6] = (ts._width) * -ts.anchor.x;\n vertices[1] = vertices[3] = ts._height * -ts.anchor.y;\n vertices[2] = vertices[4] = (ts._width) * (1.0 - ts.anchor.x);\n vertices[5] = vertices[7] = ts._height * (1.0 - ts.anchor.y);\n if (ts.uvRespectAnchor) {\n vertices = quad.uvs;\n vertices[0] = vertices[6] = -ts.anchor.x;\n vertices[1] = vertices[3] = -ts.anchor.y;\n vertices[2] = vertices[4] = 1.0 - ts.anchor.x;\n vertices[5] = vertices[7] = 1.0 - ts.anchor.y;\n }\n quad.invalidate();\n var tex = ts._texture;\n var baseTex = tex.baseTexture;\n var lt = ts.tileTransform.localTransform;\n var uv = ts.uvMatrix;\n var isSimple = baseTex.isPowerOfTwo\n && tex.frame.width === baseTex.width && tex.frame.height === baseTex.height;\n // auto, force repeat wrapMode for big tiling textures\n if (isSimple) {\n if (!baseTex._glTextures[renderer.CONTEXT_UID]) {\n if (baseTex.wrapMode === WRAP_MODES.CLAMP) {\n baseTex.wrapMode = WRAP_MODES.REPEAT;\n }\n }\n else {\n isSimple = baseTex.wrapMode !== WRAP_MODES.CLAMP;\n }\n }\n var shader = isSimple ? this.simpleShader : this.shader;\n var w = tex.width;\n var h = tex.height;\n var W = ts._width;\n var H = ts._height;\n tempMat.set(lt.a * w / W, lt.b * w / H, lt.c * h / W, lt.d * h / H, lt.tx / W, lt.ty / H);\n // that part is the same as above:\n // tempMat.identity();\n // tempMat.scale(tex.width, tex.height);\n // tempMat.prepend(lt);\n // tempMat.scale(1.0 / ts._width, 1.0 / ts._height);\n tempMat.invert();\n if (isSimple) {\n tempMat.prepend(uv.mapCoord);\n }\n else {\n shader.uniforms.uMapCoord = uv.mapCoord.toArray(true);\n shader.uniforms.uClampFrame = uv.uClampFrame;\n shader.uniforms.uClampOffset = uv.uClampOffset;\n }\n shader.uniforms.uTransform = tempMat.toArray(true);\n shader.uniforms.uColor = premultiplyTintToRgba(ts.tint, ts.worldAlpha, shader.uniforms.uColor, baseTex.alphaMode);\n shader.uniforms.translationMatrix = ts.transform.worldTransform.toArray(true);\n shader.uniforms.uSampler = tex;\n renderer.shader.bind(shader);\n renderer.geometry.bind(quad);\n this.state.blendMode = correctBlendMode(ts.blendMode, baseTex.alphaMode);\n renderer.state.set(this.state);\n renderer.geometry.draw(this.renderer.gl.TRIANGLES, 6, 0);\n };\n return TilingSpriteRenderer;\n}(ObjectRenderer));\n\nexport { TilingSprite, TilingSpriteRenderer };\n//# sourceMappingURL=sprite-tiling.es.js.map\n","/*!\n * @pixi/mesh - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/mesh is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { State, Program, TextureMatrix, Shader, Buffer, Geometry } from '@pixi/core';\nimport { Point, Polygon, Matrix } from '@pixi/math';\nimport { DRAW_MODES, TYPES } from '@pixi/constants';\nimport { Container } from '@pixi/display';\nimport { settings } from '@pixi/settings';\nimport { premultiplyTintToRgba } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * Class controls cache for UV mapping from Texture normal space to BaseTexture normal space.\n *\n * @class\n * @memberof PIXI\n */\nvar MeshBatchUvs = /** @class */ (function () {\n /**\n * @param {PIXI.Buffer} uvBuffer - Buffer with normalized uv's\n * @param {PIXI.TextureMatrix} uvMatrix - Material UV matrix\n */\n function MeshBatchUvs(uvBuffer, uvMatrix) {\n /**\n * Buffer with normalized UV's\n * @member {PIXI.Buffer}\n */\n this.uvBuffer = uvBuffer;\n /**\n * Material UV matrix\n * @member {PIXI.TextureMatrix}\n */\n this.uvMatrix = uvMatrix;\n /**\n * UV Buffer data\n * @member {Float32Array}\n * @readonly\n */\n this.data = null;\n this._bufferUpdateId = -1;\n this._textureUpdateId = -1;\n this._updateID = 0;\n }\n /**\n * updates\n *\n * @param {boolean} [forceUpdate] - force the update\n */\n MeshBatchUvs.prototype.update = function (forceUpdate) {\n if (!forceUpdate\n && this._bufferUpdateId === this.uvBuffer._updateID\n && this._textureUpdateId === this.uvMatrix._updateID) {\n return;\n }\n this._bufferUpdateId = this.uvBuffer._updateID;\n this._textureUpdateId = this.uvMatrix._updateID;\n var data = this.uvBuffer.data;\n if (!this.data || this.data.length !== data.length) {\n this.data = new Float32Array(data.length);\n }\n this.uvMatrix.multiplyUvs(data, this.data);\n this._updateID++;\n };\n return MeshBatchUvs;\n}());\n\nvar tempPoint = new Point();\nvar tempPolygon = new Polygon();\n/**\n * Base mesh class.\n *\n * This class empowers you to have maximum flexibility to render any kind of WebGL visuals you can think of.\n * This class assumes a certain level of WebGL knowledge.\n * If you know a bit this should abstract enough away to make you life easier!\n *\n * Pretty much ALL WebGL can be broken down into the following:\n * - Geometry - The structure and data for the mesh. This can include anything from positions, uvs, normals, colors etc..\n * - Shader - This is the shader that PixiJS will render the geometry with (attributes in the shader must match the geometry)\n * - State - This is the state of WebGL required to render the mesh.\n *\n * Through a combination of the above elements you can render anything you want, 2D or 3D!\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI\n */\nvar Mesh = /** @class */ (function (_super) {\n __extends(Mesh, _super);\n /**\n * @param {PIXI.Geometry} geometry - the geometry the mesh will use\n * @param {PIXI.MeshMaterial} shader - the shader the mesh will use\n * @param {PIXI.State} [state] - the state that the WebGL context is required to be in to render the mesh\n * if no state is provided, uses {@link PIXI.State.for2d} to create a 2D state for PixiJS.\n * @param {number} [drawMode=PIXI.DRAW_MODES.TRIANGLES] - the drawMode, can be any of the PIXI.DRAW_MODES consts\n */\n function Mesh(geometry, shader, state, drawMode) {\n if (drawMode === void 0) { drawMode = DRAW_MODES.TRIANGLES; }\n var _this = _super.call(this) || this;\n /**\n * Includes vertex positions, face indices, normals, colors, UVs, and\n * custom attributes within buffers, reducing the cost of passing all\n * this data to the GPU. Can be shared between multiple Mesh objects.\n * @member {PIXI.Geometry}\n * @readonly\n */\n _this.geometry = geometry;\n geometry.refCount++;\n /**\n * Represents the vertex and fragment shaders that processes the geometry and runs on the GPU.\n * Can be shared between multiple Mesh objects.\n * @member {PIXI.Shader|PIXI.MeshMaterial}\n */\n _this.shader = shader;\n /**\n * Represents the WebGL state the Mesh required to render, excludes shader and geometry. E.g.,\n * blend mode, culling, depth testing, direction of rendering triangles, backface, etc.\n * @member {PIXI.State}\n */\n _this.state = state || State.for2d();\n /**\n * The way the Mesh should be drawn, can be any of the {@link PIXI.DRAW_MODES} constants.\n *\n * @member {number}\n * @see PIXI.DRAW_MODES\n */\n _this.drawMode = drawMode;\n /**\n * Typically the index of the IndexBuffer where to start drawing.\n * @member {number}\n * @default 0\n */\n _this.start = 0;\n /**\n * How much of the geometry to draw, by default `0` renders everything.\n * @member {number}\n * @default 0\n */\n _this.size = 0;\n /**\n * thease are used as easy access for batching\n * @member {Float32Array}\n * @private\n */\n _this.uvs = null;\n /**\n * thease are used as easy access for batching\n * @member {Uint16Array}\n * @private\n */\n _this.indices = null;\n /**\n * this is the caching layer used by the batcher\n * @member {Float32Array}\n * @private\n */\n _this.vertexData = new Float32Array(1);\n /**\n * If geometry is changed used to decide to re-transform\n * the vertexData.\n * @member {number}\n * @private\n */\n _this.vertexDirty = 0;\n _this._transformID = -1;\n /**\n * Internal roundPixels field\n *\n * @member {boolean}\n * @private\n */\n _this._roundPixels = settings.ROUND_PIXELS;\n /**\n * Batched UV's are cached for atlas textures\n * @member {PIXI.MeshBatchUvs}\n * @private\n */\n _this.batchUvs = null;\n return _this;\n }\n Object.defineProperty(Mesh.prototype, \"uvBuffer\", {\n /**\n * To change mesh uv's, change its uvBuffer data and increment its _updateID.\n * @member {PIXI.Buffer}\n * @readonly\n */\n get: function () {\n return this.geometry.buffers[1];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"verticesBuffer\", {\n /**\n * To change mesh vertices, change its uvBuffer data and increment its _updateID.\n * Incrementing _updateID is optional because most of Mesh objects do it anyway.\n * @member {PIXI.Buffer}\n * @readonly\n */\n get: function () {\n return this.geometry.buffers[0];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"material\", {\n get: function () {\n return this.shader;\n },\n /**\n * Alias for {@link PIXI.Mesh#shader}.\n * @member {PIXI.MeshMaterial}\n */\n set: function (value) {\n this.shader = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"blendMode\", {\n get: function () {\n return this.state.blendMode;\n },\n /**\n * The blend mode to be applied to the Mesh. Apply a value of\n * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL;\n * @see PIXI.BLEND_MODES\n */\n set: function (value) {\n this.state.blendMode = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"roundPixels\", {\n get: function () {\n return this._roundPixels;\n },\n /**\n * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.\n * Advantages can include sharper image quality (like text) and faster rendering on canvas.\n * The main disadvantage is movement of objects may appear less smooth.\n * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}\n *\n * @member {boolean}\n * @default false\n */\n set: function (value) {\n if (this._roundPixels !== value) {\n this._transformID = -1;\n }\n this._roundPixels = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"tint\", {\n /**\n * The multiply tint applied to the Mesh. This is a hex value. A value of\n * `0xFFFFFF` will remove any tint effect.\n *\n * @member {number}\n * @default 0xFFFFFF\n */\n get: function () {\n return this.shader.tint;\n },\n set: function (value) {\n this.shader.tint = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"texture\", {\n /**\n * The texture that the Mesh uses.\n *\n * @member {PIXI.Texture}\n */\n get: function () {\n return this.shader.texture;\n },\n set: function (value) {\n this.shader.texture = value;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Standard renderer draw.\n * @protected\n * @param {PIXI.Renderer} renderer - Instance to renderer.\n */\n Mesh.prototype._render = function (renderer) {\n // set properties for batching..\n // TODO could use a different way to grab verts?\n var vertices = this.geometry.buffers[0].data;\n // TODO benchmark check for attribute size..\n if (this.shader.batchable\n && this.drawMode === DRAW_MODES.TRIANGLES\n && vertices.length < Mesh.BATCHABLE_SIZE * 2) {\n this._renderToBatch(renderer);\n }\n else {\n this._renderDefault(renderer);\n }\n };\n /**\n * Standard non-batching way of rendering.\n * @protected\n * @param {PIXI.Renderer} renderer - Instance to renderer.\n */\n Mesh.prototype._renderDefault = function (renderer) {\n var shader = this.shader;\n shader.alpha = this.worldAlpha;\n if (shader.update) {\n shader.update();\n }\n renderer.batch.flush();\n if (shader.program.uniformData.translationMatrix) {\n shader.uniforms.translationMatrix = this.transform.worldTransform.toArray(true);\n }\n // bind and sync uniforms..\n renderer.shader.bind(shader);\n // set state..\n renderer.state.set(this.state);\n // bind the geometry...\n renderer.geometry.bind(this.geometry, shader);\n // then render it\n renderer.geometry.draw(this.drawMode, this.size, this.start, this.geometry.instanceCount);\n };\n /**\n * Rendering by using the Batch system.\n * @protected\n * @param {PIXI.Renderer} renderer - Instance to renderer.\n */\n Mesh.prototype._renderToBatch = function (renderer) {\n var geometry = this.geometry;\n if (this.shader.uvMatrix) {\n this.shader.uvMatrix.update();\n this.calculateUvs();\n }\n // set properties for batching..\n this.calculateVertices();\n this.indices = geometry.indexBuffer.data;\n this._tintRGB = this.shader._tintRGB;\n this._texture = this.shader.texture;\n var pluginName = this.material.pluginName;\n renderer.batch.setObjectRenderer(renderer.plugins[pluginName]);\n renderer.plugins[pluginName].render(this);\n };\n /**\n * Updates vertexData field based on transform and vertices\n */\n Mesh.prototype.calculateVertices = function () {\n var geometry = this.geometry;\n var vertices = geometry.buffers[0].data;\n if (geometry.vertexDirtyId === this.vertexDirty && this._transformID === this.transform._worldID) {\n return;\n }\n this._transformID = this.transform._worldID;\n if (this.vertexData.length !== vertices.length) {\n this.vertexData = new Float32Array(vertices.length);\n }\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var vertexData = this.vertexData;\n for (var i = 0; i < vertexData.length / 2; i++) {\n var x = vertices[(i * 2)];\n var y = vertices[(i * 2) + 1];\n vertexData[(i * 2)] = (a * x) + (c * y) + tx;\n vertexData[(i * 2) + 1] = (b * x) + (d * y) + ty;\n }\n if (this._roundPixels) {\n var resolution = settings.RESOLUTION;\n for (var i = 0; i < vertexData.length; ++i) {\n vertexData[i] = Math.round((vertexData[i] * resolution | 0) / resolution);\n }\n }\n this.vertexDirty = geometry.vertexDirtyId;\n };\n /**\n * Updates uv field based on from geometry uv's or batchUvs\n */\n Mesh.prototype.calculateUvs = function () {\n var geomUvs = this.geometry.buffers[1];\n if (!this.shader.uvMatrix.isSimple) {\n if (!this.batchUvs) {\n this.batchUvs = new MeshBatchUvs(geomUvs, this.shader.uvMatrix);\n }\n this.batchUvs.update();\n this.uvs = this.batchUvs.data;\n }\n else {\n this.uvs = geomUvs.data;\n }\n };\n /**\n * Updates the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account.\n * there must be a aVertexPosition attribute present in the geometry for bounds to be calculated correctly.\n *\n * @protected\n */\n Mesh.prototype._calculateBounds = function () {\n this.calculateVertices();\n this._bounds.addVertexData(this.vertexData, 0, this.vertexData.length);\n };\n /**\n * Tests if a point is inside this mesh. Works only for PIXI.DRAW_MODES.TRIANGLES.\n *\n * @param {PIXI.IPointData} point - the point to test\n * @return {boolean} the result of the test\n */\n Mesh.prototype.containsPoint = function (point) {\n if (!this.getBounds().contains(point.x, point.y)) {\n return false;\n }\n this.worldTransform.applyInverse(point, tempPoint);\n var vertices = this.geometry.getBuffer('aVertexPosition').data;\n var points = tempPolygon.points;\n var indices = this.geometry.getIndex().data;\n var len = indices.length;\n var step = this.drawMode === 4 ? 3 : 1;\n for (var i = 0; i + 2 < len; i += step) {\n var ind0 = indices[i] * 2;\n var ind1 = indices[i + 1] * 2;\n var ind2 = indices[i + 2] * 2;\n points[0] = vertices[ind0];\n points[1] = vertices[ind0 + 1];\n points[2] = vertices[ind1];\n points[3] = vertices[ind1 + 1];\n points[4] = vertices[ind2];\n points[5] = vertices[ind2 + 1];\n if (tempPolygon.contains(tempPoint.x, tempPoint.y)) {\n return true;\n }\n }\n return false;\n };\n /**\n * Destroys the Mesh object.\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all\n * options have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have\n * their destroy method called as well. 'options' will be passed on to those calls.\n */\n Mesh.prototype.destroy = function (options) {\n _super.prototype.destroy.call(this, options);\n this.geometry.refCount--;\n if (this.geometry.refCount === 0) {\n this.geometry.dispose();\n }\n this.geometry = null;\n this.shader = null;\n this.state = null;\n this.uvs = null;\n this.indices = null;\n this.vertexData = null;\n };\n /**\n * The maximum number of vertices to consider batchable. Generally, the complexity\n * of the geometry.\n * @memberof PIXI.Mesh\n * @static\n * @member {number} BATCHABLE_SIZE\n */\n Mesh.BATCHABLE_SIZE = 100;\n return Mesh;\n}(Container));\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform vec4 uColor;\\n\\nuniform sampler2D uSampler;\\n\\nvoid main(void)\\n{\\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\\n}\\n\";\n\nvar vertex = \"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\";\n\n/**\n * Slightly opinionated default shader for PixiJS 2D objects.\n * @class\n * @memberof PIXI\n * @extends PIXI.Shader\n */\nvar MeshMaterial = /** @class */ (function (_super) {\n __extends(MeshMaterial, _super);\n /**\n * @param {PIXI.Texture} uSampler - Texture that material uses to render.\n * @param {object} [options] - Additional options\n * @param {number} [options.alpha=1] - Default alpha.\n * @param {number} [options.tint=0xFFFFFF] - Default tint.\n * @param {string} [options.pluginName='batch'] - Renderer plugin for batching.\n * @param {PIXI.Program} [options.program=0xFFFFFF] - Custom program.\n * @param {object} [options.uniforms] - Custom uniforms.\n */\n function MeshMaterial(uSampler, options) {\n var _this = this;\n var uniforms = {\n uSampler: uSampler,\n alpha: 1,\n uTextureMatrix: Matrix.IDENTITY,\n uColor: new Float32Array([1, 1, 1, 1]),\n };\n // Set defaults\n options = Object.assign({\n tint: 0xFFFFFF,\n alpha: 1,\n pluginName: 'batch',\n }, options);\n if (options.uniforms) {\n Object.assign(uniforms, options.uniforms);\n }\n _this = _super.call(this, options.program || Program.from(vertex, fragment), uniforms) || this;\n /**\n * Only do update if tint or alpha changes.\n * @member {boolean}\n * @private\n * @default false\n */\n _this._colorDirty = false;\n /**\n * TextureMatrix instance for this Mesh, used to track Texture changes\n *\n * @member {PIXI.TextureMatrix}\n * @readonly\n */\n _this.uvMatrix = new TextureMatrix(uSampler);\n /**\n * `true` if shader can be batch with the renderer's batch system.\n * @member {boolean}\n * @default true\n */\n _this.batchable = options.program === undefined;\n /**\n * Renderer plugin for batching\n *\n * @member {string}\n * @default 'batch'\n */\n _this.pluginName = options.pluginName;\n _this.tint = options.tint;\n _this.alpha = options.alpha;\n return _this;\n }\n Object.defineProperty(MeshMaterial.prototype, \"texture\", {\n /**\n * Reference to the texture being rendered.\n * @member {PIXI.Texture}\n */\n get: function () {\n return this.uniforms.uSampler;\n },\n set: function (value) {\n if (this.uniforms.uSampler !== value) {\n this.uniforms.uSampler = value;\n this.uvMatrix.texture = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MeshMaterial.prototype, \"alpha\", {\n get: function () {\n return this._alpha;\n },\n /**\n * This gets automatically set by the object using this.\n *\n * @default 1\n * @member {number}\n */\n set: function (value) {\n if (value === this._alpha)\n { return; }\n this._alpha = value;\n this._colorDirty = true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MeshMaterial.prototype, \"tint\", {\n get: function () {\n return this._tint;\n },\n /**\n * Multiply tint for the material.\n * @member {number}\n * @default 0xFFFFFF\n */\n set: function (value) {\n if (value === this._tint)\n { return; }\n this._tint = value;\n this._tintRGB = (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16);\n this._colorDirty = true;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Gets called automatically by the Mesh. Intended to be overridden for custom\n * MeshMaterial objects.\n */\n MeshMaterial.prototype.update = function () {\n if (this._colorDirty) {\n this._colorDirty = false;\n var baseTexture = this.texture.baseTexture;\n premultiplyTintToRgba(this._tint, this._alpha, this.uniforms.uColor, baseTexture.alphaMode);\n }\n if (this.uvMatrix.update()) {\n this.uniforms.uTextureMatrix = this.uvMatrix.mapCoord;\n }\n };\n return MeshMaterial;\n}(Shader));\n\n/**\n * Standard 2D geometry used in PixiJS.\n *\n * Geometry can be defined without passing in a style or data if required.\n *\n * ```js\n * const geometry = new PIXI.Geometry();\n *\n * geometry.addAttribute('positions', [0, 0, 100, 0, 100, 100, 0, 100], 2);\n * geometry.addAttribute('uvs', [0,0,1,0,1,1,0,1], 2);\n * geometry.addIndex([0,1,2,1,3,2]);\n *\n * ```\n * @class\n * @memberof PIXI\n * @extends PIXI.Geometry\n */\nvar MeshGeometry = /** @class */ (function (_super) {\n __extends(MeshGeometry, _super);\n /**\n * @param {Float32Array|number[]} [vertices] - Positional data on geometry.\n * @param {Float32Array|number[]} [uvs] - Texture UVs.\n * @param {Uint16Array|number[]} [index] - IndexBuffer\n */\n function MeshGeometry(vertices, uvs, index) {\n var _this = _super.call(this) || this;\n var verticesBuffer = new Buffer(vertices);\n var uvsBuffer = new Buffer(uvs, true);\n var indexBuffer = new Buffer(index, true, true);\n _this.addAttribute('aVertexPosition', verticesBuffer, 2, false, TYPES.FLOAT)\n .addAttribute('aTextureCoord', uvsBuffer, 2, false, TYPES.FLOAT)\n .addIndex(indexBuffer);\n /**\n * Dirty flag to limit update calls on Mesh. For example,\n * limiting updates on a single Mesh instance with a shared Geometry\n * within the render loop.\n * @private\n * @member {number}\n * @default -1\n */\n _this._updateId = -1;\n return _this;\n }\n Object.defineProperty(MeshGeometry.prototype, \"vertexDirtyId\", {\n /**\n * If the vertex position is updated.\n * @member {number}\n * @readonly\n * @private\n */\n get: function () {\n return this.buffers[0]._updateID;\n },\n enumerable: false,\n configurable: true\n });\n return MeshGeometry;\n}(Geometry));\n\nexport { Mesh, MeshBatchUvs, MeshGeometry, MeshMaterial };\n//# sourceMappingURL=mesh.es.js.map\n","/*!\n * @pixi/text-bitmap - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/text-bitmap is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Rectangle, ObservablePoint, Point } from '@pixi/math';\nimport { settings } from '@pixi/settings';\nimport { MeshGeometry, MeshMaterial, Mesh } from '@pixi/mesh';\nimport { hex2rgb, string2hex, getResolutionOfUrl, deprecation, removeItems } from '@pixi/utils';\nimport { Texture, BaseTexture } from '@pixi/core';\nimport { TEXT_GRADIENT, TextStyle, TextMetrics } from '@pixi/text';\nimport { Container } from '@pixi/display';\nimport { LoaderResource } from '@pixi/loaders';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/* eslint-disable max-len */\n/**\n * Normalized parsed data from .fnt files.\n *\n * @class\n * @memberof PIXI\n */\nvar BitmapFontData = /** @class */ (function () {\n function BitmapFontData() {\n /**\n * @member {PIXI.IBitmapFontDataInfo[]}\n * @readOnly\n */\n this.info = [];\n /**\n * @member {PIXI.IBitmapFontDataCommon[]}\n * @readOnly\n */\n this.common = [];\n /**\n * @member {PIXI.IBitmapFontDataPage[]}\n * @readOnly\n */\n this.page = [];\n /**\n * @member {PIXI.IBitmapFontDataChar[]}\n * @readOnly\n */\n this.char = [];\n /**\n * @member {PIXI.IBitmapFontDataKerning[]}\n * @readOnly\n */\n this.kerning = [];\n }\n return BitmapFontData;\n}());\n/**\n * @memberof PIXI\n * @typedef {object} IBitmapFontDataInfo\n * @property {string} face\n * @property {number} size\n */\n/**\n * @memberof PIXI\n * @typedef {object} IBitmapFontDataCommon\n * @property {number} lineHeight\n */\n/**\n * @memberof PIXI\n * @typedef {object} IBitmapFontDataPage\n * @property {number} id\n * @property {string} file\n */\n/**\n * @memberof PIXI\n * @typedef {object} IBitmapFontDataChar\n * @property {string} id\n * @property {number} page\n * @property {number} x\n * @property {number} y\n * @property {number} width\n * @property {number} height\n * @property {number} xoffset\n * @property {number} yoffset\n * @property {number} xadvance\n */\n/**\n * @memberof PIXI\n * @typedef {object} IBitmapFontDataKerning\n * @property {number} first\n * @property {number} second\n * @property {number} amount\n */\n\n/**\n * BitmapFont format that's Text-based.\n *\n * @class\n * @private\n */\nvar TextFormat = /** @class */ (function () {\n function TextFormat() {\n }\n /**\n * Check if resource refers to txt font data.\n *\n * @static\n * @private\n * @param {any} data\n * @return {boolean} True if resource could be treated as font data, false otherwise.\n */\n TextFormat.test = function (data) {\n return typeof data === 'string' && data.indexOf('info face=') === 0;\n };\n /**\n * Convert text font data to a javascript object.\n *\n * @static\n * @private\n * @param {string} txt - Raw string data to be converted\n * @return {PIXI.BitmapFontData} Parsed font data\n */\n TextFormat.parse = function (txt) {\n // Retrieve data item\n var items = txt.match(/^[a-z]+\\s+.+$/gm);\n var rawData = {\n info: [],\n common: [],\n page: [],\n char: [],\n chars: [],\n kerning: [],\n kernings: [],\n };\n for (var i in items) {\n // Extract item name\n var name = items[i].match(/^[a-z]+/gm)[0];\n // Extract item attribute list as string ex.: \"width=10\"\n var attributeList = items[i].match(/[a-zA-Z]+=([^\\s\"']+|\"([^\"]*)\")/gm);\n // Convert attribute list into an object\n var itemData = {};\n for (var i_1 in attributeList) {\n // Split key-value pairs\n var split = attributeList[i_1].split('=');\n var key = split[0];\n // Remove eventual quotes from value\n var strValue = split[1].replace(/\"/gm, '');\n // Try to convert value into float\n var floatValue = parseFloat(strValue);\n // Use string value case float value is NaN\n var value = isNaN(floatValue) ? strValue : floatValue;\n itemData[key] = value;\n }\n // Push current item to the resulting data\n rawData[name].push(itemData);\n }\n var font = new BitmapFontData();\n rawData.info.forEach(function (info) { return font.info.push({\n face: info.face,\n size: parseInt(info.size, 10),\n }); });\n rawData.common.forEach(function (common) { return font.common.push({\n lineHeight: parseInt(common.lineHeight, 10),\n }); });\n rawData.page.forEach(function (page) { return font.page.push({\n id: parseInt(page.id, 10),\n file: page.file,\n }); });\n rawData.char.forEach(function (char) { return font.char.push({\n id: parseInt(char.id, 10),\n page: parseInt(char.page, 10),\n x: parseInt(char.x, 10),\n y: parseInt(char.y, 10),\n width: parseInt(char.width, 10),\n height: parseInt(char.height, 10),\n xoffset: parseInt(char.xoffset, 10),\n yoffset: parseInt(char.yoffset, 10),\n xadvance: parseInt(char.xadvance, 10),\n }); });\n rawData.kerning.forEach(function (kerning) { return font.kerning.push({\n first: parseInt(kerning.first, 10),\n second: parseInt(kerning.second, 10),\n amount: parseInt(kerning.amount, 10),\n }); });\n return font;\n };\n return TextFormat;\n}());\n\n/**\n * BitmapFont format that's XML-based.\n *\n * @class\n * @private\n */\nvar XMLFormat = /** @class */ (function () {\n function XMLFormat() {\n }\n /**\n * Check if resource refers to xml font data.\n *\n * @static\n * @private\n * @param {any} data\n * @return {boolean} True if resource could be treated as font data, false otherwise.\n */\n XMLFormat.test = function (data) {\n return data instanceof XMLDocument\n && data.getElementsByTagName('page').length\n && data.getElementsByTagName('info')[0].getAttribute('face') !== null;\n };\n /**\n * Convert the XML into BitmapFontData that we can use.\n *\n * @static\n * @private\n * @param {XMLDocument} xml\n * @return {BitmapFontData} Data to use for BitmapFont\n */\n XMLFormat.parse = function (xml) {\n var data = new BitmapFontData();\n var info = xml.getElementsByTagName('info');\n var common = xml.getElementsByTagName('common');\n var page = xml.getElementsByTagName('page');\n var char = xml.getElementsByTagName('char');\n var kerning = xml.getElementsByTagName('kerning');\n for (var i = 0; i < info.length; i++) {\n data.info.push({\n face: info[i].getAttribute('face'),\n size: parseInt(info[i].getAttribute('size'), 10),\n });\n }\n for (var i = 0; i < common.length; i++) {\n data.common.push({\n lineHeight: parseInt(common[i].getAttribute('lineHeight'), 10),\n });\n }\n for (var i = 0; i < page.length; i++) {\n data.page.push({\n id: parseInt(page[i].getAttribute('id'), 10) || 0,\n file: page[i].getAttribute('file'),\n });\n }\n for (var i = 0; i < char.length; i++) {\n var letter = char[i];\n data.char.push({\n id: parseInt(letter.getAttribute('id'), 10),\n page: parseInt(letter.getAttribute('page'), 10) || 0,\n x: parseInt(letter.getAttribute('x'), 10),\n y: parseInt(letter.getAttribute('y'), 10),\n width: parseInt(letter.getAttribute('width'), 10),\n height: parseInt(letter.getAttribute('height'), 10),\n xoffset: parseInt(letter.getAttribute('xoffset'), 10),\n yoffset: parseInt(letter.getAttribute('yoffset'), 10),\n xadvance: parseInt(letter.getAttribute('xadvance'), 10),\n });\n }\n for (var i = 0; i < kerning.length; i++) {\n data.kerning.push({\n first: parseInt(kerning[i].getAttribute('first'), 10),\n second: parseInt(kerning[i].getAttribute('second'), 10),\n amount: parseInt(kerning[i].getAttribute('amount'), 10),\n });\n }\n return data;\n };\n return XMLFormat;\n}());\n\n/**\n * BitmapFont format that's XML-based.\n *\n * @class\n * @private\n */\nvar XMLStringFormat = /** @class */ (function () {\n function XMLStringFormat() {\n }\n /**\n * Check if resource refers to text xml font data.\n *\n * @static\n * @private\n * @param {any} data\n * @return {boolean} True if resource could be treated as font data, false otherwise.\n */\n XMLStringFormat.test = function (data) {\n if (typeof data === 'string' && data.indexOf('') > -1) {\n var xml = new self.DOMParser().parseFromString(data, 'text/xml');\n return XMLFormat.test(xml);\n }\n return false;\n };\n /**\n * Convert the text XML into BitmapFontData that we can use.\n *\n * @static\n * @private\n * @param {string} xmlTxt\n * @return {BitmapFontData} Data to use for BitmapFont\n */\n XMLStringFormat.parse = function (xmlTxt) {\n var xml = new window.DOMParser().parseFromString(xmlTxt, 'text/xml');\n return XMLFormat.parse(xml);\n };\n return XMLStringFormat;\n}());\n\n// Registered formats, maybe make this extensible in the future?\nvar formats = [\n TextFormat,\n XMLFormat,\n XMLStringFormat ];\n/**\n * Auto-detect BitmapFont parsing format based on data.\n * @private\n * @param {any} data - Data to detect format\n * @return {any} Format or null\n */\nfunction autoDetectFormat(data) {\n for (var i = 0; i < formats.length; i++) {\n if (formats[i].test(data)) {\n return formats[i];\n }\n }\n return null;\n}\n\n// TODO: Prevent code duplication b/w generateFillStyle & Text#generateFillStyle\n/**\n * Generates the fill style. Can automatically generate a gradient based on the fill style being an array\n *\n * @private\n * @param {object} style - The style.\n * @param {string[]} lines - The lines of text.\n * @return {string|number|CanvasGradient} The fill style\n */\nfunction generateFillStyle(canvas, context, style, resolution, lines, metrics) {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n var fillStyle = style.fill;\n if (!Array.isArray(fillStyle)) {\n return fillStyle;\n }\n else if (fillStyle.length === 1) {\n return fillStyle[0];\n }\n // the gradient will be evenly spaced out according to how large the array is.\n // ['#FF0000', '#00FF00', '#0000FF'] would created stops at 0.25, 0.5 and 0.75\n var gradient;\n // a dropshadow will enlarge the canvas and result in the gradient being\n // generated with the incorrect dimensions\n var dropShadowCorrection = (style.dropShadow) ? style.dropShadowDistance : 0;\n // should also take padding into account, padding can offset the gradient\n var padding = style.padding || 0;\n var width = Math.ceil(canvas.width / resolution) - dropShadowCorrection - (padding * 2);\n var height = Math.ceil(canvas.height / resolution) - dropShadowCorrection - (padding * 2);\n // make a copy of the style settings, so we can manipulate them later\n var fill = fillStyle.slice();\n var fillGradientStops = style.fillGradientStops.slice();\n // wanting to evenly distribute the fills. So an array of 4 colours should give fills of 0.25, 0.5 and 0.75\n if (!fillGradientStops.length) {\n var lengthPlus1 = fill.length + 1;\n for (var i = 1; i < lengthPlus1; ++i) {\n fillGradientStops.push(i / lengthPlus1);\n }\n }\n // stop the bleeding of the last gradient on the line above to the top gradient of the this line\n // by hard defining the first gradient colour at point 0, and last gradient colour at point 1\n fill.unshift(fillStyle[0]);\n fillGradientStops.unshift(0);\n fill.push(fillStyle[fillStyle.length - 1]);\n fillGradientStops.push(1);\n if (style.fillGradientType === TEXT_GRADIENT.LINEAR_VERTICAL) {\n // start the gradient at the top center of the canvas, and end at the bottom middle of the canvas\n gradient = context.createLinearGradient(width / 2, padding, width / 2, height + padding);\n // we need to repeat the gradient so that each individual line of text has the same vertical gradient effect\n // ['#FF0000', '#00FF00', '#0000FF'] over 2 lines would create stops at 0.125, 0.25, 0.375, 0.625, 0.75, 0.875\n // There's potential for floating point precision issues at the seams between gradient repeats.\n // The loop below generates the stops in order, so track the last generated one to prevent\n // floating point precision from making us go the teeniest bit backwards, resulting in\n // the first and last colors getting swapped.\n var lastIterationStop = 0;\n // Actual height of the text itself, not counting spacing for lineHeight/leading/dropShadow etc\n var textHeight = metrics.fontProperties.fontSize + style.strokeThickness;\n // textHeight, but as a 0-1 size in global gradient stop space\n var gradStopLineHeight = textHeight / height;\n for (var i = 0; i < lines.length; i++) {\n var thisLineTop = metrics.lineHeight * i;\n for (var j = 0; j < fill.length; j++) {\n // 0-1 stop point for the current line, multiplied to global space afterwards\n var lineStop = 0;\n if (typeof fillGradientStops[j] === 'number') {\n lineStop = fillGradientStops[j];\n }\n else {\n lineStop = j / fill.length;\n }\n var globalStop = (thisLineTop / height) + (lineStop * gradStopLineHeight);\n // Prevent color stop generation going backwards from floating point imprecision\n var clampedStop = Math.max(lastIterationStop, globalStop);\n clampedStop = Math.min(clampedStop, 1); // Cap at 1 as well for safety's sake to avoid a possible throw.\n gradient.addColorStop(clampedStop, fill[j]);\n lastIterationStop = clampedStop;\n }\n }\n }\n else {\n // start the gradient at the center left of the canvas, and end at the center right of the canvas\n gradient = context.createLinearGradient(padding, height / 2, width + padding, height / 2);\n // can just evenly space out the gradients in this case, as multiple lines makes no difference\n // to an even left to right gradient\n var totalIterations = fill.length + 1;\n var currentIteration = 1;\n for (var i = 0; i < fill.length; i++) {\n var stop = void 0;\n if (typeof fillGradientStops[i] === 'number') {\n stop = fillGradientStops[i];\n }\n else {\n stop = currentIteration / totalIterations;\n }\n gradient.addColorStop(stop, fill[i]);\n currentIteration++;\n }\n }\n return gradient;\n}\n\n// TODO: Prevent code duplication b/w drawGlyph & Text#updateText\n/**\n * Draws the glyph `metrics.text` on the given canvas.\n *\n * Ignored because not directly exposed.\n *\n * @ignore\n * @param {HTMLCanvasElement} canvas\n * @param {CanvasRenderingContext2D} context\n * @param {TextMetrics} metrics\n * @param {number} x\n * @param {number} y\n * @param {number} resolution\n * @param {TextStyle} style\n */\nfunction drawGlyph(canvas, context, metrics, x, y, resolution, style) {\n var char = metrics.text;\n var fontProperties = metrics.fontProperties;\n context.translate(x, y);\n context.scale(resolution, resolution);\n var tx = style.strokeThickness / 2;\n var ty = -(style.strokeThickness / 2);\n context.font = style.toFontString();\n context.lineWidth = style.strokeThickness;\n context.textBaseline = style.textBaseline;\n context.lineJoin = style.lineJoin;\n context.miterLimit = style.miterLimit;\n // set canvas text styles\n context.fillStyle = generateFillStyle(canvas, context, style, resolution, [char], metrics);\n context.strokeStyle = style.stroke;\n context.font = style.toFontString();\n context.lineWidth = style.strokeThickness;\n context.textBaseline = style.textBaseline;\n context.lineJoin = style.lineJoin;\n context.miterLimit = style.miterLimit;\n // set canvas text styles\n context.fillStyle = generateFillStyle(canvas, context, style, resolution, [char], metrics);\n context.strokeStyle = style.stroke;\n var dropShadowColor = style.dropShadowColor;\n var rgb = hex2rgb(typeof dropShadowColor === 'number' ? dropShadowColor : string2hex(dropShadowColor));\n if (style.dropShadow) {\n context.shadowColor = \"rgba(\" + rgb[0] * 255 + \",\" + rgb[1] * 255 + \",\" + rgb[2] * 255 + \",\" + style.dropShadowAlpha + \")\";\n context.shadowBlur = style.dropShadowBlur;\n context.shadowOffsetX = Math.cos(style.dropShadowAngle) * style.dropShadowDistance;\n context.shadowOffsetY = Math.sin(style.dropShadowAngle) * style.dropShadowDistance;\n }\n else {\n context.shadowColor = 'black';\n context.shadowBlur = 0;\n context.shadowOffsetX = 0;\n context.shadowOffsetY = 0;\n }\n if (style.stroke && style.strokeThickness) {\n context.strokeText(char, tx, ty + metrics.lineHeight - fontProperties.descent);\n }\n if (style.fill) {\n context.fillText(char, tx, ty + metrics.lineHeight - fontProperties.descent);\n }\n context.setTransform(1, 0, 0, 1, 0, 0); // defaults needed for older browsers (e.g. Opera 29)\n context.fillStyle = 'rgba(0, 0, 0, 0)';\n}\n\n/**\n * Processes the passed character set data and returns a flattened array of all the characters.\n *\n * Ignored because not directly exposed.\n *\n * @ignore\n * @param {string | string[] | string[][] } chars\n * @returns {string[]}\n */\nfunction resolveCharacters(chars) {\n // Split the chars string into individual characters\n if (typeof chars === 'string') {\n chars = [chars];\n }\n // Handle an array of characters+ranges\n var result = [];\n for (var i = 0, j = chars.length; i < j; i++) {\n var item = chars[i];\n // Handle range delimited by start/end chars\n if (Array.isArray(item)) {\n if (item.length !== 2) {\n throw new Error(\"[BitmapFont]: Invalid character range length, expecting 2 got \" + item.length + \".\");\n }\n var startCode = item[0].charCodeAt(0);\n var endCode = item[1].charCodeAt(0);\n if (endCode < startCode) {\n throw new Error('[BitmapFont]: Invalid character range.');\n }\n for (var i_1 = startCode, j_1 = endCode; i_1 <= j_1; i_1++) {\n result.push(String.fromCharCode(i_1));\n }\n }\n // Handle a character set string\n else {\n result.push.apply(result, item.split(''));\n }\n }\n if (result.length === 0) {\n throw new Error('[BitmapFont]: Empty set when resolving characters.');\n }\n return result;\n}\n\n/**\n * BitmapFont represents a typeface available for use with the BitmapText class. Use the `install`\n * method for adding a font to be used.\n *\n * @class\n * @memberof PIXI\n */\nvar BitmapFont = /** @class */ (function () {\n /**\n * @param {PIXI.BitmapFontData} data\n * @param {PIXI.Texture[]|Object.} textures\n */\n function BitmapFont(data, textures) {\n var info = data.info[0];\n var common = data.common[0];\n var page = data.page[0];\n var res = getResolutionOfUrl(page.file);\n var pageTextures = {};\n /**\n * The name of the font face.\n *\n * @member {string}\n * @readonly\n */\n this.font = info.face;\n /**\n * The size of the font face in pixels.\n *\n * @member {number}\n * @readonly\n */\n this.size = info.size;\n /**\n * The line-height of the font face in pixels.\n *\n * @member {number}\n * @readonly\n */\n this.lineHeight = common.lineHeight / res;\n /**\n * The map of characters by character code.\n *\n * @member {object}\n * @readonly\n */\n this.chars = {};\n /**\n * The map of base page textures (i.e., sheets of glyphs).\n *\n * @member {object}\n * @readonly\n * @private\n */\n this.pageTextures = pageTextures;\n // Convert the input Texture, Textures or object\n // into a page Texture lookup by \"id\"\n for (var i = 0; i < data.page.length; i++) {\n var _a = data.page[i], id = _a.id, file = _a.file;\n pageTextures[id] = textures instanceof Array\n ? textures[i] : textures[file];\n }\n // parse letters\n for (var i = 0; i < data.char.length; i++) {\n var _b = data.char[i], id = _b.id, page_1 = _b.page;\n var _c = data.char[i], x = _c.x, y = _c.y, width = _c.width, height = _c.height, xoffset = _c.xoffset, yoffset = _c.yoffset, xadvance = _c.xadvance;\n x /= res;\n y /= res;\n width /= res;\n height /= res;\n xoffset /= res;\n yoffset /= res;\n xadvance /= res;\n var rect = new Rectangle(x + (pageTextures[page_1].frame.x / res), y + (pageTextures[page_1].frame.y / res), width, height);\n this.chars[id] = {\n xOffset: xoffset,\n yOffset: yoffset,\n xAdvance: xadvance,\n kerning: {},\n texture: new Texture(pageTextures[page_1].baseTexture, rect),\n page: page_1,\n };\n }\n // parse kernings\n for (var i = 0; i < data.kerning.length; i++) {\n var _d = data.kerning[i], first = _d.first, second = _d.second, amount = _d.amount;\n first /= res;\n second /= res;\n amount /= res;\n if (this.chars[second]) {\n this.chars[second].kerning[first] = amount;\n }\n }\n }\n /**\n * Remove references to created glyph textures.\n */\n BitmapFont.prototype.destroy = function () {\n for (var id in this.chars) {\n this.chars[id].texture.destroy();\n this.chars[id].texture = null;\n }\n for (var id in this.pageTextures) {\n this.pageTextures[id].destroy(true);\n this.pageTextures[id] = null;\n }\n // Set readonly null.\n this.chars = null;\n this.pageTextures = null;\n };\n /**\n * Register a new bitmap font.\n *\n * @static\n * @param {XMLDocument|string|PIXI.BitmapFontData} data - The\n * characters map that could be provided as xml or raw string.\n * @param {Object.|PIXI.Texture|PIXI.Texture[]}\n * textures - List of textures for each page.\n * @return {PIXI.BitmapFont} Result font object with font, size, lineHeight\n * and char fields.\n */\n BitmapFont.install = function (data, textures) {\n var fontData;\n if (data instanceof BitmapFontData) {\n fontData = data;\n }\n else {\n var format = autoDetectFormat(data);\n if (!format) {\n throw new Error('Unrecognized data format for font.');\n }\n fontData = format.parse(data);\n }\n // Single texture, convert to list\n if (textures instanceof Texture) {\n textures = [textures];\n }\n var font = new BitmapFont(fontData, textures);\n BitmapFont.available[font.font] = font;\n return font;\n };\n /**\n * Remove bitmap font by name.\n *\n * @static\n * @param {string} name\n */\n BitmapFont.uninstall = function (name) {\n var font = BitmapFont.available[name];\n if (!font) {\n throw new Error(\"No font found named '\" + name + \"'\");\n }\n font.destroy();\n delete BitmapFont.available[name];\n };\n /**\n * Generates a bitmap-font for the given style and character set. This does not support\n * kernings yet. With `style` properties, only the following non-layout properties are used:\n *\n * - {@link PIXI.TextStyle#dropShadow|dropShadow}\n * - {@link PIXI.TextStyle#dropShadowDistance|dropShadowDistance}\n * - {@link PIXI.TextStyle#dropShadowColor|dropShadowColor}\n * - {@link PIXI.TextStyle#dropShadowBlur|dropShadowBlur}\n * - {@link PIXI.TextStyle#dropShadowAngle|dropShadowAngle}\n * - {@link PIXI.TextStyle#fill|fill}\n * - {@link PIXI.TextStyle#fillGradientStops|fillGradientStops}\n * - {@link PIXI.TextStyle#fillGradientType|fillGradientType}\n * - {@link PIXI.TextStyle#fontFamily|fontFamily}\n * - {@link PIXI.TextStyle#fontSize|fontSize}\n * - {@link PIXI.TextStyle#fontVariant|fontVariant}\n * - {@link PIXI.TextStyle#fontWeight|fontWeight}\n * - {@link PIXI.TextStyle#lineJoin|lineJoin}\n * - {@link PIXI.TextStyle#miterLimit|miterLimit}\n * - {@link PIXI.TextStyle#stroke|stroke}\n * - {@link PIXI.TextStyle#strokeThickness|strokeThickness}\n * - {@link PIXI.TextStyle#textBaseline|textBaseline}\n *\n * @param {string} name - The name of the custom font to use with BitmapText.\n * @param {object|PIXI.TextStyle} [style] - Style options to render with BitmapFont.\n * @param {PIXI.IBitmapFontOptions} [options] - Setup options for font or name of the font.\n * @param {string|string[]|string[][]} [options.chars=PIXI.BitmapFont.ALPHANUMERIC] - characters included\n * in the font set. You can also use ranges. For example, `[['a', 'z'], ['A', 'Z'], \"!@#$%^&*()~{}[] \"]`.\n * Don't forget to include spaces ' ' in your character set!\n * @param {number} [options.resolution=1] - Render resolution for glyphs.\n * @param {number} [options.textureWidth=512] - Optional width of atlas, smaller values to reduce memory.\n * @param {number} [options.textureHeight=512] - Optional height of atlas, smaller values to reduce memory.\n * @param {number} [options.padding=4] - Padding between glyphs on texture atlas.\n * @return {PIXI.BitmapFont} Font generated by style options.\n * @static\n * @example\n * PIXI.BitmapFont.from(\"TitleFont\", {\n * fontFamily: \"Arial\",\n * fontSize: 12,\n * strokeThickness: 2,\n * fill: \"purple\"\n * });\n *\n * const title = new PIXI.BitmapText(\"This is the title\", { fontName: \"TitleFont\" });\n */\n BitmapFont.from = function (name, textStyle, options) {\n if (!name) {\n throw new Error('[BitmapFont] Property `name` is required.');\n }\n var _a = Object.assign({}, BitmapFont.defaultOptions, options), chars = _a.chars, padding = _a.padding, resolution = _a.resolution, textureWidth = _a.textureWidth, textureHeight = _a.textureHeight;\n var charsList = resolveCharacters(chars);\n var style = textStyle instanceof TextStyle ? textStyle : new TextStyle(textStyle);\n var lineWidth = textureWidth;\n var fontData = new BitmapFontData();\n fontData.info[0] = {\n face: style.fontFamily,\n size: style.fontSize,\n };\n fontData.common[0] = {\n lineHeight: style.fontSize,\n };\n var positionX = 0;\n var positionY = 0;\n var canvas;\n var context;\n var baseTexture;\n var maxCharHeight = 0;\n var textures = [];\n for (var i = 0; i < charsList.length; i++) {\n if (!canvas) {\n canvas = document.createElement('canvas');\n canvas.width = textureWidth;\n canvas.height = textureHeight;\n context = canvas.getContext('2d');\n baseTexture = new BaseTexture(canvas, { resolution: resolution });\n textures.push(new Texture(baseTexture));\n fontData.page.push({\n id: textures.length - 1,\n file: '',\n });\n }\n // Measure glyph dimensions\n var metrics = TextMetrics.measureText(charsList[i], style, false, canvas);\n var width = metrics.width;\n var height = Math.ceil(metrics.height);\n // This is ugly - but italics are given more space so they don't overlap\n var textureGlyphWidth = Math.ceil((style.fontStyle === 'italic' ? 2 : 1) * width);\n // Can't fit char anymore: next canvas please!\n if (positionY >= textureHeight - (height * resolution)) {\n if (positionY === 0) {\n // We don't want user debugging an infinite loop (or do we? :)\n throw new Error(\"[BitmapFont] textureHeight \" + textureHeight + \"px is \"\n + (\"too small for \" + style.fontSize + \"px fonts\"));\n }\n --i;\n // Create new atlas once current has filled up\n canvas = null;\n context = null;\n baseTexture = null;\n positionY = 0;\n positionX = 0;\n maxCharHeight = 0;\n continue;\n }\n maxCharHeight = Math.max(height + metrics.fontProperties.descent, maxCharHeight);\n // Wrap line once full row has been rendered\n if ((textureGlyphWidth * resolution) + positionX >= lineWidth) {\n --i;\n positionY += maxCharHeight * resolution;\n positionY = Math.ceil(positionY);\n positionX = 0;\n maxCharHeight = 0;\n continue;\n }\n drawGlyph(canvas, context, metrics, positionX, positionY, resolution, style);\n // Unique (numeric) ID mapping to this glyph\n var id = metrics.text.charCodeAt(0);\n // Create a texture holding just the glyph\n fontData.char.push({\n id: id,\n page: textures.length - 1,\n x: positionX / resolution,\n y: positionY / resolution,\n width: textureGlyphWidth,\n height: height,\n xoffset: 0,\n yoffset: 0,\n xadvance: Math.ceil(width\n - (style.dropShadow ? style.dropShadowDistance : 0)\n - (style.stroke ? style.strokeThickness : 0)),\n });\n positionX += (textureGlyphWidth + (2 * padding)) * resolution;\n positionX = Math.ceil(positionX);\n }\n var font = new BitmapFont(fontData, textures);\n // Make it easier to replace a font\n if (BitmapFont.available[name] !== undefined) {\n BitmapFont.uninstall(name);\n }\n BitmapFont.available[name] = font;\n return font;\n };\n /**\n * This character set includes all the letters in the alphabet (both lower- and upper- case).\n * @readonly\n * @static\n * @member {string[][]}\n * @example\n * BitmapFont.from(\"ExampleFont\", style, { chars: BitmapFont.ALPHA })\n */\n BitmapFont.ALPHA = [['a', 'z'], ['A', 'Z'], ' '];\n /**\n * This character set includes all decimal digits (from 0 to 9).\n * @readonly\n * @static\n * @member {string[][]}\n * @example\n * BitmapFont.from(\"ExampleFont\", style, { chars: BitmapFont.NUMERIC })\n */\n BitmapFont.NUMERIC = [['0', '9']];\n /**\n * This character set is the union of `BitmapFont.ALPHA` and `BitmapFont.NUMERIC`.\n * @readonly\n * @static\n * @member {string[][]}\n */\n BitmapFont.ALPHANUMERIC = [['a', 'z'], ['A', 'Z'], ['0', '9'], ' '];\n /**\n * This character set consists of all the ASCII table.\n * @readonly\n * @static\n * @member {string[][]}\n * @see http://www.asciitable.com/\n */\n BitmapFont.ASCII = [[' ', '~']];\n /**\n * Collection of default options when using `BitmapFont.from`.\n *\n * @readonly\n * @static\n * @member {PIXI.IBitmapFontOptions}\n * @property {number} resolution=1\n * @property {number} textureWidth=512\n * @property {number} textureHeight=512\n * @property {number} padding=4\n * @property {string|string[]|string[][]} chars=PIXI.BitmapFont.ALPHANUMERIC\n */\n BitmapFont.defaultOptions = {\n resolution: 1,\n textureWidth: 512,\n textureHeight: 512,\n padding: 4,\n chars: BitmapFont.ALPHANUMERIC,\n };\n /**\n * Collection of available/installed fonts.\n *\n * @readonly\n * @static\n * @member {Object.}\n */\n BitmapFont.available = {};\n return BitmapFont;\n}());\n/**\n * @memberof PIXI\n * @interface IBitmapFontOptions\n * @property {string | string[] | string[][]} [chars=PIXI.BitmapFont.ALPHANUMERIC] - the character set to generate\n * @property {number} [resolution=1] - the resolution for rendering\n * @property {number} [padding=4] - the padding between glyphs in the atlas\n * @property {number} [textureWidth=512] - the width of the texture atlas\n * @property {number} [textureHeight=512] - the height of the texture atlas\n */\n\nvar pageMeshDataPool = [];\nvar charRenderDataPool = [];\n/**\n * A BitmapText object will create a line or multiple lines of text using bitmap font.\n *\n * The primary advantage of this class over Text is that all of your textures are pre-generated and loading,\n * meaning that rendering is fast, and changing text has no performance implications.\n *\n * Supporting character sets other than latin, such as CJK languages, may be impractical due to the number of characters.\n *\n * To split a line you can use '\\n', '\\r' or '\\r\\n' in your string.\n *\n * PixiJS can auto-generate fonts on-the-fly using BitmapFont or use fnt files provided by:\n * http://www.angelcode.com/products/bmfont/ for Windows or\n * http://www.bmglyph.com/ for Mac.\n *\n * A BitmapText can only be created when the font is loaded.\n *\n * ```js\n * // in this case the font is in a file called 'desyrel.fnt'\n * let bitmapText = new PIXI.BitmapText(\"text using a fancy font!\", {font: \"35px Desyrel\", align: \"right\"});\n * ```\n *\n * @class\n * @extends PIXI.Container\n * @memberof PIXI\n */\nvar BitmapText = /** @class */ (function (_super) {\n __extends(BitmapText, _super);\n /**\n * @param {string} text - A string that you would like the text to display.\n * @param {object} style - The style parameters.\n * @param {string} style.fontName - The installed BitmapFont name.\n * @param {number} [style.fontSize] - The size of the font in pixels, e.g. 24. If undefined,\n *. this will default to the BitmapFont size.\n * @param {string} [style.align='left'] - Alignment for multiline text ('left', 'center' or 'right'),\n * does not affect single line text.\n * @param {number} [style.tint=0xFFFFFF] - The tint color.\n * @param {number} [style.letterSpacing=0] - The amount of spacing between letters.\n * @param {number} [style.maxWidth=0] - The max width of the text before line wrapping.\n */\n function BitmapText(text, style) {\n if (style === void 0) { style = {}; }\n var _this = _super.call(this) || this;\n _this._tint = 0xFFFFFF;\n if (style.font) {\n deprecation('5.3.0', 'PIXI.BitmapText constructor style.font property is deprecated.');\n _this._upgradeStyle(style);\n }\n // Apply the defaults\n var _a = Object.assign({}, BitmapText.styleDefaults, style), align = _a.align, tint = _a.tint, maxWidth = _a.maxWidth, letterSpacing = _a.letterSpacing, fontName = _a.fontName, fontSize = _a.fontSize;\n if (!BitmapFont.available[fontName]) {\n throw new Error(\"Missing BitmapFont \\\"\" + fontName + \"\\\"\");\n }\n /**\n * Collection of page mesh data.\n *\n * @member {object}\n * @private\n */\n _this._activePagesMeshData = [];\n /**\n * Private tracker for the width of the overall text\n *\n * @member {number}\n * @private\n */\n _this._textWidth = 0;\n /**\n * Private tracker for the height of the overall text\n *\n * @member {number}\n * @private\n */\n _this._textHeight = 0;\n /**\n * Private tracker for the current text align.\n *\n * @member {string}\n * @private\n */\n _this._align = align;\n /**\n * Private tracker for the current tint.\n *\n * @member {number}\n * @private\n */\n _this._tint = tint;\n /**\n * Private tracker for the current font name.\n *\n * @member {string}\n * @private\n */\n _this._fontName = fontName;\n /**\n * Private tracker for the current font size.\n *\n * @member {number}\n * @private\n */\n _this._fontSize = fontSize || BitmapFont.available[fontName].size;\n /**\n * Private tracker for the current text.\n *\n * @member {string}\n * @private\n */\n _this._text = text;\n /**\n * The max width of this bitmap text in pixels. If the text provided is longer than the\n * value provided, line breaks will be automatically inserted in the last whitespace.\n * Disable by setting value to 0\n *\n * @member {number}\n * @private\n */\n _this._maxWidth = maxWidth;\n /**\n * The max line height. This is useful when trying to use the total height of the Text,\n * ie: when trying to vertically align. (Internally used)\n *\n * @member {number}\n * @private\n */\n _this._maxLineHeight = 0;\n /**\n * Letter spacing. This is useful for setting the space between characters.\n * @member {number}\n * @private\n */\n _this._letterSpacing = letterSpacing;\n /**\n * Text anchor. read-only\n *\n * @member {PIXI.ObservablePoint}\n * @private\n */\n _this._anchor = new ObservablePoint(function () { _this.dirty = true; }, _this, 0, 0);\n /**\n * If true PixiJS will Math.floor() x/y values when rendering\n *\n * @member {boolean}\n * @default PIXI.settings.ROUND_PIXELS\n */\n _this._roundPixels = settings.ROUND_PIXELS;\n /**\n * Set to `true` if the BitmapText needs to be redrawn.\n *\n * @member {boolean}\n */\n _this.dirty = true;\n /**\n * Cached char texture is destroyed when BitmapText is destroyed\n * @member {Record}\n * @private\n */\n _this._textureCache = {};\n return _this;\n }\n /**\n * Renders text and updates it when needed. This should only be called\n * if the BitmapFont is regenerated.\n */\n BitmapText.prototype.updateText = function () {\n var _a;\n var data = BitmapFont.available[this._fontName];\n var scale = this._fontSize / data.size;\n var pos = new Point();\n var chars = [];\n var lineWidths = [];\n var text = this._text.replace(/(?:\\r\\n|\\r)/g, '\\n') || ' ';\n var textLength = text.length;\n var maxWidth = this._maxWidth * data.size / this._fontSize;\n var prevCharCode = null;\n var lastLineWidth = 0;\n var maxLineWidth = 0;\n var line = 0;\n var lastBreakPos = -1;\n var lastBreakWidth = 0;\n var spacesRemoved = 0;\n var maxLineHeight = 0;\n for (var i = 0; i < textLength; i++) {\n var charCode = text.charCodeAt(i);\n var char = text.charAt(i);\n if ((/(?:\\s)/).test(char)) {\n lastBreakPos = i;\n lastBreakWidth = lastLineWidth;\n }\n if (char === '\\r' || char === '\\n') {\n lineWidths.push(lastLineWidth);\n maxLineWidth = Math.max(maxLineWidth, lastLineWidth);\n ++line;\n ++spacesRemoved;\n pos.x = 0;\n pos.y += data.lineHeight;\n prevCharCode = null;\n continue;\n }\n var charData = data.chars[charCode];\n if (!charData) {\n continue;\n }\n if (prevCharCode && charData.kerning[prevCharCode]) {\n pos.x += charData.kerning[prevCharCode];\n }\n var charRenderData = charRenderDataPool.pop() || {\n texture: Texture.EMPTY,\n line: 0,\n charCode: 0,\n position: new Point(),\n };\n charRenderData.texture = charData.texture;\n charRenderData.line = line;\n charRenderData.charCode = charCode;\n charRenderData.position.x = pos.x + charData.xOffset + (this._letterSpacing / 2);\n charRenderData.position.y = pos.y + charData.yOffset;\n chars.push(charRenderData);\n pos.x += charData.xAdvance + this._letterSpacing;\n lastLineWidth = pos.x;\n maxLineHeight = Math.max(maxLineHeight, (charData.yOffset + charData.texture.height));\n prevCharCode = charCode;\n if (lastBreakPos !== -1 && maxWidth > 0 && pos.x > maxWidth) {\n ++spacesRemoved;\n removeItems(chars, 1 + lastBreakPos - spacesRemoved, 1 + i - lastBreakPos);\n i = lastBreakPos;\n lastBreakPos = -1;\n lineWidths.push(lastBreakWidth);\n maxLineWidth = Math.max(maxLineWidth, lastBreakWidth);\n line++;\n pos.x = 0;\n pos.y += data.lineHeight;\n prevCharCode = null;\n }\n }\n var lastChar = text.charAt(text.length - 1);\n if (lastChar !== '\\r' && lastChar !== '\\n') {\n if ((/(?:\\s)/).test(lastChar)) {\n lastLineWidth = lastBreakWidth;\n }\n lineWidths.push(lastLineWidth);\n maxLineWidth = Math.max(maxLineWidth, lastLineWidth);\n }\n var lineAlignOffsets = [];\n for (var i = 0; i <= line; i++) {\n var alignOffset = 0;\n if (this._align === 'right') {\n alignOffset = maxLineWidth - lineWidths[i];\n }\n else if (this._align === 'center') {\n alignOffset = (maxLineWidth - lineWidths[i]) / 2;\n }\n lineAlignOffsets.push(alignOffset);\n }\n var lenChars = chars.length;\n var pagesMeshData = {};\n var newPagesMeshData = [];\n var activePagesMeshData = this._activePagesMeshData;\n for (var i = 0; i < activePagesMeshData.length; i++) {\n pageMeshDataPool.push(activePagesMeshData[i]);\n }\n for (var i = 0; i < lenChars; i++) {\n var texture = chars[i].texture;\n var baseTextureUid = texture.baseTexture.uid;\n if (!pagesMeshData[baseTextureUid]) {\n var pageMeshData = pageMeshDataPool.pop();\n if (!pageMeshData) {\n var geometry = new MeshGeometry();\n var material = new MeshMaterial(Texture.EMPTY);\n var mesh = new Mesh(geometry, material);\n pageMeshData = {\n index: 0,\n indexCount: 0,\n vertexCount: 0,\n uvsCount: 0,\n total: 0,\n mesh: mesh,\n vertices: null,\n uvs: null,\n indices: null,\n };\n }\n // reset data..\n pageMeshData.index = 0;\n pageMeshData.indexCount = 0;\n pageMeshData.vertexCount = 0;\n pageMeshData.uvsCount = 0;\n pageMeshData.total = 0;\n // TODO need to get page texture here somehow..\n var _textureCache = this._textureCache;\n _textureCache[baseTextureUid] = _textureCache[baseTextureUid] || new Texture(texture.baseTexture);\n pageMeshData.mesh.texture = _textureCache[baseTextureUid];\n pageMeshData.mesh.tint = this._tint;\n newPagesMeshData.push(pageMeshData);\n pagesMeshData[baseTextureUid] = pageMeshData;\n }\n pagesMeshData[baseTextureUid].total++;\n }\n // lets find any previously active pageMeshDatas that are no longer required for\n // the updated text (if any), removed and return them to the pool.\n for (var i = 0; i < activePagesMeshData.length; i++) {\n if (newPagesMeshData.indexOf(activePagesMeshData[i]) === -1) {\n this.removeChild(activePagesMeshData[i].mesh);\n }\n }\n // next lets add any new meshes, that have not yet been added to this BitmapText\n // we only add if its not already a child of this BitmapObject\n for (var i = 0; i < newPagesMeshData.length; i++) {\n if (newPagesMeshData[i].mesh.parent !== this) {\n this.addChild(newPagesMeshData[i].mesh);\n }\n }\n // active page mesh datas are set to be the new pages added.\n this._activePagesMeshData = newPagesMeshData;\n for (var i in pagesMeshData) {\n var pageMeshData = pagesMeshData[i];\n var total = pageMeshData.total;\n // lets only allocate new buffers if we can fit the new text in the current ones..\n // unless that is, we will be batching. Currently batching dose not respect the size property of mesh\n if (!(((_a = pageMeshData.indices) === null || _a === void 0 ? void 0 : _a.length) > 6 * total) || pageMeshData.vertices.length < Mesh.BATCHABLE_SIZE * 2) {\n pageMeshData.vertices = new Float32Array(4 * 2 * total);\n pageMeshData.uvs = new Float32Array(4 * 2 * total);\n pageMeshData.indices = new Uint16Array(6 * total);\n }\n else {\n var total_1 = pageMeshData.total;\n var vertices = pageMeshData.vertices;\n // Clear the garbage at the end of the vertices buffer. This will prevent the bounds miscalculation.\n for (var i_1 = total_1 * 4 * 2; i_1 < vertices.length; i_1++) {\n vertices[i_1] = 0;\n }\n }\n // as a buffer maybe bigger than the current word, we set the size of the meshMaterial\n // to match the number of letters needed\n pageMeshData.mesh.size = 6 * total;\n }\n for (var i = 0; i < lenChars; i++) {\n var char = chars[i];\n var offset = char.position.x + lineAlignOffsets[char.line];\n if (this._roundPixels) {\n offset = Math.round(offset);\n }\n var xPos = offset * scale;\n var yPos = char.position.y * scale;\n var texture = char.texture;\n var pageMesh = pagesMeshData[texture.baseTexture.uid];\n var textureFrame = texture.frame;\n var textureUvs = texture._uvs;\n var index = pageMesh.index++;\n pageMesh.indices[(index * 6) + 0] = 0 + (index * 4);\n pageMesh.indices[(index * 6) + 1] = 1 + (index * 4);\n pageMesh.indices[(index * 6) + 2] = 2 + (index * 4);\n pageMesh.indices[(index * 6) + 3] = 0 + (index * 4);\n pageMesh.indices[(index * 6) + 4] = 2 + (index * 4);\n pageMesh.indices[(index * 6) + 5] = 3 + (index * 4);\n pageMesh.vertices[(index * 8) + 0] = xPos;\n pageMesh.vertices[(index * 8) + 1] = yPos;\n pageMesh.vertices[(index * 8) + 2] = xPos + (textureFrame.width * scale);\n pageMesh.vertices[(index * 8) + 3] = yPos;\n pageMesh.vertices[(index * 8) + 4] = xPos + (textureFrame.width * scale);\n pageMesh.vertices[(index * 8) + 5] = yPos + (textureFrame.height * scale);\n pageMesh.vertices[(index * 8) + 6] = xPos;\n pageMesh.vertices[(index * 8) + 7] = yPos + (textureFrame.height * scale);\n pageMesh.uvs[(index * 8) + 0] = textureUvs.x0;\n pageMesh.uvs[(index * 8) + 1] = textureUvs.y0;\n pageMesh.uvs[(index * 8) + 2] = textureUvs.x1;\n pageMesh.uvs[(index * 8) + 3] = textureUvs.y1;\n pageMesh.uvs[(index * 8) + 4] = textureUvs.x2;\n pageMesh.uvs[(index * 8) + 5] = textureUvs.y2;\n pageMesh.uvs[(index * 8) + 6] = textureUvs.x3;\n pageMesh.uvs[(index * 8) + 7] = textureUvs.y3;\n }\n this._textWidth = maxLineWidth * scale;\n this._textHeight = (pos.y + data.lineHeight) * scale;\n for (var i in pagesMeshData) {\n var pageMeshData = pagesMeshData[i];\n // apply anchor\n if (this.anchor.x !== 0 || this.anchor.y !== 0) {\n var vertexCount = 0;\n var anchorOffsetX = this._textWidth * this.anchor.x;\n var anchorOffsetY = this._textHeight * this.anchor.y;\n for (var i_2 = 0; i_2 < pageMeshData.total; i_2++) {\n pageMeshData.vertices[vertexCount++] -= anchorOffsetX;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetY;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetX;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetY;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetX;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetY;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetX;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetY;\n }\n }\n this._maxLineHeight = maxLineHeight * scale;\n var vertexBuffer = pageMeshData.mesh.geometry.getBuffer('aVertexPosition');\n var textureBuffer = pageMeshData.mesh.geometry.getBuffer('aTextureCoord');\n var indexBuffer = pageMeshData.mesh.geometry.getIndex();\n vertexBuffer.data = pageMeshData.vertices;\n textureBuffer.data = pageMeshData.uvs;\n indexBuffer.data = pageMeshData.indices;\n vertexBuffer.update();\n textureBuffer.update();\n indexBuffer.update();\n }\n for (var i = 0; i < chars.length; i++) {\n charRenderDataPool.push(chars[i]);\n }\n };\n /**\n * Updates the transform of this object\n *\n * @private\n */\n BitmapText.prototype.updateTransform = function () {\n this.validate();\n this.containerUpdateTransform();\n };\n /**\n * Validates text before calling parent's getLocalBounds\n *\n * @return {PIXI.Rectangle} The rectangular bounding area\n */\n BitmapText.prototype.getLocalBounds = function () {\n this.validate();\n return _super.prototype.getLocalBounds.call(this);\n };\n /**\n * Updates text when needed\n *\n * @private\n */\n BitmapText.prototype.validate = function () {\n if (this.dirty) {\n this.updateText();\n this.dirty = false;\n }\n };\n Object.defineProperty(BitmapText.prototype, \"tint\", {\n /**\n * The tint of the BitmapText object.\n *\n * @member {number}\n * @default 0xffffff\n */\n get: function () {\n return this._tint;\n },\n set: function (value) {\n if (this._tint === value)\n { return; }\n this._tint = value;\n for (var i = 0; i < this._activePagesMeshData.length; i++) {\n this._activePagesMeshData[i].mesh.tint = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"align\", {\n /**\n * The alignment of the BitmapText object.\n *\n * @member {string}\n * @default 'left'\n */\n get: function () {\n return this._align;\n },\n set: function (value) {\n if (this._align !== value) {\n this._align = value;\n this.dirty = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"fontName\", {\n /**\n * The name of the BitmapFont.\n *\n * @member {string}\n */\n get: function () {\n return this._fontName;\n },\n set: function (value) {\n if (!BitmapFont.available[value]) {\n throw new Error(\"Missing BitmapFont \\\"\" + value + \"\\\"\");\n }\n if (this._fontName !== value) {\n this._fontName = value;\n this.dirty = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"fontSize\", {\n /**\n * The size of the font to display.\n *\n * @member {number}\n */\n get: function () {\n return this._fontSize;\n },\n set: function (value) {\n if (this._fontSize !== value) {\n this._fontSize = value;\n this.dirty = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"anchor\", {\n /**\n * The anchor sets the origin point of the text.\n *\n * The default is `(0,0)`, this means the text's origin is the top left.\n *\n * Setting the anchor to `(0.5,0.5)` means the text's origin is centered.\n *\n * Setting the anchor to `(1,1)` would mean the text's origin point will be the bottom right corner.\n *\n * @member {PIXI.Point | number}\n */\n get: function () {\n return this._anchor;\n },\n set: function (value) {\n if (typeof value === 'number') {\n this._anchor.set(value);\n }\n else {\n this._anchor.copyFrom(value);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"text\", {\n /**\n * The text of the BitmapText object.\n *\n * @member {string}\n */\n get: function () {\n return this._text;\n },\n set: function (text) {\n text = String(text === null || text === undefined ? '' : text);\n if (this._text === text) {\n return;\n }\n this._text = text;\n this.dirty = true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"maxWidth\", {\n /**\n * The max width of this bitmap text in pixels. If the text provided is longer than the\n * value provided, line breaks will be automatically inserted in the last whitespace.\n * Disable by setting the value to 0.\n *\n * @member {number}\n */\n get: function () {\n return this._maxWidth;\n },\n set: function (value) {\n if (this._maxWidth === value) {\n return;\n }\n this._maxWidth = value;\n this.dirty = true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"maxLineHeight\", {\n /**\n * The max line height. This is useful when trying to use the total height of the Text,\n * i.e. when trying to vertically align.\n *\n * @member {number}\n * @readonly\n */\n get: function () {\n this.validate();\n return this._maxLineHeight;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"textWidth\", {\n /**\n * The width of the overall text, different from fontSize,\n * which is defined in the style object.\n *\n * @member {number}\n * @readonly\n */\n get: function () {\n this.validate();\n return this._textWidth;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"letterSpacing\", {\n /**\n * Additional space between characters.\n *\n * @member {number}\n */\n get: function () {\n return this._letterSpacing;\n },\n set: function (value) {\n if (this._letterSpacing !== value) {\n this._letterSpacing = value;\n this.dirty = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"roundPixels\", {\n /**\n * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.\n * Advantages can include sharper image quality (like text) and faster rendering on canvas.\n * The main disadvantage is movement of objects may appear less smooth.\n * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}\n *\n * @member {boolean}\n * @default PIXI.settings.ROUND_PIXELS\n */\n get: function () {\n return this._roundPixels;\n },\n set: function (value) {\n if (value !== this._roundPixels) {\n this._roundPixels = value;\n this.dirty = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"textHeight\", {\n /**\n * The height of the overall text, different from fontSize,\n * which is defined in the style object.\n *\n * @member {number}\n * @readonly\n */\n get: function () {\n this.validate();\n return this._textHeight;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * For backward compatibility, convert old style.font constructor param to fontName & fontSize properties.\n *\n * @private\n * @deprecated since 5.3.0\n */\n BitmapText.prototype._upgradeStyle = function (style) {\n if (typeof style.font === 'string') {\n var valueSplit = style.font.split(' ');\n style.fontName = valueSplit.length === 1\n ? valueSplit[0]\n : valueSplit.slice(1).join(' ');\n if (valueSplit.length >= 2) {\n style.fontSize = parseInt(valueSplit[0], 10);\n }\n }\n else {\n style.fontName = style.font.name;\n style.fontSize = typeof style.font.size === 'number'\n ? style.font.size\n : parseInt(style.font.size, 10);\n }\n };\n BitmapText.prototype.destroy = function (options) {\n var _textureCache = this._textureCache;\n for (var id in _textureCache) {\n var texture = _textureCache[id];\n texture.destroy();\n delete _textureCache[id];\n }\n this._textureCache = null;\n _super.prototype.destroy.call(this, options);\n };\n /**\n * Register a bitmap font with data and a texture.\n *\n * @deprecated since 5.3.0\n * @see PIXI.BitmapFont.install\n * @static\n */\n BitmapText.registerFont = function (data, textures) {\n deprecation('5.3.0', 'PIXI.BitmapText.registerFont is deprecated, use PIXI.BitmapFont.install');\n return BitmapFont.install(data, textures);\n };\n Object.defineProperty(BitmapText, \"fonts\", {\n /**\n * Get the list of installed fonts.\n *\n * @see PIXI.BitmapFont.available\n * @deprecated since 5.3.0\n * @static\n * @readonly\n * @member {Object.}\n */\n get: function () {\n deprecation('5.3.0', 'PIXI.BitmapText.fonts is deprecated, use PIXI.BitmapFont.available');\n return BitmapFont.available;\n },\n enumerable: false,\n configurable: true\n });\n BitmapText.styleDefaults = {\n align: 'left',\n tint: 0xFFFFFF,\n maxWidth: 0,\n letterSpacing: 0,\n };\n return BitmapText;\n}(Container));\n\n/**\n * {@link PIXI.Loader Loader} middleware for loading\n * bitmap-based fonts suitable for using with {@link PIXI.BitmapText}.\n * @class\n * @memberof PIXI\n * @implements PIXI.ILoaderPlugin\n */\nvar BitmapFontLoader = /** @class */ (function () {\n function BitmapFontLoader() {\n }\n /**\n * Called when the plugin is installed.\n *\n * @see PIXI.Loader.registerPlugin\n */\n BitmapFontLoader.add = function () {\n LoaderResource.setExtensionXhrType('fnt', LoaderResource.XHR_RESPONSE_TYPE.TEXT);\n };\n /**\n * Called after a resource is loaded.\n * @see PIXI.Loader.loaderMiddleware\n * @param {PIXI.LoaderResource} resource\n * @param {function} next\n */\n BitmapFontLoader.use = function (resource, next) {\n var format = autoDetectFormat(resource.data);\n // Resource was not recognised as any of the expected font data format\n if (!format) {\n next();\n return;\n }\n var baseUrl = BitmapFontLoader.getBaseUrl(this, resource);\n var data = format.parse(resource.data);\n var textures = {};\n // Handle completed, when the number of textures\n // load is the same number as references in the fnt file\n var completed = function (page) {\n textures[page.metadata.pageFile] = page.texture;\n if (Object.keys(textures).length === data.page.length) {\n resource.bitmapFont = BitmapFont.install(data, textures);\n next();\n }\n };\n for (var i = 0; i < data.page.length; ++i) {\n var pageFile = data.page[i].file;\n var url = baseUrl + pageFile;\n var exists = false;\n // incase the image is loaded outside\n // using the same loader, resource will be available\n for (var name in this.resources) {\n var bitmapResource = this.resources[name];\n if (bitmapResource.url === url) {\n bitmapResource.metadata.pageFile = pageFile;\n if (bitmapResource.texture) {\n completed(bitmapResource);\n }\n else {\n bitmapResource.onAfterMiddleware.add(completed);\n }\n exists = true;\n break;\n }\n }\n // texture is not loaded, we'll attempt to add\n // it to the load and add the texture to the list\n if (!exists) {\n // Standard loading options for images\n var options = {\n crossOrigin: resource.crossOrigin,\n loadType: LoaderResource.LOAD_TYPE.IMAGE,\n metadata: Object.assign({ pageFile: pageFile }, resource.metadata.imageMetadata),\n parentResource: resource,\n };\n this.add(url, options, completed);\n }\n }\n };\n /**\n * Get folder path from a resource\n * @private\n * @param {PIXI.Loader} loader\n * @param {PIXI.LoaderResource} resource\n * @return {string}\n */\n BitmapFontLoader.getBaseUrl = function (loader, resource) {\n var resUrl = !resource.isDataUrl ? BitmapFontLoader.dirname(resource.url) : '';\n if (resource.isDataUrl) {\n if (resUrl === '.') {\n resUrl = '';\n }\n if (loader.baseUrl && resUrl) {\n // if baseurl has a trailing slash then add one to resUrl so the replace works below\n if (loader.baseUrl.charAt(loader.baseUrl.length - 1) === '/') {\n resUrl += '/';\n }\n }\n }\n // remove baseUrl from resUrl\n resUrl = resUrl.replace(loader.baseUrl, '');\n // if there is an resUrl now, it needs a trailing slash. Ensure that it does if the string isn't empty.\n if (resUrl && resUrl.charAt(resUrl.length - 1) !== '/') {\n resUrl += '/';\n }\n return resUrl;\n };\n /**\n * Replacement for NodeJS's path.dirname\n * @private\n * @param {string} url - Path to get directory for\n */\n BitmapFontLoader.dirname = function (url) {\n var dir = url\n .replace(/\\\\/g, '/') // convert windows notation to UNIX notation, URL-safe because it's a forbidden character\n .replace(/\\/$/, '') // replace trailing slash\n .replace(/\\/[^\\/]*$/, ''); // remove everything after the last\n // File request is relative, use current directory\n if (dir === url) {\n return '.';\n }\n // Started with a slash\n else if (dir === '') {\n return '/';\n }\n return dir;\n };\n return BitmapFontLoader;\n}());\n\nexport { BitmapFont, BitmapFontData, BitmapFontLoader, BitmapText };\n//# sourceMappingURL=text-bitmap.es.js.map\n","/*!\n * @pixi/filter-alpha - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/filter-alpha is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { defaultVertex, Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar fragment = \"varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform float uAlpha;\\n\\nvoid main(void)\\n{\\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\\n}\\n\";\n\n/**\n * Simplest filter - applies alpha.\n *\n * Use this instead of Container's alpha property to avoid visual layering of individual elements.\n * AlphaFilter applies alpha evenly across the entire display object and any opaque elements it contains.\n * If elements are not opaque, they will blend with each other anyway.\n *\n * Very handy if you want to use common features of all filters:\n *\n * 1. Assign a blendMode to this filter, blend all elements inside display object with background.\n *\n * 2. To use clipping in display coordinates, assign a filterArea to the same container that has this filter.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar AlphaFilter = /** @class */ (function (_super) {\n __extends(AlphaFilter, _super);\n /**\n * @param {number} [alpha=1] - Amount of alpha from 0 to 1, where 0 is transparent\n */\n function AlphaFilter(alpha) {\n if (alpha === void 0) { alpha = 1.0; }\n var _this = _super.call(this, defaultVertex, fragment, { uAlpha: 1 }) || this;\n _this.alpha = alpha;\n return _this;\n }\n Object.defineProperty(AlphaFilter.prototype, \"alpha\", {\n /**\n * Coefficient for alpha multiplication\n *\n * @member {number}\n * @default 1\n */\n get: function () {\n return this.uniforms.uAlpha;\n },\n set: function (value) {\n this.uniforms.uAlpha = value;\n },\n enumerable: false,\n configurable: true\n });\n return AlphaFilter;\n}(Filter));\n\nexport { AlphaFilter };\n//# sourceMappingURL=filter-alpha.es.js.map\n","/*!\n * @pixi/filter-blur - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/filter-blur is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { settings } from '@pixi/settings';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertTemplate = \"\\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 }\";\nfunction generateBlurVertSource(kernelSize, x) {\n var halfLength = Math.ceil(kernelSize / 2);\n var vertSource = vertTemplate;\n var blurLoop = '';\n var template;\n if (x) {\n template = 'vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);';\n }\n else {\n template = 'vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);';\n }\n for (var i = 0; i < kernelSize; i++) {\n var blur = template.replace('%index%', i.toString());\n blur = blur.replace('%sampleIndex%', i - (halfLength - 1) + \".0\");\n blurLoop += blur;\n blurLoop += '\\n';\n }\n vertSource = vertSource.replace('%blur%', blurLoop);\n vertSource = vertSource.replace('%size%', kernelSize.toString());\n return vertSource;\n}\n\nvar GAUSSIAN_VALUES = {\n 5: [0.153388, 0.221461, 0.250301],\n 7: [0.071303, 0.131514, 0.189879, 0.214607],\n 9: [0.028532, 0.067234, 0.124009, 0.179044, 0.20236],\n 11: [0.0093, 0.028002, 0.065984, 0.121703, 0.175713, 0.198596],\n 13: [0.002406, 0.009255, 0.027867, 0.065666, 0.121117, 0.174868, 0.197641],\n 15: [0.000489, 0.002403, 0.009246, 0.02784, 0.065602, 0.120999, 0.174697, 0.197448],\n};\nvar fragTemplate = [\n 'varying vec2 vBlurTexCoords[%size%];',\n 'uniform sampler2D uSampler;',\n 'void main(void)',\n '{',\n ' gl_FragColor = vec4(0.0);',\n ' %blur%',\n '}' ].join('\\n');\nfunction generateBlurFragSource(kernelSize) {\n var kernel = GAUSSIAN_VALUES[kernelSize];\n var halfLength = kernel.length;\n var fragSource = fragTemplate;\n var blurLoop = '';\n var template = 'gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;';\n var value;\n for (var i = 0; i < kernelSize; i++) {\n var blur = template.replace('%index%', i.toString());\n value = i;\n if (i >= halfLength) {\n value = kernelSize - i - 1;\n }\n blur = blur.replace('%value%', kernel[value].toString());\n blurLoop += blur;\n blurLoop += '\\n';\n }\n fragSource = fragSource.replace('%blur%', blurLoop);\n fragSource = fragSource.replace('%size%', kernelSize.toString());\n return fragSource;\n}\n\n/**\n * Different types of environments for WebGL.\n *\n * @static\n * @memberof PIXI\n * @name ENV\n * @enum {number}\n * @property {number} WEBGL_LEGACY - Used for older v1 WebGL devices. PixiJS will aim to ensure compatibility\n * with older / less advanced devices. If you experience unexplained flickering prefer this environment.\n * @property {number} WEBGL - Version 1 of WebGL\n * @property {number} WEBGL2 - Version 2 of WebGL\n */\nvar ENV;\n(function (ENV) {\n ENV[ENV[\"WEBGL_LEGACY\"] = 0] = \"WEBGL_LEGACY\";\n ENV[ENV[\"WEBGL\"] = 1] = \"WEBGL\";\n ENV[ENV[\"WEBGL2\"] = 2] = \"WEBGL2\";\n})(ENV || (ENV = {}));\n/**\n * Constant to identify the Renderer Type.\n *\n * @static\n * @memberof PIXI\n * @name RENDERER_TYPE\n * @enum {number}\n * @property {number} UNKNOWN - Unknown render type.\n * @property {number} WEBGL - WebGL render type.\n * @property {number} CANVAS - Canvas render type.\n */\nvar RENDERER_TYPE;\n(function (RENDERER_TYPE) {\n RENDERER_TYPE[RENDERER_TYPE[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\n RENDERER_TYPE[RENDERER_TYPE[\"WEBGL\"] = 1] = \"WEBGL\";\n RENDERER_TYPE[RENDERER_TYPE[\"CANVAS\"] = 2] = \"CANVAS\";\n})(RENDERER_TYPE || (RENDERER_TYPE = {}));\n/**\n * Bitwise OR of masks that indicate the buffers to be cleared.\n *\n * @static\n * @memberof PIXI\n * @name BUFFER_BITS\n * @enum {number}\n * @property {number} COLOR - Indicates the buffers currently enabled for color writing.\n * @property {number} DEPTH - Indicates the depth buffer.\n * @property {number} STENCIL - Indicates the stencil buffer.\n */\nvar BUFFER_BITS;\n(function (BUFFER_BITS) {\n BUFFER_BITS[BUFFER_BITS[\"COLOR\"] = 16384] = \"COLOR\";\n BUFFER_BITS[BUFFER_BITS[\"DEPTH\"] = 256] = \"DEPTH\";\n BUFFER_BITS[BUFFER_BITS[\"STENCIL\"] = 1024] = \"STENCIL\";\n})(BUFFER_BITS || (BUFFER_BITS = {}));\n/**\n * Various blend modes supported by PIXI.\n *\n * IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes.\n * Anything else will silently act like NORMAL.\n *\n * @memberof PIXI\n * @name BLEND_MODES\n * @enum {number}\n * @property {number} NORMAL\n * @property {number} ADD\n * @property {number} MULTIPLY\n * @property {number} SCREEN\n * @property {number} OVERLAY\n * @property {number} DARKEN\n * @property {number} LIGHTEN\n * @property {number} COLOR_DODGE\n * @property {number} COLOR_BURN\n * @property {number} HARD_LIGHT\n * @property {number} SOFT_LIGHT\n * @property {number} DIFFERENCE\n * @property {number} EXCLUSION\n * @property {number} HUE\n * @property {number} SATURATION\n * @property {number} COLOR\n * @property {number} LUMINOSITY\n * @property {number} NORMAL_NPM\n * @property {number} ADD_NPM\n * @property {number} SCREEN_NPM\n * @property {number} NONE\n * @property {number} SRC_IN\n * @property {number} SRC_OUT\n * @property {number} SRC_ATOP\n * @property {number} DST_OVER\n * @property {number} DST_IN\n * @property {number} DST_OUT\n * @property {number} DST_ATOP\n * @property {number} SUBTRACT\n * @property {number} SRC_OVER\n * @property {number} ERASE\n * @property {number} XOR\n */\nvar BLEND_MODES;\n(function (BLEND_MODES) {\n BLEND_MODES[BLEND_MODES[\"NORMAL\"] = 0] = \"NORMAL\";\n BLEND_MODES[BLEND_MODES[\"ADD\"] = 1] = \"ADD\";\n BLEND_MODES[BLEND_MODES[\"MULTIPLY\"] = 2] = \"MULTIPLY\";\n BLEND_MODES[BLEND_MODES[\"SCREEN\"] = 3] = \"SCREEN\";\n BLEND_MODES[BLEND_MODES[\"OVERLAY\"] = 4] = \"OVERLAY\";\n BLEND_MODES[BLEND_MODES[\"DARKEN\"] = 5] = \"DARKEN\";\n BLEND_MODES[BLEND_MODES[\"LIGHTEN\"] = 6] = \"LIGHTEN\";\n BLEND_MODES[BLEND_MODES[\"COLOR_DODGE\"] = 7] = \"COLOR_DODGE\";\n BLEND_MODES[BLEND_MODES[\"COLOR_BURN\"] = 8] = \"COLOR_BURN\";\n BLEND_MODES[BLEND_MODES[\"HARD_LIGHT\"] = 9] = \"HARD_LIGHT\";\n BLEND_MODES[BLEND_MODES[\"SOFT_LIGHT\"] = 10] = \"SOFT_LIGHT\";\n BLEND_MODES[BLEND_MODES[\"DIFFERENCE\"] = 11] = \"DIFFERENCE\";\n BLEND_MODES[BLEND_MODES[\"EXCLUSION\"] = 12] = \"EXCLUSION\";\n BLEND_MODES[BLEND_MODES[\"HUE\"] = 13] = \"HUE\";\n BLEND_MODES[BLEND_MODES[\"SATURATION\"] = 14] = \"SATURATION\";\n BLEND_MODES[BLEND_MODES[\"COLOR\"] = 15] = \"COLOR\";\n BLEND_MODES[BLEND_MODES[\"LUMINOSITY\"] = 16] = \"LUMINOSITY\";\n BLEND_MODES[BLEND_MODES[\"NORMAL_NPM\"] = 17] = \"NORMAL_NPM\";\n BLEND_MODES[BLEND_MODES[\"ADD_NPM\"] = 18] = \"ADD_NPM\";\n BLEND_MODES[BLEND_MODES[\"SCREEN_NPM\"] = 19] = \"SCREEN_NPM\";\n BLEND_MODES[BLEND_MODES[\"NONE\"] = 20] = \"NONE\";\n BLEND_MODES[BLEND_MODES[\"SRC_OVER\"] = 0] = \"SRC_OVER\";\n BLEND_MODES[BLEND_MODES[\"SRC_IN\"] = 21] = \"SRC_IN\";\n BLEND_MODES[BLEND_MODES[\"SRC_OUT\"] = 22] = \"SRC_OUT\";\n BLEND_MODES[BLEND_MODES[\"SRC_ATOP\"] = 23] = \"SRC_ATOP\";\n BLEND_MODES[BLEND_MODES[\"DST_OVER\"] = 24] = \"DST_OVER\";\n BLEND_MODES[BLEND_MODES[\"DST_IN\"] = 25] = \"DST_IN\";\n BLEND_MODES[BLEND_MODES[\"DST_OUT\"] = 26] = \"DST_OUT\";\n BLEND_MODES[BLEND_MODES[\"DST_ATOP\"] = 27] = \"DST_ATOP\";\n BLEND_MODES[BLEND_MODES[\"ERASE\"] = 26] = \"ERASE\";\n BLEND_MODES[BLEND_MODES[\"SUBTRACT\"] = 28] = \"SUBTRACT\";\n BLEND_MODES[BLEND_MODES[\"XOR\"] = 29] = \"XOR\";\n})(BLEND_MODES || (BLEND_MODES = {}));\n/**\n * Various webgl draw modes. These can be used to specify which GL drawMode to use\n * under certain situations and renderers.\n *\n * @memberof PIXI\n * @static\n * @name DRAW_MODES\n * @enum {number}\n * @property {number} POINTS\n * @property {number} LINES\n * @property {number} LINE_LOOP\n * @property {number} LINE_STRIP\n * @property {number} TRIANGLES\n * @property {number} TRIANGLE_STRIP\n * @property {number} TRIANGLE_FAN\n */\nvar DRAW_MODES;\n(function (DRAW_MODES) {\n DRAW_MODES[DRAW_MODES[\"POINTS\"] = 0] = \"POINTS\";\n DRAW_MODES[DRAW_MODES[\"LINES\"] = 1] = \"LINES\";\n DRAW_MODES[DRAW_MODES[\"LINE_LOOP\"] = 2] = \"LINE_LOOP\";\n DRAW_MODES[DRAW_MODES[\"LINE_STRIP\"] = 3] = \"LINE_STRIP\";\n DRAW_MODES[DRAW_MODES[\"TRIANGLES\"] = 4] = \"TRIANGLES\";\n DRAW_MODES[DRAW_MODES[\"TRIANGLE_STRIP\"] = 5] = \"TRIANGLE_STRIP\";\n DRAW_MODES[DRAW_MODES[\"TRIANGLE_FAN\"] = 6] = \"TRIANGLE_FAN\";\n})(DRAW_MODES || (DRAW_MODES = {}));\n/**\n * Various GL texture/resources formats.\n *\n * @memberof PIXI\n * @static\n * @name FORMATS\n * @enum {number}\n * @property {number} RGBA=6408\n * @property {number} RGB=6407\n * @property {number} ALPHA=6406\n * @property {number} LUMINANCE=6409\n * @property {number} LUMINANCE_ALPHA=6410\n * @property {number} DEPTH_COMPONENT=6402\n * @property {number} DEPTH_STENCIL=34041\n */\nvar FORMATS;\n(function (FORMATS) {\n FORMATS[FORMATS[\"RGBA\"] = 6408] = \"RGBA\";\n FORMATS[FORMATS[\"RGB\"] = 6407] = \"RGB\";\n FORMATS[FORMATS[\"ALPHA\"] = 6406] = \"ALPHA\";\n FORMATS[FORMATS[\"LUMINANCE\"] = 6409] = \"LUMINANCE\";\n FORMATS[FORMATS[\"LUMINANCE_ALPHA\"] = 6410] = \"LUMINANCE_ALPHA\";\n FORMATS[FORMATS[\"DEPTH_COMPONENT\"] = 6402] = \"DEPTH_COMPONENT\";\n FORMATS[FORMATS[\"DEPTH_STENCIL\"] = 34041] = \"DEPTH_STENCIL\";\n})(FORMATS || (FORMATS = {}));\n/**\n * Various GL target types.\n *\n * @memberof PIXI\n * @static\n * @name TARGETS\n * @enum {number}\n * @property {number} TEXTURE_2D=3553\n * @property {number} TEXTURE_CUBE_MAP=34067\n * @property {number} TEXTURE_2D_ARRAY=35866\n * @property {number} TEXTURE_CUBE_MAP_POSITIVE_X=34069\n * @property {number} TEXTURE_CUBE_MAP_NEGATIVE_X=34070\n * @property {number} TEXTURE_CUBE_MAP_POSITIVE_Y=34071\n * @property {number} TEXTURE_CUBE_MAP_NEGATIVE_Y=34072\n * @property {number} TEXTURE_CUBE_MAP_POSITIVE_Z=34073\n * @property {number} TEXTURE_CUBE_MAP_NEGATIVE_Z=34074\n */\nvar TARGETS;\n(function (TARGETS) {\n TARGETS[TARGETS[\"TEXTURE_2D\"] = 3553] = \"TEXTURE_2D\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP\"] = 34067] = \"TEXTURE_CUBE_MAP\";\n TARGETS[TARGETS[\"TEXTURE_2D_ARRAY\"] = 35866] = \"TEXTURE_2D_ARRAY\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_POSITIVE_X\"] = 34069] = \"TEXTURE_CUBE_MAP_POSITIVE_X\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_NEGATIVE_X\"] = 34070] = \"TEXTURE_CUBE_MAP_NEGATIVE_X\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_POSITIVE_Y\"] = 34071] = \"TEXTURE_CUBE_MAP_POSITIVE_Y\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_NEGATIVE_Y\"] = 34072] = \"TEXTURE_CUBE_MAP_NEGATIVE_Y\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_POSITIVE_Z\"] = 34073] = \"TEXTURE_CUBE_MAP_POSITIVE_Z\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_NEGATIVE_Z\"] = 34074] = \"TEXTURE_CUBE_MAP_NEGATIVE_Z\";\n})(TARGETS || (TARGETS = {}));\n/**\n * Various GL data format types.\n *\n * @memberof PIXI\n * @static\n * @name TYPES\n * @enum {number}\n * @property {number} UNSIGNED_BYTE=5121\n * @property {number} UNSIGNED_SHORT=5123\n * @property {number} UNSIGNED_SHORT_5_6_5=33635\n * @property {number} UNSIGNED_SHORT_4_4_4_4=32819\n * @property {number} UNSIGNED_SHORT_5_5_5_1=32820\n * @property {number} FLOAT=5126\n * @property {number} HALF_FLOAT=36193\n */\nvar TYPES;\n(function (TYPES) {\n TYPES[TYPES[\"UNSIGNED_BYTE\"] = 5121] = \"UNSIGNED_BYTE\";\n TYPES[TYPES[\"UNSIGNED_SHORT\"] = 5123] = \"UNSIGNED_SHORT\";\n TYPES[TYPES[\"UNSIGNED_SHORT_5_6_5\"] = 33635] = \"UNSIGNED_SHORT_5_6_5\";\n TYPES[TYPES[\"UNSIGNED_SHORT_4_4_4_4\"] = 32819] = \"UNSIGNED_SHORT_4_4_4_4\";\n TYPES[TYPES[\"UNSIGNED_SHORT_5_5_5_1\"] = 32820] = \"UNSIGNED_SHORT_5_5_5_1\";\n TYPES[TYPES[\"FLOAT\"] = 5126] = \"FLOAT\";\n TYPES[TYPES[\"HALF_FLOAT\"] = 36193] = \"HALF_FLOAT\";\n})(TYPES || (TYPES = {}));\n/**\n * The scale modes that are supported by pixi.\n *\n * The {@link PIXI.settings.SCALE_MODE} scale mode affects the default scaling mode of future operations.\n * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability.\n *\n * @memberof PIXI\n * @static\n * @name SCALE_MODES\n * @enum {number}\n * @property {number} LINEAR Smooth scaling\n * @property {number} NEAREST Pixelating scaling\n */\nvar SCALE_MODES;\n(function (SCALE_MODES) {\n SCALE_MODES[SCALE_MODES[\"NEAREST\"] = 0] = \"NEAREST\";\n SCALE_MODES[SCALE_MODES[\"LINEAR\"] = 1] = \"LINEAR\";\n})(SCALE_MODES || (SCALE_MODES = {}));\n/**\n * The wrap modes that are supported by pixi.\n *\n * The {@link PIXI.settings.WRAP_MODE} wrap mode affects the default wrapping mode of future operations.\n * It can be re-assigned to either CLAMP or REPEAT, depending upon suitability.\n * If the texture is non power of two then clamp will be used regardless as WebGL can\n * only use REPEAT if the texture is po2.\n *\n * This property only affects WebGL.\n *\n * @name WRAP_MODES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} CLAMP - The textures uvs are clamped\n * @property {number} REPEAT - The texture uvs tile and repeat\n * @property {number} MIRRORED_REPEAT - The texture uvs tile and repeat with mirroring\n */\nvar WRAP_MODES;\n(function (WRAP_MODES) {\n WRAP_MODES[WRAP_MODES[\"CLAMP\"] = 33071] = \"CLAMP\";\n WRAP_MODES[WRAP_MODES[\"REPEAT\"] = 10497] = \"REPEAT\";\n WRAP_MODES[WRAP_MODES[\"MIRRORED_REPEAT\"] = 33648] = \"MIRRORED_REPEAT\";\n})(WRAP_MODES || (WRAP_MODES = {}));\n/**\n * Mipmap filtering modes that are supported by pixi.\n *\n * The {@link PIXI.settings.MIPMAP_TEXTURES} affects default texture filtering.\n * Mipmaps are generated for a baseTexture if its `mipmap` field is `ON`,\n * or its `POW2` and texture dimensions are powers of 2.\n * Due to platform restriction, `ON` option will work like `POW2` for webgl-1.\n *\n * This property only affects WebGL.\n *\n * @name MIPMAP_MODES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} OFF - No mipmaps\n * @property {number} POW2 - Generate mipmaps if texture dimensions are pow2\n * @property {number} ON - Always generate mipmaps\n */\nvar MIPMAP_MODES;\n(function (MIPMAP_MODES) {\n MIPMAP_MODES[MIPMAP_MODES[\"OFF\"] = 0] = \"OFF\";\n MIPMAP_MODES[MIPMAP_MODES[\"POW2\"] = 1] = \"POW2\";\n MIPMAP_MODES[MIPMAP_MODES[\"ON\"] = 2] = \"ON\";\n})(MIPMAP_MODES || (MIPMAP_MODES = {}));\n/**\n * How to treat textures with premultiplied alpha\n *\n * @name ALPHA_MODES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} NO_PREMULTIPLIED_ALPHA - Source is not premultiplied, leave it like that.\n * Option for compressed and data textures that are created from typed arrays.\n * @property {number} PREMULTIPLY_ON_UPLOAD - Source is not premultiplied, premultiply on upload.\n * Default option, used for all loaded images.\n * @property {number} PREMULTIPLIED_ALPHA - Source is already premultiplied\n * Example: spine atlases with `_pma` suffix.\n * @property {number} NPM - Alias for NO_PREMULTIPLIED_ALPHA.\n * @property {number} UNPACK - Default option, alias for PREMULTIPLY_ON_UPLOAD.\n * @property {number} PMA - Alias for PREMULTIPLIED_ALPHA.\n */\nvar ALPHA_MODES;\n(function (ALPHA_MODES) {\n ALPHA_MODES[ALPHA_MODES[\"NPM\"] = 0] = \"NPM\";\n ALPHA_MODES[ALPHA_MODES[\"UNPACK\"] = 1] = \"UNPACK\";\n ALPHA_MODES[ALPHA_MODES[\"PMA\"] = 2] = \"PMA\";\n ALPHA_MODES[ALPHA_MODES[\"NO_PREMULTIPLIED_ALPHA\"] = 0] = \"NO_PREMULTIPLIED_ALPHA\";\n ALPHA_MODES[ALPHA_MODES[\"PREMULTIPLY_ON_UPLOAD\"] = 1] = \"PREMULTIPLY_ON_UPLOAD\";\n ALPHA_MODES[ALPHA_MODES[\"PREMULTIPLY_ALPHA\"] = 2] = \"PREMULTIPLY_ALPHA\";\n})(ALPHA_MODES || (ALPHA_MODES = {}));\n/**\n * How to clear renderTextures in filter\n *\n * @name CLEAR_MODES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} BLEND - Preserve the information in the texture, blend above\n * @property {number} CLEAR - Must use `gl.clear` operation\n * @property {number} BLIT - Clear or blit it, depends on device and level of paranoia\n * @property {number} NO - Alias for BLEND, same as `false` in earlier versions\n * @property {number} YES - Alias for CLEAR, same as `true` in earlier versions\n * @property {number} AUTO - Alias for BLIT\n */\nvar CLEAR_MODES;\n(function (CLEAR_MODES) {\n CLEAR_MODES[CLEAR_MODES[\"NO\"] = 0] = \"NO\";\n CLEAR_MODES[CLEAR_MODES[\"YES\"] = 1] = \"YES\";\n CLEAR_MODES[CLEAR_MODES[\"AUTO\"] = 2] = \"AUTO\";\n CLEAR_MODES[CLEAR_MODES[\"BLEND\"] = 0] = \"BLEND\";\n CLEAR_MODES[CLEAR_MODES[\"CLEAR\"] = 1] = \"CLEAR\";\n CLEAR_MODES[CLEAR_MODES[\"BLIT\"] = 2] = \"BLIT\";\n})(CLEAR_MODES || (CLEAR_MODES = {}));\n/**\n * The gc modes that are supported by pixi.\n *\n * The {@link PIXI.settings.GC_MODE} Garbage Collection mode for PixiJS textures is AUTO\n * If set to GC_MODE, the renderer will occasionally check textures usage. If they are not\n * used for a specified period of time they will be removed from the GPU. They will of course\n * be uploaded again when they are required. This is a silent behind the scenes process that\n * should ensure that the GPU does not get filled up.\n *\n * Handy for mobile devices!\n * This property only affects WebGL.\n *\n * @name GC_MODES\n * @enum {number}\n * @static\n * @memberof PIXI\n * @property {number} AUTO - Garbage collection will happen periodically automatically\n * @property {number} MANUAL - Garbage collection will need to be called manually\n */\nvar GC_MODES;\n(function (GC_MODES) {\n GC_MODES[GC_MODES[\"AUTO\"] = 0] = \"AUTO\";\n GC_MODES[GC_MODES[\"MANUAL\"] = 1] = \"MANUAL\";\n})(GC_MODES || (GC_MODES = {}));\n/**\n * Constants that specify float precision in shaders.\n *\n * @name PRECISION\n * @memberof PIXI\n * @constant\n * @static\n * @enum {string}\n * @property {string} LOW='lowp'\n * @property {string} MEDIUM='mediump'\n * @property {string} HIGH='highp'\n */\nvar PRECISION;\n(function (PRECISION) {\n PRECISION[\"LOW\"] = \"lowp\";\n PRECISION[\"MEDIUM\"] = \"mediump\";\n PRECISION[\"HIGH\"] = \"highp\";\n})(PRECISION || (PRECISION = {}));\n/**\n * Constants for mask implementations.\n * We use `type` suffix because it leads to very different behaviours\n *\n * @name MASK_TYPES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} NONE - Mask is ignored\n * @property {number} SCISSOR - Scissor mask, rectangle on screen, cheap\n * @property {number} STENCIL - Stencil mask, 1-bit, medium, works only if renderer supports stencil\n * @property {number} SPRITE - Mask that uses SpriteMaskFilter, uses temporary RenderTexture\n */\nvar MASK_TYPES;\n(function (MASK_TYPES) {\n MASK_TYPES[MASK_TYPES[\"NONE\"] = 0] = \"NONE\";\n MASK_TYPES[MASK_TYPES[\"SCISSOR\"] = 1] = \"SCISSOR\";\n MASK_TYPES[MASK_TYPES[\"STENCIL\"] = 2] = \"STENCIL\";\n MASK_TYPES[MASK_TYPES[\"SPRITE\"] = 3] = \"SPRITE\";\n})(MASK_TYPES || (MASK_TYPES = {}));\n/**\n * Constants for multi-sampling antialiasing.\n *\n * @see PIXI.Framebuffer#multisample\n *\n * @name MSAA_QUALITY\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} NONE - No multisampling for this renderTexture\n * @property {number} LOW - Try 2 samples\n * @property {number} MEDIUM - Try 4 samples\n * @property {number} HIGH - Try 8 samples\n */\nvar MSAA_QUALITY;\n(function (MSAA_QUALITY) {\n MSAA_QUALITY[MSAA_QUALITY[\"NONE\"] = 0] = \"NONE\";\n MSAA_QUALITY[MSAA_QUALITY[\"LOW\"] = 2] = \"LOW\";\n MSAA_QUALITY[MSAA_QUALITY[\"MEDIUM\"] = 4] = \"MEDIUM\";\n MSAA_QUALITY[MSAA_QUALITY[\"HIGH\"] = 8] = \"HIGH\";\n})(MSAA_QUALITY || (MSAA_QUALITY = {}));\n\n/**\n * The BlurFilterPass applies a horizontal or vertical Gaussian blur to an object.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar BlurFilterPass = /** @class */ (function (_super) {\n __extends(BlurFilterPass, _super);\n /**\n * @param {boolean} horizontal - Do pass along the x-axis (`true`) or y-axis (`false`).\n * @param {number} [strength=8] - The strength of the blur filter.\n * @param {number} [quality=4] - The quality of the blur filter.\n * @param {number} [resolution=PIXI.settings.FILTER_RESOLUTION] - The resolution of the blur filter.\n * @param {number} [kernelSize=5] - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.\n */\n function BlurFilterPass(horizontal, strength, quality, resolution, kernelSize) {\n if (strength === void 0) { strength = 8; }\n if (quality === void 0) { quality = 4; }\n if (resolution === void 0) { resolution = settings.FILTER_RESOLUTION; }\n if (kernelSize === void 0) { kernelSize = 5; }\n var _this = this;\n var vertSrc = generateBlurVertSource(kernelSize, horizontal);\n var fragSrc = generateBlurFragSource(kernelSize);\n _this = _super.call(this, \n // vertex shader\n vertSrc, \n // fragment shader\n fragSrc) || this;\n _this.horizontal = horizontal;\n _this.resolution = resolution;\n _this._quality = 0;\n _this.quality = quality;\n _this.blur = strength;\n return _this;\n }\n /**\n * Applies the filter.\n *\n * @param {PIXI.systems.FilterSystem} filterManager - The manager.\n * @param {PIXI.RenderTexture} input - The input target.\n * @param {PIXI.RenderTexture} output - The output target.\n * @param {PIXI.CLEAR_MODES} clearMode - How to clear\n */\n BlurFilterPass.prototype.apply = function (filterManager, input, output, clearMode) {\n if (output) {\n if (this.horizontal) {\n this.uniforms.strength = (1 / output.width) * (output.width / input.width);\n }\n else {\n this.uniforms.strength = (1 / output.height) * (output.height / input.height);\n }\n }\n else {\n if (this.horizontal) // eslint-disable-line\n {\n this.uniforms.strength = (1 / filterManager.renderer.width) * (filterManager.renderer.width / input.width);\n }\n else {\n this.uniforms.strength = (1 / filterManager.renderer.height) * (filterManager.renderer.height / input.height); // eslint-disable-line\n }\n }\n // screen space!\n this.uniforms.strength *= this.strength;\n this.uniforms.strength /= this.passes;\n if (this.passes === 1) {\n filterManager.applyFilter(this, input, output, clearMode);\n }\n else {\n var renderTarget = filterManager.getFilterTexture();\n var renderer = filterManager.renderer;\n var flip = input;\n var flop = renderTarget;\n this.state.blend = false;\n filterManager.applyFilter(this, flip, flop, CLEAR_MODES.CLEAR);\n for (var i = 1; i < this.passes - 1; i++) {\n filterManager.bindAndClear(flip, CLEAR_MODES.BLIT);\n this.uniforms.uSampler = flop;\n var temp = flop;\n flop = flip;\n flip = temp;\n renderer.shader.bind(this);\n renderer.geometry.draw(5);\n }\n this.state.blend = true;\n filterManager.applyFilter(this, flop, output, clearMode);\n filterManager.returnFilterTexture(renderTarget);\n }\n };\n Object.defineProperty(BlurFilterPass.prototype, \"blur\", {\n /**\n * Sets the strength of both the blur.\n *\n * @member {number}\n * @default 16\n */\n get: function () {\n return this.strength;\n },\n set: function (value) {\n this.padding = 1 + (Math.abs(value) * 2);\n this.strength = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilterPass.prototype, \"quality\", {\n /**\n * Sets the quality of the blur by modifying the number of passes. More passes means higher\n * quaility bluring but the lower the performance.\n *\n * @member {number}\n * @default 4\n */\n get: function () {\n return this._quality;\n },\n set: function (value) {\n this._quality = value;\n this.passes = value;\n },\n enumerable: false,\n configurable: true\n });\n return BlurFilterPass;\n}(Filter));\n\n/**\n * The BlurFilter applies a Gaussian blur to an object.\n *\n * The strength of the blur can be set for the x-axis and y-axis separately.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar BlurFilter = /** @class */ (function (_super) {\n __extends(BlurFilter, _super);\n /**\n * @param {number} [strength=8] - The strength of the blur filter.\n * @param {number} [quality=4] - The quality of the blur filter.\n * @param {number} [resolution=PIXI.settings.FILTER_RESOLUTION] - The resolution of the blur filter.\n * @param {number} [kernelSize=5] - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.\n */\n function BlurFilter(strength, quality, resolution, kernelSize) {\n if (strength === void 0) { strength = 8; }\n if (quality === void 0) { quality = 4; }\n if (resolution === void 0) { resolution = settings.FILTER_RESOLUTION; }\n if (kernelSize === void 0) { kernelSize = 5; }\n var _this = _super.call(this) || this;\n _this.blurXFilter = new BlurFilterPass(true, strength, quality, resolution, kernelSize);\n _this.blurYFilter = new BlurFilterPass(false, strength, quality, resolution, kernelSize);\n _this.resolution = resolution;\n _this.quality = quality;\n _this.blur = strength;\n _this.repeatEdgePixels = false;\n return _this;\n }\n /**\n * Applies the filter.\n *\n * @param {PIXI.systems.FilterSystem} filterManager - The manager.\n * @param {PIXI.RenderTexture} input - The input target.\n * @param {PIXI.RenderTexture} output - The output target.\n * @param {PIXI.CLEAR_MODES} clearMode - How to clear\n */\n BlurFilter.prototype.apply = function (filterManager, input, output, clearMode) {\n var xStrength = Math.abs(this.blurXFilter.strength);\n var yStrength = Math.abs(this.blurYFilter.strength);\n if (xStrength && yStrength) {\n var renderTarget = filterManager.getFilterTexture();\n this.blurXFilter.apply(filterManager, input, renderTarget, CLEAR_MODES.CLEAR);\n this.blurYFilter.apply(filterManager, renderTarget, output, clearMode);\n filterManager.returnFilterTexture(renderTarget);\n }\n else if (yStrength) {\n this.blurYFilter.apply(filterManager, input, output, clearMode);\n }\n else {\n this.blurXFilter.apply(filterManager, input, output, clearMode);\n }\n };\n BlurFilter.prototype.updatePadding = function () {\n if (this._repeatEdgePixels) {\n this.padding = 0;\n }\n else {\n this.padding = Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength)) * 2;\n }\n };\n Object.defineProperty(BlurFilter.prototype, \"blur\", {\n /**\n * Sets the strength of both the blurX and blurY properties simultaneously\n *\n * @member {number}\n * @default 2\n */\n get: function () {\n return this.blurXFilter.blur;\n },\n set: function (value) {\n this.blurXFilter.blur = this.blurYFilter.blur = value;\n this.updatePadding();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilter.prototype, \"quality\", {\n /**\n * Sets the number of passes for blur. More passes means higher quaility bluring.\n *\n * @member {number}\n * @default 1\n */\n get: function () {\n return this.blurXFilter.quality;\n },\n set: function (value) {\n this.blurXFilter.quality = this.blurYFilter.quality = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilter.prototype, \"blurX\", {\n /**\n * Sets the strength of the blurX property\n *\n * @member {number}\n * @default 2\n */\n get: function () {\n return this.blurXFilter.blur;\n },\n set: function (value) {\n this.blurXFilter.blur = value;\n this.updatePadding();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilter.prototype, \"blurY\", {\n /**\n * Sets the strength of the blurY property\n *\n * @member {number}\n * @default 2\n */\n get: function () {\n return this.blurYFilter.blur;\n },\n set: function (value) {\n this.blurYFilter.blur = value;\n this.updatePadding();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilter.prototype, \"blendMode\", {\n /**\n * Sets the blendmode of the filter\n *\n * @member {number}\n * @default PIXI.BLEND_MODES.NORMAL\n */\n get: function () {\n return this.blurYFilter.blendMode;\n },\n set: function (value) {\n this.blurYFilter.blendMode = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilter.prototype, \"repeatEdgePixels\", {\n /**\n * If set to true the edge of the target will be clamped\n *\n * @member {boolean}\n * @default false\n */\n get: function () {\n return this._repeatEdgePixels;\n },\n set: function (value) {\n this._repeatEdgePixels = value;\n this.updatePadding();\n },\n enumerable: false,\n configurable: true\n });\n return BlurFilter;\n}(Filter));\n\nexport { BlurFilter, BlurFilterPass };\n//# sourceMappingURL=filter-blur.es.js.map\n","/*!\n * @pixi/filter-color-matrix - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/filter-color-matrix is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { defaultFilterVertex, Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar fragment = \"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\";\n\n/**\n * The ColorMatrixFilter class lets you apply a 5x4 matrix transformation on the RGBA\n * color and alpha values of every pixel on your displayObject to produce a result\n * with a new set of RGBA color and alpha values. It's pretty powerful!\n *\n * ```js\n * let colorMatrix = new PIXI.filters.ColorMatrixFilter();\n * container.filters = [colorMatrix];\n * colorMatrix.contrast(2);\n * ```\n * @author Clément Chenebault \n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar ColorMatrixFilter = /** @class */ (function (_super) {\n __extends(ColorMatrixFilter, _super);\n function ColorMatrixFilter() {\n var _this = this;\n var uniforms = {\n m: new Float32Array([1, 0, 0, 0, 0,\n 0, 1, 0, 0, 0,\n 0, 0, 1, 0, 0,\n 0, 0, 0, 1, 0]),\n uAlpha: 1,\n };\n _this = _super.call(this, defaultFilterVertex, fragment, uniforms) || this;\n _this.alpha = 1;\n return _this;\n }\n /**\n * Transforms current matrix and set the new one\n *\n * @param {number[]} matrix - 5x4 matrix\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype._loadMatrix = function (matrix, multiply) {\n if (multiply === void 0) { multiply = false; }\n var newMatrix = matrix;\n if (multiply) {\n this._multiply(newMatrix, this.uniforms.m, matrix);\n newMatrix = this._colorMatrix(newMatrix);\n }\n // set the new matrix\n this.uniforms.m = newMatrix;\n };\n /**\n * Multiplies two mat5's\n *\n * @private\n * @param {number[]} out - 5x4 matrix the receiving matrix\n * @param {number[]} a - 5x4 matrix the first operand\n * @param {number[]} b - 5x4 matrix the second operand\n * @returns {number[]} 5x4 matrix\n */\n ColorMatrixFilter.prototype._multiply = function (out, a, b) {\n // Red Channel\n out[0] = (a[0] * b[0]) + (a[1] * b[5]) + (a[2] * b[10]) + (a[3] * b[15]);\n out[1] = (a[0] * b[1]) + (a[1] * b[6]) + (a[2] * b[11]) + (a[3] * b[16]);\n out[2] = (a[0] * b[2]) + (a[1] * b[7]) + (a[2] * b[12]) + (a[3] * b[17]);\n out[3] = (a[0] * b[3]) + (a[1] * b[8]) + (a[2] * b[13]) + (a[3] * b[18]);\n out[4] = (a[0] * b[4]) + (a[1] * b[9]) + (a[2] * b[14]) + (a[3] * b[19]) + a[4];\n // Green Channel\n out[5] = (a[5] * b[0]) + (a[6] * b[5]) + (a[7] * b[10]) + (a[8] * b[15]);\n out[6] = (a[5] * b[1]) + (a[6] * b[6]) + (a[7] * b[11]) + (a[8] * b[16]);\n out[7] = (a[5] * b[2]) + (a[6] * b[7]) + (a[7] * b[12]) + (a[8] * b[17]);\n out[8] = (a[5] * b[3]) + (a[6] * b[8]) + (a[7] * b[13]) + (a[8] * b[18]);\n out[9] = (a[5] * b[4]) + (a[6] * b[9]) + (a[7] * b[14]) + (a[8] * b[19]) + a[9];\n // Blue Channel\n out[10] = (a[10] * b[0]) + (a[11] * b[5]) + (a[12] * b[10]) + (a[13] * b[15]);\n out[11] = (a[10] * b[1]) + (a[11] * b[6]) + (a[12] * b[11]) + (a[13] * b[16]);\n out[12] = (a[10] * b[2]) + (a[11] * b[7]) + (a[12] * b[12]) + (a[13] * b[17]);\n out[13] = (a[10] * b[3]) + (a[11] * b[8]) + (a[12] * b[13]) + (a[13] * b[18]);\n out[14] = (a[10] * b[4]) + (a[11] * b[9]) + (a[12] * b[14]) + (a[13] * b[19]) + a[14];\n // Alpha Channel\n out[15] = (a[15] * b[0]) + (a[16] * b[5]) + (a[17] * b[10]) + (a[18] * b[15]);\n out[16] = (a[15] * b[1]) + (a[16] * b[6]) + (a[17] * b[11]) + (a[18] * b[16]);\n out[17] = (a[15] * b[2]) + (a[16] * b[7]) + (a[17] * b[12]) + (a[18] * b[17]);\n out[18] = (a[15] * b[3]) + (a[16] * b[8]) + (a[17] * b[13]) + (a[18] * b[18]);\n out[19] = (a[15] * b[4]) + (a[16] * b[9]) + (a[17] * b[14]) + (a[18] * b[19]) + a[19];\n return out;\n };\n /**\n * Create a Float32 Array and normalize the offset component to 0-1\n *\n * @private\n * @param {number[]} matrix - 5x4 matrix\n * @return {number[]} 5x4 matrix with all values between 0-1\n */\n ColorMatrixFilter.prototype._colorMatrix = function (matrix) {\n // Create a Float32 Array and normalize the offset component to 0-1\n var m = new Float32Array(matrix);\n m[4] /= 255;\n m[9] /= 255;\n m[14] /= 255;\n m[19] /= 255;\n return m;\n };\n /**\n * Adjusts brightness\n *\n * @param {number} b - value of the brigthness (0-1, where 0 is black)\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.brightness = function (b, multiply) {\n var matrix = [\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Set the matrices in grey scales\n *\n * @param {number} scale - value of the grey (0-1, where 0 is black)\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.greyscale = function (scale, multiply) {\n var matrix = [\n scale, scale, scale, 0, 0,\n scale, scale, scale, 0, 0,\n scale, scale, scale, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Set the black and white matrice.\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.blackAndWhite = function (multiply) {\n var matrix = [\n 0.3, 0.6, 0.1, 0, 0,\n 0.3, 0.6, 0.1, 0, 0,\n 0.3, 0.6, 0.1, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Set the hue property of the color\n *\n * @param {number} rotation - in degrees\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.hue = function (rotation, multiply) {\n rotation = (rotation || 0) / 180 * Math.PI;\n var cosR = Math.cos(rotation);\n var sinR = Math.sin(rotation);\n var sqrt = Math.sqrt;\n /* a good approximation for hue rotation\n This matrix is far better than the versions with magic luminance constants\n formerly used here, but also used in the starling framework (flash) and known from this\n old part of the internet: quasimondo.com/archives/000565.php\n\n This new matrix is based on rgb cube rotation in space. Look here for a more descriptive\n implementation as a shader not a general matrix:\n https://github.com/evanw/glfx.js/blob/58841c23919bd59787effc0333a4897b43835412/src/filters/adjust/huesaturation.js\n\n This is the source for the code:\n see http://stackoverflow.com/questions/8507885/shift-hue-of-an-rgb-color/8510751#8510751\n */\n var w = 1 / 3;\n var sqrW = sqrt(w); // weight is\n var a00 = cosR + ((1.0 - cosR) * w);\n var a01 = (w * (1.0 - cosR)) - (sqrW * sinR);\n var a02 = (w * (1.0 - cosR)) + (sqrW * sinR);\n var a10 = (w * (1.0 - cosR)) + (sqrW * sinR);\n var a11 = cosR + (w * (1.0 - cosR));\n var a12 = (w * (1.0 - cosR)) - (sqrW * sinR);\n var a20 = (w * (1.0 - cosR)) - (sqrW * sinR);\n var a21 = (w * (1.0 - cosR)) + (sqrW * sinR);\n var a22 = cosR + (w * (1.0 - cosR));\n var matrix = [\n a00, a01, a02, 0, 0,\n a10, a11, a12, 0, 0,\n a20, a21, a22, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Set the contrast matrix, increase the separation between dark and bright\n * Increase contrast : shadows darker and highlights brighter\n * Decrease contrast : bring the shadows up and the highlights down\n *\n * @param {number} amount - value of the contrast (0-1)\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.contrast = function (amount, multiply) {\n var v = (amount || 0) + 1;\n var o = -0.5 * (v - 1);\n var matrix = [\n v, 0, 0, 0, o,\n 0, v, 0, 0, o,\n 0, 0, v, 0, o,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Set the saturation matrix, increase the separation between colors\n * Increase saturation : increase contrast, brightness, and sharpness\n *\n * @param {number} amount - The saturation amount (0-1)\n * @param {boolean} [multiply] - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.saturate = function (amount, multiply) {\n if (amount === void 0) { amount = 0; }\n var x = (amount * 2 / 3) + 1;\n var y = ((x - 1) * -0.5);\n var matrix = [\n x, y, y, 0, 0,\n y, x, y, 0, 0,\n y, y, x, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Desaturate image (remove color)\n *\n * Call the saturate function\n *\n */\n ColorMatrixFilter.prototype.desaturate = function () {\n this.saturate(-1);\n };\n /**\n * Negative image (inverse of classic rgb matrix)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.negative = function (multiply) {\n var matrix = [\n -1, 0, 0, 1, 0,\n 0, -1, 0, 1, 0,\n 0, 0, -1, 1, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Sepia image\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.sepia = function (multiply) {\n var matrix = [\n 0.393, 0.7689999, 0.18899999, 0, 0,\n 0.349, 0.6859999, 0.16799999, 0, 0,\n 0.272, 0.5339999, 0.13099999, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Color motion picture process invented in 1916 (thanks Dominic Szablewski)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.technicolor = function (multiply) {\n var matrix = [\n 1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337,\n -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398,\n -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Polaroid filter\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.polaroid = function (multiply) {\n var matrix = [\n 1.438, -0.062, -0.062, 0, 0,\n -0.122, 1.378, -0.122, 0, 0,\n -0.016, -0.016, 1.483, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Filter who transforms : Red -> Blue and Blue -> Red\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.toBGR = function (multiply) {\n var matrix = [\n 0, 0, 1, 0, 0,\n 0, 1, 0, 0, 0,\n 1, 0, 0, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Color reversal film introduced by Eastman Kodak in 1935. (thanks Dominic Szablewski)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.kodachrome = function (multiply) {\n var matrix = [\n 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502,\n -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203,\n -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Brown delicious browni filter (thanks Dominic Szablewski)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.browni = function (multiply) {\n var matrix = [\n 0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873,\n -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127,\n 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Vintage filter (thanks Dominic Szablewski)\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.vintage = function (multiply) {\n var matrix = [\n 0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123,\n 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591,\n 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * We don't know exactly what it does, kind of gradient map, but funny to play with!\n *\n * @param {number} desaturation - Tone values.\n * @param {number} toned - Tone values.\n * @param {number} lightColor - Tone values, example: `0xFFE580`\n * @param {number} darkColor - Tone values, example: `0xFFE580`\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.colorTone = function (desaturation, toned, lightColor, darkColor, multiply) {\n desaturation = desaturation || 0.2;\n toned = toned || 0.15;\n lightColor = lightColor || 0xFFE580;\n darkColor = darkColor || 0x338000;\n var lR = ((lightColor >> 16) & 0xFF) / 255;\n var lG = ((lightColor >> 8) & 0xFF) / 255;\n var lB = (lightColor & 0xFF) / 255;\n var dR = ((darkColor >> 16) & 0xFF) / 255;\n var dG = ((darkColor >> 8) & 0xFF) / 255;\n var dB = (darkColor & 0xFF) / 255;\n var matrix = [\n 0.3, 0.59, 0.11, 0, 0,\n lR, lG, lB, desaturation, 0,\n dR, dG, dB, toned, 0,\n lR - dR, lG - dG, lB - dB, 0, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Night effect\n *\n * @param {number} intensity - The intensity of the night effect.\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.night = function (intensity, multiply) {\n intensity = intensity || 0.1;\n var matrix = [\n intensity * (-2.0), -intensity, 0, 0, 0,\n -intensity, 0, intensity, 0, 0,\n 0, intensity, intensity * 2.0, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Predator effect\n *\n * Erase the current matrix by setting a new indepent one\n *\n * @param {number} amount - how much the predator feels his future victim\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.predator = function (amount, multiply) {\n var matrix = [\n // row 1\n 11.224130630493164 * amount,\n -4.794486999511719 * amount,\n -2.8746118545532227 * amount,\n 0 * amount,\n 0.40342438220977783 * amount,\n // row 2\n -3.6330697536468506 * amount,\n 9.193157196044922 * amount,\n -2.951810836791992 * amount,\n 0 * amount,\n -1.316135048866272 * amount,\n // row 3\n -3.2184197902679443 * amount,\n -4.2375030517578125 * amount,\n 7.476448059082031 * amount,\n 0 * amount,\n 0.8044459223747253 * amount,\n // row 4\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * LSD effect\n *\n * Multiply the current matrix\n *\n * @param {boolean} multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.lsd = function (multiply) {\n var matrix = [\n 2, -0.4, 0.5, 0, 0,\n -0.5, 2, -0.4, 0, 0,\n -0.4, -0.5, 3, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Erase the current matrix by setting the default one\n *\n */\n ColorMatrixFilter.prototype.reset = function () {\n var matrix = [\n 1, 0, 0, 0, 0,\n 0, 1, 0, 0, 0,\n 0, 0, 1, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, false);\n };\n Object.defineProperty(ColorMatrixFilter.prototype, \"matrix\", {\n /**\n * The matrix of the color matrix filter\n *\n * @member {number[]}\n * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]\n */\n get: function () {\n return this.uniforms.m;\n },\n set: function (value) {\n this.uniforms.m = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ColorMatrixFilter.prototype, \"alpha\", {\n /**\n * The opacity value to use when mixing the original and resultant colors.\n *\n * When the value is 0, the original color is used without modification.\n * When the value is 1, the result color is used.\n * When in the range (0, 1) the color is interpolated between the original and result by this amount.\n *\n * @member {number}\n * @default 1\n */\n get: function () {\n return this.uniforms.uAlpha;\n },\n set: function (value) {\n this.uniforms.uAlpha = value;\n },\n enumerable: false,\n configurable: true\n });\n return ColorMatrixFilter;\n}(Filter));\n// Americanized alias\nColorMatrixFilter.prototype.grayscale = ColorMatrixFilter.prototype.greyscale;\n\nexport { ColorMatrixFilter };\n//# sourceMappingURL=filter-color-matrix.es.js.map\n","/*!\n * @pixi/filter-displacement - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/filter-displacement is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { Matrix, Point } from '@pixi/math';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar fragment = \"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\";\n\nvar vertex = \"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\";\n\n/**\n * The DisplacementFilter class uses the pixel values from the specified texture\n * (called the displacement map) to perform a displacement of an object.\n *\n * You can use this filter to apply all manor of crazy warping effects.\n * Currently the `r` property of the texture is used to offset the `x`\n * and the `g` property of the texture is used to offset the `y`.\n *\n * The way it works is it uses the values of the displacement map to look up the\n * correct pixels to output. This means it's not technically moving the original.\n * Instead, it's starting at the output and asking \"which pixel from the original goes here\".\n * For example, if a displacement map pixel has `red = 1` and the filter scale is `20`,\n * this filter will output the pixel approximately 20 pixels to the right of the original.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar DisplacementFilter = /** @class */ (function (_super) {\n __extends(DisplacementFilter, _super);\n /**\n * @param {PIXI.Sprite} sprite - The sprite used for the displacement map. (make sure its added to the scene!)\n * @param {number} [scale] - The scale of the displacement\n */\n function DisplacementFilter(sprite, scale) {\n var _this = this;\n var maskMatrix = new Matrix();\n sprite.renderable = false;\n _this = _super.call(this, vertex, fragment, {\n mapSampler: sprite._texture,\n filterMatrix: maskMatrix,\n scale: { x: 1, y: 1 },\n rotation: new Float32Array([1, 0, 0, 1]),\n }) || this;\n _this.maskSprite = sprite;\n _this.maskMatrix = maskMatrix;\n if (scale === null || scale === undefined) {\n scale = 20;\n }\n /**\n * scaleX, scaleY for displacements\n * @member {PIXI.Point}\n */\n _this.scale = new Point(scale, scale);\n return _this;\n }\n /**\n * Applies the filter.\n *\n * @param {PIXI.systems.FilterSystem} filterManager - The manager.\n * @param {PIXI.RenderTexture} input - The input target.\n * @param {PIXI.RenderTexture} output - The output target.\n * @param {PIXI.CLEAR_MODES} clearMode - clearMode.\n */\n DisplacementFilter.prototype.apply = function (filterManager, input, output, clearMode) {\n // fill maskMatrix with _normalized sprite texture coords_\n this.uniforms.filterMatrix = filterManager.calculateSpriteMatrix(this.maskMatrix, this.maskSprite);\n this.uniforms.scale.x = this.scale.x;\n this.uniforms.scale.y = this.scale.y;\n // Extract rotation from world transform\n var wt = this.maskSprite.worldTransform;\n var lenX = Math.sqrt((wt.a * wt.a) + (wt.b * wt.b));\n var lenY = Math.sqrt((wt.c * wt.c) + (wt.d * wt.d));\n if (lenX !== 0 && lenY !== 0) {\n this.uniforms.rotation[0] = wt.a / lenX;\n this.uniforms.rotation[1] = wt.b / lenX;\n this.uniforms.rotation[2] = wt.c / lenY;\n this.uniforms.rotation[3] = wt.d / lenY;\n }\n // draw the filter...\n filterManager.applyFilter(this, input, output, clearMode);\n };\n Object.defineProperty(DisplacementFilter.prototype, \"map\", {\n /**\n * The texture used for the displacement map. Must be power of 2 sized texture.\n *\n * @member {PIXI.Texture}\n */\n get: function () {\n return this.uniforms.mapSampler;\n },\n set: function (value) {\n this.uniforms.mapSampler = value;\n },\n enumerable: false,\n configurable: true\n });\n return DisplacementFilter;\n}(Filter));\n\nexport { DisplacementFilter };\n//# sourceMappingURL=filter-displacement.es.js.map\n","/*!\n * @pixi/filter-fxaa - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/filter-fxaa is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"\\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\";\n\nvar fragment = \"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\";\n\n/**\n * Basic FXAA (Fast Approximate Anti-Aliasing) implementation based on the code on geeks3d.com\n * with the modification that the texture2DLod stuff was removed since it is unsupported by WebGL.\n *\n * @see https://github.com/mitsuhiko/webgl-meincraft\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n *\n */\nvar FXAAFilter = /** @class */ (function (_super) {\n __extends(FXAAFilter, _super);\n function FXAAFilter() {\n // TODO - needs work\n return _super.call(this, vertex, fragment) || this;\n }\n return FXAAFilter;\n}(Filter));\n\nexport { FXAAFilter };\n//# sourceMappingURL=filter-fxaa.es.js.map\n","/*!\n * @pixi/filter-noise - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/filter-noise is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { defaultFilterVertex, Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar fragment = \"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\";\n\n/**\n * @author Vico @vicocotea\n * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js\n */\n/**\n * A Noise effect filter.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n */\nvar NoiseFilter = /** @class */ (function (_super) {\n __extends(NoiseFilter, _super);\n /**\n * @param {number} [noise=0.5] - The noise intensity, should be a normalized value in the range [0, 1].\n * @param {number} [seed] - A random seed for the noise generation. Default is `Math.random()`.\n */\n function NoiseFilter(noise, seed) {\n if (noise === void 0) { noise = 0.5; }\n if (seed === void 0) { seed = Math.random(); }\n var _this = _super.call(this, defaultFilterVertex, fragment, {\n uNoise: 0,\n uSeed: 0,\n }) || this;\n _this.noise = noise;\n _this.seed = seed;\n return _this;\n }\n Object.defineProperty(NoiseFilter.prototype, \"noise\", {\n /**\n * The amount of noise to apply, this value should be in the range (0, 1].\n *\n * @member {number}\n * @default 0.5\n */\n get: function () {\n return this.uniforms.uNoise;\n },\n set: function (value) {\n this.uniforms.uNoise = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NoiseFilter.prototype, \"seed\", {\n /**\n * A seed value to apply to the random noise generation. `Math.random()` is a good value to use.\n *\n * @member {number}\n */\n get: function () {\n return this.uniforms.uSeed;\n },\n set: function (value) {\n this.uniforms.uSeed = value;\n },\n enumerable: false,\n configurable: true\n });\n return NoiseFilter;\n}(Filter));\n\nexport { NoiseFilter };\n//# sourceMappingURL=filter-noise.es.js.map\n","/*!\n * @pixi/mixin-cache-as-bitmap - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/mixin-cache-as-bitmap is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { RenderTexture, BaseTexture, Texture } from '@pixi/core';\nimport { Sprite } from '@pixi/sprite';\nimport { DisplayObject } from '@pixi/display';\nimport { Matrix } from '@pixi/math';\nimport { uid } from '@pixi/utils';\nimport { settings } from '@pixi/settings';\n\nvar _tempMatrix = new Matrix();\nDisplayObject.prototype._cacheAsBitmap = false;\nDisplayObject.prototype._cacheData = null;\n// figured there's no point adding ALL the extra variables to prototype.\n// this model can hold the information needed. This can also be generated on demand as\n// most objects are not cached as bitmaps.\n/**\n * @class\n * @ignore\n */\nvar CacheData = /** @class */ (function () {\n function CacheData() {\n this.textureCacheId = null;\n this.originalRender = null;\n this.originalRenderCanvas = null;\n this.originalCalculateBounds = null;\n this.originalGetLocalBounds = null;\n this.originalUpdateTransform = null;\n this.originalDestroy = null;\n this.originalMask = null;\n this.originalFilterArea = null;\n this.originalContainsPoint = null;\n this.sprite = null;\n }\n return CacheData;\n}());\nObject.defineProperties(DisplayObject.prototype, {\n /**\n * Set this to true if you want this display object to be cached as a bitmap.\n * This basically takes a snap shot of the display object as it is at that moment. It can\n * provide a performance benefit for complex static displayObjects.\n * To remove simply set this property to `false`\n *\n * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true\n * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.\n *\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n cacheAsBitmap: {\n get: function () {\n return this._cacheAsBitmap;\n },\n set: function (value) {\n if (this._cacheAsBitmap === value) {\n return;\n }\n this._cacheAsBitmap = value;\n var data;\n if (value) {\n if (!this._cacheData) {\n this._cacheData = new CacheData();\n }\n data = this._cacheData;\n data.originalRender = this.render;\n data.originalRenderCanvas = this.renderCanvas;\n data.originalUpdateTransform = this.updateTransform;\n data.originalCalculateBounds = this.calculateBounds;\n data.originalGetLocalBounds = this.getLocalBounds;\n data.originalDestroy = this.destroy;\n data.originalContainsPoint = this.containsPoint;\n data.originalMask = this._mask;\n data.originalFilterArea = this.filterArea;\n this.render = this._renderCached;\n this.renderCanvas = this._renderCachedCanvas;\n this.destroy = this._cacheAsBitmapDestroy;\n }\n else {\n data = this._cacheData;\n if (data.sprite) {\n this._destroyCachedDisplayObject();\n }\n this.render = data.originalRender;\n this.renderCanvas = data.originalRenderCanvas;\n this.calculateBounds = data.originalCalculateBounds;\n this.getLocalBounds = data.originalGetLocalBounds;\n this.destroy = data.originalDestroy;\n this.updateTransform = data.originalUpdateTransform;\n this.containsPoint = data.originalContainsPoint;\n this._mask = data.originalMask;\n this.filterArea = data.originalFilterArea;\n }\n },\n },\n});\n/**\n * Renders a cached version of the sprite with WebGL\n *\n * @private\n * @function _renderCached\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.Renderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._renderCached = function _renderCached(renderer) {\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n this._initCachedDisplayObject(renderer);\n this._cacheData.sprite.transform._worldID = this.transform._worldID;\n this._cacheData.sprite.worldAlpha = this.worldAlpha;\n this._cacheData.sprite._render(renderer);\n};\n/**\n * Prepares the WebGL renderer to cache the sprite\n *\n * @private\n * @function _initCachedDisplayObject\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.Renderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._initCachedDisplayObject = function _initCachedDisplayObject(renderer) {\n if (this._cacheData && this._cacheData.sprite) {\n return;\n }\n // make sure alpha is set to 1 otherwise it will get rendered as invisible!\n var cacheAlpha = this.alpha;\n this.alpha = 1;\n // first we flush anything left in the renderer (otherwise it would get rendered to the cached texture)\n renderer.batch.flush();\n // this.filters= [];\n // next we find the dimensions of the untransformed object\n // this function also calls updatetransform on all its children as part of the measuring.\n // This means we don't need to update the transform again in this function\n // TODO pass an object to clone too? saves having to create a new one each time!\n var bounds = this.getLocalBounds(null, true).clone();\n // add some padding!\n if (this.filters) {\n var padding = this.filters[0].padding;\n bounds.pad(padding);\n }\n bounds.ceil(settings.RESOLUTION);\n // for now we cache the current renderTarget that the WebGL renderer is currently using.\n // this could be more elegant..\n var cachedRenderTexture = renderer.renderTexture.current;\n var cachedSourceFrame = renderer.renderTexture.sourceFrame.clone();\n var cachedProjectionTransform = renderer.projection.transform;\n // We also store the filter stack - I will definitely look to change how this works a little later down the line.\n // const stack = renderer.filterManager.filterStack;\n // this renderTexture will be used to store the cached DisplayObject\n var renderTexture = RenderTexture.create({ width: bounds.width, height: bounds.height });\n var textureCacheId = \"cacheAsBitmap_\" + uid();\n this._cacheData.textureCacheId = textureCacheId;\n BaseTexture.addToCache(renderTexture.baseTexture, textureCacheId);\n Texture.addToCache(renderTexture, textureCacheId);\n // need to set //\n var m = this.transform.localTransform.copyTo(_tempMatrix).invert().translate(-bounds.x, -bounds.y);\n // set all properties to there original so we can render to a texture\n this.render = this._cacheData.originalRender;\n renderer.render(this, renderTexture, true, m, false);\n // now restore the state be setting the new properties\n renderer.projection.transform = cachedProjectionTransform;\n renderer.renderTexture.bind(cachedRenderTexture, cachedSourceFrame);\n // renderer.filterManager.filterStack = stack;\n this.render = this._renderCached;\n // the rest is the same as for Canvas\n this.updateTransform = this.displayObjectUpdateTransform;\n this.calculateBounds = this._calculateCachedBounds;\n this.getLocalBounds = this._getCachedLocalBounds;\n this._mask = null;\n this.filterArea = null;\n // create our cached sprite\n var cachedSprite = new Sprite(renderTexture);\n cachedSprite.transform.worldTransform = this.transform.worldTransform;\n cachedSprite.anchor.x = -(bounds.x / bounds.width);\n cachedSprite.anchor.y = -(bounds.y / bounds.height);\n cachedSprite.alpha = cacheAlpha;\n cachedSprite._bounds = this._bounds;\n this._cacheData.sprite = cachedSprite;\n this.transform._parentID = -1;\n // restore the transform of the cached sprite to avoid the nasty flicker..\n if (!this.parent) {\n this.enableTempParent();\n this.updateTransform();\n this.disableTempParent(null);\n }\n else {\n this.updateTransform();\n }\n // map the hit test..\n this.containsPoint = cachedSprite.containsPoint.bind(cachedSprite);\n};\n/**\n * Renders a cached version of the sprite with canvas\n *\n * @private\n * @function _renderCachedCanvas\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.CanvasRenderer} renderer - The canvas renderer\n */\nDisplayObject.prototype._renderCachedCanvas = function _renderCachedCanvas(renderer) {\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n this._initCachedDisplayObjectCanvas(renderer);\n this._cacheData.sprite.worldAlpha = this.worldAlpha;\n this._cacheData.sprite._renderCanvas(renderer);\n};\n// TODO this can be the same as the WebGL version.. will need to do a little tweaking first though..\n/**\n * Prepares the Canvas renderer to cache the sprite\n *\n * @private\n * @function _initCachedDisplayObjectCanvas\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.CanvasRenderer} renderer - The canvas renderer\n */\nDisplayObject.prototype._initCachedDisplayObjectCanvas = function _initCachedDisplayObjectCanvas(renderer) {\n if (this._cacheData && this._cacheData.sprite) {\n return;\n }\n // get bounds actually transforms the object for us already!\n var bounds = this.getLocalBounds(null, true);\n var cacheAlpha = this.alpha;\n this.alpha = 1;\n var cachedRenderTarget = renderer.context;\n var cachedProjectionTransform = renderer._projTransform;\n bounds.ceil(settings.RESOLUTION);\n var renderTexture = RenderTexture.create({ width: bounds.width, height: bounds.height });\n var textureCacheId = \"cacheAsBitmap_\" + uid();\n this._cacheData.textureCacheId = textureCacheId;\n BaseTexture.addToCache(renderTexture.baseTexture, textureCacheId);\n Texture.addToCache(renderTexture, textureCacheId);\n // need to set //\n var m = _tempMatrix;\n this.transform.localTransform.copyTo(m);\n m.invert();\n m.tx -= bounds.x;\n m.ty -= bounds.y;\n // m.append(this.transform.worldTransform.)\n // set all properties to there original so we can render to a texture\n this.renderCanvas = this._cacheData.originalRenderCanvas;\n renderer.render(this, renderTexture, true, m, false);\n // now restore the state be setting the new properties\n renderer.context = cachedRenderTarget;\n renderer._projTransform = cachedProjectionTransform;\n this.renderCanvas = this._renderCachedCanvas;\n // the rest is the same as for WebGL\n this.updateTransform = this.displayObjectUpdateTransform;\n this.calculateBounds = this._calculateCachedBounds;\n this.getLocalBounds = this._getCachedLocalBounds;\n this._mask = null;\n this.filterArea = null;\n // create our cached sprite\n var cachedSprite = new Sprite(renderTexture);\n cachedSprite.transform.worldTransform = this.transform.worldTransform;\n cachedSprite.anchor.x = -(bounds.x / bounds.width);\n cachedSprite.anchor.y = -(bounds.y / bounds.height);\n cachedSprite.alpha = cacheAlpha;\n cachedSprite._bounds = this._bounds;\n this._cacheData.sprite = cachedSprite;\n this.transform._parentID = -1;\n // restore the transform of the cached sprite to avoid the nasty flicker..\n if (!this.parent) {\n this.parent = renderer._tempDisplayObjectParent;\n this.updateTransform();\n this.parent = null;\n }\n else {\n this.updateTransform();\n }\n // map the hit test..\n this.containsPoint = cachedSprite.containsPoint.bind(cachedSprite);\n};\n/**\n * Calculates the bounds of the cached sprite\n *\n * @private\n */\nDisplayObject.prototype._calculateCachedBounds = function _calculateCachedBounds() {\n this._bounds.clear();\n this._cacheData.sprite.transform._worldID = this.transform._worldID;\n this._cacheData.sprite._calculateBounds();\n this._bounds.updateID = this._boundsID;\n};\n/**\n * Gets the bounds of the cached sprite.\n *\n * @private\n * @return {Rectangle} The local bounds.\n */\nDisplayObject.prototype._getCachedLocalBounds = function _getCachedLocalBounds() {\n return this._cacheData.sprite.getLocalBounds(null);\n};\n/**\n * Destroys the cached sprite.\n *\n * @private\n */\nDisplayObject.prototype._destroyCachedDisplayObject = function _destroyCachedDisplayObject() {\n this._cacheData.sprite._texture.destroy(true);\n this._cacheData.sprite = null;\n BaseTexture.removeFromCache(this._cacheData.textureCacheId);\n Texture.removeFromCache(this._cacheData.textureCacheId);\n this._cacheData.textureCacheId = null;\n};\n/**\n * Destroys the cached object.\n *\n * @private\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value.\n * Used when destroying containers, see the Container.destroy method.\n */\nDisplayObject.prototype._cacheAsBitmapDestroy = function _cacheAsBitmapDestroy(options) {\n this.cacheAsBitmap = false;\n this.destroy(options);\n};\n\nexport { CacheData };\n//# sourceMappingURL=mixin-cache-as-bitmap.es.js.map\n","/*!\n * @pixi/mixin-get-child-by-name - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/mixin-get-child-by-name is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { DisplayObject, Container } from '@pixi/display';\n\n/**\n * The instance name of the object.\n *\n * @memberof PIXI.DisplayObject#\n * @member {string} name\n */\nDisplayObject.prototype.name = null;\n/**\n * Returns the display object in the container.\n *\n * Recursive searches are done in a preorder traversal.\n *\n * @method getChildByName\n * @memberof PIXI.Container#\n * @param {string} name - Instance name.\n * @param {boolean}[deep=false] - Whether to search recursively\n * @return {PIXI.DisplayObject} The child with the specified name.\n */\nContainer.prototype.getChildByName = function getChildByName(name, deep) {\n for (var i = 0, j = this.children.length; i < j; i++) {\n if (this.children[i].name === name) {\n return this.children[i];\n }\n }\n if (deep) {\n for (var i = 0, j = this.children.length; i < j; i++) {\n var child = this.children[i];\n if (!child.getChildByName) {\n continue;\n }\n var target = this.children[i].getChildByName(name, true);\n if (target) {\n return target;\n }\n }\n }\n return null;\n};\n//# sourceMappingURL=mixin-get-child-by-name.es.js.map\n","/*!\n * @pixi/mixin-get-global-position - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/mixin-get-global-position is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { DisplayObject } from '@pixi/display';\nimport { Point } from '@pixi/math';\n\n/**\n * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.\n *\n * @method getGlobalPosition\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.Point} [point=new PIXI.Point()] - The point to write the global value to.\n * @param {boolean} [skipUpdate=false] - Setting to true will stop the transforms of the scene graph from\n * being updated. This means the calculation returned MAY be out of date BUT will give you a\n * nice performance boost.\n * @return {PIXI.Point} The updated point.\n */\nDisplayObject.prototype.getGlobalPosition = function getGlobalPosition(point, skipUpdate) {\n if (point === void 0) { point = new Point(); }\n if (skipUpdate === void 0) { skipUpdate = false; }\n if (this.parent) {\n this.parent.toGlobal(this.position, point, skipUpdate);\n }\n else {\n point.x = this.position.x;\n point.y = this.position.y;\n }\n return point;\n};\n//# sourceMappingURL=mixin-get-global-position.es.js.map\n","/*!\n * @pixi/mesh-extras - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/mesh-extras is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { MeshGeometry, MeshMaterial, Mesh } from '@pixi/mesh';\nimport { WRAP_MODES } from '@pixi/constants';\nimport { Texture } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar PlaneGeometry = /** @class */ (function (_super) {\n __extends(PlaneGeometry, _super);\n function PlaneGeometry(width, height, segWidth, segHeight) {\n if (width === void 0) { width = 100; }\n if (height === void 0) { height = 100; }\n if (segWidth === void 0) { segWidth = 10; }\n if (segHeight === void 0) { segHeight = 10; }\n var _this = _super.call(this) || this;\n _this.segWidth = segWidth;\n _this.segHeight = segHeight;\n _this.width = width;\n _this.height = height;\n _this.build();\n return _this;\n }\n /**\n * Refreshes plane coordinates\n * @private\n */\n PlaneGeometry.prototype.build = function () {\n var total = this.segWidth * this.segHeight;\n var verts = [];\n var uvs = [];\n var indices = [];\n var segmentsX = this.segWidth - 1;\n var segmentsY = this.segHeight - 1;\n var sizeX = (this.width) / segmentsX;\n var sizeY = (this.height) / segmentsY;\n for (var i = 0; i < total; i++) {\n var x = (i % this.segWidth);\n var y = ((i / this.segWidth) | 0);\n verts.push(x * sizeX, y * sizeY);\n uvs.push(x / segmentsX, y / segmentsY);\n }\n var totalSub = segmentsX * segmentsY;\n for (var i = 0; i < totalSub; i++) {\n var xpos = i % segmentsX;\n var ypos = (i / segmentsX) | 0;\n var value = (ypos * this.segWidth) + xpos;\n var value2 = (ypos * this.segWidth) + xpos + 1;\n var value3 = ((ypos + 1) * this.segWidth) + xpos;\n var value4 = ((ypos + 1) * this.segWidth) + xpos + 1;\n indices.push(value, value2, value3, value2, value4, value3);\n }\n this.buffers[0].data = new Float32Array(verts);\n this.buffers[1].data = new Float32Array(uvs);\n this.indexBuffer.data = new Uint16Array(indices);\n // ensure that the changes are uploaded\n this.buffers[0].update();\n this.buffers[1].update();\n this.indexBuffer.update();\n };\n return PlaneGeometry;\n}(MeshGeometry));\n\n/**\n * RopeGeometry allows you to draw a geometry across several points and then manipulate these points.\n *\n * ```js\n * for (let i = 0; i < 20; i++) {\n * points.push(new PIXI.Point(i * 50, 0));\n * };\n * const rope = new PIXI.RopeGeometry(100, points);\n * ```\n *\n * @class\n * @extends PIXI.MeshGeometry\n * @memberof PIXI\n *\n */\nvar RopeGeometry = /** @class */ (function (_super) {\n __extends(RopeGeometry, _super);\n /**\n * @param {number} [width=200] - The width (i.e., thickness) of the rope.\n * @param {PIXI.Point[]} [points] - An array of {@link PIXI.Point} objects to construct this rope.\n * @param {number} [textureScale=0] - By default the rope texture will be stretched to match\n * rope length. If textureScale is positive this value will be treated as a scaling\n * factor and the texture will preserve its aspect ratio instead. To create a tiling rope\n * set baseTexture.wrapMode to {@link PIXI.WRAP_MODES.REPEAT} and use a power of two texture,\n * then set textureScale=1 to keep the original texture pixel size.\n * In order to reduce alpha channel artifacts provide a larger texture and downsample -\n * i.e. set textureScale=0.5 to scale it down twice.\n */\n function RopeGeometry(width, points, textureScale) {\n if (width === void 0) { width = 200; }\n if (textureScale === void 0) { textureScale = 0; }\n var _this = _super.call(this, new Float32Array(points.length * 4), new Float32Array(points.length * 4), new Uint16Array((points.length - 1) * 6)) || this;\n /**\n * An array of points that determine the rope\n * @member {PIXI.Point[]}\n */\n _this.points = points;\n /**\n * The width (i.e., thickness) of the rope.\n * @member {number}\n * @readOnly\n */\n _this._width = width;\n /**\n * Rope texture scale, if zero then the rope texture is stretched.\n * @member {number}\n * @readOnly\n */\n _this.textureScale = textureScale;\n _this.build();\n return _this;\n }\n Object.defineProperty(RopeGeometry.prototype, \"width\", {\n /**\n * The width (i.e., thickness) of the rope.\n * @member {number}\n * @readOnly\n */\n get: function () {\n return this._width;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Refreshes Rope indices and uvs\n * @private\n */\n RopeGeometry.prototype.build = function () {\n var points = this.points;\n if (!points)\n { return; }\n var vertexBuffer = this.getBuffer('aVertexPosition');\n var uvBuffer = this.getBuffer('aTextureCoord');\n var indexBuffer = this.getIndex();\n // if too little points, or texture hasn't got UVs set yet just move on.\n if (points.length < 1) {\n return;\n }\n // if the number of points has changed we will need to recreate the arraybuffers\n if (vertexBuffer.data.length / 4 !== points.length) {\n vertexBuffer.data = new Float32Array(points.length * 4);\n uvBuffer.data = new Float32Array(points.length * 4);\n indexBuffer.data = new Uint16Array((points.length - 1) * 6);\n }\n var uvs = uvBuffer.data;\n var indices = indexBuffer.data;\n uvs[0] = 0;\n uvs[1] = 0;\n uvs[2] = 0;\n uvs[3] = 1;\n var amount = 0;\n var prev = points[0];\n var textureWidth = this._width * this.textureScale;\n var total = points.length; // - 1;\n for (var i = 0; i < total; i++) {\n // time to do some smart drawing!\n var index = i * 4;\n if (this.textureScale > 0) {\n // calculate pixel distance from previous point\n var dx = prev.x - points[i].x;\n var dy = prev.y - points[i].y;\n var distance = Math.sqrt((dx * dx) + (dy * dy));\n prev = points[i];\n amount += distance / textureWidth;\n }\n else {\n // stretch texture\n amount = i / (total - 1);\n }\n uvs[index] = amount;\n uvs[index + 1] = 0;\n uvs[index + 2] = amount;\n uvs[index + 3] = 1;\n }\n var indexCount = 0;\n for (var i = 0; i < total - 1; i++) {\n var index = i * 2;\n indices[indexCount++] = index;\n indices[indexCount++] = index + 1;\n indices[indexCount++] = index + 2;\n indices[indexCount++] = index + 2;\n indices[indexCount++] = index + 1;\n indices[indexCount++] = index + 3;\n }\n // ensure that the changes are uploaded\n uvBuffer.update();\n indexBuffer.update();\n this.updateVertices();\n };\n /**\n * refreshes vertices of Rope mesh\n */\n RopeGeometry.prototype.updateVertices = function () {\n var points = this.points;\n if (points.length < 1) {\n return;\n }\n var lastPoint = points[0];\n var nextPoint;\n var perpX = 0;\n var perpY = 0;\n var vertices = this.buffers[0].data;\n var total = points.length;\n for (var i = 0; i < total; i++) {\n var point = points[i];\n var index = i * 4;\n if (i < points.length - 1) {\n nextPoint = points[i + 1];\n }\n else {\n nextPoint = point;\n }\n perpY = -(nextPoint.x - lastPoint.x);\n perpX = nextPoint.y - lastPoint.y;\n var perpLength = Math.sqrt((perpX * perpX) + (perpY * perpY));\n var num = this.textureScale > 0 ? this.textureScale * this._width / 2 : this._width / 2;\n perpX /= perpLength;\n perpY /= perpLength;\n perpX *= num;\n perpY *= num;\n vertices[index] = point.x + perpX;\n vertices[index + 1] = point.y + perpY;\n vertices[index + 2] = point.x - perpX;\n vertices[index + 3] = point.y - perpY;\n lastPoint = point;\n }\n this.buffers[0].update();\n };\n RopeGeometry.prototype.update = function () {\n if (this.textureScale > 0) {\n this.build(); // we need to update UVs\n }\n else {\n this.updateVertices();\n }\n };\n return RopeGeometry;\n}(MeshGeometry));\n\n/**\n * The rope allows you to draw a texture across several points and then manipulate these points\n *\n *```js\n * for (let i = 0; i < 20; i++) {\n * points.push(new PIXI.Point(i * 50, 0));\n * };\n * let rope = new PIXI.SimpleRope(PIXI.Texture.from(\"snake.png\"), points);\n * ```\n *\n * @class\n * @extends PIXI.Mesh\n * @memberof PIXI\n *\n */\nvar SimpleRope = /** @class */ (function (_super) {\n __extends(SimpleRope, _super);\n /**\n * @param {PIXI.Texture} texture - The texture to use on the rope.\n * @param {PIXI.Point[]} points - An array of {@link PIXI.Point} objects to construct this rope.\n * @param {number} [textureScale=0] - Optional. Positive values scale rope texture\n * keeping its aspect ratio. You can reduce alpha channel artifacts by providing a larger texture\n * and downsampling here. If set to zero, texture will be streched instead.\n */\n function SimpleRope(texture, points, textureScale) {\n if (textureScale === void 0) { textureScale = 0; }\n var _this = this;\n var ropeGeometry = new RopeGeometry(texture.height, points, textureScale);\n var meshMaterial = new MeshMaterial(texture);\n if (textureScale > 0) {\n // attempt to set UV wrapping, will fail on non-power of two textures\n texture.baseTexture.wrapMode = WRAP_MODES.REPEAT;\n }\n _this = _super.call(this, ropeGeometry, meshMaterial) || this;\n /**\n * re-calculate vertices by rope points each frame\n *\n * @member {boolean}\n */\n _this.autoUpdate = true;\n return _this;\n }\n SimpleRope.prototype._render = function (renderer) {\n var geometry = this.geometry;\n if (this.autoUpdate || geometry._width !== this.shader.texture.height) {\n geometry._width = this.shader.texture.height;\n geometry.update();\n }\n _super.prototype._render.call(this, renderer);\n };\n return SimpleRope;\n}(Mesh));\n\n/**\n * The SimplePlane allows you to draw a texture across several points and then manipulate these points\n *\n *```js\n * for (let i = 0; i < 20; i++) {\n * points.push(new PIXI.Point(i * 50, 0));\n * };\n * let SimplePlane = new PIXI.SimplePlane(PIXI.Texture.from(\"snake.png\"), points);\n * ```\n *\n * @class\n * @extends PIXI.Mesh\n * @memberof PIXI\n *\n */\nvar SimplePlane = /** @class */ (function (_super) {\n __extends(SimplePlane, _super);\n /**\n * @param {PIXI.Texture} texture - The texture to use on the SimplePlane.\n * @param {number} verticesX - The number of vertices in the x-axis\n * @param {number} verticesY - The number of vertices in the y-axis\n */\n function SimplePlane(texture, verticesX, verticesY) {\n var _this = this;\n var planeGeometry = new PlaneGeometry(texture.width, texture.height, verticesX, verticesY);\n var meshMaterial = new MeshMaterial(Texture.WHITE);\n _this = _super.call(this, planeGeometry, meshMaterial) || this;\n // lets call the setter to ensure all necessary updates are performed\n _this.texture = texture;\n return _this;\n }\n /**\n * Method used for overrides, to do something in case texture frame was changed.\n * Meshes based on plane can override it and change more details based on texture.\n */\n SimplePlane.prototype.textureUpdated = function () {\n this._textureID = this.shader.texture._updateID;\n var geometry = this.geometry;\n geometry.width = this.shader.texture.width;\n geometry.height = this.shader.texture.height;\n geometry.build();\n };\n Object.defineProperty(SimplePlane.prototype, \"texture\", {\n get: function () {\n return this.shader.texture;\n },\n set: function (value) {\n // Track texture same way sprite does.\n // For generated meshes like NineSlicePlane it can change the geometry.\n // Unfortunately, this method might not work if you directly change texture in material.\n if (this.shader.texture === value) {\n return;\n }\n this.shader.texture = value;\n this._textureID = -1;\n if (value.baseTexture.valid) {\n this.textureUpdated();\n }\n else {\n value.once('update', this.textureUpdated, this);\n }\n },\n enumerable: false,\n configurable: true\n });\n SimplePlane.prototype._render = function (renderer) {\n if (this._textureID !== this.shader.texture._updateID) {\n this.textureUpdated();\n }\n _super.prototype._render.call(this, renderer);\n };\n SimplePlane.prototype.destroy = function (options) {\n this.shader.texture.off('update', this.textureUpdated, this);\n _super.prototype.destroy.call(this, options);\n };\n return SimplePlane;\n}(Mesh));\n\n/**\n * The Simple Mesh class mimics Mesh in PixiJS v4, providing easy-to-use constructor arguments.\n * For more robust customization, use {@link PIXI.Mesh}.\n *\n * @class\n * @extends PIXI.Mesh\n * @memberof PIXI\n */\nvar SimpleMesh = /** @class */ (function (_super) {\n __extends(SimpleMesh, _super);\n /**\n * @param {PIXI.Texture} [texture=Texture.EMPTY] - The texture to use\n * @param {Float32Array} [vertices] - if you want to specify the vertices\n * @param {Float32Array} [uvs] - if you want to specify the uvs\n * @param {Uint16Array} [indices] - if you want to specify the indices\n * @param {number} [drawMode] - the drawMode, can be any of the Mesh.DRAW_MODES consts\n */\n function SimpleMesh(texture, vertices, uvs, indices, drawMode) {\n if (texture === void 0) { texture = Texture.EMPTY; }\n var _this = this;\n var geometry = new MeshGeometry(vertices, uvs, indices);\n geometry.getBuffer('aVertexPosition').static = false;\n var meshMaterial = new MeshMaterial(texture);\n _this = _super.call(this, geometry, meshMaterial, null, drawMode) || this;\n /**\n * upload vertices buffer each frame\n * @member {boolean}\n */\n _this.autoUpdate = true;\n return _this;\n }\n Object.defineProperty(SimpleMesh.prototype, \"vertices\", {\n /**\n * Collection of vertices data.\n * @member {Float32Array}\n */\n get: function () {\n return this.geometry.getBuffer('aVertexPosition').data;\n },\n set: function (value) {\n this.geometry.getBuffer('aVertexPosition').data = value;\n },\n enumerable: false,\n configurable: true\n });\n SimpleMesh.prototype._render = function (renderer) {\n if (this.autoUpdate) {\n this.geometry.getBuffer('aVertexPosition').update();\n }\n _super.prototype._render.call(this, renderer);\n };\n return SimpleMesh;\n}(Mesh));\n\nvar DEFAULT_BORDER_SIZE = 10;\n/**\n * The NineSlicePlane allows you to stretch a texture using 9-slice scaling. The corners will remain unscaled (useful\n * for buttons with rounded corners for example) and the other areas will be scaled horizontally and or vertically\n *\n *```js\n * let Plane9 = new PIXI.NineSlicePlane(PIXI.Texture.from('BoxWithRoundedCorners.png'), 15, 15, 15, 15);\n * ```\n *
\n *      A                          B\n *    +---+----------------------+---+\n *  C | 1 |          2           | 3 |\n *    +---+----------------------+---+\n *    |   |                      |   |\n *    | 4 |          5           | 6 |\n *    |   |                      |   |\n *    +---+----------------------+---+\n *  D | 7 |          8           | 9 |\n *    +---+----------------------+---+\n\n *  When changing this objects width and/or height:\n *     areas 1 3 7 and 9 will remain unscaled.\n *     areas 2 and 8 will be stretched horizontally\n *     areas 4 and 6 will be stretched vertically\n *     area 5 will be stretched both horizontally and vertically\n * 
\n *\n * @class\n * @extends PIXI.SimplePlane\n * @memberof PIXI\n *\n */\nvar NineSlicePlane = /** @class */ (function (_super) {\n __extends(NineSlicePlane, _super);\n /**\n * @param {PIXI.Texture} texture - The texture to use on the NineSlicePlane.\n * @param {number} [leftWidth=10] - size of the left vertical bar (A)\n * @param {number} [topHeight=10] - size of the top horizontal bar (C)\n * @param {number} [rightWidth=10] - size of the right vertical bar (B)\n * @param {number} [bottomHeight=10] - size of the bottom horizontal bar (D)\n */\n function NineSlicePlane(texture, leftWidth, topHeight, rightWidth, bottomHeight) {\n if (leftWidth === void 0) { leftWidth = DEFAULT_BORDER_SIZE; }\n if (topHeight === void 0) { topHeight = DEFAULT_BORDER_SIZE; }\n if (rightWidth === void 0) { rightWidth = DEFAULT_BORDER_SIZE; }\n if (bottomHeight === void 0) { bottomHeight = DEFAULT_BORDER_SIZE; }\n var _this = _super.call(this, Texture.WHITE, 4, 4) || this;\n _this._origWidth = texture.orig.width;\n _this._origHeight = texture.orig.height;\n /**\n * The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n * @override\n */\n _this._width = _this._origWidth;\n /**\n * The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n * @override\n */\n _this._height = _this._origHeight;\n /**\n * The width of the left column (a)\n *\n * @member {number}\n * @private\n */\n _this._leftWidth = leftWidth;\n /**\n * The width of the right column (b)\n *\n * @member {number}\n * @private\n */\n _this._rightWidth = rightWidth;\n /**\n * The height of the top row (c)\n *\n * @member {number}\n * @private\n */\n _this._topHeight = topHeight;\n /**\n * The height of the bottom row (d)\n *\n * @member {number}\n * @private\n */\n _this._bottomHeight = bottomHeight;\n // lets call the setter to ensure all necessary updates are performed\n _this.texture = texture;\n return _this;\n }\n NineSlicePlane.prototype.textureUpdated = function () {\n this._textureID = this.shader.texture._updateID;\n this._refresh();\n };\n Object.defineProperty(NineSlicePlane.prototype, \"vertices\", {\n get: function () {\n return this.geometry.getBuffer('aVertexPosition').data;\n },\n set: function (value) {\n this.geometry.getBuffer('aVertexPosition').data = value;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Updates the horizontal vertices.\n *\n */\n NineSlicePlane.prototype.updateHorizontalVertices = function () {\n var vertices = this.vertices;\n var scale = this._getMinScale();\n vertices[9] = vertices[11] = vertices[13] = vertices[15] = this._topHeight * scale;\n vertices[17] = vertices[19] = vertices[21] = vertices[23] = this._height - (this._bottomHeight * scale);\n vertices[25] = vertices[27] = vertices[29] = vertices[31] = this._height;\n };\n /**\n * Updates the vertical vertices.\n *\n */\n NineSlicePlane.prototype.updateVerticalVertices = function () {\n var vertices = this.vertices;\n var scale = this._getMinScale();\n vertices[2] = vertices[10] = vertices[18] = vertices[26] = this._leftWidth * scale;\n vertices[4] = vertices[12] = vertices[20] = vertices[28] = this._width - (this._rightWidth * scale);\n vertices[6] = vertices[14] = vertices[22] = vertices[30] = this._width;\n };\n /**\n * Returns the smaller of a set of vertical and horizontal scale of nine slice corners.\n *\n * @return {number} Smaller number of vertical and horizontal scale.\n * @private\n */\n NineSlicePlane.prototype._getMinScale = function () {\n var w = this._leftWidth + this._rightWidth;\n var scaleW = this._width > w ? 1.0 : this._width / w;\n var h = this._topHeight + this._bottomHeight;\n var scaleH = this._height > h ? 1.0 : this._height / h;\n var scale = Math.min(scaleW, scaleH);\n return scale;\n };\n Object.defineProperty(NineSlicePlane.prototype, \"width\", {\n /**\n * The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n */\n get: function () {\n return this._width;\n },\n set: function (value) {\n this._width = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NineSlicePlane.prototype, \"height\", {\n /**\n * The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane\n *\n * @member {number}\n */\n get: function () {\n return this._height;\n },\n set: function (value) {\n this._height = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NineSlicePlane.prototype, \"leftWidth\", {\n /**\n * The width of the left column\n *\n * @member {number}\n */\n get: function () {\n return this._leftWidth;\n },\n set: function (value) {\n this._leftWidth = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NineSlicePlane.prototype, \"rightWidth\", {\n /**\n * The width of the right column\n *\n * @member {number}\n */\n get: function () {\n return this._rightWidth;\n },\n set: function (value) {\n this._rightWidth = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NineSlicePlane.prototype, \"topHeight\", {\n /**\n * The height of the top row\n *\n * @member {number}\n */\n get: function () {\n return this._topHeight;\n },\n set: function (value) {\n this._topHeight = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NineSlicePlane.prototype, \"bottomHeight\", {\n /**\n * The height of the bottom row\n *\n * @member {number}\n */\n get: function () {\n return this._bottomHeight;\n },\n set: function (value) {\n this._bottomHeight = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Refreshes NineSlicePlane coords. All of them.\n */\n NineSlicePlane.prototype._refresh = function () {\n var texture = this.texture;\n var uvs = this.geometry.buffers[1].data;\n this._origWidth = texture.orig.width;\n this._origHeight = texture.orig.height;\n var _uvw = 1.0 / this._origWidth;\n var _uvh = 1.0 / this._origHeight;\n uvs[0] = uvs[8] = uvs[16] = uvs[24] = 0;\n uvs[1] = uvs[3] = uvs[5] = uvs[7] = 0;\n uvs[6] = uvs[14] = uvs[22] = uvs[30] = 1;\n uvs[25] = uvs[27] = uvs[29] = uvs[31] = 1;\n uvs[2] = uvs[10] = uvs[18] = uvs[26] = _uvw * this._leftWidth;\n uvs[4] = uvs[12] = uvs[20] = uvs[28] = 1 - (_uvw * this._rightWidth);\n uvs[9] = uvs[11] = uvs[13] = uvs[15] = _uvh * this._topHeight;\n uvs[17] = uvs[19] = uvs[21] = uvs[23] = 1 - (_uvh * this._bottomHeight);\n this.updateHorizontalVertices();\n this.updateVerticalVertices();\n this.geometry.buffers[0].update();\n this.geometry.buffers[1].update();\n };\n return NineSlicePlane;\n}(SimplePlane));\n\nexport { NineSlicePlane, PlaneGeometry, RopeGeometry, SimpleMesh, SimplePlane, SimpleRope };\n//# sourceMappingURL=mesh-extras.es.js.map\n","/*!\n * @pixi/sprite-animated - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/sprite-animated is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Texture } from '@pixi/core';\nimport { Sprite } from '@pixi/sprite';\nimport { Ticker, UPDATE_PRIORITY } from '@pixi/ticker';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * An AnimatedSprite is a simple way to display an animation depicted by a list of textures.\n *\n * ```js\n * let alienImages = [\"image_sequence_01.png\",\"image_sequence_02.png\",\"image_sequence_03.png\",\"image_sequence_04.png\"];\n * let textureArray = [];\n *\n * for (let i=0; i < 4; i++)\n * {\n * let texture = PIXI.Texture.from(alienImages[i]);\n * textureArray.push(texture);\n * };\n *\n * let animatedSprite = new PIXI.AnimatedSprite(textureArray);\n * ```\n *\n * The more efficient and simpler way to create an animated sprite is using a {@link PIXI.Spritesheet}\n * containing the animation definitions:\n *\n * ```js\n * PIXI.Loader.shared.add(\"assets/spritesheet.json\").load(setup);\n *\n * function setup() {\n * let sheet = PIXI.Loader.shared.resources[\"assets/spritesheet.json\"].spritesheet;\n * animatedSprite = new PIXI.AnimatedSprite(sheet.animations[\"image_sequence\"]);\n * ...\n * }\n * ```\n *\n * @class\n * @extends PIXI.Sprite\n * @memberof PIXI\n */\nvar AnimatedSprite = /** @class */ (function (_super) {\n __extends(AnimatedSprite, _super);\n /**\n * @param {PIXI.Texture[]|PIXI.AnimatedSprite.FrameObject[]} textures - An array of {@link PIXI.Texture} or frame\n * objects that make up the animation.\n * @param {boolean} [autoUpdate=true] - Whether to use PIXI.Ticker.shared to auto update animation time.\n */\n function AnimatedSprite(textures, autoUpdate) {\n if (autoUpdate === void 0) { autoUpdate = true; }\n var _this = _super.call(this, textures[0] instanceof Texture ? textures[0] : textures[0].texture) || this;\n /**\n * @type {PIXI.Texture[]}\n * @private\n */\n _this._textures = null;\n /**\n * @type {number[]}\n * @private\n */\n _this._durations = null;\n /**\n * `true` uses PIXI.Ticker.shared to auto update animation time.\n *\n * @type {boolean}\n * @default true\n * @private\n */\n _this._autoUpdate = autoUpdate;\n /**\n * `true` if the instance is currently connected to PIXI.Ticker.shared to auto update animation time.\n *\n * @type {boolean}\n * @default false\n * @private\n */\n _this._isConnectedToTicker = false;\n /**\n * The speed that the AnimatedSprite will play at. Higher is faster, lower is slower.\n *\n * @member {number}\n * @default 1\n */\n _this.animationSpeed = 1;\n /**\n * Whether or not the animate sprite repeats after playing.\n *\n * @member {boolean}\n * @default true\n */\n _this.loop = true;\n /**\n * Update anchor to [Texture's defaultAnchor]{@link PIXI.Texture#defaultAnchor} when frame changes.\n *\n * Useful with [sprite sheet animations]{@link PIXI.Spritesheet#animations} created with tools.\n * Changing anchor for each frame allows to pin sprite origin to certain moving feature\n * of the frame (e.g. left foot).\n *\n * Note: Enabling this will override any previously set `anchor` on each frame change.\n *\n * @member {boolean}\n * @default false\n */\n _this.updateAnchor = false;\n /**\n * User-assigned function to call when an AnimatedSprite finishes playing.\n *\n * @example\n * animation.onComplete = function () {\n * // finished!\n * };\n * @member {Function}\n */\n _this.onComplete = null;\n /**\n * User-assigned function to call when an AnimatedSprite changes which texture is being rendered.\n *\n * @example\n * animation.onFrameChange = function () {\n * // updated!\n * };\n * @member {Function}\n */\n _this.onFrameChange = null;\n /**\n * User-assigned function to call when `loop` is true, and an AnimatedSprite is played and\n * loops around to start again.\n *\n * @example\n * animation.onLoop = function () {\n * // looped!\n * };\n * @member {Function}\n */\n _this.onLoop = null;\n /**\n * Elapsed time since animation has been started, used internally to display current texture.\n *\n * @member {number}\n * @private\n */\n _this._currentTime = 0;\n _this._playing = false;\n /**\n * The texture index that was displayed last time\n *\n * @member {number}\n * @private\n */\n _this._previousFrame = null;\n _this.textures = textures;\n return _this;\n }\n /**\n * Stops the AnimatedSprite.\n *\n */\n AnimatedSprite.prototype.stop = function () {\n if (!this._playing) {\n return;\n }\n this._playing = false;\n if (this._autoUpdate && this._isConnectedToTicker) {\n Ticker.shared.remove(this.update, this);\n this._isConnectedToTicker = false;\n }\n };\n /**\n * Plays the AnimatedSprite.\n *\n */\n AnimatedSprite.prototype.play = function () {\n if (this._playing) {\n return;\n }\n this._playing = true;\n if (this._autoUpdate && !this._isConnectedToTicker) {\n Ticker.shared.add(this.update, this, UPDATE_PRIORITY.HIGH);\n this._isConnectedToTicker = true;\n }\n };\n /**\n * Stops the AnimatedSprite and goes to a specific frame.\n *\n * @param {number} frameNumber - Frame index to stop at.\n */\n AnimatedSprite.prototype.gotoAndStop = function (frameNumber) {\n this.stop();\n var previousFrame = this.currentFrame;\n this._currentTime = frameNumber;\n if (previousFrame !== this.currentFrame) {\n this.updateTexture();\n }\n };\n /**\n * Goes to a specific frame and begins playing the AnimatedSprite.\n *\n * @param {number} frameNumber - Frame index to start at.\n */\n AnimatedSprite.prototype.gotoAndPlay = function (frameNumber) {\n var previousFrame = this.currentFrame;\n this._currentTime = frameNumber;\n if (previousFrame !== this.currentFrame) {\n this.updateTexture();\n }\n this.play();\n };\n /**\n * Updates the object transform for rendering.\n *\n * @param {number} deltaTime - Time since last tick.\n */\n AnimatedSprite.prototype.update = function (deltaTime) {\n var elapsed = this.animationSpeed * deltaTime;\n var previousFrame = this.currentFrame;\n if (this._durations !== null) {\n var lag = this._currentTime % 1 * this._durations[this.currentFrame];\n lag += elapsed / 60 * 1000;\n while (lag < 0) {\n this._currentTime--;\n lag += this._durations[this.currentFrame];\n }\n var sign = Math.sign(this.animationSpeed * deltaTime);\n this._currentTime = Math.floor(this._currentTime);\n while (lag >= this._durations[this.currentFrame]) {\n lag -= this._durations[this.currentFrame] * sign;\n this._currentTime += sign;\n }\n this._currentTime += lag / this._durations[this.currentFrame];\n }\n else {\n this._currentTime += elapsed;\n }\n if (this._currentTime < 0 && !this.loop) {\n this.gotoAndStop(0);\n if (this.onComplete) {\n this.onComplete();\n }\n }\n else if (this._currentTime >= this._textures.length && !this.loop) {\n this.gotoAndStop(this._textures.length - 1);\n if (this.onComplete) {\n this.onComplete();\n }\n }\n else if (previousFrame !== this.currentFrame) {\n if (this.loop && this.onLoop) {\n if (this.animationSpeed > 0 && this.currentFrame < previousFrame) {\n this.onLoop();\n }\n else if (this.animationSpeed < 0 && this.currentFrame > previousFrame) {\n this.onLoop();\n }\n }\n this.updateTexture();\n }\n };\n /**\n * Updates the displayed texture to match the current frame index.\n *\n * @private\n */\n AnimatedSprite.prototype.updateTexture = function () {\n var currentFrame = this.currentFrame;\n if (this._previousFrame === currentFrame) {\n return;\n }\n this._previousFrame = currentFrame;\n this._texture = this._textures[currentFrame];\n this._textureID = -1;\n this._textureTrimmedID = -1;\n this._cachedTint = 0xFFFFFF;\n this.uvs = this._texture._uvs.uvsFloat32;\n if (this.updateAnchor) {\n this._anchor.copyFrom(this._texture.defaultAnchor);\n }\n if (this.onFrameChange) {\n this.onFrameChange(this.currentFrame);\n }\n };\n /**\n * Stops the AnimatedSprite and destroys it.\n *\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value.\n * @param {boolean} [options.children=false] - If set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well.\n * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well.\n */\n AnimatedSprite.prototype.destroy = function (options) {\n this.stop();\n _super.prototype.destroy.call(this, options);\n this.onComplete = null;\n this.onFrameChange = null;\n this.onLoop = null;\n };\n /**\n * A short hand way of creating an AnimatedSprite from an array of frame ids.\n *\n * @static\n * @param {string[]} frames - The array of frames ids the AnimatedSprite will use as its texture frames.\n * @return {PIXI.AnimatedSprite} The new animated sprite with the specified frames.\n */\n AnimatedSprite.fromFrames = function (frames) {\n var textures = [];\n for (var i = 0; i < frames.length; ++i) {\n textures.push(Texture.from(frames[i]));\n }\n return new AnimatedSprite(textures);\n };\n /**\n * A short hand way of creating an AnimatedSprite from an array of image ids.\n *\n * @static\n * @param {string[]} images - The array of image urls the AnimatedSprite will use as its texture frames.\n * @return {PIXI.AnimatedSprite} The new animate sprite with the specified images as frames.\n */\n AnimatedSprite.fromImages = function (images) {\n var textures = [];\n for (var i = 0; i < images.length; ++i) {\n textures.push(Texture.from(images[i]));\n }\n return new AnimatedSprite(textures);\n };\n Object.defineProperty(AnimatedSprite.prototype, \"totalFrames\", {\n /**\n * The total number of frames in the AnimatedSprite. This is the same as number of textures\n * assigned to the AnimatedSprite.\n *\n * @readonly\n * @member {number}\n * @default 0\n */\n get: function () {\n return this._textures.length;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AnimatedSprite.prototype, \"textures\", {\n /**\n * The array of textures used for this AnimatedSprite.\n *\n * @member {PIXI.Texture[]}\n */\n get: function () {\n return this._textures;\n },\n set: function (value) {\n if (value[0] instanceof Texture) {\n this._textures = value;\n this._durations = null;\n }\n else {\n this._textures = [];\n this._durations = [];\n for (var i = 0; i < value.length; i++) {\n this._textures.push(value[i].texture);\n this._durations.push(value[i].time);\n }\n }\n this._previousFrame = null;\n this.gotoAndStop(0);\n this.updateTexture();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AnimatedSprite.prototype, \"currentFrame\", {\n /**\n * The AnimatedSprites current frame index.\n *\n * @member {number}\n * @readonly\n */\n get: function () {\n var currentFrame = Math.floor(this._currentTime) % this._textures.length;\n if (currentFrame < 0) {\n currentFrame += this._textures.length;\n }\n return currentFrame;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AnimatedSprite.prototype, \"playing\", {\n /**\n * Indicates if the AnimatedSprite is currently playing.\n *\n * @member {boolean}\n * @readonly\n */\n get: function () {\n return this._playing;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AnimatedSprite.prototype, \"autoUpdate\", {\n /**\n * Whether to use PIXI.Ticker.shared to auto update animation time\n *\n * @member {boolean}\n */\n get: function () {\n return this._autoUpdate;\n },\n set: function (value) {\n if (value !== this._autoUpdate) {\n this._autoUpdate = value;\n if (!this._autoUpdate && this._isConnectedToTicker) {\n Ticker.shared.remove(this.update, this);\n this._isConnectedToTicker = false;\n }\n else if (this._autoUpdate && !this._isConnectedToTicker && this._playing) {\n Ticker.shared.add(this.update, this);\n this._isConnectedToTicker = true;\n }\n }\n },\n enumerable: false,\n configurable: true\n });\n return AnimatedSprite;\n}(Sprite));\n/**\n * @memberof PIXI.AnimatedSprite\n * @typedef {object} FrameObject\n * @type {object}\n * @property {PIXI.Texture} texture - The {@link PIXI.Texture} of the frame\n * @property {number} time - the duration of the frame in ms\n */\n\nexport { AnimatedSprite };\n//# sourceMappingURL=sprite-animated.es.js.map\n","/*!\n * pixi.js - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * pixi.js is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport '@pixi/polyfill';\nimport { deprecation } from '@pixi/utils';\nimport * as utils from '@pixi/utils';\nexport { utils };\nimport { AccessibilityManager } from '@pixi/accessibility';\nexport * from '@pixi/accessibility';\nimport { InteractionManager } from '@pixi/interaction';\nexport * from '@pixi/interaction';\nimport { Application } from '@pixi/app';\nexport * from '@pixi/app';\nimport { Renderer, BatchRenderer } from '@pixi/core';\nexport * from '@pixi/core';\nimport { Extract } from '@pixi/extract';\nexport * from '@pixi/extract';\nimport { Loader, AppLoaderPlugin } from '@pixi/loaders';\nexport * from '@pixi/loaders';\nimport { ParticleRenderer } from '@pixi/particles';\nexport * from '@pixi/particles';\nimport { Prepare } from '@pixi/prepare';\nexport * from '@pixi/prepare';\nimport { SpritesheetLoader } from '@pixi/spritesheet';\nexport * from '@pixi/spritesheet';\nimport { TilingSpriteRenderer } from '@pixi/sprite-tiling';\nexport * from '@pixi/sprite-tiling';\nimport { BitmapFontLoader } from '@pixi/text-bitmap';\nexport * from '@pixi/text-bitmap';\nimport { TickerPlugin } from '@pixi/ticker';\nexport * from '@pixi/ticker';\nimport { AlphaFilter } from '@pixi/filter-alpha';\nimport { BlurFilter, BlurFilterPass } from '@pixi/filter-blur';\nimport { ColorMatrixFilter } from '@pixi/filter-color-matrix';\nimport { DisplacementFilter } from '@pixi/filter-displacement';\nimport { FXAAFilter } from '@pixi/filter-fxaa';\nimport { NoiseFilter } from '@pixi/filter-noise';\nimport '@pixi/mixin-cache-as-bitmap';\nimport '@pixi/mixin-get-child-by-name';\nimport '@pixi/mixin-get-global-position';\nexport * from '@pixi/constants';\nexport * from '@pixi/display';\nexport * from '@pixi/graphics';\nexport * from '@pixi/math';\nexport * from '@pixi/mesh';\nexport * from '@pixi/mesh-extras';\nexport * from '@pixi/runner';\nexport * from '@pixi/sprite';\nexport * from '@pixi/sprite-animated';\nexport * from '@pixi/text';\nexport * from '@pixi/settings';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar v5 = '5.0.0';\n/**\n * Deprecations (backward compatibilities) are automatically applied for browser bundles\n * in the UMD module format. If using Webpack or Rollup, you'll need to apply these\n * deprecations manually by doing something like this:\n * @example\n * import * as PIXI from 'pixi.js';\n * PIXI.useDeprecated(); // MUST be bound to namespace\n * @memberof PIXI\n * @function useDeprecated\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nfunction useDeprecated() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var PIXI = this;\n Object.defineProperties(PIXI, {\n /**\n * @constant {RegExp|string} SVG_SIZE\n * @memberof PIXI\n * @see PIXI.resources.SVGResource.SVG_SIZE\n * @deprecated since 5.0.0\n */\n SVG_SIZE: {\n get: function () {\n deprecation(v5, 'PIXI.utils.SVG_SIZE property has moved to PIXI.resources.SVGResource.SVG_SIZE');\n return PIXI.SVGResource.SVG_SIZE;\n },\n },\n /**\n * @class PIXI.TransformStatic\n * @deprecated since 5.0.0\n * @see PIXI.Transform\n */\n TransformStatic: {\n get: function () {\n deprecation(v5, 'PIXI.TransformStatic class has been removed, use PIXI.Transform');\n return PIXI.Transform;\n },\n },\n /**\n * @class PIXI.TransformBase\n * @deprecated since 5.0.0\n * @see PIXI.Transform\n */\n TransformBase: {\n get: function () {\n deprecation(v5, 'PIXI.TransformBase class has been removed, use PIXI.Transform');\n return PIXI.Transform;\n },\n },\n /**\n * Constants that specify the transform type.\n *\n * @static\n * @constant\n * @name TRANSFORM_MODE\n * @memberof PIXI\n * @enum {number}\n * @deprecated since 5.0.0\n * @property {number} STATIC\n * @property {number} DYNAMIC\n */\n TRANSFORM_MODE: {\n get: function () {\n deprecation(v5, 'PIXI.TRANSFORM_MODE property has been removed');\n return { STATIC: 0, DYNAMIC: 1 };\n },\n },\n /**\n * @class PIXI.WebGLRenderer\n * @see PIXI.Renderer\n * @deprecated since 5.0.0\n */\n WebGLRenderer: {\n get: function () {\n deprecation(v5, 'PIXI.WebGLRenderer class has moved to PIXI.Renderer');\n return PIXI.Renderer;\n },\n },\n /**\n * @class PIXI.CanvasRenderTarget\n * @see PIXI.utils.CanvasRenderTarget\n * @deprecated since 5.0.0\n */\n CanvasRenderTarget: {\n get: function () {\n deprecation(v5, 'PIXI.CanvasRenderTarget class has moved to PIXI.utils.CanvasRenderTarget');\n return PIXI.utils.CanvasRenderTarget;\n },\n },\n /**\n * @memberof PIXI\n * @name loader\n * @type {PIXI.Loader}\n * @see PIXI.Loader.shared\n * @deprecated since 5.0.0\n */\n loader: {\n get: function () {\n deprecation(v5, 'PIXI.loader instance has moved to PIXI.Loader.shared');\n return PIXI.Loader.shared;\n },\n },\n /**\n * @class PIXI.FilterManager\n * @see PIXI.systems.FilterSystem\n * @deprecated since 5.0.0\n */\n FilterManager: {\n get: function () {\n deprecation(v5, 'PIXI.FilterManager class has moved to PIXI.systems.FilterSystem');\n return PIXI.systems.FilterSystem;\n },\n },\n /**\n * @namespace PIXI.CanvasTinter\n * @see PIXI.canvasUtils\n * @deprecated since 5.2.0\n */\n CanvasTinter: {\n get: function () {\n deprecation('5.2.0', 'PIXI.CanvasTinter namespace has moved to PIXI.canvasUtils');\n return PIXI.canvasUtils;\n },\n },\n /**\n * @namespace PIXI.GroupD8\n * @see PIXI.groupD8\n * @deprecated since 5.2.0\n */\n GroupD8: {\n get: function () {\n deprecation('5.2.0', 'PIXI.GroupD8 namespace has moved to PIXI.groupD8');\n return PIXI.groupD8;\n },\n },\n });\n /**\n * @namespace PIXI.accessibility\n * @see PIXI\n * @deprecated since 5.3.0\n */\n PIXI.accessibility = {};\n Object.defineProperties(PIXI.accessibility, {\n /**\n * @class PIXI.accessibility.AccessibilityManager\n * @deprecated since 5.3.0\n * @see PIXI.AccessibilityManager\n */\n AccessibilityManager: {\n get: function () {\n deprecation('5.3.0', 'PIXI.accessibility.AccessibilityManager moved to PIXI.AccessibilityManager');\n return PIXI.AccessibilityManager;\n },\n },\n });\n /**\n * @namespace PIXI.interaction\n * @see PIXI\n * @deprecated since 5.3.0\n */\n PIXI.interaction = {};\n Object.defineProperties(PIXI.interaction, {\n /**\n * @class PIXI.interaction.InteractionManager\n * @deprecated since 5.3.0\n * @see PIXI.InteractionManager\n */\n InteractionManager: {\n get: function () {\n deprecation('5.3.0', 'PIXI.interaction.InteractionManager moved to PIXI.InteractionManager');\n return PIXI.InteractionManager;\n },\n },\n /**\n * @class PIXI.interaction.InteractionData\n * @deprecated since 5.3.0\n * @see PIXI.InteractionData\n */\n InteractionData: {\n get: function () {\n deprecation('5.3.0', 'PIXI.interaction.InteractionData moved to PIXI.InteractionData');\n return PIXI.InteractionData;\n },\n },\n /**\n * @class PIXI.interaction.InteractionEvent\n * @deprecated since 5.3.0\n * @see PIXI.InteractionEvent\n */\n InteractionEvent: {\n get: function () {\n deprecation('5.3.0', 'PIXI.interaction.InteractionEvent moved to PIXI.InteractionEvent');\n return PIXI.InteractionEvent;\n },\n },\n });\n /**\n * @namespace PIXI.prepare\n * @see PIXI\n * @deprecated since 5.2.1\n */\n PIXI.prepare = {};\n Object.defineProperties(PIXI.prepare, {\n /**\n * @class PIXI.prepare.BasePrepare\n * @deprecated since 5.2.1\n * @see PIXI.BasePrepare\n */\n BasePrepare: {\n get: function () {\n deprecation('5.2.1', 'PIXI.prepare.BasePrepare moved to PIXI.BasePrepare');\n return PIXI.BasePrepare;\n },\n },\n /**\n * @class PIXI.prepare.Prepare\n * @deprecated since 5.2.1\n * @see PIXI.Prepare\n */\n Prepare: {\n get: function () {\n deprecation('5.2.1', 'PIXI.prepare.Prepare moved to PIXI.Prepare');\n return PIXI.Prepare;\n },\n },\n /**\n * @class PIXI.prepare.CanvasPrepare\n * @deprecated since 5.2.1\n * @see PIXI.CanvasPrepare\n */\n CanvasPrepare: {\n get: function () {\n deprecation('5.2.1', 'PIXI.prepare.CanvasPrepare moved to PIXI.CanvasPrepare');\n return PIXI.CanvasPrepare;\n },\n },\n });\n /**\n * @namespace PIXI.extract\n * @see PIXI\n * @deprecated since 5.2.1\n */\n PIXI.extract = {};\n Object.defineProperties(PIXI.extract, {\n /**\n * @class PIXI.extract.Extract\n * @deprecated since 5.2.1\n * @see PIXI.Extract\n */\n Extract: {\n get: function () {\n deprecation('5.2.1', 'PIXI.extract.Extract moved to PIXI.Extract');\n return PIXI.Extract;\n },\n },\n /**\n * @class PIXI.extract.CanvasExtract\n * @deprecated since 5.2.1\n * @see PIXI.CanvasExtract\n */\n CanvasExtract: {\n get: function () {\n deprecation('5.2.1', 'PIXI.extract.CanvasExtract moved to PIXI.CanvasExtract');\n return PIXI.CanvasExtract;\n },\n },\n });\n /**\n * This namespace has been removed. All classes previous nested\n * under this namespace have been moved to the top-level `PIXI` object.\n * @namespace PIXI.extras\n * @deprecated since 5.0.0\n */\n PIXI.extras = {};\n Object.defineProperties(PIXI.extras, {\n /**\n * @class PIXI.extras.TilingSprite\n * @see PIXI.TilingSprite\n * @deprecated since 5.0.0\n */\n TilingSprite: {\n get: function () {\n deprecation(v5, 'PIXI.extras.TilingSprite class has moved to PIXI.TilingSprite');\n return PIXI.TilingSprite;\n },\n },\n /**\n * @class PIXI.extras.TilingSpriteRenderer\n * @see PIXI.TilingSpriteRenderer\n * @deprecated since 5.0.0\n */\n TilingSpriteRenderer: {\n get: function () {\n deprecation(v5, 'PIXI.extras.TilingSpriteRenderer class has moved to PIXI.TilingSpriteRenderer');\n return PIXI.TilingSpriteRenderer;\n },\n },\n /**\n * @class PIXI.extras.AnimatedSprite\n * @see PIXI.AnimatedSprite\n * @deprecated since 5.0.0\n */\n AnimatedSprite: {\n get: function () {\n deprecation(v5, 'PIXI.extras.AnimatedSprite class has moved to PIXI.AnimatedSprite');\n return PIXI.AnimatedSprite;\n },\n },\n /**\n * @class PIXI.extras.BitmapText\n * @see PIXI.BitmapText\n * @deprecated since 5.0.0\n */\n BitmapText: {\n get: function () {\n deprecation(v5, 'PIXI.extras.BitmapText class has moved to PIXI.BitmapText');\n return PIXI.BitmapText;\n },\n },\n });\n /**\n * @static\n * @method PIXI.TilingSprite.fromFrame\n * @deprecated since 5.3.0\n * @see PIXI.TilingSprite.from\n */\n PIXI.TilingSprite.fromFrame = function fromFrame(frameId, width, height) {\n deprecation('5.3.0', 'TilingSprite.fromFrame is deprecated, use TilingSprite.from');\n return PIXI.TilingSprite.from(frameId, { width: width, height: height });\n };\n /**\n * @static\n * @method PIXI.TilingSprite.fromImage\n * @deprecated since 5.3.0\n * @see PIXI.TilingSprite.from\n */\n PIXI.TilingSprite.fromImage = function fromImage(imageId, width, height, options) {\n if (options === void 0) { options = {}; }\n deprecation('5.3.0', 'TilingSprite.fromImage is deprecated, use TilingSprite.from');\n // Fallback support for crossorigin, scaleMode parameters\n if (options && typeof options !== 'object') {\n options = {\n // eslint-disable-next-line prefer-rest-params\n scaleMode: arguments[4],\n resourceOptions: {\n // eslint-disable-next-line prefer-rest-params\n crossorigin: arguments[3],\n },\n };\n }\n options.width = width;\n options.height = height;\n return PIXI.TilingSprite.from(imageId, options);\n };\n Object.defineProperties(PIXI.utils, {\n /**\n * @function PIXI.utils.getSvgSize\n * @see PIXI.resources.SVGResource.getSize\n * @deprecated since 5.0.0\n */\n getSvgSize: {\n get: function () {\n deprecation(v5, 'PIXI.utils.getSvgSize function has moved to PIXI.resources.SVGResource.getSize');\n return PIXI.resources.SVGResource.getSize;\n },\n },\n });\n /**\n * All classes on this namespace have moved to the high-level `PIXI` object.\n * @namespace PIXI.mesh\n * @deprecated since 5.0.0\n */\n PIXI.mesh = {};\n Object.defineProperties(PIXI.mesh, {\n /**\n * @class PIXI.mesh.Mesh\n * @see PIXI.SimpleMesh\n * @deprecated since 5.0.0\n */\n Mesh: {\n get: function () {\n deprecation(v5, 'PIXI.mesh.Mesh class has moved to PIXI.SimpleMesh');\n return PIXI.SimpleMesh;\n },\n },\n /**\n * @class PIXI.mesh.NineSlicePlane\n * @see PIXI.NineSlicePlane\n * @deprecated since 5.0.0\n */\n NineSlicePlane: {\n get: function () {\n deprecation(v5, 'PIXI.mesh.NineSlicePlane class has moved to PIXI.NineSlicePlane');\n return PIXI.NineSlicePlane;\n },\n },\n /**\n * @class PIXI.mesh.Plane\n * @see PIXI.SimplePlane\n * @deprecated since 5.0.0\n */\n Plane: {\n get: function () {\n deprecation(v5, 'PIXI.mesh.Plane class has moved to PIXI.SimplePlane');\n return PIXI.SimplePlane;\n },\n },\n /**\n * @class PIXI.mesh.Rope\n * @see PIXI.SimpleRope\n * @deprecated since 5.0.0\n */\n Rope: {\n get: function () {\n deprecation(v5, 'PIXI.mesh.Rope class has moved to PIXI.SimpleRope');\n return PIXI.SimpleRope;\n },\n },\n /**\n * @class PIXI.mesh.RawMesh\n * @see PIXI.Mesh\n * @deprecated since 5.0.0\n */\n RawMesh: {\n get: function () {\n deprecation(v5, 'PIXI.mesh.RawMesh class has moved to PIXI.Mesh');\n return PIXI.Mesh;\n },\n },\n /**\n * @class PIXI.mesh.CanvasMeshRenderer\n * @see PIXI.CanvasMeshRenderer\n * @deprecated since 5.0.0\n */\n CanvasMeshRenderer: {\n get: function () {\n deprecation(v5, 'PIXI.mesh.CanvasMeshRenderer class has moved to PIXI.CanvasMeshRenderer');\n return PIXI.CanvasMeshRenderer;\n },\n },\n /**\n * @class PIXI.mesh.MeshRenderer\n * @see PIXI.MeshRenderer\n * @deprecated since 5.0.0\n */\n MeshRenderer: {\n get: function () {\n deprecation(v5, 'PIXI.mesh.MeshRenderer class has moved to PIXI.MeshRenderer');\n return PIXI.MeshRenderer;\n },\n },\n });\n /**\n * This namespace has been removed and items have been moved to\n * the top-level `PIXI` object.\n * @namespace PIXI.particles\n * @deprecated since 5.0.0\n */\n PIXI.particles = {};\n Object.defineProperties(PIXI.particles, {\n /**\n * @class PIXI.particles.ParticleContainer\n * @deprecated since 5.0.0\n * @see PIXI.ParticleContainer\n */\n ParticleContainer: {\n get: function () {\n deprecation(v5, 'PIXI.particles.ParticleContainer class has moved to PIXI.ParticleContainer');\n return PIXI.ParticleContainer;\n },\n },\n /**\n * @class PIXI.particles.ParticleRenderer\n * @deprecated since 5.0.0\n * @see PIXI.ParticleRenderer\n */\n ParticleRenderer: {\n get: function () {\n deprecation(v5, 'PIXI.particles.ParticleRenderer class has moved to PIXI.ParticleRenderer');\n return PIXI.ParticleRenderer;\n },\n },\n });\n /**\n * This namespace has been removed and items have been moved to\n * the top-level `PIXI` object.\n * @namespace PIXI.ticker\n * @deprecated since 5.0.0\n */\n PIXI.ticker = {};\n Object.defineProperties(PIXI.ticker, {\n /**\n * @class PIXI.ticker.Ticker\n * @deprecated since 5.0.0\n * @see PIXI.Ticker\n */\n Ticker: {\n get: function () {\n deprecation(v5, 'PIXI.ticker.Ticker class has moved to PIXI.Ticker');\n return PIXI.Ticker;\n },\n },\n /**\n * @name PIXI.ticker.shared\n * @type {PIXI.Ticker}\n * @deprecated since 5.0.0\n * @see PIXI.Ticker.shared\n */\n shared: {\n get: function () {\n deprecation(v5, 'PIXI.ticker.shared instance has moved to PIXI.Ticker.shared');\n return PIXI.Ticker.shared;\n },\n },\n });\n /**\n * All classes on this namespace have moved to the high-level `PIXI` object.\n * @namespace PIXI.loaders\n * @deprecated since 5.0.0\n */\n PIXI.loaders = {};\n Object.defineProperties(PIXI.loaders, {\n /**\n * @class PIXI.loaders.Loader\n * @see PIXI.Loader\n * @deprecated since 5.0.0\n */\n Loader: {\n get: function () {\n deprecation(v5, 'PIXI.loaders.Loader class has moved to PIXI.Loader');\n return PIXI.Loader;\n },\n },\n /**\n * @class PIXI.loaders.Resource\n * @see PIXI.LoaderResource\n * @deprecated since 5.0.0\n */\n Resource: {\n get: function () {\n deprecation(v5, 'PIXI.loaders.Resource class has moved to PIXI.LoaderResource');\n return PIXI.LoaderResource;\n },\n },\n /**\n * @function PIXI.loaders.bitmapFontParser\n * @see PIXI.BitmapFontLoader.use\n * @deprecated since 5.0.0\n */\n bitmapFontParser: {\n get: function () {\n deprecation(v5, 'PIXI.loaders.bitmapFontParser function has moved to PIXI.BitmapFontLoader.use');\n return PIXI.BitmapFontLoader.use;\n },\n },\n /**\n * @function PIXI.loaders.parseBitmapFontData\n * @deprecated since 5.0.0\n */\n parseBitmapFontData: {\n get: function () {\n deprecation(v5, 'PIXI.loaders.parseBitmapFontData function has removed');\n },\n },\n /**\n * @function PIXI.loaders.spritesheetParser\n * @see PIXI.SpritesheetLoader.use\n * @deprecated since 5.0.0\n */\n spritesheetParser: {\n get: function () {\n deprecation(v5, 'PIXI.loaders.spritesheetParser function has moved to PIXI.SpritesheetLoader.use');\n return PIXI.SpritesheetLoader.use;\n },\n },\n /**\n * @function PIXI.loaders.getResourcePath\n * @see PIXI.SpritesheetLoader.getResourcePath\n * @deprecated since 5.0.0\n */\n getResourcePath: {\n get: function () {\n deprecation(v5, 'PIXI.loaders.getResourcePath property has moved to PIXI.SpritesheetLoader.getResourcePath');\n return PIXI.SpritesheetLoader.getResourcePath;\n },\n },\n });\n /**\n * @function PIXI.loaders.Loader.addPixiMiddleware\n * @see PIXI.Loader.registerPlugin\n * @deprecated since 5.0.0\n * @param {function} middleware\n */\n PIXI.Loader.addPixiMiddleware = function addPixiMiddleware(middleware) {\n deprecation(v5, 'PIXI.loaders.Loader.addPixiMiddleware function is deprecated, use PIXI.loaders.Loader.registerPlugin');\n return PIXI.loaders.Loader.registerPlugin({ use: middleware() });\n };\n // convenience for converting event name to signal name\n var eventToSignal = function (event) {\n return \"on\" + event.charAt(0).toUpperCase() + event.slice(1);\n };\n Object.assign(PIXI.Loader.prototype, {\n /**\n * Use the corresponding signal, e.g., event `start`` is signal `onStart`.\n * @method PIXI.Loader#on\n * @deprecated since 5.0.0\n */\n on: function (event) {\n var signal = eventToSignal(event);\n deprecation(v5, \"PIXI.Loader#on is completely deprecated, use PIXI.Loader#\" + signal + \".add\");\n },\n /**\n * Use the corresponding signal, e.g., event `start`` is signal `onStart`.\n * @method PIXI.Loader#once\n * @deprecated since 5.0.0\n */\n once: function (event) {\n var signal = eventToSignal(event);\n deprecation(v5, \"PIXI.Loader#once is completely deprecated, use PIXI.Loader#\" + signal + \".once\");\n },\n /**\n * Use the corresponding signal, e.g., event `start`` is signal `onStart`.\n * @method PIXI.Loader#off\n * @deprecated since 5.0.0\n */\n off: function (event) {\n var signal = eventToSignal(event);\n deprecation(v5, \"PIXI.Loader#off is completely deprecated, use PIXI.Loader#\" + signal + \".detach\");\n },\n });\n /**\n * @class PIXI.extract.WebGLExtract\n * @deprecated since 5.0.0\n * @see PIXI.Extract\n */\n Object.defineProperty(PIXI.extract, 'WebGLExtract', {\n get: function () {\n deprecation(v5, 'PIXI.extract.WebGLExtract method has moved to PIXI.Extract');\n return PIXI.Extract;\n },\n });\n /**\n * @class PIXI.prepare.WebGLPrepare\n * @deprecated since 5.0.0\n * @see PIXI.Prepare\n */\n Object.defineProperty(PIXI.prepare, 'WebGLPrepare', {\n get: function () {\n deprecation(v5, 'PIXI.prepare.WebGLPrepare class has moved to PIXI.Prepare');\n return PIXI.Prepare;\n },\n });\n /**\n * @method PIXI.Container#_renderWebGL\n * @private\n * @deprecated since 5.0.0\n * @see PIXI.Container#render\n * @param {PIXI.Renderer} renderer Instance of renderer\n */\n PIXI.Container.prototype._renderWebGL = function _renderWebGL(renderer) {\n deprecation(v5, 'PIXI.Container._renderWebGL method has moved to PIXI.Container._render');\n this._render(renderer);\n };\n /**\n * @method PIXI.Container#renderWebGL\n * @deprecated since 5.0.0\n * @see PIXI.Container#render\n * @param {PIXI.Renderer} renderer Instance of renderer\n */\n PIXI.Container.prototype.renderWebGL = function renderWebGL(renderer) {\n deprecation(v5, 'PIXI.Container.renderWebGL method has moved to PIXI.Container.render');\n this.render(renderer);\n };\n /**\n * @method PIXI.DisplayObject#renderWebGL\n * @deprecated since 5.0.0\n * @see PIXI.DisplayObject#render\n * @param {PIXI.Renderer} renderer Instance of renderer\n */\n PIXI.DisplayObject.prototype.renderWebGL = function renderWebGL(renderer) {\n deprecation(v5, 'PIXI.DisplayObject.renderWebGL method has moved to PIXI.DisplayObject.render');\n this.render(renderer);\n };\n /**\n * @method PIXI.Container#renderAdvancedWebGL\n * @deprecated since 5.0.0\n * @see PIXI.Container#renderAdvanced\n * @param {PIXI.Renderer} renderer Instance of renderer\n */\n PIXI.Container.prototype.renderAdvancedWebGL = function renderAdvancedWebGL(renderer) {\n deprecation(v5, 'PIXI.Container.renderAdvancedWebGL method has moved to PIXI.Container.renderAdvanced');\n this.renderAdvanced(renderer);\n };\n Object.defineProperties(PIXI.settings, {\n /**\n * Default transform type.\n *\n * @static\n * @deprecated since 5.0.0\n * @memberof PIXI.settings\n * @type {PIXI.TRANSFORM_MODE}\n * @default PIXI.TRANSFORM_MODE.STATIC\n */\n TRANSFORM_MODE: {\n get: function () {\n deprecation(v5, 'PIXI.settings.TRANSFORM_MODE property has been removed');\n return 0;\n },\n set: function () {\n deprecation(v5, 'PIXI.settings.TRANSFORM_MODE property has been removed');\n },\n },\n });\n var BaseTextureAny = PIXI.BaseTexture;\n /**\n * @method loadSource\n * @memberof PIXI.BaseTexture#\n * @deprecated since 5.0.0\n */\n BaseTextureAny.prototype.loadSource = function loadSource(image) {\n deprecation(v5, 'PIXI.BaseTexture.loadSource method has been deprecated');\n var resource = PIXI.resources.autoDetectResource(image);\n resource.internal = true;\n this.setResource(resource);\n this.update();\n };\n var baseTextureIdDeprecation = false;\n Object.defineProperties(BaseTextureAny.prototype, {\n /**\n * @name PIXI.BaseTexture#hasLoaded\n * @type {boolean}\n * @deprecated since 5.0.0\n * @readonly\n * @see PIXI.BaseTexture#valid\n */\n hasLoaded: {\n get: function () {\n deprecation(v5, 'PIXI.BaseTexture.hasLoaded property has been removed, use PIXI.BaseTexture.valid');\n return this.valid;\n },\n },\n /**\n * @name PIXI.BaseTexture#imageUrl\n * @type {string}\n * @deprecated since 5.0.0\n * @see PIXI.resources.ImageResource#url\n */\n imageUrl: {\n get: function () {\n var _a;\n deprecation(v5, 'PIXI.BaseTexture.imageUrl property has been removed, use PIXI.BaseTexture.resource.url');\n return (_a = this.resource) === null || _a === void 0 ? void 0 : _a.url;\n },\n set: function (imageUrl) {\n deprecation(v5, 'PIXI.BaseTexture.imageUrl property has been removed, use PIXI.BaseTexture.resource.url');\n if (this.resource) {\n this.resource.url = imageUrl;\n }\n },\n },\n /**\n * @name PIXI.BaseTexture#source\n * @type {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement}\n * @deprecated since 5.0.0\n * @readonly\n * @see PIXI.resources.BaseImageResource#source\n */\n source: {\n get: function () {\n deprecation(v5, 'PIXI.BaseTexture.source property has been moved, use `PIXI.BaseTexture.resource.source`');\n return this.resource.source;\n },\n set: function (source) {\n deprecation(v5, 'PIXI.BaseTexture.source property has been moved, use `PIXI.BaseTexture.resource.source` '\n + 'if you want to set HTMLCanvasElement. Otherwise, create new BaseTexture.');\n if (this.resource) {\n this.resource.source = source;\n }\n },\n },\n /**\n * @name PIXI.BaseTexture#premultiplyAlpha\n * @type {boolean}\n * @deprecated since 5.2.0\n * @readonly\n * @see PIXI.BaseTexture#alphaMode\n */\n premultiplyAlpha: {\n get: function () {\n deprecation('5.2.0', 'PIXI.BaseTexture.premultiplyAlpha property has been changed to `alphaMode`'\n + ', see `PIXI.ALPHA_MODES`');\n return this.alphaMode !== 0;\n },\n set: function (value) {\n deprecation('5.2.0', 'PIXI.BaseTexture.premultiplyAlpha property has been changed to `alphaMode`'\n + ', see `PIXI.ALPHA_MODES`');\n this.alphaMode = Number(value);\n },\n },\n /**\n * Batch local field, stores current texture location\n *\n * @name PIXI.BaseTexture#_id\n * @deprecated since 5.2.0\n * @type {number}\n * @see PIXI.BaseTexture#_batchLocation\n */\n _id: {\n get: function () {\n if (!baseTextureIdDeprecation) {\n // #popelyshev: That property was a hot place, I don't want to call deprecation method on it if possible\n deprecation('5.2.0', 'PIXI.BaseTexture._id batch local field has been changed to `_batchLocation`');\n baseTextureIdDeprecation = true;\n }\n return this._batchLocation;\n },\n set: function (value) {\n this._batchLocation = value;\n },\n },\n });\n /**\n * @method fromImage\n * @static\n * @memberof PIXI.BaseTexture\n * @deprecated since 5.0.0\n * @see PIXI.BaseTexture.from\n */\n BaseTextureAny.fromImage = function fromImage(canvas, crossorigin, scaleMode, scale) {\n deprecation(v5, 'PIXI.BaseTexture.fromImage method has been replaced with PIXI.BaseTexture.from');\n var resourceOptions = { scale: scale, crossorigin: crossorigin };\n return BaseTextureAny.from(canvas, { scaleMode: scaleMode, resourceOptions: resourceOptions });\n };\n /**\n * @method fromCanvas\n * @static\n * @memberof PIXI.BaseTexture\n * @deprecated since 5.0.0\n * @see PIXI.BaseTexture.from\n */\n BaseTextureAny.fromCanvas = function fromCanvas(canvas, scaleMode) {\n deprecation(v5, 'PIXI.BaseTexture.fromCanvas method has been replaced with PIXI.BaseTexture.from');\n return BaseTextureAny.from(canvas, { scaleMode: scaleMode });\n };\n /**\n * @method fromSVG\n * @static\n * @memberof PIXI.BaseTexture\n * @deprecated since 5.0.0\n * @see PIXI.BaseTexture.from\n */\n BaseTextureAny.fromSVG = function fromSVG(canvas, crossorigin, scaleMode, scale) {\n deprecation(v5, 'PIXI.BaseTexture.fromSVG method has been replaced with PIXI.BaseTexture.from');\n var resourceOptions = { scale: scale, crossorigin: crossorigin };\n return BaseTextureAny.from(canvas, { scaleMode: scaleMode, resourceOptions: resourceOptions });\n };\n Object.defineProperties(PIXI.resources.ImageResource.prototype, {\n /**\n * @name PIXI.resources.ImageResource#premultiplyAlpha\n * @type {boolean}\n * @deprecated since 5.2.0\n * @readonly\n * @see PIXI.resources.ImageResource#alphaMode\n */\n premultiplyAlpha: {\n get: function () {\n deprecation('5.2.0', 'PIXI.resources.ImageResource.premultiplyAlpha property '\n + 'has been changed to `alphaMode`, see `PIXI.ALPHA_MODES`');\n return this.alphaMode !== 0;\n },\n set: function (value) {\n deprecation('5.2.0', 'PIXI.resources.ImageResource.premultiplyAlpha property '\n + 'has been changed to `alphaMode`, see `PIXI.ALPHA_MODES`');\n this.alphaMode = Number(value);\n },\n },\n });\n /**\n * @method PIXI.Point#copy\n * @deprecated since 5.0.0\n * @see PIXI.Point#copyFrom\n */\n PIXI.Point.prototype.copy = function copy(p) {\n deprecation(v5, 'PIXI.Point.copy method has been replaced with PIXI.Point.copyFrom');\n return this.copyFrom(p);\n };\n /**\n * @method PIXI.ObservablePoint#copy\n * @deprecated since 5.0.0\n * @see PIXI.ObservablePoint#copyFrom\n */\n PIXI.ObservablePoint.prototype.copy = function copy(p) {\n deprecation(v5, 'PIXI.ObservablePoint.copy method has been replaced with PIXI.ObservablePoint.copyFrom');\n return this.copyFrom(p);\n };\n /**\n * @method PIXI.Rectangle#copy\n * @deprecated since 5.0.0\n * @see PIXI.Rectangle#copyFrom\n */\n PIXI.Rectangle.prototype.copy = function copy(p) {\n deprecation(v5, 'PIXI.Rectangle.copy method has been replaced with PIXI.Rectangle.copyFrom');\n return this.copyFrom(p);\n };\n /**\n * @method PIXI.Matrix#copy\n * @deprecated since 5.0.0\n * @see PIXI.Matrix#copyTo\n */\n PIXI.Matrix.prototype.copy = function copy(p) {\n deprecation(v5, 'PIXI.Matrix.copy method has been replaced with PIXI.Matrix.copyTo');\n return this.copyTo(p);\n };\n /**\n * @method PIXI.systems.StateSystem#setState\n * @deprecated since 5.1.0\n * @see PIXI.systems.StateSystem#set\n */\n PIXI.systems.StateSystem.prototype.setState = function setState(s) {\n deprecation('v5.1.0', 'StateSystem.setState has been renamed to StateSystem.set');\n return this.set(s);\n };\n Object.assign(PIXI.systems.FilterSystem.prototype, {\n /**\n * @method PIXI.FilterManager#getRenderTarget\n * @deprecated since 5.0.0\n * @see PIXI.systems.FilterSystem#getFilterTexture\n */\n getRenderTarget: function (_clear, resolution) {\n deprecation(v5, 'PIXI.FilterManager.getRenderTarget method has been replaced with PIXI.systems.FilterSystem#getFilterTexture');\n return this.getFilterTexture(null, resolution);\n },\n /**\n * @method PIXI.FilterManager#returnRenderTarget\n * @deprecated since 5.0.0\n * @see PIXI.systems.FilterSystem#returnFilterTexture\n */\n returnRenderTarget: function (renderTexture) {\n deprecation(v5, 'PIXI.FilterManager.returnRenderTarget method has been replaced with '\n + 'PIXI.systems.FilterSystem.returnFilterTexture');\n this.returnFilterTexture(renderTexture);\n },\n /**\n * @method PIXI.systems.FilterSystem#calculateScreenSpaceMatrix\n * @deprecated since 5.0.0\n * @param {PIXI.Matrix} outputMatrix - the matrix to output to.\n * @return {PIXI.Matrix} The mapped matrix.\n */\n calculateScreenSpaceMatrix: function (outputMatrix) {\n deprecation(v5, 'PIXI.systems.FilterSystem.calculateScreenSpaceMatrix method is removed, '\n + 'use `(vTextureCoord * inputSize.xy) + outputFrame.xy` instead');\n var mappedMatrix = outputMatrix.identity();\n var _a = this.activeState, sourceFrame = _a.sourceFrame, destinationFrame = _a.destinationFrame;\n mappedMatrix.translate(sourceFrame.x / destinationFrame.width, sourceFrame.y / destinationFrame.height);\n mappedMatrix.scale(destinationFrame.width, destinationFrame.height);\n return mappedMatrix;\n },\n /**\n * @method PIXI.systems.FilterSystem#calculateNormalizedScreenSpaceMatrix\n * @deprecated since 5.0.0\n * @param {PIXI.Matrix} outputMatrix - The matrix to output to.\n * @return {PIXI.Matrix} The mapped matrix.\n */\n calculateNormalizedScreenSpaceMatrix: function (outputMatrix) {\n deprecation(v5, 'PIXI.systems.FilterManager.calculateNormalizedScreenSpaceMatrix method is removed, '\n + 'use `((vTextureCoord * inputSize.xy) + outputFrame.xy) / outputFrame.zw` instead.');\n var _a = this.activeState, sourceFrame = _a.sourceFrame, destinationFrame = _a.destinationFrame;\n var mappedMatrix = outputMatrix.identity();\n mappedMatrix.translate(sourceFrame.x / destinationFrame.width, sourceFrame.y / destinationFrame.height);\n var translateScaleX = (destinationFrame.width / sourceFrame.width);\n var translateScaleY = (destinationFrame.height / sourceFrame.height);\n mappedMatrix.scale(translateScaleX, translateScaleY);\n return mappedMatrix;\n },\n });\n Object.defineProperties(PIXI.RenderTexture.prototype, {\n /**\n * @name PIXI.RenderTexture#sourceFrame\n * @type {PIXI.Rectangle}\n * @deprecated since 5.0.0\n * @readonly\n */\n sourceFrame: {\n get: function () {\n deprecation(v5, 'PIXI.RenderTexture.sourceFrame property has been removed');\n return this.filterFrame;\n },\n },\n /**\n * @name PIXI.RenderTexture#size\n * @type {PIXI.Rectangle}\n * @deprecated since 5.0.0\n * @readonly\n */\n size: {\n get: function () {\n deprecation(v5, 'PIXI.RenderTexture.size property has been removed');\n return this._frame;\n },\n },\n });\n /**\n * @class BlurXFilter\n * @memberof PIXI.filters\n * @deprecated since 5.0.0\n * @see PIXI.filters.BlurFilterPass\n */\n var BlurXFilter = /** @class */ (function (_super) {\n __extends(BlurXFilter, _super);\n function BlurXFilter(strength, quality, resolution, kernelSize) {\n var _this = this;\n deprecation(v5, 'PIXI.filters.BlurXFilter class is deprecated, use PIXI.filters.BlurFilterPass');\n _this = _super.call(this, true, strength, quality, resolution, kernelSize) || this;\n return _this;\n }\n return BlurXFilter;\n }(PIXI.filters.BlurFilterPass));\n /**\n * @class BlurYFilter\n * @memberof PIXI.filters\n * @deprecated since 5.0.0\n * @see PIXI.filters.BlurFilterPass\n */\n var BlurYFilter = /** @class */ (function (_super) {\n __extends(BlurYFilter, _super);\n function BlurYFilter(strength, quality, resolution, kernelSize) {\n var _this = this;\n deprecation(v5, 'PIXI.filters.BlurYFilter class is deprecated, use PIXI.filters.BlurFilterPass');\n _this = _super.call(this, false, strength, quality, resolution, kernelSize) || this;\n return _this;\n }\n return BlurYFilter;\n }(PIXI.filters.BlurFilterPass));\n Object.assign(PIXI.filters, {\n BlurXFilter: BlurXFilter,\n BlurYFilter: BlurYFilter,\n });\n var SpriteAny = PIXI.Sprite, TextureAny = PIXI.Texture, GraphicsAny = PIXI.Graphics;\n // Support for pixi.js-legacy bifurcation\n // give users a friendly assist to use legacy\n if (!GraphicsAny.prototype.generateCanvasTexture) {\n GraphicsAny.prototype.generateCanvasTexture = function generateCanvasTexture() {\n deprecation(v5, 'PIXI.Graphics.generateCanvasTexture method is only available in \"pixi.js-legacy\"');\n };\n }\n /**\n * @deprecated since 5.0.0\n * @member {PIXI.Graphics} PIXI.Graphics#graphicsData\n * @see PIXI.Graphics#geometry\n * @readonly\n */\n Object.defineProperty(GraphicsAny.prototype, 'graphicsData', {\n get: function () {\n deprecation(v5, 'PIXI.Graphics.graphicsData property is deprecated, use PIXI.Graphics.geometry.graphicsData');\n return this.geometry.graphicsData;\n },\n });\n // Use these to deprecate all the Sprite from* methods\n function spriteFrom(name, source, crossorigin, scaleMode) {\n deprecation(v5, \"PIXI.Sprite.\" + name + \" method is deprecated, use PIXI.Sprite.from\");\n return SpriteAny.from(source, {\n resourceOptions: {\n scale: scaleMode,\n crossorigin: crossorigin,\n },\n });\n }\n /**\n * @deprecated since 5.0.0\n * @see PIXI.Sprite.from\n * @method PIXI.Sprite.fromImage\n * @return {PIXI.Sprite}\n */\n SpriteAny.fromImage = spriteFrom.bind(null, 'fromImage');\n /**\n * @deprecated since 5.0.0\n * @method PIXI.Sprite.fromSVG\n * @see PIXI.Sprite.from\n * @return {PIXI.Sprite}\n */\n SpriteAny.fromSVG = spriteFrom.bind(null, 'fromSVG');\n /**\n * @deprecated since 5.0.0\n * @method PIXI.Sprite.fromCanvas\n * @see PIXI.Sprite.from\n * @return {PIXI.Sprite}\n */\n SpriteAny.fromCanvas = spriteFrom.bind(null, 'fromCanvas');\n /**\n * @deprecated since 5.0.0\n * @method PIXI.Sprite.fromVideo\n * @see PIXI.Sprite.from\n * @return {PIXI.Sprite}\n */\n SpriteAny.fromVideo = spriteFrom.bind(null, 'fromVideo');\n /**\n * @deprecated since 5.0.0\n * @method PIXI.Sprite.fromFrame\n * @see PIXI.Sprite.from\n * @return {PIXI.Sprite}\n */\n SpriteAny.fromFrame = spriteFrom.bind(null, 'fromFrame');\n // Use these to deprecate all the Texture from* methods\n function textureFrom(name, source, crossorigin, scaleMode) {\n deprecation(v5, \"PIXI.Texture.\" + name + \" method is deprecated, use PIXI.Texture.from\");\n return TextureAny.from(source, {\n resourceOptions: {\n scale: scaleMode,\n crossorigin: crossorigin,\n },\n });\n }\n /**\n * @deprecated since 5.0.0\n * @method PIXI.Texture.fromImage\n * @see PIXI.Texture.from\n * @return {PIXI.Texture}\n */\n TextureAny.fromImage = textureFrom.bind(null, 'fromImage');\n /**\n * @deprecated since 5.0.0\n * @method PIXI.Texture.fromSVG\n * @see PIXI.Texture.from\n * @return {PIXI.Texture}\n */\n TextureAny.fromSVG = textureFrom.bind(null, 'fromSVG');\n /**\n * @deprecated since 5.0.0\n * @method PIXI.Texture.fromCanvas\n * @see PIXI.Texture.from\n * @return {PIXI.Texture}\n */\n TextureAny.fromCanvas = textureFrom.bind(null, 'fromCanvas');\n /**\n * @deprecated since 5.0.0\n * @method PIXI.Texture.fromVideo\n * @see PIXI.Texture.from\n * @return {PIXI.Texture}\n */\n TextureAny.fromVideo = textureFrom.bind(null, 'fromVideo');\n /**\n * @deprecated since 5.0.0\n * @method PIXI.Texture.fromFrame\n * @see PIXI.Texture.from\n * @return {PIXI.Texture}\n */\n TextureAny.fromFrame = textureFrom.bind(null, 'fromFrame');\n /**\n * @deprecated since 5.0.0\n * @member {boolean} PIXI.AbstractRenderer#autoResize\n * @see PIXI.AbstractRenderer#autoDensity\n */\n Object.defineProperty(PIXI.AbstractRenderer.prototype, 'autoResize', {\n get: function () {\n deprecation(v5, 'PIXI.AbstractRenderer.autoResize property is deprecated, '\n + 'use PIXI.AbstractRenderer.autoDensity');\n return this.autoDensity;\n },\n set: function (value) {\n deprecation(v5, 'PIXI.AbstractRenderer.autoResize property is deprecated, '\n + 'use PIXI.AbstractRenderer.autoDensity');\n this.autoDensity = value;\n },\n });\n /**\n * @deprecated since 5.0.0\n * @member {PIXI.systems.TextureSystem} PIXI.Renderer#textureManager\n * @see PIXI.Renderer#texture\n */\n Object.defineProperty(PIXI.Renderer.prototype, 'textureManager', {\n get: function () {\n deprecation(v5, 'PIXI.Renderer.textureManager property is deprecated, use PIXI.Renderer.texture');\n return this.texture;\n },\n });\n /**\n * @namespace PIXI.utils.mixins\n * @deprecated since 5.0.0\n */\n PIXI.utils.mixins = {\n /**\n * @memberof PIXI.utils.mixins\n * @function mixin\n * @deprecated since 5.0.0\n */\n mixin: function () {\n deprecation(v5, 'PIXI.utils.mixins.mixin function is no longer available');\n },\n /**\n * @memberof PIXI.utils.mixins\n * @function delayMixin\n * @deprecated since 5.0.0\n */\n delayMixin: function () {\n deprecation(v5, 'PIXI.utils.mixins.delayMixin function is no longer available');\n },\n /**\n * @memberof PIXI.utils.mixins\n * @function performMixins\n * @deprecated since 5.0.0\n */\n performMixins: function () {\n deprecation(v5, 'PIXI.utils.mixins.performMixins function is no longer available');\n },\n };\n /**\n * @memberof PIXI.BitmapText\n * @member {object} font\n * @deprecated since 5.3.0\n */\n Object.defineProperty(PIXI.BitmapText.prototype, 'font', {\n get: function () {\n deprecation('5.3.0', 'PIXI.BitmapText.font property is deprecated, '\n + 'use fontName, fontSize, tint or align properties');\n return {\n name: this._fontName,\n size: this._fontSize,\n tint: this._tint,\n align: this._align,\n };\n },\n set: function (value) {\n deprecation('5.3.0', 'PIXI.BitmapText.font property is deprecated, '\n + 'use fontName, fontSize, tint or align properties');\n if (!value) {\n return;\n }\n var style = { font: value };\n this._upgradeStyle(style);\n style.fontSize = style.fontSize || PIXI.BitmapFont.available[style.fontName].size;\n this._fontName = style.fontName;\n this._fontSize = style.fontSize;\n this.dirty = true;\n },\n });\n}\n\n// Install renderer plugins\nRenderer.registerPlugin('accessibility', AccessibilityManager);\nRenderer.registerPlugin('extract', Extract);\nRenderer.registerPlugin('interaction', InteractionManager);\nRenderer.registerPlugin('particle', ParticleRenderer);\nRenderer.registerPlugin('prepare', Prepare);\nRenderer.registerPlugin('batch', BatchRenderer);\nRenderer.registerPlugin('tilingSprite', TilingSpriteRenderer);\nLoader.registerPlugin(BitmapFontLoader);\nLoader.registerPlugin(SpritesheetLoader);\nApplication.registerPlugin(TickerPlugin);\nApplication.registerPlugin(AppLoaderPlugin);\n/**\n * String of the current PIXI version.\n *\n * @static\n * @constant\n * @memberof PIXI\n * @name VERSION\n * @type {string}\n */\nvar VERSION = '5.3.7';\n/**\n * @namespace PIXI\n */\n/**\n * This namespace contains WebGL-only display filters that can be applied\n * to DisplayObjects using the {@link PIXI.DisplayObject#filters filters} property.\n *\n * Since PixiJS only had a handful of built-in filters, additional filters\n * can be downloaded {@link https://github.com/pixijs/pixi-filters here} from the\n * PixiJS Filters repository.\n *\n * All filters must extend {@link PIXI.Filter}.\n *\n * @example\n * // Create a new application\n * const app = new PIXI.Application();\n *\n * // Draw a green rectangle\n * const rect = new PIXI.Graphics()\n * .beginFill(0x00ff00)\n * .drawRect(40, 40, 200, 200);\n *\n * // Add a blur filter\n * rect.filters = [new PIXI.filters.BlurFilter()];\n *\n * // Display rectangle\n * app.stage.addChild(rect);\n * document.body.appendChild(app.view);\n * @namespace PIXI.filters\n */\nvar filters = {\n AlphaFilter: AlphaFilter,\n BlurFilter: BlurFilter,\n BlurFilterPass: BlurFilterPass,\n ColorMatrixFilter: ColorMatrixFilter,\n DisplacementFilter: DisplacementFilter,\n FXAAFilter: FXAAFilter,\n NoiseFilter: NoiseFilter,\n};\n\nexport { VERSION, filters, useDeprecated };\n//# sourceMappingURL=pixi.es.js.map\n","import { render } from \"./Live2d.vue?vue&type=template&id=78eb8350&scoped=true\"\nimport script from \"./Live2d.vue?vue&type=script&lang=js\"\nexport * from \"./Live2d.vue?vue&type=script&lang=js\"\n\nimport \"./Live2d.vue?vue&type=style&index=0&id=78eb8350&scoped=true&lang=css\"\nscript.render = render\nscript.__scopeId = \"data-v-78eb8350\"\n\nexport default script","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","var baseFor = require('./_baseFor'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nmodule.exports = baseForOwn;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","/*!\n * @pixi/math - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/math is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\n/**\n * Two Pi.\n *\n * @static\n * @constant {number} PI_2\n * @memberof PIXI\n */\nvar PI_2 = Math.PI * 2;\n/**\n * Conversion factor for converting radians to degrees.\n *\n * @static\n * @constant {number} RAD_TO_DEG\n * @memberof PIXI\n */\nvar RAD_TO_DEG = 180 / Math.PI;\n/**\n * Conversion factor for converting degrees to radians.\n *\n * @static\n * @constant {number} DEG_TO_RAD\n * @memberof PIXI\n */\nvar DEG_TO_RAD = Math.PI / 180;\nvar SHAPES;\n(function (SHAPES) {\n SHAPES[SHAPES[\"POLY\"] = 0] = \"POLY\";\n SHAPES[SHAPES[\"RECT\"] = 1] = \"RECT\";\n SHAPES[SHAPES[\"CIRC\"] = 2] = \"CIRC\";\n SHAPES[SHAPES[\"ELIP\"] = 3] = \"ELIP\";\n SHAPES[SHAPES[\"RREC\"] = 4] = \"RREC\";\n})(SHAPES || (SHAPES = {}));\n/**\n * Constants that identify shapes, mainly to prevent `instanceof` calls.\n *\n * @static\n * @constant\n * @name SHAPES\n * @memberof PIXI\n * @type {enum}\n * @property {number} POLY Polygon\n * @property {number} RECT Rectangle\n * @property {number} CIRC Circle\n * @property {number} ELIP Ellipse\n * @property {number} RREC Rounded Rectangle\n * @enum {number}\n */\n\n/**\n * Size object, contains width and height\n *\n * @memberof PIXI\n * @typedef {object} ISize\n * @property {number} width - Width component\n * @property {number} height - Height component\n */\n/**\n * Rectangle object is an area defined by its position, as indicated by its top-left corner\n * point (x, y) and by its width and its height.\n *\n * @class\n * @memberof PIXI\n */\nvar Rectangle = /** @class */ (function () {\n /**\n * @param {number} [x=0] - The X coordinate of the upper-left corner of the rectangle\n * @param {number} [y=0] - The Y coordinate of the upper-left corner of the rectangle\n * @param {number} [width=0] - The overall width of this rectangle\n * @param {number} [height=0] - The overall height of this rectangle\n */\n function Rectangle(x, y, width, height) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (width === void 0) { width = 0; }\n if (height === void 0) { height = 0; }\n /**\n * @member {number}\n * @default 0\n */\n this.x = Number(x);\n /**\n * @member {number}\n * @default 0\n */\n this.y = Number(y);\n /**\n * @member {number}\n * @default 0\n */\n this.width = Number(width);\n /**\n * @member {number}\n * @default 0\n */\n this.height = Number(height);\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readOnly\n * @default PIXI.SHAPES.RECT\n * @see PIXI.SHAPES\n */\n this.type = SHAPES.RECT;\n }\n Object.defineProperty(Rectangle.prototype, \"left\", {\n /**\n * returns the left edge of the rectangle\n *\n * @member {number}\n */\n get: function () {\n return this.x;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Rectangle.prototype, \"right\", {\n /**\n * returns the right edge of the rectangle\n *\n * @member {number}\n */\n get: function () {\n return this.x + this.width;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Rectangle.prototype, \"top\", {\n /**\n * returns the top edge of the rectangle\n *\n * @member {number}\n */\n get: function () {\n return this.y;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Rectangle.prototype, \"bottom\", {\n /**\n * returns the bottom edge of the rectangle\n *\n * @member {number}\n */\n get: function () {\n return this.y + this.height;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Rectangle, \"EMPTY\", {\n /**\n * A constant empty rectangle.\n *\n * @static\n * @constant\n * @member {PIXI.Rectangle}\n * @return {PIXI.Rectangle} An empty rectangle\n */\n get: function () {\n return new Rectangle(0, 0, 0, 0);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Creates a clone of this Rectangle\n *\n * @return {PIXI.Rectangle} a copy of the rectangle\n */\n Rectangle.prototype.clone = function () {\n return new Rectangle(this.x, this.y, this.width, this.height);\n };\n /**\n * Copies another rectangle to this one.\n *\n * @param {PIXI.Rectangle} rectangle - The rectangle to copy from.\n * @return {PIXI.Rectangle} Returns itself.\n */\n Rectangle.prototype.copyFrom = function (rectangle) {\n this.x = rectangle.x;\n this.y = rectangle.y;\n this.width = rectangle.width;\n this.height = rectangle.height;\n return this;\n };\n /**\n * Copies this rectangle to another one.\n *\n * @param {PIXI.Rectangle} rectangle - The rectangle to copy to.\n * @return {PIXI.Rectangle} Returns given parameter.\n */\n Rectangle.prototype.copyTo = function (rectangle) {\n rectangle.x = this.x;\n rectangle.y = this.y;\n rectangle.width = this.width;\n rectangle.height = this.height;\n return rectangle;\n };\n /**\n * Checks whether the x and y coordinates given are contained within this Rectangle\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this Rectangle\n */\n Rectangle.prototype.contains = function (x, y) {\n if (this.width <= 0 || this.height <= 0) {\n return false;\n }\n if (x >= this.x && x < this.x + this.width) {\n if (y >= this.y && y < this.y + this.height) {\n return true;\n }\n }\n return false;\n };\n /**\n * Pads the rectangle making it grow in all directions.\n * If paddingY is omitted, both paddingX and paddingY will be set to paddingX.\n *\n * @param {number} [paddingX=0] - The horizontal padding amount.\n * @param {number} [paddingY=0] - The vertical padding amount.\n * @return {PIXI.Rectangle} Returns itself.\n */\n Rectangle.prototype.pad = function (paddingX, paddingY) {\n if (paddingX === void 0) { paddingX = 0; }\n if (paddingY === void 0) { paddingY = paddingX; }\n this.x -= paddingX;\n this.y -= paddingY;\n this.width += paddingX * 2;\n this.height += paddingY * 2;\n return this;\n };\n /**\n * Fits this rectangle around the passed one.\n *\n * @param {PIXI.Rectangle} rectangle - The rectangle to fit.\n * @return {PIXI.Rectangle} Returns itself.\n */\n Rectangle.prototype.fit = function (rectangle) {\n var x1 = Math.max(this.x, rectangle.x);\n var x2 = Math.min(this.x + this.width, rectangle.x + rectangle.width);\n var y1 = Math.max(this.y, rectangle.y);\n var y2 = Math.min(this.y + this.height, rectangle.y + rectangle.height);\n this.x = x1;\n this.width = Math.max(x2 - x1, 0);\n this.y = y1;\n this.height = Math.max(y2 - y1, 0);\n return this;\n };\n /**\n * Enlarges rectangle that way its corners lie on grid\n *\n * @param {number} [resolution=1] resolution\n * @param {number} [eps=0.001] precision\n * @return {PIXI.Rectangle} Returns itself.\n */\n Rectangle.prototype.ceil = function (resolution, eps) {\n if (resolution === void 0) { resolution = 1; }\n if (eps === void 0) { eps = 0.001; }\n var x2 = Math.ceil((this.x + this.width - eps) * resolution) / resolution;\n var y2 = Math.ceil((this.y + this.height - eps) * resolution) / resolution;\n this.x = Math.floor((this.x + eps) * resolution) / resolution;\n this.y = Math.floor((this.y + eps) * resolution) / resolution;\n this.width = x2 - this.x;\n this.height = y2 - this.y;\n return this;\n };\n /**\n * Enlarges this rectangle to include the passed rectangle.\n *\n * @param {PIXI.Rectangle} rectangle - The rectangle to include.\n * @return {PIXI.Rectangle} Returns itself.\n */\n Rectangle.prototype.enlarge = function (rectangle) {\n var x1 = Math.min(this.x, rectangle.x);\n var x2 = Math.max(this.x + this.width, rectangle.x + rectangle.width);\n var y1 = Math.min(this.y, rectangle.y);\n var y2 = Math.max(this.y + this.height, rectangle.y + rectangle.height);\n this.x = x1;\n this.width = x2 - x1;\n this.y = y1;\n this.height = y2 - y1;\n return this;\n };\n return Rectangle;\n}());\n\n/**\n * The Circle object is used to help draw graphics and can also be used to specify a hit area for displayObjects.\n *\n * @class\n * @memberof PIXI\n */\nvar Circle = /** @class */ (function () {\n /**\n * @param {number} [x=0] - The X coordinate of the center of this circle\n * @param {number} [y=0] - The Y coordinate of the center of this circle\n * @param {number} [radius=0] - The radius of the circle\n */\n function Circle(x, y, radius) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (radius === void 0) { radius = 0; }\n /**\n * @member {number}\n * @default 0\n */\n this.x = x;\n /**\n * @member {number}\n * @default 0\n */\n this.y = y;\n /**\n * @member {number}\n * @default 0\n */\n this.radius = radius;\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readOnly\n * @default PIXI.SHAPES.CIRC\n * @see PIXI.SHAPES\n */\n this.type = SHAPES.CIRC;\n }\n /**\n * Creates a clone of this Circle instance\n *\n * @return {PIXI.Circle} a copy of the Circle\n */\n Circle.prototype.clone = function () {\n return new Circle(this.x, this.y, this.radius);\n };\n /**\n * Checks whether the x and y coordinates given are contained within this circle\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this Circle\n */\n Circle.prototype.contains = function (x, y) {\n if (this.radius <= 0) {\n return false;\n }\n var r2 = this.radius * this.radius;\n var dx = (this.x - x);\n var dy = (this.y - y);\n dx *= dx;\n dy *= dy;\n return (dx + dy <= r2);\n };\n /**\n * Returns the framing rectangle of the circle as a Rectangle object\n *\n * @return {PIXI.Rectangle} the framing rectangle\n */\n Circle.prototype.getBounds = function () {\n return new Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2);\n };\n return Circle;\n}());\n\n/**\n * The Ellipse object is used to help draw graphics and can also be used to specify a hit area for displayObjects.\n *\n * @class\n * @memberof PIXI\n */\nvar Ellipse = /** @class */ (function () {\n /**\n * @param {number} [x=0] - The X coordinate of the center of this ellipse\n * @param {number} [y=0] - The Y coordinate of the center of this ellipse\n * @param {number} [halfWidth=0] - The half width of this ellipse\n * @param {number} [halfHeight=0] - The half height of this ellipse\n */\n function Ellipse(x, y, halfWidth, halfHeight) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (halfWidth === void 0) { halfWidth = 0; }\n if (halfHeight === void 0) { halfHeight = 0; }\n /**\n * @member {number}\n * @default 0\n */\n this.x = x;\n /**\n * @member {number}\n * @default 0\n */\n this.y = y;\n /**\n * @member {number}\n * @default 0\n */\n this.width = halfWidth;\n /**\n * @member {number}\n * @default 0\n */\n this.height = halfHeight;\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readOnly\n * @default PIXI.SHAPES.ELIP\n * @see PIXI.SHAPES\n */\n this.type = SHAPES.ELIP;\n }\n /**\n * Creates a clone of this Ellipse instance\n *\n * @return {PIXI.Ellipse} a copy of the ellipse\n */\n Ellipse.prototype.clone = function () {\n return new Ellipse(this.x, this.y, this.width, this.height);\n };\n /**\n * Checks whether the x and y coordinates given are contained within this ellipse\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coords are within this ellipse\n */\n Ellipse.prototype.contains = function (x, y) {\n if (this.width <= 0 || this.height <= 0) {\n return false;\n }\n // normalize the coords to an ellipse with center 0,0\n var normx = ((x - this.x) / this.width);\n var normy = ((y - this.y) / this.height);\n normx *= normx;\n normy *= normy;\n return (normx + normy <= 1);\n };\n /**\n * Returns the framing rectangle of the ellipse as a Rectangle object\n *\n * @return {PIXI.Rectangle} the framing rectangle\n */\n Ellipse.prototype.getBounds = function () {\n return new Rectangle(this.x - this.width, this.y - this.height, this.width, this.height);\n };\n return Ellipse;\n}());\n\n/**\n * A class to define a shape via user defined co-orinates.\n *\n * @class\n * @memberof PIXI\n */\nvar Polygon = /** @class */ (function () {\n /**\n * @param {PIXI.IPoint[]|number[]} points - This can be an array of Points\n * that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], or\n * the arguments passed can be all the points of the polygon e.g.\n * `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the arguments passed can be flat\n * x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are Numbers.\n */\n function Polygon() {\n var arguments$1 = arguments;\n\n var points = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n points[_i] = arguments$1[_i];\n }\n var flat = Array.isArray(points[0]) ? points[0] : points;\n // if this is an array of points, convert it to a flat array of numbers\n if (typeof flat[0] !== 'number') {\n var p = [];\n for (var i = 0, il = flat.length; i < il; i++) {\n p.push(flat[i].x, flat[i].y);\n }\n flat = p;\n }\n /**\n * An array of the points of this polygon\n *\n * @member {number[]}\n */\n this.points = flat;\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readOnly\n * @default PIXI.SHAPES.POLY\n * @see PIXI.SHAPES\n */\n this.type = SHAPES.POLY;\n /**\n * `false` after moveTo, `true` after `closePath`. In all other cases it is `true`.\n * @member {boolean}\n * @default true\n */\n this.closeStroke = true;\n }\n /**\n * Creates a clone of this polygon\n *\n * @return {PIXI.Polygon} a copy of the polygon\n */\n Polygon.prototype.clone = function () {\n var points = this.points.slice();\n var polygon = new Polygon(points);\n polygon.closeStroke = this.closeStroke;\n return polygon;\n };\n /**\n * Checks whether the x and y coordinates passed to this function are contained within this polygon\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this polygon\n */\n Polygon.prototype.contains = function (x, y) {\n var inside = false;\n // use some raycasting to test hits\n // https://github.com/substack/point-in-polygon/blob/master/index.js\n var length = this.points.length / 2;\n for (var i = 0, j = length - 1; i < length; j = i++) {\n var xi = this.points[i * 2];\n var yi = this.points[(i * 2) + 1];\n var xj = this.points[j * 2];\n var yj = this.points[(j * 2) + 1];\n var intersect = ((yi > y) !== (yj > y)) && (x < ((xj - xi) * ((y - yi) / (yj - yi))) + xi);\n if (intersect) {\n inside = !inside;\n }\n }\n return inside;\n };\n return Polygon;\n}());\n\n/**\n * The Rounded Rectangle object is an area that has nice rounded corners, as indicated by its\n * top-left corner point (x, y) and by its width and its height and its radius.\n *\n * @class\n * @memberof PIXI\n */\nvar RoundedRectangle = /** @class */ (function () {\n /**\n * @param {number} [x=0] - The X coordinate of the upper-left corner of the rounded rectangle\n * @param {number} [y=0] - The Y coordinate of the upper-left corner of the rounded rectangle\n * @param {number} [width=0] - The overall width of this rounded rectangle\n * @param {number} [height=0] - The overall height of this rounded rectangle\n * @param {number} [radius=20] - Controls the radius of the rounded corners\n */\n function RoundedRectangle(x, y, width, height, radius) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (width === void 0) { width = 0; }\n if (height === void 0) { height = 0; }\n if (radius === void 0) { radius = 20; }\n /**\n * @member {number}\n * @default 0\n */\n this.x = x;\n /**\n * @member {number}\n * @default 0\n */\n this.y = y;\n /**\n * @member {number}\n * @default 0\n */\n this.width = width;\n /**\n * @member {number}\n * @default 0\n */\n this.height = height;\n /**\n * @member {number}\n * @default 20\n */\n this.radius = radius;\n /**\n * The type of the object, mainly used to avoid `instanceof` checks\n *\n * @member {number}\n * @readonly\n * @default PIXI.SHAPES.RREC\n * @see PIXI.SHAPES\n */\n this.type = SHAPES.RREC;\n }\n /**\n * Creates a clone of this Rounded Rectangle\n *\n * @return {PIXI.RoundedRectangle} a copy of the rounded rectangle\n */\n RoundedRectangle.prototype.clone = function () {\n return new RoundedRectangle(this.x, this.y, this.width, this.height, this.radius);\n };\n /**\n * Checks whether the x and y coordinates given are contained within this Rounded Rectangle\n *\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @return {boolean} Whether the x/y coordinates are within this Rounded Rectangle\n */\n RoundedRectangle.prototype.contains = function (x, y) {\n if (this.width <= 0 || this.height <= 0) {\n return false;\n }\n if (x >= this.x && x <= this.x + this.width) {\n if (y >= this.y && y <= this.y + this.height) {\n if ((y >= this.y + this.radius && y <= this.y + this.height - this.radius)\n || (x >= this.x + this.radius && x <= this.x + this.width - this.radius)) {\n return true;\n }\n var dx = x - (this.x + this.radius);\n var dy = y - (this.y + this.radius);\n var radius2 = this.radius * this.radius;\n if ((dx * dx) + (dy * dy) <= radius2) {\n return true;\n }\n dx = x - (this.x + this.width - this.radius);\n if ((dx * dx) + (dy * dy) <= radius2) {\n return true;\n }\n dy = y - (this.y + this.height - this.radius);\n if ((dx * dx) + (dy * dy) <= radius2) {\n return true;\n }\n dx = x - (this.x + this.radius);\n if ((dx * dx) + (dy * dy) <= radius2) {\n return true;\n }\n }\n }\n return false;\n };\n return RoundedRectangle;\n}());\n\n/**\n * Common interface for points. Both Point and ObservablePoint implement it\n * @memberof PIXI\n * @interface IPointData\n */\n/**\n * X coord\n * @memberof PIXI.IPointData#\n * @member {number} x\n */\n/**\n * Y coord\n * @memberof PIXI.IPointData#\n * @member {number} y\n */\n\n/**\n * Common interface for points. Both Point and ObservablePoint implement it\n * @memberof PIXI\n * @interface IPoint\n * @extends PIXI.IPointData\n */\n/**\n * Sets the point to a new x and y position.\n * If y is omitted, both x and y will be set to x.\n *\n * @method set\n * @memberof PIXI.IPoint#\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=x] - position of the point on the y axis\n */\n/**\n * Copies x and y from the given point\n * @method copyFrom\n * @memberof PIXI.IPoint#\n * @param {PIXI.IPointData} p - The point to copy from\n * @returns {this} Returns itself.\n */\n/**\n * Copies x and y into the given point\n * @method copyTo\n * @memberof PIXI.IPoint#\n * @param {PIXI.IPoint} p - The point to copy.\n * @returns {PIXI.IPoint} Given point with values updated\n */\n/**\n * Returns true if the given point is equal to this point\n *\n * @method equals\n * @memberof PIXI.IPoint#\n * @param {PIXI.IPointData} p - The point to check\n * @returns {boolean} Whether the given point equal to this point\n */\n\n/**\n * The Point object represents a location in a two-dimensional coordinate system, where x represents\n * the horizontal axis and y represents the vertical axis.\n *\n * @class\n * @memberof PIXI\n * @implements IPoint\n */\nvar Point = /** @class */ (function () {\n /**\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n function Point(x, y) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n /**\n * @member {number}\n * @default 0\n */\n this.x = x;\n /**\n * @member {number}\n * @default 0\n */\n this.y = y;\n }\n /**\n * Creates a clone of this point\n *\n * @return {PIXI.Point} a copy of the point\n */\n Point.prototype.clone = function () {\n return new Point(this.x, this.y);\n };\n /**\n * Copies x and y from the given point\n *\n * @param {PIXI.IPointData} p - The point to copy from\n * @returns {this} Returns itself.\n */\n Point.prototype.copyFrom = function (p) {\n this.set(p.x, p.y);\n return this;\n };\n /**\n * Copies x and y into the given point\n *\n * @param {PIXI.IPoint} p - The point to copy.\n * @returns {PIXI.IPoint} Given point with values updated\n */\n Point.prototype.copyTo = function (p) {\n p.set(this.x, this.y);\n return p;\n };\n /**\n * Returns true if the given point is equal to this point\n *\n * @param {PIXI.IPointData} p - The point to check\n * @returns {boolean} Whether the given point equal to this point\n */\n Point.prototype.equals = function (p) {\n return (p.x === this.x) && (p.y === this.y);\n };\n /**\n * Sets the point to a new x and y position.\n * If y is omitted, both x and y will be set to x.\n *\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=x] - position of the point on the y axis\n * @returns {this} Returns itself.\n */\n Point.prototype.set = function (x, y) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = x; }\n this.x = x;\n this.y = y;\n return this;\n };\n return Point;\n}());\n\n/**\n * The Point object represents a location in a two-dimensional coordinate system, where x represents\n * the horizontal axis and y represents the vertical axis.\n *\n * An ObservablePoint is a point that triggers a callback when the point's position is changed.\n *\n * @class\n * @memberof PIXI\n * @implements IPoint\n */\nvar ObservablePoint = /** @class */ (function () {\n /**\n * @param {Function} cb - callback when changed\n * @param {object} scope - owner of callback\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n function ObservablePoint(cb, scope, x, y) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n this._x = x;\n this._y = y;\n this.cb = cb;\n this.scope = scope;\n }\n /**\n * Creates a clone of this point.\n * The callback and scope params can be overidden otherwise they will default\n * to the clone object's values.\n *\n * @override\n * @param {Function} [cb=null] - callback when changed\n * @param {object} [scope=null] - owner of callback\n * @return {PIXI.ObservablePoint} a copy of the point\n */\n ObservablePoint.prototype.clone = function (cb, scope) {\n if (cb === void 0) { cb = this.cb; }\n if (scope === void 0) { scope = this.scope; }\n return new ObservablePoint(cb, scope, this._x, this._y);\n };\n /**\n * Sets the point to a new x and y position.\n * If y is omitted, both x and y will be set to x.\n *\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=x] - position of the point on the y axis\n * @returns {this} Returns itself.\n */\n ObservablePoint.prototype.set = function (x, y) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = x; }\n if (this._x !== x || this._y !== y) {\n this._x = x;\n this._y = y;\n this.cb.call(this.scope);\n }\n return this;\n };\n /**\n * Copies x and y from the given point\n *\n * @param {PIXI.IPointData} p - The point to copy from.\n * @returns {this} Returns itself.\n */\n ObservablePoint.prototype.copyFrom = function (p) {\n if (this._x !== p.x || this._y !== p.y) {\n this._x = p.x;\n this._y = p.y;\n this.cb.call(this.scope);\n }\n return this;\n };\n /**\n * Copies x and y into the given point\n *\n * @param {PIXI.IPoint} p - The point to copy.\n * @returns {PIXI.IPoint} Given point with values updated\n */\n ObservablePoint.prototype.copyTo = function (p) {\n p.set(this._x, this._y);\n return p;\n };\n /**\n * Returns true if the given point is equal to this point\n *\n * @param {PIXI.IPointData} p - The point to check\n * @returns {boolean} Whether the given point equal to this point\n */\n ObservablePoint.prototype.equals = function (p) {\n return (p.x === this._x) && (p.y === this._y);\n };\n Object.defineProperty(ObservablePoint.prototype, \"x\", {\n /**\n * The position of the displayObject on the x axis relative to the local coordinates of the parent.\n *\n * @member {number}\n */\n get: function () {\n return this._x;\n },\n set: function (value) {\n if (this._x !== value) {\n this._x = value;\n this.cb.call(this.scope);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ObservablePoint.prototype, \"y\", {\n /**\n * The position of the displayObject on the x axis relative to the local coordinates of the parent.\n *\n * @member {number}\n */\n get: function () {\n return this._y;\n },\n set: function (value) {\n if (this._y !== value) {\n this._y = value;\n this.cb.call(this.scope);\n }\n },\n enumerable: false,\n configurable: true\n });\n return ObservablePoint;\n}());\n\n/**\n * The PixiJS Matrix as a class makes it a lot faster.\n *\n * Here is a representation of it:\n * ```js\n * | a | c | tx|\n * | b | d | ty|\n * | 0 | 0 | 1 |\n * ```\n * @class\n * @memberof PIXI\n */\nvar Matrix = /** @class */ (function () {\n /**\n * @param {number} [a=1] - x scale\n * @param {number} [b=0] - x skew\n * @param {number} [c=0] - y skew\n * @param {number} [d=1] - y scale\n * @param {number} [tx=0] - x translation\n * @param {number} [ty=0] - y translation\n */\n function Matrix(a, b, c, d, tx, ty) {\n if (a === void 0) { a = 1; }\n if (b === void 0) { b = 0; }\n if (c === void 0) { c = 0; }\n if (d === void 0) { d = 1; }\n if (tx === void 0) { tx = 0; }\n if (ty === void 0) { ty = 0; }\n this.array = null;\n /**\n * @member {number}\n * @default 1\n */\n this.a = a;\n /**\n * @member {number}\n * @default 0\n */\n this.b = b;\n /**\n * @member {number}\n * @default 0\n */\n this.c = c;\n /**\n * @member {number}\n * @default 1\n */\n this.d = d;\n /**\n * @member {number}\n * @default 0\n */\n this.tx = tx;\n /**\n * @member {number}\n * @default 0\n */\n this.ty = ty;\n }\n /**\n * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:\n *\n * a = array[0]\n * b = array[1]\n * c = array[3]\n * d = array[4]\n * tx = array[2]\n * ty = array[5]\n *\n * @param {number[]} array - The array that the matrix will be populated from.\n */\n Matrix.prototype.fromArray = function (array) {\n this.a = array[0];\n this.b = array[1];\n this.c = array[3];\n this.d = array[4];\n this.tx = array[2];\n this.ty = array[5];\n };\n /**\n * sets the matrix properties\n *\n * @param {number} a - Matrix component\n * @param {number} b - Matrix component\n * @param {number} c - Matrix component\n * @param {number} d - Matrix component\n * @param {number} tx - Matrix component\n * @param {number} ty - Matrix component\n *\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n Matrix.prototype.set = function (a, b, c, d, tx, ty) {\n this.a = a;\n this.b = b;\n this.c = c;\n this.d = d;\n this.tx = tx;\n this.ty = ty;\n return this;\n };\n /**\n * Creates an array from the current Matrix object.\n *\n * @param {boolean} transpose - Whether we need to transpose the matrix or not\n * @param {Float32Array} [out=new Float32Array(9)] - If provided the array will be assigned to out\n * @return {number[]} the newly created array which contains the matrix\n */\n Matrix.prototype.toArray = function (transpose, out) {\n if (!this.array) {\n this.array = new Float32Array(9);\n }\n var array = out || this.array;\n if (transpose) {\n array[0] = this.a;\n array[1] = this.b;\n array[2] = 0;\n array[3] = this.c;\n array[4] = this.d;\n array[5] = 0;\n array[6] = this.tx;\n array[7] = this.ty;\n array[8] = 1;\n }\n else {\n array[0] = this.a;\n array[1] = this.c;\n array[2] = this.tx;\n array[3] = this.b;\n array[4] = this.d;\n array[5] = this.ty;\n array[6] = 0;\n array[7] = 0;\n array[8] = 1;\n }\n return array;\n };\n /**\n * Get a new position with the current transformation applied.\n * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)\n *\n * @param {PIXI.IPointData} pos - The origin\n * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)\n * @return {PIXI.Point} The new point, transformed through this matrix\n */\n Matrix.prototype.apply = function (pos, newPos) {\n newPos = (newPos || new Point());\n var x = pos.x;\n var y = pos.y;\n newPos.x = (this.a * x) + (this.c * y) + this.tx;\n newPos.y = (this.b * x) + (this.d * y) + this.ty;\n return newPos;\n };\n /**\n * Get a new position with the inverse of the current transformation applied.\n * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input)\n *\n * @param {PIXI.IPointData} pos - The origin\n * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)\n * @return {PIXI.Point} The new point, inverse-transformed through this matrix\n */\n Matrix.prototype.applyInverse = function (pos, newPos) {\n newPos = (newPos || new Point());\n var id = 1 / ((this.a * this.d) + (this.c * -this.b));\n var x = pos.x;\n var y = pos.y;\n newPos.x = (this.d * id * x) + (-this.c * id * y) + (((this.ty * this.c) - (this.tx * this.d)) * id);\n newPos.y = (this.a * id * y) + (-this.b * id * x) + (((-this.ty * this.a) + (this.tx * this.b)) * id);\n return newPos;\n };\n /**\n * Translates the matrix on the x and y.\n *\n * @param {number} x - How much to translate x by\n * @param {number} y - How much to translate y by\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n Matrix.prototype.translate = function (x, y) {\n this.tx += x;\n this.ty += y;\n return this;\n };\n /**\n * Applies a scale transformation to the matrix.\n *\n * @param {number} x - The amount to scale horizontally\n * @param {number} y - The amount to scale vertically\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n Matrix.prototype.scale = function (x, y) {\n this.a *= x;\n this.d *= y;\n this.c *= x;\n this.b *= y;\n this.tx *= x;\n this.ty *= y;\n return this;\n };\n /**\n * Applies a rotation transformation to the matrix.\n *\n * @param {number} angle - The angle in radians.\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n Matrix.prototype.rotate = function (angle) {\n var cos = Math.cos(angle);\n var sin = Math.sin(angle);\n var a1 = this.a;\n var c1 = this.c;\n var tx1 = this.tx;\n this.a = (a1 * cos) - (this.b * sin);\n this.b = (a1 * sin) + (this.b * cos);\n this.c = (c1 * cos) - (this.d * sin);\n this.d = (c1 * sin) + (this.d * cos);\n this.tx = (tx1 * cos) - (this.ty * sin);\n this.ty = (tx1 * sin) + (this.ty * cos);\n return this;\n };\n /**\n * Appends the given Matrix to this Matrix.\n *\n * @param {PIXI.Matrix} matrix - The matrix to append.\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n Matrix.prototype.append = function (matrix) {\n var a1 = this.a;\n var b1 = this.b;\n var c1 = this.c;\n var d1 = this.d;\n this.a = (matrix.a * a1) + (matrix.b * c1);\n this.b = (matrix.a * b1) + (matrix.b * d1);\n this.c = (matrix.c * a1) + (matrix.d * c1);\n this.d = (matrix.c * b1) + (matrix.d * d1);\n this.tx = (matrix.tx * a1) + (matrix.ty * c1) + this.tx;\n this.ty = (matrix.tx * b1) + (matrix.ty * d1) + this.ty;\n return this;\n };\n /**\n * Sets the matrix based on all the available properties\n *\n * @param {number} x - Position on the x axis\n * @param {number} y - Position on the y axis\n * @param {number} pivotX - Pivot on the x axis\n * @param {number} pivotY - Pivot on the y axis\n * @param {number} scaleX - Scale on the x axis\n * @param {number} scaleY - Scale on the y axis\n * @param {number} rotation - Rotation in radians\n * @param {number} skewX - Skew on the x axis\n * @param {number} skewY - Skew on the y axis\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n Matrix.prototype.setTransform = function (x, y, pivotX, pivotY, scaleX, scaleY, rotation, skewX, skewY) {\n this.a = Math.cos(rotation + skewY) * scaleX;\n this.b = Math.sin(rotation + skewY) * scaleX;\n this.c = -Math.sin(rotation - skewX) * scaleY;\n this.d = Math.cos(rotation - skewX) * scaleY;\n this.tx = x - ((pivotX * this.a) + (pivotY * this.c));\n this.ty = y - ((pivotX * this.b) + (pivotY * this.d));\n return this;\n };\n /**\n * Prepends the given Matrix to this Matrix.\n *\n * @param {PIXI.Matrix} matrix - The matrix to prepend\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n Matrix.prototype.prepend = function (matrix) {\n var tx1 = this.tx;\n if (matrix.a !== 1 || matrix.b !== 0 || matrix.c !== 0 || matrix.d !== 1) {\n var a1 = this.a;\n var c1 = this.c;\n this.a = (a1 * matrix.a) + (this.b * matrix.c);\n this.b = (a1 * matrix.b) + (this.b * matrix.d);\n this.c = (c1 * matrix.a) + (this.d * matrix.c);\n this.d = (c1 * matrix.b) + (this.d * matrix.d);\n }\n this.tx = (tx1 * matrix.a) + (this.ty * matrix.c) + matrix.tx;\n this.ty = (tx1 * matrix.b) + (this.ty * matrix.d) + matrix.ty;\n return this;\n };\n /**\n * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform.\n *\n * @param {PIXI.Transform} transform - The transform to apply the properties to.\n * @return {PIXI.Transform} The transform with the newly applied properties\n */\n Matrix.prototype.decompose = function (transform) {\n // sort out rotation / skew..\n var a = this.a;\n var b = this.b;\n var c = this.c;\n var d = this.d;\n var skewX = -Math.atan2(-c, d);\n var skewY = Math.atan2(b, a);\n var delta = Math.abs(skewX + skewY);\n if (delta < 0.00001 || Math.abs(PI_2 - delta) < 0.00001) {\n transform.rotation = skewY;\n transform.skew.x = transform.skew.y = 0;\n }\n else {\n transform.rotation = 0;\n transform.skew.x = skewX;\n transform.skew.y = skewY;\n }\n // next set scale\n transform.scale.x = Math.sqrt((a * a) + (b * b));\n transform.scale.y = Math.sqrt((c * c) + (d * d));\n // next set position\n transform.position.x = this.tx;\n transform.position.y = this.ty;\n return transform;\n };\n /**\n * Inverts this matrix\n *\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n Matrix.prototype.invert = function () {\n var a1 = this.a;\n var b1 = this.b;\n var c1 = this.c;\n var d1 = this.d;\n var tx1 = this.tx;\n var n = (a1 * d1) - (b1 * c1);\n this.a = d1 / n;\n this.b = -b1 / n;\n this.c = -c1 / n;\n this.d = a1 / n;\n this.tx = ((c1 * this.ty) - (d1 * tx1)) / n;\n this.ty = -((a1 * this.ty) - (b1 * tx1)) / n;\n return this;\n };\n /**\n * Resets this Matrix to an identity (default) matrix.\n *\n * @return {PIXI.Matrix} This matrix. Good for chaining method calls.\n */\n Matrix.prototype.identity = function () {\n this.a = 1;\n this.b = 0;\n this.c = 0;\n this.d = 1;\n this.tx = 0;\n this.ty = 0;\n return this;\n };\n /**\n * Creates a new Matrix object with the same values as this one.\n *\n * @return {PIXI.Matrix} A copy of this matrix. Good for chaining method calls.\n */\n Matrix.prototype.clone = function () {\n var matrix = new Matrix();\n matrix.a = this.a;\n matrix.b = this.b;\n matrix.c = this.c;\n matrix.d = this.d;\n matrix.tx = this.tx;\n matrix.ty = this.ty;\n return matrix;\n };\n /**\n * Changes the values of the given matrix to be the same as the ones in this matrix\n *\n * @param {PIXI.Matrix} matrix - The matrix to copy to.\n * @return {PIXI.Matrix} The matrix given in parameter with its values updated.\n */\n Matrix.prototype.copyTo = function (matrix) {\n matrix.a = this.a;\n matrix.b = this.b;\n matrix.c = this.c;\n matrix.d = this.d;\n matrix.tx = this.tx;\n matrix.ty = this.ty;\n return matrix;\n };\n /**\n * Changes the values of the matrix to be the same as the ones in given matrix\n *\n * @param {PIXI.Matrix} matrix - The matrix to copy from.\n * @return {PIXI.Matrix} this\n */\n Matrix.prototype.copyFrom = function (matrix) {\n this.a = matrix.a;\n this.b = matrix.b;\n this.c = matrix.c;\n this.d = matrix.d;\n this.tx = matrix.tx;\n this.ty = matrix.ty;\n return this;\n };\n Object.defineProperty(Matrix, \"IDENTITY\", {\n /**\n * A default (identity) matrix\n *\n * @static\n * @const\n * @member {PIXI.Matrix}\n */\n get: function () {\n return new Matrix();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Matrix, \"TEMP_MATRIX\", {\n /**\n * A temp matrix\n *\n * @static\n * @const\n * @member {PIXI.Matrix}\n */\n get: function () {\n return new Matrix();\n },\n enumerable: false,\n configurable: true\n });\n return Matrix;\n}());\n\n// Your friendly neighbour https://en.wikipedia.org/wiki/Dihedral_group\n/*\n * Transform matrix for operation n is:\n * | ux | vx |\n * | uy | vy |\n */\nvar ux = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1];\nvar uy = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1];\nvar vx = [0, -1, -1, -1, 0, 1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1];\nvar vy = [1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, 1, 1, 1, 0, -1];\n/**\n * [Cayley Table]{@link https://en.wikipedia.org/wiki/Cayley_table}\n * for the composition of each rotation in the dihederal group D8.\n *\n * @type number[][]\n * @private\n */\nvar rotationCayley = [];\n/**\n * Matrices for each `GD8Symmetry` rotation.\n *\n * @type Matrix[]\n * @private\n */\nvar rotationMatrices = [];\n/*\n * Alias for {@code Math.sign}.\n */\nvar signum = Math.sign;\n/*\n * Initializes `rotationCayley` and `rotationMatrices`. It is called\n * only once below.\n */\nfunction init() {\n for (var i = 0; i < 16; i++) {\n var row = [];\n rotationCayley.push(row);\n for (var j = 0; j < 16; j++) {\n /* Multiplies rotation matrices i and j. */\n var _ux = signum((ux[i] * ux[j]) + (vx[i] * uy[j]));\n var _uy = signum((uy[i] * ux[j]) + (vy[i] * uy[j]));\n var _vx = signum((ux[i] * vx[j]) + (vx[i] * vy[j]));\n var _vy = signum((uy[i] * vx[j]) + (vy[i] * vy[j]));\n /* Finds rotation matrix matching the product and pushes it. */\n for (var k = 0; k < 16; k++) {\n if (ux[k] === _ux && uy[k] === _uy\n && vx[k] === _vx && vy[k] === _vy) {\n row.push(k);\n break;\n }\n }\n }\n }\n for (var i = 0; i < 16; i++) {\n var mat = new Matrix();\n mat.set(ux[i], uy[i], vx[i], vy[i], 0, 0);\n rotationMatrices.push(mat);\n }\n}\ninit();\n/**\n * @memberof PIXI\n * @typedef {number} GD8Symmetry\n * @see PIXI.groupD8\n */\n/**\n * Implements the dihedral group D8, which is similar to\n * [group D4]{@link http://mathworld.wolfram.com/DihedralGroupD4.html};\n * D8 is the same but with diagonals, and it is used for texture\n * rotations.\n *\n * The directions the U- and V- axes after rotation\n * of an angle of `a: GD8Constant` are the vectors `(uX(a), uY(a))`\n * and `(vX(a), vY(a))`. These aren't necessarily unit vectors.\n *\n * **Origin:**
\n * This is the small part of gameofbombs.com portal system. It works.\n *\n * @see PIXI.groupD8.E\n * @see PIXI.groupD8.SE\n * @see PIXI.groupD8.S\n * @see PIXI.groupD8.SW\n * @see PIXI.groupD8.W\n * @see PIXI.groupD8.NW\n * @see PIXI.groupD8.N\n * @see PIXI.groupD8.NE\n * @author Ivan @ivanpopelyshev\n * @namespace PIXI.groupD8\n * @memberof PIXI\n */\nvar groupD8 = {\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 0° | East |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n E: 0,\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 45°↻ | Southeast |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n SE: 1,\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 90°↻ | South |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n S: 2,\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 135°↻ | Southwest |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n SW: 3,\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 180° | West |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n W: 4,\n /**\n * | Rotation | Direction |\n * |-------------|--------------|\n * | -135°/225°↻ | Northwest |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n NW: 5,\n /**\n * | Rotation | Direction |\n * |-------------|--------------|\n * | -90°/270°↻ | North |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n N: 6,\n /**\n * | Rotation | Direction |\n * |-------------|--------------|\n * | -45°/315°↻ | Northeast |\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n NE: 7,\n /**\n * Reflection about Y-axis.\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n MIRROR_VERTICAL: 8,\n /**\n * Reflection about the main diagonal.\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n MAIN_DIAGONAL: 10,\n /**\n * Reflection about X-axis.\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n MIRROR_HORIZONTAL: 12,\n /**\n * Reflection about reverse diagonal.\n *\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n REVERSE_DIAGONAL: 14,\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.\n * @return {PIXI.GD8Symmetry} The X-component of the U-axis\n * after rotating the axes.\n */\n uX: function (ind) { return ux[ind]; },\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.\n * @return {PIXI.GD8Symmetry} The Y-component of the U-axis\n * after rotating the axes.\n */\n uY: function (ind) { return uy[ind]; },\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.\n * @return {PIXI.GD8Symmetry} The X-component of the V-axis\n * after rotating the axes.\n */\n vX: function (ind) { return vx[ind]; },\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.\n * @return {PIXI.GD8Symmetry} The Y-component of the V-axis\n * after rotating the axes.\n */\n vY: function (ind) { return vy[ind]; },\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} rotation - symmetry whose opposite\n * is needed. Only rotations have opposite symmetries while\n * reflections don't.\n * @return {PIXI.GD8Symmetry} The opposite symmetry of `rotation`\n */\n inv: function (rotation) {\n if (rotation & 8) // true only if between 8 & 15 (reflections)\n {\n return rotation & 15; // or rotation % 16\n }\n return (-rotation) & 7; // or (8 - rotation) % 8\n },\n /**\n * Composes the two D8 operations.\n *\n * Taking `^` as reflection:\n *\n * | | E=0 | S=2 | W=4 | N=6 | E^=8 | S^=10 | W^=12 | N^=14 |\n * |-------|-----|-----|-----|-----|------|-------|-------|-------|\n * | E=0 | E | S | W | N | E^ | S^ | W^ | N^ |\n * | S=2 | S | W | N | E | S^ | W^ | N^ | E^ |\n * | W=4 | W | N | E | S | W^ | N^ | E^ | S^ |\n * | N=6 | N | E | S | W | N^ | E^ | S^ | W^ |\n * | E^=8 | E^ | N^ | W^ | S^ | E | N | W | S |\n * | S^=10 | S^ | E^ | N^ | W^ | S | E | N | W |\n * | W^=12 | W^ | S^ | E^ | N^ | W | S | E | N |\n * | N^=14 | N^ | W^ | S^ | E^ | N | W | S | E |\n *\n * [This is a Cayley table]{@link https://en.wikipedia.org/wiki/Cayley_table}\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} rotationSecond - Second operation, which\n * is the row in the above cayley table.\n * @param {PIXI.GD8Symmetry} rotationFirst - First operation, which\n * is the column in the above cayley table.\n * @return {PIXI.GD8Symmetry} Composed operation\n */\n add: function (rotationSecond, rotationFirst) { return (rotationCayley[rotationSecond][rotationFirst]); },\n /**\n * Reverse of `add`.\n *\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} rotationSecond - Second operation\n * @param {PIXI.GD8Symmetry} rotationFirst - First operation\n * @return {PIXI.GD8Symmetry} Result\n */\n sub: function (rotationSecond, rotationFirst) { return (rotationCayley[rotationSecond][groupD8.inv(rotationFirst)]); },\n /**\n * Adds 180 degrees to rotation, which is a commutative\n * operation.\n *\n * @memberof PIXI.groupD8\n * @param {number} rotation - The number to rotate.\n * @returns {number} Rotated number\n */\n rotate180: function (rotation) { return rotation ^ 4; },\n /**\n * Checks if the rotation angle is vertical, i.e. south\n * or north. It doesn't work for reflections.\n *\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} rotation - The number to check.\n * @returns {boolean} Whether or not the direction is vertical\n */\n isVertical: function (rotation) { return (rotation & 3) === 2; },\n /**\n * Approximates the vector `V(dx,dy)` into one of the\n * eight directions provided by `groupD8`.\n *\n * @memberof PIXI.groupD8\n * @param {number} dx - X-component of the vector\n * @param {number} dy - Y-component of the vector\n * @return {PIXI.GD8Symmetry} Approximation of the vector into\n * one of the eight symmetries.\n */\n byDirection: function (dx, dy) {\n if (Math.abs(dx) * 2 <= Math.abs(dy)) {\n if (dy >= 0) {\n return groupD8.S;\n }\n return groupD8.N;\n }\n else if (Math.abs(dy) * 2 <= Math.abs(dx)) {\n if (dx > 0) {\n return groupD8.E;\n }\n return groupD8.W;\n }\n else if (dy > 0) {\n if (dx > 0) {\n return groupD8.SE;\n }\n return groupD8.SW;\n }\n else if (dx > 0) {\n return groupD8.NE;\n }\n return groupD8.NW;\n },\n /**\n * Helps sprite to compensate texture packer rotation.\n *\n * @memberof PIXI.groupD8\n * @param {PIXI.Matrix} matrix - sprite world matrix\n * @param {PIXI.GD8Symmetry} rotation - The rotation factor to use.\n * @param {number} tx - sprite anchoring\n * @param {number} ty - sprite anchoring\n */\n matrixAppendRotationInv: function (matrix, rotation, tx, ty) {\n if (tx === void 0) { tx = 0; }\n if (ty === void 0) { ty = 0; }\n // Packer used \"rotation\", we use \"inv(rotation)\"\n var mat = rotationMatrices[groupD8.inv(rotation)];\n mat.tx = tx;\n mat.ty = ty;\n matrix.append(mat);\n },\n};\n\n/**\n * Transform that takes care about its versions\n *\n * @class\n * @memberof PIXI\n */\nvar Transform = /** @class */ (function () {\n function Transform() {\n /**\n * The world transformation matrix.\n *\n * @member {PIXI.Matrix}\n */\n this.worldTransform = new Matrix();\n /**\n * The local transformation matrix.\n *\n * @member {PIXI.Matrix}\n */\n this.localTransform = new Matrix();\n /**\n * The coordinate of the object relative to the local coordinates of the parent.\n *\n * @member {PIXI.ObservablePoint}\n */\n this.position = new ObservablePoint(this.onChange, this, 0, 0);\n /**\n * The scale factor of the object.\n *\n * @member {PIXI.ObservablePoint}\n */\n this.scale = new ObservablePoint(this.onChange, this, 1, 1);\n /**\n * The pivot point of the displayObject that it rotates around.\n *\n * @member {PIXI.ObservablePoint}\n */\n this.pivot = new ObservablePoint(this.onChange, this, 0, 0);\n /**\n * The skew amount, on the x and y axis.\n *\n * @member {PIXI.ObservablePoint}\n */\n this.skew = new ObservablePoint(this.updateSkew, this, 0, 0);\n /**\n * The rotation amount.\n *\n * @protected\n * @member {number}\n */\n this._rotation = 0;\n /**\n * The X-coordinate value of the normalized local X axis,\n * the first column of the local transformation matrix without a scale.\n *\n * @protected\n * @member {number}\n */\n this._cx = 1;\n /**\n * The Y-coordinate value of the normalized local X axis,\n * the first column of the local transformation matrix without a scale.\n *\n * @protected\n * @member {number}\n */\n this._sx = 0;\n /**\n * The X-coordinate value of the normalized local Y axis,\n * the second column of the local transformation matrix without a scale.\n *\n * @protected\n * @member {number}\n */\n this._cy = 0;\n /**\n * The Y-coordinate value of the normalized local Y axis,\n * the second column of the local transformation matrix without a scale.\n *\n * @protected\n * @member {number}\n */\n this._sy = 1;\n /**\n * The locally unique ID of the local transform.\n *\n * @protected\n * @member {number}\n */\n this._localID = 0;\n /**\n * The locally unique ID of the local transform\n * used to calculate the current local transformation matrix.\n *\n * @protected\n * @member {number}\n */\n this._currentLocalID = 0;\n /**\n * The locally unique ID of the world transform.\n *\n * @protected\n * @member {number}\n */\n this._worldID = 0;\n /**\n * The locally unique ID of the parent's world transform\n * used to calculate the current world transformation matrix.\n *\n * @protected\n * @member {number}\n */\n this._parentID = 0;\n }\n /**\n * Called when a value changes.\n *\n * @protected\n */\n Transform.prototype.onChange = function () {\n this._localID++;\n };\n /**\n * Called when the skew or the rotation changes.\n *\n * @protected\n */\n Transform.prototype.updateSkew = function () {\n this._cx = Math.cos(this._rotation + this.skew.y);\n this._sx = Math.sin(this._rotation + this.skew.y);\n this._cy = -Math.sin(this._rotation - this.skew.x); // cos, added PI/2\n this._sy = Math.cos(this._rotation - this.skew.x); // sin, added PI/2\n this._localID++;\n };\n /**\n * Updates the local transformation matrix.\n */\n Transform.prototype.updateLocalTransform = function () {\n var lt = this.localTransform;\n if (this._localID !== this._currentLocalID) {\n // get the matrix values of the displayobject based on its transform properties..\n lt.a = this._cx * this.scale.x;\n lt.b = this._sx * this.scale.x;\n lt.c = this._cy * this.scale.y;\n lt.d = this._sy * this.scale.y;\n lt.tx = this.position.x - ((this.pivot.x * lt.a) + (this.pivot.y * lt.c));\n lt.ty = this.position.y - ((this.pivot.x * lt.b) + (this.pivot.y * lt.d));\n this._currentLocalID = this._localID;\n // force an update..\n this._parentID = -1;\n }\n };\n /**\n * Updates the local and the world transformation matrices.\n *\n * @param {PIXI.Transform} parentTransform - The parent transform\n */\n Transform.prototype.updateTransform = function (parentTransform) {\n var lt = this.localTransform;\n if (this._localID !== this._currentLocalID) {\n // get the matrix values of the displayobject based on its transform properties..\n lt.a = this._cx * this.scale.x;\n lt.b = this._sx * this.scale.x;\n lt.c = this._cy * this.scale.y;\n lt.d = this._sy * this.scale.y;\n lt.tx = this.position.x - ((this.pivot.x * lt.a) + (this.pivot.y * lt.c));\n lt.ty = this.position.y - ((this.pivot.x * lt.b) + (this.pivot.y * lt.d));\n this._currentLocalID = this._localID;\n // force an update..\n this._parentID = -1;\n }\n if (this._parentID !== parentTransform._worldID) {\n // concat the parent matrix with the objects transform.\n var pt = parentTransform.worldTransform;\n var wt = this.worldTransform;\n wt.a = (lt.a * pt.a) + (lt.b * pt.c);\n wt.b = (lt.a * pt.b) + (lt.b * pt.d);\n wt.c = (lt.c * pt.a) + (lt.d * pt.c);\n wt.d = (lt.c * pt.b) + (lt.d * pt.d);\n wt.tx = (lt.tx * pt.a) + (lt.ty * pt.c) + pt.tx;\n wt.ty = (lt.tx * pt.b) + (lt.ty * pt.d) + pt.ty;\n this._parentID = parentTransform._worldID;\n // update the id of the transform..\n this._worldID++;\n }\n };\n /**\n * Decomposes a matrix and sets the transforms properties based on it.\n *\n * @param {PIXI.Matrix} matrix - The matrix to decompose\n */\n Transform.prototype.setFromMatrix = function (matrix) {\n matrix.decompose(this);\n this._localID++;\n };\n Object.defineProperty(Transform.prototype, \"rotation\", {\n /**\n * The rotation of the object in radians.\n *\n * @member {number}\n */\n get: function () {\n return this._rotation;\n },\n set: function (value) {\n if (this._rotation !== value) {\n this._rotation = value;\n this.updateSkew();\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * A default (identity) transform\n *\n * @static\n * @constant\n * @member {PIXI.Transform}\n */\n Transform.IDENTITY = new Transform();\n return Transform;\n}());\n\n/**\n * Math classes and utilities mixed into PIXI namespace.\n *\n * @lends PIXI\n */\n\nexport { Circle, DEG_TO_RAD, Ellipse, Matrix, ObservablePoint, PI_2, Point, Polygon, RAD_TO_DEG, Rectangle, RoundedRectangle, SHAPES, Transform, groupD8 };\n//# sourceMappingURL=math.es.js.map\n","var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nvar MiniSignalBinding = (function () {\n function MiniSignalBinding(fn, once, thisArg) {\n if (once === undefined) once = false;\n\n _classCallCheck(this, MiniSignalBinding);\n\n this._fn = fn;\n this._once = once;\n this._thisArg = thisArg;\n this._next = this._prev = this._owner = null;\n }\n\n _createClass(MiniSignalBinding, [{\n key: 'detach',\n value: function detach() {\n if (this._owner === null) return false;\n this._owner.detach(this);\n return true;\n }\n }]);\n\n return MiniSignalBinding;\n})();\n\nfunction _addMiniSignalBinding(self, node) {\n if (!self._head) {\n self._head = node;\n self._tail = node;\n } else {\n self._tail._next = node;\n node._prev = self._tail;\n self._tail = node;\n }\n\n node._owner = self;\n\n return node;\n}\n\nvar MiniSignal = (function () {\n function MiniSignal() {\n _classCallCheck(this, MiniSignal);\n\n this._head = this._tail = undefined;\n }\n\n _createClass(MiniSignal, [{\n key: 'handlers',\n value: function handlers() {\n var exists = arguments.length <= 0 || arguments[0] === undefined ? false : arguments[0];\n\n var node = this._head;\n\n if (exists) return !!node;\n\n var ee = [];\n\n while (node) {\n ee.push(node);\n node = node._next;\n }\n\n return ee;\n }\n }, {\n key: 'has',\n value: function has(node) {\n if (!(node instanceof MiniSignalBinding)) {\n throw new Error('MiniSignal#has(): First arg must be a MiniSignalBinding object.');\n }\n\n return node._owner === this;\n }\n }, {\n key: 'dispatch',\n value: function dispatch() {\n var node = this._head;\n\n if (!node) return false;\n\n while (node) {\n if (node._once) this.detach(node);\n node._fn.apply(node._thisArg, arguments);\n node = node._next;\n }\n\n return true;\n }\n }, {\n key: 'add',\n value: function add(fn) {\n var thisArg = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];\n\n if (typeof fn !== 'function') {\n throw new Error('MiniSignal#add(): First arg must be a Function.');\n }\n return _addMiniSignalBinding(this, new MiniSignalBinding(fn, false, thisArg));\n }\n }, {\n key: 'once',\n value: function once(fn) {\n var thisArg = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];\n\n if (typeof fn !== 'function') {\n throw new Error('MiniSignal#once(): First arg must be a Function.');\n }\n return _addMiniSignalBinding(this, new MiniSignalBinding(fn, true, thisArg));\n }\n }, {\n key: 'detach',\n value: function detach(node) {\n if (!(node instanceof MiniSignalBinding)) {\n throw new Error('MiniSignal#detach(): First arg must be a MiniSignalBinding object.');\n }\n if (node._owner !== this) return this;\n\n if (node._prev) node._prev._next = node._next;\n if (node._next) node._next._prev = node._prev;\n\n if (node === this._head) {\n this._head = node._next;\n if (node._next === null) {\n this._tail = null;\n }\n } else if (node === this._tail) {\n this._tail = node._prev;\n this._tail._next = null;\n }\n\n node._owner = null;\n return this;\n }\n }, {\n key: 'detachAll',\n value: function detachAll() {\n var node = this._head;\n if (!node) return this;\n\n this._head = this._tail = null;\n\n while (node) {\n node._owner = null;\n node = node._next;\n }\n return this;\n }\n }]);\n\n return MiniSignal;\n})();\n\nMiniSignal.MiniSignalBinding = MiniSignalBinding;\n\nexports['default'] = MiniSignal;\nmodule.exports = exports['default'];\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var baseProperty = require('./_baseProperty'),\n basePropertyDeep = require('./_basePropertyDeep'),\n isKey = require('./_isKey'),\n toKey = require('./_toKey');\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = property;\n","/**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseIndexOfWith;\n","var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n","var baseIsMatch = require('./_baseIsMatch'),\n getMatchData = require('./_getMatchData'),\n matchesStrictComparable = require('./_matchesStrictComparable');\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nmodule.exports = baseMatches;\n","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar stringifyPrimitive = function(v) {\n switch (typeof v) {\n case 'string':\n return v;\n\n case 'boolean':\n return v ? 'true' : 'false';\n\n case 'number':\n return isFinite(v) ? v : '';\n\n default:\n return '';\n }\n};\n\nmodule.exports = function(obj, sep, eq, name) {\n sep = sep || '&';\n eq = eq || '=';\n if (obj === null) {\n obj = undefined;\n }\n\n if (typeof obj === 'object') {\n return map(objectKeys(obj), function(k) {\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n if (isArray(obj[k])) {\n return map(obj[k], function(v) {\n return ks + encodeURIComponent(stringifyPrimitive(v));\n }).join(sep);\n } else {\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n }\n }).join(sep);\n\n }\n\n if (!name) return '';\n return encodeURIComponent(stringifyPrimitive(name)) + eq +\n encodeURIComponent(stringifyPrimitive(obj));\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\nfunction map (xs, f) {\n if (xs.map) return xs.map(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n res.push(f(xs[i], i));\n }\n return res;\n}\n\nvar objectKeys = Object.keys || function (obj) {\n var res = [];\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);\n }\n return res;\n};\n","/*!\n * @pixi/ticker - v5.3.7\n * Compiled Tue, 29 Dec 2020 19:30:11 UTC\n *\n * @pixi/ticker is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { settings } from '@pixi/settings';\n\n/**\n * Target frames per millisecond.\n *\n * @static\n * @name TARGET_FPMS\n * @memberof PIXI.settings\n * @type {number}\n * @default 0.06\n */\nsettings.TARGET_FPMS = 0.06;\n\n/**\n * Represents the update priorities used by internal PIXI classes when registered with\n * the {@link PIXI.Ticker} object. Higher priority items are updated first and lower\n * priority items, such as render, should go later.\n *\n * @static\n * @constant\n * @name UPDATE_PRIORITY\n * @memberof PIXI\n * @enum {number}\n * @property {number} INTERACTION=50 Highest priority, used for {@link PIXI.InteractionManager}\n * @property {number} HIGH=25 High priority updating, {@link PIXI.VideoBaseTexture} and {@link PIXI.AnimatedSprite}\n * @property {number} NORMAL=0 Default priority for ticker events, see {@link PIXI.Ticker#add}.\n * @property {number} LOW=-25 Low priority used for {@link PIXI.Application} rendering.\n * @property {number} UTILITY=-50 Lowest priority used for {@link PIXI.BasePrepare} utility.\n */\nvar UPDATE_PRIORITY;\n(function (UPDATE_PRIORITY) {\n UPDATE_PRIORITY[UPDATE_PRIORITY[\"INTERACTION\"] = 50] = \"INTERACTION\";\n UPDATE_PRIORITY[UPDATE_PRIORITY[\"HIGH\"] = 25] = \"HIGH\";\n UPDATE_PRIORITY[UPDATE_PRIORITY[\"NORMAL\"] = 0] = \"NORMAL\";\n UPDATE_PRIORITY[UPDATE_PRIORITY[\"LOW\"] = -25] = \"LOW\";\n UPDATE_PRIORITY[UPDATE_PRIORITY[\"UTILITY\"] = -50] = \"UTILITY\";\n})(UPDATE_PRIORITY || (UPDATE_PRIORITY = {}));\n\n/**\n * Internal class for handling the priority sorting of ticker handlers.\n *\n * @private\n * @class\n * @memberof PIXI\n */\nvar TickerListener = /** @class */ (function () {\n /**\n * Constructor\n * @private\n * @param {Function} fn - The listener function to be added for one update\n * @param {*} [context=null] - The listener context\n * @param {number} [priority=0] - The priority for emitting\n * @param {boolean} [once=false] - If the handler should fire once\n */\n function TickerListener(fn, context, priority, once) {\n if (context === void 0) { context = null; }\n if (priority === void 0) { priority = 0; }\n if (once === void 0) { once = false; }\n /**\n * The handler function to execute.\n * @private\n * @member {Function}\n */\n this.fn = fn;\n /**\n * The calling to execute.\n * @private\n * @member {*}\n */\n this.context = context;\n /**\n * The current priority.\n * @private\n * @member {number}\n */\n this.priority = priority;\n /**\n * If this should only execute once.\n * @private\n * @member {boolean}\n */\n this.once = once;\n /**\n * The next item in chain.\n * @private\n * @member {TickerListener}\n */\n this.next = null;\n /**\n * The previous item in chain.\n * @private\n * @member {TickerListener}\n */\n this.previous = null;\n /**\n * `true` if this listener has been destroyed already.\n * @member {boolean}\n * @private\n */\n this._destroyed = false;\n }\n /**\n * Simple compare function to figure out if a function and context match.\n * @private\n * @param {Function} fn - The listener function to be added for one update\n * @param {any} [context] - The listener context\n * @return {boolean} `true` if the listener match the arguments\n */\n TickerListener.prototype.match = function (fn, context) {\n if (context === void 0) { context = null; }\n return this.fn === fn && this.context === context;\n };\n /**\n * Emit by calling the current function.\n * @private\n * @param {number} deltaTime - time since the last emit.\n * @return {TickerListener} Next ticker\n */\n TickerListener.prototype.emit = function (deltaTime) {\n if (this.fn) {\n if (this.context) {\n this.fn.call(this.context, deltaTime);\n }\n else {\n this.fn(deltaTime);\n }\n }\n var redirect = this.next;\n if (this.once) {\n this.destroy(true);\n }\n // Soft-destroying should remove\n // the next reference\n if (this._destroyed) {\n this.next = null;\n }\n return redirect;\n };\n /**\n * Connect to the list.\n * @private\n * @param {TickerListener} previous - Input node, previous listener\n */\n TickerListener.prototype.connect = function (previous) {\n this.previous = previous;\n if (previous.next) {\n previous.next.previous = this;\n }\n this.next = previous.next;\n previous.next = this;\n };\n /**\n * Destroy and don't use after this.\n * @private\n * @param {boolean} [hard = false] `true` to remove the `next` reference, this\n * is considered a hard destroy. Soft destroy maintains the next reference.\n * @return {TickerListener} The listener to redirect while emitting or removing.\n */\n TickerListener.prototype.destroy = function (hard) {\n if (hard === void 0) { hard = false; }\n this._destroyed = true;\n this.fn = null;\n this.context = null;\n // Disconnect, hook up next and previous\n if (this.previous) {\n this.previous.next = this.next;\n }\n if (this.next) {\n this.next.previous = this.previous;\n }\n // Redirect to the next item\n var redirect = this.next;\n // Remove references\n this.next = hard ? null : redirect;\n this.previous = null;\n return redirect;\n };\n return TickerListener;\n}());\n\n/**\n * A Ticker class that runs an update loop that other objects listen to.\n *\n * This class is composed around listeners meant for execution on the next requested animation frame.\n * Animation frames are requested only when necessary, e.g. When the ticker is started and the emitter has listeners.\n *\n * @class\n * @memberof PIXI\n */\nvar Ticker = /** @class */ (function () {\n function Ticker() {\n var _this = this;\n /**\n * The first listener. All new listeners added are chained on this.\n * @private\n * @type {TickerListener}\n */\n this._head = new TickerListener(null, null, Infinity);\n /**\n * Internal current frame request ID\n * @type {?number}\n * @private\n */\n this._requestId = null;\n /**\n * Internal value managed by minFPS property setter and getter.\n * This is the maximum allowed milliseconds between updates.\n * @type {number}\n * @private\n */\n this._maxElapsedMS = 100;\n /**\n * Internal value managed by maxFPS property setter and getter.\n * This is the minimum allowed milliseconds between updates.\n * @type {number}\n * @private\n */\n this._minElapsedMS = 0;\n /**\n * Whether or not this ticker should invoke the method\n * {@link PIXI.Ticker#start} automatically\n * when a listener is added.\n *\n * @member {boolean}\n * @default false\n */\n this.autoStart = false;\n /**\n * Scalar time value from last frame to this frame.\n * This value is capped by setting {@link PIXI.Ticker#minFPS}\n * and is scaled with {@link PIXI.Ticker#speed}.\n * **Note:** The cap may be exceeded by scaling.\n *\n * @member {number}\n * @default 1\n */\n this.deltaTime = 1;\n /**\n * Scaler time elapsed in milliseconds from last frame to this frame.\n * This value is capped by setting {@link PIXI.Ticker#minFPS}\n * and is scaled with {@link PIXI.Ticker#speed}.\n * **Note:** The cap may be exceeded by scaling.\n * If the platform supports DOMHighResTimeStamp,\n * this value will have a precision of 1 µs.\n * Defaults to target frame time\n *\n * @member {number}\n * @default 16.66\n */\n this.deltaMS = 1 / settings.TARGET_FPMS;\n /**\n * Time elapsed in milliseconds from last frame to this frame.\n * Opposed to what the scalar {@link PIXI.Ticker#deltaTime}\n * is based, this value is neither capped nor scaled.\n * If the platform supports DOMHighResTimeStamp,\n * this value will have a precision of 1 µs.\n * Defaults to target frame time\n *\n * @member {number}\n * @default 16.66\n */\n this.elapsedMS = 1 / settings.TARGET_FPMS;\n /**\n * The last time {@link PIXI.Ticker#update} was invoked.\n * This value is also reset internally outside of invoking\n * update, but only when a new animation frame is requested.\n * If the platform supports DOMHighResTimeStamp,\n * this value will have a precision of 1 µs.\n *\n * @member {number}\n * @default -1\n */\n this.lastTime = -1;\n /**\n * Factor of current {@link PIXI.Ticker#deltaTime}.\n * @example\n * // Scales ticker.deltaTime to what would be\n * // the equivalent of approximately 120 FPS\n * ticker.speed = 2;\n *\n * @member {number}\n * @default 1\n */\n this.speed = 1;\n /**\n * Whether or not this ticker has been started.\n * `true` if {@link PIXI.Ticker#start} has been called.\n * `false` if {@link PIXI.Ticker#stop} has been called.\n * While `false`, this value may change to `true` in the\n * event of {@link PIXI.Ticker#autoStart} being `true`\n * and a listener is added.\n *\n * @member {boolean}\n * @default false\n */\n this.started = false;\n /**\n * If enabled, deleting is disabled.\n * @member {boolean}\n * @default false\n * @private\n */\n this._protected = false;\n /**\n * The last time keyframe was executed.\n * Maintains a relatively fixed interval with the previous value.\n * @member {number}\n * @default -1\n * @private\n */\n this._lastFrame = -1;\n /**\n * Internal tick method bound to ticker instance.\n * This is because in early 2015, Function.bind\n * is still 60% slower in high performance scenarios.\n * Also separating frame requests from update method\n * so listeners may be called at any time and with\n * any animation API, just invoke ticker.update(time).\n *\n * @private\n * @param {number} time - Time since last tick.\n */\n this._tick = function (time) {\n _this._requestId = null;\n if (_this.started) {\n // Invoke listeners now\n _this.update(time);\n // Listener side effects may have modified ticker state.\n if (_this.started && _this._requestId === null && _this._head.next) {\n _this._requestId = requestAnimationFrame(_this._tick);\n }\n }\n };\n }\n /**\n * Conditionally requests a new animation frame.\n * If a frame has not already been requested, and if the internal\n * emitter has listeners, a new frame is requested.\n *\n * @private\n */\n Ticker.prototype._requestIfNeeded = function () {\n if (this._requestId === null && this._head.next) {\n // ensure callbacks get correct delta\n this.lastTime = performance.now();\n this._lastFrame = this.lastTime;\n this._requestId = requestAnimationFrame(this._tick);\n }\n };\n /**\n * Conditionally cancels a pending animation frame.\n *\n * @private\n */\n Ticker.prototype._cancelIfNeeded = function () {\n if (this._requestId !== null) {\n cancelAnimationFrame(this._requestId);\n this._requestId = null;\n }\n };\n /**\n * Conditionally requests a new animation frame.\n * If the ticker has been started it checks if a frame has not already\n * been requested, and if the internal emitter has listeners. If these\n * conditions are met, a new frame is requested. If the ticker has not\n * been started, but autoStart is `true`, then the ticker starts now,\n * and continues with the previous conditions to request a new frame.\n *\n * @private\n */\n Ticker.prototype._startIfPossible = function () {\n if (this.started) {\n this._requestIfNeeded();\n }\n else if (this.autoStart) {\n this.start();\n }\n };\n /**\n * Register a handler for tick events. Calls continuously unless\n * it is removed or the ticker is stopped.\n *\n * @param {Function} fn - The listener function to be added for updates\n * @param {*} [context] - The listener context\n * @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting\n * @returns {PIXI.Ticker} This instance of a ticker\n */\n Ticker.prototype.add = function (fn, context, priority) {\n if (priority === void 0) { priority = UPDATE_PRIORITY.NORMAL; }\n return this._addListener(new TickerListener(fn, context, priority));\n };\n /**\n * Add a handler for the tick event which is only execute once.\n *\n * @param {Function} fn - The listener function to be added for one update\n * @param {*} [context] - The listener context\n * @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting\n * @returns {PIXI.Ticker} This instance of a ticker\n */\n Ticker.prototype.addOnce = function (fn, context, priority) {\n if (priority === void 0) { priority = UPDATE_PRIORITY.NORMAL; }\n return this._addListener(new TickerListener(fn, context, priority, true));\n };\n /**\n * Internally adds the event handler so that it can be sorted by priority.\n * Priority allows certain handler (user, AnimatedSprite, Interaction) to be run\n * before the rendering.\n *\n * @private\n * @param {TickerListener} listener - Current listener being added.\n * @returns {PIXI.Ticker} This instance of a ticker\n */\n Ticker.prototype._addListener = function (listener) {\n // For attaching to head\n var current = this._head.next;\n var previous = this._head;\n // Add the first item\n if (!current) {\n listener.connect(previous);\n }\n else {\n // Go from highest to lowest priority\n while (current) {\n if (listener.priority > current.priority) {\n listener.connect(previous);\n break;\n }\n previous = current;\n current = current.next;\n }\n // Not yet connected\n if (!listener.previous) {\n listener.connect(previous);\n }\n }\n this._startIfPossible();\n return this;\n };\n /**\n * Removes any handlers matching the function and context parameters.\n * If no handlers are left after removing, then it cancels the animation frame.\n *\n * @param {Function} fn - The listener function to be removed\n * @param {*} [context] - The listener context to be removed\n * @returns {PIXI.Ticker} This instance of a ticker\n */\n Ticker.prototype.remove = function (fn, context) {\n var listener = this._head.next;\n while (listener) {\n // We found a match, lets remove it\n // no break to delete all possible matches\n // incase a listener was added 2+ times\n if (listener.match(fn, context)) {\n listener = listener.destroy();\n }\n else {\n listener = listener.next;\n }\n }\n if (!this._head.next) {\n this._cancelIfNeeded();\n }\n return this;\n };\n Object.defineProperty(Ticker.prototype, \"count\", {\n /**\n * The number of listeners on this ticker, calculated by walking through linked list\n *\n * @readonly\n * @member {number}\n */\n get: function () {\n if (!this._head) {\n return 0;\n }\n var count = 0;\n var current = this._head;\n while ((current = current.next)) {\n count++;\n }\n return count;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Starts the ticker. If the ticker has listeners\n * a new animation frame is requested at this point.\n */\n Ticker.prototype.start = function () {\n if (!this.started) {\n this.started = true;\n this._requestIfNeeded();\n }\n };\n /**\n * Stops the ticker. If the ticker has requested\n * an animation frame it is canceled at this point.\n */\n Ticker.prototype.stop = function () {\n if (this.started) {\n this.started = false;\n this._cancelIfNeeded();\n }\n };\n /**\n * Destroy the ticker and don't use after this. Calling\n * this method removes all references to internal events.\n */\n Ticker.prototype.destroy = function () {\n if (!this._protected) {\n this.stop();\n var listener = this._head.next;\n while (listener) {\n listener = listener.destroy(true);\n }\n this._head.destroy();\n this._head = null;\n }\n };\n /**\n * Triggers an update. An update entails setting the\n * current {@link PIXI.Ticker#elapsedMS},\n * the current {@link PIXI.Ticker#deltaTime},\n * invoking all listeners with current deltaTime,\n * and then finally setting {@link PIXI.Ticker#lastTime}\n * with the value of currentTime that was provided.\n * This method will be called automatically by animation\n * frame callbacks if the ticker instance has been started\n * and listeners are added.\n *\n * @param {number} [currentTime=performance.now()] - the current time of execution\n */\n Ticker.prototype.update = function (currentTime) {\n if (currentTime === void 0) { currentTime = performance.now(); }\n var elapsedMS;\n // If the difference in time is zero or negative, we ignore most of the work done here.\n // If there is no valid difference, then should be no reason to let anyone know about it.\n // A zero delta, is exactly that, nothing should update.\n //\n // The difference in time can be negative, and no this does not mean time traveling.\n // This can be the result of a race condition between when an animation frame is requested\n // on the current JavaScript engine event loop, and when the ticker's start method is invoked\n // (which invokes the internal _requestIfNeeded method). If a frame is requested before\n // _requestIfNeeded is invoked, then the callback for the animation frame the ticker requests,\n // can receive a time argument that can be less than the lastTime value that was set within\n // _requestIfNeeded. This difference is in microseconds, but this is enough to cause problems.\n //\n // This check covers this browser engine timing issue, as well as if consumers pass an invalid\n // currentTime value. This may happen if consumers opt-out of the autoStart, and update themselves.\n if (currentTime > this.lastTime) {\n // Save uncapped elapsedMS for measurement\n elapsedMS = this.elapsedMS = currentTime - this.lastTime;\n // cap the milliseconds elapsed used for deltaTime\n if (elapsedMS > this._maxElapsedMS) {\n elapsedMS = this._maxElapsedMS;\n }\n elapsedMS *= this.speed;\n // If not enough time has passed, exit the function.\n // Get ready for next frame by setting _lastFrame, but based on _minElapsedMS\n // adjustment to ensure a relatively stable interval.\n if (this._minElapsedMS) {\n var delta = currentTime - this._lastFrame | 0;\n if (delta < this._minElapsedMS) {\n return;\n }\n this._lastFrame = currentTime - (delta % this._minElapsedMS);\n }\n this.deltaMS = elapsedMS;\n this.deltaTime = this.deltaMS * settings.TARGET_FPMS;\n // Cache a local reference, in-case ticker is destroyed\n // during the emit, we can still check for head.next\n var head = this._head;\n // Invoke listeners added to internal emitter\n var listener = head.next;\n while (listener) {\n listener = listener.emit(this.deltaTime);\n }\n if (!head.next) {\n this._cancelIfNeeded();\n }\n }\n else {\n this.deltaTime = this.deltaMS = this.elapsedMS = 0;\n }\n this.lastTime = currentTime;\n };\n Object.defineProperty(Ticker.prototype, \"FPS\", {\n /**\n * The frames per second at which this ticker is running.\n * The default is approximately 60 in most modern browsers.\n * **Note:** This does not factor in the value of\n * {@link PIXI.Ticker#speed}, which is specific\n * to scaling {@link PIXI.Ticker#deltaTime}.\n *\n * @member {number}\n * @readonly\n */\n get: function () {\n return 1000 / this.elapsedMS;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Ticker.prototype, \"minFPS\", {\n /**\n * Manages the maximum amount of milliseconds allowed to\n * elapse between invoking {@link PIXI.Ticker#update}.\n * This value is used to cap {@link PIXI.Ticker#deltaTime},\n * but does not effect the measured value of {@link PIXI.Ticker#FPS}.\n * When setting this property it is clamped to a value between\n * `0` and `PIXI.settings.TARGET_FPMS * 1000`.\n *\n * @member {number}\n * @default 10\n */\n get: function () {\n return 1000 / this._maxElapsedMS;\n },\n set: function (fps) {\n // Minimum must be below the maxFPS\n var minFPS = Math.min(this.maxFPS, fps);\n // Must be at least 0, but below 1 / settings.TARGET_FPMS\n var minFPMS = Math.min(Math.max(0, minFPS) / 1000, settings.TARGET_FPMS);\n this._maxElapsedMS = 1 / minFPMS;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Ticker.prototype, \"maxFPS\", {\n /**\n * Manages the minimum amount of milliseconds required to\n * elapse between invoking {@link PIXI.Ticker#update}.\n * This will effect the measured value of {@link PIXI.Ticker#FPS}.\n * If it is set to `0`, then there is no limit; PixiJS will render as many frames as it can.\n * Otherwise it will be at least `minFPS`\n *\n * @member {number}\n * @default 0\n */\n get: function () {\n if (this._minElapsedMS) {\n return Math.round(1000 / this._minElapsedMS);\n }\n return 0;\n },\n set: function (fps) {\n if (fps === 0) {\n this._minElapsedMS = 0;\n }\n else {\n // Max must be at least the minFPS\n var maxFPS = Math.max(this.minFPS, fps);\n this._minElapsedMS = 1 / (maxFPS / 1000);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Ticker, \"shared\", {\n /**\n * The shared ticker instance used by {@link PIXI.AnimatedSprite} and by\n * {@link PIXI.VideoResource} to update animation frames / video textures.\n *\n * It may also be used by {@link PIXI.Application} if created with the `sharedTicker` option property set to true.\n *\n * The property {@link PIXI.Ticker#autoStart} is set to `true` for this instance.\n * Please follow the examples for usage, including how to opt-out of auto-starting the shared ticker.\n *\n * @example\n * let ticker = PIXI.Ticker.shared;\n * // Set this to prevent starting this ticker when listeners are added.\n * // By default this is true only for the PIXI.Ticker.shared instance.\n * ticker.autoStart = false;\n * // FYI, call this to ensure the ticker is stopped. It should be stopped\n * // if you have not attempted to render anything yet.\n * ticker.stop();\n * // Call this when you are ready for a running shared ticker.\n * ticker.start();\n *\n * @example\n * // You may use the shared ticker to render...\n * let renderer = PIXI.autoDetectRenderer();\n * let stage = new PIXI.Container();\n * document.body.appendChild(renderer.view);\n * ticker.add(function (time) {\n * renderer.render(stage);\n * });\n *\n * @example\n * // Or you can just update it manually.\n * ticker.autoStart = false;\n * ticker.stop();\n * function animate(time) {\n * ticker.update(time);\n * renderer.render(stage);\n * requestAnimationFrame(animate);\n * }\n * animate(performance.now());\n *\n * @member {PIXI.Ticker}\n * @static\n */\n get: function () {\n if (!Ticker._shared) {\n var shared = Ticker._shared = new Ticker();\n shared.autoStart = true;\n shared._protected = true;\n }\n return Ticker._shared;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Ticker, \"system\", {\n /**\n * The system ticker instance used by {@link PIXI.InteractionManager} and by\n * {@link PIXI.BasePrepare} for core timing functionality that shouldn't usually need to be paused,\n * unlike the `shared` ticker which drives visual animations and rendering which may want to be paused.\n *\n * The property {@link PIXI.Ticker#autoStart} is set to `true` for this instance.\n *\n * @member {PIXI.Ticker}\n * @static\n */\n get: function () {\n if (!Ticker._system) {\n var system = Ticker._system = new Ticker();\n system.autoStart = true;\n system._protected = true;\n }\n return Ticker._system;\n },\n enumerable: false,\n configurable: true\n });\n return Ticker;\n}());\n\n/**\n * Middleware for for Application Ticker.\n *\n * @example\n * import {TickerPlugin} from '@pixi/ticker';\n * import {Application} from '@pixi/app';\n * Application.registerPlugin(TickerPlugin);\n *\n * @class\n * @memberof PIXI\n */\nvar TickerPlugin = /** @class */ (function () {\n function TickerPlugin() {\n }\n /**\n * Initialize the plugin with scope of application instance\n *\n * @static\n * @private\n * @param {object} [options] - See application options\n */\n TickerPlugin.init = function (options) {\n var _this = this;\n // Set default\n options = Object.assign({\n autoStart: true,\n sharedTicker: false,\n }, options);\n // Create ticker setter\n Object.defineProperty(this, 'ticker', {\n set: function (ticker) {\n if (this._ticker) {\n this._ticker.remove(this.render, this);\n }\n this._ticker = ticker;\n if (ticker) {\n ticker.add(this.render, this, UPDATE_PRIORITY.LOW);\n }\n },\n get: function () {\n return this._ticker;\n },\n });\n /**\n * Convenience method for stopping the render.\n *\n * @method PIXI.Application#stop\n */\n this.stop = function () {\n _this._ticker.stop();\n };\n /**\n * Convenience method for starting the render.\n *\n * @method PIXI.Application#start\n */\n this.start = function () {\n _this._ticker.start();\n };\n /**\n * Internal reference to the ticker.\n *\n * @type {PIXI.Ticker}\n * @name _ticker\n * @memberof PIXI.Application#\n * @private\n */\n this._ticker = null;\n /**\n * Ticker for doing render updates.\n *\n * @type {PIXI.Ticker}\n * @name ticker\n * @memberof PIXI.Application#\n * @default PIXI.Ticker.shared\n */\n this.ticker = options.sharedTicker ? Ticker.shared : new Ticker();\n // Start the rendering\n if (options.autoStart) {\n this.start();\n }\n };\n /**\n * Clean up the ticker, scoped to application.\n *\n * @static\n * @private\n */\n TickerPlugin.destroy = function () {\n if (this._ticker) {\n var oldTicker = this._ticker;\n this.ticker = null;\n oldTicker.destroy();\n }\n };\n return TickerPlugin;\n}());\n\nexport { Ticker, TickerPlugin, UPDATE_PRIORITY };\n//# sourceMappingURL=ticker.es.js.map\n","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nmodule.exports = mapToArray;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var castPath = require('./_castPath'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isIndex = require('./_isIndex'),\n isLength = require('./isLength'),\n toKey = require('./_toKey');\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nmodule.exports = hasPath;\n","/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = strictIndexOf;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/client/dist/js/chat.30b924f6.js b/client/dist/js/chat.30b924f6.js new file mode 100644 index 0000000..03e6544 --- /dev/null +++ b/client/dist/js/chat.30b924f6.js @@ -0,0 +1,2 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chat"],{"293a":function(t,e,c){"use strict";c.r(e);var a=c("7a23"),n={key:0,class:"kaiwa"},o={class:"kaiwa-img-right"},i={class:"kaiwa-text-left"},s={class:"kaiwa-text"};function h(t,e,c,h,l,u){return Object(a["t"])(),Object(a["g"])("div",null,[Object(a["j"])(a["c"],{name:"fade"},{default:Object(a["K"])((function(){return[l.chatShow?(Object(a["t"])(),Object(a["g"])("div",n,[Object(a["j"])("figure",o,[Object(a["j"])("img",{src:l.avatar,alt:"no-img2"},null,8,["src"])]),Object(a["j"])("div",i,[Object(a["j"])("p",s,Object(a["F"])(l.chat||"..."),1)])])):Object(a["h"])("",!0)]})),_:1})])}c("99af");var l=c("8055"),u=c.n(l),r={name:"chat",components:{},data:function(){return{chat:"",chatList:[],chatShow:!1,chatShowTimer:null,socket:null,isSpeech:!1,avatar:"https://i.loli.net/2021/08/01/SFHndyel1UJx6wL.png",cloudSel:"googleNiang",appkey:"",AccessToken:"",voice:"xiaoyun"}},computed:{},watch:{},methods:{playVoice:function(t){var e=this;if(this.isSpeech){var c="";switch(this.cloudSel){case"aliyun":c="https://nls-gateway.cn-shanghai.aliyuncs.com/stream/v1/tts?appkey=".concat(this.appkey,"&token=").concat(this.AccessToken,"&text=").concat(encodeURI(this.chat),"&format=mp3&sample_rate=16000&voice=").concat(this.voice);break;case"googleNiang":c=t;break;case"googleCloud":c=t;break;case"azure":c=t;break;default:break}if(c){var a=new Audio(c);a.load(),a.play().then((function(){})).catch((function(){setTimeout((function(){e.playNextChat()}),300*e.chat.length)})),a.onended=function(){e.playNextChat()}}else setTimeout((function(){e.playNextChat()}),300*this.chat.length)}else setTimeout((function(){e.playNextChat()}),300*this.chat.length)},say:function(t,e){var c=this;this.chat=t,this.$nextTick((function(){c.chatShow=!0,c.playVoice(e)})),clearTimeout(this.chatShowTimer),this.chatShowTimer=setTimeout((function(){c.chatShow=!1}),1e3*this.chat.length)},addChat:function(t){var e=!1;0===this.chatList.length&&(e=!0),this.chatList.push(t),e&&this.playNextChat(!0)},removeChat:function(){this.chatList.length>0&&this.chatList.shift()},playNextChat:function(t){t||this.removeChat();var e=this.chatList[0];e&&this.say(e.chat,e.voiceUrl)},toSocket:function(){var t=this;this.socket=u.a.connect("/socketchat"),this.socket.on("msg",(function(e){var c={chat:e.message,voiceUrl:e.voiceUrl};t.addChat(c),console.log(e)})),this.socket.on("getSettingData",(function(e){console.log(e),t.isSpeech=!!e.isSpeech,t.avatar=e.avatar||"https://i.loli.net/2021/08/01/SFHndyel1UJx6wL.png",t.cloudSel=e.cloudSel||"googleNiang",t.appkey=e.appkey||"",t.AccessToken=e.AccessToken||"",t.voice=e.voice||"xiaoyun"})),this.socket.on("connect",(function(){console.log("已连接")})),this.socket.on("disconnect",(function(){console.log("已断开")}))}},created:function(){this.toSocket()},mounted:function(){},beforeCreate:function(){},beforeMount:function(){},beforeUpdate:function(){},updated:function(){},beforeUnmount:function(){this.socket.close()},unmounted:function(){},activated:function(){}};c("68c7");r.render=h;e["default"]=r},"68c7":function(t,e,c){"use strict";c("f73a")},f73a:function(t,e,c){}}]); +//# sourceMappingURL=chat.30b924f6.js.map \ No newline at end of file diff --git a/client/dist/js/chat.30b924f6.js.map b/client/dist/js/chat.30b924f6.js.map new file mode 100644 index 0000000..040c4b0 --- /dev/null +++ b/client/dist/js/chat.30b924f6.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///./src/views/Chat.vue","webpack:///./src/views/Chat.vue?7f7d","webpack:///./src/views/Chat.vue?d98c"],"names":["class","name","chatShow","src","avatar","alt","chat","components","data","chatList","chatShowTimer","socket","isSpeech","cloudSel","appkey","AccessToken","voice","computed","watch","methods","playVoice","voiceUrl","this","url","encodeURI","speech","Audio","load","play","then","catch","setTimeout","playNextChat","length","onended","say","$nextTick","clearTimeout","addChat","chatData","playFlag","push","removeChat","shift","noremove","toSocket","connect","on","message","console","log","created","mounted","beforeCreate","beforeMount","beforeUpdate","updated","beforeUnmount","close","unmounted","activated","render"],"mappings":"wIAIWA,MAAM,S,GAC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EdC,UA/Ia,aAgJbC,UAhJa,c,UCpBf,EAAOC,OAASA,EAED,gB,oCCPf,W","file":"js/chat.30b924f6.js","sourcesContent":["\r\n\r\n\r\n\r\n\r\n","import { render } from \"./Chat.vue?vue&type=template&id=44d119c0\"\nimport script from \"./Chat.vue?vue&type=script&lang=js\"\nexport * from \"./Chat.vue?vue&type=script&lang=js\"\n\nimport \"./Chat.vue?vue&type=style&index=0&id=44d119c0&lang=css\"\nscript.render = render\n\nexport default script","export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Chat.vue?vue&type=style&index=0&id=44d119c0&lang=css\""],"sourceRoot":""} \ No newline at end of file diff --git a/client/dist/js/chat.d17ad9dc.js b/client/dist/js/chat.d17ad9dc.js deleted file mode 100644 index 816759c..0000000 --- a/client/dist/js/chat.d17ad9dc.js +++ /dev/null @@ -1,2 +0,0 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chat"],{"293a":function(t,e,c){"use strict";c.r(e);var o=c("7a23"),n={key:0,class:"kaiwa"},a={class:"kaiwa-img-right"},i={class:"kaiwa-text-left"},s={class:"kaiwa-text"};function u(t,e,c,u,l,h){return Object(o["t"])(),Object(o["g"])("div",null,[Object(o["j"])(o["c"],{name:"fade"},{default:Object(o["K"])((function(){return[l.chatShow?(Object(o["t"])(),Object(o["g"])("div",n,[Object(o["j"])("figure",a,[Object(o["j"])("img",{src:l.avatar,alt:"no-img2"},null,8,["src"])]),Object(o["j"])("div",i,[Object(o["j"])("p",s,Object(o["F"])(l.chat||"..."),1)])])):Object(o["h"])("",!0)]})),_:1})])}c("99af");var l=c("8055"),h=c.n(l),r={name:"chat",components:{},data:function(){return{chat:"",chatShow:!1,chatShowTimer:null,socket:null,isSpeech:!1,avatar:"https://i.loli.net/2021/08/01/SFHndyel1UJx6wL.png",cloudSel:"googleNiang",appkey:"",AccessToken:"",voice:"xiaoyun"}},computed:{},watch:{},methods:{playVoice:function(t){if(this.isSpeech){var e="";switch(this.cloudSel){case"aliyun":e="https://nls-gateway.cn-shanghai.aliyuncs.com/stream/v1/tts?appkey=".concat(this.appkey,"&token=").concat(this.AccessToken,"&text=").concat(encodeURI(this.chat),"&format=mp3&sample_rate=16000&voice=").concat(this.voice);break;case"googleNiang":e=t;break;case"googleCloud":e=t;break;case"azure":e=t;break;default:break}if(e){var c=new Audio(e);c.load(),c.play()}}},toSocket:function(){var t=this;this.socket=h.a.connect("/socketchat"),this.socket.on("msg",(function(e){console.log(e),t.chat=e.message,t.$nextTick((function(){t.chatShow=!0,t.playVoice(e.voiceUrl)})),clearTimeout(t.chatShowTimer),t.chatShowTimer=setTimeout((function(){t.chatShow=!1}),1e3*t.chat.length)})),this.socket.on("getSettingData",(function(e){console.log(e),t.isSpeech=!!e.isSpeech,t.avatar=e.avatar||"https://i.loli.net/2021/08/01/SFHndyel1UJx6wL.png",t.cloudSel=e.cloudSel||"googleNiang",t.appkey=e.appkey||"",t.AccessToken=e.AccessToken||"",t.voice=e.voice||"xiaoyun"})),this.socket.on("connect",(function(){console.log("已连接")})),this.socket.on("disconnect",(function(){console.log("已断开")}))}},created:function(){this.toSocket()},mounted:function(){},beforeCreate:function(){},beforeMount:function(){},beforeUpdate:function(){},updated:function(){},beforeUnmount:function(){this.socket.close()},unmounted:function(){},activated:function(){}};c("670c");r.render=u;e["default"]=r},"670c":function(t,e,c){"use strict";c("fc64")},fc64:function(t,e,c){}}]); -//# sourceMappingURL=chat.d17ad9dc.js.map \ No newline at end of file diff --git a/client/dist/js/chat.d17ad9dc.js.map b/client/dist/js/chat.d17ad9dc.js.map deleted file mode 100644 index 1da8ecc..0000000 --- a/client/dist/js/chat.d17ad9dc.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack:///./src/views/Chat.vue","webpack:///./src/views/Chat.vue?7f7d","webpack:///./src/views/Chat.vue?85f6"],"names":["class","name","chatShow","src","avatar","alt","chat","components","data","chatShowTimer","socket","isSpeech","cloudSel","appkey","AccessToken","voice","computed","watch","methods","playVoice","voiceUrl","this","url","encodeURI","speech","Audio","load","play","toSocket","connect","on","console","log","message","$nextTick","clearTimeout","setTimeout","length","created","mounted","beforeCreate","beforeMount","beforeUpdate","updated","beforeUnmount","close","unmounted","activated","render"],"mappings":"wIAIWA,MAAM,S,GACDA,MAAM,mB,GAOTA,MAAM,mB,GACNA,MAAM,c,gDAXjB,eAiBM,YAhBJ,eAea,QAfDC,KAAK,QAAM,C,wBACrB,iBAaM,CAbmB,EAAAC,U,iBAAzB,eAaM,MAbN,EAaM,CAZJ,eAKS,SALT,EAKS,CAJP,eAAmC,OAA7BC,IAAK,EAAAC,OAAQC,IAAI,W,kBAMzB,eAIM,MAJN,EAIM,CAHJ,eAEI,IAFJ,EAEI,eADC,EAAAC,MAAI,e,qEAWJ,GACbL,KAAM,OACNM,WAAY,GACZC,KAHa,WAIX,MAAO,CACLF,KAAM,GACNJ,UAAU,EACVO,cAAe,KACfC,OAAQ,KACRC,UAAU,EACVP,OAAQ,oDACRQ,SAAU,cACVC,OAAQ,GACRC,YAAa,GACbC,MAAO,YAGXC,SAAU,GACVC,MAAO,GACPC,QAAS,CACPC,UADO,SACGC,GACR,GAAIC,KAAKV,SAAU,CACjB,IAAIW,EAAM,GACV,OAAQD,KAAKT,UACX,IAAK,SACHU,EAAE,4EACAD,KAAKR,OADL,kBAEQQ,KAAKP,YAFb,iBAEiCS,UACjCF,KAAKf,MAHL,+CAIsCe,KAAKN,OAC7C,MACF,IAAK,cACHO,EAAMF,EACN,MACF,IAAK,cACHE,EAAMF,EACN,MACF,IAAK,QACHE,EAAMF,EACN,MACF,QACE,MAEJ,GAAIE,EAAK,CACP,IAAME,EAAS,IAAIC,MAAMH,GACzBE,EAAOE,OACPF,EAAOG,UAIbC,SA/BO,WA+BI,WACTP,KAAKX,OAAS,IAAGmB,QAAQ,eACzBR,KAAKX,OAAOoB,GAAG,OAAO,SAACtB,GACrBuB,QAAQC,IAAIxB,GACZ,EAAKF,KAAOE,EAAKyB,QACjB,EAAKC,WAAU,WACb,EAAKhC,UAAW,EAChB,EAAKiB,UAAUX,EAAKY,aAEtBe,aAAa,EAAK1B,eAClB,EAAKA,cAAgB2B,YAAW,WAC9B,EAAKlC,UAAW,IACI,IAAnB,EAAKI,KAAK+B,WAEfhB,KAAKX,OAAOoB,GAAG,kBAAkB,SAACtB,GAChCuB,QAAQC,IAAIxB,GACZ,EAAKG,WAAWH,EAAKG,SACrB,EAAKP,OACHI,EAAKJ,QAAU,oDACjB,EAAKQ,SAAWJ,EAAKI,UAAY,cACjC,EAAKC,OAASL,EAAKK,QAAU,GAC7B,EAAKC,YAAcN,EAAKM,aAAe,GACvC,EAAKC,MAAQP,EAAKO,OAAS,aAE7BM,KAAKX,OAAOoB,GAAG,WAAW,WACxBC,QAAQC,IAAI,UAEdX,KAAKX,OAAOoB,GAAG,cAAc,WAC3BC,QAAQC,IAAI,YAIlBM,QAlFa,WAmFXjB,KAAKO,YAEPW,QArFa,aAsFbC,aAtFa,aAuFbC,YAvFa,aAwFbC,aAxFa,aAyFbC,QAzFa,aA0FbC,cA1Fa,WA2FXvB,KAAKX,OAAOmC,SAEdC,UA7Fa,aA8FbC,UA9Fa,c,UCpBf,EAAOC,OAASA,EAED,gB,oCCPf,W","file":"js/chat.d17ad9dc.js","sourcesContent":["\r\n\r\n\r\n\r\n\r\n","import { render } from \"./Chat.vue?vue&type=template&id=79aeee23\"\nimport script from \"./Chat.vue?vue&type=script&lang=js\"\nexport * from \"./Chat.vue?vue&type=script&lang=js\"\n\nimport \"./Chat.vue?vue&type=style&index=0&id=79aeee23&lang=css\"\nscript.render = render\n\nexport default script","export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Chat.vue?vue&type=style&index=0&id=79aeee23&lang=css\""],"sourceRoot":""} \ No newline at end of file diff --git a/client/dist/js/index.93fe4d0b.js b/client/dist/js/index.30c81a45.js similarity index 96% rename from client/dist/js/index.93fe4d0b.js rename to client/dist/js/index.30c81a45.js index 0bf8a24..82a2718 100644 --- a/client/dist/js/index.93fe4d0b.js +++ b/client/dist/js/index.30c81a45.js @@ -1,2 +1,2 @@ -(function(e){function t(t){for(var n,a,i=t[0],s=t[1],u=t[2],r=0,d=[];r\r\n
\r\n \r\n
\r\n\r\n\r\n\r\n","import { render } from \"./App.vue?vue&type=template&id=52b6ee5f\"\nconst script = {}\nscript.render = render\n\nexport default script","\r\n\r\n\r\n\r\n\r\n","import { render } from \"./Home.vue?vue&type=template&id=007d399c\"\nimport script from \"./Home.vue?vue&type=script&lang=js\"\nexport * from \"./Home.vue?vue&type=script&lang=js\"\n\nimport \"./Home.vue?vue&type=style&index=0&id=007d399c&lang=css\"\nscript.render = render\n\nexport default script","import { createRouter, createWebHistory } from 'vue-router'\r\nimport Home from '../views/Home.vue'\r\n\r\nconst routes = [\r\n {\r\n path: '/',\r\n name: 'home',\r\n component: Home,\r\n },\r\n {\r\n path: '/chat',\r\n name: 'chat',\r\n component: () => import(/* webpackChunkName: \"chat\" */ '../views/Chat.vue'),\r\n },\r\n {\r\n path: '/speechcontrol',\r\n name: 'SpeechControl',\r\n component: () =>\r\n import(\r\n /* webpackChunkName: \"SpeechControl\" */ '../views/SpeechControl.vue'\r\n ),\r\n },\r\n {\r\n path: '/live2d',\r\n name: 'Live2d',\r\n component: () =>\r\n import(/* webpackChunkName: \"Live2d\" */ '../views/Live2d.vue'),\r\n },\r\n]\r\n\r\nconst router = createRouter({\r\n history: createWebHistory(process.env.BASE_URL),\r\n routes,\r\n})\r\n\r\nexport default router\r\n","import { createStore } from 'vuex'\r\n\r\nexport default createStore({\r\n state: {\r\n },\r\n mutations: {\r\n },\r\n actions: {\r\n },\r\n modules: {\r\n }\r\n})\r\n","import { createApp } from 'vue'\r\nimport App from './App.vue'\r\nimport PrimeVue from 'primevue/config'\r\nimport router from './router'\r\nimport store from './store'\r\nimport ToastService from 'primevue/toastservice';\r\nimport './assets/css/common.css'\r\nimport 'primevue/resources/primevue.min.css'\r\nimport 'primevue/resources/themes/saga-blue/theme.css'\r\nimport 'primeicons/primeicons.css'\r\nimport 'primeflex/primeflex.css';\r\n\r\ncreateApp(App).use(store).use(router).use(PrimeVue).use(ToastService).mount('#app')\r\n","export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Home.vue?vue&type=style&index=0&id=007d399c&lang=css\""],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/App.vue","webpack:///./src/App.vue?dfb6","webpack:///./src/views/Home.vue","webpack:///./src/views/Home.vue?ab8c","webpack:///./src/router/index.js","webpack:///./src/store/index.js","webpack:///./src/main.js","webpack:///./src/views/Home.vue?31e1"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","installedCssChunks","jsonpScriptSrc","p","exports","module","l","e","promises","cssChunks","Promise","resolve","reject","href","fullhref","existingLinkTags","document","getElementsByTagName","tag","dataHref","getAttribute","rel","existingStyleTags","linkTag","createElement","type","onload","onerror","event","request","target","src","err","Error","code","parentNode","removeChild","head","appendChild","then","installedChunkData","promise","onScriptComplete","script","charset","timeout","nc","setAttribute","error","clearTimeout","chunk","errorType","realSrc","message","name","undefined","setTimeout","all","m","c","d","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","oe","console","jsonpArray","window","oldJsonpFunction","slice","id","render","class","header","getType","getTypeChange","label","copyControlUrl","openControlUrl","status","placeholder","sendByUser","avatarPre","shape","image","changeAvatar","avatar","selModel","isSpeech","cloudSel","options","cloudList","optionLabel","optionValue","azureVoice","feedback","azureKey","toggleMask","azureRegion","googleVoice","googleSpeakingRate","showButtons","buttonLayout","step","incrementButtonIcon","decrementButtonIcon","min","max","googlePitch","appkey","AccessToken","voice","saveSetting","position","components","InputText","Button","Panel","Avatar","InputSwitch","SelectButton","Toast","RadioButton","InputNumber","Password","rec","socket","computed","watch","this","sendHomeStatus","methods","emit","url","open","location","origin","toClipboard","$toast","add","severity","summary","detail","life","settingData","localStorage","setItem","JSON","stringify","send","toSocket","connect","on","log","speechStart","speechStop","start","stop","initSpeech","webkitSpeechRecognition","continuous","interimResults","lang","onresult","transcript","results","resultIndex","onstart","onend","onspeechstart","onspeechend","onosundstart","onsoundend","onaudiostart","onaudioend","init","settingDataStr","getItem","parse","Number","isNaN","created","mounted","beforeCreate","beforeMount","beforeUpdate","updated","beforeUnmount","unmounted","activated","routes","path","component","Home","router","createRouter","history","createWebHistory","process","createStore","state","mutations","actions","createApp","App","use","store","PrimeVue","ToastService","mount"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EA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C,qBAEjB,EACA+E,OAAOnC,EAAY5C,oBACvB6B,KAAKjC,SAAWgD,EAAYhD,UAAY,GACxCiC,KAAK/B,YAAc8C,EAAY9C,aAAe,GAC9C+B,KAAKnC,WAAakD,EAAYlD,YAAc,uBAC5CmC,KAAK1C,SAAWyD,EAAYzD,UAAY,iBAE1C0C,KAAK/C,UAAY+C,KAAK3C,OACtB2C,KAAKqB,WACLrB,KAAK6B,eAGTuB,QA/Sa,aAgTbC,QAhTa,WAiTXrD,KAAK8C,QAEPQ,aAnTa,aAoTbC,YApTa,aAqTbC,aArTa,aAsTbC,QAtTa,aAuTbC,cAvTa,aAwTbC,UAxTa,aAyTbC,UAzTa,c,UCvSf,GAAOtH,OAAS,GAED,UCJTuH,GAAS,CACb,CACEC,KAAM,IACNzJ,KAAM,OACN0J,UAAWC,IAEb,CACEF,KAAM,QACNzJ,KAAM,OACN0J,UAAW,kBAAM,wCAEnB,CACED,KAAM,iBACNzJ,KAAM,gBACN0J,UAAW,kBACT,iDAIJ,CACED,KAAM,UACNzJ,KAAM,SACN0J,UAAW,kBACT,2CAIAE,GAASC,eAAa,CAC1BC,QAASC,eAAiBC,KAC1BR,YAGaI,M,aCjCAK,mBAAY,CACzBC,MAAO,GAEPC,UAAW,GAEXC,QAAS,GAETxO,QAAS,K,+DCGXyO,eAAUC,GAAKC,IAAIC,IAAOD,IAAIX,IAAQW,IAAIE,QAAUF,IAAIG,SAAcC,MAAM,S,oCCZ5E,W","file":"js/index.30c81a45.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded CSS chunks\n \tvar installedCssChunks = {\n \t\t\"index\": 0\n \t}\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t\"index\": 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// script path function\n \tfunction jsonpScriptSrc(chunkId) {\n \t\treturn __webpack_require__.p + \"js/\" + ({\"Live2d\":\"Live2d\",\"SpeechControl\":\"SpeechControl\",\"chat\":\"chat\"}[chunkId]||chunkId) + \".\" + {\"Live2d\":\"7fa92c30\",\"SpeechControl\":\"1a1f8340\",\"chat\":\"30b924f6\"}[chunkId] + \".js\"\n \t}\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar promises = [];\n\n\n \t\t// mini-css-extract-plugin CSS loading\n \t\tvar cssChunks = {\"Live2d\":1,\"SpeechControl\":1,\"chat\":1};\n \t\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n \t\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n \t\t\tpromises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) {\n \t\t\t\tvar href = \"css/\" + ({\"Live2d\":\"Live2d\",\"SpeechControl\":\"SpeechControl\",\"chat\":\"chat\"}[chunkId]||chunkId) + \".\" + {\"Live2d\":\"f98e97e2\",\"SpeechControl\":\"6b2abfd7\",\"chat\":\"79f1f898\"}[chunkId] + \".css\";\n \t\t\t\tvar fullhref = __webpack_require__.p + href;\n \t\t\t\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n \t\t\t\tfor(var i = 0; i < existingLinkTags.length; i++) {\n \t\t\t\t\tvar tag = existingLinkTags[i];\n \t\t\t\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n \t\t\t\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return resolve();\n \t\t\t\t}\n \t\t\t\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n \t\t\t\tfor(var i = 0; i < existingStyleTags.length; i++) {\n \t\t\t\t\tvar tag = existingStyleTags[i];\n \t\t\t\t\tvar dataHref = tag.getAttribute(\"data-href\");\n \t\t\t\t\tif(dataHref === href || dataHref === fullhref) return resolve();\n \t\t\t\t}\n \t\t\t\tvar linkTag = document.createElement(\"link\");\n \t\t\t\tlinkTag.rel = \"stylesheet\";\n \t\t\t\tlinkTag.type = \"text/css\";\n \t\t\t\tlinkTag.onload = resolve;\n \t\t\t\tlinkTag.onerror = function(event) {\n \t\t\t\t\tvar request = event && event.target && event.target.src || fullhref;\n \t\t\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + request + \")\");\n \t\t\t\t\terr.code = \"CSS_CHUNK_LOAD_FAILED\";\n \t\t\t\t\terr.request = request;\n \t\t\t\t\tdelete installedCssChunks[chunkId]\n \t\t\t\t\tlinkTag.parentNode.removeChild(linkTag)\n \t\t\t\t\treject(err);\n \t\t\t\t};\n \t\t\t\tlinkTag.href = fullhref;\n\n \t\t\t\tvar head = document.getElementsByTagName(\"head\")[0];\n \t\t\t\thead.appendChild(linkTag);\n \t\t\t}).then(function() {\n \t\t\t\tinstalledCssChunks[chunkId] = 0;\n \t\t\t}));\n \t\t}\n\n \t\t// JSONP chunk loading for javascript\n\n \t\tvar installedChunkData = installedChunks[chunkId];\n \t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n \t\t\t// a Promise means \"currently loading\".\n \t\t\tif(installedChunkData) {\n \t\t\t\tpromises.push(installedChunkData[2]);\n \t\t\t} else {\n \t\t\t\t// setup Promise in chunk cache\n \t\t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t\t\t});\n \t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n \t\t\t\t// start chunk loading\n \t\t\t\tvar script = document.createElement('script');\n \t\t\t\tvar onScriptComplete;\n\n \t\t\t\tscript.charset = 'utf-8';\n \t\t\t\tscript.timeout = 120;\n \t\t\t\tif (__webpack_require__.nc) {\n \t\t\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t\t}\n \t\t\t\tscript.src = jsonpScriptSrc(chunkId);\n\n \t\t\t\t// create error before stack unwound to get useful stacktrace later\n \t\t\t\tvar error = new Error();\n \t\t\t\tonScriptComplete = function (event) {\n \t\t\t\t\t// avoid mem leaks in IE.\n \t\t\t\t\tscript.onerror = script.onload = null;\n \t\t\t\t\tclearTimeout(timeout);\n \t\t\t\t\tvar chunk = installedChunks[chunkId];\n \t\t\t\t\tif(chunk !== 0) {\n \t\t\t\t\t\tif(chunk) {\n \t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n \t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n \t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n \t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n \t\t\t\t\t\t\terror.type = errorType;\n \t\t\t\t\t\t\terror.request = realSrc;\n \t\t\t\t\t\t\tchunk[1](error);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t\t\t}\n \t\t\t\t};\n \t\t\t\tvar timeout = setTimeout(function(){\n \t\t\t\t\tonScriptComplete({ type: 'timeout', target: script });\n \t\t\t\t}, 120000);\n \t\t\t\tscript.onerror = script.onload = onScriptComplete;\n \t\t\t\tdocument.head.appendChild(script);\n \t\t\t}\n \t\t}\n \t\treturn Promise.all(promises);\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([0,\"chunk-vendors\"]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","\r\n\r\n\r\n","import { render } from \"./App.vue?vue&type=template&id=52b6ee5f\"\nconst script = {}\nscript.render = render\n\nexport default script","\r\n\r\n\r\n\r\n\r\n","import { render } from \"./Home.vue?vue&type=template&id=007d399c\"\nimport script from \"./Home.vue?vue&type=script&lang=js\"\nexport * from \"./Home.vue?vue&type=script&lang=js\"\n\nimport \"./Home.vue?vue&type=style&index=0&id=007d399c&lang=css\"\nscript.render = render\n\nexport default script","import { createRouter, createWebHistory } from 'vue-router'\r\nimport Home from '../views/Home.vue'\r\n\r\nconst routes = [\r\n {\r\n path: '/',\r\n name: 'home',\r\n component: Home,\r\n },\r\n {\r\n path: '/chat',\r\n name: 'chat',\r\n component: () => import(/* webpackChunkName: \"chat\" */ '../views/Chat.vue'),\r\n },\r\n {\r\n path: '/speechcontrol',\r\n name: 'SpeechControl',\r\n component: () =>\r\n import(\r\n /* webpackChunkName: \"SpeechControl\" */ '../views/SpeechControl.vue'\r\n ),\r\n },\r\n {\r\n path: '/live2d',\r\n name: 'Live2d',\r\n component: () =>\r\n import(/* webpackChunkName: \"Live2d\" */ '../views/Live2d.vue'),\r\n },\r\n]\r\n\r\nconst router = createRouter({\r\n history: createWebHistory(process.env.BASE_URL),\r\n routes,\r\n})\r\n\r\nexport default router\r\n","import { createStore } from 'vuex'\r\n\r\nexport default createStore({\r\n state: {\r\n },\r\n mutations: {\r\n },\r\n actions: {\r\n },\r\n modules: {\r\n }\r\n})\r\n","import { createApp } from 'vue'\r\nimport App from './App.vue'\r\nimport PrimeVue from 'primevue/config'\r\nimport router from './router'\r\nimport store from './store'\r\nimport ToastService from 'primevue/toastservice';\r\nimport './assets/css/common.css'\r\nimport 'primevue/resources/primevue.min.css'\r\nimport 'primevue/resources/themes/saga-blue/theme.css'\r\nimport 'primeicons/primeicons.css'\r\nimport 'primeflex/primeflex.css';\r\n\r\ncreateApp(App).use(store).use(router).use(PrimeVue).use(ToastService).mount('#app')\r\n","export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Home.vue?vue&type=style&index=0&id=007d399c&lang=css\""],"sourceRoot":""} \ No newline at end of file