From 3c0ba313f36c463bb23627d21d18bcf920c4a6ee Mon Sep 17 00:00:00 2001 From: chendishen <690630770@qq.com> Date: Sun, 30 Aug 2020 11:07:48 +0800 Subject: [PATCH] readme --- README.md | 11 ++++++----- Samples/TypeScript/Demo/dist/bundle.js | 4 ++-- Samples/TypeScript/Demo/dist/lapptexturemanager.ts | 2 ++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 049c0a9..cd30465 100644 --- a/README.md +++ b/README.md @@ -138,11 +138,12 @@ export default function Home() ( SSR使用看板娘需要资源域名,资源域名需要允许跨域,nginx参考配置如下: ``` - location / { - add_header Access-Control-Allow-Origin *; - add_header Access-Control-Allow-Headers X-Requested-With; - add_header Access-Control-Allow-Methods GET,POST,OPTIONS; - } +server {   + .... + add_header Access-Control-Allow-Origin *; + add_header Access-Control-Allow-Methods 'GET,POST'; + add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; +} ``` diff --git a/Samples/TypeScript/Demo/dist/bundle.js b/Samples/TypeScript/Demo/dist/bundle.js index 0182eb2..e2af323 100644 --- a/Samples/TypeScript/Demo/dist/bundle.js +++ b/Samples/TypeScript/Demo/dist/bundle.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.live2d=e(require("react")):t.live2d=e(t.React)}(window,(function(t){return function(t){var e={};function i(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(r,o,function(e){return t[e]}.bind(null,o));return r},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=19)}([function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(5),o=i(21),n=i(14),a=i(3),s=r.Live2DCubismFramework.Value,u=o.Live2DCubismFramework.CubismIdManager,l=n.Live2DCubismFramework.CubismRenderer;e.strtod=function(t,e){for(var i=0,r=1;;r++){var o=t.slice(r-1,r);if("e"!=o&&"-"!=o&&"E"!=o){var n=t.substring(0,r),a=Number(n);if(isNaN(a))break;i=r}}var s=parseFloat(t);return isNaN(s)&&(s=NaN),e[0]=t.slice(i),s},function(t){var e=!1,i=!1,r=null,o=null;!function(t){t.vertexOffset=0,t.vertexStep=2}(t.Constant||(t.Constant={})),t.csmDelete=function(t){t&&(t=void 0)};var n=function(){function t(){}return t.startUp=function(t){if(void 0===t&&(t=null),e)return a.CubismLogInfo("CubismFramework.startUp() is already done."),e;if(null!=(r=t)&&Live2DCubismCore.Logging.csmSetLogFunction(r.logFunction),e=!0){var i=Live2DCubismCore.Version.csmGetVersion(),o=(4278190080&i)>>24,n=(16711680&i)>>16,s=65535&i,u=i;a.CubismLogInfo("Live2D Cubism Core version: {0}.{1}.{2} ({3})",("00"+o).slice(-2),("00"+n).slice(-2),("0000"+s).slice(-4),u)}return a.CubismLogInfo("CubismFramework.startUp() is complete."),e},t.cleanUp=function(){e=!1,i=!1,r=null,o=null},t.initialize=function(){a.CSM_ASSERT(e),e?i?a.CubismLogWarning("CubismFramework.initialize() skipped, already initialized."):(s.staticInitializeNotForClientCall(),o=new u,i=!0,a.CubismLogInfo("CubismFramework.initialize() is complete.")):a.CubismLogWarning("CubismFramework is not started.")},t.dispose=function(){a.CSM_ASSERT(e),e?i?(s.staticReleaseNotForClientCall(),o.release(),o=null,l.staticRelease(),i=!1,a.CubismLogInfo("CubismFramework.dispose() is complete.")):a.CubismLogWarning("CubismFramework.dispose() skipped, not initialized."):a.CubismLogWarning("CubismFramework is not started.")},t.isStarted=function(){return e},t.isInitialized=function(){return i},t.coreLogFunction=function(t){Live2DCubismCore.Logging.csmGetLogFunction()&&Live2DCubismCore.Logging.csmGetLogFunction()(t)},t.getLoggingLevel=function(){return null!=r?r.loggingLevel:h.LogLevel_Off},t.getIdManager=function(){return o},t}();t.CubismFramework=n}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}));var h,p=function(){};e.Option=p,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"}(h=e.LogLevel||(e.LogLevel={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){var e=function(){function t(t){void 0===t&&(t=0),t<1?(this._ptr=[],this._capacity=0,this._size=0):(this._ptr=new Array(t),this._capacity=t,this._size=0)}return t.prototype.at=function(t){return this._ptr[t]},t.prototype.set=function(t,e){this._ptr[t]=e},t.prototype.get=function(t){void 0===t&&(t=0);for(var e=new Array,i=t;i=this._capacity&&this.prepareCapacity(0==this._capacity?t.s_defaultSize:2*this._capacity),this._ptr[this._size++]=e},t.prototype.clear=function(){this._ptr.length=0,this._size=0},t.prototype.getSize=function(){return this._size},t.prototype.assign=function(t,e){this._size0)for(var u=0;uthis._capacity&&(0==this._capacity?(this._ptr=new Array(t),this._capacity=t):(this._ptr.length=t,this._capacity=t))},t.prototype.begin=function(){return 0==this._size?this.end():new i(this,0)},t.prototype.end=function(){return new i(this,this._size)},t.prototype.getOffset=function(e){var i=new t;return i._ptr=this.get(e),i._size=this.get(e).length,i._capacity=this.get(e).length,i},t.s_defaultSize=10,t}();t.csmVector=e;var i=function(){function t(t,e){this._vector=null!=t?t:null,this._index=null!=e?e:0}return t.prototype.set=function(t){return this._index=t._index,this._vector=t._vector,this},t.prototype.preIncrement=function(){return++this._index,this},t.prototype.preDecrement=function(){return--this._index,this},t.prototype.increment=function(){var e=new t(this._vector,this._index++);return this._vector=e._vector,this._index=e._index,this},t.prototype.decrement=function(){var e=new t(this._vector,this._index--);return this._vector=e._vector,this._index=e._index,this},t.prototype.ptr=function(){return this._vector._ptr[this._index]},t.prototype.substitution=function(t){return this._index=t._index,this._vector=t._vector,this},t.prototype.notEqual=function(t){return this._index!=t._index||this._vector!=t._vector},t}();t.iterator=i}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(0);e.ViewMaxScale=2,e.ViewMinScale=.8,e.ViewLogicalLeft=-1,e.ViewLogicalRight=1,e.ViewLogicalMaxLeft=-2,e.ViewLogicalMaxRight=2,e.ViewLogicalMaxBottom=-2,e.ViewLogicalMaxTop=2,e.ResourcesPath="./Resources/",e.BackImageName="back_class_normal.png",e.GearImageName="icon_gear.png",e.PowerImageName="CloseNormal.png",e.ModelDir=["Hiyori","Haru","Rice"],e.ModelDirSize=e.ModelDir.length,e.MotionGroupIdle="Idle",e.MotionGroupTapBody="TapBody",e.HitAreaNameHead="Head",e.HitAreaNameBody="Body",e.HitBodyList=["啊呀,你的手在摸哪里嘛~","哼,坏人"],e.HitHeadList=["讨厌~不要掐人家的脸嘛~","希望明天也能感受到你的触摸呢"],e.PriorityNone=0,e.PriorityIdle=1,e.PriorityNormal=2,e.PriorityForce=3,e.DebugLogEnable=!0,e.DebugTouchLogEnable=!1,e.CubismLoggingLevel=r.LogLevel.LogLevel_Verbose,e.RenderTargetWidth=1900,e.RenderTargetHeight=1e3;var o=function(){function t(){}return t.setModelDir=function(t){e.ModelDir=t.length>0?t:e.ModelDir},t.setHitBody=function(t){e.HitBodyList=t.length>0?t:e.HitBodyList},t.setHitHead=function(t){e.HitHeadList=t.length>0?t:e.HitHeadList},t.setPathFull=function(t){e.ResourcesPath=t.length>0?t:e.ResourcesPath},t}();e.lappdefineSet=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=i(0),n=i(20);e.CubismLogPrint=function(t,e,i){r.CubismDebug.print(t,"[CSM]"+e,i)},e.CubismLogPrintIn=function(t,i,r){e.CubismLogPrint(t,i+"\n",r)},e.CSM_ASSERT=function(t){console.assert(t)},n.CSM_LOG_LEVEL<=n.CSM_LOG_LEVEL_VERBOSE?(e.CubismLogVerbose=function(t){for(var i=[],r=1;r0?this.print(t,"\n"):r%8==0&&r>0&&this.print(t," "),this.print(t,"{0} ",[255&e[r]]);this.print(t,"\n")},t}();t.CubismDebug=e}(r=e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=i(0),n=o.Live2DCubismFramework.CubismFramework,a=i(23),s=i(13),u=i(50),l=i(15),h=r(i(2));e.canvas=null,e.s_instance=null,e.gl=null,e.frameBuffer=null;var p=function(){function t(){this._captured=!1,this._mouseX=0,this._mouseY=0,this._isEnd=!1,this._cubismOption=new o.Option,this._view=new a.LAppView,this._textureManager=new u.LAppTextureManager}return t.getInstance=function(){return null==e.s_instance&&(e.s_instance=new t),e.s_instance},t.releaseInstance=function(){console.log("releaseInstance"),null!=e.s_instance&&e.s_instance.release(),e.s_instance=null},t.prototype.initialize=function(){return e.canvas=document.getElementById("live2d"),document.addEventListener("mousemove",(function(e){if(t.getInstance()._view){var i=document.getElementById("live2d").getBoundingClientRect(),r=e.clientX-i.left,o=e.clientY-i.top;t.getInstance()._view.onTouchesMoved(r,o)}else s.LAppPal.printMessage("view notfound")}),!1),document.addEventListener("mouseout",(function(t){l.LAppLive2DManager.getInstance().onDrag(0,0)}),!1),e.canvas.addEventListener("click",(function(i){if(console.log(i),t.getInstance()._view){var r=e.canvas.getBoundingClientRect(),o=i.clientX-r.left,n=i.clientY-r.top;t.getInstance()._view.onTouchesBegan(o,n),t.getInstance()._view.onTouchesEnded(o,n)}else s.LAppPal.printMessage("view notfound")}),!1),e.gl=e.canvas.getContext("webgl")||e.canvas.getContext("experimental-webgl"),e.gl?(e.frameBuffer||(e.frameBuffer=e.gl.getParameter(e.gl.FRAMEBUFFER_BINDING)),e.gl.enable(e.gl.BLEND),e.gl.blendFunc(e.gl.SRC_ALPHA,e.gl.ONE_MINUS_SRC_ALPHA),"ontouchend"in e.canvas&&(e.canvas.ontouchstart=g,e.canvas.ontouchmove=c,e.canvas.ontouchend=d,e.canvas.ontouchcancel=_),this._view.initialize(),this.initializeCubism(),!0):(alert("Cannot initialize WebGL. This browser does not support."),e.gl=null,document.body.innerHTML="This browser does not support the <canvas> element.",!1)},t.prototype.release=function(){this._textureManager.release(),this._textureManager=null,this._view.release(),this._view=null,l.LAppLive2DManager.releaseInstance(),n.dispose()},t.prototype.run=function(){var t=this;console.log("run");var i=function(){null!=e.s_instance&&(s.LAppPal.updateTime(),e.gl.clearColor(0,0,0,0),e.gl.enable(e.gl.DEPTH_TEST),e.gl.depthFunc(e.gl.LEQUAL),e.gl.clear(e.gl.COLOR_BUFFER_BIT|e.gl.DEPTH_BUFFER_BIT),e.gl.clearDepth(1),e.gl.enable(e.gl.BLEND),e.gl.blendFunc(e.gl.SRC_ALPHA,e.gl.ONE_MINUS_SRC_ALPHA),t._view.render(),requestAnimationFrame(i))};i()},t.prototype.createShader=function(){var t=e.gl.createShader(e.gl.VERTEX_SHADER);if(null==t)return s.LAppPal.printMessage("failed to create vertexShader"),null;e.gl.shaderSource(t,"precision mediump float;attribute vec3 position;attribute vec2 uv;varying vec2 vuv;void main(void){ gl_Position = vec4(position, 1.0); vuv = uv;}"),e.gl.compileShader(t);var i=e.gl.createShader(e.gl.FRAGMENT_SHADER);if(null==i)return s.LAppPal.printMessage("failed to create fragmentShader"),null;e.gl.shaderSource(i,"precision mediump float;varying vec2 vuv;uniform sampler2D texture;void main(void){ gl_FragColor = texture2D(texture, vuv);}"),e.gl.compileShader(i);var r=e.gl.createProgram();return e.gl.attachShader(r,t),e.gl.attachShader(r,i),e.gl.deleteShader(t),e.gl.deleteShader(i),e.gl.linkProgram(r),e.gl.useProgram(r),r},t.prototype.getView=function(){return this._view},t.prototype.getTextureManager=function(){return this._textureManager},t.prototype.initializeCubism=function(){this._cubismOption.logFunction=s.LAppPal.printMessage,this._cubismOption.loggingLevel=h.CubismLoggingLevel,n.startUp(this._cubismOption),n.initialize(),l.LAppLive2DManager.getInstance(),s.LAppPal.updateTime(),this._view.initializeSprite()},t}();function g(t){if(p.getInstance()._view){p.getInstance()._captured=!0;var e=t.changedTouches[0].pageX,i=t.changedTouches[0].pageY;p.getInstance()._view.onTouchesBegan(e,i)}else s.LAppPal.printMessage("view notfound")}function c(t){if(p.getInstance()._captured)if(p.getInstance()._view){var e=t.target.getBoundingClientRect(),i=t.changedTouches[0].clientX-e.left,r=t.changedTouches[0].clientY-e.top;p.getInstance()._view.onTouchesMoved(i,r)}else s.LAppPal.printMessage("view notfound")}function d(t){if(p.getInstance()._captured=!1,p.getInstance()._view){var e=t.target.getBoundingClientRect(),i=t.changedTouches[0].clientX-e.left,r=t.changedTouches[0].clientY-e.top;p.getInstance()._view.onTouchesEnded(i,r)}else s.LAppPal.printMessage("view notfound")}function _(t){if(p.getInstance()._captured=!1,p.getInstance()._view){var e=t.target.getBoundingClientRect(),i=t.changedTouches[0].clientX-e.left,r=t.changedTouches[0].clientY-e.top;p.getInstance()._view.onTouchesEnded(i,r)}else s.LAppPal.printMessage("view notfound")}e.LAppDelegate=p},function(t,e,i){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var n=i(8),a=i(9),s=i(1),u=i(3),l=i(0),h=s.Live2DCubismFramework.csmVector,p=a.Live2DCubismFramework.csmMap,g=n.Live2DCubismFramework.csmString;!function(t){var e=function(){function t(){}return t.prototype.getRawString=function(t,e){return this.getString(t,e)},t.prototype.toInt=function(t){return void 0===t&&(t=0),t},t.prototype.toFloat=function(t){return void 0===t&&(t=0),t},t.prototype.toBoolean=function(t){return void 0===t&&(t=!1),t},t.prototype.getSize=function(){return 0},t.prototype.getArray=function(t){return void 0===t&&(t=null),t},t.prototype.getVector=function(t){return t},t.prototype.getMap=function(t){return t},t.prototype.getValueByIndex=function(e){return t.errorValue.setErrorNotForClientCall("Error: type mismatch")},t.prototype.getValueByString=function(e){return t.nullValue.setErrorNotForClientCall("Error: type mismatch")},t.prototype.getKeys=function(){return t.s_dummyKeys},t.prototype.isError=function(){return!1},t.prototype.isNull=function(){return!1},t.prototype.isBool=function(){return!1},t.prototype.isFloat=function(){return!1},t.prototype.isString=function(){return!1},t.prototype.isArray=function(){return!1},t.prototype.isMap=function(){return!1},t.prototype.equals=function(t){return!1},t.prototype.isStatic=function(){return!1},t.prototype.setErrorNotForClientCall=function(t){return s.errorValue},t.staticInitializeNotForClientCall=function(){n.trueValue=new n(!0),n.falseValue=new n(!1),s.errorValue=new s("ERROR",!0),this.nullValue=new c,t.s_dummyKeys=new h},t.staticReleaseNotForClientCall=function(){n.trueValue=null,n.falseValue=null,s.errorValue=null,t.nullValue=null,t.s_dummyKeys=null,n.trueValue=null,n.falseValue=null,s.errorValue=null,t.nullValue=null,t.s_dummyKeys=null},t}();t.Value=e;var i=function(){function t(t,e){this._error=null,this._lineCount=0,this._root=null,null!=t&&this.parseBytes(t,e)}return t.create=function(e,i){var r=new t;return r.parseBytes(e,i)?r:(t.delete(r),null)},t.delete=function(t){null},t.prototype.getRoot=function(){return this._root},t.prototype.arrayBufferToString=function(t){for(var e=new Uint8Array(t),i="",r=0,o=e.length;ra&&n.append(t.slice(a),o-a),a=o+1,ot.s},t.prototype.isEqual=function(t){return this.s==t},t.prototype.isEmpty=function(){return 0==this.s.length},t}();t.csmString=e}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(3);!function(t){var e=function(t,e){this.first=null==t?null:t,this.second=null==e?null:e};t.csmPair=e;var i=function(){function t(t){null!=t?t<1?(this._keyValues=[],this._dummyValue=null,this._size=0):(this._keyValues=new Array(t),this._size=t):(this._keyValues=[],this._dummyValue=null,this._size=0)}return t.prototype.release=function(){this.clear()},t.prototype.appendKey=function(t){this.prepareCapacity(this._size+1,!1),this._keyValues[this._size]=new e(t),this._size+=1},t.prototype.getValue=function(t){for(var e=-1,i=0;i=0?this._keyValues[e].second:(this.appendKey(t),this._keyValues[this._size-1].second)},t.prototype.setValue=function(t,e){for(var i=-1,r=0;r=0?this._keyValues[i].second=e:(this.appendKey(t),this._keyValues[this._size-1].second=e)},t.prototype.isExist=function(t){for(var e=0;ethis._keyValues.length&&(0==this._keyValues.length?(!i&&e0&&e.getEndTime()i&&(t=i),t},t.sin=function(t){return Math.sin(t)},t.cos=function(t){return Math.cos(t)},t.abs=function(t){return Math.abs(t)},t.sqrt=function(t){return Math.sqrt(t)},t.getEasingSine=function(t){return t<0?0:t>1?1:.5-.5*this.cos(t*Math.PI)},t.max=function(t,e){return t>e?t:e},t.min=function(t,e){return t>e?e:t},t.degreesToRadian=function(t){return t/180*Math.PI},t.radianToDegrees=function(t){return 180*t/Math.PI},t.directionToRadian=function(t,e){for(var i=Math.atan2(e.y,e.x)-Math.atan2(t.y,t.x);i<-Math.PI;)i+=2*Math.PI;for(;i>Math.PI;)i-=2*Math.PI;return i},t.directionToDegrees=function(t,e){var i=this.directionToRadian(t,e),r=this.radianToDegrees(i);return e.x-t.x>0&&(r=-r),r},t.radianToDirection=function(t){var e=new r;return e.x=this.sin(t),e.y=this.cos(t),e},t}();t.CubismMath=e}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){var e=function(){function t(t,e){this.x=t,this.y=e,this.x=null==t?0:t,this.y=null==e?0:e}return t.prototype.add=function(e){var i=new t(0,0);return i.x=this.x+e.x,i.y=this.y+e.y,i},t.prototype.substract=function(e){var i=new t(0,0);return i.x=this.x-e.x,i.y=this.y-e.y,i},t.prototype.multiply=function(e){var i=new t(0,0);return i.x=this.x*e.x,i.y=this.y*e.y,i},t.prototype.multiplyByScaler=function(e){return this.multiply(new t(e,e))},t.prototype.division=function(e){var i=new t(0,0);return i.x=this.x/e.x,i.y=this.y/e.y,i},t.prototype.divisionByScalar=function(e){return this.division(new t(e,e))},t.prototype.getLength=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.getDistanceWith=function(t){return Math.sqrt((this.x-t.x)*(this.x-t.x)+(this.y-t.y)*(this.y-t.y))},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y},t.prototype.normalize=function(){var t=Math.pow(this.x*this.x+this.y*this.y,.5);this.x=this.x/t,this.y=this.y/t},t.prototype.isEqual=function(t){return this.x==t.x&&this.y==t.y},t.prototype.isNotEqual=function(t){return!this.isEqual(t)},t}();t.CubismVector2=e}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){}return t.loadFileAsBytes=function(t,e){fetch(t).then((function(t){return t.arrayBuffer()})).then((function(t){return e(t,t.byteLength)}))},t.getDeltaTime=function(){return this.s_deltaTime},t.updateTime=function(){this.s_currentFrame=Date.now(),this.s_deltaTime=(this.s_currentFrame-this.s_lastFrame)/1e3,this.s_lastFrame=this.s_currentFrame},t.printMessage=function(t){console.log(t)},t.lastUpdate=Date.now(),t.s_currentFrame=0,t.s_lastFrame=0,t.s_deltaTime=0,t}();e.LAppPal=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(6).Live2DCubismFramework.CubismMatrix44;!function(t){var e=function(){function t(){this._isCulling=!1,this._isPremultipliedAlpha=!1,this._anisortopy=0,this._model=null,this._modelColor=new i,this._mvpMatrix4x4=new r,this._mvpMatrix4x4.loadIdentity()}return t.create=function(){return null},t.delete=function(t){null},t.prototype.initialize=function(t){this._model=t},t.prototype.drawModel=function(){null!=this.getModel()&&this.doDrawModel()},t.prototype.setMvpMatrix=function(t){this._mvpMatrix4x4.setMatrix(t.getArray())},t.prototype.getMvpMatrix=function(){return this._mvpMatrix4x4},t.prototype.setModelColor=function(t,e,i,r){t<0?t=0:t>1&&(t=1),e<0?e=0:e>1&&(e=1),i<0?i=0:i>1&&(i=1),r<0?r=0:r>1&&(r=1),this._modelColor.R=t,this._modelColor.G=e,this._modelColor.B=i,this._modelColor.A=r},t.prototype.getModelColor=function(){return JSON.parse(JSON.stringify(this._modelColor))},t.prototype.setIsPremultipliedAlpha=function(t){this._isPremultipliedAlpha=t},t.prototype.isPremultipliedAlpha=function(){return this._isPremultipliedAlpha},t.prototype.setIsCulling=function(t){this._isCulling=t},t.prototype.isCulling=function(){return this._isCulling},t.prototype.setAnisotropy=function(t){this._anisortopy=t},t.prototype.getAnisotropy=function(){return this._anisortopy},t.prototype.getModel=function(){return this._model},t}();t.CubismRenderer=e,function(t){t[t.CubismBlendMode_Normal=0]="CubismBlendMode_Normal",t[t.CubismBlendMode_Additive=1]="CubismBlendMode_Additive",t[t.CubismBlendMode_Multiplicative=2]="CubismBlendMode_Multiplicative"}(t.CubismBlendMode||(t.CubismBlendMode={}));var i=function(){this.R=1,this.G=1,this.B=1,this.A=1};t.CubismTextureColor=i}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=i(6),n=i(1).Live2DCubismFramework.csmVector,a=o.Live2DCubismFramework.CubismMatrix44,s=i(26),u=i(13),l=i(4),h=r(i(2));e.s_instance=null;var p=null,g=function(){function t(){this._finishedMotion=function(t){u.LAppPal.printMessage("Motion Finished:")},this._viewMatrix=new a,this._models=new n,this._sceneIndex=0,this.changeScene(this._sceneIndex)}return t.getInstance=function(){return null==e.s_instance&&(e.s_instance=new t),e.s_instance},t.releaseInstance=function(){null!=e.s_instance&&(e.s_instance=void 0),e.s_instance=null},t.prototype.getModel=function(t){return t=1&&(n=1,this._blinkingState=e.EyeState_Closed,this._stateStartTimeSeconds=this._userTimeSeconds),o=1-n;break;case e.EyeState_Closed:(n=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._closedSeconds)>=1&&(this._blinkingState=e.EyeState_Opening,this._stateStartTimeSeconds=this._userTimeSeconds),o=0;break;case e.EyeState_Opening:(n=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._openingSeconds)>=1&&(n=1,this._blinkingState=e.EyeState_Interval,this._nextBlinkingTime=this.determinNextBlinkingTiming()),o=n;break;case e.EyeState_Interval:this._nextBlinkingTime300?t.width/2:"150px",left:t.width>300?(t.width-t.width/2)/2+"px":(t.width-150)/2+"px",top:"0",minHeight:"20px",display:"block",borderRadius:"5px",border:"1px dashed #ccc",padding:"5px",background:t.color?t.color:"#C8E6FE"},s="none",(i="display")in e?Object.defineProperty(e,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[i]=s,e);return Object(n.useEffect)((function(){console.log("props",t),t.ModelList?o.lappdefineSet.setModelDir(t.ModelList):o.lappdefineSet.setModelDir([]),t.TouchBody?o.lappdefineSet.setHitBody(t.TouchBody):o.lappdefineSet.setHitBody([]),t.TouchHead?o.lappdefineSet.setHitHead(t.TouchHead):o.lappdefineSet.setHitHead([]),t.PathFull?o.lappdefineSet.setPathFull(t.PathFull):o.lappdefineSet.setPathFull(""),0!=r.LAppDelegate.getInstance().initialize()&&(r.LAppDelegate.getInstance().run(),window.onbeforeunload=function(){return r.LAppDelegate.releaseInstance()})}),[]),a.a.createElement("div",null,a.a.createElement("div",{style:u,width:t.width?t.width:"300",height:t.height?t.height:"500",id:"live2d-container"},a.a.createElement("div",{id:"live2d-print",style:h}),a.a.createElement("canvas",{id:"live2d",style:l,width:t.width?t.width:"300",height:t.height?t.height:"500",className:"live2d"})))}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CSM_LOG_LEVEL_VERBOSE=0,e.CSM_LOG_LEVEL_DEBUG=1,e.CSM_LOG_LEVEL_INFO=2,e.CSM_LOG_LEVEL_WARNING=3,e.CSM_LOG_LEVEL_ERROR=4,e.CSM_LOG_LEVEL_OFF=5,e.CSM_LOG_LEVEL=e.CSM_LOG_LEVEL_VERBOSE},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(1),o=i(22).Live2DCubismFramework.CubismId,n=r.Live2DCubismFramework.csmVector;!function(t){var e=function(){function t(){this._ids=new n}return t.prototype.release=function(){for(var t=0;tthis._screenLeft&&(t=this._screenLeft-this._tr[0]*this._maxLeft-this._tr[12]),this._tr[0]*this._maxRight+(this._tr[12]+t)this._screenBottom&&(e=this._screenBottom-this._tr[5]*this._maxBottom-this._tr[13]);var i=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,t,e,0,1]);n.multiply(i,this._tr,this._tr)},e.prototype.adjustScale=function(t,e,i){var r=this.getMaxScale(),o=this.getMinScale(),a=i*this._tr[0];a0&&(i=o/this._tr[0]):a>r&&this._tr[0]>0&&(i=r/this._tr[0]);var s=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,t,e,0,1]),u=new Float32Array([i,0,0,0,0,i,0,0,0,0,1,0,0,0,0,1]),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,-t,-e,0,1]);n.multiply(l,this._tr,this._tr),n.multiply(u,this._tr,this._tr),n.multiply(s,this._tr,this._tr)},e.prototype.setScreenRect=function(t,e,i,r){this._screenLeft=t,this._screenRight=e,this._screenBottom=i,this._screenTop=r},e.prototype.setMaxScreenRect=function(t,e,i,r){this._maxLeft=t,this._maxRight=e,this._maxTop=r,this._maxBottom=i},e.prototype.setMaxScale=function(t){this._maxScale=t},e.prototype.setMinScale=function(t){this._minScale=t},e.prototype.getMaxScale=function(){return this._maxScale},e.prototype.getMinScale=function(){return this._minScale},e.prototype.isMaxScale=function(){return this.getScaleX()>=this._maxScale},e.prototype.isMinScale=function(){return this.getScaleX()<=this._minScale},e.prototype.getScreenLeft=function(){return this._screenLeft},e.prototype.getScreenRight=function(){return this._screenRight},e.prototype.getScreenBottom=function(){return this._screenBottom},e.prototype.getScreenTop=function(){return this._screenTop},e.prototype.getMaxLeft=function(){return this._maxLeft},e.prototype.getMaxRight=function(){return this._maxRight},e.prototype.getMaxBottom=function(){return this._maxBottom},e.prototype.getMaxTop=function(){return this._maxTop},e}(n);t.CubismViewMatrix=e}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){this._startX=0,this._startY=0,this._lastX=0,this._lastY=0,this._lastX1=0,this._lastY1=0,this._lastX2=0,this._lastY2=0,this._lastTouchDistance=0,this._deltaX=0,this._deltaY=0,this._scale=1,this._touchSingle=!1,this._flipAvailable=!1}return t.prototype.getCenterX=function(){return this._lastX},t.prototype.getCenterY=function(){return this._lastY},t.prototype.getDeltaX=function(){return this._deltaX},t.prototype.getDeltaY=function(){return this._deltaY},t.prototype.getStartX=function(){return this._startX},t.prototype.getStartY=function(){return this._startY},t.prototype.getScale=function(){return this._scale},t.prototype.getX=function(){return this._lastX},t.prototype.getY=function(){return this._lastY},t.prototype.getX1=function(){return this._lastX1},t.prototype.getY1=function(){return this._lastY1},t.prototype.getX2=function(){return this._lastX2},t.prototype.getY2=function(){return this._lastY2},t.prototype.isSingleTouch=function(){return this._touchSingle},t.prototype.isFlickAvailable=function(){return this._flipAvailable},t.prototype.disableFlick=function(){this._flipAvailable=!1},t.prototype.touchesBegan=function(t,e){this._lastX=t,this._lastY=e,this._startX=t,this._startY=e,this._lastTouchDistance=-1,this._flipAvailable=!0,this._touchSingle=!0},t.prototype.touchesMoved=function(t,e){this._lastX=t,this._lastY=e,this._lastTouchDistance=-1,this._touchSingle=!0},t.prototype.getFlickDistance=function(){return this.calculateDistance(this._startX,this._startY,this._lastX,this._lastY)},t.prototype.calculateDistance=function(t,e,i,r){return Math.sqrt((t-i)*(t-i)+(e-r)*(e-r))},t.prototype.calculateMovingAmount=function(t,e){if(t>0!=e>0)return 0;var i=t>0?1:-1,r=Math.abs(t),o=Math.abs(e);return i*(r0){for(var t=e._modelSetting.getExpressionCount(),i=function(i){var r=e._modelSetting.getExpressionName(i),n=e._modelSetting.getExpressionFileName(i);fetch(e._modelHomeDir+"/"+n).then((function(t){return t.arrayBuffer()})).then((function(i){var n=e.loadExpression(i,i.byteLength,r);null!=e._expressions.getValue(r)&&(M.delete(e._expressions.getValue(r)),e._expressions.setValue(r,null)),e._expressions.setValue(r,n),e._expressionCount++,e._expressionCount>=t&&(e._state=a.LoadPhysics,o())}))},r=0;r0&&(e._eyeBlink=x.create(e._modelSetting),e._state=a.SetupBreath),u()},u=function(){e._breath=b.create();var t=new S;t.pushBack(new C(e._idParamAngleX,0,15,6.5345,.5)),t.pushBack(new C(e._idParamAngleY,0,8,3.5345,.5)),t.pushBack(new C(e._idParamAngleZ,0,10,5.5345,.5)),t.pushBack(new C(e._idParamBodyAngleX,0,4,15.5345,.5)),t.pushBack(new C(L.getIdManager().getId(w.ParamBreath),0,.5,3.2345,.5)),e._breath.setParameters(t),e._state=a.LoadUserData,l()},l=function(){if(""!=e._modelSetting.getUserDataFile()){var t=e._modelSetting.getUserDataFile();fetch(e._modelHomeDir+"/"+t).then((function(t){return t.arrayBuffer()})).then((function(t){e.loadUserData(t,t.byteLength),e._state=a.SetupEyeBlinkIds,h()})),e._state=a.WaitLoadUserData}else e._state=a.SetupEyeBlinkIds,h()},h=function(){for(var t=e._modelSetting.getEyeBlinkParameterCount(),i=0;i=e&&(t._state=a.CompleteSetup)})),r.getRenderer().setIsPremultipliedAlpha(!0)},r=this,o=0;o=0&&s.setFadeInTime(n),(n=o._modelSetting.getMotionFadeOutTimeValue(t,e))>=0&&s.setFadeOutTime(n),s.setEffectIds(o._eyeBlinkIds,o._lipSyncIds),u=!0})):s.setFinishedMotionHandler(r),this._debugMode&&I.LAppPal.printMessage("[APP]start motion: ["+t+"_"+e),this._motionManager.startMotionPriority(s,u,i)},e.prototype.startRandomMotion=function(t,e,i){if(0==this._modelSetting.getMotionCount(t))return y;var r=Math.floor(Math.random()*this._modelSetting.getMotionCount(t));return this.startMotion(t,r,e,i)},e.prototype.setExpression=function(t){var e=this._expressions.getValue(t);this._debugMode&&I.LAppPal.printMessage("[APP]expression: ["+t+"]"),null!=e?this._expressionManager.startMotionPriority(e,!1,V.PriorityForce):this._debugMode&&I.LAppPal.printMessage("[APP]expression["+t+"] is null")},e.prototype.setRandomExpression=function(){if(0!=this._expressions.getSize())for(var t=Math.floor(Math.random()*this._expressions.getSize()),e=0;e ["+n+"]"),fetch(r._modelHomeDir+"/"+o).then((function(t){return t.arrayBuffer()})).then((function(r){var o=e.loadMotion(r,r.byteLength,n),s=e._modelSetting.getMotionFadeInTimeValue(t,i);s>=0&&o.setFadeInTime(s),(s=e._modelSetting.getMotionFadeOutTimeValue(t,i))>=0&&o.setFadeOutTime(s),o.setEffectIds(e._eyeBlinkIds,e._lipSyncIds),null!=e._motions.getValue(n)&&M.delete(e._motions.getValue(n)),e._motions.setValue(n,o),e._motionCount++,e._motionCount>=e._allMotionCount&&(e._state=a.LoadTexture,e._motionManager.stopAllMotions(),e._updating=!1,e._initialized=!0,e.createRenderer(),e.setupTextures(),e.getRenderer().startUp(F.gl))}))},r=this,o=0;os&&(s=p),gl&&(l=g)}var c=this._modelMatrix.invertTransformX(e),d=this._modelMatrix.invertTransformY(i);return a<=c&&c<=s&&u<=d&&d<=l},t.prototype.getModel=function(){return this._model},t.prototype.getRenderer=function(){return this._renderer},t.prototype.createRenderer=function(){this._renderer&&this.deleteRenderer(),this._renderer=new f,this._renderer.initialize(this._model)},t.prototype.deleteRenderer=function(){null!=this._renderer&&(this._renderer.release(),this._renderer=null)},t.prototype.motionEventFired=function(t){m.CubismLogInfo("{0}",t.s)},t.cubismDefaultMotionEventCallback=function(t,e,i){null!=i&&i.motionEventFired(e)},t.prototype.release=function(){null!=this._motionManager&&(this._motionManager.release(),this._motionManager=null),null!=this._expressionManager&&(this._expressionManager.release(),this._expressionManager=null),null!=this._moc&&(this._moc.deleteModel(this._model),this._moc.release(),this._moc=null),this._modelMatrix=null,x.delete(this._pose),y.delete(this._eyeBlink),v.delete(this._breath),this._dragManager=null,b.delete(this._physics),C.delete(this._modelUserData),this.deleteRenderer()},t}();t.CubismUserModel=e}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var n=i(16).Live2DCubismFramework.CubismMotionQueueManager;!function(t){var e=function(t){function e(){var e=t.call(this)||this;return e._currentPriority=0,e._reservePriority=0,e}return o(e,t),e.prototype.getCurrentPriority=function(){return this._currentPriority},e.prototype.getReservePriority=function(){return this._reservePriority},e.prototype.setReservePriority=function(t){this._reservePriority=t},e.prototype.startMotionPriority=function(e,i,r){return r==this._reservePriority&&(this._reservePriority=0),this._currentPriority=r,t.prototype.startMotion.call(this,e,i,this._userTimeSeconds)},e.prototype.updateMotion=function(e,i){this._userTimeSeconds+=i;var r=t.prototype.doUpdateMotion.call(this,e,this._userTimeSeconds);return this.isFinished()&&(this._currentPriority=0),r},e.prototype.reserveMotion=function(t){return!(t<=this._reservePriority||t<=this._currentPriority)&&(this._reservePriority=t,!0)},e}(n);t.CubismMotionManager=e}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(10).Live2DCubismFramework.ACubismMotion;!function(t){var e=function(){function t(){this._autoDelete=!1,this._motion=null,this._available=!0,this._finished=!1,this._started=!1,this._startTimeSeconds=-1,this._fadeInStartTimeSeconds=0,this._endTimeSeconds=-1,this._stateTimeSeconds=0,this._stateWeight=0,this._lastEventCheckSeconds=0,this._motionQueueEntryHandle=this}return t.prototype.release=function(){this._autoDelete&&this._motion&&r.delete(this._motion)},t.prototype.startFadeout=function(t,e){var i=e+t;(this._endTimeSeconds<0||ii)&&(u*=i/h,l*=i/h),this._faceVX+=u,this._faceVY+=l;var p=.5*(r.sqrt(i*i+16*i*a-8*i*a)-i),g=r.sqrt(this._faceVX*this._faceVX+this._faceVY*this._faceVY);g>p&&(this._faceVX*=p/g,this._faceVY*=p/g),this._faceX+=this._faceVX,this._faceY+=this._faceVY}}else this._lastTimeSeconds=this._userTimeSeconds},t.prototype.getX=function(){return this._faceX},t.prototype.getY=function(){return this._faceY},t.prototype.set=function(t,e){this._faceTargetX=t,this._faceTargetY=e},t}();t.CubismTargetPoint=e}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var n=i(6).Live2DCubismFramework.CubismMatrix44;!function(t){var e=function(t){function e(e,i){var r=t.call(this)||this;return r._width=void 0!==e?e:0,r._height=void 0!==i?i:0,r.setHeight(1),r}return o(e,t),e.prototype.setWidth=function(t){var e=t/this._width,i=e;this.scale(2.6*e,2.6*i)},e.prototype.setHeight=function(t){var e=t/this._height,i=e;this.scale(2.6*e,2.6*i)},e.prototype.setPosition=function(t,e){this.translate(t,e)},e.prototype.setCenterPosition=function(t,e){this.centerX(t),this.centerY(e)},e.prototype.top=function(t){this.setY(t)},e.prototype.bottom=function(t){var e=this._height*this.getScaleY();this.translateY(t-e)},e.prototype.left=function(t){this.setX(t)},e.prototype.right=function(t){var e=this._width*this.getScaleX();this.translateX(t-e)},e.prototype.centerX=function(t){var e=this._width*this.getScaleX();this.translateX(t-e/2)},e.prototype.setX=function(t){this.translateX(t)},e.prototype.centerY=function(t){var e=this._height*this.getScaleY();this.translateY(t-e/2)},e.prototype.setY=function(t){this.translateY(t)},e.prototype.setupFromLayout=function(t){for(var e=t.begin();e.notEqual(t.end());e.preIncrement()){var i=e.ptr().first,r=e.ptr().second;"width"==i?this.setWidth(r):"height"==i&&this.setHeight(r)}for(e=t.begin();e.notEqual(t.end());e.preIncrement()){i=e.ptr().first,r=e.ptr().second;"x"==i?this.setX(r):"y"==i?this.setY(r):"center_x"==i?this.centerX(r):"center_y"==i?this.centerY(r):"top"==i?this.top(r):"bottom"==i?this.bottom(r):"left"==i?this.left(r):"right"==i&&this.right(r)}},e}(n);t.CubismModelMatrix=e}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(33).Live2DCubismFramework.CubismModel,o=i(3);!function(t){var e=function(){function t(t){this._moc=t,this._modelCount=0}return t.create=function(e){var i=null,r=Live2DCubismCore.Moc.fromArrayBuffer(e);return r&&(i=new t(r)),i},t.delete=function(t){t._moc._release(),t._moc=null,t=null},t.prototype.createModel=function(){var t=null,e=Live2DCubismCore.Model.fromMoc(this._moc);return e&&((t=new r(e)).initialize(),++this._modelCount),t},t.prototype.deleteModel=function(t){null!=t&&(t.release(),t=null,--this._modelCount)},t.prototype.release=function(){o.CSM_ASSERT(0==this._modelCount),this._moc._release(),this._moc=null},t}();t.CubismMoc=e}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(14),o=i(0),n=i(9),a=i(1),s=i(3),u=o.Live2DCubismFramework.CubismFramework,l=r.Live2DCubismFramework.CubismBlendMode,h=a.Live2DCubismFramework.csmVector,p=n.Live2DCubismFramework.csmMap;!function(t){var e=function(){function t(t){this._model=t,this._parameterValues=null,this._parameterMaximumValues=null,this._parameterMinimumValues=null,this._partOpacities=null,this._savedParameters=new h,this._parameterIds=new h,this._drawableIds=new h,this._partIds=new h,this._notExistPartId=new p,this._notExistParameterId=new p,this._notExistParameterValues=new p,this._notExistPartOpacities=new p}return t.prototype.update=function(){this._model.update(),this._model.drawables.resetDynamicFlags()},t.prototype.getCanvasWidth=function(){return null==this._model?0:this._model.canvasinfo.CanvasWidth/this._model.canvasinfo.PixelsPerUnit},t.prototype.getCanvasHeight=function(){return null==this._model?0:this._model.canvasinfo.CanvasHeight/this._model.canvasinfo.PixelsPerUnit},t.prototype.saveParameters=function(){for(var t=this._model.parameters.count,e=this._savedParameters.getSize(),i=0;ie&&(e=this._model.parameters.minimumValues[t]),this._parameterValues[t]=1==i?e:this._parameterValues[t]=this._parameterValues[t]*(1-i)+e*i)},t.prototype.setParameterValueById=function(t,e,i){void 0===i&&(i=1);var r=this.getParameterIndex(t);this.setParameterValueByIndex(r,e,i)},t.prototype.addParameterValueByIndex=function(t,e,i){void 0===i&&(i=1),this.setParameterValueByIndex(t,this.getParameterValueByIndex(t)+e*i)},t.prototype.addParameterValueById=function(t,e,i){void 0===i&&(i=1);var r=this.getParameterIndex(t);this.addParameterValueByIndex(r,e,i)},t.prototype.multiplyParameterValueById=function(t,e,i){void 0===i&&(i=1);var r=this.getParameterIndex(t);this.multiplyParameterValueByIndex(r,e,i)},t.prototype.multiplyParameterValueByIndex=function(t,e,i){void 0===i&&(i=1),this.setParameterValueByIndex(t,this.getParameterValueByIndex(t)*(1+(e-1)*i))},t.prototype.getDrawableIndex=function(t){for(var e=this._model.drawables.count,i=0;ie&&(t=e);for(var i=0;ii){o=s;break}if(-1==o)return t.points.at(a).value;var u=t.segments.at(o);return u.evaluate(t.points.get(u.basePointIndex),i)}var u=function(t){function e(){var e=t.call(this)||this;return e._sourceFrameRate=30,e._loopDurationSeconds=-1,e._isLoop=!1,e._isLoopFadeIn=!0,e._lastWeight=0,e._motionData=null,e._modelCurveIdEyeBlink=null,e._modelCurveIdLipSync=null,e._eyeBlinkParameterIds=null,e._lipSyncParameterIds=null,e}return o(e,t),e.create=function(t,i,r){var o=new e;return o.parse(t,i),o._sourceFrameRate=o._motionData.fps,o._loopDurationSeconds=o._motionData.duration,o._onFinishedMotion=r,o},e.prototype.doUpdateParameters=function(t,e,i,r){null==this._modelCurveIdEyeBlink&&(this._modelCurveIdEyeBlink=b.getIdManager().getId("EyeBlink")),null==this._modelCurveIdLipSync&&(this._modelCurveIdLipSync=b.getIdManager().getId("LipSync"));var o=e-r.getStartTime();o<0&&(o=0);var n=Number.MAX_VALUE,a=Number.MAX_VALUE,u=0,l=0;this._eyeBlinkParameterIds.getSize()>64&&p.CubismLogDebug("too many eye blink targets : {0}",this._eyeBlinkParameterIds.getSize()),this._lipSyncParameterIds.getSize()>64&&p.CubismLogDebug("too many lip sync targets : {0}",this._lipSyncParameterIds.getSize());var h,g,c,d=this._fadeInSeconds<=0?1:S.getEasingSine((e-r.getFadeInStartTime())/this._fadeInSeconds),_=this._fadeOutSeconds<=0||r.getEndTime()<0?1:S.getEasingSine((r.getEndTime()-e)/this._fadeOutSeconds),m=o;if(this._isLoop)for(;m>this._motionData.duration;)m-=this._motionData.duration;var f=this._motionData.curves;for(g=0;g>C&1)){x=y+(a-y)*i;t.setParameterValueById(this._eyeBlinkParameterIds.at(C),x)}}if(n!=Number.MAX_VALUE)for(C=0;C>C&1)){x=y+(n-y)*i;t.setParameterValueById(this._lipSyncParameterIds.at(C),x)}}for(;g=this._motionData.duration&&(this._isLoop?(r.setStartTime(e),this._isLoopFadeIn&&r.setFadeInStartTime(e)):(this._onFinishedMotion&&this._onFinishedMotion(this),r.setIsFinished(!0))),this._lastWeight=i},e.prototype.setIsLoop=function(t){this._isLoop=t},e.prototype.isLoop=function(){return this._isLoop},e.prototype.setIsLoopFadeIn=function(t){this._isLoopFadeIn=t},e.prototype.isLoopFadeIn=function(){return this._isLoopFadeIn},e.prototype.getDuration=function(){return this._isLoop?-1:this._loopDurationSeconds},e.prototype.getLoopDuration=function(){return this._loopDurationSeconds},e.prototype.setParameterFadeInTime=function(t,e){for(var i=this._motionData.curves,r=0;rt&&this._motionData.events.at(i).fireTime<=e&&this._firedEventValues.pushBack(new g(this._motionData.events.at(i).value.s));return this._firedEventValues},e}(C);t.CubismMotion=u}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(5),o=i(0),n=i(8).Live2DCubismFramework.csmString,a=o.Live2DCubismFramework.CubismFramework,s=r.Live2DCubismFramework.CubismJson;!function(t){var e="Meta",i=function(){function t(t,e){this._json=s.create(t,e)}return t.prototype.release=function(){s.delete(this._json)},t.prototype.getMotionDuration=function(){return this._json.getRoot().getValueByString(e).getValueByString("Duration").toFloat()},t.prototype.isMotionLoop=function(){return this._json.getRoot().getValueByString(e).getValueByString("Loop").toBoolean()},t.prototype.getMotionCurveCount=function(){return this._json.getRoot().getValueByString(e).getValueByString("CurveCount").toInt()},t.prototype.getMotionFps=function(){return this._json.getRoot().getValueByString(e).getValueByString("Fps").toFloat()},t.prototype.getMotionTotalSegmentCount=function(){return this._json.getRoot().getValueByString(e).getValueByString("TotalSegmentCount").toInt()},t.prototype.getMotionTotalPointCount=function(){return this._json.getRoot().getValueByString(e).getValueByString("TotalPointCount").toInt()},t.prototype.isExistMotionFadeInTime=function(){return!this._json.getRoot().getValueByString(e).getValueByString("FadeInTime").isNull()},t.prototype.isExistMotionFadeOutTime=function(){return!this._json.getRoot().getValueByString(e).getValueByString("FadeOutTime").isNull()},t.prototype.getMotionFadeInTime=function(){return this._json.getRoot().getValueByString(e).getValueByString("FadeInTime").toFloat()},t.prototype.getMotionFadeOutTime=function(){return this._json.getRoot().getValueByString(e).getValueByString("FadeOutTime").toFloat()},t.prototype.getMotionCurveTarget=function(t){return this._json.getRoot().getValueByString("Curves").getValueByIndex(t).getValueByString("Target").getRawString()},t.prototype.getMotionCurveId=function(t){return a.getIdManager().getId(this._json.getRoot().getValueByString("Curves").getValueByIndex(t).getValueByString("Id").getRawString())},t.prototype.isExistMotionCurveFadeInTime=function(t){return!this._json.getRoot().getValueByString("Curves").getValueByIndex(t).getValueByString("FadeInTime").isNull()},t.prototype.isExistMotionCurveFadeOutTime=function(t){return!this._json.getRoot().getValueByString("Curves").getValueByIndex(t).getValueByString("FadeOutTime").isNull()},t.prototype.getMotionCurveFadeInTime=function(t){return this._json.getRoot().getValueByString("Curves").getValueByIndex(t).getValueByString("FadeInTime").toFloat()},t.prototype.getMotionCurveFadeOutTime=function(t){return this._json.getRoot().getValueByString("Curves").getValueByIndex(t).getValueByString("FadeOutTime").toFloat()},t.prototype.getMotionCurveSegmentCount=function(t){return this._json.getRoot().getValueByString("Curves").getValueByIndex(t).getValueByString("Segments").getVector().getSize()},t.prototype.getMotionCurveSegment=function(t,e){return this._json.getRoot().getValueByString("Curves").getValueByIndex(t).getValueByString("Segments").getValueByIndex(e).toFloat()},t.prototype.getEventCount=function(){return this._json.getRoot().getValueByString(e).getValueByString("UserDataCount").toInt()},t.prototype.getTotalEventValueSize=function(){return this._json.getRoot().getValueByString(e).getValueByString("TotalUserDataSize").toInt()},t.prototype.getEventTime=function(t){return this._json.getRoot().getValueByString("UserData").getValueByIndex(t).getValueByString("Time").toInt()},t.prototype.getEventValue=function(t){return new n(this._json.getRoot().getValueByString("UserData").getValueByIndex(t).getValueByString("Value").getRawString())},t}();t.CubismMotionJson=i}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(1).Live2DCubismFramework.csmVector;!function(t){var e;!function(t){t[t.CubismMotionCurveTarget_Model=0]="CubismMotionCurveTarget_Model",t[t.CubismMotionCurveTarget_Parameter=1]="CubismMotionCurveTarget_Parameter",t[t.CubismMotionCurveTarget_PartOpacity=2]="CubismMotionCurveTarget_PartOpacity"}(e=t.CubismMotionCurveTarget||(t.CubismMotionCurveTarget={})),function(t){t[t.CubismMotionSegmentType_Linear=0]="CubismMotionSegmentType_Linear",t[t.CubismMotionSegmentType_Bezier=1]="CubismMotionSegmentType_Bezier",t[t.CubismMotionSegmentType_Stepped=2]="CubismMotionSegmentType_Stepped",t[t.CubismMotionSegmentType_InverseStepped=3]="CubismMotionSegmentType_InverseStepped"}(t.CubismMotionSegmentType||(t.CubismMotionSegmentType={}));var i=function(){this.time=0,this.value=0};t.CubismMotionPoint=i;var o=function(){this.evaluate=null,this.basePointIndex=0,this.segmentType=0};t.CubismMotionSegment=o;var n=function(){this.type=e.CubismMotionCurveTarget_Model,this.segmentCount=0,this.baseSegmentIndex=0,this.fadeInTime=0,this.fadeOutTime=0};t.CubismMotionCurve=n;var a=function(){this.fireTime=0};t.CubismMotionEvent=a;var s=function(){this.duration=0,this.loop=!1,this.curveCount=0,this.eventCount=0,this.fps=0,this.curves=new r,this.segments=new r,this.points=new r,this.events=new r};t.CubismMotionData=s}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var n=i(10),a=i(5),s=i(0),u=i(1).Live2DCubismFramework.csmVector,l=s.Live2DCubismFramework.CubismFramework,h=a.Live2DCubismFramework.CubismJson,p=n.Live2DCubismFramework.ACubismMotion;!function(t){var e,i=function(t){function i(){var e=t.call(this)||this;return e._parameters=new u,e}return o(i,t),i.create=function(t,o){var n=new i,a=h.create(t,o),s=a.getRoot();n.setFadeInTime(s.getValueByString("FadeInTime").toFloat(1)),n.setFadeOutTime(s.getValueByString("FadeOutTime").toFloat(1));var u=s.getValueByString("Parameters").getSize();n._parameters.prepareCapacity(u);for(var p=0;p.001){if(o>=0)break;o=a,n=t.getPartOpacityByIndex(s),(n+=e/this._fadeTimeSeconds)>1&&(n=1)}}o<0&&(o=0,n=1);for(a=i;a.15&&(p=1-.15/(1-n)),h>p&&(h=p),t.setPartOpacityByIndex(l,h)}}},t}();t.CubismPose=e;var i=function(){function t(t){if(this.parameterIndex=0,this.partIndex=0,this.link=new a,null!=t){this.partId=t.partId;for(var e=t.link.begin();e.notEqual(t.link.end());e.preIncrement())this.link.pushBack(e.ptr().clone())}}return t.prototype.assignment=function(t){this.partId=t.partId;for(var e=t.link.begin();e.notEqual(t.link.end());e.preIncrement())this.link.pushBack(e.ptr().clone());return this},t.prototype.initialize=function(t){this.parameterIndex=t.getParameterIndex(this.partId),this.partIndex=t.getPartIndex(this.partId),t.setParameterValueByIndex(this.parameterIndex,1)},t.prototype.clone=function(){var e=new t;e.partId=this.partId,e.parameterIndex=this.parameterIndex,e.partIndex=this.partIndex,e.link=new a;for(var i=this.link.begin();i.notEqual(this.link.end());i.increment())e.link.pushBack(i.ptr().clone());return e},t}();t.PartData=i}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(40),o=i(8),n=i(1),a=i(0).Live2DCubismFramework.CubismFramework,s=n.Live2DCubismFramework.csmVector,u=o.Live2DCubismFramework.csmString,l=r.Live2DCubismFramework.CubismModelUserDataJson;!function(t){var e=function(){};t.CubismModelUserDataNode=e;var i=function(){function t(){this._userDataNodes=new s,this._artMeshUserDataNode=new s}return t.create=function(e,i){var r=new t;return r.parseUserData(e,i),r},t.delete=function(t){null!=t&&(t.release(),t=null)},t.prototype.getArtMeshUserDatas=function(){return this._artMeshUserDataNode},t.prototype.parseUserData=function(t,i){for(var r=new l(t,i),o=a.getIdManager().getId("ArtMesh"),n=r.getUserDataCount(),s=0;s=a.particleCount)break;-1==l[y].destinationParameterIndex&&(l[y].destinationParameterIndex=t.getParameterIndex(l[y].destination.id));var S=new _;S.x=h[v].position.x-h[v-1].position.x,S.y=h[v].position.y-h[v-1].position.y,n=l[y].getValue(S,h,v,l[y].reflect,this._options.gravity);var b=l[y].destinationParameterIndex,C=!Float32Array.prototype.slice&&"subarray"in Float32Array.prototype?JSON.parse(JSON.stringify(p.subarray(b))):p.slice(b);M(C,c[b],g[b],n,l[y]);for(var L=b,P=0;L=2?e[i-1].position.substract(e[i-2].position):o.multiplyByScaler(-1),n=s.directionToRadian(o,t),r&&(n*=-1),n}function v(t,e){return s.min(t,e)+function(t,e){var i=s.max(t,e),r=s.min(t,e);return s.abs(i-r)}(t,e)/2}function S(t,e){return JSON.parse(JSON.stringify(t.x))}function b(t,e){return JSON.parse(JSON.stringify(t.y))}function C(t,e){return JSON.parse(JSON.stringify(e))}function x(t,e,i,r,o,n,a,u){var l,h,p,g,c=new _(0,0),d=new _(0,0),m=new _(0,0),f=new _(0,0);t[0].position=new _(i.x,i.y),l=s.degreesToRadian(r),(g=s.radianToDirection(l)).normalize();for(var y=1;yi&&(n>o.valueExceededMaximum&&(o.valueExceededMaximum=n),n=i),(a=o.weight/100)>=1?t[0]=n:(n=t[0]*(1-a)+n*a,t[0]=n)}function L(t,e,i,r,o,n,a,u){var l=0,h=s.max(i,e);ht&&(t=p);var g=s.min(o,n),c=s.max(o,n),d=a,_=v(p,h),m=t-_;switch(function(t){var e=0;return t>0?e=1:t<0&&(e=-1),e}(m)){case 1:var f=c-d;0!=(y=h-_)&&(l=m*(f/y),l+=d);break;case-1:var y;f=g-d;0!=(y=p-_)&&(l=m*(f/y),l+=d);break;case 0:l=d}return u?l:-1*l}t.Options=i}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(12),o=i(1).Live2DCubismFramework.csmVector,n=r.Live2DCubismFramework.CubismVector2;!function(t){!function(t){t[t.CubismPhysicsTargetType_Parameter=0]="CubismPhysicsTargetType_Parameter"}(t.CubismPhysicsTargetType||(t.CubismPhysicsTargetType={})),function(t){t[t.CubismPhysicsSource_X=0]="CubismPhysicsSource_X",t[t.CubismPhysicsSource_Y=1]="CubismPhysicsSource_Y",t[t.CubismPhysicsSource_Angle=2]="CubismPhysicsSource_Angle"}(t.CubismPhysicsSource||(t.CubismPhysicsSource={}));var e=function(){this.gravity=new n(0,0),this.wind=new n(0,0)};t.PhysicsJsonEffectiveForces=e;var i=function(){};t.CubismPhysicsParameter=i;var r=function(){};t.CubismPhysicsNormalization=r;var a=function(){this.initialPosition=new n(0,0),this.position=new n(0,0),this.lastPosition=new n(0,0),this.lastGravity=new n(0,0),this.force=new n(0,0),this.velocity=new n(0,0)};t.CubismPhysicsParticle=a;var s=function(){this.normalizationPosition=new r,this.normalizationAngle=new r};t.CubismPhysicsSubRig=s;var u=function(){this.source=new i};t.CubismPhysicsInput=u;var l=function(){this.destination=new i,this.translationScale=new n(0,0)};t.CubismPhysicsOutput=l;var h=function(){this.settings=new o,this.inputs=new o,this.outputs=new o,this.particles=new o,this.gravity=new n(0,0),this.wind=new n(0,0)};t.CubismPhysicsRig=h}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(5),o=i(12),n=i(0).Live2DCubismFramework.CubismFramework,a=o.Live2DCubismFramework.CubismVector2,s=r.Live2DCubismFramework.CubismJson;!function(t){var e="Meta",i="PhysicsSettings",r=function(){function t(t,e){this._json=s.create(t,e)}return t.prototype.release=function(){s.delete(this._json)},t.prototype.getGravity=function(){var t=new a(0,0);return t.x=this._json.getRoot().getValueByString(e).getValueByString("EffectiveForces").getValueByString("Gravity").getValueByString("X").toFloat(),t.y=this._json.getRoot().getValueByString(e).getValueByString("EffectiveForces").getValueByString("Gravity").getValueByString("Y").toFloat(),t},t.prototype.getWind=function(){var t=new a(0,0);return t.x=this._json.getRoot().getValueByString(e).getValueByString("EffectiveForces").getValueByString("Wind").getValueByString("X").toFloat(),t.y=this._json.getRoot().getValueByString(e).getValueByString("EffectiveForces").getValueByString("Wind").getValueByString("Y").toFloat(),t},t.prototype.getSubRigCount=function(){return this._json.getRoot().getValueByString(e).getValueByString("PhysicsSettingCount").toInt()},t.prototype.getTotalInputCount=function(){return this._json.getRoot().getValueByString(e).getValueByString("TotalInputCount").toInt()},t.prototype.getTotalOutputCount=function(){return this._json.getRoot().getValueByString(e).getValueByString("TotalOutputCount").toInt()},t.prototype.getVertexCount=function(){return this._json.getRoot().getValueByString(e).getValueByString("VertexCount").toInt()},t.prototype.getNormalizationPositionMinimumValue=function(t){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Normalization").getValueByString("Position").getValueByString("Minimum").toFloat()},t.prototype.getNormalizationPositionMaximumValue=function(t){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Normalization").getValueByString("Position").getValueByString("Maximum").toFloat()},t.prototype.getNormalizationPositionDefaultValue=function(t){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Normalization").getValueByString("Position").getValueByString("Default").toFloat()},t.prototype.getNormalizationAngleMinimumValue=function(t){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Normalization").getValueByString("Angle").getValueByString("Minimum").toFloat()},t.prototype.getNormalizationAngleMaximumValue=function(t){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Normalization").getValueByString("Angle").getValueByString("Maximum").toFloat()},t.prototype.getNormalizationAngleDefaultValue=function(t){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Normalization").getValueByString("Angle").getValueByString("Default").toFloat()},t.prototype.getInputCount=function(t){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Input").getVector().getSize()},t.prototype.getInputWeight=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Input").getValueByIndex(e).getValueByString("Weight").toFloat()},t.prototype.getInputReflect=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Input").getValueByIndex(e).getValueByString("Reflect").toBoolean()},t.prototype.getInputType=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Input").getValueByIndex(e).getValueByString("Type").getRawString()},t.prototype.getInputSourceId=function(t,e){return n.getIdManager().getId(this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Input").getValueByIndex(e).getValueByString("Source").getValueByString("Id").getRawString())},t.prototype.getOutputCount=function(t){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Output").getVector().getSize()},t.prototype.getOutputVertexIndex=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Output").getValueByIndex(e).getValueByString("VertexIndex").toInt()},t.prototype.getOutputAngleScale=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Output").getValueByIndex(e).getValueByString("Scale").toFloat()},t.prototype.getOutputWeight=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Output").getValueByIndex(e).getValueByString("Weight").toFloat()},t.prototype.getOutputDestinationId=function(t,e){return n.getIdManager().getId(this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Output").getValueByIndex(e).getValueByString("Destination").getValueByString("Id").getRawString())},t.prototype.getOutputType=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Output").getValueByIndex(e).getValueByString("Type").getRawString()},t.prototype.getOutputReflect=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Output").getValueByIndex(e).getValueByString("Reflect").toBoolean()},t.prototype.getParticleCount=function(t){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Vertices").getVector().getSize()},t.prototype.getParticleMobility=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Vertices").getValueByIndex(e).getValueByString("Mobility").toFloat()},t.prototype.getParticleDelay=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Vertices").getValueByIndex(e).getValueByString("Delay").toFloat()},t.prototype.getParticleAcceleration=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Vertices").getValueByIndex(e).getValueByString("Acceleration").toFloat()},t.prototype.getParticleRadius=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Vertices").getValueByIndex(e).getValueByString("Radius").toInt()},t.prototype.getParticlePosition=function(t,e){var r=new a(0,0);return r.x=this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Vertices").getValueByIndex(e).getValueByString("Position").getValueByString("X").toFloat(),r.y=this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Vertices").getValueByIndex(e).getValueByString("Position").getValueByString("Y").toFloat(),r},t}();t.CubismPhysicsJson=r}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=i(45),s=i(14),u=i(6),l=i(9),h=i(1),p=i(3),g=n.Live2DCubismFramework.Constant,c=u.Live2DCubismFramework.CubismMatrix44,d=a.Live2DCubismFramework.csmRect,_=l.Live2DCubismFramework.csmMap,m=h.Live2DCubismFramework.csmVector,f=s.Live2DCubismFramework.CubismRenderer,y=s.Live2DCubismFramework.CubismBlendMode,v=s.Live2DCubismFramework.CubismTextureColor;!function(t){var e,i,r,n=function(){function t(){this._maskRenderTexture=null,this._colorBuffer=null,this._currentFrameNo=0,this._clippingMaskBufferSize=256,this._clippingContextListForMask=new m,this._clippingContextListForDraw=new m,this._channelColors=new m,this._tmpBoundsOnModel=new d,this._tmpMatrix=new c,this._tmpMatrixForMask=new c,this._tmpMatrixForDraw=new c,this._maskTexture=null;var t=new v;t.R=1,t.G=0,t.B=0,t.A=0,this._channelColors.pushBack(t),(t=new v).R=0,t.G=1,t.B=0,t.A=0,this._channelColors.pushBack(t),(t=new v).R=0,t.G=0,t.B=1,t.A=0,this._channelColors.pushBack(t),(t=new v).R=0,t.G=0,t.B=0,t.A=1,this._channelColors.pushBack(t)}return t.prototype.getChannelFlagAsColor=function(t){return this._channelColors.at(t)},t.prototype.getMaskRenderTexture=function(){var t=0;if(this._maskTexture&&0!=this._maskTexture.texture&&(this._maskTexture.frameNo=this._currentFrameNo,t=this._maskTexture.texture),0==t){var e=this._clippingMaskBufferSize;this._colorBuffer=this.gl.createTexture(),this.gl.bindTexture(this.gl.TEXTURE_2D,this._colorBuffer),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,e,e,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,null),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.bindTexture(this.gl.TEXTURE_2D,null),t=this.gl.createFramebuffer(),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,t),this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,this.gl.TEXTURE_2D,this._colorBuffer,0),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,r),this._maskTexture=new a(this._currentFrameNo,t)}return t},t.prototype.setGL=function(t){this.gl=t},t.prototype.calcClippedDrawTotalBounds=function(t,e){for(var i=Number.MAX_VALUE,r=Number.MAX_VALUE,o=Number.MIN_VALUE,n=Number.MIN_VALUE,a=e._clippedDrawableIndexList.length,s=0;sd&&(d=y),v_&&(_=v)}if(p!=Number.MAX_VALUE)if(po&&(o=d),_>n&&(n=_),i==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;var S=o-i,b=n-r;e._allClippedDrawRect.x=i,e._allClippedDrawRect.y=r,e._allClippedDrawRect.width=S,e._allClippedDrawRect.height=b}}},t.prototype.release=function(){for(var t=0;t0){this.gl.viewport(0,0,this._clippingMaskBufferSize,this._clippingMaskBufferSize),this._maskRenderTexture=this.getMaskRenderTexture();e.getMvpMatrix();e.preDraw(),this.setupLayoutBounds(o),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this._maskRenderTexture),this.gl.clearColor(1,1,1,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT);for(n=0;n-1};function h(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function p(t){return"string"!=typeof t&&(t=String(t)),t}function g(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return o&&(e[Symbol.iterator]=function(){return e}),e}function c(t){this.map={},t instanceof c?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function d(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function _(t){return new Promise((function(e,i){t.onload=function(){e(t.result)},t.onerror=function(){i(t.error)}}))}function m(t){var e=new FileReader,i=_(e);return e.readAsArrayBuffer(t),i}function f(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:n&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:a&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():s&&n&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=f(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(t)||l(t))?this._bodyArrayBuffer=f(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n&&(this.blob=function(){var t=d(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var t,e,i,r=d(this);if(r)return r;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,i=_(e),e.readAsText(t),i;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),i=new Array(e.length),r=0;r-1?r:i),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function b(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var i=t.split("="),r=i.shift().replace(/\+/g," "),o=i.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(o))}})),e}function C(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new c(e.headers),this.url=e.url||"",this._initBody(t)}S.prototype.clone=function(){return new S(this,{body:this._bodyInit})},y.call(S.prototype),y.call(C.prototype),C.prototype.clone=function(){return new C(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},C.error=function(){var t=new C(null,{status:0,statusText:""});return t.type="error",t};var x=[301,302,303,307,308];C.redirect=function(t,e){if(-1===x.indexOf(e))throw new RangeError("Invalid status code");return new C(null,{status:e,headers:{location:t}})};var M=self.DOMException;try{new M}catch(t){(M=function(t,e){this.message=t,this.name=e;var i=Error(t);this.stack=i.stack}).prototype=Object.create(Error.prototype),M.prototype.constructor=M}function L(t,e){return new Promise((function(i,r){var o=new S(t,e);if(o.signal&&o.signal.aborted)return r(new M("Aborted","AbortError"));var a=new XMLHttpRequest;function s(){a.abort()}a.onload=function(){var t,e,r={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new c,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var i=t.split(":"),r=i.shift().trim();if(r){var o=i.join(":").trim();e.append(r,o)}})),e)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var o="response"in a?a.response:a.responseText;i(new C(o,r))},a.onerror=function(){r(new TypeError("Network request failed"))},a.ontimeout=function(){r(new TypeError("Network request failed"))},a.onabort=function(){r(new M("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&n&&(a.responseType="blob"),o.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),o.signal&&(o.signal.addEventListener("abort",s),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",s)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}L.polyfill=!0,self.fetch||(self.fetch=L,self.Headers=c,self.Request=S,self.Response=C)},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(1).Live2DCubismFramework.csmVector,o=i(4),n=function(){function t(){this._textures=new r}return t.prototype.release=function(){for(var t=this._textures.begin();t.notEqual(this._textures.end());t.preIncrement())o.gl.deleteTexture(t.ptr().id);this._textures=null},t.prototype.createTextureFromPngFile=function(t,e,i){for(var r=this,n=function(r){if(r.ptr().fileName==t&&r.ptr().usePremultply==e)return r.ptr().img=new Image,r.ptr().img.onload=function(){return i(r.ptr())},r.ptr().img.src=t,{value:void 0}},s=this._textures.begin();s.notEqual(this._textures.end());s.preIncrement()){var u=n(s);if("object"==typeof u)return u.value}var l=new Image;l.onload=function(){var n=o.gl.createTexture();o.gl.bindTexture(o.gl.TEXTURE_2D,n),o.gl.texParameteri(o.gl.TEXTURE_2D,o.gl.TEXTURE_MIN_FILTER,o.gl.LINEAR_MIPMAP_LINEAR),o.gl.texParameteri(o.gl.TEXTURE_2D,o.gl.TEXTURE_MAG_FILTER,o.gl.LINEAR),e&&o.gl.pixelStorei(o.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1),o.gl.texImage2D(o.gl.TEXTURE_2D,0,o.gl.RGBA,o.gl.RGBA,o.gl.UNSIGNED_BYTE,l),o.gl.generateMipmap(o.gl.TEXTURE_2D),o.gl.bindTexture(o.gl.TEXTURE_2D,null);var s=new a;null!=s&&(s.fileName=t,s.width=l.width,s.height=l.height,s.id=n,s.img=l,s.usePremultply=e,r._textures.pushBack(s)),i(s)},l.src=t},t.prototype.releaseTextures=function(){for(var t=0;t>24,n=(16711680&i)>>16,s=65535&i,u=i;a.CubismLogInfo("Live2D Cubism Core version: {0}.{1}.{2} ({3})",("00"+o).slice(-2),("00"+n).slice(-2),("0000"+s).slice(-4),u)}return a.CubismLogInfo("CubismFramework.startUp() is complete."),e},t.cleanUp=function(){e=!1,i=!1,r=null,o=null},t.initialize=function(){a.CSM_ASSERT(e),e?i?a.CubismLogWarning("CubismFramework.initialize() skipped, already initialized."):(s.staticInitializeNotForClientCall(),o=new u,i=!0,a.CubismLogInfo("CubismFramework.initialize() is complete.")):a.CubismLogWarning("CubismFramework is not started.")},t.dispose=function(){a.CSM_ASSERT(e),e?i?(s.staticReleaseNotForClientCall(),o.release(),o=null,l.staticRelease(),i=!1,a.CubismLogInfo("CubismFramework.dispose() is complete.")):a.CubismLogWarning("CubismFramework.dispose() skipped, not initialized."):a.CubismLogWarning("CubismFramework is not started.")},t.isStarted=function(){return e},t.isInitialized=function(){return i},t.coreLogFunction=function(t){Live2DCubismCore.Logging.csmGetLogFunction()&&Live2DCubismCore.Logging.csmGetLogFunction()(t)},t.getLoggingLevel=function(){return null!=r?r.loggingLevel:h.LogLevel_Off},t.getIdManager=function(){return o},t}();t.CubismFramework=n}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}));var h,p=function(){};e.Option=p,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"}(h=e.LogLevel||(e.LogLevel={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){var e=function(){function t(t){void 0===t&&(t=0),t<1?(this._ptr=[],this._capacity=0,this._size=0):(this._ptr=new Array(t),this._capacity=t,this._size=0)}return t.prototype.at=function(t){return this._ptr[t]},t.prototype.set=function(t,e){this._ptr[t]=e},t.prototype.get=function(t){void 0===t&&(t=0);for(var e=new Array,i=t;i=this._capacity&&this.prepareCapacity(0==this._capacity?t.s_defaultSize:2*this._capacity),this._ptr[this._size++]=e},t.prototype.clear=function(){this._ptr.length=0,this._size=0},t.prototype.getSize=function(){return this._size},t.prototype.assign=function(t,e){this._size0)for(var u=0;uthis._capacity&&(0==this._capacity?(this._ptr=new Array(t),this._capacity=t):(this._ptr.length=t,this._capacity=t))},t.prototype.begin=function(){return 0==this._size?this.end():new i(this,0)},t.prototype.end=function(){return new i(this,this._size)},t.prototype.getOffset=function(e){var i=new t;return i._ptr=this.get(e),i._size=this.get(e).length,i._capacity=this.get(e).length,i},t.s_defaultSize=10,t}();t.csmVector=e;var i=function(){function t(t,e){this._vector=null!=t?t:null,this._index=null!=e?e:0}return t.prototype.set=function(t){return this._index=t._index,this._vector=t._vector,this},t.prototype.preIncrement=function(){return++this._index,this},t.prototype.preDecrement=function(){return--this._index,this},t.prototype.increment=function(){var e=new t(this._vector,this._index++);return this._vector=e._vector,this._index=e._index,this},t.prototype.decrement=function(){var e=new t(this._vector,this._index--);return this._vector=e._vector,this._index=e._index,this},t.prototype.ptr=function(){return this._vector._ptr[this._index]},t.prototype.substitution=function(t){return this._index=t._index,this._vector=t._vector,this},t.prototype.notEqual=function(t){return this._index!=t._index||this._vector!=t._vector},t}();t.iterator=i}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(0);e.ViewMaxScale=2,e.ViewMinScale=.8,e.ViewLogicalLeft=-1,e.ViewLogicalRight=1,e.ViewLogicalMaxLeft=-2,e.ViewLogicalMaxRight=2,e.ViewLogicalMaxBottom=-2,e.ViewLogicalMaxTop=2,e.ResourcesPath="./Resources/",e.BackImageName="back_class_normal.png",e.GearImageName="icon_gear.png",e.PowerImageName="CloseNormal.png",e.ModelDir=["Hiyori","Haru","Rice"],e.ModelDirSize=e.ModelDir.length,e.MotionGroupIdle="Idle",e.MotionGroupTapBody="TapBody",e.HitAreaNameHead="Head",e.HitAreaNameBody="Body",e.HitBodyList=["啊呀,你的手在摸哪里嘛~","哼,坏人"],e.HitHeadList=["讨厌~不要掐人家的脸嘛~","希望明天也能感受到你的触摸呢"],e.PriorityNone=0,e.PriorityIdle=1,e.PriorityNormal=2,e.PriorityForce=3,e.DebugLogEnable=!0,e.DebugTouchLogEnable=!1,e.CubismLoggingLevel=r.LogLevel.LogLevel_Verbose,e.RenderTargetWidth=1900,e.RenderTargetHeight=1e3;var o=function(){function t(){}return t.setModelDir=function(t){e.ModelDir=t.length>0?t:e.ModelDir},t.setHitBody=function(t){e.HitBodyList=t.length>0?t:e.HitBodyList},t.setHitHead=function(t){e.HitHeadList=t.length>0?t:e.HitHeadList},t.setPathFull=function(t){e.ResourcesPath=t.length>0?t:e.ResourcesPath},t}();e.lappdefineSet=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=i(0),n=i(20);e.CubismLogPrint=function(t,e,i){r.CubismDebug.print(t,"[CSM]"+e,i)},e.CubismLogPrintIn=function(t,i,r){e.CubismLogPrint(t,i+"\n",r)},e.CSM_ASSERT=function(t){console.assert(t)},n.CSM_LOG_LEVEL<=n.CSM_LOG_LEVEL_VERBOSE?(e.CubismLogVerbose=function(t){for(var i=[],r=1;r0?this.print(t,"\n"):r%8==0&&r>0&&this.print(t," "),this.print(t,"{0} ",[255&e[r]]);this.print(t,"\n")},t}();t.CubismDebug=e}(r=e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=i(0),n=o.Live2DCubismFramework.CubismFramework,a=i(23),s=i(13),u=i(50),l=i(15),h=r(i(2));e.canvas=null,e.s_instance=null,e.gl=null,e.frameBuffer=null;var p=function(){function t(){this._captured=!1,this._mouseX=0,this._mouseY=0,this._isEnd=!1,this._cubismOption=new o.Option,this._view=new a.LAppView,this._textureManager=new u.LAppTextureManager}return t.getInstance=function(){return null==e.s_instance&&(e.s_instance=new t),e.s_instance},t.releaseInstance=function(){console.log("releaseInstance"),null!=e.s_instance&&e.s_instance.release(),e.s_instance=null},t.prototype.initialize=function(){return e.canvas=document.getElementById("live2d"),document.addEventListener("mousemove",(function(e){if(t.getInstance()._view){var i=document.getElementById("live2d").getBoundingClientRect(),r=e.clientX-i.left,o=e.clientY-i.top;t.getInstance()._view.onTouchesMoved(r,o)}else s.LAppPal.printMessage("view notfound")}),!1),document.addEventListener("mouseout",(function(t){l.LAppLive2DManager.getInstance().onDrag(0,0)}),!1),e.canvas.addEventListener("click",(function(i){if(console.log(i),t.getInstance()._view){var r=e.canvas.getBoundingClientRect(),o=i.clientX-r.left,n=i.clientY-r.top;t.getInstance()._view.onTouchesBegan(o,n),t.getInstance()._view.onTouchesEnded(o,n)}else s.LAppPal.printMessage("view notfound")}),!1),e.gl=e.canvas.getContext("webgl")||e.canvas.getContext("experimental-webgl"),e.gl?(e.frameBuffer||(e.frameBuffer=e.gl.getParameter(e.gl.FRAMEBUFFER_BINDING)),e.gl.enable(e.gl.BLEND),e.gl.blendFunc(e.gl.SRC_ALPHA,e.gl.ONE_MINUS_SRC_ALPHA),"ontouchend"in e.canvas&&(e.canvas.ontouchstart=g,e.canvas.ontouchmove=c,e.canvas.ontouchend=d,e.canvas.ontouchcancel=_),this._view.initialize(),this.initializeCubism(),!0):(alert("Cannot initialize WebGL. This browser does not support."),e.gl=null,document.body.innerHTML="This browser does not support the <canvas> element.",!1)},t.prototype.release=function(){this._textureManager.release(),this._textureManager=null,this._view.release(),this._view=null,l.LAppLive2DManager.releaseInstance(),n.dispose()},t.prototype.run=function(){var t=this;console.log("run");var i=function(){null!=e.s_instance&&(s.LAppPal.updateTime(),e.gl.clearColor(0,0,0,0),e.gl.enable(e.gl.DEPTH_TEST),e.gl.depthFunc(e.gl.LEQUAL),e.gl.clear(e.gl.COLOR_BUFFER_BIT|e.gl.DEPTH_BUFFER_BIT),e.gl.clearDepth(1),e.gl.enable(e.gl.BLEND),e.gl.blendFunc(e.gl.SRC_ALPHA,e.gl.ONE_MINUS_SRC_ALPHA),t._view.render(),requestAnimationFrame(i))};i()},t.prototype.createShader=function(){var t=e.gl.createShader(e.gl.VERTEX_SHADER);if(null==t)return s.LAppPal.printMessage("failed to create vertexShader"),null;e.gl.shaderSource(t,"precision mediump float;attribute vec3 position;attribute vec2 uv;varying vec2 vuv;void main(void){ gl_Position = vec4(position, 1.0); vuv = uv;}"),e.gl.compileShader(t);var i=e.gl.createShader(e.gl.FRAGMENT_SHADER);if(null==i)return s.LAppPal.printMessage("failed to create fragmentShader"),null;e.gl.shaderSource(i,"precision mediump float;varying vec2 vuv;uniform sampler2D texture;void main(void){ gl_FragColor = texture2D(texture, vuv);}"),e.gl.compileShader(i);var r=e.gl.createProgram();return e.gl.attachShader(r,t),e.gl.attachShader(r,i),e.gl.deleteShader(t),e.gl.deleteShader(i),e.gl.linkProgram(r),e.gl.useProgram(r),r},t.prototype.getView=function(){return this._view},t.prototype.getTextureManager=function(){return this._textureManager},t.prototype.initializeCubism=function(){this._cubismOption.logFunction=s.LAppPal.printMessage,this._cubismOption.loggingLevel=h.CubismLoggingLevel,n.startUp(this._cubismOption),n.initialize(),l.LAppLive2DManager.getInstance(),s.LAppPal.updateTime(),this._view.initializeSprite()},t}();function g(t){if(p.getInstance()._view){p.getInstance()._captured=!0;var e=t.changedTouches[0].pageX,i=t.changedTouches[0].pageY;p.getInstance()._view.onTouchesBegan(e,i)}else s.LAppPal.printMessage("view notfound")}function c(t){if(p.getInstance()._captured)if(p.getInstance()._view){var e=t.target.getBoundingClientRect(),i=t.changedTouches[0].clientX-e.left,r=t.changedTouches[0].clientY-e.top;p.getInstance()._view.onTouchesMoved(i,r)}else s.LAppPal.printMessage("view notfound")}function d(t){if(p.getInstance()._captured=!1,p.getInstance()._view){var e=t.target.getBoundingClientRect(),i=t.changedTouches[0].clientX-e.left,r=t.changedTouches[0].clientY-e.top;p.getInstance()._view.onTouchesEnded(i,r)}else s.LAppPal.printMessage("view notfound")}function _(t){if(p.getInstance()._captured=!1,p.getInstance()._view){var e=t.target.getBoundingClientRect(),i=t.changedTouches[0].clientX-e.left,r=t.changedTouches[0].clientY-e.top;p.getInstance()._view.onTouchesEnded(i,r)}else s.LAppPal.printMessage("view notfound")}e.LAppDelegate=p},function(t,e,i){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var n=i(8),a=i(9),s=i(1),u=i(3),l=i(0),h=s.Live2DCubismFramework.csmVector,p=a.Live2DCubismFramework.csmMap,g=n.Live2DCubismFramework.csmString;!function(t){var e=function(){function t(){}return t.prototype.getRawString=function(t,e){return this.getString(t,e)},t.prototype.toInt=function(t){return void 0===t&&(t=0),t},t.prototype.toFloat=function(t){return void 0===t&&(t=0),t},t.prototype.toBoolean=function(t){return void 0===t&&(t=!1),t},t.prototype.getSize=function(){return 0},t.prototype.getArray=function(t){return void 0===t&&(t=null),t},t.prototype.getVector=function(t){return t},t.prototype.getMap=function(t){return t},t.prototype.getValueByIndex=function(e){return t.errorValue.setErrorNotForClientCall("Error: type mismatch")},t.prototype.getValueByString=function(e){return t.nullValue.setErrorNotForClientCall("Error: type mismatch")},t.prototype.getKeys=function(){return t.s_dummyKeys},t.prototype.isError=function(){return!1},t.prototype.isNull=function(){return!1},t.prototype.isBool=function(){return!1},t.prototype.isFloat=function(){return!1},t.prototype.isString=function(){return!1},t.prototype.isArray=function(){return!1},t.prototype.isMap=function(){return!1},t.prototype.equals=function(t){return!1},t.prototype.isStatic=function(){return!1},t.prototype.setErrorNotForClientCall=function(t){return s.errorValue},t.staticInitializeNotForClientCall=function(){n.trueValue=new n(!0),n.falseValue=new n(!1),s.errorValue=new s("ERROR",!0),this.nullValue=new c,t.s_dummyKeys=new h},t.staticReleaseNotForClientCall=function(){n.trueValue=null,n.falseValue=null,s.errorValue=null,t.nullValue=null,t.s_dummyKeys=null,n.trueValue=null,n.falseValue=null,s.errorValue=null,t.nullValue=null,t.s_dummyKeys=null},t}();t.Value=e;var i=function(){function t(t,e){this._error=null,this._lineCount=0,this._root=null,null!=t&&this.parseBytes(t,e)}return t.create=function(e,i){var r=new t;return r.parseBytes(e,i)?r:(t.delete(r),null)},t.delete=function(t){null},t.prototype.getRoot=function(){return this._root},t.prototype.arrayBufferToString=function(t){for(var e=new Uint8Array(t),i="",r=0,o=e.length;ra&&n.append(t.slice(a),o-a),a=o+1,ot.s},t.prototype.isEqual=function(t){return this.s==t},t.prototype.isEmpty=function(){return 0==this.s.length},t}();t.csmString=e}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(3);!function(t){var e=function(t,e){this.first=null==t?null:t,this.second=null==e?null:e};t.csmPair=e;var i=function(){function t(t){null!=t?t<1?(this._keyValues=[],this._dummyValue=null,this._size=0):(this._keyValues=new Array(t),this._size=t):(this._keyValues=[],this._dummyValue=null,this._size=0)}return t.prototype.release=function(){this.clear()},t.prototype.appendKey=function(t){this.prepareCapacity(this._size+1,!1),this._keyValues[this._size]=new e(t),this._size+=1},t.prototype.getValue=function(t){for(var e=-1,i=0;i=0?this._keyValues[e].second:(this.appendKey(t),this._keyValues[this._size-1].second)},t.prototype.setValue=function(t,e){for(var i=-1,r=0;r=0?this._keyValues[i].second=e:(this.appendKey(t),this._keyValues[this._size-1].second=e)},t.prototype.isExist=function(t){for(var e=0;ethis._keyValues.length&&(0==this._keyValues.length?(!i&&e0&&e.getEndTime()i&&(t=i),t},t.sin=function(t){return Math.sin(t)},t.cos=function(t){return Math.cos(t)},t.abs=function(t){return Math.abs(t)},t.sqrt=function(t){return Math.sqrt(t)},t.getEasingSine=function(t){return t<0?0:t>1?1:.5-.5*this.cos(t*Math.PI)},t.max=function(t,e){return t>e?t:e},t.min=function(t,e){return t>e?e:t},t.degreesToRadian=function(t){return t/180*Math.PI},t.radianToDegrees=function(t){return 180*t/Math.PI},t.directionToRadian=function(t,e){for(var i=Math.atan2(e.y,e.x)-Math.atan2(t.y,t.x);i<-Math.PI;)i+=2*Math.PI;for(;i>Math.PI;)i-=2*Math.PI;return i},t.directionToDegrees=function(t,e){var i=this.directionToRadian(t,e),r=this.radianToDegrees(i);return e.x-t.x>0&&(r=-r),r},t.radianToDirection=function(t){var e=new r;return e.x=this.sin(t),e.y=this.cos(t),e},t}();t.CubismMath=e}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){var e=function(){function t(t,e){this.x=t,this.y=e,this.x=null==t?0:t,this.y=null==e?0:e}return t.prototype.add=function(e){var i=new t(0,0);return i.x=this.x+e.x,i.y=this.y+e.y,i},t.prototype.substract=function(e){var i=new t(0,0);return i.x=this.x-e.x,i.y=this.y-e.y,i},t.prototype.multiply=function(e){var i=new t(0,0);return i.x=this.x*e.x,i.y=this.y*e.y,i},t.prototype.multiplyByScaler=function(e){return this.multiply(new t(e,e))},t.prototype.division=function(e){var i=new t(0,0);return i.x=this.x/e.x,i.y=this.y/e.y,i},t.prototype.divisionByScalar=function(e){return this.division(new t(e,e))},t.prototype.getLength=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.getDistanceWith=function(t){return Math.sqrt((this.x-t.x)*(this.x-t.x)+(this.y-t.y)*(this.y-t.y))},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y},t.prototype.normalize=function(){var t=Math.pow(this.x*this.x+this.y*this.y,.5);this.x=this.x/t,this.y=this.y/t},t.prototype.isEqual=function(t){return this.x==t.x&&this.y==t.y},t.prototype.isNotEqual=function(t){return!this.isEqual(t)},t}();t.CubismVector2=e}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){}return t.loadFileAsBytes=function(t,e){fetch(t).then((function(t){return t.arrayBuffer()})).then((function(t){return e(t,t.byteLength)}))},t.getDeltaTime=function(){return this.s_deltaTime},t.updateTime=function(){this.s_currentFrame=Date.now(),this.s_deltaTime=(this.s_currentFrame-this.s_lastFrame)/1e3,this.s_lastFrame=this.s_currentFrame},t.printMessage=function(t){console.log(t)},t.lastUpdate=Date.now(),t.s_currentFrame=0,t.s_lastFrame=0,t.s_deltaTime=0,t}();e.LAppPal=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(6).Live2DCubismFramework.CubismMatrix44;!function(t){var e=function(){function t(){this._isCulling=!1,this._isPremultipliedAlpha=!1,this._anisortopy=0,this._model=null,this._modelColor=new i,this._mvpMatrix4x4=new r,this._mvpMatrix4x4.loadIdentity()}return t.create=function(){return null},t.delete=function(t){null},t.prototype.initialize=function(t){this._model=t},t.prototype.drawModel=function(){null!=this.getModel()&&this.doDrawModel()},t.prototype.setMvpMatrix=function(t){this._mvpMatrix4x4.setMatrix(t.getArray())},t.prototype.getMvpMatrix=function(){return this._mvpMatrix4x4},t.prototype.setModelColor=function(t,e,i,r){t<0?t=0:t>1&&(t=1),e<0?e=0:e>1&&(e=1),i<0?i=0:i>1&&(i=1),r<0?r=0:r>1&&(r=1),this._modelColor.R=t,this._modelColor.G=e,this._modelColor.B=i,this._modelColor.A=r},t.prototype.getModelColor=function(){return JSON.parse(JSON.stringify(this._modelColor))},t.prototype.setIsPremultipliedAlpha=function(t){this._isPremultipliedAlpha=t},t.prototype.isPremultipliedAlpha=function(){return this._isPremultipliedAlpha},t.prototype.setIsCulling=function(t){this._isCulling=t},t.prototype.isCulling=function(){return this._isCulling},t.prototype.setAnisotropy=function(t){this._anisortopy=t},t.prototype.getAnisotropy=function(){return this._anisortopy},t.prototype.getModel=function(){return this._model},t}();t.CubismRenderer=e,function(t){t[t.CubismBlendMode_Normal=0]="CubismBlendMode_Normal",t[t.CubismBlendMode_Additive=1]="CubismBlendMode_Additive",t[t.CubismBlendMode_Multiplicative=2]="CubismBlendMode_Multiplicative"}(t.CubismBlendMode||(t.CubismBlendMode={}));var i=function(){this.R=1,this.G=1,this.B=1,this.A=1};t.CubismTextureColor=i}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=i(6),n=i(1).Live2DCubismFramework.csmVector,a=o.Live2DCubismFramework.CubismMatrix44,s=i(26),u=i(13),l=i(4),h=r(i(2));e.s_instance=null;var p=null,g=function(){function t(){this._finishedMotion=function(t){u.LAppPal.printMessage("Motion Finished:")},this._viewMatrix=new a,this._models=new n,this._sceneIndex=0,this.changeScene(this._sceneIndex)}return t.getInstance=function(){return null==e.s_instance&&(e.s_instance=new t),e.s_instance},t.releaseInstance=function(){null!=e.s_instance&&(e.s_instance=void 0),e.s_instance=null},t.prototype.getModel=function(t){return t=1&&(n=1,this._blinkingState=e.EyeState_Closed,this._stateStartTimeSeconds=this._userTimeSeconds),o=1-n;break;case e.EyeState_Closed:(n=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._closedSeconds)>=1&&(this._blinkingState=e.EyeState_Opening,this._stateStartTimeSeconds=this._userTimeSeconds),o=0;break;case e.EyeState_Opening:(n=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._openingSeconds)>=1&&(n=1,this._blinkingState=e.EyeState_Interval,this._nextBlinkingTime=this.determinNextBlinkingTiming()),o=n;break;case e.EyeState_Interval:this._nextBlinkingTime300?t.width/2:"150px",left:t.width>300?(t.width-t.width/2)/2+"px":(t.width-150)/2+"px",top:"0",minHeight:"20px",display:"block",borderRadius:"5px",border:"1px dashed #ccc",padding:"5px",background:t.color?t.color:"#C8E6FE"},s="none",(i="display")in e?Object.defineProperty(e,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[i]=s,e);return Object(n.useEffect)((function(){console.log("props",t),t.ModelList?o.lappdefineSet.setModelDir(t.ModelList):o.lappdefineSet.setModelDir([]),t.TouchBody?o.lappdefineSet.setHitBody(t.TouchBody):o.lappdefineSet.setHitBody([]),t.TouchHead?o.lappdefineSet.setHitHead(t.TouchHead):o.lappdefineSet.setHitHead([]),t.PathFull?o.lappdefineSet.setPathFull(t.PathFull):o.lappdefineSet.setPathFull(""),0!=r.LAppDelegate.getInstance().initialize()&&(r.LAppDelegate.getInstance().run(),window.onbeforeunload=function(){return r.LAppDelegate.releaseInstance()})}),[]),a.a.createElement("div",null,a.a.createElement("div",{style:u,width:t.width?t.width:"300",height:t.height?t.height:"500",id:"live2d-container"},a.a.createElement("div",{id:"live2d-print",style:h}),a.a.createElement("canvas",{id:"live2d",style:l,width:t.width?t.width:"300",height:t.height?t.height:"500",className:"live2d"})))}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CSM_LOG_LEVEL_VERBOSE=0,e.CSM_LOG_LEVEL_DEBUG=1,e.CSM_LOG_LEVEL_INFO=2,e.CSM_LOG_LEVEL_WARNING=3,e.CSM_LOG_LEVEL_ERROR=4,e.CSM_LOG_LEVEL_OFF=5,e.CSM_LOG_LEVEL=e.CSM_LOG_LEVEL_VERBOSE},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(1),o=i(22).Live2DCubismFramework.CubismId,n=r.Live2DCubismFramework.csmVector;!function(t){var e=function(){function t(){this._ids=new n}return t.prototype.release=function(){for(var t=0;tthis._screenLeft&&(t=this._screenLeft-this._tr[0]*this._maxLeft-this._tr[12]),this._tr[0]*this._maxRight+(this._tr[12]+t)this._screenBottom&&(e=this._screenBottom-this._tr[5]*this._maxBottom-this._tr[13]);var i=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,t,e,0,1]);n.multiply(i,this._tr,this._tr)},e.prototype.adjustScale=function(t,e,i){var r=this.getMaxScale(),o=this.getMinScale(),a=i*this._tr[0];a0&&(i=o/this._tr[0]):a>r&&this._tr[0]>0&&(i=r/this._tr[0]);var s=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,t,e,0,1]),u=new Float32Array([i,0,0,0,0,i,0,0,0,0,1,0,0,0,0,1]),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,-t,-e,0,1]);n.multiply(l,this._tr,this._tr),n.multiply(u,this._tr,this._tr),n.multiply(s,this._tr,this._tr)},e.prototype.setScreenRect=function(t,e,i,r){this._screenLeft=t,this._screenRight=e,this._screenBottom=i,this._screenTop=r},e.prototype.setMaxScreenRect=function(t,e,i,r){this._maxLeft=t,this._maxRight=e,this._maxTop=r,this._maxBottom=i},e.prototype.setMaxScale=function(t){this._maxScale=t},e.prototype.setMinScale=function(t){this._minScale=t},e.prototype.getMaxScale=function(){return this._maxScale},e.prototype.getMinScale=function(){return this._minScale},e.prototype.isMaxScale=function(){return this.getScaleX()>=this._maxScale},e.prototype.isMinScale=function(){return this.getScaleX()<=this._minScale},e.prototype.getScreenLeft=function(){return this._screenLeft},e.prototype.getScreenRight=function(){return this._screenRight},e.prototype.getScreenBottom=function(){return this._screenBottom},e.prototype.getScreenTop=function(){return this._screenTop},e.prototype.getMaxLeft=function(){return this._maxLeft},e.prototype.getMaxRight=function(){return this._maxRight},e.prototype.getMaxBottom=function(){return this._maxBottom},e.prototype.getMaxTop=function(){return this._maxTop},e}(n);t.CubismViewMatrix=e}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){this._startX=0,this._startY=0,this._lastX=0,this._lastY=0,this._lastX1=0,this._lastY1=0,this._lastX2=0,this._lastY2=0,this._lastTouchDistance=0,this._deltaX=0,this._deltaY=0,this._scale=1,this._touchSingle=!1,this._flipAvailable=!1}return t.prototype.getCenterX=function(){return this._lastX},t.prototype.getCenterY=function(){return this._lastY},t.prototype.getDeltaX=function(){return this._deltaX},t.prototype.getDeltaY=function(){return this._deltaY},t.prototype.getStartX=function(){return this._startX},t.prototype.getStartY=function(){return this._startY},t.prototype.getScale=function(){return this._scale},t.prototype.getX=function(){return this._lastX},t.prototype.getY=function(){return this._lastY},t.prototype.getX1=function(){return this._lastX1},t.prototype.getY1=function(){return this._lastY1},t.prototype.getX2=function(){return this._lastX2},t.prototype.getY2=function(){return this._lastY2},t.prototype.isSingleTouch=function(){return this._touchSingle},t.prototype.isFlickAvailable=function(){return this._flipAvailable},t.prototype.disableFlick=function(){this._flipAvailable=!1},t.prototype.touchesBegan=function(t,e){this._lastX=t,this._lastY=e,this._startX=t,this._startY=e,this._lastTouchDistance=-1,this._flipAvailable=!0,this._touchSingle=!0},t.prototype.touchesMoved=function(t,e){this._lastX=t,this._lastY=e,this._lastTouchDistance=-1,this._touchSingle=!0},t.prototype.getFlickDistance=function(){return this.calculateDistance(this._startX,this._startY,this._lastX,this._lastY)},t.prototype.calculateDistance=function(t,e,i,r){return Math.sqrt((t-i)*(t-i)+(e-r)*(e-r))},t.prototype.calculateMovingAmount=function(t,e){if(t>0!=e>0)return 0;var i=t>0?1:-1,r=Math.abs(t),o=Math.abs(e);return i*(r0){for(var t=e._modelSetting.getExpressionCount(),i=function(i){var r=e._modelSetting.getExpressionName(i),n=e._modelSetting.getExpressionFileName(i);fetch(e._modelHomeDir+"/"+n).then((function(t){return t.arrayBuffer()})).then((function(i){var n=e.loadExpression(i,i.byteLength,r);null!=e._expressions.getValue(r)&&(M.delete(e._expressions.getValue(r)),e._expressions.setValue(r,null)),e._expressions.setValue(r,n),e._expressionCount++,e._expressionCount>=t&&(e._state=a.LoadPhysics,o())}))},r=0;r0&&(e._eyeBlink=x.create(e._modelSetting),e._state=a.SetupBreath),u()},u=function(){e._breath=b.create();var t=new S;t.pushBack(new C(e._idParamAngleX,0,15,6.5345,.5)),t.pushBack(new C(e._idParamAngleY,0,8,3.5345,.5)),t.pushBack(new C(e._idParamAngleZ,0,10,5.5345,.5)),t.pushBack(new C(e._idParamBodyAngleX,0,4,15.5345,.5)),t.pushBack(new C(L.getIdManager().getId(w.ParamBreath),0,.5,3.2345,.5)),e._breath.setParameters(t),e._state=a.LoadUserData,l()},l=function(){if(""!=e._modelSetting.getUserDataFile()){var t=e._modelSetting.getUserDataFile();fetch(e._modelHomeDir+"/"+t).then((function(t){return t.arrayBuffer()})).then((function(t){e.loadUserData(t,t.byteLength),e._state=a.SetupEyeBlinkIds,h()})),e._state=a.WaitLoadUserData}else e._state=a.SetupEyeBlinkIds,h()},h=function(){for(var t=e._modelSetting.getEyeBlinkParameterCount(),i=0;i=e&&(t._state=a.CompleteSetup)})),r.getRenderer().setIsPremultipliedAlpha(!0)},r=this,o=0;o=0&&s.setFadeInTime(n),(n=o._modelSetting.getMotionFadeOutTimeValue(t,e))>=0&&s.setFadeOutTime(n),s.setEffectIds(o._eyeBlinkIds,o._lipSyncIds),u=!0})):s.setFinishedMotionHandler(r),this._debugMode&&I.LAppPal.printMessage("[APP]start motion: ["+t+"_"+e),this._motionManager.startMotionPriority(s,u,i)},e.prototype.startRandomMotion=function(t,e,i){if(0==this._modelSetting.getMotionCount(t))return y;var r=Math.floor(Math.random()*this._modelSetting.getMotionCount(t));return this.startMotion(t,r,e,i)},e.prototype.setExpression=function(t){var e=this._expressions.getValue(t);this._debugMode&&I.LAppPal.printMessage("[APP]expression: ["+t+"]"),null!=e?this._expressionManager.startMotionPriority(e,!1,V.PriorityForce):this._debugMode&&I.LAppPal.printMessage("[APP]expression["+t+"] is null")},e.prototype.setRandomExpression=function(){if(0!=this._expressions.getSize())for(var t=Math.floor(Math.random()*this._expressions.getSize()),e=0;e ["+n+"]"),fetch(r._modelHomeDir+"/"+o).then((function(t){return t.arrayBuffer()})).then((function(r){var o=e.loadMotion(r,r.byteLength,n),s=e._modelSetting.getMotionFadeInTimeValue(t,i);s>=0&&o.setFadeInTime(s),(s=e._modelSetting.getMotionFadeOutTimeValue(t,i))>=0&&o.setFadeOutTime(s),o.setEffectIds(e._eyeBlinkIds,e._lipSyncIds),null!=e._motions.getValue(n)&&M.delete(e._motions.getValue(n)),e._motions.setValue(n,o),e._motionCount++,e._motionCount>=e._allMotionCount&&(e._state=a.LoadTexture,e._motionManager.stopAllMotions(),e._updating=!1,e._initialized=!0,e.createRenderer(),e.setupTextures(),e.getRenderer().startUp(F.gl))}))},r=this,o=0;os&&(s=p),gl&&(l=g)}var c=this._modelMatrix.invertTransformX(e),d=this._modelMatrix.invertTransformY(i);return a<=c&&c<=s&&u<=d&&d<=l},t.prototype.getModel=function(){return this._model},t.prototype.getRenderer=function(){return this._renderer},t.prototype.createRenderer=function(){this._renderer&&this.deleteRenderer(),this._renderer=new f,this._renderer.initialize(this._model)},t.prototype.deleteRenderer=function(){null!=this._renderer&&(this._renderer.release(),this._renderer=null)},t.prototype.motionEventFired=function(t){m.CubismLogInfo("{0}",t.s)},t.cubismDefaultMotionEventCallback=function(t,e,i){null!=i&&i.motionEventFired(e)},t.prototype.release=function(){null!=this._motionManager&&(this._motionManager.release(),this._motionManager=null),null!=this._expressionManager&&(this._expressionManager.release(),this._expressionManager=null),null!=this._moc&&(this._moc.deleteModel(this._model),this._moc.release(),this._moc=null),this._modelMatrix=null,x.delete(this._pose),y.delete(this._eyeBlink),v.delete(this._breath),this._dragManager=null,b.delete(this._physics),C.delete(this._modelUserData),this.deleteRenderer()},t}();t.CubismUserModel=e}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var n=i(16).Live2DCubismFramework.CubismMotionQueueManager;!function(t){var e=function(t){function e(){var e=t.call(this)||this;return e._currentPriority=0,e._reservePriority=0,e}return o(e,t),e.prototype.getCurrentPriority=function(){return this._currentPriority},e.prototype.getReservePriority=function(){return this._reservePriority},e.prototype.setReservePriority=function(t){this._reservePriority=t},e.prototype.startMotionPriority=function(e,i,r){return r==this._reservePriority&&(this._reservePriority=0),this._currentPriority=r,t.prototype.startMotion.call(this,e,i,this._userTimeSeconds)},e.prototype.updateMotion=function(e,i){this._userTimeSeconds+=i;var r=t.prototype.doUpdateMotion.call(this,e,this._userTimeSeconds);return this.isFinished()&&(this._currentPriority=0),r},e.prototype.reserveMotion=function(t){return!(t<=this._reservePriority||t<=this._currentPriority)&&(this._reservePriority=t,!0)},e}(n);t.CubismMotionManager=e}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(10).Live2DCubismFramework.ACubismMotion;!function(t){var e=function(){function t(){this._autoDelete=!1,this._motion=null,this._available=!0,this._finished=!1,this._started=!1,this._startTimeSeconds=-1,this._fadeInStartTimeSeconds=0,this._endTimeSeconds=-1,this._stateTimeSeconds=0,this._stateWeight=0,this._lastEventCheckSeconds=0,this._motionQueueEntryHandle=this}return t.prototype.release=function(){this._autoDelete&&this._motion&&r.delete(this._motion)},t.prototype.startFadeout=function(t,e){var i=e+t;(this._endTimeSeconds<0||ii)&&(u*=i/h,l*=i/h),this._faceVX+=u,this._faceVY+=l;var p=.5*(r.sqrt(i*i+16*i*a-8*i*a)-i),g=r.sqrt(this._faceVX*this._faceVX+this._faceVY*this._faceVY);g>p&&(this._faceVX*=p/g,this._faceVY*=p/g),this._faceX+=this._faceVX,this._faceY+=this._faceVY}}else this._lastTimeSeconds=this._userTimeSeconds},t.prototype.getX=function(){return this._faceX},t.prototype.getY=function(){return this._faceY},t.prototype.set=function(t,e){this._faceTargetX=t,this._faceTargetY=e},t}();t.CubismTargetPoint=e}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var n=i(6).Live2DCubismFramework.CubismMatrix44;!function(t){var e=function(t){function e(e,i){var r=t.call(this)||this;return r._width=void 0!==e?e:0,r._height=void 0!==i?i:0,r.setHeight(1),r}return o(e,t),e.prototype.setWidth=function(t){var e=t/this._width,i=e;this.scale(2.6*e,2.6*i)},e.prototype.setHeight=function(t){var e=t/this._height,i=e;this.scale(2.6*e,2.6*i)},e.prototype.setPosition=function(t,e){this.translate(t,e)},e.prototype.setCenterPosition=function(t,e){this.centerX(t),this.centerY(e)},e.prototype.top=function(t){this.setY(t)},e.prototype.bottom=function(t){var e=this._height*this.getScaleY();this.translateY(t-e)},e.prototype.left=function(t){this.setX(t)},e.prototype.right=function(t){var e=this._width*this.getScaleX();this.translateX(t-e)},e.prototype.centerX=function(t){var e=this._width*this.getScaleX();this.translateX(t-e/2)},e.prototype.setX=function(t){this.translateX(t)},e.prototype.centerY=function(t){var e=this._height*this.getScaleY();this.translateY(t-e/2)},e.prototype.setY=function(t){this.translateY(t)},e.prototype.setupFromLayout=function(t){for(var e=t.begin();e.notEqual(t.end());e.preIncrement()){var i=e.ptr().first,r=e.ptr().second;"width"==i?this.setWidth(r):"height"==i&&this.setHeight(r)}for(e=t.begin();e.notEqual(t.end());e.preIncrement()){i=e.ptr().first,r=e.ptr().second;"x"==i?this.setX(r):"y"==i?this.setY(r):"center_x"==i?this.centerX(r):"center_y"==i?this.centerY(r):"top"==i?this.top(r):"bottom"==i?this.bottom(r):"left"==i?this.left(r):"right"==i&&this.right(r)}},e}(n);t.CubismModelMatrix=e}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(33).Live2DCubismFramework.CubismModel,o=i(3);!function(t){var e=function(){function t(t){this._moc=t,this._modelCount=0}return t.create=function(e){var i=null,r=Live2DCubismCore.Moc.fromArrayBuffer(e);return r&&(i=new t(r)),i},t.delete=function(t){t._moc._release(),t._moc=null,t=null},t.prototype.createModel=function(){var t=null,e=Live2DCubismCore.Model.fromMoc(this._moc);return e&&((t=new r(e)).initialize(),++this._modelCount),t},t.prototype.deleteModel=function(t){null!=t&&(t.release(),t=null,--this._modelCount)},t.prototype.release=function(){o.CSM_ASSERT(0==this._modelCount),this._moc._release(),this._moc=null},t}();t.CubismMoc=e}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(14),o=i(0),n=i(9),a=i(1),s=i(3),u=o.Live2DCubismFramework.CubismFramework,l=r.Live2DCubismFramework.CubismBlendMode,h=a.Live2DCubismFramework.csmVector,p=n.Live2DCubismFramework.csmMap;!function(t){var e=function(){function t(t){this._model=t,this._parameterValues=null,this._parameterMaximumValues=null,this._parameterMinimumValues=null,this._partOpacities=null,this._savedParameters=new h,this._parameterIds=new h,this._drawableIds=new h,this._partIds=new h,this._notExistPartId=new p,this._notExistParameterId=new p,this._notExistParameterValues=new p,this._notExistPartOpacities=new p}return t.prototype.update=function(){this._model.update(),this._model.drawables.resetDynamicFlags()},t.prototype.getCanvasWidth=function(){return null==this._model?0:this._model.canvasinfo.CanvasWidth/this._model.canvasinfo.PixelsPerUnit},t.prototype.getCanvasHeight=function(){return null==this._model?0:this._model.canvasinfo.CanvasHeight/this._model.canvasinfo.PixelsPerUnit},t.prototype.saveParameters=function(){for(var t=this._model.parameters.count,e=this._savedParameters.getSize(),i=0;ie&&(e=this._model.parameters.minimumValues[t]),this._parameterValues[t]=1==i?e:this._parameterValues[t]=this._parameterValues[t]*(1-i)+e*i)},t.prototype.setParameterValueById=function(t,e,i){void 0===i&&(i=1);var r=this.getParameterIndex(t);this.setParameterValueByIndex(r,e,i)},t.prototype.addParameterValueByIndex=function(t,e,i){void 0===i&&(i=1),this.setParameterValueByIndex(t,this.getParameterValueByIndex(t)+e*i)},t.prototype.addParameterValueById=function(t,e,i){void 0===i&&(i=1);var r=this.getParameterIndex(t);this.addParameterValueByIndex(r,e,i)},t.prototype.multiplyParameterValueById=function(t,e,i){void 0===i&&(i=1);var r=this.getParameterIndex(t);this.multiplyParameterValueByIndex(r,e,i)},t.prototype.multiplyParameterValueByIndex=function(t,e,i){void 0===i&&(i=1),this.setParameterValueByIndex(t,this.getParameterValueByIndex(t)*(1+(e-1)*i))},t.prototype.getDrawableIndex=function(t){for(var e=this._model.drawables.count,i=0;ie&&(t=e);for(var i=0;ii){o=s;break}if(-1==o)return t.points.at(a).value;var u=t.segments.at(o);return u.evaluate(t.points.get(u.basePointIndex),i)}var u=function(t){function e(){var e=t.call(this)||this;return e._sourceFrameRate=30,e._loopDurationSeconds=-1,e._isLoop=!1,e._isLoopFadeIn=!0,e._lastWeight=0,e._motionData=null,e._modelCurveIdEyeBlink=null,e._modelCurveIdLipSync=null,e._eyeBlinkParameterIds=null,e._lipSyncParameterIds=null,e}return o(e,t),e.create=function(t,i,r){var o=new e;return o.parse(t,i),o._sourceFrameRate=o._motionData.fps,o._loopDurationSeconds=o._motionData.duration,o._onFinishedMotion=r,o},e.prototype.doUpdateParameters=function(t,e,i,r){null==this._modelCurveIdEyeBlink&&(this._modelCurveIdEyeBlink=b.getIdManager().getId("EyeBlink")),null==this._modelCurveIdLipSync&&(this._modelCurveIdLipSync=b.getIdManager().getId("LipSync"));var o=e-r.getStartTime();o<0&&(o=0);var n=Number.MAX_VALUE,a=Number.MAX_VALUE,u=0,l=0;this._eyeBlinkParameterIds.getSize()>64&&p.CubismLogDebug("too many eye blink targets : {0}",this._eyeBlinkParameterIds.getSize()),this._lipSyncParameterIds.getSize()>64&&p.CubismLogDebug("too many lip sync targets : {0}",this._lipSyncParameterIds.getSize());var h,g,c,d=this._fadeInSeconds<=0?1:S.getEasingSine((e-r.getFadeInStartTime())/this._fadeInSeconds),_=this._fadeOutSeconds<=0||r.getEndTime()<0?1:S.getEasingSine((r.getEndTime()-e)/this._fadeOutSeconds),m=o;if(this._isLoop)for(;m>this._motionData.duration;)m-=this._motionData.duration;var f=this._motionData.curves;for(g=0;g>C&1)){x=y+(a-y)*i;t.setParameterValueById(this._eyeBlinkParameterIds.at(C),x)}}if(n!=Number.MAX_VALUE)for(C=0;C>C&1)){x=y+(n-y)*i;t.setParameterValueById(this._lipSyncParameterIds.at(C),x)}}for(;g=this._motionData.duration&&(this._isLoop?(r.setStartTime(e),this._isLoopFadeIn&&r.setFadeInStartTime(e)):(this._onFinishedMotion&&this._onFinishedMotion(this),r.setIsFinished(!0))),this._lastWeight=i},e.prototype.setIsLoop=function(t){this._isLoop=t},e.prototype.isLoop=function(){return this._isLoop},e.prototype.setIsLoopFadeIn=function(t){this._isLoopFadeIn=t},e.prototype.isLoopFadeIn=function(){return this._isLoopFadeIn},e.prototype.getDuration=function(){return this._isLoop?-1:this._loopDurationSeconds},e.prototype.getLoopDuration=function(){return this._loopDurationSeconds},e.prototype.setParameterFadeInTime=function(t,e){for(var i=this._motionData.curves,r=0;rt&&this._motionData.events.at(i).fireTime<=e&&this._firedEventValues.pushBack(new g(this._motionData.events.at(i).value.s));return this._firedEventValues},e}(C);t.CubismMotion=u}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(5),o=i(0),n=i(8).Live2DCubismFramework.csmString,a=o.Live2DCubismFramework.CubismFramework,s=r.Live2DCubismFramework.CubismJson;!function(t){var e="Meta",i=function(){function t(t,e){this._json=s.create(t,e)}return t.prototype.release=function(){s.delete(this._json)},t.prototype.getMotionDuration=function(){return this._json.getRoot().getValueByString(e).getValueByString("Duration").toFloat()},t.prototype.isMotionLoop=function(){return this._json.getRoot().getValueByString(e).getValueByString("Loop").toBoolean()},t.prototype.getMotionCurveCount=function(){return this._json.getRoot().getValueByString(e).getValueByString("CurveCount").toInt()},t.prototype.getMotionFps=function(){return this._json.getRoot().getValueByString(e).getValueByString("Fps").toFloat()},t.prototype.getMotionTotalSegmentCount=function(){return this._json.getRoot().getValueByString(e).getValueByString("TotalSegmentCount").toInt()},t.prototype.getMotionTotalPointCount=function(){return this._json.getRoot().getValueByString(e).getValueByString("TotalPointCount").toInt()},t.prototype.isExistMotionFadeInTime=function(){return!this._json.getRoot().getValueByString(e).getValueByString("FadeInTime").isNull()},t.prototype.isExistMotionFadeOutTime=function(){return!this._json.getRoot().getValueByString(e).getValueByString("FadeOutTime").isNull()},t.prototype.getMotionFadeInTime=function(){return this._json.getRoot().getValueByString(e).getValueByString("FadeInTime").toFloat()},t.prototype.getMotionFadeOutTime=function(){return this._json.getRoot().getValueByString(e).getValueByString("FadeOutTime").toFloat()},t.prototype.getMotionCurveTarget=function(t){return this._json.getRoot().getValueByString("Curves").getValueByIndex(t).getValueByString("Target").getRawString()},t.prototype.getMotionCurveId=function(t){return a.getIdManager().getId(this._json.getRoot().getValueByString("Curves").getValueByIndex(t).getValueByString("Id").getRawString())},t.prototype.isExistMotionCurveFadeInTime=function(t){return!this._json.getRoot().getValueByString("Curves").getValueByIndex(t).getValueByString("FadeInTime").isNull()},t.prototype.isExistMotionCurveFadeOutTime=function(t){return!this._json.getRoot().getValueByString("Curves").getValueByIndex(t).getValueByString("FadeOutTime").isNull()},t.prototype.getMotionCurveFadeInTime=function(t){return this._json.getRoot().getValueByString("Curves").getValueByIndex(t).getValueByString("FadeInTime").toFloat()},t.prototype.getMotionCurveFadeOutTime=function(t){return this._json.getRoot().getValueByString("Curves").getValueByIndex(t).getValueByString("FadeOutTime").toFloat()},t.prototype.getMotionCurveSegmentCount=function(t){return this._json.getRoot().getValueByString("Curves").getValueByIndex(t).getValueByString("Segments").getVector().getSize()},t.prototype.getMotionCurveSegment=function(t,e){return this._json.getRoot().getValueByString("Curves").getValueByIndex(t).getValueByString("Segments").getValueByIndex(e).toFloat()},t.prototype.getEventCount=function(){return this._json.getRoot().getValueByString(e).getValueByString("UserDataCount").toInt()},t.prototype.getTotalEventValueSize=function(){return this._json.getRoot().getValueByString(e).getValueByString("TotalUserDataSize").toInt()},t.prototype.getEventTime=function(t){return this._json.getRoot().getValueByString("UserData").getValueByIndex(t).getValueByString("Time").toInt()},t.prototype.getEventValue=function(t){return new n(this._json.getRoot().getValueByString("UserData").getValueByIndex(t).getValueByString("Value").getRawString())},t}();t.CubismMotionJson=i}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(1).Live2DCubismFramework.csmVector;!function(t){var e;!function(t){t[t.CubismMotionCurveTarget_Model=0]="CubismMotionCurveTarget_Model",t[t.CubismMotionCurveTarget_Parameter=1]="CubismMotionCurveTarget_Parameter",t[t.CubismMotionCurveTarget_PartOpacity=2]="CubismMotionCurveTarget_PartOpacity"}(e=t.CubismMotionCurveTarget||(t.CubismMotionCurveTarget={})),function(t){t[t.CubismMotionSegmentType_Linear=0]="CubismMotionSegmentType_Linear",t[t.CubismMotionSegmentType_Bezier=1]="CubismMotionSegmentType_Bezier",t[t.CubismMotionSegmentType_Stepped=2]="CubismMotionSegmentType_Stepped",t[t.CubismMotionSegmentType_InverseStepped=3]="CubismMotionSegmentType_InverseStepped"}(t.CubismMotionSegmentType||(t.CubismMotionSegmentType={}));var i=function(){this.time=0,this.value=0};t.CubismMotionPoint=i;var o=function(){this.evaluate=null,this.basePointIndex=0,this.segmentType=0};t.CubismMotionSegment=o;var n=function(){this.type=e.CubismMotionCurveTarget_Model,this.segmentCount=0,this.baseSegmentIndex=0,this.fadeInTime=0,this.fadeOutTime=0};t.CubismMotionCurve=n;var a=function(){this.fireTime=0};t.CubismMotionEvent=a;var s=function(){this.duration=0,this.loop=!1,this.curveCount=0,this.eventCount=0,this.fps=0,this.curves=new r,this.segments=new r,this.points=new r,this.events=new r};t.CubismMotionData=s}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var n=i(10),a=i(5),s=i(0),u=i(1).Live2DCubismFramework.csmVector,l=s.Live2DCubismFramework.CubismFramework,h=a.Live2DCubismFramework.CubismJson,p=n.Live2DCubismFramework.ACubismMotion;!function(t){var e,i=function(t){function i(){var e=t.call(this)||this;return e._parameters=new u,e}return o(i,t),i.create=function(t,o){var n=new i,a=h.create(t,o),s=a.getRoot();n.setFadeInTime(s.getValueByString("FadeInTime").toFloat(1)),n.setFadeOutTime(s.getValueByString("FadeOutTime").toFloat(1));var u=s.getValueByString("Parameters").getSize();n._parameters.prepareCapacity(u);for(var p=0;p.001){if(o>=0)break;o=a,n=t.getPartOpacityByIndex(s),(n+=e/this._fadeTimeSeconds)>1&&(n=1)}}o<0&&(o=0,n=1);for(a=i;a.15&&(p=1-.15/(1-n)),h>p&&(h=p),t.setPartOpacityByIndex(l,h)}}},t}();t.CubismPose=e;var i=function(){function t(t){if(this.parameterIndex=0,this.partIndex=0,this.link=new a,null!=t){this.partId=t.partId;for(var e=t.link.begin();e.notEqual(t.link.end());e.preIncrement())this.link.pushBack(e.ptr().clone())}}return t.prototype.assignment=function(t){this.partId=t.partId;for(var e=t.link.begin();e.notEqual(t.link.end());e.preIncrement())this.link.pushBack(e.ptr().clone());return this},t.prototype.initialize=function(t){this.parameterIndex=t.getParameterIndex(this.partId),this.partIndex=t.getPartIndex(this.partId),t.setParameterValueByIndex(this.parameterIndex,1)},t.prototype.clone=function(){var e=new t;e.partId=this.partId,e.parameterIndex=this.parameterIndex,e.partIndex=this.partIndex,e.link=new a;for(var i=this.link.begin();i.notEqual(this.link.end());i.increment())e.link.pushBack(i.ptr().clone());return e},t}();t.PartData=i}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(40),o=i(8),n=i(1),a=i(0).Live2DCubismFramework.CubismFramework,s=n.Live2DCubismFramework.csmVector,u=o.Live2DCubismFramework.csmString,l=r.Live2DCubismFramework.CubismModelUserDataJson;!function(t){var e=function(){};t.CubismModelUserDataNode=e;var i=function(){function t(){this._userDataNodes=new s,this._artMeshUserDataNode=new s}return t.create=function(e,i){var r=new t;return r.parseUserData(e,i),r},t.delete=function(t){null!=t&&(t.release(),t=null)},t.prototype.getArtMeshUserDatas=function(){return this._artMeshUserDataNode},t.prototype.parseUserData=function(t,i){for(var r=new l(t,i),o=a.getIdManager().getId("ArtMesh"),n=r.getUserDataCount(),s=0;s=a.particleCount)break;-1==l[y].destinationParameterIndex&&(l[y].destinationParameterIndex=t.getParameterIndex(l[y].destination.id));var S=new _;S.x=h[v].position.x-h[v-1].position.x,S.y=h[v].position.y-h[v-1].position.y,n=l[y].getValue(S,h,v,l[y].reflect,this._options.gravity);var b=l[y].destinationParameterIndex,C=!Float32Array.prototype.slice&&"subarray"in Float32Array.prototype?JSON.parse(JSON.stringify(p.subarray(b))):p.slice(b);M(C,c[b],g[b],n,l[y]);for(var L=b,P=0;L=2?e[i-1].position.substract(e[i-2].position):o.multiplyByScaler(-1),n=s.directionToRadian(o,t),r&&(n*=-1),n}function v(t,e){return s.min(t,e)+function(t,e){var i=s.max(t,e),r=s.min(t,e);return s.abs(i-r)}(t,e)/2}function S(t,e){return JSON.parse(JSON.stringify(t.x))}function b(t,e){return JSON.parse(JSON.stringify(t.y))}function C(t,e){return JSON.parse(JSON.stringify(e))}function x(t,e,i,r,o,n,a,u){var l,h,p,g,c=new _(0,0),d=new _(0,0),m=new _(0,0),f=new _(0,0);t[0].position=new _(i.x,i.y),l=s.degreesToRadian(r),(g=s.radianToDirection(l)).normalize();for(var y=1;yi&&(n>o.valueExceededMaximum&&(o.valueExceededMaximum=n),n=i),(a=o.weight/100)>=1?t[0]=n:(n=t[0]*(1-a)+n*a,t[0]=n)}function L(t,e,i,r,o,n,a,u){var l=0,h=s.max(i,e);ht&&(t=p);var g=s.min(o,n),c=s.max(o,n),d=a,_=v(p,h),m=t-_;switch(function(t){var e=0;return t>0?e=1:t<0&&(e=-1),e}(m)){case 1:var f=c-d;0!=(y=h-_)&&(l=m*(f/y),l+=d);break;case-1:var y;f=g-d;0!=(y=p-_)&&(l=m*(f/y),l+=d);break;case 0:l=d}return u?l:-1*l}t.Options=i}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(12),o=i(1).Live2DCubismFramework.csmVector,n=r.Live2DCubismFramework.CubismVector2;!function(t){!function(t){t[t.CubismPhysicsTargetType_Parameter=0]="CubismPhysicsTargetType_Parameter"}(t.CubismPhysicsTargetType||(t.CubismPhysicsTargetType={})),function(t){t[t.CubismPhysicsSource_X=0]="CubismPhysicsSource_X",t[t.CubismPhysicsSource_Y=1]="CubismPhysicsSource_Y",t[t.CubismPhysicsSource_Angle=2]="CubismPhysicsSource_Angle"}(t.CubismPhysicsSource||(t.CubismPhysicsSource={}));var e=function(){this.gravity=new n(0,0),this.wind=new n(0,0)};t.PhysicsJsonEffectiveForces=e;var i=function(){};t.CubismPhysicsParameter=i;var r=function(){};t.CubismPhysicsNormalization=r;var a=function(){this.initialPosition=new n(0,0),this.position=new n(0,0),this.lastPosition=new n(0,0),this.lastGravity=new n(0,0),this.force=new n(0,0),this.velocity=new n(0,0)};t.CubismPhysicsParticle=a;var s=function(){this.normalizationPosition=new r,this.normalizationAngle=new r};t.CubismPhysicsSubRig=s;var u=function(){this.source=new i};t.CubismPhysicsInput=u;var l=function(){this.destination=new i,this.translationScale=new n(0,0)};t.CubismPhysicsOutput=l;var h=function(){this.settings=new o,this.inputs=new o,this.outputs=new o,this.particles=new o,this.gravity=new n(0,0),this.wind=new n(0,0)};t.CubismPhysicsRig=h}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(5),o=i(12),n=i(0).Live2DCubismFramework.CubismFramework,a=o.Live2DCubismFramework.CubismVector2,s=r.Live2DCubismFramework.CubismJson;!function(t){var e="Meta",i="PhysicsSettings",r=function(){function t(t,e){this._json=s.create(t,e)}return t.prototype.release=function(){s.delete(this._json)},t.prototype.getGravity=function(){var t=new a(0,0);return t.x=this._json.getRoot().getValueByString(e).getValueByString("EffectiveForces").getValueByString("Gravity").getValueByString("X").toFloat(),t.y=this._json.getRoot().getValueByString(e).getValueByString("EffectiveForces").getValueByString("Gravity").getValueByString("Y").toFloat(),t},t.prototype.getWind=function(){var t=new a(0,0);return t.x=this._json.getRoot().getValueByString(e).getValueByString("EffectiveForces").getValueByString("Wind").getValueByString("X").toFloat(),t.y=this._json.getRoot().getValueByString(e).getValueByString("EffectiveForces").getValueByString("Wind").getValueByString("Y").toFloat(),t},t.prototype.getSubRigCount=function(){return this._json.getRoot().getValueByString(e).getValueByString("PhysicsSettingCount").toInt()},t.prototype.getTotalInputCount=function(){return this._json.getRoot().getValueByString(e).getValueByString("TotalInputCount").toInt()},t.prototype.getTotalOutputCount=function(){return this._json.getRoot().getValueByString(e).getValueByString("TotalOutputCount").toInt()},t.prototype.getVertexCount=function(){return this._json.getRoot().getValueByString(e).getValueByString("VertexCount").toInt()},t.prototype.getNormalizationPositionMinimumValue=function(t){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Normalization").getValueByString("Position").getValueByString("Minimum").toFloat()},t.prototype.getNormalizationPositionMaximumValue=function(t){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Normalization").getValueByString("Position").getValueByString("Maximum").toFloat()},t.prototype.getNormalizationPositionDefaultValue=function(t){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Normalization").getValueByString("Position").getValueByString("Default").toFloat()},t.prototype.getNormalizationAngleMinimumValue=function(t){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Normalization").getValueByString("Angle").getValueByString("Minimum").toFloat()},t.prototype.getNormalizationAngleMaximumValue=function(t){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Normalization").getValueByString("Angle").getValueByString("Maximum").toFloat()},t.prototype.getNormalizationAngleDefaultValue=function(t){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Normalization").getValueByString("Angle").getValueByString("Default").toFloat()},t.prototype.getInputCount=function(t){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Input").getVector().getSize()},t.prototype.getInputWeight=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Input").getValueByIndex(e).getValueByString("Weight").toFloat()},t.prototype.getInputReflect=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Input").getValueByIndex(e).getValueByString("Reflect").toBoolean()},t.prototype.getInputType=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Input").getValueByIndex(e).getValueByString("Type").getRawString()},t.prototype.getInputSourceId=function(t,e){return n.getIdManager().getId(this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Input").getValueByIndex(e).getValueByString("Source").getValueByString("Id").getRawString())},t.prototype.getOutputCount=function(t){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Output").getVector().getSize()},t.prototype.getOutputVertexIndex=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Output").getValueByIndex(e).getValueByString("VertexIndex").toInt()},t.prototype.getOutputAngleScale=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Output").getValueByIndex(e).getValueByString("Scale").toFloat()},t.prototype.getOutputWeight=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Output").getValueByIndex(e).getValueByString("Weight").toFloat()},t.prototype.getOutputDestinationId=function(t,e){return n.getIdManager().getId(this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Output").getValueByIndex(e).getValueByString("Destination").getValueByString("Id").getRawString())},t.prototype.getOutputType=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Output").getValueByIndex(e).getValueByString("Type").getRawString()},t.prototype.getOutputReflect=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Output").getValueByIndex(e).getValueByString("Reflect").toBoolean()},t.prototype.getParticleCount=function(t){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Vertices").getVector().getSize()},t.prototype.getParticleMobility=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Vertices").getValueByIndex(e).getValueByString("Mobility").toFloat()},t.prototype.getParticleDelay=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Vertices").getValueByIndex(e).getValueByString("Delay").toFloat()},t.prototype.getParticleAcceleration=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Vertices").getValueByIndex(e).getValueByString("Acceleration").toFloat()},t.prototype.getParticleRadius=function(t,e){return this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Vertices").getValueByIndex(e).getValueByString("Radius").toInt()},t.prototype.getParticlePosition=function(t,e){var r=new a(0,0);return r.x=this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Vertices").getValueByIndex(e).getValueByString("Position").getValueByString("X").toFloat(),r.y=this._json.getRoot().getValueByString(i).getValueByIndex(t).getValueByString("Vertices").getValueByIndex(e).getValueByString("Position").getValueByString("Y").toFloat(),r},t}();t.CubismPhysicsJson=r}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),a=i(45),s=i(14),u=i(6),l=i(9),h=i(1),p=i(3),g=n.Live2DCubismFramework.Constant,c=u.Live2DCubismFramework.CubismMatrix44,d=a.Live2DCubismFramework.csmRect,_=l.Live2DCubismFramework.csmMap,m=h.Live2DCubismFramework.csmVector,f=s.Live2DCubismFramework.CubismRenderer,y=s.Live2DCubismFramework.CubismBlendMode,v=s.Live2DCubismFramework.CubismTextureColor;!function(t){var e,i,r,n=function(){function t(){this._maskRenderTexture=null,this._colorBuffer=null,this._currentFrameNo=0,this._clippingMaskBufferSize=256,this._clippingContextListForMask=new m,this._clippingContextListForDraw=new m,this._channelColors=new m,this._tmpBoundsOnModel=new d,this._tmpMatrix=new c,this._tmpMatrixForMask=new c,this._tmpMatrixForDraw=new c,this._maskTexture=null;var t=new v;t.R=1,t.G=0,t.B=0,t.A=0,this._channelColors.pushBack(t),(t=new v).R=0,t.G=1,t.B=0,t.A=0,this._channelColors.pushBack(t),(t=new v).R=0,t.G=0,t.B=1,t.A=0,this._channelColors.pushBack(t),(t=new v).R=0,t.G=0,t.B=0,t.A=1,this._channelColors.pushBack(t)}return t.prototype.getChannelFlagAsColor=function(t){return this._channelColors.at(t)},t.prototype.getMaskRenderTexture=function(){var t=0;if(this._maskTexture&&0!=this._maskTexture.texture&&(this._maskTexture.frameNo=this._currentFrameNo,t=this._maskTexture.texture),0==t){var e=this._clippingMaskBufferSize;this._colorBuffer=this.gl.createTexture(),this.gl.bindTexture(this.gl.TEXTURE_2D,this._colorBuffer),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,e,e,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,null),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.bindTexture(this.gl.TEXTURE_2D,null),t=this.gl.createFramebuffer(),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,t),this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER,this.gl.COLOR_ATTACHMENT0,this.gl.TEXTURE_2D,this._colorBuffer,0),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,r),this._maskTexture=new a(this._currentFrameNo,t)}return t},t.prototype.setGL=function(t){this.gl=t},t.prototype.calcClippedDrawTotalBounds=function(t,e){for(var i=Number.MAX_VALUE,r=Number.MAX_VALUE,o=Number.MIN_VALUE,n=Number.MIN_VALUE,a=e._clippedDrawableIndexList.length,s=0;sd&&(d=y),v_&&(_=v)}if(p!=Number.MAX_VALUE)if(po&&(o=d),_>n&&(n=_),i==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;var S=o-i,b=n-r;e._allClippedDrawRect.x=i,e._allClippedDrawRect.y=r,e._allClippedDrawRect.width=S,e._allClippedDrawRect.height=b}}},t.prototype.release=function(){for(var t=0;t0){this.gl.viewport(0,0,this._clippingMaskBufferSize,this._clippingMaskBufferSize),this._maskRenderTexture=this.getMaskRenderTexture();e.getMvpMatrix();e.preDraw(),this.setupLayoutBounds(o),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this._maskRenderTexture),this.gl.clearColor(1,1,1,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT);for(n=0;n-1};function h(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function p(t){return"string"!=typeof t&&(t=String(t)),t}function g(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return o&&(e[Symbol.iterator]=function(){return e}),e}function c(t){this.map={},t instanceof c?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function d(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function _(t){return new Promise((function(e,i){t.onload=function(){e(t.result)},t.onerror=function(){i(t.error)}}))}function m(t){var e=new FileReader,i=_(e);return e.readAsArrayBuffer(t),i}function f(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:n&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:a&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():s&&n&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=f(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(t)||l(t))?this._bodyArrayBuffer=f(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n&&(this.blob=function(){var t=d(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var t,e,i,r=d(this);if(r)return r;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,i=_(e),e.readAsText(t),i;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),i=new Array(e.length),r=0;r-1?r:i),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function b(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var i=t.split("="),r=i.shift().replace(/\+/g," "),o=i.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(o))}})),e}function C(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new c(e.headers),this.url=e.url||"",this._initBody(t)}S.prototype.clone=function(){return new S(this,{body:this._bodyInit})},y.call(S.prototype),y.call(C.prototype),C.prototype.clone=function(){return new C(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},C.error=function(){var t=new C(null,{status:0,statusText:""});return t.type="error",t};var x=[301,302,303,307,308];C.redirect=function(t,e){if(-1===x.indexOf(e))throw new RangeError("Invalid status code");return new C(null,{status:e,headers:{location:t}})};var M=self.DOMException;try{new M}catch(t){(M=function(t,e){this.message=t,this.name=e;var i=Error(t);this.stack=i.stack}).prototype=Object.create(Error.prototype),M.prototype.constructor=M}function L(t,e){return new Promise((function(i,r){var o=new S(t,e);if(o.signal&&o.signal.aborted)return r(new M("Aborted","AbortError"));var a=new XMLHttpRequest;function s(){a.abort()}a.onload=function(){var t,e,r={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new c,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var i=t.split(":"),r=i.shift().trim();if(r){var o=i.join(":").trim();e.append(r,o)}})),e)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var o="response"in a?a.response:a.responseText;i(new C(o,r))},a.onerror=function(){r(new TypeError("Network request failed"))},a.ontimeout=function(){r(new TypeError("Network request failed"))},a.onabort=function(){r(new M("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&n&&(a.responseType="blob"),o.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),o.signal&&(o.signal.addEventListener("abort",s),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",s)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}L.polyfill=!0,self.fetch||(self.fetch=L,self.Headers=c,self.Request=S,self.Response=C)},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(1).Live2DCubismFramework.csmVector,o=i(4),n=function(){function t(){this._textures=new r}return t.prototype.release=function(){for(var t=this._textures.begin();t.notEqual(this._textures.end());t.preIncrement())o.gl.deleteTexture(t.ptr().id);this._textures=null},t.prototype.createTextureFromPngFile=function(t,e,i){for(var r=this,n=function(r){if(r.ptr().fileName==t&&r.ptr().usePremultply==e)return r.ptr().img=new Image,r.ptr().img.onload=function(){return i(r.ptr())},r.ptr().img.src=t,{value:void 0}},s=this._textures.begin();s.notEqual(this._textures.end());s.preIncrement()){var u=n(s);if("object"==typeof u)return u.value}var l=new Image;l.onload=function(){var n=o.gl.createTexture();o.gl.bindTexture(o.gl.TEXTURE_2D,n),o.gl.texParameteri(o.gl.TEXTURE_2D,o.gl.TEXTURE_MIN_FILTER,o.gl.LINEAR_MIPMAP_LINEAR),o.gl.texParameteri(o.gl.TEXTURE_2D,o.gl.TEXTURE_MAG_FILTER,o.gl.LINEAR),e&&o.gl.pixelStorei(o.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1),o.gl.texImage2D(o.gl.TEXTURE_2D,0,o.gl.RGBA,o.gl.RGBA,o.gl.UNSIGNED_BYTE,l),o.gl.generateMipmap(o.gl.TEXTURE_2D),o.gl.bindTexture(o.gl.TEXTURE_2D,null);var s=new a;null!=s&&(s.fileName=t,s.width=l.width,s.height=l.height,s.id=n,s.img=l,s.usePremultply=e,r._textures.pushBack(s)),i(s)},l.src=t,l.crossOrigin="anonymous"},t.prototype.releaseTextures=function(){for(var t=0;t