diff --git a/README.md b/README.md index a3d3d55..031534d 100644 --- a/README.md +++ b/README.md @@ -167,11 +167,16 @@ api 文档 (待完善,如有需要功能欢迎提[issue](https://github.com/ | right | position:relative的right值 | String | '0' | | bottom | position:relative的bottom值 | String | '0' | | left | position:relative的left值 | String | '' | -| ModelList | 模型列表,暂时只展示数组的第一个模型 | Array | ['Hiyori'] | +| ModelList | 模型列表 | Array | ['Hiyori'] | | TouchBody | 点击身体时聊天框随机出现数组的值 | Array | ['啊呀,你的手在摸哪里嘛~','哼,坏人'] | | TouchHead | 点击头部时聊天框随机出现数组的值,该值当模型未存入头部事件时无效 | Array | ['讨厌,不要掐人家的脸嘛~','希望明天也能感受到你的触摸呢'] | | color | 聊天框背景颜色 | String | '#C8E6FE' | | PathFull | 当SSR框架时,必须传入此参数,用以额外指定绝对路径资源域名地址 | String | '' | | MobileShow | 是否在移动设备展示看板娘 | Boolean | false | +| menuList | 启用的功能菜单列表,该值传空数组时不启用菜单,可用参数为:Mtab | Array | ['Mtab'] | +当menuList 传入非空数组时,其中的字段: +| 成员 | 说明 | 类型 | 默认值 | +| :-----: | ----- | ----- | ----- | +| Mtab | 切换看板娘 | String | 'Mtab' | \ No newline at end of file diff --git a/Samples/TypeScript/Demo/dist/asset/index.css b/Samples/TypeScript/Demo/dist/asset/index.css new file mode 100644 index 0000000..153535b --- /dev/null +++ b/Samples/TypeScript/Demo/dist/asset/index.css @@ -0,0 +1,19 @@ +@font-face { + font-family: 'iconfont'; /* project id 1168737 */ + src: url('//at.alicdn.com/t/font_1168737_j6ahlsx1dk.eot'); + src: url('//at.alicdn.com/t/font_1168737_j6ahlsx1dk.eot?#iefix') format('embedded-opentype'), + url('//at.alicdn.com/t/font_1168737_j6ahlsx1dk.woff2') format('woff2'), + url('//at.alicdn.com/t/font_1168737_j6ahlsx1dk.woff') format('woff'), + url('//at.alicdn.com/t/font_1168737_j6ahlsx1dk.ttf') format('truetype'), + url('//at.alicdn.com/t/font_1168737_j6ahlsx1dk.svg#iconfont') format('svg'); + } + +.iconfont{ + font-family:"iconfont" !important; + font-size:16px;font-style:normal; + -webkit-font-smoothing: antialiased; + -webkit-text-stroke-width: 0.2px; + -moz-osx-font-smoothing: grayscale; + cursor: pointer; +} + diff --git a/Samples/TypeScript/Demo/dist/bundle.js b/Samples/TypeScript/Demo/dist/bundle.js index 852a86b..4ade833 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,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(){if(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(""),!navigator.userAgent.match(/mobile/i)||1==t.MobileShow){if(0==r.LAppDelegate.getInstance().initialize())return;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>24,o=(16711680&i)>>16,s=65535&i,u=i;a.CubismLogInfo("Live2D Cubism Core version: {0}.{1}.{2} ({3})",("00"+n).slice(-2),("00"+o).slice(-2),("0000"+s).slice(-4),u)}return a.CubismLogInfo("CubismFramework.startUp() is complete."),e},t.cleanUp=function(){e=!1,i=!1,r=null,n=null},t.initialize=function(){a.CSM_ASSERT(e),e?i?a.CubismLogWarning("CubismFramework.initialize() skipped, already initialized."):(s.staticInitializeNotForClientCall(),n=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(),n.release(),n=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 n},t}();t.CubismFramework=o}(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.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 n=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=n},function(e,i){e.exports=t},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,n=i(0),o=i(21);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)},o.CSM_LOG_LEVEL<=o.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 n=i(0),o=n.Live2DCubismFramework.CubismFramework,a=i(24),s=i(13),u=i(51),l=i(14),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 n.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,n=e.clientY-i.top;t.getInstance()._view.onTouchesMoved(r,n)}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(),n=i.clientX-r.left,o=i.clientY-r.top;t.getInstance()._view.onTouchesBegan(n,o),t.getInstance()._view.onTouchesEnded(n,o)}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=c,e.canvas.ontouchmove=g,e.canvas.ontouchend=d,e.canvas.ontouchcancel=m),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(),o.dispose()},t.prototype.run=function(){var t=this,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,o.startUp(this._cubismOption),o.initialize(),l.LAppLive2DManager.getInstance(),s.LAppPal.updateTime(),this._view.initializeSprite()},t}();function c(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 g(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 m(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,n=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 o=i(8),a=i(9),s=i(1),u=i(4),l=i(0),h=s.Live2DCubismFramework.csmVector,p=a.Live2DCubismFramework.csmMap,c=o.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(){o.trueValue=new o(!0),o.falseValue=new o(!1),s.errorValue=new s("ERROR",!0),this.nullValue=new g,t.s_dummyKeys=new h},t.staticReleaseNotForClientCall=function(){o.trueValue=null,o.falseValue=null,s.errorValue=null,t.nullValue=null,t.s_dummyKeys=null,o.trueValue=null,o.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,n=e.length;ra&&o.append(t.slice(a),n-a),a=n+1,nt.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(4);!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";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 n=i(7),o=i(1).Live2DCubismFramework.csmVector,a=n.Live2DCubismFramework.CubismMatrix44,s=i(27),u=i(13),l=i(5),h=r(i(2));e.s_instance=null;var p=null,c=function(){function t(){this._finishedMotion=function(t){u.LAppPal.printMessage("Motion Finished:")},this._viewMatrix=new a,this._models=new o,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 t1&&(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";Object.defineProperty(e,"__esModule",{value:!0});var r=i(30),n=i(1).Live2DCubismFramework.csmVector,o=r.Live2DCubismFramework.CubismMotionQueueEntry;!function(t){var e=function(){function e(){this._userTimeSeconds=0,this._eventCallBack=null,this._eventCustomData=null,this._motions=new n}return e.prototype.release=function(){for(var t=0;t=1&&(o=1,this._blinkingState=e.EyeState_Closed,this._stateStartTimeSeconds=this._userTimeSeconds),n=1-o;break;case e.EyeState_Closed:(o=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._closedSeconds)>=1&&(this._blinkingState=e.EyeState_Opening,this._stateStartTimeSeconds=this._userTimeSeconds),n=0;break;case e.EyeState_Opening:(o=(this._userTimeSeconds-this._stateStartTimeSeconds)/this._openingSeconds)>=1&&(o=1,this._blinkingState=e.EyeState_Interval,this._nextBlinkingTime=this.determinNextBlinkingTiming()),n=o;break;case e.EyeState_Interval:this._nextBlinkingTimet.length)&&(e=t.length);for(var i=0,r=new Array(e);i300?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"},l="none",(i="display")in e?Object.defineProperty(e,i,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[i]=l,e),g={color:t.color?t.color:"#C8E6FE",width:"30px",height:"30px"},d=null,m=u(Object(a.useState)(!1),2),_=m[0],f=m[1],y=u(Object(a.useState)(!1),2),v=y[0],S=y[1],b=u(Object(a.useState)(!1),2);return b[0],b[1],Object(a.useEffect)((function(){if(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(""),!navigator.userAgent.match(/mobile/i)||1==t.MobileShow){if(0==r.LAppDelegate.getInstance().initialize())return;r.LAppDelegate.getInstance().run(),window.onbeforeunload=function(){return r.LAppDelegate.releaseInstance()}}}),[]),s.a.createElement("div",null,s.a.createElement("div",{style:h,width:t.width?t.width:"300",height:t.height?t.height:"500",id:"live2d-container"},s.a.createElement("div",{id:"live2d-print",style:c}),s.a.createElement("canvas",{id:"live2d",style:p,width:t.width?t.width:"300",height:t.height?t.height:"500",className:"live2d",onMouseEnter:function(){f(!0)},onMouseLeave:function(){d=setTimeout((function(){v||(f(!1),S(!1))}),10)}}),_&&(!t.menuList||t.menuList.length>0)&&s.a.createElement("div",{className:"live2d-controller",style:{position:"absolute",top:"20px",left:"20px"},onMouseEnter:function(){S(!0),clearTimeout(d)},onMouseLeave:function(){S(!1)}},(!t.menuList||t.menuList.indexOf("Mtab")>-1)&&s.a.createElement("div",{className:"iconfont",style:g,onClick:function(){n.LAppLive2DManager.getInstance().nextScene()},onMouseEnter:function(){return t="你想要换一个看板娘吗?",(e=document.getElementById("live2d-print")).innerHTML=t,void(e.style.display="block");var t,e},onMouseLeave:function(){var t=document.getElementById("live2d-print");t.innerHTML="",t.style.display="none"}},""))))}},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),n=i(23).Live2DCubismFramework.CubismId,o=r.Live2DCubismFramework.csmVector;!function(t){var e=function(){function t(){this._ids=new o}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]);o.multiply(i,this._tr,this._tr)},e.prototype.adjustScale=function(t,e,i){var r=this.getMaxScale(),n=this.getMinScale(),a=i*this._tr[0];a0&&(i=n/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]);o.multiply(l,this._tr,this._tr),o.multiply(u,this._tr,this._tr),o.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}(o);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),n=Math.abs(e);return i*(r0){for(var t=e._modelSetting.getExpressionCount(),i=function(i){var r=e._modelSetting.getExpressionName(i),o=e._modelSetting.getExpressionFileName(i);fetch(e._modelHomeDir+"/"+o).then((function(t){return t.arrayBuffer()})).then((function(i){var o=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,o),e._expressionCount++,e._expressionCount>=t&&(e._state=a.LoadPhysics,n())}))},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(B.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,n=0;n=0&&s.setFadeInTime(o),(o=n._modelSetting.getMotionFadeOutTimeValue(t,e))>=0&&s.setFadeOutTime(o),s.setEffectIds(n._eyeBlinkIds,n._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 ["+o+"]"),fetch(r._modelHomeDir+"/"+n).then((function(t){return t.arrayBuffer()})).then((function(r){var n=e.loadMotion(r,r.byteLength,o),s=e._modelSetting.getMotionFadeInTimeValue(t,i);s>=0&&n.setFadeInTime(s),(s=e._modelSetting.getMotionFadeOutTimeValue(t,i))>=0&&n.setFadeOutTime(s),n.setEffectIds(e._eyeBlinkIds,e._lipSyncIds),null!=e._motions.getValue(o)&&M.delete(e._motions.getValue(o)),e._motions.setValue(o,n),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,n=0;ns&&(s=p),cl&&(l=c)}var g=this._modelMatrix.invertTransformX(e),d=this._modelMatrix.invertTransformY(i);return a<=g&&g<=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){_.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,n=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 o=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 n(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}(o);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),c=r.sqrt(this._faceVX*this._faceVX+this._faceVY*this._faceVY);c>p&&(this._faceVX*=p/c,this._faceVY*=p/c),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,n=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 o=i(7).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 n(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}(o);t.CubismModelMatrix=e}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(34).Live2DCubismFramework.CubismModel,n=i(4);!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(){n.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(15),n=i(0),o=i(9),a=i(1),s=i(4),u=n.Live2DCubismFramework.CubismFramework,l=r.Live2DCubismFramework.CubismBlendMode,h=a.Live2DCubismFramework.csmVector,p=o.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){n=s;break}if(-1==n)return t.points.at(a).value;var u=t.segments.at(n);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 n(e,t),e.create=function(t,i,r){var n=new e;return n.parse(t,i),n._sourceFrameRate=n._motionData.fps,n._loopDurationSeconds=n._motionData.duration,n._onFinishedMotion=r,n},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 n=e-r.getStartTime();n<0&&(n=0);var o=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,c,g,d=this._fadeInSeconds<=0?1:S.getEasingSine((e-r.getFadeInStartTime())/this._fadeInSeconds),m=this._fadeOutSeconds<=0||r.getEndTime()<0?1:S.getEasingSine((r.getEndTime()-e)/this._fadeOutSeconds),_=n;if(this._isLoop)for(;_>this._motionData.duration;)_-=this._motionData.duration;var f=this._motionData.curves;for(c=0;c>C&1)){x=y+(a-y)*i;t.setParameterValueById(this._eyeBlinkParameterIds.at(C),x)}}if(o!=Number.MAX_VALUE)for(C=0;C>C&1)){x=y+(o-y)*i;t.setParameterValueById(this._lipSyncParameterIds.at(C),x)}}for(;c=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 c(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(6),n=i(0),o=i(8).Live2DCubismFramework.csmString,a=n.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 o(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 n=function(){this.evaluate=null,this.basePointIndex=0,this.segmentType=0};t.CubismMotionSegment=n;var o=function(){this.type=e.CubismMotionCurveTarget_Model,this.segmentCount=0,this.baseSegmentIndex=0,this.fadeInTime=0,this.fadeOutTime=0};t.CubismMotionCurve=o;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,n=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 o=i(10),a=i(6),s=i(0),u=i(1).Live2DCubismFramework.csmVector,l=s.Live2DCubismFramework.CubismFramework,h=a.Live2DCubismFramework.CubismJson,p=o.Live2DCubismFramework.ACubismMotion;!function(t){var e,i=function(t){function i(){var e=t.call(this)||this;return e._parameters=new u,e}return n(i,t),i.create=function(t,n){var o=new i,a=h.create(t,n),s=a.getRoot();o.setFadeInTime(s.getValueByString("FadeInTime").toFloat(1)),o.setFadeOutTime(s.getValueByString("FadeOutTime").toFloat(1));var u=s.getValueByString("Parameters").getSize();o._parameters.prepareCapacity(u);for(var p=0;p.001){if(n>=0)break;n=a,o=t.getPartOpacityByIndex(s),(o+=e/this._fadeTimeSeconds)>1&&(o=1)}}n<0&&(n=0,o=1);for(a=i;a.15&&(p=1-.15/(1-o)),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(41),n=i(8),o=i(1),a=i(0).Live2DCubismFramework.CubismFramework,s=o.Live2DCubismFramework.csmVector,u=n.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),n=a.getIdManager().getId("ArtMesh"),o=r.getUserDataCount(),s=0;s=a.particleCount)break;-1==l[y].destinationParameterIndex&&(l[y].destinationParameterIndex=t.getParameterIndex(l[y].destination.id));var S=new m;S.x=h[v].position.x-h[v-1].position.x,S.y=h[v].position.y-h[v-1].position.y,o=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,g[b],c[b],o,l[y]);for(var L=b,w=0;L=2?e[i-1].position.substract(e[i-2].position):n.multiplyByScaler(-1),o=s.directionToRadian(n,t),r&&(o*=-1),o}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,n,o,a,u){var l,h,p,c,g=new m(0,0),d=new m(0,0),_=new m(0,0),f=new m(0,0);t[0].position=new m(i.x,i.y),l=s.degreesToRadian(r),(c=s.radianToDirection(l)).normalize();for(var y=1;yi&&(o>n.valueExceededMaximum&&(n.valueExceededMaximum=o),o=i),(a=n.weight/100)>=1?t[0]=o:(o=t[0]*(1-a)+o*a,t[0]=o)}function L(t,e,i,r,n,o,a,u){var l=0,h=s.max(i,e);ht&&(t=p);var c=s.min(n,o),g=s.max(n,o),d=a,m=v(p,h),_=t-m;switch(function(t){var e=0;return t>0?e=1:t<0&&(e=-1),e}(_)){case 1:var f=g-d;0!=(y=h-m)&&(l=_*(f/y),l+=d);break;case-1:var y;f=c-d;0!=(y=p-m)&&(l=_*(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),n=i(1).Live2DCubismFramework.csmVector,o=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 o(0,0),this.wind=new o(0,0)};t.PhysicsJsonEffectiveForces=e;var i=function(){};t.CubismPhysicsParameter=i;var r=function(){};t.CubismPhysicsNormalization=r;var a=function(){this.initialPosition=new o(0,0),this.position=new o(0,0),this.lastPosition=new o(0,0),this.lastGravity=new o(0,0),this.force=new o(0,0),this.velocity=new o(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 o(0,0)};t.CubismPhysicsOutput=l;var h=function(){this.settings=new n,this.inputs=new n,this.outputs=new n,this.particles=new n,this.gravity=new o(0,0),this.wind=new o(0,0)};t.CubismPhysicsRig=h}(e.Live2DCubismFramework||(e.Live2DCubismFramework={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(6),n=i(12),o=i(0).Live2DCubismFramework.CubismFramework,a=n.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 o.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 o.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,n=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 o=i(0),a=i(46),s=i(15),u=i(7),l=i(9),h=i(1),p=i(4),c=o.Live2DCubismFramework.Constant,g=u.Live2DCubismFramework.CubismMatrix44,d=a.Live2DCubismFramework.csmRect,m=l.Live2DCubismFramework.csmMap,_=h.Live2DCubismFramework.csmVector,f=s.Live2DCubismFramework.CubismRenderer,y=s.Live2DCubismFramework.CubismBlendMode,v=s.Live2DCubismFramework.CubismTextureColor;!function(t){var e,i,r,o=function(){function t(){this._maskRenderTexture=null,this._colorBuffer=null,this._currentFrameNo=0,this._clippingMaskBufferSize=256,this._clippingContextListForMask=new _,this._clippingContextListForDraw=new _,this._channelColors=new _,this._tmpBoundsOnModel=new d,this._tmpMatrix=new g,this._tmpMatrixForMask=new g,this._tmpMatrixForDraw=new g,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,n=Number.MIN_VALUE,o=Number.MIN_VALUE,a=e._clippedDrawableIndexList.length,s=0;sd&&(d=y),vm&&(m=v)}if(p!=Number.MAX_VALUE)if(pn&&(n=d),m>o&&(o=m),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=n-i,b=o-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(n),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,this._maskRenderTexture),this.gl.clearColor(1,1,1,1),this.gl.clear(this.gl.COLOR_BUFFER_BIT);for(o=0;o-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 c(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function g(t){this.map={},t instanceof g?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 m(t){return new Promise((function(e,i){t.onload=function(){e(t.result)},t.onerror=function(){i(t.error)}}))}function _(t){var e=new FileReader,i=m(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:o&&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&&o&&((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"))},o&&(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(_)}),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=m(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)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}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," "),n=i.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(n))}})),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 g(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 g(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 n=new S(t,e);if(n.signal&&n.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 g,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var i=t.split(":"),r=i.shift().trim();if(r){var n=i.join(":").trim();e.append(r,n)}})),e)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var n="response"in a?a.response:a.responseText;i(new C(n,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(n.method,n.url,!0),"include"===n.credentials?a.withCredentials=!0:"omit"===n.credentials&&(a.withCredentials=!1),"responseType"in a&&o&&(a.responseType="blob"),n.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),n.signal&&(n.signal.addEventListener("abort",s),a.onreadystatechange=function(){4===a.readyState&&n.signal.removeEventListener("abort",s)}),a.send(void 0===n._bodyInit?null:n._bodyInit)}))}L.polyfill=!0,self.fetch||(self.fetch=L,self.Headers=g,self.Request=S,self.Response=C)},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(1).Live2DCubismFramework.csmVector,n=i(5),o=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())n.gl.deleteTexture(t.ptr().id);this._textures=null},t.prototype.createTextureFromPngFile=function(t,e,i){for(var r=this,o=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=o(s);if("object"==typeof u)return u.value}var l=new Image;l.onload=function(){var o=n.gl.createTexture();n.gl.bindTexture(n.gl.TEXTURE_2D,o),n.gl.texParameteri(n.gl.TEXTURE_2D,n.gl.TEXTURE_MIN_FILTER,n.gl.LINEAR_MIPMAP_LINEAR),n.gl.texParameteri(n.gl.TEXTURE_2D,n.gl.TEXTURE_MAG_FILTER,n.gl.LINEAR),e&&n.gl.pixelStorei(n.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1),n.gl.texImage2D(n.gl.TEXTURE_2D,0,n.gl.RGBA,n.gl.RGBA,n.gl.UNSIGNED_BYTE,l),n.gl.generateMipmap(n.gl.TEXTURE_2D),n.gl.bindTexture(n.gl.TEXTURE_2D,null);var s=new a;null!=s&&(s.fileName=t,s.width=l.width,s.height=l.height,s.id=o,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 300 ? props.width / 2 : '150px', - left: props.width > 300 ? (props.width - props.width / 2) / 2 + 'px' : (props.width - 150) / 2 + 'px', - top: '0', - minHeight: '20px', - display: 'block', - borderRadius: '5px', - border: '1px dashed #ccc', - padding: '5px', - background: props.color ? props.color : '#C8E6FE' - }, "display", 'none'); - - Object(react__WEBPACK_IMPORTED_MODULE_2__["useEffect"])(function () { - console.log('props', props); - props.ModelList ? _lappdefine__WEBPACK_IMPORTED_MODULE_1__["lappdefineSet"].setModelDir(props.ModelList) : _lappdefine__WEBPACK_IMPORTED_MODULE_1__["lappdefineSet"].setModelDir([]); - props.TouchBody ? _lappdefine__WEBPACK_IMPORTED_MODULE_1__["lappdefineSet"].setHitBody(props.TouchBody) : _lappdefine__WEBPACK_IMPORTED_MODULE_1__["lappdefineSet"].setHitBody([]); - props.TouchHead ? _lappdefine__WEBPACK_IMPORTED_MODULE_1__["lappdefineSet"].setHitHead(props.TouchHead) : _lappdefine__WEBPACK_IMPORTED_MODULE_1__["lappdefineSet"].setHitHead([]); - props.PathFull ? _lappdefine__WEBPACK_IMPORTED_MODULE_1__["lappdefineSet"].setPathFull(props.PathFull) : _lappdefine__WEBPACK_IMPORTED_MODULE_1__["lappdefineSet"].setPathFull(''); - - if (!navigator.userAgent.match(/mobile/i) || props.MobileShow == true) { - if (_lappdelegate__WEBPACK_IMPORTED_MODULE_0__["LAppDelegate"].getInstance().initialize() == false) { - return; - } - - _lappdelegate__WEBPACK_IMPORTED_MODULE_0__["LAppDelegate"].getInstance().run(); - - window.onbeforeunload = function () { - return _lappdelegate__WEBPACK_IMPORTED_MODULE_0__["LAppDelegate"].releaseInstance(); - }; - } - }, []); - return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { - style: containerStyle, - width: props.width ? props.width : '300', - height: props.height ? props.height : '500', - id: "live2d-container" - }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", { - id: "live2d-print", - style: printStyle - }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("canvas", { - id: "live2d", - style: canvasStyle, - width: props.width ? props.width : '300', - height: props.height ? props.height : '500', - className: "live2d" - }))); +function App(prop) { + return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, "liv2d"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_src_index_js__WEBPACK_IMPORTED_MODULE_2__["default"], { + width: 300, + height: 500, + bottom: '10px', + right: '10px', + ModelList: ['Haru', 'Hiyori'], + TouchBody: ['啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊你要干嘛', '哼', '坏人'] + })); } -/* harmony default export */ __webpack_exports__["default"] = (ReactLive2d); +; +react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(App, null), document.getElementById('root')); /***/ }) }) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9saXZlMmQvLi9zcmMvaW5kZXguanMiXSwibmFtZXMiOlsiUmVhY3RMaXZlMmQiLCJwcm9wcyIsImNvbnRhaW5lclN0eWxlIiwicG9zaXRpb24iLCJ0b3AiLCJyaWdodCIsImJvdHRvbSIsImxlZnQiLCJjYW52YXNTdHlsZSIsInByaW50U3R5bGUiLCJ3aWR0aCIsIm1pbkhlaWdodCIsImRpc3BsYXkiLCJib3JkZXJSYWRpdXMiLCJib3JkZXIiLCJwYWRkaW5nIiwiYmFja2dyb3VuZCIsImNvbG9yIiwidXNlRWZmZWN0IiwiY29uc29sZSIsImxvZyIsIk1vZGVsTGlzdCIsIkxBcHBEZWZpbmUiLCJzZXRNb2RlbERpciIsIlRvdWNoQm9keSIsInNldEhpdEJvZHkiLCJUb3VjaEhlYWQiLCJzZXRIaXRIZWFkIiwiUGF0aEZ1bGwiLCJzZXRQYXRoRnVsbCIsIm5hdmlnYXRvciIsInVzZXJBZ2VudCIsIm1hdGNoIiwiTW9iaWxlU2hvdyIsIkxBcHBEZWxlZ2F0ZSIsImdldEluc3RhbmNlIiwiaW5pdGlhbGl6ZSIsInJ1biIsIndpbmRvdyIsIm9uYmVmb3JldW5sb2FkIiwicmVsZWFzZUluc3RhbmNlIiwiaGVpZ2h0Il0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUE7QUFDQTtBQUNBOztBQUVBLFNBQVNBLFdBQVQsQ0FBcUJDLEtBQXJCLEVBQTRCO0FBQ3hCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBLE1BQUlDLGNBQWMsR0FBRztBQUNqQkMsWUFBUSxFQUFHLE9BRE07QUFFakJDLE9BQUcsRUFBRUgsS0FBSyxDQUFDRyxHQUFOLEdBQVlILEtBQUssQ0FBQ0csR0FBbEIsR0FBd0IsRUFGWjtBQUdqQkMsU0FBSyxFQUFFSixLQUFLLENBQUNJLEtBQU4sR0FBY0osS0FBSyxDQUFDSSxLQUFwQixHQUE0QixHQUhsQjtBQUlqQkMsVUFBTSxFQUFFTCxLQUFLLENBQUNLLE1BQU4sR0FBZUwsS0FBSyxDQUFDSyxNQUFyQixHQUE4QixHQUpyQjtBQUtqQkMsUUFBSSxFQUFFTixLQUFLLENBQUNNLElBQU4sR0FBYU4sS0FBSyxDQUFDTSxJQUFuQixHQUEwQjtBQUxmLEdBQXJCLENBUndCLENBZXhCOztBQUNBLE1BQUlDLFdBQVcsR0FBRztBQUNkTCxZQUFRLEVBQUcsVUFERztBQUVkQyxPQUFHLEVBQUVILEtBQUssQ0FBQ0csR0FBTixHQUFZSCxLQUFLLENBQUNHLEdBQWxCLEdBQXdCLEVBRmY7QUFHZEMsU0FBSyxFQUFFSixLQUFLLENBQUNJLEtBQU4sR0FBY0osS0FBSyxDQUFDSSxLQUFwQixHQUE0QixHQUhyQjtBQUlkQyxVQUFNLEVBQUVMLEtBQUssQ0FBQ0ssTUFBTixHQUFlTCxLQUFLLENBQUNLLE1BQXJCLEdBQThCLEdBSnhCO0FBS2RDLFFBQUksRUFBRU4sS0FBSyxDQUFDTSxJQUFOLEdBQWFOLEtBQUssQ0FBQ00sSUFBbkIsR0FBMEI7QUFMbEIsR0FBbEIsQ0FoQndCLENBdUJ4Qjs7QUFDQSxNQUFJRSxVQUFVO0FBQ1ZOLFlBQVEsRUFBRSxVQURBO0FBRVZPLFNBQUssRUFBRVQsS0FBSyxDQUFDUyxLQUFOLEdBQWMsR0FBZCxHQUFvQlQsS0FBSyxDQUFDUyxLQUFOLEdBQVksQ0FBaEMsR0FBb0MsT0FGakM7QUFHVkgsUUFBSSxFQUFFTixLQUFLLENBQUNTLEtBQU4sR0FBYyxHQUFkLEdBQW9CLENBQUNULEtBQUssQ0FBQ1MsS0FBTixHQUFjVCxLQUFLLENBQUNTLEtBQU4sR0FBWSxDQUEzQixJQUE4QixDQUE5QixHQUFrQyxJQUF0RCxHQUE2RCxDQUFDVCxLQUFLLENBQUNTLEtBQU4sR0FBWSxHQUFiLElBQWtCLENBQWxCLEdBQXNCLElBSC9FO0FBSVZOLE9BQUcsRUFBRSxHQUpLO0FBS1ZPLGFBQVMsRUFBRSxNQUxEO0FBTVZDLFdBQU8sRUFBRSxPQU5DO0FBT1ZDLGdCQUFZLEVBQUUsS0FQSjtBQVFWQyxVQUFNLEVBQUUsaUJBUkU7QUFTVkMsV0FBTyxFQUFFLEtBVEM7QUFVVkMsY0FBVSxFQUFFZixLQUFLLENBQUNnQixLQUFOLEdBQWNoQixLQUFLLENBQUNnQixLQUFwQixHQUE0QjtBQVY5QixnQkFXRCxNQVhDLENBQWQ7O0FBY0FDLHlEQUFTLENBQUMsWUFBTTtBQUNaQyxXQUFPLENBQUNDLEdBQVIsQ0FBWSxPQUFaLEVBQXFCbkIsS0FBckI7QUFFQUEsU0FBSyxDQUFDb0IsU0FBTixHQUFrQkMseURBQUEsQ0FBeUJDLFdBQXpCLENBQXFDdEIsS0FBSyxDQUFDb0IsU0FBM0MsQ0FBbEIsR0FBMEVDLHlEQUFBLENBQXlCQyxXQUF6QixDQUFxQyxFQUFyQyxDQUExRTtBQUNBdEIsU0FBSyxDQUFDdUIsU0FBTixHQUFrQkYseURBQUEsQ0FBeUJHLFVBQXpCLENBQW9DeEIsS0FBSyxDQUFDdUIsU0FBMUMsQ0FBbEIsR0FBeUVGLHlEQUFBLENBQXlCRyxVQUF6QixDQUFvQyxFQUFwQyxDQUF6RTtBQUNBeEIsU0FBSyxDQUFDeUIsU0FBTixHQUFrQkoseURBQUEsQ0FBeUJLLFVBQXpCLENBQW9DMUIsS0FBSyxDQUFDeUIsU0FBMUMsQ0FBbEIsR0FBeUVKLHlEQUFBLENBQXlCSyxVQUF6QixDQUFvQyxFQUFwQyxDQUF6RTtBQUNBMUIsU0FBSyxDQUFDMkIsUUFBTixHQUFpQk4seURBQUEsQ0FBeUJPLFdBQXpCLENBQXFDNUIsS0FBSyxDQUFDMkIsUUFBM0MsQ0FBakIsR0FBd0VOLHlEQUFBLENBQXlCTyxXQUF6QixDQUFxQyxFQUFyQyxDQUF4RTs7QUFFQSxRQUFJLENBQUNDLFNBQVMsQ0FBQ0MsU0FBVixDQUFvQkMsS0FBcEIsQ0FBMEIsU0FBMUIsQ0FBRCxJQUF5Qy9CLEtBQUssQ0FBQ2dDLFVBQU4sSUFBa0IsSUFBL0QsRUFBcUU7QUFFakUsVUFBSUMsMERBQVksQ0FBQ0MsV0FBYixHQUEyQkMsVUFBM0IsTUFBMkMsS0FBL0MsRUFBc0Q7QUFDbEQ7QUFDSDs7QUFFREYsZ0VBQVksQ0FBQ0MsV0FBYixHQUEyQkUsR0FBM0I7O0FBR0FDLFlBQU0sQ0FBQ0MsY0FBUCxHQUF3QjtBQUFBLGVBQU1MLDBEQUFZLENBQUNNLGVBQWIsRUFBTjtBQUFBLE9BQXhCO0FBQ0g7QUFFSixHQXBCUSxFQW9CTixFQXBCTSxDQUFUO0FBc0JBLHNCQUNJLHFGQUNJO0FBQ0MsU0FBSyxFQUFFdEMsY0FEUjtBQUVDLFNBQUssRUFBRUQsS0FBSyxDQUFDUyxLQUFOLEdBQWNULEtBQUssQ0FBQ1MsS0FBcEIsR0FBNEIsS0FGcEM7QUFHQyxVQUFNLEVBQUVULEtBQUssQ0FBQ3dDLE1BQU4sR0FBZXhDLEtBQUssQ0FBQ3dDLE1BQXJCLEdBQThCLEtBSHZDO0FBSUMsTUFBRSxFQUFDO0FBSkosa0JBS0k7QUFBSyxNQUFFLEVBQUMsY0FBUjtBQUNJLFNBQUssRUFBRWhDO0FBRFgsSUFMSixlQVFJO0FBQ0ksTUFBRSxFQUFDLFFBRFA7QUFFSSxTQUFLLEVBQUVELFdBRlg7QUFHSSxTQUFLLEVBQUVQLEtBQUssQ0FBQ1MsS0FBTixHQUFjVCxLQUFLLENBQUNTLEtBQXBCLEdBQTRCLEtBSHZDO0FBSUksVUFBTSxFQUFFVCxLQUFLLENBQUN3QyxNQUFOLEdBQWV4QyxLQUFLLENBQUN3QyxNQUFyQixHQUE4QixLQUoxQztBQUtJLGFBQVMsRUFBQztBQUxkLElBUkosQ0FESixDQURKO0FBb0JIOztBQUVjekMsMEVBQWYsRSIsImZpbGUiOiJob3QvaG90LXVwZGF0ZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IExBcHBEZWxlZ2F0ZSB9IGZyb20gJy4vbGFwcGRlbGVnYXRlJztcclxuaW1wb3J0ICogYXMgTEFwcERlZmluZSBmcm9tICcuL2xhcHBkZWZpbmUnO1xyXG5pbXBvcnQgUmVhY3QsIHsgdXNlU3RhdGUsIHVzZUVmZmVjdCB9IGZyb20gJ3JlYWN0JztcclxuXHJcbmZ1bmN0aW9uIFJlYWN0TGl2ZTJkKHByb3BzKSB7XHJcbiAgICAvLyDlpb3nnIvpopzoibLliJfooahcclxuICAgIC8vIGdyZWVuOiAnI0I0REVBRScsXHJcbiAgICAvLyBEZWVwQmx1ZTogJyM1QjhEQkUnLFxyXG4gICAgLy8gTGlnaHRCbHVlOiAnI0M4RTZGRScsXHJcbiAgICAvLyBwaW5rOiAnI0Y5QjhCRSdcclxuXHJcbiAgICAvLyDlrrnlmajmoLflvI9cclxuICAgIGxldCBjb250YWluZXJTdHlsZSA9IHtcclxuICAgICAgICBwb3NpdGlvbiA6ICdmaXhlZCcsXHJcbiAgICAgICAgdG9wOiBwcm9wcy50b3AgPyBwcm9wcy50b3AgOiAnJyxcclxuICAgICAgICByaWdodDogcHJvcHMucmlnaHQgPyBwcm9wcy5yaWdodCA6ICcwJyxcclxuICAgICAgICBib3R0b206IHByb3BzLmJvdHRvbSA/IHByb3BzLmJvdHRvbSA6ICcwJyxcclxuICAgICAgICBsZWZ0OiBwcm9wcy5sZWZ0ID8gcHJvcHMubGVmdCA6ICcnXHJcbiAgICB9XHJcbiAgICAvLyBjYW52YXPmoLflvI9cclxuICAgIGxldCBjYW52YXNTdHlsZSA9IHtcclxuICAgICAgICBwb3NpdGlvbiA6ICdyZWxhdGl2ZScsXHJcbiAgICAgICAgdG9wOiBwcm9wcy50b3AgPyBwcm9wcy50b3AgOiAnJyxcclxuICAgICAgICByaWdodDogcHJvcHMucmlnaHQgPyBwcm9wcy5yaWdodCA6ICcwJyxcclxuICAgICAgICBib3R0b206IHByb3BzLmJvdHRvbSA/IHByb3BzLmJvdHRvbSA6ICcwJyxcclxuICAgICAgICBsZWZ0OiBwcm9wcy5sZWZ0ID8gcHJvcHMubGVmdCA6ICcnXHJcbiAgICB9XHJcbiAgICAvLyDlr7nor53moYbmoLflvI9cclxuICAgIGxldCBwcmludFN0eWxlID0ge1xyXG4gICAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxyXG4gICAgICAgIHdpZHRoOiBwcm9wcy53aWR0aCA+IDMwMCA/IHByb3BzLndpZHRoLzIgOiAnMTUwcHgnLFxyXG4gICAgICAgIGxlZnQ6IHByb3BzLndpZHRoID4gMzAwID8gKHByb3BzLndpZHRoIC0gcHJvcHMud2lkdGgvMikvMiArICdweCcgOiAocHJvcHMud2lkdGgtMTUwKS8yICsgJ3B4JyxcclxuICAgICAgICB0b3A6ICcwJyxcclxuICAgICAgICBtaW5IZWlnaHQ6ICcyMHB4JyxcclxuICAgICAgICBkaXNwbGF5OiAnYmxvY2snLFxyXG4gICAgICAgIGJvcmRlclJhZGl1czogJzVweCcsXHJcbiAgICAgICAgYm9yZGVyOiAnMXB4IGRhc2hlZCAjY2NjJyxcclxuICAgICAgICBwYWRkaW5nOiAnNXB4JyxcclxuICAgICAgICBiYWNrZ3JvdW5kOiBwcm9wcy5jb2xvciA/IHByb3BzLmNvbG9yIDogJyNDOEU2RkUnLFxyXG4gICAgICAgIGRpc3BsYXk6ICdub25lJyxcclxuICAgIH1cclxuXHJcbiAgICB1c2VFZmZlY3QoKCkgPT4ge1xyXG4gICAgICAgIGNvbnNvbGUubG9nKCdwcm9wcycsIHByb3BzKVxyXG4gICAgICAgIFxyXG4gICAgICAgIHByb3BzLk1vZGVsTGlzdCA/IExBcHBEZWZpbmUubGFwcGRlZmluZVNldC5zZXRNb2RlbERpcihwcm9wcy5Nb2RlbExpc3QpIDogTEFwcERlZmluZS5sYXBwZGVmaW5lU2V0LnNldE1vZGVsRGlyKFtdKVxyXG4gICAgICAgIHByb3BzLlRvdWNoQm9keSA/IExBcHBEZWZpbmUubGFwcGRlZmluZVNldC5zZXRIaXRCb2R5KHByb3BzLlRvdWNoQm9keSkgOiBMQXBwRGVmaW5lLmxhcHBkZWZpbmVTZXQuc2V0SGl0Qm9keShbXSlcclxuICAgICAgICBwcm9wcy5Ub3VjaEhlYWQgPyBMQXBwRGVmaW5lLmxhcHBkZWZpbmVTZXQuc2V0SGl0SGVhZChwcm9wcy5Ub3VjaEhlYWQpIDogTEFwcERlZmluZS5sYXBwZGVmaW5lU2V0LnNldEhpdEhlYWQoW10pXHJcbiAgICAgICAgcHJvcHMuUGF0aEZ1bGwgPyBMQXBwRGVmaW5lLmxhcHBkZWZpbmVTZXQuc2V0UGF0aEZ1bGwocHJvcHMuUGF0aEZ1bGwpIDogTEFwcERlZmluZS5sYXBwZGVmaW5lU2V0LnNldFBhdGhGdWxsKCcnKVxyXG5cclxuICAgICAgICBpZiAoIW5hdmlnYXRvci51c2VyQWdlbnQubWF0Y2goL21vYmlsZS9pKSB8fCBwcm9wcy5Nb2JpbGVTaG93PT10cnVlKSB7XHJcbiAgICAgICAgICAgIFxyXG4gICAgICAgICAgICBpZiAoTEFwcERlbGVnYXRlLmdldEluc3RhbmNlKCkuaW5pdGlhbGl6ZSgpID09IGZhbHNlKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgIH1cclxuICAgIFxyXG4gICAgICAgICAgICBMQXBwRGVsZWdhdGUuZ2V0SW5zdGFuY2UoKS5ydW4oKTtcclxuICAgIFxyXG4gICAgXHJcbiAgICAgICAgICAgIHdpbmRvdy5vbmJlZm9yZXVubG9hZCA9ICgpID0+IExBcHBEZWxlZ2F0ZS5yZWxlYXNlSW5zdGFuY2UoKTtcclxuICAgICAgICB9XHJcblxyXG4gICAgfSwgW10pO1xyXG5cclxuICAgIHJldHVybiAoXHJcbiAgICAgICAgPGRpdj5cclxuICAgICAgICAgICAgPGRpdlxyXG4gICAgICAgICAgICAgc3R5bGU9e2NvbnRhaW5lclN0eWxlfVxyXG4gICAgICAgICAgICAgd2lkdGg9e3Byb3BzLndpZHRoID8gcHJvcHMud2lkdGggOiAnMzAwJ31cclxuICAgICAgICAgICAgIGhlaWdodD17cHJvcHMuaGVpZ2h0ID8gcHJvcHMuaGVpZ2h0IDogJzUwMCd9XHJcbiAgICAgICAgICAgICBpZD1cImxpdmUyZC1jb250YWluZXJcIj5cclxuICAgICAgICAgICAgICAgIDxkaXYgaWQ9XCJsaXZlMmQtcHJpbnRcIlxyXG4gICAgICAgICAgICAgICAgICAgIHN0eWxlPXtwcmludFN0eWxlfVxyXG4gICAgICAgICAgICAgICAgPjwvZGl2PlxyXG4gICAgICAgICAgICAgICAgPGNhbnZhc1xyXG4gICAgICAgICAgICAgICAgICAgIGlkPVwibGl2ZTJkXCJcclxuICAgICAgICAgICAgICAgICAgICBzdHlsZT17Y2FudmFzU3R5bGV9XHJcbiAgICAgICAgICAgICAgICAgICAgd2lkdGg9e3Byb3BzLndpZHRoID8gcHJvcHMud2lkdGggOiAnMzAwJ31cclxuICAgICAgICAgICAgICAgICAgICBoZWlnaHQ9e3Byb3BzLmhlaWdodCA/IHByb3BzLmhlaWdodCA6ICc1MDAnfVxyXG4gICAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZT1cImxpdmUyZFwiXHJcbiAgICAgICAgICAgICAgICA+PC9jYW52YXM+XHJcbiAgICAgICAgICAgIDwvZGl2PlxyXG4gICAgICAgIDwvZGl2PlxyXG4gICAgKVxyXG59XHJcblxyXG5leHBvcnQgZGVmYXVsdCBSZWFjdExpdmUyZCJdLCJzb3VyY2VSb290IjoiIn0= \ No newline at end of file +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9saXZlMmQvLi9leGFtcGxlL3NyYy9BcHAuanMiXSwibmFtZXMiOlsiQXBwIiwicHJvcCIsIlJlYWN0RE9NIiwicmVuZGVyIiwiZG9jdW1lbnQiLCJnZXRFbGVtZW50QnlJZCJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTs7QUFFQyxTQUFTQSxHQUFULENBQWFDLElBQWIsRUFBa0I7QUFDZixzQkFDSSxxRkFDSSxnRkFESixlQUVJLDJEQUFDLHFEQUFEO0FBQ0ksU0FBSyxFQUFFLEdBRFg7QUFFSSxVQUFNLEVBQUUsR0FGWjtBQUdJLFVBQU0sRUFBRSxNQUhaO0FBSUksU0FBSyxFQUFFLE1BSlg7QUFLSSxhQUFTLEVBQUUsQ0FBQyxNQUFELEVBQVEsUUFBUixDQUxmO0FBTUksYUFBUyxFQUFFLENBQUMsMEJBQUQsRUFBNEIsR0FBNUIsRUFBZ0MsSUFBaEM7QUFOZixJQUZKLENBREo7QUFhSDs7QUFBQTtBQUNEQyxnREFBUSxDQUFDQyxNQUFULGVBQWdCLDJEQUFDLEdBQUQsT0FBaEIsRUFBeUJDLFFBQVEsQ0FBQ0MsY0FBVCxDQUF3QixNQUF4QixDQUF6QixFIiwiZmlsZSI6ImhvdC9ob3QtdXBkYXRlLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0JztcclxuaW1wb3J0IFJlYWN0RE9NIGZyb20gJ3JlYWN0LWRvbSc7XHJcbmltcG9ydCBSZWFjdExpdmUyZCBmcm9tICcuLi8uLi9zcmMvaW5kZXguanMnO1xyXG5cclxuIGZ1bmN0aW9uIEFwcChwcm9wKXtcclxuICAgIHJldHVybihcclxuICAgICAgICA8ZGl2PlxyXG4gICAgICAgICAgICA8ZGl2PmxpdjJkPC9kaXY+XHJcbiAgICAgICAgICAgIDxSZWFjdExpdmUyZFxyXG4gICAgICAgICAgICAgICAgd2lkdGg9ezMwMH1cclxuICAgICAgICAgICAgICAgIGhlaWdodD17NTAwfVxyXG4gICAgICAgICAgICAgICAgYm90dG9tPXsnMTBweCd9XHJcbiAgICAgICAgICAgICAgICByaWdodD17JzEwcHgnfVxyXG4gICAgICAgICAgICAgICAgTW9kZWxMaXN0PXtbJ0hhcnUnLCdIaXlvcmknXX1cclxuICAgICAgICAgICAgICAgIFRvdWNoQm9keT17WyfllYrllYrllYrllYrllYrllYrllYrllYrllYrllYrllYrllYrllYrllYrllYrllYrllYrllYrllYrllYrkvaDopoHlubLlmJsnLCflk7wnLCflnY/kuronXX1cclxuICAgICAgICAgICAgIC8+XHJcbiAgICAgICAgPC9kaXY+XHJcbiAgICApXHJcbn07XHJcblJlYWN0RE9NLnJlbmRlcig8QXBwIC8+LCBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgncm9vdCcpKSJdLCJzb3VyY2VSb290IjoiIn0= \ No newline at end of file diff --git a/Samples/TypeScript/Demo/dist/hot/hot-update.json b/Samples/TypeScript/Demo/dist/hot/hot-update.json index d848a81..b701ef7 100644 --- a/Samples/TypeScript/Demo/dist/hot/hot-update.json +++ b/Samples/TypeScript/Demo/dist/hot/hot-update.json @@ -1 +1 @@ -{"h":"e7cc7f56771eba38d3dc","c":{"main":true}} \ No newline at end of file +{"h":"7b6379058224ff9c4ab0","c":{"main":true}} \ No newline at end of file diff --git a/Samples/TypeScript/Demo/dist/index.js b/Samples/TypeScript/Demo/dist/index.js index 7e25b42..8bcfe25 100644 --- a/Samples/TypeScript/Demo/dist/index.js +++ b/Samples/TypeScript/Demo/dist/index.js @@ -9,14 +9,30 @@ exports["default"] = void 0; var _lappdelegate = require("./lappdelegate"); +var _lapplive2dmanager = require("./lapplive2dmanager"); + var LAppDefine = _interopRequireWildcard(require("./lappdefine")); var _react = _interopRequireWildcard(require("react")); +require("./asset/index.css"); + function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function ReactLive2d(props) { @@ -53,7 +69,74 @@ function ReactLive2d(props) { border: '1px dashed #ccc', padding: '5px', background: props.color ? props.color : '#C8E6FE' - }, "display", 'none'); + }, "display", 'none'); // 面板主题样式 + + + var Theme = { + color: props.color ? props.color : '#C8E6FE', + width: '30px', + height: '30px' + }; + var timer = null; + + var _useState = (0, _react.useState)(false), + _useState2 = _slicedToArray(_useState, 2), + controllerOn = _useState2[0], + setControllerOn = _useState2[1]; + + var _useState3 = (0, _react.useState)(false), + _useState4 = _slicedToArray(_useState3, 2), + controllerIn = _useState4[0], + setControllerIn = _useState4[1]; + + var _useState5 = (0, _react.useState)(false), + _useState6 = _slicedToArray(_useState5, 2), + printMenu = _useState6[0], + setPrintMenu = _useState6[1]; // 进入显示控制台 + + + function cvMouseOver() { + setControllerOn(true); + } + + function cvMouseOut() { + timer = setTimeout(function () { + // 0.01秒内没有进入点击面板,说明已经鼠标离开 + if (!controllerIn) { + setControllerOn(false); + setControllerIn(false); + } + }, 10); + } // 进入选择菜单 + + + function ctMouseOver() { + setControllerIn(true); + clearTimeout(timer); + } // 离开选择菜单 + + + function ctMouseOut() { + setControllerIn(false); + } //切换 + + + function ctTab() { + _lapplive2dmanager.LAppLive2DManager.getInstance().nextScene(); + } // 悬停菜单时的对白 + + + function talkPrint(print) { + var printNow = document.getElementById('live2d-print'); + printNow.innerHTML = print; + printNow.style.display = 'block'; + } + + function cancelPrint() { + var printNow = document.getElementById('live2d-print'); + printNow.innerHTML = ''; + printNow.style.display = 'none'; + } (0, _react.useEffect)(function () { console.log('props', props); @@ -87,8 +170,27 @@ function ReactLive2d(props) { style: canvasStyle, width: props.width ? props.width : '300', height: props.height ? props.height : '500', - className: "live2d" - }))); + className: "live2d", + onMouseEnter: cvMouseOver, + onMouseLeave: cvMouseOut + }), controllerOn && (!props.menuList || props.menuList.length > 0) && /*#__PURE__*/_react["default"].createElement("div", { + className: "live2d-controller", + style: { + position: 'absolute', + top: '20px', + left: '20px' + }, + onMouseEnter: ctMouseOver, + onMouseLeave: ctMouseOut + }, (!props.menuList || props.menuList.indexOf('Mtab') > -1) && /*#__PURE__*/_react["default"].createElement("div", { + className: "iconfont", + style: Theme, + onClick: ctTab, + onMouseEnter: function onMouseEnter() { + return talkPrint('你想要换一个看板娘吗?'); + }, + onMouseLeave: cancelPrint + }, "\uE7CA")))); } var _default = ReactLive2d; diff --git a/Samples/TypeScript/Demo/dist/lappdefine.ts b/Samples/TypeScript/Demo/dist/lappdefine.ts index 3358220..eed634c 100644 --- a/Samples/TypeScript/Demo/dist/lappdefine.ts +++ b/Samples/TypeScript/Demo/dist/lappdefine.ts @@ -30,7 +30,7 @@ export let ResourcesPath = './Resources/'; // モデルの後ろにある背景の画像ファイル export const BackImageName = 'back_class_normal.png'; -// 歯車 +// 切换 export const GearImageName = 'icon_gear.png'; // 終了ボタン @@ -41,7 +41,6 @@ export const PowerImageName = 'CloseNormal.png'; // ディレクトリ名とmodel3.jsonの名前を一致させておくこと // export const ModelDir: string[] = ['Haru', 'Hiyori', 'Mark', 'Natori', 'Rice']; export let ModelDir: string[] = ['Hiyori', 'Haru', 'Rice']; -export const ModelDirSize: number = ModelDir.length; // 外部定義ファイル(json)と合わせる export const MotionGroupIdle = 'Idle'; // アイドリング diff --git a/Samples/TypeScript/Demo/dist/lapplive2dmanager.ts b/Samples/TypeScript/Demo/dist/lapplive2dmanager.ts index 7914297..4b853b2 100644 --- a/Samples/TypeScript/Demo/dist/lapplive2dmanager.ts +++ b/Samples/TypeScript/Demo/dist/lapplive2dmanager.ts @@ -178,7 +178,7 @@ export class LAppLive2DManager { * サンプルアプリケーションではモデルセットの切り替えを行う。 */ public nextScene(): void { - const no: number = (this._sceneIndex + 1) % LAppDefine.ModelDirSize; + const no: number = (this._sceneIndex + 1) % LAppDefine.ModelDir.length; this.changeScene(no); } @@ -198,7 +198,6 @@ export class LAppLive2DManager { // model3.jsonのパスを決定する。 // ディレクトリ名とmodel3.jsonの名前を一致させておくこと。 - // SSR服务端渲染的时候,无法正确读取资源。考虑把一个基础模型录入npm包 const model: string = LAppDefine.ModelDir[index]; const modelPath: string = LAppDefine.ResourcesPath + model + '/'; let modelJsonName: string = LAppDefine.ModelDir[index]; diff --git a/Samples/TypeScript/Demo/dist/lapptexturemanager.ts b/Samples/TypeScript/Demo/dist/lapptexturemanager.ts index 13e98a4..b036d2c 100644 --- a/Samples/TypeScript/Demo/dist/lapptexturemanager.ts +++ b/Samples/TypeScript/Demo/dist/lapptexturemanager.ts @@ -37,11 +37,11 @@ export class LAppTextureManager { } /** - * 画像読み込み + * 图像读取 * - * @param fileName 読み込む画像ファイルパス名 - * @param usePremultiply Premult処理を有効にするか - * @return 画像情報、読み込み失敗時はnullを返す + * @param fileName 读取的图像文件路径名称 + * @param usePremultiply 是否启用Premiult处理 + * @return 图像信息读取失败时返回null */ public createTextureFromPngFile( fileName: string, @@ -58,8 +58,8 @@ export class LAppTextureManager { ite.ptr().fileName == fileName && ite.ptr().usePremultply == usePremultiply ) { - // 2回目以降はキャッシュが使用される(待ち時間なし) - // WebKitでは同じImageのonloadを再度呼ぶには再インスタンスが必要 + // 第二次以后使用缓存(无等待时间) + // 在WebKit中,要再次调用相同Image的onload,需要再次实例 // 詳細:https://stackoverflow.com/a/5024181 ite.ptr().img = new Image(); ite.ptr().img.onload = (): void => callback(ite.ptr()); diff --git a/Samples/TypeScript/Demo/example/src/App.js b/Samples/TypeScript/Demo/example/src/App.js index 57ad275..a1ba90a 100644 --- a/Samples/TypeScript/Demo/example/src/App.js +++ b/Samples/TypeScript/Demo/example/src/App.js @@ -11,7 +11,7 @@ import ReactLive2d from '../../src/index.js'; height={500} bottom={'10px'} right={'10px'} - ModelList={['Hiyori']} + ModelList={['Haru','Hiyori']} TouchBody={['啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊你要干嘛','哼','坏人']} /> diff --git a/Samples/TypeScript/Demo/package-lock.json b/Samples/TypeScript/Demo/package-lock.json index 7cfc416..08c2fc6 100644 --- a/Samples/TypeScript/Demo/package-lock.json +++ b/Samples/TypeScript/Demo/package-lock.json @@ -1,6 +1,6 @@ { "name": "react-live2d", - "version": "1.0.11", + "version": "1.0.18", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -3154,6 +3154,113 @@ "randomfill": "^1.0.3" } }, + "css-loader": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-4.2.2.tgz", + "integrity": "sha512-omVGsTkZPVwVRpckeUnLshPp12KsmMSLqYxs12+RzM9jRR5Y+Idn/tBffjXRvOE+qW7if24cuceFJqYR5FmGBg==", + "dev": true, + "requires": { + "camelcase": "^6.0.0", + "cssesc": "^3.0.0", + "icss-utils": "^4.1.1", + "loader-utils": "^2.0.0", + "postcss": "^7.0.32", + "postcss-modules-extract-imports": "^2.0.0", + "postcss-modules-local-by-default": "^3.0.3", + "postcss-modules-scope": "^2.2.0", + "postcss-modules-values": "^3.0.0", + "postcss-value-parser": "^4.1.0", + "schema-utils": "^2.7.0", + "semver": "^7.3.2" + }, + "dependencies": { + "@types/json-schema": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", + "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", + "dev": true + }, + "ajv": { + "version": "6.12.4", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz", + "integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true + }, + "camelcase": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.0.0.tgz", + "integrity": "sha512-8KMDF1Vz2gzOq54ONPJS65IvTUaB1cHJ2DMM7MbPmLZljDH1qpzzLsWdiN9pHh6qvkRVDTi/07+eNGch/oLU4w==", + "dev": true + }, + "emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "loader-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", + "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "schema-utils": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", + "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.5", + "ajv": "^6.12.4", + "ajv-keywords": "^3.5.2" + } + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true + } + } + }, "css-select": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", @@ -3172,6 +3279,12 @@ "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==", "dev": true }, + "cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true + }, "csstype": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.2.tgz", @@ -5594,6 +5707,15 @@ "safer-buffer": ">= 2.1.2 < 3" } }, + "icss-utils": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-4.1.1.tgz", + "integrity": "sha512-4aFq7wvWyMHKgxsH8QQtGpvbASCf+eM3wPRLI6R+MgAnTCZ6STYsRvttLvRWK0Nfif5piF394St3HeJDaljGPA==", + "dev": true, + "requires": { + "postcss": "^7.0.14" + } + }, "ieee754": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", @@ -5646,6 +5768,12 @@ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, + "indexes-of": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", + "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=", + "dev": true + }, "infer-owner": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", @@ -7090,6 +7218,92 @@ "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", "dev": true }, + "postcss": { + "version": "7.0.32", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", + "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "dev": true, + "requires": { + "chalk": "^2.4.2", + "source-map": "^0.6.1", + "supports-color": "^6.1.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss-modules-extract-imports": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-2.0.0.tgz", + "integrity": "sha512-LaYLDNS4SG8Q5WAWqIJgdHPJrDDr/Lv775rMBFUbgjTz6j34lUznACHcdRWroPvXANP2Vj7yNK57vp9eFqzLWQ==", + "dev": true, + "requires": { + "postcss": "^7.0.5" + } + }, + "postcss-modules-local-by-default": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.3.tgz", + "integrity": "sha512-e3xDq+LotiGesympRlKNgaJ0PCzoUIdpH0dj47iWAui/kyTgh3CiAr1qP54uodmJhl6p9rN6BoNcdEDVJx9RDw==", + "dev": true, + "requires": { + "icss-utils": "^4.1.1", + "postcss": "^7.0.32", + "postcss-selector-parser": "^6.0.2", + "postcss-value-parser": "^4.1.0" + } + }, + "postcss-modules-scope": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-2.2.0.tgz", + "integrity": "sha512-YyEgsTMRpNd+HmyC7H/mh3y+MeFWevy7V1evVhJWewmMbjDHIbZbOXICC2y+m1xI1UVfIT1HMW/O04Hxyu9oXQ==", + "dev": true, + "requires": { + "postcss": "^7.0.6", + "postcss-selector-parser": "^6.0.0" + } + }, + "postcss-modules-values": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-3.0.0.tgz", + "integrity": "sha512-1//E5jCBrZ9DmRX+zCtmQtRSV6PV42Ix7Bzj9GbwJceduuf7IqP8MgeTXuRDHOWj2m0VzZD5+roFWDuU8RQjcg==", + "dev": true, + "requires": { + "icss-utils": "^4.0.0", + "postcss": "^7.0.6" + } + }, + "postcss-selector-parser": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.2.tgz", + "integrity": "sha512-36P2QR59jDTOAiIkqEprfJDsoNrvwFei3eCqKd1Y0tUsBimsq39BLp7RD+JWny3WgB1zGhJX8XVePwm9k4wdBg==", + "dev": true, + "requires": { + "cssesc": "^3.0.0", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + }, + "postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "dev": true + }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -8523,6 +8737,91 @@ "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true }, + "style-loader": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-1.2.1.tgz", + "integrity": "sha512-ByHSTQvHLkWE9Ir5+lGbVOXhxX10fbprhLvdg96wedFZb4NDekDPxVKv5Fwmio+QcMlkkNfuK+5W1peQ5CUhZg==", + "dev": true, + "requires": { + "loader-utils": "^2.0.0", + "schema-utils": "^2.6.6" + }, + "dependencies": { + "@types/json-schema": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", + "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", + "dev": true + }, + "ajv": { + "version": "6.12.4", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz", + "integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true + }, + "emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "loader-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", + "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "schema-utils": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", + "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.5", + "ajv": "^6.12.4", + "ajv-keywords": "^3.5.2" + } + } + } + }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -8867,6 +9166,12 @@ "set-value": "^2.0.1" } }, + "uniq": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", + "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", + "dev": true + }, "unique-filename": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", diff --git a/Samples/TypeScript/Demo/package.json b/Samples/TypeScript/Demo/package.json index 6057573..b3c64e4 100644 --- a/Samples/TypeScript/Demo/package.json +++ b/Samples/TypeScript/Demo/package.json @@ -13,7 +13,7 @@ }, "main": "dist/bundle.js", "name": "react-live2d", - "version": "1.0.18", + "version": "1.0.19", "description": "live2D 看板娘", "author": { "name": "DS", @@ -39,6 +39,7 @@ "@typescript-eslint/eslint-plugin": "^2.18.0", "@typescript-eslint/parser": "^2.18.0", "babel-loader": "^8.1.0", + "css-loader": "^4.2.2", "eslint": "^6.8.0", "eslint-config-prettier": "^6.10.0", "eslint-plugin-prettier": "^3.1.2", @@ -48,6 +49,7 @@ "react-dom": "^16.13.1", "rimraf": "^3.0.1", "serve": "^11.3.0", + "style-loader": "^1.2.1", "ts-loader": "^6.2.1", "typescript": "^3.7.5", "url-loader": "^4.1.0", diff --git a/Samples/TypeScript/Demo/src/asset/index.css b/Samples/TypeScript/Demo/src/asset/index.css new file mode 100644 index 0000000..153535b --- /dev/null +++ b/Samples/TypeScript/Demo/src/asset/index.css @@ -0,0 +1,19 @@ +@font-face { + font-family: 'iconfont'; /* project id 1168737 */ + src: url('//at.alicdn.com/t/font_1168737_j6ahlsx1dk.eot'); + src: url('//at.alicdn.com/t/font_1168737_j6ahlsx1dk.eot?#iefix') format('embedded-opentype'), + url('//at.alicdn.com/t/font_1168737_j6ahlsx1dk.woff2') format('woff2'), + url('//at.alicdn.com/t/font_1168737_j6ahlsx1dk.woff') format('woff'), + url('//at.alicdn.com/t/font_1168737_j6ahlsx1dk.ttf') format('truetype'), + url('//at.alicdn.com/t/font_1168737_j6ahlsx1dk.svg#iconfont') format('svg'); + } + +.iconfont{ + font-family:"iconfont" !important; + font-size:16px;font-style:normal; + -webkit-font-smoothing: antialiased; + -webkit-text-stroke-width: 0.2px; + -moz-osx-font-smoothing: grayscale; + cursor: pointer; +} + diff --git a/Samples/TypeScript/Demo/src/index.js b/Samples/TypeScript/Demo/src/index.js index 132940c..cddb52d 100644 --- a/Samples/TypeScript/Demo/src/index.js +++ b/Samples/TypeScript/Demo/src/index.js @@ -1,8 +1,11 @@ import { LAppDelegate } from './lappdelegate'; +import { LAppLive2DManager } from './lapplive2dmanager'; import * as LAppDefine from './lappdefine'; import React, { useState, useEffect } from 'react'; +import './asset/index.css' function ReactLive2d(props) { + // 好看颜色列表 // green: '#B4DEAE', // DeepBlue: '#5B8DBE', @@ -11,7 +14,7 @@ function ReactLive2d(props) { // 容器样式 let containerStyle = { - position : 'fixed', + position: 'fixed', top: props.top ? props.top : '', right: props.right ? props.right : '0', bottom: props.bottom ? props.bottom : '0', @@ -19,7 +22,7 @@ function ReactLive2d(props) { } // canvas样式 let canvasStyle = { - position : 'relative', + position: 'relative', top: props.top ? props.top : '', right: props.right ? props.right : '0', bottom: props.bottom ? props.bottom : '0', @@ -28,8 +31,8 @@ function ReactLive2d(props) { // 对话框样式 let printStyle = { position: 'absolute', - width: props.width > 300 ? props.width/2 : '150px', - left: props.width > 300 ? (props.width - props.width/2)/2 + 'px' : (props.width-150)/2 + 'px', + width: props.width > 300 ? props.width / 2 : '150px', + left: props.width > 300 ? (props.width - props.width / 2) / 2 + 'px' : (props.width - 150) / 2 + 'px', top: '0', minHeight: '20px', display: 'block', @@ -40,23 +43,82 @@ function ReactLive2d(props) { display: 'none', } + // 面板主题样式 + let Theme = { + color: props.color ? props.color : '#C8E6FE', + width: '30px', + height: '30px', + } + + let timer = null; + + const [controllerOn, setControllerOn] = useState(false) + + const [controllerIn, setControllerIn] = useState(false) + + const [printMenu, setPrintMenu] = useState(false) + + // 进入显示控制台 + function cvMouseOver() { + setControllerOn(true) + } + + function cvMouseOut() { + timer = setTimeout(() => { + // 0.01秒内没有进入点击面板,说明已经鼠标离开 + if (!controllerIn) { + setControllerOn(false) + setControllerIn(false) + } + }, 10); + } + + // 进入选择菜单 + function ctMouseOver() { + setControllerIn(true) + clearTimeout(timer) + } + + // 离开选择菜单 + function ctMouseOut() { + setControllerIn(false) + } + + //切换 + function ctTab() { + LAppLive2DManager.getInstance().nextScene(); + } + + // 悬停菜单时的对白 + function talkPrint(print) { + let printNow = document.getElementById('live2d-print'); + printNow.innerHTML = print; + printNow.style.display = 'block'; + } + + function cancelPrint() { + let printNow = document.getElementById('live2d-print'); + printNow.innerHTML = ''; + printNow.style.display = 'none'; + } + useEffect(() => { console.log('props', props) - + props.ModelList ? LAppDefine.lappdefineSet.setModelDir(props.ModelList) : LAppDefine.lappdefineSet.setModelDir([]) props.TouchBody ? LAppDefine.lappdefineSet.setHitBody(props.TouchBody) : LAppDefine.lappdefineSet.setHitBody([]) props.TouchHead ? LAppDefine.lappdefineSet.setHitHead(props.TouchHead) : LAppDefine.lappdefineSet.setHitHead([]) props.PathFull ? LAppDefine.lappdefineSet.setPathFull(props.PathFull) : LAppDefine.lappdefineSet.setPathFull('') - if (!navigator.userAgent.match(/mobile/i) || props.MobileShow==true) { - + if (!navigator.userAgent.match(/mobile/i) || props.MobileShow == true) { + if (LAppDelegate.getInstance().initialize() == false) { return; } - + LAppDelegate.getInstance().run(); - - + + window.onbeforeunload = () => LAppDelegate.releaseInstance(); } @@ -65,10 +127,10 @@ function ReactLive2d(props) { return (
+ style={containerStyle} + width={props.width ? props.width : '300'} + height={props.height ? props.height : '500'} + id="live2d-container">
@@ -78,7 +140,33 @@ function ReactLive2d(props) { width={props.width ? props.width : '300'} height={props.height ? props.height : '500'} className="live2d" - > + onMouseEnter={cvMouseOver} + onMouseLeave={cvMouseOut} + > + + + {controllerOn && (!props.menuList || props.menuList.length>0) && +
+ {(!props.menuList || props.menuList.indexOf('Mtab')>-1) && +
talkPrint('你想要换一个看板娘吗?')} + onMouseLeave={cancelPrint} + >
+ } +
+ }
) diff --git a/Samples/TypeScript/Demo/src/lappdefine.ts b/Samples/TypeScript/Demo/src/lappdefine.ts index 3358220..eed634c 100644 --- a/Samples/TypeScript/Demo/src/lappdefine.ts +++ b/Samples/TypeScript/Demo/src/lappdefine.ts @@ -30,7 +30,7 @@ export let ResourcesPath = './Resources/'; // モデルの後ろにある背景の画像ファイル export const BackImageName = 'back_class_normal.png'; -// 歯車 +// 切换 export const GearImageName = 'icon_gear.png'; // 終了ボタン @@ -41,7 +41,6 @@ export const PowerImageName = 'CloseNormal.png'; // ディレクトリ名とmodel3.jsonの名前を一致させておくこと // export const ModelDir: string[] = ['Haru', 'Hiyori', 'Mark', 'Natori', 'Rice']; export let ModelDir: string[] = ['Hiyori', 'Haru', 'Rice']; -export const ModelDirSize: number = ModelDir.length; // 外部定義ファイル(json)と合わせる export const MotionGroupIdle = 'Idle'; // アイドリング diff --git a/Samples/TypeScript/Demo/src/lapplive2dmanager.ts b/Samples/TypeScript/Demo/src/lapplive2dmanager.ts index 7914297..4b853b2 100644 --- a/Samples/TypeScript/Demo/src/lapplive2dmanager.ts +++ b/Samples/TypeScript/Demo/src/lapplive2dmanager.ts @@ -178,7 +178,7 @@ export class LAppLive2DManager { * サンプルアプリケーションではモデルセットの切り替えを行う。 */ public nextScene(): void { - const no: number = (this._sceneIndex + 1) % LAppDefine.ModelDirSize; + const no: number = (this._sceneIndex + 1) % LAppDefine.ModelDir.length; this.changeScene(no); } @@ -198,7 +198,6 @@ export class LAppLive2DManager { // model3.jsonのパスを決定する。 // ディレクトリ名とmodel3.jsonの名前を一致させておくこと。 - // SSR服务端渲染的时候,无法正确读取资源。考虑把一个基础模型录入npm包 const model: string = LAppDefine.ModelDir[index]; const modelPath: string = LAppDefine.ResourcesPath + model + '/'; let modelJsonName: string = LAppDefine.ModelDir[index]; diff --git a/Samples/TypeScript/Demo/src/lapptexturemanager.ts b/Samples/TypeScript/Demo/src/lapptexturemanager.ts index 13e98a4..b036d2c 100644 --- a/Samples/TypeScript/Demo/src/lapptexturemanager.ts +++ b/Samples/TypeScript/Demo/src/lapptexturemanager.ts @@ -37,11 +37,11 @@ export class LAppTextureManager { } /** - * 画像読み込み + * 图像读取 * - * @param fileName 読み込む画像ファイルパス名 - * @param usePremultiply Premult処理を有効にするか - * @return 画像情報、読み込み失敗時はnullを返す + * @param fileName 读取的图像文件路径名称 + * @param usePremultiply 是否启用Premiult处理 + * @return 图像信息读取失败时返回null */ public createTextureFromPngFile( fileName: string, @@ -58,8 +58,8 @@ export class LAppTextureManager { ite.ptr().fileName == fileName && ite.ptr().usePremultply == usePremultiply ) { - // 2回目以降はキャッシュが使用される(待ち時間なし) - // WebKitでは同じImageのonloadを再度呼ぶには再インスタンスが必要 + // 第二次以后使用缓存(无等待时间) + // 在WebKit中,要再次调用相同Image的onload,需要再次实例 // 詳細:https://stackoverflow.com/a/5024181 ite.ptr().img = new Image(); ite.ptr().img.onload = (): void => callback(ite.ptr()); diff --git a/Samples/TypeScript/Demo/tsconfig.json b/Samples/TypeScript/Demo/tsconfig.json index 981f09b..3ffa78a 100644 --- a/Samples/TypeScript/Demo/tsconfig.json +++ b/Samples/TypeScript/Demo/tsconfig.json @@ -3,7 +3,7 @@ "target": "es5", "moduleResolution": "node", "esModuleInterop": true, - "experimentalDecorators": true, + "experimentalDecorators": false, "forceConsistentCasingInFileNames": true, "outDir": "./dist", "removeComments": true, diff --git a/Samples/TypeScript/Demo/webpack.config.js b/Samples/TypeScript/Demo/webpack.config.js index aa67279..026a766 100644 --- a/Samples/TypeScript/Demo/webpack.config.js +++ b/Samples/TypeScript/Demo/webpack.config.js @@ -58,11 +58,16 @@ module.exports = { } }, { - test:/\.(png|jpe?g|gif|svg)(\?.*)?$/, + test:/\.(png|jpe?g|gif|svg|ttf|eot|woff|woff2)(\?.*)?$/, exclude: /node_modules/, use: { loader: "url-loader" } + }, + { + test:/\.css$/, + exclude: /node_modules/, + use: ['style-loader', 'css-loader'] } ] }, diff --git a/img/example.png b/img/example.png index a1abb1b..75b48c5 100644 Binary files a/img/example.png and b/img/example.png differ