UNPKG

minecraft-skin-render

Version:

我的世界皮肤渲染插件, 需要Three.js 作为前置支持, 兼容人类浏览器+IE11

1 lines 38.7 kB
!function(t){var e={};function n(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,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=27)}([function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(10)("wks"),o=n(11),a=n(0).Symbol,i="function"==typeof a;(t.exports=function(t){return r[t]||(r[t]=i&&a[t]||(i?a:o)("Symbol."+t))}).store=r},function(t,e){var n=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(4);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){t.exports=!n(14)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(8);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var r=n(5),o=n(1)("toStringTag"),a="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),o))?n:a?r(e):"Object"==(i=r(e))&&"function"==typeof e.callee?"Arguments":i}},function(t,e,n){var r=n(2),o=n(0),a=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(17)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){var r=n(0),o=n(18),a=n(15),i=n(11)("src"),c=n(33),u=(""+c).split("toString");n(2).inspectSource=function(t){return c.call(t)},(t.exports=function(t,e,n,c){var s="function"==typeof n;s&&(a(n,"name")||o(n,"name",e)),t[e]!==n&&(s&&(a(n,i)||o(n,i,t[e]?""+t[e]:u.join(String(e)))),t===r?t[e]=n:c?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[i]||c.call(this)}))},function(t,e,n){var r=n(3),o=n(30),a=n(31),i=Object.defineProperty;e.f=n(6)?Object.defineProperty:function(t,e,n){if(r(t),e=a(e,!0),r(n),o)try{return i(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(0),o=n(2),a=n(18),i=n(12),c=n(7),u=function(t,e,n){var s,h,f,l,d=t&u.F,y=t&u.G,p=t&u.S,v=t&u.P,w=t&u.B,m=y?r:p?r[e]||(r[e]={}):(r[e]||{}).prototype,x=y?o:o[e]||(o[e]={}),g=x.prototype||(x.prototype={});for(s in y&&(n=e),n)f=((h=!d&&m&&void 0!==m[s])?m:n)[s],l=w&&h?c(f,r):v&&"function"==typeof f?c(Function.call,f):f,m&&i(m,s,f,t&u.U),x[s]!=f&&a(x,s,l),v&&g[s]!=f&&(g[s]=f)};r.core=o,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e){t.exports=!1},function(t,e,n){var r=n(13),o=n(32);t.exports=n(6)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(4),o=n(0).document,a=r(o)&&r(o.createElement);t.exports=function(t){return a?o.createElement(t):{}}},function(t,e){t.exports={}},function(t,e,n){var r=n(22),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r,o,a,i=n(7),c=n(41),u=n(42),s=n(19),h=n(0),f=h.process,l=h.setImmediate,d=h.clearImmediate,y=h.MessageChannel,p=h.Dispatch,v=0,w={},m=function(){var t=+this;if(w.hasOwnProperty(t)){var e=w[t];delete w[t],e()}},x=function(t){m.call(t.data)};l&&d||(l=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return w[++v]=function(){c("function"==typeof t?t:Function(t),e)},r(v),v},d=function(t){delete w[t]},"process"==n(5)(f)?r=function(t){f.nextTick(i(m,t,1))}:p&&p.now?r=function(t){p.now(i(m,t,1))}:y?(a=(o=new y).port2,o.port1.onmessage=x,r=i(a.postMessage,a,1)):h.addEventListener&&"function"==typeof postMessage&&!h.importScripts?(r=function(t){h.postMessage(t+"","*")},h.addEventListener("message",x,!1)):r="onreadystatechange"in s("script")?function(t){u.appendChild(s("script")).onreadystatechange=function(){u.removeChild(this),m.call(t)}}:function(t){setTimeout(i(m,t,1),0)}),t.exports={set:l,clear:d}},function(t,e,n){"use strict";var r=n(8);function o(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)}t.exports.f=function(t){return new o(t)}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(55),o=n(25);t.exports=function(t){return r(o(t))}},function(t,e,n){"use strict";n.r(e);var r;n(28),n(29),n(34),n(51),n(61);function o(t,e,n,r,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function a(t){return function(){var e=this,n=arguments;return new Promise((function(r,a){var i=t.apply(e,n);function c(t){o(i,r,a,c,u,"next",t)}function u(t){o(i,r,a,c,u,"throw",t)}c(void 0)}))}}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}r=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.TAU=2*Math.PI,this.EPSILON=.001,this.skinLayout=[{head:[{l:{x:16,y:8,w:8,h:8},r:{x:0,y:8,w:8,h:8},u:{x:8,y:0,w:8,h:8},d:{x:16,y:7,w:8,h:-8},f:{x:8,y:8,w:8,h:8},b:{x:24,y:8,w:8,h:8}},{l:{x:48,y:8,w:8,h:8},r:{x:32,y:8,w:8,h:8},u:{x:40,y:0,w:8,h:8},d:{x:48,y:7,w:8,h:-8},f:{x:40,y:8,w:8,h:8},b:{x:56,y:8,w:8,h:8}}],torso:[{l:{x:28,y:20,w:4,h:12},r:{x:16,y:20,w:4,h:12},u:{x:20,y:16,w:8,h:4},d:{x:28,y:19,w:8,h:-4},f:{x:20,y:20,w:8,h:12},b:{x:32,y:20,w:8,h:12}}],armR:[{l:{x:48,y:20,w:4,h:12},r:{x:40,y:20,w:4,h:12},u:{x:44,y:16,w:4,h:4},d:{x:48,y:19,w:4,h:-4},f:{x:44,y:20,w:4,h:12},b:{x:52,y:20,w:4,h:12}}],armRS:[{l:{x:47,y:20,w:4,h:12},r:{x:40,y:20,w:4,h:12},u:{x:44,y:16,w:3,h:4},d:{x:47,y:19,w:3,h:-4},f:{x:44,y:20,w:3,h:12},b:{x:51,y:20,w:3,h:12}}],armL:[{l:{x:43,y:20,w:-4,h:12},r:{x:51,y:20,w:-4,h:12},u:{x:47,y:16,w:-4,h:4},d:{x:51,y:19,w:-4,h:-4},f:{x:47,y:20,w:-4,h:12},b:{x:55,y:20,w:-4,h:12}}],armLS:[{l:{x:43,y:20,w:-4,h:12},r:{x:50,y:20,w:-4,h:12},u:{x:46,y:16,w:-3,h:4},d:{x:49,y:19,w:-3,h:-4},f:{x:46,y:20,w:-3,h:12},b:{x:53,y:20,w:-3,h:12}}],legR:[{l:{x:8,y:20,w:4,h:12},r:{x:0,y:20,w:4,h:12},u:{x:4,y:16,w:4,h:4},d:{x:8,y:19,w:4,h:-4},f:{x:4,y:20,w:4,h:12},b:{x:12,y:20,w:4,h:12}}],legL:[{l:{x:3,y:20,w:-4,h:12},r:{x:11,y:20,w:-4,h:12},u:{x:7,y:16,w:-4,h:4},d:{x:11,y:19,w:-4,h:-4},f:{x:7,y:20,w:-4,h:12},b:{x:15,y:20,w:-4,h:12}}]},{head:[{l:{x:16,y:8,w:8,h:8},r:{x:0,y:8,w:8,h:8},u:{x:8,y:0,w:8,h:8},d:{x:16,y:7,w:8,h:-8},f:{x:8,y:8,w:8,h:8},b:{x:24,y:8,w:8,h:8}},{l:{x:48,y:8,w:8,h:8},r:{x:32,y:8,w:8,h:8},u:{x:40,y:0,w:8,h:8},d:{x:48,y:7,w:8,h:-8},f:{x:40,y:8,w:8,h:8},b:{x:56,y:8,w:8,h:8}}],torso:[{l:{x:28,y:20,w:4,h:12},r:{x:16,y:20,w:4,h:12},u:{x:20,y:16,w:8,h:4},d:{x:28,y:19,w:8,h:-4},f:{x:20,y:20,w:8,h:12},b:{x:32,y:20,w:8,h:12}},{l:{x:28,y:36,w:4,h:12},r:{x:16,y:36,w:4,h:12},u:{x:20,y:32,w:8,h:4},d:{x:28,y:35,w:8,h:-4},f:{x:20,y:36,w:8,h:12},b:{x:32,y:36,w:8,h:12}}],armR:[{l:{x:48,y:20,w:4,h:12},r:{x:40,y:20,w:4,h:12},u:{x:44,y:16,w:4,h:4},d:{x:48,y:19,w:4,h:-4},f:{x:44,y:20,w:4,h:12},b:{x:52,y:20,w:4,h:12}},{l:{x:48,y:36,w:4,h:12},r:{x:40,y:36,w:4,h:12},u:{x:44,y:32,w:4,h:4},d:{x:48,y:35,w:4,h:-4},f:{x:44,y:36,w:4,h:12},b:{x:52,y:36,w:4,h:12}}],armRS:[{l:{x:47,y:20,w:4,h:12},r:{x:40,y:20,w:4,h:12},u:{x:44,y:16,w:3,h:4},d:{x:47,y:19,w:3,h:-4},f:{x:44,y:20,w:3,h:12},b:{x:51,y:20,w:3,h:12}},{l:{x:47,y:36,w:4,h:12},r:{x:40,y:36,w:4,h:12},u:{x:44,y:32,w:3,h:4},d:{x:47,y:35,w:3,h:-4},f:{x:44,y:36,w:3,h:12},b:{x:51,y:36,w:3,h:12}}],armL:[{l:{x:40,y:52,w:4,h:12},r:{x:32,y:52,w:4,h:12},u:{x:36,y:48,w:4,h:4},d:{x:40,y:51,w:4,h:-4},f:{x:36,y:52,w:4,h:12},b:{x:44,y:52,w:4,h:12}},{l:{x:56,y:52,w:4,h:12},r:{x:48,y:52,w:4,h:12},u:{x:52,y:48,w:4,h:4},d:{x:56,y:51,w:4,h:-4},f:{x:52,y:52,w:4,h:12},b:{x:60,y:52,w:4,h:12}}],armLS:[{l:{x:39,y:52,w:4,h:12},r:{x:32,y:52,w:4,h:12},u:{x:36,y:48,w:3,h:4},d:{x:39,y:51,w:3,h:-4},f:{x:36,y:52,w:3,h:12},b:{x:43,y:52,w:3,h:12}},{l:{x:55,y:52,w:4,h:12},r:{x:48,y:52,w:4,h:12},u:{x:52,y:48,w:3,h:4},d:{x:55,y:51,w:3,h:-4},f:{x:52,y:52,w:3,h:12},b:{x:59,y:52,w:3,h:12}}],legR:[{l:{x:8,y:20,w:4,h:12},r:{x:0,y:20,w:4,h:12},u:{x:4,y:16,w:4,h:4},d:{x:8,y:19,w:4,h:-4},f:{x:4,y:20,w:4,h:12},b:{x:12,y:20,w:4,h:12}},{l:{x:8,y:36,w:4,h:12},r:{x:0,y:36,w:4,h:12},u:{x:4,y:32,w:4,h:4},d:{x:8,y:35,w:4,h:-4},f:{x:4,y:36,w:4,h:12},b:{x:12,y:36,w:4,h:12}}],legL:[{l:{x:24,y:52,w:4,h:12},r:{x:16,y:52,w:4,h:12},u:{x:20,y:48,w:4,h:4},d:{x:24,y:51,w:4,h:-4},f:{x:20,y:52,w:4,h:12},b:{x:28,y:52,w:4,h:12}},{l:{x:8,y:52,w:4,h:12},r:{x:0,y:52,w:4,h:12},u:{x:4,y:48,w:4,h:4},d:{x:8,y:51,w:4,h:-4},f:{x:4,y:52,w:4,h:12},b:{x:12,y:52,w:4,h:12}}]}]}var e,n,r;return e=t,(n=[{key:"loadImage",value:function(t){return new Promise((function(e,n){var r=new Image;r.src=t,r.addEventListener("load",(function(t){e({image:r,event:t})})),r.addEventListener("error",n)}))}},{key:"toCanvas",value:function(t,e,n,r,o){e=void 0===e?0:e,n=void 0===n?0:n,r=void 0===r?t.width:r,o=void 0===o?t.height:o;var a=document.createElement("canvas");return a.width=r,a.height=o,a.getContext("2d").drawImage(t,e,n,r,o,0,0,r,o),a}},{key:"makeOpaque",value:function(t){for(var e=this.toCanvas(t),n=e.getContext("2d"),r=n.getImageData(0,0,e.width,e.height),o=r.data,a=3;a<o.length;a+=4)o[a]=255;return n.putImageData(r,0,0),e}},{key:"hasAlphaLayer",value:function(t){for(var e=this.toCanvas(t),n=e.getContext("2d").getImageData(0,0,e.width,e.height).data,r=3;r<n.length;r+=4)if(255!==n[r])return!0;return!1}},{key:"capeScale",value:function(t){return t%22==0?t/22:t%17==0?t/17:t>=32&&0==(t&t-1)?t/32:Math.max(1,Math.floor(t/22))}},{key:"colorFaces",value:function(t,e,n){if(!n)return null;var r=e.getContext("2d").getImageData(0,0,e.width,e.height).data,o=0,a=[],i=[],c={},u=THREE.FrontSide;return Object.keys(n).forEach((function(s){for(var h=n[s],f=Math.abs(h.w),l=Math.abs(h.h),d=Math.sign(h.w),y=Math.sign(h.h),p=0,v=h.y;p<l;p++,v+=y)for(var w=0,m=h.x;w<f;w++,m+=d,o+=2){var x=4*(v*e.width+m),g=r[x+3];if(0!==g){var b=c[g];void 0===b&&(i.push(new THREE.MeshLambertMaterial({vertexColors:THREE.FaceColors,opacity:g/255,transparent:255!==g})),b=i.length-1,c[g]=b,255!==g&&(u=THREE.DoubleSide));var E=t.faces[o],_=t.faces[o+1];E.color.r=r[x]/255,E.color.g=r[x+1]/255,E.color.b=r[x+2]/255,_.color=E.color,E.materialIndex=b,_.materialIndex=b,a.push(E),a.push(_)}else u=THREE.DoubleSide}})),0===a.length?null:(t.faces=a,i.forEach((function(t){t.side=u})),new THREE.Mesh((new THREE.BufferGeometry).fromGeometry(t),i))}},{key:"buildMinecraftModel",value:function(t,e,n,r){if(t.width<64||t.height<32)return null;var o=this.skinLayout,a=this.EPSILON,i=t.height>=64?1:0,c=e?this.capeScale(e.height):null,u=this.makeOpaque(t),s=this.toCanvas(t),h=this.hasAlphaLayer(t),f=new THREE.Object3D;f.position.x=0,f.position.y=12,f.position.z=0;var l=new THREE.BoxGeometry(8,8,8,8,8,8),d=this.colorFaces(l,u,o[i].head[0]);if(f.add(d),h){l=new THREE.BoxGeometry(9,9,9,8,8,8);var y=this.colorFaces(l,s,o[i].head[1]);y&&f.add(y)}var p=new THREE.Object3D;p.position.x=0,p.position.y=2,p.position.z=0,l=new THREE.BoxGeometry(8+a,12+a,4+a,8,12,4);var v=this.colorFaces(l,u,o[i].torso[0]);if(p.add(v),i>=1&&h){l=new THREE.BoxGeometry(8.5+a,12.5+a,4.5+a,8,12,4);var w=this.colorFaces(l,s,o[i].torso[1]);w&&p.add(w)}var m,x,g=new THREE.Object3D;g.position.x=n?-5.5:-6,g.position.y=6,g.position.z=0,n?(l=new THREE.BoxGeometry(3,12,4,3,12,4).translate(0,-4,0),m=this.colorFaces(l,u,o[i].armRS[0])):(l=new THREE.BoxGeometry(4,12,4,4,12,4).translate(0,-4,0),m=this.colorFaces(l,u,o[i].armR[0])),g.add(m),i>=1&&h&&(n?(l=new THREE.BoxGeometry(3.5+4*a,12.5+4*a,4.5+4*a,3,12,4).translate(0,-4,0),x=this.colorFaces(l,s,o[i].armRS[1])):(l=new THREE.BoxGeometry(4.5+4*a,12.5+4*a,4.5+4*a,4,12,4).translate(0,-4,0),x=this.colorFaces(l,s,o[i].armR[1])),x&&g.add(x));var b,E,_=new THREE.Object3D;_.position.x=n?5.5:6,_.position.y=6,_.position.z=0,n?(l=new THREE.BoxGeometry(3,12,4,3,12,4).translate(0,-4,0),b=this.colorFaces(l,u,o[i].armLS[0])):(l=new THREE.BoxGeometry(4,12,4,4,12,4).translate(0,-4,0),b=this.colorFaces(l,u,o[i].armL[0])),_.add(b),i>=1&&h&&(n?(l=new THREE.BoxGeometry(3.5+4*a,12.5+4*a,4.5+4*a,3,12,4).translate(0,-4,0),E=this.colorFaces(l,s,o[i].armLS[1])):(l=new THREE.BoxGeometry(4.5+4*a,12.5+4*a,4.5+4*a,4,12,4).translate(0,-4,0),E=this.colorFaces(l,s,o[i].armL[1])),E&&_.add(E));var R=new THREE.Object3D;R.position.x=-2,R.position.y=-4,R.position.z=0,l=new THREE.BoxGeometry(4,12,4,4,12,4).translate(0,-6,0);var T=this.colorFaces(l,u,o[i].legR[0]);if(R.add(T),i>=1&&h){l=new THREE.BoxGeometry(4.5+2*a,12.5+2*a,4.5+2*a,4,12,4).translate(0,-6,0);var S=this.colorFaces(l,s,o[i].legR[1]);S&&R.add(S)}var k=new THREE.Object3D;k.position.x=2,k.position.y=-4,k.position.z=0,l=new THREE.BoxGeometry(4,12,4,4,12,4).translate(0,-6,0);var j=this.colorFaces(l,u,o[i].legL[0]);if(k.add(j),i>=1&&h){l=new THREE.BoxGeometry(4.5+3*a,12.5+3*a,4.5+3*a,4,12,4).translate(0,-6,0);var L=this.colorFaces(l,s,o[i].legL[1]);L&&k.add(L)}var O=new THREE.Object3D;if(O.add(f),O.add(p),O.add(g),O.add(_),O.add(R),O.add(k),e){var P,I=makeOpaque(e),H=new THREE.Object3D;H.position.x=0,H.position.y=8,H.position.z=-2,H.rotation.y+=radians(180),l=new THREE.BoxGeometry(10,16,1,10*c,16*c,c).translate(0,-8,.5),P=this.colorFaces(l,I,{left:{x:11*c,y:c,w:c,h:16*c},right:{x:0,y:c,w:c,h:16*c},top:{x:c,y:0,w:10*c,h:c},bottom:{x:11*c,y:c-1,w:10*c,h:-c},front:{x:c,y:c,w:10*c,h:16*c},back:{x:12*c,y:c,w:10*c,h:16*c}}),H.add(P),O.add(H)}return r&&(O.rotation.z+=radians(180)),O}},{key:"radians",value:function(t){return t*(this.TAU/360)}},{key:"animate",value:function(t){t.timestamp=Date.now(),window.requestAnimationFrame(this.renderAnimation.bind(this,t))}},{key:"renderAnimation",value:function(t){if(t.animate){var e=Date.now();t.time+=.24*(e-t.timestamp),t.timestamp=e,this.render(t),window.requestAnimationFrame(this.renderAnimation.bind(this,t))}}},{key:"enableRotation",value:function(t){var e=this,n=function(e,n){t.dragState[n]={x:e.screenX,y:e.screenY}},r=function(n,r){if(!t.dragState[r])return!1;var o=!0;return t.theta+=n.screenX-t.dragState[r].x,t.phi+=n.screenY-t.dragState[r].y,t.phi<-90?(t.phi=-90,o=!1):t.phi>90&&(t.phi=90,o=!1),t.model.rotation.y=e.radians(t.theta),t.model.rotation.x=e.radians(t.phi),t.renderer.render(t.scene,t.camera),t.dragState[r].x=n.screenX,t.dragState[r].y=n.screenY,o},o=function(e,n){delete t.dragState[n]};t.canvas.addEventListener("mousedown",(function(t){t.preventDefault(),n(t,"mouse")})),window.addEventListener("mousemove",(function(t){r(t,"mouse")})),window.addEventListener("mouseup",(function(t){o(0,"mouse")})),t.canvas.ontouchstart=function(t){for(var e=0;e<t.changedTouches.length;e++)n(t.changedTouches[e],t.changedTouches[e].identifier)},t.canvas.ontouchmove=function(e){for(var n=!1,o=0;o<e.changedTouches.length;o++)r(e.changedTouches[o],e.changedTouches[o].identifier)?n=!0:delete t.dragState[e.changedTouches[o].identifier];n&&e.preventDefault()},t.canvas.ontouchend=t.canvas.ontouchcancel=function(t){for(var e=0;e<t.changedTouches.length;e++)o(t.changedTouches[e],t.changedTouches[e].identifier)}}},{key:"render",value:function(t){var e=Math.sin(this.radians(t.time));if(t.model.children[2].rotation.x=-this.radians(18)*e,t.model.children[3].rotation.x=this.radians(18)*e,t.model.children[4].rotation.x=this.radians(20)*e,t.model.children[5].rotation.x=-this.radians(20)*e,t.model.children[6]){var n=Math.sin(this.radians(t.time/4));t.model.children[6].rotation.x=this.radians(18)-this.radians(6)*n}t.renderer.render(t.scene,t.camera),t.canvas!==t.renderer.domElement&&t.canvas.getContext("2d").drawImage(t.renderer.domElement,0,0)}},{key:"avatar",value:function(t,e){var n=this;return new Promise(function(){var r=a(regeneratorRuntime.mark((function r(o,a){var i,c,u,s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,t){r.next=3;break}throw new Error("丢失 canvas 容器");case 3:if(e||(e=t.getAttribute("data-skin")),e){r.next=6;break}throw new Error("未指定皮肤资源");case 6:return r.next=8,n.loadImage(e);case 8:i=r.sent,c=i.image,u=n.makeOpaque(c),(s=t.getContext("2d")).mozImageSmoothingEnabled=!1,s.webkitImageSmoothingEnabled=!1,s.msImageSmoothingEnabled=!1,s.imageSmoothingEnabled=!1,s.drawImage(u,8,8,8,8,0,0,t.width,t.height),n.hasAlphaLayer(c)&&s.drawImage(c,40,8,8,8,0,0,t.width,t.height),o({canvas:t,base64:t.toDataURL("image/png",1)}),r.next=24;break;case 21:r.prev=21,r.t0=r.catch(0),a(r.t0);case 24:case"end":return r.stop()}}),r,null,[[0,21]])})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"skin2d",value:function(t,e){var n=this;return new Promise(function(){var r=a(regeneratorRuntime.mark((function r(o,a){var i,c,u,s,h,f;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,t){r.next=3;break}throw new Error("丢失 canvas 容器");case 3:if(e||(e=t.getAttribute("data-skin")),e){r.next=6;break}throw new Error("未指定皮肤资源");case 6:return r.next=8,n.loadImage(e);case 8:i=r.sent,c=i.image,u=n.makeOpaque(c),(s=t.getContext("2d")).save(),s.mozImageSmoothingEnabled=!1,s.webkitImageSmoothingEnabled=!1,s.msImageSmoothingEnabled=!1,s.imageSmoothingEnabled=!1,s.translate(t.width/2,t.height/2),h=Math.min(Math.floor(t.width/16),Math.floor(t.height/32))-1,s.scale(h,h),s.drawImage(u,8,8,8,8,-4,-16,8,8),s.drawImage(u,20,20,8,12,-4,-8,8,12),s.drawImage(u,44,20,4,12,-8,-8,4,12),0==(f=c.height>=64?1:0)?(s.save(),s.scale(-1,1),s.drawImage(u,44,20,4,12,-8,-8,4,12),s.restore()):s.drawImage(u,36,52,4,12,4,-8,4,12),s.drawImage(u,4,20,4,12,-4,4,4,12),0===f?(s.save(),s.scale(-1,1),s.drawImage(u,4,20,4,12,-4,4,4,12),s.restore()):s.drawImage(u,20,52,4,12,0,4,4,12),n.hasAlphaLayer(c)&&(s.drawImage(c,40,8,8,8,-4,-16,8,8),f>=1&&(s.drawImage(c,20,36,8,12,-4,-8,8,12),s.drawImage(c,44,36,4,12,-8,-8,4,12),s.drawImage(c,52,52,4,12,4,-8,4,12),s.drawImage(c,4,36,4,12,-4,4,4,12),s.drawImage(c,4,52,4,12,0,4,4,12))),o({canvas:t,base64:t.toDataURL("image/png",1)}),r.next=34;break;case 31:r.prev=31,r.t0=r.catch(0),a(r.t0);case 34:case"end":return r.stop()}}),r,null,[[0,31]])})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"skin3dImage",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(function(){var r=a(regeneratorRuntime.mark((function r(o,a){var i,c,u,s,h,f,l,d,y,p,v;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,t||(t=i.getAttribute("data-skin")),t){r.next=4;break}throw new Error("未指定皮肤资源");case 4:return(i=document.createElement("canvas")).width=n.width||600,i.height=n.height||800,r.next=9,e.loadImage(t);case 9:c=r.sent,u=c.image,s=parseFloat(i.getAttribute("data-theta"))||30,h=parseFloat(i.getAttribute("data-phi"))||25,f="true"===i.getAttribute("data-flip"),l="slim"===i.getAttribute("data-model"),(d=e.buildMinecraftModel(u,null,l,f))?((y={canvas:i,animate:!1,model:d,theta:s,phi:h,scene:new THREE.Scene,camera:new THREE.PerspectiveCamera(38,i.width/i.height,40,80),renderer:new THREE.WebGLRenderer({canvas:i,alpha:!0,antialias:!0}),dragState:{},time:90}).camera.position.x=0,y.camera.position.z=60,y.camera.position.y=0,y.camera.lookAt(new THREE.Vector3(0,0,0)),y.scene.add(d),p=new THREE.AmbientLight(16777215,.7),(v=new THREE.DirectionalLight(16777215,.3)).position.set(.67763,.28571,.67763),y.scene.add(p),y.scene.add(v),y.model.rotation.y=e.radians(s),y.model.rotation.x=e.radians(h),e.render(y),o({canvas:i,base64:i.toDataURL("image/png",1)})):a(),r.next=23;break;case 20:r.prev=20,r.t0=r.catch(0),a(r.t0);case 23:case"end":return r.stop()}}),r,null,[[0,20]])})));return function(t,e){return r.apply(this,arguments)}}())}},{key:"skin3d",value:function(t,e){var n=this;return new Promise(function(){var r=a(regeneratorRuntime.mark((function r(o,a){var i,c,u,s,h,f,l,d,y,p,v,w;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,t){r.next=3;break}throw new Error("丢失 canvas 容器");case 3:if(e||(e=t.getAttribute("data-skin")),e){r.next=6;break}throw new Error("未指定皮肤资源");case 6:return r.next=8,n.loadImage(e);case 8:i=r.sent,c=i.image,u=parseFloat(t.getAttribute("data-theta"))||30,s=parseFloat(t.getAttribute("data-phi"))||25,h="true"===t.getAttribute("data-animate"),f="true"===t.getAttribute("data-rotate"),l="true"===t.getAttribute("data-flip"),d="slim"===t.getAttribute("data-model"),(y=n.buildMinecraftModel(c,null,d,l))?((p={canvas:t,animate:h,model:y,theta:u,phi:s,scene:new THREE.Scene,camera:new THREE.PerspectiveCamera(38,t.width/t.height,40,80),renderer:new THREE.WebGLRenderer({canvas:t,alpha:!0,antialias:!0}),dragState:{},time:90}).camera.position.x=0,p.camera.position.z=60,p.camera.position.y=0,p.camera.lookAt(new THREE.Vector3(0,0,0)),p.scene.add(y),v=new THREE.AmbientLight(16777215,.7),(w=new THREE.DirectionalLight(16777215,.3)).position.set(.67763,.28571,.67763),p.scene.add(v),p.scene.add(w),p.model.rotation.y=n.radians(u),p.model.rotation.x=n.radians(s),n.render(p),h&&n.animate(p),f&&n.enableRotation(p),o({canvas:t,renderState:p,animate:{pause:function(){p.animate=!1,n.animate(p)},continue:function(){p.animate=!0,n.animate(p)}},base64:t.toDataURL("image/png",1)})):a(),r.next=24;break;case 21:r.prev=21,r.t0=r.catch(0),a(r.t0);case 24:case"end":return r.stop()}}),r,null,[[0,21]])})));return function(t,e){return r.apply(this,arguments)}}())}}])&&i(e.prototype,n),r&&i(e,r),t}(),"undefined"!=typeof window&&(window.skinRender=new r),"undefined"!=typeof Vue&&(Vue.prototype.skinRender=new r),"undefined"!=typeof jQuery&&jQuery.extend({skinRender:new r})},function(t,e,n){var r=function(t){"use strict";var e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",i=r.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,a=Object.create(o.prototype),i=new _(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return T()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=g(i,n);if(c){if(c===h)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=s(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,i),a}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var h={};function f(){}function l(){}function d(){}var y={};c(y,o,(function(){return this}));var p=Object.getPrototypeOf,v=p&&p(p(R([])));v&&v!==e&&n.call(v,o)&&(y=v);var w=d.prototype=f.prototype=Object.create(y);function m(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){var r;this._invoke=function(o,a){function i(){return new e((function(r,i){!function r(o,a,i,c){var u=s(t[o],t,a);if("throw"!==u.type){var h=u.arg,f=h.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){h.value=t,i(h)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}(o,a,r,i)}))}return r=r?r.then(i,i):i()}}function g(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,g(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var r=s(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,h;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function R(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return a.next=a}}return{next:T}}function T(){return{value:void 0,done:!0}}return l.prototype=d,c(w,"constructor",d),c(d,"constructor",l),l.displayName=c(d,i,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,i,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},m(x.prototype),c(x.prototype,a,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new x(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},m(w),c(w,i,"Generator"),c(w,o,(function(){return this})),c(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=R,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return i.type="throw",i.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),E(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;E(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:R(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}(t.exports);try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},function(t,e,n){"use strict";var r=n(9),o={};o[n(1)("toStringTag")]="z",o+""!="[object z]"&&n(12)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},function(t,e,n){t.exports=!n(6)&&!n(14)((function(){return 7!=Object.defineProperty(n(19)("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(4);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){t.exports=n(10)("native-function-to-string",Function.toString)},function(t,e,n){"use strict";var r,o,a,i,c=n(17),u=n(0),s=n(7),h=n(9),f=n(16),l=n(4),d=n(8),y=n(35),p=n(36),v=n(40),w=n(23).set,m=n(43)(),x=n(24),g=n(44),b=n(45),E=n(46),_=u.TypeError,R=u.process,T=R&&R.versions,S=T&&T.v8||"",k=u.Promise,j="process"==h(R),L=function(){},O=o=x.f,P=!!function(){try{var t=k.resolve(1),e=(t.constructor={})[n(1)("species")]=function(t){t(L,L)};return(j||"function"==typeof PromiseRejectionEvent)&&t.then(L)instanceof e&&0!==S.indexOf("6.6")&&-1===b.indexOf("Chrome/66")}catch(t){}}(),I=function(t){var e;return!(!l(t)||"function"!=typeof(e=t.then))&&e},H=function(t,e){if(!t._n){t._n=!0;var n=t._c;m((function(){for(var r=t._v,o=1==t._s,a=0,i=function(e){var n,a,i,c=o?e.ok:e.fail,u=e.resolve,s=e.reject,h=e.domain;try{c?(o||(2==t._h&&A(t),t._h=1),!0===c?n=r:(h&&h.enter(),n=c(r),h&&(h.exit(),i=!0)),n===e.promise?s(_("Promise-chain cycle")):(a=I(n))?a.call(n,u,s):u(n)):s(r)}catch(t){h&&!i&&h.exit(),s(t)}};n.length>a;)i(n[a++]);t._c=[],t._n=!1,e&&!t._h&&F(t)}))}},F=function(t){w.call(u,(function(){var e,n,r,o=t._v,a=M(t);if(a&&(e=g((function(){j?R.emit("unhandledRejection",o,t):(n=u.onunhandledrejection)?n({promise:t,reason:o}):(r=u.console)&&r.error&&r.error("Unhandled promise rejection",o)})),t._h=j||M(t)?2:1),t._a=void 0,a&&e.e)throw e.v}))},M=function(t){return 1!==t._h&&0===(t._a||t._c).length},A=function(t){w.call(u,(function(){var e;j?R.emit("rejectionHandled",t):(e=u.onrejectionhandled)&&e({promise:t,reason:t._v})}))},G=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),H(e,!0))},D=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw _("Promise can't be resolved itself");(e=I(t))?m((function(){var r={_w:n,_d:!1};try{e.call(t,s(D,r,1),s(G,r,1))}catch(t){G.call(r,t)}})):(n._v=t,n._s=1,H(n,!1))}catch(t){G.call({_w:n,_d:!1},t)}}};P||(k=function(t){y(this,k,"Promise","_h"),d(t),r.call(this);try{t(s(D,this,1),s(G,this,1))}catch(t){G.call(this,t)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(47)(k.prototype,{then:function(t,e){var n=O(v(this,k));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=j?R.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&H(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),a=function(){var t=new r;this.promise=t,this.resolve=s(D,t,1),this.reject=s(G,t,1)},x.f=O=function(t){return t===k||t===i?new a(t):o(t)}),f(f.G+f.W+f.F*!P,{Promise:k}),n(48)(k,"Promise"),n(49)("Promise"),i=n(2).Promise,f(f.S+f.F*!P,"Promise",{reject:function(t){var e=O(this);return(0,e.reject)(t),e.promise}}),f(f.S+f.F*(c||!P),"Promise",{resolve:function(t){return E(c&&this===i?k:this,t)}}),f(f.S+f.F*!(P&&n(50)((function(t){k.all(t).catch(L)}))),"Promise",{all:function(t){var e=this,n=O(e),r=n.resolve,o=n.reject,a=g((function(){var n=[],a=0,i=1;p(t,!1,(function(t){var c=a++,u=!1;n.push(void 0),i++,e.resolve(t).then((function(t){u||(u=!0,n[c]=t,--i||r(n))}),o)})),--i||r(n)}));return a.e&&o(a.v),n.promise},race:function(t){var e=this,n=O(e),r=n.reject,o=g((function(){p(t,!1,(function(t){e.resolve(t).then(n.resolve,r)}))}));return o.e&&r(o.v),n.promise}})},function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var r=n(7),o=n(37),a=n(38),i=n(3),c=n(21),u=n(39),s={},h={};(e=t.exports=function(t,e,n,f,l){var d,y,p,v,w=l?function(){return t}:u(t),m=r(n,f,e?2:1),x=0;if("function"!=typeof w)throw TypeError(t+" is not iterable!");if(a(w)){for(d=c(t.length);d>x;x++)if((v=e?m(i(y=t[x])[0],y[1]):m(t[x]))===s||v===h)return v}else for(p=w.call(t);!(y=p.next()).done;)if((v=o(p,m,y.value,e))===s||v===h)return v}).BREAK=s,e.RETURN=h},function(t,e,n){var r=n(3);t.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n)}catch(e){var a=t.return;throw void 0!==a&&r(a.call(t)),e}}},function(t,e,n){var r=n(20),o=n(1)("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||a[o]===t)}},function(t,e,n){var r=n(9),o=n(1)("iterator"),a=n(20);t.exports=n(2).getIteratorMethod=function(t){if(null!=t)return t[o]||t["@@iterator"]||a[r(t)]}},function(t,e,n){var r=n(3),o=n(8),a=n(1)("species");t.exports=function(t,e){var n,i=r(t).constructor;return void 0===i||null==(n=r(i)[a])?e:o(n)}},function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var r=n(0).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(0),o=n(23).set,a=r.MutationObserver||r.WebKitMutationObserver,i=r.process,c=r.Promise,u="process"==n(5)(i);t.exports=function(){var t,e,n,s=function(){var r,o;for(u&&(r=i.domain)&&r.exit();t;){o=t.fn,t=t.next;try{o()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(u)n=function(){i.nextTick(s)};else if(!a||r.navigator&&r.navigator.standalone)if(c&&c.resolve){var h=c.resolve(void 0);n=function(){h.then(s)}}else n=function(){o.call(r,s)};else{var f=!0,l=document.createTextNode("");new a(s).observe(l,{characterData:!0}),n=function(){l.data=f=!f}}return function(r){var o={fn:r,next:void 0};e&&(e.next=o),t||(t=o,n()),e=o}}},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,n){var r=n(0).navigator;t.exports=r&&r.userAgent||""},function(t,e,n){var r=n(3),o=n(4),a=n(24);t.exports=function(t,e){if(r(t),o(e)&&e.constructor===t)return e;var n=a.f(t);return(0,n.resolve)(e),n.promise}},function(t,e,n){var r=n(12);t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},function(t,e,n){var r=n(13).f,o=n(15),a=n(1)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,a)&&r(t,a,{configurable:!0,value:e})}},function(t,e,n){"use strict";var r=n(0),o=n(13),a=n(6),i=n(1)("species");t.exports=function(t){var e=r[t];a&&e&&!e[i]&&o.f(e,i,{configurable:!0,get:function(){return this}})}},function(t,e,n){var r=n(1)("iterator"),o=!1;try{var a=[7][r]();a.return=function(){o=!0},Array.from(a,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var a=[7],i=a[r]();i.next=function(){return{done:n=!0}},a[r]=function(){return i},t(a)}catch(t){}return n}},function(t,e,n){var r=n(52),o=n(53);n(60)("keys",(function(){return function(t){return o(r(t))}}))},function(t,e,n){var r=n(25);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r=n(54),o=n(59);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e,n){var r=n(15),o=n(26),a=n(56)(!1),i=n(58)("IE_PROTO");t.exports=function(t,e){var n,c=o(t),u=0,s=[];for(n in c)n!=i&&r(c,n)&&s.push(n);for(;e.length>u;)r(c,n=e[u++])&&(~a(s,n)||s.push(n));return s}},function(t,e,n){var r=n(5);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(26),o=n(21),a=n(57);t.exports=function(t){return function(e,n,i){var c,u=r(e),s=o(u.length),h=a(i,s);if(t&&n!=n){for(;s>h;)if((c=u[h++])!=c)return!0}else for(;s>h;h++)if((t||h in u)&&u[h]===n)return t||h||0;return!t&&-1}}},function(t,e,n){var r=n(22),o=Math.max,a=Math.min;t.exports=function(t,e){return(t=r(t))<0?o(t+e,0):a(t,e)}},function(t,e,n){var r=n(10)("keys"),o=n(11);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(16),o=n(2),a=n(14);t.exports=function(t,e){var n=(o.Object||{})[t]||Object[t],i={};i[t]=e(n),r(r.S+r.F*a((function(){n(1)})),"Object",i)}},function(t,e,n){var r=n(16);r(r.S,"Math",{sign:n(62)})},function(t,e){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}}]);